Bug 49670 - sshd start-up leaves cruft in boot.log
sshd start-up leaves cruft in boot.log
Status: CLOSED RAWHIDE
Product: Red Hat Raw Hide
Classification: Retired
Component: openssh (Show other bugs)
1.0
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Nalin Dahyabhai
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-07-22 20:30 EDT by Jonathan Kamens
Modified: 2008-05-01 11:38 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2003-02-18 16:43:13 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Use "daemon" instead of "initlog" when starting sshd (271 bytes, patch)
2001-07-22 20:30 EDT, Jonathan Kamens
no flags Details | Diff
Fix sshd start-up script boot log cruft without using daemon() (4.60 KB, patch)
2002-03-08 10:50 EST, Jonathan Kamens
no flags Details | Diff

  None (edit)
Description Jonathan Kamens 2001-07-22 20:30:00 EDT
With openssh-server-2.9p2-3, this is what I see in /var/log/boot.log after
sshd starts on reboot:

Jul 22 15:42:55 jik sshd: Starting sshd:
Jul 22 15:42:57 jik sshd:  succeeded
Jul 22 15:42:57 jik sshd: ^[[60G[  
Jul 22 15:42:57 jik sshd: 
Jul 22 15:42:57 jik rc: Starting sshd:  succeeded

This is obviously not formatted correctly.  I believe that the correct fix
for this is to simply use "daemon" instead of using "initlog -c" directly
from the sshd start-up script.  I'll attach a patch to
/etc/rc.d/init.d/sshd.
Comment 1 Jonathan Kamens 2001-07-22 20:30:22 EDT
Created attachment 24547 [details]
Use "daemon" instead of "initlog" when starting sshd
Comment 2 Nalin Dahyabhai 2002-03-07 14:06:15 EST
The daemon() function (in at least certain versions of initscripts, but not the
current version) refuses to start a daemon if it detects it already running, so
if you happen to be logged in via ssh when you try to start it up, it won't
happen unless you call initlog directly.  I'll make a note of this in the
changelog so that I don't forget why it was changed to use initlog in the
future.  Marking as won't fix for this reason (you are correct that daemon() is
generally the correct way to start daemons).
Comment 3 Jonathan Kamens 2002-03-08 10:50:14 EST
OK, I am confused.  You seem to be saying that you can use daemon in the
start-up script in the current version of sshd but not in previous versions.  In
that case, why don't you just fix the bug in Raw Hide rather than marking it
WONTFIX?  Or perhaps mark it DEFERRED instead of WONTFIX?  In other words, I
don't understand why you would mark a but WONTFIX when you've acknowledged that
it should be fixed and *can* be fixed at some later date.

Furthermore, even when using versions of initscripts where daemon won't work in
this context, you can still fix this bug, i.e., get rid of the extra cruft in
the boot log.  I will attach another patch which shows how to do this.
Comment 4 Jonathan Kamens 2002-03-08 10:51:00 EST
Created attachment 47900 [details]
Fix sshd start-up script boot log cruft without using daemon()
Comment 5 Bill Nottingham 2003-02-18 16:43:13 EST
Different fix in initscripts-7.08-1.

Note You need to log in before you can comment on or make changes to this bug.