A “regular” kill command and the resulting SIGTERM signal should definitely bring the server down and if -r is supplied to otiicli it will also return the license. -R isn’t really necessary in this case (you can safely leave the client logged in).
Could it be that the container is shutting down hard before the SIGTERM cleanup is done?
There is a shutdown command that can be sent from the Python client that will shutdown the TCP server, that would ensure that the license is returned before the script will finish. Take a look at the shutdown method in the otii object.
If this is a container that is cycled repeatedly I would definitely suggest running otiicli with its TCP server on the host instead and only run the Python scripts from within the container. That way you don’t have to start and stop the TCP server (otiicli) every time you cycle the container. The TCP server can be configured from the GUI to listen on specific interfaces and only allow connections from certain IPs. By default it will only listen on connections from localhost for security reasons, so this will require some configuration depending on how your container network setup is done.
Regarding returning the license, you need to contact us (either create a case in our case system or send a mail to firstname.lastname@example.org) with information about the license and we will help you retrieve the license.
Correct, the -t parameter is removed. The reservation time you see is the time your license is valid until it expires.