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
5035c508
Commit
5035c508
authored
May 16, 2016
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
system: automate proper webgui stop/start; closes #941
parent
08d84231
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
22 deletions
+12
-22
system.inc
src/etc/inc/system.inc
+10
-7
rc.bootup
src/etc/rc.bootup
+1
-1
rc.restart_webgui
src/etc/rc.restart_webgui
+1
-14
No files found.
src/etc/inc/system.inc
View file @
5035c508
...
@@ -999,7 +999,7 @@ EOD;
...
@@ -999,7 +999,7 @@ EOD;
return
$retval
;
return
$retval
;
}
}
function
system_webgui_
start
()
function
system_webgui_
configure
()
{
{
global
$config
;
global
$config
;
...
@@ -1065,10 +1065,13 @@ function system_webgui_start()
...
@@ -1065,10 +1065,13 @@ function system_webgui_start()
$crt
,
$key
,
$ca
,
"lighty-webConfigurator.pid"
,
$portarg
,
"/usr/local/www/"
,
$crt
,
$key
,
$ca
,
"lighty-webConfigurator.pid"
,
$portarg
,
"/usr/local/www/"
,
"cert.pem"
,
"ca.pem"
);
"cert.pem"
,
"ca.pem"
);
/* kill any running lighttpd */
killbypid
(
'/var/run/lighty-webConfigurator.pid'
,
'TERM'
,
$sync
);
killbypid
(
'/var/run/lighty-webConfigurator.pid'
);
sleep
(
1
);
/*
* Force reloading all php-cgi children to
* avoid hiccups with moved include files.
*/
killbyname
(
'php-cgi'
,
'HUP'
);
/* regenerate the php.ini files in case the setup has changed */
/* regenerate the php.ini files in case the setup has changed */
mwexec
(
'/usr/local/etc/rc.php_ini_setup'
);
mwexec
(
'/usr/local/etc/rc.php_ini_setup'
);
...
@@ -1325,7 +1328,7 @@ EOD;
...
@@ -1325,7 +1328,7 @@ EOD;
if
(
$cert
<>
""
and
$key
<>
""
)
{
if
(
$cert
<>
""
and
$key
<>
""
)
{
$fd
=
fopen
(
"/var/etc/
{
$cert_location
}
"
,
"w"
);
$fd
=
fopen
(
"/var/etc/
{
$cert_location
}
"
,
"w"
);
if
(
!
$fd
)
{
if
(
!
$fd
)
{
printf
(
gettext
(
"Error: cannot open cert.pem in system_webgui_start().%s"
),
"
\n
"
);
log_error
(
'Error: cannot open cert.pem in system_webgui_configure()'
);
return
1
;
return
1
;
}
}
chmod
(
"/var/etc/
{
$cert_location
}
"
,
0600
);
chmod
(
"/var/etc/
{
$cert_location
}
"
,
0600
);
...
@@ -1336,7 +1339,7 @@ EOD;
...
@@ -1336,7 +1339,7 @@ EOD;
if
(
!
(
empty
(
$ca
)
||
(
strlen
(
trim
(
$ca
))
==
0
)))
{
if
(
!
(
empty
(
$ca
)
||
(
strlen
(
trim
(
$ca
))
==
0
)))
{
$fd
=
fopen
(
"/var/etc/
{
$ca_location
}
"
,
"w"
);
$fd
=
fopen
(
"/var/etc/
{
$ca_location
}
"
,
"w"
);
if
(
!
$fd
)
{
if
(
!
$fd
)
{
printf
(
gettext
(
"Error: cannot open ca.pem in system_webgui_start().%s"
),
"
\n
"
);
log_error
(
'Error: cannot open ca.pem in system_webgui_configure()'
);
return
1
;
return
1
;
}
}
chmod
(
"/var/etc/
{
$ca_location
}
"
,
0600
);
chmod
(
"/var/etc/
{
$ca_location
}
"
,
0600
);
...
@@ -1381,7 +1384,7 @@ EOD;
...
@@ -1381,7 +1384,7 @@ EOD;
$fd
=
fopen
(
"
{
$filename
}
"
,
"w"
);
$fd
=
fopen
(
"
{
$filename
}
"
,
"w"
);
if
(
!
$fd
)
{
if
(
!
$fd
)
{
printf
(
gettext
(
"Error: cannot open %s in system_generate_lighty_config().%s"
),
$filename
,
"
\n
"
);
log_error
(
sprintf
(
'Error: cannot open %s in system_webgui_configure()'
,
$filename
)
);
return
1
;
return
1
;
}
}
fwrite
(
$fd
,
$lighty_config
);
fwrite
(
$fd
,
$lighty_config
);
...
...
src/etc/rc.bootup
View file @
5035c508
...
@@ -265,7 +265,7 @@ local_sync_accounts();
...
@@ -265,7 +265,7 @@ local_sync_accounts();
echo
"done.
\n
"
;
echo
"done.
\n
"
;
/* start web server */
/* start web server */
echo
'Starting webConfigurator...'
.
(
system_webgui_
start
()
?
'done.'
:
'failed.'
)
.
PHP_EOL
;
echo
'Starting webConfigurator...'
.
(
system_webgui_
configure
()
?
'done.'
:
'failed.'
)
.
PHP_EOL
;
/* configure cron service */
/* configure cron service */
echo
"Configuring CRON..."
;
echo
"Configuring CRON..."
;
...
...
src/etc/rc.restart_webgui
View file @
5035c508
...
@@ -16,20 +16,7 @@ system_firmware_configure();
...
@@ -16,20 +16,7 @@ system_firmware_configure();
echo
'Restarting webConfigurator...'
;
echo
'Restarting webConfigurator...'
;
killbyname
(
'lighttpd'
);
system_webgui_configure
();
/*
* Force reloading all php-cgi children to
* avoid hiccups with moved include files.
*/
killbyname
(
'php-cgi'
,
'HUP'
);
while
(
is_process_running
(
'lighttpd'
))
{
echo
'.'
;
sleep
(
1
);
}
system_webgui_start
();
enable_rrd_graphing
();
enable_rrd_graphing
();
echo
'done.'
.
PHP_EOL
;
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