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:
Created attachment 247972 [details] mldonkey init.d script with telnet interface support
Created attachment 247973 [details] mldonkey conf.d script with telnet interface enabled by default
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.
Created attachment 247981 [details, diff] Diff from init.d script, shipped with 3.0.0 version
Created attachment 247983 [details, diff] Diff from conf.d script, shipped with 3.0.0 version
Agreed, bashisms here aren't really necessary, although I thought OpenRC is quite dead already, and gentoo uses bash-enabled version anyway.
(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.
Created attachment 248208 [details, diff] Diff from init.d script, shipped with 3.0.0 version
Created attachment 248209 [details, diff] Diff from conf.d script, shipped with 3.0.0 version
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.
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(-)