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
b0dac383
Commit
b0dac383
authored
Apr 01, 2015
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
inc|rc: shuffle more things due to shutdown flow cleanups
parent
338f71c2
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
38 deletions
+24
-38
system.inc
src/etc/inc/system.inc
+0
-17
voucher.inc
src/etc/inc/voucher.inc
+10
-10
rc.backup_captiveportal
src/etc/rc.backup_captiveportal
+9
-0
rc.halt.common
src/etc/rc.halt.common
+5
-5
actions_service.conf
src/opnsense/service/conf/actions_service.conf
+0
-6
No files found.
src/etc/inc/system.inc
View file @
b0dac383
...
...
@@ -1621,8 +1621,6 @@ function system_ntp_configure($start_ntpd = true)
function
system_halt
(
$sync
=
false
)
{
system_reboot_cleanup
();
$cmd
=
'/usr/local/etc/rc.halt > /dev/null 2>&1'
;
if
(
!
$sync
)
{
...
...
@@ -1634,8 +1632,6 @@ function system_halt($sync = false)
function
system_reboot
(
$sync
=
false
)
{
system_reboot_cleanup
();
$cmd
=
'/usr/local/etc/rc.reboot > /dev/null 2>&1'
;
if
(
!
$sync
)
{
...
...
@@ -1645,19 +1641,6 @@ function system_reboot($sync = false)
mwexec
(
$cmd
);
}
function
system_reboot_cleanup
()
{
global
$config
,
$cpzone
;
require_once
(
"captiveportal.inc"
);
if
(
is_array
(
$config
[
'captiveportal'
]))
{
foreach
(
$config
[
'captiveportal'
]
as
$cpzone
=>
$cp
)
{
captiveportal_radius_stop_all
();
captiveportal_send_server_accounting
(
true
);
}
}
}
function
system_console_configure
()
{
setup_serial_port
();
...
...
src/etc/inc/voucher.inc
View file @
b0dac383
...
...
@@ -98,12 +98,13 @@ function voucher_expire($voucher_received) {
// Refresh active DBs
if
(
$active_dirty
==
true
)
{
foreach
(
$active_vouchers
as
$roll
=>
$active
)
foreach
(
$active_vouchers
as
$roll
=>
$active
)
{
voucher_write_active_db
(
$roll
,
$active
);
}
unset
(
$active_vouchers
);
/*
Tri
ger a sync of the vouchers on config */
send_event
(
"service sync vouchers"
);
/*
trig
ger a sync of the vouchers on config */
voucher_save_db_to_config
(
);
}
// Write back the used DB's
...
...
@@ -263,9 +264,8 @@ function voucher_auth($voucher_received, $test = 0) {
$active_vouchers
[
$first_voucher_roll
][
$first_voucher
]
=
"
$timestamp
,
$minutes
"
;
voucher_write_active_db
(
$first_voucher_roll
,
$active_vouchers
[
$first_voucher_roll
]);
/* Triger a sync of the vouchers on config */
send_event
(
"service sync vouchers"
);
/* trigger a sync of the vouchers on config */
voucher_save_db_to_config
();
return
$total_minutes
;
}
...
...
@@ -393,11 +393,11 @@ function voucher_read_active_db($roll) {
}
}
fclose
(
$fd
);
if
(
$dirty
)
{
// if we found expired entries, lets save our snapshot
if
(
$dirty
)
{
/* if we found expired entries, lets save our snapshot */
voucher_write_active_db
(
$roll
,
$active
);
/* Triger a sync of the vouchers on config */
send_event
(
"service sync vouchers"
);
/* trigger a sync of the vouchers on config */
voucher_save_db_to_config
();
}
}
}
...
...
src/etc/rc.
savevoucher
→
src/etc/rc.
backup_captiveportal
View file @
b0dac383
...
...
@@ -34,4 +34,13 @@ require_once("shaper.inc");
require_once
(
"captiveportal.inc"
);
require_once
(
"voucher.inc"
);
global
$config
,
$cpzone
;
if
(
isset
(
$config
[
'captiveportal'
]))
{
foreach
(
$config
[
'captiveportal'
]
as
$cpzone
=>
$cp
)
{
captiveportal_radius_stop_all
();
captiveportal_send_server_accounting
(
true
);
}
}
voucher_save_db_to_config
();
src/etc/rc.halt.common
View file @
b0dac383
#!/bin/sh
# run beep sequence if enabled
/usr/local/bin/beep.sh stop
# shutdown rc scripts
/usr/local/etc/rc.opnsense stop
# backup volatile internals
/usr/local/etc/rc.backup_
rrd
/usr/local/etc/rc.backup_
captiveportal
/usr/local/etc/rc.backup_dhcpleases
/usr/local/etc/rc.
savevouchers
/usr/local/etc/rc.
backup_rrd
# wait for config lock to release
php
-a
>
/dev/null
<<
EOF
...
...
@@ -16,6 +19,3 @@ if (flock(\$fp, LOCK_EX)) {
fclose(
\$
fp);
}
EOF
# run beep sequence if enabled
/usr/local/bin/beep.sh stop
src/opnsense/service/conf/actions_service.conf
View file @
b0dac383
...
...
@@ -57,9 +57,3 @@ command:/usr/local/etc/rc.restart_webgui
parameters
:
type
:
script
message
:
webConfigurator
restart
in
progress
[
sync
.
vouchers
]
command
:/
usr
/
local
/
etc
/
rc
.
savevoucher
parameters
:
type
:
script
message
:
Synching
vouchers
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