zoukankan      html  css  js  c++  java
  • 用systemd脚本自动启动node js程序

    vi /usr/lib/systemd/system/pano.service

    [Unit]
    Description=pano - main site of site_name.com
    Documentation=http://www.site_name.com/docs/
    
    [Service]
    ExecStart=/usr/local/bin/node /www/www.site_name.com/node/bin/www
    ExecStop=/bin/kill -s QUIT $MAINPID
    Restart=always
    StandardOutput=syslog
    StandardError=syslog
    SyslogIdentifier=nobody
    User=nobody
    Group=nobody
    Environment=NODE_ENV=production
    
    [Install]
    WantedBy=multi-user.target
    # systemctl enable pano
    # systemctl start pano

    nginx的启动脚本/usr/lib/systemd/system/nginx.service

    [Unit]
    Description=nginx - high performance web server
    Documentation=http://nginx.org/en/docs/
    After=network.target remote-fs.target nss-lookup.target
     
    [Service]
    Type=forking
    PIDFile=/run/nginx.pid
    ExecStartPre=/usr/sbin/nginx -t -c /etc/nginx/nginx.conf
    ExecStart=/usr/sbin/nginx -c /etc/nginx/nginx.conf
    ExecReload=/bin/kill -s HUP $MAINPID
    ExecStop=/bin/kill -s QUIT $MAINPID
    PrivateTmp=true
     
    [Install]
    WantedBy=multi-user.target
  • 相关阅读:
    stm32 IO模式
    stm32的ADC
    bsp
    stm32的硬件调试设置
    RTC实时时钟
    快手2019笔试题 “回文子串" 解题思路
    C++内存修改器开源代码
    FC游戏修改教程(hack)小白文。
    GLFW+GLEW搭建opengl环境(备忘)
    8086 IO读写操作
  • 原文地址:https://www.cnblogs.com/afxcn/p/4013714.html
Copyright © 2011-2022 走看看