From: Mike Yuan Date: Wed, 5 Mar 2025 14:54:26 +0000 (+0100) Subject: units: refuse manual operations on factory-reset-now.target and friends X-Git-Tag: v258-rc1~1162^2~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=651b44bddaeb7d48a970b4b16f2877c37d93f1a2;p=thirdparty%2Fsystemd.git units: refuse manual operations on factory-reset-now.target and friends 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. --- diff --git a/units/factory-reset-now.target b/units/factory-reset-now.target index 6415cc1232e..008d565b17c 100644 --- a/units/factory-reset-now.target +++ b/units/factory-reset-now.target @@ -11,3 +11,4 @@ Description=Factory Reset Execution Documentation=man:systemd.special(7) Wants=systemd-factory-reset-complete.service +RefuseManualStart=yes diff --git a/units/systemd-factory-reset-complete.service.in b/units/systemd-factory-reset-complete.service.in index 337b99d3d42..aa0913dbe69 100644 --- a/units/systemd-factory-reset-complete.service.in +++ b/units/systemd-factory-reset-complete.service.in @@ -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