projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'collectd-5.4' into collectd-5.5
[collectd.git]
/
src
/
daemon
/
collectd.c
diff --git
a/src/daemon/collectd.c
b/src/daemon/collectd.c
index
9cba913
..
a708665
100644
(file)
--- a/
src/daemon/collectd.c
+++ b/
src/daemon/collectd.c
@@
-270,7
+270,7
@@
static void update_kstat (void)
*/
static void exit_usage (int status)
{
*/
static void exit_usage (int status)
{
- printf ("Usage: "PACKAGE" [OPTIONS]\n\n"
+ printf ("Usage: "PACKAGE
_NAME
" [OPTIONS]\n\n"
"Available options:\n"
" General:\n"
"Available options:\n"
" General:\n"
@@
-289,7
+289,7
@@
static void exit_usage (int status)
" PID file "PIDFILE"\n"
" Plugin directory "PLUGINDIR"\n"
" Data directory "PKGLOCALSTATEDIR"\n"
" PID file "PIDFILE"\n"
" Plugin directory "PLUGINDIR"\n"
" Data directory "PKGLOCALSTATEDIR"\n"
- "\n"PACKAGE
" "
VERSION", http://collectd.org/\n"
+ "\n"PACKAGE
_NAME" "PACKAGE_
VERSION", http://collectd.org/\n"
"by Florian octo Forster <octo@collectd.org>\n"
"for contributions see `AUTHORS'\n");
exit (status);
"by Florian octo Forster <octo@collectd.org>\n"
"for contributions see `AUTHORS'\n");
exit (status);
@@
-309,7
+309,7
@@
static int do_init (void)
#if HAVE_LIBSTATGRAB
if (sg_init (
#if HAVE_LIBSTATGRAB
if (sg_init (
-# if HAVE_LIBSTATGRAB_
INIT_ARG
+# if HAVE_LIBSTATGRAB_
0_90
0
# endif
))
0
# endif
))
@@
-414,6
+414,7
@@
static int pidfile_remove (void)
} /* static int pidfile_remove (const char *file) */
#endif /* COLLECT_DAEMON */
} /* static int pidfile_remove (const char *file) */
#endif /* COLLECT_DAEMON */
+#ifdef KERNEL_LINUX
int notify_upstart (void)
{
const char *upstart_job = getenv("UPSTART_JOB");
int notify_upstart (void)
{
const char *upstart_job = getenv("UPSTART_JOB");
@@
-479,6
+480,7
@@
int notify_systemd (void)
close(fd);
return 1;
}
close(fd);
return 1;
}
+#endif /* KERNEL_LINUX */
int main (int argc, char **argv)
{
int main (int argc, char **argv)
{
@@
-598,9
+600,13
@@
int main (int argc, char **argv)
/*
* Only daemonize if we're not being supervised
/*
* Only daemonize if we're not being supervised
- * by upstart or systemd.
+ * by upstart or systemd
(when using Linux)
.
*/
*/
- if (daemonize && notify_upstart() == 0 && notify_systemd() == 0)
+ if (daemonize
+#ifdef KERNEL_LINUX
+ && notify_upstart() == 0 && notify_systemd() == 0
+#endif
+ )
{
if ((pid = fork ()) == -1)
{
{
if ((pid = fork ()) == -1)
{