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

Ctrl-C causes unexpected behavior in riak-admin top and more [JIRA: TOOLS-247] #162

Open
angrycub opened this issue Aug 29, 2014 · 2 comments

Comments

@angrycub
Copy link
Contributor

The change from sudo to su is causing an issue when Ctrl-C is being pressed in interactive applications such riak attach, riak-admin top.

When Ctrl-C is pressed you receive

                   Session terminated, killing shell... ...killed.

in the case of riak-admin top, the output continues in the background

This behavior appears to be caused by a change in the check_user() function from

    exec sudo -H -u $RUNNER_USER -i $RUNNER_SCRIPT_DIR/$RUNNER_SCRIPT $@

https://github.com/basho/node_package/blob/1.3.8/priv/base/env.sh#L169

to

    exec su - $RUNNER_USER -c "$RUNNER_SCRIPT_DIR/$RUNNER_SCRIPT $ESCAPED_ARGS"

https://github.com/basho/node_package/blob/develop/priv/base/env.sh#L239.

I was able to resolve it by changing -c to --session-command on CentOS, but I doubt the portability of that. I also was able to fiddle the scripts around in such a way that the interactive commands used a separate version of check_user that used sudo and allowed stop and start to use su.

@kesslerm
Copy link
Contributor

This is partially addressed by #198. At least the user is no longer prompted to press Ctrl+C.
However, Ctrl+C is a standard *nix way of terminating an application, so the underlying issue should still be addressed.

@Basho-JIRA Basho-JIRA changed the title Ctrl-C causes unexpected behavior in riak-admin top and more Ctrl-C causes unexpected behavior in riak-admin top and more [JIRA: TOOLS-247] Mar 18, 2016
@kesslerm
Copy link
Contributor

https://www.novell.com/support/kb/doc.php?id=7009640 suggests that the change in behaviour su -c (for the coreutils version of su) was made to address a possible security issue that allowed a tty to be hijacked. su --session-command may re-introduce this issue.

Also Debian derived distributions use a different su implementation that does not support --session-command.

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

No branches or pull requests

4 participants