每个用户的无痛守护进程管理器

nocrux的Python项目详细描述


概要

usage: nocrux [-h] [-e] [-l] [-f] [--sudo] [--as AS_] [--stderr] [--version]
              [daemon] [command]

  Nocrux is a daemon process manager that is easy to configure and can
  operate on the user- or root-level. The nocrux configuration syntax is
  similar to Nginx. All users configuration file is in ~/.nocrux/conf,
  except for the root user, which is in /etc/nocrux/conf.

  This will start your $EDITOR to open the configuration file:

      $ nocrux -e

  The main namespace has the options and default values below:

      root ~/.nocrux/run;
      kill_timeout 10;

  You can also include other files like this (relative paths are considered
  relative to the configuration file):

      include ~/more-nocrux-config.txt;

  To configure a new daemon, you start a `daemon` section, specify the name
  and then the daemon's options in the news scope.

      daemon jupyter {
        cwd ~;
        run jupyter notebook;
      }

  You can now start the daemon with:

      $ nocrux jupyter start
      [nocrux]: (jupyter) starting "jupyter notebook"
      [nocrux]: (jupyter) started (pid: 10117)

  The following commands are available for all daemons:

    - start
    - stop
    - restart
    - status
    - pid
    - cat
    - tail

  You can specify additional commands like this:

      daemon jupyter {
        cwd ~;
        run jupyter notebook;
        command uptime echo $(($(date +%s) - $(date +%s -r $DAEMON_PIDFILE))) seconds;
      }

  Now to run this command:

      $ nocrux jupyter uptime;
      3424 seconds;

  Here's a daemon configuration with all available options and the
  respective default or example values:

      daemon test {
        # Example values:
        export PATH=/usr/sbin:$PATH;
        export DEBUG=1;
        run ~/Desktop/mytestdaemon.sh arg1 "arg 2";
        cwd ~;
        command uptime echo $(($(date +%s) - $(date +%s -r $DAEMON_PIDFILE))) seconds;
        requires daemon1 daemon2;

        # Options with their respective defaults:
        user me;
        group me;
        stdin /dev/null;
        stdout $root/$name.out;
        stderr $stdout;
        pidfile $root/$name.pid;
        signal term TERM;
        signal kill KILL;
      }

positional arguments:
  daemon        The name of the daemon.
  command       A command to execute on the specified daemon.

optional arguments:
  -h, --help    show this help message and exit
  -e, --edit    Edit the nocrux configuration file.
  -l, --list    List up all daemons and their status.
  -f, --follow  Pass -f to the tail command.
  --sudo        Re-invoke the same command with sudo.
  --as AS_      Run the command as the specified user. Overrides --sudo.
  --stderr      Choose stderr instead of stdout for the cat/tail command.
  --version     Print the nocrux version and exit.

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java如何使用JNA创建同一库的多个实例?   java在将Graphql查询作为JSON字符串传递时收到意外的令牌错误   OAuth2 oltu的java问题   java桌面应用程序使用的好的嵌入式数据库是什么?   java Firebase数据库高级查询选项   java正在使磁盘上的EhCache元素过期   java 安卓还原处于backstack中的片段的实例状态   XMemcached中的java异步集   java TimescaleDB是否使用与Postgresql完全相同的JDBC驱动程序?   java从网站c读取信息#   检查java Android中的字符串是否只包含数字和空格   c#如何向web服务发送特殊字符?   grails无法调用需要java的方法。lang.类参数?   java我在组合框中调用的方法不会运行所有代码,它只运行部分代码   java发送带有标头的HTTP GET请求