Auteur: tito Date: À: dng Sujet: Re: [DNG] installing OpenRC on runnng system
On Sun, 30 Jul 2023 11:58:19 +0000
Manfred Wassmann via Dng <dng@???> wrote:
> On Fri, Jul 28, 2023 at 7:34 PM tito via Dng <dng@???> wrote:
>
> > On Fri, 28 Jul 2023 13:46:33 -0400
> > Haines Brown <haines@???> wrote:
> >
> > > I would like to install OpenRC on my running Daedalus system. It is
> > > simple enough to select it during installation of the OS, but what if
> > > I want to install it on my running system? Does installation of the
> > > openrc package simply replace sysV-Init and make openrc default? Is a
> > > reboot needed?
>
>
> definitely! see below
>
>
> > > How would I revert to SysV-Init?
> > Hi,
> > have tried? on chimaera il looks easy:
> >
>
> so it does on Debian bookworm - up to the point where you stopped
>
>
> > apt install openrc
> > [...]
>
> 0 upgraded, 3 newly installed, 1 to remove and 0 not upgraded.
> > Need to get 246 kB of archives.
> > After this operation, 2,165 kB of additional disk space will be used.
> > Do you want to continue? [Y/n]
>
>
> and after that question the interesting part starts. What you generally
> have to observe when replacing the init package in a running system is that
> after the removal of the old package the binary of the running pid 1
> process will be gone as well as any helper software that init needs to
> cleanly shut down the system and you can't simply stop the old pid 1 init
> process as all other processes of the running system were spawned from it.
> The new init will not be able to perform a clean shutdown either or even
> any shutdown at all, because it is not running yet. Hi,
It could be done easier and cleaner, as root:
cp /lib/init/rc.bak /lib/init/rc
cp /lib/init/rcS.bak /lib/init/rcS
mount -o ro,bind //lib/init/rc /etc/init/rc
mount -o ro,bind //lib/init/rcS /etc/init/rcS
/sbin/reboot
System reboots normally, then after reboot clean up:
rm /lib/init/rc*
Ciao,
Tito
> Thus unless there are special precautions provided by the system you should
> be prepared to reboot the hard way after installing the new init package
> (and are really sure it has been installed properly). That means:
>
> 1) to safeguard against filesystem damage mount all viable partitions
> read-only. This can be done by running the command "mount -a -o remount-ro"
> or with a keystroke combination I don't remember if you have SysRq enabled
> in the kernel.
>
> 2) power-cycle the system, i.e. remove the power supply and plug it in
> again, preferrably after a short pause. Probably you also can use a hard
> reboot option via SysRq here.