| |||||||
| Développement web Pour les webmasters qui utilisent PHP, MySQL, AJAX, CSS, JavaScript, etc. |
![]() |
| | Outils de la discussion | Modes d'affichage |
| | postgres et launchd | #1 | ||||||
| Membre confirmé Date d'inscription: 11/03/05 Localisation: Grenoble
Messages: 224
Disco: ![]() |
Bonjour, Je souhaiterais que mon serveur postgres démarre en même temps que ma session et surtout qu'il s'arrête proprement quand l'ordinateur doit redémarrer. J'ai trouvé des moyens de le faire qui recommandent l'emploi de launchd, mais voilà ça ne marche pas ! Mon serveur postgres est compilé par fink donc dans /sw, c'est la dernière version à ce jour 8.3.1 Je le démarre à la main de cette manière : Code: sudo -u postgres /sw/bin/pg_ctl -D /sw/var/postgresql-8.3/data -l /sw/var/postgresql-8.3/logfile.log Code: <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>GroupName</key>
<string>postgres</string>
<key>Label</key>
<string>org.postgresql.PostgreSQL</string>
<key>OnDemand</key>
<true/>
<key>ProgramArguments</key>
<array>
<string>-u</string>
<string>postgres</string>
<string>/sw/bin/pg_ctl</string>
<string>-D</string>
<string>/sw/var/postgresql-8.3/data/</string>
<string>-l</string>
<string>/sw/var/postgresql-8.3/logfile.log</string>
<string>start</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>ServiceDescription</key>
<string>PostgreSQL Server</string>
<key>UserName</key>
<string>postgresql-8.3</string>
</dict>
</plist>
Les droits du fichier .plist sont bons et quand je lance le service "à la main" Code: sudo launchctl load /Library/LaunchDaemons/org.postgresql.PostgreSQL.plist sudo launchctl start org.postgresql.PostgreSQL Remarque, j'ai aussi essayé de lancer postmaster au lieu de pg_ctl car il paraît que launchd n'aime pas les process qui forkent et quittent, ce qui semble être le cas de pg_ctl, mais ça ne marche pas plus. Je peux aussi fournir le fichier .plist correspondant si besoin. Quelqu'un a-t-il réussi à avoir un serveur postgres qui démarre et s'arrête en même temps que l'ordinateur ? | |||||||
|
--------------------
MBP 15.4" (unibody) 4 Go, 250 Go, TimeCapsule 1 To, Triple boot 10.6.2-XP/SP3-Ubuntu 9.04 et un iPhone 3GS 32Go "La théorie, c'est quand on sait tout et que rien ne fonctionne. La pratique, c'est quand tout fonctionne et que personne ne sait pourquoi." Albert Einstein | ||||||||
| | | |||||||
| | #2 | |||||||
| Accro à MacG Date d'inscription: 09/11/00 Localisation: Grenoble, France
Messages: 3001
Disco: ![]() ![]() ![]() ![]() ![]() ![]() |
Tu peux chercher du côté des startupitems, il y'en a un de fourni avec mysql, j'imagine que ça doit s'adapter à postgre sans trop de mal.
| |||||||
|
--------------------
clan m4k : joueurs mac francophones. Recrutement sur COD4, et dès que possible sur Starcraft 2. | ||||||||
| | | |||||||
| | #3 | |||||||
| Accro à MacG Date d'inscription: 09/11/00 Localisation: Grenoble, France
Messages: 3001
Disco: ![]() ![]() ![]() ![]() ![]() ![]() |
Je viens de retomber là dessus par hasard : http://www.entropy.ch/software/macosx/postgresql/ Tu devrais y trouver ce qu'il te faut. | |||||||
|
--------------------
clan m4k : joueurs mac francophones. Recrutement sur COD4, et dès que possible sur Starcraft 2. | ||||||||
| | | |||||||
| | #4 | |||||||
| Membre confirmé Date d'inscription: 11/03/05 Localisation: Grenoble
Messages: 224
Disco: ![]() |
Merci pour les tuyaux, mais j'ai déjà essayé... En fait la distrib d'entropy ne me permet pas d'utiliser des fonctions particulières de postgres que je peux compiler dans celle de fink Pour les startupitems, ça ne marche pas non plus... | |||||||
|
--------------------
MBP 15.4" (unibody) 4 Go, 250 Go, TimeCapsule 1 To, Triple boot 10.6.2-XP/SP3-Ubuntu 9.04 et un iPhone 3GS 32Go "La théorie, c'est quand on sait tout et que rien ne fonctionne. La pratique, c'est quand tout fonctionne et que personne ne sait pourquoi." Albert Einstein Dernière modification par ThiGre ; 01/06/2008 à 13h06. | ||||||||
| | | |||||||
| | #5 | |||||||
| Membre confirmé Date d'inscription: 11/03/05 Localisation: Grenoble
Messages: 224
Disco: ![]() |
Bon c'est vraiment dommage que je n'arrive pas à trouver le truc pour postgres, car pour mon serveur mysql, ça marche sans problème. Launchd lance gère mon serveur mysql efficacement ! | |||||||
|
--------------------
MBP 15.4" (unibody) 4 Go, 250 Go, TimeCapsule 1 To, Triple boot 10.6.2-XP/SP3-Ubuntu 9.04 et un iPhone 3GS 32Go "La théorie, c'est quand on sait tout et que rien ne fonctionne. La pratique, c'est quand tout fonctionne et que personne ne sait pourquoi." Albert Einstein | ||||||||
| | | |||||||
| | #6 | |||||||
| Membre confirmé Date d'inscription: 11/03/05 Localisation: Grenoble
Messages: 224
Disco: ![]() |
Bon voilà, j'ai enfin trouvé le bon message ![]() ![]() Après adaptation, voici mon fichier .plist Code: <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>GID</key>
<integer>502</integer>
<key>GroupName</key>
<string>postgres</string>
<key>Label</key>
<string>org.postgres.PostgreSQL</string>
<key>OnDemand</key>
<false/>
<key>ProgramArguments</key>
<array>
<string>/sw/bin/postmaster</string>
<string>-D</string>
<string>/sw/var/postgresql-8.3/data</string>
</array>
<key>ServiceDescription</key>
<string>PostgreSQL Database Server</string>
<key>UID</key>
<integer>502</integer>
<key>UserName</key>
<string>postgres</string>
</dict>
</plist>
![]() Il ne me reste plus qu'à incorporer postgres dans php5, mais bon ça c'est pas très important pour l'instant ! | |||||||
|
--------------------
MBP 15.4" (unibody) 4 Go, 250 Go, TimeCapsule 1 To, Triple boot 10.6.2-XP/SP3-Ubuntu 9.04 et un iPhone 3GS 32Go "La théorie, c'est quand on sait tout et que rien ne fonctionne. La pratique, c'est quand tout fonctionne et que personne ne sait pourquoi." Albert Einstein | ||||||||
| | | |||||||
![]() |
| Utilisateurs regardant la discussion actuelle : 1 (0 membre(s) et 1 invité(s)) | |
| Outils de la discussion | |
| Modes d'affichage | |
| |
Discussions similaires | ||||
| Discussion | Auteur | Forum | Réponses | Dernier message |
| Fonctionnement launchd et sockets | Sékiltoyai | Développement sur Mac | 1 | 04/04/2008 18h00 |
| launchd ? | lbalda2 | Mac OS X | 1 | 13/02/2006 16h18 |
| postgres | plouffsouris | Unix, Linux & Open Source | 2 | 21/07/2005 14h31 |