Skip to content

Commit

Permalink
waylandloginmanager: delay before killing journalctl to allow it to c…
Browse files Browse the repository at this point in the history
…atch up with logging

git-svn-id: https://svn.code.sf.net/p/rebeccablackos/code@7907 b52b6941-3400-464c-9f42-43200397181c
  • Loading branch information
nerdopolis committed Jan 15, 2023
1 parent 5a1a210 commit d1bd641
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 74 deletions.
1 change: 1 addition & 0 deletions rebeccablackos_files/usr/bin/waylandloginmanager
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ function UserSessionWorker

#Write the error code into the logfile
echo -e "\nSession exited with the error code: $SessionReturnCode" >> $WLM_SESSION_LOG
$SLEEPCMD 1
TerminateJobPID $JournalctlPID 15 0
exit
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--- usr/bin/waylandloginmanager 2023-01-03 18:18:35.501548071 -0500
+++ usr/bin/waylandloginmanagerkdialog 2023-01-03 18:19:27.106243984 -0500
--- usr/bin/waylandloginmanager 2023-01-14 21:11:45.075689102 -0500
+++ usr/bin/waylandloginmanagerkdialog 2023-01-14 21:13:48.888567057 -0500
@@ -18,9 +18,9 @@

#This script is the WaylandLoginManager it handles a graphical login for the user, and allows the user to start multiple types of Wayland sessions, specified in wsession files, and it supports autologin, and user switching. It supports watching the active session until it fails, so that it swiches back to the needed TTY for the user.
Expand All @@ -12,7 +12,7 @@

#User sessions can have /etc/wlprofile or ~/.local/wlprofile (similar to xprofile only for Wayland)

@@ -708,7 +708,7 @@
@@ -709,7 +709,7 @@
export MAX_UI_ATTEMPTS=5
######################################################

Expand All @@ -21,7 +21,7 @@
export LOGINMANAGERDISPLAYUSER=waylandloginmanager
#User that reads from the loginmanager_control socket, and filters the command sent to it to loginmanager_listener FIFO
export FIFOREADERUSER=waylandloginmanager
@@ -845,7 +845,8 @@
@@ -846,7 +846,8 @@
export DEB_HOST_MULTIARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH 2>/dev/null)
export LD_LIBRARY_PATH=/opt/lib/$DEB_HOST_MULTIARCH:/opt/lib:/usr/local/lib/$DEB_HOST_MULTIARCH:/usr/lib/$DEB_HOST_MULTIARCH:/usr/local/lib:/usr/lib
export XDG_DATA_DIRS=/opt/share:/usr/share
Expand All @@ -31,7 +31,7 @@
#Set the default path for weston
export DEFAULTWAYLANDSERVER=$(which weston)
#Specify where wsession files are found
@@ -873,7 +874,7 @@
@@ -874,7 +875,7 @@
#Determine if this is running on a live instance, if booted with casper
GetConfigKey wlmlivemode "" 0 0 LiveCDMode

Expand All @@ -40,7 +40,7 @@
TERMINALCMD="runuser -u $LOGINMANAGERDISPLAYUSER -m -- vte"
WAYLANDINFOCMD="runuser -u $LOGINMANAGERDISPLAYUSER -m -- wayland-info"
if [[ $seat0HasTTYs == 1 ]]
@@ -885,8 +886,8 @@
@@ -886,8 +887,8 @@
TTYWIZARDCMD=true
fi

Expand All @@ -51,7 +51,7 @@

#Detect hardware abilities, first try to see if the system has kernel mode setting, then try framebuffer. if both aren't supported, bring up a text mode dialog
GetConfigKey wlmforcefbdev "" 0 1 wlmforcefbdev
@@ -1207,23 +1208,14 @@
@@ -1208,23 +1209,14 @@
done
}

Expand All @@ -77,7 +77,7 @@
}

#This function takes 1 argument, the seat that the loginmanagerdisplay belongs to, and waits for the loginmanagerdisplay to startup
@@ -1926,7 +1918,7 @@
@@ -1927,7 +1919,7 @@
done
if [[ $WSESSIONNUMBER == -1 ]]
then
Expand All @@ -86,7 +86,7 @@
WriteToLog "$DEFAULTWSESSION set as default session for $SessionUser, but was not found in $WSESSIONSPATHS, configured correctly, or supported by the hardware in this seat, $CurrentHandleSeat ."
return 1
fi
@@ -1937,17 +1929,33 @@
@@ -1938,17 +1930,33 @@
WSESSIONPICKLIST=""
for (( element=0; element<$WSESSIONCOUNT; element++ ))
do
Expand Down Expand Up @@ -124,7 +124,7 @@
CancelOrOK=$?
if [[ $CancelOrOK != 0 ]]
then
@@ -1963,7 +1971,7 @@
@@ -1964,7 +1972,7 @@
else
unset WSESSIONDATA
unset WSESSIONNUMBER
Expand All @@ -133,7 +133,7 @@
WriteToLog "No sessions are installed in $WSESSIONSPATHS, configured correctly, or supported by the hardware in this seat, $CurrentHandleSeat ."
return 1
fi
@@ -2015,7 +2023,7 @@
@@ -2016,7 +2024,7 @@

This is the optimal way to run Weston or other Wayland servers."
fi
Expand All @@ -142,7 +142,7 @@

$BACKENDSTRING

@@ -2043,15 +2051,17 @@
@@ -2044,15 +2052,17 @@
((NumberOfSessions--))

#go thorugh each session, reading the arrays containing information about the sessions. to build the SessionList variable
Expand All @@ -166,7 +166,7 @@
#determine if the current session is alive, before adding it to the list
SessionisRunning=0
for RunningSeatSession in "${RunningSeatSessions[@]}"
@@ -2071,11 +2081,7 @@
@@ -2072,11 +2082,7 @@
then
SessionList+=$'\n'
fi
Expand All @@ -179,7 +179,7 @@
fi
fi
((NumberOfSessions--))
@@ -2086,19 +2092,17 @@
@@ -2087,19 +2093,17 @@
SessionList+=$'\n'
fi
SessionList+="-1"$'\n'
Expand All @@ -205,7 +205,7 @@
if [[ $CancelOrOK != 0 ]]
then
exit 0
@@ -2127,7 +2131,7 @@
@@ -2128,7 +2132,7 @@
#hand over the logind session ID to allow desktop permissions to work.
loginctl activate $ChangeSessionID &>/dev/null
else
Expand All @@ -214,7 +214,7 @@
fi
fi
fi
@@ -2385,26 +2389,30 @@
@@ -2386,26 +2390,30 @@
then
UserDisplayName=$UserName
fi
Expand Down Expand Up @@ -253,7 +253,7 @@
if [[ $CancelOrOK != 0 ]]
then
exit 0
@@ -2412,9 +2420,9 @@
@@ -2413,9 +2421,9 @@
#if there is no user selected or if the LOGINUSER is -1, as in the user opted to enter a username manually prompt for the username with a text dialog
if [[ -z $LOGINUSER || $LOGINUSER == -1 ]]
then
Expand All @@ -265,7 +265,7 @@
if [[ $CancelOrOK != 0 ]]
then
exit 0
@@ -2445,9 +2453,9 @@
@@ -2446,9 +2454,9 @@
passwordresult=0
else
#Prompt for the users password
Expand All @@ -277,7 +277,7 @@
if [[ $CancelOrOK != 0 ]]
then
exit 0
@@ -2461,7 +2469,7 @@
@@ -2462,7 +2470,7 @@
fi
if [[ $passwordresult != 0 ]]
then
Expand All @@ -286,7 +286,7 @@
WriteToLog "Invalid password for $LOGINUSER, or username invalid"
else
export USERHOME=$(eval echo ~$LOGINUSER)
@@ -2485,13 +2493,13 @@
@@ -2486,13 +2494,13 @@
StartUserSession "$SessionTTY" "$CurrentSeat" "$LOGINUSER" $DoSessionLock "$WSESSIONDATA" &
fi
else
Expand All @@ -302,7 +302,7 @@
#It takes 1 optional argument, the seat to display the dialogs on
function LeavePrompt
{
@@ -2506,7 +2514,7 @@
@@ -2507,7 +2515,7 @@
SessionPromptThreshold=1
else
SetCommonConfig
Expand All @@ -311,7 +311,7 @@
SessionPromptThreshold=2

ACTIONSTRING="Switch User"$'\n'"Switch User"$'\n'"Logoff"$'\n'"Logoff Session"
@@ -2534,7 +2542,7 @@
@@ -2535,7 +2543,7 @@
unset RunningSessions
unset RunningSessionTypes

Expand All @@ -320,7 +320,7 @@
CanPowerOff=$(dbus-send --print-reply --system --dest=org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.login1.Manager.CanPowerOff)
if [[ $CanPowerOff =~ " \"yes\"" ]]
then
@@ -2590,9 +2598,15 @@
@@ -2591,9 +2599,15 @@
ACTIONSTRING+=$'\n'
ACTIONSTRING+="Hibernate Computer"
fi
Expand All @@ -338,7 +338,7 @@
if [[ $CancelOrOK != 0 ]]
then
exit 0
@@ -2611,7 +2625,7 @@
@@ -2612,7 +2626,7 @@
fi

#Prompt the user if they are sure they want to execute the selected action
Expand All @@ -347,7 +347,7 @@
CONFIRM=$?
if [[ $CONFIRM != 0 ]]
then
@@ -2656,7 +2670,7 @@
@@ -2657,7 +2671,7 @@
#if the selected action failed, tell the user
if [[ $RESULT != 0 ]]
then
Expand All @@ -356,7 +356,7 @@
fi
}

@@ -2983,7 +2997,7 @@
@@ -2984,7 +2998,7 @@
DisplayServerWait "$CurrentSeat"
AUTOLOGINUSERHOME=$(eval echo ~$AUTOLOGINUSER)
ChooseSessionType "$CurrentSeat" "$AUTOLOGINUSER" "$AUTOLOGINUSERHOME" 1
Expand All @@ -365,7 +365,7 @@
CancelOrOK=$?
if [[ $CancelOrOK != 0 ]]
then
@@ -3021,7 +3035,7 @@
@@ -3022,7 +3036,7 @@

StartUserSession "$AutoSessionTTY" "$CurrentSeat" "$AUTOLOGINUSER" $DoSessionLock "$WSESSIONDATA" &
else
Expand All @@ -374,7 +374,7 @@
WriteToLog "Not Enough TTYs for autologin!"
fi
}
@@ -3057,15 +3071,20 @@
@@ -3058,15 +3072,20 @@
SetFallbackEnvironmentVariables $CurrentSeat
#wait for the loginmanagerdisplay
DisplayServerWait "$CurrentSeat"
Expand All @@ -401,7 +401,7 @@
#If the useraction exists (the user did not click cancel), then send the command to the loginmanager_control
if [[ ! -z $USERACTION ]]
then
@@ -3073,12 +3092,12 @@
@@ -3074,12 +3093,12 @@
else
$SLEEPCMD .1
fi
Expand All @@ -417,7 +417,7 @@
}

#Function to get the index number of the specified seat of the array "StartedSeats" for the specified seat. It takes 1 argument, the seat
@@ -3427,9 +3446,9 @@
@@ -3428,9 +3447,9 @@
fi
done

Expand Down
Loading

0 comments on commit d1bd641

Please sign in to comment.