Skip to content

Commit

Permalink
system: always use reload except for deferred startup
Browse files Browse the repository at this point in the history
  • Loading branch information
fichtner committed May 9, 2017
1 parent 32a8adb commit 9c88e64
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 9 deletions.
1 change: 1 addition & 0 deletions plist
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 5 additions & 3 deletions src/etc/inc/system.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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";
Expand All @@ -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";
Expand Down
4 changes: 0 additions & 4 deletions src/etc/rc
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion src/etc/rc.bootup
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 3 additions & 0 deletions src/etc/rc.syshook.d/90-cron.start
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh
echo -n "Starting Cron: "
configctl cron restart
2 changes: 1 addition & 1 deletion src/opnsense/mvc/app/views/OPNsense/Cron/index.volt
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit 9c88e64

Please sign in to comment.