~ubuntu-branches/ubuntu/wily/glusterfs/wily

« back to all changes in this revision

Viewing changes to xlators/mgmt/glusterd/src/glusterd.c

  • Committer: Bazaar Package Importer
  • Author(s): Patrick Matthäi, Louis Zuckerman, Patrick Matthäi
  • Date: 2011-10-06 12:10:34 UTC
  • mfrom: (1.3.13 upstream)
  • Revision ID: james.westby@ubuntu.com-20111006121034-cpa0m5y3hj3qe5lt
Tags: 3.2.4-1
[ Louis Zuckerman ]
* Add dependency: glusterfs-server requires glusterfs-client
  Necessary for gluster NFS server (volume start warns unsuccessful
  without glusterfs-client).

[ Patrick Matthäi ]
* New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
366
366
 
367
367
static int
368
368
configure_syncdaemon (glusterd_conf_t *conf)
 
369
#define libc_system system
 
370
#define RUN_GSYNCD_CMD(prf) do {                                                \
 
371
        ret = prf##_system (cmd);                                               \
 
372
        if (ret) {                                                              \
 
373
                gf_log ("", GF_LOG_ERROR, "command failed: \"%s\"", cmd);       \
 
374
                goto out;                                                       \
 
375
        }                                                                       \
 
376
} while (0)
369
377
{
370
378
        int ret = 0;
371
379
#if SYNCDAEMON_COMPILE
409
417
 
410
418
        /* remote-gsyncd */
411
419
        strcpy (cmd + blen, "remote-gsyncd " GSYNCD_PREFIX"/gsyncd . .");
412
 
        ret = system (cmd);
413
 
        if (ret)
414
 
                goto out;
 
420
        RUN_GSYNCD_CMD(libc);
415
421
 
416
422
        strcpy (cmd + blen,
417
423
                "remote-gsyncd /usr/local/libexec/glusterfs/gsyncd . ^ssh:");
418
 
        ret = system (cmd);
419
 
        if (ret)
420
 
                goto out;
 
424
        RUN_GSYNCD_CMD(libc);
421
425
 
422
426
        /* gluster-command */
423
427
        /* XXX $sbindir should be used (throughout the codebase) */
424
428
        strcpy (cmd + blen,
425
429
                "gluster-command '"GFS_PREFIX"/sbin/glusterfs "
426
430
                "--xlator-option *-dht.assert-no-child-down=true' . .");
427
 
        ret = system (cmd);
428
 
        if (ret)
429
 
                goto out;
 
431
        RUN_GSYNCD_CMD(libc);
430
432
 
431
433
        /* ssh-command */
432
434
        sprintf (cmd + blen,
433
435
                 "ssh-command "
434
436
                 "'ssh -oPasswordAuthentication=no -oStrictHostKeyChecking=no "
435
437
                 "-i %s/secret.pem' . .", georepdir);
436
 
        ret = system (cmd);
437
 
        if (ret)
438
 
                goto out;
 
438
        RUN_GSYNCD_CMD(libc);
439
439
 
440
440
        /* session-owner */
441
441
        uuid_unparse (conf->uuid, volid);
442
442
        sprintf (cmd + blen, "session-owner %s . .", volid);
443
 
        ret = system (cmd);
444
 
        if (ret)
445
 
                goto out;
 
443
        RUN_GSYNCD_CMD(libc);
446
444
 
447
445
        /* pid-file */
448
446
        sprintf (cmd + blen, "pid-file %s/${mastervol}/${eSlave}.pid . .", georepdir);
449
 
        ret = gf_system (cmd);
450
 
        if (ret)
451
 
                goto out;
 
447
        RUN_GSYNCD_CMD(gf);
452
448
 
453
449
        /* state-file */
454
450
        sprintf (cmd + blen, "state-file %s/${mastervol}/${eSlave}.status . .", georepdir);
455
 
        ret = gf_system (cmd);
456
 
        if (ret)
457
 
                goto out;
 
451
        RUN_GSYNCD_CMD(gf);
458
452
 
459
453
        /* log-file */
460
454
        strcpy (cmd + blen,
461
455
                "log-file "DEFAULT_LOG_FILE_DIRECTORY"/"GEOREP"/${mastervol}/${eSlave}.log . .");
462
 
        ret = gf_system (cmd);
463
 
        if (ret)
464
 
                goto out;
 
456
        RUN_GSYNCD_CMD(gf);
465
457
 
466
458
        /* gluster-log-file */
467
459
        strcpy (cmd + blen, "gluster-log-file "
468
460
                DEFAULT_LOG_FILE_DIRECTORY"/"GEOREP"/${mastervol}/${eSlave}.gluster.log . .");
469
 
        ret = gf_system (cmd);
470
 
        if (ret)
471
 
                goto out;
 
461
        RUN_GSYNCD_CMD(gf);
472
462
 
473
463
        /************
474
464
         * slave pre-configuration
478
468
        strcpy (cmd + blen,
479
469
                "gluster-command '"GFS_PREFIX"/sbin/glusterfs "
480
470
                "--xlator-option *-dht.assert-no-child-down=true' .");
481
 
        ret = system (cmd);
482
 
        if (ret)
483
 
                goto out;
 
471
        RUN_GSYNCD_CMD(libc);
484
472
 
485
473
        /* log-file */
486
474
        strcpy (cmd + blen,
487
475
                "log-file "DEFAULT_LOG_FILE_DIRECTORY"/"GEOREP"-slaves/${session_owner}:${eSlave}.log .");
488
 
        ret = gf_system (cmd);
489
 
        if (ret)
490
 
                goto out;
 
476
        RUN_GSYNCD_CMD(gf);
491
477
 
492
478
        /* gluster-log-file */
493
479
        strcpy (cmd + blen, "gluster-log-file "
494
480
                DEFAULT_LOG_FILE_DIRECTORY"/"GEOREP"-slaves/${session_owner}:${eSlave}.gluster.log .");
495
 
        ret = gf_system (cmd);
496
 
        if (ret)
497
 
                goto out;
 
481
        RUN_GSYNCD_CMD(gf);
498
482
 
499
483
 out:
500
484
#else
502
486
#endif
503
487
        return ret ? -1 : 0;
504
488
}
 
489
#undef libc_system
 
490
#undef RUN_GSYNCD_CMD
505
491
 
506
492
 
507
493
/*