summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorirregulator <irregulator@riseup.net>2014-05-24 17:41:46 +0300
committerelijah <elijah@riseup.net>2014-07-01 16:05:41 -0700
commit4ad025d9d7b0c1999bf34e0acd3ca12c88358d05 (patch)
treec96dcf22e0a621c03f1d6141e0f6133a3995b0eb
parent49c4235477ab11118f8fc92a6f554b36121b36b2 (diff)
Simplify init script, let puppet service resource use init status
-rwxr-xr-xpuppet/modules/obfsproxy/files/obfsproxy_init9
-rw-r--r--puppet/modules/obfsproxy/manifests/init.pp2
2 files changed, 4 insertions, 7 deletions
diff --git a/puppet/modules/obfsproxy/files/obfsproxy_init b/puppet/modules/obfsproxy/files/obfsproxy_init
index 7a7e7609..b1297738 100755
--- a/puppet/modules/obfsproxy/files/obfsproxy_init
+++ b/puppet/modules/obfsproxy/files/obfsproxy_init
@@ -44,14 +44,14 @@ stop_obfsproxy() {
}
status_obfsproxy() {
- status_of_proc -p $PIDFILE $DAEMON $NAME && status="0" || status="$?"
+ status_of_proc -p $PIDFILE $DAEMON $NAME
}
case $1 in
start)
if [ -e $PIDFILE ]; then
status_obfsproxy
- if [ $status = "0" ]; then
+ if [ $? = "0" ]; then
exit
fi
fi
@@ -62,15 +62,14 @@ case $1 in
stop)
if [ -e $PIDFILE ]; then
status_obfsproxy
- if [ $status = "0" ]; then
+ if [ $? = "0" ]; then
log_begin_msg "Stopping $DESC"
stop_obfsproxy
rm -f $PIDFILE
log_end_msg $?
fi
else
- log_daemon_msg "$NAME is not running"
- log_end_msg $?
+ status_obfsproxy
fi
;;
restart)
diff --git a/puppet/modules/obfsproxy/manifests/init.pp b/puppet/modules/obfsproxy/manifests/init.pp
index 1ee44d6f..b45a60a1 100644
--- a/puppet/modules/obfsproxy/manifests/init.pp
+++ b/puppet/modules/obfsproxy/manifests/init.pp
@@ -71,8 +71,6 @@ class obfsproxy (
service { 'obfsproxy':
ensure => running,
- status => '/usr/sbin/service obfsproxy status
- | grep "is running"',
require => [
Package['obfsproxy'],
File['/etc/init.d/obfsproxy'] ]