projects
/
id3fs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e8f49e1
)
id3fsd: drop terminal unless verbose
author
Ian Beckwith
<ianb@erislabs.net>
Tue, 19 Oct 2010 14:30:30 +0000
(15:30 +0100)
committer
Ian Beckwith
<ianb@erislabs.net>
Tue, 19 Oct 2010 14:33:22 +0000
(15:33 +0100)
sbin/id3fsd
patch
|
blob
|
history
diff --git
a/sbin/id3fsd
b/sbin/id3fsd
index
0809985
..
f55d0c1
100755
(executable)
--- a/
sbin/id3fsd
+++ b/
sbin/id3fsd
@@
-21,6
+21,8
@@
use strict;
use Getopt::Long qw(Configure);
use ID3FS::DB;
use ID3FS::Fuse;
use Getopt::Long qw(Configure);
use ID3FS::DB;
use ID3FS::Fuse;
+use POSIX;
+
use vars qw($me);
$me=($0=~/(?:.*\/)?(.*)/)[0];
use vars qw($me);
$me=($0=~/(?:.*\/)?(.*)/)[0];
@@
-48,6
+50,22
@@
my $db=ID3FS::DB->new($me, $verbose, 0, $source, $dbpath);
exit unless($db);
my $fuse=ID3FS::Fuse->new($db, $source, $mountpoint, $verbose, $tagdepth);
exit unless($db);
my $fuse=ID3FS::Fuse->new($db, $source, $mountpoint, $verbose, $tagdepth);
+
+# disassociate from terminal
+unless($verbose)
+{
+ my $pid=fork();
+ if(defined($pid))
+ {
+ exit if($pid); # parent
+ POSIX::setsid(); # child
+ }
+ else
+ {
+ print "$me: couldn't drop terminal: $!\n";
+ }
+}
+
$fuse->run();
sub usage
$fuse->run();
sub usage