1
#! /bin/sh /usr/share/dpatch/dpatch-run
2
## 37_consistent_path.dpatch by Petter Reinholdtsen <pere@hungry.com>
4
Make sure the following invocations of insserv uses the same path to
8
insserv -nv /etc/init.d
9
insserv -nv /etc/init.d/
10
insserv -nv /etc/init.d/hostname.sh
12
Without this patch, they will use '/etc/init.d' and /etc/init.d/'
13
respectively, and this produces strange paths in the log output.
15
It was sent upstream 2006-09-07.
18
--- insserv-1.08.0.orig/insserv.c
19
+++ insserv-1.08.0/insserv.c
20
@@ -1651,7 +1651,15 @@
23
if (S_ISDIR(st_script.st_mode)) {
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';
35
error("usage: %s [[-r] init_script|init_directory]\n", myname);
38
char * base, * ptr = xstrdup(*argv);
40
if ((base = strrchr(ptr, '/'))) {