amazon media file explorer download upload index folder image licenses menu widget Play Pause profile-settings more dots-two-horizontal dots-two-vertical more-vertical pending google-plus hangouts facebook instagram whatsapp spotify telegram twitter vine renren rss youtube twitch vimeo flickr dribble behance deviantart 500px steam github soundcloud skype reddit linkedin lastfm delicious stackoverflow pinterest xing flattr foursquare yelp World

Managing System Processes (Daemons) In Ubuntu

System processes or Mr. daemons are processes that run in the background on your server, most of the time, they start automatically when your server boots.

An example is the OpenSSH Daemon (sshd) which is the daemon for each incoming connection, it listens to the incoming connection without needing input from the user.

Ubuntu 16.04 and above use systems to manage services, with systems services are known as units. The good thing about systems is that it features lots of great tools for managing the services, an example is systemctl command, which allows users to start, stop, and view the status of units on your server.

We would be using OpenSSH as an example, to check the status of a unit, we would use the status keyword, which shows you information regarding the unit, for example, it shows you whether the unit is active(meaning currently running), enabled (meaning its configured to start at boot time), and a host of others, so, let's check the status of ssh:

systemctl status ssh


user@server:~$ systemctl status ssh
● ssh.service - OpenBSD Secure Shell server
   Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2020-06-17 13:24:59 UTC; 2h 28min ago
  Process: 902 ExecStartPre=/usr/sbin/sshd -t (code=exited, status=0/SUCCESS)
 Main PID: 1070 (sshd)
    Tasks: 1 (limit: 2317)
   CGroup: /system.slice/ssh.service
           └─1070 /usr/sbin/sshd -D

Jun 17 13:24:50 systemd[1]: Starting OpenBSD Secure Shell server...
Jun 17 13:24:59 sshd[1070]: Server listening on port 22.
Jun 17 13:24:59 sshd[1070]: Server listening on :: port 22.
Jun 17 13:24:59 systemd[1]: Started OpenBSD Secure Shell server.
Jun 17 13:27:31 sshd[1357]: Accepted publickey for pascal from port 49836 ssh2
Jun 17 13:27:31

You can see how it displays useful information regarding the units, so, in the above output, the name of the ssh unit is actually ssh.service, but it already understood that it is part of the name, so, you don't need to include that.

If the output is condensed, that it is saving the space on the screen, you can append the -l to the see the full log entries, e.g systemctl status -l ssh

Most services in ubuntu will enable it automatically, which means, it would start by itself if your reboot the system, but other services might not, in the case of ssh example above, you can see the vendor preset is set to enabled, which means the next we start the server, ssh will be loaded automatically.

Starting and Stopping a Unit

To stop unit, you use the stop keyword along side the systemctl command, e.g

sudo systemctl stop ssh

and to start, you chang the keyword to start:

sudo systemctl start ssh

The one I like is the restart keyword, this takes care of the start, and stop, it stop the unit, and automatically start it:

sudo systemctl restart ssh

Another useful keyword is the reload command, this is useful with Apache, apache serves web pages to local or remote users, so, you won't want to stop it as this would be disconnected from the website you are serving, so, if you've added some configuration or a new site, and want to only apply the changes you've made with disrupting it from the existing connection, use the reload command:

sudo systemctl reload apache2

If you want to enabled a unit, so, it can start automatically when the server boots, you use the enable keyword, and to disable, you use the disable keyword:

sudo systemctl enable ssh -- to enable


sudo systemctl disable ssh -- to disable

The systemd also features a host of other powerful features, I'll write more guide about it in the future.

Related Post(s)

  • How To Access Windows 10 Drive/Folder in VirtualBox

    To access Windows drive or folder in your Guest OS, you first of all, install VirtualBox guest utilities: sudo apt-get install virtualbox-guest-utils You then Add a shared folder by going into: Setti

  • Send Mail with Attachment Using Mutt in GNU/Linux

    Mutt is a powerful text-based mail client for Unix/Linux operating systems. It features color support, message threading, MIME support...

  • Using Pageant To Automatically Authenticate SSH key in Putty

    I can't count how many times I have typed my ssh key passphrase whenever my ssh connection times out, it is so annoying and repetitive. Well, thanks to the putty pageant, you can do that seamlessly.

  • Installing WP-CLI In a GNU/Linux Server

    WP-CLI is a command-line interface for WordPress. It can also be used with ClassicPress, as they are no differences in their usage, maybe just minimal if you are updating or downloading new ClassicPr

  • How To Send Mail To Multiple Addresses Using (mailx)

    In this guide, you'll learn a couple of ways you can send mail to multiple addresses using mailx. mailx is a utility program for sending and receiving mail. I assume you already have mailx command, i

  • Mounting and Unmounting Cloud Storage With (Rclone) in GNU/Linux

    Ever wondered if you could mount your preferred cloud storage as a virtual drive on your system? Thanks to Rclone, you can mount and access different kinds of cloud storage from a file manager, I'll