Skip to content

Commit

Permalink
Merge 226f30f into 8b88f68
Browse files Browse the repository at this point in the history
  • Loading branch information
teclator committed Apr 25, 2022
2 parents 8b88f68 + 226f30f commit 049caf2
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package/YaST2-Firstboot.service
Expand Up @@ -6,7 +6,7 @@ After=purge-kernels.service
Conflicts=plymouth-start.service
Before=getty@tty1.service serial-getty@ttyS0.service serial-getty@ttyS1.service serial-getty@ttyS2.service
Before=serial-getty@hvc0.service serial-getty@ttyAMA0.service
Before=display-manager.service xvnc.socket
Before=display-manager.service
ConditionPathExists=/var/lib/YaST2/reconfig_system
OnFailure=shutdown.target

Expand Down
4 changes: 2 additions & 2 deletions package/YaST2-Second-Stage.service
Expand Up @@ -10,8 +10,8 @@ Conflicts=plymouth-start.service
Before=getty@tty1.service getty@tty2.service getty@tty3.service getty@tty4.service getty@tty5.service getty@tty6.service
Before=serial-getty@ttyS0.service serial-getty@ttyS1.service serial-getty@ttyS2.service
Before=serial-getty@hvc0.service serial-getty@ttyAMA0.service serial-getty@ttysclp0.service
# Prevent too early user login (bsc#1196594) and too early vnc connection (bsc#1197265)
Before=display-manager.service xvnc.socket
# Prevent too early user login (bsc#1196594)
Before=display-manager.service
ConditionPathExists=/var/lib/YaST2/runme_at_boot

[Service]
Expand Down
1 change: 1 addition & 0 deletions startup/Second-Stage/S09-cleanup
Expand Up @@ -15,6 +15,7 @@ if [ ! -z "$VNC" ] && [ "$VNC" -eq 1 ] ; then
log "\tkill all VNC sessions..."
killall Xvnc >/dev/null 2>&1
rm -fv /root/.vnc/passwd.yast
restore_xvnc
fi
# 13.3) stop network and sshd
if [ "$Y2_NETWORK_ACTIVE" -ne 0 ] ; then
Expand Down
1 change: 1 addition & 0 deletions startup/YaST2.call
Expand Up @@ -216,6 +216,7 @@ function prepare_for_vnc () {
if [ $VNCPASS_EXCEPTION = 0 ];then
disable_splash
displayVNCMessage
stop_xvnc
startVNCServer
wait_for_x11
if [ "$server_running" = 1 ];then
Expand Down
30 changes: 30 additions & 0 deletions startup/common/misc.sh
Expand Up @@ -187,6 +187,36 @@ function disable_splash () {
[ -f /proc/splash ] && echo "verbose" > /proc/splash
}

#----[ stop_xvnc]-----#
function stop_xvnc () {
#--------------------------------------------------
# stop xvnc since its default configuration collides
# with the Xvnc server used for VNC installation
# ---
systemctl stop xvnc.socket >/dev/null 2>&1
# stop also running instances of xvnc to allow start our own
systemctl stop xvnc@* >/dev/null 2>&1
}

#----[ is_xvnc_enabled ]-----#
function is_xvnc_enabled () {
# return 0 if xvnc is enabled
# ---
systemctl --quiet is-enabled xvnc.socket >/dev/null 2>&1
return $?
}

#----[ restore_xvnc ]-----#
function restore_xvnc () {
#--------------------------------------------------
# start xvnc again if it is enabled, once the Xvnc
# server already owns its port
# ---
if is_xvnc_enabled; then
systemctl start xvnc.socket
fi
}

#----[ have_pid ]----#
function have_pid () {
#------------------------------------------------------
Expand Down

0 comments on commit 049caf2

Please sign in to comment.