Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- import commands
- import os
- from sys import exit
- # exit()
- config = {
- 'Mythrios' : 'Mythrios', # Name of the wow server (Prefix for the screen session)
- 'root' : 'root', # User that should run the server processes
- }
- # List of processes that should be checked periodically
- daemons = {
- 'logon' : '/opt/mangos1/mangos-realmd',
- 'realmname' : '/opt/mangos1/mangos-worldd'
- }
- for name, path in daemons.iteritems():
- if not path in commands.getoutput('ps -Af'):
- os.chdir(os.path.dirname(path))
- os.system('screen -A -m -d -S ' + config['servername'] + '_' + name + ' sudo -u ' + config['user'] + ' ' + path)
- print '[Restarteur] Lancement ' + name
- else:
- print '[Restarteur]', name, 'Est deja lancer'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement