/*
* ion/utils/ion-statusd/ion-statusd.c
*
- * Copyright (c) Tuomo Valkonen 2004-2006.
+ * Copyright (c) Tuomo Valkonen 2004-2009.
*
- * Ion is free software; you can redistribute it and/or modify it under
- * the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
+ * See the included file LICENSE for details.
*/
#include <string.h>
#include <libtu/errorlog.h>
#include <libtu/locale.h>
#include <libtu/misc.h>
+#include <libtu/prefix.h>
#include <libextl/readconfig.h>
#include <libmainloop/select.h>
#include <libmainloop/signal.h>
static const char statusd_copy[]=
- "Ion-statusd " ION_VERSION ", copyright (c) Tuomo Valkonen 2004-2005.";
+ "Ion-statusd " ION_VERSION ", copyright (c) Tuomo Valkonen 2004-2009.";
static const char statusd_license[]=DUMMY_TR(
- "This program is free software; you can redistribute it and/or\n"
- "modify it under the terms of the GNU Lesser General Public\n"
- "License as published by the Free Software Foundation; either\n"
- "version 2.1 of the License, or (at your option) any later version.\n"
+ "This software is licensed under the GNU Lesser General Public License\n"
+ "(LGPL), version 2.1, extended with terms applying to the use of the name\n"
+ "of the project, Ion(tm), unless otherwise indicated in components taken\n"
+ "from elsewhere. For details, see the file LICENSE that you should have\n"
+ "received with this software.\n"
"\n"
"This program is distributed in the hope that it will be useful,\n"
"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
- "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n"
- "Lesser General Public License for more details.\n");
+ "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n");
/* new_informs=TRUE because we should always print period when
configtab=extl_table_none();
libtu_init(argv[0]);
- extl_init();
+#ifdef CF_RELOCATABLE_BIN_LOCATION
+ prefix_set(argv[0], CF_RELOCATABLE_BIN_LOCATION);
+#endif
+
+ extl_init();
+
if(!statusd_register_exports())
return EXIT_FAILURE;
- extl_add_searchdir(EXTRABINDIR);
- extl_add_searchdir(MODULEDIR);
- extl_add_searchdir(ETCDIR);
- extl_add_searchdir(SHAREDIR);
- extl_add_searchdir(LCDIR);
+ prefix_wrap_simple(extl_add_searchdir, EXTRABINDIR);
+ prefix_wrap_simple(extl_add_searchdir, MODULEDIR);
+ prefix_wrap_simple(extl_add_searchdir, ETCDIR);
+ prefix_wrap_simple(extl_add_searchdir, SHAREDIR);
+ prefix_wrap_simple(extl_add_searchdir, LCDIR);
extl_set_userdirs("ion3");
optparser_init(argc, argv, OPTP_MIDLONG, ion_opts);
ExtlTab statusd_getloadavg()
{
ExtlTab t=extl_create_table();
+#ifndef CF_NO_GETLOADAVG
double l[3];
int n;
extl_table_sets_d(t, "5min", l[1]);
if(n>=3)
extl_table_sets_d(t, "15min", l[2]);
-
+#endif
return t;
}