ayaports/user/loomio/loomio.sidekiq.initd

33 lines
683 B
Text
Raw Normal View History

2024-01-11 21:38:45 +00:00
#!/sbin/openrc-run
name="Loomio background workers Service"
root="/usr/share/webapps/loomio"
pidfile="/run/loomio-sidekiq.pid"
logfile="/var/log/loomio/sidekiq.log"
depend() {
use net
need redis
}
start() {
ebegin "Starting Loomio background workers"
cd $root
start-stop-daemon --start --background \
--chdir "${root}" \
--user="loomio" \
--make-pidfile --pidfile="${pidfile}" \
-1 "${logfile}" -2 "${logfile}" \
--exec /usr/bin/env -- RAILS_ENV=production bundle exec rails s
eend $?
}
stop() {
ebegin "Stopping Loomio background workers"
start-stop-daemon --stop \
--pidfile=${pidfile} \
eend $?
}