Bug 432870 - telinit 3 does not shut down X
Summary: telinit 3 does not shut down X
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: event-compat-sysv
Version: rawhide
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Casey Dahlin
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: upstart
TreeView+ depends on / blocked
 
Reported: 2008-02-14 20:55 UTC by Bill Nottingham
Modified: 2014-06-18 08:46 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2008-02-26 23:03:47 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Bill Nottingham 2008-02-14 20:55:32 UTC
Description of problem:

SSIA.

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

0.3.9-6.fc9

Comment 1 Scott James Remnant 2008-02-16 16:30:29 UTC
SSIA?

Comment 2 Casey Dahlin 2008-02-17 01:20:26 UTC
Subject Says It All :)

Comment 3 Scott James Remnant 2008-02-17 17:24:25 UTC
Ah.

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 20:22:25 UTC
# prefdm - preferred display manager
#
# Starts gdm/xdm/etc by preference

start on stopped rc5

stop on runlevel [!5]

console output
script
	exec /etc/X11/prefdm
end script


Comment 5 Scott James Remnant 2008-02-19 10:43:53 UTC
Does "stop prefdm" stop X?

Comment 6 Bill Nottingham 2008-02-19 16:54:43 UTC
No.

Comment 7 Bill Nottingham 2008-02-19 16:55:11 UTC
Well, it never returns. So it could be 'failing to stop it correctly.'

Comment 8 Scott James Remnant 2008-02-19 17:04:15 UTC
Could you paste the output from that?

Comment 9 Casey Dahlin 2008-02-19 17:17:44 UTC
Mine does return. I just get a "stop: Job not changed: prefdm"

Comment 10 Scott James Remnant 2008-02-19 17:47:54 UTC
Random question,

does prefdm stay in the foreground while X is running or does it go into the
background?

Comment 11 Bill Nottingham 2008-02-19 18:36:46 UTC
prefdm execs whatever the configured display manager is.

Comment 12 Bill Nottingham 2008-02-19 18:37:55 UTC
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-23 01:39:44 UTC
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-26 01:19:58 UTC
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-26 01:35:30 UTC
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 22:13:19 UTC
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 23:03:47 UTC
Package building now. Closed.


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