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) { '>* guix/store/deduplication.scm (dump-file/deduplicate): Use 'sendfile' instead of 'dump-port'. * tests/store-deduplication.scm ("copy-file/deduplicate, below %deduplication-minimum-size"): New test. Ludovic Courtès 2021-11-16daemon: Do not deduplicate files smaller than 8 KiB....Files smaller than 8 KiB typically represent ~70% of the entries in /gnu/store/.links but only contribute to ~4% of the space savings afforded by deduplication. Not considering these files for deduplication speeds up file insertion in the store and, more importantly, leaves 'removeUnusedLinks' with fewer entries to traverse, thereby speeding it up proportionally. Partly fixes <https://issues.guix.gnu.org/24937>. * config-daemon.ac: Remove symlink hard link check and CAN_LINK_SYMLINK definition. * guix/store/deduplication.scm (%deduplication-minimum-size): New variable. (deduplicate)[loop]: Do not recurse when FILE's size is below %DEDUPLICATION-MINIMUM-SIZE. (dump-port): New procedure. (dump-file/deduplicate)[hash]: Turn into... [dump-and-compute-hash]: ... this thunk. Call 'deduplicate' only when SIZE is greater than %DEDUPLICATION-MINIMUM-SIZE; otherwise call 'dump-port'. * nix/libstore/gc.cc (LocalStore::removeUnusedLinks): Drop files where st.st_size < deduplicationMinSize. * nix/libstore/local-store.hh (deduplicationMinSize): New declaration. * nix/libstore/optimise-store.cc (deduplicationMinSize): New variable. (LocalStore::optimisePath_): Return when PATH is a symlink or smaller than 'deduplicationMinSize'. * tests/derivations.scm ("identical files are deduplicated"): Produce files bigger than %DEDUPLICATION-MINIMUM-SIZE. * tests/nar.scm ("restore-file-set with directories (signed, valid)"): Likewise. * tests/store-deduplication.scm ("deduplicate, below %deduplication-minimum-size"): New test. ("deduplicate", "deduplicate, ENOSPC"): Produce files bigger than %DEDUPLICATION-MINIMUM-SIZE. * tests/store.scm ("substitute, deduplication"): Likewise. Ludovic Courtès 2020-12-15deduplicate: Create the '.links' directory lazily....This avoids repeated (mkdir-p "/gnu/store/.links") calls when deduplicating lots of files. * guix/store/deduplication.scm (deduplicate): Remove initial call to 'mkdir-p'. Add ENOENT case in 'link' exception handler. Reindent. * tests/store-deduplication.scm ("deduplicate, ENOSPC"): Check for (<= links 4) to account for the initial 'link' call. Ludovic Courtès 2020-12-15store-copy: 'populate-store' can optionally deduplicate files....Until now deduplication was performed as an additional pass after copying files, which involve re-traversing all the files that had just been copied. * guix/store/deduplication.scm (copy-file/deduplicate): New procedure. * tests/store-deduplication.scm ("copy-file/deduplicate"): New test. * guix/build/store-copy.scm (populate-store): Add #:deduplicate? parameter and honor it. * tests/gexp.scm ("gexp->derivation, store copy"): Pass #:deduplicate? #f to 'populate-store'. * gnu/build/image.scm (initialize-root-partition): Pass #:deduplicate? to 'populate-store'. Pass #:deduplicate? #f to 'register-closure'. * gnu/build/vm.scm (root-partition-initializer): Likewise. * gnu/build/install.scm (populate-single-profile-directory): Pass #:deduplicate? #f to 'populate-store'. * gnu/build/linux-initrd.scm (build-initrd): Likewise. * guix/scripts/pack.scm (self-contained-tarball)[import-module?]: New procedure. [build]: Pass it as an argument to 'source-module-closure'. * guix/scripts/pack.scm (squashfs-image)[build]: Wrap in 'with-extensions'. * gnu/system/linux-initrd.scm (expression->initrd)[import-module?]: New procedure. [builder]: Pass it to 'source-module-closure'. * gnu/system/install.scm (cow-store-service-type)[import-module?]: New procedure. Pass it to 'source-module-closure'. Ludovic Courtès