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

Command not recognized #26

Open
chananshgong opened this issue Jun 4, 2017 · 14 comments
Open

Command not recognized #26

chananshgong opened this issue Jun 4, 2017 · 14 comments

Comments

@chananshgong
Copy link

resolvconf: Error: Command not recognized
Usage: resolvconf (-d IFACE|-a IFACE|-u|--enable-updates|--disable-updates|--updates-are-enabled)

yet in the script I see $RESOLVCONF -x -a "${dev}.inet"
There is no -x flag above.
What's wrong?

@alfredopalhares
Copy link
Owner

Hello,

Can you give more information about our OS, and your RESOLVCONF?

@wgillett
Copy link

wgillett commented Jul 7, 2017

I am seeing the same problem on Ubuntu 17.04, RESOLVCONF=/usr/sbin/resolvconf .

@damien-ls
Copy link

damien-ls commented Sep 1, 2017

I have the same issue on Ubuntu 17.04. Removing -x flag remove the error.

@lonicerae
Copy link
Contributor

Please set the 'verb' to 4 or above, and then run the openvpn in terminal/console and then post the log to us. Filter out your sensitive information before posting.

@wgillett
Copy link

wgillett commented Sep 4, 2017

I've worked around this problem & am all set thanks

@sheldonh
Copy link

sheldonh commented Nov 9, 2017

Removing the -x flag and the ".inet" PROG specifier from the device name fixes the script for me on Ubuntu 16.04.

@alfredopalhares
Copy link
Owner

I will need to fix this and check resolvconf versions.

@slavafomin
Copy link

slavafomin commented Apr 16, 2018

Hello!

I'm getting the same error:

resolvconf: Error: Command not recognized
Usage: resolvconf (-d IFACE|-a IFACE|-u|--enable-updates|--disable-updates|--updates-are-enabled)
$ cat /etc/issue
Ubuntu 16.04.4 LTS
$ uname -a
Linux intrepid 4.13.0-38-generic #43~16.04.1-Ubuntu SMP Wed Mar 14 17:48:43 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

I can confirm that fix by sheldonh is working:

Removing the -x flag and the ".inet" PROG specifier from the device name fixes the script for me on Ubuntu 16.04.

@M-Devloo
Copy link

Same fix by @sheldonh for Ubuntu 18.04

4.15.0-64-generic #73-Ubuntu SMP Thu Sep 12 13:16:13 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

@alfredopalhares
Copy link
Owner

I need to add some OS detection to this.

@ammgws
Copy link

ammgws commented Sep 25, 2019

Would it be reliable to just check if the command output is Command not recognised and try the other command in that case?

The current command should work in systemd's resolvectl and openresolv, so it's just the resolvconf that ships with Ubuntu <18.04(?) that doesn't support those command line options.

This is the output of resolvconf --version for each command. Perhaps this output could be used for detecting which command to run if not the method above.
(sorry I cannot copy&paste text into Firefox atm)

openresolv on Arch Linux:
20190925_19h51m09s

resolvectl on Arch Linux (symlinked to /usr/bin/resolvconf when being used):
20190925_19h48m25s

resolvconf on Ubuntu 16.04:
20190925_19h48m49s

@M-Devloo
Copy link

M-Devloo commented Sep 25, 2019

The best way would be to verify that OS that the script is running on. Basically all the debian based images (Raspbian, Ubuntu, Debian) ships with a resolvconf that does not know this -x command.

The accepted answer on stackoverflow can give some insight: https://unix.stackexchange.com/questions/6345/how-can-i-get-distribution-name-and-version-number-in-a-simple-shell-script

When testing this on a a Ubuntu 18.04 server, echo ${OS} returns: Ubuntu
On Raspbian, echo ${OS} returns Raspbian GNU/Linux

With this, you can specify certain commands depending on a certain distro. If you want to really go nuts, you can also check the version with ${VER}

@ammgws
Copy link

ammgws commented Sep 25, 2019

Wouldn't the most surefire way be to detect the "version" of resolveconf being run, because the user may be using a different one as to what was originally shipped. For example on one of my Ubuntu 16.04 I'm running openresolv instead of the script originally shipped with the distro.

@tudorpavel
Copy link

tudorpavel commented Mar 25, 2020

My solution for Ubuntu 16.04 was to apt install the openresolv package which upgrades the default resolvconf to a newer version that supports the -x option.

Edit: Which of course is mentioned in the README. 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants