]>
Commit | Line | Data |
---|---|---|
3d7305a2 AF |
1 | --- chkconfig-1.2.16/chkconfig.c.wiget Thu Jul 13 21:42:54 2000 |
2 | +++ chkconfig-1.2.16/chkconfig.c Wed Nov 29 12:31:44 2000 | |
d8fc60be | 3 | @@ -12,6 +12,7 @@ |
4 | #include <unistd.h> | |
5 | ||
6 | static char *progname; | |
7 | +extern int addItem; | |
8 | ||
9 | #define _(String) gettext((String)) | |
10 | ||
3d7305a2 AF |
11 | @@ -75,12 +76,10 @@ |
12 | if (s.type == TYPE_XINETD) return 0; | |
13 | ||
d8fc60be | 14 | for (i = 0; i < 7; i++) { |
15 | - if (!isConfigured(name, i)) { | |
16 | if ((1 << i) & s.levels) | |
17 | doSetService(s, i, 1); | |
18 | else | |
19 | doSetService(s, i, 0); | |
20 | - } | |
21 | } | |
22 | ||
23 | return 0; | |
3d7305a2 AF |
24 | --- chkconfig-1.2.16/leveldb.c.wiget Wed Aug 30 23:35:52 2000 |
25 | +++ chkconfig-1.2.16/leveldb.c Wed Nov 29 12:40:20 2000 | |
d8fc60be | 26 | @@ -11,6 +11,10 @@ |
27 | #include <stdio.h> | |
28 | #include <string.h> | |
29 | #include <unistd.h> | |
30 | +#include <sys/types.h> | |
31 | +#include <dirent.h> | |
32 | + | |
33 | +int addItem = 0; | |
34 | ||
35 | /* Changes | |
36 | 1998-09-22 - Arnaldo Carvalho de Melo <acme@conectiva.com.br> | |
3d7305a2 AF |
37 | @@ -225,6 +229,9 @@ |
38 | char overflow; | |
39 | char levelbuf[20]; | |
40 | char * english_desc = NULL; | |
d8fc60be | 41 | + DIR *dir; |
42 | + struct dirent *dirent; | |
3d7305a2 | 43 | + int i; |
d8fc60be | 44 | |
45 | sprintf(filename, RUNLEVELS "/init.d/%s", name); | |
46 | ||
3d7305a2 | 47 | @@ -316,6 +322,21 @@ |
d8fc60be | 48 | } |
49 | ||
50 | serv.name = strdup(name); | |
51 | + | |
52 | + if (addItem) { | |
53 | + strcpy(levelbuf,"/etc/rc.d/rc0.d"); | |
54 | + for(i=0;i<7;i++,levelbuf[12]++) { | |
55 | + dir=opendir(levelbuf); | |
56 | + if (!dir) return 1; | |
57 | + while ((dirent=readdir(dir))) { | |
58 | + if (strlen(dirent->d_name)<4) continue; | |
59 | + if (strcmp(dirent->d_name+3,name)) continue; | |
60 | + if (*dirent->d_name=='K') serv.levels &= ~(1<<i); | |
61 | + else if (*dirent->d_name=='S') serv.levels |= 1<<i; | |
62 | + } | |
63 | + closedir(dir); | |
64 | + } | |
65 | + } | |
66 | ||
67 | *service = serv; | |
68 | return 0; |