Last change
on this file was 22, checked in by gegorbet, 9 years ago |
fix us3 baseon listen.php and status_ex=EXECUTING handling in gridctl.php
|
File size:
738 bytes
|
Rev | Line | |
---|
[1] | 1 | <?php
|
---|
| 2 |
|
---|
[18] | 3 | $us3bin = exec( "ls -d ~us3/lims/bin" );
|
---|
[22] | 4 | $us3etc = exec( "ls -d ~us3/lims/etc" );
|
---|
[9] | 5 | include "$us3bin/listen-config.php";
|
---|
[1] | 6 |
|
---|
| 7 | $socket = socket_create( AF_INET, SOCK_DGRAM, SOL_UDP );
|
---|
| 8 |
|
---|
| 9 | // Listen on all interfaces
|
---|
| 10 | if ( ! socket_bind( $socket, 0, $listen_port ) )
|
---|
| 11 | {
|
---|
| 12 | $msg = "listen bind failed: " . socket_strerror( socket_last_error( $socket ) );
|
---|
| 13 | write_log( "$self: $msg" );
|
---|
| 14 | exit();
|
---|
| 15 | };
|
---|
| 16 |
|
---|
| 17 | $handle = fopen( $pipe, "r+" );
|
---|
| 18 |
|
---|
| 19 | $php = "/usr/bin/php";
|
---|
| 20 |
|
---|
[22] | 21 | $cmd = "/usr/bin/nohup $php $us3bin/manage-us3-pipe.php >>$us3etc/manage.log 2>&1 </dev/null &";
|
---|
[1] | 22 |
|
---|
| 23 | exec( $cmd );
|
---|
| 24 |
|
---|
| 25 | do
|
---|
| 26 | {
|
---|
| 27 | socket_recvfrom( $socket, $buf, 200, 0, $from, $port );
|
---|
| 28 | fwrite( $handle, $buf . chr( 0 ) );
|
---|
| 29 |
|
---|
| 30 | } while ( trim( $buf ) != "Stop listen" );
|
---|
| 31 |
|
---|
| 32 | socket_close( $socket );
|
---|
| 33 | ?>
|
---|
Note:
See
TracBrowser
for help on using the repository browser.