[Glass] Monit scripts for gemstone?
Mariano Martinez Peck
marianopeck at gmail.com
Tue Aug 19 22:11:40 PDT 2014
Johan,
I have been having some problems when running monit scripts together with
init.d scripts.
So...before everything...are you using init.d to start your stones as well?
or you let monit do it lazily?
if the later...how do you handle a proper shutdown? it happens to me that
some lock files remind alive but the process are gone. So upon reboot, I
cannot start my process again.
In summary.... I am having problems with locks file in /opt/gemstone/locks
and the presence of both, init.d and monit scripts.
I can explain with more details what I am doing exactly, but just wanted to
know what you were doing.
Thanks!
On Tue, Aug 19, 2014 at 3:52 PM, Mariano Martinez Peck <
marianopeck at gmail.com> wrote:
> Thanks Johan, Monit is working nice :)
>
>
> On Mon, Aug 18, 2014 at 7:59 PM, Johan Brichau <johan at yesplan.be> wrote:
>
>> Hi Mariano,
>>
>> Yes, that is the procedure we use for the stone pid.
>> In our script, this happens at the end:
>>
>> gslist -p -n $GEMSTONE_NAME > $GEMSTONE_DATADIR/$GEMSTONE_NAME.pid
>>
>> cheers,
>> Johan
>>
>> On 18 Aug 2014, at 15:31, Mariano Martinez Peck <marianopeck at gmail.com>
>> wrote:
>>
>> > Hi Johan,
>> >
>> > Sorry for the late answer. Thank you very much for this very useful
>> Monit script. I am adapting it for my usage. I have only one small
>> question. You check the stone PID, but in my case, because of the way I
>> start the stone, I get no pid created for the stone. Do you do anything
>> special upon stone startup to write pid file and remove it upon stop? If
>> true, can I see how?
>> >
>> > I was planning to use: gslist -p -n myStoneName >> myStoneName.pid
>> > or something like that.
>> >
>> > Thanks in advance.
>> >
>> >
>> >
>> > On Thu, Dec 19, 2013 at 11:09 AM, Johan Brichau <johan at yesplan.be>
>> wrote:
>> > Hi Mariano,
>> >
>> > This is what I setup for each stone.
>> > Change the file paths, the user/group names, fill in the TEMPLATE and
>> PORTxx stuff, adapt the timeouts to your need and you should be good to go.
>> >
>> > Johan
>> >
>> > #################################
>> > ## TEMPLATE
>> > #################################
>> > check process fastcgi_PORT1_TEMPLATE with pidfile
>> /opt/gemstone/stones/TEMPLATE/data/FastCGI_server-PORT1.pid
>> > start program = "/home/yesplan/yesplanscripts/startYesplanGems
>> TEMPLATE PORT1" as uid yesplan and gid yesplan
>> > stop program = "/home/yesplan/yesplanscripts/stopYesplanGems
>> TEMPLATE PORT1" as uid yesplan and gid yesplan
>> > DEPENDS on stone_TEMPLATE
>> > GROUP TEMPLATE
>> > # Empty FastCGI request
>> > if failed port PORT1
>> > # Send FastCGI packet: version 1 (0x01), cmd
>> FCGI_GET_VALUES (0x09)
>> > # padding 8 bytes (0x08), followed by 8xNULLs padding
>> > send
>> "\0x01\0x09\0x00\0x00\0x00\0x00\0x08\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00"
>> > # Expect FastCGI packet: version 1 (0x01), resp
>> FCGI_GET_VALUES_RESULT (0x0A)
>> > expect "\0x01\0x0A"
>> > timeout 40 seconds
>> > then restart
>> > check process fastcgi_PORT2_TEMPLATE with pidfile
>> /opt/gemstone/stones/TEMPLATE/data/FastCGI_server-PORT2.pid
>> > start program = "/home/yesplan/yesplanscripts/startYesplanGems
>> TEMPLATE PORT2" as uid yesplan and gid yesplan
>> > stop program = "/home/yesplan/yesplanscripts/stopYesplanGems
>> TEMPLATE PORT2" as uid yesplan and gid yesplan
>> > DEPENDS on stone_TEMPLATE
>> > GROUP TEMPLATE
>> > # Empty FastCGI request
>> > if failed port PORT2
>> > # Send FastCGI packet: version 1 (0x01), cmd
>> FCGI_GET_VALUES (0x09)
>> > # padding 8 bytes (0x08), followed by 8xNULLs padding
>> > send
>> "\0x01\0x09\0x00\0x00\0x00\0x00\0x08\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00"
>> > # Expect FastCGI packet: version 1 (0x01), resp
>> FCGI_GET_VALUES_RESULT (0x0A)
>> > expect "\0x01\0x0A"
>> > timeout 40 seconds
>> > then restart
>> > check process fastcgi_PORT3_TEMPLATE with pidfile
>> /opt/gemstone/stones/TEMPLATE/data/FastCGI_server-PORT3.pid
>> > start program = "/home/yesplan/yesplanscripts/startYesplanGems
>> TEMPLATE PORT3" as uid yesplan and gid yesplan
>> > stop program = "/home/yesplan/yesplanscripts/stopYesplanGems
>> TEMPLATE PORT3" as uid yesplan and gid yesplan
>> > DEPENDS on stone_TEMPLATE
>> > GROUP TEMPLATE
>> > # Empty FastCGI request
>> > if failed port PORT3
>> > # Send FastCGI packet: version 1 (0x01), cmd
>> FCGI_GET_VALUES (0x09)
>> > # padding 8 bytes (0x08), followed by 8xNULLs padding
>> > send
>> "\0x01\0x09\0x00\0x00\0x00\0x00\0x08\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00\0x00"
>> > # Expect FastCGI packet: version 1 (0x01), resp
>> FCGI_GET_VALUES_RESULT (0x0A)
>> > expect "\0x01\0x0A"
>> > timeout 40 seconds
>> > then restart
>> > check process servicevm_TEMPLATE with pidfile
>> /opt/gemstone/stones/TEMPLATE/data/service.pid
>> > start program =
>> "/home/yesplan/yesplanscripts/startYesplanServiceVM TEMPLATE" as uid
>> yesplan and gid yesplan
>> > stop program =
>> "/home/yesplan/yesplanscripts/stopYesplanServiceVM TEMPLATE" as uid yesplan
>> and gid yesplan
>> > DEPENDS on stone_TEMPLATE
>> > GROUP TEMPLATE
>> > check file extent_TEMPLATE with path
>> /opt/gemstone/stones/TEMPLATE/data/extent0.dbf
>> > if size > 4 GB then alert
>> > GROUP TEMPLATE
>> > check process stone_TEMPLATE with pidfile
>> /opt/gemstone/stones/TEMPLATE/data/TEMPLATE.pid
>> > start program =
>> "/home/yesplan/yesplanscripts/startYesplanStone TEMPLATE" as uid yesplan
>> and gid yesplan
>> > stop program =
>> "/home/yesplan/yesplanscripts/stopYesplanStone TEMPLATE" as uid yesplan and
>> gid yesplan
>> > GROUP TEMPLATE
>> >
>> >
>> > On 19 Dec 2013, at 15:03, Mariano Martinez Peck <marianopeck at gmail.com>
>> wrote:
>> >
>> > > Ok, I could start writing monit scripts for gemstone, but I guess
>> many people already did that, right?
>> > >
>> > > The thing is that there are many processes to monit: the stone,
>> netldi, each gem, etc.. From what I could see most of them, if not all,
>> have a place for the pid, so it could be easy to write the monit scripts.
>> For the seaside gems we could check the port.
>> > >
>> > > Thoughts?
>> > >
>> > > --
>> > > Mariano
>> > > http://marianopeck.wordpress.com
>> > > _______________________________________________
>> > > Glass mailing list
>> > > Glass at lists.gemtalksystems.com
>> > > http://lists.gemtalksystems.com/mailman/listinfo/glass
>> >
>> >
>> >
>> >
>> > --
>> > Mariano
>> > http://marianopeck.wordpress.com
>>
>>
>
>
> --
> Mariano
> http://marianopeck.wordpress.com
>
--
Mariano
http://marianopeck.wordpress.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gemtalksystems.com/mailman/private/glass/attachments/20140820/c80573d0/attachment-0001.html>
More information about the Glass
mailing list