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

Shared memory does not work across users #170

Open
5 tasks
griffinmilsap opened this issue Feb 20, 2025 · 0 comments
Open
5 tasks

Shared memory does not work across users #170

griffinmilsap opened this issue Feb 20, 2025 · 0 comments

Comments

@griffinmilsap
Copy link
Collaborator

A deployment of ezmsg may feature a GraphServer/SHMServer launched from a systemd service file or startup script that runs ezmsg serve as a system user, possibly named ezmsg. When this is done, all SHM blocks are created as that user, and no other users on the machine have permission to use them. The error is thrown when a client process started by a different user on the machine starts up:

PermissionError: [Errno 13] Permission denied: '/psm_xxxxxxxx'

On Linux/MacOS it is likely possible to change the permissions for the SHM files manually using os.chmod. I'm not sure what the requirements are for getting this to work in Windows -- Its possible that services are run as the current user and this could just work. Whatever needs to be done to share blocks across users should only be done if a specific flag is set on the command line, as keeping the GraphServer sandboxed to a particular user might be useful/valuable in many deployments. Unit tests will also need to be written to check that other users can connect to the SHM blocks on that machine.

  • Introduce a new flag in ezmsg.core.command to set permissions on SHM for all-users
  • MacOS/Linux: Change permissions of SHM files once they're created in SHMServer
  • Windows: Research how this problem presents itself on Windows
  • Write unit test to validate other users can access SHM blocks.
  • Bonus feature request: Add ezmsg install and ezmsg uninstall that configures an ezmsg GraphServer to run on startup. This would configure a systemd service file on Linux, but would look different for MacOS and Windows. It may also be useful to provide a curl-able setup-script that could be run from the terminal that would install ezmsg GraphService as a single-user or multi-user install.
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