File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,24 @@ SCRIPTNAME=/etc/init.d/$NAME
26
26
# to increase this limit.
27
27
ulimit -n 16384
28
28
29
+ # initially noop but can adjust according by modifying orchestrator_profile
30
+ # - see https://github.com/github/orchestrator/issues/227 for more details.
31
+ post_start_daemon_hook () {
32
+ # by default do nothing
33
+ :
34
+ }
35
+
36
+ # Start the orchestrator daemon in the background
37
+ start_daemon () {
38
+ # start up daemon in the background
39
+ $DAEMON_PATH /$DAEMON $DAEMONOPTS >> /var/log/${NAME} .log 2>&1 &
40
+ # collect and print PID of started process
41
+ echo $!
42
+ # space for optional processing after starting orchestrator
43
+ # - redirect stdout to stderro to prevent this corrupting the pid info
44
+ post_start_daemon_hook 1>&2
45
+ }
46
+
29
47
# The file /etc/orchestrator_profile can be used to inject pre-service execution
30
48
# scripts, such as exporting variables or whatever. It's yours!
31
49
[ -f /etc/orchestrator_profile ] && . /etc/orchestrator_profile
@@ -34,7 +52,7 @@ case "$1" in
34
52
start)
35
53
printf " %-50s" " Starting $NAME ..."
36
54
cd $DAEMON_PATH
37
- PID=$( ./ $DAEMON $DAEMONOPTS >> /var/log/ ${NAME} .log 2>&1 & echo $! )
55
+ PID=$( start_daemon )
38
56
# echo "Saving PID" $PID " to " $PIDFILE
39
57
if [ -z $PID ]; then
40
58
printf " %s\n" " Fail"
You can’t perform that action at this time.
0 commit comments