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

Re: Perl postinst script running external commands



On Tue, 1 Oct 2002 09:25, Matthias Urlichs wrote:
> > I have a perl postinst script that "gets stuck" when running certain
> > external commands.  For example, the line
> >
> > `/etc/init.d/apache restart  >/dev/null 2>&1 3>&1 4>&1 5>&1`;
> >
> > will freeze the postinst script so that it must be killed.  The problem
> > has something to do with using the debconf module,
>
> More specifically, it has something to do with using backticks to start an
> external command, and open file descriptors. You don't KNOW which
> descriptor DebConf uses.

This is a good reason for not using debconf.

The interface between a program and libraries it uses should be defined, and 
it should be designed in a way to minimise harm to other programs.

> You should (a) issue the STOP command (see "man 7 debconf-devel"), and
> (b) use fork+execve to restart apache instead of backticks.

Which of course would not work well if you have to run a script to get 
information needed for the next debconf question...

-- 
http://www.coker.com.au/selinux/   My NSA Security Enhanced Linux packages
http://www.coker.com.au/bonnie++/  Bonnie++ hard drive benchmark
http://www.coker.com.au/postal/    Postal SMTP/POP benchmark
http://www.coker.com.au/~russell/  My home page



Reply to: