Skip to content

Commit 63a0e67

Browse files
variable for sleep seconds using sytemd environment.
Signed-off-by: Saravanakumar Arumugam <[email protected]>
1 parent 0fbedef commit 63a0e67

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

CentOS/check_diskspace.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
while true
55
do
66
# sleep early to get glusterd settled
7-
sleep 120
7+
sleep $1
88
current_usage=$( df --output=pcent '/var/lib/glusterd' | tail -n1 | awk {'print $1'} )
99
max_usage=99%
1010
if [ "${current_usage%?}" -ge "${max_usage%?}" ]; then

CentOS/gluster-check-diskspace.service

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ After=glusterd.service
44

55
[Service]
66
Type=simple
7-
ExecStart=/usr/local/bin/check_diskspace.sh
7+
Environment="POLL_INTERVAL=120"
8+
ExecStart=/usr/local/bin/check_diskspace.sh $POLL_INTERVAL
89

910
[Install]
1011
WantedBy=multi-user.target

0 commit comments

Comments
 (0)