My Favorites

Close

Please to see your favorites.

  • Bookmark
  • Email Document
  • Printer Friendly
  • Favorite
  • Rating:

Making CPUSets Persistent Across Reboots

This document (7007601) is provided subject to the disclaimer at the end of this document.

Environment

SUSE Linux Enterprise Server 11 Service Pack 1
SUSE Linux Real Time (SLERTE)

Situation

Every time a SLERTE server is rebooted, configured CPUsets must be created again. How can the CPUsets be configured persistent across reboots?

Resolution

If you use CPUsets, it is recommended to configure the cset service for persistent cpusets.

From the cset(1) man page:

PERSISTENT CPUSETS
To create a persistent cpuset setup, i.e. one that survives a reboot, you need to create the file /etc/init.d/cset. This distribuition of cset includes an example cset init.d file found in /usr/share/doc/pacakges/cpuset which is called cset.init.d. You will need to alter the file to your specifications and copy it to be the file /etc/init.d/cset. See the comments in that file for more details.

INSTRUCTIONS
1. Make sure the cpuset rpm package is installed.
# zypper in cpuset

2. Copy the default cset service script to /etc/init.d.
# cp /usr/share/doc/pacakges/cpuset/cset.init.d /etc/init.d/

3. Rename the cset service template script
# mv /etc/init.d/cset.init.d /etc/init.d/cset

4. Customize the /etc/init.d/cset script to meet your needs.
NOTE: See example script below

5. Turn the service on.
# insserv cset

6. Start the service.
# /etc/init.d/cset start

WARNING: The default /usr/share/doc/pacakges/cpuset/cset.init.d service script is blank. It will NOT work until you customize the start() and stop() sections to meet your server needs.

Additional Information

EXAMPLE
The following is an example of the /etc/init.d/cset file that creates and destroys a two cpusets called "system" and "rtcpus".

#!/bin/sh
#
# Example system startup script for setting up presistent cpusets with the
# cset tool from package cpuset. Copy this script to /etc/init.d/cset and
# uncomment out the commands in start() and stop() below, or add your own.
# Based on /etc/init.d/skeleton template.
#
# Copyright (C) 2009 Novell, Inc.
#
# This library is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or (at
# your option) any later version.
#
# This library is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307,
# USA.
##
# LSB compatible service control script; see http://www.linuxbase.org/spec/
#
# Note: This template uses functions rc_XXX defined in /etc/rc.status on
# UnitedLinux/SUSE/Novell based Linux distributions. If you want to base your
# script on this template and ensure that it works on non UL based LSB
# compliant Linux distributions, you either have to provide the rc.status
# functions from UL or change the script to work without them.
# See skeleton.compat for a template that works with other distros as well.
#
### BEGIN INIT INFO
# Provides: cset
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs
# Default-Start: 2 3 5
# Default-Stop: 0 1 6
# Short-Description: Make cpuset setup persistent across boots
# Description: Configure desired cpuset setup with the
# cset tool for persistent cpusets across boots.
### END INIT INFO
#
CSET_BIN=/usr/bin/cset
test -x $CSET_BIN || { echo "$CSET_BIN not installed";     if [ "$1" = "stop"]; then exit 0;    else exit 5; fi; }
CSET_SYSTEM=0
CSET_USER=1-3
. /etc/rc.status
rc_reset

case "$1" in    start)        echo -n "Starting cpuset "        $CSET_BIN shield --userset=rtcpus --cpu="$CSET_USER" --kthread=on        rc_status -v        ;;    stop)        echo -n "Shutting down cpuset "        $CSET_BIN set --set=system --destroy        $CSET_BIN set --set=rtcpus --destroy        rc_status -v        ;;    status)        echo -n "Checking for service cpuset "        $CSET_BIN set --recurse        rc_status -v        ;;    *)        echo "Usage: $0 {start|stop|status}"        exit 1        ;;
esac
rc_exit

Disclaimer

This Support Knowledgebase provides a valuable tool for NetIQ/Novell/SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.

  • Document ID:7007601
  • Creation Date:19-JAN-11
  • Modified Date:08-NOV-12
    • SUSESUSE Linux Enterprise Real Time Extension
      SUSE Linux Enterprise Server
< Back to Support Search

SUSE Support Forums

Get your questions answered by experienced Sys Ops or interact with other SUSE community experts.

Join Our Community

Support Resources

Learn how to get the most from the technical support you receive with your SUSE Subscription, Premium Support, Academic Program, or Partner Program.


SUSE Customer Support Quick Reference Guide SUSE Technical Support Handbook Update Advisories
Support FAQ

Open an Incident

Open an incident with SUSE Technical Support, manage your subscriptions, download patches, or manage user access.

Go to Customer Center