Skip to content

Commit 5c56101

Browse files
author
Brandon Riden
committed
Fix issue with init.d script
issue is when you don't have permission to access the server
1 parent c72ab42 commit 5c56101

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

templates/consul.init.erb

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,14 @@ stop() {
101101
return $retcode
102102
}
103103

104+
status() {
105+
"$CONSUL" info ${HTTP_ADDR}
106+
consul_pid=$(cat $PID_FILE)
107+
checkpid $consul_pid
108+
retcode=$?
109+
exit $retcode
110+
}
111+
104112
case "$1" in
105113
start)
106114
start
@@ -109,7 +117,7 @@ case "$1" in
109117
stop
110118
;;
111119
status)
112-
"$CONSUL" info ${RPC_ADDR}
120+
status
113121
;;
114122
restart)
115123
stop

0 commit comments

Comments
 (0)