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
f43baf4a
Commit
f43baf4a
authored
Jun 22, 2015
by
Ad Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
also let configctl wait for configd to start (
https://github.com/opnsense/core/issues/218
)
parent
b282f65d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
configd_ctl.py
src/opnsense/service/configd_ctl.py
+11
-0
No files found.
src/opnsense/service/configd_ctl.py
View file @
f43baf4a
...
@@ -38,10 +38,12 @@ import os.path
...
@@ -38,10 +38,12 @@ import os.path
import
traceback
import
traceback
import
syslog
import
syslog
import
sys
import
sys
import
time
__author__
=
'Ad Schellevis'
__author__
=
'Ad Schellevis'
configd_socket_name
=
'/var/run/configd.socket'
configd_socket_name
=
'/var/run/configd.socket'
configd_socket_wait
=
20
def
exec_config_cmd
(
exec_command
):
def
exec_config_cmd
(
exec_command
):
...
@@ -90,6 +92,14 @@ if len(sys.argv) <= 1:
...
@@ -90,6 +92,14 @@ if len(sys.argv) <= 1:
sys
.
exit
(
0
)
sys
.
exit
(
0
)
# check if configd socket exists
# check if configd socket exists
# (wait for a maximum of "configd_socket_wait" seconds for configd to start)
i
=
0
while
not
os
.
path
.
exists
(
configd_socket_name
):
if
i
>=
configd_socket_wait
:
break
time
.
sleep
(
1
)
i
+=
1
if
not
os
.
path
.
exists
(
configd_socket_name
):
if
not
os
.
path
.
exists
(
configd_socket_name
):
print
(
'configd socket missing (@
%
s)'
%
configd_socket_name
)
print
(
'configd socket missing (@
%
s)'
%
configd_socket_name
)
sys
.
exit
(
-
1
)
sys
.
exit
(
-
1
)
...
@@ -108,3 +118,4 @@ else:
...
@@ -108,3 +118,4 @@ else:
if
result
is
None
:
if
result
is
None
:
sys
.
exit
(
-
1
)
sys
.
exit
(
-
1
)
print
(
'
%
s'
%
(
result
))
print
(
'
%
s'
%
(
result
))
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