| 1 | #!/sbin/openrc-run |
| 2 | |
| 3 | supervisor=supervise-daemon |
| 4 | |
| 5 | command="/usr/bin/headscale" |
| 6 | command_args="serve" |
| 7 | command_user="headscale:headscale" |
| 8 | directory="/var/lib/headscale" |
| 9 | |
| 10 | output_log="/var/log/headscale.log" |
| 11 | error_log="/var/log/headscale.log" |
| 12 | |
| 13 | depend() { |
| 14 | need net |
| 15 | after firewall |
| 16 | } |
| 17 | |
| 18 | start_pre() { |
| 19 | checkpath -d -m 755 -o "headscale:headscale" /var/run/headscale |
| 20 | checkpath -d -m 755 -o "headscale:headscale" /var/lib/headscale |
| 21 | |
| 22 | checkpath -f -m 644 -o "headscale:headscale" /var/lib/headscale/db.sqlite |
| 23 | checkpath -f -m 644 -o "headscale:headscale" /etc/headscale/config.yaml |
| 24 | checkpath -f -m 644 -o "headscale:headscale" /var/log/headscale.log |
| 25 | } |