Changeset 6d736fb


Ignore:
Timestamp:
03/06/14 11:35:20 (5 months ago)
Author:
Kris Moore <kris@…>
Branches:
master, releng/10.0.1, releng/10.0.2
Children:
69b2305
Parents:
27b31a3
Message:

Add a nullfs backed "socket" passthrough layer to pbifs, this allows sockets in
/var/run to be available to PBIs, same as in /tmp

This fixes bugs with CUPS not being able to work in PBIs

Location:
src-sh/pbi-manager
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src-sh/pbi-manager/pbifs/main.c

    rb2efbe3 r6d736fb  
    121121        // First, lets look for calls to /var/run/ld-elf*.so.hints 
    122122        // These need to be replaced with calls to our new hints file in hintsdir 
    123         if ( strpos(rPath, "/var/run/") == 0 ) 
     123        if ( strpos(rPath, "/var/run") == 0 ) 
    124124        { 
    125125                if ( strcmp(rPath, "/var/run/ld-elf.so.hints") == 0 ) 
     
    135135                        return 0; 
    136136                } 
     137 
     138                // Check for requests to socket files 
     139                if ( strpos(rPath, ".sock") != -1 ) 
     140                { 
     141                        // Return the "nullfs-mounted" /var/run 
     142                        strcpy(npath, replace_str(rPath, "/var/run", "/usr/pbi/varrun")); 
     143                        return 0; 
     144                } 
     145                // Check for requests to socket files 
     146                if ( strpos(rPath, "socket") != -1 ) 
     147                { 
     148                        // Return the "nullfs-mounted" /var/run 
     149                        strcpy(npath, replace_str(rPath, "/var/run", "/usr/pbi/varrun")); 
     150                        return 0; 
     151                } 
     152 
    137153        } 
    138154 
  • src-sh/pbi-manager/pbime/pbimount

    rb6a6398 r6d736fb  
    6969   is_mounted "${pDir}/virtbase/tmp" || mount_nullfs /tmp "${pDir}/virtbase/tmp" 
    7070 
     71   # Mount our real system /var/run with nullfs, so that sockets are available which tend 
     72   # to exist there 
     73   if [ ! -d "/usr/pbi/varrun" ] ; then 
     74      mkdir /usr/pbi/varrun 
     75   fi 
     76   is_mounted "${pDir}/virtbase/usr/pbi/varrun" || mount_nullfs /var/run "${pDir}/virtbase/usr/pbi/varrun" 
     77 
    7178   if [ -d "${pDir}/virtbase/compat/linux/proc" ] ; then 
    7279     is_mounted "${pDir}/virtbase/compat/linux/proc" || mount -t linprocfs linprocfs "${pDir}/virtbase/compat/linux/proc" 
Note: See TracChangeset for help on using the changeset viewer.