Bug 58500 - Joinscripts return 1 in case they are already run successfully
Summary: Joinscripts return 1 in case they are already run successfully
Status: NEW
Alias: None
Product: UCS
Classification: Unclassified
Component: Join (univention-join)
Version: UCS 5.2
Hardware: Other Linux
: P5 normal
Target Milestone: ---
Assignee: UCS maintainers
QA Contact: UCS maintainers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-08-05 12:42 CEST by Arvid Requate
Modified: 2025-08-05 13:57 CEST (History)
0 users

See Also:
What kind of report is it?: Development Internal
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):
Customer ID:
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Arvid Requate univentionstaff 2025-08-05 12:42:38 CEST
https://docs.software-univention.de/developer-reference/5.2/en/join/write-join.html#join-script-exit-codes says that a joinscript should return 1 in case of error. That's ok.

But joinscripts also return 1 when they are called directly (e.g. via call_joinscript from in postinst script). That's been irritating to 3rd party developers and to be honest, it's one of those mild pains that I just grew to ignore. E.g. in the terminal output or in term.log or updater.log this looks like this:

```
Preparing to unpack .../univention-keycloak-client_3.2.2A~5.2.2.202507290836_all.deb 
Unpacking univention-keycloak-client (3.2.2A~5.2.2.202507290836) over (3.2.1) ...
Setting up univention-keycloak-client (3.2.2A~5.2.2.202507290836) ...
Calling joinscript 49univention-keycloak-client.inst ...
2025-08-03 21:05:16.359110414+02:00 (in joinscript_init)
Joinscript 49univention-keycloak-client.inst finished with exitcode 1
```


This originates here: /var/lib/dpkg/info/univention-keycloak-client.postinst
```bash
# run join script on Primary Directory Node and Backup Directory Node
if [ "$1" = "configure" ]; then
    . /usr/share/univention-lib/join.sh &&
        call_joinscript 49univention-keycloak-client.inst ||
        :
fi
```

Or directly here:
```
root@master:~# /usr/lib/univention-install/49univention-keycloak-client.inst || echo $?
2025-08-05 12:32:52.428076262+02:00 (in joinscript_init)
1
```

I think call_joinscript should check if the joinscript status is already "done" (/var/univenion-join/status) and return "ok" in that case. Or even better: joinscripts should return 0 if they are already executed successfully.