Gentoo Archives: gentoo-user

From: Alex Schuster <wonko@×××××××××.org>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] SSH won't restart
Date: Sat, 08 Sep 2007 21:04:38
Message-Id: 200709082250.20774.wonko@wonkology.org
In Reply to: Re: [gentoo-user] SSH won't restart by Josh Cepek
1 Josh Cepek writes:
2
3 > I had a similar issue after a previous update to ssh when I went to
4 > restart it to get it to use the new binaries. One of the nice features
5 > of sshd is that your current session will say active even if you kill
6 > the sshd daemon process. Of course, if you get disconnected then you
7 > will not be able to log back in, so it's good to do what you need to
8 > quickly if you do need to kill (or if it's really stuck, kill -9) the
9 > process. When I had this problem I issued a `kill -9 PID_NUMBER &&
10 > /etc/init.d/sshd start` - just be *sure* that you're killing the
11 > /usr/sbin/sshd process and not one of your sshd login forks at the same
12 > time.
13 >
14 > Alex Schuster wrote:
15 > > If you think the upgrade is necessary and don't want to wait until you
16 > > or s.o. else has physical access in case sshd doesn't come up again,
17 > > you could
18 > > try to restart sshd manually by issuing a "kill -SIGHUP $( pidof sshd
19 > > )".
20 >
21 > I don't recommend doing this as it will also kill your current ssh
22 > session. If for some reason the SIGHUP doesn't take correctly on the
23 > listening daemon you will find yourself locked and kicked out of the
24 > server. Use top or htop to determine the actual PID of the daemon only.
25
26 Oh, whoops! Big mistake, you are right - sorry for that, this was bad
27 advice. I did not think about these other sshd processes. Thanks for being
28 watchful and pointing this out.
29 Still, I would prefer -HUP instead of -9, as this would make the sshd server
30 restart itself. Just in case /etc/init.d/sshd start also makes trouble - it
31 really shouldn't, but neither should /etc/init.d/sshd stop.
32
33 Alex
34 --
35 gentoo-user@g.o mailing list

Replies

Subject Author
Re: [gentoo-user] SSH won't restart Dan Farrell <dan@×××××××××.cx>