Monday, June 11, 2012

Upgrading Cobbler from 2.0 to 2.2 -- and overcoming WSGI woes

If you've used Cobbler for a while, you'll want to upgrade it.  Naturally!

There's a problem with the upgrade, though:  the 2.0 version seems to use mod_python, and the new one uses mod_wsgi.  No problem, right?  So you install mod_wsgi as part of the process:


# service httpd start
Starting httpd: Syntax error on line 10 of /etc/httpd/conf.d/cobbler.conf:
Invalid command 'WSGIScriptAliasMatch', perhaps misspelled or defined by a
module not included in the server configuration
                                                           [FAILED]
So your server won't start.  Yay!

What's really going on is

  1. mod_python and mod_wsgi don't play well together
  2. mod_wsgi is impotent on install and needs activation
  3. mod_python is still the go-to for rendering the configs, which now use syntax it can't handle
The remedy is simple:
  1. remove mod_python.  It can't be used, so let's get it out to avoid dep- and other issues.

    rpm -e mod_python
  2. create a mod_wsgi config

    cat > /etc/httpd/conf.d/05-load-wsgi.conf
    LoadModule wsgi_module modules/mod_wsgi.so
    
    
    
  3. restart httpd

    service httpd restart
And that's it:

Stopping httpd:                                            [FAILED]
Starting httpd:                                            [  OK  ]

And you're back up and running.

Is it disappointing that it doesn't Just Work?  For sure.  Could you figure it out if you were a mod_python user or an expert, and knew the hell WSGi was?  Maybe.  But I'm not, and I think that as an app user it's not really on me to be an expert.  You may argue how proficient one needs to be to use any device, but I'm thinking it's not ready for prime-time yet.  Boo!

Labels: , , , , , , ,

Monday, April 30, 2012

Mac OS/X Password Recovery

So there we were, trying to set up a pic synch config for the photos, and - wouldn't you know it? - we couldn't remember the admin password on the mactop.

So we poke around the net for a while, and found this reference.  And it was easy:

  1. Boot into single (hold command-S) and kill the /var/db/.applesetupdone .
    • fsck -fy
    • mount -uw /
    • rm /var/db/.applesetupdone
    • reboot
  2. Create a New User Account upon System Boot, and let it go into the desktop
  3. Reset the Lost Password via System Preferences
It's that easy.  It's awesome, and doesn't need the CD.  What a great hack!

And we got the photo thing set up too.  Double-score!


Labels: , , ,

Saturday, March 03, 2012

Diffing Configs After an RPM install

Some daemon not starting?  Think you may have mucked with the config and you don't know how?  Let's talk about stashing your configs in an SCM, you lamer, or maybe doing a backup every month or so?  (ha, gotcha) For now, let's find out what you've done.
[root@gator ~]# mkdir /tmp/bz75819
[root@gator ~]# yumdownloader --destdir !$ `rpm -qf --qf "%{name}\n" /etc/httpd/conf/httpd.conf`
yumdownloader --destdir /tmp/bz75819 `rpm -qf --qf "%{name}\n" /etc/httpd/conf/httpd.conf`
[root@gator ~]# rpm2cpio /tmp/bz75819/*.rpm | cpio -tv | grep /etc/httpd/conf/httpd.conf
6573 blocks
-rw-r--r--   1 root     root        33726 Oct 20 14:05 ./etc/httpd/conf/httpd.conf
[root@gator ~]# rpm2cpio /tmp/bz75819/*.rpm | cpio -i --to-stdout */etc/httpd/conf/httpd.conf | diff -u - /etc/httpd/conf/httpd.conf
6573 blocks
--- -   2012-03-03 16:05:07.411845000 -0800
+++ /etc/httpd/conf/httpd.conf  2012-03-03 16:05:01.000000000 -0800
@@ -131,7 +131,7 @@
 # prevent Apache from glomming onto all bound IP addresses (0.0.0.0)
 #
 #Listen 12.34.56.78:80
-Listen 80
+#Listen 80

 #
 # Dynamic Shared Object (DSO) Support
So that's what you've done.  Yeah, it looks contrived, but I saw that this week.  So when I see it again this week, I know what to do.

Have you ever needed to find out just what you've changed in a config since a package has been installed?

Labels: , , , , , ,