[ConsoleKit] need better way to start sessions
Stef Bon
stef at bononline.nl
Wed Mar 3 10:18:04 PST 2010
On Tuesday 02 March 2010 17:16:29 Yclept Nemo wrote:
> As more applications start depending on consolekit, the current method
> to attach ck sessions is growing inadequate:
>
> in ~/.xinitrc
> "exec ck-launch-session window_manager"
>
> So far:
> polkit-gnome-authentication-agent
> dbus ?
> pulseaudio
>
> to varying degrees all need to be started after the consolekit session
> is initialized. Traditionally applications are started in ~/.xinitrc.
> Now it seems they no longer can be. Alternatives don't appear that
> feasible:
>
> 1) run the necessary programs afterwards in window-manager
> initialization scripts.
> - window-managers were not designed to start programs. Some
> minimalistic window-managers would require adjustments or redesign or
> bulky work-arounds to allow this.
>
> 2) in ~/.xserverrc run "exec ck-launch-session /usr/bin/X -nolisten tcp"
> - doesn't work (tested): X is not a parent process of its clients
>
Huh?
> 3) in ~/.xinitrc run all the files in ~/.xinitrc.d/*
> - bulky redhat-ism (split everything up)
> - Since it seems access to consolekit is decided on process
> parentage (ppid) implementation won't work: processes from
> ~/.xinitrc.d/* would be owned by init
> $ cat ~/.xinitrc
> files=(~/.xinitrc.d/*)
> for i in "${files[@]:0:${#files[@]}-1}"; do
> "${i}"
> done
> exec "${files[@]: -1}"
> echo "finished"
>
> 4) in ~/.xinitrc call a manual chain of "xinitrc_afterwards scripts"
> For example:
> exec ck-launch-session (one_process &; two_process &; exec window_manager)
> - bulky workaround
> - illegible syntax
> - variation on (3)
>
Have you thought about upstart? CK is not a tool to start session, only to
report about changes in them. There is this ck-lauch-session tool, but it is
old, and used in older releases of CK. Correct me if I'm wrong, it was
intended to report a session is started, but this is now done by PAM
integration and the CK daemon. Maybe it's of any use when the app is not using
PAM.
With upstart you can trigger an event like "session-started" (and add the
right parameters). You can now start everything you want to when this event
occurs, you only need to program the various upstart event files.
Stef Bon
More information about the ConsoleKit
mailing list