Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 277007 - =net-misc/openssh-5.2_p1-r2, /etc/init.d/sshd reload is misguiding
Summary: =net-misc/openssh-5.2_p1-r2, /etc/init.d/sshd reload is misguiding
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-08 09:15 UTC by Michał Górny
Modified: 2009-07-19 05:54 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2009-07-08 09:15:30 UTC
The 'reload' actions for rc.d script suggests that application will try to reload configuration without restarting itself (and thus disconnecting all current users).

While for most daemons 'reload' behaves that way, in openssh it just causes server to restart. Moreover, it doesn't even check whether the config is correct, so it can cause openssh to not start again.

Such behavior is simply misguiding and can cause serious issues. In my opinion we should remove 'reload' function from rc.d to avoid misuse. I think we can also use the function as 'restart' as this is what it does.
Comment 1 Wormo (RETIRED) gentoo-dev 2009-07-12 01:25:27 UTC
Hm that's true, it does restart the server rather than HUP it to reload config. I don't see why it doesn't just send a HUP...

Thanks for the report, assigning to maintainers.
Comment 2 SpanKY gentoo-dev 2009-07-12 03:33:36 UTC
the init.d script's reload() does send the HUP signal only.  it doesnt restart the daemon.  the behavior you're complaining about most likely is with sshd, not the init.d script.

reload() {
        ebegin "Reloading ${SVCNAME}"
        start-stop-daemon --stop --signal HUP --oknodo \
            --exec "${SSHD_BINARY}" --pidfile "${SSHD_PIDFILE}"
        eend $?
}

# pgrep -f -l /usr/sbin/sshd
9065 /usr/sbin/sshd
# kill -HUP 9065
# pgrep -f -l /usr/sbin/sshd
9076 /usr/sbin/sshd

we can add a call to 'checkconfig' to the top of the reload() function, but we're not going to drop it
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2009-07-12 10:20:57 UTC
(In reply to comment #2)
> we can add a call to 'checkconfig' to the top of the reload() function, but
> we're not going to drop it

I think that would be a good solution.