# This is a simple example for creating a systemd service which starts a program after system startup and restarts unless stopped. # # See the systemd.service man pages for more information about possible options and other examples. # The systemd_minecraft_server.txt file is another example with more complex options. cat > /etc/systemd/system/example.service << EOF [Unit] Description=Automatically start a VNC server After=network.target [Service] User=arch Type=simple ExecStart=x11vnc -noxdamage -passwdfile /home/user/.vnc/passwd -display :0 -forever Restart=on-failure [Install] WantedBy=multi-user.target EOF systemctl enable example.service systemctl start example.service # Use "journalctl -u example.service" to view the service logs, # or view the status and other information with "systemctl status example.service"