Skip to content

When something breaks

Make a risky change safely

A checklist for the change you are nervous about. kiyesi guard shows the server now, the safe way to make the change, and how to go back. It runs nothing.

Terminal window
sudo kiyesi guard -- ./deploy.sh

On a fresh Ubuntu 24.04 server running nginx:

Kiyesi changes nothing on this server. It only suggests: you review each command and run it yourself.
Now: grade A 90 · 0 failed services · 1 of 1 site answer · 0 containers running
To make this change safely, review and run:
1. If your provider offers snapshots, take one now.
2. Keep a copy of the settings and the package list (in /root, so only root reads them):
sudo tar -czf /root/etc-before-2026-10-26-0902.tgz -C / etc
sudo sh -c 'dpkg -l > /root/packages-before-2026-10-26-0902.txt'
3. Make your change:
./deploy.sh
4. Check again, and compare with Now above:
systemctl --failed
curl -s -o /dev/null -w '%{http_code}\n' http://127.0.0.1/
sudo kiyesi scan
5. If something broke, see which settings changed, put back the ones you choose, and restart what failed:
sudo tar -dzf /root/etc-before-2026-10-26-0902.tgz -C /
sudo tar -xzf /root/etc-before-2026-10-26-0902.tgz -C / etc/<the file that changed>
sudo systemctl restart <the service that failed>
6. When all is well, delete the copy: it holds password hashes and keys.
sudo rm /root/etc-before-2026-10-26-0902.tgz /root/packages-before-2026-10-26-0902.txt

We followed these steps with a deploy script that wrote a broken nginx setting. After it, nginx had failed. tar -dzf named the file that changed (etc/nginx/sites-available/default: Size differs), and putting that one file back and restarting nginx brought the site back, with the file exactly as before.

What How you check it again
The grade, from a scan sudo kiyesi scan
Failed services systemctl --failed
Running containers sudo docker ps
The server’s own sites curl to each, for its answer

The sites are http://127.0.0.1/ and https://127.0.0.1/ when the server listens on 80 or 443. Name your own with --check, as often as you like; only this server’s own addresses are allowed:

Terminal window
sudo kiyesi guard --check http://127.0.0.1:3000/health -- ./deploy.sh
  • Your command is printed as you gave it, quoted for the shell. Kiyesi never runs it.
  • tar -dzf also lists files whose time changed but not their content; look for Size differs and Contents differ.
  • The copy in /root holds /etc/shadow and private keys, readable by root only. Delete it when you no longer need it.
  • --no-restore leaves out the steps that put the settings back. --restore, from scripts written before 0.40.0, is accepted and changes nothing.
  • It needs root, to read the services and the containers. It is free on every server, and works without an account.

Before 0.40.0, guard ran the command itself and kept a copy of /etc in /var/lib/kiyesi/guard. Those runs are still there:

Terminal window
sudo kiyesi guard list
sudo kiyesi guard undo e207

guard undo lists every settings file that differs from before that run, with the commands that put each back from its copy, for you to review and run.