Results 1 to 3 of 3

Thread: Failed #service postgresql start

  1. #1
    Join Date

    Question Failed #service postgresql start

    Why I type command to start postgresql I get this error message:
    [....] Starting PostgreSQL 9.1 database server: main[....] The PostgreSQL server failed to start. Please check the log output: 2013-06-23 23:15:41 EDT FATAL: could not create shared memory segment: Invalid argument 2013-06-23 23:15:41 EDT DETAIL: Failed system call was shmget(key=5432001, size=41263104, 03600). 2013-06-23 23:15:41 EDT HINT: This error usually means that PostgreSQL's request for a shared memory segment exceeded your kernel's SHMMAX parameter. You can either reduce the request size or reconfigure the kernel with larger SHMMAX. To reduce the request size (currently 41263104 bytes), reduce PostgreSQL's shared memory usage, perhaps by reducing shared_buffers or max_connections. If the request size is already small, it's possible that it is less than your kernel's SHMMIN parameter, in which case raising the request size or reconfiguring SHMMIN is called for. The PostgreSQL documentation contains more inform[FAIL about shared memory configuration. ... failed!

    I have tried to change the SHMMAX in the /etc/sysctl.d/30-postgresql-shm.conf with no luck.

  2. #2
    Join Date
    Found a fix here:

    To fix postgresql temporarily run this command: #sysctl -w kernel.shmmax=134217728
    To fix for good edit file #nano /etc/sysctl.conf Add line at bottom uncommented (kernel.shmmax = 134217728)

  3. #3
    I know you already did this however, it seems different system responds to different shmmax value. Try with a different value.

    A good read for you here:
    A nice Q&A explaining SHHMAX and Shared memory here:
    and of course PostgreSQL doco for the kicks:

    Stop Service:
    service postgresql stop
    Edit following file:
     leafpad /etc/sysctl.d/30-postgresql-shm.conf
    Uncomment the kernel.shmmax line

    and change its values to something bigger.

    kernel.shmmax = 33554432

    Save and Quit file.

    Start service again:
    service postgresql start

Similar Threads

  1. postgresql.service wont start
    By cyRix in forum ARM Archive
    Replies: 1
    Last Post: 2020-11-24, 13:38
  2. Postgresql service wont start after reboot.
    By kalipi2 in forum ARM Archive
    Replies: 0
    Last Post: 2015-05-24, 09:28
  3. Kali on AWS - service postgresql start issue
    By 2bitwannabe in forum TroubleShooting Archive
    Replies: 1
    Last Post: 2014-03-05, 01:52

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts