Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define a non-root user? #4

Open
bilderbuchi opened this issue Aug 10, 2023 · 0 comments
Open

Define a non-root user? #4

bilderbuchi opened this issue Aug 10, 2023 · 0 comments

Comments

@bilderbuchi
Copy link

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.76d9b26890fd41f082d70f1485c8ad19

Is that intentional/should that be changed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant