Skip to content

Commit

Permalink
Update daemon.py
Browse files Browse the repository at this point in the history
  • Loading branch information
msinn authored May 11, 2019
1 parent 5f5af4c commit 1b2cb3e
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions lib/daemon.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env python3
#########################################################################
# Copyright 2013 Marcus Popp [email protected]
# Copyright 2016- Christian Strassburg [email protected]
#########################################################################
# This file is part of SmartHomeNG.
Expand Down Expand Up @@ -137,16 +136,6 @@ def read_pidfile(pidfile):
:return: PID of SmartHomeNG or 0 if it is not running
:rtype: int
"""
<<<<<<< HEAD

if os.path.isfile(pidfile):
try:
fd = open(pidfile,'r')
line = fd.readline()
return int(line)
except:
return 0 #happens if pid-file could not be opened or is empty (i.e. disc was full)
=======

try:
if os.path.isfile(pidfile):
Expand All @@ -156,7 +145,6 @@ def read_pidfile(pidfile):
return pid
except ValueError:
logger.warning("PID could not be read, maybe a false write or a corrupt filesystem? Please check the file system ASAP!")
>>>>>>> origin/release-1.6
return 0


Expand Down Expand Up @@ -213,3 +201,4 @@ def kill(pidfile, waittime=15):
if p.is_running():
logger.warning("Killing process")
p.kill()

0 comments on commit 1b2cb3e

Please sign in to comment.