I'm trying to understand the Linux init system. I don't understand how there are three competing systems, yet the service command seems to work on all of them.

From the service commands man page:

service runs a System V init script or upstart job...

I'm using lubuntu 16.4 I think systemd is the default init system (pstree shows systemd as root process). Systemd is not mentioned in the man page for service. Yet I still start and stop scripts using it.

Can anyone explain why this is?

  • Quite a few distros provide compatability scripts to emulate sysvinit functionality during the transition so that people have time to adjust.
    – jasonwryan
    May 4 '16 at 19:10
  • Or, if they're like me, keep using the old compatibility scripts and get blindsided when they're no longer supported (:
    – DopeGhoti
    May 4 '16 at 19:14
  • If you have a look at /usr/sbin/service you'll probably find it's a shell script with code to handle upstart, systemd and init.d style scripts. May 4 '16 at 19:15
  • Ubuntu isn't a "real" systemd distro, upstart is still there, and most of systemctl service management is still done using the old style.
    – cylgalad
    May 5 '16 at 8:20

Some distributions have opted to include compatibility scripts so that old style commands still work. For example, on Debian 8.

root@matrix:~# which service
root@matrix:~# file /usr/sbin/service
/usr/sbin/service: POSIX shell script, ASCII text executable, with very long lines

root@matrix:~# grep upstart /usr/sbin/service
# Operate against system upstart, not session
   && initctl version 2>/dev/null | grep -q upstart \
   # Upstart configuration exists for this job and we're running on upstart
         # Action is a valid upstart action

root@matrix:~# grep systemd /usr/sbin/service
if [ -d /run/systemd/system ]; then
          # On systems using systemd, we just perform a normal restart:
          # A restart with systemd is already a full restart.
          if [ -n "$is_systemd" ]; then
# When this machine is running systemd, standard service calls are turned into
if [ -n "$is_systemd" ]
            # the systemd service file does not (yet) support reload for a

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.