northstack / northstack-client

NorthStack Client
https://northstack.com
GNU General Public License v3.0
7 stars 1 forks source link

Installer is missing -p option for mkdir when first creating directories #75

Closed javorszky closed 5 years ago

javorszky commented 5 years ago

Can't install northstack-client.

Process to Recreate

  1. Clone repository at current master (https://github.com/northstack/northstack-client/commit/d0a6e1dc38d44325ffaa7e90baed2a798fab5314)
  2. Per docs, run ./bin/install.sh
  3. Give permission for the installer to run these, give pw, and see it fail:
[2019-06-20 17:47:19] [warn] /Users/javorszky/.local/bin/northstack or /Users/javorszky/.local/bin is not writeable by your shell user. Using sudo to copy
Asking permission to run the following command with sudo:
mkdir -pv /Users/javorszky/.local/bin ; cp -av /var/folders/8p/y0b1jwdn3d3b9m9mvbr07x_w0000gn/T/tmp.GSXuEQrU /Users/javorszky/.local/bin/northstack
You can disable this check by setting NORTHSTACK_ALLOW_SUDO=1
Enter y/n : y
[2019-06-20 17:47:21] [info] Running: sudo mkdir -pv /Users/javorszky/.local/bin
[2019-06-20 17:47:21] [info] Running: sudo cp -av /var/folders/8p/y0b1jwdn3d3b9m9mvbr07x_w0000gn/T/tmp.GSXuEQrU /Users/javorszky/.local/bin/northstack
mkdir: /Users/javorszky/.local/northstack/docker: Permission denied

Expected vs Current result

Expected the installer to complete.

It didn't complete.

Possible Fix

The file ~/.local/bin/northstack exists. But then it wants to create a directory inside ~/.local/bin/northstack/docker, which will fail because northstack is a file, not a dir.

A file and directory can't share a name on mac by the looks of it.

The directory ~/.local only has bin as directory, so mkdir northstack/docker will fail without the -p option on mac.

The .local dir will have root owner, so the mdkir -pv northstack/docker also needs sudo.

System details

mac 10.14.5

mm-pagely commented 5 years ago

There's a helper func in here for running mkdir that should handle this case--just looks like it's not being used everywhere it should.

javorszky commented 5 years ago

Interestingly it's also telling me that the directories aren't writable with my shell user, even when I manually created them with my shell user, so they should be writable without sudo.

mm-pagely commented 5 years ago

@javorszky We just pushed a fresh release with a ton of installer fixes. Please give 'er a try!

javorszky commented 5 years ago

Thank you! Will do later today :)

javorszky commented 5 years ago

That worked, I could install the client, and could also log in! :+1: