Add a separate rc.d(8) script for the workers so that we can easily
change the flags in rc.conf.local(5).
This commit is contained in:
parent
119885d55c
commit
bc15d66678
@ -1,10 +1,10 @@
|
||||
# $OpenBSD: Makefile,v 1.15 2013/03/13 10:16:12 ajacoutot Exp $
|
||||
# $OpenBSD: Makefile,v 1.16 2013/03/18 14:25:40 ajacoutot Exp $
|
||||
|
||||
COMMENT= overview of your Puppet ecosystem
|
||||
|
||||
DISTNAME= puppet-dashboard-1.2.22
|
||||
CATEGORIES= www sysutils
|
||||
REVISION= 1
|
||||
REVISION= 2
|
||||
|
||||
HOMEPAGE= https://puppetlabs.com/puppet/related-projects/dashboard/
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
@comment $OpenBSD: PLIST,v 1.7 2013/03/13 10:16:13 ajacoutot Exp $
|
||||
@comment $OpenBSD: PLIST,v 1.8 2013/03/18 14:25:41 ajacoutot Exp $
|
||||
@newgroup _puppet-dashboard:713
|
||||
@newuser _puppet-dashboard:713:713:daemon:Puppet Dashboard:/var/empty:/sbin/nologin
|
||||
@owner _puppet-dashboard
|
||||
@ -5021,3 +5021,4 @@ puppet-dashboard/vendor/rails/railties/railties.gemspec
|
||||
@cwd ${LOCALBASE}/share/doc/pkg-readmes
|
||||
${FULLPKGNAME}
|
||||
@rcscript ${RCDIR}/puppet_dashboard
|
||||
@rcscript ${RCDIR}/puppet_dashboard_workers
|
||||
|
@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# $OpenBSD: puppet_dashboard.rc,v 1.1 2013/03/13 10:16:13 ajacoutot Exp $
|
||||
# $OpenBSD: puppet_dashboard.rc,v 1.2 2013/03/18 14:25:41 ajacoutot Exp $
|
||||
|
||||
daemon="./script/server -d"
|
||||
daemon_flags="-e production"
|
||||
@ -8,23 +8,15 @@ daemon_user="_puppet-dashboard"
|
||||
|
||||
. /etc/rc.d/rc.subr
|
||||
|
||||
pexp="(${RUBY} ${daemon}${daemon_flags:+ ${daemon_flags}}|ruby${MODRUBY_BINREV}:.*delayed_job)"
|
||||
pexp="${RUBY} ${daemon}${daemon_flags:+ ${daemon_flags}}"
|
||||
rc_reload=NO
|
||||
|
||||
rc_check() {
|
||||
pgrep -u ${daemon_user} -f "^${pexp}"
|
||||
}
|
||||
|
||||
rc_start() {
|
||||
${rcexec} "cd ${INSTDIR} && \
|
||||
${daemon} ${daemon_flags}" || return 1
|
||||
sleep 1
|
||||
${rcexec} "cd ${INSTDIR} && \
|
||||
env RAILS_ENV=production script/delayed_job -p dashboard -n 4 -m start"
|
||||
${rcexec} "cd ${INSTDIR} && ${daemon} ${daemon_flags}"
|
||||
}
|
||||
|
||||
rc_stop() {
|
||||
pkill -INT -u ${daemon_user} -f "^${pexp}"
|
||||
pkill -INT -f "^${pexp}"
|
||||
}
|
||||
|
||||
rc_cmd $1
|
||||
|
28
www/puppet-dashboard/pkg/puppet_dashboard_workers.rc
Normal file
28
www/puppet-dashboard/pkg/puppet_dashboard_workers.rc
Normal file
@ -0,0 +1,28 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# $OpenBSD: puppet_dashboard_workers.rc,v 1.1 2013/03/18 14:25:41 ajacoutot Exp $
|
||||
|
||||
daemon="./script/delayed_job"
|
||||
daemon_flags="-p dashboard -n 4 -m"
|
||||
daemon_user="_puppet-dashboard"
|
||||
|
||||
. /etc/rc.d/rc.subr
|
||||
|
||||
pexp="ruby${MODRUBY_BINREV}:.*delayed_job"
|
||||
rc_reload=NO
|
||||
|
||||
rc_check() {
|
||||
pgrep -f "^${pexp}"
|
||||
}
|
||||
|
||||
rc_start() {
|
||||
${rcexec} "cd ${INSTDIR} && \
|
||||
env RAILS_ENV=production ${daemon} ${daemon_flags} start"
|
||||
}
|
||||
|
||||
rc_stop() {
|
||||
${rcexec} "cd ${INSTDIR} && \
|
||||
env RAILS_ENV=production ${daemon} ${daemon_flags} stop"
|
||||
}
|
||||
|
||||
rc_cmd $1
|
Loading…
x
Reference in New Issue
Block a user