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

0.6.1 Installation instructions not working - please correct them #543

Open
marinnedea opened this issue Dec 23, 2024 · 3 comments
Open
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers

Comments

@marinnedea
Copy link

Hi team, the current installation steps do not work, because in Linux/Unix in general, paths should not be defined as "/path/to/file" but as /path/to/file (notice the " <-- that shouldn't be there).
Also, /usr/local/bin/ is not always writable by standard users. You should always prefix the command with sudo for this to work correctly.

Correct installation steps:

Download the installation file to /usr/local/bin/ and save it with the grr name.

sudo curl -fSL -o /usr/local/bin/grr "https://github.com/grafana/grizzly/releases/download/v0.6.1/grr-linux-amd64"

Make it executable:

sudo chmod a+x /usr/local/bin/grr

Test it:

grr --version

Sample results (tested in RHEL 8.10):

$ grep "PRETTY_NAME" /etc/*release
/etc/os-release:PRETTY_NAME="Red Hat Enterprise Linux 8.10 (Ootpa)"

$ sudo curl -fSL -o /usr/local/bin/grr "https://github.com/grafana/grizzly/releases/download/v0.6.1/grr-linux-amd64"
 % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 29.9M  100 29.9M    0     0  18.2M      0  0:00:01  0:00:01 --:--:-- 37.8M

$ sudo ls -ltr /usr/local/bin/grr
-rw-r--r--. 1 root root 31371416 Dec 23 12:56 /usr/local/bin/grr

$ sudo chmod a+x /usr/local/bin/grr

$ sudo ls -ltr /usr/local/bin/grr
-rwxr-xr-x. 1 root root 31371416 Dec 23 12:56 /usr/local/bin/grr

$ grr --version
2024/12/23 13:00:07 grr version v0.6.1
@malcolmholmes
Copy link
Collaborator

The quotes will be consumed by your shell, and the curl command will just get the filename. In what scenario are you seeing other behaviour?

@marinnedea
Copy link
Author

hi @malcolmholmes , I ran this in RHEL 8.10 and had issues with the installation.
The steps I provided where the ones that worked without any problem.

I will try replicating and will update this with commands outputs and logs.

@marinnedea
Copy link
Author

marinnedea commented Dec 24, 2024

hi @malcolmholmes 👋

I checked and indeed the " do not break anything, actually helps in some cases; however, it's only optional here.

However, writing to /usr/local/bin/ typically requires root privileges because it is a system directory with restricted write permissions for non-root users. So sudo is needed in most cases, for both the download command via curl and for chmod command.

sudo curl -fSL -o "/usr/local/bin/grr" "https://github.com/grafana/grizzly/releases/download/v0.6.1/grr-linux-amd64"
sudo chmod a+x  "/usr/local/bin/grr"

What happens without sudo:

$ curl -fSL -o "/usr/local/bin/grr" "https://github.com/grafana/grizzly/releases/download/v0.6.1/grr-linux-amd64"
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
Warning: Failed to create the file /usr/local/bin/grr: Permission denied
  0 29.9M    0  1369    0     0   4161      0  2:05:39 --:--:--  2:05:39  4161
curl: (23) Failed writing body (0 != 1369)

[marin@nedmar-rhel8 ~]$ sudo curl -fSL -o /usr/local/bin/grr "https://github.com/grafana/grizzly/releases/download/v0.6.1/grr-linux-amd64"
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 29.9M  100 29.9M    0     0  52.9M      0 --:--:-- --:--:-- --:--:--  167M

[marin@nedmar-rhel8 ~]$ chmod a+x  "/usr/local/bin/grr"
chmod: changing permissions of '/usr/local/bin/grr': Operation not permitted

[marin@nedmar-rhel8 ~]$ sudo chmod a+x  "/usr/local/bin/grr"

[marin@nedmar-rhel8 ~]$ sudo ls -ltr "/usr/local/bin/grr"
-rwxr-xr-x. 1 root root 31371416 Dec 24 15:48 /usr/local/bin/grr

Additionally, when first configuring Grizzly, it needs to create .config/grizzly directory.

$ grr config create-context grafana-onprem
FATAL mkdir /home/marin/.config/grizzly: no such file or directory

However, .config directory doesn't exists by default. Therefore, that needs created too.
The above fails because the mkdir command needs to run with -p parameter for this to work:

mkdir  -p ~/.config/grizzly

The above seems to be related to the decision to use os.Mkdir() instead of os.MkdirAll() here.

The only details logged in logs while running the above testes are:

==> /var/log/secure <==
Dec 24 15:48:51 nedmar-rhel8 sudo[98137]:   marin : TTY=pts/0 ; PWD=/home/marin ; USER=root ; COMMAND=/bin/curl -fSL -o /usr/local/bin/grr https://github.com/grafana/grizzly/releases/download/v0.6.1/grr-linux-amd64
Dec 24 15:48:51 nedmar-rhel8 sudo[98137]: pam_unix(sudo:session): session opened for user root by marin(uid=1002)
Dec 24 15:48:52 nedmar-rhel8 sudo[98137]: pam_unix(sudo:session): session closed for user root
Dec 24 15:50:40 nedmar-rhel8 sudo[98145]:   marin : TTY=pts/0 ; PWD=/home/marin ; USER=root ; COMMAND=/bin/chmod a+x /usr/local/bin/grr
Dec 24 15:50:40 nedmar-rhel8 sudo[98145]: pam_unix(sudo:session): session opened for user root by marin(uid=1002)
Dec 24 15:50:40 nedmar-rhel8 sudo[98145]: pam_unix(sudo:session): session closed for user root
Dec 24 15:51:01 nedmar-rhel8 sudo[98148]:   marin : TTY=pts/0 ; PWD=/home/marin ; USER=root ; COMMAND=/bin/ls -ltr /usr/local/bin/grr
Dec 24 15:51:01 nedmar-rhel8 sudo[98148]: pam_unix(sudo:session): session opened for user root by marin(uid=1002)
Dec 24 15:51:01 nedmar-rhel8 sudo[98148]: pam_unix(sudo:session): session closed for user root

No other log entry found - the above only shows my user running with sudo the commands, so not really helpful I guess.

As a side note, I was able to replicate the exact same behaviour on Ubuntu 24.04.1 LTS, with the arm64 installer.

@Duologic Duologic added documentation Improvements or additions to documentation good first issue Good for newcomers labels Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants