views:

51

answers:

1

I have a daemon script written in ruby which responds to commands like daemon start and daemon stop. It's executable with shebang #!/usr/bin/env ruby and it works invoked from terminal. I need to start the daemon on login and stop it on logout.

Background info: KDE, zsh.

I already tried to make two separate shell scripts with daemon start and daemon stop and place them in ~/.kde4/Autostart | ~/.kde4/shutdown. The scripts start.sh and stop.sh are working in terminal, but no luck in autostart or shutdown.

I can't put them in .zshrc respectively .zlogout, because I start many login shells in a work session.

So I am stuck :) Any ideas?

Update: F1 => Help :)

A: 

You could try running the program as an autostart app, and then have it watch to see when its parent (probably the session manager) stops running.

Ignacio Vazquez-Abrams
@Ignacio Vazquez-Abrams - Unfortunately `The desktop environment MAY ignore Autostart files altogether based on policy set by the user, system administrator or vendor.` citing from provided link, this makes me to don't accept your answer as reliable.
kfl62
You can either play nice, or you can have people roll their eyes because of the experiences they've had in getting their systems hijacked in all the wrong places.
Ignacio Vazquez-Abrams
@Ignacio Vazquez-Abrams - I agree with you, but as I wrote in question sort of `autostart` app does not work on kde. We are talking about [this application](http://github.com/kfl62/MPD-DBus-Kopete) which is KDE specific and I wish to complete installation instructions with an response posted here (if any). I don't think that providing reliable install/use instructions means hijacking.
kfl62