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

Fixes #5198: Do not use stat on AIX in check-rudder-agent, but istat ins... #428

Merged
merged 1 commit into from Jul 2, 2014
Merged

Fixes #5198: Do not use stat on AIX in check-rudder-agent, but istat ins... #428

merged 1 commit into from Jul 2, 2014

Conversation

Kegeruneku
Copy link

...tead

Ticket: http://www.rudder-project.org/redmine/issues/5198

To be merged in 2.10

CF_LOCK_SIZE=`stat -c%s "${CFE_DIR}/state/cf_lock.tcdb"`

if [ "z${OS_FAMILY}" = "zAIX" ]; then
CF_LOCK_SIZE=`istat "${CFE_DIR}/state/cf_lock.tcdb" | grep Length | sed "s%^.*Length \([0-9]*\) bytes%\1%"`
Copy link
Member

Choose a reason for hiding this comment

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

I would be happier if this regex contained a .*$ at the end, so that we were SURE we were only getting a number out of this.

@jooooooon
Copy link
Member

Aside from this looks good. Please fix and self merge.

@Kegeruneku
Copy link
Author

I also changed to way we choose the database (.tcdb suffix) to avoid duplication

@@ -135,7 +139,7 @@ check_and_fix_cfengine_processes() {


# Check for anomalous number of CFEngine processes
# If there are more than 8 agent/executor processes, we should kill them, and purge the tcdb database
# If there are more than 8 agent/executor processes, we should kill them, and purge the state database
Copy link
Member

Choose a reason for hiding this comment

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

It's not the state db, it's the lock db. These are 2 different things.

@jooooooon
Copy link
Member

Looks good. Merge when ready. And please adapt for LMDB in 2.11+

Kegeruneku pushed a commit that referenced this pull request Jul 2, 2014
…n_aix_no_stat

Fixes #5198: Do not use stat on AIX in check-rudder-agent, but istat ins...
@Kegeruneku Kegeruneku merged commit bfd0894 into Normation:branches/rudder/2.10 Jul 2, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants