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

[client] Restart netbird-ui post-install in linux deb&rpm #2992

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mohamed-essam
Copy link
Contributor

Describe your changes

Add post-install script to netbird-ui deb and rpm packages to restart process if running.

Issue ticket number and link

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)
  • Extended the README / documentation, if necessary

@mohamed-essam mohamed-essam changed the title Restart netbird-ui post-install in linux deb&rpm [client] Restart netbird-ui post-install in linux deb&rpm Dec 5, 2024
@mgarces
Copy link
Contributor

mgarces commented Dec 10, 2024

Hi @mohamed-essam , thank you for this contribution.
Can you share how you tested this changes? I've tested both rpm and deb assets, both on an Ubuntu Desktop 22.04 and on Fedora Desktop 41, and this didn't work at all; just want to make sure I can replicate your steps.
Also, on Ubuntu, I got the following output:

/var/lib/dpkg/info/netbird-ui.postinst: 4 [[: not found 

I think this is due the script using /bin/sh as a shebang, which typically points to a more minimal shell. However, it uses [[ ... ]], which is a feature of bash and not POSIX-compliant. This can cause the script to fail on systems where /bin/sh is not linked to bash. To fix this, you should either change the shebang to #!/bin/bash or use POSIX-compliant [ ... ].

@mohamed-essam mohamed-essam force-pushed the netbird-ui-restart-linux branch from 0058b99 to d5da3cc Compare December 10, 2024 20:30
@mohamed-essam
Copy link
Contributor Author

Ah yes thanks, sorry I missed this and forgot that I had /bin/sh linked to /bin/bash on my system, I changed it now, and will be testing it on some other systems as well 🙏

@mohamed-essam mohamed-essam force-pushed the netbird-ui-restart-linux branch 2 times, most recently from 441432a to a0813ab Compare December 10, 2024 21:34
@mohamed-essam mohamed-essam force-pushed the netbird-ui-restart-linux branch from a0813ab to 6668abc Compare December 11, 2024 12:42
@mohamed-essam
Copy link
Contributor Author

@mgarces Tested latest script on Ubuntu 22.04 (with and without /bin/sh linked to /bin/bash), and Fedora Desktop 40 and both work now perfectly ✔️

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.

2 participants