Colin Watson <[EMAIL PROTECTED]> writes: > Well, I can tell for a start that the above isn't right because what if > sshd isn't running?
Then no real harm is caused -- but several of the other scripts in network happily test for this sort of thing already. Here is how to do it. The test you are looking for is to check if /var/run/sshd.pid is there, and if so, if the running process is in fact sshd, which is done by checking /proc/pid/exe. if [ -f /var/run/sshd.pid ] then if [ -h /proc/$(cat /var/run/sshd.pid)/exe ] then NAME=$(ls -l /proc/$(cat /var/run/sshd.pid)/exe | sed 's/^.*\///' ) if [ $NAME = "sshd" ] then /etc/init.d/sshd restart fi fi fi This is straightforward. (You should of course test the code.) > That's why I didn't just fix it on the spot, because it isn't > entirely trivial and I wanted to think about it a bit. Well, the code to do what you want is above. See also bug #120199 if you fix the above one. Feel free to bother me if you need any more shell magic like the stuff above written. Perry -- sshd not reconfigured by /etc/network https://bugs.launchpad.net/bugs/103436 You received this bug notification because you are a member of Ubuntu Bugs, which is the bug contact for Ubuntu. -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs