Systemd System Services
#testecho.service
[Unit]
Description=testecho.service
Documentation=null
[Service]
Type=simple
User=jxyu
ExecStart=/bin/bash -c "java -jar /home/jxyu/datedemo.jar >> /home/jxyu/testecho.log"
ExecStop=/bin/kill -2 $MAINPID
ExecStop=/bin/bash -c "echo stop >> /home/jxyu/testecho.log"
[Install]
WantedBy=multiuser.target