blob: 40b8d27cba21400d8b56ecc4a85266879988911d [file] [log] [blame]
Simon Kelleyc72daea2012-01-05 21:33:27 +00001[Unit]
Simon Dannerb06900d2014-08-18 22:19:50 +01002Description=dnsmasq - A lightweight DHCP and caching DNS server
Simon Kelleydec180a2015-05-13 12:16:13 +01003Requires=network.target
Simon Kelleyc72daea2012-01-05 21:33:27 +00004
5[Service]
Simon Kelleyee4d1ce2015-02-12 18:30:32 +00006Type=forking
Simon Kelley47901152015-09-29 22:54:41 +01007PIDFile=/run/dnsmasq/dnsmasq.pid
Simon Kelleyc72daea2012-01-05 21:33:27 +00008
9# Test the config file and refuse starting if it is not valid.
10ExecStartPre=/usr/sbin/dnsmasq --test
11
Simon Kelley2cd9a0d2012-06-11 21:56:10 +010012# We run dnsmasq via the /etc/init.d/dnsmasq script which acts as a
13# wrapper picking up extra configuration files and then execs dnsmasq
14# itself, when called with the "systemd-exec" function.
Simon Kelley2cd9a0d2012-06-11 21:56:10 +010015ExecStart=/etc/init.d/dnsmasq systemd-exec
16
17# The systemd-*-resolvconf functions configure (and deconfigure)
18# resolvconf to work with the dnsmasq DNS server. They're called liek
19# this to get correct error handling (ie don't start-resolvconf if the
20# dnsmasq daemon fails to start.
21ExecStartPost=/etc/init.d/dnsmasq systemd-start-resolvconf
22ExecStop=/etc/init.d/dnsmasq systemd-stop-resolvconf
23
Simon Kelleyc72daea2012-01-05 21:33:27 +000024
25ExecReload=/bin/kill -HUP $MAINPID
26
27[Install]
28WantedBy=multi-user.target