difference between restarting a daemon and a service
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Can you please clear me the difference between restarting the daemon and the service. To be more clear,
/etc/init.d/mysqld restart
and
/etc/init.d/mysqld restart
What is the difference on this both two?.....
There is no difference between the 2, as far as the command lines you quoted here is concerned. They are exactly the same, aren't they?
Do you mean "service mysqld restart"? I think it depends on the distribution. You may take a look at /sbin/service anyway. It helps you so that you don't have to memorise the path "/etc/init.d" anyway, if it really helps at all.
Thank you for your reply. ok, what is the main different between restarting the service via
service mysqld restart
and
/etc/init.d/mysqld restart
Do you find any difference on this, May be it depends on the distribution? I am sure that both the commands does not have any similar options.
And I am still not clear with my main doubt. ?>?????
"service mysqld restart" is a wrapper which actually executes "/etc/init.d/mysqld restart". You may look at the source code /sbin/service
Some distribution like ubuntu doesn't have /sbin/service installed by default. I personally never use it. I always use "/etc/init.d/mysqld restart" which I think is more direct, don't you?
There is no practical difference as far as mysqld is concerned.
The 'service' cmd simply enables users/script to not worry about exactly where the startup script happens to be located.
The service script can also be extended to do other custom actions for a given service that the default script will not take care of. Its basically a wrapper.
A daemon is simply an infinite loop running detached from the terminal. It won't respond to service cmds unless you've setup the init.d scripts to match.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.