Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
4d718803
Commit
4d718803
authored
26 years ago
by
Thomas G. Lockhart
Browse files
Options
Downloads
Patches
Plain Diff
csh and sh examples were reversed.
Update the csh example with new comments and fixes from Thomas' linux box.
parent
59d9fd9b
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
contrib/linux/postgres.init.csh
+23
-7
23 additions, 7 deletions
contrib/linux/postgres.init.csh
contrib/linux/postgres.init.sh
+3
-3
3 additions, 3 deletions
contrib/linux/postgres.init.sh
with
26 additions
and
10 deletions
contrib/linux/postgres.init.csh
+
23
−
7
View file @
4d718803
...
@@ -8,18 +8,23 @@
...
@@ -8,18 +8,23 @@
# This version can log backend output through syslog using the local5 facility.
# This version can log backend output through syslog using the local5 facility.
# To enable this, edit /etc/syslog.conf to include a line similar to:
# To enable this, edit /etc/syslog.conf to include a line similar to:
# local5.* /var/log/postgres
# local5.* /var/log/postgres
# and then set USE_SYSLOG to "yes" below
# and then set USE_SYSLOG to "yes"
and FACILITY to "local5"
below
#
#
#PGBIN="/opt/postgres/current/bin" # not used
#PGBIN="/opt/postgres/current/bin" # not used
any more - thomas 1997-12-14
PGACCOUNT
=
"postgres"
# the postgres account (you called it something else?)
PGACCOUNT
=
"postgres"
# the postgres account (you called it something else?)
POSTMASTER
=
"postmaster"
# this probably won't change
POSTMASTER
=
"postmaster"
# this probably won't change
USE_SOCKET
=
"yes"
# "no" to disable Unix sockets on localhost
PGSOCKETFILE
=
"/tmp/.s.PGSQL.5432"
USE_SYSLOG
=
"yes"
# "yes" to enable syslog, "no" to go to /tmp/postgres.log
USE_SYSLOG
=
"yes"
# "yes" to enable syslog, "no" to go to /tmp/postgres.log
FACILITY
=
"local5"
# can assign local0-local7 as the facility for logging
FACILITY
=
"local5"
# can assign local0-local7 as the facility for logging
PGLOGFILE
=
"/tmp/postgres.log"
# only used if syslog is disabled
PGLOGFILE
=
"/tmp/postgres.log"
# only used if syslog is disabled
PGOPTS
=
"-B 256"
PGOPTS
=
"-i -B 1024"
# -S -o '-Fe'"
#PGOPTS="-i -B 256" # -i to enable TCP/IP rather than Unix socket
if
[
${
USE_SOCKET
}
=
"no"
]
then
PGOPTS
=
"-i
${
PGOPTS
}
"
# -i to enable TCP/IP rather than Unix socket
fi
# Source function library.
# Source function library.
.
/etc/rc.d/init.d/functions
.
/etc/rc.d/init.d/functions
...
@@ -34,22 +39,29 @@ then
...
@@ -34,22 +39,29 @@ then
exit
0
exit
0
fi
fi
# Don't bother checking for file existance to avoid hardcoding any paths - thomas 1997-12-14
#[ -f ${PGBIN}/${POSTMASTER} ] || exit 0
#[ -f ${PGBIN}/${POSTMASTER} ] || exit 0
# See how we were called.
# See how we were called.
case
"
$1
"
in
case
"
$1
"
in
start
)
start
)
# force a stop to kill a running postmaster and to clean up sockets
# necessary if system crashed (a power outage provoked this feature)
eval
$0
stop
# save the old log file, if any
if
[
-f
${
PGLOGFILE
}
]
if
[
-f
${
PGLOGFILE
}
]
then
then
mv
${
PGLOGFILE
}
${
PGLOGFILE
}
.old
mv
${
PGLOGFILE
}
${
PGLOGFILE
}
.old
fi
fi
echo
-n
"Starting postgres: "
echo
-n
"Starting postgres: "
# force full login to get path names
# force full login to get path names
# my postgres runs
SH/BASH
so use proper syntax in redirection...
# my postgres runs
tcsh
so use proper syntax in redirection...
if
[
${
USE_SYSLOG
}
=
"yes"
]
;
then
if
[
${
USE_SYSLOG
}
=
"yes"
]
;
then
su -
${
PGACCOUNT
}
-c
"(
${
POSTMASTER
}
${
PGOPTS
}
2>&1
| logger -p
${
FACILITY
}
.notice) &"
>
/dev/null
2>&1
&
su -
${
PGACCOUNT
}
-c
"(
${
POSTMASTER
}
${
PGOPTS
}
|
&
logger -p
${
FACILITY
}
.notice) &"
>
/dev/null&
else
else
su -
${
PGACCOUNT
}
-c
"
${
POSTMASTER
}
${
PGOPTS
}
2
>>&
1
${
PGLOGFILE
}
&"
>
/dev/null
2>&1
&
su -
${
PGACCOUNT
}
-c
"
${
POSTMASTER
}
${
PGOPTS
}
>>&
!
${
PGLOGFILE
}
&"
>
/dev/null&
fi
fi
sleep
5
sleep
5
pid
=
`
pidof
${
POSTMASTER
}
`
pid
=
`
pidof
${
POSTMASTER
}
`
...
@@ -65,6 +77,10 @@ case "$1" in
...
@@ -65,6 +77,10 @@ case "$1" in
kill
-TERM
$pid
kill
-TERM
$pid
sleep
1
sleep
1
fi
fi
if
[
${
USE_SOCKET
}
=
"yes"
]
&&
[
-S
${
PGSOCKETFILE
}
]
;
then
echo
-n
" (remove socket
${
PGSOCKETFILE
}
)"
rm
-f
${
PGSOCKETFILE
}
fi
echo
echo
;;
;;
*
)
*
)
...
...
This diff is collapsed.
Click to expand it.
contrib/linux/postgres.init.sh
+
3
−
3
View file @
4d718803
...
@@ -45,11 +45,11 @@ case "$1" in
...
@@ -45,11 +45,11 @@ case "$1" in
fi
fi
echo
-n
"Starting postgres: "
echo
-n
"Starting postgres: "
# force full login to get path names
# force full login to get path names
# my postgres runs
C
SH/
TC
SH so use proper syntax in redirection...
# my postgres runs SH/
BA
SH so use proper syntax in redirection...
if
[
${
USE_SYSLOG
}
=
"yes"
]
;
then
if
[
${
USE_SYSLOG
}
=
"yes"
]
;
then
su -
${
PGACCOUNT
}
-c
"(
${
POSTMASTER
}
${
PGOPTS
}
|
&
logger -p
${
FACILITY
}
.notice) &"
>
/dev/null&
su -
${
PGACCOUNT
}
-c
"(
${
POSTMASTER
}
${
PGOPTS
}
2>&1
| logger -p
${
FACILITY
}
.notice) &"
>
/dev/null
2>&1
&
else
else
su -
${
PGACCOUNT
}
-c
"
${
POSTMASTER
}
${
PGOPTS
}
>>&
!
${
PGLOGFILE
}
&"
>
/dev/null&
su -
${
PGACCOUNT
}
-c
"
${
POSTMASTER
}
${
PGOPTS
}
2
>>&
1
${
PGLOGFILE
}
&"
>
/dev/null
2>&1
&
fi
fi
sleep
5
sleep
5
pid
=
`
pidof
${
POSTMASTER
}
`
pid
=
`
pidof
${
POSTMASTER
}
`
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment