How about using /etc/rc.d/ scripts with 'su user' to start the program as the relevant user (as per the rtorrent wiki suggestion, https://wiki.archlinux.org/index.php/Rtorrent#rtorrent_Daemon_with_screen), and then sudo permissions to run 'sudo /etc/rc.d/foo start/stop' in .xinitrc and .bash_logout? On 15:15, Mon 20 Jun 2011, XeCycle wrote: > Date: Mon, 20 Jun 2011 15:15:14 +0800 > From: XeCycle <xecycle@xxxxxxxxx> > Subject: [arch-general] Anything to manage user daemons? > To: General Discussion about Arch Linux <arch-general@xxxxxxxxxxxxx> > Reply-To: General Discussion about Arch Linux <arch-general@xxxxxxxxxxxxx> > List-Id: General Discussion about Arch Linux <arch-general.archlinux.org> > > Hello. I need to start several programs after login and > after startx. Now I write these directly in my .bash_profile > and .xinitrc; but I'm not satisfied with this. They cannot > be easily stopped after logout. To do that I think I'd > record their PID and kill them in .bash_logout, also need to > take care when they're manually stopped, and all these > related problems. > > So I think a set of scripts like the daemon managing from > initscripts will be nice. But I can't write /etc/rc.d > daemons, as they must be executed by a normal user. > > Has anyone written such a tool? > > Thank you. > > -- > Carl Lei (XeCycle) > Department of Physics, Shanghai Jiao Tong University > OpenPGP public key: 7795E591 > Fingerprint: 1FB6 7F1F D45D F681 C845 27F7 8D71 8EC4 7795 E591 > Facebook: Carl Lei > Twitter: XeCycle > Blog: http://xecycle.blogspot.com > Mon, 20 Jun 2011 15:04:17 +0800