Insync 3.9.11 — Linux freezes | root cause identified | workaround confirmed!

Insync 3.9.11 — Linux freezes caused by efivarfs/statfs: root cause identified, workaround confirmed!

Hello Insync team and forum members!

During every startup scan (Scanning...), Insync 3.9.11.60043 caused severe freezes of the entire desktop. Responsiveness returned after scanning finished. Switching to XWayland/XCB alone did not resolve the issue.

System: Kubuntu 26.04 LTS, KDE Plasma 6.6.6, Wayland, kernel 7.0.0-38-generic; Intel Core Ultra 9 275HX (24 cores), 128 GiB RAM; Intel Graphics and NVIDIA RTX 5090 Laptop GPU.

strace diagnostics (29.912 seconds): Insync made 412 calls to statfs("/sys/firmware/efi/efivars", ...). The average duration per call was 66.488 ms (minimum 66.095 ms, maximum 67.332 ms). In total, a single Insync thread spent 27,393.122 ms = 27.393 s = 91.58% of the observation period inside these calls. This is the proportion of time for the calling thread, not the overall system CPU utilization.

Linux has a known issue involving costly firmware requests via efivarfs/QueryVariableInfo() on certain x86 systems (SMM). It is documented as CVE-2026-89604; a kernel fix that rate-limits these requests exists. Similar freezes were previously discussed on the Insync forum.

Working workaround: launch Insync via systemd, with an isolated filesystem replacement visible only to the Insync process:

TemporaryFileSystem=/sys/firmware/efi/efivars:ro,size=1M

Result: desktop lag disappeared, scanning became substantially faster; file creation and modification, uploads to the cloud, and downloads from the cloud were tested, and bidirectional synchronization works.

I ask the developers to investigate the excessive statfs() calls and eliminate them in Insync. Below is my working workaround for users with the same configuration.

Quick installation for Kubuntu (temporary workaround)

Paste the following block in full into a regular Konsole terminal, without adding sudo before bash. Insync must already be installed at /usr/bin/insync. The script automatically identifies the user’s name, UID/GID, and HOME; it does not specify any synchronization folder paths. It does not launch Insync during installation; reboot the computer when installation finishes.

#!/usr/bin/env bash
# EN: Changes only Insync's launch shortcuts and autostart entries. No other apps are modified.
# DE: Ändert nur Insync-Verknüpfungen und dessen Autostart. Andere Apps bleiben unberührt.
# RU: Изменяет только ярлыки и автозапуск Insync. Другие приложения не затрагиваются.
bash <<'INSYNC_INSTALL'
set -e

insync_tmp=$(mktemp -d)
trap 'rm -rf -- "$insync_tmp"' EXIT

# EN: Prepare the Insync launcher with the isolated EFI filesystem replacement.
# DE: Insync-Starter mit isolierter Ersetzung des EFI-Dateisystems vorbereiten.
# RU: Подготовка запускателя Insync с изолированной подстановкой файловой системы EFI.
printf '#!/bin/bash -p\ninsync_uid=%q\ninsync_gid=%q\ninsync_home=%q\ninsync_umask=%q\n' \
    "$(id -u)" "$(id -g)" "$HOME" "$(umask)" >"$insync_tmp/helper"

cat >>"$insync_tmp/helper" <<'INSYNC_RUN'
insync_env=()
while IFS= read -r -d '' insync_item; do
    case "${insync_item%%=*}" in
        HOME|PATH|LANG|LANGUAGE|LC_*|DISPLAY|WAYLAND_DISPLAY|XAUTHORITY|\
        XDG_*|DBUS_SESSION_BUS_ADDRESS|QT_*|KDE_*|XCURSOR_*)
            insync_env+=("--setenv=$insync_item") ;;
    esac
done

exec /usr/bin/env -i PATH=/usr/sbin:/usr/bin:/sbin:/bin \
    /usr/bin/systemd-run --system --collect --quiet \
    --description=Insync --service-type=exec --expand-environment=no \
    --uid="$insync_uid" --gid="$insync_gid" \
    --working-directory="$insync_home" \
    --property="UMask=$insync_umask" \
    --property='TemporaryFileSystem=/sys/firmware/efi/efivars:ro,size=1M' \
    "${insync_env[@]}" -- /usr/bin/insync start --no-daemon
INSYNC_RUN

# EN: Launch Insync silently, without a terminal window or password prompt.
# DE: Insync ohne Terminalfenster und ohne Passwortabfrage starten.
# RU: Тихий запуск Insync без окна терминала и запроса пароля.
cat >"$insync_tmp/launcher" <<'INSYNC_LAUNCHER'
#!/bin/bash
/usr/bin/env -0 | /usr/bin/sudo -n -- /usr/local/libexec/insync-efi-start >/dev/null 2>&1
INSYNC_LAUNCHER

# EN: This installs root-owned helpers and a passwordless sudoers rule for this exact helper.
# DE: Dies installiert root-eigene Hilfsprogramme und eine passwortlose sudoers-Regel dafür.
# RU: Устанавливаются помощники root и правило sudoers для их запуска без пароля.
sudo install -D -o root -g root -m 0755 \
    "$insync_tmp/helper" /usr/local/libexec/insync-efi-start
sudo install -D -o root -g root -m 0755 \
    "$insync_tmp/launcher" /usr/local/bin/insync-efi

printf '%s ALL=(root) NOPASSWD: NOSETENV: /usr/local/libexec/insync-efi-start ""\n' \
    "$(id -un)" >"$insync_tmp/sudoers"
sudo install -o root -g root -m 0440 \
    "$insync_tmp/sudoers" /etc/sudoers.d/insync-efi

insync_config="${XDG_CONFIG_HOME:-$HOME/.config}"
insync_apps="${XDG_DATA_HOME:-$HOME/.local/share}/applications"
mkdir -p "$insync_config/autostart" "$insync_apps"

# EN: Disable ONLY Insync's original autostart entry (insync.desktop).
# DE: NUR den bisherigen Insync-Autostart-Eintrag (insync.desktop) deaktivieren.
# RU: Отключить ТОЛЬКО исходную запись автозапуска Insync (insync.desktop).
cat >"$insync_config/autostart/insync.desktop" <<'INSYNC_DISABLED'
[Desktop Entry]
Type=Application
Name=Insync
Hidden=true
INSYNC_DISABLED

# EN: Create the protected Insync shortcut; retain the Insync name and icon.
# DE: Geschützte Insync-Verknüpfung erstellen; Name und Symbol beibehalten.
# RU: Создать защищённый ярлык Insync с прежними названием и значком.
cat >"$insync_tmp/insync.desktop" <<'INSYNC_DESKTOP'
[Desktop Entry]
Type=Application
Name=Insync
Icon=insync
Categories=Network;
Exec=/usr/local/bin/insync-efi
TryExec=/usr/local/bin/insync-efi
Terminal=false
StartupNotify=false
INSYNC_DESKTOP

cp "$insync_tmp/insync.desktop" "$insync_config/autostart/insync-efi.desktop"
cp "$insync_tmp/insync.desktop" "$insync_apps/insync.desktop"

# EN: Modify ONLY a desktop shortcut named insync.desktop, if it exists.
# DE: NUR eine Desktop-Verknüpfung namens insync.desktop ändern, falls vorhanden.
# RU: Изменить ТОЛЬКО ярлык рабочего стола с именем insync.desktop, если он существует.
find "$(xdg-user-dir DESKTOP)" -maxdepth 1 -type f -iname 'insync.desktop' \
    -exec sed -i \
    's|^Exec=.*|Exec=/usr/local/bin/insync-efi|; s|^TryExec=.*|TryExec=/usr/local/bin/insync-efi|; s|^Terminal=.*|Terminal=false|' \
    {} + 2>/dev/null || true

printf '\nEN: Done. Restart your computer.\nDE: Fertig. Starten Sie Ihren Computer neu.\nRU: Готово. Перезагрузите компьютер.\n'
INSYNC_INSTALL

Shortcut scope: Insync only. The installer changes only Insync’s autostart entries and Insync’s insync.desktop application/desktop shortcuts. Shortcuts and autostart settings for all other applications remain untouched. Existing customizations to these specific Insync shortcuts can be overwritten without a backup.

What changes: the script installs a system launcher, creates a limited sudoers rule, disables the previous Insync autostart entry using Hidden=true, creates a new autostart entry that launches through the wrapper, and overrides the application shortcut in the user’s application menu (~/.local/share/applications/insync.desktop). If an insync.desktop file exists on the desktop, its launch command is modified as well. The Insync name and icon are preserved, and no terminal window appears during normal startup. All synchronization is performed by the original /usr/bin/insync application; no forced switch between Wayland and X11 is configured.

Limitations and security risks: the /etc/sudoers.d/insync-efi rule grants the current user passwordless execution of a specific helper as root — this adds a privileged attack surface. Even though the command is restricted and the files are owned by root, this approach requires a security assessment on each computer. The script overwrites only Insync-related .desktop files without backups, so any custom Insync shortcut settings may be lost; it does not overwrite other applications’ shortcuts. It is designed for Linux with systemd, sudo, xdg-user-dir, and a Debian-style Insync installation layout; it has not been tested on all distributions. Launching /usr/bin/insync directly, bypassing the new shortcuts, does not apply the workaround. This is not an official patch and does not replace a Linux kernel fix. Before running code with administrative privileges, read the script and ensure these changes are acceptable to you.

🇩🇪 Deutsche Version anzeigen

Insync 3.9.11 — Linux-System friert wegen efivarfs/statfs ein: Ursache identifiziert, Workaround bestätigt

Hallo Insync-Team und Forenmitglieder!

Bei jedem Scan nach dem Programmstart (Scanning...) verursachte Insync 3.9.11.60043 starke Aussetzer der gesamten Desktop-Oberfläche. Erst nach Abschluss des Scans reagierte die Benutzeroberfläche wieder normal. Ein Wechsel zu XWayland/XCB allein behob das Problem nicht.

System: Kubuntu 26.04 LTS, KDE Plasma 6.6.6, Wayland, Kernel 7.0.0-38-generic; Intel Core Ultra 9 275HX (24 Kerne), 128 GiB RAM; Intel Graphics und NVIDIA RTX 5090 Laptop GPU.

Diagnose mit strace (29,912 Sekunden): Insync führte 412 Aufrufe von statfs("/sys/firmware/efi/efivars", ...) aus. Die durchschnittliche Dauer pro Aufruf betrug 66,488 ms (Minimum 66,095 ms, Maximum 67,332 ms). Insgesamt verbrachte ein einzelner Insync-Thread 27.393,122 ms = 27,393 s = 91,58 % des Beobachtungszeitraums innerhalb dieser Aufrufe. Dieser Anteil bezieht sich auf die Zeit des aufrufenden Threads, nicht auf die CPU-Auslastung des Gesamtsystems.

Unter Linux gibt es ein bekanntes Problem mit aufwendigen Firmware-Abfragen über efivarfs/QueryVariableInfo() auf bestimmten x86-Systemen (SMM). Es ist als CVE-2026-89604 dokumentiert; ein Kernel-Fix, der die Häufigkeit dieser Anfragen begrenzt, ist vorhanden. Ähnliche Aussetzer wurden bereits im Insync-Forum diskutiert.

Funktionierender Workaround: Insync wird über systemd gestartet, wobei nur für den Insync-Prozess eine isolierte Ersatz-Dateisystemeinbindung sichtbar ist:

TemporaryFileSystem=/sys/firmware/efi/efivars:ro,size=1M

Ergebnis: Die Verzögerungen des Desktops verschwanden vollständig, und das Scannen wurde deutlich schneller. Das Erstellen und Ändern von Dateien sowie das Hoch- und Herunterladen aus der Cloud wurden getestet; die bidirektionale Synchronisierung funktioniert.

Ich bitte die Entwickler, die übermäßig häufigen statfs()-Aufrufe zu untersuchen und ihre Ursache direkt in Insync zu beseitigen. Nachfolgend stelle ich meinen funktionierenden Workaround für Benutzer mit derselben Konfiguration bereit.

Schnellinstallation für Kubuntu (vorübergehender Workaround)

Den folgenden Block vollständig in ein normales Konsole-Terminal einfügen, ohne sudo vor bash zu setzen. Insync muss bereits unter /usr/bin/insync installiert sein. Das Skript ermittelt Benutzername, UID/GID und HOME automatisch; es enthält keine festen Pfade zu Synchronisierungsordnern. Während der Installation wird Insync nicht gestartet; nach Abschluss der Installation den Computer neu starten.

#!/usr/bin/env bash
# EN: Changes only Insync's launch shortcuts and autostart entries. No other apps are modified.
# DE: Ändert nur Insync-Verknüpfungen und dessen Autostart. Andere Apps bleiben unberührt.
# RU: Изменяет только ярлыки и автозапуск Insync. Другие приложения не затрагиваются.
bash <<'INSYNC_INSTALL'
set -e

insync_tmp=$(mktemp -d)
trap 'rm -rf -- "$insync_tmp"' EXIT

# EN: Prepare the Insync launcher with the isolated EFI filesystem replacement.
# DE: Insync-Starter mit isolierter Ersetzung des EFI-Dateisystems vorbereiten.
# RU: Подготовка запускателя Insync с изолированной подстановкой файловой системы EFI.
printf '#!/bin/bash -p\ninsync_uid=%q\ninsync_gid=%q\ninsync_home=%q\ninsync_umask=%q\n' \
    "$(id -u)" "$(id -g)" "$HOME" "$(umask)" >"$insync_tmp/helper"

cat >>"$insync_tmp/helper" <<'INSYNC_RUN'
insync_env=()
while IFS= read -r -d '' insync_item; do
    case "${insync_item%%=*}" in
        HOME|PATH|LANG|LANGUAGE|LC_*|DISPLAY|WAYLAND_DISPLAY|XAUTHORITY|\
        XDG_*|DBUS_SESSION_BUS_ADDRESS|QT_*|KDE_*|XCURSOR_*)
            insync_env+=("--setenv=$insync_item") ;;
    esac
done

exec /usr/bin/env -i PATH=/usr/sbin:/usr/bin:/sbin:/bin \
    /usr/bin/systemd-run --system --collect --quiet \
    --description=Insync --service-type=exec --expand-environment=no \
    --uid="$insync_uid" --gid="$insync_gid" \
    --working-directory="$insync_home" \
    --property="UMask=$insync_umask" \
    --property='TemporaryFileSystem=/sys/firmware/efi/efivars:ro,size=1M' \
    "${insync_env[@]}" -- /usr/bin/insync start --no-daemon
INSYNC_RUN

# EN: Launch Insync silently, without a terminal window or password prompt.
# DE: Insync ohne Terminalfenster und ohne Passwortabfrage starten.
# RU: Тихий запуск Insync без окна терминала и запроса пароля.
cat >"$insync_tmp/launcher" <<'INSYNC_LAUNCHER'
#!/bin/bash
/usr/bin/env -0 | /usr/bin/sudo -n -- /usr/local/libexec/insync-efi-start >/dev/null 2>&1
INSYNC_LAUNCHER

# EN: This installs root-owned helpers and a passwordless sudoers rule for this exact helper.
# DE: Dies installiert root-eigene Hilfsprogramme und eine passwortlose sudoers-Regel dafür.
# RU: Устанавливаются помощники root и правило sudoers для их запуска без пароля.
sudo install -D -o root -g root -m 0755 \
    "$insync_tmp/helper" /usr/local/libexec/insync-efi-start
sudo install -D -o root -g root -m 0755 \
    "$insync_tmp/launcher" /usr/local/bin/insync-efi

printf '%s ALL=(root) NOPASSWD: NOSETENV: /usr/local/libexec/insync-efi-start ""\n' \
    "$(id -un)" >"$insync_tmp/sudoers"
sudo install -o root -g root -m 0440 \
    "$insync_tmp/sudoers" /etc/sudoers.d/insync-efi

insync_config="${XDG_CONFIG_HOME:-$HOME/.config}"
insync_apps="${XDG_DATA_HOME:-$HOME/.local/share}/applications"
mkdir -p "$insync_config/autostart" "$insync_apps"

# EN: Disable ONLY Insync's original autostart entry (insync.desktop).
# DE: NUR den bisherigen Insync-Autostart-Eintrag (insync.desktop) deaktivieren.
# RU: Отключить ТОЛЬКО исходную запись автозапуска Insync (insync.desktop).
cat >"$insync_config/autostart/insync.desktop" <<'INSYNC_DISABLED'
[Desktop Entry]
Type=Application
Name=Insync
Hidden=true
INSYNC_DISABLED

# EN: Create the protected Insync shortcut; retain the Insync name and icon.
# DE: Geschützte Insync-Verknüpfung erstellen; Name und Symbol beibehalten.
# RU: Создать защищённый ярлык Insync с прежними названием и значком.
cat >"$insync_tmp/insync.desktop" <<'INSYNC_DESKTOP'
[Desktop Entry]
Type=Application
Name=Insync
Icon=insync
Categories=Network;
Exec=/usr/local/bin/insync-efi
TryExec=/usr/local/bin/insync-efi
Terminal=false
StartupNotify=false
INSYNC_DESKTOP

cp "$insync_tmp/insync.desktop" "$insync_config/autostart/insync-efi.desktop"
cp "$insync_tmp/insync.desktop" "$insync_apps/insync.desktop"

# EN: Modify ONLY a desktop shortcut named insync.desktop, if it exists.
# DE: NUR eine Desktop-Verknüpfung namens insync.desktop ändern, falls vorhanden.
# RU: Изменить ТОЛЬКО ярлык рабочего стола с именем insync.desktop, если он существует.
find "$(xdg-user-dir DESKTOP)" -maxdepth 1 -type f -iname 'insync.desktop' \
    -exec sed -i \
    's|^Exec=.*|Exec=/usr/local/bin/insync-efi|; s|^TryExec=.*|TryExec=/usr/local/bin/insync-efi|; s|^Terminal=.*|Terminal=false|' \
    {} + 2>/dev/null || true

printf '\nEN: Done. Restart your computer.\nDE: Fertig. Starten Sie Ihren Computer neu.\nRU: Готово. Перезагрузите компьютер.\n'
INSYNC_INSTALL

Geltungsbereich der Verknüpfungen: ausschließlich Insync. Das Installationsskript ändert nur die Insync-Autostart-Einträge und die insync.desktop-Verknüpfungen von Insync im Anwendungsmenü bzw. auf dem Desktop. Verknüpfungen und Autostart-Einstellungen aller anderen Anwendungen bleiben unverändert. Individuelle Anpassungen dieser Insync-Verknüpfungen können ohne Sicherungskopie überschrieben werden.

Was wird geändert? Das Skript installiert einen systemweiten Starter, legt eine eingeschränkte sudoers-Regel an, deaktiviert den bisherigen Insync-Autostart-Eintrag mittels Hidden=true, erstellt einen neuen Autostart-Eintrag für den Aufruf über den Wrapper und überschreibt die Anwendungsverknüpfung im Benutzermenü (~/.local/share/applications/insync.desktop). Falls auf dem Desktop eine Datei insync.desktop vorhanden ist, wird auch deren Startbefehl angepasst. Name und Symbol von Insync bleiben erhalten; beim normalen Start öffnet sich kein Terminalfenster. Die Synchronisierung übernimmt weiterhin die originale Anwendung /usr/bin/insync. Es wird kein Wechsel zwischen Wayland und X11 erzwungen.

Einschränkungen und Sicherheitsrisiken: Die Regel /etc/sudoers.d/insync-efi erlaubt dem aktuellen Benutzer, einen bestimmten Hilfsprozess ohne Passwort mit Root-Rechten auszuführen. Dadurch entsteht eine zusätzliche privilegierte Angriffsfläche. Auch wenn der Befehl eingeschränkt ist und die Dateien root gehören, muss dieses Vorgehen auf jedem Computer hinsichtlich der Sicherheit bewertet werden. Das Skript überschreibt ausschließlich zu Insync gehörende .desktop-Dateien ohne Sicherungskopien; individuelle Insync-Verknüpfungseinstellungen können verloren gehen. Verknüpfungen anderer Anwendungen werden nicht überschrieben. Es ist für Linux mit systemd, sudo, xdg-user-dir und einer Insync-Installation mit Debian-typischem Dateiaufbau ausgelegt; es wurde nicht auf allen Distributionen getestet. Wird /usr/bin/insync direkt gestartet und werden die neuen Verknüpfungen umgangen, greift der Workaround nicht. Dies ist kein offizieller Patch und kein Ersatz für eine Korrektur im Linux-Kernel. Vor dem Ausführen von Code mit Administratorrechten das Skript lesen und prüfen, ob diese Änderungen akzeptabel sind.

🇷🇺 Показать русскую версию

Insync 3.9.11 — зависания Linux из-за efivarfs/statfs: причина установлена, обход работает

Здравствуйте, команда Insync и пользователи форума!

Во время каждого стартового сканирования (Scanning...) Insync 3.9.11.60043 вызывал сильные зависания всего рабочего стола. После завершения сканирования отзывчивость возвращалась. Переключение только на XWayland/XCB проблему не устранило.

Система: Kubuntu 26.04 LTS, KDE Plasma 6.6.6, Wayland, ядро 7.0.0-38-generic; Intel Core Ultra 9 275HX (24 ядра), 128 ГиБ RAM; Intel Graphics и NVIDIA RTX 5090 Laptop GPU.

Диагностика strace (29,912 секунды): Insync выполнил 412 вызовов statfs("/sys/firmware/efi/efivars", ...). Средняя длительность одного вызова — 66,488 мс (минимум 66,095, максимум 67,332 мс). Суммарно 27 393,122 мс = 27,393 с = 91,58% времени наблюдения один поток Insync провёл внутри этих вызовов. Это доля времени вызывающего потока, а не загрузка CPU всей системы.

В Linux известен механизм дорогостоящих запросов к прошивке через efivarfs/QueryVariableInfo() на некоторых x86-системах (SMM). Документирован как CVE-2026-89604; существует исправление ядра с ограничением частоты запросов. Аналогичные зависания обсуждались ранее на форуме Insync.

Рабочий обход: запуск Insync через systemd с отдельной подстановкой только для процесса Insync:

TemporaryFileSystem=/sys/firmware/efi/efivars:ro,size=1M

Результат: задержки интерфейса исчезли, сканирование стало существенно быстрее; создание и изменение файлов, загрузка в облако и скачивание из облака проверены, двусторонняя синхронизация работает.

Прошу разработчиков исследовать избыточные вызовы statfs() и устранить их в Insync. Ниже — мой рабочий обход для пользователей той же конфигурации.

Быстрая установка для Kubuntu (временный обход)

Вставьте следующий блок целиком в обычную Konsole, не добавляя sudo перед bash. Программа Insync уже должна быть установлена в /usr/bin/insync. Скрипт сам определяет имя, UID/GID и HOME пользователя; пути к папкам синхронизации не задаёт. Запуск во время установки не выполняет; после завершения перезагрузите компьютер.

#!/usr/bin/env bash
# EN: Changes only Insync's launch shortcuts and autostart entries. No other apps are modified.
# DE: Ändert nur Insync-Verknüpfungen und dessen Autostart. Andere Apps bleiben unberührt.
# RU: Изменяет только ярлыки и автозапуск Insync. Другие приложения не затрагиваются.
bash <<'INSYNC_INSTALL'
set -e

insync_tmp=$(mktemp -d)
trap 'rm -rf -- "$insync_tmp"' EXIT

# EN: Prepare the Insync launcher with the isolated EFI filesystem replacement.
# DE: Insync-Starter mit isolierter Ersetzung des EFI-Dateisystems vorbereiten.
# RU: Подготовка запускателя Insync с изолированной подстановкой файловой системы EFI.
printf '#!/bin/bash -p\ninsync_uid=%q\ninsync_gid=%q\ninsync_home=%q\ninsync_umask=%q\n' \
    "$(id -u)" "$(id -g)" "$HOME" "$(umask)" >"$insync_tmp/helper"

cat >>"$insync_tmp/helper" <<'INSYNC_RUN'
insync_env=()
while IFS= read -r -d '' insync_item; do
    case "${insync_item%%=*}" in
        HOME|PATH|LANG|LANGUAGE|LC_*|DISPLAY|WAYLAND_DISPLAY|XAUTHORITY|\
        XDG_*|DBUS_SESSION_BUS_ADDRESS|QT_*|KDE_*|XCURSOR_*)
            insync_env+=("--setenv=$insync_item") ;;
    esac
done

exec /usr/bin/env -i PATH=/usr/sbin:/usr/bin:/sbin:/bin \
    /usr/bin/systemd-run --system --collect --quiet \
    --description=Insync --service-type=exec --expand-environment=no \
    --uid="$insync_uid" --gid="$insync_gid" \
    --working-directory="$insync_home" \
    --property="UMask=$insync_umask" \
    --property='TemporaryFileSystem=/sys/firmware/efi/efivars:ro,size=1M' \
    "${insync_env[@]}" -- /usr/bin/insync start --no-daemon
INSYNC_RUN

# EN: Launch Insync silently, without a terminal window or password prompt.
# DE: Insync ohne Terminalfenster und ohne Passwortabfrage starten.
# RU: Тихий запуск Insync без окна терминала и запроса пароля.
cat >"$insync_tmp/launcher" <<'INSYNC_LAUNCHER'
#!/bin/bash
/usr/bin/env -0 | /usr/bin/sudo -n -- /usr/local/libexec/insync-efi-start >/dev/null 2>&1
INSYNC_LAUNCHER

# EN: This installs root-owned helpers and a passwordless sudoers rule for this exact helper.
# DE: Dies installiert root-eigene Hilfsprogramme und eine passwortlose sudoers-Regel dafür.
# RU: Устанавливаются помощники root и правило sudoers для их запуска без пароля.
sudo install -D -o root -g root -m 0755 \
    "$insync_tmp/helper" /usr/local/libexec/insync-efi-start
sudo install -D -o root -g root -m 0755 \
    "$insync_tmp/launcher" /usr/local/bin/insync-efi

printf '%s ALL=(root) NOPASSWD: NOSETENV: /usr/local/libexec/insync-efi-start ""\n' \
    "$(id -un)" >"$insync_tmp/sudoers"
sudo install -o root -g root -m 0440 \
    "$insync_tmp/sudoers" /etc/sudoers.d/insync-efi

insync_config="${XDG_CONFIG_HOME:-$HOME/.config}"
insync_apps="${XDG_DATA_HOME:-$HOME/.local/share}/applications"
mkdir -p "$insync_config/autostart" "$insync_apps"

# EN: Disable ONLY Insync's original autostart entry (insync.desktop).
# DE: NUR den bisherigen Insync-Autostart-Eintrag (insync.desktop) deaktivieren.
# RU: Отключить ТОЛЬКО исходную запись автозапуска Insync (insync.desktop).
cat >"$insync_config/autostart/insync.desktop" <<'INSYNC_DISABLED'
[Desktop Entry]
Type=Application
Name=Insync
Hidden=true
INSYNC_DISABLED

# EN: Create the protected Insync shortcut; retain the Insync name and icon.
# DE: Geschützte Insync-Verknüpfung erstellen; Name und Symbol beibehalten.
# RU: Создать защищённый ярлык Insync с прежними названием и значком.
cat >"$insync_tmp/insync.desktop" <<'INSYNC_DESKTOP'
[Desktop Entry]
Type=Application
Name=Insync
Icon=insync
Categories=Network;
Exec=/usr/local/bin/insync-efi
TryExec=/usr/local/bin/insync-efi
Terminal=false
StartupNotify=false
INSYNC_DESKTOP

cp "$insync_tmp/insync.desktop" "$insync_config/autostart/insync-efi.desktop"
cp "$insync_tmp/insync.desktop" "$insync_apps/insync.desktop"

# EN: Modify ONLY a desktop shortcut named insync.desktop, if it exists.
# DE: NUR eine Desktop-Verknüpfung namens insync.desktop ändern, falls vorhanden.
# RU: Изменить ТОЛЬКО ярлык рабочего стола с именем insync.desktop, если он существует.
find "$(xdg-user-dir DESKTOP)" -maxdepth 1 -type f -iname 'insync.desktop' \
    -exec sed -i \
    's|^Exec=.*|Exec=/usr/local/bin/insync-efi|; s|^TryExec=.*|TryExec=/usr/local/bin/insync-efi|; s|^Terminal=.*|Terminal=false|' \
    {} + 2>/dev/null || true

printf '\nEN: Done. Restart your computer.\nDE: Fertig. Starten Sie Ihren Computer neu.\nRU: Готово. Перезагрузите компьютер.\n'
INSYNC_INSTALL

Область изменений ярлыков — только Insync. Установщик меняет исключительно записи автозапуска Insync и принадлежащие ему ярлыки insync.desktop в меню приложений или на рабочем столе. Ярлыки и автозапуск любых других программ не затрагиваются. Индивидуальные настройки именно этих ярлыков Insync могут быть перезаписаны без резервной копии.

Что изменяется: скрипт устанавливает системный запускатель, создаёт ограниченное правило sudoers, выключает прежнюю запись автозапуска Insync через Hidden=true, создаёт новую запись автозапуска с запуском через обёртку, а также перекрывает ярлык приложения в пользовательском меню (~/.local/share/applications/insync.desktop). Если есть файл insync.desktop на рабочем столе, его команда запуска тоже меняется. Имя и иконка Insync сохраняются, терминальное окно при обычном запуске не появляется. Вся синхронизация выполняется оригинальной программой /usr/bin/insync; принудительное переключение между Wayland и X11 не задаётся.

Ограничения и риски безопасности: правило /etc/sudoers.d/insync-efi предоставляет текущему пользователю беспарольный запуск конкретного root-помощника — это дополнительная привилегированная поверхность атаки. Несмотря на ограничение команды и владение файлами со стороны root, такое решение требует оценки безопасности на каждом компьютере. Скрипт перезаписывает без резервных копий только файлы .desktop, относящиеся к Insync; могут потеряться индивидуальные настройки именно его ярлыков. Ярлыки других приложений не перезаписываются. Он рассчитан на Linux с systemd, sudo, xdg-user-dir и Debian-подобной компоновкой Insync; не проверен для всех дистрибутивов. Прямой запуск /usr/bin/insync, минуя новые ярлыки, обход не применяет. Это не официальный патч и не замена исправлению ядра Linux. Перед запуском с правами администратора изучите код и убедитесь, что такие изменения приемлемы.

@REXED I’m very sorry for not seeing this post sooner! It looks like the system automatically flagged it and hid it from the list :frowning:

Thank you SO much for sharing this detailed report, including the workaround! Let me send this to our engineers so we can include the necessary fixes in an upcoming version :slight_smile: If you need anything else, just reply below!

1 Like

Hi! I had exactly the same issues on my HP ProBook 470 G7 running NixOS 26.05 with Insync version 3.9.8.60034 from the OS repository. My laptop has 16 GB of RAM, an Intel graphics card, a discrete AMD graphics card, and the XFCE (X11) desktop environment.

In my case, Insync syncs with our corporate GWS - 26,500 files, including 4,000 folders on an ext4 fs. The synchronization process and the resulting slowdown took 4.5 minutes after every time I launched Insync. All the symptoms matched those described here and in the thread the author of the post additionally references (a thread from 2024).

However, the day before yesterday I needed to reinstall the OS (without changing the hardware). The reinstallation was performed using the same nix-files, meaning the OS and other software were installed exactly as in the previous installation (this is a well-known feature of NixOS).

As a result, it turned out that Insync, for some reason, had stopped slowing down my system, and now the initial synchronization process takes 1 minute.

I had my AI agent review these discussion threads. It agreed with @REXED’s (temporary) solution, adding that it doesn’t understand why a proprietary synchronization client would need to know about motherboard firmware variables.

I’ll add that when I previously asked my AI agent to find a solution on its own, it couldn’t come up with anything better than changing the I/O policy (which didn’t help).

Summary: My problem was “solved” by accident, for reasons unknown. I’m afraid that if any changes are made to my “laptop-OS-software” system, the problem will return. I ask the manufacturer to resolve this long-standing issue once and for all.

Thanks

2 Likes

This works!
Thank you so much!

For all you NixOS users out there, in your home.nix (using home-manager):


+  # Run Insync with an empty tmpfs over efivars, to avoid the slow statfs() calls
+  # See https://forums.insynchq.com/t/insync-3-9-11-linux-freezes-root-cause-identified-workaround-confirmed/37355 and https://forums.insynchq.com/t/insync-slows-down-my-quite-fast-machine-almost-to-a-halt-lags-freezes/19638
+  systemd.user.services.insync = {
+    Unit = {
+      Description = "Insync (efivars hidden to avoid statfs freezes)";
+      After = [ "graphical-session.target" ];
+      PartOf = [ "graphical-session.target" ];
+    };
+    Service = {
+      Type = "oneshot";
+      RemainAfterExit = true;
+      ExecStart = "${pkgs.insync}/bin/insync start";
+      ExecStop = "${pkgs.insync}/bin/insync quit";
+      TemporaryFileSystem = "/sys/firmware/efi/efivars:ro,size=1M";
+    };
+    Install = {
+      WantedBy = [ "graphical-session.target" ];
+    };
+  };
+

IMPORTANT: disable auto-start from KDE’s Auto start settings or the app’s built-in settings, to avoid two instances from being started.

This systemd (user) service already launches one whenever the graphical session is started.

3 Likes