The officially official Devuan Forum!

You are not logged in.

#1 2023-06-27 13:27:42

bigcat
Member
Registered: 2023-05-10
Posts: 29  

[SOLVED] Switching between init choices

Greetings All,

If I chose runit as a system init during installation, and would like to switch to sysvinit, is it a simple matter of installing sysvinit-core  and sysvinit packages?

I tested this in a VM and it seemed to work.

Thanks.

Offline

#2 2023-06-27 17:38:14

bigcat
Member
Registered: 2023-05-10
Posts: 29  

Re: [SOLVED] Switching between init choices

It worked on my desktop, too.  The only problem is that I could not reboot afterwards and had to power cycle the machine.

Offline

#3 2023-06-27 18:26:49

aitor
Member
From: basque country
Registered: 2016-12-03
Posts: 223  
Website

Re: [SOLVED] Switching between init choices

I don't recommend you to change the init system from a running system next time. The already running init, whether runit-init or sysvinit, will be removed and the system won't shutdown properly. For example, it won't be able to determine the current runlevel. For this reason, I suggest you to use a live system instead.

From the live session, run the following command to determine the partitions. One sample:

liveuser@devuan:~$ lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
loop0    7:0    0 756.3M  1 loop /lib/live/mount/rootfs/filesystem.squashfs
loop1    7:1    0   4.9M  0 loop /dev/metadata/hwdb
sda      8:0    0 465.8G  0 disk 
├─sda1   8:1    0  93.2G  0 part 
├─sda2   8:2    0     1K  0 part 
├─sda5   8:5    0 368.8G  0 part /mnt
└─sda6   8:6    0   3.7G  0 part 
sdb      8:16   1   7.2G  0 disk 
├─sdb1   8:17   1   877M  0 part /lib/live/mount/medium
└─sdb2   8:18   1   1.4M  0 part 
sr0     11:0    1  1024M  0 rom

In this concrete case /dev/sda1 is the root partition (/) in the attached internal disk, /dev/sda5 the home partition and /dev/sda6 the swap. Mount  the root partition (i.e. the system) in /mnt with the command:

# mount --rw /dev/sda1 /mnt

bind /sys, /proc and /dev and chroot the mounted system:

# mount -o bind /sys /mnt/sys
# mount -t proc proc /mnt/proc
# mount -o bind /dev /mnt/dev
# mount -o bind /dev/pts /mnt/dev/pts
# chroot /mnt

Now you're in a chroot jail and you'll be able to use apt within the mounted system. Install sysvinit-core and runit-init will be removed automatically. In addition, you an also purge other superfluous packages like runit and getty-run:

# apt-get update
# apt-get install sysvinit-core
# dpkg --purge runit getty-run
# apt-get clean

Exit the jail and unmount the partitions:

# exit
# umount /mnt/dev/pts
# umount /mnt/dev
# umount /mnt/proc
# umount /mnt/sys
# umount /mnt

Done.


If you work systematically, things will come by itself (Lev D. Landau)

Offline

#4 2023-06-27 19:33:55

Lorenzo
Member
Registered: 2020-03-03
Posts: 36  

Re: [SOLVED] Switching between init choices

It worked on my desktop, too.  The only problem is that I could not reboot afterwards and had to power cycle the machine.

Next time do the following:

1. install sysvinit-core (it will remove runit-init package), but don't remove the runit package (yet);
2. tell runit to reboot the system with

# /lib/runit/runit-init 6

(see man runit-init for details)

After you reboot into sysvinit you can safely remove the runit package too

Lorenzo

Offline

#5 2023-06-27 21:01:24

aitor
Member
From: basque country
Registered: 2016-12-03
Posts: 223  
Website

Re: [SOLVED] Switching between init choices

Thanks Lorenzo. I thought that /lib/runit/runit-init was installed in runit-init, but it belongs to runit.


If you work systematically, things will come by itself (Lev D. Landau)

Offline

#6 2023-07-01 14:34:01

mweishaar
Member
Registered: 2018-11-11
Posts: 36  

Re: [SOLVED] Switching between init choices

Could you also just install it from grub?

- when grub menu comes up at boot press e
- on the boot line (w/vmlinuz) add init=/bin/sh to the end
- ctrl-x will boot to a shell
- uninstall/install inits
- hard restart

I've done this to get to a shell, but didn't try the init uninstall/install

Last edited by mweishaar (2023-07-01 14:35:03)

Offline

Board footer