Merge pull request #43366 from brejoc/2016.11.pidfile-fix

Catching error when PIDfile cannot be deleted
This commit is contained in:
Mike Place 2017-09-12 09:31:15 -06:00 committed by GitHub
commit 90e8ca9c36

View file

@ -882,7 +882,14 @@ class DaemonMixIn(six.with_metaclass(MixInMeta, object)):
# We've loaded and merged options into the configuration, it's safe
# to query about the pidfile
if self.check_pidfile():
os.unlink(self.config['pidfile'])
try:
os.unlink(self.config['pidfile'])
except OSError as err:
self.info(
'PIDfile could not be deleted: {0}'.format(
self.config['pidfile']
)
)
def set_pidfile(self):
from salt.utils.process import set_pidfile