Patch to 1.4.2 on the road to 1.4.3
Hunter Matthews <[email protected]> 28 Jan 2003 14:53:41 -0500
| Newsgroups | gmane.network.up2date.current.devel |
|---|---|
| Message-ID | <[email protected]> |
--=-rytNYIYd7gZDLGDKnrNA
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
Nuts. I meant to include this in the annoucement.
Attached is the patch(es) that are in the tree for 1.4.3.
This includes:
1. Doc fixes/patch that Sam Bingner worked out to make current 1.4.3
work on RHL 8.0 _AS_A_SERVER_.
2. Header filename fix to deal with oddly named rpms.
3. Symlink fix where the symlink is there but the target file is gone.
This patch should be applied to a straight 1.4.2 tree. I'll forward port
this stuff to 1.5.x later - I'm busy trying to the get the CVS tree
correctly populated.
The next 1.4.x release will to fully support (or correctly support) RHL
8.0 as a client. I thought we had it, and we don't. The applet still
won't work.
--
Hunter Matthews Unix / Network Administrator
Office: BioScience 145/244 Duke Univ. Biology Department
Key: F0F88438 / FFB5 34C0 B350 99A4 BB02 9779 A5DB 8B09 F0F8 8438
Never take candy from strangers. Especially on the internet.
--=-rytNYIYd7gZDLGDKnrNA
Content-Disposition: attachment; filename=current-1.4.3.a.patch
Content-Transfer-Encoding: quoted-printable
Content-Type: text/x-patch; name=current-1.4.3.a.patch; charset=ISO-8859-1
diff -ruN --exclude SCCS --exclude BitKeeper current-1.4.2/CHANGELOG curren=
t-1.4/CHANGELOG
--- current-1.4.2/CHANGELOG Mon Oct 21 19:14:44 2002
+++ current-1.4/CHANGELOG Tue Jan 28 14:49:54 2003
@@ -1,6 +1,20 @@
Current Project Changelog
=20
-* Fri Oct 18 2002 Hunter Matthews <[email protected]>
+* Mon Jan 27 2003 Hunter Matthews <[email protected]> v1.4.3
+- Finally added the 1.0 to 1.4 transition guide to the docs directory.
+- Added some notes about the changes in RHL 8.0
+- FIX: a symlink creation bug where the symlink already exists, but the
+ file it pointed to is gone (deleted)
+- FIX: header file name bug for bugus, screwed up (IBM) rpm files, where=20
+ the rpm filename doesn't match the name,version,release,arch
+- backported some config.py changes from 1.5.x.=20
+ I forgot why. :)
+- Updated config.py, because only cadmin use the command line parsing.
+- FIX: added some extra logging to one error path.
+- Sam Bingner figured out the core problem with RHL 8.0 - mod_python bugs
+ in 3.0.0. We'll end up having to require mod_python 3.0.1
+
+* Fri Oct 18 2002 Hunter Matthews <[email protected]> v1.4.2
- Found what may be hitting people - gtk+10 in 6.2 at least had None
data in the rpm. (I claim thats a bad rpm, but whatever).
- Massive updates to the documentation based on user feedback.
@@ -21,7 +35,7 @@
built against python2, but cadmin was still using python1.
- Improved some error messages when no channels are available.
=20
-* Mon Sep 30 2002 Hunter Matthews <[email protected]> v1.4.1
+* Mon Sep 30 2002 Hunter Matthews <[email protected]> v1.4.1
- Sorry for the delay - it was a long week personally.
- Tested on server here, seems to work even for some simple error cases.
=20
@@ -43,7 +57,7 @@
there's no matching or authorized channels for a client. Probably the=20
most common symptom of perms problems.
=20
-* Fri Sep 20 2002 Hunter Matthews <[email protected]> v1.4.0
+* Fri Sep 20 2002 Hunter Matthews <[email protected]> v1.4.0
- Caught a last minute formatting problem
- bumped version to 1.4.0
- released as 1.4.0
diff -ruN --exclude SCCS --exclude BitKeeper current-1.4.2/Makefile current=
-1.4/Makefile
--- current-1.4.2/Makefile Thu Oct 17 22:26:42 2002
+++ current-1.4/Makefile Tue Jan 28 00:05:58 2003
@@ -7,7 +7,7 @@
=20
# Things that change from build to build
PROJECT =3D current
-VERSION =3D 1.4.2
+VERSION =3D 1.4.3
PYTHON_BIN =3D /usr/bin/python
PREFIX =3D /usr
INSTALL_ROOT =3D
diff -ruN --exclude SCCS --exclude BitKeeper current-1.4.2/README current-1=
.4/README
--- current-1.4.2/README Sun Oct 20 14:59:45 2002
+++ current-1.4/README Tue Jan 28 14:50:24 2003
@@ -72,4 +72,5 @@
Ivan Martinez Bug fixes
Toby D. Reeves SQL work
Barry Nathan Debugging help
+Sam Bingner Debugging help
=20
diff -ruN --exclude SCCS --exclude BitKeeper current-1.4.2/cadmin current-1=
.4/cadmin
--- current-1.4.2/cadmin Mon Oct 21 19:15:51 2002
+++ current-1.4/cadmin Tue Jan 28 00:11:48 2003
@@ -56,7 +56,9 @@
# Remember that Directory has precedence over Location
#
##
-## YOU MUST put "Include %(apache_config_file)s" in your httpd.conf file!
+## For apache 1.3.x, YOU MUST put "Include %(apache_config_file)s" in=20
+## your httpd.conf file. For apache 2.0.x, simply put the file in=20
+## the /etc/httpd/conf.d directory.
##
##########################################################################=
###
=20
@@ -77,7 +79,8 @@
=20
<Location /XMLRPC/$RHN>
PythonPath "sys.path + ['%(mod_dir)s']"
- PythonHandlerModule current_apache
+ PythonAccessHandler current_apache
+ PythonTypeHandler current_apache
</Location>
=20
## END OF CURRENT ##
@@ -115,27 +118,6 @@
config.cfg.getItem('server_id') =3D=3D 'YOUR_HOSTNAME_HERE':
sys.exit('ERROR: You must edit the config file to start')
=20
- # Look for an already running server - we need to know that, BEFORE
- # we begin logging
-# if os.path.exists(config.cfg.getItem('pid_file')):
-# try:
-# pid =3D int(open(config.cfg.getItem('pid_file')).read())
-# except ValueError:
-# sys.exit('Pidfile %s contains non numeric value' % config.cf=
g.getItem('pid_file'))
-# =20
-# try:
-# os.kill(pid, 0)
-# except OSError, why:
-# import errno
-# if why[0] =3D=3D errno.ESRCH:
-# # The pid doesnt exists.
-# print 'Removing stale pid_file %s' % config.cfg.getItem(=
'pid_file')
-# os.remove(config.cfg.getItem('pid_file'))
-# else:
-# sys.exit('Can\'t check status of PID %s from pid_file %s=
: %s' % (pid, config.cfg.getItem('pid_file'), why[1]))
-# else:
-# sys.exit('Current server is already running, PID %s' % pid)
-
## Logging system must be operational for the other modules to work.
# FIXME: tradition says this should be a dash for stdout/stderr
# How should Config know that?
diff -ruN --exclude SCCS --exclude BitKeeper current-1.4.2/current.conf cur=
rent-1.4/current.conf
--- current-1.4.2/current.conf Sun Oct 20 14:34:02 2002
+++ current-1.4/current.conf Tue Jan 28 00:16:54 2003
@@ -20,7 +20,9 @@
# log_level =3D How much should we send to the log file?
#
# apache_config_file =3D file to put apache/mod_python configuration=20
-# in. Should be included in httpd.conf
+# in. For RHL 7.x, /etc/httpd/httpd.current.conf was =
a=20
+# common value. For RHL 8.x,=20
+# /etc/httpd/conf.d/current.conf is correct.
#
# access_check_type =3D How should checkperms tell if you have your permis=
sions
# set correctly? Values are:
@@ -89,7 +91,11 @@
valid_channels =3D redhat-7.3-i386
log_file =3D /var/log/httpd/current.log =20
log_level =3D 0
-apache_config_file =3D /etc/httpd/conf/current.httpd.conf
+
+# You must pick one of the following values:
+# 7.x apache_config_file =3D /etc/httpd/conf/current.httpd.conf
+# 8.x apache_config_file =3D /etc/httpd/conf.d/current.conf
+
access_check_type =3D user
access_check_arg =3D apache
server_secret =3D YOUR_SECRET_STRING_HERE
diff -ruN --exclude SCCS --exclude BitKeeper current-1.4.2/docs/1.0-1.4_tra=
nsition_notes.txt current-1.4/docs/1.0-1.4_transition_notes.txt
--- current-1.4.2/docs/1.0-1.4_transition_notes.txt Wed Dec 31 19:00:00 196=
9
+++ current-1.4/docs/1.0-1.4_transition_notes.txt Mon Jan 27 22:35:28 2003
@@ -0,0 +1,47 @@
+Transitioning from Current 1.0.x to Current 1.4.x
+
+
+1. What do I do convert a current 1.0.x style current.pem key/cert pair
+into something that apache will understand?
+
+Nothing. Come one people, I can do better than this... :)
+
+cp /etc/current/current.pem /etc/httpd/conf/ssl.crt/server.crt
+cp /etc/current/current.pem /etc/httpd/conf/ssl.key/server.key
+
+If you got real adventurous you could then EDIT those two files with a
+plain text editor and remove the part of the file that isn't needed.
+(IE, for server.crt, you'd remove the key, and for server.key you'd
+remove the certificate)
+
+I didn't on mine, and it works perfectly. No changes on the clients.
+
+
+2. What do I do about apache/mod_ssl listening to ports 80 and 443, when
+current 1.0.x listened on 8080 and 8081?
+
+Couple things present themselves:=20
+
+A. Just change 80's to 8080's and 443's to 8081's in httpd.conf. A blind
+sed should get it right. I don't think this is the most correct answer,
+but it WILL work.
+
+B. Apache can be configured to listen to several ports, some ssl'd and
+some not. I did that, and my httpd.conf is at=20
+http://www.biology.duke.edu/computer/unix/current/httpd.conf
+which is also now linked to from the home page.
+
+Looking through that file, if you search for "deny", you'll get several
+hits of commented out sections- here's how I limit access to my
+departmental current server to just my subnets.
+
+If anyone's apache-fu is stronger than mine, I wouldn't mine knowing how
+to JUST specify those subnets in one place, instead of about 6.
+
+Running apache at the normal ports I think is the better long term
+solution, as it will let you use that apache for other things. (I'm also
+going to be doing my kickstarts from that apache, and putting up
+internal documentation).
+
+
+You do have to re-create your database... but thats it.
diff -ruN --exclude SCCS --exclude BitKeeper current-1.4.2/docs/developer_d=
ocs/rhl-8.0_server.notes current-1.4/docs/developer_docs/rhl-8.0_server.not=
es
--- current-1.4.2/docs/developer_docs/rhl-8.0_server.notes Wed Dec 31 19:00=
:00 1969
+++ current-1.4/docs/developer_docs/rhl-8.0_server.notes Sat Jan 11 21:18:1=
2 2003
@@ -0,0 +1,33 @@
+1. Apache -> httpd rename
+ Delete current.spec dependancy or wrap it in 8.x-ness
+
+2. httpd now has an /etc/httpd/conf.d dir
+ Tailor made for us to slip a current.conf file into.
+ Installation is now easier.
+
+3. mod_ssl configured in /etc/httpd/conf.d/ssl.conf file
+ has "ServerName new.host:443" which must be replaced with the=20
+ real ssl'd server name.
+
+Typical error message is as follows:
+
+[Sat Jan 11 19:01:24 2003] [warn] RSA server certificate CommonName (CN)
+`dangermouse.biology.duke.edu' does NOT match server name!?
+
+4. /var/log/httpd is now writable only by root, as is the "parent" httpd
+ process. HOWEVER, the actual children are owned by "apache". So=20
+ as a temporary measure, I moved the log file up one dir to /var/log.
+
+5. Rpm breakage. (he did upgrade from 4.0 to 4.1)=20
+ rpm.headerFromPackage() is now rpm.ts.hdrFromFdno()
+
+6. Go back to 6 for final 1.5 solution, but installing rpm404-python and=20
+ librpm404 should be a good temporary fix for 1.4
+
+7. Something in 6.2 packages is causing xmlrpclib to choke on the=20
+ getObsoletes file. Ditched 6.2 for now.
+
+8. Error from the mime_magic_file. Disabled by commenting out in=20
+ httpd.conf. Fix / work around later.
+
+ =20
diff -ruN --exclude SCCS --exclude BitKeeper current-1.4.2/src/channel.py c=
urrent-1.4/src/channel.py
--- current-1.4.2/src/channel.py Fri Oct 18 21:01:31 2002
+++ current-1.4/src/channel.py Mon Jan 27 23:39:13 2003
@@ -846,12 +846,16 @@
# Add the symlink for the GET requests
linkname =3D misc.PathJoin(self.chanInfo['package_dir'],
os.path.basename(pathname))
- if not os.path.exists(linkname):
+ # FIX: symlink may remain, but the file is gone.
+ if not os.path.islink(linkname):
os.symlink(pathname, linkname)
=20
# Cache the header itself for getPackageHeader() call
# compressed, not compressed, compressed, not compressed
- hdr_name =3D string.replace(file, '.rpm', '.hdr')
+
+ # FIX: some rpms have bogus filenames
+ hdr_name =3D "%s-%s-%s.%s.hdr" % tuple(nvreas_list)
+
filename =3D misc.PathJoin(self.chanInfo['headers_dir'], hdr_name)
h_file =3D open(filename, 'w')
h_file.write(hdr.unload())
diff -ruN --exclude SCCS --exclude BitKeeper current-1.4.2/src/config.py cu=
rrent-1.4/src/config.py
--- current-1.4.2/src/config.py Mon Oct 21 19:15:51 2002
+++ current-1.4/src/config.py Sun Dec 1 22:32:40 2002
@@ -16,7 +16,7 @@
cfg =3D None
=20
## These are replaced by make, so beware
-VERSION=3D"1.4.2"
+VERSION=3D"0.20021201"
MODULES_DIR=3D"/usr/share/current"
CONFIG_DIR=3D"/etc/current"
LOG_DIR=3D"/var/log/httpd"
@@ -35,9 +35,9 @@
"apache_config_file": "/etc/httpd/conf/current.httpd.conf",
"log_file": LOG_DIR + "/current.log",
"log_level": 0,
- "dump": 0,
}
=20
+
# Configuration Exceptions
class Error(exceptions.Exception):
pass
@@ -99,7 +99,18 @@
=20
del self._defaults
=20
- =20
+
+ def __getitem__(self, item):
+ """ We support config[key] type access."""
+ # Backported from 1.5
+ return self._data.get(item, "")
+
+
+ def __str__(self):
+ # Backported from 1.5
+ return str(self._data)
+
+=20
def getItem(self, item):
# deliberately fail - we should get asked if we don't know -=20
# the defaults should cover that sort of thing.
@@ -123,13 +134,10 @@
"""
=20
## FIXME: this should be outside the base class somewhere =20
- usage =3D """Usage: current [options]
+ usage =3D """Usage: cadmin [options]
-c, --config config file to use=20
-d, --dump dump final configuration and exit
-h, --help print this help and exit
- -k, --kill kill a running daemon
- -l, --logfile log file to use
- -n, --nodaemon do not run as a daemon
-v, --verbose increase level of logging (can use more than once)
-V, --version print version and exit"""
=20
@@ -137,9 +145,8 @@
tmp =3D {}
=20
try:
- opts, args =3D getopt.getopt(argv[1:], "c:dhkl:nvV",=20
- ("config=3D", "dump", "help", "kill", "logfile=3D=
",=20
- "nodaemon", "verbose", "version"))
+ opts, args =3D getopt.getopt(argv[1:], "c:dhvV",=20
+ ("config=3D", "dump", "help", "verbose", "version=
"))
=20
except getopt.error, msg:
sys.stdout =3D sys.stderr
@@ -157,16 +164,10 @@
tmp["dump"] =3D 1
if o in ("-h", "--help"):
usage_requested =3D 1
- if o in ("-k", "--kill"):
- tmp["kill"] =3D 1
- if o in ("-l", "--logfile"):
- tmp["log_file"] =3D a
- if o in ("-n", "--nodaemon"):
- tmp["nodaemon"] =3D 1
if o in ("-v", "--verbose"):=20
tmp["log_level"] =3D tmp.get('log_level', 0) + 1
if o in ("-V", "--version"):
- print "current v%s (C) 2001 Hunter Matthews" % \
+ print "cadmin v%s (C) 2001,2002 Hunter Matthews" % \
self._defaults["version"]
print "Released under the GPL"
sys.exit(0)
diff -ruN --exclude SCCS --exclude BitKeeper current-1.4.2/src/current_apac=
he.py current-1.4/src/current_apache.py
--- current-1.4.2/src/current_apache.py Sun Oct 6 14:23:59 2002
+++ current-1.4/src/current_apache.py Thu Oct 31 11:53:31 2002
@@ -190,6 +190,9 @@
# Fixme: need to pass req object here?
result =3D callAPIMethod(method, params)
except:
+ apacheLog('Exception at callAPIMethod()', 'NOTICE')
+ apacheLog('method was %s' % method, 'NOTICE')
+ apacheLog('params were %s' % pprint.pformat(params), 'NOTICE')
logException()
return apache.HTTP_BAD_REQUEST
=20
diff -ruN --exclude SCCS --exclude BitKeeper current-1.4.2/src/symlink.patc=
h current-1.4/src/symlink.patch
--- current-1.4.2/src/symlink.patch Wed Dec 31 19:00:00 1969
+++ current-1.4/src/symlink.patch Mon Jan 27 22:42:14 2003
@@ -0,0 +1,11 @@
+--- channel.py Fri Jan 17 16:23:08 2003
++++ channel.py.symlink.patch Fri Jan 17 16:22:34 2003
+@@ -846,7 +846,7 @@
+ # Add the symlink for the GET requests
+ linkname =3D misc.PathJoin(self.chanInfo['package_dir'],
+ os.path.basename(pathname))
+- if not os.path.exists(linkname):
++ if not os.path.islink(linkname):
+ os.symlink(pathname, linkname)
+=20
+ # Cache the header itself for getPackageHeader() call
diff -ruN --exclude SCCS --exclude BitKeeper current-1.4.2/support/current.=
spec current-1.4/support/current.spec
--- current-1.4.2/support/current.spec Mon Oct 21 19:15:51 2002
+++ current-1.4/support/current.spec Tue Jan 28 00:18:24 2003
@@ -1,12 +1,14 @@
Summary: A server for Red Hat's up2date tools.
Name: current
-Version: 1.4.2
+Version: 0.20021201
Release: 1
License: GPL
Group: System Environment/Daemons
URL: http://www.biology.duke.edu/computer/unix/current
Source0: ftp://ftp.biology.duke.edu/pub/admin/current/%{name}-%{version}.t=
ar.gz
-Requires: python python-xmlrpc rpm-python apache mod_python mod_ssl=20
+Requires: python python-xmlrpc rpm-python mod_ssl=20
+# Need to put the build crap in here from spec.notes
+Requires: mod_python >=3D 3.0.1=20
Requires: rpm >=3D 4.0.2-8
BuildRequires: docbook-style-xsl docbook-style-dsssl docbook-dtds
BuildRequires: docbook-utils docbook-utils-pdf
@@ -61,6 +63,10 @@
=20
=20
%changelog
+* Sat Jan 11 2003 Hunter Matthews <[email protected]>
+- Removed 'apache' dependancy - called httpd in 8.x
+ We need mod_ssl and mod_python really, so its not crucial.
+
* Sun Aug 18 2002 Hunter Matthews <[email protected]>
- Took out current (old standalone server)
- Took out init.d for stunnel and current
--=-rytNYIYd7gZDLGDKnrNA--