blob: aca30dc426479c0cb41652b87e64323e104c486b [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 Kelleyc72daea2012-01-05 21:33:27 +00003
4[Service]
Simon Kelleyee4d1ce2015-02-12 18:30:32 +00005Type=forking
6PIDFile=/var/run/dnsmasq/dnsmasq.pid
Simon Kelleyc72daea2012-01-05 21:33:27 +00007
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 Kelley2cd9a0d2012-06-11 21:56:10 +010014ExecStart=/etc/init.d/dnsmasq systemd-exec
15
16# The systemd-*-resolvconf functions configure (and deconfigure)
17# resolvconf to work with the dnsmasq DNS server. They're called liek
18# this to get correct error handling (ie don't start-resolvconf if the
19# dnsmasq daemon fails to start.
20ExecStartPost=/etc/init.d/dnsmasq systemd-start-resolvconf
21ExecStop=/etc/init.d/dnsmasq systemd-stop-resolvconf
22
Simon Kelleyc72daea2012-01-05 21:33:27 +000023
24ExecReload=/bin/kill -HUP $MAINPID
25
26[Install]
27WantedBy=multi-user.target