[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

aide and packaging problems



OK. Michael Vogt and I spoke and he's fine with me maintaining the aide
package (I'm still waiting on new-maintainer, but it looks like it'll fully
reopen long before the cutoff for uploading packages to woody ;).
I do have one strange problem I'd like to ask about. I include in my
package a script called "aideinit" which just generates a new database and
asks you if you want to move the new db over the old one. Nothing major.
It's worked like a charm since I packaged this several weeks ago.
Yesterday (just before reading Joey's question about packaging this program,
oddly enough) I decided it was time to put debconf support in since I
finally had a personal potato box at my disposal. Now, however, a strange
thing happens. My aideinit script asks two questions (just an echo -n and
read) - whether or not you want to overwrite the current aide.db.new, and
whether or not you want to replace the aide.db with the aide.db.new.
Obviously it only asks the first question if it's necessary. During a
standalone run of the aideinit script all is well, but when it's run from
within postinst, the second question hangs. Throwing a set -x into all these
scripts shows that it's being successfully run, but when it does the "read"
it just doesn't seem to be taking my input. It never returns to the postinst
script, I have to break out of it, do a dpkg --pending --configure and tell
debconf *not* to run aideinit, and then run it manually (outside of
postinst). Here's the fragment from postinst that runs it:

db_get aide/aideinit
[ "$RET" = "true" ] && /usr/sbin/aideinit

Nothing insane. Also, here's the aideinit fragment that's having the
problem:
cat << EOF;

You will need to copy the file /usr/lib/aide/aide.db.new to
/usr/lib/aide/aide.db before aide uses it. It is advisable for you
to first look over the new db. Say y to the following question to
ignore this sage advice.

EOF
echo -n "Copy aide.db.new to aide.db [y/N]? "
unset yn
read yn
[ -n "$yn" ] || yn="n"
while true; do
case "$yn" in
   [yY]*)
        cp -f /usr/lib/aide/aide.db.new /usr/lib/aide/aide.db
        break
        ;;
   [nN]*)
        exit 0
        ;;
esac
done

After sticking in a "echo" after the "while true; do" I've determined also
that it's not the loop - although my set -x output shows it's not reaching
the loop anyway:
You will need to copy the file /usr/lib/aide/aide.db.new to
/usr/lib/aide/aide.db before aide uses it. It is advisable for you
to first look over the new db. Say y to the following question to
ignore this sage advice.

+ echo -n 'Copy aide.db.new to aide.db [y/N]? '
Copy aide.db.new to aide.db [y/N]? + read yn
y
n

But again, it works just fine when *not* being run from postinst. This is a
potato system up-to-date as of about half an hour ago. Any ideas?

-- 
Mike Markley <mike@markley.org>
PGP: 0xA9592D4D 62 A7 11 E2 23 AD 4F 57  27 05 1A 76 56 92 D5 F6
GPG: 0x3B047084 7FC7 0DC0 EF31 DF83 7313  FE2B 77A8 F36A 3B04 7084

One of the advantages of being a captain is being able to ask for
advice without necessarily having to take it.
- Kirk, "Dagger of the Mind", stardate 2715.2


Reply to: