Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Networking & Security
  • Search

PostgreSQL /sbin/start-stop-daemon problem - SOLVED

Having problems getting connected to the internet or running a server? Wondering about securing your box? Ask here.
Post Reply
Advanced search
7 posts • Page 1 of 1
Author
Message
spottraining
n00b
n00b
User avatar
Posts: 73
Joined: Sun Jan 30, 2005 4:13 pm
Location: Estonia
Contact:
Contact spottraining
Website

PostgreSQL /sbin/start-stop-daemon problem - SOLVED

  • Quote

Post by spottraining » Tue Dec 26, 2006 7:01 pm

Hi

I upgrade my baselayout and Postgresql. And now I have problem. I can not start/restart/stop PostgreSQL server with /etc/init.d/postgresql ..... command. I getting this error:
one init.d # /etc/init.d/postgresql stop
* Stopping PostgreSQL ...
/sbin/start-stop-daemon: invalid schedule item (must be [-]<signal-name>, -<signal-number>, <timeout> or `forever'
Try `/sbin/start-stop-daemon --help' for more information. [ !! ]
I have found, that some bug was with baselayout - but version 1.13. I have now baselayout-1.12.6, PostgreSQL is postgresql-8.0.9-r1.

Other init.d scripts working....

How to fix this problem? I can only start PostgreSQL server, when I do /etc/init.d/postgresql zap and then start. PostgreSQL server with databases works.
Last edited by spottraining on Sat Jan 20, 2007 9:01 am, edited 1 time in total.
Sorry about bad English - I am learning....

The box said Windows XP or better, so I installed Linux
Top
PaulBredbury
Watchman
Watchman
User avatar
Posts: 7310
Joined: Thu Jul 14, 2005 3:47 pm

  • Quote

Post by PaulBredbury » Tue Dec 26, 2006 8:22 pm

The problem may be with the ENV_* variables in /etc/conf.d/postgresql
Top
spottraining
n00b
n00b
User avatar
Posts: 73
Joined: Sun Jan 30, 2005 4:13 pm
Location: Estonia
Contact:
Contact spottraining
Website

  • Quote

Post by spottraining » Tue Dec 26, 2006 9:05 pm

PaulBredbury wrote:The problem may be with the ENV_* variables in /etc/conf.d/postgresql
and how to fix that?
My /etc/conf.d/postgresql file:

Code: Select all

# PostgreSQL's Database Directory
PGDATA=/var/lib/postgresql/data

# Logfile path: (NOTE: This must be uid/gid owned by the value of $PGUSER!)
PGLOG=/var/lib/postgresql/data/postgresql.log

# Run the PostgreSQL user as:
PGUSER=postgres

# Extra options to run postmaster with.
# If you want to enable TCP/IP for PostgreSQL, add -i to the following:
# PGOPTS="-N 1024 -B 2048 -i"
PGOPTS=""
Sorry about bad English - I am learning....

The box said Windows XP or better, so I installed Linux
Top
PaulBredbury
Watchman
Watchman
User avatar
Posts: 7310
Joined: Thu Jul 14, 2005 3:47 pm

  • Quote

Post by PaulBredbury » Tue Dec 26, 2006 9:37 pm

It's not that then, if there are no ENV_* variables defined. I don't see what else it can be - my start-stop line in /etc/init.d/postgresql (with dev-db/postgresql-8.1.5-r1) is:

Code: Select all

    start-stop-daemon --start \
        --pidfile "${PGDATA}/postmaster.pid" \
        --chuid ${PGUSER}:${PGGROUP} \
        --exec /usr/bin/postmaster \
        ${env_vars} -- \
        -D "${PGDATA}" \
        --silent-mode=true \
        ${PGOPTS}
Top
spottraining
n00b
n00b
User avatar
Posts: 73
Joined: Sun Jan 30, 2005 4:13 pm
Location: Estonia
Contact:
Contact spottraining
Website

  • Quote

Post by spottraining » Tue Dec 26, 2006 9:44 pm

My lines are:

Code: Select all

 local env_vars
        for var in ${!ENV_*} ; do env_vars="${env_vars} -e ${!var}" ; done
        start-stop-daemon --start \
                --pidfile "${PGDATA}/postmaster.pid" \
                --chuid ${PGUSER}:${PGGROUP} \
                --exec /usr/bin/postmaster \
                ${env_vars} -- \
                -D "${PGDATA}" \
                --silent-mode=true \
                ${PGOPTS}

        eend $?
}
Sorry about bad English - I am learning....

The box said Windows XP or better, so I installed Linux
Top
spottraining
n00b
n00b
User avatar
Posts: 73
Joined: Sun Jan 30, 2005 4:13 pm
Location: Estonia
Contact:
Contact spottraining
Website

  • Quote

Post by spottraining » Sun Dec 31, 2006 3:18 am

up
Sorry about bad English - I am learning....

The box said Windows XP or better, so I installed Linux
Top
jfb3
Apprentice
Apprentice
Posts: 242
Joined: Sat Feb 01, 2003 11:23 pm

  • Quote

Post by jfb3 » Fri Jan 19, 2007 11:19 pm

I had the same problem stopping postgresql until I realized I hadn't run etc-update. The resolution was that I needed to update the /etc/conf.d/postgresl file to add the following:

Code: Select all

# SERVER SHUTDOWN:
# The server will receive 3 signals in the worst case:
# 1. SIGTERM
#  This signals the server to ignore new connections and to
#  wait for all clients to end their transactions before shutting down.
#  Use WAIT_FOR_DISCONNECT to control how much time the clients
#  should have until the next signal is being sent.
# 2. SIGINT
#  Tell the server to forcefully disconnect all clients.
#  Terminating a client results in a rollback of the open transactions for this client.
#  Use WAIT_FOR_CLEANUP to determine how much time the server has
#  for cleanup. (Set it to "forever" if you want to wait forever.)
# 3. SIGQUIT
#  This will terminate the server immediately and results in a recovery run for the next start.

# Wait for clients to disconnect (seconds or "forever")
WAIT_FOR_DISCONNECT=10

# Time the server has to clean up (seconds or "forever")
WAIT_FOR_CLEANUP=10

# If you have to export environment variables for the database process,
# this can be done here.
# Just define a new variable ENV_identifier="ENV_VAR_NAME=env_var_content",
# ENV_VAR_NAME will then be exported to the postgresql's environment.
#
# Example:
#   ENV_plr="R_HOME=/usr/lib/R"
# This exports a variable R_HOME with the content "/usr/lib/R"
Now I can stop postgresql just fine.
Top
Post Reply

7 posts • Page 1 of 1

Return to “Networking & Security”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy