git://git.onelab.eu
/
lxc-userspace.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
9e9a80a
)
rename options into ags as we use ArgumentParser and not OtionParser any more
author
Thierry Parmentelat
<thierry.parmentelat@inria.fr>
Sun, 23 Jun 2013 06:22:44 +0000
(08:22 +0200)
committer
Thierry Parmentelat
<thierry.parmentelat@inria.fr>
Sun, 23 Jun 2013 06:22:44 +0000
(08:22 +0200)
lxcsu-internal
patch
|
blob
|
history
diff --git
a/lxcsu-internal
b/lxcsu-internal
index
782ae67
..
184b68f
100755
(executable)
--- a/
lxcsu-internal
+++ b/
lxcsu-internal
@@
-47,10
+47,10
@@
def main ():
parser.add_argument ("slice_name")
parser.add_argument ("command_to_run",nargs="*")
parser.add_argument ("slice_name")
parser.add_argument ("command_to_run",nargs="*")
-
option
s = parser.parse_args()
- slice_name=
option
s.slice_name
+
arg
s = parser.parse_args()
+ slice_name=
arg
s.slice_name
# support for either setting debug at the top of this file, or on the command-line
# support for either setting debug at the top of this file, or on the command-line
- if
option
s.debug:
+ if
arg
s.debug:
global debug
debug=True
global debug
debug=True
@@
-143,13
+143,13
@@
def main ():
setns.chcontext('/proc/%s/ns/uts'%pid)
setns.chcontext('/proc/%s/ns/ipc'%pid)
setns.chcontext('/proc/%s/ns/uts'%pid)
setns.chcontext('/proc/%s/ns/ipc'%pid)
- if (not
option
s.netns):
+ if (not
arg
s.netns):
setns.chcontext('/proc/%s/ns/net'%pid)
setns.chcontext('/proc/%s/ns/net'%pid)
- if (not
option
s.mntns):
+ if (not
arg
s.mntns):
setns.chcontext('/proc/%s/ns/mnt'%pid)
setns.chcontext('/proc/%s/ns/mnt'%pid)
- if (not
option
s.pidns):
+ if (not
arg
s.pidns):
setns.chcontext('/proc/%s/ns/pid'%pid)
if (not os.access('/proc/self',0)):
setns.chcontext('/proc/%s/ns/pid'%pid)
if (not os.access('/proc/self',0)):
@@
-174,11
+174,11
@@
def main ():
if (pid == 0):
cap_arg = '--drop='+drop_capabilities
if (pid == 0):
cap_arg = '--drop='+drop_capabilities
- if (not
option
s.root):
- exec_args = [arch,'/usr/sbin/capsh',cap_arg,'--','--login']+
option
s.command_to_run
-# Thierry's suggestion:exec_args = [arch,'/usr/sbin/capsh',cap_arg,'--user=%s'%slice_name,'--','--login',]+
option
s.command_to_run
+ if (not
arg
s.root):
+ exec_args = [arch,'/usr/sbin/capsh',cap_arg,'--','--login']+
arg
s.command_to_run
+# Thierry's suggestion:exec_args = [arch,'/usr/sbin/capsh',cap_arg,'--user=%s'%slice_name,'--','--login',]+
arg
s.command_to_run
else:
else:
- exec_args = [arch,'/usr/sbin/capsh','--','--login']+
option
s.command_to_run
+ exec_args = [arch,'/usr/sbin/capsh','--','--login']+
arg
s.command_to_run
os.environ['SHELL'] = '/bin/sh'
# Thierry's suggestion:os.environ['HOME'] = '/home/%s'%slice_name
os.environ['SHELL'] = '/bin/sh'
# Thierry's suggestion:os.environ['HOME'] = '/home/%s'%slice_name