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
5427a3d6
Commit
5427a3d6
authored
Apr 01, 2015
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rc: try refreshing php-cgi through SIGHUP instead
parent
5c2589ce
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
32 additions
and
34 deletions
+32
-34
util.inc
src/etc/inc/util.inc
+15
-15
rc.initial
src/etc/rc.initial
+1
-1
rc.initial.firmware
src/etc/rc.initial.firmware
+1
-1
rc.initial.setlanip
src/etc/rc.initial.setlanip
+1
-1
rc.restart_webgui
src/etc/rc.restart_webgui
+14
-16
No files found.
src/etc/inc/util.inc
View file @
5427a3d6
...
...
@@ -26,18 +26,26 @@
POSSIBILITY OF SUCH DAMAGE.
*/
function
killby
pid
(
$pidfil
e
,
$sig
=
'TERM'
)
function
killby
name
(
$procnam
e
,
$sig
=
'TERM'
)
{
/* return 1 for success and 0 for a failure */
if
(
!
is_process_running
(
$procname
))
{
return
;
}
if
(
file_exists
(
$pidfile
))
{
return
mwexecf
(
'/bin/pkill -%s -F %s'
,
array
(
$sig
,
$pidfile
),
true
);
mwexecf
(
'/bin/pkill -%s %s'
,
array
(
$sig
,
$procname
));
}
function
killbypid
(
$pidfile
,
$sig
=
'TERM'
)
{
if
(
!
file_exists
(
$pidfile
))
{
return
;
}
return
0
;
mwexecf
(
'/bin/pkill -%s -F %s'
,
array
(
$sig
,
$pidfile
))
;
}
function
isvalidpid
(
$pidfile
)
{
function
isvalidpid
(
$pidfile
)
{
$output
=
""
;
if
(
file_exists
(
$pidfile
))
{
exec
(
"/bin/pgrep -nF
{
$pidfile
}
"
,
$output
,
$retval
);
...
...
@@ -53,14 +61,6 @@ function is_process_running($process)
return
(
intval
(
$retval
)
==
0
);
}
/* kill a process by name */
function
killbyname
(
$procname
)
{
if
(
is_process_running
(
$procname
))
{
mwexec
(
'/usr/bin/killall '
.
escapeshellarg
(
$procname
));
}
}
function
is_subsystem_dirty
(
$subsystem
=
''
)
{
if
(
$subsystem
==
''
)
{
...
...
@@ -987,7 +987,7 @@ function mwexecf($format, $args = array(), $mute = false, $clearsigmask = false)
$args
[
$id
]
=
escapeshellarg
(
$arg
);
}
mwexec
(
vsprintf
(
$format
,
$args
),
$mute
,
$clearsigmask
);
return
mwexec
(
vsprintf
(
$format
,
$args
),
$mute
,
$clearsigmask
);
}
/* wrapper for exec() */
...
...
src/etc/rc.initial
View file @
5427a3d6
...
...
@@ -87,7 +87,7 @@ case ${opmode} in
/usr/sbin/tcpdump
-s
256
-v
-S
-l
-n
-e
-ttt
-i
pflog0
;;
11
)
/usr/local/etc/rc.restart_webgui
please
/usr/local/etc/rc.restart_webgui
;;
12
)
/usr/local/etc/rc.initial.firmware
...
...
src/etc/rc.initial.firmware
View file @
5427a3d6
...
...
@@ -47,7 +47,7 @@ pkg upgrade -y
echo
# restart the GUI after PHP changes have been applied
/usr/local/etc/rc.restart_webgui
please
/usr/local/etc/rc.restart_webgui
echo
...
...
src/etc/rc.initial.setlanip
View file @
5427a3d6
...
...
@@ -460,7 +460,7 @@ if (!$dry_run) {
services_dhcpd_configure
();
}
if
(
$restart_webgui
)
{
mwexec
(
'/usr/local/etc/rc.restart_webgui
please
'
);
mwexec
(
'/usr/local/etc/rc.restart_webgui'
);
}
}
...
...
src/etc/rc.restart_webgui
View file @
5427a3d6
#!/usr/local/bin/php
<?php
require_once
(
"config.inc"
);
require_once
(
"functions.inc"
);
require_once
(
"shaper.inc"
);
require_once
(
"captiveportal.inc"
);
require_once
(
"rrd.inc"
);
require_once
(
'config.inc'
);
require_once
(
'functions.inc'
);
require_once
(
'shaper.inc'
);
require_once
(
'captiveportal.inc'
);
require_once
(
'rrd.inc'
);
echo
"Restarting webConfigurator..."
;
echo
'Restarting webConfigurator...'
;
killbyname
(
"lighttpd"
);
killbyname
(
'lighttpd'
);
if
(
$argc
>
1
)
{
/*
* Force killing all php-cgi children as well
* to avoid hiccups with moved include files.
*/
killbyname
(
"php-cgi"
);
}
/*
* Force reloading all php-cgi children to
* avoid hiccups with moved include files.
*/
killbyname
(
'php-cgi'
,
'HUP'
);
while
(
is_process_running
(
"lighttpd"
))
{
while
(
is_process_running
(
'lighttpd'
))
{
echo
'.'
;
sleep
(
1
);
}
...
...
@@ -28,4 +26,4 @@ system_webgui_start();
captiveportal_init_webgui
();
enable_rrd_graphing
();
echo
"done.
\n
"
;
echo
'done.'
.
PHP_EOL
;
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