Another neat thing about the lx branded zone is the possibility to use 
powerful Solaris features like Dtrace from the global zone.

In this case another cool way to work around the need to find a "swap" 
file under /proc would be to replace the name given to the open call 
from the branded process by another name.

For example, we could replace the string /proc/swap with /tmp/swap.

* put the content you want to see in /tmp/swap (in your lx zone)

* in the global zone (with the appropriate privileges, or as root) run:

dtrace -wn  'syscall::open:entry /zonename == "lx" && copyinstr(arg0) == 
"/proc/swap"/ {copyoutstr("/tmp/swap", arg0, sizeof(copyinstr(arg0)));}'

        "lx" is the name of my branded zone.


* in your lx zone typing 'cat /proc/swap', while the above command is 
running in the glocal zone, will give you what you want.

  (of course something like "cd /proc; cat swap" would not be caught by 
the dtrace script).


HTH,
William.


On 06/30/08 19:00, Edward Pilatowicz wrote:
> procfs is a pseudo filesystem that doesn't allow you to create random
> files.  the only way you could do this is by modifying the procfs
> filesystem code, which resides in:
>       usr/src/uts/common/brand/lx/procfs
> 
> another option to work around this problem would be to create a
> pre-load library that interposes on the open() system call.  then
> this library could fake up an open of /proc/swaps.
> 
> ed
> 
> On Mon, Jun 30, 2008 at 08:56:23AM -0700, Andrew Watkins wrote:
>> I have been using Solaris 10 5/08 and Oracle 11g. By the looks of it the 
>> install process needs /proc/swaps to exist, but swap does not exist under 
>> the brandz zones (I believe). 
>>
>> It looks like a oracle bug, since it crashes if it can't find this file.
>>
>> Just checked oracle support site and it does look like it requires the file, 
>> since it checks the size of swap by doing a "cat /proc/swaps". All I need to 
>> do is create any old  text file or ln there at it will work, does any one 
>> know how I can create a file in the "/proc" directory.
>>
>> Thanks
>>
>> Andrew
>>  
>>  
>> This message posted from opensolaris.org
>> _______________________________________________
>> brandz-discuss mailing list
>> brandz-discuss at opensolaris.org
> _______________________________________________
> brandz-discuss mailing list
> brandz-discuss at opensolaris.org
> 

Reply via email to