Honor the Xvnc command specified in the config instead of using a hard-coded default. Submitted upstream at: https://github.com/canonical/lightdm/pull/265 diff --git a/src/lightdm.c b/src/lightdm.c index 74f9ff2d..0ccfcd78 100644 --- a/src/lightdm.c +++ b/src/lightdm.c @@ -349,27 +349,42 @@ start_display_manager (void) /* Start the VNC server */ if (config_get_boolean (config_get_instance (), "VNCServer", "enabled")) { - g_autofree gchar *path = g_find_program_in_path ("Xvnc"); - if (path) + /* Validate that a the VNC command is available. */ + g_autofree gchar *command = config_get_string (config_get_instance (), "VNCServer", "command"); + if (command) { - vnc_server = vnc_server_new (); - if (config_has_key (config_get_instance (), "VNCServer", "port")) + g_auto(GStrv) tokens = g_strsplit (command, " ", 2); + if (!g_find_program_in_path (tokens[0])) { - gint port = config_get_integer (config_get_instance (), "VNCServer", "port"); - if (port > 0) - vnc_server_set_port (vnc_server, port); + g_warning ("Can't start VNC server; command '%s' not found", tokens[0]); + return; } - g_autofree gchar *listen_address = config_get_string (config_get_instance (), "VNCServer", "listen-address"); - vnc_server_set_listen_address (vnc_server, listen_address); - g_signal_connect (vnc_server, VNC_SERVER_SIGNAL_NEW_CONNECTION, G_CALLBACK (vnc_connection_cb), NULL); - - g_debug ("Starting VNC server on TCP/IP port %d", vnc_server_get_port (vnc_server)); - vnc_server_start (vnc_server); } else - g_warning ("Can't start VNC server, Xvnc is not in the path"); + { + /* Fallback to 'Xvnc'. */ + if (!g_find_program_in_path ("Xvnc")) { + g_warning ("Can't start VNC server; 'Xvnc' command not found"); + return; + } + } + + vnc_server = vnc_server_new (); + if (config_has_key (config_get_instance (), "VNCServer", "port")) + { + gint port = config_get_integer (config_get_instance (), "VNCServer", "port"); + if (port > 0) + vnc_server_set_port (vnc_server, port); + } + g_autofree gchar *listen_address = config_get_string (config_get_instance (), "VNCServer", "listen-address"); + vnc_server_set_listen_address (vnc_server, listen_address); + g_signal_connect (vnc_server, VNC_SERVER_SIGNAL_NEW_CONNECTION, G_CALLBACK (vnc_connection_cb), NULL); + + g_debug ("Starting VNC server on TCP/IP port %d", vnc_server_get_port (vnc_server)); + vnc_server_start (vnc_server); } } + static void service_ready_cb (DisplayManagerService *service) { puts, native-inputs, propagated-inputs]: New procedures. Use them in 'update-field' calls. * tests/guix-refresh.sh (GUIX_TEST_UPDATER_TARGETS): Add "libreoffice" to the dependencies of "the-test-package". Add 'updater-ignored-inputs' property to "the-test-package". * doc/guix.texi (Invoking guix refresh): Document it. Ludovic Courtès 2023-05-31upstream: 'update-package-source' edits input fields....Previously, 'guix refresh r-ggplot2 -u' and similar commands would print of list of input changes that would have to be made manually. With this change, 'guix refresh -u' takes care of updating input fields automatically. * guix/upstream.scm (update-package-inputs): New procedure. (update-package-source): Call it when 'upstream-source-inputs' returns true. * guix/scripts/refresh.scm (update-package): Remove iteration over the result of 'changed-inputs'. * guix/import/test.scm (available-updates): Add support for input lists. * tests/guix-refresh.sh (GUIX_TEST_UPDATER_TARGETS): Add input list for "the-test-package". Make sure 'guix refresh -u' updates 'inputs' accordingly. * doc/guix.texi (Invoking guix refresh): Mention it. Ludovic Courtès 2023-04-21tests: Relax two tests that expected a non-zero error code....* tests/guix-package-aliases.sh: "guix upgrade foo bar" has always returned zero; adjust accordingly. * tests/guix-refresh.sh: "guix refresh -t test idutils" and similar return zero; adjust accordingly. Ludovic Courtès 2023-04-21tests: Fix checks for expected failures....Addresses <https://issues.guix.gnu.org/62406>. With 'set -e', a return status inverted with '!' does not cause the shell to exit immediately. Instead use '&& false' to indicate an expected failure. * tests/guix-archive.sh, tests/guix-build-branch.sh, tests/guix-build.sh, tests/guix-daemon.sh, tests/guix-download.sh, tests/guix-environment-container.sh, tests/guix-environment.sh, tests/guix-gc.sh, tests/guix-git-authenticate.sh, tests/guix-graph.sh, tests/guix-hash.sh, tests/guix-home.sh, tests/guix-pack-relocatable.sh, tests/guix-pack.sh, tests/guix-package-aliases.sh, tests/guix-package-net.sh, tests/guix-package.sh, tests/guix-refresh.sh, tests/guix-shell.sh, tests/guix-style.sh, tests/guix-system.sh: Replace uses of '! ...' with '... && false' or `test ! ...` as appropriate. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Eric Bavier 2023-01-25tests: Do not try to create "$HOME/.config"....Previously this test would fail when HOME=/homeless-shelter and said directory cannot be created. * tests/guix-refresh.sh: Pass '--keyring' together with '-u'. Ludovic Courtès 2023-01-08refresh: Add CLI tests....* guix/import/test.scm, tests/guix-refresh.sh: New files. * Makefile.am (MODULES, SH_TESTS): Add them. Ludovic Courtès