Skip to content

Commit

Permalink
Merge pull request #316 from ancorgs/no_systemd
Browse files Browse the repository at this point in the history
Remove systemd dependency on xinetd
  • Loading branch information
ancorgs committed Oct 2, 2015
2 parents fa77304 + 159607c commit 2f8d440
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 16 deletions.
2 changes: 1 addition & 1 deletion package/YaST2-Second-Stage.service
Expand Up @@ -2,7 +2,7 @@
Description=YaST2 Second Stage
# If xinetd is enabled, make sure it's already running so we can stop it during
# initialization of the VNC server
After=apparmor.service local-fs.target plymouth-start.service xinetd.service
After=apparmor.service local-fs.target plymouth-start.service
Before=getty@tty1.service display-manager.service network.service NetworkManager.service SuSEfirewall2_init.service SuSEfirewall2.service
ConditionPathExists=/var/lib/YaST2/runme_at_boot

Expand Down
7 changes: 7 additions & 0 deletions package/yast2-installation.changes
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Thu Oct 1 15:55:54 UTC 2015 - ancor@suse.com

- Simplified second stage systemd unit to avoid dependencies cycles
(bnc#947521 and bnc#931643). Logic moved to YaST startup scripts.
- 3.1.160

-------------------------------------------------------------------
Fri Sep 4 07:07:33 UTC 2015 - jsrain@suse.cz

Expand Down
2 changes: 1 addition & 1 deletion package/yast2-installation.spec
Expand Up @@ -17,7 +17,7 @@


Name: yast2-installation
Version: 3.1.159
Version: 3.1.160
Release: 0

BuildRoot: %{_tmppath}/%{name}-%{version}-build
Expand Down
17 changes: 16 additions & 1 deletion startup/YaST2.call
Expand Up @@ -158,9 +158,24 @@ function prepare_for_vnc () {
setupVNCAuthentication
if [ $VNCPASS_EXCEPTION = 0 ];then
disable_splash
disable_xinetd
displayVNCMessage
stop_xinetd
startVNCServer
wait_for_x11
if is_xinetd_active; then
# xinetd shouldn't be running since we stopped it right
# before starting VNC. But there is still one small
# chance that xinetd was started by the systemd boot
# sequence during VNC startup. If it's running we cannot
# be sure that our VNC got the ports, so retry.
#
# Using systemd dependencies to ensure the correct order
# looks nicer, but is fragile (bnc#931643, bnc#947521).
killall Xvnc >/dev/null 2>&1
stop_xinetd
startVNCServer
wait_for_x11
fi
restore_xinetd
if [ "$server_running" = 1 ];then
log "\tXvnc-Server is ready: $xserver_pid"
Expand Down
23 changes: 19 additions & 4 deletions startup/common/misc.sh
Expand Up @@ -186,23 +186,38 @@ function disable_splash () {
[ -f /proc/splash ] && echo "verbose" > /proc/splash
}

#----[ disable_xinetd ]-----#
function disable_xinetd () {
#----[ stop_xinetd ]-----#
function stop_xinetd () {
#--------------------------------------------------
# stop xinetd since its default configuration collides
# with the Xvnc server used for VNC installation
# ---
systemctl stop xinetd.service >/dev/null 2>&1
}

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

#----[ is_xinetd_active ]-----#
function is_xinetd_active () {
# return 0 if xinetd is currently running
# ---
systemctl --quiet is-active xinetd.service >/dev/null 2>&1
return $?
}

#----[ restore_xinetd ]-----#
function restore_xinetd () {
#--------------------------------------------------
# start xinetd again if it is enabled, once the Xvnc
# server already owns its port
# ---
systemctl --quiet is-enabled xinetd.service >/dev/null 2>&1
if [ $? -eq 0 ]; then
if is_xinetd_enabled; then
systemctl start xinetd.service
fi
}
Expand Down
21 changes: 12 additions & 9 deletions startup/common/vnc.sh
Expand Up @@ -38,15 +38,14 @@ setupVNCAuthentication () {
fi
}

#----[ startVNCServer ]------#
startVNCServer () {
#----[ displayVNCMessage ]------#
displayVNCMessage () {
#---------------------------------------------------
# start Xvnc server and write a log file from the
# VNC server process
# inform the user that VNC server is going to be executed and provide
# instructions on how to connect to it
#
# The IP set in install.inf may not be valid if the DHCP server
# gave us a different lease in the meantime (#43974).

echo
echo starting VNC server...
echo A log file will be written to: /var/log/YaST2/vncserver.log ...
Expand All @@ -64,13 +63,17 @@ startVNCServer () {
EOF
list_ifaces
echo
}

#==========================================
# Start Xvnc...
# For -noreset see BNC #351338
#------------------------------------------
#----[ startVNCServer ]------#
startVNCServer () {
#---------------------------------------------------
# start Xvnc server and write a log file from the
# VNC server process
#
[ -z "$VNCSize" ] && VNCSize=1024x768

# For -noreset see BNC #351338
$Xbindir/Xvnc $Xvncparam :0 \
-noreset \
-rfbauth /root/.vnc/passwd.yast \
Expand Down

0 comments on commit 2f8d440

Please sign in to comment.