Bug#367333: [Pkg-aide-maintainers] Bug#367333: aide: dotlockfile
presence test incorrect
Marc Haber
mh+debian-packages at zugschlus.de
Mon May 15 07:34:31 UTC 2006
On Mon, May 15, 2006 at 12:48:52AM -0600, Bob Proulx wrote:
> The test for the presence of dotlockfile is incorrect. It fails to
> detect if dotlockfile is not installed.
Thanks for spotting this.
> if [ -x $(which dotlockfile) ]; then
> ...
> else
> echo >&2 "no dotlockfile binary in path, not checking for already running aide"
> fi
I'll probably remove the check since aide depends on liblockfile1 in
these days, and thus dotlockfile is guaranteed to be present.
Objections?
> The developers reference contains some suggestions for dealing with
> this type of situation.
>
> http://www.us.debian.org/doc/developers-reference/ch-best-pkging-practices.en.html#s-bpp-debian-maint-scripts
Yes, and it also says that using which is an acceptable alternative
for scripts that don't run early in system startup.
> Here is a suggested fix based upon those recommendations. Although
> many other good solutions also exist.
>
> pathfind() {
> OLDIFS="$IFS"
> IFS=:
> for p in $PATH; do
> if [ -x "$p/$*" ]; then
> IFS="$OLDIFS"
> return 0
> fi
> done
> IFS="$OLDIFS"
> return 1
> }
>
> if pathfind dotlockfile; then
> if ! dotlockfile -p -l $LOCKFILE; then
> echo >&2 "cannot obtain lock $LOCKFILE, stale lock?"
> exit 1
> fi
> else
> echo >&2 "no dotlockfile binary in path, not checking for already running aide"
> fi
I hate that idea. Huge complexity added.
Greetings
Marc
--
-----------------------------------------------------------------------------
Marc Haber | "I don't trust Computers. They | Mailadresse im Header
Mannheim, Germany | lose things." Winona Ryder | Fon: *49 621 72739834
Nordisch by Nature | How to make an American Quilt | Fax: *49 621 72739835
More information about the Pkg-aide-maintainers
mailing list