On Thu, Jun 25, 2015 at 06:48:26PM -0400, Nathan Scott wrote:
> Hi Jeff,
...
> Did you need any other build changes? Also, would you be able to add an
> Illumos buildbot into Lukas' set?
>
> http://buildbot.pcp.io/
> http://pcp.io/buildbot.html
>
> ... would help us keep it up to date & automatically produce & test packages.
Ok, so I started working on setting up a host. Since I have zones at my
disposal, I decided to use a zone instead of a full-blown VM. configure
didn't like it :)
The problem is that configure tries to figure out how to get ps(1) to output
all processes poorly. There are a few issues here.
(a) it looks at the output from various invocations of ps(1), and assumes that
there must be *some* init process, and it *must* be pid 1. This breaks
down if you are running inside of zones where there is init, but it is
*not* pid 1. (pid 1 is init for the global zone. The non-global zone
gets its own init which whatever pid is available.)
For example, here's the output on a pretty minimal zone running OmniOS:
$ ps -ef
UID PID PPID C STIME TTY TIME CMD
root 17098 17097 0 14:12:05 pts/7 0:00 -bash
root 16875 15953 0 14:09:55 ? 0:00
/usr/lib/autofs/automountd
root 16078 15953 0 14:09:20 ? 0:00 /sbin/init
root 16881 16871 0 14:09:55 ? 0:00 /usr/lib/saf/ttymon
root 16636 15953 0 14:09:42 ? 0:00 /usr/lib/pfexecd
root 17097 15953 0 14:12:05 pts/7 0:00 /usr/bin/login -z
global -f root
netcfg 16207 15953 0 14:09:39 ? 0:00 /lib/inet/netcfgd
root 16141 15953 0 14:09:20 ? 0:01 /lib/svc/bin/svc.startd
root 16847 15953 0 14:09:55 ? 0:00 /usr/lib/inet/in.ndpd
root 16991 15953 0 14:09:57 ? 0:00 /usr/lib/ssh/sshd
root 16954 15953 0 14:09:57 ? 0:00 /usr/lib/inet/inetd
start
daemon 16833 15953 0 14:09:55 ? 0:00 /usr/sbin/rpcbind
root 16143 15953 0 14:09:20 ? 0:17 /lib/svc/bin/svc.configd
netadm 16213 15953 0 14:09:39 ? 0:00 /lib/inet/ipmgmtd
root 16999 16998 0 14:10:43 pts/10 0:00 -bash
root 16197 15953 0 14:09:38 ? 0:00 /sbin/sh
/lib/svc/method/svc-dlmgmtd
root 15953 15953 0 14:09:20 ? 0:00 zsched
root 16871 16141 0 14:09:55 ? 0:00 /usr/lib/saf/sac -t 300
root 16860 15953 0 14:09:55 ? 0:00 /usr/lib/utmpd
root 16862 15953 0 14:09:55 ? 0:00 /usr/lib/fm/fmd/fmd
root 16998 15953 0 14:10:43 pts/10 0:00 /usr/bin/login -z
global -f root
root 16869 15953 0 14:09:55 ? 0:00 /usr/sbin/cron
builder 17309 17098 0 14:19:05 pts/7 0:00 -bash
root 16877 16875 0 14:09:55 ? 0:00
/usr/lib/autofs/automountd
root 16883 16141 0 14:09:55 console 0:00 /usr/lib/saf/ttymon -g
-d /dev/console -l console -m ldterm,ttcompat -h -p pcpb
root 16936 15953 0 14:09:56 ? 0:00 /usr/sbin/syslogd
root 17007 15953 0 14:10:43 ? 0:00 /usr/sbin/nscd
builder 11887 17309 0 14:48:38 pts/7 0:00 ps -ef
builder 9113 16999 0 14:44:59 pts/10 0:00 -bash
Note that init is /sbin/init and has pid 16078. If I were to reboot the
zone, init would likely get a different pid.
FWIW, it also looks like the headings and values are right justified for a
number of the fields. This isn't a problem, but caveat emptor.
(b) The whole idea of requiring a way to list all processes is kinda flawed.
The privilege model in illumos and solaris lets you remove the process's
ability to see other user's processes. E.g., on the same system running
the same processes as before:
$ ppriv $$
9113: -bash
flags = <none>
E: basic
I: basic
P: basic
...
$ ppriv -e -s 'A=basic,!proc_info' ps -ef
UID PID PPID C STIME TTY TIME CMD
builder 17309 17098 0 14:19:05 pts/7 0:00 -bash
builder 11891 9113 0 14:56:07 pts/10 0:00 ps -ef
builder 9113 16999 0 14:44:59 pts/10 0:00 -bash
There is *nothing* the process can do because it doesn't have the
privilege. This is a bit extreme, but I can totally see sysadmins
removing this privilege from users on a big time-sharing system. Since,
as far as I know, pcp doesn't actually require privileged access (having
it will just present more metrics), this check seems very misguided.
In order to proceed further, I made a quick hack to configure.ac. Apologies
for the terrible mangling due to copy & paste out of a terminal:
diff --git a/configure.ac b/configure.ac
index a8490f8..3e654e8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1188,6 +1188,7 @@ NR == 1 { if ($1 != "UID" && $1 !=
"USER") exit
if ($2 != "PID") exit
}
# Unix variants
+/ \/sbin\/init/ { print "OK"; exit }
$2 == 1 && / init/ { print "OK"; exit }
$2 == 1 && / \/etc\/init/ { print "OK"; exit }
$2 == 1 && / \/usr\/sbin\/init/ { print "OK"; exit }
Anyway, with this and the libzfs related change in my previous email pcp
compiles and runs. Now I'm off to figure out how to run pcpqa - I never
actually ran it before and it looks a bit daunting.
Jeff.
|