Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENT-10429: Guarded against race condition in install scriptlets with restorecon #1300

Merged
merged 1 commit into from
Sep 29, 2023

Conversation

craigcomstock
Copy link
Contributor

Try to run restorecon with the least number of processes/services running that might
make changes to /var/cfengine and /opt/cfengine

restorecon seems to gather a list of files up-front and then process which can take more
than a few seconds.

When services such as database or cf-execd/cf-agent/etc are running files can change
causing restorecon to error out when files are removed.

The files being removed doesn't create a risk of bad SELinux labels since they are gone.

Ticket: ENT-10429
Changelog: title

@craigcomstock
Copy link
Contributor Author

@cf-bottom jenkins please

@cf-bottom
Copy link

@craigcomstock
Copy link
Contributor Author

craigcomstock commented Sep 28, 2023

waiting on #1303 to be merged, then will rebase and re-run CI here.

Try to run restorecon with the least number of processes/services running that might
make changes to /var/cfengine and /opt/cfengine

restorecon seems to gather a list of files up-front and then process which can take more
than a few seconds.

When services such as database or cf-execd/cf-agent/etc are running files can change
causing restorecon to error out when files are removed.

The files being removed doesn't create a risk of bad SELinux labels since they are gone.

Ticket: ENT-10429
Changelog: title
@craigcomstock
Copy link
Contributor Author

@cf-bottom jenkins

@cf-bottom
Copy link

@craigcomstock
Copy link
Contributor Author

sequential test failure has the following issues

3	:	1695970697.290	     2.322	0	25	52	0	curl -k -i --show-error --fail -u admin:admin -H "content-type: application/json" -X POST -d @.31343.project_info https://54.195.6.54/api/build/projects && echo
54.195.6.54	curl: (52) Empty reply from server
3.250.169.0	==> /var/cfengine/state/pg/data/pg_upgrade_output.d/20230929T070442.162/log/pg_upgrade_internal.log <==
3.250.169.0	-----------------------------------------------------------------
3.250.169.0	  pg_upgrade run on Fri Sep 29 07:04:42 2023
3.250.169.0	-----------------------------------------------------------------
3.250.169.0	
3.250.169.0	check for "/var/cfengine/state/pg/backup/bin/postgres" failed: cannot execute
  • upgrade-patch failure, restorecon! ;) but this is in 3.21.2 where the bug still exists, so OK
54.246.129.115	warning: %post(cfengine-nova-hub-3.21.2-1.el8.x86_64) scriptlet failed, exit status 255

---

+ restorecon -iR /var/cfengine /opt/cfengine
restorecon: Could not set context for /var/cfengine/state/pg/data/base/16386/pg_internal.init:  No such file or directory
+ return 1

So I think this is "good to go" @nickanderson ack?

@craigcomstock craigcomstock merged commit 1885181 into master Sep 29, 2023
33 of 34 checks passed
@craigcomstock craigcomstock deleted the ENT-10429/master branch September 29, 2023 13:59
Copy link
Contributor

@vpodzime vpodzime left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! 🤞

@craigcomstock
Copy link
Contributor Author

cherry picks
#1310
#1309

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants