~ubuntu-branches/ubuntu/utopic/pacemaker/utopic-proposed

« back to all changes in this revision

Viewing changes to .pc/Fix-lrmd-Prevent-glib-timers-removed-more-than-once.patch/lib/services/services.c

  • Committer: Package Import Robot
  • Author(s): Rafael David Tinoco, James Page, Rafael David Tinoco
  • Date: 2014-12-18 10:14:38 UTC
  • Revision ID: package-import@ubuntu.com-20141218101438-4ui8lo8320kbxyn3
Tags: 1.1.10+git20130802-4ubuntu3.1
[ James Page ]
* d/control: Ensure that pacemaker binary package uses matched binary
  versions of pacemaker libraries, avoiding upgrade problems (LP: #1382842).

[ Rafael David Tinoco ]
* d/p/Fix-lrmd-Prevent-glib-timers-removed-more-than-once.patch:
  Prevent glib assert triggered by timers being removed from mainloop more
  than once, cherry picked from upstream VCS (LP: #1368737).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2010 Andrew Beekhof <andrew@beekhof.net>
 
3
 *
 
4
 * This program is free software; you can redistribute it and/or
 
5
 * modify it under the terms of the GNU General Public
 
6
 * License as published by the Free Software Foundation; either
 
7
 * version 2.1 of the License, or (at your option) any later version.
 
8
 *
 
9
 * This software is distributed in the hope that it will be useful,
 
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
12
 * General Public License for more details.
 
13
 *
 
14
 * You should have received a copy of the GNU General Public
 
15
 * License along with this library; if not, write to the Free Software
 
16
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
17
 */
 
18
 
 
19
#include <crm_internal.h>
 
20
 
 
21
#ifndef _GNU_SOURCE
 
22
#  define _GNU_SOURCE
 
23
#endif
 
24
 
 
25
#include <sys/types.h>
 
26
#include <sys/stat.h>
 
27
#include <stdio.h>
 
28
 
 
29
#include <errno.h>
 
30
#include <unistd.h>
 
31
#include <dirent.h>
 
32
#include <fcntl.h>
 
33
 
 
34
#include <crm/crm.h>
 
35
#include <crm/common/mainloop.h>
 
36
#include <crm/services.h>
 
37
#include <crm/msg_xml.h>
 
38
#include "services_private.h"
 
39
 
 
40
#if SUPPORT_UPSTART
 
41
#  include <upstart.h>
 
42
#endif
 
43
 
 
44
#if SUPPORT_SYSTEMD
 
45
#  include <systemd.h>
 
46
#endif
 
47
 
 
48
/* TODO: Develop a rollover strategy */
 
49
 
 
50
static int operations = 0;
 
51
GHashTable *recurring_actions = NULL;
 
52
 
 
53
svc_action_t *
 
54
services_action_create(const char *name, const char *action, int interval, int timeout)
 
55
{
 
56
    return resources_action_create(name, "lsb", NULL, name, action, interval, timeout, NULL);
 
57
}
 
58
 
 
59
svc_action_t *
 
60
resources_action_create(const char *name, const char *standard, const char *provider,
 
61
                        const char *agent, const char *action, int interval, int timeout,
 
62
                        GHashTable * params)
 
63
{
 
64
    svc_action_t *op = NULL;
 
65
 
 
66
    /*
 
67
     * Do some up front sanity checks before we go off and
 
68
     * build the svc_action_t instance.
 
69
     */
 
70
 
 
71
    if (crm_strlen_zero(name)) {
 
72
        crm_err("A service or resource action must have a name.");
 
73
        goto return_error;
 
74
    }
 
75
 
 
76
    if (crm_strlen_zero(standard)) {
 
77
        crm_err("A service action must have a valid standard.");
 
78
        goto return_error;
 
79
    }
 
80
 
 
81
    if (!strcasecmp(standard, "ocf") && crm_strlen_zero(provider)) {
 
82
        crm_err("An OCF resource action must have a provider.");
 
83
        goto return_error;
 
84
    }
 
85
 
 
86
    if (crm_strlen_zero(agent)) {
 
87
        crm_err("A service or resource action must have an agent.");
 
88
        goto return_error;
 
89
    }
 
90
 
 
91
    if (crm_strlen_zero(action)) {
 
92
        crm_err("A service or resource action must specify an action.");
 
93
        goto return_error;
 
94
    }
 
95
 
 
96
    if (safe_str_eq(action, "monitor")
 
97
        && (safe_str_eq(standard, "lsb") || safe_str_eq(standard, "service"))) {
 
98
        action = "status";
 
99
    }
 
100
 
 
101
    /*
 
102
     * Sanity checks passed, proceed!
 
103
     */
 
104
 
 
105
    op = calloc(1, sizeof(svc_action_t));
 
106
    op->opaque = calloc(1, sizeof(svc_action_private_t));
 
107
    op->rsc = strdup(name);
 
108
    op->action = strdup(action);
 
109
    op->interval = interval;
 
110
    op->timeout = timeout;
 
111
    op->standard = strdup(standard);
 
112
    op->agent = strdup(agent);
 
113
    op->sequence = ++operations;
 
114
    if (asprintf(&op->id, "%s_%s_%d", name, action, interval) == -1) {
 
115
        goto return_error;
 
116
    }
 
117
 
 
118
    if (strcasecmp(op->standard, "service") == 0) {
 
119
        /* Work it out and then fall into the if-else block below.
 
120
         * Priority is:
 
121
         * - lsb
 
122
         * - systemd
 
123
         * - upstart
 
124
         */
 
125
        int rc = 0;
 
126
        struct stat st;
 
127
        char *path = NULL;
 
128
 
 
129
#ifdef LSB_ROOT_DIR
 
130
        rc = asprintf(&path, "%s/%s", LSB_ROOT_DIR, op->agent);
 
131
        if (rc > 0 && stat(path, &st) == 0) {
 
132
            crm_debug("Found an lsb agent for %s/% the", op->rsc, op->agent);
 
133
            free(path);
 
134
            free(op->standard);
 
135
            op->standard = strdup("lsb");
 
136
            goto expanded;
 
137
        }
 
138
        free(path);
 
139
#endif
 
140
 
 
141
#if SUPPORT_SYSTEMD
 
142
        if (systemd_unit_exists(op->agent)) {
 
143
            crm_debug("Found a systemd agent for %s/%s", op->rsc, op->agent);
 
144
            free(op->standard);
 
145
            op->standard = strdup("systemd");
 
146
            goto expanded;
 
147
        }
 
148
#endif
 
149
 
 
150
#if SUPPORT_UPSTART
 
151
        if (upstart_job_exists(op->agent)) {
 
152
            crm_debug("Found an upstart agent for %s/%s", op->rsc, op->agent);
 
153
            free(op->standard);
 
154
            op->standard = strdup("upstart");
 
155
            goto expanded;
 
156
        }
 
157
#endif
 
158
 
 
159
        crm_info("Cannot determine the standard for %s (%s)", op->rsc, op->agent);
 
160
    }
 
161
 
 
162
  expanded:
 
163
    if (strcasecmp(op->standard, "ocf") == 0) {
 
164
        op->provider = strdup(provider);
 
165
        op->params = params;
 
166
        params = NULL;
 
167
 
 
168
        if (asprintf(&op->opaque->exec, "%s/resource.d/%s/%s", OCF_ROOT_DIR, provider, agent) == -1) {
 
169
            crm_err("Internal error: cannot create agent path");
 
170
            goto return_error;
 
171
        }
 
172
        op->opaque->args[0] = strdup(op->opaque->exec);
 
173
        op->opaque->args[1] = strdup(action);
 
174
 
 
175
    } else if (strcasecmp(op->standard, "lsb") == 0) {
 
176
        if (op->agent[0] == '/') {
 
177
            /* if given an absolute path, use that instead
 
178
             * of tacking on the LSB_ROOT_DIR path to the front */
 
179
            op->opaque->exec = strdup(op->agent);
 
180
        } else if (asprintf(&op->opaque->exec, "%s/%s", LSB_ROOT_DIR, op->agent) == -1) {
 
181
            crm_err("Internal error: cannot create agent path");
 
182
            goto return_error;
 
183
        }
 
184
        op->opaque->args[0] = strdup(op->opaque->exec);
 
185
        op->opaque->args[1] = strdup(op->action);
 
186
        op->opaque->args[2] = NULL;
 
187
 
 
188
#if SUPPORT_SYSTEMD
 
189
    } else if (strcasecmp(op->standard, "systemd") == 0) {
 
190
        op->opaque->exec = strdup("systemd-dbus");
 
191
#endif
 
192
#if SUPPORT_UPSTART
 
193
    } else if (strcasecmp(op->standard, "upstart") == 0) {
 
194
        op->opaque->exec = strdup("upstart-dbus");
 
195
#endif
 
196
    } else if (strcasecmp(op->standard, "service") == 0) {
 
197
        op->opaque->exec = strdup(SERVICE_SCRIPT);
 
198
        op->opaque->args[0] = strdup(SERVICE_SCRIPT);
 
199
        op->opaque->args[1] = strdup(agent);
 
200
        op->opaque->args[2] = strdup(action);
 
201
 
 
202
#if SUPPORT_NAGIOS
 
203
    } else if (strcasecmp(op->standard, "nagios") == 0) {
 
204
        int index = 0;
 
205
 
 
206
        if (op->agent[0] == '/') {
 
207
            /* if given an absolute path, use that instead
 
208
             * of tacking on the NAGIOS_PLUGIN_DIR path to the front */
 
209
            op->opaque->exec = strdup(op->agent);
 
210
 
 
211
        } else if (asprintf(&op->opaque->exec, "%s/%s", NAGIOS_PLUGIN_DIR, op->agent) == -1) {
 
212
            crm_err("Internal error: cannot create agent path");
 
213
            goto return_error;
 
214
        }
 
215
 
 
216
        op->opaque->args[0] = strdup(op->opaque->exec);
 
217
        index = 1;
 
218
 
 
219
        if (safe_str_eq(op->action, "monitor") && op->interval == 0) {
 
220
            /* Invoke --version for a nagios probe */
 
221
            op->opaque->args[index] = strdup("--version");
 
222
            index++;
 
223
 
 
224
        } else if (params) {
 
225
            GHashTableIter iter;
 
226
            char *key = NULL;
 
227
            char *value = NULL;
 
228
            static int args_size = sizeof(op->opaque->args) / sizeof(char *);
 
229
 
 
230
            g_hash_table_iter_init(&iter, params);
 
231
 
 
232
            while (g_hash_table_iter_next(&iter, (gpointer *) & key, (gpointer *) & value) &&
 
233
                   index <= args_size - 3) {
 
234
                int len = 3;
 
235
                char *long_opt = NULL;
 
236
 
 
237
                if (safe_str_eq(key, XML_ATTR_CRM_VERSION) || strstr(key, CRM_META "_")) {
 
238
                    continue;
 
239
                }
 
240
 
 
241
                len += strlen(key);
 
242
                long_opt = calloc(1, len);
 
243
                sprintf(long_opt, "--%s", key);
 
244
                long_opt[len - 1] = 0;
 
245
 
 
246
                op->opaque->args[index] = long_opt;
 
247
                op->opaque->args[index + 1] = strdup(value);
 
248
                index += 2;
 
249
            }
 
250
        }
 
251
        op->opaque->args[index] = NULL;
 
252
#endif
 
253
 
 
254
    } else {
 
255
        crm_err("Unknown resource standard: %s", op->standard);
 
256
        services_action_free(op);
 
257
        op = NULL;
 
258
    }
 
259
 
 
260
    if(params) {
 
261
        g_hash_table_destroy(params);
 
262
    }
 
263
    return op;
 
264
 
 
265
  return_error:
 
266
    if(params) {
 
267
        g_hash_table_destroy(params);
 
268
    }
 
269
    services_action_free(op);
 
270
 
 
271
    return NULL;
 
272
}
 
273
 
 
274
svc_action_t *
 
275
services_action_create_generic(const char *exec, const char *args[])
 
276
{
 
277
    svc_action_t *op;
 
278
    unsigned int cur_arg;
 
279
 
 
280
    op = calloc(1, sizeof(*op));
 
281
    op->opaque = calloc(1, sizeof(svc_action_private_t));
 
282
 
 
283
    op->opaque->exec = strdup(exec);
 
284
    op->opaque->args[0] = strdup(exec);
 
285
 
 
286
    for (cur_arg = 1; args && args[cur_arg - 1]; cur_arg++) {
 
287
        op->opaque->args[cur_arg] = strdup(args[cur_arg - 1]);
 
288
 
 
289
        if (cur_arg == DIMOF(op->opaque->args) - 1) {
 
290
            crm_err("svc_action_t args list not long enough for '%s' execution request.", exec);
 
291
            break;
 
292
        }
 
293
    }
 
294
 
 
295
    return op;
 
296
}
 
297
 
 
298
void
 
299
services_action_free(svc_action_t * op)
 
300
{
 
301
    unsigned int i;
 
302
 
 
303
    if (op == NULL) {
 
304
        return;
 
305
    }
 
306
 
 
307
    if (op->opaque->repeat_timer) {
 
308
        g_source_remove(op->opaque->repeat_timer);
 
309
    }
 
310
    if (op->opaque->stderr_gsource) {
 
311
        mainloop_del_fd(op->opaque->stderr_gsource);
 
312
        op->opaque->stderr_gsource = NULL;
 
313
    }
 
314
 
 
315
    if (op->opaque->stdout_gsource) {
 
316
        mainloop_del_fd(op->opaque->stdout_gsource);
 
317
        op->opaque->stdout_gsource = NULL;
 
318
    }
 
319
 
 
320
    free(op->id);
 
321
    free(op->opaque->exec);
 
322
 
 
323
    for (i = 0; i < DIMOF(op->opaque->args); i++) {
 
324
        free(op->opaque->args[i]);
 
325
    }
 
326
 
 
327
    free(op->opaque);
 
328
    free(op->rsc);
 
329
    free(op->action);
 
330
 
 
331
    free(op->standard);
 
332
    free(op->agent);
 
333
    free(op->provider);
 
334
 
 
335
    free(op->stdout_data);
 
336
    free(op->stderr_data);
 
337
 
 
338
    if (op->params) {
 
339
        g_hash_table_destroy(op->params);
 
340
        op->params = NULL;
 
341
    }
 
342
 
 
343
    free(op);
 
344
}
 
345
 
 
346
gboolean
 
347
cancel_recurring_action(svc_action_t * op)
 
348
{
 
349
    if (op->pid) {
 
350
        return FALSE;
 
351
    }
 
352
 
 
353
    crm_info("Cancelling operation %s", op->id);
 
354
 
 
355
    if (recurring_actions) {
 
356
        g_hash_table_remove(recurring_actions, op->id);
 
357
    }
 
358
 
 
359
    if (op->opaque->repeat_timer) {
 
360
        g_source_remove(op->opaque->repeat_timer);
 
361
    }
 
362
 
 
363
    return TRUE;
 
364
}
 
365
 
 
366
gboolean
 
367
services_action_cancel(const char *name, const char *action, int interval)
 
368
{
 
369
    svc_action_t *op = NULL;
 
370
    char id[512];
 
371
 
 
372
    snprintf(id, sizeof(id), "%s_%s_%d", name, action, interval);
 
373
 
 
374
    if (!(op = g_hash_table_lookup(recurring_actions, id))) {
 
375
        return FALSE;
 
376
    }
 
377
 
 
378
    if (cancel_recurring_action(op)) {
 
379
        op->status = PCMK_LRM_OP_CANCELLED;
 
380
        if (op->opaque->callback) {
 
381
            op->opaque->callback(op);
 
382
        }
 
383
        services_action_free(op);
 
384
    } else {
 
385
        int rc;
 
386
        crm_info("Cancelling in-flight op: performing early termination of %s", id);
 
387
        op->cancel = 1;
 
388
        rc = mainloop_child_kill(op->pid);
 
389
        if (rc != 0 ) {
 
390
            /* even though the early termination failed,
 
391
             * the op will be marked as cancelled once it completes. */
 
392
            crm_err("Termination of %s failed", id);
 
393
        }
 
394
    }
 
395
 
 
396
    return TRUE;
 
397
}
 
398
 
 
399
gboolean
 
400
services_action_kick(const char *name, const char *action, int interval /* ms */)
 
401
{
 
402
    svc_action_t * op = NULL;
 
403
    char *id = NULL;
 
404
 
 
405
    if (asprintf(&id, "%s_%s_%d", name, action, interval) == -1) {
 
406
        return FALSE;
 
407
    }
 
408
 
 
409
    op = g_hash_table_lookup(recurring_actions, id);
 
410
    free(id);
 
411
 
 
412
    if (op == NULL) {
 
413
        return FALSE;
 
414
    }
 
415
 
 
416
    if (op->pid) {
 
417
        return TRUE;
 
418
    } else {
 
419
        if (op->opaque->repeat_timer) {
 
420
            g_source_remove(op->opaque->repeat_timer);
 
421
        }
 
422
        recurring_action_timer(op);
 
423
        return TRUE;
 
424
    }
 
425
 
 
426
}
 
427
 
 
428
/* add new recurring operation, check for duplicates. 
 
429
 * - if duplicate found, return TRUE, immediately reschedule op.
 
430
 * - if no dup, return FALSE, inserve into recurring op list.*/
 
431
static gboolean
 
432
handle_duplicate_recurring(svc_action_t * op, void (*action_callback) (svc_action_t *))
 
433
{
 
434
    svc_action_t * dup = NULL;
 
435
 
 
436
    if (recurring_actions == NULL) {
 
437
        recurring_actions = g_hash_table_new_full(g_str_hash, g_str_equal, NULL, NULL);
 
438
        return FALSE;
 
439
    }
 
440
 
 
441
    /* check for duplicates */
 
442
    dup = g_hash_table_lookup(recurring_actions, op->id);
 
443
 
 
444
    if (dup && (dup != op)) {
 
445
        /* update user data */
 
446
        if (op->opaque->callback) {
 
447
            dup->opaque->callback = op->opaque->callback;
 
448
            dup->cb_data = op->cb_data;
 
449
            op->cb_data = NULL;
 
450
        }
 
451
        /* immediately execute the next interval */
 
452
        if (dup->pid != 0) {
 
453
            if (op->opaque->repeat_timer) {
 
454
                g_source_remove(op->opaque->repeat_timer);
 
455
            }
 
456
            recurring_action_timer(dup);
 
457
        }
 
458
        /* free the dup.  */
 
459
        services_action_free(op);
 
460
        return TRUE;
 
461
    }
 
462
 
 
463
    return FALSE;
 
464
}
 
465
 
 
466
gboolean
 
467
services_action_async(svc_action_t * op, void (*action_callback) (svc_action_t *))
 
468
{
 
469
    if (action_callback) {
 
470
        op->opaque->callback = action_callback;
 
471
    }
 
472
 
 
473
    if (op->interval > 0) {
 
474
        if (handle_duplicate_recurring(op, action_callback) == TRUE) {
 
475
            /* entry rescheduled, dup freed */
 
476
            return TRUE;
 
477
        }
 
478
        g_hash_table_replace(recurring_actions, op->id, op);
 
479
    }
 
480
#if SUPPORT_UPSTART
 
481
    if (strcasecmp(op->standard, "upstart") == 0) {
 
482
        return upstart_job_exec(op, FALSE);
 
483
    }
 
484
#endif
 
485
#if SUPPORT_SYSTEMD
 
486
    if (strcasecmp(op->standard, "systemd") == 0) {
 
487
        return systemd_unit_exec(op, FALSE);
 
488
    }
 
489
#endif
 
490
    return services_os_action_execute(op, FALSE);
 
491
}
 
492
 
 
493
gboolean
 
494
services_action_sync(svc_action_t * op)
 
495
{
 
496
    gboolean rc = TRUE;
 
497
 
 
498
    if (strcasecmp(op->standard, "upstart") == 0) {
 
499
#if SUPPORT_UPSTART
 
500
        rc = upstart_job_exec(op, TRUE);
 
501
#endif
 
502
    } else if (strcasecmp(op->standard, "systemd") == 0) {
 
503
#if SUPPORT_SYSTEMD
 
504
        rc = systemd_unit_exec(op, TRUE);
 
505
#endif
 
506
    } else {
 
507
        rc = services_os_action_execute(op, TRUE);
 
508
    }
 
509
    crm_trace(" > %s_%s_%d: %s = %d", op->rsc, op->action, op->interval, op->opaque->exec, op->rc);
 
510
    if (op->stdout_data) {
 
511
        crm_trace(" >  stdout: %s", op->stdout_data);
 
512
    }
 
513
    if (op->stderr_data) {
 
514
        crm_trace(" >  stderr: %s", op->stderr_data);
 
515
    }
 
516
    return rc;
 
517
}
 
518
 
 
519
GList *
 
520
get_directory_list(const char *root, gboolean files, gboolean executable)
 
521
{
 
522
    return services_os_get_directory_list(root, files, executable);
 
523
}
 
524
 
 
525
GList *
 
526
services_list(void)
 
527
{
 
528
    return resources_list_agents("lsb", NULL);
 
529
}
 
530
 
 
531
GList *
 
532
resources_list_standards(void)
 
533
{
 
534
    GList *standards = NULL;
 
535
    GList *agents = NULL;
 
536
 
 
537
    standards = g_list_append(standards, strdup("ocf"));
 
538
    standards = g_list_append(standards, strdup("lsb"));
 
539
    standards = g_list_append(standards, strdup("service"));
 
540
 
 
541
#if SUPPORT_SYSTEMD
 
542
    agents = systemd_unit_listall();
 
543
#else
 
544
    agents = NULL;
 
545
#endif
 
546
 
 
547
    if (agents) {
 
548
        standards = g_list_append(standards, strdup("systemd"));
 
549
        g_list_free_full(agents, free);
 
550
    }
 
551
#if SUPPORT_UPSTART
 
552
    agents = upstart_job_listall();
 
553
#else
 
554
    agents = NULL;
 
555
#endif
 
556
 
 
557
    if (agents) {
 
558
        standards = g_list_append(standards, strdup("upstart"));
 
559
        g_list_free_full(agents, free);
 
560
    }
 
561
#if SUPPORT_NAGIOS
 
562
    agents = resources_os_list_nagios_agents();
 
563
    if (agents) {
 
564
        standards = g_list_append(standards, strdup("nagios"));
 
565
        g_list_free_full(agents, free);
 
566
    }
 
567
#endif
 
568
 
 
569
    return standards;
 
570
}
 
571
 
 
572
GList *
 
573
resources_list_providers(const char *standard)
 
574
{
 
575
    if (strcasecmp(standard, "ocf") == 0) {
 
576
        return resources_os_list_ocf_providers();
 
577
    }
 
578
 
 
579
    return NULL;
 
580
}
 
581
 
 
582
GList *
 
583
resources_list_agents(const char *standard, const char *provider)
 
584
{
 
585
    if (standard == NULL || strcasecmp(standard, "service") == 0) {
 
586
        GList *tmp1;
 
587
        GList *tmp2;
 
588
        GList *result = resources_os_list_lsb_agents();
 
589
 
 
590
        if (standard == NULL) {
 
591
            tmp1 = result;
 
592
            tmp2 = resources_os_list_ocf_agents(NULL);
 
593
            if (tmp2) {
 
594
                result = g_list_concat(tmp1, tmp2);
 
595
            }
 
596
        }
 
597
#if SUPPORT_SYSTEMD
 
598
        tmp1 = result;
 
599
        tmp2 = systemd_unit_listall();
 
600
        if (tmp2) {
 
601
            result = g_list_concat(tmp1, tmp2);
 
602
        }
 
603
#endif
 
604
 
 
605
#if SUPPORT_UPSTART
 
606
        tmp1 = result;
 
607
        tmp2 = upstart_job_listall();
 
608
        if (tmp2) {
 
609
            result = g_list_concat(tmp1, tmp2);
 
610
        }
 
611
#endif
 
612
 
 
613
        return result;
 
614
 
 
615
    } else if (strcasecmp(standard, "ocf") == 0) {
 
616
        return resources_os_list_ocf_agents(provider);
 
617
    } else if (strcasecmp(standard, "lsb") == 0) {
 
618
        return resources_os_list_lsb_agents();
 
619
#if SUPPORT_SYSTEMD
 
620
    } else if (strcasecmp(standard, "systemd") == 0) {
 
621
        return systemd_unit_listall();
 
622
#endif
 
623
#if SUPPORT_UPSTART
 
624
    } else if (strcasecmp(standard, "upstart") == 0) {
 
625
        return upstart_job_listall();
 
626
#endif
 
627
#if SUPPORT_NAGIOS
 
628
    } else if (strcasecmp(standard, "nagios") == 0) {
 
629
        return resources_os_list_nagios_agents();
 
630
#endif
 
631
    }
 
632
 
 
633
    return NULL;
 
634
}