FPM doesnt handle linux FIFO named pipes #347

Closed
Finchster opened this Issue Jan 20, 2013 · 2 comments

Comments

Projects
None yet
3 participants

Linking {:file=>"fpm/package/dir.rb", :destination=>"/tmp/package-dir-staging20130120-2901-jngbb6/dir1/dir2/dir3/pipe", :method=>"copy", :line=>"113", :source=>"/dir1/dir2/dir3/pipe", "method"=>"input", :level=>:debug}
Copying {:file=>"fpm/package/dir.rb", :destination=>"/tmp/package-dir-staging20130120-2901-jngbb6/dir1/dir2/dir3/pipe", :method=>"copy", :line=>"117", :source=>"/dir1/dir2/dir3/pipe", "method"=>"input", :level=>:debug}
/usr/lib64/ruby/1.8/fileutils.rb:1257:in copy': cannot handle FIFO (RuntimeError) from /usr/lib64/ruby/1.8/fileutils.rb:452:incopy_entry'
from /usr/lib64/ruby/1.8/fileutils.rb:1331:in traverse' from /usr/lib64/ruby/1.8/fileutils.rb:449:incopy_entry'
from /usr/lib64/ruby/gems/1.8/gems/fpm-0.4.27/lib/fpm/package/dir.rb:118:in copy' from /usr/lib64/ruby/gems/1.8/gems/fpm-0.4.27/lib/fpm/package/dir.rb:81:inclone'
from /usr/lib64/ruby/1.8/find.rb:39:in find' from /usr/lib64/ruby/1.8/find.rb:38:incatch'
from /usr/lib64/ruby/1.8/find.rb:38:in find' from /usr/lib64/ruby/gems/1.8/gems/fpm-0.4.27/lib/fpm/package/dir.rb:79:inclone'
from /usr/lib64/ruby/gems/1.8/gems/fpm-0.4.27/lib/fpm/package/dir.rb:36:in input' from /usr/lib64/ruby/gems/1.8/gems/fpm-0.4.27/lib/fpm/package/dir.rb:32:inchdir'
from /usr/lib64/ruby/gems/1.8/gems/fpm-0.4.27/lib/fpm/package/dir.rb:32:in input' from /usr/lib64/ruby/gems/1.8/gems/fpm-0.4.27/lib/fpm/command.rb:316:inexecute'
from /usr/lib64/ruby/gems/1.8/gems/fpm-0.4.27/lib/fpm/command.rb:315:in each' from /usr/lib64/ruby/gems/1.8/gems/fpm-0.4.27/lib/fpm/command.rb:315:inexecute'
from /usr/lib64/ruby/gems/1.8/gems/clamp-0.3.1/lib/clamp/command.rb:64:in run' from /usr/lib64/ruby/gems/1.8/gems/clamp-0.3.1/lib/clamp/command.rb:126:inrun'
from /usr/lib64/ruby/gems/1.8/gems/fpm-0.4.27/bin/fpm:8
from /usr/bin/fpm:19:in `load'
from /usr/bin/fpm:19

server:~ # ls -l /dir1/dir2/dir3/pipe
prw-rw-r-- 1 user owner 0 Nov 7 16:51 /dir1/dir2/dir3/pipe

Excluding all files in the directory does not work and produces the same error:

"--exclude /dir1/dir2/dir3/*"

Experiencing the same issue. See output here: https://gist.github.com/rvavruch/5759433

Also tried excluding the file but it seems all the files get copied first and then excluded.

I don't need the socket file it is breaking on, so I hacked the following solution to get it to skip the socket file, from /lib/fpm/package/dir.rb:89

def copy(source, destination)
    if File.socket?(source)
        return
    end

This may not be a solution for everyone, but it solves it for me.

Collaborator

r4um commented Aug 1, 2013

There is no portable inbuilt way to create/handle named pipes in ruby. Options

  1. Call mkfifo if available
  2. Make a FFI call to mkfifo

There is a mkfifo gem but its a C extension :(.

jordansissel closed this in #511 Aug 1, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment