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

Fix conditional test against useradd so it's compatible with Dash #232

Merged
merged 1 commit into from
Sep 28, 2015

Conversation

yankcrime
Copy link

The test to see which version of useradd is installed uses 'bashisms' that fail on Ubuntu due to the fact that /bin/sh is symlinked to Dash, causing the telegraf account to be created without the --system option ever being passed.

This change amends the syntax so that it's POSIX-compatible and more portable as a result. Fixes #231.

@ekini
Copy link
Contributor

ekini commented Sep 28, 2015

Maybe it's better to use "-eq 0", then?
Seems to be portable.

The test to see which version of `useradd` is installed uses 'bashisms'
that fail on Ubuntu due to the fact that `/bin/sh` is symlinked to Dash,
causing the telegraf account to be created without the `--system` option
ever being passed.

This change amends the syntax so that it's POSIX-compatible and more
portable as a result.
@yankcrime
Copy link
Author

@ekini Good point, thanks!

@sparrc
Copy link
Contributor

sparrc commented Sep 28, 2015

this looks good, thank you @yankcrime!

@sparrc sparrc merged commit cd7468f into influxdata:master Sep 28, 2015
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.

None yet

3 participants