Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 5 Nov 1999 22:59:16 +0100
From:      Ollivier Robert <roberto@keltia.freenix.fr>
To:        "FreeBSD Current Users' list" <freebsd-current@FreeBSD.ORG>
Subject:   Serious locking problem in CURRENT
Message-ID:  <19991105225916.A14961@keltia.freenix.fr>

next in thread | raw e-mail | index | archive | help
While changing my Postfix configuration, I stumbled on something weird.

One of Postfix's processes (master) runs all the time and keep a exclusive
write lock on $spool/pid/master.pid. When one does a reload, postfix-script
runs master with the ``-t'' argument which makes master try to get a lock on
the pid file.

Under 3.3-RELEASE, everything is fine, the lock can't be obtained and Postfix
knows it is already running.

Under -CURRENT (two days old), the lock IS OBTAINED, meaning Postfix thinks it 
is not running.

3.3-RELEASE: OK
-=-=-=-
402 [22:56] root@sidhe:/etc/postfix# make
postfix reload
postfix-script: refreshing the Postfix mail system

404 [22:56] root@sidhe:spool/postfix# kdump|tail -20
  8359 master   RET   getrlimit 0
  8359 master   CALL  chdir(0x8057b28)
  8359 master   NAMI  "/var/spool/postfix"
  8359 master   RET   chdir 0
  8359 master   CALL  access(0x805c3e8,0)
  8359 master   NAMI  "pid/master.pid"
  8359 master   RET   access 0
  8359 master   CALL  open(0x805c3e8,0x2,0)
  8359 master   NAMI  "pid/master.pid"
  8359 master   RET   open 7
  8359 master   CALL  fstat(0x7,0xbfbfd300)
  8359 master   RET   fstat 0
  8359 master   CALL  lstat(0x805c3e8,0xbfbfd2a0)
  8359 master   NAMI  "pid/master.pid"
  8359 master   RET   lstat 0
  8359 master   CALL  flock(0x7,0x6)
  8359 master   RET   flock -1 errno 35 Resource temporarily unavailable
  8359 master   CALL  close(0x7)
  8359 master   RET   close 0
  8359 master   CALL  exit(0x1)
-=-=-=-

4.0-CURRENT: NOT OK
-=-=-=-
331 [22:55] root@keltia:spool/postfix# postfix reload
postfix-script: fatal: the Postfix mail system is not running

332 [22:56] root@keltia:spool/postfix# kdump|tail -20
 14942 master   RET   gettimeofday 0
 14942 master   CALL  getrlimit(0x1,0xbfbfd3d0)
 14942 master   RET   getrlimit 0
 14942 master   CALL  chdir(0x80589e8)
 14942 master   NAMI  "/var/spool/postfix"
 14942 master   RET   chdir 0
 14942 master   CALL  access(0x805e248,0)
 14942 master   NAMI  "pid/master.pid"
 14942 master   RET   access 0
 14942 master   CALL  open(0x805e248,0x2,0)
 14942 master   NAMI  "pid/master.pid"
 14942 master   RET   open 7
 14942 master   CALL  fstat(0x7,0xbfbfd324)
 14942 master   RET   fstat 0
 14942 master   CALL  lstat(0x805e248,0xbfbfd2c4)
 14942 master   NAMI  "pid/master.pid"
 14942 master   RET   lstat 0
 14942 master   CALL  flock(0x7,0x6)                    <<<<<<<< ?????
 14942 master   RET   flock 0                           <<<<<<<< ?????
 14942 master   CALL  exit(0)
-=-=-=-

I've verified that it has a lock on 3.3-RELEASE but can't on CURRENT since
lsof is broken (sigh).

3.3-RELEASE:

405 [22:56] root@sidhe:spool/postfix# lsof pid/master.pid 
COMMAND  PID USER   FD   TYPE   DEVICE SIZE/OFF  NODE NAME
master  7155 root    7uW VREG 0,131079       17 18615 pid/master.pid
                     ^^^

Same Postfix versions on both. I even recompiled it on CURRENT.

406 [22:58] root@sidhe:spool/postfix# postconf mail_version
mail_version = Snapshot-19990912

333 [22:56] root@keltia:spool/postfix# postconf mail_version
mail_version = Snapshot-19990912

-- 
Ollivier ROBERT -=- FreeBSD: The Power to Serve! -=- roberto@keltia.freenix.fr
FreeBSD keltia.freenix.fr 4.0-CURRENT #75: Tue Nov  2 21:03:12 CET 1999



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19991105225916.A14961>