root/orte/tools/orted/orted.c

/* [<][>][^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. main

   1 /*
   2  * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
   3  *                         University Research and Technology
   4  *                         Corporation.  All rights reserved.
   5  * Copyright (c) 2004-2006 The University of Tennessee and The University
   6  *                         of Tennessee Research Foundation.  All rights
   7  *                         reserved.
   8  * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
   9  *                         University of Stuttgart.  All rights reserved.
  10  * Copyright (c) 2004-2005 The Regents of the University of California.
  11  *                         All rights reserved.
  12  * Copyright (c) 2007      Cisco Systems, Inc.  All rights reserved.
  13  * Copyright (c) 2007      Los Alamos National Security, LLC.  All rights
  14  *                         reserved.
  15  * $COPYRIGHT$
  16  *
  17  * Additional copyrights may follow
  18  *
  19  * $HEADER$
  20  */
  21 
  22 #include "orte_config.h"
  23 
  24 #include <stdlib.h>
  25 #include <limits.h>
  26 #ifdef HAVE_SYS_TYPES_H
  27 #include <sys/types.h>
  28 #endif
  29 #ifdef HAVE_SYS_STAT_H
  30 #include <sys/stat.h>
  31 #endif
  32 #include <stdio.h>
  33 #include <errno.h>
  34 
  35 #include "orte/orted/orted.h"
  36 
  37 int main(int argc, char *argv[])
  38 {
  39     /* Allow the PLM starters to pass us a umask to use, if required.
  40        Most starters by default can do something sane with the umask,
  41        but some (like TM) do not pass on the umask but instead inherit
  42        it form the root level process starter.  This has to happen
  43        before opal_init and everything else so that the couple of
  44        places that stash a umask end up with the correct value.  Only
  45        do it here (and not in orte_daemon) mainly to make it clear
  46        that this should only happen when starting an orted for the
  47        first time.  All startes I'm aware of that don't require an
  48        orted are smart enough to pass on a reasonable umask, so they
  49        wouldn't need this functionality anyway. */
  50     char *umask_str = getenv("ORTE_DAEMON_UMASK_VALUE");
  51     if (NULL != umask_str) {
  52         char *endptr;
  53         long mask = strtol(umask_str, &endptr, 8);
  54         if ((! (0 == mask && (EINVAL == errno || ERANGE == errno))) &&
  55             (*endptr == '\0')) {
  56             umask(mask);
  57         }
  58     }
  59 
  60     return orte_daemon(argc, argv);
  61 }

/* [<][>][^][v][top][bottom][index][help] */