From dedbb60d0118601f007f949fbdcc2bda05a91969 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Pawe=C5=82=20Sikora?= Date: Wed, 4 Aug 2010 12:20:04 +0000 Subject: [PATCH] - new. Changed files: ggaoed.init -> 1.1 ggaoed.sysconfig -> 1.1 --- ggaoed.init | 114 +++++++++++++++++++++++++++++++++++++++++++++++ ggaoed.sysconfig | 4 ++ 2 files changed, 118 insertions(+) create mode 100644 ggaoed.init create mode 100644 ggaoed.sysconfig diff --git a/ggaoed.init b/ggaoed.init new file mode 100644 index 0000000..29f0d4b --- /dev/null +++ b/ggaoed.init @@ -0,0 +1,114 @@ +#!/bin/sh +# +# ggaoed This shell script takes care of starting and stopping ggaoed +# +# chkconfig: 2345 81 29 +# +# description: ggaoed is an AoE (ATA over Ethernet) target implementation for Linux. \ +# It utilizes Linux kernel AIO, memory mapped sockets and other Linux features \ +# to provide the best performance. +# +# pidfile: /var/run/ggaoed.pid +# config: /etc/ggaoed.conf + + +# Source function library +. /etc/rc.d/init.d/functions + +# Get network config +. /etc/sysconfig/network + +# Get service config +[ -f /etc/sysconfig/ggaoed.conf ] && . /etc/sysconfig/ggaoed.conf + +# Check that networking is up. +if is_yes "${NETWORKING}"; then + if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status -a "$1" != init ]; then + msg_network_down ggaoed + exit 1 + fi +else + exit 0 +fi + +start() { + # Check if the service is already running? + if [ ! -f /var/lock/subsys/ggaoed ]; then + msg_starting ggaoed + daemon /usr/sbin/ggaoed $GGAOED_OPTS + RETVAL=$? + [ $RETVAL -eq 0 ] && touch /var/lock/subsys/ggaoed + else + msg_already_running ggaoed + fi +} + +stop() { + if [ -f /var/lock/subsys/ggaoed ]; then + # Stop daemons. + msg_stopping ggaoed + killproc ggaoed + rm -f /var/lock/subsys/ggaoed >/dev/null 2>&1 + else + msg_not_running ggaoed + fi +} + +reload() { + if [ -f /var/lock/subsys/ggaoed ]; then + msg_reloading ggaoed + busy + ggaoectl reload + RETVAL=$? + [ $RETVAL -ne 0 ] && RETVAL=7 + [ $RETVAL -eq 0 ] && ok || fail + else + msg_not_running ggaoed + exit 7 + fi +} + +restart() { + stop + start +} + +condrestart() { + if [ -f /var/lock/subsys/ggaoed ]; then + stop + start + else + msg_not_running ggaoed + RETVAL=0 + fi +} + +RETVAL=0 +# See how we were called. +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart) + restart + ;; + try-restart) + condrestart + ;; + reload|force-reload) + reload + ;; + status) + status ggaoed + ggaoectl stats + exit $? + ;; + *) + msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|status}" + exit 3 +esac + +exit $RETVAL diff --git a/ggaoed.sysconfig b/ggaoed.sysconfig new file mode 100644 index 0000000..3d46dda --- /dev/null +++ b/ggaoed.sysconfig @@ -0,0 +1,4 @@ +# ggaoed startup configuration file + +# Try to define nice-level for running ggaoed +SERVICE_RUN_NICE_LEVEL="+5" -- 2.43.0