mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-16 01:24:38 +00:00
system: unify mvc and legacy cron restart
So both sides don't miss the other. Remove $defer since we can simply start it later anyway.
This commit is contained in:
parent
7fe7c460b0
commit
d319644859
@ -100,8 +100,10 @@ function core_services()
|
||||
$services[] = array(
|
||||
'description' => gettext('Cron'),
|
||||
'php' => array(
|
||||
"restart" => array('system_cron_configure')
|
||||
'start' => ['system_cron_configure'],
|
||||
'restart' => ['system_cron_configure'],
|
||||
),
|
||||
'pidfile' => '/var/run/cron.pid',
|
||||
'name' => 'cron',
|
||||
);
|
||||
|
||||
|
||||
@ -872,7 +872,7 @@ function system_devd_configure($verbose = false)
|
||||
}
|
||||
}
|
||||
|
||||
function system_cron_configure($verbose = false, $defer = false)
|
||||
function system_cron_configure($verbose = false)
|
||||
{
|
||||
function generate_cron_job($command, $minute = '0', $hour = '*', $monthday = '*', $month = '*', $weekday = '*')
|
||||
{
|
||||
@ -931,9 +931,7 @@ function system_cron_configure($verbose = false, $defer = false)
|
||||
|
||||
configd_run('template reload OPNsense/Cron');
|
||||
|
||||
if (!$defer) {
|
||||
configd_run('cron restart');
|
||||
}
|
||||
mwexec('/etc/rc.d/cron restart');
|
||||
|
||||
if ($verbose) {
|
||||
echo "done.\n";
|
||||
|
||||
@ -100,7 +100,6 @@ interfaces_configure(true);
|
||||
system_resolvconf_generate(true);
|
||||
filter_configure_sync(true);
|
||||
plugins_configure('early', true);
|
||||
system_cron_configure(true, true);
|
||||
system_routing_configure(true);
|
||||
|
||||
system_hosts_generate(true);
|
||||
|
||||
@ -53,10 +53,7 @@ class ServiceController extends ApiControllerBase
|
||||
|
||||
$backend = new Backend();
|
||||
|
||||
// generate template
|
||||
$backend->configdRun('template reload OPNsense/Cron');
|
||||
|
||||
// (res)start daemon
|
||||
// generate configuration and (re)start daemon
|
||||
$backend->configdRun("cron restart");
|
||||
|
||||
return array("status" => "ok");
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
[restart]
|
||||
command:/etc/rc.d/cron restart
|
||||
command:pluginctl -s cron restart
|
||||
parameters:
|
||||
type:script
|
||||
message:restarting cron
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user