[Initscripts-ng-commits] r1045 - in /trunk/src/insserv: ./ debian/ debian/patches/ debian/source/ tests/
kelmo-guest at users.alioth.debian.org
kelmo-guest at users.alioth.debian.org
Mon May 3 05:43:42 UTC 2010
Author: kelmo-guest
Date: Mon May 3 05:43:41 2010
New Revision: 1045
URL: http://svn.debian.org/wsvn/initscripts-ng/?sc=1&rev=1045
Log:
* New upstream release.
* Drop patches applied upstream:
- 20_install_perms_fixup.patch
- 21_tests_suite_new_functions.patch
- 30_deterministic_order.patch
- 40_badboy_segfault.patch
- 50_symlink_in_initddir.patch
- 60_all_keyword_start_only.patch
- 61_interactive_keyword.patch
- 62_upstart_job.patch
- 70_req_start_all_depends.patch
- 71_complete_makefile.patch
- 80_manual_warnings.patch
- 81_lessverbose.patch
- 82_loop_exit_msg.patch
- 90_no_runlevel_spec_for_debian.patch
- 91_kfreebsd_nofadvice.patch
- 93_hurd_no_path_max.patch
- 94_v1_12_2.patch
- 95_stop_all.patch
- 96_hurd_no_at_funcs.patch
* Refresh remaining patch series.
* Set debian/source/format to 3.0 (quilt).
* Drop quilt from build-depends, remove quilt usage from debian/rules.
* Remove debian/README.source which explained how to use quilt to
patch/unpatch - that is now done thanks to source format 3.0 (quilt).
* Adjust Standards-Version to 3.8.4, no other chages required.
* Add 20_manpage_spelling.patch to fix spelling errors in insserv(8).
* Add note next to test_undetected_loop() that it's 2 tests currently
fail but are not terminal.
Added:
trunk/src/insserv/debian/patches/20_manpage_spelling.patch
trunk/src/insserv/debian/source/
trunk/src/insserv/debian/source/format
trunk/src/insserv/tests/common (with props)
Removed:
trunk/src/insserv/debian/README.source
trunk/src/insserv/debian/patches/20_install_perms_fixup.patch
trunk/src/insserv/debian/patches/21_tests_suite_new_functions.patch
trunk/src/insserv/debian/patches/30_deterministic_order.patch
trunk/src/insserv/debian/patches/40_badboy_segfault.patch
trunk/src/insserv/debian/patches/50_symlink_in_initddir.patch
trunk/src/insserv/debian/patches/60_all_keyword_start_only.patch
trunk/src/insserv/debian/patches/61_interactive_keyword.patch
trunk/src/insserv/debian/patches/62_upstart_job.patch
trunk/src/insserv/debian/patches/70_req_start_all_depends.patch
trunk/src/insserv/debian/patches/71_complete_makefile.patch
trunk/src/insserv/debian/patches/80_manual_warnings.patch
trunk/src/insserv/debian/patches/81_lessverbose.patch
trunk/src/insserv/debian/patches/82_loop_exit_msg.patch
trunk/src/insserv/debian/patches/90_no_runlevel_spec_for_debian.patch
trunk/src/insserv/debian/patches/91_kfreebsd_nofadvice.patch
trunk/src/insserv/debian/patches/93_hurd_no_path_max.patch
trunk/src/insserv/debian/patches/94_v1_12_2.patch
trunk/src/insserv/debian/patches/95_stop_all.patch
trunk/src/insserv/debian/patches/96_hurd_no_at_funcs.patch
trunk/src/insserv/insserv-1.12.0.lsm
Modified:
trunk/src/insserv/CHANGES
trunk/src/insserv/COPYING
trunk/src/insserv/Makefile
trunk/src/insserv/debian/changelog
trunk/src/insserv/debian/control
trunk/src/insserv/debian/patches/10_nosuse.patch
trunk/src/insserv/debian/patches/11_debian_conf.patch
trunk/src/insserv/debian/patches/92_m68k_alignment.patch
trunk/src/insserv/debian/patches/series
trunk/src/insserv/debian/rules
trunk/src/insserv/debian/run-testsuite
trunk/src/insserv/insserv.8.in
trunk/src/insserv/insserv.c
trunk/src/insserv/insserv.conf
trunk/src/insserv/listing.c
trunk/src/insserv/listing.h
trunk/src/insserv/tests/suite
Modified: trunk/src/insserv/CHANGES
URL: http://svn.debian.org/wsvn/initscripts-ng/trunk/src/insserv/CHANGES?rev=1045&op=diff
==============================================================================
--- trunk/src/insserv/CHANGES (original)
+++ trunk/src/insserv/CHANGES Mon May 3 05:43:41 2010
@@ -1,3 +1,81 @@
+-------------------------------------------------------------------
+Wed Apr 28 15:29:23 CEST 2010 - werner at suse.de
+
+- Use savannah as primary site
+
+-------------------------------------------------------------------
+Fri Feb 19 13:36:50 CET 2010 - werner at suse.de
+
+- Adopt upstart-job patch to be able to support traditional sysv
+ rc execution of upstart jobs. Patch from Petter Reinholdtsen.
+- Defend against symlinks in init.d/ to other scripts in init.d/
+ Patch from Kel Modderman found at the Debian SVN server.
+
+-------------------------------------------------------------------
+Sat Nov 14 20:50:10 CEST 2009 - pere at hungry.com
+
+- Add simple test case checking the ordering of three scripts. Run
+ the test suite before installing.
+
+-------------------------------------------------------------------
+Wed Aug 19 12:07:58 CEST 2009 - werner at suse.de
+
+- Use dependency sorting for scripts using $all
+
+-------------------------------------------------------------------
+Tue Aug 18 14:16:05 CEST 2009 - werner at suse.de
+
+- Make $all available for stopping order
+
+-------------------------------------------------------------------
+Mon Aug 17 14:55:39 CEST 2009 - werner at suse.de
+
+- Loops within /etc/insserv.conf are real errors
+- The system facility $all is special
+
+-------------------------------------------------------------------
+Thu Jul 23 11:28:08 CEST 2009 - werner at suse.de
+
+- Fix expansion of the system facilties
+
+-------------------------------------------------------------------
+Mon Jun 29 14:26:57 CEST 2009 - werner at suse.de
+
+- Make it possible to mark a script as interactive in the LSB
+ header its self (patch from Petter Reinholdtsen).
+
+-------------------------------------------------------------------
+Mon Mar 9 13:12:17 CET 2009 - werner at suse.de
+
+- Add service in .depend.start even if $all only is used
+
+-------------------------------------------------------------------
+Mon Feb 23 13:04:00 CET 2009 - werner at suse.de
+
+- Allow overriding level on the command line
+
+-------------------------------------------------------------------
+Thu Feb 12 14:15:22 CET 2009 - werner at suse.de
+
+- Do not be fooled by inexistent /proc
+
+-------------------------------------------------------------------
+Fri Sep 12 12:33:29 CEST 2008 - werner at suse.de
+
+- Don't be fooled by broken symlinks (Patch from Kel Modderman)
+
+-------------------------------------------------------------------
+Thu Sep 11 15:28:29 CEST 2008 - werner at suse.de
+
+- Load first script in argument list before all other scripts. This
+ avoids problems with loading scripts in underterministic sequence
+ returned by readdir(3) (Patch from Kel Modderman)
+
+-------------------------------------------------------------------
+Tue Aug 12 13:40:43 CEST 2008 - werner at suse.de
+
+- Mention the $null facility
+
-------------------------------------------------------------------
Tue Jul 29 15:23:43 CEST 2008 - werner at suse.de
@@ -105,7 +183,7 @@
Petter Reinholdtsen
* Make it possible to set the path at runtime, to make it easier
to write test suites
- * Support for reading LSB headers info from override directroy
+ * Support for reading LSB headers info from override directory
* Accept script names like 'rc.local' for Debian build
* Use other defaults on Debian systems (start, stop levels)
* Put redundant level informations in one API
Modified: trunk/src/insserv/COPYING
URL: http://svn.debian.org/wsvn/initscripts-ng/trunk/src/insserv/COPYING?rev=1045&op=diff
==============================================================================
--- trunk/src/insserv/COPYING (original)
+++ trunk/src/insserv/COPYING Mon May 3 05:43:41 2010
@@ -1,8 +1,8 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
@@ -15,7 +15,7 @@
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.) You can apply it to
+the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
@@ -55,7 +55,7 @@
The precise terms and conditions for copying, distribution and
modification follow.
-
+
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
@@ -110,7 +110,7 @@
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
-
+
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
@@ -168,7 +168,7 @@
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
-
+
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
@@ -225,7 +225,7 @@
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
-
+
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
@@ -278,7 +278,7 @@
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
-
+
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
@@ -291,7 +291,7 @@
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
- Copyright (C) 19yy <name of author>
+ Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -303,17 +303,16 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
- Gnomovision version 69, Copyright (C) 19yy name of author
+ Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
@@ -336,5 +335,5 @@
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Library General
+library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.
Modified: trunk/src/insserv/Makefile
URL: http://svn.debian.org/wsvn/initscripts-ng/trunk/src/insserv/Makefile?rev=1045&op=diff
==============================================================================
--- trunk/src/insserv/Makefile (original)
+++ trunk/src/insserv/Makefile Mon May 3 05:43:41 2010
@@ -4,6 +4,7 @@
# Author: Werner Fink, <werner at suse.de>
#
+PACKAGE = insserv
INITDIR = /etc/init.d
INSCONF = /etc/insserv.conf
#DESTDIR = /tmp/root
@@ -11,7 +12,7 @@
DEBUG =
ISSUSE = -DSUSE
DESTDIR =
-VERSION = 1.12.0
+VERSION = 1.14.0
DATE = $(shell date +'%d%b%y' | tr '[:lower:]' '[:upper:]')
#
@@ -41,14 +42,14 @@
RM = rm -f
MKDIR = mkdir -p
RMDIR = rm -rf
- INSTBINFLAGS = -m 0700
+ INSTBINFLAGS = -m 0755
INSTBIN = install $(INSTBINFLAGS)
- INSTSRPFLAGS = -m 0700
+ INSTSRPFLAGS = -m 0755
INSTSRP = install $(INSTSRPFLAGS)
- INSTDOCFLAGS = -c -m 0444
+ INSTDOCFLAGS = -c -m 0644
INSTDOC = install $(INSTDOCFLAGS)
INSTCONFLAGS = -c -m 0644
- INSTCON = install $(INSTDOCFLAGS)
+ INSTCON = install $(INSTCONFLAGS)
LINK = ln -sf
#
SDOCDIR = $(DESTDIR)/usr/share/man/man8
@@ -59,7 +60,7 @@
#
# Determine if a library provides a specific function
-# Fist argument is the function to test, the second
+# First argument is the function to test, the second
# one is the library its self.
#
CTEST = $(CC) -nostdinc -fno-builtin -o /dev/null -xc
@@ -125,7 +126,15 @@
endif
-install: $(TODO)
+check: insserv
+ifeq ($(ISSUSE),-DSUSE)
+ issuse=true tests/common
+# issuse=true tests/suse
+else
+ tests/common
+endif
+
+install: $(TODO) check
$(MKDIR) $(SBINDIR)
$(MKDIR) $(SDOCDIR)
$(MKDIR) $(CONFDIR)
@@ -158,11 +167,17 @@
init-functions \
remove_initd \
install_initd \
+ tests/common \
tests/suite \
insserv-$(VERSION).lsm
-dest: clean
- $(MKDIR) insserv-$(VERSION)/tests
+SVLOGIN=$(shell svn info | sed -rn '/Repository Root:/{ s|.*//(.*)\@.*|\1|p }')
+override TMP:=$(shell mktemp -d $(PACKAGE)-$(VERSION).XXXXXXXX)
+override TARBALL:=$(TMP)/$(PACKAGE)-$(VERSION).tar.bz2
+override SFTPBATCH:=$(TMP)/$(VERSION)-sftpbatch
+override LSM=$(TMP)/$(PACKAGE)-$(VERSION).lsm
+
+$(LSM): $(TMP)/$(PACKAGE)-$(VERSION)
@echo -e "Begin3\n\
Title: insserv tool for boot scripts\n\
Version: $(VERSION)\n\
@@ -172,21 +187,41 @@
Keywords: boot service control, LSB\n\
Author: Werner Fink <werner at suse.de>\n\
Maintained-by: Werner Fink <werner at suse.de>\n\
-Primary-site: sunsite.unc.edu /pub/Linux/system/daemons/init\n\
-x @UNKNOWN insserv-$(VERSION).tar.gz\n\
+Primary-site: http://download.savannah.gnu.org/releases/sysvinit/\n\
+x @UNKNOWN $(PACKAGE)-$(VERSION).tar.bz2\n\
Alternate-site: ftp.suse.com /pub/projects/init\n\
Platforms: Linux with System VR2 or higher boot scheme\n\
Copying-policy: GPL\n\
-End" | sed 's@^ @@g;s@^x@@g' > insserv-$(VERSION).lsm
- for file in $(FILES) ; do \
- case "$$file" in \
- tests/*) cp -p $$file insserv-$(VERSION)/tests/ ;; \
- *) cp -p $$file insserv-$(VERSION)/ ;; \
- esac; \
- done
- tar -cps -zf insserv-$(VERSION).tar.gz insserv-$(VERSION)/
- $(RMDIR) insserv-$(VERSION)
- set -- `gzip -l insserv-$(VERSION).tar.gz | tail -1` ; \
- sed "s:@UNKNOWN:$$1:" < insserv-$(VERSION).lsm > \
- insserv-$(VERSION).lsm.tmp ; \
- mv insserv-$(VERSION).lsm.tmp insserv-$(VERSION).lsm
+End" | sed 's@^ @@g;s@^x@@g' > $(LSM)
+
+dest: $(LSM)
+
+upload: $(SFTPBATCH)
+ @sftp -b $< $(SVLOGIN)@dl.sv.nongnu.org:/releases/sysvinit
+ mv $(TARBALL) $(LSM) .
+ rm -rf $(TMP)
+
+$(SFTPBATCH): $(TARBALL).sig
+ @echo progress > $@
+ @echo put $(TARBALL) >> $@
+ @echo chmod 644 $(notdir $(TARBALL)) >> $@
+ @echo put $(TARBALL).sig >> $@
+ @echo chmod 644 $(notdir $(TARBALL)).sig >> $@
+ @echo rm $(PACKAGE)-latest.tar.bz2 >> $@
+ @echo symlink $(notdir $(TARBALL)) $(PACKAGE)-latest.tar.bz2 >> $@
+ @echo quit >> $@
+
+$(TARBALL).sig: $(TARBALL)
+ @gpg -q -ba --use-agent -o $@ $<
+
+$(TARBALL): $(TMP)/$(PACKAGE)-$(VERSION) $(LSM)
+ @tar --bzip2 --owner=nobody --group=nobody -cf $@ -C $(TMP) $(PACKAGE)-$(VERSION)
+ @set -- `find $@ -printf '%s'` ; \
+ sed "s:@UNKNOWN:$$1:" < $(LSM) > $(LSM).tmp ; \
+ mv $(LSM).tmp $(LSM)
+
+$(TMP)/$(PACKAGE)-$(VERSION): .svn
+ svn export . $@
+ @chmod -R a+r,u+w,og-w $@
+ @find $@ -type d | xargs -r chmod a+rx,u+w,og-w
+
Modified: trunk/src/insserv/debian/changelog
URL: http://svn.debian.org/wsvn/initscripts-ng/trunk/src/insserv/debian/changelog?rev=1045&op=diff
==============================================================================
--- trunk/src/insserv/debian/changelog (original)
+++ trunk/src/insserv/debian/changelog Mon May 3 05:43:41 2010
@@ -1,5 +1,6 @@
-insserv (1.12.0-15) UNRELEASED; urgency=low
-
+insserv (1.14.0-1) unstable; urgency=low
+
+ [ Petter Reinholdtsen ]
* Fix typo (loop->look) in previous changelog (Closes: #549286).
Thanks to Josh Triplett.
* New testsuite code test_undetected_loop to report error when the
@@ -7,7 +8,39 @@
facility, as was detected in #554905.
* Change homepage link to the Savannah project.
- -- Petter Reinholdtsen <pere at debian.org> Fri, 02 Oct 2009 07:43:29 +0200
+ [ Kel Modderman ]
+ * New upstream release.
+ * Drop patches applied upstream:
+ - 20_install_perms_fixup.patch
+ - 21_tests_suite_new_functions.patch
+ - 30_deterministic_order.patch
+ - 40_badboy_segfault.patch
+ - 50_symlink_in_initddir.patch
+ - 60_all_keyword_start_only.patch
+ - 61_interactive_keyword.patch
+ - 62_upstart_job.patch
+ - 70_req_start_all_depends.patch
+ - 71_complete_makefile.patch
+ - 80_manual_warnings.patch
+ - 81_lessverbose.patch
+ - 82_loop_exit_msg.patch
+ - 90_no_runlevel_spec_for_debian.patch
+ - 91_kfreebsd_nofadvice.patch
+ - 93_hurd_no_path_max.patch
+ - 94_v1_12_2.patch
+ - 95_stop_all.patch
+ - 96_hurd_no_at_funcs.patch
+ * Refresh remaining patch series.
+ * Set debian/source/format to 3.0 (quilt).
+ * Drop quilt from build-depends, remove quilt usage from debian/rules.
+ * Remove debian/README.source which explained how to use quilt to
+ patch/unpatch - that is now done thanks to source format 3.0 (quilt).
+ * Adjust Standards-Version to 3.8.4, no other chages required.
+ * Add 20_manpage_spelling.patch to fix spelling errors in insserv(8).
+ * Add note next to test_undetected_loop() that it's 2 tests currently
+ fail but are not terminal.
+
+ -- Kel Modderman <kel at otaku42.de> Mon, 03 May 2010 15:41:57 +1000
insserv (1.12.0-14) unstable; urgency=low
Modified: trunk/src/insserv/debian/control
URL: http://svn.debian.org/wsvn/initscripts-ng/trunk/src/insserv/debian/control?rev=1045&op=diff
==============================================================================
--- trunk/src/insserv/debian/control (original)
+++ trunk/src/insserv/debian/control Mon May 3 05:43:41 2010
@@ -3,8 +3,8 @@
Priority: optional
Maintainer: Petter Reinholdtsen <pere at debian.org>
Uploaders: Kel Modderman <kel at otaku42.de>
-Build-Depends: debhelper (>= 6.0.7), po-debconf, quilt
-Standards-Version: 3.8.3
+Build-Depends: debhelper (>= 6.0.7), po-debconf
+Standards-Version: 3.8.4
DM-Upload-Allowed: yes
Homepage: http://savannah.nongnu.org/projects/sysvinit
Vcs-Svn: svn://svn.debian.org/initscripts-ng/trunk/src/insserv
Modified: trunk/src/insserv/debian/patches/10_nosuse.patch
URL: http://svn.debian.org/wsvn/initscripts-ng/trunk/src/insserv/debian/patches/10_nosuse.patch?rev=1045&op=diff
==============================================================================
--- trunk/src/insserv/debian/patches/10_nosuse.patch (original)
+++ trunk/src/insserv/debian/patches/10_nosuse.patch Mon May 3 05:43:41 2010
@@ -2,16 +2,14 @@
Fixes: None, made as part of Debian porting.
Status: Debian specific, showed to upstream.
---
-Index: insserv/Makefile
-===================================================================
---- insserv.orig/Makefile 2009-09-26 22:35:26.000000000 +0200
-+++ insserv/Makefile 2009-09-26 22:35:45.000000000 +0200
-@@ -9,7 +9,7 @@
+--- a/Makefile
++++ b/Makefile
+@@ -10,7 +10,7 @@ INSCONF = /etc/insserv.conf
#DESTDIR = /tmp/root
#DEBUG = -DDEBUG=1 -Wpacked
DEBUG =
-ISSUSE = -DSUSE
+ISSUSE = -DNOTSUSE
DESTDIR =
- VERSION = 1.12.0
+ VERSION = 1.14.0
DATE = $(shell date +'%d%b%y' | tr '[:lower:]' '[:upper:]')
Modified: trunk/src/insserv/debian/patches/11_debian_conf.patch
URL: http://svn.debian.org/wsvn/initscripts-ng/trunk/src/insserv/debian/patches/11_debian_conf.patch?rev=1045&op=diff
==============================================================================
--- trunk/src/insserv/debian/patches/11_debian_conf.patch (original)
+++ trunk/src/insserv/debian/patches/11_debian_conf.patch Mon May 3 05:43:41 2010
@@ -2,21 +2,19 @@
Fixes: None, made as part of Debian porting.
Status: Debian specific, showed to upstream.
---
-Index: insserv/insserv.conf
-===================================================================
---- insserv.orig/insserv.conf 2009-09-26 22:35:26.000000000 +0200
-+++ insserv/insserv.conf 2009-09-26 22:35:39.000000000 +0200
+--- a/insserv.conf
++++ b/insserv.conf
@@ -1,29 +1,29 @@
#
# All local filesystems are mounted (done during boot phase)
#
--$local_fs boot.localfs
+-$local_fs boot.localfs +boot.crypto
+$local_fs +mountall +mountoverflowtmp +umountfs
#
# Low level networking (ethernet card)
#
--$network network +pcmcia +hotplug
+-$network network
+$network +networking +ifupdown
#
@@ -30,18 +28,18 @@
# be remote. Most applications that care will probably require
# both $local_fs and $remote_fs)
#
--$remote_fs $local_fs +nfs
+-$remote_fs $local_fs +nfs +smbfs
+$remote_fs $local_fs +mountnfs +mountnfs-bootclean +umountnfs +sendsigs
#
# System logger is operational
#
-$syslog syslog
-+$syslog +rsyslog +sysklogd +syslog-ng +dsyslog +inetutils-syslogd
++$syslog +rsyslog +sysklogd +syslog-ng +dsyslog +inetutils-syslogd
#
# SunRPC portmapper available
-@@ -33,9 +33,9 @@
+@@ -33,9 +33,9 @@ $portmap portmap
#
# The system time has been set correctly
#
@@ -51,5 +49,5 @@
#
# Services which need to be interactive
#
--<interactive> boot.crypto boot.localfs boot.rootfsck apache apache2 kdump
-+<interactive> glibc udev console-screen keymap keyboard-setup console-setup cryptdisks cryptdisks-early checkfs-loop
+-<interactive> apache apache2 boot.clock boot.crypto boot.crypto-early boot.localfs boot.rootfsck kbd kdump ntp
++<interactive> glibc udev console-screen keymap keyboard-setup console-setup cryptdisks cryptdisks-early checkfs-loop
Added: trunk/src/insserv/debian/patches/20_manpage_spelling.patch
URL: http://svn.debian.org/wsvn/initscripts-ng/trunk/src/insserv/debian/patches/20_manpage_spelling.patch?rev=1045&op=file
==============================================================================
--- trunk/src/insserv/debian/patches/20_manpage_spelling.patch (added)
+++ trunk/src/insserv/debian/patches/20_manpage_spelling.patch Mon May 3 05:43:41 2010
@@ -1,0 +1,23 @@
+Description: Fix spelling errors in insserv(8).
+From: Kel Modderman <kel at otaku42.de>
+---
+--- a/insserv.8.in
++++ b/insserv.8.in
+@@ -124,7 +124,7 @@ these tags is stopped.
+ The optional X\-Interactive keyword implies that the script using this
+ keyword should be started alone in a concurrent boot configuration
+ because it interact with the user at the console. Only the value
+-`true' is recogniced. All other are ignored.
++`true' is recognised. All other are ignored.
+ .PP
+ The optional
+ .B X\-Start\-Before
+@@ -244,7 +244,7 @@ in the configuration file
+ also knows the special facility
+ .BR $all .
+ This facility indicates that a service should be inserted
+-at the end of all services at starting and at the very begining
++at the end of all services at starting and at the very beginning
+ at stopping. Clearly all services using this facility will be
+ grouped into one starting or stopping order.
+ .\"
Modified: trunk/src/insserv/debian/patches/92_m68k_alignment.patch
URL: http://svn.debian.org/wsvn/initscripts-ng/trunk/src/insserv/debian/patches/92_m68k_alignment.patch?rev=1045&op=diff
==============================================================================
--- trunk/src/insserv/debian/patches/92_m68k_alignment.patch (original)
+++ trunk/src/insserv/debian/patches/92_m68k_alignment.patch Mon May 3 05:43:41 2010
@@ -3,11 +3,9 @@
Fixes: #493637
Status: Not yet submitted upstream.
---
-Index: insserv/insserv.c
-===================================================================
---- insserv.orig/insserv.c 2009-09-26 22:35:39.000000000 +0200
-+++ insserv/insserv.c 2009-09-26 22:35:40.000000000 +0200
-@@ -131,6 +131,10 @@
+--- a/insserv.c
++++ b/insserv.c
+@@ -151,6 +151,10 @@ static boolean dryrun = false;
static boolean set_override = false;
static boolean set_insconf = false;
Modified: trunk/src/insserv/debian/patches/series
URL: http://svn.debian.org/wsvn/initscripts-ng/trunk/src/insserv/debian/patches/series?rev=1045&op=diff
==============================================================================
--- trunk/src/insserv/debian/patches/series (original)
+++ trunk/src/insserv/debian/patches/series Mon May 3 05:43:41 2010
@@ -1,22 +1,4 @@
10_nosuse.patch
11_debian_conf.patch
-20_install_perms_fixup.patch
-21_tests_suite_new_functions.patch
-30_deterministic_order.patch
-40_badboy_segfault.patch
-50_symlink_in_initddir.patch
-#60_all_keyword_start_only.patch
-61_interactive_keyword.patch
-62_upstart_job.patch
-70_req_start_all_depends.patch
-71_complete_makefile.patch
-80_manual_warnings.patch
-81_lessverbose.patch
-82_loop_exit_msg.patch
-90_no_runlevel_spec_for_debian.patch
-91_kfreebsd_nofadvice.patch
+20_manpage_spelling.patch
92_m68k_alignment.patch
-93_hurd_no_path_max.patch
-94_v1_12_2.patch
-95_stop_all.patch
-96_hurd_no_at_funcs.patch
Modified: trunk/src/insserv/debian/rules
URL: http://svn.debian.org/wsvn/initscripts-ng/trunk/src/insserv/debian/rules?rev=1045&op=diff
==============================================================================
--- trunk/src/insserv/debian/rules (original)
+++ trunk/src/insserv/debian/rules Mon May 3 05:43:41 2010
@@ -21,11 +21,9 @@
pkgdatadir = /usr/share/$(PACKAGE)
sbindir = /usr/sbin
-include /usr/share/quilt/quilt.make
-
build: build-stamp
-build-stamp: $(QUILT_STAMPFN)
+build-stamp:
dh_testdir
# Add here commands to compile the package.
@@ -42,9 +40,6 @@
# Add here commands to clean up after the build process.
$(MAKE) clean
-
- # Remove patches after doing 'make clean', to allow patches to adjust the clean target
- $(MAKE) -f debian/rules unpatch
dh_clean
Modified: trunk/src/insserv/debian/run-testsuite
URL: http://svn.debian.org/wsvn/initscripts-ng/trunk/src/insserv/debian/run-testsuite?rev=1045&op=diff
==============================================================================
--- trunk/src/insserv/debian/run-testsuite (original)
+++ trunk/src/insserv/debian/run-testsuite Mon May 3 05:43:41 2010
@@ -2243,4 +2243,4 @@
test_insserv_virt_loop
test_local_virtual
test_insserv_upstart
-test_undetected_loop
+test_undetected_loop # 2 non-fatal tests failing
Added: trunk/src/insserv/debian/source/format
URL: http://svn.debian.org/wsvn/initscripts-ng/trunk/src/insserv/debian/source/format?rev=1045&op=file
==============================================================================
--- trunk/src/insserv/debian/source/format (added)
+++ trunk/src/insserv/debian/source/format Mon May 3 05:43:41 2010
@@ -1,0 +1,1 @@
+3.0 (quilt)
Modified: trunk/src/insserv/insserv.8.in
URL: http://svn.debian.org/wsvn/initscripts-ng/trunk/src/insserv/insserv.8.in?rev=1045&op=diff
==============================================================================
--- trunk/src/insserv/insserv.8.in (original)
+++ trunk/src/insserv/insserv.8.in Mon May 3 05:43:41 2010
@@ -1,22 +1,29 @@
.\"
-.\" Copyright 2000-2008 Werner Fink
+.\" Copyright 2000-2009 Werner Fink
.\" Copyright 2000-2003 SuSE GmbH Nuernberg, Germany
-.\" Copyright 2007 SuSE Linux Products GmbH Nuernberg, Germany
-.\" Copyright 2008 SuSE Linux Products GmbH Nuernberg, Germany
+.\" Copyright 2007-2009 SuSE Linux Products GmbH Nuernberg, Germany
+.\" Copyright 2009 Petter Reinholdtsen
.\"
.\" This program is free software; you can redistribute it and/or modify
.\" it under the terms of the GNU General Public License as published by
.\" the Free Software Foundation; either version 2 of the License, or
.\" (at your option) any later version.
.\"
+.\" This program is distributed in the hope that it will be useful,
+.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
+.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+.\" GNU General Public License for more details.
+.\"
+.\" You should have received a copy of the GNU General Public License
+.\" along with this program; if not, write to the Free Software
+.\" Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+.\"
@@BEGIN_SUSE@@
.TH INSSERV 8 "Jul 29, 2008" "Version 1.11" "The SuSE boot concept"
.UC 8
-.OS SuSE Linux
@@ELSE_SUSE@@
.TH INSSERV 8 "Jul 29, 2008" "Version 1.11"
.UC 8
-.OS Debian
@@END_SUSE@@
.SH NAME
insserv \- Enable an installed system init script
@@ -34,11 +41,7 @@
.RB [ \-v ]
.RB [ \-c\ <config> ]
.RB [ \-p\ <path> ]
-@@BEGIN_SUSE@@
-.RI [[ / ] path/to/init.d/ ] script [ ,start=<lvl1> [ ,<lvl2>\ ... ]
-@@ELSE_SUSE@@
-.RI [[ / ] path/to/init.d/ ] script [ ,start=<lvl1> [ ,<lvl2>\ ... ] ,stop=<lvl1> [ ,<lvl2>\ ... ]]
-@@END_SUSE@@
+.RI [[ / ] path/to/init.d/ ] script [ ,start=<lvl1,lvl2,...>,stop=<lvl1,lvl2,...> ]
.PP
.B insserv
.RB [ \-v ]
@@ -76,6 +79,7 @@
# X-Stop-After: boot_facility_1 [ boot_facility_2 ...]
# Default-Start: run_level_1 [ run_level_2 ...]
# Default-Stop: run_level_1 [ run_level_2 ...]
+ # X-Interactive: true
# Short-Description: single_line_description
# Description: multiline_description
### END INIT INFO
@@ -117,13 +121,18 @@
these tags is stopped.
@@END_SUSE@@
.PP
+The optional X\-Interactive keyword implies that the script using this
+keyword should be started alone in a concurrent boot configuration
+because it interact with the user at the console. Only the value
+`true' is recogniced. All other are ignored.
+.PP
The optional
.B X\-Start\-Before
keyword implies that the script using this keyword
should be started
.B before
the specified service names.
-Wereas the optional
+Whereas the optional
.B X\-Stop\-After
keyword implies that the script using this keyword
should be stopped
@@ -139,6 +148,7 @@
@@ELSE_SUSE@@
directories.
@@END_SUSE@@
+@@BEGIN_SUSE@@
Known runlevels are:
.sp 1
.in +1l
@@ -150,15 +160,12 @@
\fB4\fR\ reserved for local use
\fB5\fR\ used for full multiuser with network and xdm
\fB6\fR\ used for System reboot
-@@BEGIN_SUSE@@
\fBS\fR\ used during boot into single user mode
\fBB\fR\ used during boot before any other runlevel
-@@ELSE_SUSE@@
- \fBS\fR\ used during boot before any other runlevel
-@@END_SUSE@@
-.fi
-.in -1l
-.sp 1
+.fi
+.in -1l
+.sp 1
+@@END_SUSE@@
.PP
.B insserv
scans for
@@ -195,7 +202,7 @@
# System logger is operational
$syslog syslog
- # All network daemons are running
+ # All network daemons are running (This was removed in LSB 1.2)
$netdaemons portmap inetd
# Services which need to be interactive
@@ -215,9 +222,21 @@
is the only know keyword for marking a service
as an interactive one, e.g. a service which requires
a passphrase or password input during boot
-or runlevel change.
+or runlevel change. The special facility
+.B $null
+is used to enforce an empty dependency in case of
+.B Should-Stop
+and
+@@BEGIN_SUSE@@
+.B Required-Stop
+otherwise insserv assumes the same dependencies as for the
+.B Start
+case.
+@@ELSE_SUSE@@
+.BR Required-Stop .
+@@END_SUSE@@
.P
-Beside the defined
+In addition to the defined
.B System Facilities
in the configuration file
.IR /etc/insserv.conf ,
@@ -225,8 +244,9 @@
also knows the special facility
.BR $all .
This facility indicates that a service should be inserted
-at the end of all services. Clearly all services using
-this facility will be grouped into one starting order.
+at the end of all services at starting and at the very begining
+at stopping. Clearly all services using this facility will be
+grouped into one starting or stopping order.
.\"
.SH OPTIONS
Currently there exists nine options for
@@ -240,8 +260,8 @@
directory. Useful for testing.
.TP
.BR \-o\ <path> ,\ \-\-override\ <path>
-Path to replace existing LSB comment headers with the comment
-headers found in this path (default path is
+LSB comment headers found in this path will override existing
+LSB comment headers of scripts in the init.d directory (default path is
.IR /etc/insserv/overrides/ ).
.TP
.BR \-p\ <path> ,\ \-\-path\ <path>
@@ -254,11 +274,17 @@
Remove the listed scripts from all runlevels.
.TP
.BR \-d ,\ \-\-default
-Use default runlevels a defined in the scripts.
+Use default runlevels as defined in the scripts.
This may restore an edited runlevel link scheme.
.TP
.BR \-f ,\ \-\-force
-Ignore if a required service is missed.
+Ignore if a required service is missed. Beside this if start and or
+stop levels are specified on the command line the default levels of
+the script will be ignored.
+.TP
+.BR \-u\ <path> ,\ \-\-upstart-job\ <path>
+Path to replace existing upstart job path. (default path is
+.IR /lib/init/upstart-job ).
.TP
.BR \-h ,\ \-\-help
Print out short usage message.
@@ -297,22 +323,17 @@
For the runlevels the information found in
the script is used.
.TP
-.RI [[ / ] path/to/init.d/ ] script [ ,start=<lvl1> [ ,<lvl2> ]]\ ...
+.RI [[ / ] path/to/init.d/ ] script [ ,start=<lvl1,lvl2,...> ]
List of scripts which have to be added to
the specified runlevels to be started with.
You may use this extension to override the default values
for start and stop runlevels of the script.
Note that
-.BR <lvl1> ,\ <lvl2> ,\ ...
+.BR lvl1 ,\ lvl2 ,\ ...
are the known runlevels explained above.
The extension
-.IR ,stop=<lvl1> [ ,<lvl2> ]]
-is possible
-@@BEGIN_SUSE@@
-is possible but ignored on SuSE Linux.
-@@ELSE_SUSE@@
+.IR ,stop=<lvl1,lvl2,...>
is also possible.
-@@END_SUSE@@
.TP
.RI \fB\-r\fR\ [[ / ] path/to/init.d/ ] script\ ...
List of scripts which should be removed from
@@ -324,15 +345,25 @@
.\"
.SH OVERRIDES
Beside using the extensions
-.IR ,start=<lvl1> [ ,<lvl2> ]]
+.IR ,start=<lvl1,lvl2,...>
and
-.IR ,stop=<lvl1> [ ,<lvl2> ]]
+.IR ,stop=<lvl1,lvl2,...>
it is possible to use override files replace a LSB comment header
or simple provide a missing LSB comment header. This can be done
by placing a file with the new LSB comment header using the same
name as the boot or init script in the directory
.IR /etc/insserv/overrides/ .
-.\"
+For third party boot scripts without LSB header it is possible to
+add a file with the same name in the directory
+.I /usr/share/insserv/overrides/
+to make them completely LSB compliant.
+.\"
+.SH UPSTART JOB COMPATIBILITY
+To allow upstart jobs to work as init.d scripts, insserv will
+recognize a symlink from path/to/init.d/script to
+/lib/init/upstart-job as upstart jobs, and instead of reading the
+header from the file will run the script with the argument lsb-header
+to get the script header.
.SH EXIT CODES
The exit codes have the following conditions:
.RS 7
@@ -379,7 +410,9 @@
.sp 1
will be ignored.
.SH BUGS
-Boot script sometimes misses comments.
+Boot scripts sometimes lack a LSB comment header. Contact a package
+maintainer or developer of the software which provides the script to
+have a LSB comment header added to it.
.SH FILES
.TP
.I /etc/insserv.conf
@@ -418,7 +451,6 @@
with the help of
.BR startpar (8).
.in -7
-
.\"
.SH SEE ALSO
@@BEGIN_SUSE@@
@@ -432,12 +464,16 @@
@@END_SUSE@@
.BR startpar (8).
.SH COPYRIGHT
-2000\-2008 Werner Fink,
+2000\-2009 Werner Fink,
+.br
+2009 SuSE Linux Products GmbH Nuernberg, Germany.
.br
2000\-2003 SuSE GmbH Nuernberg, Germany,
.br
-2007 SuSE Linux Products GmbH Nuernberg, Germany.
-.br
-2008 SuSE Linux Products GmbH Nuernberg, Germany.
+2007\-2009 SuSE Linux Products GmbH Nuernberg, Germany.
.SH AUTHOR
Werner Fink <feedback at suse.de>
+.SH CONTRIBUTORS
+Petter Reinholdtsen
+.br
+Kel Modderman
Modified: trunk/src/insserv/insserv.c
URL: http://svn.debian.org/wsvn/initscripts-ng/trunk/src/insserv/insserv.c?rev=1045&op=diff
==============================================================================
--- trunk/src/insserv/insserv.c (original)
+++ trunk/src/insserv/insserv.c Mon May 3 05:43:41 2010
@@ -1,16 +1,26 @@
/*
* insserv(.c)
*
- * Copyright 2000-2008 Werner Fink, 2000 SuSE GmbH Nuernberg, Germany,
+ * Copyright 2000-2009 Werner Fink, 2000 SuSE GmbH Nuernberg, Germany,
* 2003 SuSE Linux AG, Germany.
* 2004 SuSE LINUX AG, Germany.
- * 2005-2008 SUSE LINUX Products GmbH, Germany.
- * Copyright 2005,2008 Petter Reinholdtsen
+ * 2005-2009 SUSE LINUX Products GmbH, Germany.
+ * Copyright 2005,2008,2009 Petter Reinholdtsen
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
*/
#define MINIMAL_MAKE 1 /* Remove disabled scripts from .depend.boot,
@@ -38,7 +48,24 @@
# include <rpm/rpmlib.h>
# include <rpm/rpmmacro.h>
#endif /* USE_RPMLIB */
+#ifdef SUSE
+# include <sys/mount.h>
+#endif /* SUSE */
#include "listing.h"
+
+#if defined _XOPEN_SOURCE && (_XOPEN_SOURCE - 0) >= 600
+# ifndef POSIX_FADV_SEQUENTIAL
+# define posix_fadvise(fd, off, len, adv) (-1)
+# endif
+#endif
+
+#ifndef PATH_MAX
+# ifdef MAXPATHLEN
+# define PATH_MAX MAXPATHLEN
+# else
+# define PATH_MAX 2048
+# endif
+#endif
#ifdef SUSE
# define DEFAULT_START_LVL "3 5"
@@ -69,6 +96,8 @@
#ifndef INSCONF
# define INSCONF "/etc/insserv.conf"
#endif
+
+const char *upstartjob_path = "/lib/init/upstart-job";
/*
* For a description of regular expressions see regex(7).
@@ -97,6 +126,7 @@
#define DEFAULT_START DEFAULT START VALUE
#define DEFAULT_STOP DEFAULT STOP VALUE
#define DESCRIPTION COMM "description" VALUE
+#define INTERACTIVE COMM "(x[-_]+[a-z0-9_-]*)?interactive" VALUE
/* System facility search within /etc/insserv.conf */
#define EQSIGN "([[:blank:]]*[=:][[:blank:]]*|[[:blank:]]+)"
@@ -111,8 +141,8 @@
/* The main line buffer if unique */
static char buf[LINE_MAX];
-/* When to be verbose */
-static boolean verbose = false;
+/* When to be verbose, and what level of verbosity */
+static int verbose = 0;
/* When to be verbose */
static boolean dryrun = false;
@@ -133,6 +163,7 @@
char *default_start;
char *default_stop;
char *description;
+ char *interactive;
} attribute((aligned(sizeof(char*)))) lsb_t;
/* Search results points here */
@@ -147,6 +178,7 @@
regex_t def_start;
regex_t def_stop;
regex_t desc;
+ regex_t interact;
} attribute((aligned(sizeof(regex_t)))) reg_t;
typedef struct creg_struct {
@@ -217,6 +249,7 @@
typedef struct repl {
list_t r_list;
string_t r[1];
+ ushort flags;
} __align repl_t;
#define getrepl(arg) list_entry((arg), struct repl, r_list)
@@ -290,8 +323,13 @@
requires(here, need, type);
break;
case '$':
+ if (strcasecmp(token, "$null") == 0)
+ break;
if (strcasecmp(token, "$all") == 0) {
- serv->attr.flags |= SERV_ALL;
+ if (bit & REQ_KILL)
+ serv->attr.flags |= SERV_FIRST;
+ else
+ serv->attr.flags |= SERV_ALL;
break;
}
/* Expand the `$' token recursively down */
@@ -614,7 +652,8 @@
/*
* Last but not least the `$all' scripts will be set to the
- * end of the current start order.
+ * beginning of the future stop order respectivly to the
+ * end of the future start order.
*/
static inline void all_script(void) attribute((always_inline));
static inline void all_script(void)
@@ -624,49 +663,67 @@
list_for_each(pos, s_start) {
service_t * serv = getservice(pos);
list_t * tmp;
- int neworder;
if (serv->attr.flags & SERV_DUPLET)
continue; /* Duplet */
- if (!(serv->attr.flags & SERV_ALL))
+ if (!(serv->attr.flags & SERV_FIRST))
continue;
if (serv->attr.script == (char*)0)
continue;
- neworder = 0;
list_for_each(tmp, s_start) {
service_t * cur = getservice(tmp);
if (cur->attr.flags & SERV_DUPLET)
continue; /* Duplet */
+ if ((serv->stopp->lvl & cur->stopp->lvl) == 0)
+ continue;
+
+ if (cur == serv)
+ continue;
+
+ if (cur->attr.flags & SERV_FIRST)
+ continue;
+
+ rememberreq(serv, REQ_SHLD|REQ_KILL, cur->name);
+ }
+
+ setorder(serv->attr.script, 'K', 1, false);
+ }
+
+ list_for_each(pos, s_start) {
+ service_t * serv = getservice(pos);
+ list_t * tmp;
+
+ if (serv->attr.flags & SERV_DUPLET)
+ continue; /* Duplet */
+
+ if (!(serv->attr.flags & SERV_ALL))
+ continue;
+
+ if (serv->attr.script == (char*)0)
+ continue;
+
+ list_for_each(tmp, s_start) {
+ service_t * cur = getservice(tmp);
+
+ if (cur->attr.flags & SERV_DUPLET)
+ continue; /* Duplet */
+
if ((serv->start->lvl & cur->start->lvl) == 0)
continue;
- if (cur->attr.script == (char*)0)
- continue;
-
if (cur == serv)
continue;
if (cur->attr.flags & SERV_ALL)
continue;
- cur->attr.sorder = getorder(cur->attr.script, 'S');
-
- if (cur->attr.sorder > neworder)
- neworder = cur->attr.sorder;
- }
- neworder++;
-
- if (neworder > MAX_DEEP)
- neworder = maxstart;
- else if (neworder > maxstart)
- maxstart = neworder;
-
- setorder(serv->attr.script, 'S', neworder, false);
+ rememberreq(serv, REQ_SHLD, cur->name);
+ }
}
}
@@ -685,9 +742,9 @@
if (dryrun) {
#ifdef USE_KILL_IN_BOOT
- info("dryrun, not creating .depend.boot, .depend.start, .depend.halt, and .depend.stop\n");
+ info(1, "dryrun, not creating .depend.boot, .depend.start, .depend.halt, and .depend.stop\n");
#else /* not USE_KILL_IN_BOOT */
- info("dryrun, not creating .depend.boot, .depend.start, and .depend.stop\n");
+ info(1, "dryrun, not creating .depend.boot, .depend.start, and .depend.stop\n");
#endif /* not USE_KILL_IN_BOOT */
return;
}
@@ -702,8 +759,8 @@
return;
}
- info("creating .depend.boot\n");
- info("creating .depend.start\n");
+ info(1, "creating .depend.boot\n");
+ info(1, "creating .depend.start\n");
lsort('S'); /* Sort into start order, set new sorder */
@@ -771,85 +828,51 @@
continue;
#endif /* not MINIMAL_RULES */
- if (list_empty(&serv->sort.req))
- continue;
-
if (serv->start->lvl & LVL_BOOT)
out = boot;
else
out = start;
+ if (list_empty(&serv->sort.req))
+ continue;
+
mark = false;
- if (serv->attr.flags & SERV_ALL) {
- list_for_each(pos, s_start) {
- service_t * dep = getservice(pos);
- const char * name;
-
- if (!dep)
- continue;
-
- if (dep->attr.flags & SERV_DUPLET)
- continue; /* Duplet */
+
+ np_list_for_each(pos, &serv->sort.req) {
+ req_t * req = getreq(pos);
+ service_t * dep = req->serv;
+ const char * name;
+
+ if (!dep)
+ continue;
+
+ if (dep->attr.flags & SERV_DUPLET)
+ continue;
#if defined(MINIMAL_RULES) && (MINIMAL_RULES != 0)
- if (dep->attr.ref <= 0)
- continue;
+ if (dep->attr.ref <= 0)
+ continue;
#endif /* not MINIMAL_RULES */
- /*
- * No self dependcies or from the last
- */
- if (dep == serv || (dep->attr.flags & SERV_ALL))
- continue;
-
- if ((serv->start->lvl & dep->start->lvl) == 0)
- continue;
-
- if ((name = dep->attr.script) == (char*)0)
- continue;
-
- if (!mark) {
- fprintf(out, "%s:", target);
- mark = true;
- }
- fprintf(out, " %s", name);
- }
- } else {
- np_list_for_each(pos, &serv->sort.req) {
- req_t * req = getreq(pos);
- service_t * dep = req->serv;
- const char * name;
-
- if (!dep)
- continue;
-
- if (dep->attr.flags & SERV_DUPLET)
- continue;
-
-#if defined(MINIMAL_RULES) && (MINIMAL_RULES != 0)
- if (dep->attr.ref <= 0)
- continue;
-#endif /* not MINIMAL_RULES */
-
- /*
- * No self dependcies or from the last
- */
- if (dep == serv || (dep->attr.flags & SERV_ALL))
- continue;
-
- if ((serv->start->lvl & dep->start->lvl) == 0)
- continue;
-
- if ((name = dep->attr.script) == (char*)0)
- continue;
-
- if (!mark) {
- fprintf(out, "%s:", target);
- mark = true;
- }
- fprintf(out, " %s", name);
- }
- }
+ /*
+ * No self dependcies or from the last
+ */
+ if (dep == serv || (dep->attr.flags & SERV_ALL))
+ continue;
+
+ if ((serv->start->lvl & dep->start->lvl) == 0)
+ continue;
+
+ if ((name = dep->attr.script) == (char*)0)
+ continue;
+
+ if (!mark) {
+ fprintf(out, "%s:", target);
+ mark = true;
+ }
+ fprintf(out, " %s", name);
+ }
+
if (mark) fputc('\n', out);
}
@@ -868,9 +891,9 @@
return;
}
- info("creating .depend.halt\n");
+ info(1, "creating .depend.halt\n");
#endif /* USE_KILL_IN_BOOT */
- info("creating .depend.stop\n");
+ info(1, "creating .depend.stop\n");
lsort('K'); /* Sort into stop order, set new korder */
@@ -1008,9 +1031,9 @@
/*
* Print message when verbose is enabled
*/
-void info(const char *fmt, ...) {
+void info(int level, const char *fmt, ...) {
va_list ap;
- if (!verbose)
+ if (level > verbose)
goto out;
va_start(ap, fmt);
_logger(fmt, ap);
@@ -1056,7 +1079,7 @@
if (stat(rcpath, &st) < 0) {
if (errno == ENOENT) {
- info("creating directory '%s'\n", rcpath);
+ info(1, "creating directory '%s'\n", rcpath);
if (!dryrun)
mkdir(rcpath, (S_IRWXU|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH));
} else
@@ -1132,6 +1155,7 @@
regcompiler(®.def_start, DEFAULT_START, REG_EXTENDED|REG_ICASE|REG_NEWLINE);
regcompiler(®.def_stop, DEFAULT_STOP, REG_EXTENDED|REG_ICASE|REG_NEWLINE);
regcompiler(®.desc, DESCRIPTION, REG_EXTENDED|REG_ICASE|REG_NEWLINE);
+ regcompiler(®.interact, INTERACTIVE, REG_EXTENDED|REG_ICASE|REG_NEWLINE);
}
static inline void scan_script_reset(void) attribute((always_inline));
@@ -1147,11 +1171,79 @@
xreset(script_inf.default_start);
xreset(script_inf.default_stop);
xreset(script_inf.description);
+ xreset(script_inf.interactive);
+}
+
+/*
+ * return name of upstart job if the script is a symlink to
+ * /lib/init/upstart-job, or NULL if path do not point to an
+ * upstart job.
+ */
+static char *is_upstart_job(const char *path)
+{
+ uint deep = 0;
+ char buf[PATH_MAX+1];
+ char *script = xstrdup(path);
+ char *retval = basename(path); /* GNU basename */
+
+ buf[PATH_MAX] = '\0';
+
+ do {
+ struct stat statbuf;
+ int len;
+
+ if (deep++ > MAXSYMLINKS) {
+ errno = ELOOP;
+ warn("Can not determine upstart job name for %s: %s\n", path, strerror(errno));
+ break;
+ }
+
+ if (lstat(script, &statbuf) < 0) {
+ warn("Can not stat %s: %s\n", path, strerror(errno));
+ break;
+ }
+
+ if (!S_ISLNK(statbuf.st_mode))
+ break;
+
+ if ((len = readlink(script, buf, sizeof(buf)-1)) < 0)
+ break;
+ buf[len] = '\0';
+
+ if (buf[0] != '/') { /* restore relative links */
+ const char *lastslash;
+
+ if ((lastslash = strrchr(script, '/'))) {
+ size_t dirlen = lastslash - script + 1;
+
+ if (dirlen + len > PATH_MAX)
+ len = PATH_MAX - dirlen;
+
+ memmove(&buf[dirlen], &buf[0], len + 1);
+ memcpy(&buf[0], script, dirlen);
+ }
+ }
+
+ free(script);
+
+ if (strcmp(buf, upstartjob_path) == 0) {
+ info(2, "script '%s' is upstart job\n", retval);
+ return strdup(retval);
+ }
+
+ script = xstrdup(buf);
+
+ } while (1);
+
+ free(script);
+
+ return (char*)0;
}
#define FOUND_LSB_HEADER 0x01
#define FOUND_LSB_DEFAULT 0x02
#define FOUND_LSB_OVERRIDE 0x04
+#define FOUND_LSB_UPSTART 0x08
static int o_flags = O_RDONLY;
@@ -1161,11 +1253,12 @@
const boolean cache, const boolean ignore)
{
regmatch_t subloc[SUBNUM_SHD+1], *val = &subloc[SUBNUM-1], *shl = &subloc[SUBNUM_SHD-1];
+ char *upstart_job = (char*)0;
char *begin = (char*)0, *end = (char*)0;
char *pbuf = buf;
FILE *script;
uchar ret = 0;
- int fd;
+ int fd = -1;
#define provides script_inf.provides
#define required_start script_inf.required_start
@@ -1177,15 +1270,27 @@
#define default_start script_inf.default_start
#define default_stop script_inf.default_stop
#define description script_inf.description
-
- info("Loading %s\n", path);
-
- if ((fd = xopen(dfd, path, o_flags)) < 0 || (script = fdopen(fd, "r")) == (FILE*)0)
- error("fopen(%s): %s\n", path, strerror(errno));
+#define interactive script_inf.interactive
+
+ info(2, "Loading %s\n", path);
+
+ if (NULL != (upstart_job = is_upstart_job(path))) {
+ char cmd[PATH_MAX];
+ int len;
+ len = snprintf(cmd, sizeof(cmd), "%s %s lsb-header", upstartjob_path, upstart_job);
+ if (len < 0 || sizeof(cmd) == len)
+ error("snprintf: insufficient buffer for %s\n", path);
+ if ((script = popen(cmd, "r")) == (FILE*)0)
+ error("popen(%s): %s\n", path, strerror(errno));
+ ret |= FOUND_LSB_UPSTART;
+ } else {
+ if ((fd = xopen(dfd, path, o_flags)) < 0 || (script = fdopen(fd, "r")) == (FILE*)0)
+ error("fopen(%s): %s\n", path, strerror(errno));
#if defined _XOPEN_SOURCE && (_XOPEN_SOURCE - 0) >= 600
- (void)posix_fadvise(fd, 0, 0, POSIX_FADV_SEQUENTIAL);
+ (void)posix_fadvise(fd, 0, 0, POSIX_FADV_SEQUENTIAL);
#endif
+ }
#define COMMON_ARGS buf, SUBNUM, subloc, 0
#define COMMON_SHD_ARGS buf, SUBNUM_SHD, subloc, 0
@@ -1273,6 +1378,14 @@
description = empty;
}
+ if (!interactive && regexecutor(®.interact, COMMON_ARGS) == true) {
+ if (val->rm_so < val->rm_eo) {
+ *(pbuf+val->rm_eo) = '\0';
+ interactive = xstrdup(pbuf+val->rm_so);
+ } else
+ interactive = empty;
+ }
+
/* Skip scanning below from LSB magic end */
if ((end = strstr(buf, "### END INIT INFO")))
break;
@@ -1280,16 +1393,21 @@
#undef COMMON_ARGS
#undef COMMON_SHD_ARGS
+ if (upstart_job) {
+ pclose(script);
+ free(upstart_job);
+ upstart_job = 0;
+ } else {
#if defined _XOPEN_SOURCE && (_XOPEN_SOURCE - 0) >= 600
- if (cache) {
- off_t deep = ftello(script);
- (void)posix_fadvise(fd, 0, deep, POSIX_FADV_WILLNEED);
- (void)posix_fadvise(fd, deep, 0, POSIX_FADV_DONTNEED);
- } else
- (void)posix_fadvise(fd, 0, 0, POSIX_FADV_NOREUSE);
+ if (cache) {
+ off_t deep = ftello(script);
+ (void)posix_fadvise(fd, 0, deep, POSIX_FADV_WILLNEED);
+ (void)posix_fadvise(fd, deep, 0, POSIX_FADV_DONTNEED);
+ } else
+ (void)posix_fadvise(fd, 0, 0, POSIX_FADV_NOREUSE);
#endif
-
- fclose(script);
+ fclose(script);
+ }
if (begin && end)
ret |= FOUND_LSB_HEADER;
@@ -1341,6 +1459,7 @@
#undef default_start
#undef default_stop
#undef description
+#undef interactive
return ret;
}
@@ -1472,6 +1591,12 @@
/* Replace with headers from the script itself */
ret |= scan_lsb_headers(dfd, path, cache, ignore);
+ /* Do not override the upstarts defaults, if we allow this
+ * we have to change name to the link name otherwise the
+ * name is always "upstart-job" */
+ if (ret & FOUND_LSB_UPSTART)
+ goto out;
+
/* Load values if the override file exist */
if ((ret & FOUND_LSB_HEADER) == 0)
ret |= load_overrides("/usr/share/insserv/overrides", name, cache, ignore);
@@ -1483,9 +1608,7 @@
* init.d scripts
*/
ret |= load_overrides(override_path, name, cache, ignore);
-#ifdef SUSE
out:
-#endif /* SUSE */
free(name);
return ret;
}
@@ -1503,6 +1626,7 @@
regfree(®.def_start);
regfree(®.def_stop);
regfree(®.desc);
+ regfree(®.interact);
}
static struct {
@@ -1696,6 +1820,11 @@
}
lsb = scan_script_defaults(dfd, d->d_name, override_path, &name, true, ignore);
+ if (!name) {
+ warn("warning: script is corrupt or invalid: %s/%s%s\n", path, rcd, d->d_name);
+ continue;
+ }
+
if (!script_inf.provides || script_inf.provides == empty)
script_inf.provides = xstrdup(ptr);
@@ -1776,6 +1905,9 @@
if (script_inf.stop_after && script_inf.stop_after != empty) {
reversereq(service, REQ_SHLD|REQ_KILL, script_inf.stop_after);
}
+ if (script_inf.interactive && 0 == strcmp(script_inf.interactive, "true")) {
+ service->attr.flags |= SERV_INTRACT;
+ }
}
if (name)
@@ -1801,7 +1933,7 @@
regmatch_t subloc[SUBCONFNUM], *val = (regmatch_t*)0;
FILE *conf;
- info("Loading %s\n", file);
+ info(2, "Loading %s\n", file);
do {
const char * fptr = file;
@@ -1849,6 +1981,7 @@
if (posix_memalign((void*)&subst, sizeof(void*), alignof(repl_t)) != 0)
error("%s", strerror(errno));
insert(&subst->r_list, r_list->prev);
+ subst->flags = 0;
r = &subst->r[0];
if (posix_memalign((void*)&r->ref, sizeof(void*), alignof(typeof(r->ref))+strsize(token)) != 0)
error("%s", strerror(errno));
@@ -1877,6 +2010,7 @@
if (posix_memalign((void*)&subst, sizeof(void*), alignof(repl_t)) != 0)
error("%s", strerror(errno));
insert(&subst->r_list, r_list->prev);
+ subst->flags = 0;
r = &subst->r[0];
if (posix_memalign((void*)&r->ref, sizeof(void*), alignof(typeof(r->ref))+strsize(token)) != 0)
error("%s", strerror(errno));
@@ -2028,33 +2162,32 @@
goto out;
}
- if ((*deep)++ > 10) {
- warn("The nested level of the system facilities in the insserv.conf file(s) is to large\n");
- goto out;
- }
-
list_for_each_safe(tmp, safe, ptr) {
repl_t * rnxt = getrepl(tmp);
+ if (rnxt->flags & 0x0001) {
+ error("Loop detected during expanding system facilities in the insserv.conf file(s): %s\n",
+ rnxt->r[0].name);
+ }
if (*rnxt->r[0].name == '$') {
+ if (*deep > 10) {
+ warn("The nested level of the system facilities in the insserv.conf file(s) is to large\n");
+ goto out;
+ }
+ (*deep)++;
+ rnxt->flags |= 0x0001;
expand_faci(tmp, head, deep);
- } else {
- if (*deep == 1) {
- if (--(*rent->r[0].ref) <= 0)
- free(rent->r[0].ref);
- rent->r[0] = rnxt->r[0];
- ++(*rent->r[0].ref);
- } else {
- repl_t *restrict subst;
- if (posix_memalign((void*)&subst, sizeof(void*), alignof(repl_t)) != 0)
- error("%s", strerror(errno));
- insert(&subst->r_list, head);
- subst->r[0] = rnxt->r[0];
- ++(*subst->r[0].ref);
- }
+ rnxt->flags &= ~0x0001;
+ (*deep)--;
+ } else if (*deep > 0) {
+ repl_t *restrict subst;
+ if (posix_memalign((void*)&subst, sizeof(void*), alignof(repl_t)) != 0)
+ error("%s", strerror(errno));
+ insert(&subst->r_list, head->prev);
+ subst->r[0] = rnxt->r[0];
+ (*subst->r[0].ref) = 1;
}
}
out:
- (*deep)--;
return;
}
@@ -2064,9 +2197,12 @@
list_for_each(ptr, sysfaci_start) {
list_t * rlist, * safe, * head = &getfaci(ptr)->replace;
list_for_each_safe(rlist, safe, head) {
- if (*getrepl(rlist)->r[0].name == '$') {
+ repl_t * tmp = getrepl(rlist);
+ if (*tmp->r[0].name == '$') {
int deep = 0;
+ tmp->flags |= 0x0001;
expand_faci(rlist, rlist, &deep);
+ tmp->flags &= ~0x0001;
}
}
}
@@ -2114,6 +2250,7 @@
static inline boolean underrpm(void)
{
boolean ret = false;
+ boolean mnt = true;
const pid_t pp = getppid();
char buf[PATH_MAX], *argv[3], *ptr;
# if defined(USE_RPMLIB) && (USE_RPMLIB > 0)
@@ -2123,8 +2260,15 @@
ssize_t len;
snprintf(buf, sizeof(buf)-1, "/proc/%lu/cmdline", (unsigned long)pp);
- if ((fd = open(buf, O_NOCTTY|O_RDONLY)) < 0)
- goto out;
+ do {
+ if ((fd = open(buf, O_NOCTTY|O_RDONLY)) >= 0)
+ break;
+ if (!mnt || (errno != ENOENT))
+ goto out;
+ if (mount("proc", "/proc", "proc", 0, NULL) < 0)
+ error ("underrpm() can not mount /proc: %s\n", strerror(errno));
+ mnt = false;
+ } while (1);
memset(buf, '\0', sizeof(buf));
if ((len = read(fd , buf, sizeof(buf)-1)) < 0)
@@ -2185,6 +2329,8 @@
out:
if (fd >= 0)
close(fd);
+ if (!mnt)
+ umount("/proc");
return ret;
}
@@ -2200,6 +2346,7 @@
{"force", 0, (int*)0, 'f'},
{"path", 1, (int*)0, 'p'},
{"override",1, (int*)0, 'o'},
+ {"upstart-job",1, (int*)0, 'u'},
{"help", 0, (int*)0, 'h'},
{ 0, 0, (int*)0, 0 },
};
@@ -2238,6 +2385,7 @@
boolean del = false;
boolean defaults = false;
boolean ignore = false;
+ boolean loadarg = false;
myname = basename(*argv);
@@ -2252,7 +2400,7 @@
for (c = 0; c < argc; c++)
argr[c] = (char*)0;
- while ((c = getopt_long(argc, argv, "c:dfrhvno:p:", long_options, (int *)0)) != -1) {
+ while ((c = getopt_long(argc, argv, "c:dfrhvno:p:u:", long_options, (int *)0)) != -1) {
size_t l;
switch (c) {
case 'c':
@@ -2271,10 +2419,10 @@
ignore = true;
break;
case 'v':
- verbose = true;
+ verbose ++;
break;
case 'n':
- verbose = true;
+ verbose ++;
dryrun = true;
break;
case 'p':
@@ -2292,6 +2440,11 @@
override_path = optarg;
set_override = true;
break;
+ case 'u':
+ if (optarg == (char*)0 || *optarg == '\0')
+ goto err;
+ upstartjob_path = optarg;
+ break;
case '?':
err:
error("For help use: %s -h\n", myname);
@@ -2305,7 +2458,9 @@
argv += optind;
argc -= optind;
- if (!argc && del)
+ if (argc)
+ loadarg = true;
+ else if (del)
error("usage: %s [[-r] init_script|init_directory]\n", myname);
if (*argv) {
@@ -2357,7 +2512,19 @@
if (strcmp(path, INITDIR) != 0) {
char * tmp;
- root = xstrdup(path);
+ if (*path != '/') {
+ char * pwd = getcwd((char*)0, 0);
+ size_t len = strlen(pwd)+1+strlen(path);
+ root = (char*)malloc(len);
+ if (!root)
+ error("%s", strerror(errno));
+ strcpy(root, pwd);
+ if (pwd[1])
+ strcat(root, "/");
+ strcat(root, path);
+ free(pwd);
+ } else
+ root = xstrdup(path);
if ((tmp = strstr(root, INITDIR))) {
*tmp = '\0';
} else {
@@ -2405,7 +2572,7 @@
scan_conf(insconf);
/*
- * Expand system facilities to real serivces
+ * Expand system facilities to real services
*/
expand_conf();
@@ -2490,33 +2657,99 @@
/*
* Scan now all scripts found in the init.d/ directory
*/
- while ((d = readdir(initdir)) != (struct dirent*)0) {
- const boolean isarg = chkfor(d->d_name, argv, argc);
+ for (;;) {
service_t * service = (service_t*)0;
char * token;
char * begin = (char*)0; /* hold start pointer of strings handled by strsep() */
boolean hard = false;
+ boolean isarg = false;
uchar lsb = 0;
#if defined(DEBUG) && (DEBUG > 0)
int nobug = 0;
#endif
+ if ((d = readdir(initdir)) == (struct dirent*)0) {
+ /*
+ * If first script in argument list was loaded in advance, then
+ * rewind the init.d/ directory stream and attempt to load all
+ * other scripts.
+ */
+ if (loadarg) {
+ loadarg = false;
+ rewinddir(initdir);
+ continue;
+ }
+ break;
+ }
+
+ isarg = chkfor(d->d_name, argv, argc);
+
+ /*
+ * Load first script in argument list before all other scripts. This
+ * avoids problems with loading scripts in underterministic sequence
+ * returned by readdir(3).
+ */
+ if (loadarg && !isarg)
+ continue;
+ if (loadarg && isarg && (curr_argc != 0))
+ continue;
+ if (!loadarg && isarg && (curr_argc == 0))
+ continue;
+
if (*d->d_name == '.')
continue;
errno = 0;
/* d_type seems not to work, therefore use (l)stat(2) */
- if (xstat(dfd, d->d_name, &st_script) < 0) {
+ if (xlstat(dfd, d->d_name, &st_script) < 0) {
warn("can not stat(%s)\n", d->d_name);
continue;
}
- if (!S_ISREG(st_script.st_mode) || !(S_IXUSR & st_script.st_mode))
+ if ((!S_ISREG(st_script.st_mode) && !S_ISLNK(st_script.st_mode)) ||
+ !(S_IXUSR & st_script.st_mode))
{
if (S_ISDIR(st_script.st_mode))
continue;
if (isarg)
warn("script %s is not an executable regular file, skipped!\n", d->d_name);
continue;
+ }
+
+ /*
+ * Do extra sanity checking of symlinks in init.d/ dir, except if it
+ * is named reboot, as that is a special case on SUSE
+ */
+ if (S_ISLNK(st_script.st_mode) && ((strcmp(d->d_name, "reboot") != 0)))
+ {
+ char * base;
+ char linkbuf[PATH_MAX+1];
+ int linklen;
+
+ linklen = xreadlink(dfd, d->d_name, linkbuf, sizeof(linkbuf)-1);
+ if (linklen < 0)
+ continue;
+ linkbuf[linklen] = '\0';
+
+ /* skip symbolic links to other scripts in this relative path */
+ if (!(base = strrchr(linkbuf, '/'))) {
+ if (isarg)
+ warn("script %s is a symlink to another script, skipped!\n",
+ d->d_name);
+ continue;
+ }
+
+ /* stat the symlink target and make sure it is a valid script */
+ if (xstat(dfd, d->d_name, &st_script) < 0)
+ continue;
+
+ if (!S_ISREG(st_script.st_mode) || !(S_IXUSR & st_script.st_mode)) {
+ if (S_ISDIR(st_script.st_mode))
+ continue;
+ if (isarg)
+ warn("script %s is not an executable regular file, skipped!\n",
+ d->d_name);
+ continue;
+ }
}
if (!strncmp(d->d_name, "README", strlen("README"))) {
@@ -2807,6 +3040,9 @@
if (script_inf.should_stop && script_inf.should_stop != empty) {
rememberreq(service, REQ_SHLD|REQ_KILL, script_inf.should_stop);
}
+ if (script_inf.interactive && 0 == strcmp(script_inf.interactive, "true")) {
+ service->attr.flags |= SERV_INTRACT;
+ }
}
if (script_inf.start_before && script_inf.start_before != empty) {
@@ -2985,16 +3221,17 @@
char * ptr = argr[curr_argc];
struct _mark {
const char * wrd;
+ const boolean sk;
char * order;
char ** str;
} mark[] = {
- {"start=", (char*)0, &script_inf.default_start},
- {"stop=", (char*)0, &script_inf.default_stop },
+ {"start=", true, (char*)0, &script_inf.default_start},
+ {"stop=", false, (char*)0, &script_inf.default_stop },
#if 0
- {"reqstart=", (char*)0, &script_inf.required_start},
- {"reqstop=", (char*)0, &script_inf.required_stop },
+ {"reqstart=", false, (char*)0, &script_inf.required_start},
+ {"reqstop=", false, (char*)0, &script_inf.required_stop },
#endif
- {(char*)0, (char*)0, (char**)0}
+ {(char*)0, false, (char*)0, (char**)0}
};
for (c = 0; mark[c].wrd; c++) {
@@ -3015,6 +3252,14 @@
if (len > 0) {
char * ptr = mark[c].order + len - 1;
if (*ptr == ',') *ptr = '\0';
+ }
+ if (ignore) {
+ service_t *arg = findservice(getprovides(d->d_name));
+ arg = getorig(arg);
+ if (mark[c].sk)
+ arg->start->lvl = 0;
+ else
+ arg->stopp->lvl = 0;
}
xreset(*(mark[c].str));
*(mark[c].str) = xstrdup(mark[c].order);
@@ -3094,22 +3339,22 @@
nonlsb_script();
/*
+ * Handle the `$all' scripts
+ */
+ all_script();
+
+ /*
* Now generate for all scripts the dependencies
*/
follow_all();
if (is_loop_detected() && !ignore)
- error("exiting without changing boot order!\n");
+ error("exiting now without changing boot order!\n");
/*
* Be sure that interactive scripts are the only member of
* a start group (for parallel start only).
*/
active_script();
-
- /*
- * Move the `$all' scripts to the end of all
- */
- all_script();
/*
* Sorry but we support only [KS][0-9][0-9]<name>
Modified: trunk/src/insserv/insserv.conf
URL: http://svn.debian.org/wsvn/initscripts-ng/trunk/src/insserv/insserv.conf?rev=1045&op=diff
==============================================================================
--- trunk/src/insserv/insserv.conf (original)
+++ trunk/src/insserv/insserv.conf Mon May 3 05:43:41 2010
@@ -1,12 +1,12 @@
#
# All local filesystems are mounted (done during boot phase)
#
-$local_fs boot.localfs
+$local_fs boot.localfs +boot.crypto
#
# Low level networking (ethernet card)
#
-$network network +pcmcia +hotplug
+$network network
#
# Named is operational
@@ -18,7 +18,7 @@
# be remote. Most applications that care will probably require
# both $local_fs and $remote_fs)
#
-$remote_fs $local_fs +nfs
+$remote_fs $local_fs +nfs +smbfs
#
# System logger is operational
@@ -38,4 +38,4 @@
#
# Services which need to be interactive
#
-<interactive> boot.crypto boot.localfs boot.rootfsck apache apache2 kdump
+<interactive> apache apache2 boot.clock boot.crypto boot.crypto-early boot.localfs boot.rootfsck kbd kdump ntp
Modified: trunk/src/insserv/listing.c
URL: http://svn.debian.org/wsvn/initscripts-ng/trunk/src/insserv/listing.c?rev=1045&op=diff
==============================================================================
--- trunk/src/insserv/listing.c (original)
+++ trunk/src/insserv/listing.c Mon May 3 05:43:41 2010
@@ -1,14 +1,24 @@
/*
* listing.c
*
- * Copyright 2000-2008 Werner Fink, 2000 SuSE GmbH Nuernberg, Germany,
+ * Copyright 2000-2009 Werner Fink, 2000 SuSE GmbH Nuernberg, Germany,
* 2003 SuSE Linux AG, Germany.
- * 2007-2008 SuSE Linux Products GmbH Nuernberg, Germany
+ * 2007-2009 SuSE Linux Products GmbH Nuernberg, Germany
*
* This source is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
*/
#include <string.h>
@@ -317,6 +327,7 @@
}
for (tmp = dir; tmp; tmp = getnextlink(l_list)) {
+ const typeof(attof(tmp)->flags) sflags = attof(tmp)->flags;
register boolean recursion = true;
handle_t * ptmp = (mode == 'K') ? &tmp->stopp : &tmp->start;
uchar * order = &ptmp->deep;
@@ -364,6 +375,7 @@
* Do not count the dependcy deep of the system facilities
* but follow them to count the replacing provides.
*/
+
if (*ptmp->name == '$')
warn("System facilities not fully expanded, see %s!\n", dir->name);
else if (++deep > MAX_DEEP) {
@@ -381,6 +393,7 @@
np_list_for_each(dent, l_list) {
dir_t * target = getlink(dent)->target;
handle_t * ptrg = (mode == 'K') ? &target->stopp : &target->start;
+ const typeof(attof(target)->flags) kflags = attof(target)->flags;
if ((peg->run.lvl & ptrg->run.lvl) == 0)
continue; /* Not same boot level */
@@ -396,6 +409,20 @@
loop_warn_two(pskp, ptmp, act);
recursion = false;
break; /* Loop detected, stop recursion */
+ }
+
+ if (mode == 'K') {
+ if (kflags & SERV_FIRST) {
+ warn("Stopping %s depends on %s and therefore on system facility `$all' which can not be true!\n",
+ tmp->script ? tmp->script : tmp->name, target->script ? target->script : target->name);
+ continue;
+ }
+ } else {
+ if (sflags & SERV_ALL) {
+ warn("Starting %s depends on %s and therefore on system facility `$all' which can not be true!\n",
+ target->script ? target->script : target->name, tmp->script ? tmp->script : tmp->name);
+ continue;
+ }
}
if (ptrg->deep >= deep) /* Nothing new */
@@ -841,7 +868,7 @@
list_for_each(tmp, d_start) {
maxorder = &maxstart;
guess_order(getdir(tmp), 'S');
- maxorder = &maxstart;
+ maxorder = &maxstop;
guess_order(getdir(tmp), 'K');
}
}
Modified: trunk/src/insserv/listing.h
URL: http://svn.debian.org/wsvn/initscripts-ng/trunk/src/insserv/listing.h?rev=1045&op=diff
==============================================================================
--- trunk/src/insserv/listing.h (original)
+++ trunk/src/insserv/listing.h Mon May 3 05:43:41 2010
@@ -1,13 +1,23 @@
/*
* listing.h
*
- * Copyright 2000,2008 Werner Fink, 2000 SuSE GmbH Nuernberg, Germany.
- * 2008 SuSE Linux Products GmbH Nuernberg, Germany
+ * Copyright 2000,2009 Werner Fink, 2000 SuSE GmbH Nuernberg, Germany.
+ * 2008,2009 SuSE Linux Products GmbH Nuernberg, Germany
*
* This source is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
*/
#include <stddef.h>
@@ -92,7 +102,7 @@
#endif
#define __packed attribute((packed))
-#define alignof(type) (sizeof(type)+(sizeof(type)%sizeof(void*)))
+#define alignof(type) ((sizeof(type)+(sizeof(void*)-1)) & ~(sizeof(void*)-1))
#define strsize(string) ((strlen(string)+1)*sizeof(char))
typedef struct list_struct {
@@ -283,7 +293,7 @@
extern const char *const delimeter;
extern void error(const char *restrict fmt, ...) attribute((noreturn,format(printf,1,2)));
extern void warn (const char *restrict fmt, ...) attribute((format(printf,1,2)));
-extern void info (const char *restrict fmt, ...) attribute((format(printf,1,2)));
+extern void info (int level, const char *restrict fmt, ...) attribute((format(printf,2,3)));
extern inline int map_has_runlevels(void) attribute((always_inline));
extern inline char map_runlevel_to_key(const int runlevel);
extern inline ushort map_key_to_lvl(const char key);
@@ -307,42 +317,42 @@
#define xreset(ptr) \
{char *restrict tmp = (char *restrict)ptr; if (ptr && *tmp) free(ptr);} ptr = NULL
-#if defined(HAS_unlinkat) && defined(_ATFILE_SOURCE)
+#if defined(HAS_unlinkat) && defined(_ATFILE_SOURCE) && !defined(__stub_unlinkat)
# define xremove(d,x) (__extension__ ({ if ((dryrun ? 0 : \
(unlinkat(d,x,0) != 0 && (errno != EISDIR || unlinkat(d,x,AT_REMOVEDIR) != 0)))) \
warn ("can not remove(%s%s): %s\n", rcd, x, strerror(errno)); \
else \
- info("remove service %s/%s%s\n", path, rcd, x); }))
+ info(1, "remove service %s/%s%s\n", path, rcd, x); }))
#else
# define xremove(d,x) (__extension__ ({ if ((dryrun ? 0 : (remove(x) != 0))) \
warn ("can not remove(%s%s): %s\n", rcd, x, strerror(errno)); \
else \
- info("remove service %s/%s%s\n", path, rcd, x); }))
-#endif
-#if defined(HAS_symlinkat) && defined(_ATFILE_SOURCE)
+ info(1, "remove service %s/%s%s\n", path, rcd, x); }))
+#endif
+#if defined(HAS_symlinkat) && defined(_ATFILE_SOURCE) && !defined(__stub_symlinkat)
# define xsymlink(d,x,y) (__extension__ ({ if ((dryrun ? 0 : (symlinkat(x, d, y) != 0))) \
warn ("can not symlink(%s, %s%s): %s\n", x, rcd, y, strerror(errno)); \
else \
- info("enable service %s -> %s/%s%s\n", x, path, rcd, y); }))
+ info(1, "enable service %s -> %s/%s%s\n", x, path, rcd, y); }))
#else
# define xsymlink(d,x,y) (__extension__ ({ if ((dryrun ? 0 : (symlink(x, y) != 0))) \
warn ("can not symlink(%s, %s%s): %s\n", x, rcd, y, strerror(errno)); \
else \
- info("enable service %s -> %s/%s%s\n", x, path, rcd, y); }))
-#endif
-#if defined(HAS_fstatat) && defined(_ATFILE_SOURCE)
+ info(1, "enable service %s -> %s/%s%s\n", x, path, rcd, y); }))
+#endif
+#if defined(HAS_fstatat) && defined(_ATFILE_SOURCE) && !defined(__stub_fstatat)
# define xstat(d,x,s) (__extension__ ({ fstatat(d,x,s, 0); }))
# define xlstat(d,x,s) (__extension__ ({ fstatat(d,x,s, AT_SYMLINK_NOFOLLOW); }))
#else
# define xstat(d,x,s) (__extension__ ({ stat(x,s); }))
# define xlstat(d,x,s) (__extension__ ({ lstat(x,s); }))
#endif
-#if defined(HAS_readlinkat) && defined(_ATFILE_SOURCE)
+#if defined(HAS_readlinkat) && defined(_ATFILE_SOURCE) && !defined(__stub_readlinkat)
# define xreadlink(d,x,b,l) (__extension__ ({ readlinkat(d,x,b,l); }))
#else
# define xreadlink(d,x,b,l) (__extension__ ({ readlink(x,b,l); }))
#endif
-#if defined(HAS_openat) && defined(_ATFILE_SOURCE)
+#if defined(HAS_openat) && defined(_ATFILE_SOURCE) && !defined(__stub_openat)
# define xopen(d,x,f) (__extension__ ({ openat(d,x,f); }))
#else
# define xopen(d,x,f) (__extension__ ({ open(x,f); }))
@@ -368,6 +378,7 @@
#define SERV_SCRIPT 0x0080
#define SERV_NOSTOP 0x0100
#define SERV_CMDLINE 0x0200
+#define SERV_FIRST 0x0400
/*
* Bits of the runlevels
Added: trunk/src/insserv/tests/common
URL: http://svn.debian.org/wsvn/initscripts-ng/trunk/src/insserv/tests/common?rev=1045&op=file
==============================================================================
--- trunk/src/insserv/tests/common (added)
+++ trunk/src/insserv/tests/common Mon May 3 05:43:41 2010
@@ -1,0 +1,110 @@
+#!/bin/bash
+
+basedir=$(dirname $0)
+. $basedir/suite
+
+##########################################################################
+test_simple_sequence() {
+echo
+echo "info: test simple script ordering."
+echo
+
+initdir_purge
+
+insertscript firstscript <<'EOF' || true
+### BEGIN INIT INFO
+# Provides: firstscript
+# Required-Start:
+# Required-Stop:
+# Default-Start: 2 3 4 5
+# Default-Stop:
+### END INIT INFO
+EOF
+
+insertscript middlescript <<'EOF' || true
+### BEGIN INIT INFO
+# Provides: middlescript
+# Required-Start: firstscript
+# Required-Stop: firstscript
+# Default-Start: 2 3 4 5
+# Default-Stop:
+### END INIT INFO
+EOF
+
+insertscript lastscript <<'EOF' || true
+### BEGIN INIT INFO
+# Provides: lastscript
+# Required-Start: middlescript
+# Required-Stop: middlescript
+# Default-Start: 2 3 4 5
+# Default-Stop:
+### END INIT INFO
+EOF
+
+list_rclinks
+
+check_script_present 2 firstscript
+check_script_present 3 firstscript
+check_script_present 4 firstscript
+check_script_present 5 firstscript
+check_order 3 firstscript middlescript
+check_order 3 middlescript lastscript
+}
+##########################################################################
+test_undetected_loop() {
+echo
+echo "info: test if loop involving virtual facility is detected."
+echo
+
+initdir_purge
+set +C
+cat <<'EOF' > $insconf
+$local_fs mountall
+EOF
+set -C
+
+insertscript hibernate <<EOF
+### BEGIN INIT INFO
+# Provides: hibernate-cleanup
+# Default-Start: 3
+# Default-Stop:
+# Required-Start:
+# Required-Stop:
+# Should-Start: udev devfsd raid2 mdadm lvm evms cryptdisks
+# X-Start-Before: mountall
+### END INIT INFO
+EOF
+
+insertscript mountall.sh <<EOF
+### BEGIN INIT INFO
+# Provides: mountall
+# Required-Start:
+# Required-Stop:
+# Default-Start: 3
+# Default-Stop:
+# Short-Description: Mount all filesystems.
+### END INIT INFO
+EOF
+
+# This should fail, as it introduce a loop
+if insertscript mdadm <<'EOF' ; then
+### BEGIN INIT INFO
+# Provides: mdadm
+# Required-Start: $local_fs
+# Required-Stop: $local_fs
+# Default-Start: 3
+# Default-Stop:
+### END INIT INFO
+EOF
+ counttest
+ error "Able to insert mdadm even though it introduce a loop"
+fi
+echo insserv.conf:
+cat $insconf
+list_rclinks
+check_order 3 hibernate mountall.sh
+}
+##########################################################################
+
+test_simple_sequence
+test_undetected_loop
Propchange: trunk/src/insserv/tests/common
------------------------------------------------------------------------------
svn:executable = *
Modified: trunk/src/insserv/tests/suite
URL: http://svn.debian.org/wsvn/initscripts-ng/trunk/src/insserv/tests/suite?rev=1045&op=diff
==============================================================================
--- trunk/src/insserv/tests/suite (original)
+++ trunk/src/insserv/tests/suite Mon May 3 05:43:41 2010
@@ -79,6 +79,22 @@
$time hwclock
<interactive> udev mountdevsubfs checkroot checkfs console-screen
EOF
+ update_conf ()
+ {
+ set +C
+ cat <<-'EOF' > $insconf
+ $local_fs +mountall +umountfs
+ $network +networking +ifupdown
+ $named +named +dnsmasq +lwresd +bind9 $network
+ $remote_fs $local_fs +mountnfs +mountnfs-bootclean +umountnfs +sendsigs
+ $syslog +syslog +sysklogd
+ $portmap portmap
+ $time hwclock
+ <interactive> udev mountdevsubfs checkroot checkfs console-screen
+ EOF
+ set -C
+ }
+
fi
chmod u+w,a+r $insconf
@@ -92,6 +108,12 @@
{
script=$(printf "${initddir}/%s\n" ${1+"$@"})
$insserv $debug -c $insconf -p $initddir -o $overridedir -r $script
+}
+
+initdir_purge ()
+{
+ rm -rf ${initddir}/../rc*.d ${initddir}
+ mkdir -p ${initddir}
}
relpath ()
@@ -201,6 +223,13 @@
chmod u+w,a+rx $script
}
+remscript ()
+{
+ local scriptname=$1
+ local script=${initddir}/$scriptname
+ rm -f $script
+}
+
insertscript ()
{
local scriptname=$1
@@ -212,8 +241,12 @@
{
local rcdpath=$(runlevel_path $1); shift
local script=$1; shift
- local ret=0
- test -L ${rcdpath}/[KS][0-9][0-9]$script || ret=1
+ local ret=1
+ for f in ${rcdpath}/[KS][0-9][0-9]$script ; do
+ if [ -L $f ] ; then
+ ret=0
+ fi
+ done
counttest
return $ret
}
More information about the Initscripts-ng-commits
mailing list