zoukankan      html  css  js  c++  java
  • 将 spring boot 安装为 systemd 服务

    [root@ecs-11-132 system]# cat /etc/systemd/system/push-gateway-3.0.0.service 
    [Unit]
    Description=app-portal.service
    After=network.target
    
    [Service]
    User=root
    Group=root
    ExecStart=/etc/systemd/system/jenkins/push-gateway-3.0.0.sh
    SuccessExitStatus=143
    RestartSec=10
    Restart=on-failure
    
    [Install]
    WantedBy=multi-user.target
    
    [root@ecs-11-132 system]# cat /etc/systemd/system/jenkins/push-gateway-3.0.0.sh 
    #!/bin/bash
    
    /usr/local/jdk/bin/java -server -Xmx512m -Xms512m -Xmn256m -XX:PermSize=128m -Xss256k -XX:+DisableExplicitGC -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:+UseCMSCompactAtFullCollection -XX:LargePageSizeInBytes=128m -XX:+UseFastAccessorMethods -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=70 -jar /data/micros/push-gateway-3.0.0/push-gateway-3.0.0.jar  >> /data/logs/micros/push-gateway-3.0.0.log 2>&1
    

    管理

    systemctl daemon-reload
    systemctl start push-gateway-3.0.0
    

    查看状态

    [root@ecs-11-132 system]# systemctl status push-gateway-3.0.0
    ● push-gateway-3.0.0.service - app-portal.service
       Loaded: loaded (/etc/systemd/system/push-gateway-3.0.0.service; disabled; vendor preset: disabled)
       Active: active (running) since Fri 2019-11-01 17:48:06 CST; 1 weeks 0 days ago
     Main PID: 46557 (push-gateway-3.)
        Tasks: 47
       Memory: 868.7M
       CGroup: /system.slice/push-gateway-3.0.0.service
               ├─46557 /bin/bash /etc/systemd/system/jenkins/push-gateway-3.0.0.sh
               └─46558 /usr/local/jdk/bin/java -server -Xmx512m -Xms512m -Xmn256m -XX:PermSize=128m -Xss256k -XX:+DisableExplicitGC -XX:...
    
    Nov 01 17:48:06 ecs-11-132 systemd[1]: Started app-portal.service.
    
  • 相关阅读:
    win32获取其它进程变量地址存放的信息
    c#中的组件拖拽和MouseMove事件
    C# 使用消息驱动
    python使用dbm持久字典详解
    python http请求
    Windows 7下解决因为itunes备份导致C盘过度臃肿问题
    鼠标形状
    IE Haslayout 详解摘自网友
    Zoom属性摘自网友
    css公共属性
  • 原文地址:https://www.cnblogs.com/fsckzy/p/11824777.html
Copyright © 2011-2022 走看看