]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
systemctl: Use /usr/bin/editor if available 52/head
authorMichael Biebl <biebl@debian.org>
Wed, 3 Jun 2015 12:00:59 +0000 (14:00 +0200)
committerMichael Biebl <biebl@debian.org>
Wed, 3 Jun 2015 12:14:42 +0000 (14:14 +0200)
If the EDITOR environment variable is not set, the Debian policy
recommends to use the /usr/bin/editor program as default editor.
This file is managed via the dpkg alternatives mechanism and typically
used in Debian/Ubuntu and derivatives to configure the default editor.

See section 11.4 of the Debian policy [1].

Therefor prefer /usr/bin/editor over specific editors if available.

[1] https://www.debian.org/doc/debian-policy/ch-customized-programs.html

man/systemctl.xml
src/systemctl/systemctl.c

index 35f47de52c64c143aa81f454da42ce1a4187f004..409b6f0895a8b21b474bc015a8da5b5c666cbb67 100644 (file)
@@ -1733,6 +1733,7 @@ kobject-uevent 1 systemd-udevd-kernel.socket systemd-udevd.service
         <varname>$VISUAL</varname> are present or if it is set to an empty
         string or if their execution failed, systemctl will try to execute well
         known editors in this order:
+        <citerefentry project='die-net'><refentrytitle>editor</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
         <citerefentry project='die-net'><refentrytitle>nano</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
         <citerefentry project='die-net'><refentrytitle>vim</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
         <citerefentry project='die-net'><refentrytitle>vi</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
index a7b8e54a9ca67e97ccf7439abd2ae44fcb8f2fe1..b3d90d2c3343e348dca65b607de188d4b8fcdc6e 100644 (file)
@@ -5879,7 +5879,7 @@ static int run_editor(char **paths) {
                         execvp(editor, (char* const*) args);
                 }
 
-                FOREACH_STRING(p, "nano", "vim", "vi") {
+                FOREACH_STRING(p, "editor", "nano", "vim", "vi") {
                         args[0] = p;
                         execvp(p, (char* const*) args);
                         /* We do not fail if the editor doesn't exist