Bug 33138 - do not die in unoin scripts
do not die in unoin scripts
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: Join (univention-join)
UNSTABLE
Other Linux
: P5 normal (vote)
: UCS 3.2
Assigned To: Philipp Hahn
Stefan Gohmann
: interim-4
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-11-06 08:20 CET by Felix Botner
Modified: 2013-11-19 06:41 CET (History)
1 user (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Felix Botner univentionstaff 2013-11-06 08:20:33 CET
I have an UCS 3.2 appliance, with the samba4 packages (default software from the installer). Now i want to setup a slave without samba4. The setup removes the packages and the unjoin script is copied to /usr/lib/univention-install. But now i get an error from the unjoin script when joining the system (samba4 was never really installed on the system).

Configure 90univention-bind-post.inst ^[[60Gdone
__MSG__:Einrichten von 98univention-pkgdb-tools
__STEP__:38
Configure 98univention-pkgdb-tools.inst ^[[60Gdone
__MSG__:Einrichten von 03univention-s4-connector.uinst
__STEP__:39
Configure 03univention-s4-connector.uinst ^[[60Gfailed


**************************************************************************
* Join failed!                                                           *
* Contact your system administrator                                      *
**************************************************************************
__JOINERR__:FAILED: 03univention-s4-connector.uinst
* Message:  FAILED: 03univention-s4-connector.uinst
**************************************************************************

Happens also if a service (with join and unjoin scripts) is installed and deinstalled without joining. The unjoin script of this service is executed on the next join (run-join-scripts) and if there is something like 

  ucs_removeServiceFromLocalhost "$SERVICE" "$@" || die

the join "fails" (because the service was never added).
Comment 1 Stefan Gohmann univentionstaff 2013-11-06 08:50:44 CET
I would prefer a check in ucs_removeServiceFromHost if the service is registered and ignore the case the service is not registered. Alternative we add a new function ucs_isServiceRegisteredAtHost / Localhost and add this test to every unjoin script.
Comment 2 Philipp Hahn univentionstaff 2013-11-07 11:40:42 CET
ucs_removeServiceFromHost() now checks for the existence of the service entry before removing it.
r45870 | Bug #33138: lib: Fix service removal
univention-lib_3.0.26-1.196.201311071135

Changelog: r45871 | Bug #33138: lib: Fix service removal
The function <function>ucs_removeServiceFromHost</function> was made idempotent and can now also be used when the service does not exist
Comment 3 Philipp Hahn univentionstaff 2013-11-07 16:10:18 CET
Adding the check for missing arguments broke it; remove double shift
r45891 | Bug #33138: lib: Fix double shift in service removal
univention-lib_3.0.26-2.197.201311071608
Comment 4 Stefan Gohmann univentionstaff 2013-11-13 16:35:41 CET
OK
Comment 5 Stefan Gohmann univentionstaff 2013-11-19 06:41:33 CET
UCS 3.2 has been released:
 http://docs.univention.de/release-notes-3.2-en.html
 http://docs.univention.de/release-notes-3.2-de.html

If this error occurs again, please use "Clone This Bug".