Skip to content
This repository has been archived by the owner on Mar 4, 2024. It is now read-only.

utils run_as and run_bg_as should not "su" if user == "root" #54

Open
kwmonroe opened this issue May 24, 2016 · 0 comments
Open

utils run_as and run_bg_as should not "su" if user == "root" #54

kwmonroe opened this issue May 24, 2016 · 0 comments

Comments

@kwmonroe
Copy link
Contributor

Hooks run as root, so if we have places where we call run_[bg_]as(x, user=root), we should drop the ['su', user, '-c'] args to the runner:

https://github.com/juju-solutions/jujubigdata/blob/master/jujubigdata/utils.py#L361

This bit me a couple minutes ago with zookeeper. We were trying to pkill -f the zk rest server with run_as(x, 'root'), which tried to do a 'su root -c "pkill -f x"'.

This is no bueno because the sigterm from pkill will travel back up into the "su root" and cause the runner to return with errno 143. In my case, i simply replaced zk's run_as with a check_call, but it would be nice if we fixed it in the utils methods.

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

No branches or pull requests

1 participant