files from an RPM, restarting httpd

Print Friendly, PDF & Email

I wasn’t sure whether a particular file from a yum-managed package had changed.  (/etc/sysconfig/httpd as it happens, but that’s not essential to this problem.

So, I wanted to (1) download the RPM, and (2) look at the files in it.  This page seems to show how:  http://www.cyberciti.biz/faq/yum-downloadonly-plugin/

I first tried the download-only command-line argument:

root@tempest conf.d] yum update httpd -y --downloadonly
Loaded plugins: downloadonly, product-id, refresh-packagekit, rhnplugin, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
This system is receiving updates from RHN Classic or RHN Satellite.
Setting up Update Process
No Packages marked for Update
[root@tempest conf.d] ls /var/cache/yum/
x86_64
[root@tempest conf.d] find /var/cache/yum/ -name "*httpd*"
[root@tempest conf.d]

Okay, so that’s useless.  Let me try method #2:

[root@tempest conf.d] cd /root/tmp/
[root@tempest tmp] yumdownloader httpd
Loaded plugins: product-id, refresh-packagekit, rhnplugin
This system is receiving updates from RHN Classic or RHN Satellite.
httpd-2.2.15-26.el6.x86_64.rpm                                                                          | 821 kB     00:00     
[root@tempest tmp] ls -l httpd-2.2.15-26.el6.x86_64.rpm 
-rw-rw----. 1 root root 840348 Feb 18 15:45 httpd-2.2.15-26.el6.x86_64.rpm
[root@tempest tmp]

Yes, that’s much better.

Now to find that file:

[root@tempest tmp] rpm2cpio httpd-2.2.15-26.el6.x86_64.rpm | cpio -idmv [root@tempest tmp] ls -l ./etc/sysconfig/httpd 
-rw-r--r--. 1 root root 947 Dec  5 03:59 ./etc/sysconfig/httpd
[root@tempest tmp]

Excellent!  This is almost easy.

[root@tempest tmp] diff !$ /etc/sysconfig/httpd.orig 
diff ./etc/sysconfig/httpd /etc/sysconfig/httpd.orig 
31c31
< #PIDFILE=/var/run/httpd/httpd.pid
---
> #PIDFILE=/var/run/httpd.pid
[root@tempest tmp]

Ah, so that did change.  What about the startup script?

[root@tempest tmp] diff ./etc/rc.d/init.d/httpd /etc/rc.d/init.d/httpd

No change there. What about the httpd.conf file?

[root@tempest tmp] diff ./etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf
65c65
< PidFile run/httpd.pid
---
> PidFile /var/run/httpd.pid

Weird.  Why can’t they make up their minds?

The problem I’m trying to solve is this:

[root@tempest sysconfig] service httpd restart
Stopping httpd:                                            [FAILED]
Starting httpd: (98)Address already in use: make_sock: could not bind to address [::]:80
(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
                                                           [FAILED]
[root@tempest sysconfig]

But I think that’s because it’s looking in the wrong place for the PID file, so it can’t stop httpd, and then it can’t start it because it’s already running and listening on port 80.  But, change where it’s looking for the PID file, and all is well:

[root@tempest sysconfig] pwd
/etc/sysconfig
[root@tempest sysconfig] diff httpd.orig httpd
31c31,32
< #PIDFILE=/var/run/httpd.pid
---
> # Wellesley mod:  uncomment this
> PIDFILE=/var/run/httpd.pid
[root@tempest sysconfig]

And now:

[root@tempest sysconfig] service httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd:                                            [  OK  ]
[root@tempest sysconfig]

 

 

 

 

About CS SysAdmins

The CS Department System Administrators
This entry was posted in Uncategorized. Bookmark the permalink.

One Response to files from an RPM, restarting httpd

Leave a Reply

Your email address will not be published. Required fields are marked *