Skip to content

Silence error on lock attempt#137

Open
petiepooo wants to merge 1 commit intoamazonlinux:mainfrom
petiepooo:patch-1
Open

Silence error on lock attempt#137
petiepooo wants to merge 1 commit intoamazonlinux:mainfrom
petiepooo:patch-1

Conversation

@petiepooo
Copy link

Silence the error when attempting to create the lockfile fails. Diagnostics are still printed every 100 failures, but this single line is filling about 90% of /var/log/messages on deployed systems.

Issue #, if available:

NA

Description of changes:

This redirects stderr to /dev/null when trying to create the lockfile via stdout redirection. Without this, the following line fills about 90% of /var/log/messages:

Feb 26 08:48:27 pnhost setup-policy-routes[1859]: /usr/share/amazon-ec2-net-utils/lib.sh: line 646: /run/amazon-ec2-net-utils/setup-policy-routes/eth0: cannot overwrite existing file

There is already additional code around this write attempt, including a diagnostic message printed every 100 attempts.

It also has a whitespace-only change on the following comment line so the leading whitespace matches the surrounding lines.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Silence the error when attempting to create the lockfile fails.  Diagnostics are still printed every 100 failures, but this single line is filling about 90% of /var/log/messages on deployed systems.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant