Skip to content

Commit b717d29

Browse files
author
Marius Cramer
committed
Merge branch 'master' into 'master'
FS#4031 - Disabling server option "Network Filesystem" does not work See merge request !242
2 parents 576d93b + f8bc88f commit b717d29

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

server/plugins-available/apache2_plugin.inc.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@ function update($event_name, $data) {
595595

596596
//* Unmount the old log directory bfore we move the log dir
597597
//exec('fuser -km '.escapeshellcmd($old_dir.'/log'));
598-
exec('umount '.escapeshellcmd($old_dir.'/log'));
598+
exec('umount '.escapeshellcmd($data['old']['document_root'].'/log'));
599599

600600
//* Create new base directory, if it does not exist yet
601601
if(!is_dir($new_dir)) $app->system->mkdirpath($new_dir);
@@ -691,7 +691,8 @@ function update($event_name, $data) {
691691
$app->system->chmod($data['new']['document_root'].'/'.$log_folder, 0755);
692692
exec('mount --bind '.escapeshellarg('/var/log/ispconfig/httpd/'.$data['new']['domain']).' '.escapeshellarg($data['new']['document_root'].'/'.$log_folder));
693693
//* add mountpoint to fstab
694-
$fstab_line = '/var/log/ispconfig/httpd/'.$data['new']['domain'].' '.$data['new']['document_root'].'/'.$log_folder.' none bind,nobootwait,_netdev 0 0';
694+
$fstab_line = '/var/log/ispconfig/httpd/'.$data['new']['domain'].' '.$data['new']['document_root'].'/'.$log_folder.' none bind,nobootwait';
695+
$fstab_line .= @($web_config['network_filesystem'] == 'y')?',_netdev 0 0':' 0 0';
695696
$app->system->replaceLine('/etc/fstab', $fstab_line, $fstab_line, 1, 1);
696697
}
697698

server/plugins-available/mailman_plugin.inc.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,15 @@ function insert($event_name, $data) {
7373

7474
$this->update_config();
7575

76-
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 &");
76+
$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 $!;");
77+
// wait for /usr/lib/mailman/bin/newlist-call
78+
$running = true;
79+
do {
80+
exec('ps -p '.intval($pid), $out);
81+
if (count($out) ==1) $running=false; else sleep(1);
82+
unset($out);
83+
} while ($running);
84+
unset($out);
7785
if(is_file('/var/lib/mailman/data/virtual-mailman')) exec('postmap /var/lib/mailman/data/virtual-mailman');
7886
if(is_file('/var/lib/mailman/data/transport-mailman')) exec('postmap /var/lib/mailman/data/transport-mailman');
7987
exec('nohup '.$conf['init_scripts'] . '/' . 'mailman reload >/dev/null 2>&1 &');

server/plugins-available/nginx_plugin.inc.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ function update($event_name, $data) {
476476

477477
//* Unmount the old log directory bfore we move the log dir
478478
//exec('fuser -km '.escapeshellcmd($old_dir.'/log'));
479-
exec('umount '.escapeshellcmd($old_dir.'/log'));
479+
exec('umount '.escapeshellcmd($data['old']['document_root'].'/log'));
480480

481481
//* Create new base directory, if it does not exist yet
482482
if(!is_dir($new_dir)) $app->system->mkdirpath($new_dir);
@@ -572,7 +572,8 @@ function update($event_name, $data) {
572572
$app->system->chmod($data['new']['document_root'].'/'.$log_folder, 0755);
573573
exec('mount --bind '.escapeshellarg('/var/log/ispconfig/httpd/'.$data['new']['domain']).' '.escapeshellarg($data['new']['document_root'].'/'.$log_folder));
574574
//* add mountpoint to fstab
575-
$fstab_line = '/var/log/ispconfig/httpd/'.$data['new']['domain'].' '.$data['new']['document_root'].'/'.$log_folder.' none bind,nobootwait,_netdev 0 0';
575+
$fstab_line = '/var/log/ispconfig/httpd/'.$data['new']['domain'].' '.$data['new']['document_root'].'/'.$log_folder.' none bind,nobootwait';
576+
$fstab_line .= @($web_config['network_filesystem'] == 'y')?',_netdev 0 0':' 0 0';
576577
$app->system->replaceLine('/etc/fstab', $fstab_line, $fstab_line, 1, 1);
577578
}
578579

0 commit comments

Comments
 (0)