Skip to content

Import and install unbound-startup #177

Merged
merged 2 commits into from
May 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ install_data misc_systemd_units/enable_overcommit_memory.service "$DESTDIR$syste
install_data misc_systemd_units/gdm.service "$DESTDIR$systemdunitdir/gdm.service"
install_data misc_systemd_units/startup-tags.service "$DESTDIR$systemdunitdir/startup-tags.service"
install_data misc_systemd_units/unbound.service "$DESTDIR$systemdunitdir/unbound.service"
install_exec misc_systemd_units/unbound-startup "$DESTDIR$usr_sbindir/unbound-startup"
install_data misc_systemd_units/xaruba.service "$DESTDIR$systemdunitdir/xaruba.service"
install_data misc_systemd_units/yppasswd.service "$DESTDIR$systemdunitdir/yppasswd.service"
install_data misc_systemd_units/ypserv.service "$DESTDIR$systemdunitdir/ypserv.service"
Expand Down
38 changes: 38 additions & 0 deletions misc_systemd_units/unbound-startup
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#! /bin/sh

#
# unbound is usuually started via systemd.
# only setup-var option is used by unbound.service


function setup_var() {
test -d /var/unbound || { mkdir -p /var/unbound;chown unbound /var/unbound; }
test -e /var/unbound/root.key -a /var/unbound/root.key -nt /etc/unbound/root.key || {
cp /etc/unbound/root.key /var/unbound/root.key
chown unbound /var/unbound/root.key
}
}



case $* in
start)
setup_var
unbound-control start
;;
stop)
unbound-control stop
;;
debug)
setup_var
unbound -dd -v
;;
setup-var)
setup_var
;;

*)
echo "usage: $0 [start | stop]"
exit 1
;;
esac