From 66862a60c225f2bbfebccdaa6cbd36a16dd15490 Mon Sep 17 00:00:00 2001 From: Rafal Mielniczuk Date: Mon, 8 Aug 2016 10:52:38 +0100 Subject: [PATCH] CP-15132: Convert to systemd Signed-off-by: Rafal Mielniczuk --- Makefile | 2 - scripts/init.d-rrdd-gpumon | 102 ------------------------------------- 2 files changed, 104 deletions(-) delete mode 100644 scripts/init.d-rrdd-gpumon diff --git a/Makefile b/Makefile index 2cd5d22..ccb3bb6 100644 --- a/Makefile +++ b/Makefile @@ -26,5 +26,3 @@ clean: install: build mkdir -p $(DESTDIR)$(LIBEXECDIR)/xcp-rrdd-plugins/ install -m 755 _build/gpumon/gpumon.native $(DESTDIR)$(LIBEXECDIR)/xcp-rrdd-plugins/xcp-rrdd-gpumon - mkdir -p $(DESTDIR)/etc/rc.d/init.d - install -m 755 scripts/init.d-rrdd-gpumon $(DESTDIR)/etc/rc.d/init.d/xcp-rrdd-gpumon diff --git a/scripts/init.d-rrdd-gpumon b/scripts/init.d-rrdd-gpumon deleted file mode 100644 index 063cb5c..0000000 --- a/scripts/init.d-rrdd-gpumon +++ /dev/null @@ -1,102 +0,0 @@ -#! /bin/bash -# -# xcp-rrdd-gpumon Start/Stop the GPU monitor RRD plugin -# -# chkconfig: 2345 18 82 -# description: XCP RRD plugin for monitoring GPU performance - -# Source function library. -. /etc/init.d/functions - -# names -NAME="xcp-rrdd-gpumon" - -# executable command: -GPUMON="/opt/xensource/libexec/xcp-rrdd-plugins/${NAME}" - -# pidfile: -PID_FILE="/var/run/${NAME}.pid" - -# lock file -SUBSYS_FILE="/var/lock/subsys/${NAME}" - -start() { - echo -n $"Starting XCP RRDD plugin ${NAME}: " - - if [ -e ${SUBSYS_FILE} ]; then - if [ -e ${PID_FILE} ] && [ -e /proc/`cat ${PID_FILE}` ]; then - echo -n $"cannot start ${NAME}: already running." - failure $"cannot start ${NAME}: already running." - echo - return 1 - fi - fi - - # Enable backtraces - export OCAMLRUNPARAM="b" - - ${GPUMON} -daemon -pidfile ${PID_FILE} >/dev/null 2>&1 /dev/null) - kill -0 ${PID} 2> /dev/null - if [ $? -eq 0 ]; then - touch ${SUBSYS_FILE} - success - echo - return 0 - fi - sleep 1 - echo -n . - RETRY=$(( ${RETRY} + 1 )) - done - if [ ${SUCCESS} -eq 1 ]; then - continue - fi - echo -n $"failed to start ${NAME}." - failure $"failed to start ${NAME}." - killproc ${NAME} - rm -f ${SUBSYS_FILE} ${PID_FILE} - echo - return 1 -} - -stop() { - echo -n $"Stopping XCP RRDD plugin ${NAME}: " - - if [ ! -e ${SUBSYS_FILE} ]; then - echo -n $"cannot stop ${NAME}: daemon is not running." - failure $"cannot stop ${NAME}: daemon is not running." - echo - return 1 - fi - - killproc ${NAME} - RETVAL=$? - echo - [ $RETVAL -eq 0 ] && rm -f ${SUBSYS_FILE} ${PID_FILE} - - return $RETVAL -} - -restart() { - stop - start -} - -case "$1" in - start) - start - ;; - stop) - stop - ;; - restart) - restart - ;; - *) - echo $"Usage: $0 {start|stop|restart}" - exit 1 -esac