1.进入服务配置文件
cd /etc/systemd/system/
2.根据如下操作进行(注意每一步注释)
# 1.创建服务配置文件vim tool.service
#2.按 i 进入编辑模式把下面内容复制进去#3.加入下面内容如下
#表示基础信息
[Unit]
#描述
Description=tool-service
#在哪个服务之后启动
After=syslog.target network.target remote-fs.target nss-lookup.target
#表示服务信息
[Service]
Type=simple
User=root
Group=root
#根据自己实际情况写java 环境 jar 包路径 启动配置文件等信息
ExecStart=/usr/java/jdk1.8.0_131/bin/java -jar /opt/tool/tool.jar --spring.profiles.active=pro
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s QUIT $MAINPID
PrivateTmp=true
#安装相关信息
[Install]
WantedBy=multi-user.target
#4. 按esc 键退出编辑模式, 在输入命令 :wq 就保存好了
3:对于systemctl基本常用服务操作
#启动服务
systemctl start tool #或者systemctl start tool.service
#停止服务
systemctl stop tool #或者systemctl stop tool.service
#服务状态
systemctl status tool #或者systemctl status tool.service
#开机启动
systemctl enable tool #或者systemctl enable tool.service
#项目日志
journalctl -u tool #或者journalctl -u tool.service
#开机时禁用服务
systemctl disable tool.service
#查看服务是否开机启动:
systemctl is-enabled app-run.service
#查看已启动的服务列表:
systemctl list-unit-files|grep enabled网友回复
开源ai大模型文件格式GGUF、MLX、Safetensors、 ONNX 有什么区别?
出海挣钱支付收款PayPal、Wise 、PingPong、Stripe如何选择?
如何实现类似google的图片隐形水印添加和识别技术?
linux上如何运行任意windows程序?
ai能写出比黑客还厉害的零日漏洞等攻击工具攻击任意软件系统工程?
js如何获取浏览器的音频上下文指纹、Canvas指纹、WebGL渲染特征?
为啥ai开始抛弃markdown文本,重新偏好html文本了?
网站有没有办法鉴别访问请求是由ai操控chrome-devtools-mcp发出的?
有没有python自动操作浏览器让网站无法鉴别是机器行为?
为啥最新由Meta / 斯坦福 / 哈佛出的ProgramBench基准GPT-5.4、Claude Opus 4.7、Gemini 3.1 Pro 等全部 0% 通过率?


