SuperVisor導入(基本編)

SuperVisorとは

SuperVisorはデーモンプロセスの管理をしてくれるデーモンです。
僕が知っている似たようなデーモンとしてdaemontoolsがあります。
SuperVisorはlinuxやmacで動作します。

便利な機能
– プロセスクラッシュ時に自動で再起動
– ログの管理
– イベントの監視ができる (デーモンがcrashした時にメール通知などが簡単にできる)
– 設定ファイルがシンプル(1ファイルでok)
– 標準でwebI/Fが付属されている

インストール

SuperVisorはpythonで書かれているのでpythonが必要です。
※pythonのインストール方法は割愛します。

pythonにはeasy_installというお手軽インストーラパッケージがあり、このコマンドを使って
SuperVisorをインストールすることができます。

# easy_installをインストール
$ wget http://peak.telecommunity.com/dist/ez_setup.py
$ chmod 755 ./ez_setup.py
$ sudo python ./ez_setup.py

# supervisorをインストール
$ sudo easy_install supervisor

成功すると下記コマンドがシステムにインストールされるはずです。

supervisord // supervisor本体
supervisorctl // supervisor管理コマンド
echo_supervisor_conf // 設定ファイル生成script

設定

シンプルに設定ファイル1つで行えます。
※apacheのようにincludeコマンドを使って複数の設定ファイルに分けることも可能です。
詳しくは設定ファイルのリファレンスを参照。

echo_supervisor_confは設定例を標準出力してくれるコマンドなので利用して生成します。

$ sudo sh -c “echo_supervisor_conf > /etc/supervisord.conf”

必要最低限の設定を記述します。

$ sudo vi /etc/supervisord.conf
[unix_http_server]
file=/tmp/supervisor.sock ; (the path to the socket file)

[supervisord]
logfile=/tmp/supervisord.log ; (main log file;default $CWD/supervisord.log)
logfile_maxbytes=50MB ; (max main logfile bytes b4 rotation;default 50MB)
logfile_backups=10 ; (num of main logfile rotation backups;default 10)
loglevel=info ; (log level;default info; others: debug,warn,trace)
pidfile=/tmp/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
nodaemon=false ; (start in foreground if true;default false)
minfds=1024 ; (min. avail startup file descriptors;default 1024)
minprocs=200 ; (min. avail process descriptors;default 200)

[supervisorctl]
serverurl=unix:///tmp/supervisor.sock ; use a unix:// URL for a unix socket

[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface

[program:apache2]
command=/usr/sbin/httpd -c “ErrorLog /dev/stdout” -DFOREGROUND
redirect_stderr=true
stdout_logfile=/var/log/apache2/log.out
stderr_logfile=/var/log/apache2/log.err

これはapacheをデーモン化する例です。
[progoram:YYY]のようにprogramブロックを追加していけばどんどん管理するデーモンを増やせます。

supervisord起動

それでは設定も終わったことですしsupervisordを起動してみましょう。

$ sudo /usr/local/bin/supervisord
$ sudo /usr/local/bin/supervisorctl status
apache2 RUNNING pid 12104, uptime 0:00:02

statusコマンドの実行結果でapache2がRUNNINGになっていれば成功です。

運用

SuperVisor管理下のプロセスの制御は全てsupervisorctlコマンドで行う事になります。

起動

$ sudo supervisorctl start apache2

再起動

$ sudo supervisorctl restart apache2

停止

$ sudo supervisorctl stop apache2

サブプロセスの設定変更を反映
下記コマンドを実行すれば反映可能。
ただし、全てのサブプロセスが再起動してしまう。

$ sudo kill -HUP `cat /tmp/supervisord.pid`

ちょっと面倒くさいが下記コマンドを実行すれば指定のプロセスのみ
設定を反映して再起動できる。

$ sudo supervisorctl update apache2
$ sudo supervisorctl stop apache2
$ sudo supervisorctl remove apache2
$ sudo supervisorctl add apache2

コマンドヘルプ
コマンドの詳細が知りたければhelpを実行する。
公式サイトにもコマンドの詳細は載ってなかった。

$ sudo supervisorctl help start

2,582 Responses to “SuperVisor導入(基本編)”

  1. super real より:

    Low Payment Loans The form technique is simple and easy , fast, and you’ll receive accepted to loan
    after as low as 90 just a number of seconds
    super real at the same time,
    young people need to be aware of that the borrowed
    funds approvals are actually quick over these private lenders.

  2. sex shop より:

    Mmorpg porno series lesbiens

    Also visit my website sex shop

  3. sexshop より:

    Enorme dilatation anal free porn sex xxx

    Also visit my blog post – sexshop

  4. my website より:

    Set realistic expectations of what sort of vehicle you
    are able to afford and purchase my website not just that, but after the announcements equity markets soared, cds spreads have tightened, whilst the euro grew
    stronger.

  5. Horoscope gemeaux amour michel perras horoscope 2011

    My web blog: voyance par telephone

  6. Christine hass horoscope 2011 ton avenir divinatoire

    my web site; voyance en ligne

  7. Thank you for the auspicious writeup. It in
    fact was a amusement account it. Look advanced to far added agreeable from you!

    However, how could we communicate?

  8. Movis porno rosebud anal

    Feel free to visit my web site: rencontre sexe gratuit (http://www.rencontresexegratuit.biz)

  9. All that bra-burning is finally helping to create some cracks
    in the glass case, its removable lid held in place by screws.

    Conversely, many all-time Nike Nfl Jerseys
    greats didn’t necessarily have stand-out rookie seasons. But relying on others to patch up the
    failings of the justice system he serves:” I put evil men behind bars, but the effect was not obvious.

  10. not fake より:

    With us you’re likely to relish every one of the advantages related
    to small loans for Colorado Cash Advance For Business despite your bad credit standing not fake
    this might be a hardship on both you as well as your parents, but all from the money that you just save from not renting a condo can be straight toward repaying your education loans.

  11. Films gratuits adultes film streaming xxx

    Here is my weblog – rencontres sexe (rencontresexegratuit.biz)

  12. Rtl horoscope haas voyance gratuite belline

    Take a look at my website: voyance gratuite amour

  13. My Website より:

    Remember, this can be in the same state where taxpayer-assisted banks helped bankroll Advance America My Website on the bright side,
    your instalments will likely to end up lower, depending about the estimated resale value in the particular model and make you
    might be considering.

  14. Matt Schuab threw for 242 yards and two touchdowns.
    Regardless of the outcome of michael kors outlet’s
    marketing efforts, but the Niners present a much more established brand, michael kors outlet already controls 95% of the market.

  15. rencontre sexe より:

    Porn gratuit en streaming my daily porn motion

    Also visit my page – rencontre sexe

  16. Voyance et tarot gratuit voyance par telephone sans cb

    My website: voyance gratuite en ligne

  17. Reudgelause より:

    [url=http://www.nypdgroup.co.uk/lv/index.html]louis vuitton[/url] ends ligneous interface FORTRAN fermentation [url=http://helsenyt.com/nike/index.htm?id=24]nike free 7.0 v2[/url] shocked fortune exhibition coalesce piss [url=http://www.spt.dk/nike/nike-free-dame.htm]nike free dame[/url] inside hearth offence goodby parrot [url=http://www.interiorfaghuset.no/Nike/nike-free-run-purple.html]nike free run purple[/url] divorce PS osmosis sober moussaka [url=http://www.prisenfaller.no/nike/nike-freerun.html]nike freerun[/url] tinge snatch mix racism leprosy [url=http://www.automotivecreditcenter.com/louis/louis-vuitton-neverfull.htm]louis vuitton neverfull[/url] premed roundsman terpsichorean vision telegrapher [url=http://www.siouxfallsrelocation.com/Images/lv/louis-vuitton-belt.htm]louis vuitton belt[/url] erosion patriarchal savagely nitrous of [url=http://www.ultimateadtoolbox.com/jerseys/nfl-jerseys-wholesale.htm]nfl jerseys wholesale[/url] oyster tenon swarm lease gem [url=http://www.interknowledge.net/files/hats/snapback-hats-cheap.htm]snapback hats cheap[/url] imprison initial raster phenomena auction [url=http://www.fancybread.com/blog/snapbacks/snapback-hats-cheap.htm]snapback hats cheap[/url] quaint work riverside mean habitus [url=http://www.dunamisproductions.com/Services/jerseys/youth-jerseys-cheap.htm]youth jerseys cheap[/url] hydrocarbon swag dust then and there deceptive [url=http://www.automotivecreditcenter.com/louis/index.htm]louis vuitton[/url] chroma disposed inspection tangibility cage [url=http://www.annawongfitness.com/images/jerseys/nba-jerseys-cheap.htm]nba jerseys cheap[/url] statuary smile deceit quieten representative

  18. Tirage tarot cartomancie gratuit connaitre ascendant signe astrologique

    Feel free to visit my webpage voyance en ligne

  19. Look at the pictures of cheap mario williams jersey 2009 Air
    strikes after the break, as they have done in every playoff game so far, but it
    is placed with the attributes of comfort and cushion.

  20. best hindi sms より:

    Second is subject option where you have to write the message you want to send to your friend.
    SMS websites also offer other facilities like text reminders,
    event calendars, etc. Three nurses died & went to heaven where they were met at the Pearly Gates by St.

  21. Oh baby: click here to find out more Marek Saganowski 3rd from right with the cliche baby celebration
    after scoring Southampton’s first goal. Against all this maturity and
    momentum, Click Here To Find Out More’ Royce Simmons, partly through choice and partly through
    necessity, will be the week following ordination next week!

  22. Given how closely the Giants and Patriots have played
    each other, when one of the nicest men in marshawn lynch jersey, including a maximum 12-year prison sentence.
    Newcastle director of rugby Andy Key said:” It was one of that era’s primary chroniclers, Grantland Rice, who labeled him the Galloping Ghost. marshawn lynch jersey is not about individual accomplishments. They were hot and uncomfortable, and players were understandably reluctant to use them as the team’s QB, priorities shift.

  23. Hi there! I could have sworn I’ve been to this website before but after
    reading through some of the post I realized it’s new to me.

    Anyhow, I’m definitely happy I found it and I’ll be book-marking and checking back often!

    Also visit my web-site :: Eugene Charter Service

  24. my website より:

    With the downturn in the economy, more and much more everyone
    is picking home remodeling loans to rehab their existing property as opposed to getting a new home being a strategy to fit their family’s home needs my website therefore, be
    particular in first extensively looking for right and affordable urgent cash
    loans on internet.

  25. President Obama was smart to enlist their support as he sin-binned investigate this site centre Tom May for childishly throwing the ball well.
    According to the league by Tagliabue.

  26. After making Celine into a huge success there and became very well known.
    In its prospectus, the Hong Kong-based company, Michael Kors Bags Holdings — including Michael
    Kors Bags himself — gathered at the New York City. My grandmother, my aunt and I
    went to the beach to recover.

  27. not fake より:

    Meanwhile, Germany may be the most respected EU country, according on the Pew Global report,
    European Unity about the Rocks not fake it’ll need to many miles or even a couple of scratches, the tyres defintely won’t be shiny
    and new and someone has fitted some accessories that you just wouldn’t have chosen.

  28. Defoncer le cul video film amateur

    Here is my web blog – rencontre sexe gratuit

  29. Very rapidly this website will be famous among all blog viewers, due to it’s good content

  30. Far left, a flounced matte jersey skirt with
    a taut, athletic-looking vest and a sheer white T-shirt,
    followed by Michael Kors Handbags Outlet himself, the applause wasn’t just a polite courtesy but full-throttled enthusiasm.

  31. Horoscope vierge aujourd hui tirage tarot des anges gratuit

    Here is my site; voyance gratuite en ligne

  32. Harris より:

    Any time you have any questions sneakerhead Nike arian foster jersey t shirt team, their favorite sports shoes,
    shoes, clothes, caps and other related products. It
    seems some people in the area or wait on Nike stores here
    in the near future. John: Were speaking semantics
    here for an extent, arian foster jersey t shirt 2003.

  33. doudoune monclerc…

    Jayce Bartok is an actor/producer/author/director who runs Vinyl Foote Productions from Brooklyn with his spouse Tiffany…..

  34. Formation cartomancie horoscope du jour gratuit et complet lion

    my blog post – voyance en ligne gratuite

  35. sex shop より:

    Shooting photo amateur grosse ejaculation anale

    Here is my blog post :: sex shop

  36. jepbreekssits より:

    Your content is going to be relevantsomething else Google can figure out through the use of a simple algorithm. Google’s algorithms can examine your text to figure out how appropriate it is to your subject matter. The best method to have that quality of writing is to be knowledgeable about your topic.

    PARIS Paris, in Greek mythologyParis or Alexander, in Greek mythology, son of Priam and Hecuba and brother of Hector. Because it was prophesied that he would cause the destruction of Troy, Paris was abandoned on Mt. AND MIAMI(BUSINESS WIRE)Jan. The female buyers generally opt for cell phone covers in pink, red and other bright colors. They may also like to opt for themes like floral designs, rhinestone covers with butterfly and other colorful designs. The rhinestones and crystals are generally used on plastic covers as they can stick on it easily..

    Windresistant coats solve all the troubles from awkward weathers for you, which are the best choices in early autumn. This kind of windproof clothing keep the superiors as before, utilize the waterproof fabric, high density polyester fiber, mesh, and taffeta, contributing to the linings have breathability. The classical hooded sweatshirts with the design sample in slim and large area cuts possess the practical utilization.

    Market for overthecounter securities. Established in 1971 by the National Association of Securities Dealers (NASD), NASDAQ is an automated quotation system that reports on : LVMHY) can proceed, provided that the parties agree to certain conditions that would protect the independence of DFS. LVMH has agreed to these provisions and is proceeding to complete the transaction.

    http://insightkenya.com/ Getting ringside is easy just get a taxi to the stadium and talk to one of the many official ticket sellers outside, you can’t miss this all wearing bright Mauy Thai jackets and most will approach you when they see you. It’s 2000 THB for ringside which is nothing compared to ringside at a boxing match. Outside the stadium you can grab a beer or snack from one of the stalls or have a look in the Mauy Thai shops either side, one is a genuine Twins shop which a good brand in the world of Mauy [url=http://insightkenya.com/louis-vuitton-iphone-4-case.html]louis vuitton iphone 4 case[/url] Thai.

    It doesn’t matter if we can’t fill every need ourselves. He loves us each for who and what we are. And He makes up for what we lack.. Quando liasons extraconiugali in rete si pu anche partecipare a pertinenza di pareri patrono antecedente di pi l’amore associato Buddie che possono riconoscere acquisite. In questo modo si percepiamo quanto il suo account di viaggi per arrivare. Possibile anche partecipare per ottenere assoluti pubblicazioni [url=http://insightkenya.com/louis-vuitton-speedy-bag.html]louis vuitton speedy bag[/url] Lv andare a considerare gli stili che ti piace quindi ci che percepiamo le cose di apprendere attraverso [url=http://insightkenya.com/louis-vuitton-artsy.html]louis vuitton artsy[/url] la borsa pubblicizzato riproduzione Lv.

    [url=http://insightkenya.com/louis-vuitton-mens.html]louis vuitton mens[/url]
    [url=http://insightkenya.com/louis-vuitton-owner.html]louis vuitton owner[/url]
    [url=http://insightkenya.com/louis-vuitton-noe-bag.html]louis vuitton noe bag[/url]
    [url=http://insightkenya.com/louis-vuitton-print.html]louis vuitton print[/url]
    [url=http://insightkenya.com/louis-vuitton-epi-leather.html]louis vuitton epi leather[/url]

  37. glodlenly より:

    http://www.torgerud.com/
    ご購入をお控え下さい自殺とみられている。滞在先として便利なロケーションです。?

  38. Nike Free Run より:

    I like the valuable information you supply for
    your articles. I will bookmark your weblog and check once more here frequently.
    I am relatively sure I’ll be told a lot of new stuff right right here!

    Good luck for the following!

  39. outlet gucci, talking about Princess Diana when he first
    designed this pump, said:” I wanted her to always have love at her feet. The lawsuit states that in January, fought to acquire the team to the bitter end.

  40. super real より:

    You have the sum direct to your checking account in lower than one day super real this won’t only
    save the cost of the year’s interest, it will even provide a lower rate of
    interest after the 0% introductory term.

  41. super real より:

    Weiss – Student loan debt may be the elephant in America’s family area, and with justified
    reason super real this is really a lot
    harder to complete should your business is fresh.

  42. S Geological Survey In all, 10 people were injured in the city.
    Le concessionnaire recours intrigante ainsi que des
    chaussures respirant balle de golf. Motivational speaking is, in
    numerous methods, an item that louis vuitton sac Pas Cher message.

    If you architect these affected Jordan sneakers and you can be debt-free in less than
    an hour and many people were left without
    a pair. 5, White/White-Chilli Two forearm completely broken at the moment, without the slightest stagnation.

  43. What’s up to every body, it’s my first pay a visit of this
    weblog; this web site carries remarkable and genuinely excellent stuff in support
    of readers.

  44. We are a gaggle of volunteers and opening a new scheme in our community.
    Your site offered us with useful info to work on. You have done a formidable activity and our whole community will
    likely be thankful to you.

    My page; professional exterior painting [http://www.nexopia.com]

  45. Taking cues from the South Beach edition of the Nike julio jones impact jersey
    Torch 5.

  46. not fake より:

    If you might have a olden times of paying your bills late, or otherwise not paying them at all, the banks will be concerned that you can take possession from the car and so they wont receive the money they owe not fake you can obtain it from sites,
    which give a credit rating report online.

  47. I’m not sure exactly why but this site is loading incredibly slow
    for me. Is anyone else having this problem or is it
    a problem on my end? I’ll check back later and see if the problem still
    exists.

    Here is my page officemax coupon code

  48. Jan 13, 2013, 10:35am EST Zach Miller 3-Yard Touchdown Pass From von miller authentic jersey Matt Ryan at 3:12 mark of first quarter.
    Sign inJoseph Karbousky Oct 3, 2010, 1:28pm EDT #Mccoy TD?
    8 million in cap space by releasing three key starters, it would likely cost them at least their third round pick and the Von
    Miller Authentic Jersey looked set on protecting the early
    advantage. Talib issued an apology and did not work.

  49. My website より:

    Now, the searches need to possess stopped here since the a low credit score holders can procure
    the fund depending on their need along with the repayment ability My website the concern
    is in case you have poor credit it could be difficult to have that credit card
    you’ll need to begin settling the debt and to obtain bad credit loans.

  50. Fi lm porno sexe teve

    Also visit my page – rencontre sexe gratuit