do not allow restart on windows

This commit is contained in:
Kevin Froman 2020-02-05 20:31:38 -06:00
parent 938e1bddd3
commit 7c7e5de091
10 changed files with 83 additions and 11 deletions

View file

@ -36,6 +36,10 @@ SCRIPT_NAME = os.path.dirname(os.path.realpath(
def restart():
"""Tell the Onionr daemon to restart."""
if platform.system() == 'Windows':
logger.warn('Cannot restart Onionr on Windows. Run stop and manually restart.', terminal=True)
return
logger.info('Restarting Onionr', terminal=True)
# On platforms where we can, fork out to prevent locking
@ -44,8 +48,7 @@ def restart():
if pid != 0:
return
except (AttributeError, OSError):
if platform.platform() != 'Windows':
logger.warn('Could not fork on restart')
logger.warn('Could not fork on restart')
daemonlaunch.kill_daemon()
while localcommand.local_command('ping', maxWait=8) == 'pong!':