postplug: add systemd service script and don't run filesystem and console scripts if systemd is running

This commit is contained in:
Silvan Calarco 2013-04-05 14:19:03 +02:00
parent 61f21f23ee
commit d6e8096815
4 changed files with 24 additions and 1 deletions

View File

@ -17,6 +17,7 @@ datadir = $(prefix)/share
initrddir = $(sysconfdir)/rc.d/init.d initrddir = $(sysconfdir)/rc.d/init.d
logrotatedir = $(sysconfdir)/logrotate.d/ logrotatedir = $(sysconfdir)/logrotate.d/
sysconfigdir= $(sysconfdir)/sysconfig sysconfigdir= $(sysconfdir)/sysconfig
systemdunitdir = /lib/systemd/system
localesdir = $(datadir)/locale localesdir = $(datadir)/locale
srcdir = . srcdir = .
@ -72,7 +73,9 @@ install-defs: $(pck_defs)
install-initscript: $(pck_initscript) install-initscript: $(pck_initscript)
@echo "installing initscript...";\ @echo "installing initscript...";\
$(INSTALL_DIR) $(DESTDIR)$(initrddir) $(INSTALL_DIR) $(DESTDIR)$(initrddir)
$(INSTALL_DIR) $(DESTDIR)$(systemdunitdir)
$(INSTALL_SCRIPT) $^ $(DESTDIR)$(initrddir)/$(PACKAGE) $(INSTALL_SCRIPT) $^ $(DESTDIR)$(initrddir)/$(PACKAGE)
$(INSTALL_SCRIPT) postplug/postplug-service $(DESTDIR)$(systemdunitdir)/postplug.service
install-logrotate: $(pck_logrotate) install-logrotate: $(pck_logrotate)
@echo "installing logrotate file...";\ @echo "installing logrotate file...";\
@ -122,6 +125,7 @@ uninstall:
-rmdir $(DESTDIR)$(postplugdir) -rmdir $(DESTDIR)$(postplugdir)
-rmdir $(DESTDIR)$(postplugrcdir) -rmdir $(DESTDIR)$(postplugrcdir)
rm -f $(DESTDIR)$(initrddir)/$(PACKAGE) rm -f $(DESTDIR)$(initrddir)/$(PACKAGE)
rm -f $(DESTDIR)$(systemdunitdir)/postplug.service
rm -f $(DESTDIR)$(localesdir)/*/LC_MESSAGES/$(PACKAGE).mo rm -f $(DESTDIR)$(localesdir)/*/LC_MESSAGES/$(PACKAGE).mo
dist: clean dist: clean

View File

@ -3,7 +3,10 @@
# filesystems - filesystems plugin for postplug # filesystems - filesystems plugin for postplug
# Copyright (c) 2004-2007 by Davide Madrisan <davide.madrisan@qilinux.it> # Copyright (c) 2004-2007 by Davide Madrisan <davide.madrisan@qilinux.it>
# Copyright (c) 2007 by Stefano Cotta Ramusino <stefano.cotta@openmamba.org> # Copyright (c) 2007 by Stefano Cotta Ramusino <stefano.cotta@openmamba.org>
# Copyright (c) 2009-2011 by Silvan Calarco <silvan.calarco@mambasoft.it> # Copyright (c) 2009-2013 by Silvan Calarco <silvan.calarco@mambasoft.it>
# systemd: completely disable for now
[ -d /run/systemd ] && exit 0
if [ $UID != 0 ]; then if [ $UID != 0 ]; then
echo "$0: must be superuser." >&2 echo "$0: must be superuser." >&2

View File

@ -2,6 +2,9 @@
# console - virtual consoles plugin for postplug # console - virtual consoles plugin for postplug
# Copyright (c) 2012 by Silvan Calarco <silvan.calarco@mambasoft.it> # Copyright (c) 2012 by Silvan Calarco <silvan.calarco@mambasoft.it>
# systemd: no need to manage inittab
[ -d /run/systemd ] && exit 0
if [ $UID != 0 ]; then if [ $UID != 0 ]; then
echo "$0: must be superuser." >&2 echo "$0: must be superuser." >&2
exit 1 exit 1

13
postplug/postplug-service Normal file
View File

@ -0,0 +1,13 @@
[Unit]
Description=openmamba system configuration script
DefaultDependencies=no
After=systemd-udev-trigger.service
Before=systemd-remount-fs.service
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/sbin/postplug
[Install]
WantedBy=sysinit.target