diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2007-10-03 08:57:54 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2007-10-03 08:57:54 +0300 |
commit | 70ed33417d1d122bfc434d106824a9035dea9463 (patch) | |
tree | 4537268b6a5c01e730ef60f0f9c2d6d6e11815e7 /scripts | |
parent | 249dad1475e08ba86f911f722a0421771ceb30ce (diff) | |
download | rpm-70ed33417d1d122bfc434d106824a9035dea9463.tar.gz rpm-70ed33417d1d122bfc434d106824a9035dea9463.tar.bz2 rpm-70ed33417d1d122bfc434d106824a9035dea9463.zip |
Small cronjob fixes (rhbz#315271)
- create cronjob temp file in target directory to ensure corrent
selinux context (rhbz#315271)
- dont leave empty files around in case of failure
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/rpm.daily | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/scripts/rpm.daily b/scripts/rpm.daily index 8a417a944..3a199ccab 100755 --- a/scripts/rpm.daily +++ b/scripts/rpm.daily @@ -1,9 +1,13 @@ #!/bin/sh -tmpfile=`/bin/mktemp rpmpkgs.XXXXXXXXX` || exit 1 +tmpfile=`/bin/mktemp /var/log/rpmpkgs.XXXXXXXXX` || exit 1 /bin/rpm -qa --qf '%{name}-%{version}-%{release}.%{arch}.rpm\n' 2>&1 \ | /bin/sort > "$tmpfile" -[ -s "$tmpfile" ] || exit 1 +if [ ! -s "$tmpfile" ]; then + rm -f "$tmpfile" + exit 1 +fi + /bin/mv "$tmpfile" /var/log/rpmpkgs /bin/chmod 0644 /var/log/rpmpkgs |