aMule Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're back! (IN POG FORM)

Author Topic: amuled and stdout?  (Read 3650 times)

Kisja

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 12
amuled and stdout?
« 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
« Last Edit: June 23, 2005, 06:27:29 PM by Kisja »
Logged

ken

  • Hero Member
  • *****
  • Karma: 4
  • Offline Offline
  • Posts: 825
RE: amuled and stdout?
« Reply #1 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.
Logged

stefanero

  • Some Support
  • Developer
  • Hero Member
  • *****
  • Karma: 8
  • Offline Offline
  • Posts: 4235
Re: amuled and stdout?
« Reply #2 on: June 24, 2005, 08:17:06 AM »

well if you look at the log from amuleweb it works actually....
Logged
In its default setup, Windows XP on the Internet amounts to a car
parked in a bad part of town, with the doors unlocked, the key in
the ignition and a Post-It note on the dashboard saying, "Please
don't steal this."

Kisja

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 12
Re: amuled and stdout?
« Reply #3 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?
Logged

stefanero

  • Some Support
  • Developer
  • Hero Member
  • *****
  • Karma: 8
  • Offline Offline
  • Posts: 4235
Re: amuled and stdout?
« Reply #4 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
Logged
In its default setup, Windows XP on the Internet amounts to a car
parked in a bad part of town, with the doors unlocked, the key in
the ignition and a Post-It note on the dashboard saying, "Please
don't steal this."

Kisja

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 12
Re: amuled and stdout?
« Reply #5 on: June 24, 2005, 12:23:17 PM »

aaahh, ok!
But log and debuglog are equal (I see always the same log)!?
Logged

stefanero

  • Some Support
  • Developer
  • Hero Member
  • *****
  • Karma: 8
  • Offline Offline
  • Posts: 4235
Re: amuled and stdout?
« Reply #6 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
Logged
In its default setup, Windows XP on the Internet amounts to a car
parked in a bad part of town, with the doors unlocked, the key in
the ignition and a Post-It note on the dashboard saying, "Please
don't steal this."

Kisja

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 12
Re: amuled and stdout?
« Reply #7 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.
Logged

stefanero

  • Some Support
  • Developer
  • Hero Member
  • *****
  • Karma: 8
  • Offline Offline
  • Posts: 4235
Re: amuled and stdout?
« Reply #8 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...
Logged
In its default setup, Windows XP on the Internet amounts to a car
parked in a bad part of town, with the doors unlocked, the key in
the ignition and a Post-It note on the dashboard saying, "Please
don't steal this."

lfroen

  • Guest
Re: amuled and stdout?
« Reply #9 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.
Logged

Kisja

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 12
Re: amuled and stdout?
« Reply #10 on: June 25, 2005, 12:04:26 AM »

Sure, but if I use -f  the ~/.aMule/logfile ist empty! Is that a Bug?
Logged

lfroen

  • Guest
Re: amuled and stdout?
« Reply #11 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.
Logged