I have some observations and suggestions for improving how opkg handles starting and stopping of services.

  • good - opkg default_postinst enables and starts init.d defined services for clean installs.

  • bad - opkg does not stop services when doing a package "remove".  This appears due to a bug in the default_prerm function which sources the package defined prerm function.  The package defined prerm function must end with a "exit 0" and since that is sourced inside default_prerm when it encounters the "exit 0" the execution of code after that does not happen.  The code after that happens to be the code that automatically stops all the init.d services that are installed by the package.

  • bad - opkg does not stop services before doing an upgrade.  There is no default_preinst function and for consistency there should be one.  IMHO services whose binaries are being updated should be stopped before the update and started after the update.

  • bad - opkg does not start services after doing an upgrade.  I guess this is consistent with not stopping them pre-upgrade.

Seems to me opkg should do all or nothing when it comes to enabling, starting, and stopping services installed by a package.  Comments?