aboutsummaryrefslogtreecommitdiffhomepage
path: root/support/freebsd/peertube
blob: f28660f2c109072768708a3882ff212715a04713 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/sh

# PROVIDE: peertube
# REQUIRE: LOGIN postgresql nginx redis
# KEYWORD: shutdown

PATH="/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin"

. /etc/rc.subr

desc="Peertube daemon"
name=peertube
rcvar=peertube_enable

load_rc_config $name

: ${peertube_enable:=NO}

sig_stop=HUP
peertube_chdir="/var/www/peertube/peertube-latest"
peertube_env="HOME=/var/www/peertube \
NODE_ENV=production \
NODE_CONFIG_DIR=/var/www/peertube/config \
USER=peertube"
peertube_user=peertube
procname="node:"

command="/usr/local/bin/npm"
command_args="start >> /var/log/peertube/${name}.log 2>&1 &"

run_rc_command "$1"