Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
OpnSense
Commits
f16199ff
Commit
f16199ff
authored
Nov 14, 2016
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cron: prepend system_, but move to system.inc later
parent
a711740d
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
29 additions
and
24 deletions
+29
-24
services.inc
src/etc/inc/services.inc
+23
-14
rc.bootup
src/etc/rc.bootup
+1
-5
rc.reload_all
src/etc/rc.reload_all
+1
-1
diag_backup.php
src/www/diag_backup.php
+1
-1
firewall_rules_edit.php
src/www/firewall_rules_edit.php
+1
-1
system_advanced_firewall.php
src/www/system_advanced_firewall.php
+1
-1
system_advanced_misc.php
src/www/system_advanced_misc.php
+1
-1
No files found.
src/etc/inc/services.inc
View file @
f16199ff
...
@@ -2184,12 +2184,31 @@ EOD;
...
@@ -2184,12 +2184,31 @@ EOD;
return
0
;
return
0
;
}
}
function
configure_cron
(
)
function
system_configure_cron
(
$verbose
=
false
)
{
{
global
$config
;
global
$config
;
function
generate_cron_job
(
$command
,
$minute
=
'0'
,
$hour
=
'*'
,
$monthday
=
'*'
,
$month
=
'*'
,
$weekday
=
'*'
)
{
$cron_item
=
array
();
$cron_item
[
'minute'
]
=
$minute
;
$cron_item
[
'hour'
]
=
$hour
;
$cron_item
[
'mday'
]
=
$monthday
;
$cron_item
[
'month'
]
=
$month
;
$cron_item
[
'wday'
]
=
$weekday
;
$cron_item
[
'command'
]
=
$command
;
return
$cron_item
;
}
$autocron
=
array
();
$autocron
=
array
();
if
(
$verbose
)
{
echo
'Configuring CRON...'
;
flush
();
}
/* hourly */
/* hourly */
$autocron
[]
=
generate_cron_job
(
'/usr/local/sbin/expiretable -v -t 3600 webConfiguratorlockout'
,
'1'
);
$autocron
[]
=
generate_cron_job
(
'/usr/local/sbin/expiretable -v -t 3600 webConfiguratorlockout'
,
'1'
);
$autocron
[]
=
generate_cron_job
(
'/usr/local/sbin/expiretable -v -t 3600 sshlockout'
,
'2'
);
$autocron
[]
=
generate_cron_job
(
'/usr/local/sbin/expiretable -v -t 3600 sshlockout'
,
'2'
);
...
@@ -2260,20 +2279,10 @@ function configure_cron()
...
@@ -2260,20 +2279,10 @@ function configure_cron()
file_put_contents
(
'/var/cron/tabs/root'
,
$crontab_contents
);
file_put_contents
(
'/var/cron/tabs/root'
,
$crontab_contents
);
killbypid
(
'/var/run/cron.pid'
,
'HUP'
);
killbypid
(
'/var/run/cron.pid'
,
'HUP'
);
}
function
generate_cron_job
(
$command
,
$minute
=
'0'
,
$hour
=
'*'
,
$monthday
=
'*'
,
$month
=
'*'
,
$weekday
=
'*'
)
{
$cron_item
=
array
();
$cron_item
[
'minute'
]
=
$minute
;
$cron_item
[
'hour'
]
=
$hour
;
$cron_item
[
'mday'
]
=
$monthday
;
$cron_item
[
'month'
]
=
$month
;
$cron_item
[
'wday'
]
=
$weekday
;
$cron_item
[
'command'
]
=
$command
;
return
$cron_item
;
if
(
$verbose
)
{
echo
"done.
\n
"
;
}
}
}
function
is_apinger_enabled
()
function
is_apinger_enabled
()
...
...
src/etc/rc.bootup
View file @
f16199ff
...
@@ -174,11 +174,7 @@ mwexec("/usr/local/etc/rc.sshd");
...
@@ -174,11 +174,7 @@ mwexec("/usr/local/etc/rc.sshd");
/* start web server */
/* start web server */
echo
'Starting webConfigurator...'
.
(
system_webgui_configure
()
?
"done.
\n
"
:
"failed.
\n
"
);
echo
'Starting webConfigurator...'
.
(
system_webgui_configure
()
?
"done.
\n
"
:
"failed.
\n
"
);
/* configure cron service */
system_configure_cron
(
true
);
echo
"Configuring CRON..."
;
configure_cron
();
echo
"done.
\n
"
;
system_routing_configure
();
system_routing_configure
();
system_routing_enable
();
system_routing_enable
();
services_dnsmasq_configure
(
true
);
services_dnsmasq_configure
(
true
);
...
...
src/etc/rc.reload_all
View file @
f16199ff
...
@@ -53,7 +53,7 @@ system_resolvconf_generate();
...
@@ -53,7 +53,7 @@ system_resolvconf_generate();
system_routing_enable
();
system_routing_enable
();
interfaces_configure
();
interfaces_configure
();
services_dyndns_configure
();
services_dyndns_configure
();
configure_cron
();
system_
configure_cron
();
system_ntp_configure
();
system_ntp_configure
();
mwexec_bg
(
'/usr/local/etc/rc.sshd'
);
mwexec_bg
(
'/usr/local/etc/rc.sshd'
);
mwexec_bg
(
'/usr/local/etc/rc.restart_webgui'
);
mwexec_bg
(
'/usr/local/etc/rc.restart_webgui'
);
...
...
src/www/diag_backup.php
View file @
f16199ff
...
@@ -449,7 +449,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
...
@@ -449,7 +449,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$savemsg
=
gettext
(
"Google Drive backup settings have been saved."
);
$savemsg
=
gettext
(
"Google Drive backup settings have been saved."
);
write_config
();
write_config
();
configure_cron
();
system_
configure_cron
();
try
{
try
{
$filesInBackup
=
backup_to_google_drive
();
$filesInBackup
=
backup_to_google_drive
();
...
...
src/www/firewall_rules_edit.php
View file @
f16199ff
...
@@ -451,7 +451,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
...
@@ -451,7 +451,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
}
}
// sort filter items per interface, not really necessary but leaves a bit nicer sorted config.xml behind.
// sort filter items per interface, not really necessary but leaves a bit nicer sorted config.xml behind.
filter_rules_sort
();
filter_rules_sort
();
c
onfigure_cron
();
system_
onfigure_cron
();
// write to config
// write to config
write_config
();
write_config
();
mark_subsystem_dirty
(
'filter'
);
mark_subsystem_dirty
(
'filter'
);
...
...
src/www/system_advanced_firewall.php
View file @
f16199ff
...
@@ -208,7 +208,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
...
@@ -208,7 +208,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$savemsg
=
get_std_save_message
();
$savemsg
=
get_std_save_message
();
configure_cron
();
system_
configure_cron
();
filter_configure
();
filter_configure
();
}
}
}
}
...
...
src/www/system_advanced_misc.php
View file @
f16199ff
...
@@ -168,7 +168,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
...
@@ -168,7 +168,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$savemsg
=
get_std_save_message
();
$savemsg
=
get_std_save_message
();
system_resolvconf_generate
(
true
);
system_resolvconf_generate
(
true
);
configure_cron
();
system_
configure_cron
();
activate_powerd
();
activate_powerd
();
load_crypto_module
();
load_crypto_module
();
load_thermal_module
();
load_thermal_module
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment