Skip to main content

supervisor manager

Project description


Simple program for testing:

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import time

if __name__ == '__main__':
    # exit()
        while True:
    except KeyboardInterrupt:

Simple config for supervisor:

command = /etc/supervisor/
stdout_logfile = /var/log/supervisor/infinity1-out.log
autostart = true
autorestart = true
redirect_stderr = true
>>> import svdlib
>>> t = svdlib.Supervisor()
>>> t.reread()
>>> [{'name': 'infinity1', 'status': 'available'}, {'name': 'infinity2', 'status': 'available'}]

>>> t.add('infinity1')
>>> {'result': False, 'status': 'ERROR', 'msg': 'process group already active'}

>>> t.add('infinity2')
>>> {'name': 'infinity2', 'result': True, 'msg': 'added process group'}
>>> t.add('infinity2')
>>> {'msg': 'process group already active', 'status': 'ERROR', 'result': False}

>>> t.status(process='infinity1')
>>> {'status': 'RUNNING', 'name': 'infinity1', 'pid': '2013', 'uptime': '0:21:25'}
>>> t.status()
>>> [{'uptime': '0:22:14', 'pid': '2013', 'status': 'RUNNING', 'name': 'infinity1'}, {'uptime': '0:00:03', 'pid': '2238', 'status': 'RUNNING', 'name': 'infinity2'}]

>>> t.stop(process='infinity2')
>>> {'result': True, 'status': 'stopped', 'name': 'infinity2'}

>>> t.remove(process='infinity2')
>>> {'msg': 'removed process group', 'result': True, 'name': 'infinity2'}

>>> t.remove(process='infinity2')
>>> {'name': 'infinity2', 'result': False, 'status': 'ERROR', 'msg': 'no such process/group'}


Apache License Version 2.0, January 2004

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for svdlib, version 0.0.2
Filename, size File type Python version Upload date Hashes
Filename, size svdlib-0.0.2.tar.gz (3.1 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page