Beispiel #1
0
def log_command(
    port=8825,
    host="127.0.0.1",
    chroot=False,
    chdir=".",
    uid=False,
    gid=False,
    umask=False,
    pid="./run/log.pid",
    FORCE=False,
    debug=False,
    daemon=True,
):
    """
    Runs a logging only server on the given hosts and port.  It logs
    each message it receives and also stores it to the run/queue 
    so that you can make sure it was received in testing.

    salmon log -port 8825 -host 127.0.0.1 \\
            -pid ./run/log.pid -chroot False  \\
            -chdir "." -umask False -uid False -gid False \\
            -FORCE False -daemon True

    If you specify a uid/gid then this means you want to first change to
    root, set everything up, and then drop to that UID/GID combination.
    This is typically so you can bind to port 25 and then become "safe"
    to continue operating as a non-root user.

    If you give one or the other, this it will just change to that
    uid or gid without doing the priv drop operation.
    """
    loader = lambda: utils.make_fake_settings(host, port)
    utils.start_server(pid, FORCE, chroot, chdir, uid, gid, umask, loader, debug, daemon)
Beispiel #2
0
def log_command(port=8825,
                host='127.0.0.1',
                chroot=False,
                chdir=".",
                uid=False,
                gid=False,
                umask=False,
                pid="./run/log.pid",
                FORCE=False,
                debug=False):
    """
    Runs a logging only server on the given hosts and port.  It logs
    each message it receives and also stores it to the run/queue 
    so that you can make sure it was received in testing.

    salmon log -port 8825 -host 127.0.0.1 \\
            -pid ./run/log.pid -chroot False  \\
            -chdir "." -umask False -uid False -gid False \\
            -FORCE False

    If you specify a uid/gid then this means you want to first change to
    root, set everything up, and then drop to that UID/GID combination.
    This is typically so you can bind to port 25 and then become "safe"
    to continue operating as a non-root user.

    If you give one or the other, this it will just change to that
    uid or gid without doing the priv drop operation.
    """
    loader = lambda: utils.make_fake_settings(host, port)
    utils.start_server(pid, FORCE, chroot, chdir, uid, gid, umask, loader,
                       debug)
Beispiel #3
0
def start(pid, force, chdir, boot, chroot, uid, gid, umask, debug, daemon):
    """
    Runs a salmon server out of the current directory
    """
    utils.start_server(pid, force, chroot, chdir, uid, gid, umask,
                       lambda: utils.import_settings(True, boot_module=boot),
                       debug, daemon)
Beispiel #4
0
def log(port, host, pid, chdir, chroot, uid, gid, umask, force, debug, daemon):
    """
    Runs a logging only server on the given hosts and port.  It logs
    each message it receives and also stores it to the run/queue
    so that you can make sure it was received in testing.
    """
    utils.start_server(pid, force, chroot, chdir, uid, gid, umask,
                       lambda: utils.make_fake_settings(host, port), debug, daemon)
Beispiel #5
0
def start_command(pid='./run/smtp.pid', FORCE=False, chroot=False, chdir=".",
                  boot="config.boot", uid=False, gid=False, umask=False, debug=False):
    """
    Runs a salmon server out of the current directory:

    salmon start -pid ./run/smtp.pid -FORCE False -chroot False -chdir "." \\
            -umask False -uid False -gid False -boot config.boot
    """
    loader = lambda: utils.import_settings(True, from_dir=os.getcwd(), boot_module=boot)
    utils.start_server(pid, FORCE, chroot, chdir, uid, gid, umask, loader, debug)
Beispiel #6
0
 def command(pid,
             force,
             chdir,
             boot,
             chroot=False,
             uid=False,
             gid=False,
             umask=False,
             debug=False,
             daemon=True):
     loader = lambda: utils.import_settings(True, boot_module=boot)
     utils.start_server(pid, force, chroot, chdir, uid, gid, umask, loader,
                        debug, daemon)
Beispiel #7
0
 def command(port,
             host,
             pid,
             chdir,
             chroot=None,
             uid=False,
             gid=False,
             umask=False,
             force=False,
             debug=False,
             daemon=True):
     loader = lambda: utils.make_fake_settings(host, port)
     utils.start_server(pid, force, chroot, chdir, uid, gid, umask, loader,
                        debug, daemon)
Beispiel #8
0
def start_command(pid='./run/smtp.pid',
                  FORCE=False,
                  chroot=False,
                  chdir=".",
                  boot="config.boot",
                  uid=False,
                  gid=False,
                  umask=False,
                  debug=False):
    """
    Runs a salmon server out of the current directory:

    salmon start -pid ./run/smtp.pid -FORCE False -chroot False -chdir "." \\
            -umask False -uid False -gid False -boot config.boot
    """
    loader = lambda: utils.import_settings(
        True, from_dir=os.getcwd(), boot_module=boot)
    utils.start_server(pid, FORCE, chroot, chdir, uid, gid, umask, loader,
                       debug)
Beispiel #9
0
 def command(port, host, pid, chdir, chroot=None, uid=False, gid=False, umask=False,
             force=False, debug=False, daemon=True):
     utils.start_server(pid, force, chroot, chdir, uid, gid, umask,
                        lambda: utils.make_fake_settings(host, port), debug, daemon)
Beispiel #10
0
 def command(pid, force, chdir, boot, chroot=False, uid=False, gid=False, umask=False, debug=False, daemon=True):
     utils.start_server(pid, force, chroot, chdir, uid, gid, umask,
                        lambda: utils.import_settings(True, boot_module=boot), debug, daemon)
Beispiel #11
0
 def command(pid, force, chdir, boot, chroot=False, uid=False, gid=False, umask=False, debug=False, daemon=True):
     loader = lambda: utils.import_settings(True, from_dir=os.getcwd(), boot_module=boot)
     utils.start_server(pid, force, chroot, chdir, uid, gid, umask, loader, debug, daemon)