Nacos自啟指令碼
1、建立服務指令碼檔案
vim /etc/systemd/system/nacos.serivce
2、過載指令碼檔案
sudo systemctl daemon-reload
3、建立自啟
sudo systemctl enable nacos
4、具體的指令碼檔案如下
[Unit]
Description=Nacos Server
After=network.target
Service
Type=forking
User=root
Group=root
ExecStart=/bin/bash -c '/tools/nacos/bin/startup.sh'
ExecStop=/bin/bash -c '/tools/nacos/bin/shutdown.sh'
Restart=on-failure
RestartSec=5
Install
WantedBy=multi-user.target
5、重啟指令
sudo systemctl restart nacos
6、檢視狀態
sudo systemctl status naocs
Odoo啟動指令碼如下,具體操作方式同上
[Unit]
Description=Odoo ERP
After=network.target
[Service]
Type=simple
User=root
Group=root
ExecStart=/tools/xinle_factory_erp/odoo-bin -c /tools/xinle_factory_erp/debian/odoo.conf
Restart=always
RestartSec=5
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=odoo
[Install]
WantedBy=multi-user.target
1、重啟指令
sudo systemctl restart odoo
2、檢視狀態指令
sudo systemctl status odoo