/etc/init.d/rtorrentd refuses to start if anyone is running a session of screen on the system. Simple fix is to add --user $USER to the init script. Reproducible: Always Steps to Reproduce: 1. Fire up a screen session 2. Detatch that screen session or open up another terminal 3. /etc/init.d/rtorrentd start Actual Results: # /etc/init.d/rtorrentd restart * Caching service Dependencies ... [ ok ] * Starting rtorrent ... /usr/bin/screen already running. [ !! ] Expected Results: # /etc/init.d/rtorrentd restart * Caching service Dependencies ... [ ok ] * Starting rtorrent ... [ ok ] Adding --user $USER to the /etc/init.d/rtorrentd script takes care of the issue for me. ebegin "Starting rtorrent" env TERM="xterm" \ start-stop-daemon --start --chuid $USER --user $USER \ --env HOME="${PWHOME:-/home/$USER}" \ --exec /usr/bin/screen -- -dmS rtorrentd /usr/bin/rtorrent eend $?
(In reply to comment #0) > /etc/init.d/rtorrentd refuses to start if anyone is running a session of screen > on the system. Simple fix is to add --user $USER to the init script. > > Adding --user $USER does not solve the problem if the given user already has screen running; this forces rtorrent to have its own user specifically for this purpose. Another option would be to create a new executable (e.g. /usr/bin/rtorrentd): #!/bin/bash /usr/bin/screen -dmS rtorrentd /usr/bin/rtorrent would do the trick, and then run that.
I had the same issue (even though ps aux didn't show any screens). Adding --name rtorrent seems to have solved it.
*** Bug 300309 has been marked as a duplicate of this bug. ***
I have committed a supposed fix, please test (don't forget to re-emerge) and verify it works.
For some strange reasons my rtorrent with new init.d script is running as root. I think we need --chuid option for start-stop-daemon too, because --user only "check for processes owned by the user specified by username or uid". And no, new init.d script doesn't fix main bug, because rtorrent runned as root, but start-stop-daemon expects $USER process.
Hi all! I've installed rtorrent today and faced with this problem too on rtorrent-0.8.6-r1. Perhaps on a new version of rtorrent all is ok, but I'll print full working config here to be on the safe side. #!/sbin/runscript # Copyright 1999-2008 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/net-p2p/rtorrent/files/rtorrentd.init,v 1.5 2010/03/18 20:30:24 spatz Exp $ depend() { use net ypbind nis after slapd mysqld postgresql } start() { PWHOME="$(getent passwd $USER | awk -F: '{ print $6 }')" ebegin "Starting rtorrent" env TERM="xterm" \ start-stop-daemon \ --start \ --chuid $USER \ --user $USER \ --chdir /home/$USER \ --env HOME="${PWHOME:-/home/$USER}" \ --name rtorrent \ --exec /usr/bin/screen -- -d -m -S rtorrentd /usr/bin/rtorrent eend $? } stop() { ebegin "Stopping rtorrent" start-stop-daemon --stop --signal 2 --name rtorrent eend $? } # With best regards # Kolan
I just wanted to note that the init.d script still does not run as the user listed in /etc/conf.d/rtorrentd unless --chuid $USER \ is added to the script as noted in comment #6.
And I still would like to pay attention for the line (works) --exec /usr/bin/screen -- -d -m -S rtorrentd as the original --exec /usr/bin/screen -- -dmS rtorrentd /usr/bin/rtorrent in my system doesn't lead to daemon start.
> --exec /usr/bin/screen -- -d -m -S rtorrentd My typing error, working variant: --exec /usr/bin/screen -- -d -m -S rtorrentd /usr/bin/rtorrent
Ive tried every thing listed here and its still not working for me. say "/usr/bin/screen died" Details here http://bugs.gentoo.org/show_bug.cgi?id=342517
I believe this should be fixed in latest versions (rtorrent-0.8.6-r3, rtorrent-0.8.7-r1). If this still does not fix your problem, feel free to reopen.
(In reply to comment #10) > Ive tried every thing listed here and its still not working for me. say > "/usr/bin/screen died" > > Details here http://bugs.gentoo.org/show_bug.cgi?id=342517 Jeremi, it seems you are using baselayout-2 and openrc. After the recent update and writing my own crutch run programs from a screen, I've noticed that the start-stop-daemon gives the same error as you said. Revising a bunch of start-stop-daemon and a screen options, I realized that problem in rc, because screen with -d option calls fork() and rc receives pid of process which finished. Here is my crutch for rtorrentd which just works: #!/sbin/runscript USER=rtorrent depend() { use net ypbind nis after slapd mysqld postgresql } start() { PWHOME="$(getent passwd $USER | awk -F: '{ print $6 }')" ebegin "Starting rtorrent" cd /home/$USER su $USER -c "screen -d -m -S rtorrent /usr/bin/rtorrent" eend $? } stop() { ebegin "Stopping rtorrent" start-stop-daemon --stop --signal 2 --name rtorrent }