469,578 Members | 1,888 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,578 developers. It's quick & easy.

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 1819
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 suresh191 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.