diff -urNpa chkconfig-1.15.orig/chkconfig.c chkconfig-1.15/chkconfig.c --- chkconfig-1.15.orig/chkconfig.c 2021-01-21 09:19:06.000000000 +0100 +++ chkconfig-1.15/chkconfig.c 2021-05-03 16:44:13.175185842 +0200 @@ -29,6 +29,7 @@ #include static char *progname; +extern int addItem; #define _(String) gettext((String)) @@ -347,12 +348,10 @@ static int addService(char *name, int ty rc = frobDependencies(&s); } else for (i = 0; i < 7; i++) { - if (!isConfigured(name, i, NULL, NULL)) { if ((1 << i) & s.levels) doSetService(s, i, 1); else doSetService(s, i, 0); - } } return rc; @@ -690,7 +689,7 @@ void forwardSystemd(const char *name, in } int main(int argc, const char **argv) { - int listItem = 0, addItem = 0, delItem = 0, overrideItem = 0, + int listItem = 0, delItem = 0, overrideItem = 0, noRedirectItem = 0; int type = TYPE_ANY; int rc, i, x; diff -urNpa chkconfig-1.15.orig/leveldb.c chkconfig-1.15/leveldb.c --- chkconfig-1.15.orig/leveldb.c 2021-01-21 09:19:06.000000000 +0100 +++ chkconfig-1.15/leveldb.c 2021-05-03 16:40:14.588185842 +0200 @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -41,6 +42,8 @@ #include "leveldb.h" +int addItem = 0; + int selinux_restore(const char *name) { struct selabel_handle *hnd = NULL; struct stat buf; @@ -729,6 +732,25 @@ int parseServiceInfo(int fd, char *name, serv.provides[1] = NULL; } + if (addItem) { + DIR *dir; + struct dirent *dirent; + int i; + + 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<