def daemon(): euid = os.geteuid() if euid != 0: print "Script not started as root. Running sudo.." args = ['sudo', sys.executable] + sys.argv + [os.environ] # the next line replaces the currently-running process with the sudo os.execlpe('sudo', *args) print 'Running. Your euid is', euid daemonize(VNFManagerAdapter)
def daemon(): daemonize(Pasta)
def daemon(): daemonize(ExampleScaling)
def daemon(): daemonize(Specification)
def daemon(): daemonize(Storage)