diff -Nru chkconfig-1.2.24h.orig/chkconfig.c chkconfig-1.2.24h/chkconfig.c --- chkconfig-1.2.24h.orig/chkconfig.c Wed Jul 17 20:10:55 2002 +++ chkconfig-1.2.24h/chkconfig.c Wed Jan 22 11:56:32 2003 @@ -31,6 +31,7 @@ #include #include static char *progname; +extern int addItem; struct config conf; // used by leveldb.c #define _(String) gettext((String)) @@ -94,12 +95,10 @@ if (s.type == TYPE_XINETD) return 0; for (i = 0; i <= conf.maxlevel; i++) { - if (!isConfigured(name, i)) { if ((1 << i) & s.levels) doSetService(s, i, 1); else doSetService(s, i, 0); - } } return 0; @@ -275,7 +274,7 @@ int main(int argc, char ** argv) { - int listItem = 0, addItem = 0, delItem = 0; + int listItem = 0, delItem = 0; int rc, i, x; char * levels = NULL; int help=0, version=0; diff -Nru chkconfig-1.2.24h.orig/leveldb.c chkconfig-1.2.24h/leveldb.c --- chkconfig-1.2.24h.orig/leveldb.c Fri Apr 19 03:15:55 2002 +++ chkconfig-1.2.24h/leveldb.c Wed Jan 22 12:04:47 2003 @@ -11,6 +11,10 @@ #include #include #include +#include +#include + +int addItem = 0; /* Changes 2001-12-03 - Petter Reinholdtsen @@ -231,6 +235,9 @@ char overflow; char levelbuf[20]; char * english_desc = NULL; + DIR *dir; + struct dirent *dirent; + int i; sprintf(filename, "%s/%s", conf.initdir, name); @@ -345,6 +352,21 @@ serv.name = strdup(name); + if (addItem) { + strcpy(levelbuf,"/etc/rc.d/rc0.d"); + for(i=0;i<7;i++,levelbuf[12]++) { + dir=opendir(levelbuf); + if (!dir) return 1; + while ((dirent=readdir(dir))) { + if (strlen(dirent->d_name)<4) continue; + if (strcmp(dirent->d_name+3,name)) continue; + if (*dirent->d_name=='K') serv.levels &= ~(1<d_name=='S') serv.levels |= 1<