Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 338017 - net-p2p/mldonkey: add support for sending shutdown signals via telnet
Summary: net-p2p/mldonkey: add support for sending shutdown signals via telnet
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Jesús P Rey (Chuso)
URL: http://mldonkey.sourceforge.net/TelnetUI
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2010-09-19 09:14 UTC by Mike Kazantsev
Modified: 2021-02-18 08:25 UTC (History)
4 users (show)

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


Attachments
mldonkey init.d script with telnet interface support (mldonkey.initd,3.77 KB, text/plain)
2010-09-19 09:15 UTC, Mike Kazantsev
Details
mldonkey conf.d script with telnet interface enabled by default (mldonkey.confd,1.03 KB, text/plain)
2010-09-19 09:15 UTC, Mike Kazantsev
Details
Diff from init.d script, shipped with 3.0.0 version (mldonkey.initd.diff,1.01 KB, patch)
2010-09-19 10:54 UTC, Mike Kazantsev
Details | Diff
Diff from conf.d script, shipped with 3.0.0 version (mldonkey.confd.diff,664 bytes, patch)
2010-09-19 10:54 UTC, Mike Kazantsev
Details | Diff
Diff from init.d script, shipped with 3.0.0 version (mldonkey.initd.diff,2.09 KB, patch)
2010-09-20 21:41 UTC, Mike Kazantsev
Details | Diff
Diff from conf.d script, shipped with 3.0.0 version (mldonkey.confd.diff,785 bytes, patch)
2010-09-20 21:41 UTC, Mike Kazantsev
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Kazantsev 2010-09-19 09:14:35 UTC
Current init.d script has support for sending core shutdown signal via web interface, which might be disabled, resulting in quite long shutdown-wait sequence.
Attached init.d / conf.d scripts allow to conditionally use telnet interface (if enabled in conf.d) to the same end via netcat-like utility (nc or ncat from nmap package).


Reproducible: Always

Steps to Reproduce:
Comment 1 Mike Kazantsev 2010-09-19 09:15:05 UTC
Created attachment 247972 [details]
mldonkey init.d script with telnet interface support
Comment 2 Mike Kazantsev 2010-09-19 09:15:27 UTC
Created attachment 247973 [details]
mldonkey conf.d script with telnet interface enabled by default
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2010-09-19 09:48:19 UTC
Could you attach unified diffs to the original init.d and conf.d scripts?

In addition, please _do not_ use bashisms in init.d scripts. OpenRC requires complete POSIX compliance of them.
Comment 4 Mike Kazantsev 2010-09-19 10:54:00 UTC
Created attachment 247981 [details, diff]
Diff from init.d script, shipped with 3.0.0 version
Comment 5 Mike Kazantsev 2010-09-19 10:54:18 UTC
Created attachment 247983 [details, diff]
Diff from conf.d script, shipped with 3.0.0 version
Comment 6 Mike Kazantsev 2010-09-19 10:57:22 UTC
Agreed, bashisms here aren't really necessary, although I thought OpenRC is quite dead already, and gentoo uses bash-enabled version anyway.
Comment 7 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2010-09-19 16:01:21 UTC
(In reply to comment #6)
> Agreed, bashisms here aren't really necessary, although I thought OpenRC is
> quite dead already, and gentoo uses bash-enabled version anyway.

OpenRC was completely taken over by Gentoo and thus it is even more likely to get stable.

Further issues related with the changes:
* please consistently use ${} for all variables,
* && within [ ] is incorrect, please use -a instead,
* please insert a space before all linebreak-preventing backslashes,
* 'echo -e' is an ugly bashism, use 'printf' instead,
* please either make TELNET_CMD call more flexible or mention in the conf.d file that it needs to accept '--wait' and '--idle-timeout' arguments.
Comment 8 Mike Kazantsev 2010-09-20 21:41:23 UTC
Created attachment 248208 [details, diff]
Diff from init.d script, shipped with 3.0.0 version
Comment 9 Mike Kazantsev 2010-09-20 21:41:49 UTC
Created attachment 248209 [details, diff]
Diff from conf.d script, shipped with 3.0.0 version
Comment 10 Mike Kazantsev 2010-09-20 21:48:52 UTC
Thanks for thorough review, these patches should fix all the mentioned issues.

I've also added and tested telnet commands for slow/fast bandwidth mode switching, although it's a bit inconsistent with native mldonkey low/high modes.
Comment 11 Larry the Git Cow gentoo-dev 2021-02-18 08:25:00 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=30cf999cd2ab9c4d29751305c986d4e692721d2c

commit 30cf999cd2ab9c4d29751305c986d4e692721d2c
Author:     Jesus P Rey (Chuso) <gentoo@chuso.net>
AuthorDate: 2021-01-30 19:18:29 +0000
Commit:     Joonas Niilola <juippis@gentoo.org>
CommitDate: 2021-02-18 08:24:51 +0000

    net-p2p/mldonkey: revision bump to 3.1.7-r1
    
    Adds support to send init.d commands via telnet in addition to http.
    
    Signed-off-by: Jesus P Rey <gentoo@chuso.net>
    Closes: https://bugs.gentoo.org/338017
    Signed-off-by: Joonas Niilola <juippis@gentoo.org>

 .../files/{mldonkey.confd-2.8 => mldonkey.confd}   |  3 +
 net-p2p/mldonkey/files/mldonkey.initd              | 70 ++++++++++++++--------
 ...onkey-3.1.7.ebuild => mldonkey-3.1.7-r1.ebuild} |  3 +-
 3 files changed, 50 insertions(+), 26 deletions(-)