在 CentOS7 上将自定义的 jar 包注册为 linux 服务 service

https://blog.csdn.net/weixin_30384031/article/details/97091051?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-1.nonecase&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-1.nonecase

/etc/rc.d/init.d/
G_FOLDER=/home/kxs/logs/resrpc
PID_FOLDER=/home/kxs/logs/resrpc
JAVA_OPTS="-Dfile.encoding=utf-8 -Dspring.profiles.active=local"
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
可以按照以下步骤在CentOS 7上将Docker CE 23.0.1注册为系统服务: 1. 首先,使用以下命令安装Docker CE 23.0.1: ``` sudo yum install docker-ce-23.0.1 ``` 2. 然后,创建一个新的systemd服务文件来启动Docker CE。使用以下命令打开一个新文件: ``` sudo nano /etc/systemd/system/docker.service ``` 3. 将以下内容复制并粘贴到该文件中: ``` [Unit] Description=Docker Application Container Engine Documentation=https://docs.docker.com After=network-online.target docker.socket firewalld.service Wants=network-online.target Requires=docker.socket [Service] Type=notify # the default is not to use systemd for cgroups because the delegate issues still # exists and systemd currently does not support the cgroup feature set required # for containers run by docker ExecStart=/usr/bin/dockerd ExecReload=/bin/kill -s HUP $MAINPID TimeoutSec=0 RestartSec=2 Restart=always # Note that StartLimit* options were moved from "Service" to "Unit" in systemd 229. # Both the old, and new location are accepted by systemd 229 and later, so using the old location # to make them work for either version of systemd. StartLimitBurst=3 # Note that StartLimitInterval was renamed to StartLimitIntervalSec in systemd 230. StartLimitInterval=60s # set delegate yes so that systemd does not reset the cgroups of docker containers Delegate=yes [Install] WantedBy=multi-user.target ``` 4. 保存和关闭该文件。 5. 开启新的systemd服务并使其自动启动: ``` sudo systemctl daemon-reload sudo systemctl enable docker sudo systemctl start docker ``` 6. 确认服务已成功启动: ``` sudo systemctl status docker ``` 如果服务已成功启动,则会显示Active(运行中)状态。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值