Skip to content

Commit 82e0625

Browse files
author
Till Brehm
committed
Merge branch '6779-install-log-dir' into 'develop'
Move install.log into the ispconfig_log_dir Closes #6779 See merge request ispconfig/ispconfig3!1950
2 parents a5ef1ad + 6f4e390 commit 82e0625

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

install/install.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,6 @@
8585
chdir( realpath(dirname(__FILE__)) );
8686
}
8787

88-
//** Install logfile
89-
define('ISPC_LOG_FILE', '/var/log/ispconfig_install.log');
9088
define('ISPC_INSTALL_ROOT', realpath(dirname(__FILE__).'/../'));
9189

9290
//** Include the templating lib
@@ -156,10 +154,15 @@
156154
swriteln($inst->lng(' Tap in "quit" (without the quotes) to stop the installer.'."\n\n"));
157155

158156
//** Check log file is writable (probably not root or sudo)
159-
if(!is_writable(dirname(ISPC_LOG_FILE))){
160-
die("ERROR: Cannot write to the ".dirname(ISPC_LOG_FILE)." directory. Are you root or sudo ?\n\n");
157+
if(!is_writable(dirname($conf['ispconfig_log_dir']))){
158+
die("ERROR: Cannot write to the ".$conf['ispconfig_log_dir']." directory. Are you root or sudo ?\n\n");
161159
}
162160

161+
if(!is_dir($conf['ispconfig_log_dir'])) {
162+
mkdir($conf['ispconfig_log_dir'], 0755, true);
163+
}
164+
define('ISPC_LOG_FILE', $conf['ispconfig_log_dir'] . '/install.log');
165+
163166
//** Check for ISPConfig 2.x versions
164167
if(is_dir('/root/ispconfig') || is_dir('/home/admispconfig')) {
165168
if(is_dir('/home/admispconfig')) {

install/update.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@
8888
if(realpath(dirname(__FILE__)) != $cur_dir) die("Please run installation/update from _inside_ the install directory!\n");
8989

9090
//** Install logfile
91-
define('ISPC_LOG_FILE', '/var/log/ispconfig_install.log');
9291
define('ISPC_INSTALL_ROOT', realpath(dirname(__FILE__).'/../'));
9392

9493
//** Include the templating lib
@@ -112,6 +111,7 @@
112111
include_once "/usr/local/ispconfig/server/lib/config.inc.php";
113112
$conf_old = $conf;
114113
unset($conf);
114+
define('ISPC_LOG_FILE', $old_conf['ispconfig_log_dir'] . '/update.log');
115115

116116
if($dist['id'] == '') die('Linux distribution or version not recognized.');
117117

0 commit comments

Comments
 (0)