Codebase list insserv / 32fc555
Import Debian changes 1.09.0-1 insserv (1.09.0-1) unstable; urgency=low * New upstream release. (Closes: #426091) - Support X-Start-Before and X-Stop-After (Closes: #326120) - Building with DEB_BUILD_OPTIONS=nostrip no longer strip the binary. (Closes: #437210) * Let /usr/share/insserv/check-initd-order read override files in /etc/insserv/overrides/ just like insserv does. Patch from Arjan Oosting. (Closes: #429398) * Correct the dependencies for nbd-client and libnss-ldap. * Add override file for spamassassin. * Update watch file with new upstream URL. (Closes: #450044) Petter Reinholdtsen authored 16 years ago Dmitry Bogatov committed 5 years ago
27 changed file(s) with 511 addition(s) and 418 deletion(s). Raw diff Collapse all Expand all
0 -------------------------------------------------------------------
1 Tue Jan 16 14:04:06 CET 2007 - werner@suse.de
2
3 - Remove obsolate `$netdaemons' facility (#209380)
4 - Add `start this script before' feature (fate #301269)
5
6 -------------------------------------------------------------------
7 Mon Nov 20 11:42:40 CET 2006 - werner@suse.de
8
9 - Expand aliases even for services which requires $all (#216202)
10
11 -------------------------------------------------------------------
12 Mon May 15 12:56:27 CEST 2006 - werner@suse.de
13
14 - Make kdump boot script a interactive script to enforce that this
15 script runs not in parallel with other script (#175340, #171332)
16
17 -------------------------------------------------------------------
18 Wed Mar 8 17:06:47 CET 2006 - werner@suse.de
19
20 - Ignore .orig and .org file (bug #155944)
21
22 -------------------------------------------------------------------
23 Wed Mar 1 12:51:17 CET 2006 - werner@suse.de
24
25 - Add a few lines about $all into the man page (bug #151561)
26
27 -------------------------------------------------------------------
28 Mon Feb 6 16:40:46 CET 2006 - werner@suse.de
29
30 - Handle duplets even for interactive scripts
31
32 -------------------------------------------------------------------
33 Tue Jan 31 15:06:53 CET 2006 - werner@suse.de
34
35 - Be sure to find all interactive scripts and set their unique
36 start number. This solves the problem of two interactive
37 scripts in the same start order.
38
39 -------------------------------------------------------------------
40 Tue Apr 4 18:23:24 CEST 2006 - werner@suse.de
41
42 - Add patches from Petter Reinholdtsen
43 - Make debian part work
44
045 -------------------------------------------------------------------
146 Wed Jan 25 14:52:26 CET 2006 - werner@suse.de
247
1212 DEBUG =
1313 ISSUSE = -DSUSE
1414 DESTDIR =
15 VERSION = 1.08.0
15 VERSION = 1.09.0
1616 DATE = $(shell date +'%d%b%y' | tr '[:lower:]' '[:upper:]')
1717
1818 #
3838 RM = rm -f
3939 MKDIR = mkdir -p
4040 RMDIR = rm -rf
41 INSTBINFLAGS = -s -m 0700
41 INSTBINFLAGS = -m 0700
4242 INSTBIN = install $(INSTBINFLAGS)
4343 INSTSRPFLAGS = -m 0700
4444 INSTSRP = install $(INSTSRPFLAGS)
0 insserv (1.09.0-1) unstable; urgency=low
1
2 * New upstream release. (Closes: #426091)
3 - Support X-Start-Before and X-Stop-After (Closes: #326120)
4 - Building with DEB_BUILD_OPTIONS=nostrip no longer strip the
5 binary. (Closes: #437210)
6 * Let /usr/share/insserv/check-initd-order read override files in
7 /etc/insserv/overrides/ just like insserv does. Patch from Arjan
8 Oosting. (Closes: #429398)
9 * Correct the dependencies for nbd-client and libnss-ldap.
10 * Add override file for spamassassin.
11 * Update watch file with new upstream URL. (Closes: #450044)
12
13 -- Petter Reinholdtsen <pere@debian.org> Sat, 17 Nov 2007 21:17:20 +0100
14
015 insserv (1.08.0-14) unstable; urgency=low
116
217 * Correct the dependencies for hwclock.sh.
1616 #$rcbase = "/opt/ltsp/i386/etc";
1717
1818 my $overridepath = "/usr/share/insserv/overrides";
19 my $hostoverridepath = "/etc/insserv/overrides";
1920
2021 my $debug = 0;
2122
207208
208209 sub load_lsb_tags {
209210 my ($initfile, $useoverrides) = @_;
210 print STDERR "Loading $initfile\n" if $debug;
211 my $lsbinforef = load_lsb_tags_from_file($initfile);
212
213 if ($useoverrides) {
214 # Try override file
215 $initfile = readlink($initfile) if (-l $initfile);
216 my $basename = basename($initfile);
217
218 # Only read shipped override file when initscript does not
219 # contain LSB tags.
220 if (! defined($lsbinforef) && -f "$overridepath/$basename") {
221 print STDERR "Override $overridepath/$basename\n" if $debug;
222 $lsbinforef = load_lsb_tags_from_file("$overridepath/$basename");
223 }
224
225 # Always read the host override in $hostoverridepath.
226 if (-f "$hostoverridepath/$basename") {
227 print STDERR "Override $hostoverridepath/$basename\n" if $debug;
228 $lsbinforef = load_lsb_tags_from_file("$hostoverridepath/$basename");
229 }
230
231 }
232 return $lsbinforef;
233 }
234
235 sub load_lsb_tags_from_file {
236 my ($file) = @_;
237 print STDERR "Loading $file\n" if $debug;
211238 ### BEGIN INIT INFO
212239 # Provides: xdebconfigurator
213240 # Required-Start: $syslog
218245 # Description: Preseed X configuration and use dexconf to
219246 # genereate a new configuration file.
220247 ### END INIT INFO
221 unless (open(FILE, "<$initfile")) {
222 warn "error: Unable to read $initfile";
248 unless (open(FILE, "<$file")) {
249 warn "error: Unable to read $file";
223250 return;
224251 }
225252 my $found = 0;
238265 }
239266 close(FILE);
240267
241 # Try override file
242 $initfile = readlink($initfile) if (-l $initfile);
243 my $basename = basename($initfile);
244
245 if (!$found) {
246 if ($useoverrides && -f "$overridepath/$basename") {
247 print STDERR "Override $overridepath/$basename\n"
248 if $debug;
249 return load_lsb_tags("$overridepath/$basename", $useoverrides);
250 }
251 }
252268 return undef unless ($found);
253269
254270 # print "Provides: $provides\n" if $provides;
258274 'required-stop' => $requiredstop,
259275 'should-start' => $shouldstart,
260276 'should-stop' => $shouldstop,
261 'file' => $initfile,
277 'file' => $file,
262278 };
263279 }
00 ### BEGIN INIT INFO
11 # Provides: libnss-ldap
22 # Required-Start: mountkernfs
3 # Required-Stop:
3 # Required-Stop: $local_fs
44 # Default-Start: S
5 # Default-Stop: 0 2 3 4 5 6
5 # Default-Stop: 0 6
66 ### END INIT INFO
00 ### BEGIN INIT INFO
11 # Provides: nbd-client
22 # Required-Start: $network
3 # X-Start-Before: $remote_fs
34 # Required-Stop: $network
4 # Default-Start: S 1 2 3 4 5
5 # Default-Stop: 0 6
5 # Default-Start: 2 3 4 5
6 # Default-Stop: 0 1 6
67 ### END INIT INFO
0 ### BEGIN INIT INFO
1 # Provides: spamassassin
2 # Required-Start: $remote_fs
3 # Required-Stop: $remote_fs
4 # Default-Start: 2 3 4 5
5 # Default-Stop: 0 1 6
6 ### END INIT INFO
0 #10_readme
10 20_overrides
2 #30_non_suse
31 31_debian_conf
42 32_debian_nolsb
53 33_debian_localok
6 #34_debian
7 35_fixunused
8 36_memleak
9 37_consistent_path
104 38_debuginfo
11 39_debianlvl
125 40_nosusescript
136 41_debiandefault
14 #51_cfgfilter_dpkg
7 42_redundantlvl
+0
-23
debian/patches/10_readme.dpatch less more
0 #! /bin/sh /usr/share/dpatch/dpatch-run
1 ## 10_readme.dpatch by Petter Reinholdtsen <pere@hungry.com>
2 ##
3 ## All lines beginning with `## DP:' are a description of the patch.
4 ## DP: Add URL to upstream source in README.
5
6 @DPATCH@
7 diff -ur insserv-1.04.0/README insserv-1.04.0/README
8 --- insserv-1.04.0/README 2005-09-14 17:53:05.000000000 +0200
9 +++ insserv-1.04.0/README 2005-11-10 21:47:38.000000000 +0100
10 @@ -5,6 +5,12 @@
11 boot scripts used by the system during boot time),
12 type `make' and `make install'.
13
14 + Downloading latest version
15 + ==========================
16 +
17 +The latest version of the insserv source is available from
18 +<URL: ftp://ftp.suse.com/pub/projects/init/ >.
19 +
20 Processes controlling
21 =====================
22
+0
-18
debian/patches/30_non_suse.dpatch less more
0 #! /bin/sh /usr/share/dpatch/dpatch-run
1 ## 30_non_suse.dpatch by Petter Reinholdtsen <pere@hungry.com>
2 ##
3 ## All lines beginning with `## DP:' are a description of the patch.
4 ## DP: Avoid crashing with null-pointer when compiling without SUSE flag.
5
6 @DPATCH@
7 --- insserv-1.04.0.orig/insserv.c
8 +++ insserv-1.04.0/insserv.c
9 @@ -1984,7 +1984,7 @@
10 * default_stop arn't used in SuSE Linux.
11 */
12 if (script_inf.default_stop && script_inf.default_stop != empty) {
13 - if (!service || !del)
14 + if (service && !del)
15 service->lvlk = str2lvl(script_inf.default_stop);
16 }
17 #endif
+0
-43
debian/patches/34_debian.dpatch less more
0 #! /bin/sh /usr/share/dpatch/dpatch-run
1 ## 34_debian.dpatch by Petter Reinholdtsen <pere@hungry.com>
2 ##
3 ## All lines beginning with `## DP:' are a description of the patch.
4 ## DP: Fix a few remaining ../init.d/ issues.
5
6 @DPATCH@
7 --- insserv-1.03.0.orig/insserv.c
8 +++ insserv-1.03.0/insserv.c
9 @@ -1877,17 +1877,21 @@
10 * Do _not_ set default stop levels
11 */
12 }
13 -#endif
14 +#endif /* not SUSE */
15 }
16 }
17 free(begin);
18 }
19
20 +#ifdef SUSE
21 /* Ahh ... set default multiuser with network */
22 if (!script_inf.default_start)
23 script_inf.default_start = xstrdup("3 5");
24 -#ifndef SUSE
25 - /* Do _not_ set default stop levels */
26 +#else /* not SUSE */
27 + if (!script_inf.default_start)
28 + script_inf.default_start = xstrdup("2 3 4 5"); /* for Debian*/
29 + if (!script_inf.default_stop)
30 + script_inf.default_stop = xstrdup("S 0 1 6"); /* for Debian*/
31 #endif
32
33 if (chkfor(d->d_name, argv, argc) && !defaults) {
34 @@ -2265,7 +2269,7 @@
35 order = (maxorder + 1) - order;
36 }
37
38 - sprintf(olink, "../%s", script);
39 + sprintf(olink, "../init.d/%s", script);
40 sprintf(nlink, "%c%.2d%s", mode, order, script);
41
42 found = false;
+0
-85
debian/patches/35_fixunused.dpatch less more
0 #! /bin/sh /usr/share/dpatch/dpatch-run
1 ## 35_fixunused.dpatch by Petter Reinholdtsen <pere@hungry.com>
2
3 When uploading version 1.08.0 of insserv into Debian this build
4 warning was discovered on s390:
5
6 insserv.c:35: warning: type qualifiers ignored on function return type
7 insserv.c:36: warning: type qualifiers ignored on function return type
8 insserv.c:1237: warning: type qualifiers ignored on function return type
9 insserv.c:1242: warning: type qualifiers ignored on function return type
10
11 The problem is the use of the unused attribute. There is also a
12 problem with lack of 'const' on the map_runlevel_to_location()
13 function. This patch fixes these problems.
14
15 It was sent upstream 2006-04-01 and found to be fixed in version
16 1.09.0.
17
18 @DPATCH@
19 --- insserv-1.08.0.orig/insserv.c
20 +++ insserv-1.08.0/insserv.c
21 @@ -30,9 +30,11 @@
22 #include <getopt.h>
23 #include "listing.h"
24
25 -static char *map_runlevel_to_location(const int runlevel);
26 -static const int map_runlevel_to_lvl (const int runlevel) __attribute__ ((unused));
27 -static const int map_runlevel_to_seek(const int runlevel) __attribute__ ((unused));
28 +static const char *map_runlevel_to_location(const int runlevel);
29 +#ifndef SUSE
30 +static const int map_runlevel_to_lvl (const int runlevel);
31 +static const int map_runlevel_to_seek(const int runlevel);
32 +#endif /* not SUSE */
33
34 #ifndef INITDIR
35 # define INITDIR "/etc/init.d"
36 @@ -1140,11 +1142,12 @@
37
38 #define RUNLEVLES (sizeof(runlevel_locations)/sizeof(runlevel_locations[0]))
39
40 -static char *map_runlevel_to_location(const int runlevel)
41 +static const char *map_runlevel_to_location(const int runlevel)
42 {
43 return runlevel_locations[runlevel].location;
44 }
45
46 +#ifndef SUSE
47 static const int map_runlevel_to_lvl(const int runlevel)
48 {
49 return runlevel_locations[runlevel].lvl;
50 @@ -1154,6 +1157,7 @@
51 {
52 return runlevel_locations[runlevel].seek;
53 }
54 +#endif /* not SUSE */
55
56 /*
57 * Scan current service structure
58 @@ -1164,7 +1164,7 @@
59
60 pushd(path);
61 for (runlevel = 0; runlevel < RUNLEVLES; runlevel++) {
62 - char * rcd = NULL;
63 + const char * rcd = NULL;
64 DIR * rcdir;
65 struct dirent *d;
66 char * token;
67 @@ -2134,7 +2134,7 @@
68 int order;
69 const char * script;
70 char nlink[PATH_MAX+1], olink[PATH_MAX+1];
71 - char * rcd = NULL;
72 + const char * rcd = NULL;
73 DIR * rcdir;
74
75 rcd = map_runlevel_to_location(runlevel);
76 @@ -2280,7 +2280,7 @@
77 int lvl = 0, seek = 0;
78 const char * script;
79 char nlink[PATH_MAX+1], olink[PATH_MAX+1];
80 - char * rcd = NULL;
81 + const char * rcd = NULL;
82 DIR * rcdir;
83
84 rcd = map_runlevel_to_location(runlevel);
+0
-26
debian/patches/36_memleak.dpatch less more
0 #! /bin/sh /usr/share/dpatch/dpatch-run
1 ## 36_memleak.dpatch by Petter Reinholdtsen <pere@hungry.com>
2
3 Fix minor memleak. Patch sent upstream 2006-04-01. Seem to be fixed
4 in version 1.09.0.
5
6 --- insserv-1.08.0.orig/insserv.c
7 +++ insserv-1.08.0/insserv.c
8 @@ -1773,7 +1773,7 @@
9 }
10 if (!script_inf.default_start || script_inf.default_start == empty) {
11 if (guess->lvls)
12 - script_inf.default_start = xstrdup(lvl2str(guess->lvls));
13 + script_inf.default_start = lvl2str(guess->lvls);
14 }
15 } else {
16 /*
17 @@ -1795,7 +1795,7 @@
18
19 list_for_each(req, &(cur->sort.req)) {
20 if (!strcmp(getreq(req)->serv, script_inf.provides)) {
21 - script_inf.default_start = xstrdup(lvl2str(getserv(ptr)->lvls));
22 + script_inf.default_start = lvl2str(getserv(ptr)->lvls);
23 break;
24 }
25 }
+0
-46
debian/patches/37_consistent_path.dpatch less more
0 #! /bin/sh /usr/share/dpatch/dpatch-run
1 ## 37_consistent_path.dpatch by Petter Reinholdtsen <pere@hungry.com>
2
3 Make sure the following invocations of insserv uses the same path to
4 init.d/:
5
6 insserv -nv
7 insserv -nv /etc/init.d
8 insserv -nv /etc/init.d/
9 insserv -nv /etc/init.d/hostname.sh
10
11 Without this patch, they will use '/etc/init.d' and /etc/init.d/'
12 respectively, and this produces strange paths in the log output.
13
14 It was sent upstream 2006-09-07. The issue seem to be fixed slightly
15 different in version 1.09.0.
16
17 @DPATCH@
18 --- insserv-1.08.0.orig/insserv.c
19 +++ insserv-1.08.0/insserv.c
20 @@ -1651,7 +1651,15 @@
21 }
22
23 if (S_ISDIR(st_script.st_mode)) {
24 - path = *argv;
25 +
26 + /* Remove trailing slash from the directory path */
27 + if ('/' == (*argv)[strlen(*argv)-1]) {
28 + char * ptr = xstrdup(*argv);
29 + ptr[strlen(ptr)-1] = '\0';
30 + path = ptr;
31 + } else
32 + path = *argv;
33 +
34 if (del)
35 error("usage: %s [[-r] init_script|init_directory]\n", myname);
36 argv++;
37 @@ -1662,7 +1670,7 @@
38 char * base, * ptr = xstrdup(*argv);
39
40 if ((base = strrchr(ptr, '/'))) {
41 - *(++base) = '\0';
42 + *(base) = '\0';
43 path = ptr;
44 } else
45 free(ptr);
00 #! /bin/sh /usr/share/dpatch/dpatch-run
11 ## 38_debuginfo.dpatch by Petter Reinholdtsen <pere@hungry.com>
22
3 Change debug output to print symbolic runlevel names instead of a hex
3 Change debug output to print symbolic runlevel names as wellas a hex
44 value with the bit pattern representing the runlevels.
55
66 @DPATCH@
1212 if (dir->script)
1313 - fprintf(stderr, "%.2d %s 0x%.2x (%s)\n",
1414 - dir->order, dir->script, dir->lvl, dir->name);
15 + fprintf(stderr, "%.2d %s '%s' (%s)\n",
16 + dir->order, dir->script, lvl2str(dir->lvl), dir->name);
15 + fprintf(stderr, "%.2d %s 0x%.2x '%s' (%s)\n",
16 + dir->order, dir->script, dir->lvl, lvl2str(dir->lvl), dir->name);
1717 else
1818 - fprintf(stderr, "%.2d %s 0x%.2x (%%%s)\n",
1919 - dir->order, dir->name, dir->lvl, *dir->name == '$' ? "system" : "guessed");
20 + fprintf(stderr, "%.2d %s '%s' (%%%s)\n",
21 + dir->order, dir->name, lvl2str(dir->lvl), *dir->name == '$' ? "system" : "guessed");
20 + fprintf(stderr, "%.2d %s 0x%.2x '%s' (%%%s)\n",
21 + dir->order, dir->name, dir->lvl, lvl2str(dir->lvl), *dir->name == '$' ? "system" : "guessed");
2222 }
2323 }
2424 #endif
+0
-49
debian/patches/39_debianlvl.dpatch less more
0 #! /bin/sh /usr/share/dpatch/dpatch-run
1 ## 39_debianlvl.dpatch by Petter Reinholdtsen <pere@hungry.com>
2
3 Adjust insserv to handle 'S' in the init.d script level list as the
4 boot directory on debian. A better solution would be to reengineer
5 insserv to have the runlevel info in one location instead of all over
6 the code.
7
8 @DPATCH@
9 --- insserv-1.08.0.orig/insserv.c
10 +++ insserv-1.08.0/insserv.c
11 @@ -418,7 +418,11 @@
12
13 switch (runlvl) {
14 case 0: serv->lvls |= LVL_HALT; break;
15 +#ifdef SUSE
16 case 1: serv->lvls |= LVL_ONE; break;
17 +#else /* not SUSE */
18 + case 1: serv->lvls |= LVL_SINGLE; break;
19 +#endif
20 case 2: serv->lvls |= LVL_TWO; break;
21 case 3: serv->lvls |= LVL_THREE; break;
22 case 4: serv->lvls |= LVL_FOUR; break;
23 @@ -1133,6 +1137,7 @@
24 {"../rc4.d/", LVL_FOUR, LVL_NORM},
25 {"../rc5.d/", LVL_FIVE, LVL_NORM},
26 {"../rc6.d/", LVL_REBOOT, LVL_NORM},
27 + {"../rc1.d/", LVL_ONE, LVL_NORM}, /* placeholder */
28 {"../rcS.d/", LVL_BOOT, LVL_BOOT}, /* runlevel S */
29 /* On e.g. Debian there exist no boot.d */
30 #endif /* not SUSE */
31 --- insserv-1.08.0.orig/listing.c
32 +++ insserv-1.08.0/listing.c
33 @@ -578,9 +578,15 @@
34 if (!strpbrk(token, "0123456sSbB"))
35 continue;
36 if (*token == 'S' || *token == 's')
37 +#ifdef SUSE
38 num = 7;
39 +#else
40 + num = 8;
41 +#endif
42 +#ifdef SUSE
43 else if (*token == 'B' || *token == 'b')
44 num = 8;
45 +#endif /* SUSE */
46 else
47 num = atoi(token);
48 switch (num) {
0 #! /bin/sh /usr/share/dpatch/dpatch-run
1 ## 42_redundantlvl.dpatch by Petter Reinholdtsen <pere@hungry.com>
2
3 Rewrite most locations with hardcoded information about levels to use
4 the runlevel_locations array to fetch the information instead. This
5 reduces the redundancy and make it easier to keep the level settings
6 in sync across the code.
7
8 The runlevel_locations array is extended to include the runlevel kode
9 in it.
10
11 @DPATCH@
12 --- insserv-1.09.0.orig/insserv.c
13 +++ insserv-1.09.0/insserv.c
14 @@ -31,8 +31,8 @@
15 #include "listing.h"
16
17 static const char *map_runlevel_to_location(const int runlevel);
18 +const int map_runlevel_to_lvl (const int runlevel);
19 #ifndef SUSE
20 -static const int map_runlevel_to_lvl (const int runlevel);
21 static const int map_runlevel_to_seek(const int runlevel);
22 #endif /* not SUSE */
23
24 @@ -418,22 +418,7 @@
25 if (serv->order < order)
26 serv->order = order;
27
28 - switch (runlvl) {
29 - case 0: serv->lvls |= LVL_HALT; break;
30 - case 1: serv->lvls |= LVL_ONE; break;
31 - case 2: serv->lvls |= LVL_TWO; break;
32 - case 3: serv->lvls |= LVL_THREE; break;
33 - case 4: serv->lvls |= LVL_FOUR; break;
34 - case 5: serv->lvls |= LVL_FIVE; break;
35 - case 6: serv->lvls |= LVL_REBOOT; break;
36 -#ifdef SUSE
37 - case 7: serv->lvls |= LVL_SINGLE; break;
38 - case 8: serv->lvls |= LVL_BOOT; break;
39 -#else /* not SUSE */
40 - case 7: serv->lvls |= LVL_BOOT; break;
41 -#endif /* not SUSE */
42 - default: break;
43 - }
44 + serv->lvls |= map_runlevel_to_lvl(runlvl);
45
46 return serv;
47 }
48 @@ -1124,45 +1109,82 @@
49 char *location;
50 const int lvl;
51 const int seek;
52 + char key;
53 } runlevel_locations[] = {
54 #ifdef SUSE /* SuSE's SystemV link scheme */
55 - {"rc0.d/", LVL_HALT, LVL_NORM},
56 - {"rc1.d/", LVL_ONE, LVL_NORM}, /* runlevel 1 switch over to single user mode */
57 - {"rc2.d/", LVL_TWO, LVL_NORM},
58 - {"rc3.d/", LVL_THREE, LVL_NORM},
59 - {"rc4.d/", LVL_FOUR, LVL_NORM},
60 - {"rc5.d/", LVL_FIVE, LVL_NORM},
61 - {"rc6.d/", LVL_REBOOT, LVL_NORM},
62 - {"rcS.d/", LVL_SINGLE, LVL_NORM}, /* runlevel S is for single user mode */
63 - {"boot.d/", LVL_BOOT, LVL_BOOT}, /* runlevel B is for system initialization */
64 + {"rc0.d/", LVL_HALT, LVL_NORM, '0'},
65 + {"rc1.d/", LVL_ONE, LVL_NORM, '1'}, /* runlevel 1 switch over to single user mode */
66 + {"rc2.d/", LVL_TWO, LVL_NORM, '2'},
67 + {"rc3.d/", LVL_THREE, LVL_NORM, '3'},
68 + {"rc4.d/", LVL_FOUR, LVL_NORM, '4'},
69 + {"rc5.d/", LVL_FIVE, LVL_NORM, '5'},
70 + {"rc6.d/", LVL_REBOOT, LVL_NORM, '6'},
71 + {"rcS.d/", LVL_SINGLE, LVL_NORM, 'S'}, /* runlevel S is for single user mode */
72 + {"boot.d/", LVL_BOOT, LVL_BOOT, 'B'}, /* runlevel B is for system initialization */
73 #else /* not SUSE (actually, Debian) */
74 - {"../rc0.d/", LVL_HALT, LVL_NORM},
75 - {"../rc1.d/", LVL_ONE, LVL_NORM}, /* runlevel 1 switch over to single user mode */
76 - {"../rc2.d/", LVL_TWO, LVL_NORM},
77 - {"../rc3.d/", LVL_THREE, LVL_NORM},
78 - {"../rc4.d/", LVL_FOUR, LVL_NORM},
79 - {"../rc5.d/", LVL_FIVE, LVL_NORM},
80 - {"../rc6.d/", LVL_REBOOT, LVL_NORM},
81 - {"../rcS.d/", LVL_BOOT, LVL_BOOT}, /* runlevel S is for system initialization */
82 + {"../rc0.d/", LVL_HALT, LVL_NORM, '0'},
83 + {"../rc1.d/", LVL_ONE, LVL_NORM, '1'}, /* runlevel 1 switch over to single user mode */
84 + {"../rc2.d/", LVL_TWO, LVL_NORM, '2'},
85 + {"../rc3.d/", LVL_THREE, LVL_NORM, '3'},
86 + {"../rc4.d/", LVL_FOUR, LVL_NORM, '4'},
87 + {"../rc5.d/", LVL_FIVE, LVL_NORM, '5'},
88 + {"../rc6.d/", LVL_REBOOT, LVL_NORM, '6'},
89 + {"../rcS.d/", LVL_BOOT, LVL_BOOT, 'S'}, /* runlevel S is for system initialization */
90 /* On e.g. Debian there exist no boot.d */
91 #endif /* not SUSE */
92 };
93
94 #define RUNLEVLES (sizeof(runlevel_locations)/sizeof(runlevel_locations[0]))
95
96 +const int map_has_runlevels(void)
97 +{
98 + return RUNLEVLES;
99 +}
100 +
101 +const char map_runlevel_to_key(const int runlevel)
102 +{
103 + if (runlevel >= RUNLEVLES) {
104 + warn("Wrong runlevel %d\n", runlevel);
105 + }
106 + return runlevel_locations[runlevel].key;
107 +}
108 +
109 +const int map_key_to_lvl(const char key)
110 +{
111 + int runlevel;
112 + const char uckey = toupper(key);
113 + for (runlevel = 0; runlevel < RUNLEVLES; runlevel++) {
114 + if (uckey == runlevel_locations[runlevel].key)
115 + return runlevel_locations[runlevel].lvl;
116 + }
117 + warn("Wrong runlevel key '%c'\n", uckey);
118 + return 0;
119 +}
120 +
121 static const char *map_runlevel_to_location(const int runlevel)
122 {
123 + if (runlevel >= RUNLEVLES) {
124 + warn("Wrong runlevel %d\n", runlevel);
125 + }
126 return runlevel_locations[runlevel].location;
127 }
128
129 -#ifndef SUSE
130 -static const int map_runlevel_to_lvl(const int runlevel)
131 +const int map_runlevel_to_lvl(const int runlevel)
132 {
133 + if (runlevel >= RUNLEVLES) {
134 + warn("Wrong runlevel %d\n", runlevel);
135 + return 0;
136 + }
137 return runlevel_locations[runlevel].lvl;
138 }
139
140 +#ifndef SUSE
141 static const int map_runlevel_to_seek(const int runlevel)
142 {
143 + if (runlevel >= RUNLEVLES) {
144 + warn("Wrong runlevel %d\n", runlevel);
145 + return LVL_NORM;
146 + }
147 return runlevel_locations[runlevel].seek;
148 }
149 #endif /* not SUSE */
150 --- insserv-1.09.0.orig/listing.c
151 +++ insserv-1.09.0/listing.c
152 @@ -58,6 +58,9 @@
153 #define DIR_LOOP 0x00000002
154 #define DIR_ISACTIVE 0x00000004
155
156 +/* From insserv.c */
157 +extern const int map_has_runlevels(void);
158 +extern const int map_runlevel_to_lvl (const int runlevel);
159 /*
160 * Provide or find a service dir, set initial states and
161 * link it into the maintaining if a new one.
162 @@ -428,24 +431,7 @@
163 boolean ret = false;
164 unsigned int lvl = 0;
165
166 - switch (runlevel) {
167 - case 0: lvl = LVL_HALT; break;
168 - case 1: lvl = LVL_ONE; break;
169 - case 2: lvl = LVL_TWO; break;
170 - case 3: lvl = LVL_THREE; break;
171 - case 4: lvl = LVL_FOUR; break;
172 - case 5: lvl = LVL_FIVE; break;
173 - case 6: lvl = LVL_REBOOT; break;
174 -#ifdef SUSE
175 - case 7: lvl = LVL_SINGLE; break;
176 - case 8: lvl = LVL_BOOT; break;
177 -#else
178 - case 7: lvl = LVL_BOOT; break;
179 -#endif /* not SUSE */
180 -
181 - default:
182 - warn("Wrong runlevel %d\n", runlevel);
183 - }
184 + lvl = map_runlevel_to_lvl (runlevel);
185
186 list_for_each(tmp, d_start) {
187 dir_t * dir = getdir(tmp);
188 @@ -480,23 +466,7 @@
189 if (!*script)
190 tmp = d_start->next;
191
192 - switch (runlevel) {
193 - case 0: lvl = LVL_HALT; break;
194 - case 1: lvl = LVL_ONE; break;
195 - case 2: lvl = LVL_TWO; break;
196 - case 3: lvl = LVL_THREE; break;
197 - case 4: lvl = LVL_FOUR; break;
198 - case 5: lvl = LVL_FIVE; break;
199 - case 6: lvl = LVL_REBOOT; break;
200 -#ifdef SUSE
201 - case 7: lvl = LVL_SINGLE; break;
202 - case 8: lvl = LVL_BOOT; break;
203 -#else
204 - case 7: lvl = LVL_BOOT; break;
205 -#endif /* not SUSE */
206 - default:
207 - warn("Wrong runlevel %d\n", runlevel);
208 - }
209 + lvl = map_runlevel_to_lvl (runlevel);
210
211 do {
212 ret = false;
213 @@ -587,30 +557,7 @@
214 if (!strpbrk(token, "0123456sSbB"))
215 continue;
216
217 - if (*token == 'S' || *token == 's')
218 - num = 7;
219 - else if (*token == 'B' || *token == 'b')
220 - num = 8;
221 - else
222 - num = atoi(token);
223 -
224 - switch (num) {
225 - case 0: ret |= LVL_HALT; break;
226 - case 1: ret |= LVL_ONE; break;
227 - case 2: ret |= LVL_TWO; break;
228 - case 3: ret |= LVL_THREE; break;
229 - case 4: ret |= LVL_FOUR; break;
230 - case 5: ret |= LVL_FIVE; break;
231 - case 6: ret |= LVL_REBOOT; break;
232 -#ifdef SUSE
233 - case 7: ret |= LVL_SINGLE; break;
234 - case 8: ret |= LVL_BOOT; break;
235 -#else
236 - case 7: ret |= LVL_BOOT; break;
237 -#endif /* not SUSE */
238 - default:
239 - warn("Wrong runlevel %d\n", num);
240 - }
241 + ret |= map_key_to_lvl(*token);
242 }
243
244 return ret;
+0
-16
debian/patches/51_cfgfilter_dpkg.dpatch less more
0 #! /bin/sh /usr/share/dpatch/dpatch-run
1 ## 51_cfgfilter_dpkg.dpatch by Petter Reinholdtsen <pere@hungry.com>
2 ##
3 ## All lines beginning with `## DP:' are a description of the patch.
4 ## DP: Ignore tempfiles from dpkg. Fixes bug #326445.
5
6 --- insserv-1.02.0.orig/insserv.c
7 +++ insserv-1.02.0/insserv.c
8 @@ -1290,6 +1293,7 @@
9 !strncmp(end, "ba", 2) || /* .bak, .backup, ... */
10 !strcmp(end, "old") ||
11 !strcmp(end, "new") ||
12 + !strncmp(end, "dpkg", 3) || /* .dpkg-old, .dpkg-new ... */
13 !strcmp(end, "save") ||
14 !strcmp(end, "swp") || /* Used by vi like editors */
15 !strcmp(end, "core")) /* modern core dump */
55
66 PACKAGE = insserv
77
8 CFLAGS = -W -g
8 CFLAGS = -W -Wall -g
99
1010 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
1111 CFLAGS += -O0
1212 else
1313 CFLAGS += -O2
1414 endif
15
16 #CFLAGS += -DDEBUG=1
1517
1618 INSTALL = install
1719 INSTALL_DATA = $(INSTALL) -m644
2426
2527 build: build-stamp
2628
27 build-stamp: patch-stamp
29 build-stamp: patch-stamp
2830 dh_testdir
2931
3032 # Add here commands to compile the package.
8284
8385 binary: binary-indep binary-arch
8486 .PHONY: build clean binary-indep binary-arch binary install
87
88 # List the init.d missing LSB headers and override files
89 missing-overrides:
90 @GET http://lintian.debian.org/reports/Tinit.d-script-missing-lsb-section.html| grep W: | rev | cut -d/ -f1 | rev | sort > missing
91 @ls debian/overrides/ |sort > overrides
92 @echo "Init.d scripts in need of overrides:"
93 @echo $$(comm -23 missing overrides) |fold -s | sed 's/^/ /'
94
95 @echo -n "Scripts missing overrides: "; comm -23 missing overrides|wc -l
96 @echo -n "Scripts with overrides and no LSB header: "; comm -12 missing overrides|wc -l
97 @echo -n "Scripts with overrides and LSB header: "; comm -13 missing overrides|wc -l
22
33 version=2
44
5 ftp://ftp.suse.com/pub/suse/i386/current/suse/src/insserv-(.*)\.src\.rpm debian uupdate
5 ftp://ftp.suse.com/pub/projects/init/insserv-(.*).tar.gz debian uupdate
+0
-15
insserv-1.08.0.lsm less more
0 Begin3
1 Title: insserv tool for boot scripts
2 Version: 1.08.0
3 Entered-date: 06FEB06
4 Description: Used for enabling of installed boot scripts
5 by scanning comment headers which are LSB conform.
6 Keywords: boot service control, LSB
7 Author: Werner Fink <werner@suse.de>
8 Maintained-by: Werner Fink <werner@suse.de>
9 Primary-site: sunsite.unc.edu /pub/Linux/system/daemons/init
10 @UNKNOWN insserv-1.08.0.tar.gz
11 Alternate-site: ftp.suse.com /pub/projects/init
12 Platforms: Linux with System VR2 or higher boot scheme
13 Copying-policy: GPL
14 End
0 Begin3
1 Title: insserv tool for boot scripts
2 Version: 1.09.0
3 Entered-date: 16JAN07
4 Description: Used for enabling of installed boot scripts
5 by scanning comment headers which are LSB conform.
6 Keywords: boot service control, LSB
7 Author: Werner Fink <werner@suse.de>
8 Maintained-by: Werner Fink <werner@suse.de>
9 Primary-site: sunsite.unc.edu /pub/Linux/system/daemons/init
10 @UNKNOWN insserv-1.09.0.tar.gz
11 Alternate-site: ftp.suse.com /pub/projects/init
12 Platforms: Linux with System VR2 or higher boot scheme
13 Copying-policy: GPL
14 End
5050 # Required-Stop: boot_facility_1 [ boot_facility_2 ...]
5151 # Should-Start: boot_facility_1 [ boot_facility_2 ...]
5252 # Should-Stop: boot_facility_1 [ boot_facility_2 ...]
53 # X-Start-Before: boot_facility_1 [ boot_facility_2 ...]
54 # X-Stop-After: boot_facility_1 [ boot_facility_2 ...]
5355 # Default-Start: run_level_1 [ run_level_2 ...]
5456 # Default-Stop: run_level_1 [ run_level_2 ...]
5557 # Description: multiline_description
6163 Please note, that the
6264 .BR Required-Stop,
6365 .BR Should-Stop ,
66 .BR X-Stop-After,
6467 and
6568 .B Default\-Stop
6669 are ignored in SuSE Linux, because the SuSE boot script concept
6770 uses a differential link scheme (see
6871 .IR init.d (7)).
72 The optional
73 .B X\-Start\-Before
74 keyword implies that the script using this keyword
75 should be started
76 .B before
77 the specified service names. This implies that those
78 services now depend on the specifying script.
6979 With known dependencies and runlevel(s)
7080 .B insserv
7181 sets and reorders the corresponding symbolic links
144154 as an interactive one, e.g. a service which requires
145155 a passphrase or password input during boot
146156 or runlevel change.
157 .P
158 Beside the defined
159 .B System Facilities
160 in the configuration file
161 .IR /etc/insserv.conf ,
162 .B insserv
163 also knows the special facility
164 .BR $all .
165 This facility indicates that a service should be inserted
166 at the end of all services. Clearly all services using
167 this facility will be grouped into one starting order.
147168 .\"
148169 .SH OPTIONS
149170 Currently there are only four options for
239260 *.ba*
240261 *.old
241262 *.new
263 *.org
264 *.orig
242265 *.save
243266 *.swp
244267 *.core
2929 #include <getopt.h>
3030 #include "listing.h"
3131
32 static char *map_runlevel_to_location(const int runlevel);
33 static const int map_runlevel_to_lvl (const int runlevel) __attribute__ ((unused));
34 static const int map_runlevel_to_seek(const int runlevel) __attribute__ ((unused));
32 static const char *map_runlevel_to_location(const int runlevel);
33 #ifndef SUSE
34 static const int map_runlevel_to_lvl (const int runlevel);
35 static const int map_runlevel_to_seek(const int runlevel);
36 #endif /* not SUSE */
3537
3638 #ifndef INITDIR
3739 # define INITDIR "/etc/init.d"
423425 case 4: serv->lvls |= LVL_FOUR; break;
424426 case 5: serv->lvls |= LVL_FIVE; break;
425427 case 6: serv->lvls |= LVL_REBOOT; break;
428 #ifdef SUSE
426429 case 7: serv->lvls |= LVL_SINGLE; break;
427430 case 8: serv->lvls |= LVL_BOOT; break;
431 #else /* not SUSE */
432 case 7: serv->lvls |= LVL_BOOT; break;
433 #endif /* not SUSE */
428434 default: break;
429435 }
430436
505511 continue;
506512
507513 if (cur->opts & SERV_DUPLET)
508 continue; /* Duplet */
514 continue; /* Duplet */
509515
510516 if (cur == serv)
511517 continue;
549555 }
550556
551557 /*
552 * Alt last but not least the `$all' scripts will be set to the of
558 * Last but not least the `$all' scripts will be set to the of
553559 * current the start order.
554560 */
555561
560566 list_for_each(pos, serv_start) {
561567 serv_t * serv = getserv(pos);
562568 list_t * tmp;
569 const char *name;
563570 int neworder;
564571
565572 if (!(serv->opts & SERV_ALL))
586593 neworder = maxorder;
587594 else if (neworder > maxorder)
588595 maxorder = neworder;
589 setorder(serv->name, neworder, false);
596 /* Expand aliases to the real script name */
597 if ((name = getscript(serv->name)) == NULL)
598 name = serv->name;
599 setorder(name, neworder, false);
590600 }
591601 }
592602
11161126 } runlevel_locations[] = {
11171127 #ifdef SUSE /* SuSE's SystemV link scheme */
11181128 {"rc0.d/", LVL_HALT, LVL_NORM},
1119 {"rc1.d/", LVL_ONE, LVL_NORM},
1129 {"rc1.d/", LVL_ONE, LVL_NORM}, /* runlevel 1 switch over to single user mode */
11201130 {"rc2.d/", LVL_TWO, LVL_NORM},
11211131 {"rc3.d/", LVL_THREE, LVL_NORM},
11221132 {"rc4.d/", LVL_FOUR, LVL_NORM},
11231133 {"rc5.d/", LVL_FIVE, LVL_NORM},
11241134 {"rc6.d/", LVL_REBOOT, LVL_NORM},
1125 {"rcS.d/", LVL_SINGLE, LVL_NORM}, /* runlevel S */
1126 {"boot.d/", LVL_BOOT, LVL_BOOT}, /* runlevel B */
1135 {"rcS.d/", LVL_SINGLE, LVL_NORM}, /* runlevel S is for single user mode */
1136 {"boot.d/", LVL_BOOT, LVL_BOOT}, /* runlevel B is for system initialization */
11271137 #else /* not SUSE (actually, Debian) */
11281138 {"../rc0.d/", LVL_HALT, LVL_NORM},
1129 {"../rc1.d/", LVL_SINGLE, LVL_NORM},
1139 {"../rc1.d/", LVL_ONE, LVL_NORM}, /* runlevel 1 switch over to single user mode */
11301140 {"../rc2.d/", LVL_TWO, LVL_NORM},
11311141 {"../rc3.d/", LVL_THREE, LVL_NORM},
11321142 {"../rc4.d/", LVL_FOUR, LVL_NORM},
11331143 {"../rc5.d/", LVL_FIVE, LVL_NORM},
11341144 {"../rc6.d/", LVL_REBOOT, LVL_NORM},
1135 {"../rcS.d/", LVL_BOOT, LVL_BOOT}, /* runlevel S */
1145 {"../rcS.d/", LVL_BOOT, LVL_BOOT}, /* runlevel S is for system initialization */
11361146 /* On e.g. Debian there exist no boot.d */
11371147 #endif /* not SUSE */
11381148 };
11391149
11401150 #define RUNLEVLES (sizeof(runlevel_locations)/sizeof(runlevel_locations[0]))
11411151
1142 static char *map_runlevel_to_location(const int runlevel)
1152 static const char *map_runlevel_to_location(const int runlevel)
11431153 {
11441154 return runlevel_locations[runlevel].location;
11451155 }
11461156
1157 #ifndef SUSE
11471158 static const int map_runlevel_to_lvl(const int runlevel)
11481159 {
11491160 return runlevel_locations[runlevel].lvl;
11531164 {
11541165 return runlevel_locations[runlevel].seek;
11551166 }
1167 #endif /* not SUSE */
11561168
11571169 /*
11581170 * Scan current service structure
11631175
11641176 pushd(path);
11651177 for (runlevel = 0; runlevel < RUNLEVLES; runlevel++) {
1166 char * rcd = NULL;
1178 const char * rcd = NULL;
11671179 DIR * rcdir;
11681180 struct dirent *d;
11691181 char * token;
13661378 !strncmp(end, "ba", 2) || /* .bak, .backup, ... */
13671379 !strcmp(end, "old") ||
13681380 !strcmp(end, "new") ||
1381 !strcmp(end, "org") ||
1382 !strcmp(end, "orig") ||
13691383 !strncmp(end, "dpkg", 3) || /* .dpkg-old, .dpkg-new ... */
13701384 !strcmp(end, "save") ||
13711385 !strcmp(end, "swp") || /* Used by vi like editors */
15481562
15491563 /* Catch `/path/script', `./script', and `path/script' */
15501564 if (strchr(*argv, '/')) {
1551 if ( stat(*argv, &st_script) < 0)
1565 if (stat(*argv, &st_script) < 0)
15521566 error("%s: %s\n", *argv, strerror(errno));
15531567 } else {
15541568 pushd(path);
15581572 }
15591573
15601574 if (S_ISDIR(st_script.st_mode)) {
1561 path = *argv;
1575 const size_t l = strlen(*argv);
1576
1577 path = xstrdup(*argv);
1578 if (path[l-1] == '/')
1579 path[l-1] = '\0';
1580
15621581 if (del)
15631582 error("usage: %s [[-r] init_script|init_directory]\n", myname);
15641583 argv++;
15691588 char * base, * ptr = xstrdup(*argv);
15701589
15711590 if ((base = strrchr(ptr, '/'))) {
1572 *(++base) = '\0';
1573 path = ptr;
1591 *base = '\0';
1592 path = ptr;
15741593 } else
15751594 free(ptr);
15761595 }
17721791 }
17731792 if (!script_inf.default_start || script_inf.default_start == empty) {
17741793 if (guess->lvls)
1775 script_inf.default_start = xstrdup(lvl2str(guess->lvls));
1794 script_inf.default_start = lvl2str(guess->lvls);
17761795 }
17771796 } else {
17781797 /*
17941813
17951814 list_for_each(req, &(cur->sort.req)) {
17961815 if (!strcmp(getreq(req)->serv, script_inf.provides)) {
1797 script_inf.default_start = xstrdup(lvl2str(getserv(ptr)->lvls));
1816 script_inf.default_start = lvl2str(getserv(ptr)->lvls);
17981817 break;
17991818 }
18001819 }
18681887 }
18691888 }
18701889
1871 if (!known && script_inf.required_start && script_inf.required_start != empty) {
1872 rememberreq(service, REQ_MUST, script_inf.required_start);
1873 requiresv(token, script_inf.required_start);
1890 if (!known) {
1891 if (script_inf.required_start && script_inf.required_start != empty) {
1892 rememberreq(service, REQ_MUST, script_inf.required_start);
1893 requiresv(token, script_inf.required_start);
1894 }
1895 if (script_inf.should_start && script_inf.should_start != empty) {
1896 rememberreq(service, REQ_SHLD, script_inf.should_start);
1897 requiresv(token, script_inf.should_start);
1898 }
1899 #ifndef SUSE
1900 /*
1901 * required_stop and should_stop arn't used in SuSE Linux.
1902 * Note: Sorting is done symetrical in stop and start!
1903 * The stop order is given by max order - start order.
1904 */
1905 if (script_inf.required_stop && script_inf.required_stop != empty) {
1906 rememberreq(service, REQ_MUST, script_inf.required_stop);
1907 requiresv(token, script_inf.required_stop);
1908 }
1909 if (script_inf.should_stop && script_inf.should_stop != empty) {
1910 rememberreq(service, REQ_SHLD, script_inf.should_stop);
1911 requiresv(token, script_inf.should_stop);
1912 }
1913 #endif /* not SUSE */
18741914 }
1875 if (!known && script_inf.should_start && script_inf.should_start != empty) {
1876 rememberreq(service, REQ_SHLD, script_inf.should_start);
1877 requiresv(token, script_inf.should_start);
1878 }
1879 #ifndef SUSE
1880 /*
1881 * required_stop and should_stop arn't used in SuSE Linux.
1882 * Note: Sorting is done symetrical in stop and start!
1883 * The stop order is given by max order - start order.
1884 */
1885 if (!known && script_inf.required_stop && script_inf.required_stop != empty) {
1886 rememberreq(service, REQ_MUST, script_inf.required_stop);
1887 requiresv(token, script_inf.required_stop);
1888 }
1889 if (!known && script_inf.should_stop && script_inf.should_stop != empty) {
1890 rememberreq(service, REQ_SHLD, script_inf.should_stop);
1891 requiresv(token, script_inf.should_stop);
1892 }
1893 #endif /* not SUSE */
18941915 /*
18951916 * Use information from symbolic link structure to
18961917 * check if all services are around for this script.
21292150 #else
21302151 # ifdef SUSE /* SuSE's SystemV link scheme */
21312152 pushd(path);
2132 for (runlevel = 0; runlevel < 9; runlevel++) {
2153 for (runlevel = 0; runlevel < RUNLEVLES; runlevel++) {
21332154 int order;
21342155 const char * script;
21352156 char nlink[PATH_MAX+1], olink[PATH_MAX+1];
2136 char * rcd = NULL;
2157 const char * rcd = NULL;
21372158 DIR * rcdir;
21382159
2139 rcd = map_runlevel_to_location(runlevel);
2160 if ((rcd = map_runlevel_to_location(runlevel)) == NULL)
2161 continue;
21402162
21412163 script = NULL;
21422164 rcdir = openrcdir(rcd); /* Creates runlevel directory if necessary */
22792301 int lvl = 0, seek = 0;
22802302 const char * script;
22812303 char nlink[PATH_MAX+1], olink[PATH_MAX+1];
2282 char * rcd = NULL;
2304 const char * rcd = NULL;
22832305 DIR * rcdir;
22842306
2285 rcd = map_runlevel_to_location(runlevel);
2307 if ((rcd = map_runlevel_to_location(runlevel)) == NULL)
2308 continue;
22862309 lvl = map_runlevel_to_lvl(runlevel);
22872310 seek = map_runlevel_to_seek(runlevel);
22882311
2525 $syslog syslog
2626
2727 #
28 # All network daemons are running (this entry is OBSOLETE)
29 #
30 $netdaemons portmap inetd
31
32 #
3328 # SunRPC portmapper available
3429 #
3530 $portmap portmap
4237 #
4338 # Services which need to be interactive
4439 #
45 <interactive> boot.crypto boot.localfs boot.rootfsck apache apache2
40 <interactive> boot.crypto boot.localfs boot.rootfsck apache apache2 kdump
435435 case 4: lvl = LVL_FOUR; break;
436436 case 5: lvl = LVL_FIVE; break;
437437 case 6: lvl = LVL_REBOOT; break;
438 #ifdef SUSE
438439 case 7: lvl = LVL_SINGLE; break;
439440 case 8: lvl = LVL_BOOT; break;
441 #else
442 case 7: lvl = LVL_BOOT; break;
443 #endif /* not SUSE */
444
440445 default:
441446 warn("Wrong runlevel %d\n", runlevel);
442447 }
482487 case 4: lvl = LVL_FOUR; break;
483488 case 5: lvl = LVL_FIVE; break;
484489 case 6: lvl = LVL_REBOOT; break;
490 #ifdef SUSE
485491 case 7: lvl = LVL_SINGLE; break;
486492 case 8: lvl = LVL_BOOT; break;
493 #else
494 case 7: lvl = LVL_BOOT; break;
495 #endif /* not SUSE */
487496 default:
488497 warn("Wrong runlevel %d\n", runlevel);
489498 }
576585 continue;
577586 if (!strpbrk(token, "0123456sSbB"))
578587 continue;
588
579589 if (*token == 'S' || *token == 's')
580590 num = 7;
581591 else if (*token == 'B' || *token == 'b')
582592 num = 8;
583593 else
584594 num = atoi(token);
595
585596 switch (num) {
586597 case 0: ret |= LVL_HALT; break;
587598 case 1: ret |= LVL_ONE; break;
590601 case 4: ret |= LVL_FOUR; break;
591602 case 5: ret |= LVL_FIVE; break;
592603 case 6: ret |= LVL_REBOOT; break;
604 #ifdef SUSE
593605 case 7: ret |= LVL_SINGLE; break;
594606 case 8: ret |= LVL_BOOT; break;
607 #else
608 case 7: ret |= LVL_BOOT; break;
609 #endif /* not SUSE */
595610 default:
596611 warn("Wrong runlevel %d\n", num);
597612 }
609624 memset(ptr , '\0', sizeof(str));
610625 for (num = 0; num < 9; num++) {
611626 if (bit & lvl) {
612 if (num < 7)
627 if (LVL_NORM & bit)
613628 *(ptr++) = num + 48;
614 else if (num == 7)
629 #ifdef SUSE
630 else if (LVL_SINGLE & bit)
615631 *(ptr++) = 'S';
616 else if (num == 8)
632 else if (LVL_BOOT & bit)
617633 *(ptr++) = 'B';
634 #else
635 else if (LVL_BOOT & bit)
636 *(ptr++) = 'S';
637 #endif /* not SUSE */
618638 else
619 error("Wrong runlevel %d\n", num + 48);
639 error("Wrong runlevel %d\n", num);
620640 *(ptr++) = ' ';
621641 }
622642 bit <<= 1;
678698 int order = -1;
679699
680700 if (dir)
681 order = getdir(dir)->order;
701 order = dir->order;
682702
683703 return order;
684704 }
804824 }
805825
806826 /*
807 * Return the level bits of a given script
827 * Return the provided service of a given script
808828 */
809829 const char * getprovides(const char * script)
810830 {
77 * the Free Software Foundation; either version 2 of the License, or
88 * (at your option) any later version.
99 */
10
11 #include <stddef.h>
1012
1113 typedef struct list_struct {
1214 struct list_struct * next, * prev;
5961 return head->next == head;
6062 }
6163
62 #define list_entry(ptr, type, member) \
63 ((type *)((char *)(ptr)-(unsigned long)(&((type *)0)->member)))
64 #define list_entry(ptr, type, member) ({ \
65 const typeof( ((type *)0)->member ) *__mptr = (ptr); \
66 ((type *)( (char *)(__mptr) - offsetof(type,member) )); })
6467 #define list_for_each(pos, head) \
6568 for (pos = (head)->next; pos != (head); pos = pos->next)
6669 #define list_for_each_prev(pos, head) \