自启动文件放在 /usr/lib/systemd/system
[Unit]
Description=code-server
[Service]
Type=simple
ExecStart=/usr/bin/code-server
User=your user name
[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload #刷新
sudo systemctl start code-server
sudo systemctl enable code-server