In the wake of the /var/run/pcp issue last week, I started looking at
the broader issue of setting uids, gids and permissions for the
artifacts in the PCP packages.
In short it is a mess, as a result of organic evolution and no
underlying policy that provides coherence within the one package, much
less across the package types and platforms.
By way of an example, we start with makefile rules like this
$(INSTALL) -m 664 -g $(PCP_GROUP) control $(PCP_PMIECONTROL_PATH)
note the mode is "unusual" and the gid is "non-default". I've quickly
looked at a couple of other files, and while the detailed story varies
slightly from file to file, the overall message of a mess is consistent!
For the RPM packages the group gets lost but the mode is correct.
$ ls -l /etc/pcp/pmie/control
-rw-rw-r-- 1 root root 1729 Jul 21 09:23 /etc/pcp/pmie/control
For the deb packages the group and mode are lost
$ ls -l /etc/pcp/pmie/control
-rw-r--r-- 1 root root 1729 Jul 19 22:13 /etc/pcp/pmie/control
For mac, the dmg package gets it right!!!
$ ls -l /etc/pcp/pmie/control
-rw-rw-r-- 1 root pcp 1729 Jul 21 20:13 /etc/pcp/pmie/control
For the tarball packages, mode ok, uid and gid wrong who knows ...
$ tar tvf /Users/kenj/src/pcp/build/tar/pcp-3.8.2-1.tar.gz | grep
pmie/control
-rw-rw-r-- 0 kenj wheel 1729 Jul 21 20:12 etc/pcp/pmie/control
We seem to use some combination of ...
1. makefile install lines
2. generic package rewriting rules
3. cherry picked rewriting cases
4. post-install scripts to "fix" things up
5. run time actions to fix things in the Irish mode (to be sure, to be
sure)
I think we should start with the proposition that the makefiles should
be source of truth, 2. may be needed. 3. is to be avoided. 4. should
not be needed. 5. is the ultimate evil.
Let's start discussing the policy and fix that before people race off
trying to change things to address the issues I've raised in this example.
|