# Installs an update for ClawdDotNet, started from the web interface (#795). # # Why a unit of its own (Deploymentcenter SETUP_INTEGRATION_GUIDE ยง4A): started from the # manager, the update agent would restart the manager itself - a second manager next to # the service. Here systemd stops the service, the agent updates, and systemd starts the # service again. The manager only stops its instances and triggers this unit: # systemctl --user start --no-block clawddotnet-update.service # # Install next to clawddotnet-manager.service: # cp clawddotnet-update.service ~/.config/systemd/user/ # # adjust paths and channel below # install -m 600 /dev/null ~/.config/clawddotnet/update.env # echo 'DC_LICENSE_KEY=' >> ~/.config/clawddotnet/update.env # systemctl --user daemon-reload # # The license key goes through the environment file (0600), never the command line: # "ps" shows command lines to every user of the machine. [Unit] Description=ClawdDotNet update (stop manager, update, start manager) [Service] Type=oneshot EnvironmentFile=%h/.config/clawddotnet/update.env TimeoutStartSec=20min ExecStartPre=/usr/bin/systemctl --user stop clawddotnet-manager.service ExecStart=%h/clawddotnet/update-agent --action update --project clawddotnet --base-url https://dc.mhdf.de --channel prod --version latest --target-dir %h/clawddotnet --require-signature # ExecStopPost and not ExecStartPost: it also runs when the update failed. A failed update # must not leave the manager down. ExecStopPost=/usr/bin/systemctl --user start clawddotnet-manager.service