Skip to content

Commit 57659ba

Browse files
author
vogelor
committed
Added Log-Rotation to the installer
1 parent 86ae40e commit 57659ba

File tree

5 files changed

+26
-48
lines changed

5 files changed

+26
-48
lines changed

docs/INSTALL_DEBIAN_5.0_dovecot_bind.txt

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -224,27 +224,6 @@ rsync - fast remote file copy program (for backup)
224224

225225
-----------------------------------------------------------------------------------------------------------
226226

227-
Ispc log files rotate, for now manual add but to add in ispc installer:
228-
229-
/etc/logrotate.d/logispc3
230-
231-
/var/log/ispconfig/ispconfig.log {
232-
weekly
233-
missingok
234-
rotate 4
235-
compress
236-
delaycompress
237-
}
238-
/var/log/ispconfig/cron.log {
239-
weekly
240-
missingok
241-
rotate 4
242-
compress
243-
delaycompress
244-
}
245-
246-
247-
-----------------------------------------------------------------------------------------------------------
248227

249228
Possible errors and their solutions
250229
------------------------------------

docs/INSTALL_DEBIAN_6.0_courier_mydns.txt

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -360,27 +360,6 @@ rsync - fast remote file copy program (for backup)
360360

361361
-----------------------------------------------------------------------------------------------------------
362362

363-
Ispc log files rotate, for now manual add but to add in ispc installer:
364-
365-
/etc/logrotate.d/logispc3
366-
367-
/var/log/ispconfig/ispconfig.log {
368-
weekly
369-
missingok
370-
rotate 4
371-
compress
372-
delaycompress
373-
}
374-
/var/log/ispconfig/cron.log {
375-
weekly
376-
missingok
377-
rotate 4
378-
compress
379-
delaycompress
380-
}
381-
382-
383-
-----------------------------------------------------------------------------------------------------------
384363

385364
Possible errors and their solutions
386365
------------------------------------

install/install.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*
4-
Copyright (c) 2007, Till Brehm, projektfarm Gmbh
4+
Copyright (c) 2007-2010, Till Brehm, projektfarm Gmbh
55
All rights reserved.
66
77
Redistribution and use in source and binary forms, with or without modification,

install/lib/installer_base.lib.php

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*
4-
Copyright (c) 2007, Till Brehm, projektfarm Gmbh
4+
Copyright (c) 2007-2010, Till Brehm, projektfarm Gmbh
55
All rights reserved.
66
77
Redistribution and use in source and binary forms, with or without modification,
@@ -154,7 +154,7 @@ public function configure_database() {
154154
caselog("mysql --default-character-set=".$conf['mysql']['charset']." -h '".$conf['mysql']['host']."' -u '".$conf['mysql']['admin_user']."' '".$conf['mysql']['database']."' < '".ISPC_INSTALL_ROOT."/install/sql/ispconfig3.sql' &> /dev/null",
155155
__FILE__, __LINE__, 'read in ispconfig3.sql', 'could not read in ispconfig3.sql');
156156
} else {
157-
caselog("mysql --default-character-set=".$conf['mysql']['charset']." -h '".$conf['mysql']['host']."' -u '".$conf['mysql']['admin_user']."' -p'".$conf['mysql']['admin_password']."' '".$conf['mysql']['database']."' < '".ISPC_INSTALL_ROOT."/install/sql/ispconfig3.sql' &> /dev/null",
157+
caselog("mysql --default-character-set=".$conf['mysql']['charset']." -h '".$conf['mysql']['host']."' -u '".$conf['mysql']['admin_user']."' -p'".$conf['mysql']['admin_password']."' '".$conf['mysql']['database']."' < '".ISPC_INSTALL_ROOT."/install/sql/ispconfig3.sql' &> /dev/null",
158158
__FILE__, __LINE__, 'read in ispconfig3.sql', 'could not read in ispconfig3.sql');
159159
}
160160
$db_tables = $this->db->getTables();
@@ -1388,8 +1388,28 @@ public function install_ispconfig()
13881388
exec('mv /usr/local/ispconfig/server/scripts/run-getmail.sh /usr/local/bin/run-getmail.sh');
13891389
if(is_user('getmail')) exec('chown getmail /usr/local/bin/run-getmail.sh');
13901390
exec('chmod 744 /usr/local/bin/run-getmail.sh');
1391-
1392-
1391+
1392+
//* Add Log-Rotation
1393+
if (is_dir('/etc/logrotate.d')){
1394+
unlink('/etc/logrotate.d/logispc3');
1395+
$fh = fopen('/etc/logrotate.d/logispc3', 'w');
1396+
fwrite($fh,
1397+
"/var/log/ispconfig/ispconfig.log { \n" .
1398+
" weekly \n" .
1399+
" missingok \n" .
1400+
" rotate 4 \n" .
1401+
" compress \n" .
1402+
" delaycompress \n" .
1403+
"} \n" .
1404+
"/var/log/ispconfig/cron.log { \n" .
1405+
" weekly \n" .
1406+
" missingok \n" .
1407+
" rotate 4 \n" .
1408+
" compress \n" .
1409+
" delaycompress \n" .
1410+
"}");
1411+
fclose($fh);
1412+
}
13931413
}
13941414

13951415
public function configure_dbserver()

install/update.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*
4-
Copyright (c) 2007, Till Brehm, projektfarm Gmbh
4+
Copyright (c) 2007-2010, Till Brehm, projektfarm Gmbh
55
All rights reserved.
66
77
Redistribution and use in source and binary forms, with or without modification,

0 commit comments

Comments
 (0)