Bug 432870 - telinit 3 does not shut down X
telinit 3 does not shut down X
Product: Fedora
Classification: Fedora
Component: event-compat-sysv (Show other bugs)
All Linux
low Severity low
: ---
: ---
Assigned To: Casey Dahlin
Fedora Extras Quality Assurance
Depends On:
Blocks: upstart
  Show dependency treegraph
Reported: 2008-02-14 15:55 EST by Bill Nottingham
Modified: 2014-06-18 04:46 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2008-02-26 18:03:47 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Bill Nottingham 2008-02-14 15:55:32 EST
Description of problem:


Version-Release number of selected component (if applicable):

Comment 1 Scott James Remnant 2008-02-16 11:30:29 EST
Comment 2 Casey Dahlin 2008-02-16 20:20:26 EST
Subject Says It All :)
Comment 3 Scott James Remnant 2008-02-17 12:24:25 EST

This one is slightly interesting, are you running X from an event.d script?

Could you attach that if you are.
Comment 4 Bill Nottingham 2008-02-18 15:22:25 EST
# prefdm - preferred display manager
# Starts gdm/xdm/etc by preference

start on stopped rc5

stop on runlevel [!5]

console output
	exec /etc/X11/prefdm
end script
Comment 5 Scott James Remnant 2008-02-19 05:43:53 EST
Does "stop prefdm" stop X?
Comment 6 Bill Nottingham 2008-02-19 11:54:43 EST
Comment 7 Bill Nottingham 2008-02-19 11:55:11 EST
Well, it never returns. So it could be 'failing to stop it correctly.'
Comment 8 Scott James Remnant 2008-02-19 12:04:15 EST
Could you paste the output from that?
Comment 9 Casey Dahlin 2008-02-19 12:17:44 EST
Mine does return. I just get a "stop: Job not changed: prefdm"
Comment 10 Scott James Remnant 2008-02-19 12:47:54 EST
Random question,

does prefdm stay in the foreground while X is running or does it go into the
Comment 11 Bill Nottingham 2008-02-19 13:36:46 EST
prefdm execs whatever the configured display manager is.
Comment 12 Bill Nottingham 2008-02-19 13:37:55 EST
As for the hang I was seeing, SELinux is preventing it from working; without
SELinux I see the 'job not changed' that Casey does.
Comment 13 Casey Dahlin 2008-02-22 20:39:44 EST
I have a quick solution to this. Edit /etc/X11/prefdm and anywhere it runs
/usr/sbin/gdm add the --no-daemon parameter. Haven't tested this issue with
kdm/xdm/et cetera.

gdm itself forks automatically, that's where the issue lies. Scott has a
somewhat controversial but ultimately effective way of getting around forking
daemons via ptrace (It will be interesting to see how it fares given that gdm
forks the holy hell out of itself). It may be worth trying to get in early.

There may also be a more upstarty way of replacing prefdm entirely with an event.
Comment 14 Kevin Kofler 2008-02-25 20:19:58 EST
KDM accepts a -nodaemon switch, it also accepts --nodaemon, but 
not --no-daemon. I don't think ptrace hackery is a good idea.
Comment 15 Casey Dahlin 2008-02-25 20:35:30 EST
That's more upstream's decision. I do think its probably the only available
solution to the fork issue long term, and its done in a fairly benign way, so I
intend to support them in it. If we set up daemons that don't fork, then it
won't affect us at all.
Comment 16 Bill Nottingham 2008-02-26 17:13:19 EST
Whooops, this is simpler than we made it out to be.

The old inittab event is:

x:5:respawn:/etc/X11/prefdm -nodaemon

Ergo, the upstart event should be -nodaemon as well - this should just be
changed in the upstart event, not /etc/X11/prefdm.
Comment 17 Casey Dahlin 2008-02-26 18:03:47 EST
Package building now. Closed.

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