Sophie

Sophie

distrib > Mageia > 8 > x86_64 > by-pkgid > 381785ef4c01f103804947e08a58df6e > files > 7

chkconfig-1.14-1.mga8.src.rpm

From c58f8bc5ce5274fbeba0a526e08d7e06b30c808d Mon Sep 17 00:00:00 2001
From: Andrey Borzenkov <arvidjaar@gmail.com>
Date: Wed, 24 Jun 2015 09:27:31 +0100
Subject: [PATCH 903/907] chkconfig: Support adding/deleting xinetd 'services'

(cg) We should probably aim to kill xinetd services shipped in MGA
---
 chkconfig.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/chkconfig.c b/chkconfig.c
index d88ab5d..e33302c 100644
--- a/chkconfig.c
+++ b/chkconfig.c
@@ -103,10 +103,14 @@ static int delService(char *name, int type, int level) {
         readServiceError(rc, name);
         return 1;
     }
-    if (s.type == TYPE_XINETD)
-        return 0;
 
     checkRoot();
+    
+    if (s.type == TYPE_XINETD) {
+        setXinetdService(s, 0);
+        system("/sbin/service xinetd reload >/dev/null 2>&1");
+        return 0;
+    }
 
     if (LSB && level == -1) {
         numservs = readServices(&services);
@@ -305,10 +310,13 @@ static int addService(char * name, int type) {
         return 1;
     }
 
-    if (s.type == TYPE_XINETD)
-        return 0;
     checkRoot();
 
+    if (s.type == TYPE_XINETD) {
+        setXinetdService(s, 1);
+        system("/sbin/service xinetd reload >/dev/null 2>&1");
+        return 0;
+    }
     if (s.isLSB) {
         for (i = 0; i < 7; i++) {
             if (isConfigured(s.name, i, NULL, NULL))
-- 
2.3.2