From 514ddcb13c9cb1bd86169af915b29faa026d5881 Mon Sep 17 00:00:00 2001 From: "Andrew A. Vasilyev" Date: Thu, 30 May 2019 17:36:10 +0300 Subject: [PATCH] 6.2 import --- .gear/glusterd.init | 109 +++++++++++++++++++++++++++++++++++++ .gear/glusterd.logrotate | 6 ++ .gear/glusterd.sysconfig | 9 +++ .gear/glustereventsd.init | 106 ++++++++++++++++++++++++++++++++++++ .gear/glusterfs.logrotate | 30 ++++++++++ .gear/glusterfs.watch | 2 + .gear/glusterfsd.init | 95 ++++++++++++++++++++++++++++++++ .gear/glusterfsd.sysconfig | 8 +++ .gear/rules | 9 +++ .gear/umount.glusterfs | 4 ++ 10 files changed, 378 insertions(+) create mode 100644 .gear/glusterd.init create mode 100644 .gear/glusterd.logrotate create mode 100644 .gear/glusterd.sysconfig create mode 100644 .gear/glustereventsd.init create mode 100644 .gear/glusterfs.logrotate create mode 100644 .gear/glusterfs.watch create mode 100644 .gear/glusterfsd.init create mode 100644 .gear/glusterfsd.sysconfig create mode 100644 .gear/rules create mode 100644 .gear/umount.glusterfs diff --git a/.gear/glusterd.init b/.gear/glusterd.init new file mode 100644 index 000000000..9f415d5a6 --- /dev/null +++ b/.gear/glusterd.init @@ -0,0 +1,109 @@ +#!/bin/sh +# +# glusterd gluster server. +# +# chkconfig: - 20 20 +# description: This file starts / stops the gluster server +# processname: glusterd +# config: /etc/glusterfs/gluster.vol +# pidfile: /var/run/glusterd.pid + +### BEGIN INIT INFO +# Provides: glusterd +# Required-Start: $local_fs $network +# Required-Stop: $local_fs $network +# Should-Start: +# Should-Stop: +# Default-Start: +# Default-Stop: 0 1 2 3 4 5 6 +# Short-Description: glusterfs server +# Description: Clustered file-system server +### END INIT INFO + +# Do not load RH compatibility interface. +WITHOUT_RC_COMPAT=1 + +# Source function library. +. /etc/init.d/functions + + +NAME=glusterd +SCRIPTNAME=/etc/init.d/$NAME +DAEMON=/usr/sbin/$NAME +PIDFILE=/var/run/$NAME.pid +LOCKFILE=/var/lock/subsys/$NAME +SourceIfNotEmpty /etc/sysconfig/$NAME +GLUSTERFSD_OPTS="-f $GLUSTERFSD_CONFIG -l $GLUSTERFSD_LOGFILE -L $GLUSTERFSD_LOGLEVEL -p $PIDFILE" +RETVAL=0 + + +start() +{ + [ -x $exec ] || exit 5 + ulimit -n $GLUSTERFSD_NOFILE + start_daemon --pidfile "$PIDFILE" --lockfile "$LOCKFILE" --expect-user root -- $DAEMON $GLUSTERFSD_OPTS + RETVAL=$? + return $RETVAL +} + +stop() +{ + stop_daemon --pidfile "$PIDFILE" --lockfile "$LOCKFILE" --expect-user root -- $NAME + RETVAL=$? + return $RETVAL +} + +restart() +{ + stop + start +} + +reload() +{ + msg_reloading $NAME + stop_daemon --pidfile "$PIDFILE" --expect-user root -HUP -- $NAME + RETVAL=$? + return $RETVAL +} + +# See how we were called. +case "$1" in + start) + start + ;; + stop) + stop + ;; + reload|force-reload) + reload + ;; + restart) + restart + ;; + condstop) + if [ -e "$LOCKFILE" ]; then + stop + fi + ;; + condrestart|try-restart) + if [ -e "$LOCKFILE" ]; then + restart + fi + ;; + condreload) + if [ -e "$LOCKFILE" ]; then + reload + fi + ;; + status) + status --pidfile "$PIDFILE" --expect-user root -- $NAME + RETVAL=$? + ;; + *) + msg_usage "${0##*/} {start|stop|reload|restart|condstop|condrestart|condreload|status}" + RETVAL=1 +esac + +exit $RETVAL + diff --git a/.gear/glusterd.logrotate b/.gear/glusterd.logrotate new file mode 100644 index 000000000..3fce6469f --- /dev/null +++ b/.gear/glusterd.logrotate @@ -0,0 +1,6 @@ +/var/log/glusterfs/*glusterd.vol.log { + missingok + postrotate + /bin/kill -HUP `cat /var/run/glusterd.pid 2>/dev/null` 2>/dev/null || true + endscript +} diff --git a/.gear/glusterd.sysconfig b/.gear/glusterd.sysconfig new file mode 100644 index 000000000..0e047a36b --- /dev/null +++ b/.gear/glusterd.sysconfig @@ -0,0 +1,9 @@ +# Change the glusterd service defaults here. +# See "glusterd --help" outpout for defaults and possible values. + +GLUSTERFSD_CONFIG="/etc/glusterfs/glusterd.vol" +GLUSTERFSD_LOGFILE="/var/log/glusterfs/gluster.log" +GLUSTERFSD_LOGLEVEL="ERROR" +GLUSTERFSD_NOFILE="65536" + + diff --git a/.gear/glustereventsd.init b/.gear/glustereventsd.init new file mode 100644 index 000000000..29b70187d --- /dev/null +++ b/.gear/glustereventsd.init @@ -0,0 +1,106 @@ +#!/bin/sh +# +# glustereventsd glustereventsd server. +# +# chkconfig: - 20 80 +# description: This file starts / stops the gluster events server +# processname: glustereventsd +# pidfile: /var/run/glustereventsd.pid + +### BEGIN INIT INFO +# Provides: glustereventsd +# Required-Start: $local_fs $network +# Required-Stop: $local_fs $network +# Should-Start: +# Should-Stop: +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: glusterfs Events server +# Description: GlusterFS Events Server +### END INIT INFO +# + +# Do not load RH compatibility interface. +WITHOUT_RC_COMPAT=1 + +# Source function library. +. /etc/init.d/functions + + +NAME=glustereventsd +DAEMON=/usr/sbin/$NAME +PIDFILE=/var/run/$NAME.pid +LOCKFILE=/var/lock/subsys/$NAME +SourceIfNotEmpty /etc/sysconfig/$NAME +GLUSTEREVENTSD_OPTS="--pid-file -p $PIDFILE" +RETVAL=0 + +start() +{ + [ -x $exec ] || exit 5 + start_daemon --pidfile "$PIDFILE" --lockfile "$LOCKFILE" --expect-user root -- $DAEMON $GLUSTEREVENTSD_OPTS + RETVAL=$? + return $RETVAL +} + +stop() +{ + stop_daemon --pidfile "$PIDFILE" --lockfile "$LOCKFILE" --expect-user root -- $NAME + RETVAL=$? + return $RETVAL +} + +restart() +{ + stop + start +} + +reload() +{ + msg_reloading $NAME + stop_daemon --pidfile "$PIDFILE" --expect-user root -HUP -- $NAME + RETVAL=$? + return $RETVAL +} + +# See how we were called. +case "$1" in + start) + start + ;; + stop) + stop + ;; + reload|force-reload) + reload + ;; + restart) + restart + ;; + condstop) + if [ -e "$LOCKFILE" ]; then + stop + fi + ;; + condrestart|try-restart) + if [ -e "$LOCKFILE" ]; then + restart + fi + ;; + condreload) + if [ -e "$LOCKFILE" ]; then + reload + fi + ;; + status) + status --pidfile "$PIDFILE" --expect-user root -- $NAME + RETVAL=$? + ;; + *) + msg_usage "${0##*/} {start|stop|reload|restart|condstop|condrestart|condreload|status}" + RETVAL=1 +esac + +exit $RETVAL + diff --git a/.gear/glusterfs.logrotate b/.gear/glusterfs.logrotate new file mode 100644 index 000000000..f95c704db --- /dev/null +++ b/.gear/glusterfs.logrotate @@ -0,0 +1,30 @@ +# Rotate client logs +/var/log/glusterfs/*.log { + sharedscripts + size=100M + weekly + rotate 5 + missingok + compress + nodelaycompress + notifempty + postrotate + /usr/bin/killall -HUP glusterfs > /dev/null 2>&1 || true + /usr/bin/killall -HUP glusterd > /dev/null 2>&1 || true + endscript +} + +# Rotate server logs +/var/log/glusterfs/bricks/*.log { + sharedscripts + size=100M + weekly + rotate 5 + missingok + compress + nodelaycompress + notifempty + postrotate + /usr/bin/killall -HUP glusterfsd > /dev/null 2>&1 || true + endscript +} diff --git a/.gear/glusterfs.watch b/.gear/glusterfs.watch new file mode 100644 index 000000000..1a05f933a --- /dev/null +++ b/.gear/glusterfs.watch @@ -0,0 +1,2 @@ +version=3 +http://download.gluster.org/pub/gluster/glusterfs/LATEST/glusterfs-([\d.]+)\.tar\.gz diff --git a/.gear/glusterfsd.init b/.gear/glusterfsd.init new file mode 100644 index 000000000..353754339 --- /dev/null +++ b/.gear/glusterfsd.init @@ -0,0 +1,95 @@ +#!/bin/sh +# +# glusterfsd gluster server. +# +# chkconfig: - 80 20 +# description: This file starts / stops the gluster server +# processname: glusterfsd +# config: /etc/glusterfs/server.vol +# pidfile: /var/run/glusterfsd.pid + +# Do not load RH compatibility interface. +WITHOUT_RC_COMPAT=1 + +# Source function library. +. /etc/init.d/functions + +NAME=glusterfsd +SCRIPTNAME=/etc/init.d/$NAME +DAEMON=/usr/sbin/$NAME +PIDFILE=/var/run/$NAME.pid +LOCKFILE=/var/lock/subsys/$NAME +CONFIGFILE=/etc/glusterfs/server.vol +GLUSTERFS_OPTS="-p $PIDFILE -f $CONFIGFILE" +RETVAL=0 + +SourceIfNotEmpty /etc/sysconfig/$NAME + +start() +{ + start_daemon --pidfile "$PIDFILE" --lockfile "$LOCKFILE" --expect-user root -- $DAEMON $GLUSTERFS_OPTS + RETVAL=$? + return $RETVAL +} + +stop() +{ + stop_daemon --pidfile "$PIDFILE" --lockfile "$LOCKFILE" --expect-user root -- $NAME + RETVAL=$? + return $RETVAL +} + +restart() +{ + stop + start +} + +reload() +{ + msg_reloading $NAME + stop_daemon --pidfile "$PIDFILE" --expect-user root -HUP -- $NAME + RETVAL=$? + return $RETVAL +} + +# See how we were called. +case "$1" in + start) + start + ;; + stop) + stop + ;; + reload) + reload + ;; + restart) + restart + ;; + condstop) + if [ -e "$LOCKFILE" ]; then + stop + fi + ;; + condrestart) + if [ -e "$LOCKFILE" ]; then + restart + fi + ;; + condreload) + if [ -e "$LOCKFILE" ]; then + reload + fi + ;; + status) + status --pidfile "$PIDFILE" --expect-user root -- $NAME + RETVAL=$? + ;; + *) + msg_usage "${0##*/} {start|stop|reload|restart|condstop|condrestart|condreload|status}" + RETVAL=1 +esac + +exit $RETVAL + diff --git a/.gear/glusterfsd.sysconfig b/.gear/glusterfsd.sysconfig new file mode 100644 index 000000000..f46cd7d5c --- /dev/null +++ b/.gear/glusterfsd.sysconfig @@ -0,0 +1,8 @@ +# Change the glusterfsd service defaults here. +# See "glusterfsd --help" outpout for defaults and possible values. + +#GLUSTERFSD_CONFIG="/etc/glusterfs/glusterfsd.vol" +#GLUSTERFSD_LOGFILE="/var/log/glusterfs/glusterfs.log" +#GLUSTERFSD_LOGLEVEL="NORMAL" +#GLUSTERFSD_NOFILE="65536" + diff --git a/.gear/rules b/.gear/rules new file mode 100644 index 000000000..4303c7add --- /dev/null +++ b/.gear/rules @@ -0,0 +1,9 @@ +copy: .gear/*.glusterfs +copy: .gear/*.logrotate +#copy: .gear/*.service +copy: .gear/*.sysconfig +copy: .gear/*.init +copy: .gear/*.watch +spec: .gear/glusterfs.spec +tar: v@version@:. +diff: v@version@:. . diff --git a/.gear/umount.glusterfs b/.gear/umount.glusterfs new file mode 100644 index 000000000..9aefa5f2c --- /dev/null +++ b/.gear/umount.glusterfs @@ -0,0 +1,4 @@ +#!/bin/sh + +umount "$1" +