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

Re: "One time" post-invoke hook



Le vendredi 06 novembre 2009 à 10:15 +0100, Julien Valroff a écrit :
> Le vendredi 06 novembre 2009 à 08:39 +0100, Julien Valroff a écrit :
> > Hi Charles,
> > 
> > Thanks for your answer.
> > 
> > Le vendredi 06 novembre 2009 à 15:37 +0900, Charles Plessy a écrit :
> > > > Le mercredi 04 novembre 2009 à 19:08 +0100, Julien Valroff a écrit :
> > > > > Hi,
> > > > > 
> > > > > 
> > > > > rkhunter recommends some packages, eg. unhide, which are configured
> > > > > after rkhunter, and hence after rkhunter postinst script is run.
> > > 
> > > Hello Julien,
> > > 
> > > if you can cooperate with the maintainers of packages like unhide, maybe you
> > > can arrange a dpkg trigger? (man 5 deb-triggers)
> > 
> > You are right, I think that is the best method which could also be used
> > by other packages so that the rkhunter database is only updated when
> > packages are upgraded/installed.
> > 
> > I already had a look to the triggers, but I am not sure to understand
> > everything.
> > 
> > In the rkhunter & unhide example, rkhunter needs to declare a trigger.
> > But where and how?
> > 
> > unhide needs to declare its interest in this trigger in debian/triggers
> > (interest <trigger-name>)
> 
> Well, I think I have done the right thing:
> add a debian/triggers to both rkhunter and unhide containing:
> interest rkhunter-update-database
> 
> In rkhunter postinst, I have added a triggered action which runs
> rkhunter --propupd
> 
> However, if I install rkhunter (unhide being installed automatically by
> aptitude), nothing happens.
> If I reinstall unhide, the trigger is activated.
> 
> It seems the trigger is not yet installed though rkhunter is configured
> before unhide.

OK, it seems it is the desired behaviour: "Note that if a consumer is
going to be normally configured (i.e. it is also being updated), then no
triggering may occur and thus the standard control flow of the
maintainer scripts should still take care to handle this."

Source: http://www.seanius.net/blog/2009/09/dpkg-triggers-howto/

As a consequence, the only solution I have found is to call rkhunter
--propupd from the rkhunter postinst script (to create the database if
the package is installed for the first time), and call it again from the
unhide postinst script (to update the entries for /usr/bin/unhide).

This is not a real solution as updating rkhunter database is quite slow
on low resource systems, and calling it twice in a row is absolutely not
acceptable.

Any better alternative someone could think of?

Cheers,
Julien


Reply to: