aMule Forum

English => aMule Help => Topic started by: Kisja on June 23, 2005, 06:10:07 PM

Title: amuled and stdout?
Post by: Kisja on June 23, 2005, 06:10:07 PM
Hi,
How does the output of amuled work? When I run amuled without any options, I get the output (error messages and so on) in the console. I would like to write these messages to a separate logfile. But if I run
"amuled >/tmp/log_amuled 2>/tmp/log_amuled_err"
or
"amuled -o >/tmp/log_amuled 2>/tmp/log_amuled_err"
the logfiles are empty.
I ve also tried to run amuled as the (yes existing) amule user with su:
su -c "(/usr/local/amuled -o >/tmp/log_amuled 2>/tmp/log_amuled_err)" amule
The logfiles are still empty when using su, but only until amuled stops (?!?!?!), when amuled ist stopped, the whole output is written to the logfile at once.

If I use -f (fork) the file /home/amule/.aMule/logfile ist also empty.

Is this the right behaviour? Are there any other Options I could use?

Regards,
Kisja
Title: RE: amuled and stdout?
Post by: ken on June 24, 2005, 12:33:49 AM
I think what's happening is that output to files is being buffered while output to the terminal is unbuffered, or maybe line buffered.

I don't know if this is a function of how the shell does output redirection, or if amuled should be doing something differently internally.
Title: Re: amuled and stdout?
Post by: stefanero on June 24, 2005, 08:17:06 AM
well if you look at the log from amuleweb it works actually....
Title: Re: amuled and stdout?
Post by: Kisja on June 24, 2005, 11:55:00 AM
Hi,

@ken: ok this could be the reason.

I use /bin/sh, is it possible to configure this function?

@stefanero: Not really, if I run amuleweb with
"amuleweb >>/var/log/amuleweb_log"
"cat /var/log/amuleweb_log"


Erstelle Client...
Verbindung wird hergestellt....
Benutze Host 'localhost' Port: 4712
Versuche zu verbinden (Timeout = 10sek)...
Verbindung hergestellt zu aMule 2.0.3

---------------------------------
|       aMule Web Server        |
---------------------------------


Benutze 'Help' für eine Liste der Kommandos

Webserver: gestartet
aMuleweb$ Syntax Fehler!
aMuleweb$ Syntax Fehler!
aMuleweb$ Syntax Fehler!
aMuleweb$ Syntax Fehler!
aMuleweb$ Syntax Fehler!
aMuleweb$ Syntax Fehler!
aMuleweb$ Syntax Fehler!
aMuleweb$ Syntax Fehler!
aMuleweb$ Syntax Fehler!
aMuleweb$ Syntax Fehler!
aMuleweb$ Syntax Fehler!
aMuleweb$ Syntax Fehler!
aMuleweb$ Syntax Fehler!
aMuleweb$ Syntax Fehler!
aMuleweb$ Syntax Fehler!
aMuleweb$ Syntax Fehler!
aMuleweb$ Syntax Fehler!
aMuleweb$ Syntax Fehler!
aMuleweb$ Syntax Fehler!
aMuleweb$ Syntax Fehler!

WSThread: Thread started
WSThread: created service
aMuleweb$ Syntax Fehler!
aMuleweb$ Syntax Fehler!
aMuleweb$ Syntax Fehler!
aMuleweb$ Syntax Fehler!
........................


And the logfile grows VERY FAST!

Any Ideas?
Title: Re: amuled and stdout?
Post by: stefanero on June 24, 2005, 12:14:41 PM
noooo ;)
I said it a little wrong....
I mean run amuleweb normal with

amuleweb -q &

for example

then open a browser, login and then select log, or server log or debug log....those 3 logs can be read from within amuleweb

stefanero
Title: Re: amuled and stdout?
Post by: Kisja on June 24, 2005, 12:23:17 PM
aaahh, ok!
But log and debuglog are equal (I see always the same log)!?
Title: Re: amuled and stdout?
Post by: stefanero on June 24, 2005, 12:42:42 PM
I think only when you have debug enabled they differ....
there is in the gui-preferences a setting to enable it, but not sure howtodo that with amuled, sorry
but if you have no problems with amuled leave it disabled since it eats a lot of cpu...

stefanero
Title: Re: amuled and stdout?
Post by: Kisja on June 24, 2005, 01:17:57 PM
How is this option called in the amule.conf? I could try to add it manually for amuled.
Title: Re: amuled and stdout?
Post by: stefanero on June 24, 2005, 01:20:20 PM
I dont have debug enabled sorry,
since it eats to much cpu and most infos are only good for Kry Xaignar and a couple other...
Title: Re: amuled and stdout?
Post by: lfroen on June 24, 2005, 10:26:02 PM
when running with "-f" or "--full-daemon" there's nothing on stdout, since process is detaching from controlling terminal and stdio is redirected to /dev/null.
Title: Re: amuled and stdout?
Post by: Kisja on June 25, 2005, 12:04:26 AM
Sure, but if I use -f  the ~/.aMule/logfile ist empty! Is that a Bug?
Title: Re: amuled and stdout?
Post by: lfroen on June 25, 2005, 05:12:25 AM
Hmm, actually it happens to me too. I think logfile doesn't get flushed right. You can use webserver to see it. And yes, I will fix it eventually.