Running scripts with ConsoleKit.
Stef Bon
stef at bononline.nl
Fri Mar 27 03:30:13 PDT 2009
Hello all,
I'm working with scripts which are started by ConsoleKit. Now this isn't
a question about ConsoleKit, but about
starting a script and not waiting for it to return.
I've been working on a solution to make networkresources available via
autofs on a dynamic way. After login with help
from ConsoleKit a mountpoint is added to the master file of the
automounter. This mountpoint is in the homedirectory of the user logging
in.
This way I've a browseable network map in my home directory for Windows
Networks (via cifs), FTP (via curlftpfs/FUSE) and SSH (with sshfs/FUSE).
Others, like Novell should be possible.
Now, the adding of the mountpoint to the auto.master file (and the
reloading of the autofs daemon) is done by ConsoleKit, which runs
scripts it finds in the some directories (/etc/ConsoleKit/run-session.d)
The problem here is that these script may not too long. This is
problematic, because determinating the networkresources an user
has access to, can take some time, and can even take too much time, when
there are networkproblems, and waiting when logging in is not a good
thing. So, I cannot let ConsoleKit wait for this script to finish. I've
read some where that you can achieve this not waiting behaviour by
adding an "&" after the shell script. An term for this is running
asynchronous. Ok, but now what happens? ConsoleKit does not wait, which
is what I wanted, but it looks like that my "add network mountpoint"
script is running completely ascynchronous. It's calling other programs,
and it looks like everything is running asynchronous, and it's making a
mess of it.
Does anybody know what's happening here and how I can prevent this?
Maybe this hasn't anything to do with ConsoleKit, but more general with
running scripts.
Stef Bon
More information about the hal
mailing list