Commit a9b8f965 authored by Franco Fichtner's avatar Franco Fichtner

verbose option for #1256

parent 4c253df1
...@@ -184,7 +184,7 @@ function system_resolvconf_generate($dynupdate = false) ...@@ -184,7 +184,7 @@ function system_resolvconf_generate($dynupdate = false)
$fd = fopen('/etc/resolv.conf', 'w'); $fd = fopen('/etc/resolv.conf', 'w');
if (!$fd) { if (!$fd) {
printf("Error: cannot open resolv.conf in system_resolvconf_generate().\n"); log_error('Cannot open resolv.conf in system_resolvconf_generate()');
unlock($dnslock); unlock($dnslock);
return 1; return 1;
} }
...@@ -765,7 +765,7 @@ function system_syslogd_extra_local($logsocket) ...@@ -765,7 +765,7 @@ function system_syslogd_extra_local($logsocket)
return exec_safe('-l %s ', $logsocket); return exec_safe('-l %s ', $logsocket);
} }
function system_syslogd_start() function system_syslogd_start($verbose = false)
{ {
global $config, $g; global $config, $g;
...@@ -775,8 +775,10 @@ function system_syslogd_start() ...@@ -775,8 +775,10 @@ function system_syslogd_start()
mwexec('/etc/rc.d/hostid start'); mwexec('/etc/rc.d/hostid start');
$syslogcfg = $config['syslog']; $syslogcfg = $config['syslog'];
if (file_exists('/var/run/booting')) {
echo gettext('Starting syslog...'); if ($verbose) {
echo 'Starting syslog...';
flush();
} }
$log_directive = '%'; $log_directive = '%';
...@@ -866,7 +868,7 @@ EOD; ...@@ -866,7 +868,7 @@ EOD;
/* write syslog.conf */ /* write syslog.conf */
if (!@file_put_contents("/var/etc/syslog.conf", $syslogconf)) { if (!@file_put_contents("/var/etc/syslog.conf", $syslogconf)) {
printf(gettext("Error: cannot open syslog.conf in system_syslogd_start().%s"), "\n"); log_error('Cannot open syslog.conf in system_syslogd_start()');
unset($syslogconf); unset($syslogconf);
return 1; return 1;
} }
...@@ -910,8 +912,8 @@ EOD; ...@@ -910,8 +912,8 @@ EOD;
mwexecf_bg("/usr/local/sbin/syslogd -s -c -c -P %s {$syslogd_extra}", '/var/run/syslog.pid'); mwexecf_bg("/usr/local/sbin/syslogd -s -c -c -P %s {$syslogd_extra}", '/var/run/syslog.pid');
} }
if (file_exists("/var/run/booting")) { if ($verbose) {
echo gettext("done.") . "\n"; echo "done.\n";
} }
} }
......
...@@ -134,7 +134,7 @@ system_hosts_generate(); ...@@ -134,7 +134,7 @@ system_hosts_generate();
interfaces_loopback_configure(); interfaces_loopback_configure();
/* start syslogd */ /* start syslogd */
system_syslogd_start(); system_syslogd_start(true);
/* set up interfaces */ /* set up interfaces */
mute_kernel_msgs(); mute_kernel_msgs();
...@@ -253,7 +253,7 @@ prefer_ipv4_or_ipv6(); ...@@ -253,7 +253,7 @@ prefer_ipv4_or_ipv6();
* initialized, otherwise it can occasionally fail to * initialized, otherwise it can occasionally fail to
* route syslog messages properly on both IPv4 and IPv6. * route syslog messages properly on both IPv4 and IPv6.
*/ */
system_syslogd_start(); system_syslogd_start(true);
/* If there are ipsec dynamic hosts try again to reload the tunnels as rc.newipsecdns does */ /* If there are ipsec dynamic hosts try again to reload the tunnels as rc.newipsecdns does */
if ($ipsec_dynamic_hosts) { if ($ipsec_dynamic_hosts) {
......
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