/etc/systemd/system 文件夹下新建文件 pffice.service
启动停止
systemctl stop poiOffice
systemctl start poiOffice
文件内容
[Unit]
Description=pffice
[Service]
ExecStart=/bin/bash -c "cd /extra/zincsearch && java -jar pffice.jar >> poitest.txt " >> /extra/zincsearch/poitestError.txt
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target
zcsearch
[Unit]
Description=zincsearch
[Service]
ExecStartPre=/bin/bash -c “export ZINC_FIRST_ADMIN_USER=admin && ZINC_FIRST_ADMIN_PASSWORD=admin”
ExecStart=/bin/bash -c “cd /root/zincsearch/ && ./zincsearch”
Restart=on-failure
[Install]
WantedBy=multi-user.target