Re: Re: Moving /var/cfengine

"'Vratislav Podzimek' via help-cfengine" <[email protected]> Tue, 04 Mar 2025 13:28:32 +0100
Newsgroups gmane.comp.sysutils.cfengine.general
Message-ID <[email protected]>
On Mon, 2025-03-03 at 10:13 -0800, Beto wrote:
> Welp, /var/cfengine ran out of space so I had to bite the bullet.=C2=A0 T=
his is what I used:
>=20
> rsync -X -avz --delete /var/cfengine/ /var/new_cfengine/
>=20
> I then checked SELinux contexts in /var/new_cfengine and they were preser=
ved, which was interesting as there is a lot of scary stuff on the interweb=
 tubes about rsync and SELinux.=C2=A0 This hub is on RHEL8 7.9.
>=20
> So far no SELinux AVCs and everything seems to be running fine.
Great! =F0=9F=8E=89=EF=B8=8F

--
Vratislav

>=20
> On Thursday, February 27, 2025 at 4:06:26=E2=80=AFPM UTC-6 vratislav...@n=
orthern.tech wrote:
> > On Thu, 2025-02-27 at 12:17 -0800, 'Nick Anderson' via help-cfengine wr=
ote:
> > > Weird, I have some memory of answering similar within the past few we=
eks. Maybe my flesh brain is breaking down.
> > >=20
> > > selinux contexts might not be handled with that but that's the only t=
hing that jumps to mind.
> > Yes, SELinux contexts and ACLs. Check man:rsync(1) for options to use, =
`-a`
> > alone won't be enough.
> >=20
> > --
> > Vratislav
> >=20
> > >=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.=C2=A0 I hav=
en't tried it yet as other priorities have taken over.=C2=A0 I'll post resu=
lts once I get to try it.
> > > >=20
> > > > Thanks for replying!
> > > >=20
> > > > On Tuesday, February 25, 2025 at 7:57:13=E2=80=AFAM UTC-6 craig.c..=
[email protected] wrote:
> > > > > Hello!
> > > > >=20
> > > > > Sorry this one hasn't had any responses. Did you figure something=
 out?
> > > > >=20
> > > > > This /var/cfengine path is hard-coded into CFEngine at compile ti=
me. It is referred to as WORKDIR:
> > > > >=20
> > > > > https://docs.cfengine.com/docs/3.24/reference-special-variables-s=
ys.html#sys-workdir
> >=20
> > > > >=20
> > > > > If you need to migrate to new storage I might suggest this untest=
ed procedure:
> > > > >=20
> > > > > - shut CFEngine down with something like `systemctl stop cfengine=
3`
> > > > > - double-checking that all CFEngine related processes are not run=
ning with something like `ps -efl | grep cf`
> > > > > - moving the current directory aside: `mv /var/cfengine /var/old-=
cfengine`
> > > > > - mounting your new storage as `/var/cfengine`
> > > > > - using rsync to copy everything over: `rsync -avz /var/old-cfeng=
ine/ /var/cfengine/`
> > > > > - restart services with `systemctl start cfengine3`
> > > > >=20
> > > > > I haven't had occasion to perform such a migration so take this a=
s a 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 wrot=
e:
> > > > > > I need to move an Enterprise hub to new storage on the same ser=
ver.=C2=A0 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?=C2=A0 I have a low pain tolerance lol.
> > > --=20
> > > You received this message because you are subscribed to the Google Gr=
oups "help-cfengine" group.
> > > To unsubscribe from this group and stop receiving emails from it, sen=
d an email to [email protected].
> > > To view this discussion visit https://groups.google.com/d/msgid/help-=
cfengine/bdcbbef4-1df8-4ac2-8078-4eacb71522a6n%40googlegroups.com.
> >=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=
 email to [email protected].
> To view this discussion visit https://groups.google.com/d/msgid/help-cfen=
gine/7c480f9d-f316-49d1-8036-841952c41b6dn%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/c0b54fc370d7c52c3170b014c3f99270307f716f.camel%40northern.tech.