#92 Fine-grained p*apply scripts


I'd like to see a variant on the preapply/postapply scripts such that the script is a part of a transcript and is only run if the transcript or command file changes. Three examples -

Run lilo if and only if a kernel changed
Run ldconfig only when new libraries are installed
Stop and restart a service if and only if the service is being updated


  • Jeff Kelley

    Jeff Kelley - 2010-06-04

    What do you mean by "such that the script is a part of a transcript"? Couldn't you just write pre- and post-apply scripts that do the things that you're asking? I have, for instance, a pre-apply script for Mac OS X that deals with kernel extensions; it only does what it needs to if the kernel extensions have changed.

  • Steve Simmons

    Steve Simmons - 2010-06-04

    If you have pre- and post- condition scripts, my understanding is that they'll always get run even if the transcript they are part of does not cause any update to the system. Yes, you can write the scripts such that they check to see what changed, but each script still gets invoked with the change details unless you explicitly decline it. (I'd be happy to be wrong about this, btw.)

    My preference is that the pre/post scripts shouldn't have to check such things - they should only be invoked if the transcript they are part actually had to be applied.

  • Jeff Kelley

    Jeff Kelley - 2010-06-10

    While I see your point, this sounds pretty far outside of ra.sh's scope. I, for one, wouldn't want this to be the default, as my pre-apply scripts are in different transcripts than some of the things they modify. I'm not in a position to say what features will or will not be implemented, but this really seems like something you should be checking in the pre-appy script itself. Using grep to look at an applicable transcript shouldn't be too much of a performance hit.


Log in to post a comment.