This is what I’m seeing. As described above, the script successfully completes on 1st run but sets the FQDN settings to the internal values. If at that point I check the status of the kopano-server service I see:-
kopano-server.service - Kopano Groupware Core Storage Server
Loaded: loaded (/lib/systemd/system/kopano-server.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2020-04-21 05:53:04 AEST; 5min ago
Docs: man:kopano-server(8)
man:kopano-server.cfg(5)
man:kopano-admin(8)
Main PID: 1819 (kopano-server)
CGroup: /system.slice/kopano-server.service
└─1819 /usr/sbin/kopano-server -F
Apr 21 05:57:36 UCS4Master kopano-server[1819]: kcoid discovery error: Get https://UCS4Master.cts.lan/kopanoid//.well-known/openid-configuration: x509: certificate is valid for mail.tosi.id.au, mail2.tosi.id.au, not UCS4Master.cts.lan
Apr 21 05:57:41 UCS4Master kopano-server[1819]: kcoid discovery error: Get https://UCS4Master.cts.lan/kopanoid//.well-known/openid-configuration: x509: certificate is valid for mail.tosi.id.au, mail2.tosi.id.au, not UCS4Master.cts.lan
Apr 21 05:57:46 UCS4Master kopano-server[1819]: kcoid discovery error: Get https://UCS4Master.cts.lan/kopanoid//.well-known/openid-configuration: x509: certificate is valid for mail.tosi.id.au, mail2.tosi.id.au, not UCS4Master.cts.lan
Apr 21 05:57:51 UCS4Master kopano-server[1819]: kcoid discovery error: Get https://UCS4Master.cts.lan/kopanoid//.well-known/openid-configuration: x509: certificate is valid for mail.tosi.id.au, mail2.tosi.id.au, not UCS4Master.cts.lan
Apr 21 05:57:56 UCS4Master kopano-server[1819]: kcoid discovery error: Get https://UCS4Master.cts.lan/kopanoid//.well-known/openid-configuration: x509: certificate is valid for mail.tosi.id.au, mail2.tosi.id.au, not UCS4Master.cts.lan
Apr 21 05:58:01 UCS4Master kopano-server[1819]: kcoid discovery error: Get https://UCS4Master.cts.lan/kopanoid//.well-known/openid-configuration: x509: certificate is valid for mail.tosi.id.au, mail2.tosi.id.au, not UCS4Master.cts.lan
Apr 21 05:58:06 UCS4Master kopano-server[1819]: kcoid discovery error: Get https://UCS4Master.cts.lan/kopanoid//.well-known/openid-configuration: x509: certificate is valid for mail.tosi.id.au, mail2.tosi.id.au, not UCS4Master.cts.lan
Apr 21 05:58:11 UCS4Master kopano-server[1819]: kcoid discovery error: Get https://UCS4Master.cts.lan/kopanoid//.well-known/openid-configuration: x509: certificate is valid for mail.tosi.id.au, mail2.tosi.id.au, not UCS4Master.cts.lan
Apr 21 05:58:16 UCS4Master kopano-server[1819]: kcoid discovery error: Get https://UCS4Master.cts.lan/kopanoid//.well-known/openid-configuration: x509: certificate is valid for mail.tosi.id.au, mail2.tosi.id.au, not UCS4Master.cts.lan
Apr 21 05:58:21 UCS4Master kopano-server[1819]: kcoid discovery error: Get https://UCS4Master.cts.lan/kopanoid//.well-known/openid-configuration: x509: certificate is valid for mail.tosi.id.au, mail2.tosi.id.au, not UCS4Master.cts.lan
So the kopano-server service is still running at that point, but showing a kcoid discovery error complaining about certificate validity. Webapp appears not to be accessible at this point however. I then edit the .env file and replace the internal FQDN values with the public ones & run the script again. The script output:-
root@UCS4Master:~/ucs-oidc-webapp# ./run.sh
Object exists: (uid) oidc-helper
Unable to open Admin session: network error (0x80040115)
The server is not running, or not accessible through "default:".
Using the -v option (possibly multiple times) may give more hints.
An error occurded on line 60 of this script.
And so at this point I check the status of the kopano-server service I see:-
root@UCS4Master:~/ucs-oidc-webapp# service kopano-server status
kopano-server.service - Kopano Groupware Core Storage Server
Loaded: loaded (/lib/systemd/system/kopano-server.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2020-04-21 06:10:44 AEST; 26s ago
Docs: man:kopano-server(8)
man:kopano-server.cfg(5)
man:kopano-admin(8)
Main PID: 15565 (code=exited, status=255)
CPU: 240ms
Apr 21 06:10:10 UCS4Master kopano-server[15565]: kcoid discovery error: Get https://UCS4Master.cts.lan/kopanoid//.well-known/openid-configuration: x509: certificate is valid for mail.tosi.id.au, mail2.tosi.id.au, not UCS4Master.cts.lan
Apr 21 06:10:15 UCS4Master kopano-server[15565]: kcoid discovery error: Get https://UCS4Master.cts.lan/kopanoid//.well-known/openid-configuration: x509: certificate is valid for mail.tosi.id.au, mail2.tosi.id.au, not UCS4Master.cts.lan
Apr 21 06:10:20 UCS4Master kopano-server[15565]: kcoid discovery error: Get https://UCS4Master.cts.lan/kopanoid//.well-known/openid-configuration: x509: certificate is valid for mail.tosi.id.au, mail2.tosi.id.au, not UCS4Master.cts.lan
Apr 21 06:10:25 UCS4Master kopano-server[15565]: kcoid discovery error: Get https://UCS4Master.cts.lan/kopanoid//.well-known/openid-configuration: x509: certificate is valid for mail.tosi.id.au, mail2.tosi.id.au, not UCS4Master.cts.lan
Apr 21 06:10:30 UCS4Master kopano-server[15565]: kcoid discovery error: Get https://UCS4Master.cts.lan/kopanoid//.well-known/openid-configuration: x509: certificate is valid for mail.tosi.id.au, mail2.tosi.id.au, not UCS4Master.cts.lan
Apr 21 06:10:35 UCS4Master kopano-server[15565]: kcoid discovery error: Get https://UCS4Master.cts.lan/kopanoid//.well-known/openid-configuration: x509: certificate is valid for mail.tosi.id.au, mail2.tosi.id.au, not UCS4Master.cts.lan
Apr 21 06:10:40 UCS4Master kopano-server[15565]: kcoid discovery error: Get https://UCS4Master.cts.lan/kopanoid//.well-known/openid-configuration: x509: certificate is valid for mail.tosi.id.au, mail2.tosi.id.au, not UCS4Master.cts.lan
Apr 21 06:10:44 UCS4Master systemd[1]: kopano-server.service: Main process exited, code=exited, status=255/n/a
Apr 21 06:10:44 UCS4Master systemd[1]: kopano-server.service: Unit entered failed state.
Apr 21 06:10:44 UCS4Master systemd[1]: kopano-server.service: Failed with result 'exit-code'.
So it appears that the kopano server service is crashing during the 2nd running of the script.