SlideShare a Scribd company logo
1 of 15
Download to read offline
Installation
•
Linux? 
• As easy as 'pip install supervisor'
•
Windows? 
• No not possible
•
Other Installation methods
Kick Start? Yes!
•
See what options exists 
<echo_supervisord_conf>
•
Create your config file like this
•
What are we waiting for ???
<supervisord ­c /etc/supervisor/supervisord.conf>
Alright. So what does it do.
•
Not a replacement for upstart/systemd/init
•
Compliments service manager. How?
•
Service manager start your process on boot, but do not monitor crash
•
Does not depend of pid files
•
Allows non root users to start/stop/restart user level services
•
Ordering of service start up
•
Daemonizes your script and logs its <stdout> and <stderr>
•
Provides hooks you could exploit in your code  
•
Read it yourselves
Whats it got?
•
The server <supervisord>
•
The client <supervisorctl>
•
What else?
•
'XML-RPC API'
•
'Web UI'
•
'Event management'
Lets Process!
●
  Your process need not be a daemon
●
  Could be as simle as printing a few lines
●
Yes just print. Supervisord will log it for you.
import os
import time
sin, sout, serr = os.popen3('ps ­ef ')
while 1:
    print sout.read()
    print serr.read()
    time.sleep(10)
●
  Tell supervisord to manage your process
[program:process_check]
command=python /home/akandavelu/spyder/supervisord_learning/process_check.py
Start ! Stop ! Restart !
•
Relax ! supervisorctl  will do it for you.
supervisorctl -u user -p 123 status process_check
supervisorctl -u user -p 123 restart process_check
supervisorctl -u user -p 123 stop process_check
supervisorctl -u user -p 123 tail process_check
That is not all
•
Process will be started in the order in which they are 
specified
•
More control on process is available through events
•
Process can be started/stopped in groups
•
Complete list of process options
Lets do it on Web
•
Enable XML RPC and HTTP in supervisor config file
[unix_http_server]
file=/tmp/supervisor.sock ; (the path to the socket file)
chmod=0700 ; socket file mode (default 0700)
chown=nobody:nogroup ; socket file uid:gid owner
username=user ; (default is no username (open server))
password=123 ; (default is no password (open server))
[inet_http_server] ; inet (TCP) server disabled by default
port=127.0.0.1:9001 ; (ip_address:port specifier, *:port for all iface)
username=user ; (default is no username (open server))
password=123 ; (default is no password (open server))
Do it from another program
•
The XML RPC api allows for interaction to supervisord 
programatically
import xmlrpclib
server = xmlrpclib.Server('http://localhost:9001/RPC2')
server.system.listMethods()
server.supervisor.getAllProcessInfo()
Child Process Logging
•
By default stdout and stderr of child process are 
stored in /tmp 
•
Can be changed using 'childlogdir' param in 
config file
•
Options for logging stdout and stderr to separate 
files, along with max file size are available.
Events ??
•
To detect process crash and respond accordingly
•
Generate crash report and notify admin via mail
•
How does it happen?
• User specifies event listeners in supervisor config file
• User specifies what event types the listener should be sent
• Supervisord talks to the listener via its stdin and stdout in
pre defined format
Create a listener
•
Configure a listener that subscribes for crash event 
from a process
[eventlistener:check_process_crash]
command=python /home/akandavelu/spyder/supervisord_learning/check_process_crash.py
events=PROCESS_STATE_EXITED
•
Started listener would be invoked every time any 
process exits
•
Listeners could aslo be configured to run at a specified 
frequency
More ?
•
Writing listeners is easiers in python with 
'supervisor.childutils'
•
Supervisord XML RPI can be customized
•
Configure supervisord to send mails on events
•
Automate you build
•
Third party applications using supervisord.
More ??
•
Supervisord is opensource so you can contribute
•
Its extensible, so you can add more features on the 
fly
Thank You
Ageeleshwar K

More Related Content

Viewers also liked

Riak a successful failure
Riak   a successful failureRiak   a successful failure
Riak a successful failure
GiltTech
 
Introducing Riak
Introducing RiakIntroducing Riak
Introducing Riak
Kevin Smith
 
Brugnoli System Ux
Brugnoli System UxBrugnoli System Ux
Brugnoli System Ux
frog
 

Viewers also liked (12)

Riak a successful failure
Riak   a successful failureRiak   a successful failure
Riak a successful failure
 
Riak - From Small to Large
Riak - From Small to LargeRiak - From Small to Large
Riak - From Small to Large
 
Job_Queues
Job_QueuesJob_Queues
Job_Queues
 
Riak in Ten Minutes
Riak in Ten MinutesRiak in Ten Minutes
Riak in Ten Minutes
 
Introducing Riak
Introducing RiakIntroducing Riak
Introducing Riak
 
Relational Databases to Riak
Relational Databases to RiakRelational Databases to Riak
Relational Databases to Riak
 
Introduction to Riak - Red Dirt Ruby Conf Training
Introduction to Riak - Red Dirt Ruby Conf TrainingIntroduction to Riak - Red Dirt Ruby Conf Training
Introduction to Riak - Red Dirt Ruby Conf Training
 
Gearman, Supervisor and PHP - Job Management with Sanity!
Gearman, Supervisor and PHP - Job Management with Sanity!Gearman, Supervisor and PHP - Job Management with Sanity!
Gearman, Supervisor and PHP - Job Management with Sanity!
 
Intro to riak
Intro to riakIntro to riak
Intro to riak
 
Brugnoli System Ux
Brugnoli System UxBrugnoli System Ux
Brugnoli System Ux
 
2015 ZendCon - Do you queue
2015 ZendCon - Do you queue2015 ZendCon - Do you queue
2015 ZendCon - Do you queue
 
MNPHP Scalable Architecture 101 - Feb 3 2011
MNPHP Scalable Architecture 101 - Feb 3 2011MNPHP Scalable Architecture 101 - Feb 3 2011
MNPHP Scalable Architecture 101 - Feb 3 2011
 

Similar to Supervisord, The Process Manager

Lotuscript for large systems
Lotuscript for large systemsLotuscript for large systems
Lotuscript for large systems
Bill Buchan
 

Similar to Supervisord, The Process Manager (20)

Serverless
ServerlessServerless
Serverless
 
Lotuscript for large systems
Lotuscript for large systemsLotuscript for large systems
Lotuscript for large systems
 
Serverless java
Serverless   javaServerless   java
Serverless java
 
Agile, DevOps & Test
Agile, DevOps & TestAgile, DevOps & Test
Agile, DevOps & Test
 
OSMC 2010 | NSClient++ - what's new? And what's coming! by Michael Medin
OSMC 2010 |  NSClient++ - what's new? And what's coming! by Michael MedinOSMC 2010 |  NSClient++ - what's new? And what's coming! by Michael Medin
OSMC 2010 | NSClient++ - what's new? And what's coming! by Michael Medin
 
Chef - Administration for programmers
Chef - Administration for programmersChef - Administration for programmers
Chef - Administration for programmers
 
Reporting service applications
Reporting service applicationsReporting service applications
Reporting service applications
 
Fixing Domino Server Sickness
Fixing Domino Server SicknessFixing Domino Server Sickness
Fixing Domino Server Sickness
 
Redundant devops
Redundant devopsRedundant devops
Redundant devops
 
Creating a continuous delivery pipeline with docker
Creating a continuous delivery pipeline with dockerCreating a continuous delivery pipeline with docker
Creating a continuous delivery pipeline with docker
 
Cloud Foundry Summit 2015: 12 Factor Apps For Operations
Cloud Foundry Summit 2015: 12 Factor Apps For OperationsCloud Foundry Summit 2015: 12 Factor Apps For Operations
Cloud Foundry Summit 2015: 12 Factor Apps For Operations
 
Continuous operations in AWS
Continuous operations in AWSContinuous operations in AWS
Continuous operations in AWS
 
WTF is Sensu and Monitoring
WTF is Sensu and MonitoringWTF is Sensu and Monitoring
WTF is Sensu and Monitoring
 
Best MCSA - SQL SERVER 2012 Training Institute in Delhi
Best MCSA - SQL SERVER 2012 Training Institute in DelhiBest MCSA - SQL SERVER 2012 Training Institute in Delhi
Best MCSA - SQL SERVER 2012 Training Institute in Delhi
 
Reliable mobile test automation
Reliable mobile test automationReliable mobile test automation
Reliable mobile test automation
 
Continuous Security Testing with Devops - OWASP EU 2014
Continuous Security Testing  with Devops - OWASP EU 2014Continuous Security Testing  with Devops - OWASP EU 2014
Continuous Security Testing with Devops - OWASP EU 2014
 
Neotys PAC - Bruno Audoux
Neotys PAC - Bruno AudouxNeotys PAC - Bruno Audoux
Neotys PAC - Bruno Audoux
 
Systemd = init + inetd
Systemd = init + inetdSystemd = init + inetd
Systemd = init + inetd
 
Devops with Python by Yaniv Cohen DevopShift
Devops with Python by Yaniv Cohen DevopShiftDevops with Python by Yaniv Cohen DevopShift
Devops with Python by Yaniv Cohen DevopShift
 
JustLetMeCode-Final
JustLetMeCode-FinalJustLetMeCode-Final
JustLetMeCode-Final
 

More from samof76 (8)

Python Subprocess
Python SubprocessPython Subprocess
Python Subprocess
 
Proces
ProcesProces
Proces
 
Process Management using Circus
Process Management using CircusProcess Management using Circus
Process Management using Circus
 
Lxc- Linux Containers
Lxc- Linux ContainersLxc- Linux Containers
Lxc- Linux Containers
 
Git.intro
Git.introGit.intro
Git.intro
 
AWS Use Cases
AWS Use CasesAWS Use Cases
AWS Use Cases
 
Cloud
CloudCloud
Cloud
 
Cloud- IaaS in Perspective AWS
Cloud- IaaS in Perspective AWSCloud- IaaS in Perspective AWS
Cloud- IaaS in Perspective AWS
 

Recently uploaded

CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
anilsa9823
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
anilsa9823
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 

Recently uploaded (20)

Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 

Supervisord, The Process Manager