[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Ovirt-devel] [PATCH 01/10] Modified init scripts for inclusion in Fedora



ovirt
ovirt-early
ovirt-firstboot
ovirt-post

Added reload to init functions
Added status
Added lockfile
---
 scripts/ovirt           |   18 ++++++++++++++++++
 scripts/ovirt-early     |   16 ++++++++++++++++
 scripts/ovirt-firstboot |   18 +++++++++++++++++-
 scripts/ovirt-post      |   18 ++++++++++++++++++
 4 files changed, 69 insertions(+), 1 deletions(-)

diff --git a/scripts/ovirt b/scripts/ovirt
index 4ff03f2..9503c06 100755
--- a/scripts/ovirt
+++ b/scripts/ovirt
@@ -10,7 +10,13 @@
 . /etc/init.d/functions
 . /etc/init.d/ovirt-functions

+prog=ovirt
+lockfile=/var/lock/subsys/$prog
+
 start() {
+
+    touch $lockfile 
+
     if is_standalone; then
         return 0
     fi
@@ -74,6 +80,8 @@ start() {
     else
         log "skipping libvirt-qpid and matahari configuration, could not find $libvirt_qpid_conf"
     fi
+    
+    rm -f $lockfile
 }

 case "$1" in
@@ -89,6 +97,16 @@ case "$1" in
         test $? == 0 && success || failure
         echo
         ;;
+    status)
+        status $prog
+        ;;
+    reload)
+        stop
+        start
+        ;;
+    stop)
+        stop
+        ;;
     *)
         echo "Usage: ovirt {start}"
         exit 2
diff --git a/scripts/ovirt-early b/scripts/ovirt-early
index cdd4afd..dcbcac4 100755
--- a/scripts/ovirt-early
+++ b/scripts/ovirt-early
@@ -10,6 +10,9 @@
 . /etc/init.d/functions
 . /etc/init.d/ovirt-functions

+prog=ovirt-early
+lockfile=/var/lock/subsys/$prog
+
 BONDING_MODCONF_FILE=/etc/modprobe.d/bonding
 AUGTOOL_CONFIG=/var/tmp/augtool-config

@@ -130,6 +133,7 @@ find_disk() {


 start() {
+    touch $lockfile
     # oVirt boot parameters
     #   BOOTIF=link|eth*|<MAC> (appended by pxelinux)
     #   ovirt_init=[usb|scsi[:serial#]|/dev/...]
@@ -433,6 +437,8 @@ start() {
             fi
         fi
     fi
+    
+    rm -f $lockfile

     return 0
 }
@@ -481,6 +487,16 @@ case "$1" in
         test $? == 0 && success || failure
         echo
         ;;
+    status)
+        status $prog
+        ;;
+    reload)
+        stop
+        start
+        ;;
+    stop)
+        stop
+        ;;
     *)
         echo "Usage: ovirt-early {start}"
         exit 2
diff --git a/scripts/ovirt-firstboot b/scripts/ovirt-firstboot
index bdafb33..335bdaa 100755
--- a/scripts/ovirt-firstboot
+++ b/scripts/ovirt-firstboot
@@ -27,6 +27,9 @@
 . /etc/init.d/functions
 . /etc/init.d/ovirt-functions

+prog=ovirt-firstboot
+lockfile=/var/lock/subsys/$prog
+
 trap '__st=$?; stop_log; exit $__st' 0
 trap 'exit $?' 1 2 13 15

@@ -35,6 +38,8 @@ start ()
     if ! is_firstboot && ! is_auto_install; then
         return
     fi
+	
+	touch $lockfile

     # by default in standalone, disable collectd until server is configured
     service collectd stop > /dev/null 2>&1
@@ -63,6 +68,8 @@ start ()
     disable_firstboot

     ovirt_store_firstboot_config >> $OVIRT_LOGFILE 2>&1
+    
+    rm -f $lockfile
 }

 case "$1" in
@@ -78,7 +85,16 @@ case "$1" in
         test $? == 0 && success || failure
         echo
         ;;
-
+    status)
+        status $prog
+        ;;
+    reload)
+        stop
+        start
+        ;;
+    stop)
+        stop
+        ;;
     *)
         echo "Usage: ovirt-firstboot {start}"
         exit 2
diff --git a/scripts/ovirt-post b/scripts/ovirt-post
index 1fcfd6a..5cc8b8a 100755
--- a/scripts/ovirt-post
+++ b/scripts/ovirt-post
@@ -10,6 +10,9 @@
 . /etc/init.d/functions
 . /etc/init.d/ovirt-functions

+prog=ovirt-post
+lockfile=/var/lock/subsys/$prog
+
 start() {
     # wait for libvirt to finish initializing
     local count=0
@@ -24,6 +27,9 @@ start() {
 	    count=$(expr $count + 1)
 	    sleep 1
 	fi
+	
+	touch $lockfile
+	
     done
     BACKUP=$(mktemp)
     ISSUE=/etc/issue
@@ -61,6 +67,8 @@ start() {

     # Removed ovirt-identify-node since it has now
     # been replaced with the matahari qmf agent.
+    
+    rm -f $lockfile
 }

 case "$1" in
@@ -76,6 +84,16 @@ case "$1" in
         test $? == 0 && success || failure
         echo
         ;;
+    status)
+        status $prog
+        ;;
+    reload)
+        stop
+        start
+        ;;
+    stop)
+        stop
+        ;;
     *)
         echo "Usage: ovirt-post {start}"
         exit 2
-- 
1.6.2.5


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]