]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - support/freebsd/peertube
Update FreeBSD startup script (#1474)
[github/Chocobozzz/PeerTube.git] / support / freebsd / peertube
CommitLineData
d29e239c
GN
1#!/bin/sh
2
3# PROVIDE: peertube
4# REQUIRE: LOGIN postgresql nginx redis
5# KEYWORD: shutdown
6
7PATH="/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin"
8
9. /etc/rc.subr
10
11desc="Peertube daemon"
12name=peertube
13rcvar=peertube_enable
14
15load_rc_config $name
16
17: ${peertube_enable:=NO}
18
2cf9a462 19sig_stop=HUP
d29e239c
GN
20peertube_chdir="/var/www/peertube/peertube-latest"
21peertube_env="HOME=/var/www/peertube \
22NODE_ENV=production \
23NODE_CONFIG_DIR=/var/www/peertube/config \
24USER=peertube"
25peertube_user=peertube
2cf9a462 26procname="node:"
d29e239c
GN
27
28command="/usr/local/bin/npm"
29command_args="start >> /var/log/peertube/${name}.log 2>&1 &"
30
31run_rc_command "$1"