34b8182705e1869da76f2186ab32131c852e1f33
3 # REQUIRE: DAEMON pgsql
5 if [ -f /etc
/rc.subr
]; then
11 command="/usr/pkg/bin/elixir"
12 command_args
="/usr/pkg/bin/mix phx.server &"
13 start_cmd
=pleroma_start
14 start_precmd
="ulimit -n unlimited"
15 pidfile
="${pleroma_home}/pleroma/pid"
17 pleroma_chdir
="${pleroma_home}/pleroma"
18 pleroma_env
="HOME=${pleroma_home} MIX_ENV=prod"
19 pleroma_user
="pleroma"
23 echo "Starting ${name}."
25 su
-m ${pleroma_user} -c "cd ${pleroma_chdir} && \
26 ${pleroma_env} ${command} ${command_args}"
32 read _pid _junk
< ${pidfile}
33 echo -n "$(ps -axo pid | grep ${_pid})"
36 if [ -f /etc
/rc.subr
-a -d /etc
/rc.d
-a -f /etc
/rc.d
/DAEMON
]; then # newer NetBSD
37 load_rc_config
${name}
39 else # ancient NetBSD, Solaris and illumos, Linux, etc...
44 echo "Starting ${name}."
49 echo "Stopping ${name}."
61 echo 1>&2 "Usage: $0 [start|stop|restart]"