Commit 838645aa 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
(cherry picked from commit 9c88e641)
parent 6bfa7ce3
......@@ -132,6 +132,7 @@
/usr/local/etc/rc.shutdown
/usr/local/etc/rc.sshd
/usr/local/etc/rc.syshook
/usr/local/etc/rc.syshook.d/90-cron.start
/usr/local/etc/rc.update_alias_url_data
/usr/local/etc/rc.update_bogons
/usr/local/etc/rc.update_urltables
......
......@@ -1550,7 +1550,7 @@ function system_devd_configure($verbose = false)
}
}
function system_cron_configure($verbose = false)
function system_cron_configure($verbose = false, $defer = false)
{
global $config;
......@@ -1636,7 +1636,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";
......@@ -1651,7 +1650,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";
......
......@@ -261,10 +261,6 @@ rm /var/run/booting
# starting standard rc scripts
/usr/local/etc/rc.opnsense start
echo -n "Starting CRON..."
cd /tmp && /usr/sbin/cron -s 2> /dev/null
echo "done."
/usr/local/sbin/beep.sh start
/usr/local/etc/rc.initial.banner
......
......@@ -101,7 +101,7 @@ filter_pflog_start(true);
setup_gateways_monitor(true);
system_webgui_configure(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