Forgot to specify default value for daemon pidfile

This commit is contained in:
Gina Häußge 2015-10-29 09:53:15 +01:00
parent 9c56b2fd4e
commit 4476545a55
2 changed files with 7 additions and 2 deletions

View file

@ -74,7 +74,7 @@ def set_ctx_obj_option(ctx, param, value):
@hidden_option("--port", type=click.INT)
@hidden_option("--logging", type=click.Path())
@hidden_option("--daemon", type=click.Choice(["start", "stop", "restart"]))
@hidden_option("--pid", type=click.Path())
@hidden_option("--pid", type=click.Path(), default="/tmp/octoprint.pid")
@hidden_option("--iknowwhatimdoing", "allow_root", is_flag=True)
@click.version_option(version=octoprint.__version__)
@click.pass_context

View file

@ -58,7 +58,7 @@ def serve_command(obj, host, port, logging, allow_root, debug):
@server_commands.command(name="daemon")
@click.option("--pid", type=click.Path(),
@click.option("--pid", type=click.Path(), default="/tmp/octoprint.pid",
help="Pidfile to use for daemonizing.")
@click.option("--host", type=click.STRING,
help="Specify the host on which to bind the server.")
@ -84,6 +84,11 @@ def daemon_command(octoprint_ctx, pid, host, port, logging, allow_root, debug, c
file=sys.stderr)
sys.exit(2)
if pid is None:
click.echo("No path to a pidfile set",
file=sys.stderr)
sys.exit(1)
from octoprint.daemon import Daemon
class OctoPrintDaemon(Daemon):
def __init__(self, pidfile, basedir, configfile, host, port, debug, allow_root, logging_config, verbosity):