[Unit] Description=Start websockify After=multi-user.target [Service] Type=simple User=www-data Group=www-data Environment=LISTEN_HOST=127.0.0.1 Environment=LISTEN_PORT=5800 Environment=TARGET_HOST=127.0.0.1 Environment=TARGET_PORT=5900 #EnvironmentFile=/etc/default/websockify PermissionsStartOnly=true ExecStartPre=/bin/sh -c '\ touch /var/run/websockify.pid; \ chown www-data:www-data /var/run/websockify.pid' WorkingDirectory=/tmp ExecStart=/usr/bin/websockify \ ${LISTEN_HOST}:${LISTEN_PORT} \ ${TARGET_HOST}:${TARGET_PORT} NoNewPrivileges=true RestartSec=5 Restart=on-failure [Install] WantedBy=multi-user.target