postgresql doesn't check /var/run/postgresql

Bug #12535 reported by 66dny9r02
6
Affects Status Importance Assigned to Milestone
postgresql (Ubuntu)
Fix Released
Medium
Martin Pitt

Bug Description

PostgreSQL init script doesn't check whether /var/run/postgresql exists and
consequently fails if it doesn't.
(postgresql 7.4.7-1)

Revision history for this message
Martin Pitt (pitti) wrote :

(In reply to comment #0)
> PostgreSQL init script doesn't check whether /var/run/postgresql exists and
> consequently fails if it doesn't.
> (postgresql 7.4.7-1)

This directory is installed along with package installation, so it should be
there unless you removed it manually. So where is the bug here?

Revision history for this message
66dny9r02 (66dny9r02) wrote :

(In reply to comment #1)
> (In reply to comment #0)
> > PostgreSQL init script doesn't check whether /var/run/postgresql exists and
> > consequently fails if it doesn't.
> > (postgresql 7.4.7-1)
>
> This directory is installed along with package installation, so it should be
> there unless you removed it manually. So where is the bug here?

Well, most packages do this check (at least dbus, hal, klogd, sshd, sudo; mysql
as well IIRC). That's why I supposed doing the check is the normal behavior. The
reason I found this difference is that I use tmpfs for /var/run since it
contains session specific data (I tried to find out what LSB says about this but
didn't succeed). I agree it's not at all a bad bug of course.

Revision history for this message
Martin Pitt (pitti) wrote :

Hi!

(In reply to comment #2)
> The reason I found this difference is that I use tmpfs for /var/run.

Ah, that explains the issue. Well, I think this is a valid use case, so I will
fix that in the near future. However, I don't want to do an upload just for
this, so I wait until something else accumulated.

Martin

Revision history for this message
Martin Pitt (pitti) wrote :

 postgresql (7.4.7-2ubuntu2) hoary; urgency=low
 .
   * debian/postgresql.init: Create socket directory /var/run/postgresql if it
     does not exist. This happens if /var/run is mounted on a tmpfs.
     (Ubuntu #6168)

Revision history for this message
Matt Zimmerman (mdz) wrote :

There are a number of other packages which misbehave if you use tmpfs for
/var/run; this isn't supported. Packages place directories there, and by using
tmpfs, you are removing directories owned by the packaging system.

Revision history for this message
66dny9r02 (66dny9r02) wrote :

(In reply to comment #5)
> There are a number of other packages which misbehave if you use tmpfs for
> /var/run; this isn't supported. Packages place directories there, and by using
> tmpfs, you are removing directories owned by the packaging system.

I'm aware that some packages don't support it at this moment, but most do (at
least all packages I have on my system).

I think it's a very clean solution to use a tmpfs on /var/run, because all
information in that directory is essentially for the current session only (apart
from empty directories). Using tmpfs, all such session specific information will
be removed on reboot to actually enforce this. It doesn't make sense e.g. to try
to kill a certain PID after a reboot. (The Filesystem Hierarchy Standard even
specifies that files under /var/run should be "cleared" at the beginning of the
boot process. I know that it doesn't specify that directories should be
cleared.) Shall I bring this to ubuntu-devel?

Revision history for this message
Matt Zimmerman (mdz) wrote :

(In reply to comment #6)
> (In reply to comment #5)
> > There are a number of other packages which misbehave if you use tmpfs for
> > /var/run; this isn't supported. Packages place directories there, and by using
> > tmpfs, you are removing directories owned by the packaging system.
>
> I'm aware that some packages don't support it at this moment, but most do (at
> least all packages I have on my system).
>
> I think it's a very clean solution to use a tmpfs on /var/run, because all
> information in that directory is essentially for the current session only (apart
> from empty directories). Using tmpfs, all such session specific information will
> be removed on reboot to actually enforce this. It doesn't make sense e.g. to try
> to kill a certain PID after a reboot. (The Filesystem Hierarchy Standard even
> specifies that files under /var/run should be "cleared" at the beginning of the
> boot process. I know that it doesn't specify that directories should be
> cleared.) Shall I bring this to ubuntu-devel?

This is one of the reasons why FHS specifies that only files should be cleared.
 The situation is the same with /var/cache.

Yes, this should be discussed on ubuntu-devel, before filing bugs.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.