PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Serveur - Sécurité et techniques > linux.debian.user > /usr busy after aptitude operations?
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
linux.debian.user debian-user@lists.debian.org.

/usr busy after aptitude operations?

Réponse
 
LinkBack Outils de la discussion
Vieux 08/05/2008, 19h40   #1
Todd A. Jacobs
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut /usr busy after aptitude operations?


I have the following in /etc/apt/apt.conf:

Dpkg::Pre-Invoke {"/bin/mount -o remount,rw /usr";};
Dpkg::Post-Invoke {"/bin/mount -o remount,ro /usr";};

However, in many cases, running aptitude results in the following error:

mount: /usr is busy
E: Problem executing scripts DPkg::Post-Invoke '/bin/mount -o remount,ro /usr'
E: Sub-process returned an error code

I can't figure out why aptitude is leaving the partition in a state
where it can't be remounted ro, even after a significant amount of time
has passed or /bin/sync has been called.

Running "fuser -vm /usr" reveals that /usr/lib/iceweasel/firefox-bin is
being left open for writing (why???), but even after closing firefox and
seeing /usr/lib/iceweasel/firefox-bin disappear from the fuser output,
the problem remains the same.

How do I work around this issue, or at the very least find out why the
filesystem is being held open?

--
"Oh, look: rocks!"
-- Doctor Who, "Destiny of the Daleks"


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
  Réponse avec citation
Vieux 08/05/2008, 20h00   #2
n0bert0
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: /usr busy after aptitude operations?

Hi Todd,

/usr holds almost all active binaries (/usr/bin) and libraries
(/usr/kib), you will not be able to umount it.
First step of "remount" is a umount.

cheers

Todd A. Jacobs wrote:
> I have the following in /etc/apt/apt.conf:
>
> Dpkg::Pre-Invoke {"/bin/mount -o remount,rw /usr";};
> Dpkg::Post-Invoke {"/bin/mount -o remount,ro /usr";};
>
> However, in many cases, running aptitude results in the following error:
>
> mount: /usr is busy
> E: Problem executing scripts DPkg::Post-Invoke '/bin/mount -o remount,ro /usr'
> E: Sub-process returned an error code
>
> I can't figure out why aptitude is leaving the partition in a state
> where it can't be remounted ro, even after a significant amount of time
> has passed or /bin/sync has been called.
>
> Running "fuser -vm /usr" reveals that /usr/lib/iceweasel/firefox-bin is
> being left open for writing (why???), but even after closing firefox and
> seeing /usr/lib/iceweasel/firefox-bin disappear from the fuser output,
> the problem remains the same.
>
> How do I work around this issue, or at the very least find out why the
> filesystem is being held open?
>
>



--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
  Réponse avec citation
Vieux 08/05/2008, 20h00   #3
Sven Joachim
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: /usr busy after aptitude operations?

On 2008-05-08 19:36 +0200, Todd A. Jacobs wrote:

> I have the following in /etc/apt/apt.conf:
>
> Dpkg::Pre-Invoke {"/bin/mount -o remount,rw /usr";};
> Dpkg::Post-Invoke {"/bin/mount -o remount,ro /usr";};
>
> However, in many cases, running aptitude results in the following error:
>
> mount: /usr is busy
> E: Problem executing scripts DPkg::Post-Invoke '/bin/mount -o remount,ro /usr'
> E: Sub-process returned an error code
>
> I can't figure out why aptitude is leaving the partition in a state
> where it can't be remounted ro, even after a significant amount of time
> has passed or /bin/sync has been called.


Probably the problem is that many files which have been upgraded are
still open (binaries and libraries). If the system were to remount /usr
read-only, their inodes could not be freed any more, resulting in file
system corruption.

> Running "fuser -vm /usr" reveals that /usr/lib/iceweasel/firefox-bin is
> being left open for writing (why???), but even after closing firefox and
> seeing /usr/lib/iceweasel/firefox-bin disappear from the fuser output,
> the problem remains the same.


Maybe lsof would be more informative, but that spits out rather many
files; fuser does not list libraries.

> How do I work around this issue, or at the very least find out why the
> filesystem is being held open?


Closing down X could be of great , but I guess that is not quite
what you want to hear. Maybe someone else has a better idea.

Sven


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
  Réponse avec citation
Vieux 08/05/2008, 20h10   #4
Sven Joachim
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: /usr busy after aptitude operations?

On 2008-05-08 20:45 +0200, n0bert0 wrote:

> Hi Todd,
>
> /usr holds almost all active binaries (/usr/bin) and libraries
> (/usr/kib), you will not be able to umount it.
> First step of "remount" is a umount.


No, where did you get that idea? Please read mount(2).

Sven


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
  Réponse avec citation
Vieux 08/05/2008, 21h40   #5
Peter Jordan
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: /usr busy after aptitude operations?

Todd A. Jacobs, 05/08/2008 07:36 PM:

> I have the following in /etc/apt/apt.conf:
>
> Dpkg::Pre-Invoke {"/bin/mount -o remount,rw /usr";};
> Dpkg::Post-Invoke {"/bin/mount -o remount,ro /usr";};


Why?


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
  Réponse avec citation
Vieux 10/05/2008, 08h30   #6
Todd A. Jacobs
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: /usr busy after aptitude operations?

On Thu, May 08, 2008 at 10:26:54PM +0200, Peter Jordan wrote:

> > Dpkg::Pre-Invoke {"/bin/mount -o remount,rw /usr";};
> > Dpkg::Post-Invoke {"/bin/mount -o remount,ro /usr";};


> Why?


Because /usr has no business being mounted rw most of the time. You only
need to write to /usr during a package upgrade.

Even with a journaling filesystem, there are plenty of ways that a
sudden shutdown can hose your system. In addition, you get an admittedly
small boost in security by not having the filesystem writable without
root taking explicit steps.

Actually, it doesn't really matter why. It should work, and it doesn't.
That's the point.

--
"Oh, look: rocks!"
-- Doctor Who, "Destiny of the Daleks"


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
  Réponse avec citation
Vieux 10/05/2008, 08h40   #7
Todd A. Jacobs
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: /usr busy after aptitude operations?

On Thu, May 08, 2008 at 08:50:53PM +0200, Sven Joachim wrote:

> Probably the problem is that many files which have been upgraded are
> still open (binaries and libraries). If the system were to remount


I know that dpkg takes steps to unlink files without actually deleting
them during an upgrade, so your suggestion makes some sense, but I'm not
quite sure why the system would need to keep inodes open for writing
after that. It still seems somewhat bug-like to me.

Shutting down X, or switching to runlevel 1, really doesn't make the
process transparent. I really might as well reboot if that's the case,
but that also defeats a great deal of the purpose of being able to
upgrade a live system.

--
"Oh, look: rocks!"
-- Doctor Who, "Destiny of the Daleks"


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
  Réponse avec citation
Vieux 10/05/2008, 09h10   #8
Sven Joachim
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: /usr busy after aptitude operations?

On 2008-05-10 09:18 +0200, Todd A. Jacobs wrote:

> I know that dpkg takes steps to unlink files without actually deleting
> them during an upgrade, so your suggestion makes some sense, but I'm not
> quite sure why the system would need to keep inodes open for writing
> after that. It still seems somewhat bug-like to me.


The filesystem has to be written to after the inodes are freed, i.e. the
offending process that kept them open has exited. You would end up with
inodes that have a link count of 0, i.e. lost space on the device, if
the system would not do that.

> Shutting down X, or switching to runlevel 1, really doesn't make the
> process transparent. I really might as well reboot if that's the case,
> but that also defeats a great deal of the purpose of being able to
> upgrade a live system.


True, but I don't have a better suggestion; maybe someone else has.

Sven


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 16h56.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,22107 seconds with 16 queries