summaryrefslogtreecommitdiff
path: root/frontends/etc/rc.d/dserver.tpl
diff options
context:
space:
mode:
Diffstat (limited to 'frontends/etc/rc.d/dserver.tpl')
-rwxr-xr-xfrontends/etc/rc.d/dserver.tpl9
1 files changed, 9 insertions, 0 deletions
diff --git a/frontends/etc/rc.d/dserver.tpl b/frontends/etc/rc.d/dserver.tpl
index aec80f5..ee250aa 100755
--- a/frontends/etc/rc.d/dserver.tpl
+++ b/frontends/etc/rc.d/dserver.tpl
@@ -9,8 +9,17 @@ daemon_user="_dserver"
rc_reload=NO
rc_pre() {
+ # /var/run is wiped by /etc/rc at boot — recreate the runtime dirs and
+ # repopulate the SSH key cache on every service start (a daily cron job
+ # keeps it fresh afterwards). The SSH host key lives in persistent
+ # /var/db/dserver so it survives reboots (a regenerated host key would
+ # break clients' known_hosts).
install -d -o _dserver /var/log/dserver
install -d -o _dserver /var/run/dserver/cache
+ install -d -o _dserver -m 0700 /var/db/dserver
+ if [ -x /usr/local/bin/dserver-update-key-cache.sh ]; then
+ /usr/local/bin/dserver-update-key-cache.sh
+ fi
}
rc_cmd $1 &