[ubuntu-mono] [Bug 78006] /etc/cron.daily/beagle-crawl-system fails to work because of "set -e"
Richard Laager
rlaager at users.sf.net
Thu Jan 4 21:41:48 UTC 2007
Public bug reported:
Binary package hint: beagle
The beagle package creates /etc/cron.daily/beagle-crawl-system, a script
to crawl system directories. The second line of this file is "set -e",
which causes the script to terminate if any command returns failure. I
don't see any reason for this, given that the script has appropriate
error checking.
In fact, stopping on errors causes this script to fail to work at all.
For example, take these two lines of code:
OPTIONS="`test -n "$CRAWL_DISABLE_FILTERING" -a "$CRAWL_DISABLE_FILTERING" = "yes" && \
echo --disable-filtering`"
If CRAWL_DISABLE_FILTERING is "no", which seems to be the default, then
the test evaluates to FALSE, as desired. This prevents the echo from
adding --disable-filtering to the OPTIONS. However, this means that the
entire line has returned a non-zero exit code. When combined with the
"set -e" at the top of the script, the execution stops, without running
a beagle crawl.
Unless there's some reason the "set -e" is necessary, which I can't
find, then the solution is to remove that line. I've tested that and the
script works again.
** Affects: beagle (Ubuntu)
Importance: Undecided
Status: Unconfirmed
** Description changed:
Binary package hint: beagle
- The beagle package creates e, a script
+ The beagle package creates /etc/cron.daily/beagle-crawl-system, a script
to crawl system directories. The second line of this file is "set -e",
which causes the script to terminate if any command returns failure. I
don't see any reason for this, given that the script has appropriate
error checking.
In fact, stopping on errors causes this script to fail to work at all.
For example, take these two lines of code:
OPTIONS="`test -n "$CRAWL_DISABLE_FILTERING" -a "$CRAWL_DISABLE_FILTERING" = "yes" && \
echo --disable-filtering`"
If CRAWL_DISABLE_FILTERING is "no", which seems to be the default, then
the test evaluates to FALSE, as desired. This prevents the echo from
adding --disable-filtering to the OPTIONS. However, this means that the
entire line has returned a non-zero exit code. When combined with the
"set -e" at the top of the script, the execution stops, without running
a beagle crawl.
Unless there's some reason the "set -e" is necessary, which I can't
find, then the solution is to remove that line. I've tested that and the
script works again.
--
/etc/cron.daily/beagle-crawl-system fails to work because of "set -e"
https://launchpad.net/bugs/78006
More information about the Ubuntu-mono
mailing list