Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-15-SP7:Update
numad
numad-opensuse-init.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File numad-opensuse-init.patch of Package numad
From 0f92675aadf2cd7a3db586f5b3ff507361e27b68 Mon Sep 17 00:00:00 2001 From: Mel Gorman <mgorman@suse.de> Date: Thu, 23 May 2013 00:14:31 +0100 Subject: [PATCH] Make init script openSUSE friendly Subject says it all, current init script is RHEL/Fedora based. Update systemd service script to shutdown numad cleanly. Signed-off-by: Mel Gorman <mgorman@suse.de> diff --git a/numad.init b/numad.init index 053bb07..de74a1b 100755 --- a/numad.init +++ b/numad.init @@ -1,109 +1,85 @@ #!/bin/bash -# chkconfig: - 99 1 -# description: Control operation of numad which will monitor and -# rebalance assignment of NUMA resources +# +# /etc/init.d/numad ### BEGIN INIT INFO # Provides: numad -# Required-Start: cgconfig -# Required-Stop: +# Required-Start: $remote_fs +# Required-Stop: $remote_fs # Should-Start: # Should-Stop: -# Default-Start: -# Default-Stop: -# Short-Description: numad control -# Description: +# Default-Start: 3 5 +# Default-Stop: 0 1 2 6 +# Short-Description: numad daemon recommends or binds workloads to NUMA nodes +# Description: numad is a userspace daemon that monitors NUMA usage +# and resource usage and attempts to configure workloads +# using cpusets to use a subset of CPUs and memory nodes +# to maximise the number local memory access for best +# performance. Alternatively, it can be used to give +# hints as to how workloads should be manually bound +# to CPUs and memory nodes. ### END INIT INFO -if [ $(id -u) -ne 0 ]; then - echo "This script can be run by root only. Exiting." - exit 4 -fi +NUMAD_BIN=/usr/sbin/numad +NUMAD_CONFIG=/etc/numad.conf -# Source function library. -. /etc/rc.d/init.d/functions +. /etc/rc.status +LOCKFILE=${PIDFILE}.lock -exec="/usr/bin/numad" -prog="numad" -config="/etc/numad.conf" +# Reset status of this service +rc_reset -[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog - -lockfile=/var/lock/subsys/$prog -base=${0##*/} - -start() { - [ -x $exec ] || exit 5 - [ -f $config ] || exit 6 - echo -n $"Starting $prog: " - . $config - daemon "$exec -i $INTERVAL" - retval=$? - echo - [ $retval -eq 0 ] && touch $lockfile - return $retval -} - -stop() { - echo -n $"Stopping $prog: " - killproc $prog - retval=$? - echo - [ $retval -eq 0 ] && rm -f $lockfile - return $retval -} +case "$1" in +start) + test -x $NUMAD_BIN || exit 5 + test -f $NUMAD_CONFIG || exit 6 + echo -n "Starting numad " + . $NUMAD_CONFIG + $NUMAD_BIN -i $INTERVAL + echo $! > "$PIDFILE" + touch "$LOCKFILE" + rc_status -v + ;; -restart() { - stop - start -} +stop) + echo -n "Shutting down numad " + $NUMAD_BIN -i 0 + RETVAL=$? + rc_status + if [ $RETVAL -eq 0 ]; then + rm -f "$LOCKFILE" "$PIDFILE" + fi + ;; -reload() { - restart -} +try-restart) + $0 status > /dev/null && $0 restart + rc_status + ;; -force_reload() { - restart -} +restart) + $0 stop + $0 start + rc_status + ;; -rh_status() { - # run checks to determine if the service is running or use generic status - status $prog -} +reload) + $0 restart + ;; -rh_status_q() { - rh_status >/dev/null 2>&1 -} +force_reload) + echo -n "Reload numad " + $0 restart + ;; +status) + echo -n "Checking for numad " + check_proc "$PIDFILE" "$LOCKFILE" -case "$1" in - start) - rh_status_q && exit 0 - $1 - ;; - stop) - rh_status_q || exit 0 - $1 - ;; - restart) - $1 - ;; - reload) - rh_status_q || exit 7 - $1 - ;; - force-reload) - force_reload - ;; - status) - rh_status - ;; - condrestart|try-restart) - rh_status_q || exit 0 - restart - ;; - *) - echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}" - exit 2 + rc_status -v + ;; +*) + echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload}" + exit 1 + ;; esac -exit $? +rc_exit diff --git a/numad.service b/numad.service index 3f096d8..faf51ef 100644 --- a/numad.service +++ b/numad.service @@ -6,6 +6,7 @@ After=syslog.target Type=forking EnvironmentFile=/etc/numad.conf ExecStart=/usr/sbin/numad -i $INTERVAL +ExecStop=/usr/sbin/numad -i 0 [Install] WantedBy=multi-user.target
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