From: | Gregory Stark <stark(at)enterprisedb(dot)com> |
---|---|
To: | "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | "Stephen Harris" <lists(at)spuddy(dot)org>, "Postgres General" <pgsql-general(at)postgresql(dot)org>, <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: [HACKERS] Shutting down a warm standby database in 8.2beta3 |
Date: | 2006-11-18 05:34:58 |
Message-ID: | 87u00xuxkt.fsf@enterprisedb.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general pgsql-hackers |
"Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:
> Gregory Stark <stark(at)enterprisedb(dot)com> writes:
>> Sure, but it might be getting delivered to, say, your "sleep" command. You
>> haven't checked the return value of sleep to handle any errors that may occur.
>> As it stands you have to check for errors from every single command executed
>> by your script.
>
> The expectation is that something like SIGINT or SIGQUIT would be
> delivered to both the sleep command and the shell process running the
> script. So the shell should fail anyway. (Of course, a nontrivial
> archive or recovery script had better be checking for failures at each
> step, but this is not very relevant to the immediate problem.)
Hm, I tried to test that before I sent that. But I guess my test was faulty
since I was really testing what process the terminal handling delivered the
signal to:
$ cat /tmp/test.sh
#!/bin/sh
echo before
sleep 5 || echo sleep failed
echo after
$ sh /tmp/test.sh ; echo $?
before
^\
/tmp/test.sh: line 4: 23407 Quit sleep 5
sleep failed
after
0
--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2006-11-18 06:01:58 | Re: [GENERAL] Shutting down a warm standby database in 8.2beta3 |
Previous Message | Tom Lane | 2006-11-18 05:03:51 | Re: [HACKERS] Shutting down a warm standby database in 8.2beta3 |
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2006-11-18 06:01:58 | Re: [GENERAL] Shutting down a warm standby database in 8.2beta3 |
Previous Message | Tom Lane | 2006-11-18 05:03:51 | Re: [HACKERS] Shutting down a warm standby database in 8.2beta3 |