start()
{
-# if test -z "$GLITE_USER" ;then
-# echo 'Error: GLITE_USER is not set'
-# echo FAILED
-# return 1
-# fi
-
- [ -n "$GLITE_HOST_CERT" -a -n "$GLITE_HOST_KEY" ] &&
- creds="-c $GLITE_HOST_CERT -k $GLITE_HOST_KEY"
-
- if test -z "$creds"; then
- if su - $GLITE_USER -c "test -r /etc/grid-security/hostkey.pem -a -r /etc/grid-security/hostcert.pem"; then
- echo "$0: WARNING: /etc/grid-security/hostkey.pem readable by $GLITE_USER"
- creds="-c /etc/grid-security/hostcert.pem -k /etc/grid-security/hostkey.pem"
- fi
- fi
-
-# not used for now
-# [ -z "$creds" ] && echo $0: WARNING: No credentials specified. Using default lookup which is dangerous. >&2
-
echo -n Starting glite-jp-indexd ...
-# su - $GLITE_USER -c
-"$GLITE_LOCATION/bin/glite-jp-indexd \
- " && echo " done" || echo " FAILED"
-# $creds -i $pidfile $port"
+ $GLITE_LOCATION/bin/glite-jp-indexd > $GLITE_LOCATION_VAR/log/glite-jp-index.log 2>&1 &
+ echo " done"
}
stop()
#include <stdlib.h>
#include <string.h>
+#include <stdio.h>
#include <glite/jp/types.h>
#include <glite/jp/context.h>
int glite_jp_get_conf(int argc, char **argv, char *config_file, glite_jp_is_conf **configuration)
{
+ char *ps = NULL;
+
// read comman line options and configuration file
// XXX: use EGEE global configure tools in future...
conf = calloc(1, sizeof(*conf));
-
+
+ // configuration from environment
+ conf->cs = getenv("GLITE_JPIS_DB");
+ conf->port = getenv("GLITE_JPIS_PORT");
+
// prefixes & attributes defined in:
// lb.server/build/jp_job_attrs.h (created when build plugin)
// jp.common/interfaces/known_attr.h
// XXX: some plugin names should come here in future
conf->plugins = NULL;
+// ps = "http://umbar.ics.muni.cz:8901";
+ if (!ps && ((ps = getenv("GLITE_JPIS_PS")) == NULL)) {
+ printf("No JP PrimaryStrorage server specified in $GLITE_JPIS_PS, default feeds skipped.\n");
+ conf->feeds = calloc(1, sizeof(*(conf->feeds)));
+ *configuration = conf;
+ return 0;
+ }
/* ask for one feed */
conf->feeds = calloc(2, sizeof(*(conf->feeds)));
conf->feeds[0] = calloc(1, sizeof(**(conf->feeds)));
-// conf->feeds[0]->PS_URL = strdup("http://umbar.ics.muni.cz:8901");
- conf->feeds[0]->PS_URL = strdup("http://localhost:8901");
+ conf->feeds[0]->PS_URL = strdup(ps);
// all job since Epoche
conf->feeds[0]->query = calloc(2,sizeof(*conf->feeds[0]->query));
conf->feeds[1] = NULL;
- conf->cs = getenv("GLITE_JPIS_DB");
- conf->port = getenv("GLITE_JPIS_PORT");
-
*configuration = conf;
return 0;