Hi
I've added back the install-discuss as they might also like to comment
more on what I am adding here:
The postinstall script you gave is not alternate root aware.
Basically if I install this on a system with running zones, it will
probably do as you intended. ( note any halted zones will probably give
you trouble as well )
But once I start to create a new zone, this just will not work at all.
for example in postinstall we have:
9 if [ -f "/opt/sfw/bin/sudo" ]; then
10 SUDOBIN="/opt/sfw/bin/sudo"
on zone install basically we end up running pkgadd -R <zone-path/root>
for this package but the lines above will reference the global zones
"/opt/sfw/bin/sudo"
Not the one in the non-global zone.
The correct way to do this is
$PKG_INSTALL_ROOT/opt/sfw/bin/sudo
as $PKG_INSTALL_ROOT will be set to the root of your zone in the case of
a zone install.
Further down we have
27 echo "$minutes * * * * /export/home/audit4u/script/cron1.sh 2>>
/export/home/audit4u/OUTDIR/cron.log 1>>
/export/home/audit4u/OUTDIR/cron.log" > /tmp/cron.audit4u
Again this will access /export/home/audit4u/OUTDIR/cron.log in the
global zone
Best to have $BASEDIR/OUTDIR/cron.log
as $BASEDIR will be set to
<root of non global zone>/export/home/audit4u in the case of installing
a non global zone with the BASEDIR in your pkginfo.
At the end of this script we have
mkdir -p /export/home/audit4u/JOB
mkdir -p /export/home/audit4u/INCOMING
mkdir -p /export/home/audit4u/OUTDIR
mkdir -p /export/home/audit4u/logs
chown audit4u /export/home/audit4u/JOB /export/home/audit4u/INCOMING
/export/home/audit4u/OUTDIR /export/home/audit4u/logs
chgrp audit4u /export/home/audit4u/JOB /export/home/audit4u/INCOMING
/export/home/audit4u/OUTDIR /export/home/audit4u/logs
But the pkgmap already has
1 d none INCOMING 0755 audit4u audit4u
1 d none JOB 0755 audit4u audit4u
1 d none OUTDIR 0755 audit4u audit4u
so these 3 will get created and set to 755 with audit4u as owner, the
logs dir is not in pkgmap at all.
Probably best to remove all this from postinstall and add logs to pkgmap
as well, the pkgmap attributes for the 3 dir's will get overwritten by
root I believe?
To be honest this package looks slightly over complex to me, it depends
on objects in /opt and /export/home and also /etc.
The correct way of doing processing in /etc and say /export/home would
be to have both a root and usr package, the root package to handle /etc
and the usr to handle the rest. That way if say /export/home was mounted
into the local zone, the /etc/ processing woudl still get handled by the
root package ( /etc cannot be shared ). This is because of /export/home
was shared the postinstall would never run, and therefore the /etc/
processing you do would never get done.
I also note the postinstall dependency on /etc/sfw/sudoers, so is the
sfw stuff installed in both global and non-global ones as well, if not
this might lead to some issues for your package I guess.
I have not installed the package yet to verify the postinstall is copied
to the correct area in /var/sadm/pkg, I suspect it will, but as the
psotinstall will only ever modify the global zone in the case of a zone
install, it's most likely the root of all your problems.
Enda
mheimel at web.de wrote:
> Hi Enda,
>
> we have no lofs mounts. the package is attached.
>
> best regards
> mario
>
>
> -----Urspr?ngliche Nachricht-----
> Von: "Enda O'Connor ( Sun Micro Systems Ireland)" <Enda.Oconnor at Sun.COM>
> Gesendet: 13.08.07 12:16:39
> An: mario heimel <mheimel at web.de>
> CC: install-discuss at opensolaris.org
> Betreff: Re: [install-discuss] problem with pkg deployment and zones
>
>
> mario heimel wrote:
>> default sparse-zone with inherhited /usr /lib /platform /sbin and a
>> whole-root zone are also affected.
>> the package was installed successfully but the install scripts do not run.
>>
>> pkginfo
>> BASEDIR=/export/home/audit4u
>>
>> cat pkgmap
>> : 1 3552
>> 1 d none INCOMING 0755 audit4u audit4u
>> 1 d none JOB 0755 audit4u audit4u
>> 1 d none OUTDIR 0755 audit4u audit4u
>> 1 f none PkgAdmin 0600 root root 15 1440 1175256959
>> 1 d none bin 0755 audit4u audit4u
>> 1 f none bin/curl 0755 audit4u audit4u 1766144 14436 1174310874
>> 1 i pkginfo 174 14287 1181650097
>> 1 i postinstall 3327 62050 1180530851
>> 1 i postremove 1152 20491 1181650046
>> 1 i preinstall 362 30218 1174396864
>> 1 d none script 0755 audit4u audit4u
>> 1 f none script/cron1.sh 0755 audit4u audit4u 12043 32774 1180530200
>> 1 f none script/cron2.sh 0755 audit4u audit4u 8051 23486 1180530253
>> 1 f none script/determine_os.sh 0755 audit4u audit4u 6090 27239 1180529833
>>
>>
>> This message posted from opensolaris.org
>> _______________________________________________
>> install-discuss mailing list
>> install-discuss at opensolaris.org
>> http://mail.opensolaris.org/mailman/listinfo/install-discuss
>
> Hi Mario
> Sorry for the late reply, could I get access to this package as I'm not
> seeing anything here that stands out, assuming /export/home is not
> mounted lofs from global.
>
>
> Enda
>
>
>
>
>
>
> _____________________________________________________________________
> Der WEB.DE SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
> http://smartsurfer.web.de/?mc=100071&distributionid=000000000066