Monitoring services and starting them on boot From wikipedia Systemd is a software suite that provides fundamental building blocks for a Linux operating system. It includes the systemd “System and Service Manager”, an init system used to bootstrap user space and manage user processes. systemd aims to unify service configuration and behavior across Linux distributions. Before going gaga over checkout it as well. But personally I find it easy to manage. Since I am not well versed in Linux it helps me make less blunders and miss out on doing some things because of lazyness and unfamiliarity. I use a command called Check if it is supported in your Linux Distro or not. systemd arguments against systemctl. # which systemctl/bin/systemctl Handy Commands Start an application sudo systemctl start application#Examplesudo systemctl start nginx Stop an application sudo systemctl stop application#Examplesudo systemctl stop nginx Restart an application sudo systemctl restart application#Examplesudo systemctl restart nginx Reload an application sudo systemctl reload application#Examplesudo systemctl reload nginx Check status sudo systemctl status application#Examplesudo systemctl status nginx Example output of status nginx.service - A high performance web server and a reverse proxy server ● Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled) Active: since Wed 2019-01-30 11:29:16 IST; 1 weeks 0 days ago active (running) Docs: man:nginx(8) Main PID: 909 (nginx) Tasks: 2 (limit: 1152) CGroup: /system.slice/nginx.service ├─909 nginx: master process /usr/sbin/nginx -g daemon on; master_process on; └─911 nginx: worker process Jan 30 11:29:15 ubuntu-s-1vcpu-1gb-blr1-01-monitoring systemd[1]: Starting A high performance web server and a reverse proxy server... Jan 30 11:29:16 ubuntu-s-1vcpu-1gb-blr1-01-monitoring systemd[1]: nginx.service: Failed to parse PID from file /run/nginx.pid: Invalid argument Jan 30 11:29:16 ubuntu-s-1vcpu-1gb-blr1-01-monitoring systemd[1]: Started A high performance web server and a reverse proxy server. Check if active If you are using a monitoring service like and need to check if a service is active you can use zabbix # systemctl is-active nginx active Ready for Restart Inspite of all the precautions we take there will be scenarios where things fail. As debugging might take more time and can put your application or service out of action, we might be forced to restart our server. Making sure that everything works on a restart is hence very critical. List all loaded units systemctl | grep loaded | awk '{print $1;}' list-units -all List all enabled units systemctl | grep enabled | awk '{print $1;}' > enabled.txt list-unit-files Most of the times we need to make sure that all the services we use are in the start up script. List all loaded services systemctl | grep service | grep loaded | awk '{print $1;}' list-units -all List all enabled services systemctl | grep service | grep enabled | awk '{print $1;}' > enabled.txt list-unit-files To find the list of services which are loaded but not enabled we can do the following. systemctl | grep service | grep loaded | awk '{print $1;}' > loaded.txtsystemctl | grep service | grep enabled | awk '{print $1;}' > enabled.txtdiff -y loaded.txt enabled.txt#If you want a quick glance of missing ones you can also usediff -y loaded.txt enabled.txt | grep '<' list-units -all list-unit-files I know this is not fool proof but it can give you quick glance of missing services. Docker, Ansible et al Making sure that your server works as expected even after restarts lets you sleep with ease at night. We are considering moving our workflow to Docker and Ansible. That will take some time. Until then we will do with a general setup, hacks like these and a monitoring tool like . Hope it helps you. Zabbix If you liked this article and would like to read similar articles, don’t forget to clap. Click and drag to clap more than once. 50 is the limit. You can read the others articles from the series. _I have had a kind of “love and hate” relationship with JavaScript. But nevertheless JavaScript was always intriguing…_hackernoon.com Understanding promises in JavaScript _Async and Await are extensions of promises. So if you are not clear about the basics of promises please get comfortable…_hackernoon.com Understanding async-await in Javascript — Gokul N K — Medium _I recently read a medium post where the author claimed that using async-await is better than using promises. While this…_hackernoon.com Should I use Promises or Async-Await If you are interested in cryptocurrencies checkout _“Never Invest In Something You Don’t Understand”_hackernoon.com 10 things to know/do before investing in cryptocurrencies _It has been more than an year since I started investing in cryptocurrencies. Following Warren Buffet’s advice of “Never…_hackernoon.com Beginner’s Guide to “Investing in Cryptocurrencies” _Price is an important indicator. But it can also be misleading in many cases._blog.goodaudience.com Why comparing cryptocurrency prices is wrong