I’ll to announce ControlDaemon a Wrapper Python Library for the command service on Fedora and CentOS, the functions in the services are: Start, Stop, Restart, Get Status and Get memory usage for all threads of a service. You can download the library from the GitHub repo: https://github.com/yograterol/python-ctrldaemon. I only try the library on Fedora and CentOS, I don’t know if work in another distros.
ControlDaemon
Installation
1 2 3 | git clone https://github.com/yograterol/python-ctrldaemon cd python-ctrldaemon python setup.py install |
Usage
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | # Import from ctrldaemon import ControlDaemon # Create object ctrld = ControlDaemon("httpd") # Start the service ctrld.start()#Debe devolver True # Restart the service ctrld.restart() # Stop the service ctrld.stop() # Get memory in MB, before start or restart the service ctrld.start() ctrld.get_memory_usage() # Get status (True - Running, False - Stopped) ctrld.get_status() |
License
This library is licensing in BSD License.