Python script opening a bash prompt terminating the script -
i want write chroot wrapper in python. script copying files, setting other stuff , executing chroot , should land me in chroot shell.
the tricky part want no python processes running after in chroot.
in other words, python should setup work, call chroot , terminate itself, leaving me in chroot shell. when exit chroot, should in directory when invoked python script.
is possible?
my first thought use 1 of os.exec*
functions. these replace python process chroot
process (or whatever decide run exec*
).
# ... setup work os.execl('/bin/chroot', '/bin/chroot', directory_name, shell_path)
(or that)
Comments
Post a Comment