用service 让Linux系统启动时执行命令
之前搭了个Xfce+VNC的环境,做了个快照保存。每次要用的时候,从快照创建了实例,还要终端登进去跑一句  vncserver -geometry 800x600  建一个vnc。  我想把它自动化,启动系统的时候自动执行。   参考: https://www.ruanyifeng.com/blog/2016/03/systemd-tutorial-part-two.html   在/lib/systemd/system目录,创建一个 open1vnc.service,内容如下:   [Unit]  Description=Open 1 vnc   [Service]  User=root  Group=root  Type=oneshot  ExecStart=/usr/bin/vncserver -geometry 800x600  ExecStop=/usr/bin/vncserver -kill :1  RemainAfterExit=yes   [Install]  WantedBy=multi-user.target  用这条命令让它在系统启动时执行。   systemctl enable open1vnc  
