6.2 import

This commit is contained in:
Andrew A. Vasilyev 2019-05-30 17:36:10 +03:00
parent 630b896166
commit 514ddcb13c
10 changed files with 378 additions and 0 deletions

109
.gear/glusterd.init Normal file
View File

@ -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

6
.gear/glusterd.logrotate Normal file
View File

@ -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
}

9
.gear/glusterd.sysconfig Normal file
View File

@ -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"

106
.gear/glustereventsd.init Normal file
View File

@ -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

30
.gear/glusterfs.logrotate Normal file
View File

@ -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
}

2
.gear/glusterfs.watch Normal file
View File

@ -0,0 +1,2 @@
version=3
http://download.gluster.org/pub/gluster/glusterfs/LATEST/glusterfs-([\d.]+)\.tar\.gz

95
.gear/glusterfsd.init Normal file
View File

@ -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

View File

@ -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"

9
.gear/rules Normal file
View File

@ -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@:. .

4
.gear/umount.glusterfs Normal file
View File

@ -0,0 +1,4 @@
#!/bin/sh
umount "$1"