Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[backend] add bs_clouduploadworker and init scripts
- Loading branch information
Showing
6 changed files
with
396 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
#! /bin/sh | ||
# Copyright (c) 2007, Novell Inc. | ||
# | ||
# Author: adrian@suse.de | ||
# | ||
# /etc/init.d/obsclouduploadserver | ||
# and its symbolic link | ||
# /usr/sbin/rcobsclouduploadserver | ||
# | ||
### BEGIN INIT INFO | ||
# Provides: obsclouduploadserver | ||
# Required-Start: $time $syslog | ||
# Required-Stop: $null | ||
# Should-Start: $none | ||
# Should-Stop: $none | ||
# Default-Start: 3 5 | ||
# Default-Stop: 0 1 2 4 6 | ||
# Description: open build service cloup upload server | ||
### END INIT INFO | ||
|
||
. /etc/rc.status | ||
|
||
. /etc/sysconfig/obs-server | ||
|
||
# Determine the base and follow a runlevel link name. | ||
base=${0##*/} | ||
link=${base#*[SK][0-9][0-9]} | ||
|
||
if [ -z "$OBS_RUN_DIR" ]; then | ||
OBS_RUN_DIR="/srv/obs/run" | ||
fi | ||
|
||
if [ -z "$OBS_LOG_DIR" ]; then | ||
OBS_LOG_DIR="/srv/obs/log" | ||
fi | ||
|
||
if [ -n "$OBS_BACKENDCODE_DIR" ]; then | ||
obsdir="$OBS_BACKENDCODE_DIR" | ||
else | ||
obsdir=/usr/lib/obs/server | ||
fi | ||
rundir="$OBS_RUN_DIR" | ||
logdir="$OBS_LOG_DIR" | ||
|
||
rundir_perm() { | ||
# make sure rundir is group writable | ||
test "$(stat -c "%A" "$rundir" | cut -c6)" = "-" && chmod 0775 "$rundir" | ||
} | ||
|
||
rc_reset | ||
case "$1" in | ||
start) | ||
echo -n "Initializing obsclouduploadserver" | ||
mkdir -p "$rundir" "$logdir" | ||
rundir_perm | ||
chown obsrun:obsrun "$logdir" "$rundir" | ||
startproc -f -l "$logdir"/clouduploadserver.log "$obsdir"/bs_clouduploadserver | ||
rc_status -v | ||
;; | ||
stop) | ||
echo -n "Shutting down obsservice" | ||
"$obsdir"/bs_clouduploadserver --stop | ||
rc_status -v | ||
;; | ||
restart) | ||
## If first returns OK call the second, if first or | ||
## second command fails, set echo return value. | ||
rundir_perm | ||
"$obsdir"/bs_clouduploadserver --restart | ||
rc_status | ||
;; | ||
try-restart|reload) | ||
$0 status | ||
if test $? = 0; then | ||
rundir_perm | ||
"$obsdir"/bs_clouduploadserver --restart | ||
else | ||
rc_reset # Not running is not a failure. | ||
fi | ||
# Remember status and be quiet | ||
rc_status | ||
;; | ||
status) | ||
echo -n "Checking for obsclouduploadserver and running processes: " | ||
"$obsdir"/bs_serverstatus "$OBS_RUN_DIR"/bs_clouduploadserver.status | ||
checkproc "$obsdir"/bs_clouduploadserver | ||
rc_status -v | ||
;; | ||
*) | ||
echo "Usage: $0 {start|stop|status|try-restart|restart|reload}" | ||
exit 1 | ||
;; | ||
esac | ||
rc_exit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
#! /bin/sh | ||
# Copyright (c) 2007, Novell Inc. | ||
# | ||
# Author: adrian@suse.de | ||
# | ||
# /etc/init.d/obsclouduploadworker | ||
# and its symbolic link | ||
# /usr/sbin/rcobsclouduploadworker | ||
# | ||
### BEGIN INIT INFO | ||
# Provides: obsclouduploadworker | ||
# Required-Start: $time $syslog | ||
# Required-Stop: $null | ||
# Should-Start: $none | ||
# Should-Stop: $none | ||
# Default-Start: 3 5 | ||
# Default-Stop: 0 1 2 4 6 | ||
# Description: open build service cloup upload worker | ||
### END INIT INFO | ||
|
||
. /etc/rc.status | ||
|
||
. /etc/sysconfig/obs-server | ||
|
||
# Determine the base and follow a runlevel link name. | ||
base=${0##*/} | ||
link=${base#*[SK][0-9][0-9]} | ||
|
||
if [ -z "$OBS_RUN_DIR" ]; then | ||
OBS_RUN_DIR="/srv/obs/run" | ||
fi | ||
|
||
if [ -z "$OBS_LOG_DIR" ]; then | ||
OBS_LOG_DIR="/srv/obs/log" | ||
fi | ||
|
||
if [ -n "$OBS_BACKENDCODE_DIR" ]; then | ||
obsdir="$OBS_BACKENDCODE_DIR" | ||
else | ||
obsdir=/usr/lib/obs/server | ||
fi | ||
rundir="$OBS_RUN_DIR" | ||
logdir="$OBS_LOG_DIR" | ||
|
||
rundir_perm() { | ||
# make sure rundir is group writable | ||
test "$(stat -c "%A" "$rundir" | cut -c6)" = "-" && chmod 0775 "$rundir" | ||
} | ||
|
||
rc_reset | ||
case "$1" in | ||
start) | ||
echo -n "Initializing obsclouduploadworker" | ||
mkdir -p "$rundir" "$logdir" | ||
rundir_perm | ||
chown obsrun:obsrun "$logdir" "$rundir" | ||
startproc -f -l "$logdir"/clouduploadworker.log "$obsdir"/bs_clouduploadworker | ||
rc_status -v | ||
;; | ||
stop) | ||
echo -n "Shutting down obsclouduploadworker" | ||
"$obsdir"/bs_clouduploadworker --stop | ||
rc_status -v | ||
;; | ||
restart) | ||
## If first returns OK call the second, if first or | ||
## second command fails, set echo return value. | ||
rundir_perm | ||
"$obsdir"/bs_clouduploadworker --restart | ||
rc_status | ||
;; | ||
try-restart|reload) | ||
$0 status | ||
if test $? = 0; then | ||
rundir_perm | ||
"$obsdir"/bs_clouduploadworker --restart | ||
else | ||
rc_reset # Not running is not a failure. | ||
fi | ||
# Remember status and be quiet | ||
rc_status | ||
;; | ||
status) | ||
echo -n "Checking for obsclouduploadworker and running processes: " | ||
checkproc "$obsdir"/bs_clouduploadworker | ||
rc_status -v | ||
;; | ||
*) | ||
echo "Usage: $0 {start|stop|status|try-restart|restart|reload}" | ||
exit 1 | ||
;; | ||
esac | ||
rc_exit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.