Univention Bugzilla – Bug 30596
Removing extended attributes during uninstallation
Last modified: 2013-10-29 10:29:05 CET
The apps don't remove the extended attributes during the uninstallation of the apps. univention-lib should provide an simple interface to remove these attributes.
The following functions have been added to the univention lib: - ucs_removeServiceFromLocalhost - ucs_removeServiceFromHost - ucs_isServiceUnused - ucs_registerLDAPSchema - call_unjoinscript The function ucs_registerLDAPSchema copies the given schema to the directory /var/lib/univention-ldap/local-schema/. Thus it is possible to uninstall the package and the schema remains on the system. The slapd.conf UCR subtemplate 25univention-ldap-server_local-schema makes this possible. To remove the Extended Attributes the App can provide an unjoin script, for example: /usr/lib/univention-uninstall/92univention-fetchmail.uninst The App should by default register a service entry for the host. If the service entry is removed in the unjoin script, the unjoin script could also recognize that the extended attributes could be removed. While the package is uninstalled this unjoin script could be called, for example: From the prerm script: if [ "$1" = "remove" ]; then cp /usr/lib/univention-uninstall/92univention-fetchmail.uninst /usr/lib/univention-install/ fi From the postrm script: if [ "$1" = "remove" ]; then . /usr/share/univention-lib/all.sh call_unjoinscript 92univention-fetchmail.uninst fi Currently we don't have any App which has on of the default master packages as part of the default packages. So we can change per converted App the support of the un-installation as we move the defaultmaster packages to the default packages. The only case which will not work currently is, if you install OX on a DC Slave. In this case the UDM module packages will be installed on the DC Master and during the uninstallation on the DC Slave the UDM packages won't be removed. But the Admin can uninstall the package manually and in a later app center version we can ask the Admin if the packages should be removed from DC Master. The following packages do have DefaultMasterPackages and should be converted: - agorumcore-pro - asterisk4ucs_20130304 - kolab - owncloud_20130313 - oxseforucs - sugarcrm_20130103 - ucc_20130218 - zarafa_20130228 - fetchmail
*** Bug 30555 has been marked as a duplicate of this bug. ***
(In reply to comment #1) > To remove the Extended Attributes the App can provide an unjoin script, for > example: > /usr/lib/univention-uninstall/92univention-fetchmail.uninst > > The App should by default register a service entry for the host. If the service > entry is removed in the unjoin script, the unjoin script could also recognize > that the extended attributes could be removed. > > While the package is uninstalled this unjoin script could be called, for > example: > > From the prerm script: > if [ "$1" = "remove" ]; then > cp /usr/lib/univention-uninstall/92univention-fetchmail.uninst > /usr/lib/univention-install/ > fi > > From the postrm script: > if [ "$1" = "remove" ]; then > . /usr/share/univention-lib/all.sh > call_unjoinscript 92univention-fetchmail.uninst > fi > > From preinst: if [ "$1" = "configure" ]; then test -e /usr/lib/univention-install/92univention-fetchmail.uninst && rm /usr/lib/univention-install/92univention-fetchmail.uninst fi
univention-fetchmail is the first app using this extension, available in the test app center: ucr set repository/app_center/server=appcenter.test.software-univention.d The following scenarios have been tested successful with UCS 3.1-0 errata and UCS 3.1-1: - Installation Master → Uninstallation Master → Extended attributes are not available - Installation Master + Installation Backup → Uninstallation Master → Extended attributes are available - Installation Member → Uninstallation Member → Extended attributes are not available - Installation Member → Uninstallation Member → Installation Member → Running join scripts → Extended attributes are available On a 3.1-0 errata system you have to run univention-run-join-scripts manually. On a 3.1-1 system you get a notice that scripts have to be executed. That is very nice. The following things do not work currently: - Installation of an app on a dc slave which uses UDM modules, for example OX. If the app was removed on the dc slave the UDM modules still on the dc master. Workaround: uninstall the integration package on the dc master via extended software management. YAML files for univention-ldap, univention-join and univention-lib have been added.
(In reply to comment #3) > From preinst: > if [ "$1" = "configure" ]; then > test -e /usr/lib/univention-install/92univention-fetchmail.uninst && \ > rm /usr/lib/univention-install/92univention-fetchmail.uninst > fi For the record: The comparison in the preinst should check for "install" and not for "configure". This has been committed to SVN correctly: ---[univention-fetchmail.preinst]--- if [ "$1" = "install" ]; then … fi (In reply to comment #4) > univention-fetchmail is the first app using this extension, available in the > test app center: > ucr set repository/app_center/server=appcenter.test.software-univention.de → OK > The following scenarios have been tested successful with UCS 3.1-0 errata and > UCS 3.1-1: Test with 3.1-0 errata 57: 1) Install Master → ExtAttr available → Deinstall Master → ExtAttr not available 2) Install Backup → Install Slave → Install Member → run join scripts on all systems → ExtAttr available → Deinstall Backup → Deinstall Slave → run join scripts → ExtAttr available → Deinstall Member → run join scripts → ExtAttr not available Test with 3.1-0 errata 75: different setups with master/backup/slave/member mixed Test with 3.1-1: 3) Install Member → Install Slave → join scripts → ExtAttr available → Deinstall Member → join scripts → ExtAttr available → Deinstall Slave → ExtAttr available → join scripts → Ext Attr unavailable → all tests have been successful > On a 3.1-0 errata system you have to run univention-run-join-scripts manually. → OK → Hint: the UMC module "domain join" does not mention unexecuted "unjoin" scripts! > On a 3.1-1 system you get a notice that scripts have to be executed. That is > very nice. → OK, all join and unjoin scripts are shown in UMC module "domain join" > The following things do not work currently: > > - Installation of an app on a dc slave which uses UDM modules, for example OX. > If the app was removed on the dc slave the UDM modules still on the dc master. > Workaround: uninstall the integration package on the dc master via extended > software management. > > YAML files for univention-ldap, univention-join and univention-lib have been > added. → YAML files are ok Some minor glitches in the code have been documented in Bug #30882.
http://errata.univention.de/3.1-errata80.html http://errata.univention.de/3.1-errata79.html http://errata.univention.de/3.1-errata78.html