I'm suggesting two service files. Fist I have the main daemon controlling service: [Unit] Description=Mldonkey - Multiple Peer-To-Peer Network Client After=network.target [Service] EnvironmentFile=/etc/conf.d/mldonkey User=p2p Nice=10 WorkingDirectory=/home/p2p/mldonkey ExecStart=/usr/bin/mlnet TimeoutStopSec=10 ExecStop=/usr/bin/wget --spider -T 10 -q http://${USERNAME}:${PASSWORD}@${SERVER}:${PORT}/submit?q=close_fds ExecStop=/usr/bin/wget --spider -T 10 -q http://${USERNAME}:${PASSWORD}@${SERVER}:${PORT}/submit?q=save ExecStop=/usr/bin/wget --spider -T 10 -q http://${USERNAME}:${PASSWORD}@${SERVER}:${PORT}/submit?q=kill [Install] WantedBy=multi-user.target Here we are still using some of the old openrc conf file. Then I suggest a seconf file for controlling the download speed. This again uses the old conf file: [Unit] Description=Mldonkey - Multiple Peer-To-Peer Network Client After=mldonkey.service [Service] Type=oneshot EnvironmentFile=/etc/conf.d/mldonkey User=p2p TimeoutStartSec=10 ExecStart=/usr/bin/wget --spider -T 10 -q "http://${USERNAME}:${PASSWORD}@${SERVER}:${PORT}/submit?q=set+max_hard_download_rate+${%i_DOWN}" ExecStart=/usr/bin/wget --spider -T 10 -q "http://${USERNAME}:${PASSWORD}@${SERVER}:${PORT}/submit?q=set+max_hard_upload_rate+${%i_UP}" you need to have, for example, something like this in /etc/conf.d/mldonkey: LOW_DOWN="16" LOW_UP="4" HIGH_DOWN="72" HIGH_UP="18" and the issue: systemctl start mldonkey@HIGH.service to get the desired setting. Reproducible: Always
Created attachment 355302 [details] mldonkey.service
Created attachment 355304 [details] mldonkey@.service
systemd team is free to add it
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4d5ed7c028714d20734af683d45755a095840ec0 commit 4d5ed7c028714d20734af683d45755a095840ec0 Author: Jesus P Rey (Chuso) <gentoo@chuso.net> AuthorDate: 2021-11-01 18:40:55 +0000 Commit: Joonas Niilola <juippis@gentoo.org> CommitDate: 2022-02-28 07:25:56 +0000 net-p2p/mldonkey: rework init.d/service files Add systemd service unit and remove obsolete settings from the OpenRC script. Signed-off-by: Jesus P Rey <gentoo@chuso.net> Closes: https://bugs.gentoo.org/480050 Closes: https://github.com/gentoo/gentoo/pull/22851 Signed-off-by: Joonas Niilola <juippis@gentoo.org> net-p2p/mldonkey/files/mldonkey.confd | 22 +--- net-p2p/mldonkey/files/mldonkey.initd | 112 ++------------------- net-p2p/mldonkey/files/mldonkey.service | 14 +++ ...ey-3.1.7-r2.ebuild => mldonkey-3.1.7-r3.ebuild} | 25 ++--- 4 files changed, 33 insertions(+), 140 deletions(-)