Re: Re: Moving /var/cfengine

Beto <[email protected]> Mon, 3 Mar 2025 10:22:30 -0800 (PST)
Newsgroups gmane.comp.sysutils.cfengine.general
Message-ID <[email protected]>
------=_Part_301204_1291750444.1741026150498
Content-Type: multipart/alternative; 
	boundary="----=_Part_301205_1779382512.1741026150498"

------=_Part_301205_1779382512.1741026150498
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable



Welp, /var/cfengine ran out of space so I had to bite the bullet.  This is=
=20
what I used:

 rsync -X -avz --delete /var/cfengine/ /var/new_cfengine/

 I then checked SELinux context in /var/new_cfengine and they were all=20
intact.  This was a bit surprising considering all the scary stuff on the=
=20
interweb tubes around rsync and SELinux.  This hub is on RHEL8 7.9.

 So far no SELinux AVCs and everything appears to be running fine.

On Thursday, February 27, 2025 at 4:06:26=E2=80=AFPM UTC-6=20
[email protected] wrote:

> On Thu, 2025-02-27 at 12:17 -0800, 'Nick Anderson' via help-cfengine wrot=
e:
> > Weird, I have some memory of answering similar within the past few=20
> weeks. Maybe my flesh brain is breaking down.
> >=20
> > selinux contexts might not be handled with that but that's the only=20
> thing that jumps to mind.
> Yes, SELinux contexts and ACLs. Check man:rsync(1) for options to use, `-=
a`
> alone won't be enough.
>
> --
> Vratislav
>
> >=20
> > On Thursday, February 27, 2025 at 8:41:30=E2=80=AFAM UTC-6 Beto wrote:
> > > Hi Craig,
> > >=20
> > > That's pretty much the process I was thinking of using.  I haven't=20
> tried it yet as other priorities have taken over.  I'll post results once=
 I=20
> get to try it.
> > >=20
> > > Thanks for replying!
> > >=20
> > > On Tuesday, February 25, 2025 at 7:57:13=E2=80=AFAM UTC-6=20
> [email protected] wrote:
> > > > Hello!
> > > >=20
> > > > Sorry this one hasn't had any responses. Did you figure something=
=20
> out?
> > > >=20
> > > > This /var/cfengine path is hard-coded into CFEngine at compile time=
.=20
> It is referred to as WORKDIR:
> > > >=20
> > > >=20
> https://docs.cfengine.com/docs/3.24/reference-special-variables-sys.html#=
sys-workdir
> > > >=20
> > > > If you need to migrate to new storage I might suggest this untested=
=20
> procedure:
> > > >=20
> > > > - shut CFEngine down with something like `systemctl stop cfengine3`
> > > > - double-checking that all CFEngine related processes are not=20
> running with something like `ps -efl | grep cf`
> > > > - moving the current directory aside: `mv /var/cfengine=20
> /var/old-cfengine`
> > > > - mounting your new storage as `/var/cfengine`
> > > > - using rsync to copy everything over: `rsync -avz=20
> /var/old-cfengine/ /var/cfengine/`
> > > > - restart services with `systemctl start cfengine3`
> > > >=20
> > > > I haven't had occasion to perform such a migration so take this as =
a=20
> suggested course to be considered carefully as you plan.
> > > >=20
> > > > Let us know how it goes or if you have more questions.
> > > >=20
> > > > -Craig
> > > > On Friday, February 7, 2025 at 8:25:35=E2=80=AFAM UTC-6 Beto wrote:
> > > > > I need to move an Enterprise hub to new storage on the same=20
> server.  I'm thinking of using rsync for this:
> > > > >=20
> > > > > rsync -avz /var/cfengine /var/new_cfengine
> > > > >=20
> > > > > Of course everything would first be shut down.
> > > > >=20
> > > > > Has anyone tried this?  I have a low pain tolerance lol.
> > --=20
> > You received this message because you are subscribed to the Google=20
> Groups "help-cfengine" group.
> > To unsubscribe from this group and stop receiving emails from it, send=
=20
> an email to [email protected].
> > To view this discussion visit=20
> https://groups.google.com/d/msgid/help-cfengine/bdcbbef4-1df8-4ac2-8078-4=
eacb71522a6n%40googlegroups.com
> .
>
>

--=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/a3f62a30-1c77-492f-b3de-c85b94ba84een%40googlegroups.com.

------=_Part_301205_1779382512.1741026150498
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<p>Welp, /var/cfengine ran out of space so I had to bite the
bullet.=C2=A0 This is what I used:</p>

<p><font face=3D"Courier New">=C2=A0rsync -X -avz --delete /var/cfengine/ /=
var/new_cfengine/</font></p>

<p>=C2=A0I then checked SELinux context in /var/new_cfengine and they
were all intact.=C2=A0 This was a bit
surprising considering all the scary stuff on the interweb tubes around rsy=
nc
and SELinux.=C2=A0 This hub is on RHEL8 7.9.</p>

<p>=C2=A0So far no SELinux AVCs and everything appears to be running
fine.</p><br /><div class=3D"gmail_quote"><div dir=3D"auto" class=3D"gmail_=
attr">On Thursday, February 27, 2025 at 4:06:26=E2=80=AFPM UTC-6 vratislav.=
[email protected] wrote:<br/></div><blockquote class=3D"gmail_quote" style=
=3D"margin: 0 0 0 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding=
-left: 1ex;">On Thu, 2025-02-27 at 12:17 -0800, &#39;Nick Anderson&#39; via=
 help-cfengine wrote:
<br>&gt; Weird, I have some memory of answering similar within the past few=
 weeks. Maybe my flesh brain is breaking down.
<br>&gt;=20
<br>&gt; selinux contexts might not be handled with that but that&#39;s the=
 only thing that jumps to mind.
<br>Yes, SELinux contexts and ACLs. Check man:rsync(1) for options to use, =
`-a`
<br>alone won&#39;t be enough.
<br>
<br>--
<br>Vratislav
<br>
<br>&gt;=20
<br>&gt; On Thursday, February 27, 2025 at 8:41:30=E2=80=AFAM UTC-6 Beto wr=
ote:
<br>&gt; &gt; Hi Craig,
<br>&gt; &gt;=20
<br>&gt; &gt; That&#39;s pretty much the process I was thinking of using.=
=C2=A0 I haven&#39;t tried it yet as other priorities have taken over.=C2=
=A0 I&#39;ll post results once I get to try it.
<br>&gt; &gt;=20
<br>&gt; &gt; Thanks for replying!
<br>&gt; &gt;=20
<br>&gt; &gt; On Tuesday, February 25, 2025 at 7:57:13=E2=80=AFAM UTC-6 cra=
[email protected] wrote:
<br>&gt; &gt; &gt; Hello!
<br>&gt; &gt; &gt;=20
<br>&gt; &gt; &gt; Sorry this one hasn&#39;t had any responses. Did you fig=
ure something out?
<br>&gt; &gt; &gt;=20
<br>&gt; &gt; &gt; This /var/cfengine path is hard-coded into CFEngine at c=
ompile time. It is referred to as WORKDIR:
<br>&gt; &gt; &gt;=20
<br>&gt; &gt; &gt; <a href=3D"https://docs.cfengine.com/docs/3.24/reference=
-special-variables-sys.html#sys-workdir" target=3D"_blank" rel=3D"nofollow"=
 data-saferedirecturl=3D"https://www.google.com/url?hl=3Den&amp;q=3Dhttps:/=
/docs.cfengine.com/docs/3.24/reference-special-variables-sys.html%23sys-wor=
kdir&amp;source=3Dgmail&amp;ust=3D1741112484092000&amp;usg=3DAOvVaw3onXkGl6=
NRLqX-RzDxNN__">https://docs.cfengine.com/docs/3.24/reference-special-varia=
bles-sys.html#sys-workdir</a>
<br>&gt; &gt; &gt;=20
<br>&gt; &gt; &gt; If you need to migrate to new storage I might suggest th=
is untested procedure:
<br>&gt; &gt; &gt;=20
<br>&gt; &gt; &gt; - shut CFEngine down with something like `systemctl stop=
 cfengine3`
<br>&gt; &gt; &gt; - double-checking that all CFEngine related processes ar=
e not running with something like `ps -efl | grep cf`
<br>&gt; &gt; &gt; - moving the current directory aside: `mv /var/cfengine =
/var/old-cfengine`
<br>&gt; &gt; &gt; - mounting your new storage as `/var/cfengine`
<br>&gt; &gt; &gt; - using rsync to copy everything over: `rsync -avz /var/=
old-cfengine/ /var/cfengine/`
<br>&gt; &gt; &gt; - restart services with `systemctl start cfengine3`
<br>&gt; &gt; &gt;=20
<br>&gt; &gt; &gt; I haven&#39;t had occasion to perform such a migration s=
o take this as a suggested course to be considered carefully as you plan.
<br>&gt; &gt; &gt;=20
<br>&gt; &gt; &gt; Let us know how it goes or if you have more questions.
<br>&gt; &gt; &gt;=20
<br>&gt; &gt; &gt; -Craig
<br>&gt; &gt; &gt; On Friday, February 7, 2025 at 8:25:35=E2=80=AFAM UTC-6 =
Beto wrote:
<br>&gt; &gt; &gt; &gt; I need to move an Enterprise hub to new storage on =
the same server.=C2=A0 I&#39;m thinking of using rsync for this:
<br>&gt; &gt; &gt; &gt;=20
<br>&gt; &gt; &gt; &gt; rsync -avz /var/cfengine /var/new_cfengine
<br>&gt; &gt; &gt; &gt;=20
<br>&gt; &gt; &gt; &gt; Of course everything would first be shut down.
<br>&gt; &gt; &gt; &gt;=20
<br>&gt; &gt; &gt; &gt; Has anyone tried this?=C2=A0 I have a low pain tole=
rance lol.
<br>&gt; --=20
<br>&gt; You received this message because you are subscribed to the Google=
 Groups &quot;help-cfengine&quot; group.
<br>&gt; To unsubscribe from this group and stop receiving emails from it, =
send an email to <a href data-email-masked rel=3D"nofollow">help-cfengin...=
@googlegroups.com</a>.
<br>&gt; To view this discussion visit <a href=3D"https://groups.google.com=
/d/msgid/help-cfengine/bdcbbef4-1df8-4ac2-8078-4eacb71522a6n%40googlegroups=
.com" target=3D"_blank" rel=3D"nofollow" data-saferedirecturl=3D"https://ww=
w.google.com/url?hl=3Den&amp;q=3Dhttps://groups.google.com/d/msgid/help-cfe=
ngine/bdcbbef4-1df8-4ac2-8078-4eacb71522a6n%2540googlegroups.com&amp;source=
=3Dgmail&amp;ust=3D1741112484092000&amp;usg=3DAOvVaw2M6gsNfEl9_6yahLK7Fp8Q"=
>https://groups.google.com/d/msgid/help-cfengine/bdcbbef4-1df8-4ac2-8078-4e=
acb71522a6n%40googlegroups.com</a>.
<br>
<br></blockquote></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;help-cfengine&quot; 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/a3f62a30-1c77-492f-b3de-c85b94ba84een%40googlegroups.com?utm_=
medium=3Demail&utm_source=3Dfooter">https://groups.google.com/d/msgid/help-=
cfengine/a3f62a30-1c77-492f-b3de-c85b94ba84een%40googlegroups.com</a>.<br /=
>

------=_Part_301205_1779382512.1741026150498--

------=_Part_301204_1291750444.1741026150498--