1、编写系统服务脚本
vim /usr/lib/systemd/system/lucien.service
[Unit]
Description=server
After=rc-local.service network.target remote-fs.target nss-lookup.target
[Service]
Type=forking
User=root
ExecStart=/bin/sh -c 'java -server -Xms512m -Xmx1204m -XX:MetaspaceSize=128m -XX:+UseConcMarkSweepGC -Dspring.profiles.active=dev -jar /var/lib/ehome/api.jar > /dev/null 2>&1 &'
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s QUIT $MAINPID
[Install]
WantedBy=multi-user.target