You are not logged in.

#1 2009-05-31 02:02:51

poopship21
Member
Registered: 2009-05-13
Posts: 177

add_daemon usage [SOLVED]

the wiki page on rtorrent (http://wiki.archlinux.org/index.php/Rtorrent) describes a script to start the client as a "daemon".  by storing the script in the /etc/rc.d/ directory, the user can execute "/etc/rc.d/rtorrent start" with the following consequences:
1) switching user to "rtorrent"
2) executing "/usr/bin/rtorrent" in a screen session
3) adding a new file in the "/var/run/daemons/" directory

i can see how point 1) is justified as a security measure.  i am fairly certain that screen session is like a "nohup" in that it detaches the execution of rtorrent from the terminal session which is necessary for any server or "daemon" process but i dont know why it would be prefferable to run a script which starts screen and runs rtorrent in that over "nohup <script which starts rtorrent>".  also, it seems fairly easy to re-attach to the screen session after the terminal is closed, which makes the script complete after point 2) so i would like to know what is the reason for point 3)?  TIA

Last edited by poopship21 (2009-08-02 17:25:46)

Offline

#2 2009-05-31 09:29:56

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: add_daemon usage [SOLVED]

/var/run/daemons/ is the daemons' home. You can start / stop / restart your rtorrent daemon just like any other.
'nohup' works great locally, I don't use screen and remote guys so I can't say how is it working remotely.

Offline

#3 2009-05-31 11:11:50

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: add_daemon usage [SOLVED]

It's simply a matter of choice. You prefer to use nohup, whoever wrote the script likes screen. add_daemon is there because it's a necessary function in any script that will be run from /etc/rc.d, as per the official prototype /usr/share/pacman/rc-script.proto.

Offline

#4 2009-05-31 13:13:44

poopship21
Member
Registered: 2009-05-13
Posts: 177

Re: add_daemon usage [SOLVED]

thanks all, thats very helpful.

Offline

Board footer

Powered by FluxBB