It is common in BOSH job templates to use a single monit wrapper script for both start and stop instructions. That is, this monit file assumes there is a single gorouter_ctl script that can be run with either start or stop as the first command-line argument.Īlternately, two scripts could have been written and the monit file could have used them. When monit is told to stop processes it is configured above to again run the gorouter_ctl script, but with the argument stop. If monit ever detects that the process has stopped running, then it will again run gorouter_ctl start to restart the process. When monit is told to start all processes, monit will run the gorouter_ctl script with the argument start. Removing the file paths & timeout to make it easier to read: check process gorouter Stop program "/var/vcap/jobs/gorouter/bin/gorouter_ctl stop" Start program "/var/vcap/jobs/gorouter/bin/gorouter_ctl start" With pidfile /var/vcap/sys/run/gorouter/gorouter.pid Here is the monit file for running the gorouter in cf-release ( source). The most common syntax used by BOSH job templates is to start/stop a process. (Thanks Abhi for the first example!) Basic example This text will be removed by BOSH because of the "if" statement above. ![]() One way to "comment out" the contents of a monit file is to use ERb templating. To do nothing, make your monit file empty. So can a BOSH job template, via monit, do absolutely nothing? Yes.Ĭopy and paste the following into your job template’s monit file and when you deploy it it will do nothing. ![]() And BOSH releases must have a monit file. So to write BOSH releases you need to learn some monit syntax and to write monit wrapper scripts. On each running BOSH job server, BOSH delegates to the monit daemon to use these monit files to start/stop processes. When you are writing a BOSH release, each job template (the folders within the jobs/ folder of a release) contains a single monit file. There are some interesting basics and interesting top tips for using monit with BOSH. Writing your own BOSH release/configuration management is relatively simple – you get monit, and monit is relatively simple.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |