summaryrefslogtreecommitdiffstats
path: root/examples/root/etc/init.d/sleeper
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2005-08-23 16:09:14 +0000
committerLuke Kanies <luke@madstop.com>2005-08-23 16:09:14 +0000
commit6029ef7812765775306ff8394005c326e359d886 (patch)
tree32cbe5ea68e0e9fbdc0935d0b41e58fdfcba9e3d /examples/root/etc/init.d/sleeper
parente87eb58ce8dc40ba8c66233bf17cea61094e7647 (diff)
downloadpuppet-6029ef7812765775306ff8394005c326e359d886.tar.gz
puppet-6029ef7812765775306ff8394005c326e359d886.tar.xz
puppet-6029ef7812765775306ff8394005c326e359d886.zip
Moving all files into a consolidated trunk. All tests pass except the known-failing certificate test, but there appear to be some errors that are incorrectly not resulting in failurs. I will track those down ASAP.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@576 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'examples/root/etc/init.d/sleeper')
-rwxr-xr-xexamples/root/etc/init.d/sleeper65
1 files changed, 65 insertions, 0 deletions
diff --git a/examples/root/etc/init.d/sleeper b/examples/root/etc/init.d/sleeper
new file mode 100755
index 000000000..e7f5d3e30
--- /dev/null
+++ b/examples/root/etc/init.d/sleeper
@@ -0,0 +1,65 @@
+#!/bin/bash
+
+# $Id$
+
+script=$0
+path=`echo $script | sed 's/etc..*/bin/'`
+
+PATH=$PATH:$path
+
+ps=`facter ps | cut -d ' ' -f3-`
+
+if [ -z "$ps" ]; then
+ ps="ps -ef"
+fi
+
+function start
+{
+ sleeper
+}
+
+function stop
+{
+ #if [ -n `which pgrep` ]; then
+ # pid=`pgrep sleeper`
+ #else
+ pid=`$ps | grep -v grep | grep sleeper | grep ruby | awk '{print $2}'`
+ #fi
+ if [ -n "$pid" ]; then
+ kill $pid
+ fi
+}
+
+function status
+{
+ #if [ -n `which pgrep` ]; then
+ # cmd="pgrep sleeper"
+ #else
+ #cmd="$ps | grep -v grep | grep sleeper | grep ruby | awk '{print $2}'"
+ #fi
+ #$cmd
+ $ps | grep -v grep | grep sleeper | grep ruby
+}
+
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ restart)
+ stop; start
+ ;;
+ status)
+ output=`status`
+ #status
+ exit $?
+ ;;
+ *)
+ echo "Usage: $N {start|stop|restart|force-reload}" >&2
+ exit 1
+ ;;
+esac
+
+exit 0