На моем сервере Ubuntu 16.04 (Xenial) я не могу отключить автозапуск служб при загрузке. Я получаю следующие сообщения об ошибках:
$ 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.
При следующей загрузке сервера автоматически запускается «агент марионеток».
Я предполагаю (из сообщений об ошибках), что мой сервер находится в каком-то странном промежуточном состоянии между systemd (который работает) и Upstart. К вашему сведению, этот сервер использовался для запуска Ubuntu 14 (pre-systemd) и был обновлён до 15.04, 15.10 и 16.04.
Похоже, что systemd работает, а upstart нет:
$ 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
Я прочитал вики-страницу SystemdForUpstartUsers и подтвердил, что пакеты systemd-sysv
и ubuntu-standard
установлены, и upstart-sysv
нет. Так что у меня, похоже, есть нужные пакеты. Я также (напрасно) гуглил эти сообщения об ошибках, но не нашел решения.
Полное сообщение об ошибке:
$ 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'
Любая помощь приветствуется !!
Обновлено 2016-05-24:
Если я удалю связанный /etc/init.d
сценарий (например, /etc/init.d/puppet
в приведенном выше примере), сообщения об ошибках исчезают. Предположительно systemd использует /lib/systemd/system/puppet.service
вместо ...?