3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-01 01:09:22 +01:00

launcher: disable pid check by default

I'm postponing this until PyLink 2.0 to make migration from 1.0.x to 1.1 less of a nuisance.

Closes #364.
This commit is contained in:
James Lu 2016-12-16 20:55:09 -08:00
parent 7e37a90c80
commit 231fd13429

8
pylink
View File

@ -21,7 +21,7 @@ if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Starts an instance of PyLink IRC Services.')
parser.add_argument('config', help='specifies the path to the config file (defaults to pylink.yml)', nargs='?', default='pylink.yml')
parser.add_argument("-v", "--version", help="displays the program version and exits", action='store_true')
parser.add_argument("-c", "--no-check-pid", help="disables PID file checking", action='store_true')
parser.add_argument("-c", "--check-pid", help="enables PID file checking", action='store_true')
parser.add_argument("-n", "--no-pid", help="skips generating PID files", action='store_true')
args = parser.parse_args()
@ -44,9 +44,9 @@ if __name__ == '__main__':
elif os.name == 'posix':
sys.stdout.write("\x1b]2;PyLink %s\x07" % __version__)
# Check for a pid file, unless told not to,
# this stops instance overlap, which wrecks clientbots
if not args.no_check_pid:
# Check for a pid file. This stops instance overlap and user mistakes, which are especially an
# issue for clientbot...
if args.check_pid:
config = conf.confname
if os.path.exists("%s.pid" % config):
log.error("PID file exists; aborting! If PyLink didn't shut down cleanly last time it "