mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #43366 from brejoc/2016.11.pidfile-fix
Catching error when PIDfile cannot be deleted
This commit is contained in:
commit
90e8ca9c36
1 changed files with 8 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue