Philippe Teuwen wrote:
Package: laptop-mode-tools
Version: 1.11-1
Severity: normal
Tags: patch

When setting VERBOSE_OUTPUT=1 it truncated /var/log/acpid and only
the last few lines are present.
This is due to the "> /dev/stdout" redirections.
This is solved by changing them to ">> /dev/stdout"

Hyper-compressed patch :-)
    sed -i 's/ \(> \?$OUTPUT\)/ >\1/g;' laptop_mode

BTW maybe this should be notified to the acpid maintainer as well
as this is not normal that a simple "client" handler can kill
all the logfile of acpid!

Just for fun because it puzzled me:
    $ echo one > /tmp/t; ( echo two >/dev/stdout ) >> /tmp/t;cat /tmp/t
    two
So you can indeed destroy a file even with the >> operator!

Wow. This is REALLY weird. Apparently >> simply attaches the output file descriptor to the given file, and the > operator simply does the same but it truncates the output file after attaching. Nice find. :-)

And apparently the logging of acpid is not handled by any syslog daemon. I agree that we should report this to the acpid maintainer as well. As you reported the bug, would you like to take care of this?

--Bart


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to