Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
DISCONTINUED:openSUSE:11.1:Update
ibmrtpkgs
rename_ibmconfig.diff
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File rename_ibmconfig.diff of Package ibmrtpkgs
Index: ibmrtpkgs-2/config/config.sh =================================================================== --- ibmrtpkgs-2.orig/config/config.sh +++ /dev/null @@ -1,159 +0,0 @@ -#!/bin/bash -# -# Copyright IBM Corporation © 2005, 2008 -# -# Original Author: John Kacur <jkacur at ca.ibm.com> -# - -CHKCONFIG=/sbin/chkconfig - -info() { - echo $0: $* -} - -check_sysctl_setting() -{ - key=${1//\//.} - val=$2 - if grep -q "^[[:space:]]*$key[[:space:]]*=[[:space:]]*$val[[:space:]]*\$" \ - /etc/sysctl.conf; then - info "Setting on sysctl $key is correct ($val)" - else - echo $key = $val >> /etc/sysctl.conf - fi - /sbin/sysctl -p >/dev/null - act=`cat /proc/sys/${key//./\/}` - if [ "$val" != "$act" ]; then - info "Setting of sysctl $key is incorrect in /proc/sys" 1>&2 - exit 1 - fi -} - -#---------------------------------------------------------------------------# -# Create the realtime group. # -#---------------------------------------------------------------------------# - -# This will be the default group (the current default group is different) -DEFAULT_GROUP=realtime - -# Although the groupadd can be executed even if the group already exists -# we test for its existence anyway, for better messages to the user -if grep -q ^${DEFAULT_GROUP}: /etc/group; then - info "The group ${DEFAULT_GROUP} already exists, no need to readd it." -else - /usr/sbin/groupadd ${DEFAULT_GROUP} > /dev/null 2>&1 - info "The group ${DEFAULT_GROUP} was successfully added." -fi - -#-----------------------------------------------------------------------# -# Make the realtime group the default group. # -#-----------------------------------------------------------------------# - -# Extract the realtime group's gid -DEFAULT_GID=$(awk -F: "/${DEFAULT_GROUP}/"'{ print $3 }' /etc/group) - -if [ "${DEFAULT_GID}" = "$(grep "GROUP=" /etc/default/useradd | awk -F= '{ print $2 }')" ]; then - info "The default group is already ${DEFAULT_GROUP}, no changes are necessary." -else - - # IF = input file - IF=/etc/default/useradd - - # Move it out of the way - mv ${IF} ${IF}.old - - # Generate the new one - # The following line creates a line specifying the default group - echo GROUP=${DEFAULT_GID} > ${IF} - - # And this line deletes the old line specifying the default group - sed /GROUP=/d ${IF}.old >> ${IF} - - info "The default group has been changed to ${DEFAULT_GROUP}" -fi - -#-----------------------------------------------------------------------# -# Setup realtime group limits # -#-----------------------------------------------------------------------# - -TIMEOUT=unlimited # in minutes -RT_PRIORITY=100 -NICE=40 -MEMLOCK=unlimited -LIMITSCONF=/etc/security/limits.conf - -if grep -q @${DEFAULT_GROUP} ${LIMITSCONF}; then - info "The group ${DEFAULT_GROUP} is already set up for security." -else - if ! sed -i -e "/^# End of file/d" /etc/security/limits.conf; then - info "Modification of /etc/security/limits.conf failed." - exit 1 - fi - cat >>${LIMITSCONF} <<EOF -@realtime soft cpu $TIMEOUT -@realtime - rtprio $RT_PRIORITY -@realtime - nice $NICE -@realtime - memlock $MEMLOCK -# End of file -EOF -fi - -#-----------------------------------------------------------------------# -# Increase the maximum precision available to users of /dev/rtc # -#-----------------------------------------------------------------------# - -# (FIXME: needed?) -# check_sysctl_setting dev.rtc.max-user-freq 8192 - -#-----------------------------------------------------------------------# -# Prevent blanking and set sysrq for the current running kernel # -#-----------------------------------------------------------------------# - -setterm -blank 0 < /dev/tty1 > /dev/tty1 - -# Add the line kernel.sysrq = 1 to /etc/sysctl.conf -check_sysctl_setting kernel.sysrq 1 - -#-----------------------------------------------------------------------# -# Configure irqbindall and irq_balancer services # -#-----------------------------------------------------------------------# - -info "Turning irqbindall on and irq_balancer off." -$CHKCONFIG irqbindall on -$CHKCONFIG irq_balancer off - -#-----------------------------------------------------------------------# -# Setup kdump # -#-----------------------------------------------------------------------# - -if [ -f /etc/sysconfig/kdump ]; then - cp /etc/sysconfig/kdump /etc/sysconfig/kdump.$$.orig - . /etc/sysconfig/kdump - - if ! echo $KDUMP_COMMANDLINE_APPEND | grep "reset_devices"; then - if ! sed -i -e "s/\(KDUMP_COMMANDLINE_APPEND\)=\"[^\"]*\"/\1=\"$KDUMP_COMMANDLINE_APPEND reset_devices=1\"/" /etc/sysconfig/kdump; then - info "Kdump setup failed." - cp -f /etc/sysconfig/kdump.$$.orig /etc/sysconfig/kdump - exit 1 - fi - fi - if ! sed -i -e "s/^\(KEXEC_ARGS\)/#\1/" /etc/sysconfig/kdump; then - info "Kdump setup failed." - cp -f /etc/sysconfig/kdump.$$.orig /etc/sysconfig/kdump - exit 1 - fi -else - info "Kdump setup failed." - cp -f /etc/sysconfig/kdump.$$.orig /etc/sysconfig/kdump - exit 1 -fi - -# Make sure kdump will work if we panic -check_sysctl_setting kernel.panic_on_oops 1 - -info "Turning kdump on." -$CHKCONFIG kdump on - -info "All changes were successfully executed." - -exit 0 Index: ibmrtpkgs-2/config/Makefile =================================================================== --- ibmrtpkgs-2.orig/config/Makefile +++ ibmrtpkgs-2/config/Makefile @@ -4,4 +4,4 @@ all: install: - install -o root -g root -m 555 config.sh /usr/bin + install -o root -g root -m 555 ibmconfig.sh /sbin Index: ibmrtpkgs-2/config/ibmconfig.sh =================================================================== --- /dev/null +++ ibmrtpkgs-2/config/ibmconfig.sh @@ -0,0 +1,159 @@ +#!/bin/bash +# +# Copyright IBM Corporation © 2005, 2008 +# +# Original Author: John Kacur <jkacur at ca.ibm.com> +# + +CHKCONFIG=/sbin/chkconfig + +info() { + echo $0: $* +} + +check_sysctl_setting() +{ + key=${1//\//.} + val=$2 + if grep -q "^[[:space:]]*$key[[:space:]]*=[[:space:]]*$val[[:space:]]*\$" \ + /etc/sysctl.conf; then + info "Setting on sysctl $key is correct ($val)" + else + echo $key = $val >> /etc/sysctl.conf + fi + /sbin/sysctl -p >/dev/null + act=`cat /proc/sys/${key//./\/}` + if [ "$val" != "$act" ]; then + info "Setting of sysctl $key is incorrect in /proc/sys" 1>&2 + exit 1 + fi +} + +#---------------------------------------------------------------------------# +# Create the realtime group. # +#---------------------------------------------------------------------------# + +# This will be the default group (the current default group is different) +DEFAULT_GROUP=realtime + +# Although the groupadd can be executed even if the group already exists +# we test for its existence anyway, for better messages to the user +if grep -q ^${DEFAULT_GROUP}: /etc/group; then + info "The group ${DEFAULT_GROUP} already exists, no need to readd it." +else + /usr/sbin/groupadd ${DEFAULT_GROUP} > /dev/null 2>&1 + info "The group ${DEFAULT_GROUP} was successfully added." +fi + +#-----------------------------------------------------------------------# +# Make the realtime group the default group. # +#-----------------------------------------------------------------------# + +# Extract the realtime group's gid +DEFAULT_GID=$(awk -F: "/${DEFAULT_GROUP}/"'{ print $3 }' /etc/group) + +if [ "${DEFAULT_GID}" = "$(grep "GROUP=" /etc/default/useradd | awk -F= '{ print $2 }')" ]; then + info "The default group is already ${DEFAULT_GROUP}, no changes are necessary." +else + + # IF = input file + IF=/etc/default/useradd + + # Move it out of the way + mv ${IF} ${IF}.old + + # Generate the new one + # The following line creates a line specifying the default group + echo GROUP=${DEFAULT_GID} > ${IF} + + # And this line deletes the old line specifying the default group + sed /GROUP=/d ${IF}.old >> ${IF} + + info "The default group has been changed to ${DEFAULT_GROUP}" +fi + +#-----------------------------------------------------------------------# +# Setup realtime group limits # +#-----------------------------------------------------------------------# + +TIMEOUT=unlimited # in minutes +RT_PRIORITY=100 +NICE=40 +MEMLOCK=unlimited +LIMITSCONF=/etc/security/limits.conf + +if grep -q @${DEFAULT_GROUP} ${LIMITSCONF}; then + info "The group ${DEFAULT_GROUP} is already set up for security." +else + if ! sed -i -e "/^# End of file/d" /etc/security/limits.conf; then + info "Modification of /etc/security/limits.conf failed." + exit 1 + fi + cat >>${LIMITSCONF} <<EOF +@realtime soft cpu $TIMEOUT +@realtime - rtprio $RT_PRIORITY +@realtime - nice $NICE +@realtime - memlock $MEMLOCK +# End of file +EOF +fi + +#-----------------------------------------------------------------------# +# Increase the maximum precision available to users of /dev/rtc # +#-----------------------------------------------------------------------# + +# (FIXME: needed?) +# check_sysctl_setting dev.rtc.max-user-freq 8192 + +#-----------------------------------------------------------------------# +# Prevent blanking and set sysrq for the current running kernel # +#-----------------------------------------------------------------------# + +setterm -blank 0 < /dev/tty1 > /dev/tty1 + +# Add the line kernel.sysrq = 1 to /etc/sysctl.conf +check_sysctl_setting kernel.sysrq 1 + +#-----------------------------------------------------------------------# +# Configure irqbindall and irq_balancer services # +#-----------------------------------------------------------------------# + +info "Turning irqbindall on and irq_balancer off." +$CHKCONFIG irqbindall on +$CHKCONFIG irq_balancer off + +#-----------------------------------------------------------------------# +# Setup kdump # +#-----------------------------------------------------------------------# + +if [ -f /etc/sysconfig/kdump ]; then + cp /etc/sysconfig/kdump /etc/sysconfig/kdump.$$.orig + . /etc/sysconfig/kdump + + if ! echo $KDUMP_COMMANDLINE_APPEND | grep "reset_devices"; then + if ! sed -i -e "s/\(KDUMP_COMMANDLINE_APPEND\)=\"[^\"]*\"/\1=\"$KDUMP_COMMANDLINE_APPEND reset_devices=1\"/" /etc/sysconfig/kdump; then + info "Kdump setup failed." + cp -f /etc/sysconfig/kdump.$$.orig /etc/sysconfig/kdump + exit 1 + fi + fi + if ! sed -i -e "s/^\(KEXEC_ARGS\)/#\1/" /etc/sysconfig/kdump; then + info "Kdump setup failed." + cp -f /etc/sysconfig/kdump.$$.orig /etc/sysconfig/kdump + exit 1 + fi +else + info "Kdump setup failed." + cp -f /etc/sysconfig/kdump.$$.orig /etc/sysconfig/kdump + exit 1 +fi + +# Make sure kdump will work if we panic +check_sysctl_setting kernel.panic_on_oops 1 + +info "Turning kdump on." +$CHKCONFIG kdump on + +info "All changes were successfully executed." + +exit 0 Index: ibmrtpkgs-2/config/ibmconfig =================================================================== --- ibmrtpkgs-2.orig/config/ibmconfig +++ ibmrtpkgs-2/config/ibmconfig @@ -22,8 +22,8 @@ rc_reset case "$1" in start) # - if [ -x /sbin/config.sh ] ; then - /sbin/config.sh + if [ -x /sbin/ibmconfig.sh ] ; then + /sbin/ibmconfig.sh rc_status -v -r fi ;;
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor