2021-06-04 15:24:22 +00:00
|
|
|
#!/sbin/openrc-run
|
|
|
|
|
|
|
|
name="Mastodon background workers Service"
|
2024-07-11 01:42:04 +00:00
|
|
|
root="/usr/lib/bundles/mastodon"
|
2021-06-04 15:24:22 +00:00
|
|
|
pidfile="/run/mastodon-sidekiq.pid"
|
|
|
|
logfile="/var/log/mastodon/sidekiq.log"
|
|
|
|
|
|
|
|
depend() {
|
|
|
|
use net
|
|
|
|
need redis
|
|
|
|
}
|
|
|
|
|
|
|
|
start() {
|
|
|
|
ebegin "Starting Mastodon background workers"
|
|
|
|
|
|
|
|
cd $root
|
|
|
|
|
|
|
|
start-stop-daemon --start --background \
|
|
|
|
--chdir "${root}" \
|
|
|
|
--user="mastodon" \
|
|
|
|
--make-pidfile --pidfile="${pidfile}" \
|
|
|
|
-1 "${logfile}" -2 "${logfile}" \
|
2023-06-27 14:26:04 +00:00
|
|
|
--exec /usr/bin/env -- RAILS_ENV=production DB_POOL=25 MALLOC_ARENA_MAX=2 bundle exec sidekiq -c 25
|
2021-06-04 15:24:22 +00:00
|
|
|
eend $?
|
|
|
|
}
|
|
|
|
|
|
|
|
stop() {
|
|
|
|
ebegin "Stopping Mastodon background workers"
|
|
|
|
start-stop-daemon --stop \
|
|
|
|
--pidfile=${pidfile} \
|
|
|
|
eend $?
|
|
|
|
}
|