[PATCH 5/5] Active configuration / state management of ietd - including feature for reloading ietd.conf

View: New views
1 Messages — Rating Filter:   Alert me  

[PATCH 5/5] Active configuration / state management of ietd - including feature for reloading ietd.conf

by Rob Caldwell :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Patch 5:  Adds reload capability to the initd scripts.

diff -upr trunk.orig/etc/initd/initd trunk/etc/initd/initd
--- trunk.orig/etc/initd/initd 2008-09-05 17:08:23.000000000 -0400
+++ trunk/etc/initd/initd 2008-09-12 14:07:27.000000000 -0400
@@ -19,6 +19,12 @@ stop_server()
  modprobe -r iscsi_trgt
 }
 
+reload_server()
+{
+ PID=`pidof ietd`
+ kill -HUP $PID
+}
+
 case "$1" in
  start)
  start_server
@@ -26,8 +32,11 @@ case "$1" in
  stop)
  stop_server
  ;;
+ reload)
+ reload_server
+ ;;
  *)
- echo "Usage: {start|stop}" >&2
+ echo "Usage: {start|stop|reload}" >&2
  exit 1
  ;;
 esac
diff -upr trunk.orig/etc/initd/initd.debian trunk/etc/initd/initd.debian
--- trunk.orig/etc/initd/initd.debian 2008-09-05 17:08:23.000000000 -0400
+++ trunk/etc/initd/initd.debian 2008-09-09 23:34:25.000000000 -0400
@@ -74,6 +74,12 @@ case "$1" in
  sleep 1
  ietd_start
         ;;
+  reload)
+ PID=`pidof ietd`
+ if [ $PID ]; then
+ kill -HUP $PID
+ fi
+ ;;
   status)
  PID=`pidof ietd`
  if [ $PID ]; then
diff -upr trunk.orig/etc/initd/initd.gentoo trunk/etc/initd/initd.gentoo
--- trunk.orig/etc/initd/initd.gentoo 2008-09-05 17:08:23.000000000 -0400
+++ trunk/etc/initd/initd.gentoo 2008-09-12 14:15:22.000000000 -0400
@@ -5,6 +5,8 @@
 
 PATH=/sbin:/bin:/usr/sbin:/usr/bin
 
+opts="${opts} reload"
+
 depend()
 {
         use net
@@ -24,6 +26,12 @@ stop_server()
         modprobe -r iscsi_trgt
 }
 
+reload()
+{
+ PID=`pidof ietd`
+ kill -HUP $PID
+}
+
 start()
 {
         ebegin "Starting iscsi"
diff -upr trunk.orig/etc/initd/initd.redhat trunk/etc/initd/initd.redhat
--- trunk.orig/etc/initd/initd.redhat 2008-09-05 17:08:23.000000000 -0400
+++ trunk/etc/initd/initd.redhat 2008-09-09 23:36:44.000000000 -0400
@@ -61,6 +61,14 @@ condrestart()
  fi
 }
 
+reload()
+{
+ PID=`pidofproc ietd`
+ if [ $PID ]; then
+ kill -HUP $PID
+ fi
+}
+
 status()
 {
  PID=`pidofproc ietd`
@@ -88,8 +96,11 @@ case "$1" in
   status)
         status
         ;;
+  reload)
+ reload
+ ;;
   *)
-        echo $"Usage: $0 {start|stop|restart|status}"
+        echo $"Usage: $0 {start|stop|restart|reload|status}"
         exit 1
 esac
 



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Iscsitarget-devel mailing list
Iscsitarget-devel@...
https://lists.sourceforge.net/lists/listinfo/iscsitarget-devel
LightInTheBox - Buy quality products at wholesale price!