Upstream dbus service just opens a new firefox window instead of launching a search provider. And after about two minutes firefox exits. $ cat /usr/share/dbus-1/services/org.mozilla.firefox.SearchProvider.service [D-BUS Service] Name=org.mozilla.firefox.SearchProvider Exec=/usr/bin/firefox Sep 06 22:17:17 work dbus-daemon[5980]: [session uid=1000 pid=5980 pidfd=5] Activating service name='org.mozilla.firefox.SearchProvider' requested by ':1.15' (uid=1000 pid=6045 comm="/usr/bin/gnome-shell") Sep 06 22:17:18 work dbus-daemon[3351]: [system] Activating via systemd: service name='org.freedesktop.timedate1' unit='dbus-org.freedesktop.timedate1.service' requested by ':1.1551' (uid=1000 pid=166860 comm="/usr/lib64/firefox/firefox") Sep 06 22:19:17 work dbus-daemon[5980]: [session uid=1000 pid=5980 pidfd=5] Failed to activate service 'org.mozilla.firefox.SearchProvider': timed out (service_start_timeout=120000ms) Sep 06 22:19:17 work org.mozilla.firefox.SearchProvider[168012]: Exiting due to channel error. Sep 06 22:19:17 work org.mozilla.firefox.SearchProvider[168031]: Exiting due to channel error. Sep 06 22:19:17 work org.mozilla.firefox.SearchProvider[167480]: Exiting due to channel error. Sep 06 22:19:17 work org.mozilla.firefox.SearchProvider[167415]: Exiting due to channel error. Sep 06 22:19:17 work org.mozilla.firefox.SearchProvider[167488]: Exiting due to channel error. Sep 06 22:19:17 work org.mozilla.firefox.SearchProvider[167767]: Exiting due to channel error. Sep 06 22:19:17 work org.mozilla.firefox.SearchProvider[167701]: Exiting due to channel error. Sep 06 22:19:17 work org.mozilla.firefox.SearchProvider[167697]: Exiting due to channel error. Sep 06 22:19:17 work org.mozilla.firefox.SearchProvider[167471]: Exiting due to channel error. Sep 06 22:19:17 work org.mozilla.firefox.SearchProvider[167410]: Exiting due to channel error. Sep 06 22:19:17 work org.mozilla.firefox.SearchProvider[167466]: Exiting due to channel error. Sep 06 22:19:17 work org.mozilla.firefox.SearchProvider[167129]: Exiting due to channel error. I've tried dbus service file from fedora [1]. Firefox now works fine without exits, but search provider still doesn't run. Not sure what else is missing, I'm still investigating. $ cat /usr/share/dbus-1/services/org.mozilla.firefox.SearchProvider.service [D-BUS Service] Name=org.mozilla.firefox.SearchProvider Exec=/usr/lib64/firefox/firefox --dbus-service /usr/bin/firefox Sep 06 23:01:07 work dbus-daemon[5980]: [session uid=1000 pid=5980 pidfd=5] Activating service name='org.mozilla.firefox.SearchProvider' requested by ':1.15' (uid=1000 pid=6045 comm="/usr/bin/gnome-shell") Sep 06 23:01:10 work dbus-daemon[3351]: [system] Activating via systemd: service name='org.freedesktop.timedate1' unit='dbus-org.freedesktop.timedate1.service' requested by ':1.1690' (uid=1000 pid=175726 comm="/usr/lib64/firefox/firefox") Sep 06 23:03:07 work dbus-daemon[5980]: [session uid=1000 pid=5980 pidfd=5] Failed to activate service 'org.mozilla.firefox.SearchProvider': timed out (service_start_timeout=120000ms) $ emerge --info firefox Portage 3.0.65 (python 3.12.3-final-0, default/linux/amd64/23.0/systemd, gcc-13, glibc-2.39-r6, 6.6.49-gentoo x86_64) ================================================================= System Settings ================================================================= System uname: Linux-6.6.49-gentoo-x86_64-Intel-R-_Core-TM-_i7-8565U_CPU_@_1.80GHz-with-glibc2.39 KiB Mem: 16118576 total, 2722520 free KiB Swap: 8388604 total, 7032956 free Timestamp of repository gentoo: Fri, 06 Sep 2024 11:30:00 +0000 Head commit of repository gentoo: 258ee7d2de8559ad285a2c95b6ef6d9322c7e2a7 Head commit of repository puleglot: 226890a9ba1e4fafae7481dc9d0ec730c4034de7 sh dash 0.5.12 ld GNU ld (Gentoo 2.42 p3) 2.42.0 distcc 3.4 x86_64-pc-linux-gnu [disabled] app-misc/pax-utils: 1.3.7::gentoo app-shells/bash: 5.2_p26-r6::gentoo dev-build/autoconf: 2.13-r8::gentoo, 2.71-r7::gentoo dev-build/automake: 1.16.5-r2::gentoo dev-build/cmake: 3.30.2::gentoo dev-build/libtool: 2.4.7-r4::gentoo dev-build/make: 4.4.1-r1::gentoo dev-build/meson: 1.5.1::gentoo dev-java/java-config: 2.3.4::gentoo dev-lang/perl: 5.40.0::gentoo dev-lang/python: 3.12.3-r1::gentoo dev-lang/rust: 1.79.0::gentoo sys-apps/baselayout: 2.15::gentoo sys-apps/sandbox: 2.38::gentoo sys-apps/systemd: 255.7-r1::gentoo sys-devel/binutils: 2.42-r1::gentoo sys-devel/binutils-config: 5.5::gentoo sys-devel/clang: 18.1.8::gentoo sys-devel/gcc: 13.3.1_p20240614::gentoo sys-devel/gcc-config: 2.11::gentoo sys-devel/lld: 18.1.8::gentoo sys-devel/llvm: 18.1.8-r1::gentoo sys-kernel/linux-headers: 6.6-r1::gentoo (virtual/os-headers) sys-libs/glibc: 2.39-r6::gentoo Repositories: gentoo location: /var/db/repos/gentoo sync-type: rsync sync-uri: rsync://puleglot.ru/gentoo-portage priority: -1000 volatile: False sync-rsync-verify-jobs: 4 sync-rsync-verify-max-age: 3 sync-rsync-verify-metamanifest: yes sync-rsync-extra-opts: crossdev location: /var/db/repos/crossdev masters: gentoo priority: 100 volatile: False puleglot location: /var/db/repos/puleglot sync-type: git sync-uri: https://puleglot.ru/git/gentoo/puleglot-overlay.git masters: gentoo priority: 900 volatile: False local location: /usr/local/portage masters: gentoo priority: 1000 volatile: True Binary Repositories: work-ex-local priority: 9998 sync-uri: http://192.168.1.188/gentoo/packages ACCEPT_KEYWORDS="amd64" ACCEPT_LICENSE="@FREE" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-O2 -march=x86-64-v2 -pipe" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/easy-rsa /usr/share/gnupg/qualified.txt" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d" CXXFLAGS="-O2 -march=x86-64-v2 -pipe" DISTDIR="/var/cache/distfiles" EMERGE_DEFAULT_OPTS="--dynamic-deps=n --with-bdeps=y --binpkg-respect-use=y --ask-enter-invalid" ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GDK_PIXBUF_MODULE_FILE GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR XDG_STATE_HOME" FCFLAGS="-O2 -march=x86-64-v2 -pipe" FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg-live clean-logs compress-build-logs config-protect-if-modified distlocks ebuild-locks fixlafiles getbinpkg ipc-sandbox merge-sync merge-wait multilib-strict network-sandbox news parallel-fetch pid-sandbox pkgdir-index-trusted preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms split-log strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr" FFLAGS="-O2 -march=x86-64-v2 -pipe" GENTOO_MIRRORS="http://mirror.yandex.ru/gentoo-distfiles/ http://distfiles.gentoo.org/" LANG="ru_RU.utf8" LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs" LEX="flex" MAKEOPTS="-j4" PKGDIR="/var/cache/binpkgs" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git" PORTAGE_TMPDIR="/var/tmp" RUSTFLAGS="-C opt-level=2 -C target-cpu=x86-64-v2" SHELL="/bin/bash" USE="X a52 aac acl acpi aio alsa amd64 amr ape asyncns avahi avif bash-completion bluetooth bluray branding bzip2 cairo caps cdda cddb cdparanoia cdr cet cli colord crypt cryptsetup cups dbus dconf device-mapper djvu dri dts dvd dvdr eds egl evo exif faac faad ffmpeg flac fontconfig fuse gdbm gif gnome gnome-online-accounts gnome-shell gpm gstreamer gtk gtk3 hardened heif iconv icu idn introspection ipv6 jpeg jpeg2k jpegxl keyring lcms libass libnotify libsecret libtirpc lz4 lzma lzo mac maildir modules-compress mp3 mp4 multilib musepack musicbrainz nautilus ncurses networkmanager nls nptl ogg opengl openmp opus pam pcre pic pie pipewire png policykit postscript pulseaudio raw readline samba sasl screencast seccomp speex spell ssl ssp startup-notification svg systemd test-rust theora tiff tls truetype udev unicode upnp-av urandom usb vaapi vdpau vim-syntax vorbis vpx vulkan wavpack wayland webp x264 x265 xattr xtpax xv xvid xz zeroconf zlib zstd" ABI_X86="64" ADA_TARGET="gcc_12" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_anon authn_dbm authn_file authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir env expires ext_filter file_cache filter headers include info log_config logio mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" APACHE2_MPMS="prefork" CALLIGRA_FEATURES="karbon sheets words" CAMERAS="*" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx f16c mmx mmxext pclmul popcnt rdrand sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 ntrip navcom oceanserver oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 tsip tripmate tnt ublox" GRUB_PLATFORMS="efi-64 pc" GUILE_SINGLE_TARGET="3-0" GUILE_TARGETS="3-0" INPUT_DEVICES="evdev libinput" KERNEL="linux" L10N="en ru" LCD_DEVICES="bayrad cfontz glk hd44780 lb216 lcdm001 mtxorb text" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php8-2" POSTGRES_TARGETS="postgres15" PYTHON_SINGLE_TARGET="python3_12" PYTHON_TARGETS="python3_12" QEMU_SOFTMMU_TARGETS="aarch64 arm i386 mips mips64 mips64el mipsel x86_64" QEMU_USER_TARGETS="aarch64 arm" RUBY_TARGETS="ruby31 ruby32" VIDEO_CARDS="intel vesa" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipp2p iface geoip fuzzy condition tarpit sysrq proto logmark ipmark dhcpmac delude chaos account" Unset: ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LD, LFLAGS, LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PYTHONPATH, RANLIB, READELF, SIZE, STRINGS, STRIP, YACC, YFLAGS ================================================================= Package Settings ================================================================= www-client/firefox-128.2.0::gentoo was built with the following: USE="X clang dbus hardened hwaccel jumbo-build openh264 pulseaudio system-av1 system-harfbuzz system-icu system-jpeg system-libevent system-libvpx system-webp telemetry wayland -debug -eme-free -gmp-autoupdate -jack -libproxy -lto -pgo (-selinux) -sndio -system-png -wifi" ABI_X86="(64)" L10N="ru -ach -af -an -ar -ast -az -be -bg -bn -br -bs -ca -ca-valencia -cak -cs -cy -da -de -dsb -el -en-CA -en-GB -eo -es-AR -es-CL -es-ES -es-MX -et -eu -fa -ff -fi -fr -fur -fy -ga -gd -gl -gn -gu -he -hi -hr -hsb -hu -hy -ia -id -is -it -ja -ka -kab -kk -km -kn -ko -lij -lt -lv -mk -mr -ms -my -nb -ne -nl -nn -oc -pa -pl -pt-BR -pt-PT -rm -ro -sc -sco -si -sk -skr -sl -son -sq -sr -sv -szl -ta -te -th -tl -tr -trs -uk -ur -uz -vi -xh -zh-CN -zh-TW" LLVM_SLOT="18 -17" CFLAGS="-march=x86-64-v2 -pipe" CXXFLAGS="-march=x86-64-v2 -pipe" FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg buildpkg-live clean-logs compress-build-logs config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync merge-wait multilib-strict network-sandbox news parallel-fetch pid-sandbox pkgdir-index-trusted preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms split-log strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr" LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,-z,relro -Wl,-z,now -Wl,--undefined-version -Wl,--compress-debug-sections=zlib -Wl,-rpath=/usr/lib64/firefox,--enable-new-dtags" [1] https://src.fedoraproject.org/rpms/firefox/blob/rawhide/f/org.mozilla.firefox.SearchProvider.service
(In reply to Alexander Tsoy from comment #0) > I've tried dbus service file from fedora [1]. Firefox now works fine without > exits, but search provider still doesn't run. Not sure what else is missing, > I'm still investigating. I added this to the wrapper script and everything seems to work now: # MOZ_DBUS_APP_NAME sets app name for DBus services like Gnome Shell # search provider or remote launcher # DBus interface name (or prefix) is org.mozilla.MOZ_DBUS_APP_NAME if [[ -z ${MOZ_DBUS_APP_NAME} ]] then export MOZ_DBUS_APP_NAME=firefox fi
(In reply to Alexander Tsoy from comment #1) > I added this to the wrapper script and everything seems to work now: > > # MOZ_DBUS_APP_NAME sets app name for DBus services like Gnome Shell > # search provider or remote launcher > # DBus interface name (or prefix) is org.mozilla.MOZ_DBUS_APP_NAME > if [[ -z ${MOZ_DBUS_APP_NAME} ]] > then > export MOZ_DBUS_APP_NAME=firefox > fi It doesn't change anything actually. Please ignore this.
(In reply to Alexander Tsoy from comment #0) > $ cat /usr/share/dbus-1/services/org.mozilla.firefox.SearchProvider.service > [D-BUS Service] > Name=org.mozilla.firefox.SearchProvider > Exec=/usr/lib64/firefox/firefox --dbus-service /usr/bin/firefox Alternatively a similar behaviour can be implemented in a wrapper script without touching upstream dbus service file: @@ -112,5 +112,10 @@ # Don't throw "old profile" dialog box. export MOZ_ALLOW_DOWNGRADE=1 -# Run the browser -exec ${MOZ_PROGRAM} "${@}" +if [[ -n ${DBUS_STARTER_ADDRESS} ]]; then + # Run as DBus service + exec ${MOZ_PROGRAM} --dbus-service ${MOZ_APP_LAUNCHER} +else + # Run the browser + exec ${MOZ_PROGRAM} "${@}" +fi
(In reply to Alexander Tsoy from comment #0) > I've tried dbus service file from fedora [1]. Firefox now works fine without > exits, but search provider still doesn't run. Not sure what else is missing, > I'm still investigating. Turned out "browser.gnome-search-provider.enabled" is also need to be set to true in about:config. Now it works for me.
To summarize, current behaviour: 1. When you search something in gnome shell, it launches firefox via dbus service if it hasn't been launched yet. 2. If "browser.gnome-search-provider.enabled" is unset or set to false, then firefox won't act as a search provider, dbus service just open up a new firefox window, then service times out and firefox exits. 3. If "browser.gnome-search-provider.enabled" is set to true, then firefox can act as a search provider, but the first issue is still present. This can be fixed by changing dbus service file (see comment #0) or by changing the wrapper script (see comment #3). And I'm not sure how to inform users about "browser.gnome-search-provider.enabled" pref and if it should be added to defaults prefs. Also note that I've only tested 128.2.0 ESR.
Thanks for all this! I guess it needs to become a use flag after all.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=de952745c916c1b1b5bd95346c886ed42eba306f commit de952745c916c1b1b5bd95346c886ed42eba306f Author: Joonas Niilola <juippis@gentoo.org> AuthorDate: 2024-09-09 11:26:25 +0000 Commit: Joonas Niilola <juippis@gentoo.org> CommitDate: 2024-09-09 11:28:34 +0000 www-client/firefox: move installing gnome search provider files - Introduce new "gnome-shell" use flag to install search provider files for Gnome. It requires adding prefs and I'm not confident it's not going to break when using other DEs/WMs. "gnome-shell" use flag is default-enabled in Gnome profiles, so it should integrate neatly when using Gnome profile. Closes: https://bugs.gentoo.org/939196 Signed-off-by: Joonas Niilola <juippis@gentoo.org> www-client/firefox/firefox-128.2.0.ebuild | 32 ++++++++++++++++++++++--------- www-client/firefox/firefox-130.0.ebuild | 32 ++++++++++++++++++++++--------- www-client/firefox/metadata.xml | 1 + 3 files changed, 47 insertions(+), 18 deletions(-)