[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Survey answers part 2: the systemd transition

Hi Vincent,

Vincent Danjean <vdanjean.ml@free.fr> writes:
> Thank you for this article. Reading it make me think about something
> I would like to know: if I install systemd and boot with it (using grub
> parameter) as described in the article, what occurs when I type
> /etc/init.d/apache2 start
Fair question.

When you invoke /etc/init.d/apache2 on a machine where the systemd
package is installed, /lib/lsb/init-functions.d/40-systemd will be
invoked because the init script includes /lib/lsb/init-functions¹.

This mechanism will then check whether you are actually running systemd
as PID 1. If so, your action will be diverted to a systemctl call.

The two cases below are equivalent from that point of view — both result
in “systemctl start apache2.service”.

> A) when apache2.service exists in the system
apache2.service will be started; its ExecStart line is something like
/usr/sbin/apache2ctl start (this is just an example!).

> B) when apache2.service does not exist
apache2.service will be started; its ExecStart line is
/etc/init.d/apache2 start, so systemd will run the init script for you.

Hope that helps.

① In case the init script does not, that’s a problem. We’ll have a
  lintian check in place real soon to warn about this.

Best regards,

Reply to: