Hi,
I'm not sure why the chrooted service should not work (it doesn't, imho
likely due to a bug in unbound-checkconf), but with the version from
backport, I've created a patch for the init script that copies the
configuration to the standard chroot directory.
I've redone the restart option in order to ensure that any modified
config files get copied to the target directory.
Kind regards,
--Toni++
--- unbound.dist 2010-09-10 05:50:31.000000000 +0200
+++ unbound 2010-10-22 11:31:29.000000000 +0200
@@ -37,6 +37,10 @@
start)
if $UNBOUND_ENABLE; then
log_daemon_msg "Starting $DESC" "$NAME"
+ cd /etc
+ # can we assume the presence of rsync?
+ rm -fr /var/lib/$NAME/etc/$NAME
+ cp -ar $NAME /var/lib/$NAME/etc
if start-stop-daemon --start --quiet --oknodo --pidfile $PIDFILE --name $NAME --startas $DAEMON -- $DAEMON_OPTS; then
log_end_msg 0
else
@@ -61,12 +65,15 @@
restart|force-reload)
if $UNBOUND_ENABLE; then
log_daemon_msg "Restarting $DESC" "$NAME"
- start-stop-daemon --stop --quiet --pidfile $PIDFILE --name $NAME --retry 5
- if start-stop-daemon --start --quiet --oknodo --pidfile $PIDFILE --name $NAME --startas $DAEMON -- $DAEMON_OPTS; then
- log_end_msg 0
- else
- log_end_msg 1
- fi
+ #start-stop-daemon --stop --quiet --pidfile $PIDFILE --name $NAME --retry 5
+ #if start-stop-daemon --start --quiet --oknodo --pidfile $PIDFILE --name $NAME --startas $DAEMON -- $DAEMON_OPTS; then
+ # log_end_msg 0
+ #else
+ # log_end_msg 1
+ #fi
+ $0 stop
+ sleep 5
+ $0 start
fi
;;