File tree Expand file tree Collapse file tree 3 files changed +33
-1
lines changed
Expand file tree Collapse file tree 3 files changed +33
-1
lines changed Original file line number Diff line number Diff line change @@ -59,18 +59,23 @@ ADD gluster-block-setup.service /etc/systemd/system/gluster-block-setup.service
5959ADD gluster-block-setup.sh /usr/sbin/gluster-block-setup.sh
6060ADD update-params.sh /usr/local/bin/update-params.sh
6161ADD tcmu-runner-params /etc/sysconfig/tcmu-runner-params
62+ ADD gluster-check-diskspace.service /etc/systemd/system/gluster-check-diskspace.service
63+ ADD check_diskspace.sh /usr/local/bin/check_diskspace.sh
6264
6365RUN chmod 644 /etc/systemd/system/gluster-setup.service && \
66+ chmod 644 /etc/systemd/system/gluster-check-diskspace.service && \
6467chmod 500 /usr/sbin/gluster-setup.sh && \
6568chmod 644 /etc/systemd/system/gluster-block-setup.service && \
6669chmod 500 /usr/sbin/gluster-block-setup.sh && \
6770chmod +x /usr/local/bin/update-params.sh && \
71+ chmod +x /usr/local/bin/check_diskspace.sh && \
6872systemctl disable nfs-server.service && \
6973systemctl mask getty.target && \
7074systemctl enable gluster-setup.service && \
7175systemctl enable gluster-block-setup.service && \
7276systemctl enable gluster-blockd.service && \
73- systemctl enable glusterd.service
77+ systemctl enable glusterd.service && \
78+ systemctl enable gluster-check-diskspace.service
7479
7580EXPOSE 2222 111 245 443 24007 2049 8080 6010 6011 6012 38465 38466 38468 38469 49152 49153 49154 49156 49157 49158 49159 49160 49161 49162
7681
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # Disk full
4+ while true
5+ do
6+ # sleep early to get glusterd settled
7+ sleep 120
8+ current_usage=$( df --output=pcent ' /var/lib/glusterd' | tail -n1 | awk {' print $1' } )
9+ max_usage=99%
10+ if [ " ${current_usage% ?} " -ge " ${max_usage% ?} " ]; then
11+ echo " $( date) - $( basename $0 ) : Running out of space in /var/lib/glusterd"
12+ echo " $( date) - $( basename $0 ) : Stopping glusterd"
13+ systemctl stop glusterd.service
14+ echo " $( date) -$( basename $0 ) : Stopped glusterd"
15+ break
16+ fi
17+ done
Original file line number Diff line number Diff line change 1+ [Unit]
2+ Description =Check glusterd config directory full
3+ After =glusterd.service
4+
5+ [Service]
6+ Type =simple
7+ ExecStart =/usr/local/bin/check_diskspace.sh
8+
9+ [Install]
10+ WantedBy =multi-user.target
You can’t perform that action at this time.
0 commit comments