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
c4c18bd8
Commit
c4c18bd8
authored
May 20, 2015
by
Ad Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(configd) oops, forgot this part
parent
9ed964ea
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
4 deletions
+17
-4
configd.py
src/opnsense/service/configd.py
+17
-4
No files found.
src/opnsense/service/configd.py
View file @
c4c18bd8
...
...
@@ -39,8 +39,8 @@ __author__ = 'Ad Schellevis'
#
import
os
import
sys
import
ConfigParser
import
modules.processhandler
import
modules.csconfigparser
from
modules.daemonize
import
Daemonize
import
cProfile
,
pstats
...
...
@@ -55,7 +55,7 @@ sys.path.append(program_path)
os
.
chdir
(
program_path
)
# open configuration
cnf
=
ConfigParser
.
ConfigParser
()
cnf
=
modules
.
csconfigparser
.
CS
ConfigParser
()
cnf
.
read
(
'conf/configd.conf'
)
# validate configuration, exit on missing item
...
...
@@ -64,12 +64,25 @@ for config_item in ['socket_filename','pid_filename']:
print
(
'configuration item main/
%
s not found in
%
s/conf/configd.conf'
%
(
config_item
,
program_path
))
sys
.
exit
(
0
)
# setup configd environment to use for all configured actions
if
not
cnf
.
has_section
(
'environment'
):
config_environment
=
os
.
environ
.
copy
()
else
:
config_environment
=
{}
for
envKey
in
cnf
.
items
(
'environment'
):
config_environment
[
envKey
[
0
]]
=
envKey
[
1
]
# run process coordinator ( on console or as daemon )
# if command-line arguments contain "emulate", start in emulation mode
if
len
(
sys
.
argv
)
>
1
and
'simulate'
in
sys
.
argv
[
1
:]:
proc_handler
=
modules
.
processhandler
.
Handler
(
socket_filename
=
cnf
.
get
(
'main'
,
'socket_filename'
),
config_path
=
'
%
s/conf'
%
(
program_path
),
simulation_mode
=
True
)
proc_handler
=
modules
.
processhandler
.
Handler
(
socket_filename
=
cnf
.
get
(
'main'
,
'socket_filename'
),
config_path
=
'
%
s/conf'
%
program_path
,
config_environment
=
config_environment
,
simulation_mode
=
True
)
else
:
proc_handler
=
modules
.
processhandler
.
Handler
(
socket_filename
=
cnf
.
get
(
'main'
,
'socket_filename'
),
config_path
=
'
%
s/conf'
%
(
program_path
))
proc_handler
=
modules
.
processhandler
.
Handler
(
socket_filename
=
cnf
.
get
(
'main'
,
'socket_filename'
),
config_path
=
'
%
s/conf'
%
program_path
,
config_environment
=
config_environment
)
if
len
(
sys
.
argv
)
>
1
and
'console'
in
sys
.
argv
[
1
:]:
print
(
'run
%
s in console mode'
%
sys
.
argv
[
0
])
...
...
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