On Fri, Feb 08, 2013 at 04:32:38PM -0300, Hudson FAS wrote:
> I have a Synology USBSTATION2 (
> http://www.synology.com/products/spec.php?product_name=USB%20Station%202&lang=enu#p_submenu)
> running kernel Linux 2.6.32.11 without udev or /dev/fd.

OK, that is the issue. Any of these should fix it:

 - symlink /proc/self/fd to /dev/fd

 - install udev

 - apply the patch below

Let me know.

Mark


commit b179f6368d72801380dcb1df04c0f7a91d8e2643
Author: Mark Hindley <[email protected]>
Date:   Thu Feb 7 22:25:34 2013 +0000

    Possible fix: use /proc/self/fd directly rather than relying on /dev/fd
    symlink which can be missing.

diff --git a/apt-cacher-cleanup.pl b/apt-cacher-cleanup.pl
index 73d1938..cc4589f 100755
--- a/apt-cacher-cleanup.pl
+++ b/apt-cacher-cleanup.pl
@@ -395,7 +395,7 @@ sub pdiff {
     fcntl($tfh, F_SETFD, 0)
       or die "Can't clear close-on-exec flag on temp filehandle: $!\n";
     my $cwd = Cwd::cwd(); # Save
-    chdir '/dev/fd' or  die "Unable to change working directory: $!";
+    chdir '/proc/self/fd' or  die "Unable to change working directory: $!";
     open(my $patchpipe, '|-', "$patchprog ".fileno($tfh)) ||  die "Unable to 
open pipe for patch: $!";
     printmsg "Patching $name with $patchprog\n";
     print $patchpipe $diffs;
diff --git a/lib/apt-cacher.pl b/lib/apt-cacher.pl
index 2cb2434..4c4e9ef 100755
--- a/lib/apt-cacher.pl
+++ b/lib/apt-cacher.pl
@@ -375,7 +375,7 @@ sub fd_path {
     my ($fh) = @_;
 
     die 'Not a GLOB' unless ref $fh eq 'GLOB';
-    return '/dev/fd/' . $fh->fileno;
+    return '/proc/self/fd/' . $fh->fileno;
 }
 
 # Delete cached files by filehandle


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to