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

Bug 338017

Summary: net-p2p/mldonkey: add support for sending shutdown signals via telnet
Product: Gentoo Linux Reporter: Mike Kazantsev <mk.fraggod>
Component: Current packagesAssignee: Jesús P Rey (Chuso) <gentoo>
Status: RESOLVED FIXED    
Severity: enhancement CC: mgorny, net-p2p, proxy-maint, sam
Priority: High Keywords: PullRequest
Version: unspecified   
Hardware: All   
OS: Linux   
URL: http://mldonkey.sourceforge.net/TelnetUI
See Also: https://github.com/gentoo/gentoo/pull/19393
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: mldonkey init.d script with telnet interface support
mldonkey conf.d script with telnet interface enabled by default
Diff from init.d script, shipped with 3.0.0 version
Diff from conf.d script, shipped with 3.0.0 version
Diff from init.d script, shipped with 3.0.0 version
Diff from conf.d script, shipped with 3.0.0 version

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(-)