mldonkey-bugs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Mldonkey-bugs] [bug #11514] start option "-daemon" does not work anymor


From: spiralvoice
Subject: [Mldonkey-bugs] [bug #11514] start option "-daemon" does not work anymore
Date: Wed, 8 Jun 2005 00:10:39 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; de-DE; rv:1.7.7) Gecko/20050418 Firefox/1.0.3 (MOOX M2)

URL:
  <http://savannah.nongnu.org/bugs/?func=detailitem&item_id=11514>

                 Summary: start option "-daemon" does not work anymore
                 Project: mldonkey, a multi-networks file-sharing client
            Submitted by: knocker
            Submitted on: Fre 07.01.2005 um 08:16
                Category: Core
                Severity: 1 - Wish
              Item Group: Feature request
                  Status: Postponed
             Assigned to: None
             Open/Closed: Open
                 Release: 2.5.30.15
                 Release: 
        Platform Version: None
         Binaries Origin: None
                CPU type: None

    _______________________________________________________

Details:

If you quit mldonkey with "kill" from telnet-Interface it don't saves the
*.ini files. 

Stopping mldonkey by Ctrl-C or "kill mlnet" has not this bug.

    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Fre 27.05.2005 um 22:03       By: spiralvoice <spiralvoice>
transformed into feature request for later work

-------------------------------------------------------
Date: Don 26.05.2005 um 10:17       By: spiralvoice <spiralvoice>
See patch #4045

-------------------------------------------------------
Date: Don 26.05.2005 um 10:15       By: spiralvoice <spiralvoice>
"- the bug does not exist in 2.5.16w1"

I don´t think this is true. The patch below shows that also
this core prints "Core stopped" in its logfile when started
with "-daemon".
Yet the bug looks different, from the logfile:
===============================================================
26/ 5, 12:11:04: Core stopped
26/ 5, 12:11:04: Saving shared files and sources
26/ 5, 12:11:04: Options correctly saved
26/ 5, 12:13:35: Core stopped
26/ 5, 12:13:35: Saving shared files and sources
26/ 5, 12:13:35: Options correctly saved
===============================================================
--- ../cvs/knocker-2-5-16w1/src/daemon/driver/driverMain.ml     2005-05-19
00:13:15.000000000 +0200
+++ ./src/daemon/driver/driverMain.ml   2005-05-26 12:08:06.000000000 +0200
@@ -505,10 +505,10 @@
   CommonGlobals.print_localtime ();
   lprintf (_b "Core started\n");
   core_included := true;
-(*
+
   CommonGlobals.do_at_exit (fun _ -> lprintf "Core stopped\n");
   CommonGlobals.do_at_exit (fun _ -> CommonGlobals.print_localtime ());
-*)
+
   if not !keep_console_output then begin
       lprintf (_b "Disabling output to console, to enable: stdout true\n");
===============================================================
This is the result of the patch from 2004/04/06 which solved
another bug, so I still think removing "-daemon" is the way to
go as we have an easy replacement.

-------------------------------------------------------
Date: Don 19.05.2005 um 02:46       By: spiralvoice <spiralvoice>
Some new thoughts about that one:
- the bug does not exist in 2.5.16w1
- I think it was introduced in 2.5.18:
2004/04/06: Fabrice
  - CommonGlobals: only execute 'do_at_exit' in the main process, not
      in the forked ones (should solve bug #7738).


-------------------------------------------------------
Date: Mit 18.05.2005 um 21:37       By: spiralvoice <spiralvoice>
Updated patch so it prints infos when "mlnet -daemon" was executed:
"Option -daemon was removed.
Use 'mlnet > /dev/null 2>&1 &' instead, exiting..."

The core will exit so users are forced to update their scripts.

Most users won´t notice as most common distros don´t use that function
anyway.

-------------------------------------------------------
Date: Mit 18.05.2005 um 21:08       By: spiralvoice <spiralvoice>
Here is a summary how MLDonkey is started on some distros:

Gentoo (mldonkey.initd): /usr/bin/mlnet &>${LOG} &

Debian: uses /usr/bin/mldonkey-server which daemonizes mlnet itself with
"--daemon" option

Fedora(ATrpms):
http://dl.atrpms.net/production/sources/fedora-4-i386/atrpms/mldonkey-2.5.28.1-43.rhfc3.92.at.src.rpm
exec /usr/@lib@/mldonkey/mlnet >> /mldonkey.log 2>&1 < /dev/null" &

PLD:
ftp://ftp.pld-linux.org/dists/2.0/PLD/SRPMS/SRPMS/mldonkey-2.5.30.1-1.src.rpm
exec $MLDONKEY_PATH > ${LOG:-/dev/null} 2>&1

-------------------------------------------------------
Date: Mit 18.05.2005 um 09:34       By: spiralvoice <spiralvoice>
As I wrote in comment #7 starting the core with 

mlnet > /dev/null 2>&1 &

works without problems. Having a function which causes data loss
is also not a good deal. I spent already two hours in debugging
but did not succeed. If no one comes up with a better solution
package maintainers should change to the other way starting the core.

-------------------------------------------------------
Date: Mit 18.05.2005 um 07:21       By: Anonymous
removing functionality used by those who dont use/have init scripts for
mldonkey isnt very user friendly and is a wontfix and not a fix

-------------------------------------------------------
Date: Die 17.05.2005 um 20:17       By: spiralvoice <spiralvoice>
I think we should drop "-daemon", patch attached.

-------------------------------------------------------
Date: Die 17.05.2005 um 20:07       By: spiralvoice <spiralvoice>
It seems the core goes through the stop process once it is started.

gentoo a # ps axHu | grep mlnet
root      2970  0.7  2.8  31896 18112 ?        Ssl  21:58   0:03 ./mlnet
-daemon
root      2970  0.0  2.8  31896 18112 ?        SNsl 21:58   0:00 ./mlnet
-daemon

Process 2969 does not exist anymore, so I think the main thread
is dropped immediatly after core start because when "MlUnix.detach_daemon
()"
is called the core already is threaded. See the comment in the code:
" (* Question: is-it not to late to go in background ? Is-it possible that
we have started some threads already ? What happens then ? *)"

The answer to one is yes, two also, three? Core stops main thread and produces
this bug.

-------------------------------------------------------
Date: Die 17.05.2005 um 20:05       By: spiralvoice <spiralvoice>
>From logfile:

Welcome to MLdonkey
Starting with pid 2969
Options correctly saved on localtime: 17/ 5, 21:58:10
Core started on localtime: 17/ 5, 21:58:10
Disabling output to console, to enable: stdout true


threads are enabled!!

Options correctly saved on localtime: 17/ 5, 21:58:10
 on localtime: 17/ 5, 21:58:10
Core stopped
Core stopped on localtime: 17/ 5, 21:58:10


-------------------------------------------------------
Date: Die 17.05.2005 um 20:00       By: spiralvoice <spiralvoice>
It seems daemon´izing the core does not work properly. For debugging I tested
this patch:

--- ./src/daemon/driver/driverMain.ml   2005-05-17 21:34:42.000000000 +0200
+++ ./src/daemon/driver/driverMain.ml   2005-05-17 21:39:11.000000000 +0200
@@ -659,10 +659,10 @@
           ()
         end else
               close_log ();
-
+
+    if BasicSocket.has_threads () then lprintf "\n\nthreads are
enabled!!\n\n";

 (* Question: is-it not to late to go in background ? Is-it possible that
 we have started some threads already ? What happens then ? *)
       if !daemon then MlUnix.detach_daemon ()
     end
-


-------------------------------------------------------
Date: Mon 09.05.2005 um 12:58       By: spiralvoice <spiralvoice>
Comment #13 is solved by patch #3993

-------------------------------------------------------
Date: Mon 09.05.2005 um 11:42       By: spiralvoice <spiralvoice>
With MinGW core CTRL+C does not save ini files and config_files_space.tmp is
not deleted.

Of course it does not because in ./src/config/mingw/mlUnix.ml
let set_signal signal f = ()

-------------------------------------------------------
Date: Don 14.04.2005 um 22:45       By: Anonymous
the problem is still in 2-5-30-5
I started with 
#./mlnet -log_file log -deamon

end of log file:

>Core started on localtime: 15/ 4, 00:39:06
>Disabling output to console, to enable: stdout true
>Options correctly saved on localtime: 15/ 4, 00:39:08
> on localtime: 15/ 4, 00:39:08
>Core stopped
>Core stopped on localtime: 15/ 4, 00:39:08

the temp file "config_files_space.tmp" is gone
BUT the core is running

-------------------------------------------------------
Date: Fre 01.04.2005 um 17:45       By: Amorphous <amorphous>
kempston and whoever had/has this problem: could you please check if the
problem, that you ini files are not saved, is fixed in 2.5.30ac ?

-------------------------------------------------------
Date: Mit 16.03.2005 um 21:08       By: Amorphous <amorphous>
oh sorry i meant revision 231:
https://opensvn.csie.org/viewcvs.cgi?root=mlnet&rev=231&view=rev

-------------------------------------------------------
Date: Mit 16.03.2005 um 21:04       By: Amorphous <amorphous>
perhaps my revision 228 fixes some of these problems.
https://opensvn.csie.org/viewcvs.cgi?root=mlnet&rev=228&view=rev

-------------------------------------------------------
Date: Don 03.03.2005 um 13:19       By: Fritz Mock <surround>

"from driverMain.ml:

CommonGlobals.do_at_exit (fun _ ->
BasicSocket.close_all ();
Sys.remove security_space_filename;
DriverInteractive.save_config ();

CommonGlobals.print_localtime ();
lprintf (_b "Core stopped\n"));

These commands should be executed every time the core is stopped, regardless
if through process signals (SIGTERM etc.), the "kill"-command or CTRL+C
"

These commands are probably not executed everytime the core is stopped ...

Currently I am lacking time, to take a closer look at it and debug it ...
however:

The first command should -better must- fail with an exception (permission
denied), if mldonkey is stared with the -run_as_user or -run_as_uid options.
Remember, a setuid can only be done with root-privileges and the sockets are
bound prior the setuid with root-privileges. Socket-binding with root
priviledges while not running the core with root privileges is the purpose of
the above options, right?
... I bet due to an exception the game is over for the remaining commands then
...

Not sure about a plain -daemon option, without an additional setuid, a plain
-daemon should save the ini-files.

One can check the neccessary permissions to close the sockets in different
startup-configurations with:

ls -al /proc/$(($(ps -C mlnet -o pid --no-header f|head -n1)))/fd|grep
socket



-------------------------------------------------------
Date: Don 10.02.2005 um 12:23       By: spiralvoice <spiralvoice>
It seems that "-daemon" is the reason why ini files are not saved. Here I
normally start mlnet like this:

/usr/local/bin/nice -n 10 /usr/local/bin/chroot /mnt/mlnet /mlnet > /dev/null
2>&1 &

so, no "-daemon", thats the reason I never experienced that bug...

-------------------------------------------------------
Date: Don 10.02.2005 um 06:41       By: Anonymous
config_files_space.tmp is gone after kill

starting: mlnet -daemon
          --> *.ini not saved & no "Core stopped" in logfile
starting: mlnet -stdout
          --> *.ini saved & and "Core stopped" on console

-------------------------------------------------------
Date: Die 08.02.2005 um 19:48       By: spiralvoice <spiralvoice>
from driverMain.ml:

  CommonGlobals.do_at_exit (fun _ ->
      BasicSocket.close_all ();
      Sys.remove security_space_filename;
      DriverInteractive.save_config ();

      CommonGlobals.print_localtime ();
      lprintf (_b "Core stopped\n"));

These commands should be executed every time the core is stopped, regardless
if through process signals (SIGTERM etc.), the "kill"-command or CTRL+C

Do you get any messages in logfile (try starting with ./mlnet -stdout) when
you issue the kill command in telnet interface?

-------------------------------------------------------
Date: Die 08.02.2005 um 19:37       By: spiralvoice <spiralvoice>
I tried it with 2-5-28r ten times or more and each time the inis
*were* saved wken "kill" was issued through telnet, HTML or sancho.

What about config_files_space.tmp?
Is this file deleted when you kill the core?

-------------------------------------------------------
Date: Die 08.02.2005 um 10:40       By: Anonymous
I can vertify this bug, tried it several times.
version 2-5-28-r

-------------------------------------------------------
Date: Mit 19.01.2005 um 15:37       By: Knocker <knocker>
I tried it several times before posting this bug.

My stats are posted here:
http://mldonkey.org/portal/modules.php?op=modload&name=phpBB2&file=viewtopic&t=5166

And Surround confirmed it.

-------------------------------------------------------
Date: Mon 10.01.2005 um 18:24       By: spiralvoice <spiralvoice>
Can´t confirm that bug with 2-5-28m. Actually I never saw this bug.

Two files compared:
- before killing the core
-rw-r--r--    1 root     root      2653089 Jan 10 19:13 file_sources.ini
-rw-r--r--    1 root     root      2632173 Jan 10 18:53 file_sources.ini.old
- after killing the core on 7:21pm
-rw-r--r--    1 root     root      2662071 Jan 10 19:21 file_sources.ini
-rw-r--r--    1 root     root      2653089 Jan 10 19:13 file_sources.ini.old

Here the core directory before killing the core via telnet:
drwxr-xr-x    2 root     65534        1024 Jun 28  2004 .mldonkey
drwxr-xr-x    2 mlnet    mlnet        1024 Dec 14 13:41 backup
-rw-r--r--    1 root     root         1349 Jan 10 19:13 bittorrent.ini
-rw-r--r--    1 root     root         1349 Jan 10 18:53 bittorrent.ini.old
-rw-r--r--    1 root     root            1 Nov 16 15:13 comments.met
-rw-r--r--    1 root     root     10485760 Jan 10 12:33
config_files_space.tmp
drwxr-xr-x    2 root     root         1024 Aug 13 09:31 dev
-rw-r--r--    1 root     65534        1685 Dec  4 16:47 directconnect.ini
-rw-r--r--    1 root     root        11102 Jan 10 19:13 donkey.ini
-rw-r--r--    1 root     root        11102 Jan 10 18:53 donkey.ini.old
-rw-r--r--    1 root     root        22377 Jan 10 19:13 downloads.ini
-rw-r--r--    1 root     root        22377 Jan 10 18:53 downloads.ini.old
drwxr-xr-x    2 mlnet    mlnet        1024 Feb 10  2004 etc
-rw-r--r--    1 root     root         1303 Jan 10 19:13 fasttrack.ini
-rw-r--r--    1 root     root         1303 Jan 10 18:53 fasttrack.ini.old
-rw-r--r--    1 root     root          951 Jan 10 19:13 fileTP.ini
-rw-r--r--    1 root     root          951 Jan 10 18:53 fileTP.ini.old
-rw-r--r--    1 root     root      2653089 Jan 10 19:13 file_sources.ini
-rw-r--r--    1 root     root      2632173 Jan 10 18:53 file_sources.ini.old
-rw-r--r--    1 root     root       607369 Jan 10 19:13 files.ini
-rw-r--r--    1 root     root       607310 Jan 10 18:53 files.ini.old
-rw-r--r--    1 root     root          116 Jan 10 19:13 friends.ini
-rw-r--r--    1 root     root          116 Jan 10 18:53 friends.ini.old
-rw-r--r--    1 root     root         1793 Jan 10 19:13 gnutella.ini
-rw-r--r--    1 root     root         1793 Jan 10 18:53 gnutella.ini.old
-rw-r--r--    1 root     root         2197 Jan 10 19:13 gnutella2.ini
-rw-r--r--    1 root     root         2197 Jan 10 18:53 gnutella2.ini.old
-rw-r--r--    1 root     root      2520205 Jan  9 06:45 guarding.p2p
drwxr-xr-x    2 mlnet    mlnet        1024 May 30  2004 lib
-rw-------    1 root     root         3370 Jan  4 18:50 messages.log
-rwxr-xr-x    1 root     65534         916 Nov 16 15:13 mldonkey_submit
-rwxr-xr-x    1 root     root      4042984 Jan 10 12:32 mlnet
-rwxr--r--    1 root     65534         291 Nov 16 15:13 mlsubmit.reg
-rw-r--r--    1 root     65534          48 Jan 10 19:13 onlinesig.dat
-rw-r--r--    1 root     65534        1260 Dec  4 16:47 opennap.ini
drwxr-xr-x    2 root     root         1024 Dec  4 16:48 searches
-rw-r--r--    1 root     root         2095 Jan 10 19:13 searches.ini
-rw-r--r--    1 root     root         2095 Jan 10 18:53 searches.ini.old
-rw-r--r--    1 root     root        60413 Jan 10 19:13 servers.ini
-rw-r--r--    1 root     root        60478 Jan 10 18:53 servers.ini.old
-rw-r--r--    1 root     root        61025 Jan 10 19:13 shared_files_new.ini
-rw-r--r--    1 root     root        61025 Jan 10 18:53
shared_files_new.ini.old
drwxr-xr-x    8 mlnet    mlnet        1024 Aug 11 01:24 shares
-rw-r--r--    1 root     65534        1270 Dec  4 16:47 soulseek.ini
-rw-r--r--    1 root     root         1521 Jan 10 19:13 stats.ini
-rw-r--r--    1 root     root         1521 Jan 10 18:53 stats.ini.old
-rw-r--r--    1 root     root        10113 Jan 10 19:13 stats_mod.ini
-rw-r--r--    1 root     root        10113 Jan 10 18:53 stats_mod.ini.old
drwxr-xr-x    5 mlnet    mlnet        2048 Jun 21  2004 torrents

Here the directory after killing the core:

drwxr-xr-x    2 root     65534        1024 Jun 28  2004 .mldonkey
drwxr-xr-x    2 mlnet    mlnet        1024 Dec 14 13:41 backup
-rw-r--r--    1 root     root         1349 Jan 10 19:21 bittorrent.ini
-rw-r--r--    1 root     root         1349 Jan 10 19:13 bittorrent.ini.old
-rw-r--r--    1 root     root            1 Nov 16 15:13 comments.met
drwxr-xr-x    2 root     root         1024 Aug 13 09:31 dev
-rw-r--r--    1 root     65534        1685 Dec  4 16:47 directconnect.ini
-rw-r--r--    1 root     root        11102 Jan 10 19:21 donkey.ini
-rw-r--r--    1 root     root        11102 Jan 10 19:13 donkey.ini.old
-rw-r--r--    1 root     root        22377 Jan 10 19:20 downloads.ini
-rw-r--r--    1 root     root        22377 Jan 10 19:13 downloads.ini.old
drwxr-xr-x    2 mlnet    mlnet        1024 Feb 10  2004 etc
-rw-r--r--    1 root     root         1303 Jan 10 19:21 fasttrack.ini
-rw-r--r--    1 root     root         1303 Jan 10 19:13 fasttrack.ini.old
-rw-r--r--    1 root     root          951 Jan 10 19:21 fileTP.ini
-rw-r--r--    1 root     root          951 Jan 10 19:13 fileTP.ini.old
-rw-r--r--    1 root     root      2662071 Jan 10 19:21 file_sources.ini
-rw-r--r--    1 root     root      2653089 Jan 10 19:13 file_sources.ini.old
-rw-r--r--    1 root     root       607311 Jan 10 19:21 files.ini
-rw-r--r--    1 root     root       607369 Jan 10 19:13 files.ini.old
-rw-r--r--    1 root     root          116 Jan 10 19:21 friends.ini
-rw-r--r--    1 root     root          116 Jan 10 19:13 friends.ini.old
-rw-r--r--    1 root     root         1793 Jan 10 19:21 gnutella.ini
-rw-r--r--    1 root     root         1793 Jan 10 19:13 gnutella.ini.old
-rw-r--r--    1 root     root         2197 Jan 10 19:21 gnutella2.ini
-rw-r--r--    1 root     root         2197 Jan 10 19:13 gnutella2.ini.old
-rw-r--r--    1 root     root      2520205 Jan  9 06:45 guarding.p2p
drwxr-xr-x    2 mlnet    mlnet        1024 May 30  2004 lib
-rw-------    1 root     root         3370 Jan  4 18:50 messages.log
-rwxr-xr-x    1 root     65534         916 Nov 16 15:13 mldonkey_submit
-rwxr-xr-x    1 root     root      4042984 Jan 10 12:32 mlnet
-rwxr--r--    1 root     65534         291 Nov 16 15:13 mlsubmit.reg
-rw-r--r--    1 root     65534          48 Jan 10 19:20 onlinesig.dat
-rw-r--r--    1 root     65534        1260 Dec  4 16:47 opennap.ini
drwxr-xr-x    2 root     root         1024 Dec  4 16:48 searches
-rw-r--r--    1 root     root         2095 Jan 10 19:21 searches.ini
-rw-r--r--    1 root     root         2095 Jan 10 19:13 searches.ini.old
-rw-r--r--    1 root     root        60438 Jan 10 19:21 servers.ini
-rw-r--r--    1 root     root        60413 Jan 10 19:13 servers.ini.old
-rw-r--r--    1 root     root        61025 Jan 10 19:20 shared_files_new.ini
-rw-r--r--    1 root     root        61025 Jan 10 19:13
shared_files_new.ini.old
drwxr-xr-x    8 mlnet    mlnet        1024 Aug 11 01:24 shares
-rw-r--r--    1 root     65534        1270 Dec  4 16:47 soulseek.ini
-rw-r--r--    1 root     root         1521 Jan 10 19:20 stats.ini
-rw-r--r--    1 root     root         1521 Jan 10 19:13 stats.ini.old
-rw-r--r--    1 root     root        10113 Jan 10 19:20 stats_mod.ini
-rw-r--r--    1 root     root        10113 Jan 10 19:13 stats_mod.ini.old
drwxr-xr-x    5 mlnet    mlnet        2048 Jun 21  2004 torrents





    _______________________________________________________

Carbon-Copy List:

CC Address                          | Comment
------------------------------------+-----------------------------
kempston                            | 



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Fre 27.05.2005 um 20:26  Name: no-daemon-reverse.patch  Size: 3,43KB  
By: amorphous
reverse of the applied patch that removed the daemon argument
<http://savannah.nongnu.org/bugs/download.php?item_id=11514&item_file_id=2548>
-------------------------------------------------------
Date: Mit 18.05.2005 um 21:37  Name: no_daemon.patch  Size: 3,47KB   By:
spiralvoice
updated version
<http://savannah.nongnu.org/bugs/download.php?item_id=11514&item_file_id=2514>

    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?func=detailitem&item_id=11514>

_______________________________________________
  Nachricht geschickt von/durch Savannah
  http://savannah.nongnu.org/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]