SIGHUP fails to restart (3.6.1p2 -> 3.7p1)

Phil Howard phil-openssh-unix-dev at
Wed Sep 17 06:30:54 EST 2003

I have the sshd daemon located at /sbin/ssh_22 in this scenario (because I have
more than one daemon with separate executable images).  After upgrading from
3.6.1p2 to 3.7p1, with the /sbin/ssh_22 copy replaced by mv (not by writing
over the existing image), I do SIGHUP and get this message logged:

Sep 16 15:07:36 vega sshd_22[22552]: Received SIGHUP; restarting.
Sep 16 15:07:36 vega sshd_22[22552]: RESTART FAILED: av[0]='/sbin/sshd_22', error: Bad address.

Relevant source code looks like:

 * Called from the main program after receiving SIGHUP.
 * Restarts the server.
static void
        logit("Received SIGHUP; restarting.");
        execv(saved_argv[0], saved_argv);
        logit("RESTART FAILED: av[0]='%.100s', error: %.100s.", saved_argv[0],

The process is now gone.  After coming back in via my backdoor port (still on
sshd version 3.6.1p2 ... now you can see why I run separate images), I find
I can simply restart the port 22 instance and now it works fine.

So I repeat the SIGHUP, this time with 3.7p1 running, which will as shown in
the source code above, re-run the same executable path, which this time is
the same image file as it is currently running.  This time it works OK.

So for yet another test, I make a copy of the executable image, and mv the
new copy in place of the one that is running.  So now it's a different inode
to be run than is running, although the images are identical.  This also runs

1. So what's the deal?
2. Was 3.6.1p2 broken in that respect?
3. Make a saved arg after av[0] was invalid?
4. Is there some weird sensitivity to a version change?
5. What is the "correct" way to upgrade a _remote_ machine (and not get locked
   out in the process)?

| Phil Howard KA9WGN       | |
| (first name) at | |

More information about the openssh-unix-dev mailing list