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

Re: dpkg -i from within postinst script



On 2008-11-13 10:55 +0100, Anton Piatek wrote:

> I work for a company that uses a specific java build - we are only
> allowed to download it from a specific internal site, that is
> authenticated.
> I have written a package that downloads and builds it into a deb
> (using make-jpkg + extra definitions) as part of the postinst script.
> I would like it to install the package too, however everything i have
> tried doesnt work
>
> Obviously dpkg is locked, so tried forking a background bash process
> to wait for it to become unlocked and then install, but the postinst
> seems to wait for that to exit - so waits forever.

Have you tried to run it with nohup?  I'm not sure it will work, but it
may at least be worth a try.

> Short of adding a cronjob that tries to install it, and deletes itself
> when done, can anyone think of any other ways I can have a deb marked
> for installation after apt/dpkg is done with the current operation?

I don't think that anything will work, but maybe someone has a bright
idea how to circumvent the locks of dpkg and apt.

> I have been unable to find anything built-in to dpkg that would let me
> add it to the list of files to install, but maybe it exists?

There is the --set-selections option, however this will not work from
the postinst, since it needs to write the status file which is locked.

Sven


Reply to: