]>
Commit | Line | Data |
---|---|---|
09a63b21 AM |
1 | diff -urN chkconfig-1.3.37.org/chkconfig.c chkconfig-1.3.37/chkconfig.c |
2 | --- chkconfig-1.3.37.org/chkconfig.c 2007-11-08 22:28:34.000000000 +0100 | |
3 | +++ chkconfig-1.3.37/chkconfig.c 2008-04-24 09:27:21.427392171 +0200 | |
4 | @@ -27,6 +27,7 @@ | |
82df657c | 5 | #include <unistd.h> |
09a63b21 | 6 | |
82df657c ER |
7 | static char *progname; |
8 | +extern int addItem; | |
82df657c ER |
9 | |
10 | #define _(String) gettext((String)) | |
09a63b21 AM |
11 | |
12 | @@ -243,12 +244,10 @@ | |
13 | frobDependencies(&s); | |
14 | else | |
15 | for (i = 0; i < 7; i++) { | |
16 | - if (!isConfigured(name, i, NULL, NULL)) { | |
82df657c ER |
17 | if ((1 << i) & s.levels) |
18 | doSetService(s, i, 1); | |
19 | else | |
20 | doSetService(s, i, 0); | |
21 | - } | |
22 | } | |
23 | ||
24 | return 0; | |
09a63b21 AM |
25 | @@ -558,7 +557,7 @@ |
26 | } | |
82df657c ER |
27 | |
28 | int main(int argc, char ** argv) { | |
09a63b21 AM |
29 | - int listItem = 0, addItem = 0, delItem = 0, overrideItem = 0; |
30 | + int listItem = 0, delItem = 0, overrideItem = 0; | |
82df657c | 31 | int rc, i, x; |
09a63b21 | 32 | int LSB = 0; |
82df657c | 33 | char * levels = NULL; |
09a63b21 AM |
34 | diff -urN chkconfig-1.3.37.org/leveldb.c chkconfig-1.3.37/leveldb.c |
35 | --- chkconfig-1.3.37.org/leveldb.c 2007-08-03 19:57:56.000000000 +0200 | |
36 | +++ chkconfig-1.3.37/leveldb.c 2008-04-24 09:27:34.124665839 +0200 | |
37 | @@ -26,6 +26,10 @@ | |
82df657c ER |
38 | #include <stdio.h> |
39 | #include <string.h> | |
40 | #include <unistd.h> | |
41 | +#include <sys/types.h> | |
42 | +#include <dirent.h> | |
43 | + | |
44 | +int addItem = 0; | |
45 | ||
46 | /* Changes | |
09a63b21 AM |
47 | 1998-09-22 - Arnaldo Carvalho de Melo <acme@conectiva.com.br> |
48 | @@ -563,6 +567,25 @@ | |
49 | serv.provides[1] = NULL; | |
50 | } | |
82df657c ER |
51 | |
52 | + if (addItem) { | |
09a63b21 AM |
53 | + DIR *dir; |
54 | + struct dirent *dirent; | |
55 | + int i; | |
56 | + | |
57 | + strcpy(levelbuf,"/etc/rc.d/rc0.d"); | |
58 | + for(i=0;i<7;i++,levelbuf[12]++) { | |
59 | + dir=opendir(levelbuf); | |
60 | + if (!dir) return 1; | |
61 | + while ((dirent=readdir(dir))) { | |
62 | + if (strlen(dirent->d_name)<4) continue; | |
63 | + if (strcmp(dirent->d_name+3,name)) continue; | |
64 | + if (*dirent->d_name=='K') serv.levels &= ~(1<<i); | |
65 | + else if (*dirent->d_name=='S') serv.levels |= 1<<i; | |
66 | + } | |
67 | + closedir(dir); | |
82df657c | 68 | + } |
82df657c ER |
69 | + } |
70 | + | |
71 | *service = serv; | |
72 | return 0; | |
73 | } |