meta-ibm: first-boot-disable-ipmi-net: Fix unit condition
The [Service] section specifies:
```
ExecStart=/bin/touch /var/lib/ipmi-net-disable-one-time
```
However, the [Unit] section specifies the following condition:
```
ConditionFileNotEmpty=!/var/lib/ipmi-net-disable-one-time
```
The documentation for ConditionFileNotEmpty[1] states:
> ConditionFileNotEmpty= is similar to ConditionPathExists= but verifies
> that a certain path exists and refers to a regular file with a
> non-zero size.
[1]: https://www.freedesktop.org/software/systemd/man/systemd.unit.html#ConditionFileNotEmpty=
And the documentation for `touch`[2] states:
> A FILE argument that does not exist is created empty, unless -c or -h
> is supplied.
[2]: https://www.man7.org/linux/man-pages/man1/touch.1.html
Neither `-c` nor `-h` are supplied, therefore the ExecStart= directive
will create an empty file. As the ConditionFileNotEmpty= directive is
negated the condition will always pass: Either the file doesn't exist,
or it does exist and is empty. Therefore, as configured, this unit
always runs.
Always running the unit is counter to its 'one-time' name. Switch to
`ConditionPathExists=`[3] to enforce the one-time nature.
[3]: https://www.freedesktop.org/software/systemd/man/systemd.unit.html#ConditionPathExists=
Change-Id: I1a8418a03c4fb9c6754f72f8651384b2f7e17715
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
diff --git a/meta-ibm/recipes-phosphor/ipmi/phosphor-ipmi-net/first-boot-disable-ipmi-net.service b/meta-ibm/recipes-phosphor/ipmi/phosphor-ipmi-net/first-boot-disable-ipmi-net.service
index 92b8c3f..2c72a2a 100644
--- a/meta-ibm/recipes-phosphor/ipmi/phosphor-ipmi-net/first-boot-disable-ipmi-net.service
+++ b/meta-ibm/recipes-phosphor/ipmi/phosphor-ipmi-net/first-boot-disable-ipmi-net.service
@@ -5,7 +5,7 @@
After=phosphor-ipmi-net@eth0.socket
After=phosphor-ipmi-net@eth1.socket
Before=srvcfg-manager.service
-ConditionFileNotEmpty=!/var/lib/ipmi-net-disable-one-time
+ConditionPathExists=!/var/lib/ipmi-net-disable-one-time
[Service]
ExecStart=/bin/systemctl stop phosphor-ipmi-net@eth0.socket
@@ -16,7 +16,6 @@
ExecStart=/bin/systemctl disable phosphor-ipmi-net@eth1.socket
ExecStart=/bin/systemctl stop phosphor-ipmi-net@eth1.service
ExecStart=/bin/systemctl disable phosphor-ipmi-net@eth1.service
-ExecStart=/bin/systemctl --no-reload disable first-boot-disable-ipmi-net.service
ExecStart=/bin/touch /var/lib/ipmi-net-disable-one-time
SyslogIdentifier=first-boot-disable-ipmi-net
Type=oneshot