| 1 |
# Copyright (C) 2018 Red Hat, Inc. |
| 2 |
# |
| 3 |
# This library is free software; you can redistribute it and/or |
| 4 |
# modify it under the terms of the GNU Lesser General Public |
| 5 |
# License as published by the Free Software Foundation; either |
| 6 |
# version 2 of the License, or (at your option) any later version. |
| 7 |
# |
| 8 |
# This library is distributed in the hope that it will be useful, |
| 9 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 11 |
# Lesser General Public License for more details. |
| 12 |
# |
| 13 |
# You should have received a copy of the GNU Lesser General Public |
| 14 |
# License along with this library. If not, see <https://www.gnu.org/licenses/>. |
| 15 |
|
| 16 |
# For some implementation discussion, see: |
| 17 |
# https://lists.freedesktop.org/archives/systemd-devel/2018-March/040557.html |
| 18 |
[Unit] |
| 19 |
Description=OSTree Finalize Staged Deployment |
| 20 |
Documentation=man:ostree(1) |
| 21 |
ConditionPathExists=/run/ostree-booted |
| 22 |
DefaultDependencies=no |
| 23 |
|
| 24 |
RequiresMountsFor=/sysroot /boot /etc |
| 25 |
After=local-fs.target |
| 26 |
Before=basic.target final.target |
| 27 |
# We want to make sure the transaction logs are persisted to disk: |
| 28 |
# https://bugzilla.redhat.com/show_bug.cgi?id=1751272 |
| 29 |
After=systemd-journal-flush.service |
| 30 |
Conflicts=final.target |
| 31 |
|
| 32 |
# Start the hold unit and ensure it stays active throughout this |
| 33 |
# service. |
| 34 |
Wants=ostree-finalize-staged-hold.service |
| 35 |
After=ostree-finalize-staged-hold.service |
| 36 |
|
| 37 |
[Service] |
| 38 |
Type=oneshot |
| 39 |
RemainAfterExit=yes |
| 40 |
ExecStop=/usr/bin/ostree admin finalize-staged |
| 41 |
# This is a quite long timeout intentionally; the failure mode |
| 42 |
# here is that people don't get an upgrade. We need to handle |
| 43 |
# cases with slow rotational media, etc. |
| 44 |
TimeoutStopSec=5m |
| 45 |
# OSTree should never touch /var at all...except, we need to remove |
| 46 |
# the /var/.updated flag, so we can't just `InaccessiblePaths=/var` right now. |
| 47 |
# For now, let's at least use ProtectHome just so we have some sandboxing |
| 48 |
# of that. |
| 49 |
ProtectHome=yes |
| 50 |
# And we shouldn't affect the current deployment's /etc. |
| 51 |
ReadOnlyPaths=/etc |
| 52 |
# We write to /sysroot and /boot of course. |