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

Re: Perl postinst script running external commands



Hi,

Brian Nelson:
> 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.

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

> -- 
> People said I was dumb, but I proved them!
> 
I once had a random signature grabber which was very good at magically find-
ing the right signarure for the email I'm writing. This one qualifies.  ;-)

-- 
Matthias Urlichs     |     noris network AG     |     http://smurf.noris.de/



Reply to: