PowerDNS / pdns

PowerDNS Authoritative, PowerDNS Recursor, dnsdist
https://www.powerdns.com/
GNU General Public License v2.0
3.63k stars 904 forks source link

pdnsutil edit-zone not working on EL7 by default #4173

Open hnsk opened 8 years ago

hnsk commented 8 years ago

EL7 environment doesn't have which editor or $EDITOR set by default.

This causes the following to happen:

# pdnsutil edit-zone vice.fi
Jul 14 10:47:09 Reading random entropy from '/dev/urandom'
Jul 14 10:47:09 gmysql Connection successful. Connected to database 'poweradmin' on '127.0.0.1'.
Jul 14 10:47:09 gmysql Connection successful. Connected to database 'poweradmin' on '127.0.0.1'.
sh: editor: command not found
Error: Editing file with: 'editor /tmp/pdnsutil-Ly1gwm', perhaps set EDITOR variable: Success

Also the ":Success" in the end is slightly misleading as it succeeded in erroring.

Maybe it should default to vi(m) by default as that is what most applications do (visudo for example) and if someone prefers something else then they most likely have $EDITOR set.

jpmens commented 8 years ago

FWIW (and I know this because it upsets me when I forget to configure $EDITOR on new boxes), Debian defaults to nano (e.g. in git, visudo, etc.).

cmouse commented 8 years ago

git uses

/usr/bin/git-core/editor
/usr/local/bin/editor
/usr/bin/editor

until it finds something. Possibly uses something else as well.

hnsk commented 8 years ago

https://github.com/PowerDNS/pdns/pull/4176 fixes this by defaulting to vi if $EDITOR is not set or editor found in path.

rodrigoslayertech commented 4 years ago

I have this error now:

sh: editor: command not found
Error: Editing file with: 'editor /tmp/pdnsutil-5VVukw', perhaps set EDITOR variable: Resource temporarily unavailable
jpmens commented 4 years ago

Have you read the actual error message? If you have, which steps did you undertake to solve the problem?

rodrigoslayertech commented 4 years ago

Have you read the actual error message? If you have, which steps did you undertake to solve the problem?

I did not understand, sorry.

cmouse commented 4 years ago

sh: editor: command not found

rodrigoslayertech commented 4 years ago

sh: editor: command not found

Yes. I already tried to define an alias to "editor" or define the editor variable for the nano editor path, but it doesn't work My OS is CentOS 7

jpmens commented 4 years ago

The variable is called EDITOR.

$ EDITOR=/path/to/your/favorite/editing/utility
$ export EDITOR

If that doesn't work: show us

$ which nano