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

misc: Fix bash path in shebangs #16494

Merged
merged 1 commit into from Aug 27, 2017
Merged

misc: Fix bash path in shebangs #16494

merged 1 commit into from Aug 27, 2017

Conversation

asomers
Copy link
Contributor

@asomers asomers commented Jul 21, 2017

/bin/bash is a Linuxism. Other operating systems install bash to
different paths. Use /usr/bin/env in shebangs to find bash.

@asomers
Copy link
Contributor Author

asomers commented Jul 21, 2017

CC @wjw , who's done a lot of work on Ceph portability

# -*- mode:shell-script; tab-width:8; sh-basic-offset:2; indent-tabs-mode:t -*-
# vim: ts=8 sw=8 ft=bash smarttab

source $(dirname $0)/../ceph-helpers.sh

set -e
set -ex
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@asomers
This change silences the -x on the ceph-helpers.sh, not sure you want to change behaviour in such an invasive patch.

@@ -1,4 +1,4 @@
#!/bin/bash -e
#!/usr/bin/env bash

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@asomers
Missing -e

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, not. There's already a redundant "set -e" on line 8

@@ -1,4 +1,4 @@
#!/bin/bash -e
#!/usr/bin/env bash

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@asomers
Missing -e

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Likewise, there's already a redundant set -e on line 9

@wjwithagen
Copy link
Contributor

wjwithagen commented Jul 21, 2017 via email

@asomers
Copy link
Contributor Author

asomers commented Jul 24, 2017

It turns out that some submodules also use /bin/bash shebangs. So I'm reverting the changes I made to README.FreeBSD. But the other changes are still good.

@wjwithagen
Copy link
Contributor

jenkins retest please

@wjwithagen
Copy link
Contributor

@asomers
Hi Alan,
You need to remove ceph-disk from the commit, since the code that had a bash ref in it has gone.

@asomers asomers force-pushed the bin_bash branch 2 times, most recently from 96c6323 to d02bdf3 Compare July 26, 2017 15:58
@@ -14,7 +14,8 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Library Public License for more details.
#
source $CEPH_ROOT/qa/standalone/ceph-helpers.sh
set -x
source $CEPH_ROOT/qa/workunits/ceph-helpers.sh
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@asomers
You are moving code back to workunits, were a few commits back things got moved to standalone.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

grahh, missed one. I'll fix it.

@@ -1,4 +1,4 @@
#!/bin/bash -x
#!/usr/bin/env bash

set -e
set -x
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@asomers
Why not join them on one line?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I could do that too.

@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -e
set -x
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@asomers Dito, unless you only want to change what really needs to change.

@wjwithagen
Copy link
Contributor

@tchaikov
Could you take a look at this as well, and run it thru QA?

/bin/bash is a Linuxism.  Other operating systems install bash to
different paths.  Use /usr/bin/env in shebangs to find bash.

Signed-off-by: Alan Somers <asomers@gmail.com>
@liewegas liewegas changed the title Fix bash path in shebangs misc: Fix bash path in shebangs Aug 8, 2017
@wjwithagen
Copy link
Contributor

wjwithagen commented Aug 10, 2017

retest this please

@@ -1,4 +1,4 @@
#! /bin/bash
#! /usr/bin/env bash
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think systemd is used by Linux only. so this change is not necessary?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tchaikov
I happy to say it is Linux only...
The amount of unexpected irritation I hear from my colleague makes me a content init user.

@liewegas
Copy link
Member

@tchaikov ok to merge?

@tchaikov tchaikov merged commit 30b5b46 into ceph:master Aug 27, 2017
@asomers asomers deleted the bin_bash branch September 25, 2017 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants