We’ve recently found a use for this enhancement for our internal testing purposes. The use case is as follows:
We run PTL tests as a non-root user on our internal test systems, there are some pbs_snapshot tests and we’d like to be able to run them as a non-root user as well. We have sudo rules in place which restrict some of the commands that pbs_snapshot executes (like chmod) from being run with sudo. So, it’d really help if we add a switch to pbs_snapshot so that it runs only the necessary commands with sudo and runs the other commands as a normal user.
So, I’m reopening this discussion. Let’s figure out the most generic way to enhance pbs_snapshot for such use cases.
Based on the input from Josh I’d argue that the original proposal - i.e., “with-sudo”, would be the right way to go. The use case that you summarize can be satisfied with that interface. If there is a relatively broad swath of end users who just use root or an alternative to sudo, it is not reasonable to provide a default interface that relies on it being there.
Other than that, this seems a fine proposal, and meets an important end user use case.
Since we already are on a consensus about the approach, I won’t wait for sign-offs on it before creating the PR, but I will appreciate if you guys could review it for semantics and let me know if I should add/modify any information. Thanks!
So, at DEBUG level, the snapshot log that’s generated already displays all the commands being run exactly as they are run, so the ones which are run with sudo will be visible as being run with sudo. Would that be sufficient?