-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
I have played around with the openmodelica/openmodelica:v1.21.0-ompython Docker image -- quite useful!
One thing I found curious is that these images have not defined & used a non-root user, like you can find e.g. here.
This leads to the problem that even basic OMPython usage is not possible because omc does not like being run as root, e.g. doing docker run -it openmodelica/openmodelica:v1.21.0-ompython:
root@cc828498295a:~# python3 -c "from OMPython import OMCSessionZMQ;omc = OMCSessionZMQ()"
2023-08-10 11:43:25,730 - OMPython - ERROR - OMC Server did not start. Please start it! Log-file says:
Error: You are trying to run OpenModelica as a server using the root user.
This is a very bad idea:
* The socket interface does not authenticate the user.
* OpenModelica allows execution of arbitrary commands.
Execution failed!
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/local/lib/python3.10/dist-packages/OMPython/__init__.py", line 707, in __init__
self._connect_to_omc(timeout)
File "/usr/local/lib/python3.10/dist-packages/OMPython/__init__.py", line 737, in _connect_to_omc
raise Exception("OMC Server did not start (timeout=%f). Could not open file %s" % (timeout,self._port_file))
Exception: OMC Server did not start (timeout=10.000000). Could not open file /tmp/openmodelica.root.port.76d9b26890fd41f082d70f1485c8ad19Is that intentional/should that be changed?
Metadata
Metadata
Assignees
Labels
No labels