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
0c10b8f4
Commit
0c10b8f4
authored
May 15, 2017
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rc: merge syshook refactor from master and assorted bits
parent
aeea6ac1
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
44 additions
and
38 deletions
+44
-38
Makefile
Makefile
+1
-8
plist
plist
+6
-0
rc
src/etc/rc
+0
-18
rc.shutdown
src/etc/rc.shutdown
+0
-8
rc.syshook
src/etc/rc.syshook
+4
-3
05-beep.stop
src/etc/rc.syshook.d/05-beep.stop
+3
-0
05-update.early
src/etc/rc.syshook.d/05-update.early
+9
-0
10-configd.early
src/etc/rc.syshook.d/10-configd.early
+4
-0
20-backup.early
src/etc/rc.syshook.d/20-backup.early
+6
-0
20-freebsd.start
src/etc/rc.syshook.d/20-freebsd.start
+1
-0
90-backup.stop
src/etc/rc.syshook.d/90-backup.stop
+6
-0
90-cron.start
src/etc/rc.syshook.d/90-cron.start
+1
-0
95-beep.start
src/etc/rc.syshook.d/95-beep.start
+3
-0
actions_dhcpd.conf
src/opnsense/service/conf/actions.d/actions_dhcpd.conf
+0
-1
No files found.
Makefile
View file @
0c10b8f4
...
...
@@ -265,7 +265,7 @@ upgrade: plist-check upgrade-check package
@
${
PKG
}
add
${
PKGDIR
}
/
*
.txz
@
${
LOCALBASE
}
/etc/rc.restart_webgui
lint
:
force
lint
:
plist-check
find
${
.CURDIR
}
/src
${
.CURDIR
}
/Scripts
\
-name
"*.sh"
-type
f
-print0
| xargs
-0
-n1
sh
-n
find
${
.CURDIR
}
/src
${
.CURDIR
}
/Scripts
\
...
...
@@ -306,13 +306,6 @@ style: want-pear-PHP_CodeSniffer
style-fix
:
want-pear-PHP_CodeSniffer
phpcbf
--standard
=
ruleset.xml
${
.CURDIR
}
/src/opnsense
||
true
setup
:
force
${
.CURDIR
}
/src/etc/rc.php_ini_setup
health
:
force
# check test script output and advertise a failure...
[
"
`
${
.CURDIR
}
/src/etc/rc.php_test_run
`
"
==
"FCGI-PASSED PASSED"
]
test
:
want-phpunit
@
cd
${
.CURDIR
}
/src/opnsense/mvc/tests
&&
\
phpunit
--configuration
PHPunit.xml
...
...
plist
View file @
0c10b8f4
...
...
@@ -132,9 +132,15 @@
/usr/local/etc/rc.shutdown
/usr/local/etc/rc.sshd
/usr/local/etc/rc.syshook
/usr/local/etc/rc.syshook.d/05-beep.stop
/usr/local/etc/rc.syshook.d/05-update.early
/usr/local/etc/rc.syshook.d/10-configd.early
/usr/local/etc/rc.syshook.d/20-backup.early
/usr/local/etc/rc.syshook.d/20-freebsd.start
/usr/local/etc/rc.syshook.d/80-freebsd.stop
/usr/local/etc/rc.syshook.d/90-backup.stop
/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
/usr/local/etc/rc.update_urltables
...
...
src/etc/rc
View file @
0c10b8f4
...
...
@@ -230,22 +230,6 @@ echo "done."
# Set up the correct php.ini content
/usr/local/etc/rc.php_ini_setup
# Perform major updates
for
STAGE
in
B P
;
do
if
opnsense-update -
${
STAGE
}
;
then
# ideally reroot with `-r', but panics on ZFS
reboot
fi
done
# Startup configd
/usr/local/etc/rc.d/configd start
# Restore backups from previous shutdown
for
BACKUP
in
captiveportal dhcpleases netflow rrd
;
do
/usr/local/etc/rc.backup_
${
BACKUP
}
restore
done
# Execute the early syshook / plugin commands
/usr/local/etc/rc.syshook early
...
...
@@ -258,8 +242,6 @@ rm /var/run/booting
# Execute the normal syshook / plugin commands
/usr/local/etc/rc.syshook start
/usr/local/sbin/beep.sh start
/usr/local/etc/rc.initial.banner
exit
0
src/etc/rc.shutdown
View file @
0c10b8f4
#!/bin/sh
# run beep sequence if enabled
/usr/local/sbin/beep.sh stop
# shutdown syshook / plugin scripts
/usr/local/etc/rc.syshook stop
# backup volatile internals
for
BACKUP
in
captiveportal dhcpleases netflow rrd
;
do
/usr/local/etc/rc.backup_
${
BACKUP
}
stop
done
# wait for config lock to release
php
-a
>
/dev/null
<<
EOF
\$
fp = fopen('/conf/config.xml', "a+");
...
...
src/etc/rc.syshook
View file @
0c10b8f4
#!/bin/sh
# Copyright (c) 2015-201
6
Franco Fichtner <franco@opnsense.org>
# Copyright (c) 2015-201
7
Franco Fichtner <franco@opnsense.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
...
...
@@ -54,11 +54,12 @@ for SYSHOOK in ${SYSHOOKS}; do
# extract syshook origin
SYSHOOK
=
${
SYSHOOK
##
"
${
SYSDIR
}
/"
}
SYSHOOK
=
${
SYSHOOK
%%
".
${
SYSLEVEL
}
"
}
SYSNAME
=
${
SYSHOOK
#??-
}
echo
"
rc.syshook(
${
SYSLEVEL
}
): running
${
SYSHOOK
#??-
}
"
echo
"
>>> Invoking
${
SYSLEVEL
}
script '
${
SYSNAME
}
'
"
if
!
${
SYSDIR
}
/
${
SYSHOOK
}
.
${
SYSLEVEL
}
;
then
echo
"
rc.syshook(
${
SYSLEVEL
}
): error in
${
SYSHOOK
#??-
}
"
echo
"
>>> Error in
${
SYSLEVEL
}
script '
${
SYSNAME
}
'
"
fi
done
...
...
src/etc/rc.syshook.d/05-beep.stop
0 → 100755
View file @
0c10b8f4
#!/bin/sh
/usr/local/sbin/beep.sh stop
src/etc/rc.syshook.d/05-update.early
0 → 100755
View file @
0c10b8f4
#!/bin/sh
# Perform major updates
for
STAGE
in
B P
;
do
if
opnsense-update -
${
STAGE
}
;
then
# ideally reroot with `-r', but panics on ZFS
reboot
fi
done
src/etc/rc.syshook.d/10-configd.early
0 → 100755
View file @
0c10b8f4
#!/bin/sh
# Startup configd
/usr/local/etc/rc.d/configd start
src/etc/rc.syshook.d/20-backup.early
0 → 100755
View file @
0c10b8f4
#!/bin/sh
# Restore backups from previous shutdown
for
BACKUP
in
captiveportal dhcpleases netflow rrd
;
do
/usr/local/etc/rc.backup_
${
BACKUP
}
restore
done
src/etc/rc.syshook.d/20-freebsd.start
View file @
0c10b8f4
#!/bin/sh
/usr/local/etc/rc.freebsd start
src/etc/rc.syshook.d/90-backup.stop
0 → 100755
View file @
0c10b8f4
#!/bin/sh
# Backup volatile internals
for
BACKUP
in
captiveportal dhcpleases netflow rrd
;
do
/usr/local/etc/rc.backup_
${
BACKUP
}
stop
done
src/etc/rc.syshook.d/90-cron.start
View file @
0c10b8f4
#!/bin/sh
echo
-n
"Starting Cron: "
configctl cron restart
src/etc/rc.syshook.d/95-beep.start
0 → 100755
View file @
0c10b8f4
#!/bin/sh
/usr/local/sbin/beep.sh start
src/opnsense/service/conf/actions.d/actions_dhcpd.conf
View file @
0c10b8f4
...
...
@@ -3,4 +3,3 @@ command:/usr/local/opnsense/scripts/dhcp/get_leases.py /inactive %s
parameters
:%
s
type
:
script_output
message
:
list
dhcp
leases
%
s
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