Hi Tyge,
You may like to read about systemctl.
Furthermore, there's good information at: http://project-open.com/en/install-debian-stretch
There, you can easily automate NaviServer startup.
Create a new file /lib/systemd/system/oacs.service with the following content:
[Unit]
Description=NaviServer Web Server as user OACS
After=postgresql.service network.target
Wants=postgresql.service
[Service]
Type=forking
PIDFile=/var/www/oacs/log/nsd.pid
ExecStartPre=rm -f /var/www/oacs/log/nsd.pid
ExecStart=/usr/local/ns/bin/nsd -t /var/www/oacs/etc/config.tcl -u nsadmin -g nsadmin
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s 9 $MAINPID
Restart=always
# Restart=on-abort
# Restart=on-abnormal
KillMode=process
[Install]
WantedBy=multi-user.target
Please execute the following commands in order to activate the configuration:
systemctl daemon-reload
systemctl enable oacs.service
systemctl start oacs.service
You can check that NaviServer is running by monitoring it's error file (debugging is switched on by default):
tail -f /var/www/oacs/log/error.log