Commit 074a5781 authored by Till Brehm's avatar Till Brehm

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
parent 980485c4
......@@ -56,6 +56,7 @@ website_basedir=/var/www
website_path=/var/www/clients/client[client_id]/web[website_id]
website_symlinks=/var/www/[website_domain]/:/var/www/clients/client[client_id]/[website_domain]/
website_symlinks_rel=n
network_filesystem=n
vhost_conf_dir=/etc/apache2/sites-available
vhost_conf_enabled_dir=/etc/apache2/sites-enabled
nginx_vhost_conf_dir=/etc/nginx/sites-available
......
......@@ -549,6 +549,12 @@ $form["tabs"]['web'] = array(
'default' => 'n',
'value' => array(0 => 'n', 1 => 'y')
),
'network_filesystem' => array (
'datatype' => 'VARCHAR',
'formtype' => 'CHECKBOX',
'default' => 'n',
'value' => array(0 => 'n', 1 => 'y')
),
'website_autoalias' => array(
'datatype' => 'VARCHAR',
'formtype' => 'TEXT',
......
......@@ -241,4 +241,5 @@ $wb['vlogger_config_dir_error_regex'] = 'Invalid vlogger config dir.';
$wb['cron_init_script_error_regex'] = 'Invalid cron init script.';
$wb['crontab_dir_error_regex'] = 'Invalid crontab directory.';
$wb['cron_wget_error_regex'] = 'Invalid cron wget path.';
$wb['network_filesystem_txt'] = 'Network Filesystem';
?>
......@@ -241,4 +241,5 @@ $wb['vlogger_config_dir_error_regex'] = 'Invalid vlogger config dir.';
$wb['cron_init_script_error_regex'] = 'Invalid cron init script.';
$wb['crontab_dir_error_regex'] = 'Invalid crontab directory.';
$wb['cron_wget_error_regex'] = 'Invalid cron wget path.';
$wb['network_filesystem_txt'] = 'Network Filesystem';
?>
......@@ -241,4 +241,5 @@ $wb['vlogger_config_dir_error_regex'] = 'Invalid vlogger config dir.';
$wb['cron_init_script_error_regex'] = 'Invalid cron init script.';
$wb['crontab_dir_error_regex'] = 'Invalid crontab directory.';
$wb['cron_wget_error_regex'] = 'Invalid cron wget path.';
$wb['network_filesystem_txt'] = 'Network Filesystem';
?>
......@@ -241,5 +241,6 @@ $wb['vlogger_config_dir_error_regex'] = 'Invalid vlogger config dir.';
$wb['cron_init_script_error_regex'] = 'Invalid cron init script.';
$wb['crontab_dir_error_regex'] = 'Invalid crontab directory.';
$wb['cron_wget_error_regex'] = 'Invalid cron wget path.';
$wb['network_filesystem_txt'] = 'Network Filesystem';
?>
......@@ -241,4 +241,5 @@ $wb['vlogger_config_dir_error_regex'] = 'Invalid vlogger config dir.';
$wb['cron_init_script_error_regex'] = 'Invalid cron init script.';
$wb['crontab_dir_error_regex'] = 'Invalid crontab directory.';
$wb['cron_wget_error_regex'] = 'Invalid cron wget path.';
$wb['network_filesystem_txt'] = 'Netzwerk-Dateisystem';
?>
......@@ -241,4 +241,5 @@ $wb['vlogger_config_dir_error_regex'] = 'Invalid vlogger config dir.';
$wb['cron_init_script_error_regex'] = 'Invalid cron init script.';
$wb['crontab_dir_error_regex'] = 'Invalid crontab directory.';
$wb['cron_wget_error_regex'] = 'Invalid cron wget path.';
$wb['network_filesystem_txt'] = 'Network Filesystem';
?>
......@@ -241,4 +241,5 @@ $wb['vlogger_config_dir_error_regex'] = 'Invalid vlogger config dir.';
$wb['cron_init_script_error_regex'] = 'Invalid cron init script.';
$wb['crontab_dir_error_regex'] = 'Invalid crontab directory.';
$wb['cron_wget_error_regex'] = 'Invalid cron wget path.';
$wb['network_filesystem_txt'] = 'Network Filesystem';
?>
......@@ -241,4 +241,5 @@ $wb['vlogger_config_dir_error_regex'] = 'Invalid vlogger config dir.';
$wb['cron_init_script_error_regex'] = 'Invalid cron init script.';
$wb['crontab_dir_error_regex'] = 'Invalid crontab directory.';
$wb['cron_wget_error_regex'] = 'Invalid cron wget path.';
$wb['network_filesystem_txt'] = 'Network Filesystem';
?>
......@@ -241,4 +241,5 @@ $wb['vlogger_config_dir_error_regex'] = 'Invalid vlogger config dir.';
$wb['cron_init_script_error_regex'] = 'Invalid cron init script.';
$wb['crontab_dir_error_regex'] = 'Invalid crontab directory.';
$wb['cron_wget_error_regex'] = 'Invalid cron wget path.';
$wb['network_filesystem_txt'] = 'Network Filesystem';
?>
......@@ -241,4 +241,5 @@ $wb['vlogger_config_dir_error_regex'] = 'Invalid vlogger config dir.';
$wb['cron_init_script_error_regex'] = 'Invalid cron init script.';
$wb['crontab_dir_error_regex'] = 'Invalid crontab directory.';
$wb['cron_wget_error_regex'] = 'Invalid cron wget path.';
$wb['network_filesystem_txt'] = 'Network Filesystem';
?>
......@@ -241,6 +241,7 @@ $wb['vlogger_config_dir_error_regex'] = 'Neispravan vlogger config dir.';
$wb['cron_init_script_error_regex'] = 'Neispravan cron init script.';
$wb['crontab_dir_error_regex'] = 'Neispravan crontab direktorij.';
$wb['cron_wget_error_regex'] = 'Neispravna cron wget putanja.';
$wb['network_filesystem_txt'] = 'Network Filesystem';
?>
......@@ -241,4 +241,5 @@ $wb['vlogger_config_dir_error_regex'] = 'Invalid vlogger config dir.';
$wb['cron_init_script_error_regex'] = 'Invalid cron init script.';
$wb['crontab_dir_error_regex'] = 'Invalid crontab directory.';
$wb['cron_wget_error_regex'] = 'Invalid cron wget path.';
$wb['network_filesystem_txt'] = 'Network Filesystem';
?>
......@@ -241,4 +241,5 @@ $wb['vlogger_config_dir_error_regex'] = 'Invalid vlogger config dir.';
$wb['cron_init_script_error_regex'] = 'Invalid cron init script.';
$wb['crontab_dir_error_regex'] = 'Invalid crontab directory.';
$wb['cron_wget_error_regex'] = 'Invalid cron wget path.';
$wb['network_filesystem_txt'] = 'Network Filesystem';
?>
......@@ -241,4 +241,5 @@ $wb['vlogger_config_dir_error_regex'] = 'Invalid vlogger config dir.';
$wb['cron_init_script_error_regex'] = 'Invalid cron init script.';
$wb['crontab_dir_error_regex'] = 'Invalid crontab directory.';
$wb['cron_wget_error_regex'] = 'Invalid cron wget path.';
$wb['network_filesystem_txt'] = 'Network Filesystem';
?>
......@@ -241,4 +241,5 @@ $wb['vlogger_config_dir_error_regex'] = 'Invalid vlogger config dir.';
$wb['cron_init_script_error_regex'] = 'Invalid cron init script.';
$wb['crontab_dir_error_regex'] = 'Invalid crontab directory.';
$wb['cron_wget_error_regex'] = 'Invalid cron wget path.';
$wb['network_filesystem_txt'] = 'Network Filesystem';
?>
......@@ -241,4 +241,5 @@ $wb['vlogger_config_dir_error_regex'] = 'Invalid vlogger config dir.';
$wb['cron_init_script_error_regex'] = 'Invalid cron init script.';
$wb['crontab_dir_error_regex'] = 'Invalid crontab directory.';
$wb['cron_wget_error_regex'] = 'Invalid cron wget path.';
$wb['network_filesystem_txt'] = 'Network Filesystem';
?>
......@@ -241,4 +241,5 @@ $wb['vlogger_config_dir_error_regex'] = 'Invalid vlogger config dir.';
$wb['cron_init_script_error_regex'] = 'Invalid cron init script.';
$wb['crontab_dir_error_regex'] = 'Invalid crontab directory.';
$wb['cron_wget_error_regex'] = 'Invalid cron wget path.';
$wb['network_filesystem_txt'] = 'Network Filesystem';
?>
......@@ -241,4 +241,5 @@ $wb['vlogger_config_dir_error_regex'] = 'Invalid vlogger config dir.';
$wb['cron_init_script_error_regex'] = 'Invalid cron init script.';
$wb['crontab_dir_error_regex'] = 'Invalid crontab directory.';
$wb['cron_wget_error_regex'] = 'Invalid cron wget path.';
$wb['network_filesystem_txt'] = 'Network Filesystem';
?>
......@@ -241,4 +241,5 @@ $wb['vlogger_config_dir_error_regex'] = 'Invalid vlogger config dir.';
$wb['cron_init_script_error_regex'] = 'Invalid cron init script.';
$wb['crontab_dir_error_regex'] = 'Invalid crontab directory.';
$wb['cron_wget_error_regex'] = 'Invalid cron wget path.';
$wb['network_filesystem_txt'] = 'Network Filesystem';
?>
......@@ -241,4 +241,5 @@ $wb['vlogger_config_dir_error_regex'] = 'Invalid vlogger config dir.';
$wb['cron_init_script_error_regex'] = 'Invalid cron init script.';
$wb['crontab_dir_error_regex'] = 'Invalid crontab directory.';
$wb['cron_wget_error_regex'] = 'Invalid cron wget path.';
$wb['network_filesystem_txt'] = 'Network Filesystem';
?>
......@@ -241,4 +241,5 @@ $wb['vlogger_config_dir_error_regex'] = 'Invalid vlogger config dir.';
$wb['cron_init_script_error_regex'] = 'Invalid cron init script.';
$wb['crontab_dir_error_regex'] = 'Invalid crontab directory.';
$wb['cron_wget_error_regex'] = 'Invalid cron wget path.';
$wb['network_filesystem_txt'] = 'Network Filesystem';
?>
......@@ -241,4 +241,5 @@ $wb['vlogger_config_dir_error_regex'] = 'Invalid vlogger config dir.';
$wb['cron_init_script_error_regex'] = 'Invalid cron init script.';
$wb['crontab_dir_error_regex'] = 'Invalid crontab directory.';
$wb['cron_wget_error_regex'] = 'Invalid cron wget path.';
$wb['network_filesystem_txt'] = 'Network Filesystem';
?>
......@@ -241,4 +241,5 @@ $wb['vlogger_config_dir_error_regex'] = 'Invalid vlogger config dir.';
$wb['cron_init_script_error_regex'] = 'Invalid cron init script.';
$wb['crontab_dir_error_regex'] = 'Invalid crontab directory.';
$wb['cron_wget_error_regex'] = 'Invalid cron wget path.';
$wb['network_filesystem_txt'] = 'Network Filesystem';
?>
......@@ -30,6 +30,12 @@
<div class="multiField">
{tmpl_var name='website_symlinks_rel'}
</div>
</div>
<div class="ctrlHolder">
<label for="website_symlinks_rel">{tmpl_var name='network_filesystem_txt'}</label>
<div class="multiField">
{tmpl_var name='network_filesystem'}
</div>
</div>
<div class="ctrlHolder">
<label for="website_autoalias">{tmpl_var name='website_autoalias_txt'}</label>
......
......@@ -495,15 +495,27 @@ class apache2_plugin {
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);
......
......@@ -501,12 +501,24 @@ class nginx_plugin {
if($nginx_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));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment