diff options
author | Martin Sivak <msivak@redhat.com> | 2013-03-08 14:19:46 +0100 |
---|---|---|
committer | Martin Sivak <msivak@redhat.com> | 2013-03-08 16:26:36 +0100 |
commit | e2927e730fe7053b819ff09672de3d6043870862 (patch) | |
tree | fbce30908b448b35ee96ba3451e416e6a266163f | |
parent | 2fec10595bae9ca4ebf44ad2e80bd3521fa2244b (diff) | |
download | firstboot2-e2927e730fe7053b819ff09672de3d6043870862.tar.gz firstboot2-e2927e730fe7053b819ff09672de3d6043870862.tar.xz firstboot2-e2927e730fe7053b819ff09672de3d6043870862.zip |
Fix graphical and text systemd target
- the xserver unit approach worked (after some patch fixes), but
still had one serious issue. The graphical unit (initial-setup)
started before Xserver was fully initialized...
- this update starts the initial-setup process inside the xinit
session and thus ensures that the Xserver is initialized by the
time initial-setup tests the DISPLAY variable
- text target was configured to conflict with graphical and
to have it's stdout and stdin routed to terminal
-rwxr-xr-x | firstboot-windowmanager | 19 | ||||
-rw-r--r-- | initial-setup.spec | 4 | ||||
-rw-r--r-- | systemd/initial-setup-graphical.service | 7 | ||||
-rw-r--r-- | systemd/initial-setup-text.service | 10 | ||||
-rw-r--r-- | systemd/initial-setup-xserver.service | 17 |
5 files changed, 28 insertions, 29 deletions
diff --git a/firstboot-windowmanager b/firstboot-windowmanager index b4fb12c..ab79a4e 100755 --- a/firstboot-windowmanager +++ b/firstboot-windowmanager @@ -3,12 +3,29 @@ # This is the list of supported window manager binaries WMS=("metacity" "kwin" "xfwm4" "openbox" "marco") +# Get the application binary to start and remove it from +# the argument list +BINARY=$1 +shift + for WM in ${WMS[@]}; do FILE=$(which $WM 2>/dev/null) FOUND=$? if [ $FOUND -eq 0 -a -x "$FILE" ]; then - exec "$FILE" "$@" + # start window manager + "$FILE" "$@" & + pid=$! + + # start the application + $BINARY + res=$? + + # stop window manager + kill $pid + + # return result + exit $res fi done diff --git a/initial-setup.spec b/initial-setup.spec index 1d844b4..ab8fcc9 100644 --- a/initial-setup.spec +++ b/initial-setup.spec @@ -66,19 +66,16 @@ if [ $1 -ne 2 -a ! -f /etc/sysconfig/initial-setup ]; then else %systemd_post initial-setup-graphical.service %systemd_post initial-setup-text.service - %systemd_post initial-setup-xserver.service fi fi %preun %systemd_preun initial-setup-graphical.service %systemd_preun initial-setup-text.service -%systemd_preun initial-setup-xserver.service %postun %systemd_postun_with_restart initial-setup-graphical.service %systemd_postun_with_restart initial-setup-text.service -%systemd_postun_with_restart initial-setup-xserver.service %files -f %{name}.lang %doc COPYING README @@ -91,7 +88,6 @@ fi %{_unitdir}/initial-setup-graphical.service %{_unitdir}/initial-setup-text.service -%{_unitdir}/initial-setup-xserver.service %ifarch s390 s390x %{_sysconfdir}/profile.d/initial-setup.sh diff --git a/systemd/initial-setup-graphical.service b/systemd/initial-setup-graphical.service index da96359..1e1c82d 100644 --- a/systemd/initial-setup-graphical.service +++ b/systemd/initial-setup-graphical.service @@ -3,15 +3,14 @@ Description=Initial Setup configuration program After=livesys.service plymouth-quit.service Before=display-manager.service getty@tty1.service Conflicts=plymouth-quit.service initial-setup-text.service -PartOf=initial-setup-xserver.service [Service] Type=oneshot ExecStartPre=-/bin/plymouth quit -ExecStart=DISPLAY=:9 /usr/sbin/initial-setup -ExecStartPost=/bin/systemctl disable initial-setup-graphical.service +ExecStart=/bin/xinit /bin/firstboot-windowmanager /bin/initial-setup -- /bin/Xorg :9 -ac -nolisten tcp +ExecStartPost=/bin/systemctl disable initial-setup-graphical.service initial-setup-text.service TimeoutSec=0 -RemainAfterExit=yes +RemainAfterExit=no SysVStartPriority=99 [Install] diff --git a/systemd/initial-setup-text.service b/systemd/initial-setup-text.service index eca8a7b..c4bb298 100644 --- a/systemd/initial-setup-text.service +++ b/systemd/initial-setup-text.service @@ -4,15 +4,19 @@ After=livesys.service plymouth-quit.service After=systemd-vconsole-setup.service Before=display-manager.service getty@tty1.service Conflicts=plymouth-quit.service +Conflicts=initial-setup-graphical.service +After=initial-setup-graphical.service [Service] Type=oneshot -ExecStartPre=-/bin/plymouth quit -ExecStart=/usr/sbin/initial-setup -ExecStartPost=/bin/systemctl disable initial-setup-text.service +ExecStartPre= +ExecStart=/bin/initial-setup +ExecStartPost=/bin/systemctl disable initial-setup-text.service initial-setup-graphical.service TimeoutSec=0 RemainAfterExit=yes SysVStartPriority=99 +StandardInput=tty +StandardOutput=tty [Install] WantedBy=multi-user.target diff --git a/systemd/initial-setup-xserver.service b/systemd/initial-setup-xserver.service deleted file mode 100644 index 3c485ce..0000000 --- a/systemd/initial-setup-xserver.service +++ /dev/null @@ -1,17 +0,0 @@ -[Unit] -Description=Initial Setup Xserver service -After=livesys.service plymouth-quit.service -After=systemd-vconsole-setup.service -Before=display-manager.service getty@tty1.service -Conflicts=plymouth-quit.service - -[Service] -Type=oneshot -ExecStartPre=-/bin/plymouth quit -ExecStart=xinit /bin/firstboot-windowmanager -- Xorg :9 -ac -nolisten tcp vt1 -ExecStartPost= -TimeoutSec=0 -RemainAfterExit=yes -SysVStartPriority=99 - -[Install] |