Till Brehm
2014-07-27 3fb802e577d71b66b9aec5593b687bcd4859581e
Fixed: FS#3509 - Apache log directory not unmounted when moving site
2 files modified
10 ■■■■■ changed files
server/plugins-available/apache2_plugin.inc.php 5 ●●●●● patch | view | raw | blame | history
server/plugins-available/nginx_plugin.inc.php 5 ●●●●● patch | view | raw | blame | history
server/plugins-available/apache2_plugin.inc.php
@@ -462,6 +462,9 @@
                    $app->log('Renaming existing directory in new docroot location. mv '.$data['new']['document_root'].' '.$data['new']['document_root'].'_bak_'.date('Y_m_d_H_i_s'), LOGLEVEL_DEBUG);
                }
                //* Unmount the old log directory bfore we move the log dir
                exec('umount '.escapeshellcmd($old_dir.'/log'));
                //* Create new base directory, if it does not exist yet
                if(!is_dir($new_dir)) $app->system->mkdirpath($new_dir);
                $app->system->web_folder_protection($data['old']['document_root'], false);
@@ -493,6 +496,8 @@
            $fstab_line = '/var/log/ispconfig/httpd/'.$data['new']['domain'].' '.$data['new']['document_root'].'/'.$log_folder.'    none    bind,nobootwait,_netdev    0 0';
            $app->system->replaceLine('/etc/fstab', $fstab_line, $fstab_line, 1, 1);
            exec('mount --bind '.escapeshellarg('/var/log/ispconfig/httpd/'.$data['new']['domain']).' '.escapeshellarg($data['new']['document_root'].'/'.$log_folder));
        }
        //print_r($data);
server/plugins-available/nginx_plugin.inc.php
@@ -466,6 +466,9 @@
                    $app->log('Renaming existing directory in new docroot location. mv '.$data['new']['document_root'].' '.$data['new']['document_root'].'_bak_'.date('Y_m_d_H_i_s'), LOGLEVEL_DEBUG);
                }
                //* Unmount the old log directory bfore we move the log dir
                exec('umount '.escapeshellcmd($old_dir.'/log'));
                //* Create new base directory, if it does not exist yet
                if(!is_dir($new_dir)) $app->system->mkdirpath($new_dir);
                $app->system->web_folder_protection($data['old']['document_root'], false);
@@ -497,6 +500,8 @@
            $fstab_line = '/var/log/ispconfig/httpd/'.$data['new']['domain'].' '.$data['new']['document_root'].'/'.$log_folder.'    none    bind,nobootwait,_netdev    0 0';
            $app->system->replaceLine('/etc/fstab', $fstab_line, $fstab_line, 1, 1);
            exec('mount --bind '.escapeshellarg('/var/log/ispconfig/httpd/'.$data['new']['domain']).' '.escapeshellarg($data['new']['document_root'].'/'.$log_folder));
        }
        //print_r($data);