archives/mastodon: new aport
This commit is contained in:
parent
fa80820d8e
commit
cda65a1f03
10 changed files with 445 additions and 0 deletions
32
archives/mastodon/mastodon.sidekiq.initd
Normal file
32
archives/mastodon/mastodon.sidekiq.initd
Normal file
|
@ -0,0 +1,32 @@
|
|||
#!/sbin/openrc-run
|
||||
|
||||
name="Mastodon background workers Service"
|
||||
root="/usr/lib/bundles/mastodon"
|
||||
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}" \
|
||||
--exec /usr/bin/env -- RAILS_ENV=production DB_POOL=25 MALLOC_ARENA_MAX=2 bundle exec sidekiq -c 25
|
||||
eend $?
|
||||
}
|
||||
|
||||
stop() {
|
||||
ebegin "Stopping Mastodon background workers"
|
||||
start-stop-daemon --stop \
|
||||
--pidfile=${pidfile} \
|
||||
eend $?
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue