Bug 122631

Summary: /var/lock/subsys/htt problem, 100% CPU usage, htt failure
Product: [Fedora] Fedora Reporter: Joe Orton <jorton>
Component: im-sdkAssignee: Yu Shao <yshao>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: eng-i18n-bugs, sopwith, wtogami
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-05-10 18:44:16 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 114961    

Description Joe Orton 2004-05-06 14:41:31 UTC
# rpm -qf /usr/sbin/htt
iiimf-server-11.4-41

From a default boot into runlevel 5, do:

# telinit 3

after a few seconds you're left with two htt daemons; the latter is
eating CPU, continually spawning a new child which dies because it
can't bind to port 9010

10967 ?        S      0:00 /usr/sbin/htt
10968 ?        S      0:00  \_ htt_server -nodaemon
11175 ?        R      0:00 /usr/sbin/htt
15648 ?        R      0:00  \_ htt_server -nodaemon

# strace -f -e clone,bind -p 11175
--- SIGCHLD (Child exited) @ 0 (0) ---
clone(Process 18988 attached
child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD,
child_tidptr=0xf70d68c8) = 18988
Process 11175 suspended
[pid 18988] bind(3, {sa_family=AF_INET, sin_port=htons(9010),
sin_addr=inet_addr("127.0.0.1")}, 16) = -1 EADDRINUSE (Address already
in use)
Process 11175 resumed
Process 18988 detached
--- SIGCHLD (Child exited) @ 0 (0) ---
clone(Process 18989 attached
child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD,
child_tidptr=0xf70d68c8) = 18989
Process 11175 suspended
[pid 18989] bind(3, {sa_family=AF_INET, sin_port=htons(9010),
sin_addr=inet_addr("127.0.0.1")}, 16) = -1 EADDRINUSE (Address already
in use)
Process 11175 resumed
Process 18989 detached
--- SIGCHLD (Child exited) @ 0 (0) ---

Comment 1 Warren Togami 2004-05-10 09:33:57 UTC
The service design itself needs work, but for now the problem can be
avoided by fixing the /etc/init.d/IIim script.  Unfortunately in the
course of investigating this bug, I realized that it causes 100% CPU
usage and total failure of htt's functionality in non-obvious way. =(

Setting FC2BLOCKER and rebuilding now, but it is up to Elliot if he
would allow this update into FC2 final.  If not then this should go
out in the first batch of FC2 updates immediately upon release.

--- IIim.orig	2004-05-09 23:04:19.297215883 -1000
+++ IIim	2004-05-09 23:14:42.989597637 -1000
@@ -16,11 +16,16 @@
 test -x $HTT || exit 0
 
 start() {
-        echo -n $"Starting IIIMF input server: "
-        daemon --user htt $HTT $OPTIONS 2>&1 </dev/null
-        echo
-	RETVAL=$?
-	[ $RETVAL -eq 0 ] && touch $LOCKER
+        if [ ! -f $LOCKER ]; then
+                echo -n $"Starting IIIMF input server: "
+                daemon --user htt $HTT $OPTIONS 2>&1 </dev/null
+                echo
+	        RETVAL=$?
+	        [ $RETVAL -eq 0 ] && touch $LOCKER
+        else
+                return 0
+        fi
+        return $RETVAL
 }
 
 stop() {
@@ -46,7 +51,7 @@
         start
         ;;
   condrestart)
-        if [ -f /var/lock/subsys/htt ]; then
+        if [ -f $LOCKER ]; then
             stop
             start
         fi