summaryrefslogtreecommitdiffstats
path: root/manifests/volume.pp
diff options
context:
space:
mode:
authorJames Shubin <james@shubin.ca>2013-12-24 08:06:57 -0500
committerJames Shubin <james@shubin.ca>2013-12-24 08:06:57 -0500
commitfcd9ec7f5d868753145027e764add098c0a98c46 (patch)
tree24b7a63a78b9caea17e47c7470777dde8cbaa598 /manifests/volume.pp
parent680a7878af062decc9924dd49fe295e545b527ae (diff)
downloadpuppet-gluster-fcd9ec7f5d868753145027e764add098c0a98c46.tar.gz
puppet-gluster-fcd9ec7f5d868753145027e764add098c0a98c46.tar.xz
puppet-gluster-fcd9ec7f5d868753145027e764add098c0a98c46.zip
Updated shell scripts to use sponge.
Avoids any chance of a race due to modifying the file in place.
Diffstat (limited to 'manifests/volume.pp')
-rw-r--r--manifests/volume.pp4
1 files changed, 2 insertions, 2 deletions
diff --git a/manifests/volume.pp b/manifests/volume.pp
index 296849d..5058d24 100644
--- a/manifests/volume.pp
+++ b/manifests/volume.pp
@@ -339,12 +339,12 @@ define gluster::volume(
$stack_truncate = "${maxlength}" ? {
'-1' => '', # unlimited
#default => sprintf("&& /bin/sed -i '%d,$ d' ${stackfile}", inline_template('<%= maxlength.to_i.abs+1 %>')),
- default => sprintf(" && (/bin/grep -v '^$' ${stackfile} | /usr/bin/tail -%d | /usr/bin/tee ${stackfile})", inline_template('<%= maxlength.to_i.abs %>')),
+ default => sprintf(" && (/bin/grep -v '^$' ${stackfile} | /usr/bin/tail -n %d | /usr/bin/sponge ${stackfile})", inline_template('<%= maxlength.to_i.abs %>')),
}
$watch_truncate = "${maxlength}" ? {
'-1' => '', # unlimited
#default => sprintf("&& /bin/sed -i '%d,$ d' ${watchfile}", inline_template('<%= maxlength.to_i.abs+1 %>')),
- default => sprintf(" && (/bin/grep -v '^$' ${watchfile} | /usr/bin/tail -%d | /usr/bin/tee ${watchfile})", inline_template('<%= maxlength.to_i.abs %>')),
+ default => sprintf(" && (/bin/grep -v '^$' ${watchfile} | /usr/bin/tail -n %d | /usr/bin/sponge ${watchfile})", inline_template('<%= maxlength.to_i.abs %>')),
}
if $are_bricks_collected and ("${valid_input}" != '') { # ready or not?