File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed
Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -188,7 +188,7 @@ function _setup_jailkit_chroot()
188188 $ tpl ->setVar ('home_dir ' ,$ this ->_get_home_dir ("" ));
189189
190190 $ bashrc = escapeshellcmd ($ this ->data ['new ' ]['dir ' ]).'/etc/bash.bashrc ' ;
191- exec ('rm ' .$ bashrc );
191+ if (@ is_file ( $ bashrc )) exec ('rm ' .$ bashrc );
192192
193193 file_put_contents ($ bashrc ,$ tpl ->grab ());
194194 unset($ tpl );
@@ -201,7 +201,7 @@ function _setup_jailkit_chroot()
201201 $ tpl ->setVar ('domain ' ,$ web ['domain ' ]);
202202
203203 $ motd = escapeshellcmd ($ this ->data ['new ' ]['dir ' ]).'/var/run/motd ' ;
204- exec ('rm ' .$ motd );
204+ if (@ is_file ( $ motd )) exec ('rm ' .$ motd );
205205
206206 file_put_contents ($ motd ,$ tpl ->grab ());
207207
Original file line number Diff line number Diff line change @@ -24,12 +24,20 @@ chown root:root $CHROOT_HOMEDIR
2424jk_init -f -k -j $CHROOT_HOMEDIR $CHROOT_APP_SECTIONS
2525
2626# # Create the temp directory
27- mkdir $CHROOT_HOMEDIR /tmp
27+ if [ ! -d " $CHROOT_HOMEDIR /tmp" ]
28+ then
29+ mkdir $CHROOT_HOMEDIR /tmp
30+ fi
2831chmod a+rwx $CHROOT_HOMEDIR /tmp
2932
3033
3134# mysql needs the socket in the chrooted environment
3235mkdir $CHROOT_HOMEDIR /var
3336mkdir $CHROOT_HOMEDIR /var/run
3437mkdir $CHROOT_HOMEDIR /var/run/mysqld
35- ln /var/run/mysqld/mysqld.sock $CHROOT_HOMEDIR /var/run/mysqld/mysqld.sock
38+
39+ # ln /var/run/mysqld/mysqld.sock $CHROOT_HOMEDIR/var/run/mysqld/mysqld.sock
40+ if [ -e " /var/run/mysqld/mysqld.sock" ]
41+ then
42+ ln /var/run/mysqld/mysqld.sock $CHROOT_HOMEDIR /var/run/mysqld/mysqld.sock
43+ fi
You can’t perform that action at this time.
0 commit comments