Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit87a9473

Browse files
committed
Update /contrib OS/X startup files, and move to a separate OS/X
directory.Mark Cotner and David Fetter
1 parent44af16f commit87a9473

File tree

4 files changed

+21
-5
lines changed

4 files changed

+21
-5
lines changed

‎contrib/start-scripts/PostgreSQL.darwinrenamed to‎contrib/start-scripts/osx/PostgreSQL

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@
1616
#
1717
# Next, add this line to the /etc/hostconfig file:
1818
#
19-
#POSTGRESQLSERVER=-YES-
19+
#POSTGRESQL=-YES-
2020
#
2121
# The startup bundle will now be ready to go. To prevent this script from
2222
# starting PostgreSQL at system startup, simply change that line in
2323
# /etc/hostconfig back to:
2424
#
25-
#POSTGRESQLSERVER=-NO-
25+
#POSTGRESQL=-NO-
2626
#
2727
# For more information on Darwin/Mac OS X startup bundles, see this article:
2828
#
@@ -66,7 +66,7 @@ ROTATESEC="604800"
6666
################################################################################
6767

6868
# The path that is to be used for the script
69-
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
69+
PATH=/usr/local/pgsql/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
7070

7171
# What to use to start up the postmaster (we do NOT use pg_ctl for this,
7272
# as it adds no value and can cause the postmaster to misrecognize a stale
@@ -82,8 +82,9 @@ LOGUTIL="/usr/sbin/rotatelogs"
8282
. /etc/rc.common
8383

8484
StartService () {
85-
if ["${POSTGRESQLSERVER:=-NO-}"="-YES-" ];then
85+
if ["${POSTGRESQL:=-NO-}"="-YES-" ];then
8686
ConsoleMessage"Starting PostgreSQL database server"
87+
cd /Users/postgres
8788
if ["${ROTATELOGS}"="1" ];then
8889
sudo -u$PGUSER sh -c"${DAEMON} -D '${PGDATA}' |${LOGUTIL} '${PGLOG}'${ROTATESEC} &"
8990
else
@@ -94,13 +95,15 @@ StartService () {
9495

9596
StopService () {
9697
ConsoleMessage"Stopping PostgreSQL database server"
98+
cd /Users/postgres
9799
sudo -u$PGUSER$PGCTL stop -D"$PGDATA" -s -m fast
98100
}
99101

100102
RestartService () {
101-
if ["${POSTGRESQLSERVER:=-NO-}"="-YES-" ];then
103+
if ["${POSTGRESQL:=-NO-}"="-YES-" ];then
102104
ConsoleMessage"Restarting PostgreSQL database server"
103105
# should match StopService:
106+
cd /Users/postgres
104107
sudo -u$PGUSER$PGCTL stop -D"$PGDATA" -s -m fast
105108
# should match StartService:
106109
if ["${ROTATELOGS}"="1" ];then

‎contrib/start-scripts/osx/README

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
To install execute the following:
2+
3+
sudo /bin/sh ./install.sh

‎contrib/start-scripts/osx/install.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
sudo sh -c'echo "POSTGRESQL=-YES-" >> /etc/hostconfig'
2+
sudo mkdir /Library/StartupItems/PostgreSQL
3+
sudo cp PostgreSQL /Library/StartupItems/PostgreSQL
4+
sudo cp StartupParameters.plist /Library/StartupItems/PostgreSQL
5+
if [-e /Library/StartupItems/PostgreSQL/PostgreSQL ]
6+
then
7+
echo"Startup Item Installed Successfully . . ."
8+
echo"Starting PostgreSQL Server . . ."
9+
SystemStarter restart PostgreSQL
10+
fi

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp