fixing white space and formatting

This commit is contained in:
Remi Bergsma 2015-08-19 16:20:20 +02:00
parent 72e55029ef
commit 14013d5d1b

View File

@ -6,9 +6,9 @@
# to you under the Apache License, Version 2.0 (the # to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance # "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at # with the License. You may obtain a copy of the License at
# #
# http://www.apache.org/licenses/LICENSE-2.0 # http://www.apache.org/licenses/LICENSE-2.0
# #
# Unless required by applicable law or agreed to in writing, # Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an # software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@ -21,20 +21,17 @@
# Script to fix cgroups co-mounted issue # Script to fix cgroups co-mounted issue
# Applies to RHEL7 versions only # Applies to RHEL7 versions only
# Detect if cpu,cpuacct cgroups are co-mounted # Detect if cpu,cpuacct cgroups are co-mounted
# If co-mounted, unmount and mount them seperately # If co-mounted, unmount and mount them seperately
#set -x #set -x
#Check distribution version for RHEL # Check distribution version for RHEL
if [ -f '/etc/redhat-release' ]; if [ -f '/etc/redhat-release' ]; then
then # Check RHEL version for 7
#Check RHEL version for 7 if grep 'Red Hat Enterprise Linux Server release 7' /etc/redhat-release > /dev/null; then
if grep 'Red Hat Enterprise Linux Server release 7' /etc/redhat-release > /dev/null # Check if cgroups if co-mounted
then if [ -d '/sys/fs/cgroup/cpu,cpuacct' ]; then
# Check if cgroups if co-mounted # cgroups co-mounted. Requires remount
if [ -d '/sys/fs/cgroup/cpu,cpuacct' ];
then
# cgroups co-mounted. Requires remount
umount /sys/fs/cgroup/cpu,cpuacct umount /sys/fs/cgroup/cpu,cpuacct
rm /sys/fs/cgroup/cpu rm /sys/fs/cgroup/cpu
rm /sys/fs/cgroup/cpuacct rm /sys/fs/cgroup/cpuacct
@ -43,14 +40,13 @@ then
mkdir -p /sys/fs/cgroup/cpuacct mkdir -p /sys/fs/cgroup/cpuacct
mount -t cgroup -o cpu cpu "/sys/fs/cgroup/cpu" mount -t cgroup -o cpu cpu "/sys/fs/cgroup/cpu"
mount -t cgroup -o cpuacct cpuacct "/sys/fs/cgroup/cpuacct" mount -t cgroup -o cpuacct cpuacct "/sys/fs/cgroup/cpuacct"
# Verify that cgroups are not co-mounted # Verify that cgroups are not co-mounted
if [ -d '/sys/fs/cgroup/cpu,cpuacct' ]; if [ -d '/sys/fs/cgroup/cpu,cpuacct' ]; then
then echo "cgroups still co-mounted"
echo "cgroups still co-mounted" exit 1;
exit 1; fi
fi fi
fi fi
fi
fi fi
exit 0 exit 0