|
|
|
|
||||||
| comp.unix.shell Using and programming the Unix shell. |
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Hello,
I'm using crontab to stop and start postgres. 51 09 * * * su -c'/path/to/bin/pg_ctl -D /pgsql/data stop' postgres 52 09 * * * su -c'/path/to/bin/pg_ctl -D /pgsql/data start' postgres Everything goes fine with the 'stop' But after the 'start', ps -ea shows me 7480 ? 00:00:00 su <defunct> The "su" process turn on 'Zs' state ... I think (but not sure) it's maybe because there is no 'exit code'. When I stop postgres, the 'su' line is removed. Any ideas .... thanks Ced |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
Cedrick wrote:
> Hello, > > I'm using crontab to stop and start postgres. > > 51 09 * * * su -c'/path/to/bin/pg_ctl -D /pgsql/data stop' postgres > 52 09 * * * su -c'/path/to/bin/pg_ctl -D /pgsql/data start' postgres > > > Everything goes fine with the 'stop' > But after the 'start', ps -ea shows me > > 7480 ? 00:00:00 su <defunct> > > The "su" process turn on 'Zs' state ... I think (but not sure) it's > maybe because there is no 'exit code'. > When I stop postgres, the 'su' line is removed. > > Any ideas .... > The final process (daemon) seems not to close its stdin/stdout/stderr. You can "close" (redirect to /dev/null) stdin/sdout/stderr like this: su -c postgres '/path/to/bin/pg_ctl -D /pgsql/data start </dev/null >/dev/null 2>&1' Or you can modify the /path/to/bin/pg_ctl script and close them there. -- Michael Tosch @ hp : com |
|
![]() |
| Outils de la discussion | |
|
|