Thursday, May 2, 2024
 Popular · Latest · Hot · Upcoming
8
rated 0 times [  8] [ 0]  / answers: 1 / hits: 2447  / 2 Years ago, thu, february 17, 2022, 8:50:54

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


More From » restart

 Answers
2

The commands start, stop, restart, etc., are links for initctl, 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.


[#44114] Friday, February 18, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
warrdel

Total Points: 356
Total Questions: 103
Total Answers: 118

Location: Bangladesh
Member since Sat, Jan 23, 2021
3 Years ago
;