mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-23 03:02:52 +01:00
Added additional check for pidfile writability to supybot-botchk.
This commit is contained in:
parent
82db19754d
commit
92e2046b81
@ -111,6 +111,13 @@ if __name__ == '__main__':
|
|||||||
debug('Pid %s is not the bot.' % pid)
|
debug('Pid %s is not the bot.' % pid)
|
||||||
|
|
||||||
if not foundBot:
|
if not foundBot:
|
||||||
|
# First, we check if the pidfile is writable. If not, supybot will just exit,
|
||||||
|
# so we go ahead and refuse to start it.
|
||||||
|
try:
|
||||||
|
file(options.pidfile, 'r+')
|
||||||
|
except EnvironmentError, e:
|
||||||
|
fatal('pidfile (%s) is not writable: %s', options.pidfile, e)
|
||||||
|
sys.exit(-1)
|
||||||
debug('Bot not found, starting.')
|
debug('Bot not found, starting.')
|
||||||
home = os.environ['HOME']
|
home = os.environ['HOME']
|
||||||
inst = popen2.Popen4('sh')
|
inst = popen2.Popen4('sh')
|
||||||
|
Loading…
Reference in New Issue
Block a user