screen-users
[Top][All Lists]
Advanced

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

Re: Auto-logging does not start for detached session


From: Rod Nussbaumer
Subject: Re: Auto-logging does not start for detached session
Date: Fri, 16 Feb 2007 12:26:45 -0800
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.9) Gecko/20061220 Red Hat/1.0.7-0.1.el4 SeaMonkey/1.0.7

Alexander Kriegisch wrote:
Having explained all this for your understanding, here is the actual
problem: Logging never really starts before I explicitly attach the
detached session at least once. After the login message has been saved
to the logfile, nothing else is logged anymore. Attaching and detaching
the session again fixes this behaviour.

Sample script:

#!/bin/sh

# start clean session
DIR=/var/tmp/fritzterm
rm -rf $DIR
mkdir $DIR
cd $DIR

# create detached screen session with auto-logging
screen -dm -L -S fritzterm
# maybe decreasing the flush interval helps?
screen -S fritzterm -X logfile flush 0
# issue remote command inside the session
screen -S fritzterm -X exec ls -l /

# wait a moment, then check log file's content
sleep 2
cat /var/tmp/fritzterm/screenlog.0

Unfortunately the effect is as described above. No logging whatsoever,
no matter hown many commands are issued to the screen session. Attaching
the session shows the same: nothing except the shell's welcome message
is there. But from that moment on evetything is neatly logged, no matter
if the session is attached or detached.

How can I solve this problem?

I, too, have seen this problem, but not limited to starting logging. A detached screen seems to ignore all commands sent to it until has become attached at least once (seems, to. I've never done exhaustive testing of this). My workaround was a monumental hack, but works. I start sessions with a $DISPLAY variable that points to a xvfb (X Virtual Frame Buffer). This allows it to start up as an attached screen, without having to have a physical terminal to display stuff on (I do this in rc.local, so there is no terminal, yet). Then, my script issues commands to do, among other things, turn on logging.
Is this behavior intended, or a bug? I am running

Screen version 4.00.02 (FAU) 5-Dec-03

Linux 2.6.9-42.0.2.ELsmp #1 SMP Tue Aug 22 17:26:55 CDT 2006 i686 i686 i386 GNU/Linux.

   ---   rod.





reply via email to

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