(file) Return to fusdd_main.c CVS log (file) Jump to this file's LXR Page (dir) Up to [CENS] / emstar / fusd / fusdd

File: [CENS] / emstar / fusd / fusdd / fusdd_main.c (download) / (as text)
Revision: 1.6, Fri Feb 25 17:51:51 2005 UTC (4 years, 8 months ago) by girod
Branch: MAIN
CVS Tags: rdd_alpha_version_1, pregeonet, acoustic-05-18-06, PRE_TOSNIC_FIX, PRE_64BIT, MOTENIC_PRE_BUGFIX_20050415, LAURA_CALIBRATION_EXPERIMENTS, HEAD, ESS_RELEASE_3_5, ESS_RELEASE_3_4, ESS_RELEASE_3_3, ESS_RELEASE_3_2, ESS_RELEASE_3_1, ESS_RELEASE_3_0, ESS_RELEASE_2_0, ESS_CONNECTIVITY, ESS_CENTROUTE_TESTING, ESS2-CMS-V1_5_pretest, ESS2-CMS-V1_4cMergeSympathy_2, ESS2-CMS-V1_4c, ESS2-CMS-V1_4b, ESS2-CMS-V1_4a, ESS2-CMS-V1_3, ESS2-CMS-V1_2, ESS2-CMS-V1_1, ESS2-CMS-V1_0, EMSTAR_RELEASE_2_5, EMSTAR_RELEASE_2_1_BRANCH, EMSTAR_RELEASE_2_1, CYCLOPS_RELEASE_CANDIDATE_2_0, CYCLOPS_PRERELEASE_STABLE, CENTROUTE_EMSTAR_SOCKETS, BG_1_0, BANGLADESH_ARSENIC_1_2, BANGLADESH_ARSENIC_1_1, AMARSS_JR_DEPLOYMENT_6_05_07
Changes since 1.5: +8 -1 lines
revised previous logging fixes.  now, if a process uses -o to set
loglevel locally, that info is correctly propagated back to emrun as a
custom
loglevel.

/*
 *
 * Copyright (c) 2003 The Regents of the University of California.  All 
 * rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * - Redistributions of source code must retain the above copyright
 *   notice, this list of conditions and the following disclaimer.
 *
 * - Neither the name of the University nor the names of its
 *   contributors may be used to endorse or promote products derived
 *   from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS''
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
 * PARTICULAR  PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 */
 
/*
 *  FUSDd_main.c
 *
 *  Start Non-DevFS and Networking daemon
 */

#include "fusdd_i.h"
#include <stdio.h>
#include <getopt.h>
#include <stdlib.h>
#include <unistd.h>

int unlink_dirs = 0;

static void usage(void)
{
  fprintf(stderr,
          "fusdd release: %s\n"
	  "\n"
	  "usage: fusdd [-v] [-U] [-T]\n"
	  "\n"
	  "-v: Verbose mode\n"
	  "-T: Test driver\n"
	  "-U: unlink dirs when empty\n"
	  "\n"
	  ,CVSTAG
	  );
  exit(1);
}


int main(int argc, char **argv)
{
  int verbose=0;
  int arg;

  /********** Parse command-line arguments ************/
	
  opterr = 0;
  while ((arg = getopt(argc, argv, "hvnT")) != EOF) {
    switch (arg) {
    default:
    case '?':
      fprintf(stderr, "invalid option '-%c' (use -h for help)", optopt);
    case 'h':
      usage();
      break;

    case 'U':
      unlink_dirs = 1;
      break;
      
    case 'T':
      dev_test();
      exit(1);
      break;

    case 'v':
      verbose = 1;
      break;      
    }
  }

  /* advance past parsed options */
  argc -= optind;
  argv += optind;

  /* spawn fusdd */
  start_fusdd(verbose);

  /* done */
  fprintf(stderr, "FUSDd startup OK.\n");
  return 0;
}

CENS CVS Mailing List
Powered by
ViewCVS 0.9.2