Re: debconf and daemons
On Fri, 29 Jun 2001, Eric Van Buggenhaut wrote:
> On Fri, Jun 29, 2001 at 04:00:47AM +1000, Sam Johnston wrote:
> > - debconf doesn't append '|| true' to the init.d stop in prerm. this
> > means that when start-stop-daemon returns 1 the removal/upgrade fails
> > miserably if the daemon isn't running or can't be stopped. imho this is
> > broken (although it may be better than removing a package under a daemon
> > that refuses to stop?). how do i get around this? ignore it?
in shell scripts (for debconf) you should always append a || true to
the commands executed when it is not really needed to fail. Actually
you should make your script fail prove (by testing and testing and did I
> > - debconf was surprisingly easy... however creating the config files once
> > the information has been obtained wasn't. i would have liked to have
> > filled in a template but ended up doing 'echo "key value" >> /etc/myfile'.
> > is there a 'standard' way of doing this? perhaps i should be using perl
> > and text::template?
doing a echo "key value" >> /etc/myfile is a rather evil approach (for
reasons search the mailing list and/or debconf docu)
better would be something like:
cat /etc/myfile | sed -e 's/key.*/key value/' >> /etc/myfile2
mv /etc/myfile2 /etc/myfile
( you could do that over /tmp too, to avoid cluttering /etc with files,
but I leave that over for your imagination ... )
Michael Moerz (aka. natoka)