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

Linux exec behavior change #10207

Closed
LukeMauldin opened this issue Mar 22, 2021 · 3 comments
Closed

Linux exec behavior change #10207

LukeMauldin opened this issue Mar 22, 2021 · 3 comments

Comments

@LukeMauldin
Copy link

Nomad version

Output from nomad version:
1.0.4

Operating system and Environment details

Linux x64 - RHEL 8.3

Issue

Upgraded Nomad cluster from 0.12.5 -> 1.0.4. After the upgrade experienced a behavior change in the users running with exec driver. In nomad version 0.12.5, each nomad task received a unique PID for each worker process. In Nomad version 1.0.4, each nomad task has PID 1. This is a breaking change in our scenario because we are using Nomad with a 3rd party application to run multiple instances of the application on the server. The application records to a database the server name and PID and it expects the servername/PID to be unique and when it is not unique, the application crashes. We do not have access to change the 3rd party code that is crashing. Is there some setting that I can set to revert Nomad 1.0.4 to assign a unique process id to each task?

As an alternative solution, we could change the driver type from exec -> raw_exec but that would require quite a bit of work because we are using the memory constraints, volume mapping, and chroot functionality of the exec driver.

@tgross
Copy link
Member

tgross commented Mar 22, 2021

Hi @LukeMauldin! This behavior was changed in #9911 which shipped in Nomad 1.0.3 to prevent CVE-2021-3283. But we added a configuration flag in #9982 and #9990 to opt-in to restoring the previous behavior, which we shipped in 1.0.4.

So you can restore the previous behavior by setting default_pid_mode = "host" in the exec driver plugin configuration on your agents.

@shoenig
Copy link
Member

shoenig commented Mar 22, 2021

Just highlighting you can also set pid_mode on the task driver configuration to restore the former behavior for a specific task, limiting exposure.

https://www.nomadproject.io/docs/drivers/exec#pid_mode

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants