[Bug 926468] Re: Stopping ssh with a logged in user causes init to spin at 100%
Jason Conti
926468 at bugs.launchpad.net
Sat Feb 4 22:04:51 UTC 2012
I think the attached source file, along with a simple upstart conf with:
exec /path/to/test-daemon may be a minimal example of the behavior.
sshd is spawned by upstart with -D so the initial process doesn't
daemonize. The upstart logging mechanism will setup a pty for
stdout/stderr. When receiving a connection, sshd forks and daemonizes,
but looking at /proc/pid/fd/ it appears to omit redirecting stderr to
/dev/null, so the pty is still opened on fd 2.
So when the ssh service is stopped, the inital sshd instance run with -D
is terminated, but the child sshd keeps running and still has the pty
open. Then when upstart flushes the log and waits for the fd to error
out in log_read_watch, it loops forever with EAGAIN until the child
exits.
I think that is what is going on anyway, and the attached code exhibits
similar behavior.
** Attachment added: "test-daemon.c"
https://bugs.launchpad.net/ubuntu/+source/upstart/+bug/926468/+attachment/2714997/+files/test-daemon.c
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to upstart in Ubuntu.
https://bugs.launchpad.net/bugs/926468
Title:
Stopping ssh with a logged in user causes init to spin at 100%
Status in “upstart” package in Ubuntu:
Triaged
Status in “upstart” source package in Precise:
Triaged
Bug description:
Steps to reproduce:
1) Boot the machine with --log on the kernel command line
2) Log into the machine through ssh
3) Execute: sudo stop ssh;
4) The init process will spin with EAGAIN on one if its file descriptors
5) Exit the remote ssh session and the service will stop
The process appears to be looping in init/log.c:log_read_watch.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/upstart/+bug/926468/+subscriptions
More information about the foundations-bugs
mailing list