Exemplo n.º 1
0
def changeBootState(serviceName, shouldStartAtBoot):
    if pkg.isAptOS():   # debian
        cmd = "sudo update-rc.d %s"
        if shouldStartAtBoot:   cmd += " defaults"
        else:                   cmd += " remove"
    elif pkg.isYumOS():
        cmd = "sudo chkconfig %s"
        if shouldStartAtBoot:   cmd += " on"
        else:                   cmd += " off"
    else:
        raise NotImplemented
    
    _OS.runCMD(cmd, serviceName)
Exemplo n.º 2
0
def remove(serviceName):
    if pkg.isAptOS():
        _OS.runCMD("sudo update-rc.d -f %s remove", serviceName)
    elif pkg.isYumOS():
        raise NotImplemented	# TODO