Check */*.rpm for signing.
[myplc.git] / plc.d / functions
index b407217..987a99d 100644 (file)
@@ -5,7 +5,7 @@
 # Mark Huang <mlhuang@cs.princeton.edu>
 # Copyright (C) 2006 The Trustees of Princeton University
 #
-# $Id: functions,v 1.6 2006/07/10 21:05:37 mlhuang Exp $
+# $Id$
 #
 
 export PATH=/sbin:/bin:/usr/bin:/usr/sbin
@@ -56,7 +56,16 @@ plc_daemon ()
     [ -n "${pid:-}" -a -z "${force:-}" ] && return
 
     # And start it up.
-    (exec -a plc_${base} $*)
+    # Thierry -- June 18 2007
+    # when invoking, e.g. service plc start httpd from an ssh connection
+    # ssh stupidly hangs when everything is done
+    # it turns out the forked ssh daemon exhibits the following stack at that point
+    # (gdb) where
+    # #0  0x001d6402 in __kernel_vsyscall ()
+    # #1  0x003c2e7d in ___newselect_nocancel () from /lib/libc.so.6
+    # #2  0x004387b4 in main () from /usr/sbin/sshd
+    # So I figured the various file descriptors used were not properly closed
+    (exec 3>&- 4>&- ; exec -a plc_${base} $*)
     ret=$?
 
     if [ -f /var/run/${base}.pid ] ; then
@@ -84,9 +93,7 @@ symlink ()
 lower ()
 {
     if [ ${#*} -ge 1 ] ; then
-       tr A-Z a-z <<EOF
-$*
-EOF
+       tr A-Z a-z <<<$*
     else
        tr A-Z a-z
     fi
@@ -96,9 +103,7 @@ EOF
 upper ()
 {
     if [ ${#*} -ge 1 ] ; then
-       tr a-z A-Z <<EOF
-$*
-EOF
+       tr a-z A-Z <<<$*
     else
        tr a-z A-Z
     fi