I normally use this command to restart my daemons(e.g. vsftpd):
$sudo /etc/init.d/vsftpd restart
Early today I noticed it said that I can try restart(8) utility. I did:
$sudo restart vsftpd
It worked. But when I tried to restart my apache2:
$sudo restart apache2
> restart: Unknown job: apache2
Why are they different? Of course I can restart apache2 by /etc/init.d/apache2
The commands
start
,stop
,restart
, etc., are links forinitctl
, and only work for upstart jobs.Calling directly the script in
/etc/init.d/
will give a warning for upstart jobs, for which the use of the script is allowed for convenience, through a wrapper symlinked common script.Calling the
service
command always works, both for upstart jobs and for traditional sysv init scripts, so it is the preferred way.You should be able to use service: