Project

General

Profile

Anomalie #2109

Monter /proc dans le conteneur durant gen_conteneurs

Added by Emmanuel GARETTE (2) about 11 years ago. Updated almost 11 years ago.

Status:
Fermé
Priority:
Normal
Assigned To:
-
Category:
-
Start date:
09/26/2011
Due date:
% Done:

100%

Spent time:
Distribution:
EOLE 2.3

Description

Certains paquets ont besoins de /proc pour s'installer.

--- cfgparser.py    2011-09-26 16:40:06.375479464 +0200
+++ /usr/share/pyshared/creole/cfgparser.py    2011-09-26 18:14:13.955702749 +0200
@@ -750,6 +750,8 @@
                     fssh.write('    Hostname=%s\n\n'%ip)
                 self._write_hosts_d(cname, name, ip, 'host')
                 fstab = []
+                #ne demonte pas proc si pas monte
+                mount_proc = False
                 for package in value['packages']:
                     self.log.info('Installation de %s' % package)
                     if not is_installed(package, container=cname, context=False):
@@ -780,6 +782,13 @@
                                     if system_code(cmd) != 0:
                                         raise Exception("Erreur d'exécution de %s" % ' '.join(cmd))
                                 fstab.append(mount_point)
+                        #monte /proc dans le conteneur si nécessaire
+                        if not mount_proc: 
+                            cmd = ['chroot', chroot, 'mount', '-n', '-t', 'proc',
+                                        'proc', '/proc']
+                            if system_code(cmd) != 0:
+                                raise Exception("Erreur d'exécution de %s" % ' '.join(cmd))
+                            mount_proc = True
                         if not isfile(join(chroot, 'usr/sbin/invoke-rc.d.real')):
                             cmd = ['chroot', chroot, 'dpkg-divert',
                                    '--rename', '--divert',
@@ -843,6 +852,10 @@
                     cmd = ['umount', mount_point]
                     if system_code(cmd) != 0:
                         raise Exception("Erreur d'exécution de %s" % ' '.join(cmd))
+                #demonte /proc dans le conteneur
+                if mount_proc:
+                    system_code(['chroot', chroot, 'umount', '-n', '/proc'])
+                
         if tcreate_containers_file:
             fcontainers = file(config.containers_file, 'a+')
             fcontainers.write('container_path_root=""\n')

Associated revisions

Revision 0c589cb9 (diff)
Added by Joël Cuissinat about 11 years ago

creole/cfgparser.py : application du patch "Monter /proc dans le conteneur durant gen_conteneurs" (fixes #2109)

History

#1 Updated by Joël Cuissinat about 11 years ago

  • Target version set to Mises à jour 2.3 - 02 RC

#2 Updated by Joël Cuissinat about 11 years ago

  • Status changed from Nouveau to Résolu
  • % Done changed from 0 to 100

#3 Updated by Fabrice Barconnière almost 11 years ago

  • Status changed from Résolu to Fermé
  • Distribution set to EOLE 2.3

Also available in: Atom PDF