From 6d6e72bc355f946edca0df9b1181976afb0922b5 Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Fri, 28 Jun 2013 23:15:37 +0200 Subject: [PATCH] mambawelcome: systemd support --- Makefile | 8 +++++--- mambawelcome/mambawelcome-init | 11 +++++++---- mambawelcome/mambawelcome.service | 12 ++++++++++++ mambawelcome/mambawelcome.target | 17 +++++++++++++++++ 4 files changed, 41 insertions(+), 7 deletions(-) create mode 100644 mambawelcome/mambawelcome.service create mode 100644 mambawelcome/mambawelcome.target diff --git a/Makefile b/Makefile index df2b2bd..4b08630 100644 --- a/Makefile +++ b/Makefile @@ -68,6 +68,7 @@ xdg_appsdir = ${datadir}/applications xdg_directorydir = ${datadir}/desktop-directories xdg_menudir = ${sysconfdir}/xdg/menus xdg_mergedmenudir = $(xdg_menudir)/applications-merged +systemdsystemdir = /lib/systemd/system distrorootdir = ${datadir}/$(DISTROid) distrobindir = ${distrorootdir}/bin @@ -257,17 +258,18 @@ endif install-mambawelcome: ifeq ($(WITHKDE3TOOLS),1) @$(INSTALL_DIR) $(DESTDIR)$(mambawelcomedatadir) - @$(INSTALL_DIR) $(DESTDIR)$(sysconfdir)/rc.d/{init.d,rc5.d} @$(INSTALL_DIR) $(DESTDIR)$(kdeconfigdir) + @$(INSTALL_DIR) $(DESTDIR)$(systemdsystemdir) $(INSTALL_SCRIPT) mambawelcome/mambawelcome.kmdr $(DESTDIR)$(mambawelcomedatadir) $(INSTALL_SCRIPT) mambawelcome/mambawelcome.sh $(DESTDIR)$(mambawelcomedatadir) - $(INSTALL_SCRIPT) mambawelcome/mambawelcome-init $(DESTDIR)$(sysconfdir)/rc.d/init.d/mambawelcome + $(INSTALL_SCRIPT) mambawelcome/mambawelcome-init $(DESTDIR)$(mambawelcomedatadir)/mambawelcome $(INSTALL_DATA) gpl.html $(DESTDIR)$(mambawelcomedatadir)/gpl.html $(INSTALL_DATA) gpl-it.html $(DESTDIR)$(mambawelcomedatadir)/gpl-it.html $(INSTALL_DATA) gpl-es.html $(DESTDIR)$(mambawelcomedatadir)/gpl-es.html $(INSTALL_DATA) kde/config/kcmfonts $(DESTDIR)$(kdeconfigdir)/kcmfonts $(INSTALL_DATA) kde/config/kdeglobals $(DESTDIR)$(kdeconfigdir)/kdeglobals - ln -s ../init.d/mambawelcome $(DESTDIR)$(sysconfdir)/rc.d/rc5.d/S99mambawelcome + $(INSTALL_DATA) mambawelcome/mambawelcome.service $(DESTDIR)$(systemdsystemdir)/mambawelcome.service + $(INSTALL_DATA) mambawelcome/mambawelcome.target $(DESTDIR)$(systemdsystemdir)/mambawelcome.target endif install-xramdr: diff --git a/mambawelcome/mambawelcome-init b/mambawelcome/mambawelcome-init index fee18af..2103cd3 100755 --- a/mambawelcome/mambawelcome-init +++ b/mambawelcome/mambawelcome-init @@ -1,7 +1,7 @@ #!/bin/bash # # mambawelcome - start mambawelcome on first time system execution -# Copyright (c) 2007-2009 by Silvan Calarco +# Copyright (c) 2007-2013 by Silvan Calarco if [ $UID != 0 ]; then echo "$0: must be superuser." >&2 @@ -29,9 +29,12 @@ xinit /opt/kde3/bin/kmdr-executor /usr/share/openmamba/mambawelcome/mambawelcome #/opt/kde3/bin/dcopserver_shutdown killall -9 dcopserver -[ -e /root/.mambawelcome-not-completed ] && { +if [ -e /root/.mambawelcome-not-completed ]; then rm -f /root/.mambawelcome-not-completed - halt -} + poweroff +else + systemctl disable mambawelcome.target + systemctl isolate graphical.target +fi exit 0 diff --git a/mambawelcome/mambawelcome.service b/mambawelcome/mambawelcome.service new file mode 100644 index 0000000..9fafca8 --- /dev/null +++ b/mambawelcome/mambawelcome.service @@ -0,0 +1,12 @@ +[Unit] +Description=openmamba 2nd stage installation welcome dialog +Conflicts=getty@tty1.service +After=systemd-user-sessions.service getty@tty1.service plymouth-quit.service + +[Service] +ExecStart=/usr/share/openmamba/mambawelcome/mambawelcome +Restart=always +IgnoreSIGPIPE=no + +[Install] +WantedBy=mambawelcome.target diff --git a/mambawelcome/mambawelcome.target b/mambawelcome/mambawelcome.target new file mode 100644 index 0000000..0273997 --- /dev/null +++ b/mambawelcome/mambawelcome.target @@ -0,0 +1,17 @@ +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. + +[Unit] +Description=Mambawelcome 2nd stage install target +Documentation=man:systemd.special(7) +Requires=multi-user.target +After=multi-user.target +Conflicts=rescue.target +AllowIsolate=yes + +[Install] +Alias=default.target