INIT_INSTALL='install -d -m 755 %{buildroot}/%{_sysconfdir}/systemd/system/ && install -m 664 contrib/dnsdist.service %{buildroot}/%{_sysconfdir}/systemd/system/dnsdist.service'
INIT_FILES='%{_sysconfdir}/systemd/system/dnsdist.service'
-# These two are the same for sysv and systemd
-DEFAULTS_INSTALL='install -d -m 755 %{buildroot}/%{_sysconfdir}/sysconfig && install -m 644 contrib/dnsdist.default %{buildroot}/%{_sysconfdir}/sysconfig/dnsdist'
-DEFAULTS_FILES='%{_sysconfdir}/sysconfig/dnsdist'
+# These two are the same for sysv and systemd (we don't install defaults files at the moment)
+DEFAULTS_INSTALL=''
+DEFAULTS_FILES=''
# On some older distro's *cough* centos 6 *cough* autosetup fails
SETUP='%autosetup -n %{name}-%{version}'
+++ /dev/null
-OPTIONS='-l 127.0.0.1'
After=syslog.target
[Service]
-EnvironmentFile=-/etc/default/dnsdist
-ExecStart=/usr/bin/dnsdist --supervised ${OPTIONS}
+# Keep the --supervised option when modifying the default options
+ExecStart=/usr/bin/dnsdist --supervised
[Install]
WantedBy=multi-user.target
author "Pieter Lexis <pieter.lexis@powerdns.com>"
# Keep the --supervised option when modifying this
-exec /usr/bin/dnsdist --supervised -l 127.0.0.1
+exec /usr/bin/dnsdist --supervised
-DNSDIST_OPTIONS='-l 127.0.0.1'
+DNSDIST_OPTIONS=''
PROG=dnsdist
DNSDIST=/usr/bin/${PROG}
PIDFILE=/var/run/${PROG}.pid
-DNSDIST_OPTIONS="-l 127.0.0.1:53"
+DNSDIST_OPTIONS=""
if [ -f /etc/default/${PROG} ]; then
. /etc/default/${PROG}
fi
+if [ -f /etc/sysconfig/${PROG} ]; then
+ . /etc/sysconfig/${PROG}
+fi
+
RETVAL=0
do_start() {
After=network.target
[Service]
-EnvironmentFile=-/etc/sysconfig/dnsdist
-ExecStart=/usr/bin/dnsdist --supervised $DNSDIST_OPTIONS
+# Keep the --supervised option when changing the default options
+ExecStart=/usr/bin/dnsdist --supervised
[Install]
WantedBy=multi-user.target