Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 141177 - net-p2p/mldonkey: Send SIGHUP in ip-up script
Summary: net-p2p/mldonkey: Send SIGHUP in ip-up script
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo net-p2p team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-07-20 08:14 UTC by spiralvoice
Modified: 2007-01-24 17:40 UTC (History)
3 users (show)

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


Attachments
mldonkey.initd (mldonkey.initd,3.26 KB, text/plain)
2007-01-12 22:57 UTC, Christian Schlotter
Details
mldonkey.confd (mldonkey.confd,887 bytes, text/plain)
2007-01-12 22:59 UTC, Christian Schlotter
Details
mldonkey.initd (mldonkey.initd,3.28 KB, text/plain)
2007-01-12 23:13 UTC, Christian Schlotter
Details
bad mldonkey.initd file (mldonkey,3.28 KB, text/plain)
2007-01-14 19:00 UTC, Pacho Ramos
Details
bad mldonkey conf.d file (mldonkey,892 bytes, text/plain)
2007-01-15 11:37 UTC, Pacho Ramos
Details

Note You need to log in before you can comment on or make changes to this bug.
Description spiralvoice 2006-07-20 08:14:22 UTC
Pasted from https://savannah.nongnu.org/bugs/index.php?func=detailitem&item_id=15349
------------------------------
I've noticed that when my dialup connection dies and reconnects that mldonkey is slow to start downloading and uploading normally. I figure this is because there are a lot of stale connections that haven't timed-out. When I used the command close_all_sockets mlnet started uploading again and began finding sources normally again. Maybe it would be beneficial to 'close_all_sockets' or something similar (so the GUI doesn't get disconnected needlessly...). However it probably wouldn't know to close the sockets until one of the connections to a server timed out or something (and when you connect to a new server and obtain a different IP from the last one).
------------------------------

Sending SIGHUP via ip-up script to MLDonkey core closes all connections after
reconnect. Implementing the idea of the OP does not solve the problem because
MLDonkey still must wait for some timeouts of connections.
Comment 1 spiralvoice 2006-08-05 13:38:02 UTC
(In reply to comment #0)

> Maybe it would be beneficial to 'close_all_sockets' or
> something similar (so the GUI doesn't get disconnected needlessly...)

To avoid disconnecting GUIs try this patch which updates SIGHUP behaviour
https://savannah.nongnu.org/patch/?func=detailitem&item_id=5275
Comment 2 Christian Schlotter 2007-01-12 18:39:17 UTC
The aforementioned patch is in MLDonkey since 2.8.0.

I think this bug can be closed as soon as 2.8.2 is stable.
Comment 3 spiralvoice 2007-01-12 20:47:08 UTC
The patch to fix comment 1 is in CVS, correct.

But the SIGHUP command is not part of MLDonkey scripts yet,
this is a useful extension which should be added to the
Gentoo package.
Comment 4 Christian Schlotter 2007-01-12 22:57:11 UTC
Created attachment 106740 [details]
mldonkey.initd
Comment 5 Christian Schlotter 2007-01-12 22:59:50 UTC
Created attachment 106742 [details]
mldonkey.confd

Please find attached an updated init script for MLDonkey.  It now features a "reload" function which sends SIGHUP to the running MLDonkey.  Also introduces is a USE_LOGGER variable, which should be set to true in mldonkey.confd, if the option log_to_syslog is enabled in MLDonkey.  In this case, the script will also specify that it uses the system logger.

I also tried to clean the script up a bit.
Comment 6 Christian Schlotter 2007-01-12 23:13:01 UTC
Created attachment 106743 [details]
mldonkey.initd

BTW spiralvoice, what is the official MLDonkey homepage?  All MLDonkey ebuild currently specify www.nongnu.org/mldonkey...
Comment 7 spiralvoice 2007-01-13 10:42:57 UTC
(In reply to comment #6)
> BTW spiralvoice, what is the official MLDonkey homepage?  All MLDonkey ebuild
> currently specify www.nongnu.org/mldonkey...

This page forwards to http://mldonkey.sourceforge.net
This is the new, official homepage of the project.

MLDonkey project is now split on two platforms:
- Sourceforge for forum, wiki, file release <- user-oriented
- Savannah for CVS, patch/task/bug trackers <- dev-oriented
Comment 8 Christian Schlotter 2007-01-13 11:18:30 UTC
OK, I have opened bug 161875 about it.
Comment 9 Pacho Ramos gentoo-dev 2007-01-13 11:41:52 UTC
It fails when I run the following:
./mldonkey slow
 * Reducing bandwidth to 6k/2k ...                                        [ !! ]

./mldonkey fast
 * Increasing bandwidth to 100k/11k ...                                   [ !! ]

Thanks
Comment 10 Christian Schlotter 2007-01-13 12:09:01 UTC
(In reply to comment #9)
> It fails when I run the following:
> ./mldonkey slow
>  * Reducing bandwidth to 6k/2k ...                                        [ !!
> ]
> 
> ./mldonkey fast
>  * Increasing bandwidth to 100k/11k ...                                   [ !!
> ]

Strange, this works here.  Do you have added you password and username to /etc/conf.d/mldonkey?  Does ist fail immediatly or does it take approximately 10 seconds?
Comment 11 Christian Schlotter 2007-01-13 14:40:38 UTC
(In reply to comment #9)
> It fails when I run the following:
> ./mldonkey slow
>  * Reducing bandwidth to 6k/2k ...                                        [ !!
> ]
> 
> ./mldonkey fast
>  * Increasing bandwidth to 100k/11k ...                                   [ !!
> ]

I forgot to mention that the new init script does only work with >=mldonkey-2.8.0 because it is based on ${FILESDIR}/mldonkey.initd-2.8.  Could it be the case that you use an older version?  There was a slight modification in telnet syntax that forced this change.
Comment 12 Pacho Ramos gentoo-dev 2007-01-14 18:57:42 UTC
(In reply to comment #10)
> (In reply to comment #9)
> > It fails when I run the following:
> > ./mldonkey slow
> >  * Reducing bandwidth to 6k/2k ...                                        [ !!
> > ]
> > 
> > ./mldonkey fast
> >  * Increasing bandwidth to 100k/11k ...                                   [ !!
> > ]
> 
> Strange, this works here.  Do you have added you password and username to
> /etc/conf.d/mldonkey?  Does ist fail immediatly or does it take approximately
> 10 seconds?
> 

immediatly. I attach my init.d file
Comment 13 Pacho Ramos gentoo-dev 2007-01-14 19:00:46 UTC
Created attachment 106985 [details]
bad mldonkey.initd file
Comment 14 Christian Schlotter 2007-01-14 23:28:23 UTC
(In reply to comment #13)
> Created an attachment (id=106985) [edit]
> bad mldonkey.initd file

Sorry, this seems to be a misunderstanding.  The file you attached seems to be exactly the same file as attachment 106743 [details].

I can think of two reasons why the my new init script fails with "slow" and "fast" on your system:

1. You use <mldonkey-2.8.
2. You did not configure your password in the script's configuration file /etc/conf.d/mldonkey (not the *conf.d*, not init.d).

Could you please check if at least one of the above points is true for you?
Comment 15 Christian Schlotter 2007-01-14 23:41:52 UTC
(In reply to comment #14)
> 1. You use <mldonkey-2.8.

OK, this point is invalid.  Only the "info" function in the new init script does not work with older versions of MLDonkey, "fast" and "slow" should work fine with all versions.
Comment 16 Pacho Ramos gentoo-dev 2007-01-15 11:35:00 UTC
(In reply to comment #14)
> (In reply to comment #13)
> > Created an attachment (id=106985) [edit]
> > bad mldonkey.initd file
> 
> Sorry, this seems to be a misunderstanding.  The file you attached seems to be
> exactly the same file as attachment 106743 [details] [edit].
> 
> I can think of two reasons why the my new init script fails with "slow" and
> "fast" on your system:
> 
> 1. You use <mldonkey-2.8.
> 2. You did not configure your password in the script's configuration file
> /etc/conf.d/mldonkey (not the *conf.d*, not init.d).
> 
> Could you please check if at least one of the above points is true for you?
> 

Sorry, I am spanish and I didn't understand it well.

1. I use mldonkey 2.8.2-r1
2. Yes, I have added a user and a password in the last two lines that I have uncommented :-/

Thanks
Comment 17 Pacho Ramos gentoo-dev 2007-01-15 11:37:20 UTC
But the problem persists. I attach my mldonkey conf.d file with a test user and password.
Comment 18 Pacho Ramos gentoo-dev 2007-01-15 11:37:46 UTC
Created attachment 107051 [details]
bad mldonkey conf.d file
Comment 19 Raúl Porcel (RETIRED) gentoo-dev 2007-01-16 15:45:38 UTC
(In reply to comment #18)
> Created an attachment (id=107051) [edit]
> bad mldonkey conf.d file
> 

Works for me...
Comment 20 Pacho Ramos gentoo-dev 2007-01-16 22:27:09 UTC
Your script is fine, I had bad configured my mldonkey.

Thanks a lot :-)
Comment 21 Pacho Ramos gentoo-dev 2007-01-16 22:27:35 UTC
Comment on attachment 106985 [details]
bad mldonkey.initd file

FIXED
Comment 22 Pacho Ramos gentoo-dev 2007-01-16 22:27:50 UTC
Comment on attachment 107051 [details]
bad mldonkey conf.d file

Fixed
Comment 23 Christian Schlotter 2007-01-17 01:32:36 UTC
Spiralvoice, maybe you can help me.  What's the best way to start MLDonkey as a daemon?  The current script does it the following way:

	env MLDONKEY_DIR=${MLDONKEY_DIR} start-stop-daemon --quiet --start \
		-c ${USER} -N ${NICE} -x ${MLDONKEY_BINARY} &>${LOG} &

So it just starts MLDonkey in the background and redirects its output to a logfile.  I don't like this approach because this file is kept open as long as MLDonkey is running.  Is there a cleaner way to do it?  I thought of using the "-daemon" option, but apparently it does not exist anymore:

$ mlnet --help
[...]
-daemon  : this argument was removed, core will exit
[...]

Regards
Christian
Comment 24 spiralvoice 2007-01-17 02:41:08 UTC
(In reply to comment #23)
> What's the best way to start MLDonkey as a daemon?

http://savannah.nongnu.org/task/?4241#comment22

mlnet > /dev/null 2>&1 &

is the way to go, the old --daemon parameter was buggy.
Everything about it can be found using the link above.
Comment 25 Raúl Porcel (RETIRED) gentoo-dev 2007-01-23 12:36:14 UTC
(In reply to comment #23)
> Spiralvoice, maybe you can help me.  What's the best way to start MLDonkey as a
> daemon?  The current script does it the following way:
> 
>         env MLDONKEY_DIR=${MLDONKEY_DIR} start-stop-daemon --quiet --start \
>                 -c ${USER} -N ${NICE} -x ${MLDONKEY_BINARY} &>${LOG} &
> 
> So it just starts MLDonkey in the background and redirects its output to a
> logfile.  I don't like this approach because this file is kept open as long as
> MLDonkey is running.  Is there a cleaner way to do it?  I thought of using the
> "-daemon" option, but apparently it does not exist anymore:
> 
> $ mlnet --help
> [...]
> -daemon  : this argument was removed, core will exit
> [...]
> 
> Regards
> Christian
> 

Any update on this? I'm going to put the init script asap...
Comment 26 Christian Schlotter 2007-01-23 12:49:27 UTC
(In reply to comment #25)
> Any update on this? I'm going to put the init script asap...

Basically the current init script starts MLDonkey as spiralvoice suggested.  We just do not categorically redirect MLDonkey's output to /dev/null, but to a user configured file ${LOG} which defaults to /var/log/mldonkey.log.

So I think the script can be committed as-is.
Comment 27 Raúl Porcel (RETIRED) gentoo-dev 2007-01-24 17:40:52 UTC
Added into 2.8.2-r1. However i edited the net.lo thing. I'm working with the baselayout maintainer to fix this in a clean way.