blob: b769c4ea04f973b2069f529923c1b1821a6ff59c [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
zeha@debian.org04cb5362016-07-06 22:30:10 +01004Wants=nss-lookup.target
5Before=nss-lookup.target
Simon Kelleycd2ddb92016-07-16 22:23:49 +01006After=network.target
Simon Kelleyc72daea2012-01-05 21:33:27 +00007
8[Service]
Simon Kelleyee4d1ce2015-02-12 18:30:32 +00009Type=forking
Simon Kelley47901152015-09-29 22:54:41 +010010PIDFile=/run/dnsmasq/dnsmasq.pid
Simon Kelleyc72daea2012-01-05 21:33:27 +000011
12# Test the config file and refuse starting if it is not valid.
Simon Kelley343b7b42019-04-08 16:50:13 +010013ExecStartPre=/etc/init.d/dnsmasq checkconfig
Simon Kelleyc72daea2012-01-05 21:33:27 +000014
Simon Kelley2cd9a0d2012-06-11 21:56:10 +010015# We run dnsmasq via the /etc/init.d/dnsmasq script which acts as a
16# wrapper picking up extra configuration files and then execs dnsmasq
17# itself, when called with the "systemd-exec" function.
Simon Kelley2cd9a0d2012-06-11 21:56:10 +010018ExecStart=/etc/init.d/dnsmasq systemd-exec
19
20# The systemd-*-resolvconf functions configure (and deconfigure)
Josh Soref730c6742017-02-06 16:14:04 +000021# resolvconf to work with the dnsmasq DNS server. They're called like
Simon Kelley343b7b42019-04-08 16:50:13 +010022# this to get correct error handling (ie don't start-resolvconf if the
23# dnsmasq daemon fails to start).
Simon Kelley2cd9a0d2012-06-11 21:56:10 +010024ExecStartPost=/etc/init.d/dnsmasq systemd-start-resolvconf
25ExecStop=/etc/init.d/dnsmasq systemd-stop-resolvconf
26
Simon Kelleyc72daea2012-01-05 21:33:27 +000027
28ExecReload=/bin/kill -HUP $MAINPID
29
30[Install]
31WantedBy=multi-user.target