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 | c72daea | 2012-01-05 21:33:27 +0000 | [diff] [blame] | 3 | |
| 4 | [Service] |
Simon Kelley | ee4d1ce | 2015-02-12 18:30:32 +0000 | [diff] [blame^] | 5 | Type=forking |
| 6 | PIDFile=/var/run/dnsmasq/dnsmasq.pid |
Simon Kelley | c72daea | 2012-01-05 21:33:27 +0000 | [diff] [blame] | 7 | |
| 8 | # Test the config file and refuse starting if it is not valid. |
| 9 | ExecStartPre=/usr/sbin/dnsmasq --test |
| 10 | |
Simon Kelley | 2cd9a0d | 2012-06-11 21:56:10 +0100 | [diff] [blame] | 11 | # 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 Kelley | 2cd9a0d | 2012-06-11 21:56:10 +0100 | [diff] [blame] | 14 | ExecStart=/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. |
| 20 | ExecStartPost=/etc/init.d/dnsmasq systemd-start-resolvconf |
| 21 | ExecStop=/etc/init.d/dnsmasq systemd-stop-resolvconf |
| 22 | |
Simon Kelley | c72daea | 2012-01-05 21:33:27 +0000 | [diff] [blame] | 23 | |
| 24 | ExecReload=/bin/kill -HUP $MAINPID |
| 25 | |
| 26 | [Install] |
| 27 | WantedBy=multi-user.target |