Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 663864 - =net-p2p/rtorrent-0.9.7-r1 deamon crashes at start and failed to stop
Summary: =net-p2p/rtorrent-0.9.7-r1 deamon crashes at start and failed to stop
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Stephen Shkardoon
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-08-17 09:12 UTC by Andrey Aleksandrovich
Modified: 2020-12-17 20:30 UTC (History)
4 users (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 Andrey Aleksandrovich 2018-08-17 09:12:45 UTC
localhost / # /etc/init.d/rtorrentd start
 * Starting rtorrent ...                                                                                                                                          [ ok ]
localhost / # /etc/init.d/rtorrentd status
 * status: crashed
localhost / # /etc/init.d/rtorrentd stop
 * Stopping rtorrent ...                                                                                                                                          [ !! ]
 * ERROR: rtorrentd failed to stop
localhost / # /etc/init.d/rtorrentd stop
 * Stopping rtorrent ...
pgrep: option requires an argument -- 'P'

Usage:
 pgrep [options] <pattern>

Options:
 -d, --delimiter <string>  specify output delimiter
 -l, --list-name           list PID and process name
 -a, --list-full           list PID and full command line
 -v, --inverse             negates the matching
 -w, --lightweight         list all TID
 -c, --count               count of matching processes
 -f, --full                use full process name to match
 -g, --pgroup <PGID,...>   match listed process group IDs
 -G, --group <GID,...>     match real group IDs
 -i, --ignore-case         match case insensitively
 -n, --newest              select most recently started
 -o, --oldest              select least recently started
 -P, --parent <PPID,...>   match only child processes of the given parent
 -s, --session <SID,...>   match session IDs
 -t, --terminal <tty,...>  match by controlling terminal
 -u, --euid <ID,...>       match by effective IDs
 -U, --uid <ID,...>        match by real IDs
 -x, --exact               match exactly with the command name
 -F, --pidfile <file>      read PIDs from file
 -L, --logpidfile          fail if PID file is not locked
 --ns <PID>                match the processes that belong to the same
                           namespace as <pid>
 --nslist <ns,...>         list which namespaces will be considered for
                           the --ns option.
                           Available namespaces: ipc, mnt, net, pid, user, uts

 -h, --help     display this help and exit
 -V, --version  output version information and exit

For more details see pgrep(1).                                                                                                                                    [ !! ]
 * ERROR: rtorrentd failed to stop
localhost / #

And I can't stop it manually, only reboot helps.
Comment 1 Stephen Shkardoon 2018-08-17 14:28:22 UTC
There's probably only one real bug here: The init script fails to indicate rtorrent is stopped once it's crashed. I'll take a look at this next week, unless someone else wants to take it first.

With regards to why it's crashing, it's probably just a configuration problem. Are you able to run it manually with the same options it would be using if started from the init script (e.g. the correct user)?
Comment 2 Andrey Aleksandrovich 2018-08-17 17:03:31 UTC
/etc/conf.d/rtorrentd
USER="p2p"

If I run start command like in init script from the regular user (not "p2p"):

/usr/bin/screen -- -D -m -S rtorrentd /usr/bin/rtorrent

I see black screen few seconds and then:

[screen is terminating]

If I just start '/usr/bin/rtorrent' from the regular user is seems like starts successfully, and quit too.

When I tried to start it from init script after system boot - it indicates no errors, but the /var/run/rtorrentd.pid is empty (doesn't contain any number; zero size file) for some reason...
After this I can't stop it by init script (see above), only reboot.
Comment 3 Andrey Aleksandrovich 2018-08-23 11:51:51 UTC
I find out the crash reason, ~/.rtorrent.rc
If I delete it the rtorrentd starts successfully. But if I write some options there - rtorrentd crashes.

Contents of the ~/.rtorrentd
directory = /home/p2p/Downloads
session = /home/p2p/_session
session_save = yes
schedule = watch_directory,5,5,load_start=/home/p2p/_watch/*.torrent
port_range = 61000-61000
port_random = no
encryption = allow_incoming,try_outgoing,enable_retry,prefer_plaintext
dht = auto
dht_port = 61000
peer_exchange = yes
Comment 4 Andrey Aleksandrovich 2018-08-26 17:38:12 UTC
Well, the problem is that newer versions of rtorrent use different syntax for ~/.rtorrent.rc https://github.com/rakshasa/rtorrent/wiki/RPC-Migration-0.9
The rTorrent Configuration Template (new syntax) is here: https://github.com/rakshasa/rtorrent/wiki/CONFIG-Template

So, please, keep https://wiki.gentoo.org/wiki/RTorrent up-to-date.
Also, it would be good if ebuild would warns about changes like that.
Comment 5 crabbed halo ablution 2020-12-17 18:54:59 UTC
https://wiki.gentoo.org/index.php?title=RTorrent&diff=821902&oldid=813191
Wiki seems to be fixed, as for the transition and a warning in the ebuild, that time seems to have passed. 0.9.7 is the oldest in portage.
Propose RESOLVED, FIXED?