Stop or remove shld on a server

Stop shld safely, preserve its state and evidence, and remove first-install files only when the documented conditions apply.

At the end, shld will stop, and you will know which files remain for retention or review. Allow about ten minutes for a stop, backup, or first-install removal.

Before you start

  • Confirm whether an earlier shld installation exists.
  • Preserve alert evidence and the state directory before removal.
  • Record the service's active and enabled state.
  • Use administrator access for system files.

Steps

  1. Record the service state before changes.
systemctl is-active shld.service
systemctl is-enabled shld.service
  1. Stop and disable the service.
sudo systemctl disable --now shld.service

Automatic updates leave a stopped server stopped. The daily update can still replace the binary, and it reports "Monitoring remains stopped."

  1. Keep the state directory, evidence, environment file, and private backup under administrator control.
  2. Run sudo shld auth logout to revoke this server while it still has a working shld binary.
  3. Run the local-only logout when remote revocation cannot complete.
sudo shld auth logout --local-only

Logout preserves collection state and tapes. It disables notification export through a local tombstone. An offline logout can retain the credential until the company administrator confirms remote revocation.

  1. Remove files only when this was a first installation and the evidence has a retention decision. Turn automatic updates and fixes off first, while the binary still exists. The installer turns automatic updates on for new installations, and the daily update timer would keep failing after the binary is gone. sudo shld fix disable stops the root fix socket if you turned fixes on.
sudo shld update auto disable
sudo shld fix disable
sudo rm -- /usr/local/bin/shld /etc/systemd/system/shld.service
sudo rm -f -- /etc/systemd/system/shld-update.service /etc/systemd/system/shld-update.timer
sudo rm -f -- /etc/systemd/system/shld-fix.socket /etc/systemd/system/shld-fix.service
sudo rm -- /usr/local/share/doc/shld/operations.md
sudo rm -- /usr/local/share/doc/shld/auth.md
sudo systemctl daemon-reload

Keep /etc/shld/shld.env and the state directory until the administrator decides to retain or delete them. Review them before deletion or sharing. The commands above leave /etc/shld/connection.json and the drop-in files in /etc/systemd/system/shld.service.d in place. /var/lib/shld-update holds only the update timer's last result: time, outcome, and versions. /etc/shld/auto-update.disabled records the opt-out. /var/lib/shld-fix holds the fix helper's state if you turned fixes on, and /etc/shld/fix.disabled records that fixes are off. Remove them with the rest of /etc/shld once you no longer need them.

If something goes wrong

  • The service does not stop. Preserve the service output and keep the files in place for review.
  • A previous installation exists. Do not use the first-install removal commands.
  • sudo shld update auto disable fails, or the binary is already gone. Run sudo systemctl disable --now shld-update.timer before you remove the unit files. If you turned fixes on, also run sudo systemctl disable --now shld-fix.socket.
  • The company administrator cannot confirm remote revocation. Keep the host ID and ask the administrator to revoke it.
  • A backup command fails. Stop and preserve the original state.
  • The state contains newer records after a trial or update. Keep those records separate from older rollback material.