[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Switching between init systems



Hi.

What is the official method to switch between init systems in Jessie?
While playing around with this a bit in a VM, I found that it is
possible to switch back and forth between systemd and sysvinit just
by installing/removing the respective package containing /sbin/init
and then rebooting:

apt install sysvinit-core && reboot

while running systemd and

apt install systemd-sysv && reboot

while running sysvinit works. Also switching to Upstart from either
one with

apt install upstart && reboot

works. But switching from Upstart to systemd or sysvinit doesn't:



Upstart -> sysvinit:

root@debian:~# apt install sysvinit-core
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  upstart
The following NEW packages will be installed:
  sysvinit-core
0 upgraded, 1 newly installed, 1 to remove and 0 not upgraded.
Need to get 0 B/132 kB of archives.
After this operation, 1,621 kB disk space will be freed.
Do you want to continue? [Y/n] 
Preconfiguring packages ...
dpkg: upstart: dependency problems, but removing anyway as you requested:
 init depends on systemd-sysv | sysvinit-core | upstart; however:
  Package systemd-sysv is not installed.
  Package sysvinit-core is not installed.
  Package upstart is to be removed.

(Reading database ... 144523 files and directories currently installed.)
Removing upstart (1.11-4) ...
Processing triggers for man-db (2.7.0.2-3) ...
Selecting previously unselected package sysvinit-core.
(Reading database ... 144442 files and directories currently installed.)
Preparing to unpack .../sysvinit-core_2.88dsf-57_amd64.deb ...
Unpacking sysvinit-core (2.88dsf-57) ...
Processing triggers for man-db (2.7.0.2-3) ...
Setting up sysvinit-core (2.88dsf-57) ...
sysvinit: creating /run/initctl
sysvinit: restarting...init: timeout opening/writing control channel /run/initctl
.init: timeout opening/writing control channel /run/initctl
.init: timeout opening/writing control channel /run/initctl
.init: timeout opening/writing control channel /run/initctl
.init: timeout opening/writing control channel /run/initctl
.init: timeout opening/writing control channel /run/initctl
.init: timeout opening/writing control channel /run/initctl
.init: timeout opening/writing control channel /run/initctl
 failed.
root@debian:~# reboot

Broadcast message from root@debian (pts/0) (Fri Nov 21 10:29:47 2014):

The system is going down for reboot NOW!
shutdown: timeout opening/writing control channel /run/initctl
init: timeout opening/writing control channel /run/initctl
root@debian:~# 





and Upstart -> systemd:

root@debian:~# apt install systemd-sysv
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  upstart
The following NEW packages will be installed:
  systemd-sysv
0 upgraded, 1 newly installed, 1 to remove and 0 not upgraded.
Need to get 0 B/29.1 kB of archives.
After this operation, 1,802 kB disk space will be freed.
Do you want to continue? [Y/n] 
dpkg: upstart: dependency problems, but removing anyway as you requested:
 init depends on systemd-sysv | sysvinit-core | upstart; however:
  Package systemd-sysv is not installed.
  Package sysvinit-core is not installed.
  Package upstart is to be removed.

(Reading database ... 144523 files and directories currently installed.)
Removing upstart (1.11-4) ...
Processing triggers for man-db (2.7.0.2-3) ...
Selecting previously unselected package systemd-sysv.
(Reading database ... 144442 files and directories currently installed.)
Preparing to unpack .../systemd-sysv_215-5+b1_amd64.deb ...
Unpacking systemd-sysv (215-5+b1) ...
Processing triggers for man-db (2.7.0.2-3) ...
root@debian:~# reboot
Failed to talk to init daemon.





Am I doing something wrong, is this method not supposed to work, or
is this a bug in Upstart/sysvinit/systemd?

I know that I could first install sysvinit or systemd, then reboot with
init=/lib/sysvinit/init or init=/lib/systemd/systemd and then install
sysvinit-core or systemd-sysv. But after reading
https://wiki.debian.org/FAQsFromDebianUser#How_can_I_prevent_systemd_to_run_as_PID_1_.28init.29_on_Jessie.3F
, I thought that the simple "install the new init system while running
the old one and then reboot"-method was supposed to work.

Thanks,
Thorsten Holzman


Reply to: