[systemd-devel] Systemd Questions

Mantas Mikulėnas grawity at gmail.com
Sun Aug 14 14:30:07 UTC 2016


On Sun, Aug 14, 2016 at 3:29 PM, Tom Browder <tom.browder at gmail.com> wrote:

> I am trying to get comfortable with systemd on Debian 8 but am very
> confused by the complex documentation.
>
> I am a simple man with a simple need to be able to modiify startup
> scripts for several packages I build from source which currently are:
>
> + apache (httpd)
> + postgresql
> + bind9
>
> I'm not sure of a few things under systemd:
>
> 1. What exactly is the command to start or stop a service (consider
> the three above)?
>

With native systemd .services, it's taken from the unit's ExecStart= and
ExecStop= (the default for the latter is SIGTERM).

SysV-compat services (see below) just run "/etc/init.d/httpd start", so
everything works as before.

In either case, `systemctl status …` shows the command that was used.

2. Where exactly do I modify starting, status, and stopping parameters
> for a service?
>

With native systemd .services, either use `systemctl edit [--full]`, or
manually copy the .service file to /etc/systemd/system and edit it there
(use `systemctl daemon-reload` afterwards).

With SysV-compat services, either edit the old initscript in /etc/init.d/
(as before), or write a native .service from scratch.


> 3. If Debian 8 is running systemd for a service, why do I need an
> entry for a service in init.d?
>

You don't – it's just that many Debian packages haven't been ported to
systemd yet, therefore systemd still uses the "SysV compatibility" mode for
them (which generates dummy .services with "/etc/init.d/whatever start").


> 4. Do I have to use systemd for a service?  If not, how do I do that?
>

You should. The SysV compat mode had to sacrifice some basic functionality
(like knowing whether the daemon is still running...) in order to still
work with all the weird init.d scripts out there. If nothing else, writing
a native .service might be useful both to learn systemd and to avoid the
several layers of indirection.

-- 
Mantas Mikulėnas <grawity at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20160814/61176f1e/attachment.html>


More information about the systemd-devel mailing list