-
Notifications
You must be signed in to change notification settings - Fork 535
Mas i1037 riakdiag #1047
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
Mas i1037 riakdiag #1047
Conversation
* Tweaks for riak-debug and hopefully Riak OTP versions * Added leveled and tictacaae directory listings * Remove a forgotten "fi" * Fix a typo * A little tidying after testing on a different OS * Update specfile to allow post install symlink * Added symlink to /usr/sbin for riak-debug Co-authored-by: root <[email protected]> Co-authored-by: Bob-The-Marauder <[email protected]>
Caused failure when installing - file is already present (perhaps from previous install)
Not starting as an app
This reverts commit 13034ee.
|
I'm afraid the substitution is failing as when I run Pull 1047 top level Pull 1040 top level Pull 1047 commands folder Pull 1040 commands folder If I go in to /usr/lib64/riak/bin and execute Given the similarity, of the two pull requests,, I think we either add riaknostic to 1040 or add the symlinks to 1047. |
|
The problem with the symlink, is that I've had them crash an install (when the symlink is already present). This changes the presence of riak debug into something that is potentially harmful for the people that don't use it. I will try and look deeper later today. |
|
Could we get around the pre-existing symlink issue by adding a in Alternatively we could try something like Please note the above are off the top of my head and not tested yet. |
|
As I understand it, the link is only resolving the problem in that it now allows you to run:
i.e. this works without the link if you ran:
The command we want to run:
doesn't work as expected with or without the link. It in fact behaves in a strange way, acting as if you passed in config options to produce some stats and not generate a file. If you pass in config switches it behaves in bizarre ways e.g:
will produce the riak outputs, and will now attempt to create the tar/zip file, but will fail as it tries to dump the tar/zip file in a privileged location. It would perhaps be understandable if So something is garbling the call to riak-debug when it goes through the main riak script. We can ignore this and run There's nothing obvious in the actual riak script to explain this: and the riak-debug script is explicit what the defaults should be if nothing is passed (and this isn't happening): |
|
So I don't think this is because the wrong switches are being passed in e.g. "-s" If we're running riak debug we're doing this as the riak user. I think the script is failing at some point (probably whilst getting the system data, and as the system data is the first thing to run that's why it looks like it is as if just that switch has been passed). This may be because of privileges - whereas if we run |
|
That's exactly where my previous work got me to. I couldn't find for the life of me why What you've expressed here has raised a concern that there is more potential available for |
|
OK, so it isn't running This is why it doesn't try to produce the tar file, the script has already exited before it gets to that point. So running the script direct works, but crashes when run via Even if we stop the if we instead use: The script will now run through to completion (but with errors). So it is this use of ". "$SCRIPT" to call script rather than simply "$SCRIPT" that causes the script to fail. Precisely what this notation means is hard to discover via google. But obviously, we don't really want to mess about in the relx extensions stuff - so perhaps it might be better to just try and treat |
Not as an extension script. There appeasr to be problems with the way relx starts extension scripts from a relative file location (and possibly also as a riak user)
|
The branch has bene updated to bypass the relx generated script, without using symlinks. So there are still some errors when running riak-debug, but the script will run through to the end. |
|
@martincox @Bob-The-Marauder any objections to proceeding with this version of the PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've just tested on CentOS. Works fine when executed as root or via sudo. When called as the riak user, it fails with:
bash-4.2$ whoami
riak
bash-4.2$ cd ~/
bash-4.2$ riak debug
Usage: riak {start|start_boot <file>|foreground|stop|restart|reboot|pid|ping|console|console_clean|console_boot <file>|attach|remote_console|upgrade|downgrade|install|uninstall|versions|escript|rpc|rpcterms|eval|status|admin|repl|chkconfig}
but I don't think that many people will be doing this as the riak user. Please proceed with this version of the PR.
Alternative PR to #1040
This includes updates to riaknostic so
riak admin diagwill work.sudo riak debug appears to work straight from install then start (tested on ubuntu 18)