[arch-general] Anything to manage user daemons?
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
Try these guys supervisord daemontools :-) On Mon, Jun 20, 2011 at 2:15 PM, XeCycle <xecycle@gmail.com> wrote:
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
-- Nguyễn Châu An || An NGUYEN Linux Technician & FOSS Advocate ------- OpenPGP KeyID 2048R/8F77A48C Key Fingerprint 7652 B403 749F F173 227D 4865 FB71 EC95 8F77 A48C
On Mon, 20 Jun 2011 14:19:47 +0700 An Nguyen <an.nguyen.foss@gmail.com> wrote:
Try these guys supervisord daemontools
:-)
those look neat. I wonder how they compare to each other and to systemd (which is designed to deal with system- and user level daemons as well) Dieter
Yes I am also curious about this, systemd (which I've been using for some time) would appear to be the ideal solution to this. However I find the interface for controlling daemons etc (using commands like `sudo systemctl restart openntpd.service') to be somewhat clunky. Maybe someone knows of a more elegant way to use systemd so as to not require extra tools like supervisord/daemontools? -- Evan LeCompte On Mon, Jun 20, 2011 at 3:51 AM, Dieter Plaetinck <dieter@plaetinck.be>wrote:
On Mon, 20 Jun 2011 14:19:47 +0700 An Nguyen <an.nguyen.foss@gmail.com> wrote:
Try these guys supervisord daemontools
:-)
those look neat. I wonder how they compare to each other and to systemd (which is designed to deal with system- and user level daemons as well)
Dieter
On Mon, 20 Jun 2011 15:15 +0800, "XeCycle" <xecycle@gmail.com> wrote:
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.
Instead of doing exec startx, you can background startx and wait for it, allowing your script to complete and clean things up. I don't know of a specific tool for managing user processes though, however you could "copy" rc.d/? files and amend them for your own usage. ~/.xinitrc: #! /bin/bash start stuff startx & wait $? stop stuff
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@gmail.com> Subject: [arch-general] Anything to manage user daemons? To: General Discussion about Arch Linux <arch-general@archlinux.org> Reply-To: General Discussion about Arch Linux <arch-general@archlinux.org> 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
yuck. if you just want to manage daemons running as your own user, su and sudo shouldn't even be involved. On Wed, 22 Jun 2011 11:05:35 +0100 Owain Sutton <mail@owainsutton.co.uk> wrote:
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@gmail.com> Subject: [arch-general] Anything to manage user daemons? To: General Discussion about Arch Linux <arch-general@archlinux.org> Reply-To: General Discussion about Arch Linux <arch-general@archlinux.org> 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
On 22/06/2011, at 7:39 PM, Dieter Plaetinck wrote:
yuck. if you just want to manage daemons running as your own user, su and sudo shouldn't even be involved.
On Wed, 22 Jun 2011 11:05:35 +0100 Owain Sutton <mail@owainsutton.co.uk> wrote:
I have to disagree. Some daemons run as a different user like httpd or mpd for instance. They are started by root but are su'd to the user needed. I don't see any need to run an actual "user" daemon but if I did, that would be the way I would do it.
On Wed, 22 Jun 2011 21:30:42 +0930 Ty <ty-ml@eye-of-odin.com> wrote:
On 22/06/2011, at 7:39 PM, Dieter Plaetinck wrote:
yuck. if you just want to manage daemons running as your own user, su and sudo shouldn't even be involved.
On Wed, 22 Jun 2011 11:05:35 +0100 Owain Sutton <mail@owainsutton.co.uk> wrote:
I have to disagree. Some daemons run as a different user like httpd or mpd for instance. They are started by root but are su'd to the user needed. I don't see any need to run an actual "user" daemon but if I did, that would be the way I would do it.
This is not a disagreement, rather a different interpretation of "user daemon". For me "user daemon" means a daemon running as the same user I'm logged in as. Daemons running as httpd or mpd probably need to be started as root indeed - I'm not aware of a better method -, but I just don't call those "user daemons", they are regular daemons to me. Dieter
On 22/06/2011, at 9:35 PM, Dieter Plaetinck wrote:
On Wed, 22 Jun 2011 21:30:42 +0930 Ty <ty-ml@eye-of-odin.com> wrote:
On 22/06/2011, at 7:39 PM, Dieter Plaetinck wrote:
yuck. if you just want to manage daemons running as your own user, su and sudo shouldn't even be involved.
On Wed, 22 Jun 2011 11:05:35 +0100 Owain Sutton <mail@owainsutton.co.uk> wrote:
I have to disagree. Some daemons run as a different user like httpd or mpd for instance. They are started by root but are su'd to the user needed. I don't see any need to run an actual "user" daemon but if I did, that would be the way I would do it.
This is not a disagreement, rather a different interpretation of "user daemon". For me "user daemon" means a daemon running as the same user I'm logged in as.
Daemons running as httpd or mpd probably need to be started as root indeed - I'm not aware of a better method -, but I just don't call those "user daemons", they are regular daemons to me.
Dieter
Apologies. I realised what you meant after I posted.
On Wed, Jun 22, 2011 at 12:09:34 +0200, Dieter Plaetinck wrote:
yuck. if you just want to manage daemons running as your own user, su and sudo shouldn't even be involved.
A user crontab with @reboot entries? Geert -- geert.hendrickx.be :: geert@hendrickx.be :: PGP: 0xC4BB9E9F This e-mail was composed using 100% recycled spam messages!
V Wed, 22 Jun 2011 12:09:34 +0200 Dieter Plaetinck <dieter@plaetinck.be> napsáno:
yuck. if you just want to manage daemons running as your own user, su and sudo shouldn't even be involved.
On Wed, 22 Jun 2011 11:05:35 +0100 Owain Sutton <mail@owainsutton.co.uk> wrote:
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@gmail.com> Subject: [arch-general] Anything to manage user daemons? To: General Discussion about Arch Linux <arch-general@archlinux.org> Reply-To: General Discussion about Arch Linux <arch-general@archlinux.org> 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
I think screen - http://en.wikipedia.org/wiki/GNU_Screen
participants (9)
-
An Nguyen
-
Dieter Plaetinck
-
Evan LeCompte
-
Geert Hendrickx
-
James Rayner
-
Luštický Josef
-
Owain Sutton
-
Ty
-
XeCycle