Wed 11 Aug 2010 09:26:36 AM UTC, original submission:
running jk_init at the first time throws below exception:
$ sudo jk_init -j /home/testjail2 jk_lsh -f
ERROR: cannot lstat() /home/testjail2
/home
Creating jail /home/testjail2
Traceback (most recent call last):
File "/usr/local/sbin/jk_init", line 246, in <module>
main()
File "/usr/local/sbin/jk_init", line 243, in main
activateConfig(config, jail, args)
File "/usr/local/sbin/jk_init", line 163, in activateConfig
ji.handle_cfg_section(config,jail,cfg,section)
File "/usr/local/sbin/jk_init", line 98, in handle_cfg_section
self.handle_cfg_section(config,chroot,cfg,tmp)
File "/usr/local/sbin/jk_init", line 133, in handle_cfg_section
jk_lib.init_passwd_and_group(chroot,users,groups,config['verbose'])
File "/usr/local/share/jailkit/jk_lib.py", line 738, in init_passwd_and_group
create_parent_path(chroot,'/etc/', be_verbose, copy_permissions=0, allow_suid=0, copy_ownership=0)
File "/usr/local/share/jailkit/jk_lib.py", line 445, in create_parent_path
os.mkdir(jailpath, 0755)
OSError: [Errno 17] File exists: '/home/testjail2/etc/'
running it a second time, it works as expected.
Appended patch fixes the problem for me. However, I'm not perfectly sure whether this is the right way to fix it.
I ran into the same problem on SLES 11 and OpenBSD.
patch is against jailkit-2.11
|