Vinzenz Feenstra has uploaded a new change for review.

Change subject: Init script for SLES
......................................................................

Init script for SLES

Change-Id: Ic647c42e986937cc5e18cb40bec7023997e6dd1c
Signed-off-by: Vinzenz Feenstra <vfeen...@redhat.com>
---
A ovirt-guest-agent/ovirt-guest-agent.sles
1 file changed, 113 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-guest-agent 
refs/changes/63/26763/1

diff --git a/ovirt-guest-agent/ovirt-guest-agent.sles 
b/ovirt-guest-agent/ovirt-guest-agent.sles
new file mode 100755
index 0000000..3b6c81e
--- /dev/null
+++ b/ovirt-guest-agent/ovirt-guest-agent.sles
@@ -0,0 +1,113 @@
+#!/bin/sh
+#
+#     Template SUSE system startup script for example service/daemon 
ovirt-guest-agent
+#     Copyright (C) 1995--2005  Kurt Garloff, SUSE / Novell Inc.
+#          
+#     This library is free software; you can redistribute it and/or modify it
+#     under the terms of the GNU Lesser General Public License as published by
+#     the Free Software Foundation; either version 2.1 of the License, or (at
+#     your option) any later version.
+#                            
+#     This library is distributed in the hope that it will be useful, but
+#     WITHOUT ANY WARRANTY; without even the implied warranty of
+#     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#     Lesser General Public License for more details.
+#      
+#     You should have received a copy of the GNU Lesser General Public
+#     License along with this library; if not, write to the Free Software
+#     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307,
+#     USA.
+#
+# /etc/init.d/ovirt-guest-agent
+#   and its symbolic link
+# /(usr/)sbin/rcovirt-guest-agent
+#
+### BEGIN INIT INFO
+# Provides:          ovirt-guest-agent
+# Required-Start:    
+# Should-Start:      
+# Required-Stop:    
+# Should-Stop:       
+# Default-Start:     3 5
+# Default-Stop:      0 1 2 6
+# Short-Description: ovirt-guest-agent
+# Description:       Start ovirt-guest-agent
+### END INIT INFO
+
+
+# Check for missing binaries (stale symlinks should not happen)
+# Note: Special treatment of stop for LSB conformance
+ovirt_guest_agent_BIN=/usr/share/ovirt-guest-agent/ovirt-guest-agent.py
+test -x $ovirt_guest_agent_BIN || { echo "$ovirt_guest_agent_BIN not 
installed"; 
+       if [ "$1" = "stop" ]; then exit 0;
+       else exit 5; fi; }
+
+. /etc/rc.status
+
+# Reset status of this service
+rc_reset
+
+pidfile=/var/run/ovirt-guest-agent.pid
+
+case "$1" in
+    start)
+       echo -n "Starting ovirt-guest-agent "
+       if [ ! -d /dev/virtio-ports ]; then
+               modprobe virtio_console > /dev/null 2>&1
+               for retries in `seq 5`; do
+                       sleep 1
+                       [ -d /dev/virtio-ports ] && break
+               done
+               [ -f /sbin/udevadm ] && /sbin/udevadm trigger
+       fi
+       if [ ! -f ${pidfile} ]; then
+               /bin/touch ${pidfile}
+               /bin/chown ovirtagent:ovirtagent ${pidfile}
+       fi
+
+       /sbin/startproc -u ovirtagent -g ovirtagent $ovirt_guest_agent_BIN 
+       rc_status -v
+       ;;
+    stop)
+       echo -n "Shutting down ovirt-guest-agent "
+       /sbin/killproc -TERM $ovirt_guest_agent_BIN
+       rc_status -v
+       ;;
+    try-restart)
+       $0 status
+       if test $? = 0; then
+               $0 restart
+       else
+               rc_reset
+       fi
+       rc_status
+       ;;
+    restart)
+       $0 stop
+       $0 start
+       rc_status
+       ;;
+    force-reload)
+       echo -n "Reload service ovirt-guest-agent "
+       /sbin/killproc -HUP $ovirt_guest_agent_BIN
+       rc_status -v
+       ;;
+    reload)
+       echo -n "Reload service ovirt-guest-agent "
+       /sbin/killproc -HUP $ovirt_guest_agent_BIN
+       rc_status -v
+       ;;
+    status)
+       echo -n "Checking for service ovirt-guest-agent "
+       /sbin/checkproc $ovirt_guest_agent_BIN
+       rc_status -v
+       ;;
+    probe)
+       test /etc/ovirt-guest-agent.conf -nt /var/run/ovirt-guest-agent.pid && 
echo reload
+       ;;
+    *)
+       echo "Usage: $0 
{start|stop|status|try-restart|restart|force-reload|reload|probe}"
+       exit 1
+       ;;
+esac
+rc_exit


-- 
To view, visit http://gerrit.ovirt.org/26763
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic647c42e986937cc5e18cb40bec7023997e6dd1c
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-guest-agent
Gerrit-Branch: master
Gerrit-Owner: Vinzenz Feenstra <vfeen...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to