Gentoo Archives: gentoo-user

From: Stephen Wittig <nofx911@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] SSH won't restart
Date: Tue, 11 Sep 2007 00:54:44
Message-Id: f1c96f570709101740y5e8836f5j7296922bb3475ef7@mail.gmail.com
In Reply to: Re: [gentoo-user] SSH won't restart by Grant
1 The current init script will not try to restart the daemon if
2 everything does not exit cleanly. We already know that the main
3 process won't exit cleanly since it was manually killed.
4
5 Unless you are comfortable editing the init script I would suggest:
6
7 1) Type:
8 ps auxww |grep /usr/sbin/sshd |grep -v grep
9
10 This will give you the process id of the current sshd daemon. Write it
11 down for later use.
12
13 2) On the following page, do steps 1 and 2 (I know this article is
14 specifically related to upgrading sshd on redhat, but these steps are
15 the same for gentoo):
16
17 http://www.hackinglinuxexposed.com/articles/20020319.html
18
19 This will give you a temporary sshd server, so that we can kill off
20 all of your old sshd process, while still giving you access to the
21 machine.
22
23 It will also make sure that there are not any configuration problems
24 with your current sshd_config file that are preventing the daemon from
25 starting.
26
27 If this copy of sshd daemon won't start then we know the problem is a
28 configuration error or that the binary somehow became corrupted.
29
30 3) Kill off the current sshd process from step 1
31 kill -TERM sshd_pid
32 -- or --
33 kill -KILL sshd_pid
34
35 4) Type:
36 /etc/init.d/sshd zap
37
38 DO NOT USE the stop or restart commands - they will kill off your
39 temporary ssh server from step 2
40
41 5) Type:
42 /etc/init.d/sshd start
43
44 6) Try connecting to your server as you normally would. If everything
45 is working, then your can kill off the ssh daemon running on the
46 alternate port.
47
48 If it still doesn't start then its off two round three problem solving...
49
50 -Good Luck, Stephen
51
52 On 9/10/07, Grant <emailgrant@×××××.com> wrote:
53 > > For Grant:
54 > > I reread the init script for sshd, and I know see what was most likely
55 > > the problem. The init script, now, tries to kill all instances with
56 > > the process name of sshd, not just the daemon (as specified by the pid
57 > > file). This is why you were locked out when trying to restart the
58 > > daemon. If you can restart the machine, everything should be working
59 > > fine after a reboot. This behavior differs from every other distro of
60 > > linux that I have used, and with previous versions of the init script.
61 > > Sorry I missed that before emailing the list last time.
62 >
63 > That's alright, I really appreciate your attention. One thing though.
64 > Your init script discovery doesn't explain why sshd wouldn't restart
65 > (stop actually) when I was logged in does it? Given that, do you
66 > still think restarting is the way to go? I'm just trying to make sure
67 > I don't restart and still not have access. That would be bad because
68 > there is a crucial daemon running now that won't come up
69 > automatically.
70 >
71 > Please tell me what you think.
72 >
73 > - Grant
74 > --
75 > gentoo-user@g.o mailing list
76 >
77 >
78 --
79 gentoo-user@g.o mailing list