Thanks for your suggestion!

Actually, zsys does it a little bit differently:
- snapshots (state save) are taken everytime you modify your system by apt or 
other things.
- In addition to this, everytime you reach graphical.target, we stamp the 
current state (which can also be a clone) as the latest good known boot status

Thanks to both of those information, you can revert in grub to any state
changes and you can also revert to a clone (which is a revert of revert,
basically), this is why we don’t need explicitly additional state saved
on boot.

However, you still can take your snapshots automatically, like with this 
service files, but just some suggestions:
- You shouldn’t consider a successful boot to be Before=zfs-mount.service. As 
you don’t know yet if the system completely boot or not. Also, this has the 
side-effect of delaying your boot. You should be After default.target (which is 
a symlink to graphical.target on desktop)
- You don’t need to be After=zsysd.service. Zsys is socket actived, and you can 
rely on only its socket to be present.
- I suggest you only run zsysctl save without any argument or a least 
prepending its name with autozsys_, so that those are garbage collected 
automatically by our system, you will have to clean them up manually.

I’m thus marking the bug as Invalid as the design doesn’t need it, but as said, 
nothing prevent from people running this.
I think we can even put that on a wiki in the github project 
(https://github.com/ubuntu/zsys): are you interested in crafting this page with 
the above information? (a little bit like a FAQ)

** Changed in: zsys (Ubuntu)
       Status: New => Invalid

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to zsys in Ubuntu.
https://bugs.launchpad.net/bugs/1875479

Title:
  Snapshot during system boot to get "known good configuration"

Status in zsys package in Ubuntu:
  Invalid

Bug description:
  I have always relied on snapshots taken during boot when rolling back
  a system since I started using zfs years ago, because I know the
  system is in a consistent state while booting (no open files, no VM or
  containers running etc.). With zsysctl this has become even easier.

  I have created a simple systemd unit file /etc/systemd/system/zfs-
  import-snap.service to achieve this. Perhaps it is a useful feature to
  add.

  [Unit]
  Description=Snapshot ZFS pools after import
  DefaultDependencies=no
  Requires=zfs-import-scan.service zsysd.service
  Before=zfs-mount.service
  After=zfs-import-scan.service zsysd.service

  [Service]
  Type=oneshot
  RemainAfterExit=yes
  ExecStart=/bin/bash -c '/usr/sbin/zsysctl save zb_$$(/usr/bin/date 
+%%Y%%m%%d-%%H%%M%%S) -s'

  [Install]
  WantedBy=zfs-mount.service
  WantedBy=zfs.target

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/zsys/+bug/1875479/+subscriptions

-- 
Mailing list: https://launchpad.net/~desktop-packages
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~desktop-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to