Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 480050 - net-p2p/mldonkey - add systemd service files
Summary: net-p2p/mldonkey - add systemd service files
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Jesús P Rey (Chuso)
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks: install-systemd-unit
  Show dependency tree
 
Reported: 2013-08-07 11:23 UTC by Mehmet Giritli
Modified: 2022-02-28 07:25 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
mldonkey.service (mldonkey.service,588 bytes, text/plain)
2013-08-07 11:24 UTC, Mehmet Giritli
Details
mldonkey@.service (mldonkey@.service,456 bytes, text/plain)
2013-08-07 11:25 UTC, Mehmet Giritli
Details

Note You need to log in before you can comment on or make changes to this bug.
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(-)