Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 225029 Details for
Bug 311047
New init scripts and conf files for dev-db/postgresql-server
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
Update init for 7.4
postgresql.init-7.4 (text/plain), 3.55 KB, created by
Aaron W. Swenson
on 2010-03-23 23:52:12 UTC
(
hide
)
Description:
Update init for 7.4
Filename:
MIME Type:
Creator:
Aaron W. Swenson
Created:
2010-03-23 23:52:12 UTC
Size:
3.55 KB
patch
obsolete
>#!/sbin/runscript ># Copyright 1999-2010 Gentoo Foundation ># Distributed under the terms of the GNU General Public License v2 ># $Header: $ > >depend() { > use net > if [ -L /etc/eselect/postgresql/service ] ; then > local p_service="$(for f in /etc/eselect/postgresql/service/* ; do . $f ; done ; echo $postgres_service )" > test "${p_service}" = "${SVCNAME}" && provide postgresql > fi >} > >checkconfig() { > if [ ! -d "$PGDATA" ] ; then > eerror "Directory not found: $PGDATA" > eerror "Please make sure that PGDATA points to the right path." > eerror "You can run 'emerge postgresql-server --config' to setup a new database cluster." > return 1 > fi >} > >start() { > checkconfig || return 1 > > ebegin "Starting PostgreSQL" > > if [ -f "$PGDATA/postmaster.pid" ] ; then > rm -f "$PGDATA/postmaster.pid" > fi > > local retval > > su -l ${PGUSER} \ > -c "env PGDATA=\"${PGDATA}\" PGPORT=\"${PGPORT}\" ${PG_EXTRA_ENV} /usr/lib/postgresql-7.4/bin/pg_ctl start ${WAIT_FOR_START} -s -o '${PGOPTS}'" > retval=$? > > if [[ $retval != 0 ]] ; then > eend $retval > return $retval > fi > > # The following is to catch the case of an already running server > # in which pg_ctl doesn't know to which server it connected to and > # falsely reports the server as 'up' > sleep 2 > if [ ! -f "$PGDATA/postmaster.pid" ] ; then > eerror "The PID file doesn't exist but pg_ctl reported a running server." > eerror "Please check whether there is another server running on the same port or read the log-file." > eend 1 > return 1 > fi > > local pid=$(grep "^[0-9]\+" "$PGDATA/postmaster.pid") > ps -p "${pid}" &> /dev/null > eend $? >} > >stop() { > ebegin "Stopping PostgreSQL (this can take a few minutes)" > > local retval > > if [[ "${NICE_QUIT}" != "NO" ]] ; then > su -l ${PGUSER} \ > -c "env PGDATA=\"${PGDATA}\" PGPORT=\"${PGPORT}\" ${PG_EXTRA_ENV} /usr/lib/postgresql-7.4/bin/pg_ctl stop ${WAIT_FOR_STOP} -s -m smart" > retval=$? > > if [[ $retval == 0 ]] ; then > eend $retval > return $retval > fi > > ewarn "Shutting down the server gracefully failed." > ewarn "Probably because some clients did not disconnect within 60 seconds." > else > ewarn "NICE_QUIT disabled." > ewarn "You really should have it enabled." > fi > > if [[ "${RUDE_QUIT}" == "YES" ]] ; then > ewarn "RUDE_QUIT enabled." > ewarn "Going to shutdown the server anyway." > > su -l ${PGUSER} \ > -c "env PGDATA=\"${PGDATA}\" PGPORT=\"${PGPORT}\" ${PG_EXTRA_ENV} /usr/lib/postgresql-7.4/bin/pg_ctl stop ${WAIT_FOR_STOP} -s -m fast" > retval=$? > > if [[ $retval == 0 ]] ; then > eend $retval > return $retval > fi > > eerror "Failed to shutdown server." > else > ewarn "RUDE_QUIT disabled." > fi > > if [[ "${FORCE_QUIT}" == "YES" ]] ; then > ewarn "FORCE_QUIT enabled." > ewarn "Forcing server to shutdown." > ewarn "A recover-run will be executed on the next startup." > > su -l ${PGUSER} \ > -c "env PGDATA=\"${PGDATA}\" PGPORT=\"${PGPORT}\" ${PG_EXTRA_ENV} /usr/lib/postgresql-7.4/bin/pg_ctl stop ${WAIT_FOR_STOP} -s -m immediate" > > retval=$? > > if [[ $retval == 0 ]] ; then > ewarn "Server forced down." > eend $retval > return $retval > fi > > eerror "Forced shutdown failed!!!" > eerror "Something is wrong with your system." > eerror "Please take care of it manually." > eerror "Unable to stop server." > eend $retval > return $retval > else > ewarn "FORCE_QUIT disabled." > eerror "Unable to shutdown server." > eend 1 > return 1 > fi >} > >reload() { > ebegin "Reloading PostgreSQL configuration" > su -l ${PGUSER} \ > -c "env PGDATA=\"${PGDATA}\" PGPORT=\"${PGPORT}\" ${PG_EXTRA_ENV} /usr/lib/postgresql-7.4/bin/pg_ctl reload -s" > eend $? >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 311047
:
225025
| 225029 |
225031
|
225033
|
225035
|
225037
|
225039
|
225041
|
225043
|
225045
|
225047
|
225049
|
225051
|
225053