Re: How to redirect to /run/uncaught-logs/current?

From: Colin Booth <cathexis_at_gmail.com>
Date: Wed, 2 Nov 2016 14:25:05 -0700

On Wed, Nov 2, 2016 at 11:54 AM, Jean Louis <bugs_at_gnu.support> wrote:
> And here is what I wish and don't know how to handle yet:
>
> I have acpid, and I wish that output from acpid is going to
> /run/uncaught-logs/current, and I have it like this, and I get on boot
> screen, the messages:
>
> acpid: starting up with netlink and the input layer, and such other
> messages. What should I do to bring it to the logs? I have tried
> various options.
>
> #!/bin/execlineb -P
> #redirfd -wnb 1 /run/service/s6-svscan-log/fifo
> fdmove -c 2 1
> /usr/sbin/acpid -fl
Check to see where the stdout and stderr for the s6-supervise managing
acpid are pointing. They should be pointed at
/run/service/s6-svscan-log/fifo which has been inherited from
s6-svscan. If it's pointing elsewhere, you should check how s6-svscan
is getting called to make sure that it's getting set correctly. Also,
if you're using s6-linux-init-maker, try regenerating your stage1
script with the -r option to s6-linux-init-maker, which force
redirects stdout and stderr from your stage2 script to the catch-all
logger.
>
> And I have question on udevd, I am running it like this, as I found a
> working script on Github:
>
> #!/bin/execlineb -P
>
> fdmove -c 2 1
> background -d {
> fdmove 1 3
> loopwhilex -o 1
> ifelse { udevadm control --reload-rules } { echo }
> foreground { sleep 1 }
> exit 1
> }
> fdclose 3
> unexport !
> udevd
>
> However, the above script is not writing anything into
> /run/uncaught-logs/current -- am I doing something wrong?
>
The reason nothing is logging into the catch-all logger is because
only the `echo' sends any messages, and that has been redirected into
the s6-supervise readyness fd. If udevd sent any messages on its own,
those would end up getting logged somewhere.
> I appreciate example of other people running udevd.
Thanks! I'm somewhat proud of the lightweight readiness notification
emulator and I'm glad to see it ending up in places outside of the
mailing list.
>
> Then the handling of eth0, I have it like this:
>
> redirfd -wnb 1 /run/service/s6-svscan-log/fifo
> foreground { /sbin/ifconfig eth0 up }
> exec -c
> /sbin/ifconfig eth0 10.0.0.1 up
>
Is this under s6-rc? one-shot scripts are always going to write
messages to where stage2 has its stdout and stderr pointing. You can
either change your stage1 or stage2 scripts to point that in the right
place (either manually or via s6-linux-init-maker), or add `fdmove -c
2 1' after the redirfd call in your oneshot script in order to point
stderr at the fifo as well. As an aside, you don't need the -n or -b
options to redirfd and that might actually be breaking things
depending on where the mode is kept.
>
> and I get this on screen, it is possibly stderr,
>
Yep, stderr. Like I mentioned above, you need to redirect it as well
since you currently have something like:
1w FIFO /run/service/s6-svscan-log/fifo
2w CHR /dev/console

Cheers!

-- 
"If the doors of perception were cleansed every thing would appear to
man as it is, infinite. For man has closed himself up, till he sees
all things thru' narrow chinks of his cavern."
  --  William Blake
Received on Wed Nov 02 2016 - 21:25:05 UTC

This archive was generated by hypermail 2.3.0 : Sun May 09 2021 - 19:44:19 UTC