Skip to content

Commit 26f6b92

Browse files
committed
šŸ› fix: fix: resolve session loop and keyboard layout issues in live session
startbiglive: - Add exec to all session starters to prevent fallthrough to systemctl restart, which caused an infinite login loop when cinnamon-session crashed due to D-Bus not being ready - Add _wait_for_user_session() to wait up to 60s for user manager and D-Bus session bus before launching desktop session - Guard language exports with file existence check services.py: - Restart/stop jamesdsp-autostart.service via systemctl --user when enabling/disabling JamesDSP, fixing the service not starting because it was stuck in failed state from earlier crash loops
1 parent 61b5914 commit 26f6b92

3 files changed

Lines changed: 59 additions & 15 deletions

File tree

ā€Žbiglinux-livecd/usr/bin/startbigliveā€Ž

Lines changed: 38 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,14 @@ wait
113113
#-------------------------------------------------------------------------------
114114
# Apply language and locale settings from user selection
115115
#-------------------------------------------------------------------------------
116-
export LANGUAGE=$(</tmp/big_language).UTF-8
117-
export LANG=$(</tmp/big_language).UTF-8
118-
export LC_MESSAGES=$(</tmp/big_language).UTF-8
119-
export LC_ALL=$(</tmp/big_language).UTF-8
120-
echo "$(</tmp/big_language)" > "$HOME/.config/user-dirs.locale"
121-
echo -e "[Formats]\nLANG=$(</tmp/big_language).UTF-8" > "$HOME/.config/plasma-localerc"
116+
if [[ -f /tmp/big_language ]]; then
117+
export LANGUAGE=$(</tmp/big_language).UTF-8
118+
export LANG=$(</tmp/big_language).UTF-8
119+
export LC_MESSAGES=$(</tmp/big_language).UTF-8
120+
export LC_ALL=$(</tmp/big_language).UTF-8
121+
echo "$(</tmp/big_language)" > "$HOME/.config/user-dirs.locale"
122+
echo -e "[Formats]\nLANG=$(</tmp/big_language).UTF-8" > "$HOME/.config/plasma-localerc"
123+
fi
122124

123125
#-------------------------------------------------------------------------------
124126
# Create user directories and installer shortcut on desktop
@@ -130,30 +132,52 @@ chmod +x "$XDG_DESKTOP_DIR/calamares-biglinux.desktop"
130132

131133
cd ~
132134

135+
#-------------------------------------------------------------------------------
136+
# Wait for user manager and D-Bus session bus to be ready
137+
# This prevents cinnamon-session/gnome-session from crashing due to missing D-Bus
138+
#-------------------------------------------------------------------------------
139+
_wait_for_user_session() {
140+
local max_wait=60
141+
local count=0
142+
while [[ $count -lt $max_wait ]]; do
143+
if systemctl --user is-active default.target &>/dev/null 2>&1; then
144+
break
145+
fi
146+
sleep 1
147+
((count++))
148+
done
149+
if [[ $count -ge $max_wait ]]; then
150+
logger "startbiglive: WARNING - user session not ready after ${max_wait}s, proceeding anyway"
151+
fi
152+
}
153+
154+
_wait_for_user_session
155+
133156
#-------------------------------------------------------------------------------
134157
# Start appropriate desktop session based on detected environment
158+
# Using exec to prevent fallthrough to systemctl restart
135159
#-------------------------------------------------------------------------------
136160

137161
# BigCommunity Core: Launch Calamares directly
138162
if grep -iq 'BigCommunity-Core.iso' /proc/cmdline; then
139-
sudo calamares_polkit
163+
exec sudo calamares_polkit
140164

141165
elif [[ "$display_manager" == "gdm" ]]; then
142166
# GNOME: Clean up and start gnome-session
143167
rm -f "$HOME/Empty Bash" "$HOME/Empty Desktop File.desktop" "$HOME/Empty File"
144168
xdg-user-dirs-update
145-
startgnome-community
169+
exec startgnome-community
146170

147171
elif [[ -e /usr/share/wayland-sessions/hyprland.desktop ]]; then
148172
# Hyprland detected
149-
Hyprland
173+
exec Hyprland
150174

151175
elif [[ "$display_manager" == "sddm" || "$display_manager" == "lxdm" ]]; then
152176
# KDE Plasma
153177
if [[ "$XDG_SESSION_TYPE" == "x11" ]]; then
154-
startkde-biglinux
178+
exec startkde-biglinux
155179
else
156-
startkde-biglinux wayland
180+
exec startkde-biglinux wayland
157181
fi
158182

159183
elif [[ -e /usr/share/xsessions/xfce.desktop ]]; then
@@ -163,14 +187,14 @@ elif [[ -e /usr/share/xsessions/xfce.desktop ]]; then
163187
export XDG_SESSION_DESKTOP=xfce
164188
export GDMSESSION=xfce
165189
export XDG_CURRENT_DESKTOP=XFCE
166-
startxfce4
190+
exec startxfce4
167191

168192
elif [[ -e /usr/bin/startcinnamon-community ]]; then
169193
# Cinnamon: Clean up and start cinnamon-session
170194
rm -f "$HOME/Empty Bash" "$HOME/Empty Desktop File.desktop" "$HOME/Empty File"
171195
xdg-user-dirs-update
172-
startcinnamon-community
196+
exec startcinnamon-community
173197
fi
174198

175-
# Restart display manager to apply changes
199+
# Fallback: restart display manager only if no session starter was found
176200
sudo systemctl restart "$display_manager"

ā€Žbiglinux-livecd/usr/share/biglinux/calamares/src/utils/constants.pyā€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# Application Information
1010
APP_NAME = "BigLinux Calamares Config"
1111
APP_ID = "com.biglinux.calamares-config"
12-
APP_VERSION = "1.0.12"
12+
APP_VERSION = "1.0.13"
1313

1414
# Paths and Directories
1515
BASE_DIR = Path(__file__).parent.parent.parent

ā€Žbiglinux-livecd/usr/share/biglinux/livecd/services.pyā€Ž

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,11 @@ def finalize_setup(self, config: SetupConfig):
487487
],
488488
as_root=False,
489489
)
490+
# Restart the systemd service so JamesDSP actually starts
491+
self._run_command(
492+
["systemctl", "--user", "restart", "jamesdsp-autostart.service"],
493+
as_root=False,
494+
)
490495
else:
491496
logger.info("JamesDSP not enabled, removing flag file if it exists.")
492497
self._run_command(["rm", "-f", self.tmp_jamesdsp_file], as_root=False)
@@ -502,6 +507,11 @@ def finalize_setup(self, config: SetupConfig):
502507
],
503508
as_root=False,
504509
)
510+
# Stop the systemd service so JamesDSP actually stops
511+
self._run_command(
512+
["systemctl", "--user", "stop", "jamesdsp-autostart.service"],
513+
as_root=False,
514+
)
505515

506516
# Display profile/ICC configuration - save flag to /tmp
507517
if config.enable_enhanced_contrast:
@@ -552,6 +562,11 @@ def apply_jamesdsp_settings(self, enabled: bool):
552562
],
553563
as_root=False,
554564
)
565+
# Restart the systemd service so JamesDSP actually starts
566+
self._run_command(
567+
["systemctl", "--user", "restart", "jamesdsp-autostart.service"],
568+
as_root=False,
569+
)
555570
else:
556571
logger.info("Applying JamesDSP disabled settings...")
557572
self._run_command(["rm", "-f", self.tmp_jamesdsp_file], as_root=False)
@@ -565,6 +580,11 @@ def apply_jamesdsp_settings(self, enabled: bool):
565580
],
566581
as_root=False,
567582
)
583+
# Stop the systemd service so JamesDSP actually stops
584+
self._run_command(
585+
["systemctl", "--user", "stop", "jamesdsp-autostart.service"],
586+
as_root=False,
587+
)
568588

569589
def apply_icc_profile_settings(self, enabled: bool):
570590
"""

0 commit comments

Comments
Ā (0)