Ubuntu – Which init daemon starts cups

initinit.dservicesupstart

I have a fresh installation of Ubuntu 14.04, and have not touched anything.

Cups is running, as reported by both ps and netstat.

There are /etc/init/cups.conf and /etc/init.d/cups, both of them seem to be able to start cups.

I used these ways to determine which init daemon started cups:

  • service cups status – "unknown job: cups"
  • initctl status cups – "unknown job: cups"
  • /etc/init.d/cups status – "cupsd is running"
  • Runlevel is 2, and there is no cups in /etc/rc2.d

So the question is: which init daemon started cups? The traditional Debian init, or upstart?

If upstart was the one started cups, why initctl status cups cannot report cups status?

Best Answer

Of the two, only one is actually an init script: /etc/init.d/cups. The /etc/init/cups.conf file appears to be a configuration file and runs certain things before/after the daemon is started but it is not itself an init script. It lacks the proper format (start,stop,restart etc. functions) and in any case, is not in the right place. Init scripts are in the init.d directory.

As for who started it, 14.04 is still using upstart, they will be moving to systemd for future releases. So it was upstart that started the cups daemon.

Now, as to why neither service nor initctl returned anything useful, that's because you did not use sudo:

terdon@16:~$ service cups status
status: Unknown job: cups
terdon@16:~$ sudo service cups status
[sudo] password for terdon: 
cups start/running, process 1319

terdon@16:~$  initctl status cups 
initctl: Unknown job: cups
terdon@16:~$ sudo initctl status cups 
cups start/running, process 1319