| 1 |
[Unit] |
| 2 |
Description=dnsmasq - A lightweight DHCP and caching DNS server |
| 3 |
Documentation=man:dnsmasq(8) |
| 4 |
Requires=network-online.target |
| 5 |
Wants=nss-lookup.target |
| 6 |
Before=nss-lookup.target |
| 7 |
After=network-online.target |
| 8 |
|
| 9 |
[Service] |
| 10 |
Type=forking |
| 11 |
PIDFile=/run/dnsmasq/dnsmasq.pid |
| 12 |
|
| 13 |
# Test the config file and refuse starting if it is not valid. |
| 14 |
ExecStartPre=/usr/share/dnsmasq/systemd-helper checkconfig |
| 15 |
|
| 16 |
# We run dnsmasq via the /usr/share/dnsmasq/systemd-helper script which acts |
| 17 |
# as a wrapper picking up extra configuration files and then execs dnsmasq |
| 18 |
# itself, when called with the "exec" function. |
| 19 |
ExecStart=/usr/share/dnsmasq/systemd-helper exec |
| 20 |
|
| 21 |
# The *-resolvconf functions configure (and deconfigure) |
| 22 |
# resolvconf to work with the dnsmasq DNS server. They're called like |
| 23 |
# this to get correct error handling (ie don't start-resolvconf if the |
| 24 |
# dnsmasq daemon fails to start). |
| 25 |
ExecStartPost=/usr/share/dnsmasq/systemd-helper start-resolvconf |
| 26 |
ExecStop=/usr/share/dnsmasq/systemd-helper stop-resolvconf |
| 27 |
|
| 28 |
|
| 29 |
ExecReload=/bin/kill -HUP $MAINPID |
| 30 |
|
| 31 |
[Install] |
| 32 |
WantedBy=multi-user.target |