]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
units: refuse manual operations on factory-reset-now.target and friends
authorMike Yuan <me@yhndnzj.com>
Wed, 5 Mar 2025 14:54:26 +0000 (15:54 +0100)
committerMike Yuan <me@yhndnzj.com>
Wed, 5 Mar 2025 16:03:59 +0000 (17:03 +0100)
It is strictly mandatory that this is done during initial
transaction, and not later when the system is already running.
Hence let's refuse manual start for all of the involved units.
Additionally, refuse manual stop for systemd-factory-reset-complete.service,
as it flags the factory reset completion through
/run/systemd/factory-reset-complete, which never gets removed
for the whole boot.

units/factory-reset-now.target
units/systemd-factory-reset-complete.service.in

index 6415cc1232e19107f61c97211cc46584ecfa3485..008d565b17c9d03d3ba60d70676aed56c8a9d03b 100644 (file)
@@ -11,3 +11,4 @@
 Description=Factory Reset Execution
 Documentation=man:systemd.special(7)
 Wants=systemd-factory-reset-complete.service
+RefuseManualStart=yes
index 337b99d3d4286542acd89d2bc5ad4dec1e84d591..aa0913dbe699a21b1a0e26deed99cdad7c610f2a 100644 (file)
@@ -15,6 +15,8 @@ Requires=factory-reset-now.target
 After=factory-reset-now.target
 Conflicts=shutdown.target
 Before=shutdown.target
+RefuseManualStart=yes
+RefuseManualStop=yes
 
 [Service]
 Type=oneshot