How to run meteor on startup on Ubuntu server

前端 未结 3 577
[愿得一人]
[愿得一人] 2021-02-06 09:03

I learn meteorjs and I have a small remote VPS.

I want:

  1. Set auto pulling from git repository my meteor project.
  2. Put script into auto start which r
3条回答
  •  梦毁少年i
    2021-02-06 09:26

    This is my meteorjs.conf file - works fine. I had all described issues before, but this variant fix them. Hope it helps somebody :)

    All EXPORT variables I got by printenv

    # meteorjs - meteorjs job file
    
    description "MeteorJS"
    author "Alex Babichev"
    
    # When to start the service
    start on runlevel [2345]
    
    # When to stop the service
    stop on runlevel [016]
    
    # Automatically restart process if crashed
    respawn
    
    # Essentially lets upstart know the process will detach itself to the background
    expect fork
    
    chdir /home/dev/www/test
    
    script
    
    export MONGO_URL=mongodb://localhost:27017/meteor
    export PATH=/opt/local/bin:/opt/local/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
    export PWD=/home/sputnik
    export NODE_PATH=/usr/lib/nodejs:/usr/lib/node_modules:/usr/share/javascript
    export HOME=/home/sputnik
    
    echo "---- start ----"
    cd /home/dev/www/test
    exec mrt
    
    end script
    

提交回复
热议问题