openbsd: properly set daemon workdir, use default rc_start, set MIX_ENV in login.conf
Setting the MIX_ENV variable in rc_pre() isn't possible, because the
environment doesn't persist between rc_pre and rc_start(). This way we
can also ditch the custom rc_start() function in favor of the default
one which is just:
rc_start() {
rc_exec "${daemon} ${daemon_flags}
}
This commit is contained in:
parent
e0ba132bce
commit
3b5b3ba4fc
2 changed files with 2 additions and 7 deletions
|
|
@ -69,7 +69,7 @@ pleroma:\
|
||||||
:datasize=1536M:\
|
:datasize=1536M:\
|
||||||
:openfiles-max=4096:\
|
:openfiles-max=4096:\
|
||||||
:openfiles-cur=1024:\
|
:openfiles-cur=1024:\
|
||||||
:setenv=LC_ALL=en_US.UTF-8,VIX_COMPILATION_MODE=PLATFORM_PROVIDED_LIBVIPS:\
|
:setenv=LC_ALL=en_US.UTF-8,VIX_COMPILATION_MODE=PLATFORM_PROVIDED_LIBVIPS,MIX_ENV=prod:\
|
||||||
:tc=daemon:
|
:tc=daemon:
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,8 +13,7 @@
|
||||||
daemon="/usr/local/bin/elixir"
|
daemon="/usr/local/bin/elixir"
|
||||||
daemon_flags="--erl \"-detached\" -S /usr/local/bin/mix phx.server"
|
daemon_flags="--erl \"-detached\" -S /usr/local/bin/mix phx.server"
|
||||||
daemon_user="_pleroma"
|
daemon_user="_pleroma"
|
||||||
|
daemon_execdir="/home/_pleroma/pleroma"
|
||||||
env="MIX_ENV=prod"
|
|
||||||
|
|
||||||
. /etc/rc.d/rc.subr
|
. /etc/rc.d/rc.subr
|
||||||
|
|
||||||
|
|
@ -25,10 +24,6 @@ rc_check() {
|
||||||
pgrep -q -U _pleroma -f "phx.server"
|
pgrep -q -U _pleroma -f "phx.server"
|
||||||
}
|
}
|
||||||
|
|
||||||
rc_start() {
|
|
||||||
rc_exec "cd pleroma; export ${env}; ${daemon} ${daemon_flags}"
|
|
||||||
}
|
|
||||||
|
|
||||||
rc_stop() {
|
rc_stop() {
|
||||||
pkill -q -U _pleroma -f "phx.server"
|
pkill -q -U _pleroma -f "phx.server"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue