| Newsgroups |
gmane.comp.sysutils.cfengine.general |
| Message-ID |
<[email protected]> |
------=_Part_70372_1888806020.1733425099628
Content-Type: multipart/alternative;
boundary="----=_Part_70373_937086975.1733425099628"
------=_Part_70373_937086975.1733425099628
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Thanks, Nick. That gives us a good direction to explore.
-- David Lee
On Thursday, 5 December 2024 at 18:33:28 UTC [email protected] wrote:
> Context: Linux "systemd" machine; CFE 3.18.=20
>
> We have an emerging use case to run a specific, minimal (i.e. fast) subse=
t=20
> of our cf-agent policy during machine shutdown/halt. We are considering a=
=20
> "systemd" service with something like:=20
>
> ExecStop=3Dcf-agent=E2=80=A6.=20
>
> Is there something already in place which can tell us the current state=
=20
> (target?) of systemd? Perhaps a "var" (e.g. "sys.") in CFE? Or perhaps=20
> something in "/proc" or similar that our policy could peek at?=20
>
> There aren't any system variables that hold states of systemd units and I=
=20
> am not familiar with anything in proc that indicates a systemd unit state=
.=20
>
> bundle agent systemd_services which is used to manage systemd service=20
> state parses information returned by systemctl --no-ask-password --global=
=20
> --system=20
> -pLoadState,CanStop,UnitFileState,ActiveState,LoadState,CanStart,CanReloa=
d=20
> show <service>=20
>
>
> https://github.com/cfengine/masterfiles/blob/b91ca88286d8efece4050e9e4811=
e801b408d034/lib/services.cf#L370-L380=20
>
> Failing that, we do could something like:=20
>
> ExecStop=3Dcf-agent =E2=80=A6 -D HALTING=20
>
> Seems like a reasonable thing to try.=20
>
--=20
You received this message because you are subscribed to the Google Groups "=
help-cfengine" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/help-cfengi=
ne/f926013b-1c96-4ec3-8ee8-f11ee3c1197an%40googlegroups.com.
------=_Part_70373_937086975.1733425099628
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div>Thanks, Nick. That gives us a good direction to explore.</div><div><br=
/></div><div>-- David Lee<br /></div><br /><div class=3D"gmail_quote"><div=
dir=3D"auto" class=3D"gmail_attr">On Thursday, 5 December 2024 at 18:33:28=
UTC [email protected] wrote:<br/></div><blockquote class=3D"gmail_qu=
ote" style=3D"margin: 0 0 0 0.8ex; border-left: 1px solid rgb(204, 204, 204=
); padding-left: 1ex;"><blockquote style=3D"border-left:2px solid gray;padd=
ing-left:4px">
<p>
Context: Linux "systemd" machine; CFE 3.18.
</p>
<p>
We have an emerging use case to run a specific, minimal (i.e. fast) subset =
of our cf-agent policy during machine shutdown/halt. We are considering a
"systemd" service with something like:
</p>
</blockquote><blockquote style=3D"border-left:2px solid gray;padding-left:4=
px"><p>
ExecStop=3Dcf-agent=E2=80=A6.
</p></blockquote><blockquote style=3D"border-left:2px solid gray;padding-le=
ft:4px">
<p>
Is there something already in place which can tell us the current state (ta=
rget?) of systemd? Perhaps a "var" (e.g. "sys.") in CF=
E? Or perhaps
something in "/proc" or similar that our policy could peek at?
</p>
</blockquote><blockquote style=3D"border-left:2px solid gray;padding-left:4=
px"></blockquote>
<p>
There aren't any system variables that hold states of systemd units and=
I am not familiar with anything in proc that indicates a systemd unit stat=
e.
</p>
<p>
<code>bundle agent systemd_services</code> which is used to manage systemd =
service state parses information returned by <code>systemctl --no-ask-passw=
ord --global --system -pLoadState,CanStop,UnitFileState,ActiveState,LoadSta=
te,CanStart,CanReload show <service></code>
</p>
<p>
<a href=3D"https://github.com/cfengine/masterfiles/blob/b91ca88286d8efece40=
50e9e4811e801b408d034/lib/services.cf#L370-L380" target=3D"_blank" rel=3D"n=
ofollow" data-saferedirecturl=3D"https://www.google.com/url?hl=3Den-GB&=
q=3Dhttps://github.com/cfengine/masterfiles/blob/b91ca88286d8efece4050e9e48=
11e801b408d034/lib/services.cf%23L370-L380&source=3Dgmail&ust=3D173=
3511373658000&usg=3DAOvVaw0VaDAHncFAuU0Tg6OLMsNs">https://github.com/cf=
engine/masterfiles/blob/b91ca88286d8efece4050e9e4811e801b408d034/lib/servic=
es.cf#L370-L380</a>
</p>
<blockquote style=3D"border-left:2px solid gray;padding-left:4px"></blockqu=
ote><blockquote style=3D"border-left:2px solid gray;padding-left:4px">
<p>
Failing that, we do could something like:
</p>
</blockquote><blockquote style=3D"border-left:2px solid gray;padding-left:4=
px"><p>
ExecStop=3Dcf-agent =E2=80=A6 -D HALTING
</p>
</blockquote>
<p>
Seems like a reasonable thing to try.
</p>
</blockquote></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;help-cfengine" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:[email protected]">help-=
[email protected]</a>.<br />
To view this discussion visit <a href=3D"https://groups.google.com/d/msgid/=
help-cfengine/f926013b-1c96-4ec3-8ee8-f11ee3c1197an%40googlegroups.com?utm_=
medium=3Demail&utm_source=3Dfooter">https://groups.google.com/d/msgid/help-=
cfengine/f926013b-1c96-4ec3-8ee8-f11ee3c1197an%40googlegroups.com</a>.<br /=
>
------=_Part_70373_937086975.1733425099628--
------=_Part_70372_1888806020.1733425099628--