Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 237899 - =dev-db/postgresql-8.2.6: could not create lock file "/tmp/.s.PGSQL.5432.lock": Permission denied
Summary: =dev-db/postgresql-8.2.6: could not create lock file "/tmp/.s.PGSQL.5432.lock...
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: All Linux
: High minor (vote)
Assignee: PgSQL Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-17 07:12 UTC by Robert W.
Modified: 2008-09-24 15:44 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robert W. 2008-09-17 07:12:34 UTC
With postgresql 8.2.6, the init-script is not able to bring the service up. The exact log message is:
-----
Sep 17 08:14:43 [postgres] [1-1] FATAL:  could not create lock file "/tmp/.s.PGSQL.5432.lock": Permission denied
-----

However, starting the service manually, after the boot has finished, using "/etc/init.d/postgresql restart" brings up the database server correctly without problems.

Reproducible: Always

Steps to Reproduce:
1. enable the postgresql-service in default run-level
2. boot the computer

Actual Results:  
The postgresql server has not been started and the log contains the message:
-----
Sep 17 08:14:43 [postgres] [1-1] FATAL:  could not create lock file "/tmp/.s.PGSQL.5432.lock": Permission denied
-----

Expected Results:  
The postgresql server should be started at boot time without necessity of user interaction.

emerge --info:
Portage 2.1.4.4 (default/linux/x86/2008.0/desktop, gcc-4.1.2, glibc-2.6.1-r0, 2.6.26.5-1 i686)
=================================================================
System uname: 2.6.26.5-1 i686 AMD Athlon(tm) MP 2200+
Timestamp of tree: Mon, 15 Sep 2008 05:45:01 +0000
distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
ccache version 2.4 [enabled]
app-shells/bash:     3.2_p33
dev-java/java-config: 1.3.7, 2.1.6
dev-lang/python:     2.5.2-r7
dev-util/ccache:     2.4-r7
sys-apps/baselayout: 1.12.11.1
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.13, 2.61-r2
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.1
sys-devel/binutils:  2.18-r3
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.23-r3
ACCEPT_KEYWORDS="x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=athlon-mp -O3 -fomit-frame-pointer -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/kde/4.1/env /usr/kde/4.1/share/config /usr/kde/4.1/shutdown /usr/share/config /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c /etc/udev/rules.d"
CPPFLAGS="-march=athlon-mp -O3 -fomit-frame-pointer -pipe"
CXXFLAGS="-march=athlon-mp -O3 -fomit-frame-pointer -pipe"
DISTDIR="/var/portage/distfiles"
FEATURES="autoaddcvs ccache distlocks metadata-transfer parallel-fetch sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/ ftp://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/ ftp://pandemonium.tiscali.de/pub/gentoo/ http://gentoo.mneisen.org/"
LC_ALL="de_DE.utf8"
LDFLAGS="-Wl,-z,now"
LINGUAS="de en_GB"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/var/portage"
PORTDIR_OVERLAY="/var/portage/local/crossdev /var/portage/local/layman/java-overlay /var/portage/local/layman/postgresql-testing /var/portage/local/layman/haskell /var/portage/local/layman/kdesvn-portage /usr/local/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="3dnow 3dnowext X a52 aac aalib acl acpi alsa arts bash-completion berkdb bitmap-fonts blas bluetooth branding bzip2 cairo caps cddb cdparanoia cdr cli cracklib crypt cscope cups curl dbus doc dri dts dvd dvdr dvdread eds emacs emboss encode evo examples fam ffmpeg fftw firefox flac fortran ftp gdbm ggi gif gpm graphviz hal hdf5 htmlhandbook iconv idn imap ipod ipv6 isdnlog java java6 jpeg kde latex lcms leim libnotify lm_sensors logitech-mouse mad mailwrapper mbox midi mikmod mmx mmxext modplug motif mp3 mpeg mplayer mudflap musepack musicbrainz ncurses nepomuk nls nptl nptlonly nsplugin ogg opengl openmp pam pcre pda pdf perl plasma plotutils png postgres ppds pppd python qt qt3 qt3support qt4 quicktime readline reflection rtsp samba sasl scanner session smp socks5 speex spell spl sse ssl startup-notification svg sysfs tcpd theora threads tiff truetype truetype-fonts type1-fonts unicode usb vcd vim-syntax vorbis wavpack win32codecs wma x264 x86 xattr xcomposite xine xinerama xml xorg xrandr xscreensaver xv xvid zeroconf zlib" ALSA_CARDS="emu10k1" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="de en_GB" USERLAND="GNU" VIDEO_CARDS="mga vesa fbdev"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
---------------------------------------------------------

/etc/conf.d/postgresql:
# PostgreSQL's Database Directory
PGDATA="/var/lib/postgresql/data"

# PostgreSQL User
PGUSER="postgres"

# PostgreSQL Group
PGGROUP="postgres"

# Extra options to run postmaster with
# -N is the maximal number of client connections
# -B is the number of shared buffers and has to be at least 2x the value for -N
# Please read the man-page to postmaster for more options. Many of these options
# can be set directly in the configuration-file.
PGOPTS="-N 40 -B 80"


# 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.
# Example:
#   export R_HOME="/usr/lib/R"
--------------------------------------------------------

rc-update show:
               acpid | boot                          
           alsasound |      default nonetwork        
                 atd |      default                  
            bootmisc | boot                          
             checkfs | boot                          
           checkroot | boot                          
               clock | boot                          
         consolefont | boot                          
               cupsd |      default                  
             distccd |      default                  
               fcron |      default                  
                hald |      default                  
            hostname | boot                          
             keymaps | boot                          
          lm_sensors |      default nonetwork        
               local |      default nonetwork        
          localmount | boot                          
               mdadm | boot default                  
             metalog |      default nonetwork        
             modules | boot                          
        mysqlmanager |      default                  
            net.eth0 |      default                  
              net.lo | boot default                  
            net.tap0 |      default                  
                ntpd |      default                  
             oidentd |      default                  
          postgresql |      default                  
           rmnologin | boot                          
               samba |      default                  
            sendmail |      default                  
              smartd | boot                          
                sshd |      default                  
             urandom | boot                          
                 xdm |      default                  
              xinetd |      default                  
------------------------------------------------------

Of course, I'll give more information on request.
Comment 1 Robert W. 2008-09-18 15:39:52 UTC
I investigated further and found, that the permissions of /tmp are 0755 at boot. I have not yet found the place, where the permissions are changed.
Comment 2 Robert W. 2008-09-24 15:44:13 UTC
Hi, I must do the ingrid, now.

The bug suddenly disappeared. Postgresql starts up fine, now.

Things I've changed:
I moved my system from a traditionally unencrypted disk, partitioned into /boot, /, /var, /usr and /opt onto another disk, which is partitioned into /boot and a luks-container. The luks-container contains a physical volume, which contains logical volumes, which replace the partitions I had before. Sounds complicated? Works wonderful. And it is all I have changed. Booting the system from the encrypted physical volume resulted in a fine working postgresql.

I'm pretty sure, that does not help, to find the actual problem, but that is, what I did. I did not change or reinstall any file, the logical volumes are copies made by rsync -aSHAX <old-fs> <new-fs>.

I believe I hit some strange conditions, therefore I adjusted this bug's priority and status.