Changeset 11243
- Timestamp:
- 08/21/08 17:30:28 (5 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
branches/remote-services/ebox/src/libexec/ebox-runnerd
r11240 r11243 62 62 POSIX::close($_) foreach (0 .. 64); 63 63 64 open( STDIN, ' /dev/null');65 open( STDOUT, ' /dev/null');66 open( STDERR, ' /dev/null');64 open( STDIN, '<', '/dev/null'); 65 open( STDOUT, '+>', '/dev/null'); 66 open( STDERR, '+>', '/dev/null'); 67 67 68 68 } … … 138 138 my $incomingSub = sub { 139 139 my ($event) = @_; 140 EBox::debug("New stuff: $event->{name}");141 EBox::debug("$event->{w}{name}");142 _run($event->{w}{name} . $event->name());140 if (defined($event) and $event->IN_CREATE) { 141 _run($event->{w}{name} . $event->name()); 142 } 143 143 }; 144 144 … … 146 146 or throw EBox::Exceptions::External("Unable to create a new inotify object: $!"); 147 147 148 $inotify->watch(INCOMING_DIR, IN_CREATE, $incomingSub); 149 $inotify->watch(INCOMING_DIR, IN_DELETE_SELF, sub {}); 148 $inotify->watch(INCOMING_DIR, IN_CREATE|IN_DELETE_SELF, $incomingSub); 150 149 # Run those directories which have not run previously 151 150 _runRemainder(); … … 159 158 if ( $evt->IN_DELETE_SELF ) { 160 159 EBox::warn(INCOMING_DIR . " has been deleted! Stopping daemon..."); 161 exit( 0);160 exit(1); 162 161 } 163 $evt->{w}{cb}; 162 # Run the watcher callback 163 $evt->{w}{cb}(); 164 164 } 165 165 }
