You are not logged in.
Hello all,
I am trying to run rTorrent as a service that will startup with the system, and restart if an error occurs.
I have followed the instructions here: https://wiki.archlinux.org/index.php/RT … _or_screen
I tried with both tmux and screen but i am getting similar errors on each:
systemctl start rt@$USER
Job for rt@root.service failed. See 'systemctl status rt@root.service' and 'journalctl -xn' for details.systemctl status -l rt@root.service
* rt@root.service - rTorrent
Loaded: loaded (/etc/systemd/system/rt@.service; enabled)
Active: failed (Result: start-limit) since Sat 2014-08-30 12:03:49 CEST; 1min 43s ago
Process: 2201 ExecStart=/usr/bin/tmux new-session -s rt -n rtorrent -d rtorrent (code=exited, status=1/FAILURE)
Aug 30 12:03:49 alarmpi systemd[1]: rt@root.service: control process exited, code=exited status=1
Aug 30 12:03:49 alarmpi systemd[1]: Failed to start rTorrent.
Aug 30 12:03:49 alarmpi systemd[1]: Unit rt@root.service entered failed state.
Aug 30 12:03:49 alarmpi tmux[2201]: duplicate session: rt
Aug 30 12:03:49 alarmpi systemd[1]: rt@root.service holdoff time over, scheduling restart.
Aug 30 12:03:49 alarmpi systemd[1]: Stopping rTorrent...
Aug 30 12:03:49 alarmpi systemd[1]: Starting rTorrent...
Aug 30 12:03:49 alarmpi systemd[1]: rt@root.service start request repeated too quickly, refusing to start.
Aug 30 12:03:49 alarmpi systemd[1]: Failed to start rTorrent.
Aug 30 12:03:49 alarmpi systemd[1]: Unit rt@root.service entered failed state.journalctl -xn
-- Logs begin at Thu 1970-01-01 01:00:04 CET, end at Sat 2014-08-30 12:05:18 CEST. --
Aug 30 12:03:49 alarmpi systemd[1]: Stopping rTorrent...
-- Subject: Unit rt@root.service has begun shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit rt@root.service has begun shutting down.
Aug 30 12:03:49 alarmpi systemd[1]: Starting rTorrent...
-- Subject: Unit rt@root.service has begun with start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit rt@root.service has begun starting up.
Aug 30 12:03:49 alarmpi systemd[1]: rt@root.service start request repeated too quickly, refusing to s
Aug 30 12:03:49 alarmpi systemd[1]: Failed to start rTorrent.
-- Subject: Unit rt@root.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit rt@root.service has failed.
--
-- The result is failed.
Aug 30 12:03:49 alarmpi systemd[1]: Unit rt@root.service entered failed state.
Aug 30 12:05:18 alarmpi systemd[1]: Job dev-disk-by\x2duuid-b028ec3e\x2dc99e\x2d4429\x2db399\x2da34ac
Aug 30 12:05:18 alarmpi systemd[1]: Timed out waiting for device dev-disk-by\x2duuid-b028ec3e\x2dc99e
-- Subject: Unit dev-disk-by\x2duuid-b028ec3e\x2dc99e\x2d4429\x2db399\x2da34accdb29fc.device has fail
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit dev-disk-by\x2duuid-b028ec3e\x2dc99e\x2d4429\x2db399\x2da34accdb29fc.device has failed.
--
-- The result is timeout.
Aug 30 12:05:18 alarmpi systemd[1]: Dependency failed for /dev/disk/by-uuid/b028ec3e-c99e-4429-b399-a
-- Subject: Unit dev-disk-by\x2duuid-b028ec3e\x2dc99e\x2d4429\x2db399\x2da34accdb29fc.swap has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit dev-disk-by\x2duuid-b028ec3e\x2dc99e\x2d4429\x2db399\x2da34accdb29fc.swap has failed.
--
-- The result is dependency.cat /etc/systemd/system/rt@.service
[Unit]
Description=rTorrent
Requires=network.target local-fs.target
[Service]
Type=forking
KillMode=none
User=%I
ExecStart=/usr/bin/tmux new-session -s rt -n rtorrent -d rtorrent
ExecStop=/usr/bin/tmux send-keys -t rt:rtorrent C-q
WorkingDirectory=/home/%I/
Restart=on-failure
[Install]
WantedBy=multi-user.targetLast edited by simonwjackson (2014-08-30 10:57:04)
Offline
Is your user really called root, and does /home/root/ exist?
Offline
updating the user in the service file worked. Thanks!
/etc/systemd/system/rt@.service
[Unit]
Description=rTorrent
Requires=network.target local-fs.target
[Service]
Type=forking
KillMode=none
User=root
ExecStart=/usr/bin/tmux new-session -s rt -n rtorrent -d rtorrent
ExecStop=/usr/bin/tmux send-keys -t rt:rtorrent C-q
WorkingDirectory=/root/
Restart=on-failure
[Install]
WantedBy=multi-user.targetOffline
FYI running rtorrent as root is the height of madness.
Offline
I'm experiencing similar problem. But in my case I don't want to run it as root but as regular user.
journalctl
lis 17 14:36:04 t61 systemd[1]: rt@kuba.service holdoff time over, scheduling restart.
lis 17 14:36:04 t61 systemd[1]: Stopping rTorrent...
lis 17 14:36:04 t61 systemd[1]: Starting rTorrent...
lis 17 14:36:04 t61 systemd[1]: start request repeated too quickly for rt@kuba.service
lis 17 14:36:04 t61 systemd[1]: Failed to start rTorrent.
lis 17 14:36:04 t61 systemd[1]: Unit rt@kuba.service entered failed state.
lis 17 14:36:04 t61 systemd[1]: rt@kuba.service failed.systemctl status rt@kuba
● rt@kuba.service - rTorrent
Loaded: loaded (/etc/systemd/system/rt@.service; enabled)
Active: failed (Result: start-limit) since pon 2014-11-17 14:40:42 CET; 27min ago
Main PID: 1111 (code=exited, status=0/SUCCESS)
lis 17 14:40:42 t61 systemd[1]: Unit rt@kuba.service entered failed state.
lis 17 14:40:42 t61 systemd[1]: rt@kuba.service failed.
lis 17 14:40:42 t61 systemd[1]: rt@kuba.service holdoff time over, scheduling restart.
lis 17 14:40:42 t61 systemd[1]: Stopping rTorrent...
lis 17 14:40:42 t61 systemd[1]: Starting rTorrent...
lis 17 14:40:42 t61 systemd[1]: start request repeated too quickly for rt@kuba.service
lis 17 14:40:42 t61 systemd[1]: Failed to start rTorrent.
lis 17 14:40:42 t61 systemd[1]: Unit rt@kuba.service entered failed state.
lis 17 14:40:42 t61 systemd[1]: rt@kuba.service failed.Update: my rt service started after restart. But anyway it would be good to know how to fix my configuration to avoid such problems in future.
Last edited by jakub (2014-11-17 14:25:05)
Offline
I think that the service should wait when the user has logged in.
do it good first, it will be faster than do it twice the saint ![]()
Offline
I'm not sure as I also couldn't start this service being already logged in. I had to restart my machine.
Offline
Rebooting was not that much necessary.
# systemctl daemon-reloadcould suffice
do it good first, it will be faster than do it twice the saint ![]()
Offline
Rebooting was not that much necessary.
# systemctl daemon-reloadcould suffice
Thx for the hint! Is should be useful as I still have some issues starting rTorrent - sometimes the service starts sometimes not. For me it shouldn't be marked as solved ![]()
Last edited by jakub (2014-11-19 15:31:17)
Offline
Thx for the hint! Is should be useful as I still have some issues starting rTorrent - sometimes the service starts sometimes not. For me it shouldn't be marked as solved
systemd does not have a way of knowing when the rtorrent process exits. systemd treats the service as stopped right after its ExecStop= exits, but rtorrent may need additional 3-5 seconds to shutdown. When the entire system shuts down in 2 seconds, then the rtorrent process is killed with rtorrent.lock file left on the filesystem. This will cause the rt.service to fail on the next boot.
Quick fix
journalctl -u rt@user...
Apr 06 15:20:10 arch systemd[1]: Stopping rTorrent...
Apr 06 15:20:10 arch bash[12123]: rtorrent still running...
Apr 06 15:20:11 arch bash[12123]: rtorrent still running...
Apr 06 15:20:11 arch bash[12123]: rtorrent still running...
Apr 06 15:20:12 arch bash[12123]: rtorrent still running...
Apr 06 15:20:12 arch bash[12123]: rtorrent still running...
Apr 06 15:20:13 arch bash[12123]: rtorrent still running...
Apr 06 15:20:13 arch systemd[1]: Stopped rTorrent.
...Last edited by cngn (2015-04-06 13:42:39)
Offline