[packages/dlm] PLD init script
jajcus
jajcus at pld-linux.org
Thu Nov 1 16:05:22 CET 2012
commit 262204ed2bfcdebcafedad4b671383c9cb5bbf75
Author: Jacek Konieczny <j.konieczny at eggsoft.pl>
Date: Thu Nov 1 16:04:12 2012 +0100
PLD init script
Release: 3
dlm.init | 85 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
dlm.spec | 8 +++---
dlm.sysconfig | 3 +++
3 files changed, 93 insertions(+), 3 deletions(-)
---
diff --git a/dlm.spec b/dlm.spec
index f3f6db2..0ea40c6 100644
--- a/dlm.spec
+++ b/dlm.spec
@@ -2,11 +2,13 @@ Summary: General-purpose distributed lock manager
Summary(pl.UTF-8): Zarządca rozproszonych blokad ogólnego przeznaczenia
Name: dlm
Version: 3.99.5
-Release: 2
+Release: 3
License: LGPL v2.1+, GPL v2
Group: Libraries
Source0: http://people.redhat.com/teigland/%{name}-%{version}.tar.gz
# Source0-md5: cad4999d0c42000bf5898af34f587728
+Source1: %{name}.init
+Source2: %{name}.sysconfig
Patch0: %{name}-link_order.patch
Patch1: %{name}-after_configfs.patch
URL: http://sources.redhat.com/cluster/dlm/
@@ -80,8 +82,8 @@ install -d $RPM_BUILD_ROOT{%{systemdunitdir},/etc/{rc.d/init.d,sysconfig}}
HDRDIR=%{_includedir}
install init/%{name}.service $RPM_BUILD_ROOT%{systemdunitdir}
-install init/%{name}.sysconfig $RPM_BUILD_ROOT/etc/sysconfig/%{name}
-install init/%{name}.init $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
+install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
+install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/%{name}
%clean
rm -rf $RPM_BUILD_ROOT
diff --git a/dlm.init b/dlm.init
new file mode 100644
index 0000000..102227a
--- /dev/null
+++ b/dlm.init
@@ -0,0 +1,85 @@
+#!/bin/sh
+#
+# dlm_controld
+#
+# chkconfig: 22 78
+# description: starts and stops dlm_controld
+#
+
+. /etc/rc.d/init.d/functions
+
+DLM_CONTROLD_OPTS=""
+
+[ -f /etc/sysconfig/dlm ] && . /etc/sysconfig/dlm
+
+setup() {
+ modprobe dlm > /dev/null 2>&1
+ mount -t configfs none /sys/kernel/config > /dev/null 2>&1
+}
+
+start() {
+
+ # Check if the service is already running?
+ if [ -f /var/lock/subsys/dlm ]; then
+ msg_already_running "dlm_controld"
+ return
+ fi
+
+ setup
+
+ msg_starting "dlm_controld"
+
+ daemon /usr/sbin/dlm_controld $DLM_CONTROLD_OPTS
+ RETVAL=$?
+ [ $RETVAL -eq 0 ] && touch /var/lock/subsys/dlm
+}
+
+stop() {
+ if [ ! -f /var/lock/subsys/dlm ]; then
+ msg_not_running "dlm_controld"
+ return
+ fi
+
+ msg_stopping "dlm_controld"
+ killproc dlm_controld
+ rm -f /var/lock/subsys/dlm
+}
+
+condrestart() {
+ if [ ! -f /var/lock/subsys/dlm ]; then
+ msg_not_running "dlm_controld"
+ RETVAL=$1
+ return
+ fi
+
+ stop
+ start
+}
+
+# See how we were called.
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ restart)
+ stop
+ start
+ ;;
+ try-restart)
+ condrestart 0
+ ;;
+ force-reload)
+ condrestart 0
+ ;;
+ status)
+ status --pidfile /var/run/dlm/dlm_controld.pid dlm dlm_controld
+ exit $?
+ ;;
+ *)
+ msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
+ exit 3
+esac
+exit $RETVAL
diff --git a/dlm.sysconfig b/dlm.sysconfig
new file mode 100644
index 0000000..58a6238
--- /dev/null
+++ b/dlm.sysconfig
@@ -0,0 +1,3 @@
+# DLM_CONTROLD_OPTS -- set command line options for dlm_controld
+# See dlm_controld man page for list of options.
+DLM_CONTROLD_OPTS=""
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/dlm.git/commitdiff/262204ed2bfcdebcafedad4b671383c9cb5bbf75
More information about the pld-cvs-commit
mailing list