/var/run/aide/ missing

Bug #114730 reported by Thomas Templin
30
Affects Status Importance Assigned to Milestone
aide (Debian)
Fix Released
Unknown
aide (Ubuntu)
Fix Released
Undecided
Unassigned
Hardy
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: aide

aide Version 0.13.1-5 , ubuntu 7.10 (gutsy)

Daily AIDE Report says:
---8<----
premature termination - Daily AIDE report for $HOSTNAME
The cron job was terminated because lock /var/run/aide/cron.daily.lock could not be obtained.
---8<---

Creating /var/run/aide/ and changing ownership via:
 sudo mkdir /var/run/aide
 sudo chmod root:adm /var/run/aide

This only works untill the next reboot.
After a reboot the directory /var/run/aide is missing again.

TESTCASE
1. install aide
2. reboot system
3. manually invoke the aide cron job:
 $ sudo /etc/cron.daily/aide
if the cronjob aborts right away, then the test has failed.

Revision history for this message
Thomas Templin (coastgnu) wrote :

The problem is in /etc/cron.daily/aide after line 39
 TMPBASE="/var/run/aide"
add:
       if [ ! -d $TMPBASE ] ; then
               # TMPBASE does not exist, create it
               mkdir $TMPBASE;
       fi

Or patch it with the attached aide.patch

Revision history for this message
Martin Schaaf (mascha) wrote :

Setting of restrictive file permissions would be also a good thing.

Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

This has been fixed in 0.13.1

Thanks for your report and feel free to submit any new bug.

Changed in aide:
status: New → Fix Released
Revision history for this message
Audric Schiltknecht (audric-schiltknecht) wrote :

Hello,

I am running a server on Hardy, with the 0.13.1-8 version of Aide, and I still get this mail.

Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

Storm, this is strange because the directory /var/run/aide is created during install by the postinst script.

Can you check if /var/run/aide/ exists on your system ?

Revision history for this message
Audric Schiltknecht (audric-schiltknecht) wrote :

No, I have to create it, and if I reboot my computer, I have to do this again.

Furthemore, sometimes directory is deleted whereas I don't shutdown my computer :s

I may narrow that I have done an update from a Dapper system, with its version of Aide (I don't remember its version number).

Revision history for this message
Thomas Templin (coastgnu) wrote : Re: [Bug 114730] Re: /var/run/aide/ missing

Am Do, 17. Juli 2008 23:01:07 schrieb Jean-Baptiste Lallement:
> Storm, this is strange because the directory /var/run/aide is created
> during install by the postinst script.
>
> Can you check if /var/run/aide/ exists on your system ?

I added a test for the /var/run/aide directory to /etc/cron.daily/aide

---8<---
TMPBASE="/var/run/aide"
if [ ! -d $TMPBASE ] ; then
   # TMPBASE does not exist, create it
   mkdir $TMPBASE;
fi
LOCKFILE="$TMPBASE/cron.daily.lock"
---8<---

regards,
thomas

Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

I'm marking it back to confirmed because even if the /var/run/aide directory is created during install, there are cases where it doesn't exist anymore at run time. I haven't found how this could happen but the proposed patch is harmless.

Changed in aide:
status: Fix Released → Confirmed
Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

Here is the debdiff to fix this issue.

Revision history for this message
Steve Beattie (sbeattie) wrote :

@Jean-Baptiste: The reason /var/run/aide no longer exists after rebooting is that in 8.04, /var/run is mounted as a tmpfs filesystem and has no backing store on disk. It would be great if we could roll this fix into the SRU update for aide that includes bug 157858 as well.

Thanks!

Steve Beattie (sbeattie)
description: updated
Revision history for this message
Jamie Strandboge (jdstrand) wrote :

I briefly reviewed the debdiff and it seems that the script will hit 'cantcreatebase' if the directory does exist. Jean-Baptiste, can you comment/update the patch?

Revision history for this message
Steve Beattie (sbeattie) wrote :

On Mon, Sep 15, 2008 at 05:29:46PM -0000, Jamie Strandboge wrote:
> I briefly reviewed the debdiff and it seems that the script will hit
> 'cantcreatebase' if the directory does exist.

I thought that too, but then both experimentation and the mkdir(1)
manpage showed that mkdir -p won't return an error if the directory
already exists (it will for other problems, such as EPERM).

--
Steve Beattie
<email address hidden>
http://NxNW.org/~steve/

Revision history for this message
Jamie Strandboge (jdstrand) wrote :

So it does. Thanks Steve.

Good work Jean-Baptiste. I have just now uploaded this to Intrepid. Thanks!

Changed in aide:
status: Confirmed → Fix Committed
Revision history for this message
Jamie Strandboge (jdstrand) wrote :

Jean-Baptiste, can you also file a bug with Debian following https://wiki.ubuntu.com/Bugs/Upstream? This will benefit Debian users with a tmpfs /var/run, as well as minimize out delta. Thanks!

Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

I'm sorry not coming back earlier. I've been quite busy. I've reported it there http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=501848

Changed in aide:
status: Unknown → New
Revision history for this message
Martin Pitt (pitti) wrote :

Accepted into -proposed, please test and give feedback here. Please see https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Changed in aide:
status: New → Fix Committed
Revision history for this message
Martin Pitt (pitti) wrote :

According to Jamie's comment this is fixed in intrepid. Please reopen if not.

Changed in aide:
status: Fix Committed → Fix Released
Revision history for this message
Paul Elliott (omahn) wrote :

Successfully verified hardy-proposed:

0.13.1-8ubuntu1 in hardy-updates
No /var/run/aide/ is present after package installation and reboot.

0.13.1-8ubuntu3 in hardy-proposed
The /var/run/aide/ directory now exists following installation and the directory is successfully recreated by the cron.daily/aide job.

Revision history for this message
Steve Beattie (sbeattie) wrote :

The fix for this in aide 0.13.1-8ubuntu3 has now been released in hardy-updates; marking as closed as the changelog had a typo for the bugnumber so this bug wasn't automatically closed

Changed in aide:
status: Fix Committed → Fix Released
Changed in aide (Debian):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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