summaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/Client/Frame.py3
-rw-r--r--src/lib/Client/Tools/SMF.py10
2 files changed, 10 insertions, 3 deletions
diff --git a/src/lib/Client/Frame.py b/src/lib/Client/Frame.py
index 16fa3e11a..d6424b603 100644
--- a/src/lib/Client/Frame.py
+++ b/src/lib/Client/Frame.py
@@ -15,7 +15,8 @@ def promptFilter(prompt, entries):
continue
return ret
-toolset_defs = {'rh': {'Service':'chkconfig', 'Package':'rpm'}}
+toolset_defs = {'rh': {'Service':'chkconfig', 'Package':'rpm'},
+ 'debian': {'Service':'deb', 'Package':'deb'}}
class Frame:
'''Frame is the container for all Tool objects and state information'''
diff --git a/src/lib/Client/Tools/SMF.py b/src/lib/Client/Tools/SMF.py
index 57d1ea8f7..e2ad2f80b 100644
--- a/src/lib/Client/Tools/SMF.py
+++ b/src/lib/Client/Tools/SMF.py
@@ -84,8 +84,14 @@ class SMF(Bcfg2.Client.Tools.Tool):
% (loc.replace('/S', '/DISABLED.S'), loc))
cmdrc = 1
else:
- cmdrc = self.cmd.run("/usr/sbin/svcadm enable -r %s" % \
- (entry.get('FMRI')))[0]
+ srvdata = self.cmd.run("/usr/bin/svcs -H -o STA %s" %
+ entry.get('FMRI'))[1] [0].split()
+ if srvdata[0] == 'MNT':
+ cmdarg = 'clear'
+ else:
+ cmdarg = 'enable'
+ cmdrc = self.cmd.run("/usr/sbin/svcadm %s -r %s" % \
+ (cmdarg, entry.get('FMRI')))[0]
return cmdrc == 0
def Remove(self, svcs):