Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 500022 - net-p2p/rtorrent - init script fails to start daemon with non-root user set in /etc/conf.d/rtorrent
Summary: net-p2p/rtorrent - init script fails to start daemon with non-root user set i...
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Jason Zaman
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-01 21:29 UTC by aryabukhin
Modified: 2018-01-16 02:19 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description aryabukhin 2014-02-01 21:29:26 UTC
When USER changed in /etc/conf.d/rtorrent daemon can't start.


Reproducible: Always

Steps to Reproduce:
1. rtorrent emerged with USE="daemon xmlrpc"
2. created user rtorrent
3. in /etc/conf.d/rtorrent USER set to rtorrent


Actual Results:  
"/etc/init.d/rtorrentd start" will starts but application fails immediatly.

Expected Results:  
rtorrent works

Please replace /etc/init.d/rtorrentd with something like this.


#!/sbin/runscript
# Copyright 1999-2011 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.8 2011/11/07 15:46:30 darkside Exp $

depend() {
        use net ypbind nis
        after slapd mysqld postgresql
}

start() {
        ebegin "Starting rtorrent $PWHOME"
        env TERM="xterm" \
                start-stop-daemon \
                        --start \
                        --make-pidfile \
                        --pidfile /run/rtorrentd.pid \
                        --background \
                        --name rtorrent \
                        --exec /usr/bin/screen -- -D -m -S rtorrentd su -c /usr/bin/rtorrent
        eend $?
}

stop() {
        ebegin "Stopping rtorrent"
        pppid=`cat /var/run/rtorrentd.pid`
        ppid=`ps --ppid $pppid -o pid | grep -v PID | tail -n1`
        pid=`ps --ppid $ppid -o pid | grep -v PID | tail -n1`
        echo "$pid" > /run/rtorrentd-real.pid
        start-stop-daemon --stop --signal 15 \
                         --pidfile /run/rtorrentd-real.pid
        eend $?
}
Comment 1 Jason Zaman gentoo-dev 2018-01-16 02:19:11 UTC
Is this still valid? looks like the current init script should work, it has the proper user stuff in it. please re-open if this is still a problem.