/mastodon/rc.d/mastodon-sidekiq
#!/bin/sh

# PROVIDE: mastodon_sidekiq
# REQUIRE: DAEMON mastodon_web
# KEYWORD: shutdown

. /etc/rc.subr

name="mastodon_sidekiq"
rcvar="mastodon_enable"

pidfile="/var/run/mastodon-sidekiq.pid"
mastodon_sidekiq_chdir="/home/mastodon/live"
mastodon_sidekiq_env="RAILS_ENV=production DB_POOL=10"
command="/usr/sbin/daemon"
command_args="-u mastodon -P ${pidfile} -H -o /var/log/mastodon/sidekiq.log /usr/local/bin/bundle exec sidekiq -c 10"

# read configuration and set defaults
load_rc_config "$name"
: ${mastodon_enable="NO"}

run_rc_command "$1"