Commit 9c88e641 authored by Franco Fichtner's avatar Franco Fichtner

system: always use reload except for deferred startup

PR: https://forum.opnsense.org/index.php?topic=5140.0
parent 32a8adb7
......@@ -135,6 +135,7 @@
/usr/local/etc/rc.syshook.d/20-freebsd.start
/usr/local/etc/rc.syshook.d/20-freebsd.stop
/usr/local/etc/rc.syshook.d/90-carp.start
/usr/local/etc/rc.syshook.d/90-cron.start
/usr/local/etc/rc.syshook.d/95-beep.start
/usr/local/etc/rc.update_alias_url_data
/usr/local/etc/rc.update_bogons
......
......@@ -1165,7 +1165,7 @@ function system_devd_configure($verbose = false)
}
}
function system_cron_configure($verbose = false)
function system_cron_configure($verbose = false, $defer = false)
{
global $config;
......@@ -1251,7 +1251,6 @@ function system_cron_configure($verbose = false)
}
$crontab_contents = "# DO NOT EDIT THIS FILE -- OPNsense auto-generated file\n";
$crontab_contents .= "# Please use /etc/crontab for your overrides instead.\n";
$crontab_contents .= "SHELL=/bin/sh\n";
$crontab_contents .= "PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin\n";
$crontab_contents .= "#minute\thour\tmday\tmonth\twday\tcommand\n";
......@@ -1266,7 +1265,10 @@ function system_cron_configure($verbose = false)
}
file_put_contents('/var/cron/tabs/root', $crontab_contents);
killbypid('/var/run/cron.pid', 'HUP');
if (!$defer) {
configd_run('cron restart');
}
if ($verbose) {
echo "done.\n";
......
......@@ -255,10 +255,6 @@ rm /var/run/booting
# Execute the normal syshook / plugin commands
/usr/local/etc/rc.syshook start
echo -n "Starting CRON..."
cd /tmp && /usr/sbin/cron -s 2> /dev/null
echo "done."
/usr/local/etc/rc.initial.banner
exit 0
......@@ -100,7 +100,7 @@ filter_configure_sync(true);
filter_pflog_start(true);
setup_gateways_monitor(true);
plugins_configure('earlybootup', true);
system_cron_configure(true);
system_cron_configure(true, true);
system_routing_configure('', true);
plugins_configure('dns', true);
......
#!/bin/sh
echo -n "Starting Cron: "
configctl cron restart
......@@ -149,7 +149,7 @@ POSSIBILITY OF SUCH DAMAGE.
</div>
<div class="col-md-12">
<hr/>
<button class="btn btn-primary" id="reconfigureAct" type="button"><b>{{ lang._('Apply') }}</b><i id="reconfigureAct_progress" class=""></i></button>
<button class="btn btn-primary" id="reconfigureAct" type="button"><b>{{ lang._('Apply') }}</b> <i id="reconfigureAct_progress" class=""></i></button>
<br/><br/>
</div>
</div>
......
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