Skip to content
This repository was archived by the owner on Mar 4, 2024. It is now read-only.
This repository was 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

@kwmonroe

Description

@kwmonroe

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions