0

I have created a deb. package with my App and I should start lighttpd at the end of installation (postinst script). The question is how to start lighttpd and don't lock a terminal. It should started in background somehow...

Thanks.

Lazy
  • 267
  • 1
  • 8
  • 18
  • Finally, I've found some strange thing... If I start `invoke-rc.d xxxx start` at the end of `postinst` script lighttpd will be started in foreground. However if I start `invoke-rc.d xxxx start` manually lighttpd will be started in background. Why it happens? – Lazy Mar 31 '12 at 22:01
  • I've found solution [http://www.fifi.org/doc/debconf-doc/tutorial.html#AEN198]. I've added `db_stop` after `invoke-rc.d xxxx start` and postinst script works properly. – Lazy Apr 01 '12 at 19:45

1 Answers1

0

To clarify for others who come by this, you're using the Debconf confmodule to ask questions to the user in your postinst (http://stackoverflow.com/q/10139395/193468). The confmodule (shell-based interface to the debconf interactive machinery) does terrible magic in order to re-exec the script it's in with pipes going in and out of a separate debconf process. It's messy, especially when you need to do other things in the same script which expect file descriptors and the owning TTY to be arranged in a certain way (as when invoking initscripts). This is why it's not recommended to use db_input in a postinst. But you seem to have got it working, so, that's great. I just want to note that adding db_stop won't always solve the problem for people with similar issues.

the paul
  • 8,972
  • 1
  • 36
  • 53