Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #180130

Re: Systemd services (was Re: If Linux Is About Choice, Why Then ...)

From Nicolas George <george@nsup.org>
Newsgroups linux.debian.user
Subject Re: Systemd services (was Re: If Linux Is About Choice, Why Then ...)
Date 2017-04-14 15:40 +0200
Message-ID <tw9Ca-1Db-11@gated-at.bofh.it> (permalink)
References <tvUjL-fo-7@gated-at.bofh.it> <tw8Zr-1bB-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

Le quintidi 25 germinal, an CCXXV, Greg Wooledge a écrit :
> Some day there will be actual end-user-friendly systemd documentation
> somewhere, consolidating all of these pieces of wisdom together.  I hope.

Note: systemd is not for end-users, it is for system administrator and
distribution authors.

> 1) To override parts of a distribution's systemd unit locally, you MUST
>    use the foo.service.d/ method.  You can't just put the override bits
>    into an /etc/systemd/system/foo.service file.  That would be too easy.

foo.service.d/*.conf            is for overriding bits.
/etc/systemd/system/foo.service is for overriding the whole file.

I find that fairly natural. Otherwise, how would you override the whole
file?

> 2) The files inside foo.service.d/ MUST end with a .conf suffix.  (Cf.
>    the wheezy->jessie apache2 upgrade, and having to rename every single
>    one of my virtual domain config files AND the symlinks to them.)

After having been bitten by old *.conf~ backup files left by an editor,
I must say I find that restriction quite useful.

> 3) foo.service.d/ must use the CANONICAL service name of whatever it is
>    that you're trying to override.  This may not be the same as the
>    Debian package name.  For example, the nfs-kernel-server package
>    creates a systemd unit named nfs-server.service with an ALIAS of
>    nfs-kernel-server.service.  If you try to create override files in
>    nfs-kernel-server.service.d/ it will not work correctly.  They have
>    to be in nfs-server.service.d/ instead.
> 
>    Don't even get me started on sshd.service vs. ssh.service.  Do you
>    have any idea how hard it is to notice that extra/missing "d", and
>    figure out why things Simply Do Not Work?

On the other hand, if systemd were to read snippets of configuration
with a subtly different name, someone else (or maybe be even yourself!)
would have complained about wasted time because of a stale config
snippet that should not have been read.

I find that strict rules are usually more convenient in the long run.

Note that you can use "systemctl edit" to have an editor started on the
exact correct file.

Regards,

-- 
  Nicolas George

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Systemd services (was Re: If Linux Is About Choice, Why Then ...) Jonathan de Boyne Pollard <j.deboynepollard-newsgroups@ntlworld.com> - 2017-04-13 23:20 +0200
  Re: Systemd services (was Re: If Linux Is About Choice, Why Then ...) Greg Wooledge <wooledg@eeg.ccf.org> - 2017-04-14 15:00 +0200
    Re: Systemd services (was Re: If Linux Is About Choice, Why Then ...) Nicolas George <george@nsup.org> - 2017-04-14 15:40 +0200
      Re: Systemd services (was Re: If Linux Is About Choice, Why Then ...) Dejan Jocic <jodejka@gmail.com> - 2017-04-14 16:10 +0200
      Re: Systemd services (was Re: If Linux Is About Choice, Why Then ...) Greg Wooledge <wooledg@eeg.ccf.org> - 2017-04-14 16:20 +0200
        Re: Re: Systemd services (was Re: If Linux Is About Choice, Why Then  ...) Laurent Bigonville <bigon@debian.org> - 2017-04-17 00:30 +0200
      Re: Systemd services (was Re: If Linux Is About Choice, Why Then ...) Martin Read <zen75502@zen.co.uk> - 2017-04-14 17:40 +0200
      Re: Systemd services (was Re: If Linux Is About Choice, Why Then ...) Jonathan Dowland <jmtd@debian.org> - 2017-04-18 00:10 +0200
        Re: Systemd services (was Re: If Linux Is About Choice, Why Then ...) Nicholas Geovanis <nickgeovanis@gmail.com> - 2017-04-21 21:40 +0200
          Fwd: Systemd services (was Re: If Linux Is About Choice, Why Then ...) Joel Rees <joel.rees@gmail.com> - 2017-04-22 01:10 +0200
    Re: Systemd services Teemu Likonen <tlikonen@iki.fi> - 2017-04-14 18:10 +0200
    Re: Systemd services (was Re: If Linux Is About Choice, Why Then ...) Joel Rees <joel.rees@gmail.com> - 2017-04-15 00:40 +0200

csiph-web