472,127 Members | 1,723 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,127 software developers and data experts.

How to execute commands in internal zones of solaris using pythonrunning from the global zone ?

How to execute commands in internal zones of solaris using python
running from the global zone ?

i tried --
1os.popen("zlogin <zone1>")
2os.popen("zonename")

the 2nd command executes back into the global zone and not into the
internal zone
can anyone help?
Hishaam
Aug 11 '08 #1
1 1869
You might try subprocess, first of all. Use it to launch zlogin and
then treat it like a shell and write 'zonename\n' to its stdin, to
simulate running it as a user. This is a good bet, but I don't have
either available to try it. The subprocess documentation covers
invoking a process and writing to its input.

What you are doing now doesn't work, because you just invoke the two
processes and dont do anything with either of them. zlogin may not
have even completely initialized when you start the second command.
The technique you need is to start zlogin and then tell it to run the
next.

On Mon, Aug 11, 2008 at 6:39 AM, Hishaam <hi********@gmail.comwrote:
How to execute commands in internal zones of solaris using python
running from the global zone ?

i tried --
1os.popen("zlogin <zone1>")
2os.popen("zonename")

the 2nd command executes back into the global zone and not into the
internal zone
can anyone help?
Hishaam
--
http://mail.python.org/mailman/listinfo/python-list


--
Read my blog! I depend on your acceptance of my opinion! I am interesting!
http://ironfroggy-code.blogspot.com/
Aug 11 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Brian | last post: by
3 posts views Thread by connieharper | last post: by
6 posts views Thread by David Graham | last post: by
11 posts views Thread by lduperval | last post: by
14 posts views Thread by Cesar Ronchese | last post: by
8 posts views Thread by Nathan Sokalski | last post: by
reply views Thread by dot.yet | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.