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, 'Nick Anderson' via= help-cfengine wrote: <br>> Weird, I have some memory of answering similar within the past few= weeks. Maybe my flesh brain is breaking down. <br>>=20 <br>> selinux contexts might not be handled with that but that'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't be enough. <br> <br>-- <br>Vratislav <br> <br>>=20 <br>> On Thursday, February 27, 2025 at 8:41:30=E2=80=AFAM UTC-6 Beto wr= ote: <br>> > Hi Craig, <br>> >=20 <br>> > That's pretty much the process I was thinking of using.= =C2=A0 I haven't tried it yet as other priorities have taken over.=C2= =A0 I'll post results once I get to try it. <br>> >=20 <br>> > Thanks for replying! <br>> >=20 <br>> > On Tuesday, February 25, 2025 at 7:57:13=E2=80=AFAM UTC-6 cra= [email protected] wrote: <br>> > > Hello! <br>> > >=20 <br>> > > Sorry this one hasn't had any responses. Did you fig= ure something out? <br>> > >=20 <br>> > > This /var/cfengine path is hard-coded into CFEngine at c= ompile time. It is referred to as WORKDIR: <br>> > >=20 <br>> > > <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&q=3Dhttps:/= /docs.cfengine.com/docs/3.24/reference-special-variables-sys.html%23sys-wor= kdir&source=3Dgmail&ust=3D1741112484092000&usg=3DAOvVaw3onXkGl6= NRLqX-RzDxNN__">https://docs.cfengine.com/docs/3.24/reference-special-varia= bles-sys.html#sys-workdir</a> <br>> > >=20 <br>> > > If you need to migrate to new storage I might suggest th= is untested procedure: <br>> > >=20 <br>> > > - shut CFEngine down with something like `systemctl stop= cfengine3` <br>> > > - double-checking that all CFEngine related processes ar= e not running with something like `ps -efl | grep cf` <br>> > > - moving the current directory aside: `mv /var/cfengine = /var/old-cfengine` <br>> > > - mounting your new storage as `/var/cfengine` <br>> > > - using rsync to copy everything over: `rsync -avz /var/= old-cfengine/ /var/cfengine/` <br>> > > - restart services with `systemctl start cfengine3` <br>> > >=20 <br>> > > I haven't had occasion to perform such a migration s= o take this as a suggested course to be considered carefully as you plan. <br>> > >=20 <br>> > > Let us know how it goes or if you have more questions. <br>> > >=20 <br>> > > -Craig <br>> > > On Friday, February 7, 2025 at 8:25:35=E2=80=AFAM UTC-6 = Beto wrote: <br>> > > > I need to move an Enterprise hub to new storage on = the same server.=C2=A0 I'm thinking of using rsync for this: <br>> > > >=20 <br>> > > > rsync -avz /var/cfengine /var/new_cfengine <br>> > > >=20 <br>> > > > Of course everything would first be shut down. <br>> > > >=20 <br>> > > > Has anyone tried this?=C2=A0 I have a low pain tole= rance lol. <br>> --=20 <br>> You received this message because you are subscribed to the Google= Groups "help-cfengine" group. <br>> 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>> 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&q=3Dhttps://groups.google.com/d/msgid/help-cfe= ngine/bdcbbef4-1df8-4ac2-8078-4eacb71522a6n%2540googlegroups.com&source= =3Dgmail&ust=3D1741112484092000&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" 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--