havp fails to (re)start because of mounted /var/spool/havp in Karmic

Bug #401048 reported by Imre Gergely
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
havp (Debian)
Fix Released
Unknown
havp (Ubuntu)
Fix Released
Wishlist
Andres Rodriguez

Bug Description

Binary package hint: havp

When stopping havp (0.90-1ubuntu1) on Karmic, it doesn't unmount /var/spool/havp and because of this it can't start again.

Looking at the init script it seems the script checks if /var/lib/havp/havp.loop is mounted by grep'ing the output of "mount" (which DOESN'T contain that filename, it contains /dev/loop0).

+ echo -n Cleaning up /var/spool/havp...
Cleaning up /var/spool/havp...+ find /var/spool/havp/ -type f -delete
+ echo done
 done
+ [ xtrue = xtrue ]
+ mount
+ grep ^/var/lib/havp/havp.loop
+ [ ]
+ exit 0

Here's the output of "mount" on my machine:

root@utest-kk:~# mount |grep havp
/dev/loop0 on /var/spool/havp type ext3 (rw,mand)

root@utest-kk:~# losetup -a
/dev/loop0: [0801]:196609 (/var/lib/havp/havp.loop)

This is when starting havp:

+ echo -n Mounting /var/lib/havp/havp.loop under /var/spool/havp ...
Mounting /var/lib/havp/havp.loop under /var/spool/havp ...+ mount -o rw,mand,loop /var/lib/havp/havp.loop /var/spool/havp

So instead of showing the actual mounted file (/var/lib/havp/havp.loop), "mount" shows /dev/loop0. Weird.

Related branches

Revision history for this message
Scott Kitterman (kitterman) wrote : Re: [Bug 401048] [NEW] havp fails to (re)start because of mounted /var/spool/havp in Karmic

I may be thinking of a different package, but I think we have a fix for
this in Intrepid or Jaunty. Did it get dropped?

Revision history for this message
Imre Gergely (cemc) wrote :

Maybe you mean this?

<snip>
havp (0.90-1ubuntu1) karmic; urgency=low

  * Merge from debian unstable (LP: #380342), remaining changes:
    - Under certain circumstances, the init script and/or postrm script
      will fail to umount loop-back devices. This issue has been addressed
      by performing a lazy umount in these two scripts.
</snip>

Revision history for this message
Scott Kitterman (kitterman) wrote : Re: [Bug 401048] Re: havp fails to (re)start because of mounted /var/spool/havp in Karmic

That's what I was thinking of.

Revision history for this message
Imre Gergely (cemc) wrote :

That's still there (the "-l" option to umount methinks), but this seems to be another problem, the umount part doesn't even get executed. I checked on Jaunty and the same thing happens, I'm not sure why "mount" shows /dev/loop0 instead of the filename that got mounted.

Attached a diff which greps for the mountpoint and not for the file that got mounted through loop. Tested and working.

Or is this a bad idea, umount'ing based on the mountpoint ?

Revision history for this message
Andres Rodriguez (andreserl) wrote :

Hi Imre,

I would like to know what test have you done in this that shows that the issue has been fixed. If you could provide the steps to reproduce this behavior I would really appreciate it, as well as show me what config you've done to reproduce it. Thanks.

Changed in havp (Ubuntu):
assignee: nobody → Andres E. Rodriguez Lazo (andreserl)
status: New → In Progress
Revision history for this message
Imre Gergely (cemc) wrote :

Well it's not fixed yet (Lucid has the same version as Karmic, and I've done the tests with 0.90-1).

Basically you just install havp, then you stop it and try to start it again. It won't start because /var/spool/havp is still mounted. It doesn't get unmounted at stop, because of the above problem in the initscript (IMHO).

It's with the default configuration, except I enabled clamav for antivirus scanning.

It goes something like this:

- install havp: apt-get install havp
- start it up (it does start after install):

root@utest-kk:~# /etc/init.d/havp start
Mounting /var/lib/havp/havp.loop under /var/spool/havp ...done
Cleaning up /var/spool/havp... done
Starting havp: Starting HAVP Version: 0.90
havp.

- check that the generated file is mounted through loop:

root@utest-kk:~# mount |grep havp
/dev/loop0 on /var/spool/havp type ext3 (rw,mand)

- stop havp and check that the file is STILL mounted:

root@utest-kk:~# /etc/init.d/havp stop
Stopping havp: havp.
Cleaning up /var/spool/havp... done
root@utest-kk:~# mount |grep havp
/dev/loop0 on /var/spool/havp type ext3 (rw,mand)

- try to start it, it won't start:

root@utest-kk:~# /etc/init.d/havp start
Mounting /var/lib/havp/havp.loop under /var/spool/havp ...mount: according to mtab /var/lib/havp/havp.loop is already mounted on /var/spool/havp as loop

The above patch should take care of umount'ing the loopback.

Changed in havp (Debian):
status: Unknown → New
Changed in havp (Ubuntu):
importance: Undecided → Wishlist
Revision history for this message
Andres Rodriguez (andreserl) wrote :

Imre,

I tested and I can confirm the behavior and confirm the fix. Any work in Debian about this? Could you please ping me on IRC when you are online. :)

Thanks

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package havp - 0.91-1.1ubuntu1

---------------
havp (0.91-1.1ubuntu1) lucid; urgency=low

  * Merge from debian testing (LP: #487776), remaining changes:
    - Under certain circumstances, the init script and/or postrm script
      will fail to umount loop-back devices. This issue has been addressed
      by performing a lazy umount in these two scripts.
  * debian/havp.init: Fixes "Fails to restart because of mounted
    '/var/spool/havp'" Thanks to Imre Gergely for the fix. (LP: #401048)
  * 05_include_libraries.dpatch: Dropped. Fixed in upstream.

havp (0.91-1.1) unstable; urgency=low

  * Non-maintainer upload.
  * Fix FTBFS on GNU/kFreeBSD (Closes: #557109): pass --disable-locking
    when DEB_HOST_ARCH_OS equals kfreebsd.
  * Include Japanese po-debconf template translation, thanks to Hideki
    Yamane (Closes: #558052).

havp (0.91-1) unstable; urgency=low

  * New upstream release. This should fix a potential DNS lookup segfault.

havp (0.90-2) unstable; urgency=low

  * Change default configuration to let havp listen only on localhost so
    as not to create an open relay. The config file now has
    BIND_ADDRESS 127.0.0.1 by default.
 -- Andres Rodriguez <email address hidden> Wed, 10 Feb 2010 15:46:22 -0500

Changed in havp (Ubuntu):
status: In Progress → Fix Released
Changed in havp (Debian):
status: New → Fix Released
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.