general question about running scripts.
Stef Bon <stef <at> bononline.nl>
2009-03-26 19:23:57 GMT
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
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. 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.