Skip to content

Commit

Permalink
Add OpenRC sample files
Browse files Browse the repository at this point in the history
  • Loading branch information
rseichter committed Mar 7, 2021
1 parent ba5e26b commit 90f1930
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
10 changes: 10 additions & 0 deletions contrib/OpenRC/conf_d
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# /etc/conf.d/automx2

# Additional parameters passed to Flask
#AUTOMX2_ARGS="--host 127.0.0.1 --port 4243"

# Configuration file
#AUTOMX2_CONF="/etc/automx2.conf"

# Process owner (choose a non-privileged user)
#AUTOMX2_USER="automx2"
26 changes: 26 additions & 0 deletions contrib/OpenRC/init_d
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/sbin/openrc-run
#
# /etc/init.d/automx2

: ${AUTOMX2_CONF:="/etc/${RC_SVCNAME}.conf"}
: ${AUTOMX2_USER:="automx2"}
: ${AUTOMX2_ARGS:="--port 4243"}

command="/usr/bin/python"
command_args="/usr/bin/flask run ${AUTOMX2_ARGS}"
command_background="true"
command_user="${AUTOMX2_USER}"
pidfile="/run/${RC_SVCNAME}.pid"
required_files="${AUTOMX2_CONF}"

depend() {
use logger net
before nginx
}

start_pre() {
export AUTOMX2_CONF
export EPYTHON="python3.9"
export FLASK_APP="automx2.server:app"
export FLASK_ENV="production"
}

0 comments on commit 90f1930

Please sign in to comment.