Skip to content
Yves Martin edited this page Dec 24, 2017 · 6 revisions

Package migration to generic service support

Support has only been testing on DSM 5 and 6 and relies on availability of

  • synouser
  • synogroup
  • servicetool
  • synoshare
  • synoacltool

Please first refer to complete documentation.

Common actions

Discard INSTALL_DIR from Makefile as new default is now set to /var/packages/$(SPK_NAME)/target/ in mk/spk.directory.mk

If relevant, take befenits from group and share folder creation with SERVICE_WIZARD_GROUP and SERVICE_WIZARD_SHARE

If INSTALLER_SCRIPT contains other specific actions like configuration setup or link creation, move them to service_ACTION functions in SERVICE_SETUP script.

For non service application, add explicitely STARTABLE=no for proper Package Center status reporting.

Service application

If SSS_SCRIPT has specific code, try to move behaviour to service_prestart or service_poststop. If not possible, create package specific from mk/spksrc.service.start-stop-service.

Service user transition

If service user already exists in system, DSM will create an additional account with _PKGtime suffix which prevents installer to enlist it in group for share permissions.

For package transition, it is recommended to keep busybox dependency to properly clean "legacy" service account (without any prefix) thanks to following function in SERVICE_SETUP script file:

service_postinst ()
{
    # Discard legacy obsolete busybox user account
    BIN=${SYNOPKG_PKGDEST}/bin
    $BIN/busybox --install $BIN
    $BIN/delgroup "${USER}" "users" >> ${INST_LOG}
    $BIN/deluser "${USER}" >> ${INST_LOG}
}

Example with mosquitto update PR: #3025

Clone this wiki locally