Simon Kelley | c72daea | 2012-01-05 21:33:27 +0000 | [diff] [blame] | 1 | [Unit] |
Simon Danner | b06900d | 2014-08-18 22:19:50 +0100 | [diff] [blame] | 2 | Description=dnsmasq - A lightweight DHCP and caching DNS server |
Simon Kelley | dec180a | 2015-05-13 12:16:13 +0100 | [diff] [blame] | 3 | Requires=network.target |
zeha@debian.org | 04cb536 | 2016-07-06 22:30:10 +0100 | [diff] [blame] | 4 | Wants=nss-lookup.target |
| 5 | Before=nss-lookup.target |
Simon Kelley | cd2ddb9 | 2016-07-16 22:23:49 +0100 | [diff] [blame] | 6 | After=network.target |
Simon Kelley | c72daea | 2012-01-05 21:33:27 +0000 | [diff] [blame] | 7 | |
| 8 | [Service] |
Simon Kelley | ee4d1ce | 2015-02-12 18:30:32 +0000 | [diff] [blame] | 9 | Type=forking |
Simon Kelley | 4790115 | 2015-09-29 22:54:41 +0100 | [diff] [blame] | 10 | PIDFile=/run/dnsmasq/dnsmasq.pid |
Simon Kelley | c72daea | 2012-01-05 21:33:27 +0000 | [diff] [blame] | 11 | |
| 12 | # Test the config file and refuse starting if it is not valid. |
Simon Kelley | 343b7b4 | 2019-04-08 16:50:13 +0100 | [diff] [blame] | 13 | ExecStartPre=/etc/init.d/dnsmasq checkconfig |
Simon Kelley | c72daea | 2012-01-05 21:33:27 +0000 | [diff] [blame] | 14 | |
Simon Kelley | 2cd9a0d | 2012-06-11 21:56:10 +0100 | [diff] [blame] | 15 | # 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 Kelley | 2cd9a0d | 2012-06-11 21:56:10 +0100 | [diff] [blame] | 18 | ExecStart=/etc/init.d/dnsmasq systemd-exec |
| 19 | |
| 20 | # The systemd-*-resolvconf functions configure (and deconfigure) |
Josh Soref | 730c674 | 2017-02-06 16:14:04 +0000 | [diff] [blame] | 21 | # resolvconf to work with the dnsmasq DNS server. They're called like |
Simon Kelley | 343b7b4 | 2019-04-08 16:50:13 +0100 | [diff] [blame] | 22 | # this to get correct error handling (ie don't start-resolvconf if the |
| 23 | # dnsmasq daemon fails to start). |
Simon Kelley | 2cd9a0d | 2012-06-11 21:56:10 +0100 | [diff] [blame] | 24 | ExecStartPost=/etc/init.d/dnsmasq systemd-start-resolvconf |
| 25 | ExecStop=/etc/init.d/dnsmasq systemd-stop-resolvconf |
| 26 | |
Simon Kelley | c72daea | 2012-01-05 21:33:27 +0000 | [diff] [blame] | 27 | |
| 28 | ExecReload=/bin/kill -HUP $MAINPID |
| 29 | |
| 30 | [Install] |
| 31 | WantedBy=multi-user.target |