Skip to content

Commit

Permalink
Prevent "sysctl: unknown oid 'sysctl.proc_translated'" on rancher step (
Browse files Browse the repository at this point in the history
#84)

@chadgh recently ran into an issue where he saw this error while trying
to install IH rancher:
```
sysctl: unknown oid 'sysctl.proc_translated'
```

This seems to be caused by running on a system that doesn't have rosetta
2 installed.

This PR uses `$(uname -m)` to check for whether it's using arm64
instead, which should be compatible with more setups.
  • Loading branch information
pb-dod authored Jan 31, 2024
1 parent 1ecd172 commit 72cf839
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.45
0.1.46
2 changes: 1 addition & 1 deletion formula/ih-core.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class IhCore < Formula
VERSION="0.1.45"
VERSION="0.1.46"
desc "Brew formula for installing core tools used at Included Health engineering."
homepage "https://github.com/ConsultingMD/homebrew-ih-public"
license "CC BY-NC-ND 4.0"
Expand Down
7 changes: 3 additions & 4 deletions lib/core/rancher/step.sh
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,12 @@ function ih::setup::core.rancher::install() {
# Installation and configuration of Rancher Desktop
for _ in 1 2 3; do

# Check if we have a Mac M1 and the terminal is running over x86
if [[ $(sysctl -n sysctl.proc_translated) -eq 1 ]] && [ $(arch) = "i386" ]; then
arch -arm64 -c brew reinstall ih-rancher
# Check if we have a M1 Mac
if [ "$(uname -m)" = "arm64" ]; then
arch -arm64 brew reinstall ih-rancher
else
brew reinstall ih-rancher
fi

CASKSUCCEEDED=$?
if [ $CASKSUCCEEDED -eq 0 ]; then
break
Expand Down

0 comments on commit 72cf839

Please sign in to comment.