When you run the service sshd command, where the option can be reloaded / restarted, it actually starts the program with a modified environment:
env -i PATH="$PATH" TERM="$TERM" "${SERVICEDIR}/${SERVICE}" ${OPTIONS}
eg:.
env -i PATH=/sbin:/usr/sbin:/bin:/usr/bin TERM=xterm /etc/init.d/sshd reload
The sshd command does almost the same thing in both cases (reboot / reboot):
reload: trying to kill the process sending the HUP signal, and, as you can see in the snap, this requires the PID of the process. (It works whether sshd is running)
reload() { echo -n $"Reloading $prog: " if [ -n "`pidfileofproc $SSHD`" ] ; then killproc $SSHD -HUP else failure $"Reloading $prog" fi RETVAL=$? echo }
restart: it will do the same as if you did stop-> start.
restart() { stop start } start() { [ -x $SSHD ] || exit 5 [ -f /etc/ssh/sshd_config ] || exit 6
nay743
source share