diff options
author | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2012-06-13 09:50:07 -0400 |
---|---|---|
committer | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2012-06-13 09:50:07 -0400 |
commit | afc2236cb97bdfd00cd3d7c54669b52861266b03 (patch) | |
tree | e0c59c7fd883ddb8093ccf08101afb395d9f00ac | |
parent | 0e5e54118824d477af758cb2c336a1dad79db407 (diff) | |
download | bcfg2-afc2236cb97bdfd00cd3d7c54669b52861266b03.tar.gz bcfg2-afc2236cb97bdfd00cd3d7c54669b52861266b03.tar.bz2 bcfg2-afc2236cb97bdfd00cd3d7c54669b52861266b03.zip |
bcfg2 cronjob fixes:
* look in all approprite places for bcfg2-cron -- it's installed in
different places in different specfiles
* send output to syslog instead of /dev/null
* exit with sensible return code
* complain if no bcfg2-cron is found at all
-rwxr-xr-x[-rw-r--r--] | debian/bcfg2.cron.daily | 14 | ||||
-rwxr-xr-x[-rw-r--r--] | debian/bcfg2.cron.hourly | 14 |
2 files changed, 24 insertions, 4 deletions
diff --git a/debian/bcfg2.cron.daily b/debian/bcfg2.cron.daily index 92e8ff02c..d69ab5036 100644..100755 --- a/debian/bcfg2.cron.daily +++ b/debian/bcfg2.cron.daily @@ -1,3 +1,13 @@ #!/bin/sh -[ -x /usr/lib/bcfg2/bcfg2-cron ] || exit 0 -/usr/lib/bcfg2/bcfg2-cron --daily > /dev/null 2>&1 || true +BCFG2CRON= +if [[ -x /usr/libexec/bcfg2-cron ]]; then + BCFG2CRON=/usr/libexec/bcfg2-cron +elif [[ -x /usr/lib/bcfg2/bcfg2-cron ]]; then + BCFG2CRON=/usr/lib/bcfg2/bcfg2-cron +elif type bcfg2-cron >& /dev/null; then + BCFG2CRON=bcfg2-cron +else + echo "No bcfg2-cron command found" + exit 1 +fi +/usr/lib/bcfg2/bcfg2-cron --daily 2>&1 | logger -t bcfg2-cron -p daemon.info diff --git a/debian/bcfg2.cron.hourly b/debian/bcfg2.cron.hourly index 1fdb9c30e..330b9c0db 100644..100755 --- a/debian/bcfg2.cron.hourly +++ b/debian/bcfg2.cron.hourly @@ -1,3 +1,13 @@ #!/bin/sh -[ -x /usr/lib/bcfg2/bcfg2-cron ] || exit 0 -/usr/lib/bcfg2/bcfg2-cron --hourly > /dev/null 2>&1 || true +BCFG2CRON= +if [[ -x /usr/libexec/bcfg2-cron ]]; then + BCFG2CRON=/usr/libexec/bcfg2-cron +elif [[ -x /usr/lib/bcfg2/bcfg2-cron ]]; then + BCFG2CRON=/usr/lib/bcfg2/bcfg2-cron +elif type bcfg2-cron >& /dev/null; then + BCFG2CRON=bcfg2-cron +else + echo "No bcfg2-cron command found" + exit 1 +fi +/usr/lib/bcfg2/bcfg2-cron --hourly 2>&1 | logger -t bcfg2-cron -p daemon.info |