Changeset 11240
- Timestamp:
- 08/19/08 15:55:59 (5 months ago)
- Location:
- branches/remote-services/ebox/src
- Files:
-
- 2 modified
-
EBox/RemoteServices.pm (modified) (4 diffs)
-
libexec/ebox-runnerd (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/remote-services/ebox/src/EBox/RemoteServices.pm
r11237 r11240 35 35 use EBox::Gettext; 36 36 use EBox::Global; 37 use EBox::Service; 37 38 use EBox::Sudo; 38 39 39 40 # Constants 40 use constant SERV_DIR => EBox::Config::conf() . 'remoteservices/'; 41 use constant CA_DIR => SERV_DIR . 'ssl-ca/'; 42 use constant SUBS_DIR => SERV_DIR . 'subscription/'; 43 use constant WS_DISPATCHER => __PACKAGE__ . '::WSDispatcher'; 41 use constant SERV_DIR => EBox::Config::conf() . 'remoteservices/'; 42 use constant CA_DIR => SERV_DIR . 'ssl-ca/'; 43 use constant SUBS_DIR => SERV_DIR . 'subscription/'; 44 use constant WS_DISPATCHER => __PACKAGE__ . '::WSDispatcher'; 45 use constant RUNNERD_SERVICE => 'ebox.runnerd'; 44 46 45 47 # Group: Protected methods … … 99 101 100 102 $self->_confSOAPService(); 103 $self->_doDaemon(); 101 104 102 105 return; … … 112 115 sub _stopService 113 116 { 114 117 my ($self) = @_; 118 119 EBox::Service::manage(RUNNERD_SERVICE, 'stop'); 115 120 } 116 121 … … 267 272 } 268 273 274 # Start/stop/restart runnerd daemon 275 sub _doDaemon 276 { 277 my ($self) = @_; 278 279 if ( $self->eBoxSubscribed() ) { 280 if ( EBox::Service::running(RUNNERD_SERVICE) ) { 281 EBox::Service::manage(RUNNERD_SERVICE, 'restart'); 282 } else { 283 EBox::Service::manage(RUNNERD_SERVICE, 'start'); 284 } 285 } else { 286 EBox::Service::manage(RUNNERD_SERVICE, 'stop'); 287 } 288 } 289 269 290 # Return the allowed prefix to send jobs 270 291 sub _allowedPrefix -
branches/remote-services/ebox/src/libexec/ebox-runnerd
r11239 r11240 7 7 use Linux::Inotify2; 8 8 use POSIX qw(SIG_IGN SIGHUP); 9 use Pod::Usage; 9 10 10 11 use constant JOBS_DIR => EBox::Config::conf() . 'remoteservices/jobs/'; … … 122 123 123 124 # Get arguments 124 my ($foreground) = (0); 125 my $result = GetOptions( 'foreground' => \$foreground ); 125 my ($usage, $foreground) = (0, 0); 126 my $correct = GetOptions( 127 'foreground' => \$foreground, 128 'usage|help' => \$usage 129 ); 130 131 if ( $usage or (not $correct)) { 132 pod2usage(1); 133 } 126 134 127 135 EBox::init(); … … 158 166 159 167 1; 168 169 __END__ 170 171 =head1 NAME 172 173 ebox-runnerd - Daemon intended to run scripts which is placed under a 174 fixed directory which is watched by the daemon 175 176 =head1 SYNOPSIS 177 178 ebox-runnerd [--usage|help] [--foreground] 179 180 Options: 181 --foreground Flag to indicate if daemon must be launched in foreground 182 Default value: false 183 --usage|help Print this help and exit 184 185 =cut
