Summary: | net-p2p/rtorrent refuses to start in daemon mode if /usr/bin/screen is already running | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Kolbjørn Fredheim <hightower> |
Component: | [OLD] Server | Assignee: | No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it <maintainer-needed> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | alex, backbone, enviouzproductionz07, ewoud+gentoo, net-p2p, snoopdugiedog+gentoo, spatz |
Priority: | High | ||
Version: | unspecified | ||
Hardware: | AMD64 | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
Kolbjørn Fredheim
2009-11-24 16:26:48 UTC
(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 } |