> > I think the SIGHUP must come from the new PID 1.
>
> I don't know if this will help you, however here is a program that I
> wrote last year that starts a service in the initramfs, it survives
> the systemd killing spree during the transition to the root
> filesystem, a new copy of the program is started from the root
> filesystem, the previous running state is passed from the initramfs to
> the version started from the root filesystem, and the version started
> from the initramfs is gracefully shut down. The program does not have
> the SIGHUP issue that you describe, so maybe there's something here
> that may help you.
>
> https://github.com/masneyb/early-service-example

Thanks very much for this pointer!

I will take a closer look at your code since I would indeed prefer to start my 
process (and systemd-bootchart) in the initrd.

I had tried doing that using "rdinit=" and did observe that the SIGHUP problem 
does not occur in that case (btw, it is SIGHUP followed by SIGCONT).

For systemd-bootchart, after it does some initial set-up, it only reads files 
under /proc (and it keeps a directory stream to /proc open).

Unfortunately, the switch-root operation somehow causes /proc/schedstat to 
become inaccessible, so systemd-bootchart is broken with "rdinit=" as well.

-James M

Reply via email to