Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
settingsd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
settingsd
Commits
a18849e0
Commit
a18849e0
authored
Oct 11, 2010
by
Devaev Maxim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Most verbosity server messages
parent
2683970b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
application.py
settingsd/application.py
+14
-0
No files found.
settingsd/application.py
View file @
a18849e0
...
...
@@ -35,8 +35,10 @@ class Application(object) :
def
run
(
self
)
:
self
.
prepare
()
if
self
.
_daemon_mode_flag
:
logger
.
info
(
"Run server in daemon mode"
)
self
.
runDaemon
()
else
:
logger
.
info
(
"Run server in interactive mode"
)
self
.
runInteractive
()
def
server
(
self
)
:
...
...
@@ -60,9 +62,11 @@ class Application(object) :
if
self
.
_daemon_mode_flag
:
syslog
.
openlog
(
const
.
MY_NAME
,
syslog
.
LOG_PID
,
syslog
.
LOG_DAEMON
)
config
.
setValue
(
config
.
RUNTIME_SECTION
,
"use_syslog"
,
True
)
logger
.
verbose
(
"Logger used syslog"
)
else
:
syslog
.
openlog
(
const
.
MY_NAME
,
syslog
.
LOG_PID
,
(
syslog
.
LOG_DAEMON
if
self
.
_daemon_mode_flag
else
syslog
.
LOG_USER
))
config
.
setValue
(
config
.
RUNTIME_SECTION
,
"use_syslog"
,
True
)
logger
.
verbose
(
"Logger used syslog"
)
try
:
self
.
_server
.
loadServerConfigs
()
...
...
@@ -70,6 +74,7 @@ class Application(object) :
logger
.
error
(
"Initialization error"
)
logger
.
attachException
()
raise
logger
.
verbose
(
"Preparing complete"
)
if
self
.
_bus_type
!=
None
:
config
.
setValue
(
config
.
APPLICATION_SECTION
,
"bus_type"
,
self
.
_bus_type
)
...
...
@@ -107,11 +112,20 @@ class Application(object) :
except
:
logger
.
error
(
"Runtime error, trying to close services"
)
logger
.
attachException
()
try
:
self
.
quit
()
except
:
logger
.
attachException
()
raise
raise
def
runDaemon
(
self
)
:
work_dir_path
=
(
"/"
if
os
.
getuid
()
==
0
else
None
)
umask
=
(
077
if
os
.
getuid
()
==
0
else
None
)
logger
.
info
(
"Run server as daemon: uid=
%
d, dir=
%
s, umask=
%
s"
%
(
os
.
getuid
(),
(
work_dir_path
if
work_dir_path
!=
None
else
os
.
getcwd
()
),
(
str
(
umask
)
if
umask
!=
None
else
"
%.4
x"
%
os
.
umask
(
-
1
)
)
))
daemon
.
startDaemon
(
self
.
runInteractive
,
work_dir_path
,
umask
)
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