Tiny Core Linux
Tiny Core Extensions => TCE Bugs => Topic started by: hiro on March 07, 2013, 12:42:11 PM
-
Sometimes my sshd doesn't restart properly. that's quite bad especially for ssh cause that's the only way of accessing some machines.
I suspect it's because pidof tries to kill not only the main sshd, but also processes from logins that might not even exist any more after killing the main sshd, so pidof gives back bad status.
stop(){
kill $(pidof sshd)
}
restart(){
if pidof sshd >/dev/null; then
stop && start
else
start
fi
}
-
I ran into this problem today and made a change in my openssh init.d script:
stop()
{
pkill /usr/local/sbin/sshd
}
the only draw backs of this solution are that:
1. we assume pkill is available to us.
2. the full pathname is hardcoded -- although it appears the rest of the init.d script assumes the same.
hope that helps
-
Why?
pkill is in /usr/bin and is part of busybox.
-
Hi gerald_clark,
I'm not sure if your "Why?" was directed at my comments or not, but if it was I was merely stating some assumptions I made and pointing out possible faults to my suggestion so that Hiro had some information to make a decision on using my suggestion or not.
Len
-
Hi Len
Gerald_clark was merely pointing out that pkill is always available.