#!/sbin/openrc-run description="A lightweight DNS, DHCP, RA, TFTP and PXE server" extra_commands="checkconfig" description_checkconfig="Check configuration syntax" extra_started_commands="reload" description_reload="Clear cache and reload hosts files" command="/usr/sbin/dnsmasq" # Tell dnsmasq to not create pidfile, that's responsibility of init system. command_args="-k --pid-file= $DNSMASQ_OPTS" command_background="yes" pidfile="/run/dnsmasq.pid" depend() { provide dns need localmount net after bootmisc use logger } start_pre() { $command --test 2>/dev/null || $command --test || return 1 checkpath -m 0644 -o dnsmasq:dnsmasq -f /var/lib/misc/dnsmasq.leases } reload() { ebegin "Reloading $RC_SVCNAME" start_pre || return 1 start-stop-daemon --signal HUP --pidfile "$pidfile" eend $? } checkconfig() { ebegin "Checking $RC_SVCNAME configuration" $command --test eend $? }