[Unit] Description = lxc-dnsmasq service After = network-online.target After = syslog.target Before = lxc.service [Service] Type = simple User = root Group = root ExecStartPre = -/usr/bin/pkill -u lxc-dnsmasq "^dnsmasq" ExecStartPre = /usr/local/bin/lxc-system-manage iptables-create ExecStart = /usr/local/bin/lxc-system-manage dnsmasq-start ExecReload = /bin/kill -HUP $MAINPID ExecStop = -/usr/local/bin/lxc-system-manage dnsmasq-stop ExecStopPost = -/usr/local/bin/lxc-system-manage iptables-remove # Give a reasonable amount of time for the server to start up/shut down TimeoutSec = 120 Restart = on-failure RestartSec = 2 # This creates a specific slice which all services will operate from # The accounting options give us the ability to see resource usage through # the `systemd-cgtop` command. Slice = lxc-dnsmasq.slice # Set Accounting CPUAccounting = True BlockIOAccounting = True MemoryAccounting = True TasksAccounting = True # Set Sandboxing PrivateTmp = False PrivateDevices = False PrivateNetwork = False PrivateUsers = False PIDFile = /run/lxc/dnsmasq.pid [Install] WantedBy = multi-user.target