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
fd8ad006
Commit
fd8ad006
authored
Sep 10, 2010
by
Devaev Maxim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Exceptions instead _exit()
parent
0ea6e604
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
15 deletions
+10
-15
daemon.py
settingsd/daemon.py
+0
-4
startup.py
settingsd/startup.py
+10
-11
No files found.
settingsd/daemon.py
View file @
fd8ad006
...
@@ -95,10 +95,6 @@ def startDaemon(function, work_dir_path = None, umask = None) :
...
@@ -95,10 +95,6 @@ def startDaemon(function, work_dir_path = None, umask = None) :
os
.
dup2
(
null_fd
,
fd
)
os
.
dup2
(
null_fd
,
fd
)
function
()
function
()
else
:
os
.
_exit
(
1
)
else
:
os
.
_exit
(
1
)
def
killDaemon
()
:
def
killDaemon
()
:
pids_list
=
pidsListOfPythonProc
(
"main.py"
,
[
"-k"
,
"--kill"
],
os
.
getuid
())
# FIXME
pids_list
=
pidsListOfPythonProc
(
"main.py"
,
[
"-k"
,
"--kill"
],
os
.
getuid
())
# FIXME
...
...
settingsd/startup.py
View file @
fd8ad006
...
@@ -55,7 +55,7 @@ class Startup(object) :
...
@@ -55,7 +55,7 @@ class Startup(object) :
except
:
except
:
logger
.
error
(
"Initialization error"
)
logger
.
error
(
"Initialization error"
)
logger
.
attachException
()
logger
.
attachException
()
sys
.
exit
(
1
)
raise
if
self
.
_bus_type
!=
None
:
if
self
.
_bus_type
!=
None
:
config
.
setValue
(
config
.
APPLICATION_SECTION
,
"bus_type"
,
self
.
_bus_type
)
config
.
setValue
(
config
.
APPLICATION_SECTION
,
"bus_type"
,
self
.
_bus_type
)
...
@@ -63,7 +63,7 @@ class Startup(object) :
...
@@ -63,7 +63,7 @@ class Startup(object) :
if
self
.
_log_level
!=
None
:
if
self
.
_log_level
!=
None
:
config
.
setValue
(
config
.
APPLICATION_SECTION
,
"log_level"
,
self
.
_log_level
)
config
.
setValue
(
config
.
APPLICATION_SECTION
,
"log_level"
,
self
.
_log_level
)
def
load
(
self
)
:
def
runInteractive
(
self
)
:
try
:
try
:
self
.
_app
.
loadModules
()
self
.
_app
.
loadModules
()
self
.
_app
.
loadServicesConfigs
()
self
.
_app
.
loadServicesConfigs
()
...
@@ -73,15 +73,14 @@ class Startup(object) :
...
@@ -73,15 +73,14 @@ class Startup(object) :
except
:
except
:
logger
.
error
(
"Initialization error"
)
logger
.
error
(
"Initialization error"
)
logger
.
attachException
()
logger
.
attachException
()
sys
.
exit
(
1
)
raise
###
def
runInteractive
(
self
)
:
self
.
load
()
signal
.
signal
(
signal
.
SIGTERM
,
self
.
quit
)
try
:
signal
.
signal
(
signal
.
SIGQUIT
,
self
.
quit
)
signal
.
signal
(
signal
.
SIGTERM
,
self
.
quit
)
signal
.
signal
(
signal
.
SIGQUIT
,
self
.
quit
)
except
:
logger
.
error
(
"signal() error"
)
logger
.
attachException
()
try
:
try
:
self
.
_app
.
runLoop
()
self
.
_app
.
runLoop
()
...
@@ -91,7 +90,7 @@ class Startup(object) :
...
@@ -91,7 +90,7 @@ class Startup(object) :
logger
.
error
(
"Runtime error, trying to close services"
)
logger
.
error
(
"Runtime error, trying to close services"
)
logger
.
attachException
()
logger
.
attachException
()
self
.
quit
()
self
.
quit
()
sys
.
exit
(
1
)
raise
def
runDaemon
(
self
)
:
def
runDaemon
(
self
)
:
work_dir_path
=
(
"/"
if
os
.
getuid
()
==
0
else
None
)
work_dir_path
=
(
"/"
if
os
.
getuid
()
==
0
else
None
)
...
...
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