On my Ubuntu 16.04 (Xenial) server, I cannot disable services from autostarting at boot. I get these error messages:
$ sudo systemctl disable puppet.service
...
initctl: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused
The script you are attempting to invoke has been converted to an Upstart
job, but lsb-header is not supported for Upstart jobs.
Next time I boot the server, "puppet agent" is running automatically.
I am guessing (from the error messages) that my server is in some weird intermediate state between systemd (which is running) and Upstart. FYI, this server used to run Ubuntu 14 (pre-systemd) and has been upgraded to 15.04, 15.10, and 16.04.
It appears that systemd is running and upstart is not:
$ ps uax|grep init | grep -v grep
root 1 0.0 0.0 119780 6000 ? Ss May20 0:04 /sbin/init
$ ps uax|grep upstart|grep -v grep
$ ps uax|grep systemd|grep -v grep
root 279 0.0 0.0 35368 3276 ? Ss May20 0:01 /lib/systemd/systemd-journald
root 306 0.0 0.0 45956 5384 ? Ss May20 0:00 /lib/systemd/systemd-udevd
systemd+ 703 0.0 0.0 100324 2532 ? Ssl May20 0:00 /lib/systemd/systemd-timesyncd
root 709 0.0 0.0 20100 2824 ? Ss May20 0:00 /lib/systemd/systemd-logind
root 716 0.0 0.0 29880 1564 ? Ss May20 0:00 /sbin/cgmanager -m name=systemd
message+ 727 0.0 0.0 52848 5668 ? Ss May20 0:00 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation
I read the SystemdForUpstartUsers wiki page and confirmed that the packages systemd-sysv and ubuntu-standard are installed, and upstart-sysv is not. So I appear to have the right packages. I've also googled (in vain) these error messages but have not found a solution.
Full error message:
$ sudo systemctl disable puppet.service
Synchronizing state of puppet.service with SysV init with /lib/systemd/systemd-sysv-install...
Executing /lib/systemd/systemd-sysv-install disable puppet
insserv: warning: current start runlevel(s) (empty) of script `puppet' overrides LSB defaults (2 3 4 5).
insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script `puppet' overrides LSB defaults (0 1 6).
initctl: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused
The script you are attempting to invoke has been converted to an Upstart
job, but lsb-header is not supported for Upstart jobs.
insserv: warning: script 'screen-cleanup' missing LSB tags and overrides
insserv: Default-Start undefined, assuming empty start runlevel(s) for script `screen-cleanup'
insserv: Default-Stop undefined, assuming empty stop runlevel(s) for script `screen-cleanup'
insserv: warning: current start runlevel(s) (empty) of script `puppet' overrides LSB defaults (2 3 4 5).
insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script `puppet' overrides LSB defaults (0 1 6).
initctl: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused
The script you are attempting to invoke has been converted to an Upstart
job, but lsb-header is not supported for Upstart jobs.
insserv: warning: script 'screen-cleanup' missing LSB tags and overrides
insserv: Default-Start undefined, assuming empty start runlevel(s) for script `screen-cleanup'
insserv: Default-Stop undefined, assuming empty stop runlevel(s) for script `screen-cleanup'
Any help appreciated!!
Updated 2016-05-24:
If I remove the associated /etc/init.d script (such as /etc/init.d/puppet in the above example), the error messages go away. Presumably systemd is using /lib/systemd/system/puppet.service instead...?