PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Serveur - Sécurité et techniques > comp.unix.shell > Crontab execution problem
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
comp.unix.shell Using and programming the Unix shell.

Crontab execution problem

Réponse
 
LinkBack Outils de la discussion
Vieux 12/07/2007, 09h23   #1
Cedrick
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Crontab execution problem

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
  Réponse avec citation
Vieux 12/07/2007, 17h53   #2
Michael Tosch
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Crontab execution problem

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
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 19h19.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,10269 seconds with 10 queries