Skip to content

Require root or runner privs to run ping command #146

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

Merged
merged 1 commit into from
Jun 26, 2014

Conversation

jaredmorrow
Copy link
Contributor

Addresses: basho/riak#561

In certain cases, if riak ping was run before riak start (or any
other command) a .erlang.cookie file was created with the wrong
privs (in this case a root user) that prevented the riak user from
starting erlang.

Addresses: basho/riak#561

In certain cases, if `riak ping` was run before `riak start` (or any
other command) a `.erlang.cookie` file was created with the wrong
privs (in this case a root user) that prevented the riak user from
starting erlang.
@jaredmorrow
Copy link
Contributor Author

Use the following packages to test:

@jaredmorrow
Copy link
Contributor Author

/cc @jburwell @hectcastro

I will address @glickbot's ENV variable issue basho/riak#563 when we confirm this first step works.

@jaredmorrow
Copy link
Contributor Author

I tested on ubuntu 12.04 with this simply:

vagrant@precise64:~$ sudo dpkg -i riak_2.0.0beta7-c9b9d12d-1_amd64.deb
Selecting previously unselected package riak.
(Reading database ... 51095 files and directories currently installed.)
Unpacking riak (from riak_2.0.0beta7-c9b9d12d-1_amd64.deb) ...
Setting up riak (2.0.0beta7-c9b9d12d-1) ...
Adding group `riak' (GID 111) ...
Done.
Adding system user `riak' (UID 106) ...
Adding new user `riak' (UID 106) with group `riak' ...
Not creating home directory `/var/lib/riak'.
Processing triggers for ureadahead ...
ureadahead will be reprofiled on next reboot
Processing triggers for man-db ...
vagrant@precise64:~$ sudo service riak start
!!!!
!!!! WARNING: ulimit -n is 1024; 65536 is the recommended minimum.
!!!!
vagrant@precise64:~$ ls -la /var/lib/riak
total 36
drwxr-xr-x  8 riak riak 4096 Jun 25 19:03 .
drwxr-xr-x 36 root root 4096 Jun 25 19:02 ..
drwxrwxr-x  4 riak riak 4096 Jun 25 19:03 anti_entropy
drwxrwxr-x  4 riak riak 4096 Jun 25 19:03 bitcask
drwxrwxr-x  3 riak riak 4096 Jun 25 19:03 cluster_meta
-r--------  1 riak riak   20 Jun 25 00:00 .erlang.cookie
drwxrwxr-x  2 riak riak 4096 Jun 25 19:03 generated.configs
drwxrwxr-x  2 riak riak 4096 Jun 25 19:03 kv_vnode
drwxr-xr-x  2 riak riak 4096 Jun 25 19:03 ring
vagrant@precise64:~$ service riak ping
You need to be root or use sudo to run this command
vagrant@precise64:~$ sudo service riak ping
pong
vagrant@precise64:~$ riak ping
You need to be root or use sudo to run this command
vagrant@precise64:~$ sudo riak ping
pong

@hectcastro
Copy link
Contributor

I ran similar tests on the following platforms with success:

  • ubuntu-1404
  • ubuntu-1204
  • centos-65
  • centos-510
  • debian-74
  • debian-608

@jaredmorrow
Copy link
Contributor Author

Awesome @hectcastro thanks for giving that a go. I'll wait on @jburwell since he seems to run into the issue more than I do.

After that I'll figure out where the best place to source those default scripts. We'll need to do it early, but not so early that it gets lost before the su call.

@jburwell jburwell self-assigned this Jun 26, 2014
@jburwell
Copy link

Tested and passed on the following platforms:

  • Ubuntu 12.04.4
  • CentOS 6.5
  • Debian 7.4

Reviewed the code modification.

+1

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

Successfully merging this pull request may close these issues.

3 participants