赞
踩
[Unit]
Description=xxx Service # 服务名称
After=multi-user.target
[Service]
Type=idle
ExecStart=/usr/local/python/bin/python3.6 /data/test/xxx.py # python与python脚本所在的位置
[Install]
WantedBy=multi-user.target
chmod 644 /usr/lib/systemd/system/xxx.service # 配置权限
systemctl daemon-reload #重载服务列表
systemctl enable xxx.service #设置开机自启动
systemctl start xxx.service #开启服务
systemctl status xxx.service #查看服务是否正常运行
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。