blob: d75ab62ab95314ece7992c345bfea7a42fce8b61 [file] [log] [blame]
Simon Kelleyc72daea2012-01-05 21:33:27 +00001[Unit]
2Description=A lightweight DHCP and caching DNS server
3
4[Service]
5Type=dbus
6BusName=uk.org.thekelleys.dnsmasq
7
8# Test the config file and refuse starting if it is not valid.
9ExecStartPre=/usr/sbin/dnsmasq --test
10
Simon Kelley2cd9a0d2012-06-11 21:56:10 +010011# We run dnsmasq via the /etc/init.d/dnsmasq script which acts as a
12# wrapper picking up extra configuration files and then execs dnsmasq
13# itself, when called with the "systemd-exec" function.
Simon Kelleyc72daea2012-01-05 21:33:27 +000014#
Simon Kelley2cd9a0d2012-06-11 21:56:10 +010015# It also adds the command-line flags
16# --keep-in-foreground --pid-file --enable-dbus
17# to disable writing a pid-file (not needed with systemd) and
18# enable DBus by default because we use DBus activation.
Simon Kelleyc72daea2012-01-05 21:33:27 +000019#
Simon Kelley2cd9a0d2012-06-11 21:56:10 +010020ExecStart=/etc/init.d/dnsmasq systemd-exec
21
22# The systemd-*-resolvconf functions configure (and deconfigure)
23# resolvconf to work with the dnsmasq DNS server. They're called liek
24# this to get correct error handling (ie don't start-resolvconf if the
25# dnsmasq daemon fails to start.
26ExecStartPost=/etc/init.d/dnsmasq systemd-start-resolvconf
27ExecStop=/etc/init.d/dnsmasq systemd-stop-resolvconf
28
Simon Kelleyc72daea2012-01-05 21:33:27 +000029
30ExecReload=/bin/kill -HUP $MAINPID
31
32[Install]
33WantedBy=multi-user.target