LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   difference between restarting a daemon and a service (https://www.linuxquestions.org/questions/linux-server-73/difference-between-restarting-a-daemon-and-a-service-741360/)

gsiva 07-20-2009 05:40 AM

difference between restarting a daemon and a service
 
Hi,

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?.....

whho 07-20-2009 05:50 AM

Quote:

Originally Posted by gsiva (Post 3613658)
Hi,

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.

Hope it helps!

gsiva 07-20-2009 06:03 AM

Hi,

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. ?>?????

whho 07-20-2009 06:18 AM

Quote:

Originally Posted by gsiva (Post 3613689)
Hi,

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?

gsiva 07-20-2009 06:39 AM

Yes I to use both of the commands to restart the service.

I am not in a clear state, with the difference in restarting the service with the daemon and the service under the daemon?....

I hope it makes sense ...

chrism01 07-20-2009 08:16 PM

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.

gsiva 07-21-2009 05:49 AM

Thank you Chris, I am quite clear now... Thank you for your update........


All times are GMT -5. The time now is 11:48 PM.