vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hello, I am writing a shell script to check installation pre-requisites. Currently that shell script is able to get all important information (hostname, memsize, /tmp free and stuff) but I am not able to tell, if the script is executed unter WPAR or if there are WPAR available in the system. Best I can do is to list /wpars/*. In a WPAR you have a symlink to / and outside you have a list if System Type WPARs. But this is not a complete list (and it requres root also). So has anybody an idea for a lswpar replacement which does not need root. And alternatively one that is able to get the characteristics of the Current WPAR. Greetings Bernd |
| |||
| bernd.eckenfels@googlemail.com wrote: > Hello, > > I am writing a shell script to check installation pre-requisites. > Currently that shell script is able to get all important information > (hostname, memsize, /tmp free and stuff) but I am not able to tell, if > the script is executed unter WPAR or if there are WPAR available in > the system. > > Best I can do is to list /wpars/*. In a WPAR you have a symlink to / > and outside you have a list if System Type WPARs. But this is not a > complete list (and it requres root also). > > So has anybody an idea for a lswpar replacement which does not need > root. And alternatively one that is able to get the characteristics of > the Current WPAR. > > Greetings > Bernd > Only a partial answer, but: 'uname -W' will tell you whether you are running in a WPAR or in the global (base) system. uname -W is 0 if in the global uname -W is non-zero if in a WPAR Paul Landay |
| |||
| On Nov 8, 1:35 pm, Paul Landay <lan...@attglobal.net> wrote: > 'uname -W' will tell you whether you are running > in a WPAR or in the global (base) system. > uname -W is 0 if in the global > uname -W is non-zero if in a WPAR Thank you Paul, that is actually helpfull. Just a side note: I did checked uname - but I was looking for WPAR, and the comment reads: # -W # Displays the static workload partition identification number. If # the uname command runs in the Global environment, a value of zero # is displayed. I still find it strange that root in a WPAR cannot see its own WPAR params (without additional ACLs or privs). Gruss Bernd |
| ||||
| bernd.eckenfels@googlemail.com wrote: > On Nov 8, 1:35 pm, Paul Landay <lan...@attglobal.net> wrote: > >> 'uname -W' will tell you whether you are running >> in a WPAR or in the global (base) system. >> uname -W is 0 if in the global >> uname -W is non-zero if in a WPAR > > > Thank you Paul, that is actually helpfull. > > Just a side note: I did checked uname - but I was looking for WPAR, > and the comment reads: > > # -W > # Displays the static workload partition identification > number. If > # the uname command runs in the Global environment, a value > of zero > # is displayed. > > Gruss > Bernd > Looks like you could also write a small program using /usr/include/sys/wpar.h and make it setuid-root. The AIX 6.1 pubs are online at: http://publib.boulder.ibm.com/infoce...v6r1/index.jsp Search there for 'wpar.h', which will then lead to this: http://publib.boulder.ibm.com/infoce...r_get_info.htm I haven't actually tried using lpar_get_info() but it looks promising. Another suggestion: Doing a 'truss lswpar' showed that it was looking at the /etc/corrals/index file. From what I can see: - if /etc/corrals/index exists and 'uname -W' = 0 then you are on the global and there are wpars defined and you can open up /etc/corrals/index to see the wpar names. - if /etc/corrals/index does not exist and 'uname -W' = 0 then you are on the global and there are no wpars defined. - if /etc/corrals/index does not exist and 'uname -W' != 0 then you are running within a wpar. Paul Landay |