Bug 256694 - net-p2p/rtorrent: drop EXAMPLES, add rc.d script.
Summary: net-p2p/rtorrent: drop EXAMPLES, add rc.d script.
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Nuno Teixeira
URL:
Keywords:
Depends on:
Blocks: 239921
  Show dependency treegraph
 
Reported: 2021-06-18 14:45 UTC by Ivan Rozhuk
Modified: 2024-11-21 08:22 UTC (History)
2 users (show)

See Also:
dbaio: maintainer-feedback-


Attachments
patch (4.74 KB, patch)
2021-06-18 14:45 UTC, Ivan Rozhuk
no flags Details | Diff
v0: rename .config -> .conf (4.34 KB, patch)
2024-11-16 10:52 UTC, Nuno Teixeira
no flags Details | Diff
patch (4.99 KB, patch)
2024-11-20 22:55 UTC, Ivan Rozhuk
rozhuk.im: maintainer-approval?
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ivan Rozhuk 2021-06-18 14:45:27 UTC
Created attachment 225906 [details]
patch

Add add rc.d script.
Install /doc/rtorrent.rc into ${ETCDIR}/rtorrent.config.sample.
Comment 1 Danilo G. Baio freebsd_committer freebsd_triage 2021-06-20 16:55:25 UTC
Thanks for your work.

I don't know, this needs to be executed in daemon mode, and usually, users want to hold everything in a homedir.

What about installing this rc.script as an example and add a message to the pkg-message about it?
Comment 2 Ivan Rozhuk 2021-06-20 17:11:12 UTC
I use it as daemon only with WebUI rutorrent: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=239921
It runs as www, www have no home dir on my home server.

If some one do not want run rtorrent as daemon - then do not add rtorrent_enable="YES" in /etc/rc.conf, no need to move rc.d script to examples to prevent daemon start.
Comment 3 Danilo G. Baio freebsd_committer freebsd_triage 2021-06-20 18:00:07 UTC
(In reply to rozhuk.im from comment #2)

I know, it was not what I meant.
So, there are other port involved, you can't use the rcscript without that.
Well, at least inform users about that.

I don't have time to dig into this, so I dropped maintainership from rtorrent/libtorrent, don't want to hold your work.
Comment 4 Danilo G. Baio freebsd_committer freebsd_triage 2021-06-20 18:01:51 UTC
Open to take.
Comment 5 Zsolt Udvari freebsd_committer freebsd_triage 2024-11-03 19:49:29 UTC
Assign to maintainer.
Comment 6 Nuno Teixeira freebsd_committer freebsd_triage 2024-11-03 20:25:07 UTC
> Add add rc.d script.

I don't see why we should include a rc in this port.
My opinion is to continue to have it simpler.

> Install /doc/rtorrent.rc into ${ETCDIR}/rtorrent.config.sample.

Port is using the upstream file name:
https://github.com/rakshasa/rtorrent/wiki/CONFIG-Template#using-the-template

I will not change that.

Thanks
Comment 7 Ivan Rozhuk 2024-11-03 23:03:38 UTC
I use it as daemon and never even see it TUI.
Only web gui in my installation: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=239921
Comment 8 Nuno Teixeira freebsd_committer freebsd_triage 2024-11-04 08:37:00 UTC
(In reply to Ivan Rozhuk from comment #7)

It seams that Arch have an rtorrent-headless flavor but I don't see a dependency on rutorrent pkg.
 
https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=rtorrent-headless
https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=rutorrent

Ok, I started to understand better the need for rc script.

Let's do the following, put this PR as a dependency of 239921 (rutorrent new port).
Comment 9 Ivan Rozhuk 2024-11-05 14:48:17 UTC
(In reply to Nuno Teixeira from comment #8)

rtorrent have "RPC" interface that can be used by rutorrent or probably some other tools/xxxUI.
rutorrent may be installed on other host than rtorrent.

I many years (since 2009-2010) run rtorrent as daemon using my patch to remove TUI and rc.d script to run as daemon.
It was planned as centralized replacement to uTorrent: I do not want to have multiple torrent clients at home (me, wife, children's...), one client - is simple to manage network channel load.
Only in past few years rtorrents author add option to build it without TUI and run as daemon. Probably after that this PR was opened.
Comment 10 Nuno Teixeira freebsd_committer freebsd_triage 2024-11-07 12:44:42 UTC
Whats your opinion of creating a "rtorrent-headless" port like Arch do just for adding required rc scripts and stuff?
This way rtorrent port isn't touched/changed.
rtorrent-headless port will run depend on rtorrent.

( https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=rtorrent-headless )
Comment 11 Ivan Rozhuk 2024-11-07 12:53:15 UTC
(In reply to Nuno Teixeira from comment #10)
IMHO it is overengineering just for one rc.d script )

rc.d script related to XMLRPC option.
And if there exist option to disable TUI - nice to have it.
Comment 12 Nuno Teixeira freebsd_committer freebsd_triage 2024-11-07 13:32:12 UTC
(In reply to Ivan Rozhuk from comment #11)

Ok, understood.

Related to:

	${INSTALL_DATA} ${WRKSRC}/doc/rtorrent.rc \
		${STAGEDIR}${ETCDIR}/rtorrent.config.sample

rtorrent by defaults reads ~/.rtorrent.rc config. I can't find out if it can read a global config from $PREFIX${ETCDIR}.

Supose that it reads global {STAGEDIR}${ETCDIR}/rtorrent.rc, than this should be corrected to:

	${INSTALL_DATA} ${WRKSRC}/doc/rtorrent.rc \
		${STAGEDIR}${ETCDIR}/rtorrent.rc.sample

and thus, @sample macro do its job as usual?
Comment 13 Ivan Rozhuk 2024-11-07 13:53:19 UTC
(In reply to Nuno Teixeira from comment #12)

from my rc.d script: 

...
${rtorrent_config="%%PREFIX%%/etc/${name}/${name}.conf"} # .rtorrent.rc config file name.
...
command_args="${command_args} -o import=${rtorrent_config}"
...

to read config from any place.


> Supose that it reads global {STAGEDIR}${ETCDIR}/rtorrent.rc, than this should be corrected to

rc.d script expect .conf file.
Better that config file name be same in rc.d and on disk.
Looks like I miss that .conf != .config.
Comment 14 Nuno Teixeira freebsd_committer freebsd_triage 2024-11-16 10:52:16 UTC
Created attachment 255214 [details]
v0: rename .config -> .conf

When starting service rtorrent as root (`service rtorrent onestart`)

Starting rtorrent.
daemon: pidfile ``/var/run/rtorrent.pid'': Permission denied
/usr/local/etc/rc.d/rtorrent: WARNING: failed to start rtorrent

Any clues?
Comment 15 Ivan Rozhuk 2024-11-20 22:55:08 UTC
Created attachment 255336 [details]
patch
Comment 16 Ivan Rozhuk 2024-11-20 22:56:41 UTC
(In reply to Nuno Teixeira from comment #14)
This patch should fix it.
On my systems /var/run have 1777 perms and I always miss that.
Comment 17 Nuno Teixeira freebsd_committer freebsd_triage 2024-11-21 08:22:49 UTC
I will test it this weekend.

Could you provide a short description about this rc script and for what is usefull?
My opinion is to create a pkg-message that instruct users to use it only under certain circunstances.

Thoughts?