Bug 826720
Summary: | sshd initscript clobbers other sshd processes. | ||||||
---|---|---|---|---|---|---|---|
Product: | Red Hat Enterprise Linux 6 | Reporter: | Rick Houser <rick.houser> | ||||
Component: | openssh | Assignee: | Petr Lautrbach <plautrba> | ||||
Status: | CLOSED ERRATA | QA Contact: | Jiri Jaburek <jjaburek> | ||||
Severity: | medium | Docs Contact: | |||||
Priority: | medium | ||||||
Version: | 6.2 | CC: | jbastian, jjaburek, pattonme, pvrabec, syeghiay | ||||
Target Milestone: | rc | ||||||
Target Release: | --- | ||||||
Hardware: | All | ||||||
OS: | Linux | ||||||
Whiteboard: | |||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2013-02-21 10:27:53 UTC | Type: | Bug | ||||
Regression: | --- | Mount Type: | --- | ||||
Documentation: | --- | CRM: | |||||
Verified Versions: | Category: | --- | |||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
Cloudforms Team: | --- | Target Upstream Version: | |||||
Embargoed: | |||||||
Bug Depends On: | |||||||
Bug Blocks: | 782183, 836160, 840699 | ||||||
Attachments: |
|
Description
Rick Houser
2012-05-30 20:31:10 UTC
The init script needs a complete rethink and rewrite. All variables moved to /etc/sysconfig/`basename $0`, variables derived dynamically from /etc/ssh/sshd_config or other specified file, etc. Created attachment 624155 [details]
fixed sshd.init
This is fixed sshd.init using "killproc -p $PID_FILE $SSHD". It's also slightly changed to simplify process of creating multiple sshd instances. Following steps should work to setup a second sshd instance on the port 2222:
# cp /etc/init.d/sshd /etc/init.d/sshd-second
# cp /etc/sysconfig/sshd /etc/sysconfig/sshd-second
# echo 'OPTIONS="-f /etc/ssh/sshd_config-second -p 2222 -o PidFile=/var/run/sshd-second.pid"' >> /etc/sysconfig/sshd-second
(plus some SELinux changes)
> # echo 'OPTIONS="-f /etc/ssh/sshd_config-second -p 2222 -o
> PidFile=/var/run/sshd-second.pid"' >> /etc/sysconfig/sshd-second
If you use -f /etc/ssh/sshd_config-second then you also need to change SSHD_CONFIG variable in the new sshd-secong initscript
Comment on attachment 624155 [details]
fixed sshd.init
This initscript is wrong.
Starting S15sshd: [ OK ]
> The initscript does unsafe things that interfere with other ssh daemons, > like this: > > killproc $SSHD > > The PID file is already available as a variable, so the killproc should > probably look something like this: > > killproc -p $PID_FILE $SSHD will be fixed in next release. Thanks. > > It looks like a similar problem may be affecting the configuration > validation, etc. (In reply to comment #3) > The init script needs a complete rethink and rewrite. All variables moved to > /etc/sysconfig/`basename $0`, variables derived dynamically from > /etc/ssh/sshd_config or other specified file, etc. This would need big change with high regression risc, bugs and so, see my comment #c6. This scripts hasn't been supposed to be used in multinstance environment. I won't do this. Sorry. Please fix your sshd.init copies to avoid problems with configuration validation, sysconfig file and so. Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHSA-2013-0519.html |