1

I have a virtual server running Debian. For some reason it doesn't boot if I am using sysvinit. I assume the problem lies with the host operating system, since it's a Virtuozzo based machine and not fully virtual. It does boot when using upstart though. The problem is that I am also using cron-apt which reinstalls sysvinit every time an update arrives. Is there any way to tell Debian to use upstart as default? Or to lock it in place using apt?

Update:

I tried the solution suggested below and it seems to work. The correct syntax for the apt preferences is this:

Package: sysvinit
Pin: origin ""
Pin-Priority: -1
Arne
  • 843

1 Answers1

1

This is similar to the existing question Upstart on Debian?

Regardless of version, it must be disclaimed that running upstart as the init system in Debian seems to be "at your own risk". That being said...

In Debian Wheezy (oldstable as of 2015), the sysvinit package is marked Essential, which is probably why the upstart isn't very "sticky".

Two mechanisms that can be used to place restrictions on apt's behavior are apt_preferences and dpkg blacklisting. apt_preferences are described in files under /etc/apt/preferences.d/; read the man page linked above.

dpkg blacklisting is described in a nixCraft blog post. You could try:

echo "sysvinit hold" | sudo dpkg --set-selections

As of Debian Jessie (stable as of 2015), the sysvinit package is a transitional package and no longer essential:

This package depends on init, which is an essential package that pulls in the default init system. Starting with jessie, this will be systemd on Linux. It facilitates a smooth transition and provides a fallback SysV init binary which can be used to boot the system via the init=/lib/sysvinit/init kernel command line parameter in case the system fails to start after the switch to systemd.

If your system successfully boots with systemd or if you have chosen to stick with sysvinit-core, this package can be removed safely.

So I would guess that you aren't running Jessie, but if you are you could try the Wheezy solutions described above.

bnewbold
  • 666
  • Year, I am currently running Wheezy. Haven't upgraded yet. – Arne Aug 07 '15 at 05:09
  • I was trying out your apt_preferences suggestion. However I don't get the man page... I see settings to change priorities. But how would I make upstart "sticky"? – Arne Aug 09 '15 at 05:47
  • I would try setting the priority for upstart very high (> 1000) and the priority for sysvinit very low (negative) – bnewbold Aug 10 '15 at 03:21
  • I found out that you also need to use the Pin: origin="", because apt-preferences is usually for pinning where the packages come from. The empty string allows you to just pin any package despite of its origin. – Arne Aug 10 '15 at 12:32
  • This answer is now out of date. Upstart has actually been removed from Debian as of version 9. – JdeBP Aug 31 '17 at 11:16