4

I am running Ubuntu 12.04.3 LTS and installed several services like Samba, DHCP server, ...

I receive the following warning when I run "halt now", "telinit 6" or similar:

Since the script you are attempting to invoke has been converted
to an Upstart job, you may also use the...

I can see that the affected services try to stop/start twice. Once through the Upstart job and again through the S/K symlinks in the /etc/rcN.d folder which target the init.d script. Probably I can simply remove the symlink in the /etc/rcN.d folder.

Example flow:

  1. Run 'halt now' from shell
  2. Upstart stops Samba (because there is a Upstart conf file for Samba)
  3. SysV tries to stop Samba again (because there is also a /etc/rc0.d/K20smbd symlink)

I don't understand/want step 3 as it seems unnecessary and shows an ugly warning.

Why are there both, the Upstart script and and the symlinks to the init.d script, for several daemons? Is it the correct way that I have to manually clean up the duplicate symlinks in each /etc/rcN.d folder?

Alex
  • 321

2 Answers2

1

Ubuntu has compatibility init links that calls their counterparts upstart's whenever you run them.

If you call for example sudo /etc/init.d/apache start you get linked to upstart-job that presents you a nice information message that you should use sudo services apache start and then it runs the command by itself.

ls -l /etc/init.d/network-manager 
lrwxrwxrwx 1 root root 21 Sep 18 14:02 /etc/init.d/network-manager -> /lib/init/upstart-job

cat /lib/init/upstart-job
#!/bin/sh -e
# upstart-job
#
# Symlink target for initscripts that have been converted to Upstart.
{ lots of ASCII awesomeness }
Braiam
  • 35,991
  • That is a nice reminder when I accidentally run the old init.d script manually. But why are there symlinks in the rcN.d directories as well (updated question to be more specific)? – Alex Sep 18 '13 at 21:13
  • I think this is what you are looking for http://unix.stackexchange.com/a/83752/41104 – Braiam Sep 18 '13 at 21:23
  • I understand that a service can be active in different runlevels. I don't understand why SysV and Upstart are used in parallel. I added an example to the question. – Alex Sep 18 '13 at 21:25
0

I figured out this is a misconfiguration in my Puppet scripts.

The 'service' type attribute 'enable' created the SysV init script instead of recognizing the Upstart script.

Alex
  • 321