summaryrefslogtreecommitdiff
path: root/system
diff options
context:
space:
mode:
authorMario Preksavec <mario at slackware dot hr>2019-05-18 06:51:33 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2019-05-18 06:51:33 +0700
commitcfdf1e2c64ae2f7820ae18cc85d051929fb74873 (patch)
tree76afb167a0e95992ae0c8c7d7b9a7de02a797555 /system
parent05d40c537c6ca330a720cba131c184e24d081d7d (diff)
downloadslackbuilds-cfdf1e2c64ae2f7820ae18cc85d051929fb74873.tar.gz
system/sanlock: Added (shared storage daemon).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system')
-rw-r--r--system/sanlock/README13
-rw-r--r--system/sanlock/README.SLACKWARE26
-rw-r--r--system/sanlock/doinst.sh29
-rw-r--r--system/sanlock/sanlock.SlackBuild131
-rw-r--r--system/sanlock/sanlock.info10
-rw-r--r--system/sanlock/slack-desc19
6 files changed, 228 insertions, 0 deletions
diff --git a/system/sanlock/README b/system/sanlock/README
new file mode 100644
index 0000000000..fe32fa73d1
--- /dev/null
+++ b/system/sanlock/README
@@ -0,0 +1,13 @@
+The sanlock daemon manages leases for applications on hosts using shared
+storage.
+
+You must have a sanlock user to run this script:
+
+ # groupadd -g 363 sanlock
+ # useradd -u 363 -d /var/run/sanlock -s /bin/false -g sanlock sanlock
+
+The disk group is also needed:
+
+ # usermod -a -G disk sanlock
+
+More information post-install can be found in README.SLACKWARE
diff --git a/system/sanlock/README.SLACKWARE b/system/sanlock/README.SLACKWARE
new file mode 100644
index 0000000000..aa2f6ea006
--- /dev/null
+++ b/system/sanlock/README.SLACKWARE
@@ -0,0 +1,26 @@
+Starting the daemon on boot
+---------------------------
+
+You may wish to add these lines to /etc/rc.d/rc.local to start the service:
+
+ if [ -x /etc/rc.d/rc.wdmd ]; then
+ /etc/rc.d/rc.wdmd start
+ fi
+
+ if [ -x /etc/rc.d/rc.sanlock ]; then
+ /etc/rc.d/rc.sanlock start
+ fi
+
+You may also add these lines to /etc/rc.d/rc.local_shutdown:
+
+ if [ -x /etc/rc.d/rc.sanlock ]; then
+ /etc/rc.d/rc.sanlock stop
+ fi
+
+ if [ -x /etc/rc.d/rc.wdmd ]; then
+ /etc/rc.d/rc.wdmd stop
+ fi
+
+Remember to give executable permission to /etc/rc.d/rc.local_shutdown:
+
+ chmod 0755 /etc/rc.d/rc.local_shutdown
diff --git a/system/sanlock/doinst.sh b/system/sanlock/doinst.sh
new file mode 100644
index 0000000000..a4c200227e
--- /dev/null
+++ b/system/sanlock/doinst.sh
@@ -0,0 +1,29 @@
+config() {
+ NEW="$1"
+ OLD="$(dirname $NEW)/$(basename $NEW .new)"
+ # If there's no config file by that name, mv it over:
+ if [ ! -r $OLD ]; then
+ mv $NEW $OLD
+ elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
+ # toss the redundant copy
+ rm $NEW
+ fi
+ # Otherwise, we leave the .new copy for the admin to consider...
+}
+
+preserve_perms() {
+ NEW="$1"
+ OLD="$(dirname $NEW)/$(basename $NEW .new)"
+ if [ -e $OLD ]; then
+ cp -a $OLD ${NEW}.incoming
+ cat $NEW > ${NEW}.incoming
+ mv ${NEW}.incoming $NEW
+ fi
+ config $NEW
+}
+
+preserve_perms etc/rc.d/rc.sanlock.new
+preserve_perms etc/rc.d/rc.wdmd.new
+config etc/logrotate.d/sanlock.new
+config etc/sanlock/sanlock.conf.new
+config etc/default/wdmd.new
diff --git a/system/sanlock/sanlock.SlackBuild b/system/sanlock/sanlock.SlackBuild
new file mode 100644
index 0000000000..522d5552e6
--- /dev/null
+++ b/system/sanlock/sanlock.SlackBuild
@@ -0,0 +1,131 @@
+#!/bin/sh
+
+# Slackware build script for sanlock
+
+# Copyright 2019 Mario Preksavec, Zagreb, Croatia
+# All rights reserved.
+#
+# Redistribution and use of this script, with or without modification, is
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of this script must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+PRGNAM=sanlock
+VERSION=${VERSION:-3.7.1}
+BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) ARCH=i586 ;;
+ arm*) ARCH=arm ;;
+ *) ARCH=$( uname -m ) ;;
+ esac
+fi
+
+CWD=$(pwd)
+TMP=${TMP:-/tmp/SBo}
+PKG=$TMP/package-$PRGNAM
+OUTPUT=${OUTPUT:-/tmp}
+
+if [ "$ARCH" = "i586" ]; then
+ SLKCFLAGS="-O2 -march=i586 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "i686" ]; then
+ SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+fi
+
+# Bail if user or group isn't valid on your system
+if ! grep ^$PRGNAM: /etc/passwd 2>&1 > /dev/null; then
+ cat << EOF
+
+ You must have a $PRGNAM user to run this script
+
+ # groupadd -g 363 $PRGNAM
+ # useradd -u 363 -d /var/run/$PRGNAM -s /bin/false -g $PRGNAM $PRGNAM
+
+ The disk group is also needed
+
+ # usermod -a -G disk $PRGNAM
+
+EOF
+ exit
+fi
+
+set -e
+
+rm -rf $PKG
+mkdir -p $TMP $PKG $OUTPUT
+cd $TMP
+rm -rf {,$PRGNAM-}$PRGNAM-$VERSION
+tar xvf $CWD/$PRGNAM-$VERSION.tar.gz || tar xvf $CWD/$PRGNAM-$PRGNAM-$VERSION.tar.gz
+cd $PRGNAM-$VERSION || cd $PRGNAM-$PRGNAM-$VERSION
+chown -R root:root .
+find -L . \
+ \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
+ -o -perm 511 \) -exec chmod 755 {} \; -o \
+ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
+ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
+
+# We don't have stack clash protection support yet
+sed -i 's/-fstack-clash-protection//' */Makefile
+
+CFLAGS="$SLKCFLAGS" make -C wdmd
+CFLAGS="$SLKCFLAGS" make -C src
+CFLAGS="$SLKCFLAGS" make -C python
+
+make -C src install LIBDIR=/usr/lib${LIBDIRSUFFIX} DESTDIR=$PKG
+make -C wdmd install LIBDIR=/usr/lib${LIBDIRSUFFIX} DESTDIR=$PKG
+make -C python install LIBDIR=/usr/lib${LIBDIRSUFFIX} DESTDIR=$PKG
+
+install -D -m0755 -oroot -groot init.d/sanlock $PKG/etc/rc.d/rc.sanlock.new
+install -D -m0755 -oroot -groot init.d/wdmd $PKG/etc/rc.d/rc.wdmd.new
+sed -e "s|/etc/sysconfig|/etc/default|g" \
+ -i $PKG/etc/rc.d/rc.sanlock.new \
+ -i $PKG/etc/rc.d/rc.wdmd.new
+
+install -D -m0644 -oroot -groot src/logrotate.sanlock $PKG/etc/logrotate.d/sanlock.new
+install -D -m0644 -oroot -groot src/sanlock.conf $PKG/etc/sanlock/sanlock.conf.new
+install -D -m0644 -oroot -groot init.d/wdmd.sysconfig $PKG/etc/default/wdmd.new
+
+mkdir -p $PKG/{etc/wdmd.d,var/run/sanlock}
+
+mv $PKG/usr/share/man $PKG/usr
+rmdir $PKG/usr/share
+
+find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
+ | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
+
+find $PKG/usr/man -type f -exec gzip -9 {} \;
+for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
+
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a README.rst $PKG/usr/doc/$PRGNAM-$VERSION
+cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+cat $CWD/README.SLACKWARE > $PKG/usr/doc/$PRGNAM-$VERSION/README.SLACKWARE
+
+mkdir -p $PKG/install
+cat $CWD/slack-desc > $PKG/install/slack-desc
+cat $CWD/doinst.sh > $PKG/install/doinst.sh
+
+cd $PKG
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
diff --git a/system/sanlock/sanlock.info b/system/sanlock/sanlock.info
new file mode 100644
index 0000000000..864a393d5f
--- /dev/null
+++ b/system/sanlock/sanlock.info
@@ -0,0 +1,10 @@
+PRGNAM="sanlock"
+VERSION="3.7.1"
+HOMEPAGE="https://pagure.io/sanlock"
+DOWNLOAD="https://pagure.io/sanlock/archive/sanlock-3.7.1/sanlock-sanlock-3.7.1.tar.gz"
+MD5SUM="d78996fcdc6965c238a7a33ba1a2d10e"
+DOWNLOAD_x86_64=""
+MD5SUM_x86_64=""
+REQUIRES=""
+MAINTAINER="Mario Preksavec"
+EMAIL="mario at slackware dot hr"
diff --git a/system/sanlock/slack-desc b/system/sanlock/slack-desc
new file mode 100644
index 0000000000..cab0bffee3
--- /dev/null
+++ b/system/sanlock/slack-desc
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description.
+# Line up the first '|' above the ':' following the base package name, and
+# the '|' on the right side marks the last column you can put a character in.
+# You must make exactly 11 lines for the formatting to be correct. It's also
+# customary to leave one space after the ':' except on otherwise blank lines.
+
+ |-----handy-ruler------------------------------------------------------|
+sanlock: sanlock (shared storage daemon)
+sanlock:
+sanlock: The sanlock daemon manages leases for applications on hosts using
+sanlock: shared storage.
+sanlock:
+sanlock: Homepage: https://pagure.io/sanlock
+sanlock:
+sanlock:
+sanlock:
+sanlock:
+sanlock: