Bug 478688 - httpd-2.2.11-4: service httpd stop will not work
httpd-2.2.11-4: service httpd stop will not work
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: httpd (Show other bugs)
rawhide
All Linux
low Severity medium
: ---
: ---
Assigned To: Joe Orton
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-01-03 12:08 EST by Reindl Harald
Modified: 2009-08-03 14:35 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-01-22 10:09:31 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Reindl Harald 2009-01-03 12:08:10 EST
Hi

I made a rebuild from the src.rpm for F9/F10
All works fine, only stopping service will not do anything
Using "apachectl" instead of "service" does it right

[root@srv-rhsoft:~]$ service httpd restart      
httpd beenden:                                             [FEHLGESCHLAGEN]
httpd starten: (98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down                                             
Unable to open logs
                                                           [FEHLGESCHLAGEN]
[root@srv-rhsoft:~]$ cat apache_error.log

[root@srv-rhsoft:~]$ service httpd stop
httpd beenden:                                             [FEHLGESCHLAGEN]
[root@srv-rhsoft:~]$ ps aux | grep httpd
root      3926  0.0  0.4 554340 34532 ?        Ss   17:22   0:00 /usr/sbin/httpd
apache    5853  0.0  0.2 554340 19200 ?        S    18:00   0:00 /usr/sbin/httpd
apache    5854  0.1  0.4 560668 33384 ?        S    18:00   0:00 /usr/sbin/httpd
apache    5855  0.0  0.2 554476 20692 ?        S    18:00   0:00 /usr/sbin/httpd
apache    5856  0.0  0.3 556988 28276 ?        S    18:00   0:00 /usr/sbin/httpd
apache    5857  0.0  0.2 554476 20684 ?        S    18:00   0:00 /usr/sbin/httpd
apache    5858  0.0  0.2 554476 20684 ?        S    18:00   0:00 /usr/sbin/httpd
apache    5859  0.0  0.3 556984 28196 ?        S    18:00   0:00 /usr/sbin/httpd
apache    5860  0.0  0.2 554476 20688 ?        S    18:00   0:00 /usr/sbin/httpd
apache    5861  0.0  0.2 554476 20688 ?        S    18:00   0:00 /usr/sbin/httpd
apache    5862  0.0  0.2 554476 20688 ?        S    18:00   0:00 /usr/sbin/httpd
apache    5863  0.0  0.3 556984 28172 ?        S    18:00   0:00 /usr/sbin/httpd
root      6104  0.0  0.0  87076   936 pts/5    S+   18:04   0:00 grep --color httpd
[root@srv-rhsoft:~]$ apachectl stop
[root@srv-rhsoft:~]$ ps aux | grep httpd
root      6116  0.0  0.0  87072   860 pts/5    S+   18:04   0:00 grep --color httpd
[root@srv-rhsoft:~]$ service httpd start
httpd starten:                                             [  OK  ]
[root@srv-rhsoft:
Comment 1 Joe Orton 2009-01-22 09:27:04 EST
Can you provide the output of

sh -x /etc/init.d/httpd stop
Comment 2 Reindl Harald 2009-01-22 09:34:02 EST
I hope this helps
Apache 2.2.11 is running like a charme, 
only stop him hangs, maybe it runs too smooth :-)

[root@srv-rhsoft:~]$ sh -x /etc/init.d/httpd stop
+ . /etc/rc.d/init.d/functions                   
++ TEXTDOMAIN=initscripts                        
++ umask 022                                     
++ PATH=/sbin:/usr/sbin:/bin:/usr/bin            
++ export PATH                                   
++ '[' -z '' ']'                                 
++ COLUMNS=80                                    
++ '[' -z '' ']'                                 
+++ /sbin/consoletype                            
++ CONSOLETYPE=pty                               
++ '[' -f /etc/sysconfig/i18n -a -z '' -a -z '' ']'
++ . /etc/profile.d/lang.sh                        
+++ sourced=0                                      
+++ '[' -n de_DE.UTF-8 ']'                         
+++ saved_lang=de_DE.UTF-8                         
+++ '[' -f /root/.i18n ']'                         
+++ LANG=de_DE.UTF-8                               
+++ unset saved_lang                               
+++ '[' 0 = 1 ']'                                  
+++ unset sourced                                  
+++ unset langfile                                 
++ unset LANGSH_SOURCED                            
++ '[' -z '' ']'                                   
++ '[' -f /etc/sysconfig/init ']'                  
++ . /etc/sysconfig/init                           
+++ BOOTUP=color                                   
+++ RES_COL=60                                     
+++ MOVE_TO_COL='echo -en \033[60G'                
+++ SETCOLOR_SUCCESS='echo -en \033[0;32m'         
+++ SETCOLOR_FAILURE='echo -en \033[0;31m'         
+++ SETCOLOR_WARNING='echo -en \033[0;33m'         
+++ SETCOLOR_NORMAL='echo -en \033[0;39m'          
+++ LOGLEVEL=3                                     
+++ PROMPT=yes                                     
+++ AUTOSWAP=no                                    
++ '[' pty = serial ']'                            
++ __sed_discard_ignored_files='/\(~\|\.bak\|\.orig\|\.rpmnew\|\.rpmorig\|\.rpmsave\)$/d'
+ '[' -f /etc/sysconfig/httpd ']'                                                        
+ . /etc/sysconfig/httpd                                                                 
+ HTTPD_LANG=C                                                                           
+ INITLOG_ARGS=                                                                          
+ apachectl=/usr/sbin/apachectl                                                          
+ httpd=/usr/sbin/httpd                                                                  
+ prog=httpd                                                                             
+ pidfile=/var/run/httpd/httpd.pid                                                       
+ lockfile=/var/lock/subsys/httpd                                                        
+ RETVAL=0                                                                               
+ case "$1" in                                                                           
+ stop                                                                                   
+ echo -n 'httpd beenden: '                                                              
httpd beenden: + killproc -p /var/run/httpd/httpd.pid -d 10 /usr/sbin/httpd              
+ local RC killlevel= base pid pid_file= delay                                           
+ RC=0                                                                                   
+ delay=3                                                                                
+ '[' 5 -eq 0 ']'                                                                        
+ '[' -p = -p ']'                                                                        
+ pid_file=/var/run/httpd/httpd.pid                                                      
+ shift 2                                                                                
+ '[' -d = -d ']'                                                                        
+ delay=10                                                                               
+ shift 2                                                                                
+ '[' -n '' ']'                                                                          
+ base=httpd                                                                             
+ __pids_var_run /usr/sbin/httpd /var/run/httpd/httpd.pid                                
+ local base=httpd                                                                       
+ local pid_file=/var/run/httpd/httpd.pid                                                
+ pid=                                                                                   
+ '[' -f /var/run/httpd/httpd.pid ']'                                                    
+ return 3                                                                               
+ '[' -z /var/run/httpd/httpd.pid -a -z '' ']'                                           
+ '[' -n '' ']'                                                                          
+ '[' -n '' -a -n '' ']'                                                                 
+ failure 'httpd beenden'                                                                
+ local rc=1                                                                             
+ '[' color '!=' verbose -a -z '' ']'                                                    
+ echo_failure
+ '[' color = color ']'
+ echo -en '\033[60G'
                                                           + echo -n '['
[+ '[' color = color ']'
+ echo -en '\033[0;31m'
+ echo -n FEHLGESCHLAGEN
FEHLGESCHLAGEN+ '[' color = color ']'
+ echo -en '\033[0;39m'
+ echo -n ']'
]+ echo -ne '\r'
+ return 1
+ '[' -x /usr/bin/plymouth ']'
+ /usr/bin/plymouth --details
+ return 1
+ RC=0
+ '[' -z '' ']'
+ rm -f /var/run/httpd/httpd.pid
+ return 0
+ RETVAL=0
+ echo

+ '[' 0 = 0 ']'
+ rm -f /var/lock/subsys/httpd /var/run/httpd/httpd.pid
+ exit 0
Comment 3 Joe Orton 2009-01-22 09:42:37 EST
httpd wrote it's pidfile somewhere unexpected.  You probably have an old httpd.conf.  Output of:

rpm -q httpd
rpm -V httpd
grep -i pidfile /etc/httpd/conf/httpd.conf
Comment 4 Reindl Harald 2009-01-22 10:05:06 EST
Thank you - That was it
Yes we use some years old "httpd.conf" because here are running > 100 virtual hosts and our setup is very complex and straight designed for our applications

I think it would be a good idea in /etc/init.d/httpd parse the "httpd.conf" if such things are changed and make only a fallback to hardcoded if there is no result

[root@srv-rhsoft:~]$ rpm -q httpd
httpd-2.2.11-8.fc10.rh.x86_64

[root@srv-rhsoft:~]$ rpm -V httpd
S.5....T  c /etc/httpd/conf.d/proxy_ajp.conf
S.5....T  c /etc/httpd/conf.d/welcome.conf
SM5...GT  c /etc/httpd/conf/httpd.conf
S.5....T    /etc/rc.d/init.d/httpd

[root@srv-rhsoft:~]$ grep -i pidfile /etc/httpd/conf/httpd.conf
PidFile    "run/httpd.pid"

[root@srv-rhsoft:~]$ cat /etc/init.d/httpd | grep pid
# pidfile: /var/run/httpd/httpd.pid
pidfile=${PIDFILE-/var/run/httpd/httpd.pid}
        LANG=$HTTPD_LANG daemon --pidfile=${pidfile} $httpd $OPTIONS
        killproc -p ${pidfile} -d 10 $httpd
        [ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile}
        killproc -p ${pidfile} $httpd -HUP
        if [ -f ${pidfile} ] ; then

[root@srv-rhsoft:~]$ nano /etc/httpd/conf/httpd.conf

[root@srv-rhsoft:~]$ grep -i pidfile /etc/httpd/conf/httpd.conf
PidFile "/var/run/httpd/httpd.pid"

[root@srv-rhsoft:~]$ apachectl stop
httpd (no pid file) not running
[root@srv-rhsoft:~]$ killall httpd

[root@srv-rhsoft:~]$ service httpd start
httpd starten:                                             [  OK  ]

[root@srv-rhsoft:~]$ service httpd stop
httpd beenden:                                             [  OK  ]

[root@srv-rhsoft:~]$ service httpd start
httpd starten:                                             [  OK  ]
Comment 5 Joe Orton 2009-01-22 10:09:31 EST
Yeah, I've fixed this so that the PidFile directive doesn't need to change, but the /etc/httpd/run symlink is changed to point to /var/run/httpd and everything should work correclty after an upgrade even if the old httpd.conf is used.

Thanks for reporting this.

(testing of httpd-2.2.11-6 from Raw Hide very welcome!)
Comment 6 Rainer Traut 2009-03-17 08:51:49 EDT
I see in httpd-2.2.11-7's logrotate:

/bin/kill -HUP `cat /var/run/httpd.pid 2>/dev/null` 2> /dev/null || true

That's the wrong path, too.

Why the change to use a subdir for the pidfile?
Comment 7 Joe Orton 2009-03-17 09:12:43 EDT
Thanks Rainer, fixed in -8.

The subdir is there so that the $SERVER_ROOT-relative path "run/" can be used to store arbitrary runtime state; future releases may exploit this (the new mod_socache_* modules in the httpd trunk use it as a default, for example).
Comment 8 Victor Quinault 2009-05-21 19:13:01 EDT
(In reply to comment #7)
> Thanks Rainer, fixed in -8.
> 
The status should not be close :
runing rawhide uptodate 21/05/2009 (httpd-2.2.11-8.i586), and reinstalling httpd (and deleting httpd.conf during the operation) did not solved the problem : the pid file in the conf file is still : run/httpd.pid

Thanks to watch our beloved apache :)
Victor
Comment 9 Michael Breuer 2009-07-31 14:03:44 EDT
Let me add: /etc/httpd/conf.d/system-config-httpd.conf has the pid file as /var/run/http.pid

Also conflicts with the startup script and httpd.conf.
Comment 10 Joe Orton 2009-08-03 05:58:20 EDT
Michael, can you file a bug against system-config-httpd describing that problem?
Comment 11 Michael Breuer 2009-08-03 14:35:51 EDT
done.

Note You need to log in before you can comment on or make changes to this bug.