Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 480050

Summary: net-p2p/mldonkey - add systemd service files
Product: Gentoo Linux Reporter: Mehmet Giritli <mehmet>
Component: Current packagesAssignee: Jesús P Rey (Chuso) <gentoo>
Status: RESOLVED FIXED    
Severity: normal CC: ml, net-p2p, proxy-maint, sam
Priority: Normal Keywords: PullRequest
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://github.com/gentoo/gentoo/pull/22851
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 448882    
Attachments: mldonkey.service
mldonkey@.service

Description Mehmet Giritli 2013-08-07 11:23:37 UTC
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
Comment 1 Mehmet Giritli 2013-08-07 11:24:43 UTC
Created attachment 355302 [details]
mldonkey.service
Comment 2 Mehmet Giritli 2013-08-07 11:25:06 UTC
Created attachment 355304 [details]
mldonkey@.service
Comment 3 Alexis Ballier gentoo-dev 2017-01-31 21:23:16 UTC
systemd team is free to add it
Comment 4 Larry the Git Cow gentoo-dev 2022-02-28 07:25:59 UTC
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(-)