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