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

Update Shebangs and daily.sh for FreeBSD compatibility #6413

Merged
merged 4 commits into from Apr 18, 2017

Conversation

Projects
None yet
6 participants
@Pricetx
Contributor

Pricetx commented Apr 13, 2017

Updated the shebangs on any files that did not have flags set to use /usr/bin/env, to provide support for FreeBSD in addition to Linux.
Updated daily.sh to support FreeBSD (su has different args, replaced with sudo when not on linux)

DO NOT DELETE THIS TEXT

Please note

Please read this information carefully. You can run ./scripts/pre-commit.php to check your code before submitting.

  • Have you signed the Contributors agreement - please do NOT submit a pull request unless you have (signing the agreement in the same pull request is fine). Your commit message for signing the agreement must appear as per the docs.
  • Have you followed our code guidelines?

Testers

If you would like to test this pull request then please run: ./scripts/github-apply <pr_id>, i.e ./scripts/github-apply 5926

Pricetx added some commits Apr 13, 2017

Where shebangs had no flags, updated them to use /usr/bin/env for cro…
…ss-platform compatibility

Updated daily.sh to support FreeBSD (su has different args, replaced with sudo when not on linux)
@mention-bot

This comment has been minimized.

Show comment
Hide comment
@mention-bot

mention-bot Apr 13, 2017

Thank you for submitting a PR @Pricetx! We have found the following @laf and @sTywin based on the history of these files to review this PR.

mention-bot commented Apr 13, 2017

Thank you for submitting a PR @Pricetx! We have found the following @laf and @sTywin based on the history of these files to review this PR.

Show outdated Hide outdated daily.sh
if [[ "$(uname)" == "Linux" ]]; then
su -l "$LIBRENMS_USER" -c "$DAILY_SCRIPT $@"
else
sudo -u "$LIBRENMS_USER" "$DAILY_SCRIPT"

This comment has been minimized.

@murrant

murrant Apr 13, 2017

Member

You are missing the arguments here $@

Also, we could probably use sudo for both Linux and FreeBSD...

@murrant

murrant Apr 13, 2017

Member

You are missing the arguments here $@

Also, we could probably use sudo for both Linux and FreeBSD...

This comment has been minimized.

@Pricetx

Pricetx Apr 13, 2017

Contributor

Thanks, I had initially left it off due to it causing the script to break, but later realised it was just a quoting issue. I had intended to add it back but apparently forgot to. I will fix that now.

Regarding sudo on Linux, I'm perfectly fine to do so, but I didn't want to unnecessarily impose the additional dependency on Linux users if I didn't have to. If you're happy for everything to use sudo then i'll go ahead and remove the if statement altogether.

@Pricetx

Pricetx Apr 13, 2017

Contributor

Thanks, I had initially left it off due to it causing the script to break, but later realised it was just a quoting issue. I had intended to add it back but apparently forgot to. I will fix that now.

Regarding sudo on Linux, I'm perfectly fine to do so, but I didn't want to unnecessarily impose the additional dependency on Linux users if I didn't have to. If you're happy for everything to use sudo then i'll go ahead and remove the if statement altogether.

This comment has been minimized.

@murrant

murrant Apr 15, 2017

Member

I think sudo is very standard.

@murrant

murrant Apr 15, 2017

Member

I think sudo is very standard.

Set all platforms to use sudo rather than su
Re-added missing arguments to sudo
@Pricetx

This comment has been minimized.

Show comment
Hide comment
@Pricetx

Pricetx Apr 15, 2017

Contributor

I have updated the pull request with the following changes:

  • Added missing arguments to sudo command
  • Removed su command so all platforms use sudo
Contributor

Pricetx commented Apr 15, 2017

I have updated the pull request with the following changes:

  • Added missing arguments to sudo command
  • Removed su command so all platforms use sudo
@LibreNMS-CI

This comment has been minimized.

Show comment
Hide comment

LibreNMS-CI commented Apr 15, 2017

Auto-Deploy finished, Test PR at http://6413.ci.librenms.org or https://6413.ci.librenms.org

@scrutinizer-notifier

This comment has been minimized.

Show comment
Hide comment
@scrutinizer-notifier

scrutinizer-notifier Apr 15, 2017

The inspection completed: No new issues

scrutinizer-notifier commented Apr 15, 2017

The inspection completed: No new issues

@laf

laf approved these changes Apr 17, 2017

@laf

This comment has been minimized.

Show comment
Hide comment
@laf

laf Apr 17, 2017

Member

lgtm

Member

laf commented Apr 17, 2017

lgtm

@murrant murrant merged commit 2186e3b into librenms:master Apr 18, 2017

2 checks passed

Auto-Deploy Build finished.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@lock lock bot locked as resolved and limited conversation to collaborators May 18, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.