Changeset View
Changeset View
Standalone View
Standalone View
head/devel/py-buildbot-worker/files/buildbot-worker.in
Show First 20 Lines • Show All 67 Lines • ▼ Show 20 Lines | if [ -n "$2" ]; then | ||||
if [ -n "${buildbot_worker_profiles}" ]; then | if [ -n "${buildbot_worker_profiles}" ]; then | ||||
eval buildbot_worker_enable="\${buildbot_worker_${profile}_enable:-${buildbot_worker_enable}}" | eval buildbot_worker_enable="\${buildbot_worker_${profile}_enable:-${buildbot_worker_enable}}" | ||||
eval buildbot_worker_flags="\${buildbot_worker_${profile}_flags:-${buildbot_worker_flags}}" | eval buildbot_worker_flags="\${buildbot_worker_${profile}_flags:-${buildbot_worker_flags}}" | ||||
eval buildbot_worker_uid="\${buildbot_worker_${profile}_uid:-${buildbot_worker_uid}}" | eval buildbot_worker_uid="\${buildbot_worker_${profile}_uid:-${buildbot_worker_uid}}" | ||||
eval buildbot_worker_gid="\${buildbot_worker_${profile}_gid:-${buildbot_worker_gid}}" | eval buildbot_worker_gid="\${buildbot_worker_${profile}_gid:-${buildbot_worker_gid}}" | ||||
eval buildbot_worker_basedir="\${buildbot_worker_${profile}_basedir:-${buildbot_worker_basedir}}" | eval buildbot_worker_basedir="\${buildbot_worker_${profile}_basedir:-${buildbot_worker_basedir}}" | ||||
eval pidfile="\${buildbot_worker_${profile}_basedir:-${buildbot_worker_basedir}}/twistd.pid" | eval pidfile="\${buildbot_worker_${profile}_basedir:-${buildbot_worker_basedir}}/twistd.pid" | ||||
else | else | ||||
echo "%%PREFIX%%/etc/rc.d/${name}: extra argument ignored" | echo "$0: extra argument ignored" | ||||
fi | fi | ||||
# A specific profile is not in the command | # A specific profile is not in the command | ||||
else | else | ||||
# Check if any profiles are defined | # Check if any profiles are defined | ||||
if [ -n "$1" -a -n "${buildbot_worker_profiles}" ]; then | if [ -n "$1" -a -n "${buildbot_worker_profiles}" ]; then | ||||
# Loop through them | # Loop through them | ||||
for profile in ${buildbot_worker_profiles}; do | for profile in ${buildbot_worker_profiles}; do | ||||
eval _enable="\${buildbot_worker_${profile}_enable}" | eval _enable="\${buildbot_worker_${profile}_enable}" | ||||
Show All 12 Lines | if [ -n "$1" -a -n "${buildbot_worker_profiles}" ]; then | ||||
warn "Bad value" \ | warn "Bad value" \ | ||||
"'${_enable:-${buildbot_worker_enable}}'" \ | "'${_enable:-${buildbot_worker_enable}}'" \ | ||||
"for ${_var}. " \ | "for ${_var}. " \ | ||||
"Profile ${profile} skipped." | "Profile ${profile} skipped." | ||||
continue | continue | ||||
;; | ;; | ||||
esac | esac | ||||
echo "===> ${name} profile: ${profile}" | echo "===> ${name} profile: ${profile}" | ||||
if %%PREFIX%%/etc/rc.d/${name} $1 ${profile}; then | if $0 $1 ${profile}; then | ||||
success="${profile} ${success:-}" | success="${profile} ${success:-}" | ||||
else | else | ||||
failed="${profile} (${retcode}) ${failed:-}" | failed="${profile} (${retcode}) ${failed:-}" | ||||
fi | fi | ||||
done | done | ||||
# Exit so that non-profile rc.d is not started when there are profiles | # Exit so that non-profile rc.d is not started when there are profiles | ||||
exit 0 | exit 0 | ||||
fi | fi | ||||
fi | fi | ||||
# run_rc_command would send ${name}_flags as parameters to $command (daemon) | # run_rc_command would send ${name}_flags as parameters to $command (daemon) | ||||
# This ensures they are actually passed to fcgiwrap instead. | # This ensures they are actually passed to fcgiwrap instead. | ||||
actual_buildbot_worker_flags="${buildbot_worker_flags}" | actual_buildbot_worker_flags="${buildbot_worker_flags}" | ||||
buildbot_worker_flags="" | buildbot_worker_flags="" | ||||
command_args="--uid=${buildbot_worker_uid} --gid=${buildbot_worker_gid} --pidfile=${pidfile} --python=${buildbot_worker_basedir}/buildbot.tac ${actual_buildbot_worker_flags}" | command_args="--uid=${buildbot_worker_uid} --gid=${buildbot_worker_gid} --pidfile=${pidfile} --python=${buildbot_worker_basedir}/buildbot.tac ${actual_buildbot_worker_flags}" | ||||
run_rc_command "$1" | run_rc_command "$1" |