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.
sudo kiyesi guard -- ./deploy.shOn 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.txtWe 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 it reads, now
Section titled “What it reads, now”| 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:
sudo kiyesi guard --check http://127.0.0.1:3000/health -- ./deploy.shGood to know
Section titled “Good to know”- Your command is printed as you gave it, quoted for the shell. Kiyesi never runs it.
tar -dzfalso lists files whose time changed but not their content; look for Size differs and Contents differ.- The copy in
/rootholds/etc/shadowand private keys, readable by root only. Delete it when you no longer need it. --no-restoreleaves 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.
Runs from before 0.40.0
Section titled “Runs from before 0.40.0”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:
sudo kiyesi guard listsudo kiyesi guard undo e207guard 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.