From 074a578110cefcd658b1c491491757478bf7907e Mon Sep 17 00:00:00 2001
From: Till Brehm <tbrehm@ispconfig.org>
Date: Fri, 17 Oct 2014 09:29:31 -0400
Subject: [PATCH] Fixed: FS#3705 - openvz container wont boot after new mounts added to fstab -Added a new option "Network Filesystem" under System > Server config > Web to toggle on / off the _netdev option for the bind mounts in /etc/fstab
---
server/plugins-available/apache2_plugin.inc.php | 18 +++++++++++++++---
1 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/server/plugins-available/apache2_plugin.inc.php b/server/plugins-available/apache2_plugin.inc.php
index 3c4ba3e..7c1903a 100644
--- a/server/plugins-available/apache2_plugin.inc.php
+++ b/server/plugins-available/apache2_plugin.inc.php
@@ -495,15 +495,27 @@
if($apache_chrooted) $this->_exec('chroot '.escapeshellcmd($web_config['website_basedir']).' '.$command);
//* Change the log mount
+ /*
$fstab_line = '/var/log/ispconfig/httpd/'.$data['old']['domain'].' '.$data['old']['document_root'].'/'.$old_log_folder.' none bind';
$app->system->removeLine('/etc/fstab', $fstab_line);
$fstab_line = '/var/log/ispconfig/httpd/'.$data['old']['domain'].' '.$data['old']['document_root'].'/'.$old_log_folder.' none bind,nobootwait';
$app->system->removeLine('/etc/fstab', $fstab_line);
- $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);
+ $fstab_line = '/var/log/ispconfig/httpd/'.$data['old']['domain'].' '.$data['old']['document_root'].'/'.$old_log_folder.' none bind,nobootwait';
+ $app->system->removeLine('/etc/fstab', $fstab_line);
+ */
+
+ $fstab_line_old = '/var/log/ispconfig/httpd/'.$data['old']['domain'].' '.$data['old']['document_root'].'/'.$old_log_folder.' none bind';
+
+ if($web_config['network_filesystem'] == 'y') {
+ $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_old, $fstab_line, 0, 1);
+ } else {
+ $fstab_line = '/var/log/ispconfig/httpd/'.$data['new']['domain'].' '.$data['new']['document_root'].'/'.$log_folder.' none bind,nobootwait 0 0';
+ $app->system->replaceLine('/etc/fstab', $fstab_line_old, $fstab_line, 0, 1);
+ }
exec('mount --bind '.escapeshellarg('/var/log/ispconfig/httpd/'.$data['new']['domain']).' '.escapeshellarg($data['new']['document_root'].'/'.$log_folder));
-
+
}
//print_r($data);
--
Gitblit v1.9.1