[Pkg-sysvinit-devel] Bug#638019: /run/initctl
Roger Leigh
rleigh at codelibre.net
Sun Jan 8 14:14:51 UTC 2012
On Sun, Jan 08, 2012 at 03:01:57PM +0100, Robert Millan wrote:
> El 8 de gener de 2012 15:00, Robert Millan <rmh at debian.org> ha escrit:
> > El 8 de gener de 2012 14:56, Roger Leigh <rleigh at codelibre.net> ha escrit:
> >> The postinst currently calls "init u", but I think that's problematic--
> >> it would call the new binary using the new path.
> >
> > On the contrary, isn't this precisely what we wanted? No symlink needed then.
>
> Uhm, not sure if I understood correctly what "init u" does. Anyway,
> I'd propose this approach:
>
> - Create a new fifo in new path (no symlink).
> - Install new binaries (both sides) which use the new path.
> - Force init re-exec using a signal.
>
> It seems much simpler than messing with symlinks or adding on-reboot
> triggered actions.
The problem is that there isn't a signal to force a re-exec. You
have to do it through the control pipe. "init u" sends the signal
through the pipe to trigger the re-exec, which requires that the
old pipe be present. Because the new binaries will use the new
path, "init u" on its own won't work. I would suggest this strategy:
1) Create /run/initctl
2) Symlink /dev/initctl (or /etc/.initctl) to /run/initctl
3) Send SIGUSR1 to init
→ init reopens using the old path, but is redirected to use
/run/initctl
4) Wait for that action to complete
5) Run "init q" to re-exec init. The new init will use the new
paths
6) Delete the no-longer-needed /dev/initctl (or /etc/.initctl).
Regards,
Roger
--
.''`. Roger Leigh
: :' : Debian GNU/Linux http://people.debian.org/~rleigh/
`. `' Printing on GNU/Linux? http://gutenprint.sourceforge.net/
`- GPG Public Key: 0x25BFB848 Please GPG sign your mail.
More information about the Pkg-sysvinit-devel
mailing list