Skip to content

Conversation

@pedrib
Copy link

@pedrib pedrib commented Apr 12, 2020

This fixes a bug that happens (at least on my machine) when sysctl is not executable by a non-root user.
Without it, this happens:

autochrome > ruby autochrome.rb -d autochrome_install/
[???] Detected Linux (x86_64)
Traceback (most recent call last):
        7: from autochrome.rb:90:in `<main>'
        6: from autochrome.rb:90:in `new'
        5: from tools/autochrome/lib/auto_chrome.rb:107:in `initialize'
        4: from tools/autochrome/lib/processor/chrome.rb:49:in `new_from_type'
        3: from tools/autochrome/lib/processor/chrome.rb:49:in `new'
        2: from tools/autochrome/lib/processor/unix.rb:9:in `initialize'
        1: from tools/autochrome/lib/processor/linux.rb:14:in `sanity_check'
tools/autochrome/lib/processor/linux.rb:14:in ``': No such file or directory - sysctl (Errno::ENOENT)

The fix is to surround the sysctl command with a begin / rescue statement for Errno::ENOENT.

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.

1 participant