Issue 328 in glassdb: Class versions problematic for Seaside applications

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
28 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Re: Need bash script to loop and restart WAFastCGIAdaptor

Paul DeBruicker
hmm..

seems like I've misled you.


To see if it is running it should have been:

ps -A | grep svscan

'supervise' is the process that runs once you start daemontools
monitoring a process.  'svscan' scans for processes and starts supervise
running them.

And the svscanboot starts the svscan process which should run forever.

Does this link help?

http://directory.fedoraproject.org/wiki/Howto:Daemontools





On 12-01-31 06:57 PM, Lawrence Kellogg wrote:

> Thanks, Paul.
>
>
> On Jan 31, 2012, at 9:48 PM, Paul DeBruicker wrote:
>
>> I would have guessed that your linux distro had a daemontools package you could've installed.  As for restarting, see if the 'supervise' process is running e.g.
>>
>
> I guess not...
>
> $ sudo yum install daemontools
> Loaded plugins: fastestmirror, priorities, security, update-motd
> Loading mirror speeds from cached hostfile
>   * amzn-main: packages.us-east-1.amazonaws.com
>   * amzn-updates: packages.us-east-1.amazonaws.com
> Setting up Install Process
> No package daemontools available.
> Error: Nothing to do
>
>
>>
>> ps -A | grep supervise
>>
>
> nothing running
>
>
>>
>> if so you should be all set if not try
>>
>> sudo svscanboot
>>
>>
>
>
>    I found this in .usr/local/bin and am running it but it does not seem to
> be terminating... how long should it run?
>
>>
>>
>>
>> On 12-01-31 06:17 PM, Lawrence Kellogg wrote:
>>> Thanks anyway, Dale, it was the dreaded errno problem that I posted on here.
>>>
>>> I got it to compile,
>>>
>>> grep sysdep hasflock.h>>   sysdeps
>>> grep sysdep hasshsgr.h>>   sysdeps
>>> Copying commands into ./command...
>>> Creating symlink daemontools ->   daemontools-0.76...
>>> Making command links in /command...
>>>
>>> Making compatibility links in /usr/local/bin...
>>> Creating /service...
>>> Adding svscanboot to inittab...
>>> init should start svscan now.
>>> [seasideuser@ip-10-245-218-240 daemontools-0.76]$
>>> [seasideuser@ip-10-245-218-240 daemontools-0.76]$
>>>
>>> now I'm just wondering if I have to reboot the instance on Amazon, which
>>> will give me a new public DNS entry (I think) and mess up the forwarding I have
>>> set up on my domain (CNAME record).
>>>
>>> Any Unix person know? The documentation says to restart BSD boxes.
>>>
>>>
>>>    Larry
>>>
>>>
>>> On Jan 31, 2012, at 9:08 PM, Dale Henrichs wrote:
>>>
>>>> Lawrence,
>>>>
>>>> I'm just not an expert on daemontools Monty has a github project with some daemontools setup scripts[1] that might be of help...
>>>>
>>>> Also you might try googling the error message and see what turns up ....
>>>>
>>>> Dale
>>>>
>>>> [1] https://github.com/Monty/GemStone_daemontools_setup
>>>>
>>>> ----- Original Message -----
>>>> | From: "Lawrence Kellogg"<[hidden email]>
>>>> | To: "GemStone Seaside beta discussion"<[hidden email]>
>>>> | Sent: Tuesday, January 31, 2012 6:01:41 PM
>>>> | Subject: Re: [GS/SS Beta] Need bash script to loop and restart WAFastCGIAdaptor
>>>> |
>>>> | Well, I tried to compile daemontools and got this:
>>>> |
>>>> |
>>>> | ./compile wait_nohang.c
>>>> | ./compile wait_pid.c
>>>> | ./makelib unix.a alloc.o alloc_re.o buffer.o buffer_0.o buffer_1.o \
>>>> | buffer_2.o buffer_get.o buffer_put.o buffer_read.o buffer_write.o \
>>>> | coe.o env.o error.o error_str.o fd_copy.o fd_move.o fifo.o lock_ex.o
>>>> | \
>>>> | lock_exnb.o ndelay_off.o ndelay_on.o open_append.o open_read.o \
>>>> | open_trunc.o open_write.o openreadclose.o pathexec_env.o \
>>>> | pathexec_run.o prot.o readclose.o seek_set.o sgetopt.o sig.o \
>>>> | sig_block.o sig_catch.o sig_pause.o stralloc_cat.o stralloc_catb.o \
>>>> | stralloc_cats.o stralloc_eady.o stralloc_opyb.o stralloc_opys.o \
>>>> | stralloc_pend.o strerr_die.o strerr_sys.o subgetopt.o wait_nohang.o
>>>> | \
>>>> | wait_pid.o
>>>> | ./load envdir unix.a byte.a
>>>> | /usr/bin/ld: errno: TLS definition in /lib64/libc.so.6 section .tbss
>>>> | mismatches non-TLS reference in envdir.o
>>>> | /lib64/libc.so.6: could not read symbols: Bad value
>>>> | collect2: ld returned 1 exit status
>>>> | make: *** [envdir] Error 1
>>>> |
>>>> | But, of course, why would I expect it to work?  Beats me what that
>>>> | error means.
>>>> |
>>>> | Larry
>>>> |
>>>> |
>>>> | On Jan 31, 2012, at 3:27 PM, Dale Henrichs wrote:
>>>> |
>>>> |>   Here's a writeup for daemontools and GemStone[1] from Tobias
>>>> |>   Pape...
>>>> |>
>>>> |>   Dale
>>>> |>
>>>> |>   [1] http://code.google.com/p/glassdb/wiki/GLASSDaemonToolsIndex
>>>> |>
>>>> |>   ----- Original Message -----
>>>> |>   | From: "Lawrence Kellogg"<[hidden email]>
>>>> |>   | To: "GemStone Seaside beta discussion"
>>>> |>   |<[hidden email]>
>>>> |>   | Sent: Tuesday, January 31, 2012 11:56:29 AM
>>>> |>   | Subject: [GS/SS Beta] Need bash script to loop and restart
>>>> |>   | WAFastCGIAdaptor
>>>> |>   |
>>>> |>   | Hello,
>>>> |>   |   I need a script that will automatically restart my
>>>> |>   |   WAFastCGIAdaptor
>>>> |>   |   on port 9001 when
>>>> |>   | it falls down. Unfortunately, it appears that any walkback brings
>>>> |>   | down nginx, although I
>>>> |>   | have installed the production error handler.
>>>> |>   |
>>>> |>   |   Does anyone have a little script that will restart the
>>>> |>   |   WAFastCGIAdaptor?
>>>> |>   | I apologize for being such a terrible Unix hacker.
>>>> |>   |
>>>> |>   |   Regards,
>>>> |>   |
>>>> |>   |   Larry
>>>> |>   |
>>>> |>   |
>>>> |>   |
>>>> |
>>>> |
>>>
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: Need bash script to loop and restart WAFastCGIAdaptor

Tobias Pape
In reply to this post by Dale Henrichs

Am 2012-01-31 um 21:27 schrieb Dale Henrichs:

> Here's a writeup for daemontools and GemStone[1] from Tobias Pape...
>
> Dale
>
> [1] http://code.google.com/p/glassdb/wiki/GLASSDaemonToolsIndex

Note that it needs adaption for Seaside3, tho

best
        -Tobias

Reply | Threaded
Open this post in threaded view
|

Re: Need bash script to loop and restart WAFastCGIAdaptor

Tobias Pape
In reply to this post by Larry Kellogg

Am 2012-02-01 um 03:01 schrieb Lawrence Kellogg:

> Well, I tried to compile daemontools and got this:
>
>
> ./compile wait_nohang.c
> ./compile wait_pid.c
> ./makelib unix.a alloc.o alloc_re.o buffer.o buffer_0.o buffer_1.o \
> buffer_2.o buffer_get.o buffer_put.o buffer_read.o buffer_write.o \
> coe.o env.o error.o error_str.o fd_copy.o fd_move.o fifo.o lock_ex.o \
> lock_exnb.o ndelay_off.o ndelay_on.o open_append.o open_read.o \
> open_trunc.o open_write.o openreadclose.o pathexec_env.o \
> pathexec_run.o prot.o readclose.o seek_set.o sgetopt.o sig.o \
> sig_block.o sig_catch.o sig_pause.o stralloc_cat.o stralloc_catb.o \
> stralloc_cats.o stralloc_eady.o stralloc_opyb.o stralloc_opys.o \
> stralloc_pend.o strerr_die.o strerr_sys.o subgetopt.o wait_nohang.o \
> wait_pid.o
> ./load envdir unix.a byte.a
> /usr/bin/ld: errno: TLS definition in /lib64/libc.so.6 section .tbss mismatches non-TLS reference in envdir.o
> /lib64/libc.so.6: could not read symbols: Bad value
> collect2: ld returned 1 exit status
> make: *** [envdir] Error 1
>
> But, of course, why would I expect it to work?  Beats me what that error means.

What platform/distribution are you on?

best
        -tobias
Reply | Threaded
Open this post in threaded view
|

Re: Need bash script to loop and restart WAFastCGIAdaptor

Larry Kellogg

On Feb 1, 2012, at 7:43 AM, Tobias Pape wrote:

>
> Am 2012-02-01 um 03:01 schrieb Lawrence Kellogg:
>
>> Well, I tried to compile daemontools and got this:
>>
>>
>> ./compile wait_nohang.c
>> ./compile wait_pid.c
>> ./makelib unix.a alloc.o alloc_re.o buffer.o buffer_0.o buffer_1.o \
>> buffer_2.o buffer_get.o buffer_put.o buffer_read.o buffer_write.o \
>> coe.o env.o error.o error_str.o fd_copy.o fd_move.o fifo.o lock_ex.o \
>> lock_exnb.o ndelay_off.o ndelay_on.o open_append.o open_read.o \
>> open_trunc.o open_write.o openreadclose.o pathexec_env.o \
>> pathexec_run.o prot.o readclose.o seek_set.o sgetopt.o sig.o \
>> sig_block.o sig_catch.o sig_pause.o stralloc_cat.o stralloc_catb.o \
>> stralloc_cats.o stralloc_eady.o stralloc_opyb.o stralloc_opys.o \
>> stralloc_pend.o strerr_die.o strerr_sys.o subgetopt.o wait_nohang.o \
>> wait_pid.o
>> ./load envdir unix.a byte.a
>> /usr/bin/ld: errno: TLS definition in /lib64/libc.so.6 section .tbss mismatches non-TLS reference in envdir.o
>> /lib64/libc.so.6: could not read symbols: Bad value
>> collect2: ld returned 1 exit status
>> make: *** [envdir] Error 1
>>
>> But, of course, why would I expect it to work?  Beats me what that error means.
>
> What platform/distribution are you on?
>

  Well, it is some version of Linux running on one of the Amazon EC2 servers.
I tried this method of finding the DISTRO:

http://legroom.net/2010/05/05/generic-method-determine-linux-or-unix-distribution-name

but only got system. The /etc/system-release file says:  Amazon Linux AMI release 2011.09

not much help, I'm afraid. I'll dig around on the Amazon site to see if I can get some more information.

  Your writeup on daemontools is well done. Any idea how much has to change for Seaside 3?

  Regards,

  Larry
 


> best
> -tobias

Reply | Threaded
Open this post in threaded view
|

Re: Need bash script to loop and restart WAFastCGIAdaptor

Larry Kellogg
In reply to this post by Paul DeBruicker
I'm locked in a death struggle with daemontools.

I created a /service directory and put a directory under it called fastcgi.

I changed a runGem script so that it does not go into the background  and
send its outpout to stdout, not a file, as instructed in Tobias'.

I created a run script calling it and changed the permission on the run script to 1755
as found somewhere on the net.

Yet, all daemontools will say is:

[seasideuser@ip-10-191-194-75 service]$ svscan
svscan: warning: unable to start supervise fastcgi: file does not exist
svscan: warning: unable to start supervise fastcgi/log: file does not exist
svscan: warning: unable to start supervise fastcgi: file does not exist
svscan: warning: unable to start supervise fastcgi/log: file does not exist
svscan: warning: unable to start supervise fastcgi: file does not exist
svscan: warning: unable to start supervise fastcgi/log: file does not exist

yeah, which file????

similar results are obtained when trying to use svc.

my run script

#!/bin/sh
echo starting FastCGI on 9001
startSeaside30Gem_Adaptor WAFastCGIAdaptor 9001

works fine to bring up the fast cgi adaptor.

Any thoughts? I think I'm close...

Larry



On Jan 31, 2012, at 10:45 PM, Paul DeBruicker wrote:

> hmm..
>
> seems like I've misled you.
>
>
> To see if it is running it should have been:
>
> ps -A | grep svscan
>
> 'supervise' is the process that runs once you start daemontools monitoring a process.  'svscan' scans for processes and starts supervise running them.
>
> And the svscanboot starts the svscan process which should run forever.
>
> Does this link help?
>
> http://directory.fedoraproject.org/wiki/Howto:Daemontools
>
>
>
>
>
> On 12-01-31 06:57 PM, Lawrence Kellogg wrote:
>> Thanks, Paul.
>>
>>
>> On Jan 31, 2012, at 9:48 PM, Paul DeBruicker wrote:
>>
>>> I would have guessed that your linux distro had a daemontools package you could've installed.  As for restarting, see if the 'supervise' process is running e.g.
>>>
>>
>> I guess not...
>>
>> $ sudo yum install daemontools
>> Loaded plugins: fastestmirror, priorities, security, update-motd
>> Loading mirror speeds from cached hostfile
>>  * amzn-main: packages.us-east-1.amazonaws.com
>>  * amzn-updates: packages.us-east-1.amazonaws.com
>> Setting up Install Process
>> No package daemontools available.
>> Error: Nothing to do
>>
>>
>>>
>>> ps -A | grep supervise
>>>
>>
>> nothing running
>>
>>
>>>
>>> if so you should be all set if not try
>>>
>>> sudo svscanboot
>>>
>>>
>>
>>
>>   I found this in .usr/local/bin and am running it but it does not seem to
>> be terminating... how long should it run?
>>
>>>
>>>
>>>
>>> On 12-01-31 06:17 PM, Lawrence Kellogg wrote:
>>>> Thanks anyway, Dale, it was the dreaded errno problem that I posted on here.
>>>>
>>>> I got it to compile,
>>>>
>>>> grep sysdep hasflock.h>>   sysdeps
>>>> grep sysdep hasshsgr.h>>   sysdeps
>>>> Copying commands into ./command...
>>>> Creating symlink daemontools ->   daemontools-0.76...
>>>> Making command links in /command...
>>>>
>>>> Making compatibility links in /usr/local/bin...
>>>> Creating /service...
>>>> Adding svscanboot to inittab...
>>>> init should start svscan now.
>>>> [seasideuser@ip-10-245-218-240 daemontools-0.76]$
>>>> [seasideuser@ip-10-245-218-240 daemontools-0.76]$
>>>>
>>>> now I'm just wondering if I have to reboot the instance on Amazon, which
>>>> will give me a new public DNS entry (I think) and mess up the forwarding I have
>>>> set up on my domain (CNAME record).
>>>>
>>>> Any Unix person know? The documentation says to restart BSD boxes.
>>>>
>>>>
>>>>   Larry
>>>>
>>>>
>>>> On Jan 31, 2012, at 9:08 PM, Dale Henrichs wrote:
>>>>
>>>>> Lawrence,
>>>>>
>>>>> I'm just not an expert on daemontools Monty has a github project with some daemontools setup scripts[1] that might be of help...
>>>>>
>>>>> Also you might try googling the error message and see what turns up ....
>>>>>
>>>>> Dale
>>>>>
>>>>> [1] https://github.com/Monty/GemStone_daemontools_setup
>>>>>
>>>>> ----- Original Message -----
>>>>> | From: "Lawrence Kellogg"<[hidden email]>
>>>>> | To: "GemStone Seaside beta discussion"<[hidden email]>
>>>>> | Sent: Tuesday, January 31, 2012 6:01:41 PM
>>>>> | Subject: Re: [GS/SS Beta] Need bash script to loop and restart WAFastCGIAdaptor
>>>>> |
>>>>> | Well, I tried to compile daemontools and got this:
>>>>> |
>>>>> |
>>>>> | ./compile wait_nohang.c
>>>>> | ./compile wait_pid.c
>>>>> | ./makelib unix.a alloc.o alloc_re.o buffer.o buffer_0.o buffer_1.o \
>>>>> | buffer_2.o buffer_get.o buffer_put.o buffer_read.o buffer_write.o \
>>>>> | coe.o env.o error.o error_str.o fd_copy.o fd_move.o fifo.o lock_ex.o
>>>>> | \
>>>>> | lock_exnb.o ndelay_off.o ndelay_on.o open_append.o open_read.o \
>>>>> | open_trunc.o open_write.o openreadclose.o pathexec_env.o \
>>>>> | pathexec_run.o prot.o readclose.o seek_set.o sgetopt.o sig.o \
>>>>> | sig_block.o sig_catch.o sig_pause.o stralloc_cat.o stralloc_catb.o \
>>>>> | stralloc_cats.o stralloc_eady.o stralloc_opyb.o stralloc_opys.o \
>>>>> | stralloc_pend.o strerr_die.o strerr_sys.o subgetopt.o wait_nohang.o
>>>>> | \
>>>>> | wait_pid.o
>>>>> | ./load envdir unix.a byte.a
>>>>> | /usr/bin/ld: errno: TLS definition in /lib64/libc.so.6 section .tbss
>>>>> | mismatches non-TLS reference in envdir.o
>>>>> | /lib64/libc.so.6: could not read symbols: Bad value
>>>>> | collect2: ld returned 1 exit status
>>>>> | make: *** [envdir] Error 1
>>>>> |
>>>>> | But, of course, why would I expect it to work?  Beats me what that
>>>>> | error means.
>>>>> |
>>>>> | Larry
>>>>> |
>>>>> |
>>>>> | On Jan 31, 2012, at 3:27 PM, Dale Henrichs wrote:
>>>>> |
>>>>> |>   Here's a writeup for daemontools and GemStone[1] from Tobias
>>>>> |>   Pape...
>>>>> |>
>>>>> |>   Dale
>>>>> |>
>>>>> |>   [1] http://code.google.com/p/glassdb/wiki/GLASSDaemonToolsIndex
>>>>> |>
>>>>> |>   ----- Original Message -----
>>>>> |>   | From: "Lawrence Kellogg"<[hidden email]>
>>>>> |>   | To: "GemStone Seaside beta discussion"
>>>>> |>   |<[hidden email]>
>>>>> |>   | Sent: Tuesday, January 31, 2012 11:56:29 AM
>>>>> |>   | Subject: [GS/SS Beta] Need bash script to loop and restart
>>>>> |>   | WAFastCGIAdaptor
>>>>> |>   |
>>>>> |>   | Hello,
>>>>> |>   |   I need a script that will automatically restart my
>>>>> |>   |   WAFastCGIAdaptor
>>>>> |>   |   on port 9001 when
>>>>> |>   | it falls down. Unfortunately, it appears that any walkback brings
>>>>> |>   | down nginx, although I
>>>>> |>   | have installed the production error handler.
>>>>> |>   |
>>>>> |>   |   Does anyone have a little script that will restart the
>>>>> |>   |   WAFastCGIAdaptor?
>>>>> |>   | I apologize for being such a terrible Unix hacker.
>>>>> |>   |
>>>>> |>   |   Regards,
>>>>> |>   |
>>>>> |>   |   Larry
>>>>> |>   |
>>>>> |>   |
>>>>> |>   |
>>>>> |
>>>>> |
>>>>
>>>
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: Need bash script to loop and restart WAFastCGIAdaptor

Larry Kellogg

On Feb 6, 2012, at 6:56 PM, Lawrence Kellogg wrote:

> I'm locked in a death struggle with daemontools.
>
> I created a /service directory and put a directory under it called fastcgi.
>
> I changed a runGem script so that it does not go into the background  and
> send its outpout to stdout, not a file, as instructed in Tobias'.
>
> I created a run script calling it and changed the permission on the run script to 1755
> as found somewhere on the net.
>
> Yet, all daemontools will say is:
>
> [seasideuser@ip-10-191-194-75 service]$ svscan
> svscan: warning: unable to start supervise fastcgi: file does not exist
> svscan: warning: unable to start supervise fastcgi/log: file does not exist
> svscan: warning: unable to start supervise fastcgi: file does not exist
> svscan: warning: unable to start supervise fastcgi/log: file does not exist
> svscan: warning: unable to start supervise fastcgi: file does not exist
> svscan: warning: unable to start supervise fastcgi/log: file does not exist
>
> yeah, which file????
>


Silly me, I had forgotten to move the supervise program to the other machine...but I'm
still stuck with this:

[seasideuser@ip-10-191-194-75 service]$ svscan
supervise: fatal: unable to acquire fastcgi/supervise/lock: access denied
supervise: fatal: unable to acquire log/supervise/lock: access denied
supervise: fatal: unable to acquire fastcgi/supervise/lock: access denied
supervise: fatal: unable to acquire log/supervise/lock: access denied
^C



Am I supposed to create all these directories and files???





> similar results are obtained when trying to use svc.
>
> my run script
>
> #!/bin/sh
> echo starting FastCGI on 9001
> startSeaside30Gem_Adaptor WAFastCGIAdaptor 9001
>
> works fine to bring up the fast cgi adaptor.
>
> Any thoughts? I think I'm close...
>
> Larry
>
>
>
> On Jan 31, 2012, at 10:45 PM, Paul DeBruicker wrote:
>
>> hmm..
>>
>> seems like I've misled you.
>>
>>
>> To see if it is running it should have been:
>>
>> ps -A | grep svscan
>>
>> 'supervise' is the process that runs once you start daemontools monitoring a process.  'svscan' scans for processes and starts supervise running them.
>>
>> And the svscanboot starts the svscan process which should run forever.
>>
>> Does this link help?
>>
>> http://directory.fedoraproject.org/wiki/Howto:Daemontools
>>
>>
>>
>>
>>
>> On 12-01-31 06:57 PM, Lawrence Kellogg wrote:
>>> Thanks, Paul.
>>>
>>>
>>> On Jan 31, 2012, at 9:48 PM, Paul DeBruicker wrote:
>>>
>>>> I would have guessed that your linux distro had a daemontools package you could've installed.  As for restarting, see if the 'supervise' process is running e.g.
>>>>
>>>
>>> I guess not...
>>>
>>> $ sudo yum install daemontools
>>> Loaded plugins: fastestmirror, priorities, security, update-motd
>>> Loading mirror speeds from cached hostfile
>>> * amzn-main: packages.us-east-1.amazonaws.com
>>> * amzn-updates: packages.us-east-1.amazonaws.com
>>> Setting up Install Process
>>> No package daemontools available.
>>> Error: Nothing to do
>>>
>>>
>>>>
>>>> ps -A | grep supervise
>>>>
>>>
>>> nothing running
>>>
>>>
>>>>
>>>> if so you should be all set if not try
>>>>
>>>> sudo svscanboot
>>>>
>>>>
>>>
>>>
>>>  I found this in .usr/local/bin and am running it but it does not seem to
>>> be terminating... how long should it run?
>>>
>>>>
>>>>
>>>>
>>>> On 12-01-31 06:17 PM, Lawrence Kellogg wrote:
>>>>> Thanks anyway, Dale, it was the dreaded errno problem that I posted on here.
>>>>>
>>>>> I got it to compile,
>>>>>
>>>>> grep sysdep hasflock.h>>   sysdeps
>>>>> grep sysdep hasshsgr.h>>   sysdeps
>>>>> Copying commands into ./command...
>>>>> Creating symlink daemontools ->   daemontools-0.76...
>>>>> Making command links in /command...
>>>>>
>>>>> Making compatibility links in /usr/local/bin...
>>>>> Creating /service...
>>>>> Adding svscanboot to inittab...
>>>>> init should start svscan now.
>>>>> [seasideuser@ip-10-245-218-240 daemontools-0.76]$
>>>>> [seasideuser@ip-10-245-218-240 daemontools-0.76]$
>>>>>
>>>>> now I'm just wondering if I have to reboot the instance on Amazon, which
>>>>> will give me a new public DNS entry (I think) and mess up the forwarding I have
>>>>> set up on my domain (CNAME record).
>>>>>
>>>>> Any Unix person know? The documentation says to restart BSD boxes.
>>>>>
>>>>>
>>>>>  Larry
>>>>>
>>>>>
>>>>> On Jan 31, 2012, at 9:08 PM, Dale Henrichs wrote:
>>>>>
>>>>>> Lawrence,
>>>>>>
>>>>>> I'm just not an expert on daemontools Monty has a github project with some daemontools setup scripts[1] that might be of help...
>>>>>>
>>>>>> Also you might try googling the error message and see what turns up ....
>>>>>>
>>>>>> Dale
>>>>>>
>>>>>> [1] https://github.com/Monty/GemStone_daemontools_setup
>>>>>>
>>>>>> ----- Original Message -----
>>>>>> | From: "Lawrence Kellogg"<[hidden email]>
>>>>>> | To: "GemStone Seaside beta discussion"<[hidden email]>
>>>>>> | Sent: Tuesday, January 31, 2012 6:01:41 PM
>>>>>> | Subject: Re: [GS/SS Beta] Need bash script to loop and restart WAFastCGIAdaptor
>>>>>> |
>>>>>> | Well, I tried to compile daemontools and got this:
>>>>>> |
>>>>>> |
>>>>>> | ./compile wait_nohang.c
>>>>>> | ./compile wait_pid.c
>>>>>> | ./makelib unix.a alloc.o alloc_re.o buffer.o buffer_0.o buffer_1.o \
>>>>>> | buffer_2.o buffer_get.o buffer_put.o buffer_read.o buffer_write.o \
>>>>>> | coe.o env.o error.o error_str.o fd_copy.o fd_move.o fifo.o lock_ex.o
>>>>>> | \
>>>>>> | lock_exnb.o ndelay_off.o ndelay_on.o open_append.o open_read.o \
>>>>>> | open_trunc.o open_write.o openreadclose.o pathexec_env.o \
>>>>>> | pathexec_run.o prot.o readclose.o seek_set.o sgetopt.o sig.o \
>>>>>> | sig_block.o sig_catch.o sig_pause.o stralloc_cat.o stralloc_catb.o \
>>>>>> | stralloc_cats.o stralloc_eady.o stralloc_opyb.o stralloc_opys.o \
>>>>>> | stralloc_pend.o strerr_die.o strerr_sys.o subgetopt.o wait_nohang.o
>>>>>> | \
>>>>>> | wait_pid.o
>>>>>> | ./load envdir unix.a byte.a
>>>>>> | /usr/bin/ld: errno: TLS definition in /lib64/libc.so.6 section .tbss
>>>>>> | mismatches non-TLS reference in envdir.o
>>>>>> | /lib64/libc.so.6: could not read symbols: Bad value
>>>>>> | collect2: ld returned 1 exit status
>>>>>> | make: *** [envdir] Error 1
>>>>>> |
>>>>>> | But, of course, why would I expect it to work?  Beats me what that
>>>>>> | error means.
>>>>>> |
>>>>>> | Larry
>>>>>> |
>>>>>> |
>>>>>> | On Jan 31, 2012, at 3:27 PM, Dale Henrichs wrote:
>>>>>> |
>>>>>> |>   Here's a writeup for daemontools and GemStone[1] from Tobias
>>>>>> |>   Pape...
>>>>>> |>
>>>>>> |>   Dale
>>>>>> |>
>>>>>> |>   [1] http://code.google.com/p/glassdb/wiki/GLASSDaemonToolsIndex
>>>>>> |>
>>>>>> |>   ----- Original Message -----
>>>>>> |>   | From: "Lawrence Kellogg"<[hidden email]>
>>>>>> |>   | To: "GemStone Seaside beta discussion"
>>>>>> |>   |<[hidden email]>
>>>>>> |>   | Sent: Tuesday, January 31, 2012 11:56:29 AM
>>>>>> |>   | Subject: [GS/SS Beta] Need bash script to loop and restart
>>>>>> |>   | WAFastCGIAdaptor
>>>>>> |>   |
>>>>>> |>   | Hello,
>>>>>> |>   |   I need a script that will automatically restart my
>>>>>> |>   |   WAFastCGIAdaptor
>>>>>> |>   |   on port 9001 when
>>>>>> |>   | it falls down. Unfortunately, it appears that any walkback brings
>>>>>> |>   | down nginx, although I
>>>>>> |>   | have installed the production error handler.
>>>>>> |>   |
>>>>>> |>   |   Does anyone have a little script that will restart the
>>>>>> |>   |   WAFastCGIAdaptor?
>>>>>> |>   | I apologize for being such a terrible Unix hacker.
>>>>>> |>   |
>>>>>> |>   |   Regards,
>>>>>> |>   |
>>>>>> |>   |   Larry
>>>>>> |>   |
>>>>>> |>   |
>>>>>> |>   |
>>>>>> |
>>>>>> |
>>>>>
>>>>
>>>
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: Need bash script to loop and restart WAFastCGIAdaptor

Larry Kellogg

On Feb 6, 2012, at 7:13 PM, Lawrence Kellogg wrote:

>
> On Feb 6, 2012, at 6:56 PM, Lawrence Kellogg wrote:
>
>> I'm locked in a death struggle with daemontools.
>>
>> I created a /service directory and put a directory under it called fastcgi.
>>
>> I changed a runGem script so that it does not go into the background  and
>> send its outpout to stdout, not a file, as instructed in Tobias'.
>>
>> I created a run script calling it and changed the permission on the run script to 1755
>> as found somewhere on the net.
>>
>> Yet, all daemontools will say is:
>>
>> [seasideuser@ip-10-191-194-75 service]$ svscan
>> svscan: warning: unable to start supervise fastcgi: file does not exist
>> svscan: warning: unable to start supervise fastcgi/log: file does not exist
>> svscan: warning: unable to start supervise fastcgi: file does not exist
>> svscan: warning: unable to start supervise fastcgi/log: file does not exist
>> svscan: warning: unable to start supervise fastcgi: file does not exist
>> svscan: warning: unable to start supervise fastcgi/log: file does not exist
>>
>> yeah, which file????
>>
>
>
> Silly me, I had forgotten to move the supervise program to the other machine...but I'm
> still stuck with this:
>
> [seasideuser@ip-10-191-194-75 service]$ svscan
> supervise: fatal: unable to acquire fastcgi/supervise/lock: access denied
> supervise: fatal: unable to acquire log/supervise/lock: access denied
> supervise: fatal: unable to acquire fastcgi/supervise/lock: access denied
> supervise: fatal: unable to acquire log/supervise/lock: access denied
> ^C
>
>
>
> Am I supposed to create all these directories and files???
>


  Well, I finally gave it all of the files it was demanding, got hung up by the loop svscan process...

so, I just started my own supervise process on the directory

service fastcgi&

and it picks itself back up....

So, I guess I can declare success....


Larry



>
>
>
>
>> similar results are obtained when trying to use svc.
>>
>> my run script
>>
>> #!/bin/sh
>> echo starting FastCGI on 9001
>> startSeaside30Gem_Adaptor WAFastCGIAdaptor 9001
>>
>> works fine to bring up the fast cgi adaptor.
>>
>> Any thoughts? I think I'm close...
>>
>> Larry
>>
>>
>>
>> On Jan 31, 2012, at 10:45 PM, Paul DeBruicker wrote:
>>
>>> hmm..
>>>
>>> seems like I've misled you.
>>>
>>>
>>> To see if it is running it should have been:
>>>
>>> ps -A | grep svscan
>>>
>>> 'supervise' is the process that runs once you start daemontools monitoring a process.  'svscan' scans for processes and starts supervise running them.
>>>
>>> And the svscanboot starts the svscan process which should run forever.
>>>
>>> Does this link help?
>>>
>>> http://directory.fedoraproject.org/wiki/Howto:Daemontools
>>>
>>>
>>>
>>>
>>>
>>> On 12-01-31 06:57 PM, Lawrence Kellogg wrote:
>>>> Thanks, Paul.
>>>>
>>>>
>>>> On Jan 31, 2012, at 9:48 PM, Paul DeBruicker wrote:
>>>>
>>>>> I would have guessed that your linux distro had a daemontools package you could've installed.  As for restarting, see if the 'supervise' process is running e.g.
>>>>>
>>>>
>>>> I guess not...
>>>>
>>>> $ sudo yum install daemontools
>>>> Loaded plugins: fastestmirror, priorities, security, update-motd
>>>> Loading mirror speeds from cached hostfile
>>>> * amzn-main: packages.us-east-1.amazonaws.com
>>>> * amzn-updates: packages.us-east-1.amazonaws.com
>>>> Setting up Install Process
>>>> No package daemontools available.
>>>> Error: Nothing to do
>>>>
>>>>
>>>>>
>>>>> ps -A | grep supervise
>>>>>
>>>>
>>>> nothing running
>>>>
>>>>
>>>>>
>>>>> if so you should be all set if not try
>>>>>
>>>>> sudo svscanboot
>>>>>
>>>>>
>>>>
>>>>
>>>> I found this in .usr/local/bin and am running it but it does not seem to
>>>> be terminating... how long should it run?
>>>>
>>>>>
>>>>>
>>>>>
>>>>> On 12-01-31 06:17 PM, Lawrence Kellogg wrote:
>>>>>> Thanks anyway, Dale, it was the dreaded errno problem that I posted on here.
>>>>>>
>>>>>> I got it to compile,
>>>>>>
>>>>>> grep sysdep hasflock.h>>   sysdeps
>>>>>> grep sysdep hasshsgr.h>>   sysdeps
>>>>>> Copying commands into ./command...
>>>>>> Creating symlink daemontools ->   daemontools-0.76...
>>>>>> Making command links in /command...
>>>>>>
>>>>>> Making compatibility links in /usr/local/bin...
>>>>>> Creating /service...
>>>>>> Adding svscanboot to inittab...
>>>>>> init should start svscan now.
>>>>>> [seasideuser@ip-10-245-218-240 daemontools-0.76]$
>>>>>> [seasideuser@ip-10-245-218-240 daemontools-0.76]$
>>>>>>
>>>>>> now I'm just wondering if I have to reboot the instance on Amazon, which
>>>>>> will give me a new public DNS entry (I think) and mess up the forwarding I have
>>>>>> set up on my domain (CNAME record).
>>>>>>
>>>>>> Any Unix person know? The documentation says to restart BSD boxes.
>>>>>>
>>>>>>
>>>>>> Larry
>>>>>>
>>>>>>
>>>>>> On Jan 31, 2012, at 9:08 PM, Dale Henrichs wrote:
>>>>>>
>>>>>>> Lawrence,
>>>>>>>
>>>>>>> I'm just not an expert on daemontools Monty has a github project with some daemontools setup scripts[1] that might be of help...
>>>>>>>
>>>>>>> Also you might try googling the error message and see what turns up ....
>>>>>>>
>>>>>>> Dale
>>>>>>>
>>>>>>> [1] https://github.com/Monty/GemStone_daemontools_setup
>>>>>>>
>>>>>>> ----- Original Message -----
>>>>>>> | From: "Lawrence Kellogg"<[hidden email]>
>>>>>>> | To: "GemStone Seaside beta discussion"<[hidden email]>
>>>>>>> | Sent: Tuesday, January 31, 2012 6:01:41 PM
>>>>>>> | Subject: Re: [GS/SS Beta] Need bash script to loop and restart WAFastCGIAdaptor
>>>>>>> |
>>>>>>> | Well, I tried to compile daemontools and got this:
>>>>>>> |
>>>>>>> |
>>>>>>> | ./compile wait_nohang.c
>>>>>>> | ./compile wait_pid.c
>>>>>>> | ./makelib unix.a alloc.o alloc_re.o buffer.o buffer_0.o buffer_1.o \
>>>>>>> | buffer_2.o buffer_get.o buffer_put.o buffer_read.o buffer_write.o \
>>>>>>> | coe.o env.o error.o error_str.o fd_copy.o fd_move.o fifo.o lock_ex.o
>>>>>>> | \
>>>>>>> | lock_exnb.o ndelay_off.o ndelay_on.o open_append.o open_read.o \
>>>>>>> | open_trunc.o open_write.o openreadclose.o pathexec_env.o \
>>>>>>> | pathexec_run.o prot.o readclose.o seek_set.o sgetopt.o sig.o \
>>>>>>> | sig_block.o sig_catch.o sig_pause.o stralloc_cat.o stralloc_catb.o \
>>>>>>> | stralloc_cats.o stralloc_eady.o stralloc_opyb.o stralloc_opys.o \
>>>>>>> | stralloc_pend.o strerr_die.o strerr_sys.o subgetopt.o wait_nohang.o
>>>>>>> | \
>>>>>>> | wait_pid.o
>>>>>>> | ./load envdir unix.a byte.a
>>>>>>> | /usr/bin/ld: errno: TLS definition in /lib64/libc.so.6 section .tbss
>>>>>>> | mismatches non-TLS reference in envdir.o
>>>>>>> | /lib64/libc.so.6: could not read symbols: Bad value
>>>>>>> | collect2: ld returned 1 exit status
>>>>>>> | make: *** [envdir] Error 1
>>>>>>> |
>>>>>>> | But, of course, why would I expect it to work?  Beats me what that
>>>>>>> | error means.
>>>>>>> |
>>>>>>> | Larry
>>>>>>> |
>>>>>>> |
>>>>>>> | On Jan 31, 2012, at 3:27 PM, Dale Henrichs wrote:
>>>>>>> |
>>>>>>> |>   Here's a writeup for daemontools and GemStone[1] from Tobias
>>>>>>> |>   Pape...
>>>>>>> |>
>>>>>>> |>   Dale
>>>>>>> |>
>>>>>>> |>   [1] http://code.google.com/p/glassdb/wiki/GLASSDaemonToolsIndex
>>>>>>> |>
>>>>>>> |>   ----- Original Message -----
>>>>>>> |>   | From: "Lawrence Kellogg"<[hidden email]>
>>>>>>> |>   | To: "GemStone Seaside beta discussion"
>>>>>>> |>   |<[hidden email]>
>>>>>>> |>   | Sent: Tuesday, January 31, 2012 11:56:29 AM
>>>>>>> |>   | Subject: [GS/SS Beta] Need bash script to loop and restart
>>>>>>> |>   | WAFastCGIAdaptor
>>>>>>> |>   |
>>>>>>> |>   | Hello,
>>>>>>> |>   |   I need a script that will automatically restart my
>>>>>>> |>   |   WAFastCGIAdaptor
>>>>>>> |>   |   on port 9001 when
>>>>>>> |>   | it falls down. Unfortunately, it appears that any walkback brings
>>>>>>> |>   | down nginx, although I
>>>>>>> |>   | have installed the production error handler.
>>>>>>> |>   |
>>>>>>> |>   |   Does anyone have a little script that will restart the
>>>>>>> |>   |   WAFastCGIAdaptor?
>>>>>>> |>   | I apologize for being such a terrible Unix hacker.
>>>>>>> |>   |
>>>>>>> |>   |   Regards,
>>>>>>> |>   |
>>>>>>> |>   |   Larry
>>>>>>> |>   |
>>>>>>> |>   |
>>>>>>> |>   |
>>>>>>> |
>>>>>>> |
>>>>>>
>>>>>
>>>>
>>>
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: TimeZone conversion in GemStone

Thelliez
In reply to this post by Dale Henrichs
Yesterday I needed to print a given date/time in different timezones.
The current DateTime implementation seems to print the date either in
the server timezone, or in the timezone of the date itself.  But I
needed to print the date in an arbitrary timezone.

Here is a simple addition for DateTime:

asStringUsingFormat: anArray timeZone: displayTimeZone

"Returns a String that expresses the receiver in local time
 in the format defined by anArray.  Generates an error if anArray
 contains an incorrect formatting specification.

 See the class documentation of DateTime for a complete description of the
 String-formatting specification Array.

 displayTimeZone is used when the 12th parameter is set to false. It
 defines the timeZone to be used for the localtime.
"

| localDt aString |

  ((anArray size >= 12) _and: [ anArray at: 12 ])
   ifTrue: [ aTimeZone := self timeZone  ]
   ifFalse: [ displayTimeZone
                    ifNil: [ aTimeZone := TimeZone current ]
              ifNotNil: [ aTimeZone := displayTimeZone ] ].

((anArray size >= 11) _and: [ anArray at: 11 ])
  ifTrue: [
    localDt := self addSeconds: (self _localOffset: aTimeZone).
    aString := localDt asStringStdUsingFormat: anArray.
    aString add: Character space.
    (self isDstIn: aTimeZone)
      ifTrue: [ aString addAll: aTimeZone dstPrintString ]
      ifFalse: [ aString addAll: aTimeZone standardPrintString ].
    ]
  ifFalse: [
    localDt := self addSeconds: (self _localOffset: aTimeZone).
    "localDt := self addSeconds: self _localOffset."
    aString := localDt asStringStdUsingFormat: anArray.
    ].

^ aString.


Thierry
12