Marius Cramer
2015-11-14 b717d292577f33f2e2ca044da469d8663aa982f6
Merge branch 'master' into 'master'

FS#4031 - Disabling server option "Network Filesystem" does not work



See merge request !242
3 files modified
20 ■■■■ changed files
server/plugins-available/apache2_plugin.inc.php 5 ●●●●● patch | view | raw | blame | history
server/plugins-available/mailman_plugin.inc.php 10 ●●●●● 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
@@ -595,7 +595,7 @@
                
                //* Unmount the old log directory bfore we move the log dir
                //exec('fuser -km '.escapeshellcmd($old_dir.'/log'));
                exec('umount '.escapeshellcmd($old_dir.'/log'));
                exec('umount '.escapeshellcmd($data['old']['document_root'].'/log'));
                //* Create new base directory, if it does not exist yet
                if(!is_dir($new_dir)) $app->system->mkdirpath($new_dir);
@@ -691,7 +691,8 @@
            $app->system->chmod($data['new']['document_root'].'/'.$log_folder, 0755);
            exec('mount --bind '.escapeshellarg('/var/log/ispconfig/httpd/'.$data['new']['domain']).' '.escapeshellarg($data['new']['document_root'].'/'.$log_folder));
            //* add mountpoint to fstab
            $fstab_line = '/var/log/ispconfig/httpd/'.$data['new']['domain'].' '.$data['new']['document_root'].'/'.$log_folder.'    none    bind,nobootwait,_netdev    0 0';
            $fstab_line = '/var/log/ispconfig/httpd/'.$data['new']['domain'].' '.$data['new']['document_root'].'/'.$log_folder.'    none    bind,nobootwait';
            $fstab_line .= @($web_config['network_filesystem'] == 'y')?',_netdev    0 0':'    0 0';
            $app->system->replaceLine('/etc/fstab', $fstab_line, $fstab_line, 1, 1);
        }
server/plugins-available/mailman_plugin.inc.php
@@ -73,7 +73,15 @@
        $this->update_config();
        exec("nohup /usr/lib/mailman/bin/newlist -u ".escapeshellcmd($data["new"]["domain"])." -e ".escapeshellcmd($data["new"]["domain"])." ".escapeshellcmd($data["new"]["listname"])." ".escapeshellcmd($data["new"]["email"])." ".escapeshellcmd($data["new"]["password"])." >/dev/null 2>&1 &");
        $pid = exec("nohup /usr/lib/mailman/bin/newlist -u ".escapeshellcmd($data["new"]["domain"])." -e ".escapeshellcmd($data["new"]["domain"])." ".escapeshellcmd($data["new"]["listname"])." ".escapeshellcmd($data["new"]["email"])." ".escapeshellcmd($data["new"]["password"])." >/dev/null 2>&1 & echo $!;");
        // wait for /usr/lib/mailman/bin/newlist-call
        $running = true;
        do {
            exec('ps -p '.intval($pid), $out);
            if (count($out) ==1) $running=false; else sleep(1);
            unset($out);
        } while ($running);
        unset($out);
        if(is_file('/var/lib/mailman/data/virtual-mailman')) exec('postmap /var/lib/mailman/data/virtual-mailman');
        if(is_file('/var/lib/mailman/data/transport-mailman')) exec('postmap /var/lib/mailman/data/transport-mailman');
        exec('nohup '.$conf['init_scripts'] . '/' . 'mailman reload >/dev/null 2>&1 &');
server/plugins-available/nginx_plugin.inc.php
@@ -476,7 +476,7 @@
                
                //* Unmount the old log directory bfore we move the log dir
                //exec('fuser -km '.escapeshellcmd($old_dir.'/log'));
                exec('umount '.escapeshellcmd($old_dir.'/log'));
                exec('umount '.escapeshellcmd($data['old']['document_root'].'/log'));
                //* Create new base directory, if it does not exist yet
                if(!is_dir($new_dir)) $app->system->mkdirpath($new_dir);
@@ -572,7 +572,8 @@
            $app->system->chmod($data['new']['document_root'].'/'.$log_folder, 0755);
            exec('mount --bind '.escapeshellarg('/var/log/ispconfig/httpd/'.$data['new']['domain']).' '.escapeshellarg($data['new']['document_root'].'/'.$log_folder));
            //* add mountpoint to fstab
            $fstab_line = '/var/log/ispconfig/httpd/'.$data['new']['domain'].' '.$data['new']['document_root'].'/'.$log_folder.'    none    bind,nobootwait,_netdev    0 0';
            $fstab_line = '/var/log/ispconfig/httpd/'.$data['new']['domain'].' '.$data['new']['document_root'].'/'.$log_folder.'    none    bind,nobootwait';
            $fstab_line .= @($web_config['network_filesystem'] == 'y')?',_netdev    0 0':'    0 0';
            $app->system->replaceLine('/etc/fstab', $fstab_line, $fstab_line, 1, 1);
        }