[CentOS] More systemd-ness: unit file

Thu Jul 17 08:48:36 UTC 2014
James Hogarth <james.hogarth at gmail.com>

On 17 July 2014 06:50, Mauricio Tavares <raubvogel at gmail.com> wrote:

>       Ok, I did read
> www.freedesktop.org/software/systemd/man/systemd.unit.html and am
> still confused. What is it? If it helps, let' suse a real application:
> I create in /etc/systemd/system/ the home-ducker.{,auto}mount files.
> Where does this unit file go with respect to them? Is it one of them
>

Think of it as object inheritance ...

All systemd 'objects' are units and have the general unit file stanza and
syntax in them:

[Unit]
Description=blurb goes here
Documentation=man page name here
Requires=dependencies generated from here
After=network.target

And so on - see man systemd.unit for full details.

After that section depending on the type of unit you are working with
(timer, service, mount, etc) there will be an appropriate section with
entries specific to that:

[Service]
Type=oneshot
RemainAfterExit=true
ExecStart=/usr/sbin/ifup dummy0
ExecStart=/usr/sbin/ip link set multicast on dummy0
ExecStop=/usr/sbin/ifdown dummy0

 Does that make more sense?