In a customer environment due to a crash or interruption the file /var/univetion-join/status got corrupted with some binary codes at the end of the file. univention.run-joinscript failed by complaining every joinscript is invalid: Search LDAP binddn done Running 00ucs-school-app-version-check.inst skipped (invalid joinscript) Running 00ucs-school-slave-check-ou.inst skipped (invalid joinscript) Running 01univention-ldap-server-init.inst skipped (invalid joinscript) [...] After some debugging by set -x the following output of the related bash functions: + joinscript_get_last_executed_version + '[' -n '' ']' + joinscript_check_any_version_executed + touch /var/univention-join/status + grep -qs -E '^univention-samba4 v[0-9]+ successful' /var/univention-join/status + return 0 ++ grep -E '^univention-samba4 v[0-9]+ successful' /var/univention-join/status ++ sed 's/^univention-samba4 v//' ++ sed 's/ successful.*$//' ++ sort -n ++ tail -n 1 + JS_LAST_EXECUTED_VERSION='Übereinstimmungen in Binärdatei /var/univention-join/status.' + joinscript_is_version 'Übereinstimmungen in Binärdatei /var/univention-join/status.' + local 'var=Übereinstimmungen in Binärdatei /var/univention-join/status.' + '[' -z 'Übereinstimmungen in Binärdatei /var/univention-join/status.' ']' ++ echo 'Übereinstimmungen in Binärdatei /var/univention-join/status.' ++ tr -d 0-9 + '[' '!' -z 'Übereinstimmungen in Binärdatei /var/univention-join/status.' ']' + return 1 + return 1 + return 1 root@bk175134a:/usr/share/univention-join# echo $HS_STATUSFILE + echo So the command returned nothing as the file was partially recognized as binary. The script should be aware of such errors and log something accordingly.
reproduced with: -> head -c60 < /vmlinuz >> /var/univention-join/status -> univention-run-join-scripts ... Running 01univention-ldap-server-init.inst skipped (invalid joinscript) Running 02univention-directory-notifier.inst skipped (invalid joinscript) Running 03univention-directory-listener.inst skipped (invalid joinscript) Running 04un...
In this case it should be fine by adding the "-a" parameter to the grep command...
> In this case it should be fine by adding the "-a" parameter > to the grep command... no, i do not think it is good to silently ignore a "broken" status file, better let the tools display an appropriate error message added joinscript_check_status_file to joinscripthelper.lib (checks if $JS_STATUSFILE is a text/plain file, otherwise abort join) added joinscript_check_status_file call to univention-join, univention-run-join-scripts and to joinscripthelper.lib.joinscript_init() -> head -c60 < /vmlinuz >> /var/univention-join/status -> /usr/lib/univention-install/30univention-appcenter.inst The status file /var/univention-join/status seems to be corrupt (mime type is application/octet-stream, should be text/plain). Please make sure this file is a plain text file. -> univention-run-join-scripts univention-run-join-scripts: runs all join scripts existing on local computer. copyright (c) 2001-2018 Univention GmbH, Germany The status file /var/univention-join/status seems to be corrupt (mime type is application/octet-stream, should be text/plain). Please make sure this file is a plain text file. -> univention-join univention-join: joins a computer to an ucs domain copyright (c) 2001-2018 Univention GmbH, Germany The status file /var/univention-join/status seems to be corrupt (mime type is application/octet-stream, should be text/plain). Please make sure this file is a plain text file. univention-join 354959ed8339bfdf05e25897fed2f895288ff163 104578fa2bec555e6134e0b60ad86c3634c3cad5 yaml bbd509f01a93d25040143863cd003d45a8c18328
Ok: * univention-run-join-scripts detects broken satus * univention-join still works even if status file was broken * Advisory Ok
<http://errata.software-univention.de/ucs/4.3/85.html>