How to create a systemd service for jar package
sudo groupadd -r appmgr
sudo useradd -r -s /bin/false -g appmgr jvmapps
id jvmapps
[Unit]
Description=Manage Java service
After=network.target
[Service]
WorkingDirectory=/etc/aliyun-driver/
ExecStart=/usr/bin/java -Xms256m -Xmx512m -jar /home/aliyundriver/webdav-aliyundriver.jar
User=jvmapps
Type=simple
Restart=on-failure
RestartSec=10
[Install]
WantedBy=multi-user.target