In an earlier thread it was mentioned I could use postfix stop to stop postfix. I'm trying to get sshd started and starting on boot. I did chkconfig sshd on and that worked fine, but then tried sshd start, but that didn't work. It looks like I need to do service sshd start (I did just that and it is now started). Why the difference?
Thanks,
-wes
On Fri, Nov 1, 2013 at 2:18 PM, Wes James comptekki@gmail.com wrote:
In an earlier thread it was mentioned I could use postfix stop to stop postfix. I'm trying to get sshd started and starting on boot. I did chkconfig sshd on and that worked fine, but then tried sshd start, but that didn't work. It looks like I need to do service sshd start (I did just that and it is now started). Why the difference?
'chkconfig' uses comments in the script in /etc/rc.d/init.d/ as hints to make the symlinks in the runlevel directories (/etc/rc.d/rc1.d, etc.) for you and some other convenience operations. The runlevel directories control what happens at startup and shutdown - based on your default runlevel set in /etc/inittab.
'service' executes the script immediately with the argument you provide. If you look at the contents of the script you can see what it does with each argument (stop/start/restart are always handled, other arguments may be).
On Fri, Nov 1, 2013 at 1:33 PM, Les Mikesell lesmikesell@gmail.com wrote:
On Fri, Nov 1, 2013 at 2:18 PM, Wes James comptekki@gmail.com wrote:
In an earlier thread it was mentioned I could use postfix stop to stop postfix. I'm trying to get sshd started and starting on boot. I did chkconfig sshd on and that worked fine, but then tried sshd start, but
that
didn't work. It looks like I need to do service sshd start (I did just that and it is now started). Why the difference?
'chkconfig' uses comments in the script in /etc/rc.d/init.d/ as hints to make the symlinks in the runlevel directories (/etc/rc.d/rc1.d, etc.) for you and some other convenience operations. The runlevel directories control what happens at startup and shutdown - based on your default runlevel set in /etc/inittab.
'service' executes the script immediately with the argument you provide. If you look at the contents of the script you can see what it does with each argument (stop/start/restart are always handled, other arguments may be).
-- Les Mikesell lesmikesell@gmail.com
Thanks. But why do some commands require service service-name command (like sshd) where postfix works without the service command in front of it?
-wes
On Fri, Nov 1, 2013 at 2:49 PM, Wes James comptekki@gmail.com wrote:
Thanks. But why do some commands require service service-name command (like sshd) where postfix works without the service command in front of it?
'service command option' is essentially the same as: /etc/rc.d/init.d/command option so it runs the standard startup/shutdown script.
'command option' is going to run the first instance of 'command' it finds in your execution search $PATH, and then it is up to that command to interpret the option. In other words there is no way to generalize about this case.