When I start/stop/restart a daemon (eg. apache2), no message appears. I am on Debian testing (jessie).

On my old server (Debian testing too), messages are displayed:

root@old-server # /etc/init.d/apache2 restart
[ ok ] Restarting web server: apache2.

But not on the new server:

root@new-server # /etc/init.d/apache2 restart

How could I do to view these messages?

The /etc/init.d/apache2 script (same on both servers): http://pastebin.com/RWHpSymG

Thank you!


Functions which provide the output are installed to the /lib/lsb/init-functions.d directory. Most likely you do not have anything there which provides the nice output.

The lsb-base package provides the /lib/lsb/init-functions script which is sourced by your init script. This provides stubs for the functions that produce the output which are overridden by sourcing each file in /lib/lsb/init-functions.d.

Scripts providing these functions should be put there by some package installed as part of your startup system. For example I have systemd on Debian Jessie which provides /lib/lsb/init-functions.d/40-systemd. This outputs a slightly different message when restarting services. For ssh I get:

[ ok ] Restarting ssh (via systemctl): ssh.service.

Most likely you either do not have the correct package installed, the files have somehow been deleted or there is a bug somewhere in the version of the package you are using.

Try doing grep -r Restarting /lib/lsb on both systems to find the file which produces the message (if there is one). You can then use dpkg -S <filename> to find the package that installed it.

  • grep -R Restarting /lib returns "/lib/init/init-d-script". But the /lib/init/init-d-script script is the same on both servers. – Clément DUGAL Oct 5 '14 at 12:38
  • pastebin.com/zueFGpb2 – Clément DUGAL Oct 5 '14 at 12:41
  • @Clément /lib/init/init-d-script isn't used by your init script as far as I can see. /lib/lsb/init-functions is sourced directly which should in turn source everything under /lib/lsb/init-functions.d. That is where the difference should be. – Graeme Oct 5 '14 at 13:18
  • On the new server, there is a 40-systemd additional file. dpkg -S 40-systemd returns systemd but the package isn't installed on the old server. – Clément DUGAL Oct 5 '14 at 14:00
  • @Clément, that sounds more like it. Debian Jessie is the first one to use systemd instead of the old System V. The idea of systemd is actually to move away from using shell scripts for services - you are supposed to use systemctl instead. Looking more closely at the 40-systemd script, I see that it will actually call systemctl for you (hence the via systemctl) in some circumstances. Only then will it print a message, otherwise you get nothing. Note that systemctl itself does not print a message. – Graeme Oct 5 '14 at 14:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.