gfarm-2.4.1/0000755000000000000000000000000011507222730011307 5ustar rootrootgfarm-2.4.1/makes/0000755000000000000000000000000011507222730012407 5ustar rootrootgfarm-2.4.1/makes/gfptool.mk0000644000000000000000000000026211507222720014411 0ustar rootrootgfregister: prog-gfregister gfptool-gfregister post-gfregister-hook include $(top_srcdir)/makes/prog.mk gfptool-gfregister: $(PROGRAM) -gfreg $(PROGRAM) gfarm:/bin/$(PROGRAM) gfarm-2.4.1/makes/man.mk0000644000000000000000000000234211507222720013513 0ustar rootrootall: man-all post-all-hook install: man-install post-install-hook clean: man-clean post-clean-hook veryclean: man-veryclean post-very-clean-hook distclean: man-distclean post-distclean-hook gfregister: man-gfregister post-gfregister-hook man: man-man html: man-html msgno: man-msgno catalog: man-catalog post-all-hook: post-install-hook: post-clean-hook: post-very-clean-hook: post-distclean-hook: post-gfregister-hook: man-all: man-install: @for i in -- $(MAN); do \ case $$i in --) continue;; esac; \ suffix=`expr $$i : '.*\.\([^.]*\)$$'`; \ $(MKDIR_P) $(DESTDIR)$(mandir)/man$$suffix; \ echo \ $(INSTALL_DOC) $(srcdir)/$$i \ $(DESTDIR)$(mandir)/man$$suffix/$$i; \ $(INSTALL_DOC) $(srcdir)/$$i \ $(DESTDIR)$(mandir)/man$$suffix/$$i; \ done man-clean: -test -z "$(EXTRA_CLEAN_TARGETS)" || $(RM) -f $(EXTRA_CLEAN_TARGETS) man-veryclean: clean -test -z "$(EXTRA_VERYCLEAN_TARGETS)" || $(RM) -f $(EXTRA_VERYCLEAN_TARGETS) man-distclean: veryclean -test ! -f $(srcdir)/Makefile.in || $(RM) -f Makefile man-gfregister: $(dstsubst): $(srcsubst) $(DOCBOOK2MAN) $(srcsubst) man-man: for i in $(DOCBOOK); do \ $(MAKE) srcsubst=$(DOCBOOK_DIR)/$${i}.docbook \ dstsubst=$$i $$i; \ done man-html: man-msgno: man-catalog: gfarm-2.4.1/makes/data.mk0000644000000000000000000000207611507222720013655 0ustar rootrootall: data-all post-all-hook install: all data-install post-install-hook clean: data-clean post-clean-hook veryclean: data-veryclean post-veryclean-hook distclean: data-distclean post-distclean-hook gfregister: data-gfregister post-gfregister-hook man: data-man post-man-hook html: data-html post-html-hook msgno: data-msgno catalog: data-catalog post-all-hook: post-install-hook: post-clean-hook: post-veryclean-hook: post-distclean-hook: post-gfregister-hook: post-man-hook: post-html-hook: data-all: data-install: @$(MKDIR_P) $(DESTDIR)$(datadir) @for i in -- $(DATA); do \ case $$i in --) continue;; esac; \ echo \ $(INSTALL_DATA) $$i $(DESTDIR)$(datadir)/`basename $$i`; \ $(INSTALL_DATA) $$i $(DESTDIR)$(datadir)/`basename $$i`; \ done data-clean: -test -z "$(EXTRA_CLEAN_TARGETS)" || $(RM) -f $(EXTRA_CLEAN_TARGETS) data-veryclean: clean -test -z "$(EXTRA_VERYCLEAN_TARGETS)" || $(RM) -f $(EXTRA_VERYCLEAN_TARGETS) data-distclean: veryclean -test ! -f $(srcdir)/Makefile.in || $(RM) -f Makefile data-gfregister: data-man: data-html: data-msgno: data-catalog: gfarm-2.4.1/makes/config.sub0000755000000000000000000007577711507222720014420 0ustar rootroot#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. timestamp='2005-07-08' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \ kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray) os= basic_machine=$1 ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | m32r | m32rle | m68000 | m68k | m88k | maxq | mcore \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64vr | mips64vrel \ | mips64orion | mips64orionel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | ms1 \ | msp430 \ | ns16k | ns32k \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b \ | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ | x86 | xscale | xscalee[bl] | xstormy16 | xtensa \ | z8k) basic_machine=$basic_machine-unknown ;; m32c) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64vr-* | mips64vrel-* \ | mips64orion-* | mips64orionel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | ms1-* \ | msp430-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \ | xstormy16-* | xtensa-* \ | ymp-* \ | z8k-*) ;; m32c-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; c90) basic_machine=c90-cray os=-unicos ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16c) basic_machine=cr16c-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tic55x | c55x*) basic_machine=tic55x-unknown os=-coff ;; tic6x | c6x*) basic_machine=tic6x-unknown os=-coff ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: gfarm-2.4.1/makes/ltmain.sh0000644000000000000000000055703211507222720014242 0ustar rootroot# ltmain.sh - Provide generalized library-building support services. # NOTE: Changing this file will not affect anything until you rerun configure. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005 # Free Software Foundation, Inc. # Originally by Gordon Matzigkeit , 1996 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. basename="s,^.*/,,g" # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath="$0" # The name of this program: progname=`echo "$progpath" | $SED $basename` modename="$progname" # Global variables: EXIT_SUCCESS=0 EXIT_FAILURE=1 PROGRAM=ltmain.sh PACKAGE=libtool VERSION=1.5.18 TIMESTAMP=" (1.1220.2.245 2005/05/16 08:55:27)" # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Check that we have a working $echo. if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then # Yippee, $echo works! : else # Restart under the correct shell, and then maybe $echo will work. exec $SHELL "$progpath" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat <&2 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit $EXIT_FAILURE fi # Global variables. mode=$default_mode nonopt= prev= prevopt= run= show="$echo" show_help= execute_dlfiles= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" quote_scanset='[[~#^*{};<>?'"'"' ]' ##################################### # Shell function definitions: # This seems to be the best place for them # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. func_win32_libid () { win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then win32_nmres=`eval $NM -f posix -A $1 | \ sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'` if test "X$win32_nmres" = "Ximport" ; then win32_libid_type="x86 archive import" else win32_libid_type="x86 archive static" fi fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $echo $win32_libid_type } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { # Set the commonly-used compilers for some tags. tag_compilers_CC="*cc *xlc" tag_compilers_CXX="*++ *CC" tag_compilers_F77="*77 *fort" base_compiler=`set -- "$@"; $echo $1` # If $tagname still isn't set, then try to infer if the default # "CC" tag applies by matching up the base compile command to some # compilers commonly used for the "CC" tag. if test -z "$tagname"; then z=CC eval "tag_compilers=\$tag_compilers_${z}" if test -n "$tag_compilers"; then for zp in $tag_compilers; do case $base_compiler in $zp) # The compiler in the base compile command matches # one of the common compilers for the current tag. # Assume this is the tagged configuration we want. tagname=$z break ;; esac done fi fi if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do case $arg in *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") arg="\"$arg\"" ;; esac CC_quoted="$CC_quoted $arg" done case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. case $arg in *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") arg="\"$arg\"" ;; esac CC_quoted="$CC_quoted $arg" done case "$@ " in " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac # If $tagname still isn't set, then try to infer it by # matching up the base compile command to some compilers # commonly used for certain tags. base_compiler=`set -- "$@"; $echo $1` eval "tag_compilers=\$tag_compilers_${z}" if test -n "$tag_compilers"; then for zp in $tag_compilers; do case $base_compiler in $zp) # The compiler in the base compile command matches # one of the common compilers for the current tag. # Assume this is the tagged configuration we want. tagname=$z break ;; esac done if test -n "$tagname"; then break fi fi fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then $echo "$modename: unable to infer tagged configuration" $echo "$modename: specify a tag with \`--tag'" 1>&2 exit $EXIT_FAILURE # else # $echo "$modename: using $tagname tagged configuration" fi ;; esac fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)" $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $? if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2 exit $EXIT_FAILURE fi } # func_extract_archives gentop oldlib ... func_extract_archives () { my_gentop="$1"; shift my_oldlibs=${1+"$@"} my_oldobjs="" my_xlib="" my_xabs="" my_xdir="" my_status="" $show "${rm}r $my_gentop" $run ${rm}r "$my_gentop" $show "$mkdir $my_gentop" $run $mkdir "$my_gentop" my_status=$? if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then exit $my_status fi for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'` my_xdir="$my_gentop/$my_xlib" $show "${rm}r $my_xdir" $run ${rm}r "$my_xdir" $show "$mkdir $my_xdir" $run $mkdir "$my_xdir" status=$? if test "$status" -ne 0 && test ! -d "$my_xdir"; then exit $status fi case $host in *-darwin*) $show "Extracting $my_xabs" # Do not bother doing anything if just a dry run if test -z "$run"; then darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'` darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null` if test -n "$darwin_arches"; then darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= $show "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches ; do mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}" lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" func_extract_an_archive "`pwd`" "${darwin_base_archive}" cd "$darwin_curdir" $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" done # $darwin_arches ## Okay now we have a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` lipo -create -output "$darwin_file" $darwin_files done # $darwin_filelist ${rm}r unfat-$$ cd "$darwin_orig_dir" else cd "$darwin_orig_dir" func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches fi # $run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` done func_extract_archives_result="$my_oldobjs" } # End of Shell function definitions ##################################### # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Parse our command line options once, thoroughly. while test "$#" -gt 0 do arg="$1" shift case $arg in -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; *) optarg= ;; esac # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in execute_dlfiles) execute_dlfiles="$execute_dlfiles $arg" ;; tag) tagname="$arg" preserve_args="${preserve_args}=$arg" # Check whether tagname contains only valid characters case $tagname in *[!-_A-Za-z0-9,/]*) $echo "$progname: invalid tag name: $tagname" 1>&2 exit $EXIT_FAILURE ;; esac case $tagname in CC) # Don't test for the "default" C tag, as we know, it's there, but # not specially marked. ;; *) if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then taglist="$taglist $tagname" # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`" else $echo "$progname: ignoring unknown tag $tagname" 1>&2 fi ;; esac ;; *) eval "$prev=\$arg" ;; esac prev= prevopt= continue fi # Have we seen a non-optional argument yet? case $arg in --help) show_help=yes ;; --version) $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" $echo $echo "Copyright (C) 2005 Free Software Foundation, Inc." $echo "This is free software; see the source for copying conditions. There is NO" $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." exit $? ;; --config) ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath # Now print the configurations for the tags. for tagname in $taglist; do ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath" done exit $? ;; --debug) $echo "$progname: enabling shell trace mode" set -x preserve_args="$preserve_args $arg" ;; --dry-run | -n) run=: ;; --features) $echo "host: $host" if test "$build_libtool_libs" = yes; then $echo "enable shared libraries" else $echo "disable shared libraries" fi if test "$build_old_libs" = yes; then $echo "enable static libraries" else $echo "disable static libraries" fi exit $? ;; --finish) mode="finish" ;; --mode) prevopt="--mode" prev=mode ;; --mode=*) mode="$optarg" ;; --preserve-dup-deps) duplicate_deps="yes" ;; --quiet | --silent) show=: preserve_args="$preserve_args $arg" ;; --tag) prevopt="--tag" prev=tag ;; --tag=*) set tag "$optarg" ${1+"$@"} shift prev=tag preserve_args="$preserve_args --tag" ;; -dlopen) prevopt="-dlopen" prev=execute_dlfiles ;; -*) $echo "$modename: unrecognized option \`$arg'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; *) nonopt="$arg" break ;; esac done if test -n "$prevopt"; then $echo "$modename: option \`$prevopt' requires an argument" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= if test -z "$show_help"; then # Infer the operation mode. if test -z "$mode"; then $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2 $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2 case $nonopt in *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc* | *CC) mode=link for arg do case $arg in -c) mode=compile break ;; esac done ;; *db | *dbx | *strace | *truss) mode=execute ;; *install*|cp|mv) mode=install ;; *rm) mode=uninstall ;; *) # If we have no mode, but dlfiles were specified, then do execute mode. test -n "$execute_dlfiles" && mode=execute # Just use the default operation mode. if test -z "$mode"; then if test -n "$nonopt"; then $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 else $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 fi fi ;; esac fi # Only execute mode is allowed to have -dlopen flags. if test -n "$execute_dlfiles" && test "$mode" != execute; then $echo "$modename: unrecognized option \`-dlopen'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$modename --help --mode=$mode' for more information." # These modes are in order of execution frequency so that they run quickly. case $mode in # libtool compile mode compile) modename="$modename: compile" # Get the compilation command and the source file. base_compile= srcfile="$nonopt" # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= for arg do case "$arg_mode" in arg ) # do not "continue". Instead, add this to base_compile lastarg="$arg" arg_mode=normal ;; target ) libobj="$arg" arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) if test -n "$libobj" ; then $echo "$modename: you cannot specify \`-o' more than once" 1>&2 exit $EXIT_FAILURE fi arg_mode=target continue ;; -static | -prefer-pic | -prefer-non-pic) later="$later $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` lastarg= save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. case $arg in *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") arg="\"$arg\"" ;; esac lastarg="$lastarg $arg" done IFS="$save_ifs" lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` # Add the arguments to base_compile. base_compile="$base_compile $lastarg" continue ;; * ) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg="$srcfile" srcfile="$arg" ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` case $lastarg in # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly # in scan sets, and some SunOS ksh mistreat backslash-escaping # in scan sets (worked around with variable expansion), # and furthermore cannot handle '|' '&' '(' ')' in scan sets # at all, so we specify them separately. *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") lastarg="\"$lastarg\"" ;; esac base_compile="$base_compile $lastarg" done # for arg case $arg_mode in arg) $echo "$modename: you must specify an argument for -Xcompile" exit $EXIT_FAILURE ;; target) $echo "$modename: you must specify a target with \`-o'" 1>&2 exit $EXIT_FAILURE ;; *) # Get the name of the library object. [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo xform='[cCFSifmso]' case $libobj in *.ada) xform=ada ;; *.adb) xform=adb ;; *.ads) xform=ads ;; *.asm) xform=asm ;; *.c++) xform=c++ ;; *.cc) xform=cc ;; *.ii) xform=ii ;; *.class) xform=class ;; *.cpp) xform=cpp ;; *.cxx) xform=cxx ;; *.f90) xform=f90 ;; *.for) xform=for ;; *.java) xform=java ;; esac libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` case $libobj in *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; *) $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 exit $EXIT_FAILURE ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -static) build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"` case $qlibobj in *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") qlibobj="\"$qlibobj\"" ;; esac if test "X$libobj" != "X$qlibobj"; then $echo "$modename: libobj name \`$libobj' may not contain shell special characters." exit $EXIT_FAILURE fi objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$obj"; then xdir= else xdir=$xdir/ fi lobj=${xdir}$objdir/$objname if test -z "$base_compile"; then $echo "$modename: you must specify a compilation command" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi $run $rm $removelist trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" removelist="$removelist $output_obj $lockfile" trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until $run ln "$progpath" "$lockfile" 2>/dev/null; do $show "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then $echo "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit $EXIT_FAILURE fi $echo "$srcfile" > "$lockfile" fi if test -n "$fix_srcfile_path"; then eval srcfile=\"$fix_srcfile_path\" fi qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"` case $qsrcfile in *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") qsrcfile="\"$qsrcfile\"" ;; esac $run $rm "$libobj" "${libobj}T" # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. test -z "$run" && cat > ${libobj}T </dev/null`" != "X$srcfile"; then $echo "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then $show "$mv $output_obj $lobj" if $run $mv $output_obj $lobj; then : else error=$? $run $rm $removelist exit $error fi fi # Append the name of the PIC object to the libtool object file. test -z "$run" && cat >> ${libobj}T <> ${libobj}T </dev/null`" != "X$srcfile"; then $echo "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $run $rm $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then $show "$mv $output_obj $obj" if $run $mv $output_obj $obj; then : else error=$? $run $rm $removelist exit $error fi fi # Append the name of the non-PIC object the libtool object file. # Only append if the libtool object file exists. test -z "$run" && cat >> ${libobj}T <> ${libobj}T <&2 fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi else if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi fi build_libtool_libs=no build_old_libs=yes prefer_static_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg="$1" shift case $arg in *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test ;; *) qarg=$arg ;; esac libtool_args="$libtool_args $qarg" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) compile_command="$compile_command @OUTPUT@" finalize_command="$finalize_command @OUTPUT@" ;; esac case $prev in dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. compile_command="$compile_command @SYMFILE@" finalize_command="$finalize_command @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then dlfiles="$dlfiles $arg" else dlprefiles="$dlprefiles $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" if test ! -f "$arg"; then $echo "$modename: symbol file \`$arg' does not exist" exit $EXIT_FAILURE fi prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; precious_regex) precious_files_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat $save_arg` do # moreargs="$moreargs $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then pic_object= non_pic_object= # Read the .lo file # If there is no directory component, then add one. case $arg in */* | *\\*) . $arg ;; *) . ./$arg ;; esac if test -z "$pic_object" || \ test -z "$non_pic_object" || test "$pic_object" = none && \ test "$non_pic_object" = none; then $echo "$modename: cannot find name of object for \`$arg'" 1>&2 exit $EXIT_FAILURE fi # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then dlfiles="$dlfiles $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. dlprefiles="$dlprefiles $pic_object" prev= fi # A PIC object. libobjs="$libobjs $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object non_pic_objects="$non_pic_objects $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi fi else # Only an error if not doing a dry-run. if test -z "$run"; then $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 exit $EXIT_FAILURE else # Dry-run case. # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` libobjs="$libobjs $pic_object" non_pic_objects="$non_pic_objects $non_pic_object" fi fi done else $echo "$modename: link input file \`$save_arg' does not exist" exit $EXIT_FAILURE fi arg=$save_arg prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) $echo "$modename: only absolute run-paths are allowed" 1>&2 exit $EXIT_FAILURE ;; esac # Canonicalise the pathname tmp="" while test "$arg" != "$tmp" do tmp=$arg arg=`$echo "X$arg" | $Xsed -e 's%[^/.][^/.]*/\.\.%%g' -e 's%/\./%/%g' -e 's%//*%/%g' -e 's%/$%%g'` done if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) rpath="$rpath $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) xrpath="$xrpath $arg" ;; esac fi prev= continue ;; xcompiler) compiler_flags="$compiler_flags $qarg" prev= compile_command="$compile_command $qarg" finalize_command="$finalize_command $qarg" continue ;; xlinker) linker_flags="$linker_flags $qarg" compiler_flags="$compiler_flags $wl$qarg" prev= compile_command="$compile_command $wl$qarg" finalize_command="$finalize_command $wl$qarg" continue ;; xcclinker) linker_flags="$linker_flags $qarg" compiler_flags="$compiler_flags $qarg" prev= compile_command="$compile_command $qarg" finalize_command="$finalize_command $qarg" continue ;; shrext) shrext_cmds="$arg" prev= continue ;; darwin_framework) compiler_flags="$compiler_flags $arg" compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" prev= continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg="$arg" case $arg in -all-static) if test -n "$link_static_flag"; then compile_command="$compile_command $link_static_flag" finalize_command="$finalize_command $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 continue ;; -avoid-version) avoid_version=yes continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then $echo "$modename: more than one -exported-symbols argument is not allowed" exit $EXIT_FAILURE fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=darwin_framework compiler_flags="$compiler_flags $arg" compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" ;; esac continue ;; -L*) dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 exit $EXIT_FAILURE fi dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "*) ;; *) deplibs="$deplibs -L$dir" lib_search_path="$lib_search_path $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) case :$dllsearchpath: in *":$dir:"*) ;; *) dllsearchpath="$dllsearchpath:$dir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-pw32* | *-*-beos*) # These systems don't actually have a C or math library (as such) continue ;; *-*-mingw* | *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework deplibs="$deplibs -framework System" continue esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi deplibs="$deplibs $arg" continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. -model) compile_command="$compile_command $arg" compiler_flags="$compiler_flags $arg" finalize_command="$finalize_command $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) compiler_flags="$compiler_flags $arg" compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" continue ;; -module) module=yes continue ;; # -64, -mips[0-9] enable 64-bit mode on the SGI compiler # -r[0-9][0-9]* specifies the processor on the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler # +DA*, +DD* enable 64-bit mode on the HP compiler # -q* pass through compiler args for the IBM compiler # -m* pass through architecture-specific compiler args for GCC -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") arg="\"$arg\"" ;; esac compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" if test "$with_gcc" = "yes" ; then compiler_flags="$compiler_flags $arg" fi continue ;; -shrext) prev=shrext continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) # The PATH hackery in wrapper scripts is required on Windows # in order for the loader to find any dlls it needs. $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) $echo "$modename: only absolute run-paths are allowed" 1>&2 exit $EXIT_FAILURE ;; esac case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac continue ;; -static) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -Wc,*) args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" case $flag in *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") flag="\"$flag\"" ;; esac arg="$arg $wl$flag" compiler_flags="$compiler_flags $flag" done IFS="$save_ifs" arg=`$echo "X$arg" | $Xsed -e "s/^ //"` ;; -Wl,*) args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" case $flag in *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") flag="\"$flag\"" ;; esac arg="$arg $wl$flag" compiler_flags="$compiler_flags $wl$flag" linker_flags="$linker_flags $flag" done IFS="$save_ifs" arg=`$echo "X$arg" | $Xsed -e "s/^ //"` ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # Some other compiler flag. -* | +*) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") arg="\"$arg\"" ;; esac ;; *.$objext) # A standard object. objs="$objs $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then pic_object= non_pic_object= # Read the .lo file # If there is no directory component, then add one. case $arg in */* | *\\*) . $arg ;; *) . ./$arg ;; esac if test -z "$pic_object" || \ test -z "$non_pic_object" || test "$pic_object" = none && \ test "$non_pic_object" = none; then $echo "$modename: cannot find name of object for \`$arg'" 1>&2 exit $EXIT_FAILURE fi # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then dlfiles="$dlfiles $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. dlprefiles="$dlprefiles $pic_object" prev= fi # A PIC object. libobjs="$libobjs $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object non_pic_objects="$non_pic_objects $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi fi else # Only an error if not doing a dry-run. if test -z "$run"; then $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 exit $EXIT_FAILURE else # Dry-run case. # Extract subdirectory from the argument. xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` if test "X$xdir" = "X$arg"; then xdir= else xdir="$xdir/" fi pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` libobjs="$libobjs $pic_object" non_pic_objects="$non_pic_objects $non_pic_object" fi fi ;; *.$libext) # An archive. deplibs="$deplibs $arg" old_deplibs="$old_deplibs $arg" continue ;; *.la) # A libtool-controlled library. if test "$prev" = dlfiles; then # This library was specified with -dlopen. dlfiles="$dlfiles $arg" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. dlprefiles="$dlprefiles $arg" prev= else deplibs="$deplibs $arg" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") arg="\"$arg\"" ;; esac ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" fi done # argument parsing loop if test -n "$prev"; then $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" fi oldlibs= # calculate the name of the file, without its directory outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` if test "X$output_objdir" = "X$output"; then output_objdir="$objdir" else output_objdir="$output_objdir/$objdir" fi # Create the object directory. if test ! -d "$output_objdir"; then $show "$mkdir $output_objdir" $run $mkdir $output_objdir status=$? if test "$status" -ne 0 && test ! -d "$output_objdir"; then exit $status fi fi # Determine the type of output case $output in "") $echo "$modename: you must specify an output file" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac case $host in *cygwin* | *mingw* | *pw32*) # don't eliminate duplications in $postdeps and $predeps duplicate_compiler_generated_deps=yes ;; *) duplicate_compiler_generated_deps=$duplicate_deps ;; esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if test "X$duplicate_deps" = "Xyes" ; then case "$libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi libs="$libs $deplib" done if test "$linkmode" = lib; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; esac pre_post_deps="$pre_post_deps $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 exit $EXIT_FAILURE ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan"; then libs="$deplibs" deplibs= fi if test "$linkmode" = prog; then case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; esac fi if test "$pass" = dlopen; then # Collect dlpreopened libraries save_deplibs="$deplibs" deplibs= fi for deplib in $libs; do lib= found=no case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else compiler_flags="$compiler_flags $deplib" fi continue ;; -l*) if test "$linkmode" != lib && test "$linkmode" != prog; then $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 continue fi name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib="$searchdir/lib${name}${search_ext}" if test -f "$lib"; then if test "$search_ext" = ".la"; then found=yes else found=no fi break 2 fi done done if test "$found" != yes; then # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue else # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $deplib "*) if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then library_names= old_library= case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac for l in $old_library $library_names; do ll="$l" done if test "X$ll" = "X$old_library" ; then # only static version available found=no ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` test "X$ladir" = "X$lib" && ladir="." lib=$ladir/$old_library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi fi ;; # -l -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` ;; prog) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi if test "$pass" = scan; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` ;; *) $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2 ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) lib="$deplib" ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) valid_a_lib=no case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` if eval $echo \"$deplib\" 2>/dev/null \ | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=yes fi ;; pass_all) valid_a_lib=yes ;; esac if test "$valid_a_lib" != yes; then $echo $echo "*** Warning: Trying to link with static lib archive $deplib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have" $echo "*** because the file extensions .$libext of this argument makes me believe" $echo "*** that it is just a static archive that I should not used here." else $echo $echo "*** Warning: Linking the shared library $output against the" $echo "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi continue ;; prog) if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test "$pass" = conv; then deplibs="$deplib $deplibs" elif test "$linkmode" = prog; then if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. newdlprefiles="$newdlprefiles $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else newdlfiles="$newdlfiles $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else $echo "$modename: cannot find the library \`$lib'" 1>&2 exit $EXIT_FAILURE fi # Check to see that this really is a libtool archive. if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` test "X$ladir" = "X$lib" && ladir="." dlname= dlopen= dlpreopen= libdir= library_names= old_library= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then test -n "$dlopen" && dlfiles="$dlfiles $dlopen" test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" fi if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 exit $EXIT_FAILURE fi # It is a libtool convenience library, so add in its objects. convenience="$convenience $ladir/$objdir/$old_library" old_convenience="$old_convenience $ladir/$objdir/$old_library" tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done elif test "$linkmode" != prog && test "$linkmode" != lib; then $echo "$modename: \`$lib' is not a convenience library" 1>&2 exit $EXIT_FAILURE fi continue fi # $pass = conv # Get the name of the library we link against. linklib= for l in $old_library $library_names; do linklib="$l" done if test -z "$linklib"; then $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 exit $EXIT_FAILURE fi # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 exit $EXIT_FAILURE fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. dlprefiles="$dlprefiles $lib $dependency_libs" else newdlfiles="$newdlfiles $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 abs_ladir="$ladir" fi ;; esac laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then $echo "$modename: warning: library \`$lib' was moved." 1>&2 dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$libdir" absdir="$libdir" fi test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir="$ladir" absdir="$abs_ladir" # Remove this search path later notinst_path="$notinst_path $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later notinst_path="$notinst_path $abs_ladir" fi fi # $installed = yes name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` # This library was specified with -dlpreopen. if test "$pass" = dlpreopen; then if test -z "$libdir"; then $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 exit $EXIT_FAILURE fi # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then newdlprefiles="$newdlprefiles $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then newdlprefiles="$newdlprefiles $dir/$dlname" else newdlprefiles="$newdlprefiles $dir/$linklib" fi fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test "$linkmode" = prog && test "$pass" != link; then newlib_search_path="$newlib_search_path $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test esac # Need to link against all dependency_libs? if test "$linkalldeplibs" = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done # for deplib continue fi # $linkmode = prog... if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && { test "$prefer_static_libs" = no || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then # Make sure the rpath contains only unique directories. case "$temp_rpath " in *" $dir "*) ;; *" $absdir "*) ;; *) temp_rpath="$temp_rpath $dir" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically if test -n "$library_names" && { test "$prefer_static_libs" = no || test -z "$old_library"; }; then if test "$installed" = no; then notinst_deplibs="$notinst_deplibs $lib" need_relink=yes fi # This is a shared library # Warn about portability, can't link against -module's on # some systems (darwin) if test "$shouldnotlink" = yes && test "$pass" = link ; then $echo if test "$linkmode" = prog; then $echo "*** Warning: Linking the executable $output against the loadable module" else $echo "*** Warning: Linking the shared library $output against the loadable module" fi $echo "*** $linklib is not portable!" fi if test "$linkmode" = lib && test "$hardcode_into_libs" = yes; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names realname="$2" shift; shift libname=`eval \\$echo \"$libname_spec\"` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw*) major=`expr $current - $age` versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" soname=`$echo $soroot | ${SED} -e 's/^.*\///'` newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a" # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else $show "extracting exported symbol list from \`$soname'" save_ifs="$IFS"; IFS='~' cmds=$extract_expsyms_cmds for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else $show "generating import library for \`$soname'" save_ifs="$IFS"; IFS='~' cmds=$old_archive_from_expsyms_cmds for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test "$linkmode" = prog || test "$mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" case $host in *-*-sco3.2v5* ) add_dir="-L$dir" ;; *-*-darwin* ) # if the lib is a module then we can not link against # it, someone is ignoring the new warnings I added if /usr/bin/file -L $add 2> /dev/null | $EGREP "bundle" >/dev/null ; then $echo "** Warning, lib $linklib is a module, not a shared library" if test -z "$old_library" ; then $echo $echo "** And there doesn't seem to be a static archive available" $echo "** The link will probably fail, sorry" else add="$dir/$old_library" fi fi esac elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$dir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case "$libdir" in [\\/]*) add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then $echo "$modename: configuration error: unsupported hardcode properties" exit $EXIT_FAILURE fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && \ test "$hardcode_minus_L" != yes && \ test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then add="$inst_prefix_dir$libdir/$linklib" else add="$libdir/$linklib" fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case "$libdir" in [\\/]*) add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" fi if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test "$linkmode" = prog; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. $echo $echo "*** Warning: This system can not link to static lib archive $lib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then $echo "*** But as you try to build a module library, libtool will still create " $echo "*** a static module, that should work as long as the dlopening application" $echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then $echo $echo "*** However, this would only work if libtool was able to extract symbol" $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" $echo "*** not find such a program. So, this module is probably useless." $echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else convenience="$convenience $dir/$old_library" old_convenience="$old_convenience $dir/$old_library" deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test "$linkmode" = lib; then if test -n "$dependency_libs" && { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` case " $xrpath " in *" $temp_xrpath "*) ;; *) xrpath="$xrpath $temp_xrpath";; esac;; *) temp_deplibs="$temp_deplibs $libdir";; esac done dependency_libs="$temp_deplibs" fi newlib_search_path="$newlib_search_path $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" if test "X$duplicate_deps" = "Xyes" ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do case $deplib in -L*) path="$deplib" ;; *.la) dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$deplib" && dir="." # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 absdir="$dir" fi ;; esac if grep "^installed=no" $deplib > /dev/null; then path="$absdir/$objdir" else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` if test -z "$libdir"; then $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi if test "$absdir" != "$libdir"; then $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 fi path="$absdir" fi depdepl= case $host in *-*-darwin*) # we do not want to link against static libs, # but need to link against shared eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names" ; then for tmp in $deplibrary_names ; do depdepl=$tmp done if test -f "$path/$depdepl" ; then depdepl="$path/$depdepl" fi # do not add paths which are already there case " $newlib_search_path " in *" $path "*) ;; *) newlib_search_path="$newlib_search_path $path";; esac fi path="" ;; *) path="-L$path" ;; esac ;; -l*) case $host in *-*-darwin*) # Again, we only want to link against shared libraries eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"` for tmp in $newlib_search_path ; do if test -f "$tmp/lib$tmp_libs.dylib" ; then eval depdepl="$tmp/lib$tmp_libs.dylib" break fi done path="" ;; *) continue ;; esac ;; *) continue ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac case " $deplibs " in *" $depdepl "*) ;; *) deplibs="$depdepl $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs dependency_libs="$newdependency_libs" if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test "$pass" != dlopen; then if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) lib_search_path="$lib_search_path $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) tmp_libs="$tmp_libs $deplib" ;; esac ;; *) tmp_libs="$tmp_libs $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs ; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i="" ;; esac if test -n "$i" ; then tmp_libs="$tmp_libs $i" fi done dependency_libs=$tmp_libs done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$deplibs"; then $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 fi if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 fi if test -n "$rpath"; then $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 fi if test -n "$xrpath"; then $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 fi if test -n "$export_symbols" || test -n "$export_symbols_regex"; then $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 fi # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" objs="$objs$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) if test "$module" = no; then $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 exit $EXIT_FAILURE else $echo $echo "*** Warning: Linking the shared library $output against the non-libtool" $echo "*** objects $objs is not portable!" libobjs="$libobjs $objs" fi fi if test "$dlself" != no; then $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 fi set dummy $rpath if test "$#" -gt 2; then $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 fi install_libdir="$2" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. # Some compilers have problems with a `.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 fi else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 IFS="$save_ifs" if test -n "$8"; then $echo "$modename: too many parameters to \`-version-info'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major="$2" number_minor="$3" number_revision="$4" # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # which has an extra 1 added just for fun # case $version_type in darwin|linux|osf|windows) current=`expr $number_major + $number_minor` age="$number_minor" revision="$number_revision" ;; freebsd-aout|freebsd-elf|sunos) current="$number_major" revision="$number_minor" age="0" ;; irix|nonstopux) current=`expr $number_major + $number_minor - 1` age="$number_minor" revision="$number_minor" ;; esac ;; no) current="$2" revision="$3" age="$4" ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE ;; esac if test "$age" -gt "$current"; then $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 exit $EXIT_FAILURE fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header major=.`expr $current - $age` versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... minor_current=`expr $current + 1` verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current"; ;; irix | nonstopux) major=`expr $current - $age + 1` case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test "$loop" -ne 0; do iface=`expr $revision - $loop` loop=`expr $loop - 1` verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) major=.`expr $current - $age` versuffix="$major.$age.$revision" versuffix2="$major.$age" ;; osf) major=.`expr $current - $age` versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test "$loop" -ne 0; do iface=`expr $current - $loop` loop=`expr $loop - 1` verstring="$verstring:${iface}.0" done # Make executables depend on our current version. verstring="$verstring:${current}.0" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. major=`expr $current - $age` versuffix="-$major" ;; *) $echo "$modename: unknown library version type \`$version_type'" 1>&2 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 exit $EXIT_FAILURE ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring="0.0" ;; esac if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi if test "$mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$echo "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) if test "X$precious_files_regex" != "X"; then if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi removelist="$removelist $p" ;; *) ;; esac done if test -n "$removelist"; then $show "${rm}r $removelist" $run ${rm}r $removelist fi fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then oldlibs="$oldlibs $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` fi # Eliminate all temporary directories. for path in $notinst_path; do lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'` deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'` dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'` done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do temp_xrpath="$temp_xrpath -R$libdir" case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) dlfiles="$dlfiles $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) dlprefiles="$dlprefiles $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework deplibs="$deplibs -framework System" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then deplibs="$deplibs -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $rm conftest.c cat > conftest.c </dev/null` for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null \ | grep " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ | ${SED} 10q \ | $EGREP "$file_magic_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes $echo $echo "*** Warning: linker path does not have real file for library $a_deplib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have" $echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $echo "*** with $libname but no candidates were found. (...for file magic test)" else $echo "*** with $libname and none of the candidates passed a file format test" $echo "*** using a file magic. Last file checked: $potlib" fi fi else # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" fi done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` for a_deplib in $deplibs; do name="`expr $a_deplib : '-l\(.*\)'`" # If $name is empty we are operating on a -L argument. if test -n "$name" && test "$name" != "0"; then if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) newdeplibs="$newdeplibs $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval \\$echo \"$libname_spec\"` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib="$potent_lib" # see symlink-check above in file_magic test if eval $echo \"$potent_lib\" 2>/dev/null \ | ${SED} 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes $echo $echo "*** Warning: linker path does not have real file for library $a_deplib." $echo "*** I have the capability to make that library automatically link in when" $echo "*** you link to this library. But I can only do this if you have a" $echo "*** shared version of the library, which you do not appear to have" $echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $echo "*** with $libname but no candidates were found. (...for regex pattern test)" else $echo "*** with $libname and none of the candidates passed a file format test" $echo "*** using a regex pattern. Last file checked: $potlib" fi fi else # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" fi done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ -e 's/ -[LR][^ ]*//g'` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"` done fi if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \ | grep . >/dev/null; then $echo if test "X$deplibs_check_method" = "Xnone"; then $echo "*** Warning: inter-library dependencies are not supported in this platform." else $echo "*** Warning: inter-library dependencies are not known to be supported." fi $echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes fi ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then $echo $echo "*** Warning: libtool could not satisfy all declared inter-library" $echo "*** dependencies of module $libname. Therefore, libtool will create" $echo "*** a static module, that should work as long as the dlopening" $echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then $echo $echo "*** However, this would only work if libtool was able to extract symbol" $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" $echo "*** not find such a program. So, this module is probably useless." $echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else $echo "*** The inter-library dependencies that have been dropped here will be" $echo "*** automatically added whenever a program is linked with this library" $echo "*** or is declared to -dlopen it." if test "$allow_undefined" = no; then $echo $echo "*** Since this library must not contain undefined symbols," $echo "*** because either the platform does not support them or" $echo "*** it was explicitly requested with -no-undefined," $echo "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" dep_rpath="$dep_rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" if test -n "$hardcode_libdir_flag_spec_ld"; then eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" else eval dep_rpath=\"$hardcode_libdir_flag_spec\" fi fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names realname="$2" shift; shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi if test -z "$dlname"; then dlname=$soname fi lib="$output_objdir/$realname" for link do linknames="$linknames $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then $show "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $run $rm $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" if len=`expr "X$cmd" : ".*"` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then $show "$cmd" $run eval "$cmd" || exit $? skipped_export=false else # The command line is too long to execute in one step. $show "using reloadable object file for export list..." skipped_export=: fi done IFS="$save_ifs" if test -n "$export_symbols_regex"; then $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' $show "$mv \"${export_symbols}T\" \"$export_symbols\"" $run eval '$mv "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) tmp_deplibs="$tmp_deplibs $test_deplib" ;; esac done deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" else gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_extract_archives $gentop $convenience libobjs="$libobjs $func_extract_archives_result" fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" linker_flags="$linker_flags $flag" fi # Make a backup of the uninstalled library when relinking if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise. $echo "creating reloadable object files..." # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output output_la=`$echo "X$output" | $Xsed -e "$basename"` # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= delfiles= last_robj= k=1 output=$output_objdir/$output_la-${k}.$objext # Loop over the list of objects to be linked. for obj in $save_libobjs do eval test_cmds=\"$reload_cmds $objlist $last_robj\" if test "X$objlist" = X || { len=`expr "X$test_cmds" : ".*"` && test "$len" -le "$max_cmd_len"; }; then objlist="$objlist $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. eval concat_cmds=\"$reload_cmds $objlist $last_robj\" else # All subsequent reloadable object files will link in # the last one created. eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\" fi last_robj=$output_objdir/$output_la-${k}.$objext k=`expr $k + 1` output=$output_objdir/$output_la-${k}.$objext objlist=$obj len=1 fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" if ${skipped_export-false}; then $show "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $run $rm $export_symbols libobjs=$output # Append the command to create the export file. eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\" fi # Set up a command to remove the reloadable object files # after they are used. i=0 while test "$i" -lt "$k" do i=`expr $i + 1` delfiles="$delfiles $output_objdir/$output_la-${i}.$objext" done $echo "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs="$IFS"; IFS='~' for cmd in $concat_cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi # Append the command to remove the reloadable object files # to the just-reset $cmds. eval cmds=\"\$cmds~\$rm $delfiles\" fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $? fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; obj) if test -n "$deplibs"; then $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 fi if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 fi if test -n "$rpath"; then $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 fi if test -n "$xrpath"; then $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 fi if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 fi case $output in *.lo) if test -n "$objs$old_deplibs"; then $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 exit $EXIT_FAILURE fi libobj="$output" obj=`$echo "X$output" | $Xsed -e "$lo2o"` ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $run $rm $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\" else gentop="$output_objdir/${obj}x" generated="$generated $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # Create the old-style object. reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" cmds=$reload_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi exit $EXIT_SUCCESS fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $run eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS fi if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" cmds=$reload_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi if test -n "$gentop"; then $show "${rm}r $gentop" $run ${rm}r $gentop fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;; esac if test -n "$vinfo"; then $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 fi if test -n "$release"; then $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 fi if test "$preload" = yes; then if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown && test "$dlopen_self_static" = unknown; then $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." fi fi case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'` finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` ;; esac case $host in *darwin*) # Don't allow lazy linking, it breaks C++ global constructors if test "$tagname" = CXX ; then compile_command="$compile_command ${wl}-bind_at_load" finalize_command="$finalize_command ${wl}-bind_at_load" fi ;; esac compile_command="$compile_command $compile_deplibs" finalize_command="$finalize_command $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) case :$dllsearchpath: in *":$libdir:"*) ;; *) dllsearchpath="$dllsearchpath:$libdir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` fi dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then dlsyms="${outputname}S.c" else $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 fi fi if test -n "$dlsyms"; then case $dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${outputname}.nm" $show "$rm $nlist ${nlist}S ${nlist}T" $run $rm "$nlist" "${nlist}S" "${nlist}T" # Parse the name list into a source file. $show "creating $output_objdir/$dlsyms" test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ #ifdef __cplusplus extern \"C\" { #endif /* Prevent the only kind of declaration conflicts we can make. */ #define lt_preloaded_symbols some_other_symbol /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then $show "generating symbol list for \`$output'" test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` for arg in $progfiles; do $show "extracting global C symbols from \`$arg'" $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' $run eval '$mv "$nlist"T "$nlist"' fi if test -n "$export_symbols_regex"; then $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' $run eval '$mv "$nlist"T "$nlist"' fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$outputname.exp" $run $rm $export_symbols $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' else $run eval "${SED} -e 's/\([ ][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' $run eval 'mv "$nlist"T "$nlist"' fi fi for arg in $dlprefiles; do $show "extracting global C symbols from \`$arg'" name=`$echo "$arg" | ${SED} -e 's%^.*/%%'` $run eval '$echo ": $name " >> "$nlist"' $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" done if test -z "$run"; then # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $mv "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if grep -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else grep -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' else $echo '/* NONE */' >> "$output_objdir/$dlsyms" fi $echo >> "$output_objdir/$dlsyms" "\ #undef lt_preloaded_symbols #if defined (__STDC__) && __STDC__ # define lt_ptr void * #else # define lt_ptr char * # define const #endif /* The mapping between symbol names and symbols. */ " case $host in *cygwin* | *mingw* ) $echo >> "$output_objdir/$dlsyms" "\ /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs */ struct { " ;; * ) $echo >> "$output_objdir/$dlsyms" "\ const struct { " ;; esac $echo >> "$output_objdir/$dlsyms" "\ const char *name; lt_ptr address; } lt_preloaded_symbols[] = {\ " eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms" $echo >> "$output_objdir/$dlsyms" "\ {0, (lt_ptr) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " fi pic_flag_for_symtable= case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) case "$compile_command " in *" -static "*) ;; *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";; esac;; *-*-hpux*) case "$compile_command " in *" -static "*) ;; *) pic_flag_for_symtable=" $pic_flag";; esac esac # Now compile the dynamic symbol file. $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? # Clean up the generated files. $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" # Transform the symbol file into the correct name. compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` ;; *) $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 exit $EXIT_FAILURE ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` fi if test "$need_relink" = no || test "$build_libtool_libs" != yes; then # Replace the output file specification. compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. $show "$link_command" $run eval "$link_command" status=$? # Delete the generated files. if test -n "$dlsyms"; then $show "$rm $output_objdir/${outputname}S.${objext}" $run $rm "$output_objdir/${outputname}S.${objext}" fi exit $status fi if test -n "$shlibpath_var"; then # We should set the shlibpath_var rpath= for dir in $temp_rpath; do case $dir in [\\/]* | [A-Za-z]:[\\/]*) # Absolute path. rpath="$rpath$dir:" ;; *) # Relative path: add a thisdir entry. rpath="$rpath\$thisdir/$dir:" ;; esac done temp_rpath="$rpath" fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do rpath="$rpath$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $run $rm $output # Link the executable and exit $show "$link_command" $run eval "$link_command" || exit $? exit $EXIT_SUCCESS fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 $echo "$modename: \`$output' will be relinked during installation" 1>&2 else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname $show "$link_command" $run eval "$link_command" || exit $? # Now create the wrapper script. $show "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` relink_command="$var=\"$var_value\"; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` fi # Quote $echo for shipping. if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then case $progpath in [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; esac qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` else qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` fi # Only actually do things if our run command is non-null. if test -z "$run"; then # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) cwrappersource=`$echo ${objdir}/lt-${outputname}.c` cwrapper=`$echo ${output}.exe` $rm $cwrappersource $cwrapper trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 cat > $cwrappersource <> $cwrappersource<<"EOF" #include #include #include #include #include #include #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef DIR_SEPARATOR #define DIR_SEPARATOR '/' #endif #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) #define HAVE_DOS_BASED_FILE_SYSTEM #ifndef DIR_SEPARATOR_2 #define DIR_SEPARATOR_2 '\\' #endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) const char *program_name = NULL; void * xmalloc (size_t num); char * xstrdup (const char *string); char * basename (const char *name); char * fnqualify(const char *path); char * strendzap(char *str, const char *pat); void lt_fatal (const char *message, ...); int main (int argc, char *argv[]) { char **newargz; int i; program_name = (char *) xstrdup ((char *) basename (argv[0])); newargz = XMALLOC(char *, argc+2); EOF cat >> $cwrappersource <> $cwrappersource <<"EOF" newargz[1] = fnqualify(argv[0]); /* we know the script has the same name, without the .exe */ /* so make sure newargz[1] doesn't end in .exe */ strendzap(newargz[1],".exe"); for (i = 1; i < argc; i++) newargz[i+1] = xstrdup(argv[i]); newargz[argc+1] = NULL; EOF cat >> $cwrappersource <> $cwrappersource <<"EOF" } void * xmalloc (size_t num) { void * p = (void *) malloc (num); if (!p) lt_fatal ("Memory exhausted"); return p; } char * xstrdup (const char *string) { return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL ; } char * basename (const char *name) { const char *base; #if defined (HAVE_DOS_BASED_FILE_SYSTEM) /* Skip over the disk name in MSDOS pathnames. */ if (isalpha (name[0]) && name[1] == ':') name += 2; #endif for (base = name; *name; name++) if (IS_DIR_SEPARATOR (*name)) base = name + 1; return (char *) base; } char * fnqualify(const char *path) { size_t size; char *p; char tmp[LT_PATHMAX + 1]; assert(path != NULL); /* Is it qualified already? */ #if defined (HAVE_DOS_BASED_FILE_SYSTEM) if (isalpha (path[0]) && path[1] == ':') return xstrdup (path); #endif if (IS_DIR_SEPARATOR (path[0])) return xstrdup (path); /* prepend the current directory */ /* doesn't handle '~' */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal ("getcwd failed"); size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */ p = XMALLOC(char, size); sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path); return p; } char * strendzap(char *str, const char *pat) { size_t len, patlen; assert(str != NULL); assert(pat != NULL); len = strlen(str); patlen = strlen(pat); if (patlen <= len) { str += len - patlen; if (strcmp(str, pat) == 0) *str = '\0'; } return str; } static void lt_error_core (int exit_status, const char * mode, const char * message, va_list ap) { fprintf (stderr, "%s: %s: ", program_name, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, "FATAL", message, ap); va_end (ap); } EOF # we should really use a build-platform specific compiler # here, but OTOH, the wrappers (shell script and this C one) # are only useful if you want to execute the "real" binary. # Since the "real" binary is built for $host, then this # wrapper might as well be built for $host, too. $run $LTCC -s -o $cwrapper $cwrappersource ;; esac $rm $output trap "$rm $output; exit $EXIT_FAILURE" 1 2 15 $echo > $output "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='${SED} -e 1s/^X//' sed_quote_subst='$sed_quote_subst' # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variable: notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$echo are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then echo=\"$qecho\" file=\"\$0\" # Make sure echo works. if test \"X\$1\" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then # Yippee, \$echo works! : else # Restart under the correct shell, and then maybe \$echo will work. exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} fi fi\ " $echo >> $output "\ # Find the directory that this script lives in. thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` done # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then $echo >> $output "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || \\ { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $mkdir \"\$progdir\" else $rm \"\$progdir/\$file\" fi" $echo >> $output "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else $echo \"\$relink_command_output\" >&2 $rm \"\$progdir/\$file\" exit $EXIT_FAILURE fi fi $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $rm \"\$progdir/\$program\"; $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } $rm \"\$progdir/\$file\" fi" else $echo >> $output "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $echo >> $output "\ if test -f \"\$progdir/\$program\"; then" # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $echo >> $output "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` export $shlibpath_var " fi # fixup the dll searchpath if we need to. if test -n "$dllsearchpath"; then $echo >> $output "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi $echo >> $output "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2*) $echo >> $output "\ exec \$progdir\\\\\$program \${1+\"\$@\"} " ;; *) $echo >> $output "\ exec \$progdir/\$program \${1+\"\$@\"} " ;; esac $echo >> $output "\ \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" exit $EXIT_FAILURE fi else # The program doesn't exist. \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2 \$echo \"This script is just a wrapper for \$program.\" 1>&2 $echo \"See the $PACKAGE documentation for more information.\" 1>&2 exit $EXIT_FAILURE fi fi\ " chmod +x $output fi exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$old_deplibs $non_pic_objects" fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_extract_archives $gentop $addlibs oldobjs="$oldobjs $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do $echo "X$obj" | $Xsed -e 's%^.*/%%' done | sort | sort -uc >/dev/null 2>&1); then : else $echo "copying selected object files to avoid basename conflicts..." if test -z "$gentop"; then gentop="$output_objdir/${outputname}x" generated="$generated $gentop" $show "${rm}r $gentop" $run ${rm}r "$gentop" $show "$mkdir $gentop" $run $mkdir "$gentop" status=$? if test "$status" -ne 0 && test ! -d "$gentop"; then exit $status fi fi save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase counter=`expr $counter + 1` case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" $run ln "$obj" "$gentop/$newobj" || $run cp "$obj" "$gentop/$newobj" oldobjs="$oldobjs $gentop/$newobj" ;; *) oldobjs="$oldobjs $obj" ;; esac done fi eval cmds=\"$old_archive_cmds\" if len=`expr "X$cmds" : ".*"` && test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts $echo "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done for obj in $save_oldobjs do oldobjs="$objlist $obj" objlist="$objlist $obj" eval test_cmds=\"$old_archive_cmds\" if len=`expr "X$test_cmds" : ".*"` && test "$len" -le "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj" ; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" objlist= fi done RANLIB=$save_RANLIB oldobjs=$objlist if test "X$oldobjs" = "X" ; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do eval cmd=\"$cmd\" IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" done if test -n "$generated"; then $show "${rm}r$generated" $run ${rm}r$generated fi # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" $show "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` relink_command="$var=\"$var_value\"; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` if test "$hardcode_automatic" = yes ; then relink_command= fi # Only create the output if not a dry run. if test -z "$run"; then for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` if test -z "$libdir"; then $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi newdependency_libs="$newdependency_libs $libdir/$name" ;; *) newdependency_libs="$newdependency_libs $deplib" ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` if test -z "$libdir"; then $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi newdlfiles="$newdlfiles $libdir/$name" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` if test -z "$libdir"; then $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit $EXIT_FAILURE fi newdlprefiles="$newdlprefiles $libdir/$name" done dlprefiles="$newdlprefiles" else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac newdlfiles="$newdlfiles $abs" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac newdlprefiles="$newdlprefiles $abs" done dlprefiles="$newdlprefiles" fi $rm $output # place dlname in correct position for cygwin tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; esac $echo > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test "$need_relink" = yes; then $echo >> $output "\ relink_command=\"$relink_command\"" fi done fi # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? ;; esac exit $EXIT_SUCCESS ;; # libtool install mode install) modename="$modename: install" # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then # Aesthetically quote it. arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` case $arg in *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") arg="\"$arg\"" ;; esac install_prog="$arg " arg="$1" shift else install_prog= arg="$nonopt" fi # The real first argument should be the name of the installation program. # Aesthetically quote it. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") arg="\"$arg\"" ;; esac install_prog="$install_prog$arg" # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= for arg do if test -n "$dest"; then files="$files $dest" dest="$arg" continue fi case $arg in -d) isdir=yes ;; -f) prev="-f" ;; -g) prev="-g" ;; -m) prev="-m" ;; -o) prev="-o" ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then prev= else dest="$arg" continue fi ;; esac # Aesthetically quote the argument. arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in *$quote_scanset* | *]* | *\|* | *\&* | *\(* | *\)* | "") arg="\"$arg\"" ;; esac install_prog="$install_prog $arg" done if test -z "$install_prog"; then $echo "$modename: you must specify an install program" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test -n "$prev"; then $echo "$modename: the \`$prev' option requires an argument" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi if test -z "$files"; then if test -z "$dest"; then $echo "$modename: no file or destination specified" 1>&2 else $echo "$modename: you must specify a destination" 1>&2 fi $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Canonicalise the pathname: # - remove foo/../ # - replace // # - remove /./ # - strip any trailing / tmp="" while test "$dest" != "$tmp"; do tmp=$dest dest=`$echo "X$dest" | $Xsed -e 's%[^/.][^/.]*/\.\.%%g' -e 's%/\./%/%g' -e 's%//*%/%g' -e 's%/$%%g'` done # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` test "X$destdir" = "X$dest" && destdir=. destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` # Not a directory, so check to see that there is only one file specified. set dummy $files if test "$#" -gt 2; then $echo "$modename: \`$dest' is not a directory" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. staticlibs="$staticlibs $file" ;; *.la) # Check to see that this really is a libtool archive. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi library_names= old_library= relink_command= # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) current_libdirs="$current_libdirs $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) future_libdirs="$future_libdirs $libdir" ;; esac fi dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/ test "X$dir" = "X$file/" && dir= dir="$dir$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. if test "$inst_prefix_dir" = "$destdir"; then $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 exit $EXIT_FAILURE fi if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi $echo "$modename: warning: relinking \`$file'" 1>&2 $show "$relink_command" if $run eval "$relink_command"; then : else $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 exit $EXIT_FAILURE fi fi # See the names of the shared library. set dummy $library_names if test -n "$2"; then realname="$2" shift shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. $show "$install_prog $dir/$srcname $destdir/$realname" $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? if test -n "$stripme" && test -n "$striplib"; then $show "$striplib $destdir/$realname" $run eval "$striplib $destdir/$realname" || exit $? fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. for linkname do if test "$linkname" != "$realname"; then $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" fi done fi # Do each command in the postinstall commands. lib="$destdir/$realname" cmds=$postinstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # Install the pseudo-library for information purposes. name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` instname="$dir/$name"i $show "$install_prog $instname $destdir/$name" $run eval "$install_prog $instname $destdir/$name" || exit $? # Maybe install the static library, too. test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` ;; *.$objext) staticdest="$destfile" destfile= ;; *) $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; esac # Install the libtool object if requested. if test -n "$destfile"; then $show "$install_prog $file $destfile" $run eval "$install_prog $file $destfile" || exit $? fi # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` $show "$install_prog $staticobj $staticdest" $run eval "$install_prog \$staticobj \$staticdest" || exit $? fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` destfile="$destdir/$destfile" fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext="" case $file in *.exe) if test ! -f "$file"; then file=`$echo $file|${SED} 's,.exe$,,'` stripped_ext=".exe" fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin*|*mingw*) wrapper=`$echo $file | ${SED} -e 's,.exe$,,'` ;; *) wrapper=$file ;; esac if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then notinst_deplibs= relink_command= # To insure that "foo" is sourced, and not "foo.exe", # finese the cygwin/MSYS system by explicitly sourcing "foo." # which disallows the automatic-append-.exe behavior. case $build in *cygwin* | *mingw*) wrapperdot=${wrapper}. ;; *) wrapperdot=${wrapper} ;; esac # If there is no directory component, then add one. case $file in */* | *\\*) . ${wrapperdot} ;; *) . ./${wrapperdot} ;; esac # Check the variables that should have been set. if test -z "$notinst_deplibs"; then $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2 exit $EXIT_FAILURE fi finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then # If there is no directory component, then add one. case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac fi libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 finalize=no fi done relink_command= # To insure that "foo" is sourced, and not "foo.exe", # finese the cygwin/MSYS system by explicitly sourcing "foo." # which disallows the automatic-append-.exe behavior. case $build in *cygwin* | *mingw*) wrapperdot=${wrapper}. ;; *) wrapperdot=${wrapper} ;; esac # If there is no directory component, then add one. case $file in */* | *\\*) . ${wrapperdot} ;; *) . ./${wrapperdot} ;; esac outputname= if test "$fast_install" = no && test -n "$relink_command"; then if test "$finalize" = yes && test -z "$run"; then tmpdir="/tmp" test -n "$TMPDIR" && tmpdir="$TMPDIR" tmpdir="$tmpdir/libtool-$$" save_umask=`umask` umask 0077 if $mkdir "$tmpdir"; then umask $save_umask else umask $save_umask $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2 continue fi file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'` outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` $show "$relink_command" if $run eval "$relink_command"; then : else $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 ${rm}r "$tmpdir" continue fi file="$outputname" else $echo "$modename: warning: cannot relink \`$file'" 1>&2 fi else # Install the binary that we compiled earlier. file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyways case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'` ;; esac ;; esac $show "$install_prog$stripme $file $destfile" $run eval "$install_prog\$stripme \$file \$destfile" || exit $? test -n "$outputname" && ${rm}r "$tmpdir" ;; esac done for file in $staticlibs; do name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` # Set up the ranlib parameters. oldlib="$destdir/$name" $show "$install_prog $file $oldlib" $run eval "$install_prog \$file \$oldlib" || exit $? if test -n "$stripme" && test -n "$old_striplib"; then $show "$old_striplib $oldlib" $run eval "$old_striplib $oldlib" || exit $? fi # Do each command in the postinstall commands. cmds=$old_postinstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" done if test -n "$future_libdirs"; then $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 fi if test -n "$current_libdirs"; then # Maybe just do a dry run. test -n "$run" && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi ;; # libtool finish mode finish) modename="$modename: finish" libdirs="$nonopt" admincmds= if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for dir do libdirs="$libdirs $dir" done for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. cmds=$finish_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" || admincmds="$admincmds $cmd" done IFS="$save_ifs" fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $run eval "$cmds" || admincmds="$admincmds $cmds" fi done fi # Exit here if they wanted silent mode. test "$show" = : && exit $EXIT_SUCCESS $echo "----------------------------------------------------------------------" $echo "Libraries have been installed in:" for libdir in $libdirs; do $echo " $libdir" done $echo $echo "If you ever happen to want to link against installed libraries" $echo "in a given directory, LIBDIR, you must either use libtool, and" $echo "specify the full pathname of the library, or use the \`-LLIBDIR'" $echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then $echo " - add LIBDIR to the \`$shlibpath_var' environment variable" $echo " during execution" fi if test -n "$runpath_var"; then $echo " - add LIBDIR to the \`$runpath_var' environment variable" $echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $echo " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then $echo " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi $echo $echo "See any operating system documentation about shared libraries for" $echo "more information, such as the ld(1) and ld.so(8) manual pages." $echo "----------------------------------------------------------------------" exit $EXIT_SUCCESS ;; # libtool execute mode execute) modename="$modename: execute" # The first argument is the command name. cmd="$nonopt" if test -z "$cmd"; then $echo "$modename: you must specify a COMMAND" 1>&2 $echo "$help" exit $EXIT_FAILURE fi # Handle -dlopen flags immediately. for file in $execute_dlfiles; do if test ! -f "$file"; then $echo "$modename: \`$file' is not a file" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi dir= case $file in *.la) # Check to see that this really is a libtool archive. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi # Read the libtool library. dlname= library_names= # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" continue fi dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$file" && dir=. if test -f "$dir/$objdir/$dlname"; then dir="$dir/$objdir" else $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 exit $EXIT_FAILURE fi ;; *.lo) # Just add the directory containing the .lo file. dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$file" && dir=. ;; *) $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case $file in -*) ;; *) # Do a test to see if this is really a libtool program. if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` args="$args \"$file\"" done if test -z "$run"; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables if test "${save_LC_ALL+set}" = set; then LC_ALL="$save_LC_ALL"; export LC_ALL fi if test "${save_LANG+set}" = set; then LANG="$save_LANG"; export LANG fi # Now prepare to actually exec the command. exec_cmd="\$cmd$args" else # Display what would be done. if test -n "$shlibpath_var"; then eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" $echo "export $shlibpath_var" fi $echo "$cmd$args" exit $EXIT_SUCCESS fi ;; # libtool clean and uninstall mode clean | uninstall) modename="$modename: $mode" rm="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) rm="$rm $arg"; rmforce=yes ;; -*) rm="$rm $arg" ;; *) files="$files $arg" ;; esac done if test -z "$rm"; then $echo "$modename: you must specify an RM program" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE fi rmdirs= origobjdir="$objdir" for file in $files; do dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` if test "X$dir" = "X$file"; then dir=. objdir="$origobjdir" else objdir="$dir/$origobjdir" fi name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` test "$mode" = uninstall && objdir="$dir" # Remember objdir for removal later, being careful to avoid duplicates if test "$mode" = clean; then case " $rmdirs " in *" $objdir "*) ;; *) rmdirs="$rmdirs $objdir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if (test -L "$file") >/dev/null 2>&1 \ || (test -h "$file") >/dev/null 2>&1 \ || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then . $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do rmfiles="$rmfiles $objdir/$n" done test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" if test "$mode" = uninstall; then if test -n "$library_names"; then # Do each command in the postuninstall commands. cmds=$postuninstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" if test "$?" -ne 0 && test "$rmforce" != yes; then exit_status=1 fi done IFS="$save_ifs" fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. cmds=$old_postuninstall_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $show "$cmd" $run eval "$cmd" if test "$?" -ne 0 && test "$rmforce" != yes; then exit_status=1 fi done IFS="$save_ifs" fi # FIXME: should reinstall the best remaining shared library. fi fi ;; *.lo) # Possibly a libtool object, so verify it. if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then # Read the .lo file . $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" \ && test "$pic_object" != none; then rmfiles="$rmfiles $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" \ && test "$non_pic_object" != none; then rmfiles="$rmfiles $dir/$non_pic_object" fi fi ;; *) if test "$mode" = clean ; then noexename=$name case $file in *.exe) file=`$echo $file|${SED} 's,.exe$,,'` noexename=`$echo $name|${SED} 's,.exe$,,'` # $file with .exe has already been added to rmfiles, # add $file without .exe rmfiles="$rmfiles $file" ;; esac # Do a test to see if this is a libtool program. if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then relink_command= . $dir/$noexename # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then rmfiles="$rmfiles $objdir/lt-$name" fi if test "X$noexename" != "X$name" ; then rmfiles="$rmfiles $objdir/lt-${noexename}.c" fi fi fi ;; esac $show "$rm $rmfiles" $run $rm $rmfiles || exit_status=1 done objdir="$origobjdir" # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then $show "rmdir $dir" $run rmdir $dir >/dev/null 2>&1 fi done exit $exit_status ;; "") $echo "$modename: you must specify a MODE" 1>&2 $echo "$generic_help" 1>&2 exit $EXIT_FAILURE ;; esac if test -z "$exec_cmd"; then $echo "$modename: invalid operation mode \`$mode'" 1>&2 $echo "$generic_help" 1>&2 exit $EXIT_FAILURE fi fi # test -z "$show_help" if test -n "$exec_cmd"; then eval exec $exec_cmd exit $EXIT_FAILURE fi # We need to display help for each of the modes. case $mode in "") $echo \ "Usage: $modename [OPTION]... [MODE-ARG]... Provide generalized library-building support services. --config show all configuration variables --debug enable verbose shell tracing -n, --dry-run display commands without modifying any files --features display basic configuration information and exit --finish same as \`--mode=finish' --help display this help message and exit --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] --quiet same as \`--silent' --silent don't print informational messages --tag=TAG use configuration variables from tag TAG --version print version information MODE must be one of the following: clean remove files from the build directory compile compile a source file into a libtool object execute automatically set library path, then run a program finish complete the installation of libtool libraries install install libraries or executables link create a library or an executable uninstall remove libraries from an installed directory MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for a more detailed description of MODE. Report bugs to ." exit $EXIT_SUCCESS ;; clean) $echo \ "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $echo \ "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -prefer-pic try to building PIC objects only -prefer-non-pic try to building non-PIC objects only -static always build a \`.o' file suitable for static linking COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $echo \ "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $echo \ "Usage: $modename [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $echo \ "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $echo \ "Usage: $modename [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE Use a list of object files found in FILE to specify objects -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -static do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] All other options (arguments beginning with \`-') are ignored. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $echo \ "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) $echo "$modename: invalid operation mode \`$mode'" 1>&2 $echo "$help" 1>&2 exit $EXIT_FAILURE ;; esac $echo $echo "Try \`$modename --help' for more information about other modes." exit $? # The TAGs below are defined such that we never get into a situation # in which we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: gfarm-2.4.1/makes/private-file.mk0000644000000000000000000000160011507222720015323 0ustar rootrootprivate-dir-link: @if test "x$(top_private_dir)" != "x"; then \ tsDir=`(cd $(top_srcdir); /bin/pwd)` ; \ crDir=`/bin/pwd` ; \ tDir=`echo $${crDir} | sed "s:$${tsDir}::"` ; \ $(RM) -f $(private_dir) ; \ ln -s $(top_private_dir)$${tDir} $(private_dir) ; \ fi private-dir-unlink: private-src-unlink @if test -L $(private_dir); then \ $(RM) -f $(private_dir) ; \ fi private-src-link: private-dir-link @if test "x$(PRIVATE_FILES)" != "x"; then \ for i in $(PRIVATE_FILES); do \ if test ! -r ./$${i}; then \ if test -r $(private_dir)/$${i}; then \ ln -s $(private_dir)/$${i} . ; \ fi ; \ fi ; \ done ; \ fi private-src-unlink: @if test "x$(PRIVATE_FILES)" != "x"; then \ for i in $(PRIVATE_FILES); do \ if test -L ./$${i}; then \ $(RM) ./$${i} ; \ fi ; \ done ; \ fi private-initialize: private-src-link private-finalize: private-dir-unlink gfarm-2.4.1/makes/catalog.mk0000644000000000000000000000214511507222720014353 0ustar rootrootall: catalog-all post-all-hook install: catalog-install post-install-hook clean: catalog-clean post-clean-hook veryclean: catalog-veryclean post-very-clean-hook distclean: catalog-distclean post-distclean-hook gfregister: catalog-gfregister post-gfregister-hook man: gflog-man html: gflog-html msgno: catalog-msgno catalog: catalog-catalog post-all-hook: post-install-hook: post-clean-hook: post-very-clean-hook: post-distclean-hook: post-gfregister-hook: catalog-all: catalog-catalog catalog-install: @$(MKDIR_P) $(DESTDIR)$(localedir)/$(LOCALE) @for i in -- $(CATALOG_FILES); do \ case $$i in --) continue;; esac; \ echo \ $(INSTALL_DATA) $$i $(DESTDIR)$(localedir)/$(LOCALE); \ $(INSTALL_DATA) $$i $(DESTDIR)$(localedir)/$(LOCALE); \ done catalog-clean: -test -z "$(EXTRA_CLEAN_TARGETS)" || $(RM) -f $(EXTRA_CLEAN_TARGETS) catalog-veryclean: clean -test -z "$(EXTRA_VERYCLEAN_TARGETS)" || $(RM) -f $(EXTRA_VERYCLEAN_TARGETS) catalog-distclean: veryclean -test ! -f $(srcdir)/Makefile.in || $(RM) -f Makefile catalog-gfregister: catalog-man: catalog-html: catalog-msgno: catalog-catalog: $(CATALOG_FILES) gfarm-2.4.1/makes/gflog.mk0000644000000000000000000000012711507222720014035 0ustar rootrootmsgno: assign_msgno assign_msgno: GFARM_TOPDIR=$(top_srcdir) $(ASSIGNMSGNO) $(SRCS); gfarm-2.4.1/makes/var.mk0000644000000000000000000000552211507222720013533 0ustar rootrootVPATH=$(srcdir) include $(top_builddir)/makes/config.mk ja_mandir = $(default_mandir)/ja # example_bindir = $(default_bindir)/example example_bindir = $(default_bindir) metadb_client_includes = $(ldap_includes) $(postgresql_includes) metadb_client_libs = $(ldap_libs) $(postgresql_libs) SHELL = /bin/sh RM = rm GENCAT = gencat # gflog ASSIGNMSGNO=$(top_srcdir)/makes/assign_msgno.pl # library to be installed, see lib.mk LIBRARY_RESULT = $(LIBRARY) # libgfarm # COMPAT_GFARM_2_3 - enable protocols which were deprecated in 2.4.0 COMMON_CFLAGS = $(OPTFLAGS) $(largefile_cflags) \ -I$(top_builddir)/include -I$(top_srcdir)/include \ -DCOMPAT_GFARM_2_3 COMMON_LDFLAGS = $(largefile_ldflags) GFARMLIB = -L$(top_builddir)/lib/libgfarm -lgfarm \ $(globus_gssapi_libs) $(openssl_libs) INC_SRCDIR = $(top_srcdir)/include/gfarm INC_BUILDDIR = $(top_builddir)/include/gfarm DEPGFARMLIB = $(top_builddir)/lib/libgfarm/libgfarm.la DEPGFARMINC = $(INC_BUILDDIR)/gfarm_config.h $(INC_SRCDIR)/gfarm.h $(INC_SRCDIR)/gflog.h $(INC_SRCDIR)/error.h $(INC_SRCDIR)/gfarm_misc.h $(INC_SRCDIR)/gfarm_stringlist.h $(INC_SRCDIR)/gfs.h $(INC_SRCDIR)/gfs_glob.h # ns NS_COMMON_CFLAGS = $(OPTFLAGS) $(largefile_cflags) \ -I$(top_builddir)/include \ -I$(top_builddir)/ns/include -I$(top_srcdir)/ns/include NSLIB = -L$(top_builddir)/ns/nslib -lns NSEXECLIB = -L$(top_builddir)/ns/nslib -lnsexec NSINC_SRCDIR = $(top_srcdir)/ns/include/gfarm NSINC_BUILDDIR = $(top_builddir)/ns/include/gfarm GFD_SRCDIR = $(top_srcdir)/ns/gfarmd DEPNSLIB = $(top_builddir)/ns/nslib/libns.la DEPNSEXECLIB = $(top_builddir)/ns/nslib/libnsexec.la # gfsl GFSL_SRCDIR = $(top_srcdir)/lib/libgfarm/gfsl DEPGFSLINC = $(GFSL_SRCDIR)/gfarm_auth.h $(GFSL_SRCDIR)/gfarm_gsi.h $(GFSL_SRCDIR)/gfarm_secure_session.h # libgfarm internal interface GFUTIL_SRCDIR = $(top_srcdir)/lib/libgfarm/gfutil GFARMLIB_SRCDIR = $(top_srcdir)/lib/libgfarm/gfarm # doc & man DOCBOOK2MAN = jw -b man DOCBOOK2HTML = jw -b html -u srcsubst = dummy dstsubst = dummy # libtool LTFLAGS_SHARELIB_IN = -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) -rpath CCLD = $(CC) LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) LTLINK = $(LIBTOOL) --mode=link $(CCLD) $(CFLAGS) $(LTLDFLAGS) $(LDFLAGS) -o $@ LTCLEAN = $(LIBTOOL) --mode=clean $(RM) -f # the use of the following operations should honor $(DESTDIR) LTINSTALL_PROGRAM = $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) LTINSTALL_LIBRARY = $(LIBTOOL) --mode=install $(INSTALL_DATA) # private src private_dir = ./private .SUFFIXES: .a .la .ln .o .lo .s .S .c .cc .f .y .l .msg .cat .c.lo: $(LTCOMPILE) -c $(srcdir)/$*.c .s.lo: $(LTCOMPILE) -c $(srcdir)/$*.s .S.lo: $(LTCOMPILE) -c $(srcdir)/$*.S .msg.cat: cat $(srcdir)/$*.msg | $(CPP) $(CFLAGS) - 2>/dev/null | \ grep '^[0-9$$]' > tmp$$$$.msg; \ LC_ALL=$(LOCALE) $(GENCAT) $@ tmp$$$$.msg; rv=$$?; \ rm tmp$$$$.msg; \ exit $${rv} gfarm-2.4.1/makes/.msgno0000644000000000000000000000000711507222720013527 0ustar rootroot1002518gfarm-2.4.1/makes/private-subdir.mk0000644000000000000000000000124311507222720015677 0ustar rootrootprivate-dir-tree-link: @if test "x${top_private_dir}" != "x"; then \ tsDir=`(cd $(top_srcdir); /bin/pwd)` ; \ crDir=`/bin/pwd` ; \ tDir=`echo $${crDir} | sed "s:$${tsDir}::"` ; \ if test "x${PRIVATE_TARGETS}" != "x"; then \ for i in ${PRIVATE_TARGETS}; do \ if test ! -d ./$${i}; then \ mkdir ./$${i}; \ fi; \ lndir ${top_private_dir}$${tDir}/$${i} "`/bin/pwd`"/$${i}; \ done ; \ fi; \ fi private-dir-tree-remove: @if test "x${top_private_dir}" != "x"; then \ if test "x${PRIVATE_TARGETS}" != "x"; then \ for i in ${PRIVATE_TARGETS}; do \ if test -d ./$${i}; then \ $(RM) -rf ./$${i}; \ fi ; \ done ; \ fi ; \ fi gfarm-2.4.1/makes/subdir.mk0000644000000000000000000000353511507222720014235 0ustar rootrootall: private-dir-tree-link subdir-all post-all-hook install: subdir-install post-install-hook clean: subdir-clean post-clean-hook veryclean: subdir-veryclean post-very-clean-hook distclean: subdir-distclean subdir-distclean-here post-distclean-hook gfregister: subdir-gfregister post-gfregister-hook man: subdir-man html: subdir-html msgno: subdir-msgno catalog: subdir-catalog include $(top_srcdir)/makes/private-subdir.mk post-all-hook: post-install-hook: post-clean-hook: post-very-clean-hook: post-distclean-hook: private-dir-tree-remove post-gfregister-hook: # The reason why assignments of $(top_srcdir) and $(srcdir) are needed # for Makefile.in case too is to prevent variable-inheritance caused by # non Makefile.in case. subdir-all subdir-install subdir-clean subdir-veryclean subdir-distclean subdir-gfregister subdir-man subdir-html subdir-msgno subdir-catalog: @target=`expr $@ : 'subdir-\(.*\)'`; \ for dir in -- $(SUBDIRS); do \ case $${dir} in --) continue;; esac; \ echo '[' making $${dir} ']'; \ case $(top_srcdir) in \ /*) top_srcdir=$(top_srcdir); \ srcdir=$(srcdir)/$${dir};; \ *) rel=`echo $${dir}|sed 's|[^/][^/]*|..|g'`; \ top_srcdir=$${rel}/$(top_srcdir); \ srcdir=$${rel}/$(srcdir)/$${dir};; \ esac; \ if test -f $(srcdir)/$${dir}/Makefile.in; then \ ( cd $${dir} && \ case "$(srcdir)" in \ .) $(MAKE) $${target};;\ *) $(MAKE) top_srcdir=$${top_srcdir} \ srcdir=$${srcdir} \ $${target};; \ esac; \ ) || exit 1; \ else \ test -d $${dir} || mkdir -p $${dir} || exit 1; \ ( cd $${dir} && \ case "$(srcdir)" in \ .) $(MAKE) $${target};;\ *) $(MAKE) -f $${srcdir}/Makefile \ top_srcdir=$${top_srcdir} \ srcdir=$${srcdir} \ $${target};; \ esac; \ ) || exit 1; \ fi; \ done subdir-distclean-here: -test ! -f $(srcdir)/Makefile.in || $(RM) -f Makefile gfarm-2.4.1/makes/assign_msgno.pl0000755000000000000000000000304611507222720015440 0ustar rootroot#!/usr/bin/perl -w # # catgets() mesasge number assignment tool # use File::Temp qw/ :mktemp /; $gfarmtopdir=$ENV{"GFARM_TOPDIR"}; $number_file="$gfarmtopdir/makes/.msgno"; $msgno_base=1000000; $msgno_used=0; $msgno_orig=0; $header_file="$gfarmtopdir/include/gfarm/gfarm_msg_enums.h"; sub assign_msgno { my($file, $current) = @_; my($count) = 0; open(IN, $file); ($OUT, $tmpfile) = mkstemp("/tmp/assign_msgno.XXXXXX"); while ($line = ) { $msg_str = sprintf("GFARM_MSG_%07d", $current + $count + 1); if ($line =~ s/GFARM_MSG_UNFIXED/$msg_str/) { $count++; } print $OUT $line; } close(IN); close(OUT); if ($count != 0) { system("mv $tmpfile $file"); printf("replaced %d messages in file: %s\n", $count, $file); } else { unlink($tmpfile); } return $current + $count; } sub append_header { my($from, $to) = @_; open(HDROUT, ">>$header_file"); for ($i = $from; $i <= $to; $i++) { $hdr_str = sprintf("#define GFARM_MSG_%07d\t%07d\n", $i, $i); print HDROUT $hdr_str; } close(HDROUT); } # main if (-e $number_file) { $msgno_used=`cat $number_file`; } else { print "message number file initialized, because $number_file not found\n"; $msgno_used=$msgno_base; } $msgno_orig=$msgno_used; foreach $f (@ARGV) { chomp($f); $msgno_used = assign_msgno($f, $msgno_used); } if ($msgno_used != $msgno_orig) { append_header($msgno_orig + 1, $msgno_used); open(OUT, ">$number_file"); printf OUT $msgno_used; close(OUT); printf("max msgno is now %d.\n", $msgno_used); printf("don't forget to commit $number_file file.\n"); } gfarm-2.4.1/makes/install-doc.in0000755000000000000000000000147111507222720015155 0ustar rootroot#!/bin/sh case $# in 2) :;; *) echo "Usage: $0 " >&2 exit 1;; esac src=$1 dst=$2 prefix="@prefix@" exec_prefix="@exec_prefix@" libdir="@libdir@" sysconfdir="@sysconfdir@" globus_flavor="@globus_flavor@" # If Globus is not configured, use "gcc32" for documentation purpose. : ${globus_flavor:="gcc32"} INSTALL="@abs_top_srcdir@/makes/install-sh -c" tmpfile=/tmp/insttmp.$$ status=1 trap 'rm -f $tmpfile; exit $status' 0 1 2 15 if grep '%%' "$src" >/dev/null; then sed -e "s|%%PREFIX%%|$prefix|g" \ -e "s|%%EXEC_PREFIX%%|$exec_prefix|g" \ -e "s|%%SYSCONFDIR%%|$sysconfdir|g" \ -e "s|%%LIBDIR%%|$libdir|g" \ -e "s|%%GLOBUS_FLAVOR%%|$globus_flavor|g" \ $src >$tmpfile @INSTALL_DATA@ "$tmpfile" "$dst" status=$? rm -f $tmpfile else @INSTALL_DATA@ "$src" "$dst" status=$? fi gfarm-2.4.1/makes/make.sh0000755000000000000000000000263111507222720013664 0ustar rootroot#!/bin/sh # It isn't possible to simply invoke "make" on directories which don't # have Makefile.in, if builddir is different from srcdir. # This script can be used as an alternative of "make" on such situation. : ${MAKE=make} if [ -f Makefile ]; then exec ${MAKE} ${1+"$@"} fi # search ${top_builddir} - use sub shell to keep current directory top_builddir=`sh -c ' top_builddir=.; while if pwd | grep ^/\$ >/dev/null; then echo '"$0"': cannot find \\${top_builddir} >&2; exit 1; fi; if [ -f Makefile -a -d makes -a -d gfptool ]; then false; else :; fi; do top_builddir=${top_builddir}/..; cd ..; done; echo ${top_builddir} '` case ${top_builddir} in '') exit 1;; .) :;; *) top_builddir="`echo ${top_builddir} | sed 's|^./||'`";; esac # search ${top_srcdir} top_srcdir=`sed -n 's/^top_srcdir *= *//p' ${top_builddir}/Makefile` # search ${srcdir} top_builddir_abspath=`cd ${top_builddir} && pwd` curdir=`pwd | sed "s|^${top_builddir_abspath}/||"` srcdir=${top_srcdir}/${curdir} case ${top_srcdir} in /*) :;; *) # ${top_srcdir} and ${srcdir} are relative paths? top_srcdir=${top_builddir}/${top_srcdir} srcdir=${top_builddir}/${srcdir} ;; esac # echo top_builddir = ${top_builddir} # echo top_srcdir = ${top_srcdir} # echo srcdir = ${srcdir} if [ -f ${srcdir}/Makefile.in ]; then exec ${MAKE} ${1+"$@"} else exec ${MAKE} -f ${srcdir}/Makefile \ top_srcdir=${top_srcdir} \ srcdir=${srcdir} \ ${1+"$@"} fi gfarm-2.4.1/makes/lib.mk0000644000000000000000000000230711507222720013507 0ustar rootrootinstall: all lib-install post-install-hook clean: lib-clean post-clean-hook veryclean: lib-veryclean post-veryclean-hook distclean: lib-distclean post-distclean-hook gfregister: lib-gfregister post-gfregister-hook man: lib-man post-man-hook html: lib-html post-html-hook msgno: lib-msgno include $(top_srcdir)/makes/private-file.mk post-install-hook: post-clean-hook: post-veryclean-hook: post-distclean-hook: post-gfregister-hook: post-man-hook: post-html-hook: $(LIBRARY): $(OBJS) $(DEPLIBS) $(LTLINK) $(OBJS) $(LDLIBS) lib-install: @$(MKDIR_P) $(DESTDIR)$(libdir) @for i in -- $(LIBRARY_RESULT); do \ case $$i in --) continue;; esac; \ echo \ $(LTINSTALL_LIBRARY) $$i $(DESTDIR)$(libdir)/$$i; \ $(LTINSTALL_LIBRARY) $$i $(DESTDIR)$(libdir)/$$i; \ done lib-clean: -$(LTCLEAN) $(OBJS) $(EXTRA_CLEAN_TARGETS) lib-veryclean: clean private-finalize -test -z "$(EXTRA_VERYCLEAN_TARGETS)" || $(LTCLEAN) $(EXTRA_VERYCLEAN_TARGETS) -test -z "$(LIBRARY)" || $(LTCLEAN) $(LIBRARY) -test -z "$(LIBRARY_RESULT)" || $(LTCLEAN) $(LIBRARY_RESULT) lib-distclean: veryclean -test ! -f $(srcdir)/Makefile.in || $(RM) -f Makefile lib-gfregister: lib-man: lib-html: lib-msgno: $(PRIVATE_FILES): private-initialize gfarm-2.4.1/makes/mkdirhier0000755000000000000000000000176611507222720014324 0ustar rootroot#!/bin/sh # $Xorg: mkdirhier.sh,v 1.3 2000/08/17 19:41:53 cpqbld Exp $ # Courtesy of Paul Eggert newline=' ' IFS=$newline case ${1--} in -*) echo >&2 "mkdirhier: usage: mkdirhier directory ..."; exit 1 esac status= for directory do case $directory in '') echo >&2 "mkdirhier: empty directory name" status=1 continue;; *"$newline"*) echo >&2 "mkdirhier: directory name contains a newline: \`\`$directory''" status=1 continue;; ///*) prefix=/;; # See Posix 2.3 "path". //*) prefix=//;; /*) prefix=/;; -*) prefix=./;; *) prefix= esac IFS=/ set x $directory case $2 in */*) # IFS parsing is broken IFS=' ' set x `echo $directory | tr / ' '` ;; esac IFS=$newline shift for filename do path=$prefix$filename prefix=$path/ shift test -d "$path" || { paths=$path for filename do if [ "$filename" != "." ]; then path=$path/$filename paths=$paths$newline$path fi done mkdir $paths || status=$? break } done done exit $status gfarm-2.4.1/makes/html.mk0000644000000000000000000000271411507222720013707 0ustar rootrootall: html-all post-all-hook install: html-install post-install-hook clean: html-clean post-clean-hook veryclean: html-veryclean post-very-clean-hook distclean: html-distclean post-distclean-hook gfregister: html-gfregister post-gfregister-hook man: html-man html: html-html msgno: html-msgno catalog: html-catalog post-all-hook: post-install-hook: post-clean-hook: post-very-clean-hook: post-distclean-hook: post-gfregister-hook: html-all: html-install: @$(MKDIR_P) $(DESTDIR)$(htmldir) @for i in -- $(HTML); do \ case $$i in --) continue;; esac; \ echo \ $(INSTALL_DOC) $(srcdir)/$${i} $(DESTDIR)$(htmldir)/$${i}; \ $(INSTALL_DOC) $(srcdir)/$${i} $(DESTDIR)$(htmldir)/$${i}; \ done @for i in -- $(HTMLSRC); do \ case $$i in --) continue;; esac; \ echo \ $(INSTALL_DOC) $(srcdir)/$${i}.html \ $(DESTDIR)$(htmldir)/$${i}.html; \ $(INSTALL_DOC) $(srcdir)/$${i}.html \ $(DESTDIR)$(htmldir)/$${i}.html; \ done html-clean: -test -z "$(EXTRA_CLEAN_TARGETS)" || $(RM) -f $(EXTRA_CLEAN_TARGETS) html-veryclean: clean -test -z "$(EXTRA_VERYCLEAN_TARGETS)" || $(RM) -f $(EXTRA_VERYCLEAN_TARGETS) html-distclean: veryclean -test ! -f $(srcdir)/Makefile.in || $(RM) -f Makefile html-gfregister: html-man: $(dstsubst): $(srcsubst) $(DOCBOOK2HTML) $(srcsubst) html-html: for i in -- $(HTMLSRC); do \ case $$i in --) continue;; esac; \ $(MAKE) srcsubst=$(DOCBOOK_DIR)/$${i}.docbook \ dstsubst=$${i}.html $${i}.html; \ done html-msgno: html-catalog: gfarm-2.4.1/makes/prog.mk0000644000000000000000000000175011507222720013711 0ustar rootrootinstall: all prog-install post-install-hook clean: prog-clean post-clean-hook veryclean: prog-veryclean post-veryclean-hook distclean: prog-distclean post-distclean-hook gfregister: prog-gfregister post-gfregister-hook man: prog-man post-man-hook html: prog-html post-html-hook msgno: prog-msgno catalog: prog-catalog include $(top_srcdir)/makes/private-file.mk post-install-hook: post-clean-hook: post-veryclean-hook: post-distclean-hook: post-gfregister-hook: post-man-hook: post-html-hook: $(PROGRAM): $(OBJS) $(DEPLIBS) $(LTLINK) $(OBJS) $(LDLIBS) prog-install: @$(MKDIR_P) $(DESTDIR)$(bindir) $(LTINSTALL_PROGRAM) $(PROGRAM) $(DESTDIR)$(bindir)/$(PROGRAM) prog-clean: -$(LTCLEAN) $(OBJS) $(EXTRA_CLEAN_TARGETS) prog-veryclean: clean private-finalize -$(LTCLEAN) $(PROGRAM) $(EXTRA_VERYCLEAN_TARGETS) prog-distclean: veryclean -test ! -f $(srcdir)/Makefile.in || $(RM) -f Makefile prog-gfregister: prog-man: prog-html: prog-msgno: prog-catalog: $(PRIVATE_FILES): private-initialize gfarm-2.4.1/makes/install-sh0000755000000000000000000001124311507222720014413 0ustar rootroot#!/bin/sh # # install - install a program, script, or datafile # This comes from X11R5. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. # # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" tranformbasename="" transform_arg="" instcmd="$mvprog" chmodcmd="$chmodprog 0755" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" dir_arg="" while [ x"$1" != x ]; do case $1 in -c) instcmd="$cpprog" shift continue;; -d) dir_arg=true shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd="$stripprog" shift continue;; -t=*) transformarg=`echo $1 | sed 's/-t=//'` shift continue;; -b=*) transformbasename=`echo $1 | sed 's/-b=//'` shift continue;; *) if [ x"$src" = x ] then src=$1 else # this colon is to work around a 386BSD /bin/sh bug : dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "install: no input file specified" exit 1 else true fi if [ x"$dir_arg" != x ]; then dst=$src src="" if [ -d $dst ]; then instcmd=: else instcmd=mkdir fi else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if [ -f $src -o -d $src ] then true else echo "install: $src does not exist" exit 1 fi if [ x"$dst" = x ] then echo "install: no destination specified" exit 1 else true fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d $dst ] then dst="$dst"/`basename $src` else true fi fi ## this sed command emulates the dirname command dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # this part is taken from Noah Friedman's mkinstalldirs script # Skip lots of stat calls in the usual case. if [ ! -d "$dstdir" ]; then defaultIFS=' ' IFS="${IFS-${defaultIFS}}" oIFS="${IFS}" # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` IFS="${oIFS}" pathcomp='' while [ $# -ne 0 ] ; do pathcomp="${pathcomp}${1}" shift if [ ! -d "${pathcomp}" ] ; then $mkdirprog "${pathcomp}" else true fi pathcomp="${pathcomp}/" done fi if [ x"$dir_arg" != x ] then $doit $instcmd $dst && if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi else # If we're going to rename the final executable, determine the name now. if [ x"$transformarg" = x ] then dstfile=`basename $dst` else dstfile=`basename $dst $transformbasename | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename if [ x"$dstfile" = x ] then dstfile=`basename $dst` else true fi # Make a temp file name in the proper directory. dsttmp=$dstdir/#inst.$$# # Move or copy the file name to the temp name $doit $instcmd $src $dsttmp && trap "rm -f ${dsttmp}" 0 && # and set any options; do chmod last to preserve setuid bits # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $instcmd $src $dsttmp" command. if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && # Now rename the file to the real destination. $doit $rmcmd -f $dstdir/$dstfile && $doit $mvcmd $dsttmp $dstdir/$dstfile fi && exit 0 gfarm-2.4.1/makes/script.mk0000644000000000000000000000231611507222720014245 0ustar rootrootall: script-all post-all-hook install: all script-install post-install-hook clean: script-clean post-clean-hook veryclean: script-veryclean post-veryclean-hook distclean: script-distclean post-distclean-hook gfregister: script-gfregister post-gfregister-hook man: script-man post-man-hook html: script-html post-html-hook msgno: script-msgno catalog: script-catalog include $(top_srcdir)/makes/private-file.mk post-all-hook: post-install-hook: post-clean-hook: post-veryclean-hook: post-distclean-hook: post-gfregister-hook: post-man-hook: post-html-hook: script-all: script-install: @$(MKDIR_P) $(DESTDIR)$(bindir) @for i in -- $(SCRIPTS); do \ case $$i in --) continue;; esac; \ echo \ $(INSTALL_SCRIPT) $$i $(DESTDIR)$(bindir)/`basename $$i`; \ $(INSTALL_SCRIPT) $$i $(DESTDIR)$(bindir)/`basename $$i`; \ done script-clean: -test -z "$(EXTRA_CLEAN_TARGETS)" || $(RM) -f $(EXTRA_CLEAN_TARGETS) script-veryclean: clean private-finalize -test -z "$(EXTRA_VERYCLEAN_TARGETS)" || $(RM) -f $(EXTRA_VERYCLEAN_TARGETS) script-distclean: veryclean -test ! -f $(srcdir)/Makefile.in || $(RM) -f Makefile script-gfregister: script-man: script-html: script-msgno: script-catalog: $(PRIVATE_FILES): private-initialize gfarm-2.4.1/makes/include.mk0000644000000000000000000000263511507222720014370 0ustar rootrootall: include-all post-all-hook install: all include-install post-install-hook clean: include-clean post-clean-hook veryclean: include-veryclean post-veryclean-hook distclean: include-distclean post-distclean-hook gfregister: include-gfregister post-gfregister-hook man: include-man post-man-hook html: include-html post-html-hook msgno: include-msgno catalog: include-catalog post-all-hook: post-install-hook: post-clean-hook: post-veryclean-hook: post-distclean-hook: post-gfregister-hook: post-man-hook: post-html-hook: include-all: include-install: all @$(MKDIR_P) $(DESTDIR)$(includedir) $(DESTDIR)$(exec_includedir) @for i in -- $(INCS); do \ case $$i in --) continue;; esac; \ echo \ $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(includedir)/$$i; \ $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(includedir)/$$i; \ done @for i in -- $(EXEC_INCS); do \ case $$i in --) continue;; esac; \ echo \ $(INSTALL_DATA) $$i $(DESTDIR)$(exec_includedir)/$$i; \ $(INSTALL_DATA) $$i $(DESTDIR)$(exec_includedir)/$$i; \ done include-clean: -test -z "$(EXTRA_CLEAN_TARGETS)" || $(RM) -f $(EXTRA_CLEAN_TARGETS) include-veryclean: clean -test -z "$(EXTRA_VERYCLEAN_TARGETS)" || $(RM) -f $(EXTRA_VERYCLEAN_TARGETS) include-distclean: veryclean -test -z "$(EXEC_INCS)" || $(RM) -f $(EXEC_INCS) -test ! -f $(srcdir)/Makefile.in || $(RM) -f Makefile include-gfregister: include-man: include-html: include-msgno: include-catalog: gfarm-2.4.1/makes/config.guess0000755000000000000000000012475311507222720014742 0ustar rootroot#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. timestamp='2005-08-03' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Per Bothner . # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you # don't specify an explicit build system type. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep __ELF__ >/dev/null then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerppc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm:riscos:*:*|arm:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[45]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep __LP64__ >/dev/null then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; i*:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; x86:Interix*:[34]*) echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' exit ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit ;; crisv32:Linux:*:*) echo crisv32-axis-linux-gnu exit ;; frv:Linux:*:*) echo frv-unknown-linux-gnu exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; mips:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips #undef mipsel #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mipsel #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips64 #undef mips64el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mips64el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips64 #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) echo or32-unknown-linux-gnu exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent # problems with other programs or directories called `ld' in the path. # Set LC_ALL=C to ensure ld outputs messages in English. ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ | sed -ne '/supported targets:/!d s/[ ][ ]*/ /g s/.*supported targets: *// s/ .*// p'` case "$ld_supported_targets" in elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" exit ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. echo "${UNAME_MACHINE}-pc-linux-gnuoldld" exit ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include #ifdef __ELF__ # ifdef __GLIBC__ # if __GLIBC__ >= 2 LIBC=gnu # else LIBC=gnulibc1 # endif # else LIBC=gnulibc1 # endif #else #ifdef __INTEL_COMPILER LIBC=gnu #else LIBC=gnuaout #endif #endif #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` test x"${LIBC}" != x && { echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit } test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i386. echo i386-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in *86) UNAME_PROCESSOR=i686 ;; unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: gfarm-2.4.1/makes/config.mk.in0000644000000000000000000001025111507222720014610 0ustar rootrootprefix = @prefix@ exec_prefix = @exec_prefix@ # save default for reference from where installation directory is overridden. default_sbindir = @sbindir@ default_bindir = @bindir@ default_libdir = @libdir@ default_libexecdir = @libexecdir@ default_includedir = @includedir@ default_exec_includedir = @includedir@ default_datadir = @datadir@ default_mandir = @mandir@ default_docdir = $(default_datadir)/doc/gfarm default_htmldir = $(default_docdir)/html default_sysconfdir= @sysconfdir@ default_localedir = @localedir@ sbindir = $(default_sbindir) bindir = $(default_bindir) libdir = $(default_libdir) libexecdir = $(default_libexecdir) includedir = $(default_includedir) exec_includedir = $(default_exec_includedir) datadir = $(default_datadir) mandir = $(default_mandir) docdir = $(default_docdir) htmldir = $(default_htmldir) sysconfdir = $(default_sysconfdir) localedir = $(default_localedir) CC = @CC@ OPTFLAGS = @CFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ YACC = @YACC@ RANLIB = @RANLIB@ LIBTOOL = @LIBTOOL@ # the use of the following operations should honor $(DESTDIR) MKDIR_P = @MKDIR_P@ # We don't use "@INSTALL@" here, since we want absolute pathname # instead of relative pathname for the case that install-sh is selected. # XXX this isn't efficient on platforms which have working /usr/bin/install. INSTALL = $(top_srcdir)/makes/install-sh -c INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_DOC = sh $(top_builddir)/makes/install-doc LIBS = @LIBS@ $(pthread_libs) largefile_cflags = @largefile_cflags@ largefile_ldflags = @largefile_ldflags@ # `getconf LFS_LIBS` is already added to $(LIBS) # for conditional compilation which depends on _LARGEFILE64_SOURCE API largefile64_srcs = @largefile64_srcs@ largefile64_objs = @largefile64_objs@ largefile64_cflags = @largefile64_cflags@ largefile64_targets = @largefile64_targets@ pthread_includes = @pthread_includes@ pthread_libs = @pthread_libs@ # for conditional compilation which depends on whether pthread is enabled or not pthread_srcs = @pthread_srcs@ pthread_objs = @pthread_objs@ pthread_cflags = @pthread_cflags@ pthread_targets = @pthread_targets@ openssl_includes = @openssl_includes@ openssl_libs = @openssl_libs@ globus_flavor = @globus_flavor@ globus_location = @globus_location@ globus_includes = @globus_includes@ globus_gssapi_libs = @globus_gssapi_libs@ # for conditional compilation which depends on whether globus is enabled or not globus_srcs = @globus_srcs@ globus_objs = @globus_objs@ globus_cflags = @globus_cflags@ globus_targets = @globus_targets@ # for conditional compilation related to syscall hooking library gfshook_srcs = @gfshook_srcs@ gfshook_objs = @gfshook_objs@ gfshook_cflags = @gfshook_cflags@ gfshook_targets = @gfshook_targets@ MPICC = @mpicc@ # for conditional compilation which depends on whether MPI is enabled or not mpi_srcs = @mpi_srcs@ mpi_objs = @mpi_objs@ mpi_cflags = @mpi_cflags@ mpi_targets = @mpi_targets@ readline_includes = @readline_includes@ readline_libs = @readline_libs@ ldap_includes = @ldap_includes@ ldap_libs = @ldap_libs@ # for conditional compilation which depends on whether LDAP is enabled or not ldap_srcs = @ldap_srcs@ ldap_objs = @ldap_objs@ ldap_cflags = @ldap_cflags@ ldap_targets = @ldap_targets@ postgresql_includes = @postgresql_includes@ postgresql_libs = @postgresql_libs@ # for conditional compilation which depends on whether PostgreSQL is enabled or not postgresql_srcs = @postgresql_srcs@ postgresql_objs = @postgresql_objs@ postgresql_cflags = @postgresql_cflags@ postgresql_targets = @postgresql_targets@ # build lib/gfs_hook/sysdep/$(gfs_hook_sysdep_subdir) gfs_hook_sysdep_subdir = @gfs_hook_sysdep_subdir@ # build gftool/config-gfarm/sysdep/$(config_gfarm_sysdep_subdir) config_gfarm_sysdep_subdir = @config_gfarm_sysdep_subdir@ # build gftool/gfvoms-sync gfvoms_sync_targets = @gfvoms_sync_targets@ # private functions top_private_dir = @top_private_dir@ # optional function configuration optional_config = @optional_config@ # optional functions optional_rule = @optional_rule@ optional_srcs = @optional_srcs@ optional_objs = @optional_objs@ optional_cflags = @optional_cflags@ optional_targets = @optional_targets@ include $(optional_config) gfarm-2.4.1/INSTALL.ja0000644000000000000000000000650111507222727012741 0ustar rootroot[This is written in Japanese, please look at INSTALL.en for English version.] =============================== ¥½¡¼¥¹¥³¡¼¥É¤«¤é¤Î Gfarm ¤Î¹½ÃÛ =============================== ¤³¤Î¹à¤Ç¤Ï¡¤¥½¡¼¥¹¤«¤é¤Î¹½ÃۤˤĤ¤¤ÆÀâÌÀ¤·¤Þ¤¹¡¥ ¥Ð¥¤¥Ê¥êÇÛÉÛ¤òÍøÍѤµ¤ì¤Æ¤¤¤ëÊý¤Ï¡¤¤³¤Î¥Õ¥¡¥¤¥ë¤ÎÀâÌÀ¤ÏÆÉ¤ßÈô¤Ð¤·¤Æ¹½¤¤¤Þ¤»¤ó¡¥ º£²ó¤Î¥·¥¹¥Æ¥à¤Ï¡¤Linux ¾å¤Ç¼Â¹Ô¥Æ¥¹¥È¤µ¤ì¤Æ¤¤¤Þ¤¹¡¥ ¹½Ãۤ˴ؤ·¤Æ¤Ï NetBSD, Solaris ¾å¤Ç¥Æ¥¹¥È¤µ¤ì¤Æ¤¤¤Þ¤¹¡¥ ¥·¥¹¥Æ¥à¤Î¹½ÃۤΤ¿¤á¤Ë¤Ï¡¤OpenLDAP ¤Ê¤¤¤· PostgreSQL ¤Î¾¯¤Ê¤¯¤È¤â¤É¤Á¤é ¤«ÊÒÊý¤È OpenSSL ¥é¥¤¥Ö¥é¥ê¤¬É¬ÍפǤ¹¡¥ ¥·¥¹¥Æ¥à¤ò¹½ÃÛ¤¹¤ë¤Ë¤Ï¡¤²¼µ­¤Î¤è¤¦¤Ë¤·¤Þ¤¹¡¥ Linux ¤È NetBSD °Ê³°¤Î OS ¤Ç¤Ï¡¤GNU make ¤ò»È¤Ã¤Æ¤¯¤À¤µ¤¤¡¥ % ./configure [¥ª¥×¥·¥ç¥ó] % make % su Password: # make install configure ¥³¥Þ¥ó¥É¤Ë¤Ï¡¤²¼µ­¤Î¥ª¥×¥·¥ç¥ó¤¬¤¢¤ê¤Þ¤¹¡¥ ¡¦--with-openldap=¥Ç¥£¥ì¥¯¥È¥ê OpenLDAP ¤Î¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Æ¤¤¤ë¥Ç¥£¥ì¥¯¥È¥ê¤ò»ØÄꤷ¤Þ¤¹¡¥ ¥ª¥×¥·¥ç¥ó¾Êά»þ¤Ï¼«Æ°Åª¤Ë¥¤¥ó¥¹¥È¡¼¥ë¥Ç¥£¥ì¥¯¥È¥ê¤Î¸¡º÷¤¬»î¤ß¤é¤ì¤Þ ¤¹¡¥ ¡¦--with-postgresql=¥Ç¥£¥ì¥¯¥È¥ê PostgreSQL ¤Î¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Æ¤¤¤ë¥Ç¥£¥ì¥¯¥È¥ê¤ò»ØÄꤷ¤Þ¤¹¡¥ ¥ª¥×¥·¥ç¥ó¾Êά»þ¤Ï¼«Æ°Åª¤Ë¥¤¥ó¥¹¥È¡¼¥ë¥Ç¥£¥ì¥¯¥È¥ê¤Î¸¡º÷¤¬»î¤ß¤é¤ì¤Þ ¤¹¡¥ ¡¦--with-openssl=¥Ç¥£¥ì¥¯¥È¥ê OpenSSL ¤Î¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Æ¤¤¤ë¥Ç¥£¥ì¥¯¥È¥ê¤ò»ØÄꤷ¤Þ¤¹¡¥ ¥ª¥×¥·¥ç¥ó¾Êά»þ¤Ï /usr ¤¬»ØÄꤵ¤ì¤Þ¤¹¡¥ ¡¦--with-globus=¥Ç¥£¥ì¥¯¥È¥ê ǧ¾ÚÊý¼°¤È¤·¤Æ GSI ¤ò²Äǽ¤È¤·¤Þ¤¹¡¥¥Ç¥£¥ì¥¯¥È¥ê¤Ï Globus toolkit ¤Î ¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Æ¤¤¤ë¥Ç¥£¥ì¥¯¥È¥ê¤ò»ØÄꤷ¤Þ¤¹¡¥ Globus toolkit ¤Î¤¦¤Á GSSAPI ¥é¥¤¥Ö¥é¥ê¤¬É¬ÍפȤʤê¤Þ¤¹¡¥¥Ç¥£¥ì¥¯¥È ¥ê¤ò»ØÄꤷ¤Ê¤¤¤È¡¤´Ä¶­ÊÑ¿ô GLOBUS_LOCATION ¤Î¼¨¤¹¥Ç¥£¥ì¥¯¥È¥ê¤¬ÍøÍÑ ¤µ¤ì¤Þ¤¹¡¥ ¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¾Êά²Äǽ¤Ç¤¹¡¥ ¥Ç¥Õ¥©¡¼¥ë¥È¤Ç¤Ï¡¤¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Æ¤¤¤ë flavor ¤ò¼«Æ°Åª¤Ë¸¡º÷¤·¤Þ¤¹ ¤¬¡¤--with-globus-flavor="gcc32dbg" ¤Î¤è¤¦¤Ë¤·¤Æ flavor ̾¤ò»ØÄꤹ¤ë ¤È¤â¤Ç¤­¤Þ¤¹¡¥ ¡¦--without-mtsafe-netdb ¥é¥¤¥Ö¥é¥ê´Ø¿ô getaddrinfo(3) ¤¢¤ë¤¤¤Ï getnameinfo(3) ¤¬¡¤¥Þ¥ë¥Á¥¹¥ì¥Ã¥É¡¦ ¥»¡¼¥Õ¤Ç¤Ï¤Ê¤¤¾ì¹ç¤Ë¡¤»ØÄ꤬ɬÍפǤ¹¡¥ ¡¦--prefix=¥Ç¥£¥ì¥¯¥È¥ê ¥¤¥ó¥¹¥È¡¼¥ëÀè¤Î¥Ç¥£¥ì¥¯¥È¥ê¤ò»ØÄꤷ¤Þ¤¹¡¥¤³¤Î¥ª¥×¥·¥ç¥ó¤ò¾Êά¤·¤¿¾ì ¹ç¤Ï /usr/local ¥Ç¥£¥ì¥¯¥È¥ê¤Î²¼¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤·¤Þ¤¹¡¥ ¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¾Êά²Äǽ¤Ç¤¹¡¥ ¡¦--sysconfdir=¥Ç¥£¥ì¥¯¥È¥ê ÀßÄê¥Õ¥¡¥¤¥ë¡Ögfarm2.conf¡×¤òÃÖ¤¯¥Ç¥£¥ì¥¯¥È¥ê¤ò»ØÄꤷ¤Þ¤¹¡¥¤³¤Î¥ª¥×¥·¥ç ¥ó¤ò¾Êά¤·¤¿¾ì¹ç¤Ï¾åµ­¤Î --prefix ¥ª¥×¥·¥ç¥ó¤Ç»ØÄꤷ¤¿¥Ç¥£¥ì¥¯¥È¥ê¤Î ²¼¤Î¡Öetc¡×¥Ç¥£¥ì¥¯¥È¥ê¤¬»ØÄꤵ¤ì¤¿¤â¤Î¤È¤ß¤Ê¤·¤Þ¤¹¡¥ËÜʸ½ñ¤Ï¡¤¥ª¥× ¥·¥ç¥ó --sysconfdir=/etc ¤¬»ØÄꤵ¤ì¤¿¤â¤Î¤È²¾Äꤷ¤Æµ­½Ò¤·¤Æ¤¢¤ê¤Þ¤¹¡¥ ¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¾Êά²Äǽ¤Ç¤¹¡¥ ¡¦--enable-voms ¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»ØÄꤹ¤ë¤È¡¤VOMS ¤Î VO¡¤¥°¥ë¡¼¥×¡¤Ìò³ä¤ÈÏ¢·È¤·¤Æ Gfarm ¤Î¥°¥ë¡¼¥×¤ò´ÉÍý¤¹¤ë¤¿¤á¤Î¥³¥Þ¥ó¥É·²¤ò¥Ó¥ë¥É¤·¤Þ¤¹¡¥¾Ü¤·¤¯¤Ï doc/voms-{install,man,dev}.ja ¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡¥ ¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¾Êά²Äǽ¤Ç¤¹¡¥ ¡¦--enable-xmlattr XPath ¤Ë¤è¤ë¸¡º÷¤¬²Äǽ¤Ê XML ³Èĥ°À­¤òÍøÍѤ¹¤ë¤È¤­¤Ë»ØÄꤷ¤Þ¤¹¡¥¾Ü ¤·¤¯¤Ï doc/xattr-install.ja ¤ª¤è¤Ó gfxattr¡¤gffindxmlattr ¤Î¥Þ¥Ë¥å¥¢ ¥ë¥Ú¡¼¥¸¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡¥ Ëܵ¡Ç½¤òÍøÍѤ¹¤ë¤¿¤á¤Ë¤Ï¡¤configure ¤Ë --with-libxml ¥ª¥×¥·¥ç¥ó¤ò¤Ä ¤±¤Æ¹½ÃÛ¤µ¤ì¤¿ postgresql-8.3.x °Ê¹ß¤¬É¬ÍפȤʤê¤Þ¤¹¡¥ ¡Êhttp://www.postgresql.org/docs/8.3/static/install-procedure.html¡Ë ¤Þ¤¿¡¤config-gfarm »þ¤Ë -X ¥ª¥×¥·¥ç¥ó¤Î»ØÄ꤬ɬÍפˤʤê¤Þ¤¹¡¥ ¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¾Êά²Äǽ¤Ç¤¹¡¥ ÍøÍѤ¹¤ë¥³¥ó¥Ñ¥¤¥é¤òÌÀ¼¨¤·¤¿¤¤¾ì¹ç¤Ë¤Ï¡¤´Ä¶­ÊÑ¿ô CC ¤Ë¡¤¥³¥ó¥Ñ¥¤¥é¤Î¥³ ¥Þ¥ó¥É̾¤ò»ØÄꤷ¤Æ configure ¤ò¼Â¹Ô¤·¤Æ¤¯¤À¤µ¤¤¡¥°Ê²¼¤Ï gcc ¤ò»ØÄꤹ¤ë Îã¤Ç¤¹¡¥ % env CC=gcc ./configure [options] $Id: INSTALL.ja 5010 2010-12-30 00:29:02Z n-soda $ gfarm-2.4.1/INSTALL.en0000644000000000000000000000602311507222727012750 0ustar rootroot======================================= Gfarm installation from the source code ======================================= This distribution is fully tested on Linux. The building tests were done on NetBSD, and Solaris. This section describes how to build Gfarm binaries from the source distribution. You can skip this document if you use a binary distribution. To build the Gfarm system, the OpenSSL library and either the OpenLDAP library, or the PostgreSQL library are required. The following is the installation procedure for the Gfarm system. Please use GNU make on operating systems other than Linux and NetBSD. % ./configure [options] % make % su Password: # make install Options for configure: --with-openldap=directory Specifies an installation directory for OpenLDAP. When this option is not specified, the installation directory is searched for automatically. --with-postgresql=directory Specifies an installation directory for PostgreSQL. When this option is not specified, the installation directory is searched for automatically. --with-openssl=directory Specifies an installation directory for OpenSSL. The default directory is /usr. --with-globus=directory Specifies an installation directory for the Globus Toolkit to utilize the GSI authentication method. When a directory is not specified, the environment variable, GLOBUS_LOCATION is used. This is optional. The flavor of the Globus library is searched for automatically. If you need to specify a flavor, specify it with the --with-globus-flavor=flavor option. --without-mtsafe-netdb Specifies if either getaddrinfo(3) or getnameinfo(3) library function is not multi-thread safe. --prefix=directory Specifies a destination directory for installation. The default is /usr/local directory. This is optional. --sysconfdir=directory Specifies a directory where the ``gfarm2.conf'' configuration file is located. The default is the ``etc'' directory under the directory specified in the above --prefix option. This document assumes that --sysconfdir=/etc is specified. This is optional. --enable-voms Enables to compile the gfvoms-sync command to synchronize Gfarm group membership with VOMS (Virtual Organization Membership Service) servers. This option requires Python and ZSI (Zolera SOAP Infrastructure). This is optional. --enable-xmlattr Enables XML extended attribute feature that can be queried by the XML Path Language (XPath). For details, see manual pages of gfxattr and gffindxmlattr. This option requires postgresql-8.3 or later that configures with the --with-libxml option. See http://www.postgresql.org/docs/8.3/static/install-procedure.html for details. The -X option is also required to config-gfarm when setting up the Gfarm file system. This is optional. When you need to specify a compiler program explicitly, use the environment variable, CC. This is an example using gcc. % env CC=gcc ./configure [options] $Id: INSTALL.en 4240 2009-08-18 08:45:36Z tatebe $ gfarm-2.4.1/package/0000755000000000000000000000000011507222730012702 5ustar rootrootgfarm-2.4.1/package/solaris/0000755000000000000000000000000011507222730014356 5ustar rootrootgfarm-2.4.1/package/solaris/gfarm-gfront.files0000644000000000000000000000005011507222720017765 0ustar rootroot@PREFIX@/bin/gfront @PREFIX@/share/java gfarm-2.4.1/package/solaris/build0000755000000000000000000000636311507222720015412 0ustar rootroot#!/bin/sh # /usr/local/bin must be before /bin, otherwise globus-makefile-header fails. PATH=/opt/SUNWspro/bin:/usr/ccs/bin:/usr/local/bin:/usr/bin:/bin:/usr/ucb export PATH version=1.4 subpkgs='client devel doc fsnode gfptool libs agent server gfront' prefix=usr/local/gfarm pkg_list='gfarm gfarm-gsi' cc_list='vendorcc gcc' # XXX gcc cannot link shared object. what's wrong? cc_list='vendorcc' srcdir=`pwd` work=$srcdir/.. buildrootbase=$work/buildroot-$$ make=/usr/local/bin/make tar=/usr/local/bin/tar with_prefix=--prefix=/$prefix with_sysconfdir=--sysconfdir=/etc with_globus=--with-globus=/opt/GT4/gt-4.0.3-gcc-3.2.3 with_globus="$with_globus --with-globus-static" # XXX --with-mpi needs OPTFLAGS=-O with gcc (an error happens at gfs_hook_mpi). # XXX currently, MPICH isn't installed on the build-host. # XXX tar warns missing `gfwc', because it isn't built without --with-mpi. with_mpi= # --with-mpi=/usr/local/mpich vendorcc_pkg=/home/soda/install/SunOS-5.9-sparc-SunForte-7 with_vendorcc_postgresql=--with-postgresql=$vendorcc_pkg/postgresql-8.1.5 with_vendorcc_openldap=--with-openldap=$vendorcc_pkg/openldap-2.3.28 with_vendorcc_openssl=--with-openssl=$vendorcc_pkg/openssl-0.9.8d with_vendorcc_globus_flavor= # --with-globus-flavor=vendorcc32 # not necessary gcc_pkg=/home/soda/install/SunOS-5.9-gcc-3.2.3 with_gcc_postgresql=--with-postgresql=$gcc_pkg/postgresql-8.1.5 with_gcc_openldap=--with-openldap=$gcc_pkg/openldap-2.3.28 with_gcc_openssl=--with-openssl=$gcc_pkg/openssl-0.9.8d with_gcc_globus_flavor= # --with-globus-flavor=gcc32 # not necessary case `whoami` in root) ;; # OK *) echo "WARNING: root privilege is needed to invoke this script" >&2 # exit 1 ;; esac for pkg in $pkg_list do for cc in $cc_list do case ${pkg}-${cc} in gfarm-vendorcc) ./configure $with_prefix $with_sysconfdir \ $with_vendorcc_postgresql \ $with_vendorcc_openldap \ $with_vendorcc_openssl;; gfarm-gsi-vendorcc) ./configure $with_prefix $with_sysconfdir \ $with_vendorcc_postgresql \ $with_vendorcc_openldap \ $with_vendorcc_openssl \ $with_globus $with_vendorcc_globus_flavor;; gfarm-gcc) CC=gcc ./configure $with_prefix $with_sysconfdir \ $with_gcc_postgresql \ $with_gcc_openldap \ $with_gcc_openssl;; gfarm-gsi-gcc) CC=gcc ./configure $with_prefix $with_sysconfdir \ $with_gcc_postgresql \ $with_gcc_openldap \ $with_gcc_openssl \ $with_globus $with_gcc_globus_flavor;; esac $make buildroot=${buildrootbase}-${pkg}-${cc} rm -rf $buildroot mkdir -p $buildroot $buildroot/$prefix $buildroot/etc $make prefix=$buildroot/$prefix install mkdir -p $buildroot/etc/rc3.d cp package/solaris/gfmd $buildroot/etc/rc3.d/S90gfmd cp package/solaris/gfsd $buildroot/etc/rc3.d/S95gfsd ln $buildroot/etc/rc3.d/S90gfmd $buildroot/etc/rc3.d/K10gfmd ln $buildroot/etc/rc3.d/S95gfsd $buildroot/etc/rc3.d/K05gfsd chmod +x $buildroot/etc/rc3.d/* cp doc/conf/gfarm.conf $buildroot/etc/gfarm.conf.sample $make distclean ( cd $buildroot && for s in $subpkgs do eval \ $tar zcf $work/${pkg}-${s}-${cc}-${version}.tar.gz \ `sed "s:@PREFIX@:$prefix:" \ $srcdir/package/solaris/gfarm-${s}.files` done ) # rm -rf $buildroot done done # $Id: build 3617 2007-03-12 08:32:55Z n-soda $ gfarm-2.4.1/package/solaris/gfarm-fsnode.files0000644000000000000000000000035211507222720017751 0ustar rootroot@PREFIX@/bin/config-gfsd @PREFIX@/bin/gfarm.arch.guess @PREFIX@/bin/gfexec @PREFIX@/bin/gfsplck @PREFIX@/bin/thput-gfpio @PREFIX@/sbin/gfsd @PREFIX@/share/gfarm/config/gfsd.in etc/rc3.d/S95gfsd etc/rc3.d/K05gfsd etc/gfarm.conf.sample gfarm-2.4.1/package/solaris/gfarm-server.files0000644000000000000000000000136611507222720020007 0ustar rootroot@PREFIX@/bin/config-gfarm @PREFIX@/bin/gfdump @PREFIX@/bin/gfusage @PREFIX@/sbin/gfmd @PREFIX@/share/gfarm/config/bdb.DB_CONFIG.in @PREFIX@/share/gfarm/config/config-gfarm.ldap @PREFIX@/share/gfarm/config/config-gfarm.postgresql @PREFIX@/share/gfarm/config/gfarm.conf-ldap.in @PREFIX@/share/gfarm/config/gfarm.conf-postgresql.in @PREFIX@/share/gfarm/config/gfarm.schema @PREFIX@/share/gfarm/config/gfarm.schema-1.sql @PREFIX@/share/gfarm/config/gfarm.schema-2.sql @PREFIX@/share/gfarm/config/initial.ldif.in @PREFIX@/share/gfarm/config/gfarm-pgsql.in @PREFIX@/share/gfarm/config/gfarm-slapd.in @PREFIX@/share/gfarm/config/gfmd.in @PREFIX@/share/gfarm/config/slapd.conf-2.0.in @PREFIX@/share/gfarm/config/slapd.conf-2.1.in etc/rc3.d/S90gfmd etc/rc3.d/K10gfmd gfarm-2.4.1/package/solaris/gfsd.in0000755000000000000000000000246111507222720015636 0ustar rootroot#!/sbin/sh # # $Id: gfsd.in 2373 2006-01-12 00:54:22Z soda $ PROG="gfsd" FILE=$PROG CONF="/etc/gfarm.conf" DAEMON="@prefix@/sbin/$PROG" PIDFILE="/var/run/${FILE}.pid" OPTIONS= globus_location="@globus_location@" if [ -z "${GLOBUS_LOCATION-}" ] && [ -n "$globus_location" ] && [ -f "$globus_location/etc/globus-user-env.sh" ] then GLOBUS_LOCATION="$globus_location" export GLOBUS_LOCATION . "$GLOBUS_LOCATION/etc/globus-user-env.sh" fi case $1 in start) if [ ! -x "$DAEMON" ]; then echo -n "$DAEMON is not installed" exit 1 fi if [ ! -f "$CONF" ]; then echo -n "$CONF is not configured" exit 1 fi $DAEMON -P "$PIDFILE" $OPTIONS ;; stop) if [ -f "$PIDFILE" ] && kill -TERM `cat "$PIDFILE"`; then rm -f "$PIDFILE" elif [ -f "$PIDFILE" ]; then echo "$FILE (pid" `cat "$PIDFILE"`") is not running? (check $PIDFILE)" exit 1 else echo "$FILE is already stopped (no $PIDFILE)" exit 1 fi ;; restart) $0 stop $0 start ;; status) if [ -f "$PIDFILE" ] && kill -0 `cat "$PIDFILE"`; then echo "$FILE (pid" `cat "$PIDFILE"`") is running" elif [ -f "$PIDFILE" ]; then echo "$FILE (pid" `cat "$PIDFILE"`") is not running? (check $PIDFILE)" exit 1 else echo "$FILE is stopped (no $PIDFILE)" exit 1 fi ;; *) echo "Usage: $0 { start | stop | restart | status }" exit 1 ;; esac exit 0 gfarm-2.4.1/package/solaris/gfarm-gfptool.files0000644000000000000000000000033411507222720020145 0ustar rootroot@PREFIX@/bin/gfcombine @PREFIX@/bin/gfcombine_hook @PREFIX@/bin/gfcp @PREFIX@/bin/gfcp_hook @PREFIX@/bin/gfgrep @PREFIX@/bin/gfwc @PREFIX@/libexec/gfrepbe_client @PREFIX@/libexec/gfrepbe_server @PREFIX@/sbin/gfregister gfarm-2.4.1/package/solaris/gfmd.in0000755000000000000000000000246111507222720015630 0ustar rootroot#!/sbin/sh # # $Id: gfmd.in 2373 2006-01-12 00:54:22Z soda $ PROG="gfmd" FILE=$PROG CONF="/etc/gfarm.conf" DAEMON="@prefix@/sbin/$PROG" PIDFILE="/var/run/${FILE}.pid" OPTIONS= globus_location="@globus_location@" if [ -z "${GLOBUS_LOCATION-}" ] && [ -n "$globus_location" ] && [ -f "$globus_location/etc/globus-user-env.sh" ] then GLOBUS_LOCATION="$globus_location" export GLOBUS_LOCATION . "$GLOBUS_LOCATION/etc/globus-user-env.sh" fi case $1 in start) if [ ! -x "$DAEMON" ]; then echo -n "$DAEMON is not installed" exit 1 fi if [ ! -f "$CONF" ]; then echo -n "$CONF is not configured" exit 1 fi $DAEMON -P "$PIDFILE" $OPTIONS ;; stop) if [ -f "$PIDFILE" ] && kill -TERM `cat "$PIDFILE"`; then rm -f "$PIDFILE" elif [ -f "$PIDFILE" ]; then echo "$FILE (pid" `cat "$PIDFILE"`") is not running? (check $PIDFILE)" exit 1 else echo "$FILE is already stopped (no $PIDFILE)" exit 1 fi ;; restart) $0 stop $0 start ;; status) if [ -f "$PIDFILE" ] && kill -0 `cat "$PIDFILE"`; then echo "$FILE (pid" `cat "$PIDFILE"`") is running" elif [ -f "$PIDFILE" ]; then echo "$FILE (pid" `cat "$PIDFILE"`") is not running? (check $PIDFILE)" exit 1 else echo "$FILE is stopped (no $PIDFILE)" exit 1 fi ;; *) echo "Usage: $0 { start | stop | restart | status }" exit 1 ;; esac exit 0 gfarm-2.4.1/package/solaris/gfarm-devel.files0000644000000000000000000000012711507222720017572 0ustar rootroot@PREFIX@/include @PREFIX@/lib/*.a @PREFIX@/lib/*.la @PREFIX@/lib/*.o @PREFIX@/lib/*.so gfarm-2.4.1/package/solaris/gfarm-doc.files0000644000000000000000000000004011507222720017232 0ustar rootroot@PREFIX@/man @PREFIX@/share/doc gfarm-2.4.1/package/solaris/gfarm-libs.files0000644000000000000000000000010411507222720017417 0ustar rootroot@PREFIX@/lib/*.so.* @PREFIX@/share/gfarm/config/config-gfarm.sysdep gfarm-2.4.1/package/solaris/gfarm-client.files0000644000000000000000000000137311507222720017755 0ustar rootroot@PREFIX@/bin/gfarm-pcp @PREFIX@/bin/gfarm-prun @PREFIX@/bin/gfarm-ptool @PREFIX@/bin/gfdf @PREFIX@/bin/gfexport @PREFIX@/bin/gfhost @PREFIX@/bin/gfifo.sh @PREFIX@/bin/gfimport_fixed @PREFIX@/bin/gfimport_text @PREFIX@/bin/gfkey @PREFIX@/bin/gfls @PREFIX@/bin/gfmkdir @PREFIX@/bin/gfmpirun_p4 @PREFIX@/bin/gfps @PREFIX@/bin/gfpwd @PREFIX@/bin/gfq.sh @PREFIX@/bin/gfq_commit.sh @PREFIX@/bin/gfq_setup.sh @PREFIX@/bin/gfrcmd @PREFIX@/bin/gfreg @PREFIX@/bin/gfrep @PREFIX@/bin/gfrm @PREFIX@/bin/gfrmdir @PREFIX@/bin/gfrsh @PREFIX@/bin/gfrshl @PREFIX@/bin/gfrun @PREFIX@/bin/gfsched @PREFIX@/bin/gfsck @PREFIX@/bin/gfsetdir @PREFIX@/bin/gfssh @PREFIX@/bin/gfsshl @PREFIX@/bin/gfstat @PREFIX@/bin/gfstatus @PREFIX@/bin/gftest @PREFIX@/bin/gfwhere @PREFIX@/bin/gfwhoami gfarm-2.4.1/package/freebsd/0000755000000000000000000000000011507222730014314 5ustar rootrootgfarm-2.4.1/package/freebsd/pkg-descr0000644000000000000000000000134511507222720016120 0ustar rootrootGfarm (Grid Datafarm) provides a user-level grid filesystem and parallel process management based on file-affinity scheduling. The filesystem can be accessed by either every existing dynamically-linked program (please read README.hook.{en,ja} in the document directory to do this), or programs which are using Gfarm file access API. Parallel process scheduling and invokation are done by gfrun command. If this package is configured with globus, don't forget to configure your environment by the following procedure: on Bourne shell: GLOBUS_LOCATION=/usr/local/globus export GLOBUS_LOCATION . $GLOBUS_LOCATION/etc/globus-user-env.sh on csh: setenv GLOBUS_LOCATION /usr/local/globus . $GLOBUS_LOCATION/etc/globus-user-env.csh gfarm-2.4.1/package/freebsd/Makefile0000644000000000000000000000547311507222720015764 0ustar rootroot# New ports collection makefile for: gfarm # Date created: 13 July 2005 # Whom: SODA Noriyuki # # $FreeBSD$ # PORTNAME= gfarm PORTVERSION= 1.4 CATEGORIES= net MASTER_SITES= http://datafarm.apgrid.org/software/${PORTVERSION}/ PATCH_SITES= ${MASTER_SITES} MAINTAINER= soda@sra.co.jp COMMENT= User-level grid filesystem and parallel process management GNU_CONFIGURE= yes USE_GMAKE= yes USE_OPENSSL= yes USE_OPENLDAP= yes USE_LIBTOOL_VER=15 INSTALLS_SHLIB= yes SYSCONFDIR?= ${PREFIX}/etc CONFIGURE_ARGS+=--sysconfdir=${SYSCONFDIR} LIB_DEPENDS= pq.4:${PORTSDIR}/${POSTGRESQL_PORT} POSTGRESQL_PORT?= databases/postgresql80-client USE_RC_SUBR= yes RC_SCRIPTS_SUB= PREFIX=${PREFIX} SYSCONFDIR=${SYSCONFDIR} RC_SUBR=${RC_SUBR} post-patch: @${SED} ${RC_SCRIPTS_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \ ${FILESDIR}/gfmd.sh > ${WRKDIR}/gfmd.sh @${SED} ${RC_SCRIPTS_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \ ${FILESDIR}/gfsd.sh > ${WRKDIR}/gfsd.sh post-install: @${INSTALL_SCRIPT} ${WRKDIR}/gfmd.sh ${PREFIX}/etc/rc.d/ @${INSTALL_SCRIPT} ${WRKDIR}/gfsd.sh ${PREFIX}/etc/rc.d/ .if defined(WITH_GLOBUS) GPT_LOCATION= ${LOCALBASE} GLOBUS_LOCATION=${LOCALBASE}/globus GLOBUS_FLAVOR?= gcc32dbg RC_SCRIPTS_SUB+= GLOBUS_LOCATION=${GLOBUS_LOCATION} .if defined(LDCONFIG_R_DOES_WORK_FOR_GLOBUS) # XXX This doesn't work, because "ldconfig -r" doesn't show the libraries. LIB_DEPENDS+= globus_gssapi_gsi_${GLOBUS_FLAVOR}:${PORTSDIR}/misc/globus2 .else # So, workaround the problem BUILD_DEPENDS= ${GLOBUS_LOCATION}/bin/globus-makefile-header:${PORTSDIR}/misc/globus2 RUN_DEPENDS= ${BUILD_DEPENDS} .endif # XXX Workaround a mistake in ports/misc/globus2. # Without the following environment, globus-makefile-header complains # that it can't locate Grid/GPT/Dependencies.pm in @INC. PERL5LIB_FIX= PERL5LIB=${LOCALBASE}/lib/perl # globus-makefile-header will be called from configure pre-configure: @if ! ${SETENV} ${PERL5LIB_FIX} GLOBUS_LOCATION=${GLOBUS_LOCATION} \ ${GLOBUS_LOCATION}/bin/globus-makefile-header \ -flavor=${GLOBUS_FLAVOR} globus_gssapi_gsi >/dev/null; then \ ${ECHO_CMD} "${PKGNAME}: globus-makefile-header failed."; \ ${ECHO_CMD} "Probably you need to run the following command:"; \ ${ECHO_CMD} " ${SETENV} GPT_LOCATION=${GPT_LOCATION} GLOBUS_LOCATION=${GLOBUS_LOCATION} ${GPT_LOCATION}/sbin/gpt-postinstall"; \ ${FALSE}; \ fi CONFIGURE_ARGS+=--with-globus=${GLOBUS_LOCATION} \ --with-globus-flavor=${GLOBUS_FLAVOR} CONFIGURE_ENV+= ${PERL5LIB_FIX} # XXX # GSI authentication doesn't work, if gfarm is linked with OpenLDAP in ports. # Probably this is because of OpenSSL conflicts between Globus and ports # (OpenLDAP depends on OpenSSL in ports). CONFIGURE_ARGS+=--without-openldap .endif # WITH_GLOBUS # TODO: # - split into fine-grained packages. # e.g. gfarm-{libs,client,fsnode,server,devel} .include gfarm-2.4.1/package/freebsd/pkg-plist0000644000000000000000000004300411507222720016151 0ustar rootroot@comment $FreeBSD$ bin/config-gfarm bin/config-agent bin/config-gfsd bin/gfarm.arch.guess bin/gfarm_agent bin/gfarm-pcp bin/gfarm-prun bin/gfarm-ptool bin/gfcombine bin/gfcombine_hook bin/gfcp bin/gfcp_hook bin/gfdf bin/gfdump bin/gfexec bin/gfexport bin/gfgrep bin/gfhost bin/gfifo.sh bin/gfimport_fixed bin/gfimport_text bin/gfkey bin/gfls bin/gfmkdir bin/gfmpirun_p4 bin/gfps bin/gfpwd bin/gfq.sh bin/gfq_commit.sh bin/gfq_setup.sh bin/gfrcmd bin/gfreg bin/gfrep bin/gfrm bin/gfrmdir bin/gfront bin/gfrsh bin/gfrshl bin/gfrun bin/gfsched bin/gfsck bin/gfsetdir bin/gfsplck bin/gfssh bin/gfsshl bin/gfstat bin/gfstatus bin/gftest bin/gfusage bin/gfwhere bin/gfwhoami bin/thput-gfpio etc/rc.d/gfmd.sh etc/rc.d/gfsd.sh include/gfarm/gfarm.h include/gfarm/gfarm_config.h include/gfarm/gfarm_error.h include/gfarm/gfarm_metadb.h include/gfarm/gfarm_misc.h include/gfarm/gfarm_stringlist.h include/gfarm/gflog.h include/gfarm/gfs.h include/gfarm/gfs_glob.h include/gfarm/gfs_hook.h lib/gfs_hook.o lib/gfs_hook_debug.o lib/gfs_hook_no_init.o lib/gfs_hook_no_init_debug.o lib/hooks_init_mpi.c lib/libgfarm.so.0 lib/libgfarm.so lib/libgfarm.a lib/libgfs_hook_debug.so.0 lib/libgfs_hook_debug.so lib/libgfs_hook_debug.a lib/libgfs_hook_no_init_debug.so.0 lib/libgfs_hook_no_init_debug.so lib/libgfs_hook_no_init_debug.a lib/libgfs_hook.so.0 lib/libgfs_hook.so lib/libgfs_hook.a lib/libgfs_hook_no_init.so.0 lib/libgfs_hook_no_init.so lib/libgfs_hook_no_init.a libexec/gfrepbe_client libexec/gfrepbe_server man/ja/man1/gfarm_agent.1 man/ja/man1/gfcd.1 man/ja/man1/gfdf.1 man/ja/man1/gfexec.1 man/ja/man1/gfexport.1 man/ja/man1/gfgrep.1 man/ja/man1/gfhost.1 man/ja/man1/gfimport_fixed.1 man/ja/man1/gfimport_text.1 man/ja/man1/gfkey.1 man/ja/man1/gfls.1 man/ja/man1/gfmkdir.1 man/ja/man1/gfmpirun_p4.1 man/ja/man1/gfps.1 man/ja/man1/gfpwd.1 man/ja/man1/gfrcmd.1 man/ja/man1/gfreg.1 man/ja/man1/gfrep.1 man/ja/man1/gfrm.1 man/ja/man1/gfrmdir.1 man/ja/man1/gfront.1 man/ja/man1/gfrsh.1 man/ja/man1/gfrun.1 man/ja/man1/gfsched.1 man/ja/man1/gfsetdir.1 man/ja/man1/gfssh.1 man/ja/man1/gfstat.1 man/ja/man1/gfusage.1 man/ja/man1/gfwc.1 man/ja/man1/gfwhere.1 man/ja/man1/gfwhoami.1 man/ja/man3/gfarm.3 man/ja/man3/gfarm_hostlist_read.3 man/ja/man3/gfarm_import_fragment_config_read.3 man/ja/man3/gfarm_import_fragment_size_alloc.3 man/ja/man3/gfarm_initialize.3 man/ja/man3/gfarm_stringlist_add.3 man/ja/man3/gfarm_stringlist_cat.3 man/ja/man3/gfarm_stringlist_elem.3 man/ja/man3/gfarm_stringlist_free.3 man/ja/man3/gfarm_stringlist_init.3 man/ja/man3/gfarm_stringlist_length.3 man/ja/man3/gfarm_strings_free_deeply.3 man/ja/man3/gfarm_terminate.3 man/ja/man3/gfarm_url_fragments_replicate.3 man/ja/man3/gfarm_url_hosts_schedule.3 man/ja/man3/gfarm_url_program_deliver.3 man/ja/man3/gfarm_url_program_register.3 man/ja/man3/gfarm_url_section_replicate_from_to.3 man/ja/man3/gfarm_url_section_replicate_to.3 man/ja/man3/gfs_chdir.3 man/ja/man3/gfs_chmod.3 man/ja/man3/gfs_closedir.3 man/ja/man3/gfs_glob.3 man/ja/man3/gfs_glob_add.3 man/ja/man3/gfs_glob_free.3 man/ja/man3/gfs_glob_init.3 man/ja/man3/gfs_mkdir.3 man/ja/man3/gfs_opendir.3 man/ja/man3/gfs_pio_close.3 man/ja/man3/gfs_pio_create.3 man/ja/man3/gfs_pio_datasync.3 man/ja/man3/gfs_pio_eof.3 man/ja/man3/gfs_pio_error.3 man/ja/man3/gfs_pio_flush.3 man/ja/man3/gfs_pio_getc.3 man/ja/man3/gfs_pio_getline.3 man/ja/man3/gfs_pio_gets.3 man/ja/man3/gfs_pio_open.3 man/ja/man3/gfs_pio_putc.3 man/ja/man3/gfs_pio_putline.3 man/ja/man3/gfs_pio_puts.3 man/ja/man3/gfs_pio_read.3 man/ja/man3/gfs_pio_readdelim.3 man/ja/man3/gfs_pio_readline.3 man/ja/man3/gfs_pio_seek.3 man/ja/man3/gfs_pio_set_local.3 man/ja/man3/gfs_pio_set_view_index.3 man/ja/man3/gfs_pio_set_view_local.3 man/ja/man3/gfs_pio_sync.3 man/ja/man3/gfs_pio_truncate.3 man/ja/man3/gfs_pio_ungetc.3 man/ja/man3/gfs_pio_write.3 man/ja/man3/gfs_readdir.3 man/ja/man3/gfs_realpath.3 man/ja/man3/gfs_rename.3 man/ja/man3/gfs_rmdir.3 man/ja/man3/gfs_stat.3 man/ja/man3/gfs_stat_free.3 man/ja/man3/gfs_unlink.3 man/ja/man3/gfs_unlink_section.3 man/ja/man3/gfs_utimes.3 man/ja/man5/gfarm.conf.5 man/ja/man8/gfmd.8 man/ja/man8/gfsd.8 man/man1/gfarm_agent.1 man/man1/gfcd.1 man/man1/gfdf.1 man/man1/gfexec.1 man/man1/gfexport.1 man/man1/gfgrep.1 man/man1/gfhost.1 man/man1/gfimport_fixed.1 man/man1/gfimport_text.1 man/man1/gfkey.1 man/man1/gfls.1 man/man1/gfmkdir.1 man/man1/gfmpirun_p4.1 man/man1/gfps.1 man/man1/gfpwd.1 man/man1/gfrcmd.1 man/man1/gfreg.1 man/man1/gfrep.1 man/man1/gfrm.1 man/man1/gfrmdir.1 man/man1/gfront.1 man/man1/gfrsh.1 man/man1/gfrun.1 man/man1/gfsched.1 man/man1/gfsetdir.1 man/man1/gfssh.1 man/man1/gfstat.1 man/man1/gfusage.1 man/man1/gfwc.1 man/man1/gfwhere.1 man/man1/gfwhoami.1 man/man3/gfarm.3 man/man3/gfarm_initialize.3 man/man3/gfarm_strings_free_deeply.3 man/man3/gfarm_terminate.3 man/man3/gfarm_url_fragments_replicate.3 man/man3/gfarm_url_hosts_schedule.3 man/man3/gfarm_url_section_replicate_from_to.3 man/man3/gfarm_url_section_replicate_to.3 man/man3/gfs_chdir.3 man/man3/gfs_chmod.3 man/man3/gfs_closedir.3 man/man3/gfs_glob.3 man/man3/gfs_glob_add.3 man/man3/gfs_glob_free.3 man/man3/gfs_glob_init.3 man/man3/gfs_mkdir.3 man/man3/gfs_opendir.3 man/man3/gfs_pio_close.3 man/man3/gfs_pio_create.3 man/man3/gfs_pio_datasync.3 man/man3/gfs_pio_eof.3 man/man3/gfs_pio_error.3 man/man3/gfs_pio_flush.3 man/man3/gfs_pio_getc.3 man/man3/gfs_pio_getline.3 man/man3/gfs_pio_gets.3 man/man3/gfs_pio_open.3 man/man3/gfs_pio_putc.3 man/man3/gfs_pio_putline.3 man/man3/gfs_pio_puts.3 man/man3/gfs_pio_read.3 man/man3/gfs_pio_readdelim.3 man/man3/gfs_pio_readline.3 man/man3/gfs_pio_seek.3 man/man3/gfs_pio_set_local.3 man/man3/gfs_pio_set_view_index.3 man/man3/gfs_pio_set_view_local.3 man/man3/gfs_pio_sync.3 man/man3/gfs_pio_truncate.3 man/man3/gfs_pio_ungetc.3 man/man3/gfs_pio_write.3 man/man3/gfs_readdir.3 man/man3/gfs_realpath.3 man/man3/gfs_rename.3 man/man3/gfs_rmdir.3 man/man3/gfs_stat.3 man/man3/gfs_stat_free.3 man/man3/gfs_unlink.3 man/man3/gfs_unlink_section.3 man/man3/gfs_utimes.3 man/man5/gfarm.conf.5 man/man8/gfmd.8 man/man8/gfsd.8 sbin/gfmd sbin/gfregister sbin/gfsd share/doc/gfarm/GUIDE.ja share/doc/gfarm/Gfarm-FAQ.en share/doc/gfarm/Gfarm-FAQ.ja share/doc/gfarm/INSTALL.RPM.en share/doc/gfarm/INSTALL.RPM.ja share/doc/gfarm/INSTALL.en share/doc/gfarm/INSTALL.ja share/doc/gfarm/KNOWN_PROBLEMS.en share/doc/gfarm/KNOWN_PROBLEMS.ja share/doc/gfarm/LICENSE share/doc/gfarm/OVERVIEW.en share/doc/gfarm/OVERVIEW.ja share/doc/gfarm/README.en share/doc/gfarm/README.ja share/doc/gfarm/README.hook.en share/doc/gfarm/README.hook.ja share/doc/gfarm/RELNOTES share/doc/gfarm/SETUP.detail.en share/doc/gfarm/SETUP.detail.ja share/doc/gfarm/SETUP.en share/doc/gfarm/SETUP.ja share/doc/gfarm/html/en/ref/index.html share/doc/gfarm/html/en/ref/man1/gfarm_agent.1.html share/doc/gfarm/html/en/ref/man1/gfcd.1.html share/doc/gfarm/html/en/ref/man1/gfdf.1.html share/doc/gfarm/html/en/ref/man1/gfexec.1.html share/doc/gfarm/html/en/ref/man1/gfexport.1.html share/doc/gfarm/html/en/ref/man1/gfgrep.1.html share/doc/gfarm/html/en/ref/man1/gfhost.1.html share/doc/gfarm/html/en/ref/man1/gfimport_fixed.1.html share/doc/gfarm/html/en/ref/man1/gfimport_text.1.html share/doc/gfarm/html/en/ref/man1/gfkey.1.html share/doc/gfarm/html/en/ref/man1/gfls.1.html share/doc/gfarm/html/en/ref/man1/gfmkdir.1.html share/doc/gfarm/html/en/ref/man1/gfmpirun_p4.1.html share/doc/gfarm/html/en/ref/man1/gfps.1.html share/doc/gfarm/html/en/ref/man1/gfpwd.1.html share/doc/gfarm/html/en/ref/man1/gfrcmd.1.html share/doc/gfarm/html/en/ref/man1/gfreg.1.html share/doc/gfarm/html/en/ref/man1/gfrep.1.html share/doc/gfarm/html/en/ref/man1/gfrm.1.html share/doc/gfarm/html/en/ref/man1/gfrmdir.1.html share/doc/gfarm/html/en/ref/man1/gfront.1.html share/doc/gfarm/html/en/ref/man1/gfrun.1.html share/doc/gfarm/html/en/ref/man1/gfsched.1.html share/doc/gfarm/html/en/ref/man1/gfsetdir.1.html share/doc/gfarm/html/en/ref/man1/gfstat.1.html share/doc/gfarm/html/en/ref/man1/gfusage.1.html share/doc/gfarm/html/en/ref/man1/gfwc.1.html share/doc/gfarm/html/en/ref/man1/gfwhere.1.html share/doc/gfarm/html/en/ref/man1/gfwhoami.1.html share/doc/gfarm/html/en/ref/man3/gfarm.3.html share/doc/gfarm/html/en/ref/man3/gfarm_initialize.3.html share/doc/gfarm/html/en/ref/man3/gfarm_strings_free_deeply.3.html share/doc/gfarm/html/en/ref/man3/gfarm_terminate.3.html share/doc/gfarm/html/en/ref/man3/gfarm_url_fragments_replicate.3.html share/doc/gfarm/html/en/ref/man3/gfarm_url_hosts_schedule.3.html share/doc/gfarm/html/en/ref/man3/gfarm_url_section_replicate_from_to.3.html share/doc/gfarm/html/en/ref/man3/gfarm_url_section_replicate_to.3.html share/doc/gfarm/html/en/ref/man3/gfs_chdir.3.html share/doc/gfarm/html/en/ref/man3/gfs_chmod.3.html share/doc/gfarm/html/en/ref/man3/gfs_closedir.3.html share/doc/gfarm/html/en/ref/man3/gfs_glob.3.html share/doc/gfarm/html/en/ref/man3/gfs_glob_add.3.html share/doc/gfarm/html/en/ref/man3/gfs_glob_free.3.html share/doc/gfarm/html/en/ref/man3/gfs_glob_init.3.html share/doc/gfarm/html/en/ref/man3/gfs_mkdir.3.html share/doc/gfarm/html/en/ref/man3/gfs_opendir.3.html share/doc/gfarm/html/en/ref/man3/gfs_pio_close.3.html share/doc/gfarm/html/en/ref/man3/gfs_pio_create.3.html share/doc/gfarm/html/en/ref/man3/gfs_pio_datasync.3.html share/doc/gfarm/html/en/ref/man3/gfs_pio_eof.3.html share/doc/gfarm/html/en/ref/man3/gfs_pio_error.3.html share/doc/gfarm/html/en/ref/man3/gfs_pio_flush.3.html share/doc/gfarm/html/en/ref/man3/gfs_pio_getc.3.html share/doc/gfarm/html/en/ref/man3/gfs_pio_getline.3.html share/doc/gfarm/html/en/ref/man3/gfs_pio_gets.3.html share/doc/gfarm/html/en/ref/man3/gfs_pio_open.3.html share/doc/gfarm/html/en/ref/man3/gfs_pio_putc.3.html share/doc/gfarm/html/en/ref/man3/gfs_pio_putline.3.html share/doc/gfarm/html/en/ref/man3/gfs_pio_puts.3.html share/doc/gfarm/html/en/ref/man3/gfs_pio_read.3.html share/doc/gfarm/html/en/ref/man3/gfs_pio_readdelim.3.html share/doc/gfarm/html/en/ref/man3/gfs_pio_readline.3.html share/doc/gfarm/html/en/ref/man3/gfs_pio_seek.3.html share/doc/gfarm/html/en/ref/man3/gfs_pio_set_local.3.html share/doc/gfarm/html/en/ref/man3/gfs_pio_set_view_index.3.html share/doc/gfarm/html/en/ref/man3/gfs_pio_set_view_local.3.html share/doc/gfarm/html/en/ref/man3/gfs_pio_sync.3.html share/doc/gfarm/html/en/ref/man3/gfs_pio_truncate.3.html share/doc/gfarm/html/en/ref/man3/gfs_pio_ungetc.3.html share/doc/gfarm/html/en/ref/man3/gfs_pio_write.3.html share/doc/gfarm/html/en/ref/man3/gfs_readdir.3.html share/doc/gfarm/html/en/ref/man3/gfs_realpath.3.html share/doc/gfarm/html/en/ref/man3/gfs_rename.3.html share/doc/gfarm/html/en/ref/man3/gfs_rmdir.3.html share/doc/gfarm/html/en/ref/man3/gfs_stat.3.html share/doc/gfarm/html/en/ref/man3/gfs_stat_free.3.html share/doc/gfarm/html/en/ref/man3/gfs_unlink.3.html share/doc/gfarm/html/en/ref/man3/gfs_unlink_section.3.html share/doc/gfarm/html/en/ref/man3/gfs_utimes.3.html share/doc/gfarm/html/en/ref/man5/gfarm.conf.5.html share/doc/gfarm/html/en/ref/man8/gfmd.8.html share/doc/gfarm/html/en/ref/man8/gfsd.8.html share/doc/gfarm/html/en/user/index.html share/doc/gfarm/html/en/user/nfs-gfarmfs.html share/doc/gfarm/html/en/user/samba-gfarmfs.html share/doc/gfarm/html/index.html share/doc/gfarm/html/ja/ref/index.html share/doc/gfarm/html/ja/ref/man1/gfarm_agent.1.html share/doc/gfarm/html/ja/ref/man1/gfcd.1.html share/doc/gfarm/html/ja/ref/man1/gfdf.1.html share/doc/gfarm/html/ja/ref/man1/gfexec.1.html share/doc/gfarm/html/ja/ref/man1/gfexport.1.html share/doc/gfarm/html/ja/ref/man1/gfgrep.1.html share/doc/gfarm/html/ja/ref/man1/gfhost.1.html share/doc/gfarm/html/ja/ref/man1/gfimport_fixed.1.html share/doc/gfarm/html/ja/ref/man1/gfimport_text.1.html share/doc/gfarm/html/ja/ref/man1/gfkey.1.html share/doc/gfarm/html/ja/ref/man1/gfls.1.html share/doc/gfarm/html/ja/ref/man1/gfmkdir.1.html share/doc/gfarm/html/ja/ref/man1/gfmpirun_p4.1.html share/doc/gfarm/html/ja/ref/man1/gfps.1.html share/doc/gfarm/html/ja/ref/man1/gfpwd.1.html share/doc/gfarm/html/ja/ref/man1/gfrcmd.1.html share/doc/gfarm/html/ja/ref/man1/gfreg.1.html share/doc/gfarm/html/ja/ref/man1/gfrep.1.html share/doc/gfarm/html/ja/ref/man1/gfrm.1.html share/doc/gfarm/html/ja/ref/man1/gfrmdir.1.html share/doc/gfarm/html/ja/ref/man1/gfront.1.html share/doc/gfarm/html/ja/ref/man1/gfrun.1.html share/doc/gfarm/html/ja/ref/man1/gfsched.1.html share/doc/gfarm/html/ja/ref/man1/gfsetdir.1.html share/doc/gfarm/html/ja/ref/man1/gfstat.1.html share/doc/gfarm/html/ja/ref/man1/gfusage.1.html share/doc/gfarm/html/ja/ref/man1/gfwc.1.html share/doc/gfarm/html/ja/ref/man1/gfwhere.1.html share/doc/gfarm/html/ja/ref/man1/gfwhoami.1.html share/doc/gfarm/html/ja/ref/man3/gfarm.3.html share/doc/gfarm/html/ja/ref/man3/gfarm_hostlist_read.3.html share/doc/gfarm/html/ja/ref/man3/gfarm_import_fragment_config_read.3.html share/doc/gfarm/html/ja/ref/man3/gfarm_import_fragment_size_alloc.3.html share/doc/gfarm/html/ja/ref/man3/gfarm_initialize.3.html share/doc/gfarm/html/ja/ref/man3/gfarm_stringlist_add.3.html share/doc/gfarm/html/ja/ref/man3/gfarm_stringlist_cat.3.html share/doc/gfarm/html/ja/ref/man3/gfarm_stringlist_elem.3.html share/doc/gfarm/html/ja/ref/man3/gfarm_stringlist_free.3.html share/doc/gfarm/html/ja/ref/man3/gfarm_stringlist_init.3.html share/doc/gfarm/html/ja/ref/man3/gfarm_stringlist_length.3.html share/doc/gfarm/html/ja/ref/man3/gfarm_strings_free_deeply.3.html share/doc/gfarm/html/ja/ref/man3/gfarm_terminate.3.html share/doc/gfarm/html/ja/ref/man3/gfarm_url_fragments_replicate.3.html share/doc/gfarm/html/ja/ref/man3/gfarm_url_hosts_schedule.3.html share/doc/gfarm/html/ja/ref/man3/gfarm_url_program_deliver.3.html share/doc/gfarm/html/ja/ref/man3/gfarm_url_program_register.3.html share/doc/gfarm/html/ja/ref/man3/gfarm_url_section_replicate_from_to.3.html share/doc/gfarm/html/ja/ref/man3/gfarm_url_section_replicate_to.3.html share/doc/gfarm/html/ja/ref/man3/gfs_chdir.3.html share/doc/gfarm/html/ja/ref/man3/gfs_chmod.3.html share/doc/gfarm/html/ja/ref/man3/gfs_closedir.3.html share/doc/gfarm/html/ja/ref/man3/gfs_glob.3.html share/doc/gfarm/html/ja/ref/man3/gfs_glob_add.3.html share/doc/gfarm/html/ja/ref/man3/gfs_glob_free.3.html share/doc/gfarm/html/ja/ref/man3/gfs_glob_init.3.html share/doc/gfarm/html/ja/ref/man3/gfs_mkdir.3.html share/doc/gfarm/html/ja/ref/man3/gfs_opendir.3.html share/doc/gfarm/html/ja/ref/man3/gfs_pio_close.3.html share/doc/gfarm/html/ja/ref/man3/gfs_pio_create.3.html share/doc/gfarm/html/ja/ref/man3/gfs_pio_datasync.3.html share/doc/gfarm/html/ja/ref/man3/gfs_pio_eof.3.html share/doc/gfarm/html/ja/ref/man3/gfs_pio_error.3.html share/doc/gfarm/html/ja/ref/man3/gfs_pio_flush.3.html share/doc/gfarm/html/ja/ref/man3/gfs_pio_getc.3.html share/doc/gfarm/html/ja/ref/man3/gfs_pio_getline.3.html share/doc/gfarm/html/ja/ref/man3/gfs_pio_gets.3.html share/doc/gfarm/html/ja/ref/man3/gfs_pio_open.3.html share/doc/gfarm/html/ja/ref/man3/gfs_pio_putc.3.html share/doc/gfarm/html/ja/ref/man3/gfs_pio_putline.3.html share/doc/gfarm/html/ja/ref/man3/gfs_pio_puts.3.html share/doc/gfarm/html/ja/ref/man3/gfs_pio_read.3.html share/doc/gfarm/html/ja/ref/man3/gfs_pio_readdelim.3.html share/doc/gfarm/html/ja/ref/man3/gfs_pio_readline.3.html share/doc/gfarm/html/ja/ref/man3/gfs_pio_seek.3.html share/doc/gfarm/html/ja/ref/man3/gfs_pio_set_local.3.html share/doc/gfarm/html/ja/ref/man3/gfs_pio_set_view_index.3.html share/doc/gfarm/html/ja/ref/man3/gfs_pio_set_view_local.3.html share/doc/gfarm/html/ja/ref/man3/gfs_pio_sync.3.html share/doc/gfarm/html/ja/ref/man3/gfs_pio_truncate.3.html share/doc/gfarm/html/ja/ref/man3/gfs_pio_ungetc.3.html share/doc/gfarm/html/ja/ref/man3/gfs_pio_write.3.html share/doc/gfarm/html/ja/ref/man3/gfs_readdir.3.html share/doc/gfarm/html/ja/ref/man3/gfs_realpath.3.html share/doc/gfarm/html/ja/ref/man3/gfs_rename.3.html share/doc/gfarm/html/ja/ref/man3/gfs_rmdir.3.html share/doc/gfarm/html/ja/ref/man3/gfs_stat.3.html share/doc/gfarm/html/ja/ref/man3/gfs_stat_free.3.html share/doc/gfarm/html/ja/ref/man3/gfs_unlink.3.html share/doc/gfarm/html/ja/ref/man3/gfs_unlink_section.3.html share/doc/gfarm/html/ja/ref/man3/gfs_utimes.3.html share/doc/gfarm/html/ja/ref/man5/gfarm.conf.5.html share/doc/gfarm/html/ja/ref/man8/gfmd.8.html share/doc/gfarm/html/ja/ref/man8/gfsd.8.html share/doc/gfarm/html/ja/user/export-gfarm.html share/doc/gfarm/html/ja/user/index.html share/doc/gfarm/html/ja/user/nfs-gfarmfs.html share/doc/gfarm/html/ja/user/samba-gfarmfs.html share/doc/gfarm/html/ja/user/samba-hook.html share/doc/gfarm/html/ja/user/smboverssh.html share/doc/gfarm/html/pic/gfarm-logo.gif share/gfarm/config/bdb.DB_CONFIG.in share/gfarm/config/config-gfarm.ldap share/gfarm/config/config-gfarm.postgresql share/gfarm/config/config-gfarm.sysdep share/gfarm/config/gfarm.conf-ldap.in share/gfarm/config/gfarm.conf-postgresql.in share/gfarm/config/gfarm.schema share/gfarm/config/gfarm.schema-1.sql share/gfarm/config/gfarm.schema-2.sql share/gfarm/config/initial.ldif.in share/gfarm/config/gfarm-pgsql.in share/gfarm/config/gfarm-slapd.in share/gfarm/config/gfmd.in share/gfarm/config/gfarm_agent.in share/gfarm/config/gfsd.in share/gfarm/config/slapd.conf-2.0.in share/gfarm/config/slapd.conf-2.1.in share/java/gfront.jar @unexec rmdir %%LOCALBASE%%/share/java 2>/dev/null || true @dirrm share/gfarm/config @dirrm share/gfarm @dirrm share/doc/gfarm/html/pic @dirrm share/doc/gfarm/html/ja/user @dirrm share/doc/gfarm/html/ja/ref/man8 @dirrm share/doc/gfarm/html/ja/ref/man5 @dirrm share/doc/gfarm/html/ja/ref/man3 @dirrm share/doc/gfarm/html/ja/ref/man1 @dirrm share/doc/gfarm/html/ja/ref @dirrm share/doc/gfarm/html/ja @dirrm share/doc/gfarm/html/en/user @dirrm share/doc/gfarm/html/en/ref/man8 @dirrm share/doc/gfarm/html/en/ref/man5 @dirrm share/doc/gfarm/html/en/ref/man3 @dirrm share/doc/gfarm/html/en/ref/man1 @dirrm share/doc/gfarm/html/en/ref @dirrm share/doc/gfarm/html/en @dirrm share/doc/gfarm/html @dirrm share/doc/gfarm @dirrm include/gfarm gfarm-2.4.1/package/freebsd/files/0000755000000000000000000000000011507222730015416 5ustar rootrootgfarm-2.4.1/package/freebsd/files/gfmd.sh0000644000000000000000000000173411507222717016701 0ustar rootroot#!/bin/sh # # $FreeBSD$ # # PROVIDE: gfmd # REQUIRE: NETWORKING SERVERS # BEFORE: DAEMON # KEYWORD: FreeBSD shutdown # # Add the following lines to /etc/rc.conf to enable gfmd: # gfmd_enable (bool): Set to "NO" by default. # gfmd_flags (str): Set to "" by default. # Extra flags passed to start command # . %%RC_SUBR%% name="gfmd" FILE=${name} rcvar=`set_rcvar` command="%%PREFIX%%/sbin/${name}" pidfile="/var/run/${FILE}.pid" required_files=%%SYSCONFDIR%%/gfarm.conf # add more flags through ${${name}_flags} command_args="-P $pidfile" globus_location="%%GLOBUS_LOCATION%%" [ -z "$gfmd_enable" ] && gfmd_enable="NO" [ -z "$gfmd_flags" ] && gfmd_flags="" load_rc_config ${FILE} if [ -z "${GLOBUS_LOCATION-}" ] && [ -n "$globus_location" ] && [ -f "$globus_location/etc/globus-user-env.sh" ] then GLOBUS_LOCATION="$globus_location" export GLOBUS_LOCATION . "$GLOBUS_LOCATION/etc/globus-user-env.sh" fi run_rc_command "$1" gfarm-2.4.1/package/freebsd/files/gfsd.sh0000644000000000000000000000173411507222717016707 0ustar rootroot#!/bin/sh # # $FreeBSD$ # # PROVIDE: gfsd # REQUIRE: NETWORKING SERVERS # BEFORE: DAEMON # KEYWORD: FreeBSD shutdown # # Add the following lines to /etc/rc.conf to enable gfsd: # gfsd_enable (bool): Set to "NO" by default. # gfsd_flags (str): Set to "" by default. # Extra flags passed to start command # . %%RC_SUBR%% name="gfsd" FILE=${name} rcvar=`set_rcvar` command="%%PREFIX%%/sbin/${name}" pidfile="/var/run/${FILE}.pid" required_files=%%SYSCONFDIR%%/gfarm.conf # add more flags through ${${name}_flags} command_args="-P $pidfile" globus_location="%%GLOBUS_LOCATION%%" [ -z "$gfsd_enable" ] && gfsd_enable="NO" [ -z "$gfsd_flags" ] && gfsd_flags="" load_rc_config ${FILE} if [ -z "${GLOBUS_LOCATION-}" ] && [ -n "$globus_location" ] && [ -f "$globus_location/etc/globus-user-env.sh" ] then GLOBUS_LOCATION="$globus_location" export GLOBUS_LOCATION . "$GLOBUS_LOCATION/etc/globus-user-env.sh" fi run_rc_command "$1" gfarm-2.4.1/package/redhat/0000755000000000000000000000000011507222730014151 5ustar rootrootgfarm-2.4.1/package/redhat/gfarm.sh0000755000000000000000000000004411507222717015607 0ustar rootrootgfcd() { eval "`gfsetdir -s $1`"; } gfarm-2.4.1/package/redhat/gfarm-slapd0000755000000000000000000000216311507222717016303 0ustar rootroot#! /bin/sh # # gfarm-slapd # # chkconfig: 2345 85 15 # description: LDAP slapd for Gfarm # processname: slapd # pidfile: /var/run/gfarm-slapd.pid # config: /etc/gfarm-ldap/slapd.conf # Source function library. . /etc/rc.d/init.d/functions prog="slapd" FILE="gfarm-slapd" CONF=/etc/gfarm-ldap/slapd.conf PORT=389 DAEMON=/usr/sbin/$prog LOCKFILE=/var/lock/subsys/$FILE # Get config. . /etc/sysconfig/network # Check that networking is up. if [ ${NETWORKING} = "no" ] then exit 0 fi # pull in sysconfig settings [ -f "/etc/sysconfig/$FILE" ] && . "/etc/sysconfig/$FILE" [ -f "$DAEMON" ] || exit 0 [ -f "$CONF" ] || exit 0 RETVAL=0 case "$1" in start) echo -n "Starting $FILE: " daemon "$DAEMON" -f "$CONF" -h "ldap://:$PORT/" RETVAL=$? [ $RETVAL -eq 0 ] && touch "$LOCKFILE" echo ;; stop) echo -n "Stopping $FILE: " killproc "$FILE" RETVAL=$? [ $RETVAL -eq 0 ] && rm -f "$LOCKFILE" echo ;; status) status "$PROG" RETVAL=$? ;; restart|reload) $0 stop $0 start # is this available?: killall -HUP "$PROG" RETVAL=$? ;; *) echo "Usage: $FILE {start|stop|status|restart|reload}" exit 1 esac exit $REVAL gfarm-2.4.1/package/redhat/gfarm.spec0000644000000000000000000010143211507222717016127 0ustar rootroot# Part 1 data definition %define pkg gfarm %define ver 2.4.1 %define rel 1 # a hook to make RPM version number different from %{ver} %define pkgver %{ver} %define prefix %{_prefix} %define lib_prefix %{_libdir} %define man_prefix %{_mandir} %define share_prefix %{prefix}/share/%{pkg} %define doc_prefix %{prefix}/share/doc/%{name}-%{ver} %define html_prefix %{doc_prefix}/html %define etc_prefix /etc %define rc_prefix %{etc_prefix}/rc.d/init.d %define profile_prefix %{etc_prefix}/profile.d %define sysconfdir %{etc_prefix} # whether "ns" is included in this release or not. %define have_ns 0 %define gfarm_v2_not_yet 0 # # check && enable/disable MPI # # do the followings to make gfwc # # env MPI_PREFIX=/usr/local/mpich rpmbuild -bb gfarm.spec %define mpi_prefix %(echo "${MPI_PREFIX}") %define mpi %(test -x %{mpi_prefix}/bin/mpicc && echo 1 || echo 0) # # check && enable/disable Globus # # do the followings to build gfarm-gsi-*.rpm: # # env GLOBUS_PREFIX=/usr/grid GLOBUS_FLAVOR=gcc32 rpmbuild -bb gfarm.spec # or # # env GLOBUS_PREFIX=/usr/grid GLOBUS_FLAVOR=gcc32 \ # GFARM_CONFIGURE_OPTION=--with-globus-static rpmbuild -bb gfarm.spec %define globus_prefix %(echo "${GLOBUS_PREFIX}") %define globus_flavor %(echo "${GLOBUS_FLAVOR}") %define globus %(test -n "${GLOBUS_PREFIX}" -a -n "${GLOBUS_FLAVOR}" -a -r %{globus_prefix}/include/%{globus_flavor}/gssapi.h && echo 1 || echo 0) %if %{globus} %define package_name %{pkg}-gsi %else %define package_name %{pkg} %endif Summary: Gfarm File System 2 Name: %{package_name} Version: %pkgver Release: %{rel}%{?dist} Source: %{pkg}-%{ver}.tar.gz #Patch: %{pkg}.patch #%Patch0: gfarm-1.2-patch1.diff #%Patch1: gfarm-1.2-patch2.diff #%Patch2: gfarm-1.2-patch3.diff #%Patch3: gfarm-1.2-patch4.diff Group: Applications/Internet License: BSD Vendor: National Institute of Advanced Industrial Science and Technology (AIST) and Osamu Tatebe URL: http://datafarm.apgrid.org/ Packager: Osamu Tatebe BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot %package doc Summary: Document for Gfarm file system Group: Documentation # always provide "gfarm-doc" as a virtual package. %if %{globus} Provides: %{pkg}-doc = %{ver}-%{rel} %endif %package libs Summary: Runtime libraries for Gfarm file system Group: System Environment/Libraries # always provide "gfarm-libs" as a virtual package. %if %{globus} Provides: %{pkg}-libs = %{ver}-%{rel} %endif BuildRequires: openssl-devel, postgresql-devel %package client Summary: Clients for Gfarm file system Group: Applications/Internet # always provide "gfarm-client" as a virtual package. %if %{globus} Provides: %{pkg}-client = %{ver}-%{rel} %endif Requires: %{package_name}-libs = %{ver} %package fsnode Summary: File system daemon for Gfarm file system Group: System Environment/Daemons # always provide "gfarm-fsnode" as a virtual package. %if %{globus} Provides: %{pkg}-fsnode = %{ver}-%{rel} %endif Requires: %{package_name}-libs = %{ver}, %{package_name}-client = %{ver} %package server Summary: Metadata server for Gfarm file system Group: System Environment/Daemons # always provide "gfarm-server" as a virtual package. %if %{globus} Provides: %{pkg}-server = %{ver}-%{rel} %endif Requires: %{package_name}-libs = %{ver} %package devel Summary: Development header files and libraries for Gfarm file system Group: Development/Libraries %if %{globus} Provides: %{pkg}-devel = %{ver}-%{rel} %endif Requires: %{package_name}-libs = %{ver} %description The Gfarm filesystem is a distributed filesystem consisting of the local storage of commodity PCs. PCs in a local area network, compute nodes in a single cluster, multiple clusters in wide area, comprise a large-scale, high-performance shared network filesystem. The Gfarm filesystem solves performance and reliability problems in NFS and AFS by means of multiple file replicas. It not only prevents performance degradation due to access concentration, but also supports fault tolerance and disaster recovery. %description doc Documentation for Gfarm file system %description libs Runtime libraries for Gfarm file system %description client Clients for Gfarm file system %description fsnode File system daemon for Gfarm file system %description server Metadata server for Gfarm file system %description devel Development header files and libraries for Gfarm file system %changelog * Thu Jul 22 2010 Osamu Tatebe 2.3.2-1 - Gfarm version 2.4.0 released * Wed Jul 21 2010 Osamu Tatebe 2.3.2-3 - portability fix for old rpm that does not support nested conditionals - compatibility fix for Linux 2.4 and old OpenLDAP library * Tue Jul 20 2010 Osamu Tatebe 2.3.2-2 - gfhost -R does not work [sf.net trac #120] - retry another file system node in GFARM_ERR_FILE_MIGRATED case [sf.net trac #117] * Thu Jul 1 2010 Osamu Tatebe 2.3.2-1 - Gfarm version 2.3.2 released * Fri Nov 28 2007 Osamu Tatebe 2.0.0-1 - first release of Gfarm file system version 2 * Tue Aug 8 2006 SODA Noriyuki - restart gfsd, gfmd and gfarm_agent at update, if they are already running. * Fri Apr 24 2003 Tohru Sotoyama - first public release for version 1.0b1 * Wed Nov 27 2002 Tohru Sotoyama - first release for version 0.1 # Part 2 script %prep rm -rf ${RPM_BUILD_ROOT} mkdir -p $RPM_BUILD_ROOT %setup -n %{pkg}-%{ver} #%patch -p1 #%patch0 -p1 #%patch1 -p1 #%patch2 -p1 #%patch3 -p1 %build ./configure --prefix=%{prefix} \ --libdir=%{lib_prefix} \ --sysconfdir=%{sysconfdir} \ --with-postgresql=/usr \ --with-openldap=/usr \ --with-openssl=/usr \ `test "%{globus}" -ne 0 && echo \ --with-globus=%{globus_prefix} \ --with-globus-flavor=%{globus_flavor}` \ `test "%{mpi}" -ne 0 && echo --with-mpi=%{mpi_prefix}` \ ${GFARM_CONFIGURE_OPTION} make %install make DESTDIR=${RPM_BUILD_ROOT} \ default_docdir=%{doc_prefix} \ default_mandir=%{man_prefix} install %if %{gfarm_v2_not_yet} mkdir -p ${RPM_BUILD_ROOT}%{profile_prefix} cp -p package/redhat/gfarm.{csh,sh} ${RPM_BUILD_ROOT}%{profile_prefix} chmod +x ${RPM_BUILD_ROOT}%{profile_prefix}/* %endif %clean rm -rf ${RPM_BUILD_ROOT} %post libs -p /sbin/ldconfig %postun libs -p /sbin/ldconfig %post fsnode if [ ! -f /etc/gfarm2.conf ]; then echo "copy /etc/gfarm2.conf from a metadata server and" echo run %{prefix}/bin/config-gfsd fi %post server if [ ! -f /etc/gfmd.conf ]; then echo run %{prefix}/bin/config-gfarm to configure Gfarm file system fi %preun fsnode if [ "$1" = 0 ] then # XXX This doesn't deal with /etc/init.d/gfsd-IP_ADDRESS. if [ -f /etc/init.d/gfsd ]; then /sbin/service gfsd stop > /dev/null 2>&1 || : /sbin/chkconfig --del gfsd > /dev/null 2>&1 || : fi fi %pre fsnode useradd -c "Gfarm gfsd" _gfarmfs >/dev/null 2>&1 || : %pre server useradd -c "Gfarm gfsd" _gfarmfs >/dev/null 2>&1 || : %preun server if [ "$1" = 0 ] then if [ -f /etc/init.d/gfmd ]; then /sbin/service gfmd stop > /dev/null 2>&1 || : /sbin/chkconfig --del gfmd > /dev/null 2>&1 || : fi if [ -f /etc/init.d/gfarm-slapd ]; then /sbin/service gfarm-slapd stop > /dev/null 2>&1 || : /sbin/chkconfig --del gfarm-slapd > /dev/null 2>&1 || : fi if [ -f /etc/init.d/gfarm-pgsql ]; then /sbin/service gfarm-pgsql stop > /dev/null 2>&1 || : /sbin/chkconfig --del gfarm-pgsql > /dev/null 2>&1 || : fi fi %postun fsnode if [ "$1" -ge 1 ] then # XXX This doesn't deal with /etc/init.d/gfsd-IP_ADDRESS. if [ -f /etc/init.d/gfsd ] && /sbin/service gfsd status > /dev/null 2>&1 then /sbin/service gfsd restart > /dev/null 2>&1 || : fi fi %postun server if [ "$1" -ge 1 ] then if [ -f /etc/init.d/gfmd ] && /sbin/service gfmd status > /dev/null 2>&1 then /sbin/service gfmd restart > /dev/null 2>&1 || : fi # We don't have to restart gfarm-slapd and gfarm-pgsql, # because the binaries aren't included in the gfarm RPMs. fi # Part 3 file list %files doc %defattr(-,root,root) %if %{gfarm_v2_not_yet} %{man_prefix}/man1/gfarm_agent.1.gz %{man_prefix}/man1/gfcd.1.gz %endif %{man_prefix}/man1/gfchgrp.1.gz %{man_prefix}/man1/gfchmod.1.gz %{man_prefix}/man1/gfchown.1.gz %{man_prefix}/man1/gfdf.1.gz %if %{gfarm_v2_not_yet} %{man_prefix}/man1/gfexec.1.gz %{man_prefix}/man1/gfexport.1.gz %endif %{man_prefix}/man1/gffindxmlattr.1.gz %if %{gfarm_v2_not_yet} %{man_prefix}/man1/gfgrep.1.gz %endif %{man_prefix}/man1/gfgroup.1.gz %{man_prefix}/man1/gfhost.1.gz %if %{gfarm_v2_not_yet} %{man_prefix}/man1/gfimport_fixed.1.gz %{man_prefix}/man1/gfimport_text.1.gz %endif %{man_prefix}/man1/gfkey.1.gz %{man_prefix}/man1/gfln.1.gz %{man_prefix}/man1/gfls.1.gz %{man_prefix}/man1/gfmkdir.1.gz %if %{gfarm_v2_not_yet} %{man_prefix}/man1/gfmpirun_p4.1.gz %endif %{man_prefix}/man1/gfmv.1.gz %if %{gfarm_v2_not_yet} %{man_prefix}/man1/gfps.1.gz %{man_prefix}/man1/gfpwd.1.gz %{man_prefix}/man1/gfrcmd.1.gz %{man_prefix}/man1/gfreg.1.gz %endif %{man_prefix}/man1/gfrep.1.gz %if %{gfarm_v2_not_yet} %{man_prefix}/man1/gfrm.1.gz %endif %{man_prefix}/man1/gfrmdir.1.gz %{man_prefix}/man1/gfsched.1.gz %if %{gfarm_v2_not_yet} %{man_prefix}/man1/gfront.1.gz %{man_prefix}/man1/gfrsh.1.gz %{man_prefix}/man1/gfrun.1.gz %{man_prefix}/man1/gfsetdir.1.gz %{man_prefix}/man1/gfssh.1.gz %endif %{man_prefix}/man1/gfstat.1.gz %{man_prefix}/man1/gfstatus.1.gz %if %{gfarm_v2_not_yet} %{man_prefix}/man1/gfusage.1.gz %endif %{man_prefix}/man1/gfuser.1.gz %if %{gfarm_v2_not_yet} %{man_prefix}/man1/gfwc.1.gz %endif %{man_prefix}/man1/gfwhere.1.gz %{man_prefix}/man1/gfwhoami.1.gz %{man_prefix}/man1/gfxattr.1.gz %{man_prefix}/man3/gfarm.3.gz %{man_prefix}/man3/gfarm_initialize.3.gz %{man_prefix}/man3/gfarm_terminate.3.gz %{man_prefix}/man3/gfs_pio_close.3.gz %{man_prefix}/man3/gfs_pio_create.3.gz %{man_prefix}/man3/gfs_pio_open.3.gz %{man_prefix}/man3/gfs_pio_read.3.gz %{man_prefix}/man3/gfs_pio_write.3.gz %if %{gfarm_v2_not_yet} %{man_prefix}/man3/gfarm_strings_free_deeply.3.gz %{man_prefix}/man3/gfarm_url_fragments_replicate.3.gz %{man_prefix}/man3/gfarm_url_hosts_schedule.3.gz %{man_prefix}/man3/gfarm_url_section_replicate_from_to.3.gz %{man_prefix}/man3/gfarm_url_section_replicate_to.3.gz %{man_prefix}/man3/gfs_chdir.3.gz %{man_prefix}/man3/gfs_chmod.3.gz %{man_prefix}/man3/gfs_closedir.3.gz %{man_prefix}/man3/gfs_glob.3.gz %{man_prefix}/man3/gfs_glob_add.3.gz %{man_prefix}/man3/gfs_glob_free.3.gz %{man_prefix}/man3/gfs_glob_init.3.gz %{man_prefix}/man3/gfs_mkdir.3.gz %{man_prefix}/man3/gfs_opendir.3.gz %{man_prefix}/man3/gfs_pio_datasync.3.gz %{man_prefix}/man3/gfs_pio_eof.3.gz %{man_prefix}/man3/gfs_pio_error.3.gz %{man_prefix}/man3/gfs_pio_flush.3.gz %{man_prefix}/man3/gfs_pio_getc.3.gz %{man_prefix}/man3/gfs_pio_getline.3.gz %{man_prefix}/man3/gfs_pio_gets.3.gz %{man_prefix}/man3/gfs_pio_putc.3.gz %{man_prefix}/man3/gfs_pio_putline.3.gz %{man_prefix}/man3/gfs_pio_puts.3.gz %{man_prefix}/man3/gfs_pio_readdelim.3.gz %{man_prefix}/man3/gfs_pio_readline.3.gz %{man_prefix}/man3/gfs_pio_seek.3.gz %{man_prefix}/man3/gfs_pio_set_local.3.gz %{man_prefix}/man3/gfs_pio_set_view_index.3.gz %{man_prefix}/man3/gfs_pio_set_view_local.3.gz %{man_prefix}/man3/gfs_pio_sync.3.gz %{man_prefix}/man3/gfs_pio_truncate.3.gz %{man_prefix}/man3/gfs_pio_ungetc.3.gz %{man_prefix}/man3/gfs_readdir.3.gz %{man_prefix}/man3/gfs_realpath.3.gz %{man_prefix}/man3/gfs_rename.3.gz %{man_prefix}/man3/gfs_rmdir.3.gz %{man_prefix}/man3/gfs_stat.3.gz %{man_prefix}/man3/gfs_stat_free.3.gz %{man_prefix}/man3/gfs_unlink.3.gz %{man_prefix}/man3/gfs_unlink_section.3.gz %{man_prefix}/man3/gfs_utimes.3.gz %endif %{man_prefix}/man5/gfarm2.conf.5.gz %{man_prefix}/man8/gfmd.8.gz %{man_prefix}/man8/gfsd.8.gz %if %{gfarm_v2_not_yet} %{man_prefix}/ja/man1/gfarm_agent.1.gz %{man_prefix}/ja/man1/gfcd.1.gz %endif %{man_prefix}/ja/man1/gfchgrp.1.gz %{man_prefix}/ja/man1/gfchmod.1.gz %{man_prefix}/ja/man1/gfchown.1.gz %{man_prefix}/ja/man1/gfdf.1.gz %if %{gfarm_v2_not_yet} %{man_prefix}/ja/man1/gfexec.1.gz %{man_prefix}/ja/man1/gfexport.1.gz %endif %{man_prefix}/ja/man1/gffindxmlattr.1.gz %if %{gfarm_v2_not_yet} %{man_prefix}/ja/man1/gfgrep.1.gz %endif %{man_prefix}/ja/man1/gfgroup.1.gz %{man_prefix}/ja/man1/gfhost.1.gz %if %{gfarm_v2_not_yet} %{man_prefix}/ja/man1/gfimport_fixed.1.gz %{man_prefix}/ja/man1/gfimport_text.1.gz %endif %{man_prefix}/ja/man1/gfkey.1.gz %{man_prefix}/ja/man1/gfln.1.gz %{man_prefix}/ja/man1/gfls.1.gz %{man_prefix}/ja/man1/gfmkdir.1.gz %if %{gfarm_v2_not_yet} %{man_prefix}/ja/man1/gfmpirun_p4.1.gz %endif %{man_prefix}/ja/man1/gfmv.1.gz %if %{gfarm_v2_not_yet} %{man_prefix}/ja/man1/gfps.1.gz %{man_prefix}/ja/man1/gfpwd.1.gz %{man_prefix}/ja/man1/gfrcmd.1.gz %{man_prefix}/ja/man1/gfreg.1.gz %endif %{man_prefix}/ja/man1/gfrep.1.gz %if %{gfarm_v2_not_yet} %{man_prefix}/ja/man1/gfrm.1.gz %endif %{man_prefix}/ja/man1/gfrmdir.1.gz %{man_prefix}/ja/man1/gfsched.1.gz %if %{gfarm_v2_not_yet} %{man_prefix}/ja/man1/gfront.1.gz %{man_prefix}/ja/man1/gfrsh.1.gz %{man_prefix}/ja/man1/gfrun.1.gz %{man_prefix}/ja/man1/gfsetdir.1.gz %{man_prefix}/ja/man1/gfssh.1.gz %endif %{man_prefix}/ja/man1/gfstat.1.gz %{man_prefix}/ja/man1/gfstatus.1.gz %if %{gfarm_v2_not_yet} %{man_prefix}/ja/man1/gfusage.1.gz %endif %{man_prefix}/ja/man1/gfuser.1.gz %if %{gfarm_v2_not_yet} %{man_prefix}/ja/man1/gfwc.1.gz %endif %{man_prefix}/ja/man1/gfwhere.1.gz %{man_prefix}/ja/man1/gfwhoami.1.gz %{man_prefix}/ja/man1/gfxattr.1.gz %{man_prefix}/ja/man3/gfarm.3.gz %{man_prefix}/ja/man3/gfarm_initialize.3.gz %{man_prefix}/ja/man3/gfarm_terminate.3.gz %{man_prefix}/ja/man3/gfs_pio_close.3.gz %{man_prefix}/ja/man3/gfs_pio_create.3.gz %{man_prefix}/ja/man3/gfs_pio_open.3.gz %{man_prefix}/ja/man3/gfs_pio_read.3.gz %{man_prefix}/ja/man3/gfs_pio_write.3.gz %if %{gfarm_v2_not_yet} %{man_prefix}/ja/man3/gfarm_hostlist_read.3.gz %{man_prefix}/ja/man3/gfarm_import_fragment_config_read.3.gz %{man_prefix}/ja/man3/gfarm_import_fragment_size_alloc.3.gz %{man_prefix}/ja/man3/gfarm_stringlist_add.3.gz %{man_prefix}/ja/man3/gfarm_stringlist_cat.3.gz %{man_prefix}/ja/man3/gfarm_stringlist_elem.3.gz %{man_prefix}/ja/man3/gfarm_stringlist_free.3.gz %{man_prefix}/ja/man3/gfarm_stringlist_init.3.gz %{man_prefix}/ja/man3/gfarm_stringlist_length.3.gz %{man_prefix}/ja/man3/gfarm_strings_free_deeply.3.gz %{man_prefix}/ja/man3/gfarm_url_fragments_replicate.3.gz %{man_prefix}/ja/man3/gfarm_url_hosts_schedule.3.gz %{man_prefix}/ja/man3/gfarm_url_program_deliver.3.gz %{man_prefix}/ja/man3/gfarm_url_program_register.3.gz %{man_prefix}/ja/man3/gfarm_url_section_replicate_from_to.3.gz %{man_prefix}/ja/man3/gfarm_url_section_replicate_to.3.gz %{man_prefix}/ja/man3/gfs_chdir.3.gz %{man_prefix}/ja/man3/gfs_chmod.3.gz %{man_prefix}/ja/man3/gfs_closedir.3.gz %{man_prefix}/ja/man3/gfs_glob.3.gz %{man_prefix}/ja/man3/gfs_glob_add.3.gz %{man_prefix}/ja/man3/gfs_glob_free.3.gz %{man_prefix}/ja/man3/gfs_glob_init.3.gz %{man_prefix}/ja/man3/gfs_mkdir.3.gz %{man_prefix}/ja/man3/gfs_opendir.3.gz %{man_prefix}/ja/man3/gfs_pio_datasync.3.gz %{man_prefix}/ja/man3/gfs_pio_eof.3.gz %{man_prefix}/ja/man3/gfs_pio_error.3.gz %{man_prefix}/ja/man3/gfs_pio_flush.3.gz %{man_prefix}/ja/man3/gfs_pio_getc.3.gz %{man_prefix}/ja/man3/gfs_pio_getline.3.gz %{man_prefix}/ja/man3/gfs_pio_gets.3.gz %{man_prefix}/ja/man3/gfs_pio_putc.3.gz %{man_prefix}/ja/man3/gfs_pio_putline.3.gz %{man_prefix}/ja/man3/gfs_pio_puts.3.gz %{man_prefix}/ja/man3/gfs_pio_readdelim.3.gz %{man_prefix}/ja/man3/gfs_pio_readline.3.gz %{man_prefix}/ja/man3/gfs_pio_seek.3.gz %{man_prefix}/ja/man3/gfs_pio_set_local.3.gz %{man_prefix}/ja/man3/gfs_pio_set_view_index.3.gz %{man_prefix}/ja/man3/gfs_pio_set_view_local.3.gz %{man_prefix}/ja/man3/gfs_pio_sync.3.gz %{man_prefix}/ja/man3/gfs_pio_truncate.3.gz %{man_prefix}/ja/man3/gfs_pio_ungetc.3.gz %{man_prefix}/ja/man3/gfs_readdir.3.gz %{man_prefix}/ja/man3/gfs_realpath.3.gz %{man_prefix}/ja/man3/gfs_rename.3.gz %{man_prefix}/ja/man3/gfs_rmdir.3.gz %{man_prefix}/ja/man3/gfs_stat.3.gz %{man_prefix}/ja/man3/gfs_stat_free.3.gz %{man_prefix}/ja/man3/gfs_unlink.3.gz %{man_prefix}/ja/man3/gfs_unlink_section.3.gz %{man_prefix}/ja/man3/gfs_utimes.3.gz %endif %{man_prefix}/ja/man5/gfarm2.conf.5.gz %{man_prefix}/ja/man8/gfmd.8.gz %{man_prefix}/ja/man8/gfsd.8.gz %{html_prefix}/index.html %{html_prefix}/en/ref/index.html %if %{gfarm_v2_not_yet} %{html_prefix}/en/ref/man1/gfarm_agent.1.html %{html_prefix}/en/ref/man1/gfcd.1.html %endif %{html_prefix}/en/ref/man1/gfchgrp.1.html %{html_prefix}/en/ref/man1/gfchmod.1.html %{html_prefix}/en/ref/man1/gfchown.1.html %{html_prefix}/en/ref/man1/gfdf.1.html %if %{gfarm_v2_not_yet} %{html_prefix}/en/ref/man1/gfexec.1.html %{html_prefix}/en/ref/man1/gfexport.1.html %endif %{html_prefix}/en/ref/man1/gffindxmlattr.1.html %if %{gfarm_v2_not_yet} %{html_prefix}/en/ref/man1/gfgrep.1.html %endif %{html_prefix}/en/ref/man1/gfgroup.1.html %{html_prefix}/en/ref/man1/gfhost.1.html %if %{gfarm_v2_not_yet} %{html_prefix}/en/ref/man1/gfimport_fixed.1.html %{html_prefix}/en/ref/man1/gfimport_text.1.html %endif %{html_prefix}/en/ref/man1/gfkey.1.html %{html_prefix}/en/ref/man1/gfln.1.html %{html_prefix}/en/ref/man1/gfls.1.html %{html_prefix}/en/ref/man1/gfmkdir.1.html %if %{gfarm_v2_not_yet} %{html_prefix}/en/ref/man1/gfmpirun_p4.1.html %endif %{html_prefix}/en/ref/man1/gfmv.1.html %if %{gfarm_v2_not_yet} %{html_prefix}/en/ref/man1/gfps.1.html %{html_prefix}/en/ref/man1/gfpwd.1.html %{html_prefix}/en/ref/man1/gfrcmd.1.html %{html_prefix}/en/ref/man1/gfreg.1.html %endif %{html_prefix}/en/ref/man1/gfrep.1.html %if %{gfarm_v2_not_yet} %{html_prefix}/en/ref/man1/gfrm.1.html %endif %{html_prefix}/en/ref/man1/gfrmdir.1.html %{html_prefix}/en/ref/man1/gfsched.1.html %if %{gfarm_v2_not_yet} %{html_prefix}/en/ref/man1/gfront.1.html %{html_prefix}/en/ref/man1/gfrun.1.html %{html_prefix}/en/ref/man1/gfsetdir.1.html %endif %{html_prefix}/en/ref/man1/gfstat.1.html %{html_prefix}/en/ref/man1/gfstatus.1.html %if %{gfarm_v2_not_yet} %{html_prefix}/en/ref/man1/gfusage.1.html %endif %{html_prefix}/en/ref/man1/gfuser.1.html %if %{gfarm_v2_not_yet} %{html_prefix}/en/ref/man1/gfwc.1.html %endif %{html_prefix}/en/ref/man1/gfwhere.1.html %{html_prefix}/en/ref/man1/gfwhoami.1.html %{html_prefix}/en/ref/man1/gfxattr.1.html %{html_prefix}/en/ref/man3/gfarm.3.html %{html_prefix}/en/ref/man3/gfarm_initialize.3.html %{html_prefix}/en/ref/man3/gfarm_terminate.3.html %{html_prefix}/en/ref/man3/gfs_pio_close.3.html %{html_prefix}/en/ref/man3/gfs_pio_create.3.html %{html_prefix}/en/ref/man3/gfs_pio_open.3.html %{html_prefix}/en/ref/man3/gfs_pio_read.3.html %{html_prefix}/en/ref/man3/gfs_pio_write.3.html %if %{gfarm_v2_not_yet} %{html_prefix}/en/ref/man3/gfarm_strings_free_deeply.3.html %{html_prefix}/en/ref/man3/gfarm_url_fragments_replicate.3.html %{html_prefix}/en/ref/man3/gfarm_url_hosts_schedule.3.html %{html_prefix}/en/ref/man3/gfarm_url_section_replicate_from_to.3.html %{html_prefix}/en/ref/man3/gfarm_url_section_replicate_to.3.html %{html_prefix}/en/ref/man3/gfs_chdir.3.html %{html_prefix}/en/ref/man3/gfs_chmod.3.html %{html_prefix}/en/ref/man3/gfs_closedir.3.html %{html_prefix}/en/ref/man3/gfs_glob.3.html %{html_prefix}/en/ref/man3/gfs_glob_add.3.html %{html_prefix}/en/ref/man3/gfs_glob_free.3.html %{html_prefix}/en/ref/man3/gfs_glob_init.3.html %{html_prefix}/en/ref/man3/gfs_mkdir.3.html %{html_prefix}/en/ref/man3/gfs_opendir.3.html %{html_prefix}/en/ref/man3/gfs_pio_datasync.3.html %{html_prefix}/en/ref/man3/gfs_pio_eof.3.html %{html_prefix}/en/ref/man3/gfs_pio_error.3.html %{html_prefix}/en/ref/man3/gfs_pio_flush.3.html %{html_prefix}/en/ref/man3/gfs_pio_getc.3.html %{html_prefix}/en/ref/man3/gfs_pio_getline.3.html %{html_prefix}/en/ref/man3/gfs_pio_gets.3.html %{html_prefix}/en/ref/man3/gfs_pio_putc.3.html %{html_prefix}/en/ref/man3/gfs_pio_putline.3.html %{html_prefix}/en/ref/man3/gfs_pio_puts.3.html %{html_prefix}/en/ref/man3/gfs_pio_readdelim.3.html %{html_prefix}/en/ref/man3/gfs_pio_readline.3.html %{html_prefix}/en/ref/man3/gfs_pio_seek.3.html %{html_prefix}/en/ref/man3/gfs_pio_set_local.3.html %{html_prefix}/en/ref/man3/gfs_pio_set_view_index.3.html %{html_prefix}/en/ref/man3/gfs_pio_set_view_local.3.html %{html_prefix}/en/ref/man3/gfs_pio_sync.3.html %{html_prefix}/en/ref/man3/gfs_pio_truncate.3.html %{html_prefix}/en/ref/man3/gfs_pio_ungetc.3.html %{html_prefix}/en/ref/man3/gfs_readdir.3.html %{html_prefix}/en/ref/man3/gfs_realpath.3.html %{html_prefix}/en/ref/man3/gfs_rename.3.html %{html_prefix}/en/ref/man3/gfs_rmdir.3.html %{html_prefix}/en/ref/man3/gfs_stat.3.html %{html_prefix}/en/ref/man3/gfs_stat_free.3.html %{html_prefix}/en/ref/man3/gfs_unlink.3.html %{html_prefix}/en/ref/man3/gfs_unlink_section.3.html %{html_prefix}/en/ref/man3/gfs_utimes.3.html %endif %{html_prefix}/en/ref/man5/gfarm2.conf.5.html %{html_prefix}/en/ref/man8/gfmd.8.html %{html_prefix}/en/ref/man8/gfsd.8.html %{html_prefix}/en/user/index.html %{html_prefix}/en/user/nfs-gfarmfs.html %{html_prefix}/en/user/samba-gfarmfs.html # XXX NOTYET %{html_prefix}/en/user/samba-hook.html %{html_prefix}/ja/ref/index.html %if %{gfarm_v2_not_yet} %{html_prefix}/ja/ref/man1/gfarm_agent.1.html %{html_prefix}/ja/ref/man1/gfcd.1.html %endif %{html_prefix}/ja/ref/man1/gfchgrp.1.html %{html_prefix}/ja/ref/man1/gfchmod.1.html %{html_prefix}/ja/ref/man1/gfchown.1.html %{html_prefix}/ja/ref/man1/gfdf.1.html %if %{gfarm_v2_not_yet} %{html_prefix}/ja/ref/man1/gfexec.1.html %{html_prefix}/ja/ref/man1/gfexport.1.html %endif %{html_prefix}/ja/ref/man1/gffindxmlattr.1.html %if %{gfarm_v2_not_yet} %{html_prefix}/ja/ref/man1/gfgrep.1.html %endif %{html_prefix}/ja/ref/man1/gfgroup.1.html %{html_prefix}/ja/ref/man1/gfhost.1.html %if %{gfarm_v2_not_yet} %{html_prefix}/ja/ref/man1/gfimport_fixed.1.html %{html_prefix}/ja/ref/man1/gfimport_text.1.html %endif %{html_prefix}/ja/ref/man1/gfkey.1.html %{html_prefix}/ja/ref/man1/gfln.1.html %{html_prefix}/ja/ref/man1/gfls.1.html %{html_prefix}/ja/ref/man1/gfmkdir.1.html %if %{gfarm_v2_not_yet} %{html_prefix}/ja/ref/man1/gfmpirun_p4.1.html %endif %{html_prefix}/ja/ref/man1/gfmv.1.html %if %{gfarm_v2_not_yet} %{html_prefix}/ja/ref/man1/gfps.1.html %{html_prefix}/ja/ref/man1/gfpwd.1.html %{html_prefix}/ja/ref/man1/gfrcmd.1.html %{html_prefix}/ja/ref/man1/gfreg.1.html %endif %{html_prefix}/ja/ref/man1/gfrep.1.html %if %{gfarm_v2_not_yet} %{html_prefix}/ja/ref/man1/gfrm.1.html %endif %{html_prefix}/ja/ref/man1/gfrmdir.1.html %{html_prefix}/ja/ref/man1/gfsched.1.html %if %{gfarm_v2_not_yet} %{html_prefix}/ja/ref/man1/gfront.1.html %{html_prefix}/ja/ref/man1/gfrun.1.html %{html_prefix}/ja/ref/man1/gfsetdir.1.html %endif %{html_prefix}/ja/ref/man1/gfstat.1.html %{html_prefix}/ja/ref/man1/gfstatus.1.html %if %{gfarm_v2_not_yet} %{html_prefix}/ja/ref/man1/gfusage.1.html %endif %{html_prefix}/ja/ref/man1/gfuser.1.html %if %{gfarm_v2_not_yet} %{html_prefix}/ja/ref/man1/gfwc.1.html %endif %{html_prefix}/ja/ref/man1/gfwhere.1.html %{html_prefix}/ja/ref/man1/gfwhoami.1.html %{html_prefix}/ja/ref/man1/gfxattr.1.html %{html_prefix}/ja/ref/man3/gfarm.3.html %{html_prefix}/ja/ref/man3/gfarm_initialize.3.html %{html_prefix}/ja/ref/man3/gfarm_terminate.3.html %{html_prefix}/ja/ref/man3/gfs_pio_close.3.html %{html_prefix}/ja/ref/man3/gfs_pio_create.3.html %{html_prefix}/ja/ref/man3/gfs_pio_open.3.html %{html_prefix}/ja/ref/man3/gfs_pio_read.3.html %{html_prefix}/ja/ref/man3/gfs_pio_write.3.html %if %{gfarm_v2_not_yet} %{html_prefix}/ja/ref/man3/gfarm_hostlist_read.3.html %{html_prefix}/ja/ref/man3/gfarm_import_fragment_config_read.3.html %{html_prefix}/ja/ref/man3/gfarm_import_fragment_size_alloc.3.html %{html_prefix}/ja/ref/man3/gfarm_stringlist_add.3.html %{html_prefix}/ja/ref/man3/gfarm_stringlist_cat.3.html %{html_prefix}/ja/ref/man3/gfarm_stringlist_elem.3.html %{html_prefix}/ja/ref/man3/gfarm_stringlist_free.3.html %{html_prefix}/ja/ref/man3/gfarm_stringlist_init.3.html %{html_prefix}/ja/ref/man3/gfarm_stringlist_length.3.html %{html_prefix}/ja/ref/man3/gfarm_strings_free_deeply.3.html %{html_prefix}/ja/ref/man3/gfarm_url_fragments_replicate.3.html %{html_prefix}/ja/ref/man3/gfarm_url_hosts_schedule.3.html %{html_prefix}/ja/ref/man3/gfarm_url_program_deliver.3.html %{html_prefix}/ja/ref/man3/gfarm_url_program_register.3.html %{html_prefix}/ja/ref/man3/gfarm_url_section_replicate_from_to.3.html %{html_prefix}/ja/ref/man3/gfarm_url_section_replicate_to.3.html %{html_prefix}/ja/ref/man3/gfs_chdir.3.html %{html_prefix}/ja/ref/man3/gfs_chmod.3.html %{html_prefix}/ja/ref/man3/gfs_closedir.3.html %{html_prefix}/ja/ref/man3/gfs_glob.3.html %{html_prefix}/ja/ref/man3/gfs_glob_add.3.html %{html_prefix}/ja/ref/man3/gfs_glob_free.3.html %{html_prefix}/ja/ref/man3/gfs_glob_init.3.html %{html_prefix}/ja/ref/man3/gfs_mkdir.3.html %{html_prefix}/ja/ref/man3/gfs_opendir.3.html %{html_prefix}/ja/ref/man3/gfs_pio_datasync.3.html %{html_prefix}/ja/ref/man3/gfs_pio_eof.3.html %{html_prefix}/ja/ref/man3/gfs_pio_error.3.html %{html_prefix}/ja/ref/man3/gfs_pio_flush.3.html %{html_prefix}/ja/ref/man3/gfs_pio_getc.3.html %{html_prefix}/ja/ref/man3/gfs_pio_getline.3.html %{html_prefix}/ja/ref/man3/gfs_pio_gets.3.html %{html_prefix}/ja/ref/man3/gfs_pio_putc.3.html %{html_prefix}/ja/ref/man3/gfs_pio_putline.3.html %{html_prefix}/ja/ref/man3/gfs_pio_puts.3.html %{html_prefix}/ja/ref/man3/gfs_pio_readdelim.3.html %{html_prefix}/ja/ref/man3/gfs_pio_readline.3.html %{html_prefix}/ja/ref/man3/gfs_pio_seek.3.html %{html_prefix}/ja/ref/man3/gfs_pio_set_local.3.html %{html_prefix}/ja/ref/man3/gfs_pio_set_view_index.3.html %{html_prefix}/ja/ref/man3/gfs_pio_set_view_local.3.html %{html_prefix}/ja/ref/man3/gfs_pio_sync.3.html %{html_prefix}/ja/ref/man3/gfs_pio_truncate.3.html %{html_prefix}/ja/ref/man3/gfs_pio_ungetc.3.html %{html_prefix}/ja/ref/man3/gfs_readdir.3.html %{html_prefix}/ja/ref/man3/gfs_realpath.3.html %{html_prefix}/ja/ref/man3/gfs_rename.3.html %{html_prefix}/ja/ref/man3/gfs_rmdir.3.html %{html_prefix}/ja/ref/man3/gfs_stat.3.html %{html_prefix}/ja/ref/man3/gfs_stat_free.3.html %{html_prefix}/ja/ref/man3/gfs_unlink.3.html %{html_prefix}/ja/ref/man3/gfs_unlink_section.3.html %{html_prefix}/ja/ref/man3/gfs_utimes.3.html %endif %{html_prefix}/ja/ref/man5/gfarm2.conf.5.html %{html_prefix}/ja/ref/man8/gfmd.8.html %{html_prefix}/ja/ref/man8/gfsd.8.html %{html_prefix}/ja/user/export-gfarm.html %{html_prefix}/ja/user/index.html %{html_prefix}/ja/user/nfs-gfarmfs.html %{html_prefix}/ja/user/samba-gfarmfs.html %{html_prefix}/ja/user/samba-hook.html %{html_prefix}/ja/user/smboverssh.html %{html_prefix}/pic/gfarm-logo.gif %{doc_prefix}/INSTALL.en %{doc_prefix}/INSTALL.ja %{doc_prefix}/INSTALL.RPM.en %{doc_prefix}/INSTALL.RPM.ja %{doc_prefix}/LICENSE %{doc_prefix}/README.en %{doc_prefix}/README.ja %{doc_prefix}/RELNOTES %{doc_prefix}/OVERVIEW.en %{doc_prefix}/OVERVIEW.ja %{doc_prefix}/SETUP.en %{doc_prefix}/SETUP.ja %{doc_prefix}/SETUP.private.en %{doc_prefix}/SETUP.private.ja %{doc_prefix}/Gfarm-FAQ.en %{doc_prefix}/Gfarm-FAQ.ja %{doc_prefix}/KNOWN_PROBLEMS.en %{doc_prefix}/KNOWN_PROBLEMS.ja %if %{gfarm_v2_not_yet} %{doc_prefix}/README.hook.en %{doc_prefix}/README.hook.ja %endif %files libs %defattr(-,root,root) %{lib_prefix}/libgfarm.so.1 %{lib_prefix}/libgfarm.so.1.0.0 %if %{gfarm_v2_not_yet} %{lib_prefix}/libgfs_hook.so.0 %{lib_prefix}/libgfs_hook.so.0.0.0 %{lib_prefix}/libgfs_hook_debug.so.0 %{lib_prefix}/libgfs_hook_debug.so.0.0.0 %{lib_prefix}/libgfs_hook_no_init.so.0 %{lib_prefix}/libgfs_hook_no_init.so.0.0.0 %{lib_prefix}/libgfs_hook_no_init_debug.so.0 %{lib_prefix}/libgfs_hook_no_init_debug.so.0.0.0 %endif %dir %{share_prefix} %dir %{share_prefix}/config %{share_prefix}/config/config-gfarm.sysdep %if %{mpi} %{lib_prefix}/libgfs_hook_mpi.so.0 %{lib_prefix}/libgfs_hook_mpi.so.0.0.0 %{lib_prefix}/libgfs_hook_mpi_debug.so.0 %{lib_prefix}/libgfs_hook_mpi_debug.so.0.0.0 %endif %if %{have_ns} %{lib_prefix}/libns.so.0 %{lib_prefix}/libns.so.0.0.0 %{lib_prefix}/libnsexec.so.0 %{lib_prefix}/libnsexec.so.0.0.0 %endif %files client %defattr(-,root,root) %{prefix}/bin/gfarm-pcp %{prefix}/bin/gfarm-prun %{prefix}/bin/gfarm-ptool %{prefix}/bin/gfdf %{prefix}/bin/gfchgrp %{prefix}/bin/gfchmod %{prefix}/bin/gfchown %{prefix}/bin/gfedquota %{prefix}/bin/gfexport %{prefix}/bin/gffindxmlattr %{prefix}/bin/gfgroup %{prefix}/bin/gfhost %if %{gfarm_v2_not_yet} %{prefix}/bin/gfifo.sh %{prefix}/bin/gfimport_fixed %{prefix}/bin/gfimport_text %endif %{prefix}/bin/gfkey %{prefix}/bin/gfln %{prefix}/bin/gfls %{prefix}/bin/gfmkdir %{prefix}/bin/gfmv %{prefix}/bin/gfpath %if %{gfarm_v2_not_yet} %{prefix}/bin/gfmpirun_p4 %{prefix}/bin/gfps %{prefix}/bin/gfpwd %{prefix}/bin/gfq.sh %{prefix}/bin/gfq_commit.sh %{prefix}/bin/gfq_setup.sh %{prefix}/bin/gfrcmd %endif %{prefix}/bin/gfquota %{prefix}/bin/gfquotacheck %{prefix}/bin/gfreg %{prefix}/bin/gfrep %{prefix}/bin/gfrm %{prefix}/bin/gfrmdir %{prefix}/bin/gfusage %{prefix}/bin/gfuser %{prefix}/bin/gfsched %if %{gfarm_v2_not_yet} %{prefix}/bin/gfrsh %{prefix}/bin/gfrshl %{prefix}/bin/gfrun %{prefix}/bin/gfsck %{prefix}/bin/gfsetdir %{prefix}/bin/gfssh %{prefix}/bin/gfsshl %endif %{prefix}/bin/gfstat %{prefix}/bin/gfstatus %if %{gfarm_v2_not_yet} %{prefix}/bin/gftest %endif %{prefix}/bin/gfwhere %{prefix}/bin/gfwhoami %{prefix}/bin/gfxattr %if %{gfarm_v2_not_yet} %{profile_prefix}/gfarm.sh %{profile_prefix}/gfarm.csh %endif %if %{have_ns} %{prefix}/sbin/gfarmd %{prefix}/bin/ns_get %{prefix}/bin/ns_lstat %{prefix}/bin/ns_mkdir %{prefix}/bin/ns_put %{prefix}/bin/ns_readdir %{prefix}/bin/ns_readlink %{prefix}/bin/ns_rename %{prefix}/bin/ns_stat %{prefix}/bin/ns_symlink %{prefix}/bin/ns_unlink %{prefix}/bin/ns_unlink_dir %endif %files fsnode %defattr(-,root,root) %{prefix}/bin/config-gfsd %{prefix}/bin/gfarm.arch.guess %if %{gfarm_v2_not_yet} %{prefix}/bin/gfexec %{prefix}/bin/gfsplck %{prefix}/bin/thput-gfpio %endif %{prefix}/sbin/gfsd %dir %{share_prefix} %dir %{share_prefix}/config %{share_prefix}/config/linux/debian/gfsd.in %{share_prefix}/config/linux/default/gfsd.in %{share_prefix}/config/linux/redhat/gfsd.in %{share_prefix}/config/linux/suse/gfsd.in %files server %defattr(-,root,root) %{prefix}/sbin/gfmd %{prefix}/bin/config-gfarm %{prefix}/bin/config-gfarm-update %{prefix}/bin/gfdump.postgresql %dir %{share_prefix} %dir %{share_prefix}/config %{share_prefix}/config/bdb.DB_CONFIG.in %{share_prefix}/config/config-gfarm.ldap %{share_prefix}/config/config-gfarm.postgresql %{share_prefix}/config/config-gfarm-update.postgresql %{share_prefix}/config/config-gfarm-update.ldap %{share_prefix}/config/gfarm.conf-ldap.in %{share_prefix}/config/gfarm.conf-postgresql.in %{share_prefix}/config/gfarm.conf.in %{share_prefix}/config/gfarm.sql %{share_prefix}/config/gfarm-xmlattr.sql %{share_prefix}/config/gfarm.schema %{share_prefix}/config/initial.ldif.in %{share_prefix}/config/linux/debian/gfarm-pgsql.in %{share_prefix}/config/linux/debian/gfarm-slapd.in %{share_prefix}/config/linux/debian/gfmd.in %{share_prefix}/config/linux/default/gfarm-pgsql.in %{share_prefix}/config/linux/default/gfarm-slapd.in %{share_prefix}/config/linux/default/gfmd.in %{share_prefix}/config/linux/redhat/gfarm-pgsql.in %{share_prefix}/config/linux/redhat/gfarm-slapd.in %{share_prefix}/config/linux/redhat/gfmd.in %{share_prefix}/config/linux/suse/gfarm-pgsql.in %{share_prefix}/config/linux/suse/gfarm-slapd.in %{share_prefix}/config/linux/suse/gfmd.in %{share_prefix}/config/slapd.conf-2.0.in %{share_prefix}/config/slapd.conf-2.1.in %files devel %defattr(-,root,root) %{prefix}/include/gfarm/gfarm.h %{prefix}/include/gfarm/gfarm_config.h %{prefix}/include/gfarm/error.h %{prefix}/include/gfarm/gfarm_misc.h %{prefix}/include/gfarm/gfarm_stringlist.h %{prefix}/include/gfarm/gflog.h %{prefix}/include/gfarm/host_info.h %{prefix}/include/gfarm/user_info.h %{prefix}/include/gfarm/group_info.h %{prefix}/include/gfarm/gfs.h %{prefix}/include/gfarm/gfs_glob.h # XXX - this should not be here %{prefix}/include/gfarm/gfarm_msg_enums.h %if %{gfarm_v2_not_yet} %{prefix}/include/gfarm/gfs_hook.h %{lib_prefix}/gfs_hook.o %{lib_prefix}/gfs_hook_debug.o %{lib_prefix}/gfs_hook_no_init.o %{lib_prefix}/gfs_hook_no_init_debug.o %{lib_prefix}/hooks_init_mpi.c %endif %{lib_prefix}/libgfarm.a %{lib_prefix}/libgfarm.la %{lib_prefix}/libgfarm.so %if %{gfarm_v2_not_yet} %{lib_prefix}/libgfs_hook.a %{lib_prefix}/libgfs_hook.la %{lib_prefix}/libgfs_hook.so %{lib_prefix}/libgfs_hook_debug.a %{lib_prefix}/libgfs_hook_debug.la %{lib_prefix}/libgfs_hook_debug.so %{lib_prefix}/libgfs_hook_no_init.a %{lib_prefix}/libgfs_hook_no_init.la %{lib_prefix}/libgfs_hook_no_init.so %{lib_prefix}/libgfs_hook_no_init_debug.a %{lib_prefix}/libgfs_hook_no_init_debug.la %{lib_prefix}/libgfs_hook_no_init_debug.so %endif %if %{mpi} %{lib_prefix}/gfs_hook_mpi.o %{lib_prefix}/gfs_hook_mpi_debug.o %{lib_prefix}/libgfs_hook_mpi.a %{lib_prefix}/libgfs_hook_mpi.la %{lib_prefix}/libgfs_hook_mpi.so %{lib_prefix}/libgfs_hook_mpi_debug.a %{lib_prefix}/libgfs_hook_mpi_debug.la %{lib_prefix}/libgfs_hook_mpi_debug.so %endif %if %{have_ns} %{prefix}/include/gfarm/comm.h %{prefix}/include/gfarm/con.h %{prefix}/include/gfarm/debug.h %{prefix}/include/gfarm/gflib.h %{prefix}/include/gfarm/ns.h %{prefix}/include/gfarm/nsclnt.h %{prefix}/include/gfarm/nscom.h %{prefix}/include/gfarm/nsexec.h %{prefix}/include/gfarm/soc-lxdr.h %{prefix}/include/gfarm/soc.h %{prefix}/include/gfarm/type.h %{lib_prefix}/libns.a %{lib_prefix}/libns.la %{lib_prefix}/libns.so %{lib_prefix}/libnsexec.a %{lib_prefix}/libnsexec.la %{lib_prefix}/libnsexec.so %endif gfarm-2.4.1/package/redhat/gfarm.csh0000755000000000000000000000004411507222717015752 0ustar rootrootalias gfcd 'eval `gfsetdir -c \!*`' gfarm-2.4.1/package/pkgsrc/0000755000000000000000000000000011507222730014173 5ustar rootrootgfarm-2.4.1/package/pkgsrc/DESCR0000644000000000000000000000062411507222717014765 0ustar rootrootGfarm (Grid Datafarm) provides a user-level grid filesystem and parallel process management based on file-affinity scheduling. The filesystem can be accessed by either every existing dynamically-linked program (please read README.hook.{en,ja} in the document directory to do this), or programs which are using Gfarm file access API. Parallel process scheduling and invokation are done by gfrun command. gfarm-2.4.1/package/pkgsrc/Makefile0000644000000000000000000000246411507222717015646 0ustar rootroot# $NetBSD$ DISTNAME= gfarm-${GFARM_VERSION} CATEGORIES= parallel net MASTER_SITES= http://datafarm.apgrid.org/software/${GFARM_VERSION}/ PATCH_SITES= ${MASTER_SITES} MAINTAINER= soda@NetBSD.org HOMEPAGE= http://datafarm.apgrid.org/ COMMENT= User-level grid filesystem and parallel process management GFARM_VERSION= 1.4 USE_PKGINSTALL= yes USE_TOOLS+= gmake # NetBSD-make works too, but pkgsrc supports non-NetBSD. USE_LIBTOOL= yes GNU_CONFIGURE= yes # XXX what was version that getaddrinfo(3) and getnameinfo(3) became MT-Safe? CONFIGURE_ARGS+=--sysconfdir=${PKG_SYSCONFDIR} --without-mtsafe-netdb PGSQL_VERSIONS_ACCEPTED?= 83 82 81 80 # 74 # 7.4 has some minor problems default_htmldir=${PREFIX}/share/doc/html/gfarm ja_mandir= ${PREFIX}/man/ja_JP.eucJP MAKEFLAGS+= default_htmldir=${default_htmldir} ja_mandir=${ja_mandir} RCD_SCRIPTS= gfmd gfsd GFARM_PID_DIR= ${VARBASE}/run # default directory for PID files FILES_SUBST+= GFARM_PID_DIR=${GFARM_PID_DIR} .include "../../security/openssl/buildlink3.mk" .include "../../databases/openldap-client/buildlink3.mk" .include "../../mk/pgsql.buildlink3.mk" .include "../../mk/pthread.buildlink3.mk" .include "../../mk/bsd.pkg.mk" # TODO: # - enable GSI, but this requires Globus in pkgsrc. # - split into fine-grained packages. # e.g. gfarm-{libs,client,fsnode,server,devel} gfarm-2.4.1/package/pkgsrc/files/0000755000000000000000000000000011507222730015275 5ustar rootrootgfarm-2.4.1/package/pkgsrc/files/gfmd.sh0000644000000000000000000000101311507222717016546 0ustar rootroot#!@RCD_SCRIPTS_SHELL@ # # $NetBSD$ # # Gfarm filesystem metaserver # # PROVIDE: gfmd # REQUIRE: DAEMON if [ -f /etc/rc.subr ]; then . /etc/rc.subr fi name="gfmd" FILE=${name} rcvar=${name} command="@PREFIX@/sbin/${name}" pidfile="@GFARM_PID_DIR@/${FILE}.pid" required_files="@PKG_SYSCONFDIR@/gfarm.conf" # add more flags through ${${name}_flags} command_args="-P $pidfile" if [ -f /etc/rc.subr ]; then load_rc_config ${FILE} run_rc_command "$1" else @ECHO@ -n " ${name}" ${command} ${gfmd_flags} ${command_args} fi gfarm-2.4.1/package/pkgsrc/files/gfsd.sh0000644000000000000000000000101411507222717016555 0ustar rootroot#!@RCD_SCRIPTS_SHELL@ # # $NetBSD$ # # Gfarm filesystem node daemon # # PROVIDE: gfsd # REQUIRE: DAEMON if [ -f /etc/rc.subr ]; then . /etc/rc.subr fi name="gfsd" FILE=${name} rcvar=${name} command="@PREFIX@/sbin/${name}" pidfile="@GFARM_PID_DIR@/${FILE}.pid" required_files="@PKG_SYSCONFDIR@/gfarm.conf" # add more flags through ${${name}_flags} command_args="-P $pidfile" if [ -f /etc/rc.subr ]; then load_rc_config ${FILE} run_rc_command "$1" else @ECHO@ -n " ${name}" ${command} ${gfsd_flags} ${command_args} fi gfarm-2.4.1/package/pkgsrc/PLIST0000644000000000000000000004416311507222717015026 0ustar rootroot@comment $NetBSD$ bin/config-gfarm bin/config-agent bin/config-gfsd bin/gfarm.arch.guess bin/gfarm_agent bin/gfarm-pcp bin/gfarm-prun bin/gfarm-ptool bin/gfcombine bin/gfcombine_hook bin/gfcp bin/gfcp_hook bin/gfdf bin/gfdump bin/gfexec bin/gfexport bin/gfgrep bin/gfhost bin/gfifo.sh bin/gfimport_fixed bin/gfimport_text bin/gfkey bin/gfls bin/gfmkdir bin/gfmpirun_p4 bin/gfps bin/gfpwd bin/gfq.sh bin/gfq_commit.sh bin/gfq_setup.sh bin/gfrcmd bin/gfreg bin/gfrep bin/gfrm bin/gfrmdir bin/gfront bin/gfrsh bin/gfrshl bin/gfrun bin/gfsched bin/gfsck bin/gfsetdir bin/gfsplck bin/gfssh bin/gfsshl bin/gfstat bin/gfstatus bin/gftest bin/gfusage bin/gfwhere bin/gfwhoami bin/thput-gfpio include/gfarm/gfarm.h include/gfarm/gfarm_config.h include/gfarm/gfarm_error.h include/gfarm/gfarm_metadb.h include/gfarm/gfarm_misc.h include/gfarm/gfarm_stringlist.h include/gfarm/gflog.h include/gfarm/gfs.h include/gfarm/gfs_glob.h include/gfarm/gfs_hook.h lib/gfs_hook.o lib/gfs_hook_debug.o lib/gfs_hook_no_init.o lib/gfs_hook_no_init_debug.o lib/hooks_init_mpi.c lib/libgfarm.la lib/libgfs_hook.la lib/libgfs_hook_debug.la lib/libgfs_hook_no_init.la lib/libgfs_hook_no_init_debug.la libexec/gfrepbe_client libexec/gfrepbe_server man/ja_JP.eucJP/man1/gfarm_agent.1 man/ja_JP.eucJP/man1/gfcd.1 man/ja_JP.eucJP/man1/gfdf.1 man/ja_JP.eucJP/man1/gfexec.1 man/ja_JP.eucJP/man1/gfexport.1 man/ja_JP.eucJP/man1/gfgrep.1 man/ja_JP.eucJP/man1/gfhost.1 man/ja_JP.eucJP/man1/gfimport_fixed.1 man/ja_JP.eucJP/man1/gfimport_text.1 man/ja_JP.eucJP/man1/gfkey.1 man/ja_JP.eucJP/man1/gfls.1 man/ja_JP.eucJP/man1/gfmkdir.1 man/ja_JP.eucJP/man1/gfmpirun_p4.1 man/ja_JP.eucJP/man1/gfps.1 man/ja_JP.eucJP/man1/gfpwd.1 man/ja_JP.eucJP/man1/gfrcmd.1 man/ja_JP.eucJP/man1/gfreg.1 man/ja_JP.eucJP/man1/gfrep.1 man/ja_JP.eucJP/man1/gfrm.1 man/ja_JP.eucJP/man1/gfrmdir.1 man/ja_JP.eucJP/man1/gfront.1 man/ja_JP.eucJP/man1/gfrsh.1 man/ja_JP.eucJP/man1/gfrun.1 man/ja_JP.eucJP/man1/gfsched.1 man/ja_JP.eucJP/man1/gfsetdir.1 man/ja_JP.eucJP/man1/gfssh.1 man/ja_JP.eucJP/man1/gfstat.1 man/ja_JP.eucJP/man1/gfusage.1 man/ja_JP.eucJP/man1/gfwc.1 man/ja_JP.eucJP/man1/gfwhere.1 man/ja_JP.eucJP/man1/gfwhoami.1 man/ja_JP.eucJP/man3/gfarm.3 man/ja_JP.eucJP/man3/gfarm_hostlist_read.3 man/ja_JP.eucJP/man3/gfarm_import_fragment_config_read.3 man/ja_JP.eucJP/man3/gfarm_import_fragment_size_alloc.3 man/ja_JP.eucJP/man3/gfarm_initialize.3 man/ja_JP.eucJP/man3/gfarm_stringlist_add.3 man/ja_JP.eucJP/man3/gfarm_stringlist_cat.3 man/ja_JP.eucJP/man3/gfarm_stringlist_elem.3 man/ja_JP.eucJP/man3/gfarm_stringlist_free.3 man/ja_JP.eucJP/man3/gfarm_stringlist_init.3 man/ja_JP.eucJP/man3/gfarm_stringlist_length.3 man/ja_JP.eucJP/man3/gfarm_strings_free_deeply.3 man/ja_JP.eucJP/man3/gfarm_terminate.3 man/ja_JP.eucJP/man3/gfarm_url_fragments_replicate.3 man/ja_JP.eucJP/man3/gfarm_url_hosts_schedule.3 man/ja_JP.eucJP/man3/gfarm_url_program_deliver.3 man/ja_JP.eucJP/man3/gfarm_url_program_register.3 man/ja_JP.eucJP/man3/gfarm_url_section_replicate_from_to.3 man/ja_JP.eucJP/man3/gfarm_url_section_replicate_to.3 man/ja_JP.eucJP/man3/gfs_chdir.3 man/ja_JP.eucJP/man3/gfs_chmod.3 man/ja_JP.eucJP/man3/gfs_closedir.3 man/ja_JP.eucJP/man3/gfs_glob.3 man/ja_JP.eucJP/man3/gfs_glob_add.3 man/ja_JP.eucJP/man3/gfs_glob_free.3 man/ja_JP.eucJP/man3/gfs_glob_init.3 man/ja_JP.eucJP/man3/gfs_mkdir.3 man/ja_JP.eucJP/man3/gfs_opendir.3 man/ja_JP.eucJP/man3/gfs_pio_close.3 man/ja_JP.eucJP/man3/gfs_pio_create.3 man/ja_JP.eucJP/man3/gfs_pio_datasync.3 man/ja_JP.eucJP/man3/gfs_pio_eof.3 man/ja_JP.eucJP/man3/gfs_pio_error.3 man/ja_JP.eucJP/man3/gfs_pio_flush.3 man/ja_JP.eucJP/man3/gfs_pio_getc.3 man/ja_JP.eucJP/man3/gfs_pio_getline.3 man/ja_JP.eucJP/man3/gfs_pio_gets.3 man/ja_JP.eucJP/man3/gfs_pio_open.3 man/ja_JP.eucJP/man3/gfs_pio_putc.3 man/ja_JP.eucJP/man3/gfs_pio_putline.3 man/ja_JP.eucJP/man3/gfs_pio_puts.3 man/ja_JP.eucJP/man3/gfs_pio_read.3 man/ja_JP.eucJP/man3/gfs_pio_readdelim.3 man/ja_JP.eucJP/man3/gfs_pio_readline.3 man/ja_JP.eucJP/man3/gfs_pio_seek.3 man/ja_JP.eucJP/man3/gfs_pio_set_local.3 man/ja_JP.eucJP/man3/gfs_pio_set_view_index.3 man/ja_JP.eucJP/man3/gfs_pio_set_view_local.3 man/ja_JP.eucJP/man3/gfs_pio_sync.3 man/ja_JP.eucJP/man3/gfs_pio_truncate.3 man/ja_JP.eucJP/man3/gfs_pio_ungetc.3 man/ja_JP.eucJP/man3/gfs_pio_write.3 man/ja_JP.eucJP/man3/gfs_readdir.3 man/ja_JP.eucJP/man3/gfs_realpath.3 man/ja_JP.eucJP/man3/gfs_rename.3 man/ja_JP.eucJP/man3/gfs_rmdir.3 man/ja_JP.eucJP/man3/gfs_stat.3 man/ja_JP.eucJP/man3/gfs_stat_free.3 man/ja_JP.eucJP/man3/gfs_unlink.3 man/ja_JP.eucJP/man3/gfs_unlink_section.3 man/ja_JP.eucJP/man3/gfs_utimes.3 man/ja_JP.eucJP/man5/gfarm.conf.5 man/ja_JP.eucJP/man8/gfmd.8 man/ja_JP.eucJP/man8/gfsd.8 man/man1/gfarm_agent.1 man/man1/gfcd.1 man/man1/gfdf.1 man/man1/gfexec.1 man/man1/gfexport.1 man/man1/gfgrep.1 man/man1/gfhost.1 man/man1/gfimport_fixed.1 man/man1/gfimport_text.1 man/man1/gfkey.1 man/man1/gfls.1 man/man1/gfmkdir.1 man/man1/gfmpirun_p4.1 man/man1/gfps.1 man/man1/gfpwd.1 man/man1/gfrcmd.1 man/man1/gfreg.1 man/man1/gfrep.1 man/man1/gfrm.1 man/man1/gfrmdir.1 man/man1/gfront.1 man/man1/gfrsh.1 man/man1/gfrun.1 man/man1/gfsched.1 man/man1/gfsetdir.1 man/man1/gfssh.1 man/man1/gfstat.1 man/man1/gfusage.1 man/man1/gfwc.1 man/man1/gfwhere.1 man/man1/gfwhoami.1 man/man3/gfarm.3 man/man3/gfarm_initialize.3 man/man3/gfarm_strings_free_deeply.3 man/man3/gfarm_terminate.3 man/man3/gfarm_url_fragments_replicate.3 man/man3/gfarm_url_hosts_schedule.3 man/man3/gfarm_url_section_replicate_from_to.3 man/man3/gfarm_url_section_replicate_to.3 man/man3/gfs_chdir.3 man/man3/gfs_chmod.3 man/man3/gfs_closedir.3 man/man3/gfs_glob.3 man/man3/gfs_glob_add.3 man/man3/gfs_glob_free.3 man/man3/gfs_glob_init.3 man/man3/gfs_mkdir.3 man/man3/gfs_opendir.3 man/man3/gfs_pio_close.3 man/man3/gfs_pio_create.3 man/man3/gfs_pio_datasync.3 man/man3/gfs_pio_eof.3 man/man3/gfs_pio_error.3 man/man3/gfs_pio_flush.3 man/man3/gfs_pio_getc.3 man/man3/gfs_pio_getline.3 man/man3/gfs_pio_gets.3 man/man3/gfs_pio_open.3 man/man3/gfs_pio_putc.3 man/man3/gfs_pio_putline.3 man/man3/gfs_pio_puts.3 man/man3/gfs_pio_read.3 man/man3/gfs_pio_readdelim.3 man/man3/gfs_pio_readline.3 man/man3/gfs_pio_seek.3 man/man3/gfs_pio_set_local.3 man/man3/gfs_pio_set_view_index.3 man/man3/gfs_pio_set_view_local.3 man/man3/gfs_pio_sync.3 man/man3/gfs_pio_truncate.3 man/man3/gfs_pio_ungetc.3 man/man3/gfs_pio_write.3 man/man3/gfs_readdir.3 man/man3/gfs_realpath.3 man/man3/gfs_rename.3 man/man3/gfs_rmdir.3 man/man3/gfs_stat.3 man/man3/gfs_stat_free.3 man/man3/gfs_unlink.3 man/man3/gfs_unlink_section.3 man/man3/gfs_utimes.3 man/man5/gfarm.conf.5 man/man8/gfmd.8 man/man8/gfsd.8 sbin/gfmd sbin/gfregister sbin/gfsd share/doc/gfarm/GUIDE.ja share/doc/gfarm/Gfarm-FAQ.en share/doc/gfarm/Gfarm-FAQ.ja share/doc/gfarm/INSTALL.RPM.en share/doc/gfarm/INSTALL.RPM.ja share/doc/gfarm/INSTALL.en share/doc/gfarm/INSTALL.ja share/doc/gfarm/KNOWN_PROBLEMS.en share/doc/gfarm/KNOWN_PROBLEMS.ja share/doc/gfarm/LICENSE share/doc/gfarm/OVERVIEW.en share/doc/gfarm/OVERVIEW.ja share/doc/gfarm/README.en share/doc/gfarm/README.ja share/doc/gfarm/README.hook.en share/doc/gfarm/README.hook.ja share/doc/gfarm/RELNOTES share/doc/gfarm/SETUP.detail.en share/doc/gfarm/SETUP.detail.ja share/doc/gfarm/SETUP.en share/doc/gfarm/SETUP.ja share/doc/html/gfarm/en/ref/index.html share/doc/html/gfarm/en/ref/man1/gfarm_agent.1.html share/doc/html/gfarm/en/ref/man1/gfcd.1.html share/doc/html/gfarm/en/ref/man1/gfdf.1.html share/doc/html/gfarm/en/ref/man1/gfexec.1.html share/doc/html/gfarm/en/ref/man1/gfexport.1.html share/doc/html/gfarm/en/ref/man1/gfgrep.1.html share/doc/html/gfarm/en/ref/man1/gfhost.1.html share/doc/html/gfarm/en/ref/man1/gfimport_fixed.1.html share/doc/html/gfarm/en/ref/man1/gfimport_text.1.html share/doc/html/gfarm/en/ref/man1/gfkey.1.html share/doc/html/gfarm/en/ref/man1/gfls.1.html share/doc/html/gfarm/en/ref/man1/gfmkdir.1.html share/doc/html/gfarm/en/ref/man1/gfmpirun_p4.1.html share/doc/html/gfarm/en/ref/man1/gfps.1.html share/doc/html/gfarm/en/ref/man1/gfpwd.1.html share/doc/html/gfarm/en/ref/man1/gfrcmd.1.html share/doc/html/gfarm/en/ref/man1/gfreg.1.html share/doc/html/gfarm/en/ref/man1/gfrep.1.html share/doc/html/gfarm/en/ref/man1/gfrm.1.html share/doc/html/gfarm/en/ref/man1/gfrmdir.1.html share/doc/html/gfarm/en/ref/man1/gfront.1.html share/doc/html/gfarm/en/ref/man1/gfrun.1.html share/doc/html/gfarm/en/ref/man1/gfsched.1.html share/doc/html/gfarm/en/ref/man1/gfsetdir.1.html share/doc/html/gfarm/en/ref/man1/gfstat.1.html share/doc/html/gfarm/en/ref/man1/gfusage.1.html share/doc/html/gfarm/en/ref/man1/gfwc.1.html share/doc/html/gfarm/en/ref/man1/gfwhere.1.html share/doc/html/gfarm/en/ref/man1/gfwhoami.1.html share/doc/html/gfarm/en/ref/man3/gfarm.3.html share/doc/html/gfarm/en/ref/man3/gfarm_initialize.3.html share/doc/html/gfarm/en/ref/man3/gfarm_strings_free_deeply.3.html share/doc/html/gfarm/en/ref/man3/gfarm_terminate.3.html share/doc/html/gfarm/en/ref/man3/gfarm_url_fragments_replicate.3.html share/doc/html/gfarm/en/ref/man3/gfarm_url_hosts_schedule.3.html share/doc/html/gfarm/en/ref/man3/gfarm_url_section_replicate_from_to.3.html share/doc/html/gfarm/en/ref/man3/gfarm_url_section_replicate_to.3.html share/doc/html/gfarm/en/ref/man3/gfs_chdir.3.html share/doc/html/gfarm/en/ref/man3/gfs_chmod.3.html share/doc/html/gfarm/en/ref/man3/gfs_closedir.3.html share/doc/html/gfarm/en/ref/man3/gfs_glob.3.html share/doc/html/gfarm/en/ref/man3/gfs_glob_add.3.html share/doc/html/gfarm/en/ref/man3/gfs_glob_free.3.html share/doc/html/gfarm/en/ref/man3/gfs_glob_init.3.html share/doc/html/gfarm/en/ref/man3/gfs_mkdir.3.html share/doc/html/gfarm/en/ref/man3/gfs_opendir.3.html share/doc/html/gfarm/en/ref/man3/gfs_pio_close.3.html share/doc/html/gfarm/en/ref/man3/gfs_pio_create.3.html share/doc/html/gfarm/en/ref/man3/gfs_pio_datasync.3.html share/doc/html/gfarm/en/ref/man3/gfs_pio_eof.3.html share/doc/html/gfarm/en/ref/man3/gfs_pio_error.3.html share/doc/html/gfarm/en/ref/man3/gfs_pio_flush.3.html share/doc/html/gfarm/en/ref/man3/gfs_pio_getc.3.html share/doc/html/gfarm/en/ref/man3/gfs_pio_getline.3.html share/doc/html/gfarm/en/ref/man3/gfs_pio_gets.3.html share/doc/html/gfarm/en/ref/man3/gfs_pio_open.3.html share/doc/html/gfarm/en/ref/man3/gfs_pio_putc.3.html share/doc/html/gfarm/en/ref/man3/gfs_pio_putline.3.html share/doc/html/gfarm/en/ref/man3/gfs_pio_puts.3.html share/doc/html/gfarm/en/ref/man3/gfs_pio_read.3.html share/doc/html/gfarm/en/ref/man3/gfs_pio_readdelim.3.html share/doc/html/gfarm/en/ref/man3/gfs_pio_readline.3.html share/doc/html/gfarm/en/ref/man3/gfs_pio_seek.3.html share/doc/html/gfarm/en/ref/man3/gfs_pio_set_local.3.html share/doc/html/gfarm/en/ref/man3/gfs_pio_set_view_index.3.html share/doc/html/gfarm/en/ref/man3/gfs_pio_set_view_local.3.html share/doc/html/gfarm/en/ref/man3/gfs_pio_sync.3.html share/doc/html/gfarm/en/ref/man3/gfs_pio_truncate.3.html share/doc/html/gfarm/en/ref/man3/gfs_pio_ungetc.3.html share/doc/html/gfarm/en/ref/man3/gfs_pio_write.3.html share/doc/html/gfarm/en/ref/man3/gfs_readdir.3.html share/doc/html/gfarm/en/ref/man3/gfs_realpath.3.html share/doc/html/gfarm/en/ref/man3/gfs_rename.3.html share/doc/html/gfarm/en/ref/man3/gfs_rmdir.3.html share/doc/html/gfarm/en/ref/man3/gfs_stat.3.html share/doc/html/gfarm/en/ref/man3/gfs_stat_free.3.html share/doc/html/gfarm/en/ref/man3/gfs_unlink.3.html share/doc/html/gfarm/en/ref/man3/gfs_unlink_section.3.html share/doc/html/gfarm/en/ref/man3/gfs_utimes.3.html share/doc/html/gfarm/en/ref/man5/gfarm.conf.5.html share/doc/html/gfarm/en/ref/man8/gfmd.8.html share/doc/html/gfarm/en/ref/man8/gfsd.8.html share/doc/html/gfarm/en/user/index.html share/doc/html/gfarm/en/user/nfs-gfarmfs.html share/doc/html/gfarm/en/user/samba-gfarmfs.html share/doc/html/gfarm/index.html share/doc/html/gfarm/ja/ref/index.html share/doc/html/gfarm/ja/ref/man1/gfarm_agent.1.html share/doc/html/gfarm/ja/ref/man1/gfcd.1.html share/doc/html/gfarm/ja/ref/man1/gfdf.1.html share/doc/html/gfarm/ja/ref/man1/gfexec.1.html share/doc/html/gfarm/ja/ref/man1/gfexport.1.html share/doc/html/gfarm/ja/ref/man1/gfgrep.1.html share/doc/html/gfarm/ja/ref/man1/gfhost.1.html share/doc/html/gfarm/ja/ref/man1/gfimport_fixed.1.html share/doc/html/gfarm/ja/ref/man1/gfimport_text.1.html share/doc/html/gfarm/ja/ref/man1/gfkey.1.html share/doc/html/gfarm/ja/ref/man1/gfls.1.html share/doc/html/gfarm/ja/ref/man1/gfmkdir.1.html share/doc/html/gfarm/ja/ref/man1/gfmpirun_p4.1.html share/doc/html/gfarm/ja/ref/man1/gfps.1.html share/doc/html/gfarm/ja/ref/man1/gfpwd.1.html share/doc/html/gfarm/ja/ref/man1/gfrcmd.1.html share/doc/html/gfarm/ja/ref/man1/gfreg.1.html share/doc/html/gfarm/ja/ref/man1/gfrep.1.html share/doc/html/gfarm/ja/ref/man1/gfrm.1.html share/doc/html/gfarm/ja/ref/man1/gfrmdir.1.html share/doc/html/gfarm/ja/ref/man1/gfront.1.html share/doc/html/gfarm/ja/ref/man1/gfrun.1.html share/doc/html/gfarm/ja/ref/man1/gfsched.1.html share/doc/html/gfarm/ja/ref/man1/gfsetdir.1.html share/doc/html/gfarm/ja/ref/man1/gfstat.1.html share/doc/html/gfarm/ja/ref/man1/gfusage.1.html share/doc/html/gfarm/ja/ref/man1/gfwc.1.html share/doc/html/gfarm/ja/ref/man1/gfwhere.1.html share/doc/html/gfarm/ja/ref/man1/gfwhoami.1.html share/doc/html/gfarm/ja/ref/man3/gfarm.3.html share/doc/html/gfarm/ja/ref/man3/gfarm_hostlist_read.3.html share/doc/html/gfarm/ja/ref/man3/gfarm_import_fragment_config_read.3.html share/doc/html/gfarm/ja/ref/man3/gfarm_import_fragment_size_alloc.3.html share/doc/html/gfarm/ja/ref/man3/gfarm_initialize.3.html share/doc/html/gfarm/ja/ref/man3/gfarm_stringlist_add.3.html share/doc/html/gfarm/ja/ref/man3/gfarm_stringlist_cat.3.html share/doc/html/gfarm/ja/ref/man3/gfarm_stringlist_elem.3.html share/doc/html/gfarm/ja/ref/man3/gfarm_stringlist_free.3.html share/doc/html/gfarm/ja/ref/man3/gfarm_stringlist_init.3.html share/doc/html/gfarm/ja/ref/man3/gfarm_stringlist_length.3.html share/doc/html/gfarm/ja/ref/man3/gfarm_strings_free_deeply.3.html share/doc/html/gfarm/ja/ref/man3/gfarm_terminate.3.html share/doc/html/gfarm/ja/ref/man3/gfarm_url_fragments_replicate.3.html share/doc/html/gfarm/ja/ref/man3/gfarm_url_hosts_schedule.3.html share/doc/html/gfarm/ja/ref/man3/gfarm_url_program_deliver.3.html share/doc/html/gfarm/ja/ref/man3/gfarm_url_program_register.3.html share/doc/html/gfarm/ja/ref/man3/gfarm_url_section_replicate_from_to.3.html share/doc/html/gfarm/ja/ref/man3/gfarm_url_section_replicate_to.3.html share/doc/html/gfarm/ja/ref/man3/gfs_chdir.3.html share/doc/html/gfarm/ja/ref/man3/gfs_chmod.3.html share/doc/html/gfarm/ja/ref/man3/gfs_closedir.3.html share/doc/html/gfarm/ja/ref/man3/gfs_glob.3.html share/doc/html/gfarm/ja/ref/man3/gfs_glob_add.3.html share/doc/html/gfarm/ja/ref/man3/gfs_glob_free.3.html share/doc/html/gfarm/ja/ref/man3/gfs_glob_init.3.html share/doc/html/gfarm/ja/ref/man3/gfs_mkdir.3.html share/doc/html/gfarm/ja/ref/man3/gfs_opendir.3.html share/doc/html/gfarm/ja/ref/man3/gfs_pio_close.3.html share/doc/html/gfarm/ja/ref/man3/gfs_pio_create.3.html share/doc/html/gfarm/ja/ref/man3/gfs_pio_datasync.3.html share/doc/html/gfarm/ja/ref/man3/gfs_pio_eof.3.html share/doc/html/gfarm/ja/ref/man3/gfs_pio_error.3.html share/doc/html/gfarm/ja/ref/man3/gfs_pio_flush.3.html share/doc/html/gfarm/ja/ref/man3/gfs_pio_getc.3.html share/doc/html/gfarm/ja/ref/man3/gfs_pio_getline.3.html share/doc/html/gfarm/ja/ref/man3/gfs_pio_gets.3.html share/doc/html/gfarm/ja/ref/man3/gfs_pio_open.3.html share/doc/html/gfarm/ja/ref/man3/gfs_pio_putc.3.html share/doc/html/gfarm/ja/ref/man3/gfs_pio_putline.3.html share/doc/html/gfarm/ja/ref/man3/gfs_pio_puts.3.html share/doc/html/gfarm/ja/ref/man3/gfs_pio_read.3.html share/doc/html/gfarm/ja/ref/man3/gfs_pio_readdelim.3.html share/doc/html/gfarm/ja/ref/man3/gfs_pio_readline.3.html share/doc/html/gfarm/ja/ref/man3/gfs_pio_seek.3.html share/doc/html/gfarm/ja/ref/man3/gfs_pio_set_local.3.html share/doc/html/gfarm/ja/ref/man3/gfs_pio_set_view_index.3.html share/doc/html/gfarm/ja/ref/man3/gfs_pio_set_view_local.3.html share/doc/html/gfarm/ja/ref/man3/gfs_pio_sync.3.html share/doc/html/gfarm/ja/ref/man3/gfs_pio_truncate.3.html share/doc/html/gfarm/ja/ref/man3/gfs_pio_ungetc.3.html share/doc/html/gfarm/ja/ref/man3/gfs_pio_write.3.html share/doc/html/gfarm/ja/ref/man3/gfs_readdir.3.html share/doc/html/gfarm/ja/ref/man3/gfs_realpath.3.html share/doc/html/gfarm/ja/ref/man3/gfs_rename.3.html share/doc/html/gfarm/ja/ref/man3/gfs_rmdir.3.html share/doc/html/gfarm/ja/ref/man3/gfs_stat.3.html share/doc/html/gfarm/ja/ref/man3/gfs_stat_free.3.html share/doc/html/gfarm/ja/ref/man3/gfs_unlink.3.html share/doc/html/gfarm/ja/ref/man3/gfs_unlink_section.3.html share/doc/html/gfarm/ja/ref/man3/gfs_utimes.3.html share/doc/html/gfarm/ja/ref/man5/gfarm.conf.5.html share/doc/html/gfarm/ja/ref/man8/gfmd.8.html share/doc/html/gfarm/ja/ref/man8/gfsd.8.html share/doc/html/gfarm/ja/user/export-gfarm.html share/doc/html/gfarm/ja/user/index.html share/doc/html/gfarm/ja/user/nfs-gfarmfs.html share/doc/html/gfarm/ja/user/samba-gfarmfs.html share/doc/html/gfarm/ja/user/samba-hook.html share/doc/html/gfarm/ja/user/smboverssh.html share/doc/html/gfarm/pic/gfarm-logo.gif share/examples/rc.d/gfmd share/examples/rc.d/gfsd share/gfarm/config/bdb.DB_CONFIG.in share/gfarm/config/config-gfarm.ldap share/gfarm/config/config-gfarm.postgresql share/gfarm/config/config-gfarm.sysdep share/gfarm/config/gfarm.conf-ldap.in share/gfarm/config/gfarm.conf-postgresql.in share/gfarm/config/gfarm.schema share/gfarm/config/gfarm.schema-1.sql share/gfarm/config/gfarm.schema-2.sql share/gfarm/config/initial.ldif.in share/gfarm/config/gfarm-pgsql.in share/gfarm/config/gfarm-slapd.in share/gfarm/config/gfmd.in share/gfarm/config/gfarm_agent.in share/gfarm/config/gfsd.in share/gfarm/config/slapd.conf-2.0.in share/gfarm/config/slapd.conf-2.1.in share/java/gfront.jar @unexec ${RMDIR} -p %D/share/java 2>/dev/null || ${TRUE} @dirrm share/gfarm/config @dirrm share/gfarm @dirrm share/doc/html/gfarm/pic @dirrm share/doc/html/gfarm/ja/user @dirrm share/doc/html/gfarm/ja/ref/man8 @dirrm share/doc/html/gfarm/ja/ref/man5 @dirrm share/doc/html/gfarm/ja/ref/man3 @dirrm share/doc/html/gfarm/ja/ref/man1 @dirrm share/doc/html/gfarm/ja/ref @dirrm share/doc/html/gfarm/ja @dirrm share/doc/html/gfarm/en/user @dirrm share/doc/html/gfarm/en/ref/man8 @dirrm share/doc/html/gfarm/en/ref/man5 @dirrm share/doc/html/gfarm/en/ref/man3 @dirrm share/doc/html/gfarm/en/ref/man1 @dirrm share/doc/html/gfarm/en/ref @dirrm share/doc/html/gfarm/en @dirrm share/doc/html/gfarm @dirrm share/doc/gfarm @dirrm include/gfarm gfarm-2.4.1/gfptool/0000755000000000000000000000000011507222730012761 5ustar rootrootgfarm-2.4.1/gfptool/gfsplck/0000755000000000000000000000000011507222730014412 5ustar rootrootgfarm-2.4.1/gfptool/gfsplck/gfsplck.c0000644000000000000000000002736111507222724016223 0ustar rootroot/* * $Id: gfsplck.c 3617 2007-03-12 08:32:55Z n-soda $ */ #include #include #include #include #include #include #include #include #include #include #include "config.h" #include "gfs_misc.h" char *progname = "gfsplck"; static int check_all = 0; static int delete_invalid_file = 0; static int list_local_file = 0; static void print_msg_common(FILE *out, const char *path, char *section, char *msg) { if (section == NULL) fprintf(out, "%s on %s: %s\n", path, gfarm_host_get_self_name(), msg); else fprintf(out, "%s (%s) on %s: %s\n", path, section, gfarm_host_get_self_name(), msg); } static void print_errmsg(const char *path, char *section, char *msg) { print_msg_common(stderr, path, section, msg); } static void print_msg(const char *path, char *section, char *msg) { /* do not print any message when listing local files */ if (!list_local_file) print_msg_common(stdout, path, section, msg); } static int unlink_dir(const char *src) { struct stat sb; if (lstat(src, &sb)) { perror(src); return (1); } if (S_ISDIR(sb.st_mode)) { DIR *dirp; struct dirent *dp; /* allow read and write access always */ chmod(src, (sb.st_mode | S_IRUSR | S_IWUSR) & 07777); dirp = opendir(src); if (dirp == NULL) { perror(src); return (1); } while ((dp = readdir(dirp)) != NULL) { char *f; if (strcmp(dp->d_name, ".") == 0 || strcmp(dp->d_name, "..") == 0 || dp->d_ino == 0) continue; GFARM_MALLOC_ARRAY(f, strlen(src) + 1 + strlen(dp->d_name) + 1); if (f == NULL) { print_errmsg(dp->d_name, NULL, "not enough memory"); return (1); } strcpy(f, src); strcat(f, "/"); strcat(f, dp->d_name); (void)unlink_dir(f); free(f); } closedir(dirp); if (rmdir(src)) { perror(src); return (1); } } else if (unlink(src)) { /* if 'src' is not a directory, try to unlink. */ perror(src); return (1); } return (0); } static void delete_invalid_file_or_directory(char *pathname) { if (delete_invalid_file) { if (unlink_dir(pathname) == 0) print_msg(pathname, NULL, "deleted"); else print_errmsg(pathname, NULL, "cannot delete"); } } static char * append_prefix_pathname(const char *prefix, const char *path) { char *url; GFARM_MALLOC_ARRAY(url, strlen(prefix) + strlen(path) + 2); if (url == NULL) return (url); strcpy(url, prefix); switch (url[strlen(url) - 1]) { case '/': case ':': break; default: strcat(url, "/"); } strcat(url, path); return (url); } static char * check_file_size(char *pathname, char *gfarm_file, char *section) { struct stat st; struct gfarm_file_section_info fi; char *e; if (lstat(pathname, &st) == -1) return (gfarm_errno_to_error(errno)); e = gfarm_file_section_info_get(gfarm_file, section, &fi); if (e == GFARM_ERR_NO_SUCH_OBJECT) return (GFARM_ERR_NO_FRAGMENT_INFORMATION); else if (e != NULL) return (e); if (fi.filesize != st.st_size) e = "file size mismatch"; gfarm_file_section_info_free(&fi); return (e); } static char * split_file_and_section(char *file_sec, char **secp) { char *sec; /* split file and section parts. */ sec = &file_sec[strlen(file_sec) - 1]; while (sec > file_sec && *sec != '/') { if (*sec == ':') { *sec = '\0'; ++sec; break; } --sec; } if (sec == file_sec || *sec == '/') return ("invalid filename"); if (secp != NULL) *secp = sec; return (NULL); } static char * fixfrag_ii(char *pathname, char *gfarm_file, char *sec) { char *hostname, *e; struct gfarm_file_section_copy_info sc_info; /* * XXX - Gfarm v1 uses a special lock file to avoid race * condition during on-demand replication. This file should * not be registered. */ if (strstr(sec, ":::lock")) return ("lock file"); if (check_all == 0 && gfs_file_section_check_busy(gfarm_file, sec) != GFARM_ERR_TEXT_FILE_BUSY) { /* check file size */ e = check_file_size(pathname, gfarm_file, sec); if (e != GFARM_ERR_NO_FRAGMENT_INFORMATION && e != NULL) return (e); /* check whether the fragment is already registered. */ e = gfarm_host_get_canonical_self_name(&hostname); if (e == NULL) { e = gfarm_file_section_copy_info_get( gfarm_file, sec, hostname, &sc_info); if (e == NULL) { /* already exist */ gfarm_file_section_copy_info_free(&sc_info); return (GFARM_ERR_ALREADY_EXISTS); } if (e != GFARM_ERR_NO_SUCH_OBJECT) return (e); } } /* * If the corresponding metadata does not exist, register it. * Otherwise, check file size and checksum. */ return (gfs_pio_set_fragment_info_local(pathname, gfarm_file, sec)); } static char * fixfrag_i(const char *gfarm_url, char *pathname, char *gfarm_file, char *sec) { char *e, *path; e = fixfrag_ii(pathname, gfarm_file, sec); if (e != NULL) { if (e != GFARM_ERR_ALREADY_EXISTS) { print_errmsg(gfarm_url, sec, e); if (e != GFARM_ERR_TEXT_FILE_BUSY) delete_invalid_file_or_directory(pathname); } /* display file name */ if (list_local_file) { path = strdup(pathname); if (path != NULL) { if (split_file_and_section(path, NULL) == NULL) printf("%s\n", path); free(path); } } } else print_msg(gfarm_url, sec, "fixed"); return (e); } static int fixdir(char *dir, const char *gfarm_prefix); static void fixurl(const char *gfarm_url) { char *gfarm_file, *local_path, *e; struct stat sb; int len_path, is_invalid = 0, is_directory = 0; glob_t pglob; char **pathp, *pat; struct gfs_stat gs; e = gfarm_canonical_path(gfarm_url_prefix_skip(gfarm_url), &gfarm_file); if (e != NULL) { /* * no path info, try to delete invalid physical files * or directories */ e = gfarm_canonical_path_for_creation( gfarm_url_prefix_skip(gfarm_url), &gfarm_file); if (e != NULL) { /* in this case, give up searching invalid files */ print_errmsg(gfarm_url, NULL, e); return; } is_invalid = 1; } else { /* check it is a directory or not */ e = gfs_stat(gfarm_url, &gs); if (e != NULL) { if (e != GFARM_ERR_NO_FRAGMENT_INFORMATION) { /* maybe permission denied */ print_errmsg(gfarm_url, NULL, e); goto error_gfarm_file; } /* no fragment information case */ } else { is_directory = GFARM_S_ISDIR(gs.st_mode); gfs_stat_free(&gs); } } /* * Check local_path; if it is invalid or not a directory, * delete it. Otherwise, check it recursively. */ e = gfarm_path_localize(gfarm_file, &local_path); if (e == NULL && stat(local_path, &sb) == 0) { if (is_invalid || !is_directory || !S_ISDIR(sb.st_mode)) { print_errmsg(local_path, NULL, "invalid file or directory"); delete_invalid_file_or_directory(local_path); } else if (chdir(local_path) == 0) (void)fixdir(".", gfarm_url); /* continue */ } if (e != NULL) { print_errmsg(gfarm_url, NULL, e); goto error_gfarm_file; } /* investigate file sections */ len_path = strlen(local_path); GFARM_MALLOC_ARRAY(pat, len_path + 3); if (pat == NULL) { print_errmsg(gfarm_url, NULL, "not enough memory"); free(local_path); goto error_gfarm_file; } strcpy(pat, local_path); strcat(pat, ":*"); free(local_path); pglob.gl_offs = 0; glob(pat, GLOB_DOOFFS, NULL, &pglob); free(pat); pathp = pglob.gl_pathv; while (*pathp) { char *sec = &((*pathp)[len_path + 1]); if (is_invalid || is_directory) { print_errmsg(gfarm_url, sec, "invalid file"); delete_invalid_file_or_directory(*pathp); ++pathp; continue; } (void)fixfrag_i(gfarm_url, *pathp, gfarm_file, sec); ++pathp; } globfree(&pglob); error_gfarm_file: free(gfarm_file); return; } static int fixfrag(char *pathname, const char *gfarm_prefix) { char *gfarm_url, *sec, *gfarm_file, *e; struct gfs_stat gst; int r = 1; gfarm_url = append_prefix_pathname(gfarm_prefix, pathname); if (gfarm_url == NULL) { print_errmsg(pathname, NULL, "not enough memory"); return (r); } /* divide into file and section parts. */ e = split_file_and_section(gfarm_url, &sec); if (e != NULL) { print_errmsg(pathname, NULL, e); delete_invalid_file_or_directory(pathname); goto error_gfarm_url; } e = gfs_stat(gfarm_url, &gst); if (e == NULL) { if (!GFARM_S_ISREG(gst.st_mode)) { gfs_stat_free(&gst); print_errmsg(gfarm_url, NULL, "not a regular file"); delete_invalid_file_or_directory(pathname); goto error_gfarm_url; } gfs_stat_free(&gst); } else /* permit no fragment case */; e = gfarm_url_make_path(gfarm_url, &gfarm_file); if (e != NULL) { print_errmsg(gfarm_url, sec, e); delete_invalid_file_or_directory(pathname); goto error_gfarm_url; } /* check whether the fragment is already registered. */ e = fixfrag_i(gfarm_url, pathname, gfarm_file, sec); if (e != NULL && e != GFARM_ERR_ALREADY_EXISTS) goto error_gfarm_file; r = 0; error_gfarm_file: free(gfarm_file); error_gfarm_url: free(gfarm_url); return (r); } static int fixdir(char *dir, const char *gfarm_prefix) { DIR* dirp; struct dirent *dp; struct stat sb; char *dir1; char *gfarm_url, *e; int is_directory; struct gfs_stat gs; if (lstat(dir, &sb)) { perror(dir); return (1); } if (S_ISREG(sb.st_mode)) return (fixfrag(dir, gfarm_prefix)); if (!S_ISDIR(sb.st_mode)) { print_errmsg(dir, NULL, "neither a regular file nor a directory"); delete_invalid_file_or_directory(dir); return (1); } /* 'dir' is a directory */ gfarm_url = append_prefix_pathname(gfarm_prefix, dir); if (gfarm_url == NULL) { print_errmsg(dir, NULL, "not enough memory"); return (1); } e = gfs_stat(gfarm_url, &gs); if (e != NULL) { print_errmsg(gfarm_url, NULL, e); delete_invalid_file_or_directory(dir); free(gfarm_url); return (1); } is_directory = GFARM_S_ISDIR(gs.st_mode); gfs_stat_free(&gs); if (!is_directory) { print_errmsg(gfarm_url, NULL, "invalid directory"); delete_invalid_file_or_directory(dir); free(gfarm_url); return (1); } free(gfarm_url); dirp = opendir(dir); if (dirp == NULL) { perror(dir); return (1); } if (strcmp(dir, ".") == 0) dir = ""; /* just a trick */ while ((dp = readdir(dirp)) != NULL) { if (strcmp(dp->d_name, ".") == 0 || strcmp(dp->d_name, "..") == 0) continue; GFARM_MALLOC_ARRAY(dir1, strlen(dir) + strlen(dp->d_name) + 2); if (dir1 == NULL) { print_errmsg(dp->d_name, NULL, "not enough memory"); closedir(dirp); return (1); } strcpy(dir1, dir); if (strcmp(dir, "")) strcat(dir1, "/"); strcat(dir1, dp->d_name); fixdir(dir1, gfarm_prefix); free(dir1); } return (closedir(dirp)); } /* * */ void usage() { fprintf(stderr, "usage: %s [ -a ] [ -d ] [ -l ] " "[ Gfarm directory . . . ]\n", progname); fprintf(stderr, "options:\n"); fprintf(stderr, "\t-a\tcheck all files\n"); fprintf(stderr, "\t-d\tdelete invalid files\n"); fprintf(stderr, "\t-l\tlist local fils\n"); exit(1); } int main(int argc, char *argv[]) { char *e, *gfarm_prefix, *spool_root = NULL; extern int optind; int c; e = gfarm_initialize(&argc, &argv); if (e != NULL) { print_errmsg(progname, NULL, e); exit(1); } if (!gfarm_is_active_file_system_node) { print_errmsg(progname, NULL, "not a filesystem node"); exit(1); } while ((c = getopt(argc, argv, "adhlr:")) != EOF) { switch (c) { case 'a': check_all = 1; break; case 'd': delete_invalid_file = 1; break; case 'l': list_local_file = 1; break; case 'r': spool_root = optarg; break; case 'h': default: usage(); } } argc -= optind; argv += optind; if (*argv) { while (*argv) fixurl(*argv++); goto finish; } /* fix a whole spool directory. */ if (spool_root == NULL) spool_root = gfarm_spool_root_for_compatibility; if (chdir(spool_root) == 0) gfarm_prefix = "gfarm:/"; else gfarm_prefix = "gfarm:"; fixdir(".", gfarm_prefix); finish: e = gfarm_terminate(); if (e != NULL) { print_errmsg(progname, NULL, e); exit(1); } exit(0); } gfarm-2.4.1/gfptool/gfsplck/Makefile0000644000000000000000000000074611507222724016064 0ustar rootroot# $Id: Makefile 3617 2007-03-12 08:32:55Z n-soda $ top_builddir = ../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk SRCS = gfsplck.c OBJS = gfsplck.o PROGRAM = gfsplck CFLAGS = $(COMMON_CFLAGS) -I$(GFARMLIB_SRCDIR) $(openssl_includes) LDLIBS = $(COMMON_LDFLAGS) $(GFARMLIB) $(LIBS) DEPLIBS = $(DEPGFARMLIB) all: $(PROGRAM) include $(top_srcdir)/makes/gfptool.mk ### $(OBJS): $(DEPGFARMINC) $(GFARMLIB_SRCDIR)/config.h $(GFARMLIB_SRCDIR)/gfs_misc.h gfarm-2.4.1/gfptool/util/0000755000000000000000000000000011507222730013736 5ustar rootrootgfarm-2.4.1/gfptool/util/gfregister.in0000644000000000000000000000243611507222725016440 0ustar rootroot#!/bin/sh prefix=@prefix@ exec_prefix=@exec_prefix@ sbindir=@sbindir@ bindir=@bindir@ libexecdir=@libexecdir@ PATH=${bindir}:${PATH}; export PATH PTOOLS_BIN='gfcombine gfcombine_hook gfcp gfcp_hook gfgrep gfrcmd gfreg' PTOOLS_LIBEXEC='gfrepbe_client gfrepbe_server' # gfwc may not be included in a release binary if [ -f ${bindir}/gfwc ]; then PTOOLS_BIN="$PTOOLS_BIN gfwc" fi hostname=`hostname` arch=`gfhost -M $hostname | sed 's/ .*//'` status=0 if test x"$arch" = x"" then echo "$0: error: architecture name of $hostname isn't determined" >&2 exit 1 fi echo Creating gfarm:/bin gfarm:/libexec ... if gfmkdir gfarm:/bin gfarm:/libexec; then : else status=1 fi # force to register the commands, even if already registered, # because the binaries may be obsolete. echo Registering gfarm commands for $arch ... cd ${bindir}; gfreg -f $PTOOLS_BIN gfarm:/bin cd ${libexecdir}; gfreg -f $PTOOLS_LIBEXEC gfarm:/libexec all_commands='' for cmd in $PTOOLS_BIN; do all_commands="$all_commands gfarm:/bin/$cmd" done for cmd in $PTOOLS_LIBEXEC; do all_commands="$all_commands gfarm:/libexec/$cmd" done gfhost -a $arch | while read host; do echo Replicating gfarm commands to $host ... if gfrep -b -I $arch -s $hostname -d $host $all_commands then : else status=1 fi done exit $status gfarm-2.4.1/gfptool/util/Makefile0000644000000000000000000000037411507222725015406 0ustar rootroottop_builddir = ../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk # gfregister is an administration command. bindir = $(sbindir) SCRIPTS= gfregister include $(top_srcdir)/makes/script.mk distclean: -rm -f $(SCRIPTS) gfarm-2.4.1/gfptool/gfcombine/0000755000000000000000000000000011507222730014712 5ustar rootrootgfarm-2.4.1/gfptool/gfcombine/gfcombine.c0000644000000000000000000000663311507222724017022 0ustar rootroot/* * $Id: gfcombine.c 2373 2006-01-12 00:54:22Z soda $ * * Reduce the number of fragments by nth. */ #include #include #include #include char *program_name = "gfarm_combine"; #define default_output "gfarm:combine.out" void usage() { fprintf(stderr, "Usage: %s [option] \n", program_name); fprintf(stderr, "option:\n"); fprintf(stderr, "\t-n \tdefault 2\n"); fprintf(stderr, "\t-o \t\tdefault %s\n", default_output); exit(1); } #define BUFSIZE 65536 int main(int argc, char *argv[]) { extern char *optarg; extern int optind; int c, total_nodes = -1, node_index = -1; int output_nodes, output_index; char *e, *input, *output = default_output; GFS_File igf, ogf; int n = 2, i; e = gfarm_initialize(&argc, &argv); if (e != NULL) { fprintf(stderr, "%s: %s\n", program_name, e); exit(1); } if (argc >= 1) program_name = argv[0]; while ((c = getopt(argc, argv, "o:n:")) != -1) { switch (c) { case 'n': n = atoi(optarg); break; case 'o': output = optarg; break; case '?': default: usage(); } } argc -= optind; argv += optind; e = gfs_pio_get_node_rank(&node_index); if (e != NULL) { fprintf(stderr, "%s: %s\n", program_name, e); exit(1); } e = gfs_pio_get_node_size(&total_nodes); if (total_nodes <= 0) { fprintf(stderr, "%s: %s\n", program_name, e); exit(1); } if (argc == 0) { if (node_index == 0) { fprintf(stderr, "%s: missing input file name\n", program_name); } exit(1); } input = argv[0]; argc--; argv++; if (argc != 0) { if (node_index == 0) { fprintf(stderr, "%s: currently, " "only one input file is supported\n", program_name); } exit(1); } output_nodes = (total_nodes + n - 1) / n; output_index = node_index / n; if (output_index * n != node_index) goto terminate; /* Only combined nodes run this part. */ e = gfs_pio_create(output, GFARM_FILE_WRONLY|GFARM_FILE_TRUNC, 0666, &ogf); if (e != NULL) { fprintf(stderr, "%s: node %d, cannot open %s: %s\n", program_name, node_index, output, e); exit(1); } e = gfs_pio_set_view_index(ogf, output_nodes, output_index, NULL, GFARM_FILE_SEQUENTIAL); if (e != NULL) { fprintf(stderr, "%s: node %d, set_view_index(%s): %s\n", program_name, node_index, output, e); exit(1); } e = gfs_pio_open(input, GFARM_FILE_RDONLY, &igf); if (e != NULL) { fprintf(stderr, "%s: node %d, cannot open %s: %s\n", program_name, node_index, input, e); exit(1); } for (i = 0; i < n; ++i) { if (node_index + i < total_nodes) { e = gfs_pio_set_view_index(igf, GFARM_FILE_DONTCARE, node_index + i, NULL, GFARM_FILE_SEQUENTIAL); if (e != NULL) { fprintf(stderr, "%s: node %d, set_view_index(%s): %s\n", program_name, node_index, input, e); exit(1); } /* copy this fragment */ for (;;) { int rv, wv; char buffer[BUFSIZE]; e = gfs_pio_read(igf, buffer, sizeof(buffer), &rv); if (e != NULL || rv == 0) break; e = gfs_pio_write(ogf, buffer, rv, &wv); if (e != NULL) break; } } } e = gfs_pio_close(igf); if (e != NULL) fprintf(stderr, "%s: close failed: %s\n", input, e); e = gfs_pio_close(ogf); if (e != NULL) fprintf(stderr, "%s: close failed: %s\n", output, e); terminate: e = gfarm_terminate(); if (e != NULL) { fprintf(stderr, "%s: %s\n", program_name, e); exit(1); } return (0); } gfarm-2.4.1/gfptool/gfcombine/Makefile0000644000000000000000000000060711507222724016360 0ustar rootroot# $Id: Makefile 2373 2006-01-12 00:54:22Z soda $ top_builddir = ../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk SRCS = gfcombine.c OBJS = gfcombine.o PROGRAM = gfcombine CFLAGS = $(COMMON_CFLAGS) LDLIBS = $(COMMON_LDFLAGS) $(GFARMLIB) $(LIBS) DEPLIBS = $(DEPGFARMLIB) all: $(PROGRAM) include $(top_srcdir)/makes/gfptool.mk ### $(OBJS): $(DEPGFARMINC) gfarm-2.4.1/gfptool/gfgrep/0000755000000000000000000000000011507222730014233 5ustar rootrootgfarm-2.4.1/gfptool/gfgrep/Makefile0000644000000000000000000000057611507222725015707 0ustar rootroot# $Id: Makefile 2373 2006-01-12 00:54:22Z soda $ top_builddir = ../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk SRCS = gfgrep.c OBJS = gfgrep.o PROGRAM = gfgrep CFLAGS = $(COMMON_CFLAGS) LDLIBS = $(COMMON_LDFLAGS) $(GFARMLIB) $(LIBS) DEPLIBS = $(DEPGFARMLIB) all: $(PROGRAM) include $(top_srcdir)/makes/gfptool.mk ### $(OBJS): $(DEPGFARMINC) gfarm-2.4.1/gfptool/gfgrep/gfgrep.c0000644000000000000000000000647511507222725015671 0ustar rootroot/* * $Id: gfgrep.c 2373 2006-01-12 00:54:22Z soda $ */ #include #include #include #include #include #include char *program_name = "gfarm_grep"; void usage() { fprintf(stderr, "Usage: %s [option] \n", program_name); fprintf(stderr, "option:\n"); fprintf(stderr, "\t-o \n"); exit(1); } int main(argc, argv) int argc; char **argv; { extern char *optarg; extern int optind; int c, total_nodes = -1, node_index = -1; char *regexp = NULL; char *e, *input, *output = NULL; regex_t re; struct gfs_file *igf; struct gfs_file *ogf; int eof; char line[1024]; e = gfarm_initialize(&argc, &argv); if (e != NULL) { fprintf(stderr, "%s: %s\n", program_name, e); exit(1); } if (argc >= 1) program_name = argv[0]; while ((c = getopt(argc, argv, "e:o:")) != -1) { switch (c) { case 'e': regexp = optarg; break; case 'o': output = optarg; break; case '?': default: usage(); } } argc -= optind; argv += optind; e = gfs_pio_get_node_rank(&node_index); if (e != NULL) { fprintf(stderr, "%s: %s\n", program_name, e); exit(1); } e = gfs_pio_get_node_size(&total_nodes); if (total_nodes <= 0) { fprintf(stderr, "%s: %s\n", program_name, e); exit(1); } if (regexp == NULL) { if (argc == 0) { if (node_index == 0) { fprintf(stderr, "%s: missing regular expression\n", program_name); usage(); } exit(1); } regexp = argv[0]; argc--; argv++; } if (output == NULL) { if (node_index == 0) { fprintf(stderr, "%s: \"-o \" is needed\n", program_name); } exit(1); } if (argc == 0) { if (node_index == 0) { fprintf(stderr, "%s: input file name is mandatory\n", program_name); } exit(1); } input = argv[0]; argc--; argv++; if (argc != 0) { if (node_index == 0) { fprintf(stderr, "%s: currently, " "only one input file is supported\n", program_name); } exit(1); } if (regcomp(&re, regexp, REG_NOSUB) != 0) { if (node_index == 0) { fprintf(stderr, "%s: invalid regular expression\n", program_name); } exit(1); } e = gfs_pio_create(output, GFARM_FILE_WRONLY|GFARM_FILE_TRUNC, 0666, &ogf); if (e != NULL) { fprintf(stderr, "%s: node %d, cannot open %s: %s\n", program_name, node_index, output, e); exit(1); } e = gfs_pio_set_view_local(ogf, GFARM_FILE_SEQUENTIAL); if (e != NULL) { fprintf(stderr, "%s: node %d, set_view_local(%s): %s\n", program_name, node_index, output, e); exit(1); } e = gfs_pio_open(input, GFARM_FILE_RDONLY, &igf); if (e != NULL) { fprintf(stderr, "%s: node %d, cannot open %s: %s\n", program_name, node_index, input, e); exit(1); } e = gfs_pio_set_view_local(igf, GFARM_FILE_SEQUENTIAL); if (e != NULL) { fprintf(stderr, "%s: node %d, set_view_local(%s): %s\n", program_name, node_index, input, e); exit(1); } for (;;) { e = gfs_pio_getline(igf, line, sizeof line, &eof); if (e != NULL) { fprintf(stderr, "%s: %s\n", input, e); break; } if (eof) break; if (regexec(&re, line, 0, NULL, 0) == 0) gfs_pio_putline(ogf, line); } gfs_pio_close(igf); gfs_pio_close(ogf); e = gfarm_terminate(); if (e != NULL) { fprintf(stderr, "%s: %s\n", program_name, e); exit(1); } regfree(&re); return (0); } gfarm-2.4.1/gfptool/gfcp/0000755000000000000000000000000011507222730013700 5ustar rootrootgfarm-2.4.1/gfptool/gfcp/Makefile0000644000000000000000000000057011507222724015345 0ustar rootroot# $Id: Makefile 2373 2006-01-12 00:54:22Z soda $ top_builddir = ../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk SRCS = gfcp.c OBJS = gfcp.o PROGRAM = gfcp CFLAGS = $(COMMON_CFLAGS) LDLIBS = $(COMMON_LDFLAGS) $(GFARMLIB) $(LIBS) DEPLIBS = $(DEPGFARMLIB) all: $(PROGRAM) include $(top_srcdir)/makes/gfptool.mk ### $(OBJS): $(DEPGFARMINC) gfarm-2.4.1/gfptool/gfcp/gfcp.c0000644000000000000000000000763111507222724014775 0ustar rootroot/* * $Id: gfcp.c 2373 2006-01-12 00:54:22Z soda $ * * Copy a file */ #include #include #include #include #include char *program_name = "gfcp"; void usage() { fprintf(stderr, "Usage: %s [option] \n", program_name); fprintf(stderr, "option:\n"); fprintf(stderr, "\t-p\t\t\tpreserve file status\n"); fprintf(stderr, "\t-I fragment-index\tspecify a fragment index\n"); exit(1); } #define BUFSIZE 65536 int main(int argc, char *argv[]) { int flag_preserve = 0; char *e, c, *input, *output, *gfarm_index = NULL; GFS_File igf, ogf; struct gfs_stat gstat; gfarm_mode_t mode; struct gfarm_timespec gtspec[2]; extern char *optarg; extern int optind; e = gfarm_initialize(&argc, &argv); if (e != NULL) { fprintf(stderr, "%s: %s\n", program_name, e); exit(1); } if (argc >= 1) program_name = argv[0]; while ((c = getopt(argc, argv, "hI:p?")) != -1) { switch (c) { case 'p': flag_preserve = 1; break; case 'I': gfarm_index = optarg; break; case 'h': case '?': default: usage(); } } argc -= optind; argv += optind; if (argc < 2 || argc > 3 /* XXX */) usage(); output = argv[argc - 1]; --argc; e = gfs_stat(output, &gstat); if (e == NULL) { if (GFARM_S_ISDIR(gstat.st_mode)) { fprintf(stderr, "%s: is a directory, " "not supported yet\n", output); exit(1); } /* * XXX - gfs_stat() may return a non-null pointer because * a process in the same parallel process might create * it but a different file fragment already. */ /* fprintf(stderr, "%s: already exist\n", output); */ gfs_stat_free(&gstat); } e = gfs_realpath(*argv, &input); if (e != NULL) { fprintf(stderr, "%s: %s\n", *argv, e); exit(1); } e = gfs_stat(input, &gstat); if (e != NULL) { fprintf(stderr, "%s: %s\n", input, e); exit(1); } if (flag_preserve) { mode = gstat.st_mode; gtspec[0] = gstat.st_atimespec; gtspec[1] = gstat.st_mtimespec; } else mode = 0666; gfs_stat_free(&gstat); /** **/ e = gfs_pio_open(input, GFARM_FILE_RDONLY, &igf); if (e != NULL) { fprintf(stderr, "%s: %s\n", input, e); exit(1); } if (gfarm_index == NULL) { e = gfs_pio_set_view_local(igf, GFARM_FILE_SEQUENTIAL); if (e != NULL) { fprintf(stderr, "%s: set_view_local(%s): %s\n", program_name, input, e); exit(1); } } else { e = gfs_pio_set_view_section( igf, gfarm_index, NULL, GFARM_FILE_SEQUENTIAL); if (e != NULL) { fprintf(stderr, "%s: set_view_section(%s, %s): %s\n", program_name, input, gfarm_index, e); exit(1); } } /** **/ e = gfs_pio_create(output, GFARM_FILE_WRONLY|GFARM_FILE_TRUNC, mode, &ogf); if (e != NULL) { fprintf(stderr, "%s: cannot open %s: %s\n", program_name, output, e); exit(1); } if (gfarm_index == NULL) { e = gfs_pio_set_view_local(ogf, GFARM_FILE_SEQUENTIAL); if (e != NULL) { fprintf(stderr, "%s: set_view_local(%s): %s\n", program_name, output, e); exit(1); } } else { e = gfs_pio_set_view_section( ogf, gfarm_index, NULL, GFARM_FILE_SEQUENTIAL); if (e != NULL) { fprintf(stderr, "%s: set_view_section(%s, %s): %s\n", program_name, output, gfarm_index, e); exit(1); } } /* copy this fragment */ for (;;) { int rv, wv; char buffer[BUFSIZE]; e = gfs_pio_read(igf, buffer, sizeof(buffer), &rv); if (e != NULL || rv == 0) break; e = gfs_pio_write(ogf, buffer, rv, &wv); if (e != NULL) break; } if (e != NULL) fprintf(stderr, "%s\n", e); e = gfs_pio_close(igf); if (e != NULL) fprintf(stderr, "%s: close failed: %s\n", input, e); e = gfs_pio_close(ogf); if (e != NULL) fprintf(stderr, "%s: close failed: %s\n", output, e); if (flag_preserve) { e = gfs_utimes(output, gtspec); if (e != NULL) fprintf(stderr, "%s: utimes failed: %s\n", output, e); } e = gfarm_terminate(); if (e != NULL) { fprintf(stderr, "%s: %s\n", program_name, e); exit(1); } return (0); } gfarm-2.4.1/gfptool/gfcp_hook/0000755000000000000000000000000011507222730014720 5ustar rootrootgfarm-2.4.1/gfptool/gfcp_hook/Makefile0000644000000000000000000000072711507222724016371 0ustar rootroot# $Id: Makefile 2373 2006-01-12 00:54:22Z soda $ top_builddir = ../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk SRCS = gfcp_hook.c OBJS = gfcp_hook.o PROGRAM = gfcp_hook CFLAGS = $(COMMON_CFLAGS) LDLIBS = $(COMMON_LDFLAGS) $(top_builddir)/lib/gfs_hook/gfs_hook.o $(GFARMLIB) $(LIBS) DEPLIBS = $(DEPGFARMLIB) $(top_builddir)/lib/gfs_hook/gfs_hook.o all: $(PROGRAM) include $(top_srcdir)/makes/gfptool.mk ### $(OBJS): $(DEPGFARMINC) gfarm-2.4.1/gfptool/gfcp_hook/gfcp_hook.c0000644000000000000000000000263011507222724017027 0ustar rootroot/* * $Id: gfcp_hook.c 2373 2006-01-12 00:54:22Z soda $ */ #include #include #include #include #include #include char *program_name = "gfcp_hook"; void usage() { fprintf(stderr, "Usage: %s [option] \n", program_name); fprintf(stderr, "option:\n"); fprintf(stderr, "\tcurrently no option supported\n"); exit(1); } #define BUFSIZE 65536 int main(int argc, char *argv[]) { char *input, *output; int ifd, ofd; if (argc >= 1) program_name = argv[0]; --argc; ++argv; if (argc == 0) { fprintf(stderr, "%s: missing input file name\n", program_name); exit(1); } input = argv[0]; argc--; argv++; if (argc == 0) { fprintf(stderr, "%s: missing output file name\n", program_name); exit(1); } output = argv[0]; argc--; argv++; if (argc != 0) { fprintf(stderr, "%s: currently, " "only one input file is supported\n", program_name); exit(1); } ofd = creat(output, 0666); if (ofd == -1) { perror(output); exit(1); } ifd = open(input, O_RDONLY); if (ifd == -1) { perror(input); exit(1); } /* copy this fragment */ for (;;) { int rv, wv; char buffer[BUFSIZE]; rv = read(ifd, buffer, sizeof(buffer)); if (rv <= 0) break; wv = write(ofd, buffer, rv); if (wv <= 0) break; } if (close(ifd)) perror(input); if (close(ofd)) perror(output); return (0); } gfarm-2.4.1/gfptool/Makefile0000644000000000000000000000045111507222725014425 0ustar rootroottop_builddir = .. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk MPI_TARGETS = gfwc GFSHOOK_TARGETS = gfcombine_hook gfcp_hook SUBDIRS = \ gfcombine \ gfcp \ gfgrep \ gfsplck \ $(mpi_targets) \ util \ $(gfshook_targets) include $(top_srcdir)/makes/subdir.mk gfarm-2.4.1/gfptool/gfwc/0000755000000000000000000000000011507222730013707 5ustar rootrootgfarm-2.4.1/gfptool/gfwc/gfwc.c0000644000000000000000000000470611507222724015013 0ustar rootroot/* * $Id: gfwc.c 239 2003-01-30 12:27:58Z tatebe $ */ #include #include #include #include #include #include char *program_name = "gfwc"; #if 0 # define FILE_TYPE FILE * # define GETC(file) getc(file) #else # define FILE_TYPE GFS_File # define GETC(file) gfs_pio_getc(file) #endif void wordcount(FILE_TYPE file, long *result) { int c; long linec, wordc, charc; int inword = 0; linec = wordc = charc = 0; while ((c = GETC(file)) != EOF) { charc++; if (c == '\n') linec++; if (isspace(c)) { if (inword) inword = 0; } else { if (!inword) { inword = 1; wordc++; } } } result[0] = linec; result[1] = wordc; result[2] = charc; } int main(argc, argv) int argc; char **argv; { int argc_save = argc; char **argv_save = argv; int total_nodes, node_index; char *e, *input; struct gfs_file *igf; long local_result[3], total_result[3]; if (argc >= 1) program_name = argv[0]; MPI_Init(&argc, &argv); MPI_Comm_rank(MPI_COMM_WORLD, &node_index); MPI_Comm_size(MPI_COMM_WORLD, &total_nodes); #if 0 printf("running on %d/%d\n", node_index, total_nodes); #endif if (argc <= 1) { if (node_index == 0) { fprintf(stderr, "%s: input file name is mandatory\n", program_name); } MPI_Finalize(); exit(1); } argc--; argv++; input = argv[0]; if (argc != 1) { if (node_index == 0) { fprintf(stderr, "%s: currently, " "only one input file is supported\n", program_name); } MPI_Finalize(); exit(1); } e = gfarm_initialize(&argc_save, &argv_save); if (e != NULL) { fprintf(stderr, "%s: %s\n", program_name, e); exit(1); } gfs_pio_set_local(node_index, total_nodes); e = gfs_pio_open(input, GFARM_FILE_RDONLY, &igf); if (e != NULL) { fprintf(stderr, "%s: node %d, cannot open %s: %s\n", program_name, node_index, input, e); exit(1); } e = gfs_pio_set_view_local(igf, GFARM_FILE_SEQUENTIAL); if (e != NULL) { fprintf(stderr, "%s: node %d, set_view_local(%s): %s\n", program_name, node_index, input, e); gfs_pio_close(igf); exit(1); } wordcount(igf, local_result); gfs_pio_close(igf); MPI_Reduce(local_result, total_result, 3, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD); if (node_index == 0) printf("\t%ld\t%ld\t%ld\n", total_result[0], total_result[1], total_result[2]); MPI_Finalize(); e = gfarm_terminate(); if (e != NULL) { fprintf(stderr, "%s: %s\n", program_name, e); exit(1); } return (0); } gfarm-2.4.1/gfptool/gfwc/Makefile0000644000000000000000000000060611507222724015354 0ustar rootroot# $Id: Makefile 2373 2006-01-12 00:54:22Z soda $ top_builddir = ../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk CC = $(MPICC) SRCS = gfwc.c OBJS = gfwc.o PROGRAM = gfwc CFLAGS = $(COMMON_CFLAGS) LDLIBS = $(COMMON_LDFLAGS) $(GFARMLIB) $(LIBS) DEPLIBS = $(DEPGFARMLIB) all: $(PROGRAM) include $(top_srcdir)/makes/gfptool.mk ### $(OBJS): $(DEPGFARMINC) gfarm-2.4.1/gfptool/gfcombine_hook/0000755000000000000000000000000011507222730015732 5ustar rootrootgfarm-2.4.1/gfptool/gfcombine_hook/gfcombine_hook.c0000644000000000000000000000546711507222724021066 0ustar rootroot/* * $Id: gfcombine_hook.c 239 2003-01-30 12:27:58Z tatebe $ * * Reduce the number of fragments by nth using gfs_hook. */ #include #include #include #include #include #include #include #include char *program_name = "gfarm_combine_hook"; #define default_output "gfarm:combine_hook.out" void usage() { fprintf(stderr, "Usage: %s [option] \n", program_name); fprintf(stderr, "option:\n"); fprintf(stderr, "\t-n \tdefault 2\n"); fprintf(stderr, "\t-o \t\tdefault %s\n", default_output); exit(1); } #define BUFSIZE 65536 int main(int argc, char *argv[]) { extern char *optarg; extern int optind; int c, total_nodes = -1, node_index = -1; int output_nodes, output_index; char *e, *input, *output = default_output; int ifd, ofd; int n = 2, i; e = gfarm_initialize(&argc, &argv); if (e != NULL) { fprintf(stderr, "%s: %s\n", program_name, e); exit(1); } if (argc >= 1) program_name = argv[0]; while ((c = getopt(argc, argv, "o:n:")) != -1) { switch (c) { case 'n': n = atoi(optarg); break; case 'o': output = optarg; break; case '?': default: usage(); } } argc -= optind; argv += optind; e = gfs_pio_get_node_rank(&node_index); if (e != NULL) { fprintf(stderr, "%s: %s\n", program_name, e); exit(1); } e = gfs_pio_get_node_size(&total_nodes); if (total_nodes <= 0) { fprintf(stderr, "%s: %s\n", program_name, e); exit(1); } if (argc == 0) { if (node_index == 0) { fprintf(stderr, "%s: missing input file name\n", program_name); } exit(1); } input = argv[0]; argc--; argv++; if (argc != 0) { if (node_index == 0) { fprintf(stderr, "%s: currently, " "only one input file is supported\n", program_name); } exit(1); } output_nodes = (total_nodes + n - 1) / n; output_index = node_index / n; if (output_index * n != node_index) goto terminate; /* Only combined nodes run this part. */ gfs_hook_set_default_view_index(output_index, output_nodes); ofd = creat(output, 0666); if (ofd == -1) { perror(output); exit(1); } for (i = 0; i < n; ++i) { if (node_index + i < total_nodes) { gfs_hook_set_default_view_index(node_index + i, GFARM_FILE_DONTCARE); ifd = open(input, O_RDONLY); if (ifd == -1) { perror(input); exit(1); } /* copy this fragment */ for (;;) { int rv, wv; char buffer[BUFSIZE]; rv = read(ifd, buffer, sizeof(buffer)); if (rv <= 0) break; wv = write(ofd, buffer, rv); if (wv <= 0) break; } if (close(ifd)) perror(input); } } if (close(ofd)) perror(output); terminate: e = gfarm_terminate(); if (e != NULL) { fprintf(stderr, "%s: %s\n", program_name, e); exit(1); } return (0); } gfarm-2.4.1/gfptool/gfcombine_hook/Makefile0000644000000000000000000000074611507222724017404 0ustar rootroot# $Id: Makefile 2373 2006-01-12 00:54:22Z soda $ top_builddir = ../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk SRCS = gfcombine_hook.c OBJS = gfcombine_hook.o PROGRAM = gfcombine_hook CFLAGS = $(COMMON_CFLAGS) LDLIBS = $(COMMON_LDFLAGS) $(top_builddir)/lib/gfs_hook/gfs_hook.o $(GFARMLIB) $(LIBS) DEPLIBS = $(DEPGFARMLIB) $(top_builddir)/lib/gfs_hook/gfs_hook.o all: $(PROGRAM) include $(top_srcdir)/makes/gfptool.mk ### $(OBJS): $(DEPGFARMINC) gfarm-2.4.1/README.ja0000644000000000000000000000310111507222727012561 0ustar rootroot[This is written in Japanese, please look at README.en for English version.] ÆþÌç¥É¥­¥å¥á¥ó¥È¤Ë¤Ä¤¤¤Æ ======================== ½é¤á¤ÆÍøÍѤµ¤ì¤ëÊý¤Ï¡¤¤Þ¤º°Ê²¼¤Î½çÈ֤ǥɥ­¥å¥á¥ó¥È¤òÆÉ¤à¤³¤È¤ò ¤ª´«¤á¤·¤Þ¤¹¡¥ 1. ³µÍ× OVERVIEW.ja 2. ¥¤¥ó¥¹¥È¡¼¥ëÊýË¡ ¥½¡¼¥¹¤«¤é¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤ë¾ì¹ç¡¤INSTALL.ja¡¤ RPM ¤«¤é¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤ë¾ì¹ç¡¤INSTALL.RPM.ja¡¥ 3. ÀßÄêÊýË¡ SETUP.ja 4. ÍøÍÑÊýË¡ GfarmFS-FUSE ¤òÍøÍѤµ¤ì¤ë¾ì¹ç¡¤¤½¤Á¤é¤ËÉÕ°¤¹¤ë¥É¥­¥å¥á¥ó¥È¡¤ ¥É¥­¥å¥á¥ó¥È°ìÍ÷ ================ - README.en (±Ñ¸ì) README.ja (ÆüËܸì) ¤³¤Î¥É¥­¥å¥á¥ó¥È¤Ç¤¹¡¥ - LICENSE (±Ñ¸ì) Gfarm ¤Î¥é¥¤¥»¥ó¥¹É½¼¨¤Ç¤¹¡¥ - RELNOTES (±Ñ¸ì) ³Æ¥Ð¡¼¥¸¥ç¥ó¤ÎÊѹ¹ÅÀ¤Î³µÍפòÀâÌÀ¤·¤Þ¤¹¡¥ - OVERVIEW.en (±Ñ¸ì) OVERVIEW.ja (ÆüËܸì) Gfarm ¤Î³µÍפ䡤³Æ¥É¥­¥å¥á¥ó¥È¤Ç»È¤ï¤ì¤ëÍѸìÅù¤ò¾Ò²ð¤·¤Þ¤¹¡¥ - INSTALL.en (±Ñ¸ì) INSTALL.ja (ÆüËܸì) ¥½¡¼¥¹¥³¡¼¥É¤«¤é¥¤¥ó¥¹¥È¡¼¥ë¤¹¤ë¼ê½ç¤òÀâÌÀ¤·¤Þ¤¹¡¥ - INSTALL.RPM.en (±Ñ¸ì) INSTALL.RPM.ja (ÆüËܸì) RedHat Linux, Fedora Core, CentOS ¤Ê¤É¤ÇÍѤ¤¤é¤ì¤Æ¤¤¤ë¡¤ RPM ¥Ð¥¤¥Ê¥ê¥Ñ¥Ã¥±¡¼¥¸¤«¤é¤Î¥¤¥ó¥¹¥È¡¼¥ë¼ê½ç¤òÀâÌÀ¤·¤Þ¤¹¡¥ - SETUP.en (±Ñ¸ì) SETUP.ja (ÆüËܸì) Gfarm ¤ÎÀßÄêÊýË¡¤òÀâÌÀ¤·¤Þ¤¹¡¥ - SETUP.private.en (±Ñ¸ì) SETUP.private.ja (ÆüËܸì) Gfarm ¤ò¥æ¡¼¥¶¸¢¸Â¤Çưºî¤µ¤»¤ëÊýË¡¤òÀâÌÀ¤·¤Þ¤¹¡¥ ¤³¤Î¾ì¹ç¡¤ÀßÄꤷ¤¿¥æ¡¼¥¶ÀìÍѤȤʤê¤Þ¤¹¡¥ - KNOWN_PROBLEMS.en (±Ñ¸ì) KNOWN_PROBLEMS.ja (ÆüËܸì) Gfarm ¤Ë´Ø¤¹¤ë´ûÃΤÎÌäÂêÅÀ¤Ç¤¹¡¥ - Gfarm-FAQ.en (±Ñ¸ì) Gfarm-FAQ.ja (ÆüËܸì) ¤è¤¯Ê¹¤«¤ì¤ë¼ÁÌä¤È¤½¤ÎÅú¤Ç¤¹¡¥ - HTML ·Á¼°¤Ê¤¤¤· UNIX man ·Á¼°¤Î¥ê¥Õ¥¡¥ì¥ó¥¹¥Þ¥Ë¥å¥¢¥ë (±Ñ¸ì¤ª¤è¤ÓÆüËܸì) - HTML ·Á¼°¤Î¥æ¡¼¥¶¥Þ¥Ë¥å¥¢¥ë (±Ñ¸ì¤ª¤è¤ÓÆüËܸì) ¥¦¥§¥Ö¥µ¥¤¥È http://datafarm.apgrid.org/ ¤â¤´Í÷²¼¤µ¤¤¡¥ gfarm-2.4.1/OVERVIEW.en0000644000000000000000000001260211507222727013110 0ustar rootroot Overview of the Gfarm filesystem About the Gfarm filesystem =========================== The Gfarm filesystem is a distributed filesystem consisting of the local storage of commodity PCs. Many PCs in a local area network, compute nodes in a single cluster, multiple clusters in wide area, comprise a large-scale, high-performance shared network filesystem. The Gfarm filesystem solves performance and reliability problems in NFS and AFS by means of multiple file replicas. It not only prevents performance degradation due to access concentration, but also supports fault tolerance and disaster recovery. A unique feature of Gfarm is that each filesystem node is also a client of the Gfarm filesystem. Distributed access by filesystem nodes realizes super-scalable I/O performance. For detailed information about the Grid Datafarm architecture and Gfarm file system, refer to the following papers. [1] Osamu Tatebe, Youhei Morita, Satoshi Matsuoka, Noriyuki Soda, Satoshi Sekiguchi, "Grid Datafarm Architecture for Petascale Data Intensive Computing," Proceedings of the 2nd IEEE/ACM International Symposium on Cluster Computing and the Grid (CCGrid 2002), IEEE, pp.102-110, 2002 http://datafarm.apgrid.org/ [2] Osamu Tatebe, Noriyuki Soda, Youhei Morita, Satoshi Matsuoka, Satoshi Sekiguchi, "Gfarm v2: A Grid file system that supports high-performance distributed and parallel data computing" Proceedings of the 2004 Computing in High Energy and Nuclear Physics (CHEP04), 2004 http://datafarm.apgrid.org/pdf/CHEP04-gfarmv2.pdf How to access Gfarm =================== There are two methods that can be used to access the Gfarm filesystem: - Using Gfarm commands and Gfarm native file I/O APIs You can use Gfarm specific features like file replication, filesystem node management, etc., via this method. - Using GfarmFS-FUSE (gfarm2fs) You can actually mount the Gfarm filesystem from Linux clients by using FUSE (http://fuse.sourceforge.net/). Unlike the other methods, this one is completely transparent from your application. Host types that make up the Gfarm system ======================================== A Gfarm system consists of the following kinds of nodes: - Client node A terminal node for users. - Filesystem node Filesystem nodes provide data storage and CPUs for the Gfarm system. On each filesystem node, the Gfarm filesystem daemon, called gfsd, is running to facilitate remote file operations and access control in the Gfarm filesystem, as well as to provide user authentication, file replication, node resource status monitoring, and control. - Metadata server node A metadata server node manages Gfarm filesystem metadata. On the metadata server node, a Gfarm filesystem metaserver (gfmd), and a backend database server such as an LDAP server (slapd) or a PostgreSQL server (postmaster) are running. The three types of nodes just introduced are not necessarily different hosts, i.e., you can use the same host for the above purposes, if the number of available hosts are limited. Physically, each file is replicated and dispersed across the disks of the filesystem nodes, and they will be accessed in parallel. Structure of the Gfarm software =============================== The Gfarm filesystem consists of the following software: - The libgfarm.a library A library that implements Gfarm APIs, including Gfarm file access, file replication, and file-affinity process scheduling. - gfmd - the Gfarm filesystem metadata server A metadata server for the Gfarm file system that runs on a metadata server node. It manages directory structure, file information, replica catalog, user/group information, and host information. Gfmd keeps the metadata in memory, but it stored a backend databse such as PostgreSQL server or OpenLDAP server, on background. - gfsd - the Gfarm filesystem daemon An I/O daemon for the Gfarm filesystem that runs on every filesystem node, which provides remote file operations with access control, as well as user authentication, file replication, and node resource status monitoring. - Gfarm command tools Gfarm command tools consist of filesystem commands such as gfls, gfrm, gfwhere and gfrep; a filesystem node management tool, gfhost; file management tools such as gfreg and gfexport; session key management tools, such as gfkey. About authentication ==================== gfmd and gfsd support the following three authentication methods. Please read the security section in Gfarm-FAQ.en, too. 1. sharedsecret This uses a shared key in the ~/.gfarm_shared_key file which will be generated automatically by the Gfarm software. This is suitable for an environment that is protected by a firewall. This authentication method is easy to use in an environment which shares users' home directories via NFS. 2. gsi This is the GSI -- Grid Security Infrastructure -- method, and it uses public key authentication, which is based on a PKI-style certificate. This method encrypts network communication, and is suitable for use over the Internet. Please read the following page provided by the Globus project for details: http://www.globus.org/security/overview.html 3. gsi_auth This method uses GSI for its authentication, but switches to a plain TCP connection after the authentication is completed. This method is suitable for an environment that is protected by a firewall. gfarm-2.4.1/INSTALL.RPM.ja0000644000000000000000000000405511507222727013400 0ustar rootroot[This is written in Japanese, please look at INSTALL.RPM.en for English version.] Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥àƳÆþ¥Þ¥Ë¥å¥¢¥ë ¡ü Ëܥɥ­¥å¥á¥ó¥È¤Ë¤Ä¤¤¤Æ ========================= Ëܥɥ­¥å¥á¥ó¥È¤Ï RPM ¥Ñ¥Ã¥±¡¼¥¸¤Ë¤è¤ë Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ÎƳÆþ¤Ë ´Ø¤·¤Æµ­½Ò¤·¤¿¤â¤Î¤Ç¤¹¡¥ ¡ü ³µÍ× ================================= Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ÎƳÆþ¤Ë¤¢¤¿¤ê¡¤¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¡¤¥Õ¥¡¥¤¥ë¥·¥¹¥Æ ¥à¥Î¡¼¥É¡¤¥¯¥é¥¤¥¢¥ó¥È¥Î¡¼¥É¤ËɬÍפʥѥ屡¼¥¸¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¤Þ¤¹¡¥ °Ê²¼¤Ç¤Ï¡¤¤½¤ì¤¾¤ì°Û¤Ê¤ë¥Û¥¹¥È¤È¤·¤ÆÀâÌÀ¤·¤Æ¤¤¤Þ¤¹¤¬¡¤Æ±°ì¤Î¥Û¥¹¥È¤ËÁ´ ¤Æ¤ò¥¤¥ó¥¹¥È¡¼¥ë¤¹¤ë¤³¤È¤â¤Ç¤­¤Þ¤¹¡¥ ¡ü ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤Î¥¤¥ó¥¹¥È¡¼¥ë ================================= ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥ÐÍѤΠRPM ¥Ñ¥Ã¥±¡¼¥¸¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¤Þ¤¹¡¥ # rpm -Uvh gfarm-server-X.X.X-X.ARCH.rpm \ gfarm-libs-X.X.X-X.ARCH.rpm ¡ÊÃí¡Ë¾åµ­¤Ç¤Ï gfarm-* ¤È¤¤¤¦ RPM ¥Ñ¥Ã¥±¡¼¥¸¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¤Æ¤¤¤Þ ¤¹¤¬¡¤GSI ǧ¾Ú¤¬´Þ¤Þ¤ì¤ë¥Ñ¥Ã¥±¡¼¥¸¤Î¾ì¹ç¤Ï¥Ñ¥Ã¥±¡¼¥¸Ì¾¤¬ gfarm-gsi-* ¤È¤Ê¤ê¤Þ¤¹¡¥ ¡ü ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¡Ê¤«¤Ä¥¯¥é¥¤¥¢¥ó¥È¥Î¡¼¥É¡Ë¤Î¥¤¥ó¥¹¥È¡¼¥ë ================================================================= ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥ÉÍѤΠRPM ¥Ñ¥Ã¥±¡¼¥¸¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¤Þ¤¹¡¥ # rpm -Uvh gfarm-fsnode-X.X.X-X.ARCH.rpm \ gfarm-libs-X.X.X-X.ARCH.rpm \ gfarm-client-X.X.X-X.ARCH.rpm \ gfarm-doc-X.X.X-X.ARCH.rpm Gfarm ¤Ç¤Ï¡¤¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤ÏÄ̾說¥é¥¤¥¢¥ó¥È¤Ë¤â¤Ê¤ê¤Þ¤¹¤Î¤Ç¡¤ client ¥Ñ¥Ã¥±¡¼¥¸¤â¥¤¥ó¥¹¥È¡¼¥ë¤·¤Þ¤¹¡¥doc ¥Ñ¥Ã¥±¡¼¥¸¤ÏǤ°Õ¤Ç¤¹¡¥ ¤µ¤é¤Ë¡¤¥¯¥é¥¤¥¢¥ó¥È¤È¤·¤Æ¡¤GfarmFS-FUSE (gfarm2fs)¤òÍøÍѤ·¡¤Gfarm ¥Õ¥¡ ¥¤¥ë¥·¥¹¥Æ¥à¤ò mount ¤¹¤ë¾ì¹ç¡¤gfarm2fs ¥Ñ¥Ã¥±¡¼¥¸¤Î¥¤¥ó¥¹¥È¡¼¥ë¤âɬÍ× ¤Ç¤¹¡¥ # rpm -Uvh gfarm2fs-X.X.X-X.ARCH.rpm ¡ü ¥¯¥é¥¤¥¢¥ó¥È¥Î¡¼¥É¤Î¥¤¥ó¥¹¥È¡¼¥ë =================================== ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥ÉÍѤΠRPM ¥Ñ¥Ã¥±¡¼¥¸¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¤Þ¤¹¡¥ # rpm -Uvh gfarm-client-X.X.X-X.ARCH.rpm \ gfarm-libs-X.X.X-X.ARCH.rpm \ gfarm-doc-X.X.X-X.ARCH.rpm doc ¥Ñ¥Ã¥±¡¼¥¸¤ÏǤ°Õ¤Ç¤¹¡¥ GfarmFS-FUSE¤òÍøÍѤ·¡¤Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ò mount ¤¹¤ë¾ì¹ç¡¤ gfarm2fs ¥Ñ¥Ã¥±¡¼¥¸¤Î¥¤¥ó¥¹¥È¡¼¥ë¤âɬÍפǤ¹¡¥ # rpm -Uvh gfarm2fs-X.X.X-X.ARCH.rpm $Id: INSTALL.RPM.ja 5010 2010-12-30 00:29:02Z n-soda $ gfarm-2.4.1/util/0000755000000000000000000000000011507222730012264 5ustar rootrootgfarm-2.4.1/util/gfront/0000755000000000000000000000000011507222730013563 5ustar rootrootgfarm-2.4.1/util/gfront/gfront.in0000755000000000000000000000010511507222727015417 0ustar rootroot#! /bin/sh java -jar @prefix@/share/java/gfront.jar >/dev/null 2>&1 gfarm-2.4.1/util/gfront/gfront/0000755000000000000000000000000011507222730015062 5ustar rootrootgfarm-2.4.1/util/gfront/gfront/gfront.in0000755000000000000000000000010511507222727016716 0ustar rootroot#! /bin/sh java -jar @prefix@/share/java/gfront.jar >/dev/null 2>&1 gfarm-2.4.1/util/gfront/gfront/src/0000755000000000000000000000000011507222730015651 5ustar rootrootgfarm-2.4.1/util/gfront/gfront/src/gfront/0000755000000000000000000000000011507222730017150 5ustar rootrootgfarm-2.4.1/util/gfront/gfront/src/gfront/ReadOnlyTableModel.java0000644000000000000000000000030411507222727023464 0ustar rootrootpackage gfront; import javax.swing.table.DefaultTableModel; public class ReadOnlyTableModel extends DefaultTableModel { public boolean isCellEditable(int row, int column) { return false; } } gfarm-2.4.1/util/gfront/gfront/src/gfront/GFAppConst.java0000644000000000000000000000321211507222727021763 0ustar rootrootpackage gfront; public interface GFAppConst { public static final int DEFAULT_METASERVER_PORT = 9000; public static final String DEFAULT_SNMP_COMMUNITY = "public"; public static final String DEFAULT_SNMPGET = "/usr/bin/snmpget"; public static final String DEFAULT_MIBPREFIX_HOSTNAME = "system.sysName"; public static final String DEFAULT_MIBPREFIX_LOAD_AVG = "enterprises.ucdavis.laTable.laEntry.laLoad"; public static final String DEFAULT_MIBPREFIX_IF_TX = "interfaces.ifTable.ifEntry.ifOutOctets"; public static final String DEFAULT_MIBPREFIX_IF_RX = "interfaces.ifTable.ifEntry.ifInOctets"; public static final String DEFAULT_MIBPREFIX_SPOOL_USAGE = "enterprises.ucdavis.dskTable.dskEntry.dskUsed"; public static final String DEFAULT_MIBPREFIX_SPOOL_AVAIL = "enterprises.ucdavis.dskTable.dskEntry.dskAvail"; public static final String[] DEFAULT_MIBPREFIX = { DEFAULT_MIBPREFIX_HOSTNAME, DEFAULT_MIBPREFIX_LOAD_AVG, DEFAULT_MIBPREFIX_IF_TX, DEFAULT_MIBPREFIX_IF_RX, DEFAULT_MIBPREFIX_SPOOL_USAGE, DEFAULT_MIBPREFIX_SPOOL_AVAIL, }; public static final String DEFAULT_MIB_HOSTNAME = DEFAULT_MIBPREFIX_HOSTNAME + ".1"; public static final String DEFAULT_MIB_LOAD_AVG = DEFAULT_MIBPREFIX_LOAD_AVG + ".1"; public static final String DEFAULT_MIB_IF_TX = DEFAULT_MIBPREFIX_IF_TX + ".5"; public static final String DEFAULT_MIB_IF_RX = DEFAULT_MIBPREFIX_IF_RX + ".5"; public static final String DEFAULT_MIB_SPOOL_USAGE = DEFAULT_MIBPREFIX_SPOOL_USAGE + ".1"; public static final String DEFAULT_MIB_SPOOL_AVAIL = DEFAULT_MIBPREFIX_SPOOL_AVAIL + ".1"; public static final int DEFAULT_INTERVAL = 1000; // milli sec. } gfarm-2.4.1/util/gfront/gfront/src/gfront/GFrontConst.java0000644000000000000000000000310511507222727022226 0ustar rootrootpackage gfront; public interface GFrontConst { // class local constants, for l10n. public static final String APPNAME = "GFront"; public static final String _LABEL_MENU_FILE = "File"; public static final String _LABEL_MENU_EDIT = "Edit"; public static final String _LABEL_MENU_SPECIAL = "L&F"; public static final String _LABEL_ITEM_IMPORT = "Import"; public static final String _LABEL_ITEM_EXPORT = "Export"; public static final String _LABEL_ITEM_REPL = "Replicate"; public static final String _LABEL_ITEM_REMOVE = "Remove"; public static final String _LABEL_ITEM_REGISTER = "Register"; public static final String _LABEL_ITEM_MKDIR = "Mkdir"; public static final String _LABEL_ITEM_RUN = "Run"; public static final String _LABEL_ITEM_MPIRUN = "MPI Run"; public static final String _LABEL_ITEM_METASERVER = "MetaServer"; public static final String _LABEL_ITEM_INTERNAL_DEMO = "InternalDemo"; public static final int IDX_MENU_FILE = 0; public static final int IDX_MENU_EDIT = 1; public static final int IDX_MENU_SPECIAL = 2; public static final int IDX_MENU_COUNT = 3; public static final int IDX_ITEM_IMPORT = 0; public static final int IDX_ITEM_EXPORT = 1; public static final int IDX_ITEM_REPL = 2; public static final int IDX_ITEM_REMOVE = 3; public static final int IDX_ITEM_REGISTER = 4; public static final int IDX_ITEM_MKDIR = 5; public static final int IDX_ITEM_RUN = 6; public static final int IDX_ITEM_MPIRUN = 7; public static final int IDX_ITEM_METASERVER = 8; public static final int IDX_ITEM_INTERNAL_DEMO = 9; public static final int IDX_ITEM_COUNT = 10; } gfarm-2.4.1/util/gfront/gfront/src/gfront/CommandOutput.java0000644000000000000000000000025211507222727022617 0ustar rootrootpackage gfront; public class CommandOutput { String[] output; int retcode; int idx; CommandOutput(int num, int r) { output = new String[num]; retcode = r; } } gfarm-2.4.1/util/gfront/gfront/src/gfront/GFLSParser.java0000644000000000000000000001473111507222727021737 0ustar rootrootpackage gfront; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.HashMap; import java.util.StringTokenizer; /* parse the following style output of gfls: -rw-r--r-- tatebe * 17885 Jan 1 1970 Event001.root -rwxr-xr-x tatebe * 11180 Nov 1 20:59 echo -rw-rw-rw- tatebe * 48 Jan 1 1970 host3 -rw-rw-r-- tatebe * 92 Jan 1 1970 host4.indiana -rwxrwxr-x tatebe * 445420 Oct 31 20:53 test -rw-r--r-- tatebe * 1073741824 Jan 1 1970 test.file1 -rwxrwxr-x tatebe * 365113 Jan 1 1970 thput-gfpio */ public class GFLSParser { public static final String DEFAULT_GFLS = "gfls"; public static final String ATTRIB_ATTR = "ATTRIB_ATTR"; public static final String ATTRIB_USER = "ATTRIB_USER"; public static final String ATTRIB_GROUP = "ATTRIB_GROUP"; public static final String ATTRIB_SIZE = "ATTRIB_SIZE"; public static final String ATTRIB_MTIME_DATE = "ATTRIB_DATE"; public static final String ATTRIB_MTIME_MONTH = "ATTRIB_MTIME_MONTH"; public static final String ATTRIB_MTIME_DAY = "ATTRIB_MTIME_DAY"; public static final String ATTRIB_MTIME_TIME = "ATTRIB_MTIME_TIME"; public static final String ATTRIB_MTIME_YEAR = "ATTRIB_MTIME_YEAR"; public static final String ATTRIB_NAME = "ATTRIB_NAME"; String _gfls; // gfls command to use. String gfarm_path; // gfarm path to parse. HashMap[] attribs; // parsed data of gfarm_path; GFront gfront; public GFLSParser(GFront _gfront) { _gfls = DEFAULT_GFLS; gfarm_path = null; attribs = null; gfront = _gfront; } public String getPATH() { return new String(gfarm_path); } public void setPATH(String p) throws IllegalStateException { if (attribs != null) { // already parsed. throw new IllegalStateException("Already parsed parser."); } gfarm_path = new String(p); } public void setCommand(String cmd) throws IllegalStateException { if (attribs != null) { // already parsed. throw new IllegalStateException("Already parsed parser."); } _gfls = new String(cmd); } protected CommandOutput _spawn_gfls_and_capture_output() { Runtime r = Runtime.getRuntime(); String[] cmds = { _gfls, "-lT", gfarm_path }; Process p = null; try { p = r.exec(cmds); } catch (IOException ioe) { // cannot spawn gfls. return null; } int ret = -1; ArrayList l = new ArrayList(); try { InputStream is = p.getInputStream(); BufferedReader br = new BufferedReader(new InputStreamReader(is)); /* ProgressMonitorInputStream pmis = new ProgressMonitorInputStream(gfront, "gfls...", is); //InputStream myis = new BufferedInputStream(pmis); StringWriter sw = new StringWriter(); ProgressMonitor pm = pmis.getProgressMonitor(); pm.setProgress(0); pm.setMillisToDecideToPopup(200); pm.setMaximum(10000); pm.setNote("**********************************************"); System.out.println("available: " + is.available()); int c; while((c = pmis.read()) != -1){ sw.write(c); System.out.print(c); } BufferedReader br = new BufferedReader(new StringReader(sw.toString())); */ while (true) { String ln = br.readLine(); if (ln == null) { // End of stream. break; } l.add(ln); } //pm.close(); } catch (IOException ioe) { // End of stream, pass through. } try { ret = p.waitFor(); } catch (InterruptedException ie) { // Interrupted waiting, but nothing to do... } int sz = l.size(); CommandOutput out = new CommandOutput(sz, ret); out.output = (String[]) (l.toArray(out.output)); return out; } protected HashMap _chop_and_eat(String s) { HashMap nm = new HashMap(); StringTokenizer st = new StringTokenizer(s, " "); // try extract file attributes. if (st.hasMoreTokens() == false) { // Invalid output, no tokens. return null; } String attr = (String) (st.nextToken()); nm.put(ATTRIB_ATTR, attr); // try extract file owner. if (st.hasMoreTokens() == false) { // Invalid output, no second token. return null; } String user = (String) (st.nextToken()); nm.put(ATTRIB_USER, user); // try extract file group. if (st.hasMoreTokens() == false) { // Invalid output, no third token. return null; } String group = (String) (st.nextToken()); nm.put(ATTRIB_GROUP, group); // try extract file size. if (st.hasMoreTokens() == false) { // Invalid output, no 4th token. return null; } String size = (String) (st.nextToken()); nm.put(ATTRIB_SIZE, size); // try extract modified date. if (st.hasMoreTokens() == false) { // Invalid output, no 5th token. return null; } String mon = (String) (st.nextToken()); nm.put(ATTRIB_MTIME_MONTH, mon); if (st.hasMoreTokens() == false) { // Invalid output, no 6th token. return null; } String day = (String) (st.nextToken()); nm.put(ATTRIB_MTIME_DAY, day); if (st.hasMoreTokens() == false) { // Invalid output, no 7th token, time or year. return null; } String time = (String) (st.nextToken()); nm.put(ATTRIB_MTIME_TIME, time); if (st.hasMoreTokens() == false) { // Invalid output, no 7th token, time or year. return null; } String year = (String) (st.nextToken()); nm.put(ATTRIB_MTIME_YEAR, year); nm.put(ATTRIB_MTIME_DATE, mon + " " + day + " " + time + " " + year); if (st.hasMoreTokens() == false) { // Invalid output, no 8th token. return null; } String filename = (String) (st.nextToken()); nm.put(ATTRIB_NAME, filename); return nm; } public boolean parse() throws IllegalStateException { if (attribs != null) { // already parsed. throw new IllegalStateException("Already parsed parser."); } if (gfarm_path == null) { throw new IllegalStateException("No path is set."); } CommandOutput o = _spawn_gfls_and_capture_output(); if (o == null) { // spawning gfls is failed. return false; } if (o.retcode != 0) { // failure. return false; } // success. int sz = o.output.length; attribs = new HashMap[sz]; for (int i = 0; i < sz; i++) { HashMap nm = _chop_and_eat(o.output[i]); if (nm == null) { // Invalid format in output. return false; } attribs[i] = nm; } return true; } public int getSize() { if (attribs == null) { // not parsed. return -1; } return attribs.length; } public String getAttr(int i, String key) { if (attribs == null) { // not parsed. return null; } return (String) (attribs[i].get(key)); } } gfarm-2.4.1/util/gfront/gfront/src/gfront/ChangeLookAndFeel.java0000644000000000000000000000376011507222727023260 0ustar rootrootpackage gfront; import java.awt.Component; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.Vector; import javax.swing.JMenuItem; import javax.swing.LookAndFeel; import javax.swing.SwingUtilities; import javax.swing.UIManager; import javax.swing.UnsupportedLookAndFeelException; public class ChangeLookAndFeel { LookAndFeel laf; UIManager.LookAndFeelInfo lafinfo[]; //Component main; Vector compolist; ChangeLookAndFeel(){ init(); } ChangeLookAndFeel(Component _main){ this(); //main = _main; compolist = new Vector(); compolist.add(_main); } void init(){ laf = UIManager.getLookAndFeel(); lafinfo = UIManager.getInstalledLookAndFeels(); } public void addComponent(Component c){ compolist.add(c); } public void addMenuItem(JMenuItem mi){ for(int i = 0; i < lafinfo.length; i++){ JMenuItem jmi = new JMenuItem(lafinfo[i].getName()); jmi.addActionListener(new ClickAction(lafinfo[i].getClassName())); mi.add(jmi); } } public static void main(String args[]){ ChangeLookAndFeel clf = new ChangeLookAndFeel(); for(int i = 0; i < clf.lafinfo.length; i++){ System.out.println(clf.lafinfo[i].getClassName()); System.out.println(clf.lafinfo[i].getName()); } } protected class ClickAction implements ActionListener { String uiName; //Component c; ClickAction(String _uiName){ uiName = _uiName; } public void actionPerformed(ActionEvent ae) { try { UIManager.setLookAndFeel(uiName); } catch (ClassNotFoundException e) { //e.printStackTrace(); } catch (InstantiationException e) { //e.printStackTrace(); } catch (IllegalAccessException e) { //e.printStackTrace(); } catch (UnsupportedLookAndFeelException e) { //e.printStackTrace(); } int size = compolist.size(); Component[] tmp = new Component[size]; Component[] cmp = (Component[]) (compolist.toArray(tmp)); for(int i=0; i < size; i++){ SwingUtilities.updateComponentTreeUI(cmp[i]); } } } } gfarm-2.4.1/util/gfront/gfront/src/gfront/GFWHEREParser2.java0000644000000000000000000001231111507222727022345 0ustar rootrootpackage gfront; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.HashMap; import java.util.StringTokenizer; public class GFWHEREParser2 { public static final String DEFAULT_GFWHERE = "gfwhere"; public static final String ATTRIB_INDEX = "ATTRIB_INDEX"; public static final String ATTRIB_NODES = "ATTRIB_NODES"; String _gfwhere; // gfwhere command to use. String gfarm_file; // gfarm file to analyze. HashMap[] attribs; // parsed data of gfarm_path; ArrayList comargs; // command arguments String[] outs; int all_fragment_count = 0; int fragment_count = 0; public GFWHEREParser2() { _gfwhere = DEFAULT_GFWHERE; gfarm_file = null; attribs = null; comargs = new ArrayList(); comargs.add(_gfwhere); outs = null; } public String getPATH() { return new String(gfarm_file); } public void addPATH(String p) throws IllegalStateException { if (attribs != null) { // already parsed. throw new IllegalStateException("Already parsed parser."); } comargs.add(p); } public void setCommand(String cmd) throws IllegalStateException { if (attribs != null) { // already parsed. throw new IllegalStateException("Already parsed parser."); } _gfwhere = new String(cmd); } protected CommandOutput _spawn_gfwhere_and_capture_output() { Runtime r = Runtime.getRuntime(); String[] cmds = new String[comargs.size()]; cmds = (String[]) comargs.toArray(cmds); Process p = null; try { p = r.exec(cmds); } catch (IOException ioe) { // cannot spawn gfwhere. return null; } int ret = -1; ArrayList l = new ArrayList(); try { InputStream is = p.getInputStream(); BufferedReader br = new BufferedReader(new InputStreamReader(is)); while (true) { String ln = br.readLine(); if (ln == null) { // End of stream. break; } System.out.println("add: " + ln); l.add(ln); } } catch (IOException ioe) { // End of stream, pass through. } try { ret = p.waitFor(); } catch (InterruptedException ie) { // Interrupted waiting, but nothing to do... } int sz = l.size(); CommandOutput out = new CommandOutput(sz, ret); out.output = (String[]) (l.toArray(out.output)); return out; } protected HashMap _chop_and_eat(String s) { HashMap nm = new HashMap(); StringTokenizer st = new StringTokenizer(s, " "); // try extract file attributes. if (st.hasMoreTokens() == false) { // Invalid output, no tokens. return null; } String str_idx = (String) (st.nextToken()); str_idx = str_idx.substring(0, str_idx.length() - 1); nm.put(ATTRIB_INDEX, str_idx); if (st.hasMoreTokens() == false) { // No filesystem node is. return null; } ArrayList node_list = new ArrayList(); while (st.hasMoreTokens()) { String n = (String) (st.nextToken()); node_list.add(n); all_fragment_count++; } nm.put(ATTRIB_NODES, node_list); return nm; } public boolean parse() throws IllegalStateException { if (attribs != null) { // already parsed. throw new IllegalStateException("Already parsed parser."); } System.out.println("size:" + comargs.size()); if (comargs.size() == 1) { throw new IllegalStateException("No path is set."); } CommandOutput o = _spawn_gfwhere_and_capture_output(); if (o == null) { // spawning gfwhere is failed. return false; } if (o.retcode != 0) { // failure. return false; } outs = o.output; /* // success. int sz = o.output.length; attribs = new HashMap[sz]; for (int i = 0; i < sz; i++) { HashMap nm = _chop_and_eat(o.output[i]); if (nm == null) { // Invalid format in output. return false; } attribs[i] = nm; } fragment_count = sz; */ return true; } public int getFragmentCount(int index) { if(outs == null){ return -1; } int nodeindex = -1; int fragcount = 0; int found = 0; for(int i=0; i < outs.length; i++){ if(outs[i].startsWith("gfarm:")){ if(found == 1) { return fragcount; } nodeindex++; fragcount = 0; } else if(outs[i].equals("")){ } else if(index == nodeindex || nodeindex == -1){ fragcount++; System.out.println("seek: " + outs[i]); found = 1; } } return fragcount; } public int getAllFragmentCount() { return all_fragment_count; } public int getSize() { if (attribs == null) { // not parsed. return -1; } return attribs.length; } public ArrayList getNodeList(int i) { if (attribs == null) { // not parsed. return null; } return (ArrayList) (attribs[i].get(ATTRIB_NODES)); } public String getARCH(int i) { if (attribs == null) { // not parsed. return null; } return (String) (attribs[i].get(ATTRIB_INDEX)); } public int getFragmentIndex(int i) throws NumberFormatException { if (attribs == null) { // not parsed. throw new NumberFormatException("Not parsed."); } return Integer.parseInt((String) (attribs[i].get(ATTRIB_INDEX))); } public static void main(String args[]){ GFWHEREParser2 p = new GFWHEREParser2(); p.addPATH("gfarm:/3com-stat"); p.addPATH("gfarm:/3com-stat.bin"); p.addPATH("gfarm:/takuya/aaa"); p.parse(); System.out.println("fragment:" + p.getFragmentCount(2)); } } gfarm-2.4.1/util/gfront/gfront/src/gfront/FragmentEditor.java0000644000000000000000000001366211507222727022743 0ustar rootrootpackage gfront; import java.awt.BorderLayout; import java.util.ArrayList; import java.util.Vector; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTable; import javax.swing.ListSelectionModel; import javax.swing.SwingUtilities; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; import javax.swing.table.JTableHeader; public class FragmentEditor extends JPanel implements GFAppConst, ListSelectionListener { JTable tbl_frag; FragmentTableModel frags; JScrollPane jsp; protected static FragmentTableModel _create_new_table_model() { FragmentTableModel dtm = new FragmentTableModel(); return dtm; } public FragmentEditor() { frags = _create_new_table_model(); tbl_frag = new JTable(frags); tbl_frag.setShowGrid(false); tbl_frag.setShowHorizontalLines(false); tbl_frag.setShowVerticalLines(true); tbl_frag.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); tbl_frag.getSelectionModel().addListSelectionListener(this); jsp = new JScrollPane(tbl_frag); jsp.getViewport().setBackground(tbl_frag.getBackground()); JTableHeader jth = tbl_frag.getTableHeader(); jsp.setColumnHeaderView(jth); setLayout(new BorderLayout()); add(jsp, BorderLayout.CENTER); } public synchronized void valueChanged(ListSelectionEvent e) { // } /* public void update(String fullpath) { GFWHEREThread gwt = new GFWHEREThread(); gwt.fullpath = fullpath; gwt.start(); while(gwt.fullpath != null){ System.out.println("sleep"); try { Thread.sleep(1000); } catch (InterruptedException e) { e.printStackTrace(); } } } class GFWHEREThread extends Thread { public String fullpath = null; public void run() { if(fullpath == null){ return; } System.out.println("thread: gfwhere"); GFWHEREParser p = new GFWHEREParser(); p.setPATH(fullpath); if (p.parse() == false) { // update failed. return; } FragmentTableModel dtm = _create_new_table_model(); int sz = p.getSize(); Vector v = null; int col_sz = 2; dtm.setColumnCount(col_sz); try { // OK, file is normal file, index is index. int idx = p.getFragmentIndex(0); dtm.setExecutable(false); for (int i = 0; i < sz; i++) { int id = p.getFragmentIndex(i); ArrayList nl = p.getNodeList(i); if (col_sz - 1 < nl.size()) { int old_col_sz = col_sz; col_sz = nl.size() + 1; for (int j = 0; j < col_sz - old_col_sz; j++) { dtm.addColumn(""); } // dtm.setColumnCount(col_sz); } v = new Vector(nl); v.add(0, new Integer(id)); dtm.addRow(v); } } catch (NumberFormatException nfe) { // OK, file is executable, index is architecture. dtm.setExecutable(true); for (int i = 0; i < sz; i++) { String arch = p.getARCH(i); ArrayList nl = p.getNodeList(i); v = new Vector(nl); v.add(0, arch); dtm.addRow(v); } } tbl_frag.setModel(dtm); fullpath = null; } } */ public void setNullFragmentTable(){ FragmentTableModel dtm = _create_new_table_model(); frags = dtm; SwingUtilities.invokeLater(new Runnable() { public void run() { tbl_frag.setModel(frags); } }); } public void update(String fullpath) { if(fullpath == null){ setNullFragmentTable(); return; } GFWHEREParser p = new GFWHEREParser(); p.setPATH(fullpath); p.start(); try { while (p.isAlive()) { //System.out.println("sleep: gfwhere"); p.join(100); } } catch (InterruptedException e) { //e.printStackTrace(); } if (p.retval == false) { // update failed. setNullFragmentTable(); return; } FragmentTableModel dtm = _create_new_table_model(); int sz = p.getSize(); Vector v = null; int col_sz = 2; int colMax = 11; // Limit: Filesystem Node = 10 dtm.setColumnCount(col_sz); try { // OK, file is normal file, index is index. // int idx = p.getFragmentIndex(0); dtm.setExecutable(false); for (int i = 0; i < sz; i++) { int id = p.getFragmentIndex(i); ArrayList nl = p.getNodeList(i); if (col_sz - 1 < nl.size()) { int old_col_sz = col_sz; col_sz = nl.size() + 1; if(col_sz > colMax){ col_sz = colMax; } for (int j = 0; j < col_sz - old_col_sz; j++) { dtm.addColumn(""); } // dtm.setColumnCount(col_sz); } v = new Vector(nl); v.add(0, new Integer(id)); dtm.addRow(v); } } catch (NumberFormatException nfe) { // OK, file is executable, index is architecture. // dtm.setExecutable(true); // for (int i = 0; i < sz; i++) { // String arch = p.getARCH(i); // ArrayList nl = p.getNodeList(i); // v = new Vector(nl); // v.add(0, arch); // dtm.addRow(v); // } dtm.setExecutable(true); for (int i = 0; i < sz; i++) { String arch = p.getARCH(i); ArrayList nl = p.getNodeList(i); if (col_sz - 1 < nl.size()) { int old_col_sz = col_sz; col_sz = nl.size() + 1; if(col_sz > colMax){ col_sz = colMax; } for (int j = 0; j < col_sz - old_col_sz; j++) { dtm.addColumn(""); } } v = new Vector(nl); v.add(0, arch); dtm.addRow(v); } } //tbl_frag.setModel(dtm); frags = dtm; SwingUtilities.invokeLater(new Runnable() { public void run() { tbl_frag.setModel(frags); } }); jsp.getViewport().setBackground(tbl_frag.getBackground()); } } class FragmentTableModel extends ReadOnlyTableModel { protected boolean isExecutable = false; public FragmentTableModel() { setColumnIdentifiers(new String[] { "Index", "Filesystem Node" }); } public Class getColumnClass(int idx) { if (idx == 0 && isExecutable) { return String.class; } if (idx == 0 && !(isExecutable)) { return Number.class; } return Object.class; } public void setExecutable(boolean t) { isExecutable = t; if (t == true) { setColumnIdentifiers( new String[] { "Architecture", "Filesystem Node" }); } } } gfarm-2.4.1/util/gfront/gfront/src/gfront/DirectoryTreeNode.java0000644000000000000000000000055011507222727023413 0ustar rootrootpackage gfront; import javax.swing.tree.*; public class DirectoryTreeNode extends DefaultMutableTreeNode { protected boolean _isExplored = false; public DirectoryTreeNode() { super(); } public boolean isLeaf() { return false; } public void setExplored(boolean b) { _isExplored = b; } public boolean isExplored() { return _isExplored; } } gfarm-2.4.1/util/gfront/gfront/src/gfront/GFrontApp.java0000644000000000000000000000100411507222727021654 0ustar rootrootpackage gfront; import java.awt.Dimension; import java.awt.DisplayMode; import java.awt.GraphicsEnvironment; public class GFrontApp { public static void main(String args[]) { GFront f = new GFront(); f.initial_setup(); //f.pack(); try { Dimension d = f.getSize(); DisplayMode dm = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDisplayMode(); f.setLocation(dm.getWidth()/2 - d.width/2, dm.getHeight()/2 - d.height/2); } catch(Exception e){ } f.show(); } } gfarm-2.4.1/util/gfront/gfront/src/gfront/GFront.java0000644000000000000000000003444211507222727021227 0ustar rootrootpackage gfront; import java.awt.BorderLayout; import java.awt.Container; import java.awt.Dimension; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.HashMap; import java.util.Locale; import javax.swing.JFrame; import javax.swing.JMenu; import javax.swing.JMenuBar; import javax.swing.JMenuItem; import javax.swing.JProgressBar; import javax.swing.JScrollPane; import javax.swing.JSplitPane; import javax.swing.JTable; import javax.swing.JTree; import javax.swing.ListSelectionModel; import javax.swing.SwingUtilities; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; import javax.swing.event.TreeExpansionEvent; import javax.swing.event.TreeSelectionEvent; import javax.swing.event.TreeSelectionListener; import javax.swing.event.TreeWillExpandListener; import javax.swing.table.JTableHeader; import javax.swing.tree.DefaultTreeModel; import javax.swing.tree.DefaultTreeSelectionModel; import javax.swing.tree.TreeNode; import javax.swing.tree.TreePath; public class GFront extends JFrame implements GFAppConst, GFrontConst, ListSelectionListener, TreeSelectionListener, TreeWillExpandListener { DirectoryTreeNode root_dir; DefaultTreeModel dirs; FileTableModel files; FragmentEditor property; JTree tre_dirs; JTable tbl_files; JMenuBar menubar; JMenu[] menus; JMenuItem[] menuItems; ChangeLookAndFeel clf; TreePath selected_path; DirectoryTreeNode selected_dir; String ldap_hostname; String ldap_base; int ldap_port; JScrollPane jsp_files; HashMap dir_node_map; private JProgressBar progressBar; public GFront() { super(); setSize(600, 600); selected_path = null; selected_dir = null; _node_is_not_selected_now(); //setDefaultCloseOperation(DISPOSE_ON_CLOSE); setDefaultCloseOperation(EXIT_ON_CLOSE); //ldap_hostname = "(not connected)"; ldap_hostname = "GFront"; ldap_base = ""; ldap_port = DEFAULT_METASERVER_PORT; root_dir = new DirectoryTreeNode(); root_dir.setUserObject("/"); dirs = new DefaultTreeModel(root_dir); files = new FileTableModel(); clf = new ChangeLookAndFeel(this); // Tree (gfls) tre_dirs = new JTree(dirs); tre_dirs.addTreeWillExpandListener(this); tre_dirs.addTreeSelectionListener(this); RightClickDirTree tree_right = new RightClickDirTree(tre_dirs, this); tre_dirs.addMouseListener(tree_right); clf.addComponent(tree_right.jpop); DefaultTreeSelectionModel tslm = new DefaultTreeSelectionModel(); tslm.setSelectionMode(DefaultTreeSelectionModel.SINGLE_TREE_SELECTION); tre_dirs.setSelectionModel(tslm); // Table (gfls) tbl_files = new JTable(files); tbl_files.setShowGrid(false); tbl_files.setShowHorizontalLines(false); tbl_files.setShowVerticalLines(true); tbl_files.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); tbl_files.getSelectionModel().addListSelectionListener(this); RightClickTable tbl_right = new RightClickTable(tbl_files, this); tbl_files.addMouseListener(tbl_right); clf.addComponent(tbl_right.jpop); // Property (gfwhere) property = new FragmentEditor(); property.setEnabled(false); // ProgressBar progressBar = new JProgressBar(0, 1000); progressBar.setValue(0); progressBar.setStringPainted(true); progressBar.setString(""); //but don't paint it //progressBar.setIndeterminate(true); Dimension dm = new Dimension(); dm.setSize(5, 30); progressBar.setMinimumSize(dm); progressBar.setMaximumSize(dm); //progressBar.setPreferredSize(dm); jsp_files = new JScrollPane(tbl_files); jsp_files.getViewport().setBackground(tbl_files.getBackground()); JTableHeader jth = tbl_files.getTableHeader(); jsp_files.setColumnHeaderView(jth); // right JSplitPane tb_split = new JSplitPane( JSplitPane.VERTICAL_SPLIT, jsp_files, property); tb_split.setDividerLocation(getHeight()/2); tb_split.setDividerSize(5); // left JSplitPane left_split = new JSplitPane( JSplitPane.VERTICAL_SPLIT, new JScrollPane(tre_dirs), progressBar); //left_split.setDividerLocation(1000); // all JSplitPane lr_split = new JSplitPane( JSplitPane.HORIZONTAL_SPLIT, true, new JScrollPane(tre_dirs), // left_split, tb_split); lr_split.setDividerLocation(getWidth()/4); lr_split.setDividerSize(5); Container c = getContentPane(); c.setLayout(new BorderLayout()); c.add(lr_split, BorderLayout.CENTER); init_all_menus(); setJMenuBar(menubar); setTitle(ldap_hostname); } public boolean initial_setup() { root_dir.removeAllChildren(); boolean retv = _update_node(root_dir, (String) (root_dir.getUserObject())); if(retv == false){ return false; } if(selected_path == null){ int sz = root_dir.getChildCount(); GFrontCommon gfc = new GFrontCommon(); String workDir = gfc.runNomalCommandToString(this, "gfsetdir", "gfsetdir"); String userName; try { userName = workDir.substring(workDir.indexOf("gfarm:/")+7, workDir.indexOf(";")); } catch(Exception e){ userName = System.getProperty("user.name"); } System.out.println("gfpwd: gfarm:/" + userName); for(int i=0; i 0) { // stdout System.out.println(stdMsg); showTextArea(parent, name + ": stdout", stdMsg); } if (errorMsg.length() > 0) { // stderr System.out.println(errorMsg); showTextArea(parent, name + ": stderr", errorMsg); } } errStringOfRunCommand = errorMsg; return stdMsg; } public void runNomalCommand(JFrame parent, String cmd, String name){ runCommand(parent, cmd, name, true); } public String runNomalCommandToString(JFrame parent, String cmd, String name){ return runCommand(parent, cmd, name, false); } public String getErrorString(){ return errStringOfRunCommand; } class SaveStringOfInputStream extends java.lang.Thread { private BufferedReader br; private StringBuffer lines; SaveStringOfInputStream(InputStream is){ br = new BufferedReader(new InputStreamReader(is)); lines = new StringBuffer(); } public void run() { try { while (true) { String ln = br.readLine(); if (ln == null) { // End of stream. break; } lines.append(ln + System.getProperty("line.separator")); } } catch (IOException ioe) { return; } } public String toString(){ return lines.toString(); } } } gfarm-2.4.1/util/gfront/gfront/src/gfront/GfhostList.java0000644000000000000000000000313711507222727022113 0ustar rootrootpackage gfront; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.ArrayList; public class GfhostList implements ActionListener { String[] list; GFront gfront; GfhostList(GFront _gfront){ list = null; gfront = _gfront; } public void runGfhost(){ Runtime r = Runtime.getRuntime(); String[] cmds = { "gfhost", "-l"}; Process p = null; try { p = r.exec(cmds); } catch (IOException ioe) { list = null; return; } int ret = -1; ArrayList l = new ArrayList(); try { InputStream is = p.getInputStream(); BufferedReader br = new BufferedReader(new InputStreamReader(is)); while (true) { String ln = br.readLine(); if (ln == null) { // End of stream. break; } l.add(ln); } } catch (IOException ioe) { // End of stream, pass through. } try { ret = p.waitFor(); } catch (InterruptedException ie) { // Interrupted waiting, but nothing to do... } int sz = l.size(); CommandOutput out = new CommandOutput(sz, ret); list = out.output = (String[]) (l.toArray(out.output)); return; } public String toString(){ StringBuffer str = new StringBuffer(); for(int i=0; i < list.length; i++){ str.append(list[i] + System.getProperty("line.separator")); } return str.toString(); } public void actionPerformed(ActionEvent ae) { runGfhost(); if(list != null){ GFrontCommon gfc = new GFrontCommon(); gfc.showTextArea(gfront,"gfhost", toString(), 30, 60); } } } gfarm-2.4.1/util/gfront/gfront/src/gfront/FileTableModel.java0000644000000000000000000000061711507222727022635 0ustar rootrootpackage gfront; public class FileTableModel extends ReadOnlyTableModel { public Class getColumnClass(int idx) { Class ret = null; switch (idx) { case 0 : ret = String.class; break; case 1 : ret = Number.class; break; case 2 : ret = String.class; break; case 3 : ret = Number.class; break; default : ret = Object.class; } return ret; } } gfarm-2.4.1/util/gfront/gfront/src/gfront/RightClickDirTree.java0000644000000000000000000001044211507222727023324 0ustar rootrootpackage gfront; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.io.File; import javax.swing.JFileChooser; import javax.swing.JMenuItem; import javax.swing.JOptionPane; import javax.swing.JPopupMenu; import javax.swing.JTree; import javax.swing.tree.TreePath; public class RightClickDirTree implements MouseListener, ActionListener { public JPopupMenu jpop; JMenuItem gfrmdir, gfmkdir, gfreg, gfimport_text, gfimport_fixed; JTree jt; GFront gfront; RightClickDirTree(JTree _jt, GFront _gfront) { jpop = new JPopupMenu(); //gfreg = new JMenuItem("gfreg -N 1 -I 0"); gfreg = new JMenuItem("import"); gfreg.addActionListener(this); jpop.add(gfreg); gfimport_text = new JMenuItem("* gfimport_text"); gfimport_text.addActionListener(this); //jpop.add(gfimport_text); gfimport_fixed = new JMenuItem("* gfimport_fixed"); gfimport_fixed.addActionListener(this); //jpop.add(gfimport_fixed); gfmkdir = new JMenuItem("gfmkdir"); gfmkdir.addActionListener(this); jpop.add(gfmkdir); gfrmdir = new JMenuItem("gfrmdir"); gfrmdir.addActionListener(this); jpop.add(gfrmdir); jt = _jt; gfront = _gfront; } public void actionPerformed(ActionEvent ae) { GFrontCommon gfc = new GFrontCommon(); TreePath tp = jt.getSelectionPath(); if (tp == null) { return; } String dirurl = gfront.savedSelectedDirname; if (ae.getSource() == gfreg) { JFileChooser chooser = new JFileChooser(); int returnVal = chooser.showOpenDialog(gfront); if (returnVal != JFileChooser.APPROVE_OPTION) { return; } File inFile = chooser.getSelectedFile(); if (inFile.exists() == false) { JOptionPane.showMessageDialog( null, inFile.getName() + ": No such file or directory", "gfreg", JOptionPane.INFORMATION_MESSAGE); return; } String inPath = inFile.getPath(); String regName = JOptionPane.showInputDialog( gfront, "a name for registering", inFile.getName()); if(regName == null) { return; } //String cmd = "gfreg -N 1 -I 0 " + inFile + " " + dirurl + regName; String cmd = "gfreg " + inFile + " " + dirurl + regName; gfc.runNomalCommand(gfront, cmd, "gfreg"); // update gfront._update_table(gfront.savedSelectedDirname); } else if (ae.getSource() == gfimport_text) { gfc.showTextArea(gfront, "gfimport_text", "test\ntest\n"); } else if (ae.getSource() == gfimport_fixed) { } else if (ae.getSource() == gfrmdir) { Object[] options = { "OK", "CANCEL" }; int ret = JOptionPane.showOptionDialog( null, "remove " + dirurl + " ?", "gfrmdir", JOptionPane.DEFAULT_OPTION, JOptionPane.WARNING_MESSAGE, null, options, options[0]); if (ret == 0) { // OK //System.out.println("$ gfrmdir " + dirurl); gfc.runNomalCommand(gfront, "gfrmdir " + dirurl, "gfrmdir"); gfront.initial_setup(); } else { System.out.println(ret); } } else if (ae.getSource() == gfmkdir) { String mkdirname = JOptionPane.showInputDialog("gfmkdir: input directry name"); //System.out.println("$ gfmkdir " + dirurl + mkdirname); gfc.runNomalCommand(gfront, "gfmkdir " + dirurl + mkdirname, "gfmkdir"); gfront.initial_setup(); } } private void actionPoint(MouseEvent e) { if (e.getSource() == jt) { int selRow = jt.getRowForLocation(e.getX(), e.getY()); if (selRow == jt.getMinSelectionRow()) { System.out.println("tree sel OK"); if (jt.getSelectionPath() == null) { return; } System.out.println(e.getX() + ", " + e.getY()); jpop.show(jt, e.getX(), e.getY()); } } } public void mouseClicked(MouseEvent e) { if (e.isPopupTrigger()) { System.out.println("Popup"); } //System.out.println("mouse click"); } public void mousePressed(MouseEvent e) { if (e.isPopupTrigger()) { // Linux System.out.println("Popup2"); actionPoint(e); } //System.out.println("mouse press"); } public void mouseReleased(MouseEvent e) { if (e.isPopupTrigger()) { // Windows System.out.println("Popup3"); actionPoint(e); } //System.out.println("mouse release"); } public void mouseEntered(MouseEvent e) { //System.out.println("mouse enter"); } public void mouseExited(MouseEvent e) { //System.out.println("mouse exit"); } } gfarm-2.4.1/util/gfront/gfront/src/gfront/GFWHEREParser.java0000644000000000000000000001175011507222727022271 0ustar rootrootpackage gfront; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.HashMap; import java.util.StringTokenizer; /* [hkondo@gfm01 glogger]$ /usr/local/gfarm/bin/gfwhere gfarm:/tatebe/echo i386-intel-linux-aist: gfm02.apgrid.org gfm01.apgrid.org gfm03.apgrid.org gfm04 .apgrid.org gfm17.apgrid.org gfm18.apgrid.org gfm19.apgrid.org [hkondo@gfm01 glogger]$ /usr/local/gfarm/bin/gfwhere gfarm:/tatebe/thput-gfpio i386-intel-linux-aist: gfm02.apgrid.org gfm03.apgrid.org gfm17.apgrid.org gfm18 .apgrid.org gfm01.apgrid.org gfm04.apgrid.org gfm19.apgrid.org [hkondo@gfm01 glogger]$ /usr/local/gfarm/bin/gfwhere gfarm:/tatebe/test.file1 0: gfm01.apgrid.org gfm17.apgrid.org */ public class GFWHEREParser extends Thread { public static final String DEFAULT_GFWHERE = "gfwhere"; public static final String ATTRIB_INDEX = "ATTRIB_INDEX"; public static final String ATTRIB_NODES = "ATTRIB_NODES"; String _gfwhere; // gfwhere command to use. String gfarm_file; // gfarm file to analyze. HashMap[] attribs; // parsed data of gfarm_path; int all_fragment_count = 0; int fragment_count = 0; public GFWHEREParser() { _gfwhere = DEFAULT_GFWHERE; gfarm_file = null; attribs = null; } public String getPATH() { return new String(gfarm_file); } public void setPATH(String p) throws IllegalStateException { if (attribs != null) { // already parsed. throw new IllegalStateException("Already parsed parser."); } gfarm_file = new String(p); } public void setCommand(String cmd) throws IllegalStateException { if (attribs != null) { // already parsed. throw new IllegalStateException("Already parsed parser."); } _gfwhere = new String(cmd); } protected CommandOutput _spawn_gfwhere_and_capture_output() { Runtime r = Runtime.getRuntime(); String[] cmds = { _gfwhere, gfarm_file }; Process p = null; try { p = r.exec(cmds); } catch (IOException ioe) { // cannot spawn gfwhere. return null; } int ret = -1; ArrayList l = new ArrayList(); try { InputStream is = p.getInputStream(); BufferedReader br = new BufferedReader(new InputStreamReader(is)); while (true) { String ln = br.readLine(); if (ln == null) { // End of stream. break; } l.add(ln); } } catch (IOException ioe) { // End of stream, pass through. } try { ret = p.waitFor(); } catch (InterruptedException ie) { // Interrupted waiting, but nothing to do... } int sz = l.size(); CommandOutput out = new CommandOutput(sz, ret); out.output = (String[]) (l.toArray(out.output)); return out; } protected HashMap _chop_and_eat(String s) { HashMap nm = new HashMap(); StringTokenizer st = new StringTokenizer(s, " "); // try extract file attributes. if (st.hasMoreTokens() == false) { // Invalid output, no tokens. return null; } String str_idx = (String) (st.nextToken()); str_idx = str_idx.substring(0, str_idx.length() - 1); nm.put(ATTRIB_INDEX, str_idx); if (st.hasMoreTokens() == false) { // No filesystem node is. return null; } ArrayList node_list = new ArrayList(); while (st.hasMoreTokens()) { String n = (String) (st.nextToken()); node_list.add(n); all_fragment_count++; } nm.put(ATTRIB_NODES, node_list); return nm; } boolean retval; // public boolean parse() throws IllegalStateException { public void run() throws IllegalStateException { retval = false; if (attribs != null) { // already parsed. throw new IllegalStateException("Already parsed parser."); } if (gfarm_file == null) { throw new IllegalStateException("No path is set."); } CommandOutput o = _spawn_gfwhere_and_capture_output(); if (o == null) { // spawning gfwhere is failed. //return false; retval = false; return; } if (o.retcode != 0) { // failure. //return false; retval = false; return; } // success. int sz = o.output.length; attribs = new HashMap[sz]; for (int i = 0; i < sz; i++) { HashMap nm = _chop_and_eat(o.output[i]); if (nm == null) { // Invalid format in output. //return false; } attribs[i] = nm; } fragment_count = sz; //return true; retval = true; return; } public int getFragmentCount() { return fragment_count; } public int getAllFragmentCount() { return all_fragment_count; } public int getSize() { if (attribs == null) { // not parsed. return -1; } return attribs.length; } public ArrayList getNodeList(int i) { if (attribs == null) { // not parsed. return null; } return (ArrayList) (attribs[i].get(ATTRIB_NODES)); } public String getARCH(int i) { if (attribs == null) { // not parsed. return null; } return (String) (attribs[i].get(ATTRIB_INDEX)); } public int getFragmentIndex(int i) throws NumberFormatException { if (attribs == null) { // not parsed. throw new NumberFormatException("Not parsed."); } return Integer.parseInt((String) (attribs[i].get(ATTRIB_INDEX))); } } gfarm-2.4.1/util/gfront/gfront/src/gfront/GFAction.java0000644000000000000000000000044711507222727021460 0ustar rootrootpackage gfront; import java.awt.event.ActionEvent; import javax.swing.AbstractAction; public class GFAction extends AbstractAction { GFront gf; public GFAction(String name, GFront gf) { super(name); this.gf = gf; } public void actionPerformed(ActionEvent a) { // Nothing to do. } } gfarm-2.4.1/util/gfront/gfront/src/gfront/RightClickTable.java0000644000000000000000000002300011507222727023007 0ustar rootrootpackage gfront; import java.awt.Toolkit; import java.awt.event.*; import java.awt.event.ActionListener; import java.io.BufferedInputStream; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import javax.swing.JFileChooser; import javax.swing.JMenuItem; import javax.swing.JOptionPane; import javax.swing.JPopupMenu; import javax.swing.JTable; import javax.swing.ProgressMonitor; import javax.swing.Timer; public class RightClickTable implements MouseListener, ActionListener { public JPopupMenu jpop; JMenuItem gfrun, gfrm, gfexport, gfexport_view, gfrep; JTable jt; GFront gfront; private ExportTask task; private ProgressMonitor progressMonitor; private Timer timer; RightClickTable(JTable _jt, GFront _gfront) { jpop = new JPopupMenu(); gfrun = new JMenuItem("gfrun"); gfrun.addActionListener(this); jpop.add(gfrun); gfrm = new JMenuItem("gfrm"); gfrm.addActionListener(this); jpop.add(gfrm); gfexport = new JMenuItem("gfexport"); gfexport.addActionListener(this); jpop.add(gfexport); gfexport_view = new JMenuItem("gfexport viewer"); gfexport_view.addActionListener(this); jpop.add(gfexport_view); gfrep = new JMenuItem("* gfrep"); gfrep.addActionListener(this); jpop.add(gfrep); jt = _jt; gfront = _gfront; } public void actionPerformed(ActionEvent ae) { GFrontCommon gfc = new GFrontCommon(); int row = jt.getSelectedRow(); if (row < 0) { // Not selected. return; } String name = (String) (jt.getValueAt(row, 0)); String url = gfront.savedSelectedDirname + name; //System.out.println(url); // check file size long filesize; try { //filesize = new Long((String) jt.getValueAt(row, 1)).longValue(); filesize = Long.parseLong((String) jt.getValueAt(row, 1)); } catch (Exception e) { //e.printStackTrace(); // gfls error JOptionPane.showMessageDialog( null, "cannot get file size", "error", JOptionPane.ERROR_MESSAGE); //filesize = 777777; return; } if (ae.getSource() == gfrun) { String commandLine = JOptionPane.showInputDialog( gfront, "gfrun (for the output of strings)", "gfarm:CMD " + url); if(commandLine != null){ gfc.runNomalCommand(gfront, "gfrun " + commandLine, "gfrun"); } } else if (ae.getSource() == gfrm) { Object[] options = { "OK", "CANCEL" }; int ret = JOptionPane.showOptionDialog( null, "remove " + url + " ?", "gfrm", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE, null, options, options[0]); if (ret == 0) { // OK System.out.println("$ gfrm " + url); gfc.runNomalCommand(gfront, "gfrm " + url, "gfrm"); // update gfront._update_table(gfront.savedSelectedDirname); } else { // cancel // do nothing System.out.println(ret); } } else if (ae.getSource() == gfexport) { JFileChooser chooser = new JFileChooser(); int returnVal = chooser.showSaveDialog(gfront); if (returnVal == JFileChooser.APPROVE_OPTION) { File outf = chooser.getSelectedFile(); String to = outf.getName(); System.out.println("*** $ gfexport " + url + " > " + to); if (outf.exists()) { Object[] options = { "OK", "CANCEL" }; int ret = JOptionPane.showOptionDialog( null, "\"" + to + "\" exists. overwrite?", "gfexport", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE, null, options, options[0]); if (ret != 0) { // ! cancel return; } } run_gfexport(filesize, url, outf); } } else if (ae.getSource() == gfexport_view) { run_gfexport(filesize, url, null); } else if (ae.getSource() == gfrep) { /* gfrep -H hostfile gfarm-URL ˆêŽžƒtƒ@ƒCƒ‹ì‚ç‚È‚¯‚ê‚΂Ȃç‚È‚¢ gfrep -D domainname gfarm-URL ‚Å‚«‚é ‰E‰º ƒm[ƒh–¼‘I‘ð‚·‚é‚Æ -s ƒIƒvƒVƒ‡ƒ“‚à”½‰f gfrep -I fragment-index [ -s src-node ] -d dest-node gfarm-URL */ } } private void run_gfexport(long filesize, String url, File outf) { //filesize = 1000; int setmax; boolean isLong; if (filesize > Integer.MAX_VALUE) { setmax = (int) ((filesize >> 32) & 0x00000000FFFFFFFF); isLong = true; } else { setmax = (int) filesize; isLong = false; } progressMonitor = new ProgressMonitor(gfront, "gfexport", "", 0, setmax); progressMonitor.setProgress(0); progressMonitor.setMillisToDecideToPopup(200); progressMonitor.setNote("0 / 0"); task = new ExportTask(url, outf, filesize, isLong); task.start(); timer = new Timer(1000, new ExportTimerListener()); timer.start(); } // exec gfexport class ExportTask extends Thread { String from; File to; long now; long maxsize; boolean isLong; public boolean isError; public String errorString; private boolean stopFlag; private StringBuffer str; private int maxview = 2048; ExportTask(String _from, File _to, long max, boolean _isLong) { from = _from; to = _to; maxsize = max; isLong = _isLong; if (to == null) { str = new StringBuffer(); } else { str = null; } } String getMessage() { String msg = "copy: " + now + " / " + maxsize; System.out.println(msg); return msg; } /* public void run() { now = 0; while (now < maxsize) { // test code try { Thread.sleep(1000); } catch (InterruptedException e) { e.printStackTrace(); } now += Math.random() * maxsize / 10; } } */ public void run() { now = 0; stopFlag = false; isError = false; Runtime r = Runtime.getRuntime(); String[] cmds = { "gfexport", from }; Process p = null; try { p = r.exec(cmds); } catch (IOException ioe) { isError = true; errorString = "gfexport is not found"; return; } FileOutputStream fo = null; if (to != null) { // file output try { fo = new FileOutputStream(to); } catch (FileNotFoundException e) { isError = true; errorString = "file open error: " + to; return; } } BufferedInputStream is = new BufferedInputStream(p.getInputStream()); int len; byte[] b = new byte[1024]; try { while ((len = is.read(b)) != -1 && stopFlag != true) { if (to != null) { fo.write(b, 0, len); } else { str.append(new String(b, 0, len)); if (str.length() > maxview) { str.append( System.getProperty("line.separator") + System.getProperty("line.separator") + "[print first " + maxview + " bytes]"); break; } } now += len; } } catch (IOException ioe) { // do nothing } if (now > maxsize) { isError = true; errorString = "output file is bigger than input gfarm file"; } if (now < maxsize) { isError = true; errorString = "output file is not enough"; BufferedInputStream es = new BufferedInputStream(p.getErrorStream()); try { len = es.read(b); } catch (IOException e1) { len = -1; } if (len > 0) { errorString = new String(b, 0, len); } } if (stopFlag == true) { System.out.println("Interrupt!"); } try { p.waitFor(); } catch (InterruptedException ie) { // Interrupted waiting, but nothing to do... } stopFlag = true; } int getCurrent() { if (isLong) { return (int) ((now >> 32) & 0x00000000FFFFFFFF); } else { return (int) now; } } // stop void end() { if (progressMonitor.isCanceled()) { stopFlag = true; to.delete(); } else if (isError) { stopFlag = true; } } String viewString() { if (str != null) { return str.toString(); } else { return null; } } boolean isDone() { if (stopFlag != true && now < maxsize) { return false; } else { return true; } } } class ExportTimerListener implements ActionListener { public void actionPerformed(ActionEvent evt) { if (progressMonitor.isCanceled() || task.isDone() || task.isError) { task.end(); progressMonitor.close(); Toolkit.getDefaultToolkit().beep(); timer.stop(); String st = task.viewString(); if (st != null && st.length() > 0) { GFrontCommon gfc = new GFrontCommon(); gfc.showTextArea(gfront, "gfexport viewer", st, 30, 60); } else if (task.isError) { JOptionPane.showMessageDialog( null, task.errorString, "error", JOptionPane.WARNING_MESSAGE); } else if (task.isDone()) { JOptionPane.showMessageDialog( null, "done", "gfexport", JOptionPane.INFORMATION_MESSAGE); } else { JOptionPane.showMessageDialog( null, "canceled", "gfexport", JOptionPane.WARNING_MESSAGE); } } else { progressMonitor.setNote(task.getMessage()); progressMonitor.setProgress(task.getCurrent()); } } } private void actionPoint(MouseEvent e) { System.out.println(e.getX() + ", " + e.getY()); jpop.show(jt, e.getX(), e.getY()); } public void mouseClicked(MouseEvent e) { if (e.isPopupTrigger()) { System.out.println("Popup"); } //System.out.println("mouse click"); } public void mousePressed(MouseEvent e) { if (e.isPopupTrigger()) { // Linux System.out.println("Popup2"); actionPoint(e); } //System.out.println("mouse press"); } public void mouseReleased(MouseEvent e) { if (e.isPopupTrigger()) { // Windows System.out.println("Popup3"); actionPoint(e); } //System.out.println("mouse release"); } public void mouseEntered(MouseEvent e) { //System.out.println("mouse enter"); } public void mouseExited(MouseEvent e) { //System.out.println("mouse exit"); } } gfarm-2.4.1/util/gfront/gfront/Makefile0000644000000000000000000000115511507222727016532 0ustar rootroottop_builddir = ../.. top_srcdir = $(top_builddir) srcdir = . javadir = $(prefix)/share/java include $(top_srcdir)/makes/var.mk # NOTE: We use current directory instead of $(srcdir) for the script # to be installed, because the script will be generated by configure. SCRIPTS= gfront JAR= gfront.jar include $(top_srcdir)/makes/script.mk install: @$(MKDIR_P) $(DESTDIR)$(javadir) @for i in -- $(JAR); do \ case $$i in --) continue;; esac; \ echo \ $(INSTALL_DATA) $(srcdir)/$${i} $(DESTDIR)$(javadir)/$${i}; \ $(INSTALL_DATA) $(srcdir)/$${i} $(DESTDIR)$(javadir)/$${i}; \ done distclean: -rm -f $(SCRIPTS) gfarm-2.4.1/util/gfront/gfront/gfront.mani0000644000000000000000000000003511507222727017233 0ustar rootrootMain-Class: gfront.GFrontApp gfarm-2.4.1/util/gfront/gfront/build.xml0000644000000000000000000000177711507222727016725 0ustar rootroot gfarm-2.4.1/util/gfront/gfront/gfront.jar0000755000000000000000000010347311507222727017100 0ustar rootrootPK qy/ META-INF/PKqy/META-INF/MANIFEST.MFóMÌËLK-.Ñ K-*ÎÌϳR0Ô3àårÌCq,HLÎHUŠ%MõLx¹œ‹RKRSt*ALôŒt“Œ,4‚Kó|3“‹ò‹+‹KRs‹<ó’õ4y¹|3óts‹‹­ÒÓŠòóJôÜÝ@”cA//PKŠõõÅx†PK s„[/gfront/PKqy/*gfront/ChangeLookAndFeel$ClickAction.classuT]SÓ@=KS––H Z>´jZ>‚¨¨ÔÚ™Îpá…§˜.%’N²åC_ý%¾ðÌ ãŒŽÏþÿz´)™ÉÞìÝs÷žs÷n~üúò À8^Ç‘D Ãí81Ä1Ìq‡ã.G:†{¸Çh™Àf9FâÅÇ8ÇCŽI†Öšµhl †®Ò¦±cè¶áTôeéYN%G«rÃòÓ 7K•uÏu¤^Ø €(¹îVÞ)Ï a*¶¼ïÈ !-“"f,Ç’/tíêË©2« JÁ-‘„aJËuÞoÝõ¶E™aP; 0v¥.vm™!sÁ7…ªèÁ#7RÑ…ëU<ÁÃÐyž‚møþ¢+çÝšSžÛ3E5Øá¤èøÒp¤e„{7‡Ø¶¨vÞ4…ï7@FÈžîï’}ÅñkÕªëIQn]Gsƒ¦­•þ—˜Ë4ñQ—7*ZÆJ`I+¨SªV-RÔá­'Ä eêÑšQfÃt+“`èD ]XjÌp¤.%_7‚'ð÷ —æ}ôu‹æ²‰ìg°ìÈ1Z²£Çˆ†P"G€3à¶’]Ê!r åÉ…¨ô¶Ñ«,»å±Ägû¿¢}ñï|ìêw\›V"SÑT´ÿ:û”Ttò£ìà÷ÏC(´)GÑÐv„I8qæ¡íF[Hd‚Æ8Ùý_t(PKÉíä7—‘PKqy/gfront/ChangeLookAndFeel.classTYSÓP=—"±!Z@VÁÍ6ã¾UP¬¢Å²( ¢O‘Œ¦‰Ó—w‰/>ëHad†gÇàÏQÏmÚÚvŠCf’{¿{Ïwܟ¿¿ï8ƒ=SщqùSpFE3ÆÂ4 9;«âÎKó‚œ]”³K .«8†+*4\UpM×UD+7ägBÁd7qKÅn+H ´&{õõÔªo{®€–r]+—tÌ|ÞÊ „sM /ýÊ|k¾7òïlwÝH{Þë)73mYNB@!Âv×<w"U{). DŸ×ø>IÍš®¹nå†ëd ¯zÙ7žcç}Ž¢—±áÛŽ±d­ú^Ž€–¶kû“Œ*[hNzK '`Íw¾‘” ®åú‰"@™’™ÉT6˜/ÍYËÝHùVVàh´&¾™òN@5mÖ¤»”„ᘄ,ú9"¹¯aCF1$ÐV®†“8¥á.¦ÜÓp) Gѯa4 à„@WÃ5¤1+©ç†××ržË´^ò`«ªbÃU=Ó08,hxˆGòÌEÞ½\<ÖðK –5<•§´ýËmþÅ+F/0²¯ž±¬%‰¦ë)±gu VX¯[~•@4ö…õžró¾é8V¦j‹òÔ£±ýëK!Ïœ™¥d:KçÕ4´.J›) :ÿˆÀÛˆ¦÷*n¢1A;Ë4+Mu[®,Â`•l­·T¦Q‹(:êµÝh±¦‹òEu‡¼ v³+ÀÛž±À|f™Y:i°Ì2½‘–ãâï”^G!¾”.äCáGЛ߾ü@¥rÖÅQp ë[zM_<ƒ)AFHÖı¾ƒæ•-ØD‹þ -ñ”å²Ëh…µŸ’5¢oãà&É·¡n¢5 œ®pw(¹Õ:2ÞAˆ•03 ¹™ãdhb€°ÖÝO¸´mEÎÎph ‡çÆwYÑËKm[h/ #>^À‘åMâóŸo:â%Þ;ÌK–éê:™R(MþxÀú+ºâe®º«ÌC4‹Œ¿Ê‘öñÛÁ,",}/#=Æ»ý8ÂPKU,ÇPKqy/gfront/CommandOutput.class]ÁJÃPEÏ4mž­O­mu£îÚ,Ì(nº ]ݸŠM )öE«ø[.Š èøQâ4¸fî0Ü{gæëûý¸à¸GȡߥÃá¶ CÃH«µZ{axw³LŸÓø1uE|ëëÒ—‚©s¿¨²\DÊìE%W¥+ýµÐ'Éd.´§Ê°XŽ„þ‹aÇÒ¥'ŒŠ‡ºr>žV«Uê²Ùïê?šÙý2_è(Oæœë¡¡>hª ÛPŸwMËžâ¾vg´î zC¢“Z‚ètCûµÑðPKTÀ&ÒØPKqy/gfront/DirectoryTreeNode.classM±NÃ0†;nB“Ph‘%yÔ…v&ÄÐz©Œ¢9.”wê‚Bbàx(Ä%Êâ;ÿ÷ýÿÙŸ_ïޱBa« Ûúѵ©&Ëû¼´4SÿÄÆ¼áÑ•€:-gĪ©ÎHgÊPT‘[ÛÔpZ£á:*F€ø{óÌ–…KÇÆÒ­+íÓ¥%ºhRïôƒ^¦Õ£)æ©c9S¦¹;_8}“Ó/‰~³â?ð®:”;Å=ïà³Ë·]Hî€0yƒH¼WÈg áCD-ÓãZ3Ò[µ³›ílÀ~ÉÕOöÿy{Þ~ëí$/?v|PKkÚsöWPKqy/gfront/FileTableModel.classu’QOÓPÇÿ—nkW¯ æ@çAl7õÁŒ/S#Ý1$†jÌËy}‘(ô¾IžŒ3²ÉÊ9RŸã†[ÈðGº¡ÙÌ*|"ûm,ÑzL«Iëhý2YãéÃ/ÐO‘¢ˆuŠÎ¦×0c`xyUÅ£«*òCp ®+ÀcÀ­í³Ñô3©[Ùõõ7C6[¹;Ûûípë+çHþŒ‡M ©¸æ/PKw ì:ÿœPKqy/gfront/ReadOnlyTableModel.class;õo×>=.fNv.vnF6›Ì¼Ì;Ff Í0Fçü”TF¾ÌbçÔœה̒Ĥ «†§§f +#ƒdzZQ~^‰~PjbŠ^NeH/Pc#ƒrVbYb…~qyf^º>X³¾KjZbiN Bƒ"Ð ÀÄÀ2H²y‚@šH³jmg`ÜVÀÈÀÎÀ•æÒ mLÌkÀr PKrœcÉ®ÔPKqy/gfront/FragmentEditor$1.classu‘ÛJÃ@†ÿí!1qÕZ{ÖSµB[ÁèuÅ›¢ T•ÞJÚ¦mJÜB²õðXBUðÂð¡ÄÙXÑJ ìNfòýÿ0“÷×7»Ø6¡cÑ€†¤%¤Ô•6‘AVÇ²Ž¼ŽMöÜ ¸Ç­w;þ@HëØ·»7ŽGmWü*ƒqù dÏ‘n‹ðW¸ò!Wú‡/7bµAÛaˆúCAw©ÜààHp0u¬r¬ac›[(R÷©fÅ}0ð!¿æÙAà ‰¾}k[ž-ºÖy³ï´$Cò§t1ÂnzÔ>=Õ“aF6½ëRu%¼·‚;—¤§WJHÇÕWê”ÿ;cœÑp^uÜtRKæ#C€¡Pšp— °~9”´þ©è$Õz(ÎB=:s”ÏÓ[†rU1+/`•'DCŠa‰1³F­ ÉÊ‘¢_!öŒø7›Sµ0Ç'PKÛ¥UW)PKqy/gfront/FragmentEditor.class…Vùw×þKiô ¶a!˜!Û¨!DmE’Æ(Û‘ ±Á©É⌭AŒ‘gÔÑÈ6d)iÉÚ´ m ;Yœ­mœÀ˜ÄÙº%çäè9ýòKþ€¦÷ÎH¶,6£û–»}ï{÷½7ßýï³/l÷2ö)p—‚[YÜ‚‰Aû„p€CÜ»›Å/Y ³8Èâž(îÅ}2îW°#lú÷4Ö*CŽ{:Ï’‘W°ÆOq8 ƒÛqGl€©ÀB‘g~%ÃV°‰Í6¡ÄÂaQÂÿåx4)c*Bí4Ž2úc,äáC,Vð~F§ËxTÁvüFÆoìÀ <ÆšÇe<ÁæOÊxJA¦Œ§e<#ãY'%„ÑÂÈ![ËKX•×&µédiÊ0óÉÞýÚhAß)!ÈÚ’„õÙü!Û2änOè¦ãôY9½@V 㥢„ØÒƒc¶U(ìÓL޳fdÌÖ5G1õ©‡}G&ØYÂ5ñ­WŒÈPGBèÃ4œÛ(W|ë1©Êzæ°fæõœ„­ñ%¹õIŠ’Ì%gP/ècŽa™]<µ“]W•t§¿\(,ÉF ÊÅ” ú±’Štl èùÅ.‹R ½»±G`2Z.æ’m~'p;:~çþÀâ,žÇ §ð'x§‰­ËÉAÎÜ.—ð²À+xUÆk¯ã ³xSà-œ¡%x Цœä.ËÎévV;j•·ñ-4Càu[`ïRªºUuå Dz·Ü(ÊGô˜¦ng Z©¤—8ù{2Þø ô¡—¸¬xïÙ}ww×@×>Í.qä¿`¯À_™“¿á#Y|,aã"©=œß.=×5=¦y>Á9ópæ˜ LͧøL`ŸËøBàKÖ}…¯%4y±ÊŽQHÑöZ6cû»„æ¥9òº§x—úâ_®]4é/OŒêön˞МÿÆ7—¥e;q{IMýžónQq7/ðÓY,f,³äH¸á*•Êh—к´ª½c“¬9\•QªæÁÃÖÔÛ sˆäÉÕ•ÉnË6ŽQ~­5L½ä×>+†tÛ1Ʀ›xºš¿Ï;oxGjÎ×ihQ›éÄÖâZ‚¾zl7^ÙBÂZ-—»ÌºÛ¯zš«¶k*–ë=cM-³zÔ£„~ÈÐ§Š–MÄÇêp÷VU·‘,wicGò¶U6‰È–Šm%hÁ²wVŽÕEÞä\Zê¼2^ïË`–S oóºu-ÇˬçÑßßÞʹ’bSŒò„éOqV šõ5]Í5Ùü¹>ÍÔòrˆæ…û±Ž¢š{nïè81ëy¬‹×ßÇ~‰ûÊZÀƒ,Ð)4ƒË(j˜“Ö=Kר½¸-^ü²izO ‘ ý¾ÎýÝô¼””RgÁ˜Ô½ëý U߸e˜\„½l²u‡î{ ©d®Hã˜oÚC´.”!ö+»Ñ5­•ÿbo"‡êJzÌœ>íw_ýT\MT4™]¼X:m[;ÊÞ„KLS”’#B ûêÞŽNcñšÈd\)cO·:Þsi§°¦£Ö\x>„¿s ÓÍU쵯Zé{ãV,ÃmøèÛ‚^ïƒ)¯¥‡„dÞÛE÷}7V“=]þPæ! ÏaÙ‰<[‰¹ŠÍiÈ 8™˜CCâçLÌ#4œ8‡àäóS/Üà"Rin.¢•±àÖEcâS,_ò]Á¾á94G3õš]´ø&+]¬ò{j–m.V“ý¶ÖE,Ás-ë\¬Ÿõ`¶âNd+0éÏ0¥ÙÊ úVÐJ|°J%ðÙDáŸÇ†aZÎ5°±jÞ½¾¹tŠHZNíѶoii.®Ç&BÐÚ×Nx6·»¸Žþ[N£±}®wqÃÌ?Ì Ðß~[ÏT<.ðØE"ÒÁ`*ÔMÉjÈE[ÒÞ «a5p“í*-¶#ñÚmiE r1ÅEò,v¨¡TÔëH…Ô*¿Y•S¡†”P£¹³XÑÑò7žÒÌßÏcûpL™ÃMé`,Ø0Ãjd7»HuÄ‚.~z"LVOÍàx:Üð`DÔðÚÕˆ‹Ÿ§¯Ý–Žz0¢ 0„׿F£ÚHcQ£qF´ ƒWPÍ!õs‰oÒ¼;i.ª€YÚ­uh£Ïù8à?ø/~æmÑÉÒm¨|=§ýæÿPKç¬E~ý PKqy/gfront/GFAppConst.class•”mOÚP†ï#ÇÍùRN7÷æTtZtνé¶tZX „"ÙR :,„Ö²oK¶°_²_±ìA9ˆ3Ø/ç\Ï}ŸöÜÏIÏï¿?~ñ1Œ-™#ʱͱÃñ‚cw cxÆ^¯æÔ˜’M˜…¤j*†šÉ©™BZϘ Lc¸sXw=ßrýœUkÙ`9Â0×]b¤’類LfSš™g'Ö™­Yn5jøMÇ­îs¼f˜ÄU“ã ÃbïÃÚ§tFiDžϺa¦”¤z¥˜Ð•£‚’‹‹[î‰Z¬`ÿOɲ4¨i]O²†W¯Ñ•œ¢%¦t†™/ƒyfg/ÇÛKJ7Ç»þ·w²pì–3T>èO)¦àx¥xãÃTWÔR&µ’  üaग़ã:>Y‘õCð°^¶É9Äwîùö©LCÊ:%φíúv³Ñt<Û“[¥²uæxrÍ2­bͦQuýæ9‰ºUfXuÚæŠU"¯SéxœJÇãTô–¯—|Û÷V®5jn×·uÕ×ËÞ×Î št–Ð$ëÙ´yh¿rf9µq,â>DµÒ¬»~4S‹_¢¯7zñÄ.Q)ÔhkN‰´hËkF‹ŽõÜÓFÕnÛûû&ï0lß¹¶=2\ïä=†µ¡º×vFoÔ¿ö6¶oÖAy'Äè¾¹E÷Ñ4pã k…hÄ“˜êq[—ž!žx„ø®Àâ9ƒÄóß8D¼ p˜ˆŽ—æ x Ô—ˆ üˆø±ÀOˆŸ ¼LüLàâU׈#Bîušqlà9›TÙ¥·Ÿµ©ÐO°|@1òA)`äG¥ ‘I£F>,…Œ<—ÂÆwðofüPK4´óŠåPKqy/gfront/FragmentTableModel.classmTßOÓPþ.ëÖR c“¡8À©·¡›¿(NHH`$·Oe»%]kÚÎŒ?Ež|óu¢Ѩ&þQÆs×-̱4iï9çûÎ9÷;÷öÏßo?d‘W1‡«2R2Ò*†QÀ¼Š® c×edäÜPɺ)\·ÜÆaÜUpO|ï+x à¡ŒG24Ã]iòrÃÓ·MÎÀ¶&ʦîºÉ]ýž4u«–,zŽaÕ"ë—¾\^`ˆ?\ܳ¼îåÄB£¾ÍÍí]^öB‹†exK Túƒ”·+ÔÄh{yÛlÔ­v†ñÔZz@í—{½ÍK©-‘%äWc˜MõüM,œÎ#cQÃcÌ2$úBÛ[µVe¥Yæo=öfN » zΫ>ÈqlGÞh˜ÆSñšÑ0s cý]0׬ o2„W “»{®Çë‰m^Ã2ži8É-+hYŸ¦!‰Y ñ¾ ¯²†©>WdmÙ)ï­©4Y«:¶ååV½Vç–÷Rˆ·AµÍ“Ø ®W6-s¯7îS‡A®ÚNA¯SN•&¶Á]W¯q1­ôiÝbƒ¦Aãw»Ó^«P;FÕà%ŸH½éÁû{!<t†ct!$zH]Z)B.0\ÚVü?kªÇ’hEc¡÷E²RÒ ˜Ê!” |…œ þ€R D‡‹%)ªqæS›GG—:¬ ]½!ú¾Žï#‘ùù=& ýF8:rŒÑÒgh"O« Ø€°Œù€pn "¼Qßi{#­NÅ˸ҩ˜¦>EÅéLœzŒKë6z¶¯QEœ Úý-š9k­G 4éÁ_ímK´¾4øPK"ü,q†hPKqy/gfront/GFAction.classmÏJQÆ¿3NN꘺ˆ M-Ò¤ûF bm\û[Þ&ô\/Úkµ¡EÐCEߌÚ"ZÜóçžïwþ|}|¸F§Žq 4#Eh ‚4´&iârëÕý]á‚êMf3+¸¸œ¼è•VsmSõè]fÓÁuw*Gṵ̀‘~öYnŒKr·03ÁÙŽ×k¯ÌÊ–’q¡ãUÒ¿}·ÁiÁ¾ªåšcÕðiéì‹Çÿ¬Öâœç…0N{ ÍØ¼xÌ/f|#‡÷9jÆçÌËqxX6^¸ªsoZÏ ÖárEXÁê¦ÊÙ`œü òßãu+ÃëlOPK—Äì!£PKqy/gfront/GFront$AllRefresh.classuSmoA~*ç"ˆ…jµ–ZTJ_¨Öwkk1&$16ú…lakŽ;r·`ú³L*M4ñ£üQÆY®U)xÉÎËæ™™gfö~þúúÀJ&’˜!Ë&®`.F⪶浕ÕbÁÄ5,È™ˆa6ŠëZßÐâ¦æ ,X1°ÊQmËÏ­3$*­¦ç:ªø²¬Õc†XõÀQm©¬:Á6-ÇR[ ©ü)ÜÒ{†©m·!)…¨+ËuÞH¯ézÙ`˜ÏWöE_Å'U”}IQ¥!dGÛÊ‘ÆG  9Öq‹ã668îà.Ç=Üçx€ 9(e†Ùlá´ŠUåYNëy¯Ù”q ØdW³›x±…§ÏtÌž¹’m¿•MOúmó_‡¿rémÛÂ÷¥Ïü[êõÞ¾¬+†¹‰½T,_IG“çõ0â#õÈד³„]ó¥êu‡¨ Ó¾èËFUÚ”Y6^Xž#:4ÂTåt‡ÔA¼Öë6„’5%öl¥óã(3ÚõÜ®ôÔÃÌÉ–ÊžhuˆìNÃR®GÉÒ#…Ë–-ƒÊ鉴ù öªR¿ÑíJ‡–½2 0vlŒˆD•ÜÐ0òã8 ‰½³”-±@¯= †ótRú¹ž†þBd¥‘!9C^†üi³pVXþ‚Ðç!Š^.cj1ÕÂ!B„wµÖçSœÙ ÌH Œ¢ÇÖ,jëbŽ`¦ÎÀÿ`øñÎ[ÖH'èg+€ýPK();’+»PKqy/gfront/GFront.class•9x\ÅÑ3«»{OO뢳Îö¹!c¤“dgSdY¶e$YX²…l@~Ö=IgŸîŽ+.FBBI!§8Šu$'”tz'„Þ“pü3û®ëùõÙ[fggf§í¼½{?¼m?,aîÇÊr¸Ý5ÓxTŇ§Ó¹™¡ãL†xuœÅýlnæh8×€IöÖy:“j çàÆ NÖ1ƒNOÅõ<êbX·† hǬÅÆM/7›¶™›Ó5<À ÄÏÄ>·poòÊV¦ÞÏ£7«x€›A ‡äÉ6 ·Е:†¸Ö‘Œº#:F¹?KØŽq˜,§f‡†; ˆ0þ.îwss¶ç৘ܧyÏgXÍŸÕðsìÂs¹ù<7_àæ<¿Èý—tü2ãžÏ»¾ÂÍlû ¼/6ð«ø5†}Gß`a¿ÉŠû–ߦUZ¸„w)7—±¾Ã(—ëx…Žßåá•~OǫخÖð¯-Ç=ø}.ÅøCü‘Ž{yòcžüDßpþLÇë4¼Þ€kIhü9þ‚Mq772›t¼ÙÀ}8Â'Né8Ê“[t¼UÇÛtÓñvfw³ßÏÍ/5¼Ó€›±RûXÐ_éøkFðnïÑñ7Ðñ·ŒáÝþ΀ý¬©1¼—Qîãæ~Ðð÷Üçêø ÿhÀFš‰bºÖð/þUÃ5|HÇ5|DÃGŒ¦Ph½5³âC²5¶bÍ!3·âz,Iô‚1„Ymƒ±H8Ѹ2³ú‘Øîî˜euDÖ2¡ú¡mÛÌæ®ÆøÎ`x°1Aë+­3J0n;á†Ù9 1ñŠ«hÞmn e1ôh,µb‰ÝùH1spØ 'ZAbÎHD¿Ïæ;­€ïZfF剭¡¾4¯ª" æF(QLn5éxÓ Ú ¾Âd6NFa ›Çc0^nMXÄ2³ /ZYh O‡ÍCfxÐj‹D¶7…«,uèIq+Dе}Q3A¦˜=^™|°NZ$l™ÅVÖ™ ˜Ñ¾¡H<6‡-·ÚÜ"6]‰Q`YÒV3neÆÑH,€­4ßf”å-†–}ìZž¾A+Ñ7 …ØOØü¶>¯Ùœ'ûº­Ûhã²ÚR~0)£‡Q¬)}è’Rµã‰RÍèëYJÃÖN›nß0G3ySMí„îµ])§>Ñ—ué0»ƒ'»VŸÌî3C¡¾tdVö)H4MF3°i6,Þ6TÂûpP»ð¦ÄÇðq /ÁË^%JZÀ'ðIòªÕ«XT ¯Âk áuxMÂð&…÷D>#á¯ð …Q£Ä§ði„ùŸ˜I|FÂCð0³¤r$<æxŽKLáY /À‹¤€qÙWŸ“ð<)ñoø¼Ä¿ã 9b냃C‰æP°;%ƒþ¢Ä—ðe‰¯à«_Ãg|wŒ¬ ØÒâëH¬Þ@R“{|¦eúoIx ž–ø6¾#ñÜü“›á»þ[â{ø>%áqf·ÌSTÁM á1x\âð:àD‰†)Áÿ ÿ’ø_–ôæý!~”·ÑÜÉv%ª·R€@)„@òë R¡„·àm)Ê„C §piB“BåR¢B Éú›^¸5 &ìï‹IRLS¤˜J²ˆJjæ–bꄇΚ•jE$°bmæîH2¡‰éRÌ3ÉM›IVL ¯˜%q2ûõ3ð¬³Å)æâGRÌ#˜8DTSî*n aÌS(PÒJµÝ¾92< SV üI©EŠâPº'ÌØ°¿QŠ…â0òôeR,‡Óîé–]ýV”‚î’dÜŠ-欤‰)j…OŠ:QŸÖH¾$+’]“¢;þê,›±XŠFq„&Ž”b Ÿç(q´Lj¥RËqZ™•»­«ÓŒCÖáqRÏÈ~ø@Še|¾Š¦îîõ­+ú¸“b¹8!êhjo‘âDqkñd)šÈ'Ä |FÍR¬-šX%ÅjQ-Å&·R´Jt¢KеøŽ&NaH›„s~xÑÎIDC,GHuæÊ"…ØÚ­n¨–h`EIìDM·¤Ïç£ó‡âÕQ:é¦ÚŠÅ"±jKÑ!Ö†Ú”°v%»‚Ãѵ’òíªHlؤíUíííÕ@õš5þáa<^½›þ4Ñ)Å©b=«¦KÝRls XÙÔM ð‹)N½éð±(•fM*Å&8˜Û×Õº©aJç,ê’í4ƒaûÊ‚&¨ùùK…pÚ©vNÛÁ›IÙ )‡jîÊ¡V^7­öW¥·H£k3KüB˜+Ìþ탱H’?‡ÜiÜt¼†Ô¾§än;IäožVS¼WIG,”ÒÖXf€ PlaÛ¿ÖæáÏiD›h$‡Ã6ˆ¹²íZK¥“‰RL9±^cq «¾?éëÚÍ™/¸#È•\¤?ó&瀶þjZ7ýøèħ'àÇ>-¥}òUcRLj”‚"V't‡Úža—˜³óÔiÃÚͰ9˜öË2òðì—aI9‹s5‡lî‚öùuæ¡E‡0»ƒ þ$­ŒYÑ]“ÍCÁP f…m§É¿ªjjÇs´ÑÔ¦frB›K†;"Ãfˆ‹[ÊÏÝ‘L ´É¢.Ø%"¥Ôgµ ¬]ë&.~d‰'·ÆÓ̧ó¥XŠL~¹¾;®j¬Îì“Ø¢RÔKQ*SöôØKÁHc'Á9X&?I¹ÌhÔâø©ÿŸèÙ¥ºzwË*°ÐY¾ÓJ0$õDy"C 5%ø*o-ŠË‚Ëœä´ÎJš¡øÅÀ&*»ò¯õüDà®)‘(¹élê^CõWØÕd*5%\ eBýµëê2c|®]šÇ]ÐêíI•e JŽª(OqN®âG¢™ìO$c¹¡…ÿËÓ’-w§z-œ[œÝŠÞ ½.’ ƒýqE)ï†7‚ñœœžšÚÏKö5ÓJ~O£ÃÁ0UêÊ^øhÝÝü±†çÛ»# e¾÷»í×*e eåé%¼6f"H½Ir¶åMbCWöQ4oa|¢€ÏÇc²U¹Ï£ü/¯i¤=žwÓåØJ…·î'†33¡Q„ONoŠ%#³ ¤dðs‹%ýqJÔŽ6º»c&Ë0+_»]Ün ÁD‹ Š`xGd»ÕFôb¹[^‘\Ÿ «‚"{f>Ý”Ú9zUÁ¾_œÅ²~ᲟKzÃø'D;k¯ ÆâÊ™vñ-T";fsL{l¹*{k·ˆZp hñÏ•ä)MEeØ‚qµpÓøâ눗”zȯnWÇ]%3!6\…g¿%gMHo㸠Ùþa¡£e0îƒûÁ ÀïáðGøxøíøï!xXõÀ£ª Wýð¤êŸ‚§Uÿ <«zú,VýóðwÕ¿/ªþ%xYõ¯¤é¾ ¯©þõtÿ¼©ú·àmÕ¿ÿ VðãšêßUëÈ#ªOõShô>¤ö?„Ô Ô¯ñúÄ_¥8þ¥ Ì‡#ààÆI‹.Ÿ+šÏ­@¹ÏmŒ@…¯òК¾1˜Ô; “G`ŠoLqOMA%Áܽ<…i#PES¡L4œÙKä¼#0‹Æ³«jæŒÀ\Íõ¥`^º?d ª{Õxæ·ñ . ¨ŸU·MÁÂ18Œˆ.j¯w¤àp^¯OA Ѭå]3FÁ7u4ª+KA}ºoàžÐ§çܧàß­p¤€1XÂ[ëˆáQµÔ©ø{œ{àÄËýé|Ưñè³<Ò½9Î禮o: Xë^2Ae—4{®’ä.öÞÏsÌ/|ÄRÚFõO‰3IE>ÁÒ†@‘]:‚ävP¿¶ž×NB~‘ÎßA²}érpÜèkðèË)8Ÿ,ÒcïžeèHïÞIçԨߞöí¯• Ú}õ”"x_GCÃ~G` Qd3¥àBòSÖýù씘¾×A‰„t\Dо<œY.öy]#p;p ¾J“|­‡Lèþ:ÌÂÁO½Ye pÙÊV&n¯gwˆõÔ•-IŸEY“ÝdªbRYÏÂÄzêyëq,uzœuû÷À’:³pK1»ÓHo9ÏIj€Ž¿!-ކº-® +€Ž‹3¶o¯'­œíË8à7ˆ@]ÆÿΠpùf:ç X躾Åb–¹¿Ýåu8ܵNjXŠKöÂíõì2Ÿ—öº/» ¾3 —û·À~WÙRÍ£y{(Ýy4Û‹t)/*?O#iŸËâ$Kሥ†W·íjhgøw^A!P‘‚+ýÒëòÊ|Ï_± šÑøjå¥a™·¼Ë+¼éÚDcÚDRÎ%Š÷¾Êòcp-ëcÏ-ðýqyLÅÒ=tE>W¥}¬•µ/NÁ ìcÃÒ&ÊK{mÛý8?qÿÔÿŒÇ×íÉz©éc4[p ÎO_{mudî-½eîë»zîŸwõ:Ý¿èJÁ u¶G-à=óÂsá»'M´äàßšÒK@µTN.v#ý¿)ƒ2eâÝS³KI\Žì7H/7“¼ûF`³$4E÷ÇH¯{tnéâ©CMoÍLjzOË–ÁX¯ûöQ¸£} ö³ü²£žìt'#Î^B>}W=LÁ¯î¯ —ã` îfô{²¸l¾»z6Åß0–ÓK¬0ÖosXNÆrò½;+Cøw\¬¨\ËŠõ™|EñØã¢å{{T"}>sQý…ÚYäw¨¤û3ͯûïn»û?PKj!K-û1'PKqy/gfront/GFrontConst.class]“ÙrÓ0†š4qJ÷–B€BÙÊÞ°oes¥ˆÚŽÇY¦wÓšLJêtR·Ã³qÁðP ¿âL|â+éûuΑÎ/éï¿ßˆh‹¬<}ÈÓGAyÓuÓ–‚–­#ÿÜ/õü°SªGƒnØÙ4W‘F-¿wôIÐbÛ2w¤Õ¶¥ÓlW•% úœReE5 ú"h…«uW–•idb³Ñ‚jH»­l·æ!a'¥ËýX/'出']T©¤¢=i×Z8 ZYÔwU½!=ƒª‚–øŠ½WQw-L$4ƒ¾¦ªÛ®êJÐÚ„.f]z-]ÿ› âD_¶uL«]ÁÑ Úƒª²Ÿ'H¨ ®ƒø‚öN‹MÅ‘uZŸ4?Ö˵¦3ŒÎ ­2?¹;9Úfì!ˆÝƒAL‰}Óå³£MÛ´:-h6 o:ZËñ¢±iZÎã-$òØ3½dÀÑäèÜ2½Zà;ÛÁít~ úaTÚ­êaøLáXò„kß‚H¹8@P¶Úíäa”±6ñrêø¤?ÐQòW<)xÁI¯{àGÍyÁqÿà :ÝÓ(š¶v1f¼³¿n g3vùõ`p®ƒfUˆàÐïUPŽšÂ¡×©HÊ‚¦õ=Rœgl€ ŒgÀÏ‚çσ/‚—/ƒW¯‚/2^_b|\d|t•ñ5ð:ãëàŒ7À7éÖ˜oƒï0¾ Þd||ŸñðÃTþ£TþãTþ“Tþãø)ãgàçŒ_€_2~~Íø ø-ãwà÷Œ·õ×ýPK²ã™ÏMRPKqy/gfront/GFLSParser.class•Vi[W~ÇL2Ã8¸  Ž"bµC¥mpi@ÀØJ6Ú6ÉÑ0I“‰¨Ý«Ý÷½ÚÝ.t¡-¶ú”Gë'}žþ‡þ€þ‰Ús'„$~hxrî}ß{ιçœ{î%ýûÇuMÈIØ‹˜½{0ÌÄ£LÄœ” à”€„ˆ1 8%Á@RDŠ H ÈHX˜Y§ŒK¨Æ U8ËÄ9¶ü8[~BÀ“ <%ài µx¦‚ijŒyNÀy$lDLÀó"^° /2ñ/‹ð³ÅWD´‹èq@D—ˆnED¼*à5 -,мÎÄ"‰xS¢,ÞbÛ¼Ífï0ï xOÀûä]þ`8ÚÝ qP‚'µÓZsB3FšCf:nŒ´q¨ìHS3ÌA-‘Õ9,õ‡Ãýö(Ð@¨“l£îþ¾Ã ‹¡À±N+mÔôtFøÃÄ)‹¸ž¾ÞðA+Š#ŶLs‘NA8½~¦áŒŽ '2¤‘a-=Miæ(A3)µDWÏç›5ã‰æƒZf´GKQ®‘átÒ09,ægÍÝ]l`K{âFÜÜGq»‹Ö¶ rà;’1*0¢›‡ý,‘j÷¶r2s 5îÒuæIê<3¤§Ì8Už©w$ÇÆ4#Æ¡.šIi㆕X”˜è–2³i=šÌš©,½†ö´C³ú¬v’Ñ¡ÑdʲÒ5RÝZn÷²%q¦´t†Rs¸·Ë'ŠŸËã@û©¨ÌcàŽ. )GðŒe!ãì—d¢½2ú@­³¢Ø†™å°a$úˆ–™š©Ï׋Ã*"­k±³õV̱ünð¡Œp‘‚nL„e\ÂǪ,oñds ¯ÀCÕB üé´v6Ϙ>‘ñ)>#ÿs6íÙáa=­Çúi7’WçToŠZׯòk,öÏ™øBÆ—q_ÉøgA>†©§ÓÙ”©Ç惑ñ Óª.w¢Ìá·2&p^Æwøžâ>^®ÛV–è\¨—× 'Oé)¥ÁÕ3Ç?ÈøQ“,ÜŸðóÂÕÊ_ÜUÅ;å«!ãLɸ‚º>½Ézvåêã™zjá&Çp\ƯøMÆCxXÆULSxó÷(:lÕ¢Ãï;qR2­NœËÅZèÏf|Lg—[7çAÍ¢gÓT^?£qp»Ë”¨Ðâp:9¤g2m‹¶²IËh«‚Ãå°zn»Å§ÞÆ®aÙ–DÕÂR¾=,VdMŒìVi±XÑÛ/C›uûƵ¸Ù•¤2ñë:Ýóàš{3iõmq¾sNÊpåƒòS娖éI¦u«g¨*†~Æ´…n°»Lèeâ(†KK¥töÐyïü8•tÙ‰f2ÏPúiݲ^bŽ'‡-åŠYJÑÿÆ=ô[Xû°î'´„þTø °›p{öî(À „`/áμƒpWn$Ü]€›,ÀÍ„x;áC¸•$=£`Ÿ =Òcjôž’¬ Ý#è'"´ÅÊ Xë™çQ–LÃáá¦Á3áô4LÃuŲ寀m³šò,„ˆç*øˆS¶Ö Ž’?¦åoy®# çMT΢"¢H3Xú§‡Ù5í“÷þ }y²f±EþŸG±ž½.v¤7á$¸ü;ä ë9È—#á•ÊPÄÉbõp½ Þ–õN@ðñÜÔ’V~+"3Xés6æ ø\³¨ŠÌ¢:¢ºfP3ƒU>ArXíUñ\X¦:U1‡5G'nÿ3§ÏEfj+oMUgëZÉEm¤ÆUC•ZϬÉ@¸Šº6Ü@ý4êTaŠjZ‡ÍØJ· q$h4èwâ8ÖZ™Ñ;™Ï‰k$TIãÆYl¤(ïê™Å¦Hƒ²yw÷ÒÆ[.ÁÉMÑd«÷*n•ÏaÛÑżӫxX\ż˫4¨®R^ð*^–q1/z•F–x1_áUšÔŠR^ò*ͪTÊ/õ*ÛÕ¥Œ÷*;fÑBYÝÃüîT6“`žì™4?#í9Ü[êKö*­ªlùškÉGµêÙI£QÚPÔ ·lb—Eä°;Øp NÇdÃUÜwÑžÔ]ß멽†t9ûÖ×^Æfc×·äàóñ*o0ïëU>tÁÁMÜþ›Ÿ,iñG¡Ù ºŽFv•–32^b_Ÿ´C?![q¥à qµ­ÈM±Éºêܶò¹â?PKƒ_ïtÊ PKqy/gfront/GFWHEREParser.class•Vùsuÿl³É¦Ë–#m•H)åJZ¨EM9,= Ҧؖ–€·É6 &›¸Ù@ññ¾oÁû¬jÑ6eìø‹ñŸpüÑB|o³iÓ²3Ž™Éûî;¿ï}ÞÛ—üñÏ/—lGAÆíˆVâ6ÜÏDõb„Ï“8M¨ /ƼHÊ‘q0IIHKÐe¬DTFY J0dÔ '£&“<«O°ú¤„qfNIxHF®$òK•ð˜„Çe¬GTÂ^<)c#N3yŠÉNái&Ïx±‹Ížõb7ç÷œÏËt¾À±^ä§—Xý²„W¼xUÆN÷5¼.á o XÑÙÕÝ~¸g0º¿{ø@W—_Ïqõ„Ú’RõDË€i$õD›€ªŽŒž3UÝRSyM€Ò>8ØÚ …;»Ž,°á¾Î®Þhbôä˜f¡œUtt4™"FRM 8’Ps¬xKÞL¦Z¨¹±^5K×øÔT*:j¨‰´¦›ÑX&¯›„€åK…C3O¨)Ò%fWROš{¸· ;2q¾-¡™‡ÚÐm[Š’r%ƒÚÆkõIîiY3IÅCæ™tZÕãÖGsYõ¤^*4JÂhLÍšyzÎäÍlžr\M×&FŒn¶Ø~}–†ñŒÆÆ2YËKSÉt‹S޹Œ¼.`%ÕÖmCÒQD„j' ªIÑžJ-Ñ1ɇ”eô&xz’9+ÃPù-톡žbM[Ñ¥½¿Ã'ä_y!=®òdR°ìC‡‚Ntp¨"H ö ¨`/“;ÑN–Fe×^ëä¡TJK¨©S5µùf¸®=ehjüTCV5rZ¼xÛ%¼¥àm¼£à]¼G`Xq’™–P_™oµCÁÎ*8‡÷)rÉg_~t”’Ž÷Ó=š!À?L§R¾šš.ê8ë˜|¨à#Tð1>Qð)h€êË*ÑMÍ0òYS‹Ï'£à3¶ªq𸹂/ð˜‚/ñå}Ì© «®’Rª–¬h7˜y@Ó©ÿT†ÐÀ'|o|Ëé~‡!çñ½‚ð£‚.tÓ^gTs¬!™k ¹ß®àîV0ÉMíÇ€‚ øiQ£ÂùôˆftgŒ´j–½,œ1í&Qw~V0…é…‚í¥sÈêÞ¢yãþ–ʳDý4ÊÉ´µS4sž©]ônÛbÂEÔÆµ˜€ÆFÔÊ=™˜–˵-ºÊÒÞ¡«Êú-àúÒu‹¡ß%G¯‘êUqb,©—+ìIêT„KÇ—l¡¾‘ãZÌlÛJëM:©&MB–ŠÊY/±»1âžÒ¦‘ÌŒ5ÊKë-q9ïç5X5¦æz3†fQÎZ5”V¥®›–ˆ2IizÂ#a.?’³<éUâ4fÖe%}»C¹¹;¥.ÑöYKÞE °Ù 9'ÇU‹ßÇO×ÏïIÇßý~ÞF €Jøq‚ÐF\Dâw•ñâw—ñÍDiå?{퓟uÒz´ÎNû¤·ŽhùÒö$"®‰bt® Ì@¸¦QÁÄð‰Óp„ix˜H¬îÂAÛq5\–£2 o$0Ï *'m«ôRX¶ PtÖ“…ô;ªf!G|Ëf \°_9ÑÅèaúŠä-Ó·ïÿEp/ ò.±3ý n‚øð"ªzÜ¿’“‹b¹""§=Ð+„›š Xž€…ÉŠâ,VFf°*èÞV€/è™Eud5?ÕX;ƒë‚’_*àú ×ïƒgËýn¿·€ÕÃWÿž€;è!7ÿNÑzô» X³“BÔEj=µâ Ö²79HS¨/`Ý4L£Þ/Mœ~¬Ã¬@+âHЙ¤?pn°Š¢…h—ó4q§f±ž²ÜÐ;‹‘&ߦܦ‹7Ÿƒ[˜¤‡-AÑ/ºübb¼€­A±Ù`¶ixÞ¬¼ÐÍgQo¹QÎ~—ˆL¡B¼Ÿfbâê_;f®¥i¸¹ÔåA¢b^¡äÝtžæÙÙvm£æ9[°ÝÐÒÓ4‡JËþBÓn:[ÆÔ_Ú¨ûëiî\{ÖÖ}† –®m-àf.jÜ@i­_8ã&®þ¨ã‘ÙýšI:Œ!¸UtòĺÉÙuÞ.bØQ]QR™W¯±Õ+øê9¸+ÎóÃ¥’aGmÃM ìjÛP˜ä‡5­>²Ö+XY‚ïîù/€åá-yÜ‹ûlÀ[pöØXô hwD|·ÌàÖË‹=/bçùEˆìþPK/dû Œ‰ PKqy/gfront/GFWHEREParser2.class…V‡{gÿuÒ•s\ËqÕ)W,pSä&àx$[1¶× ­z–β­œNF¡$-«ÐR–Ëh(à n±åPÑ$Œ6PFÙJÙ{ü„÷=dɾ>èyô~ß÷~ï^ß=ýßÇ/èÀÜâL5úñ¯•ñ:^_Ïà.oðF7äÍݼ{ïÎJ8çF î‘p¯Œ7»Q‹{Üx ÞÊocðv ÇsŸ„w¸ñNÜ/á ïrã:<è†ïfðžj¼ï“ð~7vàŒŒ9^bð7>ˆ1ã‡%<,á¼»ñ‘jHø¨­8#ác2>îF;>Á`žÁ'Ù¨O1ø´Œ&ûŒŒQ ,ó³2>ç&ã?Ïbe<ÊtÉø¯K2–™>'aEÆ7zØ£/âq yf"ë¾Äë2.ʸÄÛË2¾ÌëW$|U@m_ÿ@ÏÑÁ±Ð¡ñÃý#ý<ƒ'Ô;U_\MF}£†KF»Ôô¦’CMÇÔxV ôŒ†Á¾þ[VÁ#}ý£äPtêô´¦¡;:¥ê‰ÐT,NI5HàdFÀ¦ã-Y#÷V3ÓCjšÔHáTBÕ£DÐPvߣëêì`,c…˜Êt]ÜÎJ‡¦t5šÐ’F(œÊ& B@ÀƵH×ͱdÌ8 ÀÑÜrŒ¤ö¦"l_T3†{Æ“}Í-v $5)44¯¿gIîþ™°–6b.:d4£7•H¨Éˆ€¡LZ=,†&DÈPXMYÚ“Sé,™µ…ÔF§ôTÒðY|GÌÎ@(¹¸cˆÇµ¨5TC+e–ìë‰ëš™m2C),z‡„§\Á×|§dRPéú›ü?Uð3fù¹‚_€B÷Kœ°½Ì礡éz6mh‘2—7ÙÕ%[ð+¿æhÖ­«½¢&®`ÍXꤖ¤:"ƒ„&æ~VÁoPð ~ËQû~¯àø#™œ!J?›ü'TÁ…Ù˜nŠeš¨­:L#¦àÏ\.sÈå_ðWPð7,ùÛî†!àUtª‚H瑲ó^:–÷¤wü;j­ôú˜+=5æJ¹Ò›e®·›ëF’AOA•N‡à Ðݺ¡Õ±Œ*ŽV¸ g«° ©5ybÕËp·.™gÆùNyÔ.`aKèK¨’GÍѺV°qÑ¢¢AEæ3Õn¢ª¢µ‘(¤§P“Gí„çšÔ]bm,¿ zŠþ"±ÖÒ?Zbo%³o_ÏÎjÛH'¹°V‚È£Û2óY8QMkþ}x²ÎêŸ@ÍoÛsØt CB°¶›ƒóü¢°XÕ%Z‘ð;÷ä°ÅïÊÃ;‘Çu^r²q[ý’WÊa›_öÊWàšGócØžÇbiòìÌá^™@»r¸ÞëäÆñù«ÏÌÃéw‘Àv‰æÖKá­ï"á»'\ â šY.1HKh)˜¶Œ¯´H1܆]¸×¢ wã­÷â>ÜOvùNZΞ£“Dël­dLÛPímž=+è’bßCp ‹´y‘_ôН˜Ã‹ÅH~±Ý³—7Ž—ÈÊCà›Ãv“löºÌ¢˜XB•x•ÒüÕçÚ=ûØ—ÇÛ‹@/•Á”Uáu,‹Y…ËÊM/)Î:‹ç-ž›Ì¬çðÒÁ¶+p:Ú–àŸãM+íZ¨DÅ…u…Dï™çâ‘X…ø«ªö;8ºDG—³ÁÉÈ‹ Ækƒ³ÓÓÃÍs¨oI»sÛÂÙ*Áq`}Åëý9˜ã¼w6n}òÖªóh>ëÊzYÁ!¦.U‚Ø%žu óWܶ`E)S–yu´r3±%UÅk½tÝh]×rMëys±H˜a^O±æho±…EÞ4vzöåðòË‹ùÉâÎÿDZ×ä¨)rœ¦P2ê³2º«ÀAÙé™ð\Aï¥JÎ è«ÌH5â f-Å«µ÷çÑO1lóÊáp›'`ÂW0Ìá•ãeQ¤X¶Q¡ •ФÐùøPK 0@2A¹PKqy/gfront/GFrontApp.classuR[OAþ¦t»t™"7[´¨€·–õ®PD‘6iõ¡ ú`ÖíÐY¶›îЪÈgSŒ&þ”ñÌ–€ÄºçúïÌ9{~ýþþÀ2^XGÊÄ´…RZ\Òâ²…4f´¸bá*®Y˜Å\󸮭Úº©q·LÜÖ:c"kb!¶&=©Ö†2Ù]†èf«.HØÒcHfÞ•÷íŽwm¯‘¯ª¶ô…ì.Ç&½vËSùm­8rXäX²‰<ÇÜ帇û&p<Ä#9ž`ÅÄ*GkO±Â±®­gxÎ0yÖhë£#|%[džn4v®Ñ†ïSè ýúþp=G"m÷} Ô¡ô–ÁlU•Ÿ…&ÛÆîª|Q/ †™ÓèNÛö›Ò ¶¼Ž¤V!Þ41”[ŽíÌÎþÍ:AüI"(Š=ûÐUU§-„WéЋ҃jûI*Ký'Å0ª eà»ö§Jø»¦Ïvš!–©Aq†a¢¨Éºj†{*1Lü»£Û‡0Ä©â¥& kž#A7ªÏ”JáÍVs£SÕ_L_ É)òÆI3ÒÆÂ1ØQˆã"’'é DIoþ@äÍ1†Ê¹¢5Fåb=˜= ¿Ê-õ7Üů° ·NÎHèprzH|A´BŽˆ2Uº´QÝåPKžG&mþDPKqy/gfront/GFrontCommon$1.classu‘ÙJ1†ÿ´µcÇqk­ŠûR¥VqÔ[Eº ï☶)Ó L‚Ëc nxáøPâÉ x3Â9'üç|ɟϯ÷ëXvá`¸€<Š.JqQÆ¨ÍÆŒ;˜t0Å7m©+ åF«GÊøG‡6Ô£n7RÛ …óeÚÂÈ€Ä;RI³Ë0^MU¯\0äêÑ`ä‘‘:q3Š»â†a¶Úèð[îó;ã‹[A½{‰äÀæÔêÁô‡\3f1ç`ÞÃ=T°D7LAV6Àà+%âzȵša(…\µüÓëŽ Ãt*»!µÔÉ­ÚË—R .¡É¥ òiퟧ'»÷õ$êɾäaÔ"ûJ)Ç4Q s!µ¼ɪ\õʲÿ([ {é”TH:sôñyÓK»hm¥Ø»2´=ôS=@Ù(ÕöÄ­½‚ÕVŸ‘yLTô‡úÑÌÿhʵ'dÞ; gSö†žË_ù„B1ŸÔøPKEÓ·)qˆPKqy/gfront/GFrontCommon.classW‰{Wÿm,iWëmê#J"©Ó¦©,9È)·œ†Æ®Ý*µc›l¤µ½©¼+VO>¸Z -÷Ñrö.g8‹šUˆ ÜW¹¡œ 3»+Yr6ùúEúô®ùͼ™yófž^øß¥ç¼ÿã(Þ®b§yôï„®Ò茌¢ŠJÜ2TÄqZÆ¢ŠnœæÉ’ SÅvœ•qŠ”y²ÌÅ-£¢à]*pdTUìF'+2VUìÁš‚uónïQñ^¼'ïçÝîåæ>n>Çýø Œ©8€Ó àþAn>¬â#ø¨ŠáãÜ|BÆ'|JƧU|©ÆÃ<ú,>Ç£ÏËø‚Š×â‹ ¾ÄóGXÊ£L&QáqO°ÙO*xŠû§e|YÆW$ìšÕWŒYá˜ÖâôBÞªÔM }Y‚–·,Ã+ëÕªQ•°ílIBbò¬¾¢¯e««„Ï»ÃÔËöâ­ŽÓr¢fÙË˺Eø>Ÿ-ë„öéŽ6-S‘Е<)!2f— ÝÕ%{u^w,I¸%u9çå+Ì®1ßœ±&Ž’ÚFR*N8ú²Â.ì¶kæÎç™_uÚŒŸºfa§Ãüv= ?n/ëåÖ»¶¬ÌÙ>XÂäµ»!lë틆wÛiÊß‘ Å©z±hT«û‡‡‡% ¥&ÛÙ;'¸c%m+ØàòŠÏ®[bÉf±]έŽ†Ë .\Ã8&4äqLøKÆW5| _×p3úCXü çðM âúŒneŠxÏz}UdGm§d8“úº]¾…oÄG38Yæwè[œy«jˆ*/WÃ÷ðŒ†ïcCó8¿U©Ñš¶E—pún†=â’ý‡$€é?Ðð.P|t™-:v¹Ìú3† ‹·±¤ÁE&³¤?弋~ˆKø‘†ãy ?a·ý2~¦áçø…„[~´¶°`8¤ßþÖÿ—~…y¿Öðœ—ñ[ ¿Ã ~?–eM;›Ÿ_+a²e× ˜ÕË vC;fßr•Œ?jøþÌfýEÃ_yô7VúïxQÂÞMeó– DU«£ÔÚZÃ?pŒÒˆ±fн\3rdÃ?ñ"ò/ÿÖð£äª¢äñqL7ç$NÛp‚Ì QXBÏææÓgÎE±õP¦=%øP$ôr*›¢¸× ? %!Ç ­Ø–a‰ökë‹ ËHœ´±_)œb`‚BqÒ.ê¬Í £LýŠ1g“¶¡û3Gœ9¼¨—°§ å¯MéYáxÈhÊÏŽ2õþˆy§tgÑ´8•Ln¹S7ÆK¦ÐÏ”É5‘”§eL¯T DH}`Àî+ä"õê¥ÒÑ"Û7iV…aq¼Þض·±B–e;c1J|‰ÁÉö#öóÄ^¶³Nj)d…1¾\ë>IÂ>ß1¹ëŒG ¸G|—5ñ{SW²Û $}luÙÖ¨¡¯:¾*‘tà=\7AÀCÏ+ÝsÈ]uZ}ôŸ¦'—!F_Cd!mº¢5°(;':yï×Éo¾€´ÿô ¾´ÿWø3ÞP`;ã ñí5¶>9UEpýW>ä‰'î;…’©‘Ä?]…šœâjæ™p †®º<Ì«èIÃÁ?8FgØVÚ9~ù÷1ü‰¹õÆ}îgØ_Eœ 2ý~_ ×<æäÁŸb°Šðoxm÷ƒ22¼è§²F)ÛèôhtЛaÁFŸ[ÝÛFE«D…—öùS Q¢ÃiïÜpô)<ÏÆÄdC&ÏÃ3UŒ„FŸá:íU¼NëÎvüò¯I:=n0õ.ÞkàÎ àâŽG«¸!~ÇÈ)Æîµ):o¤y³{´{¶Š·êLã_PK‘©gÿ PKqy/gfront/RightClickDirTree.classVyxWÿ­-yWòúÚØM¦Hq·*.- §-©5¾ˆ8n)fc=ËëHZ±ZÙ(PîZî„«\6P®´±ìÖ4P®Bi ÷Uî£冿ù˜y»’¥Xæ+øûüæÍ¼ßÌ›óiþ÷ýg\Š…Ñ KÅL5°BÄ1) é0‚È0oó.ËÇ/Òà°$§Áeš×pˆé¬†¦s¼Ìór\Å‹ÃhƒÆKps/ÅËÂx9nQñŠ0¶°x ^É˫¸¯Vñš0¶±øV¼–w¯Óðz¦oÐp8Œ7â6>¹]Û˜y³†;øðN oáKÞ&ûoÓ0¦áíÌ¿CÅ;5¼Kà '5¼›uޣὠ{_ïÇ]a|Ôð!>ù°†„±€[xYäå£ìôÇxù¸†»û ¾î“>ÅYø4c>£á”†{Âë½N«XRQP±¬ 0“µ³ ÎïŸ1gÍùhnÎÊ$£×ÛÙ|v@dò= Ô䔓NXŽ‚Í• >»"íaÒÇ$&Hh‘TМ²ÒYÛq'\1ï*h,ñSÖ¼H(¨™!é¦J‹£Žd­ŽlØ:nê÷vÑëú˜ðÑ+c¹W+ØÙQEõø®Ã_¯dÉœt-;3,œ)ÛIóýÛ<QsΊYAZ{%d?ï¥j½¯c[ìËEëðv>'ÖàzšùÞ”5yŒí{ì°#r9f${P¤„™[;ÞŸq…Ãl½ÇÎ[®Hè¸ + Ϋ^ÏÃAmUKA ò²Ì6îÓq£:îǪŽÏâÊBg¤¢,:Æ0ª ¹L,«£ã+âe„—qÜ ãF<Ÿ*V‘â^;¶3*Îèø>¯âA_ÀU|IÇ—ñj« /û¬”è¶íœpt<„¯êøVñuàQ?àhÊ$èˆëƵù©)†~gu|ßRpA,2hGrùÉéÈ‹ØN„ºNLº¶s\Ç·qVÅwt|ßÓñ}œ%“f$c¦E„Š¡¶´r”n2¬ãø¡×g"aÛ?R ÐæÇxLÇOðSaWä\oÑñ3W-ëž*oR¸#4žÞÌ›î4…ÕQi‚³e4÷È7®l´æÌY‘ðŒˆ%‹¨ÀX¶‚-?> Bì‹w&I»Õw¢¼óH¿17mÏ eEfŸe¦lzp7—eŒÆ2kgäç©/E&<‚kѦeGYBöôržšBÌS¦s²t7ðû.ÜAL¥;¥pêÌ,ùBÕèªVäu"o²IOsmOBTe(ëÕ!Cw¶p¬ôšIQ wOÕp×gj½7qnÈ+róðM÷ÿï¦}IÕÔTddC`)#MN>3h§Í¿­&§´çœïs¨U«>] ùlÂtÅ„kåÊVB*±Îy¥…½Ž0©E¼þâ"óâþÿ)WDŸ´3=7>©„Rû6ð/>¹0‘.¿^eïðÈñœüÑ«µó45m¥ž¦[]º[˜<훪ˆ©²Ì¥2ô‰Ð![ââ'U'²×¾áwÙ¢¾:"§&î1ãÔ¾DÚs}¶ÓoOšœQzŠ;âq†t6`eJáèWŽÚ¸A\ò¢j5â2”F+'õQÇJ&…ƒíôÝ×Mß‚C†…¿ ÀôÛ.é!Ÿöé˜Oø”~þ%¥/Z5ú¿ / ;´»Ô]ì\†Ò¹ŠšñeÔ.!@Ûà¸Q· u Zçiú/ D4ÀûÂc ^tê … RØHÂÆ5a“6“°¹ÌTóš© 0Hh” ؽ„M]Kh=%QðB˜^ʃ¡žèÒ*ÚÈ÷óHiS›/ySÄ´žÆù±ÀîÚÙõܽŠ-¼ lòq[¯¬k«;Aèö`ÆÔvµ€‹Nb‡²Šm„Œ0¿½€ÆSh)à©ÆÎÀ .>Åâ§Å89­F‡Ä¬`W,Ôâ‹}UeŸí6ºxà%䙉…»X·=lì,àÞúÞpéØ"÷]Ö`H 5.+àé‹xÄ?i\@Ý"Îøœ±€Ùàè¯5.ω‹W/7®ôch© *픂Úî<“p]òš¢Ê³Š*í{XÀ³Éµ÷ ÖVW@Ï"žãßÞ¼€+Œ=+¸*¬°ru)ê oª©Ì”WÎþ’ñûñf¿³d÷.å’Lˆå«öpíU[½÷Þ…~rÄØWÀ~¿èœyù—³N}Æut³§ÛGxè@¥Ñç+Qòd+ùUC´™ñ¨ç«®'å"R”Û}d›‡lfä¾f÷2ú‹ð©ÿ 8ž,Ád†HV<šÞèÿPKÄ Ý”hPKqy/'gfront/RightClickTable$ExportTask.classVûÕÿÞìc&“²›‡D„n4â2‰„¶#,j5!´K ¯èln6›™uæ.IÔj«±kÛF| Q›*Pwƒô7úùøø×”ž;³6&æÓù|öž{Ï=÷<¾çÜs÷»ÿ~ý €­øVëÇv Ëáq9FlËëw]Çehà’úTO8…Ýy“¦!OÐöúeF{‹ccÜݨ>iqi(MêŸåul“'rä¯-ºY¹qÑ—·²'†Ìß­úÁi[ŒsaeIþ!˶Ä# 'ìÀòx—Æ¹çØ–#„NŸ3Jái9.¸ç™9Z4'·¬VÈ-Ú4&å1)ßWt]n ŸE!„¸=J2¦*Ú.Çæ¾Ä1Ô±¿Öñ+¤u¤°SÇCxXÇ£ø…ŽÇÐËк2^:vã—¤/ë¦S 3x[Ç#òÔ Þ!õ‰nbžÇAï글‹ ÞÓñ>>ÐÑ^}èUð¡ŽKøˆ¡ñ‡&(o¹1>Up\¡ãcÌ24UJïïŸÊò‚°м¥*•°¼„íˆÄ˜S´Guì³¾ÛýEQ( ÒÎÍ ö' k÷÷9b·<[£<6Fü„SàvÂ/© ÊO6THðÑ´½¨[Ág:þ‰9iã_:>Ç:.ãŠ\Òp‡©¸ó–Í·z¼`º¦pÈãK†5Êœ"°\Oø–JT‘‰‘iÁ½':?€„ï;bårÜMˆqÓNXÒ|"7fºþ>CÛ¤%4ÜvйqeÌQM¤mAA ¢]ǼôjÓí,îñÛp(¸¦ã+|­`AÇudÜÐñ 2 í+{G¿Ÿ˜!Ó;AæjzÚ¶¹Û—7={K’?4NRÅFÍBÁ/Ý®äòª_~/ð†äžUvUáT««¶à¦=Á©…2*¨Å y@f#ÈéΚò«aSzü”åe!®ä(]ÊØmî¡¢-¬‰ÊÅ^\´,¹Ø6 ó)NM%™^®“¥&A'bÉ¥ÍDš_‚ßþ‘ã<+VÃ/¶L/U+y[Sß wT=–—ñö†¼pÉ7üž$6’î•)2éZ‚¢WhNKhžÛ91Ní›ì‘ñwÅ4Ãæÿ«üÔ§W LÑ_y‚ÌMš]xzZW._J“™•tlÛFoÀƒ?ÚÓ«SÝÞ¤À–séÔ€Coã×ä*ÛdÄòúL;ËóœÐÑkóGŒ[p$è½ÞAèG ò£íSj¸>}´B©cÓÈd{õé._¾Nö\ŸRÏö)u{¢qÙúIj¯V¡ßöÑz¿? ùœÇŒy0£³„:#¦¢„ÑUBظ¿„ˆÑ.!j´DKPŒ/ùbÆÔÌ<êKÐf¡Œè߬¨ÞNªëˆvU„ã eè¤`Mkãë‚y”æe4XgñÎ˾†C ´°ï…Fô’AÖÖ¡šäÐ|.qäZ3¡øƒ™0é °}]e¬ß7‹X*lÛÍFüÎ6\a))¹‰pWFNç±1žÅ½©H Wuò'c‘2ä˜<»€öÌýeÜ={R‘X×Õ”ÒiSÊèÈôDë.â4É7…/âùÀDc[¸M µPh÷Îb˜xÚ¹é³æ±™Ô•¼2î#º„D`=y [Hb‘7¡2:ã™N.I³ˆB²%zÊ$Tfo¹³ˆ¤T ®õܬ­DO ܰÈ>OiØ[‰]‰«[Æ¥¶©~@=QÊgª¾®'Ú½@H×zhj ¿‡JW|勎ÿôh`šô6]A›Ñ…n´Qá(6á,ÛÄÚÑÆžd9vœè96ÃÎãg~ž‡p¸R+›¦p'YPfÐ(]nL<ÛŒŸ¿pfN.ÎÌUêëHµ2ÐCÕ%Ï´_w ”Ñ3C.KG‚>H®­£ió ªþßÑÅÝHTêˆÉ$ÜDC™ÆËìrEô7ÈTD;*.®¯d;Vk$4ž«”îßiÔˆn§?ÅþPK=(‘¤š PKqy/0gfront/RightClickTable$ExportTimerListener.classUÛRG=‚Ë$ˆµ v†$8BDà\HvB8rÄÅFqb纬FÒÂjGÞ]Îõ;ì‡TÞüœ*"SIUóàñä%•žÕ…›L¬ªÙéî9Ýs¦»gôäß?þð~Ö1ŠDF0¡#‰Il)%Mé˜Æ•ú¼©¤·ÔÂÛ:ÞÁŒú¼« ïéx³juNÇU\ÓðŽ˜Š–ćQÌ+å#!Å‚ŽE,Eq=Š£È(§*ä'JÊ*iYʆ›n1t%Û›b8Ÿ-<é©[v±¤ÛÚÊ™Ž˜eèY¿ï%Øáçl×®1 ÅŸå0~›!’–yÁÐgZ-Ý5á¤Wy†‘xvÓÜ1Sf5H‰Aîó!dQÉäÊq ë¯â5 9ŽOq[ÃgŸãÇ]|©á+ޝ•ò ¾å0vë,Ž<GAYŠ(i°96•²GC™Ã…d8Óà|}IMiY.K—£‚{ĵX»é£;¶¨ ÃÏ`›¡Kxžô4ìpT±KÇËK—Žmºh™®%‘縇ã;|Ïñ$Çø‰!Ñ>Wc‹¡{Î. /kûp…G$ÛZyÆ¥9혾/|†X˜FÇt‹©ÕMa‡á¶™=ˆÐW¥hO…A7-KøÔ SÔ3Ï.oXÀÝ”_µiï5O=òZ–ÔÒ£n:e™6±ýt#S!¡»ûN«}õÆÙM‹áê)$NO(¹•WþD mû a15Û_TUf`DªS¸D°Ër¤/šÉV™ÍIélÙ”ìþ¢DÁÜv‚–íl|<{I4"BTÎyEsò9ó6Åè?a¤¸~ U\Õ¯ëG+‡(„Q·Îé–&²Ûn1(…UÈZ§C÷ {äŽ3÷K²š»Á¼'̰*‡ÉÜXò̲˜=¹ëIK&£°7¼LMF;ºƒG6X­„ˆ©ªÔ¯¸,SÍ¢X°MGRˆ¹Co ]é •“xg_v„*ÙˆH]à‹`E$‹ŸÄ7áémÏ*Y½oö8$Né•¡AÝGÃP/ÍcP¿—ð:é—I ]YôÄc°ÄÄïèø-D1Ä1ÞÀüƒnDh~šØCÇ>:kˆ<Äp]骡û!b eÚüÚZ‰¶zö¡×Ð[×y /´0/.'ÿÆåd }¿`ôOÄîÓ3½Ï4ä½™]Ø…EmøýøÞwü¿÷Þ÷®yûÐwß `£ØX oâáÍ<ܤ  §$¼E§xç­NË+ñ6^¿g7óñ;dã32"Lo‘ñN¦·ÊxÓÛxx7ï‘ð^ËqJÁûp;ï—ð  ªYÊ$>ȳñðaÁ>*ãc2>®àNœUp>!㜌)^'eL3»ó>)ãn32>%ã>»·÷á~ŸVð|VÆçâþy^< á ¶²[ñ _Tð–ñ%_æéWd|UÆ# iü5Y'fgg=³©? _—ñ {ñM¾Å÷e|‡éw%|OA¾Ïà ?ðC½ø‘‚ü˜‡ ~‚Ÿò&ãç¼øÛð—<û•Œ_Ëx”åþFÆo%üNÂï%üA |÷xÜ0­¾pT7; K馀Œmh‰„žPR -qLÀ=7âË;†µQm¼91Ž 5ïë6â#ñN=6Ò&à4Gb˲!|´ô(!Ü„ˆ ÈCƒºÍY (==<ÖÇ:‰É¦ÃŠlF}Ú‘ˆN\ò cÄ輤Ù5?k`Ùº®Mô„‡ŽZí‘pè˜}¹nþA.‰›Æ©'F,lôþê,ÝÙÇüB‹íEÖËÂÙFd½¶… ¸]`} —â ”­?@ê¶:)¢…¬°ëÖÍAÃŒê5‡fmÌjÖGuºµÓ†ìæ¹}U%Sž·c]`Ÿs#¢‘Ä^Ë$ÁmÎNØhÞ&ù|«0%ɳýV/’ÒiŒ$ô !Q^Ûöc­œe7Û„—Eö²GèZbþxwÌÒM^:Ëñ°Å+E …è^]KK‹À–Àj«¿„ zǬ£ºͳ¼’Y^}–— if›˜YÓeêçx^ÅÆU$`©Á¨Šãø£@eîc— è}FªÈJt´ß°ô‹õG—ê÷b‘ž„¥q£¹réÖˆPkÁË(šUKvüA·®c1Á‹”õa÷»œÖt,UNئè3ÃCCº‰Zú)Ô„<A…ÜŒñï1n¹lz,E#)MÑXŠRoeSj¯hÌã¦Ï¦Ô÷Ù”:Að·ÔÉÝ@üo¤ÙÃpÃEô¾†i¸fàéŸFþum3û½ÓP¦PØpŽþ“P‰JŸÅl˜Æá4ü•…¿`!üUsð"û¡´—>zõRG2^ƒ“´ÁGe¡ßà|uÝi¿6z^Ÿ”— zÞ˜$2A:^‚õR yÑAàIPK6 ®×“ VPKqy/1gfront/GFrontCommon$SaveStringOfInputStream.classS[oQþ·…íZ[ oër) Öz¡j"QSCR#FÃãZ°Î’åÐÈ/âÕ&Æ&¾šøêÿQçÒ&ÐÄ—™Û7sæ›ýùûÛw<ÕƵ–q]à q>ÜÔáŦrÞÒ`êŽ3ÊTf*ˆ´Ž-d”‘ÕÓpGÃ=Ï—a½øÑ:´²¶“}Ö©V¹Ë+o¸UánžÁß°oOS–¨eKÒµEmœJ)Y·ÛñÃJ±Vu!³/_(UpšMGPB¨Ô²Î¥}@É»¶°å†-snöt’=ÑêHêÄ­f>ñŽÁWp*œÁëvIS¹‚ÒÂ53æ \Ć5¬3¬Î!Ã…9 Ç1U¾£Ä}Dÿa̬ÀÀ V <@ÌÀC÷‹¤8Oò}ïϯüÅ£#Br¸‹¥.È7JZÅ‚ ˆª>O:o“ÔI/ã6Uá/PK^²³²9PKqy/gfront/FragmentEditor$2.classu‘ÛJÃ@†ÿí!1qÕZ{ÖSµB[Áˆ·oŠ‚RTz+i›¶)q ÉÖÃc UÁ À‡gcE+5°;™É÷ÿÃLÞ?^ßìbÛ„ŽE’–RWÚDYË:ò:V4ÙsƒâC¶Þíø!­cßîÞ8Bµ]9ð« Æåƒ=Gº-Â\áÊC†\é¾Ü`ˆÕm‡!êÝ¥rƒƒ#ÁaÀԱʱ†uŽ tlrl¡Hݧš÷ÀÀO„püšg0$úö­my¶èZç;Ӓ ÉŸÒÅP»éQûôTO†Ùô®;TdHÕ•ðÞ î\’ž^)!MW_©SþïŒ!pFÃyÕqÓI-™Ž †BiÂ]*ÀúåPnÐ4úG¤¢“Të¡8 õDèpÌQ>OoÊUŬ¼€Uvžy )†$ÆÌ´.$+#DFˆ~…Ø3âßlN9PÔŸPKÀª×"W)PK qy/ íAMETA-INF/PKqy/ŠõõÅx†¤'META-INF/MANIFEST.MFPK s„[/íAágfront/PKqy/Éíä7—‘*¤gfront/ChangeLookAndFeel$ClickAction.classPKqy/U,Ǥõgfront/ChangeLookAndFeel.classPKqy/TÀ&ÒØ¤Vgfront/CommandOutput.classPKqy/kÚsöW¤vgfront/DirectoryTreeNode.classPKqy/w ì:ÿœ¤¸ gfront/FileTableModel.classPKqy/rœcɮԤ gfront/ReadOnlyTableModel.classPKqy/Û¥UW)¤û gfront/FragmentEditor$1.classPKqy/ç¬E~ý ¤gfront/FragmentEditor.classPKqy/4´óŠå¤dgfront/GFAppConst.classPKqy/"ü,q†h¤3gfront/FragmentTableModel.classPKqy/rFSqæC¤gfront/GFAction.classPKqy/ñ¡l N¤/gfront/GFront$1.classPKqy/—Äì!£¤Àgfront/GFront$2.classPKqy/();’+»¤$gfront/GFront$AllRefresh.classPKqy/j!K-û1'¤›!gfront/GFront.classPKqy/²ã™ÏMR¤×4gfront/GFrontConst.classPKqy/ƒ_ïtÊ ¤j7gfront/GFLSParser.classPKqy//dû Œ‰ ¤#>gfront/GFWHEREParser.classPKqy/ 0@2A¹¤÷Dgfront/GFWHEREParser2.classPKqy/žG&mþD¤Mgfront/GFrontApp.classPKqy/EÓ·)qˆ¤ÃOgfront/GFrontCommon$1.classPKqy/§ò{¤}Qgfront/GFrontCommon.classPKqy/‘©gÿ ¤¶Xgfront/GfhostList.classPKqy/Ä Ý”h¤ú\gfront/RightClickDirTree.classPKqy/=(‘¤š '¤Údgfront/RightClickTable$ExportTask.classPKqy/qCКÇR0¤Ékgfront/RightClickTable$ExportTimerListener.classPKqy/6 ®×“ V¤îogfront/RightClickTable.classPKqy/^²³²91¤Ëygfront/GFrontCommon$SaveStringOfInputStream.classPKqy/Àª×"W)¤c|gfront/FragmentEditor$2.classPK ~gfarm-2.4.1/util/gfront/src/0000755000000000000000000000000011507222730014352 5ustar rootrootgfarm-2.4.1/util/gfront/src/gfront/0000755000000000000000000000000011507222730015651 5ustar rootrootgfarm-2.4.1/util/gfront/src/gfront/ReadOnlyTableModel.java0000644000000000000000000000030411507222727022165 0ustar rootrootpackage gfront; import javax.swing.table.DefaultTableModel; public class ReadOnlyTableModel extends DefaultTableModel { public boolean isCellEditable(int row, int column) { return false; } } gfarm-2.4.1/util/gfront/src/gfront/GFAppConst.java0000644000000000000000000000321211507222727020464 0ustar rootrootpackage gfront; public interface GFAppConst { public static final int DEFAULT_METASERVER_PORT = 9000; public static final String DEFAULT_SNMP_COMMUNITY = "public"; public static final String DEFAULT_SNMPGET = "/usr/bin/snmpget"; public static final String DEFAULT_MIBPREFIX_HOSTNAME = "system.sysName"; public static final String DEFAULT_MIBPREFIX_LOAD_AVG = "enterprises.ucdavis.laTable.laEntry.laLoad"; public static final String DEFAULT_MIBPREFIX_IF_TX = "interfaces.ifTable.ifEntry.ifOutOctets"; public static final String DEFAULT_MIBPREFIX_IF_RX = "interfaces.ifTable.ifEntry.ifInOctets"; public static final String DEFAULT_MIBPREFIX_SPOOL_USAGE = "enterprises.ucdavis.dskTable.dskEntry.dskUsed"; public static final String DEFAULT_MIBPREFIX_SPOOL_AVAIL = "enterprises.ucdavis.dskTable.dskEntry.dskAvail"; public static final String[] DEFAULT_MIBPREFIX = { DEFAULT_MIBPREFIX_HOSTNAME, DEFAULT_MIBPREFIX_LOAD_AVG, DEFAULT_MIBPREFIX_IF_TX, DEFAULT_MIBPREFIX_IF_RX, DEFAULT_MIBPREFIX_SPOOL_USAGE, DEFAULT_MIBPREFIX_SPOOL_AVAIL, }; public static final String DEFAULT_MIB_HOSTNAME = DEFAULT_MIBPREFIX_HOSTNAME + ".1"; public static final String DEFAULT_MIB_LOAD_AVG = DEFAULT_MIBPREFIX_LOAD_AVG + ".1"; public static final String DEFAULT_MIB_IF_TX = DEFAULT_MIBPREFIX_IF_TX + ".5"; public static final String DEFAULT_MIB_IF_RX = DEFAULT_MIBPREFIX_IF_RX + ".5"; public static final String DEFAULT_MIB_SPOOL_USAGE = DEFAULT_MIBPREFIX_SPOOL_USAGE + ".1"; public static final String DEFAULT_MIB_SPOOL_AVAIL = DEFAULT_MIBPREFIX_SPOOL_AVAIL + ".1"; public static final int DEFAULT_INTERVAL = 1000; // milli sec. } gfarm-2.4.1/util/gfront/src/gfront/GFrontConst.java0000644000000000000000000000310511507222727020727 0ustar rootrootpackage gfront; public interface GFrontConst { // class local constants, for l10n. public static final String APPNAME = "GFront"; public static final String _LABEL_MENU_FILE = "File"; public static final String _LABEL_MENU_EDIT = "Edit"; public static final String _LABEL_MENU_SPECIAL = "L&F"; public static final String _LABEL_ITEM_IMPORT = "Import"; public static final String _LABEL_ITEM_EXPORT = "Export"; public static final String _LABEL_ITEM_REPL = "Replicate"; public static final String _LABEL_ITEM_REMOVE = "Remove"; public static final String _LABEL_ITEM_REGISTER = "Register"; public static final String _LABEL_ITEM_MKDIR = "Mkdir"; public static final String _LABEL_ITEM_RUN = "Run"; public static final String _LABEL_ITEM_MPIRUN = "MPI Run"; public static final String _LABEL_ITEM_METASERVER = "MetaServer"; public static final String _LABEL_ITEM_INTERNAL_DEMO = "InternalDemo"; public static final int IDX_MENU_FILE = 0; public static final int IDX_MENU_EDIT = 1; public static final int IDX_MENU_SPECIAL = 2; public static final int IDX_MENU_COUNT = 3; public static final int IDX_ITEM_IMPORT = 0; public static final int IDX_ITEM_EXPORT = 1; public static final int IDX_ITEM_REPL = 2; public static final int IDX_ITEM_REMOVE = 3; public static final int IDX_ITEM_REGISTER = 4; public static final int IDX_ITEM_MKDIR = 5; public static final int IDX_ITEM_RUN = 6; public static final int IDX_ITEM_MPIRUN = 7; public static final int IDX_ITEM_METASERVER = 8; public static final int IDX_ITEM_INTERNAL_DEMO = 9; public static final int IDX_ITEM_COUNT = 10; } gfarm-2.4.1/util/gfront/src/gfront/CommandOutput.java0000644000000000000000000000025211507222727021320 0ustar rootrootpackage gfront; public class CommandOutput { String[] output; int retcode; int idx; CommandOutput(int num, int r) { output = new String[num]; retcode = r; } } gfarm-2.4.1/util/gfront/src/gfront/GFLSParser.java0000644000000000000000000001473111507222727020440 0ustar rootrootpackage gfront; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.HashMap; import java.util.StringTokenizer; /* parse the following style output of gfls: -rw-r--r-- tatebe * 17885 Jan 1 1970 Event001.root -rwxr-xr-x tatebe * 11180 Nov 1 20:59 echo -rw-rw-rw- tatebe * 48 Jan 1 1970 host3 -rw-rw-r-- tatebe * 92 Jan 1 1970 host4.indiana -rwxrwxr-x tatebe * 445420 Oct 31 20:53 test -rw-r--r-- tatebe * 1073741824 Jan 1 1970 test.file1 -rwxrwxr-x tatebe * 365113 Jan 1 1970 thput-gfpio */ public class GFLSParser { public static final String DEFAULT_GFLS = "gfls"; public static final String ATTRIB_ATTR = "ATTRIB_ATTR"; public static final String ATTRIB_USER = "ATTRIB_USER"; public static final String ATTRIB_GROUP = "ATTRIB_GROUP"; public static final String ATTRIB_SIZE = "ATTRIB_SIZE"; public static final String ATTRIB_MTIME_DATE = "ATTRIB_DATE"; public static final String ATTRIB_MTIME_MONTH = "ATTRIB_MTIME_MONTH"; public static final String ATTRIB_MTIME_DAY = "ATTRIB_MTIME_DAY"; public static final String ATTRIB_MTIME_TIME = "ATTRIB_MTIME_TIME"; public static final String ATTRIB_MTIME_YEAR = "ATTRIB_MTIME_YEAR"; public static final String ATTRIB_NAME = "ATTRIB_NAME"; String _gfls; // gfls command to use. String gfarm_path; // gfarm path to parse. HashMap[] attribs; // parsed data of gfarm_path; GFront gfront; public GFLSParser(GFront _gfront) { _gfls = DEFAULT_GFLS; gfarm_path = null; attribs = null; gfront = _gfront; } public String getPATH() { return new String(gfarm_path); } public void setPATH(String p) throws IllegalStateException { if (attribs != null) { // already parsed. throw new IllegalStateException("Already parsed parser."); } gfarm_path = new String(p); } public void setCommand(String cmd) throws IllegalStateException { if (attribs != null) { // already parsed. throw new IllegalStateException("Already parsed parser."); } _gfls = new String(cmd); } protected CommandOutput _spawn_gfls_and_capture_output() { Runtime r = Runtime.getRuntime(); String[] cmds = { _gfls, "-lT", gfarm_path }; Process p = null; try { p = r.exec(cmds); } catch (IOException ioe) { // cannot spawn gfls. return null; } int ret = -1; ArrayList l = new ArrayList(); try { InputStream is = p.getInputStream(); BufferedReader br = new BufferedReader(new InputStreamReader(is)); /* ProgressMonitorInputStream pmis = new ProgressMonitorInputStream(gfront, "gfls...", is); //InputStream myis = new BufferedInputStream(pmis); StringWriter sw = new StringWriter(); ProgressMonitor pm = pmis.getProgressMonitor(); pm.setProgress(0); pm.setMillisToDecideToPopup(200); pm.setMaximum(10000); pm.setNote("**********************************************"); System.out.println("available: " + is.available()); int c; while((c = pmis.read()) != -1){ sw.write(c); System.out.print(c); } BufferedReader br = new BufferedReader(new StringReader(sw.toString())); */ while (true) { String ln = br.readLine(); if (ln == null) { // End of stream. break; } l.add(ln); } //pm.close(); } catch (IOException ioe) { // End of stream, pass through. } try { ret = p.waitFor(); } catch (InterruptedException ie) { // Interrupted waiting, but nothing to do... } int sz = l.size(); CommandOutput out = new CommandOutput(sz, ret); out.output = (String[]) (l.toArray(out.output)); return out; } protected HashMap _chop_and_eat(String s) { HashMap nm = new HashMap(); StringTokenizer st = new StringTokenizer(s, " "); // try extract file attributes. if (st.hasMoreTokens() == false) { // Invalid output, no tokens. return null; } String attr = (String) (st.nextToken()); nm.put(ATTRIB_ATTR, attr); // try extract file owner. if (st.hasMoreTokens() == false) { // Invalid output, no second token. return null; } String user = (String) (st.nextToken()); nm.put(ATTRIB_USER, user); // try extract file group. if (st.hasMoreTokens() == false) { // Invalid output, no third token. return null; } String group = (String) (st.nextToken()); nm.put(ATTRIB_GROUP, group); // try extract file size. if (st.hasMoreTokens() == false) { // Invalid output, no 4th token. return null; } String size = (String) (st.nextToken()); nm.put(ATTRIB_SIZE, size); // try extract modified date. if (st.hasMoreTokens() == false) { // Invalid output, no 5th token. return null; } String mon = (String) (st.nextToken()); nm.put(ATTRIB_MTIME_MONTH, mon); if (st.hasMoreTokens() == false) { // Invalid output, no 6th token. return null; } String day = (String) (st.nextToken()); nm.put(ATTRIB_MTIME_DAY, day); if (st.hasMoreTokens() == false) { // Invalid output, no 7th token, time or year. return null; } String time = (String) (st.nextToken()); nm.put(ATTRIB_MTIME_TIME, time); if (st.hasMoreTokens() == false) { // Invalid output, no 7th token, time or year. return null; } String year = (String) (st.nextToken()); nm.put(ATTRIB_MTIME_YEAR, year); nm.put(ATTRIB_MTIME_DATE, mon + " " + day + " " + time + " " + year); if (st.hasMoreTokens() == false) { // Invalid output, no 8th token. return null; } String filename = (String) (st.nextToken()); nm.put(ATTRIB_NAME, filename); return nm; } public boolean parse() throws IllegalStateException { if (attribs != null) { // already parsed. throw new IllegalStateException("Already parsed parser."); } if (gfarm_path == null) { throw new IllegalStateException("No path is set."); } CommandOutput o = _spawn_gfls_and_capture_output(); if (o == null) { // spawning gfls is failed. return false; } if (o.retcode != 0) { // failure. return false; } // success. int sz = o.output.length; attribs = new HashMap[sz]; for (int i = 0; i < sz; i++) { HashMap nm = _chop_and_eat(o.output[i]); if (nm == null) { // Invalid format in output. return false; } attribs[i] = nm; } return true; } public int getSize() { if (attribs == null) { // not parsed. return -1; } return attribs.length; } public String getAttr(int i, String key) { if (attribs == null) { // not parsed. return null; } return (String) (attribs[i].get(key)); } } gfarm-2.4.1/util/gfront/src/gfront/ChangeLookAndFeel.java0000644000000000000000000000376011507222727021761 0ustar rootrootpackage gfront; import java.awt.Component; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.Vector; import javax.swing.JMenuItem; import javax.swing.LookAndFeel; import javax.swing.SwingUtilities; import javax.swing.UIManager; import javax.swing.UnsupportedLookAndFeelException; public class ChangeLookAndFeel { LookAndFeel laf; UIManager.LookAndFeelInfo lafinfo[]; //Component main; Vector compolist; ChangeLookAndFeel(){ init(); } ChangeLookAndFeel(Component _main){ this(); //main = _main; compolist = new Vector(); compolist.add(_main); } void init(){ laf = UIManager.getLookAndFeel(); lafinfo = UIManager.getInstalledLookAndFeels(); } public void addComponent(Component c){ compolist.add(c); } public void addMenuItem(JMenuItem mi){ for(int i = 0; i < lafinfo.length; i++){ JMenuItem jmi = new JMenuItem(lafinfo[i].getName()); jmi.addActionListener(new ClickAction(lafinfo[i].getClassName())); mi.add(jmi); } } public static void main(String args[]){ ChangeLookAndFeel clf = new ChangeLookAndFeel(); for(int i = 0; i < clf.lafinfo.length; i++){ System.out.println(clf.lafinfo[i].getClassName()); System.out.println(clf.lafinfo[i].getName()); } } protected class ClickAction implements ActionListener { String uiName; //Component c; ClickAction(String _uiName){ uiName = _uiName; } public void actionPerformed(ActionEvent ae) { try { UIManager.setLookAndFeel(uiName); } catch (ClassNotFoundException e) { //e.printStackTrace(); } catch (InstantiationException e) { //e.printStackTrace(); } catch (IllegalAccessException e) { //e.printStackTrace(); } catch (UnsupportedLookAndFeelException e) { //e.printStackTrace(); } int size = compolist.size(); Component[] tmp = new Component[size]; Component[] cmp = (Component[]) (compolist.toArray(tmp)); for(int i=0; i < size; i++){ SwingUtilities.updateComponentTreeUI(cmp[i]); } } } } gfarm-2.4.1/util/gfront/src/gfront/GFWHEREParser2.java0000644000000000000000000001231111507222727021046 0ustar rootrootpackage gfront; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.HashMap; import java.util.StringTokenizer; public class GFWHEREParser2 { public static final String DEFAULT_GFWHERE = "gfwhere"; public static final String ATTRIB_INDEX = "ATTRIB_INDEX"; public static final String ATTRIB_NODES = "ATTRIB_NODES"; String _gfwhere; // gfwhere command to use. String gfarm_file; // gfarm file to analyze. HashMap[] attribs; // parsed data of gfarm_path; ArrayList comargs; // command arguments String[] outs; int all_fragment_count = 0; int fragment_count = 0; public GFWHEREParser2() { _gfwhere = DEFAULT_GFWHERE; gfarm_file = null; attribs = null; comargs = new ArrayList(); comargs.add(_gfwhere); outs = null; } public String getPATH() { return new String(gfarm_file); } public void addPATH(String p) throws IllegalStateException { if (attribs != null) { // already parsed. throw new IllegalStateException("Already parsed parser."); } comargs.add(p); } public void setCommand(String cmd) throws IllegalStateException { if (attribs != null) { // already parsed. throw new IllegalStateException("Already parsed parser."); } _gfwhere = new String(cmd); } protected CommandOutput _spawn_gfwhere_and_capture_output() { Runtime r = Runtime.getRuntime(); String[] cmds = new String[comargs.size()]; cmds = (String[]) comargs.toArray(cmds); Process p = null; try { p = r.exec(cmds); } catch (IOException ioe) { // cannot spawn gfwhere. return null; } int ret = -1; ArrayList l = new ArrayList(); try { InputStream is = p.getInputStream(); BufferedReader br = new BufferedReader(new InputStreamReader(is)); while (true) { String ln = br.readLine(); if (ln == null) { // End of stream. break; } System.out.println("add: " + ln); l.add(ln); } } catch (IOException ioe) { // End of stream, pass through. } try { ret = p.waitFor(); } catch (InterruptedException ie) { // Interrupted waiting, but nothing to do... } int sz = l.size(); CommandOutput out = new CommandOutput(sz, ret); out.output = (String[]) (l.toArray(out.output)); return out; } protected HashMap _chop_and_eat(String s) { HashMap nm = new HashMap(); StringTokenizer st = new StringTokenizer(s, " "); // try extract file attributes. if (st.hasMoreTokens() == false) { // Invalid output, no tokens. return null; } String str_idx = (String) (st.nextToken()); str_idx = str_idx.substring(0, str_idx.length() - 1); nm.put(ATTRIB_INDEX, str_idx); if (st.hasMoreTokens() == false) { // No filesystem node is. return null; } ArrayList node_list = new ArrayList(); while (st.hasMoreTokens()) { String n = (String) (st.nextToken()); node_list.add(n); all_fragment_count++; } nm.put(ATTRIB_NODES, node_list); return nm; } public boolean parse() throws IllegalStateException { if (attribs != null) { // already parsed. throw new IllegalStateException("Already parsed parser."); } System.out.println("size:" + comargs.size()); if (comargs.size() == 1) { throw new IllegalStateException("No path is set."); } CommandOutput o = _spawn_gfwhere_and_capture_output(); if (o == null) { // spawning gfwhere is failed. return false; } if (o.retcode != 0) { // failure. return false; } outs = o.output; /* // success. int sz = o.output.length; attribs = new HashMap[sz]; for (int i = 0; i < sz; i++) { HashMap nm = _chop_and_eat(o.output[i]); if (nm == null) { // Invalid format in output. return false; } attribs[i] = nm; } fragment_count = sz; */ return true; } public int getFragmentCount(int index) { if(outs == null){ return -1; } int nodeindex = -1; int fragcount = 0; int found = 0; for(int i=0; i < outs.length; i++){ if(outs[i].startsWith("gfarm:")){ if(found == 1) { return fragcount; } nodeindex++; fragcount = 0; } else if(outs[i].equals("")){ } else if(index == nodeindex || nodeindex == -1){ fragcount++; System.out.println("seek: " + outs[i]); found = 1; } } return fragcount; } public int getAllFragmentCount() { return all_fragment_count; } public int getSize() { if (attribs == null) { // not parsed. return -1; } return attribs.length; } public ArrayList getNodeList(int i) { if (attribs == null) { // not parsed. return null; } return (ArrayList) (attribs[i].get(ATTRIB_NODES)); } public String getARCH(int i) { if (attribs == null) { // not parsed. return null; } return (String) (attribs[i].get(ATTRIB_INDEX)); } public int getFragmentIndex(int i) throws NumberFormatException { if (attribs == null) { // not parsed. throw new NumberFormatException("Not parsed."); } return Integer.parseInt((String) (attribs[i].get(ATTRIB_INDEX))); } public static void main(String args[]){ GFWHEREParser2 p = new GFWHEREParser2(); p.addPATH("gfarm:/3com-stat"); p.addPATH("gfarm:/3com-stat.bin"); p.addPATH("gfarm:/takuya/aaa"); p.parse(); System.out.println("fragment:" + p.getFragmentCount(2)); } } gfarm-2.4.1/util/gfront/src/gfront/FragmentEditor.java0000644000000000000000000001366211507222727021444 0ustar rootrootpackage gfront; import java.awt.BorderLayout; import java.util.ArrayList; import java.util.Vector; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.JTable; import javax.swing.ListSelectionModel; import javax.swing.SwingUtilities; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; import javax.swing.table.JTableHeader; public class FragmentEditor extends JPanel implements GFAppConst, ListSelectionListener { JTable tbl_frag; FragmentTableModel frags; JScrollPane jsp; protected static FragmentTableModel _create_new_table_model() { FragmentTableModel dtm = new FragmentTableModel(); return dtm; } public FragmentEditor() { frags = _create_new_table_model(); tbl_frag = new JTable(frags); tbl_frag.setShowGrid(false); tbl_frag.setShowHorizontalLines(false); tbl_frag.setShowVerticalLines(true); tbl_frag.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); tbl_frag.getSelectionModel().addListSelectionListener(this); jsp = new JScrollPane(tbl_frag); jsp.getViewport().setBackground(tbl_frag.getBackground()); JTableHeader jth = tbl_frag.getTableHeader(); jsp.setColumnHeaderView(jth); setLayout(new BorderLayout()); add(jsp, BorderLayout.CENTER); } public synchronized void valueChanged(ListSelectionEvent e) { // } /* public void update(String fullpath) { GFWHEREThread gwt = new GFWHEREThread(); gwt.fullpath = fullpath; gwt.start(); while(gwt.fullpath != null){ System.out.println("sleep"); try { Thread.sleep(1000); } catch (InterruptedException e) { e.printStackTrace(); } } } class GFWHEREThread extends Thread { public String fullpath = null; public void run() { if(fullpath == null){ return; } System.out.println("thread: gfwhere"); GFWHEREParser p = new GFWHEREParser(); p.setPATH(fullpath); if (p.parse() == false) { // update failed. return; } FragmentTableModel dtm = _create_new_table_model(); int sz = p.getSize(); Vector v = null; int col_sz = 2; dtm.setColumnCount(col_sz); try { // OK, file is normal file, index is index. int idx = p.getFragmentIndex(0); dtm.setExecutable(false); for (int i = 0; i < sz; i++) { int id = p.getFragmentIndex(i); ArrayList nl = p.getNodeList(i); if (col_sz - 1 < nl.size()) { int old_col_sz = col_sz; col_sz = nl.size() + 1; for (int j = 0; j < col_sz - old_col_sz; j++) { dtm.addColumn(""); } // dtm.setColumnCount(col_sz); } v = new Vector(nl); v.add(0, new Integer(id)); dtm.addRow(v); } } catch (NumberFormatException nfe) { // OK, file is executable, index is architecture. dtm.setExecutable(true); for (int i = 0; i < sz; i++) { String arch = p.getARCH(i); ArrayList nl = p.getNodeList(i); v = new Vector(nl); v.add(0, arch); dtm.addRow(v); } } tbl_frag.setModel(dtm); fullpath = null; } } */ public void setNullFragmentTable(){ FragmentTableModel dtm = _create_new_table_model(); frags = dtm; SwingUtilities.invokeLater(new Runnable() { public void run() { tbl_frag.setModel(frags); } }); } public void update(String fullpath) { if(fullpath == null){ setNullFragmentTable(); return; } GFWHEREParser p = new GFWHEREParser(); p.setPATH(fullpath); p.start(); try { while (p.isAlive()) { //System.out.println("sleep: gfwhere"); p.join(100); } } catch (InterruptedException e) { //e.printStackTrace(); } if (p.retval == false) { // update failed. setNullFragmentTable(); return; } FragmentTableModel dtm = _create_new_table_model(); int sz = p.getSize(); Vector v = null; int col_sz = 2; int colMax = 11; // Limit: Filesystem Node = 10 dtm.setColumnCount(col_sz); try { // OK, file is normal file, index is index. // int idx = p.getFragmentIndex(0); dtm.setExecutable(false); for (int i = 0; i < sz; i++) { int id = p.getFragmentIndex(i); ArrayList nl = p.getNodeList(i); if (col_sz - 1 < nl.size()) { int old_col_sz = col_sz; col_sz = nl.size() + 1; if(col_sz > colMax){ col_sz = colMax; } for (int j = 0; j < col_sz - old_col_sz; j++) { dtm.addColumn(""); } // dtm.setColumnCount(col_sz); } v = new Vector(nl); v.add(0, new Integer(id)); dtm.addRow(v); } } catch (NumberFormatException nfe) { // OK, file is executable, index is architecture. // dtm.setExecutable(true); // for (int i = 0; i < sz; i++) { // String arch = p.getARCH(i); // ArrayList nl = p.getNodeList(i); // v = new Vector(nl); // v.add(0, arch); // dtm.addRow(v); // } dtm.setExecutable(true); for (int i = 0; i < sz; i++) { String arch = p.getARCH(i); ArrayList nl = p.getNodeList(i); if (col_sz - 1 < nl.size()) { int old_col_sz = col_sz; col_sz = nl.size() + 1; if(col_sz > colMax){ col_sz = colMax; } for (int j = 0; j < col_sz - old_col_sz; j++) { dtm.addColumn(""); } } v = new Vector(nl); v.add(0, arch); dtm.addRow(v); } } //tbl_frag.setModel(dtm); frags = dtm; SwingUtilities.invokeLater(new Runnable() { public void run() { tbl_frag.setModel(frags); } }); jsp.getViewport().setBackground(tbl_frag.getBackground()); } } class FragmentTableModel extends ReadOnlyTableModel { protected boolean isExecutable = false; public FragmentTableModel() { setColumnIdentifiers(new String[] { "Index", "Filesystem Node" }); } public Class getColumnClass(int idx) { if (idx == 0 && isExecutable) { return String.class; } if (idx == 0 && !(isExecutable)) { return Number.class; } return Object.class; } public void setExecutable(boolean t) { isExecutable = t; if (t == true) { setColumnIdentifiers( new String[] { "Architecture", "Filesystem Node" }); } } } gfarm-2.4.1/util/gfront/src/gfront/DirectoryTreeNode.java0000644000000000000000000000055011507222727022114 0ustar rootrootpackage gfront; import javax.swing.tree.*; public class DirectoryTreeNode extends DefaultMutableTreeNode { protected boolean _isExplored = false; public DirectoryTreeNode() { super(); } public boolean isLeaf() { return false; } public void setExplored(boolean b) { _isExplored = b; } public boolean isExplored() { return _isExplored; } } gfarm-2.4.1/util/gfront/src/gfront/GFrontApp.java0000644000000000000000000000100411507222727020355 0ustar rootrootpackage gfront; import java.awt.Dimension; import java.awt.DisplayMode; import java.awt.GraphicsEnvironment; public class GFrontApp { public static void main(String args[]) { GFront f = new GFront(); f.initial_setup(); //f.pack(); try { Dimension d = f.getSize(); DisplayMode dm = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDisplayMode(); f.setLocation(dm.getWidth()/2 - d.width/2, dm.getHeight()/2 - d.height/2); } catch(Exception e){ } f.show(); } } gfarm-2.4.1/util/gfront/src/gfront/GFront.java0000644000000000000000000003444211507222727017730 0ustar rootrootpackage gfront; import java.awt.BorderLayout; import java.awt.Container; import java.awt.Dimension; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.HashMap; import java.util.Locale; import javax.swing.JFrame; import javax.swing.JMenu; import javax.swing.JMenuBar; import javax.swing.JMenuItem; import javax.swing.JProgressBar; import javax.swing.JScrollPane; import javax.swing.JSplitPane; import javax.swing.JTable; import javax.swing.JTree; import javax.swing.ListSelectionModel; import javax.swing.SwingUtilities; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; import javax.swing.event.TreeExpansionEvent; import javax.swing.event.TreeSelectionEvent; import javax.swing.event.TreeSelectionListener; import javax.swing.event.TreeWillExpandListener; import javax.swing.table.JTableHeader; import javax.swing.tree.DefaultTreeModel; import javax.swing.tree.DefaultTreeSelectionModel; import javax.swing.tree.TreeNode; import javax.swing.tree.TreePath; public class GFront extends JFrame implements GFAppConst, GFrontConst, ListSelectionListener, TreeSelectionListener, TreeWillExpandListener { DirectoryTreeNode root_dir; DefaultTreeModel dirs; FileTableModel files; FragmentEditor property; JTree tre_dirs; JTable tbl_files; JMenuBar menubar; JMenu[] menus; JMenuItem[] menuItems; ChangeLookAndFeel clf; TreePath selected_path; DirectoryTreeNode selected_dir; String ldap_hostname; String ldap_base; int ldap_port; JScrollPane jsp_files; HashMap dir_node_map; private JProgressBar progressBar; public GFront() { super(); setSize(600, 600); selected_path = null; selected_dir = null; _node_is_not_selected_now(); //setDefaultCloseOperation(DISPOSE_ON_CLOSE); setDefaultCloseOperation(EXIT_ON_CLOSE); //ldap_hostname = "(not connected)"; ldap_hostname = "GFront"; ldap_base = ""; ldap_port = DEFAULT_METASERVER_PORT; root_dir = new DirectoryTreeNode(); root_dir.setUserObject("/"); dirs = new DefaultTreeModel(root_dir); files = new FileTableModel(); clf = new ChangeLookAndFeel(this); // Tree (gfls) tre_dirs = new JTree(dirs); tre_dirs.addTreeWillExpandListener(this); tre_dirs.addTreeSelectionListener(this); RightClickDirTree tree_right = new RightClickDirTree(tre_dirs, this); tre_dirs.addMouseListener(tree_right); clf.addComponent(tree_right.jpop); DefaultTreeSelectionModel tslm = new DefaultTreeSelectionModel(); tslm.setSelectionMode(DefaultTreeSelectionModel.SINGLE_TREE_SELECTION); tre_dirs.setSelectionModel(tslm); // Table (gfls) tbl_files = new JTable(files); tbl_files.setShowGrid(false); tbl_files.setShowHorizontalLines(false); tbl_files.setShowVerticalLines(true); tbl_files.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); tbl_files.getSelectionModel().addListSelectionListener(this); RightClickTable tbl_right = new RightClickTable(tbl_files, this); tbl_files.addMouseListener(tbl_right); clf.addComponent(tbl_right.jpop); // Property (gfwhere) property = new FragmentEditor(); property.setEnabled(false); // ProgressBar progressBar = new JProgressBar(0, 1000); progressBar.setValue(0); progressBar.setStringPainted(true); progressBar.setString(""); //but don't paint it //progressBar.setIndeterminate(true); Dimension dm = new Dimension(); dm.setSize(5, 30); progressBar.setMinimumSize(dm); progressBar.setMaximumSize(dm); //progressBar.setPreferredSize(dm); jsp_files = new JScrollPane(tbl_files); jsp_files.getViewport().setBackground(tbl_files.getBackground()); JTableHeader jth = tbl_files.getTableHeader(); jsp_files.setColumnHeaderView(jth); // right JSplitPane tb_split = new JSplitPane( JSplitPane.VERTICAL_SPLIT, jsp_files, property); tb_split.setDividerLocation(getHeight()/2); tb_split.setDividerSize(5); // left JSplitPane left_split = new JSplitPane( JSplitPane.VERTICAL_SPLIT, new JScrollPane(tre_dirs), progressBar); //left_split.setDividerLocation(1000); // all JSplitPane lr_split = new JSplitPane( JSplitPane.HORIZONTAL_SPLIT, true, new JScrollPane(tre_dirs), // left_split, tb_split); lr_split.setDividerLocation(getWidth()/4); lr_split.setDividerSize(5); Container c = getContentPane(); c.setLayout(new BorderLayout()); c.add(lr_split, BorderLayout.CENTER); init_all_menus(); setJMenuBar(menubar); setTitle(ldap_hostname); } public boolean initial_setup() { root_dir.removeAllChildren(); boolean retv = _update_node(root_dir, (String) (root_dir.getUserObject())); if(retv == false){ return false; } if(selected_path == null){ int sz = root_dir.getChildCount(); GFrontCommon gfc = new GFrontCommon(); String workDir = gfc.runNomalCommandToString(this, "gfsetdir", "gfsetdir"); String userName; try { userName = workDir.substring(workDir.indexOf("gfarm:/")+7, workDir.indexOf(";")); } catch(Exception e){ userName = System.getProperty("user.name"); } System.out.println("gfpwd: gfarm:/" + userName); for(int i=0; i 0) { // stdout System.out.println(stdMsg); showTextArea(parent, name + ": stdout", stdMsg); } if (errorMsg.length() > 0) { // stderr System.out.println(errorMsg); showTextArea(parent, name + ": stderr", errorMsg); } } errStringOfRunCommand = errorMsg; return stdMsg; } public void runNomalCommand(JFrame parent, String cmd, String name){ runCommand(parent, cmd, name, true); } public String runNomalCommandToString(JFrame parent, String cmd, String name){ return runCommand(parent, cmd, name, false); } public String getErrorString(){ return errStringOfRunCommand; } class SaveStringOfInputStream extends java.lang.Thread { private BufferedReader br; private StringBuffer lines; SaveStringOfInputStream(InputStream is){ br = new BufferedReader(new InputStreamReader(is)); lines = new StringBuffer(); } public void run() { try { while (true) { String ln = br.readLine(); if (ln == null) { // End of stream. break; } lines.append(ln + System.getProperty("line.separator")); } } catch (IOException ioe) { return; } } public String toString(){ return lines.toString(); } } } gfarm-2.4.1/util/gfront/src/gfront/GfhostList.java0000644000000000000000000000313711507222727020614 0ustar rootrootpackage gfront; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.ArrayList; public class GfhostList implements ActionListener { String[] list; GFront gfront; GfhostList(GFront _gfront){ list = null; gfront = _gfront; } public void runGfhost(){ Runtime r = Runtime.getRuntime(); String[] cmds = { "gfhost", "-l"}; Process p = null; try { p = r.exec(cmds); } catch (IOException ioe) { list = null; return; } int ret = -1; ArrayList l = new ArrayList(); try { InputStream is = p.getInputStream(); BufferedReader br = new BufferedReader(new InputStreamReader(is)); while (true) { String ln = br.readLine(); if (ln == null) { // End of stream. break; } l.add(ln); } } catch (IOException ioe) { // End of stream, pass through. } try { ret = p.waitFor(); } catch (InterruptedException ie) { // Interrupted waiting, but nothing to do... } int sz = l.size(); CommandOutput out = new CommandOutput(sz, ret); list = out.output = (String[]) (l.toArray(out.output)); return; } public String toString(){ StringBuffer str = new StringBuffer(); for(int i=0; i < list.length; i++){ str.append(list[i] + System.getProperty("line.separator")); } return str.toString(); } public void actionPerformed(ActionEvent ae) { runGfhost(); if(list != null){ GFrontCommon gfc = new GFrontCommon(); gfc.showTextArea(gfront,"gfhost", toString(), 30, 60); } } } gfarm-2.4.1/util/gfront/src/gfront/FileTableModel.java0000644000000000000000000000061711507222727021336 0ustar rootrootpackage gfront; public class FileTableModel extends ReadOnlyTableModel { public Class getColumnClass(int idx) { Class ret = null; switch (idx) { case 0 : ret = String.class; break; case 1 : ret = Number.class; break; case 2 : ret = String.class; break; case 3 : ret = Number.class; break; default : ret = Object.class; } return ret; } } gfarm-2.4.1/util/gfront/src/gfront/RightClickDirTree.java0000644000000000000000000001044211507222727022025 0ustar rootrootpackage gfront; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.io.File; import javax.swing.JFileChooser; import javax.swing.JMenuItem; import javax.swing.JOptionPane; import javax.swing.JPopupMenu; import javax.swing.JTree; import javax.swing.tree.TreePath; public class RightClickDirTree implements MouseListener, ActionListener { public JPopupMenu jpop; JMenuItem gfrmdir, gfmkdir, gfreg, gfimport_text, gfimport_fixed; JTree jt; GFront gfront; RightClickDirTree(JTree _jt, GFront _gfront) { jpop = new JPopupMenu(); //gfreg = new JMenuItem("gfreg -N 1 -I 0"); gfreg = new JMenuItem("import"); gfreg.addActionListener(this); jpop.add(gfreg); gfimport_text = new JMenuItem("* gfimport_text"); gfimport_text.addActionListener(this); //jpop.add(gfimport_text); gfimport_fixed = new JMenuItem("* gfimport_fixed"); gfimport_fixed.addActionListener(this); //jpop.add(gfimport_fixed); gfmkdir = new JMenuItem("gfmkdir"); gfmkdir.addActionListener(this); jpop.add(gfmkdir); gfrmdir = new JMenuItem("gfrmdir"); gfrmdir.addActionListener(this); jpop.add(gfrmdir); jt = _jt; gfront = _gfront; } public void actionPerformed(ActionEvent ae) { GFrontCommon gfc = new GFrontCommon(); TreePath tp = jt.getSelectionPath(); if (tp == null) { return; } String dirurl = gfront.savedSelectedDirname; if (ae.getSource() == gfreg) { JFileChooser chooser = new JFileChooser(); int returnVal = chooser.showOpenDialog(gfront); if (returnVal != JFileChooser.APPROVE_OPTION) { return; } File inFile = chooser.getSelectedFile(); if (inFile.exists() == false) { JOptionPane.showMessageDialog( null, inFile.getName() + ": No such file or directory", "gfreg", JOptionPane.INFORMATION_MESSAGE); return; } String inPath = inFile.getPath(); String regName = JOptionPane.showInputDialog( gfront, "a name for registering", inFile.getName()); if(regName == null) { return; } //String cmd = "gfreg -N 1 -I 0 " + inFile + " " + dirurl + regName; String cmd = "gfreg " + inFile + " " + dirurl + regName; gfc.runNomalCommand(gfront, cmd, "gfreg"); // update gfront._update_table(gfront.savedSelectedDirname); } else if (ae.getSource() == gfimport_text) { gfc.showTextArea(gfront, "gfimport_text", "test\ntest\n"); } else if (ae.getSource() == gfimport_fixed) { } else if (ae.getSource() == gfrmdir) { Object[] options = { "OK", "CANCEL" }; int ret = JOptionPane.showOptionDialog( null, "remove " + dirurl + " ?", "gfrmdir", JOptionPane.DEFAULT_OPTION, JOptionPane.WARNING_MESSAGE, null, options, options[0]); if (ret == 0) { // OK //System.out.println("$ gfrmdir " + dirurl); gfc.runNomalCommand(gfront, "gfrmdir " + dirurl, "gfrmdir"); gfront.initial_setup(); } else { System.out.println(ret); } } else if (ae.getSource() == gfmkdir) { String mkdirname = JOptionPane.showInputDialog("gfmkdir: input directry name"); //System.out.println("$ gfmkdir " + dirurl + mkdirname); gfc.runNomalCommand(gfront, "gfmkdir " + dirurl + mkdirname, "gfmkdir"); gfront.initial_setup(); } } private void actionPoint(MouseEvent e) { if (e.getSource() == jt) { int selRow = jt.getRowForLocation(e.getX(), e.getY()); if (selRow == jt.getMinSelectionRow()) { System.out.println("tree sel OK"); if (jt.getSelectionPath() == null) { return; } System.out.println(e.getX() + ", " + e.getY()); jpop.show(jt, e.getX(), e.getY()); } } } public void mouseClicked(MouseEvent e) { if (e.isPopupTrigger()) { System.out.println("Popup"); } //System.out.println("mouse click"); } public void mousePressed(MouseEvent e) { if (e.isPopupTrigger()) { // Linux System.out.println("Popup2"); actionPoint(e); } //System.out.println("mouse press"); } public void mouseReleased(MouseEvent e) { if (e.isPopupTrigger()) { // Windows System.out.println("Popup3"); actionPoint(e); } //System.out.println("mouse release"); } public void mouseEntered(MouseEvent e) { //System.out.println("mouse enter"); } public void mouseExited(MouseEvent e) { //System.out.println("mouse exit"); } } gfarm-2.4.1/util/gfront/src/gfront/GFWHEREParser.java0000644000000000000000000001175011507222727020772 0ustar rootrootpackage gfront; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.HashMap; import java.util.StringTokenizer; /* [hkondo@gfm01 glogger]$ /usr/local/gfarm/bin/gfwhere gfarm:/tatebe/echo i386-intel-linux-aist: gfm02.apgrid.org gfm01.apgrid.org gfm03.apgrid.org gfm04 .apgrid.org gfm17.apgrid.org gfm18.apgrid.org gfm19.apgrid.org [hkondo@gfm01 glogger]$ /usr/local/gfarm/bin/gfwhere gfarm:/tatebe/thput-gfpio i386-intel-linux-aist: gfm02.apgrid.org gfm03.apgrid.org gfm17.apgrid.org gfm18 .apgrid.org gfm01.apgrid.org gfm04.apgrid.org gfm19.apgrid.org [hkondo@gfm01 glogger]$ /usr/local/gfarm/bin/gfwhere gfarm:/tatebe/test.file1 0: gfm01.apgrid.org gfm17.apgrid.org */ public class GFWHEREParser extends Thread { public static final String DEFAULT_GFWHERE = "gfwhere"; public static final String ATTRIB_INDEX = "ATTRIB_INDEX"; public static final String ATTRIB_NODES = "ATTRIB_NODES"; String _gfwhere; // gfwhere command to use. String gfarm_file; // gfarm file to analyze. HashMap[] attribs; // parsed data of gfarm_path; int all_fragment_count = 0; int fragment_count = 0; public GFWHEREParser() { _gfwhere = DEFAULT_GFWHERE; gfarm_file = null; attribs = null; } public String getPATH() { return new String(gfarm_file); } public void setPATH(String p) throws IllegalStateException { if (attribs != null) { // already parsed. throw new IllegalStateException("Already parsed parser."); } gfarm_file = new String(p); } public void setCommand(String cmd) throws IllegalStateException { if (attribs != null) { // already parsed. throw new IllegalStateException("Already parsed parser."); } _gfwhere = new String(cmd); } protected CommandOutput _spawn_gfwhere_and_capture_output() { Runtime r = Runtime.getRuntime(); String[] cmds = { _gfwhere, gfarm_file }; Process p = null; try { p = r.exec(cmds); } catch (IOException ioe) { // cannot spawn gfwhere. return null; } int ret = -1; ArrayList l = new ArrayList(); try { InputStream is = p.getInputStream(); BufferedReader br = new BufferedReader(new InputStreamReader(is)); while (true) { String ln = br.readLine(); if (ln == null) { // End of stream. break; } l.add(ln); } } catch (IOException ioe) { // End of stream, pass through. } try { ret = p.waitFor(); } catch (InterruptedException ie) { // Interrupted waiting, but nothing to do... } int sz = l.size(); CommandOutput out = new CommandOutput(sz, ret); out.output = (String[]) (l.toArray(out.output)); return out; } protected HashMap _chop_and_eat(String s) { HashMap nm = new HashMap(); StringTokenizer st = new StringTokenizer(s, " "); // try extract file attributes. if (st.hasMoreTokens() == false) { // Invalid output, no tokens. return null; } String str_idx = (String) (st.nextToken()); str_idx = str_idx.substring(0, str_idx.length() - 1); nm.put(ATTRIB_INDEX, str_idx); if (st.hasMoreTokens() == false) { // No filesystem node is. return null; } ArrayList node_list = new ArrayList(); while (st.hasMoreTokens()) { String n = (String) (st.nextToken()); node_list.add(n); all_fragment_count++; } nm.put(ATTRIB_NODES, node_list); return nm; } boolean retval; // public boolean parse() throws IllegalStateException { public void run() throws IllegalStateException { retval = false; if (attribs != null) { // already parsed. throw new IllegalStateException("Already parsed parser."); } if (gfarm_file == null) { throw new IllegalStateException("No path is set."); } CommandOutput o = _spawn_gfwhere_and_capture_output(); if (o == null) { // spawning gfwhere is failed. //return false; retval = false; return; } if (o.retcode != 0) { // failure. //return false; retval = false; return; } // success. int sz = o.output.length; attribs = new HashMap[sz]; for (int i = 0; i < sz; i++) { HashMap nm = _chop_and_eat(o.output[i]); if (nm == null) { // Invalid format in output. //return false; } attribs[i] = nm; } fragment_count = sz; //return true; retval = true; return; } public int getFragmentCount() { return fragment_count; } public int getAllFragmentCount() { return all_fragment_count; } public int getSize() { if (attribs == null) { // not parsed. return -1; } return attribs.length; } public ArrayList getNodeList(int i) { if (attribs == null) { // not parsed. return null; } return (ArrayList) (attribs[i].get(ATTRIB_NODES)); } public String getARCH(int i) { if (attribs == null) { // not parsed. return null; } return (String) (attribs[i].get(ATTRIB_INDEX)); } public int getFragmentIndex(int i) throws NumberFormatException { if (attribs == null) { // not parsed. throw new NumberFormatException("Not parsed."); } return Integer.parseInt((String) (attribs[i].get(ATTRIB_INDEX))); } } gfarm-2.4.1/util/gfront/src/gfront/GFAction.java0000644000000000000000000000044711507222727020161 0ustar rootrootpackage gfront; import java.awt.event.ActionEvent; import javax.swing.AbstractAction; public class GFAction extends AbstractAction { GFront gf; public GFAction(String name, GFront gf) { super(name); this.gf = gf; } public void actionPerformed(ActionEvent a) { // Nothing to do. } } gfarm-2.4.1/util/gfront/src/gfront/RightClickTable.java0000644000000000000000000002300011507222727021510 0ustar rootrootpackage gfront; import java.awt.Toolkit; import java.awt.event.*; import java.awt.event.ActionListener; import java.io.BufferedInputStream; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import javax.swing.JFileChooser; import javax.swing.JMenuItem; import javax.swing.JOptionPane; import javax.swing.JPopupMenu; import javax.swing.JTable; import javax.swing.ProgressMonitor; import javax.swing.Timer; public class RightClickTable implements MouseListener, ActionListener { public JPopupMenu jpop; JMenuItem gfrun, gfrm, gfexport, gfexport_view, gfrep; JTable jt; GFront gfront; private ExportTask task; private ProgressMonitor progressMonitor; private Timer timer; RightClickTable(JTable _jt, GFront _gfront) { jpop = new JPopupMenu(); gfrun = new JMenuItem("gfrun"); gfrun.addActionListener(this); jpop.add(gfrun); gfrm = new JMenuItem("gfrm"); gfrm.addActionListener(this); jpop.add(gfrm); gfexport = new JMenuItem("gfexport"); gfexport.addActionListener(this); jpop.add(gfexport); gfexport_view = new JMenuItem("gfexport viewer"); gfexport_view.addActionListener(this); jpop.add(gfexport_view); gfrep = new JMenuItem("* gfrep"); gfrep.addActionListener(this); jpop.add(gfrep); jt = _jt; gfront = _gfront; } public void actionPerformed(ActionEvent ae) { GFrontCommon gfc = new GFrontCommon(); int row = jt.getSelectedRow(); if (row < 0) { // Not selected. return; } String name = (String) (jt.getValueAt(row, 0)); String url = gfront.savedSelectedDirname + name; //System.out.println(url); // check file size long filesize; try { //filesize = new Long((String) jt.getValueAt(row, 1)).longValue(); filesize = Long.parseLong((String) jt.getValueAt(row, 1)); } catch (Exception e) { //e.printStackTrace(); // gfls error JOptionPane.showMessageDialog( null, "cannot get file size", "error", JOptionPane.ERROR_MESSAGE); //filesize = 777777; return; } if (ae.getSource() == gfrun) { String commandLine = JOptionPane.showInputDialog( gfront, "gfrun (for the output of strings)", "gfarm:CMD " + url); if(commandLine != null){ gfc.runNomalCommand(gfront, "gfrun " + commandLine, "gfrun"); } } else if (ae.getSource() == gfrm) { Object[] options = { "OK", "CANCEL" }; int ret = JOptionPane.showOptionDialog( null, "remove " + url + " ?", "gfrm", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE, null, options, options[0]); if (ret == 0) { // OK System.out.println("$ gfrm " + url); gfc.runNomalCommand(gfront, "gfrm " + url, "gfrm"); // update gfront._update_table(gfront.savedSelectedDirname); } else { // cancel // do nothing System.out.println(ret); } } else if (ae.getSource() == gfexport) { JFileChooser chooser = new JFileChooser(); int returnVal = chooser.showSaveDialog(gfront); if (returnVal == JFileChooser.APPROVE_OPTION) { File outf = chooser.getSelectedFile(); String to = outf.getName(); System.out.println("*** $ gfexport " + url + " > " + to); if (outf.exists()) { Object[] options = { "OK", "CANCEL" }; int ret = JOptionPane.showOptionDialog( null, "\"" + to + "\" exists. overwrite?", "gfexport", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE, null, options, options[0]); if (ret != 0) { // ! cancel return; } } run_gfexport(filesize, url, outf); } } else if (ae.getSource() == gfexport_view) { run_gfexport(filesize, url, null); } else if (ae.getSource() == gfrep) { /* gfrep -H hostfile gfarm-URL ˆêŽžƒtƒ@ƒCƒ‹ì‚ç‚È‚¯‚ê‚΂Ȃç‚È‚¢ gfrep -D domainname gfarm-URL ‚Å‚«‚é ‰E‰º ƒm[ƒh–¼‘I‘ð‚·‚é‚Æ -s ƒIƒvƒVƒ‡ƒ“‚à”½‰f gfrep -I fragment-index [ -s src-node ] -d dest-node gfarm-URL */ } } private void run_gfexport(long filesize, String url, File outf) { //filesize = 1000; int setmax; boolean isLong; if (filesize > Integer.MAX_VALUE) { setmax = (int) ((filesize >> 32) & 0x00000000FFFFFFFF); isLong = true; } else { setmax = (int) filesize; isLong = false; } progressMonitor = new ProgressMonitor(gfront, "gfexport", "", 0, setmax); progressMonitor.setProgress(0); progressMonitor.setMillisToDecideToPopup(200); progressMonitor.setNote("0 / 0"); task = new ExportTask(url, outf, filesize, isLong); task.start(); timer = new Timer(1000, new ExportTimerListener()); timer.start(); } // exec gfexport class ExportTask extends Thread { String from; File to; long now; long maxsize; boolean isLong; public boolean isError; public String errorString; private boolean stopFlag; private StringBuffer str; private int maxview = 2048; ExportTask(String _from, File _to, long max, boolean _isLong) { from = _from; to = _to; maxsize = max; isLong = _isLong; if (to == null) { str = new StringBuffer(); } else { str = null; } } String getMessage() { String msg = "copy: " + now + " / " + maxsize; System.out.println(msg); return msg; } /* public void run() { now = 0; while (now < maxsize) { // test code try { Thread.sleep(1000); } catch (InterruptedException e) { e.printStackTrace(); } now += Math.random() * maxsize / 10; } } */ public void run() { now = 0; stopFlag = false; isError = false; Runtime r = Runtime.getRuntime(); String[] cmds = { "gfexport", from }; Process p = null; try { p = r.exec(cmds); } catch (IOException ioe) { isError = true; errorString = "gfexport is not found"; return; } FileOutputStream fo = null; if (to != null) { // file output try { fo = new FileOutputStream(to); } catch (FileNotFoundException e) { isError = true; errorString = "file open error: " + to; return; } } BufferedInputStream is = new BufferedInputStream(p.getInputStream()); int len; byte[] b = new byte[1024]; try { while ((len = is.read(b)) != -1 && stopFlag != true) { if (to != null) { fo.write(b, 0, len); } else { str.append(new String(b, 0, len)); if (str.length() > maxview) { str.append( System.getProperty("line.separator") + System.getProperty("line.separator") + "[print first " + maxview + " bytes]"); break; } } now += len; } } catch (IOException ioe) { // do nothing } if (now > maxsize) { isError = true; errorString = "output file is bigger than input gfarm file"; } if (now < maxsize) { isError = true; errorString = "output file is not enough"; BufferedInputStream es = new BufferedInputStream(p.getErrorStream()); try { len = es.read(b); } catch (IOException e1) { len = -1; } if (len > 0) { errorString = new String(b, 0, len); } } if (stopFlag == true) { System.out.println("Interrupt!"); } try { p.waitFor(); } catch (InterruptedException ie) { // Interrupted waiting, but nothing to do... } stopFlag = true; } int getCurrent() { if (isLong) { return (int) ((now >> 32) & 0x00000000FFFFFFFF); } else { return (int) now; } } // stop void end() { if (progressMonitor.isCanceled()) { stopFlag = true; to.delete(); } else if (isError) { stopFlag = true; } } String viewString() { if (str != null) { return str.toString(); } else { return null; } } boolean isDone() { if (stopFlag != true && now < maxsize) { return false; } else { return true; } } } class ExportTimerListener implements ActionListener { public void actionPerformed(ActionEvent evt) { if (progressMonitor.isCanceled() || task.isDone() || task.isError) { task.end(); progressMonitor.close(); Toolkit.getDefaultToolkit().beep(); timer.stop(); String st = task.viewString(); if (st != null && st.length() > 0) { GFrontCommon gfc = new GFrontCommon(); gfc.showTextArea(gfront, "gfexport viewer", st, 30, 60); } else if (task.isError) { JOptionPane.showMessageDialog( null, task.errorString, "error", JOptionPane.WARNING_MESSAGE); } else if (task.isDone()) { JOptionPane.showMessageDialog( null, "done", "gfexport", JOptionPane.INFORMATION_MESSAGE); } else { JOptionPane.showMessageDialog( null, "canceled", "gfexport", JOptionPane.WARNING_MESSAGE); } } else { progressMonitor.setNote(task.getMessage()); progressMonitor.setProgress(task.getCurrent()); } } } private void actionPoint(MouseEvent e) { System.out.println(e.getX() + ", " + e.getY()); jpop.show(jt, e.getX(), e.getY()); } public void mouseClicked(MouseEvent e) { if (e.isPopupTrigger()) { System.out.println("Popup"); } //System.out.println("mouse click"); } public void mousePressed(MouseEvent e) { if (e.isPopupTrigger()) { // Linux System.out.println("Popup2"); actionPoint(e); } //System.out.println("mouse press"); } public void mouseReleased(MouseEvent e) { if (e.isPopupTrigger()) { // Windows System.out.println("Popup3"); actionPoint(e); } //System.out.println("mouse release"); } public void mouseEntered(MouseEvent e) { //System.out.println("mouse enter"); } public void mouseExited(MouseEvent e) { //System.out.println("mouse exit"); } } gfarm-2.4.1/util/gfront/Makefile0000644000000000000000000000115511507222727015233 0ustar rootroottop_builddir = ../.. top_srcdir = $(top_builddir) srcdir = . javadir = $(prefix)/share/java include $(top_srcdir)/makes/var.mk # NOTE: We use current directory instead of $(srcdir) for the script # to be installed, because the script will be generated by configure. SCRIPTS= gfront JAR= gfront.jar include $(top_srcdir)/makes/script.mk install: @$(MKDIR_P) $(DESTDIR)$(javadir) @for i in -- $(JAR); do \ case $$i in --) continue;; esac; \ echo \ $(INSTALL_DATA) $(srcdir)/$${i} $(DESTDIR)$(javadir)/$${i}; \ $(INSTALL_DATA) $(srcdir)/$${i} $(DESTDIR)$(javadir)/$${i}; \ done distclean: -rm -f $(SCRIPTS) gfarm-2.4.1/util/gfront/gfront.mani0000644000000000000000000000003511507222727015734 0ustar rootrootMain-Class: gfront.GFrontApp gfarm-2.4.1/util/gfront/build.xml0000644000000000000000000000177711507222727015426 0ustar rootroot gfarm-2.4.1/util/gfront/gfront.jar0000755000000000000000000010347311507222727015601 0ustar rootrootPK qy/ META-INF/PKqy/META-INF/MANIFEST.MFóMÌËLK-.Ñ K-*ÎÌϳR0Ô3àårÌCq,HLÎHUŠ%MõLx¹œ‹RKRSt*ALôŒt“Œ,4‚Kó|3“‹ò‹+‹KRs‹<ó’õ4y¹|3óts‹‹­ÒÓŠòóJôÜÝ@”cA//PKŠõõÅx†PK s„[/gfront/PKqy/*gfront/ChangeLookAndFeel$ClickAction.classuT]SÓ@=KS––H Z>´jZ>‚¨¨ÔÚ™Îpá…§˜.%’N²åC_ý%¾ðÌ ãŒŽÏþÿz´)™ÉÞìÝs÷žs÷n~üúò À8^Ç‘D Ãí81Ä1Ìq‡ã.G:†{¸Çh™Àf9FâÅÇ8ÇCŽI†Öšµhl †®Ò¦±cè¶áTôeéYN%G«rÃòÓ 7K•uÏu¤^Ø €(¹îVÞ)Ï a*¶¼ïÈ !-“"f,Ç’/tíêË©2« JÁ-‘„aJËuÞoÝõ¶E™aP; 0v¥.vm™!sÁ7…ªèÁ#7RÑ…ëU<ÁÃÐyž‚møþ¢+çÝšSžÛ3E5Øá¤èøÒp¤e„{7‡Ø¶¨vÞ4…ï7@FÈžîï’}ÅñkÕªëIQn]Gsƒ¦­•þ—˜Ë4ñQ—7*ZÆJ`I+¨SªV-RÔá­'Ä eêÑšQfÃt+“`èD ]XjÌp¤.%_7‚'ð÷ —æ}ôu‹æ²‰ìg°ìÈ1Z²£Çˆ†P"G€3à¶’]Ê!r åÉ…¨ô¶Ñ«,»å±Ägû¿¢}ñï|ìêw\›V"SÑT´ÿ:û”Ttò£ìà÷ÏC(´)GÑÐv„I8qæ¡íF[Hd‚Æ8Ùý_t(PKÉíä7—‘PKqy/gfront/ChangeLookAndFeel.classTYSÓP=—"±!Z@VÁÍ6ã¾UP¬¢Å²( ¢O‘Œ¦‰Ó—w‰/>ëHad†gÇàÏQÏmÚÚvŠCf’{¿{Ïwܟ¿¿ï8ƒ=SщqùSpFE3ÆÂ4 9;«âÎKó‚œ]”³K .«8†+*4\UpM×UD+7ägBÁd7qKÅn+H ´&{õõÔªo{®€–r]+—tÌ|ÞÊ „sM /ýÊ|k¾7òïlwÝH{Þë)73mYNB@!Âv×<w"U{). DŸ×ø>IÍš®¹nå†ëd ¯zÙ7žcç}Ž¢—±áÛŽ±d­ú^Ž€–¶kû“Œ*[hNzK '`Íw¾‘” ®åú‰"@™’™ÉT6˜/ÍYËÝHùVVàh´&¾™òN@5mÖ¤»”„ᘄ,ú9"¹¯aCF1$ÐV®†“8¥á.¦ÜÓp) Gѯa4 à„@WÃ5¤1+©ç†××ržË´^ò`«ªbÃU=Ó08,hxˆGòÌEÞ½\<ÖðK –5<•§´ýËmþÅ+F/0²¯ž±¬%‰¦ë)±gu VX¯[~•@4ö…õžró¾é8V¦j‹òÔ£±ýëK!Ïœ™¥d:KçÕ4´.J›) :ÿˆÀÛˆ¦÷*n¢1A;Ë4+Mu[®,Â`•l­·T¦Q‹(:êµÝh±¦‹òEu‡¼ v³+ÀÛž±À|f™Y:i°Ì2½‘–ãâï”^G!¾”.äCáGЛ߾ü@¥rÖÅQp ë[zM_<ƒ)AFHÖı¾ƒæ•-ØD‹þ -ñ”å²Ëh…µŸ’5¢oãà&É·¡n¢5 œ®pw(¹Õ:2ÞAˆ•03 ¹™ãdhb€°ÖÝO¸´mEÎÎph ‡çÆwYÑËKm[h/ #>^À‘åMâóŸo:â%Þ;ÌK–éê:™R(MþxÀú+ºâe®º«ÌC4‹Œ¿Ê‘öñÛÁ,",}/#=Æ»ý8ÂPKU,ÇPKqy/gfront/CommandOutput.class]ÁJÃPEÏ4mž­O­mu£îÚ,Ì(nº ]ݸŠM )öE«ø[.Š èøQâ4¸fî0Ü{gæëûý¸à¸GȡߥÃá¶ CÃH«µZ{axw³LŸÓø1uE|ëëÒ—‚©s¿¨²\DÊìE%W¥+ýµÐ'Éd.´§Ê°XŽ„þ‹aÇÒ¥'ŒŠ‡ºr>žV«Uê²Ùïê?šÙý2_è(Oæœë¡¡>hª ÛPŸwMËžâ¾vg´î zC¢“Z‚ètCûµÑðPKTÀ&ÒØPKqy/gfront/DirectoryTreeNode.classM±NÃ0†;nB“Ph‘%yÔ…v&ÄÐz©Œ¢9.”wê‚Bbàx(Ä%Êâ;ÿ÷ýÿÙŸ_ïޱBa« Ûúѵ©&Ëû¼´4SÿÄÆ¼áÑ•€:-gĪ©ÎHgÊPT‘[ÛÔpZ£á:*F€ø{óÌ–…KÇÆÒ­+íÓ¥%ºhRïôƒ^¦Õ£)æ©c9S¦¹;_8}“Ó/‰~³â?ð®:”;Å=ïà³Ë·]Hî€0yƒH¼WÈg áCD-ÓãZ3Ò[µ³›ílÀ~ÉÕOöÿy{Þ~ëí$/?v|PKkÚsöWPKqy/gfront/FileTableModel.classu’QOÓPÇÿ—nkW¯ æ@çAl7õÁŒ/S#Ý1$†jÌËy}‘(ô¾IžŒ3²ÉÊ9RŸã†[ÈðGº¡ÙÌ*|"ûm,ÑzL«Iëhý2YãéÃ/ÐO‘¢ˆuŠÎ¦×0c`xyUÅ£«*òCp ®+ÀcÀ­í³Ñô3©[Ùõõ7C6[¹;Ûûípë+çHþŒ‡M ©¸æ/PKw ì:ÿœPKqy/gfront/ReadOnlyTableModel.class;õo×>=.fNv.vnF6›Ì¼Ì;Ff Í0Fçü”TF¾ÌbçÔœה̒Ĥ «†§§f +#ƒdzZQ~^‰~PjbŠ^NeH/Pc#ƒrVbYb…~qyf^º>X³¾KjZbiN Bƒ"Ð ÀÄÀ2H²y‚@šH³jmg`ÜVÀÈÀÎÀ•æÒ mLÌkÀr PKrœcÉ®ÔPKqy/gfront/FragmentEditor$1.classu‘ÛJÃ@†ÿí!1qÕZ{ÖSµB[ÁèuÅ›¢ T•ÞJÚ¦mJÜB²õðXBUðÂð¡ÄÙXÑJ ìNfòýÿ0“÷×7»Ø6¡cÑ€†¤%¤Ô•6‘AVÇ²Ž¼ŽMöÜ ¸Ç­w;þ@HëØ·»7ŽGmWü*ƒqù dÏ‘n‹ðW¸ò!Wú‡/7bµAÛaˆúCAw©ÜààHp0u¬r¬ac›[(R÷©fÅ}0ð!¿æÙAà ‰¾}k[ž-ºÖy³ï´$Cò§t1ÂnzÔ>=Õ“aF6½ëRu%¼·‚;—¤§WJHÇÕWê”ÿ;cœÑp^uÜtRKæ#C€¡Pšp— °~9”´þ©è$Õz(ÎB=:s”ÏÓ[†rU1+/`•'DCŠa‰1³F­ ÉÊ‘¢_!öŒø7›Sµ0Ç'PKÛ¥UW)PKqy/gfront/FragmentEditor.class…Vùw×þKiô ¶a!˜!Û¨!DmE’Æ(Û‘ ±Á©É⌭AŒ‘gÔÑÈ6d)iÉÚ´ m ;Yœ­mœÀ˜ÄÙº%çäè9ýòKþ€¦÷ÎH¶,6£û–»}ï{÷½7ßýï³/l÷2ö)p—‚[YÜ‚‰Aû„p€CÜ»›Å/Y ³8Èâž(îÅ}2îW°#lú÷4Ö*CŽ{:Ï’‘W°ÆOq8 ƒÛqGl€©ÀB‘g~%ÃV°‰Í6¡ÄÂaQÂÿåx4)c*Bí4Ž2úc,äáC,Vð~F§ËxTÁvüFÆoìÀ <ÆšÇe<ÁæOÊxJA¦Œ§e<#ãY'%„ÑÂÈ![ËKX•×&µédiÊ0óÉÞýÚhAß)!ÈÚ’„õÙü!Û2änOè¦ãôY9½@V 㥢„ØÒƒc¶U(ìÓL޳fdÌÖ5G1õ©‡}G&ØYÂ5ñ­WŒÈPGBèÃ4œÛ(W|ë1©Êzæ°fæõœ„­ñ%¹õIŠ’Ì%gP/ècŽa™]<µ“]W•t§¿\(,ÉF ÊÅ” ú±’Štl èùÅ.‹R ½»±G`2Z.æ’m~'p;:~çþÀâ,žÇ §ð'x§‰­ËÉAÎÜ.—ð²À+xUÆk¯ã ³xSà-œ¡%x Цœä.ËÎévV;j•·ñ-4Càu[`ïRªºUuå Dz·Ü(ÊGô˜¦ng Z©¤—8ù{2Þø ô¡—¸¬xïÙ}ww×@×>Í.qä¿`¯À_™“¿á#Y|,aã"©=œß.=×5=¦y>Á9ópæ˜ LͧøL`ŸËøBàKÖ}…¯%4y±ÊŽQHÑöZ6cû»„æ¥9òº§x—úâ_®]4é/OŒêön˞МÿÆ7—¥e;q{IMýžónQq7/ðÓY,f,³äH¸á*•Êh—к´ª½c“¬9\•QªæÁÃÖÔÛ sˆäÉÕ•ÉnË6ŽQ~­5L½ä×>+†tÛ1Ʀ›xºš¿Ï;oxGjÎ×ihQ›éÄÖâZ‚¾zl7^ÙBÂZ-—»ÌºÛ¯zš«¶k*–ë=cM-³zÔ£„~ÈÐ§Š–MÄÇêp÷VU·‘,wicGò¶U6‰È–Šm%hÁ²wVŽÕEÞä\Zê¼2^ïË`–S oóºu-ÇˬçÑßßÞʹ’bSŒò„éOqV šõ5]Í5Ùü¹>ÍÔòrˆæ…û±Ž¢š{nïè81ëy¬‹×ßÇ~‰ûÊZÀƒ,Ð)4ƒË(j˜“Ö=Kר½¸-^ü²izO ‘ ý¾ÎýÝô¼””RgÁ˜Ô½ëý U߸e˜\„½l²u‡î{ ©d®Hã˜oÚC´.”!ö+»Ñ5­•ÿbo"‡êJzÌœ>íw_ýT\MT4™]¼X:m[;ÊÞ„KLS”’#B ûêÞŽNcñšÈd\)cO·:Þsi§°¦£Ö\x>„¿s ÓÍU쵯Zé{ãV,ÃmøèÛ‚^ïƒ)¯¥‡„dÞÛE÷}7V“=]þPæ! ÏaÙ‰<[‰¹ŠÍiÈ 8™˜CCâçLÌ#4œ8‡àäóS/Üà"Rin.¢•±àÖEcâS,_ò]Á¾á94G3õš]´ø&+]¬ò{j–m.V“ý¶ÖE,Ás-ë\¬Ÿõ`¶âNd+0éÏ0¥ÙÊ úVÐJ|°J%ðÙDáŸÇ†aZÎ5°±jÞ½¾¹tŠHZNíѶoii.®Ç&BÐÚ×Nx6·»¸Žþ[N£±}®wqÃÌ?Ì Ðß~[ÏT<.ðØE"ÒÁ`*ÔMÉjÈE[ÒÞ «a5p“í*-¶#ñÚmiE r1ÅEò,v¨¡TÔëH…Ô*¿Y•S¡†”P£¹³XÑÑò7žÒÌßÏcûpL™ÃMé`,Ø0Ãjd7»HuÄ‚.~z"LVOÍàx:Üð`DÔðÚÕˆ‹Ÿ§¯Ý–Žz0¢ 0„׿F£ÚHcQ£qF´ ƒWPÍ!õs‰oÒ¼;i.ª€YÚ­uh£Ïù8à?ø/~æmÑÉÒm¨|=§ýæÿPKç¬E~ý PKqy/gfront/GFAppConst.class•”mOÚP†ï#ÇÍùRN7÷æTtZtνé¶tZX „"ÙR :,„Ö²oK¶°_²_±ìA9ˆ3Ø/ç\Ï}ŸöÜÏIÏï¿?~ñ1Œ-™#ʱͱÃñ‚cw cxÆ^¯æÔ˜’M˜…¤j*†šÉ©™BZϘ Lc¸sXw=ßrýœUkÙ`9Â0×]b¤’類LfSš™g'Ö™­Yn5jøMÇ­îs¼f˜ÄU“ã ÃbïÃÚ§tFiDžϺa¦”¤z¥˜Ð•£‚’‹‹[î‰Z¬`ÿOɲ4¨i]O²†W¯Ñ•œ¢%¦t†™/ƒyfg/ÇÛKJ7Ç»þ·w²pì–3T>èO)¦àx¥xãÃTWÔR&µ’  üaग़ã:>Y‘õCð°^¶É9Äwîùö©LCÊ:%φíúv³Ñt<Û“[¥²uæxrÍ2­bͦQuýæ9‰ºUfXuÚæŠU"¯SéxœJÇãTô–¯—|Û÷V®5jn×·uÕ×ËÞ×Î št–Ð$ëÙ´yh¿rf9µq,â>DµÒ¬»~4S‹_¢¯7zñÄ.Q)ÔhkN‰´hËkF‹ŽõÜÓFÕnÛûû&ï0lß¹¶=2\ïä=†µ¡º×vFoÔ¿ö6¶oÖAy'Äè¾¹E÷Ñ4pã k…hÄ“˜êq[—ž!žx„ø®Àâ9ƒÄóß8D¼ p˜ˆŽ—æ x Ô—ˆ üˆø±ÀOˆŸ ¼LüLàâU׈#Bîušqlà9›TÙ¥·Ÿµ©ÐO°|@1òA)`äG¥ ‘I£F>,…Œ<—ÂÆwðofüPK4´óŠåPKqy/gfront/FragmentTableModel.classmTßOÓPþ.ëÖR c“¡8À©·¡›¿(NHH`$·Oe»%]kÚÎŒ?Ež|óu¢Ѩ&þQÆs×-̱4iï9çûÎ9÷;÷öÏßo?d‘W1‡«2R2Ò*†QÀ¼Š® c×edäÜPɺ)\·ÜÆaÜUpO|ï+x à¡ŒG24Ã]iòrÃÓ·MÎÀ¶&ʦîºÉ]ýž4u«–,zŽaÕ"ë—¾\^`ˆ?\ܳ¼îåÄB£¾ÍÍí]^öB‹†exK Túƒ”·+ÔÄh{yÛlÔ­v†ñÔZz@í—{½ÍK©-‘%äWc˜MõüM,œÎ#cQÃcÌ2$úBÛ[µVe¥Yæo=öfN » zΫ>ÈqlGÞh˜ÆSñšÑ0s cý]0׬ o2„W “»{®Çë‰m^Ã2ži8É-+hYŸ¦!‰Y ñ¾ ¯²†©>WdmÙ)ï­©4Y«:¶ååV½Vç–÷Rˆ·AµÍ“Ø ®W6-s¯7îS‡A®ÚNA¯SN•&¶Á]W¯q1­ôiÝbƒ¦Aãw»Ó^«P;FÕà%ŸH½éÁû{!<t†ct!$zH]Z)B.0\ÚVü?kªÇ’hEc¡÷E²RÒ ˜Ê!” |…œ þ€R D‡‹%)ªqæS›GG—:¬ ]½!ú¾Žï#‘ùù=& ýF8:rŒÑÒgh"O« Ø€°Œù€pn "¼Qßi{#­NÅ˸ҩ˜¦>EÅéLœzŒKë6z¶¯QEœ Úý-š9k­G 4éÁ_ímK´¾4øPK"ü,q†hPKqy/gfront/GFAction.classmÏJQÆ¿3NN꘺ˆ M-Ò¤ûF bm\û[Þ&ô\/Úkµ¡EÐCEߌÚ"ZÜóçžïwþ|}|¸F§Žq 4#Eh ‚4´&iârëÕý]á‚êMf3+¸¸œ¼è•VsmSõè]fÓÁuw*Gṵ̀‘~öYnŒKr·03ÁÙŽ×k¯ÌÊ–’q¡ãUÒ¿}·ÁiÁ¾ªåšcÕðiéì‹Çÿ¬Öâœç…0N{ ÍØ¼xÌ/f|#‡÷9jÆçÌËqxX6^¸ªsoZÏ ÖárEXÁê¦ÊÙ`œü òßãu+ÃëlOPK—Äì!£PKqy/gfront/GFront$AllRefresh.classuSmoA~*ç"ˆ…jµ–ZTJ_¨Öwkk1&$16ú…lakŽ;r·`ú³L*M4ñ£üQÆY®U)xÉÎËæ™™gfö~þúúÀJ&’˜!Ë&®`.F⪶浕ÕbÁÄ5,È™ˆa6ŠëZßÐâ¦æ ,X1°ÊQmËÏ­3$*­¦ç:ªø²¬Õc†XõÀQm©¬:Á6-ÇR[ ©ü)ÜÒ{†©m·!)…¨+ËuÞH¯ézÙ`˜ÏWöE_Å'U”}IQ¥!dGÛÊ‘ÆG  9Öq‹ã668îà.Ç=Üçx€ 9(e†Ùlá´ŠUåYNëy¯Ù”q ØdW³›x±…§ÏtÌž¹’m¿•MOúmó_‡¿rémÛÂ÷¥Ïü[êõÞ¾¬+†¹‰½T,_IG“çõ0â#õÈד³„]ó¥êu‡¨ Ó¾èËFUÚ”Y6^Xž#:4ÂTåt‡ÔA¼Öë6„’5%öl¥óã(3ÚõÜ®ôÔÃÌÉ–ÊžhuˆìNÃR®GÉÒ#…Ë–-ƒÊ鉴ù öªR¿ÑíJ‡–½2 0vlŒˆD•ÜÐ0òã8 ‰½³”-±@¯= †ótRú¹ž†þBd¥‘!9C^†üi³pVXþ‚Ðç!Š^.cj1ÕÂ!B„wµÖçSœÙ ÌH Œ¢ÇÖ,jëbŽ`¦ÎÀÿ`øñÎ[ÖH'èg+€ýPK();’+»PKqy/gfront/GFront.class•9x\ÅÑ3«»{OO뢳Îö¹!c¤“dgSdY¶e$YX²…l@~Ö=IgŸîŽ+.FBBI!§8Šu$'”tz'„Þ“pü3û®ëùõÙ[fggf§í¼½{?¼m?,aîÇÊr¸Ý5ÓxTŇ§Ó¹™¡ãL†xuœÅýlnæh8×€IöÖy:“j çàÆ NÖ1ƒNOÅõ<êbX·† hǬÅÆM/7›¶™›Ó5<À ÄÏÄ>·poòÊV¦ÞÏ£7«x€›A ‡äÉ6 ·Е:†¸Ö‘Œº#:F¹?KØŽq˜,§f‡†; ˆ0þ.îwss¶ç৘ܧyÏgXÍŸÕðsìÂs¹ù<7_àæ<¿Èý—tü2ãžÏ»¾ÂÍlû ¼/6ð«ø5†}Gß`a¿ÉŠû–ߦUZ¸„w)7—±¾Ã(—ëx…Žßåá•~OǫخÖð¯-Ç=ø}.ÅøCü‘Ž{yòcžüDßpþLÇë4¼Þ€kIhü9þ‚Mq772›t¼ÙÀ}8Â'Né8Ê“[t¼UÇÛtÓñvfw³ßÏÍ/5¼Ó€›±RûXÐ_éøkFðnïÑñ7Ðñ·ŒáÝþ΀ý¬©1¼—Qîãæ~Ðð÷Üçêø ÿhÀFš‰bºÖð/þUÃ5|HÇ5|DÃGŒ¦Ph½5³âC²5¶bÍ!3·âz,Iô‚1„Ymƒ±H8Ѹ2³ú‘Øîî˜euDÖ2¡ú¡mÛÌæ®ÆøÎ`x°1Aë+­3J0n;á†Ù9 1ñŠ«hÞmn e1ôh,µb‰ÝùH1spØ 'ZAbÎHD¿Ïæ;­€ïZfF剭¡¾4¯ª" æF(QLn5éxÓ Ú ¾Âd6NFa ›Çc0^nMXÄ2³ /ZYh O‡ÍCfxÐj‹D¶7…«,uèIq+Dе}Q3A¦˜=^™|°NZ$l™ÅVÖ™ ˜Ñ¾¡H<6‡-·ÚÜ"6]‰Q`YÒV3neÆÑH,€­4ßf”å-†–}ìZž¾A+Ñ7 …ØOØü¶>¯Ùœ'ûº­Ûhã²ÚR~0)£‡Q¬)}è’Rµã‰RÍèëYJÃÖN›nß0G3ySMí„îµ])§>Ñ—ué0»ƒ'»VŸÌî3C¡¾tdVö)H4MF3°i6,Þ6TÂûpP»ð¦ÄÇðq /ÁË^%JZÀ'ðIòªÕ«XT ¯Âk áuxMÂð&…÷D>#á¯ð …Q£Ä§ði„ùŸ˜I|FÂCð0³¤r$<æxŽKLáY /À‹¤€qÙWŸ“ð<)ñoø¼Ä¿ã 9b냃C‰æP°;%ƒþ¢Ä—ðe‰¯à«_Ãg|wŒ¬ ØÒâëH¬Þ@R“{|¦eúoIx ž–ø6¾#ñÜü“›á»þ[â{ø>%áqf·ÌSTÁM á1x\âð:àD‰†)Áÿ ÿ’ø_–ôæý!~”·ÑÜÉv%ª·R€@)„@òë R¡„·àm)Ê„C §piB“BåR¢B Éú›^¸5 &ìï‹IRLS¤˜J²ˆJjæ–bꄇΚ•jE$°bmæîH2¡‰éRÌ3ÉM›IVL ¯˜%q2ûõ3ð¬³Å)æâGRÌ#˜8DTSî*n aÌS(PÒJµÝ¾92< SV üI©EŠâPº'ÌØ°¿QŠ…â0òôeR,‡Óîé–]ýV”‚î’dÜŠ-欤‰)j…OŠ:QŸÖH¾$+’]“¢;þê,›±XŠFq„&Ž”b Ÿç(q´Lj¥RËqZ™•»­«ÓŒCÖáqRÏÈ~ø@Še|¾Š¦îîõ­+ú¸“b¹8!êhjo‘âDqkñd)šÈ'Ä |FÍR¬-šX%ÅjQ-Å&·R´Jt¢KеøŽ&NaH›„s~xÑÎIDC,GHuæÊ"…ØÚ­n¨–h`EIìDM·¤Ïç£ó‡âÕQ:é¦ÚŠÅ"±jKÑ!Ö†Ú”°v%»‚Ãѵ’òíªHlؤíUíííÕ@õš5þáa<^½›þ4Ñ)Å©b=«¦KÝRls XÙÔM ð‹)N½éð±(•fM*Å&8˜Û×Õº©aJç,ê’í4ƒaûÊ‚&¨ùùK…pÚ©vNÛÁ›IÙ )‡jîÊ¡V^7­öW¥·H£k3KüB˜+Ìþ탱H’?‡ÜiÜt¼†Ô¾§än;IäožVS¼WIG,”ÒÖXf€ PlaÛ¿ÖæáÏiD›h$‡Ã6ˆ¹²íZK¥“‰RL9±^cq «¾?éëÚÍ™/¸#È•\¤?ó&瀶þjZ7ýøèħ'àÇ>-¥}òUcRLj”‚"V't‡Úža—˜³óÔiÃÚͰ9˜öË2òðì—aI9‹s5‡lî‚öùuæ¡E‡0»ƒ þ$­ŒYÑ]“ÍCÁP f…m§É¿ªjjÇs´ÑÔ¦frB›K†;"Ãfˆ‹[ÊÏÝ‘L ´É¢.Ø%"¥Ôgµ ¬]ë&.~d‰'·ÆÓ̧ó¥XŠL~¹¾;®j¬Îì“Ø¢RÔKQ*SöôØKÁHc'Á9X&?I¹ÌhÔâø©ÿŸèÙ¥ºzwË*°ÐY¾ÓJ0$õDy"C 5%ø*o-ŠË‚Ëœä´ÎJš¡øÅÀ&*»ò¯õüDà®)‘(¹élê^CõWØÕd*5%\ eBýµëê2c|®]šÇ]ÐêíI•e JŽª(OqN®âG¢™ìO$c¹¡…ÿËÓ’-w§z-œ[œÝŠÞ ½.’ ƒýqE)ï†7‚ñœœžšÚÏKö5ÓJ~O£ÃÁ0UêÊ^øhÝÝü±†çÛ»# e¾÷»í×*e eåé%¼6f"H½Ir¶åMbCWöQ4oa|¢€ÏÇc²U¹Ï£ü/¯i¤=žwÓåØJ…·î'†33¡Q„ONoŠ%#³ ¤dðs‹%ýqJÔŽ6º»c&Ë0+_»]Ün ÁD‹ Š`xGd»ÕFôb¹[^‘\Ÿ «‚"{f>Ý”Ú9zUÁ¾_œÅ²~ᲟKzÃø'D;k¯ ÆâÊ™vñ-T";fsL{l¹*{k·ˆZp hñÏ•ä)MEeØ‚qµpÓøâ눗”zȯnWÇ]%3!6\…g¿%gMHo㸠Ùþa¡£e0îƒûÁ ÀïáðGøxøíøï!xXõÀ£ª Wýð¤êŸ‚§Uÿ <«zú,VýóðwÕ¿/ªþ%xYõ¯¤é¾ ¯©þõtÿ¼©ú·àmÕ¿ÿ VðãšêßUëÈ#ªOõShô>¤ö?„Ô Ô¯ñúÄ_¥8þ¥ Ì‡#ààÆI‹.Ÿ+šÏ­@¹ÏmŒ@…¯òК¾1˜Ô; “G`ŠoLqOMA%Áܽ<…i#PES¡L4œÙKä¼#0‹Æ³«jæŒÀ\Íõ¥`^º?d ª{Õxæ·ñ . ¨ŸU·MÁÂ18Œˆ.j¯w¤àp^¯OA Ѭå]3FÁ7u4ª+KA}ºoàžÐ§çܧàß­p¤€1XÂ[ëˆáQµÔ©ø{œ{àÄËýé|Ưñè³<Ò½9Î禮o: Xë^2Ae—4{®’ä.öÞÏsÌ/|ÄRÚFõO‰3IE>ÁÒ†@‘]:‚ävP¿¶ž×NB~‘ÎßA²}érpÜèkðèË)8Ÿ,ÒcïžeèHïÞIçԨߞöí¯• Ú}õ”"x_GCÃ~G` Qd3¥àBòSÖýù씘¾×A‰„t\Dо<œY.öy]#p;p ¾J“|­‡Lèþ:ÌÂÁO½Ye pÙÊV&n¯gwˆõÔ•-IŸEY“ÝdªbRYÏÂÄzêyëq,uzœuû÷À’:³pK1»ÓHo9ÏIj€Ž¿!-ކº-® +€Ž‹3¶o¯'­œíË8à7ˆ@]ÆÿΠpùf:ç X躾Åb–¹¿Ýåu8ܵNjXŠKöÂíõì2Ÿ—öº/» ¾3 —û·À~WÙRÍ£y{(Ýy4Û‹t)/*?O#iŸËâ$Kሥ†W·íjhgøw^A!P‘‚+ýÒëòÊ|Ï_± šÑøjå¥a™·¼Ë+¼éÚDcÚDRÎ%Š÷¾Êòcp-ëcÏ-ðýqyLÅÒ=tE>W¥}¬•µ/NÁ ìcÃÒ&ÊK{mÛý8?qÿÔÿŒÇ×íÉz©éc4[p ÎO_{mudî-½eîë»zîŸwõ:Ý¿èJÁ u¶G-à=óÂsá»'M´äàßšÒK@µTN.v#ý¿)ƒ2eâÝS³KI\Žì7H/7“¼ûF`³$4E÷ÇH¯{tnéâ©CMoÍLjzOË–ÁX¯ûöQ¸£} ö³ü²£žìt'#Î^B>}W=LÁ¯î¯ —ã` îfô{²¸l¾»z6Åß0–ÓK¬0ÖosXNÆrò½;+Cøw\¬¨\ËŠõ™|EñØã¢å{{T"}>sQý…ÚYäw¨¤û3ͯûïn»û?PKj!K-û1'PKqy/gfront/GFrontConst.class]“ÙrÓ0†š4qJ÷–B€BÙÊÞ°oes¥ˆÚŽÇY¦wÓšLJêtR·Ã³qÁðP ¿âL|â+éûuΑÎ/éï¿ßˆh‹¬<}ÈÓGAyÓuÓ–‚–­#ÿÜ/õü°SªGƒnØÙ4W‘F-¿wôIÐbÛ2w¤Õ¶¥ÓlW•% úœReE5 ú"h…«uW–•idb³Ñ‚jH»­l·æ!a'¥ËýX/'出']T©¤¢=i×Z8 ZYÔwU½!=ƒª‚–øŠ½WQw-L$4ƒ¾¦ªÛ®êJÐÚ„.f]z-]ÿ› âD_¶uL«]ÁÑ Úƒª²Ÿ'H¨ ®ƒø‚öN‹MÅ‘uZŸ4?Ö˵¦3ŒÎ ­2?¹;9Úfì!ˆÝƒAL‰}Óå³£MÛ´:-h6 o:ZËñ¢±iZÎã-$òØ3½dÀÑäèÜ2½Zà;ÛÁít~ úaTÚ­êaøLáXò„kß‚H¹8@P¶Úíäa”±6ñrêø¤?ÐQòW<)xÁI¯{àGÍyÁqÿà :ÝÓ(š¶v1f¼³¿n g3vùõ`p®ƒfUˆàÐïUPŽšÂ¡×©HÊ‚¦õ=Rœgl€ ŒgÀÏ‚çσ/‚—/ƒW¯‚/2^_b|\d|t•ñ5ð:ãëàŒ7À7éÖ˜oƒï0¾ Þd||ŸñðÃTþ£TþãTþ“Tþãø)ãgàçŒ_€_2~~Íø ø-ãwà÷Œ·õ×ýPK²ã™ÏMRPKqy/gfront/GFLSParser.class•Vi[W~ÇL2Ã8¸  Ž"bµC¥mpi@ÀØJ6Ú6ÉÑ0I“‰¨Ý«Ý÷½ÚÝ.t¡-¶ú”Gë'}žþ‡þ€þ‰Ús'„$~hxrî}ß{ιçœ{î%ýûÇuMÈIØ‹˜½{0ÌÄ£LÄœ” à”€„ˆ1 8%Á@RDŠ H ÈHX˜Y§ŒK¨Æ U8ËÄ9¶ü8[~BÀ“ <%ài µx¦‚ijŒyNÀy$lDLÀó"^° /2ñ/‹ð³ÅWD´‹èq@D—ˆnED¼*à5 -,мÎÄ"‰xS¢,ÞbÛ¼Ífï0ï xOÀûä]þ`8ÚÝ qP‚'µÓZsB3FšCf:nŒ´q¨ìHS3ÌA-‘Õ9,õ‡Ãýö(Ð@¨“l£îþ¾Ã ‹¡À±N+mÔôtFøÃÄ)‹¸ž¾ÞðA+Š#ŶLs‘NA8½~¦áŒŽ '2¤‘a-=Miæ(A3)µDWÏç›5ã‰æƒZf´GKQ®‘átÒ09,ægÍÝ]l`K{âFÜÜGq»‹Ö¶ rà;’1*0¢›‡ý,‘j÷¶r2s 5îÒuæIê<3¤§Ì8Už©w$ÇÆ4#Æ¡.šIi㆕X”˜è–2³i=šÌš©,½†ö´C³ú¬v’Ñ¡ÑdʲÒ5RÝZn÷²%q¦´t†Rs¸·Ë'ŠŸËã@û©¨ÌcàŽ. )GðŒe!ãì—d¢½2ú@­³¢Ø†™å°a$úˆ–™š©Ï׋Ã*"­k±³õV̱ünð¡Œp‘‚nL„e\ÂǪ,oñds ¯ÀCÕB üé´v6Ϙ>‘ñ)>#ÿs6íÙáa=­Çúi7’WçToŠZׯòk,öÏ™øBÆ—q_ÉøgA>†©§ÓÙ”©Ç惑ñ Óª.w¢Ìá·2&p^Æwøžâ>^®ÛV–è\¨—× 'Oé)¥ÁÕ3Ç?ÈøQ“,ÜŸðóÂÕÊ_ÜUÅ;å«!ãLɸ‚º>½Ézvåêã™zjá&Çp\ƯøMÆCxXÆULSxó÷(:lÕ¢Ãï;qR2­NœËÅZèÏf|Lg—[7çAÍ¢gÓT^?£qp»Ë”¨Ðâp:9¤g2m‹¶²IËh«‚Ãå°zn»Å§ÞÆ®aÙ–DÕÂR¾=,VdMŒìVi±XÑÛ/C›uûƵ¸Ù•¤2ñë:Ýóàš{3iõmq¾sNÊpåƒòS娖éI¦u«g¨*†~Æ´…n°»Lèeâ(†KK¥töÐyïü8•tÙ‰f2ÏPúiݲ^bŽ'‡-åŠYJÑÿÆ=ô[Xû°î'´„þTø °›p{öî(À „`/áμƒpWn$Ü]€›,ÀÍ„x;áC¸•$=£`Ÿ =Òcjôž’¬ Ý#è'"´ÅÊ Xë™çQ–LÃáá¦Á3áô4LÃuŲ寀m³šò,„ˆç*øˆS¶Ö Ž’?¦åoy®# çMT΢"¢H3Xú§‡Ù5í“÷þ }y²f±EþŸG±ž½.v¤7á$¸ü;ä ë9È—#á•ÊPÄÉbõp½ Þ–õN@ðñÜÔ’V~+"3Xés6æ ø\³¨ŠÌ¢:¢ºfP3ƒU>ArXíUñ\X¦:U1‡5G'nÿ3§ÏEfj+oMUgëZÉEm¤ÆUC•ZϬÉ@¸Šº6Ü@ý4êTaŠjZ‡ÍØJ· q$h4èwâ8ÖZ™Ñ;™Ï‰k$TIãÆYl¤(ïê™Å¦Hƒ²yw÷ÒÆ[.ÁÉMÑd«÷*n•ÏaÛÑżӫxX\ż˫4¨®R^ð*^–q1/z•F–x1_áUšÔŠR^ò*ͪTÊ/õ*ÛÕ¥Œ÷*;fÑBYÝÃüîT6“`žì™4?#í9Ü[êKö*­ªlùškÉGµêÙI£QÚPÔ ·lb—Eä°;Øp NÇdÃUÜwÑžÔ]ß멽†t9ûÖ×^Æfc×·äàóñ*o0ïëU>tÁÁMÜþ›Ÿ,iñG¡Ù ºŽFv•–32^b_Ÿ´C?![q¥à qµ­ÈM±Éºêܶò¹â?PKƒ_ïtÊ PKqy/gfront/GFWHEREParser.class•Vùsuÿl³É¦Ë–#m•H)åJZ¨EM9,= Ҧؖ–€·É6 &›¸Ù@ññ¾oÁû¬jÑ6eìø‹ñŸpüÑB|o³iÓ²3Ž™Éûî;¿ï}ÞÛ—üñÏ/—lGAÆíˆVâ6ÜÏDõb„Ï“8M¨ /ƼHÊ‘q0IIHKÐe¬DTFY J0dÔ '£&“<«O°ú¤„qfNIxHF®$òK•ð˜„Çe¬GTÂ^<)c#N3yŠÉNái&Ïx±‹Ížõb7ç÷œÏËt¾À±^ä§—Xý²„W¼xUÆN÷5¼.á o XÑÙÕÝ~¸g0º¿{ø@W—_Ïqõ„Ú’RõDË€i$õD›€ªŽŒž3UÝRSyM€Ò>8ØÚ …;»Ž,°á¾Î®Þhbôä˜f¡œUtt4™"FRM 8’Ps¬xKÞL¦Z¨¹±^5K×øÔT*:j¨‰´¦›ÑX&¯›„€åK…C3O¨)Ò%fWROš{¸· ;2q¾-¡™‡ÚÐm[Š’r%ƒÚÆkõIîiY3IÅCæ™tZÕãÖGsYõ¤^*4JÂhLÍšyzÎäÍlžr\M×&FŒn¶Ø~}–†ñŒÆÆ2YËKSÉt‹S޹Œ¼.`%ÕÖmCÒQD„j' ªIÑžJ-Ñ1ɇ”eô&xz’9+ÃPù-톡žbM[Ñ¥½¿Ã'ä_y!=®òdR°ìC‡‚Ntp¨"H ö ¨`/“;ÑN–Fe×^ëä¡TJK¨©S5µùf¸®=ehjüTCV5rZ¼xÛ%¼¥àm¼£à]¼G`Xq’™–P_™oµCÁÎ*8‡÷)rÉg_~t”’Ž÷Ó=š!À?L§R¾šš.ê8ë˜|¨à#Tð1>Qð)h€êË*ÑMÍ0òYS‹Ï'£à3¶ªq𸹂/ð˜‚/ñå}Ì© «®’Rª–¬h7˜y@Ó©ÿT†ÐÀ'|o|Ëé~‡!çñ½‚ð£‚.tÓ^gTs¬!™k ¹ß®àîV0ÉMíÇ€‚ øiQ£ÂùôˆftgŒ´j–½,œ1í&Qw~V0…é…‚í¥sÈêÞ¢yãþ–ʳDý4ÊÉ´µS4sž©]ônÛbÂEÔÆµ˜€ÆFÔÊ=™˜–˵-ºÊÒÞ¡«Êú-àúÒu‹¡ß%G¯‘êUqb,©—+ìIêT„KÇ—l¡¾‘ãZÌlÛJëM:©&MB–ŠÊY/±»1âžÒ¦‘ÌŒ5ÊKë-q9ïç5X5¦æz3†fQÎZ5”V¥®›–ˆ2IizÂ#a.?’³<éUâ4fÖe%}»C¹¹;¥.ÑöYKÞE °Ù 9'ÇU‹ßÇO×ÏïIÇßý~ÞF €Jøq‚ÐF\Dâw•ñâw—ñÍDiå?{퓟uÒz´ÎNû¤·ŽhùÒö$"®‰bt® Ì@¸¦QÁÄð‰Óp„ix˜H¬îÂAÛq5\–£2 o$0Ï *'m«ôRX¶ PtÖ“…ô;ªf!G|Ëf \°_9ÑÅèaúŠä-Ó·ïÿEp/ ò.±3ý n‚øð"ªzÜ¿’“‹b¹""§=Ð+„›š Xž€…ÉŠâ,VFf°*èÞV€/è™Eud5?ÕX;ƒë‚’_*àú ×ïƒgËýn¿·€ÕÃWÿž€;è!7ÿNÑzô» X³“BÔEj=µâ Ö²79HS¨/`Ý4L£Þ/Mœ~¬Ã¬@+âHЙ¤?pn°Š¢…h—ó4q§f±ž²ÜÐ;‹‘&ߦܦ‹7Ÿƒ[˜¤‡-AÑ/ºübb¼€­A±Ù`¶ixÞ¬¼ÐÍgQo¹QÎ~—ˆL¡B¼Ÿfbâê_;f®¥i¸¹ÔåA¢b^¡äÝtžæÙÙvm£æ9[°ÝÐÒÓ4‡JËþBÓn:[ÆÔ_Ú¨ûëiî\{ÖÖ}† –®m-àf.jÜ@i­_8ã&®þ¨ã‘ÙýšI:Œ!¸UtòĺÉÙuÞ.bØQ]QR™W¯±Õ+øê9¸+ÎóÃ¥’aGmÃM ìjÛP˜ä‡5­>²Ö+XY‚ïîù/€åá-yÜ‹ûlÀ[pöØXô hwD|·ÌàÖË‹=/bçùEˆìþPK/dû Œ‰ PKqy/gfront/GFWHEREParser2.class…V‡{gÿuÒ•s\ËqÕ)W,pSä&àx$[1¶× ­z–β­œNF¡$-«ÐR–Ëh(à n±åPÑ$Œ6PFÙJÙ{ü„÷=dɾ>èyô~ß÷~ï^ß=ýßÇ/èÀÜâL5úñ¯•ñ:^_Ïà.oðF7äÍݼ{ïÎJ8çF î‘p¯Œ7»Q‹{Üx ÞÊocðv ÇsŸ„w¸ñNÜ/á ïrã:<è†ïfðžj¼ï“ð~7vàŒŒ9^bð7>ˆ1ã‡%<,á¼»ñ‘jHø¨­8#ác2>îF;>Á`žÁ'Ù¨O1ø´Œ&ûŒŒQ ,ó³2>ç&ã?Ïbe<ÊtÉø¯K2–™>'aEÆ7zØ£/âq yf"ë¾Äë2.ʸÄÛË2¾ÌëW$|U@m_ÿ@ÏÑÁ±Ð¡ñÃý#ý<ƒ'Ô;U_\MF}£†KF»Ôô¦’CMÇÔxV ôŒ†Á¾þ[VÁ#}ý£äPtêô´¦¡;:¥ê‰ÐT,NI5HàdFÀ¦ã-Y#÷V3ÓCjšÔHáTBÕ£DÐPvߣëêì`,c…˜Êt]ÜÎJ‡¦t5šÐ’F(œÊ& B@ÀƵH×ͱdÌ8 ÀÑÜrŒ¤ö¦"l_T3†{Æ“}Í-v $5)44¯¿gIîþ™°–6b.:d4£7•H¨Éˆ€¡LZ=,†&DÈPXMYÚ“Sé,™µ…ÔF§ôTÒðY|GÌÎ@(¹¸cˆÇµ¨5TC+e–ìë‰ëš™m2C),z‡„§\Á×|§dRPéú›ü?Uð3fù¹‚_€B÷Kœ°½Ì礡éz6mh‘2—7ÙÕ%[ð+¿æhÖ­«½¢&®`ÍXꤖ¤:"ƒ„&æ~VÁoPð ~ËQû~¯àø#™œ!J?›ü'TÁ…Ù˜nŠeš¨­:L#¦àÏ\.sÈå_ðWPð7,ùÛî†!àUtª‚H瑲ó^:–÷¤wü;j­ôú˜+=5æJ¹Ò›e®·›ëF’AOA•N‡à Ðݺ¡Õ±Œ*ŽV¸ g«° ©5ybÕËp·.™gÆùNyÔ.`aKèK¨’GÍѺV°qÑ¢¢AEæ3Õn¢ª¢µ‘(¤§P“Gí„çšÔ]bm,¿ zŠþ"±ÖÒ?Zbo%³o_ÏÎjÛH'¹°V‚È£Û2óY8QMkþ}x²ÎêŸ@ÍoÛsØt CB°¶›ƒóü¢°XÕ%Z‘ð;÷ä°ÅïÊÃ;‘Çu^r²q[ý’WÊa›_öÊWàšGócØžÇbiòìÌá^™@»r¸ÞëäÆñù«ÏÌÃéw‘Àv‰æÖKá­ï"á»'\ â šY.1HKh)˜¶Œ¯´H1܆]¸×¢ wã­÷â>ÜOvùNZΞ£“Dël­dLÛPímž=+è’bßCp ‹´y‘_ôН˜Ã‹ÅH~±Ý³—7Ž—ÈÊCà›Ãv“löºÌ¢˜XB•x•ÒüÕçÚ=ûØ—ÇÛ‹@/•Á”Uáu,‹Y…ËÊM/)Î:‹ç-ž›Ì¬çðÒÁ¶+p:Ú–àŸãM+íZ¨DÅ…u…Dï™çâ‘X…ø«ªö;8ºDG—³ÁÉÈ‹ Ækƒ³ÓÓÃÍs¨oI»sÛÂÙ*Áq`}Åëý9˜ã¼w6n}òÖªóh>ëÊzYÁ!¦.U‚Ø%žu óWܶ`E)S–yu´r3±%UÅk½tÝh]×rMëys±H˜a^O±æho±…EÞ4vzöåðòË‹ùÉâÎÿDZ×ä¨)rœ¦P2ê³2º«ÀAÙé™ð\Aï¥JÎ è«ÌH5â f-Å«µ÷çÑO1lóÊáp›'`ÂW0Ìá•ãeQ¤X¶Q¡ •ФÐùøPK 0@2A¹PKqy/gfront/GFrontApp.classuR[OAþ¦t»t™"7[´¨€·–õ®PD‘6iõ¡ ú`ÖíÐY¶›îЪÈgSŒ&þ”ñÌ–€ÄºçúïÌ9{~ýþþÀ2^XGÊÄ´…RZ\Òâ²…4f´¸bá*®Y˜Å\󸮭Úº©q·LÜÖ:c"kb!¶&=©Ö†2Ù]†èf«.HØÒcHfÞ•÷íŽwm¯‘¯ª¶ô…ì.Ç&½vËSùm­8rXäX²‰<ÇÜ帇û&p<Ä#9ž`ÅÄ*GkO±Â±®­gxÎ0yÖhë£#|%[džn4v®Ñ†ïSè ýúþp=G"m÷} Ô¡ô–ÁlU•Ÿ…&ÛÆîª|Q/ †™ÓèNÛö›Ò ¶¼Ž¤V!Þ41”[ŽíÌÎþÍ:AüI"(Š=ûÐUU§-„WéЋ҃jûI*Ký'Å0ª eà»ö§Jø»¦Ïvš!–©Aq†a¢¨Éºj†{*1Lü»£Û‡0Ä©â¥& kž#A7ªÏ”JáÍVs£SÕ_L_ É)òÆI3ÒÆÂ1ØQˆã"’'é DIoþ@äÍ1†Ê¹¢5Fåb=˜= ¿Ê-õ7Üů° ·NÎHèprzH|A´BŽˆ2Uº´QÝåPKžG&mþDPKqy/gfront/GFrontCommon$1.classu‘ÙJ1†ÿ´µcÇqk­ŠûR¥VqÔ[Eº ï☶)Ó L‚Ëc nxáøPâÉ x3Â9'üç|ɟϯ÷ëXvá`¸€<Š.JqQÆ¨ÍÆŒ;˜t0Å7m©+ åF«GÊøG‡6Ô£n7RÛ …óeÚÂÈ€Ä;RI³Ë0^MU¯\0äêÑ`ä‘‘:q3Š»â†a¶Úèð[îó;ã‹[A½{‰äÀæÔêÁô‡\3f1ç`ÞÃ=T°D7LAV6Àà+%âzȵša(…\µüÓëŽ Ãt*»!µÔÉ­ÚË—R .¡É¥ òiퟧ'»÷õ$êɾäaÔ"ûJ)Ç4Q s!µ¼ɪ\õʲÿ([ {é”TH:sôñyÓK»hm¥Ø»2´=ôS=@Ù(ÕöÄ­½‚ÕVŸ‘yLTô‡úÑÌÿhʵ'dÞ; gSö†žË_ù„B1ŸÔøPKEÓ·)qˆPKqy/gfront/GFrontCommon.classW‰{Wÿm,iWëmê#J"©Ó¦©,9È)·œ†Æ®Ý*µc›l¤µ½©¼+VO>¸Z -÷Ñrö.g8‹šUˆ ÜW¹¡œ 3»+Yr6ùúEúô®ùͼ™yófž^øß¥ç¼ÿã(Þ®b§yôï„®Ò茌¢ŠJÜ2TÄqZÆ¢ŠnœæÉ’ SÅvœ•qŠ”y²ÌÅ-£¢à]*pdTUìF'+2VUìÁš‚uónïQñ^¼'ïçÝîåæ>n>Çýø Œ©8€Ó àþAn>¬â#ø¨ŠáãÜ|BÆ'|JƧU|©ÆÃ<ú,>Ç£ÏËø‚Š×â‹ ¾ÄóGXÊ£L&QáqO°ÙO*xŠû§e|YÆW$ìšÕWŒYá˜ÖâôBÞªÔM }Y‚–·,Ã+ëÕªQ•°ílIBbò¬¾¢¯e««„Ï»ÃÔËöâ­ŽÓr¢fÙË˺Eø>Ÿ-ë„öéŽ6-S‘Е<)!2f— ÝÕ%{u^w,I¸%u9çå+Ì®1ßœ±&Ž’ÚFR*N8ú²Â.ì¶kæÎç™_uÚŒŸºfa§Ãüv= ?n/ëåÖ»¶¬ÌÙ>XÂäµ»!lë틆wÛiÊß‘ Å©z±hT«û‡‡‡% ¥&ÛÙ;'¸c%m+ØàòŠÏ®[bÉf±]έŽ†Ë .\Ã8&4äqLøKÆW5| _×p3úCXü çðM âúŒneŠxÏz}UdGm§d8“úº]¾…oÄG38Yæwè[œy«jˆ*/WÃ÷ðŒ†ïcCó8¿U©Ñš¶E—pún†=â’ý‡$€é?Ðð.P|t™-:v¹Ìú3† ‹·±¤ÁE&³¤?弋~ˆKø‘†ãy ?a·ý2~¦áçø…„[~´¶°`8¤ßþÖÿ—~…y¿Öðœ—ñ[ ¿Ã ~?–eM;›Ÿ_+a²e× ˜ÕË vC;fßr•Œ?jøþÌfýEÃ_yô7VúïxQÂÞMeó– DU«£ÔÚZÃ?pŒÒˆ±fн\3rdÃ?ñ"ò/ÿÖð£äª¢äñqL7ç$NÛp‚Ì QXBÏææÓgÎE±õP¦=%øP$ôr*›¢¸× ? %!Ç ­Ø–a‰ökë‹ ËHœ´±_)œb`‚BqÒ.ê¬Í £LýŠ1g“¶¡û3Gœ9¼¨—°§ å¯MéYáxÈhÊÏŽ2õþˆy§tgÑ´8•Ln¹S7ÆK¦ÐÏ”É5‘”§eL¯T DH}`Àî+ä"õê¥ÒÑ"Û7iV…aq¼Þض·±B–e;c1J|‰ÁÉö#öóÄ^¶³Nj)d…1¾\ë>IÂ>ß1¹ëŒG ¸G|—5ñ{SW²Û $}luÙÖ¨¡¯:¾*‘tà=\7AÀCÏ+ÝsÈ]uZ}ôŸ¦'—!F_Cd!mº¢5°(;':yï×Éo¾€´ÿô ¾´ÿWø3ÞP`;ã ñí5¶>9UEpýW>ä‰'î;…’©‘Ä?]…šœâjæ™p †®º<Ì«èIÃÁ?8FgØVÚ9~ù÷1ü‰¹õÆ}îgØ_Eœ 2ý~_ ×<æäÁŸb°Šðoxm÷ƒ22¼è§²F)ÛèôhtЛaÁFŸ[ÝÛFE«D…—öùS Q¢ÃiïÜpô)<ÏÆÄdC&ÏÃ3UŒ„FŸá:íU¼NëÎvüò¯I:=n0õ.ÞkàÎ àâŽG«¸!~ÇÈ)Æîµ):o¤y³{´{¶Š·êLã_PK‘©gÿ PKqy/gfront/RightClickDirTree.classVyxWÿ­-yWòúÚØM¦Hq·*.- §-©5¾ˆ8n)fc=ËëHZ±ZÙ(PîZî„«\6P®´±ìÖ4P®Bi ÷Uî£冿ù˜y»’¥Xæ+øûüæÍ¼ßÌ›óiþ÷ýg\Š…Ñ KÅL5°BÄ1) é0‚È0oó.ËÇ/Òà°$§Áeš×pˆé¬†¦s¼Ìór\Å‹ÃhƒÆKps/ÅËÂx9nQñŠ0¶°x ^É˫¸¯Vñš0¶±øV¼–w¯Óðz¦oÐp8Œ7â6>¹]Û˜y³†;øðN oáKÞ&ûoÓ0¦áíÌ¿CÅ;5¼Kà '5¼›uޣὠ{_ïÇ]a|Ôð!>ù°†„±€[xYäå£ìôÇxù¸†»û ¾î“>ÅYø4c>£á”†{Âë½N«XRQP±¬ 0“µ³ ÎïŸ1gÍùhnÎÊ$£×ÛÙ|v@dò= Ô䔓NXŽ‚Í• >»"íaÒÇ$&Hh‘TМ²ÒYÛq'\1ï*h,ñSÖ¼H(¨™!é¦J‹£Žd­ŽlØ:nê÷vÑëú˜ðÑ+c¹W+ØÙQEõø®Ã_¯dÉœt-;3,œ)ÛIóýÛ<QsΊYAZ{%d?ï¥j½¯c[ìËEëðv>'ÖàzšùÞ”5yŒí{ì°#r9f${P¤„™[;ÞŸq…Ãl½ÇÎ[®Hè¸ + Ϋ^ÏÃAmUKA ò²Ì6îÓq£:îǪŽÏâÊBg¤¢,:Æ0ª ¹L,«£ã+âe„—qÜ ãF<Ÿ*V‘â^;¶3*Îèø>¯âA_ÀU|IÇ—ñj« /û¬”è¶íœpt<„¯êøVñuàQ?àhÊ$èˆëƵù©)†~gu|ßRpA,2hGrùÉéÈ‹ØN„ºNLº¶s\Ç·qVÅwt|ßÓñ}œ%“f$c¦E„Š¡¶´r”n2¬ãø¡×g"aÛ?R ÐæÇxLÇOðSaWä\oÑñ3W-ëž*oR¸#4žÞÌ›î4…ÕQi‚³e4÷È7®l´æÌY‘ðŒˆ%‹¨ÀX¶‚-?> Bì‹w&I»Õw¢¼óH¿17mÏ eEfŸe¦lzp7—eŒÆ2kgäç©/E&<‚kѦeGYBöôržšBÌS¦s²t7ðû.ÜAL¥;¥pêÌ,ùBÕèªVäu"o²IOsmOBTe(ëÕ!Cw¶p¬ôšIQ wOÕp×gj½7qnÈ+róðM÷ÿï¦}IÕÔTddC`)#MN>3h§Í¿­&§´çœïs¨U«>] ùlÂtÅ„kåÊVB*±Îy¥…½Ž0©E¼þâ"óâþÿ)WDŸ´3=7>©„Rû6ð/>¹0‘.¿^eïðÈñœüÑ«µó45m¥ž¦[]º[˜<훪ˆ©²Ì¥2ô‰Ð![ââ'U'²×¾áwÙ¢¾:"§&î1ãÔ¾DÚs}¶ÓoOšœQzŠ;âq†t6`eJáèWŽÚ¸A\ò¢j5â2”F+'õQÇJ&…ƒíôÝ×Mß‚C†…¿ ÀôÛ.é!Ÿöé˜Oø”~þ%¥/Z5ú¿ / ;´»Ô]ì\†Ò¹ŠšñeÔ.!@Ûà¸Q· u Zçiú/ D4ÀûÂc ^tê … RØHÂÆ5a“6“°¹ÌTóš© 0Hh” ؽ„M]Kh=%QðB˜^ʃ¡žèÒ*ÚÈ÷óHiS›/ySÄ´žÆù±ÀîÚÙõܽŠ-¼ lòq[¯¬k«;Aèö`ÆÔvµ€‹Nb‡²Šm„Œ0¿½€ÆSh)à©ÆÎÀ .>Åâ§Å89­F‡Ä¬`W,Ôâ‹}UeŸí6ºxà%䙉…»X·=lì,àÞúÞpéØ"÷]Ö`H 5.+àé‹xÄ?i\@Ý"Îøœ±€Ùàè¯5.ω‹W/7®ôch© *픂Úî<“p]òš¢Ê³Š*í{XÀ³Éµ÷ ÖVW@Ï"žãßÞ¼€+Œ=+¸*¬°ru)ê oª©Ì”WÎþ’ñûñf¿³d÷.å’Lˆå«öpíU[½÷Þ…~rÄØWÀ~¿èœyù—³N}Æut³§ÛGxè@¥Ñç+Qòd+ùUC´™ñ¨ç«®'å"R”Û}d›‡lfä¾f÷2ú‹ð©ÿ 8ž,Ád†HV<šÞèÿPKÄ Ý”hPKqy/'gfront/RightClickTable$ExportTask.classVûÕÿÞìc&“²›‡D„n4â2‰„¶#,j5!´K ¯èln6›™uæ.IÔj«±kÛF| Q›*Pwƒô7úùøø×”ž;³6&æÓù|öž{Ï=÷<¾çÜs÷»ÿ~ý €­øVëÇv Ëáq9FlËëw]Çehà’úTO8…Ýy“¦!OÐöúeF{‹ccÜݨ>iqi(MêŸåul“'rä¯-ºY¹qÑ—·²'†Ìß­úÁi[ŒsaeIþ!˶Ä# 'ìÀòx—Æ¹çØ–#„NŸ3Jái9.¸ç™9Z4'·¬VÈ-Ú4&å1)ßWt]n ŸE!„¸=J2¦*Ú.Çæ¾Ä1Ô±¿Öñ+¤u¤°SÇCxXÇ£ø…ŽÇÐËк2^:vã—¤/ë¦S 3x[Ç#òÔ Þ!õ‰nbžÇAï글‹ ÞÓñ>>ÐÑ^}èUð¡ŽKøˆ¡ñ‡&(o¹1>Up\¡ãcÌ24UJïïŸÊò‚°м¥*•°¼„íˆÄ˜S´Guì³¾ÛýEQ( ÒÎÍ ö' k÷÷9b·<[£<6Fü„SàvÂ/© ÊO6THðÑ´½¨[Ág:þ‰9iã_:>Ç:.ãŠ\Òp‡©¸ó–Í·z¼`º¦pÈãK†5Êœ"°\Oø–JT‘‰‘iÁ½':?€„ï;bårÜMˆqÓNXÒ|"7fºþ>CÛ¤%4ÜvйqeÌQM¤mAA ¢]ǼôjÓí,îñÛp(¸¦ã+|­`AÇudÜÐñ 2 í+{G¿Ÿ˜!Ó;AæjzÚ¶¹Û—7={K’?4NRÅFÍBÁ/Ý®äòª_~/ð†äžUvUáT««¶à¦=Á©…2*¨Å y@f#ÈéΚò«aSzü”åe!®ä(]ÊØmî¡¢-¬‰ÊÅ^\´,¹Ø6 ó)NM%™^®“¥&A'bÉ¥ÍDš_‚ßþ‘ã<+VÃ/¶L/U+y[Sß wT=–—ñö†¼pÉ7üž$6’î•)2éZ‚¢WhNKhžÛ91Ní›ì‘ñwÅ4Ãæÿ«üÔ§W LÑ_y‚ÌMš]xzZW._J“™•tlÛFoÀƒ?ÚÓ«SÝÞ¤À–séÔ€Coã×ä*ÛdÄòúL;ËóœÐÑkóGŒ[p$è½ÞAèG ò£íSj¸>}´B©cÓÈd{õé._¾Nö\ŸRÏö)u{¢qÙúIj¯V¡ßöÑz¿? ùœÇŒy0£³„:#¦¢„ÑUBظ¿„ˆÑ.!j´DKPŒ/ùbÆÔÌ<êKÐf¡Œè߬¨ÞNªëˆvU„ã eè¤`Mkãë‚y”æe4XgñÎ˾†C ´°ï…Fô’AÖÖ¡šäÐ|.qäZ3¡øƒ™0é °}]e¬ß7‹X*lÛÍFüÎ6\a))¹‰pWFNç±1žÅ½©H Wuò'c‘2ä˜<»€öÌýeÜ={R‘X×Õ”ÒiSÊèÈôDë.â4É7…/âùÀDc[¸M µPh÷Îb˜xÚ¹é³æ±™Ô•¼2î#º„D`=y [Hb‘7¡2:ã™N.I³ˆB²%zÊ$Tfo¹³ˆ¤T ®õܬ­DO ܰÈ>OiØ[‰]‰«[Æ¥¶©~@=QÊgª¾®'Ú½@H×zhj ¿‡JW|勎ÿôh`šô6]A›Ñ…n´Qá(6á,ÛÄÚÑÆžd9vœè96ÃÎãg~ž‡p¸R+›¦p'YPfÐ(]nL<ÛŒŸ¿pfN.ÎÌUêëHµ2ÐCÕ%Ï´_w ”Ñ3C.KG‚>H®­£ió ªþßÑÅÝHTêˆÉ$ÜDC™ÆËìrEô7ÈTD;*.®¯d;Vk$4ž«”îßiÔˆn§?ÅþPK=(‘¤š PKqy/0gfront/RightClickTable$ExportTimerListener.classUÛRG=‚Ë$ˆµ v†$8BDà\HvB8rÄÅFqb纬FÒÂjGÞ]Îõ;ì‡TÞüœ*"SIUóàñä%•žÕ…›L¬ªÙéî9Ýs¦»gôäß?þð~Ö1ŠDF0¡#‰Il)%Mé˜Æ•ú¼©¤·ÔÂÛ:ÞÁŒú¼« ïéx³juNÇU\ÓðŽ˜Š–ćQÌ+å#!Å‚ŽE,Eq=Š£È(§*ä'JÊ*iYʆ›n1t%Û›b8Ÿ-<é©[v±¤ÛÚÊ™Ž˜eèY¿ï%Øáçl×®1 ÅŸå0~›!’–yÁÐgZ-Ý5á¤Wy†‘xvÓÜ1Sf5H‰Aîó!dQÉäÊq ë¯â5 9ŽOq[ÃgŸãÇ]|©á+ޝ•ò ¾å0vë,Ž<GAYŠ(i°96•²GC™Ã…d8Óà|}IMiY.K—£‚{ĵX»é£;¶¨ ÃÏ`›¡Kxžô4ìpT±KÇËK—Žmºh™®%‘縇ã;|Ïñ$Çø‰!Ñ>Wc‹¡{Î. /kûp…G$ÛZyÆ¥9혾/|†X˜FÇt‹©ÕMa‡á¶™=ˆÐW¥hO…A7-KøÔ SÔ3Ï.oXÀÝ”_µiï5O=òZ–ÔÒ£n:e™6±ýt#S!¡»ûN«}õÆÙM‹áê)$NO(¹•WþD mû a15Û_TUf`DªS¸D°Ër¤/šÉV™ÍIélÙ”ìþ¢DÁÜv‚–íl|<{I4"BTÎyEsò9ó6Åè?a¤¸~ U\Õ¯ëG+‡(„Q·Îé–&²Ûn1(…UÈZ§C÷ {äŽ3÷K²š»Á¼'̰*‡ÉÜXò̲˜=¹ëIK&£°7¼LMF;ºƒG6X­„ˆ©ªÔ¯¸,SÍ¢X°MGRˆ¹Co ]é •“xg_v„*ÙˆH]à‹`E$‹ŸÄ7áémÏ*Y½oö8$Né•¡AÝGÃP/ÍcP¿—ð:é—I ]YôÄc°ÄÄïèø-D1Ä1ÞÀüƒnDh~šØCÇ>:kˆ<Äp]骡û!b eÚüÚZ‰¶zö¡×Ð[×y /´0/.'ÿÆåd }¿`ôOÄîÓ3½Ï4ä½™]Ø…EmøýøÞwü¿÷Þ÷®yûÐwß `£ØX oâáÍ<ܤ  §$¼E§xç­NË+ñ6^¿g7óñ;dã32"Lo‘ñN¦·ÊxÓÛxx7ï‘ð^ËqJÁûp;ï—ð  ªYÊ$>ȳñðaÁ>*ãc2>®àNœUp>!㜌)^'eL3»ó>)ãn32>%ã>»·÷á~ŸVð|VÆçâþy^< á ¶²[ñ _Tð–ñ%_æéWd|UÆ# iü5Y'fgg=³©? _—ñ {ñM¾Å÷e|‡éw%|OA¾Ïà ?ðC½ø‘‚ü˜‡ ~‚Ÿò&ãç¼øÛð—<û•Œ_Ëx”åþFÆo%üNÂï%üA |÷xÜ0­¾pT7; K馀Œmh‰„žPR -qLÀ=7âË;†µQm¼91Ž 5ïë6â#ñN=6Ò&à4Gb˲!|´ô(!Ü„ˆ ÈCƒºÍY (==<ÖÇ:‰É¦ÃŠlF}Ú‘ˆN\ò cÄ輤Ù5?k`Ùº®Mô„‡ŽZí‘pè˜}¹nþA.‰›Æ©'F,lôþê,ÝÙÇüB‹íEÖËÂÙFd½¶… ¸]`} —â ”­?@ê¶:)¢…¬°ëÖÍAÃŒê5‡fmÌjÖGuºµÓ†ìæ¹}U%Sž·c]`Ÿs#¢‘Ä^Ë$ÁmÎNØhÞ&ù|«0%ɳýV/’ÒiŒ$ô !Q^Ûöc­œe7Û„—Eö²GèZbþxwÌÒM^:Ëñ°Å+E …è^]KK‹À–Àj«¿„ zǬ£ºͳ¼’Y^}–— if›˜YÓeêçx^ÅÆU$`©Á¨Šãø£@eîc— è}FªÈJt´ß°ô‹õG—ê÷b‘ž„¥q£¹réÖˆPkÁË(šUKvüA·®c1Á‹”õa÷»œÖt,UNئè3ÃCCº‰Zú)Ô„<A…ÜŒñï1n¹lz,E#)MÑXŠRoeSj¯hÌã¦Ï¦Ô÷Ù”:Að·ÔÉÝ@üo¤ÙÃpÃEô¾†i¸fàéŸFþum3û½ÓP¦PØpŽþ“P‰JŸÅl˜Æá4ü•…¿`!üUsð"û¡´—>zõRG2^ƒ“´ÁGe¡ßà|uÝi¿6z^Ÿ”— zÞ˜$2A:^‚õR yÑAàIPK6 ®×“ VPKqy/1gfront/GFrontCommon$SaveStringOfInputStream.classS[oQþ·…íZ[ oër) Öz¡j"QSCR#FÃãZ°Î’åÐÈ/âÕ&Æ&¾šøêÿQçÒ&ÐÄ—™Û7sæ›ýùûÛw<ÕƵ–q]à q>ÜÔáŦrÞÒ`êŽ3ÊTf*ˆ´Ž-d”‘ÕÓpGÃ=Ï—a½øÑ:´²¶“}Ö©V¹Ë+o¸UánžÁß°oOS–¨eKÒµEmœJ)Y·ÛñÃJ±Vu!³/_(UpšMGPB¨Ô²Î¥}@É»¶°å†-snöt’=ÑêHêÄ­f>ñŽÁWp*œÁëvIS¹‚ÒÂ53æ \Ć5¬3¬Î!Ã…9 Ç1U¾£Ä}Dÿa̬ÀÀ V <@ÌÀC÷‹¤8Oò}ïϯüÅ£#Br¸‹¥.È7JZÅ‚ ˆª>O:o“ÔI/ã6Uá/PK^²³²9PKqy/gfront/FragmentEditor$2.classu‘ÛJÃ@†ÿí!1qÕZ{ÖSµB[Áˆ·oŠ‚RTz+i›¶)q ÉÖÃc UÁ À‡gcE+5°;™É÷ÿÃLÞ?^ßìbÛ„ŽE’–RWÚDYË:ò:V4ÙsƒâC¶Þíø!­cßîÞ8Bµ]9ð« Æåƒ=Gº-Â\áÊC†\é¾Ü`ˆÕm‡!êÝ¥rƒƒ#ÁaÀԱʱ†uŽ tlrl¡Hݧš÷ÀÀO„püšg0$úö­my¶èZç;Ӓ ÉŸÒÅP»éQûôTO†Ùô®;TdHÕ•ðÞ î\’ž^)!MW_©SþïŒ!pFÃyÕqÓI-™Ž †BiÂ]*ÀúåPnÐ4úG¤¢“Të¡8 õDèpÌQ>OoÊUŬ¼€Uvžy )†$ÆÌ´.$+#DFˆ~…Ø3âßlN9PÔŸPKÀª×"W)PK qy/ íAMETA-INF/PKqy/ŠõõÅx†¤'META-INF/MANIFEST.MFPK s„[/íAágfront/PKqy/Éíä7—‘*¤gfront/ChangeLookAndFeel$ClickAction.classPKqy/U,Ǥõgfront/ChangeLookAndFeel.classPKqy/TÀ&ÒØ¤Vgfront/CommandOutput.classPKqy/kÚsöW¤vgfront/DirectoryTreeNode.classPKqy/w ì:ÿœ¤¸ gfront/FileTableModel.classPKqy/rœcɮԤ gfront/ReadOnlyTableModel.classPKqy/Û¥UW)¤û gfront/FragmentEditor$1.classPKqy/ç¬E~ý ¤gfront/FragmentEditor.classPKqy/4´óŠå¤dgfront/GFAppConst.classPKqy/"ü,q†h¤3gfront/FragmentTableModel.classPKqy/rFSqæC¤gfront/GFAction.classPKqy/ñ¡l N¤/gfront/GFront$1.classPKqy/—Äì!£¤Àgfront/GFront$2.classPKqy/();’+»¤$gfront/GFront$AllRefresh.classPKqy/j!K-û1'¤›!gfront/GFront.classPKqy/²ã™ÏMR¤×4gfront/GFrontConst.classPKqy/ƒ_ïtÊ ¤j7gfront/GFLSParser.classPKqy//dû Œ‰ ¤#>gfront/GFWHEREParser.classPKqy/ 0@2A¹¤÷Dgfront/GFWHEREParser2.classPKqy/žG&mþD¤Mgfront/GFrontApp.classPKqy/EÓ·)qˆ¤ÃOgfront/GFrontCommon$1.classPKqy/§ò{¤}Qgfront/GFrontCommon.classPKqy/‘©gÿ ¤¶Xgfront/GfhostList.classPKqy/Ä Ý”h¤ú\gfront/RightClickDirTree.classPKqy/=(‘¤š '¤Údgfront/RightClickTable$ExportTask.classPKqy/qCКÇR0¤Ékgfront/RightClickTable$ExportTimerListener.classPKqy/6 ®×“ V¤îogfront/RightClickTable.classPKqy/^²³²91¤Ëygfront/GFrontCommon$SaveStringOfInputStream.classPKqy/Àª×"W)¤c|gfront/FragmentEditor$2.classPK ~gfarm-2.4.1/util/ptool/0000755000000000000000000000000011507222730013421 5ustar rootrootgfarm-2.4.1/util/ptool/gfarm-prun0000755000000000000000000000164611507222727015442 0ustar rootroot#! /bin/sh -f # # $Id: gfarm-prun 2373 2006-01-12 00:54:22Z soda $ program=gfarm-prun MIN_ARGS=1 usage() { echo "usage: $program [ -h hostfile ] [ -stdin file ] [ -rsh rsh_command ] [ -p ] [ -a ] [ -n ]" echo " cmd args ..." echo "" echo "options:" echo " -h hostfile" echo " specifies a hostfile. '-' for the standard input" echo " ($PRUN_DEFAULT_HOSTFILE)" echo " -stdin file" echo " specifies a stdin file. It can be specified multiple times." echo " '-' for the standard input" echo " -rsh rsh_command" echo " specifies a remote shell command. ($PRUN_DEFAULT_RSH)" echo " -p execute in the background in parallel." echo " -a execute on all nodes listed in the hostfile including myself." echo " -n print the commands that would be executed, but do not execute them." exit 1 } . gfarm-ptool exit 0 gfarm-2.4.1/util/ptool/Makefile0000644000000000000000000000032111507222727015063 0ustar rootroottop_builddir = ../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk SCRIPTS= $(srcdir)/gfarm-ptool $(srcdir)/gfarm-prun $(srcdir)/gfarm-pcp include $(top_srcdir)/makes/script.mk gfarm-2.4.1/util/ptool/gfarm-pcp0000755000000000000000000000156111507222727015234 0ustar rootroot#! /bin/sh -f # # $Id: gfarm-pcp 2373 2006-01-12 00:54:22Z soda $ program=gfarm-pcp MIN_ARGS=2 usage() { echo "usage: $program [ -h hostfile ] [ -rcp rcp_command ] [ -a ] [ -v ] [ -n ]" echo " filename1 filename2" echo " $program [ -h hostfile ] [ -rcp rcp_command ] [ -a ] [ -v ] [ -n ]" echo " filename ... directory" echo "" echo "options:" echo " -h hostfile" echo " specifies a hostfile. '-' for the standard input" echo " ($PRUN_DEFAULT_HOSTFILE)" echo " -rcp rcp_command" echo " specifies a remote copy command. ($PRUN_DEFAULT_RCP)" echo " -a execute on all nodes listed in the hostfile including myself." echo " -v print hostname before copying." echo " -n print the commands that would be executed, but do not execute them." exit 1 } . gfarm-ptool exit 0 gfarm-2.4.1/util/ptool/gfarm-ptool0000755000000000000000000000530511507222727015607 0ustar rootroot#! /bin/sh -f # # $Id: gfarm-ptool 4677 2010-05-17 16:12:46Z tatebe $ if [ X$program = X ]; then echo gfarm-ptool cannot be executed directly exit 1 fi PRUN_DEFAULT_RSH="ssh" PRUN_DEFAULT_RCP="scp -pr" PRUN_DEFAULT_HOSTFILE=$HOME/.nodelist PRUN_DEFAULT_HOSTNAME=`hostname` [ "X$PRUN_RCP" = X ] && PRUN_RCP=$PRUN_DEFAULT_RCP [ "X$PRUN_RSH" = X ] && PRUN_RSH=$PRUN_DEFAULT_RSH [ "X$PRUN_HOSTFILE" = X ] && PRUN_HOSTFILE=$PRUN_DEFAULT_HOSTFILE [ "X$PRUN_HOSTNAME" = X ] && PRUN_HOSTNAME=$PRUN_DEFAULT_HOSTNAME [ "X$PRUN_PARALLEL" = X ] && PRUN_PARALLEL=no [ "X$PRUN_ALL_INCLUDE_MYSELF" = X ] && PRUN_ALL_INCLUDE_MYSELF=no [ "X$PRUN_VERBOSE" = X ] && PRUN_VERBOSE=no PRUN_STDIN= while [ $# -gt 0 ]; do case $1 in -h) shift; PRUN_HOSTFILE=$1 ;; -rsh) shift; PRUN_RSH=$1 ;; -rcp) shift; PRUN_RCP=$1 ;; -stdin) shift; PRUN_STDIN="$PRUN_STDIN $1" ;; -p) PRUN_PARALLEL=yes ;; -a) PRUN_ALL_INCLUDE_MYSELF=yes ;; -v) PRUN_VERBOSE=yes ;; -n) ECHO=echo ;; -*) echo "unknown option: $1" usage ;; *) break ;; esac shift done if [ $# -lt 0$MIN_ARGS ]; then usage fi hostfile=$PRUN_HOSTFILE if [ "X$hostfile" = X ]; then echo Hostfile should be specified. usage fi if [ X$hostfile = X- ]; then hostfile=/tmp/$program-host-$$ cat > $hostfile REMOVE_HOSTFILE=1 fi if [ ! -f $hostfile ]; then echo $hostfile: no such hostfile exit 1 fi if [ "X$PRUN_STDIN" != X ]; then for f in $PRUN_STDIN; do if [ X$f = X- ]; then if [ X$REMOVE_HOSTFILE != X -o X$REMOVE_STDIN_FILE != X ]; then echo \'-\' should not be specified more than once exit 1 fi f=/tmp/$program-stdin-$$ cat > $f REMOVE_STDIN_FILE=$f fi if [ ! -f $f ]; then echo $f: no such stdin file exit 1 fi prun_stdin="$prun_stdin $f" done fi PRUN_STDIN=$prun_stdin case $program in gfarm-prun) CMD="$ECHO $PRUN_RSH" [ "X$PRUN_STDIN" = X ] && CMD="$CMD -n" ARG="$*" ;; gfarm-pcp) rcpargs= while [ $# -gt 1 ]; do rcpargs="$rcpargs $1" shift done CMD="$ECHO $PRUN_RCP $rcpargs" HOSTSUF=:$1 ;; *) echo unknown program: $program exit 1 esac MESSAGE=true if [ "X$PRUN_PARALLEL" != Xyes -a "X$PRUN_VERBOSE" = Xyes ]; then MESSAGE=echo fi for host in `sed -e 's/#.*//' -e '/^[ ]*$/d' $hostfile`; do [ "X$host" = X$PRUN_HOSTNAME -a "X$PRUN_ALL_INCLUDE_MYSELF" != Xyes ] && continue $MESSAGE $host case $PRUN_PARALLEL$PRUN_STDIN in no) $CMD $host$HOSTSUF $ARG ;; no*) cat $PRUN_STDIN | $CMD $host$HOSTSUF $ARG ;; yes) $CMD $host$HOSTSUF $ARG & ;; yes*) cat $PRUN_STDIN | $CMD $host$HOSTSUF $ARG & ;; esac done wait [ X$REMOVE_HOSTFILE != X ] && rm -f $hostfile [ X$REMOVE_STDIN_FILE != X ] && rm -f $REMOVE_STDIN_FILE exit 0 gfarm-2.4.1/server/0000755000000000000000000000000011507222730012615 5ustar rootrootgfarm-2.4.1/server/Makefile.inc0000644000000000000000000000002411507222724015024 0ustar rootrootbindir = $(sbindir) gfarm-2.4.1/server/gfmd/0000755000000000000000000000000011507222730013532 5ustar rootrootgfarm-2.4.1/server/gfmd/peer.c0000644000000000000000000007622111507222724014644 0ustar rootroot/* * $Id: peer.c 4457 2010-02-23 01:53:23Z ookuma$ */ #include #include #include #include #include #include #include #include #include #include #include /* for sig_atomic_t */ #ifdef HAVE_EPOLL #include #else #include #endif #include #include #include #include #include "gfutil.h" #include "thrsubr.h" #include "gfp_xdr.h" #include "io_fd.h" #include "auth.h" #include "config.h" /* gfarm_simultaneous_replication_receivers */ #include "subr.h" #include "thrpool.h" #include "user.h" #include "host.h" #include "peer.h" #include "inode.h" #include "process.h" #include "job.h" #include "protocol_state.h" struct peer_closing_queue { pthread_mutex_t mutex; pthread_cond_t ready_to_close; struct peer *head, **tail; } peer_closing_queue = { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, NULL, &peer_closing_queue.head }; struct peer { struct peer *next_close; int refcount; struct gfp_xdr *conn; gfp_xdr_async_peer_t async; /* used by back_channel only */ enum gfarm_auth_id_type id_type; char *username, *hostname; struct user *user; struct host *host; struct process *process; int protocol_error; void *(*protocol_handler)(void *); struct thread_pool *handler_thread_pool; volatile sig_atomic_t control; #define PEER_WATCHING 1 #define PEER_INVOKING 2 /* block peer_free till protocol_handler is called */ #define PEER_CLOSING 4 /* prevent protocol_handler from being called */ pthread_mutex_t control_mutex; struct protocol_state pstate; gfarm_int32_t fd_current, fd_saved; int flags; #define PEER_FLAGS_FD_CURRENT_EXTERNALIZED 1 #define PEER_FLAGS_FD_SAVED_EXTERNALIZED 2 void *findxmlattrctx; /* only one pending GFM_PROTO_GENERATION_UPDATED per peer is allowed */ struct inode *pending_new_generation; union { struct { /* only used by "gfrun" client */ struct job_table_entry *jobs; } client; } u; /* the followings are only used for gfsd back channel */ pthread_mutex_t replication_mutex; int simultaneous_replication_receivers; struct file_replicating replicating_inodes; /* dummy header */ }; static struct peer *peer_table; static int peer_table_size; static pthread_mutex_t peer_table_mutex = PTHREAD_MUTEX_INITIALIZER; static const char peer_table_diag[] = "peer_table"; #ifdef HAVE_EPOLL struct { int fd; struct epoll_event *events; int nevents; } peer_epoll; #else static struct pollfd *peer_poll_fds; #endif static struct thread_pool *peer_default_thread_pool; static void *(*peer_default_protocol_handler)(void *); static void (*peer_async_free)(struct peer *, gfp_xdr_async_peer_t) = NULL; void peer_set_free_async(void (*async_free)(struct peer *, gfp_xdr_async_peer_t)) { peer_async_free = async_free; } void file_replicating_set_handle(struct file_replicating *fr, gfarm_int64_t handle) { fr->handle = handle; } gfarm_int64_t file_replicating_get_handle(struct file_replicating *fr) { return (fr->handle); } struct peer * file_replicating_get_peer(struct file_replicating *fr) { return (fr->peer); } /* only host_replicating_new() is allowed to call this routine */ gfarm_error_t peer_replicating_new(struct peer *peer, struct host *dst, struct file_replicating **frp) { struct file_replicating *fr; static const char diag[] = "peer_replicating_new"; static const char replication_diag[] = "replication"; GFARM_MALLOC(fr); if (fr == NULL) return (GFARM_ERR_NO_MEMORY); fr->peer = peer; fr->dst = dst; fr->handle = -1; /* the followings should be initialized by inode_replicating() */ fr->prev_host = fr; fr->next_host = fr; gfarm_mutex_lock(&peer->replication_mutex, diag, replication_diag); if (peer->simultaneous_replication_receivers >= gfarm_simultaneous_replication_receivers) { free(fr); fr = NULL; } else { ++peer->simultaneous_replication_receivers; fr->prev_inode = &peer->replicating_inodes; fr->next_inode = peer->replicating_inodes.next_inode; peer->replicating_inodes.next_inode = fr; fr->next_inode->prev_inode = fr; } gfarm_mutex_unlock(&peer->replication_mutex, diag, replication_diag); if (fr == NULL) return (GFARM_ERR_RESOURCE_TEMPORARILY_UNAVAILABLE); *frp = fr; return (GFARM_ERR_NO_ERROR); } /* only file_replicating_free() is allowed to call this routine */ void peer_replicating_free(struct file_replicating *fr) { struct peer *peer = fr->peer; static const char diag[] = "peer_replicating_free"; static const char replication_diag[] = "replication"; gfarm_mutex_lock(&peer->replication_mutex, diag, replication_diag); --peer->simultaneous_replication_receivers; fr->prev_inode->next_inode = fr->next_inode; fr->next_inode->prev_inode = fr->prev_inode; gfarm_mutex_unlock(&peer->replication_mutex, diag, replication_diag); free(fr); } gfarm_error_t peer_replicated(struct peer *peer, struct host *host, gfarm_ino_t ino, gfarm_int64_t gen, gfarm_int64_t handle, gfarm_int32_t src_errcode, gfarm_int32_t dst_errcode, gfarm_off_t size) { gfarm_error_t e; struct file_replicating *fr; static const char diag[] = "peer_replicated"; static const char replication_diag[] = "replication"; gfarm_mutex_lock(&peer->replication_mutex, diag, replication_diag); if (handle == -1) { for (fr = peer->replicating_inodes.next_inode; fr != &peer->replicating_inodes; fr = fr->next_inode) { if (fr->igen == gen && inode_get_number(fr->inode) == ino) break; } } else { for (fr = peer->replicating_inodes.next_inode; fr != &peer->replicating_inodes; fr = fr->next_inode) { if (fr->handle == handle && fr->igen == gen && inode_get_number(fr->inode) == ino) break; } } if (fr == &peer->replicating_inodes) e = GFARM_ERR_NO_SUCH_OBJECT; else e = GFARM_ERR_NO_ERROR; gfarm_mutex_unlock(&peer->replication_mutex, diag, replication_diag); if (e == GFARM_ERR_NO_ERROR) e = inode_replicated(fr, src_errcode, dst_errcode, size); else gflog_error(GFARM_MSG_1002410, "orphan replication (%s, %lld:%lld): s=%d d=%d size:%lld " "maybe the connection had a problem?", host_name(host), (long long)ino, (long long)gen, src_errcode, dst_errcode, (long long)size); return (e); } static void peer_replicating_free_all(struct peer *peer) { gfarm_error_t e; struct file_replicating *fr; static const char diag[] = "peer_replicating_free_all"; gfarm_mutex_lock(&peer->replication_mutex, diag, "loop"); while ((fr = peer->replicating_inodes.next_inode) != &peer->replicating_inodes) { gfarm_mutex_unlock(&peer->replication_mutex, diag, "settle"); e = inode_replicated(fr, GFARM_ERR_NO_ERROR, GFARM_ERR_CONNECTION_ABORTED, -1); /* assert(e == GFARM_ERR_INVALID_FILE_REPLICA); */ gfarm_mutex_lock(&peer->replication_mutex, diag, "settle"); } gfarm_mutex_unlock(&peer->replication_mutex, diag, "loop"); } #ifdef HAVE_EPOLL static void peer_epoll_ctl_fd(int op, int fd) { struct epoll_event ev = { 0, { 0 }}; ev.data.fd = fd; ev.events = EPOLLIN; /* level triggered, since we use blocking mode */ if (epoll_ctl(peer_epoll.fd, op, fd, &ev) == -1) { if (op == EPOLL_CTL_DEL) { /* * this is expected. see the comment in peer_watcher() * about calling peer_epoll_del_fd() and * https://sourceforge.net/apps/trac/gfarm/ticket/80 * https://sourceforge.net/apps/trac/gfarm/ticket/113 */ gflog_info(GFARM_MSG_1002426, "epoll_ctl(%d, %d, %d): " "probably called against a closed file: %s", peer_epoll.fd, op, fd, strerror(errno)); } else { gflog_fatal(GFARM_MSG_1002427, "epoll_ctl(%d, %d, %d): %s\n", peer_epoll.fd, op, fd, strerror(errno)); } } } static void peer_epoll_add_fd(int fd) { peer_epoll_ctl_fd(EPOLL_CTL_ADD, fd); } static void peer_epoll_del_fd(int fd) { peer_epoll_ctl_fd(EPOLL_CTL_DEL, fd); } #endif #define PEER_WATCH_INTERVAL 10 /* 10ms: XXX FIXME */ void * peer_watcher(void *arg) { struct peer *peer; int i, rv, skip, nfds; #ifdef HAVE_EPOLL int efd; #else struct pollfd *fd; #endif static const char diag[] = "peer_watcher"; for (;;) { #ifdef HAVE_EPOLL rv = nfds = epoll_wait(peer_epoll.fd, peer_epoll.events, peer_epoll.nevents, PEER_WATCH_INTERVAL); #else nfds = 0; gfarm_mutex_lock(&peer_table_mutex, diag, peer_table_diag); for (i = 0; i < peer_table_size; i++) { peer = &peer_table[i]; gfarm_mutex_lock(&peer->control_mutex, "peer_watcher start", "peer:control_mutex"); skip = peer->conn == NULL || (peer->control & PEER_WATCHING) == 0 || (peer->control & PEER_CLOSING); gfarm_mutex_unlock(&peer->control_mutex, "peer_watcher start", "peer:control_mutex"); if (skip) continue; fd = &peer_poll_fds[nfds++]; fd->fd = i; fd->events = POLLIN; fd->revents = 0; } gfarm_mutex_unlock(&peer_table_mutex, diag, peer_table_diag); rv = poll(peer_poll_fds, nfds, PEER_WATCH_INTERVAL); #endif if (rv == -1 && errno == EINTR) continue; if (rv == -1) #ifdef HAVE_EPOLL gflog_fatal(GFARM_MSG_1000276, "peer_watcher: epoll_wait: %s\n", strerror(errno)); #else gflog_fatal(GFARM_MSG_1000277, "peer_watcher: poll: %s\n", strerror(errno)); #endif for (i = 0; i < nfds; i++) { #ifdef HAVE_EPOLL efd = peer_epoll.events[i].data.fd; peer = &peer_table[efd]; #else if (rv == 0) break; /* all processed */ fd = &peer_poll_fds[i]; peer = &peer_table[fd->fd]; #endif giant_lock(); gfarm_mutex_lock(&peer_table_mutex, diag, peer_table_diag); /* * don't use peer_control_mutex_lock(), because * collision with peer_watch_access() is expected here. */ gfarm_mutex_lock(&peer->control_mutex, "peer_watcher checking", "peer:control_mutex"); #ifdef HAVE_EPOLL if ((peer_epoll.events[i].events & EPOLLIN) == 0) #else if ((fd->revents & POLLIN) == 0) #endif { skip = 1; } else { #ifdef HAVE_EPOLL /* efd may be closed during epoll */ peer_epoll_del_fd(efd); #endif rv--; if (peer->conn == NULL || (peer->control & PEER_WATCHING) == 0) { skip = 1; gflog_debug(GFARM_MSG_1002323, "peer_watcher: fd:%d must be " "closed during (e)poll: %p, 0x%x", peer_get_fd(peer), peer->conn, (int)peer->control); } else if (peer->control & PEER_CLOSING) { skip = 1; peer->control &= ~PEER_WATCHING; gflog_debug(GFARM_MSG_1002428, "peer_watcher: fd:%d will be " "closed and input will be ignored", peer_get_fd(peer)); } else { skip = 0; peer->control &= ~PEER_WATCHING; /* * needs peer_table_mutex here * to protect this from peer_free() */ peer->control |= PEER_INVOKING; } } gfarm_mutex_unlock(&peer->control_mutex, "peer_watcher checking", "peer:control_mutex"); gfarm_mutex_unlock(&peer_table_mutex, diag, peer_table_diag); giant_unlock(); if (!skip) { /* * We shouldn't have giant_lock or * peer_table_mutex here. */ thrpool_add_job(peer->handler_thread_pool, peer->protocol_handler, peer); } } } } void peer_add_ref(struct peer *peer) { static const char diag[] = "peer_add_ref"; gfarm_mutex_lock(&peer_closing_queue.mutex, diag, "peer_closing_queue"); ++peer->refcount; gfarm_mutex_unlock(&peer_closing_queue.mutex, diag, "peer_closing_queue"); } int peer_del_ref(struct peer *peer) { int referenced; static const char diag[] = "peer_del_ref"; gfarm_mutex_lock(&peer_closing_queue.mutex, diag, "peer_closing_queue"); if (--peer->refcount > 0) { referenced = 1; } else { referenced = 0; gfarm_cond_signal(&peer_closing_queue.ready_to_close, diag, "ready to close"); } gfarm_mutex_unlock(&peer_closing_queue.mutex, diag, "peer_closing_queue"); return (referenced); } void * peer_closer(void *arg) { struct peer *peer, **prev; int do_close; static const char diag[] = "peer_closer"; gfarm_mutex_lock(&peer_closing_queue.mutex, diag, "peer_closing_queue"); for (;;) { while (peer_closing_queue.head == NULL) gfarm_cond_wait(&peer_closing_queue.ready_to_close, &peer_closing_queue.mutex, diag, "queue is not empty"); for (prev = &peer_closing_queue.head; (peer = *prev) != NULL; prev = &peer->next_close) { if (peer->refcount == 0) { gfarm_mutex_lock(&peer->control_mutex, diag, "peer:control_mutex"); if ((peer->control & PEER_INVOKING) == 0) { peer->control |= PEER_CLOSING; do_close = 1; } else { do_close = 0; } gfarm_mutex_unlock(&peer->control_mutex, diag, "peer:control_mutex"); if (do_close) { *prev = peer->next_close; if (peer_closing_queue.tail == &peer->next_close) peer_closing_queue.tail = prev; break; } } } if (peer == NULL) { gfarm_cond_wait(&peer_closing_queue.ready_to_close, &peer_closing_queue.mutex, diag, "waiting for host_sender/receiver_unlock"); continue; } gfarm_mutex_unlock(&peer_closing_queue.mutex, diag, "before giant"); giant_lock(); /* * NOTE: this shouldn't need db_begin()/db_end() * at least for now, * because only externalized descriptor needs the calls. */ peer_free(peer); giant_unlock(); gfarm_mutex_lock(&peer_closing_queue.mutex, diag, "after giant"); } gfarm_mutex_unlock(&peer_closing_queue.mutex, diag, "peer_closing_queue"); } void peer_free_request(struct peer *peer) { int fd = peer_get_fd(peer), rv; static const char diag[] = "peer_free_request"; gfarm_mutex_lock(&peer_closing_queue.mutex, diag, "peer_closing_queue"); /* * wake up threads which may be sleeping at read() or write(), because * they may be holding host_sender_lock() or host_receiver_lock(), but * without closing the descriptor, because that leads race condition. */ rv = shutdown(fd, SHUT_RDWR); if (rv == -1) gflog_warning(GFARM_MSG_1002220, "back_channel: shutdown(%d): %s", fd, strerror(errno)); *peer_closing_queue.tail = peer; peer->next_close = NULL; peer_closing_queue.tail = &peer->next_close; gfarm_mutex_unlock(&peer_closing_queue.mutex, diag, "peer_closing_queue"); } void peer_init(int max_peers, struct thread_pool *thrpool, void *(*protocol_handler)(void *)) { int i; struct peer *peer; gfarm_error_t e; GFARM_MALLOC_ARRAY(peer_table, max_peers); if (peer_table == NULL) gflog_fatal(GFARM_MSG_1000278, "peer table: %s", strerror(ENOMEM)); peer_table_size = max_peers; for (i = 0; i < peer_table_size; i++) { peer = &peer_table[i]; peer->next_close = NULL; peer->refcount = 0; peer->conn = NULL; peer->async = NULL; peer->username = NULL; peer->hostname = NULL; peer->user = NULL; peer->host = NULL; peer->process = NULL; peer->protocol_error = 0; peer->control = 0; gfarm_mutex_init(&peer->control_mutex, "peer_init", "peer:control_mutex"); peer->fd_current = -1; peer->fd_saved = -1; peer->flags = 0; peer->findxmlattrctx = NULL; peer->pending_new_generation = NULL; peer->u.client.jobs = NULL; gfarm_mutex_init(&peer->replication_mutex, "peer_init", "replication"); peer->simultaneous_replication_receivers = 0; /* make circular list `replicating_inodes' empty */ peer->replicating_inodes.prev_inode = peer->replicating_inodes.next_inode = &peer->replicating_inodes; } #ifdef HAVE_EPOLL peer_epoll.fd = epoll_create(max_peers); if (peer_epoll.fd == -1) gflog_fatal(GFARM_MSG_1000279, "epoll_create: %s\n", strerror(errno)); GFARM_MALLOC_ARRAY(peer_epoll.events, max_peers); if (peer_epoll.events == NULL) gflog_fatal(GFARM_MSG_1000280, "peer epoll event table: %s", strerror(ENOMEM)); peer_epoll.nevents = max_peers; #else GFARM_MALLOC_ARRAY(peer_poll_fds, max_peers); if (peer_poll_fds == NULL) gflog_fatal(GFARM_MSG_1000281, "peer pollfd table: %s", strerror(ENOMEM)); #endif peer_default_protocol_handler = protocol_handler; peer_default_thread_pool = thrpool; e = create_detached_thread(peer_watcher, NULL); if (e != GFARM_ERR_NO_ERROR) gflog_fatal(GFARM_MSG_1000282, "create_detached_thread(peer_watcher): %s", gfarm_error_string(e)); e = create_detached_thread(peer_closer, NULL); if (e != GFARM_ERR_NO_ERROR) gflog_fatal(GFARM_MSG_1000282, "create_detached_thread(peer_closer): %s", gfarm_error_string(e)); } gfarm_error_t peer_alloc(int fd, struct peer **peerp) { gfarm_error_t e; struct peer *peer; int sockopt; static const char diag[] = "peer_alloc"; if (fd < 0) { gflog_debug(GFARM_MSG_1001580, "invalid argument 'fd'"); return (GFARM_ERR_INVALID_ARGUMENT); } if (fd >= peer_table_size) { gflog_debug(GFARM_MSG_1001581, "too many open files: fd >= peer_table_size"); return (GFARM_ERR_TOO_MANY_OPEN_FILES); } gfarm_mutex_lock(&peer_table_mutex, diag, peer_table_diag); peer = &peer_table[fd]; if (peer->conn != NULL) { /* must be an implementation error */ gfarm_mutex_unlock(&peer_table_mutex, diag, peer_table_diag); gflog_debug(GFARM_MSG_1001582, "bad file descriptor: conn is NULL"); return (GFARM_ERR_BAD_FILE_DESCRIPTOR); } peer->next_close = NULL; peer->refcount = 0; /* XXX FIXME gfp_xdr requires too much memory */ e = gfp_xdr_new_socket(fd, &peer->conn); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001583, "gfp_xdr_new_socket() failed: %s", gfarm_error_string(e)); gfarm_mutex_unlock(&peer_table_mutex, diag, peer_table_diag); return (e); } peer->async = NULL; /* synchronous protocol by default */ peer->username = NULL; peer->hostname = NULL; peer->user = NULL; peer->host = NULL; peer->process = NULL; peer->protocol_error = 0; peer->protocol_handler = peer_default_protocol_handler; peer->handler_thread_pool = peer_default_thread_pool; peer->control = 0; peer->fd_current = -1; peer->fd_saved = -1; peer->flags = 0; peer->findxmlattrctx = NULL; peer->u.client.jobs = NULL; /* deal with reboots or network problems */ sockopt = 1; if (setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, &sockopt, sizeof(sockopt)) == -1) gflog_warning_errno(GFARM_MSG_1000283, "SO_KEEPALIVE"); *peerp = peer; gfarm_mutex_unlock(&peer_table_mutex, diag, peer_table_diag); return (GFARM_ERR_NO_ERROR); } /* caller should allocate the storage for username and hostname */ void peer_authorized(struct peer *peer, enum gfarm_auth_id_type id_type, char *username, char *hostname, struct sockaddr *addr, enum gfarm_auth_method auth_method) { peer->id_type = id_type; if (id_type == GFARM_AUTH_ID_TYPE_USER) { peer->user = user_lookup(username); if (user_is_active(peer->user)) { free(username); peer->username = NULL; } else { peer->username = username; } } else { peer->user = NULL; peer->username = username; } peer->host = host_addr_lookup(hostname, addr); if (peer->host != NULL) { free(hostname); peer->hostname = NULL; } else { peer->hostname = hostname; } if (id_type == GFARM_AUTH_ID_TYPE_SPOOL_HOST) { if (peer->host == NULL) gflog_warning(GFARM_MSG_1000284, "unknown host: %s", hostname); else gflog_debug(GFARM_MSG_1000285, "gfsd connected from %s", host_name(peer->host)); } /* We don't record auth_method for now */ gfarm_mutex_lock(&peer->control_mutex, "peer_authorized", "peer:control_mutex"); peer->control = 0; gfarm_mutex_unlock(&peer->control_mutex, "peer_authorized", "peer:control_mutex"); if (gfp_xdr_recv_is_ready(peer_get_conn(peer))) thrpool_add_job(peer->handler_thread_pool, peer->protocol_handler, peer); else peer_watch_access(peer); } /* NOTE: caller of this function should acquire giant_lock as well */ void peer_free(struct peer *peer) { char *username, *hostname; static const char diag[] = "peer_free"; gfarm_mutex_lock(&peer_table_mutex, diag, peer_table_diag); if (peer->async != NULL && peer_async_free != NULL) { (*peer_async_free)(peer, peer->async); peer->async = NULL; } /* this must be called after (*peer_async_free)() */ peer_replicating_free_all(peer); username = peer_get_username(peer); hostname = peer_get_hostname(peer); /*XXX XXX*/ while (peer->u.client.jobs != NULL) job_table_remove(job_get_id(peer->u.client.jobs), username, &peer->u.client.jobs); peer->u.client.jobs = NULL; gflog_notice(GFARM_MSG_1000286, "(%s@%s) disconnected", username, hostname); peer_unset_pending_new_generation(peer); peer->control = 0; peer->protocol_error = 0; if (peer->process != NULL) { process_detach_peer(peer->process, peer); peer->process = NULL; } peer->user = NULL; peer->host = NULL; if (peer->username != NULL) { free(peer->username); peer->username = NULL; } if (peer->hostname != NULL) { free(peer->hostname); peer->hostname = NULL; } peer->findxmlattrctx = NULL; gfp_xdr_free(peer->conn); peer->conn = NULL; peer->next_close = NULL; peer->refcount = 0; gfarm_mutex_unlock(&peer_table_mutex, diag, peer_table_diag); } /* NOTE: caller of this function should acquire giant_lock as well */ void peer_shutdown_all(void) { int i; struct peer *peer; static const char diag[] = "peer_shutdown_all"; /* We never unlock this mutex any more */ gfarm_mutex_lock(&peer_table_mutex, diag, peer_table_diag); for (i = 0; i < peer_table_size; i++) { peer = &peer_table[i]; if (peer->process == NULL) continue; gflog_notice(GFARM_MSG_1000287, "(%s@%s) shutting down", peer->username, peer->hostname); #if 0 /* we don't really have to do this at shutdown */ peer_unset_pending_new_generation(peer); #endif process_detach_peer(peer->process, peer); peer->process = NULL; } #ifdef HAVE_EPOLL close(peer_epoll.fd); #endif } void peer_invoked(struct peer *peer) { gfarm_mutex_lock(&peer->control_mutex, "peer_watch_access", "peer:control_mutex"); peer->control &= ~PEER_INVOKING; gfarm_mutex_unlock(&peer->control_mutex, "peer_watch_access", "peer:control_mutex"); gfarm_cond_signal(&peer_closing_queue.ready_to_close, "peer_invoked", "connection can be freed"); } void peer_watch_access(struct peer *peer) { gfarm_mutex_lock(&peer->control_mutex, "peer_watch_access", "peer:control_mutex"); peer->control |= PEER_WATCHING; gfarm_mutex_unlock(&peer->control_mutex, "peer_watch_access", "peer:control_mutex"); #ifdef HAVE_EPOLL peer_epoll_add_fd(peer_get_fd(peer)); #endif } #if 0 struct peer * peer_by_fd(int fd) { static const char diag[] = "peer_by_fd"; gfarm_mutex_lock(&peer_table_mutex, diag, peer_table_diag); if (fd < 0 || fd >= peer_table_size || peer_table[fd].conn == NULL) return (NULL); gfarm_mutex_unlock(&peer_table_mutex, diag, peer_table_diag); return (&peer_table[fd]); } /* NOTE: caller of this function should acquire giant_lock as well */ gfarm_error_t peer_free_by_fd(int fd) { struct peer *peer = peer_by_fd(fd); if (peer == NULL) return (GFARM_ERR_BAD_FILE_DESCRIPTOR); peer_free(peer); return (GFARM_ERR_NO_ERROR); } #endif /* 0 */ struct gfp_xdr * peer_get_conn(struct peer *peer) { return (peer->conn); } int peer_get_fd(struct peer *peer) { int fd = peer - peer_table; if (fd < 0 || fd >= peer_table_size) gflog_fatal(GFARM_MSG_1000288, "peer_get_fd: invalid peer pointer"); return (fd); } void peer_set_async(struct peer *peer, gfp_xdr_async_peer_t async) { peer->async = async; } gfp_xdr_async_peer_t peer_get_async(struct peer *peer) { return (peer->async); } /* * This funciton is experimentally introduced to accept a host in * private networks. */ gfarm_error_t peer_set_host(struct peer *peer, char *hostname) { if (peer->id_type != GFARM_AUTH_ID_TYPE_SPOOL_HOST) { gflog_debug(GFARM_MSG_1001584, "operation is not permitted"); return (GFARM_ERR_OPERATION_NOT_PERMITTED); } if (peer->host != NULL) { /* already set */ gflog_debug(GFARM_MSG_1001585, "peer host is already set"); return (GFARM_ERR_NO_ERROR); } peer->host = host_lookup(hostname); if (peer->host == NULL) { gflog_debug(GFARM_MSG_1001586, "host does not exist"); return (GFARM_ERR_UNKNOWN_HOST); } if (peer->hostname != NULL) { free(peer->hostname); peer->hostname = NULL; } gflog_debug(GFARM_MSG_1000289, "gfsd connected from %s", host_name(peer->host)); return (GFARM_ERR_NO_ERROR); } enum gfarm_auth_id_type peer_get_auth_id_type(struct peer *peer) { return (peer->id_type); } char * peer_get_username(struct peer *peer) { return (peer->user != NULL ? user_name(peer->user) : peer->username); } char * peer_get_hostname(struct peer *peer) { return (peer->host != NULL ? host_name(peer->host) : peer->hostname); } struct user * peer_get_user(struct peer *peer) { return (peer->user); } void peer_set_user(struct peer *peer, struct user *user) { if (peer->user != NULL) gflog_fatal(GFARM_MSG_1000290, "peer_set_user: overriding user"); peer->user = user; } struct host * peer_get_host(struct peer *peer) { return (peer->host); } /* NOTE: caller of this function should acquire giant_lock as well */ void peer_set_pending_new_generation(struct peer *peer, struct inode *inode) { peer->pending_new_generation = inode; } /* NOTE: caller of this function should acquire giant_lock as well */ void peer_reset_pending_new_generation(struct peer *peer) { peer->pending_new_generation = NULL; } /* NOTE: caller of this function should acquire giant_lock as well */ void peer_unset_pending_new_generation(struct peer *peer) { if (peer->pending_new_generation != NULL) inode_new_generation_done(peer->pending_new_generation, peer, GFARM_ERR_PROTOCOL); } struct process * peer_get_process(struct peer *peer) { return (peer->process); } /* NOTE: caller of this function should acquire giant_lock as well */ void peer_set_process(struct peer *peer, struct process *process) { if (peer->process != NULL) gflog_fatal(GFARM_MSG_1000291, "peer_set_process: overriding process"); peer->process = process; process_attach_peer(process, peer); } /* NOTE: caller of this function should acquire giant_lock as well */ void peer_unset_process(struct peer *peer) { if (peer->process == NULL) gflog_fatal(GFARM_MSG_1000292, "peer_unset_process: already unset"); peer_unset_pending_new_generation(peer); peer_fdpair_clear(peer); process_detach_peer(peer->process, peer); peer->process = NULL; } void peer_record_protocol_error(struct peer *peer) { peer->protocol_error = 1; } int peer_had_protocol_error(struct peer *peer) { return (peer->protocol_error); } void peer_set_protocol_handler(struct peer *peer, struct thread_pool *thrpool, void *(*protocol_handler)(void *)) { peer->protocol_handler = protocol_handler; peer->handler_thread_pool = thrpool; } struct protocol_state * peer_get_protocol_state(struct peer *peer) { return (&peer->pstate); /* we only provide storage space here */ } struct job_table_entry ** peer_get_jobs_ref(struct peer *peer) { return (&peer->u.client.jobs); } /* NOTE: caller of this function should acquire giant_lock as well */ /* * NOTE: this shouldn't need db_begin()/db_end() calls at least for now, * because only externalized descriptor needs the calls. */ void peer_fdpair_clear(struct peer *peer) { if (peer->process == NULL) { assert(peer->fd_current == -1 && peer->fd_saved == -1); return; } if (peer->fd_current != -1 && (peer->flags & PEER_FLAGS_FD_CURRENT_EXTERNALIZED) == 0 && peer->fd_current != peer->fd_saved) { /* prevent double close */ process_close_file(peer->process, peer, peer->fd_current); } if (peer->fd_saved != -1 && (peer->flags & PEER_FLAGS_FD_SAVED_EXTERNALIZED) == 0) { process_close_file(peer->process, peer, peer->fd_saved); } peer->fd_current = -1; peer->fd_saved = -1; peer->flags &= ~( PEER_FLAGS_FD_CURRENT_EXTERNALIZED | PEER_FLAGS_FD_SAVED_EXTERNALIZED); } gfarm_error_t peer_fdpair_externalize_current(struct peer *peer) { if (peer->fd_current == -1) { gflog_debug(GFARM_MSG_1001587, "bad file descriptor"); return (GFARM_ERR_BAD_FILE_DESCRIPTOR); } peer->flags |= PEER_FLAGS_FD_CURRENT_EXTERNALIZED; if (peer->fd_current == peer->fd_saved) peer->flags |= PEER_FLAGS_FD_SAVED_EXTERNALIZED; return (GFARM_ERR_NO_ERROR); } gfarm_error_t peer_fdpair_close_current(struct peer *peer) { if (peer->fd_current == -1) { gflog_debug(GFARM_MSG_1001588, "bad file descriptor"); return (GFARM_ERR_BAD_FILE_DESCRIPTOR); } if (peer->fd_current == peer->fd_saved) { peer->flags &= ~PEER_FLAGS_FD_SAVED_EXTERNALIZED; peer->fd_saved = -1; } peer->flags &= ~PEER_FLAGS_FD_CURRENT_EXTERNALIZED; peer->fd_current = -1; return (GFARM_ERR_NO_ERROR); } /* NOTE: caller of this function should acquire giant_lock as well */ /* * NOTE: this shouldn't need db_begin()/db_end() calls at least for now, * because only externalized descriptor needs the calls. */ void peer_fdpair_set_current(struct peer *peer, gfarm_int32_t fd) { if (peer->fd_current != -1 && (peer->flags & PEER_FLAGS_FD_CURRENT_EXTERNALIZED) == 0 && peer->fd_current != peer->fd_saved) { /* prevent double close */ process_close_file(peer->process, peer, peer->fd_current); } peer->flags &= ~PEER_FLAGS_FD_CURRENT_EXTERNALIZED; peer->fd_current = fd; } gfarm_error_t peer_fdpair_get_current(struct peer *peer, gfarm_int32_t *fdp) { if (peer->fd_current == -1) { gflog_debug(GFARM_MSG_1001589, "bad file descriptor"); return (GFARM_ERR_BAD_FILE_DESCRIPTOR); } *fdp = peer->fd_current; return (GFARM_ERR_NO_ERROR); } gfarm_error_t peer_fdpair_get_saved(struct peer *peer, gfarm_int32_t *fdp) { if (peer->fd_saved == -1) { gflog_debug(GFARM_MSG_1001590, "bad file descriptor"); return (GFARM_ERR_BAD_FILE_DESCRIPTOR); } *fdp = peer->fd_saved; return (GFARM_ERR_NO_ERROR); } /* NOTE: caller of this function should acquire giant_lock as well */ /* * NOTE: this shouldn't need db_begin()/db_end() calls at least for now, * because only externalized descriptor needs the calls. */ gfarm_error_t peer_fdpair_save(struct peer *peer) { if (peer->fd_current == -1) { gflog_debug(GFARM_MSG_1001591, "bad file descriptor"); return (GFARM_ERR_BAD_FILE_DESCRIPTOR); } if (peer->fd_saved != -1 && (peer->flags & PEER_FLAGS_FD_SAVED_EXTERNALIZED) == 0 && peer->fd_saved != peer->fd_current) { /* prevent double close */ process_close_file(peer->process, peer, peer->fd_saved); } peer->fd_saved = peer->fd_current; peer->flags = (peer->flags & ~PEER_FLAGS_FD_SAVED_EXTERNALIZED) | ((peer->flags & PEER_FLAGS_FD_CURRENT_EXTERNALIZED) ? PEER_FLAGS_FD_SAVED_EXTERNALIZED : 0); return (GFARM_ERR_NO_ERROR); } /* NOTE: caller of this function should acquire giant_lock as well */ /* * NOTE: this shouldn't need db_begin()/db_end() calls at least for now, * because only externalized descriptor needs the calls. */ gfarm_error_t peer_fdpair_restore(struct peer *peer) { if (peer->fd_saved == -1) { gflog_debug(GFARM_MSG_1001592, "bad file descriptor"); return (GFARM_ERR_BAD_FILE_DESCRIPTOR); } if (peer->fd_current != -1 && (peer->flags & PEER_FLAGS_FD_CURRENT_EXTERNALIZED) == 0 && peer->fd_current != peer->fd_saved) { /* prevent double close */ process_close_file(peer->process, peer, peer->fd_current); } peer->fd_current = peer->fd_saved; peer->flags = (peer->flags & ~PEER_FLAGS_FD_CURRENT_EXTERNALIZED) | ((peer->flags & PEER_FLAGS_FD_SAVED_EXTERNALIZED) ? PEER_FLAGS_FD_CURRENT_EXTERNALIZED : 0); return (GFARM_ERR_NO_ERROR); } void peer_findxmlattrctx_set(struct peer *peer, void *ctx) { peer->findxmlattrctx = ctx; } void * peer_findxmlattrctx_get(struct peer *peer) { return peer->findxmlattrctx; } gfarm-2.4.1/server/gfmd/peer.h0000644000000000000000000000765311507222724014654 0ustar rootrootstruct peer; struct thread_pool; void peer_add_ref(struct peer *); int peer_del_ref(struct peer *); void peer_free_request(struct peer *); void peer_init(int, struct thread_pool *, void *(*)(void *)); gfarm_error_t peer_alloc(int, struct peer **); void peer_authorized(struct peer *, enum gfarm_auth_id_type, char *, char *, struct sockaddr *, enum gfarm_auth_method); void peer_free(struct peer *); void peer_shutdown_all(void); void peer_invoked(struct peer *); void peer_watch_access(struct peer *); struct peer *peer_by_fd(int); gfarm_error_t peer_free_by_fd(int); struct gfp_xdr *peer_get_conn(struct peer *); int peer_get_fd(struct peer *); /* (struct gfp_xdr_aync_peer *) == gfp_xdr_async_peer_t XXX */ struct gfp_xdr_async_peer; void peer_set_async(struct peer *, struct gfp_xdr_async_peer *); struct gfp_xdr_async_peer *peer_get_async(struct peer *); void peer_set_free_async(void (*)(struct peer *, struct gfp_xdr_async_peer *)); gfarm_error_t peer_set_host(struct peer *, char *); enum gfarm_auth_id_type peer_get_auth_id_type(struct peer *); char *peer_get_username(struct peer *); char *peer_get_hostname(struct peer *); struct user; struct user *peer_get_user(struct peer *); void peer_set_user(struct peer *, struct user *); struct host; struct host *peer_get_host(struct peer *); struct inode; void peer_set_pending_new_generation(struct peer *, struct inode *); void peer_reset_pending_new_generation(struct peer *); void peer_unset_pending_new_generation(struct peer *); struct process; struct process *peer_get_process(struct peer *); void peer_set_process(struct peer *, struct process *); void peer_unset_process(struct peer *); void peer_record_protocol_error(struct peer *); int peer_had_protocol_error(struct peer *); void peer_set_protocol_handler(struct peer *, struct thread_pool *, void *(*)(void *)); struct protocol_state; struct protocol_state *peer_get_protocol_state(struct peer *); /* XXX */ struct job_table_entry; struct job_table_entry **peer_get_jobs_ref(struct peer *); void peer_fdpair_clear(struct peer *); gfarm_error_t peer_fdpair_externalize_current(struct peer *); gfarm_error_t peer_fdpair_close_current(struct peer *); void peer_fdpair_set_current(struct peer *, gfarm_int32_t); gfarm_error_t peer_fdpair_get_current(struct peer *, gfarm_int32_t *); gfarm_error_t peer_fdpair_get_saved(struct peer *, gfarm_int32_t *); gfarm_error_t peer_fdpair_save(struct peer *); gfarm_error_t peer_fdpair_restore(struct peer *); void peer_findxmlattrctx_set(struct peer *, void *); void *peer_findxmlattrctx_get(struct peer *); struct dead_file_copy; struct file_replicating { /* * resources which are protected by the host::replication_mutex */ /* * end marker: * {fr->prev_inode, fr->next_inode} * == &fr->dst->replicating_inodes */ struct file_replicating *prev_inode, *next_inode; /* * resources which are protected by the giant_lock */ /* * end marker: * {fr->prev_host, fr->next_host} * == &fr->inode->u.c.s.f.rstate->replicating_hosts */ struct file_replicating *prev_host, *next_host; struct peer *peer; struct host *dst; /* * gfmd initialited replication: pid of destination side worker * client initialited replication: -1 */ gfarm_int64_t handle; struct inode *inode; gfarm_int64_t igen; /* generation when replication started */ /* * old generation which should be removed just after * the completion of the replication, * or, NULL */ struct dead_file_copy *cleanup; }; void file_replicating_set_handle(struct file_replicating *, gfarm_int64_t); gfarm_int64_t file_replicating_get_handle(struct file_replicating *); struct peer *file_replicating_get_peer(struct file_replicating *); gfarm_error_t peer_replicating_new(struct peer *, struct host *, struct file_replicating **); void peer_replicating_free(struct file_replicating *); gfarm_error_t peer_replicated(struct peer *, struct host *, gfarm_ino_t, gfarm_int64_t, gfarm_int64_t, gfarm_int32_t, gfarm_int32_t, gfarm_off_t); gfarm-2.4.1/server/gfmd/back_channel.h0000644000000000000000000000053411507222724016300 0ustar rootroot/* * $Id$ */ struct peer; gfarm_error_t async_back_channel_replication_request(char *, int, struct host *, gfarm_ino_t, gfarm_int64_t, struct file_replicating *); gfarm_error_t gfm_server_switch_back_channel(struct peer *, int, int); gfarm_error_t gfm_server_switch_async_back_channel(struct peer *, int, int); void back_channel_init(void); gfarm-2.4.1/server/gfmd/quota.c0000644000000000000000000005673511507222724015052 0ustar rootroot/* * $Id: quota.c 4630 2010-04-06 12:42:54Z n-soda $ */ #include #include #include #include #include #include "auth.h" #include "peer.h" #include "subr.h" #include "user.h" #include "group.h" #include "inode.h" #include "quota.h" #include "quota_info.h" #include "db_access.h" #define QUOTA_NOT_CHECK_YET -1 #define is_checked(q) (q->space != QUOTA_NOT_CHECK_YET ? 1 : 0) static gfarm_error_t db_state = GFARM_ERR_NO_ERROR; /* private functions */ static void update_softlimit(gfarm_time_t *exceedp, gfarm_time_t now, gfarm_time_t grace, gfarm_int64_t val, gfarm_int64_t soft) { if (!quota_limit_is_valid(grace) /* disable all softlimit */ || !quota_limit_is_valid(soft) /* disable this softlimit */ || val <= soft /* not exceed */ ) { *exceedp = GFARM_QUOTA_INVALID; return; } else if (*exceedp >= 0) return; /* already exceeded */ else if (val > soft) *exceedp = now; /* exceed now */ } static void quota_check_softlimit_exceed(struct quota *q) { struct timeval now; if (!quota_limit_is_valid(q->grace_period)) { /* disable all softlimit */ q->space_exceed = GFARM_QUOTA_INVALID; q->num_exceed = GFARM_QUOTA_INVALID; q->phy_space_exceed = GFARM_QUOTA_INVALID; q->phy_num_exceed = GFARM_QUOTA_INVALID; return; } /* update exceeded time of softlimit */ gettimeofday(&now, NULL); update_softlimit(&q->space_exceed, now.tv_sec, q->grace_period, q->space, q->space_soft); update_softlimit(&q->num_exceed, now.tv_sec, q->grace_period, q->num, q->num_soft); update_softlimit(&q->phy_space_exceed, now.tv_sec, q->grace_period, q->phy_space, q->phy_space_soft); update_softlimit(&q->phy_num_exceed, now.tv_sec, q->grace_period, q->phy_num, q->phy_num_soft); } static void quota_clear_value_user(void *closure, struct user *u) { struct quota *q = user_quota(u); if (!q->on_db) /* disabled: not gfedquota yet */ return; q->space = 0; /* is_checked is true */ q->num = 0; q->phy_space = 0; q->phy_num = 0; } static void quota_clear_value_group(void *closure, struct group *g) { struct quota *q = group_quota(g); if (!q->on_db) /* disabled: not gfedquota yet */ return; q->space = 0; /* is_checked is true */ q->num = 0; q->phy_space = 0; q->phy_num = 0; } static void quota_clear_value_all_user_and_group() { user_all(NULL, quota_clear_value_user, 0); group_all(NULL, quota_clear_value_group, 0); } static void quota_active_user_set_db(struct quota *q, struct user *u) { if (user_is_active(u)) { gfarm_error_t e = db_quota_user_set(q, user_name(u)); if (e == GFARM_ERR_NO_ERROR) q->on_db = 1; else gflog_error(GFARM_MSG_1000410, "db_quota_user_set(%s) %s", user_name(u), gfarm_error_string(e)); } } static void quota_active_group_set_db(struct quota *q, struct group *g) { if (group_is_active(g)) { gfarm_error_t e = db_quota_group_set(q, group_name(g)); if (e == GFARM_ERR_NO_ERROR) q->on_db = 1; else gflog_error(GFARM_MSG_1000411, "db_quota_group_set(%s) %s", group_name(g), gfarm_error_string(e)); } } static void quota_set_value_user(void *closure, struct user *u) { struct quota *q = user_quota(u); if (!is_checked(q)) return; quota_check_softlimit_exceed(q); quota_active_user_set_db(q, u); } static void quota_set_value_group(void *closure, struct group *g) { struct quota *q = group_quota(g); if (!is_checked(q)) return; quota_check_softlimit_exceed(q); quota_active_group_set_db(q, g); } static void quota_set_value_all_user_and_group() { user_all(NULL, quota_set_value_user, 0); group_all(NULL, quota_set_value_group, 0); } static gfarm_time_t calculate_grace_period(gfarm_time_t exceeded_time, gfarm_time_t grace_period, gfarm_time_t now) { gfarm_time_t val; if (!quota_limit_is_valid(grace_period) || !quota_limit_is_valid(exceeded_time)) return (GFARM_QUOTA_INVALID); /* disable softlimit */ val = grace_period - (now - exceeded_time); if (val < 0) return (0); /* expired */ return (val); /* grace period until expiration */ } static void quota_convert_1(const struct quota *q, const char *name, struct gfarm_quota_get_info *qi) { struct timeval now; gettimeofday(&now, NULL); qi->name = (char *)name; qi->grace_period = q->grace_period; qi->space = q->space; qi->space_grace = calculate_grace_period( q->space_exceed, q->grace_period, now.tv_sec); qi->space_soft = q->space_soft; qi->space_hard = q->space_hard; qi->num = q->num; qi->num_grace = calculate_grace_period( q->num_exceed, q->grace_period, now.tv_sec); qi->num_soft = q->num_soft; qi->num_hard = q->num_hard; qi->phy_space = q->phy_space; qi->phy_space_grace = calculate_grace_period( q->phy_space_exceed, q->grace_period, now.tv_sec); qi->phy_space_soft = q->phy_space_soft; qi->phy_space_hard = q->phy_space_hard; qi->phy_num = q->phy_num; qi->phy_num_grace = calculate_grace_period( q->phy_num_exceed, q->grace_period, now.tv_sec); qi->phy_num_soft = q->phy_num_soft; qi->phy_num_hard = q->phy_num_hard; } static void quota_convert_2(const struct gfarm_quota_info *qi, struct quota *q) { q->grace_period = qi->grace_period; q->space = qi->space; q->space_exceed = qi->space_exceed; q->space_soft = qi->space_soft; q->space_hard = qi->space_hard; q->num = qi->num; q->num_exceed = qi->num_exceed; q->num_soft = qi->num_soft; q->num_hard = qi->num_hard; q->phy_space = qi->phy_space; q->phy_space_exceed = qi->phy_space_exceed; q->phy_space_soft = qi->phy_space_soft; q->phy_space_hard = qi->phy_space_hard; q->phy_num = qi->phy_num; q->phy_num_exceed = qi->phy_num_exceed; q->phy_num_soft = qi->phy_num_soft; q->phy_num_hard = qi->phy_num_hard; } static void quota_user_remove_db(const char *name) { gfarm_error_t e = db_quota_user_remove(name); if (e != GFARM_ERR_NO_ERROR) gflog_error(GFARM_MSG_1000412, "db_quota_user_remove(%s) %s", name, gfarm_error_string(e)); } static void quota_group_remove_db(const char *name) { gfarm_error_t e = db_quota_group_remove(name); if (e != GFARM_ERR_NO_ERROR) gflog_error(GFARM_MSG_1000413, "db_quota_group_remove(%s) %s", name, gfarm_error_string(e)); } /* public functions */ static void quota_user_set_one_from_db(void *closure, struct gfarm_quota_info *qi) { struct user *u; if (qi->name == NULL) return; u = user_lookup(qi->name); if (u == NULL) { quota_user_remove_db(qi->name); } else { struct quota *q = user_quota(u); quota_convert_2(qi, q); q->on_db = 1; /* load from db */ } gfarm_quota_info_free(qi); } static void quota_group_set_one_from_db(void *closure, struct gfarm_quota_info *qi) { struct group *g; if (qi->name == NULL) return; g = group_lookup(qi->name); if (g == NULL) { quota_group_remove_db(qi->name); } else { struct quota *q = group_quota(g); quota_convert_2(qi, q); q->on_db = 1; /* load from db */ } gfarm_quota_info_free(qi); } void quota_init() { gfarm_error_t e; e = db_quota_user_load(NULL, quota_user_set_one_from_db); if (e != GFARM_ERR_NO_ERROR) { gflog_error(GFARM_MSG_1000414, "db_quota_user_load() %s", gfarm_error_string(e)); db_state = e; } e = db_quota_group_load(NULL, quota_group_set_one_from_db); if (e != GFARM_ERR_NO_ERROR) { gflog_error(GFARM_MSG_1000415, "db_quota_group_load() %s", gfarm_error_string(e)); db_state = e; } } void quota_data_init(struct quota *q) { /* gfarmadm do not execute gfedquota yet */ q->on_db = 0; /* disable all softlimit */ q->grace_period = GFARM_QUOTA_INVALID; /* gfarmadm do not execute gfquotacheck yet */ q->space = QUOTA_NOT_CHECK_YET; q->space_exceed = GFARM_QUOTA_INVALID; q->space_soft = GFARM_QUOTA_INVALID; q->space_hard = GFARM_QUOTA_INVALID; q->num = 0; q->num_exceed = GFARM_QUOTA_INVALID; q->num_soft = GFARM_QUOTA_INVALID; q->num_hard = GFARM_QUOTA_INVALID; q->phy_space = 0; q->phy_space_exceed = GFARM_QUOTA_INVALID; q->phy_space_soft = GFARM_QUOTA_INVALID; q->phy_space_hard = GFARM_QUOTA_INVALID; q->phy_num = 0; q->phy_num_exceed = GFARM_QUOTA_INVALID; q->phy_num_soft = GFARM_QUOTA_INVALID; q->phy_num_hard = GFARM_QUOTA_INVALID; } static inline gfarm_int64_t int64_add(gfarm_int64_t orig, gfarm_int64_t diff) { gfarm_int64_t val; if (diff == 0) return (orig); else if (diff > 0) { val = orig + diff; /* * signed overflow causes undefined behavior in the C language * standard, thus we have to use unsigned here. */ if ((gfarm_uint64_t)val < orig || (gfarm_uint64_t)val > GFARM_INT64_MAX) /* overflow */ val = GFARM_INT64_MAX; return (val); } else { /* diff < 0 */ val = orig + diff; if (val < 0) val = 0; return (val); } } #define update_file_add(q, size, ncopy) \ { \ q->space = int64_add(q->space, size); \ q->num = int64_add(q->num, 1); \ q->phy_space = int64_add(q->phy_space, size * ncopy); \ q->phy_num = int64_add(q->phy_num, ncopy); \ } static void quota_update_file_add_common(struct inode *inode, int quotacheck) { gfarm_off_t size = inode_get_size(inode); gfarm_int64_t ncopy = inode_get_ncopy_with_dead_host(inode); struct user *u = inode_get_user(inode); struct group *g = inode_get_group(inode); if (u) { struct quota *uq = user_quota(u); if (is_checked(uq)) { update_file_add(uq, size, ncopy); quota_check_softlimit_exceed(uq); if (!quotacheck) quota_active_user_set_db(uq, u); } } if (g) { struct quota *gq = group_quota(g); if (is_checked(gq)) { update_file_add(gq, size, ncopy); quota_check_softlimit_exceed(gq); if (!quotacheck) quota_active_group_set_db(gq, g); } } if (debug_mode) { gfarm_ino_t inum; gfarm_int64_t gen; char *username, *groupname; inum = inode_get_number(inode); gen = inode_get_gen(inode); username = user_name(u); groupname = group_name(g); gflog_debug(GFARM_MSG_1000416, " ino=%lld(gen=%lld): " "size=%lld,ncopy=%lld,user=%s,group=%s", (unsigned long long)inum, (unsigned long long)gen, (unsigned long long)size, (unsigned long long)ncopy, username, groupname); } } static void quota_update_file_add_for_quotacheck(void *closure, struct inode *inode) { if (inode_is_file(inode)) /* all inodes by inode_lookup_all() */ quota_update_file_add_common(inode, 1); } void quota_update_file_add(struct inode *inode) { quota_update_file_add_common(inode, 0); } #define update_file_resize(q, old_size, new_size, ncopy) \ { \ gfarm_int64_t diff = new_size - old_size; \ q->space = int64_add(q->space, diff); \ q->phy_space = int64_add(q->phy_space, diff * ncopy); \ } void quota_update_file_resize(struct inode *inode, gfarm_off_t new_size) { gfarm_off_t old_size = inode_get_size(inode); gfarm_int64_t ncopy = inode_get_ncopy_with_dead_host(inode); struct user *u = inode_get_user(inode); struct group *g = inode_get_group(inode); if (u) { struct quota *uq = user_quota(u); if (is_checked(uq)) { update_file_resize(uq, old_size, new_size, ncopy); quota_check_softlimit_exceed(uq); quota_active_user_set_db(uq, u); } } if (g) { struct quota *gq = group_quota(g); if (is_checked(gq)) { update_file_resize(gq, old_size, new_size, ncopy); quota_check_softlimit_exceed(gq); quota_active_group_set_db(gq, g); } } } #define update_replica_num(q, size, n) \ { \ q->phy_space = int64_add(q->phy_space, size * n); \ q->phy_num = int64_add(q->phy_num, n); \ } static void quota_update_replica_num(struct inode *inode, gfarm_int64_t n) { gfarm_off_t size = inode_get_size(inode); struct user *u = inode_get_user(inode); struct group *g = inode_get_group(inode); if (u) { struct quota *uq = user_quota(u); if (is_checked(uq)) { update_replica_num(uq, size, n); quota_check_softlimit_exceed(uq); quota_active_user_set_db(uq, u); } } if (g) { struct quota *gq = group_quota(g); if (is_checked(gq)) { update_replica_num(gq, size, n); quota_check_softlimit_exceed(gq); quota_active_group_set_db(gq, g); } } } void quota_update_replica_add(struct inode *inode) { quota_update_replica_num(inode, 1); } void quota_update_replica_remove(struct inode *inode) { quota_update_replica_num(inode, -1); } #define update_file_remove(q, size, ncopy) \ { \ q->space = int64_add(q->space, -size); \ q->num = int64_add(q->num, -1); \ q->phy_space = int64_add(q->phy_space, -(size * ncopy)); \ q->phy_num = int64_add(q->phy_num, -ncopy); \ } void quota_update_file_remove(struct inode *inode) { gfarm_off_t size = inode_get_size(inode); gfarm_int64_t ncopy = inode_get_ncopy_with_dead_host(inode); struct user *u = inode_get_user(inode); struct group *g = inode_get_group(inode); if (u) { struct quota *uq = user_quota(u); if (is_checked(uq)) { update_file_remove(uq, size, ncopy); quota_check_softlimit_exceed(uq); quota_active_user_set_db(uq, u); } } if (g) { struct quota *gq = group_quota(g); if (is_checked(gq)) { update_file_remove(gq, size, ncopy); quota_check_softlimit_exceed(gq); quota_active_group_set_db(gq, g); } } } enum quota_exceeded_type { QUOTA_NOT_EXCEEDED = 0, QUOTA_EXCEEDED_SPACE_SOFT, QUOTA_EXCEEDED_SPACE_HARD, QUOTA_EXCEEDED_NUM_SOFT, QUOTA_EXCEEDED_NUM_HARD, QUOTA_EXCEEDED_PHY_SPACE_SOFT, QUOTA_EXCEEDED_PHY_SPACE_HARD, QUOTA_EXCEEDED_PHY_NUM_SOFT, QUOTA_EXCEEDED_PHY_NUM_HARD, }; static int is_exceeded(struct timeval *nowp, struct quota *q, int is_file_creating, int is_replica_adding) { if (!is_checked(q)) /* quota is disabled */ return (QUOTA_NOT_EXCEEDED); /* softlimit */ if (quota_limit_is_valid(q->grace_period)) { if (quota_limit_is_valid(q->space_soft) && quota_limit_is_valid(q->space_exceed) && (nowp->tv_sec - q->space_exceed) > q->grace_period) return (QUOTA_EXCEEDED_SPACE_SOFT); if (quota_limit_is_valid(q->num_soft) && quota_limit_is_valid(q->num_exceed) && (nowp->tv_sec - q->num_exceed) > q->grace_period) return (QUOTA_EXCEEDED_NUM_SOFT); if (quota_limit_is_valid(q->phy_space_soft) && quota_limit_is_valid(q->phy_space_exceed) && (nowp->tv_sec - q->phy_space_exceed) > q->grace_period) return (QUOTA_EXCEEDED_PHY_SPACE_SOFT); if (quota_limit_is_valid(q->phy_num_soft) && quota_limit_is_valid(q->phy_num_exceed) && (nowp->tv_sec - q->phy_num_exceed) > q->grace_period) return (QUOTA_EXCEEDED_PHY_NUM_SOFT); } /* hardlimit */ if ((quota_limit_is_valid(q->space_hard) && q->space > q->space_hard)) return (QUOTA_EXCEEDED_SPACE_HARD); if (quota_limit_is_valid(q->num_hard) && q->num + (is_file_creating ? 1 : 0) > q->num_hard) return (QUOTA_EXCEEDED_NUM_HARD); if (quota_limit_is_valid(q->phy_space_hard) && q->phy_space > q->phy_space_hard) return (QUOTA_EXCEEDED_PHY_SPACE_HARD); if (quota_limit_is_valid(q->phy_num_hard) && q->phy_num + (is_replica_adding ? 1 : 0) > q->phy_num_hard) return (QUOTA_EXCEEDED_PHY_NUM_HARD); return (QUOTA_NOT_EXCEEDED); } gfarm_error_t quota_check_limits(struct user *u, struct group *g, int is_file_creating, int is_replica_adding) { struct timeval now; gettimeofday(&now, NULL); if (u && is_exceeded(&now, user_quota(u), is_file_creating, is_replica_adding)) { gflog_debug(GFARM_MSG_1002051, "user_quota(%s) exceeded", user_name(u)); return (GFARM_ERR_DISK_QUOTA_EXCEEDED); } if (g && is_exceeded(&now, group_quota(g), is_file_creating, is_replica_adding)) { gflog_debug(GFARM_MSG_1002052, "group_quota(%s) exceeded", group_name(g)); return (GFARM_ERR_DISK_QUOTA_EXCEEDED); } return (GFARM_ERR_NO_ERROR); } void quota_user_remove(struct user *u) { struct quota *q = user_quota(u); if (q->on_db) { quota_user_remove_db(user_name(u)); q->on_db = 0; } q->space = QUOTA_NOT_CHECK_YET; } void quota_group_remove(struct group *g) { struct quota *q = group_quota(g); if (q->on_db) { quota_group_remove_db(group_name(g)); q->on_db = 0; } q->space = QUOTA_NOT_CHECK_YET; } /* server operations */ static gfarm_error_t quota_get_common(struct peer *peer, int from_client, int skip, int is_group) { const char *diag = is_group ? "GFM_PROTO_QUOTA_GROUP_GET" : "GFM_PROTO_QUOTA_USER_GET"; gfarm_error_t e; struct user *user = NULL, *peer_user = peer_get_user(peer); struct group *group = NULL; char *name; struct quota *q; struct gfarm_quota_get_info qi; e = gfm_server_get_request(peer, diag, "s", &name); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1002053, "%s request failed: %s", diag, gfarm_error_string(e)); return (e); } if (skip) { free(name); return (GFARM_ERR_NO_ERROR); } if (!from_client || peer_user == NULL) { e = GFARM_ERR_OPERATION_NOT_PERMITTED; gflog_debug(GFARM_MSG_1002054, "%s: !from_client or invalid peer_user ", diag); free(name); return (gfm_server_put_reply(peer, diag, e, "")); } if (db_state != GFARM_ERR_NO_ERROR) { free(name); gflog_debug(GFARM_MSG_1002055, "db_quota is invalid: %s", gfarm_error_string(db_state)); return (gfm_server_put_reply(peer, diag, db_state, "")); } giant_lock(); if (is_group) { if (strcmp(name, "") == 0) e = GFARM_ERR_NO_SUCH_GROUP; else if ((group = group_lookup(name)) == NULL) { if (user_is_admin(peer_user)) e = GFARM_ERR_NO_SUCH_GROUP; else /* hidden groupnames */ e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if (!group_is_active(group)) { if (user_is_admin(peer_user)) e = GFARM_ERR_NO_SUCH_GROUP; else /* hidden groupnames */ e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if ((!user_in_group(peer_user, group)) && !user_is_admin(peer_user)) e = GFARM_ERR_OPERATION_NOT_PERMITTED; /* user_in_group() || user_is_admin() : permit */ } else { if (strcmp(name, "") == 0) { user = peer_user; /* permit not-admin */ free(name); name = strdup_log(user_name(peer_user), diag); if (name == NULL) e = GFARM_ERR_NO_MEMORY; } else if (strcmp(name, user_name(peer_user)) == 0) user = peer_user; /* permit not-admin */ else if (!user_is_admin(peer_user)) e = GFARM_ERR_OPERATION_NOT_PERMITTED; else if ((user = user_lookup(name)) == NULL) e = GFARM_ERR_NO_SUCH_USER; else if (!user_is_active(user)) e = GFARM_ERR_NO_SUCH_USER; } if (e != GFARM_ERR_NO_ERROR) { giant_unlock(); gflog_debug(GFARM_MSG_1002056, "%s: name=%s: %s", diag, name, gfarm_error_string(e)); free(name); return (gfm_server_put_reply(peer, diag, e, "")); } if (is_group) q = group_quota(group); else q = user_quota(user); if (!is_checked(q)) { /* quota is not enabled */ giant_unlock(); gflog_debug(GFARM_MSG_1002057, "%s: %s's quota is not enabled", diag, name); free(name); e = GFARM_ERR_NO_SUCH_OBJECT; return (gfm_server_put_reply(peer, diag, e, "")); } quota_convert_1(q, name, &qi); giant_unlock(); e = gfm_server_put_reply( peer, diag, e, "slllllllllllllllll", qi.name, qi.grace_period, qi.space, qi.space_grace, qi.space_soft, qi.space_hard, qi.num, qi.num_grace, qi.num_soft, qi.num_hard, qi.phy_space, qi.phy_space_grace, qi.phy_space_soft, qi.phy_space_hard, qi.phy_num, qi.phy_num_grace, qi.phy_num_soft, qi.phy_num_hard); free(name); return (e); } #define set_limit(target, received) \ { \ if (quota_limit_is_valid(received)) \ target = received; \ else if (received == GFARM_QUOTA_INVALID) \ target = GFARM_QUOTA_INVALID; \ } static gfarm_error_t quota_set_common(struct peer *peer, int from_client, int skip, int is_group) { const char *diag = is_group ? "GFM_PROTO_QUOTA_GROUP_SET" : "GFM_PROTO_QUOTA_USER_SET"; gfarm_error_t e; struct gfarm_quota_set_info qi; struct quota *q; struct user *user, *peer_user = peer_get_user(peer); struct group *group; e = gfm_server_get_request(peer, diag, "slllllllll", &qi.name, &qi.grace_period, &qi.space_soft, &qi.space_hard, &qi.num_soft, &qi.num_hard, &qi.phy_space_soft, &qi.phy_space_hard, &qi.phy_num_soft, &qi.phy_num_hard); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1002058, "%s request failed: %s", diag, gfarm_error_string(e)); return (e); } if (skip) { free(qi.name); return (GFARM_ERR_NO_ERROR); } if (db_state != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1002059, "db_quota is invalid: %s", gfarm_error_string(db_state)); free(qi.name); return (gfm_server_put_reply(peer, diag, db_state, "")); } giant_lock(); if (!from_client || peer_user == NULL || !user_is_admin(peer_user)) { e = GFARM_ERR_OPERATION_NOT_PERMITTED; gflog_debug(GFARM_MSG_1002060, "%s: !from_client or invalid peer_user" " or !user_is_admin", diag); goto end; } else if (is_group) { group = group_lookup(qi.name); if (!group_is_active(group)) { e = GFARM_ERR_NO_SUCH_GROUP; gflog_debug(GFARM_MSG_1002061, "%s: name=%s: %s", diag, qi.name, gfarm_error_string(e)); goto end; } q = group_quota(group); } else { user = user_lookup(qi.name); if (!user_is_active(user)) { e = GFARM_ERR_NO_SUCH_USER; gflog_debug(GFARM_MSG_1002062, "%s: name=%s: %s", diag, qi.name, gfarm_error_string(e)); goto end; } q = user_quota(user); } /* set limits */ set_limit(q->grace_period, qi.grace_period); set_limit(q->space_soft, qi.space_soft); set_limit(q->space_hard, qi.space_hard); set_limit(q->num_soft, qi.num_soft); set_limit(q->num_hard, qi.num_hard); set_limit(q->phy_space_soft, qi.phy_space_soft); set_limit(q->phy_space_hard, qi.phy_space_hard); set_limit(q->phy_num_soft, qi.phy_num_soft); set_limit(q->phy_num_hard, qi.phy_num_hard); /* check softlimit and update exceeded time */ quota_check_softlimit_exceed(q); if (is_group) e = db_quota_group_set(q, qi.name); else e = db_quota_user_set(q, qi.name); if (e == GFARM_ERR_NO_ERROR) q->on_db = 1; end: giant_unlock(); free(qi.name); return (gfm_server_put_reply(peer, diag, e, "")); } gfarm_error_t gfm_server_quota_user_get(struct peer *peer, int from_client, int skip) { return (quota_get_common(peer, from_client, skip, 0)); } gfarm_error_t gfm_server_quota_user_set(struct peer *peer, int from_client, int skip) { return (quota_set_common(peer, from_client, skip, 0)); } gfarm_error_t gfm_server_quota_group_get(struct peer *peer, int from_client, int skip) { return (quota_get_common(peer, from_client, skip, 1)); } gfarm_error_t gfm_server_quota_group_set(struct peer *peer, int from_client, int skip) { return (quota_set_common(peer, from_client, skip, 1)); } gfarm_error_t gfm_server_quota_check(struct peer *peer, int from_client, int skip) { static const char diag[] = "GFM_PROTO_QUOTA_CHECK"; gfarm_error_t e; struct user *peer_user = peer_get_user(peer); e = gfm_server_get_request(peer, diag, ""); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1002063, "%s request failed: %s", diag, gfarm_error_string(e)); return (e); } if (skip) return (GFARM_ERR_NO_ERROR); if (db_state != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1002064, "db_quota is invalid: %s", gfarm_error_string(db_state)); return (gfm_server_put_reply(peer, diag, db_state, "")); } giant_lock(); if (!from_client || peer_user == NULL || !user_is_admin(peer_user)) { giant_unlock(); e = GFARM_ERR_OPERATION_NOT_PERMITTED; gflog_debug(GFARM_MSG_1002065, "%s: !from_client or invalid peer_user" " or !user_is_admin", diag); return (gfm_server_put_reply(peer, diag, e, "")); } /* zero clear and set true in is_checked */ quota_clear_value_all_user_and_group(); /* load all inodes from memory and count usage values of files */ inode_lookup_all(NULL, quota_update_file_add_for_quotacheck); /* update memory and db */ quota_set_value_all_user_and_group(); giant_unlock(); return (gfm_server_put_reply(peer, diag, e, "")); } gfarm-2.4.1/server/gfmd/protocol_state.h0000644000000000000000000000176411507222724016757 0ustar rootroot/* * The state-transition-logic of struct protocol_state is described in gfmd.c, * although the storage for struct protocol_state is provided by struct peer. */ struct compound_state { /* * which part of a COMPOUND block we are currently parsing: * GFARM_ERR_NO_ERROR: main part of a COMPOUND block * otherwise: GFM_PROTO_COMPOUND_ON_ERROR part */ gfarm_error_t current_part; /* * an error at current level of a COMPOUND block. * GFARM_ERR_NO_ERROR: no error in this block for now. */ gfarm_error_t cause; /* * true, if current part of this COMPOUND block must be skipped. */ int skip; /* * XXX * peer_fdpair must belong to struct compound_state. * But because we don't allow nesting of COMPOUND blocks for now, * we don't have to do that. */ }; struct protocol_state { int nesting_level; /* 0: toplevel, or 1: inside COMPOUND */ /* * We don't allow nesting of a COMPOUND block for now, * thus, only one state is enough. */ struct compound_state cs; }; gfarm-2.4.1/server/gfmd/user.c0000644000000000000000000004360311507222724014665 0ustar rootroot#include #include #include #include #include #include #include /* fd_set for "filetab.h" */ #include #include "gfutil.h" #include "hash.h" #include "config.h" /* gfarm_metadb_admin_user */ #include "auth.h" #include "gfp_xdr.h" #include "gfm_proto.h" /* GFARM_LOGIN_NAME_MAX, etc */ #include "subr.h" #include "db_access.h" #include "user.h" #include "group.h" #include "peer.h" #include "quota.h" #define USER_HASHTAB_SIZE 3079 /* prime number */ #define USER_DN_HASHTAB_SIZE 3079 /* prime number */ /* in-core gfarm_user_info */ struct user { struct gfarm_user_info ui; struct group_assignment groups; struct quota q; int invalid; /* set when deleted */ }; char ADMIN_USER_NAME[] = "gfarmadm"; char REMOVED_USER_NAME[] = "gfarm-removed-user"; static struct gfarm_hash_table *user_hashtab = NULL; static struct gfarm_hash_table *user_dn_hashtab = NULL; /* subroutine of grpassign_add(), shouldn't be called from elsewhere */ void grpassign_add_group(struct group_assignment *ga) { struct user *u = ga->u; ga->group_next = &u->groups; ga->group_prev = u->groups.group_prev; u->groups.group_prev->group_next = ga; u->groups.group_prev = ga; } static void user_invalidate(struct user *u) { u->invalid = 1; } static void user_activate(struct user *u) { u->invalid = 0; } int user_is_invalidated(struct user *u) { return (u->invalid == 1); } int user_is_active(struct user *u) { return (u != NULL && !user_is_invalidated(u)); } struct user * user_lookup(const char *username) { struct gfarm_hash_entry *entry; entry = gfarm_hash_lookup(user_hashtab, &username, sizeof(username)); if (entry == NULL) return (NULL); return (*(struct user **)gfarm_hash_entry_data(entry)); } struct user * user_lookup_gsi_dn(const char *gsi_dn) { struct gfarm_hash_entry *entry; if (gsi_dn == NULL || gsi_dn[0] == '\0') return (NULL); entry = gfarm_hash_lookup(user_dn_hashtab, &gsi_dn, sizeof(gsi_dn)); if (entry == NULL) return (NULL); return (*(struct user **)gfarm_hash_entry_data(entry)); } gfarm_error_t user_enter_gsi_dn(const char *gsi_dn, struct user *u) { struct gfarm_hash_entry *entry; int created; if (gsi_dn == NULL || gsi_dn[0] == '\0') return (GFARM_ERR_NO_ERROR); entry = gfarm_hash_enter(user_dn_hashtab, &gsi_dn, sizeof(gsi_dn), sizeof(struct user *), &created); if (entry == NULL) return (GFARM_ERR_NO_MEMORY); if (!created) return (GFARM_ERR_ALREADY_EXISTS); *(struct user **)gfarm_hash_entry_data(entry) = u; return (GFARM_ERR_NO_ERROR); } gfarm_error_t user_enter(struct gfarm_user_info *ui, struct user **upp) { struct gfarm_hash_entry *entry; int created; struct user *u; gfarm_error_t e; u = user_lookup(ui->username); if (u != NULL) { if (user_is_invalidated(u)) { e = user_enter_gsi_dn(ui->gsi_dn, u); if (e != GFARM_ERR_NO_ERROR) return (e); user_activate(u); if (upp != NULL) *upp = u; /* copy user info but keeping address of username */ free(ui->username); ui->username = u->ui.username; u->ui.username = NULL; /* prevent to free this area */ gfarm_user_info_free(&u->ui); u->ui = *ui; return (GFARM_ERR_NO_ERROR); } else { gflog_debug(GFARM_MSG_1001492, "User already exists"); return (GFARM_ERR_ALREADY_EXISTS); } } GFARM_MALLOC(u); if (u == NULL) { gflog_debug(GFARM_MSG_1001493, "allocation of 'user' failed"); return (GFARM_ERR_NO_MEMORY); } u->ui = *ui; entry = gfarm_hash_enter(user_hashtab, &u->ui.username, sizeof(u->ui.username), sizeof(struct user *), &created); if (entry == NULL) { free(u); gflog_debug(GFARM_MSG_1001494, "gfarm_hash_enter() failed"); return (GFARM_ERR_NO_MEMORY); } if (!created) { free(u); gflog_debug(GFARM_MSG_1001495, "Entry already exists"); return (GFARM_ERR_ALREADY_EXISTS); } e = user_enter_gsi_dn(u->ui.gsi_dn, u); if (e != GFARM_ERR_NO_ERROR) { gfarm_hash_purge(user_hashtab, &u->ui.username, sizeof(u->ui.username)); free(u); return (e); } quota_data_init(&u->q); u->groups.group_prev = u->groups.group_next = &u->groups; *(struct user **)gfarm_hash_entry_data(entry) = u; user_activate(u); if (upp != NULL) *upp = u; return (GFARM_ERR_NO_ERROR); } gfarm_error_t user_remove(const char *username) { struct gfarm_hash_entry *entry; struct user *u; struct group_assignment *ga; entry = gfarm_hash_lookup(user_hashtab, &username, sizeof(username)); if (entry == NULL) { gflog_debug(GFARM_MSG_1001496, "gfarm_hash_lookup() failed: %s", username); return (GFARM_ERR_NO_SUCH_USER); } u = *(struct user **)gfarm_hash_entry_data(entry); if (user_is_invalidated(u)) { gflog_debug(GFARM_MSG_1001497, "user is invalidated"); return (GFARM_ERR_NO_SUCH_USER); } if (u->ui.gsi_dn != NULL && u->ui.gsi_dn[0] != '\0') gfarm_hash_purge(user_dn_hashtab, &u->ui.gsi_dn, sizeof(u->ui.gsi_dn)); quota_user_remove(u); /* free group assignment */ while ((ga = u->groups.group_next) != &u->groups) grpassign_remove(ga); /* * do not purge the hash entry. Instead, invalidate it so * that it can be activated later. */ user_invalidate(u); return (GFARM_ERR_NO_ERROR); } char * user_name(struct user *u) { return (user_is_active(u) ? u->ui.username : REMOVED_USER_NAME); } char * user_gsi_dn(struct user *u) { return (user_is_active(u) ? u->ui.gsi_dn : REMOVED_USER_NAME); } struct quota * user_quota(struct user *u) { return (&u->q); } void user_all(void *closure, void (*callback)(void *, struct user *), int active_only) { struct gfarm_hash_iterator it; struct user **u; for (gfarm_hash_iterator_begin(user_hashtab, &it); !gfarm_hash_iterator_is_end(&it); gfarm_hash_iterator_next(&it)) { u = gfarm_hash_entry_data(gfarm_hash_iterator_access(&it)); if (!active_only || user_is_active(*u)) callback(closure, *u); } } int user_in_group(struct user *user, struct group *group) { struct group_assignment *ga; if (user == NULL || group == NULL) /* either is already removed */ return (0); if (user_is_invalidated(user)) return (0); if (group_is_invalidated(group)) return (0); for (ga = user->groups.group_next; ga != &user->groups; ga = ga->group_next) { if (ga->g == group) return (1); } return (0); } int user_is_admin(struct user *user) { static struct group *admin = NULL; if (admin == NULL) admin = group_lookup(ADMIN_GROUP_NAME); return (user_in_group(user, admin)); } int user_is_root(struct user *user) { static struct group *root = NULL; if (root == NULL) root = group_lookup(ROOT_GROUP_NAME); return (user_in_group(user, root)); } /* The memory owner of `*ui' is changed to user.c */ void user_add_one(void *closure, struct gfarm_user_info *ui) { gfarm_error_t e = user_enter(ui, NULL); if (e != GFARM_ERR_NO_ERROR) gflog_warning(GFARM_MSG_1000233, "user_add_one: %s", gfarm_error_string(e)); } static void create_user(const char *username, const char *gsi_dn) { gfarm_error_t e; struct gfarm_user_info ui; static const char diag[] = "create_user"; gflog_info(GFARM_MSG_1000234, "user '%s' not found, creating...", username); ui.username = strdup_ck(username, diag); ui.realname = strdup_ck("Gfarm administrator", diag); ui.homedir = strdup_ck("/", diag); ui.gsi_dn = strdup_ck(gsi_dn == NULL ? "" : gsi_dn, diag); user_add_one(NULL, &ui); e = db_user_add(&ui); if (e != GFARM_ERR_NO_ERROR) gflog_error(GFARM_MSG_1000235, "failed to store user '%s' to storage: %s", username, gfarm_error_string(e)); } void user_init(void) { gfarm_error_t e; user_hashtab = gfarm_hash_table_alloc(USER_HASHTAB_SIZE, gfarm_hash_strptr, gfarm_hash_key_equal_strptr); user_dn_hashtab = gfarm_hash_table_alloc(USER_DN_HASHTAB_SIZE, gfarm_hash_strptr, gfarm_hash_key_equal_strptr); if (user_hashtab == NULL || user_dn_hashtab == NULL) gflog_fatal(GFARM_MSG_1000236, "no memory for user hashtab"); e = db_user_load(NULL, user_add_one); if (e != GFARM_ERR_NO_ERROR) gflog_error(GFARM_MSG_1000237, "loading users: %s", gfarm_error_string(e)); /* * there is no removed (invalidated) user since the hash is * just created. */ if (user_lookup(ADMIN_USER_NAME) == NULL) create_user(ADMIN_USER_NAME, NULL); if (gfarm_metadb_admin_user != NULL && user_lookup(gfarm_metadb_admin_user) == NULL) create_user(gfarm_metadb_admin_user, gfarm_metadb_admin_user_gsi_dn); } #ifndef TEST /* * protocol handler */ gfarm_error_t user_info_send(struct gfp_xdr *client, struct gfarm_user_info *ui) { return (gfp_xdr_send(client, "ssss", ui->username, ui->realname, ui->homedir, ui->gsi_dn)); } gfarm_error_t gfm_server_user_info_get_all(struct peer *peer, int from_client, int skip) { gfarm_error_t e; struct gfp_xdr *client = peer_get_conn(peer); struct gfarm_hash_iterator it; gfarm_int32_t nusers; struct user **u; static const char diag[] = "GFM_PROTO_USER_INFO_GET_ALL"; if (skip) return (GFARM_ERR_NO_ERROR); /* XXX FIXME too long giant lock */ giant_lock(); nusers = 0; for (gfarm_hash_iterator_begin(user_hashtab, &it); !gfarm_hash_iterator_is_end(&it); gfarm_hash_iterator_next(&it)) { u = gfarm_hash_entry_data(gfarm_hash_iterator_access(&it)); if (user_is_active(*u)) ++nusers; } e = gfm_server_put_reply(peer, diag, GFARM_ERR_NO_ERROR, "i", nusers); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001498, "gfm_server_put_reply() failed: %s", gfarm_error_string(e)); giant_unlock(); return (e); } for (gfarm_hash_iterator_begin(user_hashtab, &it); !gfarm_hash_iterator_is_end(&it); gfarm_hash_iterator_next(&it)) { u = gfarm_hash_entry_data(gfarm_hash_iterator_access(&it)); if (user_is_active(*u)) { e = user_info_send(client, &(*u)->ui); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001499, "user_info_send() failed: %s", gfarm_error_string(e)); giant_unlock(); return (e); } } } giant_unlock(); return (GFARM_ERR_NO_ERROR); } /* * We need to allow gfsd use this operation * to implement gfarm_metadb_verify_username() */ gfarm_error_t gfm_server_user_info_get_by_names(struct peer *peer, int from_client, int skip) { struct gfp_xdr *client = peer_get_conn(peer); gfarm_error_t e; gfarm_int32_t nusers; char *user, **users; int i, j, eof, no_memory = 0; struct user *u; static const char diag[] = "GFM_PROTO_USER_INFO_GET_BY_NAMES"; e = gfm_server_get_request(peer, diag, "i", &nusers); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001500, "%s: %s", diag, gfarm_error_string(e)); return (e); } GFARM_MALLOC_ARRAY(users, nusers); if (users == NULL) no_memory = 1; for (i = 0; i < nusers; i++) { e = gfp_xdr_recv(client, 0, &eof, "s", &user); if (e != GFARM_ERR_NO_ERROR || eof) { gflog_debug(GFARM_MSG_1001501, "gfp_xdr_recv() failed: %s", gfarm_error_string(e)); if (e == GFARM_ERR_NO_ERROR) /* i.e. eof */ e = GFARM_ERR_PROTOCOL; if (users != NULL) { for (j = 0; j < i; j++) { if (users[j] != NULL) free(users[j]); } free(users); } return (e); } if (users == NULL) { free(user); } else { if (user == NULL) no_memory = 1; users[i] = user; } } if (skip) { e = GFARM_ERR_NO_ERROR; goto free_user; } e = gfm_server_put_reply(peer, diag, no_memory ? GFARM_ERR_NO_MEMORY : e, ""); if (no_memory || e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001502, "gfm_server_put_reply() failed: %s", gfarm_error_string(e)); goto free_user; } /* XXX FIXME too long giant lock */ giant_lock(); for (i = 0; i < nusers; i++) { u = user_lookup(users[i]); if (u == NULL || user_is_invalidated(u)) { if (debug_mode) gflog_info(GFARM_MSG_1000238, "user lookup <%s>: failed", users[i]); e = gfm_server_put_reply(peer, diag, GFARM_ERR_NO_SUCH_USER, ""); } else { if (debug_mode) gflog_info(GFARM_MSG_1000239, "user lookup <%s>: ok", users[i]); e = gfm_server_put_reply(peer, diag, GFARM_ERR_NO_ERROR, ""); if (e == GFARM_ERR_NO_ERROR) e = user_info_send(client, &u->ui); } if (peer_had_protocol_error(peer)) break; } giant_unlock(); free_user: if (users != NULL) { for (i = 0; i < nusers; i++) { if (users[i] != NULL) free(users[i]); } free(users); } return (no_memory ? GFARM_ERR_NO_MEMORY : e); } gfarm_error_t gfm_server_user_info_get_by_gsi_dn( struct peer *peer, int from_client, int skip) { gfarm_error_t e; char *gsi_dn; struct user *u; struct gfarm_user_info *ui; static const char diag[] = "GFM_PROTO_USER_INFO_GET_BY_GSI_DN"; e = gfm_server_get_request(peer, diag, "s", &gsi_dn); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001503, "%s request: %s", diag, gfarm_error_string(e)); return (e); } if (skip) { free(gsi_dn); return (GFARM_ERR_NO_ERROR); } /* XXX FIXME too long giant lock */ giant_lock(); u = user_lookup_gsi_dn(gsi_dn); if (u == NULL || user_is_invalidated(u)) e = gfm_server_put_reply(peer, diag, GFARM_ERR_NO_SUCH_USER, ""); else { ui = &u->ui; e = gfm_server_put_reply(peer, diag, e, "ssss", ui->username, ui->realname, ui->homedir, ui->gsi_dn); } giant_unlock(); free(gsi_dn); return (e); } static gfarm_error_t user_info_verify(struct gfarm_user_info *ui, const char *diag) { if (strlen(ui->username) > GFARM_LOGIN_NAME_MAX || strlen(ui->realname) > GFARM_USER_REALNAME_MAX || strlen(ui->homedir) > GFARM_PATH_MAX || strlen(ui->gsi_dn) > GFARM_USER_GSI_DN_MAX) { gflog_debug(GFARM_MSG_1002418, "%s: invalid user info(%s, %s, %s, %s): argument too long", diag, ui->username, ui->realname, ui->homedir, ui->gsi_dn); return (GFARM_ERR_INVALID_ARGUMENT); } else { return (GFARM_ERR_NO_ERROR); } } gfarm_error_t gfm_server_user_info_set(struct peer *peer, int from_client, int skip) { struct gfarm_user_info ui; gfarm_error_t e; struct user *user = peer_get_user(peer); int do_not_free = 0; static const char diag[] = "GFM_PROTO_USER_INFO_SET"; e = gfm_server_get_request(peer, diag, "ssss", &ui.username, &ui.realname, &ui.homedir, &ui.gsi_dn); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001504, "USER_INFO_SET request failed: %s", gfarm_error_string(e)); return (e); } if (skip) { gfarm_user_info_free(&ui); return (GFARM_ERR_NO_ERROR); } giant_lock(); if (!from_client || user == NULL || !user_is_admin(user)) { gflog_debug(GFARM_MSG_1001505, "Operation is not permitted"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if (user_is_active(user_lookup(ui.username))) { e = GFARM_ERR_ALREADY_EXISTS; gflog_debug(GFARM_MSG_1001506, "User already exists"); } else if ((e = user_info_verify(&ui, diag)) != GFARM_ERR_NO_ERROR) { /* nothing to do */ } else { e = user_enter(&ui, NULL); if (e == GFARM_ERR_NO_ERROR) { e = db_user_add(&ui); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001507, "db_user_add(): %s", gfarm_error_string(e)); user_remove(ui.username); /* do not free since ui still used in hash */ do_not_free = 1; } } } if (e != GFARM_ERR_NO_ERROR && !do_not_free) gfarm_user_info_free(&ui); giant_unlock(); return (gfm_server_put_reply(peer, diag, e, "")); } gfarm_error_t gfm_server_user_info_modify(struct peer *peer, int from_client, int skip) { struct gfarm_user_info ui; struct user *u, *user = peer_get_user(peer); gfarm_error_t e; int needs_free = 0; static const char diag[] = "GFM_PROTO_USER_INFO_MODIFY"; e = gfm_server_get_request(peer, diag, "ssss", &ui.username, &ui.realname, &ui.homedir, &ui.gsi_dn); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001508, "USER_INFO_MODIFY request failed: %s", gfarm_error_string(e)); return (e); } if (skip) { gfarm_user_info_free(&ui); return (GFARM_ERR_NO_ERROR); } giant_lock(); if (!from_client || user == NULL || !user_is_admin(user)) { e = GFARM_ERR_OPERATION_NOT_PERMITTED; gflog_debug(GFARM_MSG_1001509, "operation is not permitted"); needs_free = 1; } else if ((u = user_lookup(ui.username)) == NULL || user_is_invalidated(u)) { e = GFARM_ERR_NO_SUCH_USER; gflog_debug(GFARM_MSG_1001510, "user_lookup() failed"); needs_free = 1; } else if ((e = user_info_verify(&ui, diag)) != GFARM_ERR_NO_ERROR) { needs_free = 1; } else if ((e = db_user_modify(&ui, DB_USER_MOD_REALNAME|DB_USER_MOD_HOMEDIR|DB_USER_MOD_GSI_DN)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001511, "db_user_modify() failed:%s", gfarm_error_string(e)); needs_free = 1; } else { free(u->ui.realname); free(u->ui.homedir); free(u->ui.gsi_dn); u->ui.realname = ui.realname; u->ui.homedir = ui.homedir; u->ui.gsi_dn = ui.gsi_dn; free(ui.username); } if (needs_free) gfarm_user_info_free(&ui); giant_unlock(); return (gfm_server_put_reply(peer, diag, e, "")); } gfarm_error_t user_info_remove_default(const char *username, const char *diag) { gfarm_int32_t e, e2; if ((e = user_remove(username)) == GFARM_ERR_NO_ERROR) { e2 = db_user_remove(username); if (e2 != GFARM_ERR_NO_ERROR) gflog_error(GFARM_MSG_1000240, "%s: db_user_remove: %s", diag, gfarm_error_string(e2)); } return (e); } gfarm_error_t (*user_info_remove)(const char *, const char *) = user_info_remove_default; gfarm_error_t gfm_server_user_info_remove(struct peer *peer, int from_client, int skip) { char *username; gfarm_int32_t e; struct user *user = peer_get_user(peer); static const char diag[] = "GFM_PROTO_USER_INFO_REMOVE"; e = gfm_server_get_request(peer, diag, "s", &username); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001512, "USER_INFO_REMOVE request failed:%s", gfarm_error_string(e)); return (e); } if (skip) { free(username); return (GFARM_ERR_NO_ERROR); } giant_lock(); if (!from_client || user == NULL || !user_is_admin(user)) { gflog_debug(GFARM_MSG_1001513, "operation is not permitted"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else e = user_info_remove(username, diag); free(username); giant_unlock(); return (gfm_server_put_reply(peer, diag, e, "")); } #endif /* TEST */ gfarm-2.4.1/server/gfmd/callout.h0000644000000000000000000000137411507222724015356 0ustar rootroot/* * See the following page for the overview of this module: * http://man.netbsd.se/?find=callout+9+30 * * There are some naming differences, though. * e.g. * callout_startup(9): callout_module_init() * callout_init(9) callout_new() * callout_destroy(9): callout_free() */ struct callout; struct thread_pool; void callout_module_init(int); struct callout *callout_new(void); void callout_free(struct callout *); void callout_schedule(struct callout *, int); void callout_reset(struct callout *, int, struct thread_pool *, void *(*)(void *), void *); void callout_setfunc(struct callout *, struct thread_pool *, void *(*)(void *), void *); int callout_stop(struct callout *); int callout_invoking(struct callout *); void callout_ack(struct callout *); gfarm-2.4.1/server/gfmd/db_common.c0000644000000000000000000001145011507222724015637 0ustar rootroot/* * $Id: db_common.c 4306 2010-01-09 06:14:20Z takuya-i $ */ #include #include #include #include #include "metadb_common.h" #include "quota.h" #include "db_access.h" #include "db_ops.h" #include "db_common.h" /**********************************************************************/ static void db_inode_cksum_arg_free(void *vinfo) { struct db_inode_cksum_arg *info = vinfo; if (info->type != NULL) free(info->type); if (info->sum != NULL) free(info->sum); } static void db_inode_cksum_arg_clear(void *vinfo) { struct db_inode_cksum_arg *info = vinfo; memset(info, 0, sizeof(*info)); } static int db_inode_cksum_arg_validate(void *vinfo) { struct db_inode_cksum_arg *info = vinfo; return ( info->type != NULL && info->sum != NULL ); } void db_inode_cksum_callback_trampoline(void *closure, void *vinfo) { struct db_inode_cksum_trampoline_closure *c = closure; struct db_inode_cksum_arg *info = vinfo; (*c->callback)(c->closure, info->inum, info->type, info->len, info->sum); } const struct gfarm_base_generic_info_ops db_base_inode_cksum_arg_ops = { sizeof(struct db_inode_cksum_arg), db_inode_cksum_arg_free, db_inode_cksum_arg_clear, db_inode_cksum_arg_validate, }; /**********************************************************************/ static void db_filecopy_arg_free(void *vinfo) { struct db_filecopy_arg *info = vinfo; if (info->hostname != NULL) free(info->hostname); } static void db_filecopy_arg_clear(void *vinfo) { struct db_filecopy_arg *info = vinfo; memset(info, 0, sizeof(*info)); } static int db_filecopy_arg_validate(void *vinfo) { struct db_filecopy_arg *info = vinfo; return ( info->hostname != NULL ); } void db_filecopy_callback_trampoline(void *closure, void *vinfo) { struct db_filecopy_trampoline_closure *c = closure; struct db_filecopy_arg *info = vinfo; (*c->callback)(c->closure, info->inum, info->hostname); } const struct gfarm_base_generic_info_ops db_base_filecopy_arg_ops = { sizeof(struct db_filecopy_arg), db_filecopy_arg_free, db_filecopy_arg_clear, db_filecopy_arg_validate, }; /**********************************************************************/ static void db_deadfilecopy_arg_free(void *vinfo) { struct db_deadfilecopy_arg *info = vinfo; if (info->hostname != NULL) free(info->hostname); } static void db_deadfilecopy_arg_clear(void *vinfo) { struct db_deadfilecopy_arg *info = vinfo; memset(info, 0, sizeof(*info)); } static int db_deadfilecopy_arg_validate(void *vinfo) { struct db_deadfilecopy_arg *info = vinfo; return ( info->hostname != NULL ); } void db_deadfilecopy_callback_trampoline(void *closure, void *vinfo) { struct db_deadfilecopy_trampoline_closure *c = closure; struct db_deadfilecopy_arg *info = vinfo; (*c->callback)(c->closure, info->inum, info->igen, info->hostname); } const struct gfarm_base_generic_info_ops db_base_deadfilecopy_arg_ops = { sizeof(struct db_deadfilecopy_arg), db_deadfilecopy_arg_free, db_deadfilecopy_arg_clear, db_deadfilecopy_arg_validate, }; /**********************************************************************/ static void db_direntry_arg_free(void *vinfo) { struct db_direntry_arg *info = vinfo; if (info->entry_name != NULL) free(info->entry_name); } static void db_direntry_arg_clear(void *vinfo) { struct db_direntry_arg *info = vinfo; memset(info, 0, sizeof(*info)); } static int db_direntry_arg_validate(void *vinfo) { struct db_direntry_arg *info = vinfo; return ( info->entry_name != NULL ); } void db_direntry_callback_trampoline(void *closure, void *vinfo) { struct db_direntry_trampoline_closure *c = closure; struct db_direntry_arg *info = vinfo; (*c->callback)(c->closure, info->dir_inum, info->entry_name, info->entry_len, info->entry_inum); } const struct gfarm_base_generic_info_ops db_base_direntry_arg_ops = { sizeof(struct db_direntry_arg), db_direntry_arg_free, db_direntry_arg_clear, db_direntry_arg_validate, }; /**********************************************************************/ static void db_symlink_arg_free(void *vinfo) { struct db_symlink_arg *info = vinfo; if (info->source_path != NULL) free(info->source_path); } static void db_symlink_arg_clear(void *vinfo) { struct db_symlink_arg *info = vinfo; memset(info, 0, sizeof(*info)); } static int db_symlink_arg_validate(void *vinfo) { struct db_symlink_arg *info = vinfo; return ( info->source_path != NULL ); } void db_symlink_callback_trampoline(void *closure, void *vinfo) { struct db_symlink_trampoline_closure *c = closure; struct db_symlink_arg *info = vinfo; (*c->callback)(c->closure, info->inum, info->source_path); } const struct gfarm_base_generic_info_ops db_base_symlink_arg_ops = { sizeof(struct db_symlink_arg), db_symlink_arg_free, db_symlink_arg_clear, db_symlink_arg_validate, }; gfarm-2.4.1/server/gfmd/subr.c0000644000000000000000000001175411507222724014664 0ustar rootroot#include #include #include #include #include #define GFARM_INTERNAL_USE #include #include #include #include #include "gfutil.h" #include "thrsubr.h" #include "gfp_xdr.h" #include "config.h" #include "auth.h" #include "subr.h" #include "peer.h" int debug_mode = 0; static pthread_mutex_t giant_mutex; void giant_init(void) { gfarm_mutex_init(&giant_mutex, "giant_init", "giant"); } void giant_lock(void) { gfarm_mutex_lock(&giant_mutex, "giant_lock", "giant"); } void giant_unlock(void) { gfarm_mutex_unlock(&giant_mutex, "giant_unlock", "giant"); } static void gfarm_pthread_attr_setstacksize(pthread_attr_t *attr) { int err; if (gfarm_metadb_stack_size != GFARM_METADB_STACK_SIZE_DEFAULT){ #ifdef HAVE_PTHREAD_ATTR_SETSTACKSIZE err = pthread_attr_setstacksize(attr, gfarm_metadb_stack_size); if (err != 0) gflog_warning(GFARM_MSG_1000218, "gfmd.conf: " "metadb_server_stack_size %d: %s", gfarm_metadb_stack_size, strerror(err)); #else gflog_warning(GFARM_MSG_1000219, "gfmd.conf: " "metadb_server_stack_size %d: " "configuration ignored due to lack of " "pthread_attr_setstacksize()", gfarm_metadb_stack_size); #endif } } pthread_attr_t gfarm_pthread_attr; void gfarm_pthread_attr_init(void) { int err; err = pthread_attr_init(&gfarm_pthread_attr); if (err != 0) gflog_fatal(GFARM_MSG_1000223, "pthread_attr_init(): %s", strerror(err)); err = pthread_attr_setdetachstate(&gfarm_pthread_attr, PTHREAD_CREATE_DETACHED); if (err != 0) gflog_fatal(GFARM_MSG_1000224, "PTHREAD_CREATE_DETACHED: %s", strerror(err)); gfarm_pthread_attr_setstacksize(&gfarm_pthread_attr); } pthread_attr_t * gfarm_pthread_attr_get(void) { static pthread_once_t gfarm_pthread_attr_initialized = PTHREAD_ONCE_INIT; pthread_once(&gfarm_pthread_attr_initialized, gfarm_pthread_attr_init); return (&gfarm_pthread_attr); } gfarm_error_t create_detached_thread(void *(*thread_main)(void *), void *arg) { int err; pthread_t thread_id; err = pthread_create(&thread_id, gfarm_pthread_attr_get(), thread_main, arg); return (err == 0 ? GFARM_ERR_NO_ERROR : gfarm_errno_to_error(err)); } /* only initialization routines are allowed to call this function */ char * strdup_ck(const char *s, const char *diag) { char *d = strdup(s); if (d == NULL) gflog_fatal(GFARM_MSG_1002313, "%s: strdup(%s): no memory", diag, s); return (d); } char * strdup_log(const char *s, const char *diag) { char *d = strdup(s); if (d == NULL) gflog_error(GFARM_MSG_1002358, "%s: strdup(%s): no memory", diag, s); return (d); } int accmode_to_op(gfarm_uint32_t flag) { int op; switch (flag & GFARM_FILE_ACCMODE) { case GFARM_FILE_RDONLY: op = (flag & GFARM_FILE_TRUNC) ? (GFS_R_OK|GFS_W_OK) : GFS_R_OK; break; case GFARM_FILE_WRONLY: op = GFS_W_OK; break; case GFARM_FILE_RDWR: op = GFS_R_OK|GFS_W_OK; break; case GFARM_FILE_LOOKUP: op = 0; break; default: assert(0); op = 0; } return (op); } gfarm_error_t gfm_server_get_request(struct peer *peer, const char *diag, const char *format, ...) { va_list ap; gfarm_error_t e; int eof; struct gfp_xdr *client = peer_get_conn(peer); if (debug_mode) gflog_info(GFARM_MSG_1000225, "<%s> start receiving", diag); va_start(ap, format); e = gfp_xdr_vrecv(client, 0, &eof, &format, &ap); va_end(ap); if (e != GFARM_ERR_NO_ERROR) { gflog_warning(GFARM_MSG_1000226, "%s receiving request: %s", diag, gfarm_error_string(e)); peer_record_protocol_error(peer); return (e); } if (eof) { gflog_warning(GFARM_MSG_1000227, "%s receiving request: missing RPC argument", diag); peer_record_protocol_error(peer); return (GFARM_ERR_PROTOCOL); } if (*format != '\0') gflog_fatal(GFARM_MSG_1000228, "%s receiving request: invalid format character", diag); return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfm_server_put_reply(struct peer *peer, const char *diag, gfarm_error_t ecode, const char *format, ...) { va_list ap; gfarm_error_t e; struct gfp_xdr *client = peer_get_conn(peer); if (debug_mode) gflog_info(GFARM_MSG_1000229, "<%s> sending reply: %d", diag, (int)ecode); va_start(ap, format); e = gfp_xdr_send(client, "i", (gfarm_int32_t)ecode); if (e != GFARM_ERR_NO_ERROR) { va_end(ap); gflog_warning(GFARM_MSG_1000230, "%s sending reply: %s", diag, gfarm_error_string(e)); peer_record_protocol_error(peer); return (e); } if (ecode == GFARM_ERR_NO_ERROR) { e = gfp_xdr_vsend(client, &format, &ap); if (e != GFARM_ERR_NO_ERROR) { va_end(ap); gflog_warning(GFARM_MSG_1000231, "%s sending reply: %s", diag, gfarm_error_string(e)); peer_record_protocol_error(peer); return (e); } if (*format != '\0') gflog_fatal(GFARM_MSG_1000232, "%s sending reply: %s", diag, "invalid format character"); } va_end(ap); /* do not call gfp_xdr_flush() here for a compound protocol */ return (ecode); } gfarm-2.4.1/server/gfmd/db_access.c0000644000000000000000000011017511507222724015614 0ustar rootroot/* * $Id: db_access.c 4644 2010-04-13 06:48:57Z n-soda $ */ #include #include #include #include #include #include #include #include "gfutil.h" #include "thrsubr.h" #include "config.h" #include "subr.h" #include "quota_info.h" #include "quota.h" #include "db_access.h" #include "db_ops.h" #define ALIGNMENT 8 #define ALIGN(offset) (((offset) + ALIGNMENT - 1) & ~(ALIGNMENT - 1)) typedef void (*dbq_entry_func_callback_t)(gfarm_error_t, void *); struct dbq_callback_arg { dbq_entry_func_t func; void *data; dbq_entry_func_callback_t cbfunc; void *cbdata; }; struct dbq_entry { dbq_entry_func_t func; void *data; }; struct dbq { pthread_mutex_t mutex; pthread_cond_t nonempty, nonfull, finished; int n, in, out, quitting, quited; struct dbq_entry *entries; } dbq; gfarm_error_t dbq_init(struct dbq *q) { static const char diag[] = "dbq_init"; GFARM_MALLOC_ARRAY(q->entries, gfarm_metadb_dbq_size); if (q->entries == NULL) { gflog_debug(GFARM_MSG_1001999, "allocation of 'q->entries' failed"); return (GFARM_ERR_NO_MEMORY); } gfarm_mutex_init(&q->mutex, diag, "mutex"); gfarm_cond_init(&q->nonempty, diag, "nonempty"); gfarm_cond_init(&q->nonfull, diag, "nonfull"); gfarm_cond_init(&q->finished, diag, "finished"); q->n = q->in = q->out = q->quitting = q->quited = 0; return (GFARM_ERR_NO_ERROR); } gfarm_error_t dbq_wait_to_finish(struct dbq *q) { static const char diag[] = "dbq_wait_to_finish"; gfarm_mutex_lock(&q->mutex, diag, "mutex"); q->quitting = 1; while (!q->quited) { gfarm_cond_signal(&q->nonempty, diag, "nonempty"); gfarm_cond_wait(&q->finished, &q->mutex, diag, "finished"); } gfarm_mutex_unlock(&q->mutex, diag, "mutex"); return (GFARM_ERR_NO_ERROR); } static gfarm_error_t dbq_enter(struct dbq *q, dbq_entry_func_t func, void *data) { gfarm_error_t e; static const char diag[] = "dbq_enter"; gfarm_mutex_lock(&q->mutex, diag, "mutex"); if (q->quitting) { /* * Because dbq_wait_to_finish() is only called while * giant_lock() is held, the dbq shouldn't be partial state. * So, this doesn't cause metadata inconsistency . */ e = GFARM_ERR_OPERATION_NOT_PERMITTED; gfarm_cond_signal(&q->nonempty, diag, "nonempty"); } else { e = GFARM_ERR_NO_ERROR; while (q->n >= gfarm_metadb_dbq_size) { gfarm_cond_wait(&q->nonfull, &q->mutex, diag, "nonfull"); } q->entries[q->in].func = func; q->entries[q->in].data = data; q->in++; if (q->in >= gfarm_metadb_dbq_size) q->in = 0; q->n++; gfarm_cond_signal(&q->nonempty, diag, "nonempty"); } gfarm_mutex_unlock(&q->mutex, diag, "mutex"); return (e); } /* DO NOT REMOVE: this interfaces is provided for a private extension */ /* The official gfmd source code shouldn't use these interface */ gfarm_error_t gfarm_dbq_enter(dbq_entry_func_t func, void *data) { return (dbq_enter(&dbq, func, data)); } static gfarm_error_t dbq_call_callback(void *a) { gfarm_error_t e; struct dbq_callback_arg *arg = (struct dbq_callback_arg *)a; e = (*arg->func)(arg->data); if (arg->cbfunc != NULL) { (*arg->cbfunc)(e, arg->cbdata); } free(arg); return (e); } static gfarm_error_t dbq_enter_withcallback(struct dbq *q, dbq_entry_func_t func, void *data, dbq_entry_func_callback_t cbfunc, void *cbdata) { gfarm_error_t e; struct dbq_callback_arg *arg; GFARM_MALLOC(arg); if (arg == NULL) { gflog_debug(GFARM_MSG_1002000, "allocation of 'dbq_callback_arg' failed"); return (GFARM_ERR_NO_MEMORY); } arg->func = func; arg->data = data; arg->cbfunc = cbfunc; arg->cbdata = cbdata; e = dbq_enter(q, dbq_call_callback, arg); if (e != GFARM_ERR_NO_ERROR) free(arg); return (e); } #define UNINITIALIZED_GFARM_ERROR (-1) void db_waitctx_init(struct db_waitctx *ctx) { static const char diag[] = "db_waitctx_init"; if (ctx != NULL) { gfarm_mutex_init(&ctx->lock, diag, "lock"); gfarm_cond_init(&ctx->cond, diag, "cond"); ctx->e = UNINITIALIZED_GFARM_ERROR; } } void db_waitctx_fini(struct db_waitctx *ctx) { static const char diag[] = "db_waitctx_fini"; if (ctx != NULL) { gfarm_cond_destroy(&ctx->cond, diag, "cond"); gfarm_mutex_destroy(&ctx->lock, diag, "lock"); } } static void dbq_done_callback(gfarm_error_t e, void *c) { struct db_waitctx *ctx = (struct db_waitctx *)c; static const char diag[] = "dbq_done_callback"; if (ctx != NULL) { gfarm_mutex_lock(&ctx->lock, diag, "lock"); ctx->e = e; gfarm_cond_signal(&ctx->cond, diag, "cond"); gfarm_mutex_unlock(&ctx->lock, diag, "lock"); } } gfarm_error_t dbq_waitret(struct db_waitctx *ctx) { gfarm_error_t e; static const char diag[] = "dbq_waitret"; if (ctx == NULL) return (GFARM_ERR_NO_ERROR); gfarm_mutex_lock(&ctx->lock, diag, "lock"); while (ctx->e == UNINITIALIZED_GFARM_ERROR) { gfarm_cond_wait(&ctx->cond, &ctx->lock, diag, "cond"); } e = ctx->e; gfarm_mutex_unlock(&ctx->lock, diag, "lock"); return (e); } static gfarm_error_t dbq_enter_for_waitret(struct dbq *q, dbq_entry_func_t func, void *data, struct db_waitctx *ctx) { return (dbq_enter_withcallback(q, func, data, dbq_done_callback, ctx)); } /* DO NOT REMOVE: this interfaces is provided for a private extension */ /* The official gfmd source code shouldn't use these interface */ gfarm_error_t gfarm_dbq_enter_for_waitret( dbq_entry_func_t func, void *data, struct db_waitctx *ctx) { return (dbq_enter_for_waitret(&dbq, func, data, ctx)); } gfarm_error_t dbq_delete(struct dbq *q, struct dbq_entry *entp) { gfarm_error_t e; static const char diag[] = "dbq_delete"; gfarm_mutex_lock(&q->mutex, diag, "mutex"); while (q->n <= 0 && !q->quitting) { gfarm_cond_wait(&q->nonempty, &q->mutex, diag, "nonempty"); } if (q->n <= 0) { assert(q->quitting); q->quited = 1; gfarm_cond_signal(&q->finished, diag, "finished"); e = GFARM_ERR_NO_SUCH_OBJECT; } else { /* (q->n > 0) */ e = GFARM_ERR_NO_ERROR; *entp = q->entries[q->out++]; if (q->out >= gfarm_metadb_dbq_size) q->out = 0; if (q->n-- >= gfarm_metadb_dbq_size) { gfarm_cond_signal(&q->nonfull, diag, "nonfull"); } } gfarm_mutex_unlock(&q->mutex, diag, "mutex"); return (e); } int db_getfreenum(void) { struct dbq *q = &dbq; int freenum; static const char diag[] = "db_getfreenum"; /* * This function is made only for gfm_server_findxmlattr(). */ gfarm_mutex_lock(&q->mutex, diag, "mutex"); freenum = (gfarm_metadb_dbq_size - q->n); gfarm_mutex_unlock(&q->mutex, diag, "mutex"); return (freenum); } static const struct db_ops *ops = &db_none_ops; /* DO NOT REMOVE: this interfaces is provided for a private extension */ /* The official gfmd source code shouldn't use these interface */ const struct db_ops * db_get_ops(void) { return (ops); } gfarm_error_t db_use(const struct db_ops *o) { ops = o; return (GFARM_ERR_NO_ERROR); } gfarm_error_t db_initialize(void) { dbq_init(&dbq); return ((*ops->initialize)()); } gfarm_error_t db_terminate(void) { gflog_info(GFARM_MSG_1000406, "try to stop database syncer"); dbq_wait_to_finish(&dbq); gflog_info(GFARM_MSG_1000407, "terminating the database"); return ((*ops->terminate)()); } void * db_thread(void *arg) { gfarm_error_t e; struct dbq_entry ent; for (;;) { e = dbq_delete(&dbq, &ent); if (e == GFARM_ERR_NO_ERROR) { (*ent.func)(ent.data); } else if (e == GFARM_ERR_NO_SUCH_OBJECT) break; } return (NULL); } gfarm_error_t db_begin(const char *diag) { gfarm_error_t e = dbq_enter(&dbq, (dbq_entry_func_t)ops->begin, NULL); if (e != GFARM_ERR_NO_ERROR) gflog_error(GFARM_MSG_1000408, "%s: db_begin(): %s", diag, gfarm_error_string(e)); return (e); } gfarm_error_t db_end(const char *diag) { gfarm_error_t e = dbq_enter(&dbq, (dbq_entry_func_t)ops->end, NULL); if (e != GFARM_ERR_NO_ERROR) gflog_error(GFARM_MSG_1000409, "%s: db_end(): %s", diag, gfarm_error_string(e)); return (e); } void * db_host_dup(const struct gfarm_host_info *hi, size_t size) { struct gfarm_host_info *r; size_t hsize = strlen(hi->hostname) + 1; size_t asize = strlen(hi->architecture) + 1; size_t sz; int overflow = 0; #ifdef __GNUC__ /* workaround gcc warning: might be used uninitialized */ r = NULL; #endif /* XXX FIXME missing hostaliases */ /* LDAP needs this extra NULL at the end of r->hostaliases[] */ sz = gfarm_size_add(&overflow, size, hsize + asize); if (!overflow) r = malloc(sz); if (overflow || r == NULL) { gflog_debug(GFARM_MSG_1002001, "allocation of 'gfarm_host_info' failed or overflow"); return (NULL); } r->hostname = (char *)r + size; r->architecture = r->hostname + hsize; strcpy(r->hostname, hi->hostname); r->port = hi->port; r->nhostaliases = 0; r->hostaliases = NULL; /* LDAP needs this extra NULL at the end of r->hostaliases[] */ strcpy(r->architecture, hi->architecture); r->ncpu = hi->ncpu; r->flags = hi->flags; return (r); } gfarm_error_t db_host_add(const struct gfarm_host_info *hi) { struct gfarm_host_info *h = db_host_dup(hi, sizeof(*h)); if (h == NULL) { gflog_debug(GFARM_MSG_1002002, "db_host_dup() failed"); return (GFARM_ERR_NO_MEMORY); } return (dbq_enter(&dbq, (dbq_entry_func_t)ops->host_add, h)); } gfarm_error_t db_host_modify(const struct gfarm_host_info *hi, int modflags, int add_count, const char **add_aliases, int del_count, const char **del_aliases) { struct db_host_modify_arg *arg = db_host_dup(hi, sizeof(*arg)); if (arg == NULL) { gflog_debug(GFARM_MSG_1002003, "db_host_dup() failed"); return (GFARM_ERR_NO_MEMORY); } arg->modflags = modflags; /* XXX FIXME missing hostaliases */ arg->add_count = 0; arg->add_aliases = NULL; arg->del_count = 0; arg->del_aliases = NULL; return (dbq_enter(&dbq, (dbq_entry_func_t)ops->host_modify, arg)); } gfarm_error_t db_host_remove(const char *hostname) { char *h = strdup_log(hostname, "db_host_remove"); if (h == NULL) return (GFARM_ERR_NO_MEMORY); return (dbq_enter(&dbq, (dbq_entry_func_t)ops->host_remove, h)); } gfarm_error_t db_host_load(void *closure, void (*callback)(void *, struct gfarm_host_info *)) { return ((*ops->host_load)(closure, callback)); } void * db_user_dup(const struct gfarm_user_info *ui, size_t size) { struct gfarm_user_info *r; size_t usize = strlen(ui->username) + 1; size_t rsize = strlen(ui->realname) + 1; size_t hsize = strlen(ui->homedir) + 1; size_t gsize = strlen(ui->gsi_dn) + 1; size_t sz; int overflow = 0; #ifdef __GNUC__ /* workaround gcc warning: might be used uninitialized */ r = NULL; #endif sz = gfarm_size_add(&overflow, size, usize + rsize + hsize + gsize); if (!overflow) r = malloc(sz); if (overflow || r == NULL) { gflog_debug(GFARM_MSG_1002005, "allocation of 'gfarm_user_info' failed or overflow"); return (NULL); } r->username = (char *)r + size; r->realname = r->username + usize; r->homedir = r->realname + rsize; r->gsi_dn = r->homedir + hsize; strcpy(r->username, ui->username); strcpy(r->realname, ui->realname); strcpy(r->homedir, ui->homedir); strcpy(r->gsi_dn, ui->gsi_dn); return (r); } gfarm_error_t db_user_add(const struct gfarm_user_info *ui) { struct gfarm_user_info *u = db_user_dup(ui, sizeof(*u)); if (u == NULL) { gflog_debug(GFARM_MSG_1002006, "db_user_dup() failed"); return (GFARM_ERR_NO_MEMORY); } return (dbq_enter(&dbq, (dbq_entry_func_t)ops->user_add, u)); } gfarm_error_t db_user_modify(const struct gfarm_user_info *ui, int modflags) { struct db_user_modify_arg *arg = db_user_dup(ui, sizeof(*arg)); if (arg == NULL) { gflog_debug(GFARM_MSG_1002007, "db_user_dup() failed"); return (GFARM_ERR_NO_MEMORY); } arg->modflags = modflags; return (dbq_enter(&dbq, (dbq_entry_func_t)ops->user_modify, arg)); } gfarm_error_t db_user_remove(const char *username) { char *u = strdup_log(username, "db_user_remove"); if (u == NULL) return (GFARM_ERR_NO_MEMORY); return (dbq_enter(&dbq, (dbq_entry_func_t)ops->user_remove, u)); } gfarm_error_t db_user_load(void *closure, void (*callback)(void *, struct gfarm_user_info *)) { return ((*ops->user_load)(closure, callback)); } void * db_group_dup(const struct gfarm_group_info *gi, size_t size) { struct gfarm_group_info *r; size_t gsize = strlen(gi->groupname) + 1; size_t users_size; size_t sz; int overflow = 0; int i; #ifdef __GNUC__ /* workaround gcc warning: might be used uninitialized */ r = NULL; #endif size = ALIGN(size); users_size = 0; for (i = 0; i < gi->nusers; i++) users_size = gfarm_size_add(&overflow, users_size, strlen(gi->usernames[i]) + 1); /* LDAP needs this extra NULL at the end of r->usernames[] */ sz = gfarm_size_add(&overflow, size, gfarm_size_add(&overflow, gfarm_size_mul(&overflow, sizeof(*r->usernames), gfarm_size_add(&overflow, gi->nusers, 1)), gfarm_size_add(&overflow, gsize, users_size))); if (!overflow) r = malloc(sz); if (overflow || r == NULL) { gflog_debug(GFARM_MSG_1002009, "allocation of 'gfarm_group_info' failed or overflow"); return (NULL); } r->usernames = (char **)((char *)r + size); r->groupname = (char *)r->usernames + sizeof(*r->usernames) * (gi->nusers + 1); users_size = 0; for (i = 0; i < gi->nusers; i++) { r->usernames[i] = r->groupname + gsize + users_size; users_size += strlen(gi->usernames[i]) + 1; } /* LDAP needs this extra NULL at the end of r->usernames[] */ r->usernames[gi->nusers] = NULL; strcpy(r->groupname, gi->groupname); r->nusers = gi->nusers; for (i = 0; i < gi->nusers; i++) strcpy(r->usernames[i], gi->usernames[i]); return (r); } gfarm_error_t db_group_add(const struct gfarm_group_info *gi) { struct gfarm_group_info *g = db_group_dup(gi, sizeof(*g)); if (g == NULL) { gflog_debug(GFARM_MSG_1002010, "db_group_dup() failed"); return (GFARM_ERR_NO_MEMORY); } return (dbq_enter(&dbq, (dbq_entry_func_t)ops->group_add, g)); } gfarm_error_t db_group_modify(const struct gfarm_group_info *gi, int modflags, int add_count, const char **add_users, int del_count, const char **del_users) { int i; struct db_group_modify_arg *arg; size_t size, users_size; int overflow = 0; char *p; #ifdef __GNUC__ /* workaround gcc warning: might be used uninitialized */ arg = NULL; #endif users_size = 0; for (i = 0; i < add_count; i++) users_size = gfarm_size_add(&overflow, users_size, strlen(add_users[i]) + 1); for (i = 0; i < del_count; i++) users_size = gfarm_size_add(&overflow, users_size, strlen(del_users[i]) + 1); size = gfarm_size_add(&overflow, gfarm_size_add(&overflow, gfarm_size_mul(&overflow, sizeof(*arg->add_users), add_count), gfarm_size_mul(&overflow, sizeof(*arg->del_users), del_count)), gfarm_size_add(&overflow, ALIGN(sizeof(*arg)), users_size)); if (!overflow) arg = db_group_dup(gi, size); if (overflow || arg == NULL) { gflog_debug(GFARM_MSG_1002011, "overflow occurred or db_group_dup() failed"); return (GFARM_ERR_NO_MEMORY); } arg->add_users = (char **)((char *)arg + ALIGN(sizeof(*arg))); arg->del_users = (char **)((char *)arg->add_users + sizeof(*arg->add_users) * add_count); p = (char *)arg->del_users + sizeof(*arg->del_users) * del_count; users_size = 0; for (i = 0; i < add_count; i++) { arg->add_users[i] = p + users_size; users_size += strlen(add_users[i]) + 1; } for (i = 0; i < del_count; i++) { arg->del_users[i] = p + users_size; users_size += strlen(del_users[i]) + 1; } arg->modflags = modflags; arg->add_count = add_count; arg->del_count = del_count; for (i = 0; i < add_count; i++) strcpy(arg->add_users[i], add_users[i]); for (i = 0; i < del_count; i++) strcpy(arg->del_users[i], del_users[i]); return (dbq_enter(&dbq, (dbq_entry_func_t)ops->group_modify, arg)); } gfarm_error_t db_group_remove(const char *groupname) { char *g = strdup_log(groupname, "db_group_remove"); if (g == NULL) return (GFARM_ERR_NO_MEMORY); return (dbq_enter(&dbq, (dbq_entry_func_t)ops->group_remove, g)); } gfarm_error_t db_group_load(void *closure, void (*callback)(void *, struct gfarm_group_info *)) { return ((*ops->group_load)(closure, callback)); } struct gfs_stat * db_inode_dup(const struct gfs_stat *st, size_t size) { struct gfs_stat *r; size_t usize = strlen(st->st_user) + 1; size_t gsize = strlen(st->st_group) + 1; size_t sz; int overflow = 0; #ifdef __GNUC__ /* workaround gcc warning: might be used uninitialized */ r = NULL; #endif sz = gfarm_size_add(&overflow, size, usize + gsize); if (!overflow) r = malloc(sz); if (overflow || r == NULL) { gflog_debug(GFARM_MSG_1002013, "allocation of 'gfs_stat' failed or overflow"); return (NULL); } r->st_user = (char *)r + size; r->st_group = r->st_user + usize; r->st_ino = st->st_ino; r->st_gen = st->st_gen; r->st_mode = st->st_mode; r->st_nlink = st->st_nlink; strcpy(r->st_user, st->st_user); strcpy(r->st_group, st->st_group); r->st_size = st->st_size; r->st_ncopy = st->st_ncopy; r->st_atimespec = st->st_atimespec; r->st_mtimespec = st->st_mtimespec; r->st_ctimespec = st->st_ctimespec; return (r); } gfarm_error_t db_inode_add(const struct gfs_stat *st) { struct gfs_stat *i = db_inode_dup(st, sizeof(*i)); if (i == NULL) { gflog_debug(GFARM_MSG_1002014, "db_inode_dup() failed"); return (GFARM_ERR_NO_MEMORY); } return (dbq_enter(&dbq, (dbq_entry_func_t)ops->inode_add, i)); } gfarm_error_t db_inode_modify(const struct gfs_stat *st) { struct gfs_stat *i = db_inode_dup(st, sizeof(*i)); if (i == NULL) { gflog_debug(GFARM_MSG_1002015, "db_inode_dup() failed"); return (GFARM_ERR_NO_MEMORY); } return (dbq_enter(&dbq, (dbq_entry_func_t)ops->inode_modify, i)); } gfarm_error_t db_inode_gen_modify(gfarm_ino_t inum, gfarm_uint64_t gen) { struct db_inode_uint64_modify_arg *arg; GFARM_MALLOC(arg); if (arg == NULL) { gflog_debug(GFARM_MSG_1002290, "allocation of 'db_inode_uint64_modify_arg' failed"); return (GFARM_ERR_NO_MEMORY); } arg->inum = inum; arg->uint64 = gen; return (dbq_enter(&dbq, (dbq_entry_func_t)ops->inode_gen_modify, arg)); } gfarm_error_t db_inode_nlink_modify(gfarm_ino_t inum, gfarm_uint64_t nlink) { struct db_inode_uint64_modify_arg *arg; GFARM_MALLOC(arg); if (arg == NULL) { gflog_debug(GFARM_MSG_1002016, "allocation of 'db_inode_uint64_modify_arg' failed"); return (GFARM_ERR_NO_MEMORY); } arg->inum = inum; arg->uint64 = nlink; return (dbq_enter(&dbq, (dbq_entry_func_t)ops->inode_nlink_modify, arg)); } gfarm_error_t db_inode_size_modify(gfarm_ino_t inum, gfarm_off_t size) { struct db_inode_uint64_modify_arg *arg; GFARM_MALLOC(arg); if (arg == NULL) { gflog_debug(GFARM_MSG_1002017, "allocation of 'db_inode_uint64_modify_arg' failed"); return (GFARM_ERR_NO_MEMORY); } arg->inum = inum; arg->uint64 = size; return (dbq_enter(&dbq, (dbq_entry_func_t)ops->inode_size_modify, arg)); } gfarm_error_t db_inode_mode_modify(gfarm_ino_t inum, gfarm_mode_t mode) { struct db_inode_uint32_modify_arg *arg; GFARM_MALLOC(arg); if (arg == NULL) { gflog_debug(GFARM_MSG_1002018, "allocation of 'db_inode_uint32_modify_arg' failed"); return (GFARM_ERR_NO_MEMORY); } arg->inum = inum; arg->uint32 = mode; return (dbq_enter(&dbq, (dbq_entry_func_t)ops->inode_mode_modify, arg)); } gfarm_error_t db_inode_user_modify(gfarm_ino_t inum, const char *user) { struct db_inode_string_modify_arg *arg; size_t sz; int overflow = 0; sz = gfarm_size_add(&overflow, sizeof(*arg), gfarm_size_add(&overflow, strlen(user), 1)); if (!overflow) arg = malloc(sz); if (overflow || arg == NULL) { gflog_debug(GFARM_MSG_1002019, "allocation of 'db_inode_string_modify_arg' failed " "or overflow"); return (GFARM_ERR_NO_MEMORY); } arg->string = (char *)arg + sizeof(*arg); arg->inum = inum; strcpy(arg->string, user); return (dbq_enter(&dbq, (dbq_entry_func_t)ops->inode_user_modify, arg)); } gfarm_error_t db_inode_group_modify(gfarm_ino_t inum, const char *group) { struct db_inode_string_modify_arg *arg; size_t sz; int overflow = 0; sz = gfarm_size_add(&overflow, sizeof(*arg), gfarm_size_add(&overflow, strlen(group), 1)); if (!overflow) arg = malloc(sz); if (overflow || arg == NULL) { gflog_debug(GFARM_MSG_1002020, "allocation of 'db_inode_string_modify_arg' failed"); return (GFARM_ERR_NO_MEMORY); } arg->string = (char *)arg + sizeof(*arg); arg->inum = inum; strcpy(arg->string, group); return (dbq_enter(&dbq, (dbq_entry_func_t)ops->inode_group_modify, arg)); } gfarm_error_t db_inode_atime_modify(gfarm_ino_t inum, struct gfarm_timespec *atime) { struct db_inode_timespec_modify_arg *arg; GFARM_MALLOC(arg); if (arg == NULL) { gflog_debug(GFARM_MSG_1002021, "allocation of 'db_inode_timespec_modify_arg' failed"); return (GFARM_ERR_NO_MEMORY); } arg->inum = inum; arg->time = *atime; return (dbq_enter(&dbq, (dbq_entry_func_t)ops->inode_atime_modify, arg)); } gfarm_error_t db_inode_mtime_modify(gfarm_ino_t inum, struct gfarm_timespec *mtime) { struct db_inode_timespec_modify_arg *arg; GFARM_MALLOC(arg); if (arg == NULL) { gflog_debug(GFARM_MSG_1002022, "allocation of 'db_inode_timespec_modify_arg' failed"); return (GFARM_ERR_NO_MEMORY); } arg->inum = inum; arg->time = *mtime; return (dbq_enter(&dbq, (dbq_entry_func_t)ops->inode_mtime_modify, arg)); } gfarm_error_t db_inode_ctime_modify(gfarm_ino_t inum, struct gfarm_timespec *ctime) { struct db_inode_timespec_modify_arg *arg; GFARM_MALLOC(arg); if (arg == NULL) { gflog_debug(GFARM_MSG_1002023, "allocation of 'db_inode_timespec_modify_arg' failed"); return (GFARM_ERR_NO_MEMORY); } arg->inum = inum; arg->time = *ctime; return (dbq_enter(&dbq, (dbq_entry_func_t)ops->inode_ctime_modify, arg)); } gfarm_error_t db_inode_load(void *closure, void (*callback)(void *, struct gfs_stat *)) { return ((*ops->inode_load)(closure, callback)); } struct db_inode_cksum_arg * db_inode_cksum_arg_alloc(gfarm_ino_t inum, const char *type, size_t len, const char *sum) { size_t tsize = strlen(type) + 1; size_t sz; int overflow = 0; struct db_inode_cksum_arg *arg; #ifdef __GNUC__ /* workaround gcc warning: might be used uninitialized */ arg = NULL; #endif sz = gfarm_size_add(&overflow, sizeof(*arg) + tsize, gfarm_size_add(&overflow, len, 1)); if (!overflow) arg = malloc(sz); if (overflow || arg == NULL) { gflog_debug(GFARM_MSG_1002024, "allocation of 'db_inode_cksum_arg' failed or " "overflow"); return (NULL); } arg->type = (char *)arg + sizeof(*arg); arg->sum = arg->type + tsize; arg->inum = inum; strcpy(arg->type, type); memcpy(arg->sum, sum, len + 1); return (arg); } gfarm_error_t db_inode_cksum_add(gfarm_ino_t inum, const char *type, size_t len, const char *sum) { struct db_inode_cksum_arg *arg = db_inode_cksum_arg_alloc(inum, type, len, sum); if (arg == NULL) { gflog_debug(GFARM_MSG_1002025, "db_inode_cksum_arg_alloc() failed"); return (GFARM_ERR_NO_MEMORY); } return (dbq_enter(&dbq, (dbq_entry_func_t)ops->inode_cksum_add, arg)); } gfarm_error_t db_inode_cksum_modify(gfarm_ino_t inum, const char *type, size_t len, const char *sum) { struct db_inode_cksum_arg *arg = db_inode_cksum_arg_alloc(inum, type, len, sum); if (arg == NULL) { gflog_debug(GFARM_MSG_1002026, "db_inode_cksum_arg_alloc() failed"); return (GFARM_ERR_NO_MEMORY); } return (dbq_enter(&dbq, (dbq_entry_func_t)ops->inode_cksum_modify, arg)); } gfarm_error_t db_inode_cksum_remove(gfarm_ino_t inum) { struct db_inode_inum_arg *arg; GFARM_MALLOC(arg); if (arg == NULL) { gflog_debug(GFARM_MSG_1002027, "allocation of 'db_inode_inum_arg' failed"); return (GFARM_ERR_NO_MEMORY); } arg->inum = inum; return (dbq_enter(&dbq, (dbq_entry_func_t)ops->inode_cksum_remove, arg)); } gfarm_error_t db_inode_cksum_load(void *closure, void (*callback)(void *, gfarm_ino_t, char *, size_t, char *)) { return ((*ops->inode_cksum_load)(closure, callback)); } struct db_filecopy_arg * db_filecopy_arg_alloc(gfarm_ino_t inum, const char *hostname) { size_t hsize = strlen(hostname) + 1; struct db_filecopy_arg *arg; size_t sz; int overflow = 0; sz = gfarm_size_add(&overflow, sizeof(*arg), hsize); if (!overflow) arg = malloc(sz); if (overflow || arg == NULL) { gflog_debug(GFARM_MSG_1002028, "allocation of 'db_filecopy_arg' failed or overflow"); return (NULL); } arg->hostname = (char *)arg + sizeof(*arg); arg->inum = inum; strcpy(arg->hostname, hostname); return (arg); } gfarm_error_t db_filecopy_add(gfarm_ino_t inum, const char *hostname) { struct db_filecopy_arg *arg = db_filecopy_arg_alloc(inum, hostname); if (arg == NULL) { gflog_debug(GFARM_MSG_1002029, "db_filecopy_arg_alloc() failed"); return (GFARM_ERR_NO_MEMORY); } return (dbq_enter(&dbq, (dbq_entry_func_t)ops->filecopy_add, arg)); } gfarm_error_t db_filecopy_remove(gfarm_ino_t inum, const char *hostname) { struct db_filecopy_arg *arg = db_filecopy_arg_alloc(inum, hostname); if (arg == NULL) { gflog_debug(GFARM_MSG_1002030, "db_filecopy_arg_alloc() failed"); return (GFARM_ERR_NO_MEMORY); } return (dbq_enter(&dbq, (dbq_entry_func_t)ops->filecopy_remove, arg)); } gfarm_error_t db_filecopy_load(void *closure, void (*callback)(void *, gfarm_ino_t, char *)) { return ((*ops->filecopy_load)(closure, callback)); } struct db_deadfilecopy_arg * db_deadfilecopy_arg_alloc(gfarm_ino_t inum, gfarm_uint64_t igen, const char *hostname) { size_t hsize = strlen(hostname) + 1; struct db_deadfilecopy_arg *arg; size_t sz; int overflow = 0; sz = gfarm_size_add(&overflow, sizeof(*arg), hsize); if (!overflow) arg = malloc(sz); if (overflow || arg == NULL) { gflog_debug(GFARM_MSG_1002031, "allocation of 'db_deadfilecopy_arg' failed or " "overflow"); return (NULL); } arg->hostname = (char *)arg + sizeof(*arg); arg->inum = inum; arg->igen = igen; strcpy(arg->hostname, hostname); return (arg); } gfarm_error_t db_deadfilecopy_add(gfarm_ino_t inum, gfarm_uint64_t igen, const char *hostname) { struct db_deadfilecopy_arg *arg = db_deadfilecopy_arg_alloc(inum, igen, hostname); if (arg == NULL) { gflog_debug(GFARM_MSG_1002032, "db_deadfilecopy_arg_alloc() failed"); return (GFARM_ERR_NO_MEMORY); } return (dbq_enter(&dbq, (dbq_entry_func_t)ops->deadfilecopy_add, arg)); } gfarm_error_t db_deadfilecopy_remove(gfarm_ino_t inum, gfarm_uint64_t igen, const char *hostname) { struct db_deadfilecopy_arg *arg = db_deadfilecopy_arg_alloc(inum, igen, hostname); if (arg == NULL) { gflog_debug(GFARM_MSG_1002033, "db_deadfilecopy_arg_alloc() failed"); return (GFARM_ERR_NO_MEMORY); } return (dbq_enter(&dbq, (dbq_entry_func_t)ops->deadfilecopy_remove, arg)); } gfarm_error_t db_deadfilecopy_load(void *closure, void (*callback)(void *, gfarm_ino_t, gfarm_uint64_t, char *)) { return ((*ops->deadfilecopy_load)(closure, callback)); } struct db_direntry_arg * db_direntry_arg_alloc( gfarm_ino_t dir_inum, const char *entry_name, int entry_len, gfarm_ino_t entry_inum) { struct db_direntry_arg *arg; size_t sz; int overflow = 0; sz = gfarm_size_add(&overflow, sizeof(*arg), entry_len + 1); if (!overflow) arg = malloc(sz); if (overflow || arg == NULL) { gflog_debug(GFARM_MSG_1002034, "allocation of 'db_direntry_arg' failed or overflow"); return (NULL); } arg->entry_name = (char *)arg + sizeof(*arg); arg->dir_inum = dir_inum; memcpy(arg->entry_name, entry_name, entry_len); arg->entry_name[entry_len] = '\0'; arg->entry_len = entry_len; arg->entry_inum = entry_inum; return (arg); } gfarm_error_t db_direntry_add(gfarm_ino_t dir_inum, const char *entry_name, int entry_len, gfarm_ino_t entry_inum) { struct db_direntry_arg *arg = db_direntry_arg_alloc(dir_inum, entry_name, entry_len, entry_inum); if (arg == NULL) { gflog_debug(GFARM_MSG_1002035, "db_direntry_arg_alloc() failed"); return (GFARM_ERR_NO_MEMORY); } return (dbq_enter(&dbq, (dbq_entry_func_t)ops->direntry_add, arg)); } gfarm_error_t db_direntry_remove(gfarm_ino_t dir_inum, const char *entry_name, int entry_len) { struct db_direntry_arg *arg = db_direntry_arg_alloc(dir_inum, entry_name, entry_len, 0); if (arg == NULL) { gflog_debug(GFARM_MSG_1002036, "db_direntry_arg_alloc() failed"); return (GFARM_ERR_NO_MEMORY); } return (dbq_enter(&dbq, (dbq_entry_func_t)ops->direntry_remove, arg)); } gfarm_error_t db_direntry_load(void *closure, void (*callback)(void *, gfarm_ino_t, char *, int, gfarm_ino_t)) { return ((*ops->direntry_load)(closure, callback)); } struct db_symlink_arg * db_symlink_arg_alloc(gfarm_ino_t inum, const char *source_path) { struct db_symlink_arg *arg; size_t sz; int overflow = 0; sz = gfarm_size_add(&overflow, sizeof(*arg), strlen(source_path) + 1); if (!overflow) arg = malloc(sz); if (overflow || arg == NULL) { gflog_debug(GFARM_MSG_1002037, "allocation of 'db_symlink_arg' failed or overflow"); return (NULL); } arg->source_path = (char *)arg + sizeof(*arg); arg->inum = inum; strcpy(arg->source_path, source_path); return (arg); } gfarm_error_t db_symlink_add(gfarm_ino_t inum, const char *source_path) { struct db_symlink_arg *arg = db_symlink_arg_alloc(inum, source_path); if (arg == NULL) { gflog_debug(GFARM_MSG_1002038, "db_symlink_arg_alloc() failed"); return (GFARM_ERR_NO_MEMORY); } return (dbq_enter(&dbq, (dbq_entry_func_t)ops->symlink_add, arg)); } gfarm_error_t db_symlink_remove(gfarm_ino_t inum) { struct db_inode_inum_arg *arg; GFARM_MALLOC(arg); if (arg == NULL) { gflog_debug(GFARM_MSG_1002039, "allocation of 'db_inode_inum_arg' failed"); return (GFARM_ERR_NO_MEMORY); } arg->inum = inum; return (dbq_enter(&dbq, (dbq_entry_func_t)ops->symlink_remove, arg)); } gfarm_error_t db_symlink_load(void *closure, void (*callback)(void *, gfarm_ino_t, char *)) { return ((*ops->symlink_load)(closure, callback)); } static struct db_xattr_arg * db_xattr_arg_alloc(char *attrname, size_t valsize) { struct db_xattr_arg *arg; size_t size; int overflow = 0; size = gfarm_size_add(&overflow, sizeof(*arg), valsize); if (attrname != NULL) { size = gfarm_size_add(&overflow, size, strlen(attrname) + 1); } if (!overflow) arg = malloc(size); if (overflow || arg == NULL) { gflog_debug(GFARM_MSG_1002040, "allocation of 'db_xattr_arg' failed or overflow"); return (NULL); } memset(arg, 0, sizeof(*arg)); /* NOTE: we allow valsize == 0 as a valid xattr_add/modify argment */ arg->value = arg + 1; if (attrname != NULL) { arg->attrname = (char *)(arg + 1) + valsize; strcpy(arg->attrname, attrname); } return (arg); } gfarm_error_t db_xattr_add(int xmlMode, gfarm_ino_t inum, char *attrname, void *value, size_t size, struct db_waitctx *waitctx) { gfarm_error_t e; struct db_xattr_arg *arg = db_xattr_arg_alloc(attrname, size); if (arg == NULL) { gflog_debug(GFARM_MSG_1002041, "db_xattr_arg_alloc() failed"); return (GFARM_ERR_NO_ERROR); } arg->xmlMode = xmlMode; arg->inum = inum; memcpy(arg->value, value, size); arg->size = size; if (waitctx != NULL) { /* * NOTE: EINVAL returns from PostgreSQL if value is * invalid XML data. We must wait to check it. * Same as db_xattr_modify(). */ e = dbq_enter_for_waitret(&dbq, (dbq_entry_func_t)ops->xattr_add, arg, waitctx); } else e = dbq_enter(&dbq, (dbq_entry_func_t)ops->xattr_add, arg); return (e); } gfarm_error_t db_xattr_modify(int xmlMode, gfarm_ino_t inum, char *attrname, void *value, size_t size, struct db_waitctx *waitctx) { gfarm_error_t e; struct db_xattr_arg *arg = db_xattr_arg_alloc(attrname, size); if (arg == NULL) { gflog_debug(GFARM_MSG_1002042, "db_xattr_arg_alloc() failed"); return (GFARM_ERR_NO_ERROR); } arg->xmlMode = xmlMode; arg->inum = inum; memcpy(arg->value, value, size); arg->size = size; if (waitctx != NULL) e = dbq_enter_for_waitret(&dbq, (dbq_entry_func_t)ops->xattr_modify, arg, waitctx); else e = dbq_enter(&dbq, (dbq_entry_func_t)ops->xattr_modify, arg); return (e); } gfarm_error_t db_xattr_remove(int xmlMode, gfarm_ino_t inum, char *attrname) { struct db_xattr_arg *arg = db_xattr_arg_alloc(attrname, 0); if (arg == NULL) { gflog_debug(GFARM_MSG_1002043, "db_xattr_arg_alloc() failed"); return (GFARM_ERR_NO_ERROR); } arg->xmlMode = xmlMode; arg->inum = inum; return (dbq_enter(&dbq, (dbq_entry_func_t)ops->xattr_remove, arg)); } gfarm_error_t db_xattr_removeall(int xmlMode, gfarm_ino_t inum) { if (ops->xattr_removeall != NULL) { struct db_xattr_arg *arg = db_xattr_arg_alloc(NULL, 0); if (arg == NULL) { gflog_debug(GFARM_MSG_1002044, "db_xattr_arg_alloc() failed"); return (GFARM_ERR_NO_ERROR); } arg->xmlMode = xmlMode; arg->inum = inum; return (dbq_enter(&dbq, (dbq_entry_func_t)ops->xattr_removeall, arg)); } else return (GFARM_ERR_OPERATION_NOT_SUPPORTED); } gfarm_error_t db_xattr_get(int xmlMode, gfarm_ino_t inum, char *attrname, void **valuep, size_t *sizep, struct db_waitctx *waitctx) { struct db_xattr_arg *arg = db_xattr_arg_alloc(attrname, 0); if (arg == NULL) { gflog_debug(GFARM_MSG_1002045, "db_xattr_arg_alloc() failed"); return (GFARM_ERR_NO_ERROR); } arg->xmlMode = xmlMode; arg->inum = inum; arg->valuep = valuep; arg->sizep = sizep; return (dbq_enter_for_waitret(&dbq, (dbq_entry_func_t)ops->xattr_get, arg, waitctx)); } gfarm_error_t db_xattr_load(void *closure, void (*callback)(void *, struct xattr_info *)) { return ((*ops->xattr_load)(closure, callback)); } gfarm_error_t db_xmlattr_find(gfarm_ino_t inum, const char *expr, gfarm_error_t (*foundcallback)(void *, int, void *), void *foundcbdata, void (*callback)(gfarm_error_t, void *), void *cbdata) { struct db_xmlattr_find_arg *arg; GFARM_MALLOC(arg); if (arg == NULL) { gflog_debug(GFARM_MSG_1002046, "allocation of 'db_xmlattr_find_arg' failed"); return (GFARM_ERR_NO_ERROR); } arg->inum = inum; arg->expr = expr; arg->foundcallback = foundcallback; arg->foundcbdata = foundcbdata; return (dbq_enter_withcallback(&dbq, (dbq_entry_func_t)ops->xmlattr_find, arg, (dbq_entry_func_callback_t)callback, cbdata)); } /* quota */ static struct db_quota_arg * db_quota_arg_alloc(const struct quota *q, const char *name, int is_group) { struct db_quota_arg *arg; size_t sz; int overflow = 0; int name_len = strlen(name); sz = gfarm_size_add(&overflow, sizeof(*arg), name_len + 1); if (!overflow) arg = malloc(sz); if (overflow || arg == NULL) { gflog_debug(GFARM_MSG_1002047, "allocation of 'db_quota_arg' failed or overflow"); return (NULL); } arg->name = (char *)arg + sizeof(*arg); arg->quota = *q; arg->is_group = is_group; strcpy(arg->name, name); return (arg); } static gfarm_error_t db_quota_set_common(struct quota *q, const char *name, int is_group) { struct db_quota_arg *arg = db_quota_arg_alloc(q, name, is_group); if (arg == NULL) { gflog_debug(GFARM_MSG_1002048, "db_quota_arg_alloc() failed"); return (GFARM_ERR_NO_MEMORY); } if (q->on_db) return (dbq_enter(&dbq, (dbq_entry_func_t)ops->quota_modify, arg)); else return (dbq_enter(&dbq, (dbq_entry_func_t)ops->quota_add, arg)); } gfarm_error_t db_quota_user_set(struct quota *q, const char *username) { return (db_quota_set_common(q, username, 0)); } gfarm_error_t db_quota_group_set(struct quota *q, const char *groupname) { return (db_quota_set_common(q, groupname, 1)); } static struct db_quota_remove_arg * db_quota_remove_arg_alloc(const char *name, int is_group) { struct db_quota_remove_arg *arg; size_t sz; int overflow = 0; int name_len = strlen(name); sz = gfarm_size_add(&overflow, sizeof(*arg), name_len + 1); if (!overflow) arg = malloc(sz); if (overflow || arg == NULL) { gflog_debug(GFARM_MSG_1002049, "allocation of 'db_quota_remove_arg' failed or " "overflow"); return (NULL); } arg->name = (char *)arg + sizeof(*arg); arg->is_group = is_group; strcpy(arg->name, name); return (arg); } static gfarm_error_t db_quota_remove_common(const char *name, int is_group) { struct db_quota_remove_arg *arg = db_quota_remove_arg_alloc(name, is_group); if (arg == NULL) { gflog_debug(GFARM_MSG_1002050, "db_quota_remove_arg_alloc() failed"); return (GFARM_ERR_NO_MEMORY); } return (dbq_enter(&dbq, (dbq_entry_func_t)ops->quota_remove, arg)); } gfarm_error_t db_quota_user_remove(const char *username) { return (db_quota_remove_common(username, 0)); } gfarm_error_t db_quota_group_remove(const char *groupname) { return (db_quota_remove_common(groupname, 1)); } gfarm_error_t db_quota_user_load(void *closure, void (*callback)(void *, struct gfarm_quota_info *)) { return ((*ops->quota_load)(closure, 0, callback)); } gfarm_error_t db_quota_group_load(void *closure, void (*callback)(void *, struct gfarm_quota_info *)) { return ((*ops->quota_load)(closure, 1, callback)); } gfarm-2.4.1/server/gfmd/gfmd.c0000644000000000000000000010532011507222724014617 0ustar rootroot/* * $Id: gfmd.c 5018 2010-12-30 08:35:34Z tatebe $ */ #include #include #include #include #include #include #include /* TCP_NODELAY */ #include /* getprotobyname() */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "gfutil.h" #include "thrsubr.h" #include "liberror.h" #include "gfp_xdr.h" #include "io_fd.h" #include "hostspec.h" #include "sockopt.h" #include "auth.h" #include "config.h" #include "gfm_proto.h" #include "gfj_client.h" #include "gfpath.h" #include "gfarm_auth.h" /* gfarmAuthInitialize(), gfarmAuthFinalize() */ #include "subr.h" #include "thrpool.h" #include "callout.h" #include "db_access.h" #include "host.h" #include "user.h" #include "group.h" #include "peer.h" #include "inode.h" #include "dead_file_copy.h" #include "process.h" #include "fs.h" #include "job.h" #include "back_channel.h" #include "xattr.h" #include "quota.h" #include "gfmd.h" #include "protocol_state.h" #ifdef SOMAXCONN #define LISTEN_BACKLOG SOMAXCONN #else #define LISTEN_BACKLOG 5 #endif #ifndef GFMD_CONFIG #define GFMD_CONFIG "/etc/gfmd.conf" #endif /* limit maximum connections, when system limit is very high */ #ifndef GFMD_CONNECTION_LIMIT #define GFMD_CONNECTION_LIMIT 65536 #endif #ifndef CALLOUT_NTHREADS /* * this is number of thread pools which are used by callouts, * so thrpool_add_job() in callout_main() won't be blocked for long time. * * currently, only back_channel_send_thread_pool is called from callouts. */ #define CALLOUT_NTHREADS 1 #endif char *program_name = "gfmd"; static struct protoent *tcp_proto; static char *pid_file; struct thread_pool *authentication_thread_pool; struct thread_pool *sync_protocol_thread_pool; /* this interface is exported for a use from a private extension */ gfarm_error_t gfm_server_protocol_extension_default(struct peer *peer, int from_client, int skip, int level, gfarm_int32_t request, gfarm_int32_t *requestp, gfarm_error_t *on_errorp) { gflog_warning(GFARM_MSG_1000181, "unknown request: %d", request); peer_record_protocol_error(peer); return (GFARM_ERR_PROTOCOL); } /* this interface is made as a hook for a private extension */ gfarm_error_t (*gfm_server_protocol_extension)(struct peer *, int, int, int, gfarm_int32_t, gfarm_int32_t *, gfarm_error_t *) = gfm_server_protocol_extension_default; gfarm_error_t protocol_switch(struct peer *peer, int from_client, int skip, int level, gfarm_int32_t *requestp, gfarm_error_t *on_errorp, int *suspendedp) { gfarm_error_t e, e2; gfarm_int32_t request; e = gfp_xdr_recv_request_command(peer_get_conn(peer), 0, NULL, &request); if (e != GFARM_ERR_NO_ERROR) { if (e == GFARM_ERR_UNEXPECTED_EOF) { e = GFARM_ERR_NO_ERROR; } else { gflog_warning(GFARM_MSG_1000180, "receiving request number: %s", gfarm_error_string(e)); } peer_record_protocol_error(peer); /* mark this peer finished */ return (e); } switch (request) { case GFM_PROTO_HOST_INFO_GET_ALL: e = gfm_server_host_info_get_all(peer, from_client, skip); break; case GFM_PROTO_HOST_INFO_GET_BY_ARCHITECTURE: e = gfm_server_host_info_get_by_architecture(peer, from_client, skip); break; case GFM_PROTO_HOST_INFO_GET_BY_NAMES: e = gfm_server_host_info_get_by_names(peer, from_client, skip); break; case GFM_PROTO_HOST_INFO_GET_BY_NAMEALIASES: e = gfm_server_host_info_get_by_namealiases(peer, from_client, skip); break; case GFM_PROTO_HOST_INFO_SET: e = gfm_server_host_info_set(peer, from_client, skip); break; case GFM_PROTO_HOST_INFO_MODIFY: e = gfm_server_host_info_modify(peer, from_client, skip); break; case GFM_PROTO_HOST_INFO_REMOVE: e = gfm_server_host_info_remove(peer, from_client, skip); break; case GFM_PROTO_USER_INFO_GET_ALL: e = gfm_server_user_info_get_all(peer, from_client, skip); break; case GFM_PROTO_USER_INFO_GET_BY_NAMES: e = gfm_server_user_info_get_by_names(peer, from_client, skip); break; case GFM_PROTO_USER_INFO_SET: e = gfm_server_user_info_set(peer, from_client, skip); break; case GFM_PROTO_USER_INFO_MODIFY: e = gfm_server_user_info_modify(peer, from_client, skip); break; case GFM_PROTO_USER_INFO_REMOVE: e = gfm_server_user_info_remove(peer, from_client, skip); break; case GFM_PROTO_USER_INFO_GET_BY_GSI_DN: e = gfm_server_user_info_get_by_gsi_dn( peer, from_client, skip); break; case GFM_PROTO_GROUP_INFO_GET_ALL: e = gfm_server_group_info_get_all(peer, from_client, skip); break; case GFM_PROTO_GROUP_INFO_GET_BY_NAMES: e = gfm_server_group_info_get_by_names(peer, from_client, skip); break; case GFM_PROTO_GROUP_INFO_SET: e = gfm_server_group_info_set(peer, from_client, skip); break; case GFM_PROTO_GROUP_INFO_MODIFY: e = gfm_server_group_info_modify(peer, from_client, skip); break; case GFM_PROTO_GROUP_INFO_REMOVE: e = gfm_server_group_info_remove(peer, from_client, skip); break; case GFM_PROTO_GROUP_INFO_ADD_USERS: e = gfm_server_group_info_add_users(peer, from_client, skip); break; case GFM_PROTO_GROUP_INFO_REMOVE_USERS: e = gfm_server_group_info_remove_users(peer, from_client, skip); break; case GFM_PROTO_GROUP_NAMES_GET_BY_USERS: e = gfm_server_group_names_get_by_users(peer, from_client, skip); break; case GFM_PROTO_COMPOUND_BEGIN: e = gfm_server_compound_begin(peer, from_client, skip, level); break; case GFM_PROTO_COMPOUND_END: e = gfm_server_compound_end(peer, from_client, skip, level); break; case GFM_PROTO_COMPOUND_ON_ERROR: e = gfm_server_compound_on_error(peer, from_client, skip, level, on_errorp); break; case GFM_PROTO_GET_FD: e = gfm_server_get_fd(peer, from_client, skip); break; case GFM_PROTO_PUT_FD: e = gfm_server_put_fd(peer, from_client, skip); break; case GFM_PROTO_SAVE_FD: e = gfm_server_save_fd(peer, from_client, skip); break; case GFM_PROTO_RESTORE_FD: e = gfm_server_restore_fd(peer, from_client, skip); break; case GFM_PROTO_CREATE: e = gfm_server_create(peer, from_client, skip); break; case GFM_PROTO_OPEN: e = gfm_server_open(peer, from_client, skip); break; case GFM_PROTO_OPEN_ROOT: e = gfm_server_open_root(peer, from_client, skip); break; case GFM_PROTO_OPEN_PARENT: e = gfm_server_open_parent(peer, from_client, skip); break; case GFM_PROTO_CLOSE: e = gfm_server_close(peer, from_client, skip); break; case GFM_PROTO_VERIFY_TYPE: e = gfm_server_verify_type(peer, from_client, skip); break; case GFM_PROTO_VERIFY_TYPE_NOT: e = gfm_server_verify_type_not(peer, from_client, skip); break; case GFM_PROTO_BEQUEATH_FD: e = gfm_server_bequeath_fd(peer, from_client, skip); break; case GFM_PROTO_INHERIT_FD: e = gfm_server_inherit_fd(peer, from_client, skip); break; case GFM_PROTO_FSTAT: e = gfm_server_fstat(peer, from_client, skip); break; case GFM_PROTO_FUTIMES: e = gfm_server_futimes(peer, from_client, skip); break; case GFM_PROTO_FCHMOD: e = gfm_server_fchmod(peer, from_client, skip); break; case GFM_PROTO_FCHOWN: e = gfm_server_fchown(peer, from_client, skip); break; case GFM_PROTO_CKSUM_GET: e = gfm_server_cksum_get(peer, from_client, skip); break; case GFM_PROTO_CKSUM_SET: e = gfm_server_cksum_set(peer, from_client, skip); break; case GFM_PROTO_SCHEDULE_FILE: e = gfm_server_schedule_file(peer, from_client, skip); break; case GFM_PROTO_SCHEDULE_FILE_WITH_PROGRAM: e = gfm_server_schedule_file_with_program(peer, from_client, skip); break; case GFM_PROTO_FGETATTRPLUS: e = gfm_server_fgetattrplus(peer, from_client, skip); break; case GFM_PROTO_REMOVE: e = gfm_server_remove(peer, from_client, skip); break; case GFM_PROTO_RENAME: e = gfm_server_rename(peer, from_client, skip); break; case GFM_PROTO_FLINK: e = gfm_server_flink(peer, from_client, skip); break; case GFM_PROTO_MKDIR: e = gfm_server_mkdir(peer, from_client, skip); break; case GFM_PROTO_SYMLINK: e = gfm_server_symlink(peer, from_client, skip); break; case GFM_PROTO_READLINK: e = gfm_server_readlink(peer, from_client, skip); break; case GFM_PROTO_GETDIRPATH: e = gfm_server_getdirpath(peer, from_client, skip); break; case GFM_PROTO_GETDIRENTS: e = gfm_server_getdirents(peer, from_client, skip); break; case GFM_PROTO_SEEK: e = gfm_server_seek(peer, from_client, skip); break; case GFM_PROTO_GETDIRENTSPLUS: e = gfm_server_getdirentsplus(peer, from_client, skip); break; case GFM_PROTO_GETDIRENTSPLUSXATTR: e = gfm_server_getdirentsplusxattr(peer, from_client, skip); break; case GFM_PROTO_REOPEN: e = gfm_server_reopen(peer, from_client, skip, suspendedp); break; case GFM_PROTO_CLOSE_READ: e = gfm_server_close_read(peer, from_client, skip); break; #ifdef COMPAT_GFARM_2_3 case GFM_PROTO_CLOSE_WRITE: e = gfm_server_close_write(peer, from_client, skip); break; #endif case GFM_PROTO_CLOSE_WRITE_V2_4: e = gfm_server_close_write_v2_4(peer, from_client, skip, suspendedp); break; case GFM_PROTO_GENERATION_UPDATED: e = gfm_server_generation_updated(peer, from_client, skip); break; case GFM_PROTO_LOCK: e = gfm_server_lock(peer, from_client, skip); break; case GFM_PROTO_TRYLOCK: e = gfm_server_trylock(peer, from_client, skip); break; case GFM_PROTO_UNLOCK: e = gfm_server_unlock(peer, from_client, skip); break; case GFM_PROTO_LOCK_INFO: e = gfm_server_lock_info(peer, from_client, skip); break; #ifdef COMPAT_GFARM_2_3 case GFM_PROTO_SWITCH_BACK_CHANNEL: e = gfm_server_switch_back_channel(peer, from_client, skip); /* should not call gfp_xdr_flush() due to race */ *requestp = request; return (e); #endif case GFM_PROTO_SWITCH_ASYNC_BACK_CHANNEL: e = gfm_server_switch_async_back_channel(peer, from_client, skip); /* should not call gfp_xdr_flush() due to race */ *requestp = request; return (e); case GFM_PROTO_GLOB: e = gfm_server_glob(peer, from_client, skip); break; case GFM_PROTO_SCHEDULE: e = gfm_server_schedule(peer, from_client, skip); break; case GFM_PROTO_PIO_OPEN: e = gfm_server_pio_open(peer, from_client, skip); break; case GFM_PROTO_PIO_SET_PATHS: e = gfm_server_pio_set_paths(peer, from_client, skip); break; case GFM_PROTO_PIO_CLOSE: e = gfm_server_pio_close(peer, from_client, skip); break; case GFM_PROTO_PIO_VISIT: e = gfm_server_pio_visit(peer, from_client, skip); break; case GFM_PROTO_HOSTNAME_SET: e = gfm_server_hostname_set(peer, from_client, skip); break; case GFM_PROTO_SCHEDULE_HOST_DOMAIN: e = gfm_server_schedule_host_domain(peer, from_client, skip); break; case GFM_PROTO_STATFS: e = gfm_server_statfs(peer, from_client, skip); break; case GFM_PROTO_REPLICA_LIST_BY_NAME: e = gfm_server_replica_list_by_name(peer, from_client, skip); break; case GFM_PROTO_REPLICA_LIST_BY_HOST: e = gfm_server_replica_list_by_host(peer, from_client, skip); break; case GFM_PROTO_REPLICA_REMOVE_BY_HOST: e = gfm_server_replica_remove_by_host(peer, from_client, skip); break; case GFM_PROTO_REPLICA_REMOVE_BY_FILE: e = gfm_server_replica_remove_by_file(peer, from_client, skip); break; case GFM_PROTO_REPLICA_INFO_GET: e = gfm_server_replica_info_get(peer, from_client, skip); break; case GFM_PROTO_REPLICATE_FILE_FROM_TO: e = gfm_server_replicate_file_from_to(peer, from_client, skip); break; case GFM_PROTO_REPLICA_ADDING: e = gfm_server_replica_adding(peer, from_client, skip, suspendedp); break; case GFM_PROTO_REPLICA_ADDED: /* obsolete protocol */ e = gfm_server_replica_added(peer, from_client, skip); break; case GFM_PROTO_REPLICA_ADDED2: e = gfm_server_replica_added2(peer, from_client, skip); break; case GFM_PROTO_REPLICA_LOST: e = gfm_server_replica_lost(peer, from_client, skip); break; case GFM_PROTO_REPLICA_ADD: e = gfm_server_replica_add(peer, from_client, skip); break; case GFM_PROTO_PROCESS_ALLOC: e = gfm_server_process_alloc(peer, from_client, skip); break; case GFM_PROTO_PROCESS_ALLOC_CHILD: e = gfm_server_process_alloc_child(peer, from_client, skip); break; case GFM_PROTO_PROCESS_FREE: e = gfm_server_process_free(peer, from_client, skip); break; case GFM_PROTO_PROCESS_SET: e = gfm_server_process_set(peer, from_client, skip); break; case GFJ_PROTO_LOCK_REGISTER: e = gfj_server_lock_register(peer, from_client, skip); break; case GFJ_PROTO_UNLOCK_REGISTER: e = gfj_server_unlock_register(peer, from_client, skip); break; case GFJ_PROTO_REGISTER: e = gfj_server_register(peer, from_client, skip); break; case GFJ_PROTO_UNREGISTER: e = gfj_server_unregister(peer, from_client, skip); break; case GFJ_PROTO_REGISTER_NODE: e = gfj_server_register_node(peer, from_client, skip); break; case GFJ_PROTO_LIST: e = gfj_server_list(peer, from_client, skip); break; case GFJ_PROTO_INFO: e = gfj_server_info(peer, from_client, skip); break; case GFJ_PROTO_HOSTINFO: e = gfj_server_hostinfo(peer, from_client, skip); break; case GFM_PROTO_XATTR_SET: e = gfm_server_setxattr(peer, from_client, skip, 0); break; case GFM_PROTO_XMLATTR_SET: e = gfm_server_setxattr(peer, from_client, skip, 1); break; case GFM_PROTO_XATTR_GET: e = gfm_server_getxattr(peer, from_client, skip, 0); break; case GFM_PROTO_XMLATTR_GET: e = gfm_server_getxattr(peer, from_client, skip, 1); break; case GFM_PROTO_XATTR_REMOVE: e = gfm_server_removexattr(peer, from_client, skip, 0); break; case GFM_PROTO_XMLATTR_REMOVE: e = gfm_server_removexattr(peer, from_client, skip, 1); break; case GFM_PROTO_XATTR_LIST: e = gfm_server_listxattr(peer, from_client, skip, 0); break; case GFM_PROTO_XMLATTR_LIST: e = gfm_server_listxattr(peer, from_client, skip, 1); break; case GFM_PROTO_XMLATTR_FIND: e = gfm_server_findxmlattr(peer, from_client, skip); break; case GFM_PROTO_QUOTA_USER_GET: e = gfm_server_quota_user_get(peer, from_client, skip); break; case GFM_PROTO_QUOTA_USER_SET: e = gfm_server_quota_user_set(peer, from_client, skip); break; case GFM_PROTO_QUOTA_GROUP_GET: e = gfm_server_quota_group_get(peer, from_client, skip); break; case GFM_PROTO_QUOTA_GROUP_SET: e = gfm_server_quota_group_set(peer, from_client, skip); break; case GFM_PROTO_QUOTA_CHECK: e = gfm_server_quota_check(peer, from_client, skip); break; default: e = gfm_server_protocol_extension(peer, from_client, skip, level, request, requestp, on_errorp); break; } if (!*suspendedp && ((level == 0 && request != GFM_PROTO_COMPOUND_BEGIN) || request == GFM_PROTO_COMPOUND_END)) { /* flush only when a COMPOUND loop is done */ if (debug_mode) gflog_debug(GFARM_MSG_1000182, "gfp_xdr_flush"); e2 = gfp_xdr_flush(peer_get_conn(peer)); if (e2 != GFARM_ERR_NO_ERROR) { gflog_warning(GFARM_MSG_1000183, "protocol flush: %s", gfarm_error_string(e2)); peer_record_protocol_error(peer); } if (e == GFARM_ERR_NO_ERROR) e = e2; } *requestp = request; /* continue unless protocol error happens */ return (e); } void compound_state_init(struct compound_state *cs) { cs->current_part = GFARM_ERR_NO_ERROR; cs->cause = GFARM_ERR_NO_ERROR; cs->skip = 0; } void protocol_state_init(struct protocol_state *ps) { ps->nesting_level = 0; } /* this interface is exported for a use from a private extension */ int protocol_service(struct peer *peer) { struct protocol_state *ps = peer_get_protocol_state(peer); struct compound_state *cs = &ps->cs; gfarm_error_t e, dummy; gfarm_int32_t request; int from_client; int suspended = 0; int transaction = 0; static const char diag[] = "protocol_service"; from_client = peer_get_auth_id_type(peer) == GFARM_AUTH_ID_TYPE_USER; if (ps->nesting_level == 0) { /* top level */ e = protocol_switch(peer, from_client, 0, 0, &request, &dummy, &suspended); if (suspended) return (1); /* finish */ giant_lock(); peer_fdpair_clear(peer); if (peer_had_protocol_error(peer)) { if (db_begin(diag) == GFARM_ERR_NO_ERROR) transaction = 1; /* * the following internally calls inode_close*() and * closing must be done regardless of the result of * db_begin(). because not closing may cause * descriptor leak. */ peer_free(peer); if (transaction) db_end(diag); giant_unlock(); return (1); /* finish */ } giant_unlock(); } else { /* inside of a COMPOUND block */ e = protocol_switch(peer, from_client, cs->skip, 1, &request, &cs->current_part, &suspended); if (suspended) return (1); /* finish */ if (peer_had_protocol_error(peer)) { giant_lock(); peer_fdpair_clear(peer); if (db_begin(diag) == GFARM_ERR_NO_ERROR) transaction = 1; /* * the following internally calls inode_close*() and * closing must be done regardless of the result of * db_begin(). because not closing may cause * descriptor leak. */ peer_free(peer); if (transaction) db_end(diag); giant_unlock(); return (1); /* finish */ } if (e != GFARM_ERR_NO_ERROR) { /* * set cs->cause, if it's first error at a main part * of a COMPOUND block */ gflog_debug(GFARM_MSG_1001481, "protocol_switch() failed inside of a " "COMPOUND block: %s", gfarm_error_string(e)); if (cs->cause == GFARM_ERR_NO_ERROR && !cs->skip) cs->cause = e; cs->skip = 1; } else if (request == GFM_PROTO_COMPOUND_END) { giant_lock(); peer_fdpair_clear(peer); giant_unlock(); ps->nesting_level--; } else if (request == GFM_PROTO_COMPOUND_ON_ERROR) { cs->skip = cs->current_part != cs->cause; } } if ( #ifdef COMPAT_GFARM_2_3 request == GFM_PROTO_SWITCH_BACK_CHANNEL || #endif request == GFM_PROTO_SWITCH_ASYNC_BACK_CHANNEL) { if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001482, "failed to process GFM_PROTO_SWITCH_BACK_" "CHANNEL request: %s", gfarm_error_string(e)); giant_lock(); if (db_begin(diag) == GFARM_ERR_NO_ERROR) transaction = 1; /* * the following internally calls inode_close*() and * closing must be done regardless of the result of * db_begin(). because not closing may cause * descriptor leak. */ peer_free(peer); if (transaction) db_end(diag); giant_unlock(); } return (1); /* finish */ } if (e == GFARM_ERR_NO_ERROR && request == GFM_PROTO_COMPOUND_BEGIN) { ps->nesting_level++; compound_state_init(&ps->cs); } return (0); /* still doing */ } /* this interface is exported for a use from a private extension */ void * protocol_main(void *arg) { struct peer *peer = arg; /* * the reason we call peer_invoked() here is just for consistency, * because currently this is unnecessary for a foreground channel. */ peer_invoked(peer); do { if (protocol_service(peer)) return (NULL); /* end of gfmd protocol session */ } while (gfp_xdr_recv_is_ready(peer_get_conn(peer))); /* * NOTE: * We should use do...while loop for the above gfp_xdr_recv_is_ready() * case, instead of thrpool_add_job() like peer_authorized(). * Because this thread is executed under thrpool_worker(), * and such thread should not use thrpool_add_job(). * Think about the following scenario: * (1) massive number of new connections filled thrpool.jobq. * (2) at the same time, all threads under thrpool_worker() * were protocol_main(). * (3) The gfp_xdr_recv_is_ready() condition became true with * all the protocol_main() threads. * With this scenario, if protocol_main() tried thrpool_add_job(), then * they would wait forever, because thrpool.jobq were already filled, * and there was no chance that the jobq became available. */ peer_watch_access(peer); /* this return value won't be used, because this thread is detached */ return (NULL); } struct resuming_queue { pthread_mutex_t mutex; pthread_cond_t nonempty; struct event_waiter *queue; } resuming_pendings = { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, NULL }; void resuming_enqueue(struct event_waiter *entry) { struct resuming_queue *q = &resuming_pendings; static const char diag[] = "resuming_enqueue"; gfarm_mutex_lock(&q->mutex, diag, "mutex"); entry->next = q->queue; q->queue = entry; gfarm_cond_signal(&q->nonempty, diag, "nonempty"); gfarm_mutex_unlock(&q->mutex, diag, "mutex"); } struct event_waiter * resuming_dequeue(struct resuming_queue *q, const char *diag) { struct event_waiter *entry; gfarm_mutex_lock(&q->mutex, diag, "mutex"); while (q->queue == NULL) gfarm_cond_wait(&q->nonempty, &q->mutex, diag, "nonempty"); entry = q->queue; q->queue = entry->next; gfarm_mutex_unlock(&q->mutex, diag, "mutex"); return (entry); } void * resuming_thread(void *arg) { struct event_waiter *entry = arg; struct peer *peer = entry->peer; int suspended = 0; (*entry->action)(peer, entry->arg, &suspended); free(entry); if (suspended) return (NULL); if (gfp_xdr_recv_is_ready(peer_get_conn(peer))) protocol_main(peer); /* this return value won't be used, because this thread is detached */ return (NULL); } void * resumer(void *arg) { struct event_waiter *entry; static const char diag[] = "resumer"; for (;;) { entry = resuming_dequeue(&resuming_pendings, diag); thrpool_add_job(sync_protocol_thread_pool, resuming_thread, entry); } /*NOTREACHED*/ return (NULL); } /* only called in case of gfarm_auth_id_type == GFARM_AUTH_ID_TYPE_USER */ gfarm_error_t auth_uid_to_global_username(void *closure, enum gfarm_auth_method auth_method, const char *auth_user_id, char **global_usernamep) { char *global_username; struct user *u; static const char diag[] = "auth_uid_to_global_username"; giant_lock(); if (GFARM_IS_AUTH_GSI(auth_method)) { /* auth_user_id is a DN */ u = user_lookup_gsi_dn(auth_user_id); } else { /* auth_user_id is a gfarm global user name */ u = user_lookup(auth_user_id); } giant_unlock(); if (u == NULL || user_is_invalidated(u)) { /* * do not return GFARM_ERR_NO_SUCH_USER * to prevent information leak */ gflog_debug(GFARM_MSG_1001483, "lookup for user failed"); return (GFARM_ERR_AUTHENTICATION); } if (global_usernamep == NULL) return (GFARM_ERR_NO_ERROR); global_username = strdup_log(user_name(u), diag); if (global_username == NULL) return (GFARM_ERR_NO_MEMORY); *global_usernamep = global_username; return (GFARM_ERR_NO_ERROR); } gfarm_error_t peer_authorize(struct peer *peer) { gfarm_error_t e; int rv, saved_errno; enum gfarm_auth_id_type id_type; char *username = NULL, *hostname; enum gfarm_auth_method auth_method; struct sockaddr addr; socklen_t addrlen = sizeof(addr); char addr_string[GFARM_SOCKADDR_STRLEN]; static const char diag[] = "peer_authorize"; /* without TCP_NODELAY, gfmd is too slow at least on NetBSD-3.0 */ rv = 1; setsockopt(gfp_xdr_fd(peer_get_conn(peer)), tcp_proto->p_proto, TCP_NODELAY, &rv, sizeof(rv)); rv = getpeername(gfp_xdr_fd(peer_get_conn(peer)), &addr, &addrlen); if (rv == -1) { saved_errno = errno; gflog_error(GFARM_MSG_1000184, "authorize: getpeername: %s", strerror(errno)); return (gfarm_errno_to_error(saved_errno)); } e = gfarm_sockaddr_to_name(&addr, &hostname); if (e != GFARM_ERR_NO_ERROR) { gfarm_sockaddr_to_string(&addr, addr_string, GFARM_SOCKADDR_STRLEN); gflog_warning(GFARM_MSG_1000185, "gfarm_sockaddr_to_name(%s): %s", gfarm_error_string(e), addr_string); hostname = strdup_log(addr_string, diag); if (hostname == NULL) return (GFARM_ERR_NO_MEMORY); } e = gfarm_authorize(peer_get_conn(peer), 0, GFM_SERVICE_TAG, hostname, &addr, auth_uid_to_global_username, NULL, &id_type, &username, &auth_method); if (e == GFARM_ERR_NO_ERROR) { protocol_state_init(peer_get_protocol_state(peer)); giant_lock(); peer_authorized(peer, id_type, username, hostname, &addr, auth_method); giant_unlock(); } else { gflog_warning(GFARM_MSG_1002474, "host %s: authorize: %s", hostname, gfarm_error_string(e)); free(hostname); } return (e); } void * try_auth(void *arg) { struct peer *peer = arg; gfarm_error_t e; if ((e = peer_authorize(peer)) != GFARM_ERR_NO_ERROR) { gflog_warning(GFARM_MSG_1000188, "peer_authorize: %s", gfarm_error_string(e)); giant_lock(); /* db_begin()/db_end() is not necessary in this case */ peer_free(peer); giant_unlock(); } /* this return value won't be used, because this thread is detached */ return (NULL); } void accepting_loop(int accepting_socket) { gfarm_error_t e; int client_socket; struct sockaddr_in client_addr; socklen_t client_addr_size; struct peer *peer; for (;;) { client_addr_size = sizeof(client_addr); client_socket = accept(accepting_socket, (struct sockaddr *)&client_addr, &client_addr_size); if (client_socket < 0) { if (errno != EINTR) gflog_warning_errno(GFARM_MSG_1000189, "accept"); } else if ((e = peer_alloc(client_socket, &peer)) != GFARM_ERR_NO_ERROR) { gflog_warning(GFARM_MSG_1000190, "peer_alloc: %s", gfarm_error_string(e)); close(client_socket); } else { thrpool_add_job(authentication_thread_pool, try_auth, peer); } } } int open_accepting_socket(int port) { gfarm_error_t e; struct sockaddr_in self_addr; socklen_t self_addr_size; int sock, sockopt; memset(&self_addr, 0, sizeof(self_addr)); self_addr.sin_family = AF_INET; self_addr.sin_addr.s_addr = INADDR_ANY; self_addr.sin_port = htons(port); self_addr_size = sizeof(self_addr); sock = socket(PF_INET, SOCK_STREAM, 0); if (sock < 0) gflog_fatal_errno(GFARM_MSG_1000191, "accepting socket"); sockopt = 1; if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &sockopt, sizeof(sockopt)) == -1) gflog_warning_errno(GFARM_MSG_1000192, "SO_REUSEADDR"); if (bind(sock, (struct sockaddr *)&self_addr, self_addr_size) < 0) gflog_fatal_errno(GFARM_MSG_1000193, "bind accepting socket"); e = gfarm_sockopt_apply_listener(sock); if (e != GFARM_ERR_NO_ERROR) gflog_warning(GFARM_MSG_1000194, "setsockopt: %s", gfarm_error_string(e)); if (listen(sock, LISTEN_BACKLOG) < 0) gflog_fatal_errno(GFARM_MSG_1000195, "listen"); return (sock); } static void write_pid() { FILE *pid_fp; if (pid_file == NULL) return; pid_fp = fopen(pid_file, "w"); if (pid_fp == NULL) gflog_fatal_errno(GFARM_MSG_1000196, "open: %s", pid_file); if (fprintf(pid_fp, "%ld\n", (long)getpid()) == -1) gflog_error_errno(GFARM_MSG_1002351, "writing PID to %s", pid_file); if (fclose(pid_fp) != 0) gflog_error_errno(GFARM_MSG_1002352, "fclose(%s)", pid_file); } void sigs_set(sigset_t *sigs) { if (sigemptyset(sigs) == -1) gflog_fatal_errno(GFARM_MSG_1002353, "sigemptyset()"); sigaddset(sigs, SIGHUP); #ifdef __NetBSD__ /* NetBSD 4 delivers SIGINT to gfmd even under gdb */ if (!debug_mode) #endif if (sigaddset(sigs, SIGINT) == -1) gflog_fatal_errno(GFARM_MSG_1002354, "sigaddset(SIGINT)"); if (sigaddset(sigs, SIGTERM) == -1) gflog_fatal_errno(GFARM_MSG_1002355, "sigaddset(SIGTERM)"); #ifdef SIGINFO if (sigaddset(sigs, SIGINFO) == -1) gflog_fatal_errno(GFARM_MSG_1002356, "sigaddset(SIGINFO)"); #endif if (sigaddset(sigs, SIGUSR2) == -1) gflog_fatal_errno(GFARM_MSG_1002357, "sigaddset(SIGUSR2)"); } void * sigs_handler(void *p) { sigset_t *sigs = p; int sig; int transaction = 0; static const char diag[] = "sigs_handler"; #ifdef __linux__ /* A Linux Thread is a process having its own process id. */ write_pid(pid_file); #endif for (;;) { if (sigwait(sigs, &sig) == -1) gflog_warning(GFARM_MSG_1000197, "sigs_handler: %s", strerror(errno)); #ifdef __linux__ /* * On linux-2.6.11 on Fedora Core 4, * spurious signal sig=8195840 arrives. * On debian-etch 4.0, signal 0 arrives. */ if (sig == 0 || (sig >= 16 #ifdef SIGINFO && sig != SIGINFO #endif && sig != SIGUSR2)) { gflog_info(GFARM_MSG_1000198, "spurious signal %d received: ignoring...", sig); continue; } #endif switch (sig) { case SIGHUP: /* reload the grid-mapfile */ #ifdef HAVE_GSI giant_lock(); gfarmAuthFinalize(); (void)gfarmAuthInitialize(GRID_MAPFILE); giant_unlock(); #endif continue; #ifdef SIGINFO case SIGINFO: /*FALLTHRU*/ #endif case SIGUSR2: thrpool_info(); continue; default: break; } break; } gflog_info(GFARM_MSG_1000199, "signal %d received: terminating...", sig); /* we never release the giant lock until exit */ /* so, it's safe to modify the state of all peers */ giant_lock(); gflog_info(GFARM_MSG_1000201, "shutting down peers"); if (db_begin(diag) == GFARM_ERR_NO_ERROR) transaction = 1; /* * the following internally calls inode_close*() and * closing must be done regardless of the result of db_begin(). * because not closing may cause descriptor leak. */ peer_shutdown_all(); if (transaction) db_end(diag); /* save all pending transactions */ /* db_terminate() needs giant_lock(), see comment in dbq_enter() */ db_terminate(); gflog_info(GFARM_MSG_1000202, "bye"); exit(0); /*NOTREACHED*/ return (0); /* to shut up warning */ } void usage(void) { fprintf(stderr, "Usage: %s [option]\n", program_name); fprintf(stderr, "option:\n"); fprintf(stderr, "\t-L \n"); fprintf(stderr, "\t-P \n"); fprintf(stderr, "\t-d\t\t\t\t... debug mode\n"); fprintf(stderr, "\t-f \n"); fprintf(stderr, "\t-p \n"); fprintf(stderr, "\t-s \n"); fprintf(stderr, "\t-v\t\t\t\t... make authentication log verbose\n"); exit(1); } /* this interface is exported for a use from a private extension */ void gfmd_modules_init_default(int table_size) { authentication_thread_pool = thrpool_new(gfarm_metadb_thread_pool_size, gfarm_metadb_job_queue_length, "authentication threads"); sync_protocol_thread_pool = thrpool_new(gfarm_metadb_thread_pool_size, gfarm_metadb_job_queue_length, "synchronous protocol threads"); if (authentication_thread_pool == NULL || sync_protocol_thread_pool == NULL) gflog_fatal(GFARM_MSG_1001485, "thread pool size:%d, queue length:%d: no memory", gfarm_metadb_thread_pool_size, gfarm_metadb_job_queue_length); callout_module_init(CALLOUT_NTHREADS); back_channel_init(); /* directory service */ host_init(); user_init(); group_init(); /* filesystem */ inode_init_desired_number(); inode_init(); dir_entry_init(); file_copy_init(); symlink_init(); xattr_init(); quota_init(); /* must be after hosts and filesystem */ dead_file_copy_init(); peer_init(table_size, sync_protocol_thread_pool, protocol_main); job_table_init(table_size); } /* this interface is made as a hook for a private extension */ void (*gfmd_modules_init)(int); /* intentionally remains uninitialized */ int main(int argc, char **argv) { gfarm_error_t e; char *config_file = NULL, *port_number = NULL; int syslog_level = -1; int syslog_facility = GFARM_DEFAULT_FACILITY; int ch, sock, table_size; sigset_t sigs; if (argc >= 1) program_name = basename(argv[0]); gflog_set_identifier(program_name); while ((ch = getopt(argc, argv, "L:P:df:p:s:v")) != -1) { switch (ch) { case 'L': syslog_level = gflog_syslog_name_to_priority(optarg); if (syslog_level == -1) gflog_fatal(GFARM_MSG_1000203, "-L %s: invalid syslog priority", optarg); break; case 'P': pid_file = optarg; break; case 'd': debug_mode = 1; if (syslog_level == -1) syslog_level = LOG_DEBUG; break; case 'f': config_file = optarg; break; case 'p': port_number = optarg; break; case 's': syslog_facility = gflog_syslog_name_to_facility(optarg); if (syslog_facility == -1) gflog_fatal(GFARM_MSG_1000204, "%s: unknown syslog facility", optarg); break; case 'v': gflog_auth_set_verbose(1); break; case '?': default: usage(); } } argc -= optind; argv += optind; tcp_proto = getprotobyname("tcp"); if (tcp_proto == NULL) gflog_fatal(GFARM_MSG_1000205, "getprotobyname(\"tcp\") failed"); if (config_file != NULL) gfarm_config_set_filename(config_file); else gfarm_config_set_filename(GFMD_CONFIG); e = gfarm_server_initialize(); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001486, "gfarm_server_initialize() failed: %s", gfarm_error_string(e)); fprintf(stderr, "gfarm_server_initialize: %s\n", gfarm_error_string(e)); exit(1); } if (syslog_level != -1) gflog_set_priority_level(syslog_level); if (port_number != NULL) gfarm_metadb_server_port = strtol(port_number, NULL, 0); sock = open_accepting_socket(gfarm_metadb_server_port); /* * We do this before calling gfarm_daemon() * to print the error message to stderr. */ write_pid(pid_file); giant_init(); table_size = GFMD_CONNECTION_LIMIT; gfarm_unlimit_nofiles(&table_size); if (table_size > GFMD_CONNECTION_LIMIT) table_size = GFMD_CONNECTION_LIMIT; /* * We do this before calling gfarm_daemon() * to print the error message to stderr. */ switch (gfarm_backend_db_type) { case GFARM_BACKEND_DB_TYPE_LDAP: #ifdef HAVE_LDAP db_use(&db_ldap_ops); #else gflog_fatal(GFARM_MSG_1000206, "LDAP DB is specified, but it's not built in"); #endif break; case GFARM_BACKEND_DB_TYPE_POSTGRESQL: #ifdef HAVE_POSTGRESQL db_use(&db_pgsql_ops); #else gflog_fatal(GFARM_MSG_1000207, "PostgreSQL is specified, but it's not built in"); #endif break; default: gflog_fatal(GFARM_MSG_1000208, "neither LDAP or PostgreSQL is specified " "in configuration"); break; } e = db_initialize(); if (e != GFARM_ERR_NO_ERROR) { /* XXX FIXME need to wait and try to reconnect */ gflog_fatal(GFARM_MSG_1000209, "database initialization failed: %s", gfarm_error_string(e)); } if (!debug_mode) { gflog_syslog_open(LOG_PID, syslog_facility); if (gfarm_daemon(0, 0) == -1) gflog_warning_errno(GFARM_MSG_1001487, "daemon"); } /* * We do this after calling gfarm_daemon(), * because it changes pid. */ write_pid(pid_file); if (gfmd_modules_init == NULL) /* there isn't any private extension? */ gfmd_modules_init = gfmd_modules_init_default; gfmd_modules_init(table_size); /* * We don't want SIGPIPE, but want EPIPE on write(2)/close(2). */ gfarm_sigpipe_ignore(); sigs_set(&sigs); pthread_sigmask(SIG_BLOCK, &sigs, NULL); e = create_detached_thread(sigs_handler, &sigs); if (e != GFARM_ERR_NO_ERROR) gflog_fatal(GFARM_MSG_1000210, "create_detached_thread(sigs_handler): %s", gfarm_error_string(e)); e = create_detached_thread(db_thread, NULL); if (e != GFARM_ERR_NO_ERROR) gflog_fatal(GFARM_MSG_1000211, "create_detached_thread(db_thread): %s", gfarm_error_string(e)); e = create_detached_thread(resumer, NULL); if (e != GFARM_ERR_NO_ERROR) gflog_fatal(GFARM_MSG_1002209, "create_detached_thread(resumer): %s", gfarm_error_string(e)); /* check and repair nlink: must be after db_thread */ inode_nlink_check(); accepting_loop(sock); /*NOTREACHED*/ return (0); /* to shut up warning */ } gfarm-2.4.1/server/gfmd/group.c0000644000000000000000000005550511507222724015047 0ustar rootroot#include /* db_access.h currently needs this */ #include #include #include #include #include #include #include #include "gfutil.h" #include "hash.h" #include "config.h" /* gfarm_metadb_admin_user */ #include "gfp_xdr.h" #include "auth.h" #include "subr.h" #include "db_access.h" #include "user.h" #include "group.h" #include "peer.h" #include "quota.h" #define GROUP_HASHTAB_SIZE 3079 /* prime number */ struct group { char *groupname; struct group_assignment users; struct quota q; int invalid; /* set when deleted */ }; char ADMIN_GROUP_NAME[] = "gfarmadm"; char ROOT_GROUP_NAME[] = "gfarmroot"; char REMOVED_GROUP_NAME[] = "gfarm-removed-group"; static struct gfarm_hash_table *group_hashtab = NULL; gfarm_error_t grpassign_add(struct user *u, struct group *g) { struct group_assignment *ga; GFARM_MALLOC(ga); if (ga == NULL) { gflog_debug(GFARM_MSG_1001514, "memory allocation of group_assignment failed"); return (GFARM_ERR_NO_MEMORY); } ga->u = u; ga->g = g; ga->user_next = &g->users; ga->user_prev = g->users.user_prev; g->users.user_prev->user_next = ga; g->users.user_prev = ga; grpassign_add_group(ga); return (GFARM_ERR_NO_ERROR); } void grpassign_remove(struct group_assignment *ga) { ga->user_prev->user_next = ga->user_next; ga->user_next->user_prev = ga->user_prev; ga->group_prev->group_next = ga->group_next; ga->group_next->group_prev = ga->group_prev; free(ga); } static void group_invalidate(struct group *g) { g->invalid = 1; } static void group_activate(struct group *g) { g->invalid = 0; } int group_is_invalidated(struct group *g) { return (g->invalid == 1); } int group_is_active(struct group *g) { return (g != NULL && !group_is_invalidated(g)); } struct group * group_lookup(const char *groupname) { struct gfarm_hash_entry *entry; entry = gfarm_hash_lookup(group_hashtab, &groupname, sizeof(groupname)); if (entry == NULL) return (NULL); return (*(struct group **)gfarm_hash_entry_data(entry)); } /* note that groupname may be free'ed */ static gfarm_error_t group_enter(char *groupname, struct group **gpp) { struct gfarm_hash_entry *entry; int created; struct group *g; g = group_lookup(groupname); if (g != NULL) { if (group_is_invalidated(g)) { group_activate(g); if (gpp != NULL) *gpp = g; free(groupname); return (GFARM_ERR_NO_ERROR); } else { gflog_debug(GFARM_MSG_1001515, "\"%s\" group already exists", group_name(g)); return (GFARM_ERR_ALREADY_EXISTS); } } GFARM_MALLOC(g); if (g == NULL) { gflog_debug(GFARM_MSG_1001516, "memory allocation of group failed"); return (GFARM_ERR_NO_MEMORY); } g->groupname = groupname; entry = gfarm_hash_enter(group_hashtab, &g->groupname, sizeof(g->groupname), sizeof(struct group *), &created); if (entry == NULL) { free(g); gflog_debug(GFARM_MSG_1001517, "gfarm_hash_enter() failed"); return (GFARM_ERR_NO_MEMORY); } if (!created) { gflog_debug(GFARM_MSG_1001518, "\"%s\" group already exists", group_name(g)); free(g); return (GFARM_ERR_ALREADY_EXISTS); } quota_data_init(&g->q); g->users.user_prev = g->users.user_next = &g->users; *(struct group **)gfarm_hash_entry_data(entry) = g; group_activate(g); if (gpp != NULL) *gpp = g; return (GFARM_ERR_NO_ERROR); } gfarm_error_t group_remove(const char *groupname) { struct gfarm_hash_entry *entry; struct group *g; struct group_assignment *ga; entry = gfarm_hash_lookup(group_hashtab, &groupname, sizeof(groupname)); if (entry == NULL) { gflog_debug(GFARM_MSG_1001519, "\"%s\" group does not exist", groupname); return (GFARM_ERR_NO_SUCH_GROUP); } g = *(struct group **)gfarm_hash_entry_data(entry); if (group_is_invalidated(g)) { gflog_debug(GFARM_MSG_1001520, "\"%s\" group is invalidated", groupname); return (GFARM_ERR_NO_SUCH_GROUP); } quota_group_remove(g); /* * do not purge the hash entry. Instead, invalidate it so * that it can be activated later. */ group_invalidate(g); /* free group_assignment */ while ((ga = g->users.user_next) != &g->users) grpassign_remove(ga); g->users.user_prev = g->users.user_next = &g->users; return (GFARM_ERR_NO_ERROR); } char * group_name(struct group *g) { return (group_is_active(g) ? g->groupname : REMOVED_GROUP_NAME); } struct quota * group_quota(struct group *g) { return (&g->q); } void group_all(void *closure, void (*callback)(void *, struct group *), int active_only) { struct gfarm_hash_iterator it; struct group **g; for (gfarm_hash_iterator_begin(group_hashtab, &it); !gfarm_hash_iterator_is_end(&it); gfarm_hash_iterator_next(&it)) { g = gfarm_hash_entry_data(gfarm_hash_iterator_access(&it)); if (!active_only || group_is_active(*g)) callback(closure, *g); } } /* The memory owner of `*gi' is changed to group.c */ static gfarm_error_t group_info_add(struct gfarm_group_info *gi) { struct group *g; gfarm_error_t e = group_enter(gi->groupname, &g); int i; struct user *u; if (e != GFARM_ERR_NO_ERROR) { gflog_warning(GFARM_MSG_1000241, "group_add_one: adding group %s: %s", gi->groupname, gfarm_error_string(e)); gfarm_group_info_free(gi); return (e); } for (i = 0; i < gi->nusers; i++) { u = user_lookup(gi->usernames[i]); if (u == NULL || user_is_invalidated(u)) { gflog_warning(GFARM_MSG_1000242, "group_add_one: unknown user %s", gi->usernames[i]); (void)group_remove(g->groupname); /* do not free gi->groupname */ gi->groupname = NULL; gfarm_group_info_free(gi); return (GFARM_ERR_NO_SUCH_USER); } e = grpassign_add(u, g); if (e != GFARM_ERR_NO_ERROR) { gflog_warning(GFARM_MSG_1000243, "group_add_one: grpassign(%s, %s): %s", gi->usernames[i], g->groupname, gfarm_error_string(e)); (void)group_remove(g->groupname); /* do not free gi->groupname */ gi->groupname = NULL; gfarm_group_info_free(gi); return (e); } } for (i = 0; i < gi->nusers; i++) free(gi->usernames[i]); if (gi->usernames != NULL) free(gi->usernames); /* do not free gi->groupname */ return (GFARM_ERR_NO_ERROR); } /* The memory owner of `*gi' is changed to group.c */ void group_add_one(void *closure, struct gfarm_group_info *gi) { gfarm_error_t e = group_info_add(gi); if (e != GFARM_ERR_NO_ERROR) { /* cannot use gi.groupname, since it's freed here */ gflog_warning(GFARM_MSG_1002314, "group_add_one(): %s", gfarm_error_string(e)); } } gfarm_error_t group_add_user(struct group *g, const char *username) { struct user *u = user_lookup(username); if (u == NULL || user_is_invalidated(u)) { gflog_debug(GFARM_MSG_1001521, "\"%s\" does not exist", username); return (GFARM_ERR_NO_SUCH_USER); } if (g == NULL || group_is_invalidated(g)) { gflog_debug(GFARM_MSG_1001522, "group is invalid or does not exist"); return (GFARM_ERR_NO_SUCH_GROUP); } if (user_in_group(u, g)) { gflog_debug(GFARM_MSG_1001523, "\"%s\" is already a member in \"%s\"", username, group_name(g)); return (GFARM_ERR_ALREADY_EXISTS); } return (grpassign_add(u, g)); } void group_add_user_and_record(struct group *g, const char *username) { gfarm_error_t e = group_add_user(g, username); struct gfarm_group_info gi; int n; struct group_assignment *ga; if (e == GFARM_ERR_ALREADY_EXISTS) return; if (e != GFARM_ERR_NO_ERROR) { gflog_info(GFARM_MSG_1000244, "failed to add user %s to group %s: %s", username, group_name(g), gfarm_error_string(e)); return; } gflog_info(GFARM_MSG_1000245, "added user %s to group %s", username, group_name(g)); gi.groupname = group_name(g); n = 0; for (ga = g->users.user_next; ga != &g->users; ga = ga->user_next) if (user_is_active(ga->u)) n++; gi.nusers = n; GFARM_MALLOC_ARRAY(gi.usernames, n); if (gi.usernames == NULL) gflog_fatal(GFARM_MSG_1002315, "group_add_user_and_record(%s): no memory", username); n = 0; for (ga = g->users.user_next; ga != &g->users; ga = ga->user_next) if (user_is_active(ga->u)) gi.usernames[n++] = user_name(ga->u); e = db_group_modify(&gi, 0, 1, &username, 0, NULL); if (e != GFARM_ERR_NO_ERROR) { gflog_error(GFARM_MSG_1000246, "failed to record user '%s' as group '%s' to storage: %s", username, gi.groupname, gfarm_error_string(e)); } free(gi.usernames); } void group_init(void) { gfarm_error_t e; struct group *admin; struct gfarm_group_info gi; static const char diag[] = "group_init"; group_hashtab = gfarm_hash_table_alloc(GROUP_HASHTAB_SIZE, gfarm_hash_strptr, gfarm_hash_key_equal_strptr); if (group_hashtab == NULL) gflog_fatal(GFARM_MSG_1000247, "no memory for group hashtab"); e = db_group_load(NULL, group_add_one); if (e != GFARM_ERR_NO_ERROR) gflog_error(GFARM_MSG_1000248, "loading groups: %s", gfarm_error_string(e)); if ((admin = group_lookup(ADMIN_GROUP_NAME)) == NULL) { gflog_info(GFARM_MSG_1000249, "group %s not found, creating it", ADMIN_GROUP_NAME); gi.groupname = strdup_ck(ADMIN_GROUP_NAME, diag); gi.nusers = gfarm_metadb_admin_user == NULL ? 1 : 2; GFARM_MALLOC_ARRAY(gi.usernames, gi.nusers); if (gi.usernames == NULL) gflog_fatal(GFARM_MSG_1002316, "creating group %s: no memory", gi.groupname); gi.usernames[0] = strdup_ck(ADMIN_USER_NAME, diag); if (gfarm_metadb_admin_user != NULL) gi.usernames[1] = strdup_ck(gfarm_metadb_admin_user, diag); /* * We have to call this before group_add_one(), * because group_add_one() frees the memory of gi */ e = db_group_add(&gi); if (e != GFARM_ERR_NO_ERROR) gflog_error(GFARM_MSG_1000250, "failed to store group '%s' to storage: %s", gi.groupname, gfarm_error_string(e)); group_add_one(NULL, &gi); /* this should always success */ } else { group_add_user_and_record(admin, ADMIN_USER_NAME); if (gfarm_metadb_admin_user != NULL) group_add_user_and_record(admin, gfarm_metadb_admin_user); } if ((admin = group_lookup(ROOT_GROUP_NAME)) == NULL) { gflog_info(GFARM_MSG_1000251, "group %s not found, creating it", ROOT_GROUP_NAME); gi.groupname = strdup_ck(ROOT_GROUP_NAME, diag); gi.nusers = 0; gi.usernames = NULL; /* * We have to call this before group_add_one(), * because group_add_one() frees the memory of gi */ e = db_group_add(&gi); if (e != GFARM_ERR_NO_ERROR) gflog_error(GFARM_MSG_1000252, "failed to store group '%s' to storage: %s", gi.groupname, gfarm_error_string(e)); group_add_one(NULL, &gi); /* this should always success */ } } #ifndef TEST /* * protocol handler */ gfarm_error_t group_info_send(struct gfp_xdr *client, struct group *g) { gfarm_error_t e; int n; struct group_assignment *ga; n = 0; for (ga = g->users.user_next; ga != &g->users; ga = ga->user_next) if (user_is_active(ga->u)) n++; e = gfp_xdr_send(client, "si", g->groupname, n); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001524, "gfp_xdr_send(groupname) failed: %s", gfarm_error_string(e)); return (e); } for (ga = g->users.user_next; ga != &g->users; ga = ga->user_next) { if (user_is_active(ga->u)) if ((e = gfp_xdr_send(client, "s", user_name(ga->u))) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001525, "gfp_xdr_send(user_name) failed: %s", gfarm_error_string(e)); return (e); } } return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfm_server_group_info_get_all(struct peer *peer, int from_client, int skip) { struct gfp_xdr *client = peer_get_conn(peer); gfarm_error_t e; struct gfarm_hash_iterator it; gfarm_int32_t ngroups; struct group **gp; static const char diag[] = "GFM_PROTO_GROUP_INFO_GET_ALL"; if (skip) return (GFARM_ERR_NO_ERROR); /* XXX FIXME too long giant lock */ giant_lock(); ngroups = 0; for (gfarm_hash_iterator_begin(group_hashtab, &it); !gfarm_hash_iterator_is_end(&it); gfarm_hash_iterator_next(&it)) { gp = gfarm_hash_entry_data(gfarm_hash_iterator_access(&it)); if (group_is_active(*gp)) ++ngroups; } e = gfm_server_put_reply(peer, diag, GFARM_ERR_NO_ERROR, "i", ngroups); if (e != GFARM_ERR_NO_ERROR) { giant_unlock(); gflog_debug(GFARM_MSG_1001526, "gfm_server_put_reply(%s): %s", diag, gfarm_error_string(e)); return (e); } for (gfarm_hash_iterator_begin(group_hashtab, &it); !gfarm_hash_iterator_is_end(&it); gfarm_hash_iterator_next(&it)) { gp = gfarm_hash_entry_data(gfarm_hash_iterator_access(&it)); if (group_is_active(*gp)) { e = group_info_send(client, *gp); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001527, "group_info_send() failed: %s", gfarm_error_string(e)); giant_unlock(); return (e); } } } giant_unlock(); return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfm_server_group_info_get_by_names(struct peer *peer, int from_client, int skip) { struct gfp_xdr *client = peer_get_conn(peer); gfarm_error_t e; gfarm_int32_t ngroups; char *groupname, **groups; int i, j, eof, no_memory = 0; struct group *g; static const char diag[] = "GFM_PROTO_GROUP_INFO_GET_BY_NAMES"; e = gfm_server_get_request(peer, diag, "i", &ngroups); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001528, "group_info_get_by_names request failed: %s", gfarm_error_string(e)); return (e); } GFARM_MALLOC_ARRAY(groups, ngroups); if (groups == NULL) no_memory = 1; for (i = 0; i < ngroups; i++) { e = gfp_xdr_recv(client, 0, &eof, "s", &groupname); if (e != GFARM_ERR_NO_ERROR || eof) { gflog_debug(GFARM_MSG_1001529, "gfp_xdr_recv(group_info_get_by_names) failed:" " %s", gfarm_error_string(e)); if (e == GFARM_ERR_NO_ERROR) /* i.e. eof */ e = GFARM_ERR_PROTOCOL; if (groups != NULL) { for (j = 0; j < i; j++) { if (groups[j] != NULL) free(groups[j]); } free(groups); } return (e); } if (groups == NULL) { free(groupname); } else { if (groupname == NULL) no_memory = 1; groups[i] = groupname; } } if (skip) { e = GFARM_ERR_NO_ERROR; goto free_group; } e = gfm_server_put_reply(peer, diag, no_memory ? GFARM_ERR_NO_MEMORY : e, ""); if (no_memory || e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001530, "gfm_server_put_reply(group_info_get_by_names) failed:" " %s", gfarm_error_string(e)); goto free_group; } /* XXX FIXME too long giant lock */ giant_lock(); for (i = 0; i < ngroups; i++) { g = group_lookup(groups[i]); if (g == NULL || group_is_invalidated(g)) { e = gfm_server_put_reply(peer, diag, GFARM_ERR_NO_SUCH_GROUP, ""); } else { e = gfm_server_put_reply(peer, diag, GFARM_ERR_NO_ERROR, ""); if (e == GFARM_ERR_NO_ERROR) e = group_info_send(client, g); } if (peer_had_protocol_error(peer)) break; } giant_unlock(); free_group: if (groups != NULL) { for (i = 0; i < ngroups; i++) { if (groups[i] != NULL) free(groups[i]); } free(groups); } return (no_memory ? GFARM_ERR_NO_MEMORY : e); } static gfarm_error_t get_group(struct peer *peer, const char *diag, struct gfarm_group_info *gp) { gfarm_error_t e; int i, eof; e = gfm_server_get_request(peer, diag, "si", &gp->groupname, &gp->nusers); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001531, "%s request failure: %s", diag, gfarm_error_string(e)); return (e); } if (gp->nusers <= 0) { gp->usernames = NULL; } else { GFARM_MALLOC_ARRAY(gp->usernames, gp->nusers); if (gp->usernames == NULL) { gflog_debug(GFARM_MSG_1001532, "allocation of usernames failed"); free(gp->groupname); return (GFARM_ERR_NO_MEMORY); } } for (i = 0; i < gp->nusers; ++i) { e = gfp_xdr_recv(peer_get_conn(peer), 0, &eof, "s", &gp->usernames[i]); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001533, "gfp_xdr_recv(usernames) failed: %s", gfarm_error_string(e)); for (--i; i >= 0; --i) free(&gp->usernames[i]); free(gp->usernames); free(gp->groupname); return (e); } } return (e); } static gfarm_error_t group_user_check(struct gfarm_group_info *gi, const char *diag) { int i; struct user *u; for (i = 0; i < gi->nusers; i++) { u = user_lookup(gi->usernames[i]); if (u == NULL || user_is_invalidated(u)) { gflog_warning(GFARM_MSG_1000253, "%s: unknown user %s", diag, gi->usernames[i]); return (GFARM_ERR_NO_SUCH_USER); } } return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfm_server_group_info_set(struct peer *peer, int from_client, int skip) { gfarm_error_t e; struct gfarm_group_info gi; struct user *user = peer_get_user(peer); int need_free; static const char diag[] = "GFM_PROTO_GROUP_INFO_SET"; e = get_group(peer, diag, &gi); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001534, "get_group() failed: %s", gfarm_error_string(e)); return (e); } if (skip) { gfarm_group_info_free(&gi); return (GFARM_ERR_NO_ERROR); } need_free = 1; giant_lock(); if (!from_client || user == NULL || !user_is_admin(user)) { gflog_debug(GFARM_MSG_1001535, "operation is not permitted for user"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if (group_is_active(group_lookup(gi.groupname))) { gflog_debug(GFARM_MSG_1001536, "group already exists"); e = GFARM_ERR_ALREADY_EXISTS; } else if ((e = group_user_check(&gi, diag)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001537, "group_user_check() failed: %s", gfarm_error_string(e)); /* * We have to call this before group_info_add(), * because group_info_add() frees the memory of gi */ } else if ((e = db_group_add(&gi)) != GFARM_ERR_NO_ERROR) { gflog_error(GFARM_MSG_1000254, "failed to store group '%s' to storage: %s", gi.groupname, gfarm_error_string(e)); } else { e = group_info_add(&gi); if (e != GFARM_ERR_NO_ERROR) { /* cannot use gi.groupname, since it's freed here */ gflog_debug(GFARM_MSG_1002317, "%s: group_info_add(): %s", diag, gfarm_error_string(e)); } need_free = 0; } if (need_free) gfarm_group_info_free(&gi); giant_unlock(); return (gfm_server_put_reply(peer, diag, e, "")); } gfarm_error_t gfm_server_group_info_modify(struct peer *peer, int from_client, int skip) { gfarm_error_t e; struct gfarm_group_info gi; struct user *user = peer_get_user(peer); struct group *group; struct group_assignment *ga; int i; static const char diag[] = "GFM_PROTO_GROUP_INFO_MODIFY"; e = get_group(peer, diag, &gi); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001539, "get_group() failed: %s", gfarm_error_string(e)); return (e); } if (skip) { gfarm_group_info_free(&gi); return (GFARM_ERR_NO_ERROR); } giant_lock(); if (!from_client || user == NULL || !user_is_admin(user)) { gflog_debug(GFARM_MSG_1001540, "operation is not permitted for user"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if ((group = group_lookup(gi.groupname)) == NULL || group_is_invalidated(group)) { gflog_debug(GFARM_MSG_1001541, "group_lookup() failed"); e = GFARM_ERR_NO_SUCH_GROUP; } else if ((e = group_user_check(&gi, diag)) != GFARM_ERR_NO_ERROR) gflog_debug(GFARM_MSG_1001542, "group_user_check() failed: %s", gfarm_error_string(e)); else { /* free group_assignment */ while ((ga = group->users.user_next) != &group->users) grpassign_remove(ga); for (i = 0; i < gi.nusers; i++) { struct user *u = user_lookup(gi.usernames[i]); if (u == NULL || user_is_invalidated(u)) { gflog_warning(GFARM_MSG_1000255, "%s: unknown user %s", diag, gi.usernames[i]); continue; } e = grpassign_add(u, group); if (e != GFARM_ERR_NO_ERROR) { gflog_warning(GFARM_MSG_1000256, "%s: grpassign(%s, %s): %s", diag, gi.usernames[i], gi.groupname, gfarm_error_string(e)); break; /* XXX - no memory */ } } /* change all entries */ e = db_group_modify(&gi, 0, 0, NULL, 0, NULL); if (e != GFARM_ERR_NO_ERROR) gflog_error(GFARM_MSG_1000257, "failed to modify group '%s' in db: %s", gi.groupname, gfarm_error_string(e)); } gfarm_group_info_free(&gi); giant_unlock(); return (gfm_server_put_reply(peer, diag, e, "")); } /* this interface is exported for a use from a private extension */ gfarm_error_t group_info_remove_default(const char *groupname, const char *diag) { gfarm_error_t e, e2; if ((e = group_remove(groupname)) == GFARM_ERR_NO_ERROR) { e2 = db_group_remove(groupname); if (e2 != GFARM_ERR_NO_ERROR) gflog_error(GFARM_MSG_1000258, "%s: db_group_remove: %s", diag, gfarm_error_string(e2)); } return (e); } /* this interface is made as a hook for a private extension */ gfarm_error_t (*group_info_remove)(const char *, const char *) = group_info_remove_default; gfarm_error_t gfm_server_group_info_remove(struct peer *peer, int from_client, int skip) { char *groupname; gfarm_error_t e; struct user *user = peer_get_user(peer); static const char diag[] = "GFM_PROTO_GROUP_INFO_REMOVE"; e = gfm_server_get_request(peer, diag, "s", &groupname); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001543, "group_info_remove request failed: %s", gfarm_error_string(e)); return (e); } if (skip) { free(groupname); return (GFARM_ERR_NO_ERROR); } giant_lock(); if (!from_client || user == NULL || !user_is_admin(user)) { gflog_debug(GFARM_MSG_1001544, "operation is not permitted for user"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if (strcmp(groupname, ADMIN_GROUP_NAME) == 0 || strcmp(groupname, ROOT_GROUP_NAME) == 0) { gflog_debug(GFARM_MSG_1002211, "%s: administrator group \"%s\" should not be deleted", diag, groupname); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else e = group_info_remove(groupname, diag); free(groupname); giant_unlock(); return (gfm_server_put_reply(peer, diag, e, "")); } gfarm_error_t gfm_server_group_info_add_users(struct peer *peer, int from_client, int skip) { gfarm_error_t e; static const char diag[] = "GFM_PROTO_GROUP_INFO_ADD_USERS"; /* XXX - NOT IMPLEMENTED */ gflog_error(GFARM_MSG_1000259, "%s: not implemented", diag); e = gfm_server_put_reply(peer, diag, GFARM_ERR_FUNCTION_NOT_IMPLEMENTED, ""); return (e != GFARM_ERR_NO_ERROR ? e : GFARM_ERR_FUNCTION_NOT_IMPLEMENTED); } gfarm_error_t gfm_server_group_info_remove_users(struct peer *peer, int from_client, int skip) { gfarm_error_t e; static const char diag[] = "GFM_PROTO_GROUP_INFO_REMOVE_USERS"; /* XXX - NOT IMPLEMENTED */ gflog_error(GFARM_MSG_1000260, "%s: not implemented", diag); e = gfm_server_put_reply(peer, diag, GFARM_ERR_FUNCTION_NOT_IMPLEMENTED, ""); return (e != GFARM_ERR_NO_ERROR ? e : GFARM_ERR_FUNCTION_NOT_IMPLEMENTED); } gfarm_error_t gfm_server_group_names_get_by_users(struct peer *peer, int from_client, int skip) { gfarm_error_t e; static const char diag[] = "GFM_PROTO_GROUP_NAMES_GET_BY_USERS"; /* XXX - NOT IMPLEMENTED */ gflog_error(GFARM_MSG_1000261, "%s: not implemented", diag); e = gfm_server_put_reply(peer, diag, GFARM_ERR_FUNCTION_NOT_IMPLEMENTED, ""); return (e != GFARM_ERR_NO_ERROR ? e : GFARM_ERR_FUNCTION_NOT_IMPLEMENTED); } #endif /* TEST */ gfarm-2.4.1/server/gfmd/subr.h0000644000000000000000000000075211507222724014665 0ustar rootrootextern int debug_mode; void giant_init(void); void giant_lock(void); void giant_unlock(void); gfarm_error_t create_detached_thread(void *(*)(void *), void *); char *strdup_ck(const char *, const char *); char *strdup_log(const char *, const char *); int accmode_to_op(gfarm_uint32_t); struct peer; gfarm_error_t gfm_server_get_request(struct peer *, const char *, const char *, ...); gfarm_error_t gfm_server_put_reply(struct peer *, const char *, gfarm_error_t, const char *, ...); gfarm-2.4.1/server/gfmd/db_ldap.c0000644000000000000000000023722211507222724015276 0ustar rootroot/* * Copyright (c) 2003-2006 National Institute of Advanced * Industrial Science and Technology (AIST). All rights reserved. * * Copyright (c) 2006 National Institute of Informatics in Japan, * All rights reserved. * * This file or a portion of this file is licensed under the terms of * the NAREGI Public License, found at * http://www.naregi.org/download/index.html. * If you redistribute this file, with or without modifications, you * must include this notice in the file. */ /* * $Id: db_ldap.c 5018 2010-12-30 08:35:34Z tatebe $ */ #include #include #include #include #include #include #include #include #include #define LDAP_DEPRECATED 1 /* export deprecated functions on OpenLDAP-2.3 */ #include #include #if defined(HAVE_LDAP_SET_OPTION) && defined(LDAP_OPT_X_TLS_CTX) #define OPENLDAP_TLS_USABLE #define OPENSSL_NO_KRB5 /* XXX - disabled for now to avoid conflict with GSI */ #else #undef OPENLDAP_TLS_USABLE #undef OPENSSL_NO_KRB5 #endif #ifdef OPENLDAP_TLS_USABLE #include #include #endif #ifndef LDAP_PORT #define LDAP_PORT 389 #endif #ifndef LDAPS_PORT #define LDAPS_PORT 636 /* ldap over SSL/TLS */ #endif /* old openldap does not have ldap_memfree. */ #ifndef HAVE_LDAP_MEMFREE #define ldap_memfree(a) #endif /* HAVE_LDAP_MEMFREE */ #include #include "gfutil.h" #include "config.h" #include "metadb_common.h" #include "xattr_info.h" #include "subr.h" #include "db_access.h" #include "quota.h" #include "db_ops.h" #include "db_common.h" #define INT32STRLEN GFARM_INT32STRLEN #define INT64STRLEN GFARM_INT64STRLEN #define ARRAY_LENGTH(array) GFARM_ARRAY_LENGTH(array) /**********************************************************************/ LDAP *gfarm_ldap_server = NULL; static gfarm_error_t gfarm_ldap_initialize(void); static gfarm_error_t gfarm_ldap_terminate(void); static int just_a_minute() { struct timespec t; /* wait 10 msec */ t.tv_sec = 0; t.tv_nsec = 10000000; return (nanosleep(&t, NULL)); } static int reconnect_to_ldap_server() { gfarm_error_t error; int i; gflog_warning(GFARM_MSG_1000726, "reconnect"); error = gfarm_ldap_terminate(); if (error != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1002115, "gfarm_ldap_terminate() failed: %s", gfarm_error_string(error)); return (error); } for (i = 1;; ++i) { /* * When OpenLDAP server is heavily loaded, * it returns LDAP_SERVER_DOWN. The first * attempt to reconnect tends to fail. * As a workaround, wait a minute and try * to reconnect several times. */ just_a_minute(); error = gfarm_ldap_initialize(); if (error == GFARM_ERR_NO_ERROR) return (error); gflog_warning(GFARM_MSG_1000727, "reconnect [%d] failed", i); /* try again and again */ } } void gfarm_ldap_sanity(void) { int rv; LDAPMessage *res = NULL; retry: rv = ldap_search_s(gfarm_ldap_server, gfarm_ldap_base_dn, LDAP_SCOPE_BASE, "objectclass=top", NULL, 0, &res); if (rv != LDAP_SUCCESS) { switch (rv) { case LDAP_SERVER_DOWN: if (reconnect_to_ldap_server() != GFARM_ERR_NO_ERROR) gflog_fatal(GFARM_MSG_1000728, "can't contact LDAP server for gfarm"); goto retry; case LDAP_NO_SUCH_OBJECT: gflog_fatal(GFARM_MSG_1000729, "gfarm LDAP base dn (%s) not found", gfarm_ldap_base_dn); break; default: gflog_fatal(GFARM_MSG_1000730, "gfarm LDAP base dn (%s) access failed", gfarm_ldap_base_dn); break; } } if (res != NULL) ldap_msgfree(res); } #ifdef OPENLDAP_TLS_USABLE /* OpenLDAP dependent SSL/TLS handling */ /* * The reason we do this is because OpenLDAP's handling of the following * options are fragile: * LDAP_OPT_X_TLS_CIPHER_SUITE * LDAP_OPT_X_TLS_CACERTDIR * LDAP_OPT_X_TLS_KEYFILE * LDAP_OPT_X_TLS_CERTFILE * LDAP_OPT_X_TLS_REQUIRE_CERT * * These options affect global state, and need to be set before ldap_init(). * Furthermore, these options only affect at initialization phase of * OpenLDAP's default SSL context (libraries/libldap/tls.c:tls_def_ctx) * at least in openldap-2.2.27. * Thus, if there is any other user of these options in the same process, * these options don't work (for gfarm if other uses the options first, * or for other user if gfarm uses the options first). * To avoid such problem, we have to set the default SSL context by * using LDAP_OPT_X_TLS_CTX and OpenSSL functions, instead of the OpenLDAP's * default one. */ /* * Initialize SSL context, but only for things needed by clients. * * This function is nearly equivalent to ldap_pvt_tls_init_def_ctx() * in libraries/libldap/tls.c:tls_def_ctx of openldap-2.2.27, * but only does client side initialization. * * XXX make this possible to use Globus LDAP certificate ("CN=ldap/HOSTNAME") */ static gfarm_error_t gfarm_ldap_new_default_ctx(SSL_CTX **ctxp) { gfarm_error_t e; SSL_CTX *ctx = SSL_CTX_new(SSLv23_method()); if (ctx == NULL) { gflog_warning(GFARM_MSG_1000731, "LDAP: cannot allocate SSL/TLS context"); return (GFARM_ERR_CANT_OPEN); } /* * The following operation is nearly equivalent to: * rv = ldap_set_option(NULL, LDAP_OPT_X_TLS_CIPHER_SUITE, * gfarm_ldap_tls_cipher_suite); */ if (gfarm_ldap_tls_cipher_suite != NULL && !SSL_CTX_set_cipher_list(ctx, gfarm_ldap_tls_cipher_suite)) { gflog_warning(GFARM_MSG_1000732, "cannot set ldap_tls_cipher_suite"); e = GFARM_ERR_CANT_OPEN; goto error; } /* * The following operation is nearly equivalent to: * rv = ldap_set_option(NULL,LDAP_OPT_X_TLS_CACERTDIR,GRID_CACERT_DIR); */ if (!SSL_CTX_load_verify_locations(ctx, NULL, GRID_CACERT_DIR)) { gflog_warning(GFARM_MSG_1000733, "cannot use " GRID_CACERT_DIR " for LDAP TLS certificates directory"); e = GFARM_ERR_CANT_OPEN; goto error; } else if (!SSL_CTX_set_default_verify_paths(ctx)) { gflog_warning(GFARM_MSG_1000734, "failed to verify " GRID_CACERT_DIR " for LDAP TLS certificates directory"); e = GFARM_ERR_CANT_OPEN; goto error; } /* * The following operation is nearly equivalent to: * rv = ldap_set_option(NULL, LDAP_OPT_X_TLS_KEYFILE, * gfarm_ldap_tls_certificate_key_file); */ if (gfarm_ldap_tls_certificate_key_file != NULL && !SSL_CTX_use_PrivateKey_file(ctx, gfarm_ldap_tls_certificate_key_file, SSL_FILETYPE_PEM)) { gflog_warning(GFARM_MSG_1000735, "failed to use ldap_tls_certificate_key_file"); e = GFARM_ERR_CANT_OPEN; goto error; } /* * The following operation is nearly equivalent to: * rv = ldap_set_option(NULL, LDAP_OPT_X_TLS_CERTFILE, * gfarm_ldap_tls_certificate_file); */ if (gfarm_ldap_tls_certificate_file != NULL && !SSL_CTX_use_certificate_file(ctx, gfarm_ldap_tls_certificate_file, SSL_FILETYPE_PEM)) { gflog_warning(GFARM_MSG_1000736, "failed to use ldap_tls_certificate_file"); e = GFARM_ERR_CANT_OPEN; goto error; } if ((gfarm_ldap_tls_certificate_key_file != NULL || gfarm_ldap_tls_certificate_file != NULL) && !SSL_CTX_check_private_key(ctx)) { gflog_warning(GFARM_MSG_1000737, "ldap_tls_certificate_file/key_file " "check failure"); e = GFARM_ERR_CANT_OPEN; goto error; } /* * The following operation is nearly equivalent to: * tls = LDAP_OPT_X_TLS_HARD; * rv = ldap_set_option(NULL, LDAP_OPT_X_TLS_REQUIRE_CERT, &tls); */ SSL_CTX_set_verify(ctx, SSL_VERIFY_PEER, NULL); *ctxp = ctx; return (GFARM_ERR_NO_ERROR); error: SSL_CTX_free(ctx); if (ERR_peek_error()) { gflog_error(GFARM_MSG_1000738, "because:", e); do { gflog_error(GFARM_MSG_1000739, "%s", ERR_error_string( ERR_get_error(), NULL)); } while (ERR_peek_error()); } return (e); } static SSL_CTX *ldap_ssl_context = NULL; static SSL_CTX *ldap_ssl_default_context = NULL; static gfarm_error_t gfarm_ldap_set_ssl_context(void) { gfarm_error_t e; int rv; if (ldap_ssl_context == NULL) { e = gfarm_ldap_new_default_ctx(&ldap_ssl_context); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1002116, "gfarm_ldap_new_default_ctx() failed: %s", gfarm_error_string(e)); return (e); } } rv = ldap_get_option(NULL, LDAP_OPT_X_TLS_CTX, &ldap_ssl_default_context); if (rv != LDAP_SUCCESS) { gflog_error(GFARM_MSG_1000740, "LDAP get default SSL/TLS context: %s", ldap_err2string(rv)); return (GFARM_ERR_CANT_OPEN); } rv = ldap_set_option(NULL, LDAP_OPT_X_TLS_CTX, ldap_ssl_context); if (rv != LDAP_SUCCESS) { gflog_error(GFARM_MSG_1000741, "LDAP set default SSL/TLS context: %s", ldap_err2string(rv)); return (GFARM_ERR_CANT_OPEN); } return (GFARM_ERR_NO_ERROR); } static gfarm_error_t gfarm_ldap_restore_ssl_context(void) { int rv = ldap_set_option(NULL, LDAP_OPT_X_TLS_CTX, ldap_ssl_default_context); if (rv != LDAP_SUCCESS) { gflog_error(GFARM_MSG_1000742, "LDAP restore default SSL/TLS context: %s", ldap_err2string(rv)); return (GFARM_ERR_CANT_OPEN); } return (GFARM_ERR_NO_ERROR); } static gfarm_error_t gfarm_ldap_switch_ssl_context(LDAP *ld) { int rv; gfarm_ldap_restore_ssl_context(); rv = ldap_set_option(ld, LDAP_OPT_X_TLS_CTX, ldap_ssl_context); if (rv != LDAP_SUCCESS) { gflog_error(GFARM_MSG_1000743, "LDAP set SSL/TLS context: %s", ldap_err2string(rv)); return (GFARM_ERR_CANT_OPEN); } return (GFARM_ERR_NO_ERROR); } #else #define gfarm_ldap_restore_ssl_context() #define gfarm_ldap_switch_ssl_context(ld) #endif /* OPENLDAP_TLS_USABLE */ static gfarm_error_t gfarm_ldap_initialize(void) { enum { LDAP_WITHOUT_TLS, LDAP_WITH_TLS, LDAP_WITH_START_TLS } tls_mode = LDAP_WITHOUT_TLS; int rv, port; #if defined(HAVE_LDAP_SET_OPTION) && defined(LDAP_VERSION3) int version; #endif #if defined(HAVE_LDAP_SET_OPTION) && defined(LDAP_OPT_NETWORK_TIMEOUT) struct timeval timeout = { 5, 0 }; #endif #if defined(HAVE_LDAP_SET_OPTION) && defined(LDAP_OPT_X_TLS) int tls; #endif char *s; /* we need to check "ldap_tls" at first to see default port number */ if (gfarm_ldap_tls != NULL) { if (strcasecmp(gfarm_ldap_tls, "false") == 0) { tls_mode = LDAP_WITHOUT_TLS; } else if (strcasecmp(gfarm_ldap_tls, "true") == 0) { tls_mode = LDAP_WITH_TLS; } else if (strcasecmp(gfarm_ldap_tls, "start_tls") == 0) { tls_mode = LDAP_WITH_START_TLS; } else { gflog_error(GFARM_MSG_1000744, "ldap_tls: unknown keyword %s", gfarm_ldap_tls); return (GFARM_ERR_INVALID_ARGUMENT); } } /* sanity check */ if (gfarm_ldap_server_name == NULL) { gflog_error(GFARM_MSG_1000745, "ldap_server_host is not specified"); return (GFARM_ERR_INVALID_ARGUMENT); } if (gfarm_ldap_server_port == NULL) { if (tls_mode == LDAP_WITH_TLS) port = LDAPS_PORT; else port = LDAP_PORT; } else { port = strtol(gfarm_ldap_server_port, &s, 0); if (s == gfarm_ldap_server_port || port <= 0 || port >= 65536) { gflog_error(GFARM_MSG_1000746, "ldap_server_port: illegal value `%s'", gfarm_ldap_server_port); return (GFARM_ERR_INVALID_ARGUMENT); } } if (gfarm_ldap_base_dn == NULL) { gflog_error(GFARM_MSG_1000747, "ldap_base_dn is not specified"); return (GFARM_ERR_INVALID_ARGUMENT); } /* * initialize LDAP */ /* open a connection */ gfarm_ldap_server = ldap_init(gfarm_ldap_server_name, port); if (gfarm_ldap_server == NULL) { /* ldap_init() defers actual connect(2) operation later */ gflog_error(GFARM_MSG_1000748, "ldap_init: %s", strerror(errno)); return (GFARM_ERR_CANT_OPEN); } if (tls_mode != LDAP_WITHOUT_TLS) { #ifdef OPENLDAP_TLS_USABLE e = gfarm_ldap_set_ssl_context(); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1002117, "gfarm_ldap_set_ssl_context() failed: %s", gfarm_error_string(e)); gfarm_ldap_terminate(); return (e); } #else gfarm_ldap_terminate(); gflog_error(GFARM_MSG_1000749, "\"ldap_tls\" is specified, but " "the LDAP library linked with gfarm doesn't support it"); return (GFARM_ERR_CANT_OPEN); #endif } #if defined(HAVE_LDAP_SET_OPTION) && defined(LDAP_VERSION3) version = LDAP_VERSION3; ldap_set_option(gfarm_ldap_server, LDAP_OPT_PROTOCOL_VERSION, &version); #endif ldap_set_option(gfarm_ldap_server, LDAP_OPT_REFERRALS, LDAP_OPT_ON); #if defined(HAVE_LDAP_SET_OPTION) && defined(LDAP_OPT_NETWORK_TIMEOUT) ldap_set_option(gfarm_ldap_server, LDAP_OPT_NETWORK_TIMEOUT, (void *)&timeout); #endif if (tls_mode == LDAP_WITH_TLS) { #if defined(HAVE_LDAP_SET_OPTION) && defined(LDAP_OPT_X_TLS) tls = LDAP_OPT_X_TLS_HARD; rv = ldap_set_option(gfarm_ldap_server, LDAP_OPT_X_TLS, &tls); if (rv != LDAP_SUCCESS) { gflog_error(GFARM_MSG_1000750, "LDAP use SSL/TLS: %s", ldap_err2string(rv)); #ifdef HAVE_LDAP_PERROR /* XXX this can only output to stderr */ ldap_perror(gfarm_ldap_server, "ldap_start_tls"); #endif gfarm_ldap_restore_ssl_context(); gfarm_ldap_terminate(); return (GFARM_ERR_CANT_OPEN); } #else gfarm_ldap_restore_ssl_context(); gfarm_ldap_terminate(); gflog_error(GFARM_MSG_1000751, "gfarm.conf: \"ldap_tls true\" is specified, but " "the LDAP library linked with gfarm doesn't support it"); return (GFARM_ERR_CANT_OPEN); #endif /* defined(LDAP_OPT_X_TLS) && defined(HAVE_LDAP_SET_OPTION) */ } if (tls_mode == LDAP_WITH_START_TLS) { #if defined(HAVE_LDAP_START_TLS_S) && defined(HAVE_LDAP_SET_OPTION) rv = ldap_start_tls_s(gfarm_ldap_server, NULL, NULL); if (rv != LDAP_SUCCESS) { gflog_error(GFARM_MSG_1000752, "LDAP start TLS: %s", ldap_err2string(rv)); #ifdef HAVE_LDAP_PERROR /* XXX this cannot output to syslog */ ldap_perror(gfarm_ldap_server, "ldap_start_tls"); #endif gfarm_ldap_restore_ssl_context(); gfarm_ldap_terminate(); return (GFARM_ERR_CANT_OPEN); } #else gfarm_ldap_restore_ssl_context(); gfarm_ldap_terminate(); gflog_error(GFARM_MSG_1000753, "gfarm.conf: \"ldap_tls start_tls\" is specified, " "but the LDAP library linked with gfarm doesn't support it"); return (GFARM_ERR_CANT_OPEN); #endif /* defined(HAVE_LDAP_START_TLS_S) && defined(HAVE_LDAP_SET_OPTION) */ } /* gfarm_ldap_bind_dn and gfarm_ldap_bind_password may be NULL */ rv = ldap_simple_bind_s(gfarm_ldap_server, gfarm_ldap_bind_dn, gfarm_ldap_bind_password); if (rv != LDAP_SUCCESS) { gflog_error(GFARM_MSG_1000754, "LDAP simple bind: %s", ldap_err2string(rv)); if (tls_mode != LDAP_WITHOUT_TLS) gfarm_ldap_restore_ssl_context(); gfarm_ldap_terminate(); return (GFARM_ERR_CANT_OPEN); } /* sanity check. base_dn can be accessed? */ gfarm_ldap_sanity(); if (tls_mode != LDAP_WITHOUT_TLS) gfarm_ldap_switch_ssl_context(gfarm_ldap_server); return (GFARM_ERR_NO_ERROR); } static gfarm_error_t gfarm_ldap_terminate(void) { gfarm_error_t e = GFARM_ERR_NO_ERROR; int rv; if (gfarm_ldap_server == NULL) { gflog_debug(GFARM_MSG_1002118, "'gfarm_ldap_server' is NULL"); return (GFARM_ERR_NO_ERROR); } rv = ldap_unbind(gfarm_ldap_server); if (rv != LDAP_SUCCESS) { gflog_error(GFARM_MSG_1000755, "ldap_unbind: %s", ldap_err2string(rv)); e = GFARM_ERR_UNKNOWN; } gfarm_ldap_server = NULL; return (e); } #if !defined(LDAP_OPT_RESULT_CODE) && defined(LDAP_OPT_ERROR_NUMBER) #define LDAP_OPT_RESULT_CODE LDAP_OPT_ERROR_NUMBER #endif static const char * gfarm_ldap_session_error(void) { int e; int rv = ldap_get_option(gfarm_ldap_server, LDAP_OPT_RESULT_CODE, &e); if (rv != LDAP_OPT_SUCCESS) gflog_fatal(GFARM_MSG_1002362, "ldap_get_option: %d", rv); return (ldap_err2string(e)); } static char** gfarm_strarray_dup_log(char **src, const char *diag) { char **dst = gfarm_strarray_dup(src); if (dst == NULL) gflog_error(GFARM_MSG_1002363, "%s: gfarm_strarray_dup(): no memory", diag); return (dst); } /**********************************************************************/ struct ldap_string_modify { LDAPMod mod; char *str[2]; }; static void set_string_mod( LDAPMod **modp, int op, char *type, char *value, struct ldap_string_modify *storage) { storage->str[0] = value; storage->str[1] = NULL; storage->mod.mod_op = op; storage->mod.mod_type = type; storage->mod.mod_vals.modv_strvals = storage->str; *modp = &storage->mod; } struct ldap_binary_modify { LDAPMod mod; struct berval *val[2]; struct berval v; }; static void set_binary_mod( LDAPMod **modp, int op, char *type, void *value, int size, struct ldap_binary_modify *storage) { storage->v.bv_val = value; storage->v.bv_len = size; storage->val[0] = &storage->v; storage->val[1] = NULL; storage->mod.mod_op = op | LDAP_MOD_BVALUES; storage->mod.mod_type = type; storage->mod.mod_vals.modv_bvals = storage->val; *modp = &storage->mod; } static void set_delete_mod( LDAPMod **modp, char *type, LDAPMod *storage) { storage->mod_op = LDAP_MOD_DELETE; storage->mod_type = type; storage->mod_values = NULL; *modp = storage; } #if 0 static void set_delete_mod( LDAPMod **modp, char *type, LDAPMod *storage) { storage->mod_op = LDAP_MOD_DELETE; storage->mod_type = type; storage->mod_vals.modv_strvals = NULL; *modp = storage; } #endif struct gfarm_ldap_generic_info_ops { const struct gfarm_base_generic_info_ops *gen_ops; char *query_type; char *dn_template; char *(*make_dn)(void *key); gfarm_error_t (*set_field)(void *info, char *attribute, char **vals); }; #if 0 /* not used */ static gfarm_error_t gfarm_ldap_generic_info_get( void *key, void *info, const struct gfarm_ldap_generic_info_ops *ops) { gfarm_error_t error = GFARM_ERR_NO_ERROR, err; LDAPMessage *res, *e; int n, rv; char *a, *dn; BerElement *ber; char **vals; retry: dn = ops->make_dn(key); if (dn == NULL) return (GFARM_ERR_NO_MEMORY); res = NULL; rv = ldap_search_s(gfarm_ldap_server, dn, LDAP_SCOPE_BASE, ops->query_type, NULL, 0, &res); if (rv != LDAP_SUCCESS) { switch (rv) { case LDAP_SERVER_DOWN: error = gfarm_ldap_initialize(); if (error == GFARM_ERR_NO_ERROR) goto retry; break; case LDAP_NO_SUCH_OBJECT: error = GFARM_ERR_NO_SUCH_OBJECT; break; default: gflog_error(GFARM_MSG_UNUSED, "ldap_search_s(%s): %s", dn, ldap_err2string(rv)); error = GFARM_ERR_UNKNOWN; break; } goto msgfree; } n = ldap_count_entries(gfarm_ldap_server, res); if (n == 0) { error = GFARM_ERR_NO_SUCH_OBJECT; goto msgfree; } ops->gen_ops->clear(info); e = ldap_first_entry(gfarm_ldap_server, res); if (e == NULL) { gflog_error(GFARM_MSG_1002364, "ldap_first_entry: %s", ldap_err2string(gfarm_ldap_server->ld_errno)); error = GFARM_ERR_UNKNOWN; goto msgfree; } ber = NULL; for (a = ldap_first_attribute(gfarm_ldap_server, e, &ber); a != NULL; a = ldap_next_attribute(gfarm_ldap_server, e, ber)) { vals = ldap_get_values(gfarm_ldap_server, e, a); if (vals == NULL) { gflog_error(GFARM_MSG_1002365, "ldap_get_values: %s", gfarm_ldap_session_error()); error = GFARM_ERR_UNKNOWN; } else { if (vals[0] != NULL) { err = ops->set_field(info, a, vals); if (err != GFARM_ERR_NO_ERROR) error = err; } ldap_value_free(vals); } ldap_memfree(a); } if (ber != NULL) ber_free(ber, 0); if (error != GFARM_ERR_NO_ERROR) { ops->gen_ops->free(info); /* should check all fields are filled */ } else if (!ops->gen_ops->validate(info)) { gflog_error(GFARM_MSG_1002366, "gfarm_ldap_generic_info_get: validation error"); ops->gen_ops->free(info); /* XXX - different error code is better ? */ error = GFARM_ERR_NO_SUCH_OBJECT; } msgfree: free(dn); /* free the search results */ if (res != NULL) ldap_msgfree(res); return (error); } #endif /* not used */ static gfarm_error_t gfarm_ldap_generic_info_add( void *key, LDAPMod **modv, const struct gfarm_ldap_generic_info_ops *ops) { gfarm_error_t error; int rv; char *dn; dn = ops->make_dn(key); if (dn == NULL) { gflog_debug(GFARM_MSG_1002119, "make_dn() failed: %s", gfarm_error_string(GFARM_ERR_NO_MEMORY)); return (GFARM_ERR_NO_MEMORY); } retry: rv = ldap_add_s(gfarm_ldap_server, dn, modv); switch (rv) { case LDAP_SUCCESS: error = GFARM_ERR_NO_ERROR; break; case LDAP_SERVER_DOWN: error = reconnect_to_ldap_server(); if (error == GFARM_ERR_NO_ERROR) goto retry; break; case LDAP_ALREADY_EXISTS: error = GFARM_ERR_ALREADY_EXISTS; gflog_debug(GFARM_MSG_1002120, "entry already exists"); break; default: gflog_error(GFARM_MSG_1000756, "ldap_add_s(%s): %s", dn, ldap_err2string(rv)); error = GFARM_ERR_UNKNOWN; } free(dn); return (error); } static gfarm_error_t gfarm_ldap_generic_info_modify( void *key, LDAPMod **modv, const struct gfarm_ldap_generic_info_ops *ops) { gfarm_error_t error; int rv; char *dn; dn = ops->make_dn(key); if (dn == NULL) { gflog_debug(GFARM_MSG_1002121, "make_dn() failed: %s", gfarm_error_string(GFARM_ERR_NO_MEMORY)); return (GFARM_ERR_NO_MEMORY); } retry: rv = ldap_modify_s(gfarm_ldap_server, dn, modv); switch (rv) { case LDAP_SUCCESS: error = GFARM_ERR_NO_ERROR; break; case LDAP_SERVER_DOWN: error = reconnect_to_ldap_server(); if (error == GFARM_ERR_NO_ERROR) goto retry; break; case LDAP_NO_SUCH_OBJECT: gflog_debug(GFARM_MSG_1002122, "ldap_modify_s(%s) failed: %s", dn, gfarm_error_string(GFARM_ERR_NO_SUCH_OBJECT)); error = GFARM_ERR_NO_SUCH_OBJECT; break; case LDAP_ALREADY_EXISTS: gflog_debug(GFARM_MSG_1002123, "ldap_modify_s(%s) failed: %s", dn, gfarm_error_string(GFARM_ERR_ALREADY_EXISTS)); error = GFARM_ERR_ALREADY_EXISTS; break; default: gflog_error(GFARM_MSG_1000757, "ldap_modify_s(%s): %s", dn, ldap_err2string(rv)); error = GFARM_ERR_UNKNOWN; } free(dn); return (error); } static gfarm_error_t gfarm_ldap_generic_info_remove( void *key, const struct gfarm_ldap_generic_info_ops *ops) { gfarm_error_t error; int rv; char *dn; dn = ops->make_dn(key); if (dn == NULL) { gflog_debug(GFARM_MSG_1002124, "make_dn() failed: %s", gfarm_error_string(GFARM_ERR_NO_MEMORY)); return (GFARM_ERR_NO_MEMORY); } retry: rv = ldap_delete_s(gfarm_ldap_server, dn); switch (rv) { case LDAP_SUCCESS: error = GFARM_ERR_NO_ERROR; break; case LDAP_SERVER_DOWN: error = reconnect_to_ldap_server(); if (error == GFARM_ERR_NO_ERROR) goto retry; break; case LDAP_NO_SUCH_OBJECT: error = GFARM_ERR_NO_SUCH_OBJECT; gflog_debug(GFARM_MSG_1002125, "ldap_delete_s(%s) failed: %s", dn, gfarm_error_string(GFARM_ERR_NO_SUCH_OBJECT)); break; default: gflog_error(GFARM_MSG_1000758, "ldap_delete_s(%s): %s", dn, ldap_err2string(rv)); error = GFARM_ERR_UNKNOWN; } free(dn); return (error); } #if 0 /* not used */ static gfarm_error_t gfarm_ldap_generic_info_get_all( char *dn, int scope, /* LDAP_SCOPE_ONELEVEL or LDAP_SCOPE_SUBTREE */ char *query, int *np, void *infosp, const struct gfarm_ldap_generic_info_ops *ops) { gfarm_error_t error = GFARM_ERR_NO_ERROR, err; LDAPMessage *res, *e; int i, n, rv; char *a; BerElement *ber; char **vals; char *infos, *tmp_info; size_t size; int overflow = 0; #ifdef __GNUC__ /* workaround gcc warning: might be used uninitialized */ infos = NULL; #endif /* search for entries, return all attrs */ retry: res = NULL; rv = ldap_search_s(gfarm_ldap_server, dn, scope, query, NULL, 0, &res); if (rv != LDAP_SUCCESS) { switch (rv) { case LDAP_SERVER_DOWN: error = gfarm_ldap_initialize(); if (error == GFARM_ERR_NO_ERROR) goto retry; break; case LDAP_NO_SUCH_OBJECT: error = GFARM_ERR_NO_SUCH_OBJECT; break; default: gflog_error(GFARM_MSG_UNUSED, "ldap_search_s(%s) - get all; %s", dn, ldap_err2string(rv)); error = GFARM_ERR_UNKNOWN; } goto msgfree; } n = ldap_count_entries(gfarm_ldap_server, res); if (n == 0) { error = GFARM_ERR_NO_SUCH_OBJECT; goto msgfree; } size = gfarm_size_mul(&overflow, ops->gen_ops->info_size, n); if (!overflow) GFARM_MALLOC_ARRAY(infos, size); if (overflow || infos == NULL) { error = GFARM_ERR_NO_MEMORY; goto msgfree; } /* use last element as temporary buffer */ tmp_info = infos + ops->gen_ops->info_size * (n - 1); /* step through each entry returned */ for (i = 0, e = ldap_first_entry(gfarm_ldap_server, res); e != NULL; e = ldap_next_entry(gfarm_ldap_server, e)) { ops->gen_ops->clear(tmp_info); ber = NULL; for (a = ldap_first_attribute(gfarm_ldap_server, e, &ber); a != NULL; a = ldap_next_attribute(gfarm_ldap_server, e, ber)) { vals = ldap_get_values(gfarm_ldap_server, e, a); if (vals == NULL) { gflog_error(GFARM_MSG_1002367, "ldap_get_values: %s", gfarm_ldap_session_error()); error = GFARM_ERR_UNKNOWN; } else { if (vals[0] != NULL) { err = ops->set_field(tmp_info, a, vals); if (err != GFARM_ERR_NO_ERROR) error = err; } ldap_value_free(vals); } ldap_memfree(a); } if (ber != NULL) ber_free(ber, 0); if (error != GFARM_ERR_NO_ERROR || !ops->gen_ops->validate(tmp_info)) { /* invalid record */ ops->gen_ops->free(tmp_info); continue; } if (i < n - 1) { /* if (i == n - 1), do not have to copy */ memcpy(infos + ops->gen_ops->info_size * i, tmp_info, ops->gen_ops->info_size); } i++; } if (error != GFARM_ERR_NO_ERROR) { while (--i >= 0) ops->gen_ops->free(infos + i * ops->gen_ops->info_size); free(infos); goto msgfree; } if (i == 0) { free(infos); /* XXX - data were all invalid */ error = GFARM_ERR_NO_SUCH_OBJECT; goto msgfree; } /* XXX - if (i < n), element from (i+1) to (n-1) may be wasted */ *np = i; *(char **)infosp = infos; msgfree: /* free the search results */ if (res != NULL) ldap_msgfree(res); return (error); } #endif /* not used */ static gfarm_error_t gfarm_ldap_generic_info_get_foreach_withattrs( char *dn, int scope, /* LDAP_SCOPE_ONELEVEL or LDAP_SCOPE_SUBTREE */ char *query, void *tmp_info, /* just used as a work area */ void (*callback)(void *, void *), void *closure, const struct gfarm_ldap_generic_info_ops *ops, char *attrs[]) { gfarm_error_t error = GFARM_ERR_NO_ERROR, err; LDAPMessage *res, *e; int i, msgid, rv; char *a; BerElement *ber; char **vals; struct berval **bervals; /* search for entries asynchronously */ msgid = ldap_search(gfarm_ldap_server, dn, scope, query, attrs, 0); if (msgid == -1) { gflog_error(GFARM_MSG_1000759, "ldap_search(%s) - for each", dn); return (GFARM_ERR_UNKNOWN); } /* step through each entry returned */ i = 0; res = NULL; while ((rv = ldap_result(gfarm_ldap_server, msgid, LDAP_MSG_ONE, NULL, &res)) > 0) { e = ldap_first_entry(gfarm_ldap_server, res); if (e == NULL) break; for (; e != NULL; e = ldap_next_entry(gfarm_ldap_server, e)) { ops->gen_ops->clear(tmp_info); ber = NULL; for (a = ldap_first_attribute(gfarm_ldap_server, e, &ber); a != NULL; a = ldap_next_attribute(gfarm_ldap_server, e, ber)) { /* XXX FIXME: a hack for "attrvalue" */ if (strcasecmp(a, "attrvalue") == 0) { bervals = ldap_get_values_len( gfarm_ldap_server, e, a); if (bervals == NULL) { gflog_error(GFARM_MSG_1002511, "ldap_get_values_len: %s", gfarm_ldap_session_error()); error = GFARM_ERR_UNKNOWN; } else { if (bervals[0] != NULL) { err = ops->set_field( tmp_info, a, (char **)bervals); if (err != GFARM_ERR_NO_ERROR) error = err; } ldap_value_free_len(bervals); } ldap_memfree(a); continue; } vals = ldap_get_values(gfarm_ldap_server, e, a); if (vals == NULL) { gflog_error(GFARM_MSG_1002368, "ldap_get_values: %s", gfarm_ldap_session_error()); error = GFARM_ERR_UNKNOWN; } else { if (vals[0] != NULL) { err = ops->set_field(tmp_info, a, vals); if (err != GFARM_ERR_NO_ERROR) error = err; } ldap_value_free(vals); } ldap_memfree(a); } if (ber != NULL) ber_free(ber, 0); /* should check all fields are filled */ if (error != GFARM_ERR_NO_ERROR || !ops->gen_ops->validate(tmp_info)) { /* invalid record */ ops->gen_ops->free(tmp_info); continue; } if (callback != NULL) (*callback)(closure, tmp_info); #if 0 /* the (*callback)() routine frees this memory */ ops->gen_ops->free(tmp_info); #endif i++; } /* free the search results */ ldap_msgfree(res); res = NULL; } if (res != NULL) ldap_msgfree(res); if (error != GFARM_ERR_NO_ERROR) return (error); if (rv == -1) { gflog_error(GFARM_MSG_1000760, "ldap_search(%s) - for each - failed", dn); return (GFARM_ERR_UNKNOWN); } if (i == 0) { gflog_debug(GFARM_MSG_1002126, "finding ldap entry failed"); return (GFARM_ERR_NO_SUCH_OBJECT); } return (GFARM_ERR_NO_ERROR); } static gfarm_error_t gfarm_ldap_generic_info_get_foreach( char *dn, int scope, /* LDAP_SCOPE_ONELEVEL or LDAP_SCOPE_SUBTREE */ char *query, void *tmp_info, /* just used as a work area */ void (*callback)(void *, void *), void *closure, const struct gfarm_ldap_generic_info_ops *ops) { return (gfarm_ldap_generic_info_get_foreach_withattrs( dn, scope, query, tmp_info, callback, closure, ops, NULL)); } /**********************************************************************/ static gfarm_error_t gfarm_ldap_nop(void *arg) { return (GFARM_ERR_NO_ERROR); } /**********************************************************************/ static char *gfarm_ldap_host_info_make_dn(void *vkey); static gfarm_error_t gfarm_ldap_host_info_set_field(void *info, char *attribute, char **vals); struct gfarm_ldap_host_info_key { const char *hostname; }; static const struct gfarm_ldap_generic_info_ops gfarm_ldap_host_info_ops = { &gfarm_base_host_info_ops, "(objectclass=GFarmHost)", "hostname=%s, %s", gfarm_ldap_host_info_make_dn, gfarm_ldap_host_info_set_field, }; static char * gfarm_ldap_host_info_make_dn(void *vkey) { struct gfarm_ldap_host_info_key *key = vkey; char *dn; GFARM_MALLOC_ARRAY(dn, strlen(gfarm_ldap_host_info_ops.dn_template) + strlen(key->hostname) + strlen(gfarm_ldap_base_dn) + 1); if (dn == NULL) { gflog_debug(GFARM_MSG_1002127, "allocation of string 'dn' failed"); return (NULL); } sprintf(dn, gfarm_ldap_host_info_ops.dn_template, key->hostname, gfarm_ldap_base_dn); return (dn); } static gfarm_error_t gfarm_ldap_host_info_set_field( void *vinfo, char *attribute, char **vals) { gfarm_error_t err = GFARM_ERR_NO_ERROR; struct gfarm_host_info *info = vinfo; static const char diag[] = "gfarm_ldap_host_info_set_field"; if (strcasecmp(attribute, "hostname") == 0) { info->hostname = strdup_log(vals[0], diag); if (info->hostname == NULL) err = GFARM_ERR_NO_MEMORY; } else if (strcasecmp(attribute, "port") == 0) { info->port = strtol(vals[0], NULL, 0); } else if (strcasecmp(attribute, "hostalias") == 0) { info->hostaliases = gfarm_strarray_dup_log(vals, diag); if (info->hostaliases == NULL) { info->nhostaliases = 0; err = GFARM_ERR_NO_MEMORY; } else { info->nhostaliases = gfarm_strarray_length(info->hostaliases); } } else if (strcasecmp(attribute, "architecture") == 0) { info->architecture = strdup_log(vals[0], diag); if (info->architecture == NULL) err = GFARM_ERR_NO_MEMORY; } else if (strcasecmp(attribute, "ncpu") == 0) { info->ncpu = strtol(vals[0], NULL, 0); } else if (strcasecmp(attribute, "flags") == 0) { info->flags = strtol(vals[0], NULL, 0); } return (err); } static gfarm_error_t gfarm_ldap_host_info_update( struct gfarm_host_info *info, int mod_op, gfarm_error_t (*update_op)(void *, LDAPMod **, const struct gfarm_ldap_generic_info_ops *)) { int i; LDAPMod *modv[8]; struct ldap_string_modify storage[ARRAY_LENGTH(modv) - 1]; char port_string[INT32STRLEN + 1]; char ncpu_string[INT32STRLEN + 1]; char flags_string[INT32STRLEN + 1]; LDAPMod hostaliases_mod; struct gfarm_ldap_host_info_key key; key.hostname = info->hostname; sprintf(port_string, "%d", info->port); sprintf(ncpu_string, "%d", info->ncpu); sprintf(flags_string, "%d", info->flags); i = 0; set_string_mod(&modv[i], mod_op, "objectclass", "GFarmHost", &storage[i]); i++; set_string_mod(&modv[i], mod_op, "hostname", info->hostname, &storage[i]); i++; set_string_mod(&modv[i], mod_op, "port", port_string, &storage[i]); i++; /* "hostalias" is optional */ if (info->hostaliases != NULL && info->nhostaliases > 0) { hostaliases_mod.mod_type = "hostalias"; hostaliases_mod.mod_op = mod_op; hostaliases_mod.mod_vals.modv_strvals = info->hostaliases; modv[i] = &hostaliases_mod; i++; } set_string_mod(&modv[i], mod_op, "architecture", info->architecture, &storage[i]); i++; set_string_mod(&modv[i], mod_op, "ncpu", ncpu_string, &storage[i]); i++; set_string_mod(&modv[i], mod_op, "flags", flags_string, &storage[i]); i++; modv[i++] = NULL; assert(i == ARRAY_LENGTH(modv) || i == ARRAY_LENGTH(modv) - 1); return ((*update_op)(&key, modv, &gfarm_ldap_host_info_ops)); } static gfarm_error_t gfarm_ldap_host_add(struct gfarm_host_info *info) { gfarm_error_t e; e = gfarm_ldap_host_info_update(info, LDAP_MOD_ADD, gfarm_ldap_generic_info_add); free(info); return (e); } static gfarm_error_t gfarm_ldap_host_modify(struct db_host_modify_arg *arg) { gfarm_error_t e; /* XXX FIXME: should use modflags, add_aliases and del_aliases */ e = gfarm_ldap_host_info_update(&arg->hi, LDAP_MOD_REPLACE, gfarm_ldap_generic_info_modify); free(arg); return (e); } static gfarm_error_t gfarm_ldap_host_remove(char *hostname) { gfarm_error_t e; struct gfarm_ldap_host_info_key key; key.hostname = hostname; e = gfarm_ldap_generic_info_remove(&key, &gfarm_ldap_host_info_ops); free(hostname); return (e); } static gfarm_error_t gfarm_ldap_host_load(void *closure, void (*callback)(void *, struct gfarm_host_info *)) { struct gfarm_host_info tmp_info; return (gfarm_ldap_generic_info_get_foreach(gfarm_ldap_base_dn, LDAP_SCOPE_ONELEVEL, gfarm_ldap_host_info_ops.query_type, &tmp_info, (void (*)(void *, void *))callback, closure, &gfarm_ldap_host_info_ops)); } /**********************************************************************/ static char *gfarm_ldap_user_info_make_dn(void *vkey); static gfarm_error_t gfarm_ldap_user_info_set_field(void *info, char *attribute, char **vals); struct gfarm_ldap_user_info_key { const char *username; }; static const struct gfarm_ldap_generic_info_ops gfarm_ldap_user_info_ops = { &gfarm_base_user_info_ops, "(objectclass=GFarmUser)", "username=%s, %s", gfarm_ldap_user_info_make_dn, gfarm_ldap_user_info_set_field, }; static char * gfarm_ldap_user_info_make_dn(void *vkey) { struct gfarm_ldap_user_info_key *key = vkey; char *dn; GFARM_MALLOC_ARRAY(dn, strlen(gfarm_ldap_user_info_ops.dn_template) + strlen(key->username) + strlen(gfarm_ldap_base_dn) + 1); if (dn == NULL) { gflog_debug(GFARM_MSG_1002128, "allocation of string 'dn' failed"); return (NULL); } sprintf(dn, gfarm_ldap_user_info_ops.dn_template, key->username, gfarm_ldap_base_dn); return (dn); } static gfarm_error_t gfarm_ldap_user_info_set_field( void *vinfo, char *attribute, char **vals) { gfarm_error_t err = GFARM_ERR_NO_ERROR; struct gfarm_user_info *info = vinfo; static const char diag[] = "gfarm_ldap_user_info_set_field"; if (strcasecmp(attribute, "username") == 0) { info->username = strdup_log(vals[0], diag); if (info->username == NULL) err = GFARM_ERR_NO_MEMORY; } else if (strcasecmp(attribute, "realname") == 0) { /* XXX FIXME - hack to allow null string */ if (strcmp(vals[0], " ") == 0) info->realname = strdup_log("", diag); else info->realname = strdup_log(vals[0], diag); if (info->realname == NULL) err = GFARM_ERR_NO_MEMORY; } else if (strcasecmp(attribute, "homedir") == 0) { /* XXX FIXME - hack to allow null string */ if (strcmp(vals[0], " ") == 0) info->homedir = strdup_log("", diag); else info->homedir = strdup_log(vals[0], diag); if (info->homedir == NULL) err = GFARM_ERR_NO_MEMORY; } else if (strcasecmp(attribute, "gsiDN") == 0) { /* XXX FIXME - hack to allow null string */ if (strcmp(vals[0], " ") == 0) info->gsi_dn = strdup_log("", diag); else info->gsi_dn = strdup_log(vals[0], diag); if (info->gsi_dn == NULL) err = GFARM_ERR_NO_MEMORY; } return (err); } static gfarm_error_t gfarm_ldap_user_info_update( struct gfarm_user_info *info, int mod_op, gfarm_error_t (*update_op)(void *, LDAPMod **, const struct gfarm_ldap_generic_info_ops *)) { int i; LDAPMod *modv[6]; struct ldap_string_modify storage[ARRAY_LENGTH(modv) - 1]; struct gfarm_ldap_user_info_key key; key.username = info->username; i = 0; set_string_mod(&modv[i], mod_op, "objectclass", "GFarmUser", &storage[i]); i++; set_string_mod(&modv[i], mod_op, "username", info->username, &storage[i]); i++; /* XXX FIXME - hack to allow null string */ set_string_mod(&modv[i], mod_op, "realname", *info->realname ? info->realname : " ", &storage[i]); i++; /* XXX FIXME - hack to allow null string */ set_string_mod(&modv[i], mod_op, "homedir", *info->homedir ? info->homedir : " ", &storage[i]); i++; /* XXX FIXME - hack to allow null string */ set_string_mod(&modv[i], mod_op, "gsiDN", *info->gsi_dn ? info->gsi_dn : " ", &storage[i]); i++; modv[i++] = NULL; assert(i == ARRAY_LENGTH(modv)); return ((*update_op)(&key, modv, &gfarm_ldap_user_info_ops)); } static gfarm_error_t gfarm_ldap_user_add(struct gfarm_user_info *info) { gfarm_error_t e; e = gfarm_ldap_user_info_update(info, LDAP_MOD_ADD, gfarm_ldap_generic_info_add); free(info); return (e); } static gfarm_error_t gfarm_ldap_user_modify(struct db_user_modify_arg *arg) { gfarm_error_t e; e = gfarm_ldap_user_info_update(&arg->ui, LDAP_MOD_REPLACE, gfarm_ldap_generic_info_modify); free(arg); return (e); } static gfarm_error_t gfarm_ldap_user_remove(char *username) { gfarm_error_t e; struct gfarm_ldap_user_info_key key; key.username = username; e = gfarm_ldap_generic_info_remove(&key, &gfarm_ldap_user_info_ops); free(username); return (e); } static gfarm_error_t gfarm_ldap_user_load(void *closure, void (*callback)(void *, struct gfarm_user_info *)) { struct gfarm_user_info tmp_info; return (gfarm_ldap_generic_info_get_foreach(gfarm_ldap_base_dn, LDAP_SCOPE_ONELEVEL, gfarm_ldap_user_info_ops.query_type, &tmp_info, (void (*)(void *, void *))callback, closure, &gfarm_ldap_user_info_ops)); } /**********************************************************************/ static char *gfarm_ldap_group_info_make_dn(void *vkey); static gfarm_error_t gfarm_ldap_group_info_set_field(void *info, char *attribute, char **vals); struct gfarm_ldap_group_info_key { const char *groupname; }; static const struct gfarm_ldap_generic_info_ops gfarm_ldap_group_info_ops = { &gfarm_base_group_info_ops, "(objectclass=GFarmGroup)", "groupname=%s, %s", gfarm_ldap_group_info_make_dn, gfarm_ldap_group_info_set_field, }; static char * gfarm_ldap_group_info_make_dn(void *vkey) { struct gfarm_ldap_group_info_key *key = vkey; char *dn; GFARM_MALLOC_ARRAY(dn, strlen(gfarm_ldap_group_info_ops.dn_template) + strlen(key->groupname) + strlen(gfarm_ldap_base_dn) + 1); if (dn == NULL) { gflog_debug(GFARM_MSG_1002129, "allocation of string 'dn' failed"); return (NULL); } sprintf(dn, gfarm_ldap_group_info_ops.dn_template, key->groupname, gfarm_ldap_base_dn); return (dn); } static gfarm_error_t gfarm_ldap_group_info_set_field( void *vinfo, char *attribute, char **vals) { gfarm_error_t err = GFARM_ERR_NO_ERROR; struct gfarm_group_info *info = vinfo; static const char diag[] = "gfarm_ldap_group_info_set_field"; if (strcasecmp(attribute, "groupname") == 0) { info->groupname = strdup_log(vals[0], diag); if (info->groupname == NULL) err = GFARM_ERR_NO_MEMORY; } else if (strcasecmp(attribute, "groupusers") == 0) { info->usernames = gfarm_strarray_dup_log(vals, diag); if (info->usernames == NULL) { info->nusers = 0; err = GFARM_ERR_NO_MEMORY; } else { info->nusers = gfarm_strarray_length(info->usernames); } } return (err); } static gfarm_error_t gfarm_ldap_group_info_update( struct gfarm_group_info *info, int mod_op, gfarm_error_t (*update_op)(void *, LDAPMod **, const struct gfarm_ldap_generic_info_ops *)) { int i; LDAPMod *modv[4]; struct ldap_string_modify storage[ARRAY_LENGTH(modv) - 1]; LDAPMod groupusers_mod; struct gfarm_ldap_group_info_key key; key.groupname = info->groupname; i = 0; set_string_mod(&modv[i], mod_op, "objectclass", "GFarmGroup", &storage[i]); i++; set_string_mod(&modv[i], mod_op, "groupname", info->groupname, &storage[i]); i++; /* "groupusers" is optional */ if (info->usernames != NULL && info->nusers > 0) { groupusers_mod.mod_type = "groupusers"; groupusers_mod.mod_op = mod_op; groupusers_mod.mod_vals.modv_strvals = info->usernames; modv[i] = &groupusers_mod; i++; } modv[i++] = NULL; assert(i == ARRAY_LENGTH(modv) || i == ARRAY_LENGTH(modv) - 1); return ((*update_op)(&key, modv, &gfarm_ldap_group_info_ops)); } static gfarm_error_t gfarm_ldap_group_add(struct gfarm_group_info *info) { gfarm_error_t e; e = gfarm_ldap_group_info_update(info, LDAP_MOD_ADD, gfarm_ldap_generic_info_add); free(info); return (e); } static gfarm_error_t gfarm_ldap_group_modify(struct db_group_modify_arg *arg) { gfarm_error_t e; e = gfarm_ldap_group_info_update(&arg->gi, LDAP_MOD_REPLACE, gfarm_ldap_generic_info_modify); free(arg); return (e); } static gfarm_error_t gfarm_ldap_group_remove(char *groupname) { gfarm_error_t e; struct gfarm_ldap_group_info_key key; key.groupname = groupname; e = gfarm_ldap_generic_info_remove(&key, &gfarm_ldap_group_info_ops); free(groupname); return (e); } static gfarm_error_t gfarm_ldap_group_load(void *closure, void (*callback)(void *, struct gfarm_group_info *)) { struct gfarm_group_info tmp_info; return (gfarm_ldap_generic_info_get_foreach(gfarm_ldap_base_dn, LDAP_SCOPE_ONELEVEL, gfarm_ldap_group_info_ops.query_type, &tmp_info, (void (*)(void *, void *))callback, closure, &gfarm_ldap_group_info_ops)); } /**********************************************************************/ static char *gfarm_ldap_db_inode_inum_make_dn(void *vkey); static gfarm_error_t gfarm_ldap_gfs_stat_set_field(void *info, char *attribute, char **vals); static char INODE_QUERY_TYPE[] = "(objectclass=GFarmINode)"; static char INODE_DN_TEMPLATE[] = "inumber=%" GFARM_PRId64 ", %s"; static const struct gfarm_ldap_generic_info_ops gfarm_ldap_gfs_stat_ops = { &gfarm_base_gfs_stat_ops, INODE_QUERY_TYPE, INODE_DN_TEMPLATE, gfarm_ldap_db_inode_inum_make_dn, gfarm_ldap_gfs_stat_set_field, }; static char * gfarm_ldap_db_inode_inum_make_dn(void *vkey) { struct db_inode_inum_arg *key = vkey; char *dn; GFARM_MALLOC_ARRAY(dn, strlen(gfarm_ldap_gfs_stat_ops.dn_template) + INT64STRLEN + strlen(gfarm_ldap_base_dn) + 1); if (dn == NULL) { gflog_debug(GFARM_MSG_1002130, "allocation of string 'dn' failed"); return (NULL); } sprintf(dn, gfarm_ldap_gfs_stat_ops.dn_template, key->inum, gfarm_ldap_base_dn); return (dn); } static gfarm_error_t gfarm_ldap_gfs_stat_set_field( void *vinfo, char *attribute, char **vals) { gfarm_error_t err = GFARM_ERR_NO_ERROR; struct gfs_stat *info = vinfo; static const char diag[] = "gfarm_ldap_gfs_stat_set_field"; if (strcasecmp(attribute, "inumber") == 0) { info->st_ino = gfarm_strtoi64(vals[0], NULL); } else if (strcasecmp(attribute, "igen") == 0) { info->st_gen = gfarm_strtoi64(vals[0], NULL); } else if (strcasecmp(attribute, "mode") == 0) { info->st_mode = strtol(vals[0], NULL, 8); } else if (strcasecmp(attribute, "nlink") == 0) { info->st_nlink = gfarm_strtoi64(vals[0], NULL); } else if (strcasecmp(attribute, "size") == 0) { info->st_size = gfarm_strtoi64(vals[0], NULL); } else if (strcasecmp(attribute, "username") == 0) { info->st_user = strdup_log(vals[0], diag); if (info->st_user == NULL) err = GFARM_ERR_NO_MEMORY; } else if (strcasecmp(attribute, "groupname") == 0) { info->st_group = strdup_log(vals[0], diag); if (info->st_group == NULL) err = GFARM_ERR_NO_MEMORY; } else if (strcasecmp(attribute, "atimesec") == 0) { info->st_atimespec.tv_sec = gfarm_strtoi64(vals[0], NULL); } else if (strcasecmp(attribute, "atimensec") == 0) { info->st_atimespec.tv_nsec = strtol(vals[0], NULL, 0); } else if (strcasecmp(attribute, "mtimesec") == 0) { info->st_mtimespec.tv_sec = gfarm_strtoi64(vals[0], NULL); } else if (strcasecmp(attribute, "mtimensec") == 0) { info->st_mtimespec.tv_nsec = strtol(vals[0], NULL, 0); } else if (strcasecmp(attribute, "ctimesec") == 0) { info->st_ctimespec.tv_sec = gfarm_strtoi64(vals[0], NULL); } else if (strcasecmp(attribute, "ctimensec") == 0) { info->st_ctimespec.tv_nsec = strtol(vals[0], NULL, 0); } info->st_ncopy = 0; return (err); } static gfarm_error_t gfarm_ldap_gfs_stat_update( struct gfs_stat *info, int mod_op, gfarm_error_t (*update_op)(void *, LDAPMod **, const struct gfarm_ldap_generic_info_ops *)) { int i; LDAPMod *modv[15]; struct ldap_string_modify storage[ARRAY_LENGTH(modv) - 1]; char ino_string[INT64STRLEN + 1]; char igen_string[INT64STRLEN + 1]; char mode_string[INT32STRLEN + 1]; char nlink_string[INT64STRLEN + 1]; char size_string[INT64STRLEN + 1]; char atime_sec_string[INT64STRLEN + 1]; char atime_nsec_string[INT32STRLEN + 1]; char mtime_sec_string[INT64STRLEN + 1]; char mtime_nsec_string[INT32STRLEN + 1]; char ctime_sec_string[INT64STRLEN + 1]; char ctime_nsec_string[INT32STRLEN + 1]; struct db_inode_inum_arg key; key.inum = info->st_ino; sprintf(ino_string, "%" GFARM_PRId64, info->st_ino); sprintf(igen_string, "%" GFARM_PRId64, info->st_gen); sprintf(mode_string, "%07o", info->st_mode); sprintf(nlink_string, "%" GFARM_PRId64, info->st_nlink); sprintf(size_string, "%" GFARM_PRId64, info->st_size); sprintf(atime_sec_string, "%" GFARM_PRId64, info->st_atimespec.tv_sec); sprintf(atime_nsec_string, "%d", info->st_atimespec.tv_nsec); sprintf(mtime_sec_string, "%" GFARM_PRId64, info->st_mtimespec.tv_sec); sprintf(mtime_nsec_string, "%d", info->st_mtimespec.tv_nsec); sprintf(ctime_sec_string, "%" GFARM_PRId64, info->st_ctimespec.tv_sec); sprintf(ctime_nsec_string, "%d", info->st_ctimespec.tv_nsec); i = 0; set_string_mod(&modv[i], mod_op, "objectclass", "GFarmINode", &storage[i]); i++; set_string_mod(&modv[i], mod_op, "inumber", ino_string, &storage[i]); i++; set_string_mod(&modv[i], mod_op, "igen", igen_string, &storage[i]); i++; set_string_mod(&modv[i], mod_op, "mode", mode_string, &storage[i]); i++; set_string_mod(&modv[i], mod_op, "nlink", nlink_string, &storage[i]); i++; set_string_mod(&modv[i], mod_op, "size", size_string, &storage[i]); i++; set_string_mod(&modv[i], mod_op, "username", info->st_user, &storage[i]); i++; set_string_mod(&modv[i], mod_op, "groupname", info->st_group, &storage[i]); i++; set_string_mod(&modv[i], mod_op, "atimesec", atime_sec_string, &storage[i]); i++; set_string_mod(&modv[i], mod_op, "atimensec", atime_nsec_string, &storage[i]); i++; set_string_mod(&modv[i], mod_op, "mtimesec", mtime_sec_string, &storage[i]); i++; set_string_mod(&modv[i], mod_op, "mtimensec", mtime_nsec_string, &storage[i]); i++; set_string_mod(&modv[i], mod_op, "ctimesec", ctime_sec_string, &storage[i]); i++; set_string_mod(&modv[i], mod_op, "ctimensec", ctime_nsec_string, &storage[i]); i++; modv[i++] = NULL; assert(i == ARRAY_LENGTH(modv)); return ((*update_op)(&key, modv, &gfarm_ldap_gfs_stat_ops)); } static gfarm_error_t gfarm_ldap_inode_add(struct gfs_stat *info) { gfarm_error_t e; e = gfarm_ldap_gfs_stat_update(info, LDAP_MOD_ADD, gfarm_ldap_generic_info_add); free(info); return (e); } static gfarm_error_t gfarm_ldap_inode_modify(struct gfs_stat *info) { gfarm_error_t e; e = gfarm_ldap_gfs_stat_update(info, LDAP_MOD_REPLACE, gfarm_ldap_generic_info_modify); free(info); return (e); } static gfarm_error_t ldap_inode_uint64_modify(struct db_inode_uint64_modify_arg *arg, char *type) { gfarm_error_t e; int i; LDAPMod *modv[2]; struct ldap_string_modify storage[ARRAY_LENGTH(modv) - 1]; char ino_string[INT64STRLEN + 1]; char uint64_string[INT64STRLEN + 1]; struct db_inode_inum_arg key; key.inum = arg->inum; sprintf(ino_string, "%" GFARM_PRId64, arg->inum); sprintf(uint64_string, "%" GFARM_PRId64, arg->uint64); i = 0; set_string_mod(&modv[i], LDAP_MOD_REPLACE, type, uint64_string, &storage[i]); i++; modv[i++] = NULL; assert(i == ARRAY_LENGTH(modv)); e = gfarm_ldap_generic_info_modify(&key, modv, &gfarm_ldap_gfs_stat_ops); free(arg); return (e); } static gfarm_error_t ldap_inode_string_modify(struct db_inode_string_modify_arg *arg, char *type) { gfarm_error_t e; int i; LDAPMod *modv[2]; struct ldap_string_modify storage[ARRAY_LENGTH(modv) - 1]; char ino_string[INT64STRLEN + 1]; struct db_inode_inum_arg key; key.inum = arg->inum; sprintf(ino_string, "%" GFARM_PRId64, arg->inum); i = 0; set_string_mod(&modv[i], LDAP_MOD_REPLACE, type, arg->string, &storage[i]); i++; modv[i++] = NULL; assert(i == ARRAY_LENGTH(modv)); e = gfarm_ldap_generic_info_modify(&key, modv, &gfarm_ldap_gfs_stat_ops); free(arg); return (e); } static gfarm_error_t ldap_inode_timespec_modify(struct db_inode_timespec_modify_arg *arg, char *sec_type, char *nsec_type) { gfarm_error_t e; int i; LDAPMod *modv[3]; struct ldap_string_modify storage[ARRAY_LENGTH(modv) - 1]; char ino_string[INT64STRLEN + 1]; char sec_string[INT64STRLEN + 1]; char nsec_string[INT32STRLEN + 1]; struct db_inode_inum_arg key; key.inum = arg->inum; sprintf(ino_string, "%" GFARM_PRId64, arg->inum); sprintf(sec_string, "%" GFARM_PRId64, arg->time.tv_sec); sprintf(nsec_string, "%d", arg->time.tv_nsec); i = 0; set_string_mod(&modv[i], LDAP_MOD_REPLACE, sec_type, sec_string, &storage[i]); i++; set_string_mod(&modv[i], LDAP_MOD_REPLACE, nsec_type, nsec_string, &storage[i]); i++; modv[i++] = NULL; assert(i == ARRAY_LENGTH(modv)); e = gfarm_ldap_generic_info_modify(&key, modv, &gfarm_ldap_gfs_stat_ops); free(arg); return (e); } static gfarm_error_t gfarm_ldap_inode_gen_modify(struct db_inode_uint64_modify_arg *arg) { return (ldap_inode_uint64_modify(arg, "igen")); } static gfarm_error_t gfarm_ldap_inode_nlink_modify(struct db_inode_uint64_modify_arg *arg) { return (ldap_inode_uint64_modify(arg, "nlink")); } static gfarm_error_t gfarm_ldap_inode_size_modify(struct db_inode_uint64_modify_arg *arg) { return (ldap_inode_uint64_modify(arg, "size")); } static gfarm_error_t gfarm_ldap_inode_mode_modify(struct db_inode_uint32_modify_arg *arg) { gfarm_error_t e; int i; LDAPMod *modv[2]; struct ldap_string_modify storage[ARRAY_LENGTH(modv) - 1]; char ino_string[INT64STRLEN + 1]; char mode_string[INT32STRLEN + 1]; struct db_inode_inum_arg key; key.inum = arg->inum; sprintf(ino_string, "%" GFARM_PRId64, arg->inum); sprintf(mode_string, "%07o", arg->uint32); i = 0; set_string_mod(&modv[i], LDAP_MOD_REPLACE, "mode", mode_string, &storage[i]); i++; modv[i++] = NULL; assert(i == ARRAY_LENGTH(modv)); e = gfarm_ldap_generic_info_modify(&key, modv, &gfarm_ldap_gfs_stat_ops); free(arg); return (e); } static gfarm_error_t gfarm_ldap_inode_user_modify(struct db_inode_string_modify_arg *arg) { return (ldap_inode_string_modify(arg, "username")); } static gfarm_error_t gfarm_ldap_inode_group_modify(struct db_inode_string_modify_arg *arg) { return (ldap_inode_string_modify(arg, "groupname")); } static gfarm_error_t gfarm_ldap_inode_atime_modify(struct db_inode_timespec_modify_arg *arg) { return (ldap_inode_timespec_modify(arg, "atimesec", "atimensec")); } static gfarm_error_t gfarm_ldap_inode_mtime_modify(struct db_inode_timespec_modify_arg *arg) { return (ldap_inode_timespec_modify(arg, "mtimesec", "mtimensec")); } static gfarm_error_t gfarm_ldap_inode_ctime_modify(struct db_inode_timespec_modify_arg *arg) { return (ldap_inode_timespec_modify(arg, "ctimesec", "ctimensec")); } static gfarm_error_t gfarm_ldap_inode_load( void *closure, void (*callback)(void *, struct gfs_stat *)) { struct gfs_stat tmp_info; return (gfarm_ldap_generic_info_get_foreach(gfarm_ldap_base_dn, LDAP_SCOPE_ONELEVEL, gfarm_ldap_gfs_stat_ops.query_type, &tmp_info, (void (*)(void *, void *))callback, closure, &gfarm_ldap_gfs_stat_ops)); } /**********************************************************************/ static gfarm_error_t gfarm_ldap_inode_cksum_set_field(void *info, char *attribute, char **vals); static const struct gfarm_ldap_generic_info_ops gfarm_ldap_inode_cksum_ops = { &db_base_inode_cksum_arg_ops, INODE_QUERY_TYPE, INODE_DN_TEMPLATE, gfarm_ldap_db_inode_inum_make_dn, gfarm_ldap_inode_cksum_set_field, }; static gfarm_error_t gfarm_ldap_inode_cksum_set_field( void *vinfo, char *attribute, char **vals) { gfarm_error_t err = GFARM_ERR_NO_ERROR; struct db_inode_cksum_arg *info = vinfo; static const char diag[] = "gfarm_ldap_inode_cksum_set_field"; if (strcasecmp(attribute, "inumber") == 0) { info->inum = gfarm_strtoi64(vals[0], NULL); } else if (strcasecmp(attribute, "checksumType") == 0) { info->type = strdup_log(vals[0], diag); if (info->type == NULL) err = GFARM_ERR_NO_MEMORY; } else if (strcasecmp(attribute, "checksum") == 0) { info->sum = strdup_log(vals[0], diag); if (info->sum == NULL) { info->sum = 0; err = GFARM_ERR_NO_MEMORY; } else { info->len = strlen(info->sum); } } return (err); } static gfarm_error_t gfarm_ldap_inode_cksum_update( struct db_inode_cksum_arg *info, int mod_op, gfarm_error_t (*update_op)(void *, LDAPMod **, const struct gfarm_ldap_generic_info_ops *)) { int i; LDAPMod *modv[3]; struct ldap_string_modify storage[ARRAY_LENGTH(modv) - 1]; struct db_inode_inum_arg key; key.inum = info->inum; i = 0; set_string_mod(&modv[i], mod_op, "checksumType", info->type, &storage[i]); i++; set_string_mod(&modv[i], mod_op, "checksum", info->sum, &storage[i]); i++; modv[i++] = NULL; assert(i == ARRAY_LENGTH(modv)); return ((*update_op)(&key, modv, &gfarm_ldap_inode_cksum_ops)); } static gfarm_error_t gfarm_ldap_inode_cksum_add(struct db_inode_cksum_arg *arg) { gfarm_error_t e; e = gfarm_ldap_inode_cksum_update(arg, LDAP_MOD_ADD, gfarm_ldap_generic_info_modify); free(arg); return (e); } static gfarm_error_t gfarm_ldap_inode_cksum_modify(struct db_inode_cksum_arg *arg) { gfarm_error_t e; e = gfarm_ldap_inode_cksum_update(arg, LDAP_MOD_REPLACE, gfarm_ldap_generic_info_modify); free(arg); return (e); } static gfarm_error_t gfarm_ldap_inode_cksum_remove(struct db_inode_inum_arg *arg) { gfarm_error_t e; int i; LDAPMod *modv[3]; LDAPMod storage[ARRAY_LENGTH(modv) - 1]; i = 0; set_delete_mod(&modv[i], "checksumType", &storage[i]); i++; set_delete_mod(&modv[i], "checksum", &storage[i]); i++; modv[i++] = NULL; assert(i == ARRAY_LENGTH(modv)); e = gfarm_ldap_generic_info_modify(arg, modv, &gfarm_ldap_inode_cksum_ops); free(arg); return (e); } static gfarm_error_t gfarm_ldap_inode_cksum_load( void *closure, void (*callback)(void *, gfarm_ino_t, char *, size_t, char *)) { struct db_inode_cksum_arg tmp_info; struct db_inode_cksum_trampoline_closure c; c.closure = closure; c.callback = callback; return (gfarm_ldap_generic_info_get_foreach(gfarm_ldap_base_dn, LDAP_SCOPE_ONELEVEL, gfarm_ldap_inode_cksum_ops.query_type, &tmp_info, db_inode_cksum_callback_trampoline, &c, &gfarm_ldap_inode_cksum_ops)); } /**********************************************************************/ static char *gfarm_ldap_db_filecopy_make_dn(void *vkey); static gfarm_error_t gfarm_ldap_db_filecopy_set_field(void *info, char *attribute, char **vals); static const struct gfarm_ldap_generic_info_ops gfarm_ldap_db_filecopy_ops = { &db_base_filecopy_arg_ops, "(objectclass=GFarmFileCopy)", "hostname=%s, inumber=%" GFARM_PRId64 ", %s", gfarm_ldap_db_filecopy_make_dn, gfarm_ldap_db_filecopy_set_field, }; static char * gfarm_ldap_db_filecopy_make_dn(void *vkey) { struct db_filecopy_arg *key = vkey; char *dn; GFARM_MALLOC_ARRAY(dn, strlen(gfarm_ldap_db_filecopy_ops.dn_template) + strlen(key->hostname) + INT64STRLEN + + strlen(gfarm_ldap_base_dn) + 1); if (dn == NULL) { gflog_debug(GFARM_MSG_1002131, "allocation of string 'dn' failed"); return (NULL); } sprintf(dn, gfarm_ldap_db_filecopy_ops.dn_template, key->hostname, key->inum, gfarm_ldap_base_dn); return (dn); } static gfarm_error_t gfarm_ldap_db_filecopy_set_field( void *vinfo, char *attribute, char **vals) { gfarm_error_t err = GFARM_ERR_NO_ERROR; struct db_filecopy_arg *info = vinfo; static const char diag[] = "gfarm_ldap_db_filecopy_set_field"; if (strcasecmp(attribute, "inumber") == 0) { info->inum = gfarm_strtoi64(vals[0], NULL); } else if (strcasecmp(attribute, "hostname") == 0) { info->hostname = strdup_log(vals[0], diag); if (info->hostname == NULL) err = GFARM_ERR_NO_MEMORY; } return (err); } static gfarm_error_t gfarm_ldap_db_filecopy_update( struct db_filecopy_arg *info, int mod_op, gfarm_error_t (*update_op)(void *, LDAPMod **, const struct gfarm_ldap_generic_info_ops *)) { int i; LDAPMod *modv[4]; struct ldap_string_modify storage[ARRAY_LENGTH(modv) - 1]; char ino_string[INT64STRLEN + 1]; sprintf(ino_string, "%" GFARM_PRId64, info->inum); i = 0; set_string_mod(&modv[i], mod_op, "objectclass", "GFarmFileCopy", &storage[i]); i++; set_string_mod(&modv[i], mod_op, "inumber", ino_string, &storage[i]); i++; set_string_mod(&modv[i], mod_op, "hostname", info->hostname, &storage[i]); i++; modv[i++] = NULL; assert(i == ARRAY_LENGTH(modv)); return ((*update_op)(info, modv, &gfarm_ldap_db_filecopy_ops)); } static gfarm_error_t gfarm_ldap_filecopy_add(struct db_filecopy_arg *info) { gfarm_error_t e; e = gfarm_ldap_db_filecopy_update(info, LDAP_MOD_ADD, gfarm_ldap_generic_info_add); free(info); return (e); } static gfarm_error_t gfarm_ldap_filecopy_remove(struct db_filecopy_arg *arg) { gfarm_error_t e; e = gfarm_ldap_generic_info_remove(arg, &gfarm_ldap_db_filecopy_ops); free(arg); return (e); } static gfarm_error_t gfarm_ldap_filecopy_load( void *closure, void (*callback)(void *, gfarm_ino_t, char *)) { struct db_filecopy_arg tmp_info; struct db_filecopy_trampoline_closure c; c.closure = closure; c.callback = callback; return (gfarm_ldap_generic_info_get_foreach(gfarm_ldap_base_dn, LDAP_SCOPE_SUBTREE, gfarm_ldap_db_filecopy_ops.query_type, &tmp_info, db_filecopy_callback_trampoline, &c, &gfarm_ldap_db_filecopy_ops)); } /**********************************************************************/ static char *gfarm_ldap_db_deadfilecopy_make_dn(void *vkey); static gfarm_error_t gfarm_ldap_db_deadfilecopy_set_field(void *info, char *attribute, char **vals); static const struct gfarm_ldap_generic_info_ops gfarm_ldap_db_deadfilecopy_ops = { &db_base_deadfilecopy_arg_ops, "(objectclass=GFarmDeadFileCopy)", /* XXX FIXME - the following assumption is wrong: delay of removal */ /* There should not be two entries for the same inumber */ "hostname=%s, inumber=%" GFARM_PRId64 ", %s", gfarm_ldap_db_deadfilecopy_make_dn, gfarm_ldap_db_deadfilecopy_set_field, }; static char * gfarm_ldap_db_deadfilecopy_make_dn(void *vkey) { struct db_deadfilecopy_arg *key = vkey; char *dn; GFARM_MALLOC_ARRAY(dn, strlen(gfarm_ldap_db_deadfilecopy_ops.dn_template) + strlen(key->hostname) + INT64STRLEN + strlen(gfarm_ldap_base_dn) + 1); if (dn == NULL) { gflog_debug(GFARM_MSG_1002132, "allocation of string 'dn' failed"); return (NULL); } sprintf(dn, gfarm_ldap_db_deadfilecopy_ops.dn_template, key->hostname, key->inum, gfarm_ldap_base_dn); return (dn); } static gfarm_error_t gfarm_ldap_db_deadfilecopy_set_field( void *vinfo, char *attribute, char **vals) { gfarm_error_t err = GFARM_ERR_NO_ERROR; struct db_deadfilecopy_arg *info = vinfo; static const char diag[] = "gfarm_ldap_db_deadfilecopy_set_field"; if (strcasecmp(attribute, "inumber") == 0) { info->inum = gfarm_strtoi64(vals[0], NULL); } else if (strcasecmp(attribute, "igen") == 0) { info->igen = gfarm_strtoi64(vals[0], NULL); } else if (strcasecmp(attribute, "hostname") == 0) { info->hostname = strdup_log(vals[0], diag); if (info->hostname == NULL) err = GFARM_ERR_NO_MEMORY; } return (err); } static gfarm_error_t gfarm_ldap_db_deadfilecopy_update( struct db_deadfilecopy_arg *info, int mod_op, gfarm_error_t (*update_op)(void *, LDAPMod **, const struct gfarm_ldap_generic_info_ops *)) { int i; LDAPMod *modv[5]; struct ldap_string_modify storage[ARRAY_LENGTH(modv) - 1]; char ino_string[INT64STRLEN + 1]; char igen_string[INT64STRLEN + 1]; sprintf(ino_string, "%" GFARM_PRId64, info->inum); sprintf(igen_string, "%" GFARM_PRId64, info->igen); i = 0; set_string_mod(&modv[i], mod_op, "objectclass", "GFarmDeadFileCopy", &storage[i]); i++; set_string_mod(&modv[i], mod_op, "inumber", ino_string, &storage[i]); i++; set_string_mod(&modv[i], mod_op, "igen", igen_string, &storage[i]); i++; set_string_mod(&modv[i], mod_op, "hostname", info->hostname, &storage[i]); i++; modv[i++] = NULL; assert(i == ARRAY_LENGTH(modv)); return ((*update_op)(info, modv, &gfarm_ldap_db_deadfilecopy_ops)); } static gfarm_error_t gfarm_ldap_deadfilecopy_add(struct db_deadfilecopy_arg *info) { gfarm_error_t e; e = gfarm_ldap_db_deadfilecopy_update(info, LDAP_MOD_ADD, gfarm_ldap_generic_info_add); free(info); return (e); } static gfarm_error_t gfarm_ldap_deadfilecopy_remove(struct db_deadfilecopy_arg *arg) { gfarm_error_t e; e = gfarm_ldap_generic_info_remove( arg, &gfarm_ldap_db_deadfilecopy_ops); free(arg); return (e); } static gfarm_error_t gfarm_ldap_deadfilecopy_load( void *closure, void (*callback)(void *, gfarm_ino_t, gfarm_uint64_t, char *)) { struct db_deadfilecopy_arg tmp_info; struct db_deadfilecopy_trampoline_closure c; c.closure = closure; c.callback = callback; return (gfarm_ldap_generic_info_get_foreach(gfarm_ldap_base_dn, LDAP_SCOPE_SUBTREE, gfarm_ldap_db_deadfilecopy_ops.query_type, &tmp_info, db_deadfilecopy_callback_trampoline, &c, &gfarm_ldap_db_deadfilecopy_ops)); } /**********************************************************************/ static char *gfarm_ldap_db_direntry_make_dn(void *vkey); static gfarm_error_t gfarm_ldap_db_direntry_set_field(void *info, char *attribute, char **vals); static const struct gfarm_ldap_generic_info_ops gfarm_ldap_db_direntry_ops = { &db_base_direntry_arg_ops, "(objectclass=GFarmDirEntry)", "entryName=%s, inumber=%" GFARM_PRId64 ", %s", gfarm_ldap_db_direntry_make_dn, gfarm_ldap_db_direntry_set_field, }; /* see RFC 2253 (Section 2.4 and 3) for detail */ static void gfarm_ldap_quote_string(char *quoted, const char *string, int slen) { int i; unsigned char c; *quoted++ = '"'; for (i = 0; i < slen; i++) { c = string[i]; if (c < ' ') { *quoted++ = '\\'; *quoted++ = c / 0x10; *quoted++ = c % 0x10; } else { if (c == '"' || c == '\\') *quoted++ = '\\'; *quoted++ = c; } } *quoted++ = '"'; *quoted++ = '\0'; } /* this implementation should match with gfarm_ldap_quote_string() */ static int gfarm_ldap_quote_string_length(const char *string, int slen) { int i, qlen = 0; unsigned char c; ++qlen; for (i = 0; i < slen; i++) { c = string[i]; if (c < ' ') { qlen += 3; } else { if (c == '"' || c == '\\') ++qlen; ++qlen; } } qlen += 2; return (qlen); } static char * gfarm_ldap_db_direntry_make_dn(void *vkey) { struct db_direntry_arg *key = vkey; char *dn, *quoted; int quoted_len; quoted_len = gfarm_ldap_quote_string_length(key->entry_name, key->entry_len); GFARM_MALLOC_ARRAY(quoted, quoted_len); if (quoted == NULL) { gflog_debug(GFARM_MSG_1002133, "allocation of string 'quoted' failed"); return (NULL); } gfarm_ldap_quote_string(quoted, key->entry_name, key->entry_len); GFARM_MALLOC_ARRAY(dn, strlen(gfarm_ldap_db_direntry_ops.dn_template) + quoted_len + INT64STRLEN + strlen(gfarm_ldap_base_dn) + 1); if (dn != NULL) sprintf(dn, gfarm_ldap_db_direntry_ops.dn_template, quoted, key->dir_inum, gfarm_ldap_base_dn); else gflog_debug(GFARM_MSG_1002134, "allocation of string 'dn' failed"); free(quoted); return (dn); } static gfarm_error_t gfarm_ldap_db_direntry_set_field( void *vinfo, char *attribute, char **vals) { gfarm_error_t err = GFARM_ERR_NO_ERROR; struct db_direntry_arg *info = vinfo; static const char diag[] = "gfarm_ldap_db_direntry_set_field"; if (strcasecmp(attribute, "inumber") == 0) { info->dir_inum = gfarm_strtoi64(vals[0], NULL); } else if (strcasecmp(attribute, "entryName") == 0) { info->entry_name = strdup_log(vals[0], diag); if (info->entry_name == NULL) { info->entry_len = 0; err = GFARM_ERR_NO_MEMORY; } else { info->entry_len = strlen(info->entry_name); } } else if (strcasecmp(attribute, "entryINumber") == 0) { info->entry_inum = gfarm_strtoi64(vals[0], NULL); } return (err); } static gfarm_error_t gfarm_ldap_db_direntry_update( struct db_direntry_arg *info, int mod_op, gfarm_error_t (*update_op)(void *, LDAPMod **, const struct gfarm_ldap_generic_info_ops *)) { int i; LDAPMod *modv[5]; struct ldap_string_modify storage[ARRAY_LENGTH(modv) - 1]; char ino_string[INT64STRLEN + 1]; char entry_ino_string[INT64STRLEN + 1]; struct db_direntry_arg key; key.dir_inum = info->dir_inum; key.entry_name = info->entry_name; key.entry_len = info->entry_len; sprintf(ino_string, "%" GFARM_PRId64, info->dir_inum); sprintf(entry_ino_string, "%" GFARM_PRId64, info->entry_inum); i = 0; set_string_mod(&modv[i], mod_op, "objectclass", "GFarmDirEntry", &storage[i]); i++; set_string_mod(&modv[i], mod_op, "inumber", ino_string, &storage[i]); i++; set_string_mod(&modv[i], mod_op, "entryName", info->entry_name, &storage[i]); i++; set_string_mod(&modv[i], mod_op, "entryINumber", entry_ino_string, &storage[i]); i++; modv[i++] = NULL; assert(i == ARRAY_LENGTH(modv)); return ((*update_op)(&key, modv, &gfarm_ldap_db_direntry_ops)); } static gfarm_error_t gfarm_ldap_direntry_add(struct db_direntry_arg *info) { gfarm_error_t e; e = gfarm_ldap_db_direntry_update(info, LDAP_MOD_ADD, gfarm_ldap_generic_info_add); free(info); return (e); } static gfarm_error_t gfarm_ldap_direntry_remove(struct db_direntry_arg *arg) { gfarm_error_t e; e = gfarm_ldap_generic_info_remove(arg, &gfarm_ldap_db_direntry_ops); free(arg); return (e); } static gfarm_error_t gfarm_ldap_direntry_load( void *closure, void (*callback)(void *, gfarm_ino_t, char *, int, gfarm_ino_t)) { struct db_direntry_arg tmp_info; struct db_direntry_trampoline_closure c; c.closure = closure; c.callback = callback; return (gfarm_ldap_generic_info_get_foreach(gfarm_ldap_base_dn, LDAP_SCOPE_SUBTREE, gfarm_ldap_db_direntry_ops.query_type, &tmp_info, db_direntry_callback_trampoline, &c, &gfarm_ldap_db_direntry_ops)); } /**********************************************************************/ static gfarm_error_t gfarm_ldap_db_symlink_set_field(void *info, char *attribute, char **vals); static const struct gfarm_ldap_generic_info_ops gfarm_ldap_db_symlink_ops = { &db_base_symlink_arg_ops, "(objectclass=GFarmSymlink)", "inumber=%" GFARM_PRId64 ", %s", gfarm_ldap_db_inode_inum_make_dn, gfarm_ldap_db_symlink_set_field, }; static gfarm_error_t gfarm_ldap_db_symlink_set_field( void *vinfo, char *attribute, char **vals) { gfarm_error_t err = GFARM_ERR_NO_ERROR; struct db_symlink_arg *info = vinfo; static const char diag[] = "gfarm_ldap_db_symlink_set_field"; if (strcasecmp(attribute, "inumber") == 0) { info->inum = gfarm_strtoi64(vals[0], NULL); } else if (strcasecmp(attribute, "sourcePath") == 0) { info->source_path = strdup_log(vals[0], diag); if (info->source_path == NULL) err = GFARM_ERR_NO_MEMORY; } return (err); } static gfarm_error_t gfarm_ldap_symlink_add(struct db_symlink_arg *info) { gfarm_error_t e; int i; LDAPMod *modv[3]; LDAPMod objectclass_modify; static char *objectclass_value[] = { "GFarmINode", "GFarmSymlink", NULL }; struct ldap_string_modify path_storage; struct db_inode_inum_arg key; key.inum = info->inum; i = 0; objectclass_modify.mod_op = LDAP_MOD_REPLACE; objectclass_modify.mod_type = "objectclass"; objectclass_modify.mod_vals.modv_strvals = objectclass_value; modv[i] = &objectclass_modify; i++; set_string_mod(&modv[i], LDAP_MOD_REPLACE, "sourcePath", info->source_path, &path_storage); i++; modv[i++] = NULL; assert(i == ARRAY_LENGTH(modv)); /* use "modify" instead of "add", since this is an AUXILIARY object */ e = gfarm_ldap_generic_info_modify(&key, modv, &gfarm_ldap_db_symlink_ops); free(info); return (e); } static gfarm_error_t gfarm_ldap_symlink_remove(struct db_inode_inum_arg *arg) { gfarm_error_t e; int i; LDAPMod *modv[3]; struct ldap_string_modify objectclass_storage; LDAPMod source_path_storage; struct db_inode_inum_arg key; key.inum = arg->inum; i = 0; set_string_mod(&modv[i], LDAP_MOD_REPLACE, "objectclass", "GFarmINode", &objectclass_storage); i++; set_delete_mod(&modv[i], "sourcePath", &source_path_storage); i++; modv[i++] = NULL; assert(i == ARRAY_LENGTH(modv)); /* * use "modify" instead of "remove", since this is an AUXILIARY object */ e = gfarm_ldap_generic_info_modify(&key, modv, &gfarm_ldap_db_symlink_ops); free(arg); return (e); } static gfarm_error_t gfarm_ldap_symlink_load( void *closure, void (*callback)(void *, gfarm_ino_t, char *)) { struct db_symlink_arg tmp_info; struct db_symlink_trampoline_closure c; c.closure = closure; c.callback = callback; return (gfarm_ldap_generic_info_get_foreach(gfarm_ldap_base_dn, LDAP_SCOPE_ONELEVEL, gfarm_ldap_db_symlink_ops.query_type, &tmp_info, db_symlink_callback_trampoline, &c, &gfarm_ldap_db_symlink_ops)); } /**********************************************************************/ static char *gfarm_ldap_xattr_info_make_dn(void *vkey); static gfarm_error_t gfarm_ldap_db_xattr_set_field(void *vinfo, char *attribute, char **vals); static gfarm_error_t gfarm_ldap_db_xmlattr_set_field(void *vinfo, char *attribute, char **vals); static const struct gfarm_ldap_generic_info_ops gfarm_ldap_xattr_info_ops = { &gfarm_base_xattr_info_ops, "(objectclass=XAttr)", "attrname=%s, inumber=%" GFARM_PRId64 ", %s", gfarm_ldap_xattr_info_make_dn, gfarm_ldap_db_xattr_set_field, }; static const struct gfarm_ldap_generic_info_ops gfarm_ldap_xmlattr_info_ops = { &gfarm_base_xattr_info_ops, "(objectclass=XAttr)", "attrname=%s, inumber=%" GFARM_PRId64 ", %s", gfarm_ldap_xattr_info_make_dn, gfarm_ldap_db_xmlattr_set_field, }; struct gfarm_ldap_xattr_get_info_key { gfarm_ino_t inumber; const char *attrname; }; static char * gfarm_ldap_xattr_info_make_dn(void *vkey) { struct gfarm_ldap_xattr_get_info_key *key = vkey; char *dn; GFARM_MALLOC_ARRAY(dn, strlen(gfarm_ldap_xattr_info_ops.dn_template) + strlen(key->attrname) + INT64STRLEN + strlen(gfarm_ldap_base_dn) + 1); if (dn == NULL) { gflog_debug(GFARM_MSG_1002135, "allocation of string 'dn' failed"); return (NULL); } sprintf(dn, gfarm_ldap_xattr_info_ops.dn_template, key->attrname, key->inumber, gfarm_ldap_base_dn); return (dn); } /* NOTE: if xmlMode, attrvalue is unnecessary to load. */ static gfarm_error_t gfarm_ldap_db_xmlattr_set_field(void *vinfo, char *attribute, char **vals) { gfarm_error_t err = GFARM_ERR_NO_ERROR; struct xattr_info *info = vinfo; static const char diag[] = "gfarm_ldap_db_x(ml)attr_set_field"; if (strcasecmp(attribute, "inumber") == 0) { info->inum = gfarm_strtoi64(vals[0], NULL); } else if (strcasecmp(attribute, "attrname") == 0) { info->attrname = strdup_log(vals[0], diag); if (info->attrname == NULL) { info->namelen = 0; err = GFARM_ERR_NO_MEMORY; } else { /* include '\0' */ info->namelen = strlen(info->attrname) + 1; } } return (err); } static gfarm_error_t gfarm_ldap_db_xattr_set_field(void *vinfo, char *attribute, char **vals) { gfarm_error_t err = GFARM_ERR_NO_ERROR; struct xattr_info *info = vinfo; struct berval **bervals; if (strcasecmp(attribute, "attrvalue") == 0) { bervals = (struct berval **)vals; info->attrsize = bervals[0]->bv_len; if (info->attrsize <= 0) { info->attrvalue = NULL; } else { info->attrvalue = malloc(info->attrsize); if (info->attrvalue == NULL) { gflog_debug(GFARM_MSG_1002512, "failed to allocate %d bytes xattr value", info->attrsize); info->attrsize = 0; err = GFARM_ERR_NO_MEMORY; } else { memcpy(info->attrvalue, bervals[0]->bv_val, info->attrsize); } } return (err); } else return (gfarm_ldap_db_xmlattr_set_field( vinfo, attribute, vals)); } static gfarm_error_t gfarm_ldap_xattr_update( struct db_xattr_arg *arg, int mod_op, gfarm_error_t (*update_op)(void *, LDAPMod **, const struct gfarm_ldap_generic_info_ops *)) { gfarm_error_t e; int i; LDAPMod *modv[5]; struct ldap_string_modify storage[ARRAY_LENGTH(modv) - 1]; struct ldap_binary_modify binstorage; char ino_string[INT64STRLEN + 1]; struct gfarm_ldap_xattr_get_info_key key; if (arg->xmlMode) return (GFARM_ERR_OPERATION_NOT_SUPPORTED); key.inumber = arg->inum; key.attrname = arg->attrname; sprintf(ino_string, "%" GFARM_PRId64, arg->inum); i = 0; set_string_mod(&modv[i], mod_op, "objectclass", "XAttr", &storage[i]); i++; set_string_mod(&modv[i], mod_op, "inumber", ino_string, &storage[i]); i++; set_string_mod(&modv[i], mod_op, "attrname", (char *)arg->attrname, &storage[i]); i++; set_binary_mod(&modv[i], mod_op, "attrvalue", (void *)arg->value, arg->size, &binstorage); i++; modv[i++] = NULL; assert(i == ARRAY_LENGTH(modv)); e = ((*update_op)(&key, modv, &gfarm_ldap_xattr_info_ops)); return (e); } static gfarm_error_t gfarm_ldap_xattr_add(struct db_xattr_arg *arg) { gfarm_error_t e; e = gfarm_ldap_xattr_update(arg, LDAP_MOD_ADD, gfarm_ldap_generic_info_add); free(arg); return (e); } static gfarm_error_t gfarm_ldap_xattr_modify(struct db_xattr_arg *arg) { gfarm_error_t e; e = gfarm_ldap_xattr_update(arg, LDAP_MOD_REPLACE, gfarm_ldap_generic_info_modify); free(arg); return (e); } static gfarm_error_t gfarm_ldap_xattr_remove(struct db_xattr_arg *arg) { gfarm_error_t e; struct gfarm_ldap_xattr_get_info_key key; if (arg->xmlMode) return (GFARM_ERR_OPERATION_NOT_SUPPORTED); key.inumber = arg->inum; key.attrname = arg->attrname; e = gfarm_ldap_generic_info_remove(&key, &gfarm_ldap_xattr_info_ops); free(arg); return (e); } static gfarm_error_t gfarm_ldap_xattr_get(struct db_xattr_arg *arg) { gfarm_error_t e; char *query_type; char *attrs[2] = { "attrvalue", NULL }; struct timeval tout = { 10, 0 }; int cnt, rv; LDAPMessage *res = NULL, *m; struct berval **vals; void *p; if (arg->xmlMode) { e = GFARM_ERR_OPERATION_NOT_SUPPORTED; gflog_debug(GFARM_MSG_1002136, "operation not supported(xmlMode is true)"); goto quit; } GFARM_MALLOC_ARRAY(query_type, 64+INT64STRLEN+strlen(arg->attrname)); if (query_type == NULL) { gflog_debug(GFARM_MSG_1002137, "allocation of string 'query_type' failed"); e = GFARM_ERR_NO_MEMORY; goto quit; } sprintf(query_type, "(&(objectclass=XAttr)(inumber=%"GFARM_PRId64")(attrname=%s))", arg->inum, arg->attrname); rv = ldap_search_st(gfarm_ldap_server, gfarm_ldap_base_dn, LDAP_SCOPE_SUBTREE, query_type, attrs, 0, &tout, &res); free(query_type); if (rv == LDAP_NO_SUCH_OBJECT) { e = GFARM_ERR_NO_SUCH_OBJECT; gflog_debug(GFARM_MSG_1002138, "ldap_search_st() failed: %s", gfarm_error_string(e)); goto quit; } else if ((rv != LDAP_SUCCESS) || (res == NULL)) { e = GFARM_ERR_UNKNOWN; gflog_debug(GFARM_MSG_1002139, "unknown error occurred in ldap_search_st()"); goto quit; } cnt = ldap_count_messages(gfarm_ldap_server, res); if (cnt <= 1) { /* NOTE: cnt==1 means res have a NULL message only */ e = GFARM_ERR_NO_SUCH_OBJECT; gflog_debug(GFARM_MSG_1002140, "ldap count messages() <= 1"); } else if (cnt != 2) { /* NOTE: res must have a valid message and a NULL message */ e = GFARM_ERR_UNKNOWN; gflog_debug(GFARM_MSG_1002141, "ldap_count_messages() != 2"); } else if ((m = ldap_first_message(gfarm_ldap_server, res)) == NULL) { e = GFARM_ERR_UNKNOWN; gflog_error(GFARM_MSG_1002369, "ldap_first_message: %s", gfarm_ldap_session_error()); } else if ((vals = ldap_get_values_len(gfarm_ldap_server, m, attrs[0])) == NULL) { e = GFARM_ERR_UNKNOWN; gflog_error(GFARM_MSG_1002370, "ldap_get_values_len: %s", gfarm_ldap_session_error()); } else { if ((vals[0] != NULL) && (vals[1] == NULL)) { e = GFARM_ERR_NO_ERROR; *arg->sizep = vals[0]->bv_len; if (vals[0]->bv_len > 0) { p = malloc(vals[0]->bv_len); if (p != NULL) { memcpy(p, vals[0]->bv_val, vals[0]->bv_len); *arg->valuep = p; } else { e = GFARM_ERR_NO_MEMORY; gflog_debug(GFARM_MSG_1002142, "allocation of 'vals' failed"); } } else *arg->valuep = NULL; } else { e = GFARM_ERR_UNKNOWN; gflog_debug(GFARM_MSG_1002143, "unknown error occurred when " "getting first ldap message"); } ldap_value_free_len(vals); } ldap_msgfree(res); quit: free(arg); return (e); } gfarm_error_t gfarm_ldap_xattr_load(void *closure, void (*callback)(void *, struct xattr_info *)) { int xmlMode = (closure != NULL) ? (*(int *)closure) : 0; struct xattr_info tmp_info; char *attrs[] = { "inumber", "attrname", NULL }; if (xmlMode) return (GFARM_ERR_OPERATION_NOT_SUPPORTED); return (gfarm_ldap_generic_info_get_foreach_withattrs( gfarm_ldap_base_dn, LDAP_SCOPE_SUBTREE, gfarm_ldap_xattr_info_ops.query_type, &tmp_info, (void (*)(void *, void *))callback, &xmlMode, /* NOTE: if xmlMode, attrvalue is unnecessary to load. */ xmlMode ? &gfarm_ldap_xmlattr_info_ops : &gfarm_ldap_xattr_info_ops, attrs)); } static gfarm_error_t gfarm_ldap_xmlattr_find(struct db_xmlattr_find_arg *arg) { free(arg); return (GFARM_ERR_OPERATION_NOT_SUPPORTED); } /**********************************************************************/ static gfarm_error_t gfarm_ldap_quota_add(struct db_quota_arg *arg) { /* XXX not implemented yet */ free(arg); return (GFARM_ERR_FUNCTION_NOT_IMPLEMENTED); } static gfarm_error_t gfarm_ldap_quota_modify(struct db_quota_arg *arg) { /* XXX not implemented yet */ free(arg); return (GFARM_ERR_FUNCTION_NOT_IMPLEMENTED); } static gfarm_error_t gfarm_ldap_quota_remove(struct db_quota_remove_arg *arg) { /* XXX not implemented yet */ free(arg); return (GFARM_ERR_FUNCTION_NOT_IMPLEMENTED); } static gfarm_error_t gfarm_ldap_quota_load(void *closure, int is_group, void (*callback)(void *, struct gfarm_quota_info *)) { /* XXX not implemented yet */ return (GFARM_ERR_FUNCTION_NOT_IMPLEMENTED); } /**********************************************************************/ const struct db_ops db_ldap_ops = { gfarm_ldap_initialize, gfarm_ldap_terminate, gfarm_ldap_nop, gfarm_ldap_nop, gfarm_ldap_host_add, gfarm_ldap_host_modify, gfarm_ldap_host_remove, gfarm_ldap_host_load, gfarm_ldap_user_add, gfarm_ldap_user_modify, gfarm_ldap_user_remove, gfarm_ldap_user_load, gfarm_ldap_group_add, gfarm_ldap_group_modify, gfarm_ldap_group_remove, gfarm_ldap_group_load, gfarm_ldap_inode_add, gfarm_ldap_inode_modify, gfarm_ldap_inode_gen_modify, gfarm_ldap_inode_nlink_modify, gfarm_ldap_inode_size_modify, gfarm_ldap_inode_mode_modify, gfarm_ldap_inode_user_modify, gfarm_ldap_inode_group_modify, gfarm_ldap_inode_atime_modify, gfarm_ldap_inode_mtime_modify, gfarm_ldap_inode_ctime_modify, /* inode_remove: never remove any inode to keep inode->i_gen */ gfarm_ldap_inode_load, /* cksum */ gfarm_ldap_inode_cksum_add, gfarm_ldap_inode_cksum_modify, gfarm_ldap_inode_cksum_remove, gfarm_ldap_inode_cksum_load, gfarm_ldap_filecopy_add, gfarm_ldap_filecopy_remove, gfarm_ldap_filecopy_load, gfarm_ldap_deadfilecopy_add, gfarm_ldap_deadfilecopy_remove, gfarm_ldap_deadfilecopy_load, gfarm_ldap_direntry_add, gfarm_ldap_direntry_remove, gfarm_ldap_direntry_load, gfarm_ldap_symlink_add, gfarm_ldap_symlink_remove, gfarm_ldap_symlink_load, gfarm_ldap_xattr_add, gfarm_ldap_xattr_modify, gfarm_ldap_xattr_remove, NULL, /* gfarm_ldap_xattr_removeall not supported */ gfarm_ldap_xattr_get, gfarm_ldap_xattr_load, gfarm_ldap_xmlattr_find, gfarm_ldap_quota_add, gfarm_ldap_quota_modify, gfarm_ldap_quota_remove, gfarm_ldap_quota_load, }; gfarm-2.4.1/server/gfmd/db_none.c0000644000000000000000000002254011507222724015310 0ustar rootroot/* * Copyright (c) 2003-2006 National Institute of Advanced * Industrial Science and Technology (AIST). All rights reserved. * * Copyright (c) 2006 National Institute of Informatics in Japan, * All rights reserved. * * This file or a portion of this file is licensed under the terms of * the NAREGI Public License, found at * http://www.naregi.org/download/index.html. * If you redistribute this file, with or without modifications, you * must include this notice in the file. */ /* * $Id: db_none.c 4679 2010-05-18 08:05:48Z n-soda $ */ #include /* db_access.h currently needs this */ #include #include #include #include #include "gfutil.h" #include "config.h" #include "quota.h" #include "db_access.h" #include "db_ops.h" /**********************************************************************/ gfarm_error_t gfarm_none_initialize(void) { return (GFARM_ERR_OPERATION_NOT_SUPPORTED); } gfarm_error_t gfarm_none_terminate(void) { return (GFARM_ERR_OPERATION_NOT_SUPPORTED); } /**********************************************************************/ static gfarm_error_t gfarm_none_nop(void *arg) { return (GFARM_ERR_OPERATION_NOT_SUPPORTED); } /**********************************************************************/ static gfarm_error_t gfarm_none_host_add(struct gfarm_host_info *info) { free(info); return (GFARM_ERR_OPERATION_NOT_SUPPORTED); } static gfarm_error_t gfarm_none_host_modify(struct db_host_modify_arg *arg) { free(arg); return (GFARM_ERR_OPERATION_NOT_SUPPORTED); } static gfarm_error_t gfarm_none_host_remove(char *hostname) { free(hostname); return (GFARM_ERR_OPERATION_NOT_SUPPORTED); } static gfarm_error_t gfarm_none_host_load(void *closure, void (*callback)(void *, struct gfarm_host_info *)) { return (GFARM_ERR_OPERATION_NOT_SUPPORTED); } /**********************************************************************/ static gfarm_error_t gfarm_none_user_add(struct gfarm_user_info *info) { free(info); return (GFARM_ERR_OPERATION_NOT_SUPPORTED); } static gfarm_error_t gfarm_none_user_modify(struct db_user_modify_arg *arg) { free(arg); return (GFARM_ERR_OPERATION_NOT_SUPPORTED); } static gfarm_error_t gfarm_none_user_remove(char *username) { free(username); return (GFARM_ERR_OPERATION_NOT_SUPPORTED); } static gfarm_error_t gfarm_none_user_load(void *closure, void (*callback)(void *, struct gfarm_user_info *)) { return (GFARM_ERR_OPERATION_NOT_SUPPORTED); } /**********************************************************************/ static gfarm_error_t gfarm_none_group_add(struct gfarm_group_info *info) { free(info); return (GFARM_ERR_OPERATION_NOT_SUPPORTED); } static gfarm_error_t gfarm_none_group_modify(struct db_group_modify_arg *arg) { free(arg); return (GFARM_ERR_OPERATION_NOT_SUPPORTED); } static gfarm_error_t gfarm_none_group_remove(char *groupname) { free(groupname); return (GFARM_ERR_OPERATION_NOT_SUPPORTED); } static gfarm_error_t gfarm_none_group_load(void *closure, void (*callback)(void *, struct gfarm_group_info *)) { return (GFARM_ERR_OPERATION_NOT_SUPPORTED); } /**********************************************************************/ static gfarm_error_t gfarm_none_inode_stat_free(struct gfs_stat *arg) { gfs_stat_free(arg); return (GFARM_ERR_OPERATION_NOT_SUPPORTED); } static gfarm_error_t gfarm_none_inode_int64_free(struct db_inode_uint64_modify_arg *arg) { free(arg); return (GFARM_ERR_OPERATION_NOT_SUPPORTED); } static gfarm_error_t gfarm_none_inode_int32_free(struct db_inode_uint32_modify_arg *arg) { free(arg); return (GFARM_ERR_OPERATION_NOT_SUPPORTED); } static gfarm_error_t gfarm_none_inode_string_free(struct db_inode_string_modify_arg *arg) { free(arg); return (GFARM_ERR_OPERATION_NOT_SUPPORTED); } static gfarm_error_t gfarm_none_inode_timespec_free(struct db_inode_timespec_modify_arg *arg) { free(arg); return (GFARM_ERR_OPERATION_NOT_SUPPORTED); } static gfarm_error_t gfarm_none_inode_load( void *closure, void (*callback)(void *, struct gfs_stat *)) { return (GFARM_ERR_OPERATION_NOT_SUPPORTED); } /**********************************************************************/ static gfarm_error_t gfarm_none_inode_cksum_free(struct db_inode_cksum_arg *arg) { free(arg); return (GFARM_ERR_OPERATION_NOT_SUPPORTED); } static gfarm_error_t gfarm_none_inode_inum_free(struct db_inode_inum_arg *arg) { free(arg); return (GFARM_ERR_OPERATION_NOT_SUPPORTED); } static gfarm_error_t gfarm_none_inode_cksum_load( void *closure, void (*callback)(void *, gfarm_ino_t, char *, size_t, char *)) { return (GFARM_ERR_OPERATION_NOT_SUPPORTED); } /**********************************************************************/ static gfarm_error_t gfarm_none_filecopy_free(struct db_filecopy_arg *arg) { free(arg); return (GFARM_ERR_OPERATION_NOT_SUPPORTED); } static gfarm_error_t gfarm_none_filecopy_load( void *closure, void (*callback)(void *, gfarm_ino_t, char *)) { return (GFARM_ERR_OPERATION_NOT_SUPPORTED); } /**********************************************************************/ static gfarm_error_t gfarm_none_deadfilecopy_free(struct db_deadfilecopy_arg *arg) { free(arg); return (GFARM_ERR_OPERATION_NOT_SUPPORTED); } static gfarm_error_t gfarm_none_deadfilecopy_load( void *closure, void (*callback)(void *, gfarm_ino_t, gfarm_uint64_t, char *)) { return (GFARM_ERR_OPERATION_NOT_SUPPORTED); } /**********************************************************************/ static gfarm_error_t gfarm_none_direntry_add(struct db_direntry_arg *arg) { free(arg); return (GFARM_ERR_OPERATION_NOT_SUPPORTED); } static gfarm_error_t gfarm_none_direntry_remove(struct db_direntry_arg *arg) { free(arg); return (GFARM_ERR_OPERATION_NOT_SUPPORTED); } static gfarm_error_t gfarm_none_direntry_load( void *closure, void (*callback)(void *, gfarm_ino_t, char *, int, gfarm_ino_t)) { return (GFARM_ERR_OPERATION_NOT_SUPPORTED); } /**********************************************************************/ static gfarm_error_t gfarm_none_symlink_free(struct db_symlink_arg *arg) { free(arg); return (GFARM_ERR_OPERATION_NOT_SUPPORTED); } static gfarm_error_t gfarm_none_symlink_load( void *closure, void (*callback)(void *, gfarm_ino_t, char *)) { return (GFARM_ERR_OPERATION_NOT_SUPPORTED); } /**********************************************************************/ static gfarm_error_t gfarm_none_xattr_add(struct db_xattr_arg *arg) { free(arg); return (GFARM_ERR_OPERATION_NOT_SUPPORTED); } static gfarm_error_t gfarm_none_xattr_modify(struct db_xattr_arg *arg) { free(arg); return (GFARM_ERR_OPERATION_NOT_SUPPORTED); } static gfarm_error_t gfarm_none_xattr_remove(struct db_xattr_arg *arg) { free(arg); return (GFARM_ERR_OPERATION_NOT_SUPPORTED); } static gfarm_error_t gfarm_none_xattr_get(struct db_xattr_arg *arg) { free(arg); return (GFARM_ERR_OPERATION_NOT_SUPPORTED); } gfarm_error_t gfarm_none_xattr_load(void *closure, void (*callback)(void *, struct xattr_info *)) { return (GFARM_ERR_OPERATION_NOT_SUPPORTED); } static gfarm_error_t gfarm_none_xmlattr_find(struct db_xmlattr_find_arg *arg) { free(arg); return (GFARM_ERR_OPERATION_NOT_SUPPORTED); } /**********************************************************************/ static gfarm_error_t gfarm_none_quota_add(struct db_quota_arg *arg) { free(arg); return (GFARM_ERR_OPERATION_NOT_SUPPORTED); } static gfarm_error_t gfarm_none_quota_modify(struct db_quota_arg *arg) { free(arg); return (GFARM_ERR_OPERATION_NOT_SUPPORTED); } static gfarm_error_t gfarm_none_quota_remove(struct db_quota_remove_arg *arg) { free(arg); return (GFARM_ERR_OPERATION_NOT_SUPPORTED); } static gfarm_error_t gfarm_none_quota_load(void *closure, int is_group, void (*callback)(void *, struct gfarm_quota_info *)) { return (GFARM_ERR_OPERATION_NOT_SUPPORTED); } /**********************************************************************/ const struct db_ops db_none_ops = { gfarm_none_initialize, gfarm_none_terminate, gfarm_none_nop, gfarm_none_nop, gfarm_none_host_add, gfarm_none_host_modify, gfarm_none_host_remove, gfarm_none_host_load, gfarm_none_user_add, gfarm_none_user_modify, gfarm_none_user_remove, gfarm_none_user_load, gfarm_none_group_add, gfarm_none_group_modify, gfarm_none_group_remove, gfarm_none_group_load, gfarm_none_inode_stat_free, gfarm_none_inode_stat_free, gfarm_none_inode_int64_free, gfarm_none_inode_int64_free, gfarm_none_inode_int64_free, gfarm_none_inode_int32_free, gfarm_none_inode_string_free, gfarm_none_inode_string_free, gfarm_none_inode_timespec_free, gfarm_none_inode_timespec_free, gfarm_none_inode_timespec_free, /* inode_remove: never remove any inode to keep inode->i_gen */ gfarm_none_inode_load, /* cksum */ gfarm_none_inode_cksum_free, gfarm_none_inode_cksum_free, gfarm_none_inode_inum_free, gfarm_none_inode_cksum_load, gfarm_none_filecopy_free, gfarm_none_filecopy_free, gfarm_none_filecopy_load, gfarm_none_deadfilecopy_free, gfarm_none_deadfilecopy_free, gfarm_none_deadfilecopy_load, gfarm_none_direntry_add, gfarm_none_direntry_remove, gfarm_none_direntry_load, gfarm_none_symlink_free, gfarm_none_inode_inum_free, gfarm_none_symlink_load, gfarm_none_xattr_add, gfarm_none_xattr_modify, gfarm_none_xattr_remove, NULL, // gfarm_none_xattr_removeall not supported gfarm_none_xattr_get, gfarm_none_xattr_load, gfarm_none_xmlattr_find, gfarm_none_quota_add, gfarm_none_quota_modify, gfarm_none_quota_remove, gfarm_none_quota_load, }; gfarm-2.4.1/server/gfmd/callout.c0000644000000000000000000001541211507222724015347 0ustar rootroot#include #include #include #include #include #include #include #include "gfutil.h" #include "thrsubr.h" #include "subr.h" #include "thrpool.h" struct callout { struct callout *prev, *next; #define CALLOUT_PENDING 1 #define CALLOUT_FIRED 2 #define CALLOUT_INVOKING 4 int state; struct timespec target_time; struct thread_pool *thrpool; void *(*func)(void *); void *closure; }; struct callout_module { pthread_mutex_t mutex; pthread_cond_t have_things_to_run; /* dummy head of doubly linked circular list */ struct callout pendings; } callout_module; static const char module_name[] = "callout_module"; int timespec_cmp(const struct timespec *t1, const struct timespec *t2) { if (t1->tv_sec > t2->tv_sec) return (1); if (t1->tv_sec < t2->tv_sec) return (-1); if (t1->tv_nsec > t2->tv_nsec) return (1); if (t1->tv_nsec < t2->tv_nsec) return (-1); return (0); } void * callout_main(void *arg) { struct callout_module *cm = arg; struct callout *c; struct thread_pool *thrpool; void *(*func)(void *); void *closure; int rv; struct timeval now; struct timespec n; #ifdef __GNUC__ /* shut up stupid warning by gcc */ thrpool = NULL; closure = NULL; #endif for (;;) { gfarm_mutex_lock(&cm->mutex, module_name, "main lock"); c = cm->pendings.next; if (c == &cm->pendings) rv = pthread_cond_wait(&cm->have_things_to_run, &cm->mutex); else rv = pthread_cond_timedwait(&cm->have_things_to_run, &cm->mutex, &c->target_time); if (rv != 0 && rv != ETIMEDOUT) { gflog_fatal(GFARM_MSG_1001490, "s: %s cond wait: %s", module_name, strerror(rv)); } func = NULL; /* cm->pendings may be changed while cond_wait */ c = cm->pendings.next; if (c != &cm->pendings) { gettimeofday(&now, NULL); n.tv_sec = now.tv_sec; n.tv_nsec = now.tv_usec * 1000; if (timespec_cmp(&c->target_time, &n) <= 0) { /* remove the head of the list */ c->prev->next = c->next; c->next->prev = c->prev; /* clear the pointers to be sure */ c->next = c; c->prev = c; c->state &= ~CALLOUT_PENDING; c->state |= (CALLOUT_FIRED | CALLOUT_INVOKING); thrpool = c->thrpool; func = c->func; closure = c->closure; } } gfarm_mutex_unlock(&cm->mutex, module_name, "main lock"); if (func != NULL) thrpool_add_job(thrpool, func, closure); } } /* This function is equivalent to callout_startup(9) */ void callout_module_init(int nthreads) { gfarm_error_t e; struct callout_module *cm = &callout_module; int i; gfarm_mutex_init(&cm->mutex, module_name, "init"); gfarm_cond_init(&cm->have_things_to_run, module_name, "init"); cm->pendings.prev = &cm->pendings; cm->pendings.next = &cm->pendings; for (i = 0; i < nthreads; i++) { e = create_detached_thread(callout_main, &callout_module); if (e != GFARM_ERR_NO_ERROR) gflog_fatal(GFARM_MSG_1001491, "callout_module_init: create_detached_thread: %s", gfarm_error_string(e)); } } /* This function is nearly equivalent to callout_init(9) */ struct callout * callout_new(void) { struct callout *c; GFARM_MALLOC(c); if (c == NULL) return (NULL); c->prev = c; c->next = c; c->state = 0; c->func = NULL; c->closure = NULL; return (c); } /* * This function is equivalent to callout_destroy(9) * * The callout must be stopped before calling this function. */ void callout_free(struct callout *c) { assert((c->state & CALLOUT_PENDING) == 0); free(c); } static void callout_schedule_common(struct callout *n, int microseconds) { struct callout_module *cm = &callout_module; struct callout *c; struct timeval now; /* callout_module.mutex must be already locked here */ gettimeofday(&now, NULL); gfarm_timeval_add_microsec(&now, microseconds); n->target_time.tv_sec = now.tv_sec; n->target_time.tv_nsec = now.tv_usec * 1000LL; n->state &= ~(CALLOUT_FIRED | CALLOUT_INVOKING); if ((n->state & CALLOUT_PENDING) != 0) { /* remove from the pending list */ n->prev->next = n->next; n->next->prev = n->prev; } /* * Since currently all callouts are scheduled with same interval * (i.e. gfarm_metadb_heartbeat_interval), searching from the tail * is most efficient. * XXX If we use another interval for something, this implementation * should be changed to use buckets for efficiency. */ for (c = cm->pendings.prev; c != &cm->pendings; c = c->prev) { if (timespec_cmp(&n->target_time, &c->target_time) >= 0) break; } /* insert n as the successor of c */ n->prev = c; n->next = c->next; c->next->prev = n; c->next = n; n->state |= CALLOUT_PENDING; if (n->prev == &cm->pendings) gfarm_cond_signal(&cm->have_things_to_run, module_name, "scheduling singal"); } void callout_schedule(struct callout *c, int microseconds) { struct callout_module *cm = &callout_module; gfarm_mutex_lock(&cm->mutex, module_name, "schedule lock"); callout_schedule_common(c, microseconds); gfarm_mutex_unlock(&cm->mutex, module_name, "schedule unlock"); } void callout_reset(struct callout *c, int microseconds, struct thread_pool *thrpool, void *(*func)(void *), void *closure) { struct callout_module *cm = &callout_module; gfarm_mutex_lock(&cm->mutex, module_name, "reset lock"); c->thrpool = thrpool; c->func = func; c->closure = closure; callout_schedule_common(c, microseconds); gfarm_mutex_unlock(&cm->mutex, module_name, "reset unlock"); } void callout_setfunc(struct callout *c, struct thread_pool *thrpool, void *(*func)(void *), void *closure) { struct callout_module *cm = &callout_module; gfarm_mutex_lock(&cm->mutex, module_name, "reset lock"); c->thrpool = thrpool; c->func = func; c->closure = closure; gfarm_mutex_unlock(&cm->mutex, module_name, "reset unlock"); } int callout_stop(struct callout *c) { struct callout_module *cm = &callout_module; int expired; gfarm_mutex_lock(&cm->mutex, module_name, "stop lock"); if ((c->state & CALLOUT_PENDING) != 0) { /* remove the head of the list */ c->prev->next = c->next; c->next->prev = c->prev; /* clear the pointers to be sure */ c->next = c; c->prev = c; } expired = (c->state & CALLOUT_FIRED) != 0; c->state &= ~(CALLOUT_PENDING | CALLOUT_FIRED); gfarm_mutex_unlock(&cm->mutex, module_name, "stop unlock"); return (expired); } #ifdef NOT_USED int callout_invoking(struct callout *c) { struct callout_module *cm = &callout_module; int invoking; gfarm_mutex_lock(&cm->mutex, module_name, "invoking lock"); invoking = (c->state & CALLOUT_INVOKING) != 0; gfarm_mutex_unlock(&cm->mutex, module_name, "invoking unlock"); return (invoking); } void callout_ack(struct callout *c) { struct callout_module *cm = &callout_module; gfarm_mutex_lock(&cm->mutex, module_name, "ack lock"); c->state &= ~CALLOUT_INVOKING; gfarm_mutex_unlock(&cm->mutex, module_name, "ack unlock"); } #endif /* NOT_USED */ gfarm-2.4.1/server/gfmd/db_pgsql.h0000644000000000000000000000242711507222724015506 0ustar rootroot /* * This header exports internal interface of db_pgsql module * for a use from a private extension. * * The official gfmd source code shouldn't include this header. */ int32_t pgsql_get_int32(PGresult *, int, const char *); char *pgsql_get_string(PGresult *, int, const char *); gfarm_error_t gfarm_pgsql_check_update_or_delete(PGresult *, const char *, const char *); gfarm_error_t gfarm_pgsql_start_with_retry(const char *); gfarm_error_t gfarm_pgsql_commit(const char *); gfarm_error_t gfarm_pgsql_rollback(const char *); gfarm_error_t gfarm_pgsql_insert_with_retry(const char *, int, const Oid *, const char *const *, const int *, const int *, int, const char *); gfarm_error_t gfarm_pgsql_update_or_delete_with_retry(const char *, int, const Oid *, const char *const *, const int *, const int *, int, const char *); gfarm_error_t gfarm_pgsql_generic_get_all(const char *, int, const char **, int *, void *, const struct gfarm_base_generic_info_ops *, gfarm_error_t (*)(PGresult *, int, void *), const char *); gfarm_error_t gfarm_pgsql_generic_grouping_get_all(const char *, const char *, int, const char **, int *, void *, const struct gfarm_base_generic_info_ops *, gfarm_error_t (*)(PGresult *, int, int, void *), const char *); PGconn *gfarm_pgsql_get_conn(void); gfarm-2.4.1/server/gfmd/inode.h0000644000000000000000000001551211507222724015010 0ustar rootrootvoid inode_init(void); void dir_entry_init(void); void file_copy_init(void); void symlink_init(void); void xattr_init(void); gfarm_uint64_t inode_total_num(void); struct inode; struct host; struct user; struct group; struct process; struct file_copy; struct dead_file_copy; void inode_for_each_file_copies( struct inode *, void (*)(struct inode *, struct file_copy *, void *), void *); void inode_for_each_file_opening( struct inode *, void (*)(int, struct host *, void *), void *); struct host *file_copy_host(struct file_copy *); int file_copy_is_valid(struct file_copy *); int inode_is_dir(struct inode *); int inode_is_file(struct inode *); int inode_is_symlink(struct inode *); gfarm_ino_t inode_get_number(struct inode *); gfarm_int64_t inode_get_gen(struct inode *); gfarm_int64_t inode_get_nlink(struct inode *); struct user *inode_get_user(struct inode *); struct group *inode_get_group(struct inode *); int inode_is_creating_file(struct inode *); gfarm_int64_t inode_get_ncopy(struct inode *); gfarm_int64_t inode_get_ncopy_with_dead_host(struct inode *); gfarm_mode_t inode_get_mode(struct inode *); gfarm_error_t inode_set_mode(struct inode *, gfarm_mode_t); gfarm_off_t inode_get_size(struct inode *); void inode_set_size(struct inode *, gfarm_off_t); gfarm_error_t inode_set_owner(struct inode *, struct user *, struct group *); struct gfarm_timespec *inode_get_atime(struct inode *); struct gfarm_timespec *inode_get_mtime(struct inode *); struct gfarm_timespec *inode_get_ctime(struct inode *); void inode_set_atime(struct inode *, struct gfarm_timespec *); void inode_set_mtime(struct inode *, struct gfarm_timespec *); void inode_set_ctime(struct inode *, struct gfarm_timespec *); void inode_accessed(struct inode *); void inode_modified(struct inode *); void inode_status_changed(struct inode *); char *inode_get_symlink(struct inode *); int inode_desired_dead_file_copy(gfarm_ino_t); struct peer; int inode_new_generation_is_pending(struct inode *); gfarm_error_t inode_new_generation_wait_start(struct inode *, struct peer *); gfarm_error_t inode_new_generation_done(struct inode *, struct peer *, gfarm_int32_t); gfarm_error_t inode_new_generation_wait(struct inode *, struct peer *, gfarm_error_t (*)(struct peer *, void *, int *), void *); gfarm_error_t inode_access(struct inode *, struct user *, int); struct inode *inode_lookup(gfarm_ino_t); void inode_lookup_all(void *, void (*callback)(void *, struct inode *)); gfarm_error_t inode_lookup_root(struct process *, int, struct inode **); gfarm_error_t inode_lookup_parent(struct inode *, struct process *, int, struct inode **); gfarm_error_t inode_lookup_by_name(struct inode *, char *, struct process *, int, struct inode **); gfarm_error_t inode_create_file(struct inode *, char *, struct process *, int, gfarm_mode_t, struct inode **, int *); gfarm_error_t inode_create_dir(struct inode *, char *, struct process *, gfarm_mode_t); gfarm_error_t inode_create_symlink(struct inode *, char *, struct process *, char *); gfarm_error_t inode_create_link(struct inode *, char *, struct process *, struct inode *); gfarm_error_t inode_rename(struct inode *, char *, struct inode *, char *, struct process *); gfarm_error_t inode_unlink(struct inode *, char *, struct process *); void inode_dead_file_copy_added(gfarm_ino_t, gfarm_int64_t, struct host *); gfarm_error_t inode_add_replica(struct inode *, struct host *, int); void inode_remove_replica_completed(gfarm_ino_t, gfarm_int64_t, struct host *); gfarm_error_t inode_remove_replica_metadata(struct inode *, struct host *, gfarm_int64_t); gfarm_error_t inode_remove_replica_gen(struct inode *, struct host *, gfarm_int64_t, int); gfarm_error_t inode_remove_replica(struct inode *, struct host *, int); int inode_file_updated_on(struct inode *, struct host *, struct gfarm_timespec *, struct gfarm_timespec *); int inode_is_updated(struct inode *, struct gfarm_timespec *); struct file_opening; gfarm_error_t inode_open(struct file_opening *); void inode_close(struct file_opening *); void inode_close_read(struct file_opening *, struct gfarm_timespec *); int inode_file_update(struct file_opening *, gfarm_off_t, struct gfarm_timespec *, struct gfarm_timespec *, gfarm_int64_t *, gfarm_int64_t *); gfarm_error_t inode_cksum_set(struct file_opening *, const char *, size_t, const char *, gfarm_int32_t, struct gfarm_timespec *); gfarm_error_t inode_cksum_get(struct file_opening *, char **, size_t *, char **, gfarm_int32_t *); int inode_has_replica(struct inode *, struct host *); gfarm_error_t inode_getdirpath(struct inode *, struct process *, char **); struct host *inode_schedule_host_for_read(struct inode *, struct host *); struct host *inode_schedule_host_for_write(struct inode *, struct host *); struct host *inode_writing_spool_host(struct inode *); int inode_schedule_confirm_for_write(struct file_opening *, struct host *, int *); struct peer; /* this interface is made as a hook for a private extension */ extern gfarm_error_t (*inode_schedule_file)(struct file_opening *, struct peer *, gfarm_int32_t *, struct host ***); struct file_replicating; gfarm_error_t file_replicating_new( struct inode *, struct host *, struct dead_file_copy *, struct file_replicating **); void file_replicating_free(struct file_replicating *); gfarm_int64_t file_replicating_get_gen(struct file_replicating *); gfarm_error_t inode_replicated(struct file_replicating *, gfarm_int32_t, gfarm_int32_t, gfarm_off_t); gfarm_error_t inode_prepare_to_replicate(struct inode *, struct user *, struct host *, struct host *, gfarm_int32_t, struct file_replicating **); gfarm_error_t inode_replica_list_by_name(struct inode *, gfarm_int32_t *, char ***); gfarm_error_t inode_replica_info_get(struct inode *, gfarm_int32_t, gfarm_int32_t *, char ***, gfarm_int64_t **, gfarm_int32_t **); gfarm_error_t inode_xattr_add(struct inode *, int, const char *, void *, size_t); gfarm_error_t inode_xattr_modify(struct inode *, int, const char *, void *, size_t); gfarm_error_t inode_xattr_get_cache(struct inode *, int, const char *, void **, size_t *); int inode_xattr_has_xmlattrs(struct inode *); gfarm_error_t inode_xattr_remove(struct inode *, int, const char *); gfarm_error_t inode_xattr_list(struct inode *, int, char **, size_t *); struct xattr_list { char *name; void *value; size_t size; }; void inode_xattr_list_free(struct xattr_list *, size_t); gfarm_error_t inode_xattr_list_get_cached_by_patterns(gfarm_ino_t, char **, int, struct xattr_list **, size_t *); void inode_init_desired_number(void); int inode_has_desired_number(struct inode *, int *); int inode_traverse_desired_replica_number(struct inode *, int *); /* check and repair */ void inode_nlink_check(void); /* debug */ void dir_dump(gfarm_ino_t); void rootdir_dump(void); /* exported for a use from a private extension */ gfarm_error_t inode_schedule_file_default(struct file_opening *, struct peer *, gfarm_int32_t *, struct host ***); gfarm-2.4.1/server/gfmd/fs.h0000644000000000000000000000770311507222724014325 0ustar rootrootstruct peer; /* gfs from client */ gfarm_error_t gfm_server_compound_begin(struct peer *, int, int, int); gfarm_error_t gfm_server_compound_end(struct peer *, int, int, int); gfarm_error_t gfm_server_compound_on_error(struct peer *, int, int, int, gfarm_error_t *); gfarm_error_t gfm_server_get_fd(struct peer *, int, int); gfarm_error_t gfm_server_put_fd(struct peer *, int, int); gfarm_error_t gfm_server_save_fd(struct peer *, int, int); gfarm_error_t gfm_server_restore_fd(struct peer *, int, int); gfarm_error_t gfm_server_create(struct peer *, int, int); gfarm_error_t gfm_server_open(struct peer *, int, int); gfarm_error_t gfm_server_open_root(struct peer *, int, int); gfarm_error_t gfm_server_open_parent(struct peer *, int, int); gfarm_error_t gfm_server_close(struct peer *, int, int); gfarm_error_t gfm_server_close_read(struct peer *, int, int); gfarm_error_t gfm_server_close_write(struct peer *, int, int); gfarm_error_t gfm_server_close_write_v2_4(struct peer *, int, int, int *); gfarm_error_t gfm_server_generation_updated(struct peer *, int, int); gfarm_error_t gfm_server_verify_type(struct peer *, int, int); gfarm_error_t gfm_server_verify_type_not(struct peer *, int, int); gfarm_error_t gfm_server_fstat(struct peer *, int, int); gfarm_error_t gfm_server_fgetattrplus(struct peer *, int, int); gfarm_error_t gfm_server_futimes(struct peer *, int, int); gfarm_error_t gfm_server_fchmod(struct peer *, int, int); gfarm_error_t gfm_server_fchown(struct peer *, int, int); gfarm_error_t gfm_server_cksum_get(struct peer *, int, int); gfarm_error_t gfm_server_cksum_set(struct peer *, int, int); gfarm_error_t gfm_server_schedule_file(struct peer *, int, int); gfarm_error_t gfm_server_schedule_file_with_program(struct peer *, int, int); gfarm_error_t gfm_server_remove(struct peer *, int, int); gfarm_error_t gfm_server_rmdir(struct peer *, int, int); gfarm_error_t gfm_server_rename(struct peer *, int, int); gfarm_error_t gfm_server_flink(struct peer *, int, int); gfarm_error_t gfm_server_mkdir(struct peer *, int, int); gfarm_error_t gfm_server_symlink(struct peer *, int, int); gfarm_error_t gfm_server_readlink(struct peer *, int, int); gfarm_error_t gfm_server_getdirpath(struct peer *, int, int); gfarm_error_t gfm_server_getdirents(struct peer *, int, int); gfarm_error_t gfm_server_seek(struct peer *, int, int); gfarm_error_t gfm_server_getdirentsplus(struct peer *, int, int); gfarm_error_t gfm_server_getdirentsplusxattr(struct peer *, int, int); /* gfs from gfsd */ gfarm_error_t gfm_server_reopen(struct peer *, int, int, int *); gfarm_error_t gfm_server_lock(struct peer *, int, int); gfarm_error_t gfm_server_trylock(struct peer *, int, int); gfarm_error_t gfm_server_unlock(struct peer *, int, int); gfarm_error_t gfm_server_lock_info(struct peer *, int, int); /* gfs_pio from client */ gfarm_error_t gfm_server_glob(struct peer *, int, int); gfarm_error_t gfm_server_schedule(struct peer *, int, int); gfarm_error_t gfm_server_pio_open(struct peer *, int, int); gfarm_error_t gfm_server_pio_set_paths(struct peer *, int, int); gfarm_error_t gfm_server_pio_close(struct peer *, int, int); gfarm_error_t gfm_server_pio_visit(struct peer *, int, int); /* replica management from client */ gfarm_error_t gfm_server_replica_list_by_name(struct peer *, int, int); gfarm_error_t gfm_server_replica_list_by_host(struct peer *, int, int); gfarm_error_t gfm_server_replica_remove_by_host(struct peer *, int, int); gfarm_error_t gfm_server_replica_remove_by_file(struct peer *, int, int); gfarm_error_t gfm_server_replica_info_get(struct peer *, int, int); gfarm_error_t gfm_server_replicate_file_from_to(struct peer *, int, int); /* replica management from gfsd */ gfarm_error_t gfm_server_replica_adding(struct peer *, int, int, int *); gfarm_error_t gfm_server_replica_added(struct peer *, int, int); gfarm_error_t gfm_server_replica_added2(struct peer *, int, int); gfarm_error_t gfm_server_replica_lost(struct peer *, int, int); gfarm_error_t gfm_server_replica_add(struct peer *, int, int); gfarm-2.4.1/server/gfmd/job.c0000644000000000000000000003231311507222724014455 0ustar rootroot#include #include #include #include #include #include "gfutil.h" #include "gfp_xdr.h" #include "auth.h" #include "gfj_client.h" #include "subr.h" #include "peer.h" #include "job.h" #define gfj_server_get_request gfm_server_get_request #define gfj_server_put_reply gfm_server_put_reply void gfarm_job_info_clear(struct gfarm_job_info *infos, int n) { memset(infos, 0, sizeof(struct gfarm_job_info) * n); } void gfarm_job_info_server_free_contents(struct gfarm_job_info *infos, int n) { int i, j; struct gfarm_job_info *info; for (i = 0; i < n; i++) { info = &infos[i]; /* * DO NOT free info->user on gfmd, * because it is shared with file_table[].user. * * if (info->user != NULL) * free(info->user); */ free(info->job_type); free(info->originate_host); free(info->gfarm_url_for_scheduling); for (j = 0; j < info->argc; j++) free(info->argv[j]); free(info->argv); for (j = 0; j < info->total_nodes; j++) free(info->nodes[j].hostname); free(info->nodes); } } struct job_table_entry { /* linked list of jobs which were registered by same file descriptor */ struct job_table_entry *next; int id; struct gfarm_job_info *info; }; #define JOB_ID_MIN 1 /* we won't use job id 0 */ int job_table_free = JOB_ID_MIN; int job_table_size = 2048; struct job_table_entry **job_table; int job_get_id(struct job_table_entry *job) { return (job->id); } void job_table_init(int table_size) { int i; GFARM_MALLOC_ARRAY(job_table, table_size); if (job_table == NULL) { errno = ENOMEM; gflog_fatal_errno(GFARM_MSG_1000294, "job table"); } for (i = 0; i < table_size; i++) job_table[i] = NULL; job_table_size = table_size; } int job_table_add(struct gfarm_job_info *info, struct job_table_entry **listp) { int id; if (job_table_free >= job_table_size) { for (job_table_free = JOB_ID_MIN; job_table_free < job_table_size; job_table_free++) if (job_table[job_table_free] == NULL) break; if (job_table_free >= job_table_size) return (-1); } id = job_table_free; GFARM_MALLOC(job_table[id]); if (job_table[id] == NULL) { gflog_debug(GFARM_MSG_1001682, "allocation of job_table failed"); return (-1); } job_table[id]->id = id; job_table[id]->info = info; job_table[id]->next = *listp; *listp = job_table[id]; for (++job_table_free; job_table_free < job_table_size; ++job_table_free) if (job_table[job_table_free] == NULL) break; return (id); } int job_table_remove(int id, char *user, struct job_table_entry **listp) { struct job_table_entry **pp = listp; if (id >= job_table_size || job_table[id] == NULL) return (EBADF); if (strcmp(job_table[id]->info->user, user) != 0) return (EPERM); for (; *pp != NULL; pp = &(*pp)->next) if ((*pp)->id == id) break; if (*pp == NULL) /* cannot find the id on the list */ return (EBADF); /* assert(*pp == job_table[id]); */ *pp = job_table[id]->next; gfarm_job_info_server_free_contents(job_table[id]->info, 1); free(job_table[id]); job_table[id] = NULL; return (0); } gfarm_error_t gfj_server_lock_register(struct peer *peer, int from_client, int skip) { gfarm_error_t e = GFARM_ERR_NO_ERROR; static const char diag[] = "GFJ_PROTO_LOCK_REGISTER"; if (!from_client) { gflog_debug(GFARM_MSG_1001683, "lock operation is not permitted for from_client"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } /* XXX - NOT IMPLEMENTED */ return (gfj_server_put_reply(peer, diag, e, "")); } gfarm_error_t gfj_server_unlock_register(struct peer *peer, int from_client, int skip) { gfarm_error_t e = GFARM_ERR_NO_ERROR; static const char diag[] = "GFJ_PROTO_UNLOCK_REGISTER"; if (!from_client) { gflog_debug(GFARM_MSG_1001684, "unlock operation is not permitted for from_client"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } /* XXX - NOT IMPLEMENTED */ return (gfj_server_put_reply(peer, diag, e, "")); } gfarm_error_t gfj_server_register(struct peer *peer, int from_client, int skip) { gfarm_error_t e; struct gfp_xdr *client = peer_get_conn(peer); char *user = peer_get_username(peer); int i, eof; gfarm_int32_t flags, total_nodes, argc, error, job_id = 0; struct gfarm_job_info *info; static const char diag[] = "GFJ_PROTO_REGISTER"; GFARM_MALLOC(info); if (info == NULL) { gflog_debug(GFARM_MSG_1001685, "allocation of gfarm_job_info failed"); return (GFARM_ERR_NO_MEMORY); } gfarm_job_info_clear(info, 1); e = gfj_server_get_request(peer, diag, "iisssi", &flags, &total_nodes, &info->job_type, &info->originate_host, &info->gfarm_url_for_scheduling, &argc); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001686, "gfj_server_get_request() failed"); return (e); } /* XXX - currently `flags' is just igored */ info->total_nodes = total_nodes; info->argc = argc; GFARM_MALLOC_ARRAY(info->argv, argc + 1); GFARM_MALLOC_ARRAY(info->nodes, total_nodes); if (info->argv == NULL || info->nodes == NULL) { gflog_debug(GFARM_MSG_1001687, "allocation of 'info->argv' or 'info->nodes' failed "); free(info->job_type); free(info->originate_host); free(info->gfarm_url_for_scheduling); if (info->argv != NULL) free(info->argv); if (info->nodes != NULL) free(info->nodes); free(info); return (GFARM_ERR_NO_MEMORY); } for (i = 0; i < argc; i++) { e = gfp_xdr_recv(client, 0, &eof, "s", &info->argv[i]); if (e != GFARM_ERR_NO_ERROR || eof) { gflog_debug(GFARM_MSG_1001688, "gfp_xdr_recv(info->argv[i]) failed"); if (e == GFARM_ERR_NO_ERROR) e = GFARM_ERR_PROTOCOL; while (--i >= 0) free(info->argv[i]); free(info->job_type); free(info->originate_host); free(info->gfarm_url_for_scheduling); free(info->argv); free(info->nodes); return (e); } } info->argv[i] = NULL; info->user = user; /* shared with file_table[].user */ for (i = 0; i < total_nodes; i++) { e = gfp_xdr_recv(client, 0, &eof, "s", &info->nodes[i].hostname); if (e != GFARM_ERR_NO_ERROR || eof) { gflog_debug(GFARM_MSG_1001689, "gfp_xdr_recv(hostname) failed"); if (e == GFARM_ERR_NO_ERROR) e = GFARM_ERR_PROTOCOL; while (--i >= 0) free(info->nodes[i].hostname); for (i = 0; i < argc; i++) free(info->argv[i]); free(info->job_type); free(info->originate_host); free(info->gfarm_url_for_scheduling); free(info->argv); free(info->nodes); return (e); } info->nodes[i].pid = 0; info->nodes[i].state = GFJ_NODE_NONE; } if (skip || !from_client) { for (i = 0; i < total_nodes; i++) free(info->nodes[i].hostname); for (i = 0; i < argc; i++) free(info->argv[i]); free(info->job_type); free(info->originate_host); free(info->gfarm_url_for_scheduling); free(info->argv); free(info->nodes); if (skip) return (GFARM_ERR_NO_ERROR); error = GFARM_ERR_OPERATION_NOT_PERMITTED; gflog_debug(GFARM_MSG_1001690, "operation is not permitted for from_client"); } else { giant_lock(); job_id = job_table_add(info, peer_get_jobs_ref(peer)); giant_unlock(); if (job_id < JOB_ID_MIN) { job_id = 0; error = GFARM_ERR_TOO_MANY_JOBS; gflog_debug(GFARM_MSG_1001691, "too many jobs"); } else { error = GFARM_ERR_NO_ERROR; } } return (gfj_server_put_reply(peer, diag, error, "i", job_id)); } gfarm_error_t gfj_server_unregister(struct peer *peer, int from_client, int skip) { char *user = peer_get_username(peer); gfarm_error_t e; gfarm_int32_t error; gfarm_int32_t job_id; static const char diag[] = "GFJ_PROTO_UNREGISTER"; e = gfj_server_get_request(peer, diag, "i", &job_id); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001692, "unregister request failure"); return (e); } if (skip) return (GFARM_ERR_NO_ERROR); if (!from_client) { error = GFARM_ERR_OPERATION_NOT_PERMITTED; gflog_debug(GFARM_MSG_1001693, "operation is not permitted for from_client"); } else { giant_lock(); error = job_table_remove(job_id, user, peer_get_jobs_ref(peer)); giant_unlock(); } return (gfj_server_put_reply(peer, diag, error, "")); } gfarm_error_t gfj_server_register_node(struct peer *peer, int from_client, int skip) { static const char diag[] = "GFJ_PROTO_REGISTER_NODE"; /* XXX - NOT IMPLEMENTED */ gflog_fatal(GFARM_MSG_1000295, "%s: not implemented", diag); return (gfj_server_put_reply(peer, diag, GFARM_ERR_NO_ERROR, "")); } gfarm_error_t gfj_server_list(struct peer *peer, int from_client, int skip) { gfarm_error_t e; struct gfp_xdr *client = peer_get_conn(peer); char *user; int i; gfarm_int32_t n; static const char diag[] = "GFJ_PROTO_LIST"; e = gfj_server_get_request(peer, diag, "s", &user); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001694, "list request failure"); return (e); } if (skip) { free(user); return (GFARM_ERR_NO_ERROR); } if (!from_client) { e = gfj_server_put_reply(peer, diag, GFARM_ERR_OPERATION_NOT_PERMITTED, ""); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001695, "gfj_server_put_reply(list) failed"); return (e); } } else { /* XXX FIXME too long giant lock */ giant_lock(); n = 0; for (i = 0; i < job_table_size; i++) { if (job_table[i] != NULL && (*user == '\0' || strcmp(user, job_table[i]->info->user) == 0)) n++; } e = gfj_server_put_reply(peer, diag, GFARM_ERR_NO_ERROR, "i", n); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001696, "gfj_server_put_reply(register) failed"); giant_unlock(); return (e); } for (i = 0; i < job_table_size; i++) { if (job_table[i] != NULL && (*user == '\0' || strcmp(user, job_table[i]->info->user) == 0)) { e = gfp_xdr_send(client, "i", (gfarm_int32_t)i); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001697, "gfp_xdr_send() failed"); giant_unlock(); return (e); } } } giant_unlock(); } free(user); return (GFARM_ERR_NO_ERROR); } static gfarm_error_t gfj_server_put_info_entry(struct gfp_xdr *client, struct gfarm_job_info *info) { gfarm_error_t e; int i; e = gfp_xdr_send(client, "issssi", info->total_nodes, info->user, info->job_type, info->originate_host, info->gfarm_url_for_scheduling, info->argc); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001698, "gfp_xdr_send() failed"); return (e); } for (i = 0; i < info->argc; i++) { e = gfp_xdr_send(client, "s", info->argv[i]); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001699, "gfp_xdr_send(info->argv[%d]) failed", i); return (e); } } for (i = 0; i < info->total_nodes; i++) { e = gfp_xdr_send(client, "sii", info->nodes[i].hostname, info->nodes[i].pid, info->nodes[i].state); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001700, "gfp_xdr_send(info->nodes[%d]) failed", i); return (e); } } return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfj_server_info(struct peer *peer, int from_client, int skip) { gfarm_error_t e; struct gfp_xdr *client = peer_get_conn(peer); int i, eof; gfarm_int32_t n, *jobs; static const char diag[] = "GFJ_PROTO_INFO"; e = gfj_server_get_request(peer, diag, "i", &n); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001701, "info request failure"); return (e); } GFARM_MALLOC_ARRAY(jobs, n); if (jobs == NULL) { gflog_debug(GFARM_MSG_1001702, "allocation of 'jobs' failed"); return (GFARM_ERR_NO_MEMORY); } for (i = 0; i < n; i++) { e = gfp_xdr_recv(client, 0, &eof, "i", &jobs[i]); if (e != GFARM_ERR_NO_ERROR || eof) { gflog_debug(GFARM_MSG_1001703, "gfp_xdr_recv(jobs[%d]) failed", i); if (e == GFARM_ERR_NO_ERROR) e = GFARM_ERR_PROTOCOL; free(jobs); return (e); } } if (skip || !from_client) { free(jobs); if (skip) return (GFARM_ERR_NO_ERROR); e = gfj_server_put_reply(peer, diag, GFARM_ERR_OPERATION_NOT_PERMITTED, ""); gflog_debug(GFARM_MSG_1001704, "operation is not permitted for from_client"); return (e); } /* XXX FIXME too long giant lock */ giant_lock(); for (i = 0; i < n; i++) { if (jobs[i] < 0 || jobs[i] >= job_table_size || job_table[jobs[i]] == NULL) { e = gfj_server_put_reply(peer, diag, GFARM_ERR_NO_SUCH_OBJECT, ""); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001705, "gfj_server_put_reply(info) failed"); giant_unlock(); free(jobs); return (e); } } else { e = gfj_server_put_reply(peer, diag, GFARM_ERR_NO_ERROR, ""); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001706, "gfj_server_put_reply(info) failed"); free(jobs); giant_unlock(); return (e); } e = gfj_server_put_info_entry(peer_get_conn(peer), job_table[jobs[i]]->info); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001707, "gfj_server_put_info_entry() failed"); free(jobs); giant_unlock(); return (e); } } } free(jobs); giant_unlock(); return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfj_server_hostinfo(struct peer *peer, int from_client, int skip) { gfarm_error_t e = GFARM_ERR_NO_ERROR; static const char diag[] = "GFJ_PROTO_HOSTINFO"; if (!from_client) e = GFARM_ERR_OPERATION_NOT_PERMITTED; /* XXX - NOT IMPLEMENTED */ gflog_fatal(GFARM_MSG_1000296, "%s: not implemented", diag); return (gfj_server_put_reply(peer, diag, GFARM_ERR_NO_ERROR, "")); } gfarm-2.4.1/server/gfmd/quota.h0000644000000000000000000000305411507222724015041 0ustar rootroot/* * $Id: quota.h 4312 2010-01-14 23:26:49Z takuya-i $ */ /* related to struct user and struct group */ struct quota { int on_db; /* 0: not exist on database and disable quota */ gfarm_time_t grace_period; gfarm_off_t space; /* -1: not gfquotacheck yet: disable quota */ gfarm_time_t space_exceed; gfarm_off_t space_soft; gfarm_off_t space_hard; gfarm_uint64_t num; gfarm_time_t num_exceed; gfarm_uint64_t num_soft; gfarm_uint64_t num_hard; gfarm_off_t phy_space; gfarm_time_t phy_space_exceed; gfarm_off_t phy_space_soft; gfarm_off_t phy_space_hard; gfarm_uint64_t phy_num; gfarm_time_t phy_num_exceed; gfarm_uint64_t phy_num_soft; gfarm_uint64_t phy_num_hard; }; void quota_init(); void quota_data_init(struct quota *); struct user; struct group; gfarm_error_t quota_check_limits(struct user *, struct group *, int, int); void quota_user_remove(struct user *); void quota_group_remove(struct group *); struct inode; void quota_update_file_add(struct inode *); void quota_update_file_resize(struct inode *, gfarm_off_t); void quota_update_replica_add(struct inode *); void quota_update_replica_remove(struct inode *); void quota_update_file_remove(struct inode *); struct peer; gfarm_error_t gfm_server_quota_user_get(struct peer *, int, int); gfarm_error_t gfm_server_quota_user_set(struct peer *, int, int); gfarm_error_t gfm_server_quota_group_get(struct peer *, int, int); gfarm_error_t gfm_server_quota_group_set(struct peer *, int, int); gfarm_error_t gfm_server_quota_check(struct peer *, int, int); gfarm-2.4.1/server/gfmd/db_pgsql.c0000644000000000000000000023124011507222724015476 0ustar rootroot/* * Copyright (c) 2003-2006 National Institute of Advanced * Industrial Science and Technology (AIST). All rights reserved. * * Copyright (c) 2006 National Institute of Informatics in Japan, * All rights reserved. * * This file or a portion of this file is licensed under the terms of * the NAREGI Public License, found at * http://www.naregi.org/download/index.html. * If you redistribute this file, with or without modifications, you * must include this notice in the file. */ /* * $Id: db_pgsql.c 5001 2010-12-29 21:08:24Z n-soda $ */ #include #include #include #include #include #include #include #include "gfutil.h" #include "config.h" #include "metadb_common.h" #include "xattr_info.h" #include "quota_info.h" #include "quota.h" #include "db_common.h" #include "db_access.h" #include "db_ops.h" /* ERROR: duplicate key violates unique constraint */ #define GFARM_PGSQL_ERRCODE_UNIQUE_VIOLATION "23505" /* ERROR: invalid XML content */ #define GFARM_PGSQL_ERRCODE_INVALID_XML_CONTENT "2200N" /* * 57P01: FATAL: terminating connection due to administrator command * 57P02: CRASH SHUTDOWN * 57P03: CANNOT CONNECT */ #define GFARM_PGSQL_ERRCODE_SHUTDOWN_PREFIX "57P" /**********************************************************************/ static PGconn *conn = NULL; static int transaction_nesting = 0; static int transaction_ok; static char * gfarm_pgsql_make_conninfo(const char **varnames, char **varvalues, int n, char *others) { int i; size_t length = 0; char *v, *conninfo, *p; /* count necessary string length */ for (i = 0; i < n; i++) { if ((v = varvalues[i]) != NULL) { if (i > 1) length++; /* space */ length += strlen(varnames[i]) + 3; /* var='' */ for (; *v != '\0'; v++) { if (*v == '\'' || *v == '\\') ++length; ++length; } } } if (others != NULL) { if (length > 0) ++length; /* space */ length += strlen(others); } ++length; /* '\0' */ GFARM_MALLOC_ARRAY(conninfo, length); if (conninfo == NULL) { gflog_debug(GFARM_MSG_1002144, "allocation of 'conninfo' failed"); return (NULL); } p = conninfo; for (i = 0; i < n; i++) { if ((v = varvalues[i]) != NULL) { if (i > 1) *p++ = ' '; p += sprintf(p, "%s='", varnames[i]); for (; *v != '\0'; v++) { if (*v == '\'' || *v == '\\') *p++ = '\\'; *p++ = *v; } *p++ = '\''; } } if (others != NULL) { if (p > conninfo) *p++ = ' '; p += sprintf(p, "%s", others); } *p++ = '\0'; return (conninfo); } gfarm_error_t gfarm_pgsql_initialize(void) { int port; static const char *varnames[] = { "host", "port", "dbname", "user", "password" }; char *varvalues[GFARM_ARRAY_LENGTH(varnames)]; char *e, *conninfo; /* * sanity check: * all parameters can be NULL, * in such cases, enviroment variables will be used. */ if (gfarm_postgresql_server_port != NULL) { port = strtol(gfarm_postgresql_server_port, &e, 0); if (e == gfarm_postgresql_server_port || port <= 0 || port >= 65536) { gflog_error(GFARM_MSG_1000421, "gfmd.conf: illegal value in " "postgresql_serverport (%s)", gfarm_postgresql_server_port); return (GFARM_ERR_INVALID_ARGUMENT); } } varvalues[0] = gfarm_postgresql_server_name; varvalues[1] = gfarm_postgresql_server_port; varvalues[2] = gfarm_postgresql_dbname; varvalues[3] = gfarm_postgresql_user; varvalues[4] = gfarm_postgresql_password; conninfo = gfarm_pgsql_make_conninfo( varnames, varvalues, GFARM_ARRAY_LENGTH(varnames), gfarm_postgresql_conninfo); if (conninfo == NULL) { gflog_debug(GFARM_MSG_1002145, "gfarm_pgsql_make_conninfo() failed"); return (GFARM_ERR_NO_MEMORY); } /* * initialize PostgreSQL */ /* open a connection */ conn = PQconnectdb(conninfo); free(conninfo); if (PQstatus(conn) != CONNECTION_OK) { /* PQerrorMessage's return value will be freed in PQfinish() */ gflog_error(GFARM_MSG_1000422, "connecting PostgreSQL: %s", PQerrorMessage(conn)); return (GFARM_ERR_CONNECTION_REFUSED); } return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfarm_pgsql_terminate(void) { /* close and free connection resources */ PQfinish(conn); return (GFARM_ERR_NO_ERROR); } /**********************************************************************/ uint64_t gfarm_hton64(uint64_t h64) { #ifdef WORDS_BIGENDIAN return (h64); /* same order */ #else return (htonl((uint32_t)((h64 >> 32) & 0xffffffff)) | ((uint64_t)htonl((uint32_t)h64 & 0xffffffff) << 32)); #endif } uint64_t gfarm_ntoh64(uint64_t n64) { return (gfarm_hton64(n64)); } static int64_t pgsql_get_int64(PGresult *res, int row, const char *field_name) { uint64_t val; memcpy(&val, PQgetvalue(res, row, PQfnumber(res, field_name)), sizeof(val)); return (gfarm_ntoh64(val)); } /* this interface is exported for a use from a private extension */ int32_t pgsql_get_int32(PGresult *res, int row, const char *field_name) { uint32_t val; memcpy(&val, PQgetvalue(res, row, PQfnumber(res, field_name)), sizeof(val)); return (ntohl(val)); } /* this interface is exported for a use from a private extension */ char * pgsql_get_string(PGresult *res, int row, const char *field_name) { char *v = PQgetvalue(res, row, PQfnumber(res, field_name)); char *s = strdup(v); if (s == NULL) { gflog_error(GFARM_MSG_1002329, "pgsql_get_string(%s): %s: no memory", field_name, v); } return (s); } char * pgsql_get_string_ck(PGresult *res, int row, const char *field_name) { char *v = PQgetvalue(res, row, PQfnumber(res, field_name)); char *s = strdup(v); if (s == NULL) { gflog_fatal(GFARM_MSG_1002371, "pgsql_get_string_ck(%s): %s: no memory", field_name, v); } return (s); } static void * pgsql_get_binary(PGresult *res, int row, const char *field_name, int *size) { int col; void *src; char *dst; col = PQfnumber(res, field_name); if ((*size = PQgetlength(res, row, col)) <= 0) { return NULL; } if ((src = PQgetvalue(res, row, col)) == NULL) { return NULL; } GFARM_MALLOC_ARRAY(dst, *size); if (dst != NULL) memcpy(dst, src, *size); else gflog_error(GFARM_MSG_1002330, "pgsql_get_binary(%s): size=%d: no memory", field_name, (int)*size); return (dst); } /**********************************************************************/ static gfarm_error_t gfarm_pgsql_check_misc(PGresult *res, const char *command, const char *diag) { gfarm_error_t e; if (PQresultStatus(res) == PGRES_COMMAND_OK) { e = GFARM_ERR_NO_ERROR; } else { e = GFARM_ERR_UNKNOWN; gflog_error(GFARM_MSG_1000423, "%s: %s: %s", diag, command, PQresultErrorMessage(res)); } return (e); } static gfarm_error_t gfarm_pgsql_check_select(PGresult *res, const char *command, const char *diag) { gfarm_error_t e; if (PQresultStatus(res) == PGRES_TUPLES_OK) { e = GFARM_ERR_NO_ERROR; } else { e = GFARM_ERR_UNKNOWN; gflog_error(GFARM_MSG_1000424, "%s: %s: %s", diag, command, PQresultErrorMessage(res)); } return (e); } static gfarm_error_t gfarm_pgsql_check_insert(PGresult *res, const char *command, const char *diag) { gfarm_error_t e; if (PQresultStatus(res) == PGRES_COMMAND_OK) { e = GFARM_ERR_NO_ERROR; } else { char *err = PQresultErrorField(res, PG_DIAG_SQLSTATE); if (strcmp(err, GFARM_PGSQL_ERRCODE_UNIQUE_VIOLATION) == 0) { e = GFARM_ERR_ALREADY_EXISTS; } else if (strcmp(err, GFARM_PGSQL_ERRCODE_INVALID_XML_CONTENT) == 0) { e = GFARM_ERR_INVALID_ARGUMENT; } else { e = GFARM_ERR_UNKNOWN; } gflog_error(GFARM_MSG_1000425, "%s: %s: %s", diag, command, PQresultErrorMessage(res)); } return (e); } /* this interface is exported for a use from a private extension */ gfarm_error_t gfarm_pgsql_check_update_or_delete(PGresult *res, const char *command, const char *diag) { gfarm_error_t e; char *pge; if (PQresultStatus(res) != PGRES_COMMAND_OK) { if ((pge = PQresultErrorField(res, PG_DIAG_SQLSTATE))!= NULL && strcmp(pge, GFARM_PGSQL_ERRCODE_INVALID_XML_CONTENT) == 0) e = GFARM_ERR_INVALID_ARGUMENT; else e = GFARM_ERR_UNKNOWN; gflog_error(GFARM_MSG_1000426, "%s: %s: %s", diag, command, PQresultErrorMessage(res)); } else if (strtol(PQcmdTuples(res), NULL, 0) == 0) { e = GFARM_ERR_NO_SUCH_OBJECT; gflog_error(GFARM_MSG_1000427, "%s: %s: %s", diag, command, "no such object"); } else { e = GFARM_ERR_NO_ERROR; } return (e); } static gfarm_error_t gfarm_pgsql_exec_and_log(const char *command, const char *diag) { PGresult *res = PQexec(conn, command); gfarm_error_t e = gfarm_pgsql_check_misc(res, command, diag); PQclear(res); return (e); } static gfarm_error_t gfarm_pgsql_exec_params_and_log(const char *command, int nParams, const Oid *paramTypes, const char *const *paramValues, const int *paramLengths, const int *paramFormats, int resultFormat, const char *diag) { PGresult *res = PQexecParams(conn, command, nParams, paramTypes, paramValues, paramLengths, paramFormats, resultFormat); gfarm_error_t e = gfarm_pgsql_check_misc(res, command, diag); PQclear(res); return (e); } static gfarm_error_t gfarm_pgsql_insert_and_log(const char *command, int nParams, const Oid *paramTypes, const char *const *paramValues, const int *paramLengths, const int *paramFormats, int resultFormat, const char *diag) { PGresult *res = PQexecParams(conn, command, nParams, paramTypes, paramValues, paramLengths, paramFormats, resultFormat); gfarm_error_t e = gfarm_pgsql_check_insert(res, command, diag); PQclear(res); return (e); } #define IS_POWER_OF_2(n) (((n) & (n - 1)) == 0) #define DAY_PER_SECOND (24 * 3600) #define RETRY_INTERVAL 10 #define MSG_THRESHOLD 4096 /* * Return Value: * 1: indicate that caller should retry. * 0: unrecoverable error, caller should end. * Note: * If return value is 1, this function calls PQclear(), * otherwise the caller of this function should call PQclear(). */ static int pgsql_should_retry(PGresult *res) { int retry = 0; if (PQstatus(conn) == CONNECTION_BAD) { gflog_error(GFARM_MSG_1002331, "PostgreSQL connection is down: %s: %s", PQresultErrorField(res, PG_DIAG_SQLSTATE), PQresultErrorMessage(res)); PQclear(res); for (;;) { ++retry; if ((retry >= MSG_THRESHOLD && retry % (DAY_PER_SECOND/RETRY_INTERVAL) == 0) || IS_POWER_OF_2(retry)) { gflog_error(GFARM_MSG_1002332, "PostgreSQL connection retrying"); } PQreset(conn); if (PQstatus(conn) == CONNECTION_OK) break; sleep(RETRY_INTERVAL); } /* XXX FIXME: one transaction may be lost in this case */ gflog_info(GFARM_MSG_1002333, "PostgreSQL connection recovered"); return (1); } else if (PQresultStatus(res) == PGRES_FATAL_ERROR && strncmp(PQresultErrorField(res, PG_DIAG_SQLSTATE), GFARM_PGSQL_ERRCODE_SHUTDOWN_PREFIX, strlen(GFARM_PGSQL_ERRCODE_SHUTDOWN_PREFIX)) == 0) { /* does this code path happen? */ gflog_error(GFARM_MSG_1002334, "PostgreSQL connection problem: %s: %s", PQresultErrorField(res, PG_DIAG_SQLSTATE), PQresultErrorMessage(res)); PQclear(res); return (1); } return (0); /* retry is not necessary */ } static PGresult * gfarm_pgsql_exec_params_with_retry(const char *command, int nParams, const Oid *paramTypes, const char *const *paramValues, const int *paramLengths, const int *paramFormats, int resultFormat) { PGresult *res; do { res = PQexecParams(conn, command, nParams, paramTypes, paramValues, paramLengths, paramFormats, resultFormat); } while (PQresultStatus(res) != PGRES_COMMAND_OK && pgsql_should_retry(res)); return (res); } /* this interface is exported for a use from a private extension */ gfarm_error_t gfarm_pgsql_start_with_retry(const char *diag) { PGresult *res; if (transaction_nesting++ > 0) return (GFARM_ERR_NO_ERROR); transaction_ok = 1; do { res = PQexec(conn, "START TRANSACTION"); } while (PQresultStatus(res) != PGRES_COMMAND_OK && pgsql_should_retry(res)); if (PQresultStatus(res) != PGRES_COMMAND_OK) { gflog_error(GFARM_MSG_1000428, "%s transaction BEGIN: %s", diag, PQresultErrorMessage(res)); PQclear(res); return (GFARM_ERR_UNKNOWN); } PQclear(res); return (GFARM_ERR_NO_ERROR); } /* this interface is exported for a use from a private extension */ gfarm_error_t gfarm_pgsql_commit(const char *diag) { if (--transaction_nesting > 0) return (GFARM_ERR_NO_ERROR); assert(transaction_nesting == 0); return (gfarm_pgsql_exec_and_log(transaction_ok ? "COMMIT" : "ROLLBACK", diag)); } /* this interface is exported for a use from a private extension */ gfarm_error_t gfarm_pgsql_rollback(const char *diag) { transaction_ok = 0; return (gfarm_pgsql_commit(diag)); } /* this interface is exported for a use from a private extension */ gfarm_error_t gfarm_pgsql_insert_with_retry(const char *command, int nParams, const Oid *paramTypes, const char *const *paramValues, const int *paramLengths, const int *paramFormats, int resultFormat, const char *diag) { PGresult *res = gfarm_pgsql_exec_params_with_retry(command, nParams, paramTypes, paramValues, paramLengths, paramFormats, resultFormat); gfarm_error_t e = gfarm_pgsql_check_insert(res, command, diag); PQclear(res); return (e); } /* this interface is exported for a use from a private extension */ gfarm_error_t gfarm_pgsql_update_or_delete_with_retry(const char *command, int nParams, const Oid *paramTypes, const char *const *paramValues, const int *paramLengths, const int *paramFormats, int resultFormat, const char *diag) { PGresult *res = gfarm_pgsql_exec_params_with_retry(command, nParams, paramTypes, paramValues, paramLengths, paramFormats, resultFormat); gfarm_error_t e = gfarm_pgsql_check_update_or_delete(res, command, diag); PQclear(res); return (e); } /* this interface is exported for a use from a private extension */ gfarm_error_t gfarm_pgsql_generic_get_all( const char *sql, int nparams, const char **paramValues, int *np, void *resultsp, const struct gfarm_base_generic_info_ops *ops, gfarm_error_t (*set_fields)(PGresult *, int, void *), const char *diag) { PGresult *res; gfarm_error_t e; int n, i; char *results; do { res = PQexecParams(conn, sql, nparams, NULL, /* param types */ paramValues, NULL, /* param lengths */ NULL, /* param formats */ 1); /* ask for binary results */ } while (PQresultStatus(res) != PGRES_TUPLES_OK && pgsql_should_retry(res)); e = gfarm_pgsql_check_select(res, sql, diag); if (e == GFARM_ERR_NO_ERROR) { n = PQntuples(res); if (n == 0) { gflog_debug(GFARM_MSG_1002147, "select results count : 0"); e = GFARM_ERR_NO_SUCH_OBJECT; } else if ((results = malloc(ops->info_size * n)) == NULL) { gflog_debug(GFARM_MSG_1002148, "allocation of 'results' failed"); e = GFARM_ERR_NO_MEMORY; } else { for (i = 0; i < n; i++) { (*ops->clear)(results + i * ops->info_size); e = (*set_fields)(res, i, results + i * ops->info_size); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1002372, "gfarm_pgsql_generic_get_all: " "%s: %d/%d: %s", sql, i, n, gfarm_error_string(e)); while (--i >= 0) { (*ops->free)(results + i * ops->info_size); } free(results); break; } } if (e == GFARM_ERR_NO_ERROR) { *np = n; *(char **)resultsp = results; } } } PQclear(res); return (e); } /* this interface is exported for a use from a private extension */ gfarm_error_t gfarm_pgsql_generic_grouping_get_all( const char *count_sql, const char *results_sql, int nparams, const char **paramValues, int *np, void *resultsp, const struct gfarm_base_generic_info_ops *ops, gfarm_error_t (*set_fields_with_grouping)(PGresult *, int,int, void *), const char *diag) { PGresult *cres, *rres; gfarm_error_t e; int ngroups; char *results; if ((e = gfarm_pgsql_start_with_retry(diag)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1002149, "pgsql restart failed"); return (e); } cres = PQexecParams(conn, count_sql, nparams, NULL, /* param types */ paramValues, NULL, /* param lengths */ NULL, /* param formats */ 1); /* ask for binary results */ e = gfarm_pgsql_check_select(cres, count_sql, diag); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1002150, "pgsql select failed : count_sql"); } else if ((ngroups = PQntuples(cres)) == 0) { gflog_debug(GFARM_MSG_1002151, "pgsql select results count is 0 : count_sql"); e = GFARM_ERR_NO_SUCH_OBJECT; } else if ((results = malloc(ops->info_size * ngroups)) == NULL) { gflog_debug(GFARM_MSG_1002152, "allocation of 'results' failed"); e = GFARM_ERR_NO_MEMORY; } else { rres = PQexecParams(conn, results_sql, nparams, NULL, /* param types */ paramValues, NULL, /* param lengths */ NULL, /* param formats */ 1); /* ask for binary results */ e = gfarm_pgsql_check_select(rres, results_sql, diag); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1002153, "pgsql select failed :results_sql"); free(results); } else { int i, startrow = 0; for (i = 0; i < ngroups; i++) { int nmembers = pgsql_get_int64(cres, i, "COUNT"); (*ops->clear)(results + i * ops->info_size); e = (*set_fields_with_grouping)( rres, startrow, nmembers, results + i * ops->info_size); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1002154, "set_fields_with_grouping " "failed"); while (--i >= 0) { (*ops->free)(results + i * ops->info_size); } free(results); break; } startrow += (nmembers == 0 ? 1 : nmembers); } if (e == GFARM_ERR_NO_ERROR) { *np = ngroups; *(char **)resultsp = results; } } PQclear(rres); } PQclear(cres); if (e == GFARM_ERR_NO_ERROR) e = gfarm_pgsql_commit(diag); else gfarm_pgsql_rollback(diag); return (e); } /**********************************************************************/ #define COPY_BINARY(data, buf, residual, msg) { \ if (sizeof(data) > residual) \ gflog_fatal(GFARM_MSG_1000429, \ "%s: %d bytes needed, but only %d bytes", \ msg, (int)sizeof(data), residual); \ memcpy(&(data), buf, sizeof(data)); \ buf += sizeof(data); \ residual -= sizeof(data); \ } #define COPY_INT32(int32, buf, residual, msg) { \ assert(sizeof(int32) == sizeof(int32_t)); \ COPY_BINARY(int32, buf, residual, msg); \ int32 = ntohl(int32); \ } /* * struct user::gsi_dn may be loaded by this function, * but currently "COPY User TO STDOUT BINARY" is NOT used for struct user. */ static char * get_string_or_null_from_copy_binary(const char **bufp, int *residualp) { int32_t len; char *p; COPY_INT32(len, *bufp, *residualp, "metdb_pgsql: copy varchar"); if (len == -1) /* NULL field */ return (NULL); if (len < 0) /* We don't allow that long varchar */ gflog_fatal(GFARM_MSG_1000430, "metadb_pgsql: copy varchar length=%d", len); if (len > *residualp) gflog_fatal(GFARM_MSG_1000431, "metadb_pgsql: copy varchar %d > %d", len, *residualp); GFARM_MALLOC_ARRAY(p, len + 1); if (p == NULL) gflog_fatal(GFARM_MSG_1002335, "metadb_pgsql: copy varchar length=%d", len); memcpy(p, *bufp, len); p[len] = '\0'; *bufp += len; *residualp -= len; return (p); } static char * get_string_from_copy_binary(const char **bufp, int *residualp) { char *p = get_string_or_null_from_copy_binary(bufp, residualp); if (p == NULL) gflog_fatal(GFARM_MSG_1002336, "metadb_pgsql: copy varchar: got NULL"); return (p); } static uint32_t get_int32_from_copy_binary(const char **bufp, int *residualp) { int32_t len; uint32_t val; COPY_INT32(len, *bufp, *residualp, "metadb_pgsql: copy int32 len"); if (len == -1) gflog_fatal(GFARM_MSG_1002337, "metadb_pgsql: copy int32: got NULL"); if (len != sizeof(val)) gflog_fatal(GFARM_MSG_1000432, "metadb_pgsql: copy int32 length=%d", len); COPY_INT32(val, *bufp, *residualp, "metadb_pgsql: copy int32"); return (val); } static uint64_t get_int64_from_copy_binary(const char **bufp, int *residualp) { int32_t len; uint64_t val; COPY_INT32(len, *bufp, *residualp, "metadb_pgsql: copy int64 len"); if (len == -1) gflog_fatal(GFARM_MSG_1002338, "metadb_pgsql: copy int64: got NULL"); if (len != sizeof(val)) gflog_fatal(GFARM_MSG_1000433, "metadb_pgsql: copy int64 length=%d", len); COPY_BINARY(val, *bufp, *residualp, "metadb_pgsql: copy int64"); val = gfarm_ntoh64(val); return (val); } #define COPY_BINARY_SIGNATURE_LEN 11 #define COPY_BINARY_FLAGS_FIELD_LEN 4 #define COPY_BINARY_HEADER_EXTENSION_AREA_LEN 4 #define COPY_BINARY_HEADER_LEN (COPY_BINARY_SIGNATURE_LEN + \ COPY_BINARY_FLAGS_FIELD_LEN+COPY_BINARY_HEADER_EXTENSION_AREA_LEN) #define COPY_BINARY_TRAILER_LEN 2 #define PQ_GET_COPY_DATA_DONE -1 #define PQ_GET_COPY_DATA_ERROR -2 #define COPY_BINARY_FLAGS_CRITICAL 0xffff0000 #define COPY_BINARY_TRAILER_VALUE -1 static gfarm_error_t gfarm_pgsql_generic_load( const char *command, void *tmp_info, /* just used as a work area */ void (*callback)(void *, void *), void *closure, const struct gfarm_base_generic_info_ops *base_ops, void (*set_fields_from_copy_binary)(const char *, int, void *), const char *diag) { PGresult *res; char *buf, *bp; int ret; uint32_t header_flags, extension_area_len; int16_t trailer; static const char binary_signature[COPY_BINARY_SIGNATURE_LEN] = "PGCOPY\n\377\r\n\0"; do { res = PQexec(conn, command); } while (PQresultStatus(res) != PGRES_COPY_OUT && pgsql_should_retry(res)); if (PQresultStatus(res) != PGRES_COPY_OUT) { gflog_error(GFARM_MSG_1000434, "%s: %s: %s", diag, command, PQresultErrorMessage(res)); PQclear(res); return (GFARM_ERR_UNKNOWN); } PQclear(res); ret = PQgetCopyData(conn, &buf, 0); if (ret < COPY_BINARY_HEADER_LEN + COPY_BINARY_TRAILER_LEN || memcmp(buf, binary_signature, COPY_BINARY_SIGNATURE_LEN) != 0) { gflog_fatal(GFARM_MSG_1000435, "%s: " "Fatal Error, COPY file signature not recognized: %d", diag, ret); } bp = buf; bp += COPY_BINARY_SIGNATURE_LEN; ret -= COPY_BINARY_SIGNATURE_LEN; COPY_INT32(header_flags, bp, ret, "db_pgsql: COPY header flag"); if (header_flags & COPY_BINARY_FLAGS_CRITICAL) gflog_fatal(GFARM_MSG_1000436, "%s: " "Fatal Error, COPY file protocol incompatible: 0x%08x", diag, header_flags); COPY_INT32(extension_area_len, bp, ret, "db_pgsql: COPY extension area length"); if (ret < extension_area_len) gflog_fatal(GFARM_MSG_1000437, "%s: " "Fatal Error, COPY file extension_area too short: %d < %d", diag, ret, extension_area_len); bp += extension_area_len; ret -= extension_area_len; for (;;) { if (ret < COPY_BINARY_TRAILER_LEN) gflog_fatal(GFARM_MSG_1000438, "%s: " "Fatal error, COPY file trailer too short: %d", diag, ret); /* don't use COPY_BINARY() here to not proceed the pointer */ memcpy(&trailer, bp, sizeof(trailer)); trailer = ntohs(trailer); if (trailer == COPY_BINARY_TRAILER_VALUE) { PQfreemem(buf); /* make sure that the COPY is done */ ret = PQgetCopyData(conn, &buf, 0); if (ret >= 0) gflog_fatal(GFARM_MSG_1000439, "%s: " "Fatal error, COPY file data after trailer" ": %d", diag, ret); break; } (*base_ops->clear)(tmp_info); (*set_fields_from_copy_binary)(bp, ret, tmp_info); if ((*base_ops->validate)(tmp_info)) (*callback)(closure, tmp_info); #if 0 /* the (*callback)() routine frees this memory */ (*base_ops->free)(tmp_info); #endif PQfreemem(buf); ret = PQgetCopyData(conn, &buf, 0); bp = buf; if (ret < 0) { gflog_warning(GFARM_MSG_1000440, "%s: warning: COPY file expected end of data", diag); break; } } if (buf != NULL) gflog_warning(GFARM_MSG_1000441, "%s: warning: COPY file NULL expected, possibly leak?", diag); if (ret == PQ_GET_COPY_DATA_ERROR) { gflog_error(GFARM_MSG_1000442, "%s: data error: %s", diag, PQerrorMessage(conn)); return (GFARM_ERR_UNKNOWN); } res = PQgetResult(conn); if (PQresultStatus(res) != PGRES_COMMAND_OK) { gflog_error(GFARM_MSG_1000443, "%s: failed: %s", diag, PQresultErrorMessage(res)); PQclear(res); return (GFARM_ERR_UNKNOWN); } PQclear(res); return (GFARM_ERR_NO_ERROR); } /**********************************************************************/ static gfarm_error_t gfarm_pgsql_begin(void *arg) { assert(transaction_nesting == 0); return (gfarm_pgsql_start_with_retry("pgsql_begin")); } static gfarm_error_t gfarm_pgsql_end(void *arg) { gfarm_error_t e = gfarm_pgsql_commit( transaction_ok ? "gfarm_pgsql_end(OK)" : "gfarm_pgsql_end(NG)"); assert(transaction_nesting == 0); return (e); } /**********************************************************************/ static gfarm_error_t host_info_set_fields_with_grouping( PGresult *res, int startrow, int nhostaliases, void *vinfo) { struct gfarm_host_info *info = vinfo; int i; info->hostname = pgsql_get_string_ck(res, startrow, "hostname"); info->port = pgsql_get_int32(res, startrow, "port"); info->architecture = pgsql_get_string_ck(res, startrow, "architecture"); info->ncpu = pgsql_get_int32(res, startrow, "ncpu"); info->flags = pgsql_get_int32(res, startrow, "flags"); info->nhostaliases = nhostaliases; GFARM_MALLOC_ARRAY(info->hostaliases, nhostaliases + 1); if (info->hostaliases == NULL) { gflog_fatal(GFARM_MSG_1002373, "host_info_set_fields_with_grouping(%s, %d): no memory", info->hostname, nhostaliases + 1); } for (i = 0; i < nhostaliases; i++) { info->hostaliases[i] = pgsql_get_string_ck(res, startrow + i, "hostalias"); } info->hostaliases[info->nhostaliases] = NULL; return (GFARM_ERR_NO_ERROR); } static gfarm_error_t hostaliases_remove(const char *hostname) { /* * We don't use check_modify_or_remove() but check_misc() here, * because it's OK that there isn't any alias. */ const char *paramValues[1]; paramValues[0] = hostname; return (gfarm_pgsql_exec_params_and_log( "DELETE FROM HostAliases WHERE hostname = $1", 1, /* number of params */ NULL, /* param types */ paramValues, NULL, /* param lengths */ NULL, /* param formats */ 0, /* ask for text results */ "pgsql_hostaliases_remove")); } static gfarm_error_t hostaliases_set(struct gfarm_host_info *info) { const char *paramValues[2]; int i; gfarm_error_t e; if (info->hostaliases == NULL) return (GFARM_ERR_NO_ERROR); for (i = 0; i < info->nhostaliases; i++) { paramValues[0] = info->hostname; paramValues[1] = info->hostaliases[i]; e = gfarm_pgsql_insert_and_log( "INSERT INTO Hostaliases (hostname, hostalias)" " VALUES ($1, $2)", 2, /* number of params */ NULL, /* param types */ paramValues, NULL, /* param lengths */ NULL, /* param formats */ 0, /* ask for text results */ "pgsql_hostaliases_set"); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1002155, "gfarm_pgsql_insert_and_log() failed"); return (e); } } return (GFARM_ERR_NO_ERROR); } static gfarm_error_t pgsql_host_update(struct gfarm_host_info *info, const char *sql, gfarm_error_t (*check)(PGresult *, const char *, const char *), int remove_all_aliases_first, const char *diag) { PGresult *res; const char *paramValues[5]; gfarm_error_t e; char port[GFARM_INT32STRLEN + 1]; char ncpu[GFARM_INT32STRLEN + 1]; char flags[GFARM_INT32STRLEN + 1]; if ((e = gfarm_pgsql_start_with_retry(diag)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1002156, "gfarm_pgsql_start_with_retry() failed"); return (e); } paramValues[0] = info->hostname; sprintf(port, "%d", info->port); paramValues[1] = port; paramValues[2] = info->architecture; sprintf(ncpu, "%d", info->ncpu); paramValues[3] = ncpu; sprintf(flags, "%d", info->flags); paramValues[4] = flags; res = PQexecParams(conn, sql, 5, /* number of params */ NULL, /* param types */ paramValues, NULL, /* param lengths */ NULL, /* param formats */ 0); /* ask for text results */ e = (*check)(res, sql, diag); PQclear(res); if (e == GFARM_ERR_NO_ERROR && remove_all_aliases_first) e = hostaliases_remove(info->hostname); if (e == GFARM_ERR_NO_ERROR) e = hostaliases_set(info); if (e == GFARM_ERR_NO_ERROR) e = gfarm_pgsql_commit(diag); else gfarm_pgsql_rollback(diag); return (e); } static gfarm_error_t gfarm_pgsql_host_add(struct gfarm_host_info *info) { gfarm_error_t e; e = pgsql_host_update(info, "INSERT INTO Host (hostname, port, architecture, ncpu, flags) " "VALUES ($1, $2, $3, $4, $5)", gfarm_pgsql_check_insert, 0, "pgsql_host_add"); free(info); return e; } static gfarm_error_t gfarm_pgsql_host_modify(struct db_host_modify_arg *arg) { gfarm_error_t e; /* XXX FIXME: should use modflags, add_aliases and del_aliases */ e = pgsql_host_update(&arg->hi, "UPDATE Host " "SET port = $2, architecture = $3, ncpu = $4, flags = $5 " "WHERE hostname = $1", gfarm_pgsql_check_update_or_delete, 1, "pgsql_host_modify"); free(arg); return e; } static gfarm_error_t gfarm_pgsql_host_remove(char *hostname) { gfarm_error_t e; const char *paramValues[1]; paramValues[0] = hostname; e = gfarm_pgsql_update_or_delete_with_retry( "DELETE FROM Host WHERE hostname = $1", 1, /* number of params */ NULL, /* param types */ paramValues, NULL, /* param lengths */ NULL, /* param formats */ 0, /* ask for text results */ "pgsql_host_remove"); free(hostname); return e; } static gfarm_error_t gfarm_pgsql_host_load(void *closure, void (*callback)(void *, struct gfarm_host_info *)) { gfarm_error_t e; int i, n; struct gfarm_host_info *infos; e = gfarm_pgsql_generic_grouping_get_all( "SELECT Host.hostname, count(hostalias) " "FROM Host LEFT OUTER JOIN HostAliases " "ON Host.hostname = HostAliases.hostname " "GROUP BY Host.hostname " "ORDER BY Host.hostname", "SELECT Host.hostname, port, architecture, ncpu, flags, " "hostalias " "FROM Host LEFT OUTER JOIN HostAliases " "ON Host.hostname = HostAliases.hostname " "ORDER BY Host.hostname, hostalias", 0, NULL, &n, &infos, &gfarm_base_host_info_ops, host_info_set_fields_with_grouping, "pgsql_host_load"); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1002157, "gfarm_pgsql_generic_grouping_get_all() failed"); return (e); } for (i = 0; i < n; i++) (*callback)(closure, &infos[i]); free(infos); return (GFARM_ERR_NO_ERROR); } /**********************************************************************/ static gfarm_error_t user_info_set_field(PGresult *res, int row, void *vinfo) { struct gfarm_user_info *info = vinfo; info->username = pgsql_get_string_ck(res, row, "username"); info->homedir = pgsql_get_string_ck(res, row, "homedir"); info->realname = pgsql_get_string_ck(res, row, "realname"); info->gsi_dn = pgsql_get_string_ck(res, row, "gsiDN"); return (GFARM_ERR_NO_ERROR); } static gfarm_error_t pgsql_user_call(struct gfarm_user_info *info, const char *sql, gfarm_error_t (*op)(const char *, int, const Oid *, const char *const *, const int *, const int *, int, const char *), const char *diag) { const char *paramValues[4]; paramValues[0] = info->username; paramValues[1] = info->homedir; paramValues[2] = info->realname; paramValues[3] = info->gsi_dn; return (*op)( sql, 4, /* number of params */ NULL, /* param types */ paramValues, NULL, /* param lengths */ NULL, /* param formats */ 0, /* ask for text results */ diag); } static gfarm_error_t gfarm_pgsql_user_add(struct gfarm_user_info *info) { gfarm_error_t e; e = pgsql_user_call(info, "INSERT INTO GfarmUser (username, homedir, realname, gsiDN) " "VALUES ($1, $2, $3, $4)", gfarm_pgsql_insert_with_retry, "pgsql_user_add"); free(info); return e; } static gfarm_error_t gfarm_pgsql_user_modify(struct db_user_modify_arg *arg) { gfarm_error_t e; e = pgsql_user_call(&arg->ui, "UPDATE GfarmUser " "SET homedir = $2, realname = $3, gsiDN = $4 " "WHERE username = $1", gfarm_pgsql_update_or_delete_with_retry, "pgsql_user_modify"); free(arg); return e; } static gfarm_error_t gfarm_pgsql_user_remove(char *username) { gfarm_error_t e; const char *paramValues[1]; paramValues[0] = username; e = gfarm_pgsql_update_or_delete_with_retry( "DELETE FROM GfarmUser WHERE username = $1", 1, /* number of params */ NULL, /* param types */ paramValues, NULL, /* param lengths */ NULL, /* param formats */ 0, /* ask for text results */ "pgsql_user_remove"); free(username); return e; } static gfarm_error_t gfarm_pgsql_user_load(void *closure, void (*callback)(void *, struct gfarm_user_info *)) { gfarm_error_t e; int i, n; struct gfarm_user_info *infos; e = gfarm_pgsql_generic_get_all( "SELECT * FROM GfarmUser", 0, NULL, &n, &infos, &gfarm_base_user_info_ops, user_info_set_field, "pgsql_user_load"); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1002158, "gfarm_pgsql_generic_get_all()"); return (e); } for (i = 0; i < n; i++) (*callback)(closure, &infos[i]); free(infos); return (GFARM_ERR_NO_ERROR); } /**********************************************************************/ static gfarm_error_t group_info_set_fields_with_grouping( PGresult *res, int startrow, int nusers, void *vinfo) { struct gfarm_group_info *info = vinfo; int i; info->groupname = pgsql_get_string_ck(res, startrow, "groupname"); info->nusers = nusers; GFARM_MALLOC_ARRAY(info->usernames, nusers + 1); if (info->usernames == NULL) { gflog_fatal(GFARM_MSG_1002374, "group_info_set_fields_with_grouping(%s, %d): no memory", info->groupname, nusers + 1); } for (i = 0; i < nusers; i++) { info->usernames[i] = pgsql_get_string_ck(res, startrow + i, "username"); } info->usernames[info->nusers] = NULL; return (GFARM_ERR_NO_ERROR); } static gfarm_error_t grpassign_remove(const char *groupname) { /* * We don't use check_modify_or_remove() but check_misc() here, * because it's OK that there isn't any grpassign. */ const char *paramValues[1]; paramValues[0] = groupname; return (gfarm_pgsql_exec_params_and_log( "DELETE FROM GfarmGroupAssignment WHERE groupname = $1", 1, /* number of params */ NULL, /* param types */ paramValues, NULL, /* param lengths */ NULL, /* param formats */ 0, /* ask for text results */ "pgsql_grpassign_remove")); } static gfarm_error_t grpassign_set(struct gfarm_group_info *info) { const char *paramValues[2]; int i; gfarm_error_t e; if (info->usernames == NULL) return (GFARM_ERR_NO_ERROR); for (i = 0; i < info->nusers; i++) { paramValues[0] = info->groupname; paramValues[1] = info->usernames[i]; e = gfarm_pgsql_insert_and_log( "INSERT INTO " "GfarmGroupAssignment (groupname, username) " "VALUES ($1, $2)", 2, /* number of params */ NULL, /* param types */ paramValues, NULL, /* param lengths */ NULL, /* param formats */ 0, /* ask for text results */ "pgsql_grpassign_set"); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1002159, "gfarm_pgsql_insert_and_log() failed"); return (e); } } return (GFARM_ERR_NO_ERROR); } static gfarm_error_t gfarm_pgsql_group_add(struct gfarm_group_info *info) { const char *paramValues[1]; gfarm_error_t e; static const char diag[] = "pgsql_group_add"; if ((e = gfarm_pgsql_start_with_retry(diag)) == GFARM_ERR_NO_ERROR) { paramValues[0] = info->groupname; e = gfarm_pgsql_insert_and_log( "INSERT INTO GfarmGroup (groupname) VALUES ($1)", 1, /* number of params */ NULL, /* param types */ paramValues, NULL, /* param lengths */ NULL, /* param formats */ 0, /* ask for text results */ diag); if (e == GFARM_ERR_NO_ERROR) e = grpassign_set(info); if (e == GFARM_ERR_NO_ERROR) e = gfarm_pgsql_commit(diag); else gfarm_pgsql_rollback(diag); } free(info); return (e); } static gfarm_error_t gfarm_pgsql_group_modify(struct db_group_modify_arg *arg) { struct gfarm_group_info *info = &arg->gi; gfarm_error_t e; static const char diag[] = "gfarm_pgsql_group_modify"; if ((e = gfarm_pgsql_start_with_retry("pgsql_group_modify")) == GFARM_ERR_NO_ERROR) { e = grpassign_remove(info->groupname); if (e == GFARM_ERR_NO_ERROR) e = grpassign_set(info); if (e == GFARM_ERR_NO_ERROR) e = gfarm_pgsql_commit(diag); else gfarm_pgsql_rollback(diag); } free(arg); return (e); } static gfarm_error_t gfarm_pgsql_group_remove(char *groupname) { gfarm_error_t e; const char *paramValues[1]; paramValues[0] = groupname; e = gfarm_pgsql_update_or_delete_with_retry( "DELETE FROM GfarmGroup WHERE groupname = $1", 1, /* number of params */ NULL, /* param types */ paramValues, NULL, /* param lengths */ NULL, /* param formats */ 0, /* ask for text results */ "pgsql_group_remove"); free(groupname); return e; } static gfarm_error_t gfarm_pgsql_group_load(void *closure, void (*callback)(void *, struct gfarm_group_info *)) { gfarm_error_t e; int i, n; struct gfarm_group_info *infos; e = gfarm_pgsql_generic_grouping_get_all( "SELECT GfarmGroup.groupname, count(username) " "FROM GfarmGroup LEFT OUTER JOIN GfarmGroupAssignment " "ON GfarmGroup.groupname = GfarmGroupAssignment.groupname " "GROUP BY GfarmGroup.groupname " "ORDER BY GfarmGroup.groupname", "SELECT GfarmGroup.groupname, username " "FROM GfarmGroup LEFT OUTER JOIN GfarmGroupAssignment " "ON GfarmGroup.groupname = GfarmGroupAssignment.groupname " "ORDER BY GfarmGroup.groupname, username", 0, NULL, &n, &infos, &gfarm_base_group_info_ops, group_info_set_fields_with_grouping, "pgsql_group_load"); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1002160, "gfarm_pgsql_generic_grouping_get_all() failed"); return (e); } for (i = 0; i < n; i++) (*callback)(closure, &infos[i]); free(infos); return (GFARM_ERR_NO_ERROR); } /**********************************************************************/ static gfarm_error_t pgsql_inode_call(struct gfs_stat *info, const char *sql, gfarm_error_t (*op)(const char *, int, const Oid *, const char *const *, const int *, const int *, int, const char *), const char *diag) { gfarm_error_t e; const char *paramValues[13]; char inumber[GFARM_INT64STRLEN + 1]; char igen[GFARM_INT64STRLEN + 1]; char nlink[GFARM_INT64STRLEN + 1]; char size[GFARM_INT64STRLEN + 1]; char mode[GFARM_INT32STRLEN + 1]; char atimesec[GFARM_INT64STRLEN + 1]; char atimensec[GFARM_INT32STRLEN + 1]; char mtimesec[GFARM_INT64STRLEN + 1]; char mtimensec[GFARM_INT32STRLEN + 1]; char ctimesec[GFARM_INT64STRLEN + 1]; char ctimensec[GFARM_INT32STRLEN + 1]; sprintf(inumber, "%" GFARM_PRId64, info->st_ino); paramValues[0] = inumber; sprintf(igen, "%" GFARM_PRId64, info->st_gen); paramValues[1] = igen; sprintf(nlink, "%" GFARM_PRId64, info->st_nlink); paramValues[2] = nlink; sprintf(size, "%" GFARM_PRId64, info->st_size); paramValues[3] = size; sprintf(mode, "%d", info->st_mode); paramValues[4] = mode; paramValues[5] = info->st_user; paramValues[6] = info->st_group; sprintf(atimesec, "%" GFARM_PRId64, info->st_atimespec.tv_sec); paramValues[7] = atimesec; sprintf(atimensec, "%d", info->st_atimespec.tv_nsec); paramValues[8] = atimensec; sprintf(mtimesec, "%" GFARM_PRId64, info->st_mtimespec.tv_sec); paramValues[9] = mtimesec; sprintf(mtimensec, "%d", info->st_mtimespec.tv_nsec); paramValues[10] = mtimensec; sprintf(ctimesec, "%" GFARM_PRId64, info->st_ctimespec.tv_sec); paramValues[11] = ctimesec; sprintf(ctimensec, "%d", info->st_ctimespec.tv_nsec); paramValues[12] = ctimensec; e = (*op)( sql, 13, /* number of params */ NULL, /* param types */ paramValues, NULL, /* param lengths */ NULL, /* param formats */ 0, /* ask for text results */ diag); free(info); return e; } static gfarm_error_t gfarm_pgsql_inode_add(struct gfs_stat *info) { return pgsql_inode_call(info, "INSERT INTO INode (inumber, igen, nlink, size, mode, " "username, groupname, " "atimesec, atimensec, " "mtimesec, mtimensec, " "ctimesec, ctimensec) " "VALUES ($1, $2, $3, $4, $5, " "$6, $7, $8, $9 ,$10, $11, $12, $13)", gfarm_pgsql_insert_with_retry, "pgsql_inode_add"); } static gfarm_error_t gfarm_pgsql_inode_modify(struct gfs_stat *info) { return pgsql_inode_call(info, "UPDATE INode SET igen = $2, nlink = $3, size = $4, " "mode = $5, username = $6, groupname = $7, " "atimesec = $8, atimensec = $9, " "mtimesec = $10, mtimensec = $11, " "ctimesec = $12, ctimensec = $13 " "WHERE inumber = $1", gfarm_pgsql_update_or_delete_with_retry, "pgsql_inode_modify"); } static gfarm_error_t pgsql_inode_uint64_call(struct db_inode_uint64_modify_arg *arg, const char *sql, const char *diag) { gfarm_error_t e; const char *paramValues[2]; char inumber[GFARM_INT64STRLEN + 1]; char uint64[GFARM_INT64STRLEN + 1]; sprintf(inumber, "%" GFARM_PRId64, arg->inum); paramValues[0] = inumber; sprintf(uint64, "%" GFARM_PRId64, arg->uint64); paramValues[1] = uint64; e = gfarm_pgsql_update_or_delete_with_retry( sql, 2, /* number of params */ NULL, /* param types */ paramValues, NULL, /* param lengths */ NULL, /* param formats */ 0, /* ask for text results */ diag); free(arg); return e; } static gfarm_error_t pgsql_inode_uint32_call(struct db_inode_uint32_modify_arg *arg, const char *sql, const char *diag) { gfarm_error_t e; const char *paramValues[2]; char inumber[GFARM_INT64STRLEN + 1]; char uint32[GFARM_INT32STRLEN + 1]; sprintf(inumber, "%" GFARM_PRId64, arg->inum); paramValues[0] = inumber; sprintf(uint32, "%d", arg->uint32); paramValues[1] = uint32; e = gfarm_pgsql_update_or_delete_with_retry( sql, 2, /* number of params */ NULL, /* param types */ paramValues, NULL, /* param lengths */ NULL, /* param formats */ 0, /* ask for text results */ diag); free(arg); return e; } static gfarm_error_t pgsql_inode_string_call(struct db_inode_string_modify_arg *arg, const char *sql, const char *diag) { gfarm_error_t e; const char *paramValues[2]; char inumber[GFARM_INT64STRLEN + 1]; sprintf(inumber, "%" GFARM_PRId64, arg->inum); paramValues[0] = inumber; paramValues[1] = arg->string; e = gfarm_pgsql_update_or_delete_with_retry( sql, 2, /* number of params */ NULL, /* param types */ paramValues, NULL, /* param lengths */ NULL, /* param formats */ 0, /* ask for text results */ diag); free(arg); return e; } static gfarm_error_t pgsql_inode_timespec_call(struct db_inode_timespec_modify_arg *arg, const char *sql, const char *diag) { gfarm_error_t e; const char *paramValues[3]; char inumber[GFARM_INT64STRLEN + 1]; char sec[GFARM_INT64STRLEN + 1]; char nsec[GFARM_INT32STRLEN + 1]; sprintf(inumber, "%" GFARM_PRId64, arg->inum); paramValues[0] = inumber; sprintf(sec, "%" GFARM_PRId64, arg->time.tv_sec); paramValues[1] = sec; sprintf(nsec, "%d", arg->time.tv_nsec); paramValues[2] = nsec; e = gfarm_pgsql_update_or_delete_with_retry( sql, 3, /* number of params */ NULL, /* param types */ paramValues, NULL, /* param lengths */ NULL, /* param formats */ 0, /* ask for text results */ diag); free(arg); return e; } static gfarm_error_t gfarm_pgsql_inode_gen_modify(struct db_inode_uint64_modify_arg *arg) { return pgsql_inode_uint64_call(arg, "UPDATE INode SET igen = $2 WHERE inumber = $1", "pgsql_inode_gen_modify"); } static gfarm_error_t gfarm_pgsql_inode_nlink_modify(struct db_inode_uint64_modify_arg *arg) { return pgsql_inode_uint64_call(arg, "UPDATE INode SET nlink = $2 WHERE inumber = $1", "pgsql_inode_nlink_modify"); } static gfarm_error_t gfarm_pgsql_inode_size_modify(struct db_inode_uint64_modify_arg *arg) { return pgsql_inode_uint64_call(arg, "UPDATE INode SET size = $2 WHERE inumber = $1", "pgsql_inode_size_modify"); } static gfarm_error_t gfarm_pgsql_inode_mode_modify(struct db_inode_uint32_modify_arg *arg) { return pgsql_inode_uint32_call(arg, "UPDATE INode SET mode = $2 WHERE inumber = $1", "pgsql_inode_mode_modify"); } static gfarm_error_t gfarm_pgsql_inode_user_modify(struct db_inode_string_modify_arg *arg) { return pgsql_inode_string_call(arg, "UPDATE INode SET username = $2 WHERE inumber = $1", "pgsql_inode_user_modify"); } static gfarm_error_t gfarm_pgsql_inode_group_modify(struct db_inode_string_modify_arg *arg) { return pgsql_inode_string_call(arg, "UPDATE INode SET groupname = $2 WHERE inumber = $1", "pgsql_inode_group_modify"); } static gfarm_error_t gfarm_pgsql_inode_atime_modify(struct db_inode_timespec_modify_arg *arg) { return pgsql_inode_timespec_call(arg, "UPDATE INode SET atimesec = $2, atimensec = $3 WHERE inumber = $1", "pgsql_inode_atime_modify"); } static gfarm_error_t gfarm_pgsql_inode_mtime_modify(struct db_inode_timespec_modify_arg *arg) { return pgsql_inode_timespec_call(arg, "UPDATE INode SET mtimesec = $2, mtimensec = $3 WHERE inumber = $1", "pgsql_inode_mtime_modify"); } static gfarm_error_t gfarm_pgsql_inode_ctime_modify(struct db_inode_timespec_modify_arg *arg) { return pgsql_inode_timespec_call(arg, "UPDATE INode SET ctimesec = $2, ctimensec = $3 WHERE inumber = $1", "pgsql_inode_ctime_modify"); } static void inode_info_set_fields_from_copy_binary( const char *buf, int residual, void *vinfo) { struct gfs_stat *info = vinfo; uint16_t num_fields; COPY_BINARY(num_fields, buf, residual, "pgsql_inode_load: field number"); num_fields = ntohs(num_fields); if (num_fields < 13) /* allow fields addition in future */ gflog_fatal(GFARM_MSG_1000444, "pgsql_inode_load: fields = %d", num_fields); info->st_ino = get_int64_from_copy_binary(&buf, &residual); info->st_gen = get_int64_from_copy_binary(&buf, &residual); info->st_nlink = get_int64_from_copy_binary(&buf, &residual); info->st_size = get_int64_from_copy_binary(&buf, &residual); info->st_ncopy = 0; info->st_mode = get_int32_from_copy_binary(&buf, &residual); info->st_user = get_string_from_copy_binary(&buf, &residual); info->st_group = get_string_from_copy_binary(&buf, &residual); info->st_atimespec.tv_sec = get_int64_from_copy_binary(&buf, &residual); info->st_atimespec.tv_nsec = get_int32_from_copy_binary(&buf, &residual); info->st_mtimespec.tv_sec = get_int64_from_copy_binary(&buf, &residual); info->st_mtimespec.tv_nsec = get_int32_from_copy_binary(&buf, &residual); info->st_ctimespec.tv_sec = get_int64_from_copy_binary(&buf, &residual); info->st_ctimespec.tv_nsec = get_int32_from_copy_binary(&buf, &residual); } static gfarm_error_t gfarm_pgsql_inode_load( void *closure, void (*callback)(void *, struct gfs_stat *)) { struct gfs_stat tmp_info; return (gfarm_pgsql_generic_load( "COPY INode TO STDOUT BINARY", &tmp_info, (void (*)(void *, void *))callback, closure, &gfarm_base_gfs_stat_ops, inode_info_set_fields_from_copy_binary, "pgsql_inode_load")); } /**********************************************************************/ static gfarm_error_t pgsql_inode_cksum_call(struct db_inode_cksum_arg *arg, const char *sql, gfarm_error_t (*op)(const char *, int, const Oid *, const char *const *, const int *, const int *, int, const char *), const char *diag) { gfarm_error_t e; const char *paramValues[3]; char inumber[GFARM_INT64STRLEN + 1]; sprintf(inumber, "%" GFARM_PRId64, arg->inum); paramValues[0] = inumber; paramValues[1] = arg->type; paramValues[2] = arg->sum; e = (*op)( sql, 3, /* number of params */ NULL, /* param types */ paramValues, NULL, /* param lengths */ NULL, /* param formats */ 0, /* ask for text results */ diag); free(arg); return e; } static gfarm_error_t pgsql_inode_inum_call(struct db_inode_inum_arg *arg, const char *sql, gfarm_error_t (*op)(const char *, int, const Oid *, const char *const *, const int *, const int *, int, const char *), const char *diag) { gfarm_error_t e; const char *paramValues[1]; char inumber[GFARM_INT64STRLEN + 1]; sprintf(inumber, "%" GFARM_PRId64, arg->inum); paramValues[0] = inumber; e = (*op)( sql, 1, /* number of params */ NULL, /* param types */ paramValues, NULL, /* param lengths */ NULL, /* param formats */ 0, /* ask for text results */ diag); free(arg); return e; } static gfarm_error_t gfarm_pgsql_file_info_add(struct db_inode_cksum_arg *arg) { return pgsql_inode_cksum_call(arg, "INSERT INTO FileInfo (inumber, checksumType, checksum) " "VALUES ($1, $2, $3)", gfarm_pgsql_insert_with_retry, "pgsql_cksum_add"); } static gfarm_error_t gfarm_pgsql_file_info_modify(struct db_inode_cksum_arg *arg) { return pgsql_inode_cksum_call(arg, "UPDATE FileInfo SET checksumType = $2, checksum = $3 " "WHERE inumber = $1", gfarm_pgsql_update_or_delete_with_retry, "pgsql_cksum_modify"); } static gfarm_error_t gfarm_pgsql_file_info_remove(struct db_inode_inum_arg *arg) { return pgsql_inode_inum_call(arg, "DELETE FROM FileInfo WHERE inumber = $1", gfarm_pgsql_update_or_delete_with_retry, "pgsql_cksum_remove"); } static void file_info_set_fields_from_copy_binary( const char *buf, int residual, void *vinfo) { struct db_inode_cksum_arg *info = vinfo; uint16_t num_fields; COPY_BINARY(num_fields, buf, residual, "pgsql_file_info_load: field number"); num_fields = ntohs(num_fields); if (num_fields < 3) /* allow fields addition in future */ gflog_fatal(GFARM_MSG_1000445, "pgsql_file_info_load: fields = %d", num_fields); info->inum = get_int64_from_copy_binary(&buf, &residual); info->type = get_string_from_copy_binary(&buf, &residual); info->sum = get_string_from_copy_binary(&buf, &residual); info->len = strlen(info->sum); } static gfarm_error_t gfarm_pgsql_file_info_load( void *closure, void (*callback)(void *, gfarm_ino_t, char *, size_t, char *)) { struct db_inode_cksum_arg tmp_info; struct db_inode_cksum_trampoline_closure c; c.closure = closure; c.callback = callback; return (gfarm_pgsql_generic_load( "COPY FileInfo TO STDOUT BINARY", &tmp_info, db_inode_cksum_callback_trampoline, &c, &db_base_inode_cksum_arg_ops, file_info_set_fields_from_copy_binary, "pgsql_cksum_load")); } /**********************************************************************/ static gfarm_error_t pgsql_filecopy_call(struct db_filecopy_arg *arg, const char *sql, gfarm_error_t (*op)(const char *, int, const Oid *, const char *const *, const int *, const int *, int, const char *), const char *diag) { gfarm_error_t e; const char *paramValues[2]; char inumber[GFARM_INT64STRLEN + 1]; sprintf(inumber, "%" GFARM_PRId64, arg->inum); paramValues[0] = inumber; paramValues[1] = arg->hostname; e = (*op)( sql, 2, /* number of params */ NULL, /* param types */ paramValues, NULL, /* param lengths */ NULL, /* param formats */ 0, /* ask for text results */ diag); free(arg); return e; } static gfarm_error_t gfarm_pgsql_filecopy_add(struct db_filecopy_arg *arg) { return pgsql_filecopy_call(arg, "INSERT INTO FileCopy (inumber, hostname) VALUES ($1, $2)", gfarm_pgsql_insert_with_retry, "pgsql_filecopy_add"); } static gfarm_error_t gfarm_pgsql_filecopy_remove(struct db_filecopy_arg *arg) { return pgsql_filecopy_call(arg, "DELETE FROM FileCopy WHERE inumber = $1 AND hostname = $2", gfarm_pgsql_update_or_delete_with_retry, "pgsql_filecopy_remove"); } static void filecopy_set_fields_from_copy_binary( const char *buf, int residual, void *vinfo) { struct db_filecopy_arg *info = vinfo; uint16_t num_fields; COPY_BINARY(num_fields, buf, residual, "pgsql_filecopy_load: field number"); num_fields = ntohs(num_fields); if (num_fields < 2) /* allow fields addition in future */ gflog_fatal(GFARM_MSG_1000446, "pgsql_filecopy_load: fields = %d", num_fields); info->inum = get_int64_from_copy_binary(&buf, &residual); info->hostname = get_string_from_copy_binary(&buf, &residual); } static gfarm_error_t gfarm_pgsql_filecopy_load( void *closure, void (*callback)(void *, gfarm_ino_t, char *)) { struct db_filecopy_arg tmp_info; struct db_filecopy_trampoline_closure c; c.closure = closure; c.callback = callback; return (gfarm_pgsql_generic_load( "COPY FileCopy TO STDOUT BINARY", &tmp_info, db_filecopy_callback_trampoline, &c, &db_base_filecopy_arg_ops, filecopy_set_fields_from_copy_binary, "pgsql_filecopy_load")); } /**********************************************************************/ static gfarm_error_t pgsql_deadfilecopy_call(struct db_deadfilecopy_arg *arg, const char *sql, gfarm_error_t (*op)(const char *, int, const Oid *, const char *const *, const int *, const int *, int, const char *), const char *diag) { gfarm_error_t e; const char *paramValues[3]; char inumber[GFARM_INT64STRLEN + 1]; char igen[GFARM_INT64STRLEN + 1]; sprintf(inumber, "%" GFARM_PRId64, arg->inum); paramValues[0] = inumber; sprintf(igen, "%" GFARM_PRId64, arg->igen); paramValues[1] = igen; paramValues[2] = arg->hostname; e = (*op)( sql, 3, /* number of params */ NULL, /* param types */ paramValues, NULL, /* param lengths */ NULL, /* param formats */ 0, /* ask for text results */ diag); free(arg); return e; } static gfarm_error_t gfarm_pgsql_deadfilecopy_add(struct db_deadfilecopy_arg *arg) { return pgsql_deadfilecopy_call(arg, "INSERT INTO DeadFileCopy (inumber, igen, hostname) " "VALUES ($1, $2, $3)", gfarm_pgsql_insert_with_retry, "pgsql_deadfilecopy_add"); } static gfarm_error_t gfarm_pgsql_deadfilecopy_remove(struct db_deadfilecopy_arg *arg) { return pgsql_deadfilecopy_call(arg, "DELETE FROM DeadFileCopy " "WHERE inumber = $1 AND igen = $2 AND hostname = $3", gfarm_pgsql_update_or_delete_with_retry, "pgsql_deadfilecopy_remove"); } static void deadfilecopy_set_fields_from_copy_binary( const char *buf, int residual, void *vinfo) { struct db_deadfilecopy_arg *info = vinfo; uint16_t num_fields; COPY_BINARY(num_fields, buf, residual, "pgsql_deadfilecopy_load: field number"); num_fields = ntohs(num_fields); if (num_fields < 3) /* allow fields addition in future */ gflog_fatal(GFARM_MSG_1000447, "pgsql_deadfilecopy_load: fields = %d", num_fields); info->inum = get_int64_from_copy_binary(&buf, &residual); info->igen = get_int64_from_copy_binary(&buf, &residual); info->hostname = get_string_from_copy_binary(&buf, &residual); } static gfarm_error_t gfarm_pgsql_deadfilecopy_load( void *closure, void (*callback)(void *, gfarm_ino_t, gfarm_uint64_t, char *)) { struct db_deadfilecopy_arg tmp_info; struct db_deadfilecopy_trampoline_closure c; c.closure = closure; c.callback = callback; return (gfarm_pgsql_generic_load( "COPY DeadFileCopy TO STDOUT BINARY", &tmp_info, db_deadfilecopy_callback_trampoline, &c, &db_base_deadfilecopy_arg_ops, deadfilecopy_set_fields_from_copy_binary, "pgsql_deadfilecopy_load")); } /**********************************************************************/ static gfarm_error_t gfarm_pgsql_direntry_add(struct db_direntry_arg *arg) { gfarm_error_t e; const char *paramValues[3]; char dir_inumber[GFARM_INT64STRLEN + 1]; char entry_inumber[GFARM_INT64STRLEN + 1]; sprintf(dir_inumber, "%" GFARM_PRId64, arg->dir_inum); paramValues[0] = dir_inumber; paramValues[1] = arg->entry_name; sprintf(entry_inumber, "%" GFARM_PRId64, arg->entry_inum); paramValues[2] = entry_inumber; e = gfarm_pgsql_insert_with_retry( "INSERT INTO DirEntry (dirINumber, entryName, entryINumber) " "VALUES ($1, $2, $3)", 3, /* number of params */ NULL, /* param types */ paramValues, NULL, /* param lengths */ NULL, /* param formats */ 0, /* ask for text results */ "direntry_add"); free(arg); return e; } static gfarm_error_t gfarm_pgsql_direntry_remove(struct db_direntry_arg *arg) { gfarm_error_t e; const char *paramValues[2]; char dir_inumber[GFARM_INT64STRLEN + 1]; sprintf(dir_inumber, "%" GFARM_PRId64, arg->dir_inum); paramValues[0] = dir_inumber; paramValues[1] = arg->entry_name; e = gfarm_pgsql_update_or_delete_with_retry( "DELETE FROM DirEntry " "WHERE dirINumber = $1 AND entryName = $2", 2, /* number of params */ NULL, /* param types */ paramValues, NULL, /* param lengths */ NULL, /* param formats */ 0, /* ask for text results */ "direntry_remove"); free(arg); return e; } static void direntry_set_fields_from_copy_binary( const char *buf, int residual, void *vinfo) { struct db_direntry_arg *info = vinfo; uint16_t num_fields; COPY_BINARY(num_fields, buf, residual, "pgsql_direntry_load: field number"); num_fields = ntohs(num_fields); if (num_fields < 3) /* allow fields addition in future */ gflog_fatal(GFARM_MSG_1000448, "pgsql_direntry_load: fields = %d", num_fields); info->dir_inum = get_int64_from_copy_binary(&buf, &residual); info->entry_name = get_string_from_copy_binary(&buf, &residual); info->entry_len = strlen(info->entry_name); info->entry_inum = get_int64_from_copy_binary(&buf, &residual); } static gfarm_error_t gfarm_pgsql_direntry_load( void *closure, void (*callback)(void *, gfarm_ino_t, char *, int, gfarm_ino_t)) { struct db_direntry_arg tmp_info; struct db_direntry_trampoline_closure c; c.callback = callback; c.closure = closure; return (gfarm_pgsql_generic_load( "COPY DirEntry TO STDOUT BINARY", &tmp_info, db_direntry_callback_trampoline, &c, &db_base_direntry_arg_ops, direntry_set_fields_from_copy_binary, "pgsql_direntry_load")); } /**********************************************************************/ static gfarm_error_t pgsql_symlink_call(struct db_symlink_arg *arg, const char *sql, gfarm_error_t (*op)(const char *, int, const Oid *, const char *const *, const int *, const int *, int, const char *), const char *diag) { gfarm_error_t e; const char *paramValues[2]; char inumber[GFARM_INT64STRLEN + 1]; sprintf(inumber, "%" GFARM_PRId64, arg->inum); paramValues[0] = inumber; paramValues[1] = arg->source_path; e = (*op)( sql, 2, /* number of params */ NULL, /* param types */ paramValues, NULL, /* param lengths */ NULL, /* param formats */ 0, /* ask for text results */ diag); free(arg); return e; } static gfarm_error_t gfarm_pgsql_symlink_add(struct db_symlink_arg *arg) { return pgsql_symlink_call(arg, "INSERT INTO Symlink (inumber, sourcePath) VALUES ($1, $2)", gfarm_pgsql_insert_with_retry, "pgsql_symlink_add"); } static gfarm_error_t gfarm_pgsql_symlink_remove(struct db_inode_inum_arg *arg) { return pgsql_inode_inum_call(arg, "DELETE FROM Symlink WHERE inumber = $1", gfarm_pgsql_update_or_delete_with_retry, "pgsql_symlink_remove"); } static void symlink_set_fields_from_copy_binary( const char *buf, int residual, void *vinfo) { struct db_symlink_arg *info = vinfo; uint16_t num_fields; COPY_BINARY(num_fields, buf, residual, "pgsql_symlink_load: field number"); num_fields = ntohs(num_fields); if (num_fields < 2) /* allow fields addition in future */ gflog_fatal(GFARM_MSG_1000449, "pgsql_symlink_load: fields = %d", num_fields); info->inum = get_int64_from_copy_binary(&buf, &residual); info->source_path = get_string_from_copy_binary(&buf, &residual); } static gfarm_error_t gfarm_pgsql_symlink_load( void *closure, void (*callback)(void *, gfarm_ino_t, char *)) { struct db_symlink_arg tmp_info; struct db_symlink_trampoline_closure c; c.closure = closure; c.callback = callback; return (gfarm_pgsql_generic_load( "COPY Symlink TO STDOUT BINARY", &tmp_info, db_symlink_callback_trampoline, &c, &db_base_symlink_arg_ops, symlink_set_fields_from_copy_binary, "pgsql_symlink_load")); } /**********************************************************************/ static gfarm_error_t gfarm_pgsql_xattr_add(struct db_xattr_arg *arg) { const char *paramValues[3]; int paramLengths[3]; int paramFormats[3]; gfarm_error_t e; char inumber[GFARM_INT64STRLEN + 1]; char *command; char *diag; sprintf(inumber, "%" GFARM_PRId64, arg->inum); paramValues[0] = inumber; paramValues[1] = arg->attrname; paramValues[2] = arg->value; paramLengths[0] = strlen(paramValues[0]); paramLengths[1] = strlen(paramValues[1]); paramLengths[2] = arg->size; paramFormats[0] = 0; paramFormats[1] = 0; if (arg->xmlMode) { command = "INSERT INTO XmlAttr (inumber, attrname, attrvalue) " "VALUES ($1, $2, $3)"; diag = "pgsql_xmlattr_set"; paramFormats[2] = 0; // as text } else { command = "INSERT INTO XAttr (inumber, attrname, attrvalue) " "VALUES ($1, $2, $3)"; diag = "pgsql_xattr_set"; paramFormats[2] = 1; // as binary } e = gfarm_pgsql_insert_and_log( command, 3, /* number of params */ NULL, /* param types */ paramValues, paramLengths, paramFormats, 0, /* ask for text results */ diag); free(arg); return e; } static gfarm_error_t gfarm_pgsql_xattr_modify(struct db_xattr_arg *arg) { const char *paramValues[3]; int paramLengths[3]; int paramFormats[3]; gfarm_error_t e; char inumber[GFARM_INT64STRLEN + 1]; char *command; char *diag; sprintf(inumber, "%" GFARM_PRId64, arg->inum); paramValues[0] = inumber; paramValues[1] = arg->attrname; paramValues[2] = arg->value; paramLengths[0] = strlen(paramValues[0]); paramLengths[1] = strlen(paramValues[1]); paramLengths[2] = arg->size; paramFormats[0] = 0; paramFormats[1] = 0; if (arg->xmlMode) { command = "UPDATE XmlAttr SET attrvalue = $3 " "WHERE inumber = $1 and attrname=$2"; diag = "pgsql_xmlattr_modify"; paramFormats[2] = 0; // as text } else { command = "UPDATE XAttr SET attrvalue = $3 " "WHERE inumber = $1 and attrname=$2"; diag = "pgsql_xattr_modify"; paramFormats[2] = 1; // as binary } e = gfarm_pgsql_update_or_delete_with_retry( command, 3, /* number of params */ NULL, /* param types */ paramValues, paramLengths, paramFormats, 0, /* ask for text results */ diag); free(arg); return e; } static gfarm_error_t gfarm_pgsql_xattr_remove(struct db_xattr_arg *arg) { gfarm_error_t e; const char *paramValues[2]; int paramNum; char inumber[GFARM_INT64STRLEN + 1]; char *diag; char *command; sprintf(inumber, "%" GFARM_PRId64, arg->inum); paramValues[0] = inumber; paramValues[1] = arg->attrname; paramNum = 2; if (arg->xmlMode) { command = "DELETE FROM XmlAttr " "WHERE inumber = $1 AND attrname = $2"; diag = "pgsql_xmlattr_remove"; } else { command = "DELETE FROM XAttr " "WHERE inumber = $1 AND attrname = $2"; diag = "pgsql_xattr_remove"; } e = gfarm_pgsql_update_or_delete_with_retry( command, paramNum, NULL, /* param types */ paramValues, NULL, /* param lengths */ NULL, /* param formats */ 0, /* ask for text results */ diag); free(arg); return e; } static gfarm_error_t gfarm_pgsql_xattr_removeall(struct db_xattr_arg *arg) { gfarm_error_t e; const char *paramValues[1]; char inumber[GFARM_INT64STRLEN + 1]; char *diag; char *command; sprintf(inumber, "%" GFARM_PRId64, arg->inum); paramValues[0] = inumber; if (arg->xmlMode) { command = "DELETE FROM XmlAttr " "WHERE inumber = $1"; diag = "pgsql_xmlattr_removeall"; } else { command = "DELETE FROM XAttr " "WHERE inumber = $1"; diag = "pgsql_xattr_removeall"; } e = gfarm_pgsql_update_or_delete_with_retry( command, 1, NULL, /* param types */ paramValues, NULL, /* param lengths */ NULL, /* param formats */ 0, /* ask for text results */ diag); free(arg); return e; } static gfarm_error_t pgsql_xattr_set_attrvalue_string(PGresult *res, int row, void *vinfo) { struct xattr_info *info = vinfo; info->attrvalue = pgsql_get_string(res, row, "attrvalue"); if (info->attrvalue != NULL) { // include '\0' in attrsize info->attrsize = strlen(info->attrvalue) + 1; return (GFARM_ERR_NO_ERROR); } else { gflog_debug(GFARM_MSG_1002161, "pgsql_get_string() failed"); info->attrsize = 0; return (GFARM_ERR_NO_MEMORY); } } static gfarm_error_t pgsql_xattr_set_attrvalue_binary(PGresult *res, int row, void *vinfo) { struct xattr_info *info = vinfo; info->attrvalue = pgsql_get_binary(res, row, "attrvalue", &info->attrsize); // NOTE: we allow attrsize==0, attrvalue==NULL if ((info->attrsize > 0) && (info->attrvalue == NULL)) { gflog_debug(GFARM_MSG_1002162, "pgsql_get_binary() failed"); return (GFARM_ERR_NO_MEMORY); } else { return (GFARM_ERR_NO_ERROR); } } static gfarm_error_t gfarm_pgsql_xattr_get(struct db_xattr_arg *arg) { gfarm_error_t e; const char *paramValues[2]; char inumber[GFARM_INT64STRLEN + 1]; const char *diag; char *command; int n; struct xattr_info *vinfo; gfarm_error_t (*set_fields)(PGresult *, int, void *); sprintf(inumber, "%" GFARM_PRId64, arg->inum); paramValues[0] = inumber; paramValues[1] = arg->attrname; if (arg->xmlMode) { command = "SELECT attrvalue FROM XmlAttr " "WHERE inumber = $1 AND attrname = $2"; diag = "pgsql_xmlattr_load"; set_fields = pgsql_xattr_set_attrvalue_string; } else { command = "SELECT attrvalue FROM XAttr " "WHERE inumber = $1 AND attrname = $2"; diag = "pgsql_xattr_load"; set_fields = pgsql_xattr_set_attrvalue_binary; } e = gfarm_pgsql_generic_get_all( command, 2, paramValues, &n, &vinfo, &gfarm_base_xattr_info_ops, set_fields, diag); if (e == GFARM_ERR_NO_ERROR) { *arg->sizep = vinfo->attrsize; *arg->valuep = vinfo->attrvalue; free(vinfo); } free(arg); return e; } static gfarm_error_t pgsql_xattr_set_inum_and_attrname(PGresult *res, int row, void *vinfo) { struct xattr_info *info = vinfo; info->inum = pgsql_get_int64(res, row, "inumber"); info->attrname = pgsql_get_string_ck(res, row, "attrname"); info->namelen = strlen(info->attrname) + 1; // include '\0' return (GFARM_ERR_NO_ERROR); } static gfarm_error_t pgsql_xattr_info_set_fields(PGresult *res, int row, void *vinfo) { pgsql_xattr_set_inum_and_attrname(res, row, vinfo); return (pgsql_xattr_set_attrvalue_binary(res, row, vinfo)); } static gfarm_error_t gfarm_pgsql_xattr_load(void *closure, void (*callback)(void *, struct xattr_info *)) { gfarm_error_t e; int xmlMode = (closure != NULL) ? *(int*)closure : 0; char *command, *diag; struct xattr_info *vinfo; int i, n; if (xmlMode) { /* NOTE: if xmlMode, attrvalue is unnecessary to load. */ command = "SELECT inumber,attrname FROM XmlAttr"; diag = "pgsql_xattr_load_xml"; } else { command = "SELECT inumber,attrname,attrvalue FROM XAttr"; diag = "pgsql_xattr_load_norm"; } /* XXX FIXME: should use gfarm_pgsql_generic_load() instead */ e = gfarm_pgsql_generic_get_all( command, 0, NULL, &n, &vinfo, &gfarm_base_xattr_info_ops, xmlMode ? pgsql_xattr_set_inum_and_attrname : pgsql_xattr_info_set_fields, diag); if (e == GFARM_ERR_NO_SUCH_OBJECT) return GFARM_ERR_NO_ERROR; if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1002163, "gfarm_pgsql_generic_get_all() failed"); return e; } for (i = 0; i < n; i++) { (*callback)(&xmlMode, &vinfo[i]); } gfarm_base_generic_info_free_all(n, vinfo, &gfarm_base_xattr_info_ops); return e; } static gfarm_error_t pgsql_xattr_set_attrname(PGresult *res, int row, void *vinfo) { struct xattr_info *info = vinfo; info->attrname = pgsql_get_string(res, row, "attrname"); if (info->attrname == NULL) { /* error is logged in pgsql_get_string() */ info->namelen = 0; return (GFARM_ERR_NO_MEMORY); } else { info->namelen = strlen(info->attrname) + 1; /* include '\0' */ return (GFARM_ERR_NO_ERROR); } } static gfarm_error_t gfarm_pgsql_xmlattr_find(struct db_xmlattr_find_arg *arg) { gfarm_error_t e; const char *paramValues[2]; char inumber[GFARM_INT64STRLEN + 1]; char *diag; char *command; int n = 0; struct xattr_info *vinfo = NULL; sprintf(inumber, "%" GFARM_PRId64, arg->inum); paramValues[0] = inumber; paramValues[1] = arg->expr; /* * xpath($2, attrvalue) returns xml[]. * Array size > 0 if some attrvalue matched XPath expr, 0 if not. */ command = "SELECT attrname FROM XmlAttr " "WHERE inumber = $1 AND array_upper(xpath($2,attrvalue),1) > 0 " "ORDER BY attrname"; diag = "pgsql_xmlattr_find"; e = gfarm_pgsql_generic_get_all( command, 2, paramValues, &n, &vinfo, &gfarm_base_xattr_info_ops, pgsql_xattr_set_attrname, diag); if (e == GFARM_ERR_NO_ERROR) { e = (*(arg->foundcallback))(arg->foundcbdata, n, vinfo); if (n > 0) gfarm_base_generic_info_free_all(n, vinfo, &gfarm_base_xattr_info_ops); } else if (e == GFARM_ERR_NO_SUCH_OBJECT) e = GFARM_ERR_NO_ERROR; free(arg); return (e); } /**********************************************************************/ /* quota */ static gfarm_error_t pgsql_quota_call(struct db_quota_arg *info, const char *sql, gfarm_error_t (*op)(const char *, int, const Oid *, const char *const *, const int *, const int *, int, const char *), const char *diag) { gfarm_error_t e; const char *paramValues[18]; struct quota *q = &info->quota; char grace_period[GFARM_INT64STRLEN + 1]; char space[GFARM_INT64STRLEN + 1]; char space_exceed[GFARM_INT64STRLEN + 1]; char space_soft[GFARM_INT64STRLEN + 1]; char space_hard[GFARM_INT64STRLEN + 1]; char num[GFARM_INT64STRLEN + 1]; char num_exceed[GFARM_INT64STRLEN + 1]; char num_soft[GFARM_INT64STRLEN + 1]; char num_hard[GFARM_INT64STRLEN + 1]; char phy_space[GFARM_INT64STRLEN + 1]; char phy_space_exceed[GFARM_INT64STRLEN + 1]; char phy_space_soft[GFARM_INT64STRLEN + 1]; char phy_space_hard[GFARM_INT64STRLEN + 1]; char phy_num[GFARM_INT64STRLEN + 1]; char phy_num_exceed[GFARM_INT64STRLEN + 1]; char phy_num_soft[GFARM_INT64STRLEN + 1]; char phy_num_hard[GFARM_INT64STRLEN + 1]; sprintf(grace_period, "%" GFARM_PRId64, q->grace_period); sprintf(space, "%" GFARM_PRId64, q->space); sprintf(space_exceed, "%" GFARM_PRId64, q->space_exceed); sprintf(space_soft, "%" GFARM_PRId64, q->space_soft); sprintf(space_hard, "%" GFARM_PRId64, q->space_hard); sprintf(num, "%" GFARM_PRId64, q->num); sprintf(num_exceed, "%" GFARM_PRId64, q->num_exceed); sprintf(num_soft, "%" GFARM_PRId64, q->num_soft); sprintf(num_hard, "%" GFARM_PRId64, q->num_hard); sprintf(phy_space, "%" GFARM_PRId64, q->phy_space); sprintf(phy_space_exceed, "%" GFARM_PRId64, q->phy_space_exceed); sprintf(phy_space_soft, "%" GFARM_PRId64, q->phy_space_soft); sprintf(phy_space_hard, "%" GFARM_PRId64, q->phy_space_hard); sprintf(phy_num, "%" GFARM_PRId64, q->phy_num); sprintf(phy_num_exceed, "%" GFARM_PRId64, q->phy_num_exceed); sprintf(phy_num_soft, "%" GFARM_PRId64, q->phy_num_soft); sprintf(phy_num_hard, "%" GFARM_PRId64, q->phy_num_hard); paramValues[0] = info->name; paramValues[1] = grace_period; paramValues[2] = space; paramValues[3] = space_exceed; paramValues[4] = space_soft; paramValues[5] = space_hard; paramValues[6] = num; paramValues[7] = num_exceed; paramValues[8] = num_soft; paramValues[9] = num_hard; paramValues[10] = phy_space; paramValues[11] = phy_space_exceed; paramValues[12] = phy_space_soft; paramValues[13] = phy_space_hard; paramValues[14] = phy_num; paramValues[15] = phy_num_exceed; paramValues[16] = phy_num_soft; paramValues[17] = phy_num_hard; e = (*op)( sql, 18, /* number of params */ NULL, /* param types */ paramValues, NULL, /* param lengths */ NULL, /* param formats */ 0, /* ask for text results */ diag); free(info); return (e); } static gfarm_error_t gfarm_pgsql_quota_add(struct db_quota_arg *arg) { static char *sql_user = "INSERT INTO QuotaUser" " (username, gracePeriod, " "fileSpace, fileSpaceExceed, fileSpaceSoft, fileSpaceHard, " "fileNum, fileNumExceed, fileNumSoft, fileNumHard, " "phySpace, phySpaceExceed, phySpaceSoft, phySpaceHard, " "phyNum, phyNumExceed, phyNumSoft, phyNumHard) " "VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9 ,$10, " "$11, $12, $13, $14, $15, $16, $17, $18)"; static char *sql_group = "INSERT INTO QuotaGroup" " (groupname, gracePeriod, " "fileSpace, fileSpaceExceed, fileSpaceSoft, fileSpaceHard, " "fileNum, fileNumExceed, fileNumSoft, fileNumHard, " "phySpace, phySpaceExceed, phySpaceSoft, phySpaceHard, " "phyNum, phyNumExceed, phyNumSoft, phyNumHard) " "VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9 ,$10, " "$11, $12, $13, $14, $15, $16, $17, $18)"; char *sql = arg->is_group ? sql_group : sql_user; return (pgsql_quota_call(arg, sql, gfarm_pgsql_insert_with_retry, "pgsql_quota_add")); } static gfarm_error_t gfarm_pgsql_quota_modify(struct db_quota_arg *arg) { static char *sql_user = "UPDATE QuotaUser SET gracePeriod = $2, " "fileSpace = $3, fileSpaceExceed = $4, " "fileSpaceSoft = $5, fileSpaceHard = $6, " "fileNum = $7, fileNumExceed = $8, " "fileNumSoft = $9, fileNumHard = $10, " "phySpace = $11, phySpaceExceed = $12, " "phySpaceSoft = $13, phySpaceHard = $14, " "phyNum = $15, phyNumExceed = $16, " "phyNumSoft = $17, phyNumHard = $18 WHERE username = $1"; static char *sql_group = "UPDATE QuotaGroup SET gracePeriod = $2, " "fileSpace = $3, fileSpaceExceed = $4, " "fileSpaceSoft = $5, fileSpaceHard = $6, " "fileNum = $7, fileNumExceed = $8, " "fileNumSoft = $9, fileNumHard = $10, " "phySpace = $11, phySpaceExceed = $12, " "phySpaceSoft = $13, phySpaceHard = $14, " "phyNum = $15, phyNumExceed = $16, " "phyNumSoft = $17, phyNumHard = $18 WHERE groupname = $1"; char *sql = arg->is_group ? sql_group : sql_user; return (pgsql_quota_call(arg, sql, gfarm_pgsql_update_or_delete_with_retry, "pgsql_quota_modify")); } static gfarm_error_t gfarm_pgsql_quota_remove(struct db_quota_remove_arg *arg) { gfarm_error_t e; const char *paramValues[1]; static char *sql_user = "DELETE FROM QuotaUser WHERE username = $1"; static char *sql_group = "DELETE FROM QuotaGroup WHERE groupname = $1"; char *sql = arg->is_group ? sql_group : sql_user; paramValues[0] = arg->name; e = gfarm_pgsql_update_or_delete_with_retry( sql, 1, /* number of params */ NULL, /* param types */ paramValues, NULL, /* param lengths */ NULL, /* param formats */ 0, /* ask for text results */ "pgsql_quota_remove"); free(arg); return (e); } static void quota_info_set_fields_from_copy_binary( const char *buf, int residual, void *vinfo) { struct gfarm_quota_info *info = vinfo; uint16_t num_fields; COPY_BINARY(num_fields, buf, residual, "pgsql_quota_load: field number"); num_fields = ntohs(num_fields); if (num_fields < 18) /* allow fields addition in future */ gflog_fatal(GFARM_MSG_1000450, "pgsql_quota_load: fields = %d", num_fields); info->name = get_string_from_copy_binary(&buf, &residual); info->grace_period = get_int64_from_copy_binary(&buf, &residual); info->space = get_int64_from_copy_binary(&buf, &residual); info->space_exceed = get_int64_from_copy_binary(&buf, &residual); info->space_soft = get_int64_from_copy_binary(&buf, &residual); info->space_hard = get_int64_from_copy_binary(&buf, &residual); info->num = get_int64_from_copy_binary(&buf, &residual); info->num_exceed = get_int64_from_copy_binary(&buf, &residual); info->num_soft = get_int64_from_copy_binary(&buf, &residual); info->num_hard = get_int64_from_copy_binary(&buf, &residual); info->phy_space = get_int64_from_copy_binary(&buf, &residual); info->phy_space_exceed = get_int64_from_copy_binary( &buf, &residual); info->phy_space_soft = get_int64_from_copy_binary( &buf, &residual); info->phy_space_hard = get_int64_from_copy_binary( &buf, &residual); info->phy_num = get_int64_from_copy_binary(&buf, &residual); info->phy_num_exceed = get_int64_from_copy_binary( &buf, &residual); info->phy_num_soft = get_int64_from_copy_binary(&buf, &residual); info->phy_num_hard = get_int64_from_copy_binary(&buf, &residual); } static gfarm_error_t gfarm_pgsql_quota_load(void *closure, int is_group, void (*callback)(void *, struct gfarm_quota_info *)) { struct gfarm_quota_info tmp_info; const char *command = (is_group ? "COPY QuotaGroup TO STDOUT BINARY" : "COPY QuotaUser TO STDOUT BINARY"); return (gfarm_pgsql_generic_load( command, &tmp_info, (void (*)(void *, void *))callback, closure, &gfarm_base_quota_info_ops, quota_info_set_fields_from_copy_binary, "pgsql_quota_load")); } /* DO NOT REMOVE: this interfaces is provided for a private extension */ /* The official gfmd source code shouldn't use these interface */ PGconn * gfarm_pgsql_get_conn(void) { return (conn); } /**********************************************************************/ const struct db_ops db_pgsql_ops = { gfarm_pgsql_initialize, gfarm_pgsql_terminate, gfarm_pgsql_begin, gfarm_pgsql_end, gfarm_pgsql_host_add, gfarm_pgsql_host_modify, gfarm_pgsql_host_remove, gfarm_pgsql_host_load, gfarm_pgsql_user_add, gfarm_pgsql_user_modify, gfarm_pgsql_user_remove, gfarm_pgsql_user_load, gfarm_pgsql_group_add, gfarm_pgsql_group_modify, gfarm_pgsql_group_remove, gfarm_pgsql_group_load, gfarm_pgsql_inode_add, gfarm_pgsql_inode_modify, gfarm_pgsql_inode_gen_modify, gfarm_pgsql_inode_nlink_modify, gfarm_pgsql_inode_size_modify, gfarm_pgsql_inode_mode_modify, gfarm_pgsql_inode_user_modify, gfarm_pgsql_inode_group_modify, gfarm_pgsql_inode_atime_modify, gfarm_pgsql_inode_mtime_modify, gfarm_pgsql_inode_ctime_modify, /* inode_remove: never remove any inode to keep inode->i_gen */ gfarm_pgsql_inode_load, /* cksum */ gfarm_pgsql_file_info_add, gfarm_pgsql_file_info_modify, gfarm_pgsql_file_info_remove, gfarm_pgsql_file_info_load, gfarm_pgsql_filecopy_add, gfarm_pgsql_filecopy_remove, gfarm_pgsql_filecopy_load, gfarm_pgsql_deadfilecopy_add, gfarm_pgsql_deadfilecopy_remove, gfarm_pgsql_deadfilecopy_load, gfarm_pgsql_direntry_add, gfarm_pgsql_direntry_remove, gfarm_pgsql_direntry_load, gfarm_pgsql_symlink_add, gfarm_pgsql_symlink_remove, gfarm_pgsql_symlink_load, gfarm_pgsql_xattr_add, gfarm_pgsql_xattr_modify, gfarm_pgsql_xattr_remove, gfarm_pgsql_xattr_removeall, gfarm_pgsql_xattr_get, gfarm_pgsql_xattr_load, gfarm_pgsql_xmlattr_find, gfarm_pgsql_quota_add, gfarm_pgsql_quota_modify, gfarm_pgsql_quota_remove, gfarm_pgsql_quota_load, }; gfarm-2.4.1/server/gfmd/dir.c0000644000000000000000000002450411507222724014464 0ustar rootroot#include #include #include #include #include #include #include /* gfarm_off_t */ #include "dir.h" #if USE_HASH /********************************************************************** * hash table version **********************************************************************/ #define DIR_HASH_SIZE 53 /* prime */ Dir dir_alloc(void) { return (gfarm_hash_table_alloc( DIR_HASH_SIZE, gfarm_hash_default, gfarm_hash_key_equal_default)); } void dir_free(Dir dir) { gfarm_hash_table_free(dir); } #if 0 /* need to check "." and ".." */ int dir_is_empty(Dir dir) { DirCursor cursor; gfarm_hash_iterator_begin(dir, &cursor); return (gfarm_hash_iterator_is_end(&cursor)); } #endif DirEntry dir_enter(Dir dir, const char *name, int namelen, int *createdp) { struct inode **eipp; int created; DirEntry entry = gfarm_hash_enter(dir, name, namelen, sizeof(*eipp), &created); if (entry == NULL) return (NULL); /* for assertion in dir_entry_set_inode() */ if (created) { eipp = gfarm_hash_entry_data(entry); *eipp = NULL; } if (createdp != NULL) *createdp = created; return (entry); } DirEntry dir_lookup(Dir dir, const char *name, int namelen) { return (gfarm_hash_lookup(dir, name, namelen)); } int dir_remove_entry(Dir dir, const char *name, int namelen) { return (gfarm_hash_purge(dir, name, namelen)); } void dir_entry_set_inode(DirEntry entry, struct inode *inode) { struct inode **eipp = gfarm_hash_entry_data(entry); assert(*eipp == NULL); /* We don't allow to overwrite existing one */ *eipp = inode; } struct inode * dir_entry_get_inode(DirEntry entry) { struct inode **eipp = gfarm_hash_entry_data(entry); assert(*eipp != NULL); return (*eipp); } char * dir_entry_get_name(DirEntry entry, int *namelenp) { *namelenp = gfarm_hash_entry_key_length(entry); return (gfarm_hash_entry_key(entry)); } int dir_cursor_lookup(Dir dir, const char *name, int namelen, DirCursor *cursor) { return (gfarm_hash_iterator_lookup(dir, name, namelen, cursor)); } int dir_cursor_next(Dir dir, DirCursor *cursor) { if (gfarm_hash_iterator_is_end(cursor)) return (0); /* end of directory */ gfarm_hash_iterator_next(cursor); return (gfarm_hash_iterator_is_end(cursor)); } /* this is stupidly slow */ int dir_cursor_set_pos(Dir dir, gfarm_off_t offset, DirCursor *cursor) { gfarm_off_t i; gfarm_hash_iterator_begin(dir, cursor); for (i = 0; i < offset; i++) { if (gfarm_hash_iterator_is_end(cursor)) return (0); /* failed */ gfarm_hash_iterator_next(cursor); } return (1); /* ok */ } /* this is stupidly slow */ gfarm_off_t dir_cursor_get_pos(Dir dir, DirCursor *cursor) { DirEntry entry = dir_cursor_get_entry(dir, cursor); gfarm_off_t i; gfarm_hash_iterator_begin(dir, cursor); for (i = 0; !gfarm_hash_iterator_is_end(cursor); i++) { if (gfarm_hash_iterator_access(cursor) == entry) break; gfarm_hash_iterator_next(cursor); } return (i); } DirEntry dir_cursor_get_entry(Dir dir, DirCursor *cursor) { return (gfarm_hash_iterator_access(cursor)); } /* * this is stupidly slow, * because currently gfarm_hash doesn't maintain number of entries. */ gfarm_off_t dir_get_entry_count(Dir dir) { DirCursor cursor; gfarm_off_t i; gfarm_hash_iterator_begin(dir, &cursor); for (i = 0; !gfarm_hash_iterator_is_end(&cursor); i++) { gfarm_hash_iterator_next(&cursor); } return (i); } #else /* ! USE_HASH */ /********************************************************************** * red-black tree version * * (functions which have rbdir_ prefix are private.) **********************************************************************/ #include /* this must be #defined before #include "tree.h" */ #define RB_AUGMENT(entry) rbdir_augment(entry) #include "tree.h" struct rbdir_entry { RB_ENTRY(rbdir_entry) node; int keylen; char *key; gfarm_off_t nentries; struct inode *inode; }; RB_HEAD(rbdir, rbdir_entry); int rbdir_compare(DirEntry a, DirEntry b) { int len = a->keylen < b->keylen ? a->keylen : b->keylen; int cmp; cmp = memcmp(a->key, b->key, len); if (cmp != 0 || a->keylen == b->keylen) return (cmp); if (a->keylen < b->keylen) return (-1); else return (1); } int rbdir_node_count(DirEntry entry) { gfarm_off_t lc, rc; lc = RB_LEFT (entry, node) == NULL ? 0 : RB_LEFT (entry, node)->nentries; rc = RB_RIGHT(entry, node) == NULL ? 0 : RB_RIGHT(entry, node)->nentries; return (lc + rc + 1); } void rbdir_augment(DirEntry entry) { entry->nentries = rbdir_node_count(entry); } RB_PROTOTYPE(rbdir, rbdir_entry, node, rbdir_compare) RB_GENERATE(rbdir, rbdir_entry, node, rbdir_compare) DirEntry rbdir_entry_prev(DirEntry entry) { if (RB_LEFT(entry, node) != NULL) { entry = RB_LEFT(entry, node); while (RB_RIGHT(entry, node)) entry = RB_RIGHT(entry, node); } else if (RB_PARENT(entry, node) != NULL && entry == RB_RIGHT(RB_PARENT(entry, node), node)) { entry = RB_PARENT(entry, node); } else { while (RB_PARENT(entry, node) != NULL && entry == RB_LEFT(RB_PARENT(entry, node), node)) entry = RB_PARENT(entry, node); entry = RB_PARENT(entry, node); } return (entry); } void rbdir_fixup(DirEntry entry) { do { rbdir_augment(entry); } while ((entry = RB_PARENT(entry, node)) != NULL); } void rbdir_entry_free(struct rbdir_entry *entry) { free(entry->key); free(entry); } int rbdir_entry_delete(Dir dir, DirEntry entry) { DirEntry deleted; DirEntry parent = RB_PARENT(entry, node); DirEntry prev = rbdir_entry_prev(entry); deleted = RB_REMOVE(rbdir, dir, entry); if (prev != NULL) rbdir_fixup(prev); if (parent != NULL) rbdir_fixup(parent); if (deleted != NULL) { rbdir_entry_free(deleted); return (1); } return (0); } Dir dir_alloc(void) { Dir dir; GFARM_MALLOC(dir); if (dir == NULL) { gflog_debug(GFARM_MSG_1001708, "allocation of 'Dir' failed"); return (NULL); } RB_INIT(dir); return (dir); } void dir_free(Dir dir) { DirEntry entry; while ((entry = RB_MIN(rbdir, dir)) != NULL) rbdir_entry_delete(dir, entry); free(dir); } #if 0 /* need to check "." and ".." */ int dir_is_empty(Dir dir) { return (RB_ROOT(dir) == NULL); } #endif gfarm_off_t dir_get_entry_count(Dir dir) { DirEntry root = RB_ROOT(dir); if (root == NULL) return (0); return (root->nentries); } DirEntry dir_enter(Dir dir, const char *name, int namelen, int *createdp) { DirEntry entry; DirEntry found; DirEntry prev; GFARM_MALLOC(entry); if (entry == NULL) { gflog_debug(GFARM_MSG_1001709, "allocation of 'DirEntry' failed"); return (NULL); /* no memory */ } entry->keylen = namelen; GFARM_MALLOC_ARRAY(entry->key, namelen); if (entry->key == NULL) { free(entry); gflog_debug(GFARM_MSG_1001710, "allocation of 'DirEntry.key' failed"); return (NULL); /* no memory */ } memcpy(entry->key, name, namelen); entry->nentries = 1; /* leaf */ found = RB_INSERT(rbdir, dir, entry); if (found != NULL) { rbdir_entry_free(entry); *createdp = 0; return (found); } rbdir_fixup(entry); prev = rbdir_entry_prev(entry); if (prev != NULL) rbdir_fixup(prev); /* for assertion in dir_entry_set_inode() */ entry->inode = NULL; if (createdp != NULL) *createdp = 1; return (entry); } DirEntry dir_lookup(Dir dir, const char *name, int namelen) { struct rbdir_entry entry; entry.keylen = namelen; entry.key = (char *)name; return (RB_FIND(rbdir, dir, &entry)); } int dir_remove_entry(Dir dir, const char *name, int namelen) { DirEntry entry; entry = dir_lookup(dir, name, namelen); if (entry == NULL) return (0); rbdir_entry_delete(dir, entry); return (1); } void dir_entry_set_inode(DirEntry entry, struct inode *inode) { /* We don't allow to overwrite existing one */ assert(entry->inode == NULL); entry->inode = inode; } struct inode * dir_entry_get_inode(DirEntry entry) { assert(entry->inode != NULL); return (entry->inode); } char * dir_entry_get_name(DirEntry entry, int *namelenp) { *namelenp = entry->keylen; return (entry->key); } int dir_cursor_lookup(Dir dir, const char *name, int namelen, DirCursor *cursor) { DirEntry entry = dir_lookup(dir, name, namelen); if (entry != NULL) { *cursor = entry; return (1); } return (0); } int dir_cursor_next(Dir dir, DirCursor *cursor) { if (*cursor == NULL) return (0); /* end of directory */ *cursor = RB_NEXT(rbdir, dir, *cursor); if (*cursor == NULL) return (0); /* end of directory */ return (1); /* ok */ } int dir_cursor_set_pos(Dir dir, gfarm_off_t nth, DirCursor *cursor) { DirEntry entry = RB_ROOT(dir); gfarm_off_t index; while (entry != NULL) { index = RB_LEFT(entry, node) == NULL ? 0 : RB_LEFT(entry, node)->nentries; if (index == nth) { *cursor = entry; return (1); /* ok */ } else if (nth < index) { entry = RB_LEFT(entry, node); } else { /* nth > index */ nth -= index + 1; entry = RB_RIGHT(entry, node); } } return (0); /* failed */ } gfarm_off_t dir_cursor_get_pos(Dir dir, DirCursor *cursor) { DirEntry key = *cursor; DirEntry entry = RB_ROOT(dir); int cmp; gfarm_off_t delta, index = 0; if (key == NULL) /* i.e. end of directory */ return (dir_get_entry_count(dir)); while (entry != NULL) { cmp = rbdir_compare(key, entry); if (cmp < 0) { entry = RB_LEFT(entry, node); continue; } delta = RB_LEFT(entry, node) == NULL ? 0 : RB_LEFT(entry, node)->nentries; index += delta; if (cmp == 0) break; index++; /* cmp > 0 */ entry = RB_RIGHT(entry, node); } return (index); } DirEntry dir_cursor_get_entry(Dir dir, DirCursor *cursor) { return (*cursor); } #endif /* ! USE_HASH */ /* utility routine */ /* * RETURN VALUE: * (*namep): entry name, must be freed by the caller. * (*inodep): entry inode * NOTE: both (*namep) and (*inodep) becomes NULL at the end of directory. */ gfarm_error_t dir_cursor_get_name_and_inode(Dir dir, DirCursor *cursorp, char **namep, struct inode **inodep) { DirEntry entry = dir_cursor_get_entry(dir, cursorp); char *name, *newname; int namelen; if (entry == NULL) { *namep = NULL; *inodep = NULL; return (GFARM_ERR_NO_ERROR); } name = dir_entry_get_name(entry, &namelen); GFARM_MALLOC_ARRAY(newname, namelen + 1); if (newname == NULL) { gflog_debug(GFARM_MSG_1001711, "allocation of array 'newname' failed"); return (GFARM_ERR_NO_MEMORY); } memcpy(newname, name, namelen); newname[namelen] = '\0'; *namep = newname; *inodep = dir_entry_get_inode(entry); return (GFARM_ERR_NO_ERROR); } gfarm-2.4.1/server/gfmd/xattr.c0000644000000000000000000007152111507222724015051 0ustar rootroot/* * Copyright (c) 2009 National Institute of Informatics in Japan. * All rights reserved. */ #include #include #include #include #include #include #include #include /* fd_set for "filetab.h" */ #include #include "gfutil.h" #include "hash.h" #include "thrsubr.h" #include "config.h" /* gfarm_metadb_admin_user */ #include "auth.h" #include "gfp_xdr.h" #include "xattr_info.h" #include "subr.h" #include "db_access.h" #include "peer.h" #include "inode.h" #include "process.h" #include "metadb_common.h" #include "dir.h" #define MAX_XATTR_NAME_LEN 256 static int isvalid_attrname(const char *attrname) { int namelen = strlen(attrname); return ((0 < namelen) && (namelen <= MAX_XATTR_NAME_LEN)); } static gfarm_error_t setxattr(int xmlMode, struct inode *inode, char *attrname, void *value, size_t size, int flags, struct db_waitctx *waitctx, int *addattr) { gfarm_error_t e; *addattr = 0; if (!isvalid_attrname(attrname)) { gflog_debug(GFARM_MSG_1002066, "argument 'attrname' is invalid"); return GFARM_ERR_INVALID_ARGUMENT; } if ((flags & (GFS_XATTR_CREATE|GFS_XATTR_REPLACE)) == (GFS_XATTR_CREATE|GFS_XATTR_REPLACE)) { gflog_debug(GFARM_MSG_1002067, "argument 'flags' is invalid"); return GFARM_ERR_INVALID_ARGUMENT; } if (flags & GFS_XATTR_REPLACE) { e = inode_xattr_modify(inode, xmlMode, attrname, value, size); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1002068, "inode_xattr_modefy(%s): %s", attrname, gfarm_error_string(e)); return (e); } } else { e = inode_xattr_add(inode, xmlMode, attrname, value, size); if (e == GFARM_ERR_NO_ERROR) *addattr = 1; else if (e == GFARM_ERR_ALREADY_EXISTS && (flags & GFS_XATTR_CREATE) == 0) e = inode_xattr_modify(inode, xmlMode, attrname, value, size); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1002069, "inode_xattr_add() failed:%s", gfarm_error_string(e)); return (e); } } if (*addattr) { e = db_xattr_add(xmlMode, inode_get_number(inode), attrname, value, size, waitctx); } else e = db_xattr_modify(xmlMode, inode_get_number(inode), attrname, value, size, waitctx); return e; } gfarm_error_t gfm_server_setxattr(struct peer *peer, int from_client, int skip, int xmlMode) { gfarm_error_t e; const char *diag = xmlMode ? "GFM_PROTO_XMLATTR_SET" : "GFM_PROTO_XATTR_SET"; char *attrname = NULL; size_t size; char *value = NULL; int flags; struct process *process; gfarm_int32_t fd; struct inode *inode; struct db_waitctx ctx, *waitctx; int addattr; e = gfm_server_get_request(peer, diag, "sBi", &attrname, &size, &value, &flags); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1002070, "gfm_server_get_request() failure:%s", gfarm_error_string(e)); return (e); } if (skip) { free(attrname); return (GFARM_ERR_NO_ERROR); } if (xmlMode) { waitctx = &ctx; #ifdef ENABLE_XMLATTR if (value[size-1] != '\0') { e = GFARM_ERR_INVALID_ARGUMENT; gflog_debug(GFARM_MSG_1002071, "argument 'xmlMode' is invalid"); goto quit; } #else e = GFARM_ERR_OPERATION_NOT_SUPPORTED; gflog_debug(GFARM_MSG_1002072, "operation is not supported(xmlMode)"); goto quit; #endif } else waitctx = NULL; db_waitctx_init(waitctx); giant_lock(); if ((process = peer_get_process(peer)) == NULL) { gflog_debug(GFARM_MSG_1002073, "peer_get_process() failed"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if ((e = peer_fdpair_get_current(peer, &fd)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1002074, "peer_fdpair_get_current() failed: %s", gfarm_error_string(e)); } else if ((e = process_get_file_inode(process, fd, &inode)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1002075, "process_get_file_inode() failed: %s", gfarm_error_string(e)); } else if ((e = inode_access(inode, process_get_user(process), GFS_W_OK)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1002076, "inode_access() failed: %s", gfarm_error_string(e)); } else e = setxattr(xmlMode, inode, attrname, value, size, flags, waitctx, &addattr); giant_unlock(); if (e == GFARM_ERR_NO_ERROR) { e = dbq_waitret(waitctx); if (e == GFARM_ERR_NO_ERROR) { giant_lock(); inode_status_changed(inode); giant_unlock(); } else if (addattr) { giant_lock(); inode_xattr_remove(inode, xmlMode, attrname); giant_unlock(); } } db_waitctx_fini(waitctx); quit: free(value); free(attrname); return (gfm_server_put_reply(peer, diag, e, "")); } gfarm_error_t gfm_server_getxattr(struct peer *peer, int from_client, int skip, int xmlMode) { gfarm_error_t e; const char *diag = xmlMode ? "GFM_PROTO_XMLATTR_GET" : "GFM_PROTO_XATTR_GET"; char *attrname = NULL; size_t size = 0; void *value = NULL; struct process *process; gfarm_int32_t fd; struct inode *inode; int waitctx_initialized = 0, cached = 0; struct db_waitctx waitctx; e = gfm_server_get_request(peer, diag, "s", &attrname); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1002079, "%s request failed: %s", diag, gfarm_error_string(e)); return (e); } if (skip) { free(attrname); return (GFARM_ERR_NO_ERROR); } #ifndef ENABLE_XMLATTR if (xmlMode) { gflog_debug(GFARM_MSG_1002080, "operation is not supported(xmlMode)"); free(attrname); e = GFARM_ERR_OPERATION_NOT_SUPPORTED; return (gfm_server_put_reply(peer, diag, e, "")); } #endif giant_lock(); if ((process = peer_get_process(peer)) == NULL) { e = GFARM_ERR_OPERATION_NOT_PERMITTED; gflog_debug(GFARM_MSG_1002081, "peer_get_process() failed: %s", gfarm_error_string(e)); } else if ((e = peer_fdpair_get_current(peer, &fd)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1002082, "peer_fdpair_get_current() failed: %s", gfarm_error_string(e)); } else if ((e = process_get_file_inode(process, fd, &inode)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1002083, "process_get_file_inode() failed: %s", gfarm_error_string(e)); } else if ((e = inode_access(inode, process_get_user(process), GFS_R_OK)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1002084, "inode_access() failed: %s", gfarm_error_string(e)); } else if (!isvalid_attrname(attrname)) { e = GFARM_ERR_INVALID_ARGUMENT; gflog_debug(GFARM_MSG_1002077, "argument 'attrname' is invalid"); } else if ((e = inode_xattr_get_cache(inode, xmlMode, attrname, &value, &size)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1002510, "getxattr(%s): %s", attrname, gfarm_error_string(e)); } else if (value == NULL) { /* not cached */ db_waitctx_init(&waitctx); waitctx_initialized = 1; e = db_xattr_get(xmlMode, inode_get_number(inode), attrname, &value, &size, &waitctx); } else cached = 1; giant_unlock(); if (e == GFARM_ERR_NO_ERROR && !cached) e = dbq_waitret(&waitctx); if (waitctx_initialized) db_waitctx_fini(&waitctx); e = gfm_server_put_reply(peer, diag, e, "b", size, value); free(attrname); if (value != NULL) free(value); return (e); } gfarm_error_t gfm_server_listxattr(struct peer *peer, int from_client, int skip, int xmlMode) { gfarm_error_t e; const char *diag = xmlMode ? "GFM_PROTO_XMLATTR_LIST" : "GFM_PROTO_XATTR_LIST"; size_t size; char *value = NULL; struct process *process; gfarm_int32_t fd; struct inode *inode; if (skip) return (GFARM_ERR_NO_ERROR); #ifndef ENABLE_XMLATTR if (xmlMode) return gfm_server_put_reply(peer, diag, GFARM_ERR_OPERATION_NOT_SUPPORTED, ""); #endif giant_lock(); if ((process = peer_get_process(peer)) == NULL) { e = GFARM_ERR_OPERATION_NOT_PERMITTED; gflog_debug(GFARM_MSG_1002085, "peer_get_process() failed: %s", gfarm_error_string(e)); } else if ((e = peer_fdpair_get_current(peer, &fd)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1002086, "peer_fdpair_get_current() failed: %s", gfarm_error_string(e)); } else if ((e = process_get_file_inode(process, fd, &inode)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1002087, "process_get_file_inode() failed: %s", gfarm_error_string(e)); } else if ((e = inode_access(inode, process_get_user(process), GFS_R_OK)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1002088, "inode_access() failed: %s", gfarm_error_string(e)); } else { // NOTE: inode_xattrname_list() doesn't access to DB. e = inode_xattr_list(inode, xmlMode, &value, &size); } giant_unlock(); e = gfm_server_put_reply(peer, diag, e, "b", size, value); free(value); return e; } static gfarm_error_t removexattr(int xmlMode, struct inode *inode, char *attrname) { gfarm_error_t e; if (isvalid_attrname(attrname)) { e = inode_xattr_remove(inode, xmlMode, attrname); if (e == GFARM_ERR_NO_ERROR) { db_xattr_remove(xmlMode, inode_get_number(inode), attrname); inode_status_changed(inode); } } else { gflog_debug(GFARM_MSG_1002089, "argument 'attrname' is invalid"); e = GFARM_ERR_INVALID_ARGUMENT; } return e; } gfarm_error_t gfm_server_removexattr(struct peer *peer, int from_client, int skip, int xmlMode) { gfarm_error_t e; const char *diag = xmlMode ? "GFM_PROTO_XMLATTR_REMOVE" : "GFM_PROTO_XATTR_REMOVE"; char *attrname = NULL; struct process *process; gfarm_int32_t fd; struct inode *inode; e = gfm_server_get_request(peer, diag, "s", &attrname); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1002090, "%s request failure", diag); return (e); } if (skip) { free(attrname); return (GFARM_ERR_NO_ERROR); } #ifndef ENABLE_XMLATTR if (xmlMode) { gflog_debug(GFARM_MSG_1002091, "operation is not supported(xmlMode)"); free(attrname); e = GFARM_ERR_OPERATION_NOT_SUPPORTED; return (gfm_server_put_reply(peer, diag, e, "")); } #endif giant_lock(); if ((process = peer_get_process(peer)) == NULL) { e = GFARM_ERR_OPERATION_NOT_PERMITTED; gflog_debug(GFARM_MSG_1002092, "peer_get_process() failed :%s", gfarm_error_string(e)); } else if ((e = peer_fdpair_get_current(peer, &fd)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1002093, "peer_fdpair_get_current() failed: %s", gfarm_error_string(e)); } else if ((e = process_get_file_inode(process, fd, &inode)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1002094, "process_get_file_inode() failed: %s", gfarm_error_string(e)); } else if ((e = inode_access(inode, process_get_user(process), GFS_W_OK)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1002095, "inode_access() failed: %s", gfarm_error_string(e)); } else e = removexattr(xmlMode, inode, attrname); giant_unlock(); free(attrname); return (gfm_server_put_reply(peer, diag, e, "")); } #ifdef ENABLE_XMLATTR /* * These parameters must be smaller than DBQ_SIZE * in db_access.c to avoid dbq_enter() waiting. */ #define DEFAULT_INUM_PATH_ARRAY_SIZE 100 #define MINIMUM_DBQ_FREE_NUM 100 /* * We use -1 as unset errno because gfarm_errno_t>=0, * to distinguish whether db access is completed. */ #define UNSET_GFARM_ERRNO (-1) #define IS_UNSET_ERRNO(errno) ((errno) < 0) struct inum_path_array; struct inum_path_entry { struct inum_path_array *array; gfarm_ino_t inum; char *path; gfarm_error_t dberr; int nattrs; char **attrnames; }; struct inum_path_array { // for DB waiting pthread_mutex_t lock; pthread_cond_t cond; char *expr; // target XPath // for cookie_path int check_ckpath; int check_ckname; int ckpathdepth; char *restartpath; // "dir1/dir2" etc char *ckpath; // "dir1\0dir2" etc char **ckpathnames; // for found path and attrnames int nentry; int nattrssum; int isfilled; struct inum_path_entry entries[DEFAULT_INUM_PATH_ARRAY_SIZE]; // for reply int replyentidx; int replynameidx; int nreplied; }; static const char inum_path_array_diag[] = "inum_path_array"; static void inum_path_entry_init(struct inum_path_array *array, struct inum_path_entry *entry) { entry->array = array; entry->dberr = UNSET_GFARM_ERRNO; } static void inum_path_entry_fini(struct inum_path_entry *entry) { int i; free(entry->path); for (i = 0; i < entry->nattrs; i++) free(entry->attrnames[i]); free(entry->attrnames); } static void inum_path_array_init(struct inum_path_array *array, char *expr) { int i; static const char diag[] = "inum_path_array_init"; memset(array, 0, sizeof(*array)); gfarm_mutex_init(&array->lock, diag, inum_path_array_diag); gfarm_cond_init(&array->cond, diag, inum_path_array_diag); for (i = 0; i < GFARM_ARRAY_LENGTH(array->entries); i++) inum_path_entry_init(array, &array->entries[i]); array->expr = expr; } static struct inum_path_array * inum_path_array_alloc(char *expr) { struct inum_path_array *array = GFARM_MALLOC(array); if (array != NULL) inum_path_array_init(array, expr); else gflog_debug(GFARM_MSG_1002096, "allocation of 'inum_path_array' failed"); return array; } static void inum_path_array_fini(struct inum_path_array *array) { int i; static const char diag[] = "inum_path_array_fini"; for (i = 0; i < array->nentry; i++) { inum_path_entry_fini(&array->entries[i]); } free(array->restartpath); free(array->ckpath); free(array->ckpathnames); gfarm_cond_destroy(&array->cond, diag, inum_path_array_diag); gfarm_mutex_destroy(&array->lock, diag, inum_path_array_diag); } static void inum_path_array_free(struct inum_path_array *array) { if (array != NULL) { inum_path_array_fini(array); free(array); } } static void inum_path_array_reinit(struct inum_path_array *array, char *expr) { if (array != NULL) { inum_path_array_fini(array); inum_path_array_init(array, expr); } } static struct inum_path_entry * inum_path_array_addpath(struct inum_path_array *array, gfarm_ino_t inum, char *path) { int n = GFARM_ARRAY_LENGTH(array->entries); if (array->nentry < n) { array->entries[array->nentry].inum = inum; array->entries[array->nentry].path = path; array->nentry++; if (array->nentry == n) array->isfilled = 1; return &array->entries[array->nentry - 1]; } else return NULL; } void db_findxmlattr_done(gfarm_error_t e, void *en) { struct inum_path_entry *entry = (struct inum_path_entry *)en; struct inum_path_array *array = entry->array; static const char diag[] = "db_findxmlattr_done"; gfarm_mutex_lock(&array->lock, diag, inum_path_array_diag); entry->dberr = e; gfarm_cond_signal(&array->cond, diag, inum_path_array_diag); gfarm_mutex_unlock(&array->lock, diag, inum_path_array_diag); } gfarm_error_t inum_path_array_add_attrnames(void *en, int nfound, void *in) { struct inum_path_entry *entry = (struct inum_path_entry *)en; struct inum_path_array *array = entry->array; struct xattr_info *vinfo = (struct xattr_info *)in; int i; static const char diag[] = "inum_path_array_add_attrnames"; if (nfound <= 0) return GFARM_ERR_NO_ERROR; GFARM_MALLOC_ARRAY(entry->attrnames, nfound); if (entry->attrnames == NULL) { gflog_debug(GFARM_MSG_1002097, "allocation of 'attrnames' failed"); return GFARM_ERR_NO_MEMORY; } gfarm_mutex_lock(&array->lock, diag, inum_path_array_diag); entry->nattrs = nfound; for (i = 0; i < nfound; i++) { entry->attrnames[i] = vinfo[i].attrname; vinfo[i].attrname = NULL; // to avoid free by caller vinfo[i].namelen = 0; } array->nattrssum += nfound; gfarm_mutex_unlock(&array->lock, diag, inum_path_array_diag); return GFARM_ERR_NO_ERROR; } static gfarm_error_t findxmlattr_dbq_enter(struct inum_path_array *array, struct inum_path_entry *entry) { gfarm_error_t e; int dbbusy = 0; if (db_getfreenum() > MINIMUM_DBQ_FREE_NUM) { e = db_xmlattr_find(entry->inum, array->expr, inum_path_array_add_attrnames, entry, db_findxmlattr_done, entry); } else { array->isfilled = 1; dbbusy = 1; e = (array->nentry > 1) ? GFARM_ERR_NO_ERROR : GFARM_ERR_RESOURCE_TEMPORARILY_UNAVAILABLE; } if ((e != GFARM_ERR_NO_ERROR) || dbbusy) { gflog_debug(GFARM_MSG_1002098, "error occurred during process:%s", gfarm_error_string(e)); free(entry->path); entry->path = NULL; array->nentry--; } return e; } static gfarm_error_t inum_path_array_add(struct inum_path_array *array, gfarm_ino_t inum, char *path) { struct inum_path_entry *entry; entry = inum_path_array_addpath(array, inum, path); if (entry != NULL) { gflog_debug(GFARM_MSG_1002099, "inum_path_array_addpath() failed"); return findxmlattr_dbq_enter(array, entry); } else { free(path); // path array is enough isfilled. return GFARM_ERR_NO_SPACE; } } static int is_dot_dir(char *name, int namelen) { if (name[0] == '.') { if (namelen == 1) return 1; if ((name[1] == '.') && (namelen == 2)) return 1; } return 0; } static gfarm_error_t findxmlattr_set_restart_path(struct inum_path_array *array, char *path) { char *p, *q; int i; static const char diag[] = "findxmlattr_set_restart_path"; /* * if restartpath = "dir1/dir2", * array->ckpath = "dir1\0dir2"; * array->ckpathdepth = 2; * array->ckpathnames = { "dir1", "dir2" } */ array->restartpath = path; free(array->ckpath); array->ckpath = strdup_log(path, diag); if (array->ckpath == NULL) return (GFARM_ERR_NO_MEMORY); array->check_ckpath = array->check_ckname = 1; p = array->ckpath; array->ckpathdepth = 1; while ((q = strchr(p, '/')) != NULL) { array->ckpathdepth++; do { q++; } while (*q == '/'); p = q; } GFARM_MALLOC_ARRAY(array->ckpathnames, array->ckpathdepth); if (array->ckpathnames == NULL) { free(array->ckpath); array->ckpath = NULL; gflog_debug(GFARM_MSG_1002101, "allocation of 'ckpathnames' failed"); return GFARM_ERR_NO_MEMORY; } p = array->ckpath; for (i = 0; i < array->ckpathdepth; i++) { array->ckpathnames[i] = p; q = strchr(p, '/'); if (q == NULL) break; do { *q = '\0'; q++; } while (*q == '/'); p = q; } return GFARM_ERR_NO_ERROR; } static int is_find_target(struct inode *inode, struct user *user) { return inode_xattr_has_xmlattrs(inode) && (inode_access(inode, user, GFS_R_OK) == GFARM_ERR_NO_ERROR); } static gfarm_error_t findxmlattr_add_selfpath(struct inode *inode, struct user *user, char *path, struct inum_path_array *array) { if (!is_find_target(inode, user)){ return GFARM_ERR_NO_ERROR; } if (array->check_ckpath) { if (strcmp(array->restartpath, path) != 0) { return GFARM_ERR_NO_ERROR; } } return inum_path_array_add(array, inode_get_number(inode), path); } static char * make_subpath(char *parent_path, char *name, int namelen) { int pathlen; size_t allocsz; int overflow = 0; char *subpath; pathlen = (parent_path[0] == '\0') ? 0 : (strlen(parent_path) + 1); allocsz = gfarm_size_add(&overflow, pathlen, namelen); allocsz = gfarm_size_add(&overflow, allocsz, 1); if (!overflow) GFARM_MALLOC_ARRAY(subpath, allocsz); if (overflow || (subpath == NULL)) { gflog_debug(GFARM_MSG_1002102, "allocation of 'subpath' failed or overflow"); return NULL; } if (pathlen > 0) sprintf(subpath, "%s/", parent_path); memcpy(subpath + pathlen, name, namelen); subpath[pathlen + namelen] = '\0'; return subpath; } static gfarm_error_t findxmlattr_add_subpaths(struct inode *inode, struct user *user, char *path, int curdepth, const int maxdepth, struct inum_path_array *array) { gfarm_error_t e = GFARM_ERR_NO_ERROR; Dir dir; DirEntry entry; DirCursor cursor; struct inode *entry_inode; char *name, *subpath = NULL; int namelen, is_dir, is_tgt, skip = 0; if (curdepth >= maxdepth) return GFARM_ERR_NO_ERROR; dir = inode_get_dir(inode); if (dir == NULL) return GFARM_ERR_NO_ERROR; if (inode_access(inode, user, GFS_X_OK) != GFARM_ERR_NO_ERROR) return GFARM_ERR_NO_ERROR; if ((array->check_ckpath) && (curdepth < array->ckpathdepth)) { char *subpath = array->ckpathnames[curdepth]; if (dir_cursor_lookup(dir, subpath, strlen(subpath), &cursor) == 0) return GFARM_ERR_NO_ERROR; if (curdepth == (array->ckpathdepth -1)) array->check_ckpath = 0; // it's restart path now else skip = 1; // doesn't find restart path yet } else { if (dir_cursor_set_pos(dir, 0, &cursor) == 0) return GFARM_ERR_NO_ERROR; } do { entry = dir_cursor_get_entry(dir, &cursor); if (entry == NULL) break; name = dir_entry_get_name(entry, &namelen); if (is_dot_dir(name, namelen)) continue; entry_inode = dir_entry_get_inode(entry); is_dir = inode_is_dir(entry_inode); is_tgt = (!skip && is_find_target(entry_inode, user)); skip = 0; if (!is_dir && !is_tgt) continue; subpath = make_subpath(path, name, namelen); if (subpath == NULL) { gflog_debug(GFARM_MSG_1002103, "make_subpath() failed"); e = GFARM_ERR_NO_MEMORY; break; } if (is_tgt) e = inum_path_array_add(array, inode_get_number(entry_inode), subpath); if (is_dir && (e == GFARM_ERR_NO_ERROR)) { e = findxmlattr_add_subpaths(entry_inode, user, subpath, curdepth + 1, maxdepth, array); } if (!is_tgt) free(subpath); } while ((e == GFARM_ERR_NO_ERROR) && (dir_cursor_next(dir, &cursor) != 0) && !array->isfilled); return e; } static gfarm_error_t findxmlattr_make_patharray(struct inode *inode, struct user *user, const int maxdepth, struct inum_path_array *array) { gfarm_error_t e; static const char diag[] = "findxmlattr_make_patharray"; char *toppath = strdup_log("", diag); if (toppath == NULL) return (GFARM_ERR_NO_MEMORY); e = findxmlattr_add_selfpath(inode, user, toppath, array); if ((e == GFARM_ERR_NO_ERROR) && inode_is_dir(inode)) { e = findxmlattr_add_subpaths( inode, user, toppath, 0, maxdepth, array); } if (array->entries[0].path != toppath) free(toppath); return e; } static void db_findxmlattr_wait(struct inum_path_array *array, int idx) { struct inum_path_entry *entry; static const char diag[] = "db_findxmlattr_wait"; /* * NOTE: must call with array->lock */ entry = &array->entries[idx]; while (IS_UNSET_ERRNO(entry->dberr)) { gfarm_cond_wait(&array->cond, &array->lock, diag, inum_path_array_diag); } } static void findxmlattr_reset_replyidx(struct inum_path_array *array, struct gfs_xmlattr_ctx *ctxp) { struct inum_path_entry *entry; int j; entry = &array->entries[array->replyentidx]; if (entry->path != NULL && (strcmp(entry->path, ctxp->cookie_path) == 0)) { for (j = 0; j < entry->nattrs; j++) { array->nreplied++; // already replied, skip it if (strcmp(entry->attrnames[j], ctxp->cookie_attrname) == 0) { break; } } array->replynameidx = j + 1; } } static void findxmlattr_get_nextname(struct inum_path_array *array, struct gfs_xmlattr_ctx *ctxp, char **fpathp, char **attrnamep) { struct inum_path_entry *entry; int i, j, jinit; *fpathp = NULL; *attrnamep = NULL; if (array->nreplied >= array->nattrssum) return; j = jinit = array->replynameidx; for (i = array->replyentidx; i < array->nentry; i++) { entry = &array->entries[i]; for (j = jinit; j < entry->nattrs; j++) { *fpathp = entry->path; *attrnamep = entry->attrnames[j]; array->nreplied++; goto quit; } jinit = 0; } quit: array->replyentidx = i; array->replynameidx = j + 1; } static void findxmlattr_dbq_wait_all(struct inum_path_array *array, struct gfs_xmlattr_ctx *ctxp) { int i; static const char diag[] = "findxmlattr_dbq_wait_all"; if (array == NULL) return; gfarm_mutex_lock(&array->lock, diag, inum_path_array_diag); for (i = 0; i < array->nentry; i++) { db_findxmlattr_wait(array, i); } gfarm_mutex_unlock(&array->lock, diag, inum_path_array_diag); } static void findxmlattr_set_found_attrnames(struct inum_path_array *array, struct gfs_xmlattr_ctx *ctxp) { int i, nreply, nremain; char *path, *name; if (array->check_ckname) { findxmlattr_reset_replyidx(array, ctxp); array->check_ckname = 0; } nremain = array->nattrssum - array->nreplied; nreply = (nremain >= ctxp->nalloc) ? ctxp->nalloc : nremain; for (i = 0; i < nreply; i++) { findxmlattr_get_nextname(array, ctxp, &path, &name); ctxp->entries[i].path = path; ctxp->entries[i].attrname = name; } ctxp->nvalid = nreply; ctxp->eof = ((array->isfilled == 0) && (array->nattrssum == array->nreplied)); } static gfarm_error_t findxmlxattr_restart(struct peer *peer, struct inode *inode, struct inum_path_array *array, struct gfs_xmlattr_ctx *ctxp) { gfarm_error_t e; struct process *process = peer_get_process(peer); struct user *user = process_get_user(process); char *restartpath; static const char diag[] = "findxmlxattr_restart"; if (array->nentry == 0) return GFARM_ERR_NO_ERROR; restartpath = strdup_log(array->entries[array->nentry-1].path, diag); if (restartpath == NULL) return (GFARM_ERR_NO_MEMORY); inum_path_array_reinit(array, ctxp->expr); e = findxmlattr_set_restart_path(array, restartpath); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1002106, "findxmlattr_set_restart_path() failed: %s", gfarm_error_string(e)); return e; } giant_lock(); e = findxmlattr_make_patharray(inode, user, ctxp->depth, array); giant_unlock(); findxmlattr_dbq_wait_all(array, ctxp); if (e == GFARM_ERR_NO_ERROR) { findxmlattr_set_found_attrnames(array, ctxp); } return e; } static int ctx_has_cookie(struct gfs_xmlattr_ctx *ctxp) { /* * cookie_pathname maybe "" if restart from top directory. * cookie_attrname is always not empty if set. */ return (ctxp->cookie_attrname[0] != '\0'); } static gfarm_error_t findxmlattr(struct peer *peer, struct inode *inode, struct gfs_xmlattr_ctx *ctxp, struct inum_path_array **ap) { gfarm_error_t e; struct process *process = peer_get_process(peer); struct user *user = process_get_user(process); struct inum_path_array *array = NULL; array = peer_findxmlattrctx_get(peer); if (array == NULL) { if (ctx_has_cookie(ctxp)) { gflog_debug(GFARM_MSG_1002107, "argument 'ctxp' is invalid"); e = GFARM_ERR_INVALID_ARGUMENT; } else if ((array = inum_path_array_alloc(ctxp->expr)) == NULL) { e = GFARM_ERR_NO_MEMORY; gflog_debug(GFARM_MSG_1002108, "inum_path_array_alloc() failed"); } else { e = findxmlattr_make_patharray(inode, user, ctxp->depth, array); } giant_unlock(); // We must wait always even if above function was failed. findxmlattr_dbq_wait_all(array, ctxp); } else { giant_unlock(); if (!ctx_has_cookie(ctxp)) { gflog_debug(GFARM_MSG_1002109, "argument 'ctxp' is invalid"); e = GFARM_ERR_INVALID_ARGUMENT; } else e = GFARM_ERR_NO_ERROR; } *ap = array; if (e == GFARM_ERR_NO_ERROR) findxmlattr_set_found_attrnames(array, ctxp); while ((e == GFARM_ERR_NO_ERROR) && array->isfilled && (ctxp->nvalid == 0)) { e = findxmlxattr_restart(peer, inode, array, ctxp); } if ((e == GFARM_ERR_NO_ERROR) && (ctxp->eof == 0)) { // remain array pointer at peer peer_findxmlattrctx_set(peer, array); *ap = NULL; // avoid to be freed } else { // purge array pointer from peer peer_findxmlattrctx_set(peer, NULL); } return e; } #endif /* ENABLE_XMLATTR */ gfarm_error_t gfm_server_findxmlattr(struct peer *peer, int from_client, int skip) { gfarm_error_t e; static const char diag[] = "GFM_PROTO_XMLATTR_FIND"; char *expr = NULL, *ck_path = NULL, *ck_name = NULL; int depth, nalloc; #ifdef ENABLE_XMLATTR struct gfs_xmlattr_ctx *ctxp = NULL; int fd, i; struct process *process; struct inode *inode; struct inum_path_array *array = NULL; #endif e = gfm_server_get_request(peer, diag, "siiss", &expr, &depth, &nalloc, &ck_path, &ck_name); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1002110, "%s request failed: %s", diag, gfarm_error_string(e)); return (e); } if (skip) { free(expr); free(ck_path); free(ck_name); return (GFARM_ERR_NO_ERROR); } #ifdef ENABLE_XMLATTR if ((ctxp = gfs_xmlattr_ctx_alloc(nalloc)) == NULL) { e = GFARM_ERR_NO_MEMORY; gflog_debug(GFARM_MSG_1002111, "allocation of 'ctxp' failed"); goto quit; } ctxp->expr = expr; ctxp->depth = depth; ctxp->cookie_path = ck_path; ctxp->cookie_attrname = ck_name; giant_lock(); if ((process = peer_get_process(peer)) == NULL) { e = GFARM_ERR_OPERATION_NOT_PERMITTED; gflog_debug(GFARM_MSG_1002112, "peer_get_process() failed :%s", gfarm_error_string(e)); } else if ((e = peer_fdpair_get_current(peer, &fd)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1002113, "peer_fdpair_get_current() failed: %s", gfarm_error_string(e)); } else if ((e = process_get_file_inode(process, fd, &inode)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1002114, "process_get_file_inode() failed: %s", gfarm_error_string(e)); } if (e == GFARM_ERR_NO_ERROR) { // giant_unlock() is called in findxmlattr() e = findxmlattr(peer, inode, ctxp, &array); } else giant_unlock(); quit: if ((e = gfm_server_put_reply(peer, diag, e, "ii", ctxp->eof, ctxp->nvalid)) == GFARM_ERR_NO_ERROR) { for (i = 0; i < ctxp->nvalid; i++) { e = gfp_xdr_send(peer_get_conn(peer), "ss", ctxp->entries[i].path, ctxp->entries[i].attrname); if (e != GFARM_ERR_NO_ERROR) { gflog_warning(GFARM_MSG_1000420, "%s@%s: findxmlattr: %s", peer_get_username(peer), peer_get_hostname(peer), gfarm_error_string(e)); break; } } } inum_path_array_free(array); gfs_xmlattr_ctx_free(ctxp, 0); return e; #else free(expr); free(ck_path); free(ck_name); return gfm_server_put_reply(peer, diag, GFARM_ERR_OPERATION_NOT_SUPPORTED, ""); #endif } gfarm-2.4.1/server/gfmd/process.h0000644000000000000000000001020611507222724015363 0ustar rootrootstruct process; struct inode; struct host; struct file_replicating; struct process *process_lookup(gfarm_pid_t); gfarm_error_t process_new_generation_wait(struct peer *, int, gfarm_error_t (*)(struct peer *, void *, int *), void *); gfarm_error_t process_new_generation_done(struct process *, struct peer *, int, gfarm_int32_t); void process_attach_peer(struct process *, struct peer *); void process_detach_peer(struct process *, struct peer *); struct user *process_get_user(struct process *); gfarm_error_t process_verify_fd(struct process *, int); gfarm_error_t process_record_desired_number(struct process *, int, int); gfarm_error_t process_get_file_inode(struct process *, int, struct inode **); gfarm_error_t process_get_file_writable(struct process *, struct peer *, int); gfarm_error_t process_get_dir_offset(struct process *, struct peer *, int, gfarm_off_t *); gfarm_error_t process_set_dir_offset(struct process *, struct peer *, int, gfarm_off_t); gfarm_error_t process_get_dir_key(struct process *, struct peer *, int, char **, int *); gfarm_error_t process_set_dir_key(struct process *, struct peer *, int, char *, int); gfarm_error_t process_clear_dir_key(struct process *, struct peer *, int); struct file_opening { /* * end marker: * {fo->opening_prev, fo->opening_next} * == &fo->inode->u.c.state->openings */ struct file_opening *opening_prev, *opening_next; struct inode *inode; int flag; struct peer *opener; union { struct opening_file { struct peer *spool_opener; struct host *spool_host; int desired_replica_number; /* only used by client initiated replication */ struct file_replicating *replicating; } f; struct opening_dir { gfarm_off_t offset; char *key; } d; } u; }; /* * a client opened a file: * file_opening:opener == client_peer * file_opening:u.f.spool_opener == NULL * then, a gfsd reopened it: * file_opening:opener == client_peer * file_opening:u.f.spool_opener == gfsd_peer * then * (a) client closed the file: * file_opening:opener == NULL * file_opening:u.f.spool_opener == gfsd_peer * (b) gfsd closed the file: * file_opening:opener == client_peer * file_opening:u.f.spool_opener == NULL * * a gfsd opened a file: * file_opening:opener == gfsd_peer * file_opening:u.f.spool_opener == gfsd_peer */ gfarm_error_t process_open_file(struct process *, struct inode *, gfarm_int32_t, int, struct peer *, struct host *, gfarm_int32_t *); gfarm_error_t process_schedule_file(struct process *, struct peer *, int, gfarm_int32_t *, struct host ***); gfarm_error_t process_reopen_file(struct process *, struct peer *, struct host *, int, gfarm_ino_t *, gfarm_uint64_t *, gfarm_int32_t *, gfarm_int32_t *, gfarm_int32_t *); gfarm_error_t process_close_file(struct process *, struct peer *, int); gfarm_error_t process_close_file_read(struct process *, struct peer *, int, struct gfarm_timespec *); gfarm_error_t process_close_file_write(struct process *, struct peer *, int, gfarm_off_t, struct gfarm_timespec *, struct gfarm_timespec *, gfarm_int32_t *, gfarm_int64_t *, gfarm_int64_t *); gfarm_error_t process_cksum_set(struct process *, struct peer *, int, const char *, size_t, const char *, gfarm_int32_t, struct gfarm_timespec *); gfarm_error_t process_cksum_get(struct process *, struct peer *, int, char **, size_t *, char **, gfarm_int32_t *); struct peer; gfarm_error_t gfm_server_process_alloc(struct peer *, int, int); gfarm_error_t gfm_server_process_alloc_child(struct peer *, int, int); gfarm_error_t gfm_server_process_free(struct peer *, int, int); gfarm_error_t gfm_server_process_set(struct peer *, int, int); gfarm_error_t gfm_server_bequeath_fd(struct peer *, int, int); gfarm_error_t gfm_server_inherit_fd(struct peer *, int, int); gfarm_error_t process_prepare_to_replicate(struct process *, struct peer *, struct host *, struct host *, int, gfarm_int32_t, struct file_replicating **, struct inode **); gfarm_error_t process_replica_adding(struct process *, struct peer *, struct host *, struct host *, int, struct inode **); gfarm_error_t process_replica_added(struct process *, struct peer *, struct host *, int, int, gfarm_int64_t, gfarm_int32_t, gfarm_off_t); gfarm-2.4.1/server/gfmd/host.h0000644000000000000000000000720011507222724014662 0ustar rootroot/* * $Id: host.h 4955 2010-12-15 03:32:37Z n-soda $ */ void host_init(void); struct host; struct sockaddr; struct peer; struct callout; struct dead_file_copy; struct host_status { double loadavg_1min, loadavg_5min, loadavg_15min; gfarm_off_t disk_used, disk_avail; }; struct host *host_lookup(const char *); struct host *host_addr_lookup(const char *, struct sockaddr *); int host_status_callout_retry(struct host *); void host_peer_set(struct host *, struct peer *, int); void host_disconnect(struct host *, struct peer *); void host_disconnect_request(struct host *, struct peer *); struct callout *host_status_callout(struct host *); struct peer *host_peer(struct host *); gfarm_error_t host_sender_lock(struct host *, struct peer **); gfarm_error_t host_sender_trylock(struct host *, struct peer **); void host_sender_unlock(struct host *, struct peer *); gfarm_error_t host_receiver_lock(struct host *, struct peer **); void host_receiver_unlock(struct host *, struct peer *); char *host_name(struct host *); int host_port(struct host *); int host_supports_async_protocols(struct host *); int host_is_disk_available(struct host *, gfarm_off_t); #ifdef COMPAT_GFARM_2_3 void host_set_callback(struct host *, struct peer *, gfarm_int32_t (*)(void *, void *, size_t), void (*)(void *, void *), void *); int host_get_result_callback(struct host *, struct peer *, gfarm_int32_t (**)(void *, void *, size_t), void **); int host_get_disconnect_callback(struct host *, void (**)(void *, void *), struct peer **, void **); #endif int host_is_up(struct host *); int host_is_active(struct host *); void host_peer_busy(struct host *); void host_peer_unbusy(struct host *); int host_check_busy(struct host *host, gfarm_int64_t); int host_unique_sort(int, struct host **); struct file_replicating; gfarm_error_t host_replicating_new(struct host *, struct file_replicating **); struct inode; gfarm_error_t host_is_disk_available_filter(struct host *, void *); gfarm_error_t host_schedule_except( int, struct host **, int (*)(struct host *, void *), void *, int, int *, struct host **); gfarm_error_t host_schedule_all_except(int, struct host **, int (*)(struct host *, void *), void *, gfarm_int32_t *, struct host ***); int host_schedule_one_except(struct peer *, int, struct host **, int (*)(struct host *, void *), void *, gfarm_int32_t *, struct host ***, gfarm_error_t *); void host_status_reply_waiting(struct host *); int host_status_reply_is_waiting(struct host *); void host_status_update(struct host *, struct host_status *); gfarm_error_t gfm_server_host_info_get_all(struct peer *, int, int); gfarm_error_t gfm_server_host_info_get_by_architecture(struct peer *, int,int); gfarm_error_t gfm_server_host_info_get_by_names(struct peer *, int, int); gfarm_error_t gfm_server_host_info_get_by_namealiases(struct peer *, int, int); gfarm_error_t gfm_server_host_info_set(struct peer *, int, int); gfarm_error_t gfm_server_host_info_modify(struct peer *, int, int); gfarm_error_t gfm_server_host_info_remove(struct peer *, int, int); gfarm_error_t host_schedule_reply(struct host *, struct peer *, const char *); gfarm_error_t host_schedule_reply_all(struct peer *, int (*)(struct host *, void *), void *, const char *); gfarm_error_t gfm_server_hostname_set(struct peer *, int, int); gfarm_error_t gfm_server_schedule_host_domain(struct peer *, int, int); gfarm_error_t gfm_server_statfs(struct peer *, int, int); /* exported for a use from a private extension */ struct gfp_xdr; gfarm_error_t host_info_send(struct gfp_xdr *, struct host *); gfarm_error_t host_info_remove_default(const char *, const char *); extern gfarm_error_t (*host_info_remove)(const char *, const char *); gfarm-2.4.1/server/gfmd/host.c0000644000000000000000000013425011507222724014663 0ustar rootroot/* * $Id: host.c 4958 2010-12-15 08:51:00Z n-soda $ */ #include #include #include #include #include #include #include /* for host_addr_lookup() */ #include #include #include #include #include #include "gfutil.h" #include "hash.h" #include "thrsubr.h" #include "metadb_common.h" /* gfarm_host_info_free_except_hostname() */ #include "gfp_xdr.h" #include "gfm_proto.h" /* GFM_PROTO_SCHED_FLAG_* */ #include "gfs_proto.h" /* GFS_PROTOCOL_VERSION */ #include "auth.h" #include "config.h" #include "callout.h" #include "subr.h" #include "db_access.h" #include "host.h" #include "user.h" #include "peer.h" #include "inode.h" #include "dead_file_copy.h" #include "back_channel.h" #define HOST_HASHTAB_SIZE 3079 /* prime number */ static pthread_mutex_t total_disk_mutex = PTHREAD_MUTEX_INITIALIZER; static gfarm_off_t total_disk_used, total_disk_avail; static const char total_disk_diag[] = "total_disk"; /* in-core gfarm_host_info */ struct host { /* * resources which are protected by the giant_lock() */ struct gfarm_host_info hi; int invalid; /* set when deleted */ /* * resources which are protected by the host::back_channel_mutex */ pthread_mutex_t back_channel_mutex; pthread_cond_t ready_to_send, ready_to_receive; int can_send, can_receive; struct peer *peer; int protocol_version; volatile int is_active; #ifdef COMPAT_GFARM_2_3 /* used by synchronous protocol (i.e. until gfarm-2.3.0) only */ gfarm_int32_t (*back_channel_result)(void *, void *, size_t); void (*back_channel_disconnect)(void *, void *); struct peer *back_channel_callback_peer; void *back_channel_callback_closure; #endif int status_reply_waiting; gfarm_int32_t report_flags; struct host_status status; struct callout *status_callout; gfarm_time_t last_report; int status_callout_retry; gfarm_time_t busy_time; }; static struct gfarm_hash_table *host_hashtab = NULL; static struct gfarm_hash_table *hostalias_hashtab = NULL; /* NOTE: each entry should be checked by host_is_active(h) too */ #define FOR_ALL_HOSTS(it) \ for (gfarm_hash_iterator_begin(host_hashtab, (it)); \ !gfarm_hash_iterator_is_end(it); \ gfarm_hash_iterator_next(it)) struct host * host_hashtab_lookup(struct gfarm_hash_table *hashtab, const char *hostname) { struct gfarm_hash_entry *entry; entry = gfarm_hash_lookup(hashtab, &hostname, sizeof(hostname)); if (entry == NULL) return (NULL); return (*(struct host **)gfarm_hash_entry_data(entry)); } struct host * host_iterator_access(struct gfarm_hash_iterator *it) { struct host **hp = gfarm_hash_entry_data(gfarm_hash_iterator_access(it)); return (*hp); } static void host_invalidate(struct host *h) { h->invalid = 1; } static void host_activate(struct host *h) { h->invalid = 0; } static int host_is_invalidated(struct host *h) { return (h->invalid == 1); } static int host_is_valid_unlocked(struct host *h) { return (!host_is_invalidated(h)); } int host_is_active(struct host *h) { int valid; static const char diag[] = "host_is_active"; gfarm_mutex_lock(&h->back_channel_mutex, diag, "back_channel"); valid = host_is_valid_unlocked(h); gfarm_mutex_unlock(&h->back_channel_mutex, diag, "back_channel"); return (valid); } static struct host * host_lookup_internal(const char *hostname) { return (host_hashtab_lookup(host_hashtab, hostname)); } struct host * host_lookup(const char *hostname) { struct host *h = host_lookup_internal(hostname); return ((h == NULL || host_is_invalidated(h)) ? NULL : h); } struct host * host_addr_lookup(const char *hostname, struct sockaddr *addr) { struct host *h = host_lookup(hostname); #if 0 struct gfarm_hash_iterator it; struct sockaddr_in *addr_in; struct hostent *hp; int i; #endif if (h != NULL) return (h); if (addr->sa_family != AF_INET) return (NULL); #if 0 /* * skip the following case since it is extraordinarily slow * when there are some nodes that cannot be resolved. */ addr_in = (struct sockaddr_in *)addr; /* XXX FIXME - this is too damn slow */ FOR_ALL_HOSTS(&it) { h = host_iterator_access(&it); if (!host_is_active(h)) continue; hp = gethostbyname(h->hi.hostname); if (hp == NULL || hp->h_addrtype != AF_INET) continue; for (i = 0; hp->h_addr_list[i] != NULL; i++) { if (memcmp(hp->h_addr_list[i], &addr_in->sin_addr, sizeof(addr_in->sin_addr)) == 0) return (h); } } #endif return (NULL); } struct host * host_namealiases_lookup(const char *hostname) { struct host *h = host_lookup(hostname); if (h != NULL) return (h); h = host_hashtab_lookup(hostalias_hashtab, hostname); return ((h == NULL || host_is_invalidated(h)) ? NULL : h); } /* XXX FIXME missing hostaliases */ gfarm_error_t host_enter(struct gfarm_host_info *hi, struct host **hpp) { struct gfarm_hash_entry *entry; int created; struct host *h; struct callout *callout; static const char diag[] = "host_enter"; h = host_lookup_internal(hi->hostname); if (h != NULL) { if (host_is_invalidated(h)) { host_activate(h); if (hpp != NULL) *hpp = h; /* * copy host info but keeping address of hostname */ free(hi->hostname); hi->hostname = h->hi.hostname; /* see the comment in host_name() */ gfarm_host_info_free_except_hostname(&h->hi); h->hi = *hi; return (GFARM_ERR_NO_ERROR); } else return (GFARM_ERR_ALREADY_EXISTS); } callout = callout_new(); if (callout == NULL) { gflog_debug(GFARM_MSG_1002212, "%s: no memory for host %s", diag, hi->hostname); return (GFARM_ERR_NO_MEMORY); } GFARM_MALLOC(h); if (h == NULL) { gflog_debug(GFARM_MSG_1001546, "allocation of host failed"); callout_free(callout); return (GFARM_ERR_NO_MEMORY); } h->hi = *hi; entry = gfarm_hash_enter(host_hashtab, &h->hi.hostname, sizeof(h->hi.hostname), sizeof(struct host *), &created); if (entry == NULL) { gflog_debug(GFARM_MSG_1001547, "gfarm_hash_enter() failed"); free(h); return (GFARM_ERR_NO_MEMORY); } if (!created) { gflog_debug(GFARM_MSG_1001548, "create entry failed"); free(h); return (GFARM_ERR_ALREADY_EXISTS); } h->peer = NULL; h->protocol_version = 0; h->can_send = 1; h->can_receive = 1; h->is_active = 0; #ifdef COMPAT_GFARM_2_3 h->back_channel_result = NULL; h->back_channel_disconnect = NULL; h->back_channel_callback_peer = NULL; h->back_channel_callback_closure = NULL; #endif h->status_reply_waiting = 0; h->report_flags = 0; h->status.loadavg_1min = h->status.loadavg_5min = h->status.loadavg_15min = 0.0; h->status.disk_used = h->status.disk_avail = 0; h->status_callout = callout; h->status_callout_retry = 0; h->last_report = 0; h->busy_time = 0; gfarm_cond_init(&h->ready_to_send, diag, "ready_to_send"); gfarm_cond_init(&h->ready_to_receive, diag, "ready_to_receive"); gfarm_mutex_init(&h->back_channel_mutex, diag, "back_channel"); *(struct host **)gfarm_hash_entry_data(entry) = h; host_activate(h); if (hpp != NULL) *hpp = h; return (GFARM_ERR_NO_ERROR); } /* XXX FIXME missing hostaliases */ static gfarm_error_t host_remove(const char *hostname) { struct host *h = host_lookup(hostname); if (h == NULL) { gflog_debug(GFARM_MSG_1001549, "host_remove(%s): not exist", hostname); return (GFARM_ERR_NO_SUCH_OBJECT); } /* * do not purge the hash entry. Instead, invalidate it so * that it can be activated later. */ host_invalidate(h); dead_file_copy_host_removed(h); return (GFARM_ERR_NO_ERROR); } /* * PREREQUISITE: nothing * LOCKS: nothing * * host_name() is usable without any mutex. * See hash_enter(), it's using gfarm_host_info_free_except_hostname() * to make h->hi.hostname always available. * It's implemented that way because host_name() is useful especially * for error logging, and acquiring giant_lock just for error logging is * not what we want to do. */ char * host_name(struct host *h) { return (h->hi.hostname); } int host_port(struct host *h) { return (h->hi.port); } int host_supports_async_protocols(struct host *h) { return (h->protocol_version >= GFS_PROTOCOL_VERSION_V2_4); } #ifdef COMPAT_GFARM_2_3 void host_set_callback(struct host *h, struct peer *peer, gfarm_int32_t (*result_callback)(void *, void *, size_t), void (*disconnect_callback)(void *, void *), void *closure) { static const char diag[] = "host_set_callback"; static const char back_channel_diag[] = "back_channel"; /* XXX FIXME sanity check? */ gfarm_mutex_lock(&h->back_channel_mutex, diag, back_channel_diag); h->back_channel_result = result_callback; h->back_channel_disconnect = disconnect_callback; h->back_channel_callback_peer = peer; h->back_channel_callback_closure = closure; gfarm_mutex_unlock(&h->back_channel_mutex, diag, back_channel_diag); } int host_get_result_callback(struct host *h, struct peer *peer, gfarm_int32_t (**callbackp)(void *, void *, size_t), void **closurep) { int ok; static const char diag[] = "host_get_result_callback"; static const char back_channel_diag[] = "back_channel"; gfarm_mutex_lock(&h->back_channel_mutex, diag, back_channel_diag); if (h->back_channel_result == NULL || h->back_channel_callback_peer != peer) { ok = 0; } else { *callbackp = h->back_channel_result; *closurep = h->back_channel_callback_closure; h->back_channel_result = NULL; h->back_channel_disconnect = NULL; h->back_channel_callback_peer = NULL; h->back_channel_callback_closure = NULL; ok = 1; } gfarm_mutex_unlock(&h->back_channel_mutex, diag, back_channel_diag); return (ok); } int host_get_disconnect_callback(struct host *h, void (**callbackp)(void *, void *), struct peer **peerp, void **closurep) { int ok; static const char diag[] = "host_get_disconnect_callback"; static const char back_channel_diag[] = "back_channel"; gfarm_mutex_lock(&h->back_channel_mutex, diag, back_channel_diag); if (h->back_channel_disconnect == NULL) { ok = 0; } else { *callbackp = h->back_channel_disconnect; *peerp = h->back_channel_callback_peer; *closurep = h->back_channel_callback_closure; h->back_channel_result = NULL; h->back_channel_disconnect = NULL; h->back_channel_callback_peer = NULL; h->back_channel_callback_closure = NULL; ok = 1; } gfarm_mutex_unlock(&h->back_channel_mutex, diag, back_channel_diag); return (ok); } #endif /* * PREREQUISITE: host::back_channel_mutex * LOCKS: nothing * SLEEPS: no */ static int host_is_up_unlocked(struct host *h) { return (host_is_valid_unlocked(h) && h->is_active); } /* * PREREQUISITE: nothing * LOCKS: host::back_channel_mutex * SLEEPS: no */ int host_is_up(struct host *h) { int up; static const char diag[] = "host_is_up"; gfarm_mutex_lock(&h->back_channel_mutex, diag, "back_channel"); up = host_is_up_unlocked(h); gfarm_mutex_unlock(&h->back_channel_mutex, diag, "back_channel"); return (up); } int host_is_disk_available(struct host *h, gfarm_off_t size) { gfarm_off_t avail, minfree = gfarm_get_minimum_free_disk_space(); static const char diag[] = "host_get_disk_avail"; gfarm_mutex_lock(&h->back_channel_mutex, diag, "back_channel_mutex"); if (host_is_up_unlocked(h)) avail = h->status.disk_avail * 1024; else avail = 0; gfarm_mutex_unlock(&h->back_channel_mutex, diag, "back_channel_mutex"); if (minfree < size) minfree = size; return (avail >= minfree); } /* * PREREQUISITE: host::back_channel_mutex * LOCKS: nothing * SLEEPS: no */ static int host_is_unresponsive(struct host *host, gfarm_int64_t now, const char *diag) { int unresponsive = 0; if (!host->is_active || host->invalid) ; else if (host->can_send) host->busy_time = 0; else if (host->busy_time != 0 && now > host->busy_time + gfarm_metadb_heartbeat_interval) { gflog_warning(GFARM_MSG_1002213, "host %s: too long busy since %lld", host_name(host), (long long)host->busy_time); unresponsive = 1; } return (unresponsive); } void host_peer_busy(struct host *host) { struct peer *unresponsive_peer = NULL; static const char diag[] = "host_peer_busy"; static const char back_channel_diag[] = "back_channel"; gfarm_mutex_lock(&host->back_channel_mutex, diag, back_channel_diag); if (!host->is_active || host->invalid) ; else if (host->busy_time == 0) host->busy_time = time(NULL); else if (host_is_unresponsive(host, time(NULL), diag)) unresponsive_peer = host->peer; gfarm_mutex_unlock(&host->back_channel_mutex, diag, back_channel_diag); if (unresponsive_peer != NULL) { gflog_error(GFARM_MSG_1002419, "back_channel(%s): disconnecting: busy at sending", host_name(host)); host_disconnect_request(host, unresponsive_peer); } } void host_peer_unbusy(struct host *host) { static const char diag[] = "host_peer_unbusy"; static const char back_channel_diag[] = "back_channel"; gfarm_mutex_lock(&host->back_channel_mutex, diag, back_channel_diag); host->busy_time = 0; gfarm_mutex_unlock(&host->back_channel_mutex, diag, back_channel_diag); } int host_check_busy(struct host *host, gfarm_int64_t now) { int busy = 0; struct peer *unresponsive_peer = NULL; static const char diag[] = "host_check_busy"; static const char back_channel_diag[] = "back_channel"; gfarm_mutex_lock(&host->back_channel_mutex, diag, back_channel_diag); if (!host->is_active || host->invalid) busy = 1; else if (host_is_unresponsive(host, now, diag)) unresponsive_peer = host->peer; gfarm_mutex_unlock(&host->back_channel_mutex, diag, back_channel_diag); if (unresponsive_peer != NULL) { gflog_error(GFARM_MSG_1002420, "back_channel(%s): disconnecting: busy during queue scan", host_name(host)); host_disconnect_request(host, unresponsive_peer); } return (busy || unresponsive_peer != NULL); } struct callout * host_status_callout(struct host *h) { return (h->status_callout); } struct peer * host_peer(struct host *h) { struct peer *peer; static const char diag[] = "host_sender_trylock"; gfarm_mutex_lock(&h->back_channel_mutex, diag, "back_channel"); peer = h->peer; gfarm_mutex_unlock(&h->back_channel_mutex, diag, "back_channel"); return (peer); } gfarm_error_t host_sender_trylock(struct host *host, struct peer **peerp) { gfarm_error_t e; static const char diag[] = "host_sender_trylock"; gfarm_mutex_lock(&host->back_channel_mutex, diag, "back_channel"); if (!host_is_up_unlocked(host)) { e = GFARM_ERR_CONNECTION_ABORTED; } else if (host->can_send) { host->can_send = 0; host->busy_time = 0; peer_add_ref(host->peer); *peerp = host->peer; e = GFARM_ERR_NO_ERROR; } else { e = GFARM_ERR_DEVICE_BUSY; } gfarm_mutex_unlock(&host->back_channel_mutex, diag, "back_channel"); return (e); } gfarm_error_t host_sender_lock(struct host *host, struct peer **peerp) { gfarm_error_t e; struct peer *peer0; static const char diag[] = "host_sender_lock"; gfarm_mutex_lock(&host->back_channel_mutex, diag, "back_channel"); for (;;) { if (!host_is_up_unlocked(host)) { e = GFARM_ERR_CONNECTION_ABORTED; break; } if (host->can_send) { host->can_send = 0; host->busy_time = 0; peer_add_ref(host->peer); *peerp = host->peer; e = GFARM_ERR_NO_ERROR; break; } peer0 = host->peer; gfarm_cond_wait(&host->ready_to_send, &host->back_channel_mutex, diag, "ready_to_send"); if (host->peer != peer0) { e = GFARM_ERR_CONNECTION_ABORTED; break; } } gfarm_mutex_unlock(&host->back_channel_mutex, diag, "back_channel"); return (e); } void host_sender_unlock(struct host *host, struct peer *peer) { static const char diag[] = "host_sender_unlock"; gfarm_mutex_lock(&host->back_channel_mutex, diag, "back_channel"); if (peer == host->peer) { host->can_send = 1; host->busy_time = 0; } peer_del_ref(peer); gfarm_cond_signal(&host->ready_to_send, diag, "ready_to_send"); gfarm_mutex_unlock(&host->back_channel_mutex, diag, "back_channel"); } gfarm_error_t host_receiver_lock(struct host *host, struct peer **peerp) { gfarm_error_t e; struct peer *peer0; static const char diag[] = "host_receiver_lock"; gfarm_mutex_lock(&host->back_channel_mutex, diag, "back_channel"); for (;;) { if (!host_is_up_unlocked(host)) { e = GFARM_ERR_CONNECTION_ABORTED; break; } if (host->can_receive) { host->can_receive = 0; peer_add_ref(host->peer); *peerp = host->peer; e = GFARM_ERR_NO_ERROR; break; } /* may happen at gfsd restart? */ peer0 = host->peer; gflog_error(GFARM_MSG_1002318, "waiting for host_receiver_lock: maybe gfsd restarted?"); gfarm_cond_wait(&host->ready_to_receive, &host->back_channel_mutex, diag, "ready_to_receive"); if (host->peer != peer0) { e = GFARM_ERR_CONNECTION_ABORTED; break; } } gfarm_mutex_unlock(&host->back_channel_mutex, diag, "back_channel"); return (e); } void host_receiver_unlock(struct host *host, struct peer *peer) { static const char diag[] = "host_receiver_unlock"; gfarm_mutex_lock(&host->back_channel_mutex, diag, "back_channel"); if (peer == host->peer) { host->can_receive = 1; } peer_del_ref(peer); gfarm_cond_signal(&host->ready_to_receive, diag, "ready_to_receive"); gfarm_mutex_unlock(&host->back_channel_mutex, diag, "back_channel"); } /* * PREREQUISITE: host::back_channel_mutex * LOCKS: nothing * SLEEPS: no * * should be called after host->is_active = 0; */ static void host_break_locks(struct host *host) { static const char diag[] = "host_break_locks"; gfarm_cond_broadcast(&host->ready_to_send, diag, "ready_to_send"); gfarm_cond_broadcast(&host->ready_to_receive, diag, "ready_to_receive"); } int host_status_callout_retry(struct host *host) { long interval; int ok; static const char diag[] = "host_status_callout_retry"; gfarm_mutex_lock(&host->back_channel_mutex, diag, "back_channel"); ++host->status_callout_retry; interval = 1 << host->status_callout_retry; ok = (interval <= gfarm_metadb_heartbeat_interval); gfarm_mutex_unlock(&host->back_channel_mutex, diag, "back_channel"); if (ok) { callout_schedule(host->status_callout, interval); gflog_debug(GFARM_MSG_1002215, "%s(%s): retrying in %ld seconds", diag, host_name(host), interval); } return (ok); } void host_status_reply_waiting(struct host *host) { static const char diag[] = "host_status_reply_waiting"; gfarm_mutex_lock(&host->back_channel_mutex, diag, "back_channel"); host->status_reply_waiting = 1; gfarm_mutex_unlock(&host->back_channel_mutex, diag, "back_channel"); } int host_status_reply_is_waiting(struct host *host) { int waiting; static const char diag[] = "host_status_reply_waiting"; gfarm_mutex_lock(&host->back_channel_mutex, diag, "back_channel"); waiting = host->status_reply_waiting; gfarm_mutex_unlock(&host->back_channel_mutex, diag, "back_channel"); return (waiting); } /* * PREREQUISITE: nothing * LOCKS: total_disk_mutex * SLEEPS: no */ static void host_total_disk_update( gfarm_uint64_t old_used, gfarm_uint64_t old_avail, gfarm_uint64_t new_used, gfarm_uint64_t new_avail) { static const char diag[] = "host_total_disk_update"; gfarm_mutex_lock(&total_disk_mutex, diag, total_disk_diag); total_disk_used += new_used - old_used; total_disk_avail += new_avail - old_avail; gfarm_mutex_unlock(&total_disk_mutex, diag, total_disk_diag); } void host_status_update(struct host *host, struct host_status *status) { gfarm_uint64_t saved_used = 0, saved_avail = 0; gfarm_mutex_lock(&host->back_channel_mutex, "host back_channel", "status_update"); host->status_reply_waiting = 0; host->status_callout_retry = 0; if (host->report_flags & GFM_PROTO_SCHED_FLAG_LOADAVG_AVAIL) { saved_used = host->status.disk_used; saved_avail = host->status.disk_avail; } host->last_report = time(NULL); host->report_flags = GFM_PROTO_SCHED_FLAG_HOST_AVAIL | GFM_PROTO_SCHED_FLAG_LOADAVG_AVAIL; host->status = *status; gfarm_mutex_unlock(&host->back_channel_mutex, "host back_channel", "status_update"); host_total_disk_update(saved_used, saved_avail, status->disk_used, status->disk_avail); } /* * PREREQUISITE: host::back_channel_mutex * LOCKS: nothing * SLEEPS: no */ static void host_status_disable_unlocked(struct host *host, gfarm_uint64_t *saved_usedp, gfarm_uint64_t *saved_availp) { if (host->report_flags & GFM_PROTO_SCHED_FLAG_LOADAVG_AVAIL) { *saved_usedp = host->status.disk_used; *saved_availp = host->status.disk_avail; } else { *saved_usedp = 0; *saved_availp = 0; } host->report_flags = 0; } /* * PREREQUISITE: giant_lock * LOCKS: host::back_channel_mutex, dfc_allq.mutex, removal_pendingq.mutex * SLEEPS: maybe (see the comment of dead_file_copy_host_becomes_up()) * but host::back_channel_mutex, dfc_allq.mutex and removal_pendingq.mutex * won't be blocked while sleeping. */ void host_peer_set(struct host *h, struct peer *p, int version) { static const char diag[] = "host_peer_set"; static const char back_channel_diag[] = "back_channel"; gfarm_mutex_lock(&h->back_channel_mutex, diag, back_channel_diag); h->can_send = 1; h->can_receive = 1; h->peer = p; h->protocol_version = version; #ifdef COMPAT_GFARM_2_3 h->back_channel_result = NULL; h->back_channel_disconnect = NULL; h->back_channel_callback_peer = NULL; h->back_channel_callback_closure = NULL; #endif h->is_active = 1; h->status_reply_waiting = 0; h->status_callout_retry = 0; h->busy_time = 0; gfarm_mutex_unlock(&h->back_channel_mutex, diag, back_channel_diag); dead_file_copy_host_becomes_up(h); } /* * PREREQUISITE: host::back_channel_mutex * LOCKS: removal_pendingq.mutex, host_busyq.mutex * SLEEPS: no */ static void host_peer_unset(struct host *h) { h->peer = NULL; h->protocol_version = 0; h->is_active = 0; callout_stop(h->status_callout); host_break_locks(h); } /* giant_lock should be held before calling this */ void host_disconnect(struct host *h, struct peer *peer) { #if 0 /* * commented out, * not to sleep while holding host::back_channel_mutex */ int disabled = 0; gfarm_uint64_t saved_used, saved_avail; static const char diag[] = "host_disconnect"; static const char back_channel_diag[] = "back_channel"; gfarm_mutex_lock(&h->back_channel_mutex, diag, back_channel_diag); if (h->is_active && (peer == h->peer || peer == NULL)) { peer_record_protocol_error(h->peer); if (h->can_send && h->can_receive) { /* * NOTE: this shouldn't need db_begin()/db_end() * at least for now, * because only externalized descriptor needs the calls. */ peer_free(h->peer); } else peer_free_request(h->peer); host_peer_unset(h); host_status_disable_unlocked(&saved_used, &saved_avail); disabled = 1; } gfarm_mutex_unlock(&h->back_channel_mutex, diag, back_channel_diag); if (disabled) { host_total_disk_update(saved_used, saved_avail, 0, 0); dead_file_copy_host_becomes_down(h); } #else host_disconnect_request(h, peer); #endif } void host_disconnect_request(struct host *h, struct peer *peer) { int disabled = 0; gfarm_uint64_t saved_used, saved_avail; static const char diag[] = "host_disconnect_request"; static const char back_channel_diag[] = "back_channel"; gfarm_mutex_lock(&h->back_channel_mutex, diag, back_channel_diag); if (h->is_active && (peer == h->peer || peer == NULL)) { peer_record_protocol_error(h->peer); peer_free_request(h->peer); host_peer_unset(h); host_status_disable_unlocked(h, &saved_used, &saved_avail); disabled = 1; } gfarm_mutex_unlock(&h->back_channel_mutex, diag, back_channel_diag); if (disabled) { host_total_disk_update(saved_used, saved_avail, 0, 0); dead_file_copy_host_becomes_down(h); } } /* only file_replicating_new() is allowed to call this routine */ gfarm_error_t host_replicating_new(struct host *dst, struct file_replicating **frp) { if (dst->peer == NULL) return (GFARM_ERR_NO_ROUTE_TO_HOST); return (peer_replicating_new(dst->peer, dst, frp)); } static int host_order(const void *a, const void *b) { const struct host *const *h1 = a, *const *h2 = b; if (*h1 < *h2) return (-1); else if (*h1 > *h2) return (1); else return (0); } static void host_sort(int nhosts, struct host **hosts) { if (nhosts <= 0) /* 2nd parameter of qsort(3) is unsigned */ return; qsort(hosts, nhosts, sizeof(*hosts), host_order); } /* * remove duplicated hosts. * NOTE: this function assumes that hosts[] is sorted by host_order() */ static int host_unique(int nhosts, struct host **hosts) { int l, r; if (nhosts <= 0) return (0); l = 0; r = l + 1; for (;;) { for (;;) { if (r >= nhosts) return (l + 1); if (hosts[l] != hosts[r]) break; r++; } ++l; hosts[l] = hosts[r]; /* maybe l == r here */ ++r; } } int host_unique_sort(int nhosts, struct host **hosts) { host_sort(nhosts, hosts); return (host_unique(nhosts, hosts)); } /* NOTE: both hosts[] and excludings[] must be host_unique_sort()ed */ static gfarm_error_t host_exclude(int *nhostsp, struct host **hosts, int n_excludings, struct host **excludings, int (*filter)(struct host *, void *), void *closure) { int cmp, i, j, nhosts = *nhostsp; unsigned char *candidates; GFARM_MALLOC_ARRAY(candidates, nhosts > 0 ? nhosts : 1); if (candidates == NULL) return (GFARM_ERR_NO_MEMORY); memset(candidates, 1, nhosts); if (n_excludings > 0) { /* exclude excludings[] from hosts[] */ i = j = 0; while (i < nhosts && j < n_excludings) { cmp = host_order(&hosts[i], &excludings[j]); if (cmp < 0) { i++; } else if (cmp == 0) { candidates[i++] = 0; } else if (cmp > 0) { j++; } } } if (filter != NULL) { for (i = 0; i < nhosts; i++) { if (!candidates[i]) continue; if (!filter(hosts[i], closure)) candidates[i] = 0; } } /* compaction */ j = 0; for (i = 0; i < nhosts; i++) { if (candidates[i]) hosts[j++] = hosts[i]; } free(candidates); *nhostsp = j; return (GFARM_ERR_NO_ERROR); } gfarm_error_t host_is_disk_available_filter(struct host *host, void *closure) { gfarm_off_t *sizep = closure; return (host_is_disk_available(host, *sizep)); } static gfarm_error_t host_array_alloc(int *nhostsp, struct host ***hostsp) { int i, nhosts; struct host **hosts; struct gfarm_hash_iterator it; nhosts = 0; FOR_ALL_HOSTS(&it) { host_iterator_access(&it); ++nhosts; } GFARM_MALLOC_ARRAY(hosts, nhosts > 0 ? nhosts : 1); if (hosts == NULL) return (GFARM_ERR_NO_MEMORY); i = 0; FOR_ALL_HOSTS(&it) { if (i >= nhosts) /* always false due to giant_lock */ break; hosts[i++] = host_iterator_access(&it); } *nhostsp = i; *hostsp = hosts; return (GFARM_ERR_NO_ERROR); } /* * just select randomly XXX FIXME: needs to improve */ static void select_hosts(int nhosts, struct host **hosts, int nresults, struct host **results) { int i, j; assert(nhosts > nresults); for (i = 0; i < nresults; i++) { j = gfarm_random() % nhosts; results[i] = hosts[j]; hosts[j] = hosts[--nhosts]; } } /* * this function sorts excludings[] as a side effect. * but caller shouldn't depend on the side effect. */ gfarm_error_t host_schedule_all_except(int n_excludings, struct host **excludings, int (*filter)(struct host *, void *), void *closure, gfarm_int32_t *nhostsp, struct host ***hostsp) { gfarm_error_t e; int nhosts; struct host **hosts; e = host_array_alloc(&nhosts, &hosts); if (e != GFARM_ERR_NO_ERROR) return (e); n_excludings = host_unique_sort(n_excludings, excludings); nhosts = host_unique_sort(nhosts, hosts); e = host_exclude(&nhosts, hosts, n_excludings, excludings, filter, closure); if (e == GFARM_ERR_NO_ERROR) { *nhostsp = nhosts; *hostsp = hosts; } else { free(hosts); } return (e); } /* * this function sorts excludings[] as a side effect. * but caller shouldn't depend on the side effect. */ gfarm_error_t host_schedule_except(int n_excludings, struct host **excludings, int (*filter)(struct host *, void *), void *closure, int n_shortage, int *n_new_targetsp, struct host **new_targets) { gfarm_error_t e; struct host **hosts; int nhosts; int i; e = host_schedule_all_except(n_excludings, excludings, filter, closure, &nhosts, &hosts); if (e != GFARM_ERR_NO_ERROR) return (e); if (nhosts <= n_shortage) { for (i = 0; i < nhosts; i++) new_targets[i] = hosts[i]; *n_new_targetsp = nhosts; } else { select_hosts(nhosts, hosts, n_shortage, new_targets); *n_new_targetsp = n_shortage; } free(hosts); return (GFARM_ERR_NO_ERROR); } /* give the top priority to the local host */ int host_schedule_one_except(struct peer *peer, int n_excludings, struct host **excludings, int (*filter)(struct host *, void *), void *closure, gfarm_int32_t *np, struct host ***hostsp, gfarm_error_t *errorp) { struct host **hosts, *h = peer_get_host(peer); int i; if (h != NULL && (*filter)(h, closure)) { /* is the host excluded? */ for (i = 0; i < n_excludings; i++) { if (h == excludings[i]) return (0); /* not scheduled */ } GFARM_MALLOC_ARRAY(hosts, 1); if (hosts == NULL) { *errorp = GFARM_ERR_NO_MEMORY; return (1); /* scheduled, sort of */ } hosts[0] = h; *np = 1; *hostsp = hosts; *errorp = GFARM_ERR_NO_ERROR; return (1); /* scheduled */ } return (0); /* not scheduled */ } #ifdef NOT_USED /* * save all to text file */ static FILE *host_fp; gfarm_error_t host_info_open_for_seq_write(void) { host_fp = fopen("host", "w"); if (host_fp == NULL) return (gfarm_errno_to_error(errno)); return (GFARM_ERR_NO_ERROR); } gfarm_error_t host_info_write_next(struct gfarm_host_info *hi) { int i; fprintf(host_fp, "%s %d %d %d %s", hi->hostname, hi->port, hi->ncpu, hi->flags, hi->architecture); for (i = 0; i < hi->nhostaliases; i++) fprintf(host_fp, " %s", hi->hostaliases[i]); fprintf(host_fp, "\n"); return (GFARM_ERR_NO_ERROR); } gfarm_error_t host_info_close_for_seq_write(void) { fclose(host_fp); return (GFARM_ERR_NO_ERROR); } #endif /* NOT_USED */ /* The memory owner of `*hi' is changed to host.c */ void host_add_one(void *closure, struct gfarm_host_info *hi) { gfarm_error_t e = host_enter(hi, NULL); if (e != GFARM_ERR_NO_ERROR) gflog_warning(GFARM_MSG_1000266, "host_add_one: %s", gfarm_error_string(e)); } void host_init(void) { gfarm_error_t e; host_hashtab = gfarm_hash_table_alloc(HOST_HASHTAB_SIZE, gfarm_hash_casefold_strptr, gfarm_hash_key_equal_casefold_strptr); if (host_hashtab == NULL) gflog_fatal(GFARM_MSG_1000267, "no memory for host hashtab"); hostalias_hashtab = gfarm_hash_table_alloc(HOST_HASHTAB_SIZE, gfarm_hash_casefold_strptr, gfarm_hash_key_equal_casefold_strptr); if (hostalias_hashtab == NULL) { gfarm_hash_table_free(host_hashtab); gflog_fatal(GFARM_MSG_1000268, "no memory for hostalias hashtab"); } e = db_host_load(NULL, host_add_one); if (e != GFARM_ERR_NO_ERROR) gflog_error(GFARM_MSG_1000269, "loading hosts: %s", gfarm_error_string(e)); } #ifndef TEST /* * protocol handler */ /* * PREREQUISITE: giant_lock * LOCKS: host::back_channel_mutex * SLEEPS: maybe * but host::back_channel_mutex won't be blocked while sleeping. */ static gfarm_error_t gfm_server_host_generic_get(struct peer *peer, gfarm_error_t (*reply)(struct host *, struct peer *, const char *), int (*filter)(struct host *, void *), void *closure, int no_match_is_ok, const char *diag) { gfarm_error_t e, e2; gfarm_int32_t nhosts, nmatch, i, answered; struct gfarm_hash_iterator it; struct host *h; char *match; nhosts = 0; FOR_ALL_HOSTS(&it) { h = host_iterator_access(&it); ++nhosts; } /* * remember the matching result to return consistent answer. * note that the result of host_is_active() may vary at each call. */ GFARM_MALLOC_ARRAY(match, nhosts > 0 ? nhosts : 1); nmatch = 0; if (match == NULL) { e = GFARM_ERR_NO_MEMORY; gflog_debug(GFARM_MSG_1002216, "%s: no memory for %d hosts", diag, nhosts); } else { i = 0; FOR_ALL_HOSTS(&it) { if (i >= nhosts) /* always false due to giant_lock */ break; h = host_iterator_access(&it); if (host_is_active(h) && (filter == NULL || (*filter)(h, closure))) { match[i] = 1; ++nmatch; } else { match[i] = 0; } ++i; } if (no_match_is_ok || nmatch > 0) { e = GFARM_ERR_NO_ERROR; } else { e = GFARM_ERR_NO_SUCH_OBJECT; gflog_debug(GFARM_MSG_1002217, "%s: no matching host", diag); } } e2 = gfm_server_put_reply(peer, diag, e, "i", nmatch); if (e2 != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1002218, "gfm_server_put_reply(%s) failed: %s", diag, gfarm_error_string(e2)); } else if (e == GFARM_ERR_NO_ERROR) { i = answered = 0; FOR_ALL_HOSTS(&it) { if (i >= nhosts || answered >= nmatch) break; h = host_iterator_access(&it); if (match[i]) { e2 = (*reply)(h, peer, diag); if (e2 != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1002219, "%s: host_info_send(): %s", diag, gfarm_error_string(e)); break; } ++answered; } i++; } } if (match != NULL) free(match); return (e2); } /* this interface is exported for a use from a private extension */ gfarm_error_t host_info_send(struct gfp_xdr *client, struct host *h) { struct gfarm_host_info *hi; hi = &h->hi; return (gfp_xdr_send(client, "ssiiii", hi->hostname, hi->architecture, hi->ncpu, hi->port, hi->flags, hi->nhostaliases)); } static gfarm_error_t host_info_reply(struct host *h, struct peer *peer, const char *diag) { return (host_info_send(peer_get_conn(peer), h)); } gfarm_error_t gfm_server_host_info_get_common(struct peer *peer, int (*filter)(struct host *, void *), void *closure, const char *diag) { gfarm_error_t e; /* XXX FIXME too long giant lock */ giant_lock(); e = gfm_server_host_generic_get(peer, host_info_reply, filter, closure, filter == NULL, diag); giant_unlock(); return (e); } gfarm_error_t gfm_server_host_info_get_all(struct peer *peer, int from_client, int skip) { static const char diag[] = "GFM_PROTO_HOST_INFO_GET_ALL"; if (skip) return (GFARM_ERR_NO_ERROR); return (gfm_server_host_info_get_common(peer, NULL, NULL, diag)); } static int arch_filter(struct host *h, void *closure) { char *architecture = closure; return (strcmp(h->hi.architecture, architecture) == 0); } gfarm_error_t gfm_server_host_info_get_by_architecture(struct peer *peer, int from_client, int skip) { gfarm_error_t e; char *architecture; static const char diag[] = "GFM_PROTO_HOST_INFO_GET_BY_ARCHITECTURE"; e = gfm_server_get_request(peer, diag, "s", &architecture); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001555, "host_info_get_by_architecture request failure: %s", gfarm_error_string(e)); return (e); } if (skip) { free(architecture); return (GFARM_ERR_NO_ERROR); } e = gfm_server_host_info_get_common(peer, arch_filter, architecture, diag); free(architecture); return (e); } gfarm_error_t gfm_server_host_info_get_by_names_common(struct peer *peer, int from_client, int skip, struct host *(*lookup)(const char *), const char *diag) { struct gfp_xdr *client = peer_get_conn(peer); gfarm_error_t e; gfarm_int32_t nhosts; char *host, **hosts; int i, j, eof, no_memory = 0; struct host *h; e = gfm_server_get_request(peer, diag, "i", &nhosts); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001558, "gfm_server_get_request() failed: %s", gfarm_error_string(e)); return (e); } if (skip) return (GFARM_ERR_NO_ERROR); GFARM_MALLOC_ARRAY(hosts, nhosts); if (hosts == NULL) no_memory = 1; for (i = 0; i < nhosts; i++) { e = gfp_xdr_recv(client, 0, &eof, "s", &host); if (e != GFARM_ERR_NO_ERROR || eof) { gflog_debug(GFARM_MSG_1001559, "gfp_xdr_recv(host) failed: %s", gfarm_error_string(e)); if (e == GFARM_ERR_NO_ERROR) /* i.e. eof */ e = GFARM_ERR_PROTOCOL; if (hosts != NULL) { for (j = 0; j < i; j++) { if (hosts[j] != NULL) free(hosts[j]); } free(hosts); } return (e); } if (hosts == NULL) { free(host); } else { hosts[i] = host; } } if (no_memory) e = gfm_server_put_reply(peer, diag, GFARM_ERR_NO_MEMORY, ""); else e = gfm_server_put_reply(peer, diag, GFARM_ERR_NO_ERROR, ""); if (no_memory || e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001560, "gfp_xdr_recv(host) failed: %s", gfarm_error_string(e)); if (hosts != NULL) { for (i = 0; i < nhosts; i++) { if (hosts[i] != NULL) free(hosts[i]); } free(hosts); } return (e); } /* XXX FIXME too long giant lock */ giant_lock(); for (i = 0; i < nhosts; i++) { h = (*lookup)(hosts[i]); if (h == NULL) { if (debug_mode) gflog_info(GFARM_MSG_1000270, "host lookup <%s>: failed", hosts[i]); e = gfm_server_put_reply(peer, diag, GFARM_ERR_UNKNOWN_HOST, ""); } else { if (debug_mode) gflog_info(GFARM_MSG_1000271, "host lookup <%s>: ok", hosts[i]); e = gfm_server_put_reply(peer, diag, GFARM_ERR_NO_ERROR, ""); if (e == GFARM_ERR_NO_ERROR) e = host_info_send(client, h); } if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001561, "error occurred during process: %s", gfarm_error_string(e)); break; } } for (i = 0; i < nhosts; i++) free(hosts[i]); free(hosts); giant_unlock(); return (e); } gfarm_error_t gfm_server_host_info_get_by_names(struct peer *peer, int from_client, int skip) { return (gfm_server_host_info_get_by_names_common( peer, from_client, skip, host_lookup, "host_info_get_by_names")); } gfarm_error_t gfm_server_host_info_get_by_namealiases(struct peer *peer, int from_client, int skip) { return (gfm_server_host_info_get_by_names_common( peer, from_client, skip, host_namealiases_lookup, "host_info_get_by_namealiases")); } static gfarm_error_t host_info_verify(struct gfarm_host_info *hi, const char *diag) { if (strlen(hi->hostname) > GFARM_HOST_NAME_MAX) { gflog_debug(GFARM_MSG_1002421, "%s: too long hostname: %s", diag, hi->hostname); return (GFARM_ERR_INVALID_ARGUMENT); } if (strlen(hi->architecture) > GFARM_HOST_ARCHITECTURE_NAME_MAX) { gflog_debug(GFARM_MSG_1002422, "%s: %s: too long architecture: %s", diag, hi->hostname, hi->architecture); return (GFARM_ERR_INVALID_ARGUMENT); } if (hi->ncpu < 0) { gflog_debug(GFARM_MSG_1002423, "%s: %s: invalid cpu number: %d", diag, hi->hostname, hi->ncpu); return (GFARM_ERR_INVALID_ARGUMENT); } if (hi->port <= 0 || hi->port >= 65536) { gflog_debug(GFARM_MSG_1002424, "%s: %s: invalid port number: %d", diag, hi->hostname, hi->port); return (GFARM_ERR_INVALID_ARGUMENT); } return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfm_server_host_info_set(struct peer *peer, int from_client, int skip) { gfarm_int32_t e; struct user *user = peer_get_user(peer); gfarm_int32_t ncpu, port, flags; struct gfarm_host_info hi; static const char diag[] = "GFM_PROTO_HOST_INFO_SET"; e = gfm_server_get_request(peer, diag, "ssiii", &hi.hostname, &hi.architecture, &ncpu, &port, &flags); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001562, "host_info_set request failure: %s", gfarm_error_string(e)); return (e); } if (skip) { free(hi.hostname); free(hi.architecture); return (GFARM_ERR_NO_ERROR); } hi.ncpu = ncpu; hi.port = port; hi.flags = flags; /* XXX FIXME missing hostaliases */ hi.nhostaliases = 0; hi.hostaliases = NULL; giant_lock(); if (!from_client || user == NULL || !user_is_admin(user)) { gflog_debug(GFARM_MSG_1001563, "operation is not permitted"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if (host_lookup(hi.hostname) != NULL) { gflog_debug(GFARM_MSG_1001564, "host already exists"); e = GFARM_ERR_ALREADY_EXISTS; } else if ((e = host_info_verify(&hi, diag)) != GFARM_ERR_NO_ERROR) { /* nothing to do */ } else if ((e = host_enter(&hi, NULL)) != GFARM_ERR_NO_ERROR) { /* nothing to do */ } else if ((e = db_host_add(&hi)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001565, "db_host_add() failed: %s", gfarm_error_string(e)); host_remove(hi.hostname); hi.hostname = hi.architecture = NULL; } if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001566, "error occurred during process: %s", gfarm_error_string(e)); if (hi.hostname != NULL) free(hi.hostname); if (hi.architecture != NULL) free(hi.architecture); } giant_unlock(); return (gfm_server_put_reply(peer, diag, e, "")); } gfarm_error_t gfm_server_host_info_modify(struct peer *peer, int from_client, int skip) { gfarm_error_t e; struct user *user = peer_get_user(peer); gfarm_int32_t ncpu, port, flags; struct gfarm_host_info hi; struct host *h; int needs_free = 0; static const char diag[] = "GFM_PROTO_HOST_INFO_MODIFY"; e = gfm_server_get_request(peer, diag, "ssiii", &hi.hostname, &hi.architecture, &ncpu, &port, &flags); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001567, "host_info_modify request failed: %s", gfarm_error_string(e)); return (e); } if (skip) { free(hi.hostname); free(hi.architecture); return (GFARM_ERR_NO_ERROR); } hi.ncpu = ncpu; hi.port = port; hi.flags = flags; /* XXX FIXME missing hostaliases */ /* XXX should we disconnect a back channel to the host? */ giant_lock(); if (!from_client || user == NULL || !user_is_admin(user)) { gflog_debug(GFARM_MSG_1001568, "operation is not permitted"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; needs_free = 1; } else if ((h = host_lookup(hi.hostname)) == NULL) { gflog_debug(GFARM_MSG_1001569, "host does not exists"); e = GFARM_ERR_NO_SUCH_OBJECT; needs_free = 1; } else if ((e = host_info_verify(&hi, diag)) != GFARM_ERR_NO_ERROR) { needs_free = 1; } else if ((e = db_host_modify(&hi, DB_HOST_MOD_ARCHITECTURE|DB_HOST_MOD_NCPU|DB_HOST_MOD_FLAGS, /* XXX */ 0, NULL, 0, NULL)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001570, "db_host_modify failed: %s", gfarm_error_string(e)); needs_free = 1; } else { free(h->hi.architecture); h->hi.architecture = hi.architecture; h->hi.ncpu = hi.ncpu; h->hi.port = hi.port; h->hi.flags = hi.flags; free(hi.hostname); } if (needs_free) { free(hi.hostname); free(hi.architecture); } giant_unlock(); return (gfm_server_put_reply(peer, diag, e, "")); } /* this interface is exported for a use from a private extension */ gfarm_error_t host_info_remove_default(const char *hostname, const char *diag) { gfarm_error_t e, e2; struct host *host; if ((host = host_lookup(hostname)) == NULL) return (GFARM_ERR_NO_SUCH_OBJECT); /* disconnect the back channel */ gflog_info(GFARM_MSG_1002425, "back_channel(%s): disconnecting: host info removed", hostname); host_disconnect(host, NULL); if ((e = host_remove(hostname)) == GFARM_ERR_NO_ERROR) { e2 = db_host_remove(hostname); if (e2 != GFARM_ERR_NO_ERROR) gflog_error(GFARM_MSG_1000272, "%s: db_host_remove: %s", diag, gfarm_error_string(e2)); } return (e); } /* this interface is made as a hook for a private extension */ gfarm_error_t (*host_info_remove)(const char *, const char *) = host_info_remove_default; gfarm_error_t gfm_server_host_info_remove(struct peer *peer, int from_client, int skip) { gfarm_error_t e; struct user *user = peer_get_user(peer); char *hostname; static const char diag[] = "GFM_PROTO_HOST_INFO_REMOVE"; e = gfm_server_get_request(peer, diag, "s", &hostname); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001571, "host_info_remove request failure: %s", gfarm_error_string(e)); return (e); } if (skip) { free(hostname); return (GFARM_ERR_NO_ERROR); } /* * XXX should we remove all file copy entries stored on the * specified host? */ giant_lock(); if (!from_client || user == NULL || !user_is_admin(user)) { gflog_debug(GFARM_MSG_1001572, "operation is not permitted"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else e = host_info_remove(hostname, diag); free(hostname); giant_unlock(); return (gfm_server_put_reply(peer, diag, e, "")); } /* called from fs.c:gfm_server_schedule_file() as well */ gfarm_error_t host_schedule_reply(struct host *h, struct peer *peer, const char *diag) { struct host_status status; gfarm_time_t last_report; gfarm_int32_t report_flags; gfarm_mutex_lock(&h->back_channel_mutex, diag, "schedule_reply"); status = h->status; last_report = h->last_report; report_flags = h->report_flags; gfarm_mutex_unlock(&h->back_channel_mutex, diag, "schedule_reply"); return (gfp_xdr_send(peer_get_conn(peer), "siiillllii", h->hi.hostname, h->hi.port, h->hi.ncpu, (gfarm_int32_t)(status.loadavg_1min * GFM_PROTO_LOADAVG_FSCALE), last_report, status.disk_used, status.disk_avail, (gfarm_int64_t)0 /* rtt_cache_time */, (gfarm_int32_t)0 /* rtt_usec */, report_flags)); } gfarm_error_t host_schedule_reply_all(struct peer *peer, int (*filter)(struct host *, void *), void *closure, const char *diag) { return (gfm_server_host_generic_get(peer, host_schedule_reply, filter, closure, 1, diag)); } gfarm_error_t gfm_server_hostname_set(struct peer *peer, int from_client, int skip) { gfarm_int32_t e; char *hostname; static const char diag[] = "GFM_PROTO_HOSTNAME_SET"; e = gfm_server_get_request(peer, diag, "s", &hostname); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001577, "gfm_server_get_request() failure"); return (e); } if (skip) { free(hostname); return (GFARM_ERR_NO_ERROR); } giant_lock(); if (from_client) { gflog_debug(GFARM_MSG_1001578, "operation is not permitted for from_client"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else e = peer_set_host(peer, hostname); giant_unlock(); free(hostname); return (gfm_server_put_reply(peer, diag, e, "")); } static int up_and_domain_filter(struct host *h, void *d) { const char *domain = d; return (host_is_up(h) && gfarm_host_is_in_domain(host_name(h), domain)); } gfarm_error_t gfm_server_schedule_host_domain(struct peer *peer, int from_client, int skip) { gfarm_int32_t e; char *domain; static const char diag[] = "GFM_PROTO_SCHEDULE_HOST_DOMAIN"; e = gfm_server_get_request(peer, diag, "s", &domain); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001579, "schedule_host_domain request failure: %s", gfarm_error_string(e)); return (e); } if (skip) { free(domain); return (GFARM_ERR_NO_ERROR); } /* XXX FIXME too long giant lock */ giant_lock(); e = host_schedule_reply_all(peer, up_and_domain_filter, domain, diag); giant_unlock(); free(domain); return (e); } gfarm_error_t gfm_server_statfs(struct peer *peer, int from_client, int skip) { gfarm_uint64_t used, avail, files; static const char diag[] = "GFM_PROTO_STATFS"; if (skip) return (GFARM_ERR_NO_ERROR); files = inode_total_num(); gfarm_mutex_lock(&total_disk_mutex, diag, total_disk_diag); used = total_disk_used; avail = total_disk_avail; gfarm_mutex_unlock(&total_disk_mutex, diag, total_disk_diag); return (gfm_server_put_reply(peer, diag, GFARM_ERR_NO_ERROR, "lll", used, avail, files)); } #endif /* TEST */ gfarm-2.4.1/server/gfmd/back_channel.c0000644000000000000000000006516311507222724016304 0ustar rootroot/* * $Id$ */ #include #include #include #include #include #include #include #include #include #include "gfutil.h" #include "thrsubr.h" #include "gfp_xdr.h" #include "gfm_proto.h" #include "gfs_proto.h" #include "auth.h" #include "config.h" #include "peer.h" #include "subr.h" #include "thrpool.h" #include "callout.h" #include "host.h" #include "inode.h" #include "dead_file_copy.h" #include "back_channel.h" struct thread_pool *back_channel_recv_thread_pool; struct thread_pool *back_channel_send_thread_pool; /* * responsibility to call host_disconnect(): * * back_channel_main() is responsible for threads in * back_channel_recv_thread_pool. * * gfs_client_send_request() (and other leaf functions) is responsible * for threads in back_channel_send_thread_pool. * * gfm_async_server_put_reply() should be responsible for threads in * back_channel_send_thread_pool too, but currently it's not because * it's called by threads in back_channel_recv_thread_pool. XXX FIXME */ static void back_channel_disconnect_request(struct host *host, struct peer *peer, const char *proto, const char *op, const char *condition) { gflog_error(GFARM_MSG_1002435, "back_channel(%s) %s %s: disconnecting: %s", host_name(host), proto, op, condition); host_disconnect_request(host, peer); } static void back_channel_already_disconnected_message(struct host *host, struct peer *peer, const char *proto, const char *op, const char *condition) { gflog_debug(GFARM_MSG_1002436, "back_channel(%s) %s %s: already disconnected: %s", host_name(host), proto, op, condition); } /* host_receiver_lock() must be already called here by back_channel_main() */ static gfarm_error_t gfm_async_server_get_request(struct peer *peer, size_t size, const char *diag, const char *format, ...) { struct gfp_xdr *client = peer_get_conn(peer); va_list ap; gfarm_error_t e; if (debug_mode) gflog_info(GFARM_MSG_1002274, "%s: <%s> back_channel start receiving", host_name(peer_get_host(peer)), diag); va_start(ap, format); e = gfp_xdr_vrecv_request_parameters(client, 0, &size, format, &ap); va_end(ap); if (e != GFARM_ERR_NO_ERROR) gflog_error(GFARM_MSG_1001980, "async server %s receiving parameter: %s", diag, gfarm_error_string(e)); return (e); } /* XXX FIXME: currently called by threads in back_channel_recv_thread_pool */ static gfarm_error_t gfm_async_server_put_reply(struct host *host, struct peer *peer0, gfp_xdr_xid_t xid, const char *diag, gfarm_error_t errcode, char *format, ...) { gfarm_error_t e; struct peer *peer; struct gfp_xdr *client; va_list ap; if (debug_mode) gflog_info(GFARM_MSG_1002275, "%s: <%s> back_channel sending reply: %d", host_name(host), diag, (int)errcode); /* * Since this is a reply, the peer is probably living, * thus, not using peer_sender_trylock() is mostly ok. */ if ((e = host_sender_lock(host, &peer)) != GFARM_ERR_NO_ERROR) return (e); if (peer != peer0) return (GFARM_ERR_CONNECTION_ABORTED); client = peer_get_conn(peer); va_start(ap, format); e = gfp_xdr_vsend_async_result(client, xid, errcode, format, &ap); va_end(ap); if (e == GFARM_ERR_NO_ERROR) e = gfp_xdr_flush(client); host_sender_unlock(host, peer); if (e != GFARM_ERR_NO_ERROR) gflog_error(GFARM_MSG_1001981, "async server %s receiving parameter: %s", diag, gfarm_error_string(e)); return (e); } /* * synchronous mode of back_channel is only used before gfarm-2.4.0 */ static gfarm_error_t gfs_client_send_request(struct host *host, struct peer *peer0, const char *diag, gfarm_int32_t (*result_callback)(void *, void *, size_t), void (*disconnect_callback)(void *, void *), void *closure, gfarm_int32_t command, const char *format, ...) { gfarm_error_t e; struct peer *peer; gfp_xdr_async_peer_t async; struct gfp_xdr *server; va_list ap; if (debug_mode) gflog_info(GFARM_MSG_1002276, "%s: <%s> back_channel sending request(%d)", host_name(host), diag, command); e = host_sender_trylock(host, &peer); if (e != GFARM_ERR_NO_ERROR) { if (e == GFARM_ERR_DEVICE_BUSY) { gflog_debug(GFARM_MSG_1002437, "back_channel(%s) %s (command %d) request: " "sending busy", host_name(host), diag, command); host_peer_busy(host); } else /* host_disconnect_request() is already called */ back_channel_already_disconnected_message(host, peer, diag, "request", "sending busy"); return (e); } /* if (peer0 == NULL), the caller doesn't care the connection */ if (peer0 != NULL && peer != peer0) { host_sender_unlock(host, peer); gflog_debug(GFARM_MSG_1002438, "back_channel(%s) %s (command %d) request: " "gfsd was reconnected", host_name(host), diag, command); return (GFARM_ERR_CONNECTION_ABORTED); } host_peer_unbusy(host); async = peer_get_async(peer); server = peer_get_conn(peer); va_start(ap, format); if (async != NULL) { /* is asynchronous mode? */ e = gfp_xdr_vsend_async_request(server, async, result_callback, disconnect_callback, closure, command, format, &ap); } else { /* synchronous mode */ host_set_callback(host, peer, result_callback, disconnect_callback, closure); e = gfp_xdr_vrpc_request(server, command, &format, &ap); if (*format != '\0') { gflog_fatal(GFARM_MSG_1002277, "gfs_client_send_request(%d): " "invalid format character: %c(%x)", command, *format, *format); } if (e == GFARM_ERR_NO_ERROR) e = gfp_xdr_flush(server); } va_end(ap); if (e != GFARM_ERR_NO_ERROR) { /* must be IS_CONNECTION_ERROR(e) */ back_channel_disconnect_request(host, peer, diag, "request", gfarm_error_string(e)); host_sender_unlock(host, peer); return (e); } if (async != NULL) /* is asynchronous mode? */ host_sender_unlock(host, peer); return (GFARM_ERR_NO_ERROR); } /* host_receiver_lock() must be already called here by back_channel_main() */ static gfarm_error_t gfs_client_recv_vresult(struct peer *peer, struct host *host, size_t size, const char *diag, const char **formatp, va_list *app, gfarm_error_t *errcodep) { gfarm_error_t e; gfp_xdr_async_peer_t async = peer_get_async(peer); gfarm_int32_t errcode; struct gfp_xdr *conn = peer_get_conn(peer); if (debug_mode) gflog_info(GFARM_MSG_1002279, "%s: <%s> back_channel receiving reply", host_name(host), diag); if (async != NULL) { /* is async mode? */ e = gfp_xdr_vrpc_result_sized(conn, 0, &size, &errcode, formatp, app); } else { /* synchronous mode */ e = gfp_xdr_vrpc_result(conn, 0, &errcode, formatp, app); host_sender_unlock(host, peer); } if (e != GFARM_ERR_NO_ERROR) { gflog_error(GFARM_MSG_1002280, "back_channel(%s) RPC result: %s", host_name(host), gfarm_error_string(e)); } else if (async != NULL && size != 0) { gflog_error(GFARM_MSG_1002281, "back_channel(%s) RPC result: protocol residual %d", host_name(host), (int)size); if ((e = gfp_xdr_purge(conn, 0, size)) != GFARM_ERR_NO_ERROR) gflog_warning(GFARM_MSG_1001985, "back_channel(%s) RPC result: skipping: %s", host_name(host), gfarm_error_string(e)); e = GFARM_ERR_PROTOCOL; } else { /* e == GFARM_ERR_NO_ERROR */ *errcodep = errcode; } return (e); } static gfarm_error_t gfs_client_recv_result_and_error(struct peer *peer, struct host *host, size_t size, gfarm_error_t *errcodep, const char *diag, const char *format, ...) { gfarm_error_t e; va_list ap; va_start(ap, format); e = gfs_client_recv_vresult(peer, host, size, diag, &format, &ap, errcodep); va_end(ap); return (e); } static gfarm_error_t gfs_client_recv_result(struct peer *peer, struct host *host, size_t size, const char *diag, const char *format, ...) { gfarm_error_t e, errcode; va_list ap; va_start(ap, format); e = gfs_client_recv_vresult(peer, host, size, diag, &format, &ap, &errcode); va_end(ap); if (e != GFARM_ERR_NO_ERROR) return (e); /* * We just use gfarm_error_t as the errcode, * Note that GFARM_ERR_NO_ERROR == 0. */ return (errcode); } static void gfs_client_status_disconnect_or_message(struct host *host, struct peer *peer, const char *proto, const char *op, const char *condition) { if (peer != NULL) { /* to make the race condition harmless */ back_channel_disconnect_request(host, peer, proto, op, condition); } else { back_channel_already_disconnected_message(host, peer, proto, op, condition); } } static gfarm_int32_t gfs_client_status_result(void *p, void *arg, size_t size) { gfarm_error_t e; struct peer *peer = p; struct host *host = arg; struct host_status st; static const char diag[] = "GFS_PROTO_STATUS"; e = gfs_client_recv_result(peer, host, size, diag, "fffll", &st.loadavg_1min, &st.loadavg_5min, &st.loadavg_15min, &st.disk_used, &st.disk_avail); if (e == GFARM_ERR_NO_ERROR) host_status_update(host, &st); else gfs_client_status_disconnect_or_message(host, peer, diag, "result", gfarm_error_string(e)); return (e); } /* both giant_lock and peer_table_lock are held before calling this function */ static void gfs_client_status_free(void *p, void *arg) { #if 0 struct peer *peer = p; struct host *host = arg; #endif } /* this function is called via callout */ static void * gfs_client_status_request(void *arg) { gfarm_error_t e; struct host *host = arg; struct peer *peer = host_peer(host); static const char diag[] = "GFS_PROTO_STATUS"; if (host_status_reply_is_waiting(host)) { gfs_client_status_disconnect_or_message(host, peer, diag, "request", "no status"); return (NULL); } /* * schedule here instead of the end of gfs_client_status_result(), * because gfs_client_send_request() may block, and we should * detect it at next call of gfs_client_status_request(). */ callout_schedule(host_status_callout(host), gfarm_metadb_heartbeat_interval * 1000000); e = gfs_client_send_request(host, NULL, diag, gfs_client_status_result, gfs_client_status_free, host, GFS_PROTO_STATUS, ""); if (e == GFARM_ERR_DEVICE_BUSY) { if (host_status_callout_retry(host)) return (NULL); gfs_client_status_disconnect_or_message(host, peer, diag, "request", "status rpc unresponsive"); return (NULL); } if (e == GFARM_ERR_NO_ERROR) { host_status_reply_waiting(host); } else { gflog_error(GFARM_MSG_1001986, "gfs_client_status_request: %s", gfarm_error_string(e)); } /* this return value won't be used, because this thread is detached */ return (NULL); } static gfarm_int32_t gfs_client_fhremove_result(void *p, void *arg, size_t size) { struct peer *peer = p; struct dead_file_copy *dfc = arg; struct host *host = dead_file_copy_get_host(dfc); gfarm_error_t e; static const char diag[] = "GFS_PROTO_FHREMOVE"; e = gfs_client_recv_result(peer, host, size, diag, ""); removal_finishedq_enqueue(dfc, e); return (e); } /* both giant_lock and peer_table_lock are held before calling this function */ static void gfs_client_fhremove_free(void *p, void *arg) { #if 0 struct peer *peer = p; #endif struct dead_file_copy *dfc = arg; removal_finishedq_enqueue(dfc, GFARM_ERR_CONNECTION_ABORTED); } static void * gfs_client_fhremove_request(void *closure) { struct dead_file_copy *dfc = closure; gfarm_ino_t ino = dead_file_copy_get_ino(dfc); gfarm_int64_t gen = dead_file_copy_get_gen(dfc); struct host *host = dead_file_copy_get_host(dfc); gfarm_error_t e; static const char diag[] = "GFS_PROTO_FHREMOVE"; e = gfs_client_send_request(host, NULL, diag, gfs_client_fhremove_result, gfs_client_fhremove_free, dfc, GFS_PROTO_FHREMOVE, "ll", ino, gen); if (e == GFARM_ERR_NO_ERROR) { return (NULL); } else if (e == GFARM_ERR_DEVICE_BUSY) { gflog_info(GFARM_MSG_1002284, "%s(%lld, %lld, %s): " "busy, waiting for some time", diag, (long long)dead_file_copy_get_ino(dfc), (long long)dead_file_copy_get_gen(dfc), host_name(dead_file_copy_get_host(dfc))); host_busyq_enqueue(dfc); } else { removal_finishedq_enqueue(dfc, e); } /* this return value won't be used, because this thread is detached */ return (NULL); } static void * remover(void *closure) { struct dead_file_copy *dfc; for (;;) { dfc = removal_pendingq_dequeue(); if (host_is_up(dead_file_copy_get_host(dfc))) thrpool_add_job(back_channel_send_thread_pool, gfs_client_fhremove_request, dfc); else /* make this dfcstate_deferred */ removal_finishedq_enqueue(dfc, GFARM_ERR_NO_ROUTE_TO_HOST); } /*NOTREACHED*/ return (NULL); } /* * GFS_PROTO_REPLICATION_REQUEST didn't exist before gfarm-2.4.0 */ static gfarm_int32_t gfs_client_replication_request_result(void *p, void *arg, size_t size) { struct peer *peer = p; struct file_replicating *fr = arg; gfarm_int64_t handle; struct host *dst; gfarm_ino_t ino; gfarm_int64_t gen; gfarm_error_t e, errcode, e2; static const char diag[] = "GFS_PROTO_REPLICATION_REQUEST result"; /* XXX FIXME, src_err and dst_err should be passed separately */ e = gfs_client_recv_result_and_error(peer, fr->dst, size, &errcode, diag, "l", &handle); /* XXX FIXME: deadlock */ giant_lock(); if (e == GFARM_ERR_NO_ERROR && errcode == GFARM_ERR_NO_ERROR) file_replicating_set_handle(fr, handle); else { dst = fr->dst; ino = inode_get_number(fr->inode); gen = fr->igen; if (e != GFARM_ERR_NO_ERROR) e2 = peer_replicated(peer, dst, ino, gen, -1, 0, e, -1); else if (IS_CONNECTION_ERROR(errcode)) e2 = peer_replicated(peer, dst, ino, gen, -1, errcode, 0, -1); else e2 = peer_replicated(peer, dst, ino, gen, -1, 0, errcode, -1); gflog_debug(GFARM_MSG_1002359, "%s: (%s, %lld:%lld): aborted: %s - (%s, %s)", diag, host_name(dst), (long long)ino, (long long)gen, gfarm_error_string(errcode), gfarm_error_string(e), gfarm_error_string(e2)); } giant_unlock(); return (e); } /* both giant_lock and peer_table_lock are held before calling this function */ static void gfs_client_replication_request_free(void *p, void *arg) { struct peer *peer = p; struct file_replicating *fr = arg; struct host *dst = fr->dst; gfarm_ino_t ino = inode_get_number(fr->inode); gfarm_int64_t gen = fr->igen; gfarm_error_t e; static const char diag[] = "GFS_PROTO_REPLICATION_REQUEST free"; e = peer_replicated(peer, dst, ino, gen, -1, 0, GFARM_ERR_CONNECTION_ABORTED, -1); gflog_debug(GFARM_MSG_1002360, "%s: (%s, %lld:%lld): connection aborted: %s", diag, host_name(dst), (long long)ino, (long long)gen, gfarm_error_string(e)); } struct gfs_client_replication_request_arg { char *srchost; int srcport; struct host *dst; gfarm_ino_t ino; gfarm_int64_t gen; struct file_replicating *fr; }; static void * gfs_client_replication_request_request(void *closure) { struct gfs_client_replication_request_arg *arg = closure; char *srchost = arg->srchost; gfarm_int32_t srcport = arg->srcport; struct host *dst = arg->dst; gfarm_ino_t ino = arg->ino; gfarm_int64_t gen = arg->gen; struct file_replicating *fr = arg->fr; struct peer *peer = file_replicating_get_peer(fr); gfarm_error_t e, e2; static const char diag[] = "GFS_PROTO_REPLICATION_REQUEST request"; free(arg); e = gfs_client_send_request(dst, peer, diag, gfs_client_replication_request_result, gfs_client_replication_request_free, fr, GFS_PROTO_REPLICATION_REQUEST, "sill", srchost, srcport, ino, gen); if (e != GFARM_ERR_NO_ERROR) { giant_lock(); /* XXX FIXME: deadlock */ e2 = peer_replicated(peer, dst, ino, gen, -1, 0, e, -1); giant_unlock(); gflog_debug(GFARM_MSG_1002361, "%s: %s->(%s, %lld:%lld): aborted: %s (%s)", diag, srchost, host_name(dst), (long long)ino, (long long)gen, gfarm_error_string(e), gfarm_error_string(e2)); } /* this return value won't be used, because this thread is detached */ return (NULL); } gfarm_error_t async_back_channel_replication_request(char *srchost, int srcport, struct host *dst, gfarm_ino_t ino, gfarm_int64_t gen, struct file_replicating *fr) { struct gfs_client_replication_request_arg *arg; /* XXX FIXME: check host_is_up(dst) */ GFARM_MALLOC(arg); if (arg == NULL) { gflog_error(GFARM_MSG_1001988, "async_back_channel_replication_request: no memory"); return (GFARM_ERR_NO_MEMORY); } arg->srchost = srchost; arg->srcport = srcport; arg->dst = dst; arg->ino = ino; arg->gen = gen; arg->fr = fr; thrpool_add_job(back_channel_send_thread_pool, gfs_client_replication_request_request, arg); return (GFARM_ERR_NO_ERROR); } /* * SLEEPS: shoundn't * but gfm_async_server_put_reply is calling peer_sender_lock() XXX FIXME */ static gfarm_error_t gfm_async_server_replication_result(struct host *host, struct peer *peer, gfp_xdr_xid_t xid, size_t size) { gfarm_error_t e; gfarm_int32_t src_errcode, dst_errcode; gfarm_ino_t ino; gfarm_int64_t gen; gfarm_int64_t handle; gfarm_off_t filesize; static const char diag[] = "GFM_PROTO_REPLICATION_RESULT"; /* * The reason why this protocol returns not only handle * but also ino and gen is because it's possible that * this request may arrive earlier than the result of * GFS_PROTO_REPLICATION_REQUEST due to race condition. */ if ((e = gfm_async_server_get_request(peer, size, diag, "llliil", &ino, &gen, &handle, &src_errcode, &dst_errcode, &filesize)) != GFARM_ERR_NO_ERROR) return (e); giant_lock(); /* XXX FIXME: deadlock */ e = peer_replicated(peer, host, ino, gen, handle, src_errcode, dst_errcode, filesize); giant_unlock(); /* * XXX FIXME * There is a slight possibility of deadlock in the following call, * because currently this is called in the context * of back_channel_recv_thread_pool, * although it unlikely blocks, since this is a reply. */ return (gfm_async_server_put_reply(host, peer, xid, diag, e, "")); } static gfarm_error_t async_back_channel_protocol_switch(struct host *host, struct peer *peer, gfp_xdr_xid_t xid, size_t size) { struct gfp_xdr *client = peer_get_conn(peer); gfarm_error_t e = GFARM_ERR_NO_ERROR; gfarm_int32_t request; e = gfp_xdr_recv_request_command(client, 0, &size, &request); if (e != GFARM_ERR_NO_ERROR) return (e); switch (request) { case GFM_PROTO_REPLICATION_RESULT: e = gfm_async_server_replication_result(host, peer, xid, size); break; default: gflog_error(GFARM_MSG_1001989, "(back channel) unknown request %d " "(xid:%d size:%d), reset", (int)request, (int)xid, (int)size); e = gfp_xdr_purge(client, 0, size); if (e != GFARM_ERR_NO_ERROR) return (e); break; } return (e); } static gfarm_error_t async_back_channel_service(struct host *host, struct peer *peer, gfp_xdr_async_peer_t async) { gfarm_error_t e; struct gfp_xdr *conn = peer_get_conn(peer); enum gfp_xdr_msg_type type; gfp_xdr_xid_t xid; size_t size; gfarm_int32_t rv; e = gfp_xdr_recv_async_header(conn, 0, &type, &xid, &size); if (e != GFARM_ERR_NO_ERROR) return (e); switch (type) { case GFP_XDR_TYPE_REQUEST: e = async_back_channel_protocol_switch(host, peer, xid, size); break; case GFP_XDR_TYPE_RESULT: e = gfp_xdr_callback_async_result(async, peer, xid, size, &rv); if (e != GFARM_ERR_NO_ERROR) { gflog_warning(GFARM_MSG_1001990, "(back channel) unknown reply " "xid:%d size:%d", (int)xid, (int)size); e = gfp_xdr_purge(conn, 0, size); if (e != GFARM_ERR_NO_ERROR) gflog_error(GFARM_MSG_1001991, "skipping %d bytes: %s", (int)size, gfarm_error_string(e)); } else if (IS_CONNECTION_ERROR(rv)) { e = rv; } break; default: gflog_fatal(GFARM_MSG_1001992, "back_channel_service: type %d", type); /*NOTREACHED*/ e = GFARM_ERR_PROTOCOL; break; } return (e); } #ifdef COMPAT_GFARM_2_3 static gfarm_error_t sync_back_channel_service(struct host *host, struct peer *peer) { gfarm_int32_t (*result_callback)(void *, void *, size_t); void *arg; if (!host_get_result_callback(host, peer, &result_callback, &arg)) { gflog_error(GFARM_MSG_1002285, "extra data from back channel"); return (GFARM_ERR_PROTOCOL); } /* * the 3rd argument of (*callback)() (i.e. 0) is dummy, * but it must be a value except GFP_XDR_ASYNC_SIZE_FREED. */ return ((*result_callback)(peer, arg, 0)); } /* * it's ok to call this with an async peer, * because host_get_disconnect_callback() returns FALSE in that case. */ static void sync_back_channel_free(struct host *host) { void (*disconnect_callback)(void *, void *); struct peer *peer; void *arg; if (host_get_disconnect_callback(host, &disconnect_callback, &peer, &arg)) { (*disconnect_callback)(peer, arg); } } #endif static void * back_channel_main(void *arg) { struct peer *peer0 = arg, *peer; struct host *host = peer_get_host(peer0);; gfp_xdr_async_peer_t async; gfarm_error_t e; e = host_receiver_lock(host, &peer); if (e != GFARM_ERR_NO_ERROR) { /* already disconnected */ gflog_error(GFARM_MSG_1002327, "back_channel(%s): aborted: %s", host_name(host), gfarm_error_string(e)); sync_back_channel_free(host); peer_invoked(peer0); return (NULL); } /* * the following ensures that the bach_channel connection is * not switched to another one. */ if (peer != peer0) { gflog_error(GFARM_MSG_1002328, "back_channel(%s): aborted: unexpected peer switch", host_name(host)); sync_back_channel_free(host); host_receiver_unlock(host, peer); peer_invoked(peer0); return (NULL); } /* now, host_receiver_lock() is protecting this peer */ peer_invoked(peer); async = peer_get_async(peer); do { if (peer_had_protocol_error(peer)) { /* host_disconnect*() must be already called */ sync_back_channel_free(host); host_receiver_unlock(host, peer); gflog_debug(GFARM_MSG_1002439, "back_channel(%s): host_disconnect was called", host_name(host)); return (NULL); } #ifdef COMPAT_GFARM_2_3 if (async != NULL) { #endif e = async_back_channel_service(host, peer, async); #ifdef COMPAT_GFARM_2_3 } else { e = sync_back_channel_service(host, peer); } #endif if (IS_CONNECTION_ERROR(e)) { if (e == GFARM_ERR_UNEXPECTED_EOF) { gflog_error(GFARM_MSG_1002286, "back_channel(%s): disconnected", host_name(host)); } else { gflog_error(GFARM_MSG_1002287, "back_channel(%s): " "request error, reset: %s", host_name(host), gfarm_error_string(e)); } sync_back_channel_free(host); host_disconnect_request(host, peer); host_receiver_unlock(host, peer); return (NULL); } } while (gfp_xdr_recv_is_ready(peer_get_conn(peer))); /* * NOTE: * We should use do...while loop for the above gfp_xdr_recv_is_ready() * case, instead of thrpool_add_job(). * See the comment in protocol_main() for detail. */ peer_watch_access(peer); host_receiver_unlock(host, peer); /* this return value won't be used, because this thread is detached */ return (NULL); } /* both giant_lock and peer_table_lock are held before calling this function */ static void back_channel_async_peer_free(struct peer *peer, gfp_xdr_async_peer_t async) { gfp_xdr_async_peer_free(async, peer); } static gfarm_error_t gfm_server_switch_back_channel_common(struct peer *peer, int from_client, int version, const char *diag) { gfarm_error_t e = GFARM_ERR_NO_ERROR, e2; struct host *host; gfp_xdr_async_peer_t async = NULL; #ifdef __GNUC__ /* workaround gcc warning: might be used uninitialized */ host = NULL; #endif giant_lock(); if (from_client) { gflog_debug(GFARM_MSG_1001995, "Operation not permitted: from_client"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if ((host = peer_get_host(peer)) == NULL) { gflog_debug(GFARM_MSG_1001996, "Operation not permitted: peer_get_host() failed"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if (version >= GFS_PROTOCOL_VERSION_V2_4 && (e = gfp_xdr_async_peer_new(&async)) != GFARM_ERR_NO_ERROR) { gflog_error(GFARM_MSG_1002288, "%s: gfp_xdr_async_peer_new(): %s", diag, gfarm_error_string(e)); } giant_unlock(); if (version < GFS_PROTOCOL_VERSION_V2_4) e2 = gfm_server_put_reply(peer, diag, e, ""); else e2 = gfm_server_put_reply(peer, diag, e, "i", 0 /*XXX FIXME*/); if (e2 != GFARM_ERR_NO_ERROR) return (e2); if (debug_mode) gflog_debug(GFARM_MSG_1000404, "gfp_xdr_flush"); e2 = gfp_xdr_flush(peer_get_conn(peer)); if (e2 != GFARM_ERR_NO_ERROR) gflog_warning(GFARM_MSG_1000405, "%s: protocol flush: %s", diag, gfarm_error_string(e2)); else if (e == GFARM_ERR_NO_ERROR) { peer_set_async(peer, async); peer_set_protocol_handler(peer, back_channel_recv_thread_pool, back_channel_main); if (host_is_up(host)) /* throw away old connetion */ { gflog_warning(GFARM_MSG_1002440, "back_channel(%s): switching to new connection", host_name(host)); host_disconnect(host, NULL); } giant_lock(); host_peer_set(host, peer, version); giant_unlock(); peer_watch_access(peer); callout_setfunc(host_status_callout(host), back_channel_send_thread_pool, gfs_client_status_request, host); thrpool_add_job( back_channel_send_thread_pool, gfs_client_status_request, host); } return (e2); } #ifdef COMPAT_GFARM_2_3 gfarm_error_t gfm_server_switch_back_channel(struct peer *peer, int from_client, int skip) { gfarm_error_t e; static const char diag[] = "GFM_PROTO_SWITCH_BACK_CHANNEL"; if (skip) return (GFARM_ERR_NO_ERROR); e = gfm_server_switch_back_channel_common(peer, from_client, GFS_PROTOCOL_VERSION_V2_3, diag); return (e); } #endif /* defined(COMPAT_GFARM_2_3) */ gfarm_error_t gfm_server_switch_async_back_channel(struct peer *peer, int from_client, int skip) { gfarm_error_t e; gfarm_int32_t version; gfarm_int64_t gfsd_cookie; static const char diag[] = "GFM_PROTO_SWITCH_ASYNC_BACK_CHANNEL"; e = gfm_server_get_request(peer, diag, "il", &version, &gfsd_cookie); if (e != GFARM_ERR_NO_ERROR) return (e); if (skip) return (GFARM_ERR_NO_ERROR); e = gfm_server_switch_back_channel_common(peer, from_client, version, diag); return (e); } void back_channel_init(void) { gfarm_error_t e; peer_set_free_async(back_channel_async_peer_free); /* XXX FIXME: use different config parameter */ back_channel_recv_thread_pool = thrpool_new( gfarm_metadb_thread_pool_size, gfarm_metadb_job_queue_length, "receiving from filesystem nodes"); back_channel_send_thread_pool = thrpool_new( gfarm_metadb_thread_pool_size, gfarm_metadb_job_queue_length, "sending to filesystem nodes"); if (back_channel_recv_thread_pool == NULL || back_channel_send_thread_pool == NULL) gflog_fatal(GFARM_MSG_1001998, "filesystem node thread pool size:" "%d, queue length:%d: no memory", gfarm_metadb_thread_pool_size, gfarm_metadb_job_queue_length); e = create_detached_thread(remover, NULL); if (e != GFARM_ERR_NO_ERROR) gflog_fatal(GFARM_MSG_1002289, "create_detached_thread(remover): %s", gfarm_error_string(e)); } gfarm-2.4.1/server/gfmd/Makefile0000644000000000000000000000405011507222724015174 0ustar rootroot# $Id: Makefile 4883 2010-09-30 13:19:12Z n-soda $ top_builddir = ../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk include $(srcdir)/../Makefile.inc CFLAGS = $(pthread_includes) $(COMMON_CFLAGS) \ -I$(GFUTIL_SRCDIR) -I$(GFSL_SRCDIR) -I$(GFARMLIB_SRCDIR) -I$(srcdir) \ $(metadb_client_includes) $(optional_cflags) \ -DGFMD_CONFIG='"$(sysconfdir)/gfmd.conf"' LDLIBS = $(COMMON_LDFLAGS) $(GFARMLIB) $(metadb_client_libs) $(LIBS) DEPLIBS = $(DEPGFARMLIB) PROGRAM = gfmd LDAP_SRCS = db_ldap.c LDAP_OBJS = db_ldap.lo POSTGRESQL_SRCS = db_pgsql.c POSTGRESQL_OBJS = db_pgsql.lo PRIVATE_RULE = $(PRIVATE_SERVER_GFMD_RULE) PRIVATE_SRCS = $(PRIVATE_SERVER_GFMD_SRCS) PRIVATE_FILES = $(PRIVATE_SERVER_GFMD_FILES) PRIVATE_OBJS = $(PRIVATE_SERVER_GFMD_OBJS) PUBLIC_RULE = /dev/null PUBLIC_SRCS = PUBLIC_OBJS = SRCS = gfmd.c thrpool.c callout.c \ subr.c user.c group.c host.c peer.c dead_file_copy.c \ process.c job.c \ dir.c inode.c fs.c back_channel.c \ db_access.c db_common.c db_none.c quota.c xattr.c \ $(ldap_srcs) $(postgresql_srcs) $(optional_srcs) OBJS = gfmd.o thrpool.o callout.o \ subr.o user.o group.o host.o peer.o dead_file_copy.o \ process.o job.o \ dir.o inode.o fs.o back_channel.o \ db_access.o db_common.o db_none.o quota.o xattr.o \ $(ldap_objs) $(postgresql_objs) $(optional_objs) all: $(PROGRAM) include $(top_srcdir)/makes/prog.mk include $(top_srcdir)/makes/gflog.mk ### $(OBJS): $(DEPGFARMINC) \ $(GFUTIL_SRCDIR)/gfutil.h \ $(GFUTIL_SRCDIR)/hash.h \ $(GFUTIL_SRCDIR)/id_table.h \ $(GFUTIL_SRCDIR)/tree.h \ $(GFUTIL_SRCDIR)/thrsubr.h \ $(GFARMLIB_SRCDIR)/patmatch.h \ $(GFARMLIB_SRCDIR)/gfp_xdr.h \ $(GFARMLIB_SRCDIR)/io_fd.h \ $(GFARMLIB_SRCDIR)/sockopt.h \ $(GFARMLIB_SRCDIR)/auth.h \ $(GFARMLIB_SRCDIR)/config.h \ $(GFARMLIB_SRCDIR)/gfm_proto.h \ $(GFARMLIB_SRCDIR)/gfj_client.h \ $(GFARMLIB_SRCDIR)/timespec.h \ thrpool.h subr.h callout.h \ user.h group.h host.h peer.h dead_file_copy.h process.h job.h \ dir.h inode.h fs.h back_channel.h protocol_state.h quota.h xattr.h include $(optional_rule) gfarm-2.4.1/server/gfmd/inode.c0000644000000000000000000032763011507222724015012 0ustar rootroot/* * $Id: inode.c 5018 2010-12-30 08:35:34Z tatebe $ */ #include #include #include #include /* sprintf */ #include #include #include #include #define GFARM_INTERNAL_USE #include #include #include #include #include "gfutil.h" #include "thrsubr.h" #include "timespec.h" #include "patmatch.h" #include "gfm_proto.h" #include "config.h" #include "quota.h" #include "subr.h" #include "db_access.h" #include "host.h" #include "user.h" #include "group.h" #include "dir.h" #include "inode.h" #include "dead_file_copy.h" #include "process.h" /* struct file_opening */ #include "xattr_info.h" #include "back_channel.h" #include "auth.h" /* for "peer.h" */ #include "peer.h" /* peer_reset_pending_new_generation() */ #include "gfmd.h" /* resuming_*() */ #define ROOT_INUMBER 2 #define INODE_TABLE_SIZE_INITIAL 1000 #define INODE_TABLE_SIZE_MULTIPLY 2 #define INODE_MODE_FREE 0 /* struct inode:i_mode */ #define GFS_MAX_DIR_DEPTH 256 struct file_copy { struct file_copy *host_next; struct host *host; int flags; /* 0, if there is ongoing replication about lastest gen */ #define FILE_COPY_VALID 1 #define FILE_COPY_BEING_REMOVED 2 }; #define FILE_COPY_IS_VALID(fc) \ (((fc)->flags & FILE_COPY_VALID) != 0) #define FILE_COPY_IS_BEING_REMOVED(fc) \ (((fc)->flags & FILE_COPY_BEING_REMOVED) != 0) /* * !FILE_COPY_IS_VALID() means either * the replica is being created (incomplete). * or * the replica was complete, but being removed. * * invariant: * if (FILE_COPY_IS_BEING_REMOVED(fc)) { * assert(!FILE_COPY_IS_VALID(fc)); * assert(remove_replica_entity() is already called); * } */ struct xattr_entry { struct xattr_entry *prev, *next; char *name; void *cached_attrvalue; int cached_attrsize; }; struct xattrs { struct xattr_entry *head, *tail; }; struct inode { gfarm_ino_t i_number; gfarm_uint64_t i_gen; gfarm_uint64_t i_nlink; gfarm_uint64_t i_nlink_ini; gfarm_off_t i_size; struct user *i_user; struct group *i_group; struct gfarm_timespec i_atimespec; gfarm_mode_t i_mode; struct gfarm_timespec i_mtimespec; struct gfarm_timespec i_ctimespec; struct xattrs i_xattrs, i_xmlattrs; union { struct inode_free_link { struct inode *prev, *next; } l; struct inode_common_data { union inode_type_specific_data { struct inode_file { struct file_copy *copies; struct checksum *cksum; struct inode_replicating_state *rstate; } f; struct inode_dir { Dir entries; } d; struct inode_symlink { char *source_path; } l; } s; struct inode_open_state *state; } c; } u; }; struct checksum { char *type; size_t len; char sum[1]; }; struct inode_open_state { struct file_opening openings; /* dummy header */ union inode_state_type_specific { struct inode_state_file { struct file_opening *cksum_owner; struct event_waiter *event_waiters; struct peer *event_source; struct gfarm_timespec last_update; int writers; } f; } u; }; struct inode_replicating_state { struct file_replicating replicating_hosts; /* dummy header */ }; struct inode **inode_table = NULL; gfarm_ino_t inode_table_size = 0; gfarm_ino_t inode_free_index = ROOT_INUMBER; struct inode inode_free_list; /* dummy header of doubly linked circular list */ int inode_free_list_initialized = 0; static gfarm_uint64_t total_num_inodes; static pthread_mutex_t total_num_inodes_mutex = PTHREAD_MUTEX_INITIALIZER; static const char total_num_inodes_diag[] = "total_num_inodes_mutex"; static char dot[] = "."; static char dotdot[] = ".."; #define DOT_LEN (sizeof(dot) - 1) #define DOTDOT_LEN (sizeof(dotdot) - 1) static char lost_found[] = "lost+found"; void inode_for_each_file_copies( struct inode *inode, void (*func)(struct inode *inode, struct file_copy *copy, void *closure), void *closure) { struct file_copy *copy; assert(inode_is_file(inode)); for (copy = inode->u.c.s.f.copies; copy != NULL; copy = copy->host_next) { (*func)(inode, copy, closure); } } void inode_for_each_file_opening( struct inode *inode, void (*func)(int openflag, struct host *spool_host, void *closure), void *closure) { struct file_opening *fo; struct inode_open_state *ios = inode->u.c.state; assert(inode_is_file(inode)); if (ios == NULL) return; for (fo = ios->openings.opening_next; fo != &ios->openings; fo = fo->opening_next) { (*func)(fo->flag, fo->u.f.spool_host, closure); } } struct host * file_copy_host(struct file_copy *file_copy) { return (file_copy->host); } int file_copy_is_valid(struct file_copy *file_copy) { return (FILE_COPY_IS_VALID(file_copy)); } gfarm_uint64_t inode_total_num(void) { gfarm_uint64_t num_inodes; static const char diag[] = "inode_total_num"; gfarm_mutex_lock(&total_num_inodes_mutex, diag, total_num_inodes_diag); num_inodes = total_num_inodes; gfarm_mutex_unlock(&total_num_inodes_mutex, diag, total_num_inodes_diag); return (num_inodes); } void inode_cksum_clear(struct inode *inode) { struct inode_open_state *ios = inode->u.c.state; assert(inode_is_file(inode)); if (ios != NULL && ios->u.f.cksum_owner != NULL) ios->u.f.cksum_owner = NULL; if (inode->u.c.s.f.cksum != NULL) { free(inode->u.c.s.f.cksum); inode->u.c.s.f.cksum = NULL; } } void inode_cksum_remove(struct inode *inode) { gfarm_error_t e; if (inode->u.c.s.f.cksum != NULL) { e = db_inode_cksum_remove(inode->i_number); if (e != GFARM_ERR_NO_ERROR) gflog_error(GFARM_MSG_1000297, "db_inode_cksum_remove(%lld): %s", (unsigned long long)inode->i_number, gfarm_error_string(e)); } inode_cksum_clear(inode); } void inode_cksum_invalidate(struct file_opening *fo) { struct inode_open_state *ios = fo->inode->u.c.state; struct file_opening *o; for (o = ios->openings.opening_next; o != &ios->openings; o = o->opening_next) { if (o != fo) o->flag |= GFARM_FILE_CKSUM_INVALIDATED; } } static gfarm_error_t inode_cksum_set_internal(struct inode *inode, const char *cksum_type, size_t cksum_len, const char *cksum) { struct checksum *cs; size_t size; int overflow = 0; #ifdef __GNUC__ /* workaround gcc warning: might be used uninitialized */ cs = NULL; #endif size = gfarm_size_add(&overflow, sizeof(*cs) - sizeof(cs->sum) + strlen(cksum_type) + 1, cksum_len); if (!overflow) cs = malloc(size); if (overflow || cs == NULL) { gflog_debug(GFARM_MSG_1001712, "allocation of 'size' failed or overflow"); return (GFARM_ERR_NO_MEMORY); } cs->type = cs->sum + cksum_len; cs->len = cksum_len; memcpy(cs->sum, cksum, cksum_len); strcpy(cs->type, cksum_type); inode->u.c.s.f.cksum = cs; return(GFARM_ERR_NO_ERROR); } gfarm_error_t inode_cksum_set(struct file_opening *fo, const char *cksum_type, size_t cksum_len, const char *cksum, gfarm_int32_t flags, struct gfarm_timespec *mtime) { gfarm_error_t e; struct inode *inode = fo->inode; struct inode_open_state *ios = inode->u.c.state; struct checksum *cs; assert(ios != NULL); if (strlen(cksum_type) > GFM_PROTO_CKSUM_TYPE_MAXLEN) { gflog_debug(GFARM_MSG_1002429, "too long cksum type: \"%s\"", cksum_type); return (GFARM_ERR_INVALID_ARGUMENT); } if (cksum_len > GFM_PROTO_CKSUM_MAXLEN) { gflog_debug(GFARM_MSG_1002430, "too long cksum (type: \"%s\"): %d bytes", cksum_type, (int)cksum_len); return (GFARM_ERR_INVALID_ARGUMENT); } if (!inode_is_file(fo->inode)) { gflog_debug(GFARM_MSG_1001713, "inode type is not file"); return (GFARM_ERR_BAD_FILE_DESCRIPTOR); } if ((fo->flag & GFARM_FILE_CKSUM_INVALIDATED) != 0) { gflog_debug(GFARM_MSG_1001714, "file checksum is invalidated"); return (GFARM_ERR_EXPIRED); } /* writable descriptor has precedence over read-only one */ if (ios->u.f.cksum_owner != NULL && (accmode_to_op(ios->u.f.cksum_owner->flag) & GFS_W_OK) != 0 && (accmode_to_op(fo->flag) & GFS_W_OK) == 0) { gflog_debug(GFARM_MSG_1001715, "writable descriptor has precedence over read-only " "one"); return (GFARM_ERR_EXPIRED); } cs = inode->u.c.s.f.cksum; if (cs == NULL) { e = db_inode_cksum_add(inode->i_number, cksum_type, cksum_len, cksum); } else { e = db_inode_cksum_modify(inode->i_number, cksum_type, cksum_len, cksum); } /* XXX FIXME: shouldn't happen, but */ if (e != GFARM_ERR_NO_ERROR) gflog_error(GFARM_MSG_1000298, "db_inode_cksum_%s(%lld): %s", cs == NULL ? "add" : "modify", (unsigned long long)inode->i_number, gfarm_error_string(e)); /* reduce memory reallocation */ if (cs != NULL && strcmp(cksum_type, cs->type) == 0 && cksum_len == cs->len) { memcpy(cs->sum, cksum, cksum_len); return (GFARM_ERR_NO_ERROR); } inode_cksum_clear(inode); e = inode_cksum_set_internal(inode, cksum_type, cksum_len, cksum); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001716, "inode_cksum_set_internal() failed: %s", gfarm_error_string(e)); return (e); } ios->u.f.cksum_owner = fo; if (flags & GFM_PROTO_CKSUM_SET_FILE_MODIFIED) { inode_set_mtime(inode, mtime); inode_cksum_invalidate(fo); } return (GFARM_ERR_NO_ERROR); } gfarm_error_t inode_cksum_get(struct file_opening *fo, char **cksum_typep, size_t *cksum_lenp, char **cksump, gfarm_int32_t *flagsp) { struct inode_open_state *ios = fo->inode->u.c.state; struct checksum *cs; gfarm_int32_t flags = 0; if (!inode_is_file(fo->inode)) { gflog_debug(GFARM_MSG_1001717, "inode type is not file"); return (GFARM_ERR_BAD_FILE_DESCRIPTOR); } if (ios->u.f.writers > 1 || (ios->u.f.writers == 1 && (accmode_to_op(fo->flag) & GFS_W_OK) == 0)) flags |= GFM_PROTO_CKSUM_GET_MAYBE_EXPIRED; if (fo->flag & GFARM_FILE_CKSUM_INVALIDATED) flags |= GFM_PROTO_CKSUM_GET_EXPIRED; cs = fo->inode->u.c.s.f.cksum; if (cs == NULL) { *cksum_typep = NULL; *cksum_lenp = 0; *cksump = NULL; *flagsp = flags; return (GFARM_ERR_NO_ERROR); } /* NOTE: These values shoundn't be referered without giant_lock */ *cksum_typep = cs->type; *cksum_lenp = cs->len; *cksump = cs->sum; *flagsp = flags; return (GFARM_ERR_NO_ERROR); } static void xattrs_init(struct xattrs *xattrs) { xattrs->head = xattrs->tail =NULL; } static void xattrs_free_entries(struct xattrs *xattrs) { struct xattr_entry *entry = xattrs->head, *next; while (entry != NULL) { free(entry->name); if (entry->cached_attrvalue != NULL) free(entry->cached_attrvalue); next = entry->next; free(entry); entry = next; } xattrs->head = NULL; xattrs->tail = NULL; } static void inode_xattrs_init(struct inode *inode) { xattrs_init(&inode->i_xattrs); xattrs_init(&inode->i_xmlattrs); } static void inode_xattrs_clear(struct inode *inode) { xattrs_free_entries(&inode->i_xattrs); xattrs_free_entries(&inode->i_xmlattrs); } static void remove_all_xattrs(struct inode *inode, int xmlMode) { gfarm_error_t e; struct xattrs *xattrs = xmlMode ? &inode->i_xmlattrs : &inode->i_xattrs; struct xattr_entry *entry = NULL; if (xattrs->head == NULL) return; e = db_xattr_removeall(xmlMode, inode->i_number); if (e != GFARM_ERR_OPERATION_NOT_SUPPORTED) { gflog_debug(GFARM_MSG_1001718, "db_xattr_removeall() failed: %s", gfarm_error_string(e)); return; } entry = xattrs->head; while (entry != NULL) { e = db_xattr_remove(xmlMode, inode->i_number, entry->name); if (e != GFARM_ERR_NO_ERROR) gflog_warning(GFARM_MSG_1000299, "remove xattr: %s", gfarm_error_string(e)); entry = entry->next; } } static void inode_remove_all_xattrs(struct inode *inode) { remove_all_xattrs(inode, 0); #ifdef ENABLE_XMLATTR remove_all_xattrs(inode, 1); #endif } struct inode_open_state * inode_open_state_alloc(void) { struct inode_open_state *ios; GFARM_MALLOC(ios); if (ios == NULL) { gflog_debug(GFARM_MSG_1001719, "allocation of 'inode_open_state' failed"); return (NULL); } /* make circular list `openings' empty */ ios->openings.opening_prev = ios->openings.opening_next = &ios->openings; ios->u.f.writers = 0; ios->u.f.event_waiters = NULL; ios->u.f.event_source = NULL; ios->u.f.last_update.tv_sec = 0; ios->u.f.last_update.tv_nsec = 0; ios->u.f.cksum_owner = NULL; return (ios); } void inode_open_state_free(struct inode_open_state *ios) { assert(ios->openings.opening_next == &ios->openings); free(ios); } void inode_free_list_init(void) { inode_free_list.u.l.prev = inode_free_list.u.l.next = &inode_free_list; inode_free_list_initialized = 1; } struct inode * inode_alloc_num(gfarm_ino_t inum) { gfarm_ino_t i; struct inode *inode; static const char diag[] = "inode_alloc_num"; if (inum < ROOT_INUMBER) return (NULL); /* we don't use 0 and 1 as i_number */ if (inode_table_size <= inum) { gfarm_ino_t new_table_size; struct inode **p; if (inum < INODE_TABLE_SIZE_INITIAL) new_table_size = INODE_TABLE_SIZE_INITIAL; else if (inum < inode_table_size * INODE_TABLE_SIZE_MULTIPLY) new_table_size = inode_table_size * INODE_TABLE_SIZE_MULTIPLY; else new_table_size = inum * INODE_TABLE_SIZE_MULTIPLY; GFARM_REALLOC_ARRAY(p, inode_table, new_table_size); if (p == NULL) { gflog_debug(GFARM_MSG_1001720, "re-allocation of inode array failed"); return (NULL); /* no memory */ } inode_table = p; for (i = inode_table_size; i < new_table_size; i++) inode_table[i] = NULL; inode_table_size = new_table_size; } if ((inode = inode_table[inum]) == NULL) { GFARM_MALLOC(inode); if (inode == NULL) { gflog_debug(GFARM_MSG_1001721, "allocation of 'inode' failed"); return (NULL); /* no memory */ } inode_xattrs_init(inode); inode->i_number = inum; inode->i_gen = 0; inode_table[inum] = inode; /* update inode_free_index */ if (inum == inode_free_index) { /* always true for now */ while (++inode_free_index < inode_table_size) { /* the following is always true for now */ if (inode_table[inode_free_index] == NULL) break; } } } else if (inode->i_mode != INODE_MODE_FREE) { assert(0); return (NULL); /* the inode is not free */ } else { /* remove from the inode_free_list */ inode->u.l.next->u.l.prev = inode->u.l.prev; inode->u.l.prev->u.l.next = inode->u.l.next; inode->i_gen++; } inode->i_nlink_ini = 0; inode->u.c.state = NULL; gfarm_mutex_lock(&total_num_inodes_mutex, diag, total_num_inodes_diag); ++total_num_inodes; gfarm_mutex_unlock(&total_num_inodes_mutex, diag, total_num_inodes_diag); return (inode); } struct inode * inode_alloc(void) { if (!inode_free_list_initialized) inode_free_list_init(); if (inode_free_list.u.l.next != &inode_free_list) return (inode_alloc_num(inode_free_list.u.l.next->i_number)); else return (inode_alloc_num(inode_free_index)); } static void inode_clear(struct inode *inode) { static const char diag[] = "inode_clear"; inode->i_mode = INODE_MODE_FREE; inode->i_nlink = inode->i_nlink_ini = 0; /* add to the inode_free_list */ inode->u.l.prev = &inode_free_list; inode->u.l.next = inode_free_list.u.l.next; inode->u.l.next->u.l.prev = inode; inode_free_list.u.l.next = inode; inode_xattrs_clear(inode); gfarm_mutex_lock(&total_num_inodes_mutex, diag, total_num_inodes_diag); --total_num_inodes; gfarm_mutex_unlock(&total_num_inodes_mutex, diag, total_num_inodes_diag); } void inode_free(struct inode *inode) { gfarm_error_t e; inode_clear(inode); e = db_inode_nlink_modify(inode->i_number, inode->i_nlink); if (e != GFARM_ERR_NO_ERROR) gflog_error(GFARM_MSG_1000300, "db_inode_nlink_modify(%lld): %s", (unsigned long long)inode->i_number, gfarm_error_string(e)); e = db_inode_mode_modify(inode->i_number, inode->i_mode); if (e != GFARM_ERR_NO_ERROR) gflog_error(GFARM_MSG_1000301, "db_inode_mode_modify(%lld): %s", (unsigned long long)inode->i_number, gfarm_error_string(e)); } /* * currently this is only called at update (i.e. when new generation is made), * and this implementation assumes that fact. */ static void schedule_replication(struct inode *inode, struct host *spool_host, struct file_copy *existing_targets, int n_existings, int n_shortage) { gfarm_error_t e; struct host **existings, **new_targets, *target; struct file_copy *copy; int n_new_targets, i = 0; struct file_replicating *fr; gfarm_off_t necessary_space; GFARM_MALLOC_ARRAY(existings, n_existings+1); /*+1 is for spool_host*/ GFARM_MALLOC_ARRAY(new_targets, n_shortage); if (existings == NULL || new_targets == NULL) { free(existings); free(new_targets); gflog_warning(GFARM_MSG_1002477, "no memory to schedule %d+%d hosts", n_existings + 1, n_shortage); return; } existings[i++] = spool_host; /* this requires +1 */ /* * copy->host where !FILE_COPY_IS_VALID(copy) is excluded here too. * * Such host doesn't have to be excluded, because all of * existing_targets have only old replicas. (i.e. i_gen is older.) * But it's better to exclude it, because * - if previous replication failed, next replication will likely * fail too. * - if the copy became invalid due to "gfrm -h ", * it's better to exclude the node from the destinations. */ for (copy = existing_targets; copy != NULL; copy = copy->host_next) existings[i++] = copy->host; necessary_space = inode_get_size(inode); e = host_schedule_except(n_existings, existings, host_is_disk_available_filter, &necessary_space, n_shortage, &n_new_targets, new_targets); if (e != GFARM_ERR_NO_ERROR) { free(existings); free(new_targets); return; } if (n_new_targets < n_shortage) gflog_warning(GFARM_MSG_1002478, "inum %lld gen %lld: " "fewer replicas (%d out of %d) will be created", (long long)inode_get_number(inode), (long long)inode_get_gen(inode), n_new_targets, n_shortage); for (i = 0; i < n_new_targets; i++) { target = new_targets[i]; e = file_replicating_new(inode, target, NULL, &fr); if (e != GFARM_ERR_NO_ERROR) { gflog_warning(GFARM_MSG_1002479, "file_replicating_new: host %s: %s", host_name(target), gfarm_error_string(e)); } else if ((e = async_back_channel_replication_request( host_name(spool_host), host_port(spool_host), target, inode->i_number, inode->i_gen, fr)) != GFARM_ERR_NO_ERROR) { file_replicating_free(fr); /* may sleep */ } } free(existings); free(new_targets); } static gfarm_error_t remove_replica_entity(struct inode *, gfarm_int64_t, struct host *, int, struct dead_file_copy **); /* spool_host may be NULL, if GFARM_FILE_TRUNC_PENDING */ static void inode_remove_every_other_replicas(struct inode *inode, struct host *spool_host, gfarm_int64_t old_gen, int start_replication, int desired_replica_number) { struct file_copy **copyp, *copy, *next, *to_be_excluded = NULL; int nreplicas = 1; struct dead_file_copy *deferred_cleanup; struct file_replicating *fr; gfarm_error_t e; for (copyp = &inode->u.c.s.f.copies; (copy = *copyp) != NULL; ) { if (copy->host == spool_host) { copyp = ©->host_next; continue; } *copyp = copy->host_next; if (start_replication && spool_host != NULL) { /* * since file_replicating_new() changes * inode->u.c.s.f.copies via inode_add_replica(), * it has to be called at outside of this loop. */ copy->host_next = to_be_excluded; to_be_excluded = copy; ++nreplicas; } else { if (!FILE_COPY_IS_BEING_REMOVED(copy)) { e = remove_replica_entity(inode, old_gen, copy->host, FILE_COPY_IS_VALID(copy), NULL); /* abandon `e' */ } else { /* dead_file_copy must be already created */ assert(!FILE_COPY_IS_VALID(copy)); } free(copy); } } if (spool_host != NULL && nreplicas < desired_replica_number) { schedule_replication(inode, spool_host, to_be_excluded, nreplicas, desired_replica_number - nreplicas); } for (copy = to_be_excluded; copy != NULL; copy = next) { /* if there is ongoing replication, don't start new one */ if (!FILE_COPY_IS_VALID(copy) || !host_is_up(copy->host) || !host_supports_async_protocols(copy->host)) { if (!FILE_COPY_IS_BEING_REMOVED(copy)) { e = remove_replica_entity(inode, old_gen, copy->host, FILE_COPY_IS_VALID(copy), NULL); /* abandon `e' */ } } else { assert(FILE_COPY_IS_VALID(copy)); e = remove_replica_entity(inode, old_gen, copy->host, FILE_COPY_IS_VALID(copy), &deferred_cleanup); /* abandon `e' */ e = file_replicating_new(inode, copy->host, deferred_cleanup, &fr); if (e != GFARM_ERR_NO_ERROR) { gflog_warning(GFARM_MSG_1002245, "replication before removal: host %s: %s", host_name(copy->host), gfarm_error_string(e)); /* give up the replication and remove the old one */ removal_pendingq_enqueue(deferred_cleanup); } else if ((e = async_back_channel_replication_request( host_name(spool_host), host_port(spool_host), copy->host, inode->i_number, inode->i_gen, fr)) != GFARM_ERR_NO_ERROR) { file_replicating_free(fr); /* may sleep */ } } next = copy->host_next; free(copy); } } void inode_remove(struct inode *inode) { int dfc_needs_free = 0; inode_remove_all_xattrs(inode); if (inode->u.c.state != NULL) gflog_fatal(GFARM_MSG_1000302, "inode_remove: still opened"); if (inode_is_file(inode)) { struct file_copy *copy, *cn; gfarm_error_t e; for (copy = inode->u.c.s.f.copies; copy != NULL; copy = cn) { if (!FILE_COPY_IS_BEING_REMOVED(copy)) { e = remove_replica_entity(inode, inode->i_gen, copy->host, FILE_COPY_IS_VALID(copy), NULL); } cn = copy->host_next; free(copy); } inode->u.c.s.f.copies = NULL; /* ncopy == 0 */ inode_cksum_remove(inode); quota_update_file_remove(inode); dfc_needs_free = 1; } else if (inode_is_dir(inode)) { dir_free(inode->u.c.s.d.entries); } else if (inode_is_symlink(inode)) { free(inode->u.c.s.l.source_path); } else { gflog_fatal(GFARM_MSG_1000303, "inode_unlink: unknown inode type"); /*NOTREACHED*/ } inode_free(inode); if (dfc_needs_free) dead_file_copy_inode_status_changed(inode->i_number); } static gfarm_error_t inode_init_dir_internal(struct inode *inode) { inode->u.c.s.d.entries = dir_alloc(); if (inode->u.c.s.d.entries == NULL) { gflog_debug(GFARM_MSG_1001722, "inode entries is NULL"); return (GFARM_ERR_NO_MEMORY); } return (GFARM_ERR_NO_ERROR); } gfarm_error_t inode_init_dir(struct inode *inode, struct inode *parent) { gfarm_error_t e; DirEntry entry; e = inode_init_dir_internal(inode); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001723, "inode_init_dir_internal() failed: %s", gfarm_error_string(e)); return (e); } /* * We won't do db_direntry_add() here to make LDAP happy. * See the comment in inode_lookup_basename(). */ entry = dir_enter(inode->u.c.s.d.entries, dot, DOT_LEN, NULL); if (entry == NULL) { dir_free(inode->u.c.s.d.entries); gflog_debug(GFARM_MSG_1001724, "inode entries is NULL"); return (GFARM_ERR_NO_MEMORY); } dir_entry_set_inode(entry, inode); entry = dir_enter(inode->u.c.s.d.entries, dotdot, DOTDOT_LEN, NULL); if (entry == NULL) { dir_free(inode->u.c.s.d.entries); gflog_debug(GFARM_MSG_1001725, "inode entries is NULL"); return (GFARM_ERR_NO_MEMORY); } dir_entry_set_inode(entry, parent); inode->i_nlink = 2; inode->i_mode = GFARM_S_IFDIR; return (GFARM_ERR_NO_ERROR); } gfarm_error_t inode_init_file(struct inode *inode) { inode->i_nlink = 1; inode->i_mode = GFARM_S_IFREG; inode->u.c.s.f.copies = NULL; inode->u.c.s.f.cksum = NULL; inode->u.c.s.f.rstate = NULL; return (GFARM_ERR_NO_ERROR); } gfarm_error_t inode_init_symlink(struct inode *inode, char *source_path) { static const char diag[] = "inode_init_symlink"; if (source_path != NULL) { source_path = strdup_log(source_path, diag); if (source_path == NULL) return (GFARM_ERR_NO_MEMORY); } inode->i_nlink = 1; inode->i_mode = GFARM_S_IFLNK; inode->u.c.s.l.source_path = source_path; return (GFARM_ERR_NO_ERROR); } gfarm_error_t inode_check_file(struct inode *inode) { if (inode_is_file(inode)) return (GFARM_ERR_NO_ERROR); else if (inode_is_dir(inode)) return (GFARM_ERR_IS_A_DIRECTORY); else if (inode_is_symlink(inode)) return (GFARM_ERR_IS_A_SYMBOLIC_LINK); else return (GFARM_ERR_OPERATION_NOT_PERMITTED); } struct inode * inode_lookup(gfarm_ino_t inum) { struct inode *inode; if (inum >= inode_table_size) return (NULL); inode = inode_table[inum]; if (inode == NULL) return (NULL); if (inode->i_mode == INODE_MODE_FREE) return (NULL); return (inode); } void inode_lookup_all(void *closure, void (*callback)(void *, struct inode *)) { int i; for (i = ROOT_INUMBER; i < inode_table_size; i++) { if (inode_table[i] != NULL && inode_table[i]->i_mode != INODE_MODE_FREE) callback(closure, inode_table[i]); } } int inode_is_dir(struct inode *inode) { return (GFARM_S_ISDIR(inode->i_mode)); } int inode_is_file(struct inode *inode) { return (GFARM_S_ISREG(inode->i_mode)); } int inode_is_symlink(struct inode *inode) { return (GFARM_S_ISLNK(inode->i_mode)); } gfarm_ino_t inode_get_number(struct inode *inode) { return (inode->i_number); } gfarm_int64_t inode_get_gen(struct inode *inode) { return (inode->i_gen); } void inode_increment_gen(struct inode *inode) { gfarm_error_t e; ++inode->i_gen; e = db_inode_gen_modify(inode->i_number, inode->i_gen); if (e != GFARM_ERR_NO_ERROR) gflog_error(GFARM_MSG_1002246, "db_inode_gen_modify(%lld, %lld): %s", (unsigned long long)inode->i_number, (unsigned long long)inode->i_gen, gfarm_error_string(e)); } gfarm_int64_t inode_get_nlink(struct inode *inode) { return (inode->i_nlink); } static gfarm_int64_t inode_get_nlink_ini(struct inode *inode) { return (inode->i_nlink_ini); } static void inode_increment_nlink_ini(struct inode *inode) { ++inode->i_nlink_ini; } struct user * inode_get_user(struct inode *inode) { return (inode->i_user); } struct group * inode_get_group(struct inode *inode) { return (inode->i_group); } int inode_is_creating_file(struct inode *inode) { return (inode->u.c.s.f.copies == NULL); } static gfarm_int64_t inode_get_ncopy_common(struct inode *inode, int is_valid, int is_up) { struct file_copy *copy; gfarm_int64_t n = 0; for (copy = inode->u.c.s.f.copies; copy != NULL; copy = copy->host_next) { if ((is_valid ? FILE_COPY_IS_VALID(copy) : 1) && (is_up ? host_is_up(copy->host) : 1)) n++; } return (n); } gfarm_int64_t inode_get_ncopy(struct inode *inode) { return (inode_get_ncopy_common(inode, 1, 1)); } gfarm_int64_t inode_get_ncopy_with_dead_host(struct inode *inode) { return (inode_get_ncopy_common(inode, 1, 0)); } static gfarm_error_t inode_alloc_file_copy_hosts(struct inode *inode, int (*filter)(struct file_copy *, void *), void *closure, gfarm_int32_t *np, struct host ***hostsp) { struct file_copy *copy; int i, nhosts; struct host **hosts; assert(inode_is_file(inode)); nhosts = 0; for (copy = inode->u.c.s.f.copies; copy != NULL; copy = copy->host_next) { if ((*filter)(copy, closure)) nhosts++; } if (nhosts == 0) { *np = 0; *hostsp = NULL; return (GFARM_ERR_NO_ERROR); } /* * need to remember the hosts, because results of * (*filter)() (i.e. host_is_up()/host_is_disk_available(), ...) * may change even while the giant lock is held. */ GFARM_MALLOC_ARRAY(hosts, nhosts); if (hosts == NULL) return (GFARM_ERR_NO_MEMORY); i = 0; for (copy = inode->u.c.s.f.copies; copy != NULL; copy = copy->host_next) { if (i >= nhosts) /* the results of (*filter)() may change */ break; if ((*filter)(copy, closure)) hosts[i++] = copy->host; } *np = i; /* NOTE: this may be 0 */ *hostsp = hosts; return (GFARM_ERR_NO_ERROR); } static int file_copy_is_valid_and_up(struct file_copy *copy, void *closure) { return (FILE_COPY_IS_VALID(copy) && host_is_up(copy->host)); } static int file_copy_is_valid_and_disk_available(struct file_copy *copy, void *closure) { gfarm_off_t *sizep = closure; return (FILE_COPY_IS_VALID(copy) && host_is_disk_available(copy->host, *sizep)); } static int file_copy_is_invalid(struct file_copy *copy, void *closure) { return (!FILE_COPY_IS_VALID(copy)); } gfarm_mode_t inode_get_mode(struct inode *inode) { return (inode->i_mode); } gfarm_error_t inode_set_mode(struct inode *inode, gfarm_mode_t mode) { gfarm_error_t e; if ((mode & GFARM_S_IFMT) != 0) { gflog_debug(GFARM_MSG_1001726, "argument 'mode' is invalid"); return (GFARM_ERR_INVALID_ARGUMENT); } inode->i_mode = (inode->i_mode & GFARM_S_IFMT) | (mode & GFARM_S_ALLPERM); e = db_inode_mode_modify(inode->i_number, inode->i_mode); if (e != GFARM_ERR_NO_ERROR) gflog_error(GFARM_MSG_1000304, "db_inode_mode_modify(%lld): %s", (unsigned long long)inode->i_number, gfarm_error_string(e)); return (GFARM_ERR_NO_ERROR); } gfarm_off_t inode_get_size(struct inode *inode) { return (inode->i_size); } void inode_set_size(struct inode *inode, gfarm_off_t size) { gfarm_error_t e; /* inode is file */ quota_update_file_resize(inode, size); inode->i_size = size; e = db_inode_size_modify(inode->i_number, inode->i_size); if (e != GFARM_ERR_NO_ERROR) gflog_error(GFARM_MSG_1000305, "db_inode_size_modify(%lld): %s", (unsigned long long)inode->i_number, gfarm_error_string(e)); } gfarm_error_t inode_set_owner(struct inode *inode, struct user *user, struct group *group) { gfarm_error_t e; if (user == NULL && group == NULL) return (GFARM_ERR_NO_ERROR); if (inode_is_file(inode)) quota_update_file_remove(inode); if (user != NULL) { inode->i_user = user; e = db_inode_user_modify(inode->i_number, user_name(user)); if (e != GFARM_ERR_NO_ERROR) gflog_error(GFARM_MSG_1000306, "db_inode_user_modify(%lld): %s", (unsigned long long)inode->i_number, gfarm_error_string(e)); } if (group != NULL) { inode->i_group = group; e = db_inode_group_modify(inode->i_number, group_name(group)); if (e != GFARM_ERR_NO_ERROR) gflog_error(GFARM_MSG_1000307, "db_inode_group_modify(%lld): %s", (unsigned long long)inode->i_number, gfarm_error_string(e)); } if (inode_is_file(inode)) quota_update_file_add(inode); return (GFARM_ERR_NO_ERROR); } struct gfarm_timespec * inode_get_atime(struct inode *inode) { return (&inode->i_atimespec); } struct gfarm_timespec * inode_get_mtime(struct inode *inode) { return (&inode->i_mtimespec); } struct gfarm_timespec * inode_get_ctime(struct inode *inode) { return (&inode->i_ctimespec); } void inode_set_atime(struct inode *inode, struct gfarm_timespec *atime) { gfarm_error_t e; if (atime == NULL) return; if (gfarm_timespec_cmp(&inode->i_atimespec, atime) == 0) return; /* not necessary to change */ inode->i_atimespec = *atime; e = db_inode_atime_modify(inode->i_number, &inode->i_atimespec); if (e != GFARM_ERR_NO_ERROR) gflog_error(GFARM_MSG_1000308, "db_inode_atime_modify(%lld): %s", (unsigned long long)inode->i_number, gfarm_error_string(e)); } void inode_set_mtime(struct inode *inode, struct gfarm_timespec *mtime) { gfarm_error_t e; if (gfarm_timespec_cmp(&inode->i_mtimespec, mtime) == 0) return; /* not necessary to change */ inode->i_mtimespec = *mtime; e = db_inode_mtime_modify(inode->i_number, inode_get_mtime(inode)); if (e != GFARM_ERR_NO_ERROR) gflog_error(GFARM_MSG_1000309, "db_inode_mtime_modify(%lld): %s", (unsigned long long)inode->i_number, gfarm_error_string(e)); } void inode_set_ctime(struct inode *inode, struct gfarm_timespec *ctime) { gfarm_error_t e; if (gfarm_timespec_cmp(&inode->i_ctimespec, ctime) == 0) return; /* not necessary to change */ inode->i_ctimespec = *ctime; e = db_inode_ctime_modify(inode->i_number, &inode->i_ctimespec); if (e != GFARM_ERR_NO_ERROR) gflog_error(GFARM_MSG_1000310, "db_inode_ctime_modify(%lld): %s", (unsigned long long)inode->i_number, gfarm_error_string(e)); } static void touch(struct gfarm_timespec *tsp) { struct timeval tv; gettimeofday(&tv, NULL); tsp->tv_sec = tv.tv_sec; tsp->tv_nsec = tv.tv_usec * 1000; } void inode_accessed(struct inode *inode) { struct gfarm_timespec ts; touch(&ts); inode_set_atime(inode, &ts); } void inode_modified(struct inode *inode) { struct gfarm_timespec ts; touch(&ts); inode_set_mtime(inode, &ts); } void inode_status_changed(struct inode *inode) { struct gfarm_timespec ts; touch(&ts); inode_set_ctime(inode, &ts); } void inode_created(struct inode *inode) { touch(&inode->i_ctimespec); inode->i_atimespec = inode->i_mtimespec = inode->i_ctimespec; } Dir inode_get_dir(struct inode *inode) { if (!inode_is_dir(inode)) return (NULL); return (inode->u.c.s.d.entries); } char * inode_get_symlink(struct inode *inode) { if (!inode_is_symlink(inode)) return (NULL); return (inode->u.c.s.l.source_path); } int inode_desired_dead_file_copy(gfarm_ino_t inum) { struct inode *inode = inode_lookup(inum); if (inode == NULL) /* already removed */ return (0); if (!inode_is_file(inode)) /* already removed */ return (0); if (inode_get_nlink(inode) == 0) /* waiting for being removed */ return (0); if (inode_get_size(inode) == 0) /* can access latest contents? */ return (0); if (inode_get_ncopy(inode) > 0) /* can access latest contents? */ return (0); return (1); /* XXX FIXME: use xattr gfarm:ncopy */ } int inode_new_generation_is_pending(struct inode *inode) { struct inode_open_state *ios = inode->u.c.state; static const char diag[] = "inode_new_generation_is_pending"; if (ios == NULL) { gflog_error(GFARM_MSG_1002247, "%s: not opened", diag); return (0); } return (ios->u.f.event_source != NULL); } gfarm_error_t inode_new_generation_wait_start(struct inode *inode, struct peer *peer) { struct inode_open_state *ios = inode->u.c.state; static const char diag[] = "inode_new_generation_wait_start"; if (ios == NULL) { gflog_error(GFARM_MSG_1002248, "%s: not opened", diag); return (GFARM_ERR_BAD_FILE_DESCRIPTOR); } ios->u.f.event_source = peer; return (GFARM_ERR_NO_ERROR); } gfarm_error_t inode_new_generation_done(struct inode *inode, struct peer *peer, gfarm_int32_t result) { struct inode_open_state *ios; struct event_waiter *waiter, *next; static const char diag[] = "inode_new_generation_done"; if (!inode_is_file(inode)) { gflog_error(GFARM_MSG_1002249, "%s: not a file", diag); return (GFARM_ERR_BAD_FILE_DESCRIPTOR); } ios = inode->u.c.state; if (ios == NULL) { gflog_error(GFARM_MSG_1002250, "%s: not opened", diag); return (GFARM_ERR_BAD_FILE_DESCRIPTOR); } if (ios->u.f.event_source == NULL) { gflog_warning(GFARM_MSG_1002251, "%s: not pending", diag); return (GFARM_ERR_OPERATION_NOT_PERMITTED); } if (peer != NULL && peer != ios->u.f.event_source) { gflog_warning(GFARM_MSG_1002252, "%s: different peer", diag); return (GFARM_ERR_OPERATION_NOT_PERMITTED); } peer_reset_pending_new_generation(peer); waiter = ios->u.f.event_waiters; for (; waiter != NULL; waiter = next) { next = waiter->next; resuming_enqueue(waiter); } ios->u.f.event_source = NULL; ios->u.f.event_waiters = NULL; return (GFARM_ERR_NO_ERROR); } gfarm_error_t inode_new_generation_wait(struct inode *inode, struct peer *peer, gfarm_error_t (*action)(struct peer *, void *, int *), void *arg) { struct inode_open_state *ios; struct event_waiter *waiter; static const char diag[] = "inode_new_generation_wait"; if (!inode_is_file(inode)) { gflog_error(GFARM_MSG_1002253, "%s: not a file", diag); return (GFARM_ERR_BAD_FILE_DESCRIPTOR); } ios = inode->u.c.state; if (ios == NULL) { gflog_error(GFARM_MSG_1002254, "%s: not opened", diag); return (GFARM_ERR_BAD_FILE_DESCRIPTOR); } if (ios->u.f.event_source == NULL) { gflog_warning(GFARM_MSG_1002255, "%s: not pending", diag); return (GFARM_ERR_OPERATION_NOT_PERMITTED); } GFARM_MALLOC(waiter); if (waiter == NULL) { gflog_warning(GFARM_MSG_1002256, "%s: no memory", diag); return (GFARM_ERR_NO_MEMORY); } waiter->peer = peer; waiter->action = action; waiter->arg = arg; waiter->next = ios->u.f.event_waiters; ios->u.f.event_waiters = waiter; return (GFARM_ERR_NO_ERROR); } gfarm_error_t inode_access(struct inode *inode, struct user *user, int op) { gfarm_mode_t mask = 0; if (user_is_root(user)) return (GFARM_ERR_NO_ERROR); if (inode->i_user == user) { if (op & GFS_X_OK) mask |= 0100; if (op & GFS_W_OK) mask |= 0200; if (op & GFS_R_OK) mask |= 0400; } else if (user_in_group(user, inode->i_group)) { if (op & GFS_X_OK) mask |= 0010; if (op & GFS_W_OK) mask |= 0020; if (op & GFS_R_OK) mask |= 0040; } else { if (op & GFS_X_OK) mask |= 0001; if (op & GFS_W_OK) mask |= 0002; if (op & GFS_R_OK) mask |= 0004; } return ((inode->i_mode & mask) == mask ? GFARM_ERR_NO_ERROR : GFARM_ERR_PERMISSION_DENIED); } enum gfarm_inode_lookup_op { INODE_LOOKUP, INODE_CREATE, INODE_CREATE_EXCLUSIVE, INODE_REMOVE, INODE_LINK, }; /* * if (op == INODE_LINK) * (*inp) is an input parameter instead of output. * db_inode_nlink_modify() should be done by the caller. * if (op == INODE_REMOVE) * db_inode_nlink_modify() should be done by the caller. * if (op == INODE_CREATE) * createdp must be passed, otherwise it's ignored. * if (op != INODE_CREATE && op != INODE_CREATE_EXCLUSIVE) * expcted_type may be GFS_DT_UNKNOWN, and that means "don't care". * if (op == INODE_CREATE || op == INODE_CREATE_EXCLUSIVE) * new_mode must be passed, otherwise it's ignored. * if ((op == INODE_CREATE || op == INODE_CREATE_EXCLUSIVE) && * expected_type == GFS_DT_LNK) * symlink_src must be passed, otherwise it's ignored. */ static gfarm_error_t inode_lookup_basename(struct inode *parent, const char *name, int len, int expected_type, enum gfarm_inode_lookup_op op, struct user *user, gfarm_mode_t new_mode, char *symlink_src, struct inode **inp, int *createdp) { gfarm_error_t e; DirEntry entry; int created; struct inode *n; if (len == 0) { if (op != INODE_LOOKUP) { gflog_debug(GFARM_MSG_1001727, "argument 'op' is invalid"); return (GFARM_ERR_INVALID_ARGUMENT); } *inp = parent; return (GFARM_ERR_NO_ERROR); } else if (len == 1 && name[0] == '.') { if (op != INODE_LOOKUP) { gflog_debug(GFARM_MSG_1001728, "argument 'op' is invalid"); return (GFARM_ERR_INVALID_ARGUMENT); } *inp = parent; return (GFARM_ERR_NO_ERROR); } else if (memchr(name, '/', len) != NULL) { gflog_debug(GFARM_MSG_1001729, "argument 'name' is invalid"); return (GFARM_ERR_INVALID_ARGUMENT); } if (len > GFS_MAXNAMLEN) { gflog_debug(GFARM_MSG_1002431, "op %d: too long file name: \"%s\"", op, name); return (GFARM_ERR_FILE_NAME_TOO_LONG); } if (op != INODE_CREATE && op != INODE_CREATE_EXCLUSIVE && op != INODE_LINK) { entry = dir_lookup(parent->u.c.s.d.entries, name, len); if (entry == NULL) { gflog_debug(GFARM_MSG_1001730, "dir_lookup() failed"); return (GFARM_ERR_NO_SUCH_FILE_OR_DIRECTORY); } if (op == INODE_LOOKUP) { *inp = dir_entry_get_inode(entry); return (GFARM_ERR_NO_ERROR); } assert(op == INODE_REMOVE); if ((e = inode_access(parent, user, GFS_W_OK)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001731, "inode_access() failed: %s", gfarm_error_string(e)); return (e); } *inp = dir_entry_get_inode(entry); (*inp)->i_nlink--; dir_remove_entry(parent->u.c.s.d.entries, name, len); inode_modified(parent); e = db_direntry_remove(parent->i_number, name, len); if (e != GFARM_ERR_NO_ERROR) gflog_error(GFARM_MSG_1000311, "db_direntry_remove(%lld, %.*s): %s", (unsigned long long)parent->i_number, len, name, gfarm_error_string(e)); return (GFARM_ERR_NO_ERROR); } entry = dir_enter(parent->u.c.s.d.entries, name, len, &created); if (entry == NULL) { gflog_debug(GFARM_MSG_1001732, "dir_enter() failed"); return (GFARM_ERR_NO_MEMORY); } if (!created) { if (op == INODE_CREATE_EXCLUSIVE || op == INODE_LINK) { gflog_debug(GFARM_MSG_1001733, "inode already exists"); return (GFARM_ERR_ALREADY_EXISTS); } assert(op == INODE_CREATE); *inp = dir_entry_get_inode(entry); *createdp = 0; return (GFARM_ERR_NO_ERROR); } if ((e = inode_access(parent, user, GFS_W_OK)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001734, "inode_access() failed: %s", gfarm_error_string(e)); dir_remove_entry(parent->u.c.s.d.entries, name, len); return (e); } if (op == INODE_LINK) { n = *inp; n->i_nlink++; dir_entry_set_inode(entry, n); inode_status_changed(n); inode_modified(parent); e = db_direntry_add(parent->i_number, name, len, n->i_number); if (e != GFARM_ERR_NO_ERROR) gflog_error(GFARM_MSG_1000313, "db_direntry_add(%lld, %lld): %s", (unsigned long long)parent->i_number, (unsigned long long)n->i_number, gfarm_error_string(e)); return (GFARM_ERR_NO_ERROR); } assert((op == INODE_CREATE || op == INODE_CREATE_EXCLUSIVE) && expected_type != GFS_DT_UNKNOWN); n = inode_alloc(); if (n == NULL) { dir_remove_entry(parent->u.c.s.d.entries, name, len); gflog_debug(GFARM_MSG_1001735, "inode_alloc() failed"); return (GFARM_ERR_NO_MEMORY); } switch (expected_type) { case GFS_DT_DIR: e = inode_init_dir(n, parent); break; case GFS_DT_REG: e = quota_check_limits(user, parent->i_group, 1, 0); if (e == GFARM_ERR_NO_ERROR) e = inode_init_file(n); break; case GFS_DT_LNK: e = inode_init_symlink(n, symlink_src); break; default: assert(0); e = GFARM_ERR_UNKNOWN; break; } if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001736, "error occurred during process: %s", gfarm_error_string(e)); dir_remove_entry(parent->u.c.s.d.entries, name, len); inode_free(n); return (e); } n->i_mode |= new_mode; n->i_user = user; n->i_group = parent->i_group; n->i_size = 0; inode_created(n); dir_entry_set_inode(entry, n); inode_modified(parent); if (inode_is_file(n)) /* after setting i_user and i_group */ quota_update_file_add(n); { struct gfs_stat st; st.st_ino = n->i_number; st.st_gen = n->i_gen; st.st_mode = n->i_mode; st.st_nlink = n->i_nlink; st.st_user = user_name(n->i_user); st.st_group = group_name(n->i_group); st.st_size = n->i_size; st.st_ncopy = 0; st.st_atimespec = n->i_atimespec; st.st_mtimespec = n->i_mtimespec; st.st_ctimespec = n->i_ctimespec; if (n->i_gen == 0) e = db_inode_add(&st); else e = db_inode_modify(&st); } if (e != GFARM_ERR_NO_ERROR) gflog_error(GFARM_MSG_1000314, "db_inode_%s(%lld): %s", n->i_gen == 0 ? "add" : "modify", (unsigned long long)n->i_number, gfarm_error_string(e)); /* * We do db_direntry_add() here to make LDAP happy. * Because inode must be created before DirEntry * due to LDAP DN hierarchy. * See the comment in inode_init_dir() too. */ if (expected_type == GFS_DT_DIR) { e = db_direntry_add(n->i_number, dot, DOT_LEN, n->i_number); if (e != GFARM_ERR_NO_ERROR) gflog_error(GFARM_MSG_1000315, "db_direntry_add(%lld, \".\", %lld): %s", (unsigned long long)parent->i_number, (unsigned long long)n->i_number, gfarm_error_string(e)); e = db_direntry_add( n->i_number, dotdot, DOTDOT_LEN, parent->i_number); if (e != GFARM_ERR_NO_ERROR) gflog_error(GFARM_MSG_1000316, "db_direntry_add(%lld, \"..\", %lld): %s", (unsigned long long)parent->i_number, (unsigned long long)n->i_number, gfarm_error_string(e)); } else if (expected_type == GFS_DT_LNK) { e = db_symlink_add(n->i_number, symlink_src); if (e != GFARM_ERR_NO_ERROR) gflog_error(GFARM_MSG_1000317, "db_symlink_add(%lld, \"%s\"): %s", (unsigned long long)n->i_number, symlink_src, gfarm_error_string(e)); } e = db_direntry_add(parent->i_number, name, len, n->i_number); if (e != GFARM_ERR_NO_ERROR) gflog_error(GFARM_MSG_1000318, "db_direntry_add(%lld, %lld): %s", (unsigned long long)parent->i_number, (unsigned long long)n->i_number, gfarm_error_string(e)); *inp = n; if (op == INODE_CREATE) *createdp = 1; return (GFARM_ERR_NO_ERROR); } /* XXX TODO: namei cache */ /* * if (op == INODE_LINK) * (*inp) is an input parameter instead of output. * if (op == INODE_CREATE) * createdp must be passed, otherwise it's ignored. * if (op != INODE_CREATE && op != INODE_CREATE_EXCLUSIVE) * expcted_type may be GFS_DT_UNKNOWN, and that means "don't care". * if (op == INODE_CREATE || op == INODE_CREATE_EXCLUSIVE) * new_mode must be passed, otherwise it's ignored. * if ((op == INODE_CREATE || op == INODE_CREATE_EXCLUSIVE) && * expected_type == GFS_DT_LNK) * symlink_src must be passed, otherwise it's ignored. */ gfarm_error_t inode_lookup_relative(struct inode *n, char *name, int expected_type, enum gfarm_inode_lookup_op op, struct user *user, gfarm_mode_t new_mode, char *symlink_src, struct inode **inp, int *createdp) { gfarm_error_t e; int len = strlen(name); struct inode *nn; #ifdef __GNUC__ /* workaround gcc warning: may be used uninitialized */ nn = NULL; #endif if (!inode_is_dir(n)) { gflog_debug(GFARM_MSG_1001737, "inode is not directory"); return (GFARM_ERR_NOT_A_DIRECTORY); } if ((e = inode_access(n, user, GFS_X_OK)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001738, "inode_access() failed: %s", gfarm_error_string(e)); return (e); } if (op == INODE_LINK) nn = *inp; e = inode_lookup_basename(n, name, len, expected_type, op, user, new_mode, symlink_src, &nn, createdp); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001739, "inode_lookup_basename() failed: %s", gfarm_error_string(e)); return (e); } if (expected_type != GFS_DT_UNKNOWN && gfs_mode_to_type(nn->i_mode) != expected_type) { assert(op != INODE_CREATE_EXCLUSIVE && (op != INODE_CREATE || !*createdp)); return ( expected_type == GFS_DT_DIR ? GFARM_ERR_NOT_A_DIRECTORY : GFARM_S_ISDIR(nn->i_mode) ? GFARM_ERR_IS_A_DIRECTORY : GFARM_ERR_OPERATION_NOT_SUPPORTED); } *inp = nn; return (GFARM_ERR_NO_ERROR); } gfarm_error_t inode_lookup_root(struct process *process, int op, struct inode **inp) { gfarm_error_t e; struct inode *inode = inode_lookup(ROOT_INUMBER); if (inode == NULL) { gflog_debug(GFARM_MSG_1001740, "inode_lookup() failed"); return (GFARM_ERR_STALE_FILE_HANDLE); /* XXX never happen */ } e = inode_access(inode, process_get_user(process), op); if (e == GFARM_ERR_NO_ERROR) *inp = inode; return (e); } gfarm_error_t inode_lookup_parent(struct inode *base, struct process *process, int op, struct inode **inp) { struct inode *inode; struct user *user = process_get_user(process); gfarm_error_t e = inode_lookup_relative(base, dotdot, GFS_DT_DIR, INODE_LOOKUP, user, 0, NULL, &inode, NULL); if (e == GFARM_ERR_NO_ERROR && (e = inode_access(inode, user, op)) == GFARM_ERR_NO_ERROR) { *inp = inode; } return (e); } gfarm_error_t inode_lookup_by_name(struct inode *base, char *name, struct process *process, int op, struct inode **inp) { struct inode *inode; struct user *user = process_get_user(process); gfarm_error_t e = inode_lookup_relative(base, name, GFS_DT_UNKNOWN, INODE_LOOKUP, user, 0, NULL, &inode, NULL); if (e == GFARM_ERR_NO_ERROR) { if ((op & GFS_W_OK) != 0 && inode_is_dir(inode)) { gflog_debug(GFARM_MSG_1001741, "inode is directory"); e = GFARM_ERR_IS_A_DIRECTORY; } else { e = inode_access(inode, user, op); } if (e == GFARM_ERR_NO_ERROR && inode_is_file(inode) && (op & GFS_W_OK) != 0) e = quota_check_limits(inode_get_user(inode), inode_get_group(inode), 0, 0); if (e == GFARM_ERR_NO_ERROR) { *inp = inode; } } return (e); } struct inode * inode_lookup_lost_found(void) { static gfarm_ino_t inum_lost_found = 0; static gfarm_uint64_t gen_lost_found = 0; struct inode *root, *inode; struct user *admin; int created; gfarm_error_t e; if (inum_lost_found != 0) { inode = inode_lookup(inum_lost_found); if (inode != NULL && inode->i_gen == gen_lost_found) return (inode); } root = inode_lookup(ROOT_INUMBER); if (root == NULL) { gflog_error(GFARM_MSG_1002480, "no root directory"); return (NULL); } admin = user_lookup(ADMIN_USER_NAME); if (admin == NULL) { gflog_error(GFARM_MSG_1002481, "no admin user"); return (NULL); } e = inode_lookup_relative(root, lost_found, GFS_DT_DIR, INODE_CREATE, admin, 0700, NULL, &inode, &created); if (e != GFARM_ERR_NO_ERROR) { gflog_error(GFARM_MSG_1002482, "no /%s directory", lost_found); return (NULL); } if (created) gflog_info(GFARM_MSG_1002483, "create /%s directory", lost_found); inum_lost_found = inode->i_number; gen_lost_found = inode->i_gen; return (inode); } gfarm_error_t inode_create_file(struct inode *base, char *name, struct process *process, int op, gfarm_mode_t mode, struct inode **inp, int *createdp) { struct inode *inode; int created; struct user *user = process_get_user(process); gfarm_error_t e = inode_lookup_relative(base, name, GFS_DT_REG, INODE_CREATE, user, mode, NULL, &inode, &created); if (e == GFARM_ERR_NO_ERROR) { if (!created) e = inode_access(inode, user, op); if (e == GFARM_ERR_NO_ERROR) { *inp = inode; *createdp = created; } } return (e); } gfarm_error_t inode_create_dir(struct inode *base, char *name, struct process *process, gfarm_mode_t mode) { struct inode *inode; return (inode_lookup_relative(base, name, GFS_DT_DIR, INODE_CREATE_EXCLUSIVE, process_get_user(process), mode, NULL, &inode, NULL)); } gfarm_error_t inode_create_symlink(struct inode *base, char *name, struct process *process, char *source_path) { struct inode *inode; if (strlen(source_path) > GFARM_PATH_MAX) { gflog_debug(GFARM_MSG_1002432, "create symlink \"%s\" \"%s\": too long source path", source_path, name); return (GFARM_ERR_FILE_NAME_TOO_LONG); } return (inode_lookup_relative(base, name, GFS_DT_LNK, INODE_CREATE_EXCLUSIVE, process_get_user(process), 0777, source_path, &inode, NULL)); } static gfarm_error_t inode_create_link_internal(struct inode *base, char *name, struct user *user, struct inode *inode) { return (inode_lookup_relative(base, name, GFS_DT_UNKNOWN, INODE_LINK, user, 0, NULL, &inode, NULL)); } gfarm_error_t inode_create_link(struct inode *base, char *name, struct process *process, struct inode *inode) { gfarm_error_t e; e = inode_create_link_internal(base, name, process_get_user(process), inode); if (e != GFARM_ERR_NO_ERROR) return (e); e = db_inode_nlink_modify(inode->i_number, inode->i_nlink); if (e != GFARM_ERR_NO_ERROR) gflog_error(GFARM_MSG_1000312, "db_inode_nlink_modify(%lld): %s", (unsigned long long)inode->i_number, gfarm_error_string(e)); return (GFARM_ERR_NO_ERROR); } gfarm_error_t inode_link_to_lost_found(struct inode *inode) { struct inode *base; struct user *admin; static char name[16 + 16 + 1]; int name_len; base = inode_lookup_lost_found(); if (base == NULL) return (GFARM_ERR_NO_SUCH_FILE_OR_DIRECTORY); admin = user_lookup(ADMIN_USER_NAME); if (admin == NULL) return (GFARM_ERR_NO_SUCH_USER); name_len = sizeof(name); snprintf(name, name_len, "%016llX%016llX", (unsigned long long)inode->i_number, (unsigned long long)inode->i_gen); return (inode_create_link_internal(base, name, admin, inode)); } gfarm_error_t inode_rename( struct inode *sdir, char *sname, struct inode *ddir, char *dname, struct process *process) { gfarm_error_t e; struct user *user = process_get_user(process); struct inode *src, *dst; if (user == NULL) { gflog_debug(GFARM_MSG_1001742, "process_get_user() failed"); return (GFARM_ERR_OPERATION_NOT_PERMITTED); } /* can remove src? */ if ((e = inode_access(sdir, user, GFS_X_OK|GFS_W_OK)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001743, "inode_access() failed: %s", gfarm_error_string(e)); return (e); } if ((e = inode_lookup_by_name(sdir, sname, process, 0, &src)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001744, "inode_lookup_by_name() failed: %s", gfarm_error_string(e)); return (e); } if (strchr(sname, '/') != NULL) { /* sname should't have '/' */ gflog_debug(GFARM_MSG_1001745, "argument 'sname' is invalid"); return (GFARM_ERR_INVALID_ARGUMENT); } if (strchr(dname, '/') != NULL) { /* dname should't have '/' */ gflog_debug(GFARM_MSG_1001746, "argument 'dname' is invalid"); return (GFARM_ERR_INVALID_ARGUMENT); } e = inode_lookup_by_name(ddir, dname, process, 0, &dst); if (e == GFARM_ERR_NO_ERROR) { if (GFARM_S_ISDIR(inode_get_mode(src)) == GFARM_S_ISDIR(inode_get_mode(dst))) { e = inode_unlink(ddir, dname, process); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001747, "inode_unlink() failed: %s", gfarm_error_string(e)); return (e); } } else if (GFARM_S_ISDIR(inode_get_mode(src))) { gflog_debug(GFARM_MSG_1001748, "inode 'inode_get_mode(src)' " "is not a directory"); return (GFARM_ERR_NOT_A_DIRECTORY); } else { gflog_debug(GFARM_MSG_1001749, "inode 'inode_get_mode(src)' is directory"); return (GFARM_ERR_IS_A_DIRECTORY); } } else if (e != GFARM_ERR_NO_SUCH_FILE_OR_DIRECTORY) return (e); e = inode_create_link_internal(ddir, dname, user, src); if (e != GFARM_ERR_NO_ERROR) { /* shouldn't happen */ gflog_error(GFARM_MSG_1000319, "rename(%s, %s): failed to link: %s", sname, dname, gfarm_error_string(e)); return (e); } e = inode_lookup_relative(sdir, sname, GFS_DT_UNKNOWN, INODE_REMOVE, user, 0, NULL, &src, NULL); if (e != GFARM_ERR_NO_ERROR) /* shouldn't happen */ gflog_error(GFARM_MSG_1000320, "rename(%s, %s): failed to unlink: %s", sname, dname, gfarm_error_string(e)); /* db_inode_nlink_modify() is not necessary, because it's unchanged */ return (e); } gfarm_error_t inode_unlink(struct inode *base, char *name, struct process *process) { struct inode *inode; gfarm_error_t e = inode_lookup_by_name(base, name, process, 0, &inode); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001750, "inode_lookup_by_name() failed: %s", gfarm_error_string(e)); return (e); } if (inode_is_file(inode)) { e = inode_lookup_relative(base, name, GFS_DT_REG, INODE_REMOVE, process_get_user(process), 0, NULL, &inode, NULL); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001751, "inode_lookup_relative() failed: %s", gfarm_error_string(e)); return (e); } if (inode->i_nlink > 0) { e = db_inode_nlink_modify(inode->i_number, inode->i_nlink); if (e != GFARM_ERR_NO_ERROR) gflog_error(GFARM_MSG_1000321, "db_inode_nlink_modify(%lld): %s", (unsigned long long)inode->i_number, gfarm_error_string(e)); return (GFARM_ERR_NO_ERROR); } } else if (inode_is_dir(inode)) { if (inode->i_nlink > 2 || !dir_is_empty(inode->u.c.s.d.entries)) { gflog_debug(GFARM_MSG_1001752, "directory is not empty"); return (GFARM_ERR_DIRECTORY_NOT_EMPTY); } else if (strcmp(name, dot) == 0 || strcmp(name, dotdot) == 0) { gflog_debug(GFARM_MSG_1001753, "argument 'name' is invalid"); return (GFARM_ERR_INVALID_ARGUMENT); } e = inode_lookup_relative(base, name, GFS_DT_DIR, INODE_REMOVE, process_get_user(process), 0, NULL, &inode, NULL); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001754, "inode_lookup_relative() failed: %s", gfarm_error_string(e)); return (e); } e = db_direntry_remove(inode->i_number, dot, DOT_LEN); if (e != GFARM_ERR_NO_ERROR) gflog_error(GFARM_MSG_1000322, "db_direntry_remove(%lld, %s): %s", (unsigned long long)inode->i_number, dot, gfarm_error_string(e)); e = db_direntry_remove(inode->i_number, dotdot, DOTDOT_LEN); if (e != GFARM_ERR_NO_ERROR) gflog_error(GFARM_MSG_1000323, "db_direntry_remove(%lld, %s): %s", (unsigned long long)inode->i_number, dotdot, gfarm_error_string(e)); } else if (inode_is_symlink(inode)) { e = inode_lookup_relative(base, name, GFS_DT_LNK, INODE_REMOVE, process_get_user(process), 0, NULL, &inode, NULL); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001755, "inode_lookup_relative() failed: %s", gfarm_error_string(e)); return (e); } assert(inode->i_nlink == 0); e = db_symlink_remove(inode->i_number); if (e != GFARM_ERR_NO_ERROR) gflog_error(GFARM_MSG_1000324, "db_symlink_remove(%lld): %s", (unsigned long long)inode->i_number, gfarm_error_string(e)); } else { gflog_fatal(GFARM_MSG_1000325, "inode_unlink: unknown inode type"); /*NOTREACHED*/ return (GFARM_ERR_UNKNOWN); } if (inode->u.c.state == NULL && (!inode_is_file(inode) || inode->u.c.s.f.rstate == NULL)) { /* no process is opening this file, just remove it */ inode_remove(inode); return (GFARM_ERR_NO_ERROR); } else { /* there are some processes which open this file */ /* leave this inode until closed */ e = db_inode_nlink_modify(inode->i_number, inode->i_nlink); if (e != GFARM_ERR_NO_ERROR) gflog_error(GFARM_MSG_1000326, "db_inode_nlink_modify(%lld): %s", (unsigned long long)inode->i_number, gfarm_error_string(e)); return (GFARM_ERR_NO_ERROR); } } gfarm_error_t inode_open(struct file_opening *fo) { struct inode *inode = fo->inode; struct inode_open_state *ios = inode->u.c.state; if (ios == NULL) { ios = inode_open_state_alloc(); if (ios == NULL) { gflog_debug(GFARM_MSG_1001756, "inode_open_state_alloc() failed"); return (GFARM_ERR_NO_MEMORY); } inode->u.c.state = ios; } if ((accmode_to_op(fo->flag) & GFS_W_OK) != 0) ++ios->u.f.writers; if ((fo->flag & GFARM_FILE_TRUNC) != 0) { inode_status_changed(inode); inode_modified(inode); inode_set_size(inode, 0); fo->flag |= GFARM_FILE_TRUNC_PENDING; } fo->opening_prev = &ios->openings; fo->opening_next = ios->openings.opening_next; ios->openings.opening_next = fo; fo->opening_next->opening_prev = fo; return (GFARM_ERR_NO_ERROR); } void inode_close(struct file_opening *fo) { inode_close_read(fo, NULL); } void inode_close_read(struct file_opening *fo, struct gfarm_timespec *atime) { struct inode *inode = fo->inode; struct inode_open_state *ios = inode->u.c.state; if ((fo->flag & GFARM_FILE_TRUNC_PENDING) != 0) { inode_file_update(fo, 0, atime, &inode->i_mtimespec, NULL, NULL); } else if (atime != NULL) inode_set_atime(inode, atime); fo->opening_prev->opening_next = fo->opening_next; fo->opening_next->opening_prev = fo->opening_prev; if (ios->openings.opening_next == &ios->openings) { /* all closed */ if (ios->u.f.event_waiters != NULL) inode_new_generation_done(inode, NULL, GFARM_ERR_PROTOCOL); inode_open_state_free(inode->u.c.state); inode->u.c.state = NULL; } else if ((accmode_to_op(fo->flag) & GFS_W_OK) != 0) --ios->u.f.writers; if (inode->i_nlink == 0 && inode->u.c.state == NULL && (!inode_is_file(inode) || inode->u.c.s.f.rstate == NULL)) { inode_remove(inode); /* clears `ios->u.f.cksum_owner' too. */ } } /* * returns TRUE, if generation number is updated. * * spool_host may be NULL, if GFARM_FILE_TRUNC_PENDING. */ int inode_file_update(struct file_opening *fo, gfarm_off_t size, struct gfarm_timespec *atime, struct gfarm_timespec *mtime, gfarm_int64_t *old_genp, gfarm_int64_t *new_genp) { struct inode *inode = fo->inode; struct inode_open_state *ios = inode->u.c.state; struct host *spool_host = fo->u.f.spool_host; gfarm_int64_t old_gen; int generation_updated = 0; int start_replication = 0; inode_cksum_invalidate(fo); if (ios->u.f.cksum_owner == NULL || ios->u.f.cksum_owner != fo) inode_cksum_remove(inode); inode_set_size(inode, size); inode_set_atime(inode, atime); inode_set_mtime(inode, mtime); inode_set_ctime(inode, mtime); ios->u.f.last_update = *mtime; old_gen = inode->i_gen; if (spool_host == NULL || host_supports_async_protocols(spool_host)) { /* update generation number */ if (old_genp != NULL) *old_genp = inode->i_gen; inode_increment_gen(inode); if (new_genp != NULL) *new_genp = inode->i_gen; generation_updated = 1; /* XXX provide an option not to start replication here? */ /* if there is no other writing process */ if (ios->u.f.writers == 1) start_replication = 1; } inode_remove_every_other_replicas(inode, spool_host, old_gen, start_replication, fo->u.f.desired_replica_number); return (generation_updated); } int inode_is_opened_for_writing(struct inode *inode) { struct inode_open_state *ios = inode->u.c.state; return (ios != NULL && ios->u.f.writers > 0); } static struct file_copy * inode_get_file_copy(struct inode *inode, struct host *spool_host) { struct file_copy *copy; if (!inode_is_file(inode)) gflog_fatal(GFARM_MSG_1000330, "inode_has_replica: not a file"); for (copy = inode->u.c.s.f.copies; copy != NULL; copy = copy->host_next) { if (copy->host == spool_host) return (copy); } return (NULL); return (0); } int inode_has_replica(struct inode *inode, struct host *spool_host) { struct file_copy *copy = inode_get_file_copy(inode, spool_host); if (copy == NULL) return (0); return (FILE_COPY_IS_VALID(copy)); } gfarm_error_t inode_getdirpath(struct inode *inode, struct process *process, char **namep) { gfarm_error_t e; struct inode *parent, *dei; int ok; struct user *user = process_get_user(process); struct inode *root = inode_lookup(ROOT_INUMBER); Dir dir; DirEntry entry; DirCursor cursor; char *s, *name, *names[GFS_MAX_DIR_DEPTH]; int i, namelen, depth = 0; size_t totallen = 0; int overflow = 0; for (; inode != root; inode = parent) { e = inode_lookup_relative(inode, dotdot, GFS_DT_DIR, INODE_LOOKUP, user, 0, NULL, &parent, NULL); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001757, "inode_lookup_relative() failed: %s", gfarm_error_string(e)); return (e); } e = inode_access(parent, user, GFS_R_OK|GFS_X_OK); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001758, "inode_access() failed: %s", gfarm_error_string(e)); return (e); } /* search the inode in the parent directory. */ /* XXX this is slow. should we create a reverse index? */ dir = inode_get_dir(parent); ok = dir_cursor_set_pos(dir, 0, &cursor); assert(ok); for (;;) { entry = dir_cursor_get_entry(dir, &cursor); assert(entry != NULL); dei = dir_entry_get_inode(entry); assert(dei != NULL); if (dei == inode) break; ok = dir_cursor_next(dir, &cursor); /* * For now, we won't remove a directory * while it's opened */ assert(ok); } name = dir_entry_get_name(entry, &namelen); GFARM_MALLOC_ARRAY(s, namelen + 1); if (depth >= GFS_MAX_DIR_DEPTH || s == NULL) { for (i = 0; i < depth; i++) free(names[i]); gflog_debug(GFARM_MSG_1001759, "allocation of string failed or directory " "too deep"); return (GFARM_ERR_NO_MEMORY); /* directory too deep */ } names[depth++] = s; totallen = gfarm_size_add(&overflow, totallen, namelen); } if (depth == 0) GFARM_MALLOC_ARRAY(s, 1 + 1); else { #ifdef __GNUC__ /* workaround gcc warning: might be used uninitialized */ s = NULL; #endif totallen = gfarm_size_add(&overflow, totallen, depth + 1); if (!overflow) GFARM_MALLOC_ARRAY(s, totallen); } if (s == NULL) { e = GFARM_ERR_NO_MEMORY; gflog_debug(GFARM_MSG_1001760, "allocation of string failed"); } else if (depth == 0) { strcpy(s, "/"); *namep = s; e = GFARM_ERR_NO_ERROR; } else { totallen = 0; for (i = depth - 1; i >= 0; --i) { namelen = strlen(names[i]); sprintf(s + totallen, "/%s", names[i]); totallen += namelen + 1; } *namep = s; e = GFARM_ERR_NO_ERROR; } for (i = 0; i < depth; i++) free(names[i]); return (e); } struct host * inode_writing_spool_host(struct inode *inode) { struct inode_open_state *ios = inode->u.c.state; struct file_opening *fo; if (!inode_is_file(inode)) { gflog_debug(GFARM_MSG_1001761, "not a file"); return (NULL); /* not a file */ } if (ios != NULL && (fo = ios->openings.opening_next) != &ios->openings) { for (; fo != &ios->openings; fo = fo->opening_next) { if ((accmode_to_op(fo->flag) & GFS_W_OK) != 0 && fo->u.f.spool_host != NULL) return (fo->u.f.spool_host); } } return (NULL); } int inode_schedule_confirm_for_write(struct file_opening *opening, struct host *spool_host, int *to_createp) { struct inode_open_state *ios = opening->inode->u.c.state; struct file_opening *fo; struct file_copy *copy; int already_opened, host_match; if (!inode_is_file(opening->inode)) gflog_fatal(GFARM_MSG_1000331, "inode_schedule_confirm_for_write: not a file"); if (ios != NULL && (fo = ios->openings.opening_next) != &ios->openings) { already_opened = host_match = 0; for (; fo != &ios->openings; fo = fo->opening_next) { if ((accmode_to_op(fo->flag) & GFS_W_OK) != 0 && fo->u.f.spool_host != NULL) return (fo->u.f.spool_host == spool_host); if (fo->u.f.spool_host != NULL && host_is_disk_available(fo->u.f.spool_host, 0)) { already_opened = 1; if (fo->u.f.spool_host == spool_host) host_match = 1; } } if (already_opened) return (host_match); } /* not opened */ if (inode_is_creating_file(opening->inode)) { *to_createp = 1; return (1); } copy = inode_get_file_copy(opening->inode, spool_host); if (copy != NULL) { /* * if a replication is ongoing, don't allow to create new one, * because it incurs a race. */ return (FILE_COPY_IS_VALID(copy)); /* == inode_has_replica() */ } if ((opening->flag & GFARM_FILE_TRUNC) != 0 || inode_get_size(opening->inode) == 0) { /* * http://sourceforge.net/apps/trac/gfarm/ticket/68 * (measures against disk full for a file overwriting case) */ *to_createp = 1; return (1); } return (0); } /* this interface is exported for a use from a private extension */ gfarm_error_t inode_schedule_file_default(struct file_opening *opening, struct peer *peer, gfarm_int32_t *np, struct host ***hostsp) { gfarm_error_t e; struct inode_open_state *ios = opening->inode->u.c.state; struct file_opening *fo; int n, nhosts, writing_mode; struct host **hosts; gfarm_off_t necessary_space = 0; /* i.e. use default value */ /* XXX FIXME too long giant lock */ assert(inode_is_file(opening->inode)); if (inode_is_creating_file(opening->inode)) { if (!host_schedule_one_except(peer, 0, NULL, host_is_disk_available_filter, &necessary_space, np, hostsp, &e)) e = host_schedule_all_except(0, NULL, host_is_disk_available_filter, &necessary_space, np, hostsp); return (e); } writing_mode = (accmode_to_op(opening->flag) & GFS_W_OK) != 0; if (writing_mode && ios != NULL && (fo = ios->openings.opening_next) != &ios->openings) { /* try to choose already opened replicas */ n = 0; for (; fo != &ios->openings; fo = fo->opening_next) { if ((accmode_to_op(fo->flag) & GFS_W_OK) != 0 && fo->u.f.spool_host != NULL) { /* * already opened for writing. * only that replica is allowed in this case. */ GFARM_MALLOC_ARRAY(hosts, 1); if (hosts == NULL) return (GFARM_ERR_NO_MEMORY); hosts[0] = fo->u.f.spool_host; *np = 1; *hostsp = hosts; return (GFARM_ERR_NO_ERROR); } if (fo->u.f.spool_host != NULL) n++; } if (n > 0) { /* * already opened for reading. * try to return the opened replicas in this case, * to give a chance to a reader to see the changes * made by this writer. */ /* * need to remember the hosts, because results of * host_is_up()/host_is_disk_available() may change * even while the giant lock is held. */ GFARM_MALLOC_ARRAY(hosts, n); if (hosts == NULL) return (GFARM_ERR_NO_MEMORY); nhosts = 0; for (fo = ios->openings.opening_next; fo != &ios->openings; fo = fo->opening_next) { assert(nhosts < n); if (fo->u.f.spool_host != NULL && host_is_disk_available( fo->u.f.spool_host, 0)) hosts[nhosts++] = fo->u.f.spool_host; } if (nhosts > 0) { /* * there may be duplicated entries in hosts[], * thus we call host_unique_sort() here. */ *np = host_unique_sort(nhosts, hosts); *hostsp = hosts; return (GFARM_ERR_NO_ERROR); } free(hosts); } } if (writing_mode) { /* all replicas are candidates */ e = inode_alloc_file_copy_hosts(opening->inode, file_copy_is_valid_and_disk_available, &necessary_space, &nhosts, &hosts); if (e != GFARM_ERR_NO_ERROR) return (e); if (nhosts > 0) { *np = nhosts; *hostsp = hosts; return (GFARM_ERR_NO_ERROR); } free(hosts); if ((opening->flag & GFARM_FILE_TRUNC) != 0 || inode_get_size(opening->inode) == 0) { /* * If there is no other writer and the size of the file * is zero, it's ok to choose any host unless * a replication is ongoing on the host. * cf. http://sourceforge.net/apps/trac/gfarm/ticket/68 * (measures against disk full for a file overwriting) */ /* exclude hosts which are during a replication */ e = inode_alloc_file_copy_hosts(opening->inode, file_copy_is_invalid, NULL, &nhosts, &hosts); if (e != GFARM_ERR_NO_ERROR) return (e); if (!host_schedule_one_except(peer, nhosts, hosts, host_is_disk_available_filter, &necessary_space, np, hostsp, &e)) e = host_schedule_all_except(nhosts, hosts, host_is_disk_available_filter, &necessary_space, np, hostsp); free(hosts); return (e); } } /* all replicas are candidates */ e = inode_alloc_file_copy_hosts(opening->inode, file_copy_is_valid_and_up, NULL, &nhosts, &hosts); if (e != GFARM_ERR_NO_ERROR) return (e); *np = nhosts; /* NOTE: this may be 0 */ *hostsp = hosts; return(GFARM_ERR_NO_ERROR); } /* this interface is made as a hook for a private extension */ gfarm_error_t (*inode_schedule_file)(struct file_opening *, struct peer *, gfarm_int32_t *, struct host ***) = inode_schedule_file_default; static gfarm_error_t remove_file_copy(struct inode *inode, struct host *spool_host) { struct file_copy **copyp, *copy, **foundp = NULL; for (copyp = &inode->u.c.s.f.copies; (copy = *copyp) != NULL; copyp = ©->host_next) { if (copy->host == spool_host) foundp = copyp; } if (foundp == NULL) { gflog_error(GFARM_MSG_1002326, "remove_file_copy(%lld, %lld, %s): not found", (long long)inode_get_number(inode), (long long)inode_get_gen(inode), host_name(spool_host)); return (GFARM_ERR_NO_SUCH_OBJECT); } copy = *foundp; *foundp = copy->host_next; free(copy); return (GFARM_ERR_NO_ERROR); } gfarm_error_t file_replicating_new(struct inode *inode, struct host *dst, struct dead_file_copy *deferred_cleanup, struct file_replicating **frp) { gfarm_error_t e; struct file_replicating *fr; struct inode_replicating_state *irs = inode->u.c.s.f.rstate; if (!host_is_disk_available(dst, inode_get_size(inode))) return (GFARM_ERR_NO_SPACE); if ((e = inode_add_replica(inode, dst, 0)) != GFARM_ERR_NO_ERROR) return (e); if ((e = host_replicating_new(dst, &fr)) != GFARM_ERR_NO_ERROR) { remove_file_copy(inode, dst); return (e); } if (irs == NULL) { GFARM_MALLOC(irs); if (irs == NULL) { peer_replicating_free(fr); remove_file_copy(inode, dst); return (GFARM_ERR_NO_MEMORY); } /* make circular list `replicating_hosts' empty */ irs->replicating_hosts.prev_host = irs->replicating_hosts.next_host = &irs->replicating_hosts; inode->u.c.s.f.rstate = irs; } fr->prev_host = &irs->replicating_hosts; fr->next_host = irs->replicating_hosts.next_host; irs->replicating_hosts.next_host = fr; fr->next_host->prev_host = fr; fr->inode = inode; fr->igen = inode_get_gen(inode); fr->cleanup = deferred_cleanup; *frp = fr; return (GFARM_ERR_NO_ERROR); } void file_replicating_free(struct file_replicating *fr) { struct inode *inode = fr->inode; struct inode_replicating_state *irs = inode->u.c.s.f.rstate; assert(inode_is_file(inode)); fr->prev_host->next_host = fr->next_host; fr->next_host->prev_host = fr->prev_host; if (irs->replicating_hosts.next_host == &irs->replicating_hosts) { /* all done */ free(inode->u.c.s.f.rstate); inode->u.c.s.f.rstate = NULL; } peer_replicating_free(fr); if (inode->i_nlink == 0 && inode->u.c.state == NULL && inode->u.c.s.f.rstate == NULL) { inode_remove(inode); /* clears `ios->u.f.cksum_owner' too. */ } } gfarm_int64_t file_replicating_get_gen(struct file_replicating *fr) { return (fr->igen); } static gfarm_error_t inode_remove_replica_gen_deferred( struct inode *, struct host *, gfarm_int64_t, int, int, int, struct dead_file_copy **); gfarm_error_t inode_replicated(struct file_replicating *fr, gfarm_int32_t src_errcode, gfarm_int32_t dst_errcode, gfarm_off_t size) { struct inode *inode = fr->inode; int transaction = 0; gfarm_error_t e = GFARM_ERR_NO_ERROR; struct dead_file_copy *dfc; static const char diag[] = "inode_replicated"; if (db_begin(diag) == GFARM_ERR_NO_ERROR) transaction = 1; if (src_errcode == GFARM_ERR_NO_ERROR && dst_errcode == GFARM_ERR_NO_ERROR && size == inode_get_size(inode) && fr->igen == inode_get_gen(inode)) { e = inode_add_replica(inode, fr->dst, 1); } else { if (src_errcode != GFARM_ERR_NO_ERROR || dst_errcode != GFARM_ERR_NO_ERROR) gflog_error(GFARM_MSG_1002257, "error at %lld:%lld replication to %s: " "src=%d dst=%d", (long long)inode_get_number(inode), (long long)fr->igen, host_name(fr->dst), src_errcode, dst_errcode); if (debug_mode && (size != inode_get_size(inode) || fr->igen != inode_get_gen(inode))) gflog_debug(GFARM_MSG_1001763, "invalid replica: " "(gen:%lld, size:%lld) " "should be (gen:%lld, size:%lld)", (long long)fr->igen, (long long)size, (long long)inode_get_gen(inode), (long long)inode_get_size(inode)); e = inode_remove_replica_gen_deferred(inode, fr->dst, fr->igen, 0, 1, 0, &dfc); if (e == GFARM_ERR_NO_ERROR) { removal_pendingq_enqueue(dfc); } else if (e == GFARM_ERR_NO_SUCH_OBJECT) { gflog_info(GFARM_MSG_1002433, "cannot remove an incomplete replica " "(%s, %lld:%lld): probably already removed", host_name(fr->dst), (long long)inode_get_number(inode), (long long)fr->igen); } else { gflog_error(GFARM_MSG_1002434, "cannot remove an incomplete replica " "(%s, %lld:%lld): %s", host_name(fr->dst), (long long)inode_get_number(inode), (long long)fr->igen, gfarm_error_string(e)); } e = GFARM_ERR_INVALID_FILE_REPLICA; } if (fr->cleanup != NULL) { /* * XXX FIXME * the following src_errcode check is somewhat adhoc condition * for a private requirement */ if (src_errcode == GFARM_ERR_NO_ERROR && dead_file_copy_is_removable(fr->cleanup)) removal_pendingq_enqueue(fr->cleanup); else dead_file_copy_mark_deferred(fr->cleanup); } else if (e == GFARM_ERR_NO_ERROR) { /* try to sweep deferred queue */ dead_file_copy_replica_status_changed(inode_get_number(inode), fr->dst); } file_replicating_free(fr); if (transaction) db_end(diag); return (e); } static gfarm_error_t inode_add_replica_internal(struct inode *inode, struct host *spool_host, int flags, int update_quota) { struct file_copy *copy; for (copy = inode->u.c.s.f.copies; copy != NULL; copy = copy->host_next) { if (copy->host == spool_host) { if (FILE_COPY_IS_VALID(copy)) { gflog_warning(GFARM_MSG_1001765, "inode_add_replica: already exists"); return (GFARM_ERR_ALREADY_EXISTS); } else if ((flags & FILE_COPY_VALID) == 0) { gflog_warning(GFARM_MSG_1002484, "inode_add_replica: %s", FILE_COPY_IS_BEING_REMOVED(copy) ? "replication while removal is ongoing" : "replication is already in progress"); return (FILE_COPY_IS_BEING_REMOVED(copy) ? GFARM_ERR_DEVICE_BUSY /* dst is busy */ : GFARM_ERR_OPERATION_ALREADY_IN_PROGRESS); } else if (FILE_COPY_IS_BEING_REMOVED(copy)) { gflog_error(GFARM_MSG_1002485, "inode_add_replica: " "replicated while removal is ongoing"); return (GFARM_ERR_DEVICE_BUSY); /*dst is busy*/ } else { /* file_copy is invalid */ assert(copy->flags == 0); copy->flags |= FILE_COPY_VALID; if (update_quota) quota_update_replica_add(inode); return (GFARM_ERR_NO_ERROR); } } } /* not exist in u.c.s.f.copies : add new replica */ if (update_quota) { gfarm_error_t e; /* check limits of space and number of the replica */ e = quota_check_limits(inode_get_user(inode), inode_get_group(inode), 0, 1); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001767, "checking of limits of the replica failed"); return (e); } } GFARM_MALLOC(copy); if (copy == NULL) { gflog_debug(GFARM_MSG_1001768, "allocation of 'copy' failed"); return (GFARM_ERR_NO_MEMORY); } if (update_quota && (flags & FILE_COPY_VALID) != 0) quota_update_replica_add(inode); copy->host = spool_host; copy->flags = flags; copy->host_next = inode->u.c.s.f.copies; inode->u.c.s.f.copies = copy; return (GFARM_ERR_NO_ERROR); } void inode_dead_file_copy_added(gfarm_ino_t inum, gfarm_int64_t igen, struct host *host) { struct inode *inode = inode_lookup(inum); if (inode == NULL || !inode_is_file(inode)) return; if (igen != inode->i_gen) return; inode_add_replica_internal(inode, host, FILE_COPY_BEING_REMOVED, 0); } /* * 'valid == 0' means that the replica is not ready right now, and * going to be created or removed. */ gfarm_error_t inode_add_replica(struct inode *inode, struct host *spool_host, int valid) { gfarm_error_t e = inode_add_replica_internal( inode, spool_host, valid ? FILE_COPY_VALID : 0, 1); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001769, "inode_add_replica_internal() failed: %s", gfarm_error_string(e)); return (e); } if (!valid) return (GFARM_ERR_NO_ERROR); e = db_filecopy_add(inode->i_number, host_name(spool_host)); if (e != GFARM_ERR_NO_ERROR) gflog_error(GFARM_MSG_1000327, "db_filecopy_add(%lld, %s): %s", (unsigned long long)inode->i_number, host_name(spool_host), gfarm_error_string(e)); return (GFARM_ERR_NO_ERROR); } static gfarm_error_t remove_replica_metadata(struct inode *inode, struct host *spool_host) { gfarm_error_t e; quota_update_replica_remove(inode); e = db_filecopy_remove(inode->i_number, host_name(spool_host)); if (e != GFARM_ERR_NO_ERROR) gflog_error(GFARM_MSG_1000329, "db_filecopy_remove(%lld, %s): %s", (unsigned long long)inode->i_number, host_name(spool_host), gfarm_error_string(e)); return (e); } static gfarm_error_t remove_replica_entity(struct inode *inode, gfarm_int64_t gen, struct host *spool_host, int valid, struct dead_file_copy **deferred_cleanupp) { gfarm_error_t e = GFARM_ERR_NO_ERROR; struct dead_file_copy *dfc; dfc = dead_file_copy_new(inode->i_number, gen, spool_host); if (dfc == NULL) gflog_error(GFARM_MSG_1002260, "remove_replica_entity(%lld, %lld, %s): no memory", (unsigned long long)inode->i_number, (unsigned long long)gen, host_name(spool_host)); else if (deferred_cleanupp == NULL) removal_pendingq_enqueue(dfc); else { dead_file_copy_mark_kept(dfc); /* prevent this from removed */ *deferred_cleanupp = dfc; } if (valid) { e = remove_replica_metadata(inode, spool_host); /* abandon `e' */ } return (dfc == NULL ? GFARM_ERR_NO_MEMORY : GFARM_ERR_NO_ERROR); } void inode_remove_replica_completed(gfarm_ino_t inum, gfarm_int64_t igen, struct host *host) { struct inode *inode = inode_lookup(inum); struct file_copy **copyp, *copy; if (inode == NULL || !inode_is_file(inode)) return; if (igen != inode->i_gen) return; for (copyp = &inode->u.c.s.f.copies; (copy = *copyp) != NULL; copyp = ©->host_next) { if (copy->host == host) { *copyp = copy->host_next; free(copy); return; } } } static gfarm_error_t inode_remove_replica_gen_deferred(struct inode *inode, struct host *spool_host, gfarm_int64_t gen, int do_not_delete_last, int invalid_is_removable, int metadata_only, struct dead_file_copy **deferred_cleanupp) { struct file_copy **copyp, *copy, **foundp = NULL; gfarm_error_t e; int num_replica = 0; if (gen == inode->i_gen) { for (copyp = &inode->u.c.s.f.copies; (copy = *copyp) != NULL; copyp = ©->host_next) { if (copy->host == spool_host) foundp = copyp; if (FILE_COPY_IS_VALID(copy)) ++num_replica; } if (foundp == NULL) { gflog_debug(GFARM_MSG_1001770, "replica to remove not found"); return (GFARM_ERR_NO_SUCH_OBJECT); } copy = *foundp; if (do_not_delete_last && num_replica == 1 && FILE_COPY_IS_VALID(copy)) return (GFARM_ERR_CANNOT_REMOVE_LAST_REPLICA); if (!metadata_only) { if (FILE_COPY_IS_BEING_REMOVED(copy) || (!invalid_is_removable && !FILE_COPY_IS_VALID(copy))) { gflog_debug(GFARM_MSG_1002486, "remove_replica(%lld, %lld, %s): %s", (unsigned long long)inode->i_number, (unsigned long long)gen, host_name(spool_host), FILE_COPY_IS_BEING_REMOVED(copy) ? "being removed" : "invalid"); e = GFARM_ERR_NO_SUCH_OBJECT; } else { e = remove_replica_entity(inode, gen, copy->host, FILE_COPY_IS_VALID(copy), deferred_cleanupp); if (e == GFARM_ERR_NO_ERROR) { copy->flags &= ~FILE_COPY_VALID; copy->flags |= FILE_COPY_BEING_REMOVED; } } } else { if (FILE_COPY_IS_VALID(copy)) { e = remove_replica_metadata(inode, copy->host); } else { gflog_debug(GFARM_MSG_1002487, "remove_replica_metadata(%lld, %lld, %s): " "invalid", (unsigned long long)inode->i_number, (unsigned long long)gen, host_name(spool_host)); e = GFARM_ERR_NO_SUCH_OBJECT; } *foundp = copy->host_next; free(copy); } } else { /* remove_replica_entity() must be already called */ gflog_debug(GFARM_MSG_1002488, "remove_replica%s(%lld, %lld, %s): old, current=%lld", metadata_only ? "_metadata" : "", (unsigned long long)inode->i_number, (unsigned long long)gen, host_name(spool_host), (unsigned long long)inode->i_gen); e = GFARM_ERR_NO_SUCH_OBJECT; } return (e); } gfarm_error_t inode_remove_replica_metadata(struct inode *inode, struct host *spool_host, gfarm_int64_t gen) { return (inode_remove_replica_gen_deferred(inode, spool_host, gen, 0, 0, 1, NULL)); } gfarm_error_t inode_remove_replica_gen(struct inode *inode, struct host *spool_host, gfarm_int64_t gen, int do_not_delete_last) { return (inode_remove_replica_gen_deferred(inode, spool_host, gen, do_not_delete_last, 0, 0, NULL)); } gfarm_error_t inode_remove_replica(struct inode *inode, struct host *spool_host, int do_not_delete_last) { return (inode_remove_replica_gen(inode, spool_host, inode_get_gen(inode), do_not_delete_last)); } gfarm_error_t inode_prepare_to_replicate(struct inode *inode, struct user *user, struct host *src, struct host *dst, gfarm_int32_t flags, struct file_replicating **frp) { gfarm_error_t e; struct file_copy *copy; struct file_replicating *fr; if ((flags & ~GFS_REPLICATE_FILE_FORCE) != 0) return (GFARM_ERR_FUNCTION_NOT_IMPLEMENTED); if ((e = inode_check_file(inode)) != GFARM_ERR_NO_ERROR) return (e); /* have enough privilege? i.e. can read the file? */ if ((e = inode_access(inode, user, GFS_R_OK)) != GFARM_ERR_NO_ERROR) return (e); if (inode_is_creating_file(inode)) /* no file copy */ return (GFARM_ERR_NO_SUCH_OBJECT); if (!inode_has_replica(inode, src)) return (GFARM_ERR_NO_SUCH_OBJECT); if ((copy = inode_get_file_copy(inode, dst)) != NULL) { if (FILE_COPY_IS_VALID(copy)) /* == inode_has_replica() */ return (GFARM_ERR_ALREADY_EXISTS); else if (FILE_COPY_IS_BEING_REMOVED(copy)) return (GFARM_ERR_DEVICE_BUSY); /* dst is busy */ else return (GFARM_ERR_OPERATION_ALREADY_IN_PROGRESS); } if ((flags & GFS_REPLICATE_FILE_FORCE) == 0 && inode_is_opened_for_writing(inode)) return (GFARM_ERR_FILE_BUSY); /* src is busy */ else if ((e = file_replicating_new(inode, dst, NULL, &fr)) != GFARM_ERR_NO_ERROR) return (e); *frp = fr; return (GFARM_ERR_NO_ERROR); } int inode_is_updated(struct inode *inode, struct gfarm_timespec *mtime) { struct inode_open_state *ios = inode->u.c.state; /* * ios->u.f.last_update is necessary, * becasuse i_mtimespec may be modified by GFM_PROTO_FUTIMES. */ return (ios != NULL && gfarm_timespec_cmp(mtime, &ios->u.f.last_update) >= 0); } gfarm_error_t inode_replica_list_by_name(struct inode *inode, gfarm_int32_t *np, char ***hostsp) { struct file_copy *copy; gfarm_error_t e = GFARM_ERR_NO_ERROR; int n, i; char **hosts; static const char diag[] = "inode_replica_list_by_name"; if (inode_is_dir(inode)) { gflog_debug(GFARM_MSG_1001771, "inode is a directory"); return (GFARM_ERR_IS_A_DIRECTORY); } else if (!inode_is_file(inode)) { gflog_debug(GFARM_MSG_1001772, "node is not a file"); return (GFARM_ERR_INVALID_ARGUMENT); } n = inode_get_ncopy(inode); GFARM_MALLOC_ARRAY(hosts, n); if (hosts == NULL) { gflog_debug(GFARM_MSG_1001773, "allocation of 'hosts' failed"); return (GFARM_ERR_NO_MEMORY); } i = 0; for (copy = inode->u.c.s.f.copies; copy != NULL && i < n; copy = copy->host_next) { /* * We have to check i < n, because the results of * host_is_up() may change even while the giant lock is held. */ if (i < n && FILE_COPY_IS_VALID(copy) && host_is_up(copy->host)) { hosts[i] = strdup_log(host_name(copy->host), diag); if (hosts[i] == NULL) { gflog_debug(GFARM_MSG_1001774, "hosts[%d] is null", i); e = GFARM_ERR_NO_MEMORY; break; } ++i; } } if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001775, "error occurred during process: %s", gfarm_error_string(e)); while (--i >= 0) free(hosts[i]); free(hosts); } else { *np = i; *hostsp = hosts; } return (e); } gfarm_error_t inode_replica_info_get(struct inode *inode, gfarm_int32_t iflags, gfarm_int32_t *np, char ***hostsp, gfarm_int64_t **gensp, gfarm_int32_t **oflagsp) { struct file_copy *copy; gfarm_error_t e = GFARM_ERR_NO_ERROR; int n, nlatest, ndead, i; char **hosts; gfarm_int64_t *gens, latest_gen; gfarm_int32_t *oflags; int valid_only = (iflags & GFS_REPLICA_INFO_INCLUDING_INCOMPLETE_COPY) != 0 ? 0 : 1; int up_only = (iflags & GFS_REPLICA_INFO_INCLUDING_DEAD_HOST) != 0 ? 0 : 1; int latest_only = (iflags & GFS_REPLICA_INFO_INCLUDING_DEAD_COPY) != 0 ? 0 : 1; static const char diag[] = "inode_replica_info_get"; if ((e = inode_check_file(inode)) != GFARM_ERR_NO_ERROR) return (e); latest_gen = inode_get_gen(inode); nlatest = inode_get_ncopy_common(inode, valid_only, up_only); if (latest_only) ndead = 0; else ndead = dead_file_copy_count_by_inode(inode_get_number(inode), latest_gen, up_only); n = nlatest + ndead; GFARM_MALLOC_ARRAY(hosts, n); if (hosts == NULL) return (GFARM_ERR_NO_MEMORY); GFARM_MALLOC_ARRAY(gens, n); if (gens == NULL) { free(hosts); return (GFARM_ERR_NO_MEMORY); } GFARM_MALLOC_ARRAY(oflags, n); if (oflags == NULL) { free(gens); free(hosts); return (GFARM_ERR_NO_MEMORY); } i = 0; for (copy = inode->u.c.s.f.copies; copy != NULL && i < n; copy = copy->host_next) { /* * We have to check i < n, because the results of * host_is_up() may change even while the giant lock is held. */ if (i < n && (valid_only ? FILE_COPY_IS_VALID(copy) : 1) && (up_only ? host_is_up(copy->host) : 1)) { hosts[i] = strdup_log(host_name(copy->host), diag); gens[i] = latest_gen; oflags[i] = (!FILE_COPY_IS_VALID(copy) ? GFM_PROTO_REPLICA_FLAG_INCOMPLETE : 0) | (!host_is_up(copy->host) ? GFM_PROTO_REPLICA_FLAG_DEAD_HOST : 0); if (hosts[i] == NULL) { e = GFARM_ERR_NO_MEMORY; break; } ++i; } } if (e == GFARM_ERR_NO_ERROR && !latest_only) e = dead_file_copy_info_by_inode( inode_get_number(inode), latest_gen, up_only, &ndead, &hosts[i], &gens[i], &oflags[i]); if (e != GFARM_ERR_NO_ERROR) { while (--i >= 0) free(hosts[i]); free(oflags); free(gens); free(hosts); } else { *np = nlatest + ndead; *hostsp = hosts; *gensp = gens; *oflagsp = oflags; } return (e); } /* * loading metadata from persistent storage. */ /* The memory owner of `*st' is changed to inode.c */ void inode_add_one(void *closure, struct gfs_stat *st) { gfarm_error_t e; struct inode *inode; inode = inode_alloc_num(st->st_ino); if (inode == NULL) { gflog_error(GFARM_MSG_1000334, "cannot allocate inode %lld", (unsigned long long)st->st_ino); e = GFARM_ERR_UNKNOWN; } else if (GFARM_S_ISDIR(st->st_mode)) { e = inode_init_dir_internal(inode); } else if (GFARM_S_ISREG(st->st_mode)) { e = inode_init_file(inode); } else if (GFARM_S_ISLNK(st->st_mode)) { e = inode_init_symlink(inode, NULL); } else if (st->st_mode == INODE_MODE_FREE) { inode_clear(inode); e = GFARM_ERR_NO_ERROR; } else { gflog_error(GFARM_MSG_1000335, "unknown inode type %lld, mode 0%o", (unsigned long long)st->st_ino, st->st_mode); e = GFARM_ERR_UNKNOWN; assert(0); } if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001776, "inode_alloc_num() failed"); if (e != GFARM_ERR_UNKNOWN) { gflog_error(GFARM_MSG_1000336, "inode %lld: %s", (unsigned long long)st->st_ino, gfarm_error_string(e)); } gfs_stat_free(st); return; } inode->i_gen = st->st_gen; inode->i_nlink = st->st_nlink; inode->i_size = st->st_size; inode->i_mode = st->st_mode; inode->i_user = user_lookup(st->st_user); inode->i_group = group_lookup(st->st_group); inode->i_atimespec = st->st_atimespec; inode->i_mtimespec = st->st_mtimespec; inode->i_ctimespec = st->st_ctimespec; gfs_stat_free(st); } /* The memory owner of `type' and `sum' is changed to inode.c */ void inode_cksum_add_one(void *closure, gfarm_ino_t inum, char *type, size_t len, char *sum) { struct inode *inode = inode_lookup(inum); if (inode == NULL) { gflog_error(GFARM_MSG_1000337, "inode_cksum_add_one: no inode %lld", (unsigned long long)inum); } else if (!inode_is_file(inode)) { gflog_error(GFARM_MSG_1000338, "inode_cksum_add_one: not file %lld", (unsigned long long)inum); } else if (inode->u.c.s.f.cksum != NULL) { gflog_error(GFARM_MSG_1000339, "inode_cksum_add_one: dup cksum %lld", (unsigned long long)inum); } else { inode_cksum_set_internal(inode, type, len, sum); } free(type); free(sum); } /* The memory owner of `source_path' is changed to inode.c */ void symlink_add_one(void *closure, gfarm_ino_t inum, char *source_path) { struct inode *inode = inode_lookup(inum); if (inode == NULL) { gflog_error(GFARM_MSG_1000340, "symlink_add_one: no inode %lld", (unsigned long long)inum); } else if (!inode_is_symlink(inode)) { gflog_error(GFARM_MSG_1000341, "symlink_add_one: not symlink %lld", (unsigned long long)inum); } else if (inode->u.c.s.l.source_path != NULL) { gflog_error(GFARM_MSG_1000342, "symlink_add_one: dup symlink %lld", (unsigned long long)inum); } else { inode->u.c.s.l.source_path = source_path; return; /* to skip free(source_path); */ } free(source_path); } /* The memory owner of `hostname' is changed to inode.c */ void file_copy_add_one(void *closure, gfarm_ino_t inum, char *hostname) { gfarm_error_t e; struct inode *inode = inode_lookup(inum); struct host *host = host_lookup(hostname); if (inode == NULL) { gflog_error(GFARM_MSG_1000343, "file_copy_add_one: no inode %lld", (unsigned long long)inum); } else if (!inode_is_file(inode)) { gflog_error(GFARM_MSG_1000344, "file_copy_add_one: not file %lld", (unsigned long long)inum); } else if (host == NULL) { gflog_error(GFARM_MSG_1000345, "file_copy_add_one: no host %s", hostname); } else if ((e = inode_add_replica_internal(inode, host, FILE_COPY_VALID, 0)) != GFARM_ERR_NO_ERROR) { gflog_error(GFARM_MSG_1000346, "file_copy_add_one: add_replica: %s", gfarm_error_string(e)); } free(hostname); } /* The memory owner of `entry_name' is changed to inode.c */ void dir_entry_add_one(void *closure, gfarm_ino_t dir_inum, char *entry_name, int entry_len, gfarm_ino_t entry_inum) { struct inode *dir_inode = inode_lookup(dir_inum); struct inode *entry_inode = inode_lookup(entry_inum); DirEntry entry; int created; if (dir_inode == NULL) { gflog_error(GFARM_MSG_1000350, "dir_entry_add_one: no dir %lld", (unsigned long long)dir_inum); } else if (!inode_is_dir(dir_inode)) { gflog_error(GFARM_MSG_1000351, "dir_entry_add_one: not dir %lld", (unsigned long long)dir_inum); } else if (entry_inode == NULL) { gflog_error(GFARM_MSG_1000352, "dir_entry_add_one: no %lld", (unsigned long long)entry_inum); } else if ((entry = dir_enter(dir_inode->u.c.s.d.entries, entry_name, entry_len, &created)) == NULL) { gflog_error(GFARM_MSG_1000353, "dir_entry_add_one: no memory"); } else if (!created) { gflog_error(GFARM_MSG_1000354, "dir_entry_add_one: already exists "); } else { dir_entry_set_inode(entry, entry_inode); inode_increment_nlink_ini(entry_inode); } free(entry_name); } void inode_init(void) { gfarm_error_t e; struct inode *root; struct gfs_stat st; if (!inode_free_list_initialized) inode_free_list_init(); e = db_inode_load(NULL, inode_add_one); if (e != GFARM_ERR_NO_ERROR) gflog_error(GFARM_MSG_1000355, "loading inode: %s", gfarm_error_string(e)); e = db_inode_cksum_load(NULL, inode_cksum_add_one); if (e != GFARM_ERR_NO_ERROR && e != GFARM_ERR_NO_SUCH_OBJECT /* XXX */) gflog_error(GFARM_MSG_1000356, "loading inode cksum: %s", gfarm_error_string(e)); root = inode_lookup(ROOT_INUMBER); if (root != NULL) return; gflog_info(GFARM_MSG_1000357, "root inode not found, creating filesystem"); /* root inode */ st.st_ino = ROOT_INUMBER; st.st_gen = 0; st.st_nlink = 2; st.st_size = 4; st.st_mode = GFARM_S_IFDIR | 0775; st.st_user = strdup_ck(ADMIN_USER_NAME, "inode_init"); st.st_group = strdup_ck(ADMIN_GROUP_NAME, "inode_init"); touch(&st.st_atimespec); st.st_ctimespec = st.st_mtimespec = st.st_atimespec; /* inode_add_one will free(st). need to call db_inode_add before it */ e = db_inode_add(&st); inode_add_one(NULL, &st); if (e != GFARM_ERR_NO_ERROR) gflog_error(GFARM_MSG_1000358, "failed to store root inode to storage: %s", gfarm_error_string(e)); /* root directory */ dir_entry_add_one(NULL, ROOT_INUMBER, strdup_ck(dot, "inode_init: \".\""), DOT_LEN, ROOT_INUMBER); dir_entry_add_one(NULL, ROOT_INUMBER, strdup_ck(dotdot, "inode_init: \"..\""), DOTDOT_LEN, ROOT_INUMBER); e = db_direntry_add(ROOT_INUMBER, dot, DOT_LEN, ROOT_INUMBER); if (e != GFARM_ERR_NO_ERROR) gflog_error(GFARM_MSG_1000359, "failed to store '.' in root directory to storage: %s", gfarm_error_string(e)); e = db_direntry_add(ROOT_INUMBER, dotdot, DOTDOT_LEN, ROOT_INUMBER); if (e != GFARM_ERR_NO_ERROR) gflog_error(GFARM_MSG_1000360, "failed to store '..' in root directory to storage: %s", gfarm_error_string(e)); } void file_copy_init(void) { gfarm_error_t e; e = db_filecopy_load(NULL, file_copy_add_one); if (e != GFARM_ERR_NO_ERROR) gflog_error(GFARM_MSG_1000361, "loading filecopy: %s", gfarm_error_string(e)); } static void nlink_check(void *closure, struct inode *inode) { gfarm_error_t e; /* XXX - nlink of a directory is the constant 2 for now */ if (inode_is_dir(inode)) { if (inode_get_nlink(inode) != 2) { gflog_warning(GFARM_MSG_1002489, "directory inode %lld nlink %lld should be 2 " "(really %lld): fixed", (long long)inode_get_number(inode), (long long)inode_get_nlink(inode), (long long)inode_get_nlink_ini(inode)); inode->i_nlink = 2; } else return; } else if (inode_get_nlink(inode) != inode_get_nlink_ini(inode)) { gflog_warning(GFARM_MSG_1002490, "inode %lld nlink %lld should be %lld: fixed", (long long)inode_get_number(inode), (long long)inode_get_nlink(inode), (long long)inode_get_nlink_ini(inode)); inode->i_nlink = inode_get_nlink_ini(inode); if (inode_get_nlink_ini(inode) == 0) { gflog_warning(GFARM_MSG_1002491, "inode %lld is not referenced, moving to /%s", (long long)inode_get_number(inode), lost_found); /* move to the /lost+found directory */ e = inode_link_to_lost_found(inode); if (e != GFARM_ERR_NO_ERROR) { gflog_error(GFARM_MSG_1002492, "failed to link inode %lld in /%s: %s", (unsigned long long)inode->i_number, lost_found, gfarm_error_string(e)); return; } } } else return; e = db_inode_nlink_modify( inode_get_number(inode), inode_get_nlink(inode)); if (e != GFARM_ERR_NO_ERROR) gflog_error(GFARM_MSG_1002493, "db_inode_nlink_modify(%lld): %s", (unsigned long long)inode->i_number, gfarm_error_string(e)); } void inode_nlink_check(void) { inode_lookup_all(NULL, nlink_check); } void dir_entry_init(void) { gfarm_error_t e; e = db_direntry_load(NULL, dir_entry_add_one); if (e != GFARM_ERR_NO_ERROR) gflog_error(GFARM_MSG_1000363, "loading direntry: %s", gfarm_error_string(e)); } void symlink_init(void) { gfarm_error_t e; e = db_symlink_load(NULL, symlink_add_one); if (e != GFARM_ERR_NO_ERROR) gflog_error(GFARM_MSG_1000364, "loading symlink: %s", gfarm_error_string(e)); } /* implemented here to refer dot and dotdot */ int dir_is_empty(Dir dir) { DirEntry entry; DirCursor cursor; char *name; int namelen; if (!dir_cursor_set_pos(dir, 0, &cursor)) { gflog_error(GFARM_MSG_1000365, "dir_emptry: cannot get cursor"); abort(); } for (;;) { entry = dir_cursor_get_entry(dir, &cursor); if (entry == NULL) return (1); name = dir_entry_get_name(entry, &namelen); if ((namelen != DOT_LEN || memcmp(name, dot, DOT_LEN) != 0) && (namelen!=DOTDOT_LEN || memcmp(name,dotdot,DOTDOT_LEN)!=0)) return (0); if (!dir_cursor_next(dir, &cursor)) return (1); } } static struct xattr_entry * xattr_entry_alloc(const char *attrname) { struct xattr_entry *entry; static const char diag[] = "xattr_entry_alloc"; GFARM_CALLOC_ARRAY(entry, 1); if (entry == NULL) { gflog_debug(GFARM_MSG_1001777, "allocation of 'xattr_entry' failed"); return NULL; } if ((entry->name = strdup_log(attrname, diag)) == NULL) { free(entry); return NULL; } entry->cached_attrvalue = NULL; entry->cached_attrsize = 0; return entry; } static void xattr_entry_free(struct xattr_entry *entry) { if (entry != NULL) { free(entry->name); if (entry->cached_attrvalue != NULL) free(entry->cached_attrvalue); free(entry); } } static struct xattr_entry * xattr_add(struct xattrs *xattrs, int xmlMode, const char *attrname, const void *value, int size) { struct xattr_entry *entry, *tail; entry = xattr_entry_alloc(attrname); if (entry == NULL) { gflog_debug(GFARM_MSG_1001778, "allocation of 'xattr_entry' failure"); return NULL; } if (!xmlMode && gfarm_xattr_caching(attrname) && value != NULL) { /* since malloc(0) is not portable */ entry->cached_attrvalue = malloc(size == 0 ? 1 : size); if (entry->cached_attrvalue == NULL) { gflog_warning(GFARM_MSG_1002494, "trying to cache %d bytes for attr %s: no memory", size, attrname); } else { memcpy(entry->cached_attrvalue, value, size); entry->cached_attrsize = size; } } if (xattrs->head == NULL) { xattrs->head = xattrs->tail = entry; entry->prev = NULL; } else { tail = xattrs->tail; entry->prev = tail; tail->next = entry; xattrs->tail = entry; } return entry; } /* The memory owner is NOT changed to inode.c for now */ void xattr_add_one(void *closure, struct xattr_info *info) { struct inode *inode = inode_lookup(info->inum); struct xattrs *xattrs; if (inode == NULL) gflog_error(GFARM_MSG_1000366, "xattr_add_one: no file %lld", (unsigned long long)info->inum); else { int xmlMode = (closure != NULL) ? *(int*)closure : 0; xattrs = (xmlMode ? &inode->i_xmlattrs : &inode->i_xattrs); if (xattr_add(xattrs, xmlMode, info->attrname, info->attrvalue, info->attrsize) == NULL) gflog_error(GFARM_MSG_1000367, "xattr_add_one: " "cannot add attrname %s to %lld", info->attrname, (unsigned long long)info->inum); } } void xattr_init(void) { gfarm_error_t e; int xmlMode; xmlMode = 0; e = db_xattr_load(&xmlMode, xattr_add_one); if (e != GFARM_ERR_NO_ERROR) gflog_error(GFARM_MSG_1000368, "loading xattr: %s", gfarm_error_string(e)); #ifdef ENABLE_XMLATTR xmlMode = 1; e = db_xattr_load(&xmlMode, xattr_add_one); if (e != GFARM_ERR_NO_ERROR) gflog_error(GFARM_MSG_1000369, "loading xmlattr: %s", gfarm_error_string(e)); #endif } static struct xattr_entry * xattr_find(struct xattrs *xattrs, const char *attrname) { struct xattr_entry *entry; entry = xattrs->head; while (entry != NULL) { if (strcmp(entry->name, attrname) == 0) { return entry; } entry = entry->next; } return NULL; } gfarm_error_t inode_xattr_add(struct inode *inode, int xmlMode, const char *attrname, void *value, size_t size) { gfarm_error_t e; struct xattrs *xattrs = xmlMode ? &inode->i_xmlattrs : &inode->i_xattrs; if (xattr_find(xattrs, attrname) != NULL) { gflog_debug(GFARM_MSG_1001779, "xattr of inode already exists: %s", attrname); e = GFARM_ERR_ALREADY_EXISTS; } else if (xattr_add(xattrs, xmlMode, attrname, value, size) != NULL) { e = GFARM_ERR_NO_ERROR; } else { gflog_debug(GFARM_MSG_1001780, "xattr_add() failed : %s", attrname); e = GFARM_ERR_NO_MEMORY; } return e; } gfarm_error_t inode_xattr_modify(struct inode *inode, int xmlMode, const char *attrname, void *value, size_t size) { struct xattrs *xattrs = xmlMode ? &inode->i_xmlattrs : &inode->i_xattrs; struct xattr_entry *entry = xattr_find(xattrs, attrname); if (entry == NULL) return (GFARM_ERR_NO_SUCH_OBJECT); if (entry->cached_attrvalue != NULL) { free(entry->cached_attrvalue); entry->cached_attrvalue = NULL; entry->cached_attrsize = 0; } if (!xmlMode && gfarm_xattr_caching(attrname)) { entry->cached_attrvalue = malloc(size); if (entry->cached_attrvalue == NULL) { gflog_warning(GFARM_MSG_1002495, "trying to cache %d bytes for attr %s: no memory", (int)size, attrname); } else { memcpy(entry->cached_attrvalue, value, size); entry->cached_attrsize = size; } } return (GFARM_ERR_NO_ERROR); } gfarm_error_t inode_xattr_get_cache(struct inode *inode, int xmlMode, const char *attrname, void **cached_valuep, size_t *cached_sizep) { struct xattrs *xattrs = xmlMode ? &inode->i_xmlattrs : &inode->i_xattrs; struct xattr_entry *entry; void *r; entry = xattr_find(xattrs, attrname); if (entry == NULL) return (GFARM_ERR_NO_SUCH_OBJECT); if (entry->cached_attrvalue == NULL || (r = malloc(entry->cached_attrsize)) == NULL) { *cached_valuep = NULL; *cached_sizep = 0; } else { memcpy(r, entry->cached_attrvalue, entry->cached_attrsize); *cached_valuep = r; *cached_sizep = entry->cached_attrsize; } return (GFARM_ERR_NO_ERROR); } void inode_xattr_list_free(struct xattr_list *list, size_t n) { int i; for (i = 0; i < n; i++) { free(list[i].name); if (list[i].value != NULL) free(list[i].value); } free(list); } gfarm_error_t inode_xattr_list_get_cached_by_patterns(gfarm_ino_t inum, char **patterns, int npattern, struct xattr_list **listp, size_t *np) { struct inode *inode; size_t nxattrs; struct xattr_list *list; struct xattrs *xattrs; struct xattr_entry *entry; int i, j; static const char diag[] = "inode_xattr_list_get_cached_by_patterns"; inode = inode_lookup(inum); if (inode == NULL) return (GFARM_ERR_NO_SUCH_FILE_OR_DIRECTORY); xattrs = &inode->i_xattrs; entry = xattrs->head; if (entry == NULL) { *np = 0; *listp = NULL; return (GFARM_ERR_NO_ERROR); } nxattrs = 0; for (; entry != NULL; entry = entry->next) { for (j = 0; j < npattern; j++) { if (gfarm_pattern_match(patterns[j], entry->name, 0)) { ++nxattrs; break; } } } GFARM_CALLOC_ARRAY(list, nxattrs); if (list == NULL) return (GFARM_ERR_NO_MEMORY); for (entry = xattrs->head, i = 0; entry != NULL && i < nxattrs; entry = entry->next) { for (j = 0; j < npattern; j++) { if (gfarm_pattern_match(patterns[j], entry->name, 0)) { list[i].name = strdup_log(entry->name, diag); if (list[i].name == NULL) { nxattrs = i; break; } if (entry->cached_attrvalue == NULL) { /* not cached */ list[i].value = NULL; list[i].size = 0; } else { /* cached */ list[i].value = malloc(entry->cached_attrsize); if (list[i].value == NULL) { list[i].size = 0; } else { memcpy(list[i].value, entry->cached_attrvalue, entry->cached_attrsize); list[i].size = entry->cached_attrsize; } } i++; break; } } } *np = nxattrs; *listp = list; return (GFARM_ERR_NO_ERROR); } int inode_xattr_has_xmlattrs(struct inode *inode) { #ifdef ENABLE_XMLATTR return (inode->i_xmlattrs.head != NULL); #else return 0; #endif } gfarm_error_t inode_xattr_remove(struct inode *inode, int xmlMode, const char *attrname) { struct xattrs *xattrs = xmlMode ? &inode->i_xmlattrs : &inode->i_xattrs; struct xattr_entry *entry, *prev, *next; entry = xattr_find(xattrs, attrname); if (entry != NULL) { prev = entry->prev; // NULL if entry is head next = entry->next; // NULL if entry is tail if (entry == xattrs->head) xattrs->head = next; else prev->next = next; if (entry == xattrs->tail) xattrs->tail = prev; else next->prev = prev; xattr_entry_free(entry); return GFARM_ERR_NO_ERROR; } else { gflog_debug(GFARM_MSG_1001781, "xattr of inode does not exist"); return GFARM_ERR_NO_SUCH_OBJECT; } } gfarm_error_t inode_xattr_list(struct inode *inode, int xmlMode, char **namesp, size_t *sizep) { struct xattrs *xattrs = xmlMode ? &inode->i_xmlattrs : &inode->i_xattrs; struct xattr_entry *entry = NULL; char *names, *p; int size = 0, len; *namesp = NULL; *sizep = 0; entry = xattrs->head; while (entry != NULL) { size += (strlen(entry->name) + 1); entry = entry->next; } if (size == 0) return GFARM_ERR_NO_ERROR; if (GFARM_MALLOC_ARRAY(names, size) == NULL) { gflog_debug(GFARM_MSG_1001782, "allocation of 'names' failed"); return GFARM_ERR_NO_MEMORY; } entry = xattrs->head; p = names; while (entry != NULL) { len = strlen(entry->name) + 1; // +1 is '\0' memcpy(p, entry->name, len); p += len; entry = entry->next; } *namesp = names; *sizep = size; return GFARM_ERR_NO_ERROR; } /* Ensure that the "gfarm.ncopy" xattr is always cached. */ void inode_init_desired_number(void) { if (!gfarm_xattr_caching("gfarm.ncopy")) gfarm_xattr_caching_pattern_add("gfarm.ncopy"); } /* This assumes that the "gfarm.ncopy" xattr is cached. */ int inode_has_desired_number(struct inode *inode, int *desired_numberp) { void *value; size_t size; unsigned char *s; int i, n; if (inode_xattr_get_cache(inode, 0, "gfarm.ncopy", &value, &size) != GFARM_ERR_NO_ERROR) return (0); if (value == NULL) return (0); s = value; for (i = 0; i < size && isspace(s[i]); i++) ; if (i < size && isdigit(s[i])) { n = 0; for (; i < size && isdigit(s[i]); i++) n = n * 10 + (s[i] - '0'); *desired_numberp = n; free(value); return (1); } free(value); return (0); } int inode_traverse_desired_replica_number(struct inode *dir, int *desired_numberp) { DirEntry entry; for (;;) { if (!inode_is_dir(dir)) return (0); if (inode_has_desired_number(dir, desired_numberp)) return (1); if (inode_get_number(dir) == ROOT_INUMBER) return (0); entry = dir_lookup(dir->u.c.s.d.entries, dotdot, DOTDOT_LEN); if (entry == NULL) return (GFARM_ERR_NO_SUCH_FILE_OR_DIRECTORY); dir = dir_entry_get_inode(entry); } } #if 1 /* DEBUG */ void dir_dump(gfarm_ino_t i_number) { gfarm_error_t e; struct inode *inode = inode_lookup(i_number), *entry_inode; Dir dir; DirCursor cursor; int ok; char *name; if (inode == NULL) { gflog_info(GFARM_MSG_1000370, "inode_lookup %lld failed", (unsigned long long)i_number); return; } dir = inode_get_dir(inode); if (dir == NULL) { gflog_info(GFARM_MSG_1000371, "inode %lld is not a directory", (unsigned long long)i_number); return; } ok = dir_cursor_set_pos(dir, 0, &cursor); if (!ok) { gflog_info(GFARM_MSG_1000372, "dir inode %lld cannot seek to 0", (unsigned long long)i_number); return; } gflog_info(GFARM_MSG_1000373, "dir inode %lld dump start:", (unsigned long long)i_number); for (;;) { if ((e = dir_cursor_get_name_and_inode(dir, &cursor, &name, &entry_inode)) != GFARM_ERR_NO_ERROR || name == NULL) { gflog_debug(GFARM_MSG_1001783, "dir_cursor_get_name_and_inode() failed: %s", gfarm_error_string(e)); break; } gflog_info(GFARM_MSG_1000374, "entry %s (len=%d) inum %lld", name, (int)strlen(name), (unsigned long long)inode_get_number(entry_inode)); free(name); if (!dir_cursor_next(dir, &cursor)) break; } gflog_info(GFARM_MSG_1000375, "dir inode %lld dump end", (unsigned long long)i_number); } void rootdir_dump(void) { dir_dump(ROOT_INUMBER); } #endif /* DEBUG */ gfarm-2.4.1/server/gfmd/group.h0000644000000000000000000000321611507222724015044 0ustar rootrootvoid group_init(void); struct user; struct group; struct group_assignment { /* end marker: {ga->user_prev, ga->user_next} == &ga->g->users */ struct group_assignment *user_prev, *user_next; /* end marker: {ga->group_prev, ga->group_next} == &ga->u->groups */ struct group_assignment *group_prev, *group_next; struct user *u; struct group *g; }; extern char ADMIN_GROUP_NAME[]; /* can modify host/user/group info of gfarm */ extern char ROOT_GROUP_NAME[]; /* can modify any data/metadata in gfarmfs */ struct group *group_lookup(const char *); gfarm_error_t grpassign_add(struct user *, struct group *); void grpassign_remove(struct group_assignment *); char *group_name(struct group *); int group_is_invalidated(struct group *); int group_is_active(struct group *); void group_all(void *, void (*)(void *, struct group *), int); struct quota; struct quota *group_quota(struct group *); struct peer; gfarm_error_t gfm_server_group_info_get_all(struct peer *, int, int); gfarm_error_t gfm_server_group_info_get_by_names(struct peer *, int, int); gfarm_error_t gfm_server_group_info_set(struct peer *, int, int); gfarm_error_t gfm_server_group_info_modify(struct peer *, int, int); gfarm_error_t gfm_server_group_info_remove(struct peer *, int, int); gfarm_error_t gfm_server_group_info_add_users(struct peer *, int, int); gfarm_error_t gfm_server_group_info_remove_users(struct peer *, int, int); gfarm_error_t gfm_server_group_names_get_by_users(struct peer *, int, int); /* exported for a use from a private extension */ gfarm_error_t group_info_remove_default(const char *, const char *); extern gfarm_error_t (*group_info_remove)(const char *, const char *); gfarm-2.4.1/server/gfmd/thrpool.h0000644000000000000000000000025611507222724015400 0ustar rootrootstruct thread_pool; struct thread_pool *thrpool_new(int, int, const char *); void thrpool_add_job(struct thread_pool *, void *(*)(void *), void *); void thrpool_info(void); gfarm-2.4.1/server/gfmd/gfmd.h0000644000000000000000000000155011507222724014624 0ustar rootrootstruct peer; struct event_waiter { struct event_waiter *next; struct peer *peer; gfarm_error_t (*action)(struct peer *, void *, int *); void *arg; }; void resuming_enqueue(struct event_waiter *); /* * The following part exports hook points for a private extension. * * The official gfmd source code shouldn't use these interface. */ extern struct thread_pool *authentication_thread_pool; extern struct thread_pool *sync_protocol_thread_pool; gfarm_error_t gfm_server_protocol_extension_default(struct peer *, int, int, int, gfarm_int32_t, gfarm_int32_t *, gfarm_error_t *); extern gfarm_error_t (*gfm_server_protocol_extension)(struct peer *, int, int, int, gfarm_int32_t, gfarm_int32_t *, gfarm_error_t *); int protocol_service(struct peer *); void *protocol_main(void *); void gfmd_modules_init_default(int); extern void (*gfmd_modules_init)(int); gfarm-2.4.1/server/gfmd/fs.c0000644000000000000000000027557211507222724014333 0ustar rootroot#include /* db_access.h currently needs this */ #include #include /* for "gfp_xdr.h" */ #include #include #include #define GFARM_INTERNAL_USE #include #include #include #include #include "gfutil.h" #include "patmatch.h" #include "gfp_xdr.h" #include "auth.h" #include "gfm_proto.h" #include "subr.h" #include "db_access.h" #include "host.h" #include "user.h" #include "group.h" #include "dead_file_copy.h" #include "dir.h" #include "inode.h" #include "process.h" #include "peer.h" #include "back_channel.h" #include "fs.h" gfarm_error_t gfm_server_compound_begin(struct peer *peer, int from_client, int skip, int level) { gfarm_error_t e = GFARM_ERR_NO_ERROR; static const char diag[] = "GFM_PROTO_COMPOUND_BEGIN"; if (skip) return (GFARM_ERR_NO_ERROR); if (level > 0) /* We don't allow nesting */ e = GFARM_ERR_INVALID_ARGUMENT; return (gfm_server_put_reply(peer, diag, e, "")); } gfarm_error_t gfm_server_compound_end(struct peer *peer, int from_client, int skip, int level) { gfarm_error_t e = GFARM_ERR_NO_ERROR; static const char diag[] = "GFM_PROTO_COMPOUND_END"; if (skip) return (GFARM_ERR_NO_ERROR); if (level < 1) /* nesting doesn't match */ e = GFARM_ERR_INVALID_ARGUMENT; return (gfm_server_put_reply(peer, diag, e, "")); } gfarm_error_t gfm_server_compound_on_error(struct peer *peer, int from_client, int skip, int level, gfarm_error_t *on_errorp) { gfarm_error_t e = GFARM_ERR_NO_ERROR, on_error; static const char diag[] = "GFM_PROTO_COMPOUND_ON_ERROR"; e = gfm_server_get_request(peer, diag, "i", &on_error); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001784, "compound_on_error request failed: %s", gfarm_error_string(e)); return (e); } if (skip) return (GFARM_ERR_NO_ERROR); if (level < 1) /* there isn't COMPOUND_BEGIN ... END block around */ e = GFARM_ERR_INVALID_ARGUMENT; else *on_errorp = on_error; return (gfm_server_put_reply(peer, diag, e, "")); } gfarm_error_t gfm_server_get_fd(struct peer *peer, int from_client, int skip) { gfarm_error_t e; gfarm_int32_t fd; struct process *process; static const char diag[] = "GFM_PROTO_GET_FD"; e = gfm_server_get_request(peer, diag, ""); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001785, "get_fd request failed: %s", gfarm_error_string(e)); return (e); } if (skip) return (GFARM_ERR_NO_ERROR); giant_lock(); if ((process = peer_get_process(peer)) == NULL) e = GFARM_ERR_OPERATION_NOT_PERMITTED; else if ((e = peer_fdpair_get_current(peer, &fd)) != GFARM_ERR_NO_ERROR) ; else e = peer_fdpair_externalize_current(peer); giant_unlock(); return (gfm_server_put_reply(peer, diag, e, "i", fd)); } gfarm_error_t gfm_server_put_fd(struct peer *peer, int from_client, int skip) { gfarm_error_t e; gfarm_int32_t fd; struct process *process; static const char diag[] = "GFM_PROTO_GET_FD"; e = gfm_server_get_request(peer, diag, "i", &fd); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001786, "put_fd request failed: %s", gfarm_error_string(e)); return (e); } if (skip) return (GFARM_ERR_NO_ERROR); giant_lock(); if ((process = peer_get_process(peer)) == NULL) e = GFARM_ERR_OPERATION_NOT_PERMITTED; else if ((e = process_verify_fd(process, fd)) != GFARM_ERR_NO_ERROR) ; else { peer_fdpair_set_current(peer, fd); e = peer_fdpair_externalize_current(peer); } giant_unlock(); return (gfm_server_put_reply(peer, diag, e, "")); } gfarm_error_t gfm_server_save_fd(struct peer *peer, int from_client, int skip) { gfarm_error_t e; struct process *process; static const char diag[] = "GFM_PROTO_SAVE_FD"; e = gfm_server_get_request(peer, diag, ""); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001787, "save_fd request failed: %s", gfarm_error_string(e)); return (e); } if (skip) return (GFARM_ERR_NO_ERROR); giant_lock(); if ((process = peer_get_process(peer)) == NULL) e = GFARM_ERR_OPERATION_NOT_PERMITTED; else e = peer_fdpair_save(peer); giant_unlock(); return (gfm_server_put_reply(peer, diag, e, "")); } gfarm_error_t gfm_server_restore_fd(struct peer *peer, int from_client, int skip) { gfarm_error_t e; struct process *process; static const char diag[] = "GFM_PROTO_RESTORE_FD"; e = gfm_server_get_request(peer, diag, ""); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001788, "restore_fd request failed: %s", gfarm_error_string(e)); return (e); } if (skip) return (GFARM_ERR_NO_ERROR); giant_lock(); if ((process = peer_get_process(peer)) == NULL) e = GFARM_ERR_OPERATION_NOT_PERMITTED; else e = peer_fdpair_restore(peer); giant_unlock(); return (gfm_server_put_reply(peer, diag, e, "")); } /* this assumes that giant_lock is already acquired */ gfarm_error_t gfm_server_open_common(const char *diag, struct peer *peer, int from_client, char *name, gfarm_int32_t flag, int to_create, gfarm_int32_t mode, gfarm_ino_t *inump, gfarm_uint64_t *genp, gfarm_int32_t *modep) { gfarm_error_t e; struct host *spool_host = NULL; struct process *process; int op; struct inode *base, *inode; int created, desired_number, transaction = 0;; gfarm_int32_t cfd, fd = -1; if (!from_client && (spool_host = peer_get_host(peer)) == NULL) { gflog_debug(GFARM_MSG_1001789, "operation is not permitted"); return (GFARM_ERR_OPERATION_NOT_PERMITTED); } if ((process = peer_get_process(peer)) == NULL) { gflog_debug(GFARM_MSG_1001790, "operation is not permitted: peer_get_process() " "failed"); return (GFARM_ERR_OPERATION_NOT_PERMITTED); } if (process_get_user(process) == NULL) { gflog_debug(GFARM_MSG_1001791, "operation is not permitted: process_get_user() " "failed"); return (GFARM_ERR_OPERATION_NOT_PERMITTED); } if ((e = peer_fdpair_get_current(peer, &cfd)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001792, "peer_fdpair_get_current() failed: %s", gfarm_error_string(e)); return (e); } if ((e = process_get_file_inode(process, cfd, &base)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001793, "process_get_file_inode() failed: %s", gfarm_error_string(e)); return (e); } if (flag & ~GFARM_FILE_USER_MODE) { gflog_debug(GFARM_MSG_1001794, "argument 'flag' is invalid"); return (GFARM_ERR_INVALID_ARGUMENT); } op = accmode_to_op(flag); if (to_create) { if (mode & ~GFARM_S_ALLPERM) { gflog_debug(GFARM_MSG_1001795, "argument 'mode' is invalid"); return (GFARM_ERR_INVALID_ARGUMENT); } e = db_begin(diag); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001796, "db_begin() failed: %s", gfarm_error_string(e)); return (e); } transaction = 1; e = inode_create_file(base, name, process, op, mode, &inode, &created); } else { e = inode_lookup_by_name(base, name, process, op, &inode); created = 0; } if (e == GFARM_ERR_NO_ERROR) e = process_open_file(process, inode, flag, created, peer, spool_host, &fd); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001797, "error occurred during process: %s", gfarm_error_string(e)); if (transaction) db_end(diag); return (e); } if (created && !from_client) { e = inode_add_replica(inode, spool_host, 1); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001798, "inode_add_replica() failed: %s", gfarm_error_string(e)); process_close_file(process, peer, fd); inode_unlink(base, name, process); if (transaction) db_end(diag); return (e); } } if (transaction) db_end(diag); if ((created || (op & GFS_W_OK) != 0) && inode_is_file(inode)) { if (inode_has_desired_number(inode, &desired_number) || inode_traverse_desired_replica_number(base, &desired_number)) process_record_desired_number(process, fd, desired_number); } peer_fdpair_set_current(peer, fd); *inump = inode_get_number(inode); *genp = inode_get_gen(inode); *modep = inode_get_mode(inode); return(GFARM_ERR_NO_ERROR); } gfarm_error_t gfm_server_create(struct peer *peer, int from_client, int skip) { gfarm_error_t e; char *name; gfarm_int32_t flag, perm; gfarm_ino_t inum = 0; gfarm_uint64_t gen = 0; gfarm_int32_t mode = 0; static const char diag[] = "GFM_PROTO_CREATE"; e = gfm_server_get_request(peer, diag, "sii", &name, &flag, &perm); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001799, "create request failed: %s", gfarm_error_string(e)); return (e); } if (skip) { free(name); return (GFARM_ERR_NO_ERROR); } giant_lock(); e = gfm_server_open_common(diag, peer, from_client, name, flag, 1, perm, &inum, &gen, &mode); if (debug_mode) { if (e != GFARM_ERR_NO_ERROR) { gflog_info(GFARM_MSG_1000376, "create(%s) -> error: %s", name, gfarm_error_string(e)); } else { gfarm_int32_t fd; peer_fdpair_get_current(peer, &fd); gflog_info(GFARM_MSG_1000377, "create(%s) -> %d, %lld:%lld, %3o", name, fd, (unsigned long long)inum, (unsigned long long)gen, mode); } } free(name); giant_unlock(); return (gfm_server_put_reply(peer, diag, e, "lli", inum, gen, mode)); } gfarm_error_t gfm_server_open(struct peer *peer, int from_client, int skip) { gfarm_error_t e; char *name; gfarm_uint32_t flag; gfarm_ino_t inum = 0; gfarm_uint64_t gen = 0; gfarm_int32_t mode = 0; static const char diag[] = "GFM_PROTO_OPEN"; e = gfm_server_get_request(peer, "open", "si", &name, &flag); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001800, "open request failed: %s", gfarm_error_string(e)); return (e); } if (skip) { free(name); return (GFARM_ERR_NO_ERROR); } giant_lock(); e = gfm_server_open_common(diag, peer, from_client, name, flag, 0, 0, &inum, &gen, &mode); if (debug_mode) { if (e != GFARM_ERR_NO_ERROR) { gflog_info(GFARM_MSG_1000378, "open(%s) -> error: %s", name, gfarm_error_string(e)); } else { gfarm_int32_t fd; peer_fdpair_get_current(peer, &fd); gflog_info(GFARM_MSG_1000379, "open(%s) -> %d, %lld:%lld, %3o", name, fd, (unsigned long long)inum, (unsigned long long)gen, mode); } } free(name); giant_unlock(); return (gfm_server_put_reply(peer, diag, e, "lli", inum, gen, mode)); } gfarm_error_t gfm_server_open_root(struct peer *peer, int from_client, int skip) { gfarm_error_t e; struct host *spool_host = NULL; struct process *process; int op; struct inode *inode; gfarm_uint32_t flag; gfarm_int32_t fd = -1; static const char diag[] = "GFM_PROTO_OPEN_ROOT"; e = gfm_server_get_request(peer, diag, "i", &flag); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001801, "open_root request failed: %s", gfarm_error_string(e)); return (e); } if (skip) return (GFARM_ERR_NO_ERROR); giant_lock(); if (flag & ~GFARM_FILE_USER_MODE) e = GFARM_ERR_INVALID_ARGUMENT; else if ((op = accmode_to_op(flag)) & GFS_W_OK) e = GFARM_ERR_IS_A_DIRECTORY; else if (!from_client && (spool_host = peer_get_host(peer)) == NULL) { if (debug_mode) gflog_info(GFARM_MSG_1000380, "open_root: from_client=%d, spool?:%d\n", from_client, spool_host != NULL); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if ((process = peer_get_process(peer)) == NULL) { if (debug_mode) gflog_info(GFARM_MSG_1000381, "get_process?:%d\n", process != NULL); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if ((e = inode_lookup_root(process, op, &inode)) != GFARM_ERR_NO_ERROR) { if (debug_mode) gflog_info(GFARM_MSG_1000382, "inode_lookup_root?:%s\n", gfarm_error_string(e)); } else if ((e = process_open_file(process, inode, flag, 0, peer, spool_host, &fd)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001802, "process_open_file() failed: %s", gfarm_error_string(e)); } else peer_fdpair_set_current(peer, fd); giant_unlock(); return (gfm_server_put_reply(peer, diag, e, "")); } gfarm_error_t gfm_server_open_parent(struct peer *peer, int from_client, int skip) { gfarm_error_t e; struct host *spool_host = NULL; int op; struct process *process; gfarm_uint32_t flag; gfarm_int32_t cfd, fd = -1; struct inode *base, *inode; static const char diag[] = "GFM_PROTO_OPEN_PARENT"; e = gfm_server_get_request(peer, diag, "i", &flag); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001803, "open_parent request failed: %s", gfarm_error_string(e)); return (e); } if (skip) return (GFARM_ERR_NO_ERROR); giant_lock(); if (flag & ~GFARM_FILE_USER_MODE) { gflog_debug(GFARM_MSG_1001804, "argument 'flag' is invalid"); e = GFARM_ERR_INVALID_ARGUMENT; } else if ((op = accmode_to_op(flag)) & GFS_W_OK) { gflog_debug(GFARM_MSG_1001805, "inode is a directory"); e = GFARM_ERR_IS_A_DIRECTORY; } else if (!from_client && (spool_host = peer_get_host(peer)) == NULL) { gflog_debug(GFARM_MSG_1001806, "operation is not permitted"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if ((process = peer_get_process(peer)) == NULL) { gflog_debug(GFARM_MSG_1001807, "operation is not permitted: peer_get_process()" "failed"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if ((e = peer_fdpair_get_current(peer, &cfd)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001808, "peer_fdpair_get_current() " "failed: %s", gfarm_error_string(e)); } else if ((e = process_get_file_inode(process, cfd, &base)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001809, "process_get_file_inode() " "failed: %s", gfarm_error_string(e)); } else if ((e = inode_lookup_parent(base, process, op, &inode)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001810, "inode_lookup_parent() failed" ": %s", gfarm_error_string(e)); } else if ((e = process_open_file(process, inode, flag, 0, peer, spool_host, &fd)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001811, "process_open_file() failed: " "%s", gfarm_error_string(e)); } else peer_fdpair_set_current(peer, fd); giant_unlock(); return (gfm_server_put_reply(peer, diag, e, "")); } gfarm_error_t gfm_server_close(struct peer *peer, int from_client, int skip) { gfarm_error_t e; struct host *spool_host = NULL; struct process *process; gfarm_int32_t fd = -1; int transaction = 0; static const char diag[] = "GFM_PROTO_CLOSE"; if (skip) return (GFARM_ERR_NO_ERROR); giant_lock(); if (!from_client && (spool_host = peer_get_host(peer)) == NULL) { gflog_debug(GFARM_MSG_1001812, "operation is not permitted"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if ((process = peer_get_process(peer)) == NULL) { gflog_debug(GFARM_MSG_1001813, "operation is not permitted : peer_get_process() " "failed"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if ((e = peer_fdpair_get_current(peer, &fd)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001814, "peer_fdpair_get_current() failed: %s", gfarm_error_string(e)); } else { if (db_begin(diag) == GFARM_ERR_NO_ERROR) transaction = 1; /* * closing must be done regardless of the result of db_begin(). * because not closing may cause descriptor leak. */ e = process_close_file(process, peer, fd); if (transaction) db_end(diag); if (e == GFARM_ERR_NO_ERROR) /* permission ok */ e = peer_fdpair_close_current(peer); } giant_unlock(); return (gfm_server_put_reply(peer, diag, e, "")); } gfarm_error_t gfm_server_verify_type(struct peer *peer, int from_client, int skip) { gfarm_error_t e; gfarm_uint32_t type; static const char diag[] = "GFM_PROTO_VERIFY_TYPE"; /* XXX - NOT IMPLEMENTED */ gflog_error(GFARM_MSG_1000383, "%s: not implemented", diag); e = gfm_server_get_request(peer, diag, "i", &type); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001815, "verify_type request failed: %s", gfarm_error_string(e)); return (e); } if (skip) return (GFARM_ERR_NO_ERROR); e = gfm_server_put_reply(peer, diag, GFARM_ERR_FUNCTION_NOT_IMPLEMENTED, ""); return (e != GFARM_ERR_NO_ERROR ? e : GFARM_ERR_FUNCTION_NOT_IMPLEMENTED); } gfarm_error_t gfm_server_verify_type_not(struct peer *peer, int from_client, int skip) { gfarm_error_t e; gfarm_uint32_t type; static const char diag[] = "GFM_PROTO_VERIFY_TYPE_NOT"; /* XXX - NOT IMPLEMENTED */ gflog_error(GFARM_MSG_1000384, "%s: not implemented", diag); e = gfm_server_get_request(peer, diag, "i", &type); if (e != GFARM_ERR_NO_ERROR) return (e); if (skip) return (GFARM_ERR_NO_ERROR); e = gfm_server_put_reply(peer, diag, GFARM_ERR_FUNCTION_NOT_IMPLEMENTED, ""); return (e != GFARM_ERR_NO_ERROR ? e : GFARM_ERR_FUNCTION_NOT_IMPLEMENTED); } static gfarm_error_t inode_get_stat(struct inode *inode, struct gfs_stat *st) { static const char diag[] = "inode_get_stat"; st->st_ino = inode_get_number(inode); st->st_gen = inode_get_gen(inode); st->st_mode = inode_get_mode(inode); st->st_nlink = inode_get_nlink(inode); st->st_user = strdup_log(user_name(inode_get_user(inode)), diag); st->st_group = strdup_log(group_name(inode_get_group(inode)), diag); st->st_size = inode_get_size(inode); if (inode_is_file(inode)) st->st_ncopy = inode_get_ncopy(inode); else st->st_ncopy = 1; st->st_atimespec = *inode_get_atime(inode); st->st_mtimespec = *inode_get_mtime(inode); st->st_ctimespec = *inode_get_ctime(inode); if (st->st_user == NULL || st->st_group == NULL) { if (st->st_user != NULL) free(st->st_user); if (st->st_group != NULL) free(st->st_group); gflog_debug(GFARM_MSG_1001816, "allocation of 'st_user' or 'st_group' failed"); return (GFARM_ERR_NO_MEMORY); } return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfm_server_fstat(struct peer *peer, int from_client, int skip) { gfarm_error_t e, e2; gfarm_int32_t fd; struct host *spool_host = NULL; struct process *process; struct inode *inode; struct gfs_stat st; static const char diag[] = "GFM_PROTO_FSTAT"; #ifdef __GNUC__ /* workaround gcc warning: may be used uninitialized */ memset(&st, 0, sizeof(st)); #endif if (skip) return (GFARM_ERR_NO_ERROR); giant_lock(); if (!from_client && (spool_host = peer_get_host(peer)) == NULL) { gflog_debug(GFARM_MSG_1001817, "operation is not permitted"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if ((process = peer_get_process(peer)) == NULL) { gflog_debug(GFARM_MSG_1001818, "operation is not permitted: peer_get_process() " "failed"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if ((e = peer_fdpair_get_current(peer, &fd)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001819, "peer_fdpair_get_current() failed: %s", gfarm_error_string(e)); } else if ((e = process_get_file_inode(process, fd, &inode)) == GFARM_ERR_NO_ERROR) e = inode_get_stat(inode, &st); giant_unlock(); e2 = gfm_server_put_reply(peer, diag, e, "llilsslllilili", st.st_ino, st.st_gen, st.st_mode, st.st_nlink, st.st_user, st.st_group, st.st_size, st.st_ncopy, st.st_atimespec.tv_sec, st.st_atimespec.tv_nsec, st.st_mtimespec.tv_sec, st.st_mtimespec.tv_nsec, st.st_ctimespec.tv_sec, st.st_ctimespec.tv_nsec); if (e == GFARM_ERR_NO_ERROR) { free(st.st_user); free(st.st_group); } return (e2); } gfarm_error_t gfm_server_fgetattrplus(struct peer *peer, int from_client, int skip) { struct gfp_xdr *client = peer_get_conn(peer); gfarm_error_t e, e2; gfarm_int32_t flags, nattrpatterns, fd; char **attrpatterns = NULL, *attrpattern; int i, j, eof; struct host *spool_host = NULL; struct process *process; struct inode *inode; struct gfs_stat st; size_t nxattrs; struct xattr_list *xattrs, *px; struct db_waitctx waitctx; static const char diag[] = "GFM_PROTO_FGETATTRPLUS"; #ifdef __GNUC__ /* workaround gcc warning: may be used uninitialized */ memset(&st, 0, sizeof(st)); #endif e = gfm_server_get_request(peer, diag, "ii", &flags, &nattrpatterns); if (e != GFARM_ERR_NO_ERROR) return (e); if (!skip) GFARM_MALLOC_ARRAY(attrpatterns, nattrpatterns); for (i = 0; i < nattrpatterns; i++) { e = gfp_xdr_recv(client, 0, &eof, "s", &attrpattern); if (e != GFARM_ERR_NO_ERROR || eof) { gflog_debug(GFARM_MSG_1002496, "gfp_xdr_recv(xattrpattern) failed: %s", gfarm_error_string(e)); if (e == GFARM_ERR_NO_ERROR) /* i.e. eof */ e = GFARM_ERR_PROTOCOL; if (attrpatterns != NULL) { for (j = 0; j < i; j++) { if (attrpatterns[j] != NULL) free(attrpatterns[j]); } free(attrpatterns); } return (e); } if (attrpatterns == NULL) { free(attrpattern); } else { attrpatterns[i] = attrpattern; } } if (skip) return (GFARM_ERR_NO_ERROR); giant_lock(); if (attrpatterns == NULL) e = GFARM_ERR_NO_MEMORY; else if (!from_client && (spool_host = peer_get_host(peer)) == NULL) { gflog_debug(GFARM_MSG_1002497, "operation is not permitted"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if ((process = peer_get_process(peer)) == NULL) { gflog_debug(GFARM_MSG_1002498, "operation is not permitted: peer_get_process() " "failed"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if ((e = peer_fdpair_get_current(peer, &fd)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1002499, "peer_fdpair_get_current() failed: %s", gfarm_error_string(e)); } else if ((e = process_get_file_inode(process, fd, &inode)) != GFARM_ERR_NO_ERROR) { } else if ((e = inode_get_stat(inode, &st)) != GFARM_ERR_NO_ERROR) { } else { e = inode_xattr_list_get_cached_by_patterns( st.st_ino, attrpatterns, nattrpatterns, &xattrs, &nxattrs); if (e != GFARM_ERR_NO_ERROR) { xattrs = NULL; nxattrs = 0; } for (j = 0; j < nxattrs; j++) { px = &xattrs[j]; if (px->value != NULL) /* cached */ continue; /* not cached */ db_waitctx_init(&waitctx); e = db_xattr_get(0, st.st_ino, px->name, &px->value, &px->size, &waitctx); if (e == GFARM_ERR_NO_ERROR) { /* * XXX this is slow, but we don't know * the safe window size */ giant_unlock(); e = dbq_waitret(&waitctx); giant_lock(); } db_waitctx_fini(&waitctx); /* if error happens, px->size == 0 here */ } } giant_unlock(); e2 = gfm_server_put_reply(peer, diag, e, "llilsslllililii", st.st_ino, st.st_gen, st.st_mode, st.st_nlink, st.st_user, st.st_group, st.st_size, st.st_ncopy, st.st_atimespec.tv_sec, st.st_atimespec.tv_nsec, st.st_mtimespec.tv_sec, st.st_mtimespec.tv_nsec, st.st_ctimespec.tv_sec, st.st_ctimespec.tv_nsec, nxattrs); if (e2 != GFARM_ERR_NO_ERROR) { gflog_warning(GFARM_MSG_1002500, "%s@%s: %s replying: %s", peer_get_username(peer), peer_get_hostname(peer), diag, gfarm_error_string(e2)); } if (e == GFARM_ERR_NO_ERROR && e2 == GFARM_ERR_NO_ERROR) { for (j = 0; j < nxattrs; j++) { px = &xattrs[j]; e2 = gfp_xdr_send(client, "sb", px->name, px->size, px->value); if (e2 != GFARM_ERR_NO_ERROR) { gflog_warning(GFARM_MSG_1002501, "%s@%s: %s returing xattr: %s", peer_get_username(peer), peer_get_hostname(peer), diag, gfarm_error_string(e2)); break; } } } if (e == GFARM_ERR_NO_ERROR) { free(st.st_user); free(st.st_group); inode_xattr_list_free(xattrs, nxattrs); } if (attrpatterns != NULL) { for (i = 0; i < nattrpatterns; i++) free(attrpatterns[i]); free(attrpatterns); } return (e2); } gfarm_error_t gfm_server_futimes(struct peer *peer, int from_client, int skip) { gfarm_error_t e; gfarm_int32_t fd; struct gfarm_timespec atime, mtime; struct host *spool_host = NULL; struct process *process; struct user *user; struct inode *inode; static const char diag[] = "GFM_PROTO_FUTIMES"; e = gfm_server_get_request(peer, diag, "lili", &atime.tv_sec, &atime.tv_nsec, &mtime.tv_sec, &mtime.tv_nsec); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001820, "futimes request failed: %s", gfarm_error_string(e)); return (e); } if (skip) return (GFARM_ERR_NO_ERROR); giant_lock(); if (!from_client && (spool_host = peer_get_host(peer)) == NULL) { gflog_debug(GFARM_MSG_1001821, "operation is not permitted"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if ((process = peer_get_process(peer)) == NULL) { gflog_debug(GFARM_MSG_1001822, "operation is not permitted: peer_get_process() " "failed"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if ((e = peer_fdpair_get_current(peer, &fd)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001823, "peer_fdpair_get_current() " "failed: %s", gfarm_error_string(e)); } else if ((e = process_get_file_inode(process, fd, &inode)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001824, "process_get_file_inode() " "failed: %s", gfarm_error_string(e)); } else if ((user = process_get_user(process)) == NULL) { gflog_debug(GFARM_MSG_1001825, "process_get_user() failed"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if (user != inode_get_user(inode) && !user_is_root(user) && (e = process_get_file_writable(process, peer, fd)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001826, "permission denied"); e = GFARM_ERR_PERMISSION_DENIED; } else if ((e = db_begin(diag)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001827, "db_begin() failed: %s", gfarm_error_string(e)); } else { inode_set_atime(inode, &atime); inode_set_mtime(inode, &mtime); db_end(diag); } giant_unlock(); return (gfm_server_put_reply(peer, diag, e, "")); } gfarm_error_t gfm_server_fchmod(struct peer *peer, int from_client, int skip) { gfarm_error_t e; gfarm_int32_t fd; gfarm_int32_t mode; struct host *spool_host = NULL; struct process *process; struct user *user; struct inode *inode; static const char diag[] = "GFM_PROTO_FCHMOD"; e = gfm_server_get_request(peer, diag, "i", &mode); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001828, "fchmod request failed: %s", gfarm_error_string(e)); return (e); } if (skip) return (GFARM_ERR_NO_ERROR); giant_lock(); if (!from_client && (spool_host = peer_get_host(peer)) == NULL) { gflog_debug(GFARM_MSG_1001829, "operation is not permitted"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if ((process = peer_get_process(peer)) == NULL) { gflog_debug(GFARM_MSG_1001830, "operation is not permitted: peer_get_process() " "failed"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if ((user = process_get_user(process)) == NULL) { gflog_debug(GFARM_MSG_1001831, "operation is not permitted: process_get_user() " "failed"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if ((e = peer_fdpair_get_current(peer, &fd)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001832, "peer_fdpair_get_current() failed: %s", gfarm_error_string(e)); } else if ((e = process_get_file_inode(process, fd, &inode)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001833, "process_get_file_inode() failed: %s", gfarm_error_string(e)); } else if (user != inode_get_user(inode) && !user_is_root(user)) { e = GFARM_ERR_OPERATION_NOT_PERMITTED; gflog_debug(GFARM_MSG_1001834, "operation is not permitted for user"); } else e = inode_set_mode(inode, mode); giant_unlock(); return (gfm_server_put_reply(peer, diag, e, "")); } gfarm_error_t gfm_server_fchown(struct peer *peer, int from_client, int skip) { gfarm_error_t e; char *username, *groupname; gfarm_int32_t fd; struct host *spool_host = NULL; struct process *process; struct user *user, *new_user = NULL; struct group *new_group = NULL; struct inode *inode; static const char diag[] = "GFM_PROTO_FCHOWN"; e = gfm_server_get_request(peer, diag, "ss", &username, &groupname); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001835, "fchown request failed: %s", gfarm_error_string(e)); return (e); } if (skip) { free(username); free(groupname); return (GFARM_ERR_NO_ERROR); } giant_lock(); if (!from_client && (spool_host = peer_get_host(peer)) == NULL) { gflog_debug(GFARM_MSG_1001836, "operation is not permitted"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if ((process = peer_get_process(peer)) == NULL) { gflog_debug(GFARM_MSG_1001837, "operation is not permitted: peer_get_process() " "failed"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if ((user = process_get_user(process)) == NULL) { gflog_debug(GFARM_MSG_1001838, "operation is not permitted: process_get_user() " "failed"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if ((e = peer_fdpair_get_current(peer, &fd)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001839, "peer_fdpair_get_current() failed: %s", gfarm_error_string(e)); } else if ((e = process_get_file_inode(process, fd, &inode)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001840, "process_get_file_inode() failed: %s", gfarm_error_string(e)); } else if (*username != '\0' && ((new_user = user_lookup(username)) == NULL || user_is_invalidated(new_user))) { gflog_debug(GFARM_MSG_1001841, "user is not found"); e = GFARM_ERR_NO_SUCH_USER; } else if (*groupname != '\0' && ((new_group = group_lookup(groupname)) == NULL || group_is_invalidated(new_group))) { gflog_debug(GFARM_MSG_1001842, "group is not found"); e = GFARM_ERR_NO_SUCH_GROUP; } else if (new_user != NULL && !user_is_root(user)) { gflog_debug(GFARM_MSG_1001843, "operation is not permitted for user"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if (new_group != NULL && !user_is_root(user) && (user != inode_get_user(inode) || !user_in_group(user, new_group))) { gflog_debug(GFARM_MSG_1001844, "operation is not permitted for group"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if ((e = db_begin(diag)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001845, "db_begin() failed: %s", gfarm_error_string(e)); } else { e = inode_set_owner(inode, new_user, new_group); db_end(diag); } free(username); free(groupname); giant_unlock(); return (gfm_server_put_reply(peer, diag, e, "")); } gfarm_error_t gfm_server_cksum_get(struct peer *peer, int from_client, int skip) { gfarm_error_t e, e2; gfarm_int32_t fd; gfarm_int32_t flags = 0; size_t cksum_len = 0; struct host *spool_host = NULL; struct process *process; char *cksum_type = NULL, *cksumbuf = NULL, *cksum; int alloced = 0; static const char diag[] = "GFM_PROTO_CKSUM_GET"; if (skip) return (GFARM_ERR_NO_ERROR); giant_lock(); if (!from_client && (spool_host = peer_get_host(peer)) == NULL) { gflog_debug(GFARM_MSG_1001846, "operation is not permitted"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if ((process = peer_get_process(peer)) == NULL) { gflog_debug(GFARM_MSG_1001847, "operation is not permitted: peer_get_process() " "failed"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if ((e = peer_fdpair_get_current(peer, &fd)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001848, "peer_fdpair_get_current() " "failed: %s", gfarm_error_string(e)); } else if ((e = process_cksum_get(process, peer, fd, &cksum_type, &cksum_len, &cksum, &flags)) != GFARM_ERR_NO_ERROR) { /* We cannot access cksum_type and cksum outside of giant */ gflog_debug(GFARM_MSG_1001849, "process_cksum_get() failed: %s", gfarm_error_string(e)); } else if (cksum_type == NULL) { cksum_type = ""; cksum_len = 0; cksumbuf = ""; } else if ((cksum_type = strdup_log(cksum_type, diag)) == NULL) { e = GFARM_ERR_NO_MEMORY; } else { GFARM_MALLOC_ARRAY(cksumbuf, cksum_len); if (cksumbuf == NULL) { e = GFARM_ERR_NO_MEMORY; free(cksum_type); #if 1 /* shut up warning by Fortify */ cksum_type = NULL; #endif } else { memcpy(cksumbuf, cksum, cksum_len); alloced = 1; } } giant_unlock(); e2 = gfm_server_put_reply(peer, diag, e, "sbi", cksum_type, cksum_len, cksumbuf, flags); if (alloced) { free(cksum_type); free(cksumbuf); } return (e2); } gfarm_error_t gfm_server_cksum_set(struct peer *peer, int from_client, int skip) { gfarm_error_t e; gfarm_int32_t fd; gfarm_int32_t cksum_len, flags; struct host *spool_host = NULL; struct process *process; char *cksum_type; char cksum[GFM_PROTO_CKSUM_MAXLEN]; struct gfarm_timespec mtime; static const char diag[] = "GFM_PROTO_CKSUM_SET"; e = gfm_server_get_request(peer, diag, "sbili", &cksum_type, sizeof(cksum), &cksum_len, cksum, &flags, &mtime.tv_sec, &mtime.tv_nsec); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001850, "cksum_set request failed: %s", gfarm_error_string(e)); return (e); } if (skip) { free(cksum_type); return (GFARM_ERR_NO_ERROR); } giant_lock(); if (from_client) { /* from gfsd only */ gflog_debug(GFARM_MSG_1001851, "operation is not permitted: from_client"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if ((spool_host = peer_get_host(peer)) == NULL) { e = GFARM_ERR_OPERATION_NOT_PERMITTED; gflog_debug(GFARM_MSG_1001852, "operation is not permitted: peer_get_host() failed"); } else if ((process = peer_get_process(peer)) == NULL) { e = GFARM_ERR_OPERATION_NOT_PERMITTED; gflog_debug(GFARM_MSG_1001853, "operation is not permitted: peer_get_process() " "failed"); } else if ((e = peer_fdpair_get_current(peer, &fd)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001854, "peer_fdpair_get_current() " "failed: %s", gfarm_error_string(e)); } else if ((e = db_begin(diag)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001855, "db_begin() failed: %s", gfarm_error_string(e)); } else { e = process_cksum_set(process, peer, fd, cksum_type, cksum_len, cksum, flags, &mtime); db_end(diag); } free(cksum_type); giant_unlock(); return (gfm_server_put_reply(peer, diag, e, "")); } gfarm_error_t gfm_server_schedule_file(struct peer *peer, int from_client, int skip) { gfarm_error_t e, e_save; char *domain; gfarm_int32_t i, fd, nhosts; struct host **hosts, *spool_host = NULL; struct process *process; static const char diag[] = "GFM_PROTO_SCHEDULE_FILE"; e = gfm_server_get_request(peer, diag, "s", &domain); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001856, "schedule_file request failed: %s", gfarm_error_string(e)); return (e); } if (skip) { free(domain); return (GFARM_ERR_NO_ERROR); } giant_lock(); if (*domain != '\0') { gflog_debug(GFARM_MSG_1001857, "function not implemented"); e = GFARM_ERR_FUNCTION_NOT_IMPLEMENTED; /* XXX FIXME */ } else if (!from_client && (spool_host = peer_get_host(peer)) == NULL) { gflog_debug(GFARM_MSG_1001858, "operation is not permitted"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if ((process = peer_get_process(peer)) == NULL) { gflog_debug(GFARM_MSG_1001859, "operation is not permitted: peer_get_process() " "failed"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if ((e = peer_fdpair_get_current(peer, &fd)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001860, "peer_fdpair_get_current() " "failed: %s", gfarm_error_string(e)); } else { e = process_schedule_file(process, peer, fd, &nhosts, &hosts); } free(domain); giant_unlock(); if (e != GFARM_ERR_NO_ERROR) return (gfm_server_put_reply(peer, diag, e, "")); e_save = gfm_server_put_reply(peer, diag, e, "i", nhosts); for (i = 0; i < nhosts; i++) { e = host_schedule_reply(hosts[i], peer, diag); if (e_save == GFARM_ERR_NO_ERROR) e_save = e; } free(hosts); return (e_save); } gfarm_error_t gfm_server_schedule_file_with_program(struct peer *peer, int from_client, int skip) { gfarm_error_t e; char *domain; static const char diag[] = "GFM_PROTO_SCHEDULE_FILE_WITH_PROGRAM"; /* XXX - NOT IMPLEMENTED */ gflog_error(GFARM_MSG_1000385, "schedule_file_with_program: not implemented"); e = gfm_server_get_request( peer, diag, "s", &domain); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001863, "schedule_file_with_program request failed: %s", gfarm_error_string(e)); return (e); } if (skip) { free(domain); return (GFARM_ERR_NO_ERROR); } free(domain); e = gfm_server_put_reply(peer, diag, GFARM_ERR_FUNCTION_NOT_IMPLEMENTED, ""); return (e != GFARM_ERR_NO_ERROR ? e : GFARM_ERR_FUNCTION_NOT_IMPLEMENTED); } gfarm_error_t gfm_server_remove(struct peer *peer, int from_client, int skip) { gfarm_error_t e; char *name; struct process *process; gfarm_int32_t cfd; struct inode *base; static const char diag[] = "GFM_PROTO_REMOVE"; e = gfm_server_get_request(peer, diag, "s", &name); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001864, "remove request failed: %s", gfarm_error_string(e)); return (e); } if (skip) { free(name); return (GFARM_ERR_NO_ERROR); } giant_lock(); if ((process = peer_get_process(peer)) == NULL) { gflog_debug(GFARM_MSG_1001865, "operation is not permitted: peer_get_process() " "failed"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if (process_get_user(process) == NULL) { gflog_debug(GFARM_MSG_1001866, "process_get_user() failed"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if ((e = peer_fdpair_get_current(peer, &cfd)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001867, "peer_fdpair_get_current() " "failed: %s", gfarm_error_string(e)); } else if ((e = process_get_file_inode(process, cfd, &base)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001868, "process_get_file_inode() " "failed: %s", gfarm_error_string(e)); } else if ((e = db_begin(diag)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001869, "db_begin() failed: %s", gfarm_error_string(e)); } else { e = inode_unlink(base, name, process); db_end(diag); } free(name); giant_unlock(); return (gfm_server_put_reply(peer, diag, e, "")); } gfarm_error_t gfm_server_rename(struct peer *peer, int from_client, int skip) { gfarm_error_t e; char *sname, *dname; struct process *process; gfarm_int32_t sfd, dfd; struct inode *sdir, *ddir; static const char diag[] = "GFM_PROTO_RENAME"; e = gfm_server_get_request(peer, diag, "ss", &sname, &dname); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001870, "rename request failed: %s", gfarm_error_string(e)); return (e); } if (skip) { free(sname); free(dname); return (GFARM_ERR_NO_ERROR); } giant_lock(); if ((process = peer_get_process(peer)) == NULL) { gflog_debug(GFARM_MSG_1001871, "operation is not permitted: peer_get_process() " "failed"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if (process_get_user(process) == NULL) { gflog_debug(GFARM_MSG_1001872, "process_get_user() failed"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if ((e = peer_fdpair_get_saved(peer, &sfd)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001873, "peer_fdpair_get_saved() failed: %s", gfarm_error_string(e)); } else if ((e = peer_fdpair_get_current(peer, &dfd)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001874, "peer_fdpair_get_current() " "failed: %s", gfarm_error_string(e)); } else if ((e = process_get_file_inode(process, sfd, &sdir)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001875, "process_get_file_inode() " "failed: %s", gfarm_error_string(e)); } else if ((e = process_get_file_inode(process, dfd, &ddir)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001876, "process_get_file_inode() " "failed: %s", gfarm_error_string(e)); } else if ((e = db_begin(diag)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001877, "db_begin() failed: %s", gfarm_error_string(e)); } else { e = inode_rename(sdir, sname, ddir, dname, process); db_end(diag); } free(sname); free(dname); giant_unlock(); return (gfm_server_put_reply(peer, diag, e, "")); } gfarm_error_t gfm_server_flink(struct peer *peer, int from_client, int skip) { gfarm_error_t e; char *name; struct host *spool_host = NULL; struct process *process; gfarm_int32_t sfd, dfd; struct inode *src, *base; static const char diag[] = "GFM_PROTO_FLINK"; e = gfm_server_get_request(peer, diag, "s", &name); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001878, "flink request failed: %s", gfarm_error_string(e)); return (e); } if (skip) { free(name); return (GFARM_ERR_NO_ERROR); } giant_lock(); if (!from_client && (spool_host = peer_get_host(peer)) == NULL) { gflog_debug(GFARM_MSG_1001879, "operation is not permitted"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if ((process = peer_get_process(peer)) == NULL) { gflog_debug(GFARM_MSG_1001880, "operation is not permitted: peer_get_process() " "failed"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if (process_get_user(process) == NULL) { gflog_debug(GFARM_MSG_1001881, "process_get_user() failed"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if ((e = peer_fdpair_get_saved(peer, &sfd)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001882, "peer_fdpair_get_saved() failed: %s", gfarm_error_string(e)); } else if ((e = process_get_file_inode(process, sfd, &src)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001883, "process_get_file_inode() " "failed: %s", gfarm_error_string(e)); } else if (!inode_is_file(src)) { gflog_debug(GFARM_MSG_1001884, "inode is not file"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if ((e = peer_fdpair_get_current(peer, &dfd)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001885, "peer_fdpair_get_current() " "failed: %s", gfarm_error_string(e)); } else if ((e = process_get_file_inode(process, dfd, &base)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001886, "process_get_file_inode() " "failed: %s", gfarm_error_string(e)); } else if ((e = db_begin(diag)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001887, "db_begin() failed: %s", gfarm_error_string(e)); } else { e = inode_create_link(base, name, process, src); db_end(diag); } free(name); giant_unlock(); return (gfm_server_put_reply(peer, diag, e, "")); } gfarm_error_t gfm_server_mkdir(struct peer *peer, int from_client, int skip) { gfarm_error_t e; char *name; gfarm_int32_t mode; struct process *process; gfarm_int32_t cfd; struct inode *base; static const char diag[] = "GFM_PROTO_MKDIR"; e = gfm_server_get_request(peer, diag, "si", &name, &mode); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001888, "mkdir request failed :%s", gfarm_error_string(e)); return (e); } if (skip) { free(name); return (GFARM_ERR_NO_ERROR); } giant_lock(); if ((process = peer_get_process(peer)) == NULL) { gflog_debug(GFARM_MSG_1001889, "peer_get_process() failed"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if (process_get_user(process) == NULL) { gflog_debug(GFARM_MSG_1001890, "process_get_user() failed"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if ((e = peer_fdpair_get_current(peer, &cfd)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001891, "peer_fdpair_get_current() " "failed: %s", gfarm_error_string(e)); } else if ((e = process_get_file_inode(process, cfd, &base)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001892, "process_get_file_inode() " "failed: %s", gfarm_error_string(e)); } else if (mode & ~GFARM_S_ALLPERM) { gflog_debug(GFARM_MSG_1001893, "argument 'mode' is invalid"); e = GFARM_ERR_INVALID_ARGUMENT; } else if ((e = db_begin(diag)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001894, "db_begin() failed: %s", gfarm_error_string(e)); } else { e = inode_create_dir(base, name, process, mode); db_end(diag); } free(name); giant_unlock(); return (gfm_server_put_reply(peer, diag, e, "")); } gfarm_error_t gfm_server_symlink(struct peer *peer, int from_client, int skip) { gfarm_error_t e; char *source_path, *name; struct host *spool_host = NULL; struct process *process; gfarm_int32_t cfd; struct inode *base; static const char diag[] = "GFM_PROTO_SYMLINK"; e = gfm_server_get_request(peer, diag, "ss", &source_path, &name); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001895, "symlink request failed: %s", gfarm_error_string(e)); return (e); } if (skip) { free(source_path); free(name); return (GFARM_ERR_NO_ERROR); } giant_lock(); if (!from_client && (spool_host = peer_get_host(peer)) == NULL) { gflog_debug(GFARM_MSG_1001896, "operation is not permitted"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if ((process = peer_get_process(peer)) == NULL) { gflog_debug(GFARM_MSG_1001897, "peer_get_process() failed"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if (process_get_user(process) == NULL) { gflog_debug(GFARM_MSG_1001898, "process_get_user() failed"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if ((e = peer_fdpair_get_current(peer, &cfd)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001899, "peer_fdpair_get_current() " "failed: %s", gfarm_error_string(e)); } else if ((e = process_get_file_inode(process, cfd, &base)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001900, "process_get_file_inode() " "failed: %s", gfarm_error_string(e)); } else if ((e = db_begin(diag)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001901, "db_begin() failed: %s", gfarm_error_string(e)); } else { e = inode_create_symlink(base, name, process, source_path); db_end(diag); } free(source_path); free(name); giant_unlock(); return (gfm_server_put_reply(peer, diag, e, "")); } gfarm_error_t gfm_server_readlink(struct peer *peer, int from_client, int skip) { gfarm_error_t e, e2; gfarm_int32_t fd; struct host *spool_host = NULL; struct process *process; struct inode *inode; char *source_path = NULL; static const char diag[] = "GFM_PROTO_READLINK"; if (skip) return (GFARM_ERR_NO_ERROR); giant_lock(); if (!from_client && (spool_host = peer_get_host(peer)) == NULL) { gflog_debug(GFARM_MSG_1001902, "operation is not permitted"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if ((process = peer_get_process(peer)) == NULL) { gflog_debug(GFARM_MSG_1001903, "peer_get_process() failed"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if ((e = peer_fdpair_get_current(peer, &fd)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001904, "peer_fdpair_get_current() " "failed: %s", gfarm_error_string(e)); } else if ((e = process_get_file_inode(process, fd, &inode)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001905, "process_get_file_inode() " "failed: %s", gfarm_error_string(e)); } else if ((source_path = inode_get_symlink(inode)) == NULL) { gflog_debug(GFARM_MSG_1001906, "invalid argument"); e = GFARM_ERR_INVALID_ARGUMENT; /* not a symlink */ } else if ((source_path = strdup_log(source_path, diag)) == NULL) { e = GFARM_ERR_NO_MEMORY; } giant_unlock(); e2 = gfm_server_put_reply(peer, diag, e, "s", source_path); if (e == GFARM_ERR_NO_ERROR) free(source_path); return (e2); } gfarm_error_t gfm_server_getdirpath(struct peer *peer, int from_client, int skip) { gfarm_error_t e, e_rpc; struct process *process; gfarm_int32_t cfd; struct inode *dir; char *s; static const char diag[] = "GFM_PROTO_GETDIRPATH"; if (skip) return (GFARM_ERR_NO_ERROR); giant_lock(); if ((process = peer_get_process(peer)) == NULL) { gflog_debug(GFARM_MSG_1001908, "peer_get_process() failed"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if ((e = peer_fdpair_get_current(peer, &cfd)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001909, "peer_fdpair_get_current() " "failed: %s", gfarm_error_string(e)); } else if ((e = process_get_file_inode(process, cfd, &dir)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001910, "process_get_file_inode() " "failed: %s", gfarm_error_string(e)); } else { e = inode_getdirpath(dir, process, &s); } giant_unlock(); e_rpc = gfm_server_put_reply(peer, diag, e, "s", s); if (e == GFARM_ERR_NO_ERROR) free(s); return (e_rpc); } static gfarm_error_t fs_dir_get(struct peer *peer, int from_client, gfarm_int32_t *np, struct process **processp, gfarm_int32_t *fdp, struct inode **inodep, Dir *dirp, DirCursor *cursorp) { gfarm_error_t e; gfarm_int32_t n = *np; struct host *spool_host = NULL; struct process *process; gfarm_int32_t fd; struct inode *inode; Dir dir; char *key; int keylen, ok; gfarm_off_t dir_offset = 0; if (n > GFM_PROTO_MAX_DIRENT) n = GFM_PROTO_MAX_DIRENT; if (!from_client && (spool_host = peer_get_host(peer)) == NULL) { gflog_debug(GFARM_MSG_1001911, "operation is not permitted"); return (GFARM_ERR_OPERATION_NOT_PERMITTED); } else if ((process = peer_get_process(peer)) == NULL) { gflog_debug(GFARM_MSG_1001912, "peer_get_process() failed"); return (GFARM_ERR_OPERATION_NOT_PERMITTED); } else if ((e = peer_fdpair_get_current(peer, &fd)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001913, "peer_fdpair_get_current() " "failed: %s", gfarm_error_string(e)); return (e); } else if ((e = process_get_file_inode(process, fd, &inode)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001914, "process_get_file_inode() " "failed: %s", gfarm_error_string(e)); return (e); } else if ((dir = inode_get_dir(inode)) == NULL) { gflog_debug(GFARM_MSG_1001915, "inode_get_dir() failed"); return (GFARM_ERR_NOT_A_DIRECTORY); } else if ((e = process_get_dir_key(process, peer, fd, &key, &keylen)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001916, "process_get_dir_key() failed: %s", gfarm_error_string(e)); return (e); } else if (key == NULL && (e = process_get_dir_offset(process, peer, fd, &dir_offset)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001917, "process_get_dir_offset() failed: %s", gfarm_error_string(e)); return (e); } else if (n <= 0) { gflog_debug(GFARM_MSG_1001918, "invalid argument"); return (GFARM_ERR_INVALID_ARGUMENT); } else { if (key != NULL) ok = dir_cursor_lookup(dir, key, strlen(key), cursorp); else ok = 0; if (!ok) ok = dir_cursor_set_pos(dir, dir_offset, cursorp); if (!ok) n = 0; /* end of directory? */ *np = n; *processp = process; *fdp = fd; *inodep = inode; *dirp = dir; /* *cursorp = *cursorp; */ return (GFARM_ERR_NO_ERROR); } } /* remember current position */ static void fs_dir_remember_cursor(struct peer *peer, struct process *process, gfarm_int32_t fd, Dir dir, DirCursor *cursor, int eof) { DirEntry entry; gfarm_off_t dir_offset; if (eof || (entry = dir_cursor_get_entry(dir, cursor)) == NULL) { process_clear_dir_key(process, peer, fd); dir_offset = dir_get_entry_count(dir); } else { int namelen; char *name = dir_entry_get_name(entry, &namelen); process_set_dir_key(process, peer, fd, name, namelen); dir_offset = dir_cursor_get_pos(dir, cursor); } process_set_dir_offset(process, peer, fd, dir_offset); } gfarm_error_t gfm_server_getdirents(struct peer *peer, int from_client, int skip) { struct gfp_xdr *client = peer_get_conn(peer); gfarm_error_t e, e2; gfarm_int32_t fd, n, i; struct process *process; struct inode *inode, *entry_inode; Dir dir; DirCursor cursor; struct dir_result_rec { char *name; gfarm_ino_t inum; gfarm_int32_t type; } *p = NULL; static const char diag[] = "GFM_PROTO_GETDIRENTS"; e = gfm_server_get_request(peer, diag, "i", &n); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001919, "getdirents request failed: %s", gfarm_error_string(e)); return (e); } if (skip) return (GFARM_ERR_NO_ERROR); giant_lock(); if ((e = fs_dir_get(peer, from_client, &n, &process, &fd, &inode, &dir, &cursor)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001920, "fs_dir_get() failed: %s", gfarm_error_string(e)); } else if (n > 0 && GFARM_MALLOC_ARRAY(p, n) == NULL) { gflog_debug(GFARM_MSG_1001921, "allocation of array failed"); e = GFARM_ERR_NO_MEMORY; } else { /* note: (n == 0) means the end of the directory */ for (i = 0; i < n; ) { if ((e = dir_cursor_get_name_and_inode(dir, &cursor, &p[i].name, &entry_inode)) != GFARM_ERR_NO_ERROR || p[i].name == NULL) break; p[i].inum = inode_get_number(entry_inode); p[i].type = gfs_mode_to_type(inode_get_mode(entry_inode)); i++; if (!dir_cursor_next(dir, &cursor)) break; } if (e == GFARM_ERR_NO_ERROR) { fs_dir_remember_cursor(peer, process, fd, dir, &cursor, n == 0); n = i; if (n > 0) /* XXX is this check necessary? */ inode_accessed(inode); } } giant_unlock(); e2 = gfm_server_put_reply(peer, diag, e, "i", n); if (e2 == GFARM_ERR_NO_ERROR && e == GFARM_ERR_NO_ERROR) { for (i = 0; i < n; i++) { e2 = gfp_xdr_send(client, "sil", p[i].name, p[i].type, p[i].inum); if (e2 != GFARM_ERR_NO_ERROR) { gflog_warning(GFARM_MSG_1000386, "%s@%s: getdirents: %s", peer_get_username(peer), peer_get_hostname(peer), gfarm_error_string(e2)); break; } } } if (p != NULL) { for (i = 0; i < n; i++) free(p[i].name); free(p); } return (e); } gfarm_error_t gfm_server_getdirentsplus(struct peer *peer, int from_client, int skip) { struct gfp_xdr *client = peer_get_conn(peer); gfarm_error_t e, e2; gfarm_int32_t fd, n, i; struct process *process; struct inode *inode, *entry_inode; Dir dir; DirCursor cursor; struct dir_result_rec { char *name; struct gfs_stat st; } *p = NULL; static const char diag[] = "GFM_PROTO_GETDIRENTSPLUS"; e = gfm_server_get_request(peer, diag, "i", &n); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001922, "getdirentsplus request failed: %s", gfarm_error_string(e)); return (e); } if (skip) return (GFARM_ERR_NO_ERROR); giant_lock(); if ((e = fs_dir_get(peer, from_client, &n, &process, &fd, &inode, &dir, &cursor)) != GFARM_ERR_NO_ERROR) gflog_debug(GFARM_MSG_1001923, "fs_dir_get() failed: %s", gfarm_error_string(e)); else if (n > 0 && GFARM_MALLOC_ARRAY(p, n) == NULL) { gflog_debug(GFARM_MSG_1001924, "allocation of array failed"); e = GFARM_ERR_NO_MEMORY; } else { /* note: (n == 0) means the end of the directory */ for (i = 0; i < n; ) { if ((e = dir_cursor_get_name_and_inode(dir, &cursor, &p[i].name, &entry_inode)) != GFARM_ERR_NO_ERROR || p[i].name == NULL) { gflog_debug(GFARM_MSG_1001925, "dir_cursor_get_name_and_inode() " "failed: %s", gfarm_error_string(e)); break; } if ((e = inode_get_stat(entry_inode, &p[i].st)) != GFARM_ERR_NO_ERROR) { free(p[i].name); gflog_debug(GFARM_MSG_1001926, "inode_get_stat() failed: %s", gfarm_error_string(e)); break; } i++; if (!dir_cursor_next(dir, &cursor)) break; } if (e == GFARM_ERR_NO_ERROR) { fs_dir_remember_cursor(peer, process, fd, dir, &cursor, n == 0); n = i; if (n > 0) /* XXX is this check necessary? */ inode_accessed(inode); } } giant_unlock(); e2 = gfm_server_put_reply(peer, diag, e, "i", n); if (e2 == GFARM_ERR_NO_ERROR && e == GFARM_ERR_NO_ERROR) { for (i = 0; i < n; i++) { struct gfs_stat *st = &p[i].st; e2 = gfp_xdr_send(client, "sllilsslllilili", p[i].name, st->st_ino, st->st_gen, st->st_mode, st->st_nlink, st->st_user, st->st_group, st->st_size, st->st_ncopy, st->st_atimespec.tv_sec, st->st_atimespec.tv_nsec, st->st_mtimespec.tv_sec, st->st_mtimespec.tv_nsec, st->st_ctimespec.tv_sec, st->st_ctimespec.tv_nsec); if (e2 != GFARM_ERR_NO_ERROR) { gflog_warning(GFARM_MSG_1000387, "%s@%s: getdirentsplus: %s", peer_get_username(peer), peer_get_hostname(peer), gfarm_error_string(e2)); break; } } } if (p != NULL) { for (i = 0; i < n; i++) { free(p[i].name); gfs_stat_free(&p[i].st); } free(p); } return (e); } gfarm_error_t gfm_server_getdirentsplusxattr(struct peer *peer, int from_client, int skip) { struct gfp_xdr *client = peer_get_conn(peer); gfarm_error_t e, e2; gfarm_int32_t fd, n, nattrpatterns, i, j, eof; char **attrpatterns, *attrpattern; struct process *process; struct inode *inode, *entry_inode; Dir dir; DirCursor cursor; struct dir_result_rec { char *name; struct gfs_stat st; size_t nxattrs; struct xattr_list *xattrs; } *p = NULL, *pp; struct xattr_list *px; struct db_waitctx waitctx; static const char diag[] = "GFM_PROTO_GETDIRENTSPLUSXATTR"; e = gfm_server_get_request(peer, diag, "ii", &n, &nattrpatterns); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1002502, "getdirentsplusxattr request failed: %s", gfarm_error_string(e)); return (e); } GFARM_MALLOC_ARRAY(attrpatterns, nattrpatterns); for (i = 0; i < nattrpatterns; i++) { e = gfp_xdr_recv(client, 0, &eof, "s", &attrpattern); if (e != GFARM_ERR_NO_ERROR || eof) { gflog_debug(GFARM_MSG_1002503, "gfp_xdr_recv(xattrpattern) failed: %s", gfarm_error_string(e)); if (e == GFARM_ERR_NO_ERROR) /* i.e. eof */ e = GFARM_ERR_PROTOCOL; if (attrpatterns != NULL) { for (j = 0; j < i; j++) { if (attrpatterns[j] != NULL) free(attrpatterns[j]); } free(attrpatterns); } return (e); } if (attrpatterns == NULL) { free(attrpattern); } else { attrpatterns[i] = attrpattern; } } if (skip) return (GFARM_ERR_NO_ERROR); giant_lock(); if (attrpatterns == NULL) { e = GFARM_ERR_NO_MEMORY; } else if ((e = fs_dir_get(peer, from_client, &n, &process, &fd, &inode, &dir, &cursor)) != GFARM_ERR_NO_ERROR) gflog_debug(GFARM_MSG_1002504, "fs_dir_get() failed: %s", gfarm_error_string(e)); else if (n > 0 && GFARM_CALLOC_ARRAY(p, n) == NULL) { gflog_debug(GFARM_MSG_1002505, "allocation of array failed"); e = GFARM_ERR_NO_MEMORY; } else { /* note: (n == 0) means the end of the directory */ for (i = 0; i < n; ) { if ((e = dir_cursor_get_name_and_inode(dir, &cursor, &p[i].name, &entry_inode)) != GFARM_ERR_NO_ERROR || p[i].name == NULL) { gflog_debug(GFARM_MSG_1002506, "dir_cursor_get_name_and_inode() " "failed: %s", gfarm_error_string(e)); break; } if ((e = inode_get_stat(entry_inode, &p[i].st)) != GFARM_ERR_NO_ERROR) { free(p[i].name); gflog_debug(GFARM_MSG_1002507, "inode_get_stat() failed: %s", gfarm_error_string(e)); break; } i++; if (!dir_cursor_next(dir, &cursor)) break; } if (e == GFARM_ERR_NO_ERROR) { fs_dir_remember_cursor(peer, process, fd, dir, &cursor, n == 0); n = i; if (n > 0) /* XXX is this check necessary? */ inode_accessed(inode); } } giant_unlock(); if (e == GFARM_ERR_NO_ERROR) { giant_lock(); for (i = 0; i < n; i++) { pp = &p[i]; e = inode_xattr_list_get_cached_by_patterns( pp->st.st_ino, attrpatterns, nattrpatterns, &pp->xattrs, &pp->nxattrs); if (e != GFARM_ERR_NO_ERROR) { pp->xattrs = NULL; pp->nxattrs = 0; } for (j = 0; j < pp->nxattrs; j++) { px = &pp->xattrs[j]; if (px->value != NULL) /* cached */ continue; /* not cached */ db_waitctx_init(&waitctx); e = db_xattr_get(0, pp->st.st_ino, px->name, &px->value, &px->size, &waitctx); if (e == GFARM_ERR_NO_ERROR) { /* * XXX this is slow, but we don't know * the safe window size */ giant_unlock(); e = dbq_waitret(&waitctx); giant_lock(); } db_waitctx_fini(&waitctx); /* if error happens, px->size == 0 here */ } } giant_unlock(); } e2 = gfm_server_put_reply(peer, diag, e, "i", n); if (e2 == GFARM_ERR_NO_ERROR && e == GFARM_ERR_NO_ERROR) { for (i = 0; i < n; i++) { struct gfs_stat *st = &p[i].st; e2 = gfp_xdr_send(client, "sllilsslllililii", p[i].name, st->st_ino, st->st_gen, st->st_mode, st->st_nlink, st->st_user, st->st_group, st->st_size, st->st_ncopy, st->st_atimespec.tv_sec, st->st_atimespec.tv_nsec, st->st_mtimespec.tv_sec, st->st_mtimespec.tv_nsec, st->st_ctimespec.tv_sec, st->st_ctimespec.tv_nsec, (int)p[i].nxattrs); if (e2 != GFARM_ERR_NO_ERROR) { gflog_warning(GFARM_MSG_1002508, "%s@%s: getdirentsplusxattr: %s", peer_get_username(peer), peer_get_hostname(peer), gfarm_error_string(e2)); break; } for (j = 0; j < p[i].nxattrs; j++) { px = &p[i].xattrs[j]; e2 = gfp_xdr_send(client, "sb", px->name, px->size, px->value); if (e2 != GFARM_ERR_NO_ERROR) { gflog_warning(GFARM_MSG_1002509, "%s@%s: getdirentsplusxattr: %s", peer_get_username(peer), peer_get_hostname(peer), gfarm_error_string(e2)); break; } } if (e2 != GFARM_ERR_NO_ERROR) break; } } if (p != NULL) { for (i = 0; i < n; i++) { free(p[i].name); gfs_stat_free(&p[i].st); inode_xattr_list_free(p[i].xattrs, p[i].nxattrs); } free(p); } if (attrpatterns != NULL) { for (i = 0; i < nattrpatterns; i++) free(attrpatterns[i]); free(attrpatterns); } return (e); } gfarm_error_t gfm_server_seek(struct peer *peer, int from_client, int skip) { gfarm_error_t e; gfarm_int32_t fd, whence; gfarm_off_t offset, current, max; struct host *spool_host = NULL; struct process *process; struct inode *inode; Dir dir; static const char diag[] = "GFM_PROTO_SEEK"; e = gfm_server_get_request(peer, diag, "li", &offset, &whence); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001927, "seek request failed: %s", gfarm_error_string(e)); return (e); } if (skip) return (GFARM_ERR_NO_ERROR); giant_lock(); if (!from_client && (spool_host = peer_get_host(peer)) == NULL) { gflog_debug(GFARM_MSG_1001928, "operation is not permitted"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if ((process = peer_get_process(peer)) == NULL) { gflog_debug(GFARM_MSG_1001929, "operation is not permitted: peer_get_process() " "failed"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if ((e = peer_fdpair_get_current(peer, &fd)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001930, "peer_fdpair_get_current() failed: %s", gfarm_error_string(e)); } else if ((e = process_get_file_inode(process, fd, &inode)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001931, "process_get_file_inode() failed: %s", gfarm_error_string(e)); } else if ((dir = inode_get_dir(inode)) == NULL) { gflog_debug(GFARM_MSG_1001932, "inode_get_dir() failed"); e = GFARM_ERR_NOT_A_DIRECTORY; } else if ((e = process_get_dir_offset(process, peer, fd, ¤t)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001933, "process_get_dir_offset() failed: %s", gfarm_error_string(e)); } else if (whence < 0 || whence > 2) { gflog_debug(GFARM_MSG_1001934, "argument 'whence' is invalid"); e = GFARM_ERR_INVALID_ARGUMENT; } else { max = dir_get_entry_count(dir); switch (whence) { case 0: break; case 1: offset += current; break; case 2: offset += max; break; default: assert(0); } if (offset != current) { if (offset > max) offset = max; process_clear_dir_key(process, peer, fd); process_set_dir_offset(process, peer, fd, offset); } } giant_unlock(); return (gfm_server_put_reply(peer, diag, e, "l", offset)); } struct reopen_resume_arg { int fd; }; gfarm_error_t reopen_resume(struct peer *peer, void *closure, int *suspendedp) { gfarm_error_t e; struct reopen_resume_arg *arg = closure; struct host *spool_host; struct process *process; gfarm_ino_t inum; gfarm_uint64_t gen; gfarm_int32_t mode, flags, to_create; static const char diag[] = "reopen_resume"; giant_lock(); if ((spool_host = peer_get_host(peer)) == NULL) { gflog_debug(GFARM_MSG_1002261, "%s: peer_get_host() failed", diag); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if ((process = peer_get_process(peer)) == NULL) { gflog_debug(GFARM_MSG_1002262, "%s: peer_get_process() failed", diag); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if ((e = process_reopen_file(process, peer, spool_host, arg->fd, &inum, &gen, &mode, &flags, &to_create)) == GFARM_ERR_RESOURCE_TEMPORARILY_UNAVAILABLE) { if ((e = process_new_generation_wait(peer, arg->fd, reopen_resume, arg)) == GFARM_ERR_NO_ERROR) { *suspendedp = 1; giant_unlock(); return (GFARM_ERR_NO_ERROR); } } free(arg); giant_unlock(); return (gfm_server_put_reply(peer, diag, e, "lliii", inum, gen, mode, flags, to_create)); } gfarm_error_t gfm_server_reopen(struct peer *peer, int from_client, int skip, int *suspendedp) { gfarm_error_t e; gfarm_int32_t fd; struct host *spool_host; struct process *process; gfarm_ino_t inum; gfarm_uint64_t gen; gfarm_int32_t mode, flags, to_create; struct reopen_resume_arg *arg; static const char diag[] = "GFM_PROTO_REOPEN"; if (skip) return (GFARM_ERR_NO_ERROR); giant_lock(); if (from_client) { /* from gfsd only */ gflog_debug(GFARM_MSG_1001935, "operation is not permitted"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if ((spool_host = peer_get_host(peer)) == NULL) { gflog_debug(GFARM_MSG_1001936, "peer_get_host() failed"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if ((process = peer_get_process(peer)) == NULL) { gflog_debug(GFARM_MSG_1001937, "peer_get_process() failed"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if ((e = peer_fdpair_get_current(peer, &fd)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001938, "peer_fdpair_get_current() failed: %s", gfarm_error_string(e)); } else if ((e = process_reopen_file(process, peer, spool_host, fd, &inum, &gen, &mode, &flags, &to_create)) == GFARM_ERR_RESOURCE_TEMPORARILY_UNAVAILABLE) { GFARM_MALLOC(arg); if (arg == NULL) { e = GFARM_ERR_NO_MEMORY; } else { arg->fd = fd; if ((e = process_new_generation_wait(peer, fd, reopen_resume, arg)) == GFARM_ERR_NO_ERROR) { *suspendedp = 1; giant_unlock(); return (GFARM_ERR_NO_ERROR); } } } giant_unlock(); return (gfm_server_put_reply(peer, diag, e, "lliii", inum, gen, mode, flags, to_create)); } gfarm_error_t gfm_server_close_read(struct peer *peer, int from_client, int skip) { gfarm_error_t e; gfarm_int32_t fd; struct gfarm_timespec atime; struct host *spool_host; struct process *process; int transaction = 0; static const char diag[] = "GFM_PROTO_CLOSE_READ"; e = gfm_server_get_request(peer, diag, "li", &atime.tv_sec, &atime.tv_nsec); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001939, "close_read request failed: %s", gfarm_error_string(e)); return (e); } if (skip) return (GFARM_ERR_NO_ERROR); giant_lock(); if (from_client) { /* from gfsd only */ gflog_debug(GFARM_MSG_1001940, "operation is not permitted"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if ((spool_host = peer_get_host(peer)) == NULL) { gflog_debug(GFARM_MSG_1001941, "peer_get_host() failed"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if ((process = peer_get_process(peer)) == NULL) { gflog_debug(GFARM_MSG_1001942, "peer_get_process() failed"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if ((e = peer_fdpair_get_current(peer, &fd)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001943, "peer_fdpair_get_current() failed: %s", gfarm_error_string(e)); } else { if (db_begin(diag) == GFARM_ERR_NO_ERROR) transaction = 1; /* * closing must be done regardless of the result of db_begin(). * because not closing may cause descriptor leak. */ e = process_close_file_read(process, peer, fd, &atime); if (transaction) db_end(diag); if (e == GFARM_ERR_NO_ERROR) /* permission ok */ e = peer_fdpair_close_current(peer); } giant_unlock(); return (gfm_server_put_reply(peer, diag, e, "")); } struct close_v2_4_resume_arg { int fd; gfarm_off_t size; struct gfarm_timespec atime, mtime; }; gfarm_error_t close_write_v2_4_resume(struct peer *peer, void *closure, int *suspendedp) { gfarm_error_t e; struct close_v2_4_resume_arg *arg = closure; struct host *spool_host; struct process *process; int transaction = 0; gfarm_int32_t flags; gfarm_int64_t old_gen = 0, new_gen = 0; static const char diag[] = "close_v2_4_resume"; giant_lock(); if ((spool_host = peer_get_host(peer)) == NULL) { gflog_debug(GFARM_MSG_1002263, "%s: peer_get_host() failed", diag); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if ((process = peer_get_process(peer)) == NULL) { gflog_debug(GFARM_MSG_1002264, "%s: peer_get_process() failed", diag); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else { if (db_begin(diag) == GFARM_ERR_NO_ERROR) transaction = 1; /* * closing must be done regardless of the result of db_begin(). * because not closing may cause descriptor leak. */ e = process_close_file_write(process, peer, arg->fd, arg->size, &arg->atime, &arg->mtime, &flags, &old_gen, &new_gen); if (transaction) db_end(diag); if (e == GFARM_ERR_NO_ERROR) /* permission ok */ e = peer_fdpair_close_current(peer); else if (e == GFARM_ERR_RESOURCE_TEMPORARILY_UNAVAILABLE) { if ((e = process_new_generation_wait(peer, arg->fd, close_write_v2_4_resume, arg)) == GFARM_ERR_NO_ERROR) { *suspendedp = 1; giant_unlock(); return (GFARM_ERR_NO_ERROR); } } } free(arg); giant_unlock(); return (gfm_server_put_reply(peer, diag, e, "ill", flags, old_gen, new_gen)); } gfarm_error_t gfm_server_close_write_common(const char *diag, struct peer *peer, int from_client, gfarm_off_t size, struct gfarm_timespec *atime, struct gfarm_timespec *mtime, gfarm_int32_t *flagsp, gfarm_int64_t *old_genp, gfarm_int64_t *new_genp) { gfarm_error_t e; gfarm_int32_t fd; struct process *process; int transaction = 0; struct close_v2_4_resume_arg *arg; if (from_client) { /* from gfsd only */ gflog_debug(GFARM_MSG_1001944, "operation is not permitted"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if (peer_get_host(peer) == NULL) { gflog_debug(GFARM_MSG_1001945, "peer_get_host() failed"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if ((process = peer_get_process(peer)) == NULL) { gflog_debug(GFARM_MSG_1001946, "peer_get_process() failed"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if ((e = peer_fdpair_get_current(peer, &fd)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001947, "peer_fdpair_get_current() failed: %s", gfarm_error_string(e)); } else { if (db_begin(diag) == GFARM_ERR_NO_ERROR) transaction = 1; /* * closing must be done regardless of the result of db_begin(). * because not closing may cause descriptor leak. */ e = process_close_file_write(process, peer, fd, size, atime, mtime, flagsp, old_genp, new_genp); if (transaction) db_end(diag); if (e == GFARM_ERR_NO_ERROR) /* permission ok */ e = peer_fdpair_close_current(peer); else if (e == GFARM_ERR_RESOURCE_TEMPORARILY_UNAVAILABLE) { GFARM_MALLOC(arg); if (arg == NULL) { e = GFARM_ERR_NO_MEMORY; } else { arg->fd = fd; arg->size = size; arg->atime = *atime; arg->mtime = *mtime; if ((e = process_new_generation_wait(peer, fd, close_write_v2_4_resume, arg)) == GFARM_ERR_NO_ERROR) { return (GFARM_ERR_RESOURCE_TEMPORARILY_UNAVAILABLE); } } } } return (e); } gfarm_error_t gfm_server_close_write(struct peer *peer, int from_client, int skip) { gfarm_error_t e; gfarm_off_t size; struct gfarm_timespec atime, mtime; static const char diag[] = "GFM_PROTO_CLOSE_WRITE"; e = gfm_server_get_request(peer, diag, "llili", &size, &atime.tv_sec, &atime.tv_nsec, &mtime.tv_sec, &mtime.tv_nsec); if (e != GFARM_ERR_NO_ERROR) return (e); if (skip) return (GFARM_ERR_NO_ERROR); giant_lock(); e = gfm_server_close_write_common(diag, peer, from_client, size, &atime, &mtime, NULL, NULL, NULL); giant_unlock(); return (gfm_server_put_reply(peer, diag, e, "")); } gfarm_error_t gfm_server_close_write_v2_4(struct peer *peer, int from_client, int skip, int *suspendedp) { gfarm_error_t e; gfarm_off_t size; struct gfarm_timespec atime, mtime; gfarm_int32_t flags; gfarm_int64_t old_gen = 0, new_gen = 0; static const char diag[] = "GFM_PROTO_CLOSE_WRITE_V2_4"; e = gfm_server_get_request(peer, diag, "llili", &size, &atime.tv_sec, &atime.tv_nsec, &mtime.tv_sec, &mtime.tv_nsec); if (e != GFARM_ERR_NO_ERROR) return (e); if (skip) return (GFARM_ERR_NO_ERROR); giant_lock(); e = gfm_server_close_write_common(diag, peer, from_client, size, &atime, &mtime, &flags, &old_gen, &new_gen); giant_unlock(); if (e == GFARM_ERR_RESOURCE_TEMPORARILY_UNAVAILABLE) { *suspendedp = 1; return (GFARM_ERR_NO_ERROR); } return (gfm_server_put_reply(peer, diag, e, "ill", flags, old_gen, new_gen)); } gfarm_error_t gfm_server_generation_updated(struct peer *peer, int from_client, int skip) { gfarm_error_t e; gfarm_int32_t fd, result; struct host *spool_host; struct process *process; static const char diag[] = "GFM_PROTO_GENERATION_UPDATED"; e = gfm_server_get_request(peer, diag, "i", &result); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1002265, "%s request failed: %s", diag, gfarm_error_string(e)); return (e); } if (skip) return (GFARM_ERR_NO_ERROR); giant_lock(); if (from_client) { /* from gfsd only */ gflog_debug(GFARM_MSG_1002266, "%s: from client", diag); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if ((spool_host = peer_get_host(peer)) == NULL) { gflog_debug(GFARM_MSG_1002267, "%s: peer_get_host() failed", diag); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if ((process = peer_get_process(peer)) == NULL) { gflog_debug(GFARM_MSG_1002268, "%s: peer_get_process() failed", diag); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if ((e = peer_fdpair_get_current(peer, &fd)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1002269, "%s: peer_fdpair_get_current() failed: %s", diag, gfarm_error_string(e)); } else if ((e = process_new_generation_done(process, peer, fd, result)) != GFARM_ERR_NO_ERROR) { gflog_warning(GFARM_MSG_1002270, "%s: host %s, fd %d: new generation wakeup(%s): %s\n", diag, host_name(spool_host), fd, gfarm_error_string(result), gfarm_error_string(e)); } else if (result != GFARM_ERR_NO_ERROR) { gflog_warning(GFARM_MSG_1002271, "%s: host %s, fd %d: new generation rename: %s\n", diag, host_name(spool_host), fd, gfarm_error_string(result)); } giant_unlock(); return (gfm_server_put_reply(peer, diag, e, "")); } gfarm_error_t gfm_server_lock(struct peer *peer, int from_client, int skip) { gfarm_error_t e; gfarm_off_t start, len; gfarm_int32_t type, whence; static const char diag[] = "GFM_PROTO_LOCK"; /* XXX - NOT IMPLEMENTED */ gflog_error(GFARM_MSG_1000388, "%s: not implemented", diag); e = gfm_server_get_request(peer, diag, "llii", &start, &len, &type, &whence); if (e != GFARM_ERR_NO_ERROR) return (e); if (skip) return (GFARM_ERR_NO_ERROR); e = gfm_server_put_reply(peer, diag, GFARM_ERR_FUNCTION_NOT_IMPLEMENTED, ""); return (e != GFARM_ERR_NO_ERROR ? e : GFARM_ERR_FUNCTION_NOT_IMPLEMENTED); } gfarm_error_t gfm_server_trylock(struct peer *peer, int from_client, int skip) { gfarm_error_t e; gfarm_off_t start, len; gfarm_int32_t type, whence; static const char diag[] = "GFM_PROTO_TRYLOCK"; /* XXX - NOT IMPLEMENTED */ gflog_error(GFARM_MSG_1000389, "%s: not implemented", diag); e = gfm_server_get_request(peer, diag, "llii", &start, &len, &type, &whence); if (e != GFARM_ERR_NO_ERROR) return (e); if (skip) return (GFARM_ERR_NO_ERROR); e = gfm_server_put_reply(peer, diag, GFARM_ERR_FUNCTION_NOT_IMPLEMENTED, ""); return (e != GFARM_ERR_NO_ERROR ? e : GFARM_ERR_FUNCTION_NOT_IMPLEMENTED); } gfarm_error_t gfm_server_unlock(struct peer *peer, int from_client, int skip) { gfarm_error_t e; gfarm_off_t start, len; gfarm_int32_t type, whence; static const char diag[] = "GFM_PROTO_UNLOCK"; /* XXX - NOT IMPLEMENTED */ gflog_error(GFARM_MSG_1000390, "%s: not implemented", diag); e = gfm_server_get_request(peer, diag, "llii", &start, &len, &type, &whence); if (e != GFARM_ERR_NO_ERROR) return (e); if (skip) return (GFARM_ERR_NO_ERROR); e = gfm_server_put_reply(peer, diag, GFARM_ERR_FUNCTION_NOT_IMPLEMENTED, ""); return (e != GFARM_ERR_NO_ERROR ? e : GFARM_ERR_FUNCTION_NOT_IMPLEMENTED); } gfarm_error_t gfm_server_lock_info(struct peer *peer, int from_client, int skip) { gfarm_error_t e; gfarm_off_t start, len; gfarm_int32_t type, whence; static const char diag[] = "GFM_PROTO_LOCK_INFO"; /* XXX - NOT IMPLEMENTED */ gflog_error(GFARM_MSG_1000391, "%s: not implemented", diag); e = gfm_server_get_request(peer, diag, "llii", &start, &len, &type, &whence); if (e != GFARM_ERR_NO_ERROR) return (e); if (skip) return (GFARM_ERR_NO_ERROR); e = gfm_server_put_reply(peer, diag, GFARM_ERR_FUNCTION_NOT_IMPLEMENTED, ""); return (e != GFARM_ERR_NO_ERROR ? e : GFARM_ERR_FUNCTION_NOT_IMPLEMENTED); } gfarm_error_t gfm_server_glob(struct peer *peer, int from_client, int skip) { gfarm_error_t e; static const char diag[] = "GFM_PROTO_GLOB"; /* XXX - NOT IMPLEMENTED */ gflog_error(GFARM_MSG_1000392, "%s: not implemented", diag); e = gfm_server_put_reply(peer, diag, GFARM_ERR_FUNCTION_NOT_IMPLEMENTED, ""); return (e != GFARM_ERR_NO_ERROR ? e : GFARM_ERR_FUNCTION_NOT_IMPLEMENTED); } gfarm_error_t gfm_server_schedule(struct peer *peer, int from_client, int skip) { gfarm_error_t e; static const char diag[] = "GFM_PROTO_SCHEDULE"; /* XXX - NOT IMPLEMENTED */ gflog_error(GFARM_MSG_1000393, "%s: not implemented", diag); e = gfm_server_put_reply(peer, diag, GFARM_ERR_FUNCTION_NOT_IMPLEMENTED, ""); return (e != GFARM_ERR_NO_ERROR ? e : GFARM_ERR_FUNCTION_NOT_IMPLEMENTED); } gfarm_error_t gfm_server_pio_open(struct peer *peer, int from_client, int skip) { gfarm_error_t e; static const char diag[] = "GFM_PROTO_PIO_OPEN"; /* XXX - NOT IMPLEMENTED */ gflog_error(GFARM_MSG_1000394, "%s: not implemented", diag); e = gfm_server_put_reply(peer, diag, GFARM_ERR_FUNCTION_NOT_IMPLEMENTED, ""); return (e != GFARM_ERR_NO_ERROR ? e : GFARM_ERR_FUNCTION_NOT_IMPLEMENTED); } gfarm_error_t gfm_server_pio_set_paths(struct peer *peer, int from_client, int skip) { gfarm_error_t e; static const char diag[] = "GFM_PROTO_PIO_SET_PATHS"; /* XXX - NOT IMPLEMENTED */ gflog_error(GFARM_MSG_1000395, "%s: not implemented", diag); e = gfm_server_put_reply(peer, diag, GFARM_ERR_FUNCTION_NOT_IMPLEMENTED, ""); return (e != GFARM_ERR_NO_ERROR ? e : GFARM_ERR_FUNCTION_NOT_IMPLEMENTED); } gfarm_error_t gfm_server_pio_close(struct peer *peer, int from_client, int skip) { gfarm_error_t e; static const char diag[] = "GFM_PROTO_PIO_CLOSE"; /* XXX - NOT IMPLEMENTED */ gflog_error(GFARM_MSG_1000396, "%s: not implemented", diag); e = gfm_server_put_reply(peer, diag, GFARM_ERR_FUNCTION_NOT_IMPLEMENTED, ""); return (e != GFARM_ERR_NO_ERROR ? e : GFARM_ERR_FUNCTION_NOT_IMPLEMENTED); } gfarm_error_t gfm_server_pio_visit(struct peer *peer, int from_client, int skip) { gfarm_error_t e; static const char diag[] = "GFM_PROTO_PIO_VISIT"; /* XXX - NOT IMPLEMENTED */ gflog_error(GFARM_MSG_1000397, "%s: not implemented", diag); e = gfm_server_put_reply(peer, diag, GFARM_ERR_FUNCTION_NOT_IMPLEMENTED, ""); return (e != GFARM_ERR_NO_ERROR ? e : GFARM_ERR_FUNCTION_NOT_IMPLEMENTED); } gfarm_error_t gfm_server_replica_list_by_name(struct peer *peer, int from_client, int skip) { gfarm_error_t e, e2; struct host *spool_host; struct process *process; int fd, i; gfarm_int32_t n; struct inode *inode; char **hosts; static const char diag[] = "GFM_PROTO_REPLICA_LIST_BY_NAME"; if (skip) return (GFARM_ERR_NO_ERROR); giant_lock(); if (!from_client && (spool_host = peer_get_host(peer)) == NULL) { gflog_debug(GFARM_MSG_1001948, "operation is not permitted"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if ((process = peer_get_process(peer)) == NULL) { gflog_debug(GFARM_MSG_1001949, "peer_get_process() failed"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if ((e = peer_fdpair_get_current(peer, &fd)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001950, "peer_fdpair_get_current() failed: %s", gfarm_error_string(e)); } else if ((e = process_get_file_inode(process, fd, &inode)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001951, "process_get_file_inode() failed: %s", gfarm_error_string(e)); } else e = inode_replica_list_by_name(inode, &n, &hosts); giant_unlock(); e2 = gfm_server_put_reply(peer, diag, e, "i", n); if (e == GFARM_ERR_NO_ERROR) { for (i = 0; i < n; ++i) { e2 = gfp_xdr_send(peer_get_conn(peer), "s", hosts[i]); if (e2 != GFARM_ERR_NO_ERROR) break; } for (i = 0; i < n; ++i) free(hosts[i]); free(hosts); } return (e2); } gfarm_error_t gfm_server_replica_list_by_host(struct peer *peer, int from_client, int skip) { gfarm_error_t e; char *host; gfarm_int32_t port; static const char diag[] = "GFM_PROTO_REPLICA_LIST_BY_HOST"; /* XXX - NOT IMPLEMENTED */ gflog_error(GFARM_MSG_1000398, "%s: not implemented", diag); e = gfm_server_get_request(peer, diag, "si", &host, &port); if (e != GFARM_ERR_NO_ERROR) return (e); if (skip) { free(host); return (GFARM_ERR_NO_ERROR); } free(host); e = gfm_server_put_reply(peer, diag, GFARM_ERR_FUNCTION_NOT_IMPLEMENTED, ""); return (e != GFARM_ERR_NO_ERROR ? e : GFARM_ERR_FUNCTION_NOT_IMPLEMENTED); } gfarm_error_t gfm_server_replica_remove_by_host(struct peer *peer, int from_client, int skip) { gfarm_error_t e; char *host; gfarm_int32_t port; static const char diag[] = "GFM_PROTO_REPLICA_REMOVE_BY_HOST"; /* XXX - NOT IMPLEMENTED */ gflog_error(GFARM_MSG_1000399, "%s: not implemented", diag); e = gfm_server_get_request(peer, diag, "si", &host, &port); if (e != GFARM_ERR_NO_ERROR) return (e); if (skip) { free(host); return (GFARM_ERR_NO_ERROR); } free(host); e = gfm_server_put_reply(peer, diag, GFARM_ERR_FUNCTION_NOT_IMPLEMENTED, ""); return (e != GFARM_ERR_NO_ERROR ? e : GFARM_ERR_FUNCTION_NOT_IMPLEMENTED); } gfarm_error_t gfm_server_replica_remove_by_file(struct peer *peer, int from_client, int skip) { gfarm_error_t e; char *hostname; struct process *process; gfarm_int32_t cfd; struct inode *inode; struct host *host, *spool_host; static const char diag[] = "GFM_PROTO_REPLICA_REMOVE_BY_FILE"; e = gfm_server_get_request(peer, diag, "s", &hostname); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001952, "replica_remove_by_file request failed: %s", gfarm_error_string(e)); return (e); } if (skip) { free(hostname); return (GFARM_ERR_NO_ERROR); } giant_lock(); if ((process = peer_get_process(peer)) == NULL) { gflog_debug(GFARM_MSG_1001953, "peer_get_process() failed"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if (process_get_user(process) == NULL) { gflog_debug(GFARM_MSG_1001954, "process_get_user() failed"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if ((e = peer_fdpair_get_current(peer, &cfd)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001955, "peer_fdpair_get_current() failed: %s", gfarm_error_string(e)); } else if ((e = process_get_file_inode(process, cfd, &inode)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001956, "process_get_file_inode() failed: %s", gfarm_error_string(e)); } else if ((host = host_lookup(hostname)) == NULL) { gflog_debug(GFARM_MSG_1001957, "host_lookup() failed"); e = GFARM_ERR_NO_SUCH_OBJECT; } else if ((spool_host = inode_writing_spool_host(inode)) != NULL && spool_host == host) { gflog_debug(GFARM_MSG_1001958, "inode_writing_spool_host() failed"); e = GFARM_ERR_TEXT_FILE_BUSY; } else { e = inode_remove_replica(inode, host, 1); } free(hostname); giant_unlock(); return (gfm_server_put_reply(peer, diag, e, "")); } gfarm_error_t gfm_server_replica_info_get(struct peer *peer, int from_client, int skip) { gfarm_error_t e, e2; struct host *spool_host; struct process *process; int fd, i; gfarm_int32_t iflags, n; struct inode *inode; char **hosts; gfarm_int64_t *gens; gfarm_int32_t *oflags; static const char diag[] = "GFM_PROTO_REPLICA_INFO_GET"; e = gfm_server_get_request(peer, diag, "i", &iflags); if (e != GFARM_ERR_NO_ERROR) return (e); if (skip) return (GFARM_ERR_NO_ERROR); giant_lock(); if (!from_client && (spool_host = peer_get_host(peer)) == NULL) e = GFARM_ERR_OPERATION_NOT_PERMITTED; else if ((process = peer_get_process(peer)) == NULL) e = GFARM_ERR_OPERATION_NOT_PERMITTED; else if ((e = peer_fdpair_get_current(peer, &fd)) != GFARM_ERR_NO_ERROR) ; else if ((e = process_get_file_inode(process, fd, &inode)) != GFARM_ERR_NO_ERROR) ; else e = inode_replica_info_get(inode, iflags, &n, &hosts, &gens, &oflags); giant_unlock(); e2 = gfm_server_put_reply(peer, diag, e, "i", n); if (e == GFARM_ERR_NO_ERROR) { for (i = 0; i < n; ++i) { e = gfp_xdr_send(peer_get_conn(peer), "sli", hosts[i], gens[i], oflags[i]); if (e != GFARM_ERR_NO_ERROR) break; } for (i = 0; i < n; ++i) free(hosts[i]); free(hosts); free(gens); free(oflags); } return (e2); } gfarm_error_t gfm_server_replicate_file_from_to(struct peer *peer, int from_client, int skip) { gfarm_error_t e; char *srchost; char *dsthost; gfarm_int32_t flags; struct process *process; gfarm_int32_t cfd; struct host *src, *dst; struct inode *inode; struct file_replicating *fr; int srcport; gfarm_ino_t ino; gfarm_int64_t gen; static const char diag[] = "GFM_PROTO_REPLICATE_FILE_FROM_TO"; #ifdef __GNUC__ /* shut up stupid warning by gcc */ src = NULL; dst = NULL; fr = NULL; srcport = 0; ino = 0; gen = 0; #endif e = gfm_server_get_request(peer, diag, "ssi", &srchost, &dsthost, &flags); if (e != GFARM_ERR_NO_ERROR) return (e); if (skip) { free(srchost); free(dsthost); return (GFARM_ERR_NO_ERROR); } giant_lock(); if ((process = peer_get_process(peer)) == NULL) e = GFARM_ERR_OPERATION_NOT_PERMITTED; else if ((e = peer_fdpair_get_current(peer, &cfd)) != GFARM_ERR_NO_ERROR) ; else if ((src = host_lookup(srchost)) == NULL) e = GFARM_ERR_UNKNOWN_HOST; else if ((dst = host_lookup(dsthost)) == NULL) e = GFARM_ERR_UNKNOWN_HOST; else if ((e = process_prepare_to_replicate(process, peer, src, dst, cfd, flags, &fr, &inode)) != GFARM_ERR_NO_ERROR) ; else { srcport = host_port(src); ino = inode_get_number(inode); gen = inode_get_gen(inode); } giant_unlock(); if (e == GFARM_ERR_NO_ERROR) { /* * host_name() is always callable without giant_lock, * and even accessible after the removal of the host. */ e = async_back_channel_replication_request( host_name(src), srcport, dst, ino, gen, fr); if (e != GFARM_ERR_NO_ERROR) { giant_lock(); file_replicating_free(fr); giant_unlock(); } } free(srchost); free(dsthost); return (gfm_server_put_reply(peer, diag, e, "")); } struct replica_adding_resume_arg { int fd; char *src_host; }; gfarm_error_t replica_adding_resume(struct peer *peer, void *closure, int *suspendedp) { gfarm_error_t e; struct replica_adding_resume_arg *arg = closure; struct host *spool_host; struct process *process; struct host *src; struct inode *inode; gfarm_ino_t inum = 0; gfarm_uint64_t gen = 0; struct gfarm_timespec *mtime; gfarm_int64_t mtime_sec = 0; gfarm_int32_t mtime_nsec = 0; static const char diag[] = "replica_adding_resume"; giant_lock(); if ((spool_host = peer_get_host(peer)) == NULL) { gflog_debug(GFARM_MSG_1002272, "%s: peer_get_host() failed", diag); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if ((process = peer_get_process(peer)) == NULL) { gflog_debug(GFARM_MSG_1002273, "%s: peer_get_process() failed", diag); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if ((src = host_lookup(arg->src_host)) == NULL) { e = GFARM_ERR_UNKNOWN_HOST; } else if ((e = process_replica_adding(process, peer, src, spool_host, arg->fd, &inode)) == GFARM_ERR_RESOURCE_TEMPORARILY_UNAVAILABLE) { if ((e = process_new_generation_wait(peer, arg->fd, replica_adding_resume, arg)) == GFARM_ERR_NO_ERROR) { *suspendedp = 1; giant_unlock(); return (GFARM_ERR_NO_ERROR); } } else if (e != GFARM_ERR_NO_ERROR) ; else { inum = inode_get_number(inode); gen = inode_get_gen(inode); mtime = inode_get_mtime(inode); mtime_sec = mtime->tv_sec; mtime_nsec = mtime->tv_nsec; } /* we don't maintain file_replicating in this case */ free(arg->src_host); free(arg); giant_unlock(); return (gfm_server_put_reply(peer, diag, e, "llli", inum, gen, mtime_sec, mtime_nsec)); } gfarm_error_t gfm_server_replica_adding(struct peer *peer, int from_client, int skip, int *suspendedp) { gfarm_error_t e; gfarm_ino_t inum = 0; gfarm_uint64_t gen = 0; struct gfarm_timespec *mtime; gfarm_int64_t mtime_sec = 0; gfarm_int32_t fd, mtime_nsec = 0; struct host *src, *spool_host; struct process *process; char *src_host; struct inode *inode; struct replica_adding_resume_arg *arg; static const char diag[] = "GFM_PROTO_REPLICA_ADDING"; e = gfm_server_get_request(peer, diag, "s", &src_host); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001959, "%s request: %s", diag, gfarm_error_string(e)); return (e); } if (skip) { free(src_host); return (GFARM_ERR_NO_ERROR); } giant_lock(); if (from_client) { /* from gfsd only */ gflog_debug(GFARM_MSG_1001960, "operation is not permitted"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if ((spool_host = peer_get_host(peer)) == NULL) { gflog_debug(GFARM_MSG_1001961, "peer_get_host() failed"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if ((process = peer_get_process(peer)) == NULL) { gflog_debug(GFARM_MSG_1001962, "operation is not permitted: peer_get_process() " "failed"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if ((e = peer_fdpair_get_current(peer, &fd)) != GFARM_ERR_NO_ERROR) ; else if ((src = host_lookup(src_host)) == NULL) e = GFARM_ERR_UNKNOWN_HOST; else if ((e = process_replica_adding(process, peer, src, spool_host, fd, &inode)) == GFARM_ERR_RESOURCE_TEMPORARILY_UNAVAILABLE) { GFARM_MALLOC(arg); if (arg == NULL) { e = GFARM_ERR_NO_MEMORY; } else { arg->fd = fd; arg->src_host = src_host; if ((e = process_new_generation_wait(peer, fd, replica_adding_resume, arg)) == GFARM_ERR_NO_ERROR) { *suspendedp = 1; giant_unlock(); return (GFARM_ERR_NO_ERROR); } } } else if (e != GFARM_ERR_NO_ERROR) ; else { inum = inode_get_number(inode); gen = inode_get_gen(inode); mtime = inode_get_mtime(inode); mtime_sec = mtime->tv_sec; mtime_nsec = mtime->tv_nsec; } /* we don't maintain file_replicating in this case */ free(src_host); giant_unlock(); return (gfm_server_put_reply(peer, diag, e, "llli", inum, gen, mtime_sec, mtime_nsec)); } /* assume giant lock is obtained */ gfarm_error_t gfm_server_replica_added_common(const char *diag, struct peer *peer, int from_client, gfarm_int32_t flags, gfarm_int64_t mtime_sec, gfarm_int32_t mtime_nsec, gfarm_off_t size) { gfarm_error_t e; gfarm_int32_t fd; struct host *spool_host; struct process *process; int transaction = 0; if (from_client) { /* from gfsd only */ gflog_debug(GFARM_MSG_1001963, "operation is not permitted"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if ((spool_host = peer_get_host(peer)) == NULL) { gflog_debug(GFARM_MSG_1001964, "operation is not permitted: peer_get_host() failed"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if ((process = peer_get_process(peer)) == NULL) { gflog_debug(GFARM_MSG_1001965, "operation is not permitted: peer_get_process() " "failed"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if ((e = peer_fdpair_get_current(peer, &fd)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001966, "peer_fdpair_get_current() failed: %s", gfarm_error_string(e)); } else { if (db_begin(diag) == GFARM_ERR_NO_ERROR) transaction = 1; /* * the following internally calls process_close_file_read() and * closing must be done regardless of the result of db_begin(). * because not closing may cause descriptor leak. */ e = process_replica_added(process, peer, spool_host, fd, flags, mtime_sec, mtime_nsec, size); if (transaction) db_end(diag); } /* we don't maintain file_replicating in this case */ return (e); } /* obsolete protocol */ gfarm_error_t gfm_server_replica_added(struct peer *peer, int from_client, int skip) { gfarm_error_t e; gfarm_int32_t flags, mtime_nsec; gfarm_int64_t mtime_sec; static const char diag[] = "GFM_PROTO_REPLICA_ADDED"; e = gfm_server_get_request(peer, diag, "ili", &flags, &mtime_sec, &mtime_nsec); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001967, "%s request failed: %s", diag, gfarm_error_string(e)); return (e); } if (skip) return (GFARM_ERR_NO_ERROR); giant_lock(); e = gfm_server_replica_added_common(diag, peer, from_client, flags, mtime_sec, mtime_nsec, -1); giant_unlock(); return (gfm_server_put_reply(peer, diag, e, "")); } gfarm_error_t gfm_server_replica_added2(struct peer *peer, int from_client, int skip) { gfarm_error_t e; gfarm_int32_t flags, mtime_nsec; gfarm_int64_t mtime_sec; gfarm_off_t size; static const char diag[] = "GFM_PROTO_REPLICA_ADDED2"; e = gfm_server_get_request(peer, diag, "ilil", &flags, &mtime_sec, &mtime_nsec, &size); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001968, "%s request failed: %s", diag, gfarm_error_string(e)); return (e); } if (skip) return (GFARM_ERR_NO_ERROR); giant_lock(); e = gfm_server_replica_added_common(diag, peer, from_client, flags, mtime_sec, mtime_nsec, size); giant_unlock(); return (gfm_server_put_reply(peer, diag, e, "")); } gfarm_error_t gfm_server_replica_lost(struct peer *peer, int from_client, int skip) { gfarm_error_t e; gfarm_ino_t inum; gfarm_uint64_t gen; struct host *spool_host; struct inode *inode; static const char diag[] = "GFM_PROTO_REPLICA_LOST"; e = gfm_server_get_request(peer, diag, "ll", &inum, &gen); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001969, "replica_remove request failed: %s", gfarm_error_string(e)); return (e); } if (skip) return (GFARM_ERR_NO_ERROR); giant_lock(); if (from_client) { /* from gfsd only */ gflog_debug(GFARM_MSG_1001970, "operation is not permitted"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if ((spool_host = peer_get_host(peer)) == NULL) { gflog_debug(GFARM_MSG_1001971, "operation is not permitted: peer_get_host() failed"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if ((inode = inode_lookup(inum)) == NULL) { gflog_debug(GFARM_MSG_1001972, "inode_lookup() failed"); e = GFARM_ERR_NO_SUCH_OBJECT; } else if (inode_get_gen(inode) != gen) { gflog_debug(GFARM_MSG_1001973, "inode_get_gen() failed"); e = GFARM_ERR_NO_SUCH_OBJECT; } else if (!inode_is_file(inode)) { gflog_debug(GFARM_MSG_1001973, "%s: not a file", diag); e = GFARM_ERR_OPERATION_NOT_SUPPORTED; } else { e = inode_remove_replica_metadata(inode, spool_host, gen); } giant_unlock(); return (gfm_server_put_reply(peer, diag, e, "")); } gfarm_error_t gfm_server_replica_add(struct peer *peer, int from_client, int skip) { gfarm_error_t e; gfarm_ino_t inum; gfarm_uint64_t gen; gfarm_off_t size; struct host *spool_host; struct inode *inode; static const char diag[] = "GFM_PROTO_REPLICA_ADD"; e = gfm_server_get_request(peer, diag, "lll", &inum, &gen, &size); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001974, "replica_add request failed: %s", gfarm_error_string(e)); return (e); } if (skip) return (GFARM_ERR_NO_ERROR); giant_lock(); if (from_client) { /* from gfsd only */ gflog_debug(GFARM_MSG_1001975, "not permitted : from_client"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if ((spool_host = peer_get_host(peer)) == NULL) { gflog_debug(GFARM_MSG_1001976, "operation is not permitted: peer_get_host() failed"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if ((inode = inode_lookup(inum)) == NULL) { gflog_debug(GFARM_MSG_1001977, "inode_lookup() failed"); e = GFARM_ERR_NO_SUCH_OBJECT; } else if (inode_get_gen(inode) != gen) { gflog_debug(GFARM_MSG_1001978, "inode_get_gen() failed"); e = GFARM_ERR_NO_SUCH_OBJECT; } else if (inode_get_size(inode) != size) { gflog_debug(GFARM_MSG_1001979, "invalid file replica"); e = GFARM_ERR_INVALID_FILE_REPLICA; } else { e = inode_add_replica(inode, spool_host, 1); } giant_unlock(); return (gfm_server_put_reply(peer, diag, e, "")); } gfarm-2.4.1/server/gfmd/xattr.h0000644000000000000000000000065211507222724015053 0ustar rootroot/* * Copyright (c) 2009 National Institute of Informatics in Japan. * All rights reserved. */ gfarm_error_t gfm_server_setxattr(struct peer *, int, int, int); gfarm_error_t gfm_server_getxattr(struct peer *, int, int, int); gfarm_error_t gfm_server_listxattr(struct peer *, int, int, int); gfarm_error_t gfm_server_removexattr(struct peer *, int, int, int); gfarm_error_t gfm_server_findxmlattr(struct peer *, int, int); gfarm-2.4.1/server/gfmd/user.h0000644000000000000000000000245011507222724014665 0ustar rootrootvoid user_init(void); struct user; struct user *user_lookup(const char *); struct user *user_lookup_gsi_dn(const char *); char *user_name(struct user *); char *user_gsi_dn(struct user *); int user_is_invalidated(struct user *); int user_is_active(struct user *); void user_all(void *, void (*)(void *, struct user *), int); struct quota; struct quota *user_quota(struct user *); extern char ADMIN_USER_NAME[]; struct group; int user_in_group(struct user *, struct group *); int user_is_admin(struct user *); int user_is_root(struct user *); struct peer; gfarm_error_t gfm_server_user_info_get_all(struct peer *, int, int); gfarm_error_t gfm_server_user_info_get_by_names(struct peer *, int, int); gfarm_error_t gfm_server_user_info_get_by_gsi_dn(struct peer *, int, int); gfarm_error_t gfm_server_user_info_set(struct peer *, int, int); gfarm_error_t gfm_server_user_info_modify(struct peer *, int, int); gfarm_error_t gfm_server_user_info_remove(struct peer *, int, int); struct group_assignment; /* subroutine of grpassign_add(), shouldn't be called from elsewhere */ void grpassign_add_group(struct group_assignment *); /* exported for a use from a private extension */ gfarm_error_t user_info_remove_default(const char *, const char *); extern gfarm_error_t (*user_info_remove)(const char *, const char *); gfarm-2.4.1/server/gfmd/job.h0000644000000000000000000000120711507222724014460 0ustar rootrootstruct job_table_entry; void job_table_init(int); int job_table_remove(int, char *, struct job_table_entry **); int job_get_id(struct job_table_entry *); gfarm_error_t gfj_server_lock_register(struct peer *, int, int); gfarm_error_t gfj_server_unlock_register(struct peer *, int, int); gfarm_error_t gfj_server_register(struct peer *, int, int); gfarm_error_t gfj_server_unregister(struct peer *, int, int); gfarm_error_t gfj_server_register_node(struct peer *, int, int); gfarm_error_t gfj_server_list(struct peer *, int, int); gfarm_error_t gfj_server_info(struct peer *, int, int); gfarm_error_t gfj_server_hostinfo(struct peer *, int, int); gfarm-2.4.1/server/gfmd/db_common.h0000644000000000000000000000204611507222724015645 0ustar rootrootstruct db_inode_cksum_trampoline_closure { void *closure; void (*callback)(void *, gfarm_ino_t, char *, size_t, char *); }; struct db_filecopy_trampoline_closure { void *closure; void (*callback)(void *, gfarm_ino_t, char *); }; struct db_deadfilecopy_trampoline_closure { void *closure; void (*callback)(void *, gfarm_ino_t, gfarm_uint64_t, char *); }; struct db_direntry_trampoline_closure { void *closure; void (*callback)(void *, gfarm_ino_t, char *, int, gfarm_ino_t); }; struct db_symlink_trampoline_closure { void *closure; void (*callback)(void *, gfarm_ino_t, char *); }; extern const struct gfarm_base_generic_info_ops db_base_inode_cksum_arg_ops, db_base_filecopy_arg_ops, db_base_deadfilecopy_arg_ops, db_base_direntry_arg_ops, db_base_symlink_arg_ops; void db_inode_cksum_callback_trampoline(void *, void *); void db_filecopy_callback_trampoline(void *, void *); void db_deadfilecopy_callback_trampoline(void *, void *); void db_direntry_callback_trampoline(void *, void *); void db_symlink_callback_trampoline(void *, void *); gfarm-2.4.1/server/gfmd/README0000644000000000000000000000066011507222724014417 0ustar rootrootlocking hierarchy: lower hierarchy should be locked earlier, unlocked later. higher hierarchy should be locked later, unlocked earlier. same hierarchy shouldn't be locked at once. level mutex 1 giant_mutex 2 peer_table_mutex 2 dbq.mutex i.e. locking order must be: giant -> (dbq OR peer_table) unlocking order must be: (dbq OR peer_table) -> giant dbq.mutex and peer_table_mutex shouldn't be locked at once. gfarm-2.4.1/server/gfmd/dead_file_copy.c0000644000000000000000000006504711507222724016643 0ustar rootroot#include #include #include #include #include #include "thrsubr.h" #include "config.h" #include "gfm_proto.h" #include "subr.h" #include "callout.h" #include "db_access.h" #include "host.h" #include "inode.h" #include "gfmd.h" /* sync_protocol_thread_pool */ struct dead_file_copy { struct dead_file_copy *allq_next, *allq_prev; struct dead_file_copy *workq_next, *workq_prev; gfarm_ino_t inum; gfarm_uint64_t igen; struct host *host; enum dead_file_copy_state { dfcstate_deferred, /* not on any dfc_workq */ dfcstate_kept, /* do not move to removal_pendingq */ dfcstate_pending, /* on removal_pendingq */ dfcstate_in_flight, /* during protocol process */ dfcstate_finished, /* on removal_finishedq */ dfcstate_finalizing, /* during finalize */ dfcstate_busy /* on host_busyq */ } state; gfarm_int32_t result; /* available if state == dfsstate_finsihed */ pthread_mutex_t mutex; /* currently only used to protect dfc->state */ }; /* * state transitions: * * (created) * -> dfcstate_deferred * * dfcstate_deferred * -> dfcstate_kept * -> dfcstate_pending * -> (freed) ... needs giant_lock() * * dfcstate_kept * -> dfcstate_deferred * -> dfcstate_pending * * dfcstate_pending * -> dfcstate_deferred * -> dfcstate_in_flight * * dfcstate_in_flight * -> dfcstate_deferred * -> dfcstate_busy * -> dfcstate_finished * * dfcstate_finished * -> dfcstate_finalizing * * dfcstate_finalizing * -> dfcstate_busy * -> (freed) ... needs giant_lock() * * dfcstate_busy * -> dfcstate_deferred * -> dfcstate_pending * */ struct dfc_allq { pthread_mutex_t mutex; struct dead_file_copy q; /* dummy head of doubly linked circular list */ }; /* IMPORTANT NOTE: functions should not sleep while holding dfc_allq.mutex */ static struct dfc_allq dfc_allq = { PTHREAD_MUTEX_INITIALIZER, { &dfc_allq.q, &dfc_allq.q, NULL, NULL } }; struct dfc_workq { pthread_mutex_t mutex; pthread_cond_t not_empty; struct dead_file_copy q; /* dummy head of doubly linked circular list */ }; /* * IMPORTANT NOTE: * functions should not sleep while holding removal_pendingq.mutex */ static struct dfc_workq removal_pendingq = { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, { NULL, NULL, &removal_pendingq.q, &removal_pendingq.q } }; /* * IMPORTANT NOTE: * functions should not sleep while holding removal_pendingq.mutex */ static struct dfc_workq removal_finishedq = { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, { NULL, NULL, &removal_finishedq.q, &removal_finishedq.q } }; /* * IMPORTANT NOTE: * functions should not sleep while holding host_busyq.mutex */ static struct dfc_workq host_busyq = { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, { NULL, NULL, &host_busyq.q, &host_busyq.q } }; static void dfc_workq_enqueue(struct dfc_workq *q, struct dead_file_copy *dfc, enum dead_file_copy_state new_state, const char *diag) { gfarm_mutex_lock(&q->mutex, diag, "lock"); dfc->workq_next = &q->q; dfc->workq_prev = q->q.workq_prev; q->q.workq_prev->workq_next = dfc; q->q.workq_prev = dfc; gfarm_mutex_lock(&dfc->mutex, diag, "dfc state"); dfc->state = new_state; gfarm_mutex_unlock(&dfc->mutex, diag, "dfc state"); gfarm_cond_signal(&q->not_empty, diag, "not empty"); gfarm_mutex_unlock(&q->mutex, diag, "unlock"); } static struct dead_file_copy * dfc_workq_dequeue(struct dfc_workq *q, enum dead_file_copy_state new_state, const char *diag) { struct dead_file_copy *dfc; gfarm_mutex_lock(&q->mutex, diag, "lock"); while (q->q.workq_next == &q->q) { gfarm_cond_wait(&q->not_empty, &q->mutex, diag, "not empty"); } dfc = q->q.workq_next; /* i.e. dfc_workq_remove(q->q.workq_next) */ q->q.workq_next = dfc->workq_next; dfc->workq_next->workq_prev = &q->q; dfc->workq_next = dfc->workq_prev = NULL; /* to be sure */ gfarm_mutex_lock(&dfc->mutex, diag, "dfc state"); dfc->state = new_state; gfarm_mutex_unlock(&dfc->mutex, diag, "dfc state"); gfarm_mutex_unlock(&q->mutex, diag, "unlock"); return (dfc); } static void dfc_workq_remove(struct dead_file_copy *dfc) { dfc->workq_next->workq_prev = dfc->workq_prev; dfc->workq_prev->workq_next = dfc->workq_next; } /* * PREREQUISITE: nothing * LOCKS: dfc_workq::mutex * SLEEPS: no */ static void dfc_workq_host_remove(struct dfc_workq *q, struct host *host, const char *diag) { struct dead_file_copy *dfc, *next; gfarm_mutex_lock(&q->mutex, diag, "lock"); for (dfc = q->q.workq_next; dfc != &q->q; dfc = next) { next = dfc->workq_next; if (dfc->host != host) continue; dfc_workq_remove(dfc); gfarm_mutex_lock(&dfc->mutex, diag, "dfc state"); dfc->state = dfcstate_deferred; gfarm_mutex_unlock(&dfc->mutex, diag, "dfc state"); dfc->workq_next = dfc->workq_prev = NULL; /* to be sure */ } gfarm_mutex_unlock(&q->mutex, diag, "unlock"); } void removal_pendingq_enqueue(struct dead_file_copy *dfc) { enum dead_file_copy_state state; static const char diag[] = "removal_pendingq_enqueue"; /* sanity check */ gfarm_mutex_lock(&dfc->mutex, diag, "dfc state"); state = dfc->state; gfarm_mutex_unlock(&dfc->mutex, diag, "dfc state"); if (state != dfcstate_deferred && state != dfcstate_kept && state != dfcstate_busy) { gflog_fatal(GFARM_MSG_1002221, "%s(%lld, %lld, %s): " "insane state %d", diag, (unsigned long long)dfc->inum, (unsigned long long)dfc->igen, host_name(dfc->host), state); return; } dfc_workq_enqueue(&removal_pendingq, dfc, dfcstate_pending, diag); } struct dead_file_copy * removal_pendingq_dequeue(void) { static const char diag[] = "removal_pendingq_dequeue"; return (dfc_workq_dequeue(&removal_pendingq, dfcstate_in_flight, diag)); } void removal_finishedq_enqueue(struct dead_file_copy *dfc, gfarm_int32_t result) { static const char diag[] = "removal_finishedq_enqueue"; /* sanity check */ gfarm_mutex_lock(&dfc->mutex, diag, "dfc state"); if (dfc->state != dfcstate_in_flight) { gfarm_mutex_unlock(&dfc->mutex, diag, "dfc state"); gflog_fatal(GFARM_MSG_1002222, "%s(%lld, %lld, %s): " "insane state %d", diag, (unsigned long long)dfc->inum, (unsigned long long)dfc->igen, host_name(dfc->host), dfc->state); return; } gfarm_mutex_unlock(&dfc->mutex, diag, "dfc state"); dfc->result = result; dfc_workq_enqueue(&removal_finishedq, dfc, dfcstate_finished, diag); } static struct dead_file_copy * removal_finishedq_dequeue(void) { static const char diag[] = "removal_finishedq_dequeue"; return (dfc_workq_dequeue(&removal_finishedq, dfcstate_finalizing, diag)); } static void dead_file_copy_free(struct dead_file_copy *); void host_busyq_enqueue(struct dead_file_copy *); /* * PREREQUISITE: nothing * LOCKS: giant_lock * -> (dbq.mutex, dfc_allq.mutex, host_busyq.mutex, host::back_channel_mutex) * SLEEPS: yes (giant_lock, dbq.mutex) * but dfc_allq.mutex, host_busyq.mutex and host::back_channel_mutex * won't be blocked while sleeping. */ static void handle_removal_result(struct dead_file_copy *dfc) { static const char diag[] = "handle_removal_result"; /* giant_lock is necessary before calling dead_file_copy_free() */ giant_lock(); if (dfc->result == GFARM_ERR_NO_ERROR || dfc->result == GFARM_ERR_NO_SUCH_FILE_OR_DIRECTORY) { dead_file_copy_free(dfc); /* sleeps to wait for dbq.mutex */ } else if (host_is_up(dfc->host)) { /* unexpected error, try again later to avoid busy loop */ gflog_error(GFARM_MSG_1002223, "waiting removal of (%lld, %lld, %s): %s", (long long)dfc->inum, (long long)dfc->igen, host_name(dfc->host), gfarm_error_string(dfc->result)); host_busyq_enqueue(dfc); } else if (!host_is_active(dfc->host)) { dead_file_copy_free(dfc); /* sleeps to wait for dbq.mutex */ } else { gfarm_mutex_lock(&dfc->mutex, diag, "dfc state"); dfc->state = dfcstate_deferred; gfarm_mutex_unlock(&dfc->mutex, diag, "dfc state"); } giant_unlock(); } static void * removal_finalizer(void *arg) { for (;;) { handle_removal_result(removal_finishedq_dequeue()); } /*NOTREACHED*/ return (NULL); } /* * FUNCTION: * check the policy whether it's ok to remove this obsolete replica or not. * * PREREQUISITE: giant_lock (at least for inode access) * LOCKS: maybe dfc_allq.mutex * SLEEPS: maybe, but no for now * but dfc_allq.mutex won't be blocked while sleeping. * * the caller should check dfc->host is `valid' and `up' and `not busy' * before calling this function. * the caller should allow this function to sleep. * * this interface is exported for a use from a private extension */ int dead_file_copy_is_removable_default(struct dead_file_copy *dfc) { int desired = inode_desired_dead_file_copy(dfc->inum); if (desired == 0) return (1); /* * XXX FIXME: check number of obsolete replicas, * and allow removal of older ones. * that will lock dfc_allq.mutex, but shouldn't sleep while locking * dfc_allq.mutex. */ return (0); } /* this interface is made as a hook for a private extension */ int (*dead_file_copy_is_removable)(struct dead_file_copy *) = dead_file_copy_is_removable_default; void host_busyq_enqueue(struct dead_file_copy *dfc) { static const char diag[] = "host_busyq_enqueue"; /* sanity check */ gfarm_mutex_lock(&dfc->mutex, diag, "dfc state"); if (dfc->state != dfcstate_in_flight && dfc->state != dfcstate_finalizing) { gfarm_mutex_unlock(&dfc->mutex, diag, "dfc state"); gflog_fatal(GFARM_MSG_1002224, "%s(%lld, %lld, %s): " "insane state %d", diag, (unsigned long long)dfc->inum, (unsigned long long)dfc->igen, host_name(dfc->host), dfc->state); return; } gfarm_mutex_unlock(&dfc->mutex, diag, "dfc state"); dfc_workq_enqueue(&host_busyq, dfc, dfcstate_busy, diag); } /* * PREREQUISITE: nothing * LOCKS: giant_lock -> host_busyq.mutex -> removal_pendingq.mutex * SLEEPS: depends on whether dead_file_copy_is_removable() sleeps or not, * but host_busyq.mutex and removal_pendingq.mutex * won't be blocked while sleeping. * * dead_file_copy_is_removable() needs giant_lock, and may sleep. * * this function is called via callout. */ static void dead_file_copy_host_busyq_scan(void) { struct dead_file_copy *dfc, *next; time_t now; int busy, up; static const char diag[] = "dead_file_copy_host_busyq_scan"; giant_lock(); gfarm_mutex_lock(&host_busyq.mutex, diag, "host_busyq lock"); now = time(NULL); for (dfc = host_busyq.q.workq_next; dfc != &host_busyq.q; dfc = next) { next = dfc->workq_next; /* this may make the host down */ busy = host_check_busy(dfc->host, now); /* so, the following should be called after host_check_busy */ up = host_is_up(dfc->host); if (!up) { dfc_workq_remove(dfc); gfarm_mutex_lock(&dfc->mutex, diag, "dfc state"); dfc->state = dfcstate_deferred; gfarm_mutex_unlock(&dfc->mutex, diag, "dfc state"); /* to be sure */ dfc->workq_next = dfc->workq_prev = NULL; } else if (!busy) { dfc_workq_remove(dfc); if (dead_file_copy_is_removable(dfc)) { removal_pendingq_enqueue(dfc); } else { /* leave it as dfcstate_deferred */ gfarm_mutex_lock(&dfc->mutex, diag, "dfc state"); dfc->state = dfcstate_deferred; gfarm_mutex_unlock(&dfc->mutex, diag, "dfc state"); /* to be sure */ dfc->workq_next = dfc->workq_prev = NULL; } } /* otherwise it's still busy, so, leave it as is. */ } gfarm_mutex_unlock(&host_busyq.mutex, diag, "host_busyq unlock"); giant_unlock(); } static void host_busyq_scanner_schedule(void); /* this function is called via callout */ static void * host_busyq_scanner(void *arg) { /* * XXX FIXME * we should periodically check possibility of automatic replicaton too. */ dead_file_copy_host_busyq_scan(); host_busyq_scanner_schedule(); /* this return value won't be used, because this thread is detached */ return (NULL); } static struct callout *host_busyq_scanner_callout; static void host_busyq_scanner_schedule(void) { /* * Q: why we use gfarm_metadb_heartbeat_interval here? * A: see the comment in callout_schedule_common(). * * Q: why we use sync_protocol_thread_pool here? * A: because this thread needs giant_lock, and * delay of the invocation is nearly harmless * at least from deadlock point of view. */ callout_reset(host_busyq_scanner_callout, gfarm_metadb_heartbeat_interval * 1000000, sync_protocol_thread_pool, host_busyq_scanner, NULL); } static void host_busyq_scanner_init(void) { host_busyq_scanner_callout = callout_new(); host_busyq_scanner_schedule(); } /* * PREREQUISITE: giant_lock * LOCKS: dfc_allq.mutex, removal_pendingq.mutex * SLEEPS: maybe, * but dfc_allq.mutex and removal_pendingq.mutex * won't be blocked while sleeping. * * dead_file_copy_is_removable() needs giant_lock, and may sleep. */ static void dead_file_copy_scan_deferred(gfarm_ino_t inum, struct host *host, int (*filter)(struct dead_file_copy *, gfarm_ino_t, struct host *), const char *diag) { struct dead_file_copy *dfc; time_t now = time(NULL); int busy; enum dead_file_copy_state state; gfarm_mutex_lock(&dfc_allq.mutex, diag, "lock"); /* giant_lock prevents dfc from being freed */ for (dfc = dfc_allq.q.allq_next; dfc != &dfc_allq.q; dfc = dfc->allq_next) { gfarm_mutex_lock(&dfc->mutex, diag, "dfc state"); state = dfc->state; gfarm_mutex_unlock(&dfc->mutex, diag, "dfc state"); if (state != dfcstate_deferred || !(*filter)(dfc, inum, host)) continue; /* * to prevent functions which acquire dfc_all.mutex * from sleeping */ gfarm_mutex_unlock(&dfc_allq.mutex, diag, "unlock before sleeping"); busy = host_check_busy(dfc->host, now); if (!busy && dead_file_copy_is_removable(dfc)) removal_pendingq_enqueue(dfc); gfarm_mutex_lock(&dfc_allq.mutex, diag, "lock after sleeping"); } gfarm_mutex_unlock(&dfc_allq.mutex, diag, "unlock"); } /* * PREREQUISITE: nothing * LOCKS: removal_pendingq.mutex, host_busyq.mutex * SLEEPS: no */ void dead_file_copy_host_becomes_down(struct host *host) { dfc_workq_host_remove(&removal_pendingq, host, "host down: removal_pendingq"); dfc_workq_host_remove(&host_busyq, host, "host down: host_busyq"); } static int transparent_filter(struct dead_file_copy *dfc, gfarm_ino_t inum, struct host *host) { return (1); } /* * PREREQUISITE: giant_lock * LOCKS: dfc_allq.mutex, removal_pendingq.mutex * SLEEPS: maybe, * but dfc_allq.mutex and removal_pendingq.mutex * won't be blocked while sleeping. */ void dead_file_copy_host_becomes_up(struct host *host) { static const char diag[] = "dead_file_copy_host_becomes_up"; /* * in this case, we have to check dead_file_copy data for *all* hosts, * not only the host which becomes up. * * for the host which becomes up: * we should start to send pending dead_file_copy entries. * for hosts except the host which becomes up: * the host which becomes up may have some replicas which * only exists on the host. in that case, other hosts may * have pending dead_file_copy entries which processing is * deferred because only owner of the newest replica is down. */ dead_file_copy_scan_deferred(0, NULL, transparent_filter, diag); /* leave the host_busyq as is, because it will be handled shortly. */ } /* * PREREQUISITE: giant_lock * LOCKS: dfc_allq.mutex, removal_pendingq.mutex, removal_finishedq.mutex, * host_busyq.mutex, dbq.mutex * SLEEPS: yes (dbq.mutex), * but dfc_allq.mutex, removal_pendingq.mutex, removal_pendingq.mutex * and host_busyq.mutex won't be blocked while sleeping. */ void dead_file_copy_host_removed(struct host *host) { struct dead_file_copy *dfc, *next; enum dead_file_copy_state state; static const char diag[] = "dead_file_copy_host_removed"; dead_file_copy_host_becomes_down(host); dfc_workq_host_remove(&removal_finishedq, host, "host removed: removal_finishedq"); gfarm_mutex_lock(&dfc_allq.mutex, diag, "lock"); /* giant_lock prevents dfc from being freed */ for (dfc = dfc_allq.q.allq_next; dfc != &dfc_allq.q; dfc = next) { next = dfc->allq_next; if (dfc->host != host) continue; gfarm_mutex_lock(&dfc->mutex, diag, "dfc state"); state = dfc->state; gfarm_mutex_unlock(&dfc->mutex, diag, "dfc state"); if (state != dfcstate_deferred) { gflog_debug(GFARM_MSG_1002225, "%s: defer removal of (%lld, %lld, %s): %d", diag, (unsigned long long)dfc->inum, (unsigned long long)dfc->igen, host_name(dfc->host), state); continue; } /* * to prevent functions which acquire dfc_all.mutex * from sleeping */ gfarm_mutex_unlock(&dfc_allq.mutex, diag, "unlock before sleeping"); dead_file_copy_free(dfc); gfarm_mutex_lock(&dfc_allq.mutex, diag, "lock after sleeping"); } gfarm_mutex_unlock(&dfc_allq.mutex, diag, "unlock"); /* leave the host_busyq as is, because it will be handled shortly. */ } static int inode_and_host_filter(struct dead_file_copy *dfc, gfarm_ino_t inum, struct host *host) { return (dfc->inum == inum && dfc->host == host); } /* * PREREQUISITE: giant_lock * LOCKS: dfc_allq.mutex, removal_pendingq.mutex * SLEEPS: maybe, * but dfc_allq.mutex and removal_pendingq.mutex * won't be blocked while sleeping. * * XXX * this assumes that the number of dead file copies is small enough, * otherwise this is too slow. */ void dead_file_copy_replica_status_changed(gfarm_ino_t inum, struct host *host) { static const char diag[] = "dead_file_copy_replica_status_changed"; dead_file_copy_scan_deferred(inum, host, inode_and_host_filter, diag); } static int inode_filter(struct dead_file_copy *dfc, gfarm_ino_t inum, struct host *host) { return (dfc->inum == inum); } /* * PREREQUISITE: giant_lock * LOCKS: dfc_allq.mutex, removal_pendingq.mutex * SLEEPS: maybe, * but dfc_allq.mutex and removal_pendingq.mutex * won't be blocked while sleeping. * * XXX * this assumes that the number of dead file copies is small enough, * otherwise this is too slow. */ void dead_file_copy_inode_status_changed(gfarm_ino_t inum) { static const char diag[] = "dead_file_copy_inode_status_changed"; dead_file_copy_scan_deferred(inum, NULL, inode_filter, diag); } /* used for deferred -> kept: prevent dfc from moved to removal_pendingq */ void dead_file_copy_mark_kept(struct dead_file_copy *dfc) { static const char diag[] = "dead_file_copy_mark_kept"; /* sanity check */ gfarm_mutex_lock(&dfc->mutex, diag, "dfc state"); if (dfc->state != dfcstate_deferred) { gfarm_mutex_unlock(&dfc->mutex, diag, "dfc state"); gflog_fatal(GFARM_MSG_1002226, "%s(%lld, %lld, %s): " "insane state %d", diag, (unsigned long long)dfc->inum, (unsigned long long)dfc->igen, host_name(dfc->host), dfc->state); return; } dfc->state = dfcstate_kept; gfarm_mutex_unlock(&dfc->mutex, diag, "dfc state"); } /* used for kept -> deferred: make dfc movable to removal_pendingq */ void dead_file_copy_mark_deferred(struct dead_file_copy *dfc) { static const char diag[] = "dead_file_copy_mark_deferred"; /* sanity check */ gfarm_mutex_lock(&dfc->mutex, diag, "dfc state"); if (dfc->state != dfcstate_kept) { gfarm_mutex_unlock(&dfc->mutex, diag, "dfc state"); gflog_fatal(GFARM_MSG_1002227, "%s(%lld, %lld, %s): " "insane state %d", diag, (unsigned long long)dfc->inum, (unsigned long long)dfc->igen, host_name(dfc->host), dfc->state); return; } dfc->state = dfcstate_deferred; gfarm_mutex_unlock(&dfc->mutex, diag, "dfc state"); } /* * PREREQUISITE: nothing * LOCKS: dfc_allq.mutex, host::back_channel_mutex * SLEEPS: no * * XXX * this assumes that the number of dead file copies is small enough, * otherwise this is too slow. */ int dead_file_copy_count_by_inode(gfarm_ino_t inum, gfarm_uint64_t igen, int up_only) { int n = 0; struct dead_file_copy *dfc; static const char diag[] = "dead_file_copy_count_by_inode"; gfarm_mutex_lock(&dfc_allq.mutex, diag, "lock"); for (dfc = dfc_allq.q.allq_next; dfc != &dfc_allq.q; dfc = dfc->allq_next) { /* dfc->inum == igen case is handled by an invalid file_copy */ if (dfc->inum == inum && dfc->inum != igen && (up_only ? host_is_up(dfc->host) : host_is_active(dfc->host))) n++; } gfarm_mutex_unlock(&dfc_allq.mutex, diag, "unlock"); return (n); } /* * PREREQUISITE: nothing * LOCKS: dfc_allq.mutex, host::back_channel_mutex * SLEEPS: no * * XXX * this assumes that the number of dead file copies is small enough, * otherwise this is too slow. */ gfarm_error_t dead_file_copy_info_by_inode(gfarm_ino_t inum, gfarm_uint64_t igen, int up_only, int *np, char **hosts, gfarm_int64_t *gens, gfarm_int32_t *flags) { int i = 0, n = *np; struct dead_file_copy *dfc; gfarm_int32_t flag; char *name; gfarm_error_t e = GFARM_ERR_NO_ERROR; static const char diag[] = "dead_file_copy_info_by_inode"; gfarm_mutex_lock(&dfc_allq.mutex, diag, "lock"); for (dfc = dfc_allq.q.allq_next; dfc != &dfc_allq.q; dfc = dfc->allq_next) { if (i >= n) break; if (dfc->inum != inum) continue; if (dfc->igen == igen) /* handled by an invalid file_copy */ continue; if (up_only) { if (!host_is_up(dfc->host)) continue; flag = GFM_PROTO_REPLICA_FLAG_DEAD_COPY; } else { if (!host_is_active(dfc->host)) continue; if (host_is_up(dfc->host)) flag = GFM_PROTO_REPLICA_FLAG_DEAD_COPY; else flag = GFM_PROTO_REPLICA_FLAG_DEAD_COPY | GFM_PROTO_REPLICA_FLAG_DEAD_HOST; } name = strdup_log(host_name(dfc->host), diag); if (name == NULL) { e = GFARM_ERR_NO_MEMORY; break; } hosts[i] = name; gens[i] = dfc->igen; flags[i] = flag; i++; } gfarm_mutex_unlock(&dfc_allq.mutex, diag, "unlock"); if (e != GFARM_ERR_NO_ERROR) { while (--i >= 0) free(hosts[i]); } else { *np = i; } return (e); } gfarm_ino_t dead_file_copy_get_ino(struct dead_file_copy *dfc) { return (dfc->inum); } gfarm_uint64_t dead_file_copy_get_gen(struct dead_file_copy *dfc) { return (dfc->igen); } struct host * dead_file_copy_get_host(struct dead_file_copy *dfc) { return (dfc->host); } /* * PREREQUISITE: nothing * LOCKS: dfc_allq.mutex * SLEEPS: no */ static struct dead_file_copy * dead_file_copy_alloc(gfarm_ino_t inum, gfarm_uint64_t igen, struct host *host) { struct dead_file_copy *dfc; static const char diag[] = "dead_file_copy_alloc"; GFARM_MALLOC(dfc); if (dfc == NULL) { gflog_debug(GFARM_MSG_1002228, "%s(%lld, %lld, %s): no memory", diag, (unsigned long long)inum, (unsigned long long)igen, host_name(host)); return (NULL); } dfc->inum = inum; dfc->igen = igen; dfc->host = host; dfc->state = dfcstate_deferred; gfarm_mutex_init(&dfc->mutex, diag, "dfc state"); /* to be sure */ dfc->workq_next = dfc->workq_prev = NULL; gfarm_mutex_lock(&dfc_allq.mutex, diag, "lock"); dfc->allq_next = &dfc_allq.q; dfc->allq_prev = dfc_allq.q.allq_prev; dfc_allq.q.allq_prev->allq_next = dfc; dfc_allq.q.allq_prev = dfc; gfarm_mutex_unlock(&dfc_allq.mutex, diag, "unlock"); return (dfc); } /* * PREREQUISITE: nothing (XXX host_name()?) * LOCKS: dfc_allq.mutex, dbq.mutex * SLEEPS: yes (dbq.mutex) */ struct dead_file_copy * dead_file_copy_new(gfarm_ino_t inum, gfarm_uint64_t igen, struct host *host) { gfarm_error_t e; struct dead_file_copy *dfc; if ((dfc = dead_file_copy_alloc(inum, igen, host)) == NULL) return (NULL); e = db_deadfilecopy_add(inum, igen, host_name(host)); if (e != GFARM_ERR_NO_ERROR) gflog_error(GFARM_MSG_1002229, "db_deadfilecopy_add(%lld, %lld, %s): %s", (unsigned long long)inum, (unsigned long long)igen, host_name(host), gfarm_error_string(e)); #if 0 else if (debug_mode) gflog_debug(GFARM_MSG_1002230, "db_deadfilecopy_add(%lld, %lld, %s): added", (unsigned long long)inum, (unsigned long long)igen, host_name(host)); #endif return (dfc); } /* * PREREQUISITE: giant_lock * LOCKS: dfc_allq.mutex, dbq.mutex * SLEEPS: yes (dbq.mutex) * but dfc_allq.mutex won't be blocked while sleeping. * * giant_lock is necessary, because dead_file_copy_scan_deferred() or * dead_file_copy_host_removed() may be accessing this dfc. */ static void dead_file_copy_free(struct dead_file_copy *dfc) { gfarm_error_t e; enum dead_file_copy_state state; static const char diag[] = "dead_file_copy_free"; gfarm_mutex_lock(&dfc_allq.mutex, diag, "allq lock"); gfarm_mutex_lock(&dfc->mutex, diag, "dfc state"); state = dfc->state; gfarm_mutex_unlock(&dfc->mutex, diag, "dfc state"); if (state != dfcstate_deferred && state != dfcstate_finalizing) { gfarm_mutex_unlock(&dfc_allq.mutex, diag, "allq unlock at error"); gflog_error(GFARM_MSG_1002231, "dead_file_copy_free(%lld, %lld, %s): " "state %d is not allowed, this shouldn't happen, ignored", (unsigned long long)dfc->inum, (unsigned long long)dfc->igen, host_name(dfc->host), state); return; } dfc->allq_next->allq_prev = dfc->allq_prev; dfc->allq_prev->allq_next = dfc->allq_next; gfarm_mutex_unlock(&dfc_allq.mutex, diag, "allq unlock"); e = db_deadfilecopy_remove(dfc->inum, dfc->igen, host_name(dfc->host)); if (e != GFARM_ERR_NO_ERROR) gflog_error(GFARM_MSG_1002232, "db_deadfilecopy_remove(%lld, %lld, %s): %s", (unsigned long long)dfc->inum, (unsigned long long)dfc->igen, host_name(dfc->host), gfarm_error_string(e)); gfarm_mutex_destroy(&dfc->mutex, diag, "dfc state"); inode_remove_replica_completed(dfc->inum, dfc->igen, dfc->host); free(dfc); } /* The memory owner of `hostname' is changed to dead_file_copy.c */ void dead_file_copy_add_one(void *closure, gfarm_ino_t inum, gfarm_uint64_t igen, char *hostname) { struct host *host = host_lookup(hostname); struct dead_file_copy *dfc; static const char diag[] = "dead_file_copy_add_one"; /* XXX FIXME: do not remove, if latest one is inaccessible */ if (host == NULL) { gflog_error(GFARM_MSG_1002233, "%s: inode %lld:%lld: no host %s", diag, (long long)inum, (long long)igen, hostname); } else if ((dfc = dead_file_copy_alloc(inum, igen, host)) == NULL) { gflog_error(GFARM_MSG_1002234, "%s: dead replica(%lld, %lld, %s): no memory", diag, (long long)inum, (long long)igen, hostname); #if 0 /* this is unnecessary, since all hosts are down in this point */ } else if (dead_file_copy_is_removable(dfc)) { removal_pendingq_enqueue(dfc); #endif } /* otherwise leave it as dfcstate_deferred */ free(hostname); inode_dead_file_copy_added(inum, igen, host); } void dead_file_copy_init(void) { gfarm_error_t e; e = db_deadfilecopy_load(NULL, dead_file_copy_add_one); if (e != GFARM_ERR_NO_ERROR && e != GFARM_ERR_NO_SUCH_OBJECT) gflog_error(GFARM_MSG_1000362, "loading deadfilecopy: %s", gfarm_error_string(e)); host_busyq_scanner_init(); e = create_detached_thread(removal_finalizer, NULL); if (e != GFARM_ERR_NO_ERROR) gflog_fatal(GFARM_MSG_1002235, "create_detached_thread(removal_finalizer): %s", gfarm_error_string(e)); } gfarm-2.4.1/server/gfmd/dead_file_copy.h0000644000000000000000000000244311507222724016637 0ustar rootrootstruct dead_file_copy; struct host; struct dead_file_copy *dead_file_copy_new( gfarm_ino_t, gfarm_uint64_t, struct host *); gfarm_ino_t dead_file_copy_get_ino(struct dead_file_copy *); gfarm_uint64_t dead_file_copy_get_gen(struct dead_file_copy *); struct host *dead_file_copy_get_host(struct dead_file_copy *); int dead_file_copy_is_removable_default(struct dead_file_copy *); extern int (*dead_file_copy_is_removable)(struct dead_file_copy *); void removal_pendingq_enqueue(struct dead_file_copy *); struct dead_file_copy *removal_pendingq_dequeue(void); void removal_finishedq_enqueue(struct dead_file_copy *, gfarm_int32_t); void host_busyq_enqueue(struct dead_file_copy *); void dead_file_copy_host_becomes_down(struct host *); void dead_file_copy_host_becomes_up(struct host *); void dead_file_copy_host_removed(struct host *); void dead_file_copy_replica_status_changed(gfarm_ino_t, struct host *); void dead_file_copy_inode_status_changed(gfarm_ino_t); void dead_file_copy_mark_kept(struct dead_file_copy *); void dead_file_copy_mark_deferred(struct dead_file_copy *); int dead_file_copy_count_by_inode(gfarm_ino_t, gfarm_uint64_t, int); gfarm_error_t dead_file_copy_info_by_inode(gfarm_ino_t, gfarm_uint64_t, int, int *, char **, gfarm_int64_t *, gfarm_int32_t *); void dead_file_copy_init(void); gfarm-2.4.1/server/gfmd/db_access.h0000644000000000000000000001237711507222724015626 0ustar rootroot/* * Metadata storage operations * * $Id: db_access.h 4480 2010-03-05 08:44:08Z n-soda $ */ gfarm_error_t db_initialize(void); gfarm_error_t db_terminate(void); void *db_thread(void *); int db_getfreenum(void); gfarm_error_t db_begin(const char *); gfarm_error_t db_end(const char *); struct gfarm_host_info; gfarm_error_t db_host_add(const struct gfarm_host_info *); gfarm_error_t db_host_modify(const struct gfarm_host_info *, int, int, const char **, int, const char **); gfarm_error_t db_host_remove(const char *); gfarm_error_t db_host_load(void *, void (*)(void *, struct gfarm_host_info *)); #define DB_HOST_MOD_ARCHITECTURE 1 #define DB_HOST_MOD_NCPU 2 #define DB_HOST_MOD_FLAGS 4 struct gfarm_user_info; gfarm_error_t db_user_add(const struct gfarm_user_info *); gfarm_error_t db_user_modify(const struct gfarm_user_info *, int); gfarm_error_t db_user_remove(const char *); gfarm_error_t db_user_load(void *, void (*)(void *, struct gfarm_user_info *)); #define DB_USER_MOD_REALNAME 1 #define DB_USER_MOD_HOMEDIR 2 #define DB_USER_MOD_GSI_DN 4 struct gfarm_group_info; gfarm_error_t db_group_add(const struct gfarm_group_info *); gfarm_error_t db_group_modify(const struct gfarm_group_info *, int, int, const char **, int, const char **); gfarm_error_t db_group_remove(const char *); gfarm_error_t db_group_load(void *, void (*)(void *, struct gfarm_group_info *)); struct gfs_stat; gfarm_error_t db_inode_add(const struct gfs_stat *); gfarm_error_t db_inode_modify(const struct gfs_stat *); gfarm_error_t db_inode_gen_modify(gfarm_ino_t, gfarm_uint64_t); gfarm_error_t db_inode_nlink_modify(gfarm_ino_t, gfarm_uint64_t); gfarm_error_t db_inode_size_modify(gfarm_ino_t, gfarm_off_t); gfarm_error_t db_inode_mode_modify(gfarm_ino_t, gfarm_mode_t); gfarm_error_t db_inode_user_modify(gfarm_ino_t, const char *); gfarm_error_t db_inode_group_modify(gfarm_ino_t, const char *); gfarm_error_t db_inode_atime_modify(gfarm_ino_t, struct gfarm_timespec *); gfarm_error_t db_inode_mtime_modify(gfarm_ino_t, struct gfarm_timespec *); gfarm_error_t db_inode_ctime_modify(gfarm_ino_t, struct gfarm_timespec *); /* db_inode_remove: never remove any inode to keep inode->i_gen */ gfarm_error_t db_inode_load(void *, void (*)(void *, struct gfs_stat *)); gfarm_error_t db_inode_cksum_add(gfarm_ino_t, const char *, size_t, const char *); gfarm_error_t db_inode_cksum_modify(gfarm_ino_t, const char *, size_t, const char *); gfarm_error_t db_inode_cksum_remove(gfarm_ino_t); gfarm_error_t db_inode_cksum_load(void *, void (*)(void *, gfarm_ino_t, char *, size_t, char *)); gfarm_error_t db_filecopy_add(gfarm_ino_t, const char *); gfarm_error_t db_filecopy_remove(gfarm_ino_t, const char *); gfarm_error_t db_filecopy_load(void *, void (*)(void *, gfarm_ino_t, char *)); gfarm_error_t db_deadfilecopy_add(gfarm_ino_t, gfarm_uint64_t, const char *); gfarm_error_t db_deadfilecopy_remove(gfarm_ino_t, gfarm_uint64_t, const char *); gfarm_error_t db_deadfilecopy_load(void *, void (*)(void *, gfarm_ino_t, gfarm_uint64_t, char *)); gfarm_error_t db_direntry_add(gfarm_ino_t, const char *, int, gfarm_ino_t); gfarm_error_t db_direntry_remove(gfarm_ino_t, const char *, int); gfarm_error_t db_direntry_load(void *, void (*)(void *, gfarm_ino_t, char *, int, gfarm_ino_t)); gfarm_error_t db_symlink_add(gfarm_ino_t, const char *); gfarm_error_t db_symlink_remove(gfarm_ino_t); gfarm_error_t db_symlink_load(void *, void (*)(void *, gfarm_ino_t, char *)); struct db_waitctx; struct xattr_info; gfarm_error_t db_xattr_add(int, gfarm_ino_t, char *, void *, size_t, struct db_waitctx *); gfarm_error_t db_xattr_modify(int, gfarm_ino_t, char *, void *, size_t, struct db_waitctx *); gfarm_error_t db_xattr_remove(int, gfarm_ino_t, char *); gfarm_error_t db_xattr_removeall(int, gfarm_ino_t); gfarm_error_t db_xattr_get(int, gfarm_ino_t, char *, void **, size_t *, struct db_waitctx *); gfarm_error_t db_xattr_load(void *closure, void (*callback)(void *, struct xattr_info *)); gfarm_error_t db_xmlattr_find(gfarm_ino_t, const char *, gfarm_error_t (*foundcallback)(void *, int, void *), void *, void (*callback)(gfarm_error_t, void *), void *); struct quota; gfarm_error_t db_quota_user_set(struct quota *, const char *); gfarm_error_t db_quota_group_set(struct quota *, const char *); gfarm_error_t db_quota_user_remove(const char *); gfarm_error_t db_quota_group_remove(const char *); struct gfarm_quota_info; gfarm_error_t db_quota_user_load(void *, void (*)(void *, struct gfarm_quota_info *)); gfarm_error_t db_quota_group_load(void *, void (*)(void *, struct gfarm_quota_info *)); /* external interface to select metadb backend type */ struct db_ops; gfarm_error_t db_use(const struct db_ops *); extern const struct db_ops db_none_ops, db_ldap_ops, db_pgsql_ops; struct db_waitctx { pthread_mutex_t lock; pthread_cond_t cond; gfarm_error_t e; }; void db_waitctx_init(struct db_waitctx *); void db_waitctx_fini(struct db_waitctx *); gfarm_error_t dbq_waitret(struct db_waitctx *); /* exported for a use from a private extension */ /* The official gfmd source code shouldn't use these interface */ typedef gfarm_error_t (*dbq_entry_func_t)(void *); gfarm_error_t gfarm_dbq_enter(dbq_entry_func_t, void *); gfarm_error_t gfarm_dbq_enter_for_waitret( dbq_entry_func_t, void *, struct db_waitctx *); const struct db_ops *db_get_ops(void); gfarm-2.4.1/server/gfmd/db_ops.h0000644000000000000000000001336511507222724015164 0ustar rootroot/* * Copyright (c) 2003-2006 National Institute of Advanced * Industrial Science and Technology (AIST). All rights reserved. * * Copyright (c) 2006 National Institute of Informatics in Japan, * All rights reserved. * * This file or a portion of this file is licensed under the terms of * the NAREGI Public License, found at * http://www.naregi.org/download/index.html. * If you redistribute this file, with or without modifications, you * must include this notice in the file. */ /* * Metadata access switch for internal implementation * * $Id: db_ops.h 4480 2010-03-05 08:44:08Z n-soda $ */ struct db_host_modify_arg { struct gfarm_host_info hi; int modflags; int add_count; char **add_aliases; int del_count; char **del_aliases; }; struct db_user_modify_arg { struct gfarm_user_info ui; int modflags; }; struct db_group_modify_arg { struct gfarm_group_info gi; int modflags; int add_count; char **add_users; int del_count; char **del_users; }; struct db_inode_uint64_modify_arg { gfarm_ino_t inum; gfarm_uint64_t uint64; }; struct db_inode_uint32_modify_arg { gfarm_ino_t inum; gfarm_uint32_t uint32; }; struct db_inode_string_modify_arg { gfarm_ino_t inum; char *string; }; struct db_inode_timespec_modify_arg { gfarm_ino_t inum; struct gfarm_timespec time; }; struct db_inode_cksum_arg { gfarm_ino_t inum; char *type; size_t len; char *sum; }; struct db_inode_inum_arg { gfarm_ino_t inum; }; struct db_filecopy_arg { gfarm_ino_t inum; char *hostname; }; struct db_deadfilecopy_arg { gfarm_ino_t inum; gfarm_uint64_t igen; char *hostname; }; struct db_direntry_arg { gfarm_ino_t dir_inum, entry_inum; char *entry_name; int entry_len; }; struct db_symlink_arg { gfarm_ino_t inum; char *source_path; }; struct db_xattr_arg { int xmlMode; gfarm_ino_t inum; char *attrname; // to set void *value; size_t size; // to get void **valuep; size_t *sizep; }; struct db_xmlattr_find_arg { gfarm_ino_t inum; const char *expr; gfarm_error_t (*foundcallback)(void *,int, void *); void *foundcbdata; }; struct xattr_info; struct db_quota_arg { int is_group; char *name; struct quota quota; }; struct db_quota_remove_arg { int is_group; char *name; }; struct gfarm_quota_info; struct db_ops { gfarm_error_t (*initialize)(void); gfarm_error_t (*terminate)(void); gfarm_error_t (*begin)(void *); gfarm_error_t (*end)(void *); gfarm_error_t (*host_add)(struct gfarm_host_info *); gfarm_error_t (*host_modify)(struct db_host_modify_arg *); gfarm_error_t (*host_remove)(char *); gfarm_error_t (*host_load)(void *, void (*)(void *, struct gfarm_host_info *)); gfarm_error_t (*user_add)(struct gfarm_user_info *); gfarm_error_t (*user_modify)(struct db_user_modify_arg *); gfarm_error_t (*user_remove)(char *); gfarm_error_t (*user_load)(void *, void (*)(void *, struct gfarm_user_info *)); gfarm_error_t (*group_add)(struct gfarm_group_info *); gfarm_error_t (*group_modify)(struct db_group_modify_arg *); gfarm_error_t (*group_remove)(char *); gfarm_error_t (*group_load)(void *, void (*)(void *, struct gfarm_group_info *)); gfarm_error_t (*inode_add)(struct gfs_stat *); gfarm_error_t (*inode_modify)(struct gfs_stat *); gfarm_error_t (*inode_gen_modify)(struct db_inode_uint64_modify_arg *); gfarm_error_t (*inode_nlink_modify)(struct db_inode_uint64_modify_arg *); gfarm_error_t (*inode_size_modify)(struct db_inode_uint64_modify_arg *); gfarm_error_t (*inode_mode_modify)(struct db_inode_uint32_modify_arg *); gfarm_error_t (*inode_user_modify)(struct db_inode_string_modify_arg *); gfarm_error_t (*inode_group_modify)(struct db_inode_string_modify_arg *); gfarm_error_t (*inode_atime_modify)(struct db_inode_timespec_modify_arg *); gfarm_error_t (*inode_mtime_modify)(struct db_inode_timespec_modify_arg *); gfarm_error_t (*inode_ctime_modify)(struct db_inode_timespec_modify_arg *); /* inode_remove: never remove any inode to keep inode->i_gen */ gfarm_error_t (*inode_load)(void *, void (*)(void *, struct gfs_stat *)); gfarm_error_t (*inode_cksum_add)(struct db_inode_cksum_arg *); gfarm_error_t (*inode_cksum_modify)(struct db_inode_cksum_arg *); gfarm_error_t (*inode_cksum_remove)(struct db_inode_inum_arg *); gfarm_error_t (*inode_cksum_load)(void *, void (*)(void *, gfarm_ino_t, char *, size_t, char *)); gfarm_error_t (*filecopy_add)(struct db_filecopy_arg *); gfarm_error_t (*filecopy_remove)(struct db_filecopy_arg *); gfarm_error_t (*filecopy_load)(void *, void (*)(void *, gfarm_ino_t, char *)); gfarm_error_t (*deadfilecopy_add)(struct db_deadfilecopy_arg *); gfarm_error_t (*deadfilecopy_remove)(struct db_deadfilecopy_arg *); gfarm_error_t (*deadfilecopy_load)(void *, void (*)(void *, gfarm_ino_t, gfarm_uint64_t, char *)); gfarm_error_t (*direntry_add)(struct db_direntry_arg *); gfarm_error_t (*direntry_remove)(struct db_direntry_arg *); gfarm_error_t (*direntry_load)(void *, void (*)(void *, gfarm_ino_t, char *, int, gfarm_ino_t)); gfarm_error_t (*symlink_add)(struct db_symlink_arg *); gfarm_error_t (*symlink_remove)(struct db_inode_inum_arg *); gfarm_error_t (*symlink_load)(void *, void (*)(void *, gfarm_ino_t, char *)); gfarm_error_t (*xattr_add)(struct db_xattr_arg *); gfarm_error_t (*xattr_modify)(struct db_xattr_arg *); gfarm_error_t (*xattr_remove)(struct db_xattr_arg *); gfarm_error_t (*xattr_removeall)(struct db_xattr_arg *); gfarm_error_t (*xattr_get)(struct db_xattr_arg *); gfarm_error_t (*xattr_load)(void *, void (*)(void *, struct xattr_info *)); gfarm_error_t (*xmlattr_find)(struct db_xmlattr_find_arg *); gfarm_error_t (*quota_add)(struct db_quota_arg *); gfarm_error_t (*quota_modify)(struct db_quota_arg *); gfarm_error_t (*quota_remove)(struct db_quota_remove_arg *); gfarm_error_t (*quota_load)(void *, int, void (*)(void *, struct gfarm_quota_info *)); }; gfarm-2.4.1/server/gfmd/process.c0000644000000000000000000011636711507222724015375 0ustar rootroot#include /* db_access.h currently needs this */ #include #include #include #include #include #define GFARM_INTERNAL_USE #include #include #include #include #include "gfutil.h" #include "auth.h" #include "gfm_proto.h" #include "timespec.h" #include "subr.h" #include "db_access.h" #include "peer.h" #include "inode.h" #include "process.h" #include "id_table.h" #include "host.h" #define FILETAB_INITIAL 16 #define FILETAB_MULTIPLY 2 #define FILETAB_MAX 1024 #define PROCESS_ID_MIN 300 #define PROCESS_TABLE_INITIAL_SIZE 100 struct process_link { struct process_link *next, *prev; }; /* XXX hack */ #define SIBLINGS_PTR_TO_PROCESS(sp) \ ((struct process *)((char *)(sp) - offsetof(struct process, siblings))) struct process { struct process_link siblings; struct process_link children; /* dummy header of siblings list */ struct process *parent; char sharedkey[GFM_PROTO_PROCESS_KEY_LEN_SHAREDSECRET]; gfarm_pid_t pid; struct user *user; int refcount; int nfiles; struct file_opening **filetab; }; static struct gfarm_id_table *process_id_table = NULL; static struct gfarm_id_table_entry_ops process_id_table_ops = { sizeof(struct process) }; static struct file_opening * file_opening_alloc(struct inode *inode, struct peer *peer, struct host *spool_host, int flag) { struct file_opening *fo; GFARM_MALLOC(fo); if (fo == NULL) { gflog_debug(GFARM_MSG_1001593, "allocation of 'file_opening' failed"); return (NULL); } fo->inode = inode; fo->flag = flag; fo->opener = peer; if (inode_is_file(inode)) { if (spool_host == NULL) { fo->u.f.spool_opener = NULL; fo->u.f.spool_host = NULL; } else { fo->u.f.spool_opener = peer; fo->u.f.spool_host = spool_host; } fo->u.f.desired_replica_number = 0; fo->u.f.replicating = NULL; } else if (inode_is_dir(inode)) { fo->u.d.offset = 0; fo->u.d.key = NULL; } return (fo); } void file_opening_free(struct file_opening *fo, gfarm_mode_t mode) { if (GFARM_S_ISREG(mode)) { if (fo->u.f.replicating != NULL) { gflog_debug(GFARM_MSG_1002236, "orphan replicating"); file_replicating_free(fo->u.f.replicating); fo->u.f.replicating = NULL; } } else if (GFARM_S_ISDIR(mode)) { if (fo->u.d.key != NULL) free(fo->u.d.key); } free(fo); } gfarm_error_t process_alloc(struct user *user, gfarm_int32_t keytype, size_t keylen, char *sharedkey, struct process **processp, gfarm_pid_t *pidp) { struct process *process; struct file_opening **filetab; int fd; gfarm_int32_t pid32; if (process_id_table == NULL) { process_id_table = gfarm_id_table_alloc(&process_id_table_ops); if (process_id_table == NULL) gflog_fatal(GFARM_MSG_1000293, "allocating pid table: no memory"); gfarm_id_table_set_base(process_id_table, PROCESS_ID_MIN); gfarm_id_table_set_initial_size(process_id_table, PROCESS_TABLE_INITIAL_SIZE); } if (keytype != GFM_PROTO_PROCESS_KEY_TYPE_SHAREDSECRET || keylen != GFM_PROTO_PROCESS_KEY_LEN_SHAREDSECRET) { gflog_debug(GFARM_MSG_1001594, "'keytype' or 'keylen' is invalid"); return (GFARM_ERR_INVALID_ARGUMENT); } GFARM_MALLOC_ARRAY(filetab, FILETAB_INITIAL); if (filetab == NULL) { gflog_debug(GFARM_MSG_1001595, "allocation of 'filetab' failed"); return (GFARM_ERR_NO_MEMORY); } process = gfarm_id_alloc(process_id_table, &pid32); if (process == NULL) { free(filetab); gflog_debug(GFARM_MSG_1001596, "gfarm_id_alloc() failed"); return (GFARM_ERR_NO_MEMORY); } process->siblings.next = process->siblings.prev = &process->siblings; process->children.next = process->children.prev = &process->children; process->parent = NULL; memcpy(process->sharedkey, sharedkey, keylen); process->pid = pid32; process->user = user; process->refcount = 0; process->nfiles = FILETAB_INITIAL; process->filetab = filetab; for (fd = 0; fd < FILETAB_INITIAL; fd++) filetab[fd] = NULL; *processp = process; *pidp = pid32; return (GFARM_ERR_NO_ERROR); } static void process_add_child(struct process *parent, struct process *child) { child->siblings.next = &parent->children; child->siblings.prev = parent->children.prev; parent->children.prev->next = &child->siblings; parent->children.prev = &child->siblings; child->parent = parent; } static void process_add_ref(struct process *process) { ++process->refcount; } /* NOTE: caller of this function should acquire giant_lock as well */ static int process_del_ref(struct process *process) { int fd; gfarm_mode_t mode; struct file_opening *fo; struct process_link *pl, *pln; struct process *child; if (--process->refcount > 0) return (1); /* still referenced */ /* make all children orphan */ for (pl = process->children.next; pl != &process->children; pl = pln) { pln = pl->next; child = SIBLINGS_PTR_TO_PROCESS(pl); child->parent = NULL; pl->next = pl->prev = pl; } /* detach myself from children list */ process->siblings.next->prev = process->siblings.prev; process->siblings.prev->next = process->siblings.next; for (fd = 0; fd < process->nfiles; fd++) { fo = process->filetab[fd]; if (fo != NULL) { mode = inode_get_mode(fo->inode); inode_close_read(fo, NULL); file_opening_free(fo, mode); } } free(process->filetab); gfarm_id_free(process_id_table, (gfarm_int32_t)process->pid); return (0); /* process freed */ } /* NOTE: caller of this function should acquire giant_lock as well */ void process_attach_peer(struct process *process, struct peer *peer) { process_add_ref(process); /* We are currently not using peer here */ } /* NOTE: caller of this function should acquire giant_lock as well */ void process_detach_peer(struct process *process, struct peer *peer) { int fd; if (!process_del_ref(process)) /* process freed */ return; for (fd = 0; fd < process->nfiles; fd++) { /* * XXX This shouldn't be done, * if we'll support gfmd reconnection. */ if (process->filetab[fd] != NULL) process_close_file(process, peer, fd); } } struct user * process_get_user(struct process *process) { return (process->user); } gfarm_error_t process_verify_fd(struct process *process, int fd) { struct file_opening *fo; if (fd < 0 || fd >= process->nfiles) { gflog_debug(GFARM_MSG_1001597, "bad file descriptor"); return (GFARM_ERR_BAD_FILE_DESCRIPTOR); } fo = process->filetab[fd]; if (fo == NULL) { gflog_debug(GFARM_MSG_1001598, "'file_opening' is NULL"); return (GFARM_ERR_BAD_FILE_DESCRIPTOR); } return (GFARM_ERR_NO_ERROR); } gfarm_error_t process_get_file_opening(struct process *process, int fd, struct file_opening **fop) { struct file_opening *fo; if (fd < 0 || fd >= process->nfiles) { gflog_debug(GFARM_MSG_1001599, "bad file descriptor"); return (GFARM_ERR_BAD_FILE_DESCRIPTOR); } fo = process->filetab[fd]; if (fo == NULL) { gflog_debug(GFARM_MSG_1001600, "'file_opening' is NULL"); return (GFARM_ERR_BAD_FILE_DESCRIPTOR); } *fop = fo; return (GFARM_ERR_NO_ERROR); } gfarm_error_t process_record_desired_number(struct process *process, int fd, int desired_number) { struct file_opening *fo; gfarm_error_t e = process_get_file_opening(process, fd, &fo); if (e != GFARM_ERR_NO_ERROR) { gflog_warning(GFARM_MSG_1002475, "process_record_desired_number(%ld, %d, %d): %s", (long)process->pid, fd, desired_number, gfarm_error_string(e)); return (e); } if (!inode_is_file(fo->inode)) { gflog_warning(GFARM_MSG_1002476, "process_record_desired_number(%ld, %d, %d): not a file", (long)process->pid, fd, desired_number); return (GFARM_ERR_BAD_FILE_DESCRIPTOR); } fo->u.f.desired_replica_number = desired_number; return (GFARM_ERR_NO_ERROR); } gfarm_error_t process_get_file_inode(struct process *process, int fd, struct inode **inp) { struct file_opening *fo; gfarm_error_t e = process_get_file_opening(process, fd, &fo); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001601, "process_get_file_opening() failed: %s", gfarm_error_string(e)); return (e); } *inp = fo->inode; return (GFARM_ERR_NO_ERROR); } gfarm_error_t process_get_file_writable(struct process *process, struct peer *peer, int fd) { struct file_opening *fo; gfarm_error_t e = process_get_file_opening(process, fd, &fo); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001602, "process_get_file_opening() failed: %s", gfarm_error_string(e)); return (e); } if ((accmode_to_op(fo->flag) & GFS_W_OK) == 0) { gflog_debug(GFARM_MSG_1001603, "permission is denied"); return (GFARM_ERR_PERMISSION_DENIED); } if (fo->opener == peer) return (GFARM_ERR_NO_ERROR); if (inode_is_file(fo->inode) && fo->u.f.spool_opener == peer) return (GFARM_ERR_NO_ERROR); gflog_debug(GFARM_MSG_1001604, "operation is not permitted"); return (GFARM_ERR_OPERATION_NOT_PERMITTED); } gfarm_error_t process_get_dir_offset(struct process *process, struct peer *peer, int fd, gfarm_off_t *offsetp) { struct file_opening *fo; gfarm_error_t e = process_get_file_opening(process, fd, &fo); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001605, "process_get_file_opening() failed: %s", gfarm_error_string(e)); return (e); } if (!inode_is_dir(fo->inode)) { gflog_debug(GFARM_MSG_1001606, "inode is not a directory"); return (GFARM_ERR_NOT_A_DIRECTORY); } if (fo->opener != peer) { gflog_debug(GFARM_MSG_1001607, "operation is not permitted"); return (GFARM_ERR_OPERATION_NOT_PERMITTED); } *offsetp = fo->u.d.offset; return (GFARM_ERR_NO_ERROR); } gfarm_error_t process_set_dir_offset(struct process *process, struct peer *peer, int fd, gfarm_off_t offset) { struct file_opening *fo; gfarm_error_t e = process_get_file_opening(process, fd, &fo); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001608, "process_get_file_opening() failed: %s", gfarm_error_string(e)); return (e); } if (!inode_is_dir(fo->inode)) { gflog_debug(GFARM_MSG_1001609, "inode is not a directory"); return (GFARM_ERR_NOT_A_DIRECTORY); } if (fo->opener != peer) { gflog_debug(GFARM_MSG_1001610, "operation is not permitted"); return (GFARM_ERR_OPERATION_NOT_PERMITTED); } fo->u.d.offset = offset; return (GFARM_ERR_NO_ERROR); } /* * The reason why we provide fo->u.d.key (not only fo->u.d.offset) is * because fo->u.d.key is more robust with directory entry insertion/deletion. */ gfarm_error_t process_get_dir_key(struct process *process, struct peer *peer, int fd, char **keyp, int *keylenp) { struct file_opening *fo; gfarm_error_t e = process_get_file_opening(process, fd, &fo); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001611, "process_get_file_opening() failed: %s", gfarm_error_string(e)); return (e); } if (!inode_is_dir(fo->inode)) { gflog_debug(GFARM_MSG_1001612, "inode is not a directory"); return (GFARM_ERR_NOT_A_DIRECTORY); } if (fo->opener != peer) { gflog_debug(GFARM_MSG_1001613, "operation is not permitted"); return (GFARM_ERR_OPERATION_NOT_PERMITTED); } if (fo->u.d.key == NULL) { *keyp = NULL; *keylenp = 0; } else { *keyp = fo->u.d.key; *keylenp = strlen(fo->u.d.key); } return (GFARM_ERR_NO_ERROR); } gfarm_error_t process_set_dir_key(struct process *process, struct peer *peer, int fd, char *key, int keylen) { struct file_opening *fo; gfarm_error_t e = process_get_file_opening(process, fd, &fo); char *s; if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001614, "process_get_file_opening() failed: %s", gfarm_error_string(e)); return (e); } if (!inode_is_dir(fo->inode)) { gflog_debug(GFARM_MSG_1001615, "inode is not a directory"); return (GFARM_ERR_NOT_A_DIRECTORY); } if (fo->opener != peer) { gflog_debug(GFARM_MSG_1001616, "operation is not permitted"); return (GFARM_ERR_OPERATION_NOT_PERMITTED); } s = malloc(keylen + 1); if (s == NULL) { gflog_debug(GFARM_MSG_1001617, "allocation of string failed"); return (GFARM_ERR_NO_MEMORY); } memcpy(s, key, keylen); s[keylen] = '\0'; if (fo->u.d.key != NULL) free(fo->u.d.key); fo->u.d.key = s; return (GFARM_ERR_NO_ERROR); } gfarm_error_t process_clear_dir_key(struct process *process, struct peer *peer, int fd) { struct file_opening *fo; gfarm_error_t e = process_get_file_opening(process, fd, &fo); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001618, "process_get_file_opening() failed: %s", gfarm_error_string(e)); return (e); } if (!inode_is_dir(fo->inode)) { gflog_debug(GFARM_MSG_1001619, "inode is not a directory"); return (GFARM_ERR_NOT_A_DIRECTORY); } if (fo->opener != peer) { gflog_debug(GFARM_MSG_1001620, "operation is not permitted"); return (GFARM_ERR_OPERATION_NOT_PERMITTED); } if (fo->u.d.key != NULL) free(fo->u.d.key); fo->u.d.key = NULL; return (GFARM_ERR_NO_ERROR); } struct process * process_lookup(gfarm_pid_t pid) { if (process_id_table == NULL) return (NULL); return (gfarm_id_lookup(process_id_table, (gfarm_int32_t)pid)); } gfarm_error_t process_does_match(gfarm_pid_t pid, gfarm_int32_t keytype, size_t keylen, char *sharedkey, struct process **processp) { struct process *process = process_lookup((gfarm_int32_t)pid); if (process == NULL) { gflog_debug(GFARM_MSG_1001621, "process_lookup() failed"); return (GFARM_ERR_NO_SUCH_PROCESS); } if (keytype != GFM_PROTO_PROCESS_KEY_TYPE_SHAREDSECRET || keylen != GFM_PROTO_PROCESS_KEY_LEN_SHAREDSECRET || memcmp(sharedkey, process->sharedkey, GFM_PROTO_PROCESS_KEY_LEN_SHAREDSECRET) != 0) { gflog_debug(GFARM_MSG_1001622, "authentication failed"); return (GFARM_ERR_AUTHENTICATION); } *processp = process; return (GFARM_ERR_NO_ERROR); } gfarm_error_t process_new_generation_wait(struct peer *peer, int fd, gfarm_error_t (*action)(struct peer *, void *, int *), void *arg) { struct process *process; struct file_opening *fo; gfarm_error_t e; static const char diag[] = "process_new_generation_wait"; if ((process = peer_get_process(peer)) == NULL) { gflog_debug(GFARM_MSG_1002237, "%s: peer_get_process() failed", diag); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if ((e = process_get_file_opening(process, fd, &fo)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1002238, "%s: process_get_file_opening(%d) failed", diag, fd); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else { e = inode_new_generation_wait(fo->inode, peer, action, arg); } return (e); } gfarm_error_t process_new_generation_done(struct process *process, struct peer *peer, int fd, gfarm_int32_t result) { struct file_opening *fo; gfarm_mode_t mode; gfarm_error_t e = process_get_file_opening(process, fd, &fo); static const char diag[] = "process_new_generation_done"; if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1002325, "%s: pid %lld descriptor %d: %s", diag, (long long)process->pid, fd, gfarm_error_string(e)); return (e); } else if ((e = inode_new_generation_done(fo->inode, peer, result)) == GFARM_ERR_NO_ERROR) { /* resume deferred operaton: close the file */ if (fo->opener != peer && fo->opener != NULL) { /* * closing REOPENed file, * but the client is still opening */ fo->u.f.spool_opener = NULL; fo->u.f.spool_host = NULL; } else { mode = inode_get_mode(fo->inode); inode_close(fo); file_opening_free(fo, mode); process->filetab[fd] = NULL; } } return (e); } gfarm_error_t process_open_file(struct process *process, struct inode *file, gfarm_int32_t flag, int created, struct peer *peer, struct host *spool_host, gfarm_int32_t *fdp) { gfarm_error_t e; int fd, fd2; struct file_opening **p, *fo; /* XXX FIXME cache minimum unused fd, and avoid liner search */ for (fd = 0; fd < process->nfiles; fd++) { if (process->filetab[fd] == NULL) break; } if (fd >= process->nfiles) { if (fd >= FILETAB_MAX) { gflog_debug(GFARM_MSG_1001623, "too many open files"); return (GFARM_ERR_TOO_MANY_OPEN_FILES); } p = realloc(process->filetab, sizeof(*p) * (process->nfiles * FILETAB_MULTIPLY)); if (p == NULL) { gflog_debug(GFARM_MSG_1001624, "re-allocation of 'process' failed"); return (GFARM_ERR_NO_MEMORY); } process->filetab = p; process->nfiles *= FILETAB_MULTIPLY; for (fd2 = fd + 1; fd2 < process->nfiles; fd2++) process->filetab[fd2] = NULL; } fo = file_opening_alloc(file, peer, spool_host, flag | (created ? GFARM_FILE_CREATE : 0)); if (fo == NULL) { gflog_debug(GFARM_MSG_1001625, "file_opening_alloc() failed"); return (GFARM_ERR_NO_MEMORY); } e = inode_open(fo); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001626, "inode_open() failed: %s", gfarm_error_string(e)); file_opening_free(fo, inode_get_mode(file)); return (e); } process->filetab[fd] = fo; *fdp = fd; return (GFARM_ERR_NO_ERROR); } gfarm_error_t process_schedule_file(struct process *process, struct peer *peer, int fd, gfarm_int32_t *np, struct host ***hostsp) { struct file_opening *fo; gfarm_error_t e = process_get_file_opening(process, fd, &fo); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001861, "process_get_file_opening() failed: %s", gfarm_error_string(e)); } else if (!inode_is_file(fo->inode)) { gflog_debug(GFARM_MSG_1001862, "inode is not file"); e = GFARM_ERR_OPERATION_NOT_SUPPORTED; } else { return (inode_schedule_file(fo, peer, np, hostsp)); } assert(e != GFARM_ERR_NO_ERROR); return (e); } gfarm_error_t process_reopen_file(struct process *process, struct peer *peer, struct host *spool_host, int fd, gfarm_ino_t *inump, gfarm_uint64_t *genp, gfarm_int32_t *modep, gfarm_int32_t *flagsp, gfarm_int32_t *to_createp) { struct file_opening *fo; gfarm_error_t e = process_get_file_opening(process, fd, &fo); int to_create, is_creating_file_replica; if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001627, "process_get_file_opening() failed: %s", gfarm_error_string(e)); return (e); } if (!inode_is_file(fo->inode)) { /* i.e. is a directory */ gflog_debug(GFARM_MSG_1001628, "inode is not file"); return (GFARM_ERR_OPERATION_NOT_PERMITTED); } if (fo->u.f.spool_opener != NULL || fo->u.f.spool_host != NULL) { /* already REOPENed */ gflog_debug(GFARM_MSG_1001629, "file already reopened"); return (GFARM_ERR_OPERATION_NOT_PERMITTED); } if (inode_new_generation_is_pending(fo->inode)) { /* wait until the generation is updated */ gflog_debug(GFARM_MSG_1002240, "process_reopen_file: new_generation pending %lld:%lld", (long long)inode_get_number(fo->inode), (long long)inode_get_gen(fo->inode)); return (GFARM_ERR_RESOURCE_TEMPORARILY_UNAVAILABLE); } to_create = 0; is_creating_file_replica = (fo->flag & GFARM_FILE_CREATE_REPLICA) != 0; if ((accmode_to_op(fo->flag) & GFS_W_OK) != 0 || inode_is_creating_file(fo->inode)) { if (is_creating_file_replica) { e = inode_add_replica(fo->inode, spool_host, 0); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001630, "inode_add_replica() failed: %s", gfarm_error_string(e)); return (e); } } else if (!inode_schedule_confirm_for_write(fo, spool_host, &to_create)) { gflog_debug(GFARM_MSG_1001631, "file migrated"); return (GFARM_ERR_FILE_MIGRATED); } if (to_create) { e = inode_add_replica(fo->inode, spool_host, 1); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001632, "inode_add_replica() failed: %s", gfarm_error_string(e)); return (e); } } } else { if (!inode_has_replica(fo->inode, spool_host)) { gflog_debug(GFARM_MSG_1001633, "file migrated"); return (GFARM_ERR_FILE_MIGRATED); } } fo->u.f.spool_opener = peer; fo->u.f.spool_host = spool_host; fo->flag &= ~GFARM_FILE_TRUNC_PENDING; /*spool_host will truncate it*/ *inump = inode_get_number(fo->inode); *genp = inode_get_gen(fo->inode); *modep = inode_get_mode(fo->inode); *flagsp = fo->flag & GFARM_FILE_USER_MODE; *to_createp = to_create || is_creating_file_replica; return (GFARM_ERR_NO_ERROR); } gfarm_error_t process_close_file(struct process *process, struct peer *peer, int fd) { struct file_opening *fo; gfarm_mode_t mode; gfarm_error_t e = process_get_file_opening(process, fd, &fo); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001634, "process_get_file_opening() failed: %s", gfarm_error_string(e)); return (e); } mode = inode_get_mode(fo->inode); if (fo->opener != peer) { if (!GFARM_S_ISREG(mode)) { gflog_debug(GFARM_MSG_1001635, "inode is not file"); return (GFARM_ERR_OPERATION_NOT_PERMITTED); } if (fo->u.f.spool_opener != peer) { gflog_debug(GFARM_MSG_1001636, "operation is not permitted"); return (GFARM_ERR_OPERATION_NOT_PERMITTED); } /* i.e. REOPENed file, and I am a gfsd. */ if (fo->opener != NULL) { /* * a gfsd is closing a REOPENed file, * but the client is still opening it. */ fo->u.f.spool_opener = NULL; fo->u.f.spool_host = NULL; return (GFARM_ERR_NO_ERROR); } } else { if (GFARM_S_ISREG(mode) && fo->u.f.spool_opener != NULL && fo->u.f.spool_opener != peer) { /* * a client is closing a file, * but the gfsd is still opening it. */ fo->opener = NULL; return (GFARM_ERR_NO_ERROR); } } inode_close(fo); file_opening_free(fo, mode); process->filetab[fd] = NULL; return (GFARM_ERR_NO_ERROR); } gfarm_error_t process_close_file_read(struct process *process, struct peer *peer, int fd, struct gfarm_timespec *atime) { struct file_opening *fo; gfarm_mode_t mode; gfarm_error_t e = process_get_file_opening(process, fd, &fo); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001637, "process_get_file_opening() failed: %s", gfarm_error_string(e)); return (e); } mode = inode_get_mode(fo->inode); if (!GFARM_S_ISREG(mode)) { gflog_debug(GFARM_MSG_1001638, "inode is not file"); return (GFARM_ERR_OPERATION_NOT_PERMITTED); } if (fo->u.f.spool_opener != peer) { gflog_debug(GFARM_MSG_1001639, "operation is not permitted"); return (GFARM_ERR_OPERATION_NOT_PERMITTED); } if (fo->opener != peer && fo->opener != NULL) { /* closing REOPENed file, but the client is still opening */ fo->u.f.spool_opener = NULL; fo->u.f.spool_host = NULL; inode_set_atime(fo->inode, atime); return (GFARM_ERR_NO_ERROR); } inode_close_read(fo, atime); file_opening_free(fo, mode); process->filetab[fd] = NULL; return (GFARM_ERR_NO_ERROR); } gfarm_error_t process_close_file_write(struct process *process, struct peer *peer, int fd, gfarm_off_t size, struct gfarm_timespec *atime, struct gfarm_timespec *mtime, gfarm_int32_t *flagsp, gfarm_int64_t *old_genp, gfarm_int64_t *new_genp) { struct file_opening *fo; gfarm_mode_t mode; gfarm_error_t e = process_get_file_opening(process, fd, &fo); gfarm_int32_t flags = 0; int is_v2_4 = (flagsp != NULL); static const char diag[] = "process_close_file_write"; /* * NOTE: gfsd uses CLOSE_FILE_WRITE protocol only if the file is * really updated. */ if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001640, "process_get_file_opening() failed: %s", gfarm_error_string(e)); return (e); } mode = inode_get_mode(fo->inode); if (!GFARM_S_ISREG(mode)) { gflog_debug(GFARM_MSG_1001641, "inode is not file"); return (GFARM_ERR_OPERATION_NOT_PERMITTED); } if (fo->u.f.spool_opener != peer) { gflog_debug(GFARM_MSG_1001642, "operation is not permitted"); return (GFARM_ERR_OPERATION_NOT_PERMITTED); } if ((accmode_to_op(fo->flag) & GFS_W_OK) == 0) { gflog_debug(GFARM_MSG_1001643, "bad file descriptor"); return (GFARM_ERR_BAD_FILE_DESCRIPTOR); } if (is_v2_4 && inode_new_generation_is_pending(fo->inode)) { gflog_debug(GFARM_MSG_1002241, "%s: new_generation pending %lld:%lld", diag, (long long)inode_get_number(fo->inode), (long long)inode_get_gen(fo->inode)); return (GFARM_ERR_RESOURCE_TEMPORARILY_UNAVAILABLE); } if (inode_is_updated(fo->inode, mtime) && /* * GFARM_FILE_CREATE_REPLICA flag means to create and add a * file replica by gfs_pio_write if this file already has file * replicas. GFARM_ERR_ALREADY_EXISTS error means this is the * first one and this file has only one replica. If it is * not, do not change the status. */ (((fo->flag & GFARM_FILE_CREATE_REPLICA) == 0) || (inode_add_replica(fo->inode, fo->u.f.spool_host, 1) == GFARM_ERR_ALREADY_EXISTS)) && inode_file_update(fo, size, atime, mtime, old_genp, new_genp)) { flags = GFM_PROTO_CLOSE_WRITE_GENERATION_UPDATE_NEEDED; } if ((flags & GFM_PROTO_CLOSE_WRITE_GENERATION_UPDATE_NEEDED) != 0) { /* defer file close for GFM_PROTO_GENERATION_UPDATED */ e = inode_new_generation_wait_start(fo->inode, peer); if (e != GFARM_ERR_NO_ERROR) return (e); /* XXX FIXME: it's better to close fd */ peer_set_pending_new_generation(peer, fo->inode); } else if (fo->opener != peer && fo->opener != NULL) { /* closing REOPENed file, but the client is still opening */ fo->u.f.spool_opener = NULL; fo->u.f.spool_host = NULL; } else { inode_close(fo); file_opening_free(fo, mode); process->filetab[fd] = NULL; } if (flagsp != NULL) *flagsp = flags; return (GFARM_ERR_NO_ERROR); } gfarm_error_t process_cksum_set(struct process *process, struct peer *peer, int fd, const char *cksum_type, size_t cksum_len, const char *cksum, gfarm_int32_t flags, struct gfarm_timespec *mtime) { struct file_opening *fo; gfarm_error_t e = process_get_file_opening(process, fd, &fo); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001644, "process_get_file_opening() failed: %s", gfarm_error_string(e)); return (e); } if (!inode_is_file(fo->inode)) { gflog_debug(GFARM_MSG_1001645, "inode is not file"); return (GFARM_ERR_OPERATION_NOT_PERMITTED); } if (fo->u.f.spool_opener != peer) { gflog_debug(GFARM_MSG_1001646, "operation is not permitted"); return (GFARM_ERR_OPERATION_NOT_PERMITTED); } if ((accmode_to_op(fo->flag) & GFS_W_OK) == 0) { gflog_debug(GFARM_MSG_1001647, "bad file descriptor"); return (GFARM_ERR_BAD_FILE_DESCRIPTOR); } return (inode_cksum_set(fo, cksum_type, cksum_len, cksum, flags, mtime)); } gfarm_error_t process_cksum_get(struct process *process, struct peer *peer, int fd, char **cksum_typep, size_t *cksum_lenp, char **cksump, gfarm_int32_t *flagsp) { struct file_opening *fo; gfarm_error_t e = process_get_file_opening(process, fd, &fo); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001648, "process_get_file_opening() failed: %s", gfarm_error_string(e)); return (e); } if (!inode_is_file(fo->inode)) { gflog_debug(GFARM_MSG_1001649, "inode is not file"); return (GFARM_ERR_OPERATION_NOT_PERMITTED); } return (inode_cksum_get(fo, cksum_typep, cksum_lenp, cksump, flagsp)); } gfarm_error_t process_bequeath_fd(struct process *process, gfarm_int32_t fd) { struct file_opening *fo; gfarm_error_t e = process_get_file_opening(process, fd, &fo); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001650, "process_get_file_opening() failed: %s", gfarm_error_string(e)); return (e); } fo->flag |= GFARM_FILE_BEQUEATHED; return (GFARM_ERR_NO_ERROR); } gfarm_error_t process_inherit_fd(struct process *process, gfarm_int32_t parent_fd, struct peer *peer, struct host *spool_host, gfarm_int32_t *fdp) { struct file_opening *fo; gfarm_error_t e; if (process->parent == NULL) { gflog_debug(GFARM_MSG_1001651, "process->parent does not exist"); return (GFARM_ERR_NO_SUCH_PROCESS); } e = process_get_file_opening(process, parent_fd, &fo); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001652, "process_get_file_opening() failed: %s", gfarm_error_string(e)); return (e); } if ((fo->flag & GFARM_FILE_BEQUEATHED) == 0) { gflog_debug(GFARM_MSG_1001653, "bad file descriptor"); return (GFARM_ERR_BAD_FILE_DESCRIPTOR); } return (process_open_file(process, fo->inode, fo->flag, (fo->flag & GFARM_FILE_CREATE) != 0, peer, spool_host, fdp)); } gfarm_error_t process_prepare_to_replicate(struct process *process, struct peer *peer, struct host *src, struct host *dst, int fd, gfarm_int32_t flags, struct file_replicating **frp, struct inode **inodep) { gfarm_error_t e; struct file_opening *fo; struct user *user; if ((e = process_get_file_opening(process, fd, &fo)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001654, "process_get_file_opening() failed: %s", gfarm_error_string(e)); return (e); } if (fo->u.f.spool_opener != NULL) { /* already REOPENed */ gflog_debug(GFARM_MSG_1001655, "operation is not permitted, already reopened"); return (GFARM_ERR_OPERATION_NOT_PERMITTED); } if ((user = process_get_user(process)) == NULL) { gflog_debug(GFARM_MSG_1001656, "process_get_user() failed"); return (GFARM_ERR_OPERATION_NOT_PERMITTED); } e = inode_prepare_to_replicate(fo->inode, user, src, dst, flags, frp); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001657, "inode_prepare_to_replicate() failed: %s", gfarm_error_string(e)); return (e); } *inodep = fo->inode; return (GFARM_ERR_NO_ERROR); } gfarm_error_t process_replica_adding(struct process *process, struct peer *peer, struct host *src, struct host *dst, int fd, struct inode **inodep) { struct file_opening *fo; gfarm_error_t e = process_get_file_opening(process, fd, &fo); if (e != GFARM_ERR_NO_ERROR) return (e); if (fo->u.f.replicating != NULL) return (GFARM_ERR_FILE_BUSY); if (inode_new_generation_is_pending(fo->inode)) { gflog_debug(GFARM_MSG_1002242, "process_replica_adding: new_generation pending %lld:%lld", (long long)inode_get_number(fo->inode), (long long)inode_get_gen(fo->inode)); return (GFARM_ERR_RESOURCE_TEMPORARILY_UNAVAILABLE); } e = process_prepare_to_replicate(process, peer, src, dst, fd, GFS_REPLICATE_FILE_FORCE, &fo->u.f.replicating, inodep); if (e == GFARM_ERR_NO_ERROR) { fo->u.f.spool_opener = peer; /* * do not set spool_host * since replica is now creating to this host */ } return (e); } gfarm_error_t process_replica_added(struct process *process, struct peer *peer, struct host *spool_host, int fd, int flags, gfarm_int64_t mtime_sec, gfarm_int32_t mtime_nsec, gfarm_off_t size) { struct file_opening *fo; struct gfarm_timespec *mtime; gfarm_error_t e = process_get_file_opening(process, fd, &fo), e2; if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001658, "process_get_file_opening() failed: %s", gfarm_error_string(e)); return (e); } if (!inode_is_file(fo->inode)) { /* i.e. is a directory */ gflog_debug(GFARM_MSG_1001659, "inode is not file"); return (GFARM_ERR_OPERATION_NOT_PERMITTED); } if (fo->u.f.spool_opener != peer) { gflog_debug(GFARM_MSG_1001660, "operation is not permitted"); return (GFARM_ERR_OPERATION_NOT_PERMITTED); } if (fo->u.f.replicating == NULL) { gflog_debug(GFARM_MSG_1002243, "replica_added was called witout adding"); return (GFARM_ERR_INVALID_ARGUMENT); } if (inode_is_creating_file(fo->inode)) { /* no file copy */ gflog_debug(GFARM_MSG_1001661, "inode has no file copy"); e = GFARM_ERR_NO_SUCH_OBJECT; } else if (inode_has_replica(fo->inode, spool_host)) { gflog_debug(GFARM_MSG_1001662, "spool_host already has replica"); e = GFARM_ERR_ALREADY_EXISTS; } else if (mtime_sec != (mtime = inode_get_mtime(fo->inode))->tv_sec || mtime_nsec != mtime->tv_nsec || (size != -1 && size != inode_get_size(fo->inode)) || file_replicating_get_gen(fo->u.f.replicating) != inode_get_gen(fo->inode)) { gflog_debug(GFARM_MSG_1002244, "inode(%lld) updated while replication: " "mtime %lld.%09lld/%lld.%09lld, " "size: %lld/%lld, gen:%lld/%lld", (long long)inode_get_number(fo->inode), (long long)mtime_sec, (long long)mtime_nsec, (long long)inode_get_mtime(fo->inode)->tv_sec, (long long)inode_get_mtime(fo->inode)->tv_nsec, (long long)size, (long long)inode_get_size(fo->inode), (long long)file_replicating_get_gen(fo->u.f.replicating), (long long)inode_get_gen(fo->inode)); e = inode_remove_replica_gen(fo->inode, spool_host, file_replicating_get_gen(fo->u.f.replicating), 0); if (e == GFARM_ERR_NO_ERROR || e == GFARM_ERR_NO_SUCH_OBJECT) e = GFARM_ERR_INVALID_FILE_REPLICA; } else e = inode_add_replica(fo->inode, spool_host, 1); file_replicating_free(fo->u.f.replicating); fo->u.f.replicating = NULL; e2 = process_close_file_read(process, peer, fd, NULL); return (e != GFARM_ERR_NO_ERROR ? e : e2); } /* * protocol handler */ gfarm_error_t gfm_server_process_alloc(struct peer *peer, int from_client, int skip) { gfarm_int32_t e; struct user *user; gfarm_int32_t keytype; size_t keylen; char sharedkey[GFM_PROTO_PROCESS_KEY_LEN_SHAREDSECRET]; struct process *process; gfarm_pid_t pid; static const char diag[] = "GFM_PROTO_PROCESS_ALLOC"; e = gfm_server_get_request(peer, diag, "ib", &keytype, sizeof(sharedkey), &keylen, sharedkey); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001663, "process_alloc request failed: %s", gfarm_error_string(e)); return (e); } if (skip) return (GFARM_ERR_NO_ERROR); giant_lock(); if (peer_get_process(peer) != NULL) { gflog_debug(GFARM_MSG_1001664, "peer_get_process() failed"); e = GFARM_ERR_ALREADY_EXISTS; } else if (!from_client || (user = peer_get_user(peer)) == NULL) { gflog_debug(GFARM_MSG_1001665, "operation is not permitted"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if ((e = process_alloc(user, keytype, keylen, sharedkey, &process, &pid)) == GFARM_ERR_NO_ERROR) { peer_set_process(peer, process); } giant_unlock(); return (gfm_server_put_reply(peer, diag, e, "l", pid)); } gfarm_error_t gfm_server_process_alloc_child(struct peer *peer, int from_client, int skip) { gfarm_int32_t e; struct user *user; gfarm_int32_t parent_keytype, keytype; size_t parent_keylen, keylen; char parent_sharedkey[GFM_PROTO_PROCESS_KEY_LEN_SHAREDSECRET]; char sharedkey[GFM_PROTO_PROCESS_KEY_LEN_SHAREDSECRET]; struct process *parent_process, *process; gfarm_pid_t parent_pid, pid; static const char diag[] = "GFM_PROTO_PROCESS_ALLOC_CHILD"; e = gfm_server_get_request(peer, diag, "iblib", &parent_keytype, sizeof(parent_sharedkey), &parent_keylen, parent_sharedkey, &parent_pid, &keytype, sizeof(sharedkey), &keylen, sharedkey); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001666, "process_alloc_child request failed: %s", gfarm_error_string(e)); return (e); } if (skip) return (GFARM_ERR_NO_ERROR); giant_lock(); if (peer_get_process(peer) != NULL) { gflog_debug(GFARM_MSG_1001667, "peer_get_process() failed"); e = GFARM_ERR_ALREADY_EXISTS; } else if (!from_client || (user = peer_get_user(peer)) == NULL) { gflog_debug(GFARM_MSG_1001668, "operation is not permitted"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if (parent_keytype != GFM_PROTO_PROCESS_KEY_TYPE_SHAREDSECRET || parent_keylen != GFM_PROTO_PROCESS_KEY_LEN_SHAREDSECRET) { gflog_debug(GFARM_MSG_1001669, "'parent_keytype' or 'parent_keylen' is invalid"); e = GFARM_ERR_INVALID_ARGUMENT; } else if ((e = process_does_match(parent_pid, parent_keytype, parent_keylen, parent_sharedkey, &parent_process)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001670, "process_does_match() failed: %s", gfarm_error_string(e)); /* error */ } else if ((e = process_alloc(user, keytype, keylen, sharedkey, &process, &pid)) == GFARM_ERR_NO_ERROR) { peer_set_process(peer, process); process_add_child(parent_process, process); } giant_unlock(); return (gfm_server_put_reply(peer, diag, e, "l", pid)); } gfarm_error_t gfm_server_process_set(struct peer *peer, int from_client, int skip) { gfarm_int32_t e; gfarm_pid_t pid; gfarm_int32_t keytype; size_t keylen; char sharedkey[GFM_PROTO_PROCESS_KEY_LEN_SHAREDSECRET]; struct process *process; static const char diag[] = "GFM_PROTO_PROCESS_SET"; e = gfm_server_get_request(peer, diag, "ibl", &keytype, sizeof(sharedkey), &keylen, sharedkey, &pid); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001671, "process_set request failed: %s", gfarm_error_string(e)); return (e); } if (skip) return (GFARM_ERR_NO_ERROR); giant_lock(); if (peer_get_process(peer) != NULL) { gflog_debug(GFARM_MSG_1001672, "peer_get_process() failed"); e = GFARM_ERR_ALREADY_EXISTS; } else if (keytype != GFM_PROTO_PROCESS_KEY_TYPE_SHAREDSECRET || keylen != GFM_PROTO_PROCESS_KEY_LEN_SHAREDSECRET) { gflog_debug(GFARM_MSG_1001673, "'parent_keytype' or 'parent_keylen' is invalid"); e = GFARM_ERR_INVALID_ARGUMENT; } else if ((e = process_does_match(pid, keytype, keylen, sharedkey, &process)) == GFARM_ERR_NO_ERROR) { peer_set_process(peer, process); if (!from_client) peer_set_user(peer, process_get_user(process)); } giant_unlock(); return (gfm_server_put_reply(peer, diag, e, "")); } gfarm_error_t gfm_server_process_free(struct peer *peer, int from_client, int skip) { gfarm_error_t e; int transaction = 0; static const char diag[] = "GFM_PROTO_PROCESS_FREE"; if (skip) return (GFARM_ERR_NO_ERROR); giant_lock(); if (peer_get_process(peer) == NULL) { gflog_debug(GFARM_MSG_1001674, "peer_get_process() failed"); e = GFARM_ERR_NO_SUCH_PROCESS; } else { if (db_begin(diag) == GFARM_ERR_NO_ERROR) transaction = 1; /* * the following internally calls inode_close*() and * closing must be done regardless of the result of db_begin(). * because not closing may cause descriptor leak. */ peer_unset_process(peer); e = GFARM_ERR_NO_ERROR; if (transaction) db_end(diag); } giant_unlock(); return (gfm_server_put_reply(peer, diag, e, "")); } gfarm_error_t gfm_server_bequeath_fd(struct peer *peer, int from_client, int skip) { gfarm_int32_t e; struct host *spool_host; struct process *process; gfarm_int32_t fd; static const char diag[] = "GFM_PROTO_BEQUEATH_FD"; if (skip) return (GFARM_ERR_NO_ERROR); giant_lock(); if (!from_client && (spool_host = peer_get_host(peer)) == NULL) { gflog_debug(GFARM_MSG_1001675, "operation is not permitted "); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if ((process = peer_get_process(peer)) == NULL) { gflog_debug(GFARM_MSG_1001676, "peer_get_process() failed"); e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if ((e = peer_fdpair_get_current(peer, &fd)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001677, "peer_fdpair_get_current() failed"); } else e = process_bequeath_fd(process, fd); giant_unlock(); return (gfm_server_put_reply(peer, diag, e, "")); } gfarm_error_t gfm_server_inherit_fd(struct peer *peer, int from_client, int skip) { gfarm_int32_t e; gfarm_int32_t parent_fd, fd; struct host *spool_host; struct process *process; static const char diag[] = "GFM_PROTO_INHERIT_FD"; e = gfm_server_get_request(peer, diag, "i", &parent_fd); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001678, "inherit_fd request failed: %s", gfarm_error_string(e)); return (e); } if (skip) return (GFARM_ERR_NO_ERROR); giant_lock(); if (!from_client && (spool_host = peer_get_host(peer)) == NULL) { e = GFARM_ERR_OPERATION_NOT_PERMITTED; gflog_debug(GFARM_MSG_1001679, "operation is not permitted"); } else if ((process = peer_get_process(peer)) == NULL) { e = GFARM_ERR_OPERATION_NOT_PERMITTED; gflog_debug(GFARM_MSG_1001680, "peer_get_process() failed"); } else if ((e = process_inherit_fd(process, parent_fd, peer, NULL, &fd)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001681, "process_inherit_fd() failed: %s", gfarm_error_string(e)); } else peer_fdpair_set_current(peer, fd); giant_unlock(); return (gfm_server_put_reply(peer, diag, e, "")); } gfarm-2.4.1/server/gfmd/thrpool.c0000644000000000000000000001057411507222724015377 0ustar rootroot#include #include #include #include #include #include #include "gfutil.h" #include "thrsubr.h" #include "subr.h" #include "thrpool.h" struct thread_job { void *(*thread_main)(void *); void *arg; }; struct thread_jobq { pthread_mutex_t mutex; pthread_cond_t nonfull, nonempty; int size, n, in, out; struct thread_job *entries; }; void thrjobq_init(struct thread_jobq *q, int size) { static const char diag[] = "thrjobq_init"; gfarm_mutex_init(&q->mutex, diag, "thrjobq"); gfarm_cond_init(&q->nonempty, diag, "nonempty"); gfarm_cond_init(&q->nonfull, diag, "nonfull"); q->size = size; q->n = q->in = q->out = 0; GFARM_MALLOC_ARRAY(q->entries, size); if (q->entries == NULL) gflog_fatal(GFARM_MSG_1000220, "%s: jobq size: %s", diag, strerror(ENOMEM)); } void thrjobq_add_job(struct thread_jobq *q, void *(*thread_main)(void *), void *arg) { static const char diag[] = "thrjobq_add_job"; gfarm_mutex_lock(&q->mutex, diag, "thrjobq"); while (q->n >= q->size) { gfarm_cond_wait(&q->nonfull, &q->mutex, diag, "nonfull"); } q->entries[q->in].thread_main = thread_main; q->entries[q->in].arg = arg; q->in++; if (q->in >= q->size) q->in = 0; q->n++; gfarm_cond_signal(&q->nonempty, diag, "nonempty"); gfarm_mutex_unlock(&q->mutex, diag, "thrjobq"); } void thrjobq_get_job(struct thread_jobq *q, struct thread_job *job) { static const char diag[] = "thrjobq_get_job"; gfarm_mutex_lock(&q->mutex, diag, "thrjobq"); while (q->n <= 0) { gfarm_cond_wait(&q->nonempty, &q->mutex, diag, "nonempty"); } *job = q->entries[q->out++]; if (q->out >= q->size) q->out = 0; q->n--; gfarm_cond_signal(&q->nonfull, diag, "nonfull"); gfarm_mutex_unlock(&q->mutex, diag, "thrjobq"); } struct thread_pool { pthread_mutex_t mutex; int pool_size; int threads; int idles; struct thread_jobq jobq; const char *name; struct thread_pool *next; }; static pthread_mutex_t all_thrpools_mutex = PTHREAD_MUTEX_INITIALIZER; static struct thread_pool *all_thrpools = NULL; struct thread_pool * thrpool_new(int pool_size, int queue_length, const char *pool_name) { struct thread_pool *p; static const char diag[] = "thrpool_new"; GFARM_MALLOC(p); if (p == NULL) return (NULL); thrjobq_init(&p->jobq, queue_length); gfarm_mutex_init(&p->mutex, diag, "thrpool"); p->pool_size = pool_size; p->threads = 0; p->idles = 0; p->name = pool_name; gfarm_mutex_lock(&all_thrpools_mutex, diag, "all_thrpools add"); p->next = all_thrpools; all_thrpools = p; gfarm_mutex_unlock(&all_thrpools_mutex, diag, "all_thrpools add"); return (p); } void * thrpool_worker(void *arg) { static const char diag[] = "thrpool_worker"; struct thread_pool *p = arg; struct thread_job job; for (;;) { gfarm_mutex_lock(&p->mutex, diag, "to get job"); p->idles++; gfarm_mutex_unlock(&p->mutex, diag, "to get job"); thrjobq_get_job(&p->jobq, &job); gfarm_mutex_lock(&p->mutex, diag, "after job was gotten"); p->idles--; gfarm_mutex_unlock(&p->mutex, diag, "after job was gotten"); (*job.thread_main)(job.arg); } /*NOTREACHED*/ /* this return value won't be used, because this thread is detached */ return (NULL); } void thrpool_add_job(struct thread_pool *p, void *(*thread_main)(void *), void *arg) { static const char diag[] = "thrpool_add_job"; gfarm_error_t e; gfarm_mutex_lock(&p->mutex, diag, "thrpool"); if (p->threads < p->pool_size && p->idles <= 0) { e = create_detached_thread(thrpool_worker, p); if (e == GFARM_ERR_NO_ERROR) { p->threads++; } else { gflog_warning(GFARM_MSG_1000221, "%s: create thread: %s\n", diag, gfarm_error_string(e)); } } gfarm_mutex_unlock(&p->mutex, diag, "thrpool"); thrjobq_add_job(&p->jobq, thread_main, arg); } void thrpool_info(void) { static const char diag[] = "thrpool_info"; struct thread_pool *p; int n, i; const char *name; gfarm_mutex_lock(&all_thrpools_mutex, diag, "all_thrpools access"); p = all_thrpools; gfarm_mutex_unlock(&all_thrpools_mutex, diag, "all_thrpools access"); /* this implementation depends on that p->next will be never changed */ for (; p != NULL; p = p->next) { gfarm_mutex_lock(&p->mutex, diag, "thrpool"); n = p->threads; i = p->idles; name = p->name; gfarm_mutex_unlock(&p->mutex, diag, "thrpool"); gflog_info(GFARM_MSG_1000222, "pool %s: number of worker threads: %d, idle threads: %d", name, n, i); } } gfarm-2.4.1/server/gfmd/dir.h0000644000000000000000000000244411507222724014470 0ustar rootroot#define USE_HASH 0 #if USE_HASH #include "hash.h" typedef struct gfarm_hash_table *Dir; typedef struct gfarm_hash_entry *DirEntry; typedef struct gfarm_hash_iterator DirCursor; #else /* ! USE_HASH */ /* red-black tree */ typedef struct rbdir *Dir; typedef struct rbdir_entry *DirEntry; typedef DirEntry DirCursor; #endif /* ! USE_HASH */ struct inode; Dir dir_alloc(void); void dir_free(Dir); int dir_is_empty(Dir); gfarm_off_t dir_get_entry_count(Dir); DirEntry dir_enter(Dir, const char *, int, int *); DirEntry dir_lookup(Dir, const char *, int); int dir_remove_entry(Dir, const char *, int); void dir_entry_set_inode(DirEntry, struct inode *); struct inode *dir_entry_get_inode(DirEntry); char *dir_entry_get_name(DirEntry, int *); int dir_cursor_lookup(Dir, const char *, int, DirCursor *); int dir_cursor_next(Dir, DirCursor *); int dir_cursor_set_pos(Dir, gfarm_off_t, DirCursor *); gfarm_off_t dir_cursor_get_pos(Dir, DirCursor *); DirEntry dir_cursor_get_entry(Dir, DirCursor *); gfarm_error_t dir_cursor_get_name_and_inode(Dir, DirCursor *, char **, struct inode **); /* * the following should belong to inode.h, really. * the reason why this is put here is to avoid to #include "dir.h" * in *.c files which need inode.h, but don't really need dir.h. */ Dir inode_get_dir(struct inode *); gfarm-2.4.1/server/Makefile0000644000000000000000000000023211507222724014255 0ustar rootroottop_builddir = .. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk SUBDIRS = gfmd gfsd include $(top_srcdir)/makes/subdir.mk gfarm-2.4.1/server/gfsd/0000755000000000000000000000000011507222730013540 5ustar rootrootgfarm-2.4.1/server/gfsd/loadavg.c0000644000000000000000000000425711507222724015334 0ustar rootroot#include #include #include #include #include "gfsd_subr.h" /* * getloadavg() function may require root user or kmem group privilege * on some OSes. */ #ifndef HAVE_GETLOADAVG #if defined(__linux__) int getloadavg(double *loadavg, int n) { int i, rv; char buffer[30]; double ldavg[3]; static int fd = -1; if (fd < 0) { if (fd != -2) /* known to be failed */ fd = open("/proc/loadavg", O_RDONLY); } if (fd < 0) { fd = -2; /* known to be failed */ return (-1); } lseek(fd, SEEK_SET, 0L); rv = read(fd, buffer, sizeof(buffer) - 1); if (rv <= 0) return (-1); buffer[rv] = '\0'; ldavg[0] = ldavg[1] = ldavg[2] = 0.0; rv = sscanf(buffer, "%lf %lf %lf", &ldavg[0], &ldavg[1], &ldavg[2]); if (n > rv) n = rv; for (i = 0; i < n; i++) loadavg[i] = ldavg[i]; return (n); } #endif /* __linux__ */ #if defined(__osf__) #include int getloadavg(double *loadavg, int n) { int i; struct tbl_loadavg ldavg; if (table(TBL_LOADAVG, 0, &ldavg, 1, sizeof(ldavg)) == -1) return (-1); if (ldavg.tl_lscale == 0) { for (i = 0; i < n; i++) loadavg[i] = ldavg.tl_avenrun.d[i]; } else { for (i = 0; i < n; i++) loadavg[i] = (double)ldavg.tl_avenrun.l[i] / ldavg.tl_lscale; } return (n); } #endif /* __osf__ */ #if defined(__hpux) #include #include int getloadavg(double *loadavg, int n) { struct pst_dynamic psd; if (pstat_getdynamic (&psd, sizeof(psd), (size_t)1, 0) == -1) return (-1); if (n > 0) loadavg[0] = psd.psd_avg_1_min; if (n > 1) loadavg[1] = psd.psd_avg_5_min; if (n > 2) loadavg[2] = psd.psd_avg_15_min; return (n > 3 ? 3 : n); } #endif /* __hpux */ #if defined(_AIX) #include #include int getloadavg(double *loadavg, int n) { int i; perfstat_cpu_total_t pct; if (perfstat_cpu_total(NULL, &pct, sizeof(pct), 1) == -1) return (-1); for (i = 0; i < n; i++) loadavg[i] = (double)pct.loadavg[i] / (1 << SBITS); return n; } #endif /* _AIX */ #endif /* !HAVE_GETLOADAVG */ #ifdef LOADAVG_TEST main() { double loadavg[3]; getloadavg(loadavg, 3); printf("%lf %lf %lf\n", loadavg[0], loadavg[1], loadavg[2]); } #endif gfarm-2.4.1/server/gfsd/statfs.c0000644000000000000000000000265011507222724015216 0ustar rootroot#include #include #include #include "gfsd_subr.h" #if defined(HAVE_STATVFS) #include #include int gfsd_statfs(char *path, gfarm_int32_t *bsizep, gfarm_off_t *blocksp, gfarm_off_t *bfreep, gfarm_off_t *bavailp, gfarm_off_t *filesp, gfarm_off_t *ffreep, gfarm_off_t *favailp) { struct statvfs buf; if (statvfs(path, &buf) == -1) return (errno); *bsizep = buf.f_frsize; *blocksp = buf.f_blocks; *bfreep = buf.f_bfree; *bavailp = buf.f_bavail; *filesp = buf.f_files; *ffreep = buf.f_ffree; *favailp = buf.f_favail; return (0); } #elif defined(HAVE_STATFS) #if defined(__linux__) #include #else #include #include #endif int gfsd_statfs(char *path, gfarm_int32_t *bsizep, gfarm_off_t *blocksp, gfarm_off_t *bfreep, gfarm_off_t *bavailp, gfarm_off_t *filesp, gfarm_off_t *ffreep, gfarm_off_t *favailp) { struct statfs buf; if (statfs(path, &buf) == -1) return (errno); *bsizep = buf.f_bsize; *blocksp = buf.f_blocks; *bfreep = buf.f_bfree; *bavailp = buf.f_bavail; *filesp = buf.f_files; *ffreep = buf.f_ffree; *favailp = buf.f_ffree; /* assumes there is no limit about i-node */ return (0); } #else int gfsd_statfs(char *path, gfarm_int32_t *bsizep, gfarm_off_t *blocksp, gfarm_off_t *bfreep, gfarm_off_t *bavailp, gfarm_off_t *filesp, gfarm_off_t *ffreep, gfarm_off_t *favailp) { return (ENOSYS); } #endif gfarm-2.4.1/server/gfsd/gfsd_subr.h0000644000000000000000000000105511507222724015673 0ustar rootroot/* need #include to see HAVE_GETLOADAVG */ #ifndef HAVE_GETLOADAVG int getloadavg(double *, int); #endif int gfsd_statfs(char *, gfarm_int32_t *, gfarm_off_t *, gfarm_off_t *, gfarm_off_t *, gfarm_off_t *, gfarm_off_t *, gfarm_off_t *); gfarm_error_t gfsd_spool_check(int); #define fatal_metadb_proto(msg_no, diag, proto, e) \ fatal_metadb_proto_full(msg_no, __FILE__, __LINE__, __func__, \ diag, proto, e) void fatal_metadb_proto_full(int, const char *, int, const char *, const char *, const char *, gfarm_error_t); gfarm-2.4.1/server/gfsd/spck.c0000644000000000000000000001347511507222724014661 0ustar rootroot/* * $Id$ */ #include #include #include #include #include #include #include #include #include #include #include #include #include "gfutil.h" #include "gfm_client.h" #include "gfsd_subr.h" extern int debug_mode; extern struct gfm_connection *gfm_server; static gfarm_error_t gfm_client_replica_add(gfarm_ino_t inum, gfarm_uint64_t gen, gfarm_off_t size) { gfarm_error_t e; char *diag = "replica_add"; if ((e = gfm_client_replica_add_request(gfm_server, inum, gen, size)) != GFARM_ERR_NO_ERROR) fatal_metadb_proto(GFARM_MSG_1000601, "replica_add request", diag, e); else if ((e = gfm_client_replica_add_result(gfm_server)) != GFARM_ERR_NO_ERROR) { if (debug_mode && e != GFARM_ERR_ALREADY_EXISTS) gflog_info(GFARM_MSG_1000602, "replica_add result: %s", gfarm_error_string(e)); } return (e); } /* * File format should be consistent with local_path() in gfsd.c */ static int get_inum_gen(const char *path, gfarm_ino_t *inump, gfarm_uint64_t *genp) { unsigned int inum32, inum24, inum16, inum8, inum0; unsigned int gen32, gen0; gfarm_ino_t inum; gfarm_uint64_t gen; if (sscanf(path, "data/%08X/%02X/%02X/%02X/%02X%08X%08X", &inum32, &inum24, &inum16, &inum8, &inum0, &gen32, &gen0) != 7) return (-1); inum = ((gfarm_ino_t)inum32 << 32) + (inum24 << 24) + (inum16 << 16) + (inum8 << 8) + inum0; gen = ((gfarm_uint64_t)gen32 << 32) + gen0; *inump = inum; *genp = gen; return (0); } static int delete_invalid_file = 0; static gfarm_error_t dir_foreach( gfarm_error_t (*op_file)(char *, struct stat *, void *), gfarm_error_t (*op_dir1)(char *, struct stat *, void *), gfarm_error_t (*op_dir2)(char *, struct stat *, void *), char *dir, void *arg) { DIR* dirp; struct dirent *dp; struct stat st; gfarm_error_t e; char *dir1; if (lstat(dir, &st)) return (gfarm_errno_to_error(errno)); if (S_ISREG(st.st_mode)) { if (op_file != NULL) return (op_file(dir, &st, arg)); else return (GFARM_ERR_NO_ERROR); } if (!S_ISDIR(st.st_mode)) { gflog_debug(GFARM_MSG_1002204, "Invalid argument st.st_mode"); return (GFARM_ERR_INVALID_ARGUMENT); /* XXX */ } if (op_dir1 != NULL) { e = op_dir1(dir, &st, arg); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1002205, "op_dir1() failed: %s", gfarm_error_string(e)); return (e); } } dirp = opendir(dir); if (dirp == NULL) { int err = errno; gflog_debug(GFARM_MSG_1002206, "opendir() failed: %s", strerror(err)); return (gfarm_errno_to_error(err)); } /* if dir is '.', remove it */ if (dir[0] == '.' && dir[1] == '\0') dir = ""; while ((dp = readdir(dirp)) != NULL) { if (dp->d_name[0] == '.' && (dp->d_name[1] == '\0' || (dp->d_name[1] == '.' && dp->d_name[2] == '\0'))) continue; GFARM_MALLOC_ARRAY(dir1, strlen(dir) + strlen(dp->d_name) + 2); if (dir1 == NULL) { closedir(dirp); gflog_debug(GFARM_MSG_1002207, "allocation of array 'dir1' failed"); return (GFARM_ERR_NO_MEMORY); } strcpy(dir1, dir); if (strcmp(dir, "")) strcat(dir1, "/"); strcat(dir1, dp->d_name); (void)dir_foreach(op_file, op_dir1, op_dir2, dir1, arg); free(dir1); } if (closedir(dirp)) return (gfarm_errno_to_error(errno)); if (op_dir2 != NULL) return (op_dir2(dir, &st, arg)); return (GFARM_ERR_NO_ERROR); } static gfarm_error_t unlink_file(char *file, struct stat *st, void *arg) { if (unlink(file)) return (gfarm_errno_to_error(errno)); return (GFARM_ERR_NO_ERROR); } static gfarm_error_t unlink_chmod(char *dir, struct stat *st, void *arg) { /* try to allow read and write access always */ (void)chmod(dir, (st->st_mode | S_IRUSR | S_IWUSR) & 07777); return (GFARM_ERR_NO_ERROR); } static gfarm_error_t unlink_rmdir(char *dir, struct stat *st, void *arg) { if (rmdir(dir)) return (gfarm_errno_to_error(errno)); return (GFARM_ERR_NO_ERROR); } static gfarm_error_t unlink_dir(char *src) { return (dir_foreach(unlink_file, unlink_chmod, unlink_rmdir, src, NULL)); } static gfarm_error_t delete_invalid_file_or_directory(char *pathname) { gfarm_error_t e; if (!delete_invalid_file) { gflog_notice(GFARM_MSG_1000603, "%s: invalid file", pathname); return (GFARM_ERR_NO_ERROR); } e = unlink_dir(pathname); if (e != GFARM_ERR_NO_ERROR) gflog_warning(GFARM_MSG_1000604, "%s: cannot delete", pathname); else gflog_notice(GFARM_MSG_1000605, "%s: deleted", pathname); return (e); } extern const char READONLY_CONFIG_FILE[]; static gfarm_error_t fixfrag(char *path) { gfarm_ino_t inum; gfarm_uint64_t gen; gfarm_off_t size; gfarm_error_t e; struct stat st; /* READONLY_CONFIG_FILE should be skipped */ if (strcmp(path, READONLY_CONFIG_FILE) == 0) return (GFARM_ERR_NO_ERROR); if (get_inum_gen(path, &inum, &gen)) return (delete_invalid_file_or_directory(path)); if (stat(path, &st)) return (gfarm_errno_to_error(errno)); size = st.st_size; e = gfm_client_replica_add(inum, gen, size); if (e == GFARM_ERR_ALREADY_EXISTS) /* correct entry */ e = GFARM_ERR_NO_ERROR; else if (e == GFARM_ERR_NO_ERROR) gflog_notice(GFARM_MSG_1000606, "%s: fixed", path); else switch (e) { case GFARM_ERR_NO_SUCH_OBJECT: case GFARM_ERR_INVALID_FILE_REPLICA: e = delete_invalid_file_or_directory(path); break; } return (e); } static gfarm_error_t fixdir_file(char *file, struct stat *st, void *arg) { return (fixfrag(file)); } static gfarm_error_t fixdir(char *dir) { return (dir_foreach(fixdir_file, NULL, NULL, dir, NULL)); } /* * check_level: * 0, 1 ... display invalid files * otherwise ... delete invalid files */ gfarm_error_t gfsd_spool_check(int check_level) { switch (check_level) { case 0: case 1: delete_invalid_file = 0; break; default: delete_invalid_file = 1; break; } return (fixdir(".")); } gfarm-2.4.1/server/gfsd/Makefile0000644000000000000000000000207111507222724015203 0ustar rootroot# $Id: Makefile 4308 2010-01-12 02:59:01Z ookuma $ top_builddir = ../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk include $(srcdir)/../Makefile.inc CFLAGS = $(COMMON_CFLAGS) -I$(GFUTIL_SRCDIR) -I$(GFARMLIB_SRCDIR) \ $(openssl_includes) \ -DGFARM_DEFAULT_BINDIR=\"$(default_bindir)\" LDLIBS = $(COMMON_LDFLAGS) $(GFARMLIB) $(LIBS) DEPLIBS = $(DEPGFARMLIB) PROGRAM = gfsd SRCS = gfsd.c loadavg.c statfs.c spck.c OBJS = gfsd.o loadavg.o statfs.o spck.o all: $(PROGRAM) include $(top_srcdir)/makes/prog.mk include $(top_srcdir)/makes/gflog.mk ### $(OBJS): $(DEPGFARMINC) \ $(GFUTIL_SRCDIR)/gfutil.h \ $(GFARMLIB_SRCDIR)/iobuffer.h \ $(GFARMLIB_SRCDIR)/gfp_xdr.h \ $(GFARMLIB_SRCDIR)/io_fd.h \ $(GFARMLIB_SRCDIR)/param.h \ $(GFARMLIB_SRCDIR)/sockopt.h \ $(GFARMLIB_SRCDIR)/hostspec.h \ $(GFARMLIB_SRCDIR)/host.h \ $(GFARMLIB_SRCDIR)/auth.h \ $(GFARMLIB_SRCDIR)/config.h \ $(GFARMLIB_SRCDIR)/gfs_proto.h \ $(GFARMLIB_SRCDIR)/gfs_client.h \ $(GFARMLIB_SRCDIR)/gfm_proto.h \ $(GFARMLIB_SRCDIR)/gfm_client.h \ $(srcdir)/gfsd_subr.h gfarm-2.4.1/server/gfsd/gfsd.c0000644000000000000000000040335311507222724014642 0ustar rootroot/* * $Id: gfsd.c 5018 2010-12-30 08:35:34Z tatebe $ */ #define _POSIX_PII_SOCKET /* to use struct msghdr on Tru64 */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #if defined(SCM_RIGHTS) && \ (!defined(sun) || (!defined(__svr4__) && !defined(__SVR4))) #define HAVE_MSG_CONTROL 1 #endif #if !defined(WCOREDUMP) && defined(_AIX) #define WCOREDUMP(status) ((status) & 0x80) #endif #ifndef SHUT_WR /* some really old OS doesn't define this symbol. */ #define SHUT_WR 1 #endif #include #include #ifdef HAVE_SYS_LOADAVG_H #include /* getloadavg() on Solaris */ #endif #define GFLOG_USE_STDARG #include #include #include #include #include #include "gfutil.h" #include "gfnetdb.h" #include "hash.h" #include "iobuffer.h" #include "gfp_xdr.h" #include "io_fd.h" #include "param.h" #include "sockopt.h" #include "hostspec.h" #include "host.h" #include "conn_hash.h" #include "auth.h" #include "config.h" #include "gfs_proto.h" #include "gfs_client.h" #include "gfm_proto.h" #include "gfm_client.h" #include "gfsd_subr.h" #define COMPAT_OLD_GFS_PROTOCOL #ifndef DEFAULT_PATH #define DEFAULT_PATH "PATH=/usr/local/bin:/usr/bin:/bin:/usr/ucb:/usr/X11R6/bin:/usr/openwin/bin:/usr/pkg/bin" #endif #define GFARM_DEFAULT_PATH DEFAULT_PATH ":" GFARM_DEFAULT_BINDIR #ifndef PATH_BSHELL #define PATH_BSHELL "/bin/sh" #endif #define LOCAL_SOCKDIR_MODE 0755 #define LOCAL_SOCKET_MODE 0777 #define PERMISSION_MASK 0777 /* need to be accessed as an executable (in future, e.g. after chmod) */ #define DATA_FILE_MASK 0711 #define DATA_DIR_MASK 0700 #ifdef SOMAXCONN #define LISTEN_BACKLOG SOMAXCONN #else #define LISTEN_BACKLOG 5 #endif /* limit maximum open files per client, when system limit is very high */ #ifndef FILE_TABLE_LIMIT #define FILE_TABLE_LIMIT 2048 #endif #define HOST_HASHTAB_SIZE 3079 /* prime number */ #define fatal(msg_no, ...) \ fatal_full(msg_no, __FILE__, __LINE__, __func__, __VA_ARGS__) #define fatal_errno(msg_no, ...) \ fatal_errno_full(msg_no, __FILE__, __LINE__, __func__, __VA_ARGS__) #define accepting_fatal(msg_no, ...) \ accepting_fatal_full(msg_no, __FILE__, __LINE__, __func__, __VA_ARGS__) #define accepting_fatal_errno(msg_no, ...) \ accepting_fatal_errno_full(msg_no, __FILE__, __LINE__, __func__,\ __VA_ARGS__) const char READONLY_CONFIG_FILE[] = ".readonly"; const char *program_name = "gfsd"; int debug_mode = 0; pid_t master_gfsd_pid; pid_t back_channel_gfsd_pid; int restrict_user = 0; uid_t restricted_user = 0; uid_t gfsd_uid = -1; mode_t command_umask; struct gfm_connection *gfm_server; char *canonical_self_name; char *username; /* gfarm global user name */ struct gfp_xdr *credential_exported = NULL; long file_read_size; #if 0 /* not yet in gfarm v2 */ long rate_limit; #endif static char *listen_addrname = NULL; struct local_socket { int sock; char *dir, *name; }; struct accepting_sockets { int local_socks_count, udp_socks_count; int tcp_sock, *udp_socks; struct local_socket *local_socks; } accepting; /* this routine should be called before the accepting server calls exit(). */ void cleanup_accepting(int sighandler) { int i; for (i = 0; i < accepting.local_socks_count; i++) { if (unlink(accepting.local_socks[i].name) == -1 && !sighandler) gflog_warning(GFARM_MSG_1002378, "unlink(%s)", accepting.local_socks[i].name); if (rmdir(accepting.local_socks[i].dir) == -1 && !sighandler) gflog_warning(GFARM_MSG_1002379, "rmdir(%s)", accepting.local_socks[i].dir); } } static void close_all_fd(void); /* this routine should be called before calling exit(). */ static void cleanup(int sighandler) { static int cleanup_started = 0; pid_t pid = getpid(); if (!cleanup_started) { cleanup_started = 1; if (pid != master_gfsd_pid && pid != back_channel_gfsd_pid && !sighandler) close_all_fd(); /* may recursivelly call cleanup() */ } if (pid == master_gfsd_pid) { cleanup_accepting(sighandler); /* send terminate signal to a back channel process */ if (kill(back_channel_gfsd_pid, SIGTERM) == -1 && !sighandler) gflog_warning_errno(GFARM_MSG_1002377, "kill(%d)", back_channel_gfsd_pid); } if (credential_exported != NULL) gfp_xdr_delete_credential(credential_exported, sighandler); credential_exported = NULL; if (!sighandler) { /* It's not safe to do the following operation */ gflog_notice(GFARM_MSG_1000451, "disconnected"); } } static void cleanup_handler(int signo) { cleanup(1); _exit(2); } static int kill_master_gfsd; static void fatal_full(int, const char *, int, const char *, const char *, ...) GFLOG_PRINTF_ARG(5, 6); static void fatal_full(int msg_no, const char *file, int line_no, const char *func, const char *format, ...) { va_list ap; va_start(ap, format); gflog_vmessage(msg_no, LOG_ERR, file, line_no, func, format, ap); va_end(ap); cleanup(0); if (getpid() == back_channel_gfsd_pid || kill_master_gfsd) { /* * send terminate signal to the master process. * this should be done at the end of fatal(), * because both the master process and the back channel process * try to kill each other. */ kill(master_gfsd_pid, SIGTERM); } exit(2); } static void fatal_errno_full(int, const char *, int, const char*, const char *, ...) GFLOG_PRINTF_ARG(5, 6); static void fatal_errno_full(int msg_no, const char *file, int line_no, const char *func, const char *format, ...) { char buffer[2048]; va_list ap; va_start(ap, format); vsnprintf(buffer, sizeof buffer, format, ap); va_end(ap); fatal_full(msg_no, file, line_no, func, "%s: %s", buffer, strerror(errno)); } void fatal_metadb_proto_full(int msg_no, const char *file, int line_no, const char *func, const char *diag, const char *proto, gfarm_error_t e) { fatal_full(msg_no, file, line_no, func, "gfmd protocol: %s error on %s: %s", proto, diag, gfarm_error_string(e)); } static void accepting_fatal_full(int, const char *, int, const char *, const char *, ...) GFLOG_PRINTF_ARG(5, 6); static void accepting_fatal_full(int msg_no, const char *file, int line_no, const char *func, const char *format, ...) { va_list ap; cleanup_accepting(0); va_start(ap, format); gflog_vmessage(msg_no, LOG_ERR, file, line_no, func, format, ap); va_end(ap); exit(2); } static void accepting_fatal_errno_full(int, const char *, int, const char *, const char *, ...) GFLOG_PRINTF_ARG(5, 6); static void accepting_fatal_errno_full(int msg_no, const char *file, int line_no, const char *func, const char *format, ...) { int save_errno = errno; char buffer[2048]; va_list ap; va_start(ap, format); vsnprintf(buffer, sizeof buffer, format, ap); va_end(ap); accepting_fatal_full(msg_no, file, line_no, func, "%s: %s", buffer, strerror(save_errno)); } static int fd_send_message(int fd, void *buf, size_t size, int fdc, int *fdv) { char *buffer = buf; int i, rv; struct iovec iov[1]; struct msghdr msg; #ifdef HAVE_MSG_CONTROL /* 4.3BSD Reno or later */ struct { struct cmsghdr hdr; char data[CMSG_SPACE(sizeof(*fdv) * GFSD_MAX_PASSING_FD) - sizeof(struct cmsghdr)]; } cmsg; if (fdc > GFSD_MAX_PASSING_FD) { fatal(GFARM_MSG_1000453, "gfsd: fd_send_message(): fd count %d > %d", fdc, GFSD_MAX_PASSING_FD); return (EINVAL); } #endif while (size > 0) { iov[0].iov_base = buffer; iov[0].iov_len = size; msg.msg_iov = iov; msg.msg_iovlen = 1; msg.msg_name = NULL; msg.msg_namelen = 0; msg.msg_flags = 0; #ifndef HAVE_MSG_CONTROL if (fdc > 0) { msg.msg_accrights = (caddr_t)fdv; msg.msg_accrightslen = sizeof(*fdv) * fdc; } else { msg.msg_accrights = NULL; msg.msg_accrightslen = 0; } #else /* 4.3BSD Reno or later */ if (fdc > 0) { msg.msg_control = (caddr_t)&cmsg.hdr; msg.msg_controllen = CMSG_SPACE(sizeof(*fdv) * fdc); cmsg.hdr.cmsg_len = CMSG_LEN(sizeof(*fdv) * fdc); cmsg.hdr.cmsg_level = SOL_SOCKET; cmsg.hdr.cmsg_type = SCM_RIGHTS; for (i = 0; i < fdc; i++) ((int *)CMSG_DATA(&cmsg.hdr))[i] = fdv[i]; /* to shut up valgrind's "uninitialised byte(s)" */ if (CMSG_SPACE(sizeof(*fdv) * fdc) > CMSG_LEN(sizeof(*fdv) * fdc)) memset(&((int *)CMSG_DATA(&cmsg.hdr))[fdc], 0, CMSG_SPACE(sizeof(*fdv) * fdc) - CMSG_LEN(sizeof(*fdv) * fdc)); } else { msg.msg_control = NULL; msg.msg_controllen = 0; } #endif rv = sendmsg(fd, &msg, 0); if (rv == -1) { if (errno == EINTR) continue; return (errno); /* failure */ } fdc = 0; fdv = NULL; buffer += rv; size -= rv; } return (0); /* success */ } void gfs_server_get_request(struct gfp_xdr *client, const char *diag, const char *format, ...) { va_list ap; gfarm_error_t e; va_start(ap, format); e = gfp_xdr_vrecv_request_parameters(client, 0, NULL, format, &ap); va_end(ap); if (e != GFARM_ERR_NO_ERROR) fatal(GFARM_MSG_1000455, "%s get request: %s", diag, gfarm_error_string(e)); } void gfs_server_put_reply_common(struct gfp_xdr *client, const char *diag, gfp_xdr_xid_t xid, gfarm_int32_t ecode, const char *format, va_list *app) { gfarm_error_t e; if (debug_mode) gflog_debug(GFARM_MSG_1000458, "reply: %s: %d (%s)", diag, (int)ecode, gfarm_error_string(ecode)); e = gfp_xdr_vsend_result(client, ecode, format, app); if (e == GFARM_ERR_NO_ERROR) e = gfp_xdr_flush(client); if (e != GFARM_ERR_NO_ERROR) fatal(GFARM_MSG_1000459, "%s put reply: %s", diag, gfarm_error_string(e)); /* if input/output error occurs, die */ if (ecode == GFARM_ERR_INPUT_OUTPUT) { kill_master_gfsd = 1; fatal(GFARM_MSG_1002513, "%s: %s, die", diag, gfarm_error_string(e)); } } void gfs_server_put_reply_with_errno_common(struct gfp_xdr *client, const char *diag, gfp_xdr_xid_t xid, int eno, const char *format, va_list *app) { gfarm_int32_t ecode = gfarm_errno_to_error(eno); if (ecode == GFARM_ERR_UNKNOWN) gflog_warning(GFARM_MSG_1000461, "%s: %s", diag, strerror(eno)); gfs_server_put_reply_common(client, diag, xid, ecode, format, app); } void gfs_server_put_reply(struct gfp_xdr *client, const char *diag, int ecode, char *format, ...) { va_list ap; va_start(ap, format); gfs_server_put_reply_common(client, diag, -1, ecode, format, &ap); va_end(ap); } void gfs_server_put_reply_with_errno(struct gfp_xdr *client, const char *diag, int eno, char *format, ...) { va_list ap; va_start(ap, format); gfs_server_put_reply_with_errno_common(client, diag, -1, eno, format, &ap); va_end(ap); } gfarm_error_t gfs_async_server_get_request(struct gfp_xdr *client, size_t size, const char *diag, const char *format, ...) { va_list ap; gfarm_error_t e; va_start(ap, format); e = gfp_xdr_vrecv_request_parameters(client, 0, &size, format, &ap); va_end(ap); if (e != GFARM_ERR_NO_ERROR) gflog_error(GFARM_MSG_1002380, "%s get request: %s", diag, gfarm_error_string(e)); return (e); } gfarm_error_t gfs_async_server_put_reply_common(struct gfp_xdr *client, gfp_xdr_xid_t xid, const char *diag, gfarm_error_t ecode, char *format, va_list *app) { gfarm_error_t e; if (debug_mode) gflog_debug(GFARM_MSG_1002381, "async_reply: %s: %d (%s)", diag, (int)ecode, gfarm_error_string(ecode)); e = gfp_xdr_vsend_async_result(client, xid, ecode, format, app); if (e == GFARM_ERR_NO_ERROR) e = gfp_xdr_flush(client); if (e != GFARM_ERR_NO_ERROR) gflog_error(GFARM_MSG_1002382, "%s put reply: %s", diag, gfarm_error_string(e)); return (e); } gfarm_error_t gfs_async_server_put_reply(struct gfp_xdr *client, gfp_xdr_xid_t xid, const char *diag, gfarm_error_t ecode, char *format, ...) { va_list ap; gfarm_error_t e; va_start(ap, format); e = gfs_async_server_put_reply_common(client, xid, diag, ecode, format, &ap); va_end(ap); return (e); } gfarm_error_t gfs_async_server_put_reply_with_errno(struct gfp_xdr *client, gfp_xdr_xid_t xid, const char *diag, int eno, char *format, ...) { va_list ap; gfarm_int32_t ecode = gfarm_errno_to_error(eno); gfarm_error_t e; if (ecode == GFARM_ERR_UNKNOWN) gflog_warning(GFARM_MSG_1002383, "%s: %s", diag, strerror(eno)); va_start(ap, format); e = gfs_async_server_put_reply_common(client, xid, diag, ecode, format, &ap); va_end(ap); return (e); } gfarm_error_t gfm_async_client_send_request(struct gfp_xdr *bc_conn, gfp_xdr_async_peer_t async, const char *diag, gfarm_int32_t (*result_callback)(void *, void *, size_t), void (*disconnect_callback)(void *, void *), void *closure, gfarm_int32_t command, const char *format, ...) { gfarm_error_t e; va_list ap; va_start(ap, format); e = gfp_xdr_vsend_async_request(bc_conn, async, result_callback, disconnect_callback, closure, command, format, &ap); va_end(ap); if (e != GFARM_ERR_NO_ERROR) gflog_error(GFARM_MSG_1002164, "gfm_async_client_send_request %s: %s", diag, gfarm_error_string(e)); return (e); } gfarm_error_t gfm_async_client_recv_reply(struct gfp_xdr *bc_conn, const char *diag, size_t size, const char *format, ...) { gfarm_error_t e; gfarm_int32_t errcode; va_list ap; va_start(ap, format); e = gfp_xdr_vrpc_result_sized(bc_conn, 0, &size, &errcode, &format, &ap); va_end(ap); if (e != GFARM_ERR_NO_ERROR) { gflog_error(GFARM_MSG_1002165, "gfm_async_client_recv_reply %s: %s", diag, gfarm_error_string(e)); } else if (size != 0) { gflog_error(GFARM_MSG_1002166, "gfm_async_client_recv_reply %s: protocol residual %d", diag, (int)size); if ((e = gfp_xdr_purge(bc_conn, 0, size)) != GFARM_ERR_NO_ERROR) gflog_warning(GFARM_MSG_1002167, "gfm_async_client_recv_reply %s: skipping: %s", diag, gfarm_error_string(e)); e = GFARM_ERR_PROTOCOL; } else { e = errcode; } return (e); } void gfs_server_process_set(struct gfp_xdr *client) { gfarm_int32_t e; gfarm_pid_t pid; gfarm_int32_t keytype; size_t keylen; char sharedkey[GFM_PROTO_PROCESS_KEY_LEN_SHAREDSECRET]; gfs_server_get_request(client, "process_set", "ibl", &keytype, sizeof(sharedkey), &keylen, sharedkey, &pid); e = gfm_client_process_set(gfm_server, keytype, sharedkey, keylen, pid); gfs_server_put_reply(client, "process_set", e, ""); } int file_table_size = 0; struct file_entry { off_t size; time_t mtime, atime; /* XXX FIXME tv_nsec */ gfarm_ino_t ino; int flags, local_fd; #define FILE_FLAG_LOCAL 0x01 #define FILE_FLAG_CREATED 0x02 #define FILE_FLAG_WRITABLE 0x04 #define FILE_FLAG_WRITTEN 0x08 #define FILE_FLAG_READ 0x10 } *file_table; static void file_entry_set_atime(struct file_entry *fe, gfarm_time_t sec, gfarm_int32_t nsec) { fe->flags |= FILE_FLAG_READ; fe->atime = sec; /* XXX FIXME st_atimespec.tv_nsec */ } static void file_entry_set_mtime(struct file_entry *fe, gfarm_time_t sec, gfarm_int32_t nsec) { fe->flags |= FILE_FLAG_WRITTEN; fe->mtime = sec; /* XXX FIXME st_mtimespec.tv_nsec */ } static void file_entry_set_size(struct file_entry *fe, gfarm_off_t size) { fe->flags |= FILE_FLAG_WRITTEN; fe->size = size; } void file_table_init(int table_size) { int i; GFARM_MALLOC_ARRAY(file_table, table_size); if (file_table == NULL) { errno = ENOMEM; fatal_errno(GFARM_MSG_1000462, "file table"); } for (i = 0; i < table_size; i++) file_table[i].local_fd = -1; file_table_size = table_size; } int file_table_is_available(gfarm_int32_t net_fd) { if (0 <= net_fd && net_fd < file_table_size) return (file_table[net_fd].local_fd == -1); else return (0); } void file_table_add(gfarm_int32_t net_fd, int local_fd, int flags, gfarm_ino_t ino) { struct file_entry *fe; struct stat st; if (fstat(local_fd, &st) < 0) fatal_errno(GFARM_MSG_1000463, "file_table_add: fstat failed"); fe = &file_table[net_fd]; fe->local_fd = local_fd; fe->flags = 0; fe->ino = ino; if (flags & O_CREAT) fe->flags |= FILE_FLAG_CREATED; if (flags & O_TRUNC) fe->flags |= FILE_FLAG_WRITTEN; if ((flags & O_ACCMODE) != O_RDONLY) fe->flags |= FILE_FLAG_WRITABLE; fe->atime = st.st_atime; /* XXX FIXME st_atimespec.tv_nsec */ fe->mtime = st.st_mtime; /* XXX FIXME st_mtimespec.tv_nsec */ fe->size = st.st_size; } gfarm_error_t file_table_close(gfarm_int32_t net_fd) { gfarm_error_t e; if (net_fd < 0 || net_fd >= file_table_size || file_table[net_fd].local_fd == -1) { gflog_debug(GFARM_MSG_1002168, "bad file descriptor"); return (GFARM_ERR_BAD_FILE_DESCRIPTOR); } if (close(file_table[net_fd].local_fd) < 0) e = gfarm_errno_to_error(errno); else e = GFARM_ERR_NO_ERROR; file_table[net_fd].local_fd = -1; return (e); } int file_table_get(gfarm_int32_t net_fd) { if (0 <= net_fd && net_fd < file_table_size) return (file_table[net_fd].local_fd); else return (-1); } struct file_entry * file_table_entry(gfarm_int32_t net_fd) { if (0 <= net_fd && net_fd < file_table_size) return (&file_table[net_fd]); else return (NULL); } static void file_table_set_flag(gfarm_int32_t net_fd, int flags) { struct file_entry *fe = file_table_entry(net_fd); if (fe != NULL) fe->flags |= flags; } static void file_table_set_read(gfarm_int32_t net_fd) { struct file_entry *fe = file_table_entry(net_fd); struct timeval now; if (fe == NULL) return; gettimeofday(&now, NULL); file_entry_set_atime(fe, now.tv_sec, 0); } static void file_table_set_written(gfarm_int32_t net_fd) { struct file_entry *fe = file_table_entry(net_fd); struct timeval now; if (fe == NULL) return; gettimeofday(&now, NULL); file_entry_set_mtime(fe, now.tv_sec, 0); } static void file_table_for_each(void (*callback)(void *, gfarm_int32_t), void *closure) { gfarm_int32_t net_fd; if (file_table == NULL) return; for (net_fd = 0; net_fd < file_table_size; net_fd++) { if (file_table[net_fd].local_fd != -1) (*callback)(closure, net_fd); } } int gfs_open_flags_localize(int open_flags) { int local_flags; switch (open_flags & GFARM_FILE_ACCMODE) { case GFARM_FILE_RDONLY: local_flags = O_RDONLY; break; case GFARM_FILE_WRONLY: local_flags = O_WRONLY; break; case GFARM_FILE_RDWR: local_flags = O_RDWR; break; default: return (-1); } #if 0 if ((open_flags & GFARM_FILE_CREATE) != 0) local_flags |= O_CREAT; #endif if ((open_flags & GFARM_FILE_TRUNC) != 0) local_flags |= O_TRUNC; #if 0 /* not yet in gfarm v2 */ if ((open_flags & GFARM_FILE_APPEND) != 0) local_flags |= O_APPEND; if ((open_flags & GFARM_FILE_EXCLUSIVE) != 0) local_flags |= O_EXCL; #endif /* not yet in gfarm v2 */ return (local_flags); } /* * if inum == 0x0011223344556677, and gen == 0X8899AABBCCDDEEFF, then * local_path = gfarm_spool_root + "data/00112233/44/55/66/778899AABBCCDDEEFF". * * If the metadata server uses inum > 0x700000000000, * We need a modern filesystem which satisfies follows: * - can create more than 32765 (= 32767 - 1 (for current) - 1 (for parent)) * subdirectories. * 32767 comes from platforms which st_nlink is 16bit signed integer. * ext2/ext3fs can create only 32000 subdirectories at maximum. * - uses B-tree or similar mechanism to search directory entries * to avoid overhead of linear search. */ void local_path(gfarm_ino_t inum, gfarm_uint64_t gen, const char *diag, char **pathp) { char *p; static int length = 0; static char template[] = "/data/00112233/44/55/66/778899AABBCCDDEEFF"; #define DIRLEVEL 5 /* there are 5 levels of directories in template[] */ if (length == 0) length = strlen(gfarm_spool_root) + sizeof(template); GFARM_MALLOC_ARRAY(p, length); if (p == NULL) { fatal(GFARM_MSG_1000464, "%s: no memory for %d bytes", diag, length); } snprintf(p, length, "%s/data/%08X/%02X/%02X/%02X/%02X%08X%08X", gfarm_spool_root, (unsigned int)((inum >> 32) & 0xffffffff), (unsigned int)((inum >> 24) & 0xff), (unsigned int)((inum >> 16) & 0xff), (unsigned int)((inum >> 8) & 0xff), (unsigned int)( inum & 0xff), (unsigned int)((gen >> 32) & 0xffffffff), (unsigned int)( gen & 0xffffffff)); *pathp = p; } int open_data(char *path, int flags) { int i, j, tail, slashpos[DIRLEVEL]; int fd = open(path, flags, DATA_FILE_MASK); struct stat st; if (fd >= 0) return (fd); if ((flags & O_CREAT) == 0 || errno != ENOENT) return (-1); /* with errno */ /* errno == ENOENT, so, maybe we don't have an ancestor directory */ tail = strlen(path); for (i = 0; i < DIRLEVEL; i++) { for (--tail; tail > 0 && path[tail] != '/'; --tail) ; if (tail <= 0) { gflog_warning(GFARM_MSG_1000465, "something wrong in local_path(): %s\n", path); errno = ENOENT; return (-1); } assert(path[tail] == '/'); slashpos[i] = tail; path[tail] = '\0'; if (stat(path, &st) == 0) { /* maybe race? */ } else if (errno != ENOENT) { gflog_warning(GFARM_MSG_1000466, "stat(`%s') failed: %s", path, strerror(errno)); errno = ENOENT; return (-1); } else if (mkdir(path, DATA_DIR_MASK) < 0) { if (errno == ENOENT) continue; if (errno == EEXIST) { /* maybe race */ } else { gflog_warning(GFARM_MSG_1000467, "mkdir(`%s') failed: %s", path, strerror(errno)); errno = ENOENT; return (-1); } } /* Now, we have the ancestor directory */ for (j = i;; --j) { path[slashpos[j]] = '/'; if (j <= 0) break; if (mkdir(path, DATA_DIR_MASK) < 0) { if (errno == EEXIST) /* maybe race */ continue; gflog_warning(GFARM_MSG_1000468, "unexpected mkdir(`%s') failure: %s", path, strerror(errno)); errno = ENOENT; return (-1); } } return (open(path, flags, DATA_FILE_MASK)); /* with errno */ } gflog_warning(GFARM_MSG_1000469, "gfsd spool_root doesn't exist?: %s\n", path); errno = ENOENT; return (-1); } static void gfm_client_compound_put_fd_request(gfarm_int32_t net_fd, const char *diag) { gfarm_error_t e; if ((e = gfm_client_compound_begin_request(gfm_server)) != GFARM_ERR_NO_ERROR) fatal_metadb_proto(GFARM_MSG_1002291, "compound_begin request", diag, e); else if ((e = gfm_client_put_fd_request(gfm_server, net_fd)) != GFARM_ERR_NO_ERROR) fatal_metadb_proto(GFARM_MSG_1002292, "put_fd request", diag, e); } static void gfm_client_compound_put_fd_result(const char *diag) { gfarm_error_t e; if ((e = gfm_client_compound_end_request(gfm_server)) != GFARM_ERR_NO_ERROR) fatal_metadb_proto(GFARM_MSG_1002293, "compound_end request", diag, e); else if ((e = gfm_client_compound_begin_result(gfm_server)) != GFARM_ERR_NO_ERROR) fatal_metadb_proto(GFARM_MSG_1002294, "compound_begin result", diag, e); else if ((e = gfm_client_put_fd_result(gfm_server)) != GFARM_ERR_NO_ERROR) fatal_metadb_proto(GFARM_MSG_1002295, "put_fd result", diag, e); } static int gfm_client_compound_end(const char *diag) { gfarm_error_t e; if ((e = gfm_client_compound_end_result(gfm_server)) != GFARM_ERR_NO_ERROR) fatal_metadb_proto(GFARM_MSG_1002296, "compound_end result", diag, e); return (1); } static gfarm_error_t gfs_server_reopen(char *diag, gfarm_int32_t net_fd, char **pathp, int *flagsp, gfarm_ino_t *inop, gfarm_uint64_t *genp) { gfarm_error_t e; gfarm_ino_t ino; gfarm_uint64_t gen; gfarm_int32_t mode, net_flags, to_create; char *path; int local_flags; gfm_client_compound_put_fd_request(net_fd, diag); if ((e = gfm_client_reopen_request(gfm_server)) != GFARM_ERR_NO_ERROR) fatal_metadb_proto(GFARM_MSG_1000472, "reopen request", diag, e); gfm_client_compound_put_fd_result(diag); if ((e = gfm_client_reopen_result(gfm_server, &ino, &gen, &mode, &net_flags, &to_create)) != GFARM_ERR_NO_ERROR) { if (debug_mode) gflog_info(GFARM_MSG_1000476, "reopen(%s) result: %s", diag, gfarm_error_string(e)); } else if (!gfm_client_compound_end(diag)) /*NOTREACHED*/; else if (!GFARM_S_ISREG(mode)) { e = GFARM_ERR_OPERATION_NOT_PERMITTED; gflog_debug(GFARM_MSG_1002169, "mode:operation is not permitted"); } else if ((local_flags = gfs_open_flags_localize(net_flags)) == -1) { e = GFARM_ERR_OPERATION_NOT_PERMITTED; gflog_debug(GFARM_MSG_1002170, "local_flags:operation is not permitted"); } else { local_path(ino, gen, diag, &path); if (to_create) local_flags |= O_CREAT; *pathp = path; *flagsp = local_flags; *inop = ino; *genp = gen; } return (e); } gfarm_error_t replica_lost(gfarm_ino_t ino, gfarm_uint64_t gen) { gfarm_error_t e; static const char diag[] = "GFM_PROTO_REPLICA_LOST"; if ((e = gfm_client_replica_lost_request(gfm_server, ino, gen)) != GFARM_ERR_NO_ERROR) fatal_metadb_proto(GFARM_MSG_1000478, "replica_lost request", diag, e); else if ((e = gfm_client_replica_lost_result(gfm_server)) != GFARM_ERR_NO_ERROR && e != GFARM_ERR_NO_SUCH_OBJECT) if (debug_mode) gflog_info(GFARM_MSG_1000479, "replica_lost(%s) result: %s", diag, gfarm_error_string(e)); return (e); } gfarm_error_t gfs_server_open_common(struct gfp_xdr *client, char *diag, gfarm_int32_t *net_fdp, int *local_fdp) { gfarm_error_t e; char *path = NULL; gfarm_ino_t ino = 0; gfarm_uint64_t gen = 0; int net_fd, local_fd, save_errno, local_flags = 0; gfs_server_get_request(client, diag, "i", &net_fd); if (!file_table_is_available(net_fd)) { e = GFARM_ERR_BAD_FILE_DESCRIPTOR; gflog_debug(GFARM_MSG_1002171, "bad file descriptor"); } else { for (;;) { if ((e = gfs_server_reopen(diag, net_fd, &path, &local_flags, &ino, &gen)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1002172, "gfs_server_reopen() failed: %s", gfarm_error_string(e)); break; } local_fd = open_data(path, local_flags); save_errno = errno; free(path); if (local_fd >= 0) { file_table_add(net_fd, local_fd, local_flags, ino); *net_fdp = net_fd; *local_fdp = local_fd; break; } gfm_client_compound_put_fd_request(net_fd, diag); if ((e = gfm_client_close_request(gfm_server)) != GFARM_ERR_NO_ERROR) fatal(GFARM_MSG_1002297, "%s: close(%d) request: %s", diag, net_fd, gfarm_error_string(e)); gfm_client_compound_put_fd_result(diag); if ((e = gfm_client_close_result(gfm_server)) != GFARM_ERR_NO_ERROR) gflog_info(GFARM_MSG_1002298, "%s: close(%d): %s", diag, net_fd, gfarm_error_string(e)); else gfm_client_compound_end(diag); if (save_errno == ENOENT) { e = replica_lost(ino, gen); if (e == GFARM_ERR_NO_SUCH_OBJECT) { gflog_debug(GFARM_MSG_1002299, "possible race between " "rename & reopen: " "ino %lld, gen %lld", (long long)ino, (long long)gen); continue; } if (e == GFARM_ERR_NO_ERROR) { gflog_info(GFARM_MSG_1000480, "invalid metadata deleted: " "ino %lld, gen %lld", (long long)ino, (long long)gen); /* * the physical file is lost. * return GFARM_ERR_FILE_MIGRATED to * try another available file. */ e = GFARM_ERR_FILE_MIGRATED; break; } else gflog_warning(GFARM_MSG_1000481, "fails to delete invalid metadata" ": ino %lld, gen %lld: %s", (long long)ino, (long long)gen, gfarm_error_string(e)); } e = gfarm_errno_to_error(save_errno); break; } } gfs_server_put_reply(client, diag, e, ""); return (e); } void gfs_server_open(struct gfp_xdr *client) { gfarm_int32_t net_fd; int local_fd; gfs_server_open_common(client, "open", &net_fd, &local_fd); } void gfs_server_open_local(struct gfp_xdr *client) { gfarm_error_t e; gfarm_int32_t net_fd; int local_fd, rv; gfarm_int8_t dummy = 0; /* needs at least 1 byte */ if (gfs_server_open_common(client, "open_local", &net_fd, &local_fd) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1002173, "gfs_server_open_common() failed"); return; } /* need to flush iobuffer before sending data w/o iobuffer */ e = gfp_xdr_flush(client); if (e != GFARM_ERR_NO_ERROR) gflog_warning(GFARM_MSG_1000482, "open_local: flush: %s", gfarm_error_string(e)); /* layering violation, but... */ rv = fd_send_message(gfp_xdr_fd(client), &dummy, sizeof(dummy), 1, &local_fd); if (rv != 0) gflog_warning(GFARM_MSG_1000483, "open_local: send_message: %s", strerror(rv)); file_table_set_flag(net_fd, FILE_FLAG_LOCAL); } gfarm_error_t close_request(struct file_entry *fe) { if (fe->flags & FILE_FLAG_WRITTEN) { return (gfm_client_close_write_v2_4_request(gfm_server, fe->size, (gfarm_int64_t)fe->atime, (gfarm_int32_t)0, (gfarm_int64_t)fe->mtime, (gfarm_int32_t)0)); /* XXX FIXME st_atimespec.tv_nsec */ /* XXX FIXME st_mtimespec.tv_nsec */ } else if (fe->flags & FILE_FLAG_READ) { return (gfm_client_close_read_request(gfm_server, (gfarm_int64_t)fe->atime, (gfarm_int32_t)0)); /* XXX FIXME st_atimespec.tv_nsec */ } else { return (gfm_client_close_request(gfm_server)); } } gfarm_error_t close_result(struct file_entry *fe, gfarm_int32_t *gen_update_result_p) { if (fe->flags & FILE_FLAG_WRITTEN) { gfarm_error_t e; gfarm_int32_t flags; gfarm_int64_t old_gen, new_gen; char *old, *new; e = gfm_client_close_write_v2_4_result(gfm_server, &flags, &old_gen, &new_gen); if (e == GFARM_ERR_NO_ERROR && (flags & GFM_PROTO_CLOSE_WRITE_GENERATION_UPDATE_NEEDED)) { local_path(fe->ino, old_gen, "close_write: old", &old); local_path(fe->ino, new_gen, "close_write: new", &new); *gen_update_result_p = rename(old, new) == -1 ? errno : 0; if (*gen_update_result_p != 0) { gflog_error(GFARM_MSG_1002300, "close_write: new generation: " "%llu -> %llu: %s", (unsigned long long)old_gen, (unsigned long long)new_gen, strerror(*gen_update_result_p)); } free(old); free(new); } else *gen_update_result_p = -1; return (e); } else if (fe->flags & FILE_FLAG_READ) { *gen_update_result_p = -1; return (gfm_client_close_read_result(gfm_server)); } else { *gen_update_result_p = -1; return (gfm_client_close_result(gfm_server)); } } gfarm_error_t close_fd(gfarm_int32_t fd, const char *diag) { gfarm_error_t e, e2; int stat_is_done = 0; struct file_entry *fe; struct stat st; gfarm_int32_t gen_update_result = -1; if ((fe = file_table_entry(fd)) == NULL) { e = GFARM_ERR_BAD_FILE_DESCRIPTOR; gflog_debug(GFARM_MSG_1002174, "bad file descriptor"); } else { if ((fe->flags & FILE_FLAG_LOCAL) == 0) { /* remote? */ ; } else if (fstat(fe->local_fd, &st) == -1) { gflog_warning(GFARM_MSG_1000484, "fd %d: stat failed at close: %s", fd, strerror(errno)); } else { stat_is_done = 1; /* XXX FIXME st_atimespec.tv_nsec */ if (st.st_atime != fe->atime) file_entry_set_atime(fe, st.st_atime, 0); /* another process might write this file */ if ((fe->flags & FILE_FLAG_WRITABLE) != 0) { /* XXX FIXME st_mtimespec.tv_nsec */ if (st.st_mtime != fe->mtime) file_entry_set_mtime(fe, st.st_mtime, 0); if (st.st_size != fe->size) file_entry_set_size(fe, st.st_size); /* XXX FIXME this may be caused by others */ } } if ((fe->flags & FILE_FLAG_WRITTEN) != 0 && !stat_is_done) { if (fstat(fe->local_fd, &st) == -1) gflog_warning(GFARM_MSG_1000485, "fd %d: stat failed at close: %s", fd, strerror(errno)); else fe->size = st.st_size; } gfm_client_compound_put_fd_request(fd, diag); if ((e = close_request(fe)) != GFARM_ERR_NO_ERROR) fatal_metadb_proto(GFARM_MSG_1000488, "close request", diag, e); gfm_client_compound_put_fd_result(diag); if ((e = close_result(fe, &gen_update_result)) != GFARM_ERR_NO_ERROR) { if (debug_mode) gflog_info(GFARM_MSG_1000492, "close(%s) result: %s", diag, gfarm_error_string(e)); } else gfm_client_compound_end(diag); if (gen_update_result != -1) { gfm_client_compound_put_fd_request(fd, diag); if ((e2 = gfm_client_generation_updated_request( gfm_server, gen_update_result)) != GFARM_ERR_NO_ERROR) fatal_metadb_proto(GFARM_MSG_1002301, "generation_updated request", diag, e2); gfm_client_compound_put_fd_result(diag); if ((e2 = gfm_client_generation_updated_result( gfm_server)) != GFARM_ERR_NO_ERROR) gflog_error(GFARM_MSG_1002302, "generation_updated result: %s", gfarm_error_string(e2)); else gfm_client_compound_end(diag); if (e == GFARM_ERR_NO_ERROR) e = e2; } e2 = file_table_close(fd); if (e == GFARM_ERR_NO_ERROR) e = e2; } return (e); } static void close_fd_adapter(void *closure, gfarm_int32_t fd) { close_fd(fd, closure); } static void close_all_fd(void) { file_table_for_each(close_fd_adapter, "closing all descriptor"); } void gfs_server_close(struct gfp_xdr *client) { gfarm_error_t e; gfarm_int32_t fd; static const char diag[] = "GFS_PROTO_CLOSE"; gfs_server_get_request(client, diag, "i", &fd); e = close_fd(fd, diag); gfs_server_put_reply(client, diag, e, ""); } void gfs_server_pread(struct gfp_xdr *client) { gfarm_int32_t fd, size; gfarm_int64_t offset; ssize_t rv; int save_errno = 0; char buffer[GFS_PROTO_MAX_IOSIZE]; gfs_server_get_request(client, "pread", "iil", &fd, &size, &offset); /* We truncatef i/o size bigger than GFS_PROTO_MAX_IOSIZE. */ if (size > GFS_PROTO_MAX_IOSIZE) size = GFS_PROTO_MAX_IOSIZE; #if 0 /* XXX FIXME: pwrite(2) on NetBSD-3.0_BETA is broken */ if ((rv = pread(file_table_get(fd), buffer, size, offset)) == -1) #else rv = 0; if (lseek(file_table_get(fd), offset, SEEK_SET) == -1) save_errno = errno; else if ((rv = read(file_table_get(fd), buffer, size)) == -1) #endif save_errno = errno; else file_table_set_read(fd); gfs_server_put_reply_with_errno(client, "pread", save_errno, "b", rv, buffer); } void gfs_server_pwrite(struct gfp_xdr *client) { gfarm_int32_t fd; size_t size; gfarm_int64_t offset; ssize_t rv; int save_errno = 0; char buffer[GFS_PROTO_MAX_IOSIZE]; gfs_server_get_request(client, "pwrite", "ibl", &fd, sizeof(buffer), &size, buffer, &offset); /* * We truncate i/o size bigger than GFS_PROTO_MAX_IOSIZE. * This is inefficient because passed extra data are just * abandoned. So client should avoid such situation. */ if (size > GFS_PROTO_MAX_IOSIZE) size = GFS_PROTO_MAX_IOSIZE; #if 0 /* XXX FIXME: pwrite(2) on NetBSD-3.0_BETA is broken */ if ((rv = pwrite(file_table_get(fd), buffer, size, offset)) == -1) #else rv = 0; if (lseek(file_table_get(fd), offset, SEEK_SET) == -1) save_errno = errno; else if ((rv = write(file_table_get(fd), buffer, size)) == -1) #endif save_errno = errno; else file_table_set_written(fd); gfs_server_put_reply_with_errno(client, "pwrite", save_errno, "i", (gfarm_int32_t)rv); } void gfs_server_ftruncate(struct gfp_xdr *client) { int fd; gfarm_int64_t length; int save_errno = 0; gfs_server_get_request(client, "ftruncate", "il", &fd, &length); if (ftruncate(file_table_get(fd), (off_t)length) == -1) save_errno = errno; else file_table_set_written(fd); gfs_server_put_reply_with_errno(client, "ftruncate", save_errno, ""); } void gfs_server_fsync(struct gfp_xdr *client) { int fd; int operation; int save_errno = 0; char *msg = "fsync"; gfs_server_get_request(client, msg, "ii", &fd, &operation); switch (operation) { case GFS_PROTO_FSYNC_WITHOUT_METADATA: #ifdef HAVE_FDATASYNC if (fdatasync(file_table_get(fd)) == -1) save_errno = errno; break; #else /*FALLTHROUGH*/ #endif case GFS_PROTO_FSYNC_WITH_METADATA: if (fsync(file_table_get(fd)) == -1) save_errno = errno; break; default: save_errno = EINVAL; break; } gfs_server_put_reply_with_errno(client, "fsync", save_errno, ""); } void gfs_server_fstat(struct gfp_xdr *client) { struct stat st; gfarm_int32_t fd; gfarm_off_t size = 0; gfarm_int64_t atime_sec = 0, mtime_sec = 0; gfarm_int32_t atime_nsec = 0, mtime_nsec = 0; int save_errno = 0; gfs_server_get_request(client, "fstat", "i", &fd); if (fstat(file_table_get(fd), &st) == -1) save_errno = errno; else { size = st.st_size; atime_sec = st.st_atime; /* XXX FIXME st_atimespec.tv_nsec */ mtime_sec = st.st_mtime; /* XXX FIXME st_mtimespec.tv_nsec */ } gfs_server_put_reply_with_errno(client, "fstat", save_errno, "llili", size, atime_sec, atime_nsec, mtime_sec, mtime_nsec); } void gfs_server_cksum_set(struct gfp_xdr *client) { gfarm_error_t e; int fd; gfarm_int32_t cksum_len; char *cksum_type; char cksum[GFM_PROTO_CKSUM_MAXLEN]; struct file_entry *fe; int was_written; time_t mtime; struct stat st; static const char diag[] = "GFS_PROTO_CKSUM_SET"; gfs_server_get_request(client, diag, "isb", &fd, &cksum_type, sizeof(cksum), &cksum_len, cksum); if ((fe = file_table_entry(fd)) == NULL) { e = GFARM_ERR_BAD_FILE_DESCRIPTOR; gflog_debug(GFARM_MSG_1002175, "bad file descriptor"); } else { /* NOTE: local client could use remote operation as well */ was_written = (fe->flags & FILE_FLAG_WRITTEN) != 0; mtime = fe->mtime; if ((fe->flags & FILE_FLAG_LOCAL) == 0) { /* remote? */ ; } else if (fstat(fe->local_fd, &st) == -1) { gflog_warning(GFARM_MSG_1000494, "fd %d: stat failed at cksum_set: %s", fd, strerror(errno)); } else { if (st.st_mtime != fe->mtime) { mtime = st.st_mtime; was_written = 1; } /* XXX FIXME st_mtimespec.tv_nsec */ } gfm_client_compound_put_fd_request(fd, diag); if ((e = gfm_client_cksum_set_request(gfm_server, cksum_type, cksum_len, cksum, was_written, (gfarm_int64_t)mtime, (gfarm_int32_t)0)) != GFARM_ERR_NO_ERROR) fatal_metadb_proto(GFARM_MSG_1000497, "cksum_set request", diag, e); gfm_client_compound_put_fd_result(diag); if ((e = gfm_client_cksum_set_result(gfm_server)) != GFARM_ERR_NO_ERROR) { if (debug_mode) gflog_info(GFARM_MSG_1000501, "cksum_set(%s) result: %s", diag, gfarm_error_string(e)); } else gfm_client_compound_end(diag); } gfs_server_put_reply(client, diag, e, ""); } static int is_readonly_mode(void) { struct stat st; int length; static char *p = NULL; static const char diag[] = "is_readonly_mode"; if (p == NULL) { length = strlen(gfarm_spool_root) + 1 + sizeof(READONLY_CONFIG_FILE); GFARM_MALLOC_ARRAY(p, length); if (p == NULL) fatal(GFARM_MSG_1000503, "%s: no memory for %d bytes", diag, length); snprintf(p, length, "%s/%s", gfarm_spool_root, READONLY_CONFIG_FILE); } return (stat(p, &st) == 0); } void gfs_server_statfs(struct gfp_xdr *client) { char *dir; int save_errno = 0; gfarm_int32_t bsize; gfarm_off_t blocks, bfree, bavail, files, ffree, favail; /* * do not use dir since there is no way to know gfarm_spool_root. * this code is kept for backward compatibility reason. */ gfs_server_get_request(client, "statfs", "s", &dir); save_errno = gfsd_statfs(gfarm_spool_root, &bsize, &blocks, &bfree, &bavail, &files, &ffree, &favail); free(dir); if (save_errno == 0 && is_readonly_mode()) { /* pretend to be disk full, to make this gfsd read-only */ bavail -= bfree; bfree = 0; } gfs_server_put_reply_with_errno(client, "statfs", save_errno, "illllll", bsize, blocks, bfree, bavail, files, ffree, favail); } static gfarm_error_t replica_adding(gfarm_int32_t net_fd, char *src_host, gfarm_ino_t *inop, gfarm_uint64_t *genp, gfarm_int64_t *mtime_secp, gfarm_int32_t *mtime_nsecp, const char *request) { gfarm_error_t e; gfarm_ino_t ino; gfarm_uint64_t gen; gfarm_int64_t mtime_sec; gfarm_int32_t mtime_nsec; static const char diag[] = "GFM_PROTO_REPLICA_ADDING"; gfm_client_compound_put_fd_request(net_fd, diag); if ((e = gfm_client_replica_adding_request(gfm_server, src_host)) != GFARM_ERR_NO_ERROR) fatal_metadb_proto(GFARM_MSG_1000506, request, diag, e); gfm_client_compound_put_fd_result(diag); if ((e = gfm_client_replica_adding_result(gfm_server, &ino, &gen, &mtime_sec, &mtime_nsec)) != GFARM_ERR_NO_ERROR) { if (debug_mode) gflog_info(GFARM_MSG_1000510, "%s result error on %s: %s", diag, request, gfarm_error_string(e)); } else if (!gfm_client_compound_end(diag)) /*NOTREACHED*/; else { *inop = ino; *genp = gen; *mtime_secp = mtime_sec; *mtime_nsecp = mtime_nsec; } return (e); } static gfarm_error_t replica_added(gfarm_int32_t net_fd, gfarm_int32_t flags, gfarm_int64_t mtime_sec, gfarm_int32_t mtime_nsec, gfarm_off_t size, const char *request) { gfarm_error_t e; static const char diag[] = "GFM_PROTO_REPLICA_ADDED2"; gfm_client_compound_put_fd_request(net_fd, diag); if ((e = gfm_client_replica_added2_request(gfm_server, flags, mtime_sec, mtime_nsec, size)) != GFARM_ERR_NO_ERROR) fatal_metadb_proto(GFARM_MSG_1000514, request, diag, e); gfm_client_compound_put_fd_result(diag); if ((e = gfm_client_replica_added_result(gfm_server)) != GFARM_ERR_NO_ERROR) { if (debug_mode) gflog_info(GFARM_MSG_1000518, "%s result on %s: %s", diag, request, gfarm_error_string(e)); } else gfm_client_compound_end(diag); return (e); } void gfs_server_replica_add_from(struct gfp_xdr *client) { gfarm_int32_t net_fd, local_fd, port, mtime_nsec = 0; gfarm_int64_t mtime_sec = 0; gfarm_ino_t ino = 0; gfarm_uint64_t gen = 0; gfarm_error_t e, e2; char *host, *path; struct gfs_connection *server; int flags = 0; /* XXX - for now */ struct stat sb; static const char diag[] = "GFS_PROTO_REPLICA_ADD_FROM"; sb.st_size = -1; gfs_server_get_request(client, diag, "sii", &host, &port, &net_fd); e = replica_adding(net_fd, host, &ino, &gen, &mtime_sec, &mtime_nsec, diag); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1002176, "replica_adding() failed: %s", gfarm_error_string(e)); goto free_host; } local_path(ino, gen, diag, &path); local_fd = open_data(path, O_WRONLY|O_CREAT|O_TRUNC); free(path); if (local_fd < 0) { e = gfarm_errno_to_error(errno); /* invalidate the creating file replica */ mtime_sec = mtime_nsec = 0; goto adding_cancel; } e = gfs_client_connection_acquire_by_host(gfm_server, host, port, &server, listen_addrname); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1002177, "gfs_client_connection_acquire_by_host() failed: %s", gfarm_error_string(e)); mtime_sec = mtime_nsec = 0; /* invalidate */ goto close; } e = gfs_client_replica_recv(server, ino, gen, local_fd); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1002178, "gfs_client_replica_recv() failed: %s", gfarm_error_string(e)); mtime_sec = mtime_nsec = 0; /* invalidate */ goto free_server; } if (fstat(local_fd, &sb) == -1) { e = gfarm_errno_to_error(errno); mtime_sec = mtime_nsec = 0; /* invalidate */ } free_server: gfs_client_connection_free(server); close: close(local_fd); adding_cancel: e2 = replica_added(net_fd, flags, mtime_sec, mtime_nsec, sb.st_size, diag); if (e == GFARM_ERR_NO_ERROR) e = e2; free_host: free(host); gfs_server_put_reply(client, diag, e, ""); return; } void gfs_server_replica_recv(struct gfp_xdr *client, enum gfarm_auth_id_type peer_type) { gfarm_error_t e, error = GFARM_ERR_NO_ERROR; gfarm_ino_t ino; gfarm_uint64_t gen; ssize_t rv; char buffer[GFS_PROTO_MAX_IOSIZE]; #if 0 /* not yet in gfarm v2 */ struct gfs_client_rep_rate_info *rinfo = NULL; #endif char *path; int local_fd; static const char diag[] = "GFS_PROTO_REPLICA_RECV"; gfs_server_get_request(client, diag, "ll", &ino, &gen); /* from gfsd only */ if (peer_type != GFARM_AUTH_ID_TYPE_SPOOL_HOST) { error = GFARM_ERR_OPERATION_NOT_PERMITTED; gflog_debug(GFARM_MSG_1002179, "operation is not permitted(peer_type)"); goto send_eof; } local_path(ino, gen, diag, &path); local_fd = open_data(path, O_RDONLY); free(path); if (local_fd < 0) { error = gfarm_errno_to_error(errno); goto send_eof; } /* data transfer */ if (file_read_size >= sizeof(buffer)) file_read_size = sizeof(buffer); #if 0 /* not yet in gfarm v2 */ if (rate_limit != 0) { rinfo = gfs_client_rep_rate_info_alloc(rate_limit); if (rinfo == NULL) fatal("%s:rate_info_alloc: %s", diag, gfarm_error_string(GFARM_ERR_NO_MEMORY)); } #endif do { rv = read(local_fd, buffer, file_read_size); if (rv <= 0) { if (rv == -1) error = gfarm_errno_to_error(errno); break; } e = gfp_xdr_send(client, "b", rv, buffer); if (e != GFARM_ERR_NO_ERROR) { error = e; gflog_debug(GFARM_MSG_1002180, "gfp_xdr_send() failed: %s", gfarm_error_string(e)); break; } if (file_read_size < GFS_PROTO_MAX_IOSIZE) { e = gfp_xdr_flush(client); if (e != GFARM_ERR_NO_ERROR) { error = e; gflog_debug(GFARM_MSG_1002181, "gfp_xdr_send() failed: %s", gfarm_error_string(e)); break; } } #if 0 /* not yet in gfarm v2 */ if (rate_limit != 0) gfs_client_rep_rate_control(rinfo, rv); #endif } while (rv > 0); #if 0 /* not yet in gfarm v2 */ if (rinfo != NULL) gfs_client_rep_rate_info_free(rinfo); #endif e = close(local_fd); if (error == GFARM_ERR_NO_ERROR) error = e; send_eof: /* send EOF mark */ e = gfp_xdr_send(client, "b", 0, buffer); if (error == GFARM_ERR_NO_ERROR) error = e; gfs_server_put_reply(client, diag, error, ""); } /* from gfmd */ gfarm_error_t gfs_async_server_fhstat(struct gfp_xdr *conn, gfp_xdr_xid_t xid, size_t size) { gfarm_error_t e; struct stat st; gfarm_ino_t ino; gfarm_uint64_t gen; gfarm_off_t filesize = 0; gfarm_int64_t atime_sec = 0, mtime_sec = 0; gfarm_int32_t atime_nsec = 0, mtime_nsec = 0; int save_errno = 0; char *path; e = gfs_async_server_get_request(conn, size, "fhstat", "ll", &ino, &gen); if (e != GFARM_ERR_NO_ERROR) return (e); local_path(ino, gen, "fhstat", &path); if (stat(path, &st) == -1) save_errno = errno; else { filesize = st.st_size; atime_sec = st.st_atime; /* XXX FIXME st_atimespec.tv_nsec */ mtime_sec = st.st_mtime; /* XXX FIXME st_mtimespec.tv_nsec */ } free(path); return (gfs_async_server_put_reply_with_errno(conn, xid, "fhstat", save_errno, "llili", filesize, atime_sec, atime_nsec, mtime_sec, mtime_nsec)); } gfarm_error_t gfs_async_server_fhremove(struct gfp_xdr *conn, gfp_xdr_xid_t xid, size_t size) { gfarm_error_t e; gfarm_ino_t ino; gfarm_uint64_t gen; int save_errno = 0; char *path; e = gfs_async_server_get_request(conn, size, "fhremove", "ll", &ino, &gen); if (e != GFARM_ERR_NO_ERROR) return (e); local_path(ino, gen, "fhremove", &path); if (unlink(path) == -1) save_errno = errno; free(path); return (gfs_async_server_put_reply_with_errno(conn, xid, "fhremove", save_errno, "")); } gfarm_error_t gfs_async_server_status(struct gfp_xdr *conn, gfp_xdr_xid_t xid, size_t size) { gfarm_error_t e; int save_errno = 0; double loadavg[3]; gfarm_int32_t bsize; gfarm_off_t blocks, bfree, bavail, files, ffree, favail; gfarm_off_t used = 0, avail = 0; /* just check that size == 0 */ e = gfs_async_server_get_request(conn, size, "status", ""); if (e != GFARM_ERR_NO_ERROR) return (e); if (getloadavg(loadavg, GFARM_ARRAY_LENGTH(loadavg)) == -1) { save_errno = EPERM; /* XXX */ gflog_warning(GFARM_MSG_1000520, "gfs_server_status: cannot get load average"); } else { save_errno = gfsd_statfs(gfarm_spool_root, &bsize, &blocks, &bfree, &bavail, &files, &ffree, &favail); /* pretend to be disk full, to make this gfsd read-only */ if (save_errno == 0 && is_readonly_mode()) { bavail -= bfree; bfree = 0; } if (save_errno == 0) { used = (blocks - bfree) * bsize / 1024; avail = bavail * bsize / 1024; } } return (gfs_async_server_put_reply_with_errno(conn, xid, "status", save_errno, "fffll", loadavg[0], loadavg[1], loadavg[2], used, avail)); } static struct gfarm_hash_table *replication_queue_set = NULL; /* per source-host queue */ struct replication_queue_data { struct replication_request *head; struct replication_request **tail; }; gfarm_error_t replication_queue_lookup(const char *hostname, int port, struct gfarm_hash_entry **qp) { gfarm_error_t e; int created; struct gfarm_hash_entry *q; struct replication_queue_data *qd; e = gfp_conn_hash_enter(&replication_queue_set, HOST_HASHTAB_SIZE, sizeof(*qd), hostname, port, gfarm_get_global_username(), &q, &created); if (e != GFARM_ERR_NO_ERROR) { gflog_error(GFARM_MSG_1002514, "creating replication queue for %s:%d: %s", hostname, port, gfarm_error_string(e)); return (e); } qd = gfarm_hash_entry_data(q); if (created) { qd->head = NULL; qd->tail = &qd->head; } *qp = q; return (GFARM_ERR_NO_ERROR); } struct replication_request { /* only used when actual replication is ongoing */ struct replication_request *ongoing_next, *ongoing_prev; struct replication_request *q_next; struct gfarm_hash_entry *q; gfp_xdr_xid_t xid; gfarm_ino_t ino; gfarm_int64_t gen; /* the followings are only used when actual replication is ongoing */ struct gfs_connection *src_gfsd; int file_fd, pipe_fd; pid_t pid; }; /* dummy header of doubly linked circular list */ struct replication_request ongoing_replications = { &ongoing_replications, &ongoing_replications }; struct replication_errcodes { gfarm_int32_t src_errcode; gfarm_int32_t dst_errcode; }; gfarm_error_t try_replication(struct gfp_xdr *conn, struct gfarm_hash_entry *q, gfarm_error_t *src_errp, gfarm_error_t *dst_errp) { gfarm_error_t e, dst_err = GFARM_ERR_NO_ERROR; gfarm_error_t conn_err = GFARM_ERR_NO_ERROR; struct replication_queue_data *qd = gfarm_hash_entry_data(q); struct replication_request *rep = qd->head; char *path; struct gfs_connection *src_gfsd; int fds[2]; pid_t pid = -1; struct replication_errcodes errcodes; int local_fd, rv; static const char diag[] = "GFS_PROTO_REPLICATION_REQUEST"; /* * XXX FIXME: * gfs_client_connection_acquire_by_host() needs timeout, otherwise * the remote gfsd (or its kernel) can block this backchannel gfsd. * See http://sourceforge.net/apps/trac/gfarm/ticket/130 */ local_path(rep->ino, rep->gen, diag, &path); local_fd = open_data(path, O_WRONLY|O_CREAT|O_TRUNC); free(path); if (local_fd < 0) { dst_err = gfarm_errno_to_error(errno); gflog_error(GFARM_MSG_1002182, "%s: cannot open local file for %lld:%lld: %s", diag, (long long)rep->ino, (long long)rep->gen, strerror(errno)); } else if ((conn_err = gfs_client_connection_acquire_by_host(gfm_server, gfp_conn_hash_hostname(q), gfp_conn_hash_port(q), &src_gfsd, listen_addrname)) != GFARM_ERR_NO_ERROR) { gflog_error(GFARM_MSG_1002184, "%s: connecting to %s:%d: %s", diag, gfp_conn_hash_hostname(q), gfp_conn_hash_port(q), gfarm_error_string(conn_err)); close(local_fd); } else if (pipe(fds) == -1) { dst_err = gfarm_errno_to_error(errno); gflog_error(GFARM_MSG_1002185, "%s: cannot create pipe: %s", diag, strerror(errno)); gfs_client_connection_free(src_gfsd); close(local_fd); } else if (fds[0] > FD_SETSIZE) { /* XXX select FD_SETSIZE */ dst_err = GFARM_ERR_TOO_MANY_OPEN_FILES; gflog_error(GFARM_MSG_1002186, "%s: cannot select %d: %s", diag, fds[0], gfarm_error_string(dst_err)); close(fds[0]); close(fds[1]); gfs_client_connection_free(src_gfsd); close(local_fd); } else if ((pid = fork()) == 0) { /* child */ close(fds[0]); e = gfs_client_replica_recv(src_gfsd, rep->ino, rep->gen, local_fd); if (e != GFARM_ERR_NO_ERROR) { gflog_error(GFARM_MSG_1002187, "%s: replica_recv: %s", diag, gfarm_error_string(e)); } /* * XXX FIXME * modify gfs_client_replica_recv() interface to return * the error codes for both source and destination side. */ if (IS_CONNECTION_ERROR(e) || e == GFARM_ERR_NO_SUCH_FILE_OR_DIRECTORY || e == GFARM_ERR_PERMISSION_DENIED) { errcodes.src_errcode = e; errcodes.dst_errcode = GFARM_ERR_NO_ERROR; } else { errcodes.src_errcode = GFARM_ERR_NO_ERROR; errcodes.dst_errcode = e; } if ((rv = write(fds[1], &errcodes, sizeof(errcodes))) == -1) gflog_error(GFARM_MSG_1002188, "%s: write pipe: %s", diag, strerror(errno)); else if (rv != sizeof(errcodes)) gflog_error(GFARM_MSG_1002189, "%s: partial write: " "%d < %d", diag, rv, (int)sizeof(e)); close(fds[1]); exit(e == GFARM_ERR_NO_ERROR ? 0 : 1); } else { /* parent */ if (pid == -1) { dst_err = gfarm_errno_to_error(errno); gflog_error(GFARM_MSG_1002190, "%s: cannot create child process: %s", diag, strerror(errno)); close(fds[0]); gfs_client_connection_free(src_gfsd); close(local_fd); } else { rep->src_gfsd = src_gfsd; rep->file_fd = local_fd; rep->pipe_fd = fds[0]; rep->pid = pid; rep->ongoing_next = &ongoing_replications; rep->ongoing_prev = ongoing_replications.ongoing_prev; ongoing_replications.ongoing_prev->ongoing_next = rep; ongoing_replications.ongoing_prev = rep; } close(fds[1]); } *src_errp = conn_err; *dst_errp = dst_err; /* XXX FIXME, src_err and dst_err should be passed separately */ return (gfs_async_server_put_reply(conn, rep->xid, diag, conn_err != GFARM_ERR_NO_ERROR ? conn_err : dst_err, "l", (gfarm_int64_t)pid)); } gfarm_error_t start_replication(struct gfp_xdr *conn, struct gfarm_hash_entry *q) { gfarm_error_t gfmd_err, dst_err, src_err = GFARM_ERR_NO_ERROR; struct replication_queue_data *qd = gfarm_hash_entry_data(q); struct replication_request *rep; do { if (src_err != GFARM_ERR_NO_ERROR) { /* * avoid retries, because this may take long time, * if the host is down or network is unreachable. */ gflog_warning(GFARM_MSG_1002515, "skipping replication for %lld:%lld, " "because %s:%d is down: %s", (long long)qd->head->ino, (long long)qd->head->gen, gfp_conn_hash_hostname(q), gfp_conn_hash_port(q), gfarm_error_string(src_err)); } else { gfmd_err = try_replication(conn, q, &src_err, &dst_err); if (gfmd_err != GFARM_ERR_NO_ERROR) return (gfmd_err); if (src_err == GFARM_ERR_NO_ERROR && dst_err == GFARM_ERR_NO_ERROR) return (GFARM_ERR_NO_ERROR); } /* * failed to start a replication, try next entry. * * we don't have to touch rep->ongoing_{next,prev} here, * since they are updated only after a replication actually * started or finished. */ rep = qd->head->q_next; free(qd->head); qd->head = rep; } while (rep != NULL); qd->tail = &qd->head; return (GFARM_ERR_NO_ERROR); /* no gfmd_err */ } gfarm_error_t gfs_async_server_replication_request(struct gfp_xdr *conn, gfp_xdr_xid_t xid, size_t size) { gfarm_error_t e; char *host; gfarm_int32_t port; gfarm_ino_t ino; gfarm_uint64_t gen; struct gfarm_hash_entry *q; struct replication_queue_data *qd; struct replication_request *rep; static const char diag[] = "GFS_PROTO_REPLICATION_REQUEST"; e = gfs_async_server_get_request(conn, size, diag, "sill", &host, &port, &ino, &gen); if (e != GFARM_ERR_NO_ERROR) return (e); if ((e = replication_queue_lookup(host, port, &q)) != GFARM_ERR_NO_ERROR) { gflog_error(GFARM_MSG_1002516, "cannot allocate replication queue for %s:%d: %s", host, port, gfarm_error_string(e)); } else { GFARM_MALLOC(rep); if (rep == NULL) { e = GFARM_ERR_NO_MEMORY; gflog_error(GFARM_MSG_1002517, "cannot allocate replication record for " "%s:%d %lld:%lld: no memory", host, port, (long long)ino, (long long)gen); } else { free(host); rep->xid = xid; rep->ino = ino; rep->gen = gen; /* not set yet, will be set in try_replication() */ rep->src_gfsd = NULL; rep->file_fd = -1; rep->pipe_fd = -1; rep->pid = 0; rep->ongoing_next = rep->ongoing_prev = rep; rep->q = q; rep->q_next = NULL; qd = gfarm_hash_entry_data(q); *qd->tail = rep; qd->tail = &rep->q_next; if (qd->head == rep) { /* this host is idle */ return (start_replication(conn, q)); } else { /* the replication is postponed */ return (GFARM_ERR_NO_ERROR); } } } free(host); /* only used in an error case */ return (gfs_async_server_put_reply(conn, xid, diag, e, "")); } #if 0 /* not yet in gfarm v2 */ void gfs_server_striping_read(struct gfp_xdr *client) { gfarm_error_t e; gfarm_int32_t fd, interleave_factor; gfarm_off_t offset, size, full_stripe_size; gfarm_off_t chunk_size; ssize_t rv; gfarm_error_t error = GFARM_ERR_NO_ERROR; char buffer[GFS_PROTO_MAX_IOSIZE]; struct gfs_client_rep_rate_info *rinfo = NULL; gfs_server_get_request(client, "striping_read", "iooio", &fd, &offset, &size, &interleave_factor, &full_stripe_size); if (file_read_size >= sizeof(buffer)) file_read_size = sizeof(buffer); if (rate_limit != 0) { rinfo = gfs_client_rep_rate_info_alloc(rate_limit); if (rinfo == NULL) fatal("striping_read:rate_info_alloc: %s", gfarm_error_string(GFARM_ERR_NO_MEMORY)); } fd = file_table_get(fd); if (lseek(fd, (off_t)offset, SEEK_SET) == -1) { error = gfarm_errno_to_error(errno); goto finish; } for (;;) { chunk_size = interleave_factor == 0 || size < interleave_factor ? size : interleave_factor; for (; chunk_size > 0; chunk_size -= rv, size -= rv) { rv = read(fd, buffer, chunk_size < file_read_size ? chunk_size : file_read_size); if (rv <= 0) { if (rv == -1) error = gfarm_errno_to_error(errno); goto finish; } e = gfp_xdr_send(client, "b", rv, buffer); if (e != GFARM_ERR_NO_ERROR) { error = e; goto finish; } if (file_read_size < GFS_PROTO_MAX_IOSIZE) { e = gfp_xdr_flush(client); if (e != GFARM_ERR_NO_ERROR) { error = e; goto finish; } } if (rate_limit != 0) gfs_client_rep_rate_control(rinfo, rv); } if (size <= 0) break; offset += full_stripe_size; if (lseek(fd, (off_t)offset, SEEK_SET) == -1) { error = gfarm_errno_to_error(errno); break; } } finish: if (rinfo != NULL) gfs_client_rep_rate_info_free(rinfo); /* send EOF mark */ e = gfp_xdr_send(client, "b", 0, buffer); if (e != GFARM_ERR_NO_ERROR && error == GFARM_ERR_NO_ERROR) error = e; gfs_server_put_reply(client, "striping_read", error, ""); } void gfs_server_replicate_file_sequential_common(struct gfp_xdr *client, char *file, gfarm_int32_t mode, char *src_canonical_hostname, char *src_if_hostname) { gfarm_error_t e; char *path; struct gfs_connection *src_conn; int fd, src_fd; long file_sync_rate; gfarm_error_t error = GFARM_ERR_NO_ERROR; struct hostent *hp; struct sockaddr_in peer_addr; hp = gethostbyname(src_if_hostname); free(src_if_hostname); if (hp == NULL || hp->h_addrtype != AF_INET) { e = GFARM_ERR_UNKNOWN_HOST; } else { memset(&peer_addr, 0, sizeof(peer_addr)); memcpy(&peer_addr.sin_addr, hp->h_addr, sizeof(peer_addr.sin_addr)); peer_addr.sin_family = hp->h_addrtype; peer_addr.sin_port = htons(gfarm_spool_server_port); e = gfarm_netparam_config_get_long( &gfarm_netparam_file_sync_rate, src_canonical_hostname, (struct sockaddr *)&peer_addr, &file_sync_rate); if (e != GFARM_ERR_NO_ERROR) /* shouldn't happen */ gflog_warning(GFARM_MSG_1000521, "file_sync_rate: %s", gfarm_error_string(e)); /* * the following gfs_client_connect() accesses user & home * information which was set in gfarm_authorize() * with switch_to==1. */ e = gfs_client_connect( src_canonical_hostname, (struct sockaddr *)&peer_addr, &src_conn); } free(src_canonical_hostname); if (e != GFARM_ERR_NO_ERROR) { error = e; gflog_warning(GFARM_MSG_1000522, "replicate_file_seq:remote_connect: %s", gfarm_error_string(e)); } else { e = gfs_client_open(src_conn, file, GFARM_FILE_RDONLY, 0, &src_fd); if (e != GFARM_ERR_NO_ERROR) { error = e; gflog_warning(GFARM_MSG_1000523, "replicate_file_seq:remote_open: %s", gfarm_error_string(e)); } else { e = gfarm_path_localize(file, &path); if (e != GFARM_ERR_NO_ERROR) fatal(GFARM_MSG_1000524, "replicate_file_seq:path: %s", gfarm_error_string(e)); fd = open(path, O_WRONLY|O_CREAT|O_TRUNC, mode); if (fd < 0) { error = gfarm_errno_to_error(errno); gflog_warning_errno(GFARM_MSG_1000525, "replicate_file_seq:local_open"); } else { e = gfs_client_copyin(src_conn, src_fd, fd, file_sync_rate); if (e != GFARM_ERR_NO_ERROR) { error = e; gflog_warning(GFARM_MSG_1000526, "replicate_file_seq:copyin: %s", gfarm_error_string(e)); } close(fd); } e = gfs_client_close(src_conn, src_fd); free(path); } gfs_client_disconnect(src_conn); } free(file); gfs_server_put_reply(client, "replicate_file_seq", error, ""); } /* obsolete interafce, keeped for backward compatibility */ void gfs_server_replicate_file_sequential_old(struct gfp_xdr *client) { char *file, *src_canonical_hostname, *src_if_hostname; gfarm_int32_t mode; gfs_server_get_request(client, "replicate_file_seq_old", "sis", &file, &mode, &src_if_hostname); src_canonical_hostname = strdup(src_if_hostname); if (src_canonical_hostname == NULL) { gfs_server_put_reply(client, "replicate_file_seq_old", GFARM_ERR_NO_MEMORY, ""); return; } gfs_server_replicate_file_sequential_common(client, file, mode, src_canonical_hostname, src_if_hostname); } void gfs_server_replicate_file_sequential(struct gfp_xdr *client) { char *file, *src_canonical_hostname, *src_if_hostname; gfarm_int32_t mode; gfs_server_get_request(client, "replicate_file_seq", "siss", &file, &mode, &src_canonical_hostname, &src_if_hostname); gfs_server_replicate_file_sequential_common(client, file, mode, src_canonical_hostname, src_if_hostname); } int iosize_alignment = 4096; int iosize_minimum_division = 65536; struct parallel_stream { struct gfs_connection *src_conn; int src_fd; enum { GSRFP_COPYING, GSRFP_FINISH } state; }; gfarm_error_t simple_division(int ofd, struct parallel_stream *divisions, off_t file_size, int n) { gfarm_error_t e, e_save = GFARM_ERR_NO_ERROR; gfarm_off_t offset = 0, residual = file_size; gfarm_off_t size_per_division = file_size / n; int i; if ((size_per_division / iosize_alignment) * iosize_alignment != size_per_division) { size_per_division = ((size_per_division / iosize_alignment) + 1) * iosize_alignment; } for (i = 0; i < n; i++) { gfarm_off_t size; if (residual <= 0 || e_save != GFARM_ERR_NO_ERROR) { divisions[i].state = GSRFP_FINISH; continue; } size = residual <= size_per_division ? residual : size_per_division; e = gfs_client_striping_copyin_request( divisions[i].src_conn, divisions[i].src_fd, ofd, offset, size, 0, 0); offset += size_per_division; residual -= size; if (e != GFARM_ERR_NO_ERROR) { if (e_save == GFARM_ERR_NO_ERROR) e_save = e; gflog_warning(GFARM_MSG_1000527, "replicate_file_division:copyin: %s", gfarm_error_string(e)); divisions[i].state = GSRFP_FINISH; continue; } divisions[i].state = GSRFP_COPYING; } return (e_save); } gfarm_error_t striping(int ofd, struct parallel_stream *divisions, off_t file_size, int n, int interleave_factor) { gfarm_error_t e, e_save = GFARM_ERR_NO_ERROR; gfarm_off_t full_stripe_size = (gfarm_off_t)interleave_factor * n; gfarm_off_t stripe_number = file_size / full_stripe_size; gfarm_off_t size_per_division = interleave_factor * stripe_number; gfarm_off_t residual = file_size - full_stripe_size * stripe_number; gfarm_off_t chunk_number_on_last_stripe; gfarm_off_t last_chunk_size; gfarm_off_t offset = 0; int i; if (residual == 0) { chunk_number_on_last_stripe = 0; last_chunk_size = 0; } else { chunk_number_on_last_stripe = residual / interleave_factor; last_chunk_size = residual - interleave_factor * chunk_number_on_last_stripe; } for (i = 0; i < n; i++) { gfarm_off_t size = size_per_division; if (i < chunk_number_on_last_stripe) size += interleave_factor; else if (i == chunk_number_on_last_stripe) size += last_chunk_size; if (size <= 0 || e_save != GFARM_ERR_NO_ERROR) { divisions[i].state = GSRFP_FINISH; continue; } e = gfs_client_striping_copyin_request( divisions[i].src_conn, divisions[i].src_fd, ofd, offset, size, interleave_factor, full_stripe_size); offset += interleave_factor; if (e != GFARM_ERR_NO_ERROR) { if (e_save == GFARM_ERR_NO_ERROR) e_save = e; gflog_warning(GFARM_MSG_1000528, "replicate_file_stripe:copyin: %s", gfarm_error_string(e)); divisions[i].state = GSRFP_FINISH; continue; } divisions[i].state = GSRFP_COPYING; } return (e_save); } void limit_division(int *ndivisionsp, gfarm_off_t file_size) { int ndivisions = *ndivisionsp; /* do not divide too much */ if (ndivisions > file_size / iosize_minimum_division) { ndivisions = file_size / iosize_minimum_division; if (ndivisions == 0) ndivisions = 1; } *ndivisionsp = ndivisions; } void gfs_server_replicate_file_parallel_common(struct gfp_xdr *client, char *file, gfarm_int32_t mode, gfarm_off_t file_size, gfarm_int32_t ndivisions, gfarm_int32_t interleave_factor, char *src_canonical_hostname, char *src_if_hostname) { struct parallel_stream *divisions; gfarm_error_t e, e_save = GFARM_ERR_NO_ERROR; char *path; long file_sync_rate, written; int i, j, n, ofd; gfarm_error_t error = GFARM_ERR_NO_ERROR; struct hostent *hp; struct sockaddr_in peer_addr; e = gfarm_path_localize(file, &path); if (e != GFARM_ERR_NO_ERROR) fatal(GFARM_MSG_1000529, "replicate_file_par: %s", gfarm_error_string(e)); ofd = open(path, O_WRONLY|O_CREAT|O_TRUNC, mode); free(path); if (ofd == -1) { error = gfarm_errno_to_error(errno); gflog_warning_errno(GFARM_MSG_1000530, "replicate_file_par:local_open"); goto finish; } limit_division(&ndivisions, file_size); GFARM_MALLOC_ARRAY(divisions, ndivisions); if (divisions == NULL) { error = GFARM_ERR_NO_MEMORY; goto finish_ofd; } hp = gethostbyname(src_if_hostname); if (hp == NULL || hp->h_addrtype != AF_INET) { error = GFARM_ERR_CONNECTION_REFUSED; goto finish_free_divisions; } memset(&peer_addr, 0, sizeof(peer_addr)); memcpy(&peer_addr.sin_addr, hp->h_addr, sizeof(peer_addr.sin_addr)); peer_addr.sin_family = hp->h_addrtype; peer_addr.sin_port = htons(gfarm_spool_server_port); e = gfarm_netparam_config_get_long(&gfarm_netparam_file_sync_rate, src_canonical_hostname, (struct sockaddr *)&peer_addr, &file_sync_rate); if (e != GFARM_ERR_NO_ERROR) /* shouldn't happen */ gflog_warning(GFARM_MSG_1000531, "file_sync_rate: %s", gfarm_error_string(e)); /* XXX - this should be done in parallel rather than sequential */ for (i = 0; i < ndivisions; i++) { e = gfs_client_connect( src_canonical_hostname, (struct sockaddr *)&peer_addr, &divisions[i].src_conn); if (e != GFARM_ERR_NO_ERROR) { if (e_save == GFARM_ERR_NO_ERROR) e_save = e; gflog_warning(GFARM_MSG_1000532, "replicate_file_par:remote_connect: %s", gfarm_error_string(e)); break; } } n = i; if (n == 0) { error = e; goto finish_free_divisions; } e_save = GFARM_ERR_NO_ERROR; /* not fatal */ /* XXX - this should be done in parallel rather than sequential */ for (i = 0; i < n; i++) { e = gfs_client_open(divisions[i].src_conn, file, GFARM_FILE_RDONLY, 0, &divisions[i].src_fd); if (e != GFARM_ERR_NO_ERROR) { if (e_save == GFARM_ERR_NO_ERROR) e_save = e; gflog_warning(GFARM_MSG_1000533, "replicate_file_par:remote_open: %s", gfarm_error_string(e)); /* * XXX - this should be done in parallel * rather than sequential */ for (j = i; j < n; j++) gfs_client_disconnect(divisions[j].src_conn); n = i; break; } } if (n == 0) { error = e_save; goto finish_free_divisions; } e_save = GFARM_ERR_NO_ERROR; /* not fatal */ if (interleave_factor == 0) { e = simple_division(ofd, divisions, file_size, n); } else { e = striping(ofd, divisions, file_size, n, interleave_factor); } e_save = e; written = 0; /* * XXX - we cannot stop here, even if e_save != GFARM_ERR_NO_ERROR, * because currently there is no way to cancel * striping_copyin request. */ for (;;) { int max_fd, fd, nfound, rv; fd_set readable; FD_ZERO(&readable); max_fd = -1; for (i = 0; i < n; i++) { if (divisions[i].state != GSRFP_COPYING) continue; fd = gfs_client_connection_fd(divisions[i].src_conn); /* XXX - prevent this happens */ if (fd >= FD_SETSIZE) { fatal(GFARM_MSG_1000534, "replicate_file_par: " "too big file descriptor"); } FD_SET(fd, &readable); if (max_fd < fd) max_fd = fd; } if (max_fd == -1) break; nfound = select(max_fd + 1, &readable, NULL, NULL, NULL); if (nfound <= 0) { if (nfound == -1 && errno != EINTR && errno != EAGAIN) gflog_warning_errno(GFARM_MSG_1000535, "replicate_file_par:select"); continue; } for (i = 0; i < n; i++) { if (divisions[i].state != GSRFP_COPYING) continue; fd = gfs_client_connection_fd(divisions[i].src_conn); if (!FD_ISSET(fd, &readable)) continue; e = gfs_client_striping_copyin_partial( divisions[i].src_conn, &rv); if (e != GFARM_ERR_NO_ERROR) { if (e_save == GFARM_ERR_NO_ERROR) e_save = e; divisions[i].state = GSRFP_FINISH; /* XXX */ } else if (rv == 0) { divisions[i].state = GSRFP_FINISH; e = gfs_client_striping_copyin_result( divisions[i].src_conn); if (e != GFARM_ERR_NO_ERROR) { if (e_save == GFARM_ERR_NO_ERROR) e_save = e; } else { e = gfs_client_close( divisions[i].src_conn, divisions[i].src_fd); if (e_save == GFARM_ERR_NO_ERROR) e_save = e; } } else if (file_sync_rate != 0) { written += rv; if (written >= file_sync_rate) { written -= file_sync_rate; #ifdef HAVE_FDATASYNC fdatasync(ofd); #else fsync(ofd); #endif } } if (--nfound <= 0) break; } } /* XXX - this should be done in parallel rather than sequential */ for (i = 0; i < n; i++) { e = gfs_client_disconnect(divisions[i].src_conn); if (e_save == GFARM_ERR_NO_ERROR) e_save = e; } if (e_save != GFARM_ERR_NO_ERROR) error = e_save; finish_free_divisions: free(divisions); finish_ofd: close(ofd); finish: free(file); free(src_canonical_hostname); free(src_if_hostname); gfs_server_put_reply(client, "replicate_file_par", error, ""); } /* obsolete interafce, keeped for backward compatibility */ void gfs_server_replicate_file_parallel_old(struct gfp_xdr *client) { char *file, *src_canonical_hostname, *src_if_hostname; gfarm_int32_t mode; gfarm_int32_t ndivisions; /* parallel_streams */ gfarm_int32_t interleave_factor; /* stripe_unit_size, chuck size */ gfarm_off_t file_size; gfs_server_get_request(client, "replicate_file_par_old", "sioiis", &file, &mode, &file_size, &ndivisions, &interleave_factor, &src_if_hostname); src_canonical_hostname = strdup(src_if_hostname); if (src_canonical_hostname == NULL) { gfs_server_put_reply(client, "replicate_file_par_old", GFARM_ERR_NO_MEMORY, ""); return; } gfs_server_replicate_file_parallel_common(client, file, mode, file_size, ndivisions, interleave_factor, src_canonical_hostname, src_if_hostname); } void gfs_server_replicate_file_parallel(struct gfp_xdr *client) { char *file, *src_canonical_hostname, *src_if_hostname; gfarm_int32_t mode; gfarm_int32_t ndivisions; /* parallel_streams */ gfarm_int32_t interleave_factor; /* stripe_unit_size, chuck size */ gfarm_off_t file_size; gfs_server_get_request(client, "replicate_file_par", "sioiiss", &file, &mode, &file_size, &ndivisions, &interleave_factor, &src_canonical_hostname, &src_if_hostname); gfs_server_replicate_file_parallel_common(client, file, mode, file_size, ndivisions, interleave_factor, src_canonical_hostname, src_if_hostname); } void gfs_server_chdir(struct gfp_xdr *client) { char *gpath, *path; int save_errno = 0; char *msg = "chdir"; gfs_server_get_request(client, msg, "s", &gpath); local_path(gpath, &path, msg); if (chdir(path) == -1) save_errno = errno; free(path); gfs_server_put_reply_with_errno(client, msg, save_errno, ""); check_input_output_error(msg, save_errno); } struct gfs_server_command_context { struct gfarm_iobuffer *iobuffer[NFDESC]; enum { GFS_COMMAND_SERVER_STATE_NEUTRAL, GFS_COMMAND_SERVER_STATE_OUTPUT, GFS_COMMAND_SERVER_STATE_EXITED } server_state; int server_output_fd; int server_output_residual; enum { GFS_COMMAND_CLIENT_STATE_NEUTRAL, GFS_COMMAND_CLIENT_STATE_OUTPUT } client_state; int client_output_residual; int pid; int exited_pid; int status; } server_command_context; #define COMMAND_IS_RUNNING() (server_command_context.exited_pid == 0) volatile sig_atomic_t sigchld_jmp_needed = 0; sigjmp_buf sigchld_jmp_buf; #endif /* not yet in gfarm v2 */ void sigchld_handler(int sig) { int pid, status, save_errno = errno; for (;;) { pid = waitpid(-1, &status, WNOHANG); if (pid == -1 || pid == 0) break; #if 0 /* not yet in gfarm v2 */ server_command_context.exited_pid = pid; server_command_context.status = status; #endif /* not yet in gfarm v2 */ } errno = save_errno; #if 0 /* not yet in gfarm v2 */ if (sigchld_jmp_needed) { sigchld_jmp_needed = 0; siglongjmp(sigchld_jmp_buf, 1); } #endif /* not yet in gfarm v2 */ } #if 0 /* not yet in gfarm v2 */ void fatal_command(const char *, ...) GFLOG_PRINTF_ARG(1, 2); void fatal_command(const char *format, ...) { va_list ap; struct gfs_server_command_context *cc = &server_command_context; /* "-" is to send it to the process group */ kill(-cc->pid, SIGTERM); va_start(ap, format); vfatal(format, ap); va_end(ap); } char * gfs_server_command_fd_set(struct gfp_xdr *client, fd_set *readable, fd_set *writable, int *max_fdp) { struct gfs_server_command_context *cc = &server_command_context; int conn_fd = gfp_xdr_fd(client); int i, fd; /* * The following test condition should just match with * the i/o condition in gfs_server_command_io_fd_set(), * otherwise unneeded busy wait happens. */ if (cc->client_state == GFS_COMMAND_CLIENT_STATE_NEUTRAL || (cc->client_state == GFS_COMMAND_CLIENT_STATE_OUTPUT && gfarm_iobuffer_is_readable(cc->iobuffer[FDESC_STDIN]))) { FD_SET(conn_fd, readable); if (*max_fdp < conn_fd) *max_fdp = conn_fd; } if ((cc->server_state == GFS_COMMAND_SERVER_STATE_NEUTRAL && (gfarm_iobuffer_is_writable(cc->iobuffer[FDESC_STDERR]) || gfarm_iobuffer_is_writable(cc->iobuffer[FDESC_STDOUT]) || !COMMAND_IS_RUNNING())) || cc->server_state == GFS_COMMAND_SERVER_STATE_OUTPUT) { FD_SET(conn_fd, writable); if (*max_fdp < conn_fd) *max_fdp = conn_fd; } if (COMMAND_IS_RUNNING() && gfarm_iobuffer_is_writable(cc->iobuffer[FDESC_STDIN])) { fd = gfarm_iobuffer_get_write_fd(cc->iobuffer[FDESC_STDIN]); FD_SET(fd, writable); if (*max_fdp < fd) *max_fdp = fd; } for (i = FDESC_STDOUT; i <= FDESC_STDERR; i++) { if (gfarm_iobuffer_is_readable(cc->iobuffer[i])) { fd = gfarm_iobuffer_get_read_fd(cc->iobuffer[i]); FD_SET(fd, readable); if (*max_fdp < fd) *max_fdp = fd; } } return (NULL); } gfarm_error_t gfs_server_command_io_fd_set(struct gfp_xdr *client, fd_set *readable, fd_set *writable) { gfarm_error_t e; struct gfs_server_command_context *cc = &server_command_context; int i, fd, conn_fd = gfp_xdr_fd(client); fd = gfarm_iobuffer_get_write_fd(cc->iobuffer[FDESC_STDIN]); if (FD_ISSET(fd, writable)) { assert(gfarm_iobuffer_is_writable(cc->iobuffer[FDESC_STDIN])); gfarm_iobuffer_write(cc->iobuffer[FDESC_STDIN], NULL); e = gfarm_iobuffer_get_error(cc->iobuffer[FDESC_STDIN]); if (e != GFARM_ERR_NO_ERROR) { /* just purge the content */ gfarm_iobuffer_purge(cc->iobuffer[FDESC_STDIN], NULL); gflog_warning(GFARM_MSG_UNUSED, "command: abandon stdin: %s", gfarm_error_string(e)); gfarm_iobuffer_set_error(cc->iobuffer[FDESC_STDIN], GFARM_ERR_NO_ERROR); } if (gfarm_iobuffer_is_eof(cc->iobuffer[FDESC_STDIN])) { /* * We need to use shutdown(2) instead of close(2) here, * to make bash happy... * At least on Solaris 9, getpeername(2) returns EINVAL * if the opposite side of the socketpair is closed, * and bash doesn't read ~/.bashrc in such case. * Read the comment about socketpair(2) in * gfs_server_command() too. */ shutdown(fd, SHUT_WR); } } for (i = FDESC_STDOUT; i <= FDESC_STDERR; i++) { fd = gfarm_iobuffer_get_read_fd(cc->iobuffer[i]); if (!FD_ISSET(fd, readable)) continue; gfarm_iobuffer_read(cc->iobuffer[i], NULL); e = gfarm_iobuffer_get_error(cc->iobuffer[i]); if (e == GFARM_ERR_NO_ERROR) continue; /* treat this as eof */ gfarm_iobuffer_set_read_eof(cc->iobuffer[i]); gflog_warning(GFARM_MSG_UNUSED, "%s: %s", i == FDESC_STDOUT ? "command: reading stdout" : "command: reading stderr", gfarm_error_string(e)); gfarm_iobuffer_set_error(cc->iobuffer[i], GFARM_ERR_NO_ERROR); } if (FD_ISSET(conn_fd, readable) && cc->server_state != GFS_COMMAND_SERVER_STATE_EXITED) { if (cc->client_state == GFS_COMMAND_CLIENT_STATE_NEUTRAL) { gfarm_int32_t cmd, fd, len, sig; int eof; e = gfp_xdr_recv(client, 1, &eof, "i", &cmd); if (e != GFARM_ERR_NO_ERROR) fatal_command("command:client subcommand"); if (eof) fatal_command("command:client subcommand: " "eof"); switch (cmd) { case GFS_PROTO_COMMAND_EXIT_STATUS: fatal_command("command:client subcommand: " "unexpected exit_status"); break; case GFS_PROTO_COMMAND_SEND_SIGNAL: e = gfp_xdr_recv(client, 1, &eof, "i", &sig); if (e != GFARM_ERR_NO_ERROR) fatal_command( "command_send_signal: %s", gfarm_error_string(e)); if (eof) fatal_command( "command_send_signal: eof"); /* "-" is to send it to the process group */ kill(-cc->pid, sig); break; case GFS_PROTO_COMMAND_FD_INPUT: e = gfp_xdr_recv(client, 1, &eof, "ii", &fd, &len); if (e != GFARM_ERR_NO_ERROR) fatal_command("command_fd_input: %s", gfarm_error_string(e)); if (eof) fatal_command("command_fd_input: eof"); if (fd != FDESC_STDIN) { /* XXX - something wrong */ fatal_command("command_fd_input: fd"); } if (len <= 0) { /* notify closed */ gfarm_iobuffer_set_read_eof( cc->iobuffer[FDESC_STDIN]); } else { cc->client_state = GFS_COMMAND_CLIENT_STATE_OUTPUT; cc->client_output_residual = len; } break; default: /* XXX - something wrong */ fatal_command("command_io: " "unknown subcommand"); break; } } else if (cc->client_state==GFS_COMMAND_CLIENT_STATE_OUTPUT) { gfarm_iobuffer_read(cc->iobuffer[FDESC_STDIN], &cc->client_output_residual); if (cc->client_output_residual == 0) cc->client_state = GFS_COMMAND_CLIENT_STATE_NEUTRAL; e = gfarm_iobuffer_get_error( cc->iobuffer[FDESC_STDIN]); if (e != GFARM_ERR_NO_ERROR) { /* treat this as eof */ gfarm_iobuffer_set_read_eof( cc->iobuffer[FDESC_STDIN]); gflog_warning(GFARM_MSG_UNUSED, "command: receiving stdin: %s", gfarm_error_string(e)); gfarm_iobuffer_set_error( cc->iobuffer[FDESC_STDIN], GFARM_ERR_NO_ERROR); } if (gfarm_iobuffer_is_read_eof( cc->iobuffer[FDESC_STDIN])) { fatal_command("command_fd_input_content: eof"); } } } if (FD_ISSET(conn_fd, writable)) { if (cc->server_state == GFS_COMMAND_SERVER_STATE_NEUTRAL) { if (gfarm_iobuffer_is_writable( cc->iobuffer[FDESC_STDERR]) || gfarm_iobuffer_is_writable( cc->iobuffer[FDESC_STDOUT])) { if (gfarm_iobuffer_is_writable( cc->iobuffer[FDESC_STDERR])) cc->server_output_fd = FDESC_STDERR; else cc->server_output_fd = FDESC_STDOUT; /* * cc->server_output_residual may be 0, * if stdout or stderr is closed. */ cc->server_output_residual = gfarm_iobuffer_avail_length( cc->iobuffer[cc->server_output_fd]); e = gfp_xdr_send(client, "iii", GFS_PROTO_COMMAND_FD_OUTPUT, cc->server_output_fd, cc->server_output_residual); if (e != GFARM_ERR_NO_ERROR || (e = gfp_xdr_flush(client)) != GFARM_ERR_NO_ERROR) fatal_command("command: fd_output: %s", gfarm_error_string(e)); cc->server_state = GFS_COMMAND_SERVER_STATE_OUTPUT; } else if (!COMMAND_IS_RUNNING()) { e = gfp_xdr_send(client, "i", GFS_PROTO_COMMAND_EXITED); if (e != GFARM_ERR_NO_ERROR || (e = gfp_xdr_flush(client)) != GFARM_ERR_NO_ERROR) fatal(GFARM_MSG_1000536, "command: report exit: %s", gfarm_error_string(e)); cc->server_state = GFS_COMMAND_SERVER_STATE_EXITED; } } else if (cc->server_state==GFS_COMMAND_SERVER_STATE_OUTPUT) { gfarm_iobuffer_write( cc->iobuffer[cc->server_output_fd], &cc->server_output_residual); if (cc->server_output_residual == 0) cc->server_state = GFS_COMMAND_SERVER_STATE_NEUTRAL; e = gfarm_iobuffer_get_error( cc->iobuffer[cc->server_output_fd]); if (e != GFARM_ERR_NO_ERROR) { fatal_command("command: sending %s: %s", cc->server_output_fd == FDESC_STDOUT ? "stdout" : "stderr", gfarm_error_string(e)); } } } return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfs_server_command_io(struct gfp_xdr *client, struct timeval *timeout) { volatile int nfound; int max_fd, conn_fd = gfp_xdr_fd(client); fd_set readable, writable; gfarm_error_t e; if (server_command_context.server_state == GFS_COMMAND_SERVER_STATE_EXITED) return (GFARM_ERR_NO_ERROR); max_fd = -1; FD_ZERO(&readable); FD_ZERO(&writable); gfs_server_command_fd_set(client, &readable, &writable, &max_fd); /* * We wait for either SIGCHLD or select(2) event here, * and use siglongjmp(3) to avoid a race condition about the signal. * * The race condition happens, if the SIGCHLD signal is delivered * after the if-statement which does FD_SET(conn_fd, writable) in * gfs_server_command_fd_set(), and before the select(2) below. * In that condition, the following select(2) may wait that the * `conn_fd' becomes readable, and because it may never happan, * it waits forever (i.e. both gfrcmd and gfsd wait each other * forever), and hangs, unless there is the sigsetjmp()/siglongjmp() * handling. * * If the SIGCHLD is delivered inside the select(2) system call, * the problem doesn't happen, because select(2) will return * with EINTR. * * Also, if the SIGCHLD is delivered before an EOF from either * cc->iobuffer[FDESC_STDOUT] or cc->iobuffer[FDESC_STDERR], * the problem doesn't happen, either. Because the select(2) * will be woken up by the EOF. But actually the SIGCHLD is * delivered after the EOF (of both FDESC_STDOUT and FDESC_STDERR, * and even after the EOFs are reported to a client) at least * on linux-2.4.21-pre4. */ nfound = -1; errno = EINTR; if (sigsetjmp(sigchld_jmp_buf, 1) == 0) { sigchld_jmp_needed = 1; /* * Here, we have to wait until the `conn_fd' is writable, * if this is !COMMAND_IS_RUNNING() case. */ if (COMMAND_IS_RUNNING() || FD_ISSET(conn_fd, &writable)) { nfound = select(max_fd + 1, &readable, &writable, NULL, timeout); } } sigchld_jmp_needed = 0; if (nfound > 0) e = gfs_server_command_io_fd_set(client, &readable, &writable); else e = GFARM_ERR_NO_ERROR; return (e); } gfarm_error_t gfs_server_client_command_result(struct gfp_xdr *client) { struct gfs_server_command_context *cc = &server_command_context; gfarm_int32_t cmd, fd, len, sig; int finish, eof; gfarm_error_t e; while (cc->server_state != GFS_COMMAND_SERVER_STATE_EXITED) gfs_server_command_io(client, NULL); /* * Because COMMAND_IS_RUNNING() must be false here, * we don't have to call fatal_command() from now on. */ /* * Now, we recover the connection file descriptor blocking mode. */ if (fcntl(gfp_xdr_fd(client), F_SETFL, 0) == -1) gflog_warning(GFARM_MSG_1000537, "command-result:block: %s", strerror(errno)); /* make cc->client_state neutral */ if (cc->client_state == GFS_COMMAND_CLIENT_STATE_OUTPUT) { e = gfp_xdr_purge(client, 0, cc->client_output_residual); if (e != GFARM_ERR_NO_ERROR) fatal(GFARM_MSG_1000538, "command_fd_input:purge: %s", gfarm_error_string(e)); } for (finish = 0; !finish; ) { e = gfp_xdr_recv(client, 0, &eof, "i", &cmd); if (e != GFARM_ERR_NO_ERROR) fatal(GFARM_MSG_1000539, "command:client subcommand: %s", gfarm_error_string(e)); if (eof) fatal(GFARM_MSG_1000540, "command:client subcommand: eof"); switch (cmd) { case GFS_PROTO_COMMAND_EXIT_STATUS: finish = 1; break; case GFS_PROTO_COMMAND_SEND_SIGNAL: e = gfp_xdr_recv(client, 0, &eof, "i", &sig); if (e != GFARM_ERR_NO_ERROR) fatal(GFARM_MSG_1000541, "command_send_signal: %s", gfarm_error_string(e)); if (eof) fatal(GFARM_MSG_1000542, "command_send_signal: eof"); break; case GFS_PROTO_COMMAND_FD_INPUT: e = gfp_xdr_recv(client, 0, &eof, "ii", &fd, &len); if (e != GFARM_ERR_NO_ERROR) fatal(GFARM_MSG_1000543, "command_fd_input: %s", gfarm_error_string(e)); if (eof) fatal(GFARM_MSG_1000544, "command_fd_input: eof"); if (fd != FDESC_STDIN) { /* XXX - something wrong */ fatal(GFARM_MSG_1000545, "command_fd_input: fd"); } e = gfp_xdr_purge(client, 0, len); if (e != GFARM_ERR_NO_ERROR) fatal(GFARM_MSG_1000546, "command_fd_input:purge: %s", gfarm_error_string(e)); break; default: /* XXX - something wrong */ fatal(GFARM_MSG_1000547, "command_io: unknown subcommand %d", (int)cmd); break; } } gfs_server_put_reply(client, "command:exit_status", GFARM_ERR_NO_ERROR, "iii", WIFEXITED(cc->status) ? 0 : WTERMSIG(cc->status), WIFEXITED(cc->status) ? WEXITSTATUS(cc->status) : 0, WIFEXITED(cc->status) ? 0 : WCOREDUMP(cc->status)); return (GFARM_ERR_NO_ERROR); } void gfs_server_command(struct gfp_xdr *client, char *cred_env) { struct gfs_server_command_context *cc = &server_command_context; gfarm_int32_t argc, argc_opt, nenv, flags, error; char *path, *command, **argv_storage = NULL, **argv = NULL; char **envp, *xauth; int stdin_pipe[2], stdout_pipe[2], stderr_pipe[2]; int conn_fd = gfp_xdr_fd(client); int i, eof; socklen_t siz; struct passwd *pw; gfarm_error_t e = GFARM_ERR_NO_ERROR; char *user, *home, *shell; char *user_env, *home_env, *shell_env, *xauth_env; /* cred_end */ static char user_format[] = "USER=%s"; static char home_format[] = "HOME=%s"; static char shell_format[] = "SHELL=%s"; static char path_env[] = GFARM_DEFAULT_PATH; #define N_EXTRA_ENV 4 /* user_env, home_env, shell_env, path_env */ int use_cred_env = cred_env != NULL ? 1 : 0; static char xauth_format[] = "XAUTHORITY=%s"; static char xauth_template[] = "/tmp/.xaXXXXXX"; static char xauth_filename[sizeof(xauth_template)]; int use_xauth_env = 0; size_t size; int overflow = 0; #ifdef __GNUC__ /* workaround gcc warning: might be used uninitialized */ envp = NULL; user_env = home_env =shell_env = xauth_env = NULL; #endif gfs_server_get_request(client, "command", "siii", &path, &argc, &nenv, &flags); argc_opt = flags & GFS_CLIENT_COMMAND_FLAG_SHELL_COMMAND ? 2 : 0; /* 2 for "$SHELL" + "-c" */ size = gfarm_size_add(&overflow, argc, argc_opt + 1); if (!overflow) GFARM_MALLOC_ARRAY(argv_storage, size); if (overflow || argv_storage == NULL) { e = GFARM_ERR_NO_MEMORY; goto rpc_error; } argv = argv_storage + argc_opt; if ((flags & GFS_CLIENT_COMMAND_FLAG_XAUTHCOPY) != 0) use_xauth_env = 1; size = gfarm_size_add(&overflow, nenv, N_EXTRA_ENV + use_cred_env + use_xauth_env + 1); if (!overflow) GFARM_MALLOC_ARRAY(envp, size); if (overflow || envp == NULL) { e = GFARM_ERR_NO_MEMORY; goto free_argv; } user = gfarm_get_local_username(); home = gfarm_get_local_homedir(); GFARM_MALLOC_ARRAY(user_env, sizeof(user_format) + strlen(user)); if (user_env == NULL) { e = GFARM_ERR_NO_MEMORY; goto free_envp; } sprintf(user_env, user_format, user); GFARM_MALLOC_ARRAY(home_env, sizeof(home_format) + strlen(home)); if (home_env == NULL) { e = GFARM_ERR_NO_MEMORY; goto free_user_env; } sprintf(home_env, home_format, home); pw = getpwnam(user); if (pw == NULL) fatal(GFARM_MSG_1000548, "%s: user doesn't exist", user); shell = pw->pw_shell; if (*shell == '\0') shell = PATH_BSHELL; if ((flags & GFS_CLIENT_COMMAND_FLAG_SHELL_COMMAND) == 0) { /* * SECURITY. * disallow anyone who doesn't have a standard shell. */ char *s; while ((s = getusershell()) != NULL) if (strcmp(s, shell) == 0) break; endusershell(); if (s == NULL) { e = GFARM_ERR_OPERATION_NOT_PERMITTED; goto free_home_env; } } GFARM_MALLOC_ARRAY(shell_env, sizeof(shell_format) + strlen(shell)); if (shell_env == NULL) { e = GFARM_ERR_NO_MEMORY; goto free_home_env; } sprintf(shell_env, shell_format, shell); argv[argc] = envp[nenv + N_EXTRA_ENV + use_cred_env + use_xauth_env] = NULL; envp[nenv + 0] = user_env; envp[nenv + 1] = home_env; envp[nenv + 2] = shell_env; envp[nenv + 3] = path_env; for (i = 0; i < argc; i++) { e = gfp_xdr_recv(client, 0, &eof, "s", &argv[i]); if (e != GFARM_ERR_NO_ERROR || eof) { while (--i >= 0) free(argv[i]); goto free_shell_env; } } for (i = 0; i < nenv; i++) { e = gfp_xdr_recv(client, 0, &eof, "s", &envp[i]); if (e != GFARM_ERR_NO_ERROR || eof) { while (--i >= 0) free(envp[i]); goto free_argv_array; } } if ((flags & GFS_CLIENT_COMMAND_FLAG_SHELL_COMMAND) != 0) { argv_storage[0] = shell; argv_storage[1] = "-c"; argv[1] = NULL; /* ignore argv[1 ... argc - 1] in this case. */ command = shell; } else { command = path; } if (use_cred_env) envp[nenv + N_EXTRA_ENV] = cred_env; if (use_xauth_env) { static char xauth_command_format[] = "%s %s nmerge - 2>/dev/null"; char *xauth_command; FILE *fp; int xauth_fd; e = gfp_xdr_recv(client, 0, &eof, "s", &xauth); if (e != GFARM_ERR_NO_ERROR || eof) goto free_envp_array; /* * don't touch $HOME/.Xauthority to avoid lock contention * on NFS home. (Is this really better? XXX) */ xauth_fd = mkstemp(strcpy(xauth_filename, xauth_template)); if (xauth_fd == -1) goto free_xauth; close(xauth_fd); GFARM_MALLOC_ARRAY(xauth_env, sizeof(xauth_format) + sizeof(xauth_filename)); if (xauth_env == NULL) goto remove_xauth; sprintf(xauth_env, xauth_format, xauth_filename); envp[nenv + N_EXTRA_ENV + use_cred_env] = xauth_env; GFARM_MALLOC_ARRAY(xauth_command, sizeof(xauth_command_format) + strlen(xauth_env) + strlen(XAUTH_COMMAND)); if (xauth_command == NULL) goto free_xauth_env; sprintf(xauth_command, xauth_command_format, xauth_env, XAUTH_COMMAND); if ((fp = popen(xauth_command, "w")) == NULL) goto free_xauth_env; fputs(xauth, fp); pclose(fp); free(xauth_command); } #if 1 /* * The reason why we use socketpair(2) instead of pipe(2) is * to make bash read ~/.bashrc. Because the condition that * bash reads it is as follows: * 1. $SSH_CLIENT/$SSH2_CLIENT is set, or stdin is a socket. * and * 2. $SHLVL < 2 * This condition that bash uses is broken, for example, this * doesn't actually work with Sun's variant of OpenSSH on Solaris 9. * * Read the comment about shutdown(2) in gfs_server_command_io_fd_set() * too. * Honestly, people should use zsh instead of bash. */ if (socketpair(PF_UNIX, SOCK_STREAM, 0, stdin_pipe) == -1) #else if (pipe(stdin_pipe) == -1) #endif { e = gfarm_errno_to_error(errno); goto free_xauth_env; } if (pipe(stdout_pipe) == -1) { e = gfarm_errno_to_error(errno); goto close_stdin_pipe; } if (pipe(stderr_pipe) == -1) { e = gfarm_errno_to_error(errno); goto close_stdout_pipe; } cc->pid = cc->exited_pid = 0; if ((cc->pid = fork()) == 0) { struct rlimit rlim; /* * XXX - Some Linux distributions set coredump size 0 * by default. */ if (getrlimit(RLIMIT_CORE, &rlim) != -1) { rlim.rlim_cur = rlim.rlim_max; setrlimit(RLIMIT_CORE, &rlim); } /* child */ dup2(stdin_pipe[0], 0); dup2(stdout_pipe[1], 1); dup2(stderr_pipe[1], 2); close(stderr_pipe[1]); close(stderr_pipe[0]); close(stdout_pipe[1]); close(stdout_pipe[0]); close(stdin_pipe[1]); close(stdin_pipe[0]); /* close client connection, syslog and other sockets */ for (i = 3; i < stderr_pipe[1]; i++) close(i); /* re-install default signal handler (see main) */ if (signal(SIGPIPE, SIG_DFL) == SIG_ERR) gflog_error_errno(GFARM_MSG_1002384, "signal(SIGPIPE, SIG_DFL)"); /* * create a process group * to make it possible to send a signal later */ setpgid(0, getpid()); umask(command_umask); execve(command, argv_storage, envp); fprintf(stderr, "%s: ", gfarm_host_get_self_name()); perror(path); _exit(1); } else if (cc->pid == -1) { e = gfarm_errno_to_error(errno); goto close_stderr_pipe; } close(stderr_pipe[1]); close(stdout_pipe[1]); close(stdin_pipe[0]); error = GFARM_ERR_NO_ERROR; goto rpc_reply; close_stderr_pipe: close(stderr_pipe[0]); close(stderr_pipe[1]); close_stdout_pipe: close(stdout_pipe[0]); close(stdout_pipe[1]); close_stdin_pipe: close(stdin_pipe[0]); close(stdin_pipe[1]); free_xauth_env: if (use_xauth_env) free(xauth_env); remove_xauth: if (use_xauth_env) unlink(xauth_filename); free_xauth: if (use_xauth_env) free(xauth); free_envp_array: for (i = 0; i < nenv; i++) free(envp[i]); free_argv_array: for (i = 0; i < argc; i++) free(argv[i]); free_shell_env: free(shell_env); free_home_env: free(home_env); free_user_env: free(user_env); free_envp: free(envp); free_argv: free(argv_storage); rpc_error: free(path); error = e; rpc_reply: gfs_server_put_reply(client, "command-start", error, "i", cc->pid); gfp_xdr_flush(client); if (error != GFARM_ERR_NO_ERROR) return; /* * Now, we set the connection file descriptor non-blocking mode. */ if (fcntl(conn_fd, F_SETFL, O_NONBLOCK) == -1) /* shouldn't fail */ gflog_warning(GFARM_MSG_1000549, "command-start:nonblock: %s", strerror(errno)); siz = sizeof(i); if (getsockopt(conn_fd, SOL_SOCKET, SO_RCVBUF, &i, &siz)) i = GFARM_DEFAULT_COMMAND_IOBUF_SIZE; cc->iobuffer[FDESC_STDIN] = gfarm_iobuffer_alloc(i); siz = sizeof(i); if (getsockopt(conn_fd, SOL_SOCKET, SO_SNDBUF, &i, &siz)) i = GFARM_DEFAULT_COMMAND_IOBUF_SIZE; cc->iobuffer[FDESC_STDOUT] = gfarm_iobuffer_alloc(i); cc->iobuffer[FDESC_STDERR] = gfarm_iobuffer_alloc(i); /* * It's safe to use gfarm_iobuffer_set_nonblocking_write_fd() * instead of gfarm_iobuffer_set_nonblocking_write_socket() here, * because we always ignore SIGPIPE in gfsd. * cf. gfarm_sigpipe_ignore() in main(). */ gfarm_iobuffer_set_nonblocking_read_xxx( cc->iobuffer[FDESC_STDIN], client); gfarm_iobuffer_set_nonblocking_write_fd( cc->iobuffer[FDESC_STDIN], stdin_pipe[1]); gfarm_iobuffer_set_nonblocking_read_fd( cc->iobuffer[FDESC_STDOUT], stdout_pipe[0]); gfarm_iobuffer_set_nonblocking_write_xxx( cc->iobuffer[FDESC_STDOUT], client); gfarm_iobuffer_set_nonblocking_read_fd( cc->iobuffer[FDESC_STDERR], stderr_pipe[0]); gfarm_iobuffer_set_nonblocking_write_xxx( cc->iobuffer[FDESC_STDERR], client); while (cc->server_state != GFS_COMMAND_SERVER_STATE_EXITED) gfs_server_command_io(client, NULL); gfs_server_client_command_result(client); /* * clean up */ gfarm_iobuffer_free(cc->iobuffer[FDESC_STDIN]); gfarm_iobuffer_free(cc->iobuffer[FDESC_STDOUT]); gfarm_iobuffer_free(cc->iobuffer[FDESC_STDERR]); close(stderr_pipe[0]); close(stdout_pipe[0]); close(stdin_pipe[1]); if (use_xauth_env) { free(xauth_env); unlink(xauth_filename); free(xauth); } for (i = 0; i < nenv; i++) free(envp[i]); for (i = 0; i < argc; i++) free(argv[i]); free(shell_env); free(home_env); free(user_env); free(envp); free(argv_storage); free(path); } #endif /* not yet in gfarm v2 */ static void gfm_client_connect_with_reconnection() { gfarm_error_t e; unsigned int sleep_interval = 10; /* 10 sec */ unsigned int sleep_max_interval = 640; /* about 10 min */ e = gfm_client_connect(gfarm_metadb_server_name, gfarm_metadb_server_port, &gfm_server, listen_addrname); while (e != GFARM_ERR_NO_ERROR) { /* suppress excessive log */ if (sleep_interval < sleep_max_interval) gflog_error(GFARM_MSG_1000550, "connecting to gfmd at %s:%d failed, " "sleep %d sec: %s", gfarm_metadb_server_name, gfarm_metadb_server_port, sleep_interval, gfarm_error_string(e)); sleep(sleep_interval); e = gfm_client_connect(gfarm_metadb_server_name, gfarm_metadb_server_port, &gfm_server, listen_addrname); if (sleep_interval < sleep_max_interval) sleep_interval *= 2; } /* * If canonical_self_name is specified (by the command-line * argument), send the hostname to identify myself. If not * sending the hostname, the canonical name will be decided by * the gfmd using the reverse lookup of the connected IP * address. */ if (canonical_self_name != NULL && (e = gfm_client_hostname_set(gfm_server, canonical_self_name)) != GFARM_ERR_NO_ERROR) fatal(GFARM_MSG_1000551, "cannot set canonical hostname of this node (%s), " "died: %s\n", canonical_self_name, gfarm_error_string(e)); } static void gfm_client_reconnect(void) { gfm_client_connection_free(gfm_server); gfm_server = NULL; gfm_client_connect_with_reconnection(); } void server(int client_fd, char *client_name, struct sockaddr *client_addr) { gfarm_error_t e; struct gfp_xdr *client; int eof; gfarm_int32_t request; char *aux, addr_string[GFARM_SOCKADDR_STRLEN]; enum gfarm_auth_id_type peer_type; enum gfarm_auth_method auth_method; gfm_client_connect_with_reconnection(); if (client_name == NULL) { /* i.e. not UNIX domain socket case */ char *s; int port; e = gfarm_sockaddr_to_name(client_addr, &client_name); if (e != GFARM_ERR_NO_ERROR) { gfarm_sockaddr_to_string(client_addr, addr_string, GFARM_SOCKADDR_STRLEN); gflog_warning(GFARM_MSG_1000552, "%s: %s", addr_string, gfarm_error_string(e)); client_name = strdup(addr_string); if (client_name == NULL) fatal(GFARM_MSG_1000553, "%s: no memory", addr_string); } e = gfm_host_get_canonical_name(gfm_server, client_name, &s, &port); if (e == GFARM_ERR_NO_ERROR) { free(client_name); client_name = s; } } #if 0 /* not yet in gfarm v2 */ e = gfarm_netparam_config_get_long(&gfarm_netparam_file_read_size, client_name, client_addr, &file_read_size); if (e != GFARM_ERR_NO_ERROR) /* shouldn't happen */ fatal("file_read_size: %s", gfarm_error_string(e)); e = gfarm_netparam_config_get_long(&gfarm_netparam_rate_limit, client_name, client_addr, &rate_limit); if (e != GFARM_ERR_NO_ERROR) /* shouldn't happen */ fatal("rate_limit: %s", gfarm_error_string(e)); #else file_read_size = GFS_PROTO_MAX_IOSIZE; #endif /* not yet in gfarm v2 */ e = gfp_xdr_new_socket(client_fd, &client); if (e != GFARM_ERR_NO_ERROR) { close(client_fd); fatal(GFARM_MSG_1000554, "%s: gfp_xdr_new: %s", client_name, gfarm_error_string(e)); } e = gfarm_authorize(client, 0, GFS_SERVICE_TAG, client_name, client_addr, gfarm_auth_uid_to_global_username, gfm_server, &peer_type, &username, &auth_method); if (e != GFARM_ERR_NO_ERROR) fatal(GFARM_MSG_1000555, "%s: gfarm_authorize: %s", client_name, gfarm_error_string(e)); GFARM_MALLOC_ARRAY(aux, strlen(username)+1 + strlen(client_name)+1); if (aux == NULL) fatal(GFARM_MSG_1000556, "%s: no memory\n", client_name); sprintf(aux, "%s@%s", username, client_name); gflog_set_auxiliary_info(aux); /* set file creation mask */ command_umask = umask(0); for (;;) { e = gfp_xdr_recv(client, 0, &eof, "i", &request); if (e != GFARM_ERR_NO_ERROR) fatal(GFARM_MSG_1000557, "request number: %s", gfarm_error_string(e)); if (eof) { /* * XXX FIXME update metadata of all opened * file descriptor before exit. */ cleanup(0); exit(0); } switch (request) { case GFS_PROTO_PROCESS_SET: gfs_server_process_set(client); break; case GFS_PROTO_OPEN_LOCAL: gfs_server_open_local(client); break; case GFS_PROTO_OPEN: gfs_server_open(client); break; case GFS_PROTO_CLOSE: gfs_server_close(client); break; case GFS_PROTO_PREAD: gfs_server_pread(client); break; case GFS_PROTO_PWRITE: gfs_server_pwrite(client); break; case GFS_PROTO_FTRUNCATE: gfs_server_ftruncate(client); break; case GFS_PROTO_FSYNC: gfs_server_fsync(client); break; case GFS_PROTO_FSTAT: gfs_server_fstat(client); break; case GFS_PROTO_CKSUM_SET: gfs_server_cksum_set(client); break; case GFS_PROTO_STATFS: gfs_server_statfs(client); break; #if 0 /* not yet in gfarm v2 */ case GFS_PROTO_COMMAND: if (credential_exported == NULL) { e = gfp_xdr_export_credential(client); if (e == GFARM_ERR_NO_ERROR) credential_exported = client; else gflog_warning(GFARM_MSG_UNUSED, "export delegated credential: %s", gfarm_error_string(e)); } gfs_server_command(client, credential_exported == NULL ? NULL : gfp_xdr_env_for_credential(client)); break; #endif /* not yet in gfarm v2 */ case GFS_PROTO_REPLICA_ADD_FROM: gfs_server_replica_add_from(client); break; case GFS_PROTO_REPLICA_RECV: gfs_server_replica_recv(client, peer_type); break; default: gflog_warning(GFARM_MSG_1000558, "unknown request %d", (int)request); cleanup(0); exit(1); } if (gfm_client_is_connection_error( gfp_xdr_flush(gfm_client_connection_conn(gfm_server)))) gfm_client_reconnect(); } } void start_server(int accepting_sock, struct sockaddr *client_addr_storage, socklen_t client_addr_size, struct sockaddr *client_addr, char *client_name, struct accepting_sockets *accepting) { int i, client = accept(accepting_sock, client_addr_storage, &client_addr_size); if (client < 0) { if (errno == EINTR || errno == ECONNABORTED || #ifdef EPROTO errno == EPROTO || #endif errno == EAGAIN) return; fatal_errno(GFARM_MSG_1000559, "accept"); } #ifndef GFSD_DEBUG switch (fork()) { case 0: #endif for (i = 0; i < accepting->local_socks_count; i++) close(accepting->local_socks[i].sock); close(accepting->tcp_sock); for (i = 0; i < accepting->udp_socks_count; i++) close(accepting->udp_socks[i]); server(client, client_name, client_addr); /*NOTREACHED*/ #ifndef GFSD_DEBUG case -1: gflog_warning_errno(GFARM_MSG_1000560, "fork"); /*FALLTHROUGH*/ default: close(client); break; } #endif } /* XXX FIXME: add protocol magic number and transaction ID */ void datagram_server(int sock) { int rv; struct sockaddr_in client_addr; socklen_t client_addr_size = sizeof(client_addr); double loadavg[3]; #ifndef WORDS_BIGENDIAN struct { char c[8]; } nloadavg[3]; #else # define nloadavg loadavg #endif char buffer[1024]; rv = recvfrom(sock, buffer, sizeof(buffer), 0, (struct sockaddr *)&client_addr, &client_addr_size); if (rv == -1) return; rv = getloadavg(loadavg, GFARM_ARRAY_LENGTH(loadavg)); if (rv == -1) { gflog_warning(GFARM_MSG_1000561, "datagram_server: cannot get load average"); return; } #ifndef WORDS_BIGENDIAN swab(&loadavg[0], &nloadavg[0], sizeof(nloadavg[0])); swab(&loadavg[1], &nloadavg[1], sizeof(nloadavg[1])); swab(&loadavg[2], &nloadavg[2], sizeof(nloadavg[2])); #endif rv = sendto(sock, nloadavg, sizeof(nloadavg), 0, (struct sockaddr *)&client_addr, sizeof(client_addr)); } gfarm_int32_t gfm_async_client_replication_result(void *peer, void *arg, size_t size) { struct gfp_xdr *bc_conn = peer; return (gfm_async_client_recv_reply(bc_conn, "gfm_async_client_replication_result", size, "")); } /* * called from gfp_xdr_async_peer_free() via gfp_xdr_async_xid_free(), * when disconnected. */ void gfm_async_client_replication_free(void *peer, void *arg) { #if 0 struct gfp_xdr *bc_conn = peer; #endif } gfarm_error_t replication_result_notify(struct gfp_xdr *bc_conn, gfp_xdr_async_peer_t async, struct gfarm_hash_entry *q) { gfarm_error_t e, e2 = GFARM_ERR_NO_ERROR; struct replication_queue_data *qd = gfarm_hash_entry_data(q); struct replication_request *rep = qd->head; struct replication_errcodes errcodes; int rv = read(rep->pipe_fd, &errcodes, sizeof(errcodes)), status; struct stat st; static const char diag[] = "GFM_PROTO_REPLICATION_RESULT"; if (rv != sizeof(errcodes)) { if (rv == -1) { gflog_error(GFARM_MSG_1002191, "%s: cannot read child result: %s", diag, strerror(errno)); } else { gflog_error(GFARM_MSG_1002192, "%s: too short child result: %d bytes", diag, rv); } errcodes.src_errcode = 0; errcodes.dst_errcode = GFARM_ERR_UNKNOWN; } else if (fstat(rep->file_fd, &st) == -1) { gflog_error(GFARM_MSG_1002193, "%s: cannot stat local fd: %s", diag, strerror(errno)); if (errcodes.dst_errcode == GFARM_ERR_NO_ERROR) errcodes.dst_errcode = GFARM_ERR_UNKNOWN; } e = gfm_async_client_send_request(bc_conn, async, diag, gfm_async_client_replication_result, gfm_async_client_replication_free, /* rep */ NULL, GFM_PROTO_REPLICATION_RESULT, "llliil", rep->ino, rep->gen, (gfarm_int64_t)rep->pid, errcodes.src_errcode, errcodes.dst_errcode, (gfarm_int64_t)st.st_size); close(rep->pipe_fd); close(rep->file_fd); if ((rv = waitpid(rep->pid, &status, 0)) == -1) gflog_warning(GFARM_MSG_1002303, "replication(%lld, %lld): child %d: %s", (long long)rep->ino, (long long)rep->gen, (int)rep->pid, strerror(errno)); if (gfs_client_is_connection_error(errcodes.src_errcode)) gfs_client_purge_from_cache(rep->src_gfsd); gfs_client_connection_free(rep->src_gfsd); rep->ongoing_prev->ongoing_next = rep->ongoing_next; rep->ongoing_next->ongoing_prev = rep->ongoing_prev; rep = rep->q_next; free(qd->head); qd->head = rep; if (rep == NULL) { qd->tail = &qd->head; } else { e2 = start_replication(bc_conn, q); } return (e != GFARM_ERR_NO_ERROR ? e : e2); } static int watch_fds(struct gfp_xdr *conn, gfp_xdr_async_peer_t async) { gfarm_error_t e; fd_set fds; /* XXX select FD_SETSIZE */ struct replication_request *rep, *next; int nfound, max_fd; struct timeval timeout; for (;;) { FD_ZERO(&fds); max_fd = gfp_xdr_fd(conn); FD_SET(max_fd, &fds); for (rep = ongoing_replications.ongoing_next; rep != &ongoing_replications; rep = rep->ongoing_next) { FD_SET(rep->pipe_fd, &fds); if (max_fd < rep->pipe_fd) max_fd = rep->pipe_fd; } timeout.tv_sec = gfarm_metadb_heartbeat_interval * 2; timeout.tv_usec = 0; nfound = select(max_fd + 1, &fds, NULL, NULL, &timeout); if (nfound == 0) { gflog_error(GFARM_MSG_1002304, "back channel: gfmd is down"); return (0); } if (nfound < 0) { if (errno == EINTR || errno == EAGAIN) continue; fatal_errno(GFARM_MSG_1002194, "back channel select"); } for (rep = ongoing_replications.ongoing_next; rep != &ongoing_replications; rep = next) { if (FD_ISSET(rep->pipe_fd, &fds)) { /* * replication_result_notify() may add an entry * at the tail of the ongoing_replications. * accessing and ignoring the new entry at * further iteration of this loop are both ok. */ next = rep->ongoing_next; /* * the following is necessary to make it * possible to access a new entry in this loop. * note that the new entry may use same pipe_fd * with this rep->pipe_fd. */ FD_CLR(rep->pipe_fd, &fds); e = replication_result_notify(conn, async, rep->q); if (e != GFARM_ERR_NO_ERROR) { gflog_error(GFARM_MSG_1002385, "back channel: " "communication error: %s", gfarm_error_string(e)); return (0); } } else { next = rep->ongoing_next; } } if (FD_ISSET(gfp_xdr_fd(conn), &fds)) return (1); } } static void kill_pending_replications(void) { struct gfarm_hash_iterator it; struct gfarm_hash_entry *q; struct replication_queue_data *qd; struct replication_request *rep, *next; if (replication_queue_set == NULL) return; for (gfarm_hash_iterator_begin(replication_queue_set, &it); !gfarm_hash_iterator_is_end(&it); gfarm_hash_iterator_next(&it)) { q = gfarm_hash_iterator_access(&it); qd = gfarm_hash_entry_data(q); if (qd->head == NULL) continue; /* do not free active replication (i.e. qd->head) */ for (rep = qd->head->q_next; rep != NULL; rep = next) { next = rep->q_next; gflog_debug(GFARM_MSG_1002518, "forget pending replication request " "%s:%d %lld:%lld", gfp_conn_hash_hostname(q), gfp_conn_hash_port(q), (long long)rep->ino, (long long)rep->gen); free(rep); } qd->head->q_next = NULL; qd->tail = &qd->head->q_next; } } static void back_channel_server(void) { gfarm_error_t e; struct gfm_connection *back_channel; struct gfp_xdr *bc_conn; gfp_xdr_async_peer_t async; enum gfp_xdr_msg_type type; gfp_xdr_xid_t xid; size_t size; gfarm_int32_t gfmd_knows_me, rv, request; static int hack_to_make_cookie_not_work = 0; /* XXX FIXME */ for (;;) { e = gfm_client_switch_async_back_channel(gfm_server, GFS_PROTOCOL_VERSION, (gfarm_int64_t)(getpid() + hack_to_make_cookie_not_work++), &gfmd_knows_me); if (e != GFARM_ERR_NO_ERROR) { /* * gfmd has to be newer than gfsd. * so we won't try GFM_PROTO_SWITCH_BACK_CHANNEL, * if GFM_PROTO_SWITCH_TO_ASYNC_BACK_CHANNEL is * not supported. */ fatal(GFARM_MSG_1000562, "cannot switch to async back channel: %s", gfarm_error_string(e)); } e = gfp_xdr_async_peer_new(&async); if (e != GFARM_ERR_NO_ERROR) { fatal(GFARM_MSG_1002195, "cannot allocate resource for async protocol: %s", gfarm_error_string(e)); } back_channel = gfm_server; bc_conn = gfm_client_connection_conn(gfm_server); /* create another gfmd connection for a foreground channel */ gfm_server = NULL; gfm_client_connect_with_reconnection(); gflog_debug(GFARM_MSG_1000563, "back channel mode"); for (;;) { if (!gfp_xdr_recv_is_ready(bc_conn)) { if (!watch_fds(bc_conn, async)) break; } e = gfp_xdr_recv_async_header(bc_conn, 0, &type, &xid, &size); if (e != GFARM_ERR_NO_ERROR) { if (e == GFARM_ERR_UNEXPECTED_EOF) { gflog_error(GFARM_MSG_1002386, "back channel disconnected"); } else { gflog_error(GFARM_MSG_1002387, "back channel RPC protocol error, " "reset: %s", gfarm_error_string(e)); } break; } if (type == GFP_XDR_TYPE_RESULT) { e = gfp_xdr_callback_async_result(async, bc_conn, xid, size, &rv); if (e != GFARM_ERR_NO_ERROR) { gflog_warning(GFARM_MSG_1002196, "(back channel) unknown reply " "xid:%d size:%d", (int)xid, (int)size); e = gfp_xdr_purge(bc_conn, 0, size); if (e != GFARM_ERR_NO_ERROR) { gflog_error(GFARM_MSG_1002197, "skipping %d bytes: %s", (int)size, gfarm_error_string(e)); break; } } else if (IS_CONNECTION_ERROR(rv)) { gflog_error(GFARM_MSG_1002198, "back channel result: %s", gfarm_error_string(e)); break; } continue; } else if (type != GFP_XDR_TYPE_REQUEST) { fatal(GFARM_MSG_1002199, "async_back_channel_service: type %d", type); } e = gfp_xdr_recv_request_command(bc_conn, 0, &size, &request); if (e != GFARM_ERR_NO_ERROR) { if (e == GFARM_ERR_UNEXPECTED_EOF) { gflog_error(GFARM_MSG_1000564, "back channel disconnected"); } else { gflog_error(GFARM_MSG_1000565, "(back channel) request error, " "reset: %s", gfarm_error_string(e)); } break; } switch (request) { case GFS_PROTO_FHSTAT: e = gfs_async_server_fhstat( bc_conn, xid, size); break; case GFS_PROTO_FHREMOVE: e = gfs_async_server_fhremove( bc_conn, xid, size); break; case GFS_PROTO_STATUS: e = gfs_async_server_status( bc_conn, xid, size); break; case GFS_PROTO_REPLICATION_REQUEST: e = gfs_async_server_replication_request( bc_conn, xid, size); break; default: gflog_error(GFARM_MSG_1000566, "(back channel) unknown request %d " "(xid:%d size:%d), skip", (int)request, (int)xid, (int)size); e = gfp_xdr_purge(bc_conn, 0, size); if (e != GFARM_ERR_NO_ERROR) { gflog_error(GFARM_MSG_1002200, "skipping %d bytes: %s", (int)size, gfarm_error_string(e)); } break; } if (e != GFARM_ERR_NO_ERROR) break; } kill_pending_replications(); /* free the foreground channel */ gfm_client_connection_free(gfm_server); gfp_xdr_async_peer_free(async, bc_conn); gfm_server = back_channel; gfm_client_reconnect(); } } static void start_back_channel_server(void) { pid_t pid; pid = fork(); switch (pid) { case 0: back_channel_gfsd_pid = getpid(); back_channel_server(); /*NOTREACHED*/ case -1: gflog_warning_errno(GFARM_MSG_1000567, "fork"); /*FALLTHROUGH*/ default: back_channel_gfsd_pid = pid; gfm_client_connection_free(gfm_server); gfm_server = NULL; break; } } int open_accepting_tcp_socket(struct in_addr address, int port) { gfarm_error_t e; struct sockaddr_in self_addr; socklen_t self_addr_size; int sock, sockopt; memset(&self_addr, 0, sizeof(self_addr)); self_addr.sin_family = AF_INET; self_addr.sin_addr = address; self_addr.sin_port = htons(port); self_addr_size = sizeof(self_addr); sock = socket(PF_INET, SOCK_STREAM, 0); if (sock < 0) accepting_fatal_errno(GFARM_MSG_1000568, "accepting socket"); sockopt = 1; if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &sockopt, sizeof(sockopt)) == -1) gflog_warning_errno(GFARM_MSG_1000569, "SO_REUSEADDR"); if (bind(sock, (struct sockaddr *)&self_addr, self_addr_size) < 0) accepting_fatal_errno(GFARM_MSG_1000570, "bind accepting socket"); e = gfarm_sockopt_apply_listener(sock); if (e != GFARM_ERR_NO_ERROR) gflog_warning(GFARM_MSG_1000571, "setsockopt: %s", gfarm_error_string(e)); if (listen(sock, LISTEN_BACKLOG) < 0) accepting_fatal_errno(GFARM_MSG_1000572, "listen"); return (sock); } void open_accepting_local_socket(struct in_addr address, int port, struct local_socket *result) { struct sockaddr_un self_addr; socklen_t self_addr_size; int sock, save_errno; char *sock_name, *sock_dir, dir_buf[PATH_MAX]; struct stat st; memset(&self_addr, 0, sizeof(self_addr)); self_addr.sun_family = AF_UNIX; snprintf(self_addr.sun_path, sizeof self_addr.sun_path, GFSD_LOCAL_SOCKET_NAME, inet_ntoa(address), port); self_addr_size = sizeof(self_addr); snprintf(dir_buf, sizeof dir_buf, GFSD_LOCAL_SOCKET_DIR, inet_ntoa(address), port); sock_name = strdup(self_addr.sun_path); sock_dir = strdup(dir_buf); if (sock_name == NULL || sock_dir == NULL) accepting_fatal(GFARM_MSG_1000573, "not enough memory"); /* to make sure */ if (unlink(sock_name) == 0) gflog_info(GFARM_MSG_1002441, "%s: remaining socket found and removed", sock_name); else if (errno != ENOENT) accepting_fatal_errno(GFARM_MSG_1002442, "%s: failed to remove remaining socket", sock_name); if (rmdir(sock_dir) == 0) gflog_info(GFARM_MSG_1002443, "%s: remaining socket directory found and removed", sock_dir); else if (errno != ENOENT) /* something wrong, but tries to continue */ gflog_error_errno(GFARM_MSG_1002444, "%s: failed to remove remaining socket directory", sock_dir); if (mkdir(sock_dir, LOCAL_SOCKDIR_MODE) == -1) { if (errno != EEXIST) { accepting_fatal_errno(GFARM_MSG_1000574, "%s: cannot mkdir", sock_dir); } else if (stat(sock_dir, &st) != 0) { accepting_fatal_errno(GFARM_MSG_1000575, "stat(%s)", sock_dir); } else if (st.st_uid != gfsd_uid) { accepting_fatal(GFARM_MSG_1000576, "%s: not owned by uid %d", sock_dir, gfsd_uid); } else if ((st.st_mode & PERMISSION_MASK) != LOCAL_SOCKDIR_MODE && chmod(sock_dir, LOCAL_SOCKDIR_MODE) != 0) { accepting_fatal_errno(GFARM_MSG_1000577, "%s: cannot chmod to 0%o", sock_dir, LOCAL_SOCKDIR_MODE); } } if (chown(sock_dir, gfsd_uid, -1) == -1) gflog_warning_errno(GFARM_MSG_1002201, "chown(%s, %d)", sock_dir, (int)gfsd_uid); sock = socket(PF_UNIX, SOCK_STREAM, 0); if (sock < 0) { save_errno = errno; if (rmdir(sock_dir) == -1) gflog_error_errno(GFARM_MSG_1002388, "rmdir(%s)", sock_dir); accepting_fatal(GFARM_MSG_1000578, "creating UNIX domain socket: %s", strerror(save_errno)); } if (bind(sock, (struct sockaddr *)&self_addr, self_addr_size) == -1) { save_errno = errno; if (rmdir(sock_dir) == -1) gflog_error_errno(GFARM_MSG_1002389, "rmdir(%s)", sock_dir); accepting_fatal(GFARM_MSG_1000579, "%s: cannot bind UNIX domain socket: %s", sock_name, strerror(save_errno)); } if (chown(sock_name, gfsd_uid, -1) == -1) gflog_warning_errno(GFARM_MSG_1002202, "chown(%s, %d)", sock_name, gfsd_uid); /* ensure access from all user, Linux at least since 2.4 needs this. */ if (chmod(sock_name, LOCAL_SOCKET_MODE) == -1) gflog_debug_errno(GFARM_MSG_1002390, "chmod(%s, 0%o)", sock_name, (int)LOCAL_SOCKET_MODE); if (listen(sock, LISTEN_BACKLOG) == -1) { save_errno = errno; if (unlink(sock_name) == -1) gflog_error_errno(GFARM_MSG_1002391, "unlink(%s)", sock_name); if (rmdir(sock_dir) == -1) gflog_error_errno(GFARM_MSG_1002392, "rmdir(%s)", sock_dir); accepting_fatal(GFARM_MSG_1000580, "listen UNIX domain socket: %s", strerror(save_errno)); } result->sock = sock; result->name = sock_name; result->dir = sock_dir; } void open_accepting_local_sockets( int self_addresses_count, struct in_addr *self_addresses, int port, struct accepting_sockets *accepting) { int i; GFARM_MALLOC_ARRAY(accepting->local_socks, self_addresses_count); if (accepting->local_socks == NULL) accepting_fatal(GFARM_MSG_1000581, "not enough memory for UNIX sockets"); for (i = 0; i < self_addresses_count; i++) { open_accepting_local_socket(self_addresses[i], port, &accepting->local_socks[i]); /* for cleanup_accepting() */ accepting->local_socks_count = i + 1; } } int open_udp_socket(struct in_addr address, int port) { struct sockaddr_in bind_addr; socklen_t bind_addr_size; int s; memset(&bind_addr, 0, sizeof(bind_addr)); bind_addr.sin_family = AF_INET; bind_addr.sin_addr = address; bind_addr.sin_port = ntohs(port); bind_addr_size = sizeof(bind_addr); s = socket(PF_INET, SOCK_DGRAM, 0); if (s < 0) accepting_fatal_errno(GFARM_MSG_1000582, "UDP socket"); if (bind(s, (struct sockaddr *)&bind_addr, bind_addr_size) < 0) accepting_fatal_errno(GFARM_MSG_1000583, "UDP socket bind(%s, %d)", inet_ntoa(address), port); return (s); } int * open_datagram_service_sockets( int self_addresses_count, struct in_addr *self_addresses, int port) { int i, *sockets; GFARM_MALLOC_ARRAY(sockets, self_addresses_count); if (sockets == NULL) accepting_fatal(GFARM_MSG_1000584, "no memory for %d datagram sockets", self_addresses_count); for (i = 0; i < self_addresses_count; i++) sockets[i] = open_udp_socket(self_addresses[i], port); return (sockets); } void usage(void) { fprintf(stderr, "Usage: %s [option]\n", program_name); fprintf(stderr, "option:\n"); fprintf(stderr, "\t-L \n"); fprintf(stderr, "\t-P \n"); fprintf(stderr, "\t-c\t\t\t\t... check and display invalid files\n"); fprintf(stderr, "\t-cc\t\t\t\t... check and delete invalid files\n"); fprintf(stderr, "\t-d\t\t\t\t... debug mode\n"); fprintf(stderr, "\t-f \n"); fprintf(stderr, "\t-h \n"); fprintf(stderr, "\t-l \n"); fprintf(stderr, "\t-r \n"); fprintf(stderr, "\t-s \n"); fprintf(stderr, "\t-v\t\t\t\t... make authentication log verbose\n"); exit(1); } int main(int argc, char **argv) { struct sockaddr_in client_addr, *self_sockaddr_array; struct sockaddr_un client_local_addr; gfarm_error_t e, e2; char *config_file = NULL, *pid_file = NULL; char *local_gfsd_user; struct gfarm_host_info self_info; struct passwd *gfsd_pw; FILE *pid_fp = NULL; int syslog_facility = GFARM_DEFAULT_FACILITY; int syslog_level = -1; struct in_addr *self_addresses, listen_address; int table_size, self_addresses_count, ch, i, nfound, max_fd, p; struct sigaction sa; fd_set requests; struct stat sb; int spool_check_level = 0; int is_root = geteuid() == 0; if (argc >= 1) program_name = basename(argv[0]); gflog_set_identifier(program_name); while ((ch = getopt(argc, argv, "L:P:dcf:h:l:r:s:uv")) != -1) { switch (ch) { case 'L': syslog_level = gflog_syslog_name_to_priority(optarg); if (syslog_level == -1) gflog_fatal(GFARM_MSG_1000585, "-L %s: invalid syslog priority", optarg); break; case 'P': pid_file = optarg; break; case 'c': ++spool_check_level; break; case 'd': debug_mode = 1; if (syslog_level == -1) syslog_level = LOG_DEBUG; break; case 'f': config_file = optarg; break; case 'h': canonical_self_name = optarg; break; case 'l': listen_addrname = optarg; break; case 'r': gfarm_spool_root = strdup(optarg); if (gfarm_spool_root == NULL) gflog_fatal(GFARM_MSG_1000586, "%s", gfarm_error_string(GFARM_ERR_NO_MEMORY)); break; case 's': syslog_facility = gflog_syslog_name_to_facility(optarg); if (syslog_facility == -1) gflog_fatal(GFARM_MSG_1000587, "%s: unknown syslog facility", optarg); break; case 'u': restrict_user = 1; restricted_user = getuid(); break; case 'v': gflog_auth_set_verbose(1); break; case '?': default: usage(); } } argc -= optind; argv += optind; if (config_file != NULL) gfarm_config_set_filename(config_file); e = gfarm_server_initialize(); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "gfarm_server_initialize: %s\n", gfarm_error_string(e)); exit(1); } if (syslog_level != -1) gflog_set_priority_level(syslog_level); e = gfarm_global_to_local_username(GFSD_USERNAME, &local_gfsd_user); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "no local user for the global `%s' user.\n", GFSD_USERNAME); exit(1); } gfsd_pw = getpwnam(local_gfsd_user); if (gfsd_pw == NULL) { fprintf(stderr, "user `%s' is necessary, but doesn't exist.\n", local_gfsd_user); exit(1); } gfsd_uid = gfsd_pw->pw_uid; if (seteuid(gfsd_uid) == -1 && is_root) gflog_error_errno(GFARM_MSG_1002393, "seteuid(%d)", (int)gfsd_uid); e = gfarm_set_local_user_for_this_local_account(); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "acquiring information about user `%s': %s\n", local_gfsd_user, gfarm_error_string(e)); exit(1); } free(local_gfsd_user); e = gfarm_set_global_username(GFSD_USERNAME); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, ": gfarm_set_global_username: %s\n", gfarm_error_string(e)); exit(1); } /* sanity check on a spool directory */ if (stat(gfarm_spool_root, &sb) == -1) gflog_fatal_errno(GFARM_MSG_1000588, "%s", gfarm_spool_root); else if (!S_ISDIR(sb.st_mode)) gflog_fatal(GFARM_MSG_1000589, "%s: %s", gfarm_spool_root, gfarm_error_string(GFARM_ERR_NOT_A_DIRECTORY)); if (pid_file != NULL) { /* * We do this before calling gfarm_daemon() * to print the error message to stderr. */ if (seteuid(0) == -1 && is_root) gflog_error_errno(GFARM_MSG_1002394, "seteuid(0)"); pid_fp = fopen(pid_file, "w"); if (seteuid(gfsd_uid) == -1 && is_root) gflog_error_errno(GFARM_MSG_1002395, "seteuid(%d)", (int)gfsd_uid); if (pid_fp == NULL) accepting_fatal_errno(GFARM_MSG_1000590, "failed to open file: %s", pid_file); } if (!debug_mode) { gflog_syslog_open(LOG_PID, syslog_facility); if (gfarm_daemon(0, 0) == -1) gflog_warning_errno(GFARM_MSG_1002203, "daemon"); } /* We do this after calling gfarm_daemon(), because it changes pid. */ master_gfsd_pid = getpid(); sa.sa_handler = cleanup_handler; if (sigemptyset(&sa.sa_mask) == -1) gflog_fatal_errno(GFARM_MSG_1002396, "sigemptyset()"); sa.sa_flags = 0; if (sigaction(SIGHUP, &sa, NULL) == -1) /* XXX - need to restart gfsd */ gflog_fatal_errno(GFARM_MSG_1002397, "sigaction(SIGHUP)"); if (sigaction(SIGINT, &sa, NULL) == -1) gflog_fatal_errno(GFARM_MSG_1002398, "sigaction(SIGINT)"); if (sigaction(SIGTERM, &sa, NULL) == -1) gflog_fatal_errno(GFARM_MSG_1002399, "sigaction(SIGTERM)"); if (pid_file != NULL) { if (fprintf(pid_fp, "%ld\n", (long)master_gfsd_pid) == -1) gflog_error_errno(GFARM_MSG_1002400, "writing PID to %s", pid_file); if (fclose(pid_fp) != 0) gflog_error_errno(GFARM_MSG_1002401, "fclose(%s)", pid_file); } gfarm_set_auth_id_type(GFARM_AUTH_ID_TYPE_SPOOL_HOST); gfm_client_connect_with_reconnection(); /* * in case of canonical_self_name != NULL, get_canonical_self_name() * cannot be used because host_get_self_name() may not be registered. */ if (canonical_self_name == NULL && (e = gfm_host_get_canonical_self_name(gfm_server, &canonical_self_name, &p)) != GFARM_ERR_NO_ERROR) { gflog_fatal(GFARM_MSG_1000591, "cannot get canonical hostname of %s, ask admin to " "register this node in Gfarm metadata server, died: %s\n", gfarm_host_get_self_name(), gfarm_error_string(e)); } /* avoid gcc warning "passing arg 3 from incompatible pointer type" */ { const char *n = canonical_self_name; e = gfm_client_host_info_get_by_names(gfm_server, 1, &n, &e2, &self_info); } if (e == GFARM_ERR_NO_ERROR) e = e2; if (e != GFARM_ERR_NO_ERROR) { gflog_fatal(GFARM_MSG_1000592, "cannot get canonical hostname of %s, ask admin to " "register this node in Gfarm metadata server, died: %s\n", canonical_self_name, gfarm_error_string(e)); } if (seteuid(0) == -1 && is_root) gflog_error_errno(GFARM_MSG_1002402, "seteuid(0)"); if (listen_addrname == NULL) listen_addrname = gfarm_spool_server_listen_address; if (listen_addrname == NULL) { e = gfarm_get_ip_addresses( &self_addresses_count, &self_addresses); if (e != GFARM_ERR_NO_ERROR) gflog_fatal(GFARM_MSG_1000593, "get_ip_addresses: %s", gfarm_error_string(e)); listen_address.s_addr = INADDR_ANY; } else { struct hostent *hp = gethostbyname(listen_addrname); if (hp == NULL || hp->h_addrtype != AF_INET) gflog_fatal(GFARM_MSG_1000594, "listen address can't be resolved: %s", listen_addrname); self_addresses_count = 1; GFARM_MALLOC(self_addresses); if (self_addresses == NULL) gflog_fatal(GFARM_MSG_1000595, "%s", gfarm_error_string(GFARM_ERR_NO_MEMORY)); memcpy(self_addresses, hp->h_addr, sizeof(*self_addresses)); listen_address = *self_addresses; } GFARM_MALLOC_ARRAY(self_sockaddr_array, self_addresses_count); if (self_sockaddr_array == NULL) gflog_fatal(GFARM_MSG_1000596, "%s", gfarm_error_string(GFARM_ERR_NO_MEMORY)); for (i = 0; i < self_addresses_count; i++) { memset(&self_sockaddr_array[i], 0, sizeof(self_sockaddr_array[i])); self_sockaddr_array[i].sin_family = AF_INET; self_sockaddr_array[i].sin_addr = self_addresses[i]; self_sockaddr_array[i].sin_port = htons(self_info.port); } accepting.tcp_sock = open_accepting_tcp_socket( listen_address, self_info.port); /* sets accepting.local_socks_count and accepting.local_socks */ open_accepting_local_sockets( self_addresses_count, self_addresses, self_info.port, &accepting); accepting.udp_socks = open_datagram_service_sockets( self_addresses_count, self_addresses, self_info.port); accepting.udp_socks_count = self_addresses_count; max_fd = accepting.tcp_sock; for (i = 0; i < accepting.local_socks_count; i++) { if (max_fd < accepting.local_socks[i].sock) max_fd = accepting.local_socks[i].sock; } for (i = 0; i < accepting.udp_socks_count; i++) { if (max_fd < accepting.udp_socks[i]) max_fd = accepting.udp_socks[i]; } if (max_fd > FD_SETSIZE) accepting_fatal(GFARM_MSG_1000597, "too big socket file descriptor: %d", max_fd); if (seteuid(gfsd_uid) == -1) { int save_errno = errno; if (geteuid() == 0) gflog_error(GFARM_MSG_1002403, "seteuid(%d): %s", gfsd_uid, strerror(save_errno)); } /* XXX - kluge for gfrcmd (to mkdir HOME....) for now */ /* XXX - kluge for GFS_PROTO_STATFS for now */ if (chdir(gfarm_spool_root) == -1) gflog_fatal_errno(GFARM_MSG_1000598, "chdir(%s)", gfarm_spool_root); /* spool check */ if (spool_check_level > 0) (void)gfsd_spool_check(spool_check_level); /* * We don't want SIGPIPE, but want EPIPE on write(2)/close(2). */ if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) gflog_fatal_errno(GFARM_MSG_1002404, "signal(SIGPIPE, SIG_IGN)"); /* start back channel server */ start_back_channel_server(); table_size = FILE_TABLE_LIMIT; gfarm_unlimit_nofiles(&table_size); if (table_size > FILE_TABLE_LIMIT) table_size = FILE_TABLE_LIMIT; file_table_init(table_size); OpenSSL_add_all_digests(); /* for EVP_get_digestbyname() */ /* * Because SA_NOCLDWAIT is not implemented on some OS, * we do not rely on the feature. */ sa.sa_handler = sigchld_handler; if (sigemptyset(&sa.sa_mask) == -1) gflog_fatal_errno(GFARM_MSG_1002405, "sigemptyset"); sa.sa_flags = SA_NOCLDSTOP; if (sigaction(SIGCHLD, &sa, NULL) == -1) gflog_fatal_errno(GFARM_MSG_1002406, "sigaction(SIGCHLD)"); /* * To deal with race condition which may be caused by RST, * listening socket must be O_NONBLOCK, if the socket will be * used as a file descriptor for select(2) . * See section 16.6 of "UNIX NETWORK PROGRAMMING, Volume1, * Third Edition" by W. Richard Stevens, for detail. */ if (fcntl(accepting.tcp_sock, F_SETFL, fcntl(accepting.tcp_sock, F_GETFL, NULL) | O_NONBLOCK) == -1) gflog_warning_errno(GFARM_MSG_1000599, "accepting TCP socket O_NONBLOCK"); for (;;) { FD_ZERO(&requests); FD_SET(accepting.tcp_sock, &requests); for (i = 0; i < accepting.local_socks_count; i++) FD_SET(accepting.local_socks[i].sock, &requests); for (i = 0; i < accepting.udp_socks_count; i++) FD_SET(accepting.udp_socks[i], &requests); nfound = select(max_fd + 1, &requests, NULL, NULL, NULL); if (nfound <= 0) { if (nfound == 0 || errno == EINTR || errno == EAGAIN) continue; fatal_errno(GFARM_MSG_1000600, "select"); } if (FD_ISSET(accepting.tcp_sock, &requests)) { start_server(accepting.tcp_sock, (struct sockaddr*)&client_addr,sizeof(client_addr), (struct sockaddr*)&client_addr, NULL, &accepting); } for (i = 0; i < accepting.local_socks_count; i++) { if (FD_ISSET(accepting.local_socks[i].sock,&requests)){ start_server(accepting.local_socks[i].sock, (struct sockaddr *)&client_local_addr, sizeof(client_local_addr), (struct sockaddr*)&self_sockaddr_array[i], canonical_self_name, &accepting); } } for (i = 0; i < accepting.udp_socks_count; i++) { if (FD_ISSET(accepting.udp_socks[i], &requests)) datagram_server(accepting.udp_socks[i]); } } /*NOTREACHED*/ #ifdef __GNUC__ /* to shut up warning */ return (0); #endif } gfarm-2.4.1/Makefile.in0000644000000000000000000000127311507222727013365 0ustar rootroottop_builddir = . top_srcdir = @top_srcdir@ srcdir = @srcdir@ include $(top_srcdir)/makes/var.mk SUBDIRS = \ doc \ man \ include/gfarm \ lib \ server \ gftool \ util/ptool \ nls # `[ -d $(srcdir)/ns ] && echo ns` \ # gfptool \ # util/gfront \ # bench/thput-gfpio all: include $(top_srcdir)/makes/subdir.mk post-distclean-hook: -rm -rf autom4te.cache rm -f config.log config.status config.cache libtool \ $(INC_BUILDDIR)/gfarm_config.h \ Makefile makes/config.mk makes/install-doc \ gftool/config-gfarm/config-gfarm \ gftool/config-gfarm/config-gfarm-update \ gftool/config-gfarm/config-gfsd \ gftool/gfdump/gfdump.postgresql \ package/solaris/gfmd package/solaris/gfsd gfarm-2.4.1/bench/0000755000000000000000000000000011507222730012366 5ustar rootrootgfarm-2.4.1/bench/fsysbench/0000755000000000000000000000000011507222730014352 5ustar rootrootgfarm-2.4.1/bench/fsysbench/fsysbench.c0000644000000000000000000004515311507222714016514 0ustar rootroot/* * $Id: fsysbench.c 3792 2007-08-30 03:00:05Z tatebe $ */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include /* #define ENABLE_RDTSC */ /* #define ENABLE_RUSAGE */ #define RDTSC_RESOLUTION 1 #ifdef ENABLE_RDTSC #if 1 /* Pentium */ #define rdtsc(x) __asm__ volatile ("rdtsc" : "=A" (x)) #else /* AMD */ #define rdtsc(x) __asm__ volatile ("rdtsc; shlq $32,%%rdx; orq %%rdx,%%rax" : "=a" (x) :: "%rdx") #endif #endif /* ENABLE_RDTSC */ #define DIR_SUFFIX "-dir" #define FILE_SUFFIX ".file" #define TEST_MAX 20 volatile sig_atomic_t timer_interrupt = 0; /**********************************************************************/ static void print_help() { fprintf(stderr, "Usage: [-w dir] [-d count] [-f count] [-i] [-F]\n" " -w working directry\n" " -d targetdir count\n" " -f targetfile count\n" " -i do I/O test (latency of read or write)\n" #ifdef ENABLE_RDTSC " -r use rdtsc timer\n" #endif " -F for FUSE filesystem\n"); } static void print_errno(int en, char *msg) { fprintf(stderr, "ERROR: %s: %s \n", msg, strerror(en)); } static void check_errno(int en, char *msg) { if (errno != 0) { print_errno(en, msg); exit(1); } } /**********************************************************************/ /* config */ struct fsb_conf { int dirs; int files; int timer_type; int fuse_mode; /* for FUSE filesystem */ int enable_io_test; /* read, write */ }; #define TIMER_RDTSC 1 #define TIMER_GETTIMEOFDAY 2 #define TIMER_GETRUSAGE 3 /* default */ static struct fsb_conf conf = { .dirs = 10, .files = 1, .timer_type = TIMER_GETTIMEOFDAY, .fuse_mode = 0, .enable_io_test = 0, }; struct fsb_op_st { char *testname; int(*testfunc)(char *, void *); void *time; unsigned int count; }; static struct fsb_op_st test_ops[TEST_MAX]; static void test_op_set(struct fsb_op_st *test_opp, char *testname, int(*testfunc)(char *, void *), void *time) { test_opp->testname = strdup(testname); test_opp->testfunc = testfunc; test_opp->time = time; test_opp->count = 0; } struct fsb_times { void *t_mkdir; void *t_rmdir; void *t_stat_noent; void *t_creat; void *t_open; void *t_read0; void *t_write0; void *t_read8; void *t_write8; void *t_utime; void *t_stat; void *t_chmod_w; void *t_chmod_x; void *t_rename; void *t_rename_overwrite; void *t_unlink; }; static struct fsb_times times; static void times_init(void(*time_initializer)(void**)) { time_initializer(×.t_mkdir); time_initializer(×.t_rmdir); time_initializer(×.t_stat_noent); time_initializer(×.t_creat); time_initializer(×.t_open); time_initializer(×.t_read0); time_initializer(×.t_write0); time_initializer(×.t_read8); time_initializer(×.t_write8); time_initializer(×.t_utime); time_initializer(×.t_stat); time_initializer(×.t_chmod_w); time_initializer(×.t_chmod_x); time_initializer(×.t_rename); time_initializer(×.t_rename_overwrite); time_initializer(×.t_unlink); } static void timer_interrupt_handler(int sig){ char msg[] = "*** Interrupt! (cleanup) (following values may be invalid)\n"; timer_interrupt = 1; write(1, msg, sizeof(msg) - 1); /* printf(3) isn't async-signal-safe */ } /**********************************************************************/ #define SECOND_BY_MICROSEC 1000000 static void timeval_normalize(struct timeval *t) { long n; if (t->tv_usec >= SECOND_BY_MICROSEC) { n = t->tv_usec / SECOND_BY_MICROSEC; t->tv_usec -= n * SECOND_BY_MICROSEC; t->tv_sec += n; } else if (t->tv_usec < 0) { n = -t->tv_usec / SECOND_BY_MICROSEC + 1; t->tv_usec += n * SECOND_BY_MICROSEC; t->tv_sec -= n; } } static void timeval_add(struct timeval *t1, const struct timeval *t2) { t1->tv_sec += t2->tv_sec; t1->tv_usec += t2->tv_usec; timeval_normalize(t1); } static void timeval_sub(struct timeval *t1, const struct timeval *t2) { t1->tv_sec -= t2->tv_sec; t1->tv_usec -= t2->tv_usec; timeval_normalize(t1); } /**********************************************************************/ static void timeval_malloc(void **val) { *val = calloc(1, sizeof(struct timeval)); if (*val == NULL) { print_errno(errno, "timeval_malloc"); exit(1); } } static void timer_gettimeofday_init() { times_init(&timeval_malloc); } static void * timer_gettimeofday_start() { static struct timeval timer; gettimeofday(&timer, NULL); return (&timer); } static void timer_gettimeofday_stop(void *timerp_tmp, void *addtimerp_tmp) { struct timeval now, *timerp, *addtimerp; gettimeofday(&now, NULL); timerp = (struct timeval *)timerp_tmp; addtimerp = (struct timeval *)addtimerp_tmp; timeval_sub(&now, timerp); timeval_add(addtimerp, &now); } static void timer_gettimeofday_print(void *timerp_tmp, char *msg, unsigned int avgnum) { struct timeval *timerp = (struct timeval *)timerp_tmp; double time = (((double)timerp->tv_sec) * SECOND_BY_MICROSEC + timerp->tv_usec) / SECOND_BY_MICROSEC; double average = time / avgnum; printf("%10.6f s | %10.6f avg | %s\n", time, average, msg); } /**********************************************************************/ #ifdef ENABLE_RUSAGE static void timer_getrusage_init() { times_init(&timeval_malloc); } static void * timer_getrusage_start() { static struct timeval timer; struct rusage ru; getrusage(RUSAGE_SELF, &ru); timer = ru.ru_utime; return (&timer); } static void timer_getrusage_stop(void *timerp_tmp, void *addtimerp_tmp) { struct timeval now, *timerp, *addtimerp; struct rusage ru; getrusage(RUSAGE_SELF, &ru); now = ru.ru_utime; timerp = (struct timeval *)timerp_tmp; addtimerp = (struct timeval *)addtimerp_tmp; timeval_sub(&now, timerp); timeval_add(addtimerp, &now); } static void timer_getrusage_print(void *timerp_tmp, char *msg, unsigned int avgnum) { timer_gettimeofday_print(timerp_tmp, msg, avgnum); } #endif /* ENABLE_RUSAGE */ /**********************************************************************/ #ifdef ENABLE_RDTSC static void unsigned_long_long_int_malloc(void **val) { *val = calloc(1, sizeof(unsigned long long int)); if (*val == NULL) { print_errno(errno, "unsigned_long_long_int_malloc"); exit(1); } } static unsigned long long int cpuclock; static void timer_rdtsc_init() { unsigned long long int x; rdtsc(x); usleep(1000000); rdtsc(cpuclock); cpuclock = cpuclock - x; printf("CPU clock: %lld Hz\n", cpuclock); times_init(&unsigned_long_long_int_malloc); } static void * timer_rdtsc_start() { static unsigned long long int val; rdtsc(val); return (&val); } static void timer_rdtsc_stop(void *start_tmp, void *add_tmp) { unsigned long long int *start, *addcount, val; rdtsc(val); start = (unsigned long long int*) start_tmp; addcount = (unsigned long long int*) add_tmp; *addcount = *addcount + (val - *start) / RDTSC_RESOLUTION; } static void timer_rdtsc_print(void *count_tmp, char *msg, unsigned int avgnum) { unsigned long long int *count = (unsigned long long int*) count_tmp; double time = (double) *count / (cpuclock / RDTSC_RESOLUTION); double average = time / avgnum; #if 0 printf("%12lld clock | %10.6f s | %10.6f avg | %s\n", *count, time, average, msg); #else printf("%10.6f s | %10.6f avg | %s\n", time, average, msg); #endif } #endif /* ENABLE_RDTSC */ /**********************************************************************/ static void* (*timer_start)(void); static void (*timer_stop)(void *, void *); static void (*timer_print)(void *, char *, unsigned int); static void timer_func_set(int timer_func_type) { switch (timer_func_type) { #ifdef ENABLE_RDTSC case TIMER_RDTSC: timer_rdtsc_init(); timer_start = timer_rdtsc_start; timer_stop = timer_rdtsc_stop; timer_print = timer_rdtsc_print; break; #endif #ifdef ENABLE_RUSAGE case TIMER_GETRUSAGE: timer_getrusage_init(); timer_start = timer_getrusage_start; timer_stop = timer_getrusage_stop; timer_print = timer_getrusage_print; break; #endif case TIMER_GETTIMEOFDAY: default: timer_gettimeofday_init(); timer_start = timer_gettimeofday_start; timer_stop = timer_gettimeofday_stop; timer_print = timer_gettimeofday_print; } } /**********************************************************************/ static int check_mode(char *name, int mode) { struct stat st; if (lstat(name, &st) != 0) return (-1); if ((st.st_mode & mode) == mode) return (0); else { errno = EACCES; return (-1); } } /**********************************************************************/ static int test_creat(char *name, void *time) { void *timer; int e, fd, save_errno; struct stat buf; timer = timer_start(); fd = creat(name, 0600); if (fd < 0) goto error; e = close(fd); if (e != 0) goto error; if (conf.fuse_mode) { /* force RELEASE */ e = lstat(".", &buf); if (e != 0) goto error; } timer_stop(timer, time); return (0); error: save_errno = errno; timer_stop(timer, time); errno = save_errno; return (-1); } static int test_open(char *name, void *time) { void *timer; int e, fd, save_errno; timer = timer_start(); fd = open(name, O_RDONLY); if (fd < 0) goto error; e = close(fd); if (e != 0) goto error; if (conf.fuse_mode) { /* force RELEASE */ e = utime(".", NULL); if (e != 0) goto error; } timer_stop(timer, time); return (0); error: save_errno = errno; timer_stop(timer, time); errno = save_errno; return (-1); } static int test_read_common(char *name, int len, void *time) { void *timer; int e, fd, save_errno; ssize_t l; unsigned char c[8]; if (check_mode(name, 0400) != 0) if (chmod(name, 0400) != 0) return (1); fd = open(name, O_RDONLY); if (fd < 0) return (1); timer = timer_start(); l = read(fd, c, len); save_errno = errno; timer_stop(timer, time); e = close(fd); if (l != len || e != 0) { errno = save_errno; return (-1); } else return (0); } static int test_read0(char *name, void *time) { return test_read_common(name, 0, time); } static int test_read8(char *name, void *time) { return test_read_common(name, 8, time); } static int test_write_common(char *name, int len, void *time) { void *timer; int e, fd, save_errno; ssize_t l; unsigned char c[8]; if (check_mode(name, 0200) != 0) if (chmod(name, 0600) != 0) return (1); memset(c, 255, 8); fd = open(name, O_WRONLY); if (fd < 0) return (1); timer = timer_start(); l = write(fd, c, len); save_errno = errno; timer_stop(timer, time); e = close(fd); if (l != len || e != 0) { errno = save_errno; return (-1); } else return (0); } static int test_write0(char *name, void *time) { return test_write_common(name, 0, time); } static int test_write8(char *name, void *time) { return test_write_common(name, 8, time); } static int test_stat_noent(char *name, void *time) { void *timer; struct stat buf; int e, save_errno; timer = timer_start(); e = lstat(name, &buf); if (e != 0) goto error; timer_stop(timer, time); errno = EEXIST; return (-1); error: save_errno = errno; timer_stop(timer, time); if (save_errno == ENOENT) { errno = 0; return (0); } else { errno = save_errno; return (-1); } } static int test_stat(char *name, void *time) { void *timer; struct stat buf; int e, save_errno; timer = timer_start(); e = lstat(name, &buf); if (e != 0) goto error; timer_stop(timer, time); return (0); error: save_errno = errno; timer_stop(timer, time); errno = save_errno; return (-1); } static int test_utime(char *name, void *time) { void *timer; int e, save_errno; timer = timer_start(); e = utime(name, NULL); if (e != 0) goto error; timer_stop(timer, time); return (0); error: save_errno = errno; timer_stop(timer, time); errno = save_errno; return (-1); } static int test_chmod_common(char *name, mode_t mode, void *time) { void *timer; int e, save_errno; timer = timer_start(); e = chmod(name, mode); if (e != 0) goto error; timer_stop(timer, time); return (0); error: save_errno = errno; timer_stop(timer, time); errno = save_errno; return (-1); } static int test_chmod_w(char *name, void *time) { if (chmod(name, 0400) != 0) return (-1); return test_chmod_common(name, 0600, time); } static int test_chmod_x(char *name, void *time) { if (chmod(name, 0400) != 0) return (-1); return test_chmod_common(name, 0500, time); } static int test_rename_common(char *name, int overwrite, void *time) { void *timer; int e, save_errno; char newname[16]; sprintf(newname, "%s_rename", name); if (overwrite && check_mode(newname, 0000) != 0) { #if 0 e = mknod(newname, 0600|S_IFREG, 0); if (e != 0) return (-1); #else e = creat(newname, 0600); if (e >= 0) close(e); else return (-1); #endif } timer = timer_start(); e = rename(name, newname); if (e != 0) goto error; timer_stop(timer, time); rename(newname, name); return (0); error: save_errno = errno; timer_stop(timer, time); errno = save_errno; return (-1); } static int test_rename(char *name, void *time) { return test_rename_common(name, 0, time); } static int test_rename_overwrite(char *name, void *time) { return test_rename_common(name, 1, time); } static int test_unlink(char *name, void *time) { void *timer; int e, save_errno; char newname[16]; timer = timer_start(); e = unlink(name); if (e != 0) goto error; timer_stop(timer, time); return (0); error: save_errno = errno; timer_stop(timer, time); if (save_errno != 0) { sprintf(newname, "%s_rename", name); unlink(newname); } errno = save_errno; return (-1); } /**********************************************************************/ #define DELETE 1 #define NORMAL 0 static int fsysbench_loop(struct fsb_op_st ops[], int deletemode) { int i, j, n; char dirname[16], filename[16]; char cwd[PATH_MAX]; int retv, save_errno; if (getcwd(cwd, PATH_MAX) == NULL) return (1); errno = 0; retv = 0; save_errno = 0; for (i = 0; i < conf.dirs; i++) { sprintf(dirname, "%d%s", i, DIR_SUFFIX); if (chdir(dirname) != 0) return (1); for (j = 0; j < conf.files; j++) { sprintf(filename, "%d%s", j, FILE_SUFFIX); if (deletemode == DELETE) { if (test_unlink(filename, times.t_unlink) != 0) { save_errno = errno; retv = 1; } } else { for (n = 0; ops[n].testname != NULL && timer_interrupt == 0; n++) { errno = 0; if (ops[n].testfunc( filename, ops[n].time) != 0) { save_errno = errno; retv = 1; goto end; } ops[n].count++; } } } if (chdir(cwd) != 0) return (1); } end: if (chdir(cwd) != 0) return (1); errno = save_errno; return (retv); } static int fsysbench() { int ret; int i; if (conf.files == 0) return (0); ret = fsysbench_loop(test_ops, NORMAL); for (i = 0; test_ops[i].testname != NULL; i++) { timer_print(test_ops[i].time, test_ops[i].testname, test_ops[i].count); } return (ret); } static int remove_all_files() { int ret; if (conf.files == 0) return (0); ret = fsysbench_loop(test_ops, DELETE); timer_print(times.t_unlink, "unlink", conf.files * conf.dirs); return (ret); } static int make_dirs() { int i, ret = 0; char name[16]; void *timer; timer = timer_start(); for (i = 0; i < conf.dirs && timer_interrupt == 0; i++) { sprintf(name, "%d%s", i, DIR_SUFFIX); if (mkdir(name, 0700) != 0 && errno != EEXIST) { ret = 1; break; } } timer_stop(timer, times.t_mkdir); timer_print(times.t_mkdir, "mkdir", conf.dirs); return (ret); } static int remove_dirs() { int i, ret = 0; char name[16]; void *timer; timer = timer_start(); for (i = 0; i < conf.dirs; i++) { sprintf(name, "%d%s", i, DIR_SUFFIX); if (rmdir(name) != 0 && errno != ENOENT) { ret = 1; break; } } timer_stop(timer, times.t_rmdir); timer_print(times.t_rmdir, "rmdir", conf.dirs); return (ret); } /**********************************************************************/ static void tests_init() { int i = 0; test_op_set(&test_ops[i++], "stat ENOENT", test_stat_noent, times.t_stat_noent); if (conf.fuse_mode) { test_op_set(&test_ops[i++], "creat+close+stat", test_creat, times.t_creat); test_op_set(&test_ops[i++], "open+close+utime", test_open, times.t_open); } else { test_op_set(&test_ops[i++], "creat+close", test_creat, times.t_creat); test_op_set(&test_ops[i++], "open+close", test_open, times.t_open); } test_op_set(&test_ops[i++], "stat EXIST", test_stat, times.t_stat); test_op_set(&test_ops[i++], "utime", test_utime, times.t_utime); test_op_set(&test_ops[i++], "chmod u+w", test_chmod_w, times.t_chmod_w); test_op_set(&test_ops[i++], "chmod u+x", test_chmod_x, times.t_chmod_x); if (conf.enable_io_test) { test_op_set(&test_ops[i++], "write 0 byte", test_write0, times.t_write0); test_op_set(&test_ops[i++], "write 8 bytes", test_write8, times.t_write8); test_op_set(&test_ops[i++], "read 0 byte", test_read0, times.t_read0); test_op_set(&test_ops[i++], "read 8 bytes", test_read8, times.t_read8); } test_op_set(&test_ops[i++], "rename", test_rename, times.t_rename); test_op_set(&test_ops[i++], "rename overwrite", test_rename_overwrite, times.t_rename_overwrite); /* if (i >= TEST_MAX) error */ test_ops[i].testname = NULL; /* end of tests */ } int main(int argc, char **argv) { char c; while ((c = getopt(argc, argv, "w:d:f:iruF")) != EOF) { switch (c) { case 'w': if (chdir(optarg) != 0) { print_errno(errno, "option -w"); exit(1); } printf("working directory: %s\n", optarg); break; case 'd': conf.dirs = atoi(optarg); if (conf.dirs <= 0) { print_errno(EINVAL, "option -d"); exit(1); } break; case 'f': conf.files = atoi(optarg); if (conf.files < 0) { print_errno(EINVAL, "option -f"); exit(1); } break; case 'i': conf.enable_io_test = 1; break; #ifdef ENABLE_RDTSC case 'r': conf.timer_type = TIMER_RDTSC; break; #endif #ifdef ENABLE_RUSAGE case 'u': /* worthless mode... */ conf.timer_type = TIMER_GETRUSAGE; break; #endif case 'F': conf.fuse_mode = 1; printf("for FUSE filesystem\n"); break; default: print_help(); exit(1); } } if (optind != argc) { print_help(); exit(1); } signal(SIGINT, timer_interrupt_handler); timer_func_set(conf.timer_type); tests_init(); printf("directories * files = %d * %d = %ld files\n", conf.dirs, conf.files, (long)conf.dirs * (long)conf.files); if (make_dirs() != 0) check_errno(errno, "make_dirs"); if (fsysbench() != 0) print_errno(errno, "fsysbench main"); if (remove_all_files() != 0) print_errno(errno, "remove_all_files"); if (remove_dirs() != 0) check_errno(errno, "remove_dirs"); return (0); } gfarm-2.4.1/bench/fsysbench/Makefile0000644000000000000000000000046111507222714016015 0ustar rootroot# $Id: Makefile 2533 2006-03-31 10:50:56Z takuya $ top_builddir = ../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk CFLAGS = $(COMMON_CFLAGS) LDLIBS = $(COMMON_LDFLAGS) $(LIBS) PROGRAM = fsysbench OBJS = fsysbench.o all: $(PROGRAM) include $(top_srcdir)/makes/prog.mk gfarm-2.4.1/bench/thput-pvfs/0000755000000000000000000000000011507222730014506 5ustar rootrootgfarm-2.4.1/bench/thput-pvfs/Makefile0000644000000000000000000000057111507222714016153 0ustar rootroot# $Id: Makefile 2373 2006-01-12 00:54:22Z soda $ top_builddir = ../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk CFLAGS = $(COMMON_CFLAGS) -I/usr/local/include -DPVFS_MOUNT=\"/mnt/pvfs\" LDLIBS = $(COMMON_LDFLAGS) $(LIBS) -L/usr/local/lib -lpvfs PROGRAM = thput-pvfs OBJS = thput-pvfs.o all: $(PROGRAM) include $(top_srcdir)/makes/prog.mk gfarm-2.4.1/bench/thput-pvfs/thput-pvfs.c0000644000000000000000000002522011507222714016775 0ustar rootroot/* * $Id: thput-pvfs.c 298 2003-02-28 04:42:39Z tatebe $ */ #include #include #include #include #include #include #include double timerval_calibration; #ifdef i386 typedef unsigned long long timerval_t; unsigned long long get_cycles(void) { unsigned long long rv; __asm __volatile("rdtsc" : "=A" (rv)); return (rv); } #define gettimerval(tp) (*(tp) = get_cycles()) #define timerval_second(tp) (*(tp) * timerval_calibration) #define timerval_sub(t1p, t2p) ((*(t1p) - *(t2p)) * timerval_calibration) void timerval_calibrate(void) { timerval_t t1, t2; struct timeval s1, s2; gettimerval(&t1); gettimeofday(&s1, NULL); sleep(10); gettimerval(&t2); gettimeofday(&s2, NULL); timerval_calibration = (t2 - t1) / ( (s2.tv_sec - s1.tv_sec) + (s2.tv_usec - s1.tv_usec) * .000001); timerval_calibration = 1.0 / timerval_calibration; } #else /* gettimeofday */ typedef struct timeval timerval_t; #define gettimerval(t1) gettimeofday(t1, NULL) #define timerval_second(t1) ((double)(t1)->tv_sec \ + (double)(t1)->tv_usec * .000001) #define timerval_sub(t1, t2) \ (((double)(t1)->tv_sec - (double)(t2)->tv_sec) \ + ((double)(t1)->tv_usec - (double)(t2)->tv_usec) * .000001) void timerval_calibrate(void) { timerval_calibration = 1.0; } #endif int tm_write_write_measured = 0; timerval_t tm_write_open_0, tm_write_open_1; timerval_t tm_write_write_0, tm_write_write_1; timerval_t tm_write_close_0, tm_write_close_1; int tm_read_read_measured = 0; timerval_t tm_read_open_0, tm_read_open_1; timerval_t tm_read_read_0, tm_read_read_1; timerval_t tm_read_close_0, tm_read_close_1; #define ARRAY_LENGTH(array) (sizeof(array)/sizeof(array[0])) #define MAX_BUFFER_SIZE_NUMBER 32 #define MAX_BUFFER_SIZE (8*1024*1024) #ifndef MAXHOSTNAMELEN #define MAXHOSTNAMELEN 256 #endif char buffer[MAX_BUFFER_SIZE]; static struct pvfs_filestat _pstat; static char _hname[MAXHOSTNAMELEN]; void initbuffer(void) { int i; for (i = 0; i < MAX_BUFFER_SIZE; i++) buffer[i] = i; } void writetest(char *ofile, int buffer_size, off_t file_size) { int fd, rv; off_t residual; gettimerval(&tm_write_open_0); fd = pvfs_open(ofile, O_CREAT|O_TRUNC|O_WRONLY|O_META, 0666, &_pstat); gettimerval(&tm_write_open_1); if (fd == -1) { perror(ofile); exit(1); } pvfs_ioctl(fd, GETMETA, &_pstat); for (residual = file_size; residual > 0; residual -= rv) { if (!tm_write_write_measured) { tm_write_write_measured = 1; gettimerval(&tm_write_write_0); rv = pvfs_write(fd, buffer, buffer_size <= residual ? buffer_size : residual); gettimerval(&tm_write_write_1); } else { rv = pvfs_write(fd, buffer, buffer_size <= residual ? buffer_size : residual); } if (rv == -1) { perror("write test"); break; } if (rv != (buffer_size <= residual ? buffer_size : residual)) break; } if (residual > 0) { fprintf(stderr, "write test failed, residual = %ld\n", (long)residual); } gettimerval(&tm_write_close_0); rv = pvfs_close(fd); gettimerval(&tm_write_close_1); if (rv == -1) perror("write test close failed"); } void readtest(char *ifile, int buffer_size, off_t file_size) { int fd, rv; off_t residual; gettimerval(&tm_read_open_0); fd = pvfs_open(ifile, O_RDONLY); gettimerval(&tm_read_open_1); if (fd == -1) { perror(ifile); exit(1); } for (residual = file_size; residual > 0; residual -= rv) { if (!tm_read_read_measured) { tm_read_read_measured = 1; gettimerval(&tm_read_read_0); rv = pvfs_read(fd, buffer, buffer_size <= residual ? buffer_size : residual); gettimerval(&tm_read_read_1); } else { rv = pvfs_read(fd, buffer, buffer_size <= residual ? buffer_size : residual); } if (rv == 0) break; if (rv == -1) { perror("read test"); break; } if (rv != buffer_size && rv != residual) break; } if (residual > 0) { fprintf(stderr, "read test failed, residual = %ld\n", (long)residual); } gettimerval(&tm_read_close_0); rv = pvfs_close(fd); gettimerval(&tm_read_close_1); if (rv == -1) perror("read test closed failed"); } void copytest(char *ifile, char *ofile, int buffer_size, off_t file_size) { int ifd, ofd; int rv, osize; off_t residual; ifd = pvfs_open(ifile, O_RDONLY); if (ifd == -1) { perror(ifile); exit(1); } ofd = pvfs_open(ofile, O_CREAT|O_TRUNC|O_WRONLY|O_META, 0666, &_pstat); if (ofd == -1) { perror(ofile); exit(1); } pvfs_ioctl(ofd, GETMETA, &_pstat); for (residual = file_size; residual > 0; residual -= rv) { rv = pvfs_read(ifd, buffer, buffer_size <= residual ? buffer_size : residual); if (rv == 0) break; if (rv == -1) { perror("copytest read"); break; } if (rv != buffer_size && rv != residual) break; osize = rv; rv = pvfs_write(ofd, buffer, osize); if (rv == -1) { perror("copytest write"); break; } if (rv != osize) break; } if (residual > 0) { fprintf(stderr, "copy test failed, residual = %ld\n", (long)residual); } if (pvfs_close(ofd) == -1) perror("copy test write close failed"); if (pvfs_close(ifd) == -1) perror("copy test read close failed"); } double timeval_sub(struct timeval *t1, struct timeval *t2) { return ((t1->tv_sec + t1->tv_usec * .000001) - (t2->tv_sec + t2->tv_usec * .000001)); } #define TESTMODE_WRITE 1 #define TESTMODE_READ 2 #define TESTMODE_COPY 4 #define FLAG_DONT_REMOVE 1 #define FLAG_MEASURE_PRIMITIVES 2 void test_title(int test_mode, off_t file_size, int flags) { fprintf(stdout, "testing with %d MB file\n", (int)file_size); printf("%-8s ", "hostname"); printf("%-8s", "bufsize"); if (test_mode & TESTMODE_WRITE) printf(" %12s", "write [MB/s]"); if (test_mode & TESTMODE_READ) printf(" %12s", "read [MB/s]"); if (test_mode & TESTMODE_COPY) printf(" %12s", "copy [MB/s]"); printf(" (#iods / base / ssize)"); printf("\n"); fflush(stdout); if ((flags & FLAG_MEASURE_PRIMITIVES) != 0 && (test_mode & (TESTMODE_WRITE|TESTMODE_READ)) != 0) fprintf(stderr, "timer/sec=%g\n", 1.0 / timerval_calibration); } void test(int test_mode, char *file1, char *file2, int buffer_size, off_t file_size, int flags) { struct timeval t1, t2, t3, t4; if ((flags & FLAG_DONT_REMOVE) == 0) { if (test_mode & TESTMODE_WRITE) pvfs_unlink(file1); if (test_mode & TESTMODE_COPY) pvfs_unlink(file2); } gettimeofday(&t1, NULL); if (test_mode & TESTMODE_WRITE) writetest(file1, buffer_size, file_size); gettimeofday(&t2, NULL); if (test_mode & TESTMODE_READ) readtest(file1,buffer_size, file_size); gettimeofday(&t3, NULL); if (test_mode & TESTMODE_COPY) copytest(file1, file2, buffer_size, file_size); gettimeofday(&t4, NULL); printf("%8s ", _hname); printf("%7d ", buffer_size); if (test_mode & TESTMODE_WRITE) printf(" %9.3f%3s", file_size / timeval_sub(&t2, &t1) * .000001, ""); if (test_mode & TESTMODE_READ) printf(" %9.3f%3s", file_size / timeval_sub(&t3, &t2) * .000001, ""); if (test_mode & TESTMODE_COPY) printf(" %9.3f%3s", file_size / timeval_sub(&t4, &t3) * .000001, ""); printf(" (%d / %d / %d)", _pstat.pcount, _pstat.base, _pstat.ssize); printf("\n"); fflush(stdout); if ((flags & FLAG_DONT_REMOVE) == 0) { if (test_mode & TESTMODE_WRITE) pvfs_unlink(file1); if (test_mode & TESTMODE_COPY) pvfs_unlink(file2); } if ((flags & FLAG_MEASURE_PRIMITIVES) != 0 && (test_mode & (TESTMODE_WRITE|TESTMODE_READ)) != 0) { fprintf(stderr, "%7d ", buffer_size); if (test_mode & TESTMODE_WRITE) fprintf(stderr, " %g %g %g", timerval_sub(&tm_write_open_1, &tm_write_open_0), timerval_sub(&tm_write_write_1, &tm_write_write_0), timerval_sub(&tm_write_close_1, &tm_write_close_0) ); if (test_mode & TESTMODE_READ) fprintf(stderr, " %g %g %g", timerval_sub(&tm_read_open_1, &tm_read_open_0), timerval_sub(&tm_read_read_1, &tm_read_read_0), timerval_sub(&tm_read_close_1, &tm_read_close_0) ); fprintf(stderr, "\n"); tm_write_write_measured = tm_read_read_measured = 0; } } /* * */ #ifndef PVFS_MOUNT #define PVFS_MOUNT "/pvfs" #endif /* PVFS_MOUNT */ int main(int argc, char **argv) { # define file_prefix "test.file" char bfile1[MAXHOSTNAMELEN + strlen(PVFS_MOUNT file_prefix) + 4]; char bfile2[MAXHOSTNAMELEN + strlen(PVFS_MOUNT file_prefix) + 4]; char *file1, *file2; int test_mode = 0; int c, i, buffer_sizec = 0, buffer_sizes[MAX_BUFFER_SIZE_NUMBER]; static int buffer_sizes_default[] = { 8 * 1024, 64 * 1024, 512 * 1024, 8 * 1024 * 1024, }; off_t file_size = 1024; int flags = 0; if (gethostname(_hname, MAXHOSTNAMELEN) == -1) { perror("gethostname"); exit(1); } sprintf(bfile1, "%s/%s1.%s", PVFS_MOUNT, file_prefix, _hname); sprintf(bfile2, "%s/%s2.%s", PVFS_MOUNT, file_prefix, _hname); file1 = bfile1; file2 = bfile2; _pstat.base = -1; _pstat.pcount = -1; _pstat.ssize = -1; _pstat.soff = 0; _pstat.bsize = 0; while ((c = getopt(argc, argv, "b:s:n:t:wrcmp")) != -1) { switch (c) { case 'b': if (buffer_sizec >= MAX_BUFFER_SIZE_NUMBER) { fprintf(stderr, "too many -b options (max %d)\n", MAX_BUFFER_SIZE_NUMBER); exit(1); } buffer_sizes[buffer_sizec] = strtol(optarg, NULL, 0); if (buffer_sizes[buffer_sizec] > MAX_BUFFER_SIZE) { fprintf(stderr, "-b: %d is too big\n", buffer_sizes[buffer_sizec]); exit(1); } buffer_sizec++; break; case 's': file_size = strtol(optarg, NULL, 0); break; case 'n': _pstat.pcount = strtol(optarg, NULL, 0); break; case 't': _pstat.ssize = strtol(optarg, NULL, 0); break; case 'w': test_mode |= TESTMODE_WRITE; break; case 'r': test_mode |= TESTMODE_READ; break; case 'c': test_mode |= TESTMODE_COPY; break; case 'm': flags |= FLAG_MEASURE_PRIMITIVES; timerval_calibrate(); break; case 'p': flags |= FLAG_DONT_REMOVE; break; case '?': default: fprintf(stderr, "Usage: thput-pvfs [options]" " [file1 [file2]]\n" "options:\n" "\t-n # of io nodes\n" "\t-t striping-size\n" "\t-b block-size\n" "\t-s file-size\n" "\t-w : write test\n" "\t-r : read test\n" "\t-c : copy test\n" "\t-p : don't remove\n"); exit(1); } } argc -= optind; argv += optind; if (argc > 0) file1 = argv[0]; if (argc > 1) file2 = argv[1]; if (test_mode == 0) test_mode = TESTMODE_WRITE|TESTMODE_READ|TESTMODE_COPY; test_title(test_mode, file_size, flags); file_size *= 1024 * 1024; initbuffer(); if (buffer_sizec == 0) { for (i = 0; i < ARRAY_LENGTH(buffer_sizes_default); i++) test(test_mode, file1, file2, buffer_sizes_default[i], file_size, flags); } else { for (i = 0; i < buffer_sizec; i++) test(test_mode, file1, file2, buffer_sizes[i], file_size, flags); } return (0); } gfarm-2.4.1/bench/thput-gfpio/0000755000000000000000000000000011507222730014634 5ustar rootrootgfarm-2.4.1/bench/thput-gfpio/thput-gfpio.c0000644000000000000000000003237011507222714017255 0ustar rootroot/* * $Id: thput-gfpio.c 4894 2010-11-12 12:05:54Z tatebe $ */ #include #include #include #include #include int node_index = -1; #ifdef i386 typedef unsigned long long timerval_t; double timerval_calibration; unsigned long long get_cycles(void) { unsigned long long rv; __asm __volatile("rdtsc" : "=A" (rv)); return (rv); } #define gettimerval(tp) (*(tp) = get_cycles()) #define timerval_second(tp) (*(tp) * timerval_calibration) #define timerval_sub(t1p, t2p) ((*(t1p) - *(t2p)) * timerval_calibration) void timerval_calibrate(void) { timerval_t t1, t2; struct timeval s1, s2; /* warming up */ gettimerval(&t1); gettimeofday(&s1, NULL); gettimerval(&t1); gettimeofday(&s1, NULL); sleep(3); gettimerval(&t2); gettimeofday(&s2, NULL); timerval_calibration = ((s2.tv_sec - s1.tv_sec) + (s2.tv_usec - s1.tv_usec) * .000001) / (t2 - t1); fprintf(stderr, "[%03d] timer/sec=%g %s\n", node_index, 1.0 / timerval_calibration, gfarm_host_get_self_name()); } #else /* gettimeofday */ typedef struct timeval timerval_t; #define gettimerval(t1) gettimeofday(t1, NULL) #define timerval_second(t1) ((double)(t1)->tv_sec \ + (double)(t1)->tv_usec * .000001) #define timerval_sub(t1, t2) \ (((double)(t1)->tv_sec - (double)(t2)->tv_sec) \ + ((double)(t1)->tv_usec - (double)(t2)->tv_usec) * .000001) void timerval_calibrate(void) {} #endif int tm_write_write_measured = 0; timerval_t tm_write_open_0, tm_write_open_1; timerval_t tm_write_write_0, tm_write_write_1; timerval_t tm_write_write_all_0, tm_write_write_all_1; timerval_t tm_write_sync_0, tm_write_sync_1; timerval_t tm_write_close_0, tm_write_close_1; int tm_read_read_measured = 0; timerval_t tm_read_open_0, tm_read_open_1; timerval_t tm_read_read_0, tm_read_read_1; timerval_t tm_read_read_all_0, tm_read_read_all_1; timerval_t tm_read_close_0, tm_read_close_1; char *program_name = "thput-gfpio"; #define MAX_BUFFER_SIZE (1024*1024) char buffer[MAX_BUFFER_SIZE]; void initbuffer(void) { int i; for (i = 0; i < MAX_BUFFER_SIZE; i++) buffer[i] = i; } void writetest(char *ofile, int buffer_size, off_t file_size) { GFS_File gf; gfarm_error_t e; int rv; off_t residual; gettimerval(&tm_write_open_0); e = gfs_pio_create(ofile, GFARM_FILE_WRONLY|GFARM_FILE_TRUNC, 0666, &gf); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "[%03d] cannot open %s: %s on %s\n", node_index, ofile, gfarm_error_string(e), gfarm_host_get_self_name()); exit(1); } #if 0 /* not yet in gfarm v2 */ e = gfs_pio_set_view_local(gf, GFARM_FILE_SEQUENTIAL); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "[%03d] set_view_local(%s): %s on %s\n", node_index, ofile, gfarm_error_string(e), gfarm_host_get_self_name()); exit(1); } #endif /* not yet in gfarm v2 */ gettimerval(&tm_write_open_1); gettimerval(&tm_write_write_all_0); for (residual = file_size; residual > 0; residual -= rv) { if (!tm_write_write_measured) { tm_write_write_measured = 1; gettimerval(&tm_write_write_0); e = gfs_pio_write(gf, buffer, buffer_size <= residual ? buffer_size : residual, &rv); gettimerval(&tm_write_write_1); } else { e = gfs_pio_write(gf, buffer, buffer_size <= residual ? buffer_size : residual, &rv); } if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "[%03d] write test: %s on %s\n", node_index, gfarm_error_string(e), gfarm_host_get_self_name()); break; } if (rv != (buffer_size <= residual ? buffer_size : residual)) break; } gettimerval(&tm_write_write_all_1); if (residual > 0) { fprintf(stderr, "[%03d] write test failed, residual = %ld on %s\n", node_index, (long)residual, gfarm_host_get_self_name()); } gettimerval(&tm_write_sync_0); e = gfs_pio_sync(gf); gettimerval(&tm_write_sync_1); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "[%03d] write test sync failed: %s on %s\n", node_index, gfarm_error_string(e), gfarm_host_get_self_name()); } gettimerval(&tm_write_close_0); e = gfs_pio_close(gf); gettimerval(&tm_write_close_1); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "[%03d] write test close failed: %s on %s\n", node_index, gfarm_error_string(e), gfarm_host_get_self_name()); } } off_t readtest(char *ifile, int buffer_size, off_t file_size) { GFS_File gf; struct gfs_stat status; gfarm_error_t e; int rv; off_t residual; e = gfs_stat(ifile, &status); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "[%03d] stat(%s): %s on %s\n", node_index, ifile, gfarm_error_string(e), gfarm_host_get_self_name()); exit(1); } if (file_size <= 0) file_size = status.st_size; if (file_size > status.st_size) file_size = status.st_size; gfs_stat_free(&status); gettimerval(&tm_read_open_0); e = gfs_pio_open(ifile, GFARM_FILE_RDONLY, &gf); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "[%03d] cannot open %s: %s on %s\n", node_index, ifile, gfarm_error_string(e), gfarm_host_get_self_name()); exit(1); } #if 0 /* not yet in gfarm v2 */ e = gfs_pio_set_view_local(gf, GFARM_FILE_SEQUENTIAL); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "[%03d] set_view_local(%s): %s on %s\n", node_index, ifile, gfarm_error_string(e), gfarm_host_get_self_name()); exit(1); } #endif /* not yet in gfarm v2 */ gettimerval(&tm_read_open_1); gettimerval(&tm_read_read_all_0); for (residual = file_size; residual > 0; residual -= rv) { if (!tm_read_read_measured) { tm_read_read_measured = 1; gettimerval(&tm_read_read_0); e = gfs_pio_read(gf, buffer, buffer_size <= residual ? buffer_size : residual, &rv); gettimerval(&tm_read_read_1); } else { e = gfs_pio_read(gf, buffer, buffer_size <= residual ? buffer_size : residual, &rv); } if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "[%03d] read test: %s on %s\n", node_index, gfarm_error_string(e), gfarm_host_get_self_name()); break; } if (rv == 0) break; if (rv != buffer_size && rv != residual) break; } gettimerval(&tm_read_read_all_1); if (residual > 0) { fprintf(stderr, "[%03d] read test failed, residual = %ld on %s\n", node_index, (long)residual, gfarm_host_get_self_name()); } gettimerval(&tm_read_close_0); e = gfs_pio_close(gf); gettimerval(&tm_read_close_1); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "[%03d] read test close failed: %s on %s\n", node_index, gfarm_error_string(e), gfarm_host_get_self_name()); } return (file_size - residual); } off_t copytest(char *ifile, char *ofile, int buffer_size, off_t file_size) { GFS_File igf, ogf; struct gfs_stat status; gfarm_error_t e; int rv, osize; off_t residual; e = gfs_stat(ifile, &status); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "[%03d] stat(%s): %s on %s\n", node_index, ifile, gfarm_error_string(e), gfarm_host_get_self_name()); exit(1); } if (file_size <= 0) file_size = status.st_size; if (file_size > status.st_size) file_size = status.st_size; gfs_stat_free(&status); e = gfs_pio_open(ifile, GFARM_FILE_RDONLY, &igf); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "[%03d] cannot open %s: %s on %s\n", node_index, ifile, gfarm_error_string(e), gfarm_host_get_self_name()); exit(1); } #if 0 /* not yet in gfarm v2 */ e = gfs_pio_set_view_local(igf, GFARM_FILE_SEQUENTIAL); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "[%03d] set_view_local(%s): %s on %s\n", node_index, ifile, gfarm_error_string(e), gfarm_host_get_self_name()); exit(1); } #endif /* not yet in gfarm v2 */ e = gfs_pio_create(ofile, GFARM_FILE_WRONLY|GFARM_FILE_TRUNC, 0666, &ogf); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "[%03d] cannot open %s: %s on %s\n", node_index, ofile, gfarm_error_string(e), gfarm_host_get_self_name()); exit(1); } #if 0 /* not yet in gfarm v2 */ e = gfs_pio_set_view_local(ogf, GFARM_FILE_SEQUENTIAL); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "[%03d] set_view_local(%s): %s on %s\n", node_index, ofile, gfarm_error_string(e), gfarm_host_get_self_name()); exit(1); } #endif /* not yet in gfarm v2 */ for (residual = file_size; residual > 0; residual -= rv) { e = gfs_pio_read(igf, buffer, buffer_size, &rv); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "[%03d] copytest read: %s on %s\n", node_index, gfarm_error_string(e), gfarm_host_get_self_name()); break; } if (rv == 0) break; if (rv != buffer_size && rv != residual) break; osize = rv; e = gfs_pio_write(ogf, buffer, osize, &rv); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "[%03d] copytest write: %s on %s\n", node_index, gfarm_error_string(e), gfarm_host_get_self_name()); break; } if (rv != osize) break; } if (residual > 0) { fprintf(stderr, "[%03d] copy test failed, residual = %ld on %s\n", node_index, (long)residual, gfarm_host_get_self_name()); } e = gfs_pio_close(ogf); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "[%03d] copy test write close failed: %s on %s\n", node_index, gfarm_error_string(e), gfarm_host_get_self_name()); } e = gfs_pio_close(igf); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "[%03d] copy test read close failed: %s on %s\n", node_index, gfarm_error_string(e), gfarm_host_get_self_name()); } return (file_size - residual); } double timeval_sub(struct timeval *t1, struct timeval *t2) { return ((t1->tv_sec + t1->tv_usec * .000001) - (t2->tv_sec + t2->tv_usec * .000001)); } enum testmode { TESTMODE_WRITE, TESTMODE_READ, TESTMODE_COPY }; #define FLAG_MEASURE_PRIMITIVES 1 void test(enum testmode test_mode, char *file1, char *file2, int buffer_size, off_t file_size, int flags) { struct timeval t1, t2; char *label; gettimeofday(&t1, NULL); switch (test_mode) { case TESTMODE_WRITE: writetest(file1, buffer_size, file_size); label = "write"; break; case TESTMODE_READ: file_size = readtest(file1, buffer_size, file_size); label = "read"; break; case TESTMODE_COPY: file_size = copytest(file1, file2, buffer_size, file_size); label = "copy"; break; default: fprintf(stderr, "[%03d] ??? wrong test_mode: %d\n", node_index, test_mode); exit(1); } gettimeofday(&t2, NULL); printf("[%03d] %" GFARM_PRId64 " %7d %-5s %10.0f %s\n", node_index, (gfarm_off_t)file_size, buffer_size, label, file_size / timeval_sub(&t2, &t1), gfarm_host_get_self_name()); fflush(stdout); if ((flags & FLAG_MEASURE_PRIMITIVES) != 0) { fprintf(stderr, "[%03d] %" GFARM_PRId64 " %7d %-5s", node_index, (gfarm_off_t)file_size, buffer_size, label); if (test_mode == TESTMODE_WRITE) fprintf(stderr, " %11g %11g %11g %11g %11g\n", timerval_sub(&tm_write_open_1, &tm_write_open_0), timerval_sub(&tm_write_write_1, &tm_write_write_0), timerval_sub(&tm_write_write_all_1, &tm_write_write_all_0), timerval_sub(&tm_write_sync_1, &tm_write_sync_0), timerval_sub(&tm_write_close_1, &tm_write_close_0) ); if (test_mode == TESTMODE_READ) fprintf(stderr, " %11g %11g %11g %11g\n", timerval_sub(&tm_read_open_1, &tm_read_open_0), timerval_sub(&tm_read_read_1, &tm_read_read_0), timerval_sub(&tm_read_read_all_1, &tm_read_read_all_0), timerval_sub(&tm_read_close_1, &tm_read_close_0) ); tm_write_write_measured = tm_read_read_measured = 0; } } #define DEFAULT_FILE_SIZE 1024 int main(int argc, char **argv) { char *file1 = "test.file1"; char *file2 = "test.file2"; int c, buffer_size = 1024 * 1024; off_t file_size = -1; enum testmode test_mode = TESTMODE_WRITE; int flags = 0; gfarm_error_t e; if (argc > 0) program_name = argv[0]; e = gfarm_initialize(&argc, &argv); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: gfarm_initalize(): %s\n", program_name, gfarm_error_string(e)); exit(1); } while ((c = getopt(argc, argv, "b:s:wrcm")) != -1) { switch (c) { case 'b': buffer_size = strtol(optarg, NULL, 0); if (buffer_size > MAX_BUFFER_SIZE) { fprintf(stderr, "%s: \"-b %d\" is too big\n", program_name, buffer_size); exit(1); } break; case 's': file_size = strtol(optarg, NULL, 0); break; case 'w': test_mode = TESTMODE_WRITE; break; case 'r': test_mode = TESTMODE_READ; break; case 'c': test_mode = TESTMODE_COPY; break; case 'm': flags |= FLAG_MEASURE_PRIMITIVES; break; case '?': default: fprintf(stderr, "Usage: %s [options]" " [create-file [copy-file]]\n" "options:\n" "\t-b block-size\n" "\t-s file-size\n" "\t-w : write test\n" "\t-r : read test\n" "\t-c : copy test\n", program_name); exit(1); } } argc -= optind; argv += optind; #if 0 /* not yet in gfarm v2 */ e = gfs_pio_get_node_rank(&node_index); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: gfs_pio_get_node_rank(): %s\n", program_name, e); exit(1); } #else node_index = 0; #endif /* not yet in gfarm v2 */ if (argc > 0) file1 = argv[0]; if (argc > 1) file2 = argv[1]; if (flags & FLAG_MEASURE_PRIMITIVES) timerval_calibrate(); if (file_size == -1 && test_mode == TESTMODE_WRITE) file_size = DEFAULT_FILE_SIZE; file_size *= 1024 * 1024; initbuffer(); test(test_mode, file1, file2, buffer_size, file_size, flags); e = gfarm_terminate(); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: gfarm_terminiate(): %s on %s\n", program_name, gfarm_error_string(e), gfarm_host_get_self_name()); exit(1); } return (0); } gfarm-2.4.1/bench/thput-gfpio/Makefile0000644000000000000000000000053311507222714016277 0ustar rootroot# $Id: Makefile 2373 2006-01-12 00:54:22Z soda $ top_builddir = ../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk CFLAGS = $(COMMON_CFLAGS) LDLIBS = $(COMMON_LDFLAGS) $(GFARMLIB) $(LIBS) DEPLIBS = $(DEPGFARMLIB) PROGRAM = thput-gfpio OBJS = thput-gfpio.o all: $(PROGRAM) include $(top_srcdir)/makes/gfptool.mk gfarm-2.4.1/bench/fsstress/0000755000000000000000000000000011507222730014242 5ustar rootrootgfarm-2.4.1/bench/fsstress/dotest.sample0000755000000000000000000000006411507222715016755 0ustar rootroot#!/bin/tcsh # ./fsstress -n 1000000 -p 10 -d test gfarm-2.4.1/bench/fsstress/xfscompat.h0000644000000000000000000000023211507222715016417 0ustar rootroot#define MAXNAMELEN 1024 struct dioattr { int d_miniosz, d_maxiosz, d_mem; }; #define MIN(a,b) ((a)<(b) ? (a):(b)) #define MAX(a,b) ((a)>(b) ? (a):(b)) gfarm-2.4.1/bench/fsstress/global.h0000644000000000000000000000512511507222715015661 0ustar rootroot/* * Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of version 2 of the GNU General Public License as * published by the Free Software Foundation. * * This program is distributed in the hope that it would be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * * Further, this software is distributed without any warranty that it is * free of the rightful claim of any third person regarding infringement * or the like. Any license provided herein, whether implied or * otherwise, applies only to this software file. Patent licenses, if * any, provided herein do not apply to combinations of this program with * other software, or any other product whatsoever. * * You should have received a copy of the GNU General Public License along * with this program; if not, write the Free Software Foundation, Inc., 59 * Temple Place - Suite 330, Boston MA 02111-1307, USA. * * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, * Mountain View, CA 94043, or: * * http://www.sgi.com * * For further information regarding this notice, see: * * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ */ #ifndef GLOBAL_H #define GLOBAL_H /* xfs-specific includes */ #if defined(NO_XFS) # include "xfscompat.h" #else # include # include #endif /* libc includes */ #ifdef __FreeBSD__ #include #include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__CYGWIN__) typedef off_t off64_t; #define stat64 stat #define lseek64 lseek #define lstat64 lstat #define fstat64 fstat #define ftruncate64 ftruncate #define truncate64 truncate #define readdir64 readdir static __inline void * memalign(int blksize, int bytes) { void *ptr; int blkmask; static int pagesize; if (pagesize == 0) pagesize = getpagesize(); if (blksize < pagesize) blksize = pagesize; blkmask = blksize - 1; ptr = malloc((bytes + blkmask) & ~blkmask); bzero(ptr, bytes); return(ptr); } #endif /* defined(__FreeBSD__) || defined(__NetBSD__) || defined(__CYGWIN__) */ #ifdef __FreeBSD__ #define fdatasync fsync typedef long ptrdiff_t; #endif #endif /* GLOBAL_H */ gfarm-2.4.1/bench/fsstress/fsstress.c0000644000000000000000000015365611507222715016305 0ustar rootroot/* * Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of version 2 of the GNU General Public License as * published by the Free Software Foundation. * * This program is distributed in the hope that it would be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * * Further, this software is distributed without any warranty that it is * free of the rightful claim of any third person regarding infringement * or the like. Any license provided herein, whether implied or * otherwise, applies only to this software file. Patent licenses, if * any, provided herein do not apply to combinations of this program with * other software, or any other product whatsoever. * * You should have received a copy of the GNU General Public License along * with this program; if not, write the Free Software Foundation, Inc., 59 * Temple Place - Suite 330, Boston MA 02111-1307, USA. * * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, * Mountain View, CA 94043, or: * * http://www.sgi.com * * For further information regarding this notice, see: * * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/ */ #include "global.h" #define XFS_ERRTAG_MAX 17 typedef enum { #ifndef NO_XFS OP_ALLOCSP, OP_ATTR_REMOVE, OP_ATTR_SET, OP_BULKSTAT, OP_BULKSTAT1, #endif OP_CHOWN, OP_CREAT, OP_DREAD, OP_DWRITE, OP_FDATASYNC, #ifndef NO_XFS OP_FREESP, #endif OP_FSYNC, OP_GETDENTS, OP_LINK, OP_MKDIR, OP_MKNOD, OP_READ, OP_READLINK, OP_RENAME, #ifndef NO_XFS OP_RESVSP, #endif OP_RMDIR, OP_STAT, OP_SYMLINK, OP_SYNC, OP_TRUNCATE, OP_UNLINK, #ifndef NO_XFS OP_UNRESVSP, #endif OP_WRITE, OP_LAST } opty_t; typedef void (*opfnc_t)(int, long); typedef struct opdesc { opty_t op; char *name; opfnc_t func; int freq; int iswrite; int isxfs; } opdesc_t; typedef struct fent { int id; int parent; } fent_t; typedef struct flist { int nfiles; int nslots; int tag; fent_t *fents; } flist_t; typedef struct pathname { int len; char *path; } pathname_t; #define FT_DIR 0 #define FT_DIRm (1 << FT_DIR) #define FT_REG 1 #define FT_REGm (1 << FT_REG) #define FT_SYM 2 #define FT_SYMm (1 << FT_SYM) #define FT_DEV 3 #define FT_DEVm (1 << FT_DEV) #define FT_RTF 4 #define FT_RTFm (1 << FT_RTF) #define FT_nft 5 #define FT_ANYm ((1 << FT_nft) - 1) #define FT_REGFILE (FT_REGm | FT_RTFm) #define FT_NOTDIR (FT_ANYm & ~FT_DIRm) #define FLIST_SLOT_INCR 16 #define NDCACHE 64 #define MAXFSIZE ((1ULL << 63) - 1ULL) #define MAXFSIZE32 ((1ULL << 40) - 1ULL) void allocsp_f(int, long); void attr_remove_f(int, long); void attr_set_f(int, long); void bulkstat_f(int, long); void bulkstat1_f(int, long); void chown_f(int, long); void creat_f(int, long); void dread_f(int, long); void dwrite_f(int, long); void fdatasync_f(int, long); void freesp_f(int, long); void fsync_f(int, long); void getdents_f(int, long); void link_f(int, long); void mkdir_f(int, long); void mknod_f(int, long); void read_f(int, long); void readlink_f(int, long); void rename_f(int, long); void resvsp_f(int, long); void rmdir_f(int, long); void stat_f(int, long); void symlink_f(int, long); void sync_f(int, long); void truncate_f(int, long); void unlink_f(int, long); void unresvsp_f(int, long); void write_f(int, long); opdesc_t ops[] = { #ifndef NO_XFS { OP_ALLOCSP, "allocsp", allocsp_f, 1, 1, 1 }, { OP_ATTR_REMOVE, "attr_remove", attr_remove_f, /* 1 */ 0, 1, 1 }, { OP_ATTR_SET, "attr_set", attr_set_f, /* 2 */ 0, 1, 1 }, { OP_BULKSTAT, "bulkstat", bulkstat_f, 1, 0, 1 }, { OP_BULKSTAT1, "bulkstat1", bulkstat1_f, 1, 0, 1 }, #endif { OP_CHOWN, "chown", chown_f, 3, 1 }, { OP_CREAT, "creat", creat_f, 4, 1 }, { OP_DREAD, "dread", dread_f, 4, 0 }, { OP_DWRITE, "dwrite", dwrite_f, 4, 1 }, { OP_FDATASYNC, "fdatasync", fdatasync_f, 1, 1 }, #ifndef NO_XFS { OP_FREESP, "freesp", freesp_f, 1, 1, 1 }, #endif { OP_FSYNC, "fsync", fsync_f, 1, 1 }, { OP_GETDENTS, "getdents", getdents_f, 1, 0 }, { OP_LINK, "link", link_f, 1, 1 }, { OP_MKDIR, "mkdir", mkdir_f, 2, 1 }, { OP_MKNOD, "mknod", mknod_f, 2, 1 }, { OP_READ, "read", read_f, 1, 0 }, { OP_READLINK, "readlink", readlink_f, 1, 0 }, { OP_RENAME, "rename", rename_f, 2, 1 }, #ifndef NO_XFS { OP_RESVSP, "resvsp", resvsp_f, 1, 1, 1 }, #endif { OP_RMDIR, "rmdir", rmdir_f, 1, 1 }, { OP_STAT, "stat", stat_f, 1, 0 }, { OP_SYMLINK, "symlink", symlink_f, 2, 1 }, { OP_SYNC, "sync", sync_f, 1, 0 }, { OP_TRUNCATE, "truncate", truncate_f, 2, 1 }, { OP_UNLINK, "unlink", unlink_f, 1, 1 }, #ifndef NO_XFS { OP_UNRESVSP, "unresvsp", unresvsp_f, 1, 1, 1 }, #endif { OP_WRITE, "write", write_f, 4, 1 }, }, *ops_end; flist_t flist[FT_nft] = { { 0, 0, 'd', NULL }, { 0, 0, 'f', NULL }, { 0, 0, 'l', NULL }, { 0, 0, 'c', NULL }, { 0, 0, 'r', NULL }, }; int dcache[NDCACHE]; int errrange; int errtag; opty_t *freq_table; int freq_table_size; #ifndef NO_XFS xfs_fsop_geom_t geom; #endif char *homedir; int *ilist; int ilistlen; off64_t maxfsize; char *myprog; int namerand; int nameseq; int nops; int nproc = 1; int operations = 1; int procid; int rtpct; unsigned long seed = 0; ino_t top_ino; int verbose = 0; #ifndef NO_XFS int no_xfs = 0; #else int no_xfs = 1; #endif void add_to_flist(int, int, int); void append_pathname(pathname_t *, char *); #ifndef NO_XFS int attr_list_path(pathname_t *, char *, const int, int, attrlist_cursor_t *); int attr_remove_path(pathname_t *, const char *, int); int attr_set_path(pathname_t *, const char *, const char *, const int, int); #endif void check_cwd(void); int creat_path(pathname_t *, mode_t); void dcache_enter(int, int); void dcache_init(void); fent_t *dcache_lookup(int); void dcache_purge(int); void del_from_flist(int, int); int dirid_to_name(char *, int); void doproc(void); void fent_to_name(pathname_t *, flist_t *, fent_t *); void fix_parent(int, int); void free_pathname(pathname_t *); int generate_fname(fent_t *, int, pathname_t *, int *, int *); int get_fname(int, long, pathname_t *, flist_t **, fent_t **, int *); void init_pathname(pathname_t *); int lchown_path(pathname_t *, uid_t, gid_t); int link_path(pathname_t *, pathname_t *); int lstat64_path(pathname_t *, struct stat64 *); void make_freq_table(void); int mkdir_path(pathname_t *, mode_t); int mknod_path(pathname_t *, mode_t, dev_t); void namerandpad(int, char *, int); int open_path(pathname_t *, int); DIR *opendir_path(pathname_t *); void process_freq(char *); int readlink_path(pathname_t *, char *, size_t); int rename_path(pathname_t *, pathname_t *); int rmdir_path(pathname_t *); void separate_pathname(pathname_t *, char *, pathname_t *); void show_ops(int, char *); int stat64_path(pathname_t *, struct stat64 *); int symlink_path(const char *, pathname_t *); int truncate64_path(pathname_t *, off64_t); int unlink_path(pathname_t *); void usage(void); void write_freq(void); void zero_freq(void); int main(int argc, char **argv) { char buf[10]; int c; char *dirname = NULL; int fd; int i; int cleanup = 0; int loops = 1; int loopcntr = 1; char cmd[256]; #ifndef NO_XFS int j; #endif char *p; int stat; struct timeval t; #ifndef NO_XFS ptrdiff_t srval; #endif int nousage=0; #ifndef NO_XFS xfs_error_injection_t err_inj; #endif errrange = errtag = 0; umask(0); nops = sizeof(ops) / sizeof(ops[0]); ops_end = &ops[nops]; myprog = argv[0]; while ((c = getopt(argc, argv, "cd:e:f:i:l:n:p:rs:vwzHSX")) != -1) { switch (c) { case 'c': /*Don't cleanup*/ cleanup=1; break; case 'd': dirname = optarg; break; case 'e': sscanf(optarg, "%d", &errtag); if (errtag < 0) { errtag = -errtag; errrange = 1; } else if (errtag == 0) errtag = -1; if (errtag >= XFS_ERRTAG_MAX) { fprintf(stderr, "error tag %d too large (max %d)\n", errtag, XFS_ERRTAG_MAX - 1); exit(1); } break; case 'f': process_freq(optarg); break; case 'i': ilist = realloc(ilist, ++ilistlen * sizeof(*ilist)); ilist[ilistlen - 1] = strtol(optarg, &p, 16); break; case 'l': loops = atoi(optarg); break; case 'n': operations = atoi(optarg); break; case 'p': nproc = atoi(optarg); break; case 'r': namerand = 1; break; case 's': seed = strtoul(optarg, NULL, 0); break; case 'v': verbose = 1; break; case 'w': write_freq(); break; case 'z': zero_freq(); break; case 'S': show_ops(0, NULL); printf("\n"); nousage=1; break; case '?': fprintf(stderr, "%s - invalid parameters\n", myprog); /* fall through */ case 'H': usage(); exit(1); case 'X': no_xfs = 1; break; } } while ( (loopcntr <= loops) || (loops == 0) ) { if (no_xfs && errtag) { fprintf(stderr, "error injection only works on XFS\n"); exit(1); } if (no_xfs) { int i; for (i = 0; ops+i < ops_end; ++i) { if (ops[i].isxfs) ops[i].freq = 0; } } if (!dirname) { /* no directory specified */ if (!nousage) usage(); exit(1); } (void)mkdir(dirname, 0777); if (chdir(dirname) < 0) { perror(dirname); exit(1); } sprintf(buf, "fss%x", getpid()); fd = creat(buf, 0666); if (lseek64(fd, (off64_t)(MAXFSIZE32 + 1ULL), SEEK_SET) < 0) maxfsize = (off64_t)MAXFSIZE32; else maxfsize = (off64_t)MAXFSIZE; make_freq_table(); dcache_init(); setlinebuf(stdout); if (!seed) { gettimeofday(&t, (void *)NULL); seed = (int)t.tv_sec ^ (int)t.tv_usec; printf("seed = %ld\n", seed); } #ifndef NO_XFS if (!no_xfs) { i = ioctl(fd, XFS_IOC_FSGEOMETRY, &geom); if (i >= 0 && geom.rtblocks) rtpct = MIN(MAX(geom.rtblocks * 100 / (geom.rtblocks + geom.datablocks), 1), 99); else rtpct = 0; } if (errtag != 0) { if (errrange == 0) { if (errtag <= 0) { srandom(seed); j = random() % 100; for (i = 0; i < j; i++) (void) random(); errtag = (random() % (XFS_ERRTAG_MAX-1)) + 1; } } else { srandom(seed); j = random() % 100; for (i = 0; i < j; i++) (void) random(); errtag += (random() % (XFS_ERRTAG_MAX - errtag)); } printf("Injecting failure on tag #%d\n", errtag); err_inj.errtag = errtag; err_inj.fd = fd; srval = ioctl(fd, XFS_IOC_ERROR_INJECTION, &err_inj); if (srval < -1) { perror("fsstress - XFS_SYSSGI error injection call"); close(fd); unlink(buf); exit(1); } } else #endif close(fd); unlink(buf); if (nproc == 1) { procid = 0; doproc(); } else { for (i = 0; i < nproc; i++) { if (fork() == 0) { procid = i; doproc(); return 0; } } while (wait(&stat) > 0) continue; } #ifndef NO_XFS if (errtag != 0) { err_inj.errtag = 0; err_inj.fd = fd; if((srval = ioctl(fd, XFS_IOC_ERROR_CLEARALL, &err_inj)) != 0) { fprintf(stderr, "Bad ej clear on %d (%d).\n", fd, errno); perror("fsstress - XFS_SYSSGI clear error injection call"); close(fd); exit(1); } close(fd); } #endif if (cleanup == 0) { sprintf(cmd,"rm -rf %s/*",dirname); system(cmd); } loopcntr++; } return 0; } void add_to_flist(int ft, int id, int parent) { fent_t *fep; flist_t *ftp; ftp = &flist[ft]; if (ftp->nfiles == ftp->nslots) { ftp->nslots += FLIST_SLOT_INCR; ftp->fents = realloc(ftp->fents, ftp->nslots * sizeof(fent_t)); } fep = &ftp->fents[ftp->nfiles++]; fep->id = id; fep->parent = parent; } void append_pathname(pathname_t *name, char *str) { int len; len = strlen(str); #ifdef DEBUG if (len && *str == '/' && name->len == 0) { fprintf(stderr, "fsstress: append_pathname failure\n"); chdir(homedir); abort(); /* NOTREACHED */ } #endif name->path = realloc(name->path, name->len + 1 + len); strcpy(&name->path[name->len], str); name->len += len; } #ifndef NO_XFS int attr_list_path(pathname_t *name, char *buffer, const int buffersize, int flags, attrlist_cursor_t *cursor) { char buf[MAXNAMELEN]; pathname_t newname; int rval; rval = attr_list(name->path, buffer, buffersize, flags, cursor); if (rval >= 0 || errno != ENAMETOOLONG) return rval; separate_pathname(name, buf, &newname); if (chdir(buf) == 0) { rval = attr_list_path(&newname, buffer, buffersize, flags, cursor); chdir(".."); } free_pathname(&newname); return rval; } int attr_remove_path(pathname_t *name, const char *attrname, int flags) { char buf[MAXNAMELEN]; pathname_t newname; int rval; rval = attr_remove(name->path, attrname, flags); if (rval >= 0 || errno != ENAMETOOLONG) return rval; separate_pathname(name, buf, &newname); if (chdir(buf) == 0) { rval = attr_remove_path(&newname, attrname, flags); chdir(".."); } free_pathname(&newname); return rval; } int attr_set_path(pathname_t *name, const char *attrname, const char *attrvalue, const int valuelength, int flags) { char buf[MAXNAMELEN]; pathname_t newname; int rval; rval = attr_set(name->path, attrname, attrvalue, valuelength, flags); if (rval >= 0 || errno != ENAMETOOLONG) return rval; separate_pathname(name, buf, &newname); if (chdir(buf) == 0) { rval = attr_set_path(&newname, attrname, attrvalue, valuelength, flags); chdir(".."); } free_pathname(&newname); return rval; } #endif void check_cwd(void) { #ifdef DEBUG struct stat64 statbuf; if (stat64(".", &statbuf) == 0 && statbuf.st_ino == top_ino) return; chdir(homedir); fprintf(stderr, "fsstress: check_cwd failure\n"); abort(); /* NOTREACHED */ #endif } int creat_path(pathname_t *name, mode_t mode) { char buf[MAXNAMELEN]; pathname_t newname; int rval; rval = creat(name->path, mode); if (rval >= 0 || errno != ENAMETOOLONG) return rval; separate_pathname(name, buf, &newname); if (chdir(buf) == 0) { rval = creat_path(&newname, mode); chdir(".."); } free_pathname(&newname); return rval; } void dcache_enter(int dirid, int slot) { dcache[dirid % NDCACHE] = slot; } void dcache_init(void) { int i; for (i = 0; i < NDCACHE; i++) dcache[i] = -1; } fent_t * dcache_lookup(int dirid) { fent_t *fep; int i; i = dcache[dirid % NDCACHE]; if (i >= 0 && (fep = &flist[FT_DIR].fents[i])->id == dirid) return fep; return NULL; } void dcache_purge(int dirid) { int *dcp; dcp = &dcache[dirid % NDCACHE]; if (*dcp >= 0 && flist[FT_DIR].fents[*dcp].id == dirid) *dcp = -1; } void del_from_flist(int ft, int slot) { flist_t *ftp; ftp = &flist[ft]; if (ft == FT_DIR) dcache_purge(ftp->fents[slot].id); if (slot != ftp->nfiles - 1) { if (ft == FT_DIR) dcache_purge(ftp->fents[ftp->nfiles - 1].id); ftp->fents[slot] = ftp->fents[--ftp->nfiles]; } else ftp->nfiles--; } fent_t * dirid_to_fent(int dirid) { fent_t *efep; fent_t *fep; flist_t *flp; if ((fep = dcache_lookup(dirid))) return fep; flp = &flist[FT_DIR]; for (fep = flp->fents, efep = &fep[flp->nfiles]; fep < efep; fep++) { if (fep->id == dirid) { dcache_enter(dirid, fep - flp->fents); return fep; } } return NULL; } void doproc(void) { struct stat64 statbuf; char buf[10]; int opno; int rval; opdesc_t *p; sprintf(buf, "p%x", procid); (void)mkdir(buf, 0777); if (chdir(buf) < 0 || stat64(".", &statbuf) < 0) { perror(buf); _exit(1); } top_ino = statbuf.st_ino; homedir = getcwd(NULL, -1); seed += procid; srandom(seed); if (namerand) namerand = random(); for (opno = 0; opno < operations; opno++) { p = &ops[freq_table[random() % freq_table_size]]; if ((unsigned long)p->func < 4096) abort(); p->func(opno, random()); /* * test for forced shutdown by stat'ing the test * directory. If this stat returns EIO, assume * the forced shutdown happened. */ if (errtag != 0 && opno % 100 == 0) { rval = stat64(".", &statbuf); if (rval == EIO) { fprintf(stderr, "Detected EIO\n"); return; } } } } void fent_to_name(pathname_t *name, flist_t *flp, fent_t *fep) { char buf[MAXNAMELEN]; int i; fent_t *pfep; if (fep == NULL) return; if (fep->parent != -1) { pfep = dirid_to_fent(fep->parent); fent_to_name(name, &flist[FT_DIR], pfep); append_pathname(name, "/"); } i = sprintf(buf, "%c%x", flp->tag, fep->id); namerandpad(fep->id, buf, i); append_pathname(name, buf); } void fix_parent(int oldid, int newid) { fent_t *fep; flist_t *flp; int i; int j; for (i = 0, flp = flist; i < FT_nft; i++, flp++) { for (j = 0, fep = flp->fents; j < flp->nfiles; j++, fep++) { if (fep->parent == oldid) fep->parent = newid; } } } void free_pathname(pathname_t *name) { if (name->path) { free(name->path); name->path = NULL; name->len = 0; } } int generate_fname(fent_t *fep, int ft, pathname_t *name, int *idp, int *v) { char buf[MAXNAMELEN]; flist_t *flp; int id; int j; int len; flp = &flist[ft]; len = sprintf(buf, "%c%x", flp->tag, id = nameseq++); namerandpad(id, buf, len); if (fep) { fent_to_name(name, &flist[FT_DIR], fep); append_pathname(name, "/"); } append_pathname(name, buf); *idp = id; *v = verbose; for (j = 0; !*v && j < ilistlen; j++) { if (ilist[j] == id) { *v = 1; break; } } return 1; } int get_fname(int which, long r, pathname_t *name, flist_t **flpp, fent_t **fepp, int *v) { int c; fent_t *fep; flist_t *flp; int i; int j; int x; for (i = 0, c = 0, flp = flist; i < FT_nft; i++, flp++) { if (which & (1 << i)) c += flp->nfiles; } if (c == 0) { if (flpp) *flpp = NULL; if (fepp) *fepp = NULL; *v = verbose; return 0; } x = (int)(r % c); for (i = 0, c = 0, flp = flist; i < FT_nft; i++, flp++) { if (which & (1 << i)) { if (x < c + flp->nfiles) { fep = &flp->fents[x - c]; if (name) fent_to_name(name, flp, fep); if (flpp) *flpp = flp; if (fepp) *fepp = fep; *v = verbose; for (j = 0; !*v && j < ilistlen; j++) { if (ilist[j] == fep->id) { *v = 1; break; } } return 1; } c += flp->nfiles; } } #ifdef DEBUG fprintf(stderr, "fsstress: get_fname failure\n"); abort(); #endif return -1; /* NOTREACHED */ } void init_pathname(pathname_t *name) { name->len = 0; name->path = NULL; } int lchown_path(pathname_t *name, uid_t owner, gid_t group) { char buf[MAXNAMELEN]; pathname_t newname; int rval; rval = lchown(name->path, owner, group); if (rval >= 0 || errno != ENAMETOOLONG) return rval; separate_pathname(name, buf, &newname); if (chdir(buf) == 0) { rval = lchown_path(&newname, owner, group); chdir(".."); } free_pathname(&newname); return rval; } int link_path(pathname_t *name1, pathname_t *name2) { char buf1[MAXNAMELEN]; char buf2[MAXNAMELEN]; int down1; pathname_t newname1; pathname_t newname2; int rval; rval = link(name1->path, name2->path); if (rval >= 0 || errno != ENAMETOOLONG) return rval; separate_pathname(name1, buf1, &newname1); separate_pathname(name2, buf2, &newname2); if (strcmp(buf1, buf2) == 0) { if (chdir(buf1) == 0) { rval = link_path(&newname1, &newname2); chdir(".."); } } else { if (strcmp(buf1, "..") == 0) down1 = 0; else if (strcmp(buf2, "..") == 0) down1 = 1; else if (strlen(buf1) == 0) down1 = 0; else if (strlen(buf2) == 0) down1 = 1; else down1 = MAX(newname1.len, 3 + name2->len) <= MAX(3 + name1->len, newname2.len); if (down1) { free_pathname(&newname2); append_pathname(&newname2, "../"); append_pathname(&newname2, name2->path); if (chdir(buf1) == 0) { rval = link_path(&newname1, &newname2); chdir(".."); } } else { free_pathname(&newname1); append_pathname(&newname1, "../"); append_pathname(&newname1, name1->path); if (chdir(buf2) == 0) { rval = link_path(&newname1, &newname2); chdir(".."); } } } free_pathname(&newname1); free_pathname(&newname2); return rval; } int lstat64_path(pathname_t *name, struct stat64 *sbuf) { char buf[MAXNAMELEN]; pathname_t newname; int rval; rval = lstat64(name->path, sbuf); if (rval >= 0 || errno != ENAMETOOLONG) return rval; separate_pathname(name, buf, &newname); if (chdir(buf) == 0) { rval = lstat64_path(&newname, sbuf); chdir(".."); } free_pathname(&newname); return rval; } void make_freq_table(void) { int f; int i; opdesc_t *p; for (p = ops, f = 0; p < ops_end; p++) f += p->freq; freq_table = malloc(f * sizeof(*freq_table)); freq_table_size = f; for (p = ops, i = 0; p < ops_end; p++) { for (f = 0; f < p->freq; f++, i++) freq_table[i] = p->op; } } int mkdir_path(pathname_t *name, mode_t mode) { char buf[MAXNAMELEN]; pathname_t newname; int rval; rval = mkdir(name->path, mode); if (rval >= 0 || errno != ENAMETOOLONG) return rval; separate_pathname(name, buf, &newname); if (chdir(buf) == 0) { rval = mkdir_path(&newname, mode); chdir(".."); } free_pathname(&newname); return rval; } int mknod_path(pathname_t *name, mode_t mode, dev_t dev) { char buf[MAXNAMELEN]; pathname_t newname; int rval; rval = mknod(name->path, mode, dev); if (rval >= 0 || errno != ENAMETOOLONG) return rval; separate_pathname(name, buf, &newname); if (chdir(buf) == 0) { rval = mknod_path(&newname, mode, dev); chdir(".."); } free_pathname(&newname); return rval; } void namerandpad(int id, char *buf, int i) { int bucket; static int buckets[] = { 2, 4, 8, 16, 32, 64, 128, MAXNAMELEN - 1 }; int padlen; int padmod; if (namerand == 0) return; bucket = (id ^ namerand) % (sizeof(buckets) / sizeof(buckets[0])); padmod = buckets[bucket] + 1 - i; if (padmod <= 0) return; padlen = (id ^ namerand) % padmod; if (padlen) { memset(&buf[i], 'X', padlen); buf[i + padlen] = '\0'; } } int open_path(pathname_t *name, int oflag) { char buf[MAXNAMELEN]; pathname_t newname; int rval; rval = open(name->path, oflag); if (rval >= 0 || errno != ENAMETOOLONG) return rval; separate_pathname(name, buf, &newname); if (chdir(buf) == 0) { rval = open_path(&newname, oflag); chdir(".."); } free_pathname(&newname); return rval; } DIR * opendir_path(pathname_t *name) { char buf[MAXNAMELEN]; pathname_t newname; DIR *rval; rval = opendir(name->path); if (rval || errno != ENAMETOOLONG) return rval; separate_pathname(name, buf, &newname); if (chdir(buf) == 0) { rval = opendir_path(&newname); chdir(".."); } free_pathname(&newname); return rval; } void process_freq(char *arg) { opdesc_t *p; char *s; s = strchr(arg, '='); if (s == NULL) { fprintf(stderr, "bad argument '%s'\n", arg); exit(1); } *s++ = '\0'; for (p = ops; p < ops_end; p++) { if (strcmp(arg, p->name) == 0) { p->freq = atoi(s); return; } } fprintf(stderr, "can't find op type %s for -f\n", arg); exit(1); } int readlink_path(pathname_t *name, char *lbuf, size_t lbufsiz) { char buf[MAXNAMELEN]; pathname_t newname; int rval; rval = readlink(name->path, lbuf, lbufsiz); if (rval >= 0 || errno != ENAMETOOLONG) return rval; separate_pathname(name, buf, &newname); if (chdir(buf) == 0) { rval = readlink_path(&newname, lbuf, lbufsiz); chdir(".."); } free_pathname(&newname); return rval; } int rename_path(pathname_t *name1, pathname_t *name2) { char buf1[MAXNAMELEN]; char buf2[MAXNAMELEN]; int down1; pathname_t newname1; pathname_t newname2; int rval; rval = rename(name1->path, name2->path); if (rval >= 0 || errno != ENAMETOOLONG) return rval; separate_pathname(name1, buf1, &newname1); separate_pathname(name2, buf2, &newname2); if (strcmp(buf1, buf2) == 0) { if (chdir(buf1) == 0) { rval = rename_path(&newname1, &newname2); chdir(".."); } } else { if (strcmp(buf1, "..") == 0) down1 = 0; else if (strcmp(buf2, "..") == 0) down1 = 1; else if (strlen(buf1) == 0) down1 = 0; else if (strlen(buf2) == 0) down1 = 1; else down1 = MAX(newname1.len, 3 + name2->len) <= MAX(3 + name1->len, newname2.len); if (down1) { free_pathname(&newname2); append_pathname(&newname2, "../"); append_pathname(&newname2, name2->path); if (chdir(buf1) == 0) { rval = rename_path(&newname1, &newname2); chdir(".."); } } else { free_pathname(&newname1); append_pathname(&newname1, "../"); append_pathname(&newname1, name1->path); if (chdir(buf2) == 0) { rval = rename_path(&newname1, &newname2); chdir(".."); } } } free_pathname(&newname1); free_pathname(&newname2); return rval; } int rmdir_path(pathname_t *name) { char buf[MAXNAMELEN]; pathname_t newname; int rval; rval = rmdir(name->path); if (rval >= 0 || errno != ENAMETOOLONG) return rval; separate_pathname(name, buf, &newname); if (chdir(buf) == 0) { rval = rmdir_path(&newname); chdir(".."); } free_pathname(&newname); return rval; } void separate_pathname(pathname_t *name, char *buf, pathname_t *newname) { char *slash; init_pathname(newname); slash = strchr(name->path, '/'); if (slash == NULL) { buf[0] = '\0'; return; } *slash = '\0'; strcpy(buf, name->path); *slash = '/'; append_pathname(newname, slash + 1); } #define WIDTH 80 void show_ops(int flag, char *lead_str) { opdesc_t *p; if (flag<0) { /* print in list form */ int x = WIDTH; for (p = ops; p < ops_end; p++) { if (lead_str != NULL && x+strlen(p->name)>=WIDTH-5) x=printf("%s%s", (p==ops)?"":"\n", lead_str); x+=printf("%s ", p->name); } printf("\n"); } else { int f; for (f = 0, p = ops; p < ops_end; p++) f += p->freq; if (f == 0) flag = 1; for (p = ops; p < ops_end; p++) { if (flag != 0 || p->freq > 0) { if (lead_str != NULL) printf("%s", lead_str); printf("%20s %d/%d %s\n", p->name, p->freq, f, (p->iswrite == 0) ? " " : "write op"); } } } } int stat64_path(pathname_t *name, struct stat64 *sbuf) { char buf[MAXNAMELEN]; pathname_t newname; int rval; rval = stat64(name->path, sbuf); if (rval >= 0 || errno != ENAMETOOLONG) return rval; separate_pathname(name, buf, &newname); if (chdir(buf) == 0) { rval = stat64_path(&newname, sbuf); chdir(".."); } free_pathname(&newname); return rval; } int symlink_path(const char *name1, pathname_t *name) { char buf[MAXNAMELEN]; pathname_t newname; int rval; if (!strcmp(name1, name->path)) { printf("yikes! %s %s\n", name1, name->path); return 0; } rval = symlink(name1, name->path); if (rval >= 0 || errno != ENAMETOOLONG) return rval; separate_pathname(name, buf, &newname); if (chdir(buf) == 0) { rval = symlink_path(name1, &newname); chdir(".."); } free_pathname(&newname); return rval; } int truncate64_path(pathname_t *name, off64_t length) { char buf[MAXNAMELEN]; pathname_t newname; int rval; rval = truncate64(name->path, length); if (rval >= 0 || errno != ENAMETOOLONG) return rval; separate_pathname(name, buf, &newname); if (chdir(buf) == 0) { rval = truncate64_path(&newname, length); chdir(".."); } free_pathname(&newname); return rval; } int unlink_path(pathname_t *name) { char buf[MAXNAMELEN]; pathname_t newname; int rval; rval = unlink(name->path); if (rval >= 0 || errno != ENAMETOOLONG) return rval; separate_pathname(name, buf, &newname); if (chdir(buf) == 0) { rval = unlink_path(&newname); chdir(".."); } free_pathname(&newname); return rval; } void usage(void) { printf("Usage: %s -H or\n", myprog); printf(" %s [-c][-d dir][-e errtg][-f op_name=freq][-l loops][-n nops]\n", myprog); printf(" [-p nproc][-r len][-s seed][-v][-w][-z][-S]\n"); printf("where\n"); printf(" -c specifies not to remove files(cleanup) after execution\n"); printf(" -d dir specifies the base directory for operations\n"); printf(" -e errtg specifies error injection stuff\n"); printf(" -f op_name=freq changes the frequency of option name to freq\n"); printf(" the valid operation names are:\n"); show_ops(-1, " "); printf(" -l loops specifies the no. of times the testrun should loop.\n"); printf(" *use 0 for infinite (default 1)\n"); printf(" -n nops specifies the no. of operations per process (default 1)\n"); printf(" -p nproc specifies the no. of processes (default 1)\n"); printf(" -r specifies random name padding\n"); printf(" -s seed specifies the seed for the random generator (default random)\n"); printf(" -v specifies verbose mode\n"); printf(" -w zeros frequencies of non-write operations\n"); printf(" -z zeros frequencies of all operations\n"); printf(" -S prints the table of operations (omitting zero frequency)\n"); printf(" -H prints usage and exits\n"); printf(" -X don't do anything XFS specific (default with -DNO_XFS)\n"); } void write_freq(void) { opdesc_t *p; for (p = ops; p < ops_end; p++) { if (!p->iswrite) p->freq = 0; } } void zero_freq(void) { opdesc_t *p; for (p = ops; p < ops_end; p++) p->freq = 0; } #ifndef NO_XFS void allocsp_f(int opno, long r) { int e; pathname_t f; int fd; struct flock64 fl; __int64_t lr; off64_t off; struct stat64 stb; int v; init_pathname(&f); if (!get_fname(FT_REGFILE, r, &f, NULL, NULL, &v)) { if (v) printf("%d/%d: allocsp - no filename\n", procid, opno); free_pathname(&f); return; } fd = open_path(&f, O_RDWR); e = fd < 0 ? errno : 0; check_cwd(); if (fd < 0) { if (v) printf("%d/%d: allocsp - open %s failed %d\n", procid, opno, f.path, e); free_pathname(&f); return; } if (fstat64(fd, &stb) < 0) { if (v) printf("%d/%d: allocsp - fstat64 %s failed %d\n", procid, opno, f.path, errno); free_pathname(&f); close(fd); return; } lr = ((__int64_t)random() << 32) + random(); off = (off64_t)(lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE)); off %= maxfsize; fl.l_whence = SEEK_SET; fl.l_start = off; fl.l_len = 0; e = ioctl(fd, XFS_IOC_ALLOCSP64, &fl) < 0 ? errno : 0; if (v) printf("%d/%d: ioctl(XFS_IOC_ALLOCSP64) %s %lld 0 %d\n", procid, opno, f.path, off, e); free_pathname(&f); close(fd); } void attr_remove_f(int opno, long r) { attrlist_ent_t *aep; attrlist_t *alist; char *aname; char buf[4096]; attrlist_cursor_t cursor; int e; int ent; pathname_t f; int total; int v; int which; init_pathname(&f); if (!get_fname(FT_ANYm, r, &f, NULL, NULL, &v)) append_pathname(&f, "."); total = 0; bzero(&cursor, sizeof(cursor)); do { e = attr_list_path(&f, buf, sizeof(buf), ATTR_DONTFOLLOW, &cursor); check_cwd(); if (e) break; alist = (attrlist_t *)buf; total += alist->al_count; } while (alist->al_more); if (total == 0) { if (v) printf("%d/%d: attr_remove - no attrs for %s\n", procid, opno, f.path); free_pathname(&f); return; } which = (int)(random() % total); bzero(&cursor, sizeof(cursor)); ent = 0; aname = NULL; do { e = attr_list_path(&f, buf, sizeof(buf), ATTR_DONTFOLLOW, &cursor); check_cwd(); if (e) break; alist = (attrlist_t *)buf; if (which < ent + alist->al_count) { aep = (attrlist_ent_t *) &buf[alist->al_offset[which - ent]]; aname = aep->a_name; break; } ent += alist->al_count; } while (alist->al_more); if (aname == NULL) { if (v) printf( "%d/%d: attr_remove - name %d not found at %s\n", procid, opno, which, f.path); free_pathname(&f); return; } e = attr_remove_path(&f, aname, ATTR_DONTFOLLOW) < 0 ? errno : 0; check_cwd(); if (v) printf("%d/%d: attr_remove %s %s %d\n", procid, opno, f.path, aname, e); free_pathname(&f); } void attr_set_f(int opno, long r) { char aname[10]; char *aval; int e; pathname_t f; int len; static int lengths[] = { 10, 100, 1000, 10000 }; int li; int v; init_pathname(&f); if (!get_fname(FT_ANYm, r, &f, NULL, NULL, &v)) append_pathname(&f, "."); sprintf(aname, "a%x", nameseq++); li = (int)(random() % (sizeof(lengths) / sizeof(lengths[0]))); len = (int)(random() % lengths[li]); if (len == 0) len = 1; aval = malloc(len); memset(aval, nameseq & 0xff, len); e = attr_set_path(&f, aname, aval, len, ATTR_DONTFOLLOW) < 0 ? errno : 0; check_cwd(); free(aval); if (v) printf("%d/%d: attr_set %s %s %d\n", procid, opno, f.path, aname, e); free_pathname(&f); } void bulkstat_f(int opno, long r) { int count; int fd; __uint64_t last; int nent; xfs_bstat_t *t; __int64_t total; xfs_fsop_bulkreq_t bsr; last = 0; nent = (r % 999) + 2; t = malloc(nent * sizeof(*t)); fd = open(".", O_RDONLY); total = 0; bsr.lastip=&last; bsr.icount=nent; bsr.ubuffer=t; bsr.ocount=&count; while (ioctl(fd, XFS_IOC_FSBULKSTAT, &bsr) == 0 && count > 0) total += count; free(t); if (verbose) printf("%d/%d: bulkstat nent %d total %lld\n", procid, opno, nent, total); close(fd); } void bulkstat1_f(int opno, long r) { int e; pathname_t f; int fd; int good; __uint64_t ino; struct stat64 s; xfs_bstat_t t; int v; xfs_fsop_bulkreq_t bsr; good = random() & 1; if (good) { /* use an inode we know exists */ init_pathname(&f); if (!get_fname(FT_ANYm, r, &f, NULL, NULL, &v)) append_pathname(&f, "."); ino = stat64_path(&f, &s) < 0 ? (ino64_t)r : s.st_ino; check_cwd(); free_pathname(&f); } else { /* * pick a random inode * * note this can generate kernel warning messages * since bulkstat_one will read the disk block that * would contain a given inode even if that disk * block doesn't contain inodes. * * this is detected later, but not until after the * warning is displayed. * * "XFS: device 0x825- bad inode magic/vsn daddr 0x0 #0" * */ ino = (ino64_t)r; v = verbose; } fd = open(".", O_RDONLY); bsr.lastip=&ino; bsr.icount=1; bsr.ubuffer=&t; bsr.ocount=NULL; e = ioctl(fd, XFS_IOC_FSBULKSTAT_SINGLE, &bsr) < 0 ? errno : 0; if (v) printf("%d/%d: bulkstat1 %s ino %lld %d\n", procid, opno, good?"real":"random", (int64_t)ino, e); close(fd); } #endif void chown_f(int opno, long r) { int e; pathname_t f; int nbits; uid_t u; int v; init_pathname(&f); if (!get_fname(FT_ANYm, r, &f, NULL, NULL, &v)) append_pathname(&f, "."); u = (uid_t)random(); nbits = (int)(random() % 32); u &= (1 << nbits) - 1; e = lchown_path(&f, u, -1) < 0 ? errno : 0; check_cwd(); if (v) printf("%d/%d: chown %s %d %d\n", procid, opno, f.path, (int)u, e); free_pathname(&f); } void creat_f(int opno, long r) { int e; int e1; int extsize; pathname_t f; int fd; fent_t *fep; int id; int parid; int type; int v; int v1; int esz=0; if (!get_fname(FT_DIRm, r, NULL, NULL, &fep, &v1)) parid = -1; else parid = fep->id; init_pathname(&f); type = rtpct ? ((random() % 100) > rtpct ? FT_REG : FT_RTF) : FT_REG; if (type == FT_RTF) extsize = (random() % 10) + 1; else extsize = 0; e = generate_fname(fep, type, &f, &id, &v); v |= v1; if (!e) { if (v) { fent_to_name(&f, &flist[FT_DIR], fep); printf("%d/%d: creat - no filename from %s\n", procid, opno, f.path); } free_pathname(&f); return; } fd = creat_path(&f, 0666); e = fd < 0 ? errno : 0; e1 = 0; check_cwd(); esz = 0; if (fd >= 0) { #ifndef NO_XFS struct fsxattr a; if (extsize && ioctl(fd, XFS_IOC_FSGETXATTR, &a) >= 0) { a.fsx_xflags |= XFS_XFLAG_REALTIME; a.fsx_extsize = geom.rtextsize * geom.blocksize * extsize; if (ioctl(fd, XFS_IOC_FSSETXATTR, &a) < 0) e1 = errno; esz = a.fsx_estsize; } #endif add_to_flist(type, id, parid); close(fd); } if (v) printf("%d/%d: creat %s x:%d %d %d\n", procid, opno, f.path, esz, e, e1); free_pathname(&f); } #ifdef O_DIRECT int setdirect(int fd) { static int no_direct; int flags; if (no_direct) return 0; flags = fcntl(fd, F_GETFL, 0); if (flags < 0) return 0; if (fcntl(fd, F_SETFL, flags|O_DIRECT) < 0) { if (no_xfs) { no_direct = 1; return 0; } printf("cannot set O_DIRECT: %s\n",strerror(errno)); return 0; } return 1; } #endif void dread_f(int opno, long r) { __int64_t align; char *buf; struct dioattr diob; int e; pathname_t f; int fd; size_t len; __int64_t lr; off64_t off; struct stat64 stb; int v; init_pathname(&f); if (!get_fname(FT_REGFILE, r, &f, NULL, NULL, &v)) { if (v) printf("%d/%d: dread - no filename\n", procid, opno); free_pathname(&f); return; } fd = open_path(&f, O_RDONLY); #ifdef O_DIRECT if (!setdirect(fd)) { return; } #endif e = fd < 0 ? errno : 0; check_cwd(); if (fd < 0) { if (v) printf("%d/%d: dread - open %s failed %d\n", procid, opno, f.path, e); free_pathname(&f); return; } if (fstat64(fd, &stb) < 0) { if (v) printf("%d/%d: dread - fstat64 %s failed %d\n", procid, opno, f.path, errno); free_pathname(&f); close(fd); return; } if (stb.st_size == 0) { if (v) printf("%d/%d: dread - %s zero size\n", procid, opno, f.path); free_pathname(&f); close(fd); return; } if (no_xfs) { diob.d_miniosz = stb.st_blksize; diob.d_maxiosz = stb.st_blksize * 256; /* good number ? */ diob.d_mem = stb.st_blksize; } #ifndef NO_XFS else if (ioctl(fd, XFS_IOC_DIOINFO, &diob) < 0) { if (v) printf( "%d/%d: dread - ioctl(fd, XFS_IOC_DIOINFO) %s failed %d\n", procid, opno, f.path, errno); free_pathname(&f); close(fd); return; } #endif align = (__int64_t)diob.d_miniosz; lr = ((__int64_t)random() << 32) + random(); off = (off64_t)(lr % stb.st_size); off -= (off % align); lseek64(fd, off, SEEK_SET); len = (random() % (getpagesize() * 32)) + 1; len -= (len % align); if (len <= 0) len = align; else if (len > diob.d_maxiosz) len = diob.d_maxiosz; buf = memalign(diob.d_mem, len); e = read(fd, buf, len) < 0 ? errno : 0; free(buf); if (v) printf("%d/%d: dread %s [%lld,%ld] %d\n", procid, opno, f.path, (long long int)off, (long)len, e); free_pathname(&f); close(fd); } void dwrite_f(int opno, long r) { __int64_t align; char *buf; struct dioattr diob; int e; pathname_t f; int fd; size_t len; __int64_t lr; off64_t off; struct stat64 stb; int v; init_pathname(&f); if (!get_fname(FT_REGFILE, r, &f, NULL, NULL, &v)) { if (v) printf("%d/%d: dwrite - no filename\n", procid, opno); free_pathname(&f); return; } fd = open_path(&f, O_WRONLY); e = fd < 0 ? errno : 0; check_cwd(); if (fd < 0) { if (v) printf("%d/%d: dwrite - open %s failed %d\n", procid, opno, f.path, e); free_pathname(&f); return; } #ifdef O_DIRECT if (!setdirect(fd)) return; #endif if (fstat64(fd, &stb) < 0) { if (v) printf("%d/%d: dwrite - fstat64 %s failed %d\n", procid, opno, f.path, errno); free_pathname(&f); close(fd); return; } if (no_xfs) { diob.d_miniosz = stb.st_blksize; diob.d_maxiosz = stb.st_blksize * 256; /* good number ? */ diob.d_mem = stb.st_blksize; } #ifndef NO_XFS else if (ioctl(fd, XFS_IOC_DIOINFO, &diob) < 0) { if (v) printf( "%d/%d: dwrite - ioctl(fd, XFS_IOC_DIOINFO) %s failed %d\n", procid, opno, f.path, errno); free_pathname(&f); close(fd); return; } #endif align = (__int64_t)diob.d_miniosz; lr = ((__int64_t)random() << 32) + random(); off = (off64_t)(lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE)); off -= (off % align); lseek64(fd, off, SEEK_SET); len = (random() % (getpagesize() * 32)) + 1; len -= (len % align); if (len <= 0) len = align; else if (len > diob.d_maxiosz) len = diob.d_maxiosz; buf = memalign(diob.d_mem, len); off %= maxfsize; lseek64(fd, off, SEEK_SET); memset(buf, nameseq & 0xff, len); e = write(fd, buf, len) < 0 ? errno : 0; free(buf); if (v) printf("%d/%d: dwrite %s [%lld,%ld] %d\n", procid, opno, f.path, (long long)off, (long int)len, e); free_pathname(&f); close(fd); } void fdatasync_f(int opno, long r) { int e; pathname_t f; int fd; int v; init_pathname(&f); if (!get_fname(FT_REGFILE, r, &f, NULL, NULL, &v)) { if (v) printf("%d/%d: fdatasync - no filename\n", procid, opno); free_pathname(&f); return; } fd = open_path(&f, O_WRONLY); e = fd < 0 ? errno : 0; check_cwd(); if (fd < 0) { if (v) printf("%d/%d: fdatasync - open %s failed %d\n", procid, opno, f.path, e); free_pathname(&f); return; } e = fdatasync(fd) < 0 ? errno : 0; if (v) printf("%d/%d: fdatasync %s %d\n", procid, opno, f.path, e); free_pathname(&f); close(fd); } #ifndef NO_XFS void freesp_f(int opno, long r) { int e; pathname_t f; int fd; struct flock64 fl; __int64_t lr; off64_t off; struct stat64 stb; int v; init_pathname(&f); if (!get_fname(FT_REGFILE, r, &f, NULL, NULL, &v)) { if (v) printf("%d/%d: freesp - no filename\n", procid, opno); free_pathname(&f); return; } fd = open_path(&f, O_RDWR); e = fd < 0 ? errno : 0; check_cwd(); if (fd < 0) { if (v) printf("%d/%d: freesp - open %s failed %d\n", procid, opno, f.path, e); free_pathname(&f); return; } if (fstat64(fd, &stb) < 0) { if (v) printf("%d/%d: freesp - fstat64 %s failed %d\n", procid, opno, f.path, errno); free_pathname(&f); close(fd); return; } lr = ((__int64_t)random() << 32) + random(); off = (off64_t)(lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE)); off %= maxfsize; fl.l_whence = SEEK_SET; fl.l_start = off; fl.l_len = 0; e = ioctl(fd, XFS_IOC_FREESP64, &fl) < 0 ? errno : 0; if (v) printf("%d/%d: ioctl(XFS_IOC_FREESP64) %s %lld 0 %d\n", procid, opno, f.path, off, e); free_pathname(&f); close(fd); } #endif void fsync_f(int opno, long r) { int e; pathname_t f; int fd; int v; init_pathname(&f); if (!get_fname(FT_REGFILE, r, &f, NULL, NULL, &v)) { if (v) printf("%d/%d: fsync - no filename\n", procid, opno); free_pathname(&f); return; } fd = open_path(&f, O_WRONLY); e = fd < 0 ? errno : 0; check_cwd(); if (fd < 0) { if (v) printf("%d/%d: fsync - open %s failed %d\n", procid, opno, f.path, e); free_pathname(&f); return; } e = fsync(fd) < 0 ? errno : 0; if (v) printf("%d/%d: fsync %s %d\n", procid, opno, f.path, e); free_pathname(&f); close(fd); } void getdents_f(int opno, long r) { DIR *dir; pathname_t f; int v; init_pathname(&f); if (!get_fname(FT_DIRm, r, &f, NULL, NULL, &v)) append_pathname(&f, "."); dir = opendir_path(&f); check_cwd(); if (dir == NULL) { if (v) printf("%d/%d: getdents - can't open %s\n", procid, opno, f.path); free_pathname(&f); return; } while (readdir64(dir) != NULL) continue; if (v) printf("%d/%d: getdents %s 0\n", procid, opno, f.path); free_pathname(&f); closedir(dir); } void link_f(int opno, long r) { int e; pathname_t f; fent_t *fep; flist_t *flp; int id; pathname_t l; int parid; int v; int v1; init_pathname(&f); if (!get_fname(FT_NOTDIR, r, &f, &flp, NULL, &v1)) { if (v1) printf("%d/%d: link - no file\n", procid, opno); free_pathname(&f); return; } if (!get_fname(FT_DIRm, random(), NULL, NULL, &fep, &v)) parid = -1; else parid = fep->id; v |= v1; init_pathname(&l); e = generate_fname(fep, flp - flist, &l, &id, &v1); v |= v1; if (!e) { if (v) { fent_to_name(&l, &flist[FT_DIR], fep); printf("%d/%d: link - no filename from %s\n", procid, opno, l.path); } free_pathname(&l); free_pathname(&f); return; } e = link_path(&f, &l) < 0 ? errno : 0; check_cwd(); if (e == 0) add_to_flist(flp - flist, id, parid); if (v) printf("%d/%d: link %s %s %d\n", procid, opno, f.path, l.path, e); free_pathname(&l); free_pathname(&f); } void mkdir_f(int opno, long r) { int e; pathname_t f; fent_t *fep; int id; int parid; int v; int v1; if (!get_fname(FT_DIRm, r, NULL, NULL, &fep, &v)) parid = -1; else parid = fep->id; init_pathname(&f); e = generate_fname(fep, FT_DIR, &f, &id, &v1); v |= v1; if (!e) { if (v) { fent_to_name(&f, &flist[FT_DIR], fep); printf("%d/%d: mkdir - no filename from %s\n", procid, opno, f.path); } free_pathname(&f); return; } e = mkdir_path(&f, 0777) < 0 ? errno : 0; check_cwd(); if (e == 0) add_to_flist(FT_DIR, id, parid); if (v) printf("%d/%d: mkdir %s %d\n", procid, opno, f.path, e); free_pathname(&f); } void mknod_f(int opno, long r) { int e; pathname_t f; fent_t *fep; int id; int parid; int v; int v1; if (!get_fname(FT_DIRm, r, NULL, NULL, &fep, &v)) parid = -1; else parid = fep->id; init_pathname(&f); e = generate_fname(fep, FT_DEV, &f, &id, &v1); v |= v1; if (!e) { if (v) { fent_to_name(&f, &flist[FT_DIR], fep); printf("%d/%d: mknod - no filename from %s\n", procid, opno, f.path); } free_pathname(&f); return; } e = mknod_path(&f, S_IFCHR|0444, 0) < 0 ? errno : 0; check_cwd(); if (e == 0) add_to_flist(FT_DEV, id, parid); if (v) printf("%d/%d: mknod %s %d\n", procid, opno, f.path, e); free_pathname(&f); } void read_f(int opno, long r) { char *buf; int e; pathname_t f; int fd; size_t len; __int64_t lr; off64_t off; struct stat64 stb; int v; init_pathname(&f); if (!get_fname(FT_REGFILE, r, &f, NULL, NULL, &v)) { if (v) printf("%d/%d: read - no filename\n", procid, opno); free_pathname(&f); return; } fd = open_path(&f, O_RDONLY); e = fd < 0 ? errno : 0; check_cwd(); if (fd < 0) { if (v) printf("%d/%d: read - open %s failed %d\n", procid, opno, f.path, e); free_pathname(&f); return; } if (fstat64(fd, &stb) < 0) { if (v) printf("%d/%d: read - fstat64 %s failed %d\n", procid, opno, f.path, errno); free_pathname(&f); close(fd); return; } if (stb.st_size == 0) { if (v) printf("%d/%d: read - %s zero size\n", procid, opno, f.path); free_pathname(&f); close(fd); return; } lr = ((__int64_t)random() << 32) + random(); off = (off64_t)(lr % stb.st_size); lseek64(fd, off, SEEK_SET); len = (random() % (getpagesize() * 32)) + 1; buf = malloc(len); e = read(fd, buf, len) < 0 ? errno : 0; free(buf); if (v) printf("%d/%d: read %s [%lld,%ld] %d\n", procid, opno, f.path, (long long)off, (long int)len, e); free_pathname(&f); close(fd); } void readlink_f(int opno, long r) { char buf[PATH_MAX]; int e; pathname_t f; int v; init_pathname(&f); if (!get_fname(FT_SYMm, r, &f, NULL, NULL, &v)) { if (v) printf("%d/%d: readlink - no filename\n", procid, opno); free_pathname(&f); return; } e = readlink_path(&f, buf, PATH_MAX) < 0 ? errno : 0; check_cwd(); if (v) printf("%d/%d: readlink %s %d\n", procid, opno, f.path, e); free_pathname(&f); } void rename_f(int opno, long r) { fent_t *dfep; int e; pathname_t f; fent_t *fep; flist_t *flp; int id; pathname_t newf; int oldid; int parid; int v; int v1; init_pathname(&f); if (!get_fname(FT_ANYm, r, &f, &flp, &fep, &v1)) { if (v1) printf("%d/%d: rename - no filename\n", procid, opno); free_pathname(&f); return; } if (!get_fname(FT_DIRm, random(), NULL, NULL, &dfep, &v)) parid = -1; else parid = dfep->id; v |= v1; init_pathname(&newf); e = generate_fname(dfep, flp - flist, &newf, &id, &v1); v |= v1; if (!e) { if (v) { fent_to_name(&f, &flist[FT_DIR], dfep); printf("%d/%d: rename - no filename from %s\n", procid, opno, f.path); } free_pathname(&newf); free_pathname(&f); return; } e = rename_path(&f, &newf) < 0 ? errno : 0; check_cwd(); if (e == 0) { if (flp - flist == FT_DIR) { oldid = fep->id; fix_parent(oldid, id); } del_from_flist(flp - flist, fep - flp->fents); add_to_flist(flp - flist, id, parid); } if (v) printf("%d/%d: rename %s to %s %d\n", procid, opno, f.path, newf.path, e); free_pathname(&newf); free_pathname(&f); } #ifndef NO_XFS void resvsp_f(int opno, long r) { int e; pathname_t f; int fd; struct flock64 fl; __int64_t lr; off64_t off; struct stat64 stb; int v; init_pathname(&f); if (!get_fname(FT_REGFILE, r, &f, NULL, NULL, &v)) { if (v) printf("%d/%d: resvsp - no filename\n", procid, opno); free_pathname(&f); return; } fd = open_path(&f, O_RDWR); e = fd < 0 ? errno : 0; check_cwd(); if (fd < 0) { if (v) printf("%d/%d: resvsp - open %s failed %d\n", procid, opno, f.path, e); free_pathname(&f); return; } if (fstat64(fd, &stb) < 0) { if (v) printf("%d/%d: resvsp - fstat64 %s failed %d\n", procid, opno, f.path, errno); free_pathname(&f); close(fd); return; } lr = ((__int64_t)random() << 32) + random(); off = (off64_t)(lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE)); off %= maxfsize; fl.l_whence = SEEK_SET; fl.l_start = off; fl.l_len = (off64_t)(random() % (1024 * 1024)); e = ioctl(fd, XFS_IOC_RESVSP64, &fl) < 0 ? errno : 0; if (v) printf("%d/%d: ioctl(XFS_IOC_RESVSP64) %s %lld %lld %d\n", procid, opno, f.path, off, fl.l_len, e); free_pathname(&f); close(fd); } #endif void rmdir_f(int opno, long r) { int e; pathname_t f; fent_t *fep; int v; init_pathname(&f); if (!get_fname(FT_DIRm, r, &f, NULL, &fep, &v)) { if (v) printf("%d/%d: rmdir - no directory\n", procid, opno); free_pathname(&f); return; } e = rmdir_path(&f) < 0 ? errno : 0; check_cwd(); if (e == 0) del_from_flist(FT_DIR, fep - flist[FT_DIR].fents); if (v) printf("%d/%d: rmdir %s %d\n", procid, opno, f.path, e); free_pathname(&f); } void stat_f(int opno, long r) { int e; pathname_t f; struct stat64 stb; int v; init_pathname(&f); if (!get_fname(FT_ANYm, r, &f, NULL, NULL, &v)) { if (v) printf("%d/%d: stat - no entries\n", procid, opno); free_pathname(&f); return; } e = lstat64_path(&f, &stb) < 0 ? errno : 0; check_cwd(); if (v) printf("%d/%d: stat %s %d\n", procid, opno, f.path, e); free_pathname(&f); } void symlink_f(int opno, long r) { int e; pathname_t f; fent_t *fep; int i; int id; int len; int parid; int v; int v1; char *val; if (!get_fname(FT_DIRm, r, NULL, NULL, &fep, &v)) parid = -1; else parid = fep->id; init_pathname(&f); e = generate_fname(fep, FT_SYM, &f, &id, &v1); v |= v1; if (!e) { if (v) { fent_to_name(&f, &flist[FT_DIR], fep); printf("%d/%d: symlink - no filename from %s\n", procid, opno, f.path); } free_pathname(&f); return; } len = (int)(random() % PATH_MAX); val = malloc(len + 1); if (len) memset(val, 'x', len); val[len] = '\0'; for (i = 10; i < len - 1; i += 10) val[i] = '/'; e = symlink_path(val, &f) < 0 ? errno : 0; check_cwd(); if (e == 0) add_to_flist(FT_SYM, id, parid); free(val); if (v) printf("%d/%d: symlink %s %d\n", procid, opno, f.path, e); free_pathname(&f); } /* ARGSUSED */ void sync_f(int opno, long r) { sync(); if (verbose) printf("%d/%d: sync\n", procid, opno); } void truncate_f(int opno, long r) { int e; pathname_t f; __int64_t lr; off64_t off; struct stat64 stb; int v; init_pathname(&f); if (!get_fname(FT_REGFILE, r, &f, NULL, NULL, &v)) { if (v) printf("%d/%d: truncate - no filename\n", procid, opno); free_pathname(&f); return; } e = stat64_path(&f, &stb) < 0 ? errno : 0; check_cwd(); if (e > 0) { if (v) printf("%d/%d: truncate - stat64 %s failed %d\n", procid, opno, f.path, e); free_pathname(&f); return; } lr = ((__int64_t)random() << 32) + random(); off = (off64_t)(lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE)); off %= maxfsize; e = truncate64_path(&f, off) < 0 ? errno : 0; check_cwd(); if (v) printf("%d/%d: truncate %s %lld %d\n", procid, opno, f.path, (long long)off, e); free_pathname(&f); } void unlink_f(int opno, long r) { int e; pathname_t f; fent_t *fep; flist_t *flp; int v; init_pathname(&f); if (!get_fname(FT_NOTDIR, r, &f, &flp, &fep, &v)) { if (v) printf("%d/%d: unlink - no file\n", procid, opno); free_pathname(&f); return; } e = unlink_path(&f) < 0 ? errno : 0; check_cwd(); if (e == 0) del_from_flist(flp - flist, fep - flp->fents); if (v) printf("%d/%d: unlink %s %d\n", procid, opno, f.path, e); free_pathname(&f); } #ifndef NO_XFS void unresvsp_f(int opno, long r) { int e; pathname_t f; int fd; struct flock64 fl; __int64_t lr; off64_t off; struct stat64 stb; int v; init_pathname(&f); if (!get_fname(FT_REGFILE, r, &f, NULL, NULL, &v)) { if (v) printf("%d/%d: unresvsp - no filename\n", procid, opno); free_pathname(&f); return; } fd = open_path(&f, O_RDWR); e = fd < 0 ? errno : 0; check_cwd(); if (fd < 0) { if (v) printf("%d/%d: unresvsp - open %s failed %d\n", procid, opno, f.path, e); free_pathname(&f); return; } if (fstat64(fd, &stb) < 0) { if (v) printf("%d/%d: unresvsp - fstat64 %s failed %d\n", procid, opno, f.path, errno); free_pathname(&f); close(fd); return; } lr = ((__int64_t)random() << 32) + random(); off = (off64_t)(lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE)); off %= maxfsize; fl.l_whence = SEEK_SET; fl.l_start = off; fl.l_len = (off64_t)(random() % (1 << 20)); e = ioctl(fd, XFS_IOC_UNRESVSP64, &fl) < 0 ? errno : 0; if (v) printf("%d/%d: ioctl(XFS_IOC_UNRESVSP64) %s %lld %lld %d\n", procid, opno, f.path, off, fl.l_len, e); free_pathname(&f); close(fd); } #endif void write_f(int opno, long r) { char *buf; int e; pathname_t f; int fd; size_t len; __int64_t lr; off64_t off; struct stat64 stb; int v; init_pathname(&f); if (!get_fname(FT_REGm, r, &f, NULL, NULL, &v)) { if (v) printf("%d/%d: write - no filename\n", procid, opno); free_pathname(&f); return; } fd = open_path(&f, O_WRONLY); e = fd < 0 ? errno : 0; check_cwd(); if (fd < 0) { if (v) printf("%d/%d: write - open %s failed %d\n", procid, opno, f.path, e); free_pathname(&f); return; } if (fstat64(fd, &stb) < 0) { if (v) printf("%d/%d: write - fstat64 %s failed %d\n", procid, opno, f.path, errno); free_pathname(&f); close(fd); return; } lr = ((__int64_t)random() << 32) + random(); off = (off64_t)(lr % MIN(stb.st_size + (1024 * 1024), MAXFSIZE)); off %= maxfsize; lseek64(fd, off, SEEK_SET); len = (random() % (getpagesize() * 32)) + 1; buf = malloc(len); memset(buf, nameseq & 0xff, len); e = write(fd, buf, len) < 0 ? errno : 0; free(buf); if (v) printf("%d/%d: write %s [%lld,%ld] %d\n", procid, opno, f.path, (long long)off, (long int)len, e); free_pathname(&f); close(fd); } gfarm-2.4.1/bench/fsstress/Makefile0000644000000000000000000000033411507222715015705 0ustar rootrootCFLAGS += -Wall -g -DNO_XFS -I. -D_LARGEFILE64_SOURCE -D_GNU_SOURCE LDFLAGS += SRCS=$(wildcard *.c) TARGETS=$(patsubst %.c,%,$(SRCS)) all: $(TARGETS) install: ln -f fsstress ../../../bin clean: rm -f $(TARGETS) gfarm-2.4.1/bench/fsstress/README0000644000000000000000000000371611507222715015134 0ustar rootrootTo: dillon@FreeBSD.ORG Subject: Andi Kleen: Re: [LTP] New NFS test added. Date: Wed, 19 Dec 2001 19:03:27 -0800 Message-ID: <13537.1008817407@winston.freebsd.org> From: Jordan Hubbard JFYI ------- Forwarded Message Return-Path: ak@suse.de Delivery-Date: Wed Dec 19 16:47:53 2001 Return-Path: Received: from Cantor.suse.de (ns.suse.de [213.95.15.193]) by winston.freebsd.org (8.11.6/8.11.6) with ESMTP id fBK0lqG13262 for ; Wed, 19 Dec 2001 16:47:52 -0800 (PST) (envelope-from ak@suse.de) Received: from Hermes.suse.de (Hermes.suse.de [213.95.15.136]) by Cantor.suse.de (Postfix) with ESMTP id 7F5061E80D; Thu, 20 Dec 2001 01:47:57 +0100 (MET) Date: Thu, 20 Dec 2001 01:47:56 +0100 From: Andi Kleen To: Robert Williamson Cc: ltp-list@lists.sourceforge.net, jkh@winston.freebsd.org Subject: Re: [LTP] New NFS test added. Message-ID: <20011220014756.A17649@wotan.suse.de> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.3.22.1i On Tue, Dec 18, 2001 at 05:01:44PM -0600, Robert Williamson wrote: > The guys at Apple have allowed us to add "fsx-linux", which is a great test > for hammering NFS. The test has already been added to the CVS tree, and > included in the runtest scripts. It will be included in the next > release...early January. Thanks again to the guys at Apple. If you're interested I also ported fsstress from the XFS test suite to build/work without XFS. It does some different tests from fsx/doio, basically all VFS operations on a tree of files and i found some bugs with it in the past. It's in ftp://zero.aec.at/pub/ak/stress/xfsstress-noxfs.tar.gz If the XFS group doesn't mind it may make sense to put it into LTP too. - -Andi ------- End of Forwarded Message gfarm-2.4.1/bench/thput-fsys/0000755000000000000000000000000011507222730014514 5ustar rootrootgfarm-2.4.1/bench/thput-fsys/thput-fsys.c0000644000000000000000000002503411507222714017014 0ustar rootroot/* * $Id: thput-fsys.c 298 2003-02-28 04:42:39Z tatebe $ */ #include #include #include #include #include #ifdef i386 typedef unsigned long long timerval_t; double timerval_calibration; unsigned long long get_cycles(void) { unsigned long long rv; __asm __volatile("rdtsc" : "=A" (rv)); return (rv); } #define gettimerval(tp) (*(tp) = get_cycles()) #define timerval_second(tp) (*(tp) * timerval_calibration) #define timerval_sub(t1p, t2p) ((*(t1p) - *(t2p)) * timerval_calibration) void timerval_calibrate(void) { timerval_t t1, t2; struct timeval s1, s2; /* warming up */ gettimerval(&t1); gettimeofday(&s1, NULL); gettimerval(&t1); gettimeofday(&s1, NULL); sleep(3); gettimerval(&t2); gettimeofday(&s2, NULL); timerval_calibration = ((s2.tv_sec - s1.tv_sec) + (s2.tv_usec - s1.tv_usec) * .000001) / (t2 - t1); fprintf(stderr, "timer/sec=%g\n", 1.0 / timerval_calibration); } #else /* gettimeofday */ typedef struct timeval timerval_t; #define gettimerval(t1) gettimeofday(t1, NULL) #define timerval_second(t1) ((double)(t1)->tv_sec \ + (double)(t1)->tv_usec * .000001) #define timerval_sub(t1, t2) \ (((double)(t1)->tv_sec - (double)(t2)->tv_sec) \ + ((double)(t1)->tv_usec - (double)(t2)->tv_usec) * .000001) void timerval_calibrate(void) {} #endif int tm_write_write_measured = 0; timerval_t tm_write_open_0, tm_write_open_1; timerval_t tm_write_write_0, tm_write_write_1; timerval_t tm_write_write_all_0, tm_write_write_all_1; timerval_t tm_write_sync_0, tm_write_sync_1; timerval_t tm_write_close_0, tm_write_close_1; int tm_read_read_measured = 0; timerval_t tm_read_open_0, tm_read_open_1; timerval_t tm_read_read_0, tm_read_read_1; timerval_t tm_read_read_all_0, tm_read_read_all_1; timerval_t tm_read_close_0, tm_read_close_1; #define ARRAY_LENGTH(array) (sizeof(array)/sizeof(array[0])) /* Linux stupidly requires 512byte aligned buffer for raw device access. */ #define ALIGNMENT 512 #define MAX_BUFFER_SIZE_NUMBER 32 char *buffer; int max_buffer_size = 0; void * alloc_aligned_memory(size_t size, int alignment) { char *p = malloc(size + alignment - 1); if (p == NULL) { fprintf(stderr, "no memory for %ld bytes\n", (long)size + alignment - 1); exit(1); } if (((long)p & (alignment - 1)) != 0) p += alignment - ((long)p & (alignment - 1)); return (p); } void initbuffer(void) { int i; for (i = 0; i < max_buffer_size; i++) buffer[i] = i; } void writetest(char *ofile, int buffer_size, off_t file_size) { int fd, rv; off_t residual; gettimerval(&tm_write_open_0); fd = open(ofile, O_CREAT|O_TRUNC|O_WRONLY, 0666); gettimerval(&tm_write_open_1); if (fd == -1) { perror(ofile); exit(1); } gettimerval(&tm_write_write_all_0); for (residual = file_size; residual > 0; residual -= rv) { if (!tm_write_write_measured) { tm_write_write_measured = 1; gettimerval(&tm_write_write_0); rv = write(fd, buffer, buffer_size <= residual ? buffer_size : residual); gettimerval(&tm_write_write_1); } else { rv = write(fd, buffer, buffer_size <= residual ? buffer_size : residual); } if (rv == -1) { perror("write test"); break; } if (rv != (buffer_size <= residual ? buffer_size : residual)) break; } gettimerval(&tm_write_write_all_1); if (residual > 0) { fprintf(stderr, "write test failed, residual = %ld\n", (long)residual); } gettimerval(&tm_write_sync_0); rv = fsync(fd); gettimerval(&tm_write_sync_1); if (rv == -1) perror("write test fsync failed"); gettimerval(&tm_write_close_0); rv = close(fd); gettimerval(&tm_write_close_1); if (rv == -1) perror("write test close failed"); } void readtest(char *ifile, int buffer_size, off_t file_size) { int fd, rv; off_t residual; gettimerval(&tm_read_open_0); fd = open(ifile, O_RDONLY); gettimerval(&tm_read_open_1); if (fd == -1) { perror(ifile); exit(1); } gettimerval(&tm_read_read_all_0); for (residual = file_size; residual > 0; residual -= rv) { if (!tm_read_read_measured) { tm_read_read_measured = 1; gettimerval(&tm_read_read_0); rv = read(fd, buffer, buffer_size <= residual ? buffer_size : residual); gettimerval(&tm_read_read_1); } else { rv = read(fd, buffer, buffer_size <= residual ? buffer_size : residual); } if (rv == 0) break; if (rv == -1) { perror("read test"); break; } if (rv != buffer_size && rv != residual) break; } gettimerval(&tm_read_read_all_1); if (residual > 0) { fprintf(stderr, "read test failed, residual = %ld\n", (long)residual); } gettimerval(&tm_read_close_0); rv = close(fd); gettimerval(&tm_read_close_1); if (rv == -1) perror("read test closed failed"); } void copytest(char *ifile, char *ofile, int buffer_size, off_t file_size) { int ifd, ofd; int rv, osize; off_t residual; ifd = open(ifile, O_RDONLY); if (ifd == -1) { perror(ifile); exit(1); } ofd = open(ofile, O_CREAT|O_TRUNC|O_WRONLY, 0666); if (ofd == -1) { perror(ofile); exit(1); } for (residual = file_size; residual > 0; residual -= rv) { rv = read(ifd, buffer, buffer_size <= residual ? buffer_size : residual); if (rv == 0) break; if (rv == -1) { perror("copytest read"); break; } if (rv != buffer_size && rv != residual) break; osize = rv; rv = write(ofd, buffer, osize); if (rv == -1) { perror("copytest write"); break; } if (rv != osize) break; } if (residual > 0) { fprintf(stderr, "copy test failed, residual = %ld\n", (long)residual); } if (close(ofd) == -1) perror("copy test write close failed"); if (close(ifd) == -1) perror("copy test read close failed"); } double timeval_sub(struct timeval *t1, struct timeval *t2) { return ((t1->tv_sec + t1->tv_usec * .000001) - (t2->tv_sec + t2->tv_usec * .000001)); } #define TESTMODE_WRITE 1 #define TESTMODE_READ 2 #define TESTMODE_COPY 4 #define FLAG_DONT_REMOVE 1 #define FLAG_MEASURE_PRIMITIVES 2 void test_title(int test_mode, off_t file_size, int flags) { fprintf(stdout, "testing with %d MB file\n", (int)file_size); printf("%-8s", "bufsize"); if (test_mode & TESTMODE_WRITE) printf(" %20s", "write [bytes/sec]"); if (test_mode & TESTMODE_READ) printf(" %20s", "read [bytes/sec]"); if (test_mode & TESTMODE_COPY) printf(" %20s", "copy [bytes/sec]"); printf("\n"); fflush(stdout); } void test(int test_mode, char *file1, char *file2, int buffer_size, off_t file_size, int flags) { struct timeval t1, t2, t3, t4; if ((flags & FLAG_DONT_REMOVE) == 0) { if (test_mode & TESTMODE_WRITE) unlink(file1); if (test_mode & TESTMODE_COPY) unlink(file2); } gettimeofday(&t1, NULL); if (test_mode & TESTMODE_WRITE) writetest(file1, buffer_size, file_size); gettimeofday(&t2, NULL); if (test_mode & TESTMODE_READ) readtest(file1,buffer_size, file_size); gettimeofday(&t3, NULL); if (test_mode & TESTMODE_COPY) copytest(file1, file2, buffer_size, file_size); gettimeofday(&t4, NULL); printf("%7d ", buffer_size); if (test_mode & TESTMODE_WRITE) printf(" %10.0f%10s", file_size / timeval_sub(&t2, &t1), ""); if (test_mode & TESTMODE_READ) printf(" %10.0f%10s", file_size / timeval_sub(&t3, &t2), ""); if (test_mode & TESTMODE_COPY) printf(" %10.0f%10s", file_size / timeval_sub(&t4, &t3), ""); printf("\n"); fflush(stdout); if ((flags & FLAG_DONT_REMOVE) == 0) { if (test_mode & TESTMODE_WRITE) unlink(file1); if (test_mode & TESTMODE_COPY) unlink(file2); } if ((flags & FLAG_MEASURE_PRIMITIVES) != 0 && (test_mode & (TESTMODE_WRITE|TESTMODE_READ)) != 0) { if (test_mode & TESTMODE_WRITE) { fprintf(stderr, "%7s %11s %11s %11s %11s %11s\n", "bufsize", "open", "write", "write all", "fsync", "close"); fprintf(stderr, "%7d %11g %11g %11g %11g %11g\n", buffer_size, timerval_sub(&tm_write_open_1, &tm_write_open_0), timerval_sub(&tm_write_write_1, &tm_write_write_0), timerval_sub(&tm_write_write_all_1, &tm_write_write_all_0), timerval_sub(&tm_write_sync_1, &tm_write_sync_0), timerval_sub(&tm_write_close_1, &tm_write_close_0) ); } if (test_mode & TESTMODE_READ) { fprintf(stderr, "%7s %11s %11s %11s %11s\n", "bufsize", "open", "read", "read all", "close"); fprintf(stderr, "%7d %11g %11g %11g %11g\n", buffer_size, timerval_sub(&tm_read_open_1, &tm_read_open_0), timerval_sub(&tm_read_read_1, &tm_read_read_0), timerval_sub(&tm_read_read_all_1, &tm_read_read_all_0), timerval_sub(&tm_read_close_1, &tm_read_close_0) ); } tm_write_write_measured = tm_read_read_measured = 0; } } int main(int argc, char **argv) { char *file1 = "test.file1"; char *file2 = "test.file2"; int test_mode = 0; int c, i, buffer_sizec = 0, buffer_sizes_space[MAX_BUFFER_SIZE_NUMBER]; static int buffer_sizes_default[] = { 512, 1024, 8 * 1024, 64 * 1024, 256 * 1024, 1024 * 1024, }; int *buffer_sizes; off_t file_size = 1024; int flags = 0; while ((c = getopt(argc, argv, "b:s:wrcmp")) != -1) { switch (c) { case 'b': if (buffer_sizec >= MAX_BUFFER_SIZE_NUMBER) { fprintf(stderr, "too many -b options (max %d)\n", MAX_BUFFER_SIZE_NUMBER); exit(1); } buffer_sizes_space[buffer_sizec] = strtol(optarg, NULL, 0); buffer_sizec++; break; case 's': file_size = strtol(optarg, NULL, 0); break; case 'w': test_mode |= TESTMODE_WRITE; break; case 'r': test_mode |= TESTMODE_READ; break; case 'c': test_mode |= TESTMODE_COPY; break; case 'm': flags |= FLAG_MEASURE_PRIMITIVES; timerval_calibrate(); break; case 'p': flags |= FLAG_DONT_REMOVE; break; case '?': default: fprintf(stderr, "Usage: thput-fsys [options]" " [file1 [file2]]\n" "options:\n" "\t-b block-size\n" "\t-s file-size\n" "\t-w : write test\n" "\t-r : read test\n" "\t-c : copy test\n" "\t-p : don't remove\n"); exit(1); } } argc -= optind; argv += optind; if (argc > 0) file1 = argv[0]; if (argc > 1) file2 = argv[1]; if (test_mode == 0) test_mode = TESTMODE_WRITE|TESTMODE_READ|TESTMODE_COPY; if (buffer_sizec == 0) { buffer_sizec = ARRAY_LENGTH(buffer_sizes_default); buffer_sizes = buffer_sizes_default; } else { buffer_sizes = buffer_sizes_space; } for (i = 0; i < buffer_sizec; i++) { if (max_buffer_size < buffer_sizes[i]) max_buffer_size = buffer_sizes[i]; } buffer = alloc_aligned_memory(max_buffer_size, ALIGNMENT); test_title(test_mode, file_size, flags); file_size *= 1024 * 1024; initbuffer(); for (i = 0; i < buffer_sizec; i++) { test(test_mode, file1, file2, buffer_sizes[i], file_size, flags); } return (0); } gfarm-2.4.1/bench/thput-fsys/Makefile0000644000000000000000000000046111507222714016157 0ustar rootroot# $Id: Makefile 2373 2006-01-12 00:54:22Z soda $ top_builddir = ../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk CFLAGS = $(COMMON_CFLAGS) LDLIBS = $(COMMON_LDFLAGS) $(LIBS) PROGRAM = thput-fsys OBJS = thput-fsys.o all: $(PROGRAM) include $(top_srcdir)/makes/prog.mk gfarm-2.4.1/bench/Makefile0000644000000000000000000000033511507222715014032 0ustar rootroottop_builddir = .. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk SUBDIRS = \ bwlat-syscache \ nconnect \ thput-fsstripe \ thput-fsys \ thput-gfpio include $(top_srcdir)/makes/subdir.mk gfarm-2.4.1/bench/thput-fsstripe/0000755000000000000000000000000011507222730015367 5ustar rootrootgfarm-2.4.1/bench/thput-fsstripe/thput-fsstripe.c0000644000000000000000000001601111507222714020535 0ustar rootroot#include #include #include #include #include #include #include #include char *program_name = "thput-fsstripe.c"; #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) \ || defined(__bsdi__) #define strtoll(nptr, endptr, base) strtoq(nptr, endptr, base) #endif /* compatibility with the source code of gfsd */ typedef off_t file_offset_t; #define file_offset_floor(n) (n) #define MAX_IOSIZE 524288 int iosize = 4096; int iosize_alignment = 512; int iosize_minimum_division = 65536; int verbose_mode = 0; void worker(char *filename, off_t offset, off_t size, off_t interleave_factor, off_t full_stripe_size) { off_t chunk_size; int rv; char buffer[MAX_IOSIZE]; int fd = open(filename, O_RDONLY); if (fd == -1) { perror(filename); exit(1); } if (verbose_mode) { fprintf(stderr, "off=%lld size=%lld ileave=%lld stripe=%lld\n", offset, size, interleave_factor, full_stripe_size); } if (lseek(fd, offset, SEEK_SET) == -1) { perror("lseek"); exit(1); } for (;;) { chunk_size = interleave_factor == 0 || size < interleave_factor ? size : interleave_factor; for (; chunk_size > 0; chunk_size -= rv, size -= rv) { rv = read(fd, buffer, chunk_size < iosize ? chunk_size : iosize); if (rv <= 0) { if (rv == -1) { perror("read"); exit(1); } return; } #if 0 write(STDOUT_FILENO, buffer, rv); #endif } if (size <= 0) break; offset += full_stripe_size; if (lseek(fd, offset, SEEK_SET) == -1) { perror("lseek"); exit(1); } } } void simple_division(char *filename, file_offset_t file_size, int n) { file_offset_t offset = 0, residual = file_size; file_offset_t size_per_division = file_offset_floor(file_size / n); int i; if (file_offset_floor(size_per_division / iosize_alignment) * iosize_alignment != size_per_division) { size_per_division = (file_offset_floor( size_per_division / iosize_alignment) + 1) * iosize_alignment; } for (i = 0; i < n && residual > 0; i++) { file_offset_t size = residual <= size_per_division ? residual : size_per_division; switch (fork()) { case 0: worker(filename, offset, size, 0, 0); exit(0); case -1: perror("fork"); /*FALLTHROUGH*/ default: break; } offset += size_per_division; residual -= size; } } void striping(char *filename, file_offset_t file_size, int n, int interleave_factor) { file_offset_t full_stripe_size = (file_offset_t)interleave_factor * n; file_offset_t stripe_number = file_offset_floor(file_size / full_stripe_size); file_offset_t size_per_division = interleave_factor * stripe_number; file_offset_t residual = file_size - full_stripe_size * stripe_number; file_offset_t chunk_number_on_last_stripe; file_offset_t last_chunk_size; file_offset_t offset = 0; int i; if (residual == 0) { chunk_number_on_last_stripe = 0; last_chunk_size = 0; } else { chunk_number_on_last_stripe = file_offset_floor( residual / interleave_factor); last_chunk_size = residual - interleave_factor * chunk_number_on_last_stripe; } for (i = 0; i < n; i++) { file_offset_t size = size_per_division; if (i < chunk_number_on_last_stripe) size += interleave_factor; else if (i == chunk_number_on_last_stripe) size += last_chunk_size; if (size <= 0) break; switch (fork()) { case 0: worker(filename, offset, size, interleave_factor, full_stripe_size); exit(0); case -1: perror("fork"); /*FALLTHROUGH*/ default: break; } offset += interleave_factor; } } void limit_division(int *ndivisionsp, file_offset_t file_size) { int ndivisions = *ndivisionsp; /* do not divide too much */ if (ndivisions > file_size / iosize_minimum_division) { ndivisions = file_size / iosize_minimum_division; if (ndivisions == 0) ndivisions = 1; } *ndivisionsp = ndivisions; } double timeval_sub(struct timeval *t1, struct timeval *t2) { return ((t1->tv_sec + t1->tv_usec * .000001) - (t2->tv_sec + t2->tv_usec * .000001)); } void usage(void) { fprintf(stderr, "Usage: %s [options] \n", program_name); fprintf(stderr, "\t-a \n"); fprintf(stderr, "\t-b \n"); fprintf(stderr, "\t-g (gap between stripe)\n"); fprintf(stderr, "\t-i (interleave factor)\n"); fprintf(stderr, "\t-m \n"); fprintf(stderr, "\t-o (slave mode)\n"); fprintf(stderr, "\t-p \n"); fprintf(stderr, "\t-s \n"); fprintf(stderr, "\t-v\t(verbose)\n"); exit(1); } extern char *optarg; extern int optind; int main(int argc, char **argv) { int full_stripe_size = 0; int interleave_factor = 0; int slave_mode = 0; file_offset_t offset = 0; int parallelism = 1; file_offset_t file_size = -1; int ch, sv; char *filename; struct stat s; struct timeval t1, t2; if (argc > 0) program_name = argv[0]; while ((ch = getopt(argc, argv, "a:b:g:i:m:o:p:s:v")) != -1) { switch (ch) { case 'a': iosize_alignment = strtoll(optarg, NULL, 0); break; case 'b': iosize = strtoll(optarg, NULL, 0); break; case 'g': full_stripe_size = strtoll(optarg, NULL, 0); break; case 'i': interleave_factor = strtoll(optarg, NULL, 0); break; case 'm': iosize_minimum_division = strtoll(optarg, NULL, 0); break; case 'o': slave_mode = 1; offset = strtoll(optarg, NULL, 0); break; case 'p': parallelism = strtoll(optarg, NULL, 0); break; case 's': file_size = strtoll(optarg, NULL, 0); break; case 'v': verbose_mode = 1; break; case '?': /*FALLTHROUGH*/ default: usage(); } } argc -= optind; argv += optind; if (argc != 1) { fprintf(stderr, " is needed\n"); exit(1); } filename = argv[0]; if (file_size == -1) { if (stat(filename, &s) == -1) { perror("stat"); exit(1); } if (!S_ISREG(s.st_mode)) { fprintf(stderr, "%s: not a file\n", filename); exit(1); } file_size = s.st_size; } if (full_stripe_size != 0 && interleave_factor != 0 && full_stripe_size != interleave_factor * parallelism) { fprintf(stderr, "inconsistency between -g and -i\n"); exit(1); } limit_division(¶llelism, file_size); if (slave_mode) { worker(filename, offset, file_size, interleave_factor, full_stripe_size); return (0); } gettimeofday(&t1, NULL); if (full_stripe_size == 0 && interleave_factor == 0) { simple_division(filename, file_size, parallelism); } else if (interleave_factor != 0) { striping(filename, file_size, parallelism, interleave_factor); } else { interleave_factor = full_stripe_size / parallelism; if ((interleave_factor / iosize_alignment) * iosize_alignment != interleave_factor) interleave_factor = ((interleave_factor / iosize_alignment) + 1) * iosize_alignment; striping(filename, file_size, parallelism, interleave_factor); } while (waitpid(-1, &sv, 0) != -1 || errno != ECHILD) ; gettimeofday(&t2, NULL); printf("%.0f\n", file_size / timeval_sub(&t2, &t1)); return (0); } gfarm-2.4.1/bench/thput-fsstripe/Makefile0000644000000000000000000000046511507222714017036 0ustar rootroot# $Id: Makefile 2373 2006-01-12 00:54:22Z soda $ top_builddir = ../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk CFLAGS = $(COMMON_CFLAGS) LDLIBS = $(COMMON_LDFLAGS) $(LIBS) PROGRAM = thput-fsstripe OBJS = $(PROGRAM).o all: $(PROGRAM) include $(top_srcdir)/makes/prog.mk gfarm-2.4.1/bench/bwlat-syscache/0000755000000000000000000000000011507222730015277 5ustar rootrootgfarm-2.4.1/bench/bwlat-syscache/bwlat-syscache.c0000644000000000000000000001370411507222715020364 0ustar rootroot/* * A little disk benchmark originally written by Bruce Evans . */ /* * Message-Id: <199604020202.SAA23506@freefall.freebsd.org> * X-Authentication-Warning: freefall.freebsd.org: Host localhost.cdrom.com [127.0.0.1] didn't use HELO protocol * To: "Michael L. VanLoon -- HeadCandy.com" * cc: John M Vinopal , port-i386@NetBSD.ORG * Subject: Re: scsi adaptor speeds etc * In-reply-to: Your message of "Mon, 01 Apr 1996 09:43:45 PST." * <199604011743.JAA19016@MindBender.HeadCandy.com> * Date: Mon, 01 Apr 1996 18:02:23 -0800 * From: "Justin T. Gibbs" * Sender: owner-port-i386@NetBSD.ORG * Precedence: list * X-Loop: port-i386@NetBSD.ORG * * > * > * >>As a data point: * >>ncr810, p100, netbsd-current * >>4338793 bytes/sec * >>with both scsiII drives I have. * > * >Using what test? ;-) * > * >What would be more useful (to me, at least) would be if you could * >provide iozone and/or Bonnie results. I can make both binaries * >available if you don't want to build your own. * * I would also suggest using this little program from Bruce Evans. * It attempts to measure the combined controller and disk command * overhead: */ #include #include #include #include #include #include #include #if 0 #define ITERATIONS 1000 #else #define ITERATIONS 0 /* use elapsed time by default */ #endif #define BLOCKSIZE 4096 #define ELAPSED_TIME 10 #ifdef linux /* Linux stupidly requires 512byte aligned buffer for raw device access. */ #define ALIGNMENT 512 #else #define ALIGNMENT 1 #endif static void usage(void); static int syserror(const char *where); static long timeit(int fd, char *buf, unsigned blocksize); static void alarm_handler(); static void *alloc_aligned_memory(size_t size, int alignment); int alignment = ALIGNMENT; int iterations = ITERATIONS; unsigned blocksize = BLOCKSIZE; int elapsed_time = ELAPSED_TIME; int alarmed = 0; char *program_name; int main(int argc, char **argv) { char *buf; int c, fd; long time_single; long time_double; program_name = argv[0]; while ((c = getopt(argc, argv, "a:b:e:i:")) != -1) { switch (c) { case 'a': alignment = atoi(optarg); break; case 'b': blocksize = atoi(optarg); break; case 'e': elapsed_time = atoi(optarg); break; case 'i': iterations = atoi(optarg); break; case '?': usage(); } } argc -= optind; argv += optind; if (argc != 1) usage(); if (iterations == 0) { if (elapsed_time == 0) elapsed_time = ELAPSED_TIME; elapsed_time /= 2; if (elapsed_time == 0) elapsed_time = 1; } buf = alloc_aligned_memory(2 * blocksize, alignment); fd = open(argv[0], O_RDONLY); if (fd == -1) syserror("open"); time_single = timeit(fd, buf, blocksize); time_double = timeit(fd, buf, 2 * blocksize); printf("Command overhead is %g usec " "(time_%u = %g, time_%u = %g)\n", (double)(time_single - (time_double - time_single)) / iterations, blocksize, (double)time_single / iterations, 2 * blocksize, (double)time_double / iterations); printf("transfer speed is %g bytes/sec\n", (double)blocksize * iterations * 1000000.0 / (time_double - time_single)); exit(0); } static void usage(void) { fprintf(stderr, "Usage: %s [] \n", program_name); fprintf(stderr, "options:\n"); fprintf(stderr, "\t-a \n"); fprintf(stderr, "\t-b \n"); fprintf(stderr, "\t-e \n"); fprintf(stderr, "\t-i \n"); exit(2); } static int syserror(const char *where) { perror(where); exit(1); } static long timeit(int fd, char *buf, unsigned blocksize) { struct timeval finish; struct timeval start; int i; if (read(fd, buf, blocksize) != blocksize) syserror("read"); if (iterations != 0) { if (gettimeofday(&start, (struct timezone *)NULL) != 0) syserror("gettimeofday(start)"); for (i = 0; i < iterations; ++i) { if (lseek(fd, (off_t)0, SEEK_SET) == -1) syserror("lseek"); if (read(fd, buf, blocksize) != blocksize) syserror("read"); } if (gettimeofday(&finish, (struct timezone *)NULL) != 0) syserror("gettimeofday(finish)"); } else { alarmed = 0; if ((int)signal(SIGALRM, alarm_handler) == -1) syserror("signal(SIGALARM)"); if (alarm(elapsed_time) == (unsigned)-1) syserror("alarm"); if (gettimeofday(&start, (struct timezone *)NULL) != 0) syserror("gettimeofday(start)"); for (i = 0; !alarmed; i++) { if (lseek(fd, (off_t)0, SEEK_SET) == -1) syserror("lseek"); if (read(fd, buf, blocksize) != blocksize) syserror("read"); } if (gettimeofday(&finish, (struct timezone *)NULL) != 0) syserror("gettimeofday(finish)"); iterations = i; } return (finish.tv_sec - start.tv_sec) * 1000000 + finish.tv_usec - start.tv_usec; } static void alarm_handler() { alarmed = 1; } void *alloc_aligned_memory(size_t size, int alignment) { char *p = malloc(size + alignment - 1); if (p == NULL) { fprintf(stderr, "no memory for %ld bytes\n", (long)size + alignment - 1); exit(1); } if (((size_t)p & (alignment - 1)) != 0) p += alignment - ((size_t)p & (alignment - 1)); return p; } /* * * >----------------------------------------------------------------------------- * > Michael L. VanLoon michaelv@HeadCandy.com * > --< Free your mind and your machine -- NetBSD free un*x >-- * > NetBSD working ports: 386+PC, Mac 68k, Amiga, HP300, Sun3, Sun4, * > DEC PMAX (MIPS), DEC Alpha, PC532 * > NetBSD ports in progress: VAX, Atari 68k, others... * >----------------------------------------------------------------------------- * * -- * Justin T. Gibbs * =========================================== * FreeBSD: Turning PCs into workstations * =========================================== */ gfarm-2.4.1/bench/bwlat-syscache/Makefile0000644000000000000000000000047111507222715016744 0ustar rootroot# $Id: Makefile 2373 2006-01-12 00:54:22Z soda $ top_builddir = ../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk CFLAGS = $(COMMON_CFLAGS) LDLIBS = $(COMMON_LDFLAGS) $(LIBS) PROGRAM = bwlat-syscache OBJS = bwlat-syscache.o all: $(PROGRAM) include $(top_srcdir)/makes/prog.mk gfarm-2.4.1/bench/nconnect/0000755000000000000000000000000011507222730014175 5ustar rootrootgfarm-2.4.1/bench/nconnect/nconnect.c0000644000000000000000000006213111507222715016156 0ustar rootroot/* * Copyright (C) 1993-2000 by Software Research Associates, Inc. * 1-1-1 Hirakawa-cho, Chiyoda-ku, Tokyo 102-8605, Japan * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without * restriction, including without limitation the rights to use, copy, * modify, merge, publish, distribute, sublicense, and/or sell copies * of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE SOFTWARE RESEARCH * ASSOCIATES BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of the Software * Research Associates shall not be used in advertising or otherwise * to promote the sale, use or other dealings in this Software without * prior written authorization from the Software Research Associates. * * Id: nconnect.c,v 1.21 2002/09/19 06:43:57 soda Exp * */ #include #include /* ntohs(), ... for BSD direct descendant */ #include #include /* PF_UNIX */ #include /* PF_INET */ #include /* TCP_NODELAY */ #include /* inet_addr(), inet_ntoa() */ #include /* gethostbyname(), getservbyname(), ... */ #include #include #include /* SIGPIPE */ #include extern int errno; /* some doesn't define `errno' */ #ifdef __STDC__ #include /* strlen(), ... & bzero()/bcopy()/bcmp() */ #include /* atoi(), ... */ #endif #ifndef NO_UNISTD_H #include #endif #include /* waitpid()/wait3() */ #ifdef _AIX #include /* fd_set, ... */ #endif #include /* 2nd argument of shutdown(2) */ #define SHUTDOWN_RECV 0 /* shutdown receive */ #define SHUTDOWN_SEND 1 /* shutdown send */ #define SHUTDOWN_SOCK 2 /* shutdown send & receive */ /* 2nd argument of listen(2) */ #define LISTEN_BACKLOG 5 /*** portable ************************************************/ #ifdef POSIX # define NO_BSTRING # define NO_INDEX #endif #ifdef NO_BSTRING #define bcmp(a, b, length) memcmp(a, b, length) #define bcopy(s, d, length) memcpy(d, s, length) #define bzero(b, length) memset(b, 0, length) #endif extern char *index(), *rindex(); #ifdef NO_INDEX extern char *strchr(), *strrchr(); #define index(string, c) strchr(string, c) #define rindex(string, c) strrchr(string, c) #endif #ifdef NO_SIZE_T typedef int size_t; #endif #ifdef __STDC__ typedef void *Pointer; #else typedef char *Pointer; #define const #define volatile #endif extern Pointer malloc(); #ifndef POSIX # if !defined(SIGTSTP) || defined(SV_BSDSIG) || defined(SA_OLDSTYLE) || (defined(SA_NOCLDWAIT) && defined(SIGCLD)) /* SysV3 or earlier || HP-UX || AIX || SVR4 */ # define CAN_IGNORE_ZOMBIE # define SIGNAL signal # else /* guarantee reliable signal */ void (*reliable_signal(sig, handler))() int sig; void (*handler)(); { struct sigvec sv, osv; sv.sv_handler = handler; sv.sv_mask = 0; sv.sv_flags = 0; /* XXX - no singal stack */ if (sigvec(sig, &sv, &osv) < 0) return (void (*)())-1; return osv.sv_handler; } # define SIGNAL reliable_signal # endif #else /* POSIX - don't use undefined behavior */ /* * This function installs reliable signal handler, but not (always) * BSD signal compatible. Because interrupted system call is not * always restarted. * At least, BSD Net/2 or later and SVR4 and AIX (SA_RESTART is not * specified) and HP-UX (struct sigcontext::sc_syscall_action == * SIG_RETURN) are not BSD compatible. On SunOS4, this function is BSD * signal compatible (because SA_INTERRUPT is not specifed). */ void (*reliable_signal(sig, handler))() int sig; void (*handler)(); { struct sigaction sa, osa; sa.sa_handler = handler; sigemptyset(&sa.sa_mask); sa.sa_flags = 0; if (sigaction(sig, &sa, &osa) < 0) return (void (*)())-1; return osa.sa_handler; } # define SIGNAL reliable_signal #endif /* POSIX */ /*** miscellaneous *******************************************/ #define ARRAY_LENGTH(array) (sizeof(array)/sizeof(array[0])) typedef int Bool; #define YES 1 #define NO 0 static char *progname = "nconnect"; static Bool debug_flag = NO; #define debug(statement) \ { \ if (debug_flag) { \ statement; \ } \ } #define EXIT_OK 0 #define EXIT_USAGE 2 #define EXIT_NETERR 1 #define EXIT_SYSERR 3 void fatal(message) char *message; { perror(message); exit(EXIT_NETERR); } Pointer emalloc(size) size_t size; { Pointer p = malloc(size); if (p == NULL) { fprintf(stderr, "%s: no memory\n", progname); exit(EXIT_SYSERR); } return p; } /*** sockaddr ************************************************/ union generic_sockaddr { struct sockaddr address; struct sockaddr_un un; struct sockaddr_in in; }; size_t make_unix_address(address, pathname) struct sockaddr_un *address; char *pathname; { size_t len = strlen(pathname); if (len >= sizeof(address->sun_path)) { fputs(pathname, stderr); fputs(": socket name too long\n", stderr); exit(EXIT_USAGE); } bzero((char *)address, sizeof(*address)); /* needless ? */ bcopy(pathname, address->sun_path, len + 1); address->sun_family = AF_UNIX; #ifdef SUN_LEN /* derived from 4.4BSD */ return SUN_LEN(address); #else return sizeof(*address) - sizeof(address->sun_path) + len; #endif } /* * make Internet address * argument `ip_address' is network byte order IP-address, * or htonl(INADDR_ANY), or htonl(INADDR_BROADCAST). * argument `port' is network byte order port-number or 0. * 0 is for bind(2). bind(2) automagically allocates port number. */ size_t make_inet_address(address, ip_address, port) struct sockaddr_in *address; unsigned long ip_address; int port; { bzero((char *)address, sizeof(*address)); address->sin_addr.s_addr = ip_address; address->sin_family = AF_INET; address->sin_port = port; return sizeof(*address); } size_t make_inet_address_by_string(address, host, port) struct sockaddr_in *address; char *host; int port; { struct hostent *hp; struct in_addr in; if ((in.s_addr = inet_addr(host)) != (unsigned long)-1) return make_inet_address(address, in.s_addr, port); if ((hp = gethostbyname(host)) != NULL) { bzero((char *)address, sizeof(*address)); bcopy(hp->h_addr, (char *)&address->sin_addr, sizeof(address->sin_addr)); address->sin_family = hp->h_addrtype; address->sin_port = port; return sizeof(*address); } /* * BUG: * if (hp == NULL && h_errno == TRY_AGAIN) * we must try again; */ fputs(host, stderr); fputs(": unknown host\n", stderr); exit(EXIT_USAGE); } int make_inet_port_by_string(portname, protocol) char *portname, *protocol; { struct servent *sp; if (isdigit(portname[0])) { return htons(atoi(portname)); } else { if (protocol == NULL) { fprintf(stderr, "%s: need port number\n", portname); exit(EXIT_SYSERR); } if ((sp = getservbyname(portname, protocol)) == NULL) { fprintf(stderr, "%s/%s: unknown service\n", portname, protocol); exit(EXIT_SYSERR); } return sp->s_port; } } size_t make_socket_address(address, name, socket_type) union generic_sockaddr *address; char *name; int socket_type; { int rv; if (bcmp(name, "unix/", (size_t)5) == 0) { /* AF_UNIX */ return make_unix_address(&address->un, name + 5); } else { /* AF_INET */ char *colon = index(name, ':'), *protocol; int port; if (colon == NULL) { port = 0; } else { *colon = '\0'; /* XXX - breaks *name */ switch (socket_type) { case SOCK_STREAM: protocol = "tcp"; break; case SOCK_DGRAM: protocol = "udp"; break; default: protocol = NULL; break; } port = make_inet_port_by_string(colon + 1, protocol); } rv = *name == '\0' ? make_inet_address(&address->in, htonl(INADDR_ANY), port) : make_inet_address_by_string(&address->in, name, port); if (colon != NULL) *colon = ':'; /* XXX - restore *name */ return rv; } } int make_socket_type(name) char *name; { if (strcmp(name, "stream") == 0) return SOCK_STREAM; else if (strcmp(name, "dgram") == 0 || strcmp(name, "datagram") == 0) return SOCK_DGRAM; #ifdef USE_RAW_SOCKET else if (strcmp(name, "raw") == 0) return SOCK_RAW; #endif else if (strcmp(name, "rdm") == 0) /* reliably-delivered message */ return SOCK_RDM; else if (strcmp(name, "seqpacket") == 0) /* sequenced packet stream */ return SOCK_SEQPACKET; else { fprintf(stderr, "%s: unknown socket type \"%s\"\n", progname, name); exit(EXIT_NETERR); } } Bool socket_type_is_stream(socket_type) int socket_type; { switch (socket_type) { case SOCK_STREAM: return YES; default: return NO; } } void print_sockaddr(fp, address, addr_size) FILE *fp; struct sockaddr *address; size_t addr_size; { union generic_sockaddr *p = (union generic_sockaddr *)address; switch (p->address.sa_family) { case AF_UNIX: fputs("AF_UNIX: pathname = \"", fp); fwrite(p->un.sun_path, sizeof(char), addr_size - (sizeof(p->un) - sizeof(p->un.sun_path)), fp); fputs("\"\n", fp); break; case AF_INET: fprintf(fp, "AF_INET: address = %s, port = %d\n", inet_ntoa(p->in.sin_addr), ntohs(p->in.sin_port)); break; default: fprintf(fp,"%s: unknown address family %d\n", progname, p->address.sa_family); break; } } void print_sockname(fd) int fd; { union generic_sockaddr generic; socklen_t addr_size = sizeof(generic); if (getsockname(fd, &generic.address, &addr_size) < 0) { perror("getsockname"); /* exit(EXIT_NETERR); */ } else { print_sockaddr(stderr, &generic.address, (size_t)addr_size); } } void print_peername(fd) int fd; { union generic_sockaddr generic; socklen_t addr_size = sizeof(generic); if (getpeername(fd, &generic.address, &addr_size) < 0) { perror("getpeername"); /* exit(EXIT_NETERR); */ } else { print_sockaddr(stderr, &generic.address, (size_t)addr_size); } } void print_sockport(fp, fd) FILE *fp; int fd; { union generic_sockaddr generic; socklen_t addr_size = sizeof(generic); if (getsockname(fd, &generic.address, &addr_size) < 0) { fatal("getsockname"); } switch (generic.address.sa_family) { case AF_INET: fprintf(fp, "%d\n", ntohs(generic.in.sin_port)); break; default: fprintf(fp,"%s: cannot print port for address family %d\n", progname, generic.address.sa_family); exit(EXIT_SYSERR); } } /*** Queue ***************************************************/ #define QBUFSIZE 4096 typedef struct Queue { char buffer[QBUFSIZE]; int length; int point; char *tag; } Queue; char *session_log = NULL; /* default - do not log session */ FILE *session_log_fp = NULL; /* default - log file is not opened */ void makeQueue(q, tag) Queue *q; char *tag; { q->length = 0; q->point = 0; q->tag = tag; } Bool queueIsEmpty(q) Queue *q; { return q->point >= q->length; } Bool queueIsFull(q) Queue *q; { /* this queue is NOT true queue */ return !queueIsEmpty(q); } Bool enqueue(q, fd) /* if success (not end-of-file) then YES */ Queue *q; int fd; { int done; if (queueIsFull(q)) return YES; done = read(fd, q->buffer, QBUFSIZE); debug(fprintf(stderr, "\tread() - %d\n", done)); if (done < 0) { if (errno == EINTR) return YES; fatal("enqueue"); } q->point = 0; q->length = done; if (session_log != NULL) { switch (session_log_fp == NULL) { case 1: session_log_fp = fopen(session_log, "a"); if (session_log_fp == NULL) { perror(session_log); session_log = NULL; /* give up logging */ break; } /*FALLTHROUGH*/ default: fprintf(session_log_fp, "%s:%d/<%.*s>\n", q->tag, done, done, q->buffer); fflush(session_log_fp); break; } } return done > 0; } int sync_rate = 0; void dequeue(q, fd) Queue *q; int fd; { int done; if (queueIsEmpty(q)) return; done = write(fd, q->buffer + q->point, q->length - q->point); debug(fprintf(stderr, "\twrite() - %d\n", done)); if (done < 0) { if (errno == EINTR) return; fatal("dequeue"); } q->point += done; if (sync_rate != 0 && fd == 1) { /* only for stdout */ static int written = 0; written += done; if (written >= sync_rate) { written -= sync_rate; fdatasync(fd); } } } /*** sockopts ************************************************/ static struct sockopt_table { char *name, *proto; int level, option, default_value; } sockopt_tab[] = { { "debug", NULL, SOL_SOCKET, SO_DEBUG, 1, }, { "reuseaddr", NULL, SOL_SOCKET, SO_REUSEADDR, 1, }, { "keepalive", NULL, SOL_SOCKET, SO_KEEPALIVE, 1, }, { "dontroute", NULL, SOL_SOCKET, SO_DONTROUTE, 1, }, { "broadcast", NULL, SOL_SOCKET, SO_BROADCAST, 1, }, #if defined(SO_USELOOPBACK) { "useloopback",NULL, SOL_SOCKET, SO_USELOOPBACK, 1, }, #endif { "linger", NULL, SOL_SOCKET, SO_LINGER, 1, }, { "oobinline", NULL, SOL_SOCKET, SO_OOBINLINE, 1, }, #if defined(SO_REUSEPORT) { "reuseport", NULL, SOL_SOCKET, SO_REUSEPORT, 1, }, #endif { "sndbuf", NULL, SOL_SOCKET, SO_SNDBUF, 16384, }, { "rcvbuf", NULL, SOL_SOCKET, SO_RCVBUF, 16384, }, { "sndlowat", NULL, SOL_SOCKET, SO_SNDLOWAT, 2048, }, { "rcvlowat", NULL, SOL_SOCKET, SO_RCVLOWAT, 1, }, #if 0 /* typeof(option) == struct timeval */ { "sndtimeo", NULL, SOL_SOCKET, SO_SNDTIMEO, , }, { "rcvtimeo", NULL, SOL_SOCKET, SO_RCVTIMEO, , }, #endif { "tcp_nodelay","tcp", 0, TCP_NODELAY, 1, }, }; #define MAX_SOCKOPTS ARRAY_LENGTH(sockopt_tab) int nsockopts = 0; struct socket_option { char *string; int level, option, value; } sockopts[MAX_SOCKOPTS]; void record_sockopt(option) char *option; { /* * SO_TYPE and SO_ERROR are used for * getsockopt() only. * SO_ACCEPTCONN, ... */ struct sockopt_table *tab; char *equal; struct protoent *proto; equal = strchr(option, '='); if (equal != NULL) *equal = '\0'; for (tab = sockopt_tab; tab < &sockopt_tab[MAX_SOCKOPTS]; tab++) { if (strcmp(option, tab->name) == 0) { if (nsockopts >= MAX_SOCKOPTS) { fprintf(stderr, "%s: too many socket options", progname); exit(EXIT_USAGE); } sockopts[nsockopts].string = option; if (tab->proto == NULL) { sockopts[nsockopts].level = tab->level; } else { proto = getprotobyname(tab->proto); if (proto == NULL) { fprintf(stderr, "%s: getprotobyname(\"%s\") failed\n", progname, tab->proto); exit(EXIT_SYSERR); } sockopts[nsockopts].level = proto->p_proto; } sockopts[nsockopts].option = tab->option; if (equal == NULL) sockopts[nsockopts].value = tab->default_value; else sockopts[nsockopts].value = atol(equal + 1); nsockopts++; if (equal != NULL) *equal = '='; return; } } fprintf(stderr, "%s: unknown socket option \"%s\"\n", progname, option); exit(EXIT_USAGE); } void apply_sockopts(fd) int fd; { int i; for (i = 0; i < nsockopts; i++) { if (setsockopt(fd, sockopts[i].level, sockopts[i].option, &sockopts[i].value, sizeof(sockopts[i].value)) == -1) { fatal(sockopts[i].string); } } } /*** main ***************************************************/ void broken_pipe_handler(sig) int sig; { fprintf(stderr, "%s: Broken pipe or socket\n", progname); exit(EXIT_NETERR); } void set_fd(set, fd, available) fd_set *set; int fd; Bool available; { if (available) FD_SET(fd, set); else FD_CLR(fd, set); } enum SocketMode { sock_sendrecv, sock_send, sock_recv }; void transfer(fd, socket_mode, one_eof_exit) int fd; enum SocketMode socket_mode; Bool one_eof_exit; { fd_set readfds, writefds, exceptfds; int nfds = fd + 1, nfound; Bool eof_stdin = NO, eof_socket = NO; Queue sendq, recvq; debug(SIGNAL(SIGPIPE, broken_pipe_handler)); switch (socket_mode) { case sock_recv: eof_stdin = YES; break; case sock_send: eof_socket = YES; break; #ifdef __GNUC__ /* workaround gcc warning: enumeration value not handled */ case sock_sendrecv: /* nothing to do */ break; #endif } FD_ZERO(&readfds); FD_ZERO(&writefds); FD_ZERO(&exceptfds); makeQueue(&sendq, "SEND"); makeQueue(&recvq, "RECV"); while (!eof_stdin || !queueIsEmpty(&sendq) || !eof_socket || !queueIsEmpty(&recvq)) { set_fd(&readfds, 0, !queueIsFull(&sendq) && !eof_stdin); set_fd(&readfds, fd, !queueIsFull(&recvq) && !eof_socket); set_fd(&writefds, fd, !queueIsEmpty(&sendq)); set_fd(&writefds, 1, !queueIsEmpty(&recvq)); debug(fprintf(stderr, "\tselect() wait : %d%d%d%d\n", FD_ISSET(0, &readfds)!=0, FD_ISSET(1, &writefds)!=0, FD_ISSET(fd,&readfds)!=0, FD_ISSET(fd,&writefds)!=0)); /* if socket is EOF, select() says "you can read socket." */ nfound = select(nfds, &readfds, &writefds, &exceptfds, NULL); debug(fprintf(stderr, "\tselect() -- %d : %d%d%d%d\n", nfound, FD_ISSET(0, &readfds)!=0, FD_ISSET(1, &writefds)!=0, FD_ISSET(fd,&readfds)!=0, FD_ISSET(fd,&writefds)!=0)); if (nfound < 0) { if (errno == EINTR) continue; fatal("select"); } if (FD_ISSET(0, &readfds)) { if (!enqueue(&sendq, 0)) { if (one_eof_exit) eof_socket = YES; eof_stdin = YES; if (queueIsEmpty(&sendq)) { if (shutdown(fd, SHUTDOWN_SEND) < 0) fatal("shutdown"); } } } if (FD_ISSET(fd, &writefds) && !queueIsEmpty(&sendq)) { dequeue(&sendq, fd); if (eof_stdin && queueIsEmpty(&sendq)) { if (shutdown(fd, SHUTDOWN_SEND) < 0) fatal("shutdown"); } } if (FD_ISSET(fd, &readfds)) { if (!enqueue(&recvq, fd)) { if (one_eof_exit) eof_stdin = YES; eof_socket = YES; } } if (FD_ISSET(1, &writefds)) { dequeue(&recvq, 1); } } if (session_log_fp != NULL) { fprintf(session_log_fp, "CLOSED\n"); fclose(session_log_fp); session_log_fp = NULL; } } void putenv_address(generic, addr_size, prefix) union generic_sockaddr *generic; int addr_size; char *prefix; { struct hostent *hp; char buffer[BUFSIZ]; switch (generic->address.sa_family) { case AF_INET: sprintf(buffer, "%s_ADDR=%s", prefix, inet_ntoa(generic->in.sin_addr)); putenv(strdup(buffer)); sprintf(buffer, "%s_PORT=%d", prefix, ntohs(generic->in.sin_port)); putenv(strdup(buffer)); hp = gethostbyaddr((char *) &generic->in.sin_addr, (int)sizeof(generic->in.sin_addr), AF_INET); if (hp != NULL) { sprintf(buffer, "%s_NAME=%s", prefix, hp->h_name); putenv(strdup(buffer)); } break; } } void env_setup(fd) int fd; { union generic_sockaddr generic; socklen_t addr_size = sizeof(generic); if (getsockname(fd, &generic.address, &addr_size) == 0) putenv_address(&generic, addr_size, "SOCK"); if (getpeername(fd, &generic.address, &addr_size) == 0) putenv_address(&generic, addr_size, "PEER"); } void doit(argv, fd, socket_mode, one_eof_exit) int fd; enum SocketMode socket_mode; char **argv; Bool one_eof_exit; { switch (socket_mode) { case sock_recv: if (shutdown(fd, SHUTDOWN_SEND) < 0) fatal("shutdown"); break; case sock_send: /* * This shutdown(2) has no effect, I THINK. */ if (shutdown(fd, SHUTDOWN_RECV) < 0) fatal("shutdown"); break; #ifdef __GNUC__ /* workaround gcc warning: enumeration value not handled */ case sock_sendrecv: /* nothing to do */ break; #endif } if (argv == NULL) { transfer(fd, socket_mode, one_eof_exit); close(fd); exit(EXIT_OK); } else { env_setup(fd); if (socket_mode != sock_send) { close(0); dup2(fd, 0); } if (socket_mode != sock_recv) { close(1); dup2(fd, 1); } close(fd); execvp(argv[0], argv); fatal(argv[0]); } } #ifndef CAN_IGNORE_ZOMBIE void child_exit_handler(sig) int sig; { #ifdef POSIX while (waitpid(-1, NULL, WNOHANG) > 0) ; #else while (wait3(NULL, WNOHANG, NULL) > 0) ; #endif } #endif /* CAN_IGNORE_ZOMBIE */ void usage() { fprintf(stderr, "Usage: %s [-srk] [-b
]
\n", progname); fprintf(stderr, " %s [-srk] -b
\n", progname); fprintf(stderr, "\t\t
format is :\n"); fprintf(stderr, "\t\t\tunix/pathname\t- unix domain socket\n"); fprintf(stderr, "\t\t\t[host]:port\t- inet domain socket\n"); exit(EXIT_USAGE); } int main(argc, argv) int argc; char **argv; { union generic_sockaddr peer_addr, self_addr; size_t peer_addr_size, self_addr_size; int fd; int socket_type = SOCK_STREAM; enum SocketMode socket_mode = sock_sendrecv; char *bind_to = NULL; char *connect_to = NULL; char **shell_command = NULL; /* if NULL: only data transfer */ Bool one_eof_exit = YES; Bool accept_one_client = YES; FILE *port_output = stderr; #ifdef __GNUC__ /* workaround gcc warning: may be used uninitialized */ peer_addr_size = 0; #endif if (argc >= 1) progname = argv[0]; while (--argc > 0) { char *s; if ((s = *++argv)[0] != '-') break; while (*++s) { static char end_loop[] = "."; switch(*s) { case 'S': if (s[1] != '\0') { sync_rate = strtol(&s[1], NULL, 0); } else { if (--argc <= 0) usage(); sync_rate = strtol(*++argv, NULL, 0); } s = end_loop; break; case 'd': debug_flag = YES; break; case 'b': /* bind sockname */ if (s[1] != '\0') { bind_to = &s[1]; } else { if (--argc <= 0) usage(); bind_to = *++argv; } s = end_loop; break; case 't': if (s[1] != '\0') { socket_type = make_socket_type(&s[1]); } else { if (--argc <= 0) usage(); socket_type = make_socket_type(*++argv); } s = end_loop; break; case 's': socket_mode = sock_send; break; case 'r': socket_mode = sock_recv; break; case 'k': /* keep */ one_eof_exit = NO; break; case 'i': /* interactive (like `telnet') */ one_eof_exit = YES; break; case 'l': /* log session - not work if shell_command */ if (s[1] != '\0') { session_log = &s[1]; } else { if (--argc <= 0) usage(); session_log = *++argv; } s = end_loop; break; case 'n': /* nowait && accept number of clients */ accept_one_client = NO; break; case 'o': if (s[1] != '\0') { record_sockopt(&s[1]); } else { if (--argc <= 0) usage(); record_sockopt(*++argv); } s = end_loop; break; case 'p': if (s[1] != '\0') { s = &s[1]; } else { if (--argc <= 0) usage(); s = *++argv; } if ((port_output = fopen(s, "w")) == NULL) fatal(s); s = end_loop; break; case 'c': if (s[1] != '\0') { connect_to = &s[1]; } else { if (--argc <= 0) usage(); connect_to = *++argv; } s = end_loop; break; case 'e': case 'f': shell_command = argv - 1; shell_command[0] = "/bin/sh"; shell_command[1] = *s == 'f' ? "-f" : "-c"; argv += argc - 1; argc = 1; /* i.e. argc -= argc - 1; */ break; default: usage(); } } } switch (argc) { case 0: if (bind_to == NULL && connect_to == NULL) usage(); break; case 1: connect_to = argv[0]; break; default: usage(); } if (connect_to != NULL) { peer_addr_size = make_socket_address(&peer_addr,connect_to,socket_type); } if (bind_to == NULL) { fd = socket(peer_addr.address.sa_family, socket_type, 0); if (fd < 0) fatal("socket"); apply_sockopts(fd); } else { Bool print_port; self_addr_size = make_socket_address(&self_addr, bind_to, socket_type); print_port = self_addr.in.sin_family == AF_INET && self_addr.in.sin_port == 0; fd = socket(self_addr.address.sa_family, socket_type, 0); if (fd < 0) fatal("socket"); switch (self_addr.address.sa_family) { case AF_UNIX: unlink(self_addr.un.sun_path); break; case AF_INET: break; } apply_sockopts(fd); if (bind(fd, &self_addr.address, (int)self_addr_size) < 0) fatal("bind"); debug(print_sockname(fd)); if (print_port) print_sockport(port_output, fd); if (port_output != stderr) fclose(port_output); } if (connect_to == NULL && socket_type_is_stream(socket_type)) { int client; #ifdef CAN_IGNORE_ZOMBIE SIGNAL(SIGCLD, SIG_IGN); #else reliable_signal(SIGCHLD, child_exit_handler); #endif if (listen(fd, accept_one_client ? 1 : LISTEN_BACKLOG) < 0) fatal("listen"); for (;;) { union generic_sockaddr client_addr; socklen_t client_addr_size = sizeof(client_addr); client = accept(fd, &client_addr.address, &client_addr_size); if (client < 0) { if (errno == EINTR) continue; fatal("accept"); } if (accept_one_client) break; switch (fork()) { case -1: fatal("fork"); case 0: close(fd); debug(print_peername(client)); doit(shell_command, client, socket_mode, one_eof_exit); default: close(client); break; } } close(fd); debug(print_peername(client)); doit(shell_command, client, socket_mode, one_eof_exit); } else if (connect_to == NULL) { doit(shell_command, fd, socket_mode, one_eof_exit); } else { if (connect(fd, &peer_addr.address, (int)peer_addr_size) < 0) fatal("connect"); debug(print_peername(fd)); doit(shell_command, fd, socket_mode, one_eof_exit); } /*NOTREACHED*/ return EXIT_SYSERR; } gfarm-2.4.1/bench/nconnect/Makefile0000644000000000000000000000045511507222715015644 0ustar rootroot# $Id: Makefile 2373 2006-01-12 00:54:22Z soda $ top_builddir = ../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk CFLAGS = $(COMMON_CFLAGS) LDLIBS = $(COMMON_LDFLAGS) $(LIBS) PROGRAM = nconnect OBJS = nconnect.o all: $(PROGRAM) include $(top_srcdir)/makes/prog.mk gfarm-2.4.1/RELNOTES0000644000000000000000000003621011507222727012475 0ustar rootrootRelease note for Gfarm 2.4.1 ============================ [2010.12.30] New Feature * automatic replication in gfmd [sf.net trac #129] extended attribute 'gfarm.ncopy' specifies the number of file replicas to be created automatically. % echo -n 2 | gfxattr -s / gfarm.ncopy New configuration in gfmd.conf * no_file_system_node_timeout and gfmd_reconnection_timeout directives to specify the timeout to try to find a file system node and to reconnect to the gfmd, respectively. Default is 30 seconds. * known_network directive to specify a network for file system nodes. File system nodes not specified by the known_network directive are assumed to be in an IPv4 class C network as same as before. Performance improvement * gfmd-initiated file replication [sf.net trac #123] * extended attribute cache in gfmd and libgfarm [sf.net trac #128] Updated feature * gfmd - check and repair nlinks at start-up [sf.net trac #57] unreferenced inodes moved to /lost+found * gfsd - if the input/output error occurs, kill oneself to cope with the hardware failure [sf.net trac #85] * select a file system node having enough capacity regardless of existent file replicas when a file is overwritten [sf.net #68] * avoid scheduling conflict of file system nodes * try another file replica when the specified physical file does not exist * gfdf - -P option to specify the metadata server * gfdf - -S and -r options to sort output by available capacity and in reverse order, respectively [sf.net trac #131] * gfdf - -h and -H options to display sizes in human readable format [sf.net trac #126] * gfmkdir - -p option to create parent directories if needed, and not to return error even if the target directory exists * gfsched - -c option to schedule file system nodes for a file creation [sf.net trac #169] Bug fix * fix error handling of protocols in terms of extended attributes in gfmd [sf.net trac #124] * gfmd - plug memory leak in case of authentication error [sf.net trac #166] * gfmd - a file system node temporarily cannot be used if replication error happens due to the connection error to the source target [sf.net trac #162] * Won't compile on FreeBSD 7.3 [sf.net trac #138] * gfrep - may fail to create two or more file replicas [sf.net trac #114] * gfrep - gfrep may cause no space left on device [sf.net trac #152] Release note for Gfarm 2.4.0 ============================ [2010.7.22] New Feature * update-based replica consistency protocol that keeps number of file replicas at file modification New configuration in gfmd.conf * simultaneous_replication_receivers directive to specify the maximum number of pending replication requests to each gfsd Documentation * how to access Gfarm via samba from Windows clients Updated feature * gfwhere - several options to obtain in progress or obsolete replica information Bug fix * fix possibility to lost files in a rare case when updating and replicating at the same time * gfhost -R does not work [sf.net trac #120] * retry another file system node in GFARM_ERR_FILE_MIGRATED case [sf.net trac #117] * fix errors found by static analysis including unchecked return value and missing check against null * compilation failure with old OpenLDAP library since the version 2.3.0 [sf.net trac #121] * compilation failure on Linux 2.4 since the version 2.3.0 [sf.net trac #122] Not supported * no_file_system_node_timeout and gfmd_reconnection_timeout directives to specify the timeout to try to find a file system node and to reconnect to the gfmd, respectively. Default is 30 seconds. * gfmd - check and repair nlinks at start-up * gfsd - if the input/output error occurs, kill oneself to cope with the hardware failure * select a file system node having enough capacity regardless of existent file replicas when a file is overwritten Release note for Gfarm 2.3.2 ============================ [2010.7.1] New Command * gfsched - schedule and display available file system nodes New API * new scheduling APIs - gfarm_schedule_hosts_domain_all, gfarm_host_sched_info_free, gfarm_schedule_hosts{,_acyclic}{,_to_write} New configuration in gfarm2.conf * no_file_system_node_timeout and gfmd_reconnection_timeout directives to specify the timeout to try to find a file system node and to reconnect to the gfmd, respectively. Default is 30 seconds. Documentation * manual pages - gfsched(1), gfarm(3), gfarm_initialize(3), gfarm_terminate(3), gfs_pio_create(3), gfs_pio_open(3), gfs_pio_close(3), gfs_pio_write(3), gfs_pio_read(3) Updated feature * support OpenSSL 1.0.0 * support kfreebsd-gnu and linux-gnuabi * gfmd - check and repair nlinks at start-up * gfsd - if the input/output error occurs, kill oneself to cope with the hardware failure * gfrm - -f option to force to remove Bug fix * gfrep - -x option does not remove excessive number of file replicas in case some file replica creations fail * gfhost - -c/-m/-d without a hostname doesn't cause an error [sf.net trac #93] * gfs_pio_fstat() - may not return correct file size [sf.net trac #111] * gfsd - fix the back channel process stop when the connection error happens * gfsd failed to report an error that its hostname is not registered in gfmd (i.e. "gfhost -M") * file close operation is missing in gfsd when a client crashed [sf.net trac #2] * fix data race to calculate total amount of disk usage when a file system node is up and down * fix missing metadata update when GFARM_FILE_TRUNC is specified [sf.net trac #103] * fix missing permission check when GFARM_FILE_RDONLY|GFARM_FILE_TRUNC is specified [sf.net trac #107] * try the next auth method in case of permission denied * the test program "fsx" causes an assertion failure [sf.net trac #102] * fix compilation errors on FreeBSD 8.0 * fix bashism reported by checkbashisms * UNIX sockets and their parent directories are not removed when gfsd is stopped [sf.net trac #94] Release note for Gfarm 2.3.1 ============================ [2010.3.29] New Feature * quota (see doc/quota.en for details) * Gfarm URL, gfarm://metaserver:port/path/name * partial support of multiple metadata servers * message catalog framework for I18N * group map file New Command * gfquota, gfedquota, gfquotacheck - manipulate disk quota * gfusage - show file system usage New configuration in gfmd.conf * local_group_map directive to specify a group map file that maps global group names to local group names for legacy clients * log_message_verbose_level directive to specify how verbose the log message is * schedule_idle_load_thresh and schedule_busy_load_thresh directives to specify threshold of CPU load average for client scheduling * schedule_virtual_load directive to specify virtual load to add when a host is scheduled Updated feature * gfrep - -x option to remove excess file replicas * gfrep - enable capacity check * gfexport - improve performance * gfhost, gfgroup, gfuser - support multiple metadata servers by the -P option * gfstat - -c option to display the number of file replicas * gfwhere - display error if there is no file replica * gfuser, gfgroup - display specified users or groups if any * gfvoms-sync - search certificates in the same order as Globus * change the maximum number of open files from 256 to 1024 * select a file system node having enough capacity regardless of existent file replicas when a file is overwritten * read only mode for gfsd * support re-registration of users, groups and hosts without gfmd restart * fix inconsistency if the corresponding file data is missing * gfmd reconnection process only starts if the connection error happens * wait for a target gfsd to reconnect to the gfmd if there is no file system node * do not allow to remove gfarmadm group * change log format Bug fix * fix rename problem such that a directory cannot be deleted or orphan inodes remain after rebooting gfmd * fix missing automatic reconnection to gfmd * fix file replication error during the file update * fix file update problem during replication * fix GSI authentication error handling * fix duplicate registration of the same GSI DN * fix file migration issue described in the tracker https://sourceforge.net/tracker/?func=detail&aid=1976260&group_id=172718&atid=862742 * fix access control for chmod * gfmd - fix segfault when the postgresql database is stopped Release note for Gfarm 2.3.0 ============================ [2009.8.23] New Feature * automatic reconnection to gfmd * extended attribute * XML extended attribute that is searchable by XPath * group management by the Virtual Organization Membership Service (VOMS) * gfarmroot group - super users' group in Gfarm * multiple spools support in GSI [contribution from Nikola Garafolic] New Command * gfvoms-sync - synchronizes the group information with the VOMS * gfxattr - set, get, remove, and list extended attributes * gffindxmlattr - search XML extended attributes by XPath New API * gfs_{set,get,list,remove}xattr, gfs_f{set,get,remove}xattr - extended attribute support * gfs_{set,get,list,remove}xmlattr - XML extended attribute support * gfs_findxmlattr, gfs_getxmlent, gfs_closexmlattr - XML extended attribute search New configuration in gfmd.conf * metadb_server_dbq_size directive to specify a queue length for backend database Updated feature * gfdf - add the -n option to display hostnames of available file system nodes * config-gfarm-update - the --update-symlink option is replaced with the --update option, which updates the metadata schema of backend database for not only symbolic links but also extended attributes * config-gfarm-update - support ldap backend * config-gfarm - add -X option to enable XML extended attribute. * gfmd - use epoll if available that improves the response time in Linux Bug fix * gfmd - fix a critical problem such that there is a case to remain invalid old replicas even when it is updated. * gfmd - fix a problem such that an application hangs when opening a file in write mode that is opened by another application. * config-gfarm - fix unbound variable error when setting the DEBUG environment variable. * update st_atime and st_mtime in backend database Release note for Gfarm 2.2.0 ============================ [2009.3.26] New Feature * symbolic link support * hundreds of clients support by thread pool * directory listing speedup by attribute cache New Command * gfstatus - display Gfarm configuration status * gfln - create a hard link or a symbolic link New Admin Command * config-gfarm-update - update the backend database. 'config-gfarm-update --update-symlink' updates the backend database to manage symbolic links. Note that the postgresql backend is only supported for now. New API * gfs_symlink, gfs_readlink - symbolic link support * gfs_lstat New configuration in gfmd.conf * metadb_server_stack_size directive to specify a stack size of threads * metadb_server_thread_pool_size directive to specify the maximum number of threads in a thread pool * metadb_server_job_queue_length directive to specify the length of a job request queue * metadb_server_heartbeat_interval directive to specify the interval of heartbeat to each gfsd Documentation * manual pages - gfchgrp(1), gfchmod(1), gfchown(1), gfgroup(1), gfhost(1), gfln(1), gfls(1), gfmv(1), gfstatus(1), gfuser(1). * manual pages in HTML Updated feature * gfls - accomodate attribute caching and support display regarding symlinks and hardlinks * gfchmod - display more user friendly error message * gfmd - support hundreds of clients by introducing a thread pool * gfmd - authorize peers concurrently by making network related functions MT safe * gfmd - schedule the local host only when it has enough disk space * gfsd - support gfmd reconnection at the start up * (GSI) allow to delegate a limited proxy * (GSI) disable GSS_C_NT_USER_NAME (spool_server_cred_type user) by default since it is not supported by Globus GSI Bug fix * libgfarm - fix missing intialization of a pointer * gfmd - fix race condition * gfsd - fix -c and -cc options to check invalid files not only invalid file replicas * gfsd - terminate the master process when the back channel process dies * (GSI) use distinguished name of delegated credential Release note for Gfarm 2.1.1 ============================ [2008.9.27] New Feature * on-demand replication New Command * gfdump.postgresql - gfdump for postgresql backend New API * gfs_link - hardlink support [contribution from Rainer Rohmfeld] Documentation * manual pages - gfrep(1) Updated feature * gfgroup - group membership modification support * C++ support * support Globus 4.2.0 Bug fix * segfault when listing a directory that includes a removed user [sf.net tracker bugs #2009543] * race condition during authentication * LP64 portability problem when using GSI authentication * "too many open files" problem when replicating many files Release note for Gfarm 2.1.0 ============================ [2008.5.27] New Feature * Grid Security Infrastructure (GSI) support New Command * gfgroup - manage groups * gfdf - report usage of Gfarm file system New API * gfs_statfs(3) * gfs_replicate_to(3), gfs_migrate_to(3), gfs_migrate_from_to(3) Documentation * manual pages - gfdf(1), gfmkdir(1), gfrmdir(1), gfwhere(1), gfwhoami(1), gfkey(1), gfarm2.conf(5), gfsd(8), and gfmd(8). * SETUP, Gfarm-FAQ Performance enhancement * enlarge the block size of remote I/O from 256KB to 1MB to improve remote read/write performance from a distant location Updated feature * gfrep - full feature support * gfrm - support deletion of a file replica * gfsd - support a feature to check a spool directory when starting up * config-gfarm - support of a private mode and GSI Bug fix * gfhost - port number cannot be modified * gfrep - recover the state when replica creation fails [sf.net tracker bugs #1929840] * a security hole of GFS_PROTO_REPLICA_RECV, pointed out by [gfarm-discuss-ja:03295] * possible segfault when deleting a user or a host * default available capacity is set accidentally to 100GB * fix race condition when obtaining all host information Release note for Gfarm 2.0.0 ============================ The Gfarm file system is a distributed file system consisting of the local storage of commodity PCs. Many PCs in a local area network, compute nodes in a single cluster, multiple clusters in wide area, comprise a large-scale, high-performance shared network file system. Gfarm 2.0.0 (aka Gfarm v2) is a major new release to solve several security issues found in Gfarm v1 and to improve performance for small files. [2007.11.28] Features * Gfarm file system metadata daemon (gfmd) Gfmd manages file system metadata including locations of file replicas, and monitors file system nodes. * Gfarm file system daemon (gfsd) Gfsd is an I/O daemon running on every file system node for remote file operations and a file replication. * Client commands file management - gfls, gfreg, gfrm, gfmv, gfexport, gfstat file replica management - gfwhere, gfrep directory management - gfmkdir, gfrmdir host management - gfhost security - gfkey user/group management - gfuser, gfchmod, gfchown configuration - config-gfarm, config-gfsd * GfarmFS-FUSE (gfarm2fs) GfarmFS-FUSE enables to mount a Gfarm file system in userspace. Unsupported features * GSI authentication $Id: RELNOTES 5022 2010-12-30 11:13:50Z tatebe $ gfarm-2.4.1/OVERVIEW.ja0000644000000000000000000001264011507222727013102 0ustar rootroot[This is written in Japanese, please look at OVERVIEW.en for English version.] Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î³µÍ× ¡ü Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë¤Ä¤¤¤Æ ================================= Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ï¡¤¥Í¥Ã¥È¥ï¡¼¥¯¤ÇÀܳ¤µ¤ì¤¿ PC ¤Î¥í¡¼¥«¥ë¡¦¥¹¥È ¥ì¡¼¥¸¤ò«¤Í¤Æ¹½À®¤¹¤ëʬ»¶¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç¤¹¡¥LAN ¤ËÀܳ¤µ¤ì¤¿Ê£¿ô¤Î PC¡¤Ã±ÆÈ¤Î PC ¥¯¥é¥¹¥¿¡¤¹­°è¤ÎÊ£¿ô¤Î PC ¥¯¥é¥¹¥¿¤Ê¤É¤Ç¹½À®¤µ¤ì¡¤Â絬ÌÏ¡¤ ¹âÀ­Ç½¤Ê¶¦Í­¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤È¤·¤ÆÍøÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡¥ Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ï¡¤¥Õ¥¡¥¤¥ëÊ£À½¤ò¤¦¤Þ¤¯³èÍѤ·¤Æ NFS ¤ä AFS ¤Î¤è ¤¦¤Ê¥Í¥Ã¥È¥ï¡¼¥¯¶¦Í­¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç¤·¤Ð¤·¤ÐÌäÂê¤È¤Ê¤ë¡¤¥¢¥¯¥»¥¹½¸Ãæ ¤Ë¤è¤ë¥¢¥¯¥»¥¹À­Ç½¤ÎÄã²¼¤òËɻߤ·¤Þ¤¹¡¥¤Þ¤¿¡¤¥Ç¥£¥¹¥¯¡¤¥Í¥Ã¥È¥ï¡¼¥¯¤Î¾ã ³²»þ¡¤ºÒ³²»þ¤Ç¤Î¥Õ¥¡¥¤¥ë¡¦¥¢¥¯¥»¥¹¤ò²Äǽ¤È¤·¤Þ¤¹¡¥ Gfarm ¤Ç¥æ¥Ë¡¼¥¯¤ÊÅÀ¤Ï¡¤¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤¬Æ±»þ¤Ë Gfarm ¥Õ¥¡¥¤¥ë¥· ¥¹¥Æ¥à¤òÍøÍѤ¹¤ë¥¯¥é¥¤¥¢¥ó¥È¤Ë¤â¤Ê¤ì¤ë¤³¤È¤Ç¤¹¡¥¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É ¤Ë¤è¤ë Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Îʬ»¶¥¢¥¯¥»¥¹¤Ë¤è¤ê¡¤Ä¶¥¹¥±¡¼¥é¥Ö¥ë¤Ê¥¢¥¯ ¥»¥¹À­Ç½¤ò¼Â¸½¤·¤Þ¤¹¡¥ Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¾ÜºÙ¤Ï¡¤°Ê²¼¤ÎÏÀʸ¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡¥ [1] ·úÉô ½¤¸«¡¤¿¹ÅÄ ÍÎÊ¿¡¤¾¾²¬ Á´Ø¸ý Ãһ̡¤Á¾ÅÄ Å¯Ç·¡¤ ¡Ö¥Ú¥¿¥Ð¥¤¥È¥¹¥±¡¼¥ë¥Ç¡¼¥¿¥¤¥ó¥Æ¥ó¥·¥Ö¥³¥ó¥Ô¥å¡¼¥Æ¥£¥ó¥°¤Î¤¿¤á¤Î Grid Datafarm ¥¢¡¼¥­¥Æ¥¯¥Á¥ã¡×¡¤ ¾ðÊó½èÍý³Ø²ñÏÀʸ»ï¡§¥Ï¥¤¥Ñ¥Õ¥©¡¼¥Þ¥ó¥¹¥³¥ó¥Ô¥å¡¼¥Æ¥£¥ó¥°¥·¥¹¥Æ¥à¡¤ ¾ðÊó½èÍý³Ø²ñ¡¤Vol.43¡¤No.SIG 6 (HPS 5)¡¤pp.184-195¡¤2002 ǯ http://datafarm.apgrid.org/ [2] ·úÉô ½¤¸«¡¤Á¾ÅÄ Å¯Ç·¡¤´Ø¸ý Ãһ̡¤ ¡Ö¹­°è²¾ÁÛ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥àGfarm v2¤ÎÀ߷פȼÂÁõ¡×¡¤ ¾ðÊó½èÍý³Ø²ñ¸¦µæÊó¹ð¡¤2004-HPC-99¡¤ pp.145-150¡¤2004 ǯ http://datafarm.apgrid.org/pdf/SWoPP2004-gfarmv2.pdf ¡ü Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ÎÍøÍѼêÃÊ =================================== Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ï¡¤¼¡¤Î2¼ïÎà¤ÎÊýË¡¤ÇÍøÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡¥ ¡¦Gfarm ¥³¥Þ¥ó¥É¤ä¡¤Gfarm ÊÂÎóÆþ½ÐÎÏ API Ê£À½µ¡Ç½¤ä¡¤¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É´ÉÍýµ¡Ç½¤Ê¤É¡¤Gfarm ÆÃÍ­¤Îµ¡Ç½¤Ë¥¢ ¥¯¥»¥¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡¥ ¡¦GfarmFS-FUSE (gfarm2fs) FUSE (http://fuse.sourceforge.net/) ¤Îµ¡Ç½¤òÍøÍѤ·¤Æ¡¤Linux ¥¯¥é¥¤ ¥¢¥ó¥È¤«¤é¡¤Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ò¥Þ¥¦¥ó¥È¤·¤Þ¤¹¡¥ ¾¤ÎÊýË¡¤È°Û¤Ê¤ê¡¤´û¸¤Î¥×¥í¥°¥é¥à¤«¤é´°Á´¤ËÆ©²áŪ¤Ë¥¢¥¯¥»¥¹¤¹¤ë ¤³¤È¤¬¤Ç¤­¤Þ¤¹¡¥ ¡ü Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ò¹½À®¤¹¤ë¥Û¥¹¥È¤Î¼ïÎà =============================================== Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ï¡¤²¼µ­¤Î¼ïÎà¤Î¥Û¥¹¥È¤«¤é¹½À®¤µ¤ì¤Þ¤¹¡¥ ¡¦¥¯¥é¥¤¥¢¥ó¥È Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤òÍøÍѤ¹¤ë¥Û¥¹¥È¤Ç¤¹¡¥ ¡¦¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥Ç¡¼¥¿µ­²±Îΰè¤òÄ󶡤¹¤ë¥Û¥¹¥È·²¤Ç¤¹¡¥Ä̾ ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤«¤é¤â Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ò¥¢¥¯¥»¥¹¤¹¤ë¤¿¤á¡¤ Ʊ»þ¤Ë¥¯¥é¥¤¥¢¥ó¥È¤Ë¤â¤Ê¤ê¤Þ¤¹¡¥ ¹­°è¤Ë¸ºß¤¹¤ë¿ôÀé¥Î¡¼¥É¡¤¿ôËü¥Î¡¼¥É¤âÁÛÄꤵ¤ì¤Æ¤¤¤Þ¤¹¡¥¤½¤ì¤¾¤ì¤Î¥Î¡¼ ¥É¾å¤Ç¤Ï I/O ¥Ç¡¼¥â¥ó¤Î gfsd ¤¬Áö¤ê¤Þ¤¹¡¥ ¡¦¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥á¥¿¥Ç¡¼¥¿¤ò´ÉÍý¤¹¤ë¥Û¥¹¥È¤Ç¤¹¡¥¥Û¥¹¥È¾å¤Ç¤Ï ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤Î gfmd ¤È¡¤LDAP ¥µ¡¼¥Ð(slapd)¡¤PostgreSQL ¥µ¡¼¥Ð (postmaster) ¤Ê¤É¤Î¥Ð¥Ã¥¯¥¨¥ó¥É¡¦¥Ç¡¼¥¿¥Ù¡¼¥¹¤¬Áö¤ê¤Þ¤¹¡¥ ¾åµ­3¼ïÎà¤Ï¡¤É¬¤º¤·¤âÊ̤Υۥ¹¥È¤Çư¤«¤¹É¬ÍפϤ¢¤ê¤Þ¤»¤ó¡¥¤¹¤Ê¤ï¤Á¡¤¤â¤· ÍøÍѲÄǽ¤Ê¥Û¥¹¥È¤Î¿ô¤¬¸Â¤é¤ì¤Æ¤¤¤ë¤Î¤Ç¤¢¤ì¤Ð¡¤Æ±°ì¤Î¥Û¥¹¥È¤ò¡¤¤³¤ì¤é¤Î ÍÑÅÓ¤ÇÍøÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡¥ Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç¤Ï¡¤¥Õ¥¡¥¤¥ë¤ÏǤ°Õ¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤ËÇÛ ÃÖ¤µ¤ì¤Þ¤¹¡¥¤Þ¤¿¡¤¥Õ¥¡¥¤¥ë¤ÏÊ£À½¤µ¤ì¡¤°Û¤ë¥Î¡¼¥É¤ËÇÛÃÖ¤µ¤ì¤Þ¤¹¡¥ Gfarm ¤Ç¤Ï¡¤ ¡¦¥Õ¥¡¥¤¥ë¤¬³ÊǼ¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Ç½èÍý¤¹¤ë ¡¦¥Õ¥¡¥¤¥ë½¸¹ç¤Î¹½À®¥Õ¥¡¥¤¥ë¤¬³ÊǼ¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤ÇÊ Îó½èÍý¤¹¤ë ¤È¤¤¤Ã¤¿ÊÂÎóʬ»¶½èÍý¤ò»Ù±ç¤·¤Þ¤¹¡¥¤³¤Î¡Ö¤Ê¤ë¤Ù¤¯¥Õ¥¡¥¤¥ë¤Î¸ºß¤¹¤ë¥Î¡¼ ¥É¤Ç½èÍý¤¹¤ë¡×¤È¤¤¤¦½èÍýÊý¼°¤Ë¤è¤ê¡¤¹â¤¤¥Õ¥¡¥¤¥ë I/O À­Ç½¤È¡¤¹â®¤Ê¥Ç¡¼ ¥¿½èÍý¤¬¼Â¸½¤µ¤ì¤Þ¤¹¡¥ ¡ü Gfarm ¥½¥Õ¥È¥¦¥§¥¢¤Î¹½Â¤ =========================== Gfarm system ¤Ï¡¤²¼µ­¤Î¥½¥Õ¥È¥¦¥§¥¢¤«¤é¤Ê¤ê¤Þ¤¹¡¥ ¡¦libgfarm.a ¥é¥¤¥Ö¥é¥ê Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ò¥¢¥¯¥»¥¹¤¹¤ë¤¿¤á¤Ë¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¡¦¥×¥í¥°¥é ¥à¤Ë¥ê¥ó¥¯¤µ¤ì¤ë¥é¥¤¥Ö¥é¥ê¤Ç¤¹¡¥Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥é¥¤¥Ö¥é¥ê¡¦ ¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤ä¡¤¥æ¡¼¥Æ¥£¥ê¥Æ¥£´Ø¿ô¤«¤é¤Ê¤ê¤Þ¤¹¡¥ ¡¦gfmd - Gfarm ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¡¦¥Þ¥·¥ó¾å¤Çưºî¤¹¤ë¥Ç¡¼¥â¥ó¥×¥í¥°¥é¥à¤Ç¤¹¡¥ ¤É¤Î¥Õ¥¡¥¤¥ë¤¬¤É¤³¤Ë³ÊǼ¤µ¤ì¤Æ¤¤¤ë¤«¤Ê¤É¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥á¥¿¥Ç¡¼¥¿¤ò ÊÝ»ý¤·¤Æ¤¤¤Þ¤¹¡¥gfmd ¤Ï¡¤¥á¥â¥ê¾å¤Ë¥á¥¿¥Ç¡¼¥¿¤òÊÝ»ý¤·¤Þ¤¹¤¬¡¤½ªÎ»¤¹ ¤ë¤È¤­¤ËÈ÷¤¨¡¤PostgreSQL ¥µ¡¼¥Ð ¤Ê¤¤¤· OpenLDAP ¥µ¡¼¥Ð¤Ë¤â¥Ç¡¼¥¿¤ò³Ê Ǽ¤·¤Þ¤¹¡¥ ¡¦gfsd - Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¡¦¥Ç¡¼¥â¥ó ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¾å¤ÎÁ´¥Û¥¹¥È¤Çưºî¤¹¤ë¥Ç¡¼¥â¥ó¥×¥í¥°¥é¥à¤Ç¤¹¡¥ Gfarm ¥Õ¥¡¥¤¥ë¤Î¼Â¥Ç¡¼¥¿¤Ø¥¢¥¯¥»¥¹¤òÄ󶡤·¤Þ¤¹¡¥ ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Î¥á¥¿¥Ç¡¼¥¿¾ðÊó¤ÎÅÐÏ¿¤ä¡¤gfsd ¤Îưºî¾õÂ֤Π¸¡ºº¤Ë¤Ï¡¤gfhost ¥³¥Þ¥ó¥É¤òÍѤ¤¤Þ¤¹¡¥ ¡¦Gfarm ¥³¥Þ¥ó¥É¥Ä¡¼¥ë gfls, gfrm, gfwhere, gfrep ¤Ê¤É¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥³¥Þ¥ó¥É¡¤gfreg, gfexport ¤Ê¤É¤Î¥Õ¥¡¥¤¥ë´ÉÍý¥³¥Þ¥ó¥É¡¤¤ª¤è¤Ó¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É´É Íý¥³¥Þ¥ó¥É gfhost¡¤Ç§¾Ú¥­¡¼´ÉÍý¥Ä¡¼¥ë gfkey ¤Ê¤É¤«¤é¤Ê¤ê¤Þ¤¹¡¥ ¡ü ¥æ¡¼¥¶Ç§¾Ú¤Ë¤Ä¤¤¤Æ ===================== gfmd ¤ª¤è¤Ó gfsd ¤Ï¡¤¸½ºß²¼µ­¤Îǧ¾ÚÊýË¡¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Þ¤¹¡¥ Gfarm-FAQ.ja ¤Î¥»¥­¥å¥ê¥Æ¥£¤Î¹à¤â»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡¥ 1. sharedsecret ¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê¤Ë gfarm ¥½¥Õ¥È¥¦¥§¥¢¤¬¼«Æ°Åª¤ËÀ¸À®¤¹¤ë¶¦Í­¸° ~/.gfarm_shared_key ¤òÍѤ¤¤ÆÇ§¾Ú¤ò¹Ô¤Ê¤¤¤Þ¤¹¡£ Firewall ¤Ç¼é¤é¤ì¤¿´Ä¶­¤ËŬ¤·¤Æ¤¤¤Þ¤¹¡¥ NFS ¤Ê¤É¤Ç¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê¤ò¶¦Í­¤·¤Æ¤¤¤ë´Ä¶­¤Ç´Ê°×Ū¤Ë±¿ÍѤ¹¤ë ¾ì¹ç¤Ë¸þ¤¤¤Æ¤¤¤Þ¤¹¡¥ 2. gsi GSI, ¤¹¤Ê¤ï¤Á Grid Security Infrastructure Êý¼°¤Ç¤¹¡¥ PKI ¾ÚÌÀ½ñ¤òÍѤ¤¤Æ¸ø³«¸°Ç§¾Ú¤ò¹Ô¤Ê¤¤¤Þ¤¹¡¥ ¤Þ¤¿¡¤¤³¤ì¤òÍѤ¤¤¿¾ì¹ç¡¤ÄÌ¿®ÆâÍÆ¤Î°Å¹æ²½¤â¹Ô¤Ê¤¤¤Þ¤¹¡¥ Internet ¤Ç¤ÎÍøÍѤËŬ¤·¤¿Êý¼°¤Ç¤¹¡¥ ¾Ü¤·¤¯¤Ï²¼µ­¤Î Globus ¥×¥í¥¸¥§¥¯¥È¤Î¥Ú¡¼¥¸¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£ http://www.globus.org/security/overview.html 3. gsi_auth ǧ¾Ú¤Ë¤Ï GSI ¤òÍѤ¤¤Þ¤¹¤¬¡¤¤½¤Î¸å¤ÎÄÌ¿®¤Ë¤Ïñ¤Ê¤ë TCP ¥³¥Í¥¯¥·¥ç¥ó¤ò ÍѤ¤¤Þ¤¹¡¥ Firewall ¤Ç¼é¤é¤ì¤¿´Ä¶­¤ËŬ¤·¤Æ¤¤¤Þ¤¹¡¥ gfarm-2.4.1/man/0000755000000000000000000000000011507222730012062 5ustar rootrootgfarm-2.4.1/man/man5/0000755000000000000000000000000011507222730012722 5ustar rootrootgfarm-2.4.1/man/man5/gfarm2.conf.50000644000000000000000000007447511507222725015137 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFARM2.CONF" "5" "30 December 2010" "Gfarm" "" .SH NAME gfarm2.conf \- Gfarm configuration file .SH "DESCRIPTION" .PP gfarm2.conf is a text file that contains a Gfarm configuration. Gfarm server processes gfmd and gfsd refer to %%SYSCONFDIR%%/gfmd.conf and %%SYSCONFDIR%%/gfarm2.conf, respectively, by default. Since this configuration file is only read at startup, it is necessary to restart servers when the contents of the configuration file are updated. .PP Application programs, such as gfls and gfhost, refer to both %%SYSCONFDIR%%/gfarm2.conf, and a file specified by an environment variable, GFARM_CONFIG_FILE. If both configuration files exist, the file specified by the environment variable, GFARM_CONFIG_FILE, is read first. Both files have the same grammar. If the environment variable GFARM_CONFIG_FILE doesn't exist, ~/.gfarm2rc in a user's home directory is used instead. .PP Each line of gfarm2.conf consists of one statement. When the line ends with the character ``\\'', the line continues for the next line. A word beginning with ``#'' causes that word and all remaining characters on that line to be ignored. .SH "HOST_SPECIFICATION" .PP \fIHost_specification\fR has the following forms. .TP \fB\fIIII.JJJ.KKK.LLL\fB\fR Specifies an IP address with four octets from 0 to 255, separated by ".". .TP \fB\fIIII.JJJ.KKK.LLL\fB/\fIMM\fB\fR Specifies a network address with an IP address and a netmask from 0 to 31 separated by "/". .TP \fB\fIdomain.name\fB\fR Specifies a host name. .TP \fB \fI\&.domain.name\fB\fR Specifies all hosts which belong to the domain.name. .TP \fB*\fR Specifies all hosts. .SH "STATEMENT" .PP The following statements are supported. .TP \fBspool \fIdirectory\fB\fR The spool statement specifies a spool directory for a Gfarm filesystem on this filesystem node. For example, .nf spool /var/spool/gfarm .fi .TP \fBspool_server_listen_address \fIIP-address\fB\fR The spool_server_listen_address statement specifies the IP address at which the gfsd accepts TCP and UDP requests. The default address is all IP addresses of the host. This option is useful when one wants to invoke multiple gfsd to provide multiple spool directories on the host. For example, .nf spool_server_listen_address 192.168.121.1 .fi .TP \fBspool_server_cred_type \fIcred_type\fB\fR This statement specifies the type of credential used by gfsd for GSI authentication. This is ignored when you are using sharedsecret authentication. If this statement isn't used on the server side, the server uses a host certificate, if the server is invoked with root privileges. Or, if the server is invoked as a non-privileged user, the server uses the user's certificate. If this statement isn't used on the client side, the client assumes that the server that the client is going to connect is using a host certificate of the server host. Thus, if the server is not invoked with root privileges, but invoked with user privileges where the user is the same as the user who invoked the client, the client side needs to specify the following one line. Example: .nf spool_server_cred_type self .fi The possible types of \fIcred_type\fR are ``self\&'', ``host\&'', ``user\&'' and ``mechanism-specific\&''. And those are used with the spool_server_cred_service and spool_server_cred_name statements as follows: .RS .TP \fBself\fR This keyword specifies that the certificate that the user currently has is used. You must not use either the spool_server_cred_service or spool_server_cred_name statement, if you are using this type. .TP \fBhost\fR This keyword specifies that a host certificate or a service certificate is used. To choose a service certificate, the name of the service may be specified by the spool_server_cred_service statement. If ``host\&'' is specified as the service name, a host certificate in the file ``\fI/etc/grid-security/hostcert.pem\fR\&'' will be used. If any server name other than ``host\&'' is specified, a service certificate in the file ``\fI/etc/grid-security/SERVICE/SERVICEcert.pem\fR\&'' will be used. If the service name is omitted, ``host\&'' will be used as the service name by default. Only the Common Name field of a certificate will be used to check the server's identity for both a host certificate and a service certificate. And the Common Name field must be in the ``CN=SERVERNAME/HOSTNAME'' format. Also, the hostname must match the canonical name configured by the \fBgfhost\fR command exactly. Alias hostnames are not allowed. This feature corresponds to the GSS_C_NT_HOSTBASED_SERVICE feature in GSSAPI (RFC2743/RFC2744). Example: .nf spool_server_cred_type host spool_server_cred_service host .fi .TP \fBuser\fR This keyword specifies that a user certificate is used. The account name of the user may be specified by the spool_server_cred_name statement. If the account name is omitted, the user who invoked the command will be used by default. You must not specify a service name using the spool_server_cred_service statement, if you are using a user certificate. To map from the account name to a Distinguished Name of a certificate, file ``\fI/etc/grid-security/grid-mapfile\fR\&'' is used. Thus, if there isn't such a file, or if the user isn't specified in this file, this feature cannot be used. This feature corresponds to the GSS_C_NT_USER_NAME feature in GSSAPI (RFC2743/RFC2744). Example: .nf spool_server_cred_type user spool_server_cred_name guest .fi .TP \fBmechanism-specific\fR This keyword specifies that spool_server_cred_name is treated as a raw X.509 Distinguished Name serving as a server's certificate. You must not specify a service name using a spool_server_cred_service statement, if you are using this type. This feature corresponds to a case where GSS_C_NO_OID is specified as a Name Type in GSSAPI (RFC2743/RFC2744). Example: .nf spool_server_cred_type mechanism-specific spool_server_cred_name "/O=Grid/O=Globus/OU=example.com/CN=John Smith" .fi .RE .TP \fBspool_server_cred_service \fIcred_service\fB\fR This statement specifies the service name of a service certificate used by gfsd for GSI authentication, when ``host\&'' is specified in spool_server_cred_type statement. This is ignored when you are using sharedsecret authentication. Please read the description of the spool_server_cred_type statement for details. .TP \fBspool_server_cred_name \fIcred_name\fB\fR This statement specifies the setting of a certificate used by gfsd for GSI authentication. What this setting means depends on the type specified in the spool_server_cred_type statement. This is ignored when you are using sharedsecret authentication. Please read the description of the spool_server_cred_type statement for details. .TP \fBmetadb_server_host \fIhostname\fB\fR The metadb_server_host statement specifies the host name on which gfmd is running. This statement cannot be omitted. For example, .nf metadb_server_host ldap.example.com .fi .TP \fBmetadb_server_port \fIport\fB\fR The metadb_server_port statement specifies the tcp port number the gfmd is listening on. The default port number is 601. For example, .nf metadb_server_port 601 .fi .TP \fBmetadb_server_cred_type \fIcred_type\fB\fR This statement specifies the type of credential used by gfmd for GSI authentication. This is ignored when you are using sharedsecret authentication. Please read the description of the spool_server_cred_type statement on the configuration of this statement. .TP \fBmetadb_server_cred_service \fIcred_service\fB\fR This statement specifies the service name of a service certificate used by gfmd for GSI authentication, when ``host\&'' is specified in metadb_server_cred_type statement. This is ignored when you are using sharedsecret authentication. Please read the description of the spool_server_cred_type statement on the configuration of this statement. .TP \fBmetadb_server_cred_name \fIcred_name\fB\fR This statement specifies the setting of a certificate used by gfmd for GSI authentication. What this setting means depends on the type specified in the metadb_server_cred_type statement. This is ignored when you are using sharedsecret authentication. Please read the description of the spool_server_cred_type statement on the configuration of this statement. .TP \fBmetadb_server_stack_size \fIbytes\fB\fR This directive specifies the size of each thread in the gfmd metadata server process. If not specified, the default size of the OS is used. This parameter is used to cut down the size of virtual memory space used by gfmd. For example, the default stack size on CentOS 5/i386 is 10MB, thus, you can decrease the size of the virtual memory space of gfmd to 1/40, by specifying 256KB as this parameter. This parameter is only available in gfmd.conf, and ignored in gfarm2.conf. For example, .nf metadb_server_stack_size 262144 .fi .TP \fBmetadb_server_thread_pool_size \fIsize\fB\fR This directive specifies the maximum number of threads in a thread pool in the gfmd. It is effective to specify around the number of CPU cores of the metadata server node. Default is 16. This parameter is only available in gfmd.conf, and ignored in gfarm2.conf. For example, .nf metadb_server_thread_pool_size 16 .fi .TP \fBmetadb_server_job_queue_length \fIlength\fB\fR This directive specifies the length of job queue in the gfmd. It is effective to specify around the maximum number of clients that access the Gfarm file system at the same time. Default is 16000. This parameter is only available in gfmd.conf, and ignored in gfarm2.conf. For example, .nf metadb_server_job_queue_length 160 .fi .TP \fBmetadb_server_heartbeat_interval \fIseconds\fB\fR This directive specifies the interval of heartbeat in seconds for gfmd to check availability of each gfsd. Default is 180 seconds. Until gfarm-2.3.0, this parameter was only available in gfmd.conf, and ignored in gfarm2.conf. But since gfarm-2.4.0, gfsd also uses this parameter to detect whether gfmd is down or not, this parameter has to be specified in both gfarm2.conf and gfmd.conf. For example, .nf metadb_server_heartbeat_interval 180 .fi .TP \fBmetadb_server_dbq_size \fIsize\fB\fR This directive specifies the queue length of metadata updates for a backend database in gfmd. Longer queue length may avoid slow down due to waiting backend database updates in case of frequent metadata operations. Default is 65536. This parameter is only available in gfmd.conf, and ignored in gfarm2.conf. For example, .nf metadb_server_dbq_size 65536 .fi .TP \fBldap_server_host \fIhostname\fB\fR The ldap_server_host statement specifies the host name on which an LDAP server is running. This statement is required when the LDAP server is used for a backend database of gfmd. This statement is used in gfmd.conf not gfarm2.conf. For example, .nf ldap_server_host ldap.example.com .fi .TP \fBldap_server_port \fIport\fB\fR The ldap_server_port statement specifies the tcp port number of the LDAP server. This statement cannot be omitted if ldap_server_host is specified. For example, .nf ldap_server_port 602 .fi .TP \fBldap_base_dn \fILDAP_base_distinguished_name\fB\fR The ldap_base_dn statement specifies the base-distinguished name of the LDAP database. This statement cannot be omitted if ldap_server_host is specified. For example, .nf ldap_base_dn "dc=example, dc=com" .fi .TP \fBldap_bind_dn \fILDAP_bind_distinguished_name\fB\fR The ldap_bind_dn statement specifies the distinguished name for the bind operation which is used for authentication to the LDAP database. For example, .nf ldap_bind_dn "cn=gfarmuser, dc=example, dc=com" .fi .TP \fBldap_bind_password \fIpassword\fB\fR The ldap_bind_password statement specifies the password for the bind operation which is used for authentication to the LDAP database. For example, .nf ldap_bind_password "secret-ldap-password" .fi .TP \fBpostgresql_server_host \fIhostname\fB\fR The postgresql_server_host statement specifies the host name on which a PostgreSQL server is running. This statement is required when the PostgreSQL server is used for a backend database of gfmd. This statement is used in gfmd.conf not gfarm2.conf. For example, .nf postgresql_server_host postgresql.example.com .fi .TP \fBpostgresql_server_port \fIport\fB\fR The postgresql_server_port statement specifies the tcp port number of the PostgreSQL server. This statement cannot be omitted if postgresql_server_host is specified. For example, .nf postgresql_server_port 602 .fi .TP \fBpostgresql_dbname \fIdbname\fB\fR The postgresql_dbname statement specifies the database name of the PostgreSQL database. This statement cannot be omitted if postgresql_server_host is specified. For example, .nf postgresql_dbname gfarm .fi .TP \fBpostgresql_user \fIuser\fB\fR The postgresql_user statement specifies the username used to connect the PostgreSQL database. For example, .nf postgresql_user gfarm .fi .TP \fBpostgresql_password \fIpassword\fB\fR The postgresql_password statement specifies the password used to connect the PostgreSQL database. For example, .nf postgresql_password gfarm .fi .TP \fBpostgresql_conninfo \fIconnection_info\fB\fR The postgresql_conninfo statement specifies the connection option used to connect the PostgreSQL database. For example, .nf postgresql_conninfo "sslmode=require connect_timeout=30" .fi .TP \fBauth \fIvalidity\fB \fImethod\fB \fIHost_specification\fB\fR This statement specifies the authentication method when communicating with the host(s) specified by the third argument. The first argument should be either the enable or disable keyword. The second argument, \fIauth method\fR, should be the gsi, gsi_auth, or sharedsecret keyword. The third argument specifies the host(s) by using \fIHost specification\fR\&. The auth statement may be specified any number of times. For each authentication method, it becomes a candidate when the first entry whose host_specification matches the target host has the enable keyword. When there is no corresponding entry, or when the first corresponding entry has the disable keyword, the authentication method does not become a candidate. This process takes place on both client and server sides. Candidates for authentication method on both sides will be tried. The order of statements with different authentication methods is not relevant. When there are several candidates for the authentication method for the host, the order of the authentication trial is sharedsecret, gsi_auth, and then gsi\&. The GSI methods are available if and only if the --with-globus option is specified at configuration. When the methods are not available, an auth statement with gsi or gsi_auth will be ignored. This statement cannot be omitted. For example, .nf auth disable sharedsecret 192.168.0.100 auth disable sharedsecret 192.168.0.101 auth enable sharedsecret 192.168.0.0/24 auth enable gsi_auth 10.0.0.0/8 auth enable gsi * .fi In this example, all hosts which belong to the network address 192.168.0.0/24, except for two hosts, 192.168.0.100 and 192.168.0.101, will be tested for authenticated by both sharedsecret and gsi; all hosts which belong to the network address 10.0.0.0/8 will be tested for authentication by both gsi_auth and gsi; and all other hosts will be authenticated by gsi\&. Note that two hosts, 192.168.0.100 and 192.168.0.101, will be tested for authentication by gsi only. .TP \fBsockopt \fIoption\fB[=\fIvalue\fB] [LISTENER | \fIHost_specification\fB]\fR The sockopt parameter specifies the socket option \fIoption\fR via the setsockopt(2) system call. When LISTENER (all capital letters) is specified by the second argument, the socket option is applied to any socket on the server side (accepting side). When the host_specification is specified by the second argument, the socket option is applied to sockets that connect to the specified host(s). If the second argument is "*", the socket option is applied to any hosts on the client side (connecting side). If the second argument is omitted, the socket option is applied to every socket. The following socket options can be specified. debug\&. The SO_DEBUG socket option is specified. A \fIvalue\fR is not necessary. keepalive\&. The SO_KEEPALIVE socket option is specified. A \fIvalue\fR is not necessary. sndbuf\&. The SO_SNDBUF socket option is specified with a \fIvalue\fR\&. rcvbuf\&. The SO_RCVBUF socket option is specified with a \fIvalue\fR\&. tcp_nodelay\&. The TCP_NODELAY socket option is specified. A \fIvalue\fR is not necessary. For example, .nf sockopt tcp_nodelay 192.168.0.0/24 sockopt sndbuf=1048576 10.0.0.0/8 sockopt sndbuf=1048576 LISTENER sockopt rcvbuf=1048576 10.0.0.0/8 sockopt rcvbuf=1048576 LISTENER .fi .TP \fBknown_network \fIHost_specification\fB\fR The known_network statement specifies a network address for file system nodes. It is used to group file system nodes at file systen node scheduling. File system nodes that are not specified in this directive are assumed to be in an IPv4 class C network. For example, .nf known_network 192.168.0.0/24 .fi .TP \fBadmin_user \fIuser\fB\fR This directive specifies an administrator user name, which is specified in gfmd.conf. .TP \fBadmin_user_gsi_dn \fIuser_gsi_dn\fB\fR This directive specifies a subject DN of an administrator, which is specified in gfmd.conf. .TP \fBlocal_user_map \fIuser-map-file\fB\fR This directive specifies a file name \fIuser-map-file\fR for mapping local user names to global user names. This map file is used only for sharedsecret authentication. When this file is not specified, a global user name is assumed to be same as the local user name. \fIuser-map-file\fR is needed when you have to use the sharedsecret authentication method in the case where you have different unix account names on different filesystem nodes. In such a case, the \fIuser-map-file\fR on each filesystem node should have an entry from each local user name to a unique global user name. Example: .nf local_user_map /etc/gfarm/gfarm-usermap .fi Each line of the \fIuser-map-file\fR consists of two fields separated by spaces; the first field is a global user name, and the second field is a local user name. Example of the user mapping file: .nf foobar foo quux baz .fi According to the first line of this mapping file, a global user name, "foobar", is mapped to a local user name, "foo", on this node. .TP \fBlocal_group_map \fIgroup-map-file\fB\fR This directive specifies a file name \fIgroup-map-file\fR for mapping global group names to local group names. This map file is used by legacy clients that use local group id such as gfarm2fs and gfarm dsi for Globus GridFTP to display mapped local groups. When this file is not specified, a local group name is assumed to be same as the global group name. Example: .nf local_group_map /etc/gfarm/gfarm-groupmap .fi Each line of the \fIgroup-map-file\fR consists of two fields separated by spaces; the first field is a global group name, and the second field is a local group name. .TP \fBschedule_cache_timeout \fIseconds\fB\fR This directive specifies the time (in seconds) until the cache used for filesystem node scheduling expires. The cache holds information on each filesystem node, e.g. load average, disk free space, and whether authentication succeeds or not. The default time is 600 seconds, i.e. ten minutes. For example, .nf schedule_cache_timeout 60 .fi .TP \fBschedule_idle_load_thresh \fIload-average\fB\fR This directive specifies the threshold of CPU load average to be considered idle. The file system nodes whose CPU load average is equal to or below the specified CPU load average are to be scheduled at first. The default load average is 0.1. For example, .nf schedule_idle_load_thresh 0.1 .fi .TP \fBschedule_busy_load_thresh \fIload-average\fB\fR This directive specifies the threshold of CPU load average to be considered busy. The file system nodes whose CPU load average is above the specified CPU load average are to be scheduled lastly. The default load average is 0.5. For example, .nf schedule_busy_load_thresh 0.5 .fi .TP \fBschedule_virtual_load \fIload-average\fB\fR This directive specifies the virtual CPU load average. The virtual CPU load is added when the host is scheduled to avoid scheduling the same host multiple times. The default load average is 0.3. For example, .nf schedule_virtual_load 0.3 .fi .TP \fBminimum_free_disk_space \fIbytes\fB\fR This directive specifies free disk space (in bytes) which is required on filesystem nodes. The Gfarm scheduler excludes filesystem nodes which have less free space than this parameter, when it schedules nodes for jobs which may write files. The free space value may have a suffix like ``k'' (kilo bytes), ``M'' (mega bytes), ``G'' (giga bytes) and ``T'' (tera bytes). The default size is 128M bytes. This directive has to be specified in both gfarm2.conf and gfmd.conf. After restarting the gfmd and the Gfarm client, it is effective. For example, .nf minimum_free_disk_space 1G .fi .TP \fBsimultaneous_replication_receivers \fInumber\fB\fR This directive specifies maximum number of simultaneous gfmd-initiated replications to same host. The default is 20. For example, .nf simultaneous_replication_receivers 40 .fi .TP \fBgfsd_connection_cache \fInumber\fB\fR This directive specifies maximum number of cached gfsd connections. The default is 16. For example, .nf gfsd_connection_cache 32 .fi .TP \fBattr_cache_limit \fInumber\fB\fR This directive specifies maximum number of cached attributes in gfarm library. The default is 40000. For example, .nf attr_cache_limit 100000 .fi .TP \fBattr_cache_timeout \fImilliseconds\fB\fR This directive specifies maximum time until cached attributes expire in milliseconds. The default is 1000, i.e. 1 second. For example, .nf attr_cache_timeout 3600000 .fi .TP \fBlog_level \fIpriority_level\fB\fR This directive specifies a level of log priority. The log output, which priority is inferior to this level, will not be sent to syslog or standard error. The priority levels are "emerg", "alert", "crit", "err", "warning", "notice", "info" and "debug" in highest first order. The default level is "info". It's not recommended to specify a level higher or equal to "crit". For example, .nf log_level debug .fi .TP \fBlog_message_verbose_level \fIlevel\fB\fR This directive specifies how verbose the log message is. The default value is 0, which outputs the log message id. The level 1 additionally outputs the file name and the line of source code. The level 2 additionally outputs the function name. For example, .nf log_message_verbose_level 1 .fi .TP \fBno_file_system_node_timeout \fIseconds\fB\fR If there is no file system node available, Gfarm client library periodically tries to find a file system node. This directive specifies the timeout to try in seconds. The default is 30 seconds. For example, .nf no_file_system_node_timeout 30 .fi .TP \fBgfmd_reconnection_timeout \fIseconds\fB\fR If the connection to the metadata server is disconnected, Gfarm client library periodically tries to reconnect. This directive specifies the timeout to try in seconds. The default is 30 seconds. For example, .nf gfmd_reconnection_timeout 30 .fi .SH "GRAMMAR" .PP This is a grammar of gfarm2.conf described by the BNF notation. .nf ::= \~\~ | \~\~ | \~\~ | \~\~ | \~\~ | \~\~ | \~\~ | \~\~ | \~\~ | \~\~ | \~\~ | \~\~ | \~\~ | \~\~ | \~\~ | \~\~ | \~\~ | \~\~ | \~\~ | \~\~ | \~\~ | \~\~ | \~\~ | \~\~ | \~\~ | \~\~ | \~\~ | \~\~ | \~\~ | \~\~ | \~\~ | \~\~ | \~\~ | \~\~ | \~\~ | \~\~ | \~\~ | \~\~ | \~\~ | \~\~ | \~\~ | \~\~ | \~\~ | \~\~ ::= "spool" ::= \~\~"spool_server_listen_address" ::= \~\~"spool_server_cred_type" ::= \~\~"spool_server_cred_service" ::= \~\~"spool_server_cred_name" ::= "metadb_server_host" ::= "metadb_server_port" ::= \~\~"metadb_server_cred_type" ::= \~\~"metadb_server_cred_service" ::= \~\~"metadb_server_cred_name" ::= \~\~"metadb_server_stack_size" ::= \~\~"metadb_server_thread_pool_size" ::= \~\~"metadb_server_job_queue_length" ::= \~\~"metadb_server_heartbeat_interval" ::= \~\~"metadb_server_dbq_size" ::= "ldap_server_host" ::= "ldap_server_port" ::= "ldap_base_dn" ::= "ldap_bind_dn" ::= "ldap_bind_password" ::= "postgresql_server_host" ::= "postgresql_server_port" ::= "postgresql_dbname" ::= "postgresql_user" ::= "postgresql_password" ::= "postgresql_conninfo" ::= \~\~"auth" ::= "enable" | "disable" ::= "gsi" | "gsi_auth" | "sharedsecret" ::= \~\~"sockopt" [=] [""LISTENER" | ] = "debug" | "keepalive" | "sndbuf" | "rcvbuf" | \~\~"tcp_nodelay" ::= "known_network" ::= "admin_user" ::= "admin_user_gsi_dn" ::= "local_user_map" ::= "local_group_map" ::= "schedule_cache_timeout" ::= "schedule_idle_load_thresh" ::= "schedule_busy_load_thresh" ::= "schedule_virtual_load" ::= \~\~"minimum_free_disk_space" ::= "simultaneous_replication_receivers" ::= "gfsd_connection_cache" ::= "attr_cache_limit" ::= "attr_cache_timeout" ::= "log_level" ::= "log_message_verbose_level" ::= "no_file_system_node_timeout" ::= "gfmd_reconnection_timeout" ::= | "/" | \~\~ | "." | "*" ::= * ::= | "," | "/" | "_" ::= * ::= | | "-" | "." ::= ::= [ "k" | "M" | "G" | "T" ] ::= [*] ::= "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" ::= """ * """ ::= \~\~ | \~\~"\\\\" | "\\"" ::= "enable" | "disable" ::= "emerg" | "alert" | "crit" | "err" | "warning" | \~\~"notice" | "info" | "debug" .fi .SH "EXAMPLES" .PP The following is an example usin PostgreSQL to store the metadata, and to allow access from filesystem nodes and clients at IP address 192.168.0.0/24, via sharedsecret authentication. .nf spool /var/spool/gfarm metadb_server_host metadb.example.org metadb_server_port 601 postgresql_server_host metadb.example.org postgresql_server_port 5432 postgresql_dbname gfarm postgresql_user gfarm postgresql_password "secret-postgresql-password" auth enable sharedsecret 192.168.0.0/24 sockopt keepalive .fi .PP The following is an example using LDAP to store the metadata, and to allow access from filesystem nodes and clients at any IP address, via GSI authentication. .nf spool /var/spool/gfarm metadb_server_host metadb.example.com metadb_server_port 601 ldap_server_host metadb.example.com ldap_server_port 602 ldap_base_dn "dc=example, dc=com" ldap_bind_dn "cn=gfarmuser, dc=example, dc=com" ldap_bind_password "secret-ldap-password" auth enable gsi * sockopt keepalive .fi .SH "FILES" .TP \fB\fI%%SYSCONFDIR%%/gfarm2.conf\fB\fR .TP \fB\fI$HOME/.gfarm2rc\fB\fR .SH "SEE ALSO" .PP \fBgfmd\fR(8), \fBgfsd\fR(8), \fBsetsockopt\fR(2) gfarm-2.4.1/man/man5/Makefile0000644000000000000000000000052011507222725014363 0ustar rootroot# $Id: Makefile 2373 2006-01-12 00:54:22Z soda $ top_builddir = ../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk DOCBOOK_DIR=$(top_srcdir)/doc/docbook/en/ref/man5 include $(DOCBOOK_DIR)/Makefile.inc MAN = $(DOCBOOK) EXTRA_CLEAN_TARGETS = manpage.links manpage.refs include $(top_srcdir)/makes/man.mk gfarm-2.4.1/man/man3/0000755000000000000000000000000011507222730012720 5ustar rootrootgfarm-2.4.1/man/man3/gfs_pio_putc.30000644000000000000000000000156511507222726015501 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_PIO_PUTC" "3" "18 March 2003" "Gfarm" "" .SH NAME gfs_pio_putc \- output of a character .SH SYNOPSIS .sp \fB#include .sp char *gfs_pio_putc (GFS_File \fIgf\fB, int \fIc\fB); \fR .SH "DESCRIPTION" .PP \fBgfs_pio_putc()\fR writes the charecter \fIc\fR to \fIgf\fR. .SH "RETURN VALUES" .TP \fBNULL\fR The function terminated successfully. .TP \fBGFARM_ERR_NO_MEMORY\fR Insufficient memory was available. .TP \fBOthers\fR An error except the above occurred. The reason is shown by its pointed strings. .SH "SEE ALSO" .PP \fBgfs_pio_create\fR(3), \fBgfs_pio_open\fR(3) gfarm-2.4.1/man/man3/gfs_pio_truncate.30000644000000000000000000000230711507222726016346 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_PIO_TRUNCATE" "3" "12 January 2005" "Gfarm" "" .SH NAME gfs_pio_truncate \- truncate a file to a specified length .SH SYNOPSIS .sp \fB#include .sp char *gfs_pio_truncate (GFS_File \fIgf\fB, file_offset_t \fIlength\fB); \fR .SH "DESCRIPTION" .PP The \fBgfs_pio_truncate()\fR function truncates the regular file \fIgf\fR to the \fIlength\fR bytes. .PP If the file was previously shorter than the length, it is extended, and the extended part is filled by zero bytes. .PP The file pointer is not changed. .PP You must specify GFS_FILE_MODE_WRITE in opening the file, because it must be open for writing. .SH "RETURN VALUES" .TP \fBNULL\fR The function terminated successfully. .TP \fBGFARM_ERR_NO_MEMORY\fR Insufficient memory was available. .TP \fBOthers\fR An error except the above occurred. The reason is shown by its pointed strings. .SH "SEE ALSO" .PP \fBgfs_pio_create\fR(3), \fBgfs_pio_open\fR(3) gfarm-2.4.1/man/man3/gfarm_terminate.30000644000000000000000000000155711507222726016165 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFARM_TERMINATE" "3" "26 June 2010" "Gfarm" "" .SH NAME gfarm_terminate \- terminate the Gfarm execution environment for client .SH SYNOPSIS .sp \fB#include .sp gfarm_error_t gfarm_terminate (\fIvoid\fB); \fR .SH "DESCRIPTION" .PP \fBgfarm_terminate()\fR terminates the Gfarm execution environment for client application. .SH "RETURN VALUES" .TP \fBGFARM_ERR_NO_ERROR\fR The function terminated successfully. .TP \fBOthers\fR An error except the above occurred. The reason is shown by \fBgfarm_error_string\fR(3)\&. .SH "SEE ALSO" .PP \fBgfarm_initialize\fR(3) gfarm-2.4.1/man/man3/gfs_pio_putline.30000644000000000000000000000162311507222726016201 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_PIO_PUTLINE" "3" "18 March 2003" "Gfarm" "" .SH NAME gfs_pio_putline \- output of a line .SH SYNOPSIS .sp \fB#include .sp char *gfs_pio_putline (GFS_File \fIgf\fB, char * \fIs\fB); \fR .SH "DESCRIPTION" .PP \fBgfs_pio_putline()\fR writes the string \fIs\fR and a trailing newline to \fIgf\fR. .SH "RETURN VALUES" .TP \fBNULL\fR The function terminated successfully. .TP \fBGFARM_ERR_NO_MEMORY\fR Insufficient memory was available. .TP \fBOthers\fR An error except the above occurred. The reason is shown by its pointed strings. .SH "SEE ALSO" .PP \fBgfs_pio_create\fR(3), \fBgfs_pio_open\fR(3) gfarm-2.4.1/man/man3/gfs_unlink_section.30000644000000000000000000000236711507222726016704 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_UNLINK_SECTION" "3" "13 November 2006" "Gfarm" "" .SH NAME gfs_unlink_section \- delete a file .SH SYNOPSIS .sp \fB#include .sp char *gfs_unlink_section (char * \fIgfarm_url\fB, char * \fIsection\fB); \fR .SH "DESCRIPTION" .PP \fBgfs_unlink_section()\fR deletes the file section whose name is the string specifiedby \fIgfarm_url\fR and \fIsection\fR\&. .SH "RETURN VALUES" .TP \fBNULL\fR The function terminated successfully. .TP \fBGFARM_ERR_NO_MEMORY\fR Insufficient memory was available. .TP \fBGFARM_ERR_AUTHENTICATION\fR User authentication failed when connecting to gfmd(8). .TP \fBGFARM_ERR_PERMISSION_DENIED\fR \fIgfarm_url\fR points outside your accessible address space. .TP \fBGFARM_ERR_NO_SUCH_OBJECT\fR \fIsection\fR of \fIgfarm_url\fR does not exist. .TP \fBGFARM_ERR_NOT_A_DIRECTORY\fR A component of the path prefix is not a directory. .TP \fBOthers\fR An error except the above occurred. The reason is shown by its pointed strings. gfarm-2.4.1/man/man3/gfs_pio_readdelim.30000644000000000000000000001145011507222726016446 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_PIO_READDELIM" "3" "13 May 2004" "Gfarm" "" .SH NAME gfs_pio_readdelim \- read one record .SH SYNOPSIS .sp \fB#include .sp char *gfs_pio_readdelim (GFS_File \fIf\fB, char **\fIbufp\fB, size_t *\fIsizep\fB, size_t *\fIlenp\fB, char *\fIdelimiter\fB, size_t \fIdelimlen\fB); \fR .SH "DESCRIPTION" .PP \fBgfs_pio_readdelim()\fR works like \fBgfs_pio_readline()\fR, except a delimiter of input records is not always newline, and can be specified. This function reads one record from the file specified by the parameter \fIgf\fR, by using the parameter \fIdelimiter\fR as the delimiter of the input records. You can include '\\0' character in the \fIdelimiter\fR, So, you have to specify the length of the \fIdelimiter\fR by the parameter \fIdelimlen\fR. If parameter \fIdelimiter\fR is NULL, this function reads entire file as one record. Otherwise, and if the parameter \fIdelimlen\fR is 0, this function treats two or more consecutive empty lines (/\\n\\n+/ in a regular expression) as the input delimiter. This feature is derived from INPUT_RECORD_SEPARATOR in perl language. .PP Parameter \fIbufp\fR specifies an address of a pointer variable initialzed by NULL at first. \fBgfs_pio_readdelim()\fR allocates a buffer for I/O dynamically, and stores the address of the buffer to this variable pointed by \fIbufp\fR. Parameter \fIsizep\fR specifies an address of a size_t variable initialized by 0. This size_t variable is used to record the size of the buffer. Or, you can specify a buffer allocated by malloc(3) in the variable pointed by the parameter \fIbufp\fR. In this case, you have to specify the size of the allocated buffer by the parameter \fIsizep\fR. If the length of the record exceeds the size of the buffer, the buffer will be automatically realloc(3)ed, and the variable pointed by \fIbufp\fR and \fIsizep\fR will be updated respectively. Note that you are responsible to free(3) this buffer. .PP This function returns the length of the record to a variable pointed by the parameter \fIlenp\fR. This length includes the length of the record delimiter. .PP This function doesn't remove the delimiter at the end of records. Also, despite that you can use the value returned by the variable pointed by \fIlenp\fR, this function always appends \\0' character at the end of records. .PP If the file reaches its end, the length of the result record becomes 0. .PP gfs_pio_readdelim(f, bufp, sizep, lenp, "\\n", 1) is equivalent to \fBgfs_pio_readline()\fR function. .SH "RETURN VALUES" .TP \fBNULL\fR The function terminated successfully. .TP \fBGFARM_ERR_NO_MEMORY\fR Insufficient memory was available. Note that you need to free(3) the buffer pointed by the parameter \fIbufp\fR .TP \fBOthers\fR An error except the above occurred. The reason is shown by its pointed strings. .SH "EXAMPLES" .SS "EXAMPLE OF GFS_PIO_READDELIM FUNCTION" .PP .nf #include #include #include #include int main(int argc, char **argv) { char *e; GFS_File gf; size_t bufsize = 0, delimlen = 1, len; char *buffer = NULL, *delim = "\\n"; e = gfarm_initialize(&argc, &argv); if (e != NULL) { fprintf(stderr, "gfarm_initialize: %s\\n", e); return (EXIT_FAILURE); } while ((c = getopt(argc, argv, "d:D")) != -1) { switch (c) { case 'd': delim = optarg; delimlen = strlen(optarg); break; case 'D': delim = NULL; delimlen = 0; break; case '?': default: fprintf(stderr, "invalid option: %c\\n", c); return (EXIT_FAILURE); } } if (optind >= argc) { fprintf(stderr, "missing gfarm filename\\n"); return (EXIT_FAILURE); } e = gfs_pio_open(argv[optind], GFARM_FILE_RDONLY, &gf); if (e != NULL) { fprintf(stderr, "%s: %s\\n", argv[optind], e); return (EXIT_FAILURE); } e = gfs_pio_set_view_global(gf, 0); if (e != NULL) { fprintf(stderr, "%s: gfs_pio_set_view_global: %s\\n", argv[optind], e); return (EXIT_FAILURE); } while ((e = gfs_pio_readdelim(gf, &buffer, &bufsize, &len, delim, delimlen)) == NULL && len > 0) { printf("<%6d/%6d >%s", len, bufsize, buffer); } if (buffer != NULL) free(buffer); if (e != NULL) { fprintf(stderr, "ERROR: %s\\n", e); return (EXIT_FAILURE); } e = gfs_pio_close(gf); if (e != NULL) { fprintf(stderr, "gfs_pio_close: %s\\n", e); return (EXIT_FAILURE); } e = gfarm_terminate(); if (e != NULL) { fprintf(stderr, "gfarm_initialize: %s\\n", e); return (EXIT_FAILURE); } return (EXIT_SUCCESS); } .fi .SH "SEE ALSO" .PP \fBgfs_pio_open\fR(3), \fBgfs_pio_getline\fR(3), \fBgfs_pio_gets\fR(3), \fBgfs_pio_readline\fR(3) gfarm-2.4.1/man/man3/gfs_rmdir.30000644000000000000000000000223111507222726014763 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_RMDIR" "3" "13 November 2006" "Gfarm" "" .SH NAME gfs_rmdir \- delete a directory .SH SYNOPSIS .sp \fB#include .sp char *gfs_rmdir (char * \fIgfarm_url\fB); \fR .SH "DESCRIPTION" .PP \fBgfs_rmdir()\fR deletes a directory whose name is the string specified by \fIgfarm_url\fR\&. The directory must be empty. .SH "RETURN VALUES" .TP \fBNULL\fR The function terminated successfully. .TP \fBGFARM_ERR_NO_MEMORY\fR Insufficient memory was available. .TP \fBGFARM_ERR_PERMISSION_DENIED\fR \fIgfarm_url\fR points outside your accessible address space. .TP \fBGFARM_ERR_DIRECTORY_NOT_EMPTY\fR Directory is not empty. .TP \fBGFARM_ERR_NO_SUCH_OBJECT\fR Directory does not exist. .TP \fBGFARM_ERR_NOT_A_DIRECTORY\fR A component of the path prefix is not a directory. .TP \fBOthers\fR An error except the above occurred. The reason is shown by its pointed strings. gfarm-2.4.1/man/man3/gfarm_strings_free_deeply.30000644000000000000000000000132511507222726020222 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFARM_STRINGS_FREE_DEEPLY" "3" "18 March 2003" "Gfarm" "" .SH NAME gfarm_strings_free_deeply \- free an array of strings .SH SYNOPSIS .sp \fB#include .sp void gfarm_strings_free_deeply (int \fIn\fB, char ** \fIstrings\fB); \fR .SH "DESCRIPTION" .PP \fBgfarm_string_free_deeply()\fR frees the memory space of an array of strings \fIstrings\fR with the size \fIn\fR. This also frees every string in the array. gfarm-2.4.1/man/man3/gfs_glob.30000644000000000000000000000303711507222726014576 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_GLOB" "3" "30 September 2003" "Gfarm" "" .SH NAME gfs_glob \- find path names matching a pattern .SH SYNOPSIS .sp \fB#include .sp char *gfs_glob (const char * \fIpattern\fB, gfarm_stringlist * \fIpaths\fB, gfs_glob_t * \fItypes\fB); \fR .SH "DESCRIPTION" .PP \fBgfs_glob()\fR searches for all the path names matching \fIpattern\fR that may include a wildcard, and returns \fIpaths\fR. .PP The returned path names are accessed by gfarm_stringlist_length(3) and gfarm_stringlist_elem(3). .PP It is necessary to allocate memory space dynamically pointed to by \fItypes\fR using \fBgfs_glob_init(3)\fR before calling \fBgfs_glob(3)\fR. The allocated memory space needs to be free'ed by gfs_glob_free(3). .SH "RETURN VALUES" .TP \fBNULL\fR The function terminated successfully. .TP \fBGFARM_ERR_NO_MEMORY\fR Insufficient memory was available. .TP \fBGFARM_ERR_PATHNAME_TOO_LONG\fR Too long pattern or path name to process. .TP \fBOthers\fR An error except the above occurred. The reason is shown by its pointed strings. .SH "SEE ALSO" .PP \fBgfs_glob_init\fR(3) \fBgfs_glob_free\fR(3) \fBgfarm_stringlist_init\fR(3) \fBgfarm_stringlist_length\fR(3) \fBgfarm_stringlist_elem\fR(3) \fBgfarm_stringlist_free\fR(3) \fBgfarm_stringlist_free_deeply\fR(3) gfarm-2.4.1/man/man3/gfs_stat_free.30000644000000000000000000000124511507222726015626 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_STAT_FREE" "3" "18 March 2003" "Gfarm" "" .SH NAME gfs_stat_free \- free dynamic memory of file status .SH SYNOPSIS .sp \fB#include .sp void gfs_stat_free (struct gfs_stat * \fIstatus\fB); \fR .SH "DESCRIPTION" .PP \fBgfs_stat_free()\fR frees frees the memory space of file status \fIstatus\fR allocated by gfs_stat(3). .SH "SEE ALSO" .PP \fBgfs_stat\fR(3) gfarm-2.4.1/man/man3/gfs_opendir.30000644000000000000000000000245411507222726015315 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_OPENDIR" "3" "29 October 2003" "Gfarm" "" .SH NAME gfs_opendir \- open a directory .SH SYNOPSIS .sp \fB#include .sp char *gfs_opendir (const char * \fIgfarm_url\fB, GFS_Dir * \fIdirp\fB); \fR .SH "DESCRIPTION" .PP The \fBgfs_opendir()\fR function opens a directory stream corresponding to the directory \fIgfarm_url\fR, and returns the directory stream to the address pointed by \fIdirp\fR. The stream is positioned at the first entry in the directory. .SH "RETURN VALUES" .TP \fBNULL\fR The function terminated successfully. .TP \fBGFARM_ERR_NO_MEMORY\fR Insufficient memory was available. .TP \fBGFARM_ERR_AUTHENTICATION\fR User authentication failed when connecting to gfmd(8). .TP \fBGFARM_ERR_PERMISSION_DENIED\fR \fIgfarm_url\fR points outside your accessible address space. .TP \fBGFARM_ERR_NO_SUCH_OBJECT\fR Directory does not exist. .TP \fBOthers\fR An error except the above occurred. The reason is shown by its pointed strings. .SH "SEE ALSO" .PP \fBgfs_closedir\fR(3), \fBgfs_readdir\fR(3) gfarm-2.4.1/man/man3/gfs_pio_open.30000644000000000000000000000710411507222726015462 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_PIO_OPEN" "3" "27 June 2010" "Gfarm" "" .SH NAME gfs_pio_open \- open a file in the Gfarm file system .SH SYNOPSIS .sp \fB#include .sp gfarm_error_t gfs_pio_open (const char * \fIgfarm_url\fB, int \fIflags\fB, GFS_File * \fIgfp\fB); \fR .SH "DESCRIPTION" .PP \fBgfs_pio_open()\fR opens a file in the Gfarm file system specified by \fIgfarm_url\fR, and returns a \fIGFS_File\fR structure to the address pointed by \fIgfp\fR\&. \fIgfarm_url\fR is a path name in the Gfarm file system, or a Gfarm URL in the form of gfarm://metaserver:port/path/name. .PP Values of \fIflags\fR are constructed by a bitwise-inclusive-OR of the following list. Exactly one of the first three values should be specified: .TP \fBGFARM_FILE_RDONLY\fR Open for reading only. .TP \fBGFARM_FILE_WRONLY\fR Open for writing only. .TP \fBGFARM_FILE_RDWR\fR Open for reading and writing. .TP \fBGFARM_FILE_TRUNC\fR If the file already exist and is a regular file, it will be truncated to length 0 if the open mode allows writing. .SH "RETURN VALUES" .TP \fBGFARM_ERR_NO_ERROR\fR The function terminated successfully. .TP \fBGFARM_ERR_IS_A_DIRECTORY\fR \fIgfarm_url\fR refers to a directory. .TP \fBGFARM_ERR_IS_A_SYMBOLIC_LINK\fR \fIgfarm_url\fR refers to a symbolic link. .TP \fBGFARM_ERR_OPERATION_NOT_PERMITTED\fR \fIgfarm_url\fR refers to not a regular file. .TP \fBGFARM_ERR_NO_SUCH_OBJECT\fR A component used as a directory in \fIgfarm_url\fR does not exist. .TP \fBGFARM_ERR_NOT_A_DIRECTORY\fR A component used as a directory in \fIgfarm_url\fR is not, in fact, a directory. .TP \fBGFARM_ERR_PERMISSION_DENIED\fR The requested access to the file is not allowed, or one of the directories in \fIgfarm_url\fR did not allow search (execute) permission. Or, the authentication to the metadata server fails. .TP \fBGFARM_ERR_NO_MEMORY\fR Insufficient memory was available. .TP \fBGFARM_ERR_INVALID_ARGUMENT\fR \fIflags\fR is not valid. .TP \fBGFARM_ERR_GFARM_URL_HOST_IS_MISSING\fR \fIgfarm_url\fR does not include a metadata server. .TP \fBGFARM_ERR_GFARM_URL_PORT_IS_MISSING\fR \fIgfarm_url\fR does not include a port number of the metadata server. .TP \fBGFARM_ERR_UNKNOWN_HOST\fR The metadata server cannot be resolved. .TP \fBGFARM_ERR_TOO_MANY_OPEN_FILES\fR The process opens too many files. .TP \fBGFARM_ERR_TOO_MANY_OPEN_FILES_IN_SYSTEM\fR The system limit on the total number of open files has been reached. .TP \fBGFARM_ERR_NETWORK_IS_UNREACHABLE\fR Network is unrechable. .TP \fBGFARM_ERR_OPERATION_TIMED_OUT\fR Connetion timeout occurs. .TP \fBGFARM_ERR_PROTOCOL\fR Protocol error occurs. .TP \fBGFARM_ERR_BROKEN_PIPE\fR Connection to the metadata server is broken. .TP \fBGFARM_ERR_PROTOCOL_NOT_SUPPORTED\fR Specified authentication protocol is not supported. .TP \fBGFARM_ERR_AUTHENTICATION\fR User authentication failed when connecting to the metadata server. .TP \fBOthers\fR An error except the above occurred. The reason is shown by \fBgfarm_error_string\fR(3)\&. .SH "SEE ALSO" .PP \fBgfs_pio_close\fR(3), \fBgfs_pio_create\fR(3), \fBgfs_pio_eof\fR(3), \fBgfs_pio_error\fR(3), \fBgfs_pio_flush\fR(3), \fBgfs_pio_getc\fR(3), \fBgfs_pio_getline\fR(3), \fBgfs_pio_open\fR(3), \fBgfs_pio_putc\fR(3), \fBgfs_pio_putline\fR(3), \fBgfs_pio_puts\fR(3), \fBgfs_pio_read\fR(3), \fBgfs_pio_seek\fR(3), \fBgfs_pio_ungetc\fR(3), \fBgfs_pio_write\fR(3) gfarm-2.4.1/man/man3/gfs_pio_gets.30000644000000000000000000000526711507222726015473 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_PIO_GETS" "3" "13 May 2004" "Gfarm" "" .SH NAME gfs_pio_gets \- read one line .SH SYNOPSIS .sp \fB#include .sp char *gfs_pio_gets (GFS_File \fIf\fB, char * \fIs\fB, size_t \fIsize\fB); \fR .SH "DESCRIPTION" .PP \fBgfs_pio_gets()\fR reads one line from the file specified by the parameter \fIgf\fR to the buffer specified by the parameter \fIs\fR. You need to specify the size of the buffer by the parameter \fIsize\fR. .PP Unlike gfs_pio_getline(3), this function doesn't remove newline character at the end of the buffer. But if whole contents of the line cannot be stored to the buffer due to its length, or if the file reaches the end without newline, there will be no newline at the end of the buffer. In any case, one '\\0' character is appended to the end of the buffer. .PP If the file reaches its end, the length of the string in the buffer becomes 0. .SH "RETURN VALUES" .TP \fBNULL\fR The function terminated successfully. .TP \fBGFARM_ERR_NO_MEMORY\fR Insufficient memory was available. .TP \fBOthers\fR An error except the above occurred. The reason is shown by its pointed strings. .SH "EXAMPLES" .SS "EXAMPLE OF GFS_PIO_GETS FUNCTION" .PP .nf #include #include #include int main(int argc, char **argv) { char *e; GFS_File gf; char buffer[512]; e = gfarm_initialize(&argc, &argv); if (e != NULL) { fprintf(stderr, "gfarm_initialize: %s\\n", e); return (EXIT_FAILURE); } if (argc <= 1) { fprintf(stderr, "missing gfarm filename\\n"); return (EXIT_FAILURE); } e = gfs_pio_open(argv[1], GFARM_FILE_RDONLY, &gf); if (e != NULL) { fprintf(stderr, "%s: %s\\n", argv[1], e); return (EXIT_FAILURE); } e = gfs_pio_set_view_global(gf, 0); if (e != NULL) { fprintf(stderr, "%s: gfs_pio_set_view_global: %s\\n", argv[1], e); return (EXIT_FAILURE); } while ((e = gfs_pio_gets(gf, buffer, sizeof buffer)) != NULL && *buffer != '\\0') { printf("got: %s", buffer); } if (e != NULL) { fprintf(stderr, "ERROR: %s\\n", e); return (EXIT_FAILURE); } e = gfs_pio_close(gf); if (e != NULL) { fprintf(stderr, "gfs_pio_close: %s\\n", e); return (EXIT_FAILURE); } e = gfarm_terminate(); if (e != NULL) { fprintf(stderr, "gfarm_initialize: %s\\n", e); return (EXIT_FAILURE); } return (EXIT_SUCCESS); } .fi .SH "SEE ALSO" .PP \fBgfs_pio_open\fR(3), \fBgfs_pio_getline\fR(3), \fBgfs_pio_readline\fR(3), \fBgfs_pio_readdelim\fR(3) gfarm-2.4.1/man/man3/gfs_pio_readline.30000644000000000000000000000732011507222726016304 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_PIO_READLINE" "3" "13 May 2004" "Gfarm" "" .SH NAME gfs_pio_readline \- read one line .SH SYNOPSIS .sp \fB#include .sp char *gfs_pio_readline (GFS_File \fIf\fB, char **\fIbufp\fB, size_t *\fIsizep\fB, size_t *\fIlenp\fB); \fR .SH "DESCRIPTION" .PP \fBgfs_pio_readline()\fR reads one line from the file specified by the parameter \fIgf\fR. .PP Parameter \fIbufp\fR specifies an address of a pointer variable initialzed by NULL at first. \fBgfs_pio_readline()\fR allocates a buffer for I/O dynamically, and stores the address of the buffer to this variable pointed by \fIbufp\fR. Parameter \fIsizep\fR specifies an address of a size_t variable initialized by 0. This size_t variable is used to record the size of the buffer. Or, you can specify a buffer allocated by malloc(3) in the variable pointed by the parameter \fIbufp\fR. In this case, you have to specify the size of the allocated buffer by the parameter \fIsizep\fR. If the length of the line exceeds the size of the buffer, the buffer will be automatically realloc(3)ed, and the variable pointed by \fIbufp\fR and \fIsizep\fR will be updated respectively. Note that you are responsible to free(3) this buffer. .PP This function returns the length of the line to a variable pointed by the parameter \fIlenp\fR. This length includes newline character. .PP Just like gfs_pio_gets(3), this function doesn't remove newline character at the end of lines. Also, this function always appends '\\0' at the end of strings. You can deal with lines which include '\\0' character by using the variable pointed by the parameter \fIlenp\fR. .PP If the file reaches its end, the length of the result string becomes 0. .PP This function is equivalent to gfs_pio_readdelim(f, bufp, sizep, lenp, "\\n", 1). .SH "RETURN VALUES" .TP \fBNULL\fR The function terminated successfully. .TP \fBGFARM_ERR_NO_MEMORY\fR Insufficient memory was available. Note that you need to free(3) the buffer pointed by the parameter \fIbufp\fR .TP \fBOthers\fR An error except the above occurred. The reason is shown by its pointed strings. .SH "EXAMPLES" .SS "EXAMPLE OF GFS_PIO_READLINE FUNCTION" .PP .nf #include #include #include int main(int argc, char **argv) { char *e; GFS_File gf; size_t bufsize = 0, len; char *buffer = NULL; e = gfarm_initialize(&argc, &argv); if (e != NULL) { fprintf(stderr, "gfarm_initialize: %s\\n", e); return (EXIT_FAILURE); } if (argc <= 1) { fprintf(stderr, "missing gfarm filename\\n"); return (EXIT_FAILURE); } e = gfs_pio_open(argv[1], GFARM_FILE_RDONLY, &gf); if (e != NULL) { fprintf(stderr, "%s: %s\\n", argv[1], e); return (EXIT_FAILURE); } e = gfs_pio_set_view_global(gf, 0); if (e != NULL) { fprintf(stderr, "%s: gfs_pio_set_view_global: %s\\n", argv[1], e); return (EXIT_FAILURE); } while ((e = gfs_pio_readline(gf, &buffer, &bufsize, &len)) == NULL && len > 0) { printf("<%6d/%6d >%s", len, bufsize, buffer); } if (buffer != NULL) free(buffer); if (e != NULL) { fprintf(stderr, "ERROR: %s\\n", e); return (EXIT_FAILURE); } e = gfs_pio_close(gf); if (e != NULL) { fprintf(stderr, "gfs_pio_close: %s\\n", e); return (EXIT_FAILURE); } e = gfarm_terminate(); if (e != NULL) { fprintf(stderr, "gfarm_initialize: %s\\n", e); return (EXIT_FAILURE); } return (EXIT_SUCCESS); } .fi .SH "SEE ALSO" .PP \fBgfs_pio_open\fR(3), \fBgfs_pio_getline\fR(3), \fBgfs_pio_gets\fR(3), \fBgfs_pio_readdelim\fR(3) gfarm-2.4.1/man/man3/gfs_pio_sync.30000644000000000000000000000217011507222726015473 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_PIO_SYNC" "3" "01 June 2005" "Gfarm" "" .SH NAME gfs_pio_sync \- output a file's data on memroy to disk .SH SYNOPSIS .sp \fB#include .sp char *gfs_pio_sync (GFS_File \fIgf\fB); \fR .SH "DESCRIPTION" .PP The function \fBgfs_pio_sync\fR copies data on memory of the \fIgf\fR, and waits for the I/O to complete before returning. It also updates metadtata stat information, while another function \fBgfs_pio_datasync\fR does not update the metadata. .SH "RETURN VALUES" .TP \fBNULL\fR The function terminated successfully. .TP \fBGFARM_ERR_NO_MEMORY\fR Insufficient memory was available. .TP \fBOthers\fR An error except the above occurred. The reason is shown by its pointed strings. .SH "SEE ALSO" .PP \fBgfs_pio_datasync\fR(3), \fBgfs_pio_create\fR(3), \fBgfs_pio_open\fR(3), \fBgfs_pio_write\fR(3), \fBgfs_pio_flush\fR(3) gfarm-2.4.1/man/man3/gfs_pio_getc.30000644000000000000000000000170311507222726015442 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_PIO_GETC" "3" "18 March 2003" "Gfarm" "" .SH NAME gfs_pio_getc \- input of a charactor .SH SYNOPSIS .sp \fB#include .sp int gfs_pio_getc (GFS_File \fIgf\fB); \fR .SH "DESCRIPTION" .PP \fBgfs_pio_getc()\fR reads the next character from \fIgf\fR. .SH "RETURN VALUES" .TP \fBEOF\fR \fBgfs_pio_getc()\fR encountered end of file or error. EOF is defined in . \fBgfs_pio_error(3)\fR is used to know end of file or error. .TP \fBOthers\fR \fBgfs_pio_getc()\fR returns the next character from the file. .SH "SEE ALSO" .PP \fBgfs_pio_create\fR(3), \fBgfs_pio_eof\fR(3), \fBgfs_pio_error\fR(3), \fBgfs_pio_open\fR(3), \fBgfs_pio_ungetc\fR(3) gfarm-2.4.1/man/man3/gfs_pio_error.30000644000000000000000000000153411507222726015653 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_PIO_ERROR" "3" "18 March 2003" "Gfarm" "" .SH NAME gfs_pio_error \- check file status .SH SYNOPSIS .sp \fB#include .sp char *gfs_pio_error (GFS_File \fIgf\fB); \fR .SH "DESCRIPTION" .PP The function \fBgfs_pio_error()\fR tests the error indicator for the file pointed to by \fIgf\fR, returning non-zero if it is set. .SH "RETURN VALUES" .TP \fBNULL\fR There is no error. .TP \fBOthers\fR An error occurred. The reason is shown by its pointed strings. .SH "SEE ALSO" .PP \fBgfs_pio_create\fR(3), \fBgfs_pio_eof\fR(3), \fBgfs_pio_open\fR(3) gfarm-2.4.1/man/man3/gfs_pio_set_view_local.30000644000000000000000000000404011507222726017514 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_PIO_SET_VIEW_LOCAL" "3" "18 March 2003" "Gfarm" "" .SH NAME gfs_pio_set_view_local \- change file view to the corresponding fragment .SH SYNOPSIS .sp \fB#include .sp char *gfs_pio_set_view_local (GFS_File \fIgf\fB, int \fIflags\fB); \fR .SH "DESCRIPTION" .PP \fBgfs_pio_set_view_local()\fR changes the process's view of the data in the file specified by \fIgf\fR to a file fragment in the local file view. The local file view model assumes each process has its own file fragment which is specified by the argument \fInode\fR of \fBgfs_pio_set_local(3)\fR. .PP The total number of file fragments is also specified by the argument \fInnode\fR of \fBgfs_pio_set_local(3)\fR. If it is different from the total fragment number of the existent file, it is erroneous. .PP Before changing to the local file view, it is necessary to call \fBgfs_pio_set_local(3)\fR in advance. .PP Values of \fIflag\fR are constructed by a bitwise-inclusive-OR of GFARM_FILE_SEQUENTIAL, GFARM_FILE_REPLICATE, and GFARM_FILE_NOT_REPLICATE. For details, refer to \fBgfs_pio_set_view_index(3)\fR. .PP By default, Gfarm files are accessed as a whole file in global file view where each fragment can be seamlessly accessed. .SH "RETURN VALUES" .TP \fBNULL\fR The function terminated successfully. .TP \fBGFARM_ERR_NO_MEMORY\fR Insufficient memory was available. .TP \fBGFARM_ERR_OPERATION_NOT_PERMITTED\fR The file is not a fragmented file. .TP \fBGFARM_ERR_FRAGMENT_NUMBER_DOES_NOT_MATCH\fR The total number of file fragments is different from the existence one. .TP \fBOthers\fR An error except the above occurred. The reason is shown by its pointed strings. .SH "SEE ALSO" .PP \fBgfs_pio_create\fR(3), \fBgfs_pio_open\fR(3), \fBgfs_pio_set_local\fR(3), \fBgfs_pio_set_view_index\fR(3) gfarm-2.4.1/man/man3/gfarm_url_section_replicate_from_to.30000644000000000000000000000347311507222726022277 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFARM_URL_SECTION_REPLICATE_FROM_TO" "3" "06 September 2005" "Gfarm" "" .SH NAME gfarm_url_section_replicate_from_to \- Create a file replica of a file section .SH SYNOPSIS .sp \fB#include .sp char *gfarm_url_section_replicate_from_to (const char *\fIgfarm_url\fB, char *\fIsection\fB, char *\fIsrchost\fB, char *\fIdsthost\fB); \fR .SH "DESCRIPTION" .PP \fBgfarm_url_section_replicate_from_to()\fR creates a file replica of a file section \fIsection\fR of a file \fIgfarm_url\fR from a source host \fIsrchost\fR to a destination host \fIdsthost\fR. .PP File section is an architecture name for executable files, or is a fragment index for a regular file. Note that a fragment index needs to be specified in string without any unnecessary space character and zero padding. .PP When there is no file copy on a host specified by \fIsrchost\fR, \fBgfarm_url_section_replicate_from_to()\fR returns error. .SH "RETURN VALUES" .TP \fBNULL\fR The function terminated successfully. .TP \fBGFARM_ERR_NO_MEMORY\fR Insufficient memory was available. .TP \fBGFARM_ERR_NO_SUCH_OBJECT\fR A component used as a directory in \fIgfarm_url\fR does not exist, or a file copy does not exist on the specified source host. .TP \fBGFARM_ERR_TEXT_FILE_BUSY\fR The file \fIgfarm_url\fR cannot be replicated because it is being updated by another process. .TP \fBOthers\fR An error except the above occurred. The reason is shown by its pointed strings. .SH "SEE ALSO" .PP \fBgfarm_url_section_replicate_to\fR(3), \fBgfarm_url_fragments_replicate\fR(3) gfarm-2.4.1/man/man3/gfs_readdir.30000644000000000000000000000212011507222726015255 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_READDIR" "3" "04 December 2003" "Gfarm" "" .SH NAME gfs_readdir \- read directory entry .SH SYNOPSIS .sp \fB#include .sp char *gfs_readdir (GFS_Dir \fIdir\fB, struct gfs_dirent ** \fIentryp\fB); \fR .SH "DESCRIPTION" .PP The \fBgfs_readdir()\fR function reads a directory entry from \fIdir\fR, and returns the pointer of the entry to the address pointed to by \fIentryp\fR. The buffer pointed to by \fIentryp\fR is destroyed when calling succeeding \fBgfs_readdir()\fR or \fBgfs_closedir()\fR with the same argument \fIdir\fR. .SH "RETURN VALUES" .TP \fBNULL\fR The function terminated successfully. .TP \fBOthers\fR An error except the above occurred. The reason is shown by its pointed strings. .SH "SEE ALSO" .PP \fBgfs_closedir\fR(3), \fBgfs_opendir\fR(3), \fBgfs_readdir\fR(3) gfarm-2.4.1/man/man3/gfs_pio_create.30000644000000000000000000000703211507222726015764 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_PIO_CREATE" "3" "27 June 2010" "Gfarm" "" .SH NAME gfs_pio_create \- create a file in the Gfarm file system .SH SYNOPSIS .sp \fB#include .sp gfarm_error_t gfs_pio_create (const char * \fIgfarm_url\fB, int \fIflags\fB, gfarm_mode_t \fImode\fB, GFS_File * \fIgfp\fB); \fR .SH "DESCRIPTION" .PP \fBgfs_pio_create()\fR creates a new file in the Gfarm file system whose name is the string pointed to by \fIgfarm_url\fR with the access mode \fImode\fR, and returns a \fIGFS_File\fR structure to the address pointed to by \fIgfp\fR\&. \fIMode\fR specifies the file permissions to be created, and is modified by the process's umask\&. .PP The \fIflags\fR argument has the same meaning as the second argument of \fBgfs_pio_open()\fR, including the point such that exactly one of \fIGFARM_FILE_RDONLY\fR, \fIGFARM_FILE_WRONLY\fR, and \fIGFARM_FILE_RDWR\fR should be specified. .PP Note that \fIGFARM_FILE_TRUNC\fR must be explicitly specified by the \fIflags\fR argument if needed. .SH "RETURN VALUES" .TP \fBGFARM_ERR_NO_ERROR\fR The function terminated successfully. .TP \fBGFARM_ERR_IS_A_DIRECTORY\fR \fIgfarm_url\fR refers to a directory. .TP \fBGFARM_ERR_IS_A_SYMBOLIC_LINK\fR \fIgfarm_url\fR refers to a symbolic link. .TP \fBGFARM_ERR_OPERATION_NOT_PERMITTED\fR \fIgfarm_url\fR refers to not a regular file. .TP \fBGFARM_ERR_NOT_A_DIRECTORY\fR A component used as a directory in \fIgfarm_url\fR is not, in fact, a directory. .TP \fBGFARM_ERR_PERMISSION_DENIED\fR The requested access to the file is not allowed, or one of the directories in \fIgfarm_url\fR did not allow search (execute) permission, or the file did not exist yet and write access to the parent directory is not allowed. Or, the authentication to the metadata server fails. .TP \fBGFARM_ERR_NO_MEMORY\fR Insufficient memory was available. .TP \fBGFARM_ERR_INVALID_ARGUMENT\fR \fIflags\fR is not valid. .TP \fBGFARM_ERR_GFARM_URL_HOST_IS_MISSING\fR \fIgfarm_url\fR does not include a metadata server. .TP \fBGFARM_ERR_GFARM_URL_PORT_IS_MISSING\fR \fIgfarm_url\fR does not include a port number of the metadata server. .TP \fBGFARM_ERR_UNKNOWN_HOST\fR The metadata server cannot be resolved. .TP \fBGFARM_ERR_TOO_MANY_OPEN_FILES\fR The process opens too many files. .TP \fBGFARM_ERR_TOO_MANY_OPEN_FILES_IN_SYSTEM\fR The system limit on the total number of open files has been reached. .TP \fBGFARM_ERR_NETWORK_IS_UNREACHABLE\fR Network is unrechable. .TP \fBGFARM_ERR_OPERATION_TIMED_OUT\fR Connetion timeout occurs. .TP \fBGFARM_ERR_PROTOCOL\fR Protocol error occurs. .TP \fBGFARM_ERR_BROKEN_PIPE\fR Connection to the metadata server is broken. .TP \fBGFARM_ERR_PROTOCOL_NOT_SUPPORTED\fR Specified authentication protocol is not supported. .TP \fBGFARM_ERR_AUTHENTICATION\fR User authentication failed when connecting to the metadata server. .TP \fBOthers\fR An error except the above occurred. The reason is shown by \fBgfarm_error_string\fR(3)\&. .SH "SEE ALSO" .PP \fBgfs_pio_close\fR(3), \fBgfs_pio_create\fR(3), \fBgfs_pio_eof\fR(3), \fBgfs_pio_error\fR(3), \fBgfs_pio_flush\fR(3), \fBgfs_pio_getc\fR(3), \fBgfs_pio_getline\fR(3), \fBgfs_pio_open\fR(3), \fBgfs_pio_putc\fR(3), \fBgfs_pio_putline\fR(3), \fBgfs_pio_puts\fR(3), \fBgfs_pio_read\fR(3), \fBgfs_pio_seek\fR(3), \fBgfs_pio_ungetc\fR(3), \fBgfs_pio_write\fR(3) gfarm-2.4.1/man/man3/gfarm_initialize.30000644000000000000000000000356311507222726016335 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFARM_INITIALIZE" "3" "26 June 2010" "Gfarm" "" .SH NAME gfarm_initialize \- initialize the Gfarm execution environment for client .SH SYNOPSIS .sp \fB#include .sp gfarm_error_t gfarm_initialize (int *\fIargcp\fB, char *** \fIargvp\fB); \fR .SH "DESCRIPTION" .PP \fBgfarm_initialize()\fR initializes the Gfarm execution environment for client application. This function should be called before any Gfarm library API. \fIargcp\fR is a pointer to the number of arguments and \fIargvp\fR is a pointer to the argument vector. .SH "RETURN VALUES" .TP \fBGFARM_ERR_NO_ERROR\fR The function terminated successfully. .TP \fBGFARM_ERR_NO_MEMORY\fR Insufficient memory was available. .TP \fBGFARM_ERR_UNKNOWN_HOST\fR The metadata server cannot be resolved. .TP \fBGFARM_ERR_NETWORK_IS_UNREACHABLE\fR Network is unrechable. .TP \fBGFARM_ERR_OPERATION_TIMED_OUT\fR Connetion timeout occurs. .TP \fBGFARM_ERR_PROTOCOL\fR Protocol error occurs. .TP \fBGFARM_ERR_BROKEN_PIPE\fR Connection to the metadata server is broken. .TP \fBGFARM_ERR_PERMISSION_DENIED\fR The requested access to the file is not allowed, or one of the directories in \fIgfarm_url\fR did not allow search (execute) permission. Or, the authentication to the metadata server fails. .TP \fBGFARM_ERR_PROTOCOL_NOT_SUPPORTED\fR Specified authentication protocol is not supported. .TP \fBGFARM_ERR_AUTHENTICATION\fR User authentication failed when connecting to the metadata server. .TP \fBOthers\fR An error except the above occurred. The reason is shown by its \fBgfarm_error_string\fR(3)\&. .SH "SEE ALSO" .PP \fBgfarm_terminate\fR(3) gfarm-2.4.1/man/man3/gfs_pio_getline.30000644000000000000000000000224511507222726016151 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_PIO_GETLINE" "3" "18 March 2003" "Gfarm" "" .SH NAME gfs_pio_getline \- read a line .SH SYNOPSIS .sp \fB#include .sp char *gfs_pio_getline (GFS_File \fIf\fB, char * \fIs\fB, size_t \fIsize\fB, int * \fIeofp\fB); \fR .SH "DESCRIPTION" .PP \fBgfs_pio_getline()\fR reads a line from the file \fIgf\fR, and stores to the buffer starting at \fIs\fR at most \fIsize\fR - 1 bytes. It is indistinguishable whether the length of a line is more than \fIsize\fR or equal to \fIsize\fR - 1. It sets 1 into the address pointed by \fIeofp\fR on end of file, otherwise it sets 0. .SH "RETURN VALUES" .TP \fBNULL\fR The function terminated successfully. .TP \fBGFARM_ERR_NO_MEMORY\fR Insufficient memory was available. .TP \fBOthers\fR An error except the above occurred. The reason is shown by its pointed strings. .SH "SEE ALSO" .PP \fBgfs_pio_create\fR(3), \fBgfs_pio_open\fR(3) gfarm-2.4.1/man/man3/gfs_chmod.30000644000000000000000000000372211507222726014746 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_CHMOD" "3" "13 November 2006" "Gfarm" "" .SH NAME gfs_chmod \- change permissions of a file .SH SYNOPSIS .sp \fB#include .sp char *gfs_chmod (char * \fIgfarm_url\fB, mode_t \fImode\fB); \fR .SH "DESCRIPTION" .PP \fBgfs_chmod()\fR changes the mode of the file given by \fIgfarm_url\fR\&. Permission bit masks of \fImode\fR are similar to ones of mode parameter to \fBchmod(2)\fR, though only the least 9 bit are effective. .PP An executable file cannot be changed to a non-executable file and vice versa, unless the number of fragment of the file is only one. In detail, a file has multiple fragments with any execution bit should not be changed to that with no execution bit. It is necessary to have at least one execution bit. Similarly, a file has multiple fragments with no execution bit should not be changed to that with any execution bit. .SH "RETURN VALUES" .TP \fBNULL\fR The function terminated successfully. .TP \fBGFARM_ERR_NO_MEMORY\fR Insufficient memory was available. .TP \fBGFARM_ERR_AUTHENTICATION\fR User authentication failed when connecting to gfmd(8) or gfsd(8). .TP \fBGFARM_ERR_PERMISSION_DENIED\fR The parent directory of \fIgfarm_url\fR did not allow write permission. .TP \fBGFARM_ERR_OPERATION_NOT_PERMITTED\fR The effective UID does not match the owner of the file, and is not zero. Or an attempt was made to change an executable file with more than one fragment to a non-executable file, or vice versa. .TP \fBGFARM_ERR_NO_SUCH_OBJECT\fR The file does not exist. .TP \fBGFARM_ERR_NOT_A_DIRECTORY\fR A component of the path prefix is not a directory. .TP \fBOthers\fR An error except the above occurred. The reason is shown by its pointed strings. gfarm-2.4.1/man/man3/gfs_pio_set_local.30000644000000000000000000000170511507222726016467 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_PIO_SET_LOCAL" "3" "18 March 2003" "Gfarm" "" .SH NAME gfs_pio_set_local \- initialize the local file view environment .SH SYNOPSIS .sp \fB#include .sp char *gfs_pio_set_local (int \fInode\fB, int \fInnode\fB); \fR .SH "DESCRIPTION" .PP \fBgfs_pio_set_local()\fR initializes the environment for the local file view with the node number \fInode\fR and the total number of nodes \fInnode\fR. .SH "RETURN VALUES" .TP \fBNULL\fR The function terminated successfully. .TP \fBOthers\fR An error except the above occurred. The reason is shown by its pointed strings. .SH "SEE ALSO" .PP \fBgfs_pio_set_view_local\fR(3), \fBgfs_pio_set_view_index\fR(3) gfarm-2.4.1/man/man3/gfs_glob_add.30000644000000000000000000000150611507222726015405 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_GLOB_ADD" "3" "11 September 2003" "Gfarm" "" .SH NAME gfs_glob_add \- adds the type of path name .SH SYNOPSIS .sp \fB#include .sp char *gfs_glob_add (gfs_glob_t * \fIlistp\fB, int \fIdtype\fB); \fR .SH "DESCRIPTION" .PP \fBgfs_glob_add()\fR adds the type of path name \fIdtype\fR to \fIlistp\fR. .SH "RETURN VALUES" .TP \fBNULL\fR The function terminated successfully. .TP \fBGFARM_ERR_NO_MEMORY\fR Insufficient memory was available. .SH "SEE ALSO" .PP \fBgfs_glob_init\fR(3) \fBgfs_glob\fR(3) \fBgfs_glob_free\fR(3) gfarm-2.4.1/man/man3/gfarm_url_fragments_replicate.30000644000000000000000000000264611507222726021075 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFARM_URL_FRAGMENTS_REPLICATE" "3" "06 September 2005" "Gfarm" "" .SH NAME gfarm_url_fragments_replicate \- Create a file replica of a file .SH SYNOPSIS .sp \fB#include .sp char *gfarm_url_fragments_replicate (const char *\fIgfarm_url\fB, int \fIndsthosts\fB, char **\fIdsthosts\fB); \fR .SH "DESCRIPTION" .PP \fBgfarm_url_fragments_replicate()\fR creates a file replica of a file \fIgfarm_url\fR to destination hosts specified by a string array \fIdsthosts\fR with a length \fIndsthosts\fR. It cannot replicate an executable file. .PP When the total number of file fragments is greater than the specified total number of hosts \fIndsthosts\fR, destination hosts are allocated in round robin. .SH "RETURN VALUES" .TP \fBNULL\fR The function terminated successfully. .TP \fBGFARM_ERR_NO_MEMORY\fR Insufficient memory was available. .TP \fBGFARM_ERR_OPERATION_NOT_PERMITTED\fR The file is not a regular fragmented file. .TP \fBOthers\fR An error except the above occurred. The reason is shown by its pointed strings. .SH "SEE ALSO" .PP \fBgfarm_url_section_replicate_from_to\fR(3), \fBgfarm_url_section_replicate_from_to\fR(3) gfarm-2.4.1/man/man3/Makefile0000644000000000000000000000052011507222726014362 0ustar rootroot# $Id: Makefile 2373 2006-01-12 00:54:22Z soda $ top_builddir = ../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk DOCBOOK_DIR=$(top_srcdir)/doc/docbook/en/ref/man3 include $(DOCBOOK_DIR)/Makefile.inc MAN = $(DOCBOOK) EXTRA_CLEAN_TARGETS = manpage.links manpage.refs include $(top_srcdir)/makes/man.mk gfarm-2.4.1/man/man3/gfs_unlink.30000644000000000000000000000222711507222726015153 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_UNLINK" "3" "13 November 2006" "Gfarm" "" .SH NAME gfs_unlink \- delete a file .SH SYNOPSIS .sp \fB#include .sp char *gfs_unlink (char * \fIgfarm_url\fB); \fR .SH "DESCRIPTION" .PP \fBgfs_unlink()\fR deletes the file whose name is the string specified by \fIgfarm_url\fR\&. .SH "RETURN VALUES" .TP \fBNULL\fR The function terminated successfully. .TP \fBGFARM_ERR_NO_MEMORY\fR Insufficient memory was available. .TP \fBGFARM_ERR_AUTHENTICATION\fR User authentication failed when connecting to gfmd(8). .TP \fBGFARM_ERR_PERMISSION_DENIED\fR \fIgfarm_url\fR points outside your accessible address space. .TP \fBGFARM_ERR_NO_SUCH_OBJECT\fR \fIgfarm_url\fR does not exist. .TP \fBGFARM_ERR_NOT_A_DIRECTORY\fR A component of the path prefix is not a directory. .TP \fBOthers\fR An error except the above occurred. The reason is shown by its pointed strings. gfarm-2.4.1/man/man3/gfs_stat.30000644000000000000000000000264111507222726014626 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_STAT" "3" "04 December 2003" "Gfarm" "" .SH NAME gfs_stat \- get file status .SH SYNOPSIS .sp \fB#include .sp char *gfs_stat (const char * \fIgfarm_url\fB, struct gfs_stat * \fIstatus\fB); \fR .SH "DESCRIPTION" .PP \fBgfs_stat()\fR return information about the specified file pointed to by \fIgfarm_url\fR, and fills in the buffer pointed to by \fIstatus\fR. Since \fIstatus\fR includes a pointer to dynamically allocated memory space, it is necessary to free the memory space by gfs_stat_free(3). .SH "RETURN VALUES" .TP \fBNULL\fR The function terminated successfully. .TP \fBGFARM_ERR_NO_MEMORY\fR Insufficient memory was available. .TP \fBGFARM_ERR_AUTHENTICATION\fR User authentication failed when connecting to gfmd(8). .TP \fBGFARM_ERR_PERMISSION_DENIED\fR \fIgfarm_url\fR points outside your accessible address space. .TP \fBGFARM_ERR_NO_SUCH_OBJECT\fR \fIgfarm_url\fR does not exist. .TP \fBGFARM_ERR_NOT_A_DIRECTORY\fR A component of the path prefix is not a directory. .TP \fBOthers\fR An error except the above occurred. The reason is shown by its pointed strings. .SH "SEE ALSO" .PP \fBgfs_stat_free\fR(3) gfarm-2.4.1/man/man3/gfs_glob_init.30000644000000000000000000000174411507222726015624 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_GLOB_INIT" "3" "11 September 2003" "Gfarm" "" .SH NAME gfs_glob_init \- allocates memory for types of path names .SH SYNOPSIS .sp \fB#include .sp char *gfs_glob_init (gfs_glob_t * \fIlistp\fB); \fR .SH "DESCRIPTION" .PP \fBgfs_glob_init()\fR allocates memory space for \fBgfs_glob(3)\fR and \fBgfs_glob_add(3)\fR. The memory space is stored to \fIlistp\fR. .SH "RETURN VALUES" .TP \fBNULL\fR The function terminated successfully. .TP \fBGFARM_ERR_NO_MEMORY\fR Insufficient memory was available. .TP \fBOthers\fR An error except the above occurred. The reason is shown by its pointed strings. .SH "SEE ALSO" .PP \fBgfs_glob\fR(3) \fBgfs_glob_add\fR(3) \fBgfs_glob_free\fR(3) gfarm-2.4.1/man/man3/gfs_pio_close.30000644000000000000000000000207711507222726015632 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_PIO_CLOSE" "3" "27 June 2010" "Gfarm" "" .SH NAME gfs_pio_close \- close a file in the Gfarm file system .SH SYNOPSIS .sp \fB#include .sp gfarm_error_t gfs_pio_close (GFS_File \fIgfp\fB); \fR .SH "DESCRIPTION" .PP \fBgfs_pio_close()\fR closes a file \fIgfp\fR, so that it no longer refers to any file and may be reused. .SH "RETURN VALUES" .TP \fBGFARM_ERR_NO_ERROR\fR The function terminated successfully. .TP \fBGFARM_ERR_BAD_FILE_DESCRIPTOR\fR The file descripter specified by \fIgfp\fR is not a valid open file descriptor. .TP \fBGFARM_ERR_NO_MEMORY\fR Insufficient memory was available. .TP \fBOthers\fR An error except the above occurred. The reason is shown by \fBgfarm_error_string\fR(3)\&. .SH "SEE ALSO" .PP \fBgfs_pio_create\fR(3), \fBgfs_pio_open\fR(3) gfarm-2.4.1/man/man3/gfarm_url_section_replicate_to.30000644000000000000000000000307011507222726021245 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFARM_URL_SECTION_REPLICATE_TO" "3" "06 September 2005" "Gfarm" "" .SH NAME gfarm_url_section_replicate_to \- Create a file replica of a file section .SH SYNOPSIS .sp \fB#include .sp char *gfarm_url_section_replicate_to (const char *\fIgfarm_url\fB, char *\fIsection\fB, char *\fIdsthost\fB); \fR .SH "DESCRIPTION" .PP \fBgfarm_url_section_replicate_to()\fR creates a file replica of a file section \fIsection\fR of a file \fIgfarm_url\fR to a destination host \fIdsthost\fR. .PP File section is an architecture name for executable files, or is a fragment index for a regular file. Note that a fragment index needs to be specified in string without any unnecessary space character and zero padding. .SH "RETURN VALUES" .TP \fBNULL\fR The function terminated successfully. .TP \fBGFARM_ERR_NO_MEMORY\fR Insufficient memory was available. .TP \fBGFARM_ERR_NO_SUCH_OBJECT\fR A component used as a directory in \fIgfarm_url\fR does not exist. .TP \fBGFARM_ERR_TEXT_FILE_BUSY\fR The file \fIgfarm_url\fR cannot be replicated because it is being updated by another process. .TP \fBOthers\fR An error except the above occurred. The reason is shown by its pointed strings. .SH "SEE ALSO" .PP \fBgfarm_url_section_replicate_from_to\fR(3), \fBgfarm_url_fragments_replicate\fR(3) gfarm-2.4.1/man/man3/gfs_pio_puts.30000644000000000000000000000156211507222726015516 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_PIO_PUTS" "3" "18 March 2003" "Gfarm" "" .SH NAME gfs_pio_puts \- output of a string .SH SYNOPSIS .sp \fB#include .sp char *gfs_pio_puts (GFS_File \fIgf\fB, char * \fIs\fB); \fR .SH "DESCRIPTION" .PP \fBgfs_pio_puts()\fR writes the string \fIs\fR to \fIgf\fR. .SH "RETURN VALUES" .TP \fBNULL\fR The function terminated successfully. .TP \fBGFARM_ERR_NO_MEMORY\fR Insufficient memory was available. .TP \fBOthers\fR An error except the above occurred. The reason is shown by its pointed strings. .SH "SEE ALSO" .PP \fBgfs_pio_create\fR(3), \fBgfs_pio_open\fR(3) gfarm-2.4.1/man/man3/gfs_rename.30000644000000000000000000000352711507222726015126 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_RENAME" "3" "13 November 2006" "Gfarm" "" .SH NAME gfs_rename \- change the name or location of a file .SH SYNOPSIS .sp \fB#include .sp char *gfs_rename (char * \fIgfarm_url_from\fB, char * \fIgfarm_url_to\fB); \fR .SH "DESCRIPTION" .PP \fBgfs_rename\fR renames a file or directory \fIgfarm_url_from\fR to \fIgfarm_url_to\fR\&. .PP If \fIgfarm_url_to\fR already exists, it will be replaced. In this case, when \fIgfarm_url_from\fR is a file \fIgfarm_url_to\fR also must be a file, when \fIgfarm_url_from\fR is a directory, \fIgfarm_url_to\fR must be a empty directory. .PP \fBGfs_rename()\fR can't rename a directory to a subdirectory of itself. .SH "RETURN VALUES" .TP \fBNULL\fR The function terminated successfully. .TP \fBGFARM_ERR_NO_MEMORY\fR Insufficient memory was available. .TP \fBGFARM_ERR_AUTHENTICATION\fR User authentication failed when connecting to gfmd(8). .TP \fBGFARM_ERR_PERMISSION_DENIED\fR The parent directory of \fIgfarm_url_from\fR or \fIgfarm_url_to\fR did not allow write permission. .TP \fBGFARM_ERR_INVALID_ARGUMENT\fR A attempt was made to rename the directory \fIgfarm_url_from\fR to a subdirectory of itself. .TP \fBGFARM_ERR_NO_SUCH_OBJECT\fR \fIgfarm_url_from\fR does not exist. .TP \fBGFARM_ERR_IS_A_DIRECTORY\fR \fIgfarm_url_to\fR is a existing directory, though \fIgfarm_url_from\fR is not a directory. .TP \fBGFARM_NOT_IS_A_DIRECTORY\fR \fIgfarm_url_to\fR is not a directory. though \fIgfarm_url_from\fR is a directory. .TP \fBOthers\fR An error except the above occurred. The reason is shown by its pointed strings. gfarm-2.4.1/man/man3/gfs_pio_datasync.30000644000000000000000000000223011507222726016322 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_PIO_DATASYNC" "3" "01 June 2005" "Gfarm" "" .SH NAME gfs_pio_datasync \- output a file's data on memroy to disk .SH SYNOPSIS .sp \fB#include .sp char *gfs_pio_datasync (GFS_File \fIgf\fB); \fR .SH "DESCRIPTION" .PP The function \fBgfs_pio_datasync\fR copies data on memory of the \fIgf\fR, and waits for the I/O to complete before returning. It does nod update metadtata stat information, while another function \fBgfs_pio_sync\fR updates the metadata in addition to the contents. .SH "RETURN VALUES" .TP \fBNULL\fR The function terminated successfully. .TP \fBGFARM_ERR_NO_MEMORY\fR Insufficient memory was available. .TP \fBOthers\fR An error except the above occurred. The reason is shown by its pointed strings. .SH "SEE ALSO" .PP \fBgfs_pio_sync\fR(3), \fBgfs_pio_create\fR(3), \fBgfs_pio_open\fR(3), \fBgfs_pio_write\fR(3), \fBgfs_pio_flush\fR(3) gfarm-2.4.1/man/man3/gfs_utimes.30000644000000000000000000000342011507222726015155 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_UTIMES" "3" "04 December 2003" "Gfarm" "" .SH NAME gfs_utimes \- set file access and modification times .SH SYNOPSIS .sp \fB#include .sp char *gfs_utimes (const char * \fIgfarm_url\fB, const struct gfarm_timespec * \fItsp\fB); \fR .SH "DESCRIPTION" .PP \fBgfs_utimes()\fR sets the access and modification times of the file pointed to by the \fIgfarm_url\fR argument to the value of the \fItsp\fR argument. The \fItsp\fR argument is an array of gfarm_timespec structures. The first array member represents the access time, and the second member represents the modification time. The gfarm_timespec structure is: .nf struct gfarm_timespec { unsigned int tv_sec; /* seconds */ unsigned int tv_nsec; /* nanoseconds */ }; .fi .PP If the \fItsp\fR argument is a null pointer, the access and modification times of the file are set to the current time. .SH "RETURN VALUES" .TP \fBNULL\fR The function terminated successfully. .TP \fBGFARM_ERR_GFARM_URL_PREFIX_IS_MISSING\fR \fIgfarm_url\fR does not start with the gfarm: prefix. .TP \fBGFARM_ERR_NO_MEMORY\fR Insufficient memory was available. .TP \fBGFARM_ERR_AUTHENTICATION\fR User authentication failed when connecting to gfmd(8). .TP \fBGFARM_ERR_PERMISSION_DENIED\fR \fIgfarm_url\fR points outside your accessible address space. .TP \fBGFARM_ERR_NO_SUCH_OBJECT\fR \fIgfarm_url\fR does not exist. .TP \fBOthers\fR An error except the above occurred. The reason is shown by its pointed strings. .SH "SEE ALSO" .PP \fBgfs_stat\fR(3) gfarm-2.4.1/man/man3/gfs_closedir.30000644000000000000000000000161111507222726015453 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_CLOSEDIR" "3" "29 October 2003" "Gfarm" "" .SH NAME gfs_closedir \- close a directory .SH SYNOPSIS .sp \fB#include .sp char * gfs_closedir (GFS_Dir \fIdir\fB); \fR .SH "DESCRIPTION" .PP The \fBgfs_closedir()\fR function closes the directory stream associated with \fIdir\fR. The directory stream descriptor \fIdir\fR is not available after this call. .SH "RETURN VALUES" .TP \fBNULL\fR The function terminated successfully. .TP \fBOthers\fR An error except the above occurred. The reason is shown by its pointed strings. .SH "SEE ALSO" .PP \fBgfs_opendir\fR(3), \fBgfs_readdir\fR(3) gfarm-2.4.1/man/man3/gfs_chdir.30000644000000000000000000000223711507222726014745 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_CHDIR" "3" "04 December 2003" "Gfarm" "" .SH NAME gfs_chdir \- change working directory .SH SYNOPSIS .sp \fB#include .sp char *gfs_chdir (const char * \fIgfarm_url\fB); \fR .SH "DESCRIPTION" .PP \fBgfs_chdir()\fR changes the current working directory to that specified by \fIgfarm_url\fR. .SH "RETURN VALUES" .TP \fBNULL\fR The function terminated successfully. .TP \fBGFARM_ERR_NO_MEMORY\fR Insufficient memory was available. .TP \fBGFARM_ERR_AUTHENTICATION\fR User authentication failed when connecting to gfmd(8). .TP \fBGFARM_ERR_PERMISSION_DENIED\fR \fIgfarm_url\fR points outside your accessible address space. .TP \fBGFARM_ERR_NO_SUCH_OBJECT\fR Directory does not exist. .TP \fBGFARM_ERR_NOT_A_DIRECTORY\fR A component of the path prefix is not a directory. .TP \fBOthers\fR An error except the above occurred. The reason is shown by its pointed strings. gfarm-2.4.1/man/man3/gfs_pio_eof.30000644000000000000000000000146011507222726015271 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_PIO_EOF" "3" "18 March 2003" "Gfarm" "" .SH NAME gfs_pio_eof \- check file status .SH SYNOPSIS .sp \fB#include .sp int gfs_pio_eof (GFS_File \fIgf\fB); \fR .SH "DESCRIPTION" .PP The function \fBgfs_pio_eof()\fR tests the end-of-file indicator for the file pointed to by \fIgf\fR. .SH "RETURN VALUES" .TP \fBzero\fR The end-of-file indicator is not set. .TP \fBnon-zero\fR The end-of-file indicator is set. .SH "SEE ALSO" .PP \fBgfs_pio_create\fR(3), \fBgfs_pio_error\fR(3), \fBgfs_pio_open\fR(3) gfarm-2.4.1/man/man3/gfarm.30000644000000000000000000001205411507222726014107 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFARM" "3" "26 June 2010" "Gfarm" "" .SH NAME gfarm \- Gfarm file system API library .SH SYNOPSIS .nf #include .fi .SH "DESCRIPTION" .PP The Gfarm library provides an interface layer to the Gfarm file system. This manual gives an overview of the library. For details, refer to a manual page of each function. .SS "INITIALIZE / FINALIZE" .PP \fBgfarm_initialize\fR(3) function is used for the initilization of the Gfarm library, and \fBgfarm_terminate\fR(3) function is used for the termination of the library. .SS "FILE INPUT/OUTPUT OPERATIONS" .PP To open an existing file as a stream, \fBgfs_pio_open\fR(3) function is used. To create an file and open the file as a stream, \fBgfs_pio_create\fR(3) function is used. \fBgfs_pio_close\fR(3) function is used to close such streams. .PP \fBgfs_pio_error\fR(3) function is used to see whether an error happens or not about a stream. \fBgfs_pio_eof\fR(3) function is used to see whether a stream, which is opened for read, already reaches end-of-file or not. \fBgfs_pio_seek\fR(3) function changes the current position of the stream. .PP \fBgfs_pio_getc\fR(3) function reads a character from a stream, and \fBgfs_pio_ungetc\fR(3) function puts back a character to a stream. \fBgfs_pio_getline\fR(3) function, \fBgfs_pio_gets\fR(3) function, and \fBgfs_pio_readline\fR(3) function read one line from a stream, and \fBgfs_pio_readdelim\fR(3) function reads from stream until delimiter character, specified by the function argument, appears. \fBgfs_pio_read\fR(3) function reads specified bytes from a stream. .PP \fBgfs_pio_putc\fR(3) function writes one character to a stream, and \fBgfs_pio_putline\fR(3) function and \fBgfs_pio_puts\fR(3) function write one line to a stream. \fBgfs_pio_write\fR(3) function writes specified bytes to a stream. \fBgfs_pio_flush\fR(3) function, \fBgfs_pio_sync\fR(3) function and \fBgfs_pio_datasync\fR(3) function moves buffered data to a storage device. \fBgfs_pio_truncate\fR(3) function truncates a file. .SS "DIRECTORY ACCESS" .PP \fBgfs_opendir\fR(3) function opens a directory, and \fBgfs_readdir\fR(3) function retrieves entries of the directory. \fBgfs_closedir\fR(3) function closes the directory. .PP A gfs_glob_t data, which is initialized by \fBgfs_glob_init\fR(3) function, can be passed to \fBgfs_glob\fR(3) function, and the gfs_glob function returns list of matched file/directory names in the gfs_glob_t. The gfs_glob_t must be released by \fBgfs_glob_free\fR(3) function. \fBgfs_glob_add\fR(3) function is used add an entry to gfs_glob_t. .SS "FILE / DIRECTORY MANIPULATION" .PP \fBgfs_chmod\fR(3) function changes the mode of a file, and \fBgfs_chown\fR(3) function changes the owner of a file, and \fBgfs_utimes\fR(3) function changes file's modification time and access time. .PP \fBgfs_mkdir\fR(3) function creates a directory, and \fBgfs_rmdir\fR(3) function removes a directory. \fBgfs_unlink\fR(3) function removes a file, and \fBgfs_rename\fR(3) function renames a file or a directory. .PP \fBgfs_stat\fR(3) function returns information like size, modified/access time, etc. The struct gfs_stat returned by gfs_stat function must be released by \fBgfs_stat_free\fR(3) function. .SS "ERROR HANDLING" .PP Most Gfarm API returns the Gfarm error code in gfarm_error_t. \fBgfarm_error_string\fR(3) function returns a string describing the Gfarm error code. \fBgfarm_errno_to_error\fR(3) function translates the error number (errno) to the Gfarm error code. \fBgfarm_error_to_errno\fR(3) function translates the Gfarm error code to the error number. .SS "STRING ARRAY MANIPULATION UTILITIES" .PP A gfarm_stringlist type variable represents an array of strings, and this type is initialized by \fBgfarm_stringlist_init\fR(3) function. \fBgfarm_stringlist_add\fR(3) function is used to add a string to a gfarm_stringlist. \fBgfarm_stringlist_cat\fR(3) function is used to add strings to a gfarm_stringlist. \fBgfarm_stringlist_free\fR(3) function releases gfarm_stringlist. \fBgfarm_stringlist_elem\fR(3) function or GFARM_STRINGLIST_ELEM() macro can be used to access each string of an array. \fBgfarm_stringlist_length\fR(3) function can be used to see number of strings in an array. .PP \fBgfarm_strings_free_deeply\fR(3) function releases a string array and each element of the array by calling standard library function free(). .SS "STRING ARRAY MANIPULATION MACROS" .TP \fBGFARM_STRINGLIST_ELEM(list, i)\fR represents \fIi\fR-th element of the \fIlist\fR argument which type is gfarm_stringlist. This macro can be used as a L-value. If this macro is used as a value, it returns same result with \fBgfarm_stringlist_elem\fR(3) function. .TP \fBGFARM_STRINGLIST_STRARRAY(list)\fR returns pointer to first element of the \fIlist\fR argument which type is gfarm_stringlist. The type of the return value is a pointer to pointer to a character. gfarm-2.4.1/man/man3/gfs_pio_flush.30000644000000000000000000000165611507222726015650 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_PIO_FLUSH" "3" "18 March 2003" "Gfarm" "" .SH NAME gfs_pio_flush \- flush a stream .SH SYNOPSIS .sp \fB#include .sp char *gfs_pio_flush (GFS_File \fIgf\fB); \fR .SH "DESCRIPTION" .PP The function \fBgfs_pio_flush()\fR forces a write of all user-space buffered data for the given output \fIgf\fR. .SH "RETURN VALUES" .TP \fBNULL\fR The function terminated successfully. .TP \fBGFARM_ERR_NO_MEMORY\fR Insufficient memory was available. .TP \fBOthers\fR An error except the above occurred. The reason is shown by its pointed strings. .SH "SEE ALSO" .PP \fBgfs_pio_create\fR(3), \fBgfs_pio_open\fR(3), \fBgfs_pio_write\fR(3) gfarm-2.4.1/man/man3/gfs_pio_seek.30000644000000000000000000000247611507222726015457 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_PIO_SEEK" "3" "18 March 2003" "Gfarm" "" .SH NAME gfs_pio_seek \- reposition a stream .SH SYNOPSIS .sp \fB#include .sp char *gfs_pio_seek (GFS_File \fIgf\fB, file_offset_t \fIoffset\fB, int \fIwhence\fB, file_offset_t * \fIresult\fB); \fR .SH "DESCRIPTION" .PP The \fBgfs_pio_seek()\fR function sets the file position indicator for the file \fIgf\fR. The new position, measured in bytes, is obtained by adding \fIoffset\fR bytes to the position specified by \fIwhence\fR. If \fIwhence\fR is set to 0, 1, or 2, the offset is relative to the start of the file, the current position indicator, or end-of-file, respectively. When \fIresult\fR is not NULL, the new position returns to the address pointed by \fIresult\fR. .SH "RETURN VALUES" .TP \fBNULL\fR The function terminated successfully. .TP \fBGFARM_ERR_NO_MEMORY\fR Insufficient memory was available. .TP \fBOthers\fR An error except the above occurred. The reason is shown by its pointed strings. .SH "SEE ALSO" .PP \fBgfs_pio_create\fR(3), \fBgfs_pio_open\fR(3) gfarm-2.4.1/man/man3/gfs_pio_ungetc.30000644000000000000000000000164711507222726016014 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_PIO_UNGETC" "3" "04 December 2003" "Gfarm" "" .SH NAME gfs_pio_ungetc \- push a character back .SH SYNOPSIS .sp \fB#include .sp int gfs_pio_ungetc (GFS_File \fIgf\fB, int \fIc\fB); \fR .SH "DESCRIPTION" .PP \fBgfs_pio_ungetc()\fR pushes a character \fIc\fR back to the file \fIgf\fR. \fBgfs_pio_ungetc()\fR is needed to follow \fIgfs_pio_getc(3)\fR. .SH "RETURN VALUES" .TP \fBEOF\fR \fBgfs_pio_ungetc()\fR does not follow \fBgfs_pio_getc(3)\fR. .TP \fBOthers\fR The function terminated successfully. .SH "SEE ALSO" .PP \fBgfs_pio_create\fR(3), \fBgfs_pio_error\fR(3), \fBgfs_pio_getc\fR(3), \fBgfs_pio_open\fR(3) gfarm-2.4.1/man/man3/gfs_mkdir.30000644000000000000000000000254611507222726014765 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_MKDIR" "3" "13 November 2006" "Gfarm" "" .SH NAME gfs_mkdir \- create a directory .SH SYNOPSIS .sp \fB#include .sp char *gfs_mkdir (char * \fIgfarm_url\fB, gfarm_mode_t \fImode\fB); \fR .SH "DESCRIPTION" .PP \fBgfs_mkdir()\fR attempts to create a directory named \fIgfarm_url\fR\&. .PP \fImode\fR speficies the permissions to use. It is modified by the process's umask in the usual way: the permissions of the created file are \fB(\fR\fImode\fR\fB & ~umask)\fR\&. .SH "RETURN VALUES" .TP \fBNULL\fR The function terminated successfully. .TP \fBGFARM_ERR_NO_MEMORY\fR Insufficient memory was available. .TP \fBGFARM_ERR_ALREADY_EXISTS\fR \fIgfarm_url\fR already exists (not necessarily as a directory). This includes the case where \fIgfarm_url\fR is a symbolic link, dangling or not. .TP \fBGFARM_ERR_NO_SUCH_OBJECT\fR The parent directory of \fIgfarm_url\fR does not exist. .TP \fBGFARM_ERR_NOT_A_DIRECTORY\fR A component of the path prefix is not a directory. .TP \fBOthers\fR An error except the above occurred. The reason is shown by its pointed strings. gfarm-2.4.1/man/man3/gfs_glob_free.30000644000000000000000000000132611507222726015576 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_GLOB_FREE" "3" "11 September 2003" "Gfarm" "" .SH NAME gfs_glob_free \- free memory for types of path names .SH SYNOPSIS .sp \fB#include .sp char *gfs_glob_free (gfs_glob_t * \fIlistp\fB); \fR .SH "DESCRIPTION" .PP \fBgfs_glob_free()\fR frees the dynamically allocated storage from an earlier call to \fBgfs_glob_init(3)\fR .SH "SEE ALSO" .PP \fBgfs_glob_init\fR(3) \fBgfs_glob\fR(3) \fBgfs_glob_add\fR(3) gfarm-2.4.1/man/man3/gfs_pio_write.30000644000000000000000000000271411507222726015655 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_PIO_WRITE" "3" "27 June 2010" "Gfarm" "" .SH NAME gfs_pio_write \- write to a file .SH SYNOPSIS .sp \fB#include .sp gfarm_error_t gfs_pio_write (GFS_File \fIgf\fB, const void * \fIbuffer\fB, int \fIsize\fB, int * \fInp\fB); \fR .SH "DESCRIPTION" .PP \fBgfs_pio_write()\fR writes up to \fIsize\fR bytes to the file \fIgf\fR from the buffer starting at \fIbuffer\fR\&. It returns the number of bytes written to the address pointed by \fInp\fR\&. .SH "RETURN VALUES" .TP \fBGFARM_ERR_NO_ERROR\fR The function terminated successfully. .TP \fBGFARM_ERR_OPERATION_NOT_PERMITTED\fR \fIgf\fR does not specify a regular file. .TP \fBGFARM_ERR_BAD_FILE_DESCRIPTOR\fR The file descripter specified by \fIgfp\fR is not a valid or is not open for writing. .TP \fBGFARM_ERR_NO_SPACE\fR The file system node has no room to store data .TP \fBGFARM_ERR_NO_FILE_SYSTEM_NODE\fR There is no available file system node. .TP \fBGFARM_ERR_NO_MEMORY\fR Insufficient memory was available. .TP \fBOthers\fR An error except the above occurred. The reason is shown by \fBgfarm_error_string\fR(3)\&. .SH "SEE ALSO" .PP \fBgfs_pio_create\fR(3), \fBgfs_pio_flush\fR(3), \fBgfs_pio_open\fR(3) gfarm-2.4.1/man/man3/gfs_realpath.30000644000000000000000000000277611507222726015464 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_REALPATH" "3" "13 November 2006" "Gfarm" "" .SH NAME gfs_realpath \- resolve pathname in Gfarm filesystem .SH SYNOPSIS .sp \fB#include .sp char *gfs_realpath (const char * \fIgfarm_url\fB, char ** \fIresolved_pathp\fB); \fR .SH "DESCRIPTION" .PP \fBgfs_realpath\fR expands a home directory '~' and resolves references to '.', '..' and extra '/' characters in the null terminated string pointed to by \fIgfarm_url\fR and stores the canonicalized absolute pathname to dynamically allocated memory space whose pointer is returned to \fIresolved_pathp\fR\&. It will be necessary to free the dynamically allocated memory space pointed to by \fIresolved_pathp\fR\&. .SH "RETURN VALUES" .TP \fBNULL\fR The function terminated successfully. .TP \fBGFARM_ERR_NO_MEMORY\fR Insufficient memory was available. .TP \fBGFARM_ERR_NOT_A_DIRECTORY\fR A component of the path prefix is not a directory. .TP \fBGFARM_ERR_INVALID_ARGUMENT\fR \fIgfarm_url\fR is NULL. .TP \fBGFARM_ERR_PERMISSION_DENIED\fR \fIgfarm_url\fR points outside your accessible address space. .TP \fBGFARM_ERR_NO_SUCH_OBJECT\fR \fIgfarm_url\fR does not exist. .TP \fBOthers\fR An error except the above occurred. The reason is shown by its pointed strings. gfarm-2.4.1/man/man3/gfs_pio_read.30000644000000000000000000000265111507222726015436 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_PIO_READ" "3" "27 June 2010" "Gfarm" "" .SH NAME gfs_pio_read \- binary stream input .SH SYNOPSIS .sp \fB#include .sp gfarm_error_t gfs_pio_read (GFS_File \fIgf\fB, void * \fIbuffer\fB, int \fIsize\fB, int * \fInp\fB); \fR .SH "DESCRIPTION" .PP \fBgfs_pio_read()\fR attempts to read up to \fIsize\fR bytes from the file referenced by \fIgf\fR into the buffer starting at \fIbuffer\fR, and returns the number of bytes read to the address pointed by \fInp\fR\&. On end of file, the number of bytes read is zero. .SH "RETURN VALUES" .TP \fBGFARM_ERR_NO_ERROR\fR The function terminated successfully. .TP \fBGFARM_ERR_OPERATION_NOT_PERMITTED\fR \fIgf\fR does not specify a regular file. .TP \fBGFARM_ERR_BAD_FILE_DESCRIPTOR\fR The file descripter specified by \fIgf\fR is not a valid or is not open for reading. .TP \fBGFARM_ERR_NO_FILE_SYSTEM_NODE\fR There is no available file system node. .TP \fBGFARM_ERR_NO_MEMORY\fR Insufficient memory was available. .TP \fBOthers\fR An error except the above occurred. The reason is shown by \fBgfarm_error_string\fR(3)\&. .SH "SEE ALSO" .PP \fBgfs_pio_create\fR(3), \fBgfs_pio_open\fR(3) gfarm-2.4.1/man/man3/gfs_pio_set_view_index.30000644000000000000000000000514111507222726017534 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_PIO_SET_VIEW_INDEX" "3" "06 September 2005" "Gfarm" "" .SH NAME gfs_pio_set_view_index \- change file view to an individual fragment .SH SYNOPSIS .sp \fB#include .sp char *gfs_pio_set_view_index (GFS_File \fIgf\fB, int \fIfragment_number\fB, int \fIfragment_index\fB, char *\fIhost\fB, int \fIflags\fB); \fR .SH "DESCRIPTION" .PP \fBgfs_pio_set_view_index()\fR changes the process's view of the data in the file specified by \fIgf\fR to a file fragment with the index \fIfragment_index\fR. .PP When creating a new file, it is necessary to specify the total number of file fragments \fIfragment_number\fR. Every parallel process should specify the same \fIfragment_number\fR for the corresponding file. When the file exists, GFARM_FILE_DONTCARE can be specified. If \fIfragment_number\fR is different from the total fragment number of the existent file, it is erroneous. .PP \fIhost\fR is used for explicitly specifying a filesystem node. If \fIhost\fR is NULL, appropriate filesystem node is chosen. .PP Values of \fIflag\fR are constructed by a bitwise-inclusive-OR of the following list. .TP \fBGFARM_FILE_SEQUENTIAL\fR File will be accessed sequentially. .TP \fBGFARM_FILE_REPLICATE\fR File may be replicated to a local filesystem when accessing remotely. This flag cannot be specified with GFARM_FILE_NOT_REPLICATE. .TP \fBGFARM_FILE_NOT_REPLICATE\fR File may not be replicated to a local filesystem when accessing remotely. This flag cannot be specified with GFARM_FILE_REPLICATE. .PP By default, Gfarm files are accessed as a whole file in global file view where each fragment can be seamlessly accessed. .SH "RETURN VALUES" .TP \fBNULL\fR The function terminated successfully. .TP \fBGFARM_ERR_NO_MEMORY\fR Insufficient memory was available. .TP \fBGFARM_ERR_OPERATION_NOT_PERMITTED\fR The file is not a regular fragmented file. .TP \fBGFARM_ERR_FRAGMENT_NUMBER_DOES_NOT_MATCH\fR The total number of file fragments is different from the existence one. .TP \fBGFARM_ERR_INVALID_ARGUMENT\fR Invalid arguments are specified, for instance, GFARM_FILE_DONTCARE is specified as the total number of fragments of a newly created file. .TP \fBOthers\fR An error except the above occurred. The reason is shown by its pointed strings. .SH "SEE ALSO" .PP \fBgfs_pio_create\fR(3), \fBgfs_pio_open\fR(3), \fBgfs_pio_set_view_local\fR(3) gfarm-2.4.1/man/man3/gfarm_url_hosts_schedule.30000644000000000000000000000253511507222726020070 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFARM_URL_HOSTS_SCHEDULE" "3" "18 March 2003" "Gfarm" "" .SH NAME gfarm_url_hosts_schedule \- schedule filesystem nodes using file-affinity scheduling .SH SYNOPSIS .sp \fB#include .sp char *gfarm_url_hosts_schedule (char * \fIgfarm_url\fB, char * \fIoption\fB, int * \fInhostsp\fB, char *** \fIhostsp\fB); \fR .SH "DESCRIPTION" .PP The \fBgfarm_url_hosts_schedule()\fR function schedules filesystem nodes using file-affinity scheduling with a Gfarm file \fIgfarm_url\fR, and returns an array of filesystem hostnames \fIhostsp\fR and the number of scheduled hosts \fInhostsp\fR. The returned array of hostnames \fIhostsp\fR should be free'ed with gfarm_strings_free_deeply(3). .SH "RETURN VALUES" .TP \fBNULL\fR The function terminated successfully. .TP \fBGFARM_ERR_NO_MEMORY\fR Insufficient memory was available. .TP \fBOthers\fR An error except the above occurred. The reason is shown by its pointed strings. .SH "NOTES" .PP The argument \fIoption\fR is reserved to specify options for scheduling, although it is not used in the current implementation. gfarm-2.4.1/man/Makefile0000644000000000000000000000024711507222726013532 0ustar rootroottop_builddir = .. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk SUBDIRS = man1 man3 man5 man8 ja include $(top_srcdir)/makes/subdir.mk gfarm-2.4.1/man/man8/0000755000000000000000000000000011507222730012725 5ustar rootrootgfarm-2.4.1/man/man8/gfmd.80000644000000000000000000000434611507222725013746 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFMD" "8" "20 December 2010" "Gfarm" "" .SH NAME gfmd(8) \- Gfarm metadata server .SH SYNOPSIS \fBgfmd\fR [ \fB\fIoptions\fB\fR ] .SH "DESCRIPTION" .PP \fBgfmd\fR is a Gfarm filesystem metadata server for accessing the filesystem metadata of the Gfarm filesystem. \fBgfmd\fR must be running on a metadata server node in advance. .PP It is possible for \fBgfmd\fR to be executed as a non-privileged user process, although only the user that executes the \fBgfmd\fR can be authenticated. Other users cannot use it. For details, see SETUP.private.en document .PP To access gfmd, the hostname and the port number should be specified by the metadb_server_host and metadb_server_port statements, respectively, in \fI~/.gfarm2rc\fR or in \fI%%SYSCONFDIR%%/gfarm2.conf\fR on a client node. .SH "OPTIONS" .TP \fB-L \fIlog-level\fB\fR Specifies a log priority level. The log output, which priority is higher or equal to this level, will be sent to syslog or standard error. Please refer gfarm2.conf(5) for the priority levels which can be specified by this option. .TP \fB-P \fIpid-file\fB\fR Specifies a file name to be used to record the process ID of gfmd. .TP \fB-d\fR Specifies the debug mode. With the -d option, gfmd runs as a foreground process, not a daemon. If this option is specified and \fB-L\fR is not specified, the log level is set to "debug". .TP \fB-f \fIconfig-file\fB\fR Specifies a configuration file that is read instead of the default configuration file. .TP \fB-p \fIport\fB\fR Specifies a port number to be used by gfmd. .TP \fB-s \fIsyslog-facility\fB\fR Specifies a syslog facility to report errors encountered by gfmd. By default, local0 is used. .TP \fB-v\fR Makes gfmd output verbose log message on authentication. This is useful, when one has to resolve an issue about GSI authenticaion. .TP \fB-?\fR Displays a list of command options. .SH "FILES" .TP \fB\fI%%SYSCONFDIR%%/gfmd.conf\fB\fR configuration file .SH "SEE ALSO" .PP \fBgfarm2.conf\fR(5) gfarm-2.4.1/man/man8/gfsd.80000644000000000000000000000552011507222725013747 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFSD" "8" "20 December 2010" "Gfarm" "" .SH NAME gfsd(8) \- Gfarm filesystem daemon .SH SYNOPSIS \fBgfsd\fR [ \fB\fIoptions\fB\fR ] .SH "DESCRIPTION" .PP \fBgfsd\fR is a filesystem daemon for the Gfarm filesystem, which runs on every filesystem node, usually, with root privileges. .PP \fBgfsd\fR provides remote file operations with access control in the Gfarm filesystem as well as user authentication, file replication, and node resource status monitoring. .PP It is possible for \fBgfsd\fR to be executed as a non-privileged user process, although only the user that executes the \fBgfsd\fR can be authenticated. Other users cannot use it. For details, see SETUP.private.en document. .SH "OPTIONS" .TP \fB-L \fIlog-level\fB\fR Specifies a log priority level. The log output, which priority is higher or equal to this level, will be sent to syslog or standard error. Please refer gfarm2.conf(5) for the priority levels which can be specified by this option. .TP \fB-P \fIpid-file\fB\fR Specifies a file name which records the process ID of gfsd. .TP \fB-c\fR When starting up, gfsd investigates all files stored in a spool directory. This option is useful when a hostname of a file system node is changed. Valid file copies will be registered to the metadata server. When the \fB-c\fR option is specified more than once, invalid file copies that are not registered in the metadata server are deleted. .TP \fB-d\fR Specifies the debug mode. With the -d option, gfsd runs as a foreground process, not a daemon. If this option is specified and \fB-L\fR is not specified, the log level is set to "debug". .TP \fB-f \fIconfig-file\fB\fR Specifies a configuration file that is read instead of the default configuration file. .TP \fB-h \fIhostname\fB\fR Specifies my own canonical host name. .TP \fB-l \fIIP-address\fB\fR Specifies the IP address from which the gfsd accepts TCP and UDP requests. The default address is all IP addresses of the host. This option is useful to invoke multiple instances of gfsd to provide multiple spool directories on the host. .TP \fB-r \fIdirectory\fB\fR Specifies a spool directory for a Gfarm filesystem on this filesystem node. .TP \fB-s \fIsyslog-facility\fB\fR Specifies a syslog facility to report errors by gfsd. By default, local0 is used. .TP \fB-v\fR Makes gfsd output verbose log message on authentication. This is useful, when one has to resolve an issue about GSI authenticaion. .TP \fB-?\fR Displays a list of command options. .SH "FILES" .TP \fB\fI%%SYSCONFDIR%%/gfarm2.conf\fB\fR configuration file .SH "SEE ALSO" .PP \fBgfarm2.conf\fR(5) gfarm-2.4.1/man/man8/Makefile0000644000000000000000000000052011507222725014366 0ustar rootroot# $Id: Makefile 2373 2006-01-12 00:54:22Z soda $ top_builddir = ../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk DOCBOOK_DIR=$(top_srcdir)/doc/docbook/en/ref/man8 include $(DOCBOOK_DIR)/Makefile.inc MAN = $(DOCBOOK) EXTRA_CLEAN_TARGETS = manpage.links manpage.refs include $(top_srcdir)/makes/man.mk gfarm-2.4.1/man/ja/0000755000000000000000000000000011507222730012454 5ustar rootrootgfarm-2.4.1/man/ja/Makefile.inc0000644000000000000000000000002611507222725014666 0ustar rootrootmandir = $(ja_mandir) gfarm-2.4.1/man/ja/man5/0000755000000000000000000000000011507222730013314 5ustar rootrootgfarm-2.4.1/man/ja/man5/gfarm2.conf.50000644000000000000000000006761611507222725015530 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFARM2.CONF" "5" "30 December 2010" "Gfarm" "" .SH NAME gfarm2.conf \- GfarmÀßÄê¥Õ¥¡¥¤¥ë .SH "DESCRIPTION" .PP gfarm2.conf¥Õ¥¡¥¤¥ë¤Ï¡¢gfarm¥×¥í¥°¥é¥à¤ÎÀßÄê¥Õ¥¡¥¤¥ë¤Ç¤¹¡£ ¥µ¡¼¥Ð¡¼¡¦¥×¥í¥»¥¹¤Ç¤¢¤ëgfsd¤Ï¡¢¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢ ¤³¤Î%%SYSCONFDIR%%/gfarm2.conf¤òÀßÄê¥Õ¥¡¥¤¥ë¤È¤·¤Æ»²¾È¤·¤Þ¤¹¡£ ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¡¼¡¦¥×¥í¥»¥¹¤Ç¤¢¤ëgfmd¤Ï¡¢%%SYSCONFDIR%%/gfmd.conf¤ò ÆÉ¤ß¹þ¤ß¤Þ¤¹¡£gfmd.conf¤Î·Á¼°¤Ï¡¢gfarm2.conf¤ÈƱ°ì¤Ç¤¹¡£ ¤Ê¤ª¡¢ÀßÄêÆâÍÆ¤¬ÆÉ¤ß¹þ¤Þ¤ì¤ë¤Î¤Ïµ¯Æ°»þ¤À¤±¤Ê¤Î¤Ç¡¢ ÀßÄêÆâÍÆ¤òÊѹ¹¤·¤¿¾ì¹ç¡¢¥µ¡¼¥Ð¡¼¤òºÆµ¯Æ°¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£ .PP ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥à¤Ï¡¢´Ä¶­ÊÑ¿ôGFARM_CONFIG_FILE¤Ç »ØÄꤷ¤¿¥Õ¥¡¥¤¥ë¤È¡¢%%SYSCONFDIR%%/gfarm2.conf¤ò¡¢ÀßÄê¥Õ¥¡¥¤¥ë ¤È¤·¤Æ»²¾È¤·¤Þ¤¹¡£¤³¤ÎÆó¤Ä¤Î¥Õ¥¡¥¤¥ë¤Ç¤Ï¡¢´Ä¶­ÊÑ¿ôGFARM_CONFIG_FILE¤Ç »ØÄꤷ¤¿¥Õ¥¡¥¤¥ë¤ÎÀßÄê¤ÎÊý¤¬Àè¤ËÆÉ¤ß¹þ¤Þ¤ì¤Þ¤¹¡£ ¤É¤Á¤é¤ÎÀßÄê¥Õ¥¡¥¤¥ë¤â¡¢Æ±°ì¤Îʸˡ¤Çµ­½Ò¤·¤Þ¤¹¡£ Ʊ°ì¤Î»ØÄêʸ¤¬Ê£¿ô¤¢¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢Àè¤Ë»ØÄꤵ¤ì¤Æ¤¤¤¿Êý¤¬Í¥À褵¤ì¤Þ¤¹¡£ ´Ä¶­ÊÑ¿ôGFARM_CONFIG_FILE¤¬ÀßÄꤵ¤ì¤Æ¤Ê¤¤¾ì¹ç¡¢Âå¤ï¤ê¤Ë ¥æ¡¼¥¶¡¼¤Î¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤¢¤ë.gfarm2rc¥Õ¥¡¥¤¥ë¤ò»ÈÍѤ·¤Þ¤¹¡£ .PP gfarm2.conf¤Ï¡¢°ì¹Ô¤Ë°ìʸ¤Î·Á¼°¤ÇÀßÄꤷ¤Þ¤¹¡£ ¤¿¤À¤·¡¢¹ÔËö¤Ëʸ»ú``\\''¤òµ­½Ò¤¹¤ë¤³¤È¤Ë¤è¤Ã¤Æ¡¢¹Ô¤ò·Ñ³¤µ¤»¤ë¤³¤È¤¬ ¤Ç¤­¤Þ¤¹¡£¤Þ¤¿¡¢Ê¸»ú``#''¤«¤é¹ÔËö¤Þ¤Ç¤Ï¡¢¥³¥á¥ó¥È¤È¤·¤Æ°·¤ï¤ì¡¢Ìµ»ë ¤µ¤ì¤Þ¤¹¡£ .SH "¥Û¥¹¥È»ØÄê" .PP °ú¿ô¤È¤·¤Æ¡¢\fI¥Û¥¹¥È»ØÄê\fR¤òµ­½Ò¤Ç¤­¤ëʸ¤¬¤¤¤¯¤Ä¤«¤¢¤ê¤Þ¤¹¤¬¡¢ ¤³¤Î¾ì¹ç¡¢¥Û¥¹¥È»ØÄê¤Ë¤Ï¡¢²¼µ­¤Î¤¤¤º¤ì¤«¤òµ­½Ò¤Ç¤­¤Þ¤¹¡£ .TP \fB\fIIII.JJJ.KKK.LLL\fB\fR "."¤Ç¶èÀÚ¤é¤ì¤¿0¡Á255¤Þ¤Ç¤Î¿ô»ú4¤Ä¤Ç¡¢IP¥¢¥É¥ì¥¹¤ò»ØÄꤷ¤Þ¤¹¡£ .TP \fB\fIIII.JJJ.KKK.LLL\fB/\fIMM\fB\fR IP¥¢¥É¥ì¥¹¤È¡¢"/"¤Ç¶èÀÚ¤é¤ì¤¿0¡Á31¤Þ¤Ç¤Î¿ô»ú¤Ç¡¢¥Í¥Ã¥È¥ï¡¼¥¯¤ò »ØÄꤷ¤Þ¤¹¡£"/"°Ê¹ß¤Î¿ô»ú¤Ïnetmask¤Î¥Ó¥Ã¥ÈŤǤ¹¡£ .TP \fB\fIdomain.name\fB\fR ¥Û¥¹¥È̾¤ò¥É¥á¥¤¥ó̾¤Ç»ØÄꤷ¤Þ¤¹¡£ .TP \fB \&.\fIdomain.name\fB\fR ¥É¥á¥¤¥ó̾¤ÎÀèÆ¬¤¬"."¤Ç¤Ï¤¸¤Þ¤ë¾ì¹ç¡¢¤³¤Î¥É¥á¥¤¥ó̾¤Ë½ê°¤¹¤ëÁ´¤Æ¤Î ¥Û¥¹¥È¤ò°ÕÌ£¤·¤Þ¤¹¡£ .TP \fB*\fR "*"¤Èµ­½Ò¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢Á´¤Æ¤Î¥Û¥¹¥È¤ò°ÕÌ£¤·¤Þ¤¹¡£ .TP \fBLISTENER\fR Á´¤ÆÂçʸ»ú¤Ç"LISTENER"¤Èµ­½Ò¤¹¤ë¤È¡¢ÄÌ¿®¤¹¤ëÁê¼ê¤Ë´Ø·¸¤Ê¤¯¡¢ ¥µ¡¼¥Ð¡¼Â¦(Ãå¸ÆÂ¦)¤Î¥½¥±¥Ã¥È¤ò°ÕÌ£¤·¤Þ¤¹¡£ .SH "ʸ" .PP ʸ¤Ë¤Ï¡¢²¼µ­¤Î¼ïÎब¤¢¤ê¤Þ¤¹¡£ .TP \fBspool \fIgfsd¥¹¥×¡¼¥ë¡¦¥Ç¥£¥ì¥¯¥È¥ê\fB\fR gfsd¤¬¡¢gfarm¥Õ¥¡¥¤¥ë¤Î¼ÂÂΤòÊÝ»ý¤¹¤ë¥Ç¥£¥ì¥¯¥È¥ê̾¤ò »ØÄꤷ¤Þ¤¹¡£ Îã: .nf spool /var/spool/gfarm .fi .TP \fBspool_server_listen_address \fIIP¥¢¥É¥ì¥¹\fB\fR gfsd¤¬TCP¤ª¤è¤ÓUDP¤ÎÍ×µá¤ò¼õ¤±ÉÕ¤±¤ëIP¥¢¥É¥ì¥¹¤ò»ØÄꤷ¤Þ¤¹¡£ ¾Êά»þ¤Ï¡¢¤½¤Î¥Û¥¹¥È¤ÎÁ´¤Æ¤ÎIP¥¢¥É¥ì¥¹¤Ç¼õ¤±ÉÕ¤±¤Þ¤¹¡£ ¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢°ì¤Ä¤Î¥Î¡¼¥É¤ÇÊ£¿ô¤Î¥¹¥×¡¼¥ë¤òÄ󶡤¹¤ë¾ì¹ç¤Ë¡¢ ¤½¤ì¤¾¤ì¤Î¥¹¥×¡¼¥ë¤´¤È¤Ë¡¢ÊÌ¡¹¤ÎIP¥¢¥É¥ì¥¹¤ò»È¤Ã¤Ægfsd¤òµ¯Æ°¤¹¤ë ¤¿¤á¤ËÍѤ¤¤Þ¤¹¡£ Îã: .nf spool_server_listen_address 192.168.121.1 .fi .TP \fBspool_server_cred_type \fIcred_type\fB\fR GSIǧ¾Ú¤Ë¤ª¤¤¤Æ¡¢gfsd¤¬ÍѤ¤¤ë¾ÚÌÀ½ñ¤Î¼ïÎà¤ò»ØÄꤷ¤Þ¤¹¡£ sharedsecretÍøÍÑ»þ¤Ë¤Ï¡¢¤³¤Î»ØÄê¤Ïñ¤Ë̵»ë¤µ¤ì¤Þ¤¹¡£ ¥µ¡¼¥Ð¦¤Ç¤³¤Î»ØÄê¤ò¾Êά¤·¤¿¾ì¹ç¡¢¥µ¡¼¥Ð¤òroot¸¢¸Â¤Çµ¯Æ°¤·¤¿¾ì¹ç¤Ï ¥Û¥¹¥È¾ÚÌÀ½ñ¤òÍѤ¤¤Þ¤¹¡£¤Þ¤¿¥µ¡¼¥Ð¤ò°ìÈ̥桼¥¶¸¢¸Â¤Çµ¯Æ°¤·¤¿¾ì¹ç¤Ï ¥æ¡¼¥¶¾ÚÌÀ½ñ¤òÍѤ¤¤Þ¤¹¡£ ¥¯¥é¥¤¥¢¥ó¥È¦¤Ç¤³¤Î»ØÄê¤ò¾Êά¤·¤¿¾ì¹ç¡¢¥µ¡¼¥Ð¤¬¥Û¥¹¥È¾ÚÌÀ½ñ¤òÍøÍѤ·¤Æ¤¤¤ë ¤È²¾Äꤷ¤Æ¥µ¡¼¥Ðǧ¾Ú¤ò¹Ô¤¤¤Þ¤¹¡£¤³¤Î¤¿¤á¥µ¡¼¥Ð¤ò¥¯¥é¥¤¥¢¥ó¥È¤ÈƱ¤¸¥æ¡¼¥¶ ¸¢¸Â¤Çµ¯Æ°¤·¤Æ¤¤¤ë¾ì¹ç¡¢¥¯¥é¥¤¥¢¥ó¥È¦¤Ç¤Ï¡¢²¼µ­¤Î°ì¹Ô¤òÀßÄꤷ¤Æ ¤ª¤¯É¬Íפ¬¤¢¤ê¤Þ¤¹¡£ Îã: .nf spool_server_cred_type self .fi »ØÄê²Äǽ¤Ê\fIcred_type\fR¤È¤·¤Æ¤Ï¡¢ ¡Öself¡×¡¢ ¡Öhost¡×¡¢¡Öuser¡×¡¢ ¡Ömechanism-specific¡×¤¬¤¢¤ê¡¢ spool_server_cred_service¤ª¤è¤Ó spool_server_cred_name¤ÈÁȤ߹ç¤ï¤»¤Æ ²¼µ­¤Î¤è¤¦¤ËÍѤ¤¤Þ¤¹¡£ .RS .TP \fBself\fR ¤½¤Î¥æ¡¼¥¶¤¬¸½ºß½ê»ý¤·¤Æ¤¤¤ë¥æ¡¼¥¶¾ÚÌÀ½ñ¤òÍѤ¤¤ë¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ ¤³¤Î»ØÄê¤òÍøÍѤ¹¤ëºÝ¤Ë¤Ï¡¢ spool_server_cred_service¤ª¤è¤Ó spool_server_cred_name¤Î »ØÄê¤ò¹Ô¤Ã¤Æ¤Ï¤¤¤±¤Þ¤»¤ó¡£ .TP \fBhost\fR ¥Û¥¹¥È¾ÚÌÀ½ñ¤¢¤ë¤¤¤Ï¥µ¡¼¥Ó¥¹¾ÚÌÀ½ñ¤òÍѤ¤¤ë¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ ¥µ¡¼¥Ó¥¹¾ÚÌÀ½ñ¤òÍѤ¤¤ë¾ì¹ç¡¢¤½¤Î¥µ¡¼¥Ó¥¹¤Î̾Á°¤ò spool_server_cred_service¤Ç»ØÄꤷ¤Þ¤¹¡£ ¥µ¡¼¥Ó¥¹Ì¾¤Ë¡Öhost¡×¤ò»ØÄꤷ¤¿¾ì¹ç¡¢ ¥Õ¥¡¥¤¥ë``\fI/etc/grid-security/hostcert.pem\fR\&''¤Ë ¤¢¤ë¥Û¥¹¥È¾ÚÌÀ½ñ¤òÍѤ¤¤Þ¤¹¡£ ¤½¤ì°Ê³°¤Î¥µ¡¼¥Ó¥¹Ì¾¤ò»ØÄꤷ¤¿¾ì¹ç¡¢ ¥Õ¥¡¥¤¥ë``\fI/etc/grid-security/¥µ¡¼¥Ó¥¹/¥µ¡¼¥Ó¥¹cert.pem\fR\&'' ¤Ë¤¢¤ë¥µ¡¼¥Ó¥¹¾ÚÌÀ½ñ¤òÍѤ¤¤Þ¤¹¡£ ¥µ¡¼¥Ó¥¹Ì¾¤ò¾Êά¤·¤¿¾ì¹ç¡¢¡Öhost¡×¤¬»ØÄꤵ¤ì¤¿¤È¤ß¤Ê¤·¤Þ¤¹¡£ ¥Û¥¹¥È¾ÚÌÀ½ñ¤ª¤è¤Ó¥µ¡¼¥Ó¥¹¾ÚÌÀ½ñ¤Î¾ì¹ç¡¢¾ÚÌÀ½ñ¤ÎCommon NameÍó¤Î¤ß¤ò Èæ³Ó¤·¤Þ¤¹¡£Common Name¤Ï¡¢¡ÖCN=¥µ¡¼¥Ó¥¹Ì¾/¥Û¥¹¥È̾¡×¤Î·Á¼°¤Ç¤¢¤ëɬÍפ¬ ¤¢¤ê¤Þ¤¹¡£¤Þ¤¿¡¢¥Û¥¹¥È̾¤Ï¡¢\fBgfhost\fR¥³¥Þ¥ó¥É¤Ç»ØÄꤷ¤¿ Àµ¼°Ì¾¤ÈÀµ³Î¤Ë°ìÃפ·¤Æ¤¤¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£¥Û¥¹¥ÈÊÌ̾¤Ïµö¤µ¤ì¤Þ¤»¤ó¡£ ¤³¤ì¤Ï¡¢GSSAPI (RFC2743/RFC2744)¤ÎGSS_C_NT_HOSTBASED_SERVICE¤Ë Âбþ¤¹¤ëµ¡Ç½¤Ç¤¹¡£ Îã: .nf spool_server_cred_type host spool_server_cred_service host .fi .TP \fBuser\fR ¥æ¡¼¥¶¾ÚÌÀ½ñ¤òÍѤ¤¤ë¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ ¥æ¡¼¥¶¤Î¥¢¥«¥¦¥ó¥È̾¤òspool_server_cred_name¤Ç»ØÄꤷ¤Þ¤¹¡£ ¥¢¥«¥¦¥ó¥È̾¤ò¾Êά¤·¤¿¾ì¹ç¤Ë¤Ï¡¢¤½¤Î¥³¥Þ¥ó¥É¤òµ¯Æ°¤·¤¿¥æ¡¼¥¶Ì¾¤¬»È¤ï¤ì¤Þ¤¹¡£ ¤³¤Î»ØÄê¤òÍøÍѤ¹¤ëºÝ¤Ë¤Ï¡¢spool_server_cred_service¤Î »ØÄê¤ò¹Ô¤Ã¤Æ¤Ï¤¤¤±¤Þ¤»¤ó¡£ ¥æ¡¼¥¶Ì¾¤È¾ÚÌÀ½ñ¤ÎDistinguished Name¤ÎÂбþ¤ò¤È¤ë¤¿¤á¡¢ ``\fI/etc/grid-security/grid-mapfile\fR\&''¤òÍѤ¤¤Þ¤¹¡£ ¤³¤Î¤¿¤á¡¢¤³¤Î¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Ê¤«¤Ã¤¿¤ê¡¢¤¢¤ë¤¤¤Ï¤³¤Î¥Õ¥¡¥¤¥ë¤ËÅÐÏ¿ ¤µ¤ì¤Æ¤Ê¤¤¥æ¡¼¥¶¤Ï¡¢¤³¤Îµ¡Ç½¤òÍѤ¤¤ë¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£ ¤³¤ì¤Ï¡¢GSSAPI (RFC2743/RFC2744)¤ÎGSS_C_NT_USER_NAME¤ËÂбþ¤¹¤ëµ¡Ç½¤Ç¤¹¡£ Îã: .nf spool_server_cred_type user spool_server_cred_name guest .fi .TP \fBmechanism-specific\fR ¥µ¡¼¥Ð¤ÎX.509 Distinguished Name¤òspool_server_cred_name¤Ç ľÀÜ»ØÄꤷ¤Þ¤¹¡£ ¤³¤Î»ØÄê¤òÍøÍѤ¹¤ëºÝ¤Ë¤Ï¡¢spool_server_cred_service¤Î »ØÄê¤ò¹Ô¤Ã¤Æ¤Ï¤¤¤±¤Þ¤»¤ó¡£ ¤³¤ì¤Ï¡¢GSSAPI (RFC2743/RFC2744)¤ÇName Type¤È¤·¤ÆGSS_C_NO_OID¤ò »ØÄꤷ¤¿¾ì¹ç¤ËÂбþ¤¹¤ëµ¡Ç½¤Ç¤¹¡£ Îã: .nf spool_server_cred_type mechanism-specific spool_server_cred_name "/O=Grid/O=Globus/OU=example.com/CN=John Smith" .fi .RE .TP \fBspool_server_cred_service \fIcred_service\fB\fR GSIǧ¾Ú¤Ë¤ª¤¤¤Æ¡¢spool_server_cred_type¤È¤·¤Æ ¡Öhost¡×¤ò»ØÄꤷ¤Æ¤¤¤ë¾ì¹ç¤Ë¡¢gfsd¤¬ÍѤ¤¤ë¥µ¡¼¥Ó¥¹¾ÚÌÀ½ñ¤Î ¼ïÎà¤ò»ØÄꤷ¤Þ¤¹¡£ sharedsecretÍøÍÑ»þ¤Ë¤Ï¡¢¤³¤Î»ØÄê¤Ïñ¤Ë̵»ë¤µ¤ì¤Þ¤¹¡£ ¾Ü¤·¤¯¤Ïspool_server_cred_type¤Î¹à¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£ .TP \fBspool_server_cred_name \fIcred_name\fB\fR GSIǧ¾Ú¤Ë¤ª¤¤¤Æ¡¢spool_server_cred_type¤Ç»ØÄꤷ¤¿ÃÍ¤Ë ±þ¤¸¤Æ¡¢gfsd¤¬ÍѤ¤¤ë¾ÚÌÀ½ñ¤ÎÀßÄê¤ò¹Ô¤¤¤Þ¤¹¡£ sharedsecretÍøÍÑ»þ¤Ë¤Ï¡¢¤³¤Î»ØÄê¤Ïñ¤Ë̵»ë¤µ¤ì¤Þ¤¹¡£ ¾Ü¤·¤¯¤Ïspool_server_cred_type¤Î¹à¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£ .TP \fBmetadb_server_host \fIgfmd¥Û¥¹¥È̾\fB\fR gfmd¤¬Æ°ºî¤·¤Æ¤¤¤ë¥Û¥¹¥È̾¤ò»ØÄꤷ¤Þ¤¹¡£ ¤³¤ÎÀßÄê¤Ïɬ¿Ü¤Ç¤¹¡£ Îã: .nf metadb_server_host ldap.example.com .fi .TP \fBmetadb_server_port \fIgfmd¥Ý¡¼¥ÈÈÖ¹æ\fB\fR gfmd¤¬ÍøÍѤ¹¤ëTCP¥Ý¡¼¥È¤ÎÈÖ¹æ¤ò»ØÄꤷ¤Þ¤¹¡£ ¾Êά»þ¤Î¥Ç¥Õ¥©¥ë¥È¡¦¥Ý¡¼¥ÈÈÖ¹æ¤Ï601È֤Ǥ¹¡£ Îã: .nf metadb_server_port 601 .fi .TP \fBmetadb_server_cred_type \fIcred_type\fB\fR GSIǧ¾Ú¤Ë¤ª¤¤¤Æ¡¢gfmd¤¬ÍѤ¤¤ë¾ÚÌÀ½ñ¤Î¼ïÎà¤ò»ØÄꤷ¤Þ¤¹¡£ sharedsecretÍøÍÑ»þ¤Ë¤Ï¡¢¤³¤Î»ØÄê¤Ïñ¤Ë̵»ë¤µ¤ì¤Þ¤¹¡£ ÀßÄê¤Î°ÕÌ£¤Ë¤Ä¤¤¤Æ¤Ïspool_server_cred_type¤Î¹à¤ò »²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£ .TP \fBmetadb_server_cred_service \fIcred_service\fB\fR GSIǧ¾Ú¤Ë¤ª¤¤¤Æ¡¢metadb_server_cred_type¤È¤·¤Æ ¡Öhost¡×¤ò»ØÄꤷ¤Æ¤¤¤ë¾ì¹ç¤Ë¡¢gfmd¤¬ÍѤ¤¤ë¥µ¡¼¥Ó¥¹¾ÚÌÀ½ñ¤Î ¼ïÎà¤ò»ØÄꤷ¤Þ¤¹¡£ sharedsecretÍøÍÑ»þ¤Ë¤Ï¡¢¤³¤Î»ØÄê¤Ïñ¤Ë̵»ë¤µ¤ì¤Þ¤¹¡£ ÀßÄê¤Î°ÕÌ£¤Ë¤Ä¤¤¤Æ¤Ïspool_server_cred_type¤Î¹à¤ò »²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£ .TP \fBmetadb_server_cred_name \fIcred_name\fB\fR GSIǧ¾Ú¤Ë¤ª¤¤¤Æ¡¢metadb_server_cred_type¤Ç»ØÄꤷ¤¿ÃÍ¤Ë ±þ¤¸¤Æ¡¢gfmd¤¬ÍѤ¤¤ë¾ÚÌÀ½ñ¤ÎÀßÄê¤ò¹Ô¤¤¤Þ¤¹¡£ sharedsecretÍøÍÑ»þ¤Ë¤Ï¡¢¤³¤Î»ØÄê¤Ïñ¤Ë̵»ë¤µ¤ì¤Þ¤¹¡£ ÀßÄê¤Î°ÕÌ£¤Ë¤Ä¤¤¤Æ¤Ïspool_server_cred_type¤Î¹à¤ò »²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£ .TP \fBmetadb_server_stack_size \fI¥Ð¥¤¥È¿ô\fB\fR ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥ÐgfmdÆâ¤Î³Æ¥¹¥ì¥Ã¥É¤¬ÍøÍѤ¹¤ë¥¹¥¿¥Ã¥¯¤Î¥µ¥¤¥º¤ò »ØÄꤷ¤Þ¤¹¡£¾Êά¤µ¤ì¤¿¾ì¹çOS¤Î¥Ç¥Õ¥©¥ë¥ÈÃͤ¬»È¤ï¤ì¤Þ¤¹¡£ ¤³¤Î¥Ñ¥é¥á¡¼¥¿¤Ï¡¢gfmd¤Î¾ÃÈñ¤¹¤ë²¾ÁÛ¥á¥â¥ê¶õ´Ö¤Î¥µ¥¤¥º¤òÀáÌ󤹤뤿¤á¤Ë ÍѤ¤¤Þ¤¹¡£ ¤¿¤È¤¨¤Ð¡¢CentOS 5/i386¤Î¾ì¹ç¡¢¥Ç¥Õ¥©¥ë¥È¤Î¥¹¥¿¥Ã¥¯¥µ¥¤¥º¤Ï10MB¤Ç¤¹ ¤Î¤Ç¡¢¤³¤Î¥Ñ¥é¥á¡¼¥¿¤Ç¥¹¥¿¥Ã¥¯¥µ¥¤¥º¤ò256KB¤ËÍÞ¤¨¤ë¤È¡¢gfmd¤Î¥¹¥¿¥Ã¥¯ ¤¬¾ÃÈñ¤¹¤ë²¾ÁÛ¥á¥â¥ê¶õ´Ö¤Î¥µ¥¤¥º¤ò¡¢1/40¤Ë¸º¤é¤¹¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ ¤³¤Îʸ¤Ïgfmd.conf¤Î¤ß¤ÇÍ­¸ú¤Ç¤¢¤ê¡¢gfarm2.conf¤Ç¤Ï̵»ë¤µ¤ì¤Þ¤¹¡£ Îã: .nf metadb_server_stack_size 262144 .fi .TP \fBmetadb_server_thread_pool_size \fI¥¹¥ì¥Ã¥É¿ô\fB\fR ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ðgfmd¤Î¥¹¥ì¥Ã¥É¥×¡¼¥ë¤Î¥¹¥ì¥Ã¥É¿ô¤ò»ØÄꤷ¤Þ¤¹¡£ ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¥Î¡¼¥É¤Î¥³¥¢¿ô¤¯¤é¤¤¤ËÀßÄꤹ¤ë¤È¸ú²ÌŪ¤Ç¤¹¡£ ¥Ç¥Õ¥©¥ë¥ÈÃͤÏ16¤Ç¤¹¡£ ¤³¤Îʸ¤Ïgfmd.conf¤Î¤ß¤ÇÍ­¸ú¤Ç¤¢¤ê¡¢gfarm2.conf¤Ç¤Ï̵»ë¤µ¤ì¤Þ¤¹¡£ Îã: .nf metadb_server_thread_pool_size 16 .fi .TP \fBmetadb_server_job_queue_length \fI¥­¥å¡¼Ä¹\fB\fR ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ðgfmd¤Î¥¸¥ç¥Ö¥­¥å¡¼¤Î¥­¥å¡¼Ä¹¤ò»ØÄꤷ¤Þ¤¹¡£ °ìÅÙ¤ËÀܳ¤¹¤ëºÇÂ祯¥é¥¤¥¢¥ó¥È¤Î¿ô¤¯¤é¤¤¤ËÀßÄꤹ¤ë¤È¸ú²ÌŪ¤Ç¤¹¡£ ¥Ç¥Õ¥©¥ë¥ÈÃͤÏ16000¤Ç¤¹¡£ ¤³¤Îʸ¤Ïgfmd.conf¤Î¤ß¤ÇÍ­¸ú¤Ç¤¢¤ê¡¢gfarm2.conf¤Ç¤Ï̵»ë¤µ¤ì¤Þ¤¹¡£ Îã: .nf metadb_server_job_queue_length 160 .fi .TP \fBmetadb_server_heartbeat_interval \fIÉÿô\fB\fR ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ðgfmd¤¬³Æ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥µ¡¼¥Ðgfsd ¤ËÂФ·Æ°ºî³Îǧ¤ò¹Ô¤¦¥Ï¡¼¥È¥Ó¡¼¥È¤Î´Ö³Ö¤òÉÿô¤Ç»ØÄꤷ¤Þ¤¹¡£ ¥Ç¥Õ¥©¥ë¥ÈÃͤÏ180ÉäǤ¹¡£ Gfarm-2.3.0¤Þ¤Ç¤Ï¤³¤Îʸ¤Ïgfmd.conf¤Î¤ß¤ÇÍ­¸ú¤Ç¤¢¤ê¡¢gfarm2.conf¤Ç¤Ï ̵»ë¤µ¤ì¤Æ¤¤¤Þ¤·¤¿¤¬¡¢Gfarm-2.4.0°Ê¹ß¤Ïgfsd¤â¤³¤Î¥Ñ¥é¥á¡¼¥¿¤òÍøÍѤ· gfmdÄä»ß¤ò¸¡ÃΤ¹¤ë¤¿¤á¡¢ gfarm2.conf¤Ègfmd.conf¤ÎξÊý¤Ç»ØÄꤹ¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£ Îã: .nf metadb_server_heartbeat_interval 180 .fi .TP \fBmetadb_server_dbq_size \fI¥­¥å¡¼Ä¹\fB\fR ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ðgfmd¤Ç¤Ï¥á¥¿¥Ç¡¼¥¿¤ÎÊѹ¹¤ò¥Ð¥Ã¥¯¥¨¥ó¥ÉDB¤Ë È󯱴üŪ¤ËÈ¿±Ç¤·¤Þ¤¹¤¬¡¤¤½¤Î¥­¥å¡¼¤ÎŤµ¤ò»ØÄꤷ¤Þ¤¹¡£ ¥­¥å¡¼Ä¹¤òŤ¯¤¹¤ë¤È¡¤¥Ð¥Ã¥¯¥¨¥ó¥ÉDB¤Î¹¹¿·Â®ÅÙ¤ËΧ®¤µ¤ì¤Ë¤¯¤¯¤Ê¤ê¤Þ¤¹¡£ ¥Ç¥Õ¥©¥ë¥ÈÃͤÏ65536¤Ç¤¹¡£ ¤³¤Îʸ¤Ïgfmd.conf¤Î¤ß¤ÇÍ­¸ú¤Ç¤¢¤ê¡¢gfarm2.conf¤Ç¤Ï̵»ë¤µ¤ì¤Þ¤¹¡£ Îã: .nf metadb_server_dbq_size 65536 .fi .TP \fBldap_server_host \fILDAP¥µ¡¼¥Ð¡¼¡¦¥Û¥¹¥È̾\fB\fR gfmd¤Î¥Ð¥Ã¥¯¥¨¥ó¥É¡¦¥Ç¡¼¥¿¥Ù¡¼¥¹¤È¤·¤Æ LDAP¥µ¡¼¥Ð¤òÁªÂò¤¹¤ë¾ì¹ç¡¢ LDAP¥µ¡¼¥Ð¡¼¤¬Æ°ºî¤·¤Æ¤¤¤ë¥Û¥¹¥È̾¤ò»ØÄꤷ¤Þ¤¹¡£ ¤³¤Îʸ¤Ïgfmd.conf¤ÇÍѤ¤¤é¤ì¡¢gfarm2.conf¤Ç¤ÏÍѤ¤¤é¤ì¤Þ¤»¤ó¡£ Îã: .nf ldap_server_host ldap.example.com .fi .TP \fBldap_server_port \fILDAP¥µ¡¼¥Ð¡¼¡¦¥Ý¡¼¥ÈÈÖ¹æ\fB\fR LDAP¥µ¡¼¥Ð¡¼¤¬ÍøÍѤ¹¤ëTCP¥Ý¡¼¥È¤ÎÈÖ¹æ¤ò»ØÄꤷ¤Þ¤¹¡£ ldap_server_host¤ò»ØÄꤹ¤ë¾ì¹ç¤Ë¤Ï¡¢ ¤³¤ÎÀßÄê¤Ïɬ¿Ü¤Ç¤¹¡£ Îã: .nf ldap_server_port 602 .fi .TP \fBldap_base_dn \fILDAP_base_distinguished_name\fB\fR LDAP¥Ç¡¼¥¿¥Ù¡¼¥¹¤ÇÊÝ»ý¤¹¤ë¥Ç¡¼¥¿¤Î¥­¡¼¤Îº¬¤È¤Ê¤ë¥Î¡¼¥É¤Î ̾¾Î¡¢base distinguished name¤ò»ØÄꤷ¤Þ¤¹¡£ ldap_server_host¤ò»ØÄꤹ¤ë¾ì¹ç¤Ë¤Ï¡¢ ¤³¤ÎÀßÄê¤Ïɬ¿Ü¤Ç¤¹¡£ Îã: .nf ldap_base_dn "dc=example, dc=com" .fi .TP \fBldap_bind_dn \fILDAP_bind_distinguished_name\fB\fR LDAP¥Ç¡¼¥¿¥Ù¡¼¥¹¤ËÀܳ¤¹¤ëºÝ¤Îǧ¾Ú¤ËÍѤ¤¤ë̾¾Î¤ò¡¢distinguished name¤Ç»ØÄꤷ¤Þ¤¹¡£ Îã: .nf ldap_bind_dn "cn=gfarmuser, dc=example, dc=com" .fi .TP \fBldap_bind_password \fIpassword\fB\fR LDAP¥Ç¡¼¥¿¥Ù¡¼¥¹¤ËÀܳ¤¹¤ëºÝ¤Îǧ¾Ú¥Ñ¥¹¥ï¡¼¥É¤ò»ØÄꤷ¤Þ¤¹¡£ Îã: .nf ldap_bind_password "secret-ldap-password" .fi .TP \fBpostgresql_server_host \fIPostgreSQL¥µ¡¼¥Ð¡¼¡¦¥Û¥¹¥È̾\fB\fR gfmd¤Î¥Ð¥Ã¥¯¥¨¥ó¥É¡¦¥Ç¡¼¥¿¥Ù¡¼¥¹¤È¤·¤Æ PostgreSQL¥µ¡¼¥Ð¤òÁªÂò¤¹¤ë¾ì¹ç¡¢ PostgreSQL¥µ¡¼¥Ð¡¼¤¬Æ°ºî¤·¤Æ¤¤¤ë¥Û¥¹¥È̾¤ò»ØÄꤷ¤Þ¤¹¡£ ¤³¤Îʸ¤Ïgfmd.conf¤ÇÍѤ¤¤é¤ì¡¢gfarm2.conf¤Ç¤ÏÍѤ¤¤é¤ì¤Þ¤»¤ó¡£ Îã: .nf postgresql_server_host postgresql.example.com .fi .TP \fBpostgresql_server_port \fIPostgreSQL¥µ¡¼¥Ð¡¼¡¦¥Ý¡¼¥ÈÈÖ¹æ\fB\fR PostgreSQL¥µ¡¼¥Ð¡¼¤¬ÍøÍѤ¹¤ëTCP¥Ý¡¼¥È¤ÎÈÖ¹æ¤ò»ØÄꤷ¤Þ¤¹¡£ postgresql_server_host¤ò»ØÄꤹ¤ë¾ì¹ç¤Ë¤Ï¡¢ ¤³¤ÎÀßÄê¤Ïɬ¿Ü¤Ç¤¹¡£ Îã: .nf postgresql_server_port 602 .fi .TP \fBpostgresql_dbname \fIdbname\fB\fR PostgreSQL¥Ç¡¼¥¿¥Ù¡¼¥¹Ì¾¤ò»ØÄꤷ¤Þ¤¹¡£ postgresql_server_host¤ò»ØÄꤹ¤ë¾ì¹ç¤Ë¤Ï¡¢ ¤³¤ÎÀßÄê¤Ïɬ¿Ü¤Ç¤¹¡£ Îã: .nf postgresql_dbname gfarm .fi .TP \fBpostgresql_user \fIuser\fB\fR PostgreSQL¥Ç¡¼¥¿¥Ù¡¼¥¹¤ËÀܳ¤¹¤ë¥Ç¡¼¥¿¥Ù¡¼¥¹´ÉÍý²¼¤Î¥æ¡¼¥¶Ì¾¤ò»ØÄꤷ¤Þ¤¹¡£ Îã: .nf postgresql_user gfarm .fi .TP \fBpostgresql_password \fIpassword\fB\fR PostgreSQL¥Ç¡¼¥¿¥Ù¡¼¥¹¤ËÀܳ¤¹¤ë¥Ç¡¼¥¿¥Ù¡¼¥¹´ÉÍý²¼¤Î¥æ¡¼¥¶¤Î¥Ñ¥¹¥ï¡¼¥É¤ò»ØÄꤷ¤Þ¤¹¡£ Îã: .nf postgresql_password "secret-postgresql-password" .fi .TP \fBpostgresql_conninfo \fIconnection_info\fB\fR PostgreSQL¥Ç¡¼¥¿¥Ù¡¼¥¹¤ËÀܳ¤¹¤ë¤È¤­¤ÎÀܳ¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Þ¤¹¡£ Îã: .nf postgresql_conninfo "sslmode=require connect_timeout=30" .fi .TP \fBauth \fIÍ­¸úÀ­\fB\~ \fIǧ¾ÚÊýË¡\fB\~ \fI¥Û¥¹¥È»ØÄê\fB\fR ¤³¤Îʸ¤Ï¡¢Âè3°ú¿ô¤Ç»ØÄꤷ¤¿¥Û¥¹¥È¤È¤ÎÄÌ¿®¤ËÍѤ¤¤ëǧ¾ÚÊýË¡¤òÀßÄꤷ¤Þ¤¹¡£ Âè1°ú¿ô¤Î\fIÍ­¸úÀ­\fRÉô¤Ë¤Ï¡¢enable¤Ê¤¤¤·disable ¥­¡¼¥ï¡¼¥É¤ò»ØÄꤷ¤Þ¤¹¡£ Âè2°ú¿ô¤Î\fIǧ¾ÚÊýË¡\fRÉô¤Ë¤Ï¡¢gsi¡¢ gsi_auth¤Ê¤¤¤·sharedsecret ¥­¡¼¥ï¡¼¥É¤ò»ØÄꤷ¤Þ¤¹¡£ Âè3°ú¿ô¤Ë¤Ï¡¢\fI¥Û¥¹¥È»ØÄê\fR¤òµ­½Ò¤·¤Þ¤¹¡£ ¤³¤Îʸ¤ÏÊ£¿ô»ØÄê²Äǽ¤Ç¤¹¡£³ÆÇ§¾ÚÊýË¡¤´¤È¤Ë¡¢ÀèÆ¬¤«¤é½ç¤Ë¥Û¥¹¥È»ØÄê¤Ë Ŭ¹ç¤¹¤ë¤«¤É¤¦¤«Ä´¤Ù¡¢Í­¸ú¤Ç¤¢¤ë¤È¤Î»ØÄê¤ËŬ¹ç¤·¤¿¾ì¹ç¡¢¤½¤Îǧ¾ÚÊýË¡¤¬ ÍøÍѸõÊä¤Ë¤Ê¤ê¤Þ¤¹¡£Í­¸ú¤Ç¤¢¤ë¤È¤Î»ØÄê¤ËŬ¹ç¤·¤Ê¤¤¾ì¹ç¤ä¡¢¤¢¤ë¤¤¤Ï Í­¸ú¤Ç¤¢¤ë¤È¤Î»ØÄê¤ËŬ¹ç¤¹¤ë¤è¤ê¤âÁ°¤Ë̵¸ú¤Ç¤¢¤ë¤È¤Î»ØÄê¤ËŬ¹ç¤·¤¿ ¾ì¹ç¡¢¤½¤Îǧ¾ÚÊýË¡¤Ï¡¢¸õÊä¤Ë¤Ê¤ê¤Þ¤»¤ó¡£ ¤³¤Î»ØÄê¤Ï¡¢¥µ¡¼¥Ð¡¼Â¦¤È¥¯¥é¥¤¥¢¥ó¥È¦¤ÎξÊý¤Ç²ò¼á¤µ¤ì¡¢ ÁÐÊý¤È¤â¤ÇÍ­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ëǧ¾ÚÊýË¡¤Î¤ß¤¬ÍѤ¤¤é¤ì¤Þ¤¹¡£ ǧ¾ÚÊýË¡¤¬°Û¤Ê¤ë¤â¤Î¤Ë´Ø¤·¤Æ¤Ï¡¢»ØÄê¤Î½ç½ø¤Ï°ÕÌ£¤¬¤¢¤ê¤Þ¤»¤ó¡£ Ê£¿ô¤Îǧ¾ÚÊýË¡¤¬¸õÊä¤È¤Ê¤Ã¤¿¾ì¹ç¡¢sharedsecret¡¢ gsi_auth¡¢gsiǧ¾Ú¤Î½ç½ø¤Ç»î¤ß¤Þ¤¹¡£ Gfarm¤Î¥³¥ó¥Ñ¥¤¥ë»þ¤Ëglobus¤È¤Î¥ê¥ó¥¯¤ò»ØÄꤷ¤Ê¤«¤Ã¤¿¾ì¹ç¡¢ GSI¤ÏÍøÍѤǤ­¤Þ¤»¤ó¡£¤³¤Î¾ì¹ç¡¢gsi¤ª¤è¤Ó gsi_authǧ¾Ú¤Î»ØÄê¤Ïñ¤Ë̵»ë¤µ¤ì¤Þ¤¹¡£ ¤³¤ÎÀßÄê¤Ïɬ¿Ü¤Ç¤¹¡£ Îã: .nf auth disable sharedsecret 192.168.0.100 auth disable sharedsecret 192.168.0.101 auth enable sharedsecret 192.168.0.0/24 auth enable gsi_auth 10.0.0.0/8 auth enable gsi * .fi ¤³¤ÎÎã¤Ç¤Ï¡¢¥Û¥¹¥È192.168.0.100¤È192.168.0.101¤Î2¤Ä¤Î¥Û¥¹¥È¤ò ½ü¤¤¤¿192.168.0.0/24¥Í¥Ã¥È¥ï¡¼¥¯¤Ë°¤¹¥Û¥¹¥È¤Ë¤Ï sharedsecret¤Ègsi¤ÎξÊý¤ò¡¢ 10.0.0.0/8¥Í¥Ã¥È¥ï¡¼¥¯¤Ë°¤¹¥Û¥¹¥È¤Ë¤Ïgsi_auth¤ª¤è¤Ó gsi¤ÎξÊý¤ò¡¢ ¤½¤ì°Ê³°¤ÎÁ´¤Æ¤Î¥Û¥¹¥È¤Ë¤Ïgsiǧ¾Ú¤Î¤ß¤ò»î¤ß¤Þ¤¹¡£ ¤¹¤Ê¤ï¤Á¡¢¥Û¥¹¥È192.168.0.100¤È192.168.0.101¤Î2¤Ä¤Î¥Û¥¹¥È¤Ï¡¢ gsiǧ¾Ú¤Î¤ß¤ò»î¤ß¤ë¤³¤È¤Ë¤Ê¤ê¤Þ¤¹¡£ .TP \fBsockopt \fI¥ª¥×¥·¥ç¥ó\fB[=\fIÃÍ\fB] [LISTENER | \fI¥Û¥¹¥È»ØÄê\fB]\fR ÄÌ¿®socket(2)¤ËÂФ·¤Æ¡¢setsockopt(2)¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò»È¤Ã¤Æ ¥½¥±¥Ã¥È¡¦¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Þ¤¹¡£ Âè2°ú¿ô¤ËÁ´¤ÆÂçʸ»ú¤ÇLISTENER¤ò»ØÄꤷ¤¿¾ì¹ç¡¢ ¥µ¡¼¥Ð¡¼Â¦(Ãå¸ÆÂ¦)¤Î¥½¥±¥Ã¥È¤Ë»ØÄꤹ¤ë¥ª¥×¥·¥ç¥ó¤Ë¤Ê¤ê¤Þ¤¹¡£ ¤³¤Î¾ì¹ç¡¢ÄÌ¿®¤¹¤ëÁê¼ê¤Ë´Ø·¸¤Ê¤¯¡¢ °ìΧ¤Ë¥½¥±¥Ã¥È¡¦¥ª¥×¥·¥ç¥ó¤¬ÀßÄꤵ¤ì¤Þ¤¹¡£ Âè2°ú¿ô¤Ë¥Û¥¹¥È»ØÄê¤òµ­½Ò¤·¤¿¾ì¹ç¡¢¥¯¥é¥¤¥¢¥ó¥È¦(ȯ¸ÆÂ¦)¤Î ¥½¥±¥Ã¥È¤Ë»ØÄꤹ¤ë¥ª¥×¥·¥ç¥ó¤Ë¤Ê¤ê¤Þ¤¹¡£¤³¤Î¾ì¹ç¡¢ÄÌ¿®¤¹¤ëÁê¼êËè¤Ë ¥½¥±¥Ã¥È¡¦¥ª¥×¥·¥ç¥ó¤òÊѤ¨¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ ¤Ê¤ª¡¢Âè2°ú¿ô¤Ë"*"¤Èµ­½Ò¤¹¤ë¤È¡¢¥¯¥é¥¤¥¢¥ó¥È¦(ȯ¸ÆÂ¦)¤ÎÁ´¤Æ¤Î ¥Û¥¹¥È¤ò°ÕÌ£¤¹¤ë¤³¤È¤Ë¤Ê¤ê¡¢¥µ¡¼¥Ð¡¼Â¦(Ãå¸ÆÂ¦)¤Ë¤ÏŬÍѤµ¤ì¤Þ¤»¤ó¡£ Âè2°ú¿ô¤ò¾Êά¤·¤¿¾ì¹ç¡¢¥µ¡¼¥Ð¡¼Â¦¤È¥¯¥é¥¤¥¢¥ó¥È¦¤ÎξÊý¤Ç¡¢ Á´¤Æ¤ÎÄÌ¿®Áê¼ê¤ËÂФ·¤ÆÆ±¤¸¥½¥±¥Ã¥È¡¦¥ª¥×¥·¥ç¥ó¤òÀßÄꤷ¤Þ¤¹¡£ »ØÄê²Äǽ¤Ê¥½¥±¥Ã¥È¡¦¥ª¥×¥·¥ç¥ó¤Ë¤Ï¼¡¤Î¤â¤Î¤¬¤¢¤ê¤Þ¤¹¡£ debug¡£setsockopt(2)¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ç¡¢SO_DEBUG¥½¥±¥Ã¥È¡¦¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Þ¤¹¡£Ãͤòµ­½Ò¤¹¤ëɬÍפϤ¢¤ê¤Þ¤»¤ó¡£ keepalive¡£setsockopt(2)¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ç¡¢SO_KEEPALIVE ¥½¥±¥Ã¥È¡¦¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Þ¤¹¡£Ãͤòµ­½Ò¤¹¤ëɬÍפϤ¢¤ê¤Þ¤»¤ó¡£ sndbuf¡£setsockopt(2)¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ç¡¢SO_SNDBUF ¥½¥±¥Ã¥È¡¦¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Þ¤¹¡£ÃͤλØÄ꤬ɬÍפǤ¹¡£ rcvbuf¡£setsockopt(2)¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ç¡¢SO_RCVBUF ¥½¥±¥Ã¥È¡¦¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Þ¤¹¡£ÃͤλØÄ꤬ɬÍפǤ¹¡£ tcp_nodelay¡£setsockopt(2)¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ç¡¢TCP_NODELAY ¥½¥±¥Ã¥È¡¦¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Þ¤¹¡£Ãͤòµ­½Ò¤¹¤ëɬÍפϤ¢¤ê¤Þ¤»¤ó¡£ Îã: .nf sockopt tcp_nodelay 192.168.0.0/24 sockopt sndbuf=1048576 10.0.0.0/8 sockopt sndbuf=1048576 LISTENER sockopt rcvbuf=1048576 10.0.0.0/8 sockopt rcvbuf=1048576 LISTENER .fi .TP \fBknown_network \fI¥Û¥¹¥È»ØÄê\fB\fR ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Î¥Í¥Ã¥È¥ï¡¼¥¯¤ò»ØÄꤷ¤Þ¤¹¡£ Ëܥͥåȥ¥¯¤Ï¡¢ ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥ÉÁªÂò»þ¤Î¥°¥ë¡¼¥Ô¥ó¥°¤ËÍøÍѤµ¤ì¤Þ¤¹¡£ ¤³¤Îʸ¤Ç»ØÄꤷ¤¿¥¢¥É¥ì¥¹¤ËŬ¹ç¤·¤Ê¤¤IP¥¢¥É¥ì¥¹¤Î¾ì¹ç¡¢ IPv4¤Î¥¯¥é¥¹C¥Í¥Ã¥È¥ï¡¼¥¯¤¬²¾Äꤵ¤ì¤Þ¤¹¡£ Îã: .nf known_network 192.168.0.0/24 .fi .TP \fBadmin_user \fI¥æ¡¼¥¶Ì¾\fB\fR gfmd.confÆâ¤Î¤³¤Îʸ¤Ç»ØÄꤵ¤ì¤¿¥æ¡¼¥¶¤¬¡¢ ¥Ç¥Õ¥©¥ë¥È¤ÎÆÃ¸¢¥æ¡¼¥¶¤È¤Ê¤ê¤Þ¤¹¡£ .TP \fBadmin_user_gsi_dn \fIDN\fB\fR gfmd.confÆâ¤Îadmin_userʸ¤Ç»ØÄꤵ¤ì¤¿ÆÃ¸¢¥æ¡¼¥¶¤ÎSubject DN¤ò»ØÄꤷ¤Þ¤¹¡£ .TP \fBlocal_user_map \fI¥æ¡¼¥¶¥Þ¥Ã¥×¥Õ¥¡¥¤¥ë¥Ñ¥¹Ì¾\fB\fR sharedsecretǧ¾Ú¤Ë¤ª¤¤¤Æ¡¢ ¥°¥í¡¼¥Ð¥ë¥æ¡¼¥¶Ì¾¤È¥í¡¼¥«¥ë¥æ¡¼¥¶Ì¾¤ÎÂбþ´Ø·¸¤òµ­½Ò¤·¤¿ ¥æ¡¼¥¶¥Þ¥Ã¥×¥Õ¥¡¥¤¥ë¥Ñ¥¹Ì¾¤ò»ØÄꤷ¤Þ¤¹¡£ ¤³¤ÎÀßÄê¤Ïɬ¿Ü¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¤¬¡¢ ¤½¤Î¾ì¹ç¥í¡¼¥«¥ë¥æ¡¼¥¶Ì¾¤¬¥°¥í¡¼¥Ð¥ë¥æ¡¼¥¶Ì¾¤ËÊÑ´¹¤µ¤ì¤Þ¤¹¡£ Ʊ°ì¥æ¡¼¥¶¡¼¤ËÂФ·¤Æ¡¢ °Û¤Ê¤ë¥í¡¼¥«¥ë¥¢¥«¥¦¥ó¥È̾¤òÍ¿¤¨¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤¬¤¢¤ë¾ì¹ç¤ä¡¢ ¥í¡¼¥«¥ë¥æ¡¼¥¶Ì¾¤È¤Ï°Û¤Ê¤ë¥°¥í¡¼¥Ð¥ë¥æ¡¼¥¶Ì¾¤òÍøÍѤ·¤¿¤¤¾ì¹ç¡¢ ¤³¤Î¥Õ¥¡¥¤¥ë¤Ç¡¢³Æ¥Î¡¼¥É¤Î¥í¡¼¥«¥ë¤Ê¥æ¡¼¥¶Ì¾¤ËÂФ·¤Æ¡¢Ã±°ì¤Î ¥°¥í¡¼¥Ð¥ë¥æ¡¼¥¶Ì¾¤òÄêµÁ¤·¤Þ¤¹¡£ Îã: .nf local_user_map /etc/gfarm/gfarm-usermap .fi ¥æ¡¼¥¶¡¼¥Þ¥Ã¥×¥Õ¥¡¥¤¥ë¤Ï¡¢¥°¥í¡¼¥Ð¥ë¥æ¡¼¥¶¡¼Ì¾¤È ¥í¡¼¥«¥ë¥æ¡¼¥¶¡¼Ì¾¤ò¡¢¶õÇò¤Ç¶èÀڤäƳƹԤ˵­½Ò¤·¤Þ¤¹¡£ ¥æ¡¼¥¶¥Þ¥Ã¥×¥Õ¥¡¥¤¥ë¤ÎÆâÍÆÎã: .nf foobar foo quux baz .fi ¤³¤ÎÎã¤Î1¹ÔÌܤλØÄê¤Ç¤Ï¡¢¤³¤Î¥Î¡¼¥É¤Î¥í¡¼¥«¥ë¥æ¡¼¥¶Ì¾foo¤Ë ÂФ·¤Æ¥°¥í¡¼¥Ð¥ë¥æ¡¼¥¶Ì¾foobar¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£ .TP \fBlocal_group_map \fI¥°¥ë¡¼¥×¥Þ¥Ã¥×¥Õ¥¡¥¤¥ë¥Ñ¥¹Ì¾\fB\fR ¥°¥í¡¼¥Ð¥ë¥°¥ë¡¼¥×̾¤È¥í¡¼¥«¥ë¥°¥ë¡¼¥×̾¤ÎÂбþ´Ø·¸¤òµ­½Ò¤·¤¿ ¥°¥ë¡¼¥×¥Þ¥Ã¥×¥Õ¥¡¥¤¥ë¥Ñ¥¹Ì¾¤ò»ØÄꤷ¤Þ¤¹¡£ ¤³¤Î¥Þ¥Ã¥×¥Õ¥¡¥¤¥ë¤Ï¡¤¥í¡¼¥«¥ë¥·¥¹¥Æ¥à¤Î¥°¥ë¡¼¥×ID¤òÍøÍѤ¹¤ëgfarm2fs¤ä Globus GridFTP¤ÎGfarm DSI¤Ê¤É¤ÇÍøÍѤµ¤ì¤Þ¤¹¡£ ¤³¤ÎÀßÄê¤Ïɬ¿Ü¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¤¬¡¢ ¤½¤Î¾ì¹ç¥í¡¼¥«¥ë¥°¥ë¡¼¥×̾¤Ï¥°¥í¡¼¥Ð¥ë¥°¥ë¡¼¥×̾¤ÈÅù¤·¤¤¤È²¾Äꤵ¤ì¤Þ¤¹¡£ Îã: .nf local_group_map /etc/gfarm/gfarm-groupmap .fi ¥°¥ë¡¼¥×¥Þ¥Ã¥×¥Õ¥¡¥¤¥ë¤Ï¡¢¥°¥í¡¼¥Ð¥ë¥°¥ë¡¼¥×̾¤È ¥í¡¼¥«¥ë¥°¥ë¡¼¥×̾¤ò¡¢¶õÇò¤Ç¶èÀڤäƳƹԤ˵­½Ò¤·¤Þ¤¹¡£ .TP \fBschedule_cache_timeout \fIÉÿô\fB\fR gfarm¥é¥¤¥Ö¥é¥ê¤¬ÆâÉôŪ¤ËÊÝ»ý¤·¤Æ¤¤¤ë¡¢¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É ¤Î¥¹¥±¥¸¥å¡¼¥ê¥ó¥°½èÍý¤Ë´Ø¤ï¤ë¾ðÊ󡢤¹¤Ê¤ï¤Á¥í¡¼¥É¥¢¥Ù¥ì¡¼¥¸¡¢ ¥Ç¥£¥¹¥¯¶õ¤­ÍÆÎÌ¡¢Ç§¾Ú¤¬Ä̤뤫Èݤ«Åù¤Î¥­¥ã¥Ã¥·¥å¤ÎÍ­¸ú´ü¸Â¤òÉÿô¤Ç»ØÄꤷ¤Þ¤¹¡£ Ää»ß¤·¤Æ¤¤¤¿¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤¬Éü³è¤·¤¿¤è¤¦¤Ê¾ì¹ç¡¢¤³¤Î´ü¸Â¤¬ ÀÚ¤ì¤ë¤Þ¤Ç¤Ï¡¢¤½¤Î¥Î¡¼¥É¤¬¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¤µ¤ì¤Ê¤¤¤³¤È¤¬¤¢¤ê¤Þ¤¹¡£ ¥Ç¥Õ¥©¥ë¥È¤Ï600É乤ʤï¤Á10ʬ¤Ç¤¹¡£ Îã: .nf schedule_cache_timeout 60 .fi .TP \fBschedule_idle_load_thresh \fICPUÉé²Ù\fB\fR ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Î¥¹¥±¥¸¥å¡¼¥ê¥ó¥°»þ¤Ë¡¢ CPUÉé²Ù¤¬Ä㤤¤È¤ß¤Ê¤µ¤ì¤ëCPUÉé²Ù¤ò»ØÄꤷ¤Þ¤¹¡£ ¤³¤³¤Ç»ØÄꤵ¤ì¤ëCPUÉé²Ù¤è¤êÄ㤤CPUÉé²Ù¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤¬ ¤Þ¤º¤Ï¥¹¥±¥¸¥å¡¼¥ëÂоݤȤʤê¤Þ¤¹¡£ ¥Ç¥Õ¥©¥ë¥ÈÃͤÏ0.1¤Ç¤¹¡£ Îã: .nf schedule_idle_load_thresh 0.1 .fi .TP \fBschedule_busy_load_thresh \fICPUÉé²Ù\fB\fR ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Î¥¹¥±¥¸¥å¡¼¥ê¥ó¥°»þ¤Ë¡¢ CPUÉé²Ù¤¬¹â¤¤¤È¤ß¤Ê¤µ¤ì¤ëCPUÉé²Ù¤ò»ØÄꤷ¤Þ¤¹¡£ ¤³¤³¤Ç»ØÄꤵ¤ì¤ëCPUÉé²Ù¤è¤ê¹â¤¤CPUÉé²Ù¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Ï Åö½é¥¹¥±¥¸¥å¡¼¥ëÂоݤȤʤê¤Þ¤»¤ó¡£ ¥Ç¥Õ¥©¥ë¥ÈÃͤÏ0.5¤Ç¤¹¡£ Îã: .nf schedule_busy_load_thresh 0.5 .fi .TP \fBschedule_virtual_load \fICPUÉé²Ù\fB\fR ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤¬ÁªÂò¤µ¤ì¤¿¤È¤­¡¢ CPUÉé²Ù¤Î¥¯¥é¥¤¥¢¥ó¥È¥­¥ã¥Ã¥·¥å¤Ë¤³¤³¤Ç»ØÄꤵ¤ì¤ëCPUÉé²Ù¤¬²Ã¤¨¤é¤ì¤Þ¤¹¡£ ¤³¤ì¤Ë¤è¤ê¡¢ °ìÅÙ¥¹¥±¥¸¥å¡¼¥ë¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤¬²¿Å٤⥹¥±¥¸¥å¡¼¥ë¤µ¤ì¤ë¤³¤È¤òËɤ¤¤Ç¤¤¤Þ¤¹¡£ ¥Ç¥Õ¥©¥ë¥ÈÃͤÏ0.3¤Ç¤¹¡£ Îã: .nf schedule_virtual_load 0.3 .fi .TP \fBminimum_free_disk_space \fI¥Ð¥¤¥È¿ô\fB\fR ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤ÇɬÍפʺǾ®¸ÂÅ٤Υǥ£¥¹¥¯¶õ¤­ÍÆÎ̤ò»ØÄê ¤·¤Þ¤¹¡£¤³¤Î¥µ¥¤¥º°Ê²¼¤Î¶õ¤­ÍÆÎ̤·¤«¤Ê¤¤¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Ï¡¢ ¥Õ¥¡¥¤¥ë½ñ¤­¹þ¤ß¤ò¹Ô¤¦²ÄǽÀ­¤Î¤¢¤ëÁàºî¤ò¹Ô¤¦ºÝ¤Ë¡¢ÁªÂò¤µ¤ì¤Ë¤¯¤¯¤Ê¤ê¤Þ¤¹¡£ »ØÄê¤Ï¥Ð¥¤¥Èñ°Ì¤Ç¹Ô¤¤¤Þ¤¹¤¬¡¢¿ô»ú¤ÎËöÈø¤Ë¶õÇò¤ò³«¤±¤º¤Ëk/M/G/T¤ò»ØÄê ¤¹¤ë¤³¤È¤Ç¡¢¤½¤ì¤¾¤ì1k¥Ð¥¤¥È¡¿1M¥Ð¥¤¥È¡¿1G¥Ð¥¤¥È¡¿1T¥Ð¥¤¥È¤òñ°Ì¤È¤¹¤ë ¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ ¥Ç¥Õ¥©¥ë¥È¤Ï128M¥Ð¥¤¥È¤Ç¤¹¡£ ¤³¤Î¥Ñ¥é¥á¡¼¥¿¤Ï¡¢gfarm2.conf¤Ègfmd.conf¤ÎξÊý¤Ç»ØÄꤹ¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£ Í­¸ú¤Ë¤¹¤ë¤¿¤á¤Ë¤Ï gfmd ¤ª¤è¤Ó Gfarm¥¯¥é¥¤¥¢¥ó¥È¤òºÆµ¯Æ°¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£ Îã: .nf minimum_free_disk_space 1G .fi .TP \fBsimultaneous_replication_receivers \fIƱ»þ½èÍý¿ô\fB\fR gfmd ¼çƳ¤ÎÊ£À½½èÍý¤ò¡¢Ã±°ìÊ£À½ºîÀ®¥Û¥¹¥È¤ËÂФ·¤Æ¡¢ Ʊ»þ¤¤¤¯¤Ä¤Þ¤ÇʹԤ·¤Æ¹Ô¤Ê¤¦¤³¤È¤òµö¤¹¤«¤òÀßÄꤷ¤Þ¤¹¡£ ¥Ç¥Õ¥©¥ë¥È¤Ï 20¤Ç¤¹¡£ Îã: .nf simultaneous_replication_receivers 40 .fi .TP \fBgfsd_connection_cache \fI¥³¥Í¥¯¥·¥ç¥ó¿ô\fB\fR gfarm¥é¥¤¥Ö¥é¥ê¤¬gfsd¤È¤ÎÄÌ¿®¤ËÍѤ¤¤ë¥³¥Í¥¯¥·¥ç¥ó¤ò¡¢¤¤¤¯¤Ä ¤Þ¤Ç¥­¥ã¥Ã¥·¥å¤¹¤ë¤«¤ò»ØÄꤷ¤Þ¤¹¡£ ¥Ç¥Õ¥©¥ë¥È¤Ï16¥³¥Í¥¯¥·¥ç¥ó¤Ç¤¹¡£ Îã: .nf gfsd_connection_cache 32 .fi .TP \fBattr_cache_limit \fI¸Ä¿ô\fB\fR gfarm¥é¥¤¥Ö¥é¥ê¤¬¥­¥ã¥Ã¥·¥å¤¹¤ë°À­¤ÎºÇÂç¿ô¤ò»ØÄꤷ¤Þ¤¹¡£ ¥Ç¥Õ¥©¥ë¥È¤Ï40000¸Ä¤Ç¤¹¡£ Îã: .nf attr_cache_limit 100000 .fi .TP \fBattr_cache_timeout \fI¥ß¥êÉÿô\fB\fR gfarm¥é¥¤¥Ö¥é¥ê¤¬Â°À­¤ò¥­¥ã¥Ã¥·¥å¤·¤Æ¤¤¤ë»þ´Ö¤ò¡¢¥ß¥êÉÃñ°Ì¤Ç»ØÄꤷ¤Þ¤¹¡£ ¥Ç¥Õ¥©¥ë¥È¤Ï 1000¥ß¥êÉ乤ʤï¤Á 1ÉäǤ¹¡£ Îã: .nf attr_cache_timeout 3600000 .fi .TP \fBlog_level \fIÍ¥ÀèÅÙ¥ì¥Ù¥ë\fB\fR ¤É¤ÎÍ¥ÀèÅÙ¥ì¥Ù¥ë°Ê¾å¤Î¥í¥°¤ò½ÐÎϤ¹¤ë¤«¤ò»ØÄꤷ¤Þ¤¹¡£ ¤³¤³¤Ç»ØÄꤷ¤¿¥ì¥Ù¥ë̤Ëþ¤ÎÍ¥ÀèÅÙ¤Î¥í¥°¤Ï¡¢syslog¤äɸ½à¥¨¥é¡¼¤Ø Á÷¤é¤ì¤Þ¤»¤ó¡£ ¥ì¥Ù¥ë¤Ï¡¢Í¥ÀèÅ٤ι⤤½ç¤Ë"emerg", "alert", "crit", "err", "warning", "notice", "info", "debug"¤Ç¤¹¡£ ¥Ç¥Õ¥©¥ë¥È¤Î½ÐÎÏ¥ì¥Ù¥ë¤Ï"info"¤Ç¤¹¡£ "crit"°Ê¾å¤ÎÍ¥ÀèÅÙ¤ò»ØÄꤹ¤ë¤³¤È¤Ï¡¢¤ª´«¤á¤Ç¤­¤Þ¤»¤ó¡£ Îã: .nf log_level debug .fi .TP \fBlog_message_verbose_level \fI¥ì¥Ù¥ë\fB\fR ¥í¥°¥á¥Ã¥»¡¼¥¸¤Î¾éĹÅÙ¤ò»ØÄꤷ¤Þ¤¹¡£ ¥Ç¥Õ¥©¥ë¥È¤Ï0¤Ç¤¹¡£¥ì¥Ù¥ë0¤Ç¤Ï¡¢¥í¥°ID¤¬½ÐÎϤµ¤ì¤Þ¤¹¡£ ¥ì¥Ù¥ë1¤Ç¤Ï¡¢¥ì¥Ù¥ë0¤Ë²Ã¤¨¥½¡¼¥¹¥³¡¼¥É¤Î¥Õ¥¡¥¤¥ë̾¤È¹ÔÈֹ椬½ÐÎϤµ¤ì¤Þ¤¹¡£ ¥ì¥Ù¥ë2¤Ç¤Ï¡¢¥ì¥Ù¥ë1¤Ë²Ã¤¨´Ø¿ô̾¤¬½ÐÎϤµ¤ì¤Þ¤¹¡£ Îã: .nf log_message_verbose_level 1 .fi .TP \fBno_file_system_node_timeout \fIÉÿô\fB\fR ÍøÍѲÄǽ¤Ê¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤¬Â¸ºß¤·¤Ê¤¤¾ì¹ç¡¤ Gfarm¥¯¥é¥¤¥¢¥ó¥È¥é¥¤¥Ö¥é¥ê¤Ï¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤¬ÍøÍѲÄǽ¤Ë¤Ê¤ë¤Þ¤Ç»î¹Ô¤ò·«¤êÊÖ¤·¤Þ¤¹¤¬¡¢ ¤½¤Î¥¿¥¤¥à¥¢¥¦¥È»þ´Ö¤òÉÃñ°Ì¤Ç»ØÄꤷ¤Þ¤¹¡£ ¥Ç¥Õ¥©¥ë¥È¤Ï 30ÉäǤ¹¡£ Îã: .nf no_file_system_node_timeout 30 .fi .TP \fBgfmd_reconnection_timeout \fIÉÿô\fB\fR ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤Ø¤ÎÀܳ¤¬ÀÚÃǤµ¤ì¤¿¾ì¹ç¡¤ ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤Ø¤ÎºÆÀܳ¤ò·«¤êÊÖ¤·¤Þ¤¹¤¬¡¤ ¤½¤Î¥¿¥¤¥à¥¢¥¦¥È»þ´Ö¤òÉÃñ°Ì¤Ç»ØÄꤷ¤Þ¤¹¡£ ¥Ç¥Õ¥©¥ë¥È¤Ï 30ÉäǤ¹¡£ Îã: .nf gfmd_reconnection_timeout 30 .fi .SH "GRAMMAR" .PP gfarm2.conf¤Îʸˡ¤òBNF¤Çµ­½Ò¤¹¤ë¤È¡¢²¼µ­¤Î¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡£ .nf ::= \~\~ | \~\~ | \~\~ | \~\~ | \~\~ | \~\~ | \~\~ | \~\~ | \~\~ | \~\~ | \~\~ | \~\~ | \~\~ | \~\~ | \~\~ | \~\~ | \~\~ | \~\~ | \~\~ | \~\~ | \~\~ | \~\~ | \~\~ | \~\~ | \~\~ | \~\~ | \~\~ | \~\~ | \~\~ | \~\~ | \~\~ | \~\~ | \~\~ | \~\~ | \~\~ | \~\~ | \~\~ | \~\~ | \~\~ | \~\~ | \~\~ | \~\~ | \~\~ | \~\~ ::= "spool" ::= \~\~"spool_server_listen_address" ::= \~\~"spool_server_cred_type" ::= \~\~"spool_server_cred_service" ::= \~\~"spool_server_cred_name" ::= "metadb_server_host" ::= "metadb_server_port" ::= \~\~"metadb_server_cred_type" ::= \~\~"metadb_server_cred_service" ::= \~\~"metadb_server_cred_name" ::= \~\~"metadb_server_stack_size" ::= \~\~"metadb_server_thread_pool_size" ::= \~\~"metadb_server_job_queue_length" ::= \~\~"metadb_server_heartbeat_interval" ::= \~\~"metadb_server_dbq_size" ::= "ldap_server_host" ::= "ldap_server_port" ::= "ldap_base_dn" ::= "ldap_bind_dn" ::= "ldap_bind_password" ::= "postgresql_server_host" ::= "postgresql_server_port" ::= "postgresql_dbname" ::= "postgresql_user" ::= "postgresql_password" ::= "postgresql_conninfo" ::= \~\~"auth" ::= "enable" | "disable" ::= "gsi" | "gsi_auth" | "sharedsecret" ::= \~\~"sockopt" [=] [""LISTENER" | ] = "debug" | "keepalive" | "sndbuf" | "rcvbuf" | \~\~"tcp_nodelay" ::= "known_network" ::= "admin_user" ::= "admin_user_gsi_dn" ::= "local_user_map" ::= "local_group_map" ::= "schedule_cache_timeout" ::= "schedule_idle_load_thresh" ::= "schedule_busy_load_thresh" ::= "schedule_virtual_load" ::= \~\~"minimum_free_disk_space" ::= "simultaneous_replication_receivers" ::= "gfsd_connection_cache" ::= "attr_cache_limit" ::= "attr_cache_timeout" ::= "log_level" ::= "log_message_verbose_level" ::= "no_file_system_node_timeout" ::= "gfmd_reconnection_timeout" ::= | "/" | \~\~ | "." | "*" ::= * ::= | "," | "/" | "_" ::= * ::= | | "-" | "." ::= ::= [ "k" | "M" | "G" | "T" ] ::= [*] ::= "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" ::= """ * """ ::= \~\~ | \~\~"\\\\" | "\\"" ::= "enable" | "disable" ::= "emerg" | "alert" | "crit" | "err" | "warning" | \~\~"notice" | "info" | "debug" .fi .SH "EXAMPLES" .PP ¥á¥¿¥Ç¡¼¥¿¤ÎÊݸ¤ËPostgreSQL¤ò»È¤¤¡¢IP¥¢¥É¥ì¥¹192.168.0.0/24¤Î ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤ä¥¯¥é¥¤¥¢¥ó¥È¤ËÂФ·¤Æ¡¢sharedsecretǧ¾Ú¤ò »È¤¦Îã¤Ç¤¹¡£ .nf spool /var/spool/gfarm metadb_server_host metadb.example.org metadb_server_port 601 postgresql_server_host metadb.example.org postgresql_server_port 5432 postgresql_dbname gfarm postgresql_user gfarm postgresql_password "secret-postgresql-password" auth enable sharedsecret 192.168.0.0/24 sockopt keepalive .fi .PP ¥á¥¿¥Ç¡¼¥¿¤ÎÊݸ¤ËLDAP¤ò»È¤¤¡¢Ç¤°Õ¤ÎIP¥¢¥É¥ì¥¹¤ò»È¤¦ ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤ä¥¯¥é¥¤¥¢¥ó¥È¤ËÂФ·¤Æ¡¢GSIǧ¾Ú¤ò»È¤¦Îã¤Ç¤¹¡£ .nf spool /var/spool/gfarm metadb_server_host metadb.example.com metadb_server_port 601 ldap_server_host metadb.example.com ldap_server_port 602 ldap_base_dn "dc=example, dc=com" ldap_bind_dn "cn=gfarmuser, dc=example, dc=com" ldap_bind_password "secret-ldap-password" auth enable gsi * sockopt keepalive .fi .SH "FILES" .TP \fB\fI%%SYSCONFDIR%%/gfarm2.conf\fB\fR .TP \fB\fI$HOME/.gfarm2rc\fB\fR .SH "SEE ALSO" .PP \fBgfmd\fR(8), \fBgfsd\fR(8), \fBsetsockopt\fR(2) gfarm-2.4.1/man/ja/man5/Makefile0000644000000000000000000000056511507222725014766 0ustar rootroot# $Id: Makefile 2373 2006-01-12 00:54:22Z soda $ top_builddir = ../../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk include $(srcdir)/../Makefile.inc DOCBOOK_DIR=$(top_srcdir)/doc/docbook/ja/ref/man5 include $(DOCBOOK_DIR)/Makefile.inc MAN = $(DOCBOOK) EXTRA_CLEAN_TARGETS = manpage.links manpage.refs include $(top_srcdir)/makes/man.mk gfarm-2.4.1/man/ja/man3/0000755000000000000000000000000011507222730013312 5ustar rootrootgfarm-2.4.1/man/ja/man3/gfs_pio_putc.30000644000000000000000000000147311507222725016070 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_PIO_PUTC" "3" "18 March 2003" "Gfarm" "" .SH NAME gfs_pio_putc \- °ìʸ»ú½ñ¤­¹þ¤ß .SH SYNOPSIS .sp \fB#include .sp char *gfs_pio_putc (GFS_File \fIgf\fB, int \fIc\fB); \fR .SH "DESCRIPTION" .PP ¥Õ¥¡¥¤¥ë \fIgf\fR ¤Ë 1¥Ð¥¤¥È (1ʸ»ú) ¤ÎÃÍ \fIc\fR ¤ò½ñ¤­¹þ¤ß¤Þ¤¹¡£ .SH "RETURN VALUES" .TP \fBNULL\fR Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ .TP \fBGFARM_ERR_NO_MEMORY\fR ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ .TP \fB¤½¤Î¾\fR ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ .SH "SEE ALSO" .PP \fBgfs_pio_create\fR(3), \fBgfs_pio_open\fR(3) gfarm-2.4.1/man/ja/man3/gfs_pio_truncate.30000644000000000000000000000231611507222725016737 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_PIO_TRUNCATE" "3" "17 November 2004" "Gfarm" "" .SH NAME gfs_pio_truncate \- »ØÄꤷ¤¿Ä¹¤µ¤Ë¥Õ¥¡¥¤¥ëÀÚ¤êµÍ¤á¤ë¡£¤â¤·¤¯¤Ï³ÈÄ¥¤¹¤ë¡£ .SH SYNOPSIS .sp \fB#include .sp char *gfs_pio_truncate (GFS_File \fIgf\fB, file_offset_t \fIlength\fB); \fR .SH "DESCRIPTION" .PP ¥Õ¥¡¥¤¥ë \fIgf\fR ¤ÎŤµ¤òÊѹ¹¤·¤Þ¤¹¡£ .PP °ú¿ô \fIlength\fR ¤¬¥Õ¥¡¥¤¥ë \fIgf\fR ¤è¤ê¤âû¤«¤±¤ì¤ÐÀÚ¤êµÍ¤á¤Þ¤¹¡£ .PP °ú¿ô \fIlength\fR ¤¬¥Õ¥¡¥¤¥ë \fIgf\fR ¤è¤ê¤âŤ±¤ì¤Ð³ÈÄ¥¤·¤Þ¤¹¡£³ÈÄ¥¤µ¤ì¤¿Éôʬ¤òÆÉ¤ó¤À¾ì¹ç¤Ï¥¼¥í¤òÊÖ¤·¤Þ¤¹¡£ .PP ¥Õ¥¡¥¤¥ë¥Ý¥¤¥ó¥¿¤ÏÊѹ¹¤·¤Þ¤»¤ó¡£ .PP ¥Õ¥¡¥¤¥ë¤Ï½ñ¤­¹þ¤ßÍѤ˥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£ ¤³¤Î¤¿¤á¡¢¥ª¡¼¥×¥ó»þ¤Ë GFS_FILE_MODE_WRITE ¥Õ¥é¥°¤ò»ØÄꤹ¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£ .SH "RETURN VALUES" .TP \fBNULL\fR Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ .TP \fBGFARM_ERR_NO_MEMORY\fR ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ .TP \fB¤½¤Î¾\fR ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ .SH "SEE ALSO" .PP \fBgfs_pio_create\fR(3), \fBgfs_pio_open\fR(3) gfarm-2.4.1/man/ja/man3/gfarm_terminate.30000644000000000000000000000136211507222725016550 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFARM_TERMINATE" "3" "26 June 2010" "Gfarm" "" .SH NAME gfarm_terminate \- gfarm ¥é¥¤¥Ö¥é¥ê¤Ë´Ø¤¹¤ë½ªÎ»½èÍý¤ò¤¹¤ë .SH SYNOPSIS .sp \fB#include .sp gfarm_error_t gfarm_terminate (\fIvoid\fB); \fR .SH "DESCRIPTION" .PP Gfarm ¥é¥¤¥Ö¥é¥ê¤Ë¤Ä¤¤¤Æ¡¢½ªÎ»½èÍý¤ò¹Ô¤¤¤Þ¤¹¡£ .SH "RETURN VALUES" .TP \fBGFARM_ERR_NO_ERROR\fR Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ .TP \fB¤½¤Î¾\fR ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ .SH "SEE ALSO" .PP \fBgfarm_initialize\fR(3) gfarm-2.4.1/man/ja/man3/gfs_pio_putline.30000644000000000000000000000151411507222725016571 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_PIO_PUTLINE" "3" "18 March 2003" "Gfarm" "" .SH NAME gfs_pio_putline \- °ì¹Ô½ñ¤­¹þ¤ß .SH SYNOPSIS .sp \fB#include .sp char *gfs_pio_putline (GFS_File \fIgf\fB, char * \fIs\fB); \fR .SH "DESCRIPTION" .PP ʸ»úÎó \fIs\fR ¤ò¥Õ¥¡¥¤¥ë \fIgf\fR ¤Ë½ñ¤­¹þ¤ß¡¢¤½¤Î¸å²þ¹Ô¤ò½ñ¤­¹þ¤ß¤Þ¤¹¡£ .SH "RETURN VALUES" .TP \fBNULL\fR Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ .TP \fBGFARM_ERR_NO_MEMORY\fR ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ .TP \fB¤½¤Î¾\fR ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ .SH "SEE ALSO" .PP \fBgfs_pio_create\fR(3), \fBgfs_pio_open\fR(3) gfarm-2.4.1/man/ja/man3/gfs_unlink_section.30000644000000000000000000000226011507222725017265 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_UNLINK_SECTION" "3" "19 May 2005" "Gfarm" "" .SH NAME gfs_unlink_section \- ¥Õ¥¡¥¤¥ë¥»¥¯¥·¥ç¥óºï½ü .SH SYNOPSIS .sp \fB#include .sp char *gfs_unlink_section (char * \fIgfarm_url\fB, char * \fIsection\fB); \fR .SH "DESCRIPTION" .PP °ú¿ô \fIgfarm_url\fR, \fIsection\fR ¤Ë»ØÄꤷ¤¿¥Õ¥¡¥¤¥ë¥»¥¯¥·¥ç¥ó¤òºï½ü¤·¤Þ¤¹¡£ .SH "RETURN VALUES" .TP \fBNULL\fR Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ .TP \fBGFARM_ERR_NO_MEMORY\fR ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ .TP \fBGFARM_ERR_AUTHENTICATION\fR gfmd(8) ¤ËÂФ¹¤ë¥æ¡¼¥¶¡¼Ç§¾Ú¤¬¼ºÇÔ¤·¤Þ¤·¤¿¡£ .TP \fBGFARM_ERR_PERMISSION_DENIED\fR \fIgfarm_url\fR ¤Î¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤Ø½ñ¤­¹þ¤ß¥¢¥¯¥»¥¹¤¹¤ë¸¢¸Â¤¬¤¢¤ê¤Þ¤»¤ó¡£ .TP \fBGFARM_ERR_NO_SUCH_OBJECT\fR »ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¥»¥¯¥·¥ç¥ó¤¬Â¸ºß¤·¤Þ¤»¤ó¡£ .TP \fBGFARM_ERR_NOT_A_DIRECTORY\fR »ØÄꤷ¤¿¥Ñ¥¹Ì¾¤Î¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤¬¡¢¼ÂºÝ¤Ë¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤«¤Ã¤¿¤³¤È¤ò ¼¨¤·¤Þ¤¹¡£ .TP \fB¤½¤Î¾\fR ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ gfarm-2.4.1/man/ja/man3/gfarm_stringlist_elem.30000644000000000000000000000166011507222725017765 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFARM_STRINGLIST_ELEM" "3" "18 March 2003" "Gfarm" "" .SH NAME gfarm_stringlist_elem \- stringlist ¤ÎÍ×ÁÇʸ»ú¤òÊÖ¤¹ .SH SYNOPSIS .sp \fB#include .sp intgfarm_stringlist_elem (gfarm_stringlist * \fIlistp\fB, int \fIi\fB); \fR .SH "DESCRIPTION" .PP \fIlistp\fR¤Î \fIi\fR ÈÖÌܤÎÇÛÎóÍ×ÁǤòÊÖ¤·¤Þ¤¹¡£ .SH "RETURN VALUES" .PP ʸ»úÎóÇÛÎó¤ÎÍ×ÁǤǤ¹¡£ .SH "SEE ALSO" .PP \fBGFARM_STRINGLIST_ELEM\fR(3), \fBGFARM_STRINGLIST_STRARRAY\fR(3), \fBgfarm_stringlist_add\fR(3), \fBgfarm_stringlist_cat\fR(3), \fBgfarm_stringlist_free\fR(3), \fBgfarm_stringlist_free_deeply\fR(3), \fBgfarm_stringlist_init\fR(3), \fBgfarm_stringlist_length\fR(3) gfarm-2.4.1/man/ja/man3/gfs_pio_readdelim.30000644000000000000000000001101111507222725017030 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_PIO_READDELIM" "3" "13 May 2004" "Gfarm" "" .SH NAME gfs_pio_readdelim \- °ì¥ì¥³¡¼¥ÉÆÉ¤ß¹þ¤ß .SH SYNOPSIS .sp \fB#include .sp char *gfs_pio_readdelim (GFS_File \fIf\fB, char **\fIbufp\fB, size_t *\fIsizep\fB, size_t *\fIlenp\fB, char *\fIdelimiter\fB, size_t \fIdelimlen\fB); \fR .SH "DESCRIPTION" .PP ¤³¤Î´Ø¿ô¤Ï¡¢gfs_pio_readline(3) ¤ÈƱÍÍ¤ËÆ¯¤­¤Þ¤¹¤¬¡¢¤¿¤À¤·¡¢ ÆþÎϤΥ»¥Ñ¥ì¡¼¥¿¤ò²þ¹Ôʸ»ú¤Ë¸Â¤é¤º¡¢°ìÈÌŪ¤Ë»ØÄê¤Ç¤­¤ë¤è¤¦¤Ë ¤·¤¿¤â¤Î¤Ç¤¹¡£ ¤³¤Î´Ø¿ô¤Ï¡¢¥Õ¥¡¥¤¥ë \fIgf\fR ¤«¤é¡¢ °ú¿ô \fIdelimiter\fR ¤Ç»ØÄꤵ¤ì¤¿¥Ð¥¤¥ÈÎó¤ò¥ì¥³¡¼¥É´Ö¶èÀÚ¤ê¤È¤·¤Æ¡¢1¥ì¥³¡¼¥ÉÆÉ¤ß¤È¤ê ¤Þ¤¹¡£ °ú¿ô \fIdelimiter\fR ¤Ë¤Ïʸ»ú '\\0' ¤ò´Þ¤à¤³¤È¤â¤Ç¤­¤Þ¤¹¡£¤³¤Î¤¿¤á¡¢¶èÀÚ¤ê¤ÎŤµ¤ò °ú¿ô \fIdelimlen\fR ¤Ç»ØÄꤷ¤Þ¤¹¡£ ¤Ê¤ª¡¢ °ú¿ô \fIdelimiter\fR ¤¬ NULL ¤Î¾ì¹ç¡¢¥Õ¥¡¥¤¥ëÁ´ÂΤò1¥ì¥³¡¼¥É¤È¤·¤Æ¥á¥â¥ê¾å¤ËÆÉ¤ß¹þ¤ß¤Þ¤¹¡£ ¤½¤¦¤Ç¤Ï¤Ê¤¯¡¢¤«¤Ä °ú¿ô \fIdelimlen\fR ¤¬ 0 ¤Î¾ì¹ç¡¢°ì¸Ä°Ê¾å¤ÎϢ³¤¹¤ë¶õ¹Ô (Àµµ¬É½¸½¤Ç¤Ï /\\n\\n+/) ¤ò ¥ì¥³¡¼¥É¶èÀÚ¤ê¤È¸«¤Ê¤·¤Þ¤¹¡£¤³¤Î»ÅÍÍ¤Ï perl ¸À¸ì¤Î INPUT_RECORD_SEPARATOR ¤ò»²¹Í¤Ë¤·¤Æ¤¤¤Þ¤¹¡£ .PP °ú¿ô \fIbufp\fR ¤Ï¡¢ºÇ½é¤Ï NULL ¤Ç½é´ü²½¤µ¤ì¤¿¥Ý¥¤¥ó¥¿ÊÑ¿ô¤Î¥¢¥É¥ì¥¹¤ò»ØÄꤷ¤Þ¤¹¡£ ´Ø¿ô \fBgfs_pio_readdelim()\fR ¤Ï¡¢Æþ½ÐÎϤËÍѤ¤¤ë ¥Ð¥Ã¥Õ¥¡¤òưŪ¤Ë³ä¤êÅö¤Æ¡¢¤½¤Î¥¢¥É¥ì¥¹¤ò¤³¤Î¥Ý¥¤¥ó¥¿ÊÑ¿ô¤Ëµ­Ï¿¤·¤Þ¤¹¡£ °ú¿ô \fIsizep\fR ¤Ï¡¢0 ¤Ç½é´ü²½¤·¤¿ size_t ·¿¤ÎÊÑ¿ô ¤Î¥¢¥É¥ì¥¹¤ò»ØÄꤷ¤Þ¤¹¡£¤³¤ÎÊÑ¿ô¤Ï¡¢¥Ð¥Ã¥Õ¥¡¤Î¥µ¥¤¥º¤òµ­Ï¿¤¹¤ë¤¿¤á¤Ë »È¤ï¤ì¤Þ¤¹¡£ ¤¢¤ë¤¤¤Ï¡¢malloc(3) ¤Ç³ä¤êÅö¤Æ¤¿¥Ð¥Ã¥Õ¥¡¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Î¥¢¥É¥ì¥¹¤ò °ú¿ô \fIbufp\fR ¤Ë»ØÄꤹ¤ë¤³¤È¤â¤Ç¤­¤Þ¤¹¡£¤³¤Î¾ì¹ç¡¢ °ú¿ô \fIsizep\fR ¤Ï¡¢³ä¤êÅö¤Æ¤¿¥Ð¥Ã¥Õ¥¡¤Î¥µ¥¤¥º¤Ç½é´ü²½¤·¤Æ¤ª¤­¤Þ¤¹¡£ ¹Ô¤ÎŤµ¤¬¥Ð¥Ã¥Õ¥¡¤Î¥µ¥¤¥º¤ò±Û¤¨¤ë¾ì¹ç¤Ë¤Ï¡¢¥Ð¥Ã¥Õ¥¡¤Ï¼«Æ°Åª¤Ë realloc(3) ¤µ¤ì¡¢ °ú¿ô \fIbufp\fR ¤ª¤è¤Ó °ú¿ô \fIsizep\fR ¤Ç»ØÄꤵ¤ì¤¿ÊÑ¿ô¤â¤½¤ì¤Ë½¾¤Ã¤Æ¹¹¿·¤µ¤ì¤Þ¤¹¡£ ¥Õ¥¡¥¤¥ë¤òÆÉ¤ß½ª¤ï¤Ã¤¿¤é¡¢¤³¤Î¥Ý¥¤¥ó¥¿¤ò free(3) ¤Ç²òÊü¤¹¤ëɬÍפ¬ ¤¢¤ê¤Þ¤¹¡£ .PP °ú¿ô \fIlenp\fR ¤Î»Ø¤¹ÊÑ¿ô¤Ë¤Ï¡¢ÆÉ¤ß¹þ¤ó¤À¥ì¥³¡¼¥É¤ÎŤµ¤òÊÖ¤·¤Þ¤¹¡£ ¤³¤ÎŤµ¤Ë¤Ï¡¢¥ì¥³¡¼¥É¶èÀÚ¤ê¤Îʬ¤â´Þ¤ß¤Þ¤¹¡£ .PP ¤³¤Î´Ø¿ô¤Ï¥ì¥³¡¼¥ÉËö¤Î¶èÀÚ¤ê¤òºï½ü¤·¤Þ¤»¤ó¡£ ¤Þ¤¿¡¢ °ú¿ô \fIlenp\fR ¤Î»Ø¤¹ÊÑ¿ô¤ËÊ֤ä¿ÃͤòÍøÍѤ¹¤ì¤ÐÎɤ¤¤Î¤Ç¾éŤǤ¹¤¬¡¢ ¥ì¥³¡¼¥ÉËö¤Ë '\\0' ʸ»ú¤òÉղä·¤Þ¤¹¡£ .PP EOF ¤Ï¡¢ÆþÎϤÎŤµ¤¬ 0 ¥Ð¥¤¥È¤Ç¤¢¤ë¤³¤È¤ÇȽÃǤ·¤Þ¤¹¡£ .PP °ú¿ô¤È¤·¤Æ gfs_pio_readdelim(f, bufp, sizep, lenp, "\\n", 1) ¤È»ØÄꤹ¤ë¤È¡¢´Ø¿ô \fBgfs_pio_readline()\fR ¤È Åù²Á¤Ë¤Ê¤ê¤Þ¤¹¡£ .SH "RETURN VALUES" .TP \fBNULL\fR Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ .TP \fBGFARM_ERR_NO_MEMORY\fR ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ ¤³¤Î¾ì¹ç¤â¡¢\fIbufp\fR ¤Î»Ø¤¹¥Ý¥¤¥ó¥¿ÊÑ¿ô¤Î »Ø¤¹Îΰè¤ò free(3) ¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¤«¤éÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡£ .TP \fB¤½¤Î¾\fR ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ .SH "EXAMPLES" .SS "GFS_PIO_READDELIM ´Ø¿ô¤Î»ÈÍÑÎã" .PP .nf #include #include #include #include int main(int argc, char **argv) { char *e; GFS_File gf; size_t bufsize = 0, delimlen = 1, len; char *buffer = NULL, *delim = "\\n"; e = gfarm_initialize(&argc, &argv); if (e != NULL) { fprintf(stderr, "gfarm_initialize: %s\\n", e); return (EXIT_FAILURE); } while ((c = getopt(argc, argv, "d:D")) != -1) { switch (c) { case 'd': delim = optarg; delimlen = strlen(optarg); break; case 'D': delim = NULL; delimlen = 0; break; case '?': default: fprintf(stderr, "invalid option: %c\\n", c); return (EXIT_FAILURE); } } if (optind >= argc) { fprintf(stderr, "missing gfarm filename\\n"); return (EXIT_FAILURE); } e = gfs_pio_open(argv[optind], GFARM_FILE_RDONLY, &gf); if (e != NULL) { fprintf(stderr, "%s: %s\\n", argv[optind], e); return (EXIT_FAILURE); } e = gfs_pio_set_view_global(gf, 0); if (e != NULL) { fprintf(stderr, "%s: gfs_pio_set_view_global: %s\\n", argv[optind], e); return (EXIT_FAILURE); } while ((e = gfs_pio_readdelim(gf, &buffer, &bufsize, &len, delim, delimlen)) == NULL && len > 0) { printf("<%6d/%6d >%s", len, bufsize, buffer); } if (buffer != NULL) free(buffer); if (e != NULL) { fprintf(stderr, "ERROR: %s\\n", e); return (EXIT_FAILURE); } e = gfs_pio_close(gf); if (e != NULL) { fprintf(stderr, "gfs_pio_close: %s\\n", e); return (EXIT_FAILURE); } e = gfarm_terminate(); if (e != NULL) { fprintf(stderr, "gfarm_initialize: %s\\n", e); return (EXIT_FAILURE); } return (EXIT_SUCCESS); } .fi .SH "SEE ALSO" .PP \fBgfs_pio_open\fR(3), \fBgfs_pio_getline\fR(3), \fBgfs_pio_gets\fR(3), \fBgfs_pio_readline\fR(3) gfarm-2.4.1/man/ja/man3/gfarm_stringlist_add.30000644000000000000000000000211611507222725017570 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFARM_STRINGLIST_ADD" "3" "18 March 2003" "Gfarm" "" .SH NAME gfarm_stringlist_add \- stringlist ¤Ëʸ»úÎó¤òÄɲ乤ë .SH SYNOPSIS .sp \fB#include .sp char *gfarm_stringlist_add (gfarm_stringlist * \fIlistp\fB, char * \fIs\fB); \fR .SH "DESCRIPTION" .PP \fIlistp\fR¤Îɽ¤¹Ê¸»úÎóÇÛÎó¤ÎËöÈø¤Ë¡¢Ê¸»úÎó \fIs\fR ¤òÄɲä·¤Þ¤¹¡£ .SH "RETURN VALUES" .TP \fBNULL\fR Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ .TP \fBGFARM_ERR_NO_MEMORY\fR ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ .TP \fB¤½¤Î¾\fR ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ .SH "SEE ALSO" .PP \fBGFARM_STRINGLIST_ELEM\fR(3), \fBGFARM_STRINGLIST_STRARRAY\fR(3), \fBgfarm_stringlist_cat\fR(3), \fBgfarm_stringlist_elem\fR(3), \fBgfarm_stringlist_free\fR(3), \fBgfarm_stringlist_free_deeply\fR(3), \fBgfarm_stringlist_init\fR(3), \fBgfarm_stringlist_length\fR(3) gfarm-2.4.1/man/ja/man3/gfs_rmdir.30000644000000000000000000000214611507222725015361 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_RMDIR" "3" "02 July 2004" "Gfarm" "" .SH NAME gfs_rmdir \- ¥Ç¥£¥ì¥¯¥È¥êºï½ü .SH SYNOPSIS .sp \fB#include .sp char *gfs_rmdir (char * \fIgfarm_url\fB); \fR .SH "DESCRIPTION" .PP °ú¿ô \fIgfarm_url\fR ¤Ë»ØÄꤷ¤¿Ì¾Á°¤Î¥Ç¥£¥ì¥¯¥È¥ê¤òºï½ü¤·¤Þ¤¹¡£ .SH "RETURN VALUES" .TP \fBNULL\fR Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ .TP \fBGFARM_ERR_NO_MEMORY\fR ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ .TP \fBGFARM_ERR_PERMISSION_DENIED\fR \fIgfarm_url\fR ¤Î¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤Ø½ñ¤­¹þ¤ß¥¢¥¯¥»¥¹¤¹¤ë¸¢¸Â¤¬¤¢¤ê¤Þ¤»¤ó¡£ .TP \fBGFARM_ERR_DIRECTORY_NOT_EMPTY\fR »ØÄꤵ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¤¬¡¢¶õ¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£ .TP \fBGFARM_ERR_NO_SUCH_OBJECT\fR »ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Þ¤»¤ó¡£ .TP \fBGFARM_ERR_NOT_A_DIRECTORY\fR »ØÄꤷ¤¿¥Ñ¥¹Ì¾¤Î¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤¬¡¢¼ÂºÝ¤Ë¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤«¤Ã¤¿¤³¤È¤ò ¼¨¤·¤Þ¤¹¡£ .TP \fB¤½¤Î¾\fR ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ gfarm-2.4.1/man/ja/man3/gfarm_url_program_deliver.30000644000000000000000000000243611507222725020626 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFARM_URL_PROGRAM_DELIVER" "3" "18 March 2003" "Gfarm" "" .SH NAME gfarm_url_program_deliver \- ¥×¥í¥°¥é¥à¤ò»ØÄꤷ¤¿¥Û¥¹¥È¤ËÇÛÉÛ¤¹¤ë .SH SYNOPSIS .sp \fB#include .sp char *gfarm_url_program_deliver (char *\fIgfarm_url\fB, int \fInhosts\fB, char **\fIhosts\fB, char ***\fIdelivered_paths\fB); \fR .SH "DESCRIPTION" .PP \fIgfarm_url\fR¤Ç»ØÄꤷ¤¿¥×¥í¥°¥é¥à¤ò¡¢ \fInhosts\fR ¸Ä¤ÎÍ×ÁǤò»ý¤Äʸ»úÎóÇÛÎó \fIhosts\fR ¤Ç»ØÄꤷ¤¿¥Û¥¹¥È¤ËÇÛÉÛ¤·¤Þ¤¹¡£ ÇÛÉÛ¤µ¤ì¤¿³Æ¥Û¥¹¥È¾å¤Ç¤Î¥×¥í¥°¥é¥à¤ÎÀäÂХѥ¹¤ò¡¢ \fInhosts\fR ¸Ä¤ÎÍ×ÁǤò»ý¤Äʸ»úÎóÇÛÎó¤Ë³ÊǼ¤·¡¢¤½¤ÎÇÛÎó¤Î¥¢¥É¥ì¥¹¤ò \fIdelivered_paths\fR ¤¬»Ø¤¹Àè¤ËÊÖ¤·¤Þ¤¹¡£ \fIdelivered_paths\fR .PP ¤ËÆÀ¤¿Ê¸»úÎóÇÛÎó¤Ï¡¢ÉÔÍפˤʤ俤é \fBgfarm_strings_free_deeply\fR(3) ¤Ç²òÊü¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£ .SH "RETURN VALUES" .TP \fBNULL\fR Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ .TP \fBGFARM_ERR_NO_MEMORY\fR ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ .TP \fB¤½¤Î¾\fR ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ .SH "SEE ALSO" .PP \fBgfarm_url_program_deliver\fR(3), \fBgfarm_strings_free_deeply\fR(3) gfarm-2.4.1/man/ja/man3/gfarm_strings_free_deeply.30000644000000000000000000000122011507222725020605 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFARM_STRINGS_FREE_DEEPLY" "3" "18 March 2003" "Gfarm" "" .SH NAME gfarm_strings_free_deeply \- ʸ»úÎó¤ò²òÊü¤¹¤ë .SH SYNOPSIS .sp \fB#include .sp void gfarm_strings_free_deeply (int \fIn\fB, char ** \fIstrings\fB); \fR .SH "DESCRIPTION" .PP Í×ÁÇ¿ô \fIn\fR ¤Îʸ»úÎóÇÛÎó \fIstrings\fR ¤ò²òÊü¤·¤Þ¤¹¡£ ¤Þ¤¿¡¢ÇÛÎóÍ×ÁǤγÆÊ¸»úÎó¤â¡¢²òÊü¤·¤Þ¤¹¡£ gfarm-2.4.1/man/ja/man3/gfarm_hostlist_read.30000644000000000000000000000247311507222725017430 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFARM_HOSTLIST_READ" "3" "18 March 2003" "Gfarm" "" .SH NAME gfarm_hostlist_read \- ¥Û¥¹¥È¹½À®¥Õ¥¡¥¤¥ë¤òÆÉ¤ß¹þ¤à .SH SYNOPSIS .sp \fB#include .sp char *gfarm_hostlist_read (char *\fIfilename\fB, int *\fInp\fB, char ***\fIline_table_p\fB, int *\fIerror_line_p\fB); \fR .SH "DESCRIPTION" .PP Gfarm¥Õ¥¡¥¤¥ë¤ò¥¤¥ó¥Ý¡¼¥È¤¹¤ë¥¢¥×¥ê¥±¡¼¥·¥ç¥óÍѤÎÊä½õ´Ø¿ô¤Î°ì¤Ä¤Ç¤¹¡£ .PP ¥Û¥¹¥È¹½À®¥Õ¥¡¥¤¥ë̾¤ò \fIfilename\fR ¤Ë»ØÄꤹ¤ë¤È¡¢¤½¤Î¥Õ¥¡¥¤¥ë¤«¤é¡¢ ¥Û¥¹¥È¤ÎÇÛÎó¤ò \fIline_table_p\fR ¤Î»Ø¤¹Àè¤Ë¤ËÊÖ¤·¤Þ¤¹¡£ ¹½À®¥Õ¥¡¥¤¥ë¤Ë¹½Ê¸¥¨¥é¡¼¤¬À¸¤¸¤¿¾ì¹ç¤Ë¤Ï¡¢ \fIerror_line_p\fR ¤Î»Ø¤¹Àè¤Ë¡¢¥Õ¥¡¥¤¥ë¤Î¹ÔÈÖ¹æ¤òÊÖ¤·¤Þ¤¹¡£¤³¤ÎÃͤ¬ -1 ¤Î¾ì¹ç¤Ë¤Ï¡¢¹½Ê¸°Ê³°¤Î¥¨¥é¡¼¸¶°ø¤Ç¤¹¡£ .PP ¤³¤³¤ÇÆÀ¤¿¥Û¥¹¥È¤ÎÇÛÎó¤Ï gfarm_strings_free_deeply() ¤òÍѤ¤¤Æ²òÊü ¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£ .SH "RETURN VALUES" .TP \fBNULL\fR Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ .TP \fBGFARM_ERR_NO_MEMORY\fR ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ .TP \fB¤½¤Î¾\fR ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ .SH "SEE ALSO" .PP \fBgfarm_import_fragment_config_read\fR(3), \fBgfarm_import_fragment_size_alloc\fR(3) gfarm-2.4.1/man/ja/man3/gfs_glob.30000644000000000000000000000262511507222725015171 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_GLOB" "3" "11 September 2003" "Gfarm" "" .SH NAME gfs_glob \- ¥Ñ¥¿¡¼¥ó¤Ë¥Þ¥Ã¥Á¤¹¤ë¥Ñ¥¹Ì¾¤ò¼èÆÀ¤¹¤ë .SH SYNOPSIS .sp \fB#include .sp char *gfs_glob (const char * \fIpattern\fB, gfarm_stringlist * \fIpaths\fB, gfs_glob_t * \fItypes\fB); \fR .SH "DESCRIPTION" .PP ¥ï¥¤¥ë¥É¥«¡¼¥É¤ò´Þ¤à°ú¿ô \fIpattern\fR ¤Ë¥Þ¥Ã¥Á¤¹¤ëÁ´¤Æ¤Î¥Ñ¥¹Ì¾¤ò \fIpaths\fR ¤ËÊÖ¤·¤Þ¤¹¡£ .PP ÊÖ¤µ¤ì¤¿¸Ä¡¹¤Î¥Ñ¥¹Ì¾¤ò»²¾È¤¹¤ë¤Ë¤Ï¡¢ gfarm_stringlist_length(3)¡¢ gfarm_stringlist_elem(3) ¤ò»È¤¤¤Þ¤¹¡£ .PP gfs_glob(3) ¤ò»ÈÍѤ¹¤ëÁ°¤Ë¡¢°ú¿ô \fItypes\fR ¤¬»Ø¤¹Îΰè¤ògfs_glob_init(3) ¤ÇưŪ¤Ë³ÎÊݤ·¡¢ »ÈÍѸå gfs_glob_free(3) ¤Ç²òÊü¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£ .SH "RETURN VALUES" .TP \fBNULL\fR Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ .TP \fBGFARM_ERR_NO_MEMORY\fR ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ .TP \fBGFARM_ERR_PATHNAME_TOO_LONG\fR ¥Ñ¥¿¡¼¥ó¤¢¤ë¤¤¤Ï¥Ñ¥¹Ì¾¤¬Ä¹¤¹¤®¤Æ½èÍý¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿¡£ .TP \fB¤½¤Î¾\fR ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ .SH "SEE ALSO" .PP \fBgfs_glob_init\fR(3) \fBgfs_glob_free\fR(3) \fBgfarm_stringlist_init\fR(3) \fBgfarm_stringlist_length\fR(3) \fBgfarm_stringlist_elem\fR(3) \fBgfarm_stringlist_free\fR(3) \fBgfarm_stringlist_free_deeply\fR(3) gfarm-2.4.1/man/ja/man3/gfs_stat_free.30000644000000000000000000000115311507222725016215 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_STAT_FREE" "3" "18 March 2003" "Gfarm" "" .SH NAME gfs_stat_free \- ¥Õ¥¡¥¤¥ë°À­¾ðÊó²òÊü .SH SYNOPSIS .sp \fB#include .sp void gfs_stat_free (struct gfs_stat * \fIstatus\fB); \fR .SH "DESCRIPTION" .PP gfs_stat(3) ¤Ç¼èÆÀ¤·¤¿Â°À­¾ðÊó¤ÎÊÝ»ý¤¹¤ë¥á¥â¥ê¤ò²òÊü¤·¤Þ¤¹¡£ .SH "SEE ALSO" .PP \fBgfs_stat\fR(3) gfarm-2.4.1/man/ja/man3/gfs_opendir.30000644000000000000000000000207611507222725015706 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_OPENDIR" "3" "11 September 2003" "Gfarm" "" .SH NAME gfs_opendir \- ¥Ç¥£¥ì¥¯¥È¥ê¤Î¥ª¡¼¥×¥ó .SH SYNOPSIS .sp \fB#include .sp char *gfs_opendir (const char * \fIgfarm_url\fB, GFS_Dir * \fIdirp\fB); \fR .SH "DESCRIPTION" .PP \fIgfarm_url\fR ¤Ç»ØÄꤷ¤¿¥Ç¥£¥ì¥¯¥È¥ê¤ò¥ª¡¼¥×¥ó¤·¤Þ¤¹¡£ .SH "RETURN VALUES" .TP \fBNULL\fR Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ .TP \fBGFARM_ERR_NO_MEMORY\fR ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ .TP \fBGFARM_ERR_AUTHENTICATION\fR gfmd(8) ¤ËÂФ¹¤ë¥æ¡¼¥¶¡¼Ç§¾Ú¤¬¼ºÇÔ¤·¤Þ¤·¤¿¡£ .TP \fBGFARM_ERR_PERMISSION_DENIED\fR \fIgfarm_url\fR ¤Ø¥¢¥¯¥»¥¹¤¹¤ë¸¢¸Â¤¬¡¢¤¢¤ê¤Þ¤»¤ó¡£ .TP \fBGFARM_ERR_NO_SUCH_OBJECT\fR »ØÄꤵ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¤¬Â¸ºß¤·¤Þ¤»¤ó¡£ .TP \fB¤½¤Î¾\fR ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ .SH "SEE ALSO" .PP \fBgfs_closedir\fR(3), \fBgfs_readdir\fR(3) gfarm-2.4.1/man/ja/man3/gfarm_stringlist_free.30000644000000000000000000000217211507222725017763 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFARM_STRINGLIST_FREE" "3" "18 March 2003" "Gfarm" "" .SH NAME gfarm_stringlist_free, gfarm_stringlist_free_deeply \- stringlist ¤ò²òÊü¤¹¤ë .SH SYNOPSIS .sp \fB#include .sp void gfarm_stringlist_free (gfarm_stringlist * \fIlistp\fB); .sp void gfarm_stringlist_free_deeply (gfarm_stringlist * \fIlistp\fB); \fR .SH "DESCRIPTION" .PP ưŪ¤Ë³ÎÊݤ·¤¿¥á¥â¥ê¤ò²òÊü¤·¤Þ¤¹¡£ .PP ´Ø¿ô gfarm_stringlist_free() ¤Ï¡¢ÊÑ¿ô \fIlistp\fR ¤¬É½¤¹Ê¸»úÎóÇÛÎó¤ÎÍ×ÁǤǤ¢¤ë³ÆÊ¸»úÎó¤Ë¤Ä¤¤¤Æ¤Ï²òÊü¤·¤Þ¤»¤ó¡£ .PP ¤³¤ì¤ËÂФ·¡¢´Ø¿ô gfarm_stringlist_free_deeply() ¤Ï¡¢Ê¸»úÎóÇÛÎó¤ÎÍ×ÁÇ¤Ç ¤¢¤ë³ÆÊ¸»úÎó¤â²òÊü¤·¤Þ¤¹¡£ .SH "SEE ALSO" .PP \fBGFARM_STRINGLIST_ELEM\fR(3), \fBGFARM_STRINGLIST_STRARRAY\fR(3), \fBgfarm_stringlist_add\fR(3), \fBgfarm_stringlist_cat\fR(3), \fBgfarm_stringlist_elem\fR(3), \fBgfarm_stringlist_init\fR(3), \fBgfarm_stringlist_length\fR(3) gfarm-2.4.1/man/ja/man3/gfs_pio_open.30000644000000000000000000000705111507222725016054 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_PIO_OPEN" "3" "27 June 2010" "Gfarm" "" .SH NAME gfs_pio_open \- Gfarm¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥Õ¥¡¥¤¥ë¤Î¥ª¡¼¥×¥ó .SH SYNOPSIS .sp \fB#include .sp gfarm_error_t gfs_pio_open (const char * \fIgfarm_url\fB, int \fIflags\fB, GFS_File * \fIgfp\fB); \fR .SH "DESCRIPTION" .PP \fIgfarm_url\fR ¤Ç»ØÄꤷ¤¿¥Õ¥¡¥¤¥ë¤ò¥ª¡¼¥×¥ó¤·¡¢GFS_File ¹½Â¤ÂΤò \fIgfp\fR ¤Î»Ø¤¹Àè¤ËÊÖ¤·¤Þ¤¹¡£ \fIgfarm_url\fR ¤ÏGfarm¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥Ñ¥¹Ì¾¡¢¤¢¤ë¤¤¤Ï gfarm://metaserver:port/path/name ·Á¼°¤ÎGfarm URL¤Ç¤¹¡£ .PP \fIflags\fR ¤Ï¡¢°Ê²¼¤Î¥Õ¥é¥°¤Î bitwise-or ¤Ç»ØÄꤷ¤Þ¤¹¡£ ¤Ï¤¸¤á¤Î»°¤Ä¤Î¥Õ¥é¥°¤Ï¤É¤ì¤«¤¬»ØÄꤵ¤ì¤Æ¤¤¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£ .TP \fBGFARM_FILE_RDONLY\fR ÆÉ¹þ¤ß¥â¡¼¥É¤Ç¥Õ¥¡¥¤¥ë¤ò¥ª¡¼¥×¥ó¤·¤Þ¤¹¡£ .TP \fBGFARM_FILE_WRONLY\fR ½ñ¹þ¤ß¥â¡¼¥É¤Ç¥Õ¥¡¥¤¥ë¤ò¥ª¡¼¥×¥ó¤·¤Þ¤¹¡£ .TP \fBGFARM_FILE_RDWR\fR ÆÉ¤ß½ñ¤­¥â¡¼¥É¤Ç¥Õ¥¡¥¤¥ë¤ò¥ª¡¼¥×¥ó¤·¤Þ¤¹¡£ .TP \fBGFARM_FILE_TRUNC\fR ¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¡¢¥ì¥®¥å¥é¡¼¥Õ¥¡¥¤¥ë¤Ç½ñ¹þ¤ß¤¬µö¤µ¤ì¤ë¾ì¹ç¡¢¥Õ¥¡¥¤¥ë¥µ¥¤¥º¤ò0¤Ë¤·¤Þ¤¹¡£ .SH "RETURN VALUES" .TP \fBGFARM_ERR_NO_ERROR\fR Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ .TP \fBGFARM_ERR_IS_A_DIRECTORY\fR »ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤¹¡£ .TP \fBGFARM_ERR_IS_A_SYMBOLIC_LINK\fR »ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤Ï¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Ç¤¹¡£ .TP \fBGFARM_ERR_OPERATION_NOT_PERMITTED\fR »ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤Ï¥Õ¥¡¥¤¥ë¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£ .TP \fBGFARM_ERR_NO_SUCH_OBJECT\fR »ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Þ¤»¤ó¡£ .TP \fBGFARM_ERR_NOT_A_DIRECTORY\fR »ØÄꤷ¤¿¥Ñ¥¹Ì¾¤Î¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤¬¡¢¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£ .TP \fBGFARM_ERR_PERMISSION_DENIED\fR »ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤ËÂФ·¡¢ \fIflags\fR ¤Ç»ØÄꤵ¤ì¤¿¥â¡¼¥É¤Ç¥¢¥¯¥»¥¹¤¹¤ë¸¢¸Â¤¬¤Ê¤¤¤«¡¢ ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤Ø¤Îǧ¾Ú¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£ .TP \fBGFARM_ERR_NO_MEMORY\fR ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ .TP \fBGFARM_ERR_INVALID_ARGUMENT\fR \fIflags\fR ¤Î»ØÄ꤬ÉÔÀµ¤Ç¤¹¡£ .TP \fBGFARM_ERR_GFARM_URL_HOST_IS_MISSING\fR \fIgfarm_url\fR ¤Ç»ØÄꤵ¤ì¤¿Gfarm URL¤Ë¤ª¤¤¤Æ¡¢ ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤¬»ØÄꤵ¤ì¤Æ¤¤¤Þ¤»¤ó¡£ .TP \fBGFARM_ERR_GFARM_URL_PORT_IS_MISSING\fR \fIgfarm_url\fR ¤Ç»ØÄꤵ¤ì¤¿Gfarm URL¤Ë¤ª¤¤¤Æ¡¢ ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤Î¥Ý¡¼¥ÈÈֹ椬»ØÄꤵ¤ì¤Æ¤¤¤Þ¤»¤ó¡£ .TP \fBGFARM_ERR_UNKNOWN_HOST\fR »ØÄꤵ¤ì¤¿¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤Î¥¢¥É¥ì¥¹²ò·è¤¬¤Ç¤­¤Þ¤»¤ó¡£ .TP \fBGFARM_ERR_TOO_MANY_OPEN_FILES\fR ¥×¥í¥»¥¹¤Ë¤ª¤±¤ë¥ª¡¼¥×¥ó²Äǽ¤Ê¥Õ¥¡¥¤¥ë¿ô¤Î¸Â³¦¤Ë㤷¤Þ¤·¤¿¡£ .TP \fBGFARM_ERR_TOO_MANY_OPEN_FILES_IN_SYSTEM\fR ¥·¥¹¥Æ¥à¤Ë¤ª¤±¤ë¥ª¡¼¥×¥ó¤Ç¤­¤ë¥Õ¥¡¥¤¥ë¿ô¤Î¸Â³¦¤Ë㤷¤Þ¤·¤¿¡£ .TP \fBGFARM_ERR_NETWORK_IS_UNREACHABLE\fR ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤ËÅþã¤Ç¤­¤Þ¤»¤ó¡£ .TP \fBGFARM_ERR_OPERATION_TIMED_OUT\fR ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤Ø¤ÎÀܳ¤¬¥¿¥¤¥à¥¢¥¦¥È¤ò¤ª¤³¤·¤Þ¤·¤¿¡£ .TP \fBGFARM_ERR_PROTOCOL\fR ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤È¤ÎÄÌ¿®¤Ë¥×¥í¥È¥³¥ë¥¨¥é¡¼¤¬È¯À¸¤·¤Þ¤·¤¿¡£ .TP \fBGFARM_ERR_BROKEN_PIPE\fR ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤È¤ÎÄÌ¿®¤¬ÀÚÃǤ·¤Þ¤·¤¿¡£ .TP \fBGFARM_ERR_PROTOCOL_NOT_SUPPORTED\fR »ØÄꤵ¤ì¤¿Ç§¾Ú¥×¥í¥È¥³¥ë¤Ï¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Þ¤»¤ó¡£ .TP \fBGFARM_ERR_AUTHENTICATION\fR ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤ËÂФ¹¤ëǧ¾Ú¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£ .TP \fB¤½¤Î¾\fR ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ \fBgfarm_error_string\fR(3) ¤Ë¤è¤ê¥¨¥é¡¼¤Î¸¶°ø¤òʸ»úÎó¤ËÊÑ´¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ .SH "SEE ALSO" .PP \fBgfs_pio_close\fR(3), \fBgfs_pio_create\fR(3), \fBgfs_pio_eof\fR(3), \fBgfs_pio_error\fR(3), \fBgfs_pio_flush\fR(3), \fBgfs_pio_getc\fR(3), \fBgfs_pio_getline\fR(3), \fBgfs_pio_open\fR(3), \fBgfs_pio_putc\fR(3), \fBgfs_pio_putline\fR(3), \fBgfs_pio_puts\fR(3), \fBgfs_pio_read\fR(3), \fBgfs_pio_seek\fR(3), \fBgfs_pio_ungetc\fR(3), \fBgfs_pio_write\fR(3) gfarm-2.4.1/man/ja/man3/gfs_pio_gets.30000644000000000000000000000471611507222725016062 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_PIO_GETS" "3" "13 May 2004" "Gfarm" "" .SH NAME gfs_pio_gets \- °ì¹ÔÆÉ¤ß¹þ¤ß .SH SYNOPSIS .sp \fB#include .sp char *gfs_pio_gets (GFS_File \fIf\fB, char * \fIs\fB, size_t \fIsize\fB); \fR .SH "DESCRIPTION" .PP ¥Õ¥¡¥¤¥ë \fIgf\fR ¤«¤é¡¢Ê¸»úÎó \fIs\fR ¤Ë¡¢°ì¹ÔÆÉ¤ß¹þ¤ß¤Þ¤¹¡£ °ú¿ô \fIsize\fR ¤Ëʸ»úÇÛÎó \fIs\fR ¤ÎÂ礭¤µ¤ò»ØÄꤷ¤Þ¤¹¡£ .PP ´Ø¿ô gfs_pio_getline(3) ¤È°Û¤Ê¤ê¡¢¤³¤Î´Ø¿ô¤Ï¹ÔËö¤Î²þ¹Ôµ­¹æ¤òºï½ü ¤·¤Þ¤»¤ó¡£°ì¹Ô¤ÎÆâÍÆ¤òʸ»úÇÛÎó¤ËǼ¤á¤­¤ì¤Ê¤¤¾ì¹ç¡¢¤¢¤ë¤¤¤Ï¥Õ¥¡¥¤¥ë ËöÈø¤Ë²þ¹Ôµ­¹æ¤¬Â¸ºß¤·¤Ê¤¤¾ì¹ç¡¢ÆþÎÏ·ë²Ì¤Îʸ»úÇÛÎó¤ÎËöÈø¤Ë²þ¹Ôµ­¹æ ¤¬¤Ä¤­¤Þ¤»¤ó¡£¤·¤«¤·Ê¸»úÎó¤Î½ª¤ï¤ê¤ò¼¨¤¹ '\\0' ʸ»ú¤Ï¡¢¤É¤Á¤é¤Î¾ì¹ç ¤Ç¤âÉղ䵤ì¤Þ¤¹¡£ .PP EOF ¤Ï¡¢ÆþÎÏ·ë²Ì¤Îʸ»úÇÛÎó¤ÎŤµ¤¬ 0 ʸ»ú¤Ç¤¢¤ë¤³¤È¤ÇȽÃǤ·¤Þ¤¹¡£ .SH "RETURN VALUES" .TP \fBNULL\fR Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ .TP \fBGFARM_ERR_NO_MEMORY\fR ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ .TP \fB¤½¤Î¾\fR ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ .SH "EXAMPLES" .SS "GFS_PIO_GETS ´Ø¿ô¤Î»ÈÍÑÎã" .PP .nf #include #include #include int main(int argc, char **argv) { char *e; GFS_File gf; char buffer[512]; e = gfarm_initialize(&argc, &argv); if (e != NULL) { fprintf(stderr, "gfarm_initialize: %s\\n", e); return (EXIT_FAILURE); } if (argc <= 1) { fprintf(stderr, "missing gfarm filename\\n"); return (EXIT_FAILURE); } e = gfs_pio_open(argv[1], GFARM_FILE_RDONLY, &gf); if (e != NULL) { fprintf(stderr, "%s: %s\\n", argv[1], e); return (EXIT_FAILURE); } e = gfs_pio_set_view_global(gf, 0); if (e != NULL) { fprintf(stderr, "%s: gfs_pio_set_view_global: %s\\n", argv[1], e); return (EXIT_FAILURE); } while ((e = gfs_pio_gets(gf, buffer, sizeof buffer)) != NULL && *buffer != '\\0') { printf("got: %s", buffer); } if (e != NULL) { fprintf(stderr, "ERROR: %s\\n", e); return (EXIT_FAILURE); } e = gfs_pio_close(gf); if (e != NULL) { fprintf(stderr, "gfs_pio_close: %s\\n", e); return (EXIT_FAILURE); } e = gfarm_terminate(); if (e != NULL) { fprintf(stderr, "gfarm_initialize: %s\\n", e); return (EXIT_FAILURE); } return (EXIT_SUCCESS); } .fi .SH "SEE ALSO" .PP \fBgfs_pio_open\fR(3), \fBgfs_pio_getline\fR(3), \fBgfs_pio_readline\fR(3), \fBgfs_pio_readdelim\fR(3) gfarm-2.4.1/man/ja/man3/gfs_pio_readline.30000644000000000000000000000672211507222725016702 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_PIO_READLINE" "3" "13 May 2004" "Gfarm" "" .SH NAME gfs_pio_readline \- °ì¹ÔÆÉ¤ß¹þ¤ß .SH SYNOPSIS .sp \fB#include .sp char *gfs_pio_readline (GFS_File \fIf\fB, char **\fIbufp\fB, size_t *\fIsizep\fB, size_t *\fIlenp\fB); \fR .SH "DESCRIPTION" .PP ¥Õ¥¡¥¤¥ë \fIgf\fR ¤«¤é¡¢°ì¹ÔÆÉ¤ß¹þ¤ß¤Þ¤¹¡£ .PP °ú¿ô \fIbufp\fR ¤Ï¡¢ºÇ½é¤Ï NULL ¤Ç½é´ü²½¤µ¤ì¤¿¥Ý¥¤¥ó¥¿ÊÑ¿ô¤Î¥¢¥É¥ì¥¹¤ò»ØÄꤷ¤Þ¤¹¡£ ´Ø¿ô \fBgfs_pio_readline()\fR ¤Ï¡¢Æþ½ÐÎϤËÍѤ¤¤ë ¥Ð¥Ã¥Õ¥¡¤òưŪ¤Ë³ä¤êÅö¤Æ¡¢¤½¤Î¥¢¥É¥ì¥¹¤ò¤³¤Î¥Ý¥¤¥ó¥¿ÊÑ¿ô¤Ëµ­Ï¿¤·¤Þ¤¹¡£ °ú¿ô \fIsizep\fR ¤Ï¡¢0 ¤Ç½é´ü²½¤·¤¿ size_t ·¿¤ÎÊÑ¿ô ¤Î¥¢¥É¥ì¥¹¤ò»ØÄꤷ¤Þ¤¹¡£¤³¤ÎÊÑ¿ô¤Ï¡¢¥Ð¥Ã¥Õ¥¡¤Î¥µ¥¤¥º¤òµ­Ï¿¤¹¤ë¤¿¤á¤Ë »È¤ï¤ì¤Þ¤¹¡£ ¤¢¤ë¤¤¤Ï¡¢malloc(3) ¤Ç³ä¤êÅö¤Æ¤¿¥Ð¥Ã¥Õ¥¡¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Î¥¢¥É¥ì¥¹¤ò °ú¿ô \fIbufp\fR ¤Ë»ØÄꤹ¤ë¤³¤È¤â¤Ç¤­¤Þ¤¹¡£¤³¤Î¾ì¹ç¡¢ °ú¿ô \fIsizep\fR ¤Ï¡¢³ä¤êÅö¤Æ¤¿¥Ð¥Ã¥Õ¥¡¤Î¥µ¥¤¥º¤Ç½é´ü²½¤·¤Æ¤ª¤­¤Þ¤¹¡£ ¹Ô¤ÎŤµ¤¬¥Ð¥Ã¥Õ¥¡¤Î¥µ¥¤¥º¤ò±Û¤¨¤ë¾ì¹ç¤Ë¤Ï¡¢¥Ð¥Ã¥Õ¥¡¤Ï¼«Æ°Åª¤Ë realloc(3) ¤µ¤ì¡¢ °ú¿ô \fIbufp\fR ¤ª¤è¤Ó °ú¿ô \fIsizep\fR ¤Ç»ØÄꤵ¤ì¤¿ÊÑ¿ô¤â¤½¤ì¤Ë½¾¤Ã¤Æ¹¹¿·¤µ¤ì¤Þ¤¹¡£ ¥Õ¥¡¥¤¥ë¤òÆÉ¤ß½ª¤ï¤Ã¤¿¤é¡¢¤³¤Î¥Ý¥¤¥ó¥¿¤ò free(3) ¤Ç²òÊü¤¹¤ëɬÍפ¬ ¤¢¤ê¤Þ¤¹¡£ .PP °ú¿ô \fIlenp\fR ¤Î»Ø¤¹ÊÑ¿ô¤Ë¤Ï¡¢ÆÉ¤ß¹þ¤ó¤ÀŤµ¤òÊÖ¤·¤Þ¤¹¡£ ¤³¤ÎŤµ¤Ë¤Ï¡¢¹ÔËöµ­¹æ¤Îʬ¤â´Þ¤ß¤Þ¤¹¡£ .PP ´Ø¿ô gfs_pio_gets(3) ¤ÈƱÍÍ¡¢¤³¤Î´Ø¿ô¤Ï¹ÔËö¤Î²þ¹Ôµ­¹æ¤òºï½ü¤·¤Þ¤»¤ó¡£ ¤Þ¤¿¡¢Ê¸»úÎó¤Î½ª¤ï¤ê¤ò¼¨¤¹ '\\0' ʸ»ú¤ò¡¢¾ï¤ËÉղä·¤Þ¤¹¡£ ¤Þ¤¿¡¢ °ú¿ô \fIlenp\fR ¤Î»Ø¤¹ÊÑ¿ô¤ËÊ֤ä¿Ãͤò»È¤¨¤Ð¡¢Ê¸»ú '\\0' ¤ò´Þ¤à¹Ô¤ò°·¤¦¤³¤È¤â¤Ç¤­¤Þ¤¹¡£ .PP EOF ¤Ï¡¢ÆþÎϤÎŤµ¤¬ 0 ʸ»ú¤Ç¤¢¤ë¤³¤È¤ÇȽÃǤ·¤Þ¤¹¡£ .PP ¤³¤Î´Ø¿ô¤Ï¡¢gfs_pio_readdelim(f, bufp, sizep, lenp, "\\n", 1) ¤È Åù²Á¤Ç¤¹¡£ .SH "RETURN VALUES" .TP \fBNULL\fR Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ .TP \fBGFARM_ERR_NO_MEMORY\fR ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ ¤³¤Î¾ì¹ç¤â¡¢\fIbufp\fR ¤Î»Ø¤¹¥Ý¥¤¥ó¥¿ÊÑ¿ô¤Î »Ø¤¹Îΰè¤ò free(3) ¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¤«¤éÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡£ .TP \fB¤½¤Î¾\fR ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ .SH "EXAMPLES" .SS "GFS_PIO_READLINE ´Ø¿ô¤Î»ÈÍÑÎã" .PP .nf #include #include #include int main(int argc, char **argv) { char *e; GFS_File gf; size_t bufsize = 0, len; char *buffer = NULL; e = gfarm_initialize(&argc, &argv); if (e != NULL) { fprintf(stderr, "gfarm_initialize: %s\\n", e); return (EXIT_FAILURE); } if (argc <= 1) { fprintf(stderr, "missing gfarm filename\\n"); return (EXIT_FAILURE); } e = gfs_pio_open(argv[1], GFARM_FILE_RDONLY, &gf); if (e != NULL) { fprintf(stderr, "%s: %s\\n", argv[1], e); return (EXIT_FAILURE); } e = gfs_pio_set_view_global(gf, 0); if (e != NULL) { fprintf(stderr, "%s: gfs_pio_set_view_global: %s\\n", argv[1], e); return (EXIT_FAILURE); } while ((e = gfs_pio_readline(gf, &buffer, &bufsize, &len)) == NULL && len > 0) { printf("<%6d/%6d >%s", len, bufsize, buffer); } if (buffer != NULL) free(buffer); if (e != NULL) { fprintf(stderr, "ERROR: %s\\n", e); return (EXIT_FAILURE); } e = gfs_pio_close(gf); if (e != NULL) { fprintf(stderr, "gfs_pio_close: %s\\n", e); return (EXIT_FAILURE); } e = gfarm_terminate(); if (e != NULL) { fprintf(stderr, "gfarm_initialize: %s\\n", e); return (EXIT_FAILURE); } return (EXIT_SUCCESS); } .fi .SH "SEE ALSO" .PP \fBgfs_pio_open\fR(3), \fBgfs_pio_getline\fR(3), \fBgfs_pio_gets\fR(3), \fBgfs_pio_readdelim\fR(3) gfarm-2.4.1/man/ja/man3/gfs_pio_sync.30000644000000000000000000000216611507222725016071 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_PIO_SYNC" "3" "01 June 2005" "Gfarm" "" .SH NAME gfs_pio_sync \- ¥á¥â¥ê¾å¤Î¥Õ¥¡¥¤¥ë¤ÎÆâÍÆ¤ò¥Ç¥£¥¹¥¯¤ËÈ¿±Ç¤µ¤»¤ë .SH SYNOPSIS .sp \fB#include .sp char *gfs_pio_sync (GFS_File \fIgf\fB); \fR .SH "DESCRIPTION" .PP ½ñ¤­¹þ¤ßÍѤ˥ª¡¼¥×¥ó¤·¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë \fIgf\fR ¤Î¡¢¥á¥â¥ê¾å¤Ë¤¢¤ë¥Ç¡¼¥¿¤ò¼ÂºÝ¤Ë¥Ç¥£¥¹¥¯¤Ë½ñ¤­¹þ¤ß¡¤ Æþ½ÐÎϤδ°Î»¤òÂԤäƤ«¤éÌá¤ê¤Þ¤¹¡¥¤Þ¤¿¡¤ ¥Õ¥¡¥¤¥ë¤Î¥á¥¿¥Ç¡¼¥¿¤â¹¹¿·¤·¤Þ¤¹¡¥ Ê̤δؿô \fBgfs_pio_datasync\fR ¤â¥á¥â¥ê¾å¤Î¥Õ¥¡¥¤¥ë¥Ç¡¼¥¿¤ò¥Ç¥£¥¹¥¯¤Ë½ñ¤­¹þ¤ß¤Þ¤¹¤¬¡¤ ¥á¥¿¥Ç¡¼¥¿¤Ï¹¹¿·¤·¤Þ¤»¤ó¡¥ .SH "RETURN VALUES" .TP \fBNULL\fR Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡¥ .TP \fBGFARM_ERR_NO_MEMORY\fR ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡¥ .TP \fB¤½¤Î¾\fR ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡¥ .SH "SEE ALSO" .PP \fBgfs_pio_datasync\fR(3), \fBgfs_pio_create\fR(3), \fBgfs_pio_open\fR(3), \fBgfs_pio_write\fR(3), \fBgfs_pio_flush\fR(3) gfarm-2.4.1/man/ja/man3/gfs_pio_getc.30000644000000000000000000000167311507222725016041 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_PIO_GETC" "3" "18 March 2003" "Gfarm" "" .SH NAME gfs_pio_getc \- °ìʸ»úÆÉ¤ß¹þ¤ß .SH SYNOPSIS .sp \fB#include .sp int gfs_pio_getc (GFS_File \fIgf\fB); \fR .SH "DESCRIPTION" .PP ¥Õ¥¡¥¤¥ë \fIgf\fR ¤«¤é°ìʸ»úÆÉ¤ß¹þ¤ß¤Þ¤¹¡£ .SH "RETURN VALUES" .TP \fBEOF\fR ¥Õ¥¡¥¤¥ë¤ÎËöÈø¤Ë㤷¤¿¾ì¹ç¡¢¤¢¤ë¤¤¤Ï¥¨¥é¡¼¤¬À¸¤¸¤¿¾ì¹ç¡¢ ¤Ç ÄêµÁ¤µ¤ì¤Æ¤¤¤ëÄê¿ô EOF ¤òÊÖ¤·¤Þ¤¹¡£ ¥Õ¥¡¥¤¥ëËöÈø¤Ê¤Î¤«¡¢¥¨¥é¡¼¤Ê¤Î¤«¤Ï¡¢´Ø¿ô gfs_pio_error(3) ¤ÇÃÎ¤ë ¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ .TP \fB¤½¤Î¾\fR ¥Õ¥¡¥¤¥ë¤«¤éÆÉ¤ß¹þ¤ó¤Àʸ»ú¤òÊÖ¤·¤Þ¤¹¡£ .SH "SEE ALSO" .PP \fBgfs_pio_create\fR(3), \fBgfs_pio_eof\fR(3), \fBgfs_pio_error\fR(3), \fBgfs_pio_open\fR(3), \fBgfs_pio_ungetc\fR(3) gfarm-2.4.1/man/ja/man3/gfs_pio_error.30000644000000000000000000000141211507222725016237 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_PIO_ERROR" "3" "18 March 2003" "Gfarm" "" .SH NAME gfs_pio_error \- ¥¨¥é¡¼¾õ¶· .SH SYNOPSIS .sp \fB#include .sp char *gfs_pio_error (GFS_File \fIgf\fB); \fR .SH "DESCRIPTION" .PP ¥Õ¥¡¥¤¥ë \fIgf\fR ¤Î¥¨¥é¡¼¾õ¶·¤ò¼¨¤·¤Þ¤¹¡£ .SH "RETURN VALUES" .TP \fBNULL\fR ÆÃ¤Ë¥¨¥é¡¼¤Ï¡¢À¸¤¸¤Æ¤¤¤Þ¤»¤ó¡£ .TP \fB¤½¤Î¾\fR ¥¨¥é¡¼¤¬À¸¤¸¤Æ¤¤¤Þ¤¹¡£¥¨¥é¡¼¤ò¼¨¤¹Ê¸»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤·¤Þ¤¹¡£ .SH "SEE ALSO" .PP \fBgfs_pio_create\fR(3), \fBgfs_pio_eof\fR(3), \fBgfs_pio_open\fR(3) gfarm-2.4.1/man/ja/man3/gfs_pio_set_view_local.30000644000000000000000000000353311507222725020113 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_PIO_SET_VIEW_LOCAL" "3" "18 March 2003" "Gfarm" "" .SH NAME gfs_pio_set_view_local \- ÊÂÎó¥×¥í¥»¥¹¤ËÂбþ¤·¤¿ fragment ñ°Ì¤Î¥¢¥¯¥»¥¹¤ò¹Ô¤¦ .SH SYNOPSIS .sp \fB#include .sp char *gfs_pio_set_view_local (GFS_File \fIgf\fB, int \fIflags\fB); \fR .SH "DESCRIPTION" .PP ¥Õ¥¡¥¤¥ë¤ò¥Õ¥é¥°¥á¥ó¥Èñ°Ì¤Ç¥¢¥¯¥»¥¹¤¹¤ë¤³¤È¤ò»ØÄꤷ¤Þ¤¹¡£ .PP ¥¢¥¯¥»¥¹¤¹¤ë¥Õ¥é¥°¥á¥ó¥È¤Ï¡¢GfarmÊÂÎó¥×¥í¥»¥¹¤Î¥Î¡¼¥ÉÈÖ¹æ¤ËÂбþ¤·¤¿ ¤â¤Î¤Ë¤Ê¤ê¤Þ¤¹¡£¤¹¤Ê¤ï¤Á¡¢´Ø¿ô gfs_pio_set_local(3) ¤Î \fInode\fR °ú¿ô¤Ë»ØÄꤷ¤¿¥Õ¥é¥°¥á¥ó¥È¤Ç¤¹¡£ .PP ¥Õ¥é¥°¥á¥ó¥È¤ÎÁí¿ô¤Ï¡¢GfarmÊÂÎó¥×¥í¥»¥¹¤Î¥Î¡¼¥É¤ÎÁí¿ô¡¢¤¹¤Ê¤ï¤Á gfs_pio_set_local(3) ¤Î \fInnode\fR °ú¿ô¤ÈƱ°ì¤Ë¤Ê¤ê¤Þ¤¹¡£ ¤â¤·¡¢´û¸¤Î¥Õ¥¡¥¤¥ë¤ò³«¤¯¤È¤­¤Ë¡¢¥Õ¥é¥°¥á¥ó¥È¤ÎÁí¿ô¤È¥Î¡¼¥É¤ÎÁí¿ô¤¬ °Û¤Ê¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢¤³¤Î´Ø¿ô¤Ï¥¨¥é¡¼¤È¤Ê¤ê¤Þ¤¹¡£ .PP °ú¿ô \fIflag\fR ¤Ë¤Ï¡¢ GFARM_FILE_SEQUENTIAL¡¢ GFARM_FILE_REPLICATE¡¢ GFARM_FILE_NOT_REPLICATE ¤ÎÏÀÍýϤ¬»ØÄê¤Ç¤­¤Þ¤¹¡£ ÃͤΰÕÌ£¤Ï gfs_pio_set_view_index(3) ¤Î²òÀâ¤ò»²¾È¤¯¤À¤µ¤¤¡£ .PP ¤³¤Î´Ø¿ô¤ò¸Æ¤Ð¤Ê¤¤¾õÂ֤Ǥϡ¢Gfarm¥Õ¥¡¥¤¥ë¤Ï global view ¾õÂ֤ȤʤäƤª¤ê¡¢Á´¤Æ¤Î¥Õ¥é¥°¥á¥ó¥È¤¬·ë¹ç¤µ¤ì¤¿Ã±°ì¥Õ¥¡¥¤¥ë¤Ë¸«¤¨¤Þ¤¹¡£ .SH "RETURN VALUES" .TP \fBNULL\fR Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ .TP \fBGFARM_ERR_NO_MEMORY\fR ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ .TP \fBGFARM_ERR_OPERATION_NOT_PERMITTED\fR »ØÄꤷ¤¿¥Ñ¥¹Ì¾¤¬¡¢¥Õ¥é¥°¥á¥ó¥È²½¥Õ¥¡¥¤¥ë¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£ .TP \fBGFARM_ERR_FRAGMENT_NUMBER_DOES_NOT_MATCH\fR ¥Î¡¼¥É¿ô¤È¡¢¥Õ¥é¥°¥á¥ó¥ÈÁí¿ô¤¬¡¢Å¬¹ç¤·¤Þ¤»¤ó¡£ .TP \fB¤½¤Î¾\fR ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ .SH "SEE ALSO" .PP \fBgfs_pio_create\fR(3), \fBgfs_pio_open\fR(3), \fBgfs_pio_set_local\fR(3), \fBgfs_pio_set_view_index\fR(3) gfarm-2.4.1/man/ja/man3/gfarm_url_section_replicate_from_to.30000644000000000000000000000324111507222725022661 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFARM_URL_SECTION_REPLICATE_FROM_TO" "3" "06 September 2005" "Gfarm" "" .SH NAME gfarm_url_section_replicate_from_to \- ¥Õ¥¡¥¤¥ë¥»¥¯¥·¥ç¥ó¤Î¥ì¥×¥ê¥«¤òºîÀ®¤¹¤ë .SH SYNOPSIS .sp \fB#include .sp char *gfarm_url_section_replicate_from_to (const char *\fIgfarm_url\fB, char *\fIsection\fB, char *\fIsrchost\fB, char *\fIdsthost\fB); \fR .SH "DESCRIPTION" .PP ¥Õ¥¡¥¤¥ë \fIgfarm_url\fR ¤Î¥Õ¥¡¥¤¥ë¥»¥¯¥·¥ç¥ó \fIsection\fR ¤ÎÊ£À½¤ò¡¢ \fIsrchost\fR¤«¤é \fIdsthost\fR ¤ËºîÀ®¤·¤Þ¤¹¡£ .PP ¥Õ¥¡¥¤¥ë¥»¥¯¥·¥ç¥ó¤È¤Ï¡¢¼Â¹Ô·Á¼°¤Î¥Õ¥¡¥¤¥ë¤Î¾ì¹ç¤Ï¥¢¡¼¥­¥Æ¥¯¥Á¥ã̾¡¢ Ä̾ï¥Õ¥¡¥¤¥ë¤Î¾ì¹ç¤Ï¥Õ¥¡¥¤¥ë¥¤¥ó¥Ç¥Ã¥¯¥¹ÈÖ¹æ¤È¤Ê¤ê¤Þ¤¹¡£ ¥Õ¥¡¥¤¥ë¥¤¥ó¥Ç¥Ã¥¯¥¹ÈÖ¹æ¤òÀ°¿ô¤Ç¤Ï¤Ê¤¯¡¢Ê¸»úÎó \fIsection\fR ¤Ç»ØÄꤹ¤ëɬÍפ¬¤¢¤ë¤³¤È¤ËÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡£¤Þ¤¿¡¢¤Þ¤¿¤³¤Îʸ»úÎó¤Ï¡¢ ;ʬ¤Ê¶õÇò¤ä¡¢Àè¹Ô 0 ¤ò´Þ¤ó¤Ç¤Ï¤¤¤±¤Þ¤»¤ó¡£ .PP »ØÄꤷ¤¿ \fIsrchost\fR ¤Ë¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï¥¨¥é¡¼¤Ë¤Ê¤ê¤Þ¤¹¡£ .SH "RETURN VALUES" .TP \fBNULL\fR Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ .TP \fBGFARM_ERR_NO_MEMORY\fR ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ .TP \fBGFARM_ERR_NO_SUCH_OBJECT\fR »ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¡¢ ¤¢¤ë¤¤¤ÏÊ£À½ºîÀ®¸µ¤Î¥Û¥¹¥È¤Ë¥Õ¥¡¥¤¥ë¤ÎÊ£À½¤¬Â¸ºß¤·¤Þ¤»¤ó¡£ .TP \fBGFARM_ERR_TEXT_FILE_BUSY\fR »ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤¬¸½ºß¡Ê¾¤Î¥×¥í¥»¥¹¤Ë¤è¤ê¡Ë¹¹¿·Ãæ¤Î¤¿¤á¡¢ ¥Õ¥¡¥¤¥ë¤ÎÊ£À½¤¬ºîÀ®¤Ç¤­¤Þ¤»¤ó¡£ .TP \fB¤½¤Î¾\fR ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ .SH "SEE ALSO" .PP \fBgfarm_url_section_replicate_to\fR(3), \fBgfarm_url_fragments_replicate\fR(3) gfarm-2.4.1/man/ja/man3/gfs_readdir.30000644000000000000000000000174211507222725015657 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_READDIR" "3" "29 October 2003" "Gfarm" "" .SH NAME gfs_readdir \- ¥Ç¥£¥ì¥¯¥È¥êÆâÍÆÆÉ¤ß¹þ¤ß .SH SYNOPSIS .sp \fB#include .sp char *gfs_readdir (GFS_Dir \fIdir\fB, struct gfs_dirent ** \fIentryp\fB); \fR .SH "DESCRIPTION" .PP °ú¿ô \fIdir\fR ¤Ç»ØÄꤷ¤¿¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¡¢1 ¤Ä¤Î¥Ç¥£¥ì¥¯¥È¥ê¡¦¥¨¥ó¥È¥ê ¤òÆÉ¤ß¹þ¤ß¡¢¤½¤Î¥Ý¥¤¥ó¥¿¤ò \fIentryp\fR ¤Î»Ø¤¹Àè¤ËÊÖ¤·¤Þ¤¹¡£ \fIentryp\fR ¤Î»Ø¤¹Îΰè¤Ï¡¢¼¡¤ËƱ¤¸ \fIdir\fR °ú¿ô¤Ç gfs_readdir() ¤Ê¤¤¤· gfs_closedir() ¤ò¸Æ¤Ó½Ð¤·¤¿»þ¤Ë¼º¤ï¤ì¤Þ¤¹¡£ .SH "RETURN VALUES" .TP \fBNULL\fR Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ .TP \fB¤½¤Î¾\fR ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ .SH "SEE ALSO" .PP \fBgfs_closedir\fR(3), \fBgfs_opendir\fR(3), \fBgfs_readdir\fR(3) gfarm-2.4.1/man/ja/man3/gfs_pio_create.30000644000000000000000000000660111507222725016356 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_PIO_CREATE" "3" "27 June 2010" "Gfarm" "" .SH NAME gfs_pio_create \- Gfarm¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥Õ¥¡¥¤¥ë¤ÎºîÀ® .SH SYNOPSIS .sp \fB#include .sp gfarm_error_t gfs_pio_create (const char * \fIgfarm_url\fB, int \fIflags\fB, gfarm_mode_t \fImode\fB, GFS_File * \fIgfp\fB); \fR .SH "DESCRIPTION" .PP »ØÄꤷ¤¿ \fIgfarm_url\fR ¤Ë¡¢¥â¡¼¥É \fImode\fR ¤Ç¥Õ¥¡¥¤¥ë¤ò¿·µ¬ºîÀ®¤·¡¢ \fIGFS_File\fR ¹½Â¤ÂΤò \fIgfp\fR ¤Î»Ø¤¹Àè¤ËÊÖ¤·¤Þ¤¹¡£ .PP °ú¿ô \fIflags\fR ¤Ï¡¢ \fBgfs_pio_open()\fR ¤ÎÂèÆó°ú¿ô¤ÈƱ¤¸°ÕÌ£¤ò»ý¤Á¤Þ¤¹¡£ \fIGFARM_FILE_RDONLY\fR¡¢ \fIGFARM_FILE_WRONLY\fR¡¢ \fIGFARM_FILE_RDWR\fR ¤Î¤¤¤º¤ì¤«°ì¤Ä¤Î¥Õ¥é¥°¤òɬ¤º»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤ÅÀ¤âƱ¤¸¤Ç¤¹¡£ .PP °ú¿ô \fIflags\fR ¤ÎÃͤȤ·¤Æ \fIGFARM_FILE_TRUNC\fR ¤¬É¬Íפʾì¹ç¤Ï¡¢ ÌÀ¼¨Åª¤Ë»ØÄꤹ¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¤Î¤Ç¡¢¤´Ãí°Õ¤¯¤À¤µ¤¤¡£ .SH "RETURN VALUES" .TP \fBGFARM_ERR_NO_ERROR\fR Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ .TP \fBGFARM_ERR_IS_A_DIRECTORY\fR »ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤¹¡£ .TP \fBGFARM_ERR_IS_A_SYMBOLIC_LINK\fR »ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤Ï¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Ç¤¹¡£ .TP \fBGFARM_ERR_OPERATION_NOT_PERMITTED\fR »ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤Ï¥Õ¥¡¥¤¥ë¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£ .TP \fBGFARM_ERR_NOT_A_DIRECTORY\fR »ØÄꤷ¤¿¥Ñ¥¹Ì¾¤Î¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤¬¡¢¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£ .TP \fBGFARM_ERR_PERMISSION_DENIED\fR »ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤ËÂФ·¡¢ \fIflags\fR ¤Ç»ØÄꤵ¤ì¤¿¥â¡¼¥É¤Ç¥¢¥¯¥»¥¹¤¹¤ë¸¢¸Â¤¬¤Ê¤¤¤«¡¢¤½¤Î¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤Ø¤Î ½ñ¤­¹þ¤ß¸¢¸Â¤¬¤¢¤ê¤Þ¤»¤ó¡£ ¤¢¤ë¤¤¤Ï¡¢¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤Ø¤Îǧ¾Ú¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£ .TP \fBGFARM_ERR_NO_MEMORY\fR ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ .TP \fBGFARM_ERR_INVALID_ARGUMENT\fR \fIflags\fR ¤Î»ØÄ꤬ÉÔÀµ¤Ç¤¹¡£ .TP \fBGFARM_ERR_GFARM_URL_HOST_IS_MISSING\fR \fIgfarm_url\fR ¤Ç»ØÄꤵ¤ì¤¿Gfarm URL¤Ë¤ª¤¤¤Æ¡¢ ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤¬»ØÄꤵ¤ì¤Æ¤¤¤Þ¤»¤ó¡£ .TP \fBGFARM_ERR_GFARM_URL_PORT_IS_MISSING\fR \fIgfarm_url\fR ¤Ç»ØÄꤵ¤ì¤¿Gfarm URL¤Ë¤ª¤¤¤Æ¡¢ ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤Î¥Ý¡¼¥ÈÈֹ椬»ØÄꤵ¤ì¤Æ¤¤¤Þ¤»¤ó¡£ .TP \fBGFARM_ERR_UNKNOWN_HOST\fR »ØÄꤵ¤ì¤¿¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤Î¥¢¥É¥ì¥¹²ò·è¤¬¤Ç¤­¤Þ¤»¤ó¡£ .TP \fBGFARM_ERR_TOO_MANY_OPEN_FILES\fR ¥×¥í¥»¥¹¤Ë¤ª¤±¤ë¥ª¡¼¥×¥ó²Äǽ¤Ê¥Õ¥¡¥¤¥ë¿ô¤Î¸Â³¦¤Ë㤷¤Þ¤·¤¿¡£ .TP \fBGFARM_ERR_TOO_MANY_OPEN_FILES_IN_SYSTEM\fR ¥·¥¹¥Æ¥à¤Ë¤ª¤±¤ë¥ª¡¼¥×¥ó¤Ç¤­¤ë¥Õ¥¡¥¤¥ë¿ô¤Î¸Â³¦¤Ë㤷¤Þ¤·¤¿¡£ .TP \fBGFARM_ERR_NETWORK_IS_UNREACHABLE\fR ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤ËÅþã¤Ç¤­¤Þ¤»¤ó¡£ .TP \fBGFARM_ERR_OPERATION_TIMED_OUT\fR ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤Ø¤ÎÀܳ¤¬¥¿¥¤¥à¥¢¥¦¥È¤ò¤ª¤³¤·¤Þ¤·¤¿¡£ .TP \fBGFARM_ERR_PROTOCOL\fR ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤È¤ÎÄÌ¿®¤Ë¥×¥í¥È¥³¥ë¥¨¥é¡¼¤¬È¯À¸¤·¤Þ¤·¤¿¡£ .TP \fBGFARM_ERR_BROKEN_PIPE\fR ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤È¤ÎÄÌ¿®¤¬ÀÚÃǤ·¤Þ¤·¤¿¡£ .TP \fBGFARM_ERR_PROTOCOL_NOT_SUPPORTED\fR »ØÄꤵ¤ì¤¿Ç§¾Ú¥×¥í¥È¥³¥ë¤Ï¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Þ¤»¤ó¡£ .TP \fBGFARM_ERR_AUTHENTICATION\fR ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤ËÂФ¹¤ëǧ¾Ú¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£ .TP \fB¤½¤Î¾\fR ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ \fBgfarm_error_string\fR(3) ¤Ë¤è¤ê¥¨¥é¡¼¤Î¸¶°ø¤òʸ»úÎó¤ËÊÑ´¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ .SH "SEE ALSO" .PP \fBgfs_pio_close\fR(3), \fBgfs_pio_create\fR(3), \fBgfs_pio_eof\fR(3), \fBgfs_pio_error\fR(3), \fBgfs_pio_flush\fR(3), \fBgfs_pio_getc\fR(3), \fBgfs_pio_getline\fR(3), \fBgfs_pio_open\fR(3), \fBgfs_pio_putc\fR(3), \fBgfs_pio_putline\fR(3), \fBgfs_pio_puts\fR(3), \fBgfs_pio_read\fR(3), \fBgfs_pio_seek\fR(3), \fBgfs_pio_ungetc\fR(3), \fBgfs_pio_write\fR(3) gfarm-2.4.1/man/ja/man3/gfarm_initialize.30000644000000000000000000000343011507222725016717 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFARM_INITIALIZE" "3" "26 June 2010" "Gfarm" "" .SH NAME gfarm_initialize \- Gfarm ¥é¥¤¥Ö¥é¥ê¤ò½é´ü²½¤¹¤ë .SH SYNOPSIS .sp \fB#include .sp gfarm_error_t gfarm_initialize (int * \fIargcp\fB, char *** \fIargvp\fB); \fR .SH "DESCRIPTION" .PP Gfarm ¥é¥¤¥Ö¥é¥ê¤ò½é´ü²½¤·¤Þ¤¹¡£ Gfarm ¥é¥¤¥Ö¥é¥ê API ¤òÍøÍѤ¹¤ëÁ°¤Ëɬ¤º¸Æ¤ÖɬÍפ¬¤¢¤ê¤Þ¤¹¡£ °ú¿ô¤Ë¤Ï¡¢¥×¥í¥°¥é¥à¤Î main ´Ø¿ô¤Î \fIargc\fR °ú¿ô¤Ø¤Î¥Ý¥¤¥ó¥¿¤È¡¢ \fIargv\fR °ú¿ô¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÅϤ·¤Þ¤¹¡£ .SH "RETURN VALUES" .TP \fBGFARM_ERR_NO_ERROR\fR Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ .TP \fBGFARM_ERR_NO_MEMORY\fR ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ .TP \fBGFARM_ERR_UNKNOWN_HOST\fR »ØÄꤵ¤ì¤¿¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤Î¥¢¥É¥ì¥¹²ò·è¤¬¤Ç¤­¤Þ¤»¤ó¡£ .TP \fBGFARM_ERR_NETWORK_IS_UNREACHABLE\fR ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤ËÅþã¤Ç¤­¤Þ¤»¤ó¡£ .TP \fBGFARM_ERR_OPERATION_TIMED_OUT\fR ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤Ø¤ÎÀܳ¤¬¥¿¥¤¥à¥¢¥¦¥È¤ò¤ª¤³¤·¤Þ¤·¤¿¡£ .TP \fBGFARM_ERR_PROTOCOL\fR ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤È¤ÎÄÌ¿®¤Ë¥×¥í¥È¥³¥ë¥¨¥é¡¼¤¬È¯À¸¤·¤Þ¤·¤¿¡£ .TP \fBGFARM_ERR_BROKEN_PIPE\fR ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤È¤ÎÄÌ¿®¤¬ÀÚÃǤ·¤Þ¤·¤¿¡£ .TP \fBGFARM_ERR_PERMISSION_DENIED\fR ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤Ø¤Îǧ¾Ú¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£ .TP \fBGFARM_ERR_PROTOCOL_NOT_SUPPORTED\fR »ØÄꤵ¤ì¤¿Ç§¾Ú¥×¥í¥È¥³¥ë¤Ï¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Þ¤»¤ó¡£ .TP \fBGFARM_ERR_AUTHENTICATION\fR ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤ËÂФ¹¤ëǧ¾Ú¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£ .TP \fBGFARM_ERR_NO_MEMORY\fR ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ .TP \fB¤½¤Î¾\fR ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ \fBgfarm_error_string\fR(3) ¤Ë¤è¤ê¥¨¥é¡¼¤Î¸¶°ø¤òʸ»úÎó¤ËÊÑ´¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ .SH "SEE ALSO" .PP \fBgfarm_terminate\fR(3) gfarm-2.4.1/man/ja/man3/gfs_pio_getline.30000644000000000000000000000212111507222725016533 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_PIO_GETLINE" "3" "18 March 2003" "Gfarm" "" .SH NAME gfs_pio_getline \- °ì¹ÔÆÉ¤ß¹þ¤ß .SH SYNOPSIS .sp \fB#include .sp char *gfs_pio_getline (GFS_File \fIf\fB, char * \fIs\fB, size_t \fIsize\fB, int * \fIeofp\fB); \fR .SH "DESCRIPTION" .PP ¥Õ¥¡¥¤¥ë \fIgf\fR ¤«¤é¡¢Ê¸»úÎó \fIs\fR ¤Ë¡¢°ì¹ÔÆÉ¤ß¹þ¤ß¤Þ¤¹¡£ °ú¿ô \fIsize\fR ¤Ëʸ»úÇÛÎó \fIs\fR ¤ÎÂ礭¤µ¤ò»ØÄꤷ¤Þ¤¹¡£¹Ô¤¬ \fIsize\fR ¤ò±Û¤¨¤¿¾ì¹ç¤È¡¢°ì¹Ô¤ÎŤµ¤¬¤Á¤ç¤¦¤É \fIsize\fR - 1 ¤À¤Ã¤¿¾ì¹ç¤ò¶èÊ̤¹¤ë¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó¡£ EOF ¤Î¾ì¹ç¤Ë¤Ï \fIeofp\fR ¤Î»Ø¤¹Àè¤Ë 1 ¤òÊÖ¤·¡¢¤µ¤â¤Ê¤¯¤Ð 0 ¤òÊÖ¤·¤Þ¤¹¡£ .SH "RETURN VALUES" .TP \fBNULL\fR Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ .TP \fBGFARM_ERR_NO_MEMORY\fR ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ .TP \fB¤½¤Î¾\fR ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ .SH "SEE ALSO" .PP \fBgfs_pio_create\fR(3), \fBgfs_pio_open\fR(3) gfarm-2.4.1/man/ja/man3/gfs_chmod.30000644000000000000000000000337411507222725015342 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_CHMOD" "3" "21 February 2005" "Gfarm" "" .SH NAME gfs_chmod \- ¥â¡¼¥ÉÊѹ¹ .SH SYNOPSIS .sp \fB#include .sp char *gfs_chmod (char * \fIgfarm_url\fB, mode_t \fImode\fB); \fR .SH "DESCRIPTION" .PP °ú¿ô \fIgfarm_url\fR ¤Ë»ØÄꤷ¤¿Ì¾Á°¤Î¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥ì¥¯¥È¥ê¤Î¥â¡¼¥É¤ò¡¢ \fImode\fR ¤ËÊѹ¹¤·¤Þ¤¹¡£¤³¤Î \fImode\fR ¤ÎÃͤΰÕÌ£¤Ï \fBchmod(2)\fR ¤ÈƱÍͤǤ¹¤¬¡¢²¼°Ì9¥Ó¥Ã¥È¤Î¤ßÍ­¸ú¤Ç¤¹¡£ .PP Ê£¿ô¤Î¥Õ¥é¥°¥á¥ó¥È¤«¤é¤Ê¤ë¥Õ¥¡¥¤¥ë¤Î¼Â¹Ô°À­¤ÎÊѹ¹¤Ë¤ÏÀ©Ìó¤¬ ¤¢¤ê¤Þ¤¹¡£¼Â¹Ô°À­¤¬¤¢¤ë¾ì¹ç¤Ë¤Ï¼Â¹Ô°À­¤ò¤¹¤Ù¤ÆÍ¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó¡£ ¾¯¤Ê¤¯¤È¤â°ì¤Ä¤Î¼Â¹Ô¥Ó¥Ã¥È¤Ï»Ä¤·¤Æ¤ª¤¯É¬Íפ¬¤¢¤ê¤Þ¤¹¡£ µÕ¤Ë¡¢¼Â¹Ô°À­¤¬Á´¤¯¤Ê¤¤¾ì¹ç¤Ë¼Â¹Ô°À­¤òΩ¤Æ¤ë¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó¡£ .SH "RETURN VALUES" .TP \fBNULL\fR Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ .TP \fBGFARM_ERR_NO_MEMORY\fR ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ .TP \fBGFARM_ERR_AUTHENTICATION\fR gfmd(8) ¤¢¤ë¤¤¤Ï gfsd(8) ¤ËÂФ¹¤ë¥æ¡¼¥¶¡¼Ç§¾Ú¤¬¼ºÇÔ¤·¤Þ¤·¤¿¡£ .TP \fBGFARM_ERR_PERMISSION_DENIED\fR »ØÄꤷ¤¿¥Ñ¥¹Ì¾¤Î¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤Ø¤Î¥¢¥¯¥»¥¹¤¹¤ë¸¢¸Â¤¬¤¢¤ê¤Þ¤»¤ó¡£ .TP \fBGFARM_ERR_OPERATION_NOT_PERMITTED\fR ¥×¥í¥»¥¹¤ò¼Â¹Ô¤·¤Æ¤¤¤ë¥æ¡¼¥¶¡¼¤¬¡¢¥Õ¥¡¥¤¥ë¤Î½êÍ­¼Ô¤Ç¤â¡¢¥·¥¹¥Æ¥à´ÉÍý¼Ô ¤Ç¤â¤¢¤ê¤Þ¤»¤ó¡£¤Þ¤¿¤Ï¡¢Ê£¿ô¤Î¥Õ¥é¥°¥á¥ó¥È¤ò¤â¤Ä¥Õ¥¡¥¤¥ë¤Î¼Â¹Ô¥Ó¥Ã¥È¤ò ¾¯¤Ê¤¯¤È¤â°ì¤Ä¤Ï¤¢¤ë¾õÂÖ¤«¤éÁ´¤¯¤Ê¤¤¾õÂ֤ˡ¢¤¢¤ë¤¤¤Ï¤½¤ÎµÕ¤ËÊѹ¹¤·¤è¤¦¤È ¤·¤Þ¤·¤¿¡£ .TP \fBGFARM_ERR_NO_SUCH_OBJECT\fR »ØÄꤵ¤ì¤¿¥Ñ¥¹Ì¾¤¬Â¸ºß¤·¤Þ¤»¤ó¡£ .TP \fBGFARM_ERR_NOT_A_DIRECTORY\fR »ØÄꤷ¤¿¥Ñ¥¹Ì¾¤Î¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤¬¡¢¼ÂºÝ¤Ë¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤«¤Ã¤¿¤³¤È¤ò ¼¨¤·¤Þ¤¹¡£ .TP \fB¤½¤Î¾\fR ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ gfarm-2.4.1/man/ja/man3/gfarm_import_fragment_size_alloc.30000644000000000000000000000271411507222725022163 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFARM_IMPORT_FRAGMENT_SIZE_ALLOC" "3" "18 March 2003" "Gfarm" "" .SH NAME gfarm_import_fragment_size_alloc \- ¥Õ¥é¥°¥á¥ó¥È¥µ¥¤¥º¤ÎÇÛÎó¤ò³ä¤êÅö¤Æ¤ë .SH SYNOPSIS .sp \fB#include .sp file_offset_t *gfarm_import_fragment_size_alloc (file_offset_t \fItotal_size\fB, int \fIn\fB); \fR .SH "DESCRIPTION" .PP Gfarm¥Õ¥¡¥¤¥ë¤ò¥¤¥ó¥Ý¡¼¥È¤¹¤ë¥¢¥×¥ê¥±¡¼¥·¥ç¥óÍѤÎÊä½õ´Ø¿ô¤Î°ì¤Ä¤Ç¤¹¡£ .PP ¥¤¥ó¥Ý¡¼¥È½èÍý¤Ë¤Ï¡¢¥Õ¥¡¥¤¥ë¤ò¡¢¤É¤ì¤¯¤é¤¤¤Î¥µ¥¤¥º¤Î¥Õ¥é¥°¥á¥ó¥È¤Ë ʬ³ä¤¹¤ë¤«¤È¤¤¤¦¾ðÊó¤¬É¬ÍפǤ¹¡£¸µ¥Õ¥¡¥¤¥ë¤Î¥µ¥¤¥º¤ò°ú¿ô \fItotal_size\fR ¤Ë¡¢¥Õ¥é¥°¥á¥ó¥È¿ô¤ò°ú¿ô \fIn\fR ¤ËÍ¿¤¨¤ë¤È¡¢¤³¤Î´Ø¿ô¤Ï·ë²Ì¤È¤·¤Æ¡¢³Æ¥Õ¥é¥°¥á¥ó¥È¤Îʬ³ä¥µ¥¤¥º¤ÎÌܰ¤ò¡¢ Í×ÁÇ¿ô \fIn\fR ¤ÎÇÛÎó¤È¤·¤ÆÊÖ¤·¤Þ¤¹¡£ .PP ¤³¤Î´Ø¿ô¤È gfarm_hostlist_read(3) ´Ø¿ô¤Î·ë²Ì¤òÁȤ߹ç¤ï¤»¤ë¤³¤È¤Ë¤è¤Ã¤Æ¡¢ gfarm_import_fragment_config_read(3) ´Ø¿ô¤¬ÊÖ¤¹¥Õ¥é¥°¥á¥ó¥Èʬ³ä¾ðÊó ¤ÈƱ¤¸·Á¼°¤Î¾ðÊó¤òÆÀ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ .PP ¤³¤Î´Ø¿ô¤ÇÆÀ¤¿ÇÛÎó¤Ï free(3) ¤òÍѤ¤¤Æ²òÊü¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£ .SH "RETURN VALUES" .TP \fBNULL\fR ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ .TP \fB¤½¤Î¾\fR ½èÍý¤ËÀ®¸ù¤·¤¿¾ì¹ç¡¢ file_offset_t ·¿¤ÎÇÛÎó¤ÎÀèÆ¬Í×ÁǤؤΥݥ¤¥ó¥¿¤òÊÖ¤·¤Þ¤¹¡£ .SH "SEE ALSO" .PP \fBgfarm_hostlist_read\fR(3), \fBgfarm_import_fragment_config_read\fR(3) gfarm-2.4.1/man/ja/man3/gfarm_stringlist_init.30000644000000000000000000000252711507222725020011 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFARM_STRINGLIST_INIT" "3" "18 March 2003" "Gfarm" "" .SH NAME gfarm_stringlist_init \- stringlist ¤ò½é´ü²½¤¹¤ë .SH SYNOPSIS .sp \fB#include .sp char *gfarm_stringlist_init (gfarm_stringlist * \fIlistp\fB); \fR .SH "DESCRIPTION" .PP gfarm_stringlist ¤Ï¡¢Ê¸»úÎóÇÛÎó¤ÎưŪ³ÎÊݤòÊä½õ¤¹¤ë·¿¤Ç¤¹¡£ ưŪ¤Ë³ÎÊݤµ¤ì¤ë¤Î¤Ï¡¢ÇÛÎó¤À¤±¤Ç¤¢¤ê¡¢ÇÛÎóÍ×ÁǤǤ¢¤ë³ÆÊ¸»úÎó¤Ë¤Ä¤¤¤Æ¤Ï¡¢ ¤³¤Î·¿¤Î´ÉÍý³°¤Ë¤Ê¤ê¤Þ¤¹¡£ .PP ¤³¤Î´Ø¿ô¤Ï¡¢ \fIlistp\fR ¤Î»Ø¤¹ gfarm_stringlist ·¿¤ÎÊÑ¿ô¤ò½é´ü²½¤·¤Þ¤¹¡£ .PP ¤³¤Î·¿¤ÎÍøÍѤò½ª¤¨¤¿»þ¤Ë¤Ï¡¢gfarm_stringlist_free() ¤òÍѤ¤¤Æ¡¢ ưŪ¤Ë³ÎÊݤ·¤¿¥á¥â¥ê¤ò²òÊü¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£ .SH "RETURN VALUES" .TP \fBNULL\fR Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ .TP \fBGFARM_ERR_NO_MEMORY\fR ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ .TP \fB¤½¤Î¾\fR ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ .SH "SEE ALSO" .PP \fBGFARM_STRINGLIST_ELEM\fR(3), \fBGFARM_STRINGLIST_STRARRAY\fR(3), \fBgfarm_stringlist_add\fR(3), \fBgfarm_stringlist_cat\fR(3), \fBgfarm_stringlist_elem\fR(3), \fBgfarm_stringlist_free\fR(3), \fBgfarm_stringlist_free_deeply\fR(3), \fBgfarm_stringlist_length\fR(3) gfarm-2.4.1/man/ja/man3/gfs_pio_set_local.30000644000000000000000000000164411507222725017062 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_PIO_SET_LOCAL" "3" "18 March 2003" "Gfarm" "" .SH NAME gfs_pio_set_local \- ¥í¡¼¥«¥ë¥Õ¥¡¥¤¥ë¥Ó¥å¡¼¤Î½é´ü²½ .SH SYNOPSIS .sp \fB#include .sp char *gfs_pio_set_local (int \fInode\fB, int \fInnode\fB); \fR .SH "DESCRIPTION" .PP ¥í¡¼¥«¥ë¥Õ¥¡¥¤¥ë¥Ó¥å¡¼¤òÍøÍѤ¹¤ëÊÂÎó¥×¥í¥»¥¹¤Ï¡¢¤½¤Î½èÍý¤ÎºÇ½é¤Ë¡¢ ¤½¤Î¥Î¡¼¥É¤Î¥Î¡¼¥ÉÈÖ¹æ¤ò \fInode\fR ¤Ë¡¢ÊÂÎó¥×¥í¥»¥¹¤ò¹½À®¤¹¤ëÁí¥Î¡¼¥É¿ô¤ò \fInnode\fR ¤ËÍ¿¤¨¤Æ¡¢¤³¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤Þ¤¹¡£ .SH "RETURN VALUES" .TP \fBNULL\fR Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ .TP \fB¤½¤Î¾\fR ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ .SH "SEE ALSO" .PP \fBgfs_pio_set_view_local\fR(3), \fBgfs_pio_set_view_index\fR(3) gfarm-2.4.1/man/ja/man3/gfs_glob_add.30000644000000000000000000000146411507222725016001 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_GLOB_ADD" "3" "11 September 2003" "Gfarm" "" .SH NAME gfs_glob_add \- ¥Ñ¥¹¤Î¥¿¥¤¥×¤ò¥ê¥¹¥È¤ËÄɲ乤ë .SH SYNOPSIS .sp \fB#include .sp char *gfs_glob_add (gfs_glob_t * \fIlistp\fB, int \fIdtype\fB); \fR .SH "DESCRIPTION" .PP °ú¿ô \fIlistp\fR ¤Ë°ú¿ô \fIdtype\fR ¤ò¥Ñ¥¹¤Î¥¿¥¤¥×¤È¤·¤ÆÄɲä·¤Þ¤¹¡£ .SH "RETURN VALUES" .TP \fBNULL\fR Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ .TP \fBGFARM_ERR_NO_MEMORY\fR ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ .SH "SEE ALSO" .PP \fBgfs_glob_init\fR(3) \fBgfs_glob\fR(3) \fBgfs_glob_free\fR(3) gfarm-2.4.1/man/ja/man3/gfarm_url_fragments_replicate.30000644000000000000000000000254311507222725021462 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFARM_URL_FRAGMENTS_REPLICATE" "3" "06 September 2005" "Gfarm" "" .SH NAME gfarm_url_fragments_replicate \- ¥Õ¥¡¥¤¥ë¤Î¥ì¥×¥ê¥«¤òºîÀ®¤¹¤ë .SH SYNOPSIS .sp \fB#include .sp char *gfarm_url_fragments_replicate (const char *\fIgfarm_url\fB, int \fIndsthosts\fB, char **\fIdsthosts\fB); \fR .SH "DESCRIPTION" .PP ¥Õ¥¡¥¤¥ë \fIgfarm_url\fR ¤ÎÊ£À½¤ò¡¢Ä¹¤µ \fIndsthosts\fR ¤Îʸ»úÎóÇÛÎó \fIdsthosts\fR ¤Ç»ØÄꤷ¤¿¥Û¥¹¥È¤ËºîÀ®¤·¤Þ¤¹¡£ ¤³¤Î´Ø¿ô¤Ç¤Ï¡¢¼Â¹Ô·Á¼°¤Î¥Õ¥¡¥¤¥ë¤ÎÊ£À½¤Ë¤ÏÍøÍѤǤ­¤Þ¤»¤ó¡£ .PP ¥Õ¥¡¥¤¥ë¤Î¥Õ¥¡¥¤¥ë¥¤¥ó¥Ç¥Ã¥¯¥¹¤ÎÁí¿ô¤è¤ê¡¢»ØÄꤵ¤ì¤¿¥Û¥¹¥È¤ÎÁí¿ô \fIndsthosts\fR ¤¬¾¯¤Ê¤¤¾ì¹ç¤Ï¡¢»ØÄꤵ¤ì¤¿¥Û¥¹¥È¤¬¥é¥¦¥ó¥É¥í¥Ó¥ó¤Ç³ä¤êÅö¤Æ¤é¤ì¤Þ¤¹¡£ .SH "RETURN VALUES" .TP \fBNULL\fR Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ .TP \fBGFARM_ERR_NO_MEMORY\fR ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ .TP \fBGFARM_ERR_OPERATION_NOT_PERMITTED\fR °ú¿ô¤È¤·¤Æ¡¢¼Â¹Ô·Á¼°¤Î¥Õ¥¡¥¤¥ë¡¢ ¥Ç¥£¥ì¥¯¥È¥ê¤Ê¤ÉÄ̾ï¥Õ¥¡¥¤¥ë°Ê³°¤Î¥Õ¥¡¥¤¥ë¤ò»ØÄꤷ¤Þ¤·¤¿¡£ .TP \fB¤½¤Î¾\fR ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ .SH "SEE ALSO" .PP \fBgfarm_url_section_replicate_from_to\fR(3), \fBgfarm_url_section_replicate_from_to\fR(3) gfarm-2.4.1/man/ja/man3/Makefile0000644000000000000000000000056511507222725014764 0ustar rootroot# $Id: Makefile 2373 2006-01-12 00:54:22Z soda $ top_builddir = ../../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk include $(srcdir)/../Makefile.inc DOCBOOK_DIR=$(top_srcdir)/doc/docbook/ja/ref/man3 include $(DOCBOOK_DIR)/Makefile.inc MAN = $(DOCBOOK) EXTRA_CLEAN_TARGETS = manpage.links manpage.refs include $(top_srcdir)/makes/man.mk gfarm-2.4.1/man/ja/man3/gfs_unlink.30000644000000000000000000000213511507222725015542 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_UNLINK" "3" "18 March 2003" "Gfarm" "" .SH NAME gfs_unlink \- ¥Õ¥¡¥¤¥ëºï½ü .SH SYNOPSIS .sp \fB#include .sp char *gfs_unlink (char * \fIgfarm_url\fB); \fR .SH "DESCRIPTION" .PP °ú¿ô \fIgfarm_url\fR ¤Ë»ØÄꤷ¤¿Ì¾Á°¤Î¥Õ¥¡¥¤¥ë¤òºï½ü¤·¤Þ¤¹¡£ .SH "RETURN VALUES" .TP \fBNULL\fR Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ .TP \fBGFARM_ERR_NO_MEMORY\fR ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ .TP \fBGFARM_ERR_AUTHENTICATION\fR gfmd(8) ¤ËÂФ¹¤ë¥æ¡¼¥¶¡¼Ç§¾Ú¤¬¼ºÇÔ¤·¤Þ¤·¤¿¡£ .TP \fBGFARM_ERR_PERMISSION_DENIED\fR \fIgfarm_url\fR ¤Î¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤Ø½ñ¤­¹þ¤ß¥¢¥¯¥»¥¹¤¹¤ë¸¢¸Â¤¬¤¢¤ê¤Þ¤»¤ó¡£ .TP \fBGFARM_ERR_NO_SUCH_OBJECT\fR »ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Þ¤»¤ó¡£ .TP \fBGFARM_ERR_NOT_A_DIRECTORY\fR »ØÄꤷ¤¿¥Ñ¥¹Ì¾¤Î¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤¬¡¢¼ÂºÝ¤Ë¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤«¤Ã¤¿¤³¤È¤ò ¼¨¤·¤Þ¤¹¡£ .TP \fB¤½¤Î¾\fR ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ gfarm-2.4.1/man/ja/man3/gfs_stat.30000644000000000000000000000246411507222725015222 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_STAT" "3" "11 September 2003" "Gfarm" "" .SH NAME gfs_stat \- ¥Õ¥¡¥¤¥ë°À­¼èÆÀ .SH SYNOPSIS .sp \fB#include .sp char *gfs_stat (const char * \fIgfarm_url\fB, struct gfs_stat * \fIstatus\fB); \fR .SH "DESCRIPTION" .PP °ú¿ô \fIgfarm_url\fR ¤Î¥Õ¥¡¥¤¥ë°À­¤ò \fIstatus\fR ¤Î»Ø¤¹Àè¤Ë¼èÆÀ¤·¤Þ¤¹¡£ \fIstatus\fR .PP ¤Ë¤Ï¡¢Æ°Åª¤Ë³ÎÊݤµ¤ì¤¿¥á¥â¥ê¤Ø¤Î¥Ý¥¤¥ó¥¿¤¬´Þ¤Þ¤ì¤ë¤Î¤Ç¡¢ ¤³¤Î¸å¡¢gfs_stat_free(3) ¤ò»È¤Ã¤Æ¤½¤Î¥á¥â¥ê¤ò²òÊü¤¹¤ëɬÍפ¬ ¤¢¤ê¤Þ¤¹¡£ .SH "RETURN VALUES" .TP \fBNULL\fR Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ .TP \fBGFARM_ERR_NO_MEMORY\fR ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ .TP \fBGFARM_ERR_AUTHENTICATION\fR gfmd(8) ¤ËÂФ¹¤ë¥æ¡¼¥¶¡¼Ç§¾Ú¤¬¼ºÇÔ¤·¤Þ¤·¤¿¡£ .TP \fBGFARM_ERR_PERMISSION_DENIED\fR »ØÄꤵ¤ì¤¿¥Ñ¥¹¤Ø¥¢¥¯¥»¥¹¤¹¤ë¸¢¸Â¤¬¡¢¤¢¤ê¤Þ¤»¤ó¡£ .TP \fBGFARM_ERR_NO_SUCH_OBJECT\fR »ØÄꤵ¤ì¤¿¥Ñ¥¹Ì¾¤¬Â¸ºß¤·¤Þ¤»¤ó¡£ .TP \fBGFARM_ERR_NOT_A_DIRECTORY\fR »ØÄꤷ¤¿¥Ñ¥¹Ì¾¤Î¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤¬¡¢¼ÂºÝ¤Ë¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤«¤Ã¤¿¤³¤È¤ò ¼¨¤·¤Þ¤¹¡£ .TP \fB¤½¤Î¾\fR ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ .SH "SEE ALSO" .PP \fBgfs_stat_free\fR(3) gfarm-2.4.1/man/ja/man3/gfs_glob_init.30000644000000000000000000000175111507222725016213 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_GLOB_INIT" "3" "02 September 2003" "Gfarm" "" .SH NAME gfs_glob_init \- ¥Ñ¥¹¤Î¥¿¥¤¥×¤ò³ÊǼ¤¹¤ëÎΰè¤ò³ÎÊݤ¹¤ë .SH SYNOPSIS .sp \fB#include .sp char *gfs_glob_init (gfs_glob_t * \fIlistp\fB); \fR .SH "DESCRIPTION" .PP ¥Ñ¥¿¡¼¥ó¤Ë¥Þ¥Ã¥Á¤¹¤ë¥Ñ¥¹Ì¾¤ò¼èÆÀ¤¹¤ë´Ø¿ô gfs_glob(3)¡¢ ¥Ñ¥¹¤Î¥¿¥¤¥×¤òÄɲä¹¤ë´Ø¿ô gfs_glob_add() ¤¬¥Ñ¥¹¤Î¥¿¥¤¥×¤ò ³ÊǼ¤¹¤ë¤¿¤á¤Ë»ÈÍѤ¹¤ëÎΰè¤òưŪ¤Ë³ÎÊݤ·¡¢¤½¤Î¥¢¥É¥ì¥¹¤ò°ú¿ô \fIlistp\fR ¤ËÀßÄꤷ¤Þ¤¹¡£ .SH "RETURN VALUES" .TP \fBNULL\fR Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ .TP \fBGFARM_ERR_NO_MEMORY\fR ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ .TP \fB¤½¤Î¾\fR ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ .SH "SEE ALSO" .PP \fBgfs_glob\fR(3) \fBgfs_glob_add\fR(3) \fBgfs_glob_free\fR(3) gfarm-2.4.1/man/ja/man3/gfarm_stringlist_free_deeply.30000644000000000000000000000004111507222725021316 0ustar rootroot.so man3/gfarm_stringlist_free.3 gfarm-2.4.1/man/ja/man3/gfarm_stringlist_length.30000644000000000000000000000165411507222725020327 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFARM_STRINGLIST_LENGTH" "3" "18 March 2003" "Gfarm" "" .SH NAME gfarm_stringlist_length \- stringlist ¤Îʸ»úÎó¿ô¤òÊÖ¤¹ .SH SYNOPSIS .sp \fB#include .sp int gfarm_stringlist_length (gfarm_stringlist * \fIlistp\fB); \fR .SH "DESCRIPTION" .PP \fIlistp\fR ¤Îɽ¤¹Ê¸»úÎóÇÛÎó¤ÎÇÛÎóÍ×ÁÇ¿ô¤òÊÖ¤·¤Þ¤¹¡£ .SH "RETURN VALUES" .PP ʸ»úÎó¤Î¿ô¤òÊÖ¤·¤Þ¤¹¡£ .SH "SEE ALSO" .PP \fBGFARM_STRINGLIST_ELEM\fR(3), \fBGFARM_STRINGLIST_STRARRAY\fR(3), \fBgfarm_stringlist_add\fR(3), \fBgfarm_stringlist_cat\fR(3), \fBgfarm_stringlist_elem\fR(3), \fBgfarm_stringlist_free\fR(3), \fBgfarm_stringlist_free_deeply\fR(3), \fBgfarm_stringlist_init\fR(3) gfarm-2.4.1/man/ja/man3/gfs_pio_close.30000644000000000000000000000177011507222725016222 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_PIO_CLOSE" "3" "27 June 2010" "Gfarm" "" .SH NAME gfs_pio_close \- Gfarm¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥Õ¥¡¥¤¥ë¤Î¥¯¥í¡¼¥º .SH SYNOPSIS .sp \fB#include .sp gfarm_error_t gfs_pio_close (GFS_File \fIgfp\fB); \fR .SH "DESCRIPTION" .PP ¥Õ¥¡¥¤¥ë \fIgfp\fR ¤ò¥¯¥í¡¼¥º¤·¤Þ¤¹¡£ .SH "RETURN VALUES" .TP \fBGFARM_ERR_NO_ERROR\fR Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ .TP \fBGFARM_ERR_BAD_FILE_DESCRIPTOR\fR \fIgfp\fR ¤Ç»ØÄꤵ¤ì¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬ÉÔÀµ¤Ç¤¹¡£ .TP \fBGFARM_ERR_NO_MEMORY\fR ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ .TP \fB¤½¤Î¾\fR ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ \fBgfarm_error_string\fR(3) ¤Ë¤è¤ê¥¨¥é¡¼¤Î¸¶°ø¤òʸ»úÎó¤ËÊÑ´¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ .SH "SEE ALSO" .PP \fBgfs_pio_create\fR(3), \fBgfs_pio_open\fR(3) gfarm-2.4.1/man/ja/man3/gfarm_url_section_replicate_to.30000644000000000000000000000276311507222725021646 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFARM_URL_SECTION_REPLICATE_TO" "3" "06 September 2005" "Gfarm" "" .SH NAME gfarm_url_section_replicate_to \- ¥Õ¥¡¥¤¥ë¥»¥¯¥·¥ç¥ó¤Î¥ì¥×¥ê¥«¤òºîÀ®¤¹¤ë .SH SYNOPSIS .sp \fB#include .sp char *gfarm_url_section_replicate_to (const char *\fIgfarm_url\fB, char *\fIsection\fB, char *\fIdsthost\fB); \fR .SH "DESCRIPTION" .PP ¥Õ¥¡¥¤¥ë \fIgfarm_url\fR ¤Î¥Õ¥¡¥¤¥ë¥»¥¯¥·¥ç¥ó \fIsection\fR ¤ÎÊ£À½¤ò¡¢ \fIdsthost\fR ¤ËºîÀ®¤·¤Þ¤¹¡£ .PP ¥Õ¥¡¥¤¥ë¥»¥¯¥·¥ç¥ó¤È¤Ï¡¢¼Â¹Ô·Á¼°¤Î¥Õ¥¡¥¤¥ë¤Î¾ì¹ç¤Ï¥¢¡¼¥­¥Æ¥¯¥Á¥ã̾¡¢ Ä̾ï¥Õ¥¡¥¤¥ë¤Î¾ì¹ç¤Ï¥Õ¥¡¥¤¥ë¥¤¥ó¥Ç¥Ã¥¯¥¹ÈÖ¹æ¤È¤Ê¤ê¤Þ¤¹¡£ ¥Õ¥¡¥¤¥ë¥¤¥ó¥Ç¥Ã¥¯¥¹ÈÖ¹æ¤òÀ°¿ô¤Ç¤Ï¤Ê¤¯¡¢Ê¸»úÎó \fIsection\fR ¤Ç»ØÄꤹ¤ëɬÍפ¬¤¢¤ë¤³¤È¤ËÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡£¤Þ¤¿¡¢¤Þ¤¿¤³¤Îʸ»úÎó¤Ï¡¢ ;ʬ¤Ê¶õÇò¤ä¡¢Àè¹Ô 0 ¤ò´Þ¤ó¤Ç¤Ï¤¤¤±¤Þ¤»¤ó¡£ .SH "RETURN VALUES" .TP \fBNULL\fR Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ .TP \fBGFARM_ERR_NO_MEMORY\fR ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ .TP \fBGFARM_ERR_NO_SUCH_OBJECT\fR »ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Þ¤»¤ó¡£ .TP \fBGFARM_ERR_TEXT_FILE_BUSY\fR »ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤¬¸½ºß¡Ê¾¤Î¥×¥í¥»¥¹¤Ë¤è¤ê¡Ë¹¹¿·Ãæ¤Î¤¿¤á¡¢ ¥Õ¥¡¥¤¥ë¤ÎÊ£À½¤¬ºîÀ®¤Ç¤­¤Þ¤»¤ó¡£ .TP \fB¤½¤Î¾\fR ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ .SH "SEE ALSO" .PP \fBgfarm_url_section_replicate_from_to\fR(3), \fBgfarm_url_fragments_replicate\fR(3) gfarm-2.4.1/man/ja/man3/gfs_pio_puts.30000644000000000000000000000145711507222725016112 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_PIO_PUTS" "3" "18 March 2003" "Gfarm" "" .SH NAME gfs_pio_puts \- ʸ»úÎó½ñ¤­¹þ¤ß .SH SYNOPSIS .sp \fB#include .sp char *gfs_pio_puts (GFS_File \fIgf\fB, char * \fIs\fB); \fR .SH "DESCRIPTION" .PP ʸ»úÎó \fIs\fR ¤ò¥Õ¥¡¥¤¥ë \fIgf\fR ¤Ë½ñ¤­¹þ¤ß¤Þ¤¹¡£ .SH "RETURN VALUES" .TP \fBNULL\fR Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ .TP \fBGFARM_ERR_NO_MEMORY\fR ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ .TP \fB¤½¤Î¾\fR ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ .SH "SEE ALSO" .PP \fBgfs_pio_create\fR(3), \fBgfs_pio_open\fR(3) gfarm-2.4.1/man/ja/man3/gfarm_import_fragment_config_read.30000644000000000000000000000303411507222725022273 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFARM_IMPORT_FRAGMENT_CONFIG_READ" "3" "18 March 2003" "Gfarm" "" .SH NAME gfarm_import_fragment_config_read \- ¥Õ¥é¥°¥á¥ó¥È¹½À®¥Õ¥¡¥¤¥ë¤òÆÉ¤ß¹þ¤à .SH SYNOPSIS .sp \fB#include .sp char *gfarm_import_fragment_config_read (char *\fIconfig\fB, int *\fInp\fB, char ***\fIhost_table_p\fB, file_offset_t **\fIsize_table_p\fB, int *\fIerror_line_p\fB); \fR .SH "DESCRIPTION" .PP Gfarm¥Õ¥¡¥¤¥ë¤ò¥¤¥ó¥Ý¡¼¥È¤¹¤ë¥¢¥×¥ê¥±¡¼¥·¥ç¥óÍѤÎÊä½õ´Ø¿ô¤Î°ì¤Ä¤Ç¤¹¡£ .PP import ¤Î¹½À®¥Õ¥¡¥¤¥ë̾¤ò \fIconfig\fR ¤Ë»ØÄꤹ¤ë¤È¡¢¤½¤Î¥Õ¥¡¥¤¥ë¤«¤é¡¢ ¥Û¥¹¥È¤ÎÇÛÎó¤ò \fIhost_table_p\fR ¤Î»Ø¤¹Àè¤Ë¡¢¤Þ¤¿¡¢¥µ¥¤¥º¤ÎÇÛÎó¤ò \fIsize_table_p\fR ¤Î»Ø¤¹Àè¤ËÊÖ¤·¤Þ¤¹¡£¹½À®¥Õ¥¡¥¤¥ë¤Ë¹½Ê¸¥¨¥é¡¼¤¬À¸¤¸¤¿¾ì¹ç¤Ë¤Ï¡¢ \fIerror_line_p\fR ¤Î»Ø¤¹Àè¤Ë¡¢¥Õ¥¡¥¤¥ë¤Î¹ÔÈÖ¹æ¤òÊÖ¤·¤Þ¤¹¡£¤³¤ÎÃͤ¬ -1 ¤Î¾ì¹ç¤Ë¤Ï¡¢¹½Ê¸°Ê³°¤Î¥¨¥é¡¼¸¶°ø¤Ç¤¹¡£ .PP ¹½À®¥Õ¥¡¥¤¥ë¤Ï¡¢³Æ¹Ô¤¬¡¢¶õÇò¤Ç¶èÀÚ¤é¤ì¤¿¥µ¥¤¥º¤È¥Û¥¹¥È̾¤«¤é¤Ê¤ë·Á¼°¤Ç¤¹¡£ .PP ¤³¤³¤ÇÆÀ¤¿¥Û¥¹¥È¤ÎÇÛÎó¤Ï gfarm_strings_free_deeply() ¤òÍѤ¤¤Æ²òÊü ¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£ ¤Þ¤¿¡¢¤³¤³¤ÇÆÀ¤¿¥µ¥¤¥º¤ÎÇÛÎó¤Ï free() ¤òÍѤ¤¤Æ²òÊü¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£ .SH "RETURN VALUES" .TP \fBNULL\fR Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ .TP \fBGFARM_ERR_NO_MEMORY\fR ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ .TP \fB¤½¤Î¾\fR ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ .SH "SEE ALSO" .PP \fBgfarm_hostlist_read\fR(3) gfarm-2.4.1/man/ja/man3/gfs_rename.30000644000000000000000000000335211507222725015513 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_RENAME" "3" "21 February 2005" "Gfarm" "" .SH NAME gfs_rename \- ¥Õ¥¡¥¤¥ë¤ò²þ̾¤¹¤ë .SH SYNOPSIS .sp \fB#include .sp char *gfs_rename (char * \fIgfarm_url_from\fB, char * \fIgfarm_url_to\fB); \fR .SH "DESCRIPTION" .PP ¥Õ¥¡¥¤¥ë¤Þ¤¿¤Ï¥Ç¥£¥ì¥¯¥È¥ê \fIgfarm_url_from\fR ¤ò \fIgfarm_url_to\fR ¤Ë²þ̾¤·¤Þ¤¹¡£ .PP \fIgfarm_url_to\fR ¤¬´û¸¤Î¾ì¹ç¤Ïºï½ü¤µ¤ì¤Þ¤¹¡£¤³¤Î¤È¤­ \fIgfarm_url_from\fR ¤¬¥Õ¥¡¥¤¥ë¤Ê¤é¤Ð \fIgfarm_url_to\fR ¤â¥Õ¥¡¥¤¥ë¡¢ \fIgfarm_url_from\fR ¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Ê¤é¤Ð \fIgfarm_url_to\fR ¤â¥Ç¥£¥ì¥¯¥È¥ê¤Ç¡¢¤·¤«¤â¶õ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£ .PP ¥Ç¥£¥ì¥¯¥È¥ê \fIgfarm_url_from\fR ¤ò¤½¤Î¥µ¥Ö¥Ç¥£¥ì¥¯¥È¥ê¤Ë²þ̾¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó¡£ .SH "RETURN VALUES" .TP \fBNULL\fR Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ .TP \fBGFARM_ERR_NO_MEMORY\fR ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ .TP \fBGFARM_ERR_AUTHENTICATION\fR gfmd(8) ¤ËÂФ¹¤ë¥æ¡¼¥¶¡¼Ç§¾Ú¤¬¼ºÇÔ¤·¤Þ¤·¤¿¡£ .TP \fBGFARM_ERR_PERMISSION_DENIED\fR ¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤Ø½ñ¤­¹þ¤ß¥¢¥¯¥»¥¹¤¹¤ë¸¢¸Â¤¬¤¢¤ê¤Þ¤»¤ó¡£ .TP \fBGFARM_ERR_INVALID_ARGUMENT\fR ¥Ç¥£¥ì¥¯¥È¥ê \fIgfarm_url_from\fR ¤ò¡¢¤½¤ì¼«¿È¤Î¥µ¥Ö¥Ç¥£¥ì¥¯¥È¥ê¤ËÊѹ¹¤·¤è¤¦¤È¤·¤Þ¤·¤¿¡£ .TP \fBGFARM_ERR_NO_SUCH_OBJECT\fR »ØÄꤵ¤ì¤¿¥Ñ¥¹ \fIgfarm_url_from\fR ¤¬Â¸ºß¤·¤Þ¤»¤ó¡£ .TP \fBGFARM_ERR_IS_A_DIRECTORY\fR \fIgfarm_url_from\fR ¤¬¥Õ¥¡¥¤¥ë¤Ç¤¢¤ë¤Î¤Ë¡¢ \fIgfarm_url_to\fR ¤Ï´û¸¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤¹¡£ .TP \fBGFARM_NOT_IS_A_DIRECTORY\fR \fIgfarm_url_from\fR ¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤¢¤ë¤Î¤Ë¡¢ \fIgfarm_url_to\fR ¤Ï´û¸¤Î¥Õ¥¡¥¤¥ë¤Ç¤¹¡£ .TP \fB¤½¤Î¾\fR ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ gfarm-2.4.1/man/ja/man3/gfs_pio_datasync.30000644000000000000000000000213011507222725016712 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_PIO_DATASYNC" "3" "01 June 2005" "Gfarm" "" .SH NAME gfs_pio_datasync \- ¥á¥â¥ê¾å¤Î¥Õ¥¡¥¤¥ë¤ÎÆâÍÆ¤ò¥Ç¥£¥¹¥¯¤ËÈ¿±Ç¤µ¤»¤ë .SH SYNOPSIS .sp \fB#include .sp char *gfs_pio_datasync (GFS_File \fIgf\fB); \fR .SH "DESCRIPTION" .PP ½ñ¤­¹þ¤ßÍѤ˥ª¡¼¥×¥ó¤·¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë \fIgf\fR ¤Î¡¢¥á¥â¥ê¾å¤Ë¤¢¤ë¥Ç¡¼¥¿¤ò¼ÂºÝ¤Ë¥Ç¥£¥¹¥¯¤Ë½ñ¤­¹þ¤ß¡¤ Æþ½ÐÎϤδ°Î»¤òÂԤäƤ«¤éÌá¤ê¤Þ¤¹¡¥¥á¥¿¥Ç¡¼¥¿¤Ï¹¹¿·¤·¤Þ¤»¤ó¡¥ Ê̤δؿô \fBgfs_pio_sync\fR ¤Ï¡¤¥Õ¥¡¥¤¥ë¥Ç¡¼¥¿¤Ë²Ã¤¨¤Æ¥á¥¿¥Ç¡¼¥¿¤â¥Ç¥£¥¹¥¯¤Ë½ñ¤­¹þ¤ß¤Þ¤¹¡¥ .SH "RETURN VALUES" .TP \fBNULL\fR Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡¥ .TP \fBGFARM_ERR_NO_MEMORY\fR ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡¥ .TP \fB¤½¤Î¾\fR ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡¥ .SH "SEE ALSO" .PP \fBgfs_pio_sync\fR(3), \fBgfs_pio_create\fR(3), \fBgfs_pio_open\fR(3), \fBgfs_pio_write\fR(3), \fBgfs_pio_flush\fR(3) gfarm-2.4.1/man/ja/man3/gfarm_url_program_register.30000644000000000000000000000230111507222725021007 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFARM_URL_PROGRAM_REGISTER" "3" "18 March 2003" "Gfarm" "" .SH NAME gfarm_url_program_register \- ¥×¥í¥°¥é¥à¤òÅÐÏ¿¤¹¤ë .SH SYNOPSIS .sp \fB#include .sp char *gfarm_url_program_register (char *\fIgfarm_url\fB, char *\fIarchitecture\fB, char *\fIfilename\fB, int \fInreplicas\fB); \fR .SH "DESCRIPTION" .PP °ú¿ô \fIarchitecture\fR ¤Ç»ØÄꤷ¤¿µ¡¼ï¸þ¤±¤Î¼Â¹Ô·Á¼°¥Õ¥¡¥¤¥ë \fIfilename\fR ¤ò¡¢ \fIgfarm_url\fR ¤Ç»ØÄꤷ¤¿¥Ñ¥¹Ì¾¤ËÅÐÏ¿¤·¤Þ¤¹¡£ ¤Þ¤¿¡¢ \fInreplicas\fR ¤Ë¡¢ºîÀ®¤¹¤ë¥ì¥×¥ê¥«¤Î¿ô¤ò»ØÄꤷ¤Þ¤¹¡£ .PP °ú¿ô \fInreplicas\fR ¤Ï¡¢¾­Íè¤Î¥Ð¡¼¥¸¥ç¥ó¤Çºï½ü¤µ¤ì¤ëͽÄê¤Ç¤¹¡£ .SH "RETURN VALUES" .TP \fBNULL\fR Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ .TP \fBGFARM_ERR_NO_MEMORY\fR ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ .TP \fBGFARM_ERR_OPERATION_NOT_PERMITTED\fR »ØÄꤷ¤¿¥Õ¥¡¥¤¥ë¤Ë¡¢¼Â¹Ô²Äǽ¥Ó¥Ã¥È¤¬Î©¤Ã¤Æ¤¤¤Þ¤»¤ó¤Ç¤·¤¿¡£ .TP \fB¤½¤Î¾\fR ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ .SH "SEE ALSO" .PP \fBgfarm_url_program_deliver\fR(3) gfarm-2.4.1/man/ja/man3/gfs_utimes.30000644000000000000000000000273611507222725015557 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_UTIMES" "3" "04 December 2003" "Gfarm" "" .SH NAME gfs_utimes \- ¥Õ¥¡¥¤¥ë¥¢¥¯¥»¥¹»þ¹ï/½¤Àµ»þ¹ïÊѹ¹ .SH SYNOPSIS .sp \fB#include .sp char *gfs_utimes (const char * \fIgfarm_url\fB, const struct gfarm_timespec * \fItsp\fB); \fR .SH "DESCRIPTION" .PP °ú¿ô \fIgfarm_url\fR ¤Î¥Õ¥¡¥¤¥ë¥¢¥¯¥»¥¹»þ¹ï/½¤Àµ»þ¹ï¤ò \fItsp\fR ¤ÎÃͤËÊѹ¹¤·¤Þ¤¹¡£ \fItsp\fR[0] ¤ÎÃͤò¥¢¥¯¥»¥¹»þ¹ï¤Ë¡¢ \fItsp\fR[1] ¤ÎÃͤò½¤Àµ»þ¹ï¤Ë»ÈÍѤ·¤Þ¤¹¡£ ¹½Â¤ÂÎ gfarm_timespec ¤Ï°Ê²¼¤Î¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£ .nf struct gfarm_timespec { unsigned int tv_sec; /* seconds */ unsigned int tv_nsec; /* nanoseconds */ }; .fi .PP \fItsp\fR ¤¬ NULL ¤Î¾ì¹ç¡¢¸½ºß¤Î»þ¹ï¤òÀßÄꤷ¤Þ¤¹¡£ .SH "RETURN VALUES" .TP \fBNULL\fR Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ .TP \fBGFARM_ERR_GFARM_URL_PREFIX_IS_MISSING\fR ¥Õ¥¡¥¤¥ë̾¤Ë Gfarm URL ¤Î gfarm: ¤¬¤¢¤ê¤Þ¤»¤ó¡£ .TP \fBGFARM_ERR_NO_MEMORY\fR ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ .TP \fBGFARM_ERR_AUTHENTICATION\fR gfmd(8) ¤ËÂФ¹¤ë¥æ¡¼¥¶¡¼Ç§¾Ú¤¬¼ºÇÔ¤·¤Þ¤·¤¿¡£ .TP \fBGFARM_ERR_PERMISSION_DENIED\fR »ØÄꤵ¤ì¤¿¥Ñ¥¹¤Ø¥¢¥¯¥»¥¹¤¹¤ë¸¢¸Â¤¬¡¢¤¢¤ê¤Þ¤»¤ó¡£ .TP \fBGFARM_ERR_NO_SUCH_OBJECT\fR »ØÄꤵ¤ì¤¿¥Ñ¥¹Ì¾¤¬Â¸ºß¤·¤Þ¤»¤ó¡£ .TP \fB¤½¤Î¾\fR ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ .SH "SEE ALSO" .PP \fBgfs_stat\fR(3) gfarm-2.4.1/man/ja/man3/gfs_closedir.30000644000000000000000000000135011507222725016044 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_CLOSEDIR" "3" "18 March 2003" "Gfarm" "" .SH NAME gfs_closedir \- ¥Ç¥£¥ì¥¯¥È¥ê¤ò¥¯¥í¡¼¥º¤¹¤ë .SH SYNOPSIS .sp \fB#include .sp char *gfs_closedir (GFS_Dir \fIdir\fB); \fR .SH "DESCRIPTION" .PP °ú¿ô \fIdir\fR ¤Ç»ØÄꤷ¤¿¥Ç¥£¥ì¥¯¥È¥ê¤ò¥¯¥í¡¼¥º¤·¤Þ¤¹¡£ .SH "RETURN VALUES" .TP \fBNULL\fR Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ .TP \fB¤½¤Î¾\fR ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ .SH "SEE ALSO" .PP \fBgfs_opendir\fR(3), \fBgfs_readdir\fR(3) gfarm-2.4.1/man/ja/man3/gfs_chdir.30000644000000000000000000000215211507222725015332 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_CHDIR" "3" "11 September 2003" "Gfarm" "" .SH NAME gfs_chdir \- ºî¶È¥Ç¥£¥ì¥¯¥È¥ê¤ÎÊѹ¹ .SH SYNOPSIS .sp \fB#include .sp char *gfs_chdir (const char * \fIgfarm_url\fB); \fR .SH "DESCRIPTION" .PP ºî¶È¥Ç¥£¥ì¥¯¥È¥ê¤ò°ú¿ô \fIgfarm_url\fR ¤Ë»ØÄꤷ¤¿¥Ç¥£¥ì¥¯¥È¥ê¤ËÊѹ¹¤·¤Þ¤¹¡£ .SH "RETURN VALUES" .TP \fBNULL\fR Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ .TP \fBGFARM_ERR_NO_MEMORY\fR ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ .TP \fBGFARM_ERR_AUTHENTICATION\fR gfmd(8) ¤ËÂФ¹¤ë¥æ¡¼¥¶¡¼Ç§¾Ú¤¬¼ºÇÔ¤·¤Þ¤·¤¿¡£ .TP \fBGFARM_ERR_PERMISSION_DENIED\fR »ØÄꤷ¤¿¥Ç¥£¥ì¥¯¥È¥ê¤ËÊѹ¹¤¹¤ë¸¢¸Â¤¬¤¢¤ê¤Þ¤»¤ó¡£ .TP \fBGFARM_ERR_NO_SUCH_OBJECT\fR »ØÄꤵ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¤¬Â¸ºß¤·¤Þ¤»¤ó¡£ .TP \fBGFARM_ERR_NOT_A_DIRECTORY\fR »ØÄꤷ¤¿¥Ñ¥¹Ì¾¤Î¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤¬¡¢¼ÂºÝ¤Ë¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤«¤Ã¤¿¤³¤È¤ò ¼¨¤·¤Þ¤¹¡£ .TP \fB¤½¤Î¾\fR ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ gfarm-2.4.1/man/ja/man3/gfs_pio_eof.30000644000000000000000000000141111507222725015656 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_PIO_EOF" "3" "18 March 2003" "Gfarm" "" .SH NAME gfs_pio_eof \- ¥Õ¥¡¥¤¥ëËöÈøÈ½ÊÌ .SH SYNOPSIS .sp \fB#include .sp int gfs_pio_eof (GFS_File \fIgf\fB); \fR .SH "DESCRIPTION" .PP ¥Õ¥¡¥¤¥ë \fIgf\fR ¤ÎÆÉ¤ß¹þ¤ß½èÍý¤¬¡¢¥Õ¥¡¥¤¥ëËöÈø¤Ë㤷¤¿¤«Èݤ«¤ò¼¨¤·¤Þ¤¹¡£ .SH "RETURN VALUES" .TP \fB0\fR ¤Þ¤ÀËöÈø¤Ë㤷¤Æ¤¤¤Þ¤»¤ó¡£ .TP \fB¤½¤Î¾\fR ¥Õ¥¡¥¤¥ë¤ÎËöÈø¤Ë㤷¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ .SH "SEE ALSO" .PP \fBgfs_pio_create\fR(3), \fBgfs_pio_error\fR(3), \fBgfs_pio_open\fR(3) gfarm-2.4.1/man/ja/man3/gfarm.30000644000000000000000000001147611507222725014507 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFARM" "3" "26 June 2010" "Gfarm" "" .SH NAME gfarm \- Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à API ¥é¥¤¥Ö¥é¥ê .SH SYNOPSIS .nf #include .fi .SH "DESCRIPTION" .PP Gfarm ¥é¥¤¥Ö¥é¥ê¤Ï¡¤Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ä¡¤¥¹¥±¥¸¥å¡¼¥ê¥ó¥° µ¡Ç½¤ËÂФ¹¤ë¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤òÄ󶡤·¤Þ¤¹¡¥¤³¤Î¥Þ¥Ë¥å¥¢¥ë¤Ï¥é¥¤¥Ö¥é¥ê ¤Î³µÍפòµ­½Ò¤·¤Þ¤¹¡¥³Æ´Ø¿ô¤Î¾ÜºÙ¤Ï¡¤´Ø¿ôñ°Ì¤Î¥Þ¥Ë¥å¥¢¥ë¤ò»²¾È¤·¤Æ ¤¯¤À¤µ¤¤¡¥ .SS "½é´ü²½¡¿½ªÎ»½èÍý" .PP \fBgfarm_initialize\fR(3) ´Ø¿ô¤Ï Gfarm ¥é¥¤¥Ö¥é¥ê¤Î½é´ü²½¤Ë¡¤ \fBgfarm_terminate\fR(3) ´Ø¿ô¤Ï Gfarm ¥é¥¤¥Ö¥é¥ê¤Î½ªÎ»½èÍý¤ËÍѤ¤¤Þ¤¹¡¥ .SS "¥Õ¥¡¥¤¥ëÆþ½ÐÎϽèÍý" .PP ´û¸¤Î¥Õ¥¡¥¤¥ë¤ò¥¹¥È¥ê¡¼¥à¤È¤·¤Æ¥ª¡¼¥×¥ó¤¹¤ë¤Ë¤Ï \fBgfs_pio_open\fR(3) ´Ø¿ô¤ò¡¤ ¿·µ¬¥Õ¥¡¥¤¥ë¤òºîÀ®¤·¤Æ¥¹¥È¥ê¡¼¥à¤È¤·¤Æ¥ª¡¼¥×¥ó¤¹¤ë¤Ë¤Ï \fBgfs_pio_create\fR(3) ´Ø¿ô¤òÍѤ¤¤Þ¤¹¡¥ ¥Õ¥¡¥¤¥ë¤Î¥¯¥í¡¼¥º¤Ï \fBgfs_pio_close\fR(3) ´Ø¿ô¤ò»È¤¤¤Þ¤¹¡¥ .PP \fBgfs_pio_error\fR(3) ´Ø¿ô¤Ï¥ª¡¼¥×¥ó¤·¤Æ¤¤¤ë¥¹¥È¥ê¡¼¥à¤Ë´Ø¤·¤Æ¥¨¥é¡¼¤¬À¸¤¸¤Æ¤¤¤ë¤« ¤òȽÊ̤·¡¤ \fBgfs_pio_eof\fR(3) ´Ø¿ô¤ÏÆÉ¤ß¹þ¤ß¥ª¡¼¥×¥ó¤·¤Æ¤¤¤ë¥¹¥È¥ê¡¼¥à¤¬¥Õ¥¡¥¤¥ë ËöÈø¤Ë㤷¤Æ¤¤¤ë¤«¤òȽÊ̤·¤Þ¤¹¡¥ \fBgfs_pio_seek\fR(3) ´Ø¿ô¤Ï¡¤¥¹¥È¥ê¡¼¥àÃæ¤Î¸½ºß°ÌÃÖ¤òÊѹ¹¤·¤Þ¤¹¡¥ .PP \fBgfs_pio_getc\fR(3) ´Ø¿ô¤Ï¥¹¥È¥ê¡¼¥à¤«¤é°ìʸ»úÆÉ¤ß¹þ¤ß¡¤ \fBgfs_pio_ungetc\fR(3) ´Ø¿ô¤ÏµÕ¤ËÆÉ¤ß¹þ¤ó¤À°ìʸ»ú¤ò¥¹¥È¥ê¡¼¥à¤ËÌᤷ¤Þ¤¹¡¥ \fBgfs_pio_getline\fR(3) ´Ø¿ô¤ä \fBgfs_pio_gets\fR(3) ´Ø¿ô¡¤ \fBgfs_pio_readline\fR(3) ´Ø¿ô¤Ï¡¤¥¹¥È¥ê¡¼¥à¤«¤é°ì¹Ô¤òÆÉ¤ß¹þ¤ß¡¤ \fBgfs_pio_readdelim\fR(3) ´Ø¿ô¤Ï¡¤¥¹¥È¥ê¡¼¥à¤«¤é»ØÄꤷ¤¿¥Ç¥ê¥ß¥¿¤Þ¤Ç¤òÆÉ¤ß¹þ¤ß¤Þ¤¹¡¥ \fBgfs_pio_read\fR(3) ´Ø¿ô¤Ï¡¤¥¹¥È¥ê¡¼¥à¤«¤é»ØÄꤷ¤¿¥Ð¥¤¥È¿ô¤À¤±ÆÉ¤ß¹þ¤ß¤Þ¤¹¡¥ .PP \fBgfs_pio_putc\fR(3) ´Ø¿ô¤Ï¥¹¥È¥ê¡¼¥à¤Ø°ìʸ»ú½ñ¤­¤À¤·¡¤ \fBgfs_pio_putline\fR(3) ´Ø¿ô¤ä \fBgfs_pio_puts\fR(3) ´Ø¿ô¤Ï¥¹¥È¥ê¡¼¥à¤Ø°ì¹Ô½ñ¤­¤À¤·¤Þ¤¹¡¥ \fBgfs_pio_write\fR(3) ´Ø¿ô¤Ï¡¤¥¹¥È¥ê¡¼¥à¤Ø»ØÄꤷ¤¿¥Ð¥¤¥È¿ô¤À¤±½ñ¤­¹þ¤ß¤Þ¤¹¡¥ \fBgfs_pio_flush\fR(3) ´Ø¿ô¤ä¡¤ \fBgfs_pio_sync\fR(3) ´Ø¿ô¡¤ \fBgfs_pio_datasync\fR(3) ´Ø¿ô¤Ï¡¤¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¤·¤Æ¤¤¤ë¥Ç¡¼¥¿¤òµ­²±ÁõÃ֤˽ñ¤­½Ð¤·¤Þ¤¹¡¥ \fBgfs_pio_truncate\fR(3) ´Ø¿ô¤Ï¡¤¥Õ¥¡¥¤¥ë¤Î¥µ¥¤¥º¤òÊѹ¹¤·¤Þ¤¹¡¥ .SS "¥Ç¥£¥ì¥¯¥È¥ê¥¢¥¯¥»¥¹" .PP \fBgfs_opendir\fR(3) ´Ø¿ô¤Ç¥Ç¥£¥ì¥¯¥È¥ê¤ò¥ª¡¼¥×¥ó¤¹¤ë¤È¡¤ \fBgfs_readdir\fR(3) ´Ø¿ô¤Ç¡¤¤½¤Î¥Ç¥£¥ì¥¯¥È¥ê¤ò¹½À®¤¹¤ë¥¨¥ó¥È¥ê¤òÆÀ¤ë¤³¤È¤¬ ¤Ç¤­¤Þ¤¹¡¥¥ª¡¼¥×¥ó¤·¤¿¥Ç¥£¥ì¥¯¥È¥ê¤Ø¤Î¥¢¥¯¥»¥¹¤Ï¡¤ \fBgfs_closedir\fR(3) ´Ø¿ô¤Ç½ªÎ»¤·¤Þ¤¹¡¥ .PP \fBgfs_glob_init\fR(3) ´Ø¿ô¤Ç½é´ü²½¤·¤¿ gfs_glob_t ¤ò \fBgfs_glob\fR(3) ´Ø¿ô¤ËÅϤ¹¤³¤È¤Ç¡¤¥ï¥¤¥ë¥É¥«¡¼¥É¤ÎŸ³«¤ò¹Ô¤¦¤³¤È¤¬ ¤Ç¤­¤Þ¤¹¡¥ ÍøÍѤ¬½ª¤ï¤Ã¤¿¤é¡¤¤³¤ÎÎΰè¤Ï \fBgfs_glob_free\fR(3) ´Ø¿ô¤Ç³«Êü¤·¤Þ¤¹¡¥ \fBgfs_glob_add\fR(3) ´Ø¿ô¤Ï¡¤gfs_glob_t ¤Ë¥¨¥ó¥È¥ê¤òÄɲ乤ë¤Î¤ËÍѤ¤¤Þ¤¹¡¥ .SS "¥Õ¥¡¥¤¥ë¡¿¥Ç¥£¥ì¥¯¥È¥êÁàºî" .PP \fBgfs_chmod\fR(3) ´Ø¿ô¤Ç¥Õ¥¡¥¤¥ë¤Î¥â¡¼¥É¤òÊѹ¹¤·¡¤ \fBgfs_chown\fR(3) ´Ø¿ô¤Ç¥Õ¥¡¥¤¥ë¤Î½êÍ­¼Ô¤òÊѹ¹¤·¡¤ \fBgfs_utimes\fR(3) ´Ø¿ô¤Ç¥Õ¥¡¥¤¥ë¤Î¹¹¿·»þ¹ï¤È¥¢¥¯¥»¥¹»þ¹ï¤òÊѹ¹¤·¤Þ¤¹¡¥ .PP \fBgfs_mkdir\fR(3) ´Ø¿ô¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤òºîÀ®¤·¡¤ \fBgfs_rmdir\fR(3) ´Ø¿ô¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤òºï½ü¤·¤Þ¤¹¡¥ \fBgfs_unlink\fR(3) ´Ø¿ô¤Ï¥Õ¥¡¥¤¥ë¤òºï½ü¤·¡¤ \fBgfs_rename\fR(3) ´Ø¿ô¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤ä¥Õ¥¡¥¤¥ë¤ò²þ̾¤·¤Þ¤¹¡¥ .PP \fBgfs_stat\fR(3) ´Ø¿ô¤Ï»ØÄꤷ¤¿¥Õ¥¡¥¤¥ë¤¢¤ë¤¤¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤Î¥µ¥¤¥º¤ä ¹¹¿·»þ¹ï¤Ê¤É¤Î¾ðÊó¤òÊÖ¤·¤Þ¤¹¡¥ ¤³¤Î´Ø¿ô¤¬ÊÖ¤·¤¿ gfs_stat ¹½Â¤ÂÎ¤Ï \fBgfs_stat_free\fR(3) ´Ø¿ô¤òÍѤ¤¤Æ²òÊü¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡¥ .SS "¥¨¥é¡¼¥³¡¼¥É" .PP ¤Û¤È¤ó¤É¤Î Gfarm ¥é¥¤¥Ö¥é¥ê¤Î´Ø¿ô¤Ï gfarm_error_t ·¿¤Î Gfarm ¥¨¥é¡¼¥³¡¼ ¥É¤òÊÖ¤·¤Þ¤¹¡£ \fBgfarm_error_string\fR(3) ´Ø¿ô¤Ï Gfarm ¥¨¥é¡¼¥³¡¼¥É¤òɽ¤¹Ê¸»úÎó¤òÊÖ¤·¤Þ¤¹¡£ \fBgfarm_errno_to_error\fR(3) ´Ø¿ô¤Ï errno ¤ò Gfarm ¥¨¥é¡¼¥³¡¼¥É¤ËÊÑ´¹¤·¤Þ¤¹¡£ \fBgfarm_error_to_errno\fR(3) ´Ø¿ô¤Ï Gfarm ¥¨¥é¡¼¥³¡¼¥É¤ò errno ¤ËÊÑ´¹¤·¤Þ¤¹¡£ .SS "ʸ»úÎóÇÛÎóÁàºî¥æ¡¼¥Æ¥£¥ê¥Æ¥£" .PP ʸ»úÎóÇÛÎó¤òɽ¤¹ gfarm_stringlist ·¿¤ÎÊÑ¿ô¤Ï¡¤ \fBgfarm_stringlist_init\fR(3) ´Ø¿ô¤Ç½é´ü²½¤·¡¤ \fBgfarm_stringlist_add\fR(3) ´Ø¿ô¤Çʸ»úÎó¤ò°ì¤ÄÄɲä·¡¤ \fBgfarm_stringlist_cat\fR(3) ´Ø¿ô¤Çʸ»úÎó¤òÊ£¿ôÄɲä·¡¤ \fBgfarm_stringlist_free\fR(3) ´Ø¿ô¤Ç²òÊü¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡¥ ʸ»úÎóÇÛÎó¤Î³ÆÍ×ÁÇʸ»úÎó¤Ë¤Ï \fBgfarm_stringlist_elem\fR(3) ´Ø¿ô¤¢¤ë¤¤¤Ï GFARM_STRINGLIST_ELEM() ¥Þ¥¯¥í¤Ç¥¢¥¯¥»¥¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡¥ ¤Þ¤¿¡¤Ê¸»úÎóÇÛÎó¤ò¹½À®¤¹¤ëʸ»úÎó¤Î¿ô¤Ï \fBgfarm_stringlist_length\fR(3) ´Ø¿ô¤ÇÆÀ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡¥ .PP \fBgfarm_strings_free_deeply\fR(3) ´Ø¿ô¤Ï¡¤Ê¸»úÎóÇÛÎ󤪤è¤Ó¤½¤ì¤ò¹½À®¤¹¤ë³ÆÊ¸»úÎó¤ËÂФ·¤Æ ɸ½à¥é¥¤¥Ö¥é¥ê´Ø¿ô¤Î free() ¤ò¸Æ¤Ó½Ð¤·¤Æ²òÊü¤·¤Þ¤¹¡¥ .SS "ʸ»úÎóÇÛÎóÁàºî¥æ¡¼¥Æ¥£¥ê¥Æ¥£¥Þ¥¯¥í" .TP \fBGFARM_STRINGLIST_ELEM(list, i)\fR gfarm_stringlist ·¿¤Î \fIlist\fR °ú¿ô¤¬É½¤¹Ê¸»úÎóÇÛÎó¤Î \fIi\fR ÈÖÌܤÎÍ×ÁǤò ɽ¤¹¥Þ¥¯¥í¤Ç¤¹¡¥¤³¤Î¥Þ¥¯¥í¤Ïº¸ÊÕÃͤȤ·¤Æ»È¤¨¤Þ¤¹¡¥ ÃͤȤ·¤ÆÉ¾²Á¤·¤¿¾ì¹ç¤Ë¤Ï \fBgfarm_stringlist_elem\fR(3) ´Ø¿ô¤ÈƱ°ì¤Î·ë²Ì¤òÊÖ¤·¤Þ¤¹¡¥ .TP \fBGFARM_STRINGLIST_STRARRAY(list)\fR gfarm_stringlist ·¿¤Î \fIlist\fR °ú¿ô¤¬ ɽ¤¹Ê¸»úÎóÇÛÎó¤ÎÀèÆ¬Í×ÁǤؤΥݥ¤¥ó¥¿¤òÊÖ¤·¤Þ¤¹¡¥ ÊÖ¤êÃͤϡ¤Ê¸»ú¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ø¤Î¥Ý¥¤¥ó¥¿¤È¤Ê¤ê¤Þ¤¹¡¥ gfarm-2.4.1/man/ja/man3/gfarm_stringlist_cat.30000644000000000000000000000215011507222725017605 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFARM_STRINGLIST_CAT" "3" "18 March 2003" "Gfarm" "" .SH NAME gfarm_stringlist_cat \- stringlist ¤Ëʸ»úÎóÇÛÎó¤òÄɲ乤ë .SH SYNOPSIS .sp \fB#include .sp char *gfarm_stringlist_cat (gfarm_stringlist * \fIlistp\fB, char ** \fIv\fB); \fR .SH "DESCRIPTION" .PP \fIlistp\fR ¤Îɽ¤¹Ê¸»úÎóÇÛÎó¤ÎËöÈø¤Ë¡¢NULL ¤Ç½ªÎ»¤¹¤ëʸ»úÎóÇÛÎó \fIv\fR ¤òÄɲä·¤Þ¤¹¡£ .SH "RETURN VALUES" .TP \fBNULL\fR Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ .TP \fBGFARM_ERR_NO_MEMORY\fR ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ .TP \fB¤½¤Î¾\fR ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ .SH "SEE ALSO" .PP \fBGFARM_STRINGLIST_ELEM\fR(3), \fBGFARM_STRINGLIST_STRARRAY\fR(3), \fBgfarm_stringlist_add\fR(3), \fBgfarm_stringlist_elem\fR(3), \fBgfarm_stringlist_free\fR(3), \fBgfarm_stringlist_free_deeply\fR(3), \fBgfarm_stringlist_init\fR(3), \fBgfarm_stringlist_length\fR(3) gfarm-2.4.1/man/ja/man3/gfs_pio_flush.30000644000000000000000000000161111507222725016230 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_PIO_FLUSH" "3" "18 March 2003" "Gfarm" "" .SH NAME gfs_pio_flush \- ½ñ¤­¹þ¤ß¤ò¥Õ¥é¥Ã¥·¥å¤¹¤ë¡£ .SH SYNOPSIS .sp \fB#include .sp char *gfs_pio_flush (GFS_File \fIgf\fB); \fR .SH "DESCRIPTION" .PP ½ñ¤­¹þ¤ßÍѤ˥ª¡¼¥×¥ó¤·¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë \fIgf\fR ¤Î¡¢½ñ¤­¹þ¤ß¥Ð¥Ã¥Õ¥¡¤Ëί¤Þ¤Ã¤Æ¤¤¤ë¥Ç¡¼¥¿¤ò¼ÂºÝ¤Ë¥Ç¥£¥¹¥¯¤Ë½ñ¤­¹þ¤ß¤Þ¤¹¡£ .SH "RETURN VALUES" .TP \fBNULL\fR Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ .TP \fBGFARM_ERR_NO_MEMORY\fR ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ .TP \fB¤½¤Î¾\fR ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ .SH "SEE ALSO" .PP \fBgfs_pio_create\fR(3), \fBgfs_pio_open\fR(3), \fBgfs_pio_write\fR(3) gfarm-2.4.1/man/ja/man3/gfs_pio_seek.30000644000000000000000000000221411507222725016036 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_PIO_SEEK" "3" "18 March 2003" "Gfarm" "" .SH NAME gfs_pio_seek \- »ØÄꤷ¤¿°ÌÃ֤˥·¡¼¥¯¤¹¤ë .SH SYNOPSIS .sp \fB#include .sp char * gfs_pio_seek (GFS_File \fIgf\fB, file_offset_t \fIoffset\fB, int \fIwhence\fB, file_offset_t * \fIresult\fB); \fR .SH "DESCRIPTION" .PP ¥Õ¥¡¥¤¥ë \fIgf\fR ¤ò¡¢ \fIwhence\fR ¤È \fIoffset\fR ¤Ç»ØÄꤷ¤¿°ÌÃ֤˥·¡¼¥¯¤·¤Þ¤¹¡£ °ú¿ô \fIoffset\fR ¤Ï¡¢ \fIwhence\fR ¤¬ 0 ¤Î¾ì¹ç¤Ë¤Ï¥Õ¥¡¥¤¥ëÀèÆ¬¤«¤é¡¢ 1 ¤Î¾ì¹ç¤Ë¤Ï¸½ºß¤Î¥·¡¼¥¯°ÌÃÖ¤«¤é¡¢ 2 ¤Î¾ì¹ç¤Ë¤Ï¥Õ¥¡¥¤¥ëËöÈø¤«¤é¤Î¥ª¥Õ¥»¥Ã¥È¤Ç¤¹¡£ .PP °ú¿ô \fIresult\fR ¤¬ NULL ¤Ç¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢°Üư¸å¤Î°ÌÃÖ¤ò \fIresult\fR ¤Î»Ø¤¹Àè¤ËÊÖ¤·¤Þ¤¹¡£ .SH "RETURN VALUES" .TP \fBNULL\fR Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ .TP \fBGFARM_ERR_NO_MEMORY\fR ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ .TP \fB¤½¤Î¾\fR ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ .SH "SEE ALSO" .PP \fBgfs_pio_create\fR(3), \fBgfs_pio_open\fR(3) gfarm-2.4.1/man/ja/man3/gfs_pio_ungetc.30000644000000000000000000000165711507222725016406 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_PIO_UNGETC" "3" "18 March 2003" "Gfarm" "" .SH NAME gfs_pio_ungetc \- ÆÉ¤ß¹þ¤ó¤Àʸ»ú¤òÌ᤹ .SH SYNOPSIS .sp \fB#include .sp int gfs_pio_ungetc (GFS_File \fIgf\fB, int \fIc\fB); \fR .SH "DESCRIPTION" .PP ¥Õ¥¡¥¤¥ë \fIgf\fR ¤«¤éÆÉ¤ß¹þ¤ó¤Àʸ»ú \fIc\fR ¤ò¡¢ÆÉ¤ß¹þ¤Þ¤Ê¤«¤Ã¤¿¤³¤È¤Ë¤·¤Þ¤¹¡£ .SH "RETURN VALUES" .TP \fBEOF\fR gfs_pio_ungetc() ¤Ï¡¢´Ø¿ô gfs_pio_getc(3) ¤Î¸Æ¤Ó¤À¤·¤Îľ¸å¤Ë¤·¤« ¸Æ¤Ö¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£¤³¤ÎÀ©Ìó¤ËÈ¿¤·¤¿¾ì¹ç¡¢ EOF ¤ò¥¨¥é¡¼¤È¤·¤ÆÊÖ¤·¤Þ¤¹¡£ .TP \fB¤½¤Î¾\fR Àµ¾ï¤Ë½èÍý¤¬´°Î»¤·¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ .SH "SEE ALSO" .PP \fBgfs_pio_create\fR(3), \fBgfs_pio_error\fR(3), \fBgfs_pio_getc\fR(3), \fBgfs_pio_open\fR(3) gfarm-2.4.1/man/ja/man3/gfs_mkdir.30000644000000000000000000000210311507222725015343 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_MKDIR" "3" "17 April 2004" "Gfarm" "" .SH NAME gfs_mkdir \- ¥Ç¥£¥ì¥¯¥È¥êºîÀ® .SH SYNOPSIS .sp \fB#include .sp char *gfs_mkdir (char * \fIgfarm_url\fB, gfarm_mode_t \fImode\fB); \fR .SH "DESCRIPTION" .PP °ú¿ô \fIgfarm_url\fR ¤Ë»ØÄꤷ¤¿Ì¾Á°¤Î¥Ç¥£¥ì¥¯¥È¥ê¤ò¡¢¥â¡¼¥É \fImode\fR ¤ÇºîÀ®¤·¤Þ¤¹¡£ .SH "RETURN VALUES" .TP \fBNULL\fR Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ .TP \fBGFARM_ERR_NO_MEMORY\fR ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ .TP \fBGFARM_ERR_ALREADY_EXISTS\fR »ØÄꤷ¤¿¥Ç¥£¥ì¥¯¥È¥ê¤¬´û¤Ë¸ºß¤·¤Þ¤¹¡£ .TP \fBGFARM_ERR_NO_SUCH_OBJECT\fR »ØÄꤷ¤¿¥Ñ¥¹Ì¾¤Î¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤¬¡¢¼ÂºÝ¤Ë¤Ï¸ºß¤·¤Ê¤«¤Ã¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ .TP \fBGFARM_ERR_NOT_A_DIRECTORY\fR »ØÄꤷ¤¿¥Ñ¥¹Ì¾¤Î¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤¬¡¢¼ÂºÝ¤Ë¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤«¤Ã¤¿¤³¤È¤ò ¼¨¤·¤Þ¤¹¡£ .TP \fB¤½¤Î¾\fR ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ gfarm-2.4.1/man/ja/man3/gfs_glob_free.30000644000000000000000000000125311507222725016166 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_GLOB_FREE" "3" "02 September 2003" "Gfarm" "" .SH NAME gfs_glob_free \- ¥Ñ¥¹¤Î¥¿¥¤¥×¤ò³ÊǼ¤·¤Æ¤¤¤ëÎΰè¤ò²òÊü¤¹¤ë .SH SYNOPSIS .sp \fB#include .sp char *gfs_glob_free (gfs_glob_t * \fIlistp\fB); \fR .SH "DESCRIPTION" .PP ¥Ñ¥¹¤Î¥¿¥¤¥×¤ò³ÊǼ¤¹¤ë¤¿¤á¤ËưŪ¤Ë³ÎÊݤ·¤¿Îΰè¤ò²òÊü¤·¤Þ¤¹¡£ .SH "SEE ALSO" .PP \fBgfs_glob_init\fR(3) \fBgfs_glob\fR(3) \fBgfs_glob_add\fR(3) gfarm-2.4.1/man/ja/man3/gfs_pio_write.30000644000000000000000000000267211507222725016251 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_PIO_WRITE" "3" "27 June 2010" "Gfarm" "" .SH NAME gfs_pio_write \- ¥Õ¥¡¥¤¥ë¤Î½ñ¤­¹þ¤ß .SH SYNOPSIS .sp \fB#include .sp gfarm_error_t gfs_pio_write (GFS_File \fIgf\fB, const void * \fIbuffer\fB, int \fIsize\fB, int * \fInp\fB); \fR .SH "DESCRIPTION" .PP \fIbuffer\fR¤«¤é \fIsize\fR ¥Ð¥¤¥È¤À¤±¡¢¥Õ¥¡¥¤¥ë \fIgf\fR ¤Ø½ñ¤­¹þ¤ß¤Þ¤¹¡£ ¼ÂºÝ¤Ë½ñ¤­¹þ¤Þ¤ì¤¿¥Ð¥¤¥È¿ô¤Ï \fInp\fR ¤Î»Ø¤¹Àè¤ËÊÖ¤·¤Þ¤¹¡£ .SH "RETURN VALUES" .TP \fBGFARM_ERR_NO_ERROR\fR Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ .TP \fBGFARM_ERR_OPERATION_NOT_PERMITTED\fR \fIgf\fR ¤Ç»ØÄꤵ¤ì¤ë¥Õ¥¡¥¤¥ë¤¬¥ì¥®¥å¥é¡¼¥Õ¥¡¥¤¥ë¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£ .TP \fBGFARM_ERR_BAD_FILE_DESCRIPTOR\fR \fIgf\fR ¤Ç»ØÄꤵ¤ì¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬ÉÔÀµ¡¢ ¤¢¤ë¤¤¤Ï½ñ¹þ²Äǽ¤Ç¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£ .TP \fBGFARM_ERR_NO_SPACE\fR ½ñ¤­¹þ¤ß¥¹¥Ú¡¼¥¹¤¬¤¢¤ê¤Þ¤»¤ó¡£ .TP \fBGFARM_ERR_NO_FILE_SYSTEM_NODE\fR ÍøÍѲÄǽ¤Ê¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤¬¤¢¤ê¤Þ¤»¤ó¡£ .TP \fBGFARM_ERR_NO_MEMORY\fR ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ .TP \fB¤½¤Î¾\fR ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ \fBgfarm_error_string\fR(3) ¤Ë¤è¤ê¥¨¥é¡¼¤Î¸¶°ø¤òʸ»úÎó¤ËÊÑ´¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ .SH "SEE ALSO" .PP \fBgfs_pio_create\fR(3), \fBgfs_pio_flush\fR(3), \fBgfs_pio_open\fR(3) gfarm-2.4.1/man/ja/man3/gfs_realpath.30000644000000000000000000000257711507222725016054 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_REALPATH" "3" "04 December 2003" "Gfarm" "" .SH NAME gfs_realpath \- Àµµ¬²½¤µ¤ì¤¿ÀäÂХѥ¹Ì¾¤òÊÖ¤¹ .SH SYNOPSIS .sp \fB#include .sp char *gfs_realpath (const char * \fIgfarm_url\fB, char ** \fIresolved_pathp\fB); \fR .SH "DESCRIPTION" .PP \fBgfs_realpath\fR ¤Ï¡¤ \fIgfarm_url\fR ¤ÇÍ¿¤¨¤é¤ì¤¿¥Ñ¥¹Ì¾¤Î¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê¤òŸ³«¤·¡¤ \&'.'¡¤'..' ¤ä;ʬ¤Ê '/' ¤ò²ò·è¤·¤Æ¡¤ Àµµ¬²½¤µ¤ì¤¿ÀäÂХѥ¹Ì¾¤òưŪ¤Ë³ÎÊݤµ¤ì¤ë¥á¥â¥ê¤Ë³ÊǼ¤·¤Þ¤¹¡¥ ưŪ¤Ë³ÎÊݤµ¤ì¤¿¥á¥â¥ê¤Î¥Ý¥¤¥ó¥¿¤Ï \fIresolved_pathp\fR ¤ËÊÖ¤µ¤ì¤Þ¤¹¡¥ ¤³¤Î¥á¥â¥êÎΰè¤Ï¤³¤Î¸å free(3) ¤Ë¤è¤ê³«Êü¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡¥ .SH "RETURN VALUES" .TP \fBNULL\fR Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡¥ .TP \fBGFARM_ERR_NO_MEMORY\fR ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡¥ .TP \fBGFARM_ERR_NOT_A_DIRECTORY\fR »ØÄꤷ¤¿¥Ñ¥¹Ì¾¤Î¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤¬¡¢¼ÂºÝ¤Ë¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤«¤Ã¤¿ ¤³¤È¤ò¼¨¤·¤Þ¤¹¡¥ .TP \fBGFARM_ERR_INVALID_ARGUMENT\fR \fIgfarm_url\fR ¤¬ NULL ¥Ý¥¤¥ó¥¿¤Ç¤¹¡¥ .TP \fBGFARM_ERR_PERMISSION_DENIED\fR »ØÄꤵ¤ì¤¿¥Ñ¥¹¤Ø¥¢¥¯¥»¥¹¤¹¤ë¸¢¸Â¤¬¤¢¤ê¤Þ¤»¤ó¡¥ .TP \fBGFARM_ERR_NO_SUCH_OBJECT\fR »ØÄꤵ¤ì¤¿¥Ñ¥¹Ì¾¤¬Â¸ºß¤·¤Þ¤»¤ó¡¥ .TP \fB¤½¤Î¾\fR ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡¥ gfarm-2.4.1/man/ja/man3/gfs_pio_read.30000644000000000000000000000260611507222725016027 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_PIO_READ" "3" "27 June 2010" "Gfarm" "" .SH NAME gfs_pio_read \- ¥Õ¥¡¥¤¥ë¤ÎÆÉ¤ß¹þ¤ß .SH SYNOPSIS .sp \fB#include .sp gfarm_error_t gfs_pio_read (GFS_File \fIgf\fB, void * \fIbuffer\fB, int \fIsize\fB, int * \fInp\fB); \fR .SH "DESCRIPTION" .PP \fIbuffer\fR¤«¤é \fIsize\fR ¥Ð¥¤¥È¤À¤±¡¢¥Õ¥¡¥¤¥ë \fIgf\fR ¤ÎÆâÍÆ¤òÆÉ¤ß¹þ¤ß¤Þ¤¹¡£ ÆÉ¤ß¹þ¤Þ¤ì¤¿¥Ð¥¤¥È¿ô¤Ï \fInp\fR ¤Î»Ø¤¹Àè¤ËÊÖ¤·¤Þ¤¹¡£¤³¤ÎÃͤ¬ 0 ¤Î¾ì¹ç¤Ë¤Ï EOF ¤ò°ÕÌ£¤·¤Þ¤¹¡£ .SH "RETURN VALUES" .TP \fBGFARM_ERR_NO_ERROR\fR Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ .TP \fBGFARM_ERR_OPERATION_NOT_PERMITTED\fR \fIgf\fR ¤Ç»ØÄꤵ¤ì¤ë¥Õ¥¡¥¤¥ë¤¬¥ì¥®¥å¥é¡¼¥Õ¥¡¥¤¥ë¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£ .TP \fBGFARM_ERR_BAD_FILE_DESCRIPTOR\fR \fIgf\fR ¤Ç»ØÄꤵ¤ì¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬ÉÔÀµ¡¢ ¤¢¤ë¤¤¤ÏÆÉ¹þ²Äǽ¤Ç¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£ .TP \fBGFARM_ERR_NO_FILE_SYSTEM_NODE\fR ÍøÍѲÄǽ¤Ê¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤¬¤¢¤ê¤Þ¤»¤ó¡£ .TP \fBGFARM_ERR_NO_MEMORY\fR ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ .TP \fB¤½¤Î¾\fR ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ \fBgfarm_error_string\fR(3) ¤Ë¤è¤ê¥¨¥é¡¼¤Î¸¶°ø¤òʸ»úÎó¤ËÊÑ´¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ .SH "SEE ALSO" .PP \fBgfs_pio_create\fR(3), \fBgfs_pio_open\fR(3) gfarm-2.4.1/man/ja/man3/gfs_pio_set_view_index.30000644000000000000000000000510511507222725020125 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFS_PIO_SET_VIEW_INDEX" "3" "25 April 2003" "Gfarm" "" .SH NAME gfs_pio_set_view_index \- fragment ñ°Ì¤Î¥¢¥¯¥»¥¹¤ò»ØÄꤹ¤ë .SH SYNOPSIS .sp \fB#include .sp char *gfs_pio_set_view_index (GFS_File \fIgf\fB, int \fIfragment_number\fB, int \fIfragment_index\fB, char *\fIhost\fB, int \fIflags\fB); \fR .SH "DESCRIPTION" .PP ¥Õ¥¡¥¤¥ë¤ò¥Õ¥é¥°¥á¥ó¥Èñ°Ì¤Ç¥¢¥¯¥»¥¹¤¹¤ë¤³¤È¤ò»ØÄꤷ¤Þ¤¹¡£ .PP ¿·µ¬ºîÀ®¤·¤¿¥Õ¥¡¥¤¥ë¤Î¾ì¹ç¡¢É¬¤º°ú¿ô \fIfragment_number\fR ¤Ë¥Õ¥é¥°¥á¥ó¥È ¤ÎÁí¿ô¤ò»ØÄꤹ¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£¤³¤ÎÃͤϡ¢¤³¤ÎÊÂÎó¥Õ¥¡¥¤¥ë¤ò³«¤¯Á´¤Æ ¤Î¥Î¡¼¥É¤Ç¡¢Æ±¤¸ÃͤǤʤ¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡£´û¸¤Î¥Õ¥¡¥¤¥ë¤Î¾ì¹ç¤Ë¤Ï¡¢ ¤³¤³¤Ë GFARM_FILE_DONTCARE ¤È½ñ¤±¤Ð¡¢»ØÄê¤ò¾Êά¤Ç¤­¤Þ¤¹¡£¤â¤· ¤â¤·¼ÂºÝ¤È°Û¤Ê¤ë¿ô¤ò»ØÄꤷ¤¿¾ì¹ç¤Ë¤Ï¡¢¤³¤Î´Ø¿ô¤Ï¥¨¥é¡¼¤Ç¼ºÇÔ¤·¤Þ¤¹¡£ .PP °ú¿ô \fIfragment_index\fR ¤Ë¤Ï¡¢ ¥¢¥¯¥»¥¹¤¹¤ë¥Õ¥é¥°¥á¥ó¥È¤ÎÈÖ¹æ¤ò»ØÄꤷ¤Þ¤¹¡£ .PP °ú¿ô \fIhost\fR ¤Ï¡¢¥¢¥¯¥»¥¹¤·¤¿¤¤¥Û¥¹¥È¤òÌÀ¼¨Åª¤Ë»ØÄꤷ¤¿¤¤»þ¤ËÍøÍѤ·¤Þ¤¹¡£ »ØÄ꤬ÉÔÍפʤé NULL ¤òÅϤ»¤Ð¾Êά¤Ç¤­¤Þ¤¹¡£ .PP °ú¿ô \fIflag\fR ¤Ë¤Ï¡¢ GFARM_FILE_SEQUENTIAL ¡¢ GFARM_FILE_REPLICATE ¡¢ GFARM_FILE_NOT_REPLICATE ¤ÎÏÀÍýϤ¬»ØÄê¤Ç¤­¤Þ¤¹¡£ ¤³¤ì¤é¤Ï¡¢²¼µ­¤ò°ÕÌ£¤·¤Þ¤¹¡£ .TP \fBGFARM_FILE_SEQUENTIAL\fR ¤³¤Î¥Õ¥é¥°¥á¥ó¥È¤Ë´Ø¤·¤Æ¤Ï¥·¡¼¥±¥ó¥·¥ã¥ë¡¦¥¢¥¯¥»¥¹¤Î¤ß¤ò¹Ô¤Ê¤¦¤³¤È ¤ò¼¨¤·¤Þ¤¹¡£ .TP \fBGFARM_FILE_REPLICATE\fR ¤¢¤é¤«¤¸¤á¡¢¥í¡¼¥«¥ë¡¦¥Î¡¼¥É¤Ë¥ì¥×¥ê¥«¤òÍѰդ·¤Æ¤«¤é¥¢¥¯¥»¥¹¤¹¤ë¤³¤È¤ò »ØÄꤷ¤Þ¤¹¡£GFARM_FILE_NOT_REPLICATE ¤È¤ÏÇÓ¾Ū¤Ê¥ª¥×¥·¥ç¥ó¤Ç¤¹¡£ .TP \fBGFARM_FILE_NOT_REPLICATE\fR ´û¤Ë¥ì¥×¥ê¥«¤¬¤¢¤ë¾ì¹ç¤ò½ü¤­¡¢¤³¤Î¥Î¡¼¥É¤Ë¥ì¥×¥ê¥«¤òÍѰդ·¤Ê¤¤¤³¤È ¤ò»ØÄꤷ¤Þ¤¹¡£GFARM_FILE_REPLICATE ¤È¤ÏÇÓ¾Ū¤Ê¥ª¥×¥·¥ç¥ó¤Ç¤¹¡£ .PP ¤³¤Î´Ø¿ô¤ò¸Æ¤Ð¤Ê¤¤¾õÂ֤Ǥϡ¢Gfarm ¥Õ¥¡¥¤¥ë¤Ï global view ¾õÂ֤ȤʤäƤª¤ê¡¢Á´¤Æ¤Î¥Õ¥é¥°¥á¥ó¥È¤¬·ë¹ç¤µ¤ì¤¿Ã±°ì¥Õ¥¡¥¤¥ë¤Ë¸«¤¨¤Þ¤¹¡£ .SH "RETURN VALUES" .TP \fBNULL\fR Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ .TP \fBGFARM_ERR_NO_MEMORY\fR ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ .TP \fBGFARM_ERR_OPERATION_NOT_PERMITTED\fR »ØÄꤷ¤¿¥Ñ¥¹Ì¾¤¬¡¢¥Õ¥é¥°¥á¥ó¥È²½¥Õ¥¡¥¤¥ë¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£ .TP \fBGFARM_ERR_FRAGMENT_NUMBER_DOES_NOT_MATCH\fR »ØÄꤷ¤¿¥Õ¥é¥°¥á¥ó¥ÈÁí¿ô¤¬¡¢ÉÔŬÀڤǤ¹¡£ .TP \fBGFARM_ERR_INVALID_ARGUMENT\fR ´Ø¿ô°ú¿ô¤¬ÉÔŬÀڤǤ¹¡£¤¿¤È¤¨¤Ð¡¢¥Õ¥¡¥¤¥ë¤Î¿·µ¬ºîÀ®»þ¤Ë¡¢ ¥Õ¥é¥°¥á¥ó¥ÈÁí¿ô¤È¤·¤Æ GFARM_FILE_DONTCARE ¤ò»ØÄꤹ¤ë¤È¡¢¤³¤Î¥¨¥é¡¼¤¬À¸¤¸¤Þ¤¹¡£ .TP \fB¤½¤Î¾\fR ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ .SH "SEE ALSO" .PP \fBgfs_pio_create\fR(3), \fBgfs_pio_open\fR(3), \fBgfs_pio_set_view_local\fR(3) gfarm-2.4.1/man/ja/man3/gfarm_url_hosts_schedule.30000644000000000000000000000223711507222725020460 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFARM_URL_HOSTS_SCHEDULE" "3" "18 March 2003" "Gfarm" "" .SH NAME gfarm_url_hosts_schedule \- gfarm ¥¿¥¹¥¯¤ò¥¹¥±¥¸¥å¡¼¥ë¤¹¤ë .SH SYNOPSIS .sp \fB#include .sp char *gfarm_url_hosts_schedule (char * \fIgfarm_url\fB, char * \fIoption\fB, int * \fInhostsp\fB, char *** \fIhostsp\fB); \fR .SH "DESCRIPTION" .PP »ØÄꤷ¤¿ Gfarm URL ¤ò¥¢¥¯¥»¥¹¤¹¤ë¥¿¥¹¥¯¤ò¼Â¹Ô¤¹¤ë¤Î¤ËŬ¤·¤¿ ¥Û¥¹¥È¤ÎÇÛÎó¤ò \fIhostsp\fR ¤Î»Ø¤¹Àè¤ËÊÖ¤·¤Þ¤¹¡£¥Û¥¹¥È¿ô¤Ï \fInhostsp\fR ¤Î»Ø¤¹Àè¤ËÊÖ¤ê¤Þ¤¹¡£ ¤³¤³¤ÇÆÀ¤¿¥Û¥¹¥È¤ÎÇÛÎó¤Ï gfarm_strings_free_deeply() ¤òÍѤ¤¤Æ²òÊü ¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£ .SH "RETURN VALUES" .TP \fBNULL\fR Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ .TP \fBGFARM_ERR_NO_MEMORY\fR ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ .TP \fB¤½¤Î¾\fR ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ .SH "NOTES" .PP °ú¿ô \fIoption\fR ¤Ë¤Ï¡¢¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¤Ë´Ø¤¹¤ë¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Þ¤¹¤¬¡¢ ¸½ºß¤Î¼ÂÁõ¤Ç¤Ï¡¢¤³¤Î°ú¿ô¤ÏÍøÍѤµ¤ì¤Æ¤¤¤Þ¤»¤ó¡£ gfarm-2.4.1/man/ja/Makefile0000644000000000000000000000024711507222725014123 0ustar rootroottop_builddir = ../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk SUBDIRS = man1 man3 man5 man8 include $(top_srcdir)/makes/subdir.mk gfarm-2.4.1/man/ja/man8/0000755000000000000000000000000011507222730013317 5ustar rootrootgfarm-2.4.1/man/ja/man8/gfmd.80000644000000000000000000000376711507222725014346 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFMD" "8" "20 December 2010" "Gfarm" "" .SH NAME gfmd(8) \- Gfarm¥á¥¿DB¡¦¥Ç¡¼¥â¥ó .SH SYNOPSIS \fBgfmd\fR [ \fB\fI¥ª¥×¥·¥ç¥ó\fB\fR ] .SH "DESCRIPTION" .PP gfmd¤Ï¡¢Gfarm¥é¥¤¥Ö¥é¥ê¤È¶¨Ä´¤·¤ÆÆ°ºî¤·¡¢Gfarm¥Õ¥¡¥¤¥ë¥·¥¹¥Æ ¥à¤Î¥á¥¿¥Ç¡¼¥¿¤Ø¤Î¥¢¥¯¥»¥¹¤òÄ󶡤¹¤ë¥Ç¡¼¥â¥ó¥×¥í¥°¥é¥à¤Ç¤¹¡£ gfmd¤ÏGfarm¤Î¥á¥¿DB¥µ¡¼¥Ð¡¼¡¦¥Û¥¹¥È¾å¤Ç¡¢ ¤¢¤é¤«¤¸¤áΩ¤Á¾å¤²¤Æ¤ª¤¯É¬Íפ¬¤¢¤ê¤Þ¤¹¡£ .PP gfmd¤Ï¥æ¡¼¥¶¸¢¸Â¤Çưºî¤µ¤»¤ë¤³¤È¤â²Äǽ¤Ç¤¹¤¬¡¢¤³¤Î¾ì¹ç¾¤Î¥æ¡¼¥¶¤Ï¤³ ¤Îgfmd¤òÍøÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£ ¾ÜºÙ¤ÏSETUP.private.ja¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£ .PP gfmd¤òÍøÍѤ¹¤ë¤¿¤á¤Ë¤Ï¡¤ ¥¯¥é¥¤¥¢¥ó¥È¥Î¡¼¥É¤Î~/.gfarm2rc¤¢¤ë¤¤¤Ï%%SYSCONFDIR%%/gfarm2.conf¤Î metadb_server_host¤ÇÍøÍѤ·¤¿¤¤gfmd¤Î¥Û¥¹¥È̾¡¤ metadb_server_port¤Ç¥Ý¡¼¥ÈÈÖ¹æ¤ò»ØÄꤹ¤ëɬÍפ¬¤¢¤ê¤Þ ¤¹¡¥ .SH "OPTIONS" .TP \fB-L \fI¥í¥°¥ì¥Ù¥ë\fB\fR ¤³¤Î¥ª¥×¥·¥ç¥ó¤Ç»ØÄꤷ¤¿¥ì¥Ù¥ë°Ê¾å¤ÎÍ¥ÀèÅÙ¤Î¥í¥°¤ò½ÐÎϤ·¤Þ¤¹¡£ »ØÄê¤Ç¤­¤ëÃͤÏgfarm2.conf(5)¤Îlog_level¤Î¹à¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£ .TP \fB-P \fIPID¥Õ¥¡¥¤¥ë\fB\fR gfmd¤Îprocess ID¤ò¡¢»ØÄꤷ¤¿¥Õ¥¡¥¤¥ë¤Ëµ­Ï¿¤·¤Þ¤¹¡£ .TP \fB-d\fR ¥Ç¥Ð¥Ã¥°¥ª¥×¥·¥ç¥ó¤Ç¤¹¡£¥Ç¡¼¥â¥ó¤È¤·¤Æ¤Ç¤Ï¤Ê¤¯¡¢¥Õ¥©¥¢¥°¥é¥¦¥ó¥É¡¦ ¥×¥í¥»¥¹¤È¤·¤ÆÎ©¤Á¾å¤¬¤ê¤Þ¤¹¡£ ¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¡¢¤«¤Ä\fB-L\fR¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Ê¤«¤Ã¤¿ ¾ì¹ç¡¢¥í¥°¥ì¥Ù¥ë¤Ïdebug¤È¤Ê¤ê¤Þ¤¹¡£ .TP \fB-f \fIÀßÄê¥Õ¥¡¥¤¥ë\fB\fR µ¯Æ°»þ¤ËÆÉ¤ß¹þ¤àÀßÄê¥Õ¥¡¥¤¥ë¤ò»ØÄꤷ¤Þ¤¹¡¥ .TP \fB-p \fI¥Ý¡¼¥ÈÈÖ¹æ\fB\fR gfmd¤¬ÍøÍѤ¹¤ëTCP¤Î¥Ý¡¼¥ÈÈÖ¹æ¤ò»ØÄꤷ¤Þ¤¹¡£ .TP \fB-s \fIsyslog¥Õ¥¡¥·¥ê¥Æ¥£\fB\fR gfmd¤¬¥¨¥é¡¼Êó¹ð¤ËÍѤ¤¤ësyslog¤Î¥Õ¥¡¥·¥ê¥Æ¥£¤ò»ØÄꤷ¤Þ¤¹¡£¾Êά ¤·¤¿¾ì¹ç¤Ë¤Ï¡¢local0¤ò»ÈÍѤ·¤Þ¤¹¡£ .TP \fB-v\fR ǧ¾Ú½èÍý¤Ë´Ø¤¹¤ë¥í¥°¤ò¾Ü¤·¤¯½ÐÎϤ·¤Þ¤¹¡£ GSIǧ¾Ú¤ÎÌäÂê¤ò²ò·è¤¹¤ë¾ì¹ç¤ËÍ­ÍѤʥª¥×¥·¥ç¥ó¤Ç¤¹¡£ .TP \fB-?\fR °ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡£ .SH "FILES" .TP \fB\fI%%SYSCONFDIR%%/gfmd.conf\fB\fR gfmd¤¬»²¾È¤¹¤ëÀßÄê¥Õ¥¡¥¤¥ë¤Ç¤¹¡£ .SH "SEE ALSO" .PP \fBgfarm2.conf\fR(5) gfarm-2.4.1/man/ja/man8/gfsd.80000644000000000000000000000513011507222725014336 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFSD" "8" "20 December 2010" "Gfarm" "" .SH NAME gfsd(8) \- Gfarm¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¡¦¥Ç¡¼¥â¥ó .SH SYNOPSIS \fBgfsd\fR [ \fB\fI¥ª¥×¥·¥ç¥ó\fB\fR ] .SH "DESCRIPTION" .PP gfsd¤Ï¡¢Gfarm¥é¥¤¥Ö¥é¥ê¤È¶¨Ä´¤·¤ÆÆ°ºî¤·¡¢Gfarm¥Õ¥¡¥¤¥ë¥·¥¹¥Æ ¥à¤ò¼Â¸½¤¹¤ë¥Ç¡¼¥â¥ó¥×¥í¥°¥é¥à¤Ç¤¹¡£ gfsd¤Ï¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤ÎÁ´¥Û¥¹¥È¾å¤Ç¡¢ root¸¢¸Â¤Ç¤¢¤é¤«¤¸¤áΩ¤Á¾å¤²¤Æ¤ª¤¯É¬Íפ¬¤¢¤ê¤Þ¤¹¡£ .PP gfsd¤¬Ä󶡤¹¤ë¤Î¤Ï¡¢¥Õ¥¡¥¤¥ë¤Î¼ÂÂΤؤΥ¢¥¯¥»¥¹¤Ç¤¹¡£ gfsd ¤¬ÍøÍѤ¹¤ë¥Ý¡¼¥ÈÈÖ¹æ¤Ï¡¢gfmd ¤¬´ÉÍý¤¹¤ë¥á¥¿¥Ç¡¼¥¿¤«¤é¼èÆÀ¤·¤Þ¤¹¡£ .PP gfsd¤Ï¥æ¡¼¥¶¸¢¸Â¤Çưºî¤µ¤»¤ë¤³¤È¤â²Äǽ¤Ç¤¹¤¬¡¤¤³¤Î¾ì¹ç¾¤Î¥æ¡¼¥¶¤Ï¤³ ¤Îgfsd¤òÍøÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£ ¾ÜºÙ¤ÏSETUP.private.ja¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£ .SH "OPTIONS" .TP \fB-L \fI¥í¥°¥ì¥Ù¥ë\fB\fR ¤³¤Î¥ª¥×¥·¥ç¥ó¤Ç»ØÄꤷ¤¿¥ì¥Ù¥ë°Ê¾å¤ÎÍ¥ÀèÅÙ¤Î¥í¥°¤ò½ÐÎϤ·¤Þ¤¹¡£ »ØÄê¤Ç¤­¤ëÃͤÏgfarm2.conf(5)¤Îlog_level¤Î¹à¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£ .TP \fB-P \fIPID¥Õ¥¡¥¤¥ë\fB\fR gfsd¤Îprocess ID¤ò¡¢»ØÄꤷ¤¿¥Õ¥¡¥¤¥ë¤Ëµ­Ï¿¤·¤Þ¤¹¡£ .TP \fB-c\fR µ¯Æ°»þ¤Ë¡¢¥¹¥×¡¼¥ë¥Ç¥£¥ì¥¯¥È¥ê¤Î¸¡ºº¤ò¹Ô¤¤¤Þ¤¹¡£ ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Î¥Û¥¹¥È̾¤¬ÊѤï¤Ã¤¿¤È¤­¤ËÍøÍѤ¹¤ë¤È¡¢ Àµ¤·¤¯³ÊǼ¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¤ò¥á¥¿¥Ç¡¼¥¿¤ËÅÐÏ¿¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ \fB-c\fR¥ª¥×¥·¥ç¥ó¤ò¤â¤¦°ìÅÙ»ØÄꤹ¤ë¤È¡¢ ̵¸ú¤Ê¥Õ¥¡¥¤¥ë¤Ê¤É¤ò¾Ãµî¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ .TP \fB-d\fR ¥Ç¥Ð¥Ã¥°¥ª¥×¥·¥ç¥ó¤Ç¤¹¡£¥Ç¡¼¥â¥ó¤È¤·¤Æ¤Ç¤Ï¤Ê¤¯¡¢¥Õ¥©¥¢¥°¥é¥¦¥ó¥É¡¦ ¥×¥í¥»¥¹¤È¤·¤ÆÎ©¤Á¾å¤¬¤ê¤Þ¤¹¡£ ¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¡¢¤«¤Ä\fB-L\fR¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Ê¤«¤Ã¤¿ ¾ì¹ç¡¢¥í¥°¥ì¥Ù¥ë¤Ïdebug¤È¤Ê¤ê¤Þ¤¹¡£ .TP \fB-f \fIÀßÄê¥Õ¥¡¥¤¥ë\fB\fR µ¯Æ°»þ¤ËÆÉ¤ß¹þ¤àÀßÄê¥Õ¥¡¥¤¥ë¤ò»ØÄꤷ¤Þ¤¹¡£ .TP \fB-h \fI¥Û¥¹¥È̾\fB\fR ¼«¥Û¥¹¥È¤Î¥«¥Î¥Ë¥«¥ë¤Ê¥Û¥¹¥È̾¤ò»ØÄꤷ¤Þ¤¹¡¥ .TP \fB-l \fIIP¥¢¥É¥ì¥¹\fB\fR gfsd¤¬TCP¤ª¤è¤ÓUDP¤ÎÍ×µá¤ò¼õ¤±ÉÕ¤±¤ëIP¥¢¥É¥ì¥¹¤ò»ØÄꤷ¤Þ¤¹¡£ ¥ª¥×¥·¥ç¥ó¾Êά»þ¤Ï¡¢¤½¤Î¥Û¥¹¥È¤ÎÁ´¤Æ¤ÎIP¥¢¥É¥ì¥¹¤Ç¼õ¤±ÉÕ¤±¤Þ¤¹¡£ ¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢°ì¤Ä¤Î¥Î¡¼¥É¤ÇÊ£¿ô¤Î¥¹¥×¡¼¥ë¤òÄ󶡤¹¤ë¾ì¹ç¤Ë¡¢ ¤½¤ì¤¾¤ì¤Î¥¹¥×¡¼¥ë¤´¤È¤Ë¡¢ÊÌ¡¹¤ÎIP¥¢¥É¥ì¥¹¤ò»È¤Ã¤Ægfsd¤òµ¯Æ°¤¹¤ë ¤¿¤á¤ËÍѤ¤¤Þ¤¹¡£ .TP \fB-r \fI¥¹¥×¡¼¥ë¡¦¥Ç¥£¥ì¥¯¥È¥ê\fB\fR gfsd¤¬¡¢¥Õ¥¡¥¤¥ë¤Î¼ÂÂΤòÊÝ»ý¤¹¤ë¥Ç¥£¥ì¥¯¥È¥ê̾¤ò»ØÄꤷ¤Þ¤¹¡£ .TP \fB-s \fIsyslog¥Õ¥¡¥·¥ê¥Æ¥£\fB\fR gfsd¤¬¥¨¥é¡¼Êó¹ð¤ËÍѤ¤¤ësyslog¤Î¥Õ¥¡¥·¥ê¥Æ¥£¤ò»ØÄꤷ¤Þ¤¹¡£¾Êά ¤·¤¿¾ì¹ç¤Ë¤Ï¡¢local0¤ò»ÈÍѤ·¤Þ¤¹¡£ .TP \fB-v\fR ǧ¾Ú½èÍý¤Ë´Ø¤¹¤ë¥í¥°¤ò¾Ü¤·¤¯½ÐÎϤ·¤Þ¤¹¡£ GSIǧ¾Ú¤ÎÌäÂê¤ò²ò·è¤¹¤ë¾ì¹ç¤ËÍ­ÍѤʥª¥×¥·¥ç¥ó¤Ç¤¹¡£ .TP \fB-?\fR °ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡£ .SH "FILES" .TP \fB\fI%%SYSCONFDIR%%/gfarm2.conf\fB\fR gfsd¤¬»²¾È¤¹¤ëÀßÄê¥Õ¥¡¥¤¥ë¤Ç¤¹¡£ .SH "SEE ALSO" .PP \fBgfarm2.conf\fR(5) gfarm-2.4.1/man/ja/man8/Makefile0000644000000000000000000000056511507222725014771 0ustar rootroot# $Id: Makefile 2373 2006-01-12 00:54:22Z soda $ top_builddir = ../../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk include $(srcdir)/../Makefile.inc DOCBOOK_DIR=$(top_srcdir)/doc/docbook/ja/ref/man8 include $(DOCBOOK_DIR)/Makefile.inc MAN = $(DOCBOOK) EXTRA_CLEAN_TARGETS = manpage.links manpage.refs include $(top_srcdir)/makes/man.mk gfarm-2.4.1/man/ja/man1/0000755000000000000000000000000011507222730013310 5ustar rootrootgfarm-2.4.1/man/ja/man1/gfreg.10000644000000000000000000000767411507222725014506 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFREG" "1" "24 January 2007" "Gfarm" "" .SH NAME gfreg \- Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ø¤Î¥Õ¥¡¥¤¥ë¡¤¥Õ¥¡¥¤¥ë¥Õ¥é¥°¥á¥ó¥È¡¤¥Ç¥£¥ì¥¯¥È¥ê¤ÎÅÐÏ¿ .SH SYNOPSIS \fBgfreg\fR [ \fB-p \fR ] [ \fB-h \fI¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É\fB\fR | \fB-H \fI¥Û¥¹¥È¥Õ¥¡¥¤¥ë̾\fB\fR | \fB-D \fI¥É¥á¥¤¥ó̾\fB\fR ] [ \fB-a \fIarchitecture\fB\fR ] \fB\fIprogram\fB\fR \fB\&...\fR \fB\fIgfarm-URL\fB\fR \fBgfreg\fR [ \fB-i \fR ] [ \fB-h \fI¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É\fB\fR | \fB-H \fI¥Û¥¹¥È¥Õ¥¡¥¤¥ë̾\fB\fR | \fB-D \fI¥É¥á¥¤¥ó̾\fB\fR ] \fB\fIlocalfile\fB\fR \fB\&...\fR \fB\fIgfarm-URL\fB\fR \fBgfreg\fR \fB-N \fI¥Õ¥é¥°¥á¥ó¥ÈÁí¿ô\fB\fR \fB-I \fI¥Õ¥é¥°¥á¥ó¥ÈÈÖ¹æ\fB\fR [ \fB-h \fI¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É\fB\fR | \fB-H \fI¥Û¥¹¥È¥Õ¥¡¥¤¥ë̾\fB\fR | \fB-D \fI¥É¥á¥¤¥ó̾\fB\fR ] \fB\fIlocalfile\fB\fR \fB\&...\fR \fB\fIgfarm-URL\fB\fR \fBgfreg\fR \fB-r\fR [ \fB-h \fI¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É\fB\fR | \fB-H \fI¥Û¥¹¥È¥Õ¥¡¥¤¥ë̾\fB\fR | \fB-D \fI¥É¥á¥¤¥ó̾\fB\fR ] [ \fB-a \fIarchitecture\fB\fR ] [ \fB\fIdirectory\fB\fR | \fB\fIprogram\fB\fR | \fB\fIlocalfile\fB\fR ] \fB\&...\fR \fB\fIgfarm-URL\fB\fR .SH "DESCRIPTION" .PP Âè1¤Î·Á¼°¤Î¾ì¹ç¡¤°ú¿ô program ¤Ë»ØÄꤷ¤¿¥í¡¼¥«¥ë¥Ç¥£¥¹¥¯¾å¤Î ¥×¥í¥°¥é¥à¡¦¥Õ¥¡¥¤¥ë¤ò¡¤gfarm-URL ¤ËÅÐÏ¿¤·¤Þ¤¹¡¥gfarm-URL ¤¬¥Ç¥£¥ì¥¯¥È ¥ê¤Î¾ì¹ç¤Ï¡¤Ê£¿ô¤Î program ¤ò»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡¥¤³¤ì°Ê¹ß¡¤ gfrun ¤ª¤è¤Ó gfmpirun_p4 ¤Ç»ØÄꤹ¤ë¥×¥í¥°¥é¥à̾¤È¤·¤Æ¡¤¤³¤Î URL ¤¬ »È¤¨¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡¥¥ª¥×¥·¥ç¥ó -p ¤¬¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¤¼Â¹Ô¤¬µö²Ä¤µ¤ì¤Æ¤¤ ¤ë program ¤Î¤ß»ØÄê¤Ç¤­¤Þ¤¹¡¥¤¢¤ë¾ì¹ç¤Ë¤Ï¡¤¼Â¹Ô¤¬µö²Ä¤µ¤ì¤Æ¤¤¤Ê¤¤¥Õ¥¡¥¤ ¥ë¤â»ØÄê¤Ç¤­¤Þ¤¹¤¬¡¤¤³¤Î¥Õ¥¡¥¤¥ë̾¤ò gfrun ¤ª¤è¤Ó gfmpirun_p4 ¤Ç»ØÄꤷ ¤Æ¤â¡¤¼Â¹Ô¤Ç¤­¤Þ¤»¤ó¡¥¥ª¥×¥·¥ç¥ó -a ¤Ç¥×¥í¥°¥é¥à¤Îưºî¤¹¤ë¥¢¡¼¥­¥Æ ¥¯¥Á¥ã¤ò»ØÄꤷ¤Ê¤«¤Ã¤¿¾ì¹ç¡¤¤¢¤ë¤¤¤Ï¥ª¥×¥·¥ç¥ó -h ¤ÇÅÐÏ¿¤¹¤ë¥Õ¥¡¥¤¥ë¥· ¥¹¥Æ¥à¥Î¡¼¥É¤ò»ØÄꤷ¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¤gfreg ¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤·¤¿¥Û¥¹¥È¤Î ¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤ÈƱ¤¸¤Ç¤¢¤ë¤È²¾Äꤷ¤Þ¤¹¡¥¤¿¤À¤·¡¤¤½¤Î¥Û¥¹¥È¤¬ Gfarm ¥á ¥¿¥µ¡¼¥Ð¤ËÅÐÏ¿¤µ¤ì¤Æ¤¤¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡¥ .PP Âè2¤Î·Á¼°¤Î¾ì¹ç¡¤°ì¤Ä°Ê¾å¤ÎÊ£¿ô¤Îlocalfile¤òGfarm¥Õ¥¡¥¤¥ë¤È¤·¤Æ ÅÐÏ¿¤·¤Þ¤¹¡¥¥ª¥×¥·¥ç¥ó -i ¤¬¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¤¼Â¹Ô¤¬µö²Ä¤µ¤ì¤Æ¤¤¤Ê¤¤ localfile ¤Î¤ß¤ò»ØÄê¤Ç¤­¤Þ¤¹¡¥¤¢¤ë¾ì¹ç¤Ë¤Ï¡¤¼Â¹Ôµö²Ä¤È¤Ï̵´Ø·¸¤Ë localfile ¤ò»ØÄê¤Ç¤­¤Þ¤¹¡¥¥Õ¥¡¥¤¥ë¤ÎÊ£À½¤¬ºîÀ®¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¥·¥¹ ¥Æ¥à¥Î¡¼¥É¤Ï¼«Æ°Åª¤ËCPUÉé²Ù¤Ë¤è¤êÁª¤Ð¤ì¤Þ¤¹¤¬¡¤¥ª¥×¥·¥ç¥ó -h, -H, -D ¤Î¤¤¤º¤ì¤«¤Ë¤è¤êÁªÂò¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤òÀ©¸Â¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡¥ .PP Âè3¤Î·Á¼°¤Î¾ì¹ç¡¤localfile¤òGfarm¥Õ¥¡¥¤¥ë¤Î¥Õ¥é¥°¥á¥ó¥È¤È¤·¤ÆÅÐ Ï¿¤·¤Þ¤¹¡¥¥ª¥×¥·¥ç¥ó -N ¤È -I ¤Ç¡¤Áí¥Õ¥é¥°¥á¥ó¥È¿ô¤È¡¤¤³¤Îlocalfile¤Î ¥Õ¥é¥°¥á¥ó¥ÈÈÖ¹æ¤òɬ¤º»ØÄꤹ¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡¥Gfarm-URL ¤¬¥Ç¥£¥ì¥¯¥È¥ê ¤Î¾ì¹ç¤Ï localfile ¤òÊ£¿ô»ØÄꤹ¤ë¤³¤È¤¬²Äǽ¤Ç¤¹¡¥¥Õ¥¡¥¤¥ë¤ÎÊ£À½¤¬ºîÀ® ¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Ï¼«Æ°Åª¤ËCPUÉé²Ù¤Ë¤è¤êÁª¤Ð¤ì¤Þ¤¹¤¬¡¤¥ª¥× ¥·¥ç¥ó -h, -H, -D ¤Î¤¤¤º¤ì¤«¤Ë¤è¤ê¤Ë¤è¤êÌÀ¼¨Åª¤Ë»ØÄꤹ¤ë¤³¤È¤â¤Ç¤­¤Þ¤¹¡¥ ¤¿¤À¡¤¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Ç gfreg ¤ò¼Â¹Ô¤·¤¿¾ì¹ç¤Ï¾ï¤Ë¼«¥Î¡¼¥É¤¬ Áª¤Ð¤ì¤Æ¤·¤Þ¤¦¤¿¤á¡¤¥Õ¥¡¥¤¥ë¤òʬ»¶¤µ¤»¤ÆÇÛÃÖ¤·¤¿¤¤¾ì¹ç¤Ï¥ª¥×¥·¥ç¥ó -h, -H, -D ¤Î¤¤¤º¤ì¤«¤ò»ØÄꤹ¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡¥ .PP Âè4¤Î·Á¼°¤Î¾ì¹ç¡¤directory, program, localfile ¤ò gfarm-URL ¤Ë ÅÐÏ¿¤·¤Þ¤¹¡¥directory ¤Ë¥µ¥Ö¥Ç¥£¥ì¥¯¥È¥ê¤ä¥Õ¥¡¥¤¥ë¤¬´Þ¤Þ¤ì¤Æ¤¤¤ì¤ÐºÆµ¢ Ū¤ËÅÐÏ¿¤·¤Þ¤¹¡¥¥Ç¥£¥ì¥¯¥È¥ê¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë¡¤¤¢¤ë¤¤¤Ï¡¤°ú¿ô localfile ¤Ç»ØÄꤵ¤ì¤Æ¤¤¤ëÈó¼Â¹Ô¥Õ¥¡¥¤¥ë¤Ï¡¤°ì¤Ä¤Î¥Õ¥é¥°¥á¥ó¥È¤«¤é¤Ê¤ë Gfarm¥Õ¥¡ ¥¤¥ë¤È¤·¤ÆÅÐÏ¿¤µ¤ì¤Þ¤¹¡¥ Gfarm-URL ¤¬¥Ç¥£¥ì¥¯¥È¥ê¤È¤·¤ÆÂ¸ºß¤¹¤ë¾ì¹ç¤Ï¡¤Ê£¿ô¤Î directory, program, localfile ¤ò Gfarm-URL ¥Ç¥£¥ì¥¯¥È¥ê¤ËÅÐÏ¿¤·¤Þ¤¹¡¥ ¾¤Î·Á¼°¤È°Û¤Ê¤ê¡¤¤³¤ì¤é¤ò¤¤¤Ã¤·¤ç¤Ë°ú¿ô¤È¤·¤Æ»ØÄꤹ¤ë¤³¤È¤â¤Ç¤­¤Þ¤¹¡¥ gfarm_URL ¤¬Â¸ºß¤·¤Ê¤¤¾ì¹ç¤Ï¡¤directory, program, localfile ¤Î¤¤¤º¤ì¤« °ì¤Ä¤òÅÐÏ¿¤Ç¤­¤Þ¤¹¡¥ ¥Õ¥¡¥¤¥ë¤¬ÅÐÏ¿¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤È¥ª¥×¥·¥ç¥ó -a -h ¤Ë¤Ä¤¤¤Æ ¤Ï¡¤¾åµ­¤ÎÂè1¤Î·Á¼°¤Ç¤ÎÀâÌÀ¤ò»²¾È¤·¤¯¤À¤µ¤¤¡¥ .SH "OPTIONS" .TP \fB-f\fR gfarm-URL ¤¬¥Õ¥¡¥¤¥ë¤È¤·¤ÆÂ¸ºß¤·¤Æ¤¤¤Æ¤â¡¤¶¯À©Åª¤Ë¾å½ñ¤­¤·¤Þ¤¹¡¥ .TP \fB-?\fR °ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡¥ gfarm-2.4.1/man/ja/man1/gfssh.10000644000000000000000000000002111507222725014501 0ustar rootroot.so man1/gfrun.1 gfarm-2.4.1/man/ja/man1/gffindxmlattr.10000644000000000000000000000274311507222725016255 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFFINDXMLATTR" "1" "18 August 2009" "Gfarm" "" .SH NAME gffindxmlattr \- ¥Õ¥¡¥¤¥ë¤ÎXML³Èĥ°À­¤òXPath¤Ë¤è¤ê¸¡º÷¤¹¤ë .SH SYNOPSIS \fBgffindxmlattr\fR [ \fB-d \fIdepth\fB\fR ] [ \fB-F \fIdelim\fB\fR ] [ \fB\fIXPath\fB\fR | \fB-f \fIXPath-file\fB\fR ] \fB\fIpath\fB\fR .SH "DESCRIPTION" .PP »ØÄꤵ¤ì¤¿XPath¼°¤Ë°ìÃפ¹¤ëXML³Èĥ°À­¤ò¸¡º÷¤·¡¤ °ìÃפ·¤¿¥Ñ¥¹Ì¾¤ÈXML³Èĥ°À­Ì¾¤òɽ¼¨¤·¤Þ¤¹¡¥ »ØÄꤵ¤ì¤¿path¤¬¥Õ¥¡¥¤¥ë¤Î¾ì¹ç¡¤¤½¤Î¥Õ¥¡¥¤¥ë¤ÎXML³Èĥ°À­¤ò¸¡º÷¤·¤Þ¤¹¡¥ ÆÉ¤ß¹þ¤ß¸¢¸Â¤Î¤Ê¤¤¥Õ¥¡¥¤¥ë¤Ï̵»ë¤µ¤ì¤Þ¤¹¡¥ .PP »ØÄꤵ¤ì¤¿path¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Î¾ì¹ç¡¤depth¤Ç»ØÄꤵ¤ì¤¿¿¼¤µ¤Þ¤ÇºÆµ¢Åª¤Ë¸¡º÷¤·¤Þ¤¹¡¥ 0¤Î¾ì¹ç¡¤»ØÄꤵ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¤ò¸¡º÷¤·¤Þ¤¹¡¥ depth¤¬»ØÄꤵ¤ì¤Ê¤¤¾ì¹ç¡¤ÌµÀ©¸Â¤Ë¸¡º÷¤·¤Þ¤¹¡¥ Éé¤ÎÃͤ¬»ØÄꤵ¤ì¤¿¾ì¹ç¤Ï¥¨¥é¡¼¤È¤Ê¤ê¤Þ¤¹¡¥ ¤Þ¤¿¡¤¼Â¹Ô¸¢¸Â¤Î¤Ê¤¤¥Ç¥£¥ì¥¯¥È¥ê¤Ï¸¡º÷¤µ¤ì¤Þ¤»¤ó¡¥ .PP ½ÐÎÏ·ë²Ì¤Ï¡¤°ìÃפ·¤¿¥Ñ¥¹Ì¾¤ÈXML°À­Ì¾¤¬¶èÀÚ¤êʸ»údelim¤Ç¶èÀڤäÆÉ½¼¨¤µ¤ì¤Þ¤¹¡¥ .SH "OPTIONS" .TP \fB-d depth\fR depth¤Ç»ØÄꤵ¤ì¤¿¿¼¤µ¤Þ¤ÇºÆµ¢Åª¤Ë¸¡º÷¤·¤Þ¤¹¡¥ .TP \fB-F delim\fR °ìÃפ·¤¿¥Ñ¥¹Ì¾¤ÈXML³Èĥ°À­Ì¾¤Î¶èÀÚ¤êʸ»ú¤ò»ØÄꤷ¤Þ¤¹¡¥ -F¥ª¥×¥·¥ç¥ó¤¬»ØÄꤵ¤ì¤Ê¤¤¾ì¹ç¤Ï¥¿¥Ö¤È¤Ê¤ê¤Þ¤¹¡¥ .TP \fB-f XPath-file\fR ¸¡º÷¤¹¤ëXPath¼°¤òÆÉ¤ß¹þ¤à¥Õ¥¡¥¤¥ë¤ò»ØÄꤷ¤Þ¤¹¡¥ .TP \fB-?\fR °ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡¥ .SH "SEE ALSO" .PP \fBgfxattr\fR(1) gfarm-2.4.1/man/ja/man1/gfpwd.10000644000000000000000000000105511507222725014506 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFPWD" "1" "02 July 2003" "Gfarm" "" .SH NAME gfpwd \- ¸½ºß¤Î Gfarm ºî¶È¥Ç¥£¥ì¥¯¥È¥ê̾¤òɽ¼¨¤¹¤ë¡£ .SH SYNOPSIS \fBgfpwd\fR .SH "DESCRIPTION" .PP ¸½ºß¤Î Gfarm ºî¶È¥Ç¥£¥ì¥¯¥È¥ê¤Î Gfarm-URL ¤òɽ¼¨¤·¤Þ¤¹¡£ .SH "SEE ALSO" .PP \fBgfcd\fR(1), \fBgfsetdir\fR(1) gfarm-2.4.1/man/ja/man1/gfuser.10000644000000000000000000000375711507222725014705 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFUSER" "1" "20 January 2010" "Gfarm" "" .SH NAME gfuser \- Gfarm ¥æ¡¼¥¶´ÉÍý¥³¥Þ¥ó¥É .SH SYNOPSIS \fBgfuser\fR [ \fB-P \fIpath\fB\fR ] [ \fB-l\fR ] [ \fB\fIuser\fB\fR\fI ...\fR ] \fBgfuser\fR [ \fB-P \fIpath\fB\fR ] \fB-c\fR \fBusername\fR \fBrealname\fR \fBhomedir\fR \fBgsi_dn\fR \fBgfuser\fR [ \fB-P \fIpath\fB\fR ] \fB-m\fR \fBusername\fR \fBrealname\fR \fBhomedir\fR \fBgsi_dn\fR \fBgfuser\fR [ \fB-P \fIpath\fB\fR ] \fB-d\fR \fBusername\fR .SH "DESCRIPTION" .PP Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë¤ª¤±¤ëÍøÍѥ桼¥¶¤Î´ÉÍý¤ò¹Ô¤¤¤Þ¤¹¡¥ ¥Ç¥Õ¥©¥ë¥È¤Ç¤ÏÅÐÏ¿¥æ¡¼¥¶¤òɽ¼¨¤·¤Þ¤¹¡¥ ¥æ¡¼¥¶Ì¾¤¬»ØÄꤵ¤ì¤¿¤é¡¤»ØÄꤵ¤ì¤¿¥æ¡¼¥¶¤òɽ¼¨¤·¤Þ¤¹¡¥ Gfarm¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î´ÉÍý¼Ô¤Ï¡¤-c¡¤-m¡¤-d ¥ª¥×¥·¥ç¥ó¤ò»ØÄꤹ¤ë¤³¤È¤Ë¤è¤ê¡¤¤½¤ì¤¾¤ì¥æ¡¼¥¶¤ÎÅÐÏ¿¡¤ ÅÐÏ¿¾ðÊóÊѹ¹¡¤ÅÐÏ¿ºï½ü¤ò¹Ô¤¦¤³¤È¤¬¤Ç¤­¤Þ¤¹¡¥ .SH "OPTIONS" .TP \fB-P \fI¥Ñ¥¹Ì¾\fB\fR ¤³¤Î¥³¥Þ¥ó¥É¤¬¥¢¥¯¥»¥¹¤¹¤ë¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤òÆÃÄꤹ¤ë¤¿¤á¤Î ¥Ñ¥¹Ì¾¤Þ¤¿¤Ï Gfarm URL ¤ò»ØÄꤷ¤Þ¤¹¡£ ¾Êά¤·¤¿¾ì¹ç¤Ï¡¢¡Ö/¡×¤ò»ØÄꤷ¤¿¤Î¤ÈƱ¤¸°ÕÌ£¤Ë¤Ê¤ê¤Þ¤¹¡£ .TP \fB-l\fR ÅÐÏ¿¥æ¡¼¥¶¤Î¾ðÊó¤ò¾ÜºÙ¤Ëɽ¼¨¤·¤Þ¤¹¡¥ .TP \fB-c\fR ¥æ¡¼¥¶¤ÎÅÐÏ¿¤ò¹Ô¤¤¤Þ¤¹¡¥ ÅÐÏ¿¤Ë¤ÏGfarm¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ËÃÖ¤±¤ë¥°¥í¡¼¥Ð¥ë¥æ¡¼¥¶Ì¾¡¤ ¼Â¥æ¡¼¥¶Ì¾¡¤Gfarm¾å¤Î¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê¡¤GSIǧ¾Ú¤Ë¤ª¤±¤ë ¥æ¡¼¥¶¾ÚÌÀ½ñ¤ÎSubject DN¤ò»ØÄꤷ¤Þ¤¹¡¥ ¼Â¥æ¡¼¥¶Ì¾¡¤Subject DN¤Ê¤É¤Ë¶õÇò¤¬´Þ¤Þ¤ì¤ë¾ì¹ç¤Ï¡¤ ¥À¥Ö¥ë¥¯¥ª¡¼¥È¤Ê¤É¤Ç³ç¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡¥ Gfarm¤Î´ÉÍý¼Ô¤¬¼Â¹Ô²Äǽ¤Ç¤¹¡¥ .TP \fB-m\fR ÅÐÏ¿¥æ¡¼¥¶¤Î¾ðÊó¤ÎÊѹ¹¤ò¹Ô¤¤¤Þ¤¹¡¥ Êѹ¹¤·¤¿¤¤¥°¥í¡¼¥Ð¥ë¥æ¡¼¥¶Ì¾¡¤ ¼Â¥æ¡¼¥¶Ì¾¡¤Gfarm¾å¤Î¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê¡¤GSIǧ¾Ú¤Ë¤ª¤±¤ë ¥æ¡¼¥¶¾ÚÌÀ½ñ¤ÎSubject DN¤ò»ØÄꤷ¤Þ¤¹¡¥ Gfarm¤Î´ÉÍý¼Ô¤¬¼Â¹Ô²Äǽ¤Ç¤¹¡¥ .TP \fB-d\fR ÅÐÏ¿¥æ¡¼¥¶¤Î¾ðÊó¤ò¾Ãµî¤·¤Þ¤¹¡¥ ¾Ãµî¤·¤¿¤¤¥°¥í¡¼¥Ð¥ë¥æ¡¼¥¶Ì¾¤ò»ØÄꤷ¤Þ¤¹¡¥ Gfarm¤Î´ÉÍý¼Ô¤¬¼Â¹Ô²Äǽ¤Ç¤¹¡¥ .TP \fB-?\fR °ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡¥ .SH "SEE ALSO" .PP \fBgfgroup\fR(1) gfarm-2.4.1/man/ja/man1/gfrm.10000644000000000000000000000615511507222725014340 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFRM" "1" "03 November 2006" "Gfarm" "" .SH NAME gfrm \- Gfarm ¥Õ¥¡¥¤¥ë¡¤¥Ç¥£¥ì¥¯¥È¥ê¡¤¥Õ¥¡¥¤¥ëÊ£À½¤òºï½ü¤¹¤ë¡¥ .SH SYNOPSIS \fBgfrm\fR [ \fB-frRnqv\fR ] [ \fB-I \fI¥Õ¥¡¥¤¥ë¥»¥¯¥·¥ç¥ó\fB\fR ] [ \fB-h \fI¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É\fB\fR ] [ \fB-D \fI¥É¥á¥¤¥ó̾\fB\fR ] [ \fB-H \fI¥Û¥¹¥È»ØÄê¥Õ¥¡¥¤¥ë\fB\fR ] [ \fB-N \fIÊ£À½¿ô\fB\fR ] [ \fB-j \fI¥¹¥ì¥Ã¥É¿ô\fB\fR ] \fB\fIgfarm-URL\fB\fR\fI ...\fR .SH "DESCRIPTION" .PP Gfarm-URL ¤Ë»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤òºï½ü¤·¤Þ¤¹¡¥ ¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤Îºï½ü¤Ï¹Ô¤¤¤Þ¤»¤ó¤¬¡¤ \fB-r\fR¤¢¤ë¤¤¤Ï\fB-R\fR ¥ª¥×¥·¥ç¥ó¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¤ »ØÄꤵ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê°Ê²¼¤Î¥Õ¥¡¥¤¥ë¤ª¤è¤Ó¥Ç¥£¥ì¥¯¥È¥ê¤¬ºÆµ¢Åª¤Ë¾Ãµî¤µ¤ì¤Þ¤¹¡¥ ¤Ê¤ª¡¤. ¤¢¤ë¤¤¤Ï .. ¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¤Ï¥¨¥é¡¼¤Ë¤Ê¤ê¤Þ¤¹¡¥ .PP \fB-I\fR¥ª¥×¥·¥ç¥ó¤ò»ØÄꤹ¤ë¤³¤È¤Ë¤è¤ê¡¤ ¥Õ¥¡¥¤¥ë¤ÎÆÃÄê¤Î¥Õ¥¡¥¤¥ë¥»¥¯¥·¥ç¥ó¤òºï½ü¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡¥ ¥Õ¥¡¥¤¥ë¥»¥¯¥·¥ç¥ó¤È¤Ï¡¤¼Â¹Ô·Á¼°¤Î¥Õ¥¡¥¤¥ë¤Î¾ì¹ç¤Ï¥¢¡¼¥­¥Æ¥¯¥Á¥ã̾¡¤ Ä̾ï¥Õ¥¡¥¤¥ë¤Î¾ì¹ç¤Ï¥Õ¥¡¥¤¥ë¥¤¥ó¥Ç¥Ã¥¯¥¹ÈÖ¹æ¤È¤Ê¤ê¤Þ¤¹¡¥ .PP \fB-h\fR¡¤\fB-D\fR¡¤\fB-H\fR ¥ª¥×¥·¥ç¥ó¤Ç¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤ò»ØÄꤹ¤ë¤³¤È¤Ë¤è¤ê¡¤ »ØÄꤵ¤ì¤¿¥Î¡¼¥É¤Ë³ÊǼ¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ëÊ£À½¤òºï½ü¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡¥ ¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¤ ¥Õ¥¡¥¤¥ë¤Îºï½ü¤È¤Ê¤Ã¤Æ¤·¤Þ¤¦Á´¤Æ¤Î¥Õ¥¡¥¤¥ëÊ£À½¤Îºï½ü¤Ï¤Ç¤­¤Þ¤»¤ó¤¬¡¤ \fB-f\fR¥ª¥×¥·¥ç¥ó¤ò¤Ä¤±¤ë¤³¤È¤Ë¤è¤êºï½ü¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡¥ .SH "OPTIONS" .TP \fB-f\fR ¥Õ¥¡¥¤¥ëÊ£À½ºï½ü¤Î¾ì¹ç¤Ë¡¤ Á´¤Æ¤Î¥Õ¥¡¥¤¥ëÊ£À½¤òºï½ü¤¹¤ë¤³¤È¤Ë¤Ê¤Ã¤Æ¤â¥Õ¥¡¥¤¥ëÊ£À½¤òºï½ü¤·¤Þ¤¹¡¥ ¤³¤Î»þ¡¤¥Õ¥¡¥¤¥ë¼«ÂΤ¬ºï½ü¤µ¤ì¤ë¤³¤È¤Ë¤Ê¤ê¤Þ¤¹¡¥ ¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï \fB-h\fR¡¤\fB-D\fR¡¤ \fB-H\fR ¤Î¤¤¤º¤ì¤«¤Î¥ª¥×¥·¥ç¥ó¤È¤È¤â¤Ë»ØÄꤵ¤ì¤¿¾ì¹ç¤ËÍ­¸ú¤Ç¤¹¡¥ .TP \fB-j \fI¥¹¥ì¥Ã¥É¿ô\fB\fR »ØÄꤵ¤ì¤¿¥¹¥ì¥Ã¥É¿ô¤ÇÊÂÎó¤Ë¥Õ¥¡¥¤¥ë¡¿¥Õ¥¡¥¤¥ëÊ£À½¤òºï½ü¤·¤Þ¤¹¡¥ ¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï gfrm ¤¬ OpenMP C ¥³¥ó¥Ñ¥¤¥é¤Ç¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤¿¤È¤­¤Ë ¸Â¤êÍ­¸ú¤Ç¤¹¡¥ .TP \fB-n\fR ¾Ãµî¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¤òɽ¼¨¤·¤Þ¤¹¡¥ ¼ÂºÝ¤Ë¤Ï²¿¤â¼Â¹Ô¤µ¤ì¤Þ¤»¤ó¡¥ .TP \fB-q\fR ;ʬ¤Ê¥á¥Ã¥»¡¼¥¸¤òɽ¼¨¤·¤Þ¤»¤ó¡¥ .TP \fB-r, -R\fR °ú¿ô¤¬¥Ç¥£¥ì¥¯¥È¥ê¤À¤Ã¤¿¾ì¹ç¡¤¤½¤Î¥Ç¥£¥ì¥¯¥È¥ê°Ê²¼¤ò Á´¤Æ¡¤ºÆµ¢Åª¤Ëºï½ü¤·¤Þ¤¹¡¥ .TP \fB-v\fR ¾éĹ¤Ë¥á¥Ã¥»¡¼¥¸¤òɽ¼¨¤·¤Þ¤¹¡¥ .TP \fB-h \fI¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É\fB\fR Ê£À½¤òºï½ü¤¹¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É̾¤ò»ØÄꤷ¤Þ¤¹¡¥ \fB-I\fR¥ª¥×¥·¥ç¥ó¤È¶¦¤ËÍѤ¤¤ë¤³¤È¤Ë¤è¤ê¡¤ ÆÃÄê¤Î¥Õ¥¡¥¤¥ë¥»¥¯¥·¥ç¥ó¤ÎÊ£À½¤òºï½ü¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡¥ .TP \fB-D \fI¥É¥á¥¤¥ó̾\fB\fR Ê£À½¤òºï½ü¤¹¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Î¥É¥á¥¤¥ó̾¤ò»ØÄꤷ¤Þ¤¹¡¥ .TP \fB-H \fI¥Û¥¹¥È»ØÄê¥Õ¥¡¥¤¥ë\fB\fR Ê£À½¤òºï½ü¤¹¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É·²¤òµ­ºÜ¤·¤¿¥Õ¥¡¥¤¥ë̾¤ò»ØÄꤷ¤Þ¤¹¡¥ ¥Û¥¹¥È̾¤Ï¡¤³Æ¹Ô¤Ë°ì¥Û¥¹¥È¤º¤Äµ­½Ò¤·¤Þ¤¹¡¥ ¥Õ¥¡¥¤¥ë̾¤È¤·¤Æ ``-'' ¤ò»ØÄꤷ¤¿¾ì¹ç¡¤É¸½àÆþÎϤ«¤é¥Û¥¹¥È̾¤Î¥ê¥¹¥È¤ò ÆÉ¤ß¹þ¤ß¤Þ¤¹¡¥ .TP \fB-I \fI¥Õ¥¡¥¤¥ë¥»¥¯¥·¥ç¥ó\fB\fR ºï½ü¤¹¤ë¥Õ¥¡¥¤¥ë¥»¥¯¥·¥ç¥ó¤ò»ØÄꤷ¤Þ¤¹¡¥ ¥Õ¥¡¥¤¥ë¥»¥¯¥·¥ç¥ó¤È¤Ï¡¤ ¼Â¹Ô·Á¼°¤Î¥Õ¥¡¥¤¥ë¤Î¾ì¹ç¤Ï¡¤¥¢¡¼¥­¥Æ¥¯¥Á¥ã̾(Îã ¡Ösparc-sun-solaris8¡×)¡¤ Ä̾ï¥Õ¥¡¥¤¥ë¤Î¾ì¹ç¤Ï¡¤¥Õ¥¡¥¤¥ë¥¤¥ó¥Ç¥Ã¥¯¥¹ÈÖ¹æ¤Î¤³¤È¤Ç¤¹¡¥ .TP \fB-N \fIÊ£À½¿ô\fB\fR »ØÄꤵ¤ì¤¿Ê£À½¿ô¤è¤ê¿¤¯¤ÎÊ£À½¤ò¤â¤Ä¥Õ¥¡¥¤¥ë¤ËÂФ·¡¤ Ê£À½¤ò¾Ãµî¤·»ØÄꤵ¤ì¤¿Ê£À½¿ô¤Ë¤·¤Þ¤¹¡¥ .TP \fB-?\fR °ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡¥ gfarm-2.4.1/man/ja/man1/gfmkdir.10000644000000000000000000000135411507222725015024 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFMKDIR" "1" "15 December 2010" "Gfarm" "" .SH NAME gfmkdir \- Gfarm ¥Ç¥£¥ì¥¯¥È¥ê¤òºîÀ®¤¹¤ë¡£ .SH SYNOPSIS \fBgfmkdir\fR [ \fB\fI¥ª¥×¥·¥ç¥ó\fB\fR ] \fB\fIgfarm¥Ñ¥¹\fB\fR\fI ...\fR .SH "DESCRIPTION" .PP Gfarm¥Ñ¥¹¤Ë»ØÄꤷ¤¿¥Ç¥£¥ì¥¯¥È¥ê¤òºîÀ®¤·¤Þ¤¹¡£ .SH "OPTIONS" .TP \fB-p\fR »ØÄꤷ¤¿¥Ç¥£¥ì¥¯¥È¥ê¤¬Â¸ºß¤·¤Æ¤â¥¨¥é¡¼¤Ë¤·¤Þ¤»¤ó¡£ ɬÍפ˱þ¤¸¤Æ¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤òºîÀ®¤·¤Þ¤¹¡£ .TP \fB-?\fR °ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡£ .SH "SEE ALSO" .PP \fBgfrmdir\fR(1) gfarm-2.4.1/man/ja/man1/gfusage.10000644000000000000000000000117011507222725015016 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFUSAGE" "1" "24 July 2006" "Gfarm" "" .SH NAME gfusage \- Gfarm ¤Î»ÈÍÑÎ̤òɽ¼¨¤¹¤ë .SH SYNOPSIS \fBgfusage\fR [ \fB-c\fR ] .SH "DESCRIPTION" .PP \fBgfusage\fR ¤Ï¡¢¥æ¡¼¥¶¤´¤È¤Ë Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î»ÈÍÑÎ̤òɽ¼¨¤·¤Þ¤¹¡£ .SH "OPTIONS" .TP \fB-c\fR ¥Õ¥¡¥¤¥ëÊ£À½¤ò¹Íθ¤·¤Æ¹ç·×¥µ¥¤¥º¤ò·×»»¤·¤Þ¤¹¡£ .SH "SEE ALSO" .PP \fBgfdf\fR(1) gfarm-2.4.1/man/ja/man1/gfrmdir.10000644000000000000000000000114311507222725015027 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFRMDIR" "1" "15 5·î 2008" "Gfarm" "" .SH NAME gfrmdir \- Gfarm ¥Ç¥£¥ì¥¯¥È¥ê¤òºï½ü¤¹¤ë¡£ .SH SYNOPSIS \fBgfrmdir\fR \fB\fIgfarm¥Ñ¥¹\fB\fR\fI ...\fR .SH "DESCRIPTION" .PP Gfarm¥Ñ¥¹¤Ë»ØÄꤷ¤¿¥Ç¥£¥ì¥¯¥È¥ê¤òºï½ü¤·¤Þ¤¹¡£ .SH "OPTIONS" .TP \fB-?\fR °ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡£ .SH "SEE ALSO" .PP \fBgfmkdir\fR(1) gfarm-2.4.1/man/ja/man1/gfexport.10000644000000000000000000000234611507222725015241 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFEXPORT" "1" "24 May 2003" "Gfarm" "" .SH NAME gfexport \- Gfarm ¥Õ¥¡¥¤¥ë¤òÄ̾ï¤Î¥Õ¥¡¥¤¥ë¤ËÊÑ´¹¤¹¤ë .SH SYNOPSIS \fBgfexport\fR [ \fB-H \fI¥Û¥¹¥È»ØÄê¥Õ¥¡¥¤¥ë\fB\fR ] [ \fB-I \fI¥Õ¥é¥°¥á¥ó¥ÈÈÖ¹æ\fB\fR ] \fB\fIgfarm-URL\fB\fR .SH "DESCRIPTION" .PP »ØÄꤷ¤¿ Gfarm URL ¤Îɽ¤¹ Gfarm ÊÂÎó¥Õ¥¡¥¤¥ë¤ò¡¢Ä̾ï¤Î¥Õ¥¡¥¤¥ë¤ËÊÑ´¹ ¤·¤ÆÉ¸½à½ÐÎϤ˽ÐÎϤ·¤Þ¤¹¡£ .SH "OPTIONS" .TP \fB-H \fI¥Û¥¹¥È»ØÄê¥Õ¥¡¥¤¥ë\fB\fR ¥Õ¥é¥°¥á¥ó¥È¤ò¼è¤ê½Ð¤¹¥Û¥¹¥È̾¤Î¥ê¥¹¥È¤ò»ØÄꤷ¤Þ¤¹¡£ ¥Û¥¹¥È̾¤Ï¡¢³Æ¹Ô¤Ë°ì¥Û¥¹¥È¤º¤Äµ­½Ò¤·¤Þ¤¹¡£ ¾Êά¤·¤¿¾ì¹ç¤Ë¤Ï¡¢¼«Æ°Åª¤ËÁª¤Ð¤ì¤¿¥Û¥¹¥È¤«¤é¥Õ¥é¥°¥á¥ó¥È¤òÆÀ¤Þ¤¹¡£ ¥Õ¥¡¥¤¥ë̾¤È¤·¤Æ ``-'' ¤ò»ØÄꤷ¤¿¾ì¹ç¡¢É¸½àÆþÎϤ«¤é¥Û¥¹¥È̾¤Î¥ê¥¹¥È¤ò ÆÉ¤ß¹þ¤ß¤Þ¤¹¡£ .TP \fB-I \fI¥Õ¥é¥°¥á¥ó¥ÈÈÖ¹æ\fB\fR ÊÂÎó¥Õ¥¡¥¤¥ëÃæ¤Î¡¢»ØÄꤷ¤¿¥Õ¥é¥°¥á¥ó¥È¤Î¤ß¤ò¼è¤ê½Ð¤·¤Þ¤¹¡£ ¼Â¹Ô·Á¼°¤Î¥Õ¥¡¥¤¥ë¤Î¾ì¹ç¤Ë¤Ï¡¢¤³¤Î¥ª¥×¥·¥ç¥ó¤Ç¼Â¹Ô¥¢¡¼¥­¥Æ¥¯¥Á¥ã (Îã ¡Ösparc-sun-solaris8¡×) ¤ò»ØÄꤹ¤ë¤³¤È¤Ë¤è¤Ã¤Æ¡¢»ØÄꤷ¤¿¥¢¡¼¥­ ¥Æ¥¯¥Á¥ã¤Î¼Â¹Ô¥Õ¥¡¥¤¥ë¤ò¼è¤ê½Ð¤»¤Þ¤¹¡£ .TP \fB-?\fR °ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡£ gfarm-2.4.1/man/ja/man1/gfgrep.10000644000000000000000000000240011507222725014644 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFGREP" "1" "18 March 2003" "Gfarm" "" .SH NAME gfgrep \- ÊÂÎó¥Õ¥¡¥¤¥ë¤ò grep ¤¹¤ë .SH SYNOPSIS \fBgfrun\fR \fBgfarm:gfgrep\fR \fB-o \fI½ÐÎÏgfarm-URL\fB\fR \fB\fIÀµµ¬É½¸½\fB\fR \fB\fIÆþÎÏgfarm-URL\fB\fR\fI ...\fR \fBgfrun\fR \fBgfarm:gfgrep\fR \fB-o \fI½ÐÎÏgfarm-URL\fB\fR \fB-e \fIÀµµ¬É½¸½\fB\fR \fB\fIÆþÎÏgfarm-URL\fB\fR\fI ...\fR .SH "DESCRIPTION" .PP gfrun ¤«¤é¸Æ¤Ó½Ð¤µ¤ì¤ë¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Î¥µ¥ó¥×¥ë¡¦¥×¥í¥°¥é¥à¤Ç¤¹¡£ .PP ¤Þ¤¿¡¢¥í¡¼¥«¥ë¥Õ¥¡¥¤¥ë¥Ó¥å¡¼¤òÍøÍѤ·¤Æ Gfarm ¥Õ¥¡¥¤¥ë¤Ë½ÐÎϤ¹¤ëÎã¤Ë¤â ¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£ .PP ÆþÎÏ gfarm-URL ¤«¤éÀµµ¬É½¸½¤ò¸¡º÷¤·¡¢·ë²Ì¤ò ½ÐÎÏ gfarm-URL ¤Ë½ÐÎϤ· ¤Þ¤¹¡£ .PP ¥½¡¼¥¹¤ò¸«¤ë¤Èʬ¤«¤ëÄ̤ꡢ\fBgfrun\fR ¤«¤é¸Æ¤Ó½Ð¤µ¤ì¤ë¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¡¢ -I ¤ª¤è¤Ó -N ¥ª¥×¥·¥ç¥ó¤ò²ò¼á¤·¡¢¤³¤³¤«¤éÆÀ¤¿ÃÍ¤Ç \fBgfs_pio_set_local()\fR ¤ò¸Æ¤Ó½Ð¤¹É¬Íפ¬¤¢¤ê¤Þ¤¹¡£ .SH "OPTIONS" .TP \fB-e \fIÀµµ¬É½¸½\fB\fR ¡Ö-¡×¤Ç»Ï¤Þ¤ëÀµµ¬É½¸½¤ò»ØÄꤷ¤¿¤¤¾ì¹ç¤ËÍѤ¤¤Þ¤¹¡£ .TP \fB-o \fIgfarm-URL\fB\fR ½ÐÎÏ Gfarm ¥Õ¥¡¥¤¥ë¤Î URL ¤ò»ØÄꤷ¤Þ¤¹¡£ .TP \fB-?\fR °ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡£ gfarm-2.4.1/man/ja/man1/gfront.10000644000000000000000000000147011507222725014677 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFRONT" "1" "19 8·î 2003" "Gfarm" "" .SH NAME gfront \- Gfarm ¥Õ¥¡¥¤¥ë¤òÁàºî¤¹¤ë¡£ .SH SYNOPSIS \fBgfront\fR .SH "DESCRIPTION" .PP GFront¤Ï¡¢gfarm¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤òÁàºî¤¹¤ëGUI¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤¢¤ë¡£ GFront¤Ï¡¢gfarm¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤òÍøÍѼԤ¬ÂÐÏÃŪ¤ËÁàºî¤¹¤ë¤³¤È¤ò²Äǽ¤È¤¹¤ë¡£ gfarm¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ËÂФ¹¤ë´ðËÜÁàºî¤Ï¤¹¤Ç¤Ë¥³¥Þ¥ó¥É¤È¤·¤Æ¼Â¸½¤µ¤ì¤Æ¤ª¤ê¡¢GFront¤Ç¤Ïgfarm¤Î¥³¥Þ¥ó¥É¤ËÁêÅö¤¹¤ëµ¡Ç½¤ò¼Â¹Ô¤¹¤ë¤¿¤á¤Î¥Õ¥í¥ó¥È¥¨¥ó¥Éµ¡Ç½¤òÄ󶡤¹¤ë¡£ .SH "SEE ALSO" .PP \fBgfexport\fR(1), \fBgfhost\fR(1), \fBgfrm\fR(1), \fBgfreg\fR(1) gfarm-2.4.1/man/ja/man1/gfrcmd.10000644000000000000000000000434011507222725014641 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFRCMD" "1" "20 August 2003" "Gfarm" "" .SH NAME gfrcmd(1) \- Gfarm ·×»»¥×¡¼¥ë¤Î¥Û¥¹¥È¤Ç¡¢¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤¹¤ë¡£ .SH SYNOPSIS \fBgfrcmd\fR \fB\fI¥Û¥¹¥È̾\fB\fR \fB\fI¥³¥Þ¥ó¥É\fB\fR\fI ...\fR .SH "DESCRIPTION" .PP Âè°ì°ú¿ô¤Ë»ØÄꤷ¤¿·×»»¥×¡¼¥ë¤Î¥Û¥¹¥È¤Ç¡¢ÂèÆó°ú¿ô°Ê¹ß¤Î¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤·¤Þ¤¹¡£ UNIX ɸ½à¤Î rsh ¤Ë»÷¤¿µ¡Ç½¤ò»ý¤Á¤Þ¤¹¤¬¡¢²¼µ­¤ÎÅÀ¤¬°Û¤Ê¤ê¤Þ¤¹¡£ .PP ¥µ¡¼¥Ð¡¼¤Ï¡¢inetd ¤«¤éµ¯Æ°¤¹¤ë¤Î¤Ç¤Ï¤Ê¤¯¡¢gfsd ¤ËÁȤ߹þ¤Þ¤ì¤Æ¤¤¤ë¡£ .PP gfarm ¤Îǧ¾Úµ¡¹½¤òÍѤ¤¤ë¡£rsh ¤Î¤è¤¦¤ËTCP¤ÎÆÃ¸¢¥Ý¡¼¥È¤òǧ¾Ú¤Ë ÍѤ¤¤ë¤³¤È¤Ï¤Ê¤¤¤Î¤Ç¡¢Æ±»þ¼Â¹Ô²Äǽ¤Ê¥³¥Þ¥ó¥É¿ô¤¬¡¢ÆÃ¸¢¥Ý¡¼¥È¤Î¿ô¤Ë À©Ì󤵤ì¤Ê¤¤¡£ .PP rsh ¤È°Û¤Ê¤ê¡£Ã±°ì¤ÎTCP¥³¥Í¥¯¥·¥ç¥ó¾å¤Çưºî¤¹¤ë¤Î¤Ç¡¢Æ±»þ¤Ë ¿¿ôµ¯Æ°¤·¤¿¾ì¹ç¤Î¡¢¥«¡¼¥Í¥ë¤Ø¤ÎÉé²Ù¤¬¼ã´³·Ú¤¤¡£ .PP ´Ä¶­ÊÑ¿ôDISPLAY¤òÅÁ¤¨¤ë¤³¤È¤¬¤Ç¤­¤ë¡£¤Þ¤¿¡¢¤³¤Î»þ X Window System ¤Îǧ¾Ú¾ðÊó¤âÅϤ¹¤³¤È¤¬½ÐÍè¤ë¡£ .PP ±ó³Ö¥Û¥¹¥È¤Ë¤ª¤±¤ë¥«¥ì¥ó¥È¡¦¥Ç¥£¥ì¥¯¥È¥ê¤Ï¡¢NFS¤Ç¶¦Í­¤µ¤ì¤Æ¤¤ ¤ë¤³¤È¤Î¿¤¤¥Û¡¼¥à¡¦¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ï¤Ê¤¯¡¢gfarm¤Î¥¹¥×¡¼¥ë¡¦¥Ç¥£¥ì ¥¯¥È¥ê¤Ë¤Ê¤ë¤Î¤Ç¡¢¥Ç¥Ð¥Ã¥°»þ¤Ë¡¢¥Û¥¹¥ÈËè¤Ëcore¥Õ¥¡¥¤¥ë¤ò»Ä¤¹¤³¤È¤¬ ÍÆ°×¡£ .PP gfarm¥é¥¤¥Ö¥é¥ê¤È¶¨Ä´¤·¤Æ¡¢¥³¥Þ¥ó¥É¤¬Ã×̿Ū¤Ê¥·¥°¥Ê¥ë¤òȯÀ¸¤µ ¤»¤¿¾ì¹ç¤Ë¥Ç¥Ð¥Ã¥¬¤ò¸Æ¤Ó½Ð¤¹µ¡Ç½¤òÈ÷¤¨¤ë¡£ .SH "OPTIONS" .TP \fB-l \fI¥æ¡¼¥¶¡¼Ì¾\fB\fR ±ó³Ö¥Û¥¹¥È¤Ç¤Î¥æ¡¼¥¶¡¼Ì¾¤ò»ØÄꤷ¤Þ¤¹¡£ .TP \fB-n\fR ɸ½àÆþÎÏ¤ÎÆâÍÆ¤ò¡¢±ó³Ö¥Û¥¹¥È¤ËÁ÷¤é¤Ê¤¯¤·¤Þ¤¹¡£ .TP \fB-r\fR ±ó³Ö¥Û¥¹¥È¤Î¥í¥°¥¤¥ó¥·¥§¥ë¤òÍøÍѤ·¤Ê¤¤¤Ç¡¤ »ØÄꤵ¤ì¤¿¥³¥Þ¥ó¥É¤òľÀܼ¹Ԥ·¤Þ¤¹¡£ .TP \fB-y\fR ´Ä¶­ÊÑ¿ôDISPLAY¤ò±ó³Ö¥Û¥¹¥È¤ËÅÁ¤¨¤Þ¤¹¡£ .TP \fB-X\fR ´Ä¶­ÊÑ¿ô X Window System ¤Îǧ¾Ú¾ðÊó¤ò¡¢±ó³Ö¥Û¥¹¥È¤ËÅÁ¤¨¤Þ¤¹¡£ ¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê¤ò¶¦Í­¤·¤Æ¤¤¤Ê¤¤¤è¤¦¤Ê¾ì¹ç¤ËÍ­ÍѤǤ¹¡£ .TP \fB-v\fR ¾ÜºÙ¤Ë¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤òɽ¼¨¤·¤Þ¤¹¡¥ .TP \fB-?\fR °ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡£ .SH "ENVIRONMENT" .TP \fBGFARM_DEBUG_MODE\fR ¤³¤Î´Ä¶­ÊÑ¿ô¤ËÃÍ gdb ¤òÀßÄꤹ¤ë¤È¡¢±ó³Ö¥Û¥¹¥È¤Î¥³¥Þ¥ó¥É¤¬ ¥·¥°¥Ê¥ë¤Ç½ªÎ»¤¹¤ëºÝ¤Ë¡¢xterm ¤ª¤è¤Ó ¤½¤Î¾å¤Çưºî¤¹¤ë GNU debugger gdb ¤ò¡¢¥³¥Þ¥ó¥É¤Ë´ØÏ¢¤Å¤±¤¿¾õÂ֤ǡ¢µ¯Æ°¤·¤Þ¤¹¡£ ¤³¤Îµ¡Ç½¤òÍøÍѤ¹¤ë¤Ë¤Ï¡¢X Window System ²¼¤Ç gfrcmd ¤òÍøÍѤ¹¤ëɬÍ× ¤¬¤¢¤ê¤Þ¤¹¡£ .SH "BUGS" .PP -l ¥ª¥×¥·¥ç¥ó¤Ï¤Þ¤À¼ÂÁõ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£ gfarm-2.4.1/man/ja/man1/gfhost.10000644000000000000000000002171711507222725014700 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFHOST" "1" "20 January 2010" "Gfarm" "" .SH NAME gfhost \- gfarm ¥Û¥¹¥È´ÉÍý¥³¥Þ¥ó¥É .SH SYNOPSIS \fBgfhost\fR [ \fB-H\fR | \fB-l\fR | \fB-M\fR ] [ \fB-iLprUv\fR ] [ \fB-P \fIpath\fB\fR ] [ \fB-a \fI¥¢¡¼¥­¥Æ¥¯¥Á¥ã\fB\fR ] [ \fB-D \fI¥É¥á¥¤¥ó̾\fB\fR ] [ \fB-j \fIÊÂÎóÅÙ\fB\fR ] [ \fB\fI¥Û¥¹¥È̾\fB\fR\fI ...\fR ] \fBgfhost\fR \fB-c\fR [ \fB-P \fIpath\fB\fR ] \fB-a\fI¥¢¡¼¥­¥Æ¥¯¥Á¥ã\fB\fR \fB-p\fI¥Ý¡¼¥ÈÈÖ¹æ\fB\fR [ \fB-n\fICPU¿ô\fB\fR ] \fB\fI¥Û¥¹¥È̾\fB\fR [ \fB\fI¥Û¥¹¥ÈÊÌ̾\fB\fR\fI ...\fR ] \fBgfhost\fR \fB-m\fR [ \fB-P \fIpath\fB\fR ] [ \fB-a\fI¥¢¡¼¥­¥Æ¥¯¥Á¥ã\fB\fR ] [ \fB-p\fI¥Ý¡¼¥ÈÈÖ¹æ\fB\fR ] [ \fB-n\fICPU¿ô\fB\fR ] [ \fB-A\fR ] \fB\fI¥Û¥¹¥È̾\fB\fR [ \fB\fI¥Û¥¹¥ÈÊÌ̾\fB\fR\fI ...\fR ] \fBgfhost\fR \fB-d\fR [ \fB-P \fIpath\fB\fR ] \fB\fI¥Û¥¹¥È̾\fB\fR\fI ...\fR \fBgfhost\fR \fB-R\fR [ \fB-P \fIpath\fB\fR ] .SH "DESCRIPTION" .PP \fBgfhost\fR ¤Ï¡¢gfarm ¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Ë ´Ø¤¹¤ë¾ðÊó¤Îɽ¼¨¤ä´ÉÍý¤ò¹Ô¤Ê¤¤¤Þ¤¹¡£\fBgfhost\fR ¤¬ ¼Â¹Ô¤¹¤ëµ¡Ç½¤Ï¡¢-c, -d, -H, -l, -M, -m, -R ¤Î¥ª¥×¥·¥ç¥ó¤Ç»ØÄꤷ¤Þ¤¹¡£ ¤³¤ì¤éµ¡Ç½¤Î»ØÄê¤ÏÇÓ¾Ū¤Ç¤¢¤ê¡¢¤É¤ì¤«°ì¤Ä¤À¤±¤ò»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ ¤Þ¤¿¡¢°ì¤Ä¤â»ØÄꤷ¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢¥Ç¥Õ¥©¡¼¥ë¥È¤Îµ¡Ç½¤Ç¤¢¤ë¥Û¥¹¥È̾ ɽ¼¨¤¬¹Ô¤Ê¤ï¤ì¤Þ¤¹¡£ .SH "FUNCTIONS" .PP µ¡Ç½»ØÄê¤Î¤¦¤Á¡¢-c, -d, -M, -m, -R ¤Ï¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¡¼¤Î¤ß¤ò ¥¢¥¯¥»¥¹¤·¡¢ÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë¥Û¥¹¥È¾ðÊó¤ÎÄɲᢺï½ü¡¢É½¼¨¡¢Êѹ¹¤ò¹Ô¤Ê¤¤¤Þ¤¹¡£ .PP µ¡Ç½»ØÄê¤Î¤¦¤Á¡¢-H, -l, -M, ¤ª¤è¤ÓÆÃ¤Ëµ¡Ç½¤ò»ØÄꤷ¤Ê¤«¤Ã¤¿¾ì¹ç¤Ï¡¢ ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Ë´Ø¤¹¤ë¾ðÊó¤òɽ¼¨¤·¤Þ¤¹¡£ ¤³¤Î¤¦¤Á -M ¤Ï¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¡¼¤Î¤ß¤ò¥¢¥¯¥»¥¹¤·¤Þ¤¹¤¬¡¢ ¤½¤ì°Ê³°¤Îµ¡Ç½¤Ï¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Çưºî¤·¤Æ¤¤¤ë \fBgfsd\fR ¤Ë¤â¥¢¥¯¥»¥¹¤·¤Þ¤¹¡£ \fBgfsd\fR ¤Ë¥¢¥¯¥»¥¹¤¹¤ëµ¡Ç½¤Ë´Ø¤·¤Æ¤Ï¡¢¤½¤Î¥¢¥¯¥»¥¹¤Ë ´Ø¤¹¤ë¥ª¥×¥·¥ç¥ó¤ò -i, -j, -U, -v ¤Ç»ØÄê¤Ç¤­¤Þ¤¹¡£ .PP ɽ¼¨µ¡Ç½¤Ë´Ø¤·¤Æ¤Ï¡¢¥Û¥¹¥È̾¤Î»ØÄê¤ò¾Êά¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¤³¤Î¾ì¹ç¡¢ ¥á¥¿¥Ç¡¼¥¿¤ËÅÐÏ¿¤µ¤ì¤Æ¤¤¤ëÁ´¤Æ¤Î¥Û¥¹¥È¤Ë´Ø¤¹¤ëɽ¼¨¤ò»î¤ß¤Þ¤¹¡£ ¤Þ¤¿¡¢-a ¤ª¤è¤Ó -D ¥ª¥×¥·¥ç¥ó¤Çɽ¼¨¤¹¤ë¥Û¥¹¥È¤Î¼ïÎà¤ò¸ÂÄê ¤¹¤ë¤³¤È¤â¤Ç¤­¤Þ¤¹¡£ ɽ¼¨¤Î½ç½ø¤Ï¡¢¥Û¥¹¥È̾¤Î¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È½ç¤Ç¤¹¤¬¡¢-L, -r, -u ¥ª¥×¥·¥ç¥ó¤Ç ½ç½ø¤òÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¤¿¤À¤·¡¢-M µ¡Ç½ ¤È¡¢µ¡Ç½¤ò»ØÄꤷ¤Ê¤«¤Ã¤¿¾ì¹ç ¤Ë´Ø¤·¤Æ¤Ï -L ¥ª¥×¥·¥ç¥ó¤Ï̵¸ú¤Ç¤¹¡£ .PP ²¼µ­¤Ï¡¢gfhost ¥³¥Þ¥ó¥É¤Îµ¡Ç½°ìÍ÷¤Ç¤¹¡£Æó¤Ä°Ê¾å¤Îµ¡Ç½¤òƱ»þ¤Ë »ØÄꤹ¤ë¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó¡£ .TP \fB̵»ØÄê\fR µ¡Ç½¤òÆÃ¤Ë»ØÄꤷ¤Ê¤«¤Ã¤¿¾ì¹ç¡¢\fBgfsd\fR ¤Ø¤Î Ì䤤¹ç¤ï¤»¤ò¹Ô¤Ê¤¤¡¢Æ°ºî¤·¤Æ¤¤¤ë¥Û¥¹¥È¤Î¥Û¥¹¥È̾¤Î¤ß¤òɽ¼¨¤·¤Þ¤¹¡£ ¥Ç¥Õ¥©¡¼¥ë¥È¤Ç¤Ï¡¢¥Û¥¹¥È̾¤Î¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È½ç¤Çɽ¼¨¤·¤Þ¤¹¡£ .TP \fB-c\fR °ú¿ô¤Ç»ØÄꤷ¤¿¥Û¥¹¥È¤ò¥á¥¿¥Ç¡¼¥¿¤ØÅÐÏ¿¤·¤Þ¤¹¡£ ¥ª¥×¥·¥ç¥ó -a ¤Ç¡¢¤½¤Î¥Û¥¹¥È¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤ò»ØÄꤹ¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£ ƱÍͤ˥ª¥×¥·¥ç¥ó -p ¤Ç¡¢¤½¤Î¥Û¥¹¥È¤Î¥Ý¡¼¥ÈÈÖ¹æ¤ò»ØÄꤹ¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£ ¥ª¥×¥·¥ç¥ó -n ¤Ç¡¢¤½¤Î¥Û¥¹¥È¤Î CPU ¿ô¤ò»ØÄꤷ¤Þ¤¹¡£¾Êά¤·¤¿¾ì¹ç¤Ë¤Ï 1 CPU ¤À¤È¤ß¤Ê¤·¤Þ¤¹¡£ ¥Û¥¹¥È̾¤Ï¡¢°ì¤Ä¤Î¥³¥Þ¥ó¥É¤ÇÊ£¿ôµ­½Ò¤Ç¤­¤Þ¤¹¡£¤³¤Î¾ì¹ç¡¢ºÇ½é¤Ë »ØÄꤷ¤¿Ì¾Á°¤¬¡¢¤½¤Î¥Û¥¹¥È¤Î¸ÇÍ­¼±Ê̻ҤȤ·¤Æ¡¢Ê£À½¾ðÊó¤Î´ÉÍý¤Ë ÍѤ¤¤é¤ì¤Þ¤¹¡£»Ä¤ê¤Î¥Û¥¹¥È̾¤Ï¡¢¤½¤Î¥Û¥¹¥È¤ËÂФ¹¤ëÊÌ̾¤È¤·¤Æ °·¤ï¤ì¤Þ¤¹¡£ ¤¢¤ë¥Û¥¹¥È¤¬Ê£¿ô¤Î¥Í¥Ã¥È¥ï¡¼¥¯¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤ò»ý¤Á¡¢¤½¤ì¤¾¤ì¤Î ¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤ËÊÌ¡¹¤Î¥Û¥¹¥È̾¤¬³ä¤êÅö¤Æ¤é¤ì¤Æ¤¤¤ë¾ì¹ç¡¢¤½¤ì¤é Á´¤Æ¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î¥Û¥¹¥È̾¤ò¡¢¸ÇÍ­¼±Ê̻Ҥ¢¤ë¤¤¤ÏÊÌ̾¤È¤·¤Æ ÅÐÏ¿¤·¤Æ¤¯¤À¤µ¤¤¡£ ¤Þ¤¿¡¢/etc/hosts ¥Õ¥¡¥¤¥ë¤ä NIS ¤Î hosts ¥Ç¡¼¥¿¥Ù¡¼¥¹¤ËÅÐÏ¿¤µ¤ì¤¿ ¥Û¥¹¥È̾¤¬¡¢¥É¥á¥¤¥óÉô¤ò´Þ¤ó¤Ç¤Ê¤¤¤è¤¦¤Ê¾ì¹ç (/etc/hosts ¤ä NIS hosts ¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ë FQDN ¤¬ÅÐÏ¿¤µ¤ì¤Æ¤Ê¤¤¤è¤¦¤Ê¾ì¹ç) ¤â¡¢ ɬ¤º¥Û¥¹¥È¤ÎÊÌ̾ÅÐÏ¿¤¬É¬ÍפȤʤê¤Þ¤¹¡£¤³¤Î¤è¤¦¤Ê¾ì¹ç¡¢¸ÇÍ­¼±ÊÌ»Ò ¤È¤·¤Æ¥É¥á¥¤¥ó̾¤ò´Þ¤à¥Û¥¹¥È̾ (FQDN) ¤ò¡¢ÊÌ̾¤È¤·¤Æ¥É¥á¥¤¥ó̾¤ò ´Þ¤Þ¤Ê¤¤¥Û¥¹¥È̾¤òÅÐÏ¿¤·¤Æ¤¯¤À¤µ¤¤¡£ .TP \fB-d\fR °ú¿ô¤Ë»ØÄꤷ¤¿¥Û¥¹¥È¾ðÊó¤ò¥á¥¿¥Ç¡¼¥¿¤«¤éºï½ü¤·¤Þ¤¹¡£ ¸½ºß¤Î¤È¤³¤í¡¢Ê£À½¾ðÊó¤È¤·¤Æ»²¾È¤µ¤ì¤Æ¤¤¤ë¥Û¥¹¥È¤â ºï½ü¤Ç¤­¤Æ¤·¤Þ¤¤¤Þ¤¹¤¬¡¢¤³¤ì¤ò¹Ô¤Ê¤¦¤ÈÊ£À½¥Ç¡¼¥¿¥Ù¡¼¥¹¤¬ÉÔÀ°¹ç ¾õÂ֤ȤʤäƤ·¤Þ¤¤¤Þ¤¹¤Î¤ÇÃí°Õ¤¬É¬ÍפǤ¹¡£ ¥Û¥¹¥È̾¤Ë»ØÄê¤Ç¤­¤ë¤Î¤Ï ¸ÇÍ­¼±Ê̻ҤΤߤǤ¹¡£ .TP \fB-H\fR \fBgfsd\fR ¤ËÌ䤤¹ç¤ï¤»¤ÆÆÀ¤¿¾ðÊ󡢤¹¤Ê¤ï¤Á ¥í¡¼¥É¥¢¥Ù¥ì¡¼¥¸¤Èǧ¾Ú¼êÃʤòɽ¼¨¤·¤Þ¤¹¡£ ¤³¤Îµ¡Ç½¤Ë´Ø¤·¤Æ¤Ï¡¢°ú¿ô¤Ç¥Û¥¹¥È̾¤ò»ØÄꤷ¤¿¾ì¹ç¡¢É½¼¨¤µ¤ì¤ë ¤Î¤Ï¡¢¸ÇÍ­¼±Ê̻ҤȤ·¤ÆÍѤ¤¤é¤ì¤Æ¤¤¤ë¥Û¥¹¥È̾¤Ç¤Ï¤Ê¤¯¡¢°ú¿ô ¤Ç»ØÄꤷ¤¿Ì¾Á°¤Ë¤Ê¤ê¤Þ¤¹¡£ ¤Þ¤¿¡¢¥Û¥¹¥È̾¤Î¸å¤Ë¡¢¥¢¥¯¥»¥¹¤ËÍѤ¤¤é¤ì¤¿ IP ¥¢¥É¥ì¥¹¤ò³ç¸Ì¤Ç °Ï¤Ã¤ÆÉ½¼¨¤·¤Þ¤¹¡£ ¥Û¥¹¥È¤¬Ää»ß¤ä¥Í¥Ã¥È¥ï¡¼¥¯¾ã³²¤Î¤¿¤á¤Ë¥¢¥¯¥»¥¹¤Ç¤­¤Ê¤«¤Ã¤¿¾ì¹ç¡¢ ¥í¡¼¥É¥¢¥Ù¥ì¡¼¥¸¤ÎÉôʬ¤Ë x.xx/x.xx/x.xx ¤Èɽ¼¨¤·¤Þ¤¹¡£ ¥Û¥¹¥È¤¬Æ°ºî¤·¤Æ¤¤¤ë¤¬¡¢¤½¤Î¥Û¥¹¥È¤Î \fBgfsd\fR ¤Ø ¥¢¥¯¥»¥¹¤Ç¤­¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï -.--/-.--/-.-- ¤Èɽ¼¨¤·¤Þ¤¹¡£ ¤½¤Î¼¡¤Î°ì·å¤ÎÍó¤Ïǧ¾Ú¼êÃʤǡ¢¡ÖG¡×¤Ï GSI ǧ¾Ú¤ª¤è¤Ó°Å¹æ²½¡¢ ¡Ög¡×¤Ïǧ¾Ú½èÍý¤Î¤ß GSI ¤Çǧ¾Ú¸å¤ÏÊݸî¤Î¤Ê¤¤À¸¥Ç¡¼¥¿ (gsi_auth)¡¢ ¡Ös¡×¤Ï sharedsecret ǧ¾Ú¡¢¡Öx¡×¤Ïǧ¾Ú¼ºÇÔ¡¢¡Ö-¡×¤Ïǧ¾Ú¤ò »î¤ß¤Ê¤«¤Ã¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£¤Þ¤¿¡¢¡Ö-U¡×¥ª¥×¥·¥ç¥ó»ØÄê»þ¤Ë¤Ï¡¢ ¤³¤Îǧ¾Ú¼êÃʤÎɽ¼¨Íó¤Ï¤Ê¤¯¤Ê¤ê¤Þ¤¹¡£ ¥Ç¥Õ¥©¡¼¥ë¥È¤Ç¤Ï¡¢¥Û¥¹¥È̾¤Î¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È½ç¤Çɽ¼¨¤·¤Þ¤¹¡£ .TP \fB-l\fR \fBgfsd\fR ¤ËÌ䤤¹ç¤ï¤»¤ÆÆÀ¤¿¾ðÊó¡¢ ¤¹¤Ê¤ï¤Á¥í¡¼¥É¥¢¥Ù¥ì¡¼¥¸¤ª¤è¤Óǧ¾Ú¼êÃʤȡ¢ ¥á¥¿¥Ç¡¼¥¿¡¦¥µ¡¼¥Ð¡¼¤ËÌ䤤¹ç¤ï¤»¤ÆÆÀ¤¿¾ðÊó¡¢ ¤¹¤Ê¤ï¤Á¥¢¡¼¥­¥Æ¥¯¥Á¥ã̾¡¢CPU¿ô¤ª¤è¤Ó¥Û¥¹¥ÈÊÌ̾¤ò Á´¤ÆÉ½¼¨¤·¤Þ¤¹¡£¤Þ¤¿¥¢¥¯¥»¥¹¤ËÍѤ¤¤é¤ì¤¿¥Û¥¹¥È̾¤Î¸å¤Ë¡¢ IP ¥¢¥É¥ì¥¹¤ò³ç¸Ì¤Ç°Ï¤Ã¤ÆÉ½¼¨¤·¤Þ¤¹¡£ ¥Û¥¹¥È¤¬Ää»ß¤ä¥Í¥Ã¥È¥ï¡¼¥¯¾ã³²¤Î¤¿¤á¤Ë¥¢¥¯¥»¥¹¤Ç¤­¤Ê¤«¤Ã¤¿¾ì¹ç¡¢ ¥í¡¼¥É¥¢¥Ù¥ì¡¼¥¸¤ÎÉôʬ¤Ë x.xx/x.xx/x.xx ¤Èɽ¼¨¤·¤Þ¤¹¡£ ¥Û¥¹¥È¤¬Æ°ºî¤·¤Æ¤¤¤ë¤¬¡¢¤½¤Î¥Û¥¹¥È¤Î \fBgfsd\fR ¤Ø ¥¢¥¯¥»¥¹¤Ç¤­¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï -.--/-.--/-.-- ¤Èɽ¼¨¤·¤Þ¤¹¡£ ¤½¤Î¼¡¤Î°ì·å¤ÎÍó¤Ïǧ¾Ú¼êÃʤǡ¢¡ÖG¡×¤Ï GSI ǧ¾Ú¤ª¤è¤Ó°Å¹æ²½¡¢ ¡Ög¡×¤Ïǧ¾Ú½èÍý¤Î¤ß GSI ¤Çǧ¾Ú¸å¤ÏÊݸî¤Î¤Ê¤¤À¸¥Ç¡¼¥¿ (gsi_auth)¡¢ ¡Ös¡×¤Ï sharedsecret ǧ¾Ú¡¢¡Öx¡×¤Ïǧ¾Ú¼ºÇÔ¡¢¡Ö-¡×¤Ïǧ¾Ú¤ò »î¤ß¤Ê¤«¤Ã¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£¤Þ¤¿¡¢¡Ö-U¡×¥ª¥×¥·¥ç¥ó»ØÄê»þ¤Ë¤Ï¡¢ ¤³¤Îǧ¾Ú¼êÃʤÎɽ¼¨Íó¤Ï¤Ê¤¯¤Ê¤ê¤Þ¤¹¡£ ¥Ç¥Õ¥©¡¼¥ë¥È¤Ç¤Ï¡¢¥Û¥¹¥È̾¤Î¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È½ç¤Çɽ¼¨¤·¤Þ¤¹¡£ .TP \fB-M\fR ¥á¥¿¥Ç¡¼¥¿¤ËÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë¥Û¥¹¥È¾ðÊó¤òɽ¼¨¤·¤Þ¤¹¡£ ¥Ç¥Õ¥©¡¼¥ë¥È¤Ç¤Ï¡¢¥Û¥¹¥È̾¤Î¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È½ç¤Çɽ¼¨¤·¤Þ¤¹¡£ .TP \fB-m\fR ¸ÇÍ­¼±Ê̻ҤȤ·¤ÆÍѤ¤¤é¤ì¤Æ¤¤¤ë¥Û¥¹¥È̾¤ò»ØÄꤷ¡¢¥á¥¿¥Ç¡¼¥¿ ¤ËÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë¥Û¥¹¥È¾ðÊó¤òÊѹ¹¤·¤Þ¤¹¡£ -a ¥ª¥×¥·¥ç¥ó¤ª¤è¤Ó -n ¥ª¥×¥·¥ç¥ó¤Ï¡¢¤½¤ì¤¾¤ì´û¸¤ÎÃͤòÃÖ¤­´¹¤¨¤Þ¤¹¡£ ¤³¤ì¤ËÂФ·¡¢¥Û¥¹¥È¤ÎÊÌ̾¤Ë´Ø¤·¤Æ¤Ï¡¢Äɲäò°ÕÌ£¤·¤Þ¤¹¡£ ÄɲäǤϤʤ¯¡¢ÊÌ̾¤ÎÃÖ¤­´¹¤¨¤äºï½ü¤ò¹Ô¤Ê¤¤¤¿¤¤¾ì¹ç¤Ë¤Ï¡¢-A ¥ª¥×¥·¥ç¥ó ¤ò»ØÄꤷ¤Æ¤¯¤À¤µ¤¤¡£¤³¤Î¾ì¹ç¡¢Á´¤Æ¤ÎÊÌ̾¤òºï½ü¤·¤Æ¤«¤é¡¢(¤â¤·¤¢¤ì¤Ð) °ú¿ô¤Ç»ØÄꤷ¤¿ÊÌ̾¤òÄɲä·¤Þ¤¹¡£ .TP \fB-R\fR ɸ½àÆþÎϤ«¤é¥Û¥¹¥È¤Ë´Ø¤¹¤ë¾ðÊó¤òÆÉ¤ß¹þ¤ß¡¢¥á¥¿¥Ç¡¼¥¿¤Ë Äɲä·¤Þ¤¹¡£Í¿¤¨¤ë¾ðÊó¤Î·Á¼°¤Ï¡¢-M µ¡Ç½¤Îɽ¼¨·Á¼°¤ÈƱ¤¸¤Ç¤¹¡£ .TP \fB-?\fR °ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡£ .SH "OPTIONS" .TP \fB-A\fR -m µ¡Ç½¤Ç¥Û¥¹¥È¾ðÊó¤òÊѹ¹¤¹¤ëºÝ¤Ë¡¢¥Û¥¹¥È¤ÎÊÌ̾¤ò ÄɲäǤϤʤ¯ÃÖ¤­´¹¤¨¤¿¤¤¾ì¹ç¤Ë¡¢¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Þ¤¹¡£ .TP \fB-a \fI¥¢¡¼¥­¥Æ¥¯¥Á¥ã\fB\fR CPU¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤ò¡¢sparc-sun-solaris8 ¤ä i386-redhat8.0-linux ¤Î ¤è¤¦¤Ê·Á¼°¤Ç»ØÄꤷ¤Þ¤¹¡£ -c ¤ª¤è¤Ó -m µ¡Ç½¤Î¾ì¹ç¤Ë¤Ï¡¢Äɲá¦Êѹ¹¤¹¤ë¥Û¥¹¥È¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤È ¤·¤Æ¡¢¤³¤Î¥ª¥×¥·¥ç¥ó¤òÍѤ¤¤Þ¤¹¡£ -H, -l, -M ¤ª¤è¤ÓÆÃ¤Ëµ¡Ç½¤ò»ØÄꤷ¤Ê¤«¤Ã¤¿¾ì¹ç¤Ç¡¢¤«¤Ä ¥Û¥¹¥È̾¤ò¾Êά¤·¤¿¾ì¹ç¤Ë¤Ï¡¢»ØÄꤷ¤¿¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Î¥Û¥¹¥È¤Ë ´Ø¤·¤Æ¤Î¤ßɽ¼¨¤ò¹Ô¤Ê¤¤¤Þ¤¹¡£ .TP \fB-D \fI¥É¥á¥¤¥ó̾\fB\fR -H, -l, -M ¤ª¤è¤ÓÆÃ¤Ëµ¡Ç½¤ò»ØÄꤷ¤Ê¤«¤Ã¤¿¾ì¹ç¤Ç¡¢¤«¤Ä ¥Û¥¹¥È̾¤ò¾Êά¤·¤¿¾ì¹ç¤Ë¡¢¤³¤Î¥ª¥×¥·¥ç¥ó¤Ç¡¢É½¼¨¤¹¤ë¥É¥á¥¤¥ó̾¤ò ¸ÂÄê¤Ç¤­¤Þ¤¹¡£ .TP \fB-i\fR %%SYSCONFDIR%%/gfarm2.conf ¤Ê¤¤¤· $HOME/.gfarm2rc Ãæ¤Ç¡Öaddress_use¡×¤ò»ØÄꤹ¤ë¤È¡¢ ¥¢¥¯¥»¥¹¤ËÍѤ¤¤ë¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¤ËÍ¥Àè½ç°Ì¤ò¤Ä¤±¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ gfhost ¥³¥Þ¥ó¥É¤ËÂФ·¤Æ¤â¡¢¤³¤ÎÍ¥Àè½ç°Ì¤Ï±Æ¶Á¤·¤Þ¤¹¤¬¡¢-i ¥ª¥×¥·¥ç¥ó¤ò ¤Ä¤±¤ë¤È¡¢¤³¤Î»ØÄê¤ò̵»ë¤·¤Æ \fBgfsd\fR ¤Ë¥¢¥¯¥»¥¹ ¤¹¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡£ .TP \fB-j \fIÊÂÎóÅÙ\fB\fR \fBgfsd\fR ¤Ë¥¢¥¯¥»¥¹¤¹¤ëºÝ¤ÎÊÂÎóÅÙ¤ò»ØÄꤷ¤Þ¤¹¡£ ¥Ç¥Õ¥©¡¼¥ë¥È¤Ï 10 ¤Ç¤¹¡£ .TP \fB-L\fR -H¡¢-l µ¡Ç½¤Î¾ì¹ç ¡¢¤³¤Î¥ª¥×¥·¥ç¥ó¤Ç¡¢ ɽ¼¨½ç½ø¤ò¡¢¥í¡¼¥É¥¢¥Ù¥ì¡¼¥¸½ç¤ËÊѹ¹¤·¤Þ¤¹¡£ .TP \fB-n \fICPU¿ô\fB\fR -c ¤ª¤è¤Ó -m µ¡Ç½¤Ç¡¢¥Û¥¹¥È¾ðÊó¤òÄɲá¦Êѹ¹¤¹¤ëºÝ¤Ë¡¢ ¤½¤Î¥Û¥¹¥È¤¬»ý¤Ä CPU ¤Î¿ô¤ò»ØÄꤷ¤Þ¤¹¡£ .TP \fB-p \fI¥Ý¡¼¥ÈÈÖ¹æ\fB\fR -c ¤ª¤è¤Ó -m µ¡Ç½¤Ç¡¢¥Û¥¹¥È¾ðÊó¤òÄɲá¦Êѹ¹¤¹¤ëºÝ¤Ë¡¢ ¤½¤Î¥Û¥¹¥È¤Î \fBgfsd\fR ¤¬ÍѤ¤¤ë¥Ý¡¼¥ÈÈÖ¹æ¤ò»ØÄꤷ¤Þ¤¹¡£ .TP \fB-P \fI¥Ñ¥¹Ì¾\fB\fR ¤³¤Î¥³¥Þ¥ó¥É¤¬¥¢¥¯¥»¥¹¤¹¤ë¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤òÆÃÄꤹ¤ë¤¿¤á¤Î ¥Ñ¥¹Ì¾¤Þ¤¿¤Ï Gfarm URL ¤ò»ØÄꤷ¤Þ¤¹¡£ ¾Êά¤·¤¿¾ì¹ç¤Ï¡¢¡Ö/¡×¤ò»ØÄꤷ¤¿¤Î¤ÈƱ¤¸°ÕÌ£¤Ë¤Ê¤ê¤Þ¤¹¡£ .TP \fB-r\fR ɽ¼¨¤òÀ°Î󤷤Ƥ¤¤ë¾ì¹ç¡¢É½¼¨¤Î½ç½ø¤òµÕ¤Ë¤·¤Þ¤¹¡£ .TP \fB-u\fR -H, -l, -M ¤ª¤è¤ÓÆÃ¤Ëµ¡Ç½¤ò»ØÄꤷ¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¡¢É½¼¨¤¹¤ë½ç½ø¤ò ¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È½ç¤ËÀ°Î󤹤ë¤Î¤ò»ß¤á¤Þ¤¹¡£ -M µ¡Ç½¤Î¾ì¹ç¡¢°ú¿ô¤Ç¥Û¥¹¥È̾¤ò»ØÄꤷ¤¿¾ì¹ç¤Ë¤Ï ¤½¤Î½ç½ø¡¢¤µ¤â¤Ê¤¯¤Ð¥á¥¿¥Ç¡¼¥¿¤«¤é¼èÆÀ¤·¤¿½ç½ø¤Çɽ¼¨¤·¤Þ¤¹¡£ -H, -l µ¡Ç½¤Î¾ì¹ç¤ª¤è¤ÓÆÃ¤Ëµ¡Ç½¤ò»ØÄꤷ¤Ê¤«¤Ã¤¿¾ì¹ç¡¢ ¥Û¥¹¥È¤Ë½ç¤ËÌ䤤¹ç¤ï¤»¤ò¹Ô¤¤¡¢ÊÖ»ö¤ÎÊ֤äƤ­¤¿½ç½ø¤Çɽ¼¨¤·¤Þ¤¹¡£ .TP \fB-U\fR TCP ¤Ë¤è¤ëǧ¾Ú¤ò¤ä¤á¡¢ UDP ¤Ë¤è¤ë¥í¡¼¥É¥¢¥Ù¥ì¡¼¥¸¤ÎÌ䤤¹ç¤ï¤»¤Î¤ß¤ò¹Ô¤¦¤è¤¦¤Ë¤·¤Þ¤¹¡£ ¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢-H ¤Ê¤¤¤· -l µ¡Ç½¤ò»ØÄꤷ¤¿¾ì¹ç¤ª¤è¤Ó ÆÃ¤Ëµ¡Ç½¤ò»ØÄꤷ¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë°ÕÌ£¤Î¤¢¤ë¥ª¥×¥·¥ç¥ó¤Ç¡¢ ¼Â¹Ô®ÅÙ¤¬Â®¤¯¤Ê¤ë¸ú²Ì¤¬¤¢¤ê¤Þ¤¹¡£ -H ¤Ê¤¤¤· -l ¤ò»ØÄꤷ¤Æ¤¤¤ë¾ì¹ç¡¢¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»ØÄꤹ¤ë¤È¡¢ ǧ¾ÚÊý¼°¤Îɽ¼¨Í󤬤ʤ¯¤Ê¤ê¤Þ¤¹¡£ .TP \fB-v\fR -H ¤Ê¤¤¤· -l µ¡Ç½¤ò»ØÄꤷ¤¿¾ì¹ç¤ª¤è¤ÓÆÃ¤Ëµ¡Ç½¤ò»ØÄꤷ¤Ê¤«¤Ã¤¿¾ì¹ç¡¢ ¥Ç¥Õ¥©¡¼¥ë¥È¤Ç¤Ï¡¢gfsd ¤ËÂФ¹¤ëÌ䤤¹ç¤ï¤»¤Ë´Ø¤¹¤ë¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸ ¤òɽ¼¨¤·¤Þ¤»¤ó¡£-v ¥ª¥×¥·¥ç¥ó¤ò»ØÄꤹ¤ë¤È¡¢¤³¤Î¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤ò ɽ¼¨¤¹¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡£ .SH "SEE ALSO" .PP \fBgfarm2.conf\fR(5), \fBgfsd\fR(8) gfarm-2.4.1/man/ja/man1/gfstatus.10000644000000000000000000000075611507222725015246 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFSTATUS" "1" "19 12·î 2008" "Gfarm" "" .SH NAME gfstatus \- Gfarm¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¾ðÊó¤òɽ¼¨¤¹¤ë .SH SYNOPSIS \fBgfstatus\fR .SH "DESCRIPTION" .PP Gfarm¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¾ðÊó¤òɽ¼¨¤·¤Þ¤¹¡¥ gfarm-2.4.1/man/ja/man1/gfmpirun_p4.10000644000000000000000000000332711507222725015635 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFMPIRUN_P4" "1" "20 August 2003" "Gfarm" "" .SH NAME gfmpirun_p4 \- mpirun ¥³¥Þ¥ó¥É¤Î Gfarm ÍÑ¥Õ¥í¥ó¥È¥¨¥ó¥É .SH SYNOPSIS \fBgfmpirun_p4\fR [ \fB\fIoptions\fB\fR ] \fB\fI¥×¥í¥°¥é¥à̾\fB\fR \fB\fI°ú¿ô\fB\fR\fI ...\fR .SH "DESCRIPTION" .PP MPIÊÂÎó¥×¥í¥°¥é¥à¤ò MPICH/p4 ¤ÇÄ󶡤µ¤ì¤ë mpirun ¤òÍøÍѤ·¤Æ¼Â¹Ô ¤·¤Þ¤¹¡¥¼Â¹Ô¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Ï¡¤-G ¥ª¥×¥·¥ç¥ó¡¤-H ¥ª¥×¥·¥ç ¥ó¤¢¤ë¤¤¤Ï -N ¥ª¥×¥·¥ç¥ó¤Ë¤è¤ê·èÄꤵ¤ì¤Þ¤¹¡¥ .PP -G ¥ª¥×¥·¥ç¥ó¡¤-H ¥ª¥×¥·¥ç¥ó¡¤-N ¥ª¥×¥·¥ç¥ó¤ÏƱ»þ¤ËÆó¤Ä°Ê¾å»ØÄꤹ¤ë¤³ ¤È¤Ï¤Ç¤­¤Þ¤»¤ó¡¥¤Þ¤¿¡¤-G ¥ª¥×¥·¥ç¥ó¡¤-H ¥ª¥×¥·¥ç¥ó¡¤-N ¥ª¥×¥·¥ç¥ó¤¬¤¤ ¤º¤ì¤â»ØÄꤵ¤ì¤Ê¤¤¾ì¹ç¤Ï¡¤°ú¿ô¤Ë»ØÄꤵ¤ì¤¿´û¤Ë¸ºß¤¹¤ë Gfarm¥Õ¥¡¥¤¥ë¤Î ¤¦¤Á°ìÈ֤Ϥ¸¤á¤Î¥Õ¥¡¥¤¥ë¤òÍøÍѤ·¤¿¥Õ¥¡¥¤¥ë¡¦¥¢¥Õ¥£¥Ë¥Æ¥£¡¦¥¹¥±¥¸¥å¡¼¥ê ¥ó¥°¤Ë¤è¤ê·èÄꤵ¤ì¤Þ¤¹¡¥ .PP ¥×¥í¥°¥é¥à̾¤È¤·¤Æ¤Ï¡¢gfreg ¥³¥Þ¥ó¥É¤ÇÅÐÏ¿¤·¤¿¥×¥í¥°¥é¥à¤Î gfarm-URL ¤â»ØÄê¤Ç¤­¤Þ¤¹¡£ .SH "OPTIONS" .TP \fB-G \fIgfarm-URL\fB\fR gfarm-URL ¤Î¥Õ¥¡¥¤¥ë¡¦¥¢¥Õ¥£¥Ë¥Æ¥£¡¦¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¤Ë¤è¤ê ÊÂÎó¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤·¤Þ¤¹¡¥ .TP \fB-H \fI¥Û¥¹¥È»ØÄê¥Õ¥¡¥¤¥ë\fB\fR ÊÂÎó¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É·²¤òµ­ºÜ¤·¤¿¥Õ¥¡¥¤¥ë̾¤ò »ØÄꤷ¤Þ¤¹¡¥ ¥Û¥¹¥È̾¤Ï¡¤³Æ¹Ô¤Ë°ì¥Û¥¹¥È¤º¤Äµ­½Ò¤·¤Þ¤¹¡¥ ¥Õ¥¡¥¤¥ë̾¤È¤·¤Æ ``-'' ¤ò»ØÄꤷ¤¿¾ì¹ç¡¤É¸½àÆþÎϤ«¤é¥Û¥¹¥È̾¤Î¥ê¥¹¥È¤ò ÆÉ¤ß¹þ¤ß¤Þ¤¹¡¥ .TP \fB-N \fI¥Î¡¼¥É¿ô\fB\fR ÊÂÎó¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Î¥Î¡¼¥É¿ô¤ò»ØÄꤷ¤Þ¤¹¡¥ ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤ÏÉé²Ù¤Î¾®¤µ¤¤¥Î¡¼¥É¤«¤é½ç¤Ë¥Î¡¼¥É¿ôʬÁª¤Ð¤ì¤Þ¤¹¡¥ .SH "BUGS" .PP ¸½¥Ð¡¼¥¸¥ç¥ó¤Ï¡¢MPICH/p4 ¤È¤ÎÁȹ礻¤Ç¤Ê¤¤¤Èưºî¤·¤Þ¤»¤ó¡£ gfarm-2.4.1/man/ja/man1/gfimport_fixed.10000644000000000000000000000475711507222725016421 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFIMPORT_FIXED" "1" "06 6·î 2003" "Gfarm" "" .SH NAME gfimport_fixed \- ¸ÇÄêĹ¥Ç¡¼¥¿¤ò¥Õ¥é¥°¥á¥ó¥È¤Ëʬ¤±¤Æ¼è¤ê¹þ¤à .SH SYNOPSIS \fBgfimport_fixed\fR [ \fB\fI¥ª¥×¥·¥ç¥ó\fB\fR ] \fB\fIÆþÎÏ¥Õ¥¡¥¤¥ë\fB\fR .SH "DESCRIPTION" .PP °ú¿ô¤Ë»ØÄꤷ¤¿¸ÇÄêĹ¥Ç¡¼¥¿¤«¤é¤Ê¤ë¥Õ¥¡¥¤¥ë¤ò¡¢¥Õ¥é¥°¥á¥ó¥È¤Ëʬ¤±¤Æ Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë¼è¤ê¹þ¤à¥µ¥ó¥×¥ë¡¦¥×¥í¥°¥é¥à¤Ç¤¹¡£ .SH "OPTIONS" .TP \fB-H \fI¥Û¥¹¥È»ØÄê¥Õ¥¡¥¤¥ë\fB\fR ¥Õ¥é¥°¥á¥ó¥È¤òÇÛÃÖ¤¹¤ë¥Û¥¹¥È̾¤Î¥ê¥¹¥È¤òµ­ºÜ¤·¤¿¥Õ¥¡¥¤¥ë̾¤ò»ØÄꤷ¤Þ¤¹¡£ ¥Û¥¹¥È̾¤Ï¡¢³Æ¹Ô¤Ë°ì¥Û¥¹¥È¤º¤Äµ­½Ò¤·¤Þ¤¹¡£ -l ¥ª¥×¥·¥ç¥ó¤ò¾Êά¤·¤¿¾ì¹ç¤Ï¡¢ÆþÎÏ¥Õ¥¡¥¤¥ë¤Ï¡¢¤³¤Î¥ª¥×¥·¥ç¥ó¤Ç »ØÄꤷ¤¿¥Û¥¹¥È¤Ë¡¢Åùʬ³ä¤·¤¿¥Õ¥é¥°¥á¥ó¥È¤È¤·¤ÆÇÛÃÖ¤µ¤ì¤Þ¤¹¡£ ¥Õ¥¡¥¤¥ë̾¤È¤·¤Æ ``-'' ¤ò»ØÄꤷ¤¿¾ì¹ç¡¢É¸½àÆþÎϤ«¤é¥Û¥¹¥È̾¤Î¥ê¥¹¥È¤ò ÆÉ¤ß¹þ¤ß¤Þ¤¹¡£ .TP \fB-f \fI¥Õ¥é¥°¥á¥ó¥È¹½À®¥Õ¥¡¥¤¥ë\fB\fR ³Æ¥Õ¥é¥°¥á¥ó¥È¤Î¤ª¤ª¤è¤½¤Î¥µ¥¤¥º¤È¡¢ÇÛÃÖ¤¹¤ë¥Û¥¹¥È¤òµ­ºÜ¤·¤¿¥Õ¥¡¥¤ ¥ë̾¤ò»ØÄꤷ¤Þ¤¹¡£ ¹½À®¥Õ¥¡¥¤¥ë¤Ï¡¢³Æ¹Ô¤¬¡¢¶õÇò¤Ç¶èÀÚ¤é¤ì¤¿¥µ¥¤¥º¤È¥Û¥¹¥È̾¤«¤é¤Ê¤ë·Á¼°¤Ç¤¹¡£ ¥Õ¥¡¥¤¥ë̾¤È¤·¤Æ ``-'' ¤ò»ØÄꤷ¤¿¾ì¹ç¡¢É¸½àÆþÎϤ«¤é¥Õ¥é¥°¥á¥ó¥È¹½À®¤ò ÆÉ¤ß¹þ¤ß¤Þ¤¹¡£ .TP \fB-l \fI¥ì¥³¡¼¥ÉĹ\fB\fR ¸ÇÄêĹ¥Ç¡¼¥¿¤Î¥ì¥³¡¼¥ÉŤò¥Ð¥¤¥È¿ô¤Ç»ØÄꤷ¤Þ¤¹¡£¥Õ¥é¥°¥á¥ó¥Èʬ³ä¤Ï¡¢ ¤³¤Î¥ì¥³¡¼¥ÉŤÎÀ°¿ôÇܤΰÌÃ֤ǤΤߡ¢¹Ô¤ï¤ì¤Þ¤¹¡£¾Êά»þ¤Î¥ì¥³¡¼¥ÉĹ ¤Ï 1 ¥Ð¥¤¥È¤Ç¤¹¡£ .TP \fB-o \fIgfarm-URL\fB\fR ½ÐÎÏ Gfarm ¥Õ¥¡¥¤¥ë¤Î URL ¤ò»ØÄꤷ¤Þ¤¹¡£ .TP \fB-?\fR °ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡£ .SH "EXAMPLES" .SS "»ØÄꤷ¤¿¸Ä¿ô¤Ëʬ³ä¤·¤Æ¼è¤ê¹þ¤à" .PP °Ê²¼¤Ï¡¢¥Õ¥¡¥¤¥ë¤ò8¸Ä¤Î¥Õ¥é¥°¥á¥ó¥È¤Ëʬ³ä¤·¡¢ ¥Õ¥¡¥¤¥ë \fIgfarm:file\fR ¤È¤·¤Æ¼è¤ê¹þ¤àÎã¤Ç¤¹¡£ .nf gfsched -N 8 | gfimport_fixed -H - -o gfarm:file source_file .fi .SS "½èÍý¤¹¤ë¥×¥í¥°¥é¥à¤ò»ØÄꤷ¡¢ÆÃÄê¤Î¸Ä¿ô¤Ëʬ³ä¤·¤Æ¼è¤ê¹þ¤à" .PP °Ê²¼¤Ï¡¢¥Õ¥¡¥¤¥ë¤ò8¸Ä¤Î¥Õ¥é¥°¥á¥ó¥È¤Ëʬ³ä¤·¡¢ »ØÄꤷ¤¿¥×¥í¥°¥é¥à \fIgfarm:prog\fR ¤ò¼Â¹Ô²Äǽ¤Ê¥Û¥¹¥È¤Ë¡¢ ¥Õ¥¡¥¤¥ë \fIgfarm:file\fR ¤È¤·¤Æ¼è¤ê¹þ¤àÎã¤Ç¤¹¡£ .nf gfsched -N 8 -p gfarm:prog | gfimport_fixed -H - -o gfarm:file source_file .fi .SS "´û¸¤Î GFARM ¥Õ¥¡¥¤¥ë¤ÈƱ¤¸ÇÛÃ֤Ǽè¤ê¹þ¤à" .PP °Ê²¼¤Ï¡¢´û¸¤Î gfarm ¥Õ¥¡¥¤¥ë \fIgfarm:template\fR ¤È Ʊ¤¸¸Ä¿ô¤Î¥Õ¥é¥°¥á¥ó¥È¤Ëʬ³ä¤·¡¢ \fIgfarm:template\fR ¤¬Â¸ºß¤¹¤ë¤Î¤ÈƱ¤¸¥Û¥¹¥È¤Ë¡¢ ¥Õ¥¡¥¤¥ë \fIgfarm:file\fR ¤È¤·¤Æ¼è¤ê¹þ¤àÎã¤Ç¤¹¡£ .nf gfsched gfarm:template | gfimport_fixed -H - -o gfarm:file source_file .fi .SH "SEE ALSO" .PP \fBgfimport_text\fR(1), \fBgfsched\fR(1), \fBgfarm.conf\fR(5) gfarm-2.4.1/man/ja/man1/gfwhoami.10000644000000000000000000000124711507222725015203 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFWHOAMI" "1" "09 April 2004" "Gfarm" "" .SH NAME gfwhoami \- Gfarm ¥°¥í¡¼¥Ð¥ë¥æ¡¼¥¶Ì¾¤òɽ¼¨¤·¤Þ¤¹ .SH SYNOPSIS \fBgfwhoami\fR [ \fB\fI¥ª¥×¥·¥ç¥ó\fB\fR ] .SH "DESCRIPTION" .PP Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¾å¤ÇÍѤ¤¤é¤ì¤ë¥°¥í¡¼¥Ð¥ë¥æ¡¼¥¶Ì¾¤ò ɽ¼¨¤·¤Þ¤¹¡£ .SH "OPTIONS" .TP \fB-v\fR GSI ǧ¾Ú¤òÍѤ¤¤Æ¤¤¤ë¾ì¹ç¡¢ÍøÍѼԤΠSubject DN ¤âɽ¼¨¤·¤Þ¤¹¡£ .TP \fB-h\fR °ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡£ gfarm-2.4.1/man/ja/man1/gfkey.10000644000000000000000000000331511507222725014505 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFKEY" "1" "25 February 2010" "Gfarm" "" .SH NAME gfkey \- Gfarm ¥»¥Ã¥·¥ç¥ó¡¦¥­¡¼´ÉÍý¥³¥Þ¥ó¥É .SH SYNOPSIS \fBgfkey\fR [ \fB\fI¥ª¥×¥·¥ç¥ó\fB\fR ] .SH "DESCRIPTION" .PP ¿®Íꤵ¤ì¤¿´Ä¶­¤Ç gfsd¡¢gfmd ¤ò¶¦Í­ÈëÌ©¸°Ç§¾Ú¤Ç¥¢¥¯¥»¥¹¤¹¤ë¤Î¤Ë ɬÍפʥ»¥Ã¥·¥ç¥ó¡¦¥­¡¼¡¦¥Õ¥¡¥¤¥ë \fB$HOME/.gfarm_shared_key\fR ¤ò°·¤¦¥³¥Þ¥ó¥É¤Ç¤¹¡£ .PP ¥Û¡¼¥à¡¦¥Ç¥£¥ì¥¯¥È¥ê¤ò¶¦Í­¤·¤Æ¤¤¤ë´Ä¶­¤Ç¤Ï¡¢¤³¤Î¥³¥Þ¥ó¥É¤ò»È¤¦É¬Í×À­ ¤Ï¤¢¤Þ¤ê¤¢¤ê¤Þ¤»¤ó¤¬¡¢¤½¤¦¤Ç¤Ê¤¤´Ä¶­¤Ç¤Ï¡¢¤³¤Î¥³¥Þ¥ó¥É¤Ç¥­¡¼¤òÀ¸À®¤· ¤¿¸å¡¢Á´¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Ë¥­¡¼¤òÇÛÉÕ¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£ .SH "OPTIONS" .TP \fB-c\fR ¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»ØÄꤹ¤ë¤È¡¢Í­¸ú¤Ê¥»¥Ã¥·¥ç¥ó¡¦¥­¡¼¤¬¤Ê¤¤¾ì¹ç¤Ë¡¢¥»¥Ã ¥·¥ç¥ó¡¦¥­¡¼¡¦¥Õ¥¡¥¤¥ë¤òºîÀ®¤·¤Þ¤¹¡£´û¤ËÍ­¸ú¤Ê¥»¥Ã¥·¥ç¥ó¡¦¥­¡¼¤¬Â¸ ºß¤¹¤ë¾ì¹ç¤Ë¤Ï²¿¤â¤·¤Þ¤»¤ó¡£ .TP \fB-f\fR ¶¯À©Åª¤Ë¥»¥Ã¥·¥ç¥ó¡¦¥­¡¼¤òºîÀ®¤·¤Þ¤¹¡£ ´û¤ËÍ­¸ú¤Ê¥»¥Ã¥·¥ç¥ó¡¦¥­¡¼¤¬Â¸ºß¤¹¤ë¾ì¹ç¤Ç¤â¡¢¤½¤Î¥­¡¼¤ò¼Î¤Æ¤Æ¿·¤¿ ¤Ë¥­¡¼¤òºîÀ®¤·¤Þ¤¹¡£ .TP \fB-p \fIperiod\fB\fR ¥»¥Ã¥·¥ç¥ó¡¦¥­¡¼¤ÎÍ­¸ú´ü¸Â¤ò»ØÄꤷ¤Þ¤¹¡£Ã±°Ì¤ÏÉäǤ¹¡£ ¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï -c ¥ª¥×¥·¥ç¥ó¤¢¤ë¤¤¤Ï -f ¥ª¥×¥·¥ç¥ó¤ÈƱ»þ¤Ë»ØÄꤹ¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£ .TP \fB-l\fR ¸½ºß¤Î¥­¡¼¤òɽ¼¨¤·¤Þ¤¹¡£ .TP \fB-e\fR ¸½ºß¤Î¥­¡¼¤Î´ü¸Â¤¬ÀÚ¤ì¤ë»þ¹ï¤òɽ¼¨¤·¤Þ¤¹¡£ .TP \fB-L \fImessage-priority-level\fB\fR ¤³¤Î¥ª¥×¥·¥ç¥ó¤Ç»ØÄꤷ¤¿¥ì¥Ù¥ë°Ê¾å¤ÎÍ¥ÀèÅ٤Υá¥Ã¥»¡¼¥¸¤ò½ÐÎϤ·¤Þ¤¹¡£ ¥Ç¥Õ¥©¥ë¥È¤Ïinfo¤Ç¤¹¡£ »ØÄê¤Ç¤­¤ëÃͤÏgfarm2.conf(5)¤Îlog_level¤Î¹à¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£ .TP \fB-?\fR °ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡£ .SH "FILES" .TP \fB\fI$HOME/.gfarm_shared_key\fB\fR ¥»¥Ã¥·¥ç¥ó¡¦¥­¡¼¡¦¥Õ¥¡¥¤¥ë¤Ç¤¹¡£ gfarm-2.4.1/man/ja/man1/gfgroup.10000644000000000000000000000327211507222725015053 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFGROUP" "1" "20 January 2010" "Gfarm" "" .SH NAME gfgroup \- Gfarm ¥°¥ë¡¼¥×´ÉÍý¥³¥Þ¥ó¥É .SH SYNOPSIS \fBgfgroup\fR [ \fB-P \fIpath\fB\fR ] [ \fB-l\fR ] [ \fB\fIgroup\fB\fR\fI ...\fR ] \fBgfgroup\fR [ \fB-P \fIpath\fB\fR ] \fB-c\fR \fBgroupname\fR [ \fB\fIuser\fB\fR\fI ...\fR ] \fBgfgroup\fR [ \fB-P \fIpath\fB\fR ] \fB-m\fR \fBgroupname\fR [ \fB\fIuser\fB\fR\fI ...\fR ] \fBgfgroup\fR [ \fB-P \fIpath\fB\fR ] \fB-d\fR \fBgroupname\fR .SH "DESCRIPTION" .PP Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë¤ª¤±¤ë¥°¥ë¡¼¥×´ÉÍý¤ò¹Ô¤¤¤Þ¤¹¡¥ ¥Ç¥Õ¥©¥ë¥È¤Ç¤ÏÁ´ÅÐÏ¿¥°¥ë¡¼¥×¤òɽ¼¨¤·¤Þ¤¹¡¥ ¥°¥ë¡¼¥×̾¤¬»ØÄꤵ¤ì¤¿¤é¡¤»ØÄꤵ¤ì¤¿¥°¥ë¡¼¥×¤òɽ¼¨¤·¤Þ¤¹¡¥ Gfarm¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î´ÉÍý¼Ô¤Ï¡¤-c¡¤-m¡¤-d ¥ª¥×¥·¥ç¥ó¤ò»ØÄꤹ¤ë¤³¤È¤Ë¤è¤ê¡¤¤½¤ì¤¾¤ì¥°¥ë¡¼¥×ºîÀ®¡¤ ¥°¥ë¡¼¥×¥á¥ó¥ÐÊѹ¹¡¤¥°¥ë¡¼¥×ºï½ü¤ò¹Ô¤¦¤³¤È¤¬¤Ç¤­¤Þ¤¹¡¥ .SH "OPTIONS" .TP \fB-P \fI¥Ñ¥¹Ì¾\fB\fR ¤³¤Î¥³¥Þ¥ó¥É¤¬¥¢¥¯¥»¥¹¤¹¤ë¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤òÆÃÄꤹ¤ë¤¿¤á¤Î ¥Ñ¥¹Ì¾¤Þ¤¿¤Ï Gfarm URL ¤ò»ØÄꤷ¤Þ¤¹¡£ ¾Êά¤·¤¿¾ì¹ç¤Ï¡¢¡Ö/¡×¤ò»ØÄꤷ¤¿¤Î¤ÈƱ¤¸°ÕÌ£¤Ë¤Ê¤ê¤Þ¤¹¡£ .TP \fB-l\fR ¥°¥ë¡¼¥×̾¤È¥°¥ë¡¼¥×¥á¥ó¥Ð¤Î¾ðÊó¤òɽ¼¨¤·¤Þ¤¹¡¥ .TP \fB-c\fR ¥°¥ë¡¼¥×¤ÎºîÀ®¤ò¹Ô¤¤¤Þ¤¹¡¥ ÅÐÏ¿¤Ë¤Ï½é´ü¥°¥ë¡¼¥×¥á¥ó¥Ð¤â»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡¥ Gfarm¤Î´ÉÍý¼Ô¤¬¼Â¹Ô²Äǽ¤Ç¤¹¡¥ .TP \fB-m\fR ¥°¥ë¡¼¥×¥á¥ó¥Ð¤ÎÊѹ¹¤ò¹Ô¤¤¤Þ¤¹¡¥ Êѹ¹¤·¤¿¤¤¥°¥ë¡¼¥×̾¤È¥á¥ó¥Ð¤Î¥ê¥¹¥È»ØÄꤷ¤Þ¤¹¡¥ Gfarm¤Î´ÉÍý¼Ô¤¬¼Â¹Ô²Äǽ¤Ç¤¹¡¥ .TP \fB-d\fR ¥°¥ë¡¼¥×¤ò¾Ãµî¤·¤Þ¤¹¡¥ Gfarm¤Î´ÉÍý¼Ô¤¬¼Â¹Ô²Äǽ¤Ç¤¹¡¥ .TP \fB-?\fR °ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡¥ .SH "SEE ALSO" .PP \fBgfuser\fR(1) gfarm-2.4.1/man/ja/man1/gfwhere.10000644000000000000000000000145511507222725015032 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFWHERE" "1" "14 May 2008" "Gfarm" "" .SH NAME gfwhere \- Gfarm ¥Õ¥¡¥¤¥ë¤Î¥ì¥×¥ê¥«¤Î½êºß¤òɽ¼¨¤¹¤ë¡£ .SH SYNOPSIS \fBgfwhere\fR [ \fB-r, -R\fR ] \fB\fIpath\fB\fR\fI ...\fR .SH "DESCRIPTION" .PP »ØÄꤷ¤¿¥Õ¥¡¥¤¥ë¤Ë¤Ä¤¤¤Æ¡¢¥ì¥×¥ê¥«¤Î½êºß¤òɽ¼¨¤·¤Þ¤¹¡£ -r ¤¢¤ë¤¤¤Ï -R ¥ª¥×¥·¥ç¥ó¤òÉÕ¤±¤ë¤È¡¢ »ØÄꤵ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¤Ë´Þ¤Þ¤ì¤ë¥Õ¥¡¥¤¥ë¤Î¥ì¥×¥ê¥«¤Î½êºß¤ò ºÆµ¢Åª¤Ëɽ¼¨¤·¤Þ¤¹¡£ .SH "OPTIONS" .TP \fB-r, -R\fR ¥Ç¥£¥ì¥¯¥È¥ê¤Ë´Þ¤Þ¤ì¤ë¥Õ¥¡¥¤¥ë¤Î¥ì¥×¥ê¥«¤Î½êºß¤ò ºÆµ¢Åª¤Ëɽ¼¨¤·¤Þ¤¹¡£ .TP \fB-?\fR °ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡£ gfarm-2.4.1/man/ja/man1/gfexec.10000644000000000000000000000171511507222725014643 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFEXEC" "1" "22 April 2004" "Gfarm" "" .SH NAME gfexec \- Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ë .SH SYNOPSIS \fBgfexec\fR [ \fB-N \fI¥Î¡¼¥ÉÁí¿ô\fB\fR ] [ \fB-I \fI¥Î¡¼¥ÉÈÖ¹æ\fB\fR ] [ \fB-s\fR ] \fB\fI¥×¥í¥°¥é¥à̾\fB\fR [ \fB\fI°ú¿ô\fB\fR\fI ...\fR ] .SH "DESCRIPTION" .PP Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤·¤Þ¤¹¡¥ËÜ¥³¥Þ¥ó¥É¤Ï¥Õ¥¡ ¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¾å¤Ç¼Â¹Ô¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡¥ .SH "OPTIONS" .TP \fB-N \fI¥Î¡¼¥É¿ô\fB\fR ¸Æ¤Ó½Ð¤¹¥×¥í¥°¥é¥à¤Î¥Î¡¼¥ÉÁí¿ô¤òÊѹ¹¤·¤Þ¤¹¡¥ .TP \fB-I \fI¥Î¡¼¥ÉÈÖ¹æ\fB\fR ¸Æ¤Ó½Ð¤¹¥×¥í¥°¥é¥à¤Î¥Î¡¼¥ÉÈÖ¹æ¤òÊѹ¹¤·¤Þ¤¹¡¥ .TP \fB-s\fR ¡Ö\fB-N\fR \fI1\fR \fB-I\fR \fI0\fR¡×¤È»ØÄꤷ¤¿¤Î¤ÈÅù²Á¤Ç¤¹¡¥ .TP \fB-?\fR °ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡¥ gfarm-2.4.1/man/ja/man1/Makefile0000644000000000000000000000061011507222725014751 0ustar rootroot# $Id: Makefile 3983 2008-05-27 13:51:18Z tatebe $ top_builddir = ../../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk include $(srcdir)/../Makefile.inc DOCBOOK_DIR=$(top_srcdir)/doc/docbook/ja/ref/man1 include $(DOCBOOK_DIR)/Makefile.inc MAN = $(DOCBOOK) #gfrsh.1 gfssh.1 EXTRA_CLEAN_TARGETS = manpage.links manpage.refs include $(top_srcdir)/makes/man.mk gfarm-2.4.1/man/ja/man1/gfsetdir.10000644000000000000000000000252611507222725015212 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFSETDIR" "1" "02 July 2003" "Gfarm" "" .SH NAME gfsetdir \- Gfarm ºî¶È¥Ç¥£¥ì¥¯¥È¥ê¤òÊѹ¹¤¹¤ë¥³¥Þ¥ó¥ÉÎó¤ò½ÐÎϤ¹¤ë¡£ .SH SYNOPSIS \fBgfsetdir\fR [ \fB-s\fR | \fB-c\fR ] [ \fB\fI¥Ç¥£¥ì¥¯¥È¥ê\fB\fR ] .SH "DESCRIPTION" .PP Gfarm ºî¶È¥Ç¥£¥ì¥¯¥È¥ê¤ò »ØÄꤷ¤¿¥Ç¥£¥ì¥¯¥È¥ê¤ËÊѹ¹¤¹¤ë¥·¥§¥ë¥³ ¥Þ¥ó¥É¤òɸ½à½ÐÎϤ˽ÐÎϤ·¤Þ¤¹¡£¥Ç¥£¥ì¥¯¥È¥ê¤ò»ØÄꤷ¤Ê¤¤¾ì¹ç¤Ï¡¢¥æ¡¼¥¶¤Î Gfarm ¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤¢¤ë gfarm:/\fI¥°¥í¡¼¥Ð¥ë¥æ¡¼¥¶\fR ¤ËÊѹ¹¤¹¤ë ¥³¥Þ¥ó¥É¤ò½ÐÎϤ·¤Þ¤¹¡£ .PP ¥æ¡¼¥¶¤¬»ÈÍѤ·¤Æ¤¤¤ë¥·¥§¥ë¤ò¼«Æ°Åª¤ËȽÄꤷ¤Æ¤½¤Î¥·¥§¥ë¤¬¼Â¹Ô²Äǽ¤Ê ¥³¥Þ¥ó¥É¤ò½ÐÎϤ·¤Þ¤¹¡£ .PP ½ÐÎÏ¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤·¤Æ Gfarm ºî¶È¥Ç¥£¥ì¥¯¥È¥ê¤òÊѹ¹¤¹¤ë \fBgfcd\fR ¤òÍøÍѤ¹¤ë¤¿¤á¤Ë¡¢³Æ¥æ¡¼¥¶¤Î¥·¥§¥ëÀßÄê¥Õ¥¡¥¤¥ë¤Ë°Ê²¼¤ÎÄêµÁ¤òÄɲä·¤Æ ¤¯¤À¤µ¤¤¡£ .TP \fBBourne shell ·Ï¥·¥§¥ë¤Î¾ì¹ç\fR .nf gfcd() { eval "`gfsetdir $1`"; } .fi .TP \fBcsh ·Ï¥·¥§¥ë¤Î¾ì¹ç\fR .nf alias gfcd 'eval `gfsetdir \\!*`' .fi .SH "OPTIONS" .TP \fB-s\fR Bourne shell ·Ï¥·¥§¥ëÍѤΥ³¥Þ¥ó¥É¤ò½ÐÎϤ·¤Þ¤¹¡£ .TP \fB-c\fR csh ·Ï¥·¥§¥ëÍѤΥ³¥Þ¥ó¥É¤ò½ÐÎϤ·¤Þ¤¹¡£ .TP \fB-?\fR °ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡£ .SH "SEE ALSO" .PP \fBgfcd\fR(1), \fBgfpwd\fR(1) gfarm-2.4.1/man/ja/man1/gfcd.10000644000000000000000000000170611507222725014305 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFCD" "1" "02 July 2003" "Gfarm" "" .SH NAME gfcd \- Gfarm ºî¶È¥Ç¥£¥ì¥¯¥È¥ê¤òÊѹ¹¤¹¤ë¡£ .SH SYNOPSIS \fBgfcd\fR [ \fB\fI¥Ç¥£¥ì¥¯¥È¥ê\fB\fR ] .SH "DESCRIPTION" .PP Gfarm ºî¶È¥Ç¥£¥ì¥¯¥È¥ê¤ò »ØÄꤷ¤¿¥Ç¥£¥ì¥¯¥È¥ê¤ËÊѹ¹¤·¤Þ¤¹¡£ ¥Ç¥£¥ì¥¯¥È¥ê¤ò»ØÄꤷ¤Ê¤¤¾ì¹ç¤Ï¡¢¥æ¡¼¥¶¤Î Gfarm ¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤¢¤ë gfarm:/\fI¥°¥í¡¼¥Ð¥ë¥æ¡¼¥¶\fR ¤ËÊѹ¹¤·¤Þ¤¹¡£ .PP ³ÆGfarm ¥³¥Þ¥ó¥É¤¬ºî¶È¥Ç¥£¥ì¥¯¥È¥ê¤ò»²¾È¤Ç¤­¤ë¤è¤¦¤Ë¡¢³Æ¥æ¡¼¥¶¤Î ¥·¥§¥ëÀßÄê¥Õ¥¡¥¤¥ë¤Ë°Ê²¼¤ÎÄêµÁ¤òÄɲ䷤Ƥ¯¤À¤µ¤¤¡£ .TP \fBBourne shell ·Ï¥·¥§¥ë¤Î¾ì¹ç\fR .nf gfcd() { eval "`gfsetdir $1`"; } .fi .TP \fBcsh ·Ï¥·¥§¥ë¤Î¾ì¹ç\fR .nf alias gfcd 'eval `gfsetdir \\!*`' .fi .SH "SEE ALSO" .PP \fBgfpwd\fR(1), \fBgfsetdir\fR(1) gfarm-2.4.1/man/ja/man1/gfchown.10000644000000000000000000000133011507222725015026 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFCHOWN" "1" "21 December 2008" "Gfarm" "" .SH NAME gfchown \- Gfarm ¥Õ¥¡¥¤¥ë¤Î½êÍ­¼Ô¡¤½êÍ­¥°¥ë¡¼¥×¤òÊѹ¹¤¹¤ë .SH SYNOPSIS \fBgfchown\fR [ \fB\fIoptions\fB\fR ] \fBowner[:group]\fR [ \fB\fIpath\fB\fR\fI ...\fR ] \fBgfchown\fR [ \fB\fIoptions\fB\fR ] \fB:group\fR [ \fB\fIpath\fB\fR\fI ...\fR ] .SH "DESCRIPTION" .PP Gfarm ¥Õ¥¡¥¤¥ë¤Î½êÍ­¼Ô¡¤½êÍ­¥°¥ë¡¼¥×¤òÊѹ¹¤·¤Þ¤¹¡¥ .SH "OPTIONS" .TP \fB-?\fR °ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡¥ gfarm-2.4.1/man/ja/man1/gfxattr.10000644000000000000000000000435111507222725015060 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFXATTR" "1" "18 August 2009" "Gfarm" "" .SH NAME gfxattr \- Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥Õ¥¡¥¤¥ë¤Î³Èĥ°À­¤òÁàºî¤¹¤ë .SH SYNOPSIS \fBgfxattr\fR [ \fB-s\fR | \fB-g\fR | \fB-l\fR | \fB-r\fR ] [ \fB-x\fR ] [ \fB-c\fR | \fB-m\fR ] [ \fB-f \fIxattrfile\fB\fR ] \fB\fIfile\fB\fR [ \fB\fIxattrname\fB\fR ] .SH "DESCRIPTION" .PP »ØÄꤷ¤¿¥Õ¥¡¥¤¥ë¤Î³Èĥ°À­¤ª¤è¤ÓXML³Èĥ°À­¤òÁàºî¤·¤Þ¤¹¡¥ ³Èĥ°À­¤Ï°À­Ì¾¤È°À­Ãͤ«¤é¤Ê¤ê¡¤¤¤¤º¤ì¤âǤ°Õ¤Îʸ»úÎó¤Ç¤¹¡¥ XML³Èĥ°À­¤Ï°À­Ãͤ¬XML·¿¤Ç¤¢¤ë³Èĥ°À­¤Ç¤¹¡¥ XML³Èĥ°À­¤ÏÄ̾ï¤Î³Èĥ°À­¤È¤ÏÆÈΩ¤Ë°·¤ï¤ì¤ë¤¿¤á¡¤ Ʊ°ì¤Î°À­Ì¾¤¬ÍøÍѲÄǽ¤Ç¤¹¡¥ .PP XML³Èĥ°À­¤òÁàºî¤¹¤ë¾ì¹ç¡¤-x¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Þ¤¹¡¥ XML³Èĥ°À­¤Ïgffindxmlattr¥³¥Þ¥ó¥É¤òÍøÍѤ¹¤ë¤³¤È¤Ë¤è¤ê XPath¸¡º÷¤ÎÂоݤȤʤê¤Þ¤¹¡¥ .PP ³Èĥ°À­¤ÏGfarm¤ÎÁ´¤Æ¤Î¥Õ¥¡¥¤¥ë¡¤¥Ç¥£¥ì¥¯¥È¥ê¤ËÀßÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡¥ ¥Õ¥¡¥¤¥ë¤òºï½ü¤¹¤ë¤È¡¤¤½¤Î¥Õ¥¡¥¤¥ë¤ËÀßÄꤵ¤ì¤Æ¤¤¤¿³Èĥ°À­¤âÁ´¤Æºï½ü¤µ¤ì¤Þ¤¹¡¥ .PP -s¡¤-g¡¤-l¡¤-r¥ª¥×¥·¥ç¥ó¤Ïɬ¤º²¿¤ì¤«¤¬»ØÄꤵ¤ì¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡¥ .SH "OPTIONS" .TP \fB-s\fR »ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤Ë°À­Ì¾xattrname¤Î³Èĥ°À­¤òÀßÄꤷ¤Þ¤¹¡¥ °À­ÃͤÏ-f¥ª¥×¥·¥ç¥ó¤Ç»ØÄꤵ¤ì¤¿xattrfile¤ÎÆâÍÆ¤È¤Ê¤ê¤Þ¤¹¡¥ -f¥ª¥×¥·¥ç¥ó¤¬»ØÄꤵ¤ì¤Ê¤¤¾ì¹ç¤Ïɸ½àÆþÎϤ«¤é¤ÎÆþÎÏÆâÍÆ¤È¤Ê¤ê¤Þ¤¹¡¥ -c¡¤-m¥ª¥×¥·¥ç¥ó¤¬»ØÄꤵ¤ì¤Ê¤¤¾ì¹ç¡¤ ¤¹¤Ç¤Ë³Èĥ°À­¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Æ¤â¾å½ñ¤­¤µ¤ì¤Þ¤¹¡¥ .TP \fB-g\fR »ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤Î°À­Ì¾xattrname¤Î³Èĥ°À­¤òɽ¼¨¤·¤Þ¤¹¡¥ .TP \fB-l\fR »ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤Î°À­Ì¾¤Î°ìÍ÷¤òɽ¼¨¤·¤Þ¤¹¡¥ .TP \fB-r\fR »ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤Î°À­Ì¾xattrname¤Î³Èĥ°À­¤ò¾Ãµî¤·¤Þ¤¹¡¥ .TP \fB-x\fR XML³Èĥ°À­¤ò½èÍý¤·¤Þ¤¹¡¥ .TP \fB-c\fR -s¥ª¥×¥·¥ç¥ó¤È¶¦¤ËÍѤ¤¤é¤ì¡¤³Èĥ°À­¤ò¿·µ¬¤ËÀßÄꤷ¤Þ¤¹¡¥ ¤³¤Î¤È¤­´û¤Ë³Èĥ°À­¤¬ÀßÄêºÑ¤ß¤Ç¤¢¤ì¤Ð¥¨¥é¡¼¤È¤Ê¤ê¤Þ¤¹¡¥ .TP \fB-m\fR -s¥ª¥×¥·¥ç¥ó¤È¶¦¤ËÍѤ¤¤é¤ì¡¤³Èĥ°À­¤ÎÊѹ¹¤ò¹Ô¤¤¤Þ¤¹¡¥ ¤³¤Î¤È¤­³Èĥ°À­¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¥¨¥é¡¼¤È¤Ê¤ê¤Þ¤¹¡¥ .TP \fB-f xattrfile\fR -s¥ª¥×¥·¥ç¥ó¤È¶¦¤ËÍѤ¤¤ë¤È¡¤»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤«¤é³Èĥ°À­¤òÆÉ¹þ¤ß¤Þ¤¹¡¥ -g¥ª¥×¥·¥ç¥ó¤È¶¦¤ËÍѤ¤¤ë¤È¡¤»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤Ë³Èĥ°À­¤ò½ñ¹þ¤ß¤Þ¤¹¡¥ .TP \fB-?\fR °ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡¥ .SH "SEE ALSO" .PP \fBgffindxmlattr\fR(1) gfarm-2.4.1/man/ja/man1/gfdf.10000644000000000000000000000255011507222725014306 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFDF" "1" "30 December 2010" "Gfarm" "" .SH NAME gfdf \- ¥Ç¥£¥¹¥¯¶õ¤­ÍÆÎ̼èÆÀ .SH SYNOPSIS \fBgfdf\fR [ \fB\fI¥ª¥×¥·¥ç¥ó\fB\fR ] .SH "DESCRIPTION" .PP \fBgfdf\fR ¤Ï¡¢Gfarm¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î ¥Ç¥£¥¹¥¯¶õ¤­ÍÆÎ̤òɽ¼¨¤·¤Þ¤¹¡£ .SH "OPTIONS" .TP \fB-a\fR Gfarm¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥àÁ´ÂΤΥǥ£¥¹¥¯¶õ¤­ÍÆÎ̤òɽ¼¨¤·¤Þ¤¹¡£ .TP \fB-h\fR ¿ô»ú¤ò¡ÖM(¥á¥¬)¡×¤Î¤è¤¦¤Êñ°Ì¤Ä¤­¤ÇÆÉ¤ß¤ä¤¹¤¯É½¼¨¤·¤Þ¤¹¡£ ñ°Ì¤Ë¤Ï2¤ÎÎß¾è¤òÍѤ¤¤Þ¤¹¤Î¤Ç¡¢¡ÖM¡×¤Ï 1,048,576 ¤ò°ÕÌ£¤·¤Þ¤¹¡£ .TP \fB-H\fR ¿ô»ú¤ò¡ÖM(¥á¥¬)¡×¤Î¤è¤¦¤Êñ°Ì¤Ä¤­¤ÇÆÉ¤ß¤ä¤¹¤¯É½¼¨¤·¤Þ¤¹¡£ ñ°Ì¤Ë¤Ï10¤ÎÎß¾è¤òÍѤ¤¤Þ¤¹¤Î¤Ç¡¢¡ÖM¡×¤Ï 1,000,000 ¤ò°ÕÌ£¤·¤Þ¤¹¡£ .TP \fB-n\fR ÍøÍѲÄǽ¤Ê¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Î¥Û¥¹¥È̾¤òɽ¼¨¤·¤Þ¤¹¡£ .TP \fB-r\fR µÕ½ç¤ËÀ°Î󤷤ƽÐÎϤ·¤Þ¤¹¡£ .TP \fB-S\fR ¶õ¤­ÍÆÎ̤νç¤ËÀ°Î󤷤ƽÐÎϤ·¤Þ¤¹¡£ .TP \fB-P \fI¥Ñ¥¹Ì¾\fB\fR »ØÄꤷ¤¿¥Ñ¥¹Ì¾¤Ë¤è¤êÆÃÄê¤Î¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤ò»ØÄꤷ¤Þ¤¹¡¥ ¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï -a ¥ª¥×¥·¥ç¥ó¤ÈƱ»þ¤ËÍøÍѤ¹¤ë¤È̵»ë¤µ¤ì¤Þ¤¹¡¥ .TP \fB-D \fI¥É¥á¥¤¥ó̾\fB\fR »ØÄꤷ¤¿¥É¥á¥¤¥ó̾¤Ë´Þ¤Þ¤ì¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Î¾õÂÖ¤òɽ¼¨¤·¤Þ¤¹¡£ .TP \fB-?\fR °ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡£ .SH "SEE ALSO" .PP \fBgfhost\fR(1), \fBgfarm2.conf\fR(5) gfarm-2.4.1/man/ja/man1/gfimport_text.10000644000000000000000000000445111507222725016275 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFIMPORT_TEXT" "1" "06 6·î 2003" "Gfarm" "" .SH NAME gfimport_text \- ¥Æ¥­¥¹¥È¡¦¥Õ¥¡¥¤¥ë¤ò¥Õ¥é¥°¥á¥ó¥È¤Ëʬ¤±¤Æ¼è¤ê¹þ¤à .SH SYNOPSIS \fBgfimport_text\fR [ \fB\fI¥ª¥×¥·¥ç¥ó\fB\fR ] \fB\fIÆþÎÏ¥Õ¥¡¥¤¥ë\fB\fR .SH "DESCRIPTION" .PP °ú¿ô¤Ë»ØÄꤷ¤¿¥Æ¥­¥¹¥È¡¦¥Õ¥¡¥¤¥ë¤ò¡¢°ì¹Ô¤òÊ£¿ô¤Î¥Õ¥é¥°¥á¥ó¥È¤Ëʬ³ä¤¹ ¤ë¤³¤È¤Î¤Ê¤¤¤è¤¦¤Ëʬ³ä¤·¤Æ Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë¼è¤ê¹þ¤à ¥µ¥ó¥×¥ë¡¦¥×¥í¥°¥é¥à¤Ç¤¹¡£ .SH "OPTIONS" .TP \fB-H \fI¥Û¥¹¥È»ØÄê¥Õ¥¡¥¤¥ë\fB\fR ¥Õ¥é¥°¥á¥ó¥È¤òÇÛÃÖ¤¹¤ë¥Û¥¹¥È̾¤Î¥ê¥¹¥È¤òµ­ºÜ¤·¤¿¥Õ¥¡¥¤¥ë̾¤ò»ØÄꤷ¤Þ¤¹¡£ ¥Û¥¹¥È̾¤Ï¡¢³Æ¹Ô¤Ë°ì¥Û¥¹¥È¤º¤Äµ­½Ò¤·¤Þ¤¹¡£ ÆþÎÏ¥Õ¥¡¥¤¥ë¤Ï¤½¤ì¤¾¤ì¤Î¥Õ¥é¥°¥á¥ó¥È¥µ¥¤¥º¤¬¤Û¤Ü¶ÑÅù¤È¤Ê¤ë¤è¤¦¤Ë ʬ³ä¤µ¤ì¤Þ¤¹¡£ ¥Õ¥¡¥¤¥ë̾¤È¤·¤Æ ``-'' ¤ò»ØÄꤷ¤¿¾ì¹ç¡¢É¸½àÆþÎϤ«¤é¥Û¥¹¥È̾¤Î¥ê¥¹¥È¤ò ÆÉ¤ß¹þ¤ß¤Þ¤¹¡£ .TP \fB-f \fI¥Õ¥é¥°¥á¥ó¥È¹½À®¥Õ¥¡¥¤¥ë\fB\fR ³Æ¥Õ¥é¥°¥á¥ó¥È¤Î¤ª¤ª¤è¤½¤Î¥µ¥¤¥º¤È¡¢ÇÛÃÖ¤¹¤ë¥Û¥¹¥È¤òµ­ºÜ¤·¤¿¥Õ¥¡¥¤ ¥ë̾¤ò»ØÄꤷ¤Þ¤¹¡£ ¹½À®¥Õ¥¡¥¤¥ë¤Ï¡¢³Æ¹Ô¤¬¡¢¶õÇò¤Ç¶èÀÚ¤é¤ì¤¿¥µ¥¤¥º¤È¥Û¥¹¥È̾¤«¤é¤Ê¤ë·Á¼°¤Ç¤¹¡£ ¥Õ¥¡¥¤¥ë̾¤È¤·¤Æ ``-'' ¤ò»ØÄꤷ¤¿¾ì¹ç¡¢É¸½àÆþÎϤ«¤é¥Õ¥é¥°¥á¥ó¥È¹½À®¤ò ÆÉ¤ß¹þ¤ß¤Þ¤¹¡£ .TP \fB-o \fIgfarm-URL\fB\fR ½ÐÎÏ Gfarm ¥Õ¥¡¥¤¥ë¤Î URL ¤ò»ØÄꤷ¤Þ¤¹¡£ .TP \fB-?\fR °ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡£ .SH "EXAMPLES" .SS "»ØÄꤷ¤¿¸Ä¿ô¤Ëʬ³ä¤·¤Æ¼è¤ê¹þ¤à" .PP °Ê²¼¤Ï¡¢¥Õ¥¡¥¤¥ë¤ò8¸Ä¤Î¥Õ¥é¥°¥á¥ó¥È¤Ëʬ³ä¤·¡¢ ¥Õ¥¡¥¤¥ë \fIgfarm:file\fR ¤È¤·¤Æ¼è¤ê¹þ¤àÎã¤Ç¤¹¡£ .nf gfsched -N 8 | gfimport_text -H - -o gfarm:file source_file .fi .SS "½èÍý¤¹¤ë¥×¥í¥°¥é¥à¤ò»ØÄꤷ¡¢ÆÃÄê¤Î¸Ä¿ô¤Ëʬ³ä¤·¤Æ¼è¤ê¹þ¤à" .PP °Ê²¼¤Ï¡¢¥Õ¥¡¥¤¥ë¤ò8¸Ä¤Î¥Õ¥é¥°¥á¥ó¥È¤Ëʬ³ä¤·¡¢ »ØÄꤷ¤¿¥×¥í¥°¥é¥à \fIgfarm:prog\fR ¤ò¼Â¹Ô²Äǽ¤Ê¥Û¥¹¥È¤Ë¡¢ ¥Õ¥¡¥¤¥ë \fIgfarm:file\fR ¤È¤·¤Æ¼è¤ê¹þ¤àÎã¤Ç¤¹¡£ .nf gfsched -N 8 -p gfarm:prog | gfimport_text -H - -o gfarm:file source_file .fi .SS "´û¸¤Î GFARM ¥Õ¥¡¥¤¥ë¤ÈƱ¤¸ÇÛÃ֤Ǽè¤ê¹þ¤à" .PP °Ê²¼¤Ï¡¢´û¸¤Î gfarm ¥Õ¥¡¥¤¥ë \fIgfarm:template\fR ¤È Ʊ¤¸¸Ä¿ô¤Î¥Õ¥é¥°¥á¥ó¥È¤Ëʬ³ä¤·¡¢ \fIgfarm:template\fR ¤¬Â¸ºß¤¹¤ë¤Î¤ÈƱ¤¸¥Û¥¹¥È¤Ë¡¢ ¥Õ¥¡¥¤¥ë \fIgfarm:file\fR ¤È¤·¤Æ¼è¤ê¹þ¤àÎã¤Ç¤¹¡£ .nf gfsched gfarm:template | gfimport_text -H - -o gfarm:file source_file .fi .SH "SEE ALSO" .PP \fBgfimport_fixed\fR(1), \fBgfsched\fR(1), \fBgfarm.conf\fR(5) gfarm-2.4.1/man/ja/man1/gfrsh.10000644000000000000000000000002111507222725014500 0ustar rootroot.so man1/gfrun.1 gfarm-2.4.1/man/ja/man1/gfchmod.10000644000000000000000000000115311507222725015005 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFCHMOD" "1" "21 December 2008" "Gfarm" "" .SH NAME gfchmod \- Gfarm ¥Õ¥¡¥¤¥ë¤Î¥¢¥¯¥»¥¹¸¢¸Â¤òÊѹ¹¤¹¤ë .SH SYNOPSIS \fBgfchmod\fR [ \fB\fIoptions\fB\fR ] \fBmode\fR [ \fB\fIpath\fB\fR\fI ...\fR ] .SH "DESCRIPTION" .PP Gfarm ¥Õ¥¡¥¤¥ë¤Î¥¢¥¯¥»¥¹¸¢¸Â¤òÊѹ¹¤·¤Þ¤¹¡¥ .SH "OPTIONS" .TP \fB-?\fR °ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡¥ gfarm-2.4.1/man/ja/man1/gfls.10000644000000000000000000000276711507222725014345 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFLS" "1" "11 March 2009" "Gfarm" "" .SH NAME gfls \- Gfarm ¥Ç¥£¥ì¥¯¥È¥ê¤ÎÆâÍÆ¤òɽ¼¨¤¹¤ë¡£ .SH SYNOPSIS \fBgfls\fR [ \fB\fI¥ª¥×¥·¥ç¥ó\fB\fR ] [ \fB\fIpath\fB\fR\fI ...\fR ] .SH "DESCRIPTION" .PP path ¤Ë»ØÄꤷ¤¿¥Õ¥¡¥¤¥ë¤Ê¤¤¤·¥Ç¥£¥ì¥¯¥È¥ê¤Î̾Á°¤È ´ØÏ¢¤¹¤ë¾ðÊó¤òɽ¼¨¤·¤Þ¤¹¡£ .SH "OPTIONS" .TP \fB-a\fR ``.''¤Ç»Ï¤Þ¤ë¥Ñ¥¹Ì¾¤âɽ¼¨¤·¤Þ¤¹¡£ .TP \fB-A\fR ``.''¤È``..''¤Ïɽ¼¨¤·¤Þ¤»¤ó¡£ .TP \fB-C\fR ¥Þ¥ë¥Á¥«¥é¥à½ÐÎϤò¹Ô¤Ê¤¤¤Þ¤¹¡£¤³¤ì¤Ï¥Ç¥Õ¥©¥ë¥È¤Î½ÐÎÏ·Á¼°¤Ç¤¹¡£ .TP \fB-d\fR ¤½¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë°¤¹¤ëÆâÍÆ¤Ç¤Ï¤Ê¤¯¡¢¥Ç¥£¥ì¥¯¥È¥ê¼«¿È¤òɽ¼¨¤·¤Þ¤¹¡£ .TP \fB-E \fIÉÿô\fB\fR °À­¥­¥ã¥Ã¥·¥å¤òÊÝ»ý¤¹¤ëÉÿô¤ò»ØÄꤷ¤Þ¤¹¡£ 0 ¤ò»ØÄꤷ¤¿¾ì¹ç¡¢Â°À­¤ò¥­¥ã¥Ã¥·¥å¤·¤Þ¤»¤ó¡£ .TP \fB-F\fR ̾¾Î¤Îľ¸å¤Ë¡¢¤½¤Î¼ïÎà¤òɽ¤¹Ê¸»ú (*/=@| ¤Î¤¤¤º¤ì¤«) ¤òɽ¼¨¤·¤Þ¤¹¡£ .TP \fB-i\fR inode ÈÖ¹æ¤âɽ¼¨¤·¤Þ¤¹¡£ .TP \fB-l\fR ¥Õ¥¡¥¤¥ë¤Î¥µ¥¤¥º¡¢½êÍ­¼Ô¡¢¥°¥ë¡¼¥×¡¢¹¹¿·»þ¹ï¤Ê¤É¤Î°À­¾ðÊó¤â ɽ¼¨¤·¤Þ¤¹¡£ .TP \fB-r\fR µÕ½ç¤ËÀ°Îó¤·¤ÆÉ½¼¨¤·¤Þ¤¹¡£ .TP \fB-R\fR ¥Ç¥£¥ì¥¯¥È¥ê¤ÎÆâÍÆ¤òºÆµ¢Åª¤Ëɽ¼¨¤·¤Þ¤¹¡£ .TP \fB-S\fR ¥Õ¥¡¥¤¥ë¥µ¥¤¥º¤ÇÀ°Îó¤·¤Þ¤¹¡£ .TP \fB-t\fR ¥Õ¥¡¥¤¥ë̾¤Ç¤Ï¤Ê¤¯¡¢¥Õ¥¡¥¤¥ë¤Î»þ¹ï¤ò´ð½à¤ËÀ°Îó¤·¤Þ¤¹¡£ .TP \fB-T\fR \fB-l\fR ¥ª¥×¥·¥ç¥ó¤ÈƱ»þ¤Ë»ØÄꤹ¤ë¤È¡¢»þ¹ï¤ò´°Á´¤Ê·Á¼°¤Çɽ¼¨¤·¤Þ¤¹¡£ .TP \fB-1\fR 1¹Ô¤Ë1¥¨¥ó¥È¥ê¤º¤Äɽ¼¨¤·¤Þ¤¹¡£ .TP \fB-?\fR °ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡£ gfarm-2.4.1/man/ja/man1/gfrun.10000644000000000000000000001021111507222725014512 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFRUN" "1" "13 November 2006" "Gfarm" "" .SH NAME gfrun, gfrsh, gfssh \- ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Ç gfarm ÊÂÎó¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤¹¤ë .SH SYNOPSIS \fBgfrun\fR [ \fB\fI¥ª¥×¥·¥ç¥ó\fB\fR ] \fB\fI¥×¥í¥°¥é¥à̾\fB\fR \fB\fI°ú¿ô\fB\fR\fI ...\fR \fBgfrsh\fR [ \fB\fI¥ª¥×¥·¥ç¥ó\fB\fR ] \fB\fI¥×¥í¥°¥é¥à̾\fB\fR \fB\fI°ú¿ô\fB\fR\fI ...\fR \fBgfssh\fR [ \fB\fI¥ª¥×¥·¥ç¥ó\fB\fR ] \fB\fI¥×¥í¥°¥é¥à̾\fB\fR \fB\fI°ú¿ô\fB\fR\fI ...\fR .SH "DESCRIPTION" .PP ÊÂÎó¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤·¤Þ¤¹¡¥¼Â¹Ô¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Ï¡¤ -G ¥ª¥×¥·¥ç¥ó¡¤-H ¥ª¥×¥·¥ç¥ó¤¢¤ë¤¤¤Ï -N ¥ª¥×¥·¥ç¥ó¤Ë¤è¤ê·èÄꤵ¤ì¤Þ¤¹¡¥ .PP -G ¥ª¥×¥·¥ç¥ó¤Ï¥Õ¥¡¥¤¥ë¡¦¥¢¥Õ¥£¥Ë¥Æ¥£¡¦¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¤Î¤¿¤á¤Î Gfarm ¥Õ¥¡¥¤¥ë \fIgfarm-URL\fR ¤ò»ØÄꤷ¤Þ¤¹¡¥ ¥Õ¥¡¥¤¥ë¡¦¥¢¥Õ¥£¥Ë¥Æ¥£¡¦¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¤Ç¤Ï¡¤»ØÄꤵ¤ì¤¿ Gfarm ¥Õ¥¡¥¤¥ë¤Î¤½¤ì¤¾¤ì¤Î¥Õ¥¡¥¤¥ëÃÇÊÒ¤ËÂФ·¡¤Ê£À½¤¬³ÊǼ¤µ¤ì¤Æ¤¤¤ë ¥Î¡¼¥É¤Î¤¦¤Á°ì¥Î¡¼¥É¤¬Áª¤Ð¤ì¤Þ¤¹¡¥¤Ä¤Þ¤ê¡¤¥Õ¥¡¥¤¥ëÃÇÊҤοô¤È Ʊ¿ô¤Î¥×¥í¥»¥¹¤¬¡¤¥Õ¥¡¥¤¥ëÃÇÊÒ¤ò³ÊǼ¤·¤Æ¤¤¤ë¥Î¡¼¥É¤Ç¼Â¹Ô¤µ¤ì ¤ë¤È¤¤¤¦¤³¤È¤Ë¤Ê¤ê¤Þ¤¹¡¥ -H ¥ª¥×¥·¥ç¥ó¤Ï \fI¥Û¥¹¥È»ØÄê¥Õ¥¡¥¤¥ë\fR ¤ò»ØÄꤷ¤Þ¤¹¡¥ ¤³¤Î¾ì¹ç¡¤¤½¤Î¥Õ¥¡¥¤¥ë¤Ëµ­½Ò¤µ¤ì¤¿¥Î¡¼¥É¤ÇÊÂÎó¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤·¤Þ¤¹¡¥ -N ¥ª¥×¥·¥ç¥ó¤Ï¼Â¹Ô¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Î \fI¥Î¡¼¥É¿ô\fR ¤ò»ØÄꤷ¤Þ¤¹¡¥ .PP -G ¥ª¥×¥·¥ç¥ó¡¤-H ¥ª¥×¥·¥ç¥ó¡¤-N ¥ª¥×¥·¥ç¥ó¤ÏƱ»þ¤ËÆó¤Ä°Ê¾å»ØÄꤹ¤ë¤³ ¤È¤Ï¤Ç¤­¤Þ¤»¤ó¡¥¤Þ¤¿¡¤-G ¥ª¥×¥·¥ç¥ó¡¤-H ¥ª¥×¥·¥ç¥ó¡¤-N ¥ª¥×¥·¥ç¥ó¤¬¤¤ ¤º¤ì¤â»ØÄꤵ¤ì¤Ê¤¤¾ì¹ç¤Ï¡¤°ú¿ô¤Ë»ØÄꤵ¤ì¤¿´û¤Ë¸ºß¤¹¤ë Gfarm¥Õ¥¡¥¤¥ë¤Î ¤¦¤Á°ìÈ֤Ϥ¸¤á¤Î¥Õ¥¡¥¤¥ë¤òÍøÍѤ·¤¿¥Õ¥¡¥¤¥ë¡¦¥¢¥Õ¥£¥Ë¥Æ¥£¡¦¥¹¥±¥¸¥å¡¼¥ê ¥ó¥°¤Ë¤è¤ê·èÄꤵ¤ì¤Þ¤¹¡¥°ú¿ôÃæ¤Ë´û¤Ë¸ºß¤¹¤ë Gfarm ¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Ê ¤¤¾ì¹ç¤Ï¡¤Å¬Åö¤Ê¥Î¡¼¥É¤¬1 ¥Î¡¼¥ÉÁªÂò¤µ¤ì¡¤Ã༡¼Â¹Ô¤È¤Ê¤ê¤Þ¤¹¡¥ .PP gfrsh ¤ä gfssh ¥³¥Þ¥ó¥É¤Ï¡¤gfrcmd ¤ÎÂå¤ï¤ê¤Ë rsh¡¤ssh ¤ò ÍøÍѤ¹¤ë¤³¤È¤ò½ü¤¤¤Æ¡¤gfrun ¤ÈƱÍͤǤ¹¡¥ .PP ¥×¥í¥°¥é¥à̾¤È¤·¤Æ¤Ï¡¤gfreg ¥³¥Þ¥ó¥É¤ÇÅÐÏ¿¤·¤¿¥×¥í¥°¥é¥à¤Î gfarm-URL ¤â»ØÄê¤Ç¤­¤Þ¤¹¡¥ .SH "OPTIONS" .TP \fB-G \fIgfarm-URL\fB\fR gfarm-URL ¤Î¥Õ¥¡¥¤¥ë¡¦¥¢¥Õ¥£¥Ë¥Æ¥£¡¦¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¤Ë¤è¤ê ÊÂÎó¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤·¤Þ¤¹¡¥ ¥Õ¥¡¥¤¥ë¡¦¥¢¥Õ¥£¥Ë¥Æ¥£¡¦¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¤Îưºî¤Ë¤Ä¤¤¤Æ¤Ï¡¤DESCRIPTION Àá¤ò »²¾È¤·¤Æ¤¯¤À¤µ¤¤¡¥ .TP \fB-H \fI¥Û¥¹¥È»ØÄê¥Õ¥¡¥¤¥ë\fB\fR ÊÂÎó¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É·²¤òµ­ºÜ¤·¤¿¥Õ¥¡¥¤¥ë̾¤ò »ØÄꤷ¤Þ¤¹¡¥ ¥Û¥¹¥È̾¤Ï¡¤³Æ¹Ô¤Ë°ì¥Û¥¹¥È¤º¤Äµ­½Ò¤·¤Þ¤¹¡¥ ¥Õ¥¡¥¤¥ë̾¤È¤·¤Æ ``-'' ¤ò»ØÄꤷ¤¿¾ì¹ç¡¤É¸½àÆþÎϤ«¤é¥Û¥¹¥È̾¤Î¥ê¥¹¥È¤ò ÆÉ¤ß¹þ¤ß¤Þ¤¹¡¥ .TP \fB-N \fI¥Î¡¼¥É¿ô\fB\fR ÊÂÎó¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Î¥Î¡¼¥É¿ô¤ò»ØÄꤷ¤Þ¤¹¡¥ ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤ÏÉé²Ù¤Î¾®¤µ¤¤¥Î¡¼¥É¤«¤é½ç¤Ë¥Î¡¼¥É¿ôʬÁª¤Ð¤ì¤Þ¤¹¡¥ .TP \fB-r\fR ¥Õ¥¡¥¤¥ë¤ò±ó³Ö»²¾È¤¹¤ë¾ì¹ç¡¤»²¾È¤ËÀèΩ¤Á¼«¥Û¥¹¥È¤Ë¥Õ¥¡¥¤¥ëÊ£À½¤ò ºîÀ®¤·¤Þ¤¹¡¥ .TP \fB-o \fIgfarm-URL\fB\fR ¼Â¹Ô¤µ¤ì¤ëÊÂÎó¥×¥í¥°¥é¥à¤Îɸ½à½ÐÎϤò gfarm-URL ¤Ë½ñ¤­½Ð¤·¤Þ¤¹¡¥ .TP \fB-e \fIgfarm-URL\fB\fR ¼Â¹Ô¤µ¤ì¤ëÊÂÎó¥×¥í¥°¥é¥à¤Îɸ½à¥¨¥é¡¼½ÐÎϤò gfarm-URL ¤Ë½ñ¤­½Ð¤·¤Þ¤¹¡¥ .TP \fB-I \fI¥Õ¥é¥°¥á¥ó¥ÈÈÖ¹æ\fB\fR »ØÄꤵ¤ì¤¿¥Õ¥é¥°¥á¥ó¥ÈÈÖ¹æ¤Î¥×¥í¥»¥¹¤À¤±¤¬¼Â¹Ô¤µ¤ì¤Þ¤¹¡¥ ¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¤\fB-G\fR ¥ª¥×¥·¥ç¥ó¤¢¤ë¤¤¤Ï°ú¿ô¤ËÍ¿¤¨¤¿ Gfarm ¥Õ¥¡¥¤¥ë¤Ë¤è¤Ã¤Æ¡¤¥Õ¥¡¥¤¥ë¡¦¥¢¥Õ¥£¥Ë¥Æ¥£¡¦¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¤¬ÁªÂò¤µ¤ì¤Æ¤¤¤ë ¾ì¹ç¡¤¤ª¤è¤Ó \fB-N\fR ¥ª¥×¥·¥ç¥ó¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Î¤ßÍø ÍѲÄǽ¤Ç¤¹¡¥ .TP \fB-v\fR ¾ÜºÙ¤Ë¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤òɽ¼¨¤·¤Þ¤¹¡¥ .TP \fB-p\fR ¥×¥í¥°¥é¥à¼Â¹Ô¸å¤Ë Gfarm ÊÂÎóI/O API¤Î½êÍ×»þ´Ö¤òɽ¼¨¤·¤Þ¤¹¡¥ .TP \fB-g\fR ¼Â¹Ô¤µ¤ì¤ë¥×¥í¥°¥é¥à¤ò gfarm ²½¤µ¤ì¤¿¥×¥í¥°¥é¥à¤À¤ÈÌÀ¼¨Åª¤Ë»ØÄꤷ¤Þ¤¹¡¥ ¤³¤Î·ë²Ì¡¤¥×¥í¥°¥é¥à¤Ë¤Ï Gfarm ÆÃÍ­¤Î¥ª¥×¥·¥ç¥ó¤¬ÅϤµ¤ì¤Þ¤¹¡¥ .TP \fB-u\fR ¼Â¹Ô¤µ¤ì¤ë¥×¥í¥°¥é¥à¤òÄ̾ï¤Î¥×¥í¥°¥é¥à¤Ç¤¢¤ë¤ÈÌÀ¼¨Åª¤Ë»ØÄꤷ¤Þ¤¹¡¥ ¤³¤Î¾ì¹ç¡¤¥×¥í¥°¥é¥à¤Ë Gfarm ÆÃÍ­¤Î¥ª¥×¥·¥ç¥ó¤¬ÅϤµ¤ì¤ë¤³¤È¤Ï¤¢¤ê¤Þ¤»¤ó¡¥ .TP \fB-b\fR Gfarm ¥·¥¹¥Æ¥à¥³¡¼¥ë¡¦¥Õ¥Ã¥¯¡¦¥é¥¤¥Ö¥é¥ê¤òÍøÍѤ·¤Æ¼Â¹Ô¤µ¤ì¤ë¥×¥í¥°¥é¥à¤Ë¤ª¤¤¤Æ¡¤ ¥Ç¥Õ¥©¥ë¥È¤Î¥Õ¥¡¥¤¥ë¡¦¥Ó¥å¡¼¤ò¥°¥í¡¼¥Ð¥ë¡¦¥Õ¥¡¥¤¥ë¡¦¥Ó¥å¡¼¤ËÀßÄꤷ¤Þ¤¹¡¥ ¤³¤Î¥ª¥×¥·¥ç¥ó¤ò¤Ä¤±¤Ê¤¤¤È¡¤ ¥Ç¥Õ¥©¥ë¥È¤Î¥Õ¥¡¥¤¥ë¡¦¥Ó¥å¡¼¤Ï¥í¡¼¥«¥ë¡¦¥Õ¥¡¥¤¥ë¡¦¥Ó¥å¡¼¤È¤Ê¤ê¤Þ¤¹¡¥ .TP \fB-?\fR °ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡¥ .SH "ENVIROMNENT VARIABLES" .TP \fBGFRUN_CMD\fR ±ó³Öµ¯Æ°¥³¥Þ¥ó¥É¤ò»ØÄꤷ¤Þ¤¹¡¥Î㤨¤Ð globus-job-run ¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¤ gfrun ¤Ï globus-job-run ¤ò»È¤Ã¤Æ¤½¤ì¤¾¤ì¤Î¥×¥í¥»¥¹¤òµ¯Æ°¤·¤Þ¤¹¡¥ gfarm-2.4.1/man/ja/man1/gfln.10000644000000000000000000000132611507222725014326 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFLN" "1" "19 March 2009" "Gfarm" "" .SH NAME gfln \- ¥Ï¡¼¥É¥ê¥ó¥¯¡¤¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤òºîÀ®¤¹¤ë .SH SYNOPSIS \fBgfln\fR [ \fB\fIoptions\fB\fR ] \fBtarget\fR \fBlink_name\fR .SH "DESCRIPTION" .PP \fItarget\fR¤ËÂФ¹¤ë¥Ï¡¼¥É¥ê¥ó¥¯¤ò \fIlink_name\fR¤ËºîÀ®¤·¤Þ¤¹¡¥ -s ¥ª¥×¥·¥ç¥ó¤¬»ØÄꤵ¤ì¤ë¤È¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤òºîÀ®¤·¤Þ¤¹¡¥ .SH "OPTIONS" .TP \fB-s\fR ¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤òºîÀ®¤·¤Þ¤¹¡¥ .TP \fB-?\fR °ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡¥ gfarm-2.4.1/man/ja/man1/gfarm_agent.10000644000000000000000000000413711507222725015655 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFARM_AGENT" "1" "07 November 2006" "Gfarm" "" .SH NAME gfarm_agent \- Gfarm ¥á¥¿¥Ç¡¼¥¿¥­¥ã¥Ã¥·¥å¥µ¡¼¥Ð .SH SYNOPSIS \fBgfarm_agent\fR [ \fB\fI¥ª¥×¥·¥ç¥ó\fB\fR ] .SH "DESCRIPTION" .PP \fBgfarm_agent\fR ¤Ï¡¢ Ê£¿ô¥Î¡¼¥É¡¢Ê£¿ô¥æ¡¼¥¶¤Ç¶¦Í­²Äǽ¤Ê Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¡¦¥á¥¿¥Ç¡¼¥¿¤Î¥­¥ã¥Ã¥·¥å¥µ¡¼¥Ð¤Ç¤¹¡£ ¥­¥ã¥Ã¥·¥å¥µ¡¼¥Ð¤Ë¤è¤ê¡¢ ±ó³Ö¤Î¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤ËÂФ¹¤ë̵Â̤ʥͥåȥ¥¯Å¾Á÷¤¬ÍÞÀ©¤µ¤ì¡¢ Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ËÂФ¹¤ë¥ì¥¹¥Ý¥ó¥¹¤òÂçÉý¤Ë²þÁ±¤·¤Þ¤¹¡£ .PP \fBgfarm_agent\fR ¤Ï¡¢ Ʊ»þ¤ËÊ£¿ô¤Î¥Î¡¼¥É¤Ç¼Â¹Ô¤¹¤ë¤³¤È¤¬²Äǽ¤Ç¤¹¡£ ¤½¤Î¾ì¹ç¡¢Ê£¿ô¤Î \fBgfarm_agent\fR ¤ª¤è¤Ó Gfarm ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð´Ö¤Î°ì´ÓÀ­¤ÏÊݾڤµ¤ì¤Þ¤¹¡£ .SH "OPTIONS" .TP \fB-L \fI¥í¥°¥ì¥Ù¥ë\fB\fR ¤³¤Î¥ª¥×¥·¥ç¥ó¤Ç»ØÄꤷ¤¿¥ì¥Ù¥ë°Ê¾å¤ÎÍ¥ÀèÅÙ¤Î¥í¥°¤ò½ÐÎϤ·¤Þ¤¹¡£ »ØÄê¤Ç¤­¤ëÃÍ¤Ï gfarm.conf(5) ¤Î log_level ¤Î¹à¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£ .TP \fB-P \fIPID¥Õ¥¡¥¤¥ë\fB\fR \fBgfarm_agent\fR ¤Î process ID ¤ò¡¢ »ØÄꤷ¤¿¥Õ¥¡¥¤¥ë¤Ëµ­Ï¿¤·¤Þ¤¹¡£ .TP \fB-S \fIsyslog¥Õ¥¡¥·¥ê¥Æ¥£\fB\fR \fBgfarm_agent\fR ¤¬¥¨¥é¡¼Êó¹ð¤ËÍѤ¤¤ë syslog ¤Î¥Õ¥¡¥·¥ê¥Æ¥£¤ò»ØÄꤷ¤Þ¤¹¡£ ¾Êά¤·¤¿¾ì¹ç¤Ë¤Ï¡¢local0 ¤ò»ÈÍѤ·¤Þ¤¹¡£ .TP \fB-d\fR ¥Ç¥Ð¥Ã¥°¥ª¥×¥·¥ç¥ó¤Ç¤¹¡£¥Ç¡¼¥â¥ó¤È¤·¤Æ¤Ç¤Ï¤Ê¤¯¡¢¥Õ¥©¥¢¥°¥é¥¦¥ó¥É¡¦ ¥×¥í¥»¥¹¤È¤·¤ÆÎ©¤Á¾å¤¬¤ê¤Þ¤¹¡£ ¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¡¢¤«¤Ä \fB-L\fR ¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Ê¤«¤Ã¤¿ ¾ì¹ç¡¢¥í¥°¥ì¥Ù¥ë¤Ï debug ¤È¤Ê¤ê¤Þ¤¹¡£ .TP \fB-f \fIÀßÄê¥Õ¥¡¥¤¥ë\fB\fR µ¯Æ°»þ¤ËÆÉ¤ß¹þ¤àÀßÄê¥Õ¥¡¥¤¥ë¤ò»ØÄꤷ¤Þ¤¹¡£ .TP \fB-m\fR ñ°ì¤Î \fBgfarm_agent\fR ¤òÍøÍѤ¹¤ë¾ì¹ç¤ËÍøÍѲÄǽ¤Ç¤¹¡£ ¤³¤Î¥ª¥×¥·¥ç¥ó¤òÍøÍѤ¹¤ë¤È¥Ñ¥¹¾ðÊó¤â¥­¥ã¥Ã¥·¥å¤¹¤ë¤è¤¦¤Ë¤Ê¤ë¤¿¤á¡¢ ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤Ø¤Î¥¢¥¯¥»¥¹¿ô¤¬¸º¤ê¡¢¹â®¤Ë¤Ê¤ê¤Þ¤¹¡£ .TP \fB-p \fI¥Ý¡¼¥ÈÈÖ¹æ\fB\fR gfarm_agent ¤¬ÍøÍѤ¹¤ë TCP ¤Î¥Ý¡¼¥ÈÈÖ¹æ¤ò»ØÄꤷ¤Þ¤¹¡£ .TP \fB-v\fR ǧ¾Ú»þ¤Î¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤Î¾ÜºÙ¤òɽ¼¨¤·¤Þ¤¹¡£ .TP \fB-?\fR °ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡£ .SH "FILES" .TP \fB\fI%%SYSCONFDIR%%/gfarm.conf\fB\fR gfarm_agent ¤¬»²¾È¤¹¤ëÀßÄê¥Õ¥¡¥¤¥ë¤Ç¤¹¡£ .SH "SEE ALSO" .PP \fBgfarm.conf\fR(5) gfarm-2.4.1/man/ja/man1/gfmv.10000644000000000000000000000114511507222725014336 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFMV" "1" "21 December 2008" "Gfarm" "" .SH NAME gfmv \- Gfarm ¥Õ¥¡¥¤¥ë¤ò̾¾ÎÊѹ¹¡¤°Üư¤¹¤ë .SH SYNOPSIS \fBgfmv\fR [ \fB\fIoptions\fB\fR ] \fBsrc\fR \fBdest\fR .SH "DESCRIPTION" .PP Gfarm ¥Õ¥¡¥¤¥ë¤ò\fIsrc\fR¤«¤é \fIdest\fR¤Ë̾¾ÎÊѹ¹¤¢¤ë¤¤¤Ï°Üư¤·¤Þ¤¹¡¥ .SH "OPTIONS" .TP \fB-?\fR °ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡¥ gfarm-2.4.1/man/ja/man1/gfsched.10000644000000000000000000000624611507222725015011 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFSCHED" "1" "28 December 2010" "Gfarm" "" .SH NAME gfsched \- ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤ò¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¤·¡¢ÍøÍѲÄǽ¤Ê¥Î¡¼¥É¤òɽ¼¨ .SH SYNOPSIS \fBgfsched\fR \fB-f \fIgfarm-URL\fB\fR [ \fB-D \fI¥É¥á¥¤¥ó̾\fB\fR ] [ \fB-n \fI¥Î¡¼¥É¿ô\fB\fR ] [ \fB-LMclw\fR ] \fBgfsched\fR [ \fB-P \fIgfarm-URL\fB\fR ] [ \fB-D \fI¥É¥á¥¤¥ó̾\fB\fR ] [ \fB-n \fI¥Î¡¼¥É¿ô\fB\fR ] [ \fB-LMlw\fR ] .SH "DESCRIPTION" .PP \fBgfsched\fR ¤Ë \fB-f\fR \fIgfarm-URL\fR ¥ª¥×¥·¥ç¥ó¤ò »ØÄꤷ¤¿¾ì¹ç¡¢¤½¤Îgfarm¥Õ¥¡¥¤¥ë¤òÊÝ»ý¤¹¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Î ¤¦¤Á¤Ç¡¢¸½ºßÍøÍѲÄǽ¤Ê¤â¤Îɽ¼¨¤·¤Þ¤¹¡£ .PP \fB-f\fR¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Ê¤«¤Ã¤¿¾ì¹ç¡¢ÍøÍѲÄǽ¤Ê ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤òɽ¼¨¤·¤Þ¤¹¡£¤³¤Î¾ì¹ç¡¢ \fB-P\fR \fIgfarm-URL\fR ¥ª¥×¥·¥ç¥ó¤Ç ¥Ñ¥¹Ì¾¤« gfarm URL ¤ò»ØÄꤹ¤ë¤³¤È¤Ë¤è¤ê¡¢É½¼¨ÂоݤΥ᥿¥Ç¡¼¥¿¥µ¡¼¥Ð¤ò ÀÚÂØ¤¨¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ .SH "OPTIONS" .TP \fB-D \fI¥É¥á¥¤¥ó̾\fB\fR ¥É¥á¥¤¥ó̾¤Ê¤¤¤·¥Û¥¹¥È̾¤ò»ØÄꤷ¡¢¸¡º÷ÂоݤΥե¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤ò ¹Ê¤ê¤Þ¤¹¡£ .TP \fB-L\fR ¤½¤Î¥Û¥¹¥È¤ËÂФ·¤Æ¡¢Ç§¾Ú¤¬À®¸ù¤¹¤ë¤«Èݤ«¤Î³Îǧ¤ò¾Êά¤·¤Þ¤¹¡£ ¹â®¤Ë¤Ê¤ê¤Þ¤¹¤¬¡¢Ç§¾ÚÉÔǽ¤Ê¥Û¥¹¥È¤¬¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¤µ¤ì¤Æ¤·¤Þ¤¦ ´í¸±¤¬¤¢¤ê¤Þ¤¹¡£ .TP \fB-M\fR ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤ËÌ䤤¹ç¤ï¤»¤¿·ë²Ì¤Î¤ß¤òɽ¼¨¤·¡¢¥¯¥é¥¤¥¢¥ó¥È¦¤Ç¤Î ¥¹¥±¥¸¥å¡¼¥ê¥ó¥°½èÍý¤ò¹Ô¤Ê¤¤¤Þ¤»¤ó¡£ ¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»ØÄꤹ¤ë¤È¡¢Æ°ºî¤Ï¹â®¤Ë¤Ê¤ê¤Þ¤¹¤¬¡¢¥Í¥Ã¥È¥ï¡¼¥¯Åª¤ËÅþ ãÉÔǽ¤Ê¥Û¥¹¥È¤ä¡¢Ç§¾ÚÉÔǽ¤Ê¥Û¥¹¥È¤¬É½¼¨¤µ¤ì¤ë´í¸±¤¬¤¢¤ê¤Þ¤¹¡£ .TP \fB-P \fIgfarm-URL\fB\fR ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤ò´ÉÍý¤¹¤ë¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤òÆÃÄꤹ¤ë ¤¿¤á¤Ë¡¢gfarm-URL ¤Ê¤¤¤·¥Ñ¥¹Ì¾¤ò»ØÄꤷ¤Þ¤¹¡£ ¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢\fB-f\fR ¥ª¥×¥·¥ç¥ó¤ÈÇÓ¾Ū¤Ç¤¹¡£ .TP \fB-f \fIgfarm-URL\fB\fR »ØÄꤷ¤¿¥Õ¥¡¥¤¥ë¤Ë¤Ä¤¤¤Æ¡¢¤½¤ÎÊ£À½¤òÊÝ»ý¤¹¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤ò ¸¡º÷¤·¤Þ¤¹¡£ ¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢\fB-P\fR ¥ª¥×¥·¥ç¥ó¤ÈÇÓ¾Ū¤Ç¤¹¡£ .TP \fB-c\fR ¥ª¥×¥·¥ç¥ó¡Ö\fB-f\fR¡×¤Ç»ØÄꤷ¤¿¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Ê¤¤ ¾ì¹ç¤Ç¡¢¤«¤Ä¡¢¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤¿¾ì¹ç¡¢¥Õ¥¡¥¤¥ë¤ò¿·µ¬ºîÀ®¤·¤¿ ¾ì¹ç¤Î¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¾ðÊó¤òɽ¼¨¤·¤Þ¤¹¡£ ¸½ºß¡¢¤³¤Î¥ª¥×¥·¥ç¥ó¤òÍøÍѤ¹¤ë¤È¡¢»ØÄꤷ¤¿¥Õ¥¡¥¤¥ë¤ò¿·µ¬ºîÀ®¤·¤Þ¤¹¡£ ¤³¤Îµóư¤Ï¾­ÍèÊѹ¹¤µ¤ì¤ë²ÄǽÀ­¤¬¤¢¤ë¤Î¤Ç¤´Ãí°Õ¤¯¤À¤µ¤¤¡£ .TP \fB-l\fR ¥Û¥¹¥È̾¤Î¤ß¤Ê¤é¤º¡¢¥Ý¡¼¥ÈÈÖ¹æ¤âɽ¼¨¤·¤Þ¤¹¡£ ¤³¤Î¥ª¥×¥·¥ç¥ó¤Îɽ¼¨·Á¼°¤Ï¡¢¾­ÍèÊѹ¹¤µ¤ì¤ë²ÄǽÀ­¤¬¤¢¤ê¤Þ¤¹¤Î¤Ç¤´Ãí°Õ¤¯¤À¤µ¤¤¡£ .TP \fB-n \fI¥Î¡¼¥É¿ô\fB\fR »ØÄꤷ¤¿¿ô¤ò¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Îɽ¼¨¤ò»î¤ß¤Þ¤¹¡£ ¥Î¡¼¥É¿ô¤¬¤½¤Î¿ô¤ËËþ¤¿¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢¤½¤³¤Çɽ¼¨¤òÂǤÁÀÚ¤ê¤Þ¤¹¡£ ¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Ê¤¤¾ì¹ç¡¢¾ò·ï¤òËþ¤¿¤¹Á´¥Î¡¼¥É¤òɽ¼¨¤·¤Þ¤¹¡£ .TP \fB-w\fR ¥Õ¥¡¥¤¥ë¤Î½ñ¤­¹þ¤ß¤ò¹Ô¤Ê¤¦Á°Äó¤Ç¡¢¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¤ò¹Ô¤Ê¤¤¤Þ¤¹¡£ ¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤¿¾ì¹ç¡¢¥Ç¥£¥¹¥¯¤Î¶õ¤­ÍÆÎ̤¬Â­¤ê¤Ê¤¤¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à ¥Î¡¼¥É¤Ï½ü³°¤µ¤ì¤Þ¤¹¡£ ¤³¤Î¥ª¥×¥·¥ç¥ó¤È¡¢\fB-f\fR ¥ª¥×¥·¥ç¥ó¤òƱ»þ¤Ë»ØÄꤷ¡¢ ¤«¤Ä¡¢¤½¤Î¥Õ¥¡¥¤¥ë¤¬´û¸¤Î¥×¥í¥»¥¹¤Ë¤è¤Ã¤Æ½ñ¤­¹þ¤ß¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢ \fB-n\fR ¤Î»ØÄê¤Ë´Ø¤ï¤é¤º¡¢¸½ºß¤³¤Î¥Õ¥¡¥¤¥ë¤Î½ñ¤­¹þ¤ßÍÑ¤Ë ³ä¤êÅö¤Æ¤é¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É 1¤Ä¤Î¤ß¤òɽ¼¨¤·¤Þ¤¹¡£ .TP \fB-?\fR °ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡£ .SH "EXAMPLES" .PP °Ê²¼¤Ï¡¢¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤¬Æ°ºîÃæ¤Ç¤¢¤ë¤ÈÇİ®¤·¤Æ¤¤¤ë¡¢¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤ò Ì䤤¹ç¤ï¤»¤ëÎã¤Ç¤¹¡£ .nf $ gfsched -M .fi gfarm-2.4.1/man/ja/man1/gfrep.10000644000000000000000000000554511507222725014512 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFREP" "1" "09 November 2009" "Gfarm" "" .SH NAME gfrep \- Gfarm ¥Õ¥¡¥¤¥ë¤ÎÊ£À½¤òºîÀ®¤¹¤ë¡¥ .SH SYNOPSIS \fBgfrep\fR [ \fB-mnqvx\fR ] [ \fB-S \fIÊ£À½¸µ¥É¥á¥¤¥ó̾\fB\fR ] [ \fB-D \fIÊ£À½Àè¥É¥á¥¤¥ó̾\fB\fR ] [ \fB-h \fIÊ£À½¸µ¥Û¥¹¥È»ØÄê¥Õ¥¡¥¤¥ë\fB\fR ] [ \fB-H \fIÊ£À½Àè¥Û¥¹¥È»ØÄê¥Õ¥¡¥¤¥ë\fB\fR ] [ \fB-N \fIÊ£À½¿ô\fB\fR ] [ \fB-j \fIÊÂÎó¿ô\fB\fR ] \fB\fIpath\fB\fR\fI ...\fR .SH "DESCRIPTION" .PP °ú¿ô \fIpath\fR ¤Ç»ØÄꤷ¤¿¥Õ¥¡¥¤¥ë¤ÎÊ£À½¤ò¡¤ »ØÄꤵ¤ì¤¿¥Û¥¹¥È·²¤Ë¡¤»ØÄꤵ¤ì¤¿Ê£À½¤Î¿ô¤À¤±ºîÀ®¤·¤Þ¤¹¡¥ Ê£À½ºîÀ®¸µ¤Î¥Û¥¹¥È·²¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¤ ¤½¤Î¥Û¥¹¥È·²¤Ë¥Õ¥¡¥¤¥ë¤ÎÊ£À½¤¬¤¢¤ë¤È¤­¤Ë¸Â¤ê¡¤ Ê£À½¤¬ºîÀ®¤µ¤ì¤Þ¤¹¡¥ ¥Û¥¹¥È·²¤Ï¡¤¥É¥á¥¤¥ó̾¤È¥Û¥¹¥È»ØÄê¥Õ¥¡¥¤¥ë¤Ë¤è¤ê»ØÄê²Äǽ¤Ç¤¹¤¬¡¤ ξÊý¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¤ÏξÊý¤Î¾ò·ï¤òËþ¤¿¤¹¥Û¥¹¥È·²¤¬»ØÄꤵ¤ì¤¿¤³¤È¤Ë¤Ê¤ê¤Þ¤¹¡¥ .PP \fIpath\fR ¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Î¾ì¹ç¡¤ ¤½¤Î¥Ç¥£¥ì¥¯¥È¥ê°Ê²¼¤Î¥Õ¥¡¥¤¥ë¤ÎÊ£À½¤òºÆµ¢Åª¤ËºîÀ®¤·¤Þ¤¹¡¥ .SH "OPTIONS" .TP \fB-S \fIÊ£À½¸µ¥É¥á¥¤¥ó̾\fB\fR ¥Õ¥¡¥¤¥ëÊ£À½¸µ¤Î¥Û¥¹¥È¤Î¥É¥á¥¤¥ó̾¤ò»ØÄꤷ¤Þ¤¹¡¥ .TP \fB-D \fIÊ£À½Àè¥É¥á¥¤¥ó̾\fB\fR ¥Õ¥¡¥¤¥ëÊ£À½ºîÀ®Àè¤Î¥Û¥¹¥È¤Î¥É¥á¥¤¥ó̾¤ò»ØÄꤷ¤Þ¤¹¡¥ ¤³¤Î¥ª¥×¥·¥ç¥ó¤â \fB-H\fR ¥ª¥×¥·¥ç¥ó¤â»ØÄꤷ¤Ê¤¤¾ì¹ç¡¤ ÍøÍѲÄǽ¤ÊÁ´¥Û¥¹¥È·²¤òÂоݤȤ·¤Æ¥Õ¥¡¥¤¥ëÊ£À½¤òºîÀ®¤·¤Þ¤¹¡¥ .TP \fB-h \fIÊ£À½¸µ¥Û¥¹¥È»ØÄê¥Õ¥¡¥¤¥ë\fB\fR ¥Õ¥¡¥¤¥ëÊ£À½¸µ¤Î¥Û¥¹¥È̾¤Î¥ê¥¹¥È¤òµ­½Ò¤·¤¿ ¥Õ¥¡¥¤¥ë̾¤ò»ØÄꤷ¤Þ¤¹¡¥ ¥Û¥¹¥È̾¤Ï¡¤¥Õ¥¡¥¤¥ëÃæ¤Î³Æ¹Ô¤Ë°ì¥Û¥¹¥È¤º¤Äµ­½Ò¤·¤Þ¤¹¡¥ ¥Õ¥¡¥¤¥ë̾¤È¤·¤Æ ``-'' ¤ò»ØÄꤷ¤¿¾ì¹ç¡¤É¸½àÆþÎϤ«¤é¥Û¥¹ ¥È̾¤Î¥ê¥¹¥È¤òÆÉ¤ß¹þ¤ß¤Þ¤¹¡¥ .TP \fB-H \fIÊ£À½Àè¥Û¥¹¥È»ØÄê¥Õ¥¡¥¤¥ë\fB\fR ¥Õ¥¡¥¤¥ë¤ÎÊ£À½¤òºîÀ®¤¹¤ë¥Û¥¹¥È̾¤Î¥ê¥¹¥È¤òµ­½Ò¤·¤¿ ¥Õ¥¡¥¤¥ë̾¤ò»ØÄꤷ¤Þ¤¹¡¥ ¥Û¥¹¥È̾¤Ï¡¤¥Õ¥¡¥¤¥ëÃæ¤Î³Æ¹Ô¤Ë°ì¥Û¥¹¥È¤º¤Äµ­½Ò¤·¤Þ¤¹¡¥ ¥Õ¥¡¥¤¥ë̾¤È¤·¤Æ ``-'' ¤ò»ØÄꤷ¤¿¾ì¹ç¡¤É¸½àÆþÎϤ«¤é¥Û¥¹ ¥È̾¤Î¥ê¥¹¥È¤òÆÉ¤ß¹þ¤ß¤Þ¤¹¡¥ .TP \fB-N \fIÊ£À½¿ô\fB\fR ɬÍפÊÊ£À½¤Î¿ô¤ò»ØÄꤷ¤Þ¤¹¡¥ Ê£À½Àè¤Ë¡¤»ØÄꤵ¤ì¤¿¿ô°Ê¾å¤ÎÊ£À½¤¬´û¤Ë¸ºß¤¹¤ë¾ì¹ç¤Ï¡¤ Ê£À½¤ÎºîÀ®¤âºï½ü¤â¹Ô¤¤¤Þ¤»¤ó¡¥ ¤³¤Î¥ª¥×¥·¥ç¥ó¤ò¾Êά¤¹¤ë¤È \fB-N 1\fR ¤È»ØÄꤵ¤ì¤¿¤â¤Î¤È¤ß¤Ê¤µ¤ì¤Þ¤¹¡¥ .TP \fB-j \fIÊÂÎó¿ô\fB\fR »ØÄꤵ¤ì¤¿ÊÂÎó¿ô¤Ç¥Õ¥¡¥¤¥ëÊ£À½¤òºîÀ®¤·¤Þ¤¹¡¥ ¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï OpenMP C ¥³¥ó¥Ñ¥¤¥é¤Ç¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤¿¤È¤­¤Ë ¸Â¤êÍ­¸ú¤Ç¤¹¡¥¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¤»ØÄꤵ¤ì¤¿Áí¥Õ¥¡¥¤¥ë¿ô¡¤ Ê£À½¸µ¥Û¥¹¥È¿ô¡¤Ê£À½Àè¥Û¥¹¥È¿ô¤Î¤¦¤Á¤ÎºÇ¾®¤È¤Ê¤ê¤Þ¤¹¡¥ .TP \fB-m\fR Ê£À½¤Ç¤Ï¤Ê¤¯°Üư¤ò¹Ô¤¤¤Þ¤¹¡¥ .TP \fB-x\fR Ê£À½Àè¤Ë¡¤»ØÄꤵ¤ì¤¿¿ô°Ê¾å¤ÎÊ£À½¤¬Â¸ºß¤¹¤ë¾ì¹ç¤Ï¡¤ Ê£À½¤ò¾Ãµî¤·¡¤»ØÄꤵ¤ì¤¿¿ô¤Ë¤·¤Þ¤¹¡¥ .TP \fB-n\fR ¥Õ¥¡¥¤¥ëÊ£À½¤¬ºîÀ®¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¤òɽ¼¨¤·¤Þ¤¹¡¥ ¼ÂºÝ¤Ë¤Ï²¿¤â¼Â¹Ô¤µ¤ì¤Þ¤»¤ó¡¥ .TP \fB-q\fR ¥¨¥é¡¼¤Ç¤Ï¤Ê¤¤¥á¥Ã¥»¡¼¥¸¤Î½ÐÎϤò¹Ô¤¤¤Þ¤»¤ó¡¥ .TP \fB-v\fR Ê£À½½èÍý¤Ë´Ø¤·¤Æ¡¤¾éŤÊɽ¼¨¤ò¹Ô¤¤¤Þ¤¹¡¤ .TP \fB-?\fR °ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡¥ .SH "BUGS" .PP Ê£À½ºîÀ®¸µ¤È¤Ê¤ë¥Û¥¹¥È¤Ï¡¤ ¼ÂºÝ¤Ë¤ÏÊ£À½ºîÀ®¸µ¤È¤·¤Æ»ØÄꤵ¤ì¤¿¥Û¥¹¥È·²¤«¤éÁª¤Ð¤ì¤ë¤È¤Ï¸Â¤ê¤Þ¤»¤ó¡¥ gfarm-2.4.1/man/ja/man1/gfwc.10000644000000000000000000000116511507222725014327 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFWC" "1" "25 April 2003" "Gfarm" "" .SH NAME gfwc \- ÊÂÎó¥Õ¥¡¥¤¥ë¤ò wc ¤¹¤ë .SH SYNOPSIS \fBgfmpirun_p4\fR \fBgfarm:gfwc\fR \fB\fIÆþÎÏgfarm-URL\fB\fR .SH "DESCRIPTION" .PP gfmpirun_p4 ¤«¤é¸Æ¤Ó½Ð¤µ¤ì¤ë¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Î¥µ¥ó¥×¥ë¡¦¥×¥í¥°¥é¥à¤Ç¤¹¡£ .PP ÆþÎÏ gfarm-URL ¤òÆÉ¤ß¹þ¤ß¡¢¥Ð¥¤¥È¿ô¡¦Ã±¸ì¿ô¡¦¹Ô¿ô¤ò¡¢É¸½à½ÐÎϤ˽ÐÎÏ ¤·¤Þ¤¹¡£ gfarm-2.4.1/man/ja/man1/gfchgrp.10000644000000000000000000000115411507222725015017 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFCHGRP" "1" "21 December 2008" "Gfarm" "" .SH NAME gfchgrp \- Gfarm ¥Õ¥¡¥¤¥ë¤Î½êÍ­¥°¥ë¡¼¥×¤òÊѹ¹¤¹¤ë .SH SYNOPSIS \fBgfchgrp\fR [ \fB\fIoptions\fB\fR ] \fBgroup\fR [ \fB\fIpath\fB\fR\fI ...\fR ] .SH "DESCRIPTION" .PP Gfarm ¥Õ¥¡¥¤¥ë¤Î½êÍ­¥°¥ë¡¼¥×¤òÊѹ¹¤·¤Þ¤¹¡¥ .SH "OPTIONS" .TP \fB-?\fR °ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡¥ gfarm-2.4.1/man/ja/man1/gfps.10000644000000000000000000000146311507222725014341 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFPS" "1" "11 October 2005" "Gfarm" "" .SH NAME gfps \- ¸½ºß¼Â¹ÔÃæ¤Î¥¸¥ç¥Ö¤òɽ¼¨¤¹¤ë¡£ .SH SYNOPSIS \fBgfps\fR [ \fB\fI¥ª¥×¥·¥ç¥ó\fB\fR ] [ \fB\fI¥¸¥ç¥ÖID\fB\fR\fI ...\fR ] .SH "DESCRIPTION" .PP °ú¿ô¤Ë»ØÄꤷ¤¿¥¸¥ç¥ÖID¤Ë´Ø¤¹¤ë¾ðÊó¤òɽ¼¨¤·¤Þ¤¹¡£ °ú¿ô¤ò¾Êά¤·¤¿¾ì¹ç¤Ë¤Ï¡¢¼«¥æ¡¼¥¶¡¼¸¢¸Â¤Ç¼Â¹ÔÃæ¤Î¥¸¥ç¥ÖÁ´¤Æ¤òɽ¼¨¤·¤Þ ¤¹¡£ .SH "OPTIONS" .TP \fB-a\fR Á´¤Æ¤Î¥æ¡¼¥¶¡¼¤Î¥¸¥ç¥Ö¤òɽ¼¨¤·¤Þ¤¹¡£ .TP \fB-l\fR ¤è¤ê¾ÜºÙ¤Ê¾ðÊó¤òɽ¼¨¤·¤Þ¤¹¡£ .TP \fB-v\fR ¾ÜºÙ¤Ë¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤òɽ¼¨¤·¤Þ¤¹¡¥ .TP \fB-?\fR °ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡£ gfarm-2.4.1/man/ja/man1/gfstat.10000644000000000000000000000124011507222725014663 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFSTAT" "1" "04 January 2010" "Gfarm" "" .SH NAME gfstat \- Gfarm ¥Õ¥¡¥¤¥ë¤Þ¤¿¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤Î¾ðÊó¤òɽ¼¨¤¹¤ë .SH SYNOPSIS \fBgfstat\fR [ \fB\fIoptions\fB\fR ] [ \fB\fIpath\fB\fR\fI ...\fR ] .SH "DESCRIPTION" .PP »ØÄꤷ¤¿¥Õ¥¡¥¤¥ë¤¢¤ë¤¤¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤Î¾ðÊó¤òɽ¼¨¤·¤Þ¤¹¡¥ .SH "OPTIONS" .TP \fB-c\fR ¥Õ¥¡¥¤¥ëÊ£À½¤Î¿ô¤òɽ¼¨¤·¤Þ¤¹¡¥ .TP \fB-?\fR °ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡¥ gfarm-2.4.1/man/man1/0000755000000000000000000000000011507222730012716 5ustar rootrootgfarm-2.4.1/man/man1/gfreg.10000644000000000000000000001020711507222725014076 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFREG" "1" "05 April 2006" "Gfarm" "" .SH NAME gfreg \- register a Gfarm file, Gfarm file fragments, or a Gfarm directory .SH SYNOPSIS \fBgfreg\fR [ \fB-p \fR ] [ \fB-h \fIfilesystem-node\fB\fR | \fB-H \fIhostfile\fB\fR | \fB-D \fIdomainname\fB\fR ] [ \fB-a \fIarchitecture\fB\fR ] \fB\fIprogram\fB\fR \fB...\fR \fB\fIgfarm-URL\fB\fR \fBgfreg\fR [ \fB-i \fR ] [ \fB-h \fIfilesystem-node\fB\fR | \fB-H \fIhostfile\fB\fR | \fB-D \fIdomainname\fB\fR ] \fB\fIlocalfile\fB\fR \fB...\fR \fB\fIgfarm-URL\fB\fR \fBgfreg\fR \fB-N \fItotal-num-of-fragments\fB\fR \fB-I \fIfragment-index\fB\fR [ \fB-h \fIfilesystem-node\fB\fR | \fB-H \fIhostfile\fB\fR | \fB-D \fIdomainname\fB\fR ] \fB\fIlocalfile\fB\fR \fB...\fR \fB\fIgfarm-URL\fB\fR \fBgfreg\fR \fB-r\fR [ \fB-h \fIfilesystem-node\fB\fR | \fB-H \fIhostfile\fB\fR | \fB-D \fIdomainname\fB\fR ] [ \fB-a \fIarchitecture\fB\fR ] [ \fB\fIdirectory\fB\fR | \fB\fIprogram\fB\fR | \fB\fIlocalfile\fB\fR ] \fB...\fR \fB\fIgfarm-URL\fB\fR .SH "DESCRIPTION" .PP The first form copies and registers the \fIprogram\fR as a Gfarm file \fIgfarm-URL\fR in the Gfarm filesystem. When \fIgfarm-URL\fR is a directory, multiple programs can be specified. After the registration, the \fIgfarm-URL\fR can be specified as a program name of gfrun(1) and gfmpirun_p4(1). Without the \fB-p\fR option, only executable file can be specified. With the \fB-p\fR option, non-executable file can be specified as well. Without the \fB-a\fR option or the \fB-h\fR option, architecture of the \fIprogram\fR is assumed to be the same architecture as the client host on that gfreg(1) is executed, which is obtained by the Gfarm metaserver. .PP The second form registers one or more \fIlocalfile\fRs as a single Gfarm file. Without the \fB-i\fR option, only non-executable file can be specified as \fIlocalfile\fR. With the \fB-i\fR option, both excutable and non-executable file can be specified as \fIlocalfile\fR. The destination filesystem node will be automatically selected by CPU load average. With any one of \fB-h\fR, \fB-H\fR, \fB-D\fR options, filesystem node can be limited. .PP The third form registers \fIlocalfile\fR as a file fragment of a Gfarm file. The total number of fragments and the fragment index are specified by the \fB-N\fR option and the \fB-I\fR option, respectively. When \fIgfarm-URL\fR is a directory, multiple \fIlocalfile\fRs can be specified. The destination filesystemnode will be automatically decided by CPU load average unless any one of \fB-h\fR, \fB-H\fR, \fB-D\fR options is explicitly specified. When the gfreg command of this form is executed on a filesystem node, the local filesystem node is always selected rather than a remote filesystemnode. In this case, \fB-h\fR, \fB-H\fR, \fB-D\fR options help to store files dispersively. .PP The fourth form registers the \fIdirectory\fR as a Gfarm directory \fIgfarm-URL\fR, the \fIprogram\fR or the \fIlocalfile\fR as a Gfarm file \fIgfarm-URL\fR. If \fIdirectory\fR have some sub directories and/or files, they will be registered recursively. The non-executable file \fIlocalfile\fR will be registered as a file has one fragment. A non-executable file in the \fIdirectory\fR will be registered in the same way. When \fIgfarm-URL\fR already exists as a directory, multiple \fIdirectorie\fRs, \fIprogram\fRs, and \fIlocalfile\fRs can be specified and they will be registered in \fIgfarm-URL\fR. They can be mixed in parameteres, while other forms inhibit this manner. If \fIgfarm-URL\fR does not exist, one \fIdirectory\fR or one \fIprogram\fR, or one \fIlocalfile\fR can be specified and it will be registered as \fIgfarm-URL\fR. Refer to the first form's part above to specify filesystem node thatprogfarms and files will reside with the \fB-a\fR option or the \fB-h\fR option. .SH "OPTIONS" .TP \fB-f\fR overwrites gfarm-URL even if it exits as a Gfarm file. .TP \fB-?\fR displays a list of command options. gfarm-2.4.1/man/man1/gfssh.10000644000000000000000000000010411507222725014111 0ustar rootroot.Id $Id: gfssh.1 136 2002-08-29 11:39:13Z tatebe $ .so man1/gfrun.1 gfarm-2.4.1/man/man1/gffindxmlattr.10000644000000000000000000000331511507222725015657 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFFINDXMLATTR" "1" "18 August 2009" "Gfarm" "" .SH NAME gffindxmlattr \- Find XML extended attributes by XPath query .SH SYNOPSIS \fBgffindxmlattr\fR [ \fB-d \fIdepth\fB\fR ] [ \fB-F \fIdelim\fB\fR ] [ \fB\fIXPath\fB\fR | \fB-f \fIXPath-file\fB\fR ] \fB\fIpath\fB\fR .SH "DESCRIPTION" .PP gffindxmlattr finds XML extended attributes by a specified XPath expression, and displays path names and the corresponding XML extended attribute names. When a file is specified, XML extended attributes associated to the file are searched if there is the read permission. .PP When a directory is specified, files or directories within the depth are recursively searched. When 0 is specified for the depth, the specified directory is searched. If the depth is not specified, all files and directories under the specified directory are searched. If the negative value is specified, gffindxmlattr returns error. Directories that do not have execute permission cannot be searched. .PP gffindxmlattr displays path names and the corresponding XML extended attribute separated by the delim. .SH "OPTIONS" .TP \fB-d depth\fR specifies the depth to be searched recursively. .TP \fB-F delim\fR specifies a delimiter that separates the path name and the XML extended attribute name. By detault, the delimiter is TAB. .TP \fB-f XPath-file\fR specifies a file that contains XPath expression. .TP \fB-?\fR displays usage. .SH "SEE ALSO" .PP \fBgfxattr\fR(1) gfarm-2.4.1/man/man1/gfpwd.10000644000000000000000000000104411507222725014112 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFPWD" "1" "02 July 2003" "Gfarm" "" .SH NAME gfpwd \- print Gfarm working directory name .SH SYNOPSIS \fBgfpwd\fR .SH "DESCRIPTION" .PP \fBgfpwd\fR prints current Gfarm working directory name. .SH "SEE ALSO" .PP \fBgfcd\fR(1), \fBgfsetdir\fR(1) gfarm-2.4.1/man/man1/gfuser.10000644000000000000000000000367411507222725014311 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFUSER" "1" "20 January 2010" "Gfarm" "" .SH NAME gfuser \- Gfarm user maintenance command .SH SYNOPSIS \fBgfuser\fR [ \fB-P \fIpath\fB\fR ] [ \fB-l\fR ] [ \fB\fIuser\fB\fR\fI ...\fR ] \fBgfuser\fR [ \fB-P \fIpath\fB\fR ] \fB-c\fR \fBusername\fR \fBrealname\fR \fBhomedir\fR \fBgsi_dn\fR \fBgfuser\fR [ \fB-P \fIpath\fB\fR ] \fB-m\fR \fBusername\fR \fBrealname\fR \fBhomedir\fR \fBgsi_dn\fR \fBgfuser\fR [ \fB-P \fIpath\fB\fR ] \fB-d\fR \fBusername\fR .SH "DESCRIPTION" .PP \fBgfuser\fR manages Gfarm global users in Gfarm file system. Default action displays all registered users. When user names are specified, specified users are displayed. Gfarm administrator can creates, modifies, and deletes a Gfarm user by -c, -m, and -d options, respectively. .SH "OPTIONS" .TP \fB-P \fIpath\fB\fR This option specifies a pathname or a Gfarm URL to identify a metadata server which will be accessed by this command. If not specified, "/" is used as the default value. .TP \fB-l\fR Displays verbose information of registered users. .TP \fB-c\fR Creates a user by specifying a global username in Gfarm file system, a real username, a home directory in Gfarm, and a Subject DN used in GSI. When the real username or the Subject DN includes spaces, it is needed to be quoted. This option can be used by Gfarm administrators. .TP \fB-m\fR Replaces a user information of the specified global user with specified real name, home directory and Subject DN. This option can be used by Gfarm administrators. .TP \fB-d\fR Deletes a registered user. This option can be used by Gfarm administrators. .TP \fB-?\fR Displays a list of command options. .SH "SEE ALSO" .PP \fBgfgroup\fR(1) gfarm-2.4.1/man/man1/gfrm.10000644000000000000000000000600211507222725013735 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFRM" "1" "13 November 2006" "Gfarm" "" .SH NAME gfrm \- remove Gfarm files, directories, or file replicas .SH SYNOPSIS \fBgfrm\fR [ \fB-frRnqv\fR ] [ \fB-I \fIfile-section\fB\fR ] [ \fB-h \fIfilesystem-node\fB\fR ] [ \fB-D \fIdomain-name\fB\fR ] [ \fB-H \fIhostfile\fB\fR ] [ \fB-N \fInum-of-replicas\fB\fR ] [ \fB-j \fInum-of-threads\fB\fR ] \fB\fIgfarm-URL\fB\fR\fI ...\fR .SH "DESCRIPTION" .PP \fBgfrm\fR removes each specified file. It does not remove directories unless the \fB-r\fR or \fB-R\fR option is specified. \&'.' or '..' cannot be removed. .PP When the \fB-I\fR option is specified, \fBgfrm\fR removes the specified file section. File section is an architecture name for executable files, or a fragment index for a regular file. .PP With the \fB-h\fR, \fB-D\fR, or \fB-H\fR option, \fBgfrm\fR removes file replicas of each specified file or file section on the specified filesystem node(s). All file replicas of a file cannot be removed, unless the \fB-f\fR option is specified. .SH "OPTIONS" .TP \fB-f\fR Even when all file replicas are specified by the \fB-h\fR, \fB-D\fR, or \fB-H\fR option, forcibly deletes all the file replica. In this case, the specified file will be deleted. .TP \fB-j \fInum-of-threads\fB\fR Specifies the number of threads to delete file replicas simultaneously. This option is only available when \fBgfrm\fR is compiled by an OpenMP C compiler. .TP \fB-n\fR Prints file names to be deleted, but does not delete them. .TP \fB-q\fR Does not print any verbose message. .TP \fB-r, -R\fR Removes all entries under the directories specified by the command-line argument recursively. .TP \fB-v\fR Prints verbose messages. .TP \fB-h \fIfilesystem-node\fB\fR Specifies a filesystem node from which file replicas will be removed. With the \fB-I\fR option, a file replica of the specified file section will be removed. .TP \fB-D \fIdomain-name\fB\fR Specifies a domain name of filesystem nodes on which file replicas will be removed. With the \fB-I\fR option, a file replica of the specified file section will be removed. .TP \fB-H \fIhostfile\fB\fR Specifies a \fIhostfile\fR that lists filesystem nodes on which file replicas will be removed. With the \fB-I\fR option, a file replica of the specified file section will be removed. if ``-'' is specified, standard input is used to read the host list. .TP \fB-I \fIfile-section\fB\fR Specifies the file section to be removed. File section is an architecture name, such as sparc-sun-solaris8, for executable files, and a fragment index for regular files. .TP \fB-N \fInum-of-replicas\fB\fR Specifies the maximum number of file replicas. If files has more number of file replicas than specified, reduce the number of file replicas. .TP \fB-?\fR Displays a list of command options. gfarm-2.4.1/man/man1/gfmkdir.10000644000000000000000000000145611507222725014435 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFMKDIR" "1" "15 December 2010" "Gfarm" "" .SH NAME gfmkdir \- make Gfarm directories .SH SYNOPSIS \fBgfmkdir\fR [ \fB\fIoptions\fB\fR ] \fB\fIpath\fB\fR\fI ...\fR .SH "DESCRIPTION" .PP \fBgfmkdir\fR makes directories specified in the arguments. The arguments must be a pathname in Gfarm file system. .SH "OPTIONS" .TP \fB-p\fR Even if the specified directory exists, do not return error. Create parent directories if needed. .TP \fB-?\fR displays a list of command options. .SH "SEE ALSO" .PP \fBgfrmdir\fR(1) gfarm-2.4.1/man/man1/gfusage.10000644000000000000000000000120511507222725014423 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFUSAGE" "1" "12 November 2006" "Gfarm" "" .SH NAME gfusage \- display Gfarm filesystem space usage .SH SYNOPSIS \fBgfusage\fR [ \fB-c\fR ] .SH "DESCRIPTION" .PP \fBgfusage\fR displays Gfarm filesystem space usage for each user. .SH "OPTIONS" .TP \fB-c\fR Calculates total size, taking replicas into account. .SH "SEE ALSO" .PP \fBgfdf\fR(1) gfarm-2.4.1/man/man1/gfrmdir.10000644000000000000000000000115711507222725014442 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFRMDIR" "1" "15 May 2008" "Gfarm" "" .SH NAME gfrmdir \- remove Gfarm directories .SH SYNOPSIS \fBgfrmdir\fR \fB\fIpath\fB\fR\fI ...\fR .SH "DESCRIPTION" .PP \fBgfrmdir\fR removes directories specified in the arguments. .SH "OPTIONS" .TP \fB-?\fR displays a list of command options. .SH "SEE ALSO" .PP \fBgfmkdir\fR(1) gfarm-2.4.1/man/man1/gfexport.10000644000000000000000000000243411507222725014645 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFEXPORT" "1" "24 May 2003" "Gfarm" "" .SH NAME gfexport \- print on the standard output .SH SYNOPSIS \fBgfexport\fR [ \fB-H \fIhostfile\fB\fR ] [ \fB-I \fIfragment-index\fB\fR ] \fB\fIgfarm-URL\fB\fR .SH "DESCRIPTION" .PP \fBgfexport\fR outputs a Gfarm file specified by \fIgfarm-URL\fR to the standard output. .SH "OPTIONS" .TP \fB-H \fIhostfile\fB\fR specifies a list of filesystem nodes explicitly to be accessed. \fIhostfile\fR contains of a hostname that stores the corresponding file fragment in each line. When the -H option is specified, the -I option cannot be specified. if ``-'' is specified, the standard input is used to read the host list. .TP \fB-I \fIfragment-index\fB\fR outputs the only specified fragment index. If the \fIgfarm-URL\fR is an executable file, an architecture name, for example, sparc-sun-solaris8, can be used to specify the executable architecture. When the -I option is specified, the -H option cannot be specified. .TP \fB-?\fR displays a list of command options. gfarm-2.4.1/man/man1/gfgrep.10000644000000000000000000000247611507222725014267 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFGREP" "1" "18 March 2003" "Gfarm" "" .SH NAME gfgrep \- search a file for a pattern .SH SYNOPSIS \fBgfrun\fR \fBgfarm:gfgrep\fR \fB-o \fIoutput-gfarm-URL\fB\fR \fB\fIpattern\fB\fR \fB\fIinput-gfarm-URL\fB\fR\fI ...\fR \fBgfrun\fR \fBgfarm:gfgrep\fR \fB-o \fIoutput-gfarm-URL\fB\fR \fB-e \fIpattern\fB\fR \fB\fIinput-gfarm-URL\fB\fR\fI ...\fR .SH "DESCRIPTION" .PP \fBgfgrep\fR is a sample program of parallel applications executed by gfrun(1) as well as an example to create a Gfarm file in the local file view. .PP \fBgfgrep\fR searches a \fIpattern\fR from \fIinput-gfarm-URL\fR, and outputs to \fIoutput-gfarm-URL\fR. .PP Every parallel application executed by \fBgfrun(1)\fR should interpret the \fB-I\fR and \fB-N\fR options that show the rank and the size of the parallel program, respectively, and call \fBgfs_pio_set_local()\fR. .SH "OPTIONS" .TP \fB-e \fIpattern\fB\fR is useful to protect patterns beginning with -. .TP \fB-o \fIgfarm-URL\fB\fR specifies an output Gfarm file. .TP \fB-?\fR displays a list of command options. gfarm-2.4.1/man/man1/gfront.10000644000000000000000000000154311507222725014306 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFRONT" "1" "13 November 2006" "Gfarm" "" .SH NAME gfront \- Gfarm filesystem browser .SH SYNOPSIS \fBgfront\fR .SH "DESCRIPTION" .PP GFront is a graphical user interface for a Gfarm filesystem. It provides functionalities for browsing a directory tree, and manupulating Gfarm files and directories. .PP GFront internally executes Gfarm client commands. It is necessary that Gfarm client commands are successfully installed, and the Gfarm configuration file is properly set up. .SH "SEE ALSO" .PP \fBgfexport\fR(1), \fBgfhost\fR(1), \fBgfrm\fR(1), \fBgfreg\fR(1) gfarm-2.4.1/man/man1/gfrcmd.10000644000000000000000000000473411507222725014256 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFRCMD" "1" "12 November 2006" "Gfarm" "" .SH NAME gfrcmd \- Gfarm remote shell .SH SYNOPSIS \fBgfrcmd\fR \fB\fIhost\fB\fR \fB\fIcommand\fB\fR\fI ...\fR .SH "DESCRIPTION" .PP \fBgfrcmd\fR logs into a filesystem node \fIhost\fR and executes \fIcommand\fRs on the filesystem node. It provides a similar functionality to rsh. The following is a list of differences, however. .PP A remote server is not executed by inetd, but is incorporated with gfsd(8). .PP The user is authenticated and authorized by the Gfarm security mechanism. Since this does not rely on privileged TCP ports for authentication like rsh, the maximum number of remote executions is not limited by the number of privileged ports. .PP Unlike rsh, \fBgfrcmd\fR utilizes a single TCP connection to a filesystem node. It requires less kernel resources than rsh when several processes are executed. .PP \fBgfrcmd\fR inherits the environment variable DISPLAY and the authentication information of the X Window System. .PP On the filesystem node, the current working directory is not the home directory that is often shared using NFS, but a spool directory of the Gfarm filesystem, which makes it possible to leave core files on each filesystem node when debugging. .PP It has functionality that invokes a debugger when a fatal signal occurs. .SH "OPTIONS" .TP \fB-l\fIusername\fB\fR Specifies a username on a remote host. .TP \fB-n\fR Redirects the standard input from the special device /dev/null. .TP \fB-r\fR Executes a remote command directly without using a login shell. .TP \fB-y\fR Inherits the environment variable, DISPLAY. .TP \fB-X\fR Inherits the authentication information of the X Window System. It is useful in a situation where the home directory is not shared. .TP \fB-v\fR Displays error message verbosely. .TP \fB-?\fR Displays a list of command options. .SH "ENVIRONMENT VARIABLES" .TP \fBGFARM_DEBUG_MODE\fR Specifies the debugger command that is invoked when a remotely executed command aborts with a fatal signal. When gdb is specified, xterm and the GNU debugger gdb are executed. To utilize this functionality, it is necessary to invoke \fBgfrcmd\fR on the X Window System. .SH "BUGS" .PP The -l option is not implemented yet. gfarm-2.4.1/man/man1/gfhost.10000644000000000000000000002335111507222725014302 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFHOST" "1" "20 January 2010" "Gfarm" "" .SH NAME gfhost \- Gfarm host maintenance command .SH SYNOPSIS \fBgfhost\fR [ \fB-H\fR | \fB-l\fR | \fB-M\fR ] [ \fB-iLprUv\fR ] [ \fB-P \fIpath\fB\fR ] [ \fB-a \fIarchitecture\fB\fR ] [ \fB-D \fIdomain-name\fB\fR ] [ \fB-j \fIconcurrency\fB\fR ] [ \fB\fIhostname\fB\fR\fI ...\fR ] \fBgfhost\fR \fB-c\fR [ \fB-P \fIpath\fB\fR ] \fB-a \fIarchitecture\fB\fR \fB-p \fIport-number\fB\fR [ \fB-n \fInumber-of-CPUs\fB\fR ] \fB\fIhostname\fB\fR [ \fB\fIhost-alias\fB\fR\fI ...\fR ] \fBgfhost\fR \fB-m\fR [ \fB-P \fIpath\fB\fR ] [ \fB-a \fIarchitecture\fB\fR ] [ \fB-p \fIport-number\fB\fR ] [ \fB-n \fInumber-of-CPUs\fB\fR ] [ \fB-A\fR ] \fB\fIhostname\fB\fR [ \fB\fIhost-alias\fB\fR\fI ...\fR ] \fBgfhost\fR \fB-d\fR [ \fB-P \fIpath\fB\fR ] \fB\fIhostname\fB\fR\fI ...\fR \fBgfhost\fR \fB-R\fR [ \fB-P \fIpath\fB\fR ] .SH "DESCRIPTION" .PP \fBgfhost\fR is used to display and maintain information about filesystem nodes. The function that \fBgfhost\fR performs is determined by an option, -c, -d, -H, -l, -M, -m, -R. These functions are mutually exclusive, and only one option among them can be specified. If none of them is specified, host name will be displayed as the default function of \fBgfhost\fR\&. .SH "FUNCTIONS" .PP Metadata in the metadata server will be accessed by function -c, -d, -M, -m or -R. These functions add/delete/display/modify/restore host information in the metadata. .PP If -H, -l or -M is specified, or none of the functions are specified, \fBgfhost\fR displays filesystem node information. The -M function only accesses information in the metadata server. Display functions other than -M also access \fBgfsd\fR, which is running on filesystem nodes. For functions which access \fBgfhost\fR, the access option can be specified by options -i, -j, -U and -v. .PP You don't have to specify hostnames for display functions. In that case, all hosts which are registered in metadata will be displayed, but you can limit the type of hosts displayed by the -a or -D option. By default, hosts are displayed in alphabetical order, but you can change this by the -L, -p, or -r options. Although the -L option is ignored in the -M function and in the default function. . .PP The following is a list of the functions of the \fBgfhost\fR command. You shouldn't specify more than one functions at a time. .TP \fB\fR If you don't specify any of the functions, \fBgfhost\fR accesses \fBgfsd\fR, and displays the names of hosts which are currently available as its default function. Hostnames are displayed in alphabetical order, by default. .TP \fB-c\fR Creates the metadata information for the host that is specified in the argument. Option -a is mandatory for this function, this option specifies the architecture of the host. Option -p is mandatory in this function too, this option specifies the port number of \fBgfsd\fR on the host. Option -n may be used to specify the number of CPUs of the host, and 1 CPU is assumed, if -n is omitted. You can specifiy multiple hostnames in this function. In that case, the first hostname is treated as the identifier of the host, and the host identifier is used for replication information management. The rest of the hostnames are used as aliases of the host. If a host has multiple network interfaces, and each interface has a unique hostname, all of the hostnames must be registered as either host identifiers or host aliases. If /etc/hosts or the NIS hosts database doesn't contain a DNS domain name part in its hostnames (i.e. these hostnames are not Fully Qualified Domain Names), you must register a host alias. In that case, you must register FQDN (a hostname which contain a domain name part) as the host identifier, and register names without the domain part as the host alias. .TP \fB-d\fR Deletes host information from metadata. Currently, even hosts which are referred by replica catalog can be deleted. But be careful, because such deletions cause inconsistencies of metadata. Only a host identifier can be used as a hostname in this function. .TP \fB-H\fR Displays load average and authentication method. With this function, the exact hostname passed by the gfhost command arguments will be displayed instead of the canonical host identifier. Also, this function displays the IP address used to access \fBgfsd\fR in parentheses just after the hostname. If the host cannot be accessed due to a machine down or network problem, etc., x.xx/x.xx/x.xx will be displayed in the load average field. If the host is up, but \fBgfsd\fR on the host cannot be accessed, -.--/-.--/-.-- will be displayed. The next field is the authentication method used with the host. `G' in this field means GSI authentication and encryption, `g' means only authentication is performed by GSI and actual communication is unprotected plain data (gsi_auth), `s' means gfarm sharedsecret authentication, `x' means that the authentication failed, and `-' means that the authentication wasn't actually tried. If the -U option is specified, this authentication method field won't be provided. Hostnames are displayed in alphabetical order, by default. .TP \fB-l\fR Displays in the long format. This function displays both information retrieved from gfsd and the metadata server. The types of information retrieved from gfsd are load average and authentication method. And the types of information retrieved from the metadata server are architecture name, number of CPUs, host identifier, and host aliases (if any). IP address will be displayed in parentheses just after the hostname used for the access to \fBgfsd\fR\&. If the host cannot be accessed due to a machine down or network problem, etc., x.xx/x.xx/x.xx will be displayed in the load average field. If the host is up, but \fBgfsd\fR on the host cannot be accessed , -.--/-.--/-.-- will be displayed. The next field is the authentication method used with the host. `G' in this field means GSI authentication and encryption, `g' means only authentication is performed by GSI and actual communication is unprotected plain data (gsi_auth), `s' means gfarm sharedsecret authentication, `x' means that the authentication failed, and `-' means that the authentication wasn't actually tried. If that -U option is specified, this authentication method field won't be provided. Hostnames are displayed in alphabetical order, by default. .TP \fB-M\fR The metadata information of the hosts will be displayed. Hostnames are displayed in alphabetical order, by default. .TP \fB-m\fR Modifies metadata information of the host, by specifying the host identifier. The -a and -n options overwrite the current value of each option. By contrast, host aliases will be added in this function by default. If you want to replace or delete host aliases, please specify the -A option with this function. In that case, all host aliases will be replaced by specified aliases (if any). .TP \fB-R\fR Restores metadata information read from standard input. The format of the metadata is same as the format that the -M function displays. .TP \fB-?\fR Prints usage. .SH "OPTIONS" .TP \fB-A\fR Alter. This option is used with the -m function to replace, rather than add, host aliases. .TP \fB-a \fIarchitecture\fB\fR This option specifies the CPU architecture using a format like sparc-sun-solaris8 or i386-redhat8.0-linux, etc. If this option is used with the -c or -m function, this means the architecture used to add/modify the metadata information. If this option is used with -H, -l, -M function or default function, this limits hosts to the specified architecture. .TP \fB-D \fIdomain-name\fB\fR This option is used with the -H, -l, -M function or the default function to limit hosts to the specified domain. .TP \fB-i\fR There is an "address_use" directive in %%SYSCONFDIR%%/gfarm2.conf and $HOME/.gfarm2rc to give priorities of network addresses for gfarm access. This directive works with the \fBgfhost\fR command, but will be ignored, if you specified the -i option with \fBgfhost\fR\&. .TP \fB-j \fIconcurrency\fB\fR This option specifies the concurrency used for access to \fBgfsd\fR\&. The default value is 10. .TP \fB-L\fR Sorts by load average order. This option is effective only with the -H and -l functions. .TP \fB-n \fInumber-of-CPUs\fB\fR This option is used with the -c or -m function, and specifies the number of CPUs of the host. .TP \fB-p \fIport-number\fB\fR This option is used with -c or -m function, and specifies the port number of \fBgfsd\fR on the host. .TP \fB-P \fIpath\fB\fR This option specifies a pathname or a Gfarm URL to identify a metadata server which will be accessed by this command. If not specified, "/" is used as the default value. .TP \fB-r\fR Reverses the order of sort. .TP \fB-u\fR Plain order. This option stops sorting on the -H, -l, -M function or the default function. With the -M function, command argument order (if any), or the order that the metadata server answers is used for display. With the -H, -l function or the default function, the result is displayed in the order that each \fBgfsd\fR answers. .TP \fB-U\fR Suppresses authentication attempts by TCP, and only queries load average by UDP. This option only makes sense if you specified the -H or -l function, or if you didn't specify any function. This option makes the gfhost command run faster. If the -H or -l function is specified, this option makes the authentication method field disappear. .TP \fB-v\fR The -H, -l function and the default function don't produce error reports on \fBgfsd\fR accesses; these error reports will be produced by this option. .SH "SEE ALSO" .PP \fBgfarm2.conf\fR(5), \fBgfsd\fR(8) gfarm-2.4.1/man/man1/gfstatus.10000644000000000000000000000100611507222725014641 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFSTATUS" "1" "19 December 2008" "Gfarm" "" .SH NAME gfstatus \- display Gfarm configuration status .SH SYNOPSIS \fBgfstatus\fR .SH "DESCRIPTION" .PP \fBgfstatus\fR displays information about the Gfarm file system. gfarm-2.4.1/man/man1/gfmpirun_p4.10000644000000000000000000000305211507222725015236 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFMPIRUN_P4" "1" "20 August 2003" "Gfarm" "" .SH NAME gfmpirun_p4 \- run Gfarm parallel programs with mpirun .SH SYNOPSIS \fBgfmpirun_p4\fR [ \fB\fIoptions\fB\fR ] \fB\fIcommand\fB\fR \fB\fIargs\fB\fR\fI ...\fR .SH "DESCRIPTION" .PP \fBgfmpirun_p4\fR executes a parallel command on filesystem nodes with mpirun provided by MPICH/p4, which is determined by the \fB-G\fR option, the \fB-H\fR option, or the \fB-N\fR option. .PP \fB-G\fR, \fB-H\fR, and \fB-N\fR options are exclusive. When none of \fB-G\fR, \fB-H\fR, and \fB-N\fR options are not specified, \fBgfmpirun_p4\fR schedules filesystem nodes by the file-affinity scheduling using the first existent Gfarm file in the argument list \fIargs\fR. .PP \fICommand\fR can be specified by a gfarm-URL that is registered using gfreg(1). .SH "OPTIONS" .TP \fB-G \fIgfarm-URL\fB\fR specifies a Gfarm file \fIgfarm-URL\fR for file-affinity scheduling. .TP \fB-H \fIhostfile\fB\fR specifies a \fIhostfile\fR that lists filesystem nodes. if ``-'' is specified, standard input is used to read the host list. .TP \fB-N \fInp\fB\fR specifies the number of nodes \fInp\fR, which are selected by the increasing order of load average. .SH "BUGS" .PP \fBgfmpirun_p4\fR can only work with the MPICH/p4. .SH "SEE ALSO" .PP \fBgfrun\fR(1) gfarm-2.4.1/man/man1/gfimport_fixed.10000644000000000000000000000474011507222725016017 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFIMPORT_FIXED" "1" "06 June 2003" "Gfarm" "" .SH NAME gfimport_fixed \- divide and register a fixed-size data file .SH SYNOPSIS \fBgfimport_fixed\fR [ \fB\fIoptions\fB\fR ] \fB\fIfile\fB\fR .SH "DESCRIPTION" .PP \fBgfimport_fixed\fR is a sample program for dividing a file to file fragments and registering it to the Gfarm filesystem. .SH "OPTIONS" .TP \fB-H\fR \fIhostfile\fR specifies a hostname list of filesystem nodes. The \fIhostfile\fR consists of a hostname of a filesystem node in each line. The file is uniformly divided into file fragments, each file fragment except the last one having the same size. if ``-'' is specified, standard input is used to read the host list. .TP \fB-f \fIfragment file\fB\fR specifies a \fIfragment file\fR that consists of a fragment size and a filesystem node separated by a white space in each line. if ``-'' is specified, standard input is used. .TP \fB-l \fIrecord size\fB\fR specifies the size of fixed-size records in bytes. With this option, file is divided by the multiple size of the \fIrecord size\fR. Default size is 1. .TP \fB-o \fIgfarm-URL\fB\fR specifies an output file. .TP \fB-?\fR displays a list of command options. .SH "EXAMPLES" .SS "IMPORTING BY SPLITTING TO SPECIFIED NUMBER OF FRAGMENTS" .PP The following is an example using \fBgfimport_fixed\fR to import a \fIsource_file\fR as \fIgfarm:file\fR by splitting to 8 fragments. .nf gfsched -N 8 | gfimport_fixed -H - -o gfarm:file source_file .fi .SS "IMPORTING BY SPLITTING TO SPECIFIED NUMBER OF FRAGMENTS FOR PARTICULAR PROGRAM" .PP The following is an example using \fBgfimport_fixed\fR to import a \fIsource_file\fR as \fIgfarm:file\fR by splitting to 8 fragments to be processed by \fIgfarm:prog\fR program. .nf gfsched -N 8 -p gfarm:prog | gfimport_fixed -H - -o gfarm:file source_file .fi .SS "IMPORTING INTO SAME DISPOSITION WITH AN EXISTING GFARM FILE" .PP The following is an example using \fBgfimport_fixed\fR to import a \fIsource_file\fR as \fIgfarm:file\fR into same disposition with existing file \fIgfarm:template\fR. .nf gfsched gfarm:template | gfimport_fixed -H - -o gfarm:file source_file .fi .SH "SEE ALSO" .PP \fBgfimport_text\fR(1), \fBgfsched\fR(1), \fBgfarm.conf\fR(5) gfarm-2.4.1/man/man1/gfwhoami.10000644000000000000000000000125211507222725014605 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFWHOAMI" "1" "12 November 2006" "Gfarm" "" .SH NAME gfwhoami \- print user name on the Gfarm filesystem .SH SYNOPSIS \fBgfwhoami\fR [ \fB\fIoptions\fB\fR ] .SH "DESCRIPTION" .PP \fBgfwhoami\fR prints a global user name on the Gfarm filesystem. .SH "OPTIONS" .TP \fB-v\fR Prints the Subject DN of the user for GSI authentication. .TP \fB-h\fR Displays a list of command options. gfarm-2.4.1/man/man1/gfkey.10000644000000000000000000000351611507222725014116 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFKEY" "1" "25 February 2010" "Gfarm" "" .SH NAME gfkey \- management of Gfarm session keys .SH SYNOPSIS \fBgfkey\fR [ \fB\fIoptions\fB\fR ] .SH "DESCRIPTION" .PP \fBgfkey\fR manages the session key file, \fI$HOME/.gfarm_shared_key\fR, that is used for user authentication by a shared secret key in a trusted environment when connecting to gfsd and/or gfmd. .PP When the home directory is shared among filesystem nodes, it is not necessary to use this command. If not, it is necessary to distribute a session key created with the -c or -f option to every filesystem node, in advance. .SH "OPTIONS" .TP \fB-c\fR Creates a new session key when there is no valid session key. If a valid session key already exists, no operation is performed. .TP \fB-f\fR Forces the creation of a new session key, even if a valid session key already exists. .TP \fB-p \fIperiod\fB\fR Specifies the term of validity in seconds. This option has to be used with the -c or -f option. .TP \fB-l\fR Displays the current key. .TP \fB-e\fR Displays the expiration date of the current key. .TP \fB-L \fImessage-priority-level\fB\fR Specifies a level of the log priority. The log messages that have higher or the same priority than the specified priority are displayed to the standard error. The default priority is info. Refer to the log_level directive described in the manual page of gfarm2.conf(5) for the priority level which can be specified by this option. .TP \fB-?\fR Displays a list of command options. .SH "FILES" .TP \fB\fI$HOME/.gfarm_shared_key\fB\fR a file for a session key gfarm-2.4.1/man/man1/gfgroup.10000644000000000000000000000333411507222725014460 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFGROUP" "1" "20 January 2010" "Gfarm" "" .SH NAME gfgroup \- Gfarm group maintenance command .SH SYNOPSIS \fBgfgroup\fR [ \fB-P \fIpath\fB\fR ] [ \fB-l\fR ] [ \fB\fIgroup\fB\fR\fI ...\fR ] \fBgfgroup\fR [ \fB-P \fIpath\fB\fR ] \fB-c\fR \fBgroupname\fR [ \fB\fIuser\fB\fR\fI ...\fR ] \fBgfgroup\fR [ \fB-P \fIpath\fB\fR ] \fB-m\fR \fBgroupname\fR [ \fB\fIuser\fB\fR\fI ...\fR ] \fBgfgroup\fR [ \fB-P \fIpath\fB\fR ] \fB-d\fR \fBgroupname\fR .SH "DESCRIPTION" .PP \fBgfgroup\fR manages Gfarm groups in Gfarm file system. Default action displays all registered groups. When group names are specified, specified groups are displayed. Gfarm administrator can creates, modifies, and deletes a Gfarm group by -c, -m, and -d options, respectively. .SH "OPTIONS" .TP \fB-P \fIpath\fB\fR This option specifies a pathname or a Gfarm URL to identify a metadata server which will be accessed by this command. If not specified, "/" is used as the default value. .TP \fB-l\fR Displays group names and the group members. .TP \fB-c\fR Creates a group in Gfarm file system by specifying a group name and initial group members. This option can be used by Gfarm administrators. .TP \fB-m\fR Replaces group members of the group with new group members. This option can be used by Gfarm administrators. .TP \fB-d\fR Deletes a group. This option can be used by Gfarm administrators. .TP \fB-?\fR Displays a list of command options. .SH "SEE ALSO" .PP \fBgfuser\fR(1) gfarm-2.4.1/man/man1/gfwhere.10000644000000000000000000000140411507222725014432 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFWHERE" "1" "21 December 2008" "Gfarm" "" .SH NAME gfwhere \- print replica locations .SH SYNOPSIS \fBgfwhere\fR [ \fB-r, -R\fR ] \fB\fIpath\fB\fR\fI ...\fR .SH "DESCRIPTION" .PP \fBgfwhere\fR prints replica locations of specified files. When -r or -R option is specified, prints replica locations of subentries in specified directories recursively. .SH "OPTIONS" .TP \fB-r, -R\fR Displays subdirectories recursively. .TP \fB-?\fR Displays a list of command options. gfarm-2.4.1/man/man1/gfexec.10000644000000000000000000000203011507222725014240 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFEXEC" "1" "13 November 2006" "Gfarm" "" .SH NAME gfexec \- execute other commands in the Gfarm filesystem .SH SYNOPSIS \fBgfexec\fR [ \fB-N \fInumber-of-nodes\fB\fR ] [ \fB-I \fInode-index\fB\fR ] [ \fB-s\fR ] \fB\fIcommand\fB\fR [ \fB\fIargs\fB\fR\fI ...\fR ] .SH "DESCRIPTION" .PP \fBgfexec\fR executes the specified command in Gfarm filesystem. \fBgfexec\fR has to be executed on a filesystem node. .SH "OPTIONS" .TP \fB-N \fInumber-of-nodes\fB\fR Changes the number of nodes for the invoked program to the argument. .TP \fB-I \fInode-index\fB\fR Changes the index of the node for the invoked program to the argument. .TP \fB-s\fR This option is equivalent to the ``\fB-N\fR \fI1\fR \fB-I\fR \fI0\fR\&'' option. .TP \fB-?\fR Prints usage. gfarm-2.4.1/man/man1/Makefile0000644000000000000000000000054311507222725014364 0ustar rootroot# $Id: Makefile 3983 2008-05-27 13:51:18Z tatebe $ top_builddir = ../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk DOCBOOK_DIR=$(top_srcdir)/doc/docbook/en/ref/man1 include $(DOCBOOK_DIR)/Makefile.inc MAN = $(DOCBOOK) #gfrsh.1 gfssh.1 EXTRA_CLEAN_TARGETS = manpage.links manpage.refs include $(top_srcdir)/makes/man.mk gfarm-2.4.1/man/man1/gfsetdir.10000644000000000000000000000245111507222725014615 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFSETDIR" "1" "02 July 2003" "Gfarm" "" .SH NAME gfsetdir \- helper command for gfcd .SH SYNOPSIS \fBgfsetdir\fR [ \fB-s\fR | \fB-c\fR ] [ \fB\fIdirectory\fB\fR ] .SH "DESCRIPTION" .PP \fBgfsetdir\fR prints shell commands which change Gfarm working directory to the directory specified in the argument. If no argument is specified, it prints commands which change the working directory to the user's home directory that is gfarm:/\fIglobal_user_name\fR. .PP This command automatically detects user's shell type, and prints appropriate commands for the shell. .PP Please add the following definition to the shell rc file of each user, to define \fBgfcd\fR command. .TP \fBfor shells derived from Bourne shell\fR .nf gfcd() { eval "`gfsetdir $1`"; } .fi .TP \fBfor csh or tcsh\fR .nf alias gfcd 'eval `gfsetdir \\!*`' .fi .SH "OPTIONS" .TP \fB-s\fR generates Bourne shell commands. .TP \fB-c\fR generates C-shell commands. .TP \fB-?\fR displays a list of command options. .SH "SEE ALSO" .PP \fBgfcd\fR(1), \fBgfpwd\fR(1) gfarm-2.4.1/man/man1/gfcd.10000644000000000000000000000171711507222725013715 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFCD" "1" "02 July 2003" "Gfarm" "" .SH NAME gfcd \- change Gfarm working directory .SH SYNOPSIS \fBgfcd\fR [ \fB\fIdirectory\fB\fR ] .SH "DESCRIPTION" .PP \fBgfcd\fR changes Gfarm working directory to the directory specified in the argument. If no argument is specified, working directory is changed to the user's home directory that is gfarm:/\fIglobal_user_name\fR. .PP To use this command, please add the following setting to the shell rc file of each user. .TP \fBfor shells derived from Bourne shell\fR .nf gfcd() { eval "`gfsetdir $1`"; } .fi .TP \fBfor csh or tcsh\fR .nf alias gfcd 'eval `gfsetdir \\!*`' .fi .SH "SEE ALSO" .PP \fBgfpwd\fR(1), \fBgfsetdir\fR(1) gfarm-2.4.1/man/man1/gfchown.10000644000000000000000000000133211507222725014436 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFCHOWN" "1" "21 December 2008" "Gfarm" "" .SH NAME gfchown \- change Gfarm file owner and group .SH SYNOPSIS \fBgfchown\fR [ \fB\fIoptions\fB\fR ] \fBowner[:group]\fR [ \fB\fIpath\fB\fR\fI ...\fR ] \fBgfchown\fR [ \fB\fIoptions\fB\fR ] \fB:group\fR [ \fB\fIpath\fB\fR\fI ...\fR ] .SH "DESCRIPTION" .PP \fBgfchown\fR changes an owner and a group of Gfarm files. .SH "OPTIONS" .TP \fB-?\fR Displays a list of command options. gfarm-2.4.1/man/man1/gfxattr.10000644000000000000000000000475111507222725014472 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFXATTR" "1" "18 August 2009" "Gfarm" "" .SH NAME gfxattr \- Manipulate extended attributes in Gfarm file system .SH SYNOPSIS \fBgfxattr\fR [ \fB-s\fR | \fB-g\fR | \fB-l\fR | \fB-r\fR ] [ \fB-x\fR ] [ \fB-c\fR | \fB-m\fR ] [ \fB-f \fIxattrfile\fB\fR ] \fB\fIfile\fB\fR [ \fB\fIxattrname\fB\fR ] .SH "DESCRIPTION" .PP gfxattr manipulates extended attributes and XML extended attributes of a specified file. An extended attribute consists of an attribute name and an attribute value, which are arbitrary strings. An XML extended attribute is an extended attribute having an XML attribute value. Since XML extended attributes have a different name space from extended attributes, the same attribute name can be used. .PP When the -x option is specified, XML extended attributes are manipulated. It is possible to search XML extended attributes by XPath query using gffindxmlattr command. .PP All files and directories in Gfarm file system can keep extended attributes. When removing a file or directory, the associated extended attributes are also removed. .PP Either -s, -g, -l, or -r option should be specified. .SH "OPTIONS" .TP \fB-s\fR sets a new value with an extended attribute xattrname for a specified file. With the -f option, the value can be specified by the file xattrfile instead of by the standard input. When neither -c nor -m option is specified, the extended attribute is overwritten if it is already set. .TP \fB-g\fR reads a value with an extended attribute xattrname for a specified file. .TP \fB-l\fR display a list of extended attributes for a specified file. .TP \fB-r\fR removes a extended attribute xattrname for a specified file. .TP \fB-x\fR manipulates XML extended attributes. .TP \fB-c\fR sets a new extended attribute if it is not set. This option is used with the -s option. .TP \fB-m\fR modifies the extended attribute if there it is. This option is used with the -s option. .TP \fB-f xattrfile\fR With the -s option, reads an extended attribute from the specified xattrfile instead of from the standard input. With the -g option, writes the extended attribute to the specified xattrfile instead of to the standard output. .TP \fB-?\fR displays usage. .SH "SEE ALSO" .PP \fBgffindxmlattr\fR(1) gfarm-2.4.1/man/man1/gfdf.10000644000000000000000000000303011507222725013706 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFDF" "1" "30 December 2010" "Gfarm" "" .SH NAME gfdf \- display disk free space of Gfarm file system .SH SYNOPSIS \fBgfdf\fR [ \fB\fIoptions\fB\fR ] .SH "DESCRIPTION" .PP \fBgfdf\fR displays disk usage and free space of Gfarm file system. .SH "OPTIONS" .TP \fB-a\fR Displays only summary information of the Gfarm file system. .TP \fB-h\fR Displays numbers in human readable format by adding a prefix multiplier symbol like "M" (mega). Since this option uses powers of 1024, "M" means 1,048,576. .TP \fB-H\fR Displays numbers in human readable format by adding a prefix multiplier symbol like "M" (mega). Since this option uses powers of 1000, "M" means 1,000,000. .TP \fB-n\fR Displays hostnames of available Gfarm file system nodes. .TP \fB-r\fR Sort output in the reverse order. .TP \fB-S\fR Sort output in the increasing order of the available disk capacity. .TP \fB-P \fIpath\fB\fR Specifies a path name to specify a metadata server instead of the root metadata server. Note that this option is not effective with the -a option. .TP \fB-D \fIdomainname\fB\fR Specifies a domain name of filesystem nodes to list the status of disk free space. .TP \fB-?\fR Displays a list of command options. .SH "SEE ALSO" .PP \fBgfhost\fR(1), \fBgfarm2.conf\fR(5) gfarm-2.4.1/man/man1/gfimport_text.10000644000000000000000000000436011507222725015702 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFIMPORT_TEXT" "1" "06 June 2003" "Gfarm" "" .SH NAME gfimport_text \- divide and register a text file .SH SYNOPSIS \fBgfimport_text\fR [ \fB\fIoptions\fB\fR ] \fB\fIfile\fB\fR .SH "DESCRIPTION" .PP \fBgfimport_text\fR is a sample program for dividing a text file to file fragments by the line and registering it to the Gfarm filesystem. .SH "OPTIONS" .TP \fB-H \fIhostfile\fB\fR specifies a list of filesystem nodes. The \fIhostfile\fR consists of a hostname of a filesystem node in each line. The file is almost uniformly divided into file fragments. if ``-'' is specified, standard input is used to read the host list. .TP \fB-f \fIfragment-file\fB\fR specifies a \fIfragment-file\fR that consists of a fragment size in byte and a filesystem node separated by a white space in each line. if ``-'' is specified, standard input is used. .TP \fB-o \fIgfarm-URL\fB\fR specifies an output file. .TP \fB-?\fR displays a list of command options. .SH "EXAMPLES" .SS "IMPORTING BY SPLITTING TO SPECIFIED NUMBER OF FRAGMENTS" .PP The following is an example using \fBgfimport_text\fR to import a \fIsource_file\fR as \fIgfarm:file\fR by splitting to 8 fragments. .nf gfsched -N 8 | gfimport_text -H - -o gfarm:file source_file .fi .SS "IMPORTING BY SPLITTING TO SPECIFIED NUMBER OF FRAGMENTS FOR PARTICULAR PROGRAM" .PP The following is an example using \fBgfimport_text\fR to import a \fIsource_file\fR as \fIgfarm:file\fR by splitting to 8 fragments to be processed by \fIgfarm:prog\fR program. .nf gfsched -N 8 -p gfarm:prog | gfimport_text -H - -o gfarm:file source_file .fi .SS "IMPORTING INTO SAME DISPOSITION WITH AN EXISTING GFARM FILE" .PP The following is an example using \fBgfimport_text\fR to import a \fIsource_file\fR as \fIgfarm:file\fR into same disposition with existing file \fIgfarm:template\fR. .nf gfsched gfarm:template | gfimport_text -H - -o gfarm:file source_file .fi .SH "SEE ALSO" .PP \fBgfimport_fixed\fR(1), \fBgfsched\fR(1), \fBgfarm.conf\fR(5) gfarm-2.4.1/man/man1/gfrsh.10000644000000000000000000000010411507222725014110 0ustar rootroot.Id $Id: gfrsh.1 136 2002-08-29 11:39:13Z tatebe $ .so man1/gfrun.1 gfarm-2.4.1/man/man1/gfchmod.10000644000000000000000000000116011507222725014411 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFCHMOD" "1" "21 December 2008" "Gfarm" "" .SH NAME gfchmod \- change Gfarm file permission .SH SYNOPSIS \fBgfchmod\fR [ \fB\fIoptions\fB\fR ] \fBmode\fR [ \fB\fIpath\fB\fR\fI ...\fR ] .SH "DESCRIPTION" .PP \fBgfchmod\fR changes a permission of Gfarm files. .SH "OPTIONS" .TP \fB-?\fR Displays a list of command options. gfarm-2.4.1/man/man1/gfls.10000644000000000000000000000273011507222725013741 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFLS" "1" "11 March 2009" "Gfarm" "" .SH NAME gfls \- list contents of Gfarm directory .SH SYNOPSIS \fBgfls\fR [ \fB\fIoptions\fB\fR ] [ \fB\fIpath\fB\fR\fI ...\fR ] .SH "DESCRIPTION" .PP List information of files or contents of directories specified by \fIpath\fR\&. .SH "OPTIONS" .TP \fB-a\fR Do not hide entries starting with ``.''. .TP \fB-A\fR Do not list ``.'' and ``..''. .TP \fB-C\fR Multi-column output. This is the default output format. .TP \fB-d\fR List directory entries instead of the contents. .TP \fB-E \fIseconds\fB\fR Specifies seconds to hold attribute cache. If 0 is specified, attributes won't be cached. .TP \fB-F\fR Append indicator (one of */=@|) to entries. .TP \fB-i\fR Display inode number. .TP \fB-l\fR List in long format, including mode, owner, group, size in bytes, time of last modification for each file. .TP \fB-r\fR Reverse the order while sorting. .TP \fB-R\fR Recursively lists subdirectories encountered. .TP \fB-S\fR Sort by file size. .TP \fB-t\fR Sort by time stamp instead of by name. .TP \fB-T\fR With the \fB-l\fR option, show complete date format. .TP \fB-1\fR Prints one entry per line of output. .TP \fB-?\fR displays a list of command options. gfarm-2.4.1/man/man1/gfrun.10000644000000000000000000000740611507222725014134 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFRUN" "1" "13 November 2006" "Gfarm" "" .SH NAME gfrun, gfrsh, gfssh \- run Gfarm parallel programs .SH SYNOPSIS \fBgfrun\fR [ \fB\fIoptions\fB\fR ] \fB\fIcommand\fB\fR \fB\fIarg\fB\fR\fI ...\fR \fBgfrsh\fR [ \fB\fIoptions\fB\fR ] \fB\fIcommand\fB\fR \fB\fIarg\fB\fR\fI ...\fR \fBgfssh\fR [ \fB\fIoptions\fB\fR ] \fB\fIcommand\fB\fR \fB\fIarg\fB\fR\fI ...\fR .SH "DESCRIPTION" .PP \fBgfrun\fR executes a parallel command on filesystem nodes, which is determined by the \fB-G\fR option, the \fB-H\fR option, or the \fB-N\fR option. .PP The \fB-G\fR option specifies the \fIgfarm-URL\fR, which will be used by file-affinity scheduling. In this case, \fBgfrun\fR schedules the same number of filesystem nodes as the number of Gfarm fragments, taking into consideration the physical locations of each fragment replica of the Gfarm file, and filesystem node status. The \fB-H\fR option specifies the \fIhostfile\fR that lists filesystem nodes. The \fB-N\fR option specifies the number of filesystem nodes. .PP The \fB-G\fR, \fB-H\fR, and \fB-N\fR options are exclusive. When none of the \fB-G\fR, \fB-H\fR, or \fB-N\fR options are specified, \fBgfrun\fR schedules filesystem nodes by file-affinity scheduling using the first existent Gfarm file in the argument list, \fIargs\fR\&. If there are no existent Gfarm files in the argument list, an appropriate filesystem node is selected to be executed. .PP \fBgfrsh\fR and \fBgfssh\fR utilize rsh and ssh, respectively, instead of gfrcmd. .PP A \fIcommand\fR can be specified by a gfarm-URL that is registered using gfreg(1). .SH "OPTIONS" .TP \fB-G \fIgfarm-URL\fB\fR Specifies a Gfarm file \fIgfarm-URL\fR for file-affinity scheduling. Please read the DESCRIPTION section about how file-affinity scheduling works. .TP \fB-H \fIhostfile\fB\fR Specifies a \fIhostfile\fR that lists filesystem nodes. if ``-'' is specified, standard input is used to read the host list. .TP \fB-N \fInp\fB\fR Specifies the number of nodes, \fInp\fR, which are selected in the increasing order of load average. .TP \fB-r\fR Specifies an on-demand replication mode. In this mode, every file will be replicated before it is accessed remotely. .TP \fB-o \fIgfarm-URL\fB\fR Specifies a Gfarm file that the standard output of the executed program will be redirected to. .TP \fB-e \fIgfarm-URL\fB\fR Specifies a Gfarm file that the standard error of the executed program will be redirected to. .TP \fB-I \fIfragment-index\fB\fR Specifies a Gfarm fragment index executed by the gfrun command. This option is available only when either file-affinity scheduling is selected by the \fB-G\fR option or a gfarm file in the argument list, or the \fB-N\fR option is specified. .TP \fB-v\fR Displays error message verbosely. .TP \fB-p\fR Displays the elapsed time of each Gfarm parallel I/O API after the program terminates. .TP \fB-g\fR Explicitly specifies that the command is a Gfarm program. Gfarm specific options will be passed to the command as the result. .TP \fB-u\fR Explicitly specifies that the command is an ordinary program, and does not take Gfarm specific options. .TP \fB-b\fR Specifies global file view as the default file view for programs linked with the Gfarm syscall-hooking library. If this option is not specified, the default is local file view. .TP \fB-?\fR Displays a list of command options. .SH "ENVIRONMENT VARIABLES" .TP \fBGFRUN_CMD\fR Specifies a remote shell command. If globus-job-run is specified, gfrun executes each process using globus-job-run. .SH "SEE ALSO" .PP \fBgfmpirun_p4\fR(1) gfarm-2.4.1/man/man1/gfln.10000644000000000000000000000133011507222725013727 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFLN" "1" "19 March 2009" "Gfarm" "" .SH NAME gfln \- create a hardlink or a symbolic link .SH SYNOPSIS \fBgfln\fR [ \fB\fIoptions\fB\fR ] \fBtarget\fR \fBlink_name\fR .SH "DESCRIPTION" .PP \fBgfln\fR creates a hardlink \fIlink_name\fR linked to \fItarget\fR\&. When the -s option is specified, it creates a symbolic link. .SH "OPTIONS" .TP \fB-s\fR Creates a symbolic link. .TP \fB-?\fR Displays a list of command options. gfarm-2.4.1/man/man1/gfarm_agent.10000644000000000000000000000437311507222725015265 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFARM_AGENT" "1" "13 November 2006" "Gfarm" "" .SH NAME gfarm_agent \- Gfarm Filesystem Metadata Cache Server .SH SYNOPSIS \fBgfarm_agent\fR [ \fB\fIoptions\fB\fR ] .SH "DESCRIPTION" .PP \fBgfarm_agent\fR is a cache server for a Gfarm metadata server that can be shared by multiple hosts and multiple users. The cache server greatly improves performance and response time for a Gfarm filesystem by reducing network communication to a distant metadata server. .PP Any number of \fBgfarm_agent\fRs can be running on different nodes (or even on the same node) at the same time. Consistency among multiple cache servers and a metadata server is maintained. .SH "OPTIONS" .TP \fB-L \fIlog-level\fB\fR Specifies a log priority level. The log output, which priority is higher or equal to this level, will be sent to syslog or standard error. Please refer gfarm.conf(5) for the priority levels which can be specified by this option. .TP \fB-P \fIpid-file\fB\fR Specifies a file name which records the process ID of \fBgfarm_agent\fR\&. .TP \fB-S \fIsyslog-facility\fB\fR Specifies a syslog facility used to report errors by \fBgfarm_agent\fR\&. By default, local0 is used. .TP \fB-d\fR Specifies the debug mode. \fBgfarm_agent\fR runs in the foreground, not in the background. If this option is specified and \fB-L\fR is not specified, the log level is set to "debug". .TP \fB-f \fIconfig-file\fB\fR Specifies a configuration file that is read instead of the default configuration file. .TP \fB-m\fR Specifies the master mode. This improves metadata access performance by caching the path information. This option is only available when there is a single \fBgfarm_agent\fR running. .TP \fB-p \fIport-number\fB\fR Specifies a port number for TCP, to be used by gfarm_agent. .TP \fB-v\fR Displays verbose error messages in authentication. .TP \fB-?\fR Displays a list of command options. .SH "FILES" .TP \fB\fI%%SYSCONFDIR%%/gfarm.conf\fB\fR configuration file .SH "SEE ALSO" .PP \fBgfarm.conf\fR(5) gfarm-2.4.1/man/man1/gfmv.10000644000000000000000000000114411507222725013743 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFMV" "1" "21 December 2008" "Gfarm" "" .SH NAME gfmv \- move (rename) Gfarm file .SH SYNOPSIS \fBgfmv\fR [ \fB\fIoptions\fB\fR ] \fBsrc\fR \fBdest\fR .SH "DESCRIPTION" .PP \fBgfmv\fR moves or renames a Gfarm file from \fIsrc\fR to \fIdest\fR\&. .SH "OPTIONS" .TP \fB-?\fR Displays a list of command options. gfarm-2.4.1/man/man1/gfsched.10000644000000000000000000000624411507222725014415 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFSCHED" "1" "28 December 2010" "Gfarm" "" .SH NAME gfsched \- schedule and display available file system nodes .SH SYNOPSIS \fBgfsched\fR \fB-f \fIgfarm-URL\fB\fR [ \fB-D \fIdomain-name\fB\fR ] [ \fB-n \fInumber\fB\fR ] [ \fB-LMclw\fR ] \fBgfsched\fR [ \fB-P \fIgfarm-URL\fB\fR ] [ \fB-D \fIdomain-name\fB\fR ] [ \fB-n \fInumber\fB\fR ] [ \fB-LMlw\fR ] .SH "DESCRIPTION" .PP The \fBgfsched\fR command with the \fB-f\fR \fIgfarm-URL\fR option displays available file system nodes which have a file replica of the specified gfarm-URL. .PP When the \fB-f\fR \fIgfarm-URL\fR option is not specified, the \fBgfsched\fR command just displays available file system nodes. In this case, you can specify a metadata server by the \fB-P\fR \fIgfarm-URL\fR option, if necessary. .SH "OPTIONS" .TP \fB-D \fIdomain-name\fB\fR Limits file system node by specifying a domain name or a hostname. .TP \fB-c\fR Displays scheduling information for a file creation, if the file specified by \fB-f\fR doesn't exist. Currently, this option creates the specified file. But please note that this behavior may be changed in future. .TP \fB-L\fR Suppresses authentication check. Without this option, the scheduler checks whether the user will be successfully authenticated with the hosts or not. This option omits the check to make scheduling faster, but that creates a risk that hosts which fail authentication with the user may be scheduled. .TP \fB-M\fR Suppresses client-side scheduling and only performs metadata-server-side scheduling. This option makes scheduling faster, but also creates a risk that hosts which is network-unreachable or fails authentication with the user may be scheduled. .TP \fB-P \fIgfarm-URL\fB\fR Specifies a \fIgfarm-URL\fR or a pathname to identify a metadata server which is used for the scheduling. This option conflicts with the \fB-f\fR option. .TP \fB-f \fIgfarm-URL\fB\fR The \fBgfsched\fR command schedules file system nodes which have a replica of a file specified by this option. This option conflicts with the \fB-P\fR option. .TP \fB-l\fR Long format. This option displays port numbers as well as hostnames. Note that the display format of this option may be changed in future. .TP \fB-n \fInumber\fB\fR Displays specified number of file system nodes at most. If this option is not specified, it displays all available nodes. .TP \fB-w\fR Schedules with write-mode. When this option is specified, file system nodes which don't have enough free space won't be displayed. When both this option and the \fB-f\fR are specified, and if the file is already opened by an existing process with write-mode, the \fBgfsched\fR command only displays one file system node which is assigned for writing to the file. .TP \fB-?\fR Displays a list of command options. .SH "EXAMPLES" .PP The following is an example to inquire file system nodes that the metadata server thinks they are currently working. .nf $ gfsched -M .fi gfarm-2.4.1/man/man1/gfrep.10000644000000000000000000000624711507222725014120 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFREP" "1" "09 November 2009" "Gfarm" "" .SH NAME gfrep \- replicate Gfarm files .SH SYNOPSIS \fBgfrep\fR [ \fB-mnqvx\fR ] [ \fB-S \fIsource-domainname\fB\fR ] [ \fB-D \fIdestination-domainname\fB\fR ] [ \fB-h \fIsource-hostfile\fB\fR ] [ \fB-H \fIdestination-hostfile\fB\fR ] [ \fB-N \fInum-of-replicas\fB\fR ] [ \fB-j \fInum-of-threads\fB\fR ] \fB\fIpath\fB\fR\fI ...\fR .SH "DESCRIPTION" .PP \fBgfrep\fR creates specified number of replicas of Gfarm files specified by the \fIpath\fR to specified set of destination hosts. When set of source hosts are specified, only files stored on the set of source hosts are replicated. A set of hosts can be specified by a domain name and/or a host file. When both a domain name and a host file are specified, a set of hosts is determined by both conditions. .PP If the \fIpath\fR parameter is a directory, files under the directory will be copied recursively. .SH "OPTIONS" .TP \fB-S \fIsource-domainname\fB\fR Specifies the domain name of source filesystem nodes from which replicas will be copied. .TP \fB-D \fIdestination-domainname\fB\fR Specifies the domain name of destination filesystem nodes to which replicas will be copied. If neither this nor the \fB-H\fR option is specified, replicas may be copied to any available host. .TP \fB-h \fIsource-hostfile\fB\fR Specifies a file which describes hostnames of source filesystem nodes from which the replica will be made. The \fIsource-hostfile\fR consists of a filesystem node name on each line. if ``-'' is specified, standard input is used to read the host list. .TP \fB-H \fIdestination-hostfile\fB\fR Specifies a file which describes hostnames of destination filesystem nodes on which the replica will be made. The \fIdestination-hostfile\fR consists of a filesystem node name on each line. if ``-'' is specified, standard input is used to read the host list. .TP \fB-N \fInum-of-replicas\fB\fR Specifies the required number of file replicas, counting already existing ones. If there are a sufficient number of replicas in the destination hosts, neither any copying nor any removal will be done. If this option is not specified, \fB-N 1\fR is assumed. .TP \fB-j \fInum-of-threads\fB\fR Specifies the number of threads to create file replicas simultaneously. This option is only available when compiled by an OpenMP C compiler. By default, it will be the smallest among the number of total files, the number of source hosts, and the number of destination hosts. .TP \fB-m\fR Lets gfrep command do a migrate/move, instead of doing replication. .TP \fB-x\fR Removes file replicas when a set of destination nodes has more file replicas than specified. .TP \fB-n\fR Displays files to be replicated, but does nothing. .TP \fB-q\fR Suppresses non-error messages. .TP \fB-v\fR Displays verbose output. .TP \fB-?\fR Displays a list of command options. .SH "BUGS" .PP A source host is not always selected within a set of source hosts. gfarm-2.4.1/man/man1/gfwc.10000644000000000000000000000126511507222725013736 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFWC" "1" "25 April 2003" "Gfarm" "" .SH NAME gfwc \- print the number of bytes, words, and lines in Gfarm files .SH SYNOPSIS \fBgfmpirun_p4\fR \fBgfarm:gfwc\fR \fB\fIinput-gfarm-URL\fB\fR .SH "DESCRIPTION" .PP This is a sample application invoked with gfmpirun_p4(1). .PP \fBgfwc\fR reads from \fIinput-gfarm-URL\fR and prints the numbers of bytes, words, and lines to the standard output. gfarm-2.4.1/man/man1/gfchgrp.10000644000000000000000000000114711507222725014427 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFCHGRP" "1" "21 December 2008" "Gfarm" "" .SH NAME gfchgrp \- change Gfarm file group .SH SYNOPSIS \fBgfchgrp\fR [ \fB\fIoptions\fB\fR ] \fBgroup\fR [ \fB\fIpath\fB\fR\fI ...\fR ] .SH "DESCRIPTION" .PP \fBgfchgrp\fR changes a group of Gfarm files. .SH "OPTIONS" .TP \fB-?\fR Displays a list of command options. gfarm-2.4.1/man/man1/gfps.10000644000000000000000000000154711507222725013752 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFPS" "1" "12 November 2006" "Gfarm" "" .SH NAME gfps \- report process status .SH SYNOPSIS \fBgfps\fR [ \fB\fIoptions\fB\fR ] [ \fB\fIjobID\fB\fR\fI ...\fR ] .SH "DESCRIPTION" .PP \fBgfps\fR prints information about processes specified by the arguments. If the argments are missing, it prints information about all processes that have the same effective user ID. .SH "OPTIONS" .TP \fB-a\fR Lists information about all jobs. .TP \fB-l\fR Displays using the long format. .TP \fB-v\fR Displays error messages verbosely. .TP \fB-?\fR Displays a list of command options. gfarm-2.4.1/man/man1/gfstat.10000644000000000000000000000131611507222725014275 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GFSTAT" "1" "04 January 2010" "Gfarm" "" .SH NAME gfstat \- display file or directory status .SH SYNOPSIS \fBgfstat\fR [ \fB\fIoptions\fB\fR ] [ \fB\fIpath\fB\fR\fI ...\fR ] .SH "DESCRIPTION" .PP \fBgfstat\fR displays information about the specified files or directories in the Gfarm filesystem. .SH "OPTIONS" .TP \fB-c\fR displays only the number of file replicas. .TP \fB-?\fR displays a list of command options. gfarm-2.4.1/doc/0000755000000000000000000000000011507222730012054 5ustar rootrootgfarm-2.4.1/doc/KNOWN_PROBLEMS.ja0000644000000000000000000001703011507222722014571 0ustar rootroot¡ü gfarm Á´ÂΤ˴ؤï¤ëÌäÂêÅÀ - Linux ¤Î¤¤¤¯¤Ä¤«¤Î¥Ð¡¼¥¸¥ç¥ó¤Ë¤ª¤¤¤Æ¡¢/etc/nsswitch.conf ¤Ç ldap ¤ò »ØÄꤷ¤¿¾ì¹ç¡¢gfmd ¤Ç¥á¥â¥ê¡¼¥ê¡¼¥¯¤¬È¯À¸¤¹¤ë¾ì¹ç¤¬¤¢¤ê¤Þ¤¹¡£ ¤³¤ÎÌäÂê¤Ï¡¢Gfarm ¤Î¥Ð¥°¤Ç¤Ï¤Ê¤¯¡¢¥·¥¹¥Æ¥àÉí°¤Î¥é¥¤¥Ö¥é¥ê¤Î¥Ð¥°¤Ç¤¹¡£ ÌäÂ꤬À¸¤¸¤ë¤³¤È¤¬¤¢¤ë¤È³Îǧ¥Ç¥£¥¹¥È¥ê¥Ó¥å¡¼¥·¥ç¥ó: CentOS 5.4 with glibc-2.5-49.x86_64.rpm CentOS 5.5 with glibc-2.5-49.el5_5.7.x86_64.rpm Âкö: nscd ¤òµ¯Æ°¤·¤Æ¤ª¤±¤Ð¡¢¤³¤ÎÌäÂê¤ò²óÈò¤Ç¤­¤ë¤è¤¦¤Ç¤¹¡£ - Linux ¤Î¤¤¤¯¤Ä¤«¤Î¥Ð¡¼¥¸¥ç¥ó¤Ë¤ª¤¤¤Æ¡¢/etc/nsswitch.conf ¤Ç ldap ¤ò »ØÄꤷ¤¿¾ì¹ç¡¢gfarm ¥×¥í¥°¥é¥à¤ä gfsd ¤¬¥Ï¥ó¥°¤¹¤ë¾ì¹ç¤¬¤¢¤ê¤Þ¤¹¡£ ¤³¤ÎÌäÂê¤Ï¡¢Gfarm ¤Î¥Ð¥°¤Ç¤Ï¤Ê¤¯¡¢¥·¥¹¥Æ¥àÉí°¤Î¥é¥¤¥Ö¥é¥ê¤Î¥Ð¥°¤Ç¤¹¡£ ¶ñÂÎŪ¤Ë¤Ï¡¢°Ê²¼¤Î¾ò·ïÁ´¤Æ¤¬À®¤êΩ¤Ä¾ì¹ç¤ËȯÀ¸¤·¤Þ¤¹¡£ 1. ¤¢¤ë¥×¥í¥°¥é¥à¤¬ fork(2) ¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò¸Æ¤Ó½Ð¤¹¡£ 2. ¤½¤Î¥×¥í¥°¥é¥à¤¬¡¢fork(2) ¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò¸Æ¤Ó½Ð¤¹Á°¤Ë¡¢getpwuid(3) ¤Î¤è¤¦¤Ê¡¢´ÖÀÜŪ¤Ë nss_ldap ¥â¥¸¥å¡¼¥ë¤ò¸Æ¤Ó½Ð¤¹´Ø¿ô¤ò¸Æ¤Ó½Ð¤¹¡£ 3. ¤½¤Î¥×¥í¥°¥é¥à¤Î¿Æ¥×¥í¥»¥¹¤È»Ò¥×¥í¥»¥¹¤ÎξÊý¤¬¡¢fork(2) ¥·¥¹¥Æ¥à ¥³¡¼¥ë¸Æ¤Ó½Ð¤·¸å¤Ë¡¢¤½¤Î¤è¤¦¤Ê¼ïÎà¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤¹¡£ 4. ¤½¤Î¥×¥í¥°¥é¥à¤Ï¡¢pthread ¥é¥¤¥Ö¥é¥ê¤È¥ê¥ó¥¯¤µ¤ì¤Æ¤¤¤ë¡£ ¤³¤Î¾É¾õ¤Ï Fedora Core 3, Fedora Core 5 ¤ª¤è¤Ó CentOS 4.4 ¤Ç³Îǧ¤µ¤ì ¤Æ¤¤¤Þ¤¹¤¬¡¢Red Hat 8 ¤Ç¤Ï³Îǧ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£ ÂнèͽÄê: nss_ldap ¤Î³«È¯¸µ¤Ë´Ø¤·¤Æ¤Ï¡¢²¼µ­¤Î¥Ð¥°¥Ç¡¼¥¿¥Ù¡¼¥¹¤ò»²¾È¤·¤Æ ¤¯¤À¤µ¤¤¡£ http://bugzilla.padl.com/show_bug.cgi?id=271 http://bugzilla.padl.com/show_bug.cgi?id=414 ¶ñÂÎŪ¤Ê²ò·èºö¤Ï¡¢³Æ Linux ¥Ç¥£¥¹¥È¥ê¥Ó¥å¡¼¥·¥ç¥óºîÀ®Â¦¤Ë°Í¸¤·¤Þ¤¹¡£ Fedore Core Linux ¤Ë´Ø¤·¤Æ¤Ï²¼µ­¤Î¥Ð¥°¥Ç¡¼¥¿¥Ù¡¼¥¹¤ò»²¾È¤·¤Æ ¤¯¤À¤µ¤¤¡£ https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=154314 Red Hat Enterprise Linux ¤Ë´Ø¤·¤Æ¤Ï²¼µ­¤Î¥Ð¥°¥Ç¡¼¥¿¥Ù¡¼¥¹¤ò»²¾È¤·¤Æ ¤¯¤À¤µ¤¤¡£ https://bugzilla.redhat.com/show_bug.cgi?id=474181 Red Hat Enterprise Linux 5 ¤ª¤è¤Ó CentOS 5 ¤Ë¤Ä¤¤¤Æ¤Ï¡¢ nss_ldap-253-17.el5 °Ê¹ß¤Î RPM ¤Ç¾É¾õ¤¬´ËϤ¹¤ë²ÄǽÀ­¤¬¤¢¤ê¤Þ¤¹¤¬¡¢ ̤³Îǧ¤Ç¤¹¡£¤³¤Î RPM ¤Ë´Þ¤Þ¤ì¤ë½¤Àµ¤Ë¤Ä¤¤¤Æ¤Ï¡¢°Ê²¼¤Î RHBA-2009:0241-4 ¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£ http://www.jp.redhat.com/support/errata/RHBA/RHBA-2009-0241J.html - ¹âÉé²Ù»þ¤Ê¤É¡¢³Èĥ°À­ gfarm.ncopy ¤ÎÀßÄê¤Ë¤è¤ë¼«Æ°Ê£À½¤¬¹Ô¤Ê¤ï¤ì¤º¡¢ Ê£À½¿ô¤¬¾¯¤Ê¤¤¤Þ¤Þ¤Ë¤Ê¤ë¤³¤È¤¬¤¢¤ê¤Þ¤¹¡£ ÂнèͽÄê: 2011ǯ3·î¤Þ¤Ç¤Ë¤ÏÂн褹¤ëͽÄê¤Ç¤¹¡£ - gfs_pio_sync() ¤Ï¡¢¸½ºß¤Î¤È¤³¤í¥á¥¿¥Ç¡¼¥¿¤Î¹¹¿·¤ò¹Ô¤Ê¤Ã¤Æ¤¤¤Þ¤»¤ó¡£ ÂнèͽÄê: ̤Äê¤Ç¤¹¡£ - ¥Õ¥¡¥¤¥ë¥¢¥¯¥»¥¹¤Ë»È¤ï¤ì¤Æ¤¤¤ëºÇÃæ¤Ë¡¢gfsd ¤¬Í½´ü¤»¤Ì½ªÎ»¤ò¤·¤¿¾ì¹ç¡¢ ¤½¤Î¥Õ¥¡¥¤¥ë¤Ø¤Î°Ê¹ß¤Î¥¢¥¯¥»¥¹¤Ï¥¨¥é¡¼¤È¤Ê¤ê¤Þ¤¹¡£ ¥Õ¥¡¥¤¥ë¤ò¥ª¡¼¥×¥ó¤·Ä¾¤»¤Ð¥¢¥¯¥»¥¹²Äǽ¤Ë¤Ê¤ê¤Þ¤¹¡£ ¤³¤ì¤Ï¡¢¤¿¤È¤¨¤Ð¤½¤Î gfsd ¤òư¤«¤·¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤ò ¥ê¥Ö¡¼¥È¤·¤¿¾ì¹ç¤Ê¤É¤Ëµ¯¤­¤Þ¤¹¡£ ÂнèͽÄê: ̤Äê¤Ç¤¹¡£ - ¥Õ¥¡¥¤¥ë¥Ó¥å¡¼µ¡Ç½¤Ï¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£ ÂнèͽÄê: ̤Äê¤Ç¤¹¡£ - stat API ¤Ï¡¢¥Õ¥¡¥¤¥ë¤ò¥¯¥í¡¼¥º¤¹¤ë¤Þ¤Ç¡¢Àµ³Î¤Ê¥Õ¥¡¥¤¥ë¥µ¥¤¥º¤òÊÖ¤·¤Þ¤»¤ó¡£ ÂнèͽÄê: ̤Äê¤Ç¤¹¡£ - gfarm ¥é¥¤¥Ö¥é¥ê¤ò´û¤ËÍøÍѳ«»Ï¤·¤Æ¤¤¤ë¥×¥í¥°¥é¥à¤¬ fork(2) ¤·¤¿¾ì¹ç¡¢ gfarm ¥é¥¤¥Ö¥é¥ê¤Î API ¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤¬¤Ç¤­¤ë¤Î¤Ï¡¢¿Æ¥×¥í¥»¥¹¤«»Ò¥× ¥í¥»¥¹¤Î¤É¤Á¤é¤«¤À¤±¤Ç¤¹¡£Î¾Êý¤¬¥¢¥¯¥»¥¹¤ò¹Ô¤Ê¤Ã¤¿¾ì¹ç¡¢gfsd ¥µ¡¼¥Ð ¥×¥í¥»¥¹¤ËÂФ¹¤ë¿Æ»Ò¤Î¥ê¥¯¥¨¥¹¥È¤¬º®¤¶¤Ã¤Æ¤·¤Þ¤¦¤³¤È¤¬¤¢¤ë¤¿¤á¡¢ Àµ¤·¤¯Æ°ºî¤·¤Ê¤¤¤³¤È¤¬¤¢¤ê¤Þ¤¹¡£fork Á°¤Ë³ÎΩ¤·¤¿ gfsd ¥µ¡¼¥Ð¤È¤Î ¥³¥Í¥¯¥·¥ç¥ó¤Ï¡¢¿Æ»Ò¤Ç¶¦Í­¤µ¤ì¤Æ¤¤¤ë¤¿¤á¡¢¤â¤·¿Æ¤È»Ò¤¬Ê̤Υե¡¥¤¥ë¤ò ¥ª¡¼¥×¥ó¤·¤¿¾ì¹ç¤Ç¤â¡¢Æ±°ì¤Î gfsd ¥µ¡¼¥Ð¤Ø¤Î¥¢¥¯¥»¥¹¤È¤Ê¤ë¾ì¹ç¤Ë¤Ï¡¢ ÌäÂ꤬À¸¤¸¤Þ¤¹¡£ ¤Þ¤¿¡¢¿Æ¥×¥í¥»¥¹¤¬¥Õ¥¡¥¤¥ë¤ò¥ª¡¼¥×¥ó¸å fork(2) ¤·¡¢»Ò¥×¥í¥»¥¹¤Î¦¤¬ ¤½¤Î¥Õ¥¡¥¤¥ë¤Ë¥¢¥¯¥»¥¹¤¹¤ë¾ì¹ç¡¢¿Æ¥×¥í¥»¥¹¤¬ exit(3) ¤ò¸Æ¤ó¤Ç½ªÎ»¤¹¤ë ¤è¤ê¤âÁ°¤Ë¡¢»Ò¥×¥í¥»¥¹¤«¤é¤Î¥¢¥¯¥»¥¹¤Ï´°Î»¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£¤È¤¤¤¦ ¤Î¤Ï¡¢¿Æ¥×¥í¥»¥¹¤¬ exit(3) ´Ø¿ô¤ò¸Æ¤ó¤À»þ¤Ë¡¢gfsd ¤ËÂФ·¤Æ¡¢¤½¤Î¥Õ¥¡ ¥¤¥ë¤Î¥¯¥í¡¼¥ºÍ׵᤬Á÷¤é¤ì¤ë¤«¤é¤Ç¤¹¡£¤³¤Î¤¿¤á¡¢¿Æ¥×¥í¥»¥¹¤¬ exit(3) ¤·¤¿¸å¤Ï¡¢»Ò¥×¥í¥»¥¹¤«¤é¤Î¥¢¥¯¥»¥¹¤Ï¼ºÇÔ¤·¤Æ¤·¤Þ¤¤¤Þ¤¹¡£ ¤µ¤é¤Ë¡¢¿Æ¥×¥í¥»¥¹¤¬¥Õ¥¡¥¤¥ë¤ò¥ª¡¼¥×¥ó¸å fork(2) ¤·¤¿¾ì¹ç¡¢»Ò¥×¥í¥»¥¹ ¤Î¦¤¬¤½¤Î¥Õ¥¡¥¤¥ë¤ò¥¯¥í¡¼¥º¤·¤Æ¤â¡¢¤½¤Î¥¯¥í¡¼¥ºÍ×µá¤Ï¡¢gfsd ¤ØÁ÷¤é¤ì ¤Þ¤»¤ó¡£½¾¤Ã¤Æ¡¢²¼µ­¤Î¤è¤¦¤Ê½èÍý¤ò¹Ô¤Ê¤Ã¤¿¾ì¹ç¡¢¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ ÉÔ­¤Î¤¿¤á¡¢3. ¤Ï¼ºÇÔ¤¹¤ë²ÄǽÀ­¤¬¤¢¤ê¤Þ¤¹¡£ 1. ¿Æ¥×¥í¥»¥¹¤¬Æ±°ì¤Î gfsd ¤ËÂФ·¤ÆÂ¿¿ô¤Î¥Õ¥¡¥¤¥ë¤ò¥ª¡¼¥×¥ó¤·¤¿¾õÂÖ¤Ç fork(2) ¤¹¤ë¡£ 2. »Ò¥×¥í¥»¥¹¤Ï¡¢¤½¤é¤é¤Î¥Õ¥¡¥¤¥ë¤òÁ´¤Æ¥¯¥í¡¼¥º¤¹¤ë¡£ 3. »Ò¥×¥í¥»¥¹¤Ï¡¢Æ±¤¸ gfsd ¤¬ÊÝ»ý¤¹¤ë¥Õ¥¡¥¤¥ë¤ò¿¿ô¥ª¡¼¥×¥ó¤¹¤ë¡£ ¤³¤ì¤Ï¡¢2. ¤Ç¹Ô¤Ê¤Ã¤¿¥¯¥í¡¼¥º¤¬ gfsd ¤ËÅÁ¤ï¤é¤º¡¢gfsd ¤¬ 1. ¤Ç¥ª¡¼¥×¥ó ¤·¤¿¥Õ¥¡¥¤¥ë¤Î¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÊÝ»ý¤·Â³¤±¤Æ¤¤¤ë¤«¤é¤Ç¤¹¡£ ÂнèͽÄê: ̤Äê¤Ç¤¹¡£ - Ê£À½½èÍý¤òÅÓÃæ¤ÇÃæÃǤ¹¤ëÊýË¡¤¬¤¢¤ê¤Þ¤»¤ó¡£ ¤¿¤È¤¨ gfrep ¥³¥Þ¥ó¥É¤ò kill ¤·¤Æ¤â¡¢´û¤Ë¥Í¥Ã¥È¥ï¡¼¥¯´Ö¤Ç¤Î¥³¥Ô¡¼¤ò ³«»Ï¤·¤Æ¤¤¤ë¥Õ¥é¥°¥á¥ó¥È¤Ë¤Ä¤¤¤Æ¤Ï¡¢¤½¤ì¤¬´°Î»¤¹¤ë¤Þ¤Ç¡¢¥³¥Ô¡¼¤¬ ³¤¤¤Æ¤·¤Þ¤¤¤Þ¤¹¡£¤·¤«¤â¡¢¤½¤ì¤Ç¤Ç¤­¤¿Ê£À½¤Ë¤Ä¤¤¤Æ¤Ï¡¢¥á¥¿¥Ç¡¼¥¿¤Î ¹¹¿·¤Ï¹Ô¤Ê¤ï¤ì¤Þ¤»¤ó¡£ ÂнèͽÄê: ̤Äê¤Ç¤¹¡£ - gfarm ¥é¥¤¥Ö¥é¥ê¤Ï multithread safe ¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£ ÂнèͽÄê: ̤Äê¤Ç¤¹¡£ - gfarm ¥é¥¤¥Ö¥é¥ê¤Ï¡¢Ã±°ì¥×¥í¥»¥¹¤¬Ê£¿ô¤Î°Û¤Ê¤ë¥æ¡¼¥¶¸¢¸Â¤ò»È¤¤Ê¬¤±¤ë ¤è¤¦¤Ê¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤«¤é¤ÎÍøÍѤòÁÛÄꤷ¤Æ¤¤¤Þ¤»¤ó¡£ setuid() ¤ä setgid() ¤òÍѤ¤¤ë¤è¤¦¤Ê¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤«¤é¤ÎÍøÍѤò ÁÛÄꤷ¤Æ¤¤¤Þ¤»¤ó¡£ ÂнèͽÄê: ̤Äê¤Ç¤¹¡£ - NFS ¥µ¡¼¥Ð¤È¥¯¥é¥¤¥¢¥ó¥È¤ÎÁȹ礻¤Ë¤è¤Ã¤Æ¤Ï¡¢sharedsecret ǧ¾Ú¤Ë ¼ºÇÔ¤¹¤ë¤³¤È¤¬¤¢¤ê¤Þ¤¹¡£ ¤½¤Î¤è¤¦¤ÊÌäÂ꤬¤¢¤ë¤«Èݤ«¤Ï¡¢²¼µ­¤Î¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤·¤Æ¡¢Ç§¾Ú¤Ë ¼ºÇÔ¤¹¤ë¤³¤È¤¬¤¢¤ë¡¢¤¹¤Ê¤ï¤Á gfhost ¤Îɽ¼¨¤ÎÂèÆóÍ󤬡Ös¡×¤Ç¤Ï¤Ê¤¯ ¡Öx¡×¤È¤Ê¤ë¤³¤È¤¬¤¢¤ë¤«¤É¤¦¤«¤Ç³Îǧ¤Ç¤­¤Þ¤¹¡£ sh -c 'seq 60 | while read n; do gfkey -f; gfhost -l ¾¤Î¥Û¥¹¥È; done' ¤³¤³¤Ç¡Ö¾¤Î¥Û¥¹¥È¡×¤È¤¤¤¦¤Î¤Ï¡¢¤³¤Î¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤¹¤ë¥Û¥¹¥È¤È¡¢ NFS ¤Ç¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê¤ò¶¦Í­¤·¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Ç¤¹¡£ ¤³¤ÎÌäÂ꤬À¸¤¸¤ë¾ì¹ç¡¢²¼µ­¤Î¤è¤¦¤ÊÊýË¡¤Î¤¤¤º¤ì¤«¤Ç²óÈò¤Ç¤­¤Þ¤¹¡£ ¡¦¡Ögfkey -f -p Éÿô¡×¤Ç¡¢Í­¸ú´ü´Ö¤ò»ØÄꤷ¤Æ¸°¤òÀ¸À®¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ ¤³¤Î´ü´Ö¤ò½½Ê¬Ä¹¤¯ÀßÄꤷ¡¢¥¸¥ç¥Ö¤Î¼Â¹ÔÃæ¤Ë¡¢¸°¤ÎºÆÀ¸À®¤¬À¸¤¸¤Ê¤¤ ¤è¤¦¤Ë¤·¤Þ¤¹¡£(¥Ç¥Õ¥©¥ë¥È¤ÎÍ­¸ú´ü´Ö¤Ï°ìÆü¤Ç¤¹¡£) ¡¦Ç§¾ÚÊý¼°¤ò sharedsecert ¤«¤é¡¢gsi_auth ¤¢¤ë¤¤¤Ï gsi ¤ËÊѹ¹¤·¤Þ¤¹¡£ ¡¦ÌäÂê¤Îµ¯¤­¤Ê¤¤ NFS ¥µ¡¼¥Ð¤ËÊѹ¹¤¹¤ë¤³¤È¤Ë¤è¤Ã¤Æ¤â²óÈò¤Ç¤­¤Þ¤¹¡£ ÌäÂ꤬À¸¤¸¤ë¤³¤È¤¬¤¢¤ë¤È³Îǧ¤µ¤ì¤¿Áȹ礻 NFS ¥µ¡¼¥Ð NFS ¥¯¥é¥¤¥¢¥ó¥È Linux 2.6.12 (Fedora Core 4) Linux 2.4.20 (RedHat 8) Linux 2.6.12 (Fedora Core 4) Linux 2.6.9 (Fedora Core 3) Linux 2.6.12 (Fedora Core 4) Linux 2.6.11 (Fedora Core 4) ÌäÂ꤬À¸¤¸¤Æ¤¤¤Ê¤¤Áȹ礻 NFS ¥µ¡¼¥Ð NFS ¥¯¥é¥¤¥¢¥ó¥È Solaris 2.6 Linux 2.4.18 (RedHat 8) NetBSD 3.0 Linux 2.4.18 (RedHat 8) ÂнèͽÄê: ̤Äê¤Ç¤¹¡£ - ÀßÄê²Äǽ¤Ê´Ä¶­ÊÑ¿ô¤Ë´Ø¤¹¤ë»²¾È¥Þ¥Ë¥å¥¢¥ë¤¬Â¸ºß¤·¤Þ¤»¤ó¡£ ÂнèͽÄê: ̤Äê¤Ç¤¹¡£ ¡ü gfarm ¥³¥Þ¥ó¥É·²¤Ë´Ø¤¹¤ëÌäÂêÅÀ - ²¼µ­¤Î¥³¥Þ¥ó¥É¤¬Â¸ºß¤·¤Þ¤»¤ó¡£ gfdump, gfcd, gfpwd, gfsck, gftest ÂнèͽÄê: ̤Äê¤Ç¤¹¡£ - ²¼µ­¤Î¥³¥Þ¥ó¥É¤Ë´Ø¤¹¤ë»²¾È¥Þ¥Ë¥å¥¢¥ë¤¬Â¸ºß¤·¤Ê¤¤¤«¡¤¹¹¿·¤µ¤ì¤Æ¤¤¤Þ¤» ¤ó¡£ config-gfarm, config-gfarm-update, config-gfsd, gfarm.arch.guess, gfexport, gfreg, gfrm, gfarm-pcp, gfarm-prun, gfquota, gfedquota, gfquotacheck, gfusage, gfvoms-sync ÂнèͽÄê: ̤Äê¤Ç¤¹¡£ ¡ü gfarm2fs ¥³¥Þ¥ó¥É¤Ë´Ø¤¹¤ëÌäÂêÅÀ - Ʊ°ì¥Õ¥¡¥¤¥ë¤ËÂФ·¤ÆÊ£¿ô¤Î°Û¤Ê¤ë open(2) ¤ò¹Ô¤Ê¤Ã¤¿¾ì¹ç¡¢Ä̾ï¤Î¥Õ¥¡¥¤¥ë ¥·¥¹¥Æ¥à¤ËÂФ·¤Æ read(2)/write(2) ¤ò¹Ô¤Ê¤Ã¤¿¾ì¹ç¤ËÆÀ¤é¤ì¤ë¤è¤¦¤Ê°ì´ÓÀ­¤Ï¡¢ ɬ¤º¤·¤âÆÀ¤é¤ì¤Þ¤»¤ó¡£ ¤³¤ì¤Ï gfarm2fs ¤¬¡¢¤½¤ì¤¾¤ì¤Î open(2) ¤Ë¤Ä¤¤¤ÆÊ̤Πgfs_pio_open() ¤ä gfs_pio_create() ¸Æ¤Ó½Ð¤·¤ò¹Ô¤Ê¤¤¡¢¤½¤Î·ë²Ì¡¢gfarm ¥é¥¤¥Ö¥é¥ê¤ä¥«¡¼¥Í¥ë ¤Î¥Í¥Ã¥È¥ï¡¼¥¯ÁؤÇÊÌ¡¹¤Ë¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¤¬¤µ¤ì¤ë¤¿¤á¤Ç¤¹¡£ ¤¿¤È¤¨¤Ð PostgreSQL ¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¥Õ¥¡¥¤¥ë¤ògfarm2fs ¤ÇÄ󶡤·¤è¤¦¤È ¤¹¤ë¤È¡¢¤³¤ÎÌäÂê¤Î¤¿¤á¡¢PostgreSQL ¤¬Àµ¾ï¤Ëưºî¤·¤Þ¤»¤ó¡£ ÂнèͽÄê: ̤Äê¤Ç¤¹¡£ - ftruncate(2) ¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò¸Æ¤Ó½Ð¤·¤¿¸å¡¢Æ±¤¸¥Õ¥¡¥¤¥ë¤ËÂФ¹¤ë read(2) ¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬¡¢´üÂÔ¤µ¤ì¤ë¤è¤ê¤âû¤¤¥µ¥¤¥º¤òÊÖ¤¹¤³¤È¤¬ ¤¢¤ê¤Þ¤¹¡£ ¤³¤ì¤Ï¡¢FUSE ¤¬¤³¤Î¾ì¹ç¤Ë getattr ¥¨¥ó¥È¥ê¥Ý¥¤¥ó¥È¤ò¸Æ¤Ó½Ð¤·¡¢¤½¤Î ·ë²Ì¡¢¾å½Ò¤Î¡Östat API ¤¬¡¢¥Õ¥¡¥¤¥ë¤ò¥¯¥í¡¼¥º¤¹¤ë¤Þ¤Ç¡¢Àµ³Î¤Ê¥Õ¥¡¥¤¥ë ¥µ¥¤¥º¤òÊÖ¤µ¤Ê¤¤¡×ÌäÂê¤Î±Æ¶Á¤ò¼õ¤±¤ë¤¿¤á¤Ç¤¹¡£ ÂнèͽÄê: ̤Äê¤Ç¤¹¡£ gfarm-2.4.1/doc/xattr-man.ja0000644000000000000000000001124311507222722014305 0ustar rootroot³Èĥ°À­À©¸æ¥³¥Þ¥ó¥É gfxattr, gffindxmlattr <1> ÀßÄê¥Þ¥Ë¥å¥¢¥ë ³Èĥ°À­¥¤¥ó¥¹¥È¡¼¥ë¥Þ¥Ë¥å¥¢¥ë¤Ë½¾¤Ã¤Æ¥»¥Ã¥È¥¢¥Ã¥×¤¹¤ë¤À¤±¤Ç¤è¤¤¡£ <2> ¥³¥Þ¥ó¥É¥Þ¥Ë¥å¥¢¥ë (1)gfxattr [name] ³Èĥ°À­¤ÎÀßÄꡦ¼èÆÀ¡¦Â°À­Ì¾°ìÍ÷¡¦ºï½ü¤ò¹Ô¤¦¡£ Ä̾ï¤Î³Èĥ°À­¤ÈXML³Èĥ°À­¤òÁàºî¤¹¤ë¡£ [Usage] gfxattr [-s|-g|-l|-r] [-x] [-c|-m] [-f ] file [xattrname] -s,-g,-l,-r : ¤¤¤º¤ì¤«¤ò»ØÄê¡£ -s¤Ç³Èĥ°À­¤ÎÀßÄê -g¤Ç³Èĥ°À­¤Î¼èÆÀ -l¤Ç³Èĥ°À­Ì¾°ìÍ÷¤Î¼èÆÀ -r¤Ç³Èĥ°À­¤Îºï½ü -x : »ØÄꤵ¤ì¤Æ¤¤¤¿¾ì¹ç¤ÏXML³Èĥ°À­¤ò½èÍý¤¹¤ë¡£ -c,-m : -s¤ÈÊ»¤»¤Æ¤¤¤º¤ì¤«¤ò»ØÄê¡£ -c¤Ç³Èĥ°À­¤Î¿·µ¬ÀßÄê -m¤Ç³Èĥ°À­¤Î¹¹¿· -f : ÀßÄꤹ¤ë°À­¥Ç¡¼¥¿¤Î¥Õ¥¡¥¤¥ë¡¢¤¢¤ë¤¤¤Ï¡¢ ¼èÆÀ¤·¤¿¥Ç¡¼¥¿¤Î¥Õ¥¡¥¤¥ë file : ½èÍýÂоݤΥե¡¥¤¥ë¤ÎGfarm¥Ñ¥¹ xattrname : ½èÍýÂоݤγÈĥ°À­Ì¾ [ÀâÌÀ] ÀßÄê file¤Ë°À­Ì¾xattrname¤Î³Èĥ°À­¤òÀßÄꤹ¤ë¡£ °À­¥Ç¡¼¥¿¤Ï¡¢-f¤Ç»ØÄꤵ¤ì¤¿xattrfile¤ÎÆâÍÆ¤«¡¢¤½¤ì¤¬Ìµ»ØÄê¤Ê¤é ɸ½àÆþÎϤȤ¹¤ë¡£ ÀßÄꤹ¤ë¤Ë¤Ï¡¢¤½¤Î¥Õ¥¡¥¤¥ë¤Î½ñ¤­¹þ¤ß¸¢¸Â¤¬É¬ÍפǤ¢¤ë¡£ -c»ØÄꤹ¤ì¤Ðxattrname¤¬´û¸¤Î»þ¤Ï¥¨¥é¡¼¤È¤Ê¤ë¡£ -m»ØÄꤹ¤ì¤Ðxattrname¤¬ÉԺߤλþ¤Ï¥¨¥é¡¼¤È¤Ê¤ë¡£ -c, -m ¤Î¤¤¤º¤ì¤â̵»ØÄê¤Î¾ì¹ç¡¢xattrname¤¬ÉԺߤʤ鿷µ¬ÀßÄê¡¢ ´û¸¤Ê¤é¾å½ñ¤­¤È¤¹¤ë¡£ ¼èÆÀ file¤Ë°À­Ì¾xattrname¤Î³Èĥ°À­¤ò¼èÆÀ¤¹¤ë¡£ °À­¥Ç¡¼¥¿¤Ï¡¢-f¤Ç»ØÄꤵ¤ì¤¿xattrfile¤Ë½ñ¤­½Ð¤¹¤«¡¢¤½¤ì¤¬Ìµ»ØÄê¤Ê¤é ɸ½à½ÐÎϤ˽ñ¤­½Ð¤¹¡¢ ¼èÆÀ¤¹¤ë¤Ë¤Ï¡¢¤½¤Î¥Õ¥¡¥¤¥ë¤ÎÆÉ¤ß¹þ¤ß¸¢¸Â¤¬É¬ÍפǤ¢¤ë¡£ °À­Ì¾°ìÍ÷¼èÆÀ file¤ËÀßÄꤵ¤ì¤Æ¤¤¤ëÁ´¤Æ¤Î³Èĥ°À­Ì¾¤ò¼èÆÀ¤·¡¢É¸½à½ÐÎϤËɽ¼¨¤¹¤ë¡£ ¼èÆÀ¤¹¤ë¤Ë¤Ï¡¢¤½¤Î¥Õ¥¡¥¤¥ë¤ÎÆÉ¤ß¹þ¤ß¸¢¸Â¤¬É¬ÍפǤ¢¤ë¡£ ºï½ü file¤Ë°À­Ì¾xattrname¤Î³Èĥ°À­¤òºï½ü¤¹¤ë¡£ ºï½ü¤¹¤ë¤Ë¤Ï¡¢¤½¤Î¥Õ¥¡¥¤¥ë¤Î½ñ¤­¹þ¤ß¸¢¸Â¤¬É¬ÍפǤ¢¤ë¡£ [»ÈÍѾå¤ÎÃí°Õ] ³Èĥ°À­¤Ï¡¢Gfarm¾å¤ÎÁ´¤Æ¤Î¥Õ¥¡¥¤¥ë¡ÊÄ̾ï¥Õ¥¡¥¤¥ë¤Ç¤â¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤â¡Ë ÀßÄê¤Ç¤­¤ë¡£ ¥Õ¥¡¥¤¥ë¤òºï½ü¤¹¤ë¤È¡¢¤½¤Î¥Õ¥¡¥¤¥ë¤ËÀßÄꤵ¤ì¤Æ¤¤¤¿³Èĥ°À­¤âÁ´¤Æ¾ÃÌǤ¹¤ë¡£ Ä̾ï¤Î³Èĥ°À­¤ÈXML³Èĥ°À­¤ÏÆÈΩ¤Ç¤¢¤ë¤Î¤Ç¡¢Æ±°ì¤Î°À­Ì¾¤òÍøÍѲÄǽ¤Ç¤¢¤ë¡£ Ä̾ï¤Î³Èĥ°À­¤Î°À­¥Ç¡¼¥¿¤È¤·¤Æ¡¢¶õ¤Î¥Ç¡¼¥¿¡¢¥Æ¥­¥¹¥È¥Ç¡¼¥¿¡¢¥Ð¥¤¥Ê¥ê ¥Ç¡¼¥¿¤Î¤¤¤º¤ì¤âÀßÄê²Äǽ¤Ç¤¢¤ë¡£ XML³Èĥ°À­¤È¤·¤ÆÀßÄê¤Ç¤­¤ë¤Î¤Ï¡¢¶õ¤Ç¤Ê¤¤ÀµÅö¤ÊXML¤À¤±¤Ç¤¢¤ë¡£¤½¤¦¤Ç¤Ê¤¤ ¾ì¹ç¡¢EINVAL¥¨¥é¡¼¤È¤Ê¤ë¡£ ÀßÄꤹ¤ëXML¤ÎÀèÆ¬¤Ë¤È ¤¤¤¦¤è¤¦¤ÊXMLÀë¸Àʸ¤Ï¤¢¤Ã¤Æ¤â¤Ê¤¯¤Æ¤âÎɤ¤¡£¤¿¤À¤·¡¢¼èÆÀ¤¹¤ë¤È ɬ¤º¤½¤Î¹Ô¤Ï¾Ã¤¨¤ë¡£¤³¤ì¤ÏPostgreSQL¤Ë»ÅÍͤˤè¤ë¤â¤Î¤Ç¡¢XML ³Èĥ°À­¤Î»ÅÍͤȤ¹¤ë¡£ ³Èĥ°À­Ì¾¤Ï¡¢ºÇÂç256ʸ»ú¤Þ¤Ç¤È¤¹¤ë¡£ Linux OS¤Ï¡¢³Èĥ°À­¤ÎºÇÂç¥Ç¡¼¥¿¥µ¥¤¥º¤ò64KB¤ËÀ©¸Â¤·¤Æ¤¤¤ë¡£¤³¤Î¤¿¤á¡¢ ËÜ¥³¥Þ¥ó¥É¤Ë¤è¤êGfarm¾å¤Ë¤½¤ì°Ê¾å¤Î¥µ¥¤¥º¤Î³Èĥ°À­¥Ç¡¼¥¿¤òÀßÄꤷ¤Æ¤â¡¢ fuse·Ðͳ¤Ç¼èÆÀ¤Ç¤­¤ë¤Î¤ÏÀèÆ¬¤Î64KB¤Þ¤Ç¤È¤Ê¤ë¡£attr(1)»²¾È¡£ (2)gffindxmlattr [name] »ØÄꤵ¤ì¤¿XPath¼°¤Ë°ìÃפȤ¹¤ë³Èĥ°À­¤ò¸¡º÷¤¹¤ë¡£ [Usage] gffindxmlattr [-d depth] [-F delim] {expr | -f } path -d depth : path¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Î»þ¡¢¸¡º÷¤¹¤ë¿¼¤µ¡£ -F delim : ¸«¤Ä¤«¤Ã¤¿¥Ñ¥¹Ì¾¤È³Èĥ°À­Ì¾¤Î¶èÀÚ¤êʸ»ú¡£ ¥Ç¥Õ¥©¥ë¥È¤Ï¥¿¥Ö¤È¤¹¤ë¡£ expr : ¸¡º÷¤¹¤ëXPath¼° -f : ¸¡º÷¤¹¤ëXPath¼°¤Î½ñ¤«¤ì¤¿¥Õ¥¡¥¤¥ë¤Î¥Ñ¥¹ path : ¸¡º÷³«»Ï¤¹¤ëGfarm¤Î¥Õ¥¡¥¤¥ë¥Ñ¥¹ [ÀâÌÀ] »ØÄꤵ¤ì¤¿XPath¼°¤Ë°ìÃפȤ¹¤ë³Èĥ°À­¤ò¡¢path¤Ë¤Ä¤¤¤Æ¸¡º÷¤·¡¢¸«¤Ä¤«¤Ã¤¿ ¥Ñ¥¹Ì¾¤È³Èĥ°À­Ì¾¤òɸ½à½ÐÎϤËɽ¼¨¤¹¤ë¡£ path¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤±¤ì¤Ð¡¢¤½¤Î¥Õ¥¡¥¤¥ë¤ÎXML³Èĥ°À­¤À¤±¤ò¸¡º÷¤¹¤ë¡£ ÆÉ¤ß¹þ¤ß¸¢¸Â¤Î¤Ê¤¤¥Õ¥¡¥¤¥ë¤Ï̵»ë¤¹¤ë¡Ê¤¢¤Ã¤Æ¤â¥¨¥é¡¼¤È¤·¤Ê¤¤¡Ë¡£ ¥Ç¥£¥ì¥¯¥È¥ê¤Î¾ì¹ç¡¢depth¤Ç»ØÄꤵ¤ì¤¿¿¼¤µ¤Þ¤ÇºÆµ¢Åª¤Ë¸¡º÷¤¹¤ë¡£ 0¤Ê¤é¤Ð¼«¥Ç¥£¥ì¥¯¥È¥ê¤Î¤ß¡¢1¤Ê¤é¤Ð¥µ¥Ö¥Ç¥£¥ì¥¯¥È¥ê¤Þ¤Ç¤Ê¤É¤È¤Ê¤ë¡£ ̵»ØÄê¤Ê¤é¤Ð¡¢ÌµÀ©¸Â¤Ë¸¡º÷¤¹¤ë¡£Éé¤ÎÃͤϥ¨¥é¡¼¤È¤¹¤ë¡£ ¤Þ¤¿¡¢¼Â¹Ô(X)¸¢¸Â¤Î¤Ê¤¤¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤Ä¤¤¤Æ¤Ï¡¢¥µ¥Ö¥Ç¥£¥ì¥¯¥È¥ê¤ò ¸¡º÷¤·¤Ê¤¤¡£¤³¤Î¤è¤¦¤Ê¾ì¹ç¤Ç¤â¡¢¸¡º÷¥¨¥é¡¼¤Ë¤Ï¤Ê¤é¤Ê¤¤¡£ ½ÐÎÏ·ë²Ì¤Ï¡¢¸«¤Ä¤«¤Ã¤¿¥Ñ¥¹Ì¾(¥³¥Þ¥ó¥É¤Ë»ØÄꤷ¤¿path¤ò´Þ¤à)¤È³Èĥ°À­Ì¾¤ò ¶èÀÚ¤êʸ»ú¤Ç¶èÀڤäÆÉ½¼¨¤¹¤ë¡£ [¼Â¹ÔÎã] % gffindxmlattr /a / / attr /dir1 attr2 [»ÈÍѾå¤ÎÃí°Õ] ¸¡º÷Ãæ¤Ërename¤äºï½ü¤¬µ¯¤³¤Ã¤¿¾ì¹ç¡¢¸¡º÷·ë²Ì¤ÎÀµÅöÀ­¤ÎÊݾڤϤʤ¤¡£ ¸«¤Ä¤«¤Ã¤¿¥Ñ¥¹Ì¾¤ä³Èĥ°À­Ì¾¤Ë¡¢¶èÀÚ¤êʸ»ú¤ÈƱ¤¸Ê¸»ú¤¬¤¢¤Ã¤¿¾ì¹ç¡¢ ¶èÀÚ¤êʸ»ú¤¬Ê£¿ôɽ¼¨¤µ¤ì¤ë¤³¤È¤Ë¤Ê¤ë¡£¤½¤Î¾ì¹ç¤Ï¶èÀÚ¤êʸ»ú¤È¤·¤Æ ŬÅö¤Êʸ»ú¡ÊÎó¡Ë¤ò-F¥ª¥×¥·¥ç¥ó¤Ç»ØÄꤹ¤ë¤³¤È¡£ gfarm-2.4.1/doc/SETUP.private.en0000644000000000000000000001547011507222722014761 0ustar rootroot Private Gfarm Filesystem Setup Manual About this document =================== This document describes how to configure a private Gfarm filesystem by a non privileged user. If problems occur, please refer to the Trouble Shooting section in Gfarm-FAQ.en. Overview ======== Install the Gfarm software from the source code, and configure a metadata server, and filesystem nodes. Gfarm installation from the source code ======================================= This document assumes the installation directory to be $HOME/local/gfarm_v2, which is specified by the environment variable PREFIX. % export PREFIX=$HOME/local/gfarm_v2 Configure and install the Gfarm file system from the source code. % ./configure --prefix=$PREFIX % make % make install For details, refer to INSTALL.en document. Configuration of a Gfarm metadata server ======================================== o Configuration of the Gfarm filesystem At first, add a binary directory of the Gfarm file system, and change to the $PREFIX directory. % export PATH=$PREFIX/bin:$PATH % cd $PREFIX Run 'config-gfarm' to configure a Gfarm filesystem. % config-gfarm --prefix $PREFIX -S -m -p where is a listening TCP port number of the gfmd, and is a listening TCP port number of a backend database. It is necessary to use a port number of 1024 or greater for a non privileged user. needs to be accessed from outside by TCP. The -S option specifies to configure a private Gfarm file system for a non priviledged user. config-gfarm creates a Gfarm configuration file, $PREFIX/etc/gfarm2.conf, $PREFIX/etc/gfsd.conf and $PREFIX/etc/gfmd.conf. Create a shared secret key (~/.gfarm_shared_key) in the home directory. % cd % gfkey -f -p 31536000 This example sets up an expiration date of about one year (31536000 seconds). o Firewall configuration The Gfarm metadata server should be able to accept TCP connections at a port that are specified by the -m option of the config-gfarm command. Configuration of a Gfarm filesystem node ======================================== o Configuration of a filesystem node When the $PREFIX directory is not shared among the metadata server and a filesystem node, it is necessary to copy $PREFIX/etc/gfarm2.conf $PREFIX/etc/gfsd.conf $PREFIX/etc/usermap to a $PREFIX/etc directory on the filesystem node. Execute the following command to configure the filesystem node. % config-gfsd --prefix $PREFIX -S -p where is a listening TCP port number of the gfsd. It is necessary to use a port number of 1024 or greater for a non privileged user. needs to be accessed from outside by TCP. The -S option specifies to configure a private Gfarm file system for a non priviledged user. The last argument of config-gfsd is a spool directory, which stores physical files in Gfarm file system. Note that the spool directory should be a non-shared area among filesystem nodes. If you do not specify the directory, it would be $PREFIX/var/gfarm-spool. o Firewall configuration Filesystem nodes should be able to accept TCP connections and UDP packet reception and transmission at the port that is specified by the -p option of the config-gfsd command. Also, it requires the same settings as those of the client nodes. Configuration of a Gfarm client node ==================================== This chapter describes configuration only for a client node. o Configuration of a client node Copy /etc/gfarm2.conf from the metadata server to the client node. Note: This setting can be substituted for copying to ~/.gfarm2rc. If user's home directory is shared among metadata server and file system nodes, there is nothing to do. If not, .gfarm_shared_key needs to be copied from the metadata server. o Firewall configuration Client nodes should be able to initiate TCP connections to the metadata server, at the port specified by the -m option of the config-gfarm command. Furthermore, they should be able to initiate TCP connections and should be able to send/receive UDP packets to filesystem nodes, from the port specified by the -p option of the config-gfsd command. Testing of the Gfarm filesystem =============================== You can check whether the Gfarm filesystem works or not using any client, since it can be accessed (or shared) by every client node. o gfls - Directory listing 'gfls' lists the contents of a directory. % gfls -la drwxrwxr-x gfarmadm gfarmadm 4 Aug 23 06:33 . drwxrwxr-x gfarmadm gfarmadm 4 Aug 23 06:33 .. drwxr-xr-x tatebe gfarmadm 0 Aug 22 16:08 tmp o gfhost - Filesystem node information 'gfhost -M' displays the information for filesystem nodes registered with the metadata server. % gfhost -M i386-fedora3-linux 2 linux-1.example.com 600 0 i386-fedora3-linux 2 linux-2.example.com 600 0 i386-fedora3-linux 2 linux-3.example.com 600 0 i386-redhat8.0-linux 1 linux-4.example.com 600 0 sparc-sun-solaris8 1 solaris-1.example.com 600 0 sparc-sun-solaris8 1 solaris-2.example.com 600 0 ... 'gfhost -l' displays the status of the filesystem nodes. % gfhost -l 0.01/0.03/0.03 s i386-fedora3-linux 2 linux-1.example.com 600 0(10.0.0.1) 0.00/0.00/0.00 s i386-fedora3-linux 2 linux-2.example.com 600 0(10.0.0.2) -.--/-.--/-.-- - i386-fedora3-linux 2 linux-3.example.com 600 0(10.0.0.3) 0.00/0.02/0.00 x i386-redhat8.0-linux 1 linux-4.example.com 600 0(10.0.0.4) 0.10/0.00/0.00 G sparc-sun-solaris8 1 solaris-1.example.com 600 0(10.0.1.1) x.xx/x.xx/x.xx - sparc-sun-solaris8 1 solaris-2.example.com 600 0(10.0.1.2) ... The second field shows the status of authentication with the filesystem node. 's', 'g', and 'G' show successful authentication, while 'x' shows an authentication failure. '-.--/-.--/-.--' in the first field shows that gfsd has not executed correctly, and 'x.xx/x.xx/x.xx' shows the filesystem node is probably down. For details of the above Gfarm commands, refer to the respective man page. Further examples of advanced functionality ========================================== o File replica creation Each file in the Gfarm filesystem can have several file copies that can be stored on two and more filesystem nodes. Multiple file copies of the same file enables access to the file even when one of the filesystem nodes is down. Moreover, it enables prevention of access performance deterioration by allowing access to different file copies. The 'gfwhere' command displays the location of file copies, or a replica catalog, of the specified files. % gfwhere .bashrc linux-1.example.com The 'gfrep' command creates file copies. % gfrep -s linux-1.example.com -d linux-2.example.com .bashrc % gfwhere .bashrc linux-1.example.com linux-2.example.com In this case, '.bashrc' has two copies; one is stored on linux-1.example.com and the other is stored on linux-2.example.com. gfarm-2.4.1/doc/voms-man.ja0000644000000000000000000001717611507222722014142 0ustar rootrootvomsÏ¢·È¥³¥Þ¥ó¥É gfvoms-sync <1> ÀßÄê¥Þ¥Ë¥å¥¢¥ë vomsÏ¢·È¥³¥Þ¥ó¥É¤Ç¤ÏvomsID¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ëɬÍפ¬¤¢¤ë¡£ vomsID¤Ï/etc/gfarm.vomsids¤ÇÀßÄꤹ¤ë¡£ vomsids¤ÎÃæ¤Ë " <¥Ý¡¼¥ÈÈÖ¹æ>" ¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤Ç°ì¹Ô°ì¥Û¥¹¥È¤ÇvomsID¤òÄêµÁ¤¹¤ë¡£ vomsID¤Ï¥æ¡¼¥¶¡¼¤ÇǤ°Õ¤Ë·è¤á¤Æ¤è¤¤¡£ÍøÍѲÄǽʸ»ú¤Ï¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È¡¢¿ô»ú¡¢ "-(¥Ï¥¤¥Õ¥ó)"¡¢ "_(¥¢¥ó¥À¡¼¥Ð¡¼)"¤Ç¤¢¤ë¡£ host¤ÏIPv4, IPv6, ¥Û¥¹¥È̾¤Ç»ØÄê¤Ç¤­¤ë¡£ ¥Ý¡¼¥ÈÈÖ¹æ¤Ï¾Êά²Äǽ¡£¾Êά»þ¤Ï8443¤¬¥Ç¥Õ¥©¥ë¥È¤ÇÍøÍѤµ¤ì¤ë¡£ <2> ¥³¥Þ¥ó¥É¥Þ¥Ë¥å¥¢¥ë (1)gfvoms-sync [name] gfarm¤Î¥á¥ó¥Ð¡¼¥·¥Ã¥×¾ðÊó¤òvoms¤Î¥á¥ó¥Ð¡¼¥·¥Ã¥×¾ðÊó¤ÈƱ´ü¤¹¤ë¡£ gfarm¤Î¥°¥ë¡¼¥×¤«¤éÆÃÄê¤Îvoms,vo¤Î¥°¥ë¡¼¥×¤òºï½ü¤¹¤ë¡£ [Usage] gfvoms-sync (-s|-d) -V -v [-g ] [-a ] [-h] [-n] -s,-d : ¤¤¤º¤ì¤«¤ò»ØÄê¡£ -s¤Ç»ØÄêvoms¤Î»ØÄêvo¤È¤ÎƱ´ü -d¤Ç»ØÄêvoms¤Î»ØÄêvo¤Î¥°¥ë¡¼¥×¾ðÊó¤ògfarm¤«¤éºï½ü -V : vomsID¤ò»ØÄê¡£vomsID¤Ïvomsids¤ÇÄêµÁ¤µ¤ì¤¿¤â¤Î¤¬»²¾È¤µ¤ì¤ë¡£ -v : vo̾¤ò»ØÄê¡£ -g : »ØÄꤵ¤ì¤¿¥á¥ó¥Ð¡¼¥·¥Ã¥×¾ðÊó¥Õ¥¡¥¤¥ë¤òÍøÍѤ·¤ÆÆ±´ü¤¹¤ë¡£ -d¥ª¥×¥·¥ç¥ó»ØÄê¤Î¤È¤­¤Ï̵»ë¤µ¤ì¤ë¡£ -a : vomsIDÄêµÁ¥Õ¥¡¥¤¥ë¤Î¥Ñ¥¹¤ò»ØÄꤹ¤ë¡£ -h : »ØÄꤵ¤ì¤Æ¤¤¤¿¾ì¹ç¤ÏUsage¤ò½ÐÎϤ·¤Æ½ªÎ»¤¹¤ë¡£ -n : ¥Ç¥Ð¥Ã¥°ÍÑ¥ª¥×¥·¥ç¥ó¡£gfarm¤Ø¤ÎƱ´ü¡¦ºï½ü¤ò¹Ô¤ï¤º¡¢ gfarm¹Ô¤ï¤ì¤ëÁàºîÆâÍÆ¤òɸ½à½ÐÎϤËɽ¼¨¤¹¤ë¡£gfvoms-update¤ò»²¾È¡£ [ÀâÌÀ] Ʊ´ü -s¥ª¥×¥·¥ç¥ó¤Çgfarm¤Î¥á¥ó¥Ð¡¼¥·¥Ã¥×¾ðÊó¤ò»ØÄêvoms¤Îvo¤Î¥á¥ó¥Ð¡¼¥·¥Ã¥×¾ðÊó¤ÈƱ´ü¤¹¤ë¡£ -V¥ª¥×¥·¥ç¥ó¤Ç»ØÄꤵ¤ì¤ëvomsID¤Ï¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï/etc/gfarm.vomsids¤Ç¤ÎÄêµÁ¤ò»²¾È¤¹¤ë¡£ -a¥ª¥×¥·¥ç¥ó¤Ç»²¾È¤¹¤ë¥Õ¥¡¥¤¥ë¤òÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ ¥Ç¥Õ¥©¥ë¥È¤Ç¤Ïvoms¤Î¥á¥ó¥Ð¡¼¥·¥Ã¥×¾ðÊó¤ò¼èÆÀ¤·¤Æ¤«¤éƱ´ü¤¹¤ë¤¬¡¢ -g¥ª¥×¥·¥ç¥ó¤Ç¥á¥ó¥Ð¡¼¥·¥Ã¥×¥Õ¥¡¥¤¥ë¤ò»ØÄꤹ¤ë¤È¤½¤Á¤é¤òÍøÍѤ¹¤ë¤¿¤á¡¢voms¤Î¾ðÊó¼èÆÀ¤Ï ¹Ô¤ï¤ì¤Ê¤¤¡£ ºï½ü -d¥ª¥×¥·¥ç¥ó¤Çgfarm¤Î¥á¥ó¥Ð¡¼¥·¥Ã¥×¾ðÊ󤫤黨Äêvoms¤Îvo¤Î¥°¥ë¡¼¥×¤òºï½ü¤¹¤ë¡£ -V¥ª¥×¥·¥ç¥ó¤Ç»ØÄꤵ¤ì¤ëvomsID¤Ï¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï/etc/gfarm.vomsids¤Ç¤ÎÄêµÁ¤ò»²¾È¤¹¤ë¡£ -a¥ª¥×¥·¥ç¥ó¤Ç»²¾È¤¹¤ë¥Õ¥¡¥¤¥ë¤òÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ "^:/($|/)"¤Ç¥Þ¥Ã¥Á¤¹¤ë¤â¤Î¤¬ºï½üÂоݤȤʤ롣 -g¥ª¥×¥·¥ç¥ó¤Ï̵»ë¤µ¤ì¤ë¡£ [»ÈÍѾå¤ÎÃí°Õ]¡£ Ʊ´ü¤Ç-g¥ª¥×¥·¥ç¥ó¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï¡¢¥á¥ó¥Ð¡¼¥·¥Ã¥×¾ðÊó¤Ï"/tmp/vomslist.tmp"¤Ë°ì»þÊݸ¤µ¤ì¡¢ gfvoms-update¤¬À®¸ù¤¹¤ë¤Èºï½ü¤µ¤ì¤ë¡£¤³¤Î¾ì¹ç"/tmp"¤Ø¤Î½ñ¤­¹þ¤ß¸¢¸Â¤¬¤¢¤ë¥æ¡¼¥¶¡¼¤Ç¼Â¹Ô¤¹¤ë¤³¤È¡£ ¤³¤ÎƱ´ü¥³¥Þ¥ó¥É¤Ë¤è¤é¤Ê¤¤Ä̾ï¼ê³¤­¤ÇÅÐÏ¿¤¹¤ë¥°¥ë¡¼¥×̾¤¬:/¤Ë°ìÃפ¹¤ë¤È¡¢ voms Ï¢·È¥°¥ë¡¼¥×̾¤È´ÇÐö¤µ¤ì¤Æ¡¢Ï¢·È½èÍý»þ¤Ëºï½ü¤µ¤ì¤ë¡£ ±¿ÍѾ塢¤³¤¦¤·¤¿Ì¾Á°¤Î¥°¥ë¡¼¥×¤ÏºîÀ®¤·¤Ê¤¤¤è¤¦¤ËÃí°Õ¤¹¤ë¤³¤È¡£ (Ãí) gfvoms-sync¤Ïgfvoms-sync.py¤òµ¯Æ°¤¹¤ë¥·¥§¥ë¥¹¥¯¥ê¥×¥È¡£ gfvoms-sync¤ÇɬÍפÊÀßÄê¤ò¤·¤¿¾å¤Çgfvoms-sync.py¤ò¸Æ¤Ó½Ð¤·¤Æ¤¤¤ë¤Î¤Ç¡¢ ľÀÜgfvoms-sync.py, gfvoms-list¤òµ¯Æ°¤·¤¿¤¤¾ì¹ç¤Ë¤ÏɬÍפʥե¡¥¤¥ë¤¬ ¥¤¥ó¥Ý¡¼¥È¤Ç¤­¤ë¤è¤¦¤ËÀßÄê¤ò¤¹¤ëɬÍפ¬¤¢¤ë¡£ (2)gfvoms-list [name] »ØÄê¤Îvoms¤Îvo¤Î¥á¥ó¥Ð¡¼¥·¥Ã¥×¾ðÊó¤ò¼èÆÀ¤¹¤ë¡£ [Usage] gfvoms-list -V -v [-f ] [-m ] [-a ] [-h] -V : vomsID¤ò»ØÄê¡£vomsID¤Ïvomsids¤ÇÄêµÁ¤µ¤ì¤¿¤â¤Î¤¬»²¾È¤µ¤ì¤ë¡£ -v : vo̾¤ò»ØÄê¡£ -f : ¥á¥ó¥Ð¡¼¥·¥Ã¥×¾ðÊó¤Î¼èÆÀÂоݥ桼¥¶¡¼¤ò»ØÄꤷ¤¿¥Õ¥¡¥¤¥ë¤ò»ØÄê¡£ »ØÄ꤬¤Ê¤¤¾ì¹ç¤Ïvoms¤ÎÁ´¥æ¡¼¥¶¡¼¤¬ÂоݤȤʤ롣 -m : ¥á¥ó¥Ð¡¼¥·¥Ã¥×¾ðÊó¥Õ¥¡¥¤¥ë¤ÎÊݸÀè¤ò»ØÄê¡£ »ØÄ꤬¤Ê¤¤¾ì¹ç¤Ïɸ½à½ÐÎϤ˽ñ¤­½Ð¤¹¡£ -a : vomsIDÄêµÁ¥Õ¥¡¥¤¥ë¤Î¥Ñ¥¹¤ò»ØÄꤹ¤ë¡£ -h : »ØÄꤵ¤ì¤Æ¤¤¤¿¾ì¹ç¤ÏUsage¤ò½ÐÎϤ·¤Æ½ªÎ»¤¹¤ë¡£ [ÀâÌÀ] -V¥ª¥×¥·¥ç¥ó¤Ç»ØÄꤵ¤ì¤¿voms¤«¤évo¤Î¥á¥ó¥Ð¡¼¥·¥Ã¥×¾ðÊó¤ò¼èÆÀ¤¹¤ë¡£ -V¥ª¥×¥·¥ç¥ó¤Ç»ØÄꤵ¤ì¤ëvomsID¤Ï¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï/etc/gfarm.vomsids¤Ç¤ÎÄêµÁ¤ò»²¾È¤¹¤ë¡£ -a¥ª¥×¥·¥ç¥ó¤Ç»²¾È¤¹¤ë¥Õ¥¡¥¤¥ë¤òÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ -f¥ª¥×¥·¥ç¥ó¤Ç¥á¥ó¥Ð¡¼¥ê¥¹¥È¤ò»ØÄꤹ¤ë¤È¼èÆÀ¤¹¤ë¥á¥ó¥Ð¡¼¤ò¹Ê¤ê¹þ¤à¤³¤È¤¬¤Ç¤­¤ë¡£ ¥á¥ó¥Ð¡¼¥ê¥¹¥È¤Ï"user="¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤Ç¡¢°ì¹Ô°ì¥æ¡¼¥¶¡¼¤Ç»ØÄꤹ¤ë¡£ ¼èÆÀ¤µ¤ì¤¿voms¤Î¥á¥ó¥Ð¡¼¥·¥Ã¥×¾ðÊó¤Ï¥Ç¥Õ¥©¥ë¥È¤Ç¤Ïɸ½à½ÐÎϤËɽ¼¨¤µ¤ì¤ë¤¬¡¢ -m¥ª¥×¥·¥ç¥ó¤Ç¡¢¥Õ¥¡¥¤¥ë¤Ø¤Î½ÐÎϤËÊѹ¹¤Ç¤­¤ë¡£ [»ÈÍѾå¤ÎÃí°Õ] ¾ðÊó¼èÆÀÃæ¤Ë voms¤Ç¤Î¸¢¸Â¤¬¤Ê¤¤Áàºî¤ò¤·¤è¤¦¤È¤·¤¿¾ì¹ç ¥°¥ë¡¼¥×̾+¥í¡¼¥ë̾¤¬255ʸ»ú¤òͤ¨¤¿¾ì¹ç ¤Ï¡¢¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤òɽ¼¨¤·¤Æ¡¢¤½¤Î¤Þ¤Þ½èÍý¤ò³¤±¤ë¡£ ¤½¤ì°Ê³°¤Î¥¨¥é¡¼¤Ç¤Ï¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤ò½Ð¤·¤Æ½ªÎ»¤¹¤ë¡£ (Ãí) voms¤ËÀܳ¤¹¤ë¤È¤­¡¢"/etc/grid-security/hostcert.pem"¡¢"/etc/grid-security/hostkey.pem"¤òÍøÍѤ¹¤ë¡£ ¤³¤ì¤é¤ÎÆÉ¤ß¹þ¤ß¸¢¸Â¤¬¤¢¤ë¥æ¡¼¥¶¡¼¤Ç¼Â¹Ô¤¹¤ë¤³¤È¡£ ¤Þ¤¿¡¢ÍøÍѤ¹¤ëÈëÌ©¸°¤Ë¥Ñ¥¹¥Õ¥ì¡¼¥º¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢Ê£¿ô²ó¥Ñ¥¹¥Õ¥ì¡¼¥º¤òÆþÎϤ¹¤ëɬÍפ¬¤¢¤ë¡£ Ä̾ï"/etc/grid-security/hostkey.pem"¤Ï¥Ñ¥¹¥Õ¥ì¡¼¥º¤ÏÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¤¬¡¢Ãí°Õ¤¹¤ë¤³¤È¡£ (3)gfvoms-update [name] gfarm¾å¤Î»ØÄê¤Îvoms¤Îvo¤Î¥°¥ë¡¼¥×¤Î¿·µ¬Äɲᦺï½ü¡¦¹¹¿·¤ò¹Ô¤¦¡£ gfarm¾å¤Î»ØÄê¤Îvoms¤Îvo¤Î¥°¥ë¡¼¥×¤Îºï½ü¤ò¹Ô¤¦¡£ [Usage] gfvoms-update [-d] -V -v -m [-h] [-n] -V : vomsID¤ò»ØÄê¡£vomsID¤Ïvomsids¤ÇÄêµÁ¤µ¤ì¤¿¤â¤Î¤¬»²¾È¤µ¤ì¤ë¡£ -v : vo̾¤ò»ØÄê¡£ -d : »ØÄêvoms¤Î»ØÄêvo¤Î¥°¥ë¡¼¥×¾ðÊó¤ògfarm¤«¤éºï½ü¤¹¤ë¡£ -m : »ÈÍѤ¹¤ëvoms¥á¥ó¥Ð¡¼¥·¥Ã¥×¾ðÊó¥Õ¥¡¥¤¥ë¤ò»ØÄê¡£ -d¥ª¥×¥·¥ç¥ó»ØÄê»þ¤Ï̵»ë¤µ¤ì¤ë¡£ -h : »ØÄꤵ¤ì¤Æ¤¤¤¿¾ì¹ç¤ÏUsage¤ò½ÐÎϤ·¤Æ½ªÎ»¤¹¤ë¡£ -n : ¥Ç¥Ð¥Ã¥°ÍÑ¥ª¥×¥·¥ç¥ó¡£gfarm¤Ø¤ÎƱ´ü¡¦ºï½ü¤ò¹Ô¤ï¤º¡¢ gfarm¤Ë¹Ô¤ï¤ì¤ëÁàºîÆâÍÆ¤òɸ½à½ÐÎϤËɽ¼¨¤¹¤ë¡£ [ÀâÌÀ] Ʊ´ü -m¥ª¥×¥·¥ç¥ó¤Ç»ØÄꤵ¤ì¤¿voms¤Î¥á¥ó¥Ð¡¼¥·¥Ã¥×¥Õ¥¡¥¤¥ë¤ò»È¤Ã¤Æ gfarm¤Î»ØÄêvoms¤Îvo¤Î¥á¥ó¥Ð¡¼¥·¥Ã¥×¾ðÊó¤ò¥Õ¥¡¥¤¥ëÆâÍÆ¤ÈƱ´ü¤¹¤ë¡£ ¥Õ¥¡¥¤¥ëÆâ¤Ç¤Î¥Ø¥Ã¥À¡¼¾ðÊó¤È-V, -v¥ª¥×¥·¥ç¥ó¤Ç»ØÄꤵ¤ì¤¿voms, vo¤¬°ã¤Ã¤Æ¤¤¤¿¾ì¹ç¤Ï Ʊ´ü¤µ¤ì¤Ê¤¤¡£ Ʊ´ü¤Ï¡¢voms¤Ç¤Î¥á¥ó¥Ð¡¼¥·¥Ã¥×¾ðÊó¤Ègfarm¤Î¥á¥ó¥Ð¡¼¥·¥Ã¥×¾ðÊó¤òÈæ¤Ù¤Æ voms¤Ë¤¢¤Ã¤Ægfarm¤Ë¤Ê¤¤¥°¥ë¡¼¥×¤Ï¿·µ¬Äɲà gfarm¤Ë¤¢¤Ã¤Ævoms¤Ë¤Ê¤¤¥°¥ë¡¼¥×¤Ïºï½ü ξ¼Ô¤Ë¤¢¤Ã¤Æ¡¢¥á¥ó¥Ð¡¼¤¬°ã¤¦¥°¥ë¡¼¥×¤Ïvoms¤Î¾ðÊó¤Ë¹¹¿· ¤¬¹Ô¤ï¤ì¤ë¡£ -V¥ª¥×¥·¥ç¥ó¤Ç»ØÄꤵ¤ì¤ëvomsID¤Ï¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï/etc/gfarm.vomsids¤Ç¤ÎÄêµÁ¤ò»²¾È¤¹¤ë¡£ -a¥ª¥×¥·¥ç¥ó¤Ç»²¾È¤¹¤ë¥Õ¥¡¥¤¥ë¤òÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ ºï½ü -d¥ª¥×¥·¥ç¥ó¤Çgfarm¤Î¥á¥ó¥Ð¡¼¥·¥Ã¥×¾ðÊ󤫤黨Äêvoms¤Îvo¤Î¥°¥ë¡¼¥×¤òºï½ü¤¹¤ë¡£ -V¥ª¥×¥·¥ç¥ó¤Ç»ØÄꤵ¤ì¤ëvomsID¤Ï¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï/etc/gfarm.vomsids¤Ç¤ÎÄêµÁ¤ò»²¾È¤¹¤ë¡£ -a¥ª¥×¥·¥ç¥ó¤Ç»²¾È¤¹¤ë¥Õ¥¡¥¤¥ë¤òÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£ "^:/($|/)"¤Ç¥Þ¥Ã¥Á¤¹¤ë¤â¤Î¤¬ºï½üÂоݤȤʤ롣 -g¥ª¥×¥·¥ç¥ó¤Ï̵»ë¤µ¤ì¤ë¡£ [»ÈÍѾå¤ÎÃí°Õ] -n¤Ï¥Ç¥Ð¥Ã¥°ÍÑ¥ª¥×¥·¥ç¥ó¡£¿·µ¬Äɲ尥롼¥×¡¦¹¹¿·¥°¥ë¡¼¥×¡¦ºï½ü¥°¥ë¡¼¥×¤È ¤½¤ì¤¾¤ì¤Î¥á¥ó¥Ð¡¼¤¬É½¼¨¤µ¤ì¤ë¤À¤±¤Ç¼ÂºÝ¤ÎÁàºî¤Ï¹Ô¤ï¤ì¤Ê¤¤¡£ -d¤Çºï½ü¤ò¹Ô¤¦¾ì¹ç¡¢"^:/($|/)"¤Ç¥Þ¥Ã¥Á¤¹¤ë¤â¤Î¤¬ºï½üÂоݤȤʤ롣 ¤³¤ÎƱ´ü¥³¥Þ¥ó¥É¤Ë¤è¤é¤Ê¤¤Ä̾ï¼ê³¤­¤ÇÅÐÏ¿¤¹¤ë¥°¥ë¡¼¥×̾¤¬ void:/vo̾ ¤Ë°ìÃפ¹¤ë¤È¡¢ voms Ï¢·È¥°¥ë¡¼¥×̾¤È´ÇÐö¤µ¤ì¤Æ¡¢Ï¢·È½èÍý»þ¤Ëºï½ü¤µ¤ì¤ë¡£ ±¿ÍѾ塢¤³¤¦¤·¤¿Ì¾Á°¤Î¥°¥ë¡¼¥×¤ÏºîÀ®¤·¤Ê¤¤¤è¤¦¤ËÃí°Õ¤¹¤ë¤³¤È¡£ gfarm-2.4.1/doc/voms-dev.ja0000644000000000000000000001311611507222722014133 0ustar rootroot VOMS Ï¢·È 1. ³µÍ× VOMS ¤Î¥á¥ó¥Ð¡¼¥·¥Ã¥×¾ðÊó¤Ëgfarm¤Î¥°¥ë¡¼¥×¾ðÊó¤òƱ´ü¤µ¤»¤ë¡£ ´ÉÍý¼Ô¤¬Ç¤°Õ¤ËƱ´ü¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤·¡¢»ØÄꤵ¤ì¤¿VOMS¤Ë´Ø¤·¤Æ¡¢ gfarm ¾å¤ÎÅö³ºVOMS¤Ë´ØÏ¢¤¹¤ë¥°¥ë¡¼¥×¾ðÊó¤ò¹¹¿·¤·¡¢¥æ¡¼¥¶¤Î ¥°¥ë¡¼¥×¾ðÊó¤â¹¹¿·¤¹¤ë¡£ gfarm ¾å¤Î¥°¥ë¡¼¥×̾¤Ï¡¢Ä¹¤µÀ©¸Â¤ò¤Ê¤¯¤·¡¢ VOMS ¤Î vomsid, VO̾¡¢¥°¥ë¡¼¥×¡¢¥µ¥Ö¥°¥ë¡¼¥×̾¡¢¥í¡¼¥ë̾ ¤«¤éÀ¸À®¤¹¤ë¡£ Capability ¤Ï´û¤Ë¿ä¾©¤µ¤ì¤Æ¤¤¤Ê¤¤¤Î¤ÇÂбþ¤·¤Ê¤¤¡£ Ä̾ï¼ê³¤­¤ÇºîÀ®¤µ¤ì¤¿¥°¥ë¡¼¥×̾¤¬vomsid, VO̾¤Ë°ìÃפ·¤¿¾ì¹ç¡¢ VOMSÏ¢·È½èÍý¤Ç¹¹¿·Âоݥ°¥ë¡¼¥×¤È´ÇÐö¤µ¤ìºï½ü¤µ¤ì¤¦¤ë¤Î¤Ç¥æ¡¼¥¶¡¼¤Ï Ãí°Õ¤òÍפ¹¤ë¡£ 2. Ʊ´ü¥³¥Þ¥ó¥É gfvoms-sync -s [-n] [-g group-list] [-a void-list] -V void -v voname gfvoms-sync -d [-a void-list] -V void -v voname -s ¤ÏƱ´ü»Ø¼¨¤ò¼¨¤¹¡£ -n ¤Ïgfarm ¤Î¹¹¿·¤ò¹Ô¤ï¤ºÂбþɽ¤ò½ÐÎϤ¹¤ë¤³¤È¤ò»Ø¼¨¤¹¤ë¡£ -g ¤Ï¥°¥ë¡¼¥×̾ɽ¤ò»ØÄꤷ¤Æ¹¹¿·¤ò»Ø¼¨¤¹¤ë¡£ -a ¤Ï vomsid ¤È¥Û¥¹¥È̾¤ÎÂбþ¥ê¥¹¥È¤ò»Ø¼¨¤¹¤ë¡£ -V ¤Ïvomsid ʸ»úÎó¤ò»ØÄꤹ¤ë¡£ -v ¤ÏVO ̾¤ò»ØÄꤹ¤ë¡£ -d ¤Ïvo ¤Îºï½ü¤ò»Ø¼¨¤¹¤ë¡£ 1. gfarm¥æ¡¼¥¶¡¼¥Æ¡¼¥Ö¥ë¤Ïgfarm´ÉÍý¼Ô¤¬ ¥æ¡¼¥¶¡¼Ì¾¤ÈDN¡¢¤ª¤è¤Óreal-name, home-dir ¤ò»ØÄꤷ¤Æ ¸ÄÊ̤Ë(VOMSÏ¢·Èµ¡Ç½¤Ç¤Ï¤Ê¤¯¡ËÅÐÏ¿¡¢ºï½ü¤ò¹Ô¤¦¤â¤Î¤È¤·¡¢ ËÜVOMSÏ¢·È¤ÎÈϰϳ°¤È¤¹¤ë¡£ 2. vomsidÂбþ¥ê¥¹¥È¤Ï¡¢Ê£¿ôVOMS¤ËÂбþ¤·¤ÆVO̾¤À¤±¤Ç¤Ï¥æ¥Ë¡¼¥¯¤Ë ¤Ê¤é¤Ê¤¤¤³¤È¤ËÈ÷¤¨¤Æ¡¢VOMS¤ËÂФ·¤Ævomsid ¤ò¿¶¤ë¤¿¤á¤Î¥Õ¥¡¥¤¥ë¤Ç¡¢ ´ÉÍý¼Ô¤¬ºîÀ®¤·¤Æ¤ª¤¯¡£ Âбþ¤Ï "id ¥Û¥¹¥Èfqn ¥Ý¡¼¥È"¤òµ­½Ò¤¹¤ë¡£ 3. ¥°¥ë¡¼¥×¤ÎƱ´ü¤Ïgfarm´ÉÍý¼Ô¤¬¡¢ VO¤ò»ØÄꤷ¤Æ¹Ô¤¤¡¢Åö³ºVO¤Ë´ØÏ¢¤¹¤ë¥°¥ë¡¼¥×¥¨¥ó¥È¥ê¡¼¤ò¹¹¿·¤¹¤ë¡£ VO¾å¤Ë¤Ê¤¯¤Ê¤Ã¤¿Gfarm¾å¤Î¥°¥ë¡¼¥×¤Ïºï½ü¤¹¤ë¡£ 4. Ʊ´ü¤Ï´ÉÍý¼Ô¥³¥Þ¥ó¥É(gfvoms-sync)¤Ç¹Ô¤¤¡¢VOMS¤Î¥á¥ó¥Ð¡¼¥·¥Ã¥×¾ðÊó¤Î ¡¡ Ãê½Ð¤È¡¢gfarm ¤Î¥°¥ë¡¼¥×¥Æ¡¼¥Ö¥ë¤Î¹¹¿·¤ÎÆóÃʳ¬¤Ç¹Ô¤¦¡£ 5. À¸À®¤¹¤ë¥°¥ë¡¼¥×̾¤Ïgfarm¥æ¡¼¥¶¡¼¥Æ¡¼¥Ö¥ë¤ËÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë¥æ¡¼¥¶¡¼¤Ë ´Ø¤ï¤ë¤â¤Î¤À¤±¤È¤¹¤ë¡£¥­¡¼¤ÏDN¤Ç¤¢¤ë¡£ 6. ¥°¥ë¡¼¥×̾¤ÎÀ¸À®¤Ç¤Ï¡¢Gfarm¾å¤Î¥°¥ë¡¼¥×¾ðÊó¤ò¼èÆÀ¤·¡¢ Äɲᢺï½ü¡¢¹¹¿·¤òȽÃǤ·¡¢ ÄɲäˤĤ¤¤Æ¤Ï¾¤È½ÅÊ£¤·¤Ê¤¤Ì¾Á°¤òÀ¸À®¤¹¤ë¡£ 3. Ʊ´ü¥³¥Þ¥ó¥É¾ÜºÙ Ʊ´ü¥³¥Þ¥ó¥É¤Ï¤µ¤é¤Ë²¼°Ì¤Ë VOMS¤«¤é¥á¥ó¥Ð¡¼¥·¥Ã¥×¾ðÊó¤ò¼è¤ê½Ð¤¹¥³¥Þ¥ó¥É¤È ¤³¤ì¤ò¸µ¤Ë¡¢gfarm ¤Î¥°¥ë¡¼¥×¡¢¥æ¡¼¥¶¡¼¾ðÊó¤ò¹¹¿·¤¹¤ë¥³¥Þ¥ó¥É¤Î Æó¤Ä¤ò»ý¤Ä¡£ 3.1. ¥á¥ó¥Ð¡¼¥·¥Ã¥×¾ðÊó¥ê¥¹¥È¥³¥Þ¥ó¥É gfvoms-list [-a void-list] -V void -v vo [-f user-list-path] [-m membership-path] VO ¤ò»ØÄꤷ¤ÆÅö³ºVO¤Î¥á¥ó¥Ð¡¼¥·¥Ã¥×¾ðÊó¤ò½ÐÎϤ¹¤ë¡£ user-list-path ¤¬»ØÄꤵ¤ì¤Æ¤¤¤ì¤Ð¡¢»ØÄꤵ¤ì¤¿¥æ¡¼¥¶¡¼¤Ë ´ØÏ¢¤¹¤ë¾ðÊó¤Î¤ß¤ò½ÐÎϤ¹¤ë¡£¤Ê¤±¤ì¤ÐÁ´¥æ¡¼¥¶¡¼¤Ë¤Ä¤¤¤Æ ½ÐÎϤ¹¤ë¡£ ½ÐÎϤϡ¢membership-path ¤¬»ØÄꤵ¤ì¤Æ¤¤¤ì¤Ð¤½¤³¤Ë¡¢¤Ê¤±¤ì¤Ð ɸ½à½ÐÎϤǤ¢¤ë¡£ user-list-path ¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤Ï1¹Ô¤Ë°Ê²¼¤Î·Á¼°¤Çµ­½Ò¤¹¤ë¡£ ¹ÔƬ¤Ë#¤¬¤¢¤ì¤Ð¥³¥á¥ó¥È¹Ô¤Ç¤¢¤ë¡£ user=<¥æ¡¼¥¶¡¼DN> ¥æ¡¼¥¶¡¼¤¬°Û¤Ê¤ëǧ¾Ú¶É¤ÇƱ¤¸DN¤òÅÐÏ¿¤·¤Æ¤¤¤Æ¤â¡¢DN¤Ç¼±Ê̤¹¤ë ¤Î¤ÇƱ¤¸¤È´ÇÐö¤µ¤ì¤ë¡£ ¼ÂºÝ¤Ë¤Ï°Û¤Ê¤ëǧ¾Ú¶É¤òÍѤ¤¤ë¤³¤È¤Ï¤Ê¤¤¡£ membership-path ¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤Ï1¹Ô¤Ë°Ê²¼¤Î·Á¼°¤Çµ­½Ò¤¹¤ë¡£ void= vo=/ voms=/[/..] user=<¥æ¡¼¥¶¡¼DN> user=<¥æ¡¼¥¶¡¼DN> voms=/[/..]/role= user=<¥æ¡¼¥¶¡¼DN> user=<¥æ¡¼¥¶¡¼DN> 3.2. gfarm ¥°¥ë¡¼¥×¹¹¿·¥³¥Þ¥ó¥É gfvoms-update -V void -v vo -m membership-path gfvoms-update -d -V void -v vo VOMS¤Î¥á¥ó¥Ð¡¼¥·¥Ã¥×¾ðÊó¤ò¸µ¤Ë¡¢gfarm ¤Î³ºÅö¤¹¤ëvo¤Î ¥°¥ë¡¼¥×¡¢¥æ¡¼¥¶¥Æ¡¼¥Ö¥ë¤ò¹¹¿·¤¹¤ë¡£ -d ¤ÏÅö³º VO¤Îºï½ü¤ò»Ø¼¨¤¹¤ë¡£ 4. Ʊ´ü¥³¥Þ¥ó¥É¼ÂÁõ 4.1. gfvoms-sync ¤Îưºî³µÍ× ¡¦´ÉÍý¼Ô¤¬VO¤ò»ØÄꤷ¤Æµ¯Æ°¤¹¤ë¡£ +-----------+ |vomsid-list| .....--...... +-----------+ |gfvoms-sync| +-----------+ ¡¦gfmd ¤«¤é¥æ¡¼¥¶¡¼¥ê¥¹¥È¤ò¼è¤ê½Ð¤¹¡£ +---------+ |user-list| ........... ¡¦gfvoms-list ¤òµ¯Æ°¤¹¤ë¡£ +-----------+ |gfvoms-list| +-----------+ ¡¦»ØÄꤵ¤ì¤¿¥æ¡¼¥¶¡¼¤Ë´ØÏ¢¤¹¤ë¥á¥ó¥Ð¡¼¥·¥Ã¥× ¡¡¾ðÊó¤ò½ÐÎϤ¹¤ë +---------------+ |membership-list| ................. ¡¦gfvoms-update ¤òµ¯Æ°¤¹¤ë¡£ +-------------+ |gfvoms-update| +-------------+ ¡¦»ØÄꤵ¤ì¤¿VO¤Ë´Ø¤¹¤ë¥°¥ë¡¼¥×¾ðÊó¤ò¹¹¿·¤¹¤ë¡£ +----------+ |group-list| ............ 4.2. gfvoms-list ¤Îưºî³µÍ× 1. voms ¤«¤é¥æ¡¼¥¶¡¼¥ê¥¹¥È¤ò¼èÆÀ¤¹¤ë¡£ 2. -f user-list-path ¤¬»ØÄꤵ¤ì¤Æ¤¤¤ì¤Ð¥Þ¥Ã¥Á¤¹¤ë¥æ¡¼¥¶¡¼¤Ë¹Ê¤ê¹þ¤à¡£ 3. ³Æ¥æ¡¼¥¶¡¼¤Ë¤Ä¤¤¤ÆÂ°¤¹¤ë¥°¥ë¡¼¥×¤ò¥ê¥¹¥È¥¢¥Ã¥×¤¹¤ë¡£ 4. ³Æ¥æ¡¼¥¶¡¼¤Ë¤Ä¤¤¤ÆÂ°¤¹¤ë¥°¥ë¡¼¥×/¥í¡¼¥ë¤ò¥ê¥¹¥È¥¢¥Ã¥×¤¹¤ë¡£ ¥á¥ó¥Ð¡¼¥·¥Ã¥×°À­¤Î¥µ¥Ö¥°¥ë¡¼¥×¤Ø¤Î·Ñ¾µÅù¤Ï¡¢voms ¤Î½ÐÎϤËǤ¤»¤ë¡£ 5. ¼èÆÀ¤·¤¿¥°¥ë¡¼¥×Ëè¤Ë¥æ¡¼¥¶¡¼¤ò¤Þ¤È¤á¡¢½ÐÎϤ¹¤ë¡£ 6. ¼èÆÀ¤·¤¿¥°¥ë¡¼¥×/¥í¡¼¥ëËè¤Ë¥æ¡¼¥¶¡¼¤ò¤Þ¤È¤á¡¢½ÐÎϤ¹¤ë¡£ voms-list ¤Ï zsi ¥Ñ¥Ã¥±¡¼¥¸¤òÍøÍѤ·¤Æ python ¤Çµ­½Ò¤¹¤ë¡£ 4.3. gfvoms-update ¤Îưºî³µÍ× 1. gfarm ¤«¤éÁ´¥°¥ë¡¼¥×̾¤òGFM_PROTO_GROUP_INFO_GET_ALL¤Ç¼èÆÀ¤·¡¢ void, VO¤Ë´ØÏ¢¤¹¤ë¥°¥ë¡¼¥×¤ò¥ê¥¹¥È¥¢¥Ã¥×¤¹¤ë¡£ 2. »ØÄꤵ¤ì¤¿¥á¥ó¥Ð¡¼¥·¥Ã¥×¥ê¥¹¥È¤ÈÃê½Ð¤·¤¿¥°¥ë¡¼¥×¥ê¥¹¥È¤òÈæ¤Ù¡¢ °Ê²¼¤Î¶èʬ¤ò¹Ô¤¦¡£ a)Êݸ¤¹¤ë¥°¥ë¡¼¥×¡¢ b)gfarm ¤«¤éºï½ü¤¹¤ë¥°¥ë¡¼¥× c)gfarm ¤ËÄɲ乤륰¥ë¡¼¥× ̾Á°¤ÏÂçʸ»ú¾®Ê¸»ú¤ò¶èÊ̤¹¤ë¡£ 3. gfarm ¤ËÄɲ乤륰¥ë¡¼¥×¤Ë¤Ä¤¤¤Æ¡¢¥°¥ë¡¼¥×̾¤òÀ¸À®¤¹¤ë¡£ //[/...]/role= 4. gfarm ¤«¤éºï½ü¤¹¤ë¥°¥ë¡¼¥×¤Ë¤Ä¤¤¤ÆGFM_PROTO_GROUP_INFO_REMOVE ¤ògfmd¤Ëȯ¹Ô¤¹¤ë¡£ ENOENT °Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤ì¤Ð½ªÎ»¤¹¤ë¡£ 5. gfarm ¤«¤é GFM_PROTO_USER_INFO_GET_ALL ¤Ç¥æ¡¼¥¶¡¼¾ðÊó¤ò¼è¤ê½Ð¤¹¡£ 6. Êݸ¤¹¤Ù¤­¥°¥ë¡¼¥×¤È¡¢Äɲ乤٤­¥°¥ë¡¼¥×¤Ë¤Ä¤¤¤Æ¡¢ ¡¡ °¤¹¤ë¥æ¡¼¥¶¤òdn ¤Ç¥Þ¥Ã¥Á¤·¤Æ¥ê¥¹¥È¥¢¥Ã¥×¤¹¤ë¡£ 7. Êݸ¤¹¤Ù¤­¥°¥ë¡¼¥×¤Ë¤Ä¤¤¤Æ ´û¸¾ðÊó¤È°Û¤Ê¤Ã¤Æ¤¤¤ì¤Ð¡¢ GFM_PROTO_GROUP_INFO_MODIFY ¤Ç°¤¹¤ë¥æ¡¼¥¶¡¼¤òÊѹ¹¤¹¤ë¡£ ENOENT °Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤ì¤Ð½ªÎ»¤¹¤ë¡£ ENOENT ¤Ï¿·µ¬ÄɲýèÍý¤ò¹Ô¤¦¡£ 8. gfarm ¤ËÄɲ乤٤­¥°¥ë¡¼¥×¤Ë¤Ä¤¤¤Æ GFM_PROTO_GROUP_INFO_SET ¤Ç gfmd ¤Ë°ÍÍꤹ¤ë¡£ ¥¨¥é¡¼¤¬À¸¤¸¤ì¤Ð½ªÎ»¤¹¤ë¡£ 5. DB ¥¹¥­¡¼¥Þ GfarmGroup ¤Îgroup̾¤ò VARCHAR(64)¤«¤éTEXT¤ËÊѹ¹¤¹¤ë¡£ gfarm-2.4.1/doc/xattr-dev.ja0000644000000000000000000002011111507222722014302 0ustar rootroot ³Èĥ°À­¤Î¥µ¥Ý¡¼¥È 1. ³µÍ× gfarmV2 ¤Ë³Èĥ°À­¡¢¤ª¤è¤ÓXML³Èĥ°À­¤Îµ¡Ç½¤òÄɲ乤롣 API¤Ïlinux ¤Îsetxattr ¤Ë½à¤¸¡¢XML³Èĥ°À­¤Ë¤Ä¤¤¤Æ¤Ï¡¢ XML ¸¡º÷API¤òÍѰդ¹¤ë¡£ ¤Ê¤ª¡¢³Èĥ°À­¤ÈXML³Èĥ°À­¤Ï¸ß¤¤¤ËÆÈΩ¤Ç¤¢¤ë¡£ ³Èĥ°À­¤Ï¥á¥¿¥Ç¡¼¥¿¤È¤·¤Æ³ÊǼ¤¹¤ë¡£ XML³Èĥ°À­¥Ç¡¼¥¿¤Î³ÊǼ¡¦¸¡º÷¤Ï¡¢PostgreSQL¤ÎXML¥Ç¡¼¥¿·¿½èÍý¤ò ÍøÍѤ¹¤ë¡£ 2.API 2.1 ´Ø¿ôÀë¸À gfarm_error_t gfs_setxattr(const char *path, const char *name, const void *value, size_t size, int flags); gfarm_error_t gfs_getxattr(const char *path, const char *name, void *value, size_t *size); gfarm_error_t gfs_listxattr(const char *path, char *list, size_t *size); gfarm_error_t gfs_removexattr(const char *path, const char *name); #include "gfarm_api.h" gfarm_error_t gfs_setxmlattr(const char *path, const char *name, const void *value, size_t size, int flags); gfarm_error_t gfs_getxmlattr(const char *path, const char *name, void *value, size_t *size); gfarm_error_t gfs_listxmlattr(const char *path, char *list, size_t *size); gfarm_error_t gfs_removexmlattr(const char *path, const char *name); struct gfs_xmlattr_ctx; gfarm_error_t gfs_findxmlattr(const char *path, const char *expr, int depth, struct gfs_xmlattr_ctx **ctxpp); gfarm_error_t gfs_getxmlent(struct gfs_xmlattr_ctx *ctxp, char **fpathp, char **namep); gfarm_error_t gfs_closexmlattr(struct gfs_xmlattr_ctx *ctxp); 2.2 »ÅÍͲòÀâ setxattr, getxattr, listxattr, removexattr ¤Ïlinux ¤ÎAPI¤Ë½à¤º¤ë¡£ getxattr, listxattr¤Ï¡¢¸Æ¤Ó½Ð¤·Â¦¤¬³ÎÊݤ·¤¿¥Ð¥Ã¥Õ¥¡¤È¤½¤Î¥µ¥¤¥º¤ò °ú¿ô¤È¤·¤ÆÅϤ¹¡£·ë²Ì¤¬¤½¤Î¥Ð¥Ã¥Õ¥¡¤Ë¼ý¤Þ¤é¤Ê¤«¤Ã¤¿¾ì¹ç¤ÏERANGE¥¨¥é¡¼¤È ¤Ê¤ê¡¢É¬Íפʥµ¥¤¥º¤¬size¤ËÀßÄꤵ¤ì¤ÆÌá¤ë¡£ linux¤Îxattr¤Ë¤ª¤¤¤Æ¤Ï¡¢°ì¤Ä¤Î³Èĥ°À­¥Ç¡¼¥¿¤Î¥µ¥¤¥º¡¢°ì¤Ä¤Î¥Õ¥¡¥¤¥ë¤Ë ÀßÄê¤Ç¤­¤ë³Èĥ°À­Ì¾°ìÍ÷¤Î¹ç·×¥µ¥¤¥º¤Ï¡¢¤½¤ì¤¾¤ì64KB¤ËÀ©¸Â¤µ¤ì¤Æ¤¤¤ë¡£ libgfarm·Ðͳ¤Ç¤Ï64KB¤òͤ¨¤ë³Èĥ°À­¤òÀßÄê¤Ç¤­¤ë¤¬¡¢fuse·Ðͳ¤Ç¼èÆÀ¤¹¤ë ¾ì¹ç¤Ï64KB¤Þ¤Ç¤·¤«¼èÆÀ¤Ç¤­¤Ê¤¤¤³¤È¤ËÃí°Õ¡£ xml³Èĥ°À­¤Ï¡¢¥á¥¿DB¤¬XML·¿¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë(ÅöÌÌPostgreSQL¤Î¤ß)¾ì¹ç ¥µ¥Ý¡¼¥È¤¹¤ë¡£¤½¤¦¤Ç¤Ê¤¤¾ì¹çxmlattr ·Ï¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤ÏENOTSUP¤òÊÖ¤¹¡£ xml³Èĥ°À­¤Ï´ðËÜŪ¤Ë³Èĥ°À­¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤ËÅù¤·¤¤¤¬¡¢ gfs_setxmlattr ¤Ç¤Ï¡¢ÅϤµ¤ì¤¿buf ¤¬XML¤ÎÀ°·Á¼°¤Îʸ½ñ¤Ç¤¢¤ë¤«¤Î ¥Á¥§¥Ã¥¯¤¬¹Ô¤ï¤ì¤ë¡£Àµ¤·¤¯¤Ê¤¤¤È¤­¤ÏEINVAL¤¬ÊÖ¤µ¤ì¤ë¡£ ÀßÄꤹ¤ëXML¤ÎÀèÆ¬¤Ë¤È ¤¤¤¦¤è¤¦¤ÊXMLÀë¸Àʸ¤Ï¤¢¤Ã¤Æ¤â¤Ê¤¯¤Æ¤âÎɤ¤¡£¤¿¤À¤·¡¢¼èÆÀ¤¹¤ë¤È ɬ¤º¤½¤Î¹Ô¤Ï¾Ã¤¨¤ë¡£¤³¤ì¤ÏPostgreSQL¤Ë»ÅÍͤˤè¤ë¤â¤Î¤Ç¡¢XML ³Èĥ°À­¤Î»ÅÍͤȤ¹¤ë¡£ ¤Þ¤¿¡¢xml³Èĥ°À­¤Ë¤ÏXML¸¡º÷¤ò¹Ô¤¦¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤¬¤¢¤ë¡£ path ¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤±¤ì¤Ð¡¢Åö³º¥Ñ¥¹¤Ë¤Ä¤¤¤Æ¡¢ path ¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤¢¤ì¤Ð¡¢Åö³ºpath¤«¤é¤½¤ÎÇÛ²¼¤Îdepth¤Þ¤Ç¤Î ¥Õ¥¡¥¤¥ë(0¤Ïpath ¤Î¤ß) ¤Ë¤Ä¤¤¤Æ¡¢ Âоݥե¡¥¤¥ë¤¬XML³Èĥ°À­¤ò»ý¤Ã¤Æ¤¤¤ì¤Ð¡¢expr ¤Ç¼¨¤µ¤ì¤ë¾ò·ï¤Ç XML¸¡º÷¤ò¹Ô¤¤¡¢¥Þ¥Ã¥Á¤¹¤ì¤ÐÅö³º³Èĥ°À­¤Î¥Ñ¥¹¤È̾Á°¤òÊÖ¤¹¡£ gfs_findxmlattr() ¤Ï¸¡º÷¾ò·ï¤òÀßÄꤷ¤Æ¡¢¸¡º÷¥³¥ó¥Æ¥¯¥¹¥È¤òÊֵѤµ¤ì¤ë¡£ ¤½¤Î¸å¤Ï¡¢¸¡º÷¥³¥ó¥Æ¥¯¥¹¥È¤òÅϤ·¤Æ gfs_getxmlent() ¤Ç¥¨¥ó¥È¥ê¡¼¤òÆÀ¤ë Áàºî¤ò·«¤êÊÖ¤·¡¢NULL ¤¬Ê֤äƤ¯¤ë¤ÈEOF¤Ç¤¢¤ë¤Î¤Ç¡¢ gfs_closexmlattr()¤Ç¸¡º÷¥³¥ó¥Æ¥¯¥¹¥È¤Î²òÊü¤ò¹Ô¤¦¡£ expr ¤Ï¥Ì¥ë¥¿¡¼¥ß¥Í¡¼¥È¤·¤¿Ê¸»úÎó¤Ç¡¢XPATH ¤ÎÆþÎϤȤʤ롣 expr ¤Ë¥Õ¥¡¥¤¥ë̾¤ä³Èĥ°À­Ì¾¤ò½ñ¤¯¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£ depth ¤Ïpath ¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Î»þ¤Ë²¼°Ì¤Î¥Ç¥£¥ì¥¯¥È¥ê¤òºÆµ¢Åª¤Ë ¸¡º÷¤¹¤ë¾ì¹ç¤Î¿¼¤µ¤Ç¡¢0¤Ï¼«¿È¤Î¤ß¡¢1¤Ïľ²¼¤Î¥Õ¥¡¥¤¥ë¤ò»Ø¼¨¤¹¤ë¡£ ¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤¤¾ì¹ç¤Ïdepth ¤Ï̵»ë¤µ¤ì¤ë¡£ ¥Ç¥£¥ì¥¯¥È¥ê¤ò²¼¹ß¤¹¤ë¾ì¹ç¤Î½ç½ø¤Ëµ¬Â§À­¤Ï´üÂÔ¤µ¤ì¤Ê¤¤¡£ gfs_getxmlent() ¤ÏXML ¸¡º÷¤Ë¹çÃפ·¤¿¥Õ¥¡¥¤¥ë¤Î¡¢path¤ò´Þ¤àÁêÂХѥ¹¤È ³Èĥ°À­Ì¾¤¬ÊÖ¤µ¤ì¤ë¡£ eof ¤Î¾ì¹ç¤Ï ¥Ñ¥¹Ì¾¤È°À­Ì¾¤È¤·¤ÆNULL¤¬Ê֤롣 gfs_getxmlent() ¤Ï¥ê¥¨¥ó¥È¥é¥ó¥È¤Ç¤Ï¤Ê¤¤¡£ ÊÖ¤µ¤ì¤ë fpath, name ¤ÎÎΰè¤Ï¼¡¤Î¸Æ¤Ó½Ð¤·¤ä¡¢gfs_closexmlattr()¤Î ¸Æ¤Ó½Ð¤·¤¬¤¢¤ì¤ÐÊݾڤµ¤ì¤Ê¤¤¡£ ±þÅú¤Î³Èĥ°À­¥Ñ¥¹¤Ï±þÅú»þ¤Î¸ºß¤òÊݾڤ¹¤ë¤â¤Î¤Ç¤Ï¤Ê¤¤¡£ ¤Þ¤¿¡¢¸¡º÷»þ¤Ërename ¤äºï½ü¤¬¶¥¹ç¤·¤¿¾ì¹ç¡¢»Ä¤ê¤Î¸¡º÷¤¬·Ñ³¤µ¤ì¤ë¤«¤Ï Êݾڤµ¤ì¤Ê¤¤¡£ 2.3 XML¸¡º÷¤ÎÎ㠰ʲ¼¤Î¤è¤¦¤Ê¥Õ¥¡¥¤¥ë¥Ä¥ê¡¼¤¬¤¢¤Ã¤Æ¡¢¾®Ê¸»ú¤Î¥Õ¥¡¥¤¥ë¤Ï¤½¤ì¤¾¤ì¡¢ n1,n2¤ÎXML³Èĥ°À­¤ò»ý¤Ã¤Æ¤¤¤Æ¡¢n1¤¬¥Þ¥Ã¥Á¤¹¤ë¸¡º÷¤òȯ¹Ô¤·¤¿¾ì¹ç¤Î ½ÐÎϤϼ¡¤Î¤è¤¦¤Ë¤Ê¤ë¡£ ¥Õ¥¡¥¤¥ë¥Ä¥ê¡¼ ------------------------------------------------ /a0/b0/c0/d0 /C1/d1 /C1/D2 /c2 ¥×¥í¥°¥é¥à ---------------------------------------------------- struct gfs_xmlattr_ctx *ctxp; char *path, *name; if(gfs_findxmlattr("/a0/b0", "//child1", 100, &ctxp) == GFARM_ERR_NO_ERROR){ while((gfs_getxmlent(ctx, &path, &name) == GFARM_ERR_NO_ERROR) && (path != NULL)) { printf("%s:%s\n", path, name); } gfs_closexmlattr(ctx); } ½ÐÎÏ ----------------------------------------------------------- /a0/b0:n1 /a0/b0/c0:n1 /a0/b0/c0/d0:n1 /a0/b0/C1/d1:n1 /a0/b0/c2:n1 3. ¥á¥¿¥Ç¡¼¥¿ 3.1. ¥á¥¿DB ³Èĥ°À­¤Ïinode ¤È¤ÏÊ̤Υơ¼¥Ö¥ë¤Ë³ÊǼ¤¹¤ë¡£ ³Èĥ°À­¤Î¥Æ¡¼¥Ö¥ëºîÀ®¤Ï°Ê²¼¤Î¤è¤¦¤Ë¤Ê¤ë¡£ XmlAttr¤Ï¡¢XML³Èĥ°À­¤ò¥µ¥Ý¡¼¥È¤¹¤ëÀßÄê¤Î»þ¤Î¤ßºîÀ®¤¹¤ë¡£ CREATE TABLE XAttr ( inumber INT8 REFERENCES INode(inumber) ON DELETE CASCADE, attrname VARCHAR(256) NOT NULL, attrvalue BYTEA NOT NULL, PRIMARY KEY(inumber, attrname) ); CREATE TABLE XmlAttr ( inumber INT8 REFERENCES INode(inumber) ON DELETE CASCADE, attrname VARCHAR(256) NOT NULL, attrvalue XML NOT NULL, PRIMARY KEY(inumber, attrname) ); 3.2. stat ¾ðÊó ³Èĥ°À­¥Ç¡¼¥¿¤Î¥µ¥¤¥º¤Ï¡¢st_size ¤ä st_blocks ¤Ë±Æ¶Á¤·¤Ê¤¤¡£ setxattr(), removexattr() ¤Ïst_ctime ¤ò¹¹¿·¤¹¤ë¤¬¡¢ st_mtime ¤Ï¹¹¿·¤·¤Ê¤¤¡£ getxattr(), listxattr() ¤Ï st_atime ¤ò¹¹¿·¤·¤Ê¤¤¡£ ¥¢¥¯¥»¥¹¸¢¤Ï¥Ç¡¼¥¿¤ÎIO¤ËƱ¤¸¤Ç¡¢WRITE¸¢¤¬¤¢¤ì¤Ð¡¢setxattr, removexattr ¤¬¤Ç¤­¡¢READ¸¢¤¬¤¢¤ì¤Ðgetxattr, listxattr¤¬¤Ç¤­¤ë¡£ ¥¢¥¯¥»¥¹¥Á¥§¥Ã¥¯¤ò¤¤¤Ä¤É¤³¤Ç¹Ô¤¦¤«¤Ï´Ø¿ô¤Ë¤è¤Ã¤Æ°Û¤Ê¤ë¡£ 3.3. ¥á¥â¥êɽ¸½ ¥á¥â¥ê¾å¤Ë¤Ï³Èĥ°À­Ì¾¤òinode ¤Î°À­¤È¤·¤Æ³ÊǼ¤·¡¢³Èĥ°À­¥Ç¡¼¥¿¤Ï DB¤Ë¤Î¤ßÊÝ»ý¤¹¤ë¡£ struct xattr_entry { struct xattr_entry *prev, *next; char *name; }; struct xattrs { pthread_mutex_t lock; int loaded; struct xattr_entry *head, *tail; }; struct inode { ... struct xattrs xattrs, xmlattrs; }; °ì¤Ä¤Î¥Õ¥¡¥¤¥ë¤Î³Èĥ°À­¤Ï¤¢¤Þ¤ê¿¤¯¤Ê¤¤¤È´üÂÔ¤µ¤ì¤ë¤Î¤Ç¡¢ Àþ·Á¥ê¥¹¥È¤Ç´ÉÍý¤¹¤ë¡£¥ê¥¹¥È¤Ø¤Î¥¢¥¯¥»¥¹¤Ï¡¢lock¤ÇÇÓ¾¤¹¤ë¡£ DB ¤Ø¤Î¥¢¥¯¥»¥¹¤Ï¾¤Î¥á¥¿¥Ç¡¼¥¿¤ÈƱ¤¸¤¯¡¢dbq ¤ò²ð¤·¤Æ¹Ô¤¦¡£ ¤¿¤À¤·¡¢½èÍý·ë²ÌÂÔ¤Á¤ò¤¹¤ë¡£ 4. gfmd ¥¤¥ó¥¿¥Õ¥§¡¼¥¹ GFM_PROTO_XATTR_SET, GFM_PROTO_XMLATTR_SET Í×µá s : name B : value i : flags ±þÅú i : ¥¨¥é¡¼ GFM_PROTO_XATTR_GET, GFM_PROTO_XMLATTR_GET Í×µá s : name ±þÅú i : ¥¨¥é¡¼ b : value ¥µ¥¤¥ºÌ䤤¹ç¤ï¤»¤Ï¤Ê¤¤¡£ GFM_PROTO_XATTR_REMOVE, GFM_PROTO_XMLATTR_REMOVE Í×µá s : name ±þÅú i : ¥¨¥é¡¼ GFM_PROTO_XATTR_LIST, GFM_PROTO_XMLATTR_LIST Í×µá ±þÅú i : ¥¨¥é¡¼ b : value value ¤Ï NULL¥¿¡¼¥ß¥Í¡¼¥È¤·¤¿Ê¸»úÎó¤Î½¸¹ç¤Ç¤¢¤ë¡£ GFM_PROTO_XMLATTR_FIND Í×µá s : expr i : depth i : nentry cookie s : path s : name ±þÅú i : ¥¨¥é¡¼ i : eof i : nentry entry[nent] s : path s : name ¥µ¥¤¥ºÌ䤤¹ç¤ï¤»¤Ï¤Ê¤¤¡£ Í׵᥵¥¤¥º¤Ë¶á¤¤Å¬Åö¤Ê¶èÀÚ¤ê¤Î̾Á°¤Þ¤Ç¤òÊÖ¤¹¡£ entry ¤Ï ³Èĥ°À­¤ò»ý¤Ä¥Õ¥¡¥¤¥ë¤ÎÁêÂХѥ¹¤È³Èĥ°À­Ì¾¤«¤éÀ®¤ë¡£ Í×µá¥Õ¥¡¥¤¥ë¼«¿È¤Î³Èĥ°À­¤Î»þ¤Ë¤Ï¥Ñ¥¹¤Ï"."¤È¤¹¤ë¡£ Í×µá¤Îcookie¤Ïentry¤Ç¡¢½é²ó¤ÎÍ×µá¤Ç¤Ï³Èĥ°À­Ì¾¤¬NULL¤ò¤·¤á¤¹¡£ ·Ñ³Í×µá¤Î¾ì¹ç¤Ï¡¢ºÇ¸å¤ËÊÖ¤µ¤ì¤¿entry¤òcookie¤È¤·¤ÆÅϤ¹¡£ eof ¤Î¾ì¹ç¤Ï eof ¥Õ¥é¥°¤¬1¤Ç¤¢¤ë¡£ 5. gfmd ¼ÂÁõ ¥á¥¿´ÉÍý db_access.c, db_pgsql.c, db_ldap.c¤Ê¤É ³Èĥ°À­´ÉÍýÄɲáʥ¹¥­¡¼¥Þ¡¢¶¦ÄÌÉô¡¢PBSQL¡¢LDAP¡Ë dbq¤Î½èÍý´°Î»ÂÔ¤Á½èÍý inode´ÉÍý inode.c ³Èĥ°À­´ÉÍýÄɲáʥª¡¼¥×¥ó»þ¤ÎÆÉ¤ß¹þ¤ß¡¢Äɲᦺï½ü¡¦°ìÍ÷¡Ë inodeºï½ü¤ÎºÝ¤ÎÁ´³Èĥ°À­ºï½ü ¥¿¥¤¥à¥¹¥¿¥ó¥×¹¹¿·½èÍý ¥×¥í¥È¥³¥ë½èÍý xattr.c¿·µ¬Äɲà ³Èĥ°À­¤ÎÀßÄꡦ¼èÆÀ¡¦ºï½ü¡¦°ìÍ÷ gfm_server_fchmod()¤ägfm_serevr_fstat()¤ËÊï¤Ã¤Æ gfm_server_xxx()¤òºîÀ®¤¹¤ë¡£ ½èÍýÁ´ÂΤògiant_lock()/unlock()¤Ç¥í¥Ã¥¯¤¹¤ë¡£ XML¸¡º÷ ¸¡º÷½èÍý¼«ÂΤϡ¢PostgreSQL¤ÎXML½èÍý¤ËǤ¤»¤ë¡£ ´û¤Ë¥Ñ¥¹¡¦Â°À­Ì¾¤¬¾Ã¤¨¤Æ¤¤¤¿¤é¡¢¥¹¥­¥Ã¥×¤¹¤ë¡Ê¥¨¥é¡¼¤È¤·¤Ê¤¤¡Ë¡£ ¥Ñ¥¹¡¦Â°À­Ì¾¤¬Áý¤¨¤Æ¤¤¤Æ¤â̵»ë¤µ¤ì¤ë¡£ cookie¤Ç»ØÄꤵ¤ì¤¿¥Ñ¥¹¡¦Â°À­Ì¾¤¬Ìµ¤¯¤Ê¤Ã¤Æ¤¤¤¿¤é¡¢ EOF±þÅú¤òÊÖ¤¹¡£ 6. ´ØÏ¢¥é¥¤¥Ö¥é¥ê¼ÂÁõ libgfarm gfs_setxattr()¤Ê¤É¤ò¿·µ¬ºîÀ®¡£ gfm_client_xxx_request/result()¤òÄɲᣠgfs_hook gfarm v2¤Ç¤ÏÈ󥵥ݡ¼¥È¤Ê¤Î¤Ç¡¢Êѹ¹¤·¤Ê¤¤¡£ gfarm2fs (fuse) setxattr, getxattr, listxattr, removexattr¤òÄɲᣠxml³Èĥ°À­¤Ø¤Î¥¢¥¯¥»¥¹¤Ï¹Ô¤ï¤Ê¤¤¡£ gfarm-2.4.1/doc/html/0000755000000000000000000000000011507222730013020 5ustar rootrootgfarm-2.4.1/doc/html/en/0000755000000000000000000000000011507222730013422 5ustar rootrootgfarm-2.4.1/doc/html/en/ref/0000755000000000000000000000000011507222730014176 5ustar rootrootgfarm-2.4.1/doc/html/en/ref/man5/0000755000000000000000000000000011507222730015036 5ustar rootrootgfarm-2.4.1/doc/html/en/ref/man5/gfarm2.conf.5.html0000644000000000000000000012750211507222721020200 0ustar rootroot gfarm2.conf

gfarm2.conf

Name

gfarm2.conf -- Gfarm configuration file

DESCRIPTION

gfarm2.conf is a text file that contains a Gfarm configuration. Gfarm server processes gfmd and gfsd refer to %%SYSCONFDIR%%/gfmd.conf and %%SYSCONFDIR%%/gfarm2.conf, respectively, by default. Since this configuration file is only read at startup, it is necessary to restart servers when the contents of the configuration file are updated.

Application programs, such as gfls and gfhost, refer to both %%SYSCONFDIR%%/gfarm2.conf, and a file specified by an environment variable, GFARM_CONFIG_FILE. If both configuration files exist, the file specified by the environment variable, GFARM_CONFIG_FILE, is read first. Both files have the same grammar. If the environment variable GFARM_CONFIG_FILE doesn't exist, ~/.gfarm2rc in a user's home directory is used instead.

Each line of gfarm2.conf consists of one statement. When the line ends with the character ``\'', the line continues for the next line. A word beginning with ``#'' causes that word and all remaining characters on that line to be ignored.

Host_specification

Host_specification has the following forms.

III.JJJ.KKK.LLL

Specifies an IP address with four octets from 0 to 255, separated by ".".

III.JJJ.KKK.LLL/MM

Specifies a network address with an IP address and a netmask from 0 to 31 separated by "/".

domain.name

Specifies a host name.

.domain.name

Specifies all hosts which belong to the domain.name.

*

Specifies all hosts.

Statement

The following statements are supported.

spool directory

The spool statement specifies a spool directory for a Gfarm filesystem on this filesystem node.

For example,

spool /var/spool/gfarm

spool_server_listen_address IP-address

The spool_server_listen_address statement specifies the IP address at which the gfsd accepts TCP and UDP requests. The default address is all IP addresses of the host. This option is useful when one wants to invoke multiple gfsd to provide multiple spool directories on the host.

For example,

spool_server_listen_address 192.168.121.1

spool_server_cred_type cred_type

This statement specifies the type of credential used by gfsd for GSI authentication. This is ignored when you are using sharedsecret authentication.

If this statement isn't used on the server side, the server uses a host certificate, if the server is invoked with root privileges. Or, if the server is invoked as a non-privileged user, the server uses the user's certificate.

If this statement isn't used on the client side, the client assumes that the server that the client is going to connect is using a host certificate of the server host. Thus, if the server is not invoked with root privileges, but invoked with user privileges where the user is the same as the user who invoked the client, the client side needs to specify the following one line.

Example:

spool_server_cred_type self

The possible types of cred_type are ``self'', ``host'', ``user'' and ``mechanism-specific''. And those are used with the spool_server_cred_service and spool_server_cred_name statements as follows:

self

This keyword specifies that the certificate that the user currently has is used. You must not use either the spool_server_cred_service or spool_server_cred_name statement, if you are using this type.

host

This keyword specifies that a host certificate or a service certificate is used. To choose a service certificate, the name of the service may be specified by the spool_server_cred_service statement. If ``host'' is specified as the service name, a host certificate in the file ``/etc/grid-security/hostcert.pem'' will be used. If any server name other than ``host'' is specified, a service certificate in the file ``/etc/grid-security/SERVICE/SERVICEcert.pem'' will be used. If the service name is omitted, ``host'' will be used as the service name by default. Only the Common Name field of a certificate will be used to check the server's identity for both a host certificate and a service certificate. And the Common Name field must be in the ``CN=SERVERNAME/HOSTNAME'' format. Also, the hostname must match the canonical name configured by the gfhost command exactly. Alias hostnames are not allowed.

This feature corresponds to the GSS_C_NT_HOSTBASED_SERVICE feature in GSSAPI (RFC2743/RFC2744).

Example:

spool_server_cred_type host
spool_server_cred_service host

user

This keyword specifies that a user certificate is used. The account name of the user may be specified by the spool_server_cred_name statement. If the account name is omitted, the user who invoked the command will be used by default. You must not specify a service name using the spool_server_cred_service statement, if you are using a user certificate.

To map from the account name to a Distinguished Name of a certificate, file ``/etc/grid-security/grid-mapfile'' is used. Thus, if there isn't such a file, or if the user isn't specified in this file, this feature cannot be used.

This feature corresponds to the GSS_C_NT_USER_NAME feature in GSSAPI (RFC2743/RFC2744).

Example:

spool_server_cred_type user
spool_server_cred_name guest

mechanism-specific

This keyword specifies that spool_server_cred_name is treated as a raw X.509 Distinguished Name serving as a server's certificate. You must not specify a service name using a spool_server_cred_service statement, if you are using this type.

This feature corresponds to a case where GSS_C_NO_OID is specified as a Name Type in GSSAPI (RFC2743/RFC2744).

Example:

spool_server_cred_type mechanism-specific
spool_server_cred_name "/O=Grid/O=Globus/OU=example.com/CN=John Smith"

spool_server_cred_service cred_service

This statement specifies the service name of a service certificate used by gfsd for GSI authentication, when ``host'' is specified in spool_server_cred_type statement. This is ignored when you are using sharedsecret authentication. Please read the description of the spool_server_cred_type statement for details.

spool_server_cred_name cred_name

This statement specifies the setting of a certificate used by gfsd for GSI authentication. What this setting means depends on the type specified in the spool_server_cred_type statement. This is ignored when you are using sharedsecret authentication. Please read the description of the spool_server_cred_type statement for details.

metadb_server_host hostname

The metadb_server_host statement specifies the host name on which gfmd is running.

This statement cannot be omitted.

For example,

metadb_server_host ldap.example.com

metadb_server_port port

The metadb_server_port statement specifies the tcp port number the gfmd is listening on. The default port number is 601.

For example,

metadb_server_port 601

metadb_server_cred_type cred_type

This statement specifies the type of credential used by gfmd for GSI authentication. This is ignored when you are using sharedsecret authentication. Please read the description of the spool_server_cred_type statement on the configuration of this statement.

metadb_server_cred_service cred_service

This statement specifies the service name of a service certificate used by gfmd for GSI authentication, when ``host'' is specified in metadb_server_cred_type statement. This is ignored when you are using sharedsecret authentication. Please read the description of the spool_server_cred_type statement on the configuration of this statement.

metadb_server_cred_name cred_name

This statement specifies the setting of a certificate used by gfmd for GSI authentication. What this setting means depends on the type specified in the metadb_server_cred_type statement. This is ignored when you are using sharedsecret authentication. Please read the description of the spool_server_cred_type statement on the configuration of this statement.

metadb_server_stack_size bytes

This directive specifies the size of each thread in the gfmd metadata server process. If not specified, the default size of the OS is used. This parameter is used to cut down the size of virtual memory space used by gfmd.

For example, the default stack size on CentOS 5/i386 is 10MB, thus, you can decrease the size of the virtual memory space of gfmd to 1/40, by specifying 256KB as this parameter.

This parameter is only available in gfmd.conf, and ignored in gfarm2.conf.

For example,

metadb_server_stack_size 262144

metadb_server_thread_pool_size size

This directive specifies the maximum number of threads in a thread pool in the gfmd. It is effective to specify around the number of CPU cores of the metadata server node. Default is 16.

This parameter is only available in gfmd.conf, and ignored in gfarm2.conf.

For example,

metadb_server_thread_pool_size 16

metadb_server_job_queue_length length

This directive specifies the length of job queue in the gfmd. It is effective to specify around the maximum number of clients that access the Gfarm file system at the same time. Default is 16000.

This parameter is only available in gfmd.conf, and ignored in gfarm2.conf.

For example,

metadb_server_job_queue_length 160

metadb_server_heartbeat_interval seconds

This directive specifies the interval of heartbeat in seconds for gfmd to check availability of each gfsd. Default is 180 seconds.

Until gfarm-2.3.0, this parameter was only available in gfmd.conf, and ignored in gfarm2.conf. But since gfarm-2.4.0, gfsd also uses this parameter to detect whether gfmd is down or not, this parameter has to be specified in both gfarm2.conf and gfmd.conf.

For example,

metadb_server_heartbeat_interval 180

metadb_server_dbq_size size

This directive specifies the queue length of metadata updates for a backend database in gfmd. Longer queue length may avoid slow down due to waiting backend database updates in case of frequent metadata operations. Default is 65536.

This parameter is only available in gfmd.conf, and ignored in gfarm2.conf.

For example,

metadb_server_dbq_size 65536

ldap_server_host hostname

The ldap_server_host statement specifies the host name on which an LDAP server is running. This statement is required when the LDAP server is used for a backend database of gfmd. This statement is used in gfmd.conf not gfarm2.conf.

For example,

ldap_server_host ldap.example.com

ldap_server_port port

The ldap_server_port statement specifies the tcp port number of the LDAP server.

This statement cannot be omitted if ldap_server_host is specified.

For example,

ldap_server_port 602

ldap_base_dn LDAP_base_distinguished_name

The ldap_base_dn statement specifies the base-distinguished name of the LDAP database.

This statement cannot be omitted if ldap_server_host is specified.

For example,

ldap_base_dn "dc=example, dc=com"

ldap_bind_dn LDAP_bind_distinguished_name

The ldap_bind_dn statement specifies the distinguished name for the bind operation which is used for authentication to the LDAP database.

For example,

ldap_bind_dn "cn=gfarmuser, dc=example, dc=com"

ldap_bind_password password

The ldap_bind_password statement specifies the password for the bind operation which is used for authentication to the LDAP database.

For example,

ldap_bind_password "secret-ldap-password"

postgresql_server_host hostname

The postgresql_server_host statement specifies the host name on which a PostgreSQL server is running. This statement is required when the PostgreSQL server is used for a backend database of gfmd. This statement is used in gfmd.conf not gfarm2.conf.

For example,

postgresql_server_host postgresql.example.com

postgresql_server_port port

The postgresql_server_port statement specifies the tcp port number of the PostgreSQL server.

This statement cannot be omitted if postgresql_server_host is specified.

For example,

postgresql_server_port 602

postgresql_dbname dbname

The postgresql_dbname statement specifies the database name of the PostgreSQL database.

This statement cannot be omitted if postgresql_server_host is specified.

For example,

postgresql_dbname gfarm

postgresql_user user

The postgresql_user statement specifies the username used to connect the PostgreSQL database.

For example,

postgresql_user gfarm

postgresql_password password

The postgresql_password statement specifies the password used to connect the PostgreSQL database.

For example,

postgresql_password gfarm

postgresql_conninfo connection_info

The postgresql_conninfo statement specifies the connection option used to connect the PostgreSQL database.

For example,

postgresql_conninfo "sslmode=require connect_timeout=30"

auth validity method Host_specification

This statement specifies the authentication method when communicating with the host(s) specified by the third argument.

The first argument should be either the enable or disable keyword. The second argument, auth method, should be the gsi, gsi_auth, or sharedsecret keyword. The third argument specifies the host(s) by using Host specification.

The auth statement may be specified any number of times. For each authentication method, it becomes a candidate when the first entry whose host_specification matches the target host has the enable keyword. When there is no corresponding entry, or when the first corresponding entry has the disable keyword, the authentication method does not become a candidate.

This process takes place on both client and server sides. Candidates for authentication method on both sides will be tried.

The order of statements with different authentication methods is not relevant. When there are several candidates for the authentication method for the host, the order of the authentication trial is sharedsecret, gsi_auth, and then gsi.

The GSI methods are available if and only if the --with-globus option is specified at configuration. When the methods are not available, an auth statement with gsi or gsi_auth will be ignored.

This statement cannot be omitted.

For example,

auth disable sharedsecret 192.168.0.100
auth disable sharedsecret 192.168.0.101
auth enable sharedsecret 192.168.0.0/24
auth enable gsi_auth 10.0.0.0/8
auth enable gsi *

In this example, all hosts which belong to the network address 192.168.0.0/24, except for two hosts, 192.168.0.100 and 192.168.0.101, will be tested for authenticated by both sharedsecret and gsi; all hosts which belong to the network address 10.0.0.0/8 will be tested for authentication by both gsi_auth and gsi; and all other hosts will be authenticated by gsi. Note that two hosts, 192.168.0.100 and 192.168.0.101, will be tested for authentication by gsi only.

sockopt option[=value] [LISTENER | Host_specification]

The sockopt parameter specifies the socket option option via the setsockopt(2) system call.

When LISTENER (all capital letters) is specified by the second argument, the socket option is applied to any socket on the server side (accepting side).

When the host_specification is specified by the second argument, the socket option is applied to sockets that connect to the specified host(s). If the second argument is "*", the socket option is applied to any hosts on the client side (connecting side).

If the second argument is omitted, the socket option is applied to every socket.

The following socket options can be specified.

debug. The SO_DEBUG socket option is specified. A value is not necessary.

keepalive. The SO_KEEPALIVE socket option is specified. A value is not necessary.

sndbuf. The SO_SNDBUF socket option is specified with a value.

rcvbuf. The SO_RCVBUF socket option is specified with a value.

tcp_nodelay. The TCP_NODELAY socket option is specified. A value is not necessary.

For example,

sockopt tcp_nodelay 192.168.0.0/24
sockopt sndbuf=1048576 10.0.0.0/8
sockopt sndbuf=1048576 LISTENER
sockopt rcvbuf=1048576 10.0.0.0/8
sockopt rcvbuf=1048576 LISTENER

known_network Host_specification

The known_network statement specifies a network address for file system nodes. It is used to group file system nodes at file systen node scheduling. File system nodes that are not specified in this directive are assumed to be in an IPv4 class C network.

For example,

known_network 192.168.0.0/24

admin_user user

This directive specifies an administrator user name, which is specified in gfmd.conf.

admin_user_gsi_dn user_gsi_dn

This directive specifies a subject DN of an administrator, which is specified in gfmd.conf.

local_user_map user-map-file

This directive specifies a file name user-map-file for mapping local user names to global user names. This map file is used only for sharedsecret authentication. When this file is not specified, a global user name is assumed to be same as the local user name.

user-map-file is needed when you have to use the sharedsecret authentication method in the case where you have different unix account names on different filesystem nodes. In such a case, the user-map-file on each filesystem node should have an entry from each local user name to a unique global user name.

Example:

local_user_map /etc/gfarm/gfarm-usermap

Each line of the user-map-file consists of two fields separated by spaces; the first field is a global user name, and the second field is a local user name.

Example of the user mapping file:

foobar foo
quux baz

According to the first line of this mapping file, a global user name, "foobar", is mapped to a local user name, "foo", on this node.

local_group_map group-map-file

This directive specifies a file name group-map-file for mapping global group names to local group names. This map file is used by legacy clients that use local group id such as gfarm2fs and gfarm dsi for Globus GridFTP to display mapped local groups. When this file is not specified, a local group name is assumed to be same as the global group name.

Example:

local_group_map /etc/gfarm/gfarm-groupmap

Each line of the group-map-file consists of two fields separated by spaces; the first field is a global group name, and the second field is a local group name.

schedule_cache_timeout seconds

This directive specifies the time (in seconds) until the cache used for filesystem node scheduling expires. The cache holds information on each filesystem node, e.g. load average, disk free space, and whether authentication succeeds or not. The default time is 600 seconds, i.e. ten minutes.

For example,

schedule_cache_timeout 60

schedule_idle_load_thresh load-average

This directive specifies the threshold of CPU load average to be considered idle. The file system nodes whose CPU load average is equal to or below the specified CPU load average are to be scheduled at first. The default load average is 0.1.

For example,

schedule_idle_load_thresh 0.1

schedule_busy_load_thresh load-average

This directive specifies the threshold of CPU load average to be considered busy. The file system nodes whose CPU load average is above the specified CPU load average are to be scheduled lastly. The default load average is 0.5.

For example,

schedule_busy_load_thresh 0.5

schedule_virtual_load load-average

This directive specifies the virtual CPU load average. The virtual CPU load is added when the host is scheduled to avoid scheduling the same host multiple times. The default load average is 0.3.

For example,

schedule_virtual_load 0.3

minimum_free_disk_space bytes

This directive specifies free disk space (in bytes) which is required on filesystem nodes. The Gfarm scheduler excludes filesystem nodes which have less free space than this parameter, when it schedules nodes for jobs which may write files. The free space value may have a suffix like ``k'' (kilo bytes), ``M'' (mega bytes), ``G'' (giga bytes) and ``T'' (tera bytes). The default size is 128M bytes.

This directive has to be specified in both gfarm2.conf and gfmd.conf. After restarting the gfmd and the Gfarm client, it is effective.

For example,

minimum_free_disk_space 1G

simultaneous_replication_receivers number

This directive specifies maximum number of simultaneous gfmd-initiated replications to same host. The default is 20.

For example,

simultaneous_replication_receivers 40

gfsd_connection_cache number

This directive specifies maximum number of cached gfsd connections. The default is 16.

For example,

gfsd_connection_cache 32

attr_cache_limit number

This directive specifies maximum number of cached attributes in gfarm library. The default is 40000.

For example,

attr_cache_limit 100000

attr_cache_timeout milliseconds

This directive specifies maximum time until cached attributes expire in milliseconds. The default is 1000, i.e. 1 second.

For example,

attr_cache_timeout 3600000

log_level priority_level

This directive specifies a level of log priority. The log output, which priority is inferior to this level, will not be sent to syslog or standard error. The priority levels are "emerg", "alert", "crit", "err", "warning", "notice", "info" and "debug" in highest first order. The default level is "info". It's not recommended to specify a level higher or equal to "crit".

For example,

log_level debug

log_message_verbose_level level

This directive specifies how verbose the log message is. The default value is 0, which outputs the log message id. The level 1 additionally outputs the file name and the line of source code. The level 2 additionally outputs the function name.

For example,

log_message_verbose_level 1

no_file_system_node_timeout seconds

If there is no file system node available, Gfarm client library periodically tries to find a file system node. This directive specifies the timeout to try in seconds. The default is 30 seconds.

For example,

no_file_system_node_timeout 30

gfmd_reconnection_timeout seconds

If the connection to the metadata server is disconnected, Gfarm client library periodically tries to reconnect. This directive specifies the timeout to try in seconds. The default is 30 seconds.

For example,

gfmd_reconnection_timeout 30

GRAMMAR

This is a grammar of gfarm2.conf described by the BNF notation.

<statement> ::=
  <spool_statement> |
  <spool_server_listen_address_statement> |
  <spool_server_cred_type_statement> |
  <spool_server_cred_service_statement> |
  <spool_server_cred_name_statement> |
  <metadb_server_host_statement> |
  <metadb_server_port_statement> |
  <metadb_server_cred_type_statement> |
  <metadb_server_cred_service_statement> |
  <metadb_server_cred_name_statement> |
  <metadb_server_stack_size_statement> |
  <metadb_server_thread_pool_size_statement> |
  <metadb_server_job_queue_length_statement> |
  <metadb_server_heartbeat_interval_statement> |
  <metadb_server_dbq_size_statement> |
  <ldap_server_host_statement> |
  <ldap_server_port_statement> |
  <ldap_base_dn_statement> |
  <ldap_bind_dn_statement> |
  <ldap_bind_password_statement> |
  <postgresql_server_host_statement> |
  <postgresql_server_port_statement> |
  <postgresql_dbname_statement> |
  <postgresql_user_statement> |
  <postgresql_password_statement> |
  <postgresql_conninfo_statement> |
  <auth_statement> |
  <sockopt_statement> |
  <known_network_statement> |
  <admin_user_statement> |
  <admin_user_gsi_dn_statement> |
  <local_user_map_statement> |
  <local_group_map_statement> |
  <schedule_cache_timeout_statement> |
  <schedule_idle_load_thresh_statement> |
  <schedule_busy_load_thresh_statement> |
  <schedule_virtual_load_statement> |
  <minimum_free_disk_space_statement> |
  <simultaneous_replication_receivers> |
  <gfsd_connection_cache_statement> |
  <attr_cache_limit_statement> |
  <attr_cache_timeout_statement> |
  <log_level_statement> |
  <log_message_verbose_level_statement>
<spool_statement> ::= "spool" <pathname>
<spool_server_listen_address_statement> ::=
  "spool_server_listen_address" <ipv4_address>
<spool_server_cred_type_statement> ::=
  "spool_server_cred_type" <cred_type>
<spool_server_cred_service_statement> ::=
  "spool_server_cred_service" <cred_service>
<spool_server_cred_name_statement> ::=
  "spool_server_cred_name" <cred_name>
<metadb_server_host_statement> ::= "metadb_server_host" <hostname>
<metadb_server_port_statement> ::= "metadb_server_port" <portnumber>
<metadb_server_cred_type_statement> ::=
  "metadb_server_cred_type" <cred_type>
<metadb_server_cred_service_statement> ::=
  "metadb_server_cred_service" <cred_service>
<metadb_server_cred_name_statement> ::=
  "metadb_server_cred_name" <cred_name>
<metadb_server_stack_size_statement> ::=
  "metadb_server_stack_size" <number>
<metadb_server_thread_pool_size_statement> ::=
  "metadb_server_thread_pool_size" <number>
<metadb_server_job_queue_length_statement> ::=
  "metadb_server_job_queue_length" <number>
<metadb_server_heartbeat_interval_statement> ::=
  "metadb_server_heartbeat_interval" <number>
<metadb_server_dbq_size_statement> ::=
  "metadb_server_dbq_size" <number>
<ldap_server_host_statement> ::= "ldap_server_host" <hostname>
<ldap_server_port_statement> ::= "ldap_server_port" <portnumber>
<ldap_base_dn_statement> ::= "ldap_base_dn" <string>
<ldap_bind_dn_statement> ::= "ldap_bind_dn" <string>
<ldap_bind_password_statement> ::= "ldap_bind_password" <string>
<postgresql_server_host_statement> ::= "postgresql_server_host" <hostname>
<postgresql_server_port_statement> ::= "postgresql_server_port" <portnumber>
<postgresql_dbname_statement> ::= "postgresql_dbname" <string>
<postgresql_user_statement> ::= "postgresql_user" <string>
<postgresql_password_statement> ::= "postgresql_password" <string>
<postgresql_conninfo_statement> ::= "postgresql_conninfo" <string>
<auth_statement> ::=
  "auth" <validity> <auth_method> <hostspec>
<auth_command> ::= "enable" | "disable"
<auth_method> ::= "gsi" | "gsi_auth" | "sharedsecret"
<sockopt_statement> ::=
  "sockopt" <socket_option>[=<number>] [""LISTENER" | <hostspec>]
<socket_option> = "debug" | "keepalive" | "sndbuf" | "rcvbuf" |
  "tcp_nodelay"
<known_network_statement> ::= "known_network" <hostspec>
<admin_user_statement> ::= "admin_user" <string>
<admin_user_gsi_dn_statement> ::= "admin_user_gsi_dn" <string>
<local_user_map_statement> ::= "local_user_map" <pathname>
<local_group_map_statement> ::= "local_group_map" <pathname>
<schedule_cache_timeout_statement> ::= "schedule_cache_timeout" <number>
<schedule_idle_load_thresh_statement> ::= "schedule_idle_load_thresh" <load>
<schedule_busy_load_thresh_statement> ::= "schedule_busy_load_thresh" <load>
<schedule_virtual_load_statement> ::= "schedule_virtual_load" <load>
<minimum_free_disk_space_statement> ::=
  "minimum_free_disk_space" <size>
<simultaneous_replication_receivers> ::= "simultaneous_replication_receivers" <number>
<gfsd_connection_cache_statement> ::= "gfsd_connection_cache" <number>
<attr_cache_limit_statement> ::= "attr_cache_limit" <number>
<attr_cache_timeout_statement> ::= "attr_cache_timeout" <number>
<log_level_statement> ::= "log_level" <log_priority>
<log_message_verbose_level_statement> ::= "log_message_verbose_level" <number>
<no_file_system_node_timeout_statement> ::= "no_file_system_node_timeout" <number>
<gfmd_reconnection_timeout_statement> ::= "gfmd_reconnection_timeout" <number>
<hostspec> ::= <ipv4_address> | <ipv4_address> "/" <address_mask> |
  <hostname> | "." <domain_name> | "*"
<pathname> ::= <pathname_character> <pathname_character>*
<pathname_character> ::= <hostname_character> | "," | "/" | "_"
<hostname> ::= <hostname_character> <hostname_character>*
<hostname_character> ::= <alphabet> | <digit> | "-" | "."
<portnumber> ::= <number>
<size> ::= <number> [ "k" | "M" | "G" | "T" ]
<number> ::= <digit> [<digit>*]
<digit> ::= "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9"
<string> ::= """ <double_quoted_character>* """
<double_quoted_character> ::=
  <any_character_except_backslash_and_double_quotation> |
  "\\" | "\""
<validity> ::= "enable" | "disable"
<log_priority> ::= "emerg" | "alert" | "crit" | "err" | "warning" |
  "notice" | "info" | "debug"

EXAMPLES

The following is an example usin PostgreSQL to store the metadata, and to allow access from filesystem nodes and clients at IP address 192.168.0.0/24, via sharedsecret authentication.

spool /var/spool/gfarm
metadb_server_host metadb.example.org
metadb_server_port 601
postgresql_server_host metadb.example.org
postgresql_server_port 5432
postgresql_dbname gfarm
postgresql_user gfarm
postgresql_password "secret-postgresql-password"
auth enable sharedsecret 192.168.0.0/24
sockopt keepalive

The following is an example using LDAP to store the metadata, and to allow access from filesystem nodes and clients at any IP address, via GSI authentication.

spool /var/spool/gfarm
metadb_server_host metadb.example.com
metadb_server_port 601
ldap_server_host metadb.example.com
ldap_server_port 602
ldap_base_dn "dc=example, dc=com"
ldap_bind_dn "cn=gfarmuser, dc=example, dc=com"
ldap_bind_password "secret-ldap-password"
auth enable gsi *
sockopt keepalive

FILES

%%SYSCONFDIR%%/gfarm2.conf

$HOME/.gfarm2rc

SEE ALSO

gfmd(8), gfsd(8), setsockopt(2)

gfarm-2.4.1/doc/html/en/ref/man5/Makefile0000644000000000000000000000052311507222721016476 0ustar rootroot# $Id: Makefile 2373 2006-01-12 00:54:22Z soda $ top_builddir = ../../../../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk htmldir=$(default_htmldir)/en/ref/man5 DOCBOOK_DIR=$(top_srcdir)/doc/docbook/en/ref/man5 include $(DOCBOOK_DIR)/Makefile.inc HTMLSRC=$(DOCBOOK) include $(top_srcdir)/makes/html.mk gfarm-2.4.1/doc/html/en/ref/index.html0000644000000000000000000001214611507222721016177 0ustar rootroot Gfarm documentation [GFARM LOGO] documents > Reference Manual

Gfarm Reference Manaual

English | Japanese


section 1: commands

  1. client side commands

section 3: libraries

  1. overview
  2. initialization and finalization
  3. file I/O

section 5: file formats


section 8: daemons


gfarm-2.4.1/doc/html/en/ref/man3/0000755000000000000000000000000011507222730015034 5ustar rootrootgfarm-2.4.1/doc/html/en/ref/man3/gfs_pio_set_local.3.html0000644000000000000000000000374411507222721021546 0ustar rootroot gfs_pio_set_local

gfs_pio_set_local

Name

gfs_pio_set_local -- initialize the local file view environment

Synopsis

#include <gfarm/gfarm.h>

char *gfs_pio_set_local(int node, int nnode);

DESCRIPTION

gfs_pio_set_local() initializes the environment for the local file view with the node number node and the total number of nodes nnode.

RETURN VALUES

NULL

The function terminated successfully.

Others

An error except the above occurred. The reason is shown by its pointed strings.

SEE ALSO

gfs_pio_set_view_local(3), gfs_pio_set_view_index(3)

gfarm-2.4.1/doc/html/en/ref/man3/gfs_pio_putline.3.html0000644000000000000000000000373511507222721021261 0ustar rootroot gfs_pio_putline

gfs_pio_putline

Name

gfs_pio_putline -- output of a line

Synopsis

#include <gfarm/gfarm.h>

char *gfs_pio_putline(GFS_File gf, char * s);

DESCRIPTION

gfs_pio_putline() writes the string s and a trailing newline to gf.

RETURN VALUES

NULL

The function terminated successfully.

GFARM_ERR_NO_MEMORY

Insufficient memory was available.

Others

An error except the above occurred. The reason is shown by its pointed strings.

SEE ALSO

gfs_pio_create(3), gfs_pio_open(3)

gfarm-2.4.1/doc/html/en/ref/man3/gfs_glob_add.3.html0000644000000000000000000000366611507222721020470 0ustar rootroot gfs_glob_add

gfs_glob_add

Name

gfs_glob_add -- adds the type of path name

Synopsis

#include <gfarm/gfarm.h>

char *gfs_glob_add(gfs_glob_t * listp, int dtype);

DESCRIPTION

gfs_glob_add() adds the type of path name dtype to listp.

RETURN VALUES

NULL

The function terminated successfully.

GFARM_ERR_NO_MEMORY

Insufficient memory was available.

SEE ALSO

gfs_glob_init(3) gfs_glob(3) gfs_glob_free(3)

gfarm-2.4.1/doc/html/en/ref/man3/gfs_rename.3.html0000644000000000000000000000675111507222721020202 0ustar rootroot gfs_rename

gfs_rename

Name

gfs_rename -- change the name or location of a file

Synopsis

#include <gfarm/gfarm.h>

char *gfs_rename(char * gfarm_url_from, char * gfarm_url_to);

DESCRIPTION

gfs_rename renames a file or directory gfarm_url_from to gfarm_url_to.

If gfarm_url_to already exists, it will be replaced. In this case, when gfarm_url_from is a file gfarm_url_to also must be a file, when gfarm_url_from is a directory, gfarm_url_to must be a empty directory.

Gfs_rename() can't rename a directory to a subdirectory of itself.

RETURN VALUES

NULL

The function terminated successfully.

GFARM_ERR_NO_MEMORY

Insufficient memory was available.

GFARM_ERR_AUTHENTICATION

User authentication failed when connecting to gfmd(8).

GFARM_ERR_PERMISSION_DENIED

The parent directory of gfarm_url_from or gfarm_url_to did not allow write permission.

GFARM_ERR_INVALID_ARGUMENT

A attempt was made to rename the directory gfarm_url_from to a subdirectory of itself.

GFARM_ERR_NO_SUCH_OBJECT

gfarm_url_from does not exist.

GFARM_ERR_IS_A_DIRECTORY

gfarm_url_to is a existing directory, though gfarm_url_from is not a directory.

GFARM_NOT_IS_A_DIRECTORY

gfarm_url_to is not a directory. though gfarm_url_from is a directory.

Others

An error except the above occurred. The reason is shown by its pointed strings.

gfarm-2.4.1/doc/html/en/ref/man3/gfs_pio_putc.3.html0000644000000000000000000000367111507222721020553 0ustar rootroot gfs_pio_putc

gfs_pio_putc

Name

gfs_pio_putc -- output of a character

Synopsis

#include <gfarm/gfarm.h>

char *gfs_pio_putc(GFS_File gf, int c);

DESCRIPTION

gfs_pio_putc() writes the charecter c to gf.

RETURN VALUES

NULL

The function terminated successfully.

GFARM_ERR_NO_MEMORY

Insufficient memory was available.

Others

An error except the above occurred. The reason is shown by its pointed strings.

SEE ALSO

gfs_pio_create(3), gfs_pio_open(3)

gfarm-2.4.1/doc/html/en/ref/man3/gfs_pio_flush.3.html0000644000000000000000000000376711507222721020727 0ustar rootroot gfs_pio_flush

gfs_pio_flush

Name

gfs_pio_flush -- flush a stream

Synopsis

#include <gfarm/gfarm.h>

char *gfs_pio_flush(GFS_File gf);

DESCRIPTION

The function gfs_pio_flush() forces a write of all user-space buffered data for the given output gf.

RETURN VALUES

NULL

The function terminated successfully.

GFARM_ERR_NO_MEMORY

Insufficient memory was available.

Others

An error except the above occurred. The reason is shown by its pointed strings.

SEE ALSO

gfs_pio_create(3), gfs_pio_open(3), gfs_pio_write(3)

gfarm-2.4.1/doc/html/en/ref/man3/gfs_pio_datasync.3.html0000644000000000000000000000460511507222721021404 0ustar rootroot gfs_pio_datasync

gfs_pio_datasync

Name

gfs_pio_datasync -- output a file's data on memroy to disk

Synopsis

#include <gfarm/gfarm.h>

char *gfs_pio_datasync(GFS_File gf);

DESCRIPTION

The function gfs_pio_datasync copies data on memory of the gf, and waits for the I/O to complete before returning. It does nod update metadtata stat information, while another function gfs_pio_sync updates the metadata in addition to the contents.

RETURN VALUES

NULL

The function terminated successfully.

GFARM_ERR_NO_MEMORY

Insufficient memory was available.

Others

An error except the above occurred. The reason is shown by its pointed strings.

SEE ALSO

gfs_pio_sync(3), gfs_pio_create(3), gfs_pio_open(3), gfs_pio_write(3), gfs_pio_flush(3)

gfarm-2.4.1/doc/html/en/ref/man3/gfs_pio_error.3.html0000644000000000000000000000356611507222721020734 0ustar rootroot gfs_pio_error

gfs_pio_error

Name

gfs_pio_error -- check file status

Synopsis

#include <gfarm/gfarm.h>

char *gfs_pio_error(GFS_File gf);

DESCRIPTION

The function gfs_pio_error() tests the error indicator for the file pointed to by gf, returning non-zero if it is set.

RETURN VALUES

NULL

There is no error.

Others

An error occurred. The reason is shown by its pointed strings.

SEE ALSO

gfs_pio_create(3), gfs_pio_eof(3), gfs_pio_open(3)

gfarm-2.4.1/doc/html/en/ref/man3/gfs_unlink.3.html0000644000000000000000000000440511507222721020225 0ustar rootroot gfs_unlink

gfs_unlink

Name

gfs_unlink -- delete a file

Synopsis

#include <gfarm/gfarm.h>

char *gfs_unlink(char * gfarm_url);

DESCRIPTION

gfs_unlink() deletes the file whose name is the string specified by gfarm_url.

RETURN VALUES

NULL

The function terminated successfully.

GFARM_ERR_NO_MEMORY

Insufficient memory was available.

GFARM_ERR_AUTHENTICATION

User authentication failed when connecting to gfmd(8).

GFARM_ERR_PERMISSION_DENIED

gfarm_url points outside your accessible address space.

GFARM_ERR_NO_SUCH_OBJECT

gfarm_url does not exist.

GFARM_ERR_NOT_A_DIRECTORY

A component of the path prefix is not a directory.

Others

An error except the above occurred. The reason is shown by its pointed strings.

gfarm-2.4.1/doc/html/en/ref/man3/gfs_glob_init.3.html0000644000000000000000000000412511507222721020672 0ustar rootroot gfs_glob_init

gfs_glob_init

Name

gfs_glob_init -- allocates memory for types of path names

Synopsis

#include <gfarm/gfarm.h>

char *gfs_glob_init(gfs_glob_t * listp);

DESCRIPTION

gfs_glob_init() allocates memory space for gfs_glob(3) and gfs_glob_add(3). The memory space is stored to listp.

RETURN VALUES

NULL

The function terminated successfully.

GFARM_ERR_NO_MEMORY

Insufficient memory was available.

Others

An error except the above occurred. The reason is shown by its pointed strings.

SEE ALSO

gfs_glob(3) gfs_glob_add(3) gfs_glob_free(3)

gfarm-2.4.1/doc/html/en/ref/man3/gfarm_url_hosts_schedule.3.html0000644000000000000000000000472011507222721023140 0ustar rootroot gfarm_url_hosts_schedule

gfarm_url_hosts_schedule

Name

gfarm_url_hosts_schedule -- schedule filesystem nodes using file-affinity scheduling

Synopsis

#include <gfarm/gfarm.h>

char *gfarm_url_hosts_schedule(char * gfarm_url, char * option, int * nhostsp, char *** hostsp);

DESCRIPTION

The gfarm_url_hosts_schedule() function schedules filesystem nodes using file-affinity scheduling with a Gfarm file gfarm_url, and returns an array of filesystem hostnames hostsp and the number of scheduled hosts nhostsp. The returned array of hostnames hostsp should be free'ed with gfarm_strings_free_deeply(3).

RETURN VALUES

NULL

The function terminated successfully.

GFARM_ERR_NO_MEMORY

Insufficient memory was available.

Others

An error except the above occurred. The reason is shown by its pointed strings.

NOTES

The argument option is reserved to specify options for scheduling, although it is not used in the current implementation.

gfarm-2.4.1/doc/html/en/ref/man3/gfs_pio_set_view_index.3.html0000644000000000000000000001075111507222721022611 0ustar rootroot gfs_pio_set_view_index

gfs_pio_set_view_index

Name

gfs_pio_set_view_index -- change file view to an individual fragment

Synopsis

#include <gfarm/gfarm.h>

char *gfs_pio_set_view_index(GFS_File gf, int fragment_number, int fragment_index, char *host, int flags);

DESCRIPTION

gfs_pio_set_view_index() changes the process's view of the data in the file specified by gf to a file fragment with the index fragment_index.

When creating a new file, it is necessary to specify the total number of file fragments fragment_number. Every parallel process should specify the same fragment_number for the corresponding file. When the file exists, GFARM_FILE_DONTCARE can be specified. If fragment_number is different from the total fragment number of the existent file, it is erroneous.

host is used for explicitly specifying a filesystem node. If host is NULL, appropriate filesystem node is chosen.

Values of flag are constructed by a bitwise-inclusive-OR of the following list.

GFARM_FILE_SEQUENTIAL

File will be accessed sequentially.

GFARM_FILE_REPLICATE

File may be replicated to a local filesystem when accessing remotely. This flag cannot be specified with GFARM_FILE_NOT_REPLICATE.

GFARM_FILE_NOT_REPLICATE

File may not be replicated to a local filesystem when accessing remotely. This flag cannot be specified with GFARM_FILE_REPLICATE.

By default, Gfarm files are accessed as a whole file in global file view where each fragment can be seamlessly accessed.

RETURN VALUES

NULL

The function terminated successfully.

GFARM_ERR_NO_MEMORY

Insufficient memory was available.

GFARM_ERR_OPERATION_NOT_PERMITTED

The file is not a regular fragmented file.

GFARM_ERR_FRAGMENT_NUMBER_DOES_NOT_MATCH

The total number of file fragments is different from the existence one.

GFARM_ERR_INVALID_ARGUMENT

Invalid arguments are specified, for instance, GFARM_FILE_DONTCARE is specified as the total number of fragments of a newly created file.

Others

An error except the above occurred. The reason is shown by its pointed strings.

SEE ALSO

gfs_pio_create(3), gfs_pio_open(3), gfs_pio_set_view_local(3)

gfarm-2.4.1/doc/html/en/ref/man3/gfarm_url_section_replicate_to.3.html0000644000000000000000000000557711507222721024335 0ustar rootroot gfarm_url_section_replicate_to

gfarm_url_section_replicate_to

Name

gfarm_url_section_replicate_to -- Create a file replica of a file section

Synopsis

#include <gfarm/gfarm.h>

char *gfarm_url_section_replicate_to(const char *gfarm_url, char *section, char *dsthost);

DESCRIPTION

gfarm_url_section_replicate_to() creates a file replica of a file section section of a file gfarm_url to a destination host dsthost.

File section is an architecture name for executable files, or is a fragment index for a regular file. Note that a fragment index needs to be specified in string without any unnecessary space character and zero padding.

RETURN VALUES

NULL

The function terminated successfully.

GFARM_ERR_NO_MEMORY

Insufficient memory was available.

GFARM_ERR_NO_SUCH_OBJECT

A component used as a directory in gfarm_url does not exist.

GFARM_ERR_TEXT_FILE_BUSY

The file gfarm_url cannot be replicated because it is being updated by another process.

Others

An error except the above occurred. The reason is shown by its pointed strings.

SEE ALSO

gfarm_url_section_replicate_from_to(3), gfarm_url_fragments_replicate(3)

gfarm-2.4.1/doc/html/en/ref/man3/gfs_chdir.3.html0000644000000000000000000000426111507222721020016 0ustar rootroot gfs_chdir

gfs_chdir

Name

gfs_chdir -- change working directory

Synopsis

#include <gfarm/gfarm.h>

char *gfs_chdir(const char * gfarm_url);

DESCRIPTION

gfs_chdir() changes the current working directory to that specified by gfarm_url.

RETURN VALUES

NULL

The function terminated successfully.

GFARM_ERR_NO_MEMORY

Insufficient memory was available.

GFARM_ERR_AUTHENTICATION

User authentication failed when connecting to gfmd(8).

GFARM_ERR_PERMISSION_DENIED

gfarm_url points outside your accessible address space.

GFARM_ERR_NO_SUCH_OBJECT

Directory does not exist.

GFARM_ERR_NOT_A_DIRECTORY

A component of the path prefix is not a directory.

Others

An error except the above occurred. The reason is shown by its pointed strings.

gfarm-2.4.1/doc/html/en/ref/man3/gfs_pio_truncate.3.html0000644000000000000000000000447111507222721021424 0ustar rootroot gfs_pio_truncate

gfs_pio_truncate

Name

gfs_pio_truncate -- truncate a file to a specified length

Synopsis

#include <gfarm/gfarm.h>

char *gfs_pio_truncate(GFS_File gf, file_offset_t length);

DESCRIPTION

The gfs_pio_truncate() function truncates the regular file gf to the length bytes.

If the file was previously shorter than the length, it is extended, and the extended part is filled by zero bytes.

The file pointer is not changed.

You must specify GFS_FILE_MODE_WRITE in opening the file, because it must be open for writing.

RETURN VALUES

NULL

The function terminated successfully.

GFARM_ERR_NO_MEMORY

Insufficient memory was available.

Others

An error except the above occurred. The reason is shown by its pointed strings.

SEE ALSO

gfs_pio_create(3), gfs_pio_open(3)

gfarm-2.4.1/doc/html/en/ref/man3/gfarm_url_section_replicate_from_to.3.html0000644000000000000000000000640711507222721025351 0ustar rootroot gfarm_url_section_replicate_from_to

gfarm_url_section_replicate_from_to

Name

gfarm_url_section_replicate_from_to -- Create a file replica of a file section

Synopsis

#include <gfarm/gfarm.h>

char *gfarm_url_section_replicate_from_to(const char *gfarm_url, char *section, char *srchost, char *dsthost);

DESCRIPTION

gfarm_url_section_replicate_from_to() creates a file replica of a file section section of a file gfarm_url from a source host srchost to a destination host dsthost.

File section is an architecture name for executable files, or is a fragment index for a regular file. Note that a fragment index needs to be specified in string without any unnecessary space character and zero padding.

When there is no file copy on a host specified by srchost, gfarm_url_section_replicate_from_to() returns error.

RETURN VALUES

NULL

The function terminated successfully.

GFARM_ERR_NO_MEMORY

Insufficient memory was available.

GFARM_ERR_NO_SUCH_OBJECT

A component used as a directory in gfarm_url does not exist, or a file copy does not exist on the specified source host.

GFARM_ERR_TEXT_FILE_BUSY

The file gfarm_url cannot be replicated because it is being updated by another process.

Others

An error except the above occurred. The reason is shown by its pointed strings.

SEE ALSO

gfarm_url_section_replicate_to(3), gfarm_url_fragments_replicate(3)

gfarm-2.4.1/doc/html/en/ref/man3/gfs_pio_gets.3.html0000644000000000000000000001040211507222721020530 0ustar rootroot gfs_pio_gets

gfs_pio_gets

Name

gfs_pio_gets -- read one line

Synopsis

#include <gfarm/gfarm.h>

char *gfs_pio_gets(GFS_File f, char * s, size_t size);

DESCRIPTION

gfs_pio_gets() reads one line from the file specified by the parameter gf to the buffer specified by the parameter s. You need to specify the size of the buffer by the parameter size.

Unlike gfs_pio_getline(3), this function doesn't remove newline character at the end of the buffer. But if whole contents of the line cannot be stored to the buffer due to its length, or if the file reaches the end without newline, there will be no newline at the end of the buffer. In any case, one '\0' character is appended to the end of the buffer.

If the file reaches its end, the length of the string in the buffer becomes 0.

RETURN VALUES

NULL

The function terminated successfully.

GFARM_ERR_NO_MEMORY

Insufficient memory was available.

Others

An error except the above occurred. The reason is shown by its pointed strings.

EXAMPLES

Example 1. Example of gfs_pio_gets function

#include <stdio.h>
#include <stdlib.h>
#include <gfarm/gfarm.h>

int
main(int argc, char **argv)
{
	char *e;
	GFS_File gf;
	char buffer[512];

	e = gfarm_initialize(&argc, &argv);
	if (e != NULL) {
		fprintf(stderr, "gfarm_initialize: %s\n", e);
		return (EXIT_FAILURE);
	}
	if (argc <= 1) {
		fprintf(stderr, "missing gfarm filename\n");
		return (EXIT_FAILURE);
	}
	e = gfs_pio_open(argv[1], GFARM_FILE_RDONLY, &gf);
	if (e != NULL) {
		fprintf(stderr, "%s: %s\n", argv[1], e);
		return (EXIT_FAILURE);
	}
	e = gfs_pio_set_view_global(gf, 0);
	if (e != NULL) {
		fprintf(stderr, "%s: gfs_pio_set_view_global: %s\n",
		    argv[1], e);
		return (EXIT_FAILURE);
	}

	while ((e = gfs_pio_gets(gf, buffer, sizeof buffer)) != NULL &&
	    *buffer != '\0') {
		printf("got: %s", buffer);
	}
	if (e != NULL) {
		fprintf(stderr, "ERROR: %s\n", e);
		return (EXIT_FAILURE);
	}
	e = gfs_pio_close(gf);
	if (e != NULL) {
		fprintf(stderr, "gfs_pio_close: %s\n", e);
		return (EXIT_FAILURE);
	}
	e = gfarm_terminate();
	if (e != NULL) {
		fprintf(stderr, "gfarm_initialize: %s\n", e);
		return (EXIT_FAILURE);
	}
	return (EXIT_SUCCESS);
}

SEE ALSO

gfs_pio_open(3), gfs_pio_getline(3), gfs_pio_readline(3), gfs_pio_readdelim(3)

gfarm-2.4.1/doc/html/en/ref/man3/gfs_glob_free.3.html0000644000000000000000000000305211507222721020646 0ustar rootroot gfs_glob_free

gfs_glob_free

Name

gfs_glob_free -- free memory for types of path names

Synopsis

#include <gfarm/gfarm.h>

char *gfs_glob_free(gfs_glob_t * listp);

DESCRIPTION

gfs_glob_free() frees the dynamically allocated storage from an earlier call to gfs_glob_init(3)

SEE ALSO

gfs_glob_init(3) gfs_glob(3) gfs_glob_add(3)

gfarm-2.4.1/doc/html/en/ref/man3/gfs_opendir.3.html0000644000000000000000000000503111507222721020361 0ustar rootroot gfs_opendir

gfs_opendir

Name

gfs_opendir -- open a directory

Synopsis

#include <gfarm/gfarm.h>

char *gfs_opendir(const char * gfarm_url, GFS_Dir * dirp);

DESCRIPTION

The gfs_opendir() function opens a directory stream corresponding to the directory gfarm_url, and returns the directory stream to the address pointed by dirp. The stream is positioned at the first entry in the directory.

RETURN VALUES

NULL

The function terminated successfully.

GFARM_ERR_NO_MEMORY

Insufficient memory was available.

GFARM_ERR_AUTHENTICATION

User authentication failed when connecting to gfmd(8).

GFARM_ERR_PERMISSION_DENIED

gfarm_url points outside your accessible address space.

GFARM_ERR_NO_SUCH_OBJECT

Directory does not exist.

Others

An error except the above occurred. The reason is shown by its pointed strings.

SEE ALSO

gfs_closedir(3), gfs_readdir(3)

gfarm-2.4.1/doc/html/en/ref/man3/gfs_pio_readline.3.html0000644000000000000000000001320411507222721021354 0ustar rootroot gfs_pio_readline

gfs_pio_readline

Name

gfs_pio_readline -- read one line

Synopsis

#include <gfarm/gfarm.h>

char *gfs_pio_readline(GFS_File f, char **bufp, size_t *sizep, size_t *lenp);

DESCRIPTION

gfs_pio_readline() reads one line from the file specified by the parameter gf.

Parameter bufp specifies an address of a pointer variable initialzed by NULL at first. gfs_pio_readline() allocates a buffer for I/O dynamically, and stores the address of the buffer to this variable pointed by bufp. Parameter sizep specifies an address of a size_t variable initialized by 0. This size_t variable is used to record the size of the buffer. Or, you can specify a buffer allocated by malloc(3) in the variable pointed by the parameter bufp. In this case, you have to specify the size of the allocated buffer by the parameter sizep. If the length of the line exceeds the size of the buffer, the buffer will be automatically realloc(3)ed, and the variable pointed by bufp and sizep will be updated respectively. Note that you are responsible to free(3) this buffer.

This function returns the length of the line to a variable pointed by the parameter lenp. This length includes newline character.

Just like gfs_pio_gets(3), this function doesn't remove newline character at the end of lines. Also, this function always appends '\0' at the end of strings. You can deal with lines which include '\0' character by using the variable pointed by the parameter lenp.

If the file reaches its end, the length of the result string becomes 0.

This function is equivalent to gfs_pio_readdelim(f, bufp, sizep, lenp, "\n", 1).

RETURN VALUES

NULL

The function terminated successfully.

GFARM_ERR_NO_MEMORY

Insufficient memory was available.

Note that you need to free(3) the buffer pointed by the parameter bufp

Others

An error except the above occurred. The reason is shown by its pointed strings.

EXAMPLES

Example 1. Example of gfs_pio_readline function

#include <stdio.h>
#include <stdlib.h>
#include <gfarm/gfarm.h>

int
main(int argc, char **argv)
{
	char *e;
	GFS_File gf;
	size_t bufsize = 0, len;
	char *buffer = NULL;

	e = gfarm_initialize(&argc, &argv);
	if (e != NULL) {
		fprintf(stderr, "gfarm_initialize: %s\n", e);
		return (EXIT_FAILURE);
	}
	if (argc <= 1) {
		fprintf(stderr, "missing gfarm filename\n");
		return (EXIT_FAILURE);
	}
	e = gfs_pio_open(argv[1], GFARM_FILE_RDONLY, &gf);
	if (e != NULL) {
		fprintf(stderr, "%s: %s\n", argv[1], e);
		return (EXIT_FAILURE);
	}
	e = gfs_pio_set_view_global(gf, 0);
	if (e != NULL) {
		fprintf(stderr, "%s: gfs_pio_set_view_global: %s\n",
		    argv[1], e);
		return (EXIT_FAILURE);
	}

	while ((e = gfs_pio_readline(gf, &buffer, &bufsize, &len))
	    == NULL && len > 0) {
		printf("<%6d/%6d >%s", len, bufsize, buffer);
	}
	if (buffer != NULL)
		free(buffer);
	if (e != NULL) {
		fprintf(stderr, "ERROR: %s\n", e);
		return (EXIT_FAILURE);
	}
	e = gfs_pio_close(gf);
	if (e != NULL) {
		fprintf(stderr, "gfs_pio_close: %s\n", e);
		return (EXIT_FAILURE);
	}
	e = gfarm_terminate();
	if (e != NULL) {
		fprintf(stderr, "gfarm_initialize: %s\n", e);
		return (EXIT_FAILURE);
	}
	return (EXIT_SUCCESS);
}

SEE ALSO

gfs_pio_open(3), gfs_pio_getline(3), gfs_pio_gets(3), gfs_pio_readdelim(3)

gfarm-2.4.1/doc/html/en/ref/man3/gfs_stat.3.html0000644000000000000000000000526311507222721017703 0ustar rootroot gfs_stat

gfs_stat

Name

gfs_stat -- get file status

Synopsis

#include <gfarm/gfarm.h>

char *gfs_stat(const char * gfarm_url, struct gfs_stat * status);

DESCRIPTION

gfs_stat() return information about the specified file pointed to by gfarm_url, and fills in the buffer pointed to by status. Since status includes a pointer to dynamically allocated memory space, it is necessary to free the memory space by gfs_stat_free(3).

RETURN VALUES

NULL

The function terminated successfully.

GFARM_ERR_NO_MEMORY

Insufficient memory was available.

GFARM_ERR_AUTHENTICATION

User authentication failed when connecting to gfmd(8).

GFARM_ERR_PERMISSION_DENIED

gfarm_url points outside your accessible address space.

GFARM_ERR_NO_SUCH_OBJECT

gfarm_url does not exist.

GFARM_ERR_NOT_A_DIRECTORY

A component of the path prefix is not a directory.

Others

An error except the above occurred. The reason is shown by its pointed strings.

SEE ALSO

gfs_stat_free(3)

gfarm-2.4.1/doc/html/en/ref/man3/gfs_pio_write.3.html0000644000000000000000000000611211507222721020723 0ustar rootroot gfs_pio_write

gfs_pio_write

Name

gfs_pio_write -- write to a file

Synopsis

#include <gfarm/gfarm.h>

gfarm_error_t gfs_pio_write(GFS_File gf, const void * buffer, int size, int * np);

DESCRIPTION

gfs_pio_write() writes up to size bytes to the file gf from the buffer starting at buffer. It returns the number of bytes written to the address pointed by np.

RETURN VALUES

GFARM_ERR_NO_ERROR

The function terminated successfully.

GFARM_ERR_OPERATION_NOT_PERMITTED

gf does not specify a regular file.

GFARM_ERR_BAD_FILE_DESCRIPTOR

The file descripter specified by gfp is not a valid or is not open for writing.

GFARM_ERR_NO_SPACE

The file system node has no room to store data

GFARM_ERR_NO_FILE_SYSTEM_NODE

There is no available file system node.

GFARM_ERR_NO_MEMORY

Insufficient memory was available.

Others

An error except the above occurred. The reason is shown by gfarm_error_string(3).

SEE ALSO

gfs_pio_create(3), gfs_pio_flush(3), gfs_pio_open(3)

gfarm-2.4.1/doc/html/en/ref/man3/gfs_pio_seek.3.html0000644000000000000000000000510211507222721020516 0ustar rootroot gfs_pio_seek

gfs_pio_seek

Name

gfs_pio_seek -- reposition a stream

Synopsis

#include <gfarm/gfarm.h>

char *gfs_pio_seek(GFS_File gf, file_offset_t offset, int whence, file_offset_t * result);

DESCRIPTION

The gfs_pio_seek() function sets the file position indicator for the file gf. The new position, measured in bytes, is obtained by adding offset bytes to the position specified by whence. If whence is set to 0, 1, or 2, the offset is relative to the start of the file, the current position indicator, or end-of-file, respectively. When result is not NULL, the new position returns to the address pointed by result.

RETURN VALUES

NULL

The function terminated successfully.

GFARM_ERR_NO_MEMORY

Insufficient memory was available.

Others

An error except the above occurred. The reason is shown by its pointed strings.

SEE ALSO

gfs_pio_create(3), gfs_pio_open(3)

gfarm-2.4.1/doc/html/en/ref/man3/gfs_pio_getc.3.html0000644000000000000000000000430711507222721020517 0ustar rootroot gfs_pio_getc

gfs_pio_getc

Name

gfs_pio_getc -- input of a charactor

Synopsis

#include <gfarm/gfarm.h>

int gfs_pio_getc(GFS_File gf);

DESCRIPTION

gfs_pio_getc() reads the next character from gf.

RETURN VALUES

EOF

gfs_pio_getc() encountered end of file or error. EOF is defined in <stdio.h>. gfs_pio_error(3) is used to know end of file or error.

Others

gfs_pio_getc() returns the next character from the file.

SEE ALSO

gfs_pio_create(3), gfs_pio_eof(3), gfs_pio_error(3), gfs_pio_open(3), gfs_pio_ungetc(3)

gfarm-2.4.1/doc/html/en/ref/man3/gfs_realpath.3.html0000644000000000000000000000535611507222721020533 0ustar rootroot gfs_realpath

gfs_realpath

Name

gfs_realpath -- resolve pathname in Gfarm filesystem

Synopsis

#include <gfarm/gfarm.h>

char *gfs_realpath(const char * gfarm_url, char ** resolved_pathp);

DESCRIPTION

gfs_realpath expands a home directory '~' and resolves references to '.', '..' and extra '/' characters in the null terminated string pointed to by gfarm_url and stores the canonicalized absolute pathname to dynamically allocated memory space whose pointer is returned to resolved_pathp. It will be necessary to free the dynamically allocated memory space pointed to by resolved_pathp.

RETURN VALUES

NULL

The function terminated successfully.

GFARM_ERR_NO_MEMORY

Insufficient memory was available.

GFARM_ERR_NOT_A_DIRECTORY

A component of the path prefix is not a directory.

GFARM_ERR_INVALID_ARGUMENT

gfarm_url is NULL.

GFARM_ERR_PERMISSION_DENIED

gfarm_url points outside your accessible address space.

GFARM_ERR_NO_SUCH_OBJECT

gfarm_url does not exist.

Others

An error except the above occurred. The reason is shown by its pointed strings.

gfarm-2.4.1/doc/html/en/ref/man3/gfs_pio_ungetc.3.html0000644000000000000000000000423311507222721021060 0ustar rootroot gfs_pio_ungetc

gfs_pio_ungetc

Name

gfs_pio_ungetc -- push a character back

Synopsis

#include <gfarm/gfarm.h>

int gfs_pio_ungetc(GFS_File gf, int c);

DESCRIPTION

gfs_pio_ungetc() pushes a character c back to the file gf. gfs_pio_ungetc() is needed to follow gfs_pio_getc(3).

RETURN VALUES

EOF

gfs_pio_ungetc() does not follow gfs_pio_getc(3).

Others

The function terminated successfully.

SEE ALSO

gfs_pio_create(3), gfs_pio_error(3), gfs_pio_getc(3), gfs_pio_open(3)

gfarm-2.4.1/doc/html/en/ref/man3/gfarm_url_fragments_replicate.3.html0000644000000000000000000000523411507222721024143 0ustar rootroot gfarm_url_fragments_replicate

gfarm_url_fragments_replicate

Name

gfarm_url_fragments_replicate -- Create a file replica of a file

Synopsis

#include <gfarm/gfarm.h>

char *gfarm_url_fragments_replicate(const char *gfarm_url, int ndsthosts, char **dsthosts);

DESCRIPTION

gfarm_url_fragments_replicate() creates a file replica of a file gfarm_url to destination hosts specified by a string array dsthosts with a length ndsthosts. It cannot replicate an executable file.

When the total number of file fragments is greater than the specified total number of hosts ndsthosts, destination hosts are allocated in round robin.

RETURN VALUES

NULL

The function terminated successfully.

GFARM_ERR_NO_MEMORY

Insufficient memory was available.

GFARM_ERR_OPERATION_NOT_PERMITTED

The file is not a regular fragmented file.

Others

An error except the above occurred. The reason is shown by its pointed strings.

SEE ALSO

gfarm_url_section_replicate_from_to(3), gfarm_url_section_replicate_from_to(3)

gfarm-2.4.1/doc/html/en/ref/man3/gfs_pio_readdelim.3.html0000644000000000000000000001601711507222721021524 0ustar rootroot gfs_pio_readdelim

gfs_pio_readdelim

Name

gfs_pio_readdelim -- read one record

Synopsis

#include <gfarm/gfarm.h>

char *gfs_pio_readdelim(GFS_File f, char **bufp, size_t *sizep, size_t *lenp, char *delimiter, size_t delimlen);

DESCRIPTION

gfs_pio_readdelim() works like gfs_pio_readline(), except a delimiter of input records is not always newline, and can be specified. This function reads one record from the file specified by the parameter gf, by using the parameter delimiter as the delimiter of the input records. You can include '\0' character in the delimiter, So, you have to specify the length of the delimiter by the parameter delimlen. If parameter delimiter is NULL, this function reads entire file as one record. Otherwise, and if the parameter delimlen is 0, this function treats two or more consecutive empty lines (/\n\n+/ in a regular expression) as the input delimiter. This feature is derived from INPUT_RECORD_SEPARATOR in perl language.

Parameter bufp specifies an address of a pointer variable initialzed by NULL at first. gfs_pio_readdelim() allocates a buffer for I/O dynamically, and stores the address of the buffer to this variable pointed by bufp. Parameter sizep specifies an address of a size_t variable initialized by 0. This size_t variable is used to record the size of the buffer. Or, you can specify a buffer allocated by malloc(3) in the variable pointed by the parameter bufp. In this case, you have to specify the size of the allocated buffer by the parameter sizep. If the length of the record exceeds the size of the buffer, the buffer will be automatically realloc(3)ed, and the variable pointed by bufp and sizep will be updated respectively. Note that you are responsible to free(3) this buffer.

This function returns the length of the record to a variable pointed by the parameter lenp. This length includes the length of the record delimiter.

This function doesn't remove the delimiter at the end of records. Also, despite that you can use the value returned by the variable pointed by lenp, this function always appends \0' character at the end of records.

If the file reaches its end, the length of the result record becomes 0.

gfs_pio_readdelim(f, bufp, sizep, lenp, "\n", 1) is equivalent to gfs_pio_readline() function.

RETURN VALUES

NULL

The function terminated successfully.

GFARM_ERR_NO_MEMORY

Insufficient memory was available.

Note that you need to free(3) the buffer pointed by the parameter bufp

Others

An error except the above occurred. The reason is shown by its pointed strings.

EXAMPLES

Example 1. Example of gfs_pio_readdelim function

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <gfarm/gfarm.h>

int
main(int argc, char **argv)
{
	char *e;
	GFS_File gf;
	size_t bufsize = 0, delimlen = 1, len;
	char *buffer = NULL, *delim = "\n";

	e = gfarm_initialize(&argc, &argv);
	if (e != NULL) {
		fprintf(stderr, "gfarm_initialize: %s\n", e);
		return (EXIT_FAILURE);
	}
	while ((c = getopt(argc, argv, "d:D")) != -1) {
		switch (c) {
		case 'd':
			delim = optarg;
			delimlen = strlen(optarg);
			break;
		case 'D':
			delim = NULL;
			delimlen = 0;
			break;
		case '?':
		default:
			fprintf(stderr, "invalid option: %c\n", c);
			return (EXIT_FAILURE);
		}
	}
	if (optind >= argc) {
		fprintf(stderr, "missing gfarm filename\n");
		return (EXIT_FAILURE);
	}
	e = gfs_pio_open(argv[optind], GFARM_FILE_RDONLY, &gf);
	if (e != NULL) {
		fprintf(stderr, "%s: %s\n", argv[optind], e);
		return (EXIT_FAILURE);
	}
	e = gfs_pio_set_view_global(gf, 0);
	if (e != NULL) {
		fprintf(stderr, "%s: gfs_pio_set_view_global: %s\n",
		    argv[optind], e);
		return (EXIT_FAILURE);
	}

	while ((e = gfs_pio_readdelim(gf, &buffer, &bufsize, &len,
	    delim, delimlen)) == NULL && len > 0) {
		printf("<%6d/%6d >%s", len, bufsize, buffer);
	}
	if (buffer != NULL)
		free(buffer);
	if (e != NULL) {
		fprintf(stderr, "ERROR: %s\n", e);
		return (EXIT_FAILURE);
	}
	e = gfs_pio_close(gf);
	if (e != NULL) {
		fprintf(stderr, "gfs_pio_close: %s\n", e);
		return (EXIT_FAILURE);
	}
	e = gfarm_terminate();
	if (e != NULL) {
		fprintf(stderr, "gfarm_initialize: %s\n", e);
		return (EXIT_FAILURE);
	}
	return (EXIT_SUCCESS);
}

SEE ALSO

gfs_pio_open(3), gfs_pio_getline(3), gfs_pio_gets(3), gfs_pio_readline(3)

gfarm-2.4.1/doc/html/en/ref/man3/gfs_pio_getline.3.html0000644000000000000000000000465711507222721021234 0ustar rootroot gfs_pio_getline

gfs_pio_getline

Name

gfs_pio_getline -- read a line

Synopsis

#include <gfarm/gfarm.h>

char *gfs_pio_getline(GFS_File f, char * s, size_t size, int * eofp);

DESCRIPTION

gfs_pio_getline() reads a line from the file gf, and stores to the buffer starting at s at most size - 1 bytes. It is indistinguishable whether the length of a line is more than size or equal to size - 1. It sets 1 into the address pointed by eofp on end of file, otherwise it sets 0.

RETURN VALUES

NULL

The function terminated successfully.

GFARM_ERR_NO_MEMORY

Insufficient memory was available.

Others

An error except the above occurred. The reason is shown by its pointed strings.

SEE ALSO

gfs_pio_create(3), gfs_pio_open(3)

gfarm-2.4.1/doc/html/en/ref/man3/gfs_closedir.3.html0000644000000000000000000000357411507222721020537 0ustar rootroot gfs_closedir

gfs_closedir

Name

gfs_closedir -- close a directory

Synopsis

#include <gfarm/gfarm.h>

char * gfs_closedir(GFS_Dir dir);

DESCRIPTION

The gfs_closedir() function closes the directory stream associated with dir. The directory stream descriptor dir is not available after this call.

RETURN VALUES

NULL

The function terminated successfully.

Others

An error except the above occurred. The reason is shown by its pointed strings.

SEE ALSO

gfs_opendir(3), gfs_readdir(3)

gfarm-2.4.1/doc/html/en/ref/man3/gfarm_initialize.3.html0000644000000000000000000000664111507222721021407 0ustar rootroot gfarm_initialize

gfarm_initialize

Name

gfarm_initialize -- initialize the Gfarm execution environment for client

Synopsis

#include <gfarm/gfarm.h>

gfarm_error_t gfarm_initialize(int *argcp, char *** argvp);

DESCRIPTION

gfarm_initialize() initializes the Gfarm execution environment for client application. This function should be called before any Gfarm library API. argcp is a pointer to the number of arguments and argvp is a pointer to the argument vector.

RETURN VALUES

GFARM_ERR_NO_ERROR

The function terminated successfully.

GFARM_ERR_NO_MEMORY

Insufficient memory was available.

GFARM_ERR_UNKNOWN_HOST

The metadata server cannot be resolved.

GFARM_ERR_NETWORK_IS_UNREACHABLE

Network is unrechable.

GFARM_ERR_OPERATION_TIMED_OUT

Connetion timeout occurs.

GFARM_ERR_PROTOCOL

Protocol error occurs.

GFARM_ERR_BROKEN_PIPE

Connection to the metadata server is broken.

GFARM_ERR_PERMISSION_DENIED

The requested access to the file is not allowed, or one of the directories in gfarm_url did not allow search (execute) permission. Or, the authentication to the metadata server fails.

GFARM_ERR_PROTOCOL_NOT_SUPPORTED

Specified authentication protocol is not supported.

GFARM_ERR_AUTHENTICATION

User authentication failed when connecting to the metadata server.

Others

An error except the above occurred. The reason is shown by its gfarm_error_string(3).

SEE ALSO

gfarm_terminate(3)

gfarm-2.4.1/doc/html/en/ref/man3/gfarm.3.html0000644000000000000000000002243411507222721017164 0ustar rootroot gfarm

gfarm

Name

gfarm -- Gfarm file system API library

Synopsis

#include <gfarm/gfarm.h>

DESCRIPTION

The Gfarm library provides an interface layer to the Gfarm file system. This manual gives an overview of the library. For details, refer to a manual page of each function.

Initialize / Finalize

gfarm_initialize(3) function is used for the initilization of the Gfarm library, and gfarm_terminate(3) function is used for the termination of the library.

File input/output operations

To open an existing file as a stream, gfs_pio_open(3) function is used. To create an file and open the file as a stream, gfs_pio_create(3) function is used. gfs_pio_close(3) function is used to close such streams.

gfs_pio_error(3) function is used to see whether an error happens or not about a stream. gfs_pio_eof(3) function is used to see whether a stream, which is opened for read, already reaches end-of-file or not. gfs_pio_seek(3) function changes the current position of the stream.

gfs_pio_getc(3) function reads a character from a stream, and gfs_pio_ungetc(3) function puts back a character to a stream. gfs_pio_getline(3) function, gfs_pio_gets(3) function, and gfs_pio_readline(3) function read one line from a stream, and gfs_pio_readdelim(3) function reads from stream until delimiter character, specified by the function argument, appears. gfs_pio_read(3) function reads specified bytes from a stream.

gfs_pio_putc(3) function writes one character to a stream, and gfs_pio_putline(3) function and gfs_pio_puts(3) function write one line to a stream. gfs_pio_write(3) function writes specified bytes to a stream. gfs_pio_flush(3) function, gfs_pio_sync(3) function and gfs_pio_datasync(3) function moves buffered data to a storage device. gfs_pio_truncate(3) function truncates a file.

Directory access

gfs_opendir(3) function opens a directory, and gfs_readdir(3) function retrieves entries of the directory. gfs_closedir(3) function closes the directory.

A gfs_glob_t data, which is initialized by gfs_glob_init(3) function, can be passed to gfs_glob(3) function, and the gfs_glob function returns list of matched file/directory names in the gfs_glob_t. The gfs_glob_t must be released by gfs_glob_free(3) function. gfs_glob_add(3) function is used add an entry to gfs_glob_t.

File / Directory manipulation

gfs_chmod(3) function changes the mode of a file, and gfs_chown(3) function changes the owner of a file, and gfs_utimes(3) function changes file's modification time and access time.

gfs_mkdir(3) function creates a directory, and gfs_rmdir(3) function removes a directory. gfs_unlink(3) function removes a file, and gfs_rename(3) function renames a file or a directory.

gfs_stat(3) function returns information like size, modified/access time, etc. The struct gfs_stat returned by gfs_stat function must be released by gfs_stat_free(3) function.

Error handling

Most Gfarm API returns the Gfarm error code in gfarm_error_t. gfarm_error_string(3) function returns a string describing the Gfarm error code. gfarm_errno_to_error(3) function translates the error number (errno) to the Gfarm error code. gfarm_error_to_errno(3) function translates the Gfarm error code to the error number.

String Array manipulation utilities

A gfarm_stringlist type variable represents an array of strings, and this type is initialized by gfarm_stringlist_init(3) function. gfarm_stringlist_add(3) function is used to add a string to a gfarm_stringlist. gfarm_stringlist_cat(3) function is used to add strings to a gfarm_stringlist. gfarm_stringlist_free(3) function releases gfarm_stringlist. gfarm_stringlist_elem(3) function or GFARM_STRINGLIST_ELEM() macro can be used to access each string of an array. gfarm_stringlist_length(3) function can be used to see number of strings in an array.

gfarm_strings_free_deeply(3) function releases a string array and each element of the array by calling standard library function free().

String Array manipulation macros

GFARM_STRINGLIST_ELEM(list, i)

represents i-th element of the list argument which type is gfarm_stringlist. This macro can be used as a L-value. If this macro is used as a value, it returns same result with gfarm_stringlist_elem(3) function.

GFARM_STRINGLIST_STRARRAY(list)

returns pointer to first element of the list argument which type is gfarm_stringlist. The type of the return value is a pointer to pointer to a character.

gfarm-2.4.1/doc/html/en/ref/man3/Makefile0000644000000000000000000000052311507222721016474 0ustar rootroot# $Id: Makefile 2373 2006-01-12 00:54:22Z soda $ top_builddir = ../../../../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk htmldir=$(default_htmldir)/en/ref/man3 DOCBOOK_DIR=$(top_srcdir)/doc/docbook/en/ref/man3 include $(DOCBOOK_DIR)/Makefile.inc HTMLSRC=$(DOCBOOK) include $(top_srcdir)/makes/html.mk gfarm-2.4.1/doc/html/en/ref/man3/gfs_stat_free.3.html0000644000000000000000000000260111507222721020675 0ustar rootroot gfs_stat_free

gfs_stat_free

Name

gfs_stat_free -- free dynamic memory of file status

Synopsis

#include <gfarm/gfarm.h>

void gfs_stat_free(struct gfs_stat * status);

DESCRIPTION

gfs_stat_free() frees frees the memory space of file status status allocated by gfs_stat(3).

SEE ALSO

gfs_stat(3)

gfarm-2.4.1/doc/html/en/ref/man3/gfs_chmod.3.html0000644000000000000000000000625311507222721020022 0ustar rootroot gfs_chmod

gfs_chmod

Name

gfs_chmod -- change permissions of a file

Synopsis

#include <gfarm/gfarm.h>

char *gfs_chmod(char * gfarm_url, mode_t mode);

DESCRIPTION

gfs_chmod() changes the mode of the file given by gfarm_url. Permission bit masks of mode are similar to ones of mode parameter to chmod(2), though only the least 9 bit are effective.

An executable file cannot be changed to a non-executable file and vice versa, unless the number of fragment of the file is only one. In detail, a file has multiple fragments with any execution bit should not be changed to that with no execution bit. It is necessary to have at least one execution bit. Similarly, a file has multiple fragments with no execution bit should not be changed to that with any execution bit.

RETURN VALUES

NULL

The function terminated successfully.

GFARM_ERR_NO_MEMORY

Insufficient memory was available.

GFARM_ERR_AUTHENTICATION

User authentication failed when connecting to gfmd(8) or gfsd(8).

GFARM_ERR_PERMISSION_DENIED

The parent directory of gfarm_url did not allow write permission.

GFARM_ERR_OPERATION_NOT_PERMITTED

The effective UID does not match the owner of the file, and is not zero. Or an attempt was made to change an executable file with more than one fragment to a non-executable file, or vice versa.

GFARM_ERR_NO_SUCH_OBJECT

The file does not exist.

GFARM_ERR_NOT_A_DIRECTORY

A component of the path prefix is not a directory.

Others

An error except the above occurred. The reason is shown by its pointed strings.

gfarm-2.4.1/doc/html/en/ref/man3/gfs_pio_set_view_local.3.html0000644000000000000000000000713011507222721022571 0ustar rootroot gfs_pio_set_view_local

gfs_pio_set_view_local

Name

gfs_pio_set_view_local -- change file view to the corresponding fragment

Synopsis

#include <gfarm/gfarm.h>

char *gfs_pio_set_view_local(GFS_File gf, int flags);

DESCRIPTION

gfs_pio_set_view_local() changes the process's view of the data in the file specified by gf to a file fragment in the local file view. The local file view model assumes each process has its own file fragment which is specified by the argument node of gfs_pio_set_local(3).

The total number of file fragments is also specified by the argument nnode of gfs_pio_set_local(3). If it is different from the total fragment number of the existent file, it is erroneous.

Before changing to the local file view, it is necessary to call gfs_pio_set_local(3) in advance.

Values of flag are constructed by a bitwise-inclusive-OR of GFARM_FILE_SEQUENTIAL, GFARM_FILE_REPLICATE, and GFARM_FILE_NOT_REPLICATE. For details, refer to gfs_pio_set_view_index(3).

By default, Gfarm files are accessed as a whole file in global file view where each fragment can be seamlessly accessed.

RETURN VALUES

NULL

The function terminated successfully.

GFARM_ERR_NO_MEMORY

Insufficient memory was available.

GFARM_ERR_OPERATION_NOT_PERMITTED

The file is not a fragmented file.

GFARM_ERR_FRAGMENT_NUMBER_DOES_NOT_MATCH

The total number of file fragments is different from the existence one.

Others

An error except the above occurred. The reason is shown by its pointed strings.

SEE ALSO

gfs_pio_create(3), gfs_pio_open(3), gfs_pio_set_local(3), gfs_pio_set_view_index(3)

gfarm-2.4.1/doc/html/en/ref/man3/gfs_pio_create.3.html0000644000000000000000000001606211507222721021041 0ustar rootroot gfs_pio_create

gfs_pio_create

Name

gfs_pio_create -- create a file in the Gfarm file system

Synopsis

#include <gfarm/gfarm.h>

gfarm_error_t gfs_pio_create(const char * gfarm_url, int flags, gfarm_mode_t mode, GFS_File * gfp);

DESCRIPTION

gfs_pio_create() creates a new file in the Gfarm file system whose name is the string pointed to by gfarm_url with the access mode mode, and returns a GFS_File structure to the address pointed to by gfp. Mode specifies the file permissions to be created, and is modified by the process's umask.

The flags argument has the same meaning as the second argument of gfs_pio_open(), including the point such that exactly one of GFARM_FILE_RDONLY, GFARM_FILE_WRONLY, and GFARM_FILE_RDWR should be specified.

Note that GFARM_FILE_TRUNC must be explicitly specified by the flags argument if needed.

RETURN VALUES

GFARM_ERR_NO_ERROR

The function terminated successfully.

GFARM_ERR_IS_A_DIRECTORY

gfarm_url refers to a directory.

GFARM_ERR_IS_A_SYMBOLIC_LINK

gfarm_url refers to a symbolic link.

GFARM_ERR_OPERATION_NOT_PERMITTED

gfarm_url refers to not a regular file.

GFARM_ERR_NOT_A_DIRECTORY

A component used as a directory in gfarm_url is not, in fact, a directory.

GFARM_ERR_PERMISSION_DENIED

The requested access to the file is not allowed, or one of the directories in gfarm_url did not allow search (execute) permission, or the file did not exist yet and write access to the parent directory is not allowed. Or, the authentication to the metadata server fails.

GFARM_ERR_NO_MEMORY

Insufficient memory was available.

GFARM_ERR_INVALID_ARGUMENT

flags is not valid.

GFARM_ERR_GFARM_URL_HOST_IS_MISSING

gfarm_url does not include a metadata server.

GFARM_ERR_GFARM_URL_PORT_IS_MISSING

gfarm_url does not include a port number of the metadata server.

GFARM_ERR_UNKNOWN_HOST

The metadata server cannot be resolved.

GFARM_ERR_TOO_MANY_OPEN_FILES

The process opens too many files.

GFARM_ERR_TOO_MANY_OPEN_FILES_IN_SYSTEM

The system limit on the total number of open files has been reached.

GFARM_ERR_NETWORK_IS_UNREACHABLE

Network is unrechable.

GFARM_ERR_OPERATION_TIMED_OUT

Connetion timeout occurs.

GFARM_ERR_PROTOCOL

Protocol error occurs.

GFARM_ERR_BROKEN_PIPE

Connection to the metadata server is broken.

GFARM_ERR_PROTOCOL_NOT_SUPPORTED

Specified authentication protocol is not supported.

GFARM_ERR_AUTHENTICATION

User authentication failed when connecting to the metadata server.

Others

An error except the above occurred. The reason is shown by gfarm_error_string(3).

SEE ALSO

gfs_pio_close(3), gfs_pio_create(3), gfs_pio_eof(3), gfs_pio_error(3), gfs_pio_flush(3), gfs_pio_getc(3), gfs_pio_getline(3), gfs_pio_open(3), gfs_pio_putc(3), gfs_pio_putline(3), gfs_pio_puts(3), gfs_pio_read(3), gfs_pio_seek(3), gfs_pio_ungetc(3), gfs_pio_write(3)

gfarm-2.4.1/doc/html/en/ref/man3/gfs_glob.3.html0000644000000000000000000000611011507222721017643 0ustar rootroot gfs_glob

gfs_glob

Name

gfs_glob -- find path names matching a pattern

Synopsis

#include <gfarm/gfarm.h>

char *gfs_glob(const char * pattern, gfarm_stringlist * paths, gfs_glob_t * types);

DESCRIPTION

gfs_glob() searches for all the path names matching pattern that may include a wildcard, and returns paths.

The returned path names are accessed by gfarm_stringlist_length(3) and gfarm_stringlist_elem(3).

It is necessary to allocate memory space dynamically pointed to by types using gfs_glob_init(3) before calling gfs_glob(3). The allocated memory space needs to be free'ed by gfs_glob_free(3).

RETURN VALUES

NULL

The function terminated successfully.

GFARM_ERR_NO_MEMORY

Insufficient memory was available.

GFARM_ERR_PATHNAME_TOO_LONG

Too long pattern or path name to process.

Others

An error except the above occurred. The reason is shown by its pointed strings.

SEE ALSO

gfs_glob_init(3) gfs_glob_free(3) gfarm_stringlist_init(3) gfarm_stringlist_length(3) gfarm_stringlist_elem(3) gfarm_stringlist_free(3) gfarm_stringlist_free_deeply(3)

gfarm-2.4.1/doc/html/en/ref/man3/gfs_pio_sync.3.html0000644000000000000000000000453511507222721020554 0ustar rootroot gfs_pio_sync

gfs_pio_sync

Name

gfs_pio_sync -- output a file's data on memroy to disk

Synopsis

#include <gfarm/gfarm.h>

char *gfs_pio_sync(GFS_File gf);

DESCRIPTION

The function gfs_pio_sync copies data on memory of the gf, and waits for the I/O to complete before returning. It also updates metadtata stat information, while another function gfs_pio_datasync does not update the metadata.

RETURN VALUES

NULL

The function terminated successfully.

GFARM_ERR_NO_MEMORY

Insufficient memory was available.

Others

An error except the above occurred. The reason is shown by its pointed strings.

SEE ALSO

gfs_pio_datasync(3), gfs_pio_create(3), gfs_pio_open(3), gfs_pio_write(3), gfs_pio_flush(3)

gfarm-2.4.1/doc/html/en/ref/man3/gfs_rmdir.3.html0000644000000000000000000000434511507222721020045 0ustar rootroot gfs_rmdir

gfs_rmdir

Name

gfs_rmdir -- delete a directory

Synopsis

#include <gfarm/gfarm.h>

char *gfs_rmdir(char * gfarm_url);

DESCRIPTION

gfs_rmdir() deletes a directory whose name is the string specified by gfarm_url. The directory must be empty.

RETURN VALUES

NULL

The function terminated successfully.

GFARM_ERR_NO_MEMORY

Insufficient memory was available.

GFARM_ERR_PERMISSION_DENIED

gfarm_url points outside your accessible address space.

GFARM_ERR_DIRECTORY_NOT_EMPTY

Directory is not empty.

GFARM_ERR_NO_SUCH_OBJECT

Directory does not exist.

GFARM_ERR_NOT_A_DIRECTORY

A component of the path prefix is not a directory.

Others

An error except the above occurred. The reason is shown by its pointed strings.

gfarm-2.4.1/doc/html/en/ref/man3/gfarm_terminate.3.html0000644000000000000000000000352011507222721021227 0ustar rootroot gfarm_terminate

gfarm_terminate

Name

gfarm_terminate -- terminate the Gfarm execution environment for client

Synopsis

#include <gfarm/gfarm.h>

gfarm_error_t gfarm_terminate(void);

DESCRIPTION

gfarm_terminate() terminates the Gfarm execution environment for client application.

RETURN VALUES

GFARM_ERR_NO_ERROR

The function terminated successfully.

Others

An error except the above occurred. The reason is shown by gfarm_error_string(3).

SEE ALSO

gfarm_initialize(3)

gfarm-2.4.1/doc/html/en/ref/man3/gfs_pio_puts.3.html0000644000000000000000000000366611507222721020577 0ustar rootroot gfs_pio_puts

gfs_pio_puts

Name

gfs_pio_puts -- output of a string

Synopsis

#include <gfarm/gfarm.h>

char *gfs_pio_puts(GFS_File gf, char * s);

DESCRIPTION

gfs_pio_puts() writes the string s to gf.

RETURN VALUES

NULL

The function terminated successfully.

GFARM_ERR_NO_MEMORY

Insufficient memory was available.

Others

An error except the above occurred. The reason is shown by its pointed strings.

SEE ALSO

gfs_pio_create(3), gfs_pio_open(3)

gfarm-2.4.1/doc/html/en/ref/man3/gfarm_strings_free_deeply.3.html0000644000000000000000000000260711507222721023300 0ustar rootroot gfarm_strings_free_deeply

gfarm_strings_free_deeply

Name

gfarm_strings_free_deeply -- free an array of strings

Synopsis

#include <gfarm/gfarm.h>

void gfarm_strings_free_deeply(int n, char ** strings);

DESCRIPTION

gfarm_string_free_deeply() frees the memory space of an array of strings strings with the size n. This also frees every string in the array.

gfarm-2.4.1/doc/html/en/ref/man3/gfs_mkdir.3.html0000644000000000000000000000515411507222721020035 0ustar rootroot gfs_mkdir

gfs_mkdir

Name

gfs_mkdir -- create a directory

Synopsis

#include <gfarm/gfarm.h>

char *gfs_mkdir(char * gfarm_url, gfarm_mode_t mode);

DESCRIPTION

gfs_mkdir() attempts to create a directory named gfarm_url.

mode speficies the permissions to use. It is modified by the process's umask in the usual way: the permissions of the created file are (mode & ~umask).

RETURN VALUES

NULL

The function terminated successfully.

GFARM_ERR_NO_MEMORY

Insufficient memory was available.

GFARM_ERR_ALREADY_EXISTS

gfarm_url already exists (not necessarily as a directory). This includes the case where gfarm_url is a symbolic link, dangling or not.

GFARM_ERR_NO_SUCH_OBJECT

The parent directory of gfarm_url does not exist.

GFARM_ERR_NOT_A_DIRECTORY

A component of the path prefix is not a directory.

Others

An error except the above occurred. The reason is shown by its pointed strings.

gfarm-2.4.1/doc/html/en/ref/man3/gfs_utimes.3.html0000644000000000000000000000631711507222721020237 0ustar rootroot gfs_utimes

gfs_utimes

Name

gfs_utimes -- set file access and modification times

Synopsis

#include <gfarm/gfarm.h>

char *gfs_utimes(const char * gfarm_url, const struct gfarm_timespec * tsp);

DESCRIPTION

gfs_utimes() sets the access and modification times of the file pointed to by the gfarm_url argument to the value of the tsp argument. The tsp argument is an array of gfarm_timespec structures. The first array member represents the access time, and the second member represents the modification time. The gfarm_timespec structure is:
	struct gfarm_timespec {
		unsigned int tv_sec;	/* seconds */
		unsigned int tv_nsec;	/* nanoseconds */
	};

If the tsp argument is a null pointer, the access and modification times of the file are set to the current time.

RETURN VALUES

NULL

The function terminated successfully.

GFARM_ERR_GFARM_URL_PREFIX_IS_MISSING

gfarm_url does not start with the gfarm: prefix.

GFARM_ERR_NO_MEMORY

Insufficient memory was available.

GFARM_ERR_AUTHENTICATION

User authentication failed when connecting to gfmd(8).

GFARM_ERR_PERMISSION_DENIED

gfarm_url points outside your accessible address space.

GFARM_ERR_NO_SUCH_OBJECT

gfarm_url does not exist.

Others

An error except the above occurred. The reason is shown by its pointed strings.

SEE ALSO

gfs_stat(3)

gfarm-2.4.1/doc/html/en/ref/man3/gfs_pio_read.3.html0000644000000000000000000000566111507222721020514 0ustar rootroot gfs_pio_read

gfs_pio_read

Name

gfs_pio_read -- binary stream input

Synopsis

#include <gfarm/gfarm.h>

gfarm_error_t gfs_pio_read(GFS_File gf, void * buffer, int size, int * np);

DESCRIPTION

gfs_pio_read() attempts to read up to size bytes from the file referenced by gf into the buffer starting at buffer, and returns the number of bytes read to the address pointed by np. On end of file, the number of bytes read is zero.

RETURN VALUES

GFARM_ERR_NO_ERROR

The function terminated successfully.

GFARM_ERR_OPERATION_NOT_PERMITTED

gf does not specify a regular file.

GFARM_ERR_BAD_FILE_DESCRIPTOR

The file descripter specified by gf is not a valid or is not open for reading.

GFARM_ERR_NO_FILE_SYSTEM_NODE

There is no available file system node.

GFARM_ERR_NO_MEMORY

Insufficient memory was available.

Others

An error except the above occurred. The reason is shown by gfarm_error_string(3).

SEE ALSO

gfs_pio_create(3), gfs_pio_open(3)

gfarm-2.4.1/doc/html/en/ref/man3/gfs_pio_open.3.html0000644000000000000000000001622611507222721020541 0ustar rootroot gfs_pio_open

gfs_pio_open

Name

gfs_pio_open -- open a file in the Gfarm file system

Synopsis

#include <gfarm/gfarm.h>

gfarm_error_t gfs_pio_open(const char * gfarm_url, int flags, GFS_File * gfp);

DESCRIPTION

gfs_pio_open() opens a file in the Gfarm file system specified by gfarm_url, and returns a GFS_File structure to the address pointed by gfp. gfarm_url is a path name in the Gfarm file system, or a Gfarm URL in the form of gfarm://metaserver:port/path/name.

Values of flags are constructed by a bitwise-inclusive-OR of the following list. Exactly one of the first three values should be specified:

GFARM_FILE_RDONLY

Open for reading only.

GFARM_FILE_WRONLY

Open for writing only.

GFARM_FILE_RDWR

Open for reading and writing.

GFARM_FILE_TRUNC

If the file already exist and is a regular file, it will be truncated to length 0 if the open mode allows writing.

RETURN VALUES

GFARM_ERR_NO_ERROR

The function terminated successfully.

GFARM_ERR_IS_A_DIRECTORY

gfarm_url refers to a directory.

GFARM_ERR_IS_A_SYMBOLIC_LINK

gfarm_url refers to a symbolic link.

GFARM_ERR_OPERATION_NOT_PERMITTED

gfarm_url refers to not a regular file.

GFARM_ERR_NO_SUCH_OBJECT

A component used as a directory in gfarm_url does not exist.

GFARM_ERR_NOT_A_DIRECTORY

A component used as a directory in gfarm_url is not, in fact, a directory.

GFARM_ERR_PERMISSION_DENIED

The requested access to the file is not allowed, or one of the directories in gfarm_url did not allow search (execute) permission. Or, the authentication to the metadata server fails.

GFARM_ERR_NO_MEMORY

Insufficient memory was available.

GFARM_ERR_INVALID_ARGUMENT

flags is not valid.

GFARM_ERR_GFARM_URL_HOST_IS_MISSING

gfarm_url does not include a metadata server.

GFARM_ERR_GFARM_URL_PORT_IS_MISSING

gfarm_url does not include a port number of the metadata server.

GFARM_ERR_UNKNOWN_HOST

The metadata server cannot be resolved.

GFARM_ERR_TOO_MANY_OPEN_FILES

The process opens too many files.

GFARM_ERR_TOO_MANY_OPEN_FILES_IN_SYSTEM

The system limit on the total number of open files has been reached.

GFARM_ERR_NETWORK_IS_UNREACHABLE

Network is unrechable.

GFARM_ERR_OPERATION_TIMED_OUT

Connetion timeout occurs.

GFARM_ERR_PROTOCOL

Protocol error occurs.

GFARM_ERR_BROKEN_PIPE

Connection to the metadata server is broken.

GFARM_ERR_PROTOCOL_NOT_SUPPORTED

Specified authentication protocol is not supported.

GFARM_ERR_AUTHENTICATION

User authentication failed when connecting to the metadata server.

Others

An error except the above occurred. The reason is shown by gfarm_error_string(3).

SEE ALSO

gfs_pio_close(3), gfs_pio_create(3), gfs_pio_eof(3), gfs_pio_error(3), gfs_pio_flush(3), gfs_pio_getc(3), gfs_pio_getline(3), gfs_pio_open(3), gfs_pio_putc(3), gfs_pio_putline(3), gfs_pio_puts(3), gfs_pio_read(3), gfs_pio_seek(3), gfs_pio_ungetc(3), gfs_pio_write(3)

gfarm-2.4.1/doc/html/en/ref/man3/gfs_pio_eof.3.html0000644000000000000000000000354211507222721020346 0ustar rootroot gfs_pio_eof

gfs_pio_eof

Name

gfs_pio_eof -- check file status

Synopsis

#include <gfarm/gfarm.h>

int gfs_pio_eof(GFS_File gf);

DESCRIPTION

The function gfs_pio_eof() tests the end-of-file indicator for the file pointed to by gf.

RETURN VALUES

zero

The end-of-file indicator is not set.

non-zero

The end-of-file indicator is set.

SEE ALSO

gfs_pio_create(3), gfs_pio_error(3), gfs_pio_open(3)

gfarm-2.4.1/doc/html/en/ref/man3/gfs_pio_close.3.html0000644000000000000000000000440511507222721020701 0ustar rootroot gfs_pio_close

gfs_pio_close

Name

gfs_pio_close -- close a file in the Gfarm file system

Synopsis

#include <gfarm/gfarm.h>

gfarm_error_t gfs_pio_close(GFS_File gfp);

DESCRIPTION

gfs_pio_close() closes a file gfp, so that it no longer refers to any file and may be reused.

RETURN VALUES

GFARM_ERR_NO_ERROR

The function terminated successfully.

GFARM_ERR_BAD_FILE_DESCRIPTOR

The file descripter specified by gfp is not a valid open file descriptor.

GFARM_ERR_NO_MEMORY

Insufficient memory was available.

Others

An error except the above occurred. The reason is shown by gfarm_error_string(3).

SEE ALSO

gfs_pio_create(3), gfs_pio_open(3)

gfarm-2.4.1/doc/html/en/ref/man3/gfs_readdir.3.html0000644000000000000000000000441711507222721020342 0ustar rootroot gfs_readdir

gfs_readdir

Name

gfs_readdir -- read directory entry

Synopsis

#include <gfarm/gfarm.h>

char *gfs_readdir(GFS_Dir dir, struct gfs_dirent ** entryp);

DESCRIPTION

The gfs_readdir() function reads a directory entry from dir, and returns the pointer of the entry to the address pointed to by entryp. The buffer pointed to by entryp is destroyed when calling succeeding gfs_readdir() or gfs_closedir() with the same argument dir.

RETURN VALUES

NULL

The function terminated successfully.

Others

An error except the above occurred. The reason is shown by its pointed strings.

SEE ALSO

gfs_closedir(3), gfs_opendir(3), gfs_readdir(3)

gfarm-2.4.1/doc/html/en/ref/man3/gfs_unlink_section.3.html0000644000000000000000000000472511507222721021756 0ustar rootroot gfs_unlink_section

gfs_unlink_section

Name

gfs_unlink_section -- delete a file

Synopsis

#include <gfarm/gfarm.h>

char *gfs_unlink_section(char * gfarm_url, char * section);

DESCRIPTION

gfs_unlink_section() deletes the file section whose name is the string specifiedby gfarm_url and section.

RETURN VALUES

NULL

The function terminated successfully.

GFARM_ERR_NO_MEMORY

Insufficient memory was available.

GFARM_ERR_AUTHENTICATION

User authentication failed when connecting to gfmd(8).

GFARM_ERR_PERMISSION_DENIED

gfarm_url points outside your accessible address space.

GFARM_ERR_NO_SUCH_OBJECT

section of gfarm_url does not exist.

GFARM_ERR_NOT_A_DIRECTORY

A component of the path prefix is not a directory.

Others

An error except the above occurred. The reason is shown by its pointed strings.

gfarm-2.4.1/doc/html/en/ref/Makefile0000644000000000000000000000040611507222721015636 0ustar rootroottop_builddir = ../../../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk SUBDIRS = man1 man3 man5 man8 htmldir=$(default_htmldir)/en/ref HTML = index.html include $(top_srcdir)/makes/subdir.mk include $(top_srcdir)/makes/html.mk gfarm-2.4.1/doc/html/en/ref/man8/0000755000000000000000000000000011507222730015041 5ustar rootrootgfarm-2.4.1/doc/html/en/ref/man8/gfmd.8.html0000644000000000000000000000711611507222721017017 0ustar rootroot gfmd

gfmd

Name

gfmd(8) -- Gfarm metadata server

Synopsis

gfmd [options]

DESCRIPTION

gfmd is a Gfarm filesystem metadata server for accessing the filesystem metadata of the Gfarm filesystem. gfmd must be running on a metadata server node in advance.

It is possible for gfmd to be executed as a non-privileged user process, although only the user that executes the gfmd can be authenticated. Other users cannot use it. For details, see SETUP.private.en document

To access gfmd, the hostname and the port number should be specified by the metadb_server_host and metadb_server_port statements, respectively, in ~/.gfarm2rc or in %%SYSCONFDIR%%/gfarm2.conf on a client node.

OPTIONS

-L log-level

Specifies a log priority level. The log output, which priority is higher or equal to this level, will be sent to syslog or standard error. Please refer gfarm2.conf(5) for the priority levels which can be specified by this option.

-P pid-file

Specifies a file name to be used to record the process ID of gfmd.

-d

Specifies the debug mode. With the -d option, gfmd runs as a foreground process, not a daemon.

If this option is specified and -L is not specified, the log level is set to "debug".

-f config-file

Specifies a configuration file that is read instead of the default configuration file.

-p port

Specifies a port number to be used by gfmd.

-s syslog-facility

Specifies a syslog facility to report errors encountered by gfmd. By default, local0 is used.

-v

Makes gfmd output verbose log message on authentication. This is useful, when one has to resolve an issue about GSI authenticaion.

-?

Displays a list of command options.

FILES

%%SYSCONFDIR%%/gfmd.conf

configuration file

SEE ALSO

gfarm2.conf(5)

gfarm-2.4.1/doc/html/en/ref/man8/Makefile0000644000000000000000000000052311507222721016501 0ustar rootroot# $Id: Makefile 2373 2006-01-12 00:54:22Z soda $ top_builddir = ../../../../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk htmldir=$(default_htmldir)/en/ref/man8 DOCBOOK_DIR=$(top_srcdir)/doc/docbook/en/ref/man8 include $(DOCBOOK_DIR)/Makefile.inc HTMLSRC=$(DOCBOOK) include $(top_srcdir)/makes/html.mk gfarm-2.4.1/doc/html/en/ref/man8/gfsd.8.html0000644000000000000000000001057611507222721017031 0ustar rootroot gfsd

gfsd

Name

gfsd(8) -- Gfarm filesystem daemon

Synopsis

gfsd [options]

DESCRIPTION

gfsd is a filesystem daemon for the Gfarm filesystem, which runs on every filesystem node, usually, with root privileges.

gfsd provides remote file operations with access control in the Gfarm filesystem as well as user authentication, file replication, and node resource status monitoring.

It is possible for gfsd to be executed as a non-privileged user process, although only the user that executes the gfsd can be authenticated. Other users cannot use it. For details, see SETUP.private.en document.

OPTIONS

-L log-level

Specifies a log priority level. The log output, which priority is higher or equal to this level, will be sent to syslog or standard error. Please refer gfarm2.conf(5) for the priority levels which can be specified by this option.

-P pid-file

Specifies a file name which records the process ID of gfsd.

-c

When starting up, gfsd investigates all files stored in a spool directory. This option is useful when a hostname of a file system node is changed. Valid file copies will be registered to the metadata server.

When the -c option is specified more than once, invalid file copies that are not registered in the metadata server are deleted.

-d

Specifies the debug mode. With the -d option, gfsd runs as a foreground process, not a daemon.

If this option is specified and -L is not specified, the log level is set to "debug".

-f config-file

Specifies a configuration file that is read instead of the default configuration file.

-h hostname

Specifies my own canonical host name.

-l IP-address

Specifies the IP address from which the gfsd accepts TCP and UDP requests. The default address is all IP addresses of the host. This option is useful to invoke multiple instances of gfsd to provide multiple spool directories on the host.

-r directory

Specifies a spool directory for a Gfarm filesystem on this filesystem node.

-s syslog-facility

Specifies a syslog facility to report errors by gfsd. By default, local0 is used.

-v

Makes gfsd output verbose log message on authentication. This is useful, when one has to resolve an issue about GSI authenticaion.

-?

Displays a list of command options.

FILES

%%SYSCONFDIR%%/gfarm2.conf

configuration file

SEE ALSO

gfarm2.conf(5)

gfarm-2.4.1/doc/html/en/ref/man1/0000755000000000000000000000000011507222730015032 5ustar rootrootgfarm-2.4.1/doc/html/en/ref/man1/gfhost.1.html0000644000000000000000000003177111507222721017362 0ustar rootroot gfhost

gfhost

Name

gfhost -- Gfarm host maintenance command

Synopsis

gfhost [-H | -l | -M] [-iLprUv] [-P path] [-a architecture] [-D domain-name] [-j concurrency] [hostname...]

gfhost -c [-P path] -a architecture -p port-number [-n number-of-CPUs] hostname [host-alias...]

gfhost -m [-P path] [-a architecture] [-p port-number] [-n number-of-CPUs] [-A] hostname [host-alias...]

gfhost -d [-P path] hostname...

gfhost -R [-P path]

DESCRIPTION

gfhost is used to display and maintain information about filesystem nodes. The function that gfhost performs is determined by an option, -c, -d, -H, -l, -M, -m, -R. These functions are mutually exclusive, and only one option among them can be specified. If none of them is specified, host name will be displayed as the default function of gfhost.

FUNCTIONS

Metadata in the metadata server will be accessed by function -c, -d, -M, -m or -R. These functions add/delete/display/modify/restore host information in the metadata.

If -H, -l or -M is specified, or none of the functions are specified, gfhost displays filesystem node information. The -M function only accesses information in the metadata server. Display functions other than -M also access gfsd, which is running on filesystem nodes. For functions which access gfhost, the access option can be specified by options -i, -j, -U and -v.

You don't have to specify hostnames for display functions. In that case, all hosts which are registered in metadata will be displayed, but you can limit the type of hosts displayed by the -a or -D option. By default, hosts are displayed in alphabetical order, but you can change this by the -L, -p, or -r options. Although the -L option is ignored in the -M function and in the default function. .

The following is a list of the functions of the gfhost command. You shouldn't specify more than one functions at a time.

<none>

If you don't specify any of the functions, gfhost accesses gfsd, and displays the names of hosts which are currently available as its default function. Hostnames are displayed in alphabetical order, by default.

-c

Creates the metadata information for the host that is specified in the argument. Option -a is mandatory for this function, this option specifies the architecture of the host. Option -p is mandatory in this function too, this option specifies the port number of gfsd on the host. Option -n may be used to specify the number of CPUs of the host, and 1 CPU is assumed, if -n is omitted.

You can specifiy multiple hostnames in this function. In that case, the first hostname is treated as the identifier of the host, and the host identifier is used for replication information management. The rest of the hostnames are used as aliases of the host.

If a host has multiple network interfaces, and each interface has a unique hostname, all of the hostnames must be registered as either host identifiers or host aliases.

If /etc/hosts or the NIS hosts database doesn't contain a DNS domain name part in its hostnames (i.e. these hostnames are not Fully Qualified Domain Names), you must register a host alias. In that case, you must register FQDN (a hostname which contain a domain name part) as the host identifier, and register names without the domain part as the host alias.

-d

Deletes host information from metadata. Currently, even hosts which are referred by replica catalog can be deleted. But be careful, because such deletions cause inconsistencies of metadata. Only a host identifier can be used as a hostname in this function.

-H

Displays load average and authentication method. With this function, the exact hostname passed by the gfhost command arguments will be displayed instead of the canonical host identifier. Also, this function displays the IP address used to access gfsd in parentheses just after the hostname.

If the host cannot be accessed due to a machine down or network problem, etc., x.xx/x.xx/x.xx will be displayed in the load average field. If the host is up, but gfsd on the host cannot be accessed, -.--/-.--/-.-- will be displayed.

The next field is the authentication method used with the host. `G' in this field means GSI authentication and encryption, `g' means only authentication is performed by GSI and actual communication is unprotected plain data (gsi_auth), `s' means gfarm sharedsecret authentication, `x' means that the authentication failed, and `-' means that the authentication wasn't actually tried. If the -U option is specified, this authentication method field won't be provided.

Hostnames are displayed in alphabetical order, by default.

-l

Displays in the long format. This function displays both information retrieved from gfsd and the metadata server. The types of information retrieved from gfsd are load average and authentication method. And the types of information retrieved from the metadata server are architecture name, number of CPUs, host identifier, and host aliases (if any). IP address will be displayed in parentheses just after the hostname used for the access to gfsd.

If the host cannot be accessed due to a machine down or network problem, etc., x.xx/x.xx/x.xx will be displayed in the load average field. If the host is up, but gfsd on the host cannot be accessed , -.--/-.--/-.-- will be displayed.

The next field is the authentication method used with the host. `G' in this field means GSI authentication and encryption, `g' means only authentication is performed by GSI and actual communication is unprotected plain data (gsi_auth), `s' means gfarm sharedsecret authentication, `x' means that the authentication failed, and `-' means that the authentication wasn't actually tried. If that -U option is specified, this authentication method field won't be provided.

Hostnames are displayed in alphabetical order, by default.

-M

The metadata information of the hosts will be displayed. Hostnames are displayed in alphabetical order, by default.

-m

Modifies metadata information of the host, by specifying the host identifier. The -a and -n options overwrite the current value of each option. By contrast, host aliases will be added in this function by default. If you want to replace or delete host aliases, please specify the -A option with this function. In that case, all host aliases will be replaced by specified aliases (if any).

-R

Restores metadata information read from standard input. The format of the metadata is same as the format that the -M function displays.

-?

Prints usage.

OPTIONS

-A

Alter. This option is used with the -m function to replace, rather than add, host aliases.

-a architecture

This option specifies the CPU architecture using a format like sparc-sun-solaris8 or i386-redhat8.0-linux, etc. If this option is used with the -c or -m function, this means the architecture used to add/modify the metadata information. If this option is used with -H, -l, -M function or default function, this limits hosts to the specified architecture.

-D domain-name

This option is used with the -H, -l, -M function or the default function to limit hosts to the specified domain.

-i

There is an "address_use" directive in %%SYSCONFDIR%%/gfarm2.conf and $HOME/.gfarm2rc to give priorities of network addresses for gfarm access. This directive works with the gfhost command, but will be ignored, if you specified the -i option with gfhost.

-j concurrency

This option specifies the concurrency used for access to gfsd. The default value is 10.

-L

Sorts by load average order. This option is effective only with the -H and -l functions.

-n number-of-CPUs

This option is used with the -c or -m function, and specifies the number of CPUs of the host.

-p port-number

This option is used with -c or -m function, and specifies the port number of gfsd on the host.

-P path

This option specifies a pathname or a Gfarm URL to identify a metadata server which will be accessed by this command. If not specified, "/" is used as the default value.

-r

Reverses the order of sort.

-u

Plain order. This option stops sorting on the -H, -l, -M function or the default function. With the -M function, command argument order (if any), or the order that the metadata server answers is used for display. With the -H, -l function or the default function, the result is displayed in the order that each gfsd answers.

-U

Suppresses authentication attempts by TCP, and only queries load average by UDP. This option only makes sense if you specified the -H or -l function, or if you didn't specify any function. This option makes the gfhost command run faster. If the -H or -l function is specified, this option makes the authentication method field disappear.

-v

The -H, -l function and the default function don't produce error reports on gfsd accesses; these error reports will be produced by this option.

SEE ALSO

gfarm2.conf(5), gfsd(8)

gfarm-2.4.1/doc/html/en/ref/man1/gfkey.1.html0000644000000000000000000000552011507222721017166 0ustar rootroot gfkey

gfkey

Name

gfkey -- management of Gfarm session keys

Synopsis

gfkey [options]

DESCRIPTION

gfkey manages the session key file, $HOME/.gfarm_shared_key, that is used for user authentication by a shared secret key in a trusted environment when connecting to gfsd and/or gfmd.

When the home directory is shared among filesystem nodes, it is not necessary to use this command. If not, it is necessary to distribute a session key created with the -c or -f option to every filesystem node, in advance.

OPTIONS

-c

Creates a new session key when there is no valid session key. If a valid session key already exists, no operation is performed.

-f

Forces the creation of a new session key, even if a valid session key already exists.

-p period

Specifies the term of validity in seconds. This option has to be used with the -c or -f option.

-l

Displays the current key.

-e

Displays the expiration date of the current key.

-L message-priority-level

Specifies a level of the log priority. The log messages that have higher or the same priority than the specified priority are displayed to the standard error. The default priority is info. Refer to the log_level directive described in the manual page of gfarm2.conf(5) for the priority level which can be specified by this option.

-?

Displays a list of command options.

FILES

$HOME/.gfarm_shared_key

a file for a session key

gfarm-2.4.1/doc/html/en/ref/man1/gfarm_agent.1.html0000644000000000000000000000723311507222721020336 0ustar rootroot gfarm_agent

gfarm_agent

Name

gfarm_agent -- Gfarm Filesystem Metadata Cache Server

Synopsis

gfarm_agent [options]

DESCRIPTION

gfarm_agent is a cache server for a Gfarm metadata server that can be shared by multiple hosts and multiple users. The cache server greatly improves performance and response time for a Gfarm filesystem by reducing network communication to a distant metadata server.

Any number of gfarm_agents can be running on different nodes (or even on the same node) at the same time. Consistency among multiple cache servers and a metadata server is maintained.

OPTIONS

-L log-level

Specifies a log priority level. The log output, which priority is higher or equal to this level, will be sent to syslog or standard error. Please refer gfarm.conf(5) for the priority levels which can be specified by this option.

-P pid-file

Specifies a file name which records the process ID of gfarm_agent.

-S syslog-facility

Specifies a syslog facility used to report errors by gfarm_agent. By default, local0 is used.

-d

Specifies the debug mode. gfarm_agent runs in the foreground, not in the background.

If this option is specified and -L is not specified, the log level is set to "debug".

-f config-file

Specifies a configuration file that is read instead of the default configuration file.

-m

Specifies the master mode. This improves metadata access performance by caching the path information. This option is only available when there is a single gfarm_agent running.

-p port-number

Specifies a port number for TCP, to be used by gfarm_agent.

-v

Displays verbose error messages in authentication.

-?

Displays a list of command options.

FILES

%%SYSCONFDIR%%/gfarm.conf

configuration file

SEE ALSO

gfarm.conf(5)

gfarm-2.4.1/doc/html/en/ref/man1/gfmv.1.html0000644000000000000000000000214611507222721017021 0ustar rootroot gfmv

gfmv

Name

gfmv -- move (rename) Gfarm file

Synopsis

gfmv [options] src dest

DESCRIPTION

gfmv moves or renames a Gfarm file from src to dest.

OPTIONS

-?

Displays a list of command options.

gfarm-2.4.1/doc/html/en/ref/man1/gfps.1.html0000644000000000000000000000273211507222721017022 0ustar rootroot gfps

gfps

Name

gfps -- report process status

Synopsis

gfps [options] [jobID...]

DESCRIPTION

gfps prints information about processes specified by the arguments. If the argments are missing, it prints information about all processes that have the same effective user ID.

OPTIONS

-a

Lists information about all jobs.

-l

Displays using the long format.

-v

Displays error messages verbosely.

-?

Displays a list of command options.

gfarm-2.4.1/doc/html/en/ref/man1/gfrmdir.1.html0000644000000000000000000000230711507222721017513 0ustar rootroot gfrmdir

gfrmdir

Name

gfrmdir -- remove Gfarm directories

Synopsis

gfrmdir path...

DESCRIPTION

gfrmdir removes directories specified in the arguments.

OPTIONS

-?

displays a list of command options.

SEE ALSO

gfmkdir(1)

gfarm-2.4.1/doc/html/en/ref/man1/gfrm.1.html0000644000000000000000000001136711507222721017022 0ustar rootroot gfrm

gfrm

Name

gfrm -- remove Gfarm files, directories, or file replicas

Synopsis

gfrm [-frRnqv] [-I file-section] [-h filesystem-node] [-D domain-name] [-H hostfile] [-N num-of-replicas] [-j num-of-threads] gfarm-URL...

DESCRIPTION

gfrm removes each specified file. It does not remove directories unless the -r or -R option is specified. '.' or '..' cannot be removed.

When the -I option is specified, gfrm removes the specified file section. File section is an architecture name for executable files, or a fragment index for a regular file.

With the -h, -D, or -H option, gfrm removes file replicas of each specified file or file section on the specified filesystem node(s). All file replicas of a file cannot be removed, unless the -f option is specified.

OPTIONS

-f

Even when all file replicas are specified by the -h, -D, or -H option, forcibly deletes all the file replica. In this case, the specified file will be deleted.

-j num-of-threads

Specifies the number of threads to delete file replicas simultaneously. This option is only available when gfrm is compiled by an OpenMP C compiler.

-n

Prints file names to be deleted, but does not delete them.

-q

Does not print any verbose message.

-r, -R

Removes all entries under the directories specified by the command-line argument recursively.

-v

Prints verbose messages.

-h filesystem-node

Specifies a filesystem node from which file replicas will be removed. With the -I option, a file replica of the specified file section will be removed.

-D domain-name

Specifies a domain name of filesystem nodes on which file replicas will be removed. With the -I option, a file replica of the specified file section will be removed.

-H hostfile

Specifies a hostfile that lists filesystem nodes on which file replicas will be removed. With the -I option, a file replica of the specified file section will be removed.

if ``-'' is specified, standard input is used to read the host list.

-I file-section

Specifies the file section to be removed. File section is an architecture name, such as sparc-sun-solaris8, for executable files, and a fragment index for regular files.

-N num-of-replicas

Specifies the maximum number of file replicas. If files has more number of file replicas than specified, reduce the number of file replicas.

-?

Displays a list of command options.

gfarm-2.4.1/doc/html/en/ref/man1/gfcd.1.html0000644000000000000000000000333311507222721016764 0ustar rootroot gfcd

gfcd

Name

gfcd -- change Gfarm working directory

Synopsis

gfcd [directory]

DESCRIPTION

gfcd changes Gfarm working directory to the directory specified in the argument. If no argument is specified, working directory is changed to the user's home directory that is gfarm:/global_user_name.

To use this command, please add the following setting to the shell rc file of each user.

for shells derived from Bourne shell
gfcd() { eval "`gfsetdir $1`"; }
for csh or tcsh
alias gfcd 'eval `gfsetdir \!*`'

SEE ALSO

gfpwd(1), gfsetdir(1)

gfarm-2.4.1/doc/html/en/ref/man1/gfwc.1.html0000644000000000000000000000174411507222721017013 0ustar rootroot gfwc

gfwc

Name

gfwc -- print the number of bytes, words, and lines in Gfarm files

Synopsis

gfmpirun_p4 {gfarm:gfwc} input-gfarm-URL

DESCRIPTION

This is a sample application invoked with gfmpirun_p4(1).

gfwc reads from input-gfarm-URL and prints the numbers of bytes, words, and lines to the standard output.

gfarm-2.4.1/doc/html/en/ref/man1/gfront.1.html0000644000000000000000000000267511507222721017370 0ustar rootroot gfront

gfront

Name

gfront -- Gfarm filesystem browser

Synopsis

gfront

DESCRIPTION

GFront is a graphical user interface for a Gfarm filesystem. It provides functionalities for browsing a directory tree, and manupulating Gfarm files and directories.

GFront internally executes Gfarm client commands. It is necessary that Gfarm client commands are successfully installed, and the Gfarm configuration file is properly set up.

SEE ALSO

gfexport(1), gfhost(1), gfrm(1), gfreg(1)

gfarm-2.4.1/doc/html/en/ref/man1/gffindxmlattr.1.html0000644000000000000000000000504711507222721020736 0ustar rootroot gffindxmlattr

gffindxmlattr

Name

gffindxmlattr -- Find XML extended attributes by XPath query

Synopsis

gffindxmlattr [-d depth] [-F delim] [XPath | -f XPath-file] path

DESCRIPTION

gffindxmlattr finds XML extended attributes by a specified XPath expression, and displays path names and the corresponding XML extended attribute names. When a file is specified, XML extended attributes associated to the file are searched if there is the read permission.

When a directory is specified, files or directories within the depth are recursively searched. When 0 is specified for the depth, the specified directory is searched. If the depth is not specified, all files and directories under the specified directory are searched. If the negative value is specified, gffindxmlattr returns error. Directories that do not have execute permission cannot be searched.

gffindxmlattr displays path names and the corresponding XML extended attribute separated by the delim.

OPTIONS

-d depth

specifies the depth to be searched recursively.

-F delim

specifies a delimiter that separates the path name and the XML extended attribute name. By detault, the delimiter is TAB.

-f XPath-file

specifies a file that contains XPath expression.

-?

displays usage.

SEE ALSO

gfxattr(1)

gfarm-2.4.1/doc/html/en/ref/man1/gfgroup.1.html0000644000000000000000000000540211507222721017531 0ustar rootroot gfgroup

gfgroup

Name

gfgroup -- Gfarm group maintenance command

Synopsis

gfgroup [-P path] [-l] [group...]

gfgroup [-P path] -c groupname [user...]

gfgroup [-P path] -m groupname [user...]

gfgroup [-P path] -d groupname

DESCRIPTION

gfgroup manages Gfarm groups in Gfarm file system. Default action displays all registered groups. When group names are specified, specified groups are displayed. Gfarm administrator can creates, modifies, and deletes a Gfarm group by -c, -m, and -d options, respectively.

OPTIONS

-P path

This option specifies a pathname or a Gfarm URL to identify a metadata server which will be accessed by this command. If not specified, "/" is used as the default value.

-l

Displays group names and the group members.

-c

Creates a group in Gfarm file system by specifying a group name and initial group members. This option can be used by Gfarm administrators.

-m

Replaces group members of the group with new group members. This option can be used by Gfarm administrators.

-d

Deletes a group. This option can be used by Gfarm administrators.

-?

Displays a list of command options.

SEE ALSO

gfuser(1)

gfarm-2.4.1/doc/html/en/ref/man1/gfxattr.1.html0000644000000000000000000000671211507222721017544 0ustar rootroot gfxattr

gfxattr

Name

gfxattr -- Manipulate extended attributes in Gfarm file system

Synopsis

gfxattr [-s | -g | -l | -r] [-x] [-c | -m] [-f xattrfile] file [xattrname]

DESCRIPTION

gfxattr manipulates extended attributes and XML extended attributes of a specified file. An extended attribute consists of an attribute name and an attribute value, which are arbitrary strings. An XML extended attribute is an extended attribute having an XML attribute value. Since XML extended attributes have a different name space from extended attributes, the same attribute name can be used.

When the -x option is specified, XML extended attributes are manipulated. It is possible to search XML extended attributes by XPath query using gffindxmlattr command.

All files and directories in Gfarm file system can keep extended attributes. When removing a file or directory, the associated extended attributes are also removed.

Either -s, -g, -l, or -r option should be specified.

OPTIONS

-s

sets a new value with an extended attribute xattrname for a specified file. With the -f option, the value can be specified by the file xattrfile instead of by the standard input. When neither -c nor -m option is specified, the extended attribute is overwritten if it is already set.

-g

reads a value with an extended attribute xattrname for a specified file.

-l

display a list of extended attributes for a specified file.

-r

removes a extended attribute xattrname for a specified file.

-x

manipulates XML extended attributes.

-c

sets a new extended attribute if it is not set. This option is used with the -s option.

-m

modifies the extended attribute if there it is. This option is used with the -s option.

-f xattrfile

With the -s option, reads an extended attribute from the specified xattrfile instead of from the standard input. With the -g option, writes the extended attribute to the specified xattrfile instead of to the standard output.

-?

displays usage.

SEE ALSO

gffindxmlattr(1)

gfarm-2.4.1/doc/html/en/ref/man1/gfchmod.1.html0000644000000000000000000000212111507222721017462 0ustar rootroot gfchmod

gfchmod

Name

gfchmod -- change Gfarm file permission

Synopsis

gfchmod [options] mode [path...]

DESCRIPTION

gfchmod changes a permission of Gfarm files.

OPTIONS

-?

Displays a list of command options.

gfarm-2.4.1/doc/html/en/ref/man1/gfreg.1.html0000644000000000000000000001513511507222721017156 0ustar rootroot gfreg

gfreg

Name

gfreg -- register a Gfarm file, Gfarm file fragments, or a Gfarm directory

Synopsis

gfreg [-p ] [-h filesystem-node | -H hostfile | -D domainname] [-a architecture] program ... gfarm-URL

gfreg [-i ] [-h filesystem-node | -H hostfile | -D domainname] localfile ... gfarm-URL

gfreg -N total-num-of-fragments -I fragment-index [-h filesystem-node | -H hostfile | -D domainname] localfile ... gfarm-URL

gfreg -r [-h filesystem-node | -H hostfile | -D domainname] [-a architecture] [directory | program | localfile] ... gfarm-URL

DESCRIPTION

The first form copies and registers the program as a Gfarm file gfarm-URL in the Gfarm filesystem. When gfarm-URL is a directory, multiple programs can be specified. After the registration, the gfarm-URL can be specified as a program name of gfrun(1) and gfmpirun_p4(1). Without the -p option, only executable file can be specified. With the -p option, non-executable file can be specified as well. Without the -a option or the -h option, architecture of the program is assumed to be the same architecture as the client host on that gfreg(1) is executed, which is obtained by the Gfarm metaserver.

The second form registers one or more localfiles as a single Gfarm file. Without the -i option, only non-executable file can be specified as localfile. With the -i option, both excutable and non-executable file can be specified as localfile. The destination filesystem node will be automatically selected by CPU load average. With any one of -h, -H, -D options, filesystem node can be limited.

The third form registers localfile as a file fragment of a Gfarm file. The total number of fragments and the fragment index are specified by the -N option and the -I option, respectively. When gfarm-URL is a directory, multiple localfiles can be specified. The destination filesystemnode will be automatically decided by CPU load average unless any one of -h, -H, -D options is explicitly specified. When the gfreg command of this form is executed on a filesystem node, the local filesystem node is always selected rather than a remote filesystemnode. In this case, -h, -H, -D options help to store files dispersively.

The fourth form registers the directory as a Gfarm directory gfarm-URL, the program or the localfile as a Gfarm file gfarm-URL. If directory have some sub directories and/or files, they will be registered recursively. The non-executable file localfile will be registered as a file has one fragment. A non-executable file in the directory will be registered in the same way. When gfarm-URL already exists as a directory, multiple directories, programs, and localfiles can be specified and they will be registered in gfarm-URL. They can be mixed in parameteres, while other forms inhibit this manner. If gfarm-URL does not exist, one directory or one program, or one localfile can be specified and it will be registered as gfarm-URL. Refer to the first form's part above to specify filesystem node thatprogfarms and files will reside with the -a option or the -h option.

OPTIONS

-f

overwrites gfarm-URL even if it exits as a Gfarm file.

-?

displays a list of command options.

gfarm-2.4.1/doc/html/en/ref/man1/gfstat.1.html0000644000000000000000000000234311507222721017351 0ustar rootroot gfstat

gfstat

Name

gfstat -- display file or directory status

Synopsis

gfstat [options] [path...]

DESCRIPTION

gfstat displays information about the specified files or directories in the Gfarm filesystem.

OPTIONS

-c

displays only the number of file replicas.

-?

displays a list of command options.

gfarm-2.4.1/doc/html/en/ref/man1/gfstatus.1.html0000644000000000000000000000143711507222721017724 0ustar rootroot gfstatus

gfstatus

Name

gfstatus -- display Gfarm configuration status

Synopsis

gfstatus

DESCRIPTION

gfstatus displays information about the Gfarm file system.

gfarm-2.4.1/doc/html/en/ref/man1/gfrun.1.html0000644000000000000000000001424711507222721017210 0ustar rootroot gfrun

gfrun

Name

gfrun, gfrsh, gfssh -- run Gfarm parallel programs

Synopsis

gfrun [options] command arg...

gfrsh [options] command arg...

gfssh [options] command arg...

DESCRIPTION

gfrun executes a parallel command on filesystem nodes, which is determined by the -G option, the -H option, or the -N option.

The -G option specifies the gfarm-URL, which will be used by file-affinity scheduling. In this case, gfrun schedules the same number of filesystem nodes as the number of Gfarm fragments, taking into consideration the physical locations of each fragment replica of the Gfarm file, and filesystem node status. The -H option specifies the hostfile that lists filesystem nodes. The -N option specifies the number of filesystem nodes.

The -G, -H, and -N options are exclusive. When none of the -G, -H, or -N options are specified, gfrun schedules filesystem nodes by file-affinity scheduling using the first existent Gfarm file in the argument list, args. If there are no existent Gfarm files in the argument list, an appropriate filesystem node is selected to be executed.

gfrsh and gfssh utilize rsh and ssh, respectively, instead of gfrcmd.

A command can be specified by a gfarm-URL that is registered using gfreg(1).

OPTIONS

-G gfarm-URL

Specifies a Gfarm file gfarm-URL for file-affinity scheduling. Please read the DESCRIPTION section about how file-affinity scheduling works.

-H hostfile

Specifies a hostfile that lists filesystem nodes.

if ``-'' is specified, standard input is used to read the host list.

-N np

Specifies the number of nodes, np, which are selected in the increasing order of load average.

-r

Specifies an on-demand replication mode. In this mode, every file will be replicated before it is accessed remotely.

-o gfarm-URL

Specifies a Gfarm file that the standard output of the executed program will be redirected to.

-e gfarm-URL

Specifies a Gfarm file that the standard error of the executed program will be redirected to.

-I fragment-index

Specifies a Gfarm fragment index executed by the gfrun command. This option is available only when either file-affinity scheduling is selected by the -G option or a gfarm file in the argument list, or the -N option is specified.

-v

Displays error message verbosely.

-p

Displays the elapsed time of each Gfarm parallel I/O API after the program terminates.

-g

Explicitly specifies that the command is a Gfarm program. Gfarm specific options will be passed to the command as the result.

-u

Explicitly specifies that the command is an ordinary program, and does not take Gfarm specific options.

-b

Specifies global file view as the default file view for programs linked with the Gfarm syscall-hooking library. If this option is not specified, the default is local file view.

-?

Displays a list of command options.

ENVIRONMENT VARIABLES

GFRUN_CMD

Specifies a remote shell command. If globus-job-run is specified, gfrun executes each process using globus-job-run.

SEE ALSO

gfmpirun_p4(1)

gfarm-2.4.1/doc/html/en/ref/man1/gfexport.1.html0000644000000000000000000000401611507222721017716 0ustar rootroot gfexport

gfexport

Name

gfexport -- print on the standard output

Synopsis

gfexport [-H hostfile] [-I fragment-index] gfarm-URL

DESCRIPTION

gfexport outputs a Gfarm file specified by gfarm-URL to the standard output.

OPTIONS

-H hostfile

specifies a list of filesystem nodes explicitly to be accessed. hostfile contains of a hostname that stores the corresponding file fragment in each line. When the -H option is specified, the -I option cannot be specified.

if ``-'' is specified, the standard input is used to read the host list.

-I fragment-index

outputs the only specified fragment index.

If the gfarm-URL is an executable file, an architecture name, for example, sparc-sun-solaris8, can be used to specify the executable architecture. When the -I option is specified, the -H option cannot be specified.

-?

displays a list of command options.

gfarm-2.4.1/doc/html/en/ref/man1/gfimport_fixed.1.html0000644000000000000000000001077311507222721021075 0ustar rootroot gfimport_fixed

gfimport_fixed

Name

gfimport_fixed -- divide and register a fixed-size data file

Synopsis

gfimport_fixed [options] file

DESCRIPTION

gfimport_fixed is a sample program for dividing a file to file fragments and registering it to the Gfarm filesystem.

OPTIONS

-H

hostfile specifies a hostname list of filesystem nodes. The hostfile consists of a hostname of a filesystem node in each line. The file is uniformly divided into file fragments, each file fragment except the last one having the same size. if ``-'' is specified, standard input is used to read the host list.

-f fragment file

specifies a fragment file that consists of a fragment size and a filesystem node separated by a white space in each line.

if ``-'' is specified, standard input is used.

-l record size

specifies the size of fixed-size records in bytes. With this option, file is divided by the multiple size of the record size. Default size is 1.

-o gfarm-URL

specifies an output file.

-?

displays a list of command options.

EXAMPLES

Example 1. Importing by splitting to specified number of fragments

The following is an example using gfimport_fixed to import a source_file as gfarm:file by splitting to 8 fragments.
gfsched -N 8 | gfimport_fixed -H - -o gfarm:file source_file

Example 2. Importing by splitting to specified number of fragments for particular program

The following is an example using gfimport_fixed to import a source_file as gfarm:file by splitting to 8 fragments to be processed by gfarm:prog program.
gfsched -N 8 -p gfarm:prog | gfimport_fixed -H - -o gfarm:file source_file

Example 3. Importing into same disposition with an existing gfarm file

The following is an example using gfimport_fixed to import a source_file as gfarm:file into same disposition with existing file gfarm:template.
gfsched gfarm:template | gfimport_fixed -H - -o gfarm:file source_file

SEE ALSO

gfimport_text(1), gfsched(1), gfarm.conf(5)

gfarm-2.4.1/doc/html/en/ref/man1/gfdf.1.html0000644000000000000000000000516511507222721016774 0ustar rootroot gfdf

gfdf

Name

gfdf -- display disk free space of Gfarm file system

Synopsis

gfdf [options]

DESCRIPTION

gfdf displays disk usage and free space of Gfarm file system.

OPTIONS

-a

Displays only summary information of the Gfarm file system.

-h

Displays numbers in human readable format by adding a prefix multiplier symbol like "M" (mega). Since this option uses powers of 1024, "M" means 1,048,576.

-H

Displays numbers in human readable format by adding a prefix multiplier symbol like "M" (mega). Since this option uses powers of 1000, "M" means 1,000,000.

-n

Displays hostnames of available Gfarm file system nodes.

-r

Sort output in the reverse order.

-S

Sort output in the increasing order of the available disk capacity.

-P path

Specifies a path name to specify a metadata server instead of the root metadata server. Note that this option is not effective with the -a option.

-D domainname

Specifies a domain name of filesystem nodes to list the status of disk free space.

-?

Displays a list of command options.

SEE ALSO

gfhost(1), gfarm2.conf(5)

gfarm-2.4.1/doc/html/en/ref/man1/gfgrep.1.html0000644000000000000000000000435511507222721017340 0ustar rootroot gfgrep

gfgrep

Name

gfgrep -- search a file for a pattern

Synopsis

gfrun {gfarm:gfgrep} -o output-gfarm-URL pattern input-gfarm-URL...

gfrun {gfarm:gfgrep} -o output-gfarm-URL -e pattern input-gfarm-URL...

DESCRIPTION

gfgrep is a sample program of parallel applications executed by gfrun(1) as well as an example to create a Gfarm file in the local file view.

gfgrep searches a pattern from input-gfarm-URL, and outputs to output-gfarm-URL.

Every parallel application executed by gfrun(1) should interpret the -I and -N options that show the rank and the size of the parallel program, respectively, and call gfs_pio_set_local().

OPTIONS

-e pattern

is useful to protect patterns beginning with -.

-o gfarm-URL

specifies an output Gfarm file.

-?

displays a list of command options.

gfarm-2.4.1/doc/html/en/ref/man1/gfchown.1.html0000644000000000000000000000237511507222721017521 0ustar rootroot gfchown

gfchown

Name

gfchown -- change Gfarm file owner and group

Synopsis

gfchown [options] owner[:group] [path...]

gfchown [options] :group [path...]

DESCRIPTION

gfchown changes an owner and a group of Gfarm files.

OPTIONS

-?

Displays a list of command options.

gfarm-2.4.1/doc/html/en/ref/man1/gfrep.1.html0000644000000000000000000001135411507222721017166 0ustar rootroot gfrep

gfrep

Name

gfrep -- replicate Gfarm files

Synopsis

gfrep [-mnqvx] [-S source-domainname] [-D destination-domainname] [-h source-hostfile] [-H destination-hostfile] [-N num-of-replicas] [-j num-of-threads] path...

DESCRIPTION

gfrep creates specified number of replicas of Gfarm files specified by the path to specified set of destination hosts. When set of source hosts are specified, only files stored on the set of source hosts are replicated. A set of hosts can be specified by a domain name and/or a host file. When both a domain name and a host file are specified, a set of hosts is determined by both conditions.

If the path parameter is a directory, files under the directory will be copied recursively.

OPTIONS

-S source-domainname

Specifies the domain name of source filesystem nodes from which replicas will be copied.

-D destination-domainname

Specifies the domain name of destination filesystem nodes to which replicas will be copied.

If neither this nor the -H option is specified, replicas may be copied to any available host.

-h source-hostfile

Specifies a file which describes hostnames of source filesystem nodes from which the replica will be made. The source-hostfile consists of a filesystem node name on each line.

if ``-'' is specified, standard input is used to read the host list.

-H destination-hostfile

Specifies a file which describes hostnames of destination filesystem nodes on which the replica will be made. The destination-hostfile consists of a filesystem node name on each line.

if ``-'' is specified, standard input is used to read the host list.

-N num-of-replicas

Specifies the required number of file replicas, counting already existing ones. If there are a sufficient number of replicas in the destination hosts, neither any copying nor any removal will be done.

If this option is not specified, -N 1 is assumed.

-j num-of-threads

Specifies the number of threads to create file replicas simultaneously. This option is only available when compiled by an OpenMP C compiler. By default, it will be the smallest among the number of total files, the number of source hosts, and the number of destination hosts.

-m

Lets gfrep command do a migrate/move, instead of doing replication.

-x

Removes file replicas when a set of destination nodes has more file replicas than specified.

-n

Displays files to be replicated, but does nothing.

-q

Suppresses non-error messages.

-v

Displays verbose output.

-?

Displays a list of command options.

BUGS

A source host is not always selected within a set of source hosts.

gfarm-2.4.1/doc/html/en/ref/man1/gfuser.1.html0000644000000000000000000000564211507222721017361 0ustar rootroot gfuser

gfuser

Name

gfuser -- Gfarm user maintenance command

Synopsis

gfuser [-P path] [-l] [user...]

gfuser [-P path] -c username realname homedir gsi_dn

gfuser [-P path] -m username realname homedir gsi_dn

gfuser [-P path] -d username

DESCRIPTION

gfuser manages Gfarm global users in Gfarm file system. Default action displays all registered users. When user names are specified, specified users are displayed. Gfarm administrator can creates, modifies, and deletes a Gfarm user by -c, -m, and -d options, respectively.

OPTIONS

-P path

This option specifies a pathname or a Gfarm URL to identify a metadata server which will be accessed by this command. If not specified, "/" is used as the default value.

-l

Displays verbose information of registered users.

-c

Creates a user by specifying a global username in Gfarm file system, a real username, a home directory in Gfarm, and a Subject DN used in GSI. When the real username or the Subject DN includes spaces, it is needed to be quoted. This option can be used by Gfarm administrators.

-m

Replaces a user information of the specified global user with specified real name, home directory and Subject DN. This option can be used by Gfarm administrators.

-d

Deletes a registered user. This option can be used by Gfarm administrators.

-?

Displays a list of command options.

SEE ALSO

gfgroup(1)

gfarm-2.4.1/doc/html/en/ref/man1/Makefile0000644000000000000000000000052311507222721016472 0ustar rootroot# $Id: Makefile 2373 2006-01-12 00:54:22Z soda $ top_builddir = ../../../../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk htmldir=$(default_htmldir)/en/ref/man1 DOCBOOK_DIR=$(top_srcdir)/doc/docbook/en/ref/man1 include $(DOCBOOK_DIR)/Makefile.inc HTMLSRC=$(DOCBOOK) include $(top_srcdir)/makes/html.mk gfarm-2.4.1/doc/html/en/ref/man1/gfmpirun_p4.1.html0000644000000000000000000000542311507222721020315 0ustar rootroot gfmpirun_p4

gfmpirun_p4

Name

gfmpirun_p4 -- run Gfarm parallel programs with mpirun

Synopsis

gfmpirun_p4 [options] command args...

DESCRIPTION

gfmpirun_p4 executes a parallel command on filesystem nodes with mpirun provided by MPICH/p4, which is determined by the -G option, the -H option, or the -N option.

-G, -H, and -N options are exclusive. When none of -G, -H, and -N options are not specified, gfmpirun_p4 schedules filesystem nodes by the file-affinity scheduling using the first existent Gfarm file in the argument list args.

Command can be specified by a gfarm-URL that is registered using gfreg(1).

OPTIONS

-G gfarm-URL

specifies a Gfarm file gfarm-URL for file-affinity scheduling.

-H hostfile

specifies a hostfile that lists filesystem nodes.

if ``-'' is specified, standard input is used to read the host list.

-N np

specifies the number of nodes np, which are selected by the increasing order of load average.

BUGS

gfmpirun_p4 can only work with the MPICH/p4.

SEE ALSO

gfrun(1)

gfarm-2.4.1/doc/html/en/ref/man1/gfsched.1.html0000644000000000000000000001144111507222721017463 0ustar rootroot gfsched

gfsched

Name

gfsched -- schedule and display available file system nodes

Synopsis

gfsched -f gfarm-URL [-D domain-name] [-n number] [-LMclw]

gfsched [-P gfarm-URL] [-D domain-name] [-n number] [-LMlw]

DESCRIPTION

The gfsched command with the -f gfarm-URL option displays available file system nodes which have a file replica of the specified gfarm-URL.

When the -f gfarm-URL option is not specified, the gfsched command just displays available file system nodes. In this case, you can specify a metadata server by the -P gfarm-URL option, if necessary.

OPTIONS

-D domain-name

Limits file system node by specifying a domain name or a hostname.

-c

Displays scheduling information for a file creation, if the file specified by -f doesn't exist.

Currently, this option creates the specified file. But please note that this behavior may be changed in future.

-L

Suppresses authentication check. Without this option, the scheduler checks whether the user will be successfully authenticated with the hosts or not. This option omits the check to make scheduling faster, but that creates a risk that hosts which fail authentication with the user may be scheduled.

-M

Suppresses client-side scheduling and only performs metadata-server-side scheduling. This option makes scheduling faster, but also creates a risk that hosts which is network-unreachable or fails authentication with the user may be scheduled.

-P gfarm-URL

Specifies a gfarm-URL or a pathname to identify a metadata server which is used for the scheduling. This option conflicts with the -f option.

-f gfarm-URL

The gfsched command schedules file system nodes which have a replica of a file specified by this option. This option conflicts with the -P option.

-l

Long format. This option displays port numbers as well as hostnames. Note that the display format of this option may be changed in future.

-n number

Displays specified number of file system nodes at most. If this option is not specified, it displays all available nodes.

-w

Schedules with write-mode. When this option is specified, file system nodes which don't have enough free space won't be displayed.

When both this option and the -f are specified, and if the file is already opened by an existing process with write-mode, the gfsched command only displays one file system node which is assigned for writing to the file.

-?

Displays a list of command options.

EXAMPLES

The following is an example to inquire file system nodes that the metadata server thinks they are currently working.

$ gfsched -M

gfarm-2.4.1/doc/html/en/ref/man1/gfusage.1.html0000644000000000000000000000227111507222721017502 0ustar rootroot gfusage

gfusage

Name

gfusage -- display Gfarm filesystem space usage

Synopsis

gfusage [-c]

DESCRIPTION

gfusage displays Gfarm filesystem space usage for each user.

OPTIONS

-c

Calculates total size, taking replicas into account.

SEE ALSO

gfdf(1)

gfarm-2.4.1/doc/html/en/ref/man1/gfls.1.html0000644000000000000000000000525311507222721017017 0ustar rootroot gfls

gfls

Name

gfls -- list contents of Gfarm directory

Synopsis

gfls [options] [path...]

DESCRIPTION

List information of files or contents of directories specified by path.

OPTIONS

-a

Do not hide entries starting with ``.''.

-A

Do not list ``.'' and ``..''.

-C

Multi-column output. This is the default output format.

-d

List directory entries instead of the contents.

-E seconds

Specifies seconds to hold attribute cache. If 0 is specified, attributes won't be cached.

-F

Append indicator (one of */=@|) to entries.

-i

Display inode number.

-l

List in long format, including mode, owner, group, size in bytes, time of last modification for each file.

-r

Reverse the order while sorting.

-R

Recursively lists subdirectories encountered.

-S

Sort by file size.

-t

Sort by time stamp instead of by name.

-T

With the -l option, show complete date format.

-1

Prints one entry per line of output.

-?

displays a list of command options.

gfarm-2.4.1/doc/html/en/ref/man1/gfmkdir.1.html0000644000000000000000000000271411507222721017506 0ustar rootroot gfmkdir

gfmkdir

Name

gfmkdir -- make Gfarm directories

Synopsis

gfmkdir [options] path...

DESCRIPTION

gfmkdir makes directories specified in the arguments. The arguments must be a pathname in Gfarm file system.

OPTIONS

-p

Even if the specified directory exists, do not return error. Create parent directories if needed.

-?

displays a list of command options.

SEE ALSO

gfrmdir(1)

gfarm-2.4.1/doc/html/en/ref/man1/gfwhere.1.html0000644000000000000000000000237411507222721017514 0ustar rootroot gfwhere

gfwhere

Name

gfwhere -- print replica locations

Synopsis

gfwhere [-r, -R] path...

DESCRIPTION

gfwhere prints replica locations of specified files. When -r or -R option is specified, prints replica locations of subentries in specified directories recursively.

OPTIONS

-r, -R

Displays subdirectories recursively.

-?

Displays a list of command options.

gfarm-2.4.1/doc/html/en/ref/man1/gfchgrp.1.html0000644000000000000000000000211011507222721017471 0ustar rootroot gfchgrp

gfchgrp

Name

gfchgrp -- change Gfarm file group

Synopsis

gfchgrp [options] group [path...]

DESCRIPTION

gfchgrp changes a group of Gfarm files.

OPTIONS

-?

Displays a list of command options.

gfarm-2.4.1/doc/html/en/ref/man1/gfimport_text.1.html0000644000000000000000000001024311507222721020752 0ustar rootroot gfimport_text

gfimport_text

Name

gfimport_text -- divide and register a text file

Synopsis

gfimport_text [options] file

DESCRIPTION

gfimport_text is a sample program for dividing a text file to file fragments by the line and registering it to the Gfarm filesystem.

OPTIONS

-H hostfile

specifies a list of filesystem nodes. The hostfile consists of a hostname of a filesystem node in each line. The file is almost uniformly divided into file fragments.

if ``-'' is specified, standard input is used to read the host list.

-f fragment-file

specifies a fragment-file that consists of a fragment size in byte and a filesystem node separated by a white space in each line.

if ``-'' is specified, standard input is used.

-o gfarm-URL

specifies an output file.

-?

displays a list of command options.

EXAMPLES

Example 1. Importing by splitting to specified number of fragments

The following is an example using gfimport_text to import a source_file as gfarm:file by splitting to 8 fragments.
gfsched -N 8 | gfimport_text -H - -o gfarm:file source_file

Example 2. Importing by splitting to specified number of fragments for particular program

The following is an example using gfimport_text to import a source_file as gfarm:file by splitting to 8 fragments to be processed by gfarm:prog program.
gfsched -N 8 -p gfarm:prog | gfimport_text -H - -o gfarm:file source_file

Example 3. Importing into same disposition with an existing gfarm file

The following is an example using gfimport_text to import a source_file as gfarm:file into same disposition with existing file gfarm:template.
gfsched gfarm:template | gfimport_text -H - -o gfarm:file source_file

SEE ALSO

gfimport_fixed(1), gfsched(1), gfarm.conf(5)

gfarm-2.4.1/doc/html/en/ref/man1/gfln.1.html0000644000000000000000000000241611507222721017010 0ustar rootroot gfln

gfln

Name

gfln -- create a hardlink or a symbolic link

Synopsis

gfln [options] target link_name

DESCRIPTION

gfln creates a hardlink link_name linked to target. When the -s option is specified, it creates a symbolic link.

OPTIONS

-s

Creates a symbolic link.

-?

Displays a list of command options.

gfarm-2.4.1/doc/html/en/ref/man1/gfsetdir.1.html0000644000000000000000000000447511507222721017700 0ustar rootroot gfsetdir

gfsetdir

Name

gfsetdir -- helper command for gfcd

Synopsis

gfsetdir [-s | -c] [directory]

DESCRIPTION

gfsetdir prints shell commands which change Gfarm working directory to the directory specified in the argument. If no argument is specified, it prints commands which change the working directory to the user's home directory that is gfarm:/global_user_name.

This command automatically detects user's shell type, and prints appropriate commands for the shell.

Please add the following definition to the shell rc file of each user, to define gfcd command.

for shells derived from Bourne shell
gfcd() { eval "`gfsetdir $1`"; }
for csh or tcsh
alias gfcd 'eval `gfsetdir \!*`'

OPTIONS

-s

generates Bourne shell commands.

-c

generates C-shell commands.

-?

displays a list of command options.

SEE ALSO

gfcd(1), gfpwd(1)

gfarm-2.4.1/doc/html/en/ref/man1/gfrcmd.1.html0000644000000000000000000000720111507222721017321 0ustar rootroot gfrcmd

gfrcmd

Name

gfrcmd -- Gfarm remote shell

Synopsis

gfrcmd host command...

DESCRIPTION

gfrcmd logs into a filesystem node host and executes commands on the filesystem node. It provides a similar functionality to rsh. The following is a list of differences, however.

A remote server is not executed by inetd, but is incorporated with gfsd(8).

The user is authenticated and authorized by the Gfarm security mechanism. Since this does not rely on privileged TCP ports for authentication like rsh, the maximum number of remote executions is not limited by the number of privileged ports.

Unlike rsh, gfrcmd utilizes a single TCP connection to a filesystem node. It requires less kernel resources than rsh when several processes are executed.

gfrcmd inherits the environment variable DISPLAY and the authentication information of the X Window System.

On the filesystem node, the current working directory is not the home directory that is often shared using NFS, but a spool directory of the Gfarm filesystem, which makes it possible to leave core files on each filesystem node when debugging.

It has functionality that invokes a debugger when a fatal signal occurs.

OPTIONS

-lusername

Specifies a username on a remote host.

-n

Redirects the standard input from the special device /dev/null.

-r

Executes a remote command directly without using a login shell.

-y

Inherits the environment variable, DISPLAY.

-X

Inherits the authentication information of the X Window System. It is useful in a situation where the home directory is not shared.

-v

Displays error message verbosely.

-?

Displays a list of command options.

ENVIRONMENT VARIABLES

GFARM_DEBUG_MODE

Specifies the debugger command that is invoked when a remotely executed command aborts with a fatal signal. When gdb is specified, xterm and the GNU debugger gdb are executed. To utilize this functionality, it is necessary to invoke gfrcmd on the X Window System.

BUGS

The -l option is not implemented yet.

gfarm-2.4.1/doc/html/en/ref/man1/gfexec.1.html0000644000000000000000000000360011507222721017317 0ustar rootroot gfexec

gfexec

Name

gfexec -- execute other commands in the Gfarm filesystem

Synopsis

gfexec [-N number-of-nodes] [-I node-index] [-s] command [args...]

DESCRIPTION

gfexec executes the specified command in Gfarm filesystem. gfexec has to be executed on a filesystem node.

OPTIONS

-N number-of-nodes

Changes the number of nodes for the invoked program to the argument.

-I node-index

Changes the index of the node for the invoked program to the argument.

-s

This option is equivalent to the ``-N 1 -I 0'' option.

-?

Prints usage.

gfarm-2.4.1/doc/html/en/ref/man1/gfpwd.1.html0000644000000000000000000000174111507222721017171 0ustar rootroot gfpwd

gfpwd

Name

gfpwd -- print Gfarm working directory name

Synopsis

gfpwd

DESCRIPTION

gfpwd prints current Gfarm working directory name.

SEE ALSO

gfcd(1), gfsetdir(1)

gfarm-2.4.1/doc/html/en/ref/man1/gfwhoami.1.html0000644000000000000000000000226011507222721017660 0ustar rootroot gfwhoami

gfwhoami

Name

gfwhoami -- print user name on the Gfarm filesystem

Synopsis

gfwhoami [options]

DESCRIPTION

gfwhoami prints a global user name on the Gfarm filesystem.

OPTIONS

-v

Prints the Subject DN of the user for GSI authentication.

-h

Displays a list of command options.

gfarm-2.4.1/doc/html/en/user/0000755000000000000000000000000011507222730014400 5ustar rootrootgfarm-2.4.1/doc/html/en/user/samba-gfarmfs.html0000644000000000000000000001170411507222721017777 0ustar rootroot Grid Datafarm: Samba [English] [GFARM LOGO] documents > User's Manual > samba

Mount Gfarm File System from Windows Machines

English | Japanese

1. Summary

Windows client can access to the Gfarm file system using gfarm2fs and Samba.

Configuration

  • Samba (Linux) machine
    • Install Gfarm version 2 and gfarm2fs. Sharedsecret authentication is recommended.
    • Install FUSE, and specify 'user_allow_other' in /etc/fuse.conf.
    • Install Samba server (smbd).
Software

2. Japanese Filename

See Samba in Japanese

3. Samba Configuration - smb.conf

Specify the mount point of the Gfarm file system in [homes] or [Section Name]. SWAT helps to set up the configuration.
When each user mounts the Gfarm file systen on /tmp/gfarm/username, The following configuration exports the mount point via samba;
[Gfarm]
path = /tmp/gfarm/%u
create mask = 0644
read only = no

See Samba documentations about the details of Samba configurations.

4. FUSE Configuration

The FUSE version 2.3.0 (or later) requires the following setting.

/etc/fuse.conf
user_allow_other

This allows users to specify the -o allow_root or -o allow_other option.

5. Mount by Gfarm2fs

First, check whether you can access to Gfarm by 'gfdf' and 'gfhost -l'. If it is succeeded, mount the Gfarm file system by 'gfarm2fs' on the Samba server.

  $ gfarm2fs [Gfarm2FS options] mountpoint [FUSE options]

This mountpoint must be published by Samba. (See section 3)

Attention

Do not specify '-o allow_other' for the FUSE options. It allows all users to access the Gfarm file system using *your* privilege.

6. Example of Samba Configuration and Application

This is an example that the mountpoint for the Gfarm is automatically mounted by gfarm2fs, when you connect to the 'Gfarm' shared folder. This assume ~/samba-fuse directory exists. The preexec script mounts the Gfarm file system on ~/samba-fuse automatically, and the postexec script umounts it.

This also assume the shared secret key is distributed correctly, or a valid proxy certificate exists on the samba machine.

[Gfarm]
  path = %H/samba-fuse
  exec = /usr/local/bin/gfarmfsmount.sh %P
  preexec close = Yes
  postexec = /usr/local/bin/gfarmfsumount.sh %P
  read only = no

gfarmfsmount.sh
#! /bin/sh

GFARMFS=/usr/local/bin/gfarm2fs
USERNAME=`/usr/bin/whoami`
LOGFILE=/tmp/gfarm2fs-$USERNAME.log

#ARCH="-a i686-FC3-linux"
ALLOWROOT="-o allow_root"

GREP=/bin/grep
DF=/bin/df
TAIL=/usr/bin/tail
DATE=/bin/date

# for fusermount
export PATH=$PATH:/usr/local/bin

#####
if [ $# -ne 1 ]; then
    echo "usage: `basename $0` MOUNTPOINT"
    exit 1
fi

if [ ! -f $LOGFILE ]; then
    touch $LOGFILE
    chmod 600 $LOGFILE
fi

DATE=`$DATE '+%Y%m%d-%H%M%S'`
MOUNTP=$1

($DF -t fuse $MOUNTP | $TAIL +2 | $GREP gfarm2fs > /dev/null && \
    (echo $DATE MOUNT:ALREADY $MOUNTP) || \
    ($GFARMFS $ARCH $MOUNTP $ALLOWROOT && \
    echo $DATE MOUNT:SUCCESS $MOUNTP || ! echo $DATE MOUNT:FAIL $MOUNTP)
) >> $LOGFILE 2>&1

exit $?

gfarmfsumount.sh
#! /bin/sh

FUSERMOUNT=/usr/local/bin/fusermount

USERNAME=`/usr/bin/whoami`
LOGFILE=/tmp/gfarm2fs-$USERNAME.log

DATE=/bin/date
SLEEP=/bin/sleep

#####
if [ $# -ne 1 ]; then
    echo "usage: `basename $0` MOUNTPOINT"
    exit 1
fi

if [ ! -f $LOGFILE ]; then
    touch $LOGFILE
    chmod 600 $LOGFILE
fi

DATE=`date '+%Y%m%d-%H%M%S'`
MOUNTP=$1

(cd /; $SLEEP 1;
    $FUSERMOUNT -u $MOUNTP && \
        echo $DATE UMOUNT:SUCCESS $MOUNTP || \
        echo $DATE UMOUNT:FAIL $MOUNTP
) >> $LOGFILE 2>&1 &

8. comment

If you have any question or comment, feel free to send email to gfarmfs at gmail.com.


Grid Datafarm
gfarm-2.4.1/doc/html/en/user/nfs-gfarmfs.html0000644000000000000000000000746411507222721017512 0ustar rootroot Grid Datafarm: GfarmFS-FUSE + NFS [English] [GFARM LOGO] documents > User's Manual > nfs/gfarmfs-fuse

GfarmFS-FUSE + NFS

English | Japanese

1. Overview

This document describes how to export Gfarm file system via NFS. The exported Gfarm file system is assumed to be mounted by GfarmFS-FUSE.

1.1 Preparation for NFS server

  • GfarmFS-FUSE
  • see README.NFS of FUSE
Note that 'write_local_priority disable' should be set in gfarm.conf when NFS server is a file system node.

1.2 Reference

2. Export NFS file system

2.1 Mount Gfarm file system by GfarmFS-FUSE

Before exporting a Gfarm file system via NFS, it is necessary to mount Gfarm file system by GfarmFS-FUSE in user mode.

  $ gfarmfs [gfarmfs options] mount-point -o allow_root [FUSE options]

When -o allow_root is disallowed, it is necessary to allow it by adding

user_allow_other

in /etc/fuse.conf. For details, refer to a document of GfarmFS-FUSE, Gfarm, and FUSE. The following example assumes /tmp/yourname/gfarmfs is a mount point.

Note that you should not specify the -o allow_other option. In this case, every user can access Gfarm file system under your privilege.

2.2 NFS server setting

To export a GfarmFS-FUSE mounted directory, please see README.NFS of FUSE.
It is necessary to add fsid and anonuid in /etc/exports. Here is an example of /etc/exports.

/tmp/yourname/gfarmfs  AAA.BBB.CCC.0/255.255.255.0(rw,fsid=10,anonuid=1205)

You can specify any unused number for fsid. For anonuid, you need to specify a uid that mounts Gfarm file system using GfarmFS-FUSE. After that, it is necessary to restart the nfs server.

  # service nfs restart

3. Mount Gfarm file system from NFS client

You can mount Gfarm file system from NFS clients as usual. There is no special setting required. Here is an example of /etc/fstab.

AAA.BBB.CCC.1:/tmp/yourname/gfarmfs  /mnt/gfarm/yourname  nfs  rw,sync,noauto  0  0

4. Caveat

  • Gfarm file system, which will be exported via NFS, needs to be mounted by GfarmFS-FUSE in *user mode*. After mounting Gfarm file system by GfarmFS-FUSE, restarting NFS server is required.
  • Gfarm file system exported via NFS can be accessed only by a user who mounts Gfarm file system.

5. Comment

If you have any question or comment, feel free to send email to datafarm@apgrid.org.


Grid Datafarm <datafarm@apgrid.org>
gfarm-2.4.1/doc/html/en/user/index.html0000644000000000000000000000136411507222721016401 0ustar rootroot Gfarm Users' Manual [GFARM LOGO] documents > Users' Manual

Gfarm Users' Manual

English | Japanese

Accessing Gfarm filesystem by using other protocols

gfarm-2.4.1/doc/html/en/user/Makefile0000644000000000000000000000054211507222721016041 0ustar rootroot# $Id: Makefile 3617 2007-03-12 08:32:55Z n-soda $ top_builddir = ../../../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk htmldir=$(default_htmldir)/en/user HTML = index.html \ nfs-gfarmfs.html \ samba-gfarmfs.html # XXX not translated yet # export-gfarm.html \ # samba-hook.html include $(top_srcdir)/makes/html.mk gfarm-2.4.1/doc/html/en/user/samba-hook.html0000644000000000000000000002207011507222721017310 0ustar rootroot Grid Datafarm: Gfarm hook + Samba [English] [GFARM LOGO] documents > User's Manual > samba/hook

Access Gfarm file system via Samba -- using Gfarm syscall-hooking library

English | Japanese

1. Summary

This document describes how to configure samba to access Gfarm file system from Windows clients, by invoking samba with preloaded Gfarm system-call-hooking library.

Another solution: GfarmFS-FUSE + Samba
You can access Gfarm file system using Samba via FUSE, but we recommend using syscall-hooking library because it is easier to configure and use.

2. Prerequisites

  • Samba server host
    • must be able to use Samba version 3.X.
    • must be able to use Gfarm client on the host.
    • must be able to link ilbgfs_hook.
      Please refer to "Configuration of Gfarm client node" in "INSTALL.RPM.en" for steps in detail.
    • recommended that the host isn't a Gfarm file system node.
      Because all new files will be created on th host if the smbd server host is a Gfarm file system node.
    • recommended that all users use sharedsecret as the gfarm authentication method, and all users share their home directories, by e.g. using NFS, on all file system nodes and the host that smbd is running. If a user use GSI authentication she must issue grid-proxy-init in advance and whenever GSI key expires. However GSI is easier to use than sharedsecret in case of a user doesn't share her home directory. Because she must issue "gfkey -c" on the smbd host and copy her ~/.gfarm_shared_key to her home directory of all file system nodes and do this whenever her sharedsecret key expires.
Related Softwares

3. Configure LDAP server

3.1 Configuration for Japanese file name

See Gfarm hook + Samba in Japanese

4. Configure Samba server

4.1 changes to smb.conf

4.1.1 Add lines to [global] section

4.1.1.1 Configuration for Japanese file name
See Gfarm hook + Samba in Japanese
4.1.1.2 Disable kernel change notify (Samba 3.X)
Make Samba not call F_NOTIFY feature of fcntl(2) because Gfarm system-call-hook library does not support it.

kernel change notify = no
A Windows client may be disconnected from the Samba server host without this setting. We have found this problem at least on Samba 3.0.10 and 3.0.20. But this setting has a side effect that file status changes doesn't displayed immediately.
This problem is not avoided on Samba version 2.X, because Samba version 2.X cannot disable 'kernel change notify'.

4.1.2 Adding a section to define a file space share

Add a section to access Gfarm file system¡¥

4.1.2.1 Parameters to access Gfarm file system

Define the following parameters in the section.

Specify as following to make files unexecutable.
create mask = 0644
In default configuration, if you create a new file on Gfarm file sysmtem from a Windows client or copy a file from a Windows client to Gfarm file system, the file will be registered as an executable program that has the same architectue as the file system node on which the file's body will be located. This is different from what you would expect.

Specify following parameters to make Samba not invoke such system calls.
oplocks = no 
level2 oplocks = no
In default configuration, if you access a file on Gfarm file system from a Windows client, Samba invokes system calls that Gfarm doesn't support hooking them.

4.1.2.2 Example

We show you an example section to add for multiple users to share the whole Gfarm file system.

[gfarm-public]
   comment = Gfarm Public Stuff
   path = /gfarm
   public = yes
   writable = yes
   printable = no
   create mask = 0644
   oplocks = no
   level2 oplocks = no

5. Start Samba

5.1 Change start script

We explain using a case on RedHat Linux here.

Add or change the following items for starting smbd. In case of RedHat Linux, starting smbd is described in the function start() in the script file '/etc/init.d/smb'.

5.1.1 Add lines to increase the number of file descriptors

Add the following lines just before invoking smbd:

	n=$(( $(gfhost -M | wc -l) + 50))
	if [ -n "$m" -a X"$m" != X"unlimited" -a "$m" -lt $n ]; then
		ulimit -n $n
	fi

5.1.2 Add environment setting to the line which invokes smbd

Add the setting of environment variables LD_PRELOAD and LD_LIBRARY_PATH to the beginning of the line which invokes smbd. Refer to the README.hook.en document for detail.

For example, in case of RedHat Linux, change the following line

	daemon smbd $SMBDOPTIONS

to

	gfarm_prefix=/usr
	globus_location=/usr/grid
	globus_flavor=gcc32
	LD_LIBRARY_PATH="$globus_location/lib" LD_PRELOAD="$globus_location/lib/libglobus_gssapi_gsi_$globus_flavor.so.0 $globus_location/lib/libssl_$globus_flavor.so.0 $gfarm_prefix/lib/libgfs_hook.so.0 /usr/lib/gfarm/libpthread-not-hidden.so /usr/lib/gfarm/libc-not-hidden.so" daemon smbd $SMBDOPTIONS

Configure the variable gfarm_prefix and globus_location to match your installation pathnames of Gfarm and Globus, and configure globus_flavor variable to match your Globus flavor name which is linked with Gfarm.

Before adding these Globus related paths, you need to install Globus shared libraries if you have linked Globus libraries to Gfarm binaries, otherwise you need not this addition. If you install Gfarm binary distribution for RedHat Linux, you need this addition because they are linked with Globus.

Adding assignment to LD_LIBRALY_PATH is necessary only if Globus is dynamically linked to Gfarm binaries. Binary distribution for RedHat Linux is statically linked with Globus so it can be omitted.

Specifying "*-not-hiddden.so" is unnecessary on OS other than Linux.

5.2 Sample of configured script to start Samba

#!/bin/sh

(*snip*)

start() {
	KIND="SMB"
	echo -n $"Starting $KIND services: "
	m=`ulimit -n`
	n=$(( $(gfhost -M | wc -l) + 50))
	if [ -n "$m" -a X"$m" != X"unlimited" -a "$m" -lt $n ]; then
		ulimit -n $n
	fi
	gfarm_prefix=/usr
	globus_location=/usr/grid
	globus_flavor=gcc32
	LD_LIBRARY_PATH="$globus_location/lib" LD_PRELOAD="$globus_location/lib/libglobus_gssapi_gsi_$globus_flavor.so.0 $globus_location/lib/libssl_$globus_flavor.so.0 $gfarm_prefix/lib/libgfs_hook.so.0 /usr/lib/gfarm/libpthread-not-hidden.so /usr/lib/gfarm/libc-not-hidden.so" daemon smbd $SMBOPTIONS
	RETVAL=$?
	echo
	KIND="NMB"
	echo -n $"Starting $KIND services: "
	daemon nmbd $NMBDOPTIONS
	RETVAL2=$?
	echo
	[ $RETVAL -eq 0 -a $RETVAL2 -eq 0 ] && touch /var/lock/subsys/smb || \
	   RETVAL=1
	return $RETVAL
}	

(*snip*)

5.3 Starting or Restarting Samba

For example, invoke the following command on RedHat Linux.

# /etc/init.d/smb [start|restart] 

6. Access Samba server from Windows Client

Map a network drive to the Samba share. The following sample steps shows how to map

  1. Right-click on "'My Network" icon.
  2. Left-click on "Map Network Drive" menu item.
  3. Input a drive name and shared folder name on the displayed dialog.
gfarm-2.4.1/doc/html/index.html0000644000000000000000000000103011507222722015010 0ustar rootroot Gfarm documentation

Gfarm documentation

Manuals in English

Manuals in Japanese

gfarm-2.4.1/doc/html/Makefile0000644000000000000000000000042011507222722014455 0ustar rootroottop_builddir = ../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk SUBDIRS = \ en/ref en/user \ ja/ref ja/user \ pic htmldir=$(default_htmldir) HTML = index.html include $(top_srcdir)/makes/subdir.mk include $(top_srcdir)/makes/html.mk gfarm-2.4.1/doc/html/pic/0000755000000000000000000000000011507222730013573 5ustar rootrootgfarm-2.4.1/doc/html/pic/gfarm-logo.gif0000644000000000000000000000271611507222722016323 0ustar rootrootGIF89a_9Õ œÌšèèèQ¦MDŸAÁßÀƒ¿€ùùù¹¸¸µÙ³ÚìÚÐÐÐóùó]¬Zv¹tçóæîííÆ§¦¦ÜÜܨӧôóóÄÄľ¾¾­¬¬³²²ÖÖÖÊÊÊâââÎæÍj³g¡  8™4ÿÿÿ!ù ,_9ÿ@pH,Ȥd(‡0à©V¥vËín%VëEa8„«Ðæ¹ñºßp¡ù\<$˜°±FÈq‚FtV{LŠB}Vƒ’‚†iH VR“ŸqO[š ‘ ¯F´´ žn`V¦FÀE¿ÀFÀEÁÈ]s†¸\y~˜DÀÊD¿ÀËåÁ]œ†~Ô[egYÚB æß÷åË âp¡Â. 8,Xɰlˆ_ÄîøP Ÿ¶ €-ØB° AQ’9„ˆO‡ÿ´Ý‚Rȯt[®y¬GA z æreOÿ“-Uú¢Ï¡ põ&Z@ x>ô9hJ–TƒÊåA…uu,dƒcé S\}ÝCëP(Æ1à.ÀW+20MbÀQ˜ÒF"Îèά)O^¤ÝŸ#¨ä=‹W˜;ð!E–‰Û jìqéx‡ ¥#l«·!Ŷ%ClU»†Ø¤sUY,è±Ùo'.Ž“·yNÿzZ$•$ls ä~Þ™rkI»Ó]º¶‘T!²€ü¢­†ãèr~@Hó‚˜VOoÎÁ¸íQ¥T˜$8w…}y¤Kè B7θåÞƒžã0Ÿ!0øÿSIi'!h $ Ñ'åÑ¡¿âÉ~®`Kâ| iìŒ%Dxt¼(úð'„‰l4âNˆóL ØE‡î eU\0gÁÐ"œYxØ9h ËЍ¦…8åpà&“C$À¤œä áfoz6æž|öé矀*è „j衈&ªè¢Œ6ê裒t iñ ¡\®³dÝÀyD“Nª§œ T0 9{G(ɤ¦á¦°nªR„Hœ+“ÅJÄItÀ™˜Å˜z%0¯šÃ–@E(©ª¢A+˜Šå L|' ã«Síc‘¶FuÏø„ ír–ʦÿDµG°õÐ:Ô‘Å ²þâåaÞâí{Àpk-ºÀl¼=ÁÛ³ d‡ï— ÀGD¯aRûoÃÁ,Á®Z¯…žÂÁì+îÃâ,&'q†îÆøØã©¿ƒ`O7¦f›pOÝT$­Ë^:D\â `1ÁÀd‡ëÐH|0€¾¿JEsOâ¼/IÈòVî2̲Q:mÓûçµa6û·’¾äÊ,LÕ³üÏ`ÍV̧j mqÁ‹2OÞ]Ç=ü€Ð+¨ázò= dø¹FÄÀI¡«Ý?npÓš2ùRß L$4Û%x2[,º¬ûôºîÅú `vÓp¦÷KDõëîTɦ{•‰Í ³ZéclÜÀ‹[çÞ–é7—±Bˆ»„[é|zÊ¿sÚÙT"_gä€n3gV-fw_ø=W.xǧ[4àÀGx“Q6g'}Õë-{3Ä¿,þ>gpÚš‰XÅ9Éý r“žÍâr°ªõêZ7¸¼©àjkìšHäªGŸùÎc%:ÑóÔö0 *KiD(aÒ²µÒ* [‹˜Tt…0æYˆmAÚþÄEÎH/t2\ÌÖÞ'®áÕ¦óã¹l6• ^&4Æñ€5„‰lkLB7²wD|0‰‚ÈXJ@¾ ‚ ;gfarm-2.4.1/doc/html/pic/Makefile0000644000000000000000000000037411507222722015240 0ustar rootroot# $Id: Makefile 2373 2006-01-12 00:54:22Z soda $ top_builddir = ../../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk datadir=$(default_htmldir)/pic DATA = $(srcdir)/gfarm-logo.gif include $(top_srcdir)/makes/data.mk gfarm-2.4.1/doc/html/ja/0000755000000000000000000000000011507222730013412 5ustar rootrootgfarm-2.4.1/doc/html/ja/ref/0000755000000000000000000000000011507222730014166 5ustar rootrootgfarm-2.4.1/doc/html/ja/ref/man5/0000755000000000000000000000000011507222730015026 5ustar rootrootgfarm-2.4.1/doc/html/ja/ref/man5/gfarm2.conf.5.html0000644000000000000000000012105411507222721020164 0ustar rootroot gfarm2.conf

gfarm2.conf

Name

gfarm2.conf -- GfarmÀßÄê¥Õ¥¡¥¤¥ë

DESCRIPTION

gfarm2.conf¥Õ¥¡¥¤¥ë¤Ï¡¢gfarm¥×¥í¥°¥é¥à¤ÎÀßÄê¥Õ¥¡¥¤¥ë¤Ç¤¹¡£ ¥µ¡¼¥Ð¡¼¡¦¥×¥í¥»¥¹¤Ç¤¢¤ëgfsd¤Ï¡¢¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢ ¤³¤Î%%SYSCONFDIR%%/gfarm2.conf¤òÀßÄê¥Õ¥¡¥¤¥ë¤È¤·¤Æ»²¾È¤·¤Þ¤¹¡£ ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¡¼¡¦¥×¥í¥»¥¹¤Ç¤¢¤ëgfmd¤Ï¡¢%%SYSCONFDIR%%/gfmd.conf¤ò ÆÉ¤ß¹þ¤ß¤Þ¤¹¡£gfmd.conf¤Î·Á¼°¤Ï¡¢gfarm2.conf¤ÈƱ°ì¤Ç¤¹¡£ ¤Ê¤ª¡¢ÀßÄêÆâÍÆ¤¬ÆÉ¤ß¹þ¤Þ¤ì¤ë¤Î¤Ïµ¯Æ°»þ¤À¤±¤Ê¤Î¤Ç¡¢ ÀßÄêÆâÍÆ¤òÊѹ¹¤·¤¿¾ì¹ç¡¢¥µ¡¼¥Ð¡¼¤òºÆµ¯Æ°¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£

¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥à¤Ï¡¢´Ä¶­ÊÑ¿ôGFARM_CONFIG_FILE¤Ç »ØÄꤷ¤¿¥Õ¥¡¥¤¥ë¤È¡¢%%SYSCONFDIR%%/gfarm2.conf¤ò¡¢ÀßÄê¥Õ¥¡¥¤¥ë ¤È¤·¤Æ»²¾È¤·¤Þ¤¹¡£¤³¤ÎÆó¤Ä¤Î¥Õ¥¡¥¤¥ë¤Ç¤Ï¡¢´Ä¶­ÊÑ¿ôGFARM_CONFIG_FILE¤Ç »ØÄꤷ¤¿¥Õ¥¡¥¤¥ë¤ÎÀßÄê¤ÎÊý¤¬Àè¤ËÆÉ¤ß¹þ¤Þ¤ì¤Þ¤¹¡£ ¤É¤Á¤é¤ÎÀßÄê¥Õ¥¡¥¤¥ë¤â¡¢Æ±°ì¤Îʸˡ¤Çµ­½Ò¤·¤Þ¤¹¡£ Ʊ°ì¤Î»ØÄêʸ¤¬Ê£¿ô¤¢¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢Àè¤Ë»ØÄꤵ¤ì¤Æ¤¤¤¿Êý¤¬Í¥À褵¤ì¤Þ¤¹¡£ ´Ä¶­ÊÑ¿ôGFARM_CONFIG_FILE¤¬ÀßÄꤵ¤ì¤Æ¤Ê¤¤¾ì¹ç¡¢Âå¤ï¤ê¤Ë ¥æ¡¼¥¶¡¼¤Î¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤¢¤ë.gfarm2rc¥Õ¥¡¥¤¥ë¤ò»ÈÍѤ·¤Þ¤¹¡£

gfarm2.conf¤Ï¡¢°ì¹Ô¤Ë°ìʸ¤Î·Á¼°¤ÇÀßÄꤷ¤Þ¤¹¡£ ¤¿¤À¤·¡¢¹ÔËö¤Ëʸ»ú``\''¤òµ­½Ò¤¹¤ë¤³¤È¤Ë¤è¤Ã¤Æ¡¢¹Ô¤ò·Ñ³¤µ¤»¤ë¤³¤È¤¬ ¤Ç¤­¤Þ¤¹¡£¤Þ¤¿¡¢Ê¸»ú``#''¤«¤é¹ÔËö¤Þ¤Ç¤Ï¡¢¥³¥á¥ó¥È¤È¤·¤Æ°·¤ï¤ì¡¢Ìµ»ë ¤µ¤ì¤Þ¤¹¡£

¥Û¥¹¥È»ØÄê

°ú¿ô¤È¤·¤Æ¡¢¥Û¥¹¥È»ØÄê¤òµ­½Ò¤Ç¤­¤ëʸ¤¬¤¤¤¯¤Ä¤«¤¢¤ê¤Þ¤¹¤¬¡¢ ¤³¤Î¾ì¹ç¡¢¥Û¥¹¥È»ØÄê¤Ë¤Ï¡¢²¼µ­¤Î¤¤¤º¤ì¤«¤òµ­½Ò¤Ç¤­¤Þ¤¹¡£

III.JJJ.KKK.LLL

"."¤Ç¶èÀÚ¤é¤ì¤¿0¡Á255¤Þ¤Ç¤Î¿ô»ú4¤Ä¤Ç¡¢IP¥¢¥É¥ì¥¹¤ò»ØÄꤷ¤Þ¤¹¡£

III.JJJ.KKK.LLL/MM

IP¥¢¥É¥ì¥¹¤È¡¢"/"¤Ç¶èÀÚ¤é¤ì¤¿0¡Á31¤Þ¤Ç¤Î¿ô»ú¤Ç¡¢¥Í¥Ã¥È¥ï¡¼¥¯¤ò »ØÄꤷ¤Þ¤¹¡£"/"°Ê¹ß¤Î¿ô»ú¤Ïnetmask¤Î¥Ó¥Ã¥ÈŤǤ¹¡£

domain.name

¥Û¥¹¥È̾¤ò¥É¥á¥¤¥ó̾¤Ç»ØÄꤷ¤Þ¤¹¡£

.domain.name

¥É¥á¥¤¥ó̾¤ÎÀèÆ¬¤¬"."¤Ç¤Ï¤¸¤Þ¤ë¾ì¹ç¡¢¤³¤Î¥É¥á¥¤¥ó̾¤Ë½ê°¤¹¤ëÁ´¤Æ¤Î ¥Û¥¹¥È¤ò°ÕÌ£¤·¤Þ¤¹¡£

*

"*"¤Èµ­½Ò¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢Á´¤Æ¤Î¥Û¥¹¥È¤ò°ÕÌ£¤·¤Þ¤¹¡£

LISTENER

Á´¤ÆÂçʸ»ú¤Ç"LISTENER"¤Èµ­½Ò¤¹¤ë¤È¡¢ÄÌ¿®¤¹¤ëÁê¼ê¤Ë´Ø·¸¤Ê¤¯¡¢ ¥µ¡¼¥Ð¡¼Â¦(Ãå¸ÆÂ¦)¤Î¥½¥±¥Ã¥È¤ò°ÕÌ£¤·¤Þ¤¹¡£

ʸ

ʸ¤Ë¤Ï¡¢²¼µ­¤Î¼ïÎब¤¢¤ê¤Þ¤¹¡£

spool gfsd¥¹¥×¡¼¥ë¡¦¥Ç¥£¥ì¥¯¥È¥ê

gfsd¤¬¡¢gfarm¥Õ¥¡¥¤¥ë¤Î¼ÂÂΤòÊÝ»ý¤¹¤ë¥Ç¥£¥ì¥¯¥È¥ê̾¤ò »ØÄꤷ¤Þ¤¹¡£

Îã:

spool /var/spool/gfarm

spool_server_listen_address IP¥¢¥É¥ì¥¹

gfsd¤¬TCP¤ª¤è¤ÓUDP¤ÎÍ×µá¤ò¼õ¤±ÉÕ¤±¤ëIP¥¢¥É¥ì¥¹¤ò»ØÄꤷ¤Þ¤¹¡£ ¾Êά»þ¤Ï¡¢¤½¤Î¥Û¥¹¥È¤ÎÁ´¤Æ¤ÎIP¥¢¥É¥ì¥¹¤Ç¼õ¤±ÉÕ¤±¤Þ¤¹¡£ ¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢°ì¤Ä¤Î¥Î¡¼¥É¤ÇÊ£¿ô¤Î¥¹¥×¡¼¥ë¤òÄ󶡤¹¤ë¾ì¹ç¤Ë¡¢ ¤½¤ì¤¾¤ì¤Î¥¹¥×¡¼¥ë¤´¤È¤Ë¡¢ÊÌ¡¹¤ÎIP¥¢¥É¥ì¥¹¤ò»È¤Ã¤Ægfsd¤òµ¯Æ°¤¹¤ë ¤¿¤á¤ËÍѤ¤¤Þ¤¹¡£

Îã:

spool_server_listen_address 192.168.121.1

spool_server_cred_type cred_type

GSIǧ¾Ú¤Ë¤ª¤¤¤Æ¡¢gfsd¤¬ÍѤ¤¤ë¾ÚÌÀ½ñ¤Î¼ïÎà¤ò»ØÄꤷ¤Þ¤¹¡£ sharedsecretÍøÍÑ»þ¤Ë¤Ï¡¢¤³¤Î»ØÄê¤Ïñ¤Ë̵»ë¤µ¤ì¤Þ¤¹¡£

¥µ¡¼¥Ð¦¤Ç¤³¤Î»ØÄê¤ò¾Êά¤·¤¿¾ì¹ç¡¢¥µ¡¼¥Ð¤òroot¸¢¸Â¤Çµ¯Æ°¤·¤¿¾ì¹ç¤Ï ¥Û¥¹¥È¾ÚÌÀ½ñ¤òÍѤ¤¤Þ¤¹¡£¤Þ¤¿¥µ¡¼¥Ð¤ò°ìÈ̥桼¥¶¸¢¸Â¤Çµ¯Æ°¤·¤¿¾ì¹ç¤Ï ¥æ¡¼¥¶¾ÚÌÀ½ñ¤òÍѤ¤¤Þ¤¹¡£

¥¯¥é¥¤¥¢¥ó¥È¦¤Ç¤³¤Î»ØÄê¤ò¾Êά¤·¤¿¾ì¹ç¡¢¥µ¡¼¥Ð¤¬¥Û¥¹¥È¾ÚÌÀ½ñ¤òÍøÍѤ·¤Æ¤¤¤ë ¤È²¾Äꤷ¤Æ¥µ¡¼¥Ðǧ¾Ú¤ò¹Ô¤¤¤Þ¤¹¡£¤³¤Î¤¿¤á¥µ¡¼¥Ð¤ò¥¯¥é¥¤¥¢¥ó¥È¤ÈƱ¤¸¥æ¡¼¥¶ ¸¢¸Â¤Çµ¯Æ°¤·¤Æ¤¤¤ë¾ì¹ç¡¢¥¯¥é¥¤¥¢¥ó¥È¦¤Ç¤Ï¡¢²¼µ­¤Î°ì¹Ô¤òÀßÄꤷ¤Æ ¤ª¤¯É¬Íפ¬¤¢¤ê¤Þ¤¹¡£

Îã:

spool_server_cred_type self

»ØÄê²Äǽ¤Êcred_type¤È¤·¤Æ¤Ï¡¢ ¡Öself¡×¡¢ ¡Öhost¡×¡¢¡Öuser¡×¡¢ ¡Ömechanism-specific¡×¤¬¤¢¤ê¡¢ spool_server_cred_service¤ª¤è¤Ó spool_server_cred_name¤ÈÁȤ߹ç¤ï¤»¤Æ ²¼µ­¤Î¤è¤¦¤ËÍѤ¤¤Þ¤¹¡£

self

¤½¤Î¥æ¡¼¥¶¤¬¸½ºß½ê»ý¤·¤Æ¤¤¤ë¥æ¡¼¥¶¾ÚÌÀ½ñ¤òÍѤ¤¤ë¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ ¤³¤Î»ØÄê¤òÍøÍѤ¹¤ëºÝ¤Ë¤Ï¡¢ spool_server_cred_service¤ª¤è¤Ó spool_server_cred_name¤Î »ØÄê¤ò¹Ô¤Ã¤Æ¤Ï¤¤¤±¤Þ¤»¤ó¡£

host

¥Û¥¹¥È¾ÚÌÀ½ñ¤¢¤ë¤¤¤Ï¥µ¡¼¥Ó¥¹¾ÚÌÀ½ñ¤òÍѤ¤¤ë¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ ¥µ¡¼¥Ó¥¹¾ÚÌÀ½ñ¤òÍѤ¤¤ë¾ì¹ç¡¢¤½¤Î¥µ¡¼¥Ó¥¹¤Î̾Á°¤ò spool_server_cred_service¤Ç»ØÄꤷ¤Þ¤¹¡£ ¥µ¡¼¥Ó¥¹Ì¾¤Ë¡Öhost¡×¤ò»ØÄꤷ¤¿¾ì¹ç¡¢ ¥Õ¥¡¥¤¥ë``/etc/grid-security/hostcert.pem''¤Ë ¤¢¤ë¥Û¥¹¥È¾ÚÌÀ½ñ¤òÍѤ¤¤Þ¤¹¡£ ¤½¤ì°Ê³°¤Î¥µ¡¼¥Ó¥¹Ì¾¤ò»ØÄꤷ¤¿¾ì¹ç¡¢ ¥Õ¥¡¥¤¥ë``/etc/grid-security/¥µ¡¼¥Ó¥¹/¥µ¡¼¥Ó¥¹cert.pem'' ¤Ë¤¢¤ë¥µ¡¼¥Ó¥¹¾ÚÌÀ½ñ¤òÍѤ¤¤Þ¤¹¡£ ¥µ¡¼¥Ó¥¹Ì¾¤ò¾Êά¤·¤¿¾ì¹ç¡¢¡Öhost¡×¤¬»ØÄꤵ¤ì¤¿¤È¤ß¤Ê¤·¤Þ¤¹¡£ ¥Û¥¹¥È¾ÚÌÀ½ñ¤ª¤è¤Ó¥µ¡¼¥Ó¥¹¾ÚÌÀ½ñ¤Î¾ì¹ç¡¢¾ÚÌÀ½ñ¤ÎCommon NameÍó¤Î¤ß¤ò Èæ³Ó¤·¤Þ¤¹¡£Common Name¤Ï¡¢¡ÖCN=¥µ¡¼¥Ó¥¹Ì¾/¥Û¥¹¥È̾¡×¤Î·Á¼°¤Ç¤¢¤ëɬÍפ¬ ¤¢¤ê¤Þ¤¹¡£¤Þ¤¿¡¢¥Û¥¹¥È̾¤Ï¡¢gfhost¥³¥Þ¥ó¥É¤Ç»ØÄꤷ¤¿ Àµ¼°Ì¾¤ÈÀµ³Î¤Ë°ìÃפ·¤Æ¤¤¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£¥Û¥¹¥ÈÊÌ̾¤Ïµö¤µ¤ì¤Þ¤»¤ó¡£

¤³¤ì¤Ï¡¢GSSAPI (RFC2743/RFC2744)¤ÎGSS_C_NT_HOSTBASED_SERVICE¤Ë Âбþ¤¹¤ëµ¡Ç½¤Ç¤¹¡£

Îã:

spool_server_cred_type host
spool_server_cred_service host

user

¥æ¡¼¥¶¾ÚÌÀ½ñ¤òÍѤ¤¤ë¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ ¥æ¡¼¥¶¤Î¥¢¥«¥¦¥ó¥È̾¤òspool_server_cred_name¤Ç»ØÄꤷ¤Þ¤¹¡£ ¥¢¥«¥¦¥ó¥È̾¤ò¾Êά¤·¤¿¾ì¹ç¤Ë¤Ï¡¢¤½¤Î¥³¥Þ¥ó¥É¤òµ¯Æ°¤·¤¿¥æ¡¼¥¶Ì¾¤¬»È¤ï¤ì¤Þ¤¹¡£ ¤³¤Î»ØÄê¤òÍøÍѤ¹¤ëºÝ¤Ë¤Ï¡¢spool_server_cred_service¤Î »ØÄê¤ò¹Ô¤Ã¤Æ¤Ï¤¤¤±¤Þ¤»¤ó¡£

¥æ¡¼¥¶Ì¾¤È¾ÚÌÀ½ñ¤ÎDistinguished Name¤ÎÂбþ¤ò¤È¤ë¤¿¤á¡¢ ``/etc/grid-security/grid-mapfile''¤òÍѤ¤¤Þ¤¹¡£ ¤³¤Î¤¿¤á¡¢¤³¤Î¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Ê¤«¤Ã¤¿¤ê¡¢¤¢¤ë¤¤¤Ï¤³¤Î¥Õ¥¡¥¤¥ë¤ËÅÐÏ¿ ¤µ¤ì¤Æ¤Ê¤¤¥æ¡¼¥¶¤Ï¡¢¤³¤Îµ¡Ç½¤òÍѤ¤¤ë¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£

¤³¤ì¤Ï¡¢GSSAPI (RFC2743/RFC2744)¤ÎGSS_C_NT_USER_NAME¤ËÂбþ¤¹¤ëµ¡Ç½¤Ç¤¹¡£

Îã:

spool_server_cred_type user
spool_server_cred_name guest

mechanism-specific

¥µ¡¼¥Ð¤ÎX.509 Distinguished Name¤òspool_server_cred_name¤Ç ľÀÜ»ØÄꤷ¤Þ¤¹¡£ ¤³¤Î»ØÄê¤òÍøÍѤ¹¤ëºÝ¤Ë¤Ï¡¢spool_server_cred_service¤Î »ØÄê¤ò¹Ô¤Ã¤Æ¤Ï¤¤¤±¤Þ¤»¤ó¡£

¤³¤ì¤Ï¡¢GSSAPI (RFC2743/RFC2744)¤ÇName Type¤È¤·¤ÆGSS_C_NO_OID¤ò »ØÄꤷ¤¿¾ì¹ç¤ËÂбþ¤¹¤ëµ¡Ç½¤Ç¤¹¡£

Îã:

spool_server_cred_type mechanism-specific
spool_server_cred_name "/O=Grid/O=Globus/OU=example.com/CN=John Smith"

spool_server_cred_service cred_service

GSIǧ¾Ú¤Ë¤ª¤¤¤Æ¡¢spool_server_cred_type¤È¤·¤Æ ¡Öhost¡×¤ò»ØÄꤷ¤Æ¤¤¤ë¾ì¹ç¤Ë¡¢gfsd¤¬ÍѤ¤¤ë¥µ¡¼¥Ó¥¹¾ÚÌÀ½ñ¤Î ¼ïÎà¤ò»ØÄꤷ¤Þ¤¹¡£ sharedsecretÍøÍÑ»þ¤Ë¤Ï¡¢¤³¤Î»ØÄê¤Ïñ¤Ë̵»ë¤µ¤ì¤Þ¤¹¡£ ¾Ü¤·¤¯¤Ïspool_server_cred_type¤Î¹à¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£

spool_server_cred_name cred_name

GSIǧ¾Ú¤Ë¤ª¤¤¤Æ¡¢spool_server_cred_type¤Ç»ØÄꤷ¤¿ÃÍ¤Ë ±þ¤¸¤Æ¡¢gfsd¤¬ÍѤ¤¤ë¾ÚÌÀ½ñ¤ÎÀßÄê¤ò¹Ô¤¤¤Þ¤¹¡£ sharedsecretÍøÍÑ»þ¤Ë¤Ï¡¢¤³¤Î»ØÄê¤Ïñ¤Ë̵»ë¤µ¤ì¤Þ¤¹¡£ ¾Ü¤·¤¯¤Ïspool_server_cred_type¤Î¹à¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£

metadb_server_host gfmd¥Û¥¹¥È̾

gfmd¤¬Æ°ºî¤·¤Æ¤¤¤ë¥Û¥¹¥È̾¤ò»ØÄꤷ¤Þ¤¹¡£

¤³¤ÎÀßÄê¤Ïɬ¿Ü¤Ç¤¹¡£

Îã:

metadb_server_host ldap.example.com

metadb_server_port gfmd¥Ý¡¼¥ÈÈÖ¹æ

gfmd¤¬ÍøÍѤ¹¤ëTCP¥Ý¡¼¥È¤ÎÈÖ¹æ¤ò»ØÄꤷ¤Þ¤¹¡£ ¾Êά»þ¤Î¥Ç¥Õ¥©¥ë¥È¡¦¥Ý¡¼¥ÈÈÖ¹æ¤Ï601È֤Ǥ¹¡£

Îã:

metadb_server_port 601

metadb_server_cred_type cred_type

GSIǧ¾Ú¤Ë¤ª¤¤¤Æ¡¢gfmd¤¬ÍѤ¤¤ë¾ÚÌÀ½ñ¤Î¼ïÎà¤ò»ØÄꤷ¤Þ¤¹¡£ sharedsecretÍøÍÑ»þ¤Ë¤Ï¡¢¤³¤Î»ØÄê¤Ïñ¤Ë̵»ë¤µ¤ì¤Þ¤¹¡£ ÀßÄê¤Î°ÕÌ£¤Ë¤Ä¤¤¤Æ¤Ïspool_server_cred_type¤Î¹à¤ò »²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£

metadb_server_cred_service cred_service

GSIǧ¾Ú¤Ë¤ª¤¤¤Æ¡¢metadb_server_cred_type¤È¤·¤Æ ¡Öhost¡×¤ò»ØÄꤷ¤Æ¤¤¤ë¾ì¹ç¤Ë¡¢gfmd¤¬ÍѤ¤¤ë¥µ¡¼¥Ó¥¹¾ÚÌÀ½ñ¤Î ¼ïÎà¤ò»ØÄꤷ¤Þ¤¹¡£ sharedsecretÍøÍÑ»þ¤Ë¤Ï¡¢¤³¤Î»ØÄê¤Ïñ¤Ë̵»ë¤µ¤ì¤Þ¤¹¡£ ÀßÄê¤Î°ÕÌ£¤Ë¤Ä¤¤¤Æ¤Ïspool_server_cred_type¤Î¹à¤ò »²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£

metadb_server_cred_name cred_name

GSIǧ¾Ú¤Ë¤ª¤¤¤Æ¡¢metadb_server_cred_type¤Ç»ØÄꤷ¤¿ÃÍ¤Ë ±þ¤¸¤Æ¡¢gfmd¤¬ÍѤ¤¤ë¾ÚÌÀ½ñ¤ÎÀßÄê¤ò¹Ô¤¤¤Þ¤¹¡£ sharedsecretÍøÍÑ»þ¤Ë¤Ï¡¢¤³¤Î»ØÄê¤Ïñ¤Ë̵»ë¤µ¤ì¤Þ¤¹¡£ ÀßÄê¤Î°ÕÌ£¤Ë¤Ä¤¤¤Æ¤Ïspool_server_cred_type¤Î¹à¤ò »²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£

metadb_server_stack_size ¥Ð¥¤¥È¿ô

¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥ÐgfmdÆâ¤Î³Æ¥¹¥ì¥Ã¥É¤¬ÍøÍѤ¹¤ë¥¹¥¿¥Ã¥¯¤Î¥µ¥¤¥º¤ò »ØÄꤷ¤Þ¤¹¡£¾Êά¤µ¤ì¤¿¾ì¹çOS¤Î¥Ç¥Õ¥©¥ë¥ÈÃͤ¬»È¤ï¤ì¤Þ¤¹¡£ ¤³¤Î¥Ñ¥é¥á¡¼¥¿¤Ï¡¢gfmd¤Î¾ÃÈñ¤¹¤ë²¾ÁÛ¥á¥â¥ê¶õ´Ö¤Î¥µ¥¤¥º¤òÀáÌ󤹤뤿¤á¤Ë ÍѤ¤¤Þ¤¹¡£

¤¿¤È¤¨¤Ð¡¢CentOS 5/i386¤Î¾ì¹ç¡¢¥Ç¥Õ¥©¥ë¥È¤Î¥¹¥¿¥Ã¥¯¥µ¥¤¥º¤Ï10MB¤Ç¤¹ ¤Î¤Ç¡¢¤³¤Î¥Ñ¥é¥á¡¼¥¿¤Ç¥¹¥¿¥Ã¥¯¥µ¥¤¥º¤ò256KB¤ËÍÞ¤¨¤ë¤È¡¢gfmd¤Î¥¹¥¿¥Ã¥¯ ¤¬¾ÃÈñ¤¹¤ë²¾ÁÛ¥á¥â¥ê¶õ´Ö¤Î¥µ¥¤¥º¤ò¡¢1/40¤Ë¸º¤é¤¹¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£

¤³¤Îʸ¤Ïgfmd.conf¤Î¤ß¤ÇÍ­¸ú¤Ç¤¢¤ê¡¢gfarm2.conf¤Ç¤Ï̵»ë¤µ¤ì¤Þ¤¹¡£

Îã:

metadb_server_stack_size 262144

metadb_server_thread_pool_size ¥¹¥ì¥Ã¥É¿ô

¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ðgfmd¤Î¥¹¥ì¥Ã¥É¥×¡¼¥ë¤Î¥¹¥ì¥Ã¥É¿ô¤ò»ØÄꤷ¤Þ¤¹¡£ ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¥Î¡¼¥É¤Î¥³¥¢¿ô¤¯¤é¤¤¤ËÀßÄꤹ¤ë¤È¸ú²ÌŪ¤Ç¤¹¡£ ¥Ç¥Õ¥©¥ë¥ÈÃͤÏ16¤Ç¤¹¡£

¤³¤Îʸ¤Ïgfmd.conf¤Î¤ß¤ÇÍ­¸ú¤Ç¤¢¤ê¡¢gfarm2.conf¤Ç¤Ï̵»ë¤µ¤ì¤Þ¤¹¡£

Îã:

metadb_server_thread_pool_size 16

metadb_server_job_queue_length ¥­¥å¡¼Ä¹

¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ðgfmd¤Î¥¸¥ç¥Ö¥­¥å¡¼¤Î¥­¥å¡¼Ä¹¤ò»ØÄꤷ¤Þ¤¹¡£ °ìÅÙ¤ËÀܳ¤¹¤ëºÇÂ祯¥é¥¤¥¢¥ó¥È¤Î¿ô¤¯¤é¤¤¤ËÀßÄꤹ¤ë¤È¸ú²ÌŪ¤Ç¤¹¡£ ¥Ç¥Õ¥©¥ë¥ÈÃͤÏ16000¤Ç¤¹¡£

¤³¤Îʸ¤Ïgfmd.conf¤Î¤ß¤ÇÍ­¸ú¤Ç¤¢¤ê¡¢gfarm2.conf¤Ç¤Ï̵»ë¤µ¤ì¤Þ¤¹¡£

Îã:

metadb_server_job_queue_length 160

metadb_server_heartbeat_interval Éÿô

¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ðgfmd¤¬³Æ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥µ¡¼¥Ðgfsd ¤ËÂФ·Æ°ºî³Îǧ¤ò¹Ô¤¦¥Ï¡¼¥È¥Ó¡¼¥È¤Î´Ö³Ö¤òÉÿô¤Ç»ØÄꤷ¤Þ¤¹¡£ ¥Ç¥Õ¥©¥ë¥ÈÃͤÏ180ÉäǤ¹¡£

Gfarm-2.3.0¤Þ¤Ç¤Ï¤³¤Îʸ¤Ïgfmd.conf¤Î¤ß¤ÇÍ­¸ú¤Ç¤¢¤ê¡¢gfarm2.conf¤Ç¤Ï ̵»ë¤µ¤ì¤Æ¤¤¤Þ¤·¤¿¤¬¡¢Gfarm-2.4.0°Ê¹ß¤Ïgfsd¤â¤³¤Î¥Ñ¥é¥á¡¼¥¿¤òÍøÍѤ· gfmdÄä»ß¤ò¸¡ÃΤ¹¤ë¤¿¤á¡¢ gfarm2.conf¤Ègfmd.conf¤ÎξÊý¤Ç»ØÄꤹ¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£

Îã:

metadb_server_heartbeat_interval 180

metadb_server_dbq_size ¥­¥å¡¼Ä¹

¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ðgfmd¤Ç¤Ï¥á¥¿¥Ç¡¼¥¿¤ÎÊѹ¹¤ò¥Ð¥Ã¥¯¥¨¥ó¥ÉDB¤Ë È󯱴üŪ¤ËÈ¿±Ç¤·¤Þ¤¹¤¬¡¤¤½¤Î¥­¥å¡¼¤ÎŤµ¤ò»ØÄꤷ¤Þ¤¹¡£ ¥­¥å¡¼Ä¹¤òŤ¯¤¹¤ë¤È¡¤¥Ð¥Ã¥¯¥¨¥ó¥ÉDB¤Î¹¹¿·Â®ÅÙ¤ËΧ®¤µ¤ì¤Ë¤¯¤¯¤Ê¤ê¤Þ¤¹¡£ ¥Ç¥Õ¥©¥ë¥ÈÃͤÏ65536¤Ç¤¹¡£

¤³¤Îʸ¤Ïgfmd.conf¤Î¤ß¤ÇÍ­¸ú¤Ç¤¢¤ê¡¢gfarm2.conf¤Ç¤Ï̵»ë¤µ¤ì¤Þ¤¹¡£

Îã:

metadb_server_dbq_size 65536

ldap_server_host LDAP¥µ¡¼¥Ð¡¼¡¦¥Û¥¹¥È̾

gfmd¤Î¥Ð¥Ã¥¯¥¨¥ó¥É¡¦¥Ç¡¼¥¿¥Ù¡¼¥¹¤È¤·¤Æ LDAP¥µ¡¼¥Ð¤òÁªÂò¤¹¤ë¾ì¹ç¡¢ LDAP¥µ¡¼¥Ð¡¼¤¬Æ°ºî¤·¤Æ¤¤¤ë¥Û¥¹¥È̾¤ò»ØÄꤷ¤Þ¤¹¡£ ¤³¤Îʸ¤Ïgfmd.conf¤ÇÍѤ¤¤é¤ì¡¢gfarm2.conf¤Ç¤ÏÍѤ¤¤é¤ì¤Þ¤»¤ó¡£

Îã:

ldap_server_host ldap.example.com

ldap_server_port LDAP¥µ¡¼¥Ð¡¼¡¦¥Ý¡¼¥ÈÈÖ¹æ

LDAP¥µ¡¼¥Ð¡¼¤¬ÍøÍѤ¹¤ëTCP¥Ý¡¼¥È¤ÎÈÖ¹æ¤ò»ØÄꤷ¤Þ¤¹¡£

ldap_server_host¤ò»ØÄꤹ¤ë¾ì¹ç¤Ë¤Ï¡¢ ¤³¤ÎÀßÄê¤Ïɬ¿Ü¤Ç¤¹¡£

Îã:

ldap_server_port 602

ldap_base_dn LDAP_base_distinguished_name

LDAP¥Ç¡¼¥¿¥Ù¡¼¥¹¤ÇÊÝ»ý¤¹¤ë¥Ç¡¼¥¿¤Î¥­¡¼¤Îº¬¤È¤Ê¤ë¥Î¡¼¥É¤Î ̾¾Î¡¢base distinguished name¤ò»ØÄꤷ¤Þ¤¹¡£

ldap_server_host¤ò»ØÄꤹ¤ë¾ì¹ç¤Ë¤Ï¡¢ ¤³¤ÎÀßÄê¤Ïɬ¿Ü¤Ç¤¹¡£

Îã:

ldap_base_dn "dc=example, dc=com"

ldap_bind_dn LDAP_bind_distinguished_name

LDAP¥Ç¡¼¥¿¥Ù¡¼¥¹¤ËÀܳ¤¹¤ëºÝ¤Îǧ¾Ú¤ËÍѤ¤¤ë̾¾Î¤ò¡¢distinguished name¤Ç»ØÄꤷ¤Þ¤¹¡£

Îã:

ldap_bind_dn "cn=gfarmuser, dc=example, dc=com"

ldap_bind_password password

LDAP¥Ç¡¼¥¿¥Ù¡¼¥¹¤ËÀܳ¤¹¤ëºÝ¤Îǧ¾Ú¥Ñ¥¹¥ï¡¼¥É¤ò»ØÄꤷ¤Þ¤¹¡£

Îã:

ldap_bind_password "secret-ldap-password"

postgresql_server_host PostgreSQL¥µ¡¼¥Ð¡¼¡¦¥Û¥¹¥È̾

gfmd¤Î¥Ð¥Ã¥¯¥¨¥ó¥É¡¦¥Ç¡¼¥¿¥Ù¡¼¥¹¤È¤·¤Æ PostgreSQL¥µ¡¼¥Ð¤òÁªÂò¤¹¤ë¾ì¹ç¡¢ PostgreSQL¥µ¡¼¥Ð¡¼¤¬Æ°ºî¤·¤Æ¤¤¤ë¥Û¥¹¥È̾¤ò»ØÄꤷ¤Þ¤¹¡£ ¤³¤Îʸ¤Ïgfmd.conf¤ÇÍѤ¤¤é¤ì¡¢gfarm2.conf¤Ç¤ÏÍѤ¤¤é¤ì¤Þ¤»¤ó¡£

Îã:

postgresql_server_host postgresql.example.com

postgresql_server_port PostgreSQL¥µ¡¼¥Ð¡¼¡¦¥Ý¡¼¥ÈÈÖ¹æ

PostgreSQL¥µ¡¼¥Ð¡¼¤¬ÍøÍѤ¹¤ëTCP¥Ý¡¼¥È¤ÎÈÖ¹æ¤ò»ØÄꤷ¤Þ¤¹¡£

postgresql_server_host¤ò»ØÄꤹ¤ë¾ì¹ç¤Ë¤Ï¡¢ ¤³¤ÎÀßÄê¤Ïɬ¿Ü¤Ç¤¹¡£

Îã:

postgresql_server_port 602

postgresql_dbname dbname

PostgreSQL¥Ç¡¼¥¿¥Ù¡¼¥¹Ì¾¤ò»ØÄꤷ¤Þ¤¹¡£

postgresql_server_host¤ò»ØÄꤹ¤ë¾ì¹ç¤Ë¤Ï¡¢ ¤³¤ÎÀßÄê¤Ïɬ¿Ü¤Ç¤¹¡£

Îã:

postgresql_dbname gfarm

postgresql_user user

PostgreSQL¥Ç¡¼¥¿¥Ù¡¼¥¹¤ËÀܳ¤¹¤ë¥Ç¡¼¥¿¥Ù¡¼¥¹´ÉÍý²¼¤Î¥æ¡¼¥¶Ì¾¤ò»ØÄꤷ¤Þ¤¹¡£

Îã:

postgresql_user gfarm

postgresql_password password

PostgreSQL¥Ç¡¼¥¿¥Ù¡¼¥¹¤ËÀܳ¤¹¤ë¥Ç¡¼¥¿¥Ù¡¼¥¹´ÉÍý²¼¤Î¥æ¡¼¥¶¤Î¥Ñ¥¹¥ï¡¼¥É¤ò»ØÄꤷ¤Þ¤¹¡£

Îã:

postgresql_password "secret-postgresql-password"

postgresql_conninfo connection_info

PostgreSQL¥Ç¡¼¥¿¥Ù¡¼¥¹¤ËÀܳ¤¹¤ë¤È¤­¤ÎÀܳ¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Þ¤¹¡£

Îã:

postgresql_conninfo "sslmode=require connect_timeout=30"

auth Í­¸úÀ­  ǧ¾ÚÊýË¡  ¥Û¥¹¥È»ØÄê

¤³¤Îʸ¤Ï¡¢Âè3°ú¿ô¤Ç»ØÄꤷ¤¿¥Û¥¹¥È¤È¤ÎÄÌ¿®¤ËÍѤ¤¤ëǧ¾ÚÊýË¡¤òÀßÄꤷ¤Þ¤¹¡£

Âè1°ú¿ô¤ÎÍ­¸úÀ­Éô¤Ë¤Ï¡¢enable¤Ê¤¤¤·disable ¥­¡¼¥ï¡¼¥É¤ò»ØÄꤷ¤Þ¤¹¡£ Âè2°ú¿ô¤Îǧ¾ÚÊýË¡Éô¤Ë¤Ï¡¢gsi¡¢ gsi_auth¤Ê¤¤¤·sharedsecret ¥­¡¼¥ï¡¼¥É¤ò»ØÄꤷ¤Þ¤¹¡£ Âè3°ú¿ô¤Ë¤Ï¡¢¥Û¥¹¥È»ØÄê¤òµ­½Ò¤·¤Þ¤¹¡£

¤³¤Îʸ¤ÏÊ£¿ô»ØÄê²Äǽ¤Ç¤¹¡£³ÆÇ§¾ÚÊýË¡¤´¤È¤Ë¡¢ÀèÆ¬¤«¤é½ç¤Ë¥Û¥¹¥È»ØÄê¤Ë Ŭ¹ç¤¹¤ë¤«¤É¤¦¤«Ä´¤Ù¡¢Í­¸ú¤Ç¤¢¤ë¤È¤Î»ØÄê¤ËŬ¹ç¤·¤¿¾ì¹ç¡¢¤½¤Îǧ¾ÚÊýË¡¤¬ ÍøÍѸõÊä¤Ë¤Ê¤ê¤Þ¤¹¡£Í­¸ú¤Ç¤¢¤ë¤È¤Î»ØÄê¤ËŬ¹ç¤·¤Ê¤¤¾ì¹ç¤ä¡¢¤¢¤ë¤¤¤Ï Í­¸ú¤Ç¤¢¤ë¤È¤Î»ØÄê¤ËŬ¹ç¤¹¤ë¤è¤ê¤âÁ°¤Ë̵¸ú¤Ç¤¢¤ë¤È¤Î»ØÄê¤ËŬ¹ç¤·¤¿ ¾ì¹ç¡¢¤½¤Îǧ¾ÚÊýË¡¤Ï¡¢¸õÊä¤Ë¤Ê¤ê¤Þ¤»¤ó¡£

¤³¤Î»ØÄê¤Ï¡¢¥µ¡¼¥Ð¡¼Â¦¤È¥¯¥é¥¤¥¢¥ó¥È¦¤ÎξÊý¤Ç²ò¼á¤µ¤ì¡¢ ÁÐÊý¤È¤â¤ÇÍ­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ëǧ¾ÚÊýË¡¤Î¤ß¤¬ÍѤ¤¤é¤ì¤Þ¤¹¡£

ǧ¾ÚÊýË¡¤¬°Û¤Ê¤ë¤â¤Î¤Ë´Ø¤·¤Æ¤Ï¡¢»ØÄê¤Î½ç½ø¤Ï°ÕÌ£¤¬¤¢¤ê¤Þ¤»¤ó¡£ Ê£¿ô¤Îǧ¾ÚÊýË¡¤¬¸õÊä¤È¤Ê¤Ã¤¿¾ì¹ç¡¢sharedsecret¡¢ gsi_auth¡¢gsiǧ¾Ú¤Î½ç½ø¤Ç»î¤ß¤Þ¤¹¡£

Gfarm¤Î¥³¥ó¥Ñ¥¤¥ë»þ¤Ëglobus¤È¤Î¥ê¥ó¥¯¤ò»ØÄꤷ¤Ê¤«¤Ã¤¿¾ì¹ç¡¢ GSI¤ÏÍøÍѤǤ­¤Þ¤»¤ó¡£¤³¤Î¾ì¹ç¡¢gsi¤ª¤è¤Ó gsi_authǧ¾Ú¤Î»ØÄê¤Ïñ¤Ë̵»ë¤µ¤ì¤Þ¤¹¡£

¤³¤ÎÀßÄê¤Ïɬ¿Ü¤Ç¤¹¡£

Îã:

auth disable sharedsecret 192.168.0.100
auth disable sharedsecret 192.168.0.101
auth enable sharedsecret 192.168.0.0/24
auth enable gsi_auth 10.0.0.0/8
auth enable gsi *

¤³¤ÎÎã¤Ç¤Ï¡¢¥Û¥¹¥È192.168.0.100¤È192.168.0.101¤Î2¤Ä¤Î¥Û¥¹¥È¤ò ½ü¤¤¤¿192.168.0.0/24¥Í¥Ã¥È¥ï¡¼¥¯¤Ë°¤¹¥Û¥¹¥È¤Ë¤Ï sharedsecret¤Ègsi¤ÎξÊý¤ò¡¢ 10.0.0.0/8¥Í¥Ã¥È¥ï¡¼¥¯¤Ë°¤¹¥Û¥¹¥È¤Ë¤Ïgsi_auth¤ª¤è¤Ó gsi¤ÎξÊý¤ò¡¢ ¤½¤ì°Ê³°¤ÎÁ´¤Æ¤Î¥Û¥¹¥È¤Ë¤Ïgsiǧ¾Ú¤Î¤ß¤ò»î¤ß¤Þ¤¹¡£ ¤¹¤Ê¤ï¤Á¡¢¥Û¥¹¥È192.168.0.100¤È192.168.0.101¤Î2¤Ä¤Î¥Û¥¹¥È¤Ï¡¢ gsiǧ¾Ú¤Î¤ß¤ò»î¤ß¤ë¤³¤È¤Ë¤Ê¤ê¤Þ¤¹¡£

sockopt ¥ª¥×¥·¥ç¥ó[=ÃÍ] [LISTENER | ¥Û¥¹¥È»ØÄê]

ÄÌ¿®socket(2)¤ËÂФ·¤Æ¡¢setsockopt(2)¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò»È¤Ã¤Æ ¥½¥±¥Ã¥È¡¦¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Þ¤¹¡£

Âè2°ú¿ô¤ËÁ´¤ÆÂçʸ»ú¤ÇLISTENER¤ò»ØÄꤷ¤¿¾ì¹ç¡¢ ¥µ¡¼¥Ð¡¼Â¦(Ãå¸ÆÂ¦)¤Î¥½¥±¥Ã¥È¤Ë»ØÄꤹ¤ë¥ª¥×¥·¥ç¥ó¤Ë¤Ê¤ê¤Þ¤¹¡£ ¤³¤Î¾ì¹ç¡¢ÄÌ¿®¤¹¤ëÁê¼ê¤Ë´Ø·¸¤Ê¤¯¡¢ °ìΧ¤Ë¥½¥±¥Ã¥È¡¦¥ª¥×¥·¥ç¥ó¤¬ÀßÄꤵ¤ì¤Þ¤¹¡£

Âè2°ú¿ô¤Ë¥Û¥¹¥È»ØÄê¤òµ­½Ò¤·¤¿¾ì¹ç¡¢¥¯¥é¥¤¥¢¥ó¥È¦(ȯ¸ÆÂ¦)¤Î ¥½¥±¥Ã¥È¤Ë»ØÄꤹ¤ë¥ª¥×¥·¥ç¥ó¤Ë¤Ê¤ê¤Þ¤¹¡£¤³¤Î¾ì¹ç¡¢ÄÌ¿®¤¹¤ëÁê¼êËè¤Ë ¥½¥±¥Ã¥È¡¦¥ª¥×¥·¥ç¥ó¤òÊѤ¨¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ ¤Ê¤ª¡¢Âè2°ú¿ô¤Ë"*"¤Èµ­½Ò¤¹¤ë¤È¡¢¥¯¥é¥¤¥¢¥ó¥È¦(ȯ¸ÆÂ¦)¤ÎÁ´¤Æ¤Î ¥Û¥¹¥È¤ò°ÕÌ£¤¹¤ë¤³¤È¤Ë¤Ê¤ê¡¢¥µ¡¼¥Ð¡¼Â¦(Ãå¸ÆÂ¦)¤Ë¤ÏŬÍѤµ¤ì¤Þ¤»¤ó¡£

Âè2°ú¿ô¤ò¾Êά¤·¤¿¾ì¹ç¡¢¥µ¡¼¥Ð¡¼Â¦¤È¥¯¥é¥¤¥¢¥ó¥È¦¤ÎξÊý¤Ç¡¢ Á´¤Æ¤ÎÄÌ¿®Áê¼ê¤ËÂФ·¤ÆÆ±¤¸¥½¥±¥Ã¥È¡¦¥ª¥×¥·¥ç¥ó¤òÀßÄꤷ¤Þ¤¹¡£

»ØÄê²Äǽ¤Ê¥½¥±¥Ã¥È¡¦¥ª¥×¥·¥ç¥ó¤Ë¤Ï¼¡¤Î¤â¤Î¤¬¤¢¤ê¤Þ¤¹¡£

debug¡£setsockopt(2)¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ç¡¢SO_DEBUG¥½¥±¥Ã¥È¡¦¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Þ¤¹¡£Ãͤòµ­½Ò¤¹¤ëɬÍפϤ¢¤ê¤Þ¤»¤ó¡£

keepalive¡£setsockopt(2)¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ç¡¢SO_KEEPALIVE ¥½¥±¥Ã¥È¡¦¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Þ¤¹¡£Ãͤòµ­½Ò¤¹¤ëɬÍפϤ¢¤ê¤Þ¤»¤ó¡£

sndbuf¡£setsockopt(2)¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ç¡¢SO_SNDBUF ¥½¥±¥Ã¥È¡¦¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Þ¤¹¡£ÃͤλØÄ꤬ɬÍפǤ¹¡£

rcvbuf¡£setsockopt(2)¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ç¡¢SO_RCVBUF ¥½¥±¥Ã¥È¡¦¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Þ¤¹¡£ÃͤλØÄ꤬ɬÍפǤ¹¡£

tcp_nodelay¡£setsockopt(2)¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ç¡¢TCP_NODELAY ¥½¥±¥Ã¥È¡¦¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Þ¤¹¡£Ãͤòµ­½Ò¤¹¤ëɬÍפϤ¢¤ê¤Þ¤»¤ó¡£

Îã:

sockopt tcp_nodelay 192.168.0.0/24
sockopt sndbuf=1048576 10.0.0.0/8
sockopt sndbuf=1048576 LISTENER
sockopt rcvbuf=1048576 10.0.0.0/8
sockopt rcvbuf=1048576 LISTENER

known_network ¥Û¥¹¥È»ØÄê

¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Î¥Í¥Ã¥È¥ï¡¼¥¯¤ò»ØÄꤷ¤Þ¤¹¡£ Ëܥͥåȥ¥¯¤Ï¡¢ ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥ÉÁªÂò»þ¤Î¥°¥ë¡¼¥Ô¥ó¥°¤ËÍøÍѤµ¤ì¤Þ¤¹¡£ ¤³¤Îʸ¤Ç»ØÄꤷ¤¿¥¢¥É¥ì¥¹¤ËŬ¹ç¤·¤Ê¤¤IP¥¢¥É¥ì¥¹¤Î¾ì¹ç¡¢ IPv4¤Î¥¯¥é¥¹C¥Í¥Ã¥È¥ï¡¼¥¯¤¬²¾Äꤵ¤ì¤Þ¤¹¡£

Îã:

known_network 192.168.0.0/24

admin_user ¥æ¡¼¥¶Ì¾

gfmd.confÆâ¤Î¤³¤Îʸ¤Ç»ØÄꤵ¤ì¤¿¥æ¡¼¥¶¤¬¡¢ ¥Ç¥Õ¥©¥ë¥È¤ÎÆÃ¸¢¥æ¡¼¥¶¤È¤Ê¤ê¤Þ¤¹¡£

admin_user_gsi_dn DN

gfmd.confÆâ¤Îadmin_userʸ¤Ç»ØÄꤵ¤ì¤¿ÆÃ¸¢¥æ¡¼¥¶¤ÎSubject DN¤ò»ØÄꤷ¤Þ¤¹¡£

local_user_map ¥æ¡¼¥¶¥Þ¥Ã¥×¥Õ¥¡¥¤¥ë¥Ñ¥¹Ì¾

sharedsecretǧ¾Ú¤Ë¤ª¤¤¤Æ¡¢ ¥°¥í¡¼¥Ð¥ë¥æ¡¼¥¶Ì¾¤È¥í¡¼¥«¥ë¥æ¡¼¥¶Ì¾¤ÎÂбþ´Ø·¸¤òµ­½Ò¤·¤¿ ¥æ¡¼¥¶¥Þ¥Ã¥×¥Õ¥¡¥¤¥ë¥Ñ¥¹Ì¾¤ò»ØÄꤷ¤Þ¤¹¡£ ¤³¤ÎÀßÄê¤Ïɬ¿Ü¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¤¬¡¢ ¤½¤Î¾ì¹ç¥í¡¼¥«¥ë¥æ¡¼¥¶Ì¾¤¬¥°¥í¡¼¥Ð¥ë¥æ¡¼¥¶Ì¾¤ËÊÑ´¹¤µ¤ì¤Þ¤¹¡£

Ʊ°ì¥æ¡¼¥¶¡¼¤ËÂФ·¤Æ¡¢ °Û¤Ê¤ë¥í¡¼¥«¥ë¥¢¥«¥¦¥ó¥È̾¤òÍ¿¤¨¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤¬¤¢¤ë¾ì¹ç¤ä¡¢ ¥í¡¼¥«¥ë¥æ¡¼¥¶Ì¾¤È¤Ï°Û¤Ê¤ë¥°¥í¡¼¥Ð¥ë¥æ¡¼¥¶Ì¾¤òÍøÍѤ·¤¿¤¤¾ì¹ç¡¢ ¤³¤Î¥Õ¥¡¥¤¥ë¤Ç¡¢³Æ¥Î¡¼¥É¤Î¥í¡¼¥«¥ë¤Ê¥æ¡¼¥¶Ì¾¤ËÂФ·¤Æ¡¢Ã±°ì¤Î ¥°¥í¡¼¥Ð¥ë¥æ¡¼¥¶Ì¾¤òÄêµÁ¤·¤Þ¤¹¡£

Îã:

local_user_map /etc/gfarm/gfarm-usermap

¥æ¡¼¥¶¡¼¥Þ¥Ã¥×¥Õ¥¡¥¤¥ë¤Ï¡¢¥°¥í¡¼¥Ð¥ë¥æ¡¼¥¶¡¼Ì¾¤È ¥í¡¼¥«¥ë¥æ¡¼¥¶¡¼Ì¾¤ò¡¢¶õÇò¤Ç¶èÀڤäƳƹԤ˵­½Ò¤·¤Þ¤¹¡£

¥æ¡¼¥¶¥Þ¥Ã¥×¥Õ¥¡¥¤¥ë¤ÎÆâÍÆÎã:

foobar foo
quux baz

¤³¤ÎÎã¤Î1¹ÔÌܤλØÄê¤Ç¤Ï¡¢¤³¤Î¥Î¡¼¥É¤Î¥í¡¼¥«¥ë¥æ¡¼¥¶Ì¾foo¤Ë ÂФ·¤Æ¥°¥í¡¼¥Ð¥ë¥æ¡¼¥¶Ì¾foobar¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£

local_group_map ¥°¥ë¡¼¥×¥Þ¥Ã¥×¥Õ¥¡¥¤¥ë¥Ñ¥¹Ì¾

¥°¥í¡¼¥Ð¥ë¥°¥ë¡¼¥×̾¤È¥í¡¼¥«¥ë¥°¥ë¡¼¥×̾¤ÎÂбþ´Ø·¸¤òµ­½Ò¤·¤¿ ¥°¥ë¡¼¥×¥Þ¥Ã¥×¥Õ¥¡¥¤¥ë¥Ñ¥¹Ì¾¤ò»ØÄꤷ¤Þ¤¹¡£ ¤³¤Î¥Þ¥Ã¥×¥Õ¥¡¥¤¥ë¤Ï¡¤¥í¡¼¥«¥ë¥·¥¹¥Æ¥à¤Î¥°¥ë¡¼¥×ID¤òÍøÍѤ¹¤ëgfarm2fs¤ä Globus GridFTP¤ÎGfarm DSI¤Ê¤É¤ÇÍøÍѤµ¤ì¤Þ¤¹¡£ ¤³¤ÎÀßÄê¤Ïɬ¿Ü¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¤¬¡¢ ¤½¤Î¾ì¹ç¥í¡¼¥«¥ë¥°¥ë¡¼¥×̾¤Ï¥°¥í¡¼¥Ð¥ë¥°¥ë¡¼¥×̾¤ÈÅù¤·¤¤¤È²¾Äꤵ¤ì¤Þ¤¹¡£

Îã:

local_group_map /etc/gfarm/gfarm-groupmap

¥°¥ë¡¼¥×¥Þ¥Ã¥×¥Õ¥¡¥¤¥ë¤Ï¡¢¥°¥í¡¼¥Ð¥ë¥°¥ë¡¼¥×̾¤È ¥í¡¼¥«¥ë¥°¥ë¡¼¥×̾¤ò¡¢¶õÇò¤Ç¶èÀڤäƳƹԤ˵­½Ò¤·¤Þ¤¹¡£

schedule_cache_timeout Éÿô

gfarm¥é¥¤¥Ö¥é¥ê¤¬ÆâÉôŪ¤ËÊÝ»ý¤·¤Æ¤¤¤ë¡¢¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É ¤Î¥¹¥±¥¸¥å¡¼¥ê¥ó¥°½èÍý¤Ë´Ø¤ï¤ë¾ðÊ󡢤¹¤Ê¤ï¤Á¥í¡¼¥É¥¢¥Ù¥ì¡¼¥¸¡¢ ¥Ç¥£¥¹¥¯¶õ¤­ÍÆÎÌ¡¢Ç§¾Ú¤¬Ä̤뤫Èݤ«Åù¤Î¥­¥ã¥Ã¥·¥å¤ÎÍ­¸ú´ü¸Â¤òÉÿô¤Ç»ØÄꤷ¤Þ¤¹¡£ Ää»ß¤·¤Æ¤¤¤¿¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤¬Éü³è¤·¤¿¤è¤¦¤Ê¾ì¹ç¡¢¤³¤Î´ü¸Â¤¬ ÀÚ¤ì¤ë¤Þ¤Ç¤Ï¡¢¤½¤Î¥Î¡¼¥É¤¬¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¤µ¤ì¤Ê¤¤¤³¤È¤¬¤¢¤ê¤Þ¤¹¡£ ¥Ç¥Õ¥©¥ë¥È¤Ï600É乤ʤï¤Á10ʬ¤Ç¤¹¡£

Îã:

schedule_cache_timeout 60

schedule_idle_load_thresh CPUÉé²Ù

¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Î¥¹¥±¥¸¥å¡¼¥ê¥ó¥°»þ¤Ë¡¢ CPUÉé²Ù¤¬Ä㤤¤È¤ß¤Ê¤µ¤ì¤ëCPUÉé²Ù¤ò»ØÄꤷ¤Þ¤¹¡£ ¤³¤³¤Ç»ØÄꤵ¤ì¤ëCPUÉé²Ù¤è¤êÄ㤤CPUÉé²Ù¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤¬ ¤Þ¤º¤Ï¥¹¥±¥¸¥å¡¼¥ëÂоݤȤʤê¤Þ¤¹¡£ ¥Ç¥Õ¥©¥ë¥ÈÃͤÏ0.1¤Ç¤¹¡£

Îã:

schedule_idle_load_thresh 0.1

schedule_busy_load_thresh CPUÉé²Ù

¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Î¥¹¥±¥¸¥å¡¼¥ê¥ó¥°»þ¤Ë¡¢ CPUÉé²Ù¤¬¹â¤¤¤È¤ß¤Ê¤µ¤ì¤ëCPUÉé²Ù¤ò»ØÄꤷ¤Þ¤¹¡£ ¤³¤³¤Ç»ØÄꤵ¤ì¤ëCPUÉé²Ù¤è¤ê¹â¤¤CPUÉé²Ù¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Ï Åö½é¥¹¥±¥¸¥å¡¼¥ëÂоݤȤʤê¤Þ¤»¤ó¡£ ¥Ç¥Õ¥©¥ë¥ÈÃͤÏ0.5¤Ç¤¹¡£

Îã:

schedule_busy_load_thresh 0.5

schedule_virtual_load CPUÉé²Ù

¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤¬ÁªÂò¤µ¤ì¤¿¤È¤­¡¢ CPUÉé²Ù¤Î¥¯¥é¥¤¥¢¥ó¥È¥­¥ã¥Ã¥·¥å¤Ë¤³¤³¤Ç»ØÄꤵ¤ì¤ëCPUÉé²Ù¤¬²Ã¤¨¤é¤ì¤Þ¤¹¡£ ¤³¤ì¤Ë¤è¤ê¡¢ °ìÅÙ¥¹¥±¥¸¥å¡¼¥ë¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤¬²¿Å٤⥹¥±¥¸¥å¡¼¥ë¤µ¤ì¤ë¤³¤È¤òËɤ¤¤Ç¤¤¤Þ¤¹¡£ ¥Ç¥Õ¥©¥ë¥ÈÃͤÏ0.3¤Ç¤¹¡£

Îã:

schedule_virtual_load 0.3

minimum_free_disk_space ¥Ð¥¤¥È¿ô

¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤ÇɬÍפʺǾ®¸ÂÅ٤Υǥ£¥¹¥¯¶õ¤­ÍÆÎ̤ò»ØÄê ¤·¤Þ¤¹¡£¤³¤Î¥µ¥¤¥º°Ê²¼¤Î¶õ¤­ÍÆÎ̤·¤«¤Ê¤¤¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Ï¡¢ ¥Õ¥¡¥¤¥ë½ñ¤­¹þ¤ß¤ò¹Ô¤¦²ÄǽÀ­¤Î¤¢¤ëÁàºî¤ò¹Ô¤¦ºÝ¤Ë¡¢ÁªÂò¤µ¤ì¤Ë¤¯¤¯¤Ê¤ê¤Þ¤¹¡£ »ØÄê¤Ï¥Ð¥¤¥Èñ°Ì¤Ç¹Ô¤¤¤Þ¤¹¤¬¡¢¿ô»ú¤ÎËöÈø¤Ë¶õÇò¤ò³«¤±¤º¤Ëk/M/G/T¤ò»ØÄê ¤¹¤ë¤³¤È¤Ç¡¢¤½¤ì¤¾¤ì1k¥Ð¥¤¥È¡¿1M¥Ð¥¤¥È¡¿1G¥Ð¥¤¥È¡¿1T¥Ð¥¤¥È¤òñ°Ì¤È¤¹¤ë ¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ ¥Ç¥Õ¥©¥ë¥È¤Ï128M¥Ð¥¤¥È¤Ç¤¹¡£

¤³¤Î¥Ñ¥é¥á¡¼¥¿¤Ï¡¢gfarm2.conf¤Ègfmd.conf¤ÎξÊý¤Ç»ØÄꤹ¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£ Í­¸ú¤Ë¤¹¤ë¤¿¤á¤Ë¤Ï gfmd ¤ª¤è¤Ó Gfarm¥¯¥é¥¤¥¢¥ó¥È¤òºÆµ¯Æ°¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£

Îã:

minimum_free_disk_space 1G

simultaneous_replication_receivers Ʊ»þ½èÍý¿ô

gfmd ¼çƳ¤ÎÊ£À½½èÍý¤ò¡¢Ã±°ìÊ£À½ºîÀ®¥Û¥¹¥È¤ËÂФ·¤Æ¡¢ Ʊ»þ¤¤¤¯¤Ä¤Þ¤ÇʹԤ·¤Æ¹Ô¤Ê¤¦¤³¤È¤òµö¤¹¤«¤òÀßÄꤷ¤Þ¤¹¡£ ¥Ç¥Õ¥©¥ë¥È¤Ï 20¤Ç¤¹¡£

Îã:

simultaneous_replication_receivers 40

gfsd_connection_cache ¥³¥Í¥¯¥·¥ç¥ó¿ô

gfarm¥é¥¤¥Ö¥é¥ê¤¬gfsd¤È¤ÎÄÌ¿®¤ËÍѤ¤¤ë¥³¥Í¥¯¥·¥ç¥ó¤ò¡¢¤¤¤¯¤Ä ¤Þ¤Ç¥­¥ã¥Ã¥·¥å¤¹¤ë¤«¤ò»ØÄꤷ¤Þ¤¹¡£ ¥Ç¥Õ¥©¥ë¥È¤Ï16¥³¥Í¥¯¥·¥ç¥ó¤Ç¤¹¡£

Îã:

gfsd_connection_cache 32

attr_cache_limit ¸Ä¿ô

gfarm¥é¥¤¥Ö¥é¥ê¤¬¥­¥ã¥Ã¥·¥å¤¹¤ë°À­¤ÎºÇÂç¿ô¤ò»ØÄꤷ¤Þ¤¹¡£ ¥Ç¥Õ¥©¥ë¥È¤Ï40000¸Ä¤Ç¤¹¡£

Îã:

attr_cache_limit 100000

attr_cache_timeout ¥ß¥êÉÿô

gfarm¥é¥¤¥Ö¥é¥ê¤¬Â°À­¤ò¥­¥ã¥Ã¥·¥å¤·¤Æ¤¤¤ë»þ´Ö¤ò¡¢¥ß¥êÉÃñ°Ì¤Ç»ØÄꤷ¤Þ¤¹¡£ ¥Ç¥Õ¥©¥ë¥È¤Ï 1000¥ß¥êÉ乤ʤï¤Á 1ÉäǤ¹¡£

Îã:

attr_cache_timeout 3600000

log_level Í¥ÀèÅÙ¥ì¥Ù¥ë

¤É¤ÎÍ¥ÀèÅÙ¥ì¥Ù¥ë°Ê¾å¤Î¥í¥°¤ò½ÐÎϤ¹¤ë¤«¤ò»ØÄꤷ¤Þ¤¹¡£ ¤³¤³¤Ç»ØÄꤷ¤¿¥ì¥Ù¥ë̤Ëþ¤ÎÍ¥ÀèÅÙ¤Î¥í¥°¤Ï¡¢syslog¤äɸ½à¥¨¥é¡¼¤Ø Á÷¤é¤ì¤Þ¤»¤ó¡£ ¥ì¥Ù¥ë¤Ï¡¢Í¥ÀèÅ٤ι⤤½ç¤Ë"emerg", "alert", "crit", "err", "warning", "notice", "info", "debug"¤Ç¤¹¡£ ¥Ç¥Õ¥©¥ë¥È¤Î½ÐÎÏ¥ì¥Ù¥ë¤Ï"info"¤Ç¤¹¡£ "crit"°Ê¾å¤ÎÍ¥ÀèÅÙ¤ò»ØÄꤹ¤ë¤³¤È¤Ï¡¢¤ª´«¤á¤Ç¤­¤Þ¤»¤ó¡£

Îã:

log_level debug

log_message_verbose_level ¥ì¥Ù¥ë

¥í¥°¥á¥Ã¥»¡¼¥¸¤Î¾éĹÅÙ¤ò»ØÄꤷ¤Þ¤¹¡£ ¥Ç¥Õ¥©¥ë¥È¤Ï0¤Ç¤¹¡£¥ì¥Ù¥ë0¤Ç¤Ï¡¢¥í¥°ID¤¬½ÐÎϤµ¤ì¤Þ¤¹¡£ ¥ì¥Ù¥ë1¤Ç¤Ï¡¢¥ì¥Ù¥ë0¤Ë²Ã¤¨¥½¡¼¥¹¥³¡¼¥É¤Î¥Õ¥¡¥¤¥ë̾¤È¹ÔÈֹ椬½ÐÎϤµ¤ì¤Þ¤¹¡£ ¥ì¥Ù¥ë2¤Ç¤Ï¡¢¥ì¥Ù¥ë1¤Ë²Ã¤¨´Ø¿ô̾¤¬½ÐÎϤµ¤ì¤Þ¤¹¡£

Îã:

log_message_verbose_level 1

no_file_system_node_timeout Éÿô

ÍøÍѲÄǽ¤Ê¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤¬Â¸ºß¤·¤Ê¤¤¾ì¹ç¡¤ Gfarm¥¯¥é¥¤¥¢¥ó¥È¥é¥¤¥Ö¥é¥ê¤Ï¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤¬ÍøÍѲÄǽ¤Ë¤Ê¤ë¤Þ¤Ç»î¹Ô¤ò·«¤êÊÖ¤·¤Þ¤¹¤¬¡¢ ¤½¤Î¥¿¥¤¥à¥¢¥¦¥È»þ´Ö¤òÉÃñ°Ì¤Ç»ØÄꤷ¤Þ¤¹¡£ ¥Ç¥Õ¥©¥ë¥È¤Ï 30ÉäǤ¹¡£

Îã:

no_file_system_node_timeout 30

gfmd_reconnection_timeout Éÿô

¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤Ø¤ÎÀܳ¤¬ÀÚÃǤµ¤ì¤¿¾ì¹ç¡¤ ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤Ø¤ÎºÆÀܳ¤ò·«¤êÊÖ¤·¤Þ¤¹¤¬¡¤ ¤½¤Î¥¿¥¤¥à¥¢¥¦¥È»þ´Ö¤òÉÃñ°Ì¤Ç»ØÄꤷ¤Þ¤¹¡£ ¥Ç¥Õ¥©¥ë¥È¤Ï 30ÉäǤ¹¡£

Îã:

gfmd_reconnection_timeout 30

GRAMMAR

gfarm2.conf¤Îʸˡ¤òBNF¤Çµ­½Ò¤¹¤ë¤È¡¢²¼µ­¤Î¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡£

<statement> ::=
  <spool_statement> |
  <spool_server_listen_address_statement> |
  <spool_server_cred_type_statement> |
  <spool_server_cred_service_statement> |
  <spool_server_cred_name_statement> |
  <metadb_server_host_statement> |
  <metadb_server_port_statement> |
  <metadb_server_cred_type_statement> |
  <metadb_server_cred_service_statement> |
  <metadb_server_cred_name_statement> |
  <metadb_server_stack_size_statement> |
  <metadb_server_thread_pool_size_statement> |
  <metadb_server_job_queue_length_statement> |
  <metadb_server_heartbeat_interval_statement> |
  <metadb_server_dbq_size_statement> |
  <ldap_server_host_statement> |
  <ldap_server_port_statement> |
  <ldap_base_dn_statement> |
  <ldap_bind_dn_statement> |
  <ldap_bind_password_statement> |
  <postgresql_server_host_statement> |
  <postgresql_server_port_statement> |
  <postgresql_dbname_statement> |
  <postgresql_user_statement> |
  <postgresql_password_statement> |
  <postgresql_conninfo_statement> |
  <auth_statement> |
  <sockopt_statement> |
  <known_network_statement> |
  <admin_user_statement> |
  <admin_user_gsi_dn_statement> |
  <local_user_map_statement> |
  <local_group_map_statement> |
  <schedule_cache_timeout_statement> |
  <schedule_idle_load_thresh_statement> |
  <schedule_busy_load_thresh_statement> |
  <schedule_virtual_load_statement> |
  <minimum_free_disk_space_statement> |
  <simultaneous_replication_receivers> |
  <gfsd_connection_cache_statement> |
  <attr_cache_limit_statement> |
  <attr_cache_timeout_statement> |
  <log_level_statement> |
  <log_message_verbose_level_statement>
<spool_statement> ::= "spool" <pathname>
<spool_server_listen_address_statement> ::=
  "spool_server_listen_address" <ipv4_address>
<spool_server_cred_type_statement> ::=
  "spool_server_cred_type" <cred_type>
<spool_server_cred_service_statement> ::=
  "spool_server_cred_service" <cred_service>
<spool_server_cred_name_statement> ::=
  "spool_server_cred_name" <cred_name>
<metadb_server_host_statement> ::= "metadb_server_host" <hostname>
<metadb_server_port_statement> ::= "metadb_server_port" <portnumber>
<metadb_server_cred_type_statement> ::=
  "metadb_server_cred_type" <cred_type>
<metadb_server_cred_service_statement> ::=
  "metadb_server_cred_service" <cred_service>
<metadb_server_cred_name_statement> ::=
  "metadb_server_cred_name" <cred_name>
<metadb_server_stack_size_statement> ::=
  "metadb_server_stack_size" <number>
<metadb_server_thread_pool_size_statement> ::=
  "metadb_server_thread_pool_size" <number>
<metadb_server_job_queue_length_statement> ::=
  "metadb_server_job_queue_length" <number>
<metadb_server_heartbeat_interval_statement> ::=
  "metadb_server_heartbeat_interval" <number>
<metadb_server_dbq_size_statement> ::=
  "metadb_server_dbq_size" <number>
<ldap_server_host_statement> ::= "ldap_server_host" <hostname>
<ldap_server_port_statement> ::= "ldap_server_port" <portnumber>
<ldap_base_dn_statement> ::= "ldap_base_dn" <string>
<ldap_bind_dn_statement> ::= "ldap_bind_dn" <string>
<ldap_bind_password_statement> ::= "ldap_bind_password" <string>
<postgresql_server_host_statement> ::= "postgresql_server_host" <hostname>
<postgresql_server_port_statement> ::= "postgresql_server_port" <portnumber>
<postgresql_dbname_statement> ::= "postgresql_dbname" <string>
<postgresql_user_statement> ::= "postgresql_user" <string>
<postgresql_password_statement> ::= "postgresql_password" <string>
<postgresql_conninfo_statement> ::= "postgresql_conninfo" <string>
<auth_statement> ::=
  "auth" <validity> <auth_method> <hostspec>
<auth_command> ::= "enable" | "disable"
<auth_method> ::= "gsi" | "gsi_auth" | "sharedsecret"
<sockopt_statement> ::=
  "sockopt" <socket_option>[=<number>] [""LISTENER" | <hostspec>]
<socket_option> = "debug" | "keepalive" | "sndbuf" | "rcvbuf" |
  "tcp_nodelay"
<known_network_statement> ::= "known_network" <hostspec>
<admin_user_statement> ::= "admin_user" <string>
<admin_user_gsi_dn_statement> ::= "admin_user_gsi_dn" <string>
<local_user_map_statement> ::= "local_user_map" <pathname>
<local_group_map_statement> ::= "local_group_map" <pathname>
<schedule_cache_timeout_statement> ::= "schedule_cache_timeout" <number>
<schedule_idle_load_thresh_statement> ::= "schedule_idle_load_thresh" <load>
<schedule_busy_load_thresh_statement> ::= "schedule_busy_load_thresh" <load>
<schedule_virtual_load_statement> ::= "schedule_virtual_load" <load>
<minimum_free_disk_space_statement> ::=
  "minimum_free_disk_space" <size>
<simultaneous_replication_receivers> ::= "simultaneous_replication_receivers" <number>
<gfsd_connection_cache_statement> ::= "gfsd_connection_cache" <number>
<attr_cache_limit_statement> ::= "attr_cache_limit" <number>
<attr_cache_timeout_statement> ::= "attr_cache_timeout" <number>
<log_level_statement> ::= "log_level" <log_priority>
<log_message_verbose_level_statement> ::= "log_message_verbose_level" <number>
<no_file_system_node_timeout_statement> ::= "no_file_system_node_timeout" <number>
<gfmd_reconnection_timeout_statement> ::= "gfmd_reconnection_timeout" <number>
<hostspec> ::= <ipv4_address> | <ipv4_address> "/" <address_mask> |
  <hostname> | "." <domain_name> | "*"
<pathname> ::= <pathname_character> <pathname_character>*
<pathname_character> ::= <hostname_character> | "," | "/" | "_"
<hostname> ::= <hostname_character> <hostname_character>*
<hostname_character> ::= <alphabet> | <digit> | "-" | "."
<portnumber> ::= <number>
<size> ::= <number> [ "k" | "M" | "G" | "T" ]
<number> ::= <digit> [<digit>*]
<digit> ::= "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9"
<string> ::= """ <double_quoted_character>* """
<double_quoted_character> ::=
  <any_character_except_backslash_and_double_quotation> |
  "\\" | "\""
<validity> ::= "enable" | "disable"
<log_priority> ::= "emerg" | "alert" | "crit" | "err" | "warning" |
  "notice" | "info" | "debug"

EXAMPLES

¥á¥¿¥Ç¡¼¥¿¤ÎÊݸ¤ËPostgreSQL¤ò»È¤¤¡¢IP¥¢¥É¥ì¥¹192.168.0.0/24¤Î ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤ä¥¯¥é¥¤¥¢¥ó¥È¤ËÂФ·¤Æ¡¢sharedsecretǧ¾Ú¤ò »È¤¦Îã¤Ç¤¹¡£

spool /var/spool/gfarm
metadb_server_host metadb.example.org
metadb_server_port 601
postgresql_server_host metadb.example.org
postgresql_server_port 5432
postgresql_dbname gfarm
postgresql_user gfarm
postgresql_password "secret-postgresql-password"
auth enable sharedsecret 192.168.0.0/24
sockopt keepalive

¥á¥¿¥Ç¡¼¥¿¤ÎÊݸ¤ËLDAP¤ò»È¤¤¡¢Ç¤°Õ¤ÎIP¥¢¥É¥ì¥¹¤ò»È¤¦ ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤ä¥¯¥é¥¤¥¢¥ó¥È¤ËÂФ·¤Æ¡¢GSIǧ¾Ú¤ò»È¤¦Îã¤Ç¤¹¡£

spool /var/spool/gfarm
metadb_server_host metadb.example.com
metadb_server_port 601
ldap_server_host metadb.example.com
ldap_server_port 602
ldap_base_dn "dc=example, dc=com"
ldap_bind_dn "cn=gfarmuser, dc=example, dc=com"
ldap_bind_password "secret-ldap-password"
auth enable gsi *
sockopt keepalive

FILES

%%SYSCONFDIR%%/gfarm2.conf

$HOME/.gfarm2rc

SEE ALSO

gfmd(8), gfsd(8), setsockopt(2)

gfarm-2.4.1/doc/html/ja/ref/man5/Makefile0000644000000000000000000000052311507222721016466 0ustar rootroot# $Id: Makefile 2373 2006-01-12 00:54:22Z soda $ top_builddir = ../../../../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk htmldir=$(default_htmldir)/ja/ref/man5 DOCBOOK_DIR=$(top_srcdir)/doc/docbook/ja/ref/man5 include $(DOCBOOK_DIR)/Makefile.inc HTMLSRC=$(DOCBOOK) include $(top_srcdir)/makes/html.mk gfarm-2.4.1/doc/html/ja/ref/index.html0000644000000000000000000001377611507222722016202 0ustar rootroot Gfarm ¥É¥­¥å¥á¥ó¥È [GFARM LOGO] ʸ½ñ½¸ > »²¾È¥Þ¥Ë¥å¥¢¥ë

Gfarm »²¾È¥Þ¥Ë¥å¥¢¥ë

English | ÆüËܸì


section 1: ¥³¥Þ¥ó¥É

  1. ¥¯¥é¥¤¥¢¥ó¥È¡¦¥³¥Þ¥ó¥É

section 3: ¥é¥¤¥Ö¥é¥ê´Ø¿ô

  1. ³µÍ×
  2. ½é´ü²½¡¢½ªÎ»
  3. ¥Õ¥¡¥¤¥ëÆþ½ÐÎÏ

section 5: ¥Õ¥¡¥¤¥ë·Á¼°


section 8: ¥Ç¡¼¥â¥ó


gfarm-2.4.1/doc/html/ja/ref/man3/0000755000000000000000000000000011507222730015024 5ustar rootrootgfarm-2.4.1/doc/html/ja/ref/man3/gfs_pio_set_local.3.html0000644000000000000000000000365511507222722021540 0ustar rootroot gfs_pio_set_local

gfs_pio_set_local

Name

gfs_pio_set_local -- ¥í¡¼¥«¥ë¥Õ¥¡¥¤¥ë¥Ó¥å¡¼¤Î½é´ü²½

Synopsis

#include <gfarm/gfarm.h>

char *gfs_pio_set_local(int node, int nnode);

DESCRIPTION

¥í¡¼¥«¥ë¥Õ¥¡¥¤¥ë¥Ó¥å¡¼¤òÍøÍѤ¹¤ëÊÂÎó¥×¥í¥»¥¹¤Ï¡¢¤½¤Î½èÍý¤ÎºÇ½é¤Ë¡¢ ¤½¤Î¥Î¡¼¥É¤Î¥Î¡¼¥ÉÈÖ¹æ¤ò node ¤Ë¡¢ÊÂÎó¥×¥í¥»¥¹¤ò¹½À®¤¹¤ëÁí¥Î¡¼¥É¿ô¤ò nnode ¤ËÍ¿¤¨¤Æ¡¢¤³¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤Þ¤¹¡£

RETURN VALUES

NULL

Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£

¤½¤Î¾

¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£

SEE ALSO

gfs_pio_set_view_local(3), gfs_pio_set_view_index(3)

gfarm-2.4.1/doc/html/ja/ref/man3/gfs_pio_putline.3.html0000644000000000000000000000360011507222722021241 0ustar rootroot gfs_pio_putline

gfs_pio_putline

Name

gfs_pio_putline -- °ì¹Ô½ñ¤­¹þ¤ß

Synopsis

#include <gfarm/gfarm.h>

char *gfs_pio_putline(GFS_File gf, char * s);

DESCRIPTION

ʸ»úÎó s ¤ò¥Õ¥¡¥¤¥ë gf ¤Ë½ñ¤­¹þ¤ß¡¢¤½¤Î¸å²þ¹Ô¤ò½ñ¤­¹þ¤ß¤Þ¤¹¡£

RETURN VALUES

NULL

Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£

GFARM_ERR_NO_MEMORY

¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£

¤½¤Î¾

¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£

SEE ALSO

gfs_pio_create(3), gfs_pio_open(3)

gfarm-2.4.1/doc/html/ja/ref/man3/gfs_glob_add.3.html0000644000000000000000000000361611507222722020454 0ustar rootroot gfs_glob_add

gfs_glob_add

Name

gfs_glob_add -- ¥Ñ¥¹¤Î¥¿¥¤¥×¤ò¥ê¥¹¥È¤ËÄɲ乤ë

Synopsis

#include <gfarm/gfarm.h>

char *gfs_glob_add(gfs_glob_t * listp, int dtype);

DESCRIPTION

°ú¿ô listp ¤Ë°ú¿ô dtype ¤ò¥Ñ¥¹¤Î¥¿¥¤¥×¤È¤·¤ÆÄɲä·¤Þ¤¹¡£

RETURN VALUES

NULL

Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£

GFARM_ERR_NO_MEMORY

¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£

SEE ALSO

gfs_glob_init(3) gfs_glob(3) gfs_glob_free(3)

gfarm-2.4.1/doc/html/ja/ref/man3/gfs_rename.3.html0000644000000000000000000000635611507222722020174 0ustar rootroot gfs_rename

gfs_rename

Name

gfs_rename -- ¥Õ¥¡¥¤¥ë¤ò²þ̾¤¹¤ë

Synopsis

#include <gfarm/gfarm.h>

char *gfs_rename(char * gfarm_url_from, char * gfarm_url_to);

DESCRIPTION

¥Õ¥¡¥¤¥ë¤Þ¤¿¤Ï¥Ç¥£¥ì¥¯¥È¥ê gfarm_url_from ¤ò gfarm_url_to ¤Ë²þ̾¤·¤Þ¤¹¡£

gfarm_url_to ¤¬´û¸¤Î¾ì¹ç¤Ïºï½ü¤µ¤ì¤Þ¤¹¡£¤³¤Î¤È¤­ gfarm_url_from ¤¬¥Õ¥¡¥¤¥ë¤Ê¤é¤Ð gfarm_url_to ¤â¥Õ¥¡¥¤¥ë¡¢ gfarm_url_from ¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Ê¤é¤Ð gfarm_url_to ¤â¥Ç¥£¥ì¥¯¥È¥ê¤Ç¡¢¤·¤«¤â¶õ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£

¥Ç¥£¥ì¥¯¥È¥ê gfarm_url_from ¤ò¤½¤Î¥µ¥Ö¥Ç¥£¥ì¥¯¥È¥ê¤Ë²þ̾¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó¡£

RETURN VALUES

NULL

Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£

GFARM_ERR_NO_MEMORY

¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£

GFARM_ERR_AUTHENTICATION

gfmd(8) ¤ËÂФ¹¤ë¥æ¡¼¥¶¡¼Ç§¾Ú¤¬¼ºÇÔ¤·¤Þ¤·¤¿¡£

GFARM_ERR_PERMISSION_DENIED

¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤Ø½ñ¤­¹þ¤ß¥¢¥¯¥»¥¹¤¹¤ë¸¢¸Â¤¬¤¢¤ê¤Þ¤»¤ó¡£

GFARM_ERR_INVALID_ARGUMENT

¥Ç¥£¥ì¥¯¥È¥ê gfarm_url_from ¤ò¡¢¤½¤ì¼«¿È¤Î¥µ¥Ö¥Ç¥£¥ì¥¯¥È¥ê¤ËÊѹ¹¤·¤è¤¦¤È¤·¤Þ¤·¤¿¡£

GFARM_ERR_NO_SUCH_OBJECT

»ØÄꤵ¤ì¤¿¥Ñ¥¹ gfarm_url_from ¤¬Â¸ºß¤·¤Þ¤»¤ó¡£

GFARM_ERR_IS_A_DIRECTORY

gfarm_url_from ¤¬¥Õ¥¡¥¤¥ë¤Ç¤¢¤ë¤Î¤Ë¡¢ gfarm_url_to ¤Ï´û¸¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤¹¡£

GFARM_NOT_IS_A_DIRECTORY

gfarm_url_from ¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤¢¤ë¤Î¤Ë¡¢ gfarm_url_to ¤Ï´û¸¤Î¥Õ¥¡¥¤¥ë¤Ç¤¹¡£

¤½¤Î¾

¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£

gfarm-2.4.1/doc/html/ja/ref/man3/gfs_pio_putc.3.html0000644000000000000000000000355111507222722020541 0ustar rootroot gfs_pio_putc

gfs_pio_putc

Name

gfs_pio_putc -- °ìʸ»ú½ñ¤­¹þ¤ß

Synopsis

#include <gfarm/gfarm.h>

char *gfs_pio_putc(GFS_File gf, int c);

DESCRIPTION

¥Õ¥¡¥¤¥ë gf ¤Ë 1¥Ð¥¤¥È (1ʸ»ú) ¤ÎÃÍ c ¤ò½ñ¤­¹þ¤ß¤Þ¤¹¡£

RETURN VALUES

NULL

Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£

GFARM_ERR_NO_MEMORY

¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£

¤½¤Î¾

¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£

SEE ALSO

gfs_pio_create(3), gfs_pio_open(3)

gfarm-2.4.1/doc/html/ja/ref/man3/gfs_pio_flush.3.html0000644000000000000000000000367411507222722020715 0ustar rootroot gfs_pio_flush

gfs_pio_flush

Name

gfs_pio_flush -- ½ñ¤­¹þ¤ß¤ò¥Õ¥é¥Ã¥·¥å¤¹¤ë¡£

Synopsis

#include <gfarm/gfarm.h>

char *gfs_pio_flush(GFS_File gf);

DESCRIPTION

½ñ¤­¹þ¤ßÍѤ˥ª¡¼¥×¥ó¤·¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë gf ¤Î¡¢½ñ¤­¹þ¤ß¥Ð¥Ã¥Õ¥¡¤Ëί¤Þ¤Ã¤Æ¤¤¤ë¥Ç¡¼¥¿¤ò¼ÂºÝ¤Ë¥Ç¥£¥¹¥¯¤Ë½ñ¤­¹þ¤ß¤Þ¤¹¡£

RETURN VALUES

NULL

Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£

GFARM_ERR_NO_MEMORY

¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£

¤½¤Î¾

¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£

SEE ALSO

gfs_pio_create(3), gfs_pio_open(3), gfs_pio_write(3)

gfarm-2.4.1/doc/html/ja/ref/man3/gfarm_hostlist_read.3.html0000644000000000000000000000473711507222722022107 0ustar rootroot gfarm_hostlist_read

gfarm_hostlist_read

Name

gfarm_hostlist_read -- ¥Û¥¹¥È¹½À®¥Õ¥¡¥¤¥ë¤òÆÉ¤ß¹þ¤à

Synopsis

#include <gfarm/gfarm.h>

char *gfarm_hostlist_read(char *filename, int *np, char ***line_table_p, int *error_line_p);

DESCRIPTION

Gfarm¥Õ¥¡¥¤¥ë¤ò¥¤¥ó¥Ý¡¼¥È¤¹¤ë¥¢¥×¥ê¥±¡¼¥·¥ç¥óÍѤÎÊä½õ´Ø¿ô¤Î°ì¤Ä¤Ç¤¹¡£

¥Û¥¹¥È¹½À®¥Õ¥¡¥¤¥ë̾¤ò filename ¤Ë»ØÄꤹ¤ë¤È¡¢¤½¤Î¥Õ¥¡¥¤¥ë¤«¤é¡¢ ¥Û¥¹¥È¤ÎÇÛÎó¤ò line_table_p ¤Î»Ø¤¹Àè¤Ë¤ËÊÖ¤·¤Þ¤¹¡£ ¹½À®¥Õ¥¡¥¤¥ë¤Ë¹½Ê¸¥¨¥é¡¼¤¬À¸¤¸¤¿¾ì¹ç¤Ë¤Ï¡¢ error_line_p ¤Î»Ø¤¹Àè¤Ë¡¢¥Õ¥¡¥¤¥ë¤Î¹ÔÈÖ¹æ¤òÊÖ¤·¤Þ¤¹¡£¤³¤ÎÃͤ¬ -1 ¤Î¾ì¹ç¤Ë¤Ï¡¢¹½Ê¸°Ê³°¤Î¥¨¥é¡¼¸¶°ø¤Ç¤¹¡£

¤³¤³¤ÇÆÀ¤¿¥Û¥¹¥È¤ÎÇÛÎó¤Ï gfarm_strings_free_deeply() ¤òÍѤ¤¤Æ²òÊü ¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£

RETURN VALUES

NULL

Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£

GFARM_ERR_NO_MEMORY

¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£

¤½¤Î¾

¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£

SEE ALSO

gfarm_import_fragment_config_read(3), gfarm_import_fragment_size_alloc(3)

gfarm-2.4.1/doc/html/ja/ref/man3/gfs_pio_datasync.3.html0000644000000000000000000000445611507222722021401 0ustar rootroot gfs_pio_datasync

gfs_pio_datasync

Name

gfs_pio_datasync -- ¥á¥â¥ê¾å¤Î¥Õ¥¡¥¤¥ë¤ÎÆâÍÆ¤ò¥Ç¥£¥¹¥¯¤ËÈ¿±Ç¤µ¤»¤ë

Synopsis

#include <gfarm/gfarm.h>

char *gfs_pio_datasync(GFS_File gf);

DESCRIPTION

½ñ¤­¹þ¤ßÍѤ˥ª¡¼¥×¥ó¤·¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë gf ¤Î¡¢¥á¥â¥ê¾å¤Ë¤¢¤ë¥Ç¡¼¥¿¤ò¼ÂºÝ¤Ë¥Ç¥£¥¹¥¯¤Ë½ñ¤­¹þ¤ß¡¤ Æþ½ÐÎϤδ°Î»¤òÂԤäƤ«¤éÌá¤ê¤Þ¤¹¡¥¥á¥¿¥Ç¡¼¥¿¤Ï¹¹¿·¤·¤Þ¤»¤ó¡¥ Ê̤δؿô gfs_pio_sync ¤Ï¡¤¥Õ¥¡¥¤¥ë¥Ç¡¼¥¿¤Ë²Ã¤¨¤Æ¥á¥¿¥Ç¡¼¥¿¤â¥Ç¥£¥¹¥¯¤Ë½ñ¤­¹þ¤ß¤Þ¤¹¡¥

RETURN VALUES

NULL

Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡¥

GFARM_ERR_NO_MEMORY

¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡¥

¤½¤Î¾

¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡¥

SEE ALSO

gfs_pio_sync(3), gfs_pio_create(3), gfs_pio_open(3), gfs_pio_write(3), gfs_pio_flush(3)

gfarm-2.4.1/doc/html/ja/ref/man3/gfs_pio_error.3.html0000644000000000000000000000341611507222722020717 0ustar rootroot gfs_pio_error

gfs_pio_error

Name

gfs_pio_error -- ¥¨¥é¡¼¾õ¶·

Synopsis

#include <gfarm/gfarm.h>

char *gfs_pio_error(GFS_File gf);

DESCRIPTION

¥Õ¥¡¥¤¥ë gf ¤Î¥¨¥é¡¼¾õ¶·¤ò¼¨¤·¤Þ¤¹¡£

RETURN VALUES

NULL

ÆÃ¤Ë¥¨¥é¡¼¤Ï¡¢À¸¤¸¤Æ¤¤¤Þ¤»¤ó¡£

¤½¤Î¾

¥¨¥é¡¼¤¬À¸¤¸¤Æ¤¤¤Þ¤¹¡£¥¨¥é¡¼¤ò¼¨¤¹Ê¸»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤·¤Þ¤¹¡£

SEE ALSO

gfs_pio_create(3), gfs_pio_eof(3), gfs_pio_open(3)

gfarm-2.4.1/doc/html/ja/ref/man3/gfarm_url_program_register.3.html0000644000000000000000000000463311507222722023473 0ustar rootroot gfarm_url_program_register

gfarm_url_program_register

Name

gfarm_url_program_register -- ¥×¥í¥°¥é¥à¤òÅÐÏ¿¤¹¤ë

Synopsis

#include <gfarm/gfarm.h>

char *gfarm_url_program_register(char *gfarm_url, char *architecture, char *filename, int nreplicas);

DESCRIPTION

°ú¿ô architecture ¤Ç»ØÄꤷ¤¿µ¡¼ï¸þ¤±¤Î¼Â¹Ô·Á¼°¥Õ¥¡¥¤¥ë filename ¤ò¡¢ gfarm_url ¤Ç»ØÄꤷ¤¿¥Ñ¥¹Ì¾¤ËÅÐÏ¿¤·¤Þ¤¹¡£ ¤Þ¤¿¡¢ nreplicas ¤Ë¡¢ºîÀ®¤¹¤ë¥ì¥×¥ê¥«¤Î¿ô¤ò»ØÄꤷ¤Þ¤¹¡£

°ú¿ô nreplicas ¤Ï¡¢¾­Íè¤Î¥Ð¡¼¥¸¥ç¥ó¤Çºï½ü¤µ¤ì¤ëͽÄê¤Ç¤¹¡£

RETURN VALUES

NULL

Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£

GFARM_ERR_NO_MEMORY

¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£

GFARM_ERR_OPERATION_NOT_PERMITTED

»ØÄꤷ¤¿¥Õ¥¡¥¤¥ë¤Ë¡¢¼Â¹Ô²Äǽ¥Ó¥Ã¥È¤¬Î©¤Ã¤Æ¤¤¤Þ¤»¤ó¤Ç¤·¤¿¡£

¤½¤Î¾

¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£

SEE ALSO

gfarm_url_program_deliver(3)

gfarm-2.4.1/doc/html/ja/ref/man3/gfs_unlink.3.html0000644000000000000000000000413611507222722020217 0ustar rootroot gfs_unlink

gfs_unlink

Name

gfs_unlink -- ¥Õ¥¡¥¤¥ëºï½ü

Synopsis

#include <gfarm/gfarm.h>

char *gfs_unlink(char * gfarm_url);

DESCRIPTION

°ú¿ô gfarm_url ¤Ë»ØÄꤷ¤¿Ì¾Á°¤Î¥Õ¥¡¥¤¥ë¤òºï½ü¤·¤Þ¤¹¡£

RETURN VALUES

NULL

Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£

GFARM_ERR_NO_MEMORY

¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£

GFARM_ERR_AUTHENTICATION

gfmd(8) ¤ËÂФ¹¤ë¥æ¡¼¥¶¡¼Ç§¾Ú¤¬¼ºÇÔ¤·¤Þ¤·¤¿¡£

GFARM_ERR_PERMISSION_DENIED

gfarm_url ¤Î¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤Ø½ñ¤­¹þ¤ß¥¢¥¯¥»¥¹¤¹¤ë¸¢¸Â¤¬¤¢¤ê¤Þ¤»¤ó¡£

GFARM_ERR_NO_SUCH_OBJECT

»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Þ¤»¤ó¡£

GFARM_ERR_NOT_A_DIRECTORY

»ØÄꤷ¤¿¥Ñ¥¹Ì¾¤Î¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤¬¡¢¼ÂºÝ¤Ë¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤«¤Ã¤¿¤³¤È¤ò ¼¨¤·¤Þ¤¹¡£

¤½¤Î¾

¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£

gfarm-2.4.1/doc/html/ja/ref/man3/gfs_glob_init.3.html0000644000000000000000000000403011507222722020656 0ustar rootroot gfs_glob_init

gfs_glob_init

Name

gfs_glob_init -- ¥Ñ¥¹¤Î¥¿¥¤¥×¤ò³ÊǼ¤¹¤ëÎΰè¤ò³ÎÊݤ¹¤ë

Synopsis

#include <gfarm/gfarm.h>

char *gfs_glob_init(gfs_glob_t * listp);

DESCRIPTION

¥Ñ¥¿¡¼¥ó¤Ë¥Þ¥Ã¥Á¤¹¤ë¥Ñ¥¹Ì¾¤ò¼èÆÀ¤¹¤ë´Ø¿ô gfs_glob(3)¡¢ ¥Ñ¥¹¤Î¥¿¥¤¥×¤òÄɲä¹¤ë´Ø¿ô gfs_glob_add() ¤¬¥Ñ¥¹¤Î¥¿¥¤¥×¤ò ³ÊǼ¤¹¤ë¤¿¤á¤Ë»ÈÍѤ¹¤ëÎΰè¤òưŪ¤Ë³ÎÊݤ·¡¢¤½¤Î¥¢¥É¥ì¥¹¤ò°ú¿ô listp ¤ËÀßÄꤷ¤Þ¤¹¡£

RETURN VALUES

NULL

Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£

GFARM_ERR_NO_MEMORY

¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£

¤½¤Î¾

¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£

SEE ALSO

gfs_glob(3) gfs_glob_add(3) gfs_glob_free(3)

gfarm-2.4.1/doc/html/ja/ref/man3/gfarm_url_hosts_schedule.3.html0000644000000000000000000000427411507222722023135 0ustar rootroot gfarm_url_hosts_schedule

gfarm_url_hosts_schedule

Name

gfarm_url_hosts_schedule -- gfarm ¥¿¥¹¥¯¤ò¥¹¥±¥¸¥å¡¼¥ë¤¹¤ë

Synopsis

#include <gfarm/gfarm.h>

char *gfarm_url_hosts_schedule(char * gfarm_url, char * option, int * nhostsp, char *** hostsp);

DESCRIPTION

»ØÄꤷ¤¿ Gfarm URL ¤ò¥¢¥¯¥»¥¹¤¹¤ë¥¿¥¹¥¯¤ò¼Â¹Ô¤¹¤ë¤Î¤ËŬ¤·¤¿ ¥Û¥¹¥È¤ÎÇÛÎó¤ò hostsp ¤Î»Ø¤¹Àè¤ËÊÖ¤·¤Þ¤¹¡£¥Û¥¹¥È¿ô¤Ï nhostsp ¤Î»Ø¤¹Àè¤ËÊÖ¤ê¤Þ¤¹¡£ ¤³¤³¤ÇÆÀ¤¿¥Û¥¹¥È¤ÎÇÛÎó¤Ï gfarm_strings_free_deeply() ¤òÍѤ¤¤Æ²òÊü ¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£

RETURN VALUES

NULL

Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£

GFARM_ERR_NO_MEMORY

¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£

¤½¤Î¾

¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£

NOTES

°ú¿ô option ¤Ë¤Ï¡¢¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¤Ë´Ø¤¹¤ë¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Þ¤¹¤¬¡¢ ¸½ºß¤Î¼ÂÁõ¤Ç¤Ï¡¢¤³¤Î°ú¿ô¤ÏÍøÍѤµ¤ì¤Æ¤¤¤Þ¤»¤ó¡£

gfarm-2.4.1/doc/html/ja/ref/man3/gfs_pio_set_view_index.3.html0000644000000000000000000001057111507222722022602 0ustar rootroot gfs_pio_set_view_index

gfs_pio_set_view_index

Name

gfs_pio_set_view_index -- fragment ñ°Ì¤Î¥¢¥¯¥»¥¹¤ò»ØÄꤹ¤ë

Synopsis

#include <gfarm/gfarm.h>

char *gfs_pio_set_view_index(GFS_File gf, int fragment_number, int fragment_index, char *host, int flags);

DESCRIPTION

¥Õ¥¡¥¤¥ë¤ò¥Õ¥é¥°¥á¥ó¥Èñ°Ì¤Ç¥¢¥¯¥»¥¹¤¹¤ë¤³¤È¤ò»ØÄꤷ¤Þ¤¹¡£

¿·µ¬ºîÀ®¤·¤¿¥Õ¥¡¥¤¥ë¤Î¾ì¹ç¡¢É¬¤º°ú¿ô fragment_number ¤Ë¥Õ¥é¥°¥á¥ó¥È ¤ÎÁí¿ô¤ò»ØÄꤹ¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£¤³¤ÎÃͤϡ¢¤³¤ÎÊÂÎó¥Õ¥¡¥¤¥ë¤ò³«¤¯Á´¤Æ ¤Î¥Î¡¼¥É¤Ç¡¢Æ±¤¸ÃͤǤʤ¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡£´û¸¤Î¥Õ¥¡¥¤¥ë¤Î¾ì¹ç¤Ë¤Ï¡¢ ¤³¤³¤Ë GFARM_FILE_DONTCARE ¤È½ñ¤±¤Ð¡¢»ØÄê¤ò¾Êά¤Ç¤­¤Þ¤¹¡£¤â¤· ¤â¤·¼ÂºÝ¤È°Û¤Ê¤ë¿ô¤ò»ØÄꤷ¤¿¾ì¹ç¤Ë¤Ï¡¢¤³¤Î´Ø¿ô¤Ï¥¨¥é¡¼¤Ç¼ºÇÔ¤·¤Þ¤¹¡£

°ú¿ô fragment_index ¤Ë¤Ï¡¢ ¥¢¥¯¥»¥¹¤¹¤ë¥Õ¥é¥°¥á¥ó¥È¤ÎÈÖ¹æ¤ò»ØÄꤷ¤Þ¤¹¡£

°ú¿ô host ¤Ï¡¢¥¢¥¯¥»¥¹¤·¤¿¤¤¥Û¥¹¥È¤òÌÀ¼¨Åª¤Ë»ØÄꤷ¤¿¤¤»þ¤ËÍøÍѤ·¤Þ¤¹¡£ »ØÄ꤬ÉÔÍפʤé NULL ¤òÅϤ»¤Ð¾Êά¤Ç¤­¤Þ¤¹¡£

°ú¿ô flag ¤Ë¤Ï¡¢ GFARM_FILE_SEQUENTIAL ¡¢ GFARM_FILE_REPLICATE ¡¢ GFARM_FILE_NOT_REPLICATE ¤ÎÏÀÍýϤ¬»ØÄê¤Ç¤­¤Þ¤¹¡£ ¤³¤ì¤é¤Ï¡¢²¼µ­¤ò°ÕÌ£¤·¤Þ¤¹¡£

GFARM_FILE_SEQUENTIAL

¤³¤Î¥Õ¥é¥°¥á¥ó¥È¤Ë´Ø¤·¤Æ¤Ï¥·¡¼¥±¥ó¥·¥ã¥ë¡¦¥¢¥¯¥»¥¹¤Î¤ß¤ò¹Ô¤Ê¤¦¤³¤È ¤ò¼¨¤·¤Þ¤¹¡£

GFARM_FILE_REPLICATE

¤¢¤é¤«¤¸¤á¡¢¥í¡¼¥«¥ë¡¦¥Î¡¼¥É¤Ë¥ì¥×¥ê¥«¤òÍѰդ·¤Æ¤«¤é¥¢¥¯¥»¥¹¤¹¤ë¤³¤È¤ò »ØÄꤷ¤Þ¤¹¡£GFARM_FILE_NOT_REPLICATE ¤È¤ÏÇÓ¾Ū¤Ê¥ª¥×¥·¥ç¥ó¤Ç¤¹¡£

GFARM_FILE_NOT_REPLICATE

´û¤Ë¥ì¥×¥ê¥«¤¬¤¢¤ë¾ì¹ç¤ò½ü¤­¡¢¤³¤Î¥Î¡¼¥É¤Ë¥ì¥×¥ê¥«¤òÍѰդ·¤Ê¤¤¤³¤È ¤ò»ØÄꤷ¤Þ¤¹¡£GFARM_FILE_REPLICATE ¤È¤ÏÇÓ¾Ū¤Ê¥ª¥×¥·¥ç¥ó¤Ç¤¹¡£

¤³¤Î´Ø¿ô¤ò¸Æ¤Ð¤Ê¤¤¾õÂ֤Ǥϡ¢Gfarm ¥Õ¥¡¥¤¥ë¤Ï global view ¾õÂ֤ȤʤäƤª¤ê¡¢Á´¤Æ¤Î¥Õ¥é¥°¥á¥ó¥È¤¬·ë¹ç¤µ¤ì¤¿Ã±°ì¥Õ¥¡¥¤¥ë¤Ë¸«¤¨¤Þ¤¹¡£

RETURN VALUES

NULL

Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£

GFARM_ERR_NO_MEMORY

¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£

GFARM_ERR_OPERATION_NOT_PERMITTED

»ØÄꤷ¤¿¥Ñ¥¹Ì¾¤¬¡¢¥Õ¥é¥°¥á¥ó¥È²½¥Õ¥¡¥¤¥ë¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£

GFARM_ERR_FRAGMENT_NUMBER_DOES_NOT_MATCH

»ØÄꤷ¤¿¥Õ¥é¥°¥á¥ó¥ÈÁí¿ô¤¬¡¢ÉÔŬÀڤǤ¹¡£

GFARM_ERR_INVALID_ARGUMENT

´Ø¿ô°ú¿ô¤¬ÉÔŬÀڤǤ¹¡£¤¿¤È¤¨¤Ð¡¢¥Õ¥¡¥¤¥ë¤Î¿·µ¬ºîÀ®»þ¤Ë¡¢ ¥Õ¥é¥°¥á¥ó¥ÈÁí¿ô¤È¤·¤Æ GFARM_FILE_DONTCARE ¤ò»ØÄꤹ¤ë¤È¡¢¤³¤Î¥¨¥é¡¼¤¬À¸¤¸¤Þ¤¹¡£

¤½¤Î¾

¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£

SEE ALSO

gfs_pio_create(3), gfs_pio_open(3), gfs_pio_set_view_local(3)

gfarm-2.4.1/doc/html/ja/ref/man3/gfarm_url_section_replicate_to.3.html0000644000000000000000000000540211507222722024311 0ustar rootroot gfarm_url_section_replicate_to

gfarm_url_section_replicate_to

Name

gfarm_url_section_replicate_to -- ¥Õ¥¡¥¤¥ë¥»¥¯¥·¥ç¥ó¤Î¥ì¥×¥ê¥«¤òºîÀ®¤¹¤ë

Synopsis

#include <gfarm/gfarm.h>

char *gfarm_url_section_replicate_to(const char *gfarm_url, char *section, char *dsthost);

DESCRIPTION

¥Õ¥¡¥¤¥ë gfarm_url ¤Î¥Õ¥¡¥¤¥ë¥»¥¯¥·¥ç¥ó section ¤ÎÊ£À½¤ò¡¢ dsthost ¤ËºîÀ®¤·¤Þ¤¹¡£

¥Õ¥¡¥¤¥ë¥»¥¯¥·¥ç¥ó¤È¤Ï¡¢¼Â¹Ô·Á¼°¤Î¥Õ¥¡¥¤¥ë¤Î¾ì¹ç¤Ï¥¢¡¼¥­¥Æ¥¯¥Á¥ã̾¡¢ Ä̾ï¥Õ¥¡¥¤¥ë¤Î¾ì¹ç¤Ï¥Õ¥¡¥¤¥ë¥¤¥ó¥Ç¥Ã¥¯¥¹ÈÖ¹æ¤È¤Ê¤ê¤Þ¤¹¡£ ¥Õ¥¡¥¤¥ë¥¤¥ó¥Ç¥Ã¥¯¥¹ÈÖ¹æ¤òÀ°¿ô¤Ç¤Ï¤Ê¤¯¡¢Ê¸»úÎó section ¤Ç»ØÄꤹ¤ëɬÍפ¬¤¢¤ë¤³¤È¤ËÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡£¤Þ¤¿¡¢¤Þ¤¿¤³¤Îʸ»úÎó¤Ï¡¢ ;ʬ¤Ê¶õÇò¤ä¡¢Àè¹Ô 0 ¤ò´Þ¤ó¤Ç¤Ï¤¤¤±¤Þ¤»¤ó¡£

RETURN VALUES

NULL

Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£

GFARM_ERR_NO_MEMORY

¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£

GFARM_ERR_NO_SUCH_OBJECT

»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Þ¤»¤ó¡£

GFARM_ERR_TEXT_FILE_BUSY

»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤¬¸½ºß¡Ê¾¤Î¥×¥í¥»¥¹¤Ë¤è¤ê¡Ë¹¹¿·Ãæ¤Î¤¿¤á¡¢ ¥Õ¥¡¥¤¥ë¤ÎÊ£À½¤¬ºîÀ®¤Ç¤­¤Þ¤»¤ó¡£

¤½¤Î¾

¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£

SEE ALSO

gfarm_url_section_replicate_from_to(3), gfarm_url_fragments_replicate(3)

gfarm-2.4.1/doc/html/ja/ref/man3/gfs_chdir.3.html0000644000000000000000000000410511507222722020004 0ustar rootroot gfs_chdir

gfs_chdir

Name

gfs_chdir -- ºî¶È¥Ç¥£¥ì¥¯¥È¥ê¤ÎÊѹ¹

Synopsis

#include <gfarm/gfarm.h>

char *gfs_chdir(const char * gfarm_url);

DESCRIPTION

ºî¶È¥Ç¥£¥ì¥¯¥È¥ê¤ò°ú¿ô gfarm_url ¤Ë»ØÄꤷ¤¿¥Ç¥£¥ì¥¯¥È¥ê¤ËÊѹ¹¤·¤Þ¤¹¡£

RETURN VALUES

NULL

Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£

GFARM_ERR_NO_MEMORY

¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£

GFARM_ERR_AUTHENTICATION

gfmd(8) ¤ËÂФ¹¤ë¥æ¡¼¥¶¡¼Ç§¾Ú¤¬¼ºÇÔ¤·¤Þ¤·¤¿¡£

GFARM_ERR_PERMISSION_DENIED

»ØÄꤷ¤¿¥Ç¥£¥ì¥¯¥È¥ê¤ËÊѹ¹¤¹¤ë¸¢¸Â¤¬¤¢¤ê¤Þ¤»¤ó¡£

GFARM_ERR_NO_SUCH_OBJECT

»ØÄꤵ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¤¬Â¸ºß¤·¤Þ¤»¤ó¡£

GFARM_ERR_NOT_A_DIRECTORY

»ØÄꤷ¤¿¥Ñ¥¹Ì¾¤Î¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤¬¡¢¼ÂºÝ¤Ë¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤«¤Ã¤¿¤³¤È¤ò ¼¨¤·¤Þ¤¹¡£

¤½¤Î¾

¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£

gfarm-2.4.1/doc/html/ja/ref/man3/gfs_pio_truncate.3.html0000644000000000000000000000461511507222722021415 0ustar rootroot gfs_pio_truncate

gfs_pio_truncate

Name

gfs_pio_truncate -- »ØÄꤷ¤¿Ä¹¤µ¤Ë¥Õ¥¡¥¤¥ëÀÚ¤êµÍ¤á¤ë¡£¤â¤·¤¯¤Ï³ÈÄ¥¤¹¤ë¡£

Synopsis

#include <gfarm/gfarm.h>

char *gfs_pio_truncate(GFS_File gf, file_offset_t length);

DESCRIPTION

¥Õ¥¡¥¤¥ë gf ¤ÎŤµ¤òÊѹ¹¤·¤Þ¤¹¡£

°ú¿ô length ¤¬¥Õ¥¡¥¤¥ë gf ¤è¤ê¤âû¤«¤±¤ì¤ÐÀÚ¤êµÍ¤á¤Þ¤¹¡£

°ú¿ô length ¤¬¥Õ¥¡¥¤¥ë gf ¤è¤ê¤âŤ±¤ì¤Ð³ÈÄ¥¤·¤Þ¤¹¡£³ÈÄ¥¤µ¤ì¤¿Éôʬ¤òÆÉ¤ó¤À¾ì¹ç¤Ï¥¼¥í¤òÊÖ¤·¤Þ¤¹¡£

¥Õ¥¡¥¤¥ë¥Ý¥¤¥ó¥¿¤ÏÊѹ¹¤·¤Þ¤»¤ó¡£

¥Õ¥¡¥¤¥ë¤Ï½ñ¤­¹þ¤ßÍѤ˥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£ ¤³¤Î¤¿¤á¡¢¥ª¡¼¥×¥ó»þ¤Ë GFS_FILE_MODE_WRITE ¥Õ¥é¥°¤ò»ØÄꤹ¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£

RETURN VALUES

NULL

Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£

GFARM_ERR_NO_MEMORY

¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£

¤½¤Î¾

¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£

SEE ALSO

gfs_pio_create(3), gfs_pio_open(3)

gfarm-2.4.1/doc/html/ja/ref/man3/gfarm_url_section_replicate_from_to.3.html0000644000000000000000000000603611507222722025340 0ustar rootroot gfarm_url_section_replicate_from_to

gfarm_url_section_replicate_from_to

Name

gfarm_url_section_replicate_from_to -- ¥Õ¥¡¥¤¥ë¥»¥¯¥·¥ç¥ó¤Î¥ì¥×¥ê¥«¤òºîÀ®¤¹¤ë

Synopsis

#include <gfarm/gfarm.h>

char *gfarm_url_section_replicate_from_to(const char *gfarm_url, char *section, char *srchost, char *dsthost);

DESCRIPTION

¥Õ¥¡¥¤¥ë gfarm_url ¤Î¥Õ¥¡¥¤¥ë¥»¥¯¥·¥ç¥ó section ¤ÎÊ£À½¤ò¡¢ srchost¤«¤é dsthost ¤ËºîÀ®¤·¤Þ¤¹¡£

¥Õ¥¡¥¤¥ë¥»¥¯¥·¥ç¥ó¤È¤Ï¡¢¼Â¹Ô·Á¼°¤Î¥Õ¥¡¥¤¥ë¤Î¾ì¹ç¤Ï¥¢¡¼¥­¥Æ¥¯¥Á¥ã̾¡¢ Ä̾ï¥Õ¥¡¥¤¥ë¤Î¾ì¹ç¤Ï¥Õ¥¡¥¤¥ë¥¤¥ó¥Ç¥Ã¥¯¥¹ÈÖ¹æ¤È¤Ê¤ê¤Þ¤¹¡£ ¥Õ¥¡¥¤¥ë¥¤¥ó¥Ç¥Ã¥¯¥¹ÈÖ¹æ¤òÀ°¿ô¤Ç¤Ï¤Ê¤¯¡¢Ê¸»úÎó section ¤Ç»ØÄꤹ¤ëɬÍפ¬¤¢¤ë¤³¤È¤ËÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡£¤Þ¤¿¡¢¤Þ¤¿¤³¤Îʸ»úÎó¤Ï¡¢ ;ʬ¤Ê¶õÇò¤ä¡¢Àè¹Ô 0 ¤ò´Þ¤ó¤Ç¤Ï¤¤¤±¤Þ¤»¤ó¡£

»ØÄꤷ¤¿ srchost ¤Ë¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï¥¨¥é¡¼¤Ë¤Ê¤ê¤Þ¤¹¡£

RETURN VALUES

NULL

Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£

GFARM_ERR_NO_MEMORY

¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£

GFARM_ERR_NO_SUCH_OBJECT

»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¡¢ ¤¢¤ë¤¤¤ÏÊ£À½ºîÀ®¸µ¤Î¥Û¥¹¥È¤Ë¥Õ¥¡¥¤¥ë¤ÎÊ£À½¤¬Â¸ºß¤·¤Þ¤»¤ó¡£

GFARM_ERR_TEXT_FILE_BUSY

»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤¬¸½ºß¡Ê¾¤Î¥×¥í¥»¥¹¤Ë¤è¤ê¡Ë¹¹¿·Ãæ¤Î¤¿¤á¡¢ ¥Õ¥¡¥¤¥ë¤ÎÊ£À½¤¬ºîÀ®¤Ç¤­¤Þ¤»¤ó¡£

¤½¤Î¾

¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£

SEE ALSO

gfarm_url_section_replicate_to(3), gfarm_url_fragments_replicate(3)

gfarm-2.4.1/doc/html/ja/ref/man3/gfs_pio_gets.3.html0000644000000000000000000001010211507222722020516 0ustar rootroot gfs_pio_gets

gfs_pio_gets

Name

gfs_pio_gets -- °ì¹ÔÆÉ¤ß¹þ¤ß

Synopsis

#include <gfarm/gfarm.h>

char *gfs_pio_gets(GFS_File f, char * s, size_t size);

DESCRIPTION

¥Õ¥¡¥¤¥ë gf ¤«¤é¡¢Ê¸»úÎó s ¤Ë¡¢°ì¹ÔÆÉ¤ß¹þ¤ß¤Þ¤¹¡£ °ú¿ô size ¤Ëʸ»úÇÛÎó s ¤ÎÂ礭¤µ¤ò»ØÄꤷ¤Þ¤¹¡£

´Ø¿ô gfs_pio_getline(3) ¤È°Û¤Ê¤ê¡¢¤³¤Î´Ø¿ô¤Ï¹ÔËö¤Î²þ¹Ôµ­¹æ¤òºï½ü ¤·¤Þ¤»¤ó¡£°ì¹Ô¤ÎÆâÍÆ¤òʸ»úÇÛÎó¤ËǼ¤á¤­¤ì¤Ê¤¤¾ì¹ç¡¢¤¢¤ë¤¤¤Ï¥Õ¥¡¥¤¥ë ËöÈø¤Ë²þ¹Ôµ­¹æ¤¬Â¸ºß¤·¤Ê¤¤¾ì¹ç¡¢ÆþÎÏ·ë²Ì¤Îʸ»úÇÛÎó¤ÎËöÈø¤Ë²þ¹Ôµ­¹æ ¤¬¤Ä¤­¤Þ¤»¤ó¡£¤·¤«¤·Ê¸»úÎó¤Î½ª¤ï¤ê¤ò¼¨¤¹ '\0' ʸ»ú¤Ï¡¢¤É¤Á¤é¤Î¾ì¹ç ¤Ç¤âÉղ䵤ì¤Þ¤¹¡£

EOF ¤Ï¡¢ÆþÎÏ·ë²Ì¤Îʸ»úÇÛÎó¤ÎŤµ¤¬ 0 ʸ»ú¤Ç¤¢¤ë¤³¤È¤ÇȽÃǤ·¤Þ¤¹¡£

RETURN VALUES

NULL

Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£

GFARM_ERR_NO_MEMORY

¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£

¤½¤Î¾

¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£

EXAMPLES

Example 1. gfs_pio_gets ´Ø¿ô¤Î»ÈÍÑÎã

#include <stdio.h>
#include <stdlib.h>
#include <gfarm/gfarm.h>

int
main(int argc, char **argv)
{
	char *e;
	GFS_File gf;
	char buffer[512];

	e = gfarm_initialize(&argc, &argv);
	if (e != NULL) {
		fprintf(stderr, "gfarm_initialize: %s\n", e);
		return (EXIT_FAILURE);
	}
	if (argc <= 1) {
		fprintf(stderr, "missing gfarm filename\n");
		return (EXIT_FAILURE);
	}
	e = gfs_pio_open(argv[1], GFARM_FILE_RDONLY, &gf);
	if (e != NULL) {
		fprintf(stderr, "%s: %s\n", argv[1], e);
		return (EXIT_FAILURE);
	}
	e = gfs_pio_set_view_global(gf, 0);
	if (e != NULL) {
		fprintf(stderr, "%s: gfs_pio_set_view_global: %s\n",
		    argv[1], e);
		return (EXIT_FAILURE);
	}

	while ((e = gfs_pio_gets(gf, buffer, sizeof buffer)) != NULL &&
	    *buffer != '\0') {
		printf("got: %s", buffer);
	}
	if (e != NULL) {
		fprintf(stderr, "ERROR: %s\n", e);
		return (EXIT_FAILURE);
	}
	e = gfs_pio_close(gf);
	if (e != NULL) {
		fprintf(stderr, "gfs_pio_close: %s\n", e);
		return (EXIT_FAILURE);
	}
	e = gfarm_terminate();
	if (e != NULL) {
		fprintf(stderr, "gfarm_initialize: %s\n", e);
		return (EXIT_FAILURE);
	}
	return (EXIT_SUCCESS);
}

SEE ALSO

gfs_pio_open(3), gfs_pio_getline(3), gfs_pio_readline(3), gfs_pio_readdelim(3)

gfarm-2.4.1/doc/html/ja/ref/man3/gfs_glob_free.3.html0000644000000000000000000000272311507222722020643 0ustar rootroot gfs_glob_free

gfs_glob_free

Name

gfs_glob_free -- ¥Ñ¥¹¤Î¥¿¥¤¥×¤ò³ÊǼ¤·¤Æ¤¤¤ëÎΰè¤ò²òÊü¤¹¤ë

Synopsis

#include <gfarm/gfarm.h>

char *gfs_glob_free(gfs_glob_t * listp);

DESCRIPTION

¥Ñ¥¹¤Î¥¿¥¤¥×¤ò³ÊǼ¤¹¤ë¤¿¤á¤ËưŪ¤Ë³ÎÊݤ·¤¿Îΰè¤ò²òÊü¤·¤Þ¤¹¡£

SEE ALSO

gfs_glob_init(3) gfs_glob(3) gfs_glob_add(3)

gfarm-2.4.1/doc/html/ja/ref/man3/gfs_opendir.3.html0000644000000000000000000000436311507222722020361 0ustar rootroot gfs_opendir

gfs_opendir

Name

gfs_opendir -- ¥Ç¥£¥ì¥¯¥È¥ê¤Î¥ª¡¼¥×¥ó

Synopsis

#include <gfarm/gfarm.h>

char *gfs_opendir(const char * gfarm_url, GFS_Dir * dirp);

DESCRIPTION

gfarm_url ¤Ç»ØÄꤷ¤¿¥Ç¥£¥ì¥¯¥È¥ê¤ò¥ª¡¼¥×¥ó¤·¤Þ¤¹¡£

RETURN VALUES

NULL

Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£

GFARM_ERR_NO_MEMORY

¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£

GFARM_ERR_AUTHENTICATION

gfmd(8) ¤ËÂФ¹¤ë¥æ¡¼¥¶¡¼Ç§¾Ú¤¬¼ºÇÔ¤·¤Þ¤·¤¿¡£

GFARM_ERR_PERMISSION_DENIED

gfarm_url ¤Ø¥¢¥¯¥»¥¹¤¹¤ë¸¢¸Â¤¬¡¢¤¢¤ê¤Þ¤»¤ó¡£

GFARM_ERR_NO_SUCH_OBJECT

»ØÄꤵ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¤¬Â¸ºß¤·¤Þ¤»¤ó¡£

¤½¤Î¾

¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£

SEE ALSO

gfs_closedir(3), gfs_readdir(3)

gfarm-2.4.1/doc/html/ja/ref/man3/gfs_pio_readline.3.html0000644000000000000000000001255611507222722021356 0ustar rootroot gfs_pio_readline

gfs_pio_readline

Name

gfs_pio_readline -- °ì¹ÔÆÉ¤ß¹þ¤ß

Synopsis

#include <gfarm/gfarm.h>

char *gfs_pio_readline(GFS_File f, char **bufp, size_t *sizep, size_t *lenp);

DESCRIPTION

¥Õ¥¡¥¤¥ë gf ¤«¤é¡¢°ì¹ÔÆÉ¤ß¹þ¤ß¤Þ¤¹¡£

°ú¿ô bufp ¤Ï¡¢ºÇ½é¤Ï NULL ¤Ç½é´ü²½¤µ¤ì¤¿¥Ý¥¤¥ó¥¿ÊÑ¿ô¤Î¥¢¥É¥ì¥¹¤ò»ØÄꤷ¤Þ¤¹¡£ ´Ø¿ô gfs_pio_readline() ¤Ï¡¢Æþ½ÐÎϤËÍѤ¤¤ë ¥Ð¥Ã¥Õ¥¡¤òưŪ¤Ë³ä¤êÅö¤Æ¡¢¤½¤Î¥¢¥É¥ì¥¹¤ò¤³¤Î¥Ý¥¤¥ó¥¿ÊÑ¿ô¤Ëµ­Ï¿¤·¤Þ¤¹¡£ °ú¿ô sizep ¤Ï¡¢0 ¤Ç½é´ü²½¤·¤¿ size_t ·¿¤ÎÊÑ¿ô ¤Î¥¢¥É¥ì¥¹¤ò»ØÄꤷ¤Þ¤¹¡£¤³¤ÎÊÑ¿ô¤Ï¡¢¥Ð¥Ã¥Õ¥¡¤Î¥µ¥¤¥º¤òµ­Ï¿¤¹¤ë¤¿¤á¤Ë »È¤ï¤ì¤Þ¤¹¡£ ¤¢¤ë¤¤¤Ï¡¢malloc(3) ¤Ç³ä¤êÅö¤Æ¤¿¥Ð¥Ã¥Õ¥¡¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Î¥¢¥É¥ì¥¹¤ò °ú¿ô bufp ¤Ë»ØÄꤹ¤ë¤³¤È¤â¤Ç¤­¤Þ¤¹¡£¤³¤Î¾ì¹ç¡¢ °ú¿ô sizep ¤Ï¡¢³ä¤êÅö¤Æ¤¿¥Ð¥Ã¥Õ¥¡¤Î¥µ¥¤¥º¤Ç½é´ü²½¤·¤Æ¤ª¤­¤Þ¤¹¡£ ¹Ô¤ÎŤµ¤¬¥Ð¥Ã¥Õ¥¡¤Î¥µ¥¤¥º¤ò±Û¤¨¤ë¾ì¹ç¤Ë¤Ï¡¢¥Ð¥Ã¥Õ¥¡¤Ï¼«Æ°Åª¤Ë realloc(3) ¤µ¤ì¡¢ °ú¿ô bufp ¤ª¤è¤Ó °ú¿ô sizep ¤Ç»ØÄꤵ¤ì¤¿ÊÑ¿ô¤â¤½¤ì¤Ë½¾¤Ã¤Æ¹¹¿·¤µ¤ì¤Þ¤¹¡£ ¥Õ¥¡¥¤¥ë¤òÆÉ¤ß½ª¤ï¤Ã¤¿¤é¡¢¤³¤Î¥Ý¥¤¥ó¥¿¤ò free(3) ¤Ç²òÊü¤¹¤ëɬÍפ¬ ¤¢¤ê¤Þ¤¹¡£

°ú¿ô lenp ¤Î»Ø¤¹ÊÑ¿ô¤Ë¤Ï¡¢ÆÉ¤ß¹þ¤ó¤ÀŤµ¤òÊÖ¤·¤Þ¤¹¡£ ¤³¤ÎŤµ¤Ë¤Ï¡¢¹ÔËöµ­¹æ¤Îʬ¤â´Þ¤ß¤Þ¤¹¡£

´Ø¿ô gfs_pio_gets(3) ¤ÈƱÍÍ¡¢¤³¤Î´Ø¿ô¤Ï¹ÔËö¤Î²þ¹Ôµ­¹æ¤òºï½ü¤·¤Þ¤»¤ó¡£ ¤Þ¤¿¡¢Ê¸»úÎó¤Î½ª¤ï¤ê¤ò¼¨¤¹ '\0' ʸ»ú¤ò¡¢¾ï¤ËÉղä·¤Þ¤¹¡£ ¤Þ¤¿¡¢ °ú¿ô lenp ¤Î»Ø¤¹ÊÑ¿ô¤ËÊ֤ä¿Ãͤò»È¤¨¤Ð¡¢Ê¸»ú '\0' ¤ò´Þ¤à¹Ô¤ò°·¤¦¤³¤È¤â¤Ç¤­¤Þ¤¹¡£

EOF ¤Ï¡¢ÆþÎϤÎŤµ¤¬ 0 ʸ»ú¤Ç¤¢¤ë¤³¤È¤ÇȽÃǤ·¤Þ¤¹¡£

¤³¤Î´Ø¿ô¤Ï¡¢gfs_pio_readdelim(f, bufp, sizep, lenp, "\n", 1) ¤È Åù²Á¤Ç¤¹¡£

RETURN VALUES

NULL

Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£

GFARM_ERR_NO_MEMORY

¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£

¤³¤Î¾ì¹ç¤â¡¢bufp ¤Î»Ø¤¹¥Ý¥¤¥ó¥¿ÊÑ¿ô¤Î »Ø¤¹Îΰè¤ò free(3) ¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¤«¤éÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡£

¤½¤Î¾

¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£

EXAMPLES

Example 1. gfs_pio_readline ´Ø¿ô¤Î»ÈÍÑÎã

#include <stdio.h>
#include <stdlib.h>
#include <gfarm/gfarm.h>

int
main(int argc, char **argv)
{
	char *e;
	GFS_File gf;
	size_t bufsize = 0, len;
	char *buffer = NULL;

	e = gfarm_initialize(&argc, &argv);
	if (e != NULL) {
		fprintf(stderr, "gfarm_initialize: %s\n", e);
		return (EXIT_FAILURE);
	}
	if (argc <= 1) {
		fprintf(stderr, "missing gfarm filename\n");
		return (EXIT_FAILURE);
	}
	e = gfs_pio_open(argv[1], GFARM_FILE_RDONLY, &gf);
	if (e != NULL) {
		fprintf(stderr, "%s: %s\n", argv[1], e);
		return (EXIT_FAILURE);
	}
	e = gfs_pio_set_view_global(gf, 0);
	if (e != NULL) {
		fprintf(stderr, "%s: gfs_pio_set_view_global: %s\n",
		    argv[1], e);
		return (EXIT_FAILURE);
	}

	while ((e = gfs_pio_readline(gf, &buffer, &bufsize, &len))
	    == NULL && len > 0) {
		printf("<%6d/%6d >%s", len, bufsize, buffer);
	}
	if (buffer != NULL)
		free(buffer);
	if (e != NULL) {
		fprintf(stderr, "ERROR: %s\n", e);
		return (EXIT_FAILURE);
	}
	e = gfs_pio_close(gf);
	if (e != NULL) {
		fprintf(stderr, "gfs_pio_close: %s\n", e);
		return (EXIT_FAILURE);
	}
	e = gfarm_terminate();
	if (e != NULL) {
		fprintf(stderr, "gfarm_initialize: %s\n", e);
		return (EXIT_FAILURE);
	}
	return (EXIT_SUCCESS);
}

SEE ALSO

gfs_pio_open(3), gfs_pio_getline(3), gfs_pio_gets(3), gfs_pio_readdelim(3)

gfarm-2.4.1/doc/html/ja/ref/man3/gfs_stat.3.html0000644000000000000000000000476411507222722017701 0ustar rootroot gfs_stat

gfs_stat

Name

gfs_stat -- ¥Õ¥¡¥¤¥ë°À­¼èÆÀ

Synopsis

#include <gfarm/gfarm.h>

char *gfs_stat(const char * gfarm_url, struct gfs_stat * status);

DESCRIPTION

°ú¿ô gfarm_url ¤Î¥Õ¥¡¥¤¥ë°À­¤ò status ¤Î»Ø¤¹Àè¤Ë¼èÆÀ¤·¤Þ¤¹¡£ status

¤Ë¤Ï¡¢Æ°Åª¤Ë³ÎÊݤµ¤ì¤¿¥á¥â¥ê¤Ø¤Î¥Ý¥¤¥ó¥¿¤¬´Þ¤Þ¤ì¤ë¤Î¤Ç¡¢ ¤³¤Î¸å¡¢gfs_stat_free(3) ¤ò»È¤Ã¤Æ¤½¤Î¥á¥â¥ê¤ò²òÊü¤¹¤ëɬÍפ¬ ¤¢¤ê¤Þ¤¹¡£

RETURN VALUES

NULL

Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£

GFARM_ERR_NO_MEMORY

¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£

GFARM_ERR_AUTHENTICATION

gfmd(8) ¤ËÂФ¹¤ë¥æ¡¼¥¶¡¼Ç§¾Ú¤¬¼ºÇÔ¤·¤Þ¤·¤¿¡£

GFARM_ERR_PERMISSION_DENIED

»ØÄꤵ¤ì¤¿¥Ñ¥¹¤Ø¥¢¥¯¥»¥¹¤¹¤ë¸¢¸Â¤¬¡¢¤¢¤ê¤Þ¤»¤ó¡£

GFARM_ERR_NO_SUCH_OBJECT

»ØÄꤵ¤ì¤¿¥Ñ¥¹Ì¾¤¬Â¸ºß¤·¤Þ¤»¤ó¡£

GFARM_ERR_NOT_A_DIRECTORY

»ØÄꤷ¤¿¥Ñ¥¹Ì¾¤Î¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤¬¡¢¼ÂºÝ¤Ë¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤«¤Ã¤¿¤³¤È¤ò ¼¨¤·¤Þ¤¹¡£

¤½¤Î¾

¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£

SEE ALSO

gfs_stat_free(3)

gfarm-2.4.1/doc/html/ja/ref/man3/gfs_pio_write.3.html0000644000000000000000000000605011507222722020715 0ustar rootroot gfs_pio_write

gfs_pio_write

Name

gfs_pio_write -- ¥Õ¥¡¥¤¥ë¤Î½ñ¤­¹þ¤ß

Synopsis

#include <gfarm/gfarm.h>

gfarm_error_t gfs_pio_write(GFS_File gf, const void * buffer, int size, int * np);

DESCRIPTION

buffer¤«¤é size ¥Ð¥¤¥È¤À¤±¡¢¥Õ¥¡¥¤¥ë gf ¤Ø½ñ¤­¹þ¤ß¤Þ¤¹¡£ ¼ÂºÝ¤Ë½ñ¤­¹þ¤Þ¤ì¤¿¥Ð¥¤¥È¿ô¤Ï np ¤Î»Ø¤¹Àè¤ËÊÖ¤·¤Þ¤¹¡£

RETURN VALUES

GFARM_ERR_NO_ERROR

Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£

GFARM_ERR_OPERATION_NOT_PERMITTED

gf ¤Ç»ØÄꤵ¤ì¤ë¥Õ¥¡¥¤¥ë¤¬¥ì¥®¥å¥é¡¼¥Õ¥¡¥¤¥ë¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£

GFARM_ERR_BAD_FILE_DESCRIPTOR

gf ¤Ç»ØÄꤵ¤ì¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬ÉÔÀµ¡¢ ¤¢¤ë¤¤¤Ï½ñ¹þ²Äǽ¤Ç¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£

GFARM_ERR_NO_SPACE

½ñ¤­¹þ¤ß¥¹¥Ú¡¼¥¹¤¬¤¢¤ê¤Þ¤»¤ó¡£

GFARM_ERR_NO_FILE_SYSTEM_NODE

ÍøÍѲÄǽ¤Ê¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤¬¤¢¤ê¤Þ¤»¤ó¡£

GFARM_ERR_NO_MEMORY

¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£

¤½¤Î¾

¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ gfarm_error_string(3) ¤Ë¤è¤ê¥¨¥é¡¼¤Î¸¶°ø¤òʸ»úÎó¤ËÊÑ´¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£

SEE ALSO

gfs_pio_create(3), gfs_pio_flush(3), gfs_pio_open(3)

gfarm-2.4.1/doc/html/ja/ref/man3/gfs_pio_seek.3.html0000644000000000000000000000467511507222722020525 0ustar rootroot gfs_pio_seek

gfs_pio_seek

Name

gfs_pio_seek -- »ØÄꤷ¤¿°ÌÃ֤˥·¡¼¥¯¤¹¤ë

Synopsis

#include <gfarm/gfarm.h>

char * gfs_pio_seek(GFS_File gf, file_offset_t offset, int whence, file_offset_t * result);

DESCRIPTION

¥Õ¥¡¥¤¥ë gf ¤ò¡¢ whence ¤È offset ¤Ç»ØÄꤷ¤¿°ÌÃ֤˥·¡¼¥¯¤·¤Þ¤¹¡£ °ú¿ô offset ¤Ï¡¢ whence ¤¬ 0 ¤Î¾ì¹ç¤Ë¤Ï¥Õ¥¡¥¤¥ëÀèÆ¬¤«¤é¡¢ 1 ¤Î¾ì¹ç¤Ë¤Ï¸½ºß¤Î¥·¡¼¥¯°ÌÃÖ¤«¤é¡¢ 2 ¤Î¾ì¹ç¤Ë¤Ï¥Õ¥¡¥¤¥ëËöÈø¤«¤é¤Î¥ª¥Õ¥»¥Ã¥È¤Ç¤¹¡£

°ú¿ô result ¤¬ NULL ¤Ç¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢°Üư¸å¤Î°ÌÃÖ¤ò result ¤Î»Ø¤¹Àè¤ËÊÖ¤·¤Þ¤¹¡£

RETURN VALUES

NULL

Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£

GFARM_ERR_NO_MEMORY

¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£

¤½¤Î¾

¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£

SEE ALSO

gfs_pio_create(3), gfs_pio_open(3)

gfarm-2.4.1/doc/html/ja/ref/man3/gfarm_stringlist_length.3.html0000644000000000000000000000423711507222722023001 0ustar rootroot gfarm_stringlist_length

gfarm_stringlist_length

Name

gfarm_stringlist_length -- stringlist ¤Îʸ»úÎó¿ô¤òÊÖ¤¹

Synopsis

#include <gfarm/gfarm.h>

int gfarm_stringlist_length(gfarm_stringlist * listp);

DESCRIPTION

listp ¤Îɽ¤¹Ê¸»úÎóÇÛÎó¤ÎÇÛÎóÍ×ÁÇ¿ô¤òÊÖ¤·¤Þ¤¹¡£

RETURN VALUES

ʸ»úÎó¤Î¿ô¤òÊÖ¤·¤Þ¤¹¡£

SEE ALSO

GFARM_STRINGLIST_ELEM(3), GFARM_STRINGLIST_STRARRAY(3), gfarm_stringlist_add(3), gfarm_stringlist_cat(3), gfarm_stringlist_elem(3), gfarm_stringlist_free(3), gfarm_stringlist_free_deeply(3), gfarm_stringlist_init(3)

gfarm-2.4.1/doc/html/ja/ref/man3/gfarm_url_program_deliver.3.html0000644000000000000000000000515611507222722023302 0ustar rootroot gfarm_url_program_deliver

gfarm_url_program_deliver

Name

gfarm_url_program_deliver -- ¥×¥í¥°¥é¥à¤ò»ØÄꤷ¤¿¥Û¥¹¥È¤ËÇÛÉÛ¤¹¤ë

Synopsis

#include <gfarm/gfarm.h>

char *gfarm_url_program_deliver(char *gfarm_url, int nhosts, char **hosts, char ***delivered_paths);

DESCRIPTION

gfarm_url¤Ç»ØÄꤷ¤¿¥×¥í¥°¥é¥à¤ò¡¢ nhosts ¸Ä¤ÎÍ×ÁǤò»ý¤Äʸ»úÎóÇÛÎó hosts ¤Ç»ØÄꤷ¤¿¥Û¥¹¥È¤ËÇÛÉÛ¤·¤Þ¤¹¡£ ÇÛÉÛ¤µ¤ì¤¿³Æ¥Û¥¹¥È¾å¤Ç¤Î¥×¥í¥°¥é¥à¤ÎÀäÂХѥ¹¤ò¡¢ nhosts ¸Ä¤ÎÍ×ÁǤò»ý¤Äʸ»úÎóÇÛÎó¤Ë³ÊǼ¤·¡¢¤½¤ÎÇÛÎó¤Î¥¢¥É¥ì¥¹¤ò delivered_paths ¤¬»Ø¤¹Àè¤ËÊÖ¤·¤Þ¤¹¡£ delivered_paths

¤ËÆÀ¤¿Ê¸»úÎóÇÛÎó¤Ï¡¢ÉÔÍפˤʤ俤é gfarm_strings_free_deeply(3) ¤Ç²òÊü¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£

RETURN VALUES

NULL

Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£

GFARM_ERR_NO_MEMORY

¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£

¤½¤Î¾

¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£

SEE ALSO

gfarm_url_program_deliver(3), gfarm_strings_free_deeply(3)

gfarm-2.4.1/doc/html/ja/ref/man3/gfs_pio_getc.3.html0000644000000000000000000000411311507222722020503 0ustar rootroot gfs_pio_getc

gfs_pio_getc

Name

gfs_pio_getc -- °ìʸ»úÆÉ¤ß¹þ¤ß

Synopsis

#include <gfarm/gfarm.h>

int gfs_pio_getc(GFS_File gf);

DESCRIPTION

¥Õ¥¡¥¤¥ë gf ¤«¤é°ìʸ»úÆÉ¤ß¹þ¤ß¤Þ¤¹¡£

RETURN VALUES

EOF

¥Õ¥¡¥¤¥ë¤ÎËöÈø¤Ë㤷¤¿¾ì¹ç¡¢¤¢¤ë¤¤¤Ï¥¨¥é¡¼¤¬À¸¤¸¤¿¾ì¹ç¡¢<stdio.h> ¤Ç ÄêµÁ¤µ¤ì¤Æ¤¤¤ëÄê¿ô EOF ¤òÊÖ¤·¤Þ¤¹¡£ ¥Õ¥¡¥¤¥ëËöÈø¤Ê¤Î¤«¡¢¥¨¥é¡¼¤Ê¤Î¤«¤Ï¡¢´Ø¿ô gfs_pio_error(3) ¤ÇÃÎ¤ë ¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£

¤½¤Î¾

¥Õ¥¡¥¤¥ë¤«¤éÆÉ¤ß¹þ¤ó¤Àʸ»ú¤òÊÖ¤·¤Þ¤¹¡£

SEE ALSO

gfs_pio_create(3), gfs_pio_eof(3), gfs_pio_error(3), gfs_pio_open(3), gfs_pio_ungetc(3)

gfarm-2.4.1/doc/html/ja/ref/man3/gfarm_stringlist_elem.3.html0000644000000000000000000000433711507222722022443 0ustar rootroot gfarm_stringlist_elem

gfarm_stringlist_elem

Name

gfarm_stringlist_elem -- stringlist ¤ÎÍ×ÁÇʸ»ú¤òÊÖ¤¹

Synopsis

#include <gfarm/gfarm.h>

intgfarm_stringlist_elem(gfarm_stringlist * listp, int i);

DESCRIPTION

listp¤Î i ÈÖÌܤÎÇÛÎóÍ×ÁǤòÊÖ¤·¤Þ¤¹¡£

RETURN VALUES

ʸ»úÎóÇÛÎó¤ÎÍ×ÁǤǤ¹¡£

SEE ALSO

GFARM_STRINGLIST_ELEM(3), GFARM_STRINGLIST_STRARRAY(3), gfarm_stringlist_add(3), gfarm_stringlist_cat(3), gfarm_stringlist_free(3), gfarm_stringlist_free_deeply(3), gfarm_stringlist_init(3), gfarm_stringlist_length(3)

gfarm-2.4.1/doc/html/ja/ref/man3/gfs_realpath.3.html0000644000000000000000000000472511507222722020523 0ustar rootroot gfs_realpath

gfs_realpath

Name

gfs_realpath -- Àµµ¬²½¤µ¤ì¤¿ÀäÂХѥ¹Ì¾¤òÊÖ¤¹

Synopsis

#include <gfarm/gfarm.h>

char *gfs_realpath(const char * gfarm_url, char ** resolved_pathp);

DESCRIPTION

gfs_realpath ¤Ï¡¤ gfarm_url ¤ÇÍ¿¤¨¤é¤ì¤¿¥Ñ¥¹Ì¾¤Î¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê¤òŸ³«¤·¡¤ '.'¡¤'..' ¤ä;ʬ¤Ê '/' ¤ò²ò·è¤·¤Æ¡¤ Àµµ¬²½¤µ¤ì¤¿ÀäÂХѥ¹Ì¾¤òưŪ¤Ë³ÎÊݤµ¤ì¤ë¥á¥â¥ê¤Ë³ÊǼ¤·¤Þ¤¹¡¥ ưŪ¤Ë³ÎÊݤµ¤ì¤¿¥á¥â¥ê¤Î¥Ý¥¤¥ó¥¿¤Ï resolved_pathp ¤ËÊÖ¤µ¤ì¤Þ¤¹¡¥ ¤³¤Î¥á¥â¥êÎΰè¤Ï¤³¤Î¸å free(3) ¤Ë¤è¤ê³«Êü¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡¥

RETURN VALUES

NULL

Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡¥

GFARM_ERR_NO_MEMORY

¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡¥

GFARM_ERR_NOT_A_DIRECTORY

»ØÄꤷ¤¿¥Ñ¥¹Ì¾¤Î¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤¬¡¢¼ÂºÝ¤Ë¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤«¤Ã¤¿ ¤³¤È¤ò¼¨¤·¤Þ¤¹¡¥

GFARM_ERR_INVALID_ARGUMENT

gfarm_url ¤¬ NULL ¥Ý¥¤¥ó¥¿¤Ç¤¹¡¥

GFARM_ERR_PERMISSION_DENIED

»ØÄꤵ¤ì¤¿¥Ñ¥¹¤Ø¥¢¥¯¥»¥¹¤¹¤ë¸¢¸Â¤¬¤¢¤ê¤Þ¤»¤ó¡¥

GFARM_ERR_NO_SUCH_OBJECT

»ØÄꤵ¤ì¤¿¥Ñ¥¹Ì¾¤¬Â¸ºß¤·¤Þ¤»¤ó¡¥

¤½¤Î¾

¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡¥

gfarm-2.4.1/doc/html/ja/ref/man3/gfs_pio_ungetc.3.html0000644000000000000000000000412711507222722021053 0ustar rootroot gfs_pio_ungetc

gfs_pio_ungetc

Name

gfs_pio_ungetc -- ÆÉ¤ß¹þ¤ó¤Àʸ»ú¤òÌ᤹

Synopsis

#include <gfarm/gfarm.h>

int gfs_pio_ungetc(GFS_File gf, int c);

DESCRIPTION

¥Õ¥¡¥¤¥ë gf ¤«¤éÆÉ¤ß¹þ¤ó¤Àʸ»ú c ¤ò¡¢ÆÉ¤ß¹þ¤Þ¤Ê¤«¤Ã¤¿¤³¤È¤Ë¤·¤Þ¤¹¡£

RETURN VALUES

EOF

gfs_pio_ungetc() ¤Ï¡¢´Ø¿ô gfs_pio_getc(3) ¤Î¸Æ¤Ó¤À¤·¤Îľ¸å¤Ë¤·¤« ¸Æ¤Ö¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£¤³¤ÎÀ©Ìó¤ËÈ¿¤·¤¿¾ì¹ç¡¢ EOF ¤ò¥¨¥é¡¼¤È¤·¤ÆÊÖ¤·¤Þ¤¹¡£

¤½¤Î¾

Àµ¾ï¤Ë½èÍý¤¬´°Î»¤·¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£

SEE ALSO

gfs_pio_create(3), gfs_pio_error(3), gfs_pio_getc(3), gfs_pio_open(3)

gfarm-2.4.1/doc/html/ja/ref/man3/gfarm_stringlist_init.3.html0000644000000000000000000000536111507222722022462 0ustar rootroot gfarm_stringlist_init

gfarm_stringlist_init

Name

gfarm_stringlist_init -- stringlist ¤ò½é´ü²½¤¹¤ë

Synopsis

#include <gfarm/gfarm.h>

char *gfarm_stringlist_init(gfarm_stringlist * listp);

DESCRIPTION

gfarm_stringlist ¤Ï¡¢Ê¸»úÎóÇÛÎó¤ÎưŪ³ÎÊݤòÊä½õ¤¹¤ë·¿¤Ç¤¹¡£ ưŪ¤Ë³ÎÊݤµ¤ì¤ë¤Î¤Ï¡¢ÇÛÎó¤À¤±¤Ç¤¢¤ê¡¢ÇÛÎóÍ×ÁǤǤ¢¤ë³ÆÊ¸»úÎó¤Ë¤Ä¤¤¤Æ¤Ï¡¢ ¤³¤Î·¿¤Î´ÉÍý³°¤Ë¤Ê¤ê¤Þ¤¹¡£

¤³¤Î´Ø¿ô¤Ï¡¢ listp ¤Î»Ø¤¹ gfarm_stringlist ·¿¤ÎÊÑ¿ô¤ò½é´ü²½¤·¤Þ¤¹¡£

¤³¤Î·¿¤ÎÍøÍѤò½ª¤¨¤¿»þ¤Ë¤Ï¡¢gfarm_stringlist_free() ¤òÍѤ¤¤Æ¡¢ ưŪ¤Ë³ÎÊݤ·¤¿¥á¥â¥ê¤ò²òÊü¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£

RETURN VALUES

NULL

Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£

GFARM_ERR_NO_MEMORY

¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£

¤½¤Î¾

¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£

SEE ALSO

GFARM_STRINGLIST_ELEM(3), GFARM_STRINGLIST_STRARRAY(3), gfarm_stringlist_add(3), gfarm_stringlist_cat(3), gfarm_stringlist_elem(3), gfarm_stringlist_free(3), gfarm_stringlist_free_deeply(3), gfarm_stringlist_length(3)

gfarm-2.4.1/doc/html/ja/ref/man3/gfarm_url_fragments_replicate.3.html0000644000000000000000000000510111507222722024125 0ustar rootroot gfarm_url_fragments_replicate

gfarm_url_fragments_replicate

Name

gfarm_url_fragments_replicate -- ¥Õ¥¡¥¤¥ë¤Î¥ì¥×¥ê¥«¤òºîÀ®¤¹¤ë

Synopsis

#include <gfarm/gfarm.h>

char *gfarm_url_fragments_replicate(const char *gfarm_url, int ndsthosts, char **dsthosts);

DESCRIPTION

¥Õ¥¡¥¤¥ë gfarm_url ¤ÎÊ£À½¤ò¡¢Ä¹¤µ ndsthosts ¤Îʸ»úÎóÇÛÎó dsthosts ¤Ç»ØÄꤷ¤¿¥Û¥¹¥È¤ËºîÀ®¤·¤Þ¤¹¡£ ¤³¤Î´Ø¿ô¤Ç¤Ï¡¢¼Â¹Ô·Á¼°¤Î¥Õ¥¡¥¤¥ë¤ÎÊ£À½¤Ë¤ÏÍøÍѤǤ­¤Þ¤»¤ó¡£

¥Õ¥¡¥¤¥ë¤Î¥Õ¥¡¥¤¥ë¥¤¥ó¥Ç¥Ã¥¯¥¹¤ÎÁí¿ô¤è¤ê¡¢»ØÄꤵ¤ì¤¿¥Û¥¹¥È¤ÎÁí¿ô ndsthosts ¤¬¾¯¤Ê¤¤¾ì¹ç¤Ï¡¢»ØÄꤵ¤ì¤¿¥Û¥¹¥È¤¬¥é¥¦¥ó¥É¥í¥Ó¥ó¤Ç³ä¤êÅö¤Æ¤é¤ì¤Þ¤¹¡£

RETURN VALUES

NULL

Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£

GFARM_ERR_NO_MEMORY

¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£

GFARM_ERR_OPERATION_NOT_PERMITTED

°ú¿ô¤È¤·¤Æ¡¢¼Â¹Ô·Á¼°¤Î¥Õ¥¡¥¤¥ë¡¢ ¥Ç¥£¥ì¥¯¥È¥ê¤Ê¤ÉÄ̾ï¥Õ¥¡¥¤¥ë°Ê³°¤Î¥Õ¥¡¥¤¥ë¤ò»ØÄꤷ¤Þ¤·¤¿¡£

¤½¤Î¾

¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£

SEE ALSO

gfarm_url_section_replicate_from_to(3), gfarm_url_section_replicate_from_to(3)

gfarm-2.4.1/doc/html/ja/ref/man3/gfs_pio_readdelim.3.html0000644000000000000000000001524111507222722021513 0ustar rootroot gfs_pio_readdelim

gfs_pio_readdelim

Name

gfs_pio_readdelim -- °ì¥ì¥³¡¼¥ÉÆÉ¤ß¹þ¤ß

Synopsis

#include <gfarm/gfarm.h>

char *gfs_pio_readdelim(GFS_File f, char **bufp, size_t *sizep, size_t *lenp, char *delimiter, size_t delimlen);

DESCRIPTION

¤³¤Î´Ø¿ô¤Ï¡¢gfs_pio_readline(3) ¤ÈƱÍÍ¤ËÆ¯¤­¤Þ¤¹¤¬¡¢¤¿¤À¤·¡¢ ÆþÎϤΥ»¥Ñ¥ì¡¼¥¿¤ò²þ¹Ôʸ»ú¤Ë¸Â¤é¤º¡¢°ìÈÌŪ¤Ë»ØÄê¤Ç¤­¤ë¤è¤¦¤Ë ¤·¤¿¤â¤Î¤Ç¤¹¡£ ¤³¤Î´Ø¿ô¤Ï¡¢¥Õ¥¡¥¤¥ë gf ¤«¤é¡¢ °ú¿ô delimiter ¤Ç»ØÄꤵ¤ì¤¿¥Ð¥¤¥ÈÎó¤ò¥ì¥³¡¼¥É´Ö¶èÀÚ¤ê¤È¤·¤Æ¡¢1¥ì¥³¡¼¥ÉÆÉ¤ß¤È¤ê ¤Þ¤¹¡£ °ú¿ô delimiter ¤Ë¤Ïʸ»ú '\0' ¤ò´Þ¤à¤³¤È¤â¤Ç¤­¤Þ¤¹¡£¤³¤Î¤¿¤á¡¢¶èÀÚ¤ê¤ÎŤµ¤ò °ú¿ô delimlen ¤Ç»ØÄꤷ¤Þ¤¹¡£ ¤Ê¤ª¡¢ °ú¿ô delimiter ¤¬ NULL ¤Î¾ì¹ç¡¢¥Õ¥¡¥¤¥ëÁ´ÂΤò1¥ì¥³¡¼¥É¤È¤·¤Æ¥á¥â¥ê¾å¤ËÆÉ¤ß¹þ¤ß¤Þ¤¹¡£ ¤½¤¦¤Ç¤Ï¤Ê¤¯¡¢¤«¤Ä °ú¿ô delimlen ¤¬ 0 ¤Î¾ì¹ç¡¢°ì¸Ä°Ê¾å¤ÎϢ³¤¹¤ë¶õ¹Ô (Àµµ¬É½¸½¤Ç¤Ï /\n\n+/) ¤ò ¥ì¥³¡¼¥É¶èÀÚ¤ê¤È¸«¤Ê¤·¤Þ¤¹¡£¤³¤Î»ÅÍÍ¤Ï perl ¸À¸ì¤Î INPUT_RECORD_SEPARATOR ¤ò»²¹Í¤Ë¤·¤Æ¤¤¤Þ¤¹¡£

°ú¿ô bufp ¤Ï¡¢ºÇ½é¤Ï NULL ¤Ç½é´ü²½¤µ¤ì¤¿¥Ý¥¤¥ó¥¿ÊÑ¿ô¤Î¥¢¥É¥ì¥¹¤ò»ØÄꤷ¤Þ¤¹¡£ ´Ø¿ô gfs_pio_readdelim() ¤Ï¡¢Æþ½ÐÎϤËÍѤ¤¤ë ¥Ð¥Ã¥Õ¥¡¤òưŪ¤Ë³ä¤êÅö¤Æ¡¢¤½¤Î¥¢¥É¥ì¥¹¤ò¤³¤Î¥Ý¥¤¥ó¥¿ÊÑ¿ô¤Ëµ­Ï¿¤·¤Þ¤¹¡£ °ú¿ô sizep ¤Ï¡¢0 ¤Ç½é´ü²½¤·¤¿ size_t ·¿¤ÎÊÑ¿ô ¤Î¥¢¥É¥ì¥¹¤ò»ØÄꤷ¤Þ¤¹¡£¤³¤ÎÊÑ¿ô¤Ï¡¢¥Ð¥Ã¥Õ¥¡¤Î¥µ¥¤¥º¤òµ­Ï¿¤¹¤ë¤¿¤á¤Ë »È¤ï¤ì¤Þ¤¹¡£ ¤¢¤ë¤¤¤Ï¡¢malloc(3) ¤Ç³ä¤êÅö¤Æ¤¿¥Ð¥Ã¥Õ¥¡¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Î¥¢¥É¥ì¥¹¤ò °ú¿ô bufp ¤Ë»ØÄꤹ¤ë¤³¤È¤â¤Ç¤­¤Þ¤¹¡£¤³¤Î¾ì¹ç¡¢ °ú¿ô sizep ¤Ï¡¢³ä¤êÅö¤Æ¤¿¥Ð¥Ã¥Õ¥¡¤Î¥µ¥¤¥º¤Ç½é´ü²½¤·¤Æ¤ª¤­¤Þ¤¹¡£ ¹Ô¤ÎŤµ¤¬¥Ð¥Ã¥Õ¥¡¤Î¥µ¥¤¥º¤ò±Û¤¨¤ë¾ì¹ç¤Ë¤Ï¡¢¥Ð¥Ã¥Õ¥¡¤Ï¼«Æ°Åª¤Ë realloc(3) ¤µ¤ì¡¢ °ú¿ô bufp ¤ª¤è¤Ó °ú¿ô sizep ¤Ç»ØÄꤵ¤ì¤¿ÊÑ¿ô¤â¤½¤ì¤Ë½¾¤Ã¤Æ¹¹¿·¤µ¤ì¤Þ¤¹¡£ ¥Õ¥¡¥¤¥ë¤òÆÉ¤ß½ª¤ï¤Ã¤¿¤é¡¢¤³¤Î¥Ý¥¤¥ó¥¿¤ò free(3) ¤Ç²òÊü¤¹¤ëɬÍפ¬ ¤¢¤ê¤Þ¤¹¡£

°ú¿ô lenp ¤Î»Ø¤¹ÊÑ¿ô¤Ë¤Ï¡¢ÆÉ¤ß¹þ¤ó¤À¥ì¥³¡¼¥É¤ÎŤµ¤òÊÖ¤·¤Þ¤¹¡£ ¤³¤ÎŤµ¤Ë¤Ï¡¢¥ì¥³¡¼¥É¶èÀÚ¤ê¤Îʬ¤â´Þ¤ß¤Þ¤¹¡£

¤³¤Î´Ø¿ô¤Ï¥ì¥³¡¼¥ÉËö¤Î¶èÀÚ¤ê¤òºï½ü¤·¤Þ¤»¤ó¡£ ¤Þ¤¿¡¢ °ú¿ô lenp ¤Î»Ø¤¹ÊÑ¿ô¤ËÊ֤ä¿ÃͤòÍøÍѤ¹¤ì¤ÐÎɤ¤¤Î¤Ç¾éŤǤ¹¤¬¡¢ ¥ì¥³¡¼¥ÉËö¤Ë '\0' ʸ»ú¤òÉղä·¤Þ¤¹¡£

EOF ¤Ï¡¢ÆþÎϤÎŤµ¤¬ 0 ¥Ð¥¤¥È¤Ç¤¢¤ë¤³¤È¤ÇȽÃǤ·¤Þ¤¹¡£

°ú¿ô¤È¤·¤Æ gfs_pio_readdelim(f, bufp, sizep, lenp, "\n", 1) ¤È»ØÄꤹ¤ë¤È¡¢´Ø¿ô gfs_pio_readline() ¤È Åù²Á¤Ë¤Ê¤ê¤Þ¤¹¡£

RETURN VALUES

NULL

Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£

GFARM_ERR_NO_MEMORY

¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£

¤³¤Î¾ì¹ç¤â¡¢bufp ¤Î»Ø¤¹¥Ý¥¤¥ó¥¿ÊÑ¿ô¤Î »Ø¤¹Îΰè¤ò free(3) ¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¤«¤éÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡£

¤½¤Î¾

¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£

EXAMPLES

Example 1. gfs_pio_readdelim ´Ø¿ô¤Î»ÈÍÑÎã

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <gfarm/gfarm.h>

int
main(int argc, char **argv)
{
	char *e;
	GFS_File gf;
	size_t bufsize = 0, delimlen = 1, len;
	char *buffer = NULL, *delim = "\n";

	e = gfarm_initialize(&argc, &argv);
	if (e != NULL) {
		fprintf(stderr, "gfarm_initialize: %s\n", e);
		return (EXIT_FAILURE);
	}
	while ((c = getopt(argc, argv, "d:D")) != -1) {
		switch (c) {
		case 'd':
			delim = optarg;
			delimlen = strlen(optarg);
			break;
		case 'D':
			delim = NULL;
			delimlen = 0;
			break;
		case '?':
		default:
			fprintf(stderr, "invalid option: %c\n", c);
			return (EXIT_FAILURE);
		}
	}
	if (optind >= argc) {
		fprintf(stderr, "missing gfarm filename\n");
		return (EXIT_FAILURE);
	}
	e = gfs_pio_open(argv[optind], GFARM_FILE_RDONLY, &gf);
	if (e != NULL) {
		fprintf(stderr, "%s: %s\n", argv[optind], e);
		return (EXIT_FAILURE);
	}
	e = gfs_pio_set_view_global(gf, 0);
	if (e != NULL) {
		fprintf(stderr, "%s: gfs_pio_set_view_global: %s\n",
		    argv[optind], e);
		return (EXIT_FAILURE);
	}

	while ((e = gfs_pio_readdelim(gf, &buffer, &bufsize, &len,
	    delim, delimlen)) == NULL && len > 0) {
		printf("<%6d/%6d >%s", len, bufsize, buffer);
	}
	if (buffer != NULL)
		free(buffer);
	if (e != NULL) {
		fprintf(stderr, "ERROR: %s\n", e);
		return (EXIT_FAILURE);
	}
	e = gfs_pio_close(gf);
	if (e != NULL) {
		fprintf(stderr, "gfs_pio_close: %s\n", e);
		return (EXIT_FAILURE);
	}
	e = gfarm_terminate();
	if (e != NULL) {
		fprintf(stderr, "gfarm_initialize: %s\n", e);
		return (EXIT_FAILURE);
	}
	return (EXIT_SUCCESS);
}

SEE ALSO

gfs_pio_open(3), gfs_pio_getline(3), gfs_pio_gets(3), gfs_pio_readline(3)

gfarm-2.4.1/doc/html/ja/ref/man3/gfs_pio_getline.3.html0000644000000000000000000000460411507222722021215 0ustar rootroot gfs_pio_getline

gfs_pio_getline

Name

gfs_pio_getline -- °ì¹ÔÆÉ¤ß¹þ¤ß

Synopsis

#include <gfarm/gfarm.h>

char *gfs_pio_getline(GFS_File f, char * s, size_t size, int * eofp);

DESCRIPTION

¥Õ¥¡¥¤¥ë gf ¤«¤é¡¢Ê¸»úÎó s ¤Ë¡¢°ì¹ÔÆÉ¤ß¹þ¤ß¤Þ¤¹¡£ °ú¿ô size ¤Ëʸ»úÇÛÎó s ¤ÎÂ礭¤µ¤ò»ØÄꤷ¤Þ¤¹¡£¹Ô¤¬ size ¤ò±Û¤¨¤¿¾ì¹ç¤È¡¢°ì¹Ô¤ÎŤµ¤¬¤Á¤ç¤¦¤É size - 1 ¤À¤Ã¤¿¾ì¹ç¤ò¶èÊ̤¹¤ë¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó¡£ EOF ¤Î¾ì¹ç¤Ë¤Ï eofp ¤Î»Ø¤¹Àè¤Ë 1 ¤òÊÖ¤·¡¢¤µ¤â¤Ê¤¯¤Ð 0 ¤òÊÖ¤·¤Þ¤¹¡£

RETURN VALUES

NULL

Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£

GFARM_ERR_NO_MEMORY

¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£

¤½¤Î¾

¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£

SEE ALSO

gfs_pio_create(3), gfs_pio_open(3)

gfarm-2.4.1/doc/html/ja/ref/man3/gfs_closedir.3.html0000644000000000000000000000324711507222722020525 0ustar rootroot gfs_closedir

gfs_closedir

Name

gfs_closedir -- ¥Ç¥£¥ì¥¯¥È¥ê¤ò¥¯¥í¡¼¥º¤¹¤ë

Synopsis

#include <gfarm/gfarm.h>

char *gfs_closedir(GFS_Dir dir);

DESCRIPTION

°ú¿ô dir ¤Ç»ØÄꤷ¤¿¥Ç¥£¥ì¥¯¥È¥ê¤ò¥¯¥í¡¼¥º¤·¤Þ¤¹¡£

RETURN VALUES

NULL

Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£

¤½¤Î¾

¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£

SEE ALSO

gfs_opendir(3), gfs_readdir(3)

gfarm-2.4.1/doc/html/ja/ref/man3/gfarm_stringlist_free.3.html0000644000000000000000000000457211507222722022443 0ustar rootroot gfarm_stringlist_free

gfarm_stringlist_free

Name

gfarm_stringlist_free, gfarm_stringlist_free_deeply -- stringlist ¤ò²òÊü¤¹¤ë

Synopsis

#include <gfarm/gfarm.h>

void gfarm_stringlist_free(gfarm_stringlist * listp);

void gfarm_stringlist_free_deeply(gfarm_stringlist * listp);

DESCRIPTION

ưŪ¤Ë³ÎÊݤ·¤¿¥á¥â¥ê¤ò²òÊü¤·¤Þ¤¹¡£

´Ø¿ô gfarm_stringlist_free() ¤Ï¡¢ÊÑ¿ô listp ¤¬É½¤¹Ê¸»úÎóÇÛÎó¤ÎÍ×ÁǤǤ¢¤ë³ÆÊ¸»úÎó¤Ë¤Ä¤¤¤Æ¤Ï²òÊü¤·¤Þ¤»¤ó¡£

¤³¤ì¤ËÂФ·¡¢´Ø¿ô gfarm_stringlist_free_deeply() ¤Ï¡¢Ê¸»úÎóÇÛÎó¤ÎÍ×ÁÇ¤Ç ¤¢¤ë³ÆÊ¸»úÎó¤â²òÊü¤·¤Þ¤¹¡£

SEE ALSO

GFARM_STRINGLIST_ELEM(3), GFARM_STRINGLIST_STRARRAY(3), gfarm_stringlist_add(3), gfarm_stringlist_cat(3), gfarm_stringlist_elem(3), gfarm_stringlist_init(3), gfarm_stringlist_length(3)

gfarm-2.4.1/doc/html/ja/ref/man3/gfarm_initialize.3.html0000644000000000000000000000650511507222722021377 0ustar rootroot gfarm_initialize

gfarm_initialize

Name

gfarm_initialize -- Gfarm ¥é¥¤¥Ö¥é¥ê¤ò½é´ü²½¤¹¤ë

Synopsis

#include <gfarm/gfarm.h>

gfarm_error_t gfarm_initialize(int * argcp, char *** argvp);

DESCRIPTION

Gfarm ¥é¥¤¥Ö¥é¥ê¤ò½é´ü²½¤·¤Þ¤¹¡£ Gfarm ¥é¥¤¥Ö¥é¥ê API ¤òÍøÍѤ¹¤ëÁ°¤Ëɬ¤º¸Æ¤ÖɬÍפ¬¤¢¤ê¤Þ¤¹¡£ °ú¿ô¤Ë¤Ï¡¢¥×¥í¥°¥é¥à¤Î main ´Ø¿ô¤Î argc °ú¿ô¤Ø¤Î¥Ý¥¤¥ó¥¿¤È¡¢ argv °ú¿ô¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÅϤ·¤Þ¤¹¡£

RETURN VALUES

GFARM_ERR_NO_ERROR

Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£

GFARM_ERR_NO_MEMORY

¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£

GFARM_ERR_UNKNOWN_HOST

»ØÄꤵ¤ì¤¿¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤Î¥¢¥É¥ì¥¹²ò·è¤¬¤Ç¤­¤Þ¤»¤ó¡£

GFARM_ERR_NETWORK_IS_UNREACHABLE

¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤ËÅþã¤Ç¤­¤Þ¤»¤ó¡£

GFARM_ERR_OPERATION_TIMED_OUT

¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤Ø¤ÎÀܳ¤¬¥¿¥¤¥à¥¢¥¦¥È¤ò¤ª¤³¤·¤Þ¤·¤¿¡£

GFARM_ERR_PROTOCOL

¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤È¤ÎÄÌ¿®¤Ë¥×¥í¥È¥³¥ë¥¨¥é¡¼¤¬È¯À¸¤·¤Þ¤·¤¿¡£

GFARM_ERR_BROKEN_PIPE

¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤È¤ÎÄÌ¿®¤¬ÀÚÃǤ·¤Þ¤·¤¿¡£

GFARM_ERR_PERMISSION_DENIED

¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤Ø¤Îǧ¾Ú¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£

GFARM_ERR_PROTOCOL_NOT_SUPPORTED

»ØÄꤵ¤ì¤¿Ç§¾Ú¥×¥í¥È¥³¥ë¤Ï¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Þ¤»¤ó¡£

GFARM_ERR_AUTHENTICATION

¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤ËÂФ¹¤ëǧ¾Ú¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£

GFARM_ERR_NO_MEMORY

¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£

¤½¤Î¾

¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ gfarm_error_string(3) ¤Ë¤è¤ê¥¨¥é¡¼¤Î¸¶°ø¤òʸ»úÎó¤ËÊÑ´¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£

SEE ALSO

gfarm_terminate(3)

gfarm-2.4.1/doc/html/ja/ref/man3/gfarm_import_fragment_config_read.3.html0000644000000000000000000000533511507222722024753 0ustar rootroot gfarm_import_fragment_config_read

gfarm_import_fragment_config_read

Name

gfarm_import_fragment_config_read -- ¥Õ¥é¥°¥á¥ó¥È¹½À®¥Õ¥¡¥¤¥ë¤òÆÉ¤ß¹þ¤à

Synopsis

#include <gfarm/gfarm.h>

char *gfarm_import_fragment_config_read(char *config, int *np, char ***host_table_p, file_offset_t **size_table_p, int *error_line_p);

DESCRIPTION

Gfarm¥Õ¥¡¥¤¥ë¤ò¥¤¥ó¥Ý¡¼¥È¤¹¤ë¥¢¥×¥ê¥±¡¼¥·¥ç¥óÍѤÎÊä½õ´Ø¿ô¤Î°ì¤Ä¤Ç¤¹¡£

import ¤Î¹½À®¥Õ¥¡¥¤¥ë̾¤ò config ¤Ë»ØÄꤹ¤ë¤È¡¢¤½¤Î¥Õ¥¡¥¤¥ë¤«¤é¡¢ ¥Û¥¹¥È¤ÎÇÛÎó¤ò host_table_p ¤Î»Ø¤¹Àè¤Ë¡¢¤Þ¤¿¡¢¥µ¥¤¥º¤ÎÇÛÎó¤ò size_table_p ¤Î»Ø¤¹Àè¤ËÊÖ¤·¤Þ¤¹¡£¹½À®¥Õ¥¡¥¤¥ë¤Ë¹½Ê¸¥¨¥é¡¼¤¬À¸¤¸¤¿¾ì¹ç¤Ë¤Ï¡¢ error_line_p ¤Î»Ø¤¹Àè¤Ë¡¢¥Õ¥¡¥¤¥ë¤Î¹ÔÈÖ¹æ¤òÊÖ¤·¤Þ¤¹¡£¤³¤ÎÃͤ¬ -1 ¤Î¾ì¹ç¤Ë¤Ï¡¢¹½Ê¸°Ê³°¤Î¥¨¥é¡¼¸¶°ø¤Ç¤¹¡£

¹½À®¥Õ¥¡¥¤¥ë¤Ï¡¢³Æ¹Ô¤¬¡¢¶õÇò¤Ç¶èÀÚ¤é¤ì¤¿¥µ¥¤¥º¤È¥Û¥¹¥È̾¤«¤é¤Ê¤ë·Á¼°¤Ç¤¹¡£

¤³¤³¤ÇÆÀ¤¿¥Û¥¹¥È¤ÎÇÛÎó¤Ï gfarm_strings_free_deeply() ¤òÍѤ¤¤Æ²òÊü ¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£ ¤Þ¤¿¡¢¤³¤³¤ÇÆÀ¤¿¥µ¥¤¥º¤ÎÇÛÎó¤Ï free() ¤òÍѤ¤¤Æ²òÊü¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£

RETURN VALUES

NULL

Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£

GFARM_ERR_NO_MEMORY

¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£

¤½¤Î¾

¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£

SEE ALSO

gfarm_hostlist_read(3)

gfarm-2.4.1/doc/html/ja/ref/man3/gfarm.3.html0000644000000000000000000002205611507222722017155 0ustar rootroot gfarm

gfarm

Name

gfarm -- Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à API ¥é¥¤¥Ö¥é¥ê

Synopsis

#include <gfarm/gfarm.h>

DESCRIPTION

Gfarm ¥é¥¤¥Ö¥é¥ê¤Ï¡¤Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ä¡¤¥¹¥±¥¸¥å¡¼¥ê¥ó¥° µ¡Ç½¤ËÂФ¹¤ë¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤òÄ󶡤·¤Þ¤¹¡¥¤³¤Î¥Þ¥Ë¥å¥¢¥ë¤Ï¥é¥¤¥Ö¥é¥ê ¤Î³µÍפòµ­½Ò¤·¤Þ¤¹¡¥³Æ´Ø¿ô¤Î¾ÜºÙ¤Ï¡¤´Ø¿ôñ°Ì¤Î¥Þ¥Ë¥å¥¢¥ë¤ò»²¾È¤·¤Æ ¤¯¤À¤µ¤¤¡¥

½é´ü²½¡¿½ªÎ»½èÍý

gfarm_initialize(3) ´Ø¿ô¤Ï Gfarm ¥é¥¤¥Ö¥é¥ê¤Î½é´ü²½¤Ë¡¤ gfarm_terminate(3) ´Ø¿ô¤Ï Gfarm ¥é¥¤¥Ö¥é¥ê¤Î½ªÎ»½èÍý¤ËÍѤ¤¤Þ¤¹¡¥

¥Õ¥¡¥¤¥ëÆþ½ÐÎϽèÍý

´û¸¤Î¥Õ¥¡¥¤¥ë¤ò¥¹¥È¥ê¡¼¥à¤È¤·¤Æ¥ª¡¼¥×¥ó¤¹¤ë¤Ë¤Ï gfs_pio_open(3) ´Ø¿ô¤ò¡¤ ¿·µ¬¥Õ¥¡¥¤¥ë¤òºîÀ®¤·¤Æ¥¹¥È¥ê¡¼¥à¤È¤·¤Æ¥ª¡¼¥×¥ó¤¹¤ë¤Ë¤Ï gfs_pio_create(3) ´Ø¿ô¤òÍѤ¤¤Þ¤¹¡¥ ¥Õ¥¡¥¤¥ë¤Î¥¯¥í¡¼¥º¤Ï gfs_pio_close(3) ´Ø¿ô¤ò»È¤¤¤Þ¤¹¡¥

gfs_pio_error(3) ´Ø¿ô¤Ï¥ª¡¼¥×¥ó¤·¤Æ¤¤¤ë¥¹¥È¥ê¡¼¥à¤Ë´Ø¤·¤Æ¥¨¥é¡¼¤¬À¸¤¸¤Æ¤¤¤ë¤« ¤òȽÊ̤·¡¤ gfs_pio_eof(3) ´Ø¿ô¤ÏÆÉ¤ß¹þ¤ß¥ª¡¼¥×¥ó¤·¤Æ¤¤¤ë¥¹¥È¥ê¡¼¥à¤¬¥Õ¥¡¥¤¥ë ËöÈø¤Ë㤷¤Æ¤¤¤ë¤«¤òȽÊ̤·¤Þ¤¹¡¥ gfs_pio_seek(3) ´Ø¿ô¤Ï¡¤¥¹¥È¥ê¡¼¥àÃæ¤Î¸½ºß°ÌÃÖ¤òÊѹ¹¤·¤Þ¤¹¡¥

gfs_pio_getc(3) ´Ø¿ô¤Ï¥¹¥È¥ê¡¼¥à¤«¤é°ìʸ»úÆÉ¤ß¹þ¤ß¡¤ gfs_pio_ungetc(3) ´Ø¿ô¤ÏµÕ¤ËÆÉ¤ß¹þ¤ó¤À°ìʸ»ú¤ò¥¹¥È¥ê¡¼¥à¤ËÌᤷ¤Þ¤¹¡¥ gfs_pio_getline(3) ´Ø¿ô¤ä gfs_pio_gets(3) ´Ø¿ô¡¤ gfs_pio_readline(3) ´Ø¿ô¤Ï¡¤¥¹¥È¥ê¡¼¥à¤«¤é°ì¹Ô¤òÆÉ¤ß¹þ¤ß¡¤ gfs_pio_readdelim(3) ´Ø¿ô¤Ï¡¤¥¹¥È¥ê¡¼¥à¤«¤é»ØÄꤷ¤¿¥Ç¥ê¥ß¥¿¤Þ¤Ç¤òÆÉ¤ß¹þ¤ß¤Þ¤¹¡¥ gfs_pio_read(3) ´Ø¿ô¤Ï¡¤¥¹¥È¥ê¡¼¥à¤«¤é»ØÄꤷ¤¿¥Ð¥¤¥È¿ô¤À¤±ÆÉ¤ß¹þ¤ß¤Þ¤¹¡¥

gfs_pio_putc(3) ´Ø¿ô¤Ï¥¹¥È¥ê¡¼¥à¤Ø°ìʸ»ú½ñ¤­¤À¤·¡¤ gfs_pio_putline(3) ´Ø¿ô¤ä gfs_pio_puts(3) ´Ø¿ô¤Ï¥¹¥È¥ê¡¼¥à¤Ø°ì¹Ô½ñ¤­¤À¤·¤Þ¤¹¡¥ gfs_pio_write(3) ´Ø¿ô¤Ï¡¤¥¹¥È¥ê¡¼¥à¤Ø»ØÄꤷ¤¿¥Ð¥¤¥È¿ô¤À¤±½ñ¤­¹þ¤ß¤Þ¤¹¡¥ gfs_pio_flush(3) ´Ø¿ô¤ä¡¤ gfs_pio_sync(3) ´Ø¿ô¡¤ gfs_pio_datasync(3) ´Ø¿ô¤Ï¡¤¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¤·¤Æ¤¤¤ë¥Ç¡¼¥¿¤òµ­²±ÁõÃ֤˽ñ¤­½Ð¤·¤Þ¤¹¡¥ gfs_pio_truncate(3) ´Ø¿ô¤Ï¡¤¥Õ¥¡¥¤¥ë¤Î¥µ¥¤¥º¤òÊѹ¹¤·¤Þ¤¹¡¥

¥Ç¥£¥ì¥¯¥È¥ê¥¢¥¯¥»¥¹

gfs_opendir(3) ´Ø¿ô¤Ç¥Ç¥£¥ì¥¯¥È¥ê¤ò¥ª¡¼¥×¥ó¤¹¤ë¤È¡¤ gfs_readdir(3) ´Ø¿ô¤Ç¡¤¤½¤Î¥Ç¥£¥ì¥¯¥È¥ê¤ò¹½À®¤¹¤ë¥¨¥ó¥È¥ê¤òÆÀ¤ë¤³¤È¤¬ ¤Ç¤­¤Þ¤¹¡¥¥ª¡¼¥×¥ó¤·¤¿¥Ç¥£¥ì¥¯¥È¥ê¤Ø¤Î¥¢¥¯¥»¥¹¤Ï¡¤ gfs_closedir(3) ´Ø¿ô¤Ç½ªÎ»¤·¤Þ¤¹¡¥

gfs_glob_init(3) ´Ø¿ô¤Ç½é´ü²½¤·¤¿ gfs_glob_t ¤ò gfs_glob(3) ´Ø¿ô¤ËÅϤ¹¤³¤È¤Ç¡¤¥ï¥¤¥ë¥É¥«¡¼¥É¤ÎŸ³«¤ò¹Ô¤¦¤³¤È¤¬ ¤Ç¤­¤Þ¤¹¡¥ ÍøÍѤ¬½ª¤ï¤Ã¤¿¤é¡¤¤³¤ÎÎΰè¤Ï gfs_glob_free(3) ´Ø¿ô¤Ç³«Êü¤·¤Þ¤¹¡¥ gfs_glob_add(3) ´Ø¿ô¤Ï¡¤gfs_glob_t ¤Ë¥¨¥ó¥È¥ê¤òÄɲ乤ë¤Î¤ËÍѤ¤¤Þ¤¹¡¥

¥Õ¥¡¥¤¥ë¡¿¥Ç¥£¥ì¥¯¥È¥êÁàºî

gfs_chmod(3) ´Ø¿ô¤Ç¥Õ¥¡¥¤¥ë¤Î¥â¡¼¥É¤òÊѹ¹¤·¡¤ gfs_chown(3) ´Ø¿ô¤Ç¥Õ¥¡¥¤¥ë¤Î½êÍ­¼Ô¤òÊѹ¹¤·¡¤ gfs_utimes(3) ´Ø¿ô¤Ç¥Õ¥¡¥¤¥ë¤Î¹¹¿·»þ¹ï¤È¥¢¥¯¥»¥¹»þ¹ï¤òÊѹ¹¤·¤Þ¤¹¡¥

gfs_mkdir(3) ´Ø¿ô¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤òºîÀ®¤·¡¤ gfs_rmdir(3) ´Ø¿ô¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤òºï½ü¤·¤Þ¤¹¡¥ gfs_unlink(3) ´Ø¿ô¤Ï¥Õ¥¡¥¤¥ë¤òºï½ü¤·¡¤ gfs_rename(3) ´Ø¿ô¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤ä¥Õ¥¡¥¤¥ë¤ò²þ̾¤·¤Þ¤¹¡¥

gfs_stat(3) ´Ø¿ô¤Ï»ØÄꤷ¤¿¥Õ¥¡¥¤¥ë¤¢¤ë¤¤¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤Î¥µ¥¤¥º¤ä ¹¹¿·»þ¹ï¤Ê¤É¤Î¾ðÊó¤òÊÖ¤·¤Þ¤¹¡¥ ¤³¤Î´Ø¿ô¤¬ÊÖ¤·¤¿ gfs_stat ¹½Â¤ÂÎ¤Ï gfs_stat_free(3) ´Ø¿ô¤òÍѤ¤¤Æ²òÊü¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡¥

¥¨¥é¡¼¥³¡¼¥É

¤Û¤È¤ó¤É¤Î Gfarm ¥é¥¤¥Ö¥é¥ê¤Î´Ø¿ô¤Ï gfarm_error_t ·¿¤Î Gfarm ¥¨¥é¡¼¥³¡¼ ¥É¤òÊÖ¤·¤Þ¤¹¡£ gfarm_error_string(3) ´Ø¿ô¤Ï Gfarm ¥¨¥é¡¼¥³¡¼¥É¤òɽ¤¹Ê¸»úÎó¤òÊÖ¤·¤Þ¤¹¡£ gfarm_errno_to_error(3) ´Ø¿ô¤Ï errno ¤ò Gfarm ¥¨¥é¡¼¥³¡¼¥É¤ËÊÑ´¹¤·¤Þ¤¹¡£ gfarm_error_to_errno(3) ´Ø¿ô¤Ï Gfarm ¥¨¥é¡¼¥³¡¼¥É¤ò errno ¤ËÊÑ´¹¤·¤Þ¤¹¡£

ʸ»úÎóÇÛÎóÁàºî¥æ¡¼¥Æ¥£¥ê¥Æ¥£

ʸ»úÎóÇÛÎó¤òɽ¤¹ gfarm_stringlist ·¿¤ÎÊÑ¿ô¤Ï¡¤ gfarm_stringlist_init(3) ´Ø¿ô¤Ç½é´ü²½¤·¡¤ gfarm_stringlist_add(3) ´Ø¿ô¤Çʸ»úÎó¤ò°ì¤ÄÄɲä·¡¤ gfarm_stringlist_cat(3) ´Ø¿ô¤Çʸ»úÎó¤òÊ£¿ôÄɲä·¡¤ gfarm_stringlist_free(3) ´Ø¿ô¤Ç²òÊü¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡¥ ʸ»úÎóÇÛÎó¤Î³ÆÍ×ÁÇʸ»úÎó¤Ë¤Ï gfarm_stringlist_elem(3) ´Ø¿ô¤¢¤ë¤¤¤Ï GFARM_STRINGLIST_ELEM() ¥Þ¥¯¥í¤Ç¥¢¥¯¥»¥¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡¥ ¤Þ¤¿¡¤Ê¸»úÎóÇÛÎó¤ò¹½À®¤¹¤ëʸ»úÎó¤Î¿ô¤Ï gfarm_stringlist_length(3) ´Ø¿ô¤ÇÆÀ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡¥

gfarm_strings_free_deeply(3) ´Ø¿ô¤Ï¡¤Ê¸»úÎóÇÛÎ󤪤è¤Ó¤½¤ì¤ò¹½À®¤¹¤ë³ÆÊ¸»úÎó¤ËÂФ·¤Æ ɸ½à¥é¥¤¥Ö¥é¥ê´Ø¿ô¤Î free() ¤ò¸Æ¤Ó½Ð¤·¤Æ²òÊü¤·¤Þ¤¹¡¥

ʸ»úÎóÇÛÎóÁàºî¥æ¡¼¥Æ¥£¥ê¥Æ¥£¥Þ¥¯¥í

GFARM_STRINGLIST_ELEM(list, i)

gfarm_stringlist ·¿¤Î list °ú¿ô¤¬É½¤¹Ê¸»úÎóÇÛÎó¤Î i ÈÖÌܤÎÍ×ÁǤò ɽ¤¹¥Þ¥¯¥í¤Ç¤¹¡¥¤³¤Î¥Þ¥¯¥í¤Ïº¸ÊÕÃͤȤ·¤Æ»È¤¨¤Þ¤¹¡¥ ÃͤȤ·¤ÆÉ¾²Á¤·¤¿¾ì¹ç¤Ë¤Ï gfarm_stringlist_elem(3) ´Ø¿ô¤ÈƱ°ì¤Î·ë²Ì¤òÊÖ¤·¤Þ¤¹¡¥

GFARM_STRINGLIST_STRARRAY(list)

gfarm_stringlist ·¿¤Î list °ú¿ô¤¬ ɽ¤¹Ê¸»úÎóÇÛÎó¤ÎÀèÆ¬Í×ÁǤؤΥݥ¤¥ó¥¿¤òÊÖ¤·¤Þ¤¹¡¥ ÊÖ¤êÃͤϡ¤Ê¸»ú¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ø¤Î¥Ý¥¤¥ó¥¿¤È¤Ê¤ê¤Þ¤¹¡¥

gfarm-2.4.1/doc/html/ja/ref/man3/Makefile0000644000000000000000000000052311507222722016465 0ustar rootroot# $Id: Makefile 2373 2006-01-12 00:54:22Z soda $ top_builddir = ../../../../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk htmldir=$(default_htmldir)/ja/ref/man3 DOCBOOK_DIR=$(top_srcdir)/doc/docbook/ja/ref/man3 include $(DOCBOOK_DIR)/Makefile.inc HTMLSRC=$(DOCBOOK) include $(top_srcdir)/makes/html.mk gfarm-2.4.1/doc/html/ja/ref/man3/gfs_stat_free.3.html0000644000000000000000000000242111507222722020666 0ustar rootroot gfs_stat_free

gfs_stat_free

Name

gfs_stat_free -- ¥Õ¥¡¥¤¥ë°À­¾ðÊó²òÊü

Synopsis

#include <gfarm/gfarm.h>

void gfs_stat_free(struct gfs_stat * status);

DESCRIPTION

gfs_stat(3) ¤Ç¼èÆÀ¤·¤¿Â°À­¾ðÊó¤ÎÊÝ»ý¤¹¤ë¥á¥â¥ê¤ò²òÊü¤·¤Þ¤¹¡£

SEE ALSO

gfs_stat(3)

gfarm-2.4.1/doc/html/ja/ref/man3/gfs_chmod.3.html0000644000000000000000000000560111507222722020007 0ustar rootroot gfs_chmod

gfs_chmod

Name

gfs_chmod -- ¥â¡¼¥ÉÊѹ¹

Synopsis

#include <gfarm/gfarm.h>

char *gfs_chmod(char * gfarm_url, mode_t mode);

DESCRIPTION

°ú¿ô gfarm_url ¤Ë»ØÄꤷ¤¿Ì¾Á°¤Î¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥ì¥¯¥È¥ê¤Î¥â¡¼¥É¤ò¡¢ mode ¤ËÊѹ¹¤·¤Þ¤¹¡£¤³¤Î mode ¤ÎÃͤΰÕÌ£¤Ï chmod(2) ¤ÈƱÍͤǤ¹¤¬¡¢²¼°Ì9¥Ó¥Ã¥È¤Î¤ßÍ­¸ú¤Ç¤¹¡£

Ê£¿ô¤Î¥Õ¥é¥°¥á¥ó¥È¤«¤é¤Ê¤ë¥Õ¥¡¥¤¥ë¤Î¼Â¹Ô°À­¤ÎÊѹ¹¤Ë¤ÏÀ©Ìó¤¬ ¤¢¤ê¤Þ¤¹¡£¼Â¹Ô°À­¤¬¤¢¤ë¾ì¹ç¤Ë¤Ï¼Â¹Ô°À­¤ò¤¹¤Ù¤ÆÍ¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó¡£ ¾¯¤Ê¤¯¤È¤â°ì¤Ä¤Î¼Â¹Ô¥Ó¥Ã¥È¤Ï»Ä¤·¤Æ¤ª¤¯É¬Íפ¬¤¢¤ê¤Þ¤¹¡£ µÕ¤Ë¡¢¼Â¹Ô°À­¤¬Á´¤¯¤Ê¤¤¾ì¹ç¤Ë¼Â¹Ô°À­¤òΩ¤Æ¤ë¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó¡£

RETURN VALUES

NULL

Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£

GFARM_ERR_NO_MEMORY

¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£

GFARM_ERR_AUTHENTICATION

gfmd(8) ¤¢¤ë¤¤¤Ï gfsd(8) ¤ËÂФ¹¤ë¥æ¡¼¥¶¡¼Ç§¾Ú¤¬¼ºÇÔ¤·¤Þ¤·¤¿¡£

GFARM_ERR_PERMISSION_DENIED

»ØÄꤷ¤¿¥Ñ¥¹Ì¾¤Î¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤Ø¤Î¥¢¥¯¥»¥¹¤¹¤ë¸¢¸Â¤¬¤¢¤ê¤Þ¤»¤ó¡£

GFARM_ERR_OPERATION_NOT_PERMITTED

¥×¥í¥»¥¹¤ò¼Â¹Ô¤·¤Æ¤¤¤ë¥æ¡¼¥¶¡¼¤¬¡¢¥Õ¥¡¥¤¥ë¤Î½êÍ­¼Ô¤Ç¤â¡¢¥·¥¹¥Æ¥à´ÉÍý¼Ô ¤Ç¤â¤¢¤ê¤Þ¤»¤ó¡£¤Þ¤¿¤Ï¡¢Ê£¿ô¤Î¥Õ¥é¥°¥á¥ó¥È¤ò¤â¤Ä¥Õ¥¡¥¤¥ë¤Î¼Â¹Ô¥Ó¥Ã¥È¤ò ¾¯¤Ê¤¯¤È¤â°ì¤Ä¤Ï¤¢¤ë¾õÂÖ¤«¤éÁ´¤¯¤Ê¤¤¾õÂ֤ˡ¢¤¢¤ë¤¤¤Ï¤½¤ÎµÕ¤ËÊѹ¹¤·¤è¤¦¤È ¤·¤Þ¤·¤¿¡£

GFARM_ERR_NO_SUCH_OBJECT

»ØÄꤵ¤ì¤¿¥Ñ¥¹Ì¾¤¬Â¸ºß¤·¤Þ¤»¤ó¡£

GFARM_ERR_NOT_A_DIRECTORY

»ØÄꤷ¤¿¥Ñ¥¹Ì¾¤Î¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤¬¡¢¼ÂºÝ¤Ë¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤«¤Ã¤¿¤³¤È¤ò ¼¨¤·¤Þ¤¹¡£

¤½¤Î¾

¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£

gfarm-2.4.1/doc/html/ja/ref/man3/gfs_pio_set_view_local.3.html0000644000000000000000000000640511507222722022566 0ustar rootroot gfs_pio_set_view_local

gfs_pio_set_view_local

Name

gfs_pio_set_view_local -- ÊÂÎó¥×¥í¥»¥¹¤ËÂбþ¤·¤¿ fragment ñ°Ì¤Î¥¢¥¯¥»¥¹¤ò¹Ô¤¦

Synopsis

#include <gfarm/gfarm.h>

char *gfs_pio_set_view_local(GFS_File gf, int flags);

DESCRIPTION

¥Õ¥¡¥¤¥ë¤ò¥Õ¥é¥°¥á¥ó¥Èñ°Ì¤Ç¥¢¥¯¥»¥¹¤¹¤ë¤³¤È¤ò»ØÄꤷ¤Þ¤¹¡£

¥¢¥¯¥»¥¹¤¹¤ë¥Õ¥é¥°¥á¥ó¥È¤Ï¡¢GfarmÊÂÎó¥×¥í¥»¥¹¤Î¥Î¡¼¥ÉÈÖ¹æ¤ËÂбþ¤·¤¿ ¤â¤Î¤Ë¤Ê¤ê¤Þ¤¹¡£¤¹¤Ê¤ï¤Á¡¢´Ø¿ô gfs_pio_set_local(3) ¤Î node °ú¿ô¤Ë»ØÄꤷ¤¿¥Õ¥é¥°¥á¥ó¥È¤Ç¤¹¡£

¥Õ¥é¥°¥á¥ó¥È¤ÎÁí¿ô¤Ï¡¢GfarmÊÂÎó¥×¥í¥»¥¹¤Î¥Î¡¼¥É¤ÎÁí¿ô¡¢¤¹¤Ê¤ï¤Á gfs_pio_set_local(3) ¤Î nnode °ú¿ô¤ÈƱ°ì¤Ë¤Ê¤ê¤Þ¤¹¡£ ¤â¤·¡¢´û¸¤Î¥Õ¥¡¥¤¥ë¤ò³«¤¯¤È¤­¤Ë¡¢¥Õ¥é¥°¥á¥ó¥È¤ÎÁí¿ô¤È¥Î¡¼¥É¤ÎÁí¿ô¤¬ °Û¤Ê¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢¤³¤Î´Ø¿ô¤Ï¥¨¥é¡¼¤È¤Ê¤ê¤Þ¤¹¡£

°ú¿ô flag ¤Ë¤Ï¡¢ GFARM_FILE_SEQUENTIAL¡¢ GFARM_FILE_REPLICATE¡¢ GFARM_FILE_NOT_REPLICATE ¤ÎÏÀÍýϤ¬»ØÄê¤Ç¤­¤Þ¤¹¡£ ÃͤΰÕÌ£¤Ï gfs_pio_set_view_index(3) ¤Î²òÀâ¤ò»²¾È¤¯¤À¤µ¤¤¡£

¤³¤Î´Ø¿ô¤ò¸Æ¤Ð¤Ê¤¤¾õÂ֤Ǥϡ¢Gfarm¥Õ¥¡¥¤¥ë¤Ï global view ¾õÂ֤ȤʤäƤª¤ê¡¢Á´¤Æ¤Î¥Õ¥é¥°¥á¥ó¥È¤¬·ë¹ç¤µ¤ì¤¿Ã±°ì¥Õ¥¡¥¤¥ë¤Ë¸«¤¨¤Þ¤¹¡£

RETURN VALUES

NULL

Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£

GFARM_ERR_NO_MEMORY

¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£

GFARM_ERR_OPERATION_NOT_PERMITTED

»ØÄꤷ¤¿¥Ñ¥¹Ì¾¤¬¡¢¥Õ¥é¥°¥á¥ó¥È²½¥Õ¥¡¥¤¥ë¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£

GFARM_ERR_FRAGMENT_NUMBER_DOES_NOT_MATCH

¥Î¡¼¥É¿ô¤È¡¢¥Õ¥é¥°¥á¥ó¥ÈÁí¿ô¤¬¡¢Å¬¹ç¤·¤Þ¤»¤ó¡£

¤½¤Î¾

¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£

SEE ALSO

gfs_pio_create(3), gfs_pio_open(3), gfs_pio_set_local(3), gfs_pio_set_view_index(3)

gfarm-2.4.1/doc/html/ja/ref/man3/gfs_pio_create.3.html0000644000000000000000000001531211507222722021027 0ustar rootroot gfs_pio_create

gfs_pio_create

Name

gfs_pio_create -- Gfarm¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥Õ¥¡¥¤¥ë¤ÎºîÀ®

Synopsis

#include <gfarm/gfarm.h>

gfarm_error_t gfs_pio_create(const char * gfarm_url, int flags, gfarm_mode_t mode, GFS_File * gfp);

DESCRIPTION

»ØÄꤷ¤¿ gfarm_url ¤Ë¡¢¥â¡¼¥É mode ¤Ç¥Õ¥¡¥¤¥ë¤ò¿·µ¬ºîÀ®¤·¡¢ GFS_File ¹½Â¤ÂΤò gfp ¤Î»Ø¤¹Àè¤ËÊÖ¤·¤Þ¤¹¡£

°ú¿ô flags ¤Ï¡¢ gfs_pio_open() ¤ÎÂèÆó°ú¿ô¤ÈƱ¤¸°ÕÌ£¤ò»ý¤Á¤Þ¤¹¡£ GFARM_FILE_RDONLY¡¢ GFARM_FILE_WRONLY¡¢ GFARM_FILE_RDWR ¤Î¤¤¤º¤ì¤«°ì¤Ä¤Î¥Õ¥é¥°¤òɬ¤º»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤ÅÀ¤âƱ¤¸¤Ç¤¹¡£

°ú¿ô flags ¤ÎÃͤȤ·¤Æ GFARM_FILE_TRUNC ¤¬É¬Íפʾì¹ç¤Ï¡¢ ÌÀ¼¨Åª¤Ë»ØÄꤹ¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¤Î¤Ç¡¢¤´Ãí°Õ¤¯¤À¤µ¤¤¡£

RETURN VALUES

GFARM_ERR_NO_ERROR

Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£

GFARM_ERR_IS_A_DIRECTORY

»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤¹¡£

GFARM_ERR_IS_A_SYMBOLIC_LINK

»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤Ï¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Ç¤¹¡£

GFARM_ERR_OPERATION_NOT_PERMITTED

»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤Ï¥Õ¥¡¥¤¥ë¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£

GFARM_ERR_NOT_A_DIRECTORY

»ØÄꤷ¤¿¥Ñ¥¹Ì¾¤Î¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤¬¡¢¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£

GFARM_ERR_PERMISSION_DENIED

»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤ËÂФ·¡¢ flags ¤Ç»ØÄꤵ¤ì¤¿¥â¡¼¥É¤Ç¥¢¥¯¥»¥¹¤¹¤ë¸¢¸Â¤¬¤Ê¤¤¤«¡¢¤½¤Î¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤Ø¤Î ½ñ¤­¹þ¤ß¸¢¸Â¤¬¤¢¤ê¤Þ¤»¤ó¡£ ¤¢¤ë¤¤¤Ï¡¢¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤Ø¤Îǧ¾Ú¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£

GFARM_ERR_NO_MEMORY

¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£

GFARM_ERR_INVALID_ARGUMENT

flags ¤Î»ØÄ꤬ÉÔÀµ¤Ç¤¹¡£

GFARM_ERR_GFARM_URL_HOST_IS_MISSING

gfarm_url ¤Ç»ØÄꤵ¤ì¤¿Gfarm URL¤Ë¤ª¤¤¤Æ¡¢ ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤¬»ØÄꤵ¤ì¤Æ¤¤¤Þ¤»¤ó¡£

GFARM_ERR_GFARM_URL_PORT_IS_MISSING

gfarm_url ¤Ç»ØÄꤵ¤ì¤¿Gfarm URL¤Ë¤ª¤¤¤Æ¡¢ ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤Î¥Ý¡¼¥ÈÈֹ椬»ØÄꤵ¤ì¤Æ¤¤¤Þ¤»¤ó¡£

GFARM_ERR_UNKNOWN_HOST

»ØÄꤵ¤ì¤¿¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤Î¥¢¥É¥ì¥¹²ò·è¤¬¤Ç¤­¤Þ¤»¤ó¡£

GFARM_ERR_TOO_MANY_OPEN_FILES

¥×¥í¥»¥¹¤Ë¤ª¤±¤ë¥ª¡¼¥×¥ó²Äǽ¤Ê¥Õ¥¡¥¤¥ë¿ô¤Î¸Â³¦¤Ë㤷¤Þ¤·¤¿¡£

GFARM_ERR_TOO_MANY_OPEN_FILES_IN_SYSTEM

¥·¥¹¥Æ¥à¤Ë¤ª¤±¤ë¥ª¡¼¥×¥ó¤Ç¤­¤ë¥Õ¥¡¥¤¥ë¿ô¤Î¸Â³¦¤Ë㤷¤Þ¤·¤¿¡£

GFARM_ERR_NETWORK_IS_UNREACHABLE

¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤ËÅþã¤Ç¤­¤Þ¤»¤ó¡£

GFARM_ERR_OPERATION_TIMED_OUT

¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤Ø¤ÎÀܳ¤¬¥¿¥¤¥à¥¢¥¦¥È¤ò¤ª¤³¤·¤Þ¤·¤¿¡£

GFARM_ERR_PROTOCOL

¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤È¤ÎÄÌ¿®¤Ë¥×¥í¥È¥³¥ë¥¨¥é¡¼¤¬È¯À¸¤·¤Þ¤·¤¿¡£

GFARM_ERR_BROKEN_PIPE

¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤È¤ÎÄÌ¿®¤¬ÀÚÃǤ·¤Þ¤·¤¿¡£

GFARM_ERR_PROTOCOL_NOT_SUPPORTED

»ØÄꤵ¤ì¤¿Ç§¾Ú¥×¥í¥È¥³¥ë¤Ï¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Þ¤»¤ó¡£

GFARM_ERR_AUTHENTICATION

¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤ËÂФ¹¤ëǧ¾Ú¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£

¤½¤Î¾

¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ gfarm_error_string(3) ¤Ë¤è¤ê¥¨¥é¡¼¤Î¸¶°ø¤òʸ»úÎó¤ËÊÑ´¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£

SEE ALSO

gfs_pio_close(3), gfs_pio_create(3), gfs_pio_eof(3), gfs_pio_error(3), gfs_pio_flush(3), gfs_pio_getc(3), gfs_pio_getline(3), gfs_pio_open(3), gfs_pio_putc(3), gfs_pio_putline(3), gfs_pio_puts(3), gfs_pio_read(3), gfs_pio_seek(3), gfs_pio_ungetc(3), gfs_pio_write(3)

gfarm-2.4.1/doc/html/ja/ref/man3/gfarm_stringlist_add.3.html0000644000000000000000000000503611507222722022246 0ustar rootroot gfarm_stringlist_add

gfarm_stringlist_add

Name

gfarm_stringlist_add -- stringlist ¤Ëʸ»úÎó¤òÄɲ乤ë

Synopsis

#include <gfarm/gfarm.h>

char *gfarm_stringlist_add(gfarm_stringlist * listp, char * s);

DESCRIPTION

listp¤Îɽ¤¹Ê¸»úÎóÇÛÎó¤ÎËöÈø¤Ë¡¢Ê¸»úÎó s ¤òÄɲä·¤Þ¤¹¡£

RETURN VALUES

NULL

Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£

GFARM_ERR_NO_MEMORY

¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£

¤½¤Î¾

¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£

SEE ALSO

GFARM_STRINGLIST_ELEM(3), GFARM_STRINGLIST_STRARRAY(3), gfarm_stringlist_cat(3), gfarm_stringlist_elem(3), gfarm_stringlist_free(3), gfarm_stringlist_free_deeply(3), gfarm_stringlist_init(3), gfarm_stringlist_length(3)

gfarm-2.4.1/doc/html/ja/ref/man3/gfs_glob.3.html0000644000000000000000000000557511507222722017652 0ustar rootroot gfs_glob

gfs_glob

Name

gfs_glob -- ¥Ñ¥¿¡¼¥ó¤Ë¥Þ¥Ã¥Á¤¹¤ë¥Ñ¥¹Ì¾¤ò¼èÆÀ¤¹¤ë

Synopsis

#include <gfarm/gfarm.h>

char *gfs_glob(const char * pattern, gfarm_stringlist * paths, gfs_glob_t * types);

DESCRIPTION

¥ï¥¤¥ë¥É¥«¡¼¥É¤ò´Þ¤à°ú¿ô pattern ¤Ë¥Þ¥Ã¥Á¤¹¤ëÁ´¤Æ¤Î¥Ñ¥¹Ì¾¤ò paths ¤ËÊÖ¤·¤Þ¤¹¡£

ÊÖ¤µ¤ì¤¿¸Ä¡¹¤Î¥Ñ¥¹Ì¾¤ò»²¾È¤¹¤ë¤Ë¤Ï¡¢ gfarm_stringlist_length(3)¡¢ gfarm_stringlist_elem(3) ¤ò»È¤¤¤Þ¤¹¡£

gfs_glob(3) ¤ò»ÈÍѤ¹¤ëÁ°¤Ë¡¢°ú¿ô types ¤¬»Ø¤¹Îΰè¤ògfs_glob_init(3) ¤ÇưŪ¤Ë³ÎÊݤ·¡¢ »ÈÍѸå gfs_glob_free(3) ¤Ç²òÊü¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£

RETURN VALUES

NULL

Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£

GFARM_ERR_NO_MEMORY

¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£

GFARM_ERR_PATHNAME_TOO_LONG

¥Ñ¥¿¡¼¥ó¤¢¤ë¤¤¤Ï¥Ñ¥¹Ì¾¤¬Ä¹¤¹¤®¤Æ½èÍý¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿¡£

¤½¤Î¾

¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£

SEE ALSO

gfs_glob_init(3) gfs_glob_free(3) gfarm_stringlist_init(3) gfarm_stringlist_length(3) gfarm_stringlist_elem(3) gfarm_stringlist_free(3) gfarm_stringlist_free_deeply(3)

gfarm-2.4.1/doc/html/ja/ref/man3/gfs_pio_sync.3.html0000644000000000000000000000450411507222722020541 0ustar rootroot gfs_pio_sync

gfs_pio_sync

Name

gfs_pio_sync -- ¥á¥â¥ê¾å¤Î¥Õ¥¡¥¤¥ë¤ÎÆâÍÆ¤ò¥Ç¥£¥¹¥¯¤ËÈ¿±Ç¤µ¤»¤ë

Synopsis

#include <gfarm/gfarm.h>

char *gfs_pio_sync(GFS_File gf);

DESCRIPTION

½ñ¤­¹þ¤ßÍѤ˥ª¡¼¥×¥ó¤·¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë gf ¤Î¡¢¥á¥â¥ê¾å¤Ë¤¢¤ë¥Ç¡¼¥¿¤ò¼ÂºÝ¤Ë¥Ç¥£¥¹¥¯¤Ë½ñ¤­¹þ¤ß¡¤ Æþ½ÐÎϤδ°Î»¤òÂԤäƤ«¤éÌá¤ê¤Þ¤¹¡¥¤Þ¤¿¡¤ ¥Õ¥¡¥¤¥ë¤Î¥á¥¿¥Ç¡¼¥¿¤â¹¹¿·¤·¤Þ¤¹¡¥ Ê̤δؿô gfs_pio_datasync ¤â¥á¥â¥ê¾å¤Î¥Õ¥¡¥¤¥ë¥Ç¡¼¥¿¤ò¥Ç¥£¥¹¥¯¤Ë½ñ¤­¹þ¤ß¤Þ¤¹¤¬¡¤ ¥á¥¿¥Ç¡¼¥¿¤Ï¹¹¿·¤·¤Þ¤»¤ó¡¥

RETURN VALUES

NULL

Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡¥

GFARM_ERR_NO_MEMORY

¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡¥

¤½¤Î¾

¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡¥

SEE ALSO

gfs_pio_datasync(3), gfs_pio_create(3), gfs_pio_open(3), gfs_pio_write(3), gfs_pio_flush(3)

gfarm-2.4.1/doc/html/ja/ref/man3/gfs_rmdir.3.html0000644000000000000000000000412411507222722020031 0ustar rootroot gfs_rmdir

gfs_rmdir

Name

gfs_rmdir -- ¥Ç¥£¥ì¥¯¥È¥êºï½ü

DESCRIPTION

°ú¿ô gfarm_url ¤Ë»ØÄꤷ¤¿Ì¾Á°¤Î¥Ç¥£¥ì¥¯¥È¥ê¤òºï½ü¤·¤Þ¤¹¡£

RETURN VALUES

NULL

Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£

GFARM_ERR_NO_MEMORY

¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£

GFARM_ERR_PERMISSION_DENIED

gfarm_url ¤Î¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤Ø½ñ¤­¹þ¤ß¥¢¥¯¥»¥¹¤¹¤ë¸¢¸Â¤¬¤¢¤ê¤Þ¤»¤ó¡£

GFARM_ERR_DIRECTORY_NOT_EMPTY

»ØÄꤵ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¤¬¡¢¶õ¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£

GFARM_ERR_NO_SUCH_OBJECT

»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Þ¤»¤ó¡£

GFARM_ERR_NOT_A_DIRECTORY

»ØÄꤷ¤¿¥Ñ¥¹Ì¾¤Î¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤¬¡¢¼ÂºÝ¤Ë¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤«¤Ã¤¿¤³¤È¤ò ¼¨¤·¤Þ¤¹¡£

¤½¤Î¾

¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£

gfarm-2.4.1/doc/html/ja/ref/man3/gfarm_terminate.3.html0000644000000000000000000000317411507222722021225 0ustar rootroot gfarm_terminate

gfarm_terminate

Name

gfarm_terminate -- gfarm ¥é¥¤¥Ö¥é¥ê¤Ë´Ø¤¹¤ë½ªÎ»½èÍý¤ò¤¹¤ë

Synopsis

#include <gfarm/gfarm.h>

gfarm_error_t gfarm_terminate(void);

DESCRIPTION

Gfarm ¥é¥¤¥Ö¥é¥ê¤Ë¤Ä¤¤¤Æ¡¢½ªÎ»½èÍý¤ò¹Ô¤¤¤Þ¤¹¡£

RETURN VALUES

GFARM_ERR_NO_ERROR

Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£

¤½¤Î¾

¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£

SEE ALSO

gfarm_initialize(3)

gfarm-2.4.1/doc/html/ja/ref/man3/gfs_pio_puts.3.html0000644000000000000000000000353511507222722020563 0ustar rootroot gfs_pio_puts

gfs_pio_puts

Name

gfs_pio_puts -- Ê¸»úÎó½ñ¤­¹þ¤ß

Synopsis

#include <gfarm/gfarm.h>

char *gfs_pio_puts(GFS_File gf, char * s);

DESCRIPTION

ʸ»úÎó s ¤ò¥Õ¥¡¥¤¥ë gf ¤Ë½ñ¤­¹þ¤ß¤Þ¤¹¡£

RETURN VALUES

NULL

Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£

GFARM_ERR_NO_MEMORY

¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£

¤½¤Î¾

¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£

SEE ALSO

gfs_pio_create(3), gfs_pio_open(3)

gfarm-2.4.1/doc/html/ja/ref/man3/gfarm_strings_free_deeply.3.html0000644000000000000000000000245411507222722023271 0ustar rootroot gfarm_strings_free_deeply

gfarm_strings_free_deeply

Name

gfarm_strings_free_deeply -- Ê¸»úÎó¤ò²òÊü¤¹¤ë

Synopsis

#include <gfarm/gfarm.h>

void gfarm_strings_free_deeply(int n, char ** strings);

DESCRIPTION

Í×ÁÇ¿ô n ¤Îʸ»úÎóÇÛÎó strings ¤ò²òÊü¤·¤Þ¤¹¡£ ¤Þ¤¿¡¢ÇÛÎóÍ×ÁǤγÆÊ¸»úÎó¤â¡¢²òÊü¤·¤Þ¤¹¡£

gfarm-2.4.1/doc/html/ja/ref/man3/gfs_mkdir.3.html0000644000000000000000000000406211507222722020023 0ustar rootroot gfs_mkdir

gfs_mkdir

Name

gfs_mkdir -- ¥Ç¥£¥ì¥¯¥È¥êºîÀ®

Synopsis

#include <gfarm/gfarm.h>

char *gfs_mkdir(char * gfarm_url, gfarm_mode_t mode);

DESCRIPTION

°ú¿ô gfarm_url ¤Ë»ØÄꤷ¤¿Ì¾Á°¤Î¥Ç¥£¥ì¥¯¥È¥ê¤ò¡¢¥â¡¼¥É mode ¤ÇºîÀ®¤·¤Þ¤¹¡£

RETURN VALUES

NULL

Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£

GFARM_ERR_NO_MEMORY

¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£

GFARM_ERR_ALREADY_EXISTS

»ØÄꤷ¤¿¥Ç¥£¥ì¥¯¥È¥ê¤¬´û¤Ë¸ºß¤·¤Þ¤¹¡£

GFARM_ERR_NO_SUCH_OBJECT

»ØÄꤷ¤¿¥Ñ¥¹Ì¾¤Î¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤¬¡¢¼ÂºÝ¤Ë¤Ï¸ºß¤·¤Ê¤«¤Ã¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£

GFARM_ERR_NOT_A_DIRECTORY

»ØÄꤷ¤¿¥Ñ¥¹Ì¾¤Î¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤¬¡¢¼ÂºÝ¤Ë¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤«¤Ã¤¿¤³¤È¤ò ¼¨¤·¤Þ¤¹¡£

¤½¤Î¾

¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£

gfarm-2.4.1/doc/html/ja/ref/man3/gfs_utimes.3.html0000644000000000000000000000550611507222722020227 0ustar rootroot gfs_utimes

gfs_utimes

Name

gfs_utimes -- ¥Õ¥¡¥¤¥ë¥¢¥¯¥»¥¹»þ¹ï/½¤Àµ»þ¹ïÊѹ¹

Synopsis

#include <gfarm/gfarm.h>

char *gfs_utimes(const char * gfarm_url, const struct gfarm_timespec * tsp);

DESCRIPTION

°ú¿ô gfarm_url ¤Î¥Õ¥¡¥¤¥ë¥¢¥¯¥»¥¹»þ¹ï/½¤Àµ»þ¹ï¤ò tsp ¤ÎÃͤËÊѹ¹¤·¤Þ¤¹¡£ tsp[0] ¤ÎÃͤò¥¢¥¯¥»¥¹»þ¹ï¤Ë¡¢ tsp[1] ¤ÎÃͤò½¤Àµ»þ¹ï¤Ë»ÈÍѤ·¤Þ¤¹¡£ ¹½Â¤ÂÎ gfarm_timespec ¤Ï°Ê²¼¤Î¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£
	struct gfarm_timespec {
		unsigned int tv_sec;	/* seconds */
		unsigned int tv_nsec;	/* nanoseconds */
	};

tsp ¤¬ NULL ¤Î¾ì¹ç¡¢¸½ºß¤Î»þ¹ï¤òÀßÄꤷ¤Þ¤¹¡£

RETURN VALUES

NULL

Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£

GFARM_ERR_GFARM_URL_PREFIX_IS_MISSING

¥Õ¥¡¥¤¥ë̾¤Ë Gfarm URL ¤Î gfarm: ¤¬¤¢¤ê¤Þ¤»¤ó¡£

GFARM_ERR_NO_MEMORY

¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£

GFARM_ERR_AUTHENTICATION

gfmd(8) ¤ËÂФ¹¤ë¥æ¡¼¥¶¡¼Ç§¾Ú¤¬¼ºÇÔ¤·¤Þ¤·¤¿¡£

GFARM_ERR_PERMISSION_DENIED

»ØÄꤵ¤ì¤¿¥Ñ¥¹¤Ø¥¢¥¯¥»¥¹¤¹¤ë¸¢¸Â¤¬¡¢¤¢¤ê¤Þ¤»¤ó¡£

GFARM_ERR_NO_SUCH_OBJECT

»ØÄꤵ¤ì¤¿¥Ñ¥¹Ì¾¤¬Â¸ºß¤·¤Þ¤»¤ó¡£

¤½¤Î¾

¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£

SEE ALSO

gfs_stat(3)

gfarm-2.4.1/doc/html/ja/ref/man3/gfs_pio_read.3.html0000644000000000000000000000564111507222722020503 0ustar rootroot gfs_pio_read

gfs_pio_read

Name

gfs_pio_read -- ¥Õ¥¡¥¤¥ë¤ÎÆÉ¤ß¹þ¤ß

Synopsis

#include <gfarm/gfarm.h>

gfarm_error_t gfs_pio_read(GFS_File gf, void * buffer, int size, int * np);

DESCRIPTION

buffer¤«¤é size ¥Ð¥¤¥È¤À¤±¡¢¥Õ¥¡¥¤¥ë gf ¤ÎÆâÍÆ¤òÆÉ¤ß¹þ¤ß¤Þ¤¹¡£ ÆÉ¤ß¹þ¤Þ¤ì¤¿¥Ð¥¤¥È¿ô¤Ï np ¤Î»Ø¤¹Àè¤ËÊÖ¤·¤Þ¤¹¡£¤³¤ÎÃͤ¬ 0 ¤Î¾ì¹ç¤Ë¤Ï EOF ¤ò°ÕÌ£¤·¤Þ¤¹¡£

RETURN VALUES

GFARM_ERR_NO_ERROR

Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£

GFARM_ERR_OPERATION_NOT_PERMITTED

gf ¤Ç»ØÄꤵ¤ì¤ë¥Õ¥¡¥¤¥ë¤¬¥ì¥®¥å¥é¡¼¥Õ¥¡¥¤¥ë¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£

GFARM_ERR_BAD_FILE_DESCRIPTOR

gf ¤Ç»ØÄꤵ¤ì¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬ÉÔÀµ¡¢ ¤¢¤ë¤¤¤ÏÆÉ¹þ²Äǽ¤Ç¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£

GFARM_ERR_NO_FILE_SYSTEM_NODE

ÍøÍѲÄǽ¤Ê¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤¬¤¢¤ê¤Þ¤»¤ó¡£

GFARM_ERR_NO_MEMORY

¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£

¤½¤Î¾

¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ gfarm_error_string(3) ¤Ë¤è¤ê¥¨¥é¡¼¤Î¸¶°ø¤òʸ»úÎó¤ËÊÑ´¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£

SEE ALSO

gfs_pio_create(3), gfs_pio_open(3)

gfarm-2.4.1/doc/html/ja/ref/man3/gfs_pio_open.3.html0000644000000000000000000001565111507222722020533 0ustar rootroot gfs_pio_open

gfs_pio_open

Name

gfs_pio_open -- Gfarm¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥Õ¥¡¥¤¥ë¤Î¥ª¡¼¥×¥ó

Synopsis

#include <gfarm/gfarm.h>

gfarm_error_t gfs_pio_open(const char * gfarm_url, int flags, GFS_File * gfp);

DESCRIPTION

gfarm_url ¤Ç»ØÄꤷ¤¿¥Õ¥¡¥¤¥ë¤ò¥ª¡¼¥×¥ó¤·¡¢GFS_File ¹½Â¤ÂΤò gfp ¤Î»Ø¤¹Àè¤ËÊÖ¤·¤Þ¤¹¡£ gfarm_url ¤ÏGfarm¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥Ñ¥¹Ì¾¡¢¤¢¤ë¤¤¤Ï gfarm://metaserver:port/path/name ·Á¼°¤ÎGfarm URL¤Ç¤¹¡£

flags ¤Ï¡¢°Ê²¼¤Î¥Õ¥é¥°¤Î bitwise-or ¤Ç»ØÄꤷ¤Þ¤¹¡£ ¤Ï¤¸¤á¤Î»°¤Ä¤Î¥Õ¥é¥°¤Ï¤É¤ì¤«¤¬»ØÄꤵ¤ì¤Æ¤¤¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£

GFARM_FILE_RDONLY

ÆÉ¹þ¤ß¥â¡¼¥É¤Ç¥Õ¥¡¥¤¥ë¤ò¥ª¡¼¥×¥ó¤·¤Þ¤¹¡£

GFARM_FILE_WRONLY

½ñ¹þ¤ß¥â¡¼¥É¤Ç¥Õ¥¡¥¤¥ë¤ò¥ª¡¼¥×¥ó¤·¤Þ¤¹¡£

GFARM_FILE_RDWR

ÆÉ¤ß½ñ¤­¥â¡¼¥É¤Ç¥Õ¥¡¥¤¥ë¤ò¥ª¡¼¥×¥ó¤·¤Þ¤¹¡£

GFARM_FILE_TRUNC

¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¡¢¥ì¥®¥å¥é¡¼¥Õ¥¡¥¤¥ë¤Ç½ñ¹þ¤ß¤¬µö¤µ¤ì¤ë¾ì¹ç¡¢¥Õ¥¡¥¤¥ë¥µ¥¤¥º¤ò0¤Ë¤·¤Þ¤¹¡£

RETURN VALUES

GFARM_ERR_NO_ERROR

Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£

GFARM_ERR_IS_A_DIRECTORY

»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤¹¡£

GFARM_ERR_IS_A_SYMBOLIC_LINK

»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤Ï¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Ç¤¹¡£

GFARM_ERR_OPERATION_NOT_PERMITTED

»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤Ï¥Õ¥¡¥¤¥ë¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£

GFARM_ERR_NO_SUCH_OBJECT

»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Þ¤»¤ó¡£

GFARM_ERR_NOT_A_DIRECTORY

»ØÄꤷ¤¿¥Ñ¥¹Ì¾¤Î¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤¬¡¢¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£

GFARM_ERR_PERMISSION_DENIED

»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤ËÂФ·¡¢ flags ¤Ç»ØÄꤵ¤ì¤¿¥â¡¼¥É¤Ç¥¢¥¯¥»¥¹¤¹¤ë¸¢¸Â¤¬¤Ê¤¤¤«¡¢ ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤Ø¤Îǧ¾Ú¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£

GFARM_ERR_NO_MEMORY

¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£

GFARM_ERR_INVALID_ARGUMENT

flags ¤Î»ØÄ꤬ÉÔÀµ¤Ç¤¹¡£

GFARM_ERR_GFARM_URL_HOST_IS_MISSING

gfarm_url ¤Ç»ØÄꤵ¤ì¤¿Gfarm URL¤Ë¤ª¤¤¤Æ¡¢ ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤¬»ØÄꤵ¤ì¤Æ¤¤¤Þ¤»¤ó¡£

GFARM_ERR_GFARM_URL_PORT_IS_MISSING

gfarm_url ¤Ç»ØÄꤵ¤ì¤¿Gfarm URL¤Ë¤ª¤¤¤Æ¡¢ ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤Î¥Ý¡¼¥ÈÈֹ椬»ØÄꤵ¤ì¤Æ¤¤¤Þ¤»¤ó¡£

GFARM_ERR_UNKNOWN_HOST

»ØÄꤵ¤ì¤¿¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤Î¥¢¥É¥ì¥¹²ò·è¤¬¤Ç¤­¤Þ¤»¤ó¡£

GFARM_ERR_TOO_MANY_OPEN_FILES

¥×¥í¥»¥¹¤Ë¤ª¤±¤ë¥ª¡¼¥×¥ó²Äǽ¤Ê¥Õ¥¡¥¤¥ë¿ô¤Î¸Â³¦¤Ë㤷¤Þ¤·¤¿¡£

GFARM_ERR_TOO_MANY_OPEN_FILES_IN_SYSTEM

¥·¥¹¥Æ¥à¤Ë¤ª¤±¤ë¥ª¡¼¥×¥ó¤Ç¤­¤ë¥Õ¥¡¥¤¥ë¿ô¤Î¸Â³¦¤Ë㤷¤Þ¤·¤¿¡£

GFARM_ERR_NETWORK_IS_UNREACHABLE

¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤ËÅþã¤Ç¤­¤Þ¤»¤ó¡£

GFARM_ERR_OPERATION_TIMED_OUT

¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤Ø¤ÎÀܳ¤¬¥¿¥¤¥à¥¢¥¦¥È¤ò¤ª¤³¤·¤Þ¤·¤¿¡£

GFARM_ERR_PROTOCOL

¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤È¤ÎÄÌ¿®¤Ë¥×¥í¥È¥³¥ë¥¨¥é¡¼¤¬È¯À¸¤·¤Þ¤·¤¿¡£

GFARM_ERR_BROKEN_PIPE

¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤È¤ÎÄÌ¿®¤¬ÀÚÃǤ·¤Þ¤·¤¿¡£

GFARM_ERR_PROTOCOL_NOT_SUPPORTED

»ØÄꤵ¤ì¤¿Ç§¾Ú¥×¥í¥È¥³¥ë¤Ï¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Þ¤»¤ó¡£

GFARM_ERR_AUTHENTICATION

¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤ËÂФ¹¤ëǧ¾Ú¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£

¤½¤Î¾

¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ gfarm_error_string(3) ¤Ë¤è¤ê¥¨¥é¡¼¤Î¸¶°ø¤òʸ»úÎó¤ËÊÑ´¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£

SEE ALSO

gfs_pio_close(3), gfs_pio_create(3), gfs_pio_eof(3), gfs_pio_error(3), gfs_pio_flush(3), gfs_pio_getc(3), gfs_pio_getline(3), gfs_pio_open(3), gfs_pio_putc(3), gfs_pio_putline(3), gfs_pio_puts(3), gfs_pio_read(3), gfs_pio_seek(3), gfs_pio_ungetc(3), gfs_pio_write(3)

gfarm-2.4.1/doc/html/ja/ref/man3/gfs_pio_eof.3.html0000644000000000000000000000341111507222722020332 0ustar rootroot gfs_pio_eof

gfs_pio_eof

Name

gfs_pio_eof -- ¥Õ¥¡¥¤¥ëËöÈøÈ½ÊÌ

Synopsis

#include <gfarm/gfarm.h>

int gfs_pio_eof(GFS_File gf);

DESCRIPTION

¥Õ¥¡¥¤¥ë gf ¤ÎÆÉ¤ß¹þ¤ß½èÍý¤¬¡¢¥Õ¥¡¥¤¥ëËöÈø¤Ë㤷¤¿¤«Èݤ«¤ò¼¨¤·¤Þ¤¹¡£

RETURN VALUES

0

¤Þ¤ÀËöÈø¤Ë㤷¤Æ¤¤¤Þ¤»¤ó¡£

¤½¤Î¾

¥Õ¥¡¥¤¥ë¤ÎËöÈø¤Ë㤷¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£

SEE ALSO

gfs_pio_create(3), gfs_pio_error(3), gfs_pio_open(3)

gfarm-2.4.1/doc/html/ja/ref/man3/gfarm_stringlist_cat.3.html0000644000000000000000000000507011507222722022263 0ustar rootroot gfarm_stringlist_cat

gfarm_stringlist_cat

Name

gfarm_stringlist_cat -- stringlist ¤Ëʸ»úÎóÇÛÎó¤òÄɲ乤ë

Synopsis

#include <gfarm/gfarm.h>

char *gfarm_stringlist_cat(gfarm_stringlist * listp, char ** v);

DESCRIPTION

listp ¤Îɽ¤¹Ê¸»úÎóÇÛÎó¤ÎËöÈø¤Ë¡¢NULL ¤Ç½ªÎ»¤¹¤ëʸ»úÎóÇÛÎó v ¤òÄɲä·¤Þ¤¹¡£

RETURN VALUES

NULL

Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£

GFARM_ERR_NO_MEMORY

¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£

¤½¤Î¾

¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£

SEE ALSO

GFARM_STRINGLIST_ELEM(3), GFARM_STRINGLIST_STRARRAY(3), gfarm_stringlist_add(3), gfarm_stringlist_elem(3), gfarm_stringlist_free(3), gfarm_stringlist_free_deeply(3), gfarm_stringlist_init(3), gfarm_stringlist_length(3)

gfarm-2.4.1/doc/html/ja/ref/man3/gfs_pio_close.3.html0000644000000000000000000000425211507222722020672 0ustar rootroot gfs_pio_close

gfs_pio_close

Name

gfs_pio_close -- Gfarm¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥Õ¥¡¥¤¥ë¤Î¥¯¥í¡¼¥º

Synopsis

#include <gfarm/gfarm.h>

gfarm_error_t gfs_pio_close(GFS_File gfp);

DESCRIPTION

¥Õ¥¡¥¤¥ë gfp ¤ò¥¯¥í¡¼¥º¤·¤Þ¤¹¡£

RETURN VALUES

GFARM_ERR_NO_ERROR

Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£

GFARM_ERR_BAD_FILE_DESCRIPTOR

gfp ¤Ç»ØÄꤵ¤ì¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬ÉÔÀµ¤Ç¤¹¡£

GFARM_ERR_NO_MEMORY

¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£

¤½¤Î¾

¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ gfarm_error_string(3) ¤Ë¤è¤ê¥¨¥é¡¼¤Î¸¶°ø¤òʸ»úÎó¤ËÊÑ´¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£

SEE ALSO

gfs_pio_create(3), gfs_pio_open(3)

gfarm-2.4.1/doc/html/ja/ref/man3/gfs_readdir.3.html0000644000000000000000000000414011507222722020324 0ustar rootroot gfs_readdir

gfs_readdir

Name

gfs_readdir -- ¥Ç¥£¥ì¥¯¥È¥êÆâÍÆÆÉ¤ß¹þ¤ß

Synopsis

#include <gfarm/gfarm.h>

char *gfs_readdir(GFS_Dir dir, struct gfs_dirent ** entryp);

DESCRIPTION

°ú¿ô dir ¤Ç»ØÄꤷ¤¿¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¡¢1 ¤Ä¤Î¥Ç¥£¥ì¥¯¥È¥ê¡¦¥¨¥ó¥È¥ê ¤òÆÉ¤ß¹þ¤ß¡¢¤½¤Î¥Ý¥¤¥ó¥¿¤ò entryp ¤Î»Ø¤¹Àè¤ËÊÖ¤·¤Þ¤¹¡£ entryp ¤Î»Ø¤¹Îΰè¤Ï¡¢¼¡¤ËƱ¤¸ dir °ú¿ô¤Ç gfs_readdir() ¤Ê¤¤¤· gfs_closedir() ¤ò¸Æ¤Ó½Ð¤·¤¿»þ¤Ë¼º¤ï¤ì¤Þ¤¹¡£

RETURN VALUES

NULL

Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£

¤½¤Î¾

¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£

SEE ALSO

gfs_closedir(3), gfs_opendir(3), gfs_readdir(3)

gfarm-2.4.1/doc/html/ja/ref/man3/gfs_unlink_section.3.html0000644000000000000000000000440311507222722021740 0ustar rootroot gfs_unlink_section

gfs_unlink_section

Name

gfs_unlink_section -- ¥Õ¥¡¥¤¥ë¥»¥¯¥·¥ç¥óºï½ü

Synopsis

#include <gfarm/gfarm.h>

char *gfs_unlink_section(char * gfarm_url, char * section);

DESCRIPTION

°ú¿ô gfarm_url, section ¤Ë»ØÄꤷ¤¿¥Õ¥¡¥¤¥ë¥»¥¯¥·¥ç¥ó¤òºï½ü¤·¤Þ¤¹¡£

RETURN VALUES

NULL

Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£

GFARM_ERR_NO_MEMORY

¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£

GFARM_ERR_AUTHENTICATION

gfmd(8) ¤ËÂФ¹¤ë¥æ¡¼¥¶¡¼Ç§¾Ú¤¬¼ºÇÔ¤·¤Þ¤·¤¿¡£

GFARM_ERR_PERMISSION_DENIED

gfarm_url ¤Î¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤Ø½ñ¤­¹þ¤ß¥¢¥¯¥»¥¹¤¹¤ë¸¢¸Â¤¬¤¢¤ê¤Þ¤»¤ó¡£

GFARM_ERR_NO_SUCH_OBJECT

»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¥»¥¯¥·¥ç¥ó¤¬Â¸ºß¤·¤Þ¤»¤ó¡£

GFARM_ERR_NOT_A_DIRECTORY

»ØÄꤷ¤¿¥Ñ¥¹Ì¾¤Î¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤¬¡¢¼ÂºÝ¤Ë¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤«¤Ã¤¿¤³¤È¤ò ¼¨¤·¤Þ¤¹¡£

¤½¤Î¾

¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£

gfarm-2.4.1/doc/html/ja/ref/man3/gfarm_import_fragment_size_alloc.3.html0000644000000000000000000000503711507222722024636 0ustar rootroot gfarm_import_fragment_size_alloc

gfarm_import_fragment_size_alloc

Name

gfarm_import_fragment_size_alloc -- ¥Õ¥é¥°¥á¥ó¥È¥µ¥¤¥º¤ÎÇÛÎó¤ò³ä¤êÅö¤Æ¤ë

Synopsis

#include <gfarm/gfarm.h>

file_offset_t *gfarm_import_fragment_size_alloc(file_offset_t total_size, int n);

DESCRIPTION

Gfarm¥Õ¥¡¥¤¥ë¤ò¥¤¥ó¥Ý¡¼¥È¤¹¤ë¥¢¥×¥ê¥±¡¼¥·¥ç¥óÍѤÎÊä½õ´Ø¿ô¤Î°ì¤Ä¤Ç¤¹¡£

¥¤¥ó¥Ý¡¼¥È½èÍý¤Ë¤Ï¡¢¥Õ¥¡¥¤¥ë¤ò¡¢¤É¤ì¤¯¤é¤¤¤Î¥µ¥¤¥º¤Î¥Õ¥é¥°¥á¥ó¥È¤Ë ʬ³ä¤¹¤ë¤«¤È¤¤¤¦¾ðÊó¤¬É¬ÍפǤ¹¡£¸µ¥Õ¥¡¥¤¥ë¤Î¥µ¥¤¥º¤ò°ú¿ô total_size ¤Ë¡¢¥Õ¥é¥°¥á¥ó¥È¿ô¤ò°ú¿ô n ¤ËÍ¿¤¨¤ë¤È¡¢¤³¤Î´Ø¿ô¤Ï·ë²Ì¤È¤·¤Æ¡¢³Æ¥Õ¥é¥°¥á¥ó¥È¤Îʬ³ä¥µ¥¤¥º¤ÎÌܰ¤ò¡¢ Í×ÁÇ¿ô n ¤ÎÇÛÎó¤È¤·¤ÆÊÖ¤·¤Þ¤¹¡£

¤³¤Î´Ø¿ô¤È gfarm_hostlist_read(3) ´Ø¿ô¤Î·ë²Ì¤òÁȤ߹ç¤ï¤»¤ë¤³¤È¤Ë¤è¤Ã¤Æ¡¢ gfarm_import_fragment_config_read(3) ´Ø¿ô¤¬ÊÖ¤¹¥Õ¥é¥°¥á¥ó¥Èʬ³ä¾ðÊó ¤ÈƱ¤¸·Á¼°¤Î¾ðÊó¤òÆÀ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£

¤³¤Î´Ø¿ô¤ÇÆÀ¤¿ÇÛÎó¤Ï free(3) ¤òÍѤ¤¤Æ²òÊü¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£

RETURN VALUES

NULL

¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£

¤½¤Î¾

½èÍý¤ËÀ®¸ù¤·¤¿¾ì¹ç¡¢ file_offset_t ·¿¤ÎÇÛÎó¤ÎÀèÆ¬Í×ÁǤؤΥݥ¤¥ó¥¿¤òÊÖ¤·¤Þ¤¹¡£

SEE ALSO

gfarm_hostlist_read(3), gfarm_import_fragment_config_read(3)

gfarm-2.4.1/doc/html/ja/ref/Makefile0000644000000000000000000000040611507222722015627 0ustar rootroottop_builddir = ../../../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk SUBDIRS = man1 man3 man5 man8 htmldir=$(default_htmldir)/ja/ref HTML = index.html include $(top_srcdir)/makes/subdir.mk include $(top_srcdir)/makes/html.mk gfarm-2.4.1/doc/html/ja/ref/man8/0000755000000000000000000000000011507222730015031 5ustar rootrootgfarm-2.4.1/doc/html/ja/ref/man8/gfmd.8.html0000644000000000000000000000634711507222721017014 0ustar rootroot gfmd

gfmd

Name

gfmd(8) -- Gfarm¥á¥¿DB¡¦¥Ç¡¼¥â¥ó

Synopsis

gfmd [¥ª¥×¥·¥ç¥ó]

DESCRIPTION

gfmd¤Ï¡¢Gfarm¥é¥¤¥Ö¥é¥ê¤È¶¨Ä´¤·¤ÆÆ°ºî¤·¡¢Gfarm¥Õ¥¡¥¤¥ë¥·¥¹¥Æ ¥à¤Î¥á¥¿¥Ç¡¼¥¿¤Ø¤Î¥¢¥¯¥»¥¹¤òÄ󶡤¹¤ë¥Ç¡¼¥â¥ó¥×¥í¥°¥é¥à¤Ç¤¹¡£ gfmd¤ÏGfarm¤Î¥á¥¿DB¥µ¡¼¥Ð¡¼¡¦¥Û¥¹¥È¾å¤Ç¡¢ ¤¢¤é¤«¤¸¤áΩ¤Á¾å¤²¤Æ¤ª¤¯É¬Íפ¬¤¢¤ê¤Þ¤¹¡£

gfmd¤Ï¥æ¡¼¥¶¸¢¸Â¤Çưºî¤µ¤»¤ë¤³¤È¤â²Äǽ¤Ç¤¹¤¬¡¢¤³¤Î¾ì¹ç¾¤Î¥æ¡¼¥¶¤Ï¤³ ¤Îgfmd¤òÍøÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£ ¾ÜºÙ¤ÏSETUP.private.ja¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£

gfmd¤òÍøÍѤ¹¤ë¤¿¤á¤Ë¤Ï¡¤ ¥¯¥é¥¤¥¢¥ó¥È¥Î¡¼¥É¤Î~/.gfarm2rc¤¢¤ë¤¤¤Ï%%SYSCONFDIR%%/gfarm2.conf¤Î metadb_server_host¤ÇÍøÍѤ·¤¿¤¤gfmd¤Î¥Û¥¹¥È̾¡¤ metadb_server_port¤Ç¥Ý¡¼¥ÈÈÖ¹æ¤ò»ØÄꤹ¤ëɬÍפ¬¤¢¤ê¤Þ ¤¹¡¥

OPTIONS

-L ¥í¥°¥ì¥Ù¥ë

¤³¤Î¥ª¥×¥·¥ç¥ó¤Ç»ØÄꤷ¤¿¥ì¥Ù¥ë°Ê¾å¤ÎÍ¥ÀèÅÙ¤Î¥í¥°¤ò½ÐÎϤ·¤Þ¤¹¡£ »ØÄê¤Ç¤­¤ëÃͤÏgfarm2.conf(5)¤Îlog_level¤Î¹à¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£

-P PID¥Õ¥¡¥¤¥ë

gfmd¤Îprocess ID¤ò¡¢»ØÄꤷ¤¿¥Õ¥¡¥¤¥ë¤Ëµ­Ï¿¤·¤Þ¤¹¡£

-d

¥Ç¥Ð¥Ã¥°¥ª¥×¥·¥ç¥ó¤Ç¤¹¡£¥Ç¡¼¥â¥ó¤È¤·¤Æ¤Ç¤Ï¤Ê¤¯¡¢¥Õ¥©¥¢¥°¥é¥¦¥ó¥É¡¦ ¥×¥í¥»¥¹¤È¤·¤ÆÎ©¤Á¾å¤¬¤ê¤Þ¤¹¡£

¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¡¢¤«¤Ä-L¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Ê¤«¤Ã¤¿ ¾ì¹ç¡¢¥í¥°¥ì¥Ù¥ë¤Ïdebug¤È¤Ê¤ê¤Þ¤¹¡£

-f ÀßÄê¥Õ¥¡¥¤¥ë

µ¯Æ°»þ¤ËÆÉ¤ß¹þ¤àÀßÄê¥Õ¥¡¥¤¥ë¤ò»ØÄꤷ¤Þ¤¹¡¥

-p ¥Ý¡¼¥ÈÈÖ¹æ

gfmd¤¬ÍøÍѤ¹¤ëTCP¤Î¥Ý¡¼¥ÈÈÖ¹æ¤ò»ØÄꤷ¤Þ¤¹¡£

-s syslog¥Õ¥¡¥·¥ê¥Æ¥£

gfmd¤¬¥¨¥é¡¼Êó¹ð¤ËÍѤ¤¤ësyslog¤Î¥Õ¥¡¥·¥ê¥Æ¥£¤ò»ØÄꤷ¤Þ¤¹¡£¾Êά ¤·¤¿¾ì¹ç¤Ë¤Ï¡¢local0¤ò»ÈÍѤ·¤Þ¤¹¡£

-v

ǧ¾Ú½èÍý¤Ë´Ø¤¹¤ë¥í¥°¤ò¾Ü¤·¤¯½ÐÎϤ·¤Þ¤¹¡£ GSIǧ¾Ú¤ÎÌäÂê¤ò²ò·è¤¹¤ë¾ì¹ç¤ËÍ­ÍѤʥª¥×¥·¥ç¥ó¤Ç¤¹¡£

-?

°ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡£

FILES

%%SYSCONFDIR%%/gfmd.conf

gfmd¤¬»²¾È¤¹¤ëÀßÄê¥Õ¥¡¥¤¥ë¤Ç¤¹¡£

SEE ALSO

gfarm2.conf(5)

gfarm-2.4.1/doc/html/ja/ref/man8/Makefile0000644000000000000000000000052311507222721016471 0ustar rootroot# $Id: Makefile 2373 2006-01-12 00:54:22Z soda $ top_builddir = ../../../../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk htmldir=$(default_htmldir)/ja/ref/man8 DOCBOOK_DIR=$(top_srcdir)/doc/docbook/ja/ref/man8 include $(DOCBOOK_DIR)/Makefile.inc HTMLSRC=$(DOCBOOK) include $(top_srcdir)/makes/html.mk gfarm-2.4.1/doc/html/ja/ref/man8/gfsd.8.html0000644000000000000000000001007211507222721017010 0ustar rootroot gfsd

gfsd

Name

gfsd(8) -- Gfarm¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¡¦¥Ç¡¼¥â¥ó

Synopsis

gfsd [¥ª¥×¥·¥ç¥ó]

DESCRIPTION

gfsd¤Ï¡¢Gfarm¥é¥¤¥Ö¥é¥ê¤È¶¨Ä´¤·¤ÆÆ°ºî¤·¡¢Gfarm¥Õ¥¡¥¤¥ë¥·¥¹¥Æ ¥à¤ò¼Â¸½¤¹¤ë¥Ç¡¼¥â¥ó¥×¥í¥°¥é¥à¤Ç¤¹¡£ gfsd¤Ï¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤ÎÁ´¥Û¥¹¥È¾å¤Ç¡¢ root¸¢¸Â¤Ç¤¢¤é¤«¤¸¤áΩ¤Á¾å¤²¤Æ¤ª¤¯É¬Íפ¬¤¢¤ê¤Þ¤¹¡£

gfsd¤¬Ä󶡤¹¤ë¤Î¤Ï¡¢¥Õ¥¡¥¤¥ë¤Î¼ÂÂΤؤΥ¢¥¯¥»¥¹¤Ç¤¹¡£ gfsd ¤¬ÍøÍѤ¹¤ë¥Ý¡¼¥ÈÈÖ¹æ¤Ï¡¢gfmd ¤¬´ÉÍý¤¹¤ë¥á¥¿¥Ç¡¼¥¿¤«¤é¼èÆÀ¤·¤Þ¤¹¡£

gfsd¤Ï¥æ¡¼¥¶¸¢¸Â¤Çưºî¤µ¤»¤ë¤³¤È¤â²Äǽ¤Ç¤¹¤¬¡¤¤³¤Î¾ì¹ç¾¤Î¥æ¡¼¥¶¤Ï¤³ ¤Îgfsd¤òÍøÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£ ¾ÜºÙ¤ÏSETUP.private.ja¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£

OPTIONS

-L ¥í¥°¥ì¥Ù¥ë

¤³¤Î¥ª¥×¥·¥ç¥ó¤Ç»ØÄꤷ¤¿¥ì¥Ù¥ë°Ê¾å¤ÎÍ¥ÀèÅÙ¤Î¥í¥°¤ò½ÐÎϤ·¤Þ¤¹¡£ »ØÄê¤Ç¤­¤ëÃͤÏgfarm2.conf(5)¤Îlog_level¤Î¹à¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£

-P PID¥Õ¥¡¥¤¥ë

gfsd¤Îprocess ID¤ò¡¢»ØÄꤷ¤¿¥Õ¥¡¥¤¥ë¤Ëµ­Ï¿¤·¤Þ¤¹¡£

-c

µ¯Æ°»þ¤Ë¡¢¥¹¥×¡¼¥ë¥Ç¥£¥ì¥¯¥È¥ê¤Î¸¡ºº¤ò¹Ô¤¤¤Þ¤¹¡£ ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Î¥Û¥¹¥È̾¤¬ÊѤï¤Ã¤¿¤È¤­¤ËÍøÍѤ¹¤ë¤È¡¢ Àµ¤·¤¯³ÊǼ¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¤ò¥á¥¿¥Ç¡¼¥¿¤ËÅÐÏ¿¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£

-c¥ª¥×¥·¥ç¥ó¤ò¤â¤¦°ìÅÙ»ØÄꤹ¤ë¤È¡¢ ̵¸ú¤Ê¥Õ¥¡¥¤¥ë¤Ê¤É¤ò¾Ãµî¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£

-d

¥Ç¥Ð¥Ã¥°¥ª¥×¥·¥ç¥ó¤Ç¤¹¡£¥Ç¡¼¥â¥ó¤È¤·¤Æ¤Ç¤Ï¤Ê¤¯¡¢¥Õ¥©¥¢¥°¥é¥¦¥ó¥É¡¦ ¥×¥í¥»¥¹¤È¤·¤ÆÎ©¤Á¾å¤¬¤ê¤Þ¤¹¡£

¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¡¢¤«¤Ä-L¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Ê¤«¤Ã¤¿ ¾ì¹ç¡¢¥í¥°¥ì¥Ù¥ë¤Ïdebug¤È¤Ê¤ê¤Þ¤¹¡£

-f ÀßÄê¥Õ¥¡¥¤¥ë

µ¯Æ°»þ¤ËÆÉ¤ß¹þ¤àÀßÄê¥Õ¥¡¥¤¥ë¤ò»ØÄꤷ¤Þ¤¹¡£

-h ¥Û¥¹¥È̾

¼«¥Û¥¹¥È¤Î¥«¥Î¥Ë¥«¥ë¤Ê¥Û¥¹¥È̾¤ò»ØÄꤷ¤Þ¤¹¡¥

-l IP¥¢¥É¥ì¥¹

gfsd¤¬TCP¤ª¤è¤ÓUDP¤ÎÍ×µá¤ò¼õ¤±ÉÕ¤±¤ëIP¥¢¥É¥ì¥¹¤ò»ØÄꤷ¤Þ¤¹¡£ ¥ª¥×¥·¥ç¥ó¾Êά»þ¤Ï¡¢¤½¤Î¥Û¥¹¥È¤ÎÁ´¤Æ¤ÎIP¥¢¥É¥ì¥¹¤Ç¼õ¤±ÉÕ¤±¤Þ¤¹¡£ ¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢°ì¤Ä¤Î¥Î¡¼¥É¤ÇÊ£¿ô¤Î¥¹¥×¡¼¥ë¤òÄ󶡤¹¤ë¾ì¹ç¤Ë¡¢ ¤½¤ì¤¾¤ì¤Î¥¹¥×¡¼¥ë¤´¤È¤Ë¡¢ÊÌ¡¹¤ÎIP¥¢¥É¥ì¥¹¤ò»È¤Ã¤Ægfsd¤òµ¯Æ°¤¹¤ë ¤¿¤á¤ËÍѤ¤¤Þ¤¹¡£

-r ¥¹¥×¡¼¥ë¡¦¥Ç¥£¥ì¥¯¥È¥ê

gfsd¤¬¡¢¥Õ¥¡¥¤¥ë¤Î¼ÂÂΤòÊÝ»ý¤¹¤ë¥Ç¥£¥ì¥¯¥È¥ê̾¤ò»ØÄꤷ¤Þ¤¹¡£

-s syslog¥Õ¥¡¥·¥ê¥Æ¥£

gfsd¤¬¥¨¥é¡¼Êó¹ð¤ËÍѤ¤¤ësyslog¤Î¥Õ¥¡¥·¥ê¥Æ¥£¤ò»ØÄꤷ¤Þ¤¹¡£¾Êά ¤·¤¿¾ì¹ç¤Ë¤Ï¡¢local0¤ò»ÈÍѤ·¤Þ¤¹¡£

-v

ǧ¾Ú½èÍý¤Ë´Ø¤¹¤ë¥í¥°¤ò¾Ü¤·¤¯½ÐÎϤ·¤Þ¤¹¡£ GSIǧ¾Ú¤ÎÌäÂê¤ò²ò·è¤¹¤ë¾ì¹ç¤ËÍ­ÍѤʥª¥×¥·¥ç¥ó¤Ç¤¹¡£

-?

°ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡£

FILES

%%SYSCONFDIR%%/gfarm2.conf

gfsd¤¬»²¾È¤¹¤ëÀßÄê¥Õ¥¡¥¤¥ë¤Ç¤¹¡£

SEE ALSO

gfarm2.conf(5)

gfarm-2.4.1/doc/html/ja/ref/man1/0000755000000000000000000000000011507222730015022 5ustar rootrootgfarm-2.4.1/doc/html/ja/ref/man1/gfhost.1.html0000644000000000000000000003006111507222721017341 0ustar rootroot gfhost

gfhost

Name

gfhost -- gfarm ¥Û¥¹¥È´ÉÍý¥³¥Þ¥ó¥É

Synopsis

gfhost [-H | -l | -M] [-iLprUv] [-P path] [-a ¥¢¡¼¥­¥Æ¥¯¥Á¥ã] [-D ¥É¥á¥¤¥ó̾] [-j ÊÂÎóÅÙ] [¥Û¥¹¥È̾...]

gfhost -c [-P path] -a¥¢¡¼¥­¥Æ¥¯¥Á¥ã -p¥Ý¡¼¥ÈÈÖ¹æ [-nCPU¿ô] ¥Û¥¹¥È̾ [¥Û¥¹¥ÈÊÌ̾...]

gfhost -m [-P path] [-a¥¢¡¼¥­¥Æ¥¯¥Á¥ã] [-p¥Ý¡¼¥ÈÈÖ¹æ] [-nCPU¿ô] [-A] ¥Û¥¹¥È̾ [¥Û¥¹¥ÈÊÌ̾...]

gfhost -d [-P path] ¥Û¥¹¥È̾...

gfhost -R [-P path]

DESCRIPTION

gfhost ¤Ï¡¢gfarm ¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Ë ´Ø¤¹¤ë¾ðÊó¤Îɽ¼¨¤ä´ÉÍý¤ò¹Ô¤Ê¤¤¤Þ¤¹¡£gfhost ¤¬ ¼Â¹Ô¤¹¤ëµ¡Ç½¤Ï¡¢-c, -d, -H, -l, -M, -m, -R ¤Î¥ª¥×¥·¥ç¥ó¤Ç»ØÄꤷ¤Þ¤¹¡£ ¤³¤ì¤éµ¡Ç½¤Î»ØÄê¤ÏÇÓ¾Ū¤Ç¤¢¤ê¡¢¤É¤ì¤«°ì¤Ä¤À¤±¤ò»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ ¤Þ¤¿¡¢°ì¤Ä¤â»ØÄꤷ¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢¥Ç¥Õ¥©¡¼¥ë¥È¤Îµ¡Ç½¤Ç¤¢¤ë¥Û¥¹¥È̾ ɽ¼¨¤¬¹Ô¤Ê¤ï¤ì¤Þ¤¹¡£

FUNCTIONS

µ¡Ç½»ØÄê¤Î¤¦¤Á¡¢-c, -d, -M, -m, -R ¤Ï¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¡¼¤Î¤ß¤ò ¥¢¥¯¥»¥¹¤·¡¢ÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë¥Û¥¹¥È¾ðÊó¤ÎÄɲᢺï½ü¡¢É½¼¨¡¢Êѹ¹¤ò¹Ô¤Ê¤¤¤Þ¤¹¡£

µ¡Ç½»ØÄê¤Î¤¦¤Á¡¢-H, -l, -M, ¤ª¤è¤ÓÆÃ¤Ëµ¡Ç½¤ò»ØÄꤷ¤Ê¤«¤Ã¤¿¾ì¹ç¤Ï¡¢ ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Ë´Ø¤¹¤ë¾ðÊó¤òɽ¼¨¤·¤Þ¤¹¡£ ¤³¤Î¤¦¤Á -M ¤Ï¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¡¼¤Î¤ß¤ò¥¢¥¯¥»¥¹¤·¤Þ¤¹¤¬¡¢ ¤½¤ì°Ê³°¤Îµ¡Ç½¤Ï¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Çưºî¤·¤Æ¤¤¤ë gfsd ¤Ë¤â¥¢¥¯¥»¥¹¤·¤Þ¤¹¡£ gfsd ¤Ë¥¢¥¯¥»¥¹¤¹¤ëµ¡Ç½¤Ë´Ø¤·¤Æ¤Ï¡¢¤½¤Î¥¢¥¯¥»¥¹¤Ë ´Ø¤¹¤ë¥ª¥×¥·¥ç¥ó¤ò -i, -j, -U, -v ¤Ç»ØÄê¤Ç¤­¤Þ¤¹¡£

ɽ¼¨µ¡Ç½¤Ë´Ø¤·¤Æ¤Ï¡¢¥Û¥¹¥È̾¤Î»ØÄê¤ò¾Êά¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¤³¤Î¾ì¹ç¡¢ ¥á¥¿¥Ç¡¼¥¿¤ËÅÐÏ¿¤µ¤ì¤Æ¤¤¤ëÁ´¤Æ¤Î¥Û¥¹¥È¤Ë´Ø¤¹¤ëɽ¼¨¤ò»î¤ß¤Þ¤¹¡£ ¤Þ¤¿¡¢-a ¤ª¤è¤Ó -D ¥ª¥×¥·¥ç¥ó¤Çɽ¼¨¤¹¤ë¥Û¥¹¥È¤Î¼ïÎà¤ò¸ÂÄê ¤¹¤ë¤³¤È¤â¤Ç¤­¤Þ¤¹¡£ ɽ¼¨¤Î½ç½ø¤Ï¡¢¥Û¥¹¥È̾¤Î¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È½ç¤Ç¤¹¤¬¡¢-L, -r, -u ¥ª¥×¥·¥ç¥ó¤Ç ½ç½ø¤òÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¤¿¤À¤·¡¢-M µ¡Ç½ ¤È¡¢µ¡Ç½¤ò»ØÄꤷ¤Ê¤«¤Ã¤¿¾ì¹ç ¤Ë´Ø¤·¤Æ¤Ï -L ¥ª¥×¥·¥ç¥ó¤Ï̵¸ú¤Ç¤¹¡£

²¼µ­¤Ï¡¢gfhost ¥³¥Þ¥ó¥É¤Îµ¡Ç½°ìÍ÷¤Ç¤¹¡£Æó¤Ä°Ê¾å¤Îµ¡Ç½¤òƱ»þ¤Ë »ØÄꤹ¤ë¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó¡£

̵»ØÄê

µ¡Ç½¤òÆÃ¤Ë»ØÄꤷ¤Ê¤«¤Ã¤¿¾ì¹ç¡¢gfsd ¤Ø¤Î Ì䤤¹ç¤ï¤»¤ò¹Ô¤Ê¤¤¡¢Æ°ºî¤·¤Æ¤¤¤ë¥Û¥¹¥È¤Î¥Û¥¹¥È̾¤Î¤ß¤òɽ¼¨¤·¤Þ¤¹¡£ ¥Ç¥Õ¥©¡¼¥ë¥È¤Ç¤Ï¡¢¥Û¥¹¥È̾¤Î¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È½ç¤Çɽ¼¨¤·¤Þ¤¹¡£

-c

°ú¿ô¤Ç»ØÄꤷ¤¿¥Û¥¹¥È¤ò¥á¥¿¥Ç¡¼¥¿¤ØÅÐÏ¿¤·¤Þ¤¹¡£ ¥ª¥×¥·¥ç¥ó -a ¤Ç¡¢¤½¤Î¥Û¥¹¥È¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤ò»ØÄꤹ¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£ ƱÍͤ˥ª¥×¥·¥ç¥ó -p ¤Ç¡¢¤½¤Î¥Û¥¹¥È¤Î¥Ý¡¼¥ÈÈÖ¹æ¤ò»ØÄꤹ¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£ ¥ª¥×¥·¥ç¥ó -n ¤Ç¡¢¤½¤Î¥Û¥¹¥È¤Î CPU ¿ô¤ò»ØÄꤷ¤Þ¤¹¡£¾Êά¤·¤¿¾ì¹ç¤Ë¤Ï 1 CPU ¤À¤È¤ß¤Ê¤·¤Þ¤¹¡£

¥Û¥¹¥È̾¤Ï¡¢°ì¤Ä¤Î¥³¥Þ¥ó¥É¤ÇÊ£¿ôµ­½Ò¤Ç¤­¤Þ¤¹¡£¤³¤Î¾ì¹ç¡¢ºÇ½é¤Ë »ØÄꤷ¤¿Ì¾Á°¤¬¡¢¤½¤Î¥Û¥¹¥È¤Î¸ÇÍ­¼±Ê̻ҤȤ·¤Æ¡¢Ê£À½¾ðÊó¤Î´ÉÍý¤Ë ÍѤ¤¤é¤ì¤Þ¤¹¡£»Ä¤ê¤Î¥Û¥¹¥È̾¤Ï¡¢¤½¤Î¥Û¥¹¥È¤ËÂФ¹¤ëÊÌ̾¤È¤·¤Æ °·¤ï¤ì¤Þ¤¹¡£

¤¢¤ë¥Û¥¹¥È¤¬Ê£¿ô¤Î¥Í¥Ã¥È¥ï¡¼¥¯¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤ò»ý¤Á¡¢¤½¤ì¤¾¤ì¤Î ¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤ËÊÌ¡¹¤Î¥Û¥¹¥È̾¤¬³ä¤êÅö¤Æ¤é¤ì¤Æ¤¤¤ë¾ì¹ç¡¢¤½¤ì¤é Á´¤Æ¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î¥Û¥¹¥È̾¤ò¡¢¸ÇÍ­¼±Ê̻Ҥ¢¤ë¤¤¤ÏÊÌ̾¤È¤·¤Æ ÅÐÏ¿¤·¤Æ¤¯¤À¤µ¤¤¡£

¤Þ¤¿¡¢/etc/hosts ¥Õ¥¡¥¤¥ë¤ä NIS ¤Î hosts ¥Ç¡¼¥¿¥Ù¡¼¥¹¤ËÅÐÏ¿¤µ¤ì¤¿ ¥Û¥¹¥È̾¤¬¡¢¥É¥á¥¤¥óÉô¤ò´Þ¤ó¤Ç¤Ê¤¤¤è¤¦¤Ê¾ì¹ç (/etc/hosts ¤ä NIS hosts ¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ë FQDN ¤¬ÅÐÏ¿¤µ¤ì¤Æ¤Ê¤¤¤è¤¦¤Ê¾ì¹ç) ¤â¡¢ ɬ¤º¥Û¥¹¥È¤ÎÊÌ̾ÅÐÏ¿¤¬É¬ÍפȤʤê¤Þ¤¹¡£¤³¤Î¤è¤¦¤Ê¾ì¹ç¡¢¸ÇÍ­¼±ÊÌ»Ò ¤È¤·¤Æ¥É¥á¥¤¥ó̾¤ò´Þ¤à¥Û¥¹¥È̾ (FQDN) ¤ò¡¢ÊÌ̾¤È¤·¤Æ¥É¥á¥¤¥ó̾¤ò ´Þ¤Þ¤Ê¤¤¥Û¥¹¥È̾¤òÅÐÏ¿¤·¤Æ¤¯¤À¤µ¤¤¡£

-d

°ú¿ô¤Ë»ØÄꤷ¤¿¥Û¥¹¥È¾ðÊó¤ò¥á¥¿¥Ç¡¼¥¿¤«¤éºï½ü¤·¤Þ¤¹¡£ ¸½ºß¤Î¤È¤³¤í¡¢Ê£À½¾ðÊó¤È¤·¤Æ»²¾È¤µ¤ì¤Æ¤¤¤ë¥Û¥¹¥È¤â ºï½ü¤Ç¤­¤Æ¤·¤Þ¤¤¤Þ¤¹¤¬¡¢¤³¤ì¤ò¹Ô¤Ê¤¦¤ÈÊ£À½¥Ç¡¼¥¿¥Ù¡¼¥¹¤¬ÉÔÀ°¹ç ¾õÂ֤ȤʤäƤ·¤Þ¤¤¤Þ¤¹¤Î¤ÇÃí°Õ¤¬É¬ÍפǤ¹¡£ ¥Û¥¹¥È̾¤Ë»ØÄê¤Ç¤­¤ë¤Î¤Ï ¸ÇÍ­¼±Ê̻ҤΤߤǤ¹¡£

-H

gfsd ¤ËÌ䤤¹ç¤ï¤»¤ÆÆÀ¤¿¾ðÊ󡢤¹¤Ê¤ï¤Á ¥í¡¼¥É¥¢¥Ù¥ì¡¼¥¸¤Èǧ¾Ú¼êÃʤòɽ¼¨¤·¤Þ¤¹¡£ ¤³¤Îµ¡Ç½¤Ë´Ø¤·¤Æ¤Ï¡¢°ú¿ô¤Ç¥Û¥¹¥È̾¤ò»ØÄꤷ¤¿¾ì¹ç¡¢É½¼¨¤µ¤ì¤ë ¤Î¤Ï¡¢¸ÇÍ­¼±Ê̻ҤȤ·¤ÆÍѤ¤¤é¤ì¤Æ¤¤¤ë¥Û¥¹¥È̾¤Ç¤Ï¤Ê¤¯¡¢°ú¿ô ¤Ç»ØÄꤷ¤¿Ì¾Á°¤Ë¤Ê¤ê¤Þ¤¹¡£ ¤Þ¤¿¡¢¥Û¥¹¥È̾¤Î¸å¤Ë¡¢¥¢¥¯¥»¥¹¤ËÍѤ¤¤é¤ì¤¿ IP ¥¢¥É¥ì¥¹¤ò³ç¸Ì¤Ç °Ï¤Ã¤ÆÉ½¼¨¤·¤Þ¤¹¡£

¥Û¥¹¥È¤¬Ää»ß¤ä¥Í¥Ã¥È¥ï¡¼¥¯¾ã³²¤Î¤¿¤á¤Ë¥¢¥¯¥»¥¹¤Ç¤­¤Ê¤«¤Ã¤¿¾ì¹ç¡¢ ¥í¡¼¥É¥¢¥Ù¥ì¡¼¥¸¤ÎÉôʬ¤Ë x.xx/x.xx/x.xx ¤Èɽ¼¨¤·¤Þ¤¹¡£ ¥Û¥¹¥È¤¬Æ°ºî¤·¤Æ¤¤¤ë¤¬¡¢¤½¤Î¥Û¥¹¥È¤Î gfsd ¤Ø ¥¢¥¯¥»¥¹¤Ç¤­¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï -.--/-.--/-.-- ¤Èɽ¼¨¤·¤Þ¤¹¡£

¤½¤Î¼¡¤Î°ì·å¤ÎÍó¤Ïǧ¾Ú¼êÃʤǡ¢¡ÖG¡×¤Ï GSI ǧ¾Ú¤ª¤è¤Ó°Å¹æ²½¡¢ ¡Ög¡×¤Ïǧ¾Ú½èÍý¤Î¤ß GSI ¤Çǧ¾Ú¸å¤ÏÊݸî¤Î¤Ê¤¤À¸¥Ç¡¼¥¿ (gsi_auth)¡¢ ¡Ös¡×¤Ï sharedsecret ǧ¾Ú¡¢¡Öx¡×¤Ïǧ¾Ú¼ºÇÔ¡¢¡Ö-¡×¤Ïǧ¾Ú¤ò »î¤ß¤Ê¤«¤Ã¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£¤Þ¤¿¡¢¡Ö-U¡×¥ª¥×¥·¥ç¥ó»ØÄê»þ¤Ë¤Ï¡¢ ¤³¤Îǧ¾Ú¼êÃʤÎɽ¼¨Íó¤Ï¤Ê¤¯¤Ê¤ê¤Þ¤¹¡£

¥Ç¥Õ¥©¡¼¥ë¥È¤Ç¤Ï¡¢¥Û¥¹¥È̾¤Î¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È½ç¤Çɽ¼¨¤·¤Þ¤¹¡£

-l

gfsd ¤ËÌ䤤¹ç¤ï¤»¤ÆÆÀ¤¿¾ðÊó¡¢ ¤¹¤Ê¤ï¤Á¥í¡¼¥É¥¢¥Ù¥ì¡¼¥¸¤ª¤è¤Óǧ¾Ú¼êÃʤȡ¢ ¥á¥¿¥Ç¡¼¥¿¡¦¥µ¡¼¥Ð¡¼¤ËÌ䤤¹ç¤ï¤»¤ÆÆÀ¤¿¾ðÊó¡¢ ¤¹¤Ê¤ï¤Á¥¢¡¼¥­¥Æ¥¯¥Á¥ã̾¡¢CPU¿ô¤ª¤è¤Ó¥Û¥¹¥ÈÊÌ̾¤ò Á´¤ÆÉ½¼¨¤·¤Þ¤¹¡£¤Þ¤¿¥¢¥¯¥»¥¹¤ËÍѤ¤¤é¤ì¤¿¥Û¥¹¥È̾¤Î¸å¤Ë¡¢ IP ¥¢¥É¥ì¥¹¤ò³ç¸Ì¤Ç°Ï¤Ã¤ÆÉ½¼¨¤·¤Þ¤¹¡£

¥Û¥¹¥È¤¬Ää»ß¤ä¥Í¥Ã¥È¥ï¡¼¥¯¾ã³²¤Î¤¿¤á¤Ë¥¢¥¯¥»¥¹¤Ç¤­¤Ê¤«¤Ã¤¿¾ì¹ç¡¢ ¥í¡¼¥É¥¢¥Ù¥ì¡¼¥¸¤ÎÉôʬ¤Ë x.xx/x.xx/x.xx ¤Èɽ¼¨¤·¤Þ¤¹¡£ ¥Û¥¹¥È¤¬Æ°ºî¤·¤Æ¤¤¤ë¤¬¡¢¤½¤Î¥Û¥¹¥È¤Î gfsd ¤Ø ¥¢¥¯¥»¥¹¤Ç¤­¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï -.--/-.--/-.-- ¤Èɽ¼¨¤·¤Þ¤¹¡£

¤½¤Î¼¡¤Î°ì·å¤ÎÍó¤Ïǧ¾Ú¼êÃʤǡ¢¡ÖG¡×¤Ï GSI ǧ¾Ú¤ª¤è¤Ó°Å¹æ²½¡¢ ¡Ög¡×¤Ïǧ¾Ú½èÍý¤Î¤ß GSI ¤Çǧ¾Ú¸å¤ÏÊݸî¤Î¤Ê¤¤À¸¥Ç¡¼¥¿ (gsi_auth)¡¢ ¡Ös¡×¤Ï sharedsecret ǧ¾Ú¡¢¡Öx¡×¤Ïǧ¾Ú¼ºÇÔ¡¢¡Ö-¡×¤Ïǧ¾Ú¤ò »î¤ß¤Ê¤«¤Ã¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£¤Þ¤¿¡¢¡Ö-U¡×¥ª¥×¥·¥ç¥ó»ØÄê»þ¤Ë¤Ï¡¢ ¤³¤Îǧ¾Ú¼êÃʤÎɽ¼¨Íó¤Ï¤Ê¤¯¤Ê¤ê¤Þ¤¹¡£

¥Ç¥Õ¥©¡¼¥ë¥È¤Ç¤Ï¡¢¥Û¥¹¥È̾¤Î¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È½ç¤Çɽ¼¨¤·¤Þ¤¹¡£

-M

¥á¥¿¥Ç¡¼¥¿¤ËÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë¥Û¥¹¥È¾ðÊó¤òɽ¼¨¤·¤Þ¤¹¡£ ¥Ç¥Õ¥©¡¼¥ë¥È¤Ç¤Ï¡¢¥Û¥¹¥È̾¤Î¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È½ç¤Çɽ¼¨¤·¤Þ¤¹¡£

-m

¸ÇÍ­¼±Ê̻ҤȤ·¤ÆÍѤ¤¤é¤ì¤Æ¤¤¤ë¥Û¥¹¥È̾¤ò»ØÄꤷ¡¢¥á¥¿¥Ç¡¼¥¿ ¤ËÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë¥Û¥¹¥È¾ðÊó¤òÊѹ¹¤·¤Þ¤¹¡£ -a ¥ª¥×¥·¥ç¥ó¤ª¤è¤Ó -n ¥ª¥×¥·¥ç¥ó¤Ï¡¢¤½¤ì¤¾¤ì´û¸¤ÎÃͤòÃÖ¤­´¹¤¨¤Þ¤¹¡£ ¤³¤ì¤ËÂФ·¡¢¥Û¥¹¥È¤ÎÊÌ̾¤Ë´Ø¤·¤Æ¤Ï¡¢Äɲäò°ÕÌ£¤·¤Þ¤¹¡£ ÄɲäǤϤʤ¯¡¢ÊÌ̾¤ÎÃÖ¤­´¹¤¨¤äºï½ü¤ò¹Ô¤Ê¤¤¤¿¤¤¾ì¹ç¤Ë¤Ï¡¢-A ¥ª¥×¥·¥ç¥ó ¤ò»ØÄꤷ¤Æ¤¯¤À¤µ¤¤¡£¤³¤Î¾ì¹ç¡¢Á´¤Æ¤ÎÊÌ̾¤òºï½ü¤·¤Æ¤«¤é¡¢(¤â¤·¤¢¤ì¤Ð) °ú¿ô¤Ç»ØÄꤷ¤¿ÊÌ̾¤òÄɲä·¤Þ¤¹¡£

-R

ɸ½àÆþÎϤ«¤é¥Û¥¹¥È¤Ë´Ø¤¹¤ë¾ðÊó¤òÆÉ¤ß¹þ¤ß¡¢¥á¥¿¥Ç¡¼¥¿¤Ë Äɲä·¤Þ¤¹¡£Í¿¤¨¤ë¾ðÊó¤Î·Á¼°¤Ï¡¢-M µ¡Ç½¤Îɽ¼¨·Á¼°¤ÈƱ¤¸¤Ç¤¹¡£

-?

°ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡£

OPTIONS

-A

-m µ¡Ç½¤Ç¥Û¥¹¥È¾ðÊó¤òÊѹ¹¤¹¤ëºÝ¤Ë¡¢¥Û¥¹¥È¤ÎÊÌ̾¤ò ÄɲäǤϤʤ¯ÃÖ¤­´¹¤¨¤¿¤¤¾ì¹ç¤Ë¡¢¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Þ¤¹¡£

-a ¥¢¡¼¥­¥Æ¥¯¥Á¥ã

CPU¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤ò¡¢sparc-sun-solaris8 ¤ä i386-redhat8.0-linux ¤Î ¤è¤¦¤Ê·Á¼°¤Ç»ØÄꤷ¤Þ¤¹¡£ -c ¤ª¤è¤Ó -m µ¡Ç½¤Î¾ì¹ç¤Ë¤Ï¡¢Äɲá¦Êѹ¹¤¹¤ë¥Û¥¹¥È¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤È ¤·¤Æ¡¢¤³¤Î¥ª¥×¥·¥ç¥ó¤òÍѤ¤¤Þ¤¹¡£ -H, -l, -M ¤ª¤è¤ÓÆÃ¤Ëµ¡Ç½¤ò»ØÄꤷ¤Ê¤«¤Ã¤¿¾ì¹ç¤Ç¡¢¤«¤Ä ¥Û¥¹¥È̾¤ò¾Êά¤·¤¿¾ì¹ç¤Ë¤Ï¡¢»ØÄꤷ¤¿¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Î¥Û¥¹¥È¤Ë ´Ø¤·¤Æ¤Î¤ßɽ¼¨¤ò¹Ô¤Ê¤¤¤Þ¤¹¡£

-D ¥É¥á¥¤¥ó̾

-H, -l, -M ¤ª¤è¤ÓÆÃ¤Ëµ¡Ç½¤ò»ØÄꤷ¤Ê¤«¤Ã¤¿¾ì¹ç¤Ç¡¢¤«¤Ä ¥Û¥¹¥È̾¤ò¾Êά¤·¤¿¾ì¹ç¤Ë¡¢¤³¤Î¥ª¥×¥·¥ç¥ó¤Ç¡¢É½¼¨¤¹¤ë¥É¥á¥¤¥ó̾¤ò ¸ÂÄê¤Ç¤­¤Þ¤¹¡£

-i

%%SYSCONFDIR%%/gfarm2.conf ¤Ê¤¤¤· $HOME/.gfarm2rc Ãæ¤Ç¡Öaddress_use¡×¤ò»ØÄꤹ¤ë¤È¡¢ ¥¢¥¯¥»¥¹¤ËÍѤ¤¤ë¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¤ËÍ¥Àè½ç°Ì¤ò¤Ä¤±¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ gfhost ¥³¥Þ¥ó¥É¤ËÂФ·¤Æ¤â¡¢¤³¤ÎÍ¥Àè½ç°Ì¤Ï±Æ¶Á¤·¤Þ¤¹¤¬¡¢-i ¥ª¥×¥·¥ç¥ó¤ò ¤Ä¤±¤ë¤È¡¢¤³¤Î»ØÄê¤ò̵»ë¤·¤Æ gfsd ¤Ë¥¢¥¯¥»¥¹ ¤¹¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡£

-j ÊÂÎóÅÙ

gfsd ¤Ë¥¢¥¯¥»¥¹¤¹¤ëºÝ¤ÎÊÂÎóÅÙ¤ò»ØÄꤷ¤Þ¤¹¡£ ¥Ç¥Õ¥©¡¼¥ë¥È¤Ï 10 ¤Ç¤¹¡£

-L

-H¡¢-l µ¡Ç½¤Î¾ì¹ç ¡¢¤³¤Î¥ª¥×¥·¥ç¥ó¤Ç¡¢ ɽ¼¨½ç½ø¤ò¡¢¥í¡¼¥É¥¢¥Ù¥ì¡¼¥¸½ç¤ËÊѹ¹¤·¤Þ¤¹¡£

-n CPU¿ô

-c ¤ª¤è¤Ó -m µ¡Ç½¤Ç¡¢¥Û¥¹¥È¾ðÊó¤òÄɲá¦Êѹ¹¤¹¤ëºÝ¤Ë¡¢ ¤½¤Î¥Û¥¹¥È¤¬»ý¤Ä CPU ¤Î¿ô¤ò»ØÄꤷ¤Þ¤¹¡£

-p ¥Ý¡¼¥ÈÈÖ¹æ

-c ¤ª¤è¤Ó -m µ¡Ç½¤Ç¡¢¥Û¥¹¥È¾ðÊó¤òÄɲá¦Êѹ¹¤¹¤ëºÝ¤Ë¡¢ ¤½¤Î¥Û¥¹¥È¤Î gfsd ¤¬ÍѤ¤¤ë¥Ý¡¼¥ÈÈÖ¹æ¤ò»ØÄꤷ¤Þ¤¹¡£

-P ¥Ñ¥¹Ì¾

¤³¤Î¥³¥Þ¥ó¥É¤¬¥¢¥¯¥»¥¹¤¹¤ë¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤òÆÃÄꤹ¤ë¤¿¤á¤Î ¥Ñ¥¹Ì¾¤Þ¤¿¤Ï Gfarm URL ¤ò»ØÄꤷ¤Þ¤¹¡£ ¾Êά¤·¤¿¾ì¹ç¤Ï¡¢¡Ö/¡×¤ò»ØÄꤷ¤¿¤Î¤ÈƱ¤¸°ÕÌ£¤Ë¤Ê¤ê¤Þ¤¹¡£

-r

ɽ¼¨¤òÀ°Î󤷤Ƥ¤¤ë¾ì¹ç¡¢É½¼¨¤Î½ç½ø¤òµÕ¤Ë¤·¤Þ¤¹¡£

-u

-H, -l, -M ¤ª¤è¤ÓÆÃ¤Ëµ¡Ç½¤ò»ØÄꤷ¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¡¢É½¼¨¤¹¤ë½ç½ø¤ò ¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È½ç¤ËÀ°Î󤹤ë¤Î¤ò»ß¤á¤Þ¤¹¡£ -M µ¡Ç½¤Î¾ì¹ç¡¢°ú¿ô¤Ç¥Û¥¹¥È̾¤ò»ØÄꤷ¤¿¾ì¹ç¤Ë¤Ï ¤½¤Î½ç½ø¡¢¤µ¤â¤Ê¤¯¤Ð¥á¥¿¥Ç¡¼¥¿¤«¤é¼èÆÀ¤·¤¿½ç½ø¤Çɽ¼¨¤·¤Þ¤¹¡£ -H, -l µ¡Ç½¤Î¾ì¹ç¤ª¤è¤ÓÆÃ¤Ëµ¡Ç½¤ò»ØÄꤷ¤Ê¤«¤Ã¤¿¾ì¹ç¡¢ ¥Û¥¹¥È¤Ë½ç¤ËÌ䤤¹ç¤ï¤»¤ò¹Ô¤¤¡¢ÊÖ»ö¤ÎÊ֤äƤ­¤¿½ç½ø¤Çɽ¼¨¤·¤Þ¤¹¡£

-U

TCP ¤Ë¤è¤ëǧ¾Ú¤ò¤ä¤á¡¢ UDP ¤Ë¤è¤ë¥í¡¼¥É¥¢¥Ù¥ì¡¼¥¸¤ÎÌ䤤¹ç¤ï¤»¤Î¤ß¤ò¹Ô¤¦¤è¤¦¤Ë¤·¤Þ¤¹¡£ ¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢-H ¤Ê¤¤¤· -l µ¡Ç½¤ò»ØÄꤷ¤¿¾ì¹ç¤ª¤è¤Ó ÆÃ¤Ëµ¡Ç½¤ò»ØÄꤷ¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë°ÕÌ£¤Î¤¢¤ë¥ª¥×¥·¥ç¥ó¤Ç¡¢ ¼Â¹Ô®ÅÙ¤¬Â®¤¯¤Ê¤ë¸ú²Ì¤¬¤¢¤ê¤Þ¤¹¡£ -H ¤Ê¤¤¤· -l ¤ò»ØÄꤷ¤Æ¤¤¤ë¾ì¹ç¡¢¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»ØÄꤹ¤ë¤È¡¢ ǧ¾ÚÊý¼°¤Îɽ¼¨Í󤬤ʤ¯¤Ê¤ê¤Þ¤¹¡£

-v

-H ¤Ê¤¤¤· -l µ¡Ç½¤ò»ØÄꤷ¤¿¾ì¹ç¤ª¤è¤ÓÆÃ¤Ëµ¡Ç½¤ò»ØÄꤷ¤Ê¤«¤Ã¤¿¾ì¹ç¡¢ ¥Ç¥Õ¥©¡¼¥ë¥È¤Ç¤Ï¡¢gfsd ¤ËÂФ¹¤ëÌ䤤¹ç¤ï¤»¤Ë´Ø¤¹¤ë¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸ ¤òɽ¼¨¤·¤Þ¤»¤ó¡£-v ¥ª¥×¥·¥ç¥ó¤ò»ØÄꤹ¤ë¤È¡¢¤³¤Î¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤ò ɽ¼¨¤¹¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡£

SEE ALSO

gfarm2.conf(5), gfsd(8)

gfarm-2.4.1/doc/html/ja/ref/man1/gfkey.1.html0000644000000000000000000000524111507222721017156 0ustar rootroot gfkey

gfkey

Name

gfkey -- Gfarm ¥»¥Ã¥·¥ç¥ó¡¦¥­¡¼´ÉÍý¥³¥Þ¥ó¥É

Synopsis

gfkey [¥ª¥×¥·¥ç¥ó]

DESCRIPTION

¿®Íꤵ¤ì¤¿´Ä¶­¤Ç gfsd¡¢gfmd ¤ò¶¦Í­ÈëÌ©¸°Ç§¾Ú¤Ç¥¢¥¯¥»¥¹¤¹¤ë¤Î¤Ë ɬÍפʥ»¥Ã¥·¥ç¥ó¡¦¥­¡¼¡¦¥Õ¥¡¥¤¥ë $HOME/.gfarm_shared_key ¤ò°·¤¦¥³¥Þ¥ó¥É¤Ç¤¹¡£

¥Û¡¼¥à¡¦¥Ç¥£¥ì¥¯¥È¥ê¤ò¶¦Í­¤·¤Æ¤¤¤ë´Ä¶­¤Ç¤Ï¡¢¤³¤Î¥³¥Þ¥ó¥É¤ò»È¤¦É¬Í×À­ ¤Ï¤¢¤Þ¤ê¤¢¤ê¤Þ¤»¤ó¤¬¡¢¤½¤¦¤Ç¤Ê¤¤´Ä¶­¤Ç¤Ï¡¢¤³¤Î¥³¥Þ¥ó¥É¤Ç¥­¡¼¤òÀ¸À®¤· ¤¿¸å¡¢Á´¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Ë¥­¡¼¤òÇÛÉÕ¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£

OPTIONS

-c

¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»ØÄꤹ¤ë¤È¡¢Í­¸ú¤Ê¥»¥Ã¥·¥ç¥ó¡¦¥­¡¼¤¬¤Ê¤¤¾ì¹ç¤Ë¡¢¥»¥Ã ¥·¥ç¥ó¡¦¥­¡¼¡¦¥Õ¥¡¥¤¥ë¤òºîÀ®¤·¤Þ¤¹¡£´û¤ËÍ­¸ú¤Ê¥»¥Ã¥·¥ç¥ó¡¦¥­¡¼¤¬Â¸ ºß¤¹¤ë¾ì¹ç¤Ë¤Ï²¿¤â¤·¤Þ¤»¤ó¡£

-f

¶¯À©Åª¤Ë¥»¥Ã¥·¥ç¥ó¡¦¥­¡¼¤òºîÀ®¤·¤Þ¤¹¡£ ´û¤ËÍ­¸ú¤Ê¥»¥Ã¥·¥ç¥ó¡¦¥­¡¼¤¬Â¸ºß¤¹¤ë¾ì¹ç¤Ç¤â¡¢¤½¤Î¥­¡¼¤ò¼Î¤Æ¤Æ¿·¤¿ ¤Ë¥­¡¼¤òºîÀ®¤·¤Þ¤¹¡£

-p period

¥»¥Ã¥·¥ç¥ó¡¦¥­¡¼¤ÎÍ­¸ú´ü¸Â¤ò»ØÄꤷ¤Þ¤¹¡£Ã±°Ì¤ÏÉäǤ¹¡£ ¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï -c ¥ª¥×¥·¥ç¥ó¤¢¤ë¤¤¤Ï -f ¥ª¥×¥·¥ç¥ó¤ÈƱ»þ¤Ë»ØÄꤹ¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£

-l

¸½ºß¤Î¥­¡¼¤òɽ¼¨¤·¤Þ¤¹¡£

-e

¸½ºß¤Î¥­¡¼¤Î´ü¸Â¤¬ÀÚ¤ì¤ë»þ¹ï¤òɽ¼¨¤·¤Þ¤¹¡£

-L message-priority-level

¤³¤Î¥ª¥×¥·¥ç¥ó¤Ç»ØÄꤷ¤¿¥ì¥Ù¥ë°Ê¾å¤ÎÍ¥ÀèÅ٤Υá¥Ã¥»¡¼¥¸¤ò½ÐÎϤ·¤Þ¤¹¡£ ¥Ç¥Õ¥©¥ë¥È¤Ïinfo¤Ç¤¹¡£ »ØÄê¤Ç¤­¤ëÃͤÏgfarm2.conf(5)¤Îlog_level¤Î¹à¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£

-?

°ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡£

FILES

$HOME/.gfarm_shared_key

¥»¥Ã¥·¥ç¥ó¡¦¥­¡¼¡¦¥Õ¥¡¥¤¥ë¤Ç¤¹¡£

gfarm-2.4.1/doc/html/ja/ref/man1/gfarm_agent.1.html0000644000000000000000000000677511507222721020340 0ustar rootroot gfarm_agent

gfarm_agent

Name

gfarm_agent -- Gfarm ¥á¥¿¥Ç¡¼¥¿¥­¥ã¥Ã¥·¥å¥µ¡¼¥Ð

Synopsis

gfarm_agent [¥ª¥×¥·¥ç¥ó]

DESCRIPTION

gfarm_agent ¤Ï¡¢ Ê£¿ô¥Î¡¼¥É¡¢Ê£¿ô¥æ¡¼¥¶¤Ç¶¦Í­²Äǽ¤Ê Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¡¦¥á¥¿¥Ç¡¼¥¿¤Î¥­¥ã¥Ã¥·¥å¥µ¡¼¥Ð¤Ç¤¹¡£ ¥­¥ã¥Ã¥·¥å¥µ¡¼¥Ð¤Ë¤è¤ê¡¢ ±ó³Ö¤Î¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤ËÂФ¹¤ë̵Â̤ʥͥåȥ¥¯Å¾Á÷¤¬ÍÞÀ©¤µ¤ì¡¢ Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ËÂФ¹¤ë¥ì¥¹¥Ý¥ó¥¹¤òÂçÉý¤Ë²þÁ±¤·¤Þ¤¹¡£

gfarm_agent ¤Ï¡¢ Ʊ»þ¤ËÊ£¿ô¤Î¥Î¡¼¥É¤Ç¼Â¹Ô¤¹¤ë¤³¤È¤¬²Äǽ¤Ç¤¹¡£ ¤½¤Î¾ì¹ç¡¢Ê£¿ô¤Î gfarm_agent ¤ª¤è¤Ó Gfarm ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð´Ö¤Î°ì´ÓÀ­¤ÏÊݾڤµ¤ì¤Þ¤¹¡£

OPTIONS

-L ¥í¥°¥ì¥Ù¥ë

¤³¤Î¥ª¥×¥·¥ç¥ó¤Ç»ØÄꤷ¤¿¥ì¥Ù¥ë°Ê¾å¤ÎÍ¥ÀèÅÙ¤Î¥í¥°¤ò½ÐÎϤ·¤Þ¤¹¡£ »ØÄê¤Ç¤­¤ëÃÍ¤Ï gfarm.conf(5) ¤Î log_level ¤Î¹à¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£

-P PID¥Õ¥¡¥¤¥ë

gfarm_agent ¤Î process ID ¤ò¡¢ »ØÄꤷ¤¿¥Õ¥¡¥¤¥ë¤Ëµ­Ï¿¤·¤Þ¤¹¡£

-S syslog¥Õ¥¡¥·¥ê¥Æ¥£

gfarm_agent ¤¬¥¨¥é¡¼Êó¹ð¤ËÍѤ¤¤ë syslog ¤Î¥Õ¥¡¥·¥ê¥Æ¥£¤ò»ØÄꤷ¤Þ¤¹¡£ ¾Êά¤·¤¿¾ì¹ç¤Ë¤Ï¡¢local0 ¤ò»ÈÍѤ·¤Þ¤¹¡£

-d

¥Ç¥Ð¥Ã¥°¥ª¥×¥·¥ç¥ó¤Ç¤¹¡£¥Ç¡¼¥â¥ó¤È¤·¤Æ¤Ç¤Ï¤Ê¤¯¡¢¥Õ¥©¥¢¥°¥é¥¦¥ó¥É¡¦ ¥×¥í¥»¥¹¤È¤·¤ÆÎ©¤Á¾å¤¬¤ê¤Þ¤¹¡£

¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¡¢¤«¤Ä -L ¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Ê¤«¤Ã¤¿ ¾ì¹ç¡¢¥í¥°¥ì¥Ù¥ë¤Ï debug ¤È¤Ê¤ê¤Þ¤¹¡£

-f ÀßÄê¥Õ¥¡¥¤¥ë

µ¯Æ°»þ¤ËÆÉ¤ß¹þ¤àÀßÄê¥Õ¥¡¥¤¥ë¤ò»ØÄꤷ¤Þ¤¹¡£

-m

ñ°ì¤Î gfarm_agent ¤òÍøÍѤ¹¤ë¾ì¹ç¤ËÍøÍѲÄǽ¤Ç¤¹¡£ ¤³¤Î¥ª¥×¥·¥ç¥ó¤òÍøÍѤ¹¤ë¤È¥Ñ¥¹¾ðÊó¤â¥­¥ã¥Ã¥·¥å¤¹¤ë¤è¤¦¤Ë¤Ê¤ë¤¿¤á¡¢ ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤Ø¤Î¥¢¥¯¥»¥¹¿ô¤¬¸º¤ê¡¢¹â®¤Ë¤Ê¤ê¤Þ¤¹¡£

-p ¥Ý¡¼¥ÈÈÖ¹æ

gfarm_agent ¤¬ÍøÍѤ¹¤ë TCP ¤Î¥Ý¡¼¥ÈÈÖ¹æ¤ò»ØÄꤷ¤Þ¤¹¡£

-v

ǧ¾Ú»þ¤Î¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤Î¾ÜºÙ¤òɽ¼¨¤·¤Þ¤¹¡£

-?

°ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡£

FILES

%%SYSCONFDIR%%/gfarm.conf

gfarm_agent ¤¬»²¾È¤¹¤ëÀßÄê¥Õ¥¡¥¤¥ë¤Ç¤¹¡£

SEE ALSO

gfarm.conf(5)

gfarm-2.4.1/doc/html/ja/ref/man1/gfmv.1.html0000644000000000000000000000212611507222721017007 0ustar rootroot gfmv

gfmv

Name

gfmv -- Gfarm ¥Õ¥¡¥¤¥ë¤ò̾¾ÎÊѹ¹¡¤°Üư¤¹¤ë

Synopsis

gfmv [options] src dest

DESCRIPTION

Gfarm ¥Õ¥¡¥¤¥ë¤òsrc¤«¤é dest¤Ë̾¾ÎÊѹ¹¤¢¤ë¤¤¤Ï°Üư¤·¤Þ¤¹¡¥

OPTIONS

-?

°ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡¥

gfarm-2.4.1/doc/html/ja/ref/man1/gfps.1.html0000644000000000000000000000253711507222721017015 0ustar rootroot gfps

gfps

Name

gfps -- ¸½ºß¼Â¹ÔÃæ¤Î¥¸¥ç¥Ö¤òɽ¼¨¤¹¤ë¡£

Synopsis

gfps [¥ª¥×¥·¥ç¥ó] [¥¸¥ç¥ÖID...]

DESCRIPTION

°ú¿ô¤Ë»ØÄꤷ¤¿¥¸¥ç¥ÖID¤Ë´Ø¤¹¤ë¾ðÊó¤òɽ¼¨¤·¤Þ¤¹¡£ °ú¿ô¤ò¾Êά¤·¤¿¾ì¹ç¤Ë¤Ï¡¢¼«¥æ¡¼¥¶¡¼¸¢¸Â¤Ç¼Â¹ÔÃæ¤Î¥¸¥ç¥ÖÁ´¤Æ¤òɽ¼¨¤·¤Þ ¤¹¡£

OPTIONS

-a

Á´¤Æ¤Î¥æ¡¼¥¶¡¼¤Î¥¸¥ç¥Ö¤òɽ¼¨¤·¤Þ¤¹¡£

-l

¤è¤ê¾ÜºÙ¤Ê¾ðÊó¤òɽ¼¨¤·¤Þ¤¹¡£

-v

¾ÜºÙ¤Ë¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤òɽ¼¨¤·¤Þ¤¹¡¥

-?

°ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡£

gfarm-2.4.1/doc/html/ja/ref/man1/gfrmdir.1.html0000644000000000000000000000225011507222721017500 0ustar rootroot gfrmdir

gfrmdir

Name

gfrmdir -- Gfarm ¥Ç¥£¥ì¥¯¥È¥ê¤òºï½ü¤¹¤ë¡£

Synopsis

gfrmdir gfarm¥Ñ¥¹...

DESCRIPTION

Gfarm¥Ñ¥¹¤Ë»ØÄꤷ¤¿¥Ç¥£¥ì¥¯¥È¥ê¤òºï½ü¤·¤Þ¤¹¡£

OPTIONS

-?

°ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡£

SEE ALSO

gfmkdir(1)

gfarm-2.4.1/doc/html/ja/ref/man1/gfrm.1.html0000644000000000000000000001131011507222721016776 0ustar rootroot gfrm

gfrm

Name

gfrm -- Gfarm ¥Õ¥¡¥¤¥ë¡¤¥Ç¥£¥ì¥¯¥È¥ê¡¤¥Õ¥¡¥¤¥ëÊ£À½¤òºï½ü¤¹¤ë¡¥

Synopsis

gfrm [-frRnqv] [-I ¥Õ¥¡¥¤¥ë¥»¥¯¥·¥ç¥ó] [-h ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É] [-D ¥É¥á¥¤¥ó̾] [-H ¥Û¥¹¥È»ØÄê¥Õ¥¡¥¤¥ë] [-N Ê£À½¿ô] [-j ¥¹¥ì¥Ã¥É¿ô] gfarm-URL...

DESCRIPTION

Gfarm-URL ¤Ë»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤òºï½ü¤·¤Þ¤¹¡¥ ¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤Îºï½ü¤Ï¹Ô¤¤¤Þ¤»¤ó¤¬¡¤ -r¤¢¤ë¤¤¤Ï-R ¥ª¥×¥·¥ç¥ó¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¤ »ØÄꤵ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê°Ê²¼¤Î¥Õ¥¡¥¤¥ë¤ª¤è¤Ó¥Ç¥£¥ì¥¯¥È¥ê¤¬ºÆµ¢Åª¤Ë¾Ãµî¤µ¤ì¤Þ¤¹¡¥ ¤Ê¤ª¡¤. ¤¢¤ë¤¤¤Ï .. ¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¤Ï¥¨¥é¡¼¤Ë¤Ê¤ê¤Þ¤¹¡¥

-I¥ª¥×¥·¥ç¥ó¤ò»ØÄꤹ¤ë¤³¤È¤Ë¤è¤ê¡¤ ¥Õ¥¡¥¤¥ë¤ÎÆÃÄê¤Î¥Õ¥¡¥¤¥ë¥»¥¯¥·¥ç¥ó¤òºï½ü¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡¥ ¥Õ¥¡¥¤¥ë¥»¥¯¥·¥ç¥ó¤È¤Ï¡¤¼Â¹Ô·Á¼°¤Î¥Õ¥¡¥¤¥ë¤Î¾ì¹ç¤Ï¥¢¡¼¥­¥Æ¥¯¥Á¥ã̾¡¤ Ä̾ï¥Õ¥¡¥¤¥ë¤Î¾ì¹ç¤Ï¥Õ¥¡¥¤¥ë¥¤¥ó¥Ç¥Ã¥¯¥¹ÈÖ¹æ¤È¤Ê¤ê¤Þ¤¹¡¥

-h¡¤-D¡¤-H ¥ª¥×¥·¥ç¥ó¤Ç¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤ò»ØÄꤹ¤ë¤³¤È¤Ë¤è¤ê¡¤ »ØÄꤵ¤ì¤¿¥Î¡¼¥É¤Ë³ÊǼ¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ëÊ£À½¤òºï½ü¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡¥ ¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¤ ¥Õ¥¡¥¤¥ë¤Îºï½ü¤È¤Ê¤Ã¤Æ¤·¤Þ¤¦Á´¤Æ¤Î¥Õ¥¡¥¤¥ëÊ£À½¤Îºï½ü¤Ï¤Ç¤­¤Þ¤»¤ó¤¬¡¤ -f¥ª¥×¥·¥ç¥ó¤ò¤Ä¤±¤ë¤³¤È¤Ë¤è¤êºï½ü¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡¥

OPTIONS

-f

¥Õ¥¡¥¤¥ëÊ£À½ºï½ü¤Î¾ì¹ç¤Ë¡¤ Á´¤Æ¤Î¥Õ¥¡¥¤¥ëÊ£À½¤òºï½ü¤¹¤ë¤³¤È¤Ë¤Ê¤Ã¤Æ¤â¥Õ¥¡¥¤¥ëÊ£À½¤òºï½ü¤·¤Þ¤¹¡¥ ¤³¤Î»þ¡¤¥Õ¥¡¥¤¥ë¼«ÂΤ¬ºï½ü¤µ¤ì¤ë¤³¤È¤Ë¤Ê¤ê¤Þ¤¹¡¥ ¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï -h¡¤-D¡¤ -H ¤Î¤¤¤º¤ì¤«¤Î¥ª¥×¥·¥ç¥ó¤È¤È¤â¤Ë»ØÄꤵ¤ì¤¿¾ì¹ç¤ËÍ­¸ú¤Ç¤¹¡¥

-j ¥¹¥ì¥Ã¥É¿ô

»ØÄꤵ¤ì¤¿¥¹¥ì¥Ã¥É¿ô¤ÇÊÂÎó¤Ë¥Õ¥¡¥¤¥ë¡¿¥Õ¥¡¥¤¥ëÊ£À½¤òºï½ü¤·¤Þ¤¹¡¥ ¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï gfrm ¤¬ OpenMP C ¥³¥ó¥Ñ¥¤¥é¤Ç¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤¿¤È¤­¤Ë ¸Â¤êÍ­¸ú¤Ç¤¹¡¥

-n

¾Ãµî¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¤òɽ¼¨¤·¤Þ¤¹¡¥ ¼ÂºÝ¤Ë¤Ï²¿¤â¼Â¹Ô¤µ¤ì¤Þ¤»¤ó¡¥

-q

;ʬ¤Ê¥á¥Ã¥»¡¼¥¸¤òɽ¼¨¤·¤Þ¤»¤ó¡¥

-r, -R

°ú¿ô¤¬¥Ç¥£¥ì¥¯¥È¥ê¤À¤Ã¤¿¾ì¹ç¡¤¤½¤Î¥Ç¥£¥ì¥¯¥È¥ê°Ê²¼¤ò Á´¤Æ¡¤ºÆµ¢Åª¤Ëºï½ü¤·¤Þ¤¹¡¥

-v

¾éĹ¤Ë¥á¥Ã¥»¡¼¥¸¤òɽ¼¨¤·¤Þ¤¹¡¥

-h ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É

Ê£À½¤òºï½ü¤¹¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É̾¤ò»ØÄꤷ¤Þ¤¹¡¥ -I¥ª¥×¥·¥ç¥ó¤È¶¦¤ËÍѤ¤¤ë¤³¤È¤Ë¤è¤ê¡¤ ÆÃÄê¤Î¥Õ¥¡¥¤¥ë¥»¥¯¥·¥ç¥ó¤ÎÊ£À½¤òºï½ü¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡¥

-D ¥É¥á¥¤¥ó̾

Ê£À½¤òºï½ü¤¹¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Î¥É¥á¥¤¥ó̾¤ò»ØÄꤷ¤Þ¤¹¡¥

-H ¥Û¥¹¥È»ØÄê¥Õ¥¡¥¤¥ë

Ê£À½¤òºï½ü¤¹¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É·²¤òµ­ºÜ¤·¤¿¥Õ¥¡¥¤¥ë̾¤ò»ØÄꤷ¤Þ¤¹¡¥ ¥Û¥¹¥È̾¤Ï¡¤³Æ¹Ô¤Ë°ì¥Û¥¹¥È¤º¤Äµ­½Ò¤·¤Þ¤¹¡¥

¥Õ¥¡¥¤¥ë̾¤È¤·¤Æ ``-'' ¤ò»ØÄꤷ¤¿¾ì¹ç¡¤É¸½àÆþÎϤ«¤é¥Û¥¹¥È̾¤Î¥ê¥¹¥È¤ò ÆÉ¤ß¹þ¤ß¤Þ¤¹¡¥

-I ¥Õ¥¡¥¤¥ë¥»¥¯¥·¥ç¥ó

ºï½ü¤¹¤ë¥Õ¥¡¥¤¥ë¥»¥¯¥·¥ç¥ó¤ò»ØÄꤷ¤Þ¤¹¡¥ ¥Õ¥¡¥¤¥ë¥»¥¯¥·¥ç¥ó¤È¤Ï¡¤ ¼Â¹Ô·Á¼°¤Î¥Õ¥¡¥¤¥ë¤Î¾ì¹ç¤Ï¡¤¥¢¡¼¥­¥Æ¥¯¥Á¥ã̾(Îã ¡Ösparc-sun-solaris8¡×)¡¤ Ä̾ï¥Õ¥¡¥¤¥ë¤Î¾ì¹ç¤Ï¡¤¥Õ¥¡¥¤¥ë¥¤¥ó¥Ç¥Ã¥¯¥¹ÈÖ¹æ¤Î¤³¤È¤Ç¤¹¡¥

-N Ê£À½¿ô

»ØÄꤵ¤ì¤¿Ê£À½¿ô¤è¤ê¿¤¯¤ÎÊ£À½¤ò¤â¤Ä¥Õ¥¡¥¤¥ë¤ËÂФ·¡¤ Ê£À½¤ò¾Ãµî¤·»ØÄꤵ¤ì¤¿Ê£À½¿ô¤Ë¤·¤Þ¤¹¡¥

-?

°ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡¥

gfarm-2.4.1/doc/html/ja/ref/man1/gfcd.1.html0000644000000000000000000000327711507222721016763 0ustar rootroot gfcd

gfcd

Name

gfcd -- Gfarm ºî¶È¥Ç¥£¥ì¥¯¥È¥ê¤òÊѹ¹¤¹¤ë¡£

Synopsis

gfcd [¥Ç¥£¥ì¥¯¥È¥ê]

DESCRIPTION

Gfarm ºî¶È¥Ç¥£¥ì¥¯¥È¥ê¤ò »ØÄꤷ¤¿¥Ç¥£¥ì¥¯¥È¥ê¤ËÊѹ¹¤·¤Þ¤¹¡£ ¥Ç¥£¥ì¥¯¥È¥ê¤ò»ØÄꤷ¤Ê¤¤¾ì¹ç¤Ï¡¢¥æ¡¼¥¶¤Î Gfarm ¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤¢¤ë gfarm:/¥°¥í¡¼¥Ð¥ë¥æ¡¼¥¶ ¤ËÊѹ¹¤·¤Þ¤¹¡£

³ÆGfarm ¥³¥Þ¥ó¥É¤¬ºî¶È¥Ç¥£¥ì¥¯¥È¥ê¤ò»²¾È¤Ç¤­¤ë¤è¤¦¤Ë¡¢³Æ¥æ¡¼¥¶¤Î ¥·¥§¥ëÀßÄê¥Õ¥¡¥¤¥ë¤Ë°Ê²¼¤ÎÄêµÁ¤òÄɲ䷤Ƥ¯¤À¤µ¤¤¡£

Bourne shell ·Ï¥·¥§¥ë¤Î¾ì¹ç
gfcd() { eval "`gfsetdir $1`"; }
csh ·Ï¥·¥§¥ë¤Î¾ì¹ç
alias gfcd 'eval `gfsetdir \!*`'

SEE ALSO

gfpwd(1), gfsetdir(1)

gfarm-2.4.1/doc/html/ja/ref/man1/gfwc.1.html0000644000000000000000000000156111507222721017000 0ustar rootroot gfwc

gfwc

Name

gfwc -- ÊÂÎó¥Õ¥¡¥¤¥ë¤ò wc ¤¹¤ë

Synopsis

gfmpirun_p4 {gfarm:gfwc} ÆþÎÏgfarm-URL

DESCRIPTION

gfmpirun_p4 ¤«¤é¸Æ¤Ó½Ð¤µ¤ì¤ë¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Î¥µ¥ó¥×¥ë¡¦¥×¥í¥°¥é¥à¤Ç¤¹¡£

ÆþÎÏ gfarm-URL ¤òÆÉ¤ß¹þ¤ß¡¢¥Ð¥¤¥È¿ô¡¦Ã±¸ì¿ô¡¦¹Ô¿ô¤ò¡¢É¸½à½ÐÎϤ˽ÐÎÏ ¤·¤Þ¤¹¡£

gfarm-2.4.1/doc/html/ja/ref/man1/gfront.1.html0000644000000000000000000000256111507222721017352 0ustar rootroot gfront

gfront

Name

gfront -- Gfarm ¥Õ¥¡¥¤¥ë¤òÁàºî¤¹¤ë¡£

Synopsis

gfront

DESCRIPTION

GFront¤Ï¡¢gfarm¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤òÁàºî¤¹¤ëGUI¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤¢¤ë¡£ GFront¤Ï¡¢gfarm¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤òÍøÍѼԤ¬ÂÐÏÃŪ¤ËÁàºî¤¹¤ë¤³¤È¤ò²Äǽ¤È¤¹¤ë¡£ gfarm¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ËÂФ¹¤ë´ðËÜÁàºî¤Ï¤¹¤Ç¤Ë¥³¥Þ¥ó¥É¤È¤·¤Æ¼Â¸½¤µ¤ì¤Æ¤ª¤ê¡¢GFront¤Ç¤Ïgfarm¤Î¥³¥Þ¥ó¥É¤ËÁêÅö¤¹¤ëµ¡Ç½¤ò¼Â¹Ô¤¹¤ë¤¿¤á¤Î¥Õ¥í¥ó¥È¥¨¥ó¥Éµ¡Ç½¤òÄ󶡤¹¤ë¡£

SEE ALSO

gfexport(1), gfhost(1), gfrm(1), gfreg(1)

gfarm-2.4.1/doc/html/ja/ref/man1/gffindxmlattr.1.html0000644000000000000000000000447511507222721020732 0ustar rootroot gffindxmlattr

gffindxmlattr

Name

gffindxmlattr -- ¥Õ¥¡¥¤¥ë¤ÎXML³Èĥ°À­¤òXPath¤Ë¤è¤ê¸¡º÷¤¹¤ë

Synopsis

gffindxmlattr [-d depth] [-F delim] [XPath | -f XPath-file] path

DESCRIPTION

»ØÄꤵ¤ì¤¿XPath¼°¤Ë°ìÃפ¹¤ëXML³Èĥ°À­¤ò¸¡º÷¤·¡¤ °ìÃפ·¤¿¥Ñ¥¹Ì¾¤ÈXML³Èĥ°À­Ì¾¤òɽ¼¨¤·¤Þ¤¹¡¥ »ØÄꤵ¤ì¤¿path¤¬¥Õ¥¡¥¤¥ë¤Î¾ì¹ç¡¤¤½¤Î¥Õ¥¡¥¤¥ë¤ÎXML³Èĥ°À­¤ò¸¡º÷¤·¤Þ¤¹¡¥ ÆÉ¤ß¹þ¤ß¸¢¸Â¤Î¤Ê¤¤¥Õ¥¡¥¤¥ë¤Ï̵»ë¤µ¤ì¤Þ¤¹¡¥

»ØÄꤵ¤ì¤¿path¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Î¾ì¹ç¡¤depth¤Ç»ØÄꤵ¤ì¤¿¿¼¤µ¤Þ¤ÇºÆµ¢Åª¤Ë¸¡º÷¤·¤Þ¤¹¡¥ 0¤Î¾ì¹ç¡¤»ØÄꤵ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¤ò¸¡º÷¤·¤Þ¤¹¡¥ depth¤¬»ØÄꤵ¤ì¤Ê¤¤¾ì¹ç¡¤ÌµÀ©¸Â¤Ë¸¡º÷¤·¤Þ¤¹¡¥ Éé¤ÎÃͤ¬»ØÄꤵ¤ì¤¿¾ì¹ç¤Ï¥¨¥é¡¼¤È¤Ê¤ê¤Þ¤¹¡¥ ¤Þ¤¿¡¤¼Â¹Ô¸¢¸Â¤Î¤Ê¤¤¥Ç¥£¥ì¥¯¥È¥ê¤Ï¸¡º÷¤µ¤ì¤Þ¤»¤ó¡¥

½ÐÎÏ·ë²Ì¤Ï¡¤°ìÃפ·¤¿¥Ñ¥¹Ì¾¤ÈXML°À­Ì¾¤¬¶èÀÚ¤êʸ»údelim¤Ç¶èÀڤäÆÉ½¼¨¤µ¤ì¤Þ¤¹¡¥

OPTIONS

-d depth

depth¤Ç»ØÄꤵ¤ì¤¿¿¼¤µ¤Þ¤ÇºÆµ¢Åª¤Ë¸¡º÷¤·¤Þ¤¹¡¥

-F delim

°ìÃפ·¤¿¥Ñ¥¹Ì¾¤ÈXML³Èĥ°À­Ì¾¤Î¶èÀÚ¤êʸ»ú¤ò»ØÄꤷ¤Þ¤¹¡¥ -F¥ª¥×¥·¥ç¥ó¤¬»ØÄꤵ¤ì¤Ê¤¤¾ì¹ç¤Ï¥¿¥Ö¤È¤Ê¤ê¤Þ¤¹¡¥

-f XPath-file

¸¡º÷¤¹¤ëXPath¼°¤òÆÉ¤ß¹þ¤à¥Õ¥¡¥¤¥ë¤ò»ØÄꤷ¤Þ¤¹¡¥

-?

°ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡¥

SEE ALSO

gfxattr(1)

gfarm-2.4.1/doc/html/ja/ref/man1/gfgroup.1.html0000644000000000000000000000531511507222721017524 0ustar rootroot gfgroup

gfgroup

Name

gfgroup -- Gfarm ¥°¥ë¡¼¥×´ÉÍý¥³¥Þ¥ó¥É

Synopsis

gfgroup [-P path] [-l] [group...]

gfgroup [-P path] -c groupname [user...]

gfgroup [-P path] -m groupname [user...]

gfgroup [-P path] -d groupname

DESCRIPTION

Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë¤ª¤±¤ë¥°¥ë¡¼¥×´ÉÍý¤ò¹Ô¤¤¤Þ¤¹¡¥ ¥Ç¥Õ¥©¥ë¥È¤Ç¤ÏÁ´ÅÐÏ¿¥°¥ë¡¼¥×¤òɽ¼¨¤·¤Þ¤¹¡¥ ¥°¥ë¡¼¥×̾¤¬»ØÄꤵ¤ì¤¿¤é¡¤»ØÄꤵ¤ì¤¿¥°¥ë¡¼¥×¤òɽ¼¨¤·¤Þ¤¹¡¥ Gfarm¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î´ÉÍý¼Ô¤Ï¡¤-c¡¤-m¡¤-d ¥ª¥×¥·¥ç¥ó¤ò»ØÄꤹ¤ë¤³¤È¤Ë¤è¤ê¡¤¤½¤ì¤¾¤ì¥°¥ë¡¼¥×ºîÀ®¡¤ ¥°¥ë¡¼¥×¥á¥ó¥ÐÊѹ¹¡¤¥°¥ë¡¼¥×ºï½ü¤ò¹Ô¤¦¤³¤È¤¬¤Ç¤­¤Þ¤¹¡¥

OPTIONS

-P ¥Ñ¥¹Ì¾

¤³¤Î¥³¥Þ¥ó¥É¤¬¥¢¥¯¥»¥¹¤¹¤ë¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤òÆÃÄꤹ¤ë¤¿¤á¤Î ¥Ñ¥¹Ì¾¤Þ¤¿¤Ï Gfarm URL ¤ò»ØÄꤷ¤Þ¤¹¡£ ¾Êά¤·¤¿¾ì¹ç¤Ï¡¢¡Ö/¡×¤ò»ØÄꤷ¤¿¤Î¤ÈƱ¤¸°ÕÌ£¤Ë¤Ê¤ê¤Þ¤¹¡£

-l

¥°¥ë¡¼¥×̾¤È¥°¥ë¡¼¥×¥á¥ó¥Ð¤Î¾ðÊó¤òɽ¼¨¤·¤Þ¤¹¡¥

-c

¥°¥ë¡¼¥×¤ÎºîÀ®¤ò¹Ô¤¤¤Þ¤¹¡¥ ÅÐÏ¿¤Ë¤Ï½é´ü¥°¥ë¡¼¥×¥á¥ó¥Ð¤â»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡¥ Gfarm¤Î´ÉÍý¼Ô¤¬¼Â¹Ô²Äǽ¤Ç¤¹¡¥

-m

¥°¥ë¡¼¥×¥á¥ó¥Ð¤ÎÊѹ¹¤ò¹Ô¤¤¤Þ¤¹¡¥ Êѹ¹¤·¤¿¤¤¥°¥ë¡¼¥×̾¤È¥á¥ó¥Ð¤Î¥ê¥¹¥È»ØÄꤷ¤Þ¤¹¡¥ Gfarm¤Î´ÉÍý¼Ô¤¬¼Â¹Ô²Äǽ¤Ç¤¹¡¥

-d

¥°¥ë¡¼¥×¤ò¾Ãµî¤·¤Þ¤¹¡¥ Gfarm¤Î´ÉÍý¼Ô¤¬¼Â¹Ô²Äǽ¤Ç¤¹¡¥

-?

°ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡¥

SEE ALSO

gfuser(1)

gfarm-2.4.1/doc/html/ja/ref/man1/gfxattr.1.html0000644000000000000000000000631211507222721017530 0ustar rootroot gfxattr

gfxattr

Name

gfxattr -- Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥Õ¥¡¥¤¥ë¤Î³Èĥ°À­¤òÁàºî¤¹¤ë

Synopsis

gfxattr [-s | -g | -l | -r] [-x] [-c | -m] [-f xattrfile] file [xattrname]

DESCRIPTION

»ØÄꤷ¤¿¥Õ¥¡¥¤¥ë¤Î³Èĥ°À­¤ª¤è¤ÓXML³Èĥ°À­¤òÁàºî¤·¤Þ¤¹¡¥ ³Èĥ°À­¤Ï°À­Ì¾¤È°À­Ãͤ«¤é¤Ê¤ê¡¤¤¤¤º¤ì¤âǤ°Õ¤Îʸ»úÎó¤Ç¤¹¡¥ XML³Èĥ°À­¤Ï°À­Ãͤ¬XML·¿¤Ç¤¢¤ë³Èĥ°À­¤Ç¤¹¡¥ XML³Èĥ°À­¤ÏÄ̾ï¤Î³Èĥ°À­¤È¤ÏÆÈΩ¤Ë°·¤ï¤ì¤ë¤¿¤á¡¤ Ʊ°ì¤Î°À­Ì¾¤¬ÍøÍѲÄǽ¤Ç¤¹¡¥

XML³Èĥ°À­¤òÁàºî¤¹¤ë¾ì¹ç¡¤-x¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Þ¤¹¡¥ XML³Èĥ°À­¤Ïgffindxmlattr¥³¥Þ¥ó¥É¤òÍøÍѤ¹¤ë¤³¤È¤Ë¤è¤ê XPath¸¡º÷¤ÎÂоݤȤʤê¤Þ¤¹¡¥

³Èĥ°À­¤ÏGfarm¤ÎÁ´¤Æ¤Î¥Õ¥¡¥¤¥ë¡¤¥Ç¥£¥ì¥¯¥È¥ê¤ËÀßÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡¥ ¥Õ¥¡¥¤¥ë¤òºï½ü¤¹¤ë¤È¡¤¤½¤Î¥Õ¥¡¥¤¥ë¤ËÀßÄꤵ¤ì¤Æ¤¤¤¿³Èĥ°À­¤âÁ´¤Æºï½ü¤µ¤ì¤Þ¤¹¡¥

-s¡¤-g¡¤-l¡¤-r¥ª¥×¥·¥ç¥ó¤Ïɬ¤º²¿¤ì¤«¤¬»ØÄꤵ¤ì¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡¥

OPTIONS

-s

»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤Ë°À­Ì¾xattrname¤Î³Èĥ°À­¤òÀßÄꤷ¤Þ¤¹¡¥ °À­ÃͤÏ-f¥ª¥×¥·¥ç¥ó¤Ç»ØÄꤵ¤ì¤¿xattrfile¤ÎÆâÍÆ¤È¤Ê¤ê¤Þ¤¹¡¥ -f¥ª¥×¥·¥ç¥ó¤¬»ØÄꤵ¤ì¤Ê¤¤¾ì¹ç¤Ïɸ½àÆþÎϤ«¤é¤ÎÆþÎÏÆâÍÆ¤È¤Ê¤ê¤Þ¤¹¡¥ -c¡¤-m¥ª¥×¥·¥ç¥ó¤¬»ØÄꤵ¤ì¤Ê¤¤¾ì¹ç¡¤ ¤¹¤Ç¤Ë³Èĥ°À­¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Æ¤â¾å½ñ¤­¤µ¤ì¤Þ¤¹¡¥

-g

»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤Î°À­Ì¾xattrname¤Î³Èĥ°À­¤òɽ¼¨¤·¤Þ¤¹¡¥

-l

»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤Î°À­Ì¾¤Î°ìÍ÷¤òɽ¼¨¤·¤Þ¤¹¡¥

-r

»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤Î°À­Ì¾xattrname¤Î³Èĥ°À­¤ò¾Ãµî¤·¤Þ¤¹¡¥

-x

XML³Èĥ°À­¤ò½èÍý¤·¤Þ¤¹¡¥

-c

-s¥ª¥×¥·¥ç¥ó¤È¶¦¤ËÍѤ¤¤é¤ì¡¤³Èĥ°À­¤ò¿·µ¬¤ËÀßÄꤷ¤Þ¤¹¡¥ ¤³¤Î¤È¤­´û¤Ë³Èĥ°À­¤¬ÀßÄêºÑ¤ß¤Ç¤¢¤ì¤Ð¥¨¥é¡¼¤È¤Ê¤ê¤Þ¤¹¡¥

-m

-s¥ª¥×¥·¥ç¥ó¤È¶¦¤ËÍѤ¤¤é¤ì¡¤³Èĥ°À­¤ÎÊѹ¹¤ò¹Ô¤¤¤Þ¤¹¡¥ ¤³¤Î¤È¤­³Èĥ°À­¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¥¨¥é¡¼¤È¤Ê¤ê¤Þ¤¹¡¥

-f xattrfile

-s¥ª¥×¥·¥ç¥ó¤È¶¦¤ËÍѤ¤¤ë¤È¡¤»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤«¤é³Èĥ°À­¤òÆÉ¹þ¤ß¤Þ¤¹¡¥ -g¥ª¥×¥·¥ç¥ó¤È¶¦¤ËÍѤ¤¤ë¤È¡¤»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤Ë³Èĥ°À­¤ò½ñ¹þ¤ß¤Þ¤¹¡¥

-?

°ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡¥

SEE ALSO

gffindxmlattr(1)

gfarm-2.4.1/doc/html/ja/ref/man1/gfchmod.1.html0000644000000000000000000000207111507222721017456 0ustar rootroot gfchmod

gfchmod

Name

gfchmod -- Gfarm ¥Õ¥¡¥¤¥ë¤Î¥¢¥¯¥»¥¹¸¢¸Â¤òÊѹ¹¤¹¤ë

Synopsis

gfchmod [options] mode [path...]

DESCRIPTION

Gfarm ¥Õ¥¡¥¤¥ë¤Î¥¢¥¯¥»¥¹¸¢¸Â¤òÊѹ¹¤·¤Þ¤¹¡¥

OPTIONS

-?

°ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡¥

gfarm-2.4.1/doc/html/ja/ref/man1/gfreg.1.html0000644000000000000000000001222711507222721017145 0ustar rootroot gfreg

gfreg

Name

gfreg -- Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ø¤Î¥Õ¥¡¥¤¥ë¡¤¥Õ¥¡¥¤¥ë¥Õ¥é¥°¥á¥ó¥È¡¤¥Ç¥£¥ì¥¯¥È¥ê¤ÎÅÐÏ¿

Synopsis

gfreg [-p ] [-h ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É | -H ¥Û¥¹¥È¥Õ¥¡¥¤¥ë̾ | -D ¥É¥á¥¤¥ó̾] [-a architecture] program ... gfarm-URL

gfreg [-i ] [-h ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É | -H ¥Û¥¹¥È¥Õ¥¡¥¤¥ë̾ | -D ¥É¥á¥¤¥ó̾] localfile ... gfarm-URL

gfreg -N ¥Õ¥é¥°¥á¥ó¥ÈÁí¿ô -I ¥Õ¥é¥°¥á¥ó¥ÈÈÖ¹æ [-h ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É | -H ¥Û¥¹¥È¥Õ¥¡¥¤¥ë̾ | -D ¥É¥á¥¤¥ó̾] localfile ... gfarm-URL

gfreg -r [-h ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É | -H ¥Û¥¹¥È¥Õ¥¡¥¤¥ë̾ | -D ¥É¥á¥¤¥ó̾] [-a architecture] [directory | program | localfile] ... gfarm-URL

DESCRIPTION

Âè1¤Î·Á¼°¤Î¾ì¹ç¡¤°ú¿ô program ¤Ë»ØÄꤷ¤¿¥í¡¼¥«¥ë¥Ç¥£¥¹¥¯¾å¤Î ¥×¥í¥°¥é¥à¡¦¥Õ¥¡¥¤¥ë¤ò¡¤gfarm-URL ¤ËÅÐÏ¿¤·¤Þ¤¹¡¥gfarm-URL ¤¬¥Ç¥£¥ì¥¯¥È ¥ê¤Î¾ì¹ç¤Ï¡¤Ê£¿ô¤Î program ¤ò»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡¥¤³¤ì°Ê¹ß¡¤ gfrun ¤ª¤è¤Ó gfmpirun_p4 ¤Ç»ØÄꤹ¤ë¥×¥í¥°¥é¥à̾¤È¤·¤Æ¡¤¤³¤Î URL ¤¬ »È¤¨¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡¥¥ª¥×¥·¥ç¥ó -p ¤¬¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¤¼Â¹Ô¤¬µö²Ä¤µ¤ì¤Æ¤¤ ¤ë program ¤Î¤ß»ØÄê¤Ç¤­¤Þ¤¹¡¥¤¢¤ë¾ì¹ç¤Ë¤Ï¡¤¼Â¹Ô¤¬µö²Ä¤µ¤ì¤Æ¤¤¤Ê¤¤¥Õ¥¡¥¤ ¥ë¤â»ØÄê¤Ç¤­¤Þ¤¹¤¬¡¤¤³¤Î¥Õ¥¡¥¤¥ë̾¤ò gfrun ¤ª¤è¤Ó gfmpirun_p4 ¤Ç»ØÄꤷ ¤Æ¤â¡¤¼Â¹Ô¤Ç¤­¤Þ¤»¤ó¡¥¥ª¥×¥·¥ç¥ó -a ¤Ç¥×¥í¥°¥é¥à¤Îưºî¤¹¤ë¥¢¡¼¥­¥Æ ¥¯¥Á¥ã¤ò»ØÄꤷ¤Ê¤«¤Ã¤¿¾ì¹ç¡¤¤¢¤ë¤¤¤Ï¥ª¥×¥·¥ç¥ó -h ¤ÇÅÐÏ¿¤¹¤ë¥Õ¥¡¥¤¥ë¥· ¥¹¥Æ¥à¥Î¡¼¥É¤ò»ØÄꤷ¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¤gfreg ¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤·¤¿¥Û¥¹¥È¤Î ¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤ÈƱ¤¸¤Ç¤¢¤ë¤È²¾Äꤷ¤Þ¤¹¡¥¤¿¤À¤·¡¤¤½¤Î¥Û¥¹¥È¤¬ Gfarm ¥á ¥¿¥µ¡¼¥Ð¤ËÅÐÏ¿¤µ¤ì¤Æ¤¤¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡¥

Âè2¤Î·Á¼°¤Î¾ì¹ç¡¤°ì¤Ä°Ê¾å¤ÎÊ£¿ô¤Îlocalfile¤òGfarm¥Õ¥¡¥¤¥ë¤È¤·¤Æ ÅÐÏ¿¤·¤Þ¤¹¡¥¥ª¥×¥·¥ç¥ó -i ¤¬¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¤¼Â¹Ô¤¬µö²Ä¤µ¤ì¤Æ¤¤¤Ê¤¤ localfile ¤Î¤ß¤ò»ØÄê¤Ç¤­¤Þ¤¹¡¥¤¢¤ë¾ì¹ç¤Ë¤Ï¡¤¼Â¹Ôµö²Ä¤È¤Ï̵´Ø·¸¤Ë localfile ¤ò»ØÄê¤Ç¤­¤Þ¤¹¡¥¥Õ¥¡¥¤¥ë¤ÎÊ£À½¤¬ºîÀ®¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¥·¥¹ ¥Æ¥à¥Î¡¼¥É¤Ï¼«Æ°Åª¤ËCPUÉé²Ù¤Ë¤è¤êÁª¤Ð¤ì¤Þ¤¹¤¬¡¤¥ª¥×¥·¥ç¥ó -h, -H, -D ¤Î¤¤¤º¤ì¤«¤Ë¤è¤êÁªÂò¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤òÀ©¸Â¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡¥

Âè3¤Î·Á¼°¤Î¾ì¹ç¡¤localfile¤òGfarm¥Õ¥¡¥¤¥ë¤Î¥Õ¥é¥°¥á¥ó¥È¤È¤·¤ÆÅÐ Ï¿¤·¤Þ¤¹¡¥¥ª¥×¥·¥ç¥ó -N ¤È -I ¤Ç¡¤Áí¥Õ¥é¥°¥á¥ó¥È¿ô¤È¡¤¤³¤Îlocalfile¤Î ¥Õ¥é¥°¥á¥ó¥ÈÈÖ¹æ¤òɬ¤º»ØÄꤹ¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡¥Gfarm-URL ¤¬¥Ç¥£¥ì¥¯¥È¥ê ¤Î¾ì¹ç¤Ï localfile ¤òÊ£¿ô»ØÄꤹ¤ë¤³¤È¤¬²Äǽ¤Ç¤¹¡¥¥Õ¥¡¥¤¥ë¤ÎÊ£À½¤¬ºîÀ® ¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Ï¼«Æ°Åª¤ËCPUÉé²Ù¤Ë¤è¤êÁª¤Ð¤ì¤Þ¤¹¤¬¡¤¥ª¥× ¥·¥ç¥ó -h, -H, -D ¤Î¤¤¤º¤ì¤«¤Ë¤è¤ê¤Ë¤è¤êÌÀ¼¨Åª¤Ë»ØÄꤹ¤ë¤³¤È¤â¤Ç¤­¤Þ¤¹¡¥ ¤¿¤À¡¤¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Ç gfreg ¤ò¼Â¹Ô¤·¤¿¾ì¹ç¤Ï¾ï¤Ë¼«¥Î¡¼¥É¤¬ Áª¤Ð¤ì¤Æ¤·¤Þ¤¦¤¿¤á¡¤¥Õ¥¡¥¤¥ë¤òʬ»¶¤µ¤»¤ÆÇÛÃÖ¤·¤¿¤¤¾ì¹ç¤Ï¥ª¥×¥·¥ç¥ó -h, -H, -D ¤Î¤¤¤º¤ì¤«¤ò»ØÄꤹ¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡¥

Âè4¤Î·Á¼°¤Î¾ì¹ç¡¤directory, program, localfile ¤ò gfarm-URL ¤Ë ÅÐÏ¿¤·¤Þ¤¹¡¥directory ¤Ë¥µ¥Ö¥Ç¥£¥ì¥¯¥È¥ê¤ä¥Õ¥¡¥¤¥ë¤¬´Þ¤Þ¤ì¤Æ¤¤¤ì¤ÐºÆµ¢ Ū¤ËÅÐÏ¿¤·¤Þ¤¹¡¥¥Ç¥£¥ì¥¯¥È¥ê¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë¡¤¤¢¤ë¤¤¤Ï¡¤°ú¿ô localfile ¤Ç»ØÄꤵ¤ì¤Æ¤¤¤ëÈó¼Â¹Ô¥Õ¥¡¥¤¥ë¤Ï¡¤°ì¤Ä¤Î¥Õ¥é¥°¥á¥ó¥È¤«¤é¤Ê¤ë Gfarm¥Õ¥¡ ¥¤¥ë¤È¤·¤ÆÅÐÏ¿¤µ¤ì¤Þ¤¹¡¥ Gfarm-URL ¤¬¥Ç¥£¥ì¥¯¥È¥ê¤È¤·¤ÆÂ¸ºß¤¹¤ë¾ì¹ç¤Ï¡¤Ê£¿ô¤Î directory, program, localfile ¤ò Gfarm-URL ¥Ç¥£¥ì¥¯¥È¥ê¤ËÅÐÏ¿¤·¤Þ¤¹¡¥ ¾¤Î·Á¼°¤È°Û¤Ê¤ê¡¤¤³¤ì¤é¤ò¤¤¤Ã¤·¤ç¤Ë°ú¿ô¤È¤·¤Æ»ØÄꤹ¤ë¤³¤È¤â¤Ç¤­¤Þ¤¹¡¥ gfarm_URL ¤¬Â¸ºß¤·¤Ê¤¤¾ì¹ç¤Ï¡¤directory, program, localfile ¤Î¤¤¤º¤ì¤« °ì¤Ä¤òÅÐÏ¿¤Ç¤­¤Þ¤¹¡¥ ¥Õ¥¡¥¤¥ë¤¬ÅÐÏ¿¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤È¥ª¥×¥·¥ç¥ó -a -h ¤Ë¤Ä¤¤¤Æ ¤Ï¡¤¾åµ­¤ÎÂè1¤Î·Á¼°¤Ç¤ÎÀâÌÀ¤ò»²¾È¤·¤¯¤À¤µ¤¤¡¥

OPTIONS

-f

gfarm-URL ¤¬¥Õ¥¡¥¤¥ë¤È¤·¤ÆÂ¸ºß¤·¤Æ¤¤¤Æ¤â¡¤¶¯À©Åª¤Ë¾å½ñ¤­¤·¤Þ¤¹¡¥

-?

°ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡¥

gfarm-2.4.1/doc/html/ja/ref/man1/gfstat.1.html0000644000000000000000000000224211507222721017337 0ustar rootroot gfstat

gfstat

Name

gfstat -- Gfarm ¥Õ¥¡¥¤¥ë¤Þ¤¿¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤Î¾ðÊó¤òɽ¼¨¤¹¤ë

Synopsis

gfstat [options] [path...]

DESCRIPTION

»ØÄꤷ¤¿¥Õ¥¡¥¤¥ë¤¢¤ë¤¤¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤Î¾ðÊó¤òɽ¼¨¤·¤Þ¤¹¡¥

OPTIONS

-c

¥Õ¥¡¥¤¥ëÊ£À½¤Î¿ô¤òɽ¼¨¤·¤Þ¤¹¡¥

-?

°ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡¥

gfarm-2.4.1/doc/html/ja/ref/man1/gfstatus.1.html0000644000000000000000000000137011507222721017710 0ustar rootroot gfstatus

gfstatus

Name

gfstatus -- Gfarm¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¾ðÊó¤òɽ¼¨¤¹¤ë

Synopsis

gfstatus

DESCRIPTION

Gfarm¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¾ðÊó¤òɽ¼¨¤·¤Þ¤¹¡¥

gfarm-2.4.1/doc/html/ja/ref/man1/gfrun.1.html0000644000000000000000000001365311507222721017200 0ustar rootroot gfrun

gfrun

Name

gfrun, gfrsh, gfssh -- ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Ç gfarm ÊÂÎó¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤¹¤ë

Synopsis

gfrun [¥ª¥×¥·¥ç¥ó] ¥×¥í¥°¥é¥à̾ °ú¿ô...

gfrsh [¥ª¥×¥·¥ç¥ó] ¥×¥í¥°¥é¥à̾ °ú¿ô...

gfssh [¥ª¥×¥·¥ç¥ó] ¥×¥í¥°¥é¥à̾ °ú¿ô...

DESCRIPTION

ÊÂÎó¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤·¤Þ¤¹¡¥¼Â¹Ô¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Ï¡¤ -G ¥ª¥×¥·¥ç¥ó¡¤-H ¥ª¥×¥·¥ç¥ó¤¢¤ë¤¤¤Ï -N ¥ª¥×¥·¥ç¥ó¤Ë¤è¤ê·èÄꤵ¤ì¤Þ¤¹¡¥

-G ¥ª¥×¥·¥ç¥ó¤Ï¥Õ¥¡¥¤¥ë¡¦¥¢¥Õ¥£¥Ë¥Æ¥£¡¦¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¤Î¤¿¤á¤Î Gfarm ¥Õ¥¡¥¤¥ë gfarm-URL ¤ò»ØÄꤷ¤Þ¤¹¡¥ ¥Õ¥¡¥¤¥ë¡¦¥¢¥Õ¥£¥Ë¥Æ¥£¡¦¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¤Ç¤Ï¡¤»ØÄꤵ¤ì¤¿ Gfarm ¥Õ¥¡¥¤¥ë¤Î¤½¤ì¤¾¤ì¤Î¥Õ¥¡¥¤¥ëÃÇÊÒ¤ËÂФ·¡¤Ê£À½¤¬³ÊǼ¤µ¤ì¤Æ¤¤¤ë ¥Î¡¼¥É¤Î¤¦¤Á°ì¥Î¡¼¥É¤¬Áª¤Ð¤ì¤Þ¤¹¡¥¤Ä¤Þ¤ê¡¤¥Õ¥¡¥¤¥ëÃÇÊҤοô¤È Ʊ¿ô¤Î¥×¥í¥»¥¹¤¬¡¤¥Õ¥¡¥¤¥ëÃÇÊÒ¤ò³ÊǼ¤·¤Æ¤¤¤ë¥Î¡¼¥É¤Ç¼Â¹Ô¤µ¤ì ¤ë¤È¤¤¤¦¤³¤È¤Ë¤Ê¤ê¤Þ¤¹¡¥ -H ¥ª¥×¥·¥ç¥ó¤Ï ¥Û¥¹¥È»ØÄê¥Õ¥¡¥¤¥ë ¤ò»ØÄꤷ¤Þ¤¹¡¥ ¤³¤Î¾ì¹ç¡¤¤½¤Î¥Õ¥¡¥¤¥ë¤Ëµ­½Ò¤µ¤ì¤¿¥Î¡¼¥É¤ÇÊÂÎó¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤·¤Þ¤¹¡¥ -N ¥ª¥×¥·¥ç¥ó¤Ï¼Â¹Ô¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Î ¥Î¡¼¥É¿ô ¤ò»ØÄꤷ¤Þ¤¹¡¥

-G ¥ª¥×¥·¥ç¥ó¡¤-H ¥ª¥×¥·¥ç¥ó¡¤-N ¥ª¥×¥·¥ç¥ó¤ÏƱ»þ¤ËÆó¤Ä°Ê¾å»ØÄꤹ¤ë¤³ ¤È¤Ï¤Ç¤­¤Þ¤»¤ó¡¥¤Þ¤¿¡¤-G ¥ª¥×¥·¥ç¥ó¡¤-H ¥ª¥×¥·¥ç¥ó¡¤-N ¥ª¥×¥·¥ç¥ó¤¬¤¤ ¤º¤ì¤â»ØÄꤵ¤ì¤Ê¤¤¾ì¹ç¤Ï¡¤°ú¿ô¤Ë»ØÄꤵ¤ì¤¿´û¤Ë¸ºß¤¹¤ë Gfarm¥Õ¥¡¥¤¥ë¤Î ¤¦¤Á°ìÈ֤Ϥ¸¤á¤Î¥Õ¥¡¥¤¥ë¤òÍøÍѤ·¤¿¥Õ¥¡¥¤¥ë¡¦¥¢¥Õ¥£¥Ë¥Æ¥£¡¦¥¹¥±¥¸¥å¡¼¥ê ¥ó¥°¤Ë¤è¤ê·èÄꤵ¤ì¤Þ¤¹¡¥°ú¿ôÃæ¤Ë´û¤Ë¸ºß¤¹¤ë Gfarm ¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Ê ¤¤¾ì¹ç¤Ï¡¤Å¬Åö¤Ê¥Î¡¼¥É¤¬1 ¥Î¡¼¥ÉÁªÂò¤µ¤ì¡¤Ã༡¼Â¹Ô¤È¤Ê¤ê¤Þ¤¹¡¥

gfrsh ¤ä gfssh ¥³¥Þ¥ó¥É¤Ï¡¤gfrcmd ¤ÎÂå¤ï¤ê¤Ë rsh¡¤ssh ¤ò ÍøÍѤ¹¤ë¤³¤È¤ò½ü¤¤¤Æ¡¤gfrun ¤ÈƱÍͤǤ¹¡¥

¥×¥í¥°¥é¥à̾¤È¤·¤Æ¤Ï¡¤gfreg ¥³¥Þ¥ó¥É¤ÇÅÐÏ¿¤·¤¿¥×¥í¥°¥é¥à¤Î gfarm-URL ¤â»ØÄê¤Ç¤­¤Þ¤¹¡¥

OPTIONS

-G gfarm-URL

gfarm-URL ¤Î¥Õ¥¡¥¤¥ë¡¦¥¢¥Õ¥£¥Ë¥Æ¥£¡¦¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¤Ë¤è¤ê ÊÂÎó¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤·¤Þ¤¹¡¥ ¥Õ¥¡¥¤¥ë¡¦¥¢¥Õ¥£¥Ë¥Æ¥£¡¦¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¤Îưºî¤Ë¤Ä¤¤¤Æ¤Ï¡¤DESCRIPTION Àá¤ò »²¾È¤·¤Æ¤¯¤À¤µ¤¤¡¥

-H ¥Û¥¹¥È»ØÄê¥Õ¥¡¥¤¥ë

ÊÂÎó¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É·²¤òµ­ºÜ¤·¤¿¥Õ¥¡¥¤¥ë̾¤ò »ØÄꤷ¤Þ¤¹¡¥ ¥Û¥¹¥È̾¤Ï¡¤³Æ¹Ô¤Ë°ì¥Û¥¹¥È¤º¤Äµ­½Ò¤·¤Þ¤¹¡¥

¥Õ¥¡¥¤¥ë̾¤È¤·¤Æ ``-'' ¤ò»ØÄꤷ¤¿¾ì¹ç¡¤É¸½àÆþÎϤ«¤é¥Û¥¹¥È̾¤Î¥ê¥¹¥È¤ò ÆÉ¤ß¹þ¤ß¤Þ¤¹¡¥

-N ¥Î¡¼¥É¿ô

ÊÂÎó¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Î¥Î¡¼¥É¿ô¤ò»ØÄꤷ¤Þ¤¹¡¥ ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤ÏÉé²Ù¤Î¾®¤µ¤¤¥Î¡¼¥É¤«¤é½ç¤Ë¥Î¡¼¥É¿ôʬÁª¤Ð¤ì¤Þ¤¹¡¥

-r

¥Õ¥¡¥¤¥ë¤ò±ó³Ö»²¾È¤¹¤ë¾ì¹ç¡¤»²¾È¤ËÀèΩ¤Á¼«¥Û¥¹¥È¤Ë¥Õ¥¡¥¤¥ëÊ£À½¤ò ºîÀ®¤·¤Þ¤¹¡¥

-o gfarm-URL

¼Â¹Ô¤µ¤ì¤ëÊÂÎó¥×¥í¥°¥é¥à¤Îɸ½à½ÐÎϤò gfarm-URL ¤Ë½ñ¤­½Ð¤·¤Þ¤¹¡¥

-e gfarm-URL

¼Â¹Ô¤µ¤ì¤ëÊÂÎó¥×¥í¥°¥é¥à¤Îɸ½à¥¨¥é¡¼½ÐÎϤò gfarm-URL ¤Ë½ñ¤­½Ð¤·¤Þ¤¹¡¥

-I ¥Õ¥é¥°¥á¥ó¥ÈÈÖ¹æ

»ØÄꤵ¤ì¤¿¥Õ¥é¥°¥á¥ó¥ÈÈÖ¹æ¤Î¥×¥í¥»¥¹¤À¤±¤¬¼Â¹Ô¤µ¤ì¤Þ¤¹¡¥ ¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¤-G ¥ª¥×¥·¥ç¥ó¤¢¤ë¤¤¤Ï°ú¿ô¤ËÍ¿¤¨¤¿ Gfarm ¥Õ¥¡¥¤¥ë¤Ë¤è¤Ã¤Æ¡¤¥Õ¥¡¥¤¥ë¡¦¥¢¥Õ¥£¥Ë¥Æ¥£¡¦¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¤¬ÁªÂò¤µ¤ì¤Æ¤¤¤ë ¾ì¹ç¡¤¤ª¤è¤Ó -N ¥ª¥×¥·¥ç¥ó¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Î¤ßÍø ÍѲÄǽ¤Ç¤¹¡¥

-v

¾ÜºÙ¤Ë¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤òɽ¼¨¤·¤Þ¤¹¡¥

-p

¥×¥í¥°¥é¥à¼Â¹Ô¸å¤Ë Gfarm ÊÂÎóI/O API¤Î½êÍ×»þ´Ö¤òɽ¼¨¤·¤Þ¤¹¡¥

-g

¼Â¹Ô¤µ¤ì¤ë¥×¥í¥°¥é¥à¤ò gfarm ²½¤µ¤ì¤¿¥×¥í¥°¥é¥à¤À¤ÈÌÀ¼¨Åª¤Ë»ØÄꤷ¤Þ¤¹¡¥ ¤³¤Î·ë²Ì¡¤¥×¥í¥°¥é¥à¤Ë¤Ï Gfarm ÆÃÍ­¤Î¥ª¥×¥·¥ç¥ó¤¬ÅϤµ¤ì¤Þ¤¹¡¥

-u

¼Â¹Ô¤µ¤ì¤ë¥×¥í¥°¥é¥à¤òÄ̾ï¤Î¥×¥í¥°¥é¥à¤Ç¤¢¤ë¤ÈÌÀ¼¨Åª¤Ë»ØÄꤷ¤Þ¤¹¡¥ ¤³¤Î¾ì¹ç¡¤¥×¥í¥°¥é¥à¤Ë Gfarm ÆÃÍ­¤Î¥ª¥×¥·¥ç¥ó¤¬ÅϤµ¤ì¤ë¤³¤È¤Ï¤¢¤ê¤Þ¤»¤ó¡¥

-b

Gfarm ¥·¥¹¥Æ¥à¥³¡¼¥ë¡¦¥Õ¥Ã¥¯¡¦¥é¥¤¥Ö¥é¥ê¤òÍøÍѤ·¤Æ¼Â¹Ô¤µ¤ì¤ë¥×¥í¥°¥é¥à¤Ë¤ª¤¤¤Æ¡¤ ¥Ç¥Õ¥©¥ë¥È¤Î¥Õ¥¡¥¤¥ë¡¦¥Ó¥å¡¼¤ò¥°¥í¡¼¥Ð¥ë¡¦¥Õ¥¡¥¤¥ë¡¦¥Ó¥å¡¼¤ËÀßÄꤷ¤Þ¤¹¡¥ ¤³¤Î¥ª¥×¥·¥ç¥ó¤ò¤Ä¤±¤Ê¤¤¤È¡¤ ¥Ç¥Õ¥©¥ë¥È¤Î¥Õ¥¡¥¤¥ë¡¦¥Ó¥å¡¼¤Ï¥í¡¼¥«¥ë¡¦¥Õ¥¡¥¤¥ë¡¦¥Ó¥å¡¼¤È¤Ê¤ê¤Þ¤¹¡¥

-?

°ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡¥

ENVIROMNENT VARIABLES

GFRUN_CMD

±ó³Öµ¯Æ°¥³¥Þ¥ó¥É¤ò»ØÄꤷ¤Þ¤¹¡¥Î㤨¤Ð globus-job-run ¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¤ gfrun ¤Ï globus-job-run ¤ò»È¤Ã¤Æ¤½¤ì¤¾¤ì¤Î¥×¥í¥»¥¹¤òµ¯Æ°¤·¤Þ¤¹¡¥

gfarm-2.4.1/doc/html/ja/ref/man1/gfexport.1.html0000644000000000000000000000353611507222721017714 0ustar rootroot gfexport

gfexport

Name

gfexport -- Gfarm ¥Õ¥¡¥¤¥ë¤òÄ̾ï¤Î¥Õ¥¡¥¤¥ë¤ËÊÑ´¹¤¹¤ë

Synopsis

gfexport [-H ¥Û¥¹¥È»ØÄê¥Õ¥¡¥¤¥ë] [-I ¥Õ¥é¥°¥á¥ó¥ÈÈÖ¹æ] gfarm-URL

DESCRIPTION

»ØÄꤷ¤¿ Gfarm URL ¤Îɽ¤¹ Gfarm ÊÂÎó¥Õ¥¡¥¤¥ë¤ò¡¢Ä̾ï¤Î¥Õ¥¡¥¤¥ë¤ËÊÑ´¹ ¤·¤ÆÉ¸½à½ÐÎϤ˽ÐÎϤ·¤Þ¤¹¡£

OPTIONS

-H ¥Û¥¹¥È»ØÄê¥Õ¥¡¥¤¥ë

¥Õ¥é¥°¥á¥ó¥È¤ò¼è¤ê½Ð¤¹¥Û¥¹¥È̾¤Î¥ê¥¹¥È¤ò»ØÄꤷ¤Þ¤¹¡£ ¥Û¥¹¥È̾¤Ï¡¢³Æ¹Ô¤Ë°ì¥Û¥¹¥È¤º¤Äµ­½Ò¤·¤Þ¤¹¡£ ¾Êά¤·¤¿¾ì¹ç¤Ë¤Ï¡¢¼«Æ°Åª¤ËÁª¤Ð¤ì¤¿¥Û¥¹¥È¤«¤é¥Õ¥é¥°¥á¥ó¥È¤òÆÀ¤Þ¤¹¡£

¥Õ¥¡¥¤¥ë̾¤È¤·¤Æ ``-'' ¤ò»ØÄꤷ¤¿¾ì¹ç¡¢É¸½àÆþÎϤ«¤é¥Û¥¹¥È̾¤Î¥ê¥¹¥È¤ò ÆÉ¤ß¹þ¤ß¤Þ¤¹¡£

-I ¥Õ¥é¥°¥á¥ó¥ÈÈÖ¹æ

ÊÂÎó¥Õ¥¡¥¤¥ëÃæ¤Î¡¢»ØÄꤷ¤¿¥Õ¥é¥°¥á¥ó¥È¤Î¤ß¤ò¼è¤ê½Ð¤·¤Þ¤¹¡£ ¼Â¹Ô·Á¼°¤Î¥Õ¥¡¥¤¥ë¤Î¾ì¹ç¤Ë¤Ï¡¢¤³¤Î¥ª¥×¥·¥ç¥ó¤Ç¼Â¹Ô¥¢¡¼¥­¥Æ¥¯¥Á¥ã (Îã ¡Ösparc-sun-solaris8¡×) ¤ò»ØÄꤹ¤ë¤³¤È¤Ë¤è¤Ã¤Æ¡¢»ØÄꤷ¤¿¥¢¡¼¥­ ¥Æ¥¯¥Á¥ã¤Î¼Â¹Ô¥Õ¥¡¥¤¥ë¤ò¼è¤ê½Ð¤»¤Þ¤¹¡£

-?

°ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡£

gfarm-2.4.1/doc/html/ja/ref/man1/gfimport_fixed.1.html0000644000000000000000000001045111507222721021056 0ustar rootroot gfimport_fixed

gfimport_fixed

Name

gfimport_fixed -- ¸ÇÄêĹ¥Ç¡¼¥¿¤ò¥Õ¥é¥°¥á¥ó¥È¤Ëʬ¤±¤Æ¼è¤ê¹þ¤à

Synopsis

gfimport_fixed [¥ª¥×¥·¥ç¥ó] ÆþÎÏ¥Õ¥¡¥¤¥ë

DESCRIPTION

°ú¿ô¤Ë»ØÄꤷ¤¿¸ÇÄêĹ¥Ç¡¼¥¿¤«¤é¤Ê¤ë¥Õ¥¡¥¤¥ë¤ò¡¢¥Õ¥é¥°¥á¥ó¥È¤Ëʬ¤±¤Æ Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë¼è¤ê¹þ¤à¥µ¥ó¥×¥ë¡¦¥×¥í¥°¥é¥à¤Ç¤¹¡£

OPTIONS

-H ¥Û¥¹¥È»ØÄê¥Õ¥¡¥¤¥ë

¥Õ¥é¥°¥á¥ó¥È¤òÇÛÃÖ¤¹¤ë¥Û¥¹¥È̾¤Î¥ê¥¹¥È¤òµ­ºÜ¤·¤¿¥Õ¥¡¥¤¥ë̾¤ò»ØÄꤷ¤Þ¤¹¡£ ¥Û¥¹¥È̾¤Ï¡¢³Æ¹Ô¤Ë°ì¥Û¥¹¥È¤º¤Äµ­½Ò¤·¤Þ¤¹¡£ -l ¥ª¥×¥·¥ç¥ó¤ò¾Êά¤·¤¿¾ì¹ç¤Ï¡¢ÆþÎÏ¥Õ¥¡¥¤¥ë¤Ï¡¢¤³¤Î¥ª¥×¥·¥ç¥ó¤Ç »ØÄꤷ¤¿¥Û¥¹¥È¤Ë¡¢Åùʬ³ä¤·¤¿¥Õ¥é¥°¥á¥ó¥È¤È¤·¤ÆÇÛÃÖ¤µ¤ì¤Þ¤¹¡£

¥Õ¥¡¥¤¥ë̾¤È¤·¤Æ ``-'' ¤ò»ØÄꤷ¤¿¾ì¹ç¡¢É¸½àÆþÎϤ«¤é¥Û¥¹¥È̾¤Î¥ê¥¹¥È¤ò ÆÉ¤ß¹þ¤ß¤Þ¤¹¡£

-f ¥Õ¥é¥°¥á¥ó¥È¹½À®¥Õ¥¡¥¤¥ë

³Æ¥Õ¥é¥°¥á¥ó¥È¤Î¤ª¤ª¤è¤½¤Î¥µ¥¤¥º¤È¡¢ÇÛÃÖ¤¹¤ë¥Û¥¹¥È¤òµ­ºÜ¤·¤¿¥Õ¥¡¥¤ ¥ë̾¤ò»ØÄꤷ¤Þ¤¹¡£

¹½À®¥Õ¥¡¥¤¥ë¤Ï¡¢³Æ¹Ô¤¬¡¢¶õÇò¤Ç¶èÀÚ¤é¤ì¤¿¥µ¥¤¥º¤È¥Û¥¹¥È̾¤«¤é¤Ê¤ë·Á¼°¤Ç¤¹¡£

¥Õ¥¡¥¤¥ë̾¤È¤·¤Æ ``-'' ¤ò»ØÄꤷ¤¿¾ì¹ç¡¢É¸½àÆþÎϤ«¤é¥Õ¥é¥°¥á¥ó¥È¹½À®¤ò ÆÉ¤ß¹þ¤ß¤Þ¤¹¡£

-l ¥ì¥³¡¼¥ÉĹ

¸ÇÄêĹ¥Ç¡¼¥¿¤Î¥ì¥³¡¼¥ÉŤò¥Ð¥¤¥È¿ô¤Ç»ØÄꤷ¤Þ¤¹¡£¥Õ¥é¥°¥á¥ó¥Èʬ³ä¤Ï¡¢ ¤³¤Î¥ì¥³¡¼¥ÉŤÎÀ°¿ôÇܤΰÌÃ֤ǤΤߡ¢¹Ô¤ï¤ì¤Þ¤¹¡£¾Êά»þ¤Î¥ì¥³¡¼¥ÉĹ ¤Ï 1 ¥Ð¥¤¥È¤Ç¤¹¡£

-o gfarm-URL

½ÐÎÏ Gfarm ¥Õ¥¡¥¤¥ë¤Î URL ¤ò»ØÄꤷ¤Þ¤¹¡£

-?

°ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡£

EXAMPLES

Example 1. »ØÄꤷ¤¿¸Ä¿ô¤Ëʬ³ä¤·¤Æ¼è¤ê¹þ¤à

°Ê²¼¤Ï¡¢¥Õ¥¡¥¤¥ë¤ò8¸Ä¤Î¥Õ¥é¥°¥á¥ó¥È¤Ëʬ³ä¤·¡¢ ¥Õ¥¡¥¤¥ë gfarm:file ¤È¤·¤Æ¼è¤ê¹þ¤àÎã¤Ç¤¹¡£
gfsched -N 8 | gfimport_fixed -H - -o gfarm:file source_file

Example 2. ½èÍý¤¹¤ë¥×¥í¥°¥é¥à¤ò»ØÄꤷ¡¢ÆÃÄê¤Î¸Ä¿ô¤Ëʬ³ä¤·¤Æ¼è¤ê¹þ¤à

°Ê²¼¤Ï¡¢¥Õ¥¡¥¤¥ë¤ò8¸Ä¤Î¥Õ¥é¥°¥á¥ó¥È¤Ëʬ³ä¤·¡¢ »ØÄꤷ¤¿¥×¥í¥°¥é¥à gfarm:prog ¤ò¼Â¹Ô²Äǽ¤Ê¥Û¥¹¥È¤Ë¡¢ ¥Õ¥¡¥¤¥ë gfarm:file ¤È¤·¤Æ¼è¤ê¹þ¤àÎã¤Ç¤¹¡£
gfsched -N 8 -p gfarm:prog | gfimport_fixed -H - -o gfarm:file source_file

Example 3. ´û¸¤Î gfarm ¥Õ¥¡¥¤¥ë¤ÈƱ¤¸ÇÛÃ֤Ǽè¤ê¹þ¤à

°Ê²¼¤Ï¡¢´û¸¤Î gfarm ¥Õ¥¡¥¤¥ë gfarm:template ¤È Ʊ¤¸¸Ä¿ô¤Î¥Õ¥é¥°¥á¥ó¥È¤Ëʬ³ä¤·¡¢ gfarm:template ¤¬Â¸ºß¤¹¤ë¤Î¤ÈƱ¤¸¥Û¥¹¥È¤Ë¡¢ ¥Õ¥¡¥¤¥ë gfarm:file ¤È¤·¤Æ¼è¤ê¹þ¤àÎã¤Ç¤¹¡£
gfsched gfarm:template | gfimport_fixed -H - -o gfarm:file source_file

SEE ALSO

gfimport_text(1), gfsched(1), gfarm.conf(5)

gfarm-2.4.1/doc/html/ja/ref/man1/gfdf.1.html0000644000000000000000000000470511507222721016763 0ustar rootroot gfdf

gfdf

Name

gfdf -- ¥Ç¥£¥¹¥¯¶õ¤­ÍÆÎ̼èÆÀ

Synopsis

gfdf [¥ª¥×¥·¥ç¥ó]

DESCRIPTION

gfdf ¤Ï¡¢Gfarm¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î ¥Ç¥£¥¹¥¯¶õ¤­ÍÆÎ̤òɽ¼¨¤·¤Þ¤¹¡£

OPTIONS

-a

Gfarm¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥àÁ´ÂΤΥǥ£¥¹¥¯¶õ¤­ÍÆÎ̤òɽ¼¨¤·¤Þ¤¹¡£

-h

¿ô»ú¤ò¡ÖM(¥á¥¬)¡×¤Î¤è¤¦¤Êñ°Ì¤Ä¤­¤ÇÆÉ¤ß¤ä¤¹¤¯É½¼¨¤·¤Þ¤¹¡£ ñ°Ì¤Ë¤Ï2¤ÎÎß¾è¤òÍѤ¤¤Þ¤¹¤Î¤Ç¡¢¡ÖM¡×¤Ï 1,048,576 ¤ò°ÕÌ£¤·¤Þ¤¹¡£

-H

¿ô»ú¤ò¡ÖM(¥á¥¬)¡×¤Î¤è¤¦¤Êñ°Ì¤Ä¤­¤ÇÆÉ¤ß¤ä¤¹¤¯É½¼¨¤·¤Þ¤¹¡£ ñ°Ì¤Ë¤Ï10¤ÎÎß¾è¤òÍѤ¤¤Þ¤¹¤Î¤Ç¡¢¡ÖM¡×¤Ï 1,000,000 ¤ò°ÕÌ£¤·¤Þ¤¹¡£

-n

ÍøÍѲÄǽ¤Ê¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Î¥Û¥¹¥È̾¤òɽ¼¨¤·¤Þ¤¹¡£

-r

µÕ½ç¤ËÀ°Î󤷤ƽÐÎϤ·¤Þ¤¹¡£

-S

¶õ¤­ÍÆÎ̤νç¤ËÀ°Î󤷤ƽÐÎϤ·¤Þ¤¹¡£

-P ¥Ñ¥¹Ì¾

»ØÄꤷ¤¿¥Ñ¥¹Ì¾¤Ë¤è¤êÆÃÄê¤Î¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤ò»ØÄꤷ¤Þ¤¹¡¥ ¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï -a ¥ª¥×¥·¥ç¥ó¤ÈƱ»þ¤ËÍøÍѤ¹¤ë¤È̵»ë¤µ¤ì¤Þ¤¹¡¥

-D ¥É¥á¥¤¥ó̾

»ØÄꤷ¤¿¥É¥á¥¤¥ó̾¤Ë´Þ¤Þ¤ì¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Î¾õÂÖ¤òɽ¼¨¤·¤Þ¤¹¡£

-?

°ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡£

SEE ALSO

gfhost(1), gfarm2.conf(5)

gfarm-2.4.1/doc/html/ja/ref/man1/gfgrep.1.html0000644000000000000000000000400511507222721017320 0ustar rootroot gfgrep

gfgrep

Name

gfgrep -- ÊÂÎó¥Õ¥¡¥¤¥ë¤ò grep ¤¹¤ë

Synopsis

gfrun {gfarm:gfgrep} -o ½ÐÎÏgfarm-URL Àµµ¬É½¸½ ÆþÎÏgfarm-URL...

gfrun {gfarm:gfgrep} -o ½ÐÎÏgfarm-URL -e Àµµ¬É½¸½ ÆþÎÏgfarm-URL...

DESCRIPTION

gfrun ¤«¤é¸Æ¤Ó½Ð¤µ¤ì¤ë¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Î¥µ¥ó¥×¥ë¡¦¥×¥í¥°¥é¥à¤Ç¤¹¡£

¤Þ¤¿¡¢¥í¡¼¥«¥ë¥Õ¥¡¥¤¥ë¥Ó¥å¡¼¤òÍøÍѤ·¤Æ Gfarm ¥Õ¥¡¥¤¥ë¤Ë½ÐÎϤ¹¤ëÎã¤Ë¤â ¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£

ÆþÎÏ gfarm-URL ¤«¤éÀµµ¬É½¸½¤ò¸¡º÷¤·¡¢·ë²Ì¤ò ½ÐÎÏ gfarm-URL ¤Ë½ÐÎϤ· ¤Þ¤¹¡£

¥½¡¼¥¹¤ò¸«¤ë¤Èʬ¤«¤ëÄ̤ꡢgfrun ¤«¤é¸Æ¤Ó½Ð¤µ¤ì¤ë¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¡¢ -I ¤ª¤è¤Ó -N ¥ª¥×¥·¥ç¥ó¤ò²ò¼á¤·¡¢¤³¤³¤«¤éÆÀ¤¿ÃÍ¤Ç gfs_pio_set_local() ¤ò¸Æ¤Ó½Ð¤¹É¬Íפ¬¤¢¤ê¤Þ¤¹¡£

OPTIONS

-e Àµµ¬É½¸½

¡Ö-¡×¤Ç»Ï¤Þ¤ëÀµµ¬É½¸½¤ò»ØÄꤷ¤¿¤¤¾ì¹ç¤ËÍѤ¤¤Þ¤¹¡£

-o gfarm-URL

½ÐÎÏ Gfarm ¥Õ¥¡¥¤¥ë¤Î URL ¤ò»ØÄꤷ¤Þ¤¹¡£

-?

°ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡£

gfarm-2.4.1/doc/html/ja/ref/man1/gfchown.1.html0000644000000000000000000000235011507222721017502 0ustar rootroot gfchown

gfchown

Name

gfchown -- Gfarm ¥Õ¥¡¥¤¥ë¤Î½êÍ­¼Ô¡¤½êÍ­¥°¥ë¡¼¥×¤òÊѹ¹¤¹¤ë

Synopsis

gfchown [options] owner[:group] [path...]

gfchown [options] :group [path...]

DESCRIPTION

Gfarm ¥Õ¥¡¥¤¥ë¤Î½êÍ­¼Ô¡¤½êÍ­¥°¥ë¡¼¥×¤òÊѹ¹¤·¤Þ¤¹¡¥

OPTIONS

-?

°ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡¥

gfarm-2.4.1/doc/html/ja/ref/man1/gfrep.1.html0000644000000000000000000001052711507222721017157 0ustar rootroot gfrep

gfrep

Name

gfrep -- Gfarm ¥Õ¥¡¥¤¥ë¤ÎÊ£À½¤òºîÀ®¤¹¤ë¡¥

Synopsis

gfrep [-mnqvx] [-S Ê£À½¸µ¥É¥á¥¤¥ó̾] [-D Ê£À½Àè¥É¥á¥¤¥ó̾] [-h Ê£À½¸µ¥Û¥¹¥È»ØÄê¥Õ¥¡¥¤¥ë] [-H Ê£À½Àè¥Û¥¹¥È»ØÄê¥Õ¥¡¥¤¥ë] [-N Ê£À½¿ô] [-j ÊÂÎó¿ô] path...

DESCRIPTION

°ú¿ô path ¤Ç»ØÄꤷ¤¿¥Õ¥¡¥¤¥ë¤ÎÊ£À½¤ò¡¤ »ØÄꤵ¤ì¤¿¥Û¥¹¥È·²¤Ë¡¤»ØÄꤵ¤ì¤¿Ê£À½¤Î¿ô¤À¤±ºîÀ®¤·¤Þ¤¹¡¥ Ê£À½ºîÀ®¸µ¤Î¥Û¥¹¥È·²¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¤ ¤½¤Î¥Û¥¹¥È·²¤Ë¥Õ¥¡¥¤¥ë¤ÎÊ£À½¤¬¤¢¤ë¤È¤­¤Ë¸Â¤ê¡¤ Ê£À½¤¬ºîÀ®¤µ¤ì¤Þ¤¹¡¥ ¥Û¥¹¥È·²¤Ï¡¤¥É¥á¥¤¥ó̾¤È¥Û¥¹¥È»ØÄê¥Õ¥¡¥¤¥ë¤Ë¤è¤ê»ØÄê²Äǽ¤Ç¤¹¤¬¡¤ ξÊý¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¤ÏξÊý¤Î¾ò·ï¤òËþ¤¿¤¹¥Û¥¹¥È·²¤¬»ØÄꤵ¤ì¤¿¤³¤È¤Ë¤Ê¤ê¤Þ¤¹¡¥

path ¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Î¾ì¹ç¡¤ ¤½¤Î¥Ç¥£¥ì¥¯¥È¥ê°Ê²¼¤Î¥Õ¥¡¥¤¥ë¤ÎÊ£À½¤òºÆµ¢Åª¤ËºîÀ®¤·¤Þ¤¹¡¥

OPTIONS

-S Ê£À½¸µ¥É¥á¥¤¥ó̾

¥Õ¥¡¥¤¥ëÊ£À½¸µ¤Î¥Û¥¹¥È¤Î¥É¥á¥¤¥ó̾¤ò»ØÄꤷ¤Þ¤¹¡¥

-D Ê£À½Àè¥É¥á¥¤¥ó̾

¥Õ¥¡¥¤¥ëÊ£À½ºîÀ®Àè¤Î¥Û¥¹¥È¤Î¥É¥á¥¤¥ó̾¤ò»ØÄꤷ¤Þ¤¹¡¥

¤³¤Î¥ª¥×¥·¥ç¥ó¤â -H ¥ª¥×¥·¥ç¥ó¤â»ØÄꤷ¤Ê¤¤¾ì¹ç¡¤ ÍøÍѲÄǽ¤ÊÁ´¥Û¥¹¥È·²¤òÂоݤȤ·¤Æ¥Õ¥¡¥¤¥ëÊ£À½¤òºîÀ®¤·¤Þ¤¹¡¥

-h Ê£À½¸µ¥Û¥¹¥È»ØÄê¥Õ¥¡¥¤¥ë

¥Õ¥¡¥¤¥ëÊ£À½¸µ¤Î¥Û¥¹¥È̾¤Î¥ê¥¹¥È¤òµ­½Ò¤·¤¿ ¥Õ¥¡¥¤¥ë̾¤ò»ØÄꤷ¤Þ¤¹¡¥ ¥Û¥¹¥È̾¤Ï¡¤¥Õ¥¡¥¤¥ëÃæ¤Î³Æ¹Ô¤Ë°ì¥Û¥¹¥È¤º¤Äµ­½Ò¤·¤Þ¤¹¡¥

¥Õ¥¡¥¤¥ë̾¤È¤·¤Æ ``-'' ¤ò»ØÄꤷ¤¿¾ì¹ç¡¤É¸½àÆþÎϤ«¤é¥Û¥¹ ¥È̾¤Î¥ê¥¹¥È¤òÆÉ¤ß¹þ¤ß¤Þ¤¹¡¥

-H Ê£À½Àè¥Û¥¹¥È»ØÄê¥Õ¥¡¥¤¥ë

¥Õ¥¡¥¤¥ë¤ÎÊ£À½¤òºîÀ®¤¹¤ë¥Û¥¹¥È̾¤Î¥ê¥¹¥È¤òµ­½Ò¤·¤¿ ¥Õ¥¡¥¤¥ë̾¤ò»ØÄꤷ¤Þ¤¹¡¥ ¥Û¥¹¥È̾¤Ï¡¤¥Õ¥¡¥¤¥ëÃæ¤Î³Æ¹Ô¤Ë°ì¥Û¥¹¥È¤º¤Äµ­½Ò¤·¤Þ¤¹¡¥

¥Õ¥¡¥¤¥ë̾¤È¤·¤Æ ``-'' ¤ò»ØÄꤷ¤¿¾ì¹ç¡¤É¸½àÆþÎϤ«¤é¥Û¥¹ ¥È̾¤Î¥ê¥¹¥È¤òÆÉ¤ß¹þ¤ß¤Þ¤¹¡¥

-N Ê£À½¿ô

ɬÍפÊÊ£À½¤Î¿ô¤ò»ØÄꤷ¤Þ¤¹¡¥ Ê£À½Àè¤Ë¡¤»ØÄꤵ¤ì¤¿¿ô°Ê¾å¤ÎÊ£À½¤¬´û¤Ë¸ºß¤¹¤ë¾ì¹ç¤Ï¡¤ Ê£À½¤ÎºîÀ®¤âºï½ü¤â¹Ô¤¤¤Þ¤»¤ó¡¥

¤³¤Î¥ª¥×¥·¥ç¥ó¤ò¾Êά¤¹¤ë¤È -N 1 ¤È»ØÄꤵ¤ì¤¿¤â¤Î¤È¤ß¤Ê¤µ¤ì¤Þ¤¹¡¥

-j ÊÂÎó¿ô

»ØÄꤵ¤ì¤¿ÊÂÎó¿ô¤Ç¥Õ¥¡¥¤¥ëÊ£À½¤òºîÀ®¤·¤Þ¤¹¡¥ ¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï OpenMP C ¥³¥ó¥Ñ¥¤¥é¤Ç¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤¿¤È¤­¤Ë ¸Â¤êÍ­¸ú¤Ç¤¹¡¥¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¤»ØÄꤵ¤ì¤¿Áí¥Õ¥¡¥¤¥ë¿ô¡¤ Ê£À½¸µ¥Û¥¹¥È¿ô¡¤Ê£À½Àè¥Û¥¹¥È¿ô¤Î¤¦¤Á¤ÎºÇ¾®¤È¤Ê¤ê¤Þ¤¹¡¥

-m

Ê£À½¤Ç¤Ï¤Ê¤¯°Üư¤ò¹Ô¤¤¤Þ¤¹¡¥

-x

Ê£À½Àè¤Ë¡¤»ØÄꤵ¤ì¤¿¿ô°Ê¾å¤ÎÊ£À½¤¬Â¸ºß¤¹¤ë¾ì¹ç¤Ï¡¤ Ê£À½¤ò¾Ãµî¤·¡¤»ØÄꤵ¤ì¤¿¿ô¤Ë¤·¤Þ¤¹¡¥

-n

¥Õ¥¡¥¤¥ëÊ£À½¤¬ºîÀ®¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¤òɽ¼¨¤·¤Þ¤¹¡¥ ¼ÂºÝ¤Ë¤Ï²¿¤â¼Â¹Ô¤µ¤ì¤Þ¤»¤ó¡¥

-q

¥¨¥é¡¼¤Ç¤Ï¤Ê¤¤¥á¥Ã¥»¡¼¥¸¤Î½ÐÎϤò¹Ô¤¤¤Þ¤»¤ó¡¥

-v

Ê£À½½èÍý¤Ë´Ø¤·¤Æ¡¤¾éŤÊɽ¼¨¤ò¹Ô¤¤¤Þ¤¹¡¤

-?

°ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡¥

BUGS

Ê£À½ºîÀ®¸µ¤È¤Ê¤ë¥Û¥¹¥È¤Ï¡¤ ¼ÂºÝ¤Ë¤ÏÊ£À½ºîÀ®¸µ¤È¤·¤Æ»ØÄꤵ¤ì¤¿¥Û¥¹¥È·²¤«¤éÁª¤Ð¤ì¤ë¤È¤Ï¸Â¤ê¤Þ¤»¤ó¡¥

gfarm-2.4.1/doc/html/ja/ref/man1/gfuser.1.html0000644000000000000000000000570211507222721017346 0ustar rootroot gfuser

gfuser

Name

gfuser -- Gfarm ¥æ¡¼¥¶´ÉÍý¥³¥Þ¥ó¥É

Synopsis

gfuser [-P path] [-l] [user...]

gfuser [-P path] -c username realname homedir gsi_dn

gfuser [-P path] -m username realname homedir gsi_dn

gfuser [-P path] -d username

DESCRIPTION

Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë¤ª¤±¤ëÍøÍѥ桼¥¶¤Î´ÉÍý¤ò¹Ô¤¤¤Þ¤¹¡¥ ¥Ç¥Õ¥©¥ë¥È¤Ç¤ÏÅÐÏ¿¥æ¡¼¥¶¤òɽ¼¨¤·¤Þ¤¹¡¥ ¥æ¡¼¥¶Ì¾¤¬»ØÄꤵ¤ì¤¿¤é¡¤»ØÄꤵ¤ì¤¿¥æ¡¼¥¶¤òɽ¼¨¤·¤Þ¤¹¡¥ Gfarm¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î´ÉÍý¼Ô¤Ï¡¤-c¡¤-m¡¤-d ¥ª¥×¥·¥ç¥ó¤ò»ØÄꤹ¤ë¤³¤È¤Ë¤è¤ê¡¤¤½¤ì¤¾¤ì¥æ¡¼¥¶¤ÎÅÐÏ¿¡¤ ÅÐÏ¿¾ðÊóÊѹ¹¡¤ÅÐÏ¿ºï½ü¤ò¹Ô¤¦¤³¤È¤¬¤Ç¤­¤Þ¤¹¡¥

OPTIONS

-P ¥Ñ¥¹Ì¾

¤³¤Î¥³¥Þ¥ó¥É¤¬¥¢¥¯¥»¥¹¤¹¤ë¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤òÆÃÄꤹ¤ë¤¿¤á¤Î ¥Ñ¥¹Ì¾¤Þ¤¿¤Ï Gfarm URL ¤ò»ØÄꤷ¤Þ¤¹¡£ ¾Êά¤·¤¿¾ì¹ç¤Ï¡¢¡Ö/¡×¤ò»ØÄꤷ¤¿¤Î¤ÈƱ¤¸°ÕÌ£¤Ë¤Ê¤ê¤Þ¤¹¡£

-l

ÅÐÏ¿¥æ¡¼¥¶¤Î¾ðÊó¤ò¾ÜºÙ¤Ëɽ¼¨¤·¤Þ¤¹¡¥

-c

¥æ¡¼¥¶¤ÎÅÐÏ¿¤ò¹Ô¤¤¤Þ¤¹¡¥ ÅÐÏ¿¤Ë¤ÏGfarm¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ËÃÖ¤±¤ë¥°¥í¡¼¥Ð¥ë¥æ¡¼¥¶Ì¾¡¤ ¼Â¥æ¡¼¥¶Ì¾¡¤Gfarm¾å¤Î¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê¡¤GSIǧ¾Ú¤Ë¤ª¤±¤ë ¥æ¡¼¥¶¾ÚÌÀ½ñ¤ÎSubject DN¤ò»ØÄꤷ¤Þ¤¹¡¥ ¼Â¥æ¡¼¥¶Ì¾¡¤Subject DN¤Ê¤É¤Ë¶õÇò¤¬´Þ¤Þ¤ì¤ë¾ì¹ç¤Ï¡¤ ¥À¥Ö¥ë¥¯¥ª¡¼¥È¤Ê¤É¤Ç³ç¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡¥ Gfarm¤Î´ÉÍý¼Ô¤¬¼Â¹Ô²Äǽ¤Ç¤¹¡¥

-m

ÅÐÏ¿¥æ¡¼¥¶¤Î¾ðÊó¤ÎÊѹ¹¤ò¹Ô¤¤¤Þ¤¹¡¥ Êѹ¹¤·¤¿¤¤¥°¥í¡¼¥Ð¥ë¥æ¡¼¥¶Ì¾¡¤ ¼Â¥æ¡¼¥¶Ì¾¡¤Gfarm¾å¤Î¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê¡¤GSIǧ¾Ú¤Ë¤ª¤±¤ë ¥æ¡¼¥¶¾ÚÌÀ½ñ¤ÎSubject DN¤ò»ØÄꤷ¤Þ¤¹¡¥ Gfarm¤Î´ÉÍý¼Ô¤¬¼Â¹Ô²Äǽ¤Ç¤¹¡¥

-d

ÅÐÏ¿¥æ¡¼¥¶¤Î¾ðÊó¤ò¾Ãµî¤·¤Þ¤¹¡¥ ¾Ãµî¤·¤¿¤¤¥°¥í¡¼¥Ð¥ë¥æ¡¼¥¶Ì¾¤ò»ØÄꤷ¤Þ¤¹¡¥ Gfarm¤Î´ÉÍý¼Ô¤¬¼Â¹Ô²Äǽ¤Ç¤¹¡¥

-?

°ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡¥

SEE ALSO

gfgroup(1)

gfarm-2.4.1/doc/html/ja/ref/man1/Makefile0000644000000000000000000000052311507222721016462 0ustar rootroot# $Id: Makefile 2373 2006-01-12 00:54:22Z soda $ top_builddir = ../../../../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk htmldir=$(default_htmldir)/ja/ref/man1 DOCBOOK_DIR=$(top_srcdir)/doc/docbook/ja/ref/man1 include $(DOCBOOK_DIR)/Makefile.inc HTMLSRC=$(DOCBOOK) include $(top_srcdir)/makes/html.mk gfarm-2.4.1/doc/html/ja/ref/man1/gfmpirun_p4.1.html0000644000000000000000000000466111507222721020310 0ustar rootroot gfmpirun_p4

gfmpirun_p4

Name

gfmpirun_p4 -- mpirun ¥³¥Þ¥ó¥É¤Î Gfarm ÍÑ¥Õ¥í¥ó¥È¥¨¥ó¥É

Synopsis

gfmpirun_p4 [options] ¥×¥í¥°¥é¥à̾ °ú¿ô...

DESCRIPTION

MPIÊÂÎó¥×¥í¥°¥é¥à¤ò MPICH/p4 ¤ÇÄ󶡤µ¤ì¤ë mpirun ¤òÍøÍѤ·¤Æ¼Â¹Ô ¤·¤Þ¤¹¡¥¼Â¹Ô¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Ï¡¤-G ¥ª¥×¥·¥ç¥ó¡¤-H ¥ª¥×¥·¥ç ¥ó¤¢¤ë¤¤¤Ï -N ¥ª¥×¥·¥ç¥ó¤Ë¤è¤ê·èÄꤵ¤ì¤Þ¤¹¡¥

-G ¥ª¥×¥·¥ç¥ó¡¤-H ¥ª¥×¥·¥ç¥ó¡¤-N ¥ª¥×¥·¥ç¥ó¤ÏƱ»þ¤ËÆó¤Ä°Ê¾å»ØÄꤹ¤ë¤³ ¤È¤Ï¤Ç¤­¤Þ¤»¤ó¡¥¤Þ¤¿¡¤-G ¥ª¥×¥·¥ç¥ó¡¤-H ¥ª¥×¥·¥ç¥ó¡¤-N ¥ª¥×¥·¥ç¥ó¤¬¤¤ ¤º¤ì¤â»ØÄꤵ¤ì¤Ê¤¤¾ì¹ç¤Ï¡¤°ú¿ô¤Ë»ØÄꤵ¤ì¤¿´û¤Ë¸ºß¤¹¤ë Gfarm¥Õ¥¡¥¤¥ë¤Î ¤¦¤Á°ìÈ֤Ϥ¸¤á¤Î¥Õ¥¡¥¤¥ë¤òÍøÍѤ·¤¿¥Õ¥¡¥¤¥ë¡¦¥¢¥Õ¥£¥Ë¥Æ¥£¡¦¥¹¥±¥¸¥å¡¼¥ê ¥ó¥°¤Ë¤è¤ê·èÄꤵ¤ì¤Þ¤¹¡¥

¥×¥í¥°¥é¥à̾¤È¤·¤Æ¤Ï¡¢gfreg ¥³¥Þ¥ó¥É¤ÇÅÐÏ¿¤·¤¿¥×¥í¥°¥é¥à¤Î gfarm-URL ¤â»ØÄê¤Ç¤­¤Þ¤¹¡£

OPTIONS

-G gfarm-URL

gfarm-URL ¤Î¥Õ¥¡¥¤¥ë¡¦¥¢¥Õ¥£¥Ë¥Æ¥£¡¦¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¤Ë¤è¤ê ÊÂÎó¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤·¤Þ¤¹¡¥

-H ¥Û¥¹¥È»ØÄê¥Õ¥¡¥¤¥ë

ÊÂÎó¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É·²¤òµ­ºÜ¤·¤¿¥Õ¥¡¥¤¥ë̾¤ò »ØÄꤷ¤Þ¤¹¡¥ ¥Û¥¹¥È̾¤Ï¡¤³Æ¹Ô¤Ë°ì¥Û¥¹¥È¤º¤Äµ­½Ò¤·¤Þ¤¹¡¥

¥Õ¥¡¥¤¥ë̾¤È¤·¤Æ ``-'' ¤ò»ØÄꤷ¤¿¾ì¹ç¡¤É¸½àÆþÎϤ«¤é¥Û¥¹¥È̾¤Î¥ê¥¹¥È¤ò ÆÉ¤ß¹þ¤ß¤Þ¤¹¡¥

-N ¥Î¡¼¥É¿ô

ÊÂÎó¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Î¥Î¡¼¥É¿ô¤ò»ØÄꤷ¤Þ¤¹¡¥ ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤ÏÉé²Ù¤Î¾®¤µ¤¤¥Î¡¼¥É¤«¤é½ç¤Ë¥Î¡¼¥É¿ôʬÁª¤Ð¤ì¤Þ¤¹¡¥

BUGS

¸½¥Ð¡¼¥¸¥ç¥ó¤Ï¡¢MPICH/p4 ¤È¤ÎÁȹ礻¤Ç¤Ê¤¤¤Èưºî¤·¤Þ¤»¤ó¡£

gfarm-2.4.1/doc/html/ja/ref/man1/gfsched.1.html0000644000000000000000000001130211507222721017447 0ustar rootroot gfsched

gfsched

Name

gfsched -- ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤ò¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¤·¡¢ÍøÍѲÄǽ¤Ê¥Î¡¼¥É¤òɽ¼¨

Synopsis

gfsched -f gfarm-URL [-D ¥É¥á¥¤¥ó̾] [-n ¥Î¡¼¥É¿ô] [-LMclw]

gfsched [-P gfarm-URL] [-D ¥É¥á¥¤¥ó̾] [-n ¥Î¡¼¥É¿ô] [-LMlw]

DESCRIPTION

gfsched ¤Ë -f gfarm-URL ¥ª¥×¥·¥ç¥ó¤ò »ØÄꤷ¤¿¾ì¹ç¡¢¤½¤Îgfarm¥Õ¥¡¥¤¥ë¤òÊÝ»ý¤¹¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Î ¤¦¤Á¤Ç¡¢¸½ºßÍøÍѲÄǽ¤Ê¤â¤Îɽ¼¨¤·¤Þ¤¹¡£

-f¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Ê¤«¤Ã¤¿¾ì¹ç¡¢ÍøÍѲÄǽ¤Ê ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤òɽ¼¨¤·¤Þ¤¹¡£¤³¤Î¾ì¹ç¡¢ -P gfarm-URL ¥ª¥×¥·¥ç¥ó¤Ç ¥Ñ¥¹Ì¾¤« gfarm URL ¤ò»ØÄꤹ¤ë¤³¤È¤Ë¤è¤ê¡¢É½¼¨ÂоݤΥ᥿¥Ç¡¼¥¿¥µ¡¼¥Ð¤ò ÀÚÂØ¤¨¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£

OPTIONS

-D ¥É¥á¥¤¥ó̾

¥É¥á¥¤¥ó̾¤Ê¤¤¤·¥Û¥¹¥È̾¤ò»ØÄꤷ¡¢¸¡º÷ÂоݤΥե¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤ò ¹Ê¤ê¤Þ¤¹¡£

-L

¤½¤Î¥Û¥¹¥È¤ËÂФ·¤Æ¡¢Ç§¾Ú¤¬À®¸ù¤¹¤ë¤«Èݤ«¤Î³Îǧ¤ò¾Êά¤·¤Þ¤¹¡£ ¹â®¤Ë¤Ê¤ê¤Þ¤¹¤¬¡¢Ç§¾ÚÉÔǽ¤Ê¥Û¥¹¥È¤¬¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¤µ¤ì¤Æ¤·¤Þ¤¦ ´í¸±¤¬¤¢¤ê¤Þ¤¹¡£

-M

¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤ËÌ䤤¹ç¤ï¤»¤¿·ë²Ì¤Î¤ß¤òɽ¼¨¤·¡¢¥¯¥é¥¤¥¢¥ó¥È¦¤Ç¤Î ¥¹¥±¥¸¥å¡¼¥ê¥ó¥°½èÍý¤ò¹Ô¤Ê¤¤¤Þ¤»¤ó¡£ ¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»ØÄꤹ¤ë¤È¡¢Æ°ºî¤Ï¹â®¤Ë¤Ê¤ê¤Þ¤¹¤¬¡¢¥Í¥Ã¥È¥ï¡¼¥¯Åª¤ËÅþ ãÉÔǽ¤Ê¥Û¥¹¥È¤ä¡¢Ç§¾ÚÉÔǽ¤Ê¥Û¥¹¥È¤¬É½¼¨¤µ¤ì¤ë´í¸±¤¬¤¢¤ê¤Þ¤¹¡£

-P gfarm-URL

¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤ò´ÉÍý¤¹¤ë¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤òÆÃÄꤹ¤ë ¤¿¤á¤Ë¡¢gfarm-URL ¤Ê¤¤¤·¥Ñ¥¹Ì¾¤ò»ØÄꤷ¤Þ¤¹¡£ ¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢-f ¥ª¥×¥·¥ç¥ó¤ÈÇÓ¾Ū¤Ç¤¹¡£

-f gfarm-URL

»ØÄꤷ¤¿¥Õ¥¡¥¤¥ë¤Ë¤Ä¤¤¤Æ¡¢¤½¤ÎÊ£À½¤òÊÝ»ý¤¹¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤ò ¸¡º÷¤·¤Þ¤¹¡£ ¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢-P ¥ª¥×¥·¥ç¥ó¤ÈÇÓ¾Ū¤Ç¤¹¡£

-c

¥ª¥×¥·¥ç¥ó¡Ö-f¡×¤Ç»ØÄꤷ¤¿¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Ê¤¤ ¾ì¹ç¤Ç¡¢¤«¤Ä¡¢¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤¿¾ì¹ç¡¢¥Õ¥¡¥¤¥ë¤ò¿·µ¬ºîÀ®¤·¤¿ ¾ì¹ç¤Î¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¾ðÊó¤òɽ¼¨¤·¤Þ¤¹¡£

¸½ºß¡¢¤³¤Î¥ª¥×¥·¥ç¥ó¤òÍøÍѤ¹¤ë¤È¡¢»ØÄꤷ¤¿¥Õ¥¡¥¤¥ë¤ò¿·µ¬ºîÀ®¤·¤Þ¤¹¡£ ¤³¤Îµóư¤Ï¾­ÍèÊѹ¹¤µ¤ì¤ë²ÄǽÀ­¤¬¤¢¤ë¤Î¤Ç¤´Ãí°Õ¤¯¤À¤µ¤¤¡£

-l

¥Û¥¹¥È̾¤Î¤ß¤Ê¤é¤º¡¢¥Ý¡¼¥ÈÈÖ¹æ¤âɽ¼¨¤·¤Þ¤¹¡£ ¤³¤Î¥ª¥×¥·¥ç¥ó¤Îɽ¼¨·Á¼°¤Ï¡¢¾­ÍèÊѹ¹¤µ¤ì¤ë²ÄǽÀ­¤¬¤¢¤ê¤Þ¤¹¤Î¤Ç¤´Ãí°Õ¤¯¤À¤µ¤¤¡£

-n ¥Î¡¼¥É¿ô

»ØÄꤷ¤¿¿ô¤ò¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Îɽ¼¨¤ò»î¤ß¤Þ¤¹¡£ ¥Î¡¼¥É¿ô¤¬¤½¤Î¿ô¤ËËþ¤¿¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢¤½¤³¤Çɽ¼¨¤òÂǤÁÀÚ¤ê¤Þ¤¹¡£ ¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Ê¤¤¾ì¹ç¡¢¾ò·ï¤òËþ¤¿¤¹Á´¥Î¡¼¥É¤òɽ¼¨¤·¤Þ¤¹¡£

-w

¥Õ¥¡¥¤¥ë¤Î½ñ¤­¹þ¤ß¤ò¹Ô¤Ê¤¦Á°Äó¤Ç¡¢¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¤ò¹Ô¤Ê¤¤¤Þ¤¹¡£ ¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤¿¾ì¹ç¡¢¥Ç¥£¥¹¥¯¤Î¶õ¤­ÍÆÎ̤¬Â­¤ê¤Ê¤¤¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à ¥Î¡¼¥É¤Ï½ü³°¤µ¤ì¤Þ¤¹¡£

¤³¤Î¥ª¥×¥·¥ç¥ó¤È¡¢-f ¥ª¥×¥·¥ç¥ó¤òƱ»þ¤Ë»ØÄꤷ¡¢ ¤«¤Ä¡¢¤½¤Î¥Õ¥¡¥¤¥ë¤¬´û¸¤Î¥×¥í¥»¥¹¤Ë¤è¤Ã¤Æ½ñ¤­¹þ¤ß¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢ -n ¤Î»ØÄê¤Ë´Ø¤ï¤é¤º¡¢¸½ºß¤³¤Î¥Õ¥¡¥¤¥ë¤Î½ñ¤­¹þ¤ßÍÑ¤Ë ³ä¤êÅö¤Æ¤é¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É 1¤Ä¤Î¤ß¤òɽ¼¨¤·¤Þ¤¹¡£

-?

°ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡£

EXAMPLES

°Ê²¼¤Ï¡¢¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤¬Æ°ºîÃæ¤Ç¤¢¤ë¤ÈÇİ®¤·¤Æ¤¤¤ë¡¢¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤ò Ì䤤¹ç¤ï¤»¤ëÎã¤Ç¤¹¡£

$ gfsched -M

gfarm-2.4.1/doc/html/ja/ref/man1/gfusage.1.html0000644000000000000000000000220611507222721017470 0ustar rootroot gfusage

gfusage

Name

gfusage -- Gfarm ¤Î»ÈÍÑÎ̤òɽ¼¨¤¹¤ë

Synopsis

gfusage [-c]

DESCRIPTION

gfusage ¤Ï¡¢¥æ¡¼¥¶¤´¤È¤Ë Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î»ÈÍÑÎ̤òɽ¼¨¤·¤Þ¤¹¡£

OPTIONS

-c

¥Õ¥¡¥¤¥ëÊ£À½¤ò¹Íθ¤·¤Æ¹ç·×¥µ¥¤¥º¤ò·×»»¤·¤Þ¤¹¡£

SEE ALSO

gfdf(1)

gfarm-2.4.1/doc/html/ja/ref/man1/gfls.1.html0000644000000000000000000000525411507222721017010 0ustar rootroot gfls

gfls

Name

gfls -- Gfarm ¥Ç¥£¥ì¥¯¥È¥ê¤ÎÆâÍÆ¤òɽ¼¨¤¹¤ë¡£

Synopsis

gfls [¥ª¥×¥·¥ç¥ó] [path...]

DESCRIPTION

path ¤Ë»ØÄꤷ¤¿¥Õ¥¡¥¤¥ë¤Ê¤¤¤·¥Ç¥£¥ì¥¯¥È¥ê¤Î̾Á°¤È ´ØÏ¢¤¹¤ë¾ðÊó¤òɽ¼¨¤·¤Þ¤¹¡£

OPTIONS

-a

``.''¤Ç»Ï¤Þ¤ë¥Ñ¥¹Ì¾¤âɽ¼¨¤·¤Þ¤¹¡£

-A

``.''¤È``..''¤Ïɽ¼¨¤·¤Þ¤»¤ó¡£

-C

¥Þ¥ë¥Á¥«¥é¥à½ÐÎϤò¹Ô¤Ê¤¤¤Þ¤¹¡£¤³¤ì¤Ï¥Ç¥Õ¥©¥ë¥È¤Î½ÐÎÏ·Á¼°¤Ç¤¹¡£

-d

¤½¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë°¤¹¤ëÆâÍÆ¤Ç¤Ï¤Ê¤¯¡¢¥Ç¥£¥ì¥¯¥È¥ê¼«¿È¤òɽ¼¨¤·¤Þ¤¹¡£

-E Éÿô

°À­¥­¥ã¥Ã¥·¥å¤òÊÝ»ý¤¹¤ëÉÿô¤ò»ØÄꤷ¤Þ¤¹¡£ 0 ¤ò»ØÄꤷ¤¿¾ì¹ç¡¢Â°À­¤ò¥­¥ã¥Ã¥·¥å¤·¤Þ¤»¤ó¡£

-F

̾¾Î¤Îľ¸å¤Ë¡¢¤½¤Î¼ïÎà¤òɽ¤¹Ê¸»ú (*/=@| ¤Î¤¤¤º¤ì¤«) ¤òɽ¼¨¤·¤Þ¤¹¡£

-i

inode ÈÖ¹æ¤âɽ¼¨¤·¤Þ¤¹¡£

-l

¥Õ¥¡¥¤¥ë¤Î¥µ¥¤¥º¡¢½êÍ­¼Ô¡¢¥°¥ë¡¼¥×¡¢¹¹¿·»þ¹ï¤Ê¤É¤Î°À­¾ðÊó¤â ɽ¼¨¤·¤Þ¤¹¡£

-r

µÕ½ç¤ËÀ°Îó¤·¤ÆÉ½¼¨¤·¤Þ¤¹¡£

-R

¥Ç¥£¥ì¥¯¥È¥ê¤ÎÆâÍÆ¤òºÆµ¢Åª¤Ëɽ¼¨¤·¤Þ¤¹¡£

-S

¥Õ¥¡¥¤¥ë¥µ¥¤¥º¤ÇÀ°Îó¤·¤Þ¤¹¡£

-t

¥Õ¥¡¥¤¥ë̾¤Ç¤Ï¤Ê¤¯¡¢¥Õ¥¡¥¤¥ë¤Î»þ¹ï¤ò´ð½à¤ËÀ°Îó¤·¤Þ¤¹¡£

-T

-l ¥ª¥×¥·¥ç¥ó¤ÈƱ»þ¤Ë»ØÄꤹ¤ë¤È¡¢»þ¹ï¤ò´°Á´¤Ê·Á¼°¤Çɽ¼¨¤·¤Þ¤¹¡£

-1

1¹Ô¤Ë1¥¨¥ó¥È¥ê¤º¤Äɽ¼¨¤·¤Þ¤¹¡£

-?

°ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡£

gfarm-2.4.1/doc/html/ja/ref/man1/gfmkdir.1.html0000644000000000000000000000256711507222721017504 0ustar rootroot gfmkdir

gfmkdir

Name

gfmkdir -- Gfarm ¥Ç¥£¥ì¥¯¥È¥ê¤òºîÀ®¤¹¤ë¡£

Synopsis

gfmkdir [¥ª¥×¥·¥ç¥ó] gfarm¥Ñ¥¹...

DESCRIPTION

Gfarm¥Ñ¥¹¤Ë»ØÄꤷ¤¿¥Ç¥£¥ì¥¯¥È¥ê¤òºîÀ®¤·¤Þ¤¹¡£

OPTIONS

-p

»ØÄꤷ¤¿¥Ç¥£¥ì¥¯¥È¥ê¤¬Â¸ºß¤·¤Æ¤â¥¨¥é¡¼¤Ë¤·¤Þ¤»¤ó¡£ ɬÍפ˱þ¤¸¤Æ¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤òºîÀ®¤·¤Þ¤¹¡£

-?

°ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡£

SEE ALSO

gfrmdir(1)

gfarm-2.4.1/doc/html/ja/ref/man1/gfwhere.1.html0000644000000000000000000000242711507222721017503 0ustar rootroot gfwhere

gfwhere

Name

gfwhere -- Gfarm ¥Õ¥¡¥¤¥ë¤Î¥ì¥×¥ê¥«¤Î½êºß¤òɽ¼¨¤¹¤ë¡£

Synopsis

gfwhere [-r, -R] path...

DESCRIPTION

»ØÄꤷ¤¿¥Õ¥¡¥¤¥ë¤Ë¤Ä¤¤¤Æ¡¢¥ì¥×¥ê¥«¤Î½êºß¤òɽ¼¨¤·¤Þ¤¹¡£ -r ¤¢¤ë¤¤¤Ï -R ¥ª¥×¥·¥ç¥ó¤òÉÕ¤±¤ë¤È¡¢ »ØÄꤵ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¤Ë´Þ¤Þ¤ì¤ë¥Õ¥¡¥¤¥ë¤Î¥ì¥×¥ê¥«¤Î½êºß¤ò ºÆµ¢Åª¤Ëɽ¼¨¤·¤Þ¤¹¡£

OPTIONS

-r, -R

¥Ç¥£¥ì¥¯¥È¥ê¤Ë´Þ¤Þ¤ì¤ë¥Õ¥¡¥¤¥ë¤Î¥ì¥×¥ê¥«¤Î½êºß¤ò ºÆµ¢Åª¤Ëɽ¼¨¤·¤Þ¤¹¡£

-?

°ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡£

gfarm-2.4.1/doc/html/ja/ref/man1/gfchgrp.1.html0000644000000000000000000000207211507222721017470 0ustar rootroot gfchgrp

gfchgrp

Name

gfchgrp -- Gfarm ¥Õ¥¡¥¤¥ë¤Î½êÍ­¥°¥ë¡¼¥×¤òÊѹ¹¤¹¤ë

Synopsis

gfchgrp [options] group [path...]

DESCRIPTION

Gfarm ¥Õ¥¡¥¤¥ë¤Î½êÍ­¥°¥ë¡¼¥×¤òÊѹ¹¤·¤Þ¤¹¡¥

OPTIONS

-?

°ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡¥

gfarm-2.4.1/doc/html/ja/ref/man1/gfimport_text.1.html0000644000000000000000000001002411507222721020737 0ustar rootroot gfimport_text

gfimport_text

Name

gfimport_text -- ¥Æ¥­¥¹¥È¡¦¥Õ¥¡¥¤¥ë¤ò¥Õ¥é¥°¥á¥ó¥È¤Ëʬ¤±¤Æ¼è¤ê¹þ¤à

Synopsis

gfimport_text [¥ª¥×¥·¥ç¥ó] ÆþÎÏ¥Õ¥¡¥¤¥ë

DESCRIPTION

°ú¿ô¤Ë»ØÄꤷ¤¿¥Æ¥­¥¹¥È¡¦¥Õ¥¡¥¤¥ë¤ò¡¢°ì¹Ô¤òÊ£¿ô¤Î¥Õ¥é¥°¥á¥ó¥È¤Ëʬ³ä¤¹ ¤ë¤³¤È¤Î¤Ê¤¤¤è¤¦¤Ëʬ³ä¤·¤Æ Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë¼è¤ê¹þ¤à ¥µ¥ó¥×¥ë¡¦¥×¥í¥°¥é¥à¤Ç¤¹¡£

OPTIONS

-H ¥Û¥¹¥È»ØÄê¥Õ¥¡¥¤¥ë

¥Õ¥é¥°¥á¥ó¥È¤òÇÛÃÖ¤¹¤ë¥Û¥¹¥È̾¤Î¥ê¥¹¥È¤òµ­ºÜ¤·¤¿¥Õ¥¡¥¤¥ë̾¤ò»ØÄꤷ¤Þ¤¹¡£ ¥Û¥¹¥È̾¤Ï¡¢³Æ¹Ô¤Ë°ì¥Û¥¹¥È¤º¤Äµ­½Ò¤·¤Þ¤¹¡£ ÆþÎÏ¥Õ¥¡¥¤¥ë¤Ï¤½¤ì¤¾¤ì¤Î¥Õ¥é¥°¥á¥ó¥È¥µ¥¤¥º¤¬¤Û¤Ü¶ÑÅù¤È¤Ê¤ë¤è¤¦¤Ë ʬ³ä¤µ¤ì¤Þ¤¹¡£

¥Õ¥¡¥¤¥ë̾¤È¤·¤Æ ``-'' ¤ò»ØÄꤷ¤¿¾ì¹ç¡¢É¸½àÆþÎϤ«¤é¥Û¥¹¥È̾¤Î¥ê¥¹¥È¤ò ÆÉ¤ß¹þ¤ß¤Þ¤¹¡£

-f ¥Õ¥é¥°¥á¥ó¥È¹½À®¥Õ¥¡¥¤¥ë

³Æ¥Õ¥é¥°¥á¥ó¥È¤Î¤ª¤ª¤è¤½¤Î¥µ¥¤¥º¤È¡¢ÇÛÃÖ¤¹¤ë¥Û¥¹¥È¤òµ­ºÜ¤·¤¿¥Õ¥¡¥¤ ¥ë̾¤ò»ØÄꤷ¤Þ¤¹¡£

¹½À®¥Õ¥¡¥¤¥ë¤Ï¡¢³Æ¹Ô¤¬¡¢¶õÇò¤Ç¶èÀÚ¤é¤ì¤¿¥µ¥¤¥º¤È¥Û¥¹¥È̾¤«¤é¤Ê¤ë·Á¼°¤Ç¤¹¡£

¥Õ¥¡¥¤¥ë̾¤È¤·¤Æ ``-'' ¤ò»ØÄꤷ¤¿¾ì¹ç¡¢É¸½àÆþÎϤ«¤é¥Õ¥é¥°¥á¥ó¥È¹½À®¤ò ÆÉ¤ß¹þ¤ß¤Þ¤¹¡£

-o gfarm-URL

½ÐÎÏ Gfarm ¥Õ¥¡¥¤¥ë¤Î URL ¤ò»ØÄꤷ¤Þ¤¹¡£

-?

°ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡£

EXAMPLES

Example 1. »ØÄꤷ¤¿¸Ä¿ô¤Ëʬ³ä¤·¤Æ¼è¤ê¹þ¤à

°Ê²¼¤Ï¡¢¥Õ¥¡¥¤¥ë¤ò8¸Ä¤Î¥Õ¥é¥°¥á¥ó¥È¤Ëʬ³ä¤·¡¢ ¥Õ¥¡¥¤¥ë gfarm:file ¤È¤·¤Æ¼è¤ê¹þ¤àÎã¤Ç¤¹¡£
gfsched -N 8 | gfimport_text -H - -o gfarm:file source_file

Example 2. ½èÍý¤¹¤ë¥×¥í¥°¥é¥à¤ò»ØÄꤷ¡¢ÆÃÄê¤Î¸Ä¿ô¤Ëʬ³ä¤·¤Æ¼è¤ê¹þ¤à

°Ê²¼¤Ï¡¢¥Õ¥¡¥¤¥ë¤ò8¸Ä¤Î¥Õ¥é¥°¥á¥ó¥È¤Ëʬ³ä¤·¡¢ »ØÄꤷ¤¿¥×¥í¥°¥é¥à gfarm:prog ¤ò¼Â¹Ô²Äǽ¤Ê¥Û¥¹¥È¤Ë¡¢ ¥Õ¥¡¥¤¥ë gfarm:file ¤È¤·¤Æ¼è¤ê¹þ¤àÎã¤Ç¤¹¡£
gfsched -N 8 -p gfarm:prog | gfimport_text -H - -o gfarm:file source_file

Example 3. ´û¸¤Î gfarm ¥Õ¥¡¥¤¥ë¤ÈƱ¤¸ÇÛÃ֤Ǽè¤ê¹þ¤à

°Ê²¼¤Ï¡¢´û¸¤Î gfarm ¥Õ¥¡¥¤¥ë gfarm:template ¤È Ʊ¤¸¸Ä¿ô¤Î¥Õ¥é¥°¥á¥ó¥È¤Ëʬ³ä¤·¡¢ gfarm:template ¤¬Â¸ºß¤¹¤ë¤Î¤ÈƱ¤¸¥Û¥¹¥È¤Ë¡¢ ¥Õ¥¡¥¤¥ë gfarm:file ¤È¤·¤Æ¼è¤ê¹þ¤àÎã¤Ç¤¹¡£
gfsched gfarm:template | gfimport_text -H - -o gfarm:file source_file

SEE ALSO

gfimport_fixed(1), gfsched(1), gfarm.conf(5)

gfarm-2.4.1/doc/html/ja/ref/man1/gfln.1.html0000644000000000000000000000237311507222721017002 0ustar rootroot gfln

gfln

Name

gfln -- ¥Ï¡¼¥É¥ê¥ó¥¯¡¤¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤òºîÀ®¤¹¤ë

Synopsis

gfln [options] target link_name

DESCRIPTION

target¤ËÂФ¹¤ë¥Ï¡¼¥É¥ê¥ó¥¯¤ò link_name¤ËºîÀ®¤·¤Þ¤¹¡¥ -s ¥ª¥×¥·¥ç¥ó¤¬»ØÄꤵ¤ì¤ë¤È¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤òºîÀ®¤·¤Þ¤¹¡¥

OPTIONS

-s

¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤òºîÀ®¤·¤Þ¤¹¡¥

-?

°ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡¥

gfarm-2.4.1/doc/html/ja/ref/man1/gfsetdir.1.html0000644000000000000000000000452711507222721017666 0ustar rootroot gfsetdir

gfsetdir

Name

gfsetdir -- Gfarm ºî¶È¥Ç¥£¥ì¥¯¥È¥ê¤òÊѹ¹¤¹¤ë¥³¥Þ¥ó¥ÉÎó¤ò½ÐÎϤ¹¤ë¡£

Synopsis

gfsetdir [-s | -c] [¥Ç¥£¥ì¥¯¥È¥ê]

DESCRIPTION

Gfarm ºî¶È¥Ç¥£¥ì¥¯¥È¥ê¤ò »ØÄꤷ¤¿¥Ç¥£¥ì¥¯¥È¥ê¤ËÊѹ¹¤¹¤ë¥·¥§¥ë¥³ ¥Þ¥ó¥É¤òɸ½à½ÐÎϤ˽ÐÎϤ·¤Þ¤¹¡£¥Ç¥£¥ì¥¯¥È¥ê¤ò»ØÄꤷ¤Ê¤¤¾ì¹ç¤Ï¡¢¥æ¡¼¥¶¤Î Gfarm ¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤¢¤ë gfarm:/¥°¥í¡¼¥Ð¥ë¥æ¡¼¥¶ ¤ËÊѹ¹¤¹¤ë ¥³¥Þ¥ó¥É¤ò½ÐÎϤ·¤Þ¤¹¡£

¥æ¡¼¥¶¤¬»ÈÍѤ·¤Æ¤¤¤ë¥·¥§¥ë¤ò¼«Æ°Åª¤ËȽÄꤷ¤Æ¤½¤Î¥·¥§¥ë¤¬¼Â¹Ô²Äǽ¤Ê ¥³¥Þ¥ó¥É¤ò½ÐÎϤ·¤Þ¤¹¡£

½ÐÎÏ¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤·¤Æ Gfarm ºî¶È¥Ç¥£¥ì¥¯¥È¥ê¤òÊѹ¹¤¹¤ë gfcd ¤òÍøÍѤ¹¤ë¤¿¤á¤Ë¡¢³Æ¥æ¡¼¥¶¤Î¥·¥§¥ëÀßÄê¥Õ¥¡¥¤¥ë¤Ë°Ê²¼¤ÎÄêµÁ¤òÄɲä·¤Æ ¤¯¤À¤µ¤¤¡£

Bourne shell ·Ï¥·¥§¥ë¤Î¾ì¹ç
gfcd() { eval "`gfsetdir $1`"; }
csh ·Ï¥·¥§¥ë¤Î¾ì¹ç
alias gfcd 'eval `gfsetdir \!*`'

OPTIONS

-s

Bourne shell ·Ï¥·¥§¥ëÍѤΥ³¥Þ¥ó¥É¤ò½ÐÎϤ·¤Þ¤¹¡£

-c

csh ·Ï¥·¥§¥ëÍѤΥ³¥Þ¥ó¥É¤ò½ÐÎϤ·¤Þ¤¹¡£

-?

°ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡£

SEE ALSO

gfcd(1), gfpwd(1)

gfarm-2.4.1/doc/html/ja/ref/man1/gfrcmd.1.html0000644000000000000000000000630011507222721017310 0ustar rootroot gfrcmd

gfrcmd

Name

gfrcmd(1) -- Gfarm ·×»»¥×¡¼¥ë¤Î¥Û¥¹¥È¤Ç¡¢¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤¹¤ë¡£

Synopsis

gfrcmd ¥Û¥¹¥È̾ ¥³¥Þ¥ó¥É...

DESCRIPTION

Âè°ì°ú¿ô¤Ë»ØÄꤷ¤¿·×»»¥×¡¼¥ë¤Î¥Û¥¹¥È¤Ç¡¢ÂèÆó°ú¿ô°Ê¹ß¤Î¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤·¤Þ¤¹¡£ UNIX ɸ½à¤Î rsh ¤Ë»÷¤¿µ¡Ç½¤ò»ý¤Á¤Þ¤¹¤¬¡¢²¼µ­¤ÎÅÀ¤¬°Û¤Ê¤ê¤Þ¤¹¡£

¥µ¡¼¥Ð¡¼¤Ï¡¢inetd ¤«¤éµ¯Æ°¤¹¤ë¤Î¤Ç¤Ï¤Ê¤¯¡¢gfsd ¤ËÁȤ߹þ¤Þ¤ì¤Æ¤¤¤ë¡£

gfarm ¤Îǧ¾Úµ¡¹½¤òÍѤ¤¤ë¡£rsh ¤Î¤è¤¦¤ËTCP¤ÎÆÃ¸¢¥Ý¡¼¥È¤òǧ¾Ú¤Ë ÍѤ¤¤ë¤³¤È¤Ï¤Ê¤¤¤Î¤Ç¡¢Æ±»þ¼Â¹Ô²Äǽ¤Ê¥³¥Þ¥ó¥É¿ô¤¬¡¢ÆÃ¸¢¥Ý¡¼¥È¤Î¿ô¤Ë À©Ì󤵤ì¤Ê¤¤¡£

rsh ¤È°Û¤Ê¤ê¡£Ã±°ì¤ÎTCP¥³¥Í¥¯¥·¥ç¥ó¾å¤Çưºî¤¹¤ë¤Î¤Ç¡¢Æ±»þ¤Ë ¿¿ôµ¯Æ°¤·¤¿¾ì¹ç¤Î¡¢¥«¡¼¥Í¥ë¤Ø¤ÎÉé²Ù¤¬¼ã´³·Ú¤¤¡£

´Ä¶­ÊÑ¿ôDISPLAY¤òÅÁ¤¨¤ë¤³¤È¤¬¤Ç¤­¤ë¡£¤Þ¤¿¡¢¤³¤Î»þ X Window System ¤Îǧ¾Ú¾ðÊó¤âÅϤ¹¤³¤È¤¬½ÐÍè¤ë¡£

±ó³Ö¥Û¥¹¥È¤Ë¤ª¤±¤ë¥«¥ì¥ó¥È¡¦¥Ç¥£¥ì¥¯¥È¥ê¤Ï¡¢NFS¤Ç¶¦Í­¤µ¤ì¤Æ¤¤ ¤ë¤³¤È¤Î¿¤¤¥Û¡¼¥à¡¦¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ï¤Ê¤¯¡¢gfarm¤Î¥¹¥×¡¼¥ë¡¦¥Ç¥£¥ì ¥¯¥È¥ê¤Ë¤Ê¤ë¤Î¤Ç¡¢¥Ç¥Ð¥Ã¥°»þ¤Ë¡¢¥Û¥¹¥ÈËè¤Ëcore¥Õ¥¡¥¤¥ë¤ò»Ä¤¹¤³¤È¤¬ ÍÆ°×¡£

gfarm¥é¥¤¥Ö¥é¥ê¤È¶¨Ä´¤·¤Æ¡¢¥³¥Þ¥ó¥É¤¬Ã×̿Ū¤Ê¥·¥°¥Ê¥ë¤òȯÀ¸¤µ ¤»¤¿¾ì¹ç¤Ë¥Ç¥Ð¥Ã¥¬¤ò¸Æ¤Ó½Ð¤¹µ¡Ç½¤òÈ÷¤¨¤ë¡£

OPTIONS

-l ¥æ¡¼¥¶¡¼Ì¾

±ó³Ö¥Û¥¹¥È¤Ç¤Î¥æ¡¼¥¶¡¼Ì¾¤ò»ØÄꤷ¤Þ¤¹¡£

-n

ɸ½àÆþÎÏ¤ÎÆâÍÆ¤ò¡¢±ó³Ö¥Û¥¹¥È¤ËÁ÷¤é¤Ê¤¯¤·¤Þ¤¹¡£

-r

±ó³Ö¥Û¥¹¥È¤Î¥í¥°¥¤¥ó¥·¥§¥ë¤òÍøÍѤ·¤Ê¤¤¤Ç¡¤ »ØÄꤵ¤ì¤¿¥³¥Þ¥ó¥É¤òľÀܼ¹Ԥ·¤Þ¤¹¡£

-y

´Ä¶­ÊÑ¿ôDISPLAY¤ò±ó³Ö¥Û¥¹¥È¤ËÅÁ¤¨¤Þ¤¹¡£

-X

´Ä¶­ÊÑ¿ô X Window System ¤Îǧ¾Ú¾ðÊó¤ò¡¢±ó³Ö¥Û¥¹¥È¤ËÅÁ¤¨¤Þ¤¹¡£ ¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê¤ò¶¦Í­¤·¤Æ¤¤¤Ê¤¤¤è¤¦¤Ê¾ì¹ç¤ËÍ­ÍѤǤ¹¡£

-v

¾ÜºÙ¤Ë¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤òɽ¼¨¤·¤Þ¤¹¡¥

-?

°ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡£

ENVIRONMENT

GFARM_DEBUG_MODE

¤³¤Î´Ä¶­ÊÑ¿ô¤ËÃÍ gdb ¤òÀßÄꤹ¤ë¤È¡¢±ó³Ö¥Û¥¹¥È¤Î¥³¥Þ¥ó¥É¤¬ ¥·¥°¥Ê¥ë¤Ç½ªÎ»¤¹¤ëºÝ¤Ë¡¢xterm ¤ª¤è¤Ó ¤½¤Î¾å¤Çưºî¤¹¤ë GNU debugger gdb ¤ò¡¢¥³¥Þ¥ó¥É¤Ë´ØÏ¢¤Å¤±¤¿¾õÂ֤ǡ¢µ¯Æ°¤·¤Þ¤¹¡£

¤³¤Îµ¡Ç½¤òÍøÍѤ¹¤ë¤Ë¤Ï¡¢X Window System ²¼¤Ç gfrcmd ¤òÍøÍѤ¹¤ëɬÍ× ¤¬¤¢¤ê¤Þ¤¹¡£

BUGS

-l ¥ª¥×¥·¥ç¥ó¤Ï¤Þ¤À¼ÂÁõ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£

gfarm-2.4.1/doc/html/ja/ref/man1/gfexec.1.html0000644000000000000000000000333011507222721017307 0ustar rootroot gfexec

gfexec

Name

gfexec -- Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ë

Synopsis

gfexec [-N ¥Î¡¼¥ÉÁí¿ô] [-I ¥Î¡¼¥ÉÈÖ¹æ] [-s] ¥×¥í¥°¥é¥à̾ [°ú¿ô...]

DESCRIPTION

Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤·¤Þ¤¹¡¥ËÜ¥³¥Þ¥ó¥É¤Ï¥Õ¥¡ ¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¾å¤Ç¼Â¹Ô¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡¥

OPTIONS

-N ¥Î¡¼¥É¿ô

¸Æ¤Ó½Ð¤¹¥×¥í¥°¥é¥à¤Î¥Î¡¼¥ÉÁí¿ô¤òÊѹ¹¤·¤Þ¤¹¡¥

-I ¥Î¡¼¥ÉÈÖ¹æ

¸Æ¤Ó½Ð¤¹¥×¥í¥°¥é¥à¤Î¥Î¡¼¥ÉÈÖ¹æ¤òÊѹ¹¤·¤Þ¤¹¡¥

-s

¡Ö-N 1 -I 0¡×¤È»ØÄꤷ¤¿¤Î¤ÈÅù²Á¤Ç¤¹¡¥

-?

°ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡¥

gfarm-2.4.1/doc/html/ja/ref/man1/gfpwd.1.html0000644000000000000000000000173011507222721017157 0ustar rootroot gfpwd

gfpwd

Name

gfpwd -- ¸½ºß¤Î Gfarm ºî¶È¥Ç¥£¥ì¥¯¥È¥ê̾¤òɽ¼¨¤¹¤ë¡£

Synopsis

gfpwd

DESCRIPTION

¸½ºß¤Î Gfarm ºî¶È¥Ç¥£¥ì¥¯¥È¥ê¤Î Gfarm-URL ¤òɽ¼¨¤·¤Þ¤¹¡£

SEE ALSO

gfcd(1), gfsetdir(1)

gfarm-2.4.1/doc/html/ja/ref/man1/gfwhoami.1.html0000644000000000000000000000216011507222721017647 0ustar rootroot gfwhoami

gfwhoami

Name

gfwhoami -- Gfarm ¥°¥í¡¼¥Ð¥ë¥æ¡¼¥¶Ì¾¤òɽ¼¨¤·¤Þ¤¹

Synopsis

gfwhoami [¥ª¥×¥·¥ç¥ó]

DESCRIPTION

Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¾å¤ÇÍѤ¤¤é¤ì¤ë¥°¥í¡¼¥Ð¥ë¥æ¡¼¥¶Ì¾¤ò ɽ¼¨¤·¤Þ¤¹¡£

OPTIONS

-v

GSI ǧ¾Ú¤òÍѤ¤¤Æ¤¤¤ë¾ì¹ç¡¢ÍøÍѼԤΠSubject DN ¤âɽ¼¨¤·¤Þ¤¹¡£

-h

°ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡£

gfarm-2.4.1/doc/html/ja/user/0000755000000000000000000000000011507222730014370 5ustar rootrootgfarm-2.4.1/doc/html/ja/user/samba-gfarmfs.html0000644000000000000000000002472011507222722017772 0ustar rootroot Grid Datafarm: Samba [Japanese] [GFARM LOGO] ʸ½ñ½¸ > ¥æ¡¼¥¶¡¼¥º¥Þ¥Ë¥å¥¢¥ë > samba

Windows¤Ç¥Þ¥¦¥ó¥È

English | ÆüËܸì

1. ³µÍ×

gfarm2fs ¤ò»È¤Ã¤Æ Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ò¥Þ¥¦¥ó¥È¤·¡¤¤½¤Î¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤ò Samba ¤Ç¸ø³«¤¹¤ë¤³¤È¤Ç¡¤Windows ¤«¤é Gfarm ¤Î¥Õ¥¡¥¤¥ë¤Ë¥¢¥¯¥»¥¹¤Ç¤­¤Þ¤¹¡¥

ɬÍפʴĶ­¤äÀßÄê

  • Samba ¥µ¡¼¥Ð¥Þ¥·¥ó¦
    • Gfarm ¤Î¥¯¥é¥¤¥¢¥ó¥È¤¬ÍøÍѤǤ­¤ë¡¥ÍøÍѤ·¤è¤¦¤È»×¤Ã¤Æ¤¤¤ë Gfarm ¤Î´Ä¶­¤Ë¥¢¥¯¥»¥¹¤Ç¤­¤ë¡¥
    • ǧ¾ÚÊýË¡¤Ï¡¤sharedsecret ǧ¾Ú¤ò»ÈÍѤ·¡¤Gfarm ¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Î¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê¤¬¶¦Í­¤µ¤ì¤Æ¤¤¤ë¤³¤È¤ò¿ä¾©¤¹¤ë¡¥¤½¤¦¤Ç¤Ê¤¤¾ì¹ç¤Ï¡¤»ÈÍѤ¹¤ëÁ°¤Ë ~/.gfarm_shared_key ¤ò³Æ¥Î¡¼¥É¤ËÇÛÉÛ¤¹¤ë¤«¡¤grid-proxy-init ¤ò¼Â¹Ô¤·¤Æ¤ª¤«¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡¥
    • FUSE ¤¬¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Æ¤¤¤ë¡¥(= Linux ¥«¡¼¥Í¥ë 2.4 or 2.6 ´Ä¶­)
    • °ìÈ̥桼¥¶¤¬ FUSE ¤Ç¥Þ¥¦¥ó¥È¤·¤¿¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤Ë¡¤Â¾¤Î¥æ¡¼¥¶¤¬¥¢¥¯¥»¥¹¤¹¤ë¤³¤È¤òµö²Ä¤µ¤ì¤Æ¤¤¤ë¡¥(user_allow_other ÀßÄê)
    • gfarm2fs ¤¬¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Æ¤¤¤Æ¡¤¼Â¹Ô¤Ç¤­¤ë¡¥
    • °ìÈ̥桼¥¶¤¬ FUSE ¤Ç¥Þ¥¦¥ó¥È¤·¤¿(¤¹¤ëͽÄê¤Î)¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤Ë Samba ·Ðͳ¤Ç¥¢¥¯¥»¥¹¤Ç¤­¤ë¤è¤¦¤Ê Samba ¤ÎÀßÄê¤Ë¤·¤ÆÆ°¤«¤¹¤³¤È¤¬¤Ç¤­¤ë¡¥
    • ¤³¤Î Samba ¥µ¡¼¥Ð¤Î¥Þ¥·¥ó¾å¤Ç Gfarm ¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Ç¡¼¥â¥ó(gfsd)¤òư¤«¤·¤Æ¤¤¤Ê¤¤¤³¤È¤ò¿ä¾©¤¹¤ë¡¥gfsd ¤òư¤«¤·¤Æ¤¤¤ë¤È¡¤Samba ¥µ¡¼¥Ð¤Î Gfarm ¥¹¥×¡¼¥ë¤¬°ìÇդˤʤë¤Þ¤Ç Samba ¥µ¡¼¥Ð¤Ë¤·¤«¥Õ¥¡¥¤¥ë¤¬ºîÀ®¤µ¤ì¤Ê¤¤¡¥
  • Windows ¥Þ¥·¥ó¦
    • ¾åµ­ Samba ¤Î¥µ¡¼¥Ó¥¹¤Ë¥¢¥¯¥»¥¹¤¬¤Ç¤­¤ë¡¥
´ØÏ¢¥½¥Õ¥È¥¦¥¨¥¢°ìÍ÷

2. ÆüËܸì¥Õ¥¡¥¤¥ë̾¤ò°·¤¦¾ì¹ç

Samba ¤Ç UTF-8 ¤Î¥Õ¥¡¥¤¥ë̾¤ò°·¤¨¤ë¤è¤¦¤Ë¤·¤Þ¤¹¡¥ smb.conf ¤Ë¥Õ¥¡¥¤¥ë̾¤Ë´Ø¤¹¤ëÀßÄê¤ò¤·¤Þ¤¹¡¥ Linux ¦¤Ç¤Ï¥Õ¥¡¥¤¥ë̾¤Îʸ»ú¥³¡¼¥É¤È¤·¤Æ UTF-8 ¤ò»È¤¦¤è¤¦¤Ë¤·¡¤¤½¤ì¤ò Windows ¤«¤é¸«¤¨¤ë¤è¤¦¤ËÀßÄꤷ¤Þ¤¹¡¥

[global] ¤ÎÉôʬ¤Ëµ­½Ò¤·¤Þ¤¹¡¥ Samba ¤ÎÀßÄê¤Ï SWAT ¤ò»È¤¦¤È´Êñ¤Ë¤Ç¤­¤Þ¤¹¡¥

Samba 2·Ï¤Î¾ì¹ç
client code page =  932
coding system = utf8

Samba 3·Ï¤Î¾ì¹ç
dos charset = CP932
unix charset = UTF-8
display charset = UTF-8

3. Samba ¤ÎÀßÄê

¤Þ¤º¡¤¸ø³«¤¹¤ë¥Ç¥£¥ì¥¯¥È¥ê¤òÀßÄê¤ò¤·¤Þ¤¹¡¥ ¤½¤Î¤¿¤á¤Ë¡¤[homes] ¤ä [¥»¥¯¥·¥ç¥ó̾] ¤ò smb.conf ¤ËÀßÄꤷ¤Þ¤¹¡¥ gfarm2fs ¤ò»È¤Ã¤Æ¥Þ¥¦¥ó¥È¤¹¤ëͽÄê¤Î¥Ñ¥¹¡¤¤Þ¤¿¤Ï¤½¤ì¤è¤ê¾å¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Î¥Ñ¥¹¤ò»ØÄꤷ¤Þ¤¹¡¥ ¤³¤ì¤é¤Ï SWAT ¤ò»È¤¦¤È´Êñ¤ËÀßÄê¤Ç¤­¤Þ¤¹¡¥
¤½¤·¤Æ gfarm2fs ¤Ë¥¢¥¯¥»¥¹¤¹¤ë¥»¥¯¥·¥ç¥ó¤Ë¤Ï¡¤¥Õ¥¡¥¤¥ë¤ò½ñ¤­¹þ¤á¤ë¤è¤¦¤Ë¤·¡¤¥Õ¥¡¥¤¥ë¿·µ¬ºîÀ®»þ¤Ë¡¤¼Â¹Ô¥Ó¥Ã¥È¤¬ÉÕ¤«¤Ê¤¤¤è¤¦¤Ë¤·¤Þ¤¹¡¥

Îã
[Gfarm]
path = /tmp/gfarm/%u
create mask = 0644
read only = no
¤³¤ì¤Ç¡¤ /tmp/gfarm ¤Î²¼¤Ë³Æ¥æ¡¼¥¶¤¬¥æ¡¼¥¶Ì¾¤Î¥Ç¥£¥ì¥¯¥È¥ê¤òºî¤Ã¤Æ gfarm2fs ¤Ç¥Þ¥¦¥ó¥È¤·¤Æ¤ª¤±¤Ð¡¤Gfarm ¤È¤¤¤¦¶¦Í­Ì¾¤Ç¥¢¥¯¥»¥¹¤Ç¤­¤Þ¤¹¡¥

¼¡¤Ë¡¤Gfarm ¤ò¼Â¹Ô¤¹¤ë UNIX ¥æ¡¼¥¶Ì¾¤ÈÂбþ¤¹¤ë Samba ¤Ç¤Î¥æ¡¼¥¶¤òºîÀ®¤·¤Þ¤¹¡¥
¤¿¤È¤¨¤Ð¡¤SWAT ¤Ç¹Ô¤¦¾ì¹ç¤Ï¡¤¡ÖPASSWORD¢ª¥í¡¼¥«¥ë¥Þ¥·¥ó¤Î¥Ñ¥¹¥ï¡¼¥É´ÉÍý¢ª¿·µ¬¥æ¡¼¥¶Äɲáפǥ桼¥¶¤òÄɲäǤ­¤Þ¤¹¡¥

¤½¤Î¾ Samba ¤ÎÀßÄê¤Ë´Ø¤¹¤ë¾ÜºÙ¤Ï¡¤Samba ¤Î¥É¥­¥å¥á¥ó¥È¤ò¤´Í÷¤¯¤À¤µ¤¤¡¥

4. FUSE ¤ÎÀßÄê

Samba ¤ò·Ðͳ¤·¤Æ FUSE ¤ò»È¤Ã¤¿¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤Ë¥¢¥¯¥»¥¹¤¹¤ë¤Ë¤Ï¡¤ FUSE ¤Î¥»¥­¥å¥ê¥Æ¥£¤Ë´Ø¤¹¤ëÀßÄ꤬ɬÍפˤʤê¤Þ¤¹¡¥
FUSE 2.2.1 °ÊÁ°¤Ç¤Ï¡¤°Ê²¼¤Î /etc/fuse.conf ¤ÎÀßÄê¤ÏɬÍפ¢¤ê¤Þ¤»¤ó¡¥(Ê䭤⤴Í÷¤¯¤À¤µ¤¤¡¥)

/etc/fuse.conf ¤òºîÀ®¤·¡¤°Ê²¼¤Î¤è¤¦¤ËÊÔ½¸¤·¤Þ¤¹¡¥ FUSE ¤Î¥¤¥ó¥¹¥È¡¼¥ëľ¸å¤Ï¡¤¤³¤Î¥Õ¥¡¥¤¥ë¤¬¤¢¤ê¤Þ¤»¤ó¡¥

/etc/fuse.conf
user_allow_other

¤³¤ÎÀßÄê¤Ë´Ø¤·¤Æ¤Ï¡¤FUSE ¥Ñ¥Ã¥±¡¼¥¸¤Î README ¤ò¤´Í÷¤¯¤À¤µ¤¤¡¥
¤³¤ì¤Ç¡¤¥Þ¥¦¥ó¥È»þ¤Ë -o allow_root ¥ª¥×¥·¥ç¥ó¤¬»È¤¨¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡¥

Ãí°Õ

FUSE ¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¤Æ¤¢¤ë´Ä¶­¤Ç¤Ï¡¤ ³Æ°ìÈ̥桼¥¶¤Ï¼«Í³¤Ë FUSE ¤ò»È¤Ã¤Æ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤òºîÀ®¡¤¥Þ¥¦¥ó¥È¤¬¤Ç¤­¤Þ¤¹¡¥
¤µ¤é¤Ë user_allow_other ¤ÎÀßÄ꤬¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¡¤³Æ°ìÈ̥桼¥¶¤Ï¥Þ¥¦¥ó¥È»þ¤Ë¡¤ ¤½¤Î¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤Ë¾¿Í¤â¥¢¥¯¥»¥¹¤Ç¤­¤ë¤è¤¦¤Ë¤¹¤ë¥ª¥×¥·¥ç¥ó(-o allow_root ¤È -o allow_other) ¤òÉÕ¤±¤Æ¥Þ¥¦¥ó¥È¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡¥

Êä­

FUSE 2.2.1 °ÊÁ°¤È FUSE 2.3.0 ¤È¤Ç¤Ï¡¤¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë¥¢¥¯¥»¥¹¤·¤Æ¤­¤¿¥×¥í¥»¥¹¤Î¸¢¸Â (uid, gid ´Ø·¸) ¤È¡¤¥Þ¥¦¥ó¥È¤·¤¿¤È¤­¤Î¥æ¡¼¥¶¤È¤ÎÈæ³ÓÊýË¡¤¬°Û¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡¥ ¤½¤Î¤¿¤á¡¤FUSE ¤Î¥Ð¡¼¥¸¥ç¥ó¤È¡¤Samba ¤ä ftpd ¤Ê¤É¤Î³Æ¼ï¥µ¡¼¥ÐÎà¤È¤ÎÁȤ߹ç¤ï¤»¤Ë¤è¤Ã¤Æ¡¤ user_allow_other ¤ÎÀßÄ꤬ɬÍפǤ¢¤Ã¤¿¤ê¡¤É¬ÍפǤʤ«¤Ã¤¿¤ê¤·¤Þ¤¹¡¥ ¤¿¤È¤¨¤Ð¡¤vsftpd ¤Ï user_allow_other ¤ÎÀßÄ꤬ɬÍפ¢¤ê¤Þ¤»¤ó¡¥ smbd ¤â´°Á´¤Ë°ìÈ̥桼¥¶¤Î¸¢¸Â(uid, gid) ¤Ë¤Ê¤Ã¤ÆÆ°¤¯ÊýË¡¤¬¤¢¤ì¤Ð user_allow_other ¤ÎÀßÄê¤ÏÍפé¤Ê¤¤¤Ï¤º¤Ç¤¹¡¥(¤´Â¸ÃΤÎÊý¤¤¤é¤Ã¤·¤ã¤¤¤Þ¤»¤ó¤«¡©)

»²¹Í

¾åµ­¤ÎÀßÄê¤ò¤»¤º¤Ë FUSE ¤ò»È¤Ã¤¿¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ò -o allow_root ¤ò¤Ä¤±¤Æ¥Þ¥¦¥ó¥È¤¹¤ë¤È¡¤°Ê²¼¤Î¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤¬½Ð¤Þ¤¹¡£

fusermount: option allow_other only allowed if 'user_allow_other' is set in /etc/fuse.conf

5. gfarm2fs ¤Ç Gfarm ¤ò¥Þ¥¦¥ó¥È

gfarm2fs ¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤·¤Æ¡¤Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ò¥Þ¥¦¥ó¥È¤·¤Þ¤¹¡¥ ¾åµ­¤ÇÀßÄꤷ¤¿ Samba ¤òư¤«¤·¤Æ¤¤¤ë Linux ¥Þ¥·¥ó¾å¤Ç¡¤ ¤«¤Ä Gfarm ¤Î´Ä¶­¤ò»È¤¦½àÈ÷¤¬¤Ç¤­¤Æ¤¤¤ë°ìÈ̥桼¥¶¸¢¸Â¤Ç¼Â¹Ô¤·¤Þ¤¹¡¥

gfhost -l ¤Ê¤É¤Ç¡¤¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Ë¥¢¥¯¥»¥¹¤Ç¤­¤ë¾õÂ֤Ǥ¢¤ë¤³¤È¤ò³Îǧ¤·¤Æ¤«¤é¡¤ °Ê²¼¤Î¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤·¤Æ¥Þ¥¦¥ó¥È¤·¤Þ¤¹¡¥
¾Ü¤·¤¯¤Ï Gfarm ¤È gfarm2fs ¤Î¥É¥­¥å¥á¥ó¥È¤ò¤´Í÷¤¯¤À¤µ¤¤¡¥

  $ gfarm2fs [gfarm2fs ¤Î¥ª¥×¥·¥ç¥ó] ¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È -o allow_root [FUSE ¤Î¥ª¥×¥·¥ç¥ó]

¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤Ï Samba ¤Ç¸ø³«¤·¤Æ¤¤¤ë¥Ç¥£¥ì¥¯¥È¥ê¼«ÂΡ¤¤Þ¤¿¤Ï¤½¤ì°Ê²¼¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤·¤Þ¤¹¡¥

Ãí°Õ

-o allow_other ¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Ê¤¤¤Ç¤¯¤À¤µ¤¤¡¥ -o allow_other ¥ª¥×¥·¥ç¥ó¤ò¤Ä¤±¤ë¤È¡¤Â¾¤Î°ìÈ̥桼¥¶¤¬¥¢¥¯¥»¥¹¤Ç¤­¤Æ¤·¤Þ¤¤¤Þ¤¹¡¥ ¤·¤«¤â¡¤¥Þ¥¦¥ó¥È¤·¤¿¥æ¡¼¥¶¤Î¸¢¸Â¤Ç Gfarm ¤Î´Ä¶­¤Ë¥¢¥¯¥»¥¹¤¹¤ë¤³¤È¤Ë¤Ê¤ê¤Þ¤¹¡¥

6. Windows ¤«¤é Samba ¤Ë¥¢¥¯¥»¥¹¤¹¤ë

¥ï¡¼¥¯¥°¥ë¡¼¥×¤Î¥³¥ó¥Ô¥å¡¼¥¿¤òɽ¼¨¤·¤ÆÃµ¤·¤¿¤ê¡¤¥¢¥É¥ì¥¹¥Ð¡¼¤Ë IP ¥¢¥É¥ì¥¹¤ä¥Þ¥·¥ó̾¤òÆþÎϤ·¤Æ¡¤ ¾åµ­¤ÇÀßÄꤷ¤¿ Samba ¥Þ¥·¥ó¤ËÀܳ¤·¤Þ¤¹¡¥ ¼¡¤Ë¡¤gfarm2fs ¤Ç¥Þ¥¦¥ó¥È¤·¤¿¥Ç¥£¥ì¥¯¥È¥ê¤¬´Þ¤Þ¤ì¤ë¶¦Í­¥Õ¥©¥ë¥À¤ò³«¤­¤Þ¤¹¡¥ ¤³¤³¤Ç¡¤¥Í¥Ã¥È¥ï¡¼¥¯¥É¥é¥¤¥Ö¤Ë³ä¤êÅö¤Æ¤ë¤³¤È¤â¤Ç¤­¤Þ¤¹¡¥ ¤½¤·¤Æ¡¤gfarm2fs ¥³¥Þ¥ó¥É¤Ç¥Þ¥¦¥ó¥È¤·¤¿¥Ç¥£¥ì¥¯¥È¥ê¤ò³«¤­¡¤³Æ¥Õ¥¡¥¤¥ë¤ò¥¢¥¯¥»¥¹¤Ç¤­¤Þ¤¹¡¥

7. Samba ¤ÎÀßÄêÎ㡤±þÍÑ

Gfarm ¤È¤¤¤¦¶¦Í­Ì¾¤Ë¥¢¥¯¥»¥¹¤¹¤ë¤À¤±¤Ç¡¤¼«Æ°¤Ç gfarm2fs ¤Ç¥Þ¥¦¥ó¥È¤·¤Æ¥¢¥¯¥»¥¹¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ëÎã¤ò¹Í¤¨¤Æ¤ß¤Þ¤·¤¿¡¥
»²¹Í¤Ë¤·¤Æ¡¤±þÍѤ·¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡¥
  • Gfarm ¤È¤¤¤¦¶¦Í­Ì¾¤Ç¸ø³«¤¹¤ë¡¥
  • 郎¥¢¥¯¥»¥¹¤·¤Æ¤â¡¤gfarm2fs ¤Ë¤è¤ë¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤¬¶¦Í­¥Õ¥©¥ë¥À¤Îľ²¼¤Ë¤Ê¤ë¤è¤¦¤Ë¤¹¤ë¡¥
    • ³Æ¥æ¡¼¥¶¤Î¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥êľ²¼¤Î samba-fuse ¤È¤¤¤¦¥Ç¥£¥ì¥¯¥È¥ê¤ò¸ø³«¤¹¤ë¡¥
    • ¥Ç¥£¥ì¥¯¥È¥ê¤òºîÀ®¤·¤Æ¤ª¤¯É¬Íפ¬¤¢¤ë¡¥(mkdir ~/samba-fuse)
  • ¶¦Í­¥Õ¥©¥ë¥À¤ØÀܳ»þ¤Ë³Æ¥æ¡¼¥¶¤Î¸¢¸Â¤Ç¼«Æ°¤Ç gfarm2fs ¤ò»È¤Ã¤Æ¥Þ¥¦¥ó¥È¤¹¤ë¡¥
    • ¤·¤«¤·¡¤¶¦Ä̸°Ç§¾ÚÊý¼°¤ò»È¤Ã¤Æ¡¤¤¹¤Ù¤Æ¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Î¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê¤ò¶¦Í­¤·¤Æ¤ª¤«¤Ê¤¤¤È´°Á´¤Ë¼«Æ°¤Ë¤Ê¤é¤Ê¤¤¡¥
    • ¤Þ¤¿¤Ï GSI ǧ¾Ú¤ò»È¤¦¤è¤¦¤Ë¤·¡¤Samba ¤òư¤«¤·¤Æ¤¤¤ë¥Þ¥·¥ó¤Ç grid-proxy-init ¤ò¼Â¹Ô¤·¤Æ¤ª¤¯É¬Íפ¬¤¢¤ë¡¥
  • ¥Þ¥¦¥ó¥È¤Ë¼ºÇÔ¤·¤¿¤é¡¤¤³¤Î¶¦Í­Ì¾¤ÎÀܳ¤â¼ºÇÔ¤¹¤ë¤è¤¦¤Ë¤¹¤ë¡¥
  • ÀÚÃÇ»þ¤Ë¤Ï¼«Æ°¤Ç¥¢¥ó¥Þ¥¦¥ó¥È¤¹¤ë¡¥

[Gfarm]
  path = %H/samba-fuse
  create mask = 0644
  exec = /usr/local/bin/gfarmfsmount.sh %P
  preexec close = Yes
  postexec = /usr/local/bin/gfarmfsumount.sh %P
  read only = no

%H ¤Ï³Æ¥æ¡¼¥¶¤Î¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤Ê¤ê¤Þ¤¹¡¥
%P ¤Ï path ¤ÎÆâÍÆ¤Ë¤Ê¤ê¤Þ¤¹¡¥
exec ¤ÏÀܳ»þ¤Ë¼Â¹Ô¤¹¤ë¥³¥Þ¥ó¥É¤Ç¤¹¡¥
preexec close ¤Ï exec ¤Ë¼ºÇÔ¤·¤¿¾ì¹ç¤ËÀܳ¤Ç¤­¤Ê¤¤¤è¤¦¤Ë¤·¤Þ¤¹¡¥
postexec ¤ÏÀÚÃÇ»þ¤Ë¼Â¹Ô¤¹¤ë¥³¥Þ¥ó¥É¤Ç¤¹¡¥
¾Ü¤·¤¯¤Ï smb.conf ¤Î¥Þ¥Ë¥å¥¢¥ë¤ò¤´Í÷¤¯¤À¤µ¤¤¡¥

°Ê²¼¤Ï¡¤¼«Æ°¤Ç¥Þ¥¦¥ó¥È¡¿¥¢¥ó¥Þ¥¦¥ó¥È¤¹¤ë¤¿¤á¤Î¥¹¥¯¥ê¥×¥È¤ÎÎã¤Ç¤¹¡¥ ¾õ¶·¤Ë¤è¤ê½¤Àµ¤·¤Æ¤ª»È¤¤¤¯¤À¤µ¤¤¡¥

gfarmfsmount.sh
#! /bin/sh

GFARMFS=/usr/local/bin/gfarm2fs
USERNAME=`/usr/bin/whoami`
LOGFILE=/tmp/gfarm2fs-$USERNAME.log

#ARCH="-a i686-FC3-linux"
ALLOWROOT="-o allow_root"

GREP=/bin/grep
DF=/bin/df
TAIL=/usr/bin/tail
DATE=/bin/date

# for fusermount
export PATH=$PATH:/usr/local/bin

#####
if [ $# -ne 1 ]; then
    echo "usage: `basename $0` MOUNTPOINT"
    exit 1
fi

if [ ! -f $LOGFILE ]; then
    touch $LOGFILE
    chmod 600 $LOGFILE
fi

DATE=`$DATE '+%Y%m%d-%H%M%S'`
MOUNTP=$1

($DF -t fuse $MOUNTP | $TAIL +2 | $GREP gfarm2fs > /dev/null && \
    (echo $DATE MOUNT:ALREADY $MOUNTP) || \
    ($GFARMFS $ARCH $MOUNTP $ALLOWROOT && \
    echo $DATE MOUNT:SUCCESS $MOUNTP || ! echo $DATE MOUNT:FAIL $MOUNTP)
) >> $LOGFILE 2>&1

exit $?

gfarmfsumount.sh
#! /bin/sh

FUSERMOUNT=/usr/local/bin/fusermount

USERNAME=`/usr/bin/whoami`
LOGFILE=/tmp/gfarm2fs-$USERNAME.log

DATE=/bin/date
SLEEP=/bin/sleep

#####
if [ $# -ne 1 ]; then
    echo "usage: `basename $0` MOUNTPOINT"
    exit 1
fi

if [ ! -f $LOGFILE ]; then
    touch $LOGFILE
    chmod 600 $LOGFILE
fi

DATE=`date '+%Y%m%d-%H%M%S'`
MOUNTP=$1

(cd /; $SLEEP 1;
    $FUSERMOUNT -u $MOUNTP && \
        echo $DATE UMOUNT:SUCCESS $MOUNTP || \
        echo $DATE UMOUNT:FAIL $MOUNTP
) >> $LOGFILE 2>&1 &

8. ¥³¥á¥ó¥È

¼ÁÌä¤ä¥³¥á¥ó¥È¤¬¤¢¤ê¤Þ¤·¤¿¤é¡¤ gfarmfs at gmail.com ¤Þ¤Ç¼«Í³¤Ë¥á¡¼¥ë¤òÁ÷ÉÕ¤·¤Æ¤¯¤À¤µ¤¤¡¥


Grid Datafarm
gfarm-2.4.1/doc/html/ja/user/nfs-gfarmfs.html0000644000000000000000000001252211507222722017472 0ustar rootroot Grid Datafarm: NFS [Japanese] [GFARM LOGO] ʸ½ñ½¸ > ¥æ¡¼¥¶¡¼¥º¥Þ¥Ë¥å¥¢¥ë > nfs

NFS¤Ç¥Þ¥¦¥ó¥È

English | ÆüËܸì

1. ³µÍ×

gfarm2fs ¤ò»È¤Ã¤Æ Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ò¥Þ¥¦¥ó¥È¤·¡¤¤½¤Î¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤ò NFS ¥µ¡¼¥Ð¤Ç¸ø³«¤¹¤ëÊýË¡¤ò¤´¾Ò²ð¤·¤Þ¤¹¡¥
¤·¤«¤·¡¤»È¤¤¾¡¼ê¤ÎÅÀ¤Ç¡¤¤ª´«¤á¤Ç¤­¤ëÊýË¡¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡¥

ɬÍפʴĶ­¤äÀßÄê

  • NFS ¥µ¡¼¥Ð¥Þ¥·¥ó¦
    • FUSE ¤¬¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Æ¤¤¤ë¡¥
    • FUSE ¤Î README.NFS ¤ËÌܤòÄ̤·¤Æ¤ª¤¯¡¥
    • °ìÈ̥桼¥¶¤¬ FUSE ¤Ç¥Þ¥¦¥ó¥È¤·¤¿¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤Ë¾¥æ¡¼¥¶¤¬¥¢¥¯¥»¥¹¤¹¤ë¤³¤È¤òµö²Ä¤µ¤ì¤Æ¤¤¤ë¡¥(user_allow_other ÀßÄê)
    • Gfarm ´Ä¶­¤Ë¥¢¥¯¥»¥¹¤Ç¤­¤ëÀßÄ꤬ºÑ¤ó¤Ç¤¤¤ë¡¥
    • ǧ¾ÚÊýË¡¤Ï sharedsecret ǧ¾Ú¤ò»ÈÍѤ·¡¤Gfarm ¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Î¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê¤¬¶¦Í­¤µ¤ì¤Æ¤¤¤ë¤³¤È¤ò¿ä¾©¤¹¤ë¡¥¤½¤¦¤Ç¤Ê¤¤¾ì¹ç¤Ï¡¤»ÈÍѤ¹¤ëÁ°¤Ë ~/.gfarm_shared_key ¤ò³Æ¥Î¡¼¥É¤ËÇÛÉÛ¤·¤¿¤ê¡¤grid-proxy-init ¤ò¼Â¹Ô¤·¤Æ¤ª¤«¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡¥
    • gfarm2fs ¤¬¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Æ¤¤¤Æ¡¤¼Â¹Ô¤Ç¤­¤ë¡¥
    • NFS ¥µ¡¼¥Ð¤òư¤«¤¹¤³¤È¤¬¤Ç¤­¤ë¡¥
    • ¤³¤Î NFS ¥µ¡¼¥Ð¤Î¥Þ¥·¥ó¾å¤Ç Gfarm ¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É(gfsd)¤òư¤«¤·¤Æ¤¤¤ë¾ì¹ç¤Ï¡¤gfarm.conf ¤Î write_local_priority ¤ò̵¸ú¤Ë¤¹¤ë¤³¤È¤ò¿ä¾©¤¹¤ë¡¥
    • °ìÈ̥桼¥¶¤¬ FUSE ¤Ç¥Þ¥¦¥ó¥È¤¹¤ë¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤Ë NFS ·Ðͳ¤Ç¥¢¥¯¥»¥¹¤Ç¤­¤ë¤è¤¦¤Ê NFS ¤ÎÀßÄê¤Ë¤¹¤ë¡¥
    • FUSE ¤Ç¥Þ¥¦¥ó¥È¤·¤Æ¤«¤é(¤·¤Ê¤ª¤·¤¿¾ì¹ç¤â)¡¤nfs restart ¤ò¤¹¤ëɬÍפ¬¤¢¤ë¡¥
  • NFS ¥¯¥é¥¤¥¢¥ó¥È¥Þ¥·¥ó¦
    • ¾åµ­ NFS ¤Î¥µ¡¼¥Ó¥¹¤Ë¥¢¥¯¥»¥¹¤¬¤Ç¤­¤ë¡¥
´ØÏ¢¥½¥Õ¥È¥¦¥¨¥¢°ìÍ÷

2. gfarm2fs ¤Ç Gfarm ¤ò¥Þ¥¦¥ó¥È

NFS ¤Ç¥¨¥¯¥¹¥Ý¡¼¥È¤¹¤ëÁ°¤Ë¡¤gfarm2fs ¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤·¤Æ¡¤Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ò¥Þ¥¦¥ó¥È¤·¤Æ¤ª¤¯É¬Íפ¬¤¢¤ê¤Þ¤¹¡¥ ²¼µ­¤Î NFS ¥µ¡¼¥Ð¤òư¤¹Í½Äê¤Î Linux ¥Þ¥·¥ó¾å¤Ç¡¤ ¤«¤Ä Gfarm ¤Î´Ä¶­¤ò»È¤¦½àÈ÷¤¬¤Ç¤­¤Æ¤¤¤ë°ìÈ̥桼¥¶¸¢¸Â¤Ç¼Â¹Ô¤·¤Þ¤¹¡¥

gfhost -l ¤Ê¤É¤Ç¡¤¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Ë¥¢¥¯¥»¥¹¤Ç¤­¤ë¾õÂ֤Ǥ¢¤ë¤³¤È¤ò³Îǧ¤·¤Æ¤«¤é¡¤ °Ê²¼¤Î¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤·¤Æ¥Þ¥¦¥ó¥È¤·¤Þ¤¹¡¥
¾Ü¤·¤¯¤Ï Gfarm ¤È gfarm2fs ¤Î¥É¥­¥å¥á¥ó¥È¤ò¤´Í÷¤¯¤À¤µ¤¤¡¥

  $ gfarm2fs [gfarm2fs ¤Î¥ª¥×¥·¥ç¥ó] ¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È -o allow_root [FUSE ¤Î¥ª¥×¥·¥ç¥ó]

-o allow_root ¤¬»È¤¨¤º¥Þ¥¦¥ó¥È¤Ç¤­¤Ê¤¤¾ì¹ç¤Ï¡¤/etc/fuse.conf ¤Ë

user_allow_other

¤Èµ­½Ò¤·¤Þ¤¹¡¥¤³¤Î¤³¤È¤Ë´Ø¤·¤Æ¤Ï¡¤FUSE ¥Ñ¥Ã¥±¡¼¥¸¤Î README ¤â¤´Í÷¤¯¤À¤µ¤¤¡¥

¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤Ï NFS ¤Ç¸ø³«¤·¤Æ¤¤¤ë¥Ç¥£¥ì¥¯¥È¥ê¼«ÂΡ¤¤Þ¤¿¤Ï¤½¤ì°Ê²¼¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤·¤Þ¤¹¡¥
°Ê²¼¤Ç¤Ï¡¤ÀâÌÀ¤Î¤¿¤á¡¤¤³¤Î¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤ò /tmp/yourname/gfarmfs ¤È¤·¤Æ¤¤¤Þ¤¹¡¥

Ãí°Õ

-o allow_other ¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Ê¤¤¤Ç¤¯¤À¤µ¤¤¡¥ -o allow_other ¥ª¥×¥·¥ç¥ó¤ò¤Ä¤±¤ë¤È¡¤Â¾¤Î°ìÈ̥桼¥¶¤¬¥¢¥¯¥»¥¹¤Ç¤­¤Æ¤·¤Þ¤¤¤Þ¤¹¡¥ ¤·¤«¤â¡¤¥Þ¥¦¥ó¥È¤·¤¿¥æ¡¼¥¶¤Î¸¢¸Â¤Ç Gfarm ¤Î´Ä¶­¤Ë¥¢¥¯¥»¥¹¤¹¤ë¤³¤È¤Ë¤Ê¤ê¤Þ¤¹¡¥

3. NFS ¥µ¡¼¥Ð¤ÎÀßÄê

FUSE ¤Î README.NFS ¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡¥FUSE 2.5.3 »þÅÀ¤Ç¤Ï¡¤Linux ¥«¡¼¥Í¥ë 2.6.14 °Ê¹ß¤ò»ÈÍѤ·¤Æ¤¤¤ë¾ì¹ç¤Ë¡¤FUSE ¤Î ./configure ¤Ë --enable-kernel-module ¤ò¤Ä¤±¤Æ¥«¡¼¥Í¥ë¥â¥¸¥å¡¼¥ë¤òËè²ó¥¤¥ó¥¹¥È¡¼¥ë¤·¤Ê¤ª¤¹É¬Íפ¬¤¢¤ê¤Þ¤¹¡¥
/etc/exports ¤Ë¤Ï¡¤¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤ò¸ø³«¤¹¤ëÀßÄê¤Ë fsid ¤È anonuid ¤ÎÀßÄê¤â²Ã¤¨¤Þ¤¹¡¥ ¤½¤Î¾¡¤/etc/hosts.allow /etc/hosts.deny ¤Ê¤É¤ÎÀßÄê¤ò¤·¤Æ¡¤nfs restart ¤·¤Þ¤¹¡¥

/etc/exports ¤ÎÎã¤Ç¤¹¡¥
/tmp/yourname/gfarmfs  AAA.BBB.CCC.0/255.255.255.0(rw,fsid=10,anonuid=1205)

fsid ¤Ë¤Ï¡¤Â¾¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç»È¤ï¤ì¤Æ¤¤¤Ê¤¤Ç¤°Õ¤ÎÃͤò»ØÄꤹ¤ë¤è¤¦¤Ç¤¹¡¥(¾Ü¤·¤¤Êý¤¤¤é¤Ã¤·¤ã¤¤¤Þ¤»¤ó¤«¡©)
anonuid ¤Ë¤Ï¡¤gfarm2fs ¤Ç¥Þ¥¦¥ó¥È¤·¤¿¥æ¡¼¥¶¤Î uid ¤ò»ØÄꤷ¤Þ¤¹¡¥

4. NFS ¥¯¥é¥¤¥¢¥ó¥È¤«¤é¥Þ¥¦¥ó¥È

NFS ¥¯¥é¥¤¥¢¥ó¥È¤«¤é¡¤¾åµ­¤Î NFS ¥µ¡¼¥Ð¤ò¥Þ¥¦¥ó¥È¤·¤Þ¤¹¡¥ ¥¯¥é¥¤¥¢¥ó¥È¦¤Ï¡¤°ìÈÌŪ¤ÊÊýË¡¤Ç NFS ¥Þ¥¦¥ó¥È¤¹¤ë¤À¤±¤Ç¡¤ÆÃÊ̤ÊÀßÄê¤ÏÍפê¤Þ¤»¤ó¡¥ mount ¥³¥Þ¥ó¥É¤Ç¥Þ¥¦¥ó¥È¤·¤Þ¤¹¡¥ /etc/fstab ¤Ëµ­½Ò¤â¤Ç¤­¤Þ¤¹¡¥

/etc/fstab ¤ÎÎã¤Ç¤¹¡¥
AAA.BBB.CCC.1:/tmp/yourname/gfarmfs  /mnt/gfarm/yourname  nfs  rw,sync,noauto  0  0

5. »È¤¤¾¡¼ê¤Ë¤Ä¤¤¤Æ

NFS ¥µ¡¼¥Ð¦¤Ç¤Ï¡¤gfarm2fs ¤Ç¥Þ¥¦¥ó¥È¤·¤Æ¤ª¤¤¤Æ¤«¤é¡¤nfs restart ¤ò¤«¤±¤Þ¤¹¡¥ ¤·¤«¤·¡¤Ä̾gfarm2fs ¤Ç¥Þ¥¦¥ó¥È¤¹¤ë¤Î¤Ï°ìÈ̥桼¥¶¤Ç¡¤nfs restart ¤¹¤ë¤Î¤Ï root ¤Ë¤Ê¤ê¤Þ¤¹¡¥ ¤µ¤é¤Ë¡¤gfarm2fs ¤òºÆ¤Ó¥Þ¥¦¥ó¥È¤·¤Ê¤ª¤·¤¿¾ì¹ç¤Ï¡¤nfs restart ¤·¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡¥(reload ¤ä exportfs -r ¤Ç¤Ï¤À¤á¤Ç¤·¤¿)
NFS ¥¯¥é¥¤¥¢¥ó¥È¤Ï¤«¤é¤Ï, root ¸¢¸Â¤Ç¥Þ¥¦¥ó¥È¤¹¤ë¤³¤È¤Ë¤Ê¤ê¡¤¤½¤Î¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤Ë¤Ï¡¤gfarm2fs ¤Ç¥Þ¥¦¥ó¥È¤·¤¿¥æ¡¼¥¶(¤È uid, gid ¤¬°ìÃפ·¤Æ¤¤¤ë)¤·¤«ÍøÍѤǤ­¤Þ¤»¤ó¡¥/etc/fstab ¤Ë user ¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Æ¤â¡¤°ìÈ̥桼¥¶¤¬¥Þ¥¦¥ó¥È¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ë¤À¤±¤Ç¡¤gfarm2fs ¤ò¥Þ¥¦¥ó¥È¤·¤¿¥æ¡¼¥¶¤·¤«¥¢¥¯¥»¥¹¤Ç¤­¤Þ¤»¤ó¡¥

6. ¥³¥á¥ó¥È

¼ÁÌä¤ä¥³¥á¥ó¥È¤¬¤¢¤ê¤Þ¤·¤¿¤é¡¤ gfarmfs at gmail.com ¤Þ¤Ç¼«Í³¤Ë¥á¡¼¥ë¤òÁ÷ÉÕ¤·¤Æ¤¯¤À¤µ¤¤¡¥


Grid Datafarm
gfarm-2.4.1/doc/html/ja/user/index.html0000644000000000000000000000154511507222722016373 0ustar rootroot Gfarm ¥æ¡¼¥¶¡¼¥º¥Þ¥Ë¥å¥¢¥ë (in Japanese) [GFARM LOGO] ʸ½ñ½¸ > ¥æ¡¼¥¶¡¼¥º¥Þ¥Ë¥å¥¢¥ë

Gfarm ¥æ¡¼¥¶¡¼¥º¥Þ¥Ë¥å¥¢¥ë (in Japanese)

English | ÆüËܸì

¾¤Î¥×¥í¥È¥³¥ë¤òÍѤ¤¤Æ Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë¥¢¥¯¥»¥¹¤¹¤ë

gfarm-2.4.1/doc/html/ja/user/export-gfarm.html0000644000000000000000000000517311507222722017700 0ustar rootroot Grid Datafarm: Servers which export Gfarm [Japanese] [GFARM LOGO] ʸ½ñ½¸ > ¥æ¡¼¥¶¡¼¥º¥Þ¥Ë¥å¥¢¥ë > ¾¤Î¥×¥í¥È¥³¥ë¤òÍѤ¤¤ÆGfarm¤Ë¥¢¥¯¥»¥¹

¾¤Î¥×¥í¥È¥³¥ë¤òÍѤ¤¤Æ Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë¥¢¥¯¥»¥¹¤¹¤ë

English | ÆüËܸì

1. ³µÍ×

¥Õ¥¡¥¤¥ë¶¦Í­¡¿¸ø³«¥µ¡¼¥Ð¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ò·Ðͳ¤·¤Æ¡¤Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ò¥¨¥¯¥¹¥Ý¡¼¥È¤Ç¤­¤ë¤«¤É¤¦¤«¡¤¤¤¤¯¤Ä¤«Ä´ºº¤·¤Þ¤·¤¿¡¥ ³Æ¥µ¡¼¥Ð¤ËÂФ·¤Æ¡¤¥·¥¹¥Æ¥à¥³¡¼¥ë¥Õ¥Ã¥¯¤ä GfarmFS-FUSE ¤òÁȤ߹ç¤ï¤»¤ì¤Ð¼Â¸½¤Ç¤­¤Þ¤¹¡¥

2. ÁȤ߹ç¤ï¤»Ä´ºº·ë²Ì

Servers syscall-hooking library GfarmFS-FUSE
Samba ¡ý ¡ý
allow_root ɬÍ×
NFS ¡ß ¡û
allow_root ɬÍ×
vsftpd ¡û ¡û
ProFTPD ¡û ¡û
allow_root ɬÍ×
globus-gridftp-server
(GT4) (root ¸¢¸Âµ¯Æ°¡Ë
¡û
¥µ¡¼¥Ð¦¤Ç¤â grid-proxy-init ɬÍ×
¡û
¥µ¡¼¥Ð¦¤Ç¤â grid-proxy-init ɬÍ×
Apache HTTP Server
(Gfarm ¤Ë¥¢¥¯¥»¥¹¤Ç¤­¤ë
¥æ¡¼¥¶¤Î¸¢¸Â¤Çµ¯Æ°)
¡û
httpd.conf ¤Ë
EnableMMAP Off
EnableSendfile Off
¤¬É¬ÍפǤ¢¤ë
¡û

¥ê¥ó¥¯À褬¤¢¤ì¤Ð¾ÜºÙ¤Ê²òÀ⤬¤¢¤ê¤Þ¤¹¡¥Â¾¤Î¥µ¡¼¥Ð¤Ë¤â±þÍѤ·¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡¥

  • ¡ý: ¥Æ¥¹¥ÈºÑ¤ß
  • ¡û: ´Êñ¤Êưºî³Îǧ¤Î¤ß
  • ¡ß: ÉÔ²Äǽ
  • allow_root ɬÍפȤϡ¢FUSE ¤Î¥ª¥×¥·¥ç¥ó¤Ç¤¢¤ë -o allow_root ¤òÉÕ¤±¤Æ¥Þ¥¦¥ó¥È¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡¥¾Ü¤·¤¯¤Ï FUSE ¥Ñ¥Ã¥±¡¼¥¸¤Î README ¤ò¤´Í÷¤¯¤À¤µ¤¤¡¥

3. ¥³¥á¥ó¥È

¼ÁÌä¤ä¥³¥á¥ó¥È¤¬¤¢¤ê¤Þ¤·¤¿¤é¡¤ datafarm@apgrid.org ¤Þ¤Ç¼«Í³¤Ë¥á¡¼¥ë¤òÁ÷ÉÕ¤·¤Æ¤¯¤À¤µ¤¤¡¥


Grid Datafarm <datafarm@apgrid.org>
gfarm-2.4.1/doc/html/ja/user/smboverssh.html0000644000000000000000000002046511507222722017461 0ustar rootroot Grid Datafarm: Gfarm over SMB over SSH [Japanese] [GFARM LOGO] ʸ½ñ½¸ > ¥æ¡¼¥¶¡¼¥º¥Þ¥Ë¥å¥¢¥ë > SSH ¤Î¥Ý¡¼¥ÈžÁ÷¤Ç Samba ¤Ë¥¢¥¯¥»¥¹

SSH ¤Î¥Ý¡¼¥ÈžÁ÷¤òÍѤ¤¤Æ Samba ¤Ë¥¢¥¯¥»¥¹¤¹¤ë

1. ³µÍ×

SSH ¥µ¡¼¥Ð¤«¤é¸«¤¨¤ë¥Í¥Ã¥È¥ï¡¼¥¯¾å¤Ë Samba ¥µ¡¼¥Ð¤¬Â¸ºß¤·¡¤¤½¤Î SSH ¥µ¡¼¥Ð¤Ë SSH ¤Ç¥¢¥¯¥»¥¹¤Ç¤­¤ë¤Ê¤é¤Ð¡¤¤½¤Î Samba ¥µ¡¼¥Ð¤Ë¥¢¥¯¥»¥¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡¥ ¤Ä¤Þ¤ê¡¤Windows ¥Þ¥·¥ó¤«¤é¡¤Ä̾ï¤Ç¤Ï¥¢¥¯¥»¥¹¤Ç¤­¤Ê¤¤´Ä¶­¤«¤é¤Ç¤â¡¤VPN ¤òÍѤ¤¤º¤Ë SSH ¤òÍѤ¤¤Æ¡¤ËɲÐÊɤ䥤¥ó¥¿¡¼¥Í¥Ã¥È¤ò±Û¤¨¤Æ¡¤Windows ¤Î¥Õ¥¡¥¤¥ë¶¦Í­¥µ¡¼¥Ó¥¹¤ä Samba ¤Ë¥¢¥¯¥»¥¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡¥ ¤³¤Î¤¿¤á¤Ë SSH ¤Î¥Ý¡¼¥ÈžÁ÷¤Îµ¡Ç½¤òÍѤ¤¤Þ¤¹¡¥¼ê½ç¤Ï´Êñ¤Ç¤¹¡¥

¹½À®Î㣱

  • Windows ¥¯¥é¥¤¥¢¥ó¥È : ¶Ð̳À衤¥â¥Ð¥¤¥ë¤Ê¤É
  • SSH ¥µ¡¼¥Ð : ¼«Âð BB ¥ë¡¼¥¿¥Ý¡¼¥ÈžÁ÷·Ðͳ (or DMZ ´Ä¶­)
  • Windows ¥Õ¥¡¥¤¥ë¶¦Í­ : ¼«ÂðÆâ¥×¥é¥¤¥Ù¡¼¥È

¤¿¤È¤¨¤Ð¾åµ­¤Î¹½À®¤Ç¤¢¤ì¤Ð¡¤½ÐÀ褫¤é¼«Âð¤Î Windows ¤Î¥Õ¥¡¥¤¥ë¤Ë¥¢¥¯¥»¥¹¤Ç¤­¤Þ¤¹¡¥

¤³¤ì¤ò±þÍѤ·¤¿Îã¤È¤·¤Æ¡¤³°Éô¤«¤é¤Ï¥¢¥¯¥»¥¹¤Ç¤­¤Ê¤¤ Gfarm ¤Î´Ä¶­¤Ë¡¤Samba ¤È SSH ¥µ¡¼¥Ð¤òÃÖ¤¯¤³¤È¤Ç¡¤³°Éô¤«¤é¥¢¥¯¥»¥¹¤¹¤ë¤³¤È¤â¤Ç¤­¤Þ¤¹¡¥
Samba ¤ò·Ðͳ¤·¤Æ Gfarm ¤Ë¥¢¥¯¥»¥¹¤¹¤ëÊýË¡¤Ï¡¤

¤ò¤´Í÷¤¯¤À¤µ¤¤¡¥

¹½À®Î㣲

  • Windows ¥¯¥é¥¤¥¢¥ó¥È : ¥¤¥ó¥¿¡¼¥Í¥Ã¥È±Û¤·¡¤¼«Âð BB ¥ë¡¼¥¿Æâ, ¥â¥Ð¥¤¥ë¤Ê¤É
  • SSH ¥µ¡¼¥Ð : ²ñ¼Ò(Æâ³°)¥²¡¼¥È¥¦¥§¥¤
  • Samba ¥µ¡¼¥Ð : ²ñ¼ÒÆâ¥×¥é¥¤¥Ù¡¼¥È
  • Gfarm : ²ñ¼ÒÆâ¥×¥é¥¤¥Ù¡¼¥È

¹½À®Î㣳

  • Windows ¥¯¥é¥¤¥¢¥ó¥È : ²ñ¼ÒËɲÐÊÉÆâ¡¤¥¤¥ó¥¿¡¼¥Í¥Ã¥È¤Ï¥×¥í¥­¥·¥µ¡¼¥Ðɬ¿Ü
  • ¼ÒÆâ¥×¥í¥­¥· : SOCKS/HTTP ¥×¥í¥­¥· (¥×¥í¥­¥·¤ò»È¤Ã¤Æ³°Éô¤Ø SSH)
  • SSH ¥µ¡¼¥Ð : ¾¼Ò¥²¡¼¥È¥¦¥§¥¤
  • Samba ¥µ¡¼¥Ð : ¾¼ÒÆâ¥×¥é¥¤¥Ù¡¼¥È
  • Gfarm : ¾¼ÒÆâ¥×¥é¥¤¥Ù¡¼¥È
°Ê¾å¤Î¤è¤¦¤Ê¾ì¹ç¤Ç¤â¡¤¥¤¥ó¥¿¡¼¥Í¥Ã¥È¤ò±Û¤¨¤Æ¡¤Samba ¤ä Gfarm ¤Ë¥¢¥¯¥»¥¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡¥
¾¤Î¹½À®¤Ç¤â SSH ¤ò¶î»È¤·¤Æ¥¢¥¯¥»¥¹¤Ç¤­¤ë·ÐÏ©¤Ê¤é¤Ð±þÍѤǤ­¤ë¤È»×¤¤¤Þ¤¹¡¥

°Ê²¼¤Ç¤Ï¡¤(Gfarm ¤È¤Ï´Ø·¸¤Ê¤¯) Samba ¤ä Windows ¥Þ¥·¥ó¤Ë SSH ¤Ç¥Ý¡¼¥ÈžÁ÷¤¹¤ëÊýË¡¤ò¤´¾Ò²ð¤·¤Þ¤¹¡¥

2. ¥½¥Õ¥È¥¦¥¨¥¢¤Î½àÈ÷

3. ²¾Áۥͥåȥ¥¯¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î¥¤¥ó¥¹¥È¡¼¥ë

¸½ºß»ÈÍѤ·¤Æ¤¤¤ë¥Í¥Ã¥È¥ï¡¼¥¯¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤È¤ÏÊ̤ˡ¤Å¾Á÷¸µ¤È¤Ê¤ë¤¿¤á¤Î¥Í¥Ã¥È¥ï¡¼¥¯¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤òÍѰդ·¤Þ¤¹¡¥ÊªÍýŪ¤Ê¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤òÁýÀߤ¹¤ëɬÍפϤʤ¯¡¤²¾ÁÛŪ¤Ê¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ç¤âÎɤ¤¤Î¤Ç¡¤°Ê²¼¤ÎÊýË¡¤ò¾Ò²ð¤·¤Þ¤¹¡¥
  1. ¥³¥ó¥È¥í¡¼¥ë¥Ñ¥Í¥ë¤ò³«¤­¤Þ¤¹¡¥
  2. ¥Ï¡¼¥É¥¦¥¨¥¢¤ÎÄɲäò³«¤­¤Þ¤¹¡¥
  3. ¡Ö¼¡¤Ø¡×¤ò²¡¤·¤Þ¤¹¡¥
  4. ¡Ö¤Ï¤¤¡¢¥Ï¡¼¥É¥¦¥¨¥¢¤òÀܳ¤·¤Æ¤¤¤Þ¤¹¡×¤òÁªÂò¤·¤Æ¼¡¤Ø¤¤¤­¤Þ¤¹¡¥
  5. °ìÈÖ²¼¤Î¡Ö¿·¤·¤¤¥Ï¡¼¥É¥¦¥¨¥¢¤ÎÄɲáפòÁªÂò¤·¤Æ¼¡¤Ø¤¤¤­¤Þ¤¹¡¥
  6. ¡Ö°ìÍ÷¤«¤éÁªÂò¤·¤¿¥Ï¡¼¥É¥¦¥¨¥¢¤ò¥¤¥ó¥¹¥È¡¼¥ë¤¹¤ë(¾ÜºÙ)¡×¤òÁªÂò¤·¤Æ¼¡¤Ø¤¤¤­¤Þ¤¹¡¥
  7. ¡Ö¥Í¥Ã¥È¥ï¡¼¥¯ ¥¢¥À¥×¥¿¡×¤òÁªÂò¤·¤Æ¼¡¤Ø¤¤¤­¤Þ¤¹¡¥
  8. ¡ÖMicrosoft¡×¤È¡ÖMicrosoft Loopback Adaptor¡×¤òÁªÂò¤·¤Æ¼¡¤Ø¤¤¤­¤Þ¤¹¡¥
  9. ¥¤¥ó¥¹¥È¡¼¥ë¤¬´°Î»¤¹¤ë¤Þ¤Ç³¹Ô¤·¤Þ¤¹¡¥
  10. ¥¤¥ó¥¹¥È¡¼¥ë¤¬½ª¤ï¤Ã¤¿¤é¡¤¥³¥ó¥È¥í¡¼¥ë¥Ñ¥Í¥ë¤«¤é¥Í¥Ã¥È¥ï¡¼¥¯Àܳ¤ò³«¤­¤Þ¤¹¡¥
  11. ¥Ç¥Ð¥¤¥¹Ì¾¤¬¡ÖMicrosoft Loopback Adaptor¡×¤Ç¤¢¤ë¥¢¥¤¥³¥ó¤òõ¤·¤Þ¤¹¡¥
  12. # ¤³¤Î¥¢¥¤¥³¥ó¤Î̾Á°¤ò¡Öfor SMB over SSH¡×¤Ê¤É¤ï¤«¤ê¤ä¤¹¤¤Ì¾Á°¤Ë¤·¤Æ¤ª¤¯¤È¤è¤¤¤Ç¤·¤ç¤¦¡¥
  13. ¥×¥í¥Ñ¥Æ¥£¤ò³«¤­¡¤Á´È̤Υ¿¥Ö¤Ç¡¤¡ÖMicrosoft ¥Í¥Ã¥È¥ï¡¼¥¯ÍÑ¥Õ¥¡¥¤¥ë¤È¥×¥ê¥ó¥¿¶¦Í­¡×¤Î¥Á¥§¥Ã¥¯¤ò³°¤·¤Þ¤¹¡¥
  14. ¡Ö¥¤¥ó¥¿¡¼¥Í¥Ã¥È¥×¥í¥È¥³¥ë(TCP/IP)¡×¤Î¥Á¥§¥Ã¥¯¤ÏÆþ¤ì¤¿¤Þ¤Þ¡¤ÁªÂò¤·¡¤¥×¥í¥Ñ¥Æ¥£¤ò²¡¤·¤Þ¤¹¡¥
  15. ¾¤Î¥Þ¥·¥ó¤È½Å¤Ê¤é¤Ê¤¤ IP ¥¢¥É¥ì¥¹¤È¥µ¥Ö¥Í¥Ã¥È¥Þ¥¹¥¯¤òÆþÎϤ·¤Þ¤¹¡¥ ¥×¥é¥¤¥Ù¡¼¥È¥¢¥É¥ì¥¹¤ä LINKLOCAL ¥¢¥É¥ì¥¹ (169.254.*.*) ¤Î¥¢¥É¥ì¥¹ÈϰϤò»È¤¦¤³¤È¤Ë¤Ê¤ë¤È»×¤¤¤Þ¤¹¡¥ º£¸å¤Ï 169.254.0.1/255.255.0.0 ¤ÈÀßÄꤷ¤¿¾ì¹ç¤ÎÎã¤È¤·¤ÆÀâÌÀ¤·¤Þ¤¹. ¥²¡¼¥È¥¦¥§¥¤¡¤DNS ¤Î¹àÌܤòÆþÎϤ¹¤ëɬÍפϤ¢¤ê¤Þ¤»¤ó¡¥
  16. ¡Ö¾ÜºÙÀßÄê¡×¤ò³«¤­¤Þ¤¹. ¡ÖWINS¡×¤Î¥¿¥Ö¤Ç¡ÖNetBIOS over TCP/IP ¤ò̵¸ú¤Ë¤¹¤ë¡×¤òÁªÂò¤·¤Þ¤¹.
  17. ¤½¤ì¤¾¤ì OK ¤Ç·èÄꤷ¤ÆÊĤ¸¤Þ¤¹.
  • Ä̾ïÍøÍѤ·¤Æ¤¤¤ë¥Í¥Ã¥È¥ï¡¼¥¯¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î¥Ý¡¼¥È 139/TCP (Vista¤Î¾ì¹ç 445/TCP)¤Ï»ÈÍѤµ¤ì¤Æ¤¤¤ë¤Î¤Ç¡¤¤³¤ÎÊýË¡¤òÍøÍѤ·¤Æ¡¤139(445)ÈÖ¤ò³ÎÊݤ·¤Þ¤¹¡¥
  • ¡Ö¾ÜºÙÀßÄê¡×¢ª¡ÖIP ÀßÄê¡×¥¿¥Ö¢ª¡ÖIP ¥¢¥É¥ì¥¹¡×¤Ç¡¤¤µ¤é¤Ë IP ¥¢¥É¥ì¥¹¤òÄɲäǤ­¤ë¤Î¤Ç¡¤¤½¤ì¤é¤âžÁ÷¸µ¤Ë¤¹¤ë¤³¤È¤Ë¤è¤ê¡¤Ê£¿ôµòÅÀ¤Î Samba ¤òƱ»þ¤Ë»È¤¦¤³¤È¤â¤Ç¤­¤Þ¤¹.
  • %windir%\system32\drivers\etc\hosts ¥Õ¥¡¥¤¥ë¤ò»È¤Ã¤Æ IP ¥¢¥É¥ì¥¹¤È¹¥¤­¤Ê̾Á°¤òÂбþ¤µ¤»¤Æ¤ª¤¯¤ÈÊØÍø¤Ç¤¹¡¥

4. ¥Ý¡¼¥ÈžÁ÷¤ÎÀßÄê

SSH ¤Î¥í¡¼¥«¥ë¥Õ¥©¥ï¡¼¥Éµ¡Ç½¤ò»È¤¤¡¤²¾Áۥͥåȥ¥¯¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î¥Ý¡¼¥È 139(Vista¤Î¾ì¹ç445)ÈÖ¤ò¡¤ÀܳÀè¤Î SSH ¥µ¡¼¥Ð¤«¤é¸«¤¨¤ë¥Þ¥·¥ó¤Î¥¢¥É¥ì¥¹¤È¤½¤Î¥Ý¡¼¥È 139(Vista¤Î¾ì¹ç445)È֤˞Á÷¤·¤Þ¤¹¡¥°Ê²¼¡¢139È֥ݡ¼¥È¤ÇÀâÌÀ¤·¤Æ¤¤¤Þ¤¹¤¬¡¢Vista¤Î¾ì¹ç¤ÏÁ´¤Æ445ÈÖ¤ËÆÉ¤ßÂØ¤¨¤Æ¤¯¤À¤µ¤¤¡¥

  • ¿ÃÊ¤Ë SSH Àܳ¤ò¤·¤Æ¥Ý¡¼¥È¤òžÁ÷¤¹¤ë¾ì¹ç¤Ï¡¤ÅÓÃæ¤Î¥Ý¡¼¥È¤Ï 139 Èְʳ°¤Ç¤âÂç¾æÉפǤ¹¤¬¡¤ºÇ½ªÅª¤Ê½Ð¸ý¤ÈÆþ¤ê¸ý¤Ï¡¤¤È¤â¤Ë 139 È֤Ǥ¢¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡¥
  • ¥Ý¡¼¥È¤òžÁ÷¤¹¤ë¤È¤­¤Ë¥Ý¡¼¥ÈÈÖ¹æ¤òÊÑ´¹¤¹¤ë¤³¤È¤Ç¡¤139 Èְʳ°¤Ç Samba ¤òư¤«¤¹¤³¤È¤â¤Ç¤­¤Þ¤¹¡¥

°Ê¹ß¤Ç¤Ï¡¤°Ê²¼¤Î¹½À®¤ò²¾Äꤷ¤ÆÀâÌÀ¤·¤Þ¤¹¡¥

  • ¾åµ­¤ÇÀßÄꤷ¤¿¥¯¥é¥¤¥¢¥ó¥È¦¤Î²¾Áۥͥåȥ¥¯¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹: ¡Ö169.254.0.1¡×
  • SSH ¥µ¡¼¥Ð¤Î¥Û¥¹¥È̾: sshserver.example.com
  • SSH ¥µ¡¼¥Ð¤ò·Ðͳ¤·¤Æ¤«¤é¸«¤¨¤ë Samba ¥Þ¥·¥ó¤Î IP ¥¢¥É¥ì¥¹: ¡Ö192.168.1.234¡×
    • SSH ¥µ¡¼¥Ð¤È Samba ¥Þ¥·¥ó¤¬Æ±°ì¤Î¾ì¹ç¤Ï¡Ö127.0.0.1¡×¤Ç¤â²Äǽ¤Ç¤¹¡¥
    • sambaserv.example.com ¤Î¤è¤¦¤Ê̾Á°¤Ç»ØÄê¤â²Äǽ¤Ç¤¹¡¥

PuTTY (ÆüËܸìÈÇ) ¤Î¾ì¹ç

  1. sshserver.example.com ¤Ø¤Î SSH ¤ÎÀßÄê(¥»¥Ã¥·¥ç¥ó)¤ò¤Ä¤¯¤Ã¤ÆÊݸ¤·¡¤Àܳ¤Ç¤­¤ë¤³¤È¤ò³Îǧ¤·¤Æ¤ª¤­¤Þ¤¹¡¥
  2. PuTTY ¤òµ¯Æ°¤·¤Ê¤ª¤·¤Æ¡¤¤½¤Î¥»¥Ã¥·¥ç¥ó¤ò¤â¤¦°ìÅÙÆÉ¤ß¹þ¤ß¤Þ¤¹¡¥
  3. (¡ÖÀܳ¡×¢ª¡ÖSSH¡×¢ª)¡Ö¥È¥ó¥Í¥ë¡×¤òÁªÂò¤·¤Þ¤¹¡¥
  4. ¸»¥Ý¡¼¥È¤Ë¡Ö169.254.0.1:139¡×(¶¹¤¤¤Ç¤¹¤¬)¡¤Á÷¤êÀè¤Ë¡Ö192.168.1.234:139¡×¤ÈÆþÎϤ·¡¤¡Ö¥í¡¼¥«¥ë¡×¤Ë¥Á¥§¥Ã¥¯¤¬Æþ¤Ã¤Æ¤¤¤ë¤³¤È¤ò³Îǧ¤·¤Æ¡¤Äɲäò²¡¤·¤Þ¤¹¡¥
  5. ¥»¥Ã¥·¥ç¥ó¤òÊݸ¤·¤Þ¤¹¡¥

Cygwin OpenSSH ¤Þ¤¿¤Ï PortForwarder ¤Î¾ì¹ç

Cygwin ¤Ê¤é¤Ð .ssh/config ¤Ë¡¤PortForwarder ¤Ê¤é¤ÐÀßÄê¥Õ¥¡¥¤¥ë(.txt) ¤Ë¡¤ °Ê²¼¤Î¤è¤¦¤ÊÀßÄê¤òÄɲä·¤Þ¤¹¡¥

Îã
Host sshServerForSamba
HostName sshserver.example.com
User takuya
Port 22
LocalForward 169.254.0.1:139 192.168.1.234:139

5. Àܳ

  1. ¾åµ­¤ÇÀßÄꤷ¤¿ SSH ¥¯¥é¥¤¥¢¥ó¥È¤òÍѤ¤¤Æ SSH ¥µ¡¼¥Ð¤ËÀܳ¤·¤Þ¤¹¡¥
  2. ¥¨¥¯¥¹¥×¥í¡¼¥é¤ò³«¤­¤Þ¤¹¡¥
  3. ¥¢¥É¥ì¥¹¥Ð¡¼¤Ë¡Ö\\169.254.0.1¡×¤ÈÆþÎϤ·¤Þ¤¹¡¥
  4. # ·Ò¤¬¤é¤Ê¤¤¾ì¹ç¤Ï¡¤SSH ¥¯¥é¥¤¥¢¥ó¥È¤òºÇ¿·ÈǤˤ·¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡¥
  5. ¥Ñ¥¹¥ï¡¼¥É¤òʹ¤«¤ì¤ë¾ì¹ç¤Ï¡¤Å¾Á÷Àè¤Î Windows ¤Þ¤¿¤Ï Samba ÍѤΥ桼¥¶Ì¾¤È¥Ñ¥¹¥ï¡¼¥ÉÆþÎϤ·¤Þ¤¹¡¥
  6. ¶¦Í­¥Õ¥©¥ë¥À¤ò¥Í¥Ã¥È¥ï¡¼¥¯¥É¥é¥¤¥Ö¤Ë³ä¤êÅö¤Æ¤ë¤³¤È¤â¤Ç¤­¤Þ¤¹¡¥

6. ÀÚÃÇ

  1. ¥Þ¥¤¥³¥ó¥Ô¥å¡¼¥¿¤ò±¦¥¯¥ê¥Ã¥¯¤·¡¤¡Ö¥Í¥Ã¥È¥ï¡¼¥¯¥É¥é¥¤¥Ö¤ÎÀÚÃǡפò³«¤­¤Þ¤¹¡¥
  2. ³ºÅö¤¹¤ë¥É¥é¥¤¥Ö¤¬¤¢¤ì¤ÐÁªÂò¤·¤Æ OK ¤ÇÀÚÃǤ·¤Þ¤¹¡¥
  3. ÀÚÃǸ塤¤Þ¤¿¤Ï¾åµ­¤Ç³ºÅö¤¹¤ë¥É¥é¥¤¥Ö¤¬Ìµ¤¤¾ì¹ç¤Ë¤Ï¡¤»ÈÍѤ·¤Æ¤¤¤¿ SSH ¥¯¥é¥¤¥¢¥ó¥È¤ò½ªÎ»¤·¤Þ¤¹¡¥

7. ¤½¤Î¾

  • SSH ¤òÍѤ¤¤Æ¡¤TCP ¤Î¤ß¤òžÁ÷¤·¤Æ¤¤¤ë¤Î¤Ç¡¤VPN ¤ÈÈæ¤Ù¤Æ¼ê·Ú¤Ç°ÂÁ´¤Ç¤¹¡¥
  • ÄÌ¿®À­Ç½¤Ï¡¤SSH ¤ÎÄÌ¿®À­Ç½¤Ë°Í¸¤·¤Þ¤¹¡¥°Å¹æ¥â¡¼¥É¤ä°µ½Ì¥â¡¼¥É¤â±Æ¶Á¤·¤Þ¤¹¡¥

8. Linux ¤Î¾ì¹ç(»²¹Í¡¿Èæ³Ó)

Linux ¤Î¾ì¹ç¤Ï¡¤°Ê²¼¤Î¼êÃʤǡ¤¼ê¸µ¤Î¥¯¥é¥¤¥¢¥ó¥È¤«¤éľÀÜ¥¢¥¯¥»¥¹¤Ç¤­¤Ê¤¤ Gfarm ¤Î¥Ç¥£¥ì¥¯¥È¥ê°Ê²¼¤Î¥Õ¥¡¥¤¥ë¤ËľÀÜ¥¢¥¯¥»¥¹¤Ç¤­¤Þ¤¹¡¥¤µ¤é¤Ë´Êñ¤Ç¤¹¡¥
  • ¼ê¸µ¤Ç¤Ï SSHFS-FUSE ¤« SHFS ¤òÍѤ¤¤Æ¡¤SSH ±Û¤·¤Ç°Ê²¼¤Î¥µ¡¼¥Ð¤Î¥Ç¥£¥ì¥¯¥È¥ê¤ò¥Þ¥¦¥ó¥È
  • Gfarm ¤Ë¥¢¥¯¥»¥¹¤Ç¤­¤ë SSH ¥µ¡¼¥Ð¥Þ¥·¥ó¾å¤Ç GfarmFS-FUSE ¤òÍѤ¤¤Æ Gfarm ¤ò¥Þ¥¦¥ó¥È

Grid Datafarm
gfarm-2.4.1/doc/html/ja/user/Makefile0000644000000000000000000000053211507222722016031 0ustar rootroot# $Id: Makefile 2373 2006-01-12 00:54:22Z soda $ top_builddir = ../../../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk htmldir=$(default_htmldir)/ja/user HTML = export-gfarm.html \ index.html \ nfs-gfarmfs.html \ samba-gfarmfs.html \ samba-hook.html \ smboverssh.html include $(top_srcdir)/makes/html.mk gfarm-2.4.1/doc/html/ja/user/samba-hook.html0000644000000000000000000002335611507222722017311 0ustar rootroot Grid Datafarm: Gfarm hook + Samba [Japanese] [GFARM LOGO] ʸ½ñ½¸ > ¥æ¡¼¥¶¡¼¥º¥Þ¥Ë¥å¥¢¥ë > samba/hook

Samba ¤ò»È¤Ã¤Æ gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë¥¢¥¯¥»¥¹¤¹¤ë -- ¥·¥¹¥Æ¥à¥³¡¼¥ë¥Õ¥Ã¥¯¤òÍѤ¤¤ëÊýË¡

English | ÆüËܸì

1. ³µÍ×

¤³¤Îʸ½ñ¤Ç¤Ï¡¤Gfarm ¥·¥¹¥Æ¥à¥³¡¼¥ë¥Õ¥Ã¥¯¥é¥¤¥Ö¥é¥ê¤ò¥×¥ê¥í¡¼¥É¤·¤¿ ¤¦¤¨¤Ç Samba ¤òµ¯Æ°¤·¤Æ Windows ¤«¤é Gfarm ¥Õ¥¡¥¤¥ë¤Ë¥¢¥¯¥»¥¹¤¹¤ë ¤¿¤á¤ÎÀßÄêÊýË¡¤òÀâÌÀ¤·¤Æ¤¤¤Þ¤¹¡¥

Ê̤ÎÊýË¡: GfarmFS-FUSE + Samba
Ê̤ÎÊýË¡¤È¤·¤Æ¡¤FUSE ¤ò»È¤Ã¤Æ Samba ¤òÍøÍѤ¹¤ëÊýË¡¤â¤¢¤ê¤Þ¤¹¡¥ ¤·¤«¤·¡¤¥Õ¥Ã¥¯¥é¥¤¥Ö¥é¥ê¤òÍѤ¤¤ëÊý¤¬¡¤¤è¤êÀßÄê¡¿ÍøÍѼê½ç¤¬´Êñ¤Ç¤¹¤Î¤Ç¡¤ ¤³¤Á¤é¤ÎÊýË¡¤ò¤ª´«¤á¤·¤Þ¤¹¡¥

2. ÍøÍѴĶ­¤ÎÁ°Äó¾ò·ï

  • Samba ¥µ¡¼¥Ð¥Û¥¹¥È
    • Samba ¤Î¥Ð¡¼¥¸¥ç¥ó 3 °Ê¹ß¤òÍøÍѤ¹¤ë¤³¤È¡¥(ɬ¿Ü)
    • Gfarm ¥¯¥é¥¤¥¢¥ó¥È¤¬ÍøÍѤǤ­¤ë¤³¤È¡¥(ɬ¿Ü)
    • libgfs_hook ¤¬ÍøÍѤǤ­¤ë¤³¤È¡¥(ɬ¿Ü)
      ¶ñÂÎŪ¤Ê¼ê½ç¤Ë¤Ä¤¤¤Æ¤Ï INSTALL.RPM.ja ¤Î ¡Ö¡ü ¥¯¥é¥¤¥¢¥ó¥È¥Î¡¼¥É¤ÎÀßÄê¡×¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡¥
    • smbd ¤ò¼Â¹Ô¤¹¤ë¥Û¥¹¥È¤¬ Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Ç¤Ï¤Ê¤¤¤³¤È(¿ä¾©)
      smbd ¤ò¼Â¹Ô¤¹¤ë¥Û¥¹¥È¤¬¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤À¤È¡¤ ¿·µ¬ºîÀ®¤¹¤ë¥Õ¥¡¥¤¥ë¤Ï¡¤¤¹¤Ù¤Æ¤½¤Î¥Û¥¹¥È¤ËºîÀ®¤µ¤ì¤Æ¤·¤Þ¤¤¤Þ¤¹¡¥
    • ǧ¾ÚÊýË¡¤È¤·¤Æ¤Ï sharedsecret ¤ò»È¤¤¡¤Á´¤Æ¤Î filesystem node ¤È smbd ¤ò¼Â¹Ô¤¹¤ë¥Û¥¹¥È¤Î´Ö¤Ç¡¤³Æ¥æ¡¼¥¶¤¬¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê¤ò NFS ¤Ê¤É¤Î¼êÃʤǶ¦Í­¤·¤Æ¤¤¤ë¤³¤È(¿ä¾©)
      ǧ¾ÚÊýË¡¤È¤·¤Æ sharedsecret ¤Ç¤Ï¤Ê¤¯ GSI ǧ¾Ú¤ò»È¤¦¾ì¹ç¡¤ smbd ¤ò¼Â¹Ô¤¹¤ë¥Û¥¹¥È¤Ç¡¤³Æ¥æ¡¼¥¶¤¬ ¤¢¤é¤«¤¸¤á grid-proxy-init ¤ò¼Â¹Ô¤·¤Æ¤ª¤¯É¬Íפ¬¤¢¤ê¤Þ¤¹¡¥¤Þ¤¿¡¤GSI ¸°¤ÎÍ­¸ú´ü¸Â¤¬ÀÚ¤ì¤ë¤¿¤Ó ¤Ë grid-proxy-init ¤òºÆ¼Â¹Ô¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡¥
      ¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê¤ò¶¦Í­¤·¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï¡¤sharedsecret ¤è¤ê¤â GSI ǧ¾Ú¤ò»È¤¦Êý¤¬¤à¤·¤í´Êñ¤Ç¤¹¡¥ ¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê¤ò¶¦Í­¤·¤Æ¤¤¤Ê¤¤´Ä¶­¤Ç sharedsecret ¤ò»È¤¦¾ì¹ç¤Ï¡¤ ³Æ¥æ¡¼¥¶¤¬ smbd ¤ò¼Â¹Ô¤¹¤ë¥Û¥¹¥È¤Ç¡Ögfkey -c¡×¤ò¼Â¹Ô¤·¡¤ ~/.gfarm_shared_key ¤ò¡¤Á´¤Æ¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Î ¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê¤Ë¥³¥Ô¡¼¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡¥ ¤Þ¤¿¡¢sharedsecret ¸°¤ÎÍ­¸ú´ü¸Â¤¬ÀÚ¤ì¤ë¤¿¤Ó¤Ë¡¤¤³¤Îºî¶È¤ò ·«¤êÊÖ¤¹É¬Íפ¬¤¢¤ê¤Þ¤¹¡¥
´ØÏ¢¥½¥Õ¥È¥¦¥§¥¢

3. LDAP ¥µ¡¼¥Ð¤ÎÀßÄê

3.1 ÆüËܸì¥Õ¥¡¥¤¥ë̾¤Î¤¿¤á¤ÎÀßÄê

/etc/gfarm-ldap/gfarm.schema ¤Î 'pathname' ¤Ë´Ø¤¹¤ëÉôʬ¤¬¡¤ °Ê²¼¤Î¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤³¤È¤ò³Îǧ¤·¤Þ¤¹¡¥°Ê²¼¤Î¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï¡¤ ½¤Àµ¤·¤ÆLDAP ¥µ¡¼¥Ð¤òºÆµ¯Æ°¤·¤Æ¤¯¤À¤µ¤¤¡¥ Gfarm ¤Î¥Ð¡¼¥¸¥ç¥ó 1.1.1 °ÊÁ°¤ò»È¤Ã¤Æ¤¤¤¿(¤¤¤ë)¾ì¹ç¤Ï¡¤ ²¼µ­¤ÎÀßÄê¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤»¤ó¡¥

 attributetype ( 1.3.6.1.4.1.13122.2.1.2924.100.2.5 NAME 'pathname'
        EQUALITY caseExactMatch
        SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE)
# ½¤Àµ¤¹¤ë¾ì¹ç¤Ï¡¤¤³¤Î 3¹Ô¤Î¤¦¤Á¡¤²¼2¹Ô¤òÊѹ¹¤·¤Þ¤¹¡¥

4. Samba ¥µ¡¼¥Ð¤ÎÀßÄê

4.1 smb.conf ¤ÎÊѹ¹

4.1.1 [global] ¥»¥¯¥·¥ç¥ó¤Ø¤ÎÄɲùàÌÜ

4.1.1.1 ÆüËܸì¥Õ¥¡¥¤¥ë̾¤Î¤¿¤á¤ÎÀßÄê

Linux ¦¤Ç¤Ï¥Õ¥¡¥¤¥ë̾¤Îʸ»ú¥³¡¼¥É¤È¤·¤Æ UTF-8 ¤ò»È¤¦¤è¤¦¤Ë¤·¡¤ ¤½¤ì¤ò Windows ¤«¤é¸«¤¨¤ë¤è¤¦¤ËÀßÄꤷ¤Þ¤¹¡¥

Samba 3 ·Ï¤Î¤¿¤á¤ÎÀßÄê
dos charset = CP932
unix charset = UTF-8
display charset = UTF-8

4.1.1.2 kernel change notify ¤ò̵¸ú¤Ë¤¹¤ë (Samba 3 ·Ï¤Î¾ì¹ç)
Gfarm ¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¥Õ¥Ã¥¯¥é¥¤¥Ö¥é¥ê¤¬¸½ºß¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤¡¤fcntl(2) ¥·¥¹¥Æ¥à¥³¡¼¥ë¤Î F_NOTIFY µ¡Ç½¤ò¡¤samba ¤¬ÍøÍѤ·¤Ê¤¤¤è¤¦¤Ë¤·¤Þ¤¹¡¥

kernel change notify = no
¤³¤ÎÀßÄê¤ò¤·¤Ê¤¤¤È¡¤Windows ¥¯¥é¥¤¥¢¥ó¥È¤È Samba ¤È¤ÎÀܳ¤¬ÀÚ¤ì¤ë¤³¤È¤¬¤¢¤ê¤Þ¤¹(Samba 3.0.10 ¤È 3.0.20 ¤Ç³Îǧ)¡¥ ¤³¤ÎÀßÄê¤Ë¤¹¤ë¤È¡¤¹¹¿·¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤Î¾õÂÖ¤Îɽ¼¨¤¬¤¹¤°¤Ë¹¹¿·¤µ¤ì¤Ê¤¯¤Ê¤ê¤Þ¤¹¡¥
Samba 2 ·Ï¤Ç¤Ï¡¤¤³¤ÎÀßÄê¤ò»È¤¦¤³¤È¤¬¤Ç¤­¤Ê¤¤¤Î¤Ç¡¤¤³¤ÎÌäÂê¤ò²óÈò¤Ç¤­¤Þ¤»¤ó¡¥

4.1.2 Gfarm ¥Õ¥¡¥¤¥ë¤Î¶¦Í­¤òÄêµÁ¤¹¤ë¥»¥¯¥·¥ç¥ó¤òÄɲÃ

Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë¥¢¥¯¥»¥¹¤¹¤ë¤¿¤á¤Î¥»¥¯¥·¥ç¥ó¤òÄɲä·¤Þ¤¹¡¥

4.1.2.1 Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥àÍѥѥé¥á¡¼¥¿

¥»¥¯¥·¥ç¥óÆâ¤Ç°Ê²¼¤Î¥Ñ¥é¥á¡¼¥¿¤ò»ØÄꤷ¤Æ¤¯¤À¤µ¤¤¡¥

¥Ç¥Õ¥©¥ë¥È¤ÎÀßÄê¤Ç Windows ¥¯¥é¥¤¥¢¥ó¥È¤«¤é Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à ¤Ë¥Õ¥¡¥¤¥ë¤ò¿·µ¬ºîÀ®¤¢¤ë¤¤¤Ï¥³¥Ô¡¼¤¹¤ë¤È¡¤¤½¤Î¥Õ¥¡¥¤¥ë¤Î ¼ÂÂΤ¬ÃÖ¤«¤ì¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤ÈƱ¤¸¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤ò ¤â¤Ä¡¤¼Â¹Ô¥Õ¥¡¥¤¥ë(¥×¥í¥°¥é¥à)¤È¤·¤ÆÅÐÏ¿¤µ¤ì¤Æ¤·¤Þ¤¤¤Þ¤¹¡¥ ¤Û¤È¤ó¤É¤Î¾ì¹ç¡¤¤³¤ì¤Ï´üÂÔ¤µ¤ì¤ëưºî¤È°Û¤Ê¤ê¤Þ¤¹¤Î¤Ç¡¤ ¼Â¹ÔÉÔ²Äǽ¤Ê¥Õ¥¡¥¤¥ë¤È¤·¤ÆÅÐÏ¿¤¹¤ë¤¿¤á¤Ë°Ê²¼¤Î¥Ñ¥é¥á¡¼¥¿¤ò »ØÄꤷ¤Þ¤¹¡¥
create mask = 0644

¥Ç¥Õ¥©¥ë¥È¤ÎÀßÄê¤Ç¡¤Windows ¥¯¥é¥¤¥¢¥ó¥È¤«¤é Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à ¾å¤Î¥Õ¥¡¥¤¥ë¤òÆÉ¤ß½ñ¤­¤¹¤ë¤È¡¤Gfarm ¤¬¥·¥¹¥Æ¥à¥³¡¼¥ë¥Õ¥Ã¥¯ µ¡Ç½¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò Samba ¤¬¸Æ¤Ó½Ð¤·¤Þ¤¹¡¥ ¤³¤ì¤òËɤ°¤¿¤á¤Ë°Ê²¼¤Î¥Ñ¥é¥á¡¼¥¿¤ò»ØÄꤷ¤Þ¤¹¡¥
oplocks = no 
level2 oplocks = no

4.1.2.2 Îã

Ê£¿ô¥æ¡¼¥¶¤Ç¡¤Gfarm¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥àÁ´ÂΤò¶¦Í­¤¹¤ë¾ì¹ç¤ËÄɲä¹¤ë ¥»¥¯¥·¥ç¥ó¤ÎÎã¤ò°Ê²¼¤Ë¼¨¤·¤Þ¤¹¡¥

[gfarm-public]
   comment = Gfarm Public Stuff
   path = /gfarm
   public = yes
   writable = yes
   printable = no
   create mask = 0644
   oplocks = no
   level2 oplocks = no

5. Samba ¤Îµ¯Æ°ÊýË¡

5.1 µ¯Æ°¥¹¥¯¥ê¥×¥È¤ÎÊѹ¹

RedHat Linux ¤Ç¤ÎÎã¤òÍѤ¤¤ÆÀâÌÀ¤·¤Þ¤¹¡¥

smbd ¤Îµ¯Æ°½èÍý¤Ë¤ª¤¤¤Æ¡¤°Ê²¼¤Î¹àÌܤòÄɲá¦Êѹ¹¤·¤Þ¤¹¡¥
RedHat Linux ¤Î¾ì¹ç¡¤¤³¤ì¤Ï¥¹¥¯¥ê¥×¥È¥Õ¥¡¥¤¥ë /etc/init.d/smb ¤Î´Ø¿ô start() ¤Ç¹Ô¤ï¤ì¤Æ¤¤¤Þ¤¹¡¥

5.1.1 ¥Õ¥¡¥¤¥ëµ­½Ò»Ò¿ôÀ©¸Â¤Î³ÈÂç½èÍý¤ÎÄɲÃ

smbd µ¡Ç½¤ÎľÁ°¤Ë¡¤°Ê²¼¤Î¹Ô¤òÄɲä·¤Þ¤¹¡¥

	m=`ulimit -n`
	n=$(( $(gfhost -M | wc -l) + 50))
	if [ -n "$m" -a X"$m" != X"unlimited" -a "$m" -lt $n ]; then
		ulimit -n $n
	fi

5.1.2 smbd µ¯Æ°¹Ô¤Ë LD_PRELOAD ´Ä¶­ÊÑ¿ô¤ÎÀßÄê¤òÄɲÃ

smbd ¥Ç¡¼¥â¥ó¤òµ¯Æ°¤·¤Æ¤¤¤ë¹Ô¤Î¹Ô¤ÎÀèÆ¬¤Ë LD_PRELOAD ´Ä¶­ÊÑ¿ô¤ä LD_LIBRARY_PATH ´Ä¶­ÊÑ¿ô¤ÎÀßÄê¤òÄɲä·¤Þ¤¹¡¥ ¾Ü¤·¤¤ÀâÌÀ¤Ï¡¤ÉÕ°¥É¥­¥å¥á¥ó¥È¤Î README.hook.ja ¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡¥

RedHat Linux ¤òÎã¤Ë¤È¤ë¤È¡¤

	daemon smbd $SMBDOPTIONS

¤Î¤È¤³¤í¤ò

	gfarm_prefix=/usr
	globus_location=/usr/grid
	globus_flavor=gcc32
	LD_LIBRARY_PATH="$globus_location/lib" LD_PRELOAD="$globus_location/lib/libglobus_gssapi_gsi_$globus_flavor.so.0 $globus_location/lib/libssl_$globus_flavor.so.0 $gfarm_prefix/lib/libgfs_hook.so.0 /usr/lib/gfarm/libpthread-not-hidden.so /usr/lib/gfarm/libc-not-hidden.so" daemon smbd $SMBDOPTIONS

¤È¤·¤Þ¤¹¡¥ÊÑ¿ô gfarm_prefix¡¤globus_location ¤ä globus_flavor ¤ÎÃͤϡ¤¼ÂºÝ¤Ë Gfarm ¤ä Globus ¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¤¿¥Ñ¥¹¤ä¡¤ Gfarm ¤Ë¥ê¥ó¥¯¤·¤Æ¤¤¤ë Globus ¤Î flavor ̾¤Ë¹ç¤ï¤»¤ÆÊѹ¹¤·¤Æ¤¯¤À¤µ¤¤¡¥

Globus ´Ø·¸¤Î¥Ñ¥¹¤òÄɲ乤뤿¤á¤Ë¤Ï¡¤¤Þ¤º Globus ¤Î¶¦Í­¥é¥¤¥Ö¥é¥ê¤ò ¥¤¥ó¥¹¥È¡¼¥ë¤·¤Æ¤ª¤¯É¬Íפ¬¤¢¤ë¤Î¤Ç¡¤Ãí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡¥ ¤¿¤À¤·¡¤¥Ð¥¤¥Ê¥êºîÀ®»þ¤Ë Globus ¤ò¥ê¥ó¥¯¤·¤Æ¤¤¤Ê¤±¤ì¤Ð¡¤Globus ´Ø·¸¤Î¥Ñ¥¹¤ÎÄɲäÏÉÔÍפǤ¹¡¥(RedHat Linux ¸þ¤±¥Ð¥¤¥Ê¥êÇÛÉۤξì¹ç¤Ï ¥ê¥ó¥¯¤·¤Æ¤¤¤Þ¤¹¤Î¤Ç¡¤É¬ÍפǤ¹¡¥)

¤Þ¤¿¡¤¥Ð¥¤¥Ê¥êºîÀ®»þ¤Ë Globus ¤òưŪ¥ê¥ó¥¯¤·¤Æ¤¤¤Ê¤±¤ì¤Ð¡¤ LD_LIBRARY_PATH ¤ÎÄɲäÏÉÔÍפǤ¹¡¥(RedHat Linux ¸þ¤±¥Ð¥¤¥Ê¥êÇÛÉۤΠ¾ì¹ç¤ÏÀÅŪ¥ê¥ó¥¯¤·¤Æ¤¤¤Þ¤¹¤Î¤Ç¡¤¼ÂºÝ¤Ë¤Ï¾Êά¤Ç¤­¤Þ¤¹¡¥)

Linux °Ê³°¤ÎOS ¤Ç¤Ï "*-not-hiddden.so" ¤Î»ØÄê¤ÏÉÔÍפǤ¹¡¥

5.2 Äɲøå¤Îµ¯Æ°¥¹¥¯¥ê¥×¥ÈÎã

#!/bin/sh

(ÃæÎ¬)

start() {
	KIND="SMB"
	echo -n $"Starting $KIND services: "
	m=`ulimit -n`
	n=$(( $(gfhost -M | wc -l) + 50))
	if [ -n "$m" -a X"$m" != X"unlimited" -a "$m" -lt $n ]; then
		ulimit -n $n
	fi
	gfarm_prefix=/usr
	globus_location=/usr/grid
	globus_flavor=gcc32
	LD_LIBRARY_PATH="$globus_location/lib" LD_PRELOAD="$globus_location/lib/libglobus_gssapi_gsi_$globus_flavor.so.0 $globus_location/lib/libssl_$globus_flavor.so.0 $gfarm_prefix/lib/libgfs_hook.so.0 /usr/lib/gfarm/libpthread-not-hidden.so /usr/lib/gfarm/libc-not-hidden.so" daemon smbd $SMBOPTIONS
	RETVAL=$?
	echo
	KIND="NMB"
	echo -n $"Starting $KIND services: "
	daemon nmbd $NMBDOPTIONS
	RETVAL2=$?
	echo
	[ $RETVAL -eq 0 -a $RETVAL2 -eq 0 ] && touch /var/lock/subsys/smb || \
	   RETVAL=1
	return $RETVAL
}	

(°Ê²¼Î¬)

5.3 Samba ¤òµ¯Æ°¤Þ¤¿¤ÏºÆµ¯Æ°

Î㤨¤Ð RedHat Linux ¤Ç¤Ï°Ê²¼¤ò¼Â¹Ô¤·¤Þ¤¹¡¥

# /etc/init.d/smb [start|restart] 

6. Windows ¤«¤é Samba¤Ø¤Î¥¢¥¯¥»¥¹

Samba ¤Ç¤Î¶¦Í­¤Ë Windows ¥¯¥é¥¤¥¢¥ó¥È¤Î¥Í¥Ã¥È¥ï¡¼¥¯¥É¥é¥¤¥Ö¤ò ³ä¤ê¤¢¤Æ¤Þ¤¹¡¥Î㤨¤Ð°Ê²¼¤Î¼ê½ç¤Ç¶¦Í­¥Õ¥©¥ë¥À¤¬É½¼¨¤µ¤ì¤Þ¤¹¡¥

  1. ¥Þ¥¤¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥¤¥³¥ó¤ò±¦¥¯¥ê¥Ã¥¯
  2. ¥Í¥Ã¥È¥ï¡¼¥¯¥É¥é¥¤¥Ö¤Î³ä¤êÅö¤Æ¤òº¸¥¯¥ê¥Ã¥¯
  3. ɽ¼¨¤µ¤ì¤¿¥À¥¤¥¢¥í¥°¤Ç¥É¥é¥¤¥Ö̾¤È¶¦Í­¥Õ¥©¥ë¥À̾¤ò»ØÄê
gfarm-2.4.1/doc/voms-install.ja0000644000000000000000000000214011507222722015016 0ustar rootroot VOMS Ï¢·È¥³¥Þ¥ó¥É VOMS ¤Î¥°¥ë¡¼¥×¡¤¥í¡¼¥ë¤ÈÏ¢·È¤·¡¤Gfarm ¤Î¥°¥ë¡¼¥×¤Î¥á¥ó¥Ð¤ò¹¹¿·¤¹ ¤ë¤¿¤á¤Î¥³¥Þ¥ó¥É·²¤Ç¤¹¡¥VOMS ¤Ç¥°¥ë¡¼¥×´ÉÍý¤ò¹Ô¤¤¡¤¤½¤Î¥°¥ë¡¼¥×ñ °Ì¤Ç Gfarm ¤Î¥¢¥¯¥»¥¹À©¸æ¤ò¹Ô¤¤¤¿¤¤¾ì¹ç¤ËÍøÍѤ·¤Þ¤¹¡¥ *** ½àÈ÷ °Ê²¼¤Î¥½¥Õ¥È¥¦¥§¥¢¤¬»öÁ°¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Æ¤¤¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡¥ ¡¦Python (2.X ·Ï¡¤2.3 °Ê¹ß) http://www.python.org/ ¡¦ZSI (2.0 °Ê¹ß¤Çưºî³ÎǧºÑ) http://pywebsvcs.sourceforge.net/ ¥¤¥ó¥¹¥È¡¼¥ëÊýË¡ % sudo python setup.py install *** ¥¤¥ó¥¹¥È¡¼¥ëÊýË¡ Ä̾ï¤Î Gfarm ¤Î¥¤¥ó¥¹¥È¡¼¥ëÊýË¡¤ÈƱ¤¸¤Ç¤¹¤¬¡¤configure ¥³¥Þ¥ó¥É¤Î ¥ª¥×¥·¥ç¥ó¤Ç --enable-voms ¤ò»ØÄꤷ¤Þ¤¹¡¥ configure ¥³¥Þ¥ó¥É¤Î½ÐÎϤǡ¤°Ê²¼¤Î¤è¤¦¤Ë voms-collaboration available ¤¬ yes ¤È¤Ê¤Ã¤Æ¤¤¤ë¤³¤È¤ò³Îǧ¤·¤Æ¤¯¤À¤µ¤¤¡¥ checking voms-collaboration available... yes *** ¥¤¥ó¥¹¥È¡¼¥ë¥Õ¥¡¥¤¥ë °Ê²¼¤Î¥Õ¥¡¥¤¥ë¤¬¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Þ¤¹¡¥ /bin/gfvoms-list /bin/gfvoms-update /bin/gfvoms-sync /etc/gfarm.vomsids /share/gfarm/voms/gfvoms-sync.py /share/gfarm/voms/hostid.py /share/gfarm/voms/zsi_def ¥³¥Þ¥ó¥É¡¤ÀßÄê¥Õ¥¡¥¤¥ë¤Î¾ÜºÙ¤Ï voms-man.ja, voms-dev.ja ¤ò»²¾È¤¯ ¤À¤µ¤¤¡¥ gfarm-2.4.1/doc/quota.en0000644000000000000000000000624111507222722013535 0ustar rootrootQuota in Gfarm file system 2010.3.29 * Description Administrators in the gfarmadm group can limit the capacity to use and/or the number of files to create for a user or a group. These limits can be specified for files and for file replicas. The limit for file replicas is called the physical limit. There are soft limit and hard limit. The soft limit can be exceeded within the specified grace period. These limits are checked at file opening. Note that it is not possible to create a file if some limits are exceeded, but it is possible to append data beyond the capacity limit to an already opened file. * Usage ** gfedquota - edit the limit Usage: gfedquota [-P path] -u username | -g groupname [options] Options: -P,--path=NAME Gfarm pathname to specify a metadata server -u,--user=NAME username to edit the limit -g,--group=NAME groupname to edit the limit -G,--grace=SECOND grace period in second for soft limits -s,--softspc=BYTE soft limit of file space in byte -h,--hardspc=BYTE hard limit of file space in byte -m,--softnum=NUM soft limit of file number -n,--hardnum=NUM hard limit of file number -S,--physoftspc=BYTE soft limit of physical space in byte incl replicas -H,--phyhardspc=BYTE hard limit of physical space in byte incl replicas -M,--physoftnum=NUM soft limit of physical number incl replicas -N,--phyhardnum=NUM hard limit of physical number incl replicas -?,--help this help message gfedquota edits the limit for a user or a group. Each limit can be specified by one of above options. Setting 'disable' or -1 indicates unlimited. If no option for limits is specified, no quota is imposed. This command can be executed by an administrator in the gfarmadm group. The quota is enabled after executing the gfquotacheck command. ** gfquotacheck - build a table of current usage and enable the quota check Usage: gfquotacheck [-P path] Options: -P,--path=NAME Gfarm pathname to specify a metadata server gfquotacheck builds a table of the current usage for users and groups whose quota are edited by gfedquota, and enables the quota check. This command can be executed by an administrator in the gfarmadm group. ** gfquota - display the current usage and limits Usage: gfquota [-q] [-P path] [-u username | -g groupname] Options: -q do not display the current usage and limits. -P,--path=NAME Gfarm pathname to specify a metadata server -u,--user=NAME username to display -g,--group=NAME groupname to display gfquota displays the current usage and the limits. An administrator in the gfarmadm group can specify a user or a group to display. ** gfusage - display the current usage Usage: gfusage [-P path] [-g] [name] Options: -P,--path=NAME Gfarm pathname to specify a metadata server -g display the current usage for groups gfusage displays the current usage for users. If name is specified, it displays only the specified user. With the -g option, it displays the current usage for groups. The current usage is available for users or groups after building a table of the current usage by gfedquota and gfquotacheck. gfarm-2.4.1/doc/Makefile0000644000000000000000000000131511507222722013515 0ustar rootroottop_builddir = .. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk SUBDIRS = html DOC = ../LICENSE ../RELNOTES \ ../README.en ../README.ja ../OVERVIEW.en ../OVERVIEW.ja \ ../INSTALL.en ../INSTALL.ja \ ../INSTALL.RPM.en ../INSTALL.RPM.ja \ ../SETUP.en ../SETUP.ja SETUP.private.en SETUP.private.ja \ Gfarm-FAQ.en Gfarm-FAQ.ja \ KNOWN_PROBLEMS.en KNOWN_PROBLEMS.ja include $(top_srcdir)/makes/subdir.mk install: @$(MKDIR_P) $(DESTDIR)$(docdir) @for i in -- $(DOC); do \ case $$i in --) continue;; esac; \ echo \ $(INSTALL_DOC) $(srcdir)/$${i} \ $(DESTDIR)$(docdir)/`basename $${i}`; \ $(INSTALL_DOC) $(srcdir)/$${i} \ $(DESTDIR)$(docdir)/`basename $${i}`; \ done gfarm-2.4.1/doc/internal/0000755000000000000000000000000011507222730013670 5ustar rootrootgfarm-2.4.1/doc/internal/png/0000755000000000000000000000000011507222730014454 5ustar rootrootgfarm-2.4.1/doc/internal/png/gfmd-thread-dependency.png0000644000000000000000000043770111507222722021475 0ustar rootroot‰PNG  IHDRðì‡þYbKGDÿÿÿ ½§“ IDATxœìÝitç™ÿýŸ„HI€Bh„BÄ&Àì‹c‚ llŒqâÿd’ÉLœsfœYÞLN2™L<“ÍÉ9qìÄqÌcÀŽÀ6f‰}_´ $!´ïê~^ðt¥ÕhiIÝ]­Ö÷sNõR]uÕ]Õ­®º®û.?«Õjè÷ü͸EøŠðà#(ÀGP€ A>‚"|EøŠðà#(ÀGP€pÅLüüü:|Þjµºbö¦ëlýºc[û÷÷×6qÕ:øB[8k ­koy¢ÌÚl˜Á%#X­ÖvI.ÇǾ¶^­ogëí máªuð…¶pÖ@Z×Þðóós{ybaûÀ ^9€ÞöÂwµž$ôHþ]sì%ïŽÏŒ'–x¯.ð–ú¯-ð¦€Þô ¦×1ÀÓ<±Ça¹;{®£é{:mW¯;.ÛÌD}WëÔÙëÅÝ]t6]WÓ:£³z:ŸžnӞ̿/ûKOçïŽuíK<]ÍÇq^ÎîSÝ-¯/Ÿmg—Ḽî–Ñ—ï#WoÀÕü¬.ÌTu•\·ÍÙd´³óënúΖÝ×UïI1A_×ßÙ¢gÚÀþqWÓ:;}gz›líÉú¸sÞ½ÙVÞOg‰}g bz³w4ïŽæÑÛBœÎöã¾|ô¤P¢»ùuö^ à)¿€ŸŸŸ¬V«q³¾§k]%îì—m¦Þ¬Wq÷´ :{_wÓô¥Ýz2Ÿž®;çÝ›måMñt6ÿžèé{\µÏt¤£¤¾³û{Wóì¬Mݽýwðx€+“½MøÙ–å˜Ôó¤Þ¬Gq÷´ œ]gW]*¡§óéí6uÔQûôuéì±ãüݽ®=§³y¸2‰nÿÞŽâqÅüÝ©«6u×öÜ)ÀìúÂ[‹žÔ›6ðævsglÞ¶ÞÞ€þ¯_¸¢ç­³C{{«žÄèxroLB»³Í½m{z[<ö¼áÒzÎã—€9ì‡,'¹ {Þ>d¿MW—z`Ÿîë×#¸Â@H’(…¯qÕÀ}ýz$oï¹ì ¾Öî\ok+wÇÓÛù÷‡KØF´ðö8Oë—Eö‰¿ŽÞ–ìu‡¾¶Ag¯»jhøžÎÇUÛ´£Qܽ¿˜µ®®œ_¶{Wïuå(Þ:¢E¹œ†~u9€Îz(;&ß¼-Iè δãêÎ ¸"ÁÙ›ù8»MÝ9ïÞð¶x<1Çe¹;)ÞUƒÙ<±þ@Wü¬.Èžõ´WyW=•ÃéîÚß=ygóè©îÖ·»éYÿžÄÝ›ÇçmÛÞôÆîé|z²>ŽÅ ÝÅÕ—ý¥§í쟫÷ßÞÆÓ•¾^ À1uõ^G}ýÎñôö\Í%E€§‘Xu=ooÓîâóöøOð7;ÞÃ[èÎ$ø½5vÀ“(àׯ÷…uú*Àì˜Ã™kÜ{›ŽF°_þ°€;ùYÉš¡ŸéÉkoÔ“çõöï/ñîF>Âßì€kP€ A>"Àì` «ªªRyy¹îÞ½ÛîVQQ¡ÚÚZÕÖÖª¦¦Fª©©iwßö~‹ÅbÌÏjµª²²²Ý2ÒC‡*((Hþþþ Spp°†ªðððv÷‡®‘#G*""B9r¤F¥Q£F)((Èý §ùY­V«ÙA€/jllTnn®Š‹‹UTT¤ÂÂB«  Àx®¬¬L­­­íÞ7xð`#É>lØ0 >\!!!:t¨BCCÛÝ—¤¶›GXX˜üýýÛÅÒÐÐÐnšºº:577«­­MÕÕÕª««Scc£ªªªÚݯ©©1 +**JÑÑÑŠUtt´bbb4nÜ87N±±±7n\»Xà>@ÔÖÖêúõëºy󦲳³•mÜ/**’í+((HãÆStt´âââ4vìXÅÄÄ(22ò^öÇ7y­:f±XTQQñÀh·oßVQQ‘ TRR¢‚‚ݹsGmmm’¤!C†hüøñš8q¢&Mš¤ &(11Q‰‰‰š0a‚ dòšøŠÀ mmmºqã†.\¸ óçÏëâÅ‹:þ¼rsseµZ øøx%&&jâĉš8q¢5~üxEGGkÔ¨Qf¯‚Gµ¶¶êÎ;*((PNNŽQqóæMݼyS¥¥¥’î_’ %%EiiiJMMÕôéÓ•ššª±cÇš¼ýEÐÜÜ\?~\'OžÔñãÇuöìY566*00PÉÉÉJKKSZZš¦M›¦É“'+>>^f‡ÝoÔÖÖêæÍ›º|ù²ÎŸ?¯ .èÂ… *(($=ZsæÌQFF†q 39jïG€¯­­MgΜÑþýûuôèQ8qB¥¥¥ Rzzº2224{öl¥¦¦jÊ”) 4;dŸUYYidffêøñãº~ýº$)99YZ¼x±V®\©ØØX“£ð>nܸ¡ýû÷kÿþý:pà€***4aÂ-X°Àèy>cÆ þ^àÞ½{:qâ„1*ÃÑ£GUUU¥¤¤$­\¹R+V¬Ð²eË4bijC0E„¶¶69rDï½÷žvíÚ¥¼¼ùä“£pΊèwþò—¿hÚ´iúÁ~ ¯ýëÊÍÍÕ/~ñ ÅÅÅ™úåË—kÿþý:~ü¸"##õÈ#hýúõºuë–Ù¡ôEúÂÂB=þøãzôÑG5sæL]½zU?úÑ4zôh³CC?”‘‘¡={öhß¾}ºr劦L™¢ýèGjmm5;4€^ó³Z­V³ƒ€î|öÙgzúé§5räHýêW¿ÒÊ•+Í >¤¹¹Y/¿ü²~øÃjîܹھ}»"##Í  Ç €×{ùå—õ¥/}I+W®ÔéÓ§)€Ë ×Ùz;ÙeõuÛóž±`çÎÚ´i“þð‡?èÙgŸuûò\ËðJ~~~zóÍ7¦¥K—ºµ'¶}BÙjµvš˜·=g»9¾Ï™×íçÛQ"»«DwGö1Úîwôœ½ÎŠì_ïnšŽæÕU{9Æïì4öÓz²àµ×^ÓæÍ›õ/ÿò/€~…"^+,,L{÷îÕØ±c•‘‘¡wß}×m˲OþwôØþ¹Ž^sÅë]-»£yt6ÏÎ–ãøœ­ÀÙ¸º‹§§íåì4ŽÓºSSS“þöoÿVßøÆ7ôïÿþïúÿø·.ÀÕ(àÕFŽ©ýû÷ëk_ûšž|òI½øâ‹ª­­5;,ŸáŠËøŠË—/kéÒ¥zûí·µ{÷nýÛ¿ý›Ù!ôE¼^`` ~þóŸëÍ7ßÔïÿ{M™2E;vì0;,ŸáXàx)_W[[«ú§Rzzºš››uòäI=öØcf‡Ð+è7¶lÙ¢ëׯkÕªUzê©§´jÕ*eee™VŸÙ'á;ê™ï.ö‰~???ãf¹€înîäîvimmÕo¼¡äädýîw¿ÓÏ~ö3eff*))ÉåËðŠô+‘‘‘zýõ×uøðaUWWkΜ9zä‘GôÅ_˜Z¯Ù®uï‰kÞw·lûåwôš'cuײõ›ßüF“&MÒ7¾ñ ­^½Zׯ_×7¿ùMùûs˜ ú7Înè—,X 'NhïÞ½jllÔÒ¥KµpáBíØ±CÍÍÍf‡/tçÎýçþ§&L˜ _|QkÖ¬Ñõë×õꫯ*""Âìð\ÂÏ:.ôÀg=zTÿýßÿ­÷ß_£FÒ–-[´uëV¥¤¤˜LÔÖÖ¦>úH¿ûÝïôá‡jøðáúú׿®_|QQQQf‡àrð)ÅÅÅzóÍ7õꫯ*;;[óçÏ×SO=¥õë×+..Îìðà‹EÇ×{ï½§mÛ¶éöíÛZ¾|¹^xá­]»VC† 1;D·¡€O²Z­:tèÞ|óMíÚµKwïÞÕÌ™3µqãF­_¿^ÉÉÉf‡jmmÕôÞ{ïi×®]*..VZZš6nܨ¯~õ«€€ƒ">¯­­MÔ{ï½§÷Þ{O………JLLÔŠ+´bÅ -_¾\£F2;LôЕ+WôÙgŸéÓO?Õ矮ªª*eddèñÇׯ•˜˜hvˆG€ÅjµêÔ©SÚ»w¯>ýôS=zTÍÍÍš1c†–/_®‡zHóæÍãzñ^Æb±èòåË:yò¤¾øâ }úé§***Ò˜1c´|ùr­X±B<òˆÆgv¨¦¢À€ÖÐР#GŽhÿþýúì³ÏtæÌµ¶¶*..NóæÍÓ¼yó”‘‘¡3f(88ØìpŒ;wîèäÉ“:qℎ?®“'Oª¦¦FaaaZ´h‘1‚CZZšüüüÌÀkPvêëëuêÔ)#ù|üøqiРAš0a‚¦M›¦ÔÔT¥¥¥iÚ´iš0a‚ dvØýV]]._¾¬óçÏëâÅ‹ºpá‚.\¸ ÒÒR 4H©©©ÊÈÈ0Š1’““åïïovØ^‹"èFQQ‘²²²téÒ%;wN/^Ôõë×ÕÚÚª   Mš4I‰‰‰ÜÆGÂZRSS“rrrtãÆ Ý¼yÓ¸egg+//O‹E¡¡¡š:uªÒÒÒŒ‹Y³fiذaf‡ЯP½ÐÜܬK—.éâÅ‹ºzõª²³³•­›7oª²²R’4dÈ%$$(::Z1117nœ¢££«±cÇ*&&F‘‘‘$$D£FRDD„"""4jÔ(㬰°0kèС ow_º_lÜnžáááí’êMMMª¯¯o7MUU•,‹ZZZT[[«šš566ª¦¦¦Ýýêêj•——«¼¼\wïÞmwknn6æ7xð`£¸Á¾àÁ>é?tèPW77ìPÖÜܬ’’¶K¬—••©¢¢¢]’½®®NÕÕÕª««k—pw· :T¡¡¡ } 8Áþ¥èèh3Æcñ c@?a±XTUU¥ºº:566ªªªJ’T__¯¦¦¦¦»z5B}4Ißýî1høðáíæ¢ÀÀ@ã5ûÄ?ú'ŠÀGmÛ&mÙ"qÔ0pø›p Šðà#(ÀGP€ A>‚"|EøŠðà#(ÀGP€ A>‚"|EøŠðà#(ÀGP€ A>‚"|Eøˆ³xžŸß_ï[­æÅá,OÅëÌrú‹í½=y_ÛVÀ\ŒPK&{*^g–ãé¶ëoÛ ˜‹"ì{“Ã}‰£7íãÌ| ˆ®†¢·O,;›dv,è¬xÀ¾pÀ6cÒÛ™iz£·Ëvf>=Õ“yw¶î]µ3€D x¶ÄrwÉí®¦³=×YwûçÝÎLã.ÝŽàì4®\~WëÞY;Øp9àœM(÷ÇÄ3½æÀ@ÃHŸæç÷à0ú¾Š"€ÏrçPþÞˆ"|E0@ØzÅÛþºsÞ¶ž÷¶¿öËìÍ4®ˆ¯£õîhÙ½™¦·zºîµ3€ EàãìÅ~~÷w”t¶×QÁ@w‰òÎÓö‰îÞNãlÅe¿£¤{GËîÍ4½Õ“ö±_& #fp¿®’ʽ™Î™÷öt>}}¿³ïíh^}¯¯Ì^>ðŒ€`$ܬ£K ¸E€^±Olûùy>¹m¿üÎx*&gb‘(îG WÌNh›½|{Þ Øü͸EøŠðà#(ÀGP€ `vЙÇë¿ø…Ùaô[ùù %}G›6m2;Àg¼óÎ;f‡@— €×ÊÏÏ׎;Ì´cǾý#ðzô¼ímÛ¤-[h?À¶mÛ¦-[¶˜Ýb$|EøŠðà#(ÀGP€ A>"ÀìÀWøùù÷­V«‰‘8ϳ7ÄëM±ôEÜùÂ:tÆ—× ‰‘ÀeH(BòýÀÖ¡3¾¼nH@¯Ø÷&î:‹×jµz<)êM±ôUÛ€ï£z¨¿%~½)^oŠ¥¯|i]€ï z€ÄoïùRÛùÒºß`và%i‡š·ŸÆ™×çÙÕû{2Mg1÷4&Çé·lÙ"é­NßßÓø»š¶»éºk»ÞÄÒ]δQo¸c?è*î®ög—ÙÝ´ÎÄØ[½ÙÖ½×Óà‹ €Ï±Ožv•ˆî*AØÑkŽó³=v6 ÛYïq???ùùù=0¿žtôø­·Þj÷ØqþÝ%„;Š©«åv5]wmçL,Žó±Þ~¾ÅÖÙãÞpÇ~Ð]ܶçœÙOìŸënÛÙÏ×~zWŽtà¸üî¶ag1¹rz|E|ž½M Û8ÆØU‚·7óïÎbêéû\Å1ñÞO´‘;b°½§#=ÝO:{_wÓxË6t÷ôø"Šøœ®ze{2†®Ûô6!ÝÛ½3ºŠ©£¶ug{w6$¾ýs=-¬ð¤ÞÄ`?:‚³IþŽæál¡„³q¹CGë×ÓmÞ—}_`vàNý%ù×_â쎯¬‡·êMû²MX(à“¯Gïí‰P³G.è«þÖÞýUOö¶ E|ŽÙCœ4´·÷a›0pù›¸ÉOÏ¢½½Û€"ðÞ8T»7Æ4бM@w(àóœIœ:Nã©d«}o펖iFÒ·¯1¹2f[,]Å1z¼»k›tÕ¾žÐÑ6ìé6g ½³w°OZ­Ö.“ ¶×<[ [ IDATœ}OGËrU’Ñq™îH^ö4^gbòDÛÙOë=â]¹8³,{®Ø&žhßž.ÃÝÓà‹ €OqL†Úw•ìì=6%\ýüü:M:v5²@Góë(‰ÛU=Oãu6¦ž¶w_c±½¯³{ÛF½áÊýÀ™ØÜ¹M:kß®âé [1BWÛ°»˜ú:½«÷¼ #ð9õÆîª—¶3ÉUWOßÓiú2ÿžÆëŠizò¼»cqöý=åªý '±¹c›töš§ÚÌÓ:;=—ø:FÀGP€àr€«7ׄ¨ÃÉÓVôŒÜƾx 7… g 0`ÑSÝy½m+ÚÏ¢|@m­tíZûçrsïÿ=uªýóÒ´iž‰ žEø‹Eš=»ãן_»VÚ½Ûý1ÀóüÍÐw¡¡ÒªU’¿GyÏ<ãþx`ŠÀG¼ð‚ÔÝå׃‚¤ÇóL<ð<ŠÀG<úèý$g¥uë¤à`ÏÅÏ¢|ÄСғOÞOöw¤¥EzöYÏÆÏ¢|È3ÏÜOöw$,LzøaÏÆÏ¢|ÈòåÒˆ>x¿@ ³Qà( mÙ" Üþù–驧̉ žCø˜gž‘š›Û?%-ZdN<ðŠÀÇÌ›'EGÿõñàÁÒsÏIþøè™g¤––û÷Ç—ÒÓÍžAø ´4iÒ¤û÷ŸÞÔPàAfàIV«Ueee*++SuuµjjjTUU¥êêjÕÖÖª¶¶V555jmmUMMñ>‹Å¢ªªªvó “¿Ý5‡®€€ >\ÇWHHˆ†®ððp…„„(,,L‘‘‘ŠŒŒôØúbà±X,ºwïž*++UYY©††566ûõ½{÷ŒýÛöš$UWW«­­­Ý¼?6C† Qppðχ††jРA4hBCCé† ¦Áƒ+<<\ Õ°aîððp :Ô=˜¤ººÚ¸544´û¿ÒÚÚj|Þl«ªªd±X$©Ý}{õõõjjjzày???…‡‡w‡íÿ’ô×ϧí¯í˜íoxx¸ªðððþÇf©¯¯Wii©îÞ½«ªª*ã÷Zmm­îÝ»§ºº:577«¶¶V-¶îÎR»ÿq’ŒýßÞˆ#Œ¿!!! 1þ? >\aaa=z´FŽ陕z ººZ*//×½{÷TQQ¡ŠŠ Ý»wO ª««“$µ´´¨µõ9IËtâÄ?èÿý¿¿~.FŒ¡   1B#GŽ4þFEEiܸq\Šˆˆ0ŽÁ€î´´´¨¬¬Låå媮®V}}½ªªªŒý¸®®N•••’¤ÊÊJY­V㽎ç::7`Û—‡ ¦aÆç§mCCCývذažYiàQ>óË´¡¡A¹¹¹ÊËË3nÅÅźsçŽîܹc$ÿ’Œ¤}HHˆBCCĈ=Û‰b›¼¼¼vm?Æ Å£GÖ˜1c­„„ã6~üxõ½QЯY­V•––ª´´T·oßÖíÛ·UVV¦¢¢"ݽ{×HôWVV‰ÿêêê.çiŸˆ·?y¬!C†<0½ã~/Iº}ûö±ÚLlÉÎÆÆF544+cÇŽÕèÑ£;Œp¥ææfãDRYY™îܹc<¶%\ì“ýÕÕÕªªªÒ½{÷º·}јíó8hÐ I2Šf <¸Ãƒòææfåää<ð¼ýgRúkqí¯ã „ŽØþ'ÚßFŒ¡°°01BcÆŒ1NDDDh̘1ŠŒŒääœÒÚÚªÂÂBååå)??_¹¹¹ÊÏÏ7~¯ÙþçÙ™ölŸ[¡åàÁƒÔ®¨Ìñ3ÓÐРòòrã±­ÇöY±h«¯¯`yÆo·1cÆhôèÑ7nœâââŒßnñññìûp¹ÒÒR]¼xQW®\ÑåË—uëÖ-ݺuK(‡„„häÈ‘9r¤† ¢áÇKº_3eÊNUUÅhèÐBåäÜÿ­hûŸÐÐÐ`8žH;v¬âââ« &hêÔ©JIIÑ”)S:,€ŽÜ¾}[/^Ô¥K—tåÊݺuKùùùÊËË{àÿ®í8ÐV,n;/b¿²²Ò8µýÙŠ¡ìÿJ÷[ÇÇÇ+>>^qqqJIIÑÔ©S5uêTEEEy`íÑ*((0n·nÝRaa¡JKKÛ«UTTtøþ   #Ñi;örüÍØÑù¿¢¢¢v…Ù¶s¶sUUUª¯¯WCCC‡Ë9r¤"##aü~ŒŽŽ6öؘÅÅÅq^Ç555©  @ùùù*((P^^žŠŠŠTZZj$ýKKKøÎ²±'6Ì8/g_ä/=ØA§¥¥ås¶ãÿÚÚZÕ×׫¶¶¶ÓsAAAíŽë#""­¸¸8ÅÅÅû¯ãçx7?kwY/ÒÖÖ¦ÜÜ\]¾|YW®\1n¹¹¹*++3¦‹ŒŒTBB‚‘0ŒŠŠ2NÞŽ;V‘‘‘ SHHH§=(]åÞ½{ª­­UuuµÊÊÊTRRÒîwii©ŠŠŠŒß6cÆŒQ||¼¦L™bÜRRR4~üx#Y„þËjµª¤¤Ä8b»ÙNìÞ¹sG¥¥¥íŠV† ¢Ñ£G+::Ú81bŸ4ïè¾íd‰c%»ìG!°Uæ;1Ø?®¨¨Pii©Š‹‹(¨1b„¢¢¢Œû;¶“ÕP£#*..VQQ‘ U\\¬ÂÂB©¸¸ØHø;&WŒdwdd¤ÂÃÃÄxXX˜ñ×þy[[bß>‡ŽlE ¶Ïguuµñ9t,r°½VUUe|>ËËË8yk;y`û¾7nœ¢££k<މ‰áäÁQXX¨«W¯IÌ«W¯*''GEEEÆÿ¸   ?^±±±=zt»BIû¨¡¡¡ që2¶Ä¨mŸ·“ÚN2Û~ÇëÖ­[í "##¯äädM™2E“'OVJJнî³ßßlÛ¶M[¶lé¶x©?+))щ'ŒÛùóçu÷î]I÷÷­©S§…'111ŠU\\œF¥‘#Gv»>,-\Øu uuuª¨¨Ð;wŒ×¶[NNŽ®\¹¢††ùûû+!!Aéééš7ož2224kÖ, 0 „¸sçŽNœ8¡cÇŽ=ð]6vìX¥¤¤´;~‹ULLŒñ]Öב¨,‹***T^^nœg±sߺuK—/_6 F¥iÓ¦iþüùÊÈÈмyó4zôè>·z¦®®Nׯ_7nW¯^Õ7TPPЮóApp°âããÝa1²í¾­“Oxx¸üüüÜ»­˜ÔÖ ÈV˜àX@~çÎ+//¯]á@TT”bcc5iÒ$%''+))ɸQ\êýššštýúu]»vÍØw¯_¿®üü|•””ÓÙöݘ˜=ú"zÛcÛùwŸ§–Ôn” ÛqŽmµuF*//Wqq±òóóÛ󄆆*>>^‰‰‰JJJÒäÉ“5eÊ%%%1ú ^Èk‹š››uîÜ9}ºñÛ-==Ýè©îùbÒ­´´TûöíÓǬƒ*??_JKKSFF†¦OŸ®ääd¥¥¥iÔ¨Qf‡+éþoÛÜÜ\£7ïéÓ§uüøq#öéÓ§kùòåzä‘G´`Á.ùŸä‹ßG}QQQ¡}ûöiß¾}úüóÏ•““£€€¥¦¦jþüùš6mšRRR”ššê5¿§ïÞ½«K—.éòåË:w;¦K—.©µµU&L0¾Ç–/_ÞáÈxè‹Å¢›7oêÌ™3:}ú´qޝ  @ÒýQœ&L˜ ääd%&&Å"±±±ŠUDD„ÉkàåååíF6¸uë–nÞ¼iÊÚFQŒUrr²fÍš¥ôôt͘1C‰‰‰\²Í$………:}ú´±ï^¼xÑ8O „„%''kÒ¤IÆ(a¶‚M_Øw”——×®HôÆÆùNÛèm‘‘‘Æ9ëôôtÍš5KÉÉÉ\"yM@ii©¾øâ 8p@™™™:w››¡9sæ(==]©©©JNNVrrò€.¿¡¡AW¯^5VÏž=«ÌÌL•——kðàÁš1c†æÎ«Å‹kÉ’%T°{Xnn®Îž=«³gÏêÊ•+ÆaÛõˆÇŒ£äädMž<ÙHzØz?DGG3ºƒ‹”——·UáÖ­[FUv^^žZ[[åïï¯øøx£ZyÚ´iš6mšRSS)¦éGòóóuõêU]¼xÑ8a’­‚‚£wqdd¤‘TNHHx 7ú˜1c8‰âaUUUíF^ÈÏÏWaa¡Q¬á¸ýl¶ÏëÔ©S5iÒ$zU{»wïêàÁƒ:xð 233uæÌÕ××+44T3gÎ4NøØ†ˆ'Ñm½ƒlgΜѩS§TPP %''köìÙZ´h‘/^¬¤¤$³CöZ¾’tËÊÊÒÎ;õñÇëìÙ³6l˜/^¬åË—kîܹý¶7ýíÛ·uâÄ =zTŸ~ú©Îœ9£¡C‡jéÒ¥zä‘GôÄOhìØ±f‡ ¸„¯|õŵk×´cÇ}øá‡:yò¤ï²yóæiöìÙý®cF]]233uüøq}þùç:xð ZZZ4wî\­Y³FO>ù$ÿ§{¨¤¤D‡ÖáÇuæÌ9sFµµµl7—••iРAšÿüs8p@Ÿþ¹._¾¬!C†hîܹÊÈÈМ9s4gÎ%$$˜^¿‘““£ÌÌLeeeéäÉ“:yò¤ššš”’’¢+VhéÒ¥Zºté€<ùî­­­ºpá‚Μ9c$ýÏŸ?¯ªª*CÿچIJÐ2ìµùš››•mŒÈpýúu]¹rE.\Pmm­•’’¢3f(--Ímƒžšæ*))ѹsçŒ^‡¶¤¿m¸þqãÆiÊ”)íz‘Ó“¼ÿ²ÉÁ~4‡ëׯëæÍ›jiiQ`` &Mš¤©S§jÊ”)JMMUjjª&OžLQ‡UTTÅš_|ñ….\¸ Aƒ¿×fÏž­Ù³g+))‰íÐ;wî'³²²täÈÝ»wOÑÑÑZ¶l™–,Y¢eË–)11ÑìP½FNº={VÛ·o×öíÛ•››«””­]»V«V­ÒÂ… }ò¤qYY™öíÛ§½{÷jÏž=ªªªÒâÅ‹µiÓ&mܸ‘beôkýùû¨/nݺ¥·ß~[o¿ý¶Îž=«¸¸8­]»V«W¯ÖÒ¥KûeSWêëëuàÀ}ôÑGÚ½{· ”žž®§Ÿ~ZO?ý´âââÌÑë\»vM‡ÒáÇuèÐ!åäähÈ!š={¶fΜ©ôôtÍœ9S)))ôöPKK‹.]º¤Ó§OëìÙ³:uê”N:¥¦¦&Mœ8Q .Ô¢E‹´dÉ~?ö‚í8çàÁƒ:|ø°Îž=+‹Å¢©S§jΜ9Æþ;cÆ Ÿû®s§¶¶6]¿~Ý=!++K™™™ª¯¯WBB‚-ZdCOž<ÙìpðY-ÈÍÍÕž={´{÷n:tHþþþš7ož–-[¦¥K—jÞ¼y ÙG:zô¨Q\qòäIY,-Y²Dk×®Õºuëov˜ýFEE…Ž;¦cÇŽéÈ‘#ÊÌÌT]]Q=mÚ4MŸ>Ý©‚ý·ÿ±X,ÊÎÎÖ¹sçŒÂ޳gϪ¨¨Hƒ Rjjªzè!ÍŸ?_ ,Є ÌÙg•––I1Û­¸¸X’§ääd¥¦¦=ÂSRR(°@š››â‹/êÊ•+ºté’nܸ¡––…„„=ÐgÏž­Y³f)))Éí×õe999Ú³göìÙ£C‡ÉÏÏOsçÎÕÒ¥KµdÉ-X° ßõôóF‹EçÎÓÁƒÞ‡÷îÝÓäÉ“µnÝ:=öØcš?þ€5¨¿%Ý´mÛ6ýæ7¿Ñ©S§”””¤M›6iÓ¦MJKK3;ê ‹Å¢O>ùD¿úÕ¯ôñÇkôèÑzòÉ'õÔSOiÁ‚æ7–ÕjÕ‘#G´}ûvíØ±CeeeZ½zµ¾ýíoëᇰÅö…}ô‘²³³®‡zH .ÔC=¤¹sçr)>7illTff¦>¬#GŽèðáꪪRbb¢yä­^½ZË–-p£¨:ëìÙ³úè£ôÁèĉò÷÷×ìÙ³‚Š… Ò™Ê ZZZ”••e >|X÷îÝÓĉµzõj=öØcZ¼x1çVp!·dggë­·ÞÒÎ;uîÜ9EFFê±ÇÓºuë´råJª(ݬ¾¾^ûöíÓž={ôþû﫬¬L3fÌІ ´eËšîÝ»§Ï>ûL{÷îÕ¡C‡tõêUùûû·KÏ›7O'N0'=ª»wïêøñã€DEEiÁ‚Z±b…~øa*í{©­­MgÏž5ªí³²²”ŸŸ/%%%‰ÜÙ³g+--d?:ÕÒÒ¢k×®)++Ë("9wY³fiþüùZ¼x±,XÀèݸzõª¶mÛ¦;wêÒ¥K=z´{ì1­]»–ßmb±XtêÔ)íÞ½[|ðñûyÍš5Ú²e‹–-[6à úKÒ­¤¤D/¿ü²^ýu544hÓ¦Mú»¿û;edd˜šWhjjÒ;ï¼£ßüæ7:v옦Nªï~÷»zî¹ç|rDø¦þò}ÔzõÕWõóŸÿ\999Zµj•¾õ­oiÍš5îÿ£¶¶6½ÿþûúõ¯­ýû÷kâĉúÎw¾£^xa@$»+**ôî»ïj×®]:pà€ššš4wî\=úè£Z½zµ¦OŸ>`‹"Ìf+*ýË_þb\ªcÈ!Zºt©Ö¯_¯ 6häÈ‘f‡i‹Å¢hûöíúðÃUXX¨„„­Y³F_þò—}rD“þ ³ývåʕڰaƒüqÎÐGn)¨­­ÕŸÿügýþ÷¿×¡C‡4vìXmÞ¼Y?þø€ïÉd¦¶¶6;vL»víÒÿýßÿ©¤¤D‹-ÒW¿úU=ñÄ 1;DkmmÕ‰'ôÉ'ŸhÿþýÆ5 çÏŸ¯E‹iÁ‚$ éþ¾rîÜ9=zÔ¸æmYY™Æ¯/}éKZ¹r¥V®\ÉJ'ZZZ”™™©ƒßÕÕÕ7nœ-Zd$ýgΜÉ0þè³ÖÖV]ºtÉ( 8vì˜ÎŸ?/¥§§kñâÅZ²d =<þÚ¶m›þô§?éĉŠ×æÍ›µvíZeddp2×dyyyÚ³gÞ}÷]ãwõsÏ=§gŸ}V©©©f‡çÞžt+**ÒO~ò½úê«9r¤¾óïèk_ûš"""ÌÍk={V¯¼òŠþøÇ?*::Z/½ô’¾úÕ¯R ¯çíßG}ÑÔÔ¤W_}U?þñUQQ¡­[·êÛßþ¶’’’ÌÍ+]»vM¿üå/õúë¯kÔ¨Qúþ÷¿¯­[·úÜ÷Xmm­víÚ¥íÛ·ë“O>Ñ!CŒŽ=«V­ЉeoVQQa\–çý÷ßWSS“¾ô¥/éé§ŸÖºuëÌù¿ÌÌLmÛ¶Mï¼óŽJJJ”‘‘¡ 6hÍš5JII1;<8(++ÓÞ½{bhIúò—¿¬-[¶èË_þò€(¶ÀÕ\ZpóæMýÏÿüÞxã Y­VmذA_ùÊW´bÅ ÿ^¦­­M{÷î5Fi4hž{î9½øâ‹>ß³¹±±Qü±Þyç}øá‡ªªªÒÔ©SõðÃkÕªUZ²d Àè–­bù“O>Ѿ}ûtøðaµµµé¡‡Ò“O>©'žxBQQQf‡iªÂÂBýå/Ñ| Ï>ûLõõõ?~¼–,Y¢%K–hÑ¢Eš8q¢Ùab€¨¬¬Ô¡C‡tðàAו+ä9÷7yî³ïsqpp $EEELË ‡Ü¹s‡|ùå—Ä‚°X,¢¬¬L|}}ɉ'h^£ˆ555äêÕ«dóæÍDOO cÆŒ!kÖ¬!çÏŸ'uuuLK ‡\¸p888ÄÒÒ’?~œÔ××3-Ò¸\.¹yó&™?>‘‘‘!ÚÚÚdß¾}¤ªªŠiiBáäÉ“D@Ýqᢣ£CÉþýû ›ÍfZ’D“ŸŸO/^LX,qww'™™™LK¢PÚEË£¾MÜÝÝ ‹Å"Ë–-#………LK’X È’%KâééIrss™–ÔcØl69yò$±¶¶&ˆ¹¹9ñóó£ã{ýˆÊÊJrøðabnnNròäÉ~ÑŽyòä Ù°aQPP òòòdݺu$))‰iYPRRB~üñG¢««K¤¤¤ˆ››¹rå ár¹LK£P( EìéSï555•¸ººÄÖÖ–œ={–p8Ai£ˆ‡CΞ=Ëï𹺺’ÔÔT¦eõ‰ŒŒ òÑGeee"--M\\\ÈüAÊÊʘ–FéǰÙlréÒ%²bÅ ¢¤¤D¤¥¥‰§§' ë—edZZÙºu+ÑÒÒ"ˆ¡¡!Ù²e ‰ŒŒ$MMMLË£PºEFFÙ»w/qrr"222dÈ!dñâÅäòåˤ¹¹™iy!,,Œ˜››)))âááA"""˜–D999dÓ¦MdøðáDII‰ìÛ·¯_ ä¶Fœ&ÝjjjÈòåË ²xñbòüùs¦%õ+"##‰‰‰ :t(ñ÷÷gZ…òâTõ•¿ÿþ›ÈHñ” IDATËËcccÉ´œ~Cxx8144$ $00i9Ý¢©©‰>|˜hjjYYYâããCbbb˜–E2111ÄÇLJÈÊÊ---røða‰ì¿?}ú”,^¼˜HII‘ñãÇ“ü‘®ôSxí...„ÅbsssréÒ%¦eQ( …"Öôª÷úüùs²råJ"%%E,,,è r?$<<œXXX²f͉àlll$AAAÄÙÙ™°X,¢§§GöîÝKJJJ˜–F€°ÙlræÌ~'EWW—ìÙ³‡”––2-­O”””Ÿþ™XZZdüøñäË/¿$?fZ…Òg***È_ýEìíí ‹Å"cÆŒ!›7o&>dZZ¯¸ÿ>?hsΜ9$%%…iI!PUUE¶mÛF† BtttH@@@¿Y#.“n="FFFDUU•„……1-§ßÂf³ÉÖ­[ ‹Å"Ë—/'555LK¢PøˆKyÔÈûï¿OX,Ù¼ys¿ Øl6Ù¼y3a±XdýúõäÕ«WLKj‡CNœ8AôôôˆœœùðÃéîmüü|òÁ999¢¯¯ONž<)‹ ÉÚµk‰¬¬,144$¡›"’““‰§§'@¦OŸNbcc™–D¡P(ŠXÒãÞëÉ“'‰’’ÑÒÒ"´Õáp8äèÑ£DKK‹(++“þù‡iIÒÜÜLŽ=JÆG¤¥¥ÉܹsÉ•+W¨RĆǓ͛72dÈòïÿ[âv¥HKK#+W®$rrrDII‰¼ÿþû$66¶ßL4Q(mÉÍÍ%ß|ó 122"ˆ¹pá‚Dø|cc#ùüóω´´4™2e ]å7@ÈÏÏçëΘ1ƒäåå1-©ÏˆÃ¤[xx8‘——'ŽŽŽ¤  €Q-…+W®UUUbeeE^¼xÁ´ …"åQ_¨®®&DII‰3-§ßL”””ˆ³³³Ø4¥¥¥kkk"##C–/_N²³³™–Da˜¬¬,²lÙ2"--MlmmIzz:Ó’Ú…Ëå’ß~û >œhii???‰ÜÁ€"âã㉳³3@V¬XAÊËË™–D¡P(ŠX!…nRUU…Å‹cÉ’%Xºt)222°páBHIu; Š„!%%…åË—###‹-¢E‹°téRTWW3-í5! ‚©©)V¯^ dff"88³fÍ¢>J °ÿ~àûï¿ÇÑ£G¡««‹;v ªªŠiy‡9sæÀÔÔñññ8t芋‹ñÇÀÎÎ,‹i‰ŠPÐÒÒ—_~‰ôôtDGGCEEsçÎ…©©)üýýÑØØÈ´ÄvIKKƒµµ5~þùgüöÛo¸}û6™–Eøë¯¿pûöm<þo½õ˜–%Ñ\¸pnnnX´hnܸ±cÇ2-i@0kÖ,Ü»wµµµ°··ÇóçÏ™–D¡H4•••˜9s&rrrpçÎÌ;—iIýž¹sçâöíÛxúô)fÍš…ÊÊJ¦%¡¹¹»ví¤I“Àårqÿþ}=z:::LK£0̸qãpìØ1ÙÙÙpqqÁƱaÃ<~ü«V­‚ŒŒ ÓÒ( ammððpœ?W¯^…™™BCC™–E¡P(ŠØÐ­ÙÑœœLž<‘‘‘¸rå 8€!C†[EL2d<ˆË—/ãÆ˜>>ø¿ÿû?üþûï––fZÒ€BSSÑÑÑ4h\\\Ä>h’BWááá/^ ::úúúLK0"&&ÅÅÅðôôd4€´¼¼3fÌÀÎ;ñÍ7ßàÖ­[033cLE<133C||>ß}÷Ì´,Š˜0gΤ¤¤ÀÙÙغu+!LË¢P( …qº HMM…FŒäädÌœ9Sº(bˆ««+’““¡¤¤;;;¤§§3¦…‚_~ùæææxõêîß¿¿ÿþ›fP$ yyy|öÙgÈÊÊ‚——,X€… ŠE»¡¡_}õLMMQXXˆˆˆܺu žžžtw Ê€ÇÄÄþþþÈÊÊÂôéÓáåådee1- G…——V®\‰ØØXèéé1-‰Â C† ÁÏ?ÿŒóçÏ㯿þ¢E‹Äv÷ q$'' ,À‡~ˆ}ûöÑ`†5j"""@ÁÒ¥Ké€.…Ò 6oÞŒÌÌLDFFÒ€yÐÑÑAtt4ž>}ŠO>ù„ Ïž=ƒµµ5 ‘˜˜ˆO>ù„®ž¦tˆŒŒ ¶nÝŠ{÷î¡  ¶¶¶ÈÌÌdLÏ‘#GàîîŽùóç#11VVVŒi¡ˆ/***8~ü8NŸ>À×ׯ^½bZ…B¡P(ŒÒéLNVVìíí1aÂܸq#GŽ•.Š˜¢ªªŠððpÂÁÁ999"×P]]Ù³gãã?Æ–-[€·ÞzKä:(A¡¤¤„?þø—/_Fll,ÌÌ̘˜È˜žÄÄDL˜0ÿùϰk×.Ü¿NNNŒé¡PÄ•±cÇâĉˆˆˆ@VVLMMqðàAÆôøûûcÕªUرc8@v)|<==qãÆ \¿~¾¾¾tµp¹\,X°æææøñÇ™–3àQRRBHHbbb°ÿ~¦åP(ÅÙ³gáçç‡3gÎ@CCƒi9 á÷ßGpp°Hm?zô666PUUÅíÛ·abb"RûÉÅÄÄqqqPQQ­­-ž={&r ¿üò V¯^íÛ·ÃÏÏîHH鄇‡#""àp8LK¢P( …1: `³Ù˜?>¦NŠ‹/bذa¢ÔEcäååqùòeXXXÀÇÇG¤+ÊÊÊÊ`ooôôtÄÇÇã믿†¬¬¬ÈìS(ÂÄÕÕ=‚••)r °³³ƒ‘‘?~ŒÍ›7Ó‰D ¥ ñàÁ|þùçØ´iÞ{ï=‘4$%%aýúõøé§Ÿ°mÛ6‘Ú¦H666ˆŽŽFDDvïÞÍ´±çرcÈËËéS§èb‚¾¾>üýýñÍ7ß ¤¤„i9ŠDÀf³±eËìÚµ ¶¶¶LËðØÙÙaçÎØ²e Øl¶Hl–••áwÞ៛M÷Pz oGsssxyy¡ººZd¶£¢¢°yóføùùÑ>¥GØÚÚ"..>Ä–-[˜–C¡P( ct°uëV¼xñÿý7äääD©‰‹Åâ?(-ˆËï!''‡“'O¢¸¸[·n‰M6› 477#>>žnÿ% ‘ÏÚ¦!,?íH«¸ä A ¬¬ŒsçÎaáÂ…ðòòÂýû÷Efûï¿ÿƲeËðïÿ¡¡¡PWW™ma#¾#N~Jó¬à‘““Ã_|«W¯"88¾¾¾" ¨¯¯Çüùóáíí7ŠÄf[D}O™n#¶gŸiMÝÁÔÔþþþøê«¯póæM¦åˆ-µµµØ¶m¾ýö[¨¨¨0-G¬µß{yyaêÔ©øâ‹/DbB‘t8YYYlذi)”ÿ²iÓ&°X,üúë¯"±·zõj¨««ãôéÓôüt1@Ú‹í1xð`¢±±«V­‰ÍÂÂBøøøà£>ÂÊ•+Eb³7Hj¿@ˆÛwÖ××Ç™3gð믿âôéÓLË¡P( …Ú HIIÁo¿ý†þù‡Ñ/ºU©x3räHààÁƒHKKº½O?ý………¸rå ÆŒ#t{…¾æ3^_ùu ” ÒÒÒ8|ø0ÜÜܰxñbÔ×× ÝæíÛ·±jÕ*ìÞ½ß|ó ¤¤:=-Fâ(¾Óhž.3fÌ@xx8®_¿Ž;vˆÄæÞ½{!##ƒC‡‰Äž8À´oµgŸiMÝÅËË ëׯÇúõëÁår™–#–9rRRRxï½÷˜–"ö0á÷_|ñüýýñüùs‘Û¦P$‰¦¦&ìÙ³Ÿ|ò Ý=OŒ““Ã'Ÿ|‚~øÍÍÍBµuéÒ%DFF"00C‡ª-J÷”öb{(**"$$W®\AXX˜Ðí}þùç055Åž={„n«/Hr¿` `oo={ö`Ó¦M¨©©aZ…B¡P("§ÝYžï¾ût»81„"VI;;;¸¹¹á»ï¾ª””üúë¯8uê=ÇP áùdëgQú©¸å AÀb±pøðap¹\¡ŸEÌáp°fͬ\¹rÀm“&,ßi/ú]œü”æYábii‰Ó§OcïÞ½HIIª­ššüøãøúë¯Üíï÷´¿±}ûv<{ö çÏŸgZŠXrúôiÌŸ?_hqâ´Bª§ˆƒv;;;¨©©!((ˆi)ŠX‰ÊÊJxyy1-…Ò†yóæáåË—ˆŠŠª­[·bÓ¦MÐÑѪŒ8Ô‹¢ÄÐÐ}ô>ýôS¡ÚIKKÉ'ðóÏ?Óc™:@}O\û„7n„‚‚~ù妥P( …"rÞÙª®®Fpp0–-[Æ„Š²lÙ2œ;wµµµB³ñý÷ßÃÝÝÓ¦Mš JÏÇNGbذaؾ};öïß/Ôüuüøq”•• =Ø`  ÎùBœµõ7fÍš… }€,88RRR˜;w®PíPúJJJðòòÂñãÇ™–"v#>>^hyJ’ËaqÑ.%%ÄB¡tÁ… 0mÚ4z¼¢ªª [[[\¸pAh6âã㑚šŠ5kÖÍÆ@G\êEQ³zõj$''#!!Ah6üýý1yòd˜™™ ͆$3P}¯·HIIaåÊ•ðóócZ …B¡P("ç €„„°ÙlLŸ>]d"ZŸ•Ô݆LW×´=븻×÷õœäÎÒìH_w¿WwÏ™õLöööxõêîܹ#”ôÙl6.^¼ooo¡¤ßÝñ‰îúSW×we¿£´»kS¾ÑÑw꫟öTkw¾owò” ËAâé鉺º:„‡‡ ÍÆÑ£Gñî»ï2ºŠXù¬»þÓ:¤':xïµýœ lµ—nO yVô,[¶ W®\Aii©ÐlDFFÂÆÆrrrB³Á£íoÜöõîøGg~(H}ièè½®Òéèó=Ñ&N¾ëàà ôˆ’Hff&!ÐÓÓxÚÝ-‡»*{ã‡=I«£×ÚÓÞ™-ab``€§OŸ Õ…"é<{ö ãÇxºÝ©»ºS÷òþn/ÍÞ¼Ö‘Îô3Y'ëëëãÙ³gBK?22ÐÔÔš Õc}¶'ï÷åþôÖ¿ºòã¶×õä{¶÷Ù®´‹KRGGãÇj;2""ŽŽŽBK¿=ºSn âwe›¬3ۥћüÛ—2[̘1ÙÙÙÈÍ͹m …B¡P˜ä €‚‚ 6 ***"À«ø[oÔrg×´~¿£FKG×÷uÛ¢¶×·§«³Æ[Gº:ÒÖ{ÂfäÈ‘:t(òòò„’~^^jkkahh(”ô»¢+Ÿè‰?õÄz’vg¾Ñ›<ÖÚÚo»½xGŸmk¿'y +í½×ÑûÂ,‰¼¼<´´´žž.4)))ŒGØ *Ÿ±X¬7þï©ÍÎlõ¤œî*_ô4½¶ïõ4Ó<+zÞzë-p8¡ PPP ²Á] ý¶U{¿?op§í=mïÞ ¢NTÛª§urO´‰›ïjkk£ªª ŒiG ##555§ÝÓ:¢£¶^W×µ¥§>ØÕkÝ)«Ûþ-h455Q\\,ôó´)IFXm„¾´Û;ªÿ{SµN¯=mÿîJ›¨ëdMMM¡¡@vv6´´´„–~kºÛëÉXž ïOWýö^ëm¿¯­æ®úH’â¯m7nœPƒXòòò ­­-´ôÛÒ—1AÙt›¬=úR†Jê˜5^y˜••%R» …B¡0M»]Šª1Ù›Ækg í5 :jptçúö¯{B{×÷5ÍžÚ£–¶¿q_ý©³{ÖS_o8û€¨ü´³ˆ(ËJÏéK>ëéÄH{¶ûr}_mu–Ç™òEšg)méÍoÛÓÁמ ¨{ÞÓ:¹»i¶½Žú.¥3:ò&M» õa eà!ˆv» lwôZë÷º«MT噸–ç}¡£þXW¿¿¨ïOwôõ†ž¤#iþÚ_Õ@_Æø„¥‡ŽYS( …Òÿy#@CCõõõ(//gB@5äxŒÖö´ô…îFq¶~¯/ @¦Reee¨¯¯Z”¹¶¶6äååñøñc¡¤ß:ú{ëO‚ò±Îü¥¯~%h„™Ú³Át9ÐWjkk‘——ccc¡Ù033ãG„–~OéK>–žÖƒYLå'¦|‘æÙÞ“””iii˜šš ͆¦¦&òóó…–~[=H&ŠÕ]â@'޾››› %%%(++‹Ô®¸£¡¡ææf3b¿­tä=ñQÕ]¢ôáüü|¨©©AFFFd6)ICCCCèm„Þ¶Û…UÿwwâUêäüü|¡î椫«+–Û^wÇ7„qÚÖƒÝi ªîìhœS’üµ-ÙÙÙB9:‰‡¶¶6rrr„–~WˆË€0(cÖÓR(±ÆÑÑÊÊÊ8wîœÈmw¶Í;Àlý/uòÙ³g1bÄ8:: ÕÎîÝ»ñŸÿüÙÙÙBµÓºúý™¸?âØŸà!þÚšÌÌLüòË/Bt666Ʋe˰yóæÓ_ ßÿ555X¿~=ÓR( …B9혘˜`ݺuX¸p¡P£Æ;:K¨³m{×tgâ íõ­?#nÛuvÖ—8QVV†… bÆ 022º½]»vaìØ±˜5k–ØÓŸºëë­ÿï*ðEü è»Ö®:Êâ^p8¬Y³aaa Ä!C„nsòäÉð÷÷ǶmÛðÙgŸËå ÝfwéÉýj{Æco&,[_ß6ÝÖÿwå£]7Ù“<.î ô<Ûš«W¯ÂÅÅ3gÎÄöíÛEbsË–- „àý÷ߪÞÐúÑ×ôzK_}´£²¡»×µ¾–iß={ö,~ýõW8p@bÚ¢æ½÷Þ‹Å‚¿¿¿ÐltUG´EPG®tµíqw4õT» Ù¹s'V­ZuuuFìS(’‚ŒŒ þýïcïÞ½B?6ˆGwê=¦Êq©“Ùl6öîÝ‹O?ýÒÒÒBµõÎ;ïÀÅÅ>>>";ú­£þXW¿¿¨îO[=]¥ô´ß×›qÎÎt¶MŸÉ6d}}=,X¸ºº ÝÞ·ß~‹¤¤$|ÿý÷Bµ#È1€žÚé¨ÿ/Îm2I[€„„|òÉ'Ø¿?äåå™–C¡P(ŠÈi7öìÙƒQ£FañâÅ`³ÙBÐv»ØŽÍíMtINér´uº]Ùì.í]ßÝ×Ú;­7ét¤G¼zõ ‹-‚††vïÞ-m‘““CXX $$$ˆÄnW¿qOý©'÷±;¾Þ½ñ«îÐÑu}ñSaåAÜ7QQ^^OOOáüùó033™íE‹áäÉ“øÏþƒÙ³g‹4ئ/ù¬íçÚ{¿/ù®u½Ô•¶g·µ¦®luGwkhže>ÏòhllÄŽ;àææ†ùóçãŸþ”T‡Í,2tèP"88ÿùÏ„f§'ù«#Úúzoë6aúhGvÚ˯ÝIKœ|÷áÇXµj¾ÿþ{ØÙÙ Ýž¤"//ï¾û_|ñ…À¢{RG´¦·y¥í5íåƒö4µ§§7Úí×AAA¸{÷.¾ýö[¦K¡ôW6lØ.—‹ŸþY`iöµÝÞQýß²HPýëö´‰ªNþé§Ÿ %%…ÿû¿ÿšÖøùù¡¸¸>>>hhhº½ÞŽÅuõ¾¨ÛL½í÷µ~½½þdoÚž­_gê÷hhhÀüùóQQQ!²#&ÆŽ ???|õÕWøë¯¿„j«/c}kh/ýÖ×õ¤MÖúR†JÒ˜5ŒŒ xxxÀÇÇ .ª- …B¡PÄ•G§åää„ÀÝݵµµBÁk<´þíèõî¼×ú3‚²ÙÛïÒÝ×ÚÓÜ×tz󺢦¦nnnHNNÆéÓ§!'''p¡¬¬Œ¨¨(Lœ8vvvøòË/ÑÔÔ$T›Ýñ‰žøSOîcwíó>×ÕwhïÿÞú|_¿sÛ×{«µ;¯õô·ík9Ð[.]ºSSSþøcìܹSàé·½Wmßkûûó£:»g¥×]=ÂòÑŽÒiïó}Íç¢ôÝ[·nÁÉÉ o¿ý6¶lÙ"T[ý¥K—B[[¾¾¾? '¾#h›]ýßž¦ÞhÆ÷yüø1Ö¬Yƒ;v@UUU`éR(ý™AƒaÏž=øâ‹/vÜcwʬÞÖÿ]•E½m[vW›°ËâØØXlß¾ûöíÙ8ʈ#píÚ5$&&ÂÙÙ¥¥¥B·Ùßèê}AÞŸö|¢3­ýßVW_¾‡8ú+ÒÒR8::âÞ½{¸zõ*FŒ!T{­ñòòÂÞ½{ñþûï ¥Óšî”íý/¨2¨½÷Ûû¿£Ïõö;öD¿ ~QøîÍ›71mÚ4˜››ãðáÃB³C¡P(ЏÓéµqãÆ!::pqqAYY™¨tQÄ”²²2̘1Ïž=Ctt4´µµE®aøðá ÅðÓO?aêÔ©HJJ¹ EPTVVâý÷߇»»;f̘äädXXX0¦ÇÂÂÉÉÉØ²e ¾úê+XXX ""‚1=ЏRPP€%K–`ÆŒ000@ZZ>øàÆô,]ºÇŽÃÎ;±qãF‘ðtFW«)¢#$$3gÎÄìÙ³qòäIÆvÌ$¤¤¤„ääd|üñÇLË0°óOee%æÌ™'''lÚ´‰i9ŠDñî»ïbíÚµðöö›cõ"˜?>>üðCÌ™3G¤¶qëÖ-TVVÂÖÖiii"µO‘\ÒÒÒ`mmêêjÄÇÇCOOOä>þøc9r„0w«¥ôNŸ>·ß~³fÍÂÅ‹EºxB¡P(q£Ë}jqóæMTTT`âĉ ….Šrùòe˜™™¡ºº±±±022bL ‹Å‡~ˆ‡B^^–––X¸p!ž}ʨž¶“Í=Ù®’Òwêëë±aÃÌ;«V­ÂßÿMÁz€––‚‚‚ø»lˆÚw[oI;)))““dddpìØ±ÿ{P(½aß¾}Ð×ׇ££#rrr˜–3àÈÎΆ½½= ±wï^F4ðÚ­°´´Ä?üÀxÀ(E|innÆ®]»`ii mmmÄÅÅaܸqŒéY¾|9._¾Œ³gÏÂÒÒwîÜaL E|)//Ç’%Kàëë‹>ú'OžÄ Aƒ˜–E¡P( £të°Zmmmܽ{...pssÃúõëEr–˜¸Ñz ®£G¤¶¶ëÖ­ƒ»»;fÍš…;wî@KK‹iYZ:²ÑÑÑ8}ú4>|ˆ &`åÊ•ÈÎÎfZšD3P}]TÔ××ãÇĸqã°oß>lÚ´ OŸ>żyó˜–özzz¸ténݺ555x{{ÃÄÄþù§ØÔâp<ÓÐ<+¢¢¢àî'"11‡ÆãÇáááÁ´´×pwwÇÝ»wÁáp`nnŽC‡‰§Ët¬¿×…¢&)) S§NÅÎ;±cÇ\¿~ÊÊÊLË‚‹‹ ’’’ ®®ŽiÓ¦á³Ï>›1 q` çƒsçÎÁÄÄQQQ¸tévïÞÝï¿3…B¡P(Ý¡[A   €'NàÔ©S€¡¡!Ž92 V„¶=˨½G‚ËåâÈ‘#000ÀéÓ§qúôi;vLìßX,¼½½‘’’‚#GŽ &&úúúðôôÄ•+W” Šæë¢"==›6mÂØ±c±}ûv¬Zµ ™™™Ø¾}»Øå«¶ØÚÚâܹsHKKÃôéÓ±aè««cõêÕˆ‰‰aÔ'¨oÒ<+L233±sçNèééÁÉÉ 555¸xñ"=z„åË—‹íªjcccÄÅÅá_ÿú6nÜ+++DEE‰TCoýúsßÈËËÃòåËakk MMMøà0-"bòóó±víZãîÝ»@tt4 ™–Ö., k×®EFFæÌ™ƒõë×c„ 8uê]4€xøð!<==1mÚ4°X,ܺu ýõ—X[Q( …"V>ššJ\]] 2eÊHš››û’$…Aš››I`` ™2e @\]]Ijj*Ó²úÄ“'OÈ¿þõ/¢¢¢B¤¥¥‰³³39tè)))aZ¥óêÕ+B–.]J‰´´4ñòò"W¯^%\.—iy'==lÛ¶hiiD__Ÿ|üñÇ$<<œ4662-BéiiidÏž=ÄÞÞžHKKyyy²xñbrýúõ~Ó¶¹~ý:±°° ,‹¸¹¹‘7n0-‰"233ÉÆÉðáÃÉÈ‘#ɾ}û›ÍfZ–@9yò$éc·E`ÔÕÕ‘+VdÁ‚¤°°iIýŠððpbllLäååÉñãÇ™–C¡¼8•G}%00(((CCCδœ~Ãõë׉¾¾>QPP LËéMMMÄÏÏhiiâííM¢¢¢˜–E2QQQÄÛÛ›ÈÈÈmmmò×_‘¦¦&¦eõ˜ÌÌL²téR"%%EÆGöîÝK***˜–EÍÍÍ$88˜8;;ÄÒÒ’\¹r…iY …B¡ˆ5é½&$$ùóç)))¢««K8@*++‘4E”——“]]]"--MæÏŸO˜–%PÚ›”åäåå1-Ò¨©©!ÁÁÁdÙ²eDII‰HKK'''òÛo¿‘ââb¦å‰.—KîÞ½K¶oßN¬¬¬‹Å"ŠŠŠÄÇLJ=z”äää0-‘BáSUUE.]ºD6nÜHtuu ¢¡¡AÖ®]K.^¼Hêêꘖ(8 %NNN177'G%õõõLK£ô.—˸•––&:::ä§Ÿ~"ÕÕÕLK â8évñâE¢««K†NöíÛG˜–$Ñäää___€xzz’ììl¦%Q(í"ŽåQ_ÈÉÉ!žžžY²d ÉÏÏgZ’Ä’——G.\H¹sçJä8Ccc#ù矈­­-@&NœH:D'TûåååäСCÄÔÔ” vvväŸþéÁûOŸ>%›6m"ŠŠŠdذadíÚµäÞ½{LË¢€¢¢"òÃ?"%%E<==ɵk×úå" …B¡P ‹Á ôìÙ3ìß¿'Nœ‡Ã‡‡–/_ŽY³fAZZZPf(€ÃáàêÕ«8zô(BBB ++‹÷Þ{›6m‚®®.Óò„ ›ÍƵk׈K—.¡¢¢FFF˜5kfΜ GGG :”i™1‡Ëåâþýû¸~ý:®^½Šøøxp¹\ØÛÛÃÛÛóæÍÃèÑ£™–É(EEE¸téBCCŽÚÚZèèèÀÞÞöööppp€žžÓ2)„ŠŠ ÄÆÆ"::111xðàÀÒÒpssƒ……Ã*E˃°ÿ~AVVÞÞÞX¾|9ìíí!%Õã£(" 33ÇŽC@@233akk‹M›6aÞ¼yýº­€Å‹‹ÝY¦ ؽ{7öîÝ lݺkÖ¬ÁàÁƒ™–&1äææb×®]ð÷÷‡––~úé'¸»»3-‹Béq-úJHH>úè#aíڵغu+ÆŒô,‰ °°»wïÆáÇ¡¡¡Ÿþ¹_”cIII8xð N:…ææf¸ººÂ×מžžt¼D¨¯¯GHHþùç\½z222ðõõÅúõëannδ"ô €ÖäææâÂ… ¸xñ"¢££S¦L££#œaccƒ!C†ˆJN¿¤¾¾qqqˆŠŠBTTÀb±ààà€9sæÀÓÓ“Nü÷€ªª*ÄÇÇ#>>qqqHHH@MM äåå1qâD˜››óŸÍÌÌè¶x—ËųgÏ””„ 92õ¨ªB´4LMM1mÚ4ØØØÀÖÖ¶ß—Á$/^¼àOâòžóóócÆŒ‰‰ &L˜ðÚó@Èhð&û322ðèÑ#þsVVš››¡  €I“&ÁÒÒ’@¢§§‹Å´t‰%;;/^DHHbbb@Áä©SaóöÛx{êTØÙÙÑ Àáp””„¨¨(DGG#66•••˜0a<<<àáákkë7ñßI›tkhhÀéÓ§qèÐ!ܹsãÇÇ‚ àãヷÞz‹iy"…w ×éÓ§qñâE°ÙlÌ›7ëÖ­ƒÓò(”#iåQ_àr¹¸~ý:~ýõW\ºt #GŽ„··7|}}1mÚ´S/q¹\ܼy§N™3gP^^777¬[·3gΰmÍW¯^!&&¡¡¡ ógÏ   [[[ØÙÙaúô阞•Þ ***pýzüýkqó¦ êê ¼~p¹¹¹9,,,ú]Y'Lš››‘‘‘û÷ïãÁƒ¸ÿ>îÞ½‹††Œ?vvv°··‡ƒƒõ[ …B¡P„cAmyñ⢣£…;wîð·òUVVÆäÉ“aaaccc˜ššÂÈÈhÀmÓTWW‡´´4¤¥¥½¶íqee% sssLž<pÒÓƒÊÿ p8ÀÂ…À‡––L~Knn.>|ˆ¤¤$¤¥¥ñ'™ëêê#GŽ„¡¡! ¡££hkkCKK ‘‘aøôJJJ——‡¼¼<äææ"''‡/rssÁår!##ÀØØfff077‡‰‰Éÿ¶¢­¨.]‚ƒ+W€W¯[[ÀË«å1n³_”‚ÂÂB¤§§#%%ÈÊÊÂãæføú‚»nÀá@YY™ ££ƒ±cÇBSScÆŒ¦¦&FM'+EÌË—/ñüùsäççãùóç(((@^^²¿°°?¨®¦¦Æì044ä·ÆOËLADøÀ9C,°€zEbcc;wî )) µµµ——‡¹¹9,--abbccc˜˜˜ ÈI¿††ddd ##©©©HNNFbb"ŠŠŠ -- cccXYYaúôétð« $yÒ­¶øî;`ÿ~@Cã\]Á;¸ÿ> {{{8::bêÔ©˜Ä°aÃààà777Ì›7£GfZ&…"$¹<OŸ>E`` ®^½ŠøøxHIIÁÎÎÎÎΰµµ…••†δÌQSSƒ„„$$$ ""7oÞ—Ë…­­-fÏž oooº@¥p8@Xàç\¾ Ôˆ¥Kw"55III¨®®†¬¬,LLL`nnŽ &ðûåãÆðGÃ455!++ éééüE ¼1¦¦¦&(**ÂÂÂ’òÅÙ³–ÈÉ‘† °r%àë Ð9êžqï^‹¿þóO˰ÏܹÀÒ¥¯0hÐMÄÆÆ"11÷ïßGqq1¤¤¤ §§‡I“&ÁÔÔ†††022‚¾¾þ€8¤#!ÈÍÍÅ“'O‘‘Á÷Ûääd444`èС077ǤI“0mÚ4LŸ>cÇŽeZ6…B¡P(± hKSSRRRp÷î]ܽ{<@ZZÀb± ­­ ###˜˜˜ð'UyIëpò¨®®æO\fgg#77iiiÈÈÈ@nn.!6lŒŒŒ`aaÁß1ÁÔÔ´ýÎRuuK Ào¿©©À”)-Á tK6¡CA~~>úñãÇxüø1rrr››‹W¯^¤¥¥1fÌhkkCGGPSSƒªª*ÆŒƒQ£FaÔ¨Q9r$Ã߈9êêêP\\Œ’’”––¢¨¨¥¥¥(,,äOøçææ¢¡¡@Ëoª®®ŽqãÆA__Ÿ¿3ƒ±±1tuu{¶ò ¾¸zµ% 4´%@À¢¥w8o`j*¤oMé.MöØ @ÎËCÍ“'¯­$ÏÉÉAaa!JJJøƒ¶ÒÒÒPSSãhhh@UUªªªü<×ú1P·úìŠÚÚZ””” ¬¬ /^¼à?JJJP\\üÚ„?/€¢¢"ÆŽ mmmþdë$q"¬¿Pà8Z&ÿÓLAËÄÿBµ8222øAŠ÷ïßGZZ×UUUL˜0FFFÐÕÕ…––ttt ¥¥uuu|+áÀk»ñÚo¹¹¹HOOGzz:rrrÀår!''XXXð«077§>Þ$qÒÀßøâ  ¡øæ›–f8/†©¬¬ ¸rå bbb••L˜0ÖÖÖ˜8q"ŒŒŒ`ffUUUf¿Ìáp8ÈÎÎFJJ ÒÓÓñàÁܾ}ùùù••ŤI“àì쌙3gÂÖÖ–®ô¤ôK$±<&UUU¸qã®^½Šèèh°t)ÐѰ[QQÑk+ÚSRRææfHKKCGG‡¿ð‡·àGSSZZZýÂwkkkùco<ß}úô)âŸ×ÏWSSƒ‰‰ ?XeÒ¤I000 ‹/( …Ba± h.—‹œœ¤§§¿¶*>''%%%üÏ©¨¨@[[cÇŽ…ªª*ÔÔÔ0jÔ(¨ªªbôèÑPSSÃðáá  EEE¡mÌårQUU…êêjTWW£¤¤„?QRZZŠââb”••¡°°999ür=z4ttt^[EÇ‹ŽîÕDTL pèpî\KhðÊ•ÀÚµfgŒââb~#š×ùËÎÎFaa!Š‹‹QZZŠææfþçeee1jÔ(¨©©aäÈ‘PRR‚²²2”””øóþç=ËÉÉaøðáÐÙñÆÆFþÄtaa!ž?޼¼<þ$õ‹/PVV†òòò×®“’’z- @II üzDQQñ× //ÏÏLçöðòess3jjjÀf³ùõUee%ªªªøuXmU*kjø¯µžìç4ñ:t(FŽɯo[ï¾0vìX~¾¥ âG€ßœ –IÿXô!Íââb~@cjj*玂‚~7xð`hkkóƒàFŽ UUU¨««ósTUU1|øpÈËËcèС}ýªÒÔÔ„ÚÚZTTT ¦¦EEEür¡u;®°°¹¹¹¯µÝFmmmþqFFF˜0atuuéî}DÒ&Ýnß6o[•¿þºãAe¥¥¥¸}û6pûöm¿š••…ŒŒ °ÙlHIIAWW˜:u*lll`aa!Vu…",$­<5eeeür,>>>ÄË—/´Ô“&&&¯ò&ÊxeY_ëËææf”——ãåË—ÈÏÏG~~>òòò““ƒ¼¼<¤¦¦¢¬¬ @Ën}'N„ lll`mm-6 ’@CCK·ø¯¿ZºÈêê-ÃL+V=Ùܨ¡¡áµ…xöìòòòPTTÄÿÜàÁƒ¡¥¥…1cÆðÛ‹¼o¬oäÈ‘——‡‚‚†.ôö¯UUU…ÚÚZ¼xñ¥¥¥oGñwCãõX,ÔÔÔ ¥¥===ó/öø¸ òr øóO 906Ö¬/úÁ´@ˆ‚‚.÷vv½K¯±±™™™HOOç/úáíBYTTį'x}uuu¨««·ë·ªªª——‡¼¼<”””„¾¡¦¦uuu|¿åõwx}Þk………xn­ IDATÈÏÏm|DII ššš¯ƒjddCCC8E¡P(Š"QAÑÐÐÀ_…Å[‰UXXˆ²²2ñ3MMMo\;tèP~c‹w†´¼¼ük“ˆ­ƒx'Ð:( ±±µµµüÉÞªßÊÊÊ×:­ÿæAAee%Ò¼½¡”“ƒ1‰‰ðÚ„%Öƒ2¼¿‡ 999(**BFFŠŠŠü÷†Οðï7çþ%'· <|¨¨-A³fÑ#8H€¥ؖĉºº:~`@]]?ÿñžyA3¼çÖHíåEà“5miÛñçÑv€@YY™?Ä«³xϼ999þ ÃkaEE-£FqqÀ¾}Àúõø•(LÂàO!dѲêÿ=â¶sè«W¯ZVì:„áaa¸ùÍ7¨«¯ÿß.µµxõêÕy§í XÛ¼ÂË#<ÿçíÜ!//ϯ£†555º¢E ÷I·Š à»ï€_~´´€={ZâûÄ–--»xÅÅo½õÆÛ¼mY_¾|ÉŸÄç=766òû4­¿Z”ñòorDEE…ÿÌ›¬è7m4 E€ˆ{y$iTVV"??Ÿ_–µ.ÏØl6.^ô‹Å…Í!~0/hY¼!''Çà•c#FŒ€¦¦f»Áµ”žóäIËöé-ý?{ç&E™µá{È™$g‘( "A’Šaꊨ˜ãš×°º®áøfW1!*1¢€(’Aœ$Œ$‰30L`B?Ëî&ôÌtwu8÷uÕUÕÕÕU§«ÞJïyÎ9Šø5*<¢Ìsrrþr¨>|˜Ã‡sèС¿ÄnIII½så}fÌO í8]œ !§?#>>žªU«R¥J•\Ï‘ŽÓ?XÙF‹KZ|ú)Œ?þññŠ~¿ì2E¿GkC'KÅ{ïÁ¬Yúß—]¦6Û­›ÛÖå&+++WÛ=räü«í:b圜6nlÊ?\À°aOR¾|Æ1"ç¼"hß¾ê5jP¥J•¿Ú¯ó X­Zµ¿+&ð4 Ã0Œè$æD¡`:0ø…ҥРŽ4öí·aÓ&=_w\zip¥±FDÐ ¸E]~²y³Þ:§LQ¶€Ê•aÈyÎ9Go¡F±ñ¯÷+h"²³•ÏzôheŽyóMkÇH"Šø÷Ïé^ÀuÀpàX)I˜Ñ³§zœÇsÛÃÂÕé–‘¯¾ O<¡ä?>ªè²RGÙMž Ã‡ÃØ±p啱Õ0ŒÀ®×£h¥E ¸æxøa·-‰=vî”yÂEÿ7jäu ÷èá¶uFqÙ¾]BŽ?TüBóæÒy n[Wz<˜3G*>ùRS•¥âŠ+Ô ‰OG†7Þ€ÄD·-1 Ã0 #’0@ðn(ÅnÄà<5¿ý6Lš¤y_¬r}ûF¯LØ(”V(Òú~· ‰TvïVÉ€)Sà‡t  GêСРÛF‡€k)À¿+¶à?ü ž¿Ê•Õ+ؽ»ÛE¢ýß¾Ž.GÎÿ\´«X¬^ :¨ýõïï¶5† „›Ó-'GÌ÷ß{÷Â]wÁ}÷OðUÉY¿N>Y×Ú×_À Ã$áv=Šf~ÿ]ÙUfÍÒë“|’“¥C?^‘ãÕªÁ…ê–Ô¿àÓýî°r¥ŽñGɡܵ«Òã_z©Ä‘Ķm*O1nœ*4v꤈ÿ#Â#KE :Tb†‰ݶÄ0 Ã0ŒH"vìP²™!C n]øûß!%EóvïÖmè‚ ¢#…ºQ0eÊHcûÖ[:îŸ~ µkë¯qc9ÙŸ¶nuÛR8xPÏ]ƒC“&zmÙRâÌíÛegÇŽn[<¶nÕ1:ùd·-1 Ã0 #Ò0@¨Ü ¼ ¤¸lK©éÔIOÔ‰‰ðý÷pâ‰Ê и±Þ?ø@oŒFTr»P…*UäIxÿ}uøÿ½dÝcÆèœkÓF¹…,PÞáä1”¶üz”À '„eʨ8ë¬Y‹uî 3gºmULrx 8h‹ÒþE¢™(3Q„eõÌÍìÙºFŽé¶%FŒ2côî­z² ÂÒ¥Òðxb€7ôòËê}?^¡x†a1Μ9Jšf†_U´w÷îд)üóŸÊbóöÛzÔúî;5Jñ FìQ±¢„'zãZ·V¼BË–ÊðİvmèlJI ¼Uo»MíóãÕf?øÎ=ÊGœÊ¹ø,^¬Ì(VÏ0 Ã0Œâb¾½ r#ªÅ;ÖmCEÙ²’ÝŽ+ êøñŠRºæå1¦N…Œ ·-5Œeþ 2åËëÜzýu¿œ7Î?_oÞ½z©—æ–[ä‰ÈÊrÛÚ “ \ <šÿÅÒÿ‡-ýú©Gñä“áŒ3àÞ{áèQ·­ŠzRIÀ0$޹h|ƒ¢þŸº¸f]€ùâ *mÙÒmKŒcölEÇ~:Ô¨‹)Ú¬k× llÞ<]?yD×RÃ0ŒgçN%G<ØmK"—¬,ito¿Zµ‚.]”æ½{wuÛìÝ+‡ïÈ‘P§ŽÛÖáDåÊŠW7NÎöéÓõº÷Úk ¡>(ad +Ã¥¦ªä’K”Òÿª« ;[b•Ý»õÝEÉÆXbÁ P-3Ša†aÅ%Îã±b¾ÁäV`:°ž(V\8Ÿ|"QÀ¼y’“Ÿ{®œ˜g¥úçFÄR9b/sÛXeÅ øüsøì39[kÕ’~Ø08ǫ́{û=\,BNNë÷‹ Þyî¸Ú¶…?„öíݶ(ªH¦Ÿ¢ÔþéÀ”-ãB š{¦GÑ×^+稳L˜0#Fì×–œéNž~.T]ÜGU&€ ±gò]wé_}ee/ #Ì Õõ(ÖyûmøÇ?`ÿþ¨{Ý *¿ý¦s3f(a×ÁƒJ‘þ·¿ÁyçAv›1JNNŽºü¦LQ÷ÄÖ­ŠÐþXÿŒ ͯTIºÇ .PůOfÆŒ‘H5)ɺM Ã0 Ã(>&=€VÀ'n¤¦Jüõ×ʶ}»¤þg%'Ñé§CíÚn[iÉ@<&ˆ(RS•oâDc))Êg|ÑEÊЬ™Ûæb/prÁÌ$Ò›ÇÉÉpË-0~<\}5<ÿ¼rÆ0©Àr`)°ø Ø ÔDb˜Ó¡@#—ì ’“Utòd…1Mbb" .,Õ:¶l‰gùòÌÛŒÄÄš4mzˆ·Ð¿ÿVªV= Ký£ú®] zà~ïÕ‹¥7ÜÒm††‰b®pï½zY»ÖmKBÇÁƒ^‡ÿÒ¥šþýw}wüñŠ™èÞ]¯u=zœbÝ0Üäða•˜3G]K—ÊiÝ£‡"Ø+WV÷ߢE°c‡²Xtè ví´íví \9·ÿIx1j”*¯Îœé¶%†a†aD"&Ÿ#€õH `ø°bL*AÀ¼y*Ы—C†¨¨˜Õ”v…@ä¤êë²-F ÈÈP>¾É“áË/åTëÙSb€‹.‚-\5/™Ü%,a|óÙgpóÍÊMú曺¶G!9À~tí<€D.[þ6›€ (ëE Êtаþ.¾ýVÏ{÷J `Å 3SQgK–¨£yÆ u:7içž W\¡GMWHMUOw… 0w®yr Ã0|ÈÉÑ+ʨQðè£n[†_~Ñ=Ê6mÒwM›Êáߣ‡œþ=z@­ZîÚk±m›+?ÿ¬aùrÈΆ6m`Ð 8ã 80 xb",\ hX¶ ÒÒôxt  tì¨q‡вeìv &$¨¢êèÑn[b†aF$b"€‘´Î^vÙ–°&)INËo¿Õ°{74n¬,C†(K@n[3$Í9(5µÁ=ª “'+/ßÁƒêUºðB• hZyÒQà,ä„wÁ# ìÛ·Þ Ÿ~ ×\ÿýoȯç[µÀ*Ôöv#GýH”pݳªE¹ç|—ÏKÑßòÏ¡Ð9ÿ[”Àþ˜âÁ᫯`åJ·-1\äðaÈÊ’†-'G·®ìl=.&'ësR’†ýû•zö·ßÔ±œ™ ǧ[]Ÿ>z” ]éå—ëwéRhÞÜec Ã0‹T ñuëéìÚ«WëqƧ­[§{Z½z^G¿3®oiÑŒ0$+KB•Õ«å¬_ºTmyß>Eówê¤ ^}úhÜ õý23Uó~Í/«Wëó¶mŠªZUÎðÔuѪ•Ê…´j¥Ä¢ÑJr²¥Nš¤J†a†aÅÅD!ä9àQàw”bÝ(‚œ½]|û-L›¦P®råôf1dœsŽÞŒ áˆæ£hU#JÈÌT.¹É“aÊyNºv•ࢋ$Ý"`$*31èÔ­aÇĉT® o½%qW8L¾fÛÿœß H@â“( Eœû¼Z·Nϋ۶É&®ÜWкµt–Mš(¦(’³i̘¡×å]»J&®0 Ã0 Ã0@IBއ‡{]¶%"Ù»W…ŦM“0àÀõî:‚€¡J·­Œ*6퀘£6jÉʂٳå˜2EçYçÎpÙeð÷¿¥wêßÀÓÀ7ÀÀ€¯Ýˆöì[n‘åúëáÙg¡zõ€¬:˜¼LA©÷{§ƒP$¾å“ s22”7tìX]‡Œ¨cñbøä Û·ëñ­[7¥mÝš5SÔSíÚj åÊ©ƒ·lY9û]æ/ Ài§)ËÅ#¸maFØ‘™ Á?ÿ ÷†i‡É¡CrH®Zåuô¯Z¥† {”“¾¼CÅ,tìÝ‘ÊFxãñèÕkÏعþøCíu×. ‰‰rúïÚåýM:êjkÑBNÿŽõŒ–>UŒ²³õ éHóŽô.[¥Šy…kºaC uë†gwâèÑðÆ:N†a†a%ÁD!æ^`<ª&ÏΑIv¶2L›S§*·^ŊЯŸgŸ Çï¶•ÏJ &ˆ²³•ƒóÓO% HJÒ9uùåÊ_1¿bò prÐŽ*õÚŒˆç“O” Z5xóÍReÈ>6!ÇÿµÀE˜Ó?âXµJ½«W[ÆŸ(ã›oà‰'`Þî¸c?ש#±O­Z*T(؆@0t¨º:'N îv Ã0 È^Lbv¢ºÀ¯×»lKT±{·z–§NU¾¬äd‰Î>ÎüP Î=W‚€³Î*QÀ6T ý<$0 @=S·ÞªB‡#GÂsÏ©WÊO<ÀÀ¿Pö’+;ƒb¬&MR€#G‚ß³f„„ àÚkáçŸu yðAèÝÛm«BDv¶²Vmڤ׵k»m‘aFXrÑEŠÞ93¸ÛÉÊR*ñüý›7K Ê>Ó´iîÚã'ž¨¡eËÍJcD$ÂúõJÍ¿~½†5k`Ëoé¤*U”I©Ao´{£F7h ¡aÃðŒvw‹ÌL½ŠîÙ£ñ¾}ÒmîÝ›ÿç””c×QµjnQ@ÞéÊ•5]¹²†øxý¦ree¹ªVMÓ%ÅkØî¾î¹'¸ûÂ0 Ã0ŒèÅD.p0X‡Õ  YY0w®ß~«ˆÂòåáÔSáŒ3`ð`圵(¬"™ôFÎÛf.Ûb¸Hr²Ò¶ø¡2ÄÇ«—nÄÕíö£ì(Ð÷Ïñ\ÀúŒcøê+•8rDåF*²mm®Aéÿ‡¡&F„3z´JlÜè¶%F)ñxàùçáᇡ}{3F5dcŠ„^гéI'¹maFX’˜(Gû¤IpÞy%[GV–7åù®]Šp¢}4è;vè³·–¸3ݪ•"¢Ë—Ü4 Ø¿–,QâËÅ‹5í¤ê¯ZU™”N8Á;´k§(þ$í3Š =]‚Œ¤$Á÷³ïtJŠÆiiQAT¯.A@µjº6•)¿ü¢jRÍšå/(¨\*U’h©F ïzÊ•S܆#ú¨UKãªUMcm†a±†‰\`#p0¸Äe[b‚Ý»áûï½ÃîÝŠÂ^ó*UÒ2ÑÀ?ÿ©*Q¿ý&gVR’wHN>v:9Y {öèõä?4øönU¯®(èúõs7ö:ú;νÿl hó„Ù³á‡áïñȱ߳'ôè¡jB'œ Ì–"²IMÕ}%9YÚ÷ÔT8|XCZš^‡ÒôÒ¥zúûßáèQ]ûœß;Óúœž^<;|ï75kêåÜS|ïWÕªI U¡‚¾÷.ß{•ï= ¼÷.È-Tð]w^{@Ë•õ‰šsD †a†a¸ÄŨfñRÀžáCˆÇ£Ìß}'AÀœ9zrnÛVY ’ÌÖž0øèâ _ÔˆEV­‚ñãaÂ…ïtëW]¥"ÏuëþµØ| rÔ^á’©F„±t)Üp¬\ < áÏÞƒýÀHà;$x(~q #¬éÙSYFž{ÎmKŒ²g ¦dS¦@Ÿ>n[ä›6)íÁ…Â;VÇ0Ez:8 aÿþc§““åIM•“$=Ý;íYÜ^¼Ž _§GqÈΖƒÇ¡$Λüpœ8åË{«à9Ñ ¾Ž—üÄp¬sJ1êˆ(23åØÊÉÑñï18|Xέ+´}ßeòR¥Šþg|¼w\¯žRž7l¨tçyÇ–öÜGrr`áB%®œ6Mºú¸8èÒú÷×pÊ)&P1T`æLX¾Ü¿å}ï/‡+㉯`íàAÑu7+KË®»99Þ{’ïµØYhýÙÙšÎ+†+HDçñ¡8ä½_å(ä½?ûŠ À{¿„cï…¾÷=ßß9÷SÈ-Pð]—¯0ÂéRö]Ab@Ã0 Ã6&p‰_Pmìo€!.ÛÓ¤§+=«“%`ùrïØ€0p NOJŒ18HìYÕ(œz;V9<32àì³aÔ(Žž}6'•/Oà[·í4"‹¬,xå…7n cưæ´Ó d§¸l¢$êÕÓq¿õV·-1JÀ¾}z|:zTÜ­[»m‘ ¤¦ª UÙ²zÎ,‰§Ð0b„”êÚIÓ¾w¯×¡¿oŸ×Éï8ú󋾯^]öšF IDAT‰ÞêÔQg{¥JêȯYSÎÇyìL;Ë8ÓNjåÂ"C…¯ƒÅ× ãë¬II‘cÝ÷{_1ãèñuÐ8ëÍo=y?ç,Çã8h|7Žƒ¤zuX½ZŽ®‡’3ß©©×áo)¬H%-MÏD_|Ó§ë:×¢…^™‡ Q—S¼E]yèÓ:tPr¼hÂÉ`Ç ¿|ïCyž÷/8V„à»^È-^€Ü"…¼ÛuÄj w˜#GŽÝ†¯°¡´>ßû¡#(hìÜ/óö»øx¯ðÀ†a±‰\äL ˜í²†û÷+Û¬YÞ\låÊ)*Ñôê3¹ŽàVÃÝð“”õn¼÷̚ţO=ų·ßÎÊ hÙ¡ƒÛÖ‘Hb¢œÁ_ÍGW\ÁÇO>É[ RÏm»ŒàQ©’Ò§_~¹Û–ÅäÐ!%VÚ³~ú š4qÛ"—¸òJøúkòmÙÒmk Ã’“½µÙÿŽÞy;wjðíD¯TIɤ‡~íÚŠ†­]Û;8ó}?[ÝöÈÅã‘þ¾gOxóM·­1ŒÀ‘–ß|'*¥{zºª{®œÿ…TÒ3 ²²ä´}ùe¸æ·­1 ÃW|àdY€‚3(8Y!‚#¸+hìˆ û ŠÂÉT£†„ŽŽÒ™®YS¢½*U$Ò«QC‚¾jÕ´\|¼æÕ¬éýÎ0 ÃLà"?y@/—m1 `×.g›5KÃæÍê:õTɵûõS…oî©(b0Õß6Œâ²n×.ºÔ«Ç“Ï>Ë< b†£F©¨]ƒn›gD/?OžÌëwÝEà?ÿÛn³°h$=]½ _|C‡ºmQ Ž…³Î’~rÎ8þx·-r‰7Þ€›oVÈßYg¹ma…´4زE:½­[aÛ6Mÿþ»ê²oßž;:¯B=ú5n¬q“&ÞÏ zӹשãÚ_2\bʸøbehÛÖmk £tdgÃŒðá‡z”=rD]FÇ«:Pýún[hD K—ªªÔªU&1üÃä;™ œñ¡CzŽ;rDÙRS½¥’ŽÑô¡C¤¦jž#\ÈK… ^A@~"øøÜÂͼ‚N§”‚a†\Là2§õ€/Ý6ÄðmÛ$˜=[!n[·JJÙ­›ruõë'ywíÚn[ÆW£Œ†Q\†‰ÀR ìüùÊðÉ'z9óL¸ê*9ùBgÕˆ(þ< Ü—–O? Ï<#ÏÁsÏÁyç¹k XöìQéìÙpÚin[cƒÛo‡wß…yó¤ùŠI-’Hô$V2Œåða½ölÝêuò;Ÿåèw¨YSi­›5ƒ¦M½Nþúõõ¹^=s|ù“ :é5zÌ·­1Œ’³n^u?ø@Nzõ‚Ë.ƒ‹.2í»Q2ÆŒ{ï•cÖ¥F8pø°ÄÉÉœé¤$ï<ßù‡å.éä”Xð%>þØ ON¨ºuuý¬_ß;m% Ã0J†‰\æK`°èä²-F ؾ]b€ŸÖxÍ_JH  O‰š5sÛÒñ:ð°ßmCŒˆcÐø8Ý÷‹´4øòKxÿ}D¬Y.¹FŽTo‰aü‰¸xøp½ï—‰‰pÿýðñÇ”ü÷¿ºî‘ÏÆ üåèÚÕmk ?ùàeÀÿäE»Å${÷*d«}{e([Öm‹ £@rrt+ݸ6mÒ°e‹×É¿ßçá¿N¯“¿E Í›{ÇVÇÚ()ï½§Ä)7JÛi‘Ä0aŒ§ê?ÍšéYèòË-«…QzFÒýxæL·-1ŒÀ‘‘[à û÷çžÞ¿_¯UÎà› bE ê×÷ŠêÕ“@ ^=‰P6”µŠÕ´5 Ãø ¸Œè ´>uÙ#ìßsçz…K—ªPSÆpÊ)œ|²:‰# xÒ3ÀkÀ6· 1" p*P‰ dçNyŽ>ø@9@O8AÙFŽT^X#fÉnÆ〿´à?ÂwÂÊ•êE~ôQóFD:NîËß~ƒV­Ü¶ÆðƒåËõxsóÍðì³n[ãÙÙ*ð»~½Ú°å47€œ¥çwœü7z‡Í›½õkããU¾£eK¯c¿ys}nÞ\u` #Ф§ëÑÿâ‹•àÉ0"ìløæ;Vz¿ò啿ÿòËaà@‹Ø6GB £G»m‰a¸GNŽW °gìÞíý¼k—wzçN}Ÿžîým|¼†Ž0 Y3›4ÑüF,S•a±ƒ‰Â€ÉÀÅÀJÀ⣌#GÍ8o,X a÷n½-vé"a@¯^гgX:;¾V¸mˆQ8×´%HääK—*hÂå8P‚€ .ˆÁŒ82+)H÷·¢~“£ž¸ûï×çG…믇rå‚i¦,V¬€ÎM!¤§ÃI'©eÆŒ~øa) ~þY"Ã!‡+ÙêÕJIíÝït†Ö¨mÚh8þx íÚi|ÜqîÚoÄ&Ï?=&AJ”TÒ3¢˜]»àwà­·$®ê×O¯ª]dB)#ð$'ëº8iœ¾ÛÖFä°oŸ®×‰‰oß;vH$ðûïûf»ªXQXGÛªUî±éº ÈLä.¨»ålÞ Âüù~ý23¡V-èÖMC÷î·l骩w‹€¹®ZaÄÅiN—VÇ&¬]ù¬7 8è|X’ufd(¬âý÷aÚ4åðºðB… [¦lKé•*qqZ? ÒÀâ¬#) žx^yE^'žPø„¯Íá@ ×b­wåJ^±¢x…åm¿ºÂ=÷¨S|åJEUF™í~Û;u*üíoðÆ ù³RŸú³Òì»"O|Vci<HNÎíì_¹RãÄD}_¹²"«G›6JI}üñJ‘ê&‘ÖBe¯ë瀷ç/H„rÏ=pß}îÚH¬Ý”l{áŠÇ#ã˜1ªfW³¦ÿ×_¯ëkI‰´}eíºdÛ+ 3fÀé§Ë‰Ù Aè¶k±@zºW°u«†-[¼ÃöíÊúºî;"ghÛVÏ0ÍšYöÃ0"„ €+€µ@)Þ'ŒH$-M¹t—.Õ°d ¬]«§ŽÚµ½‚€“NRtdëÖ!{Ò¸ØLÉÖ¢„ptDAðìʳÞבxdТ´ëÞ³Ƈ>‚Å‹Uð뢋$è×/úŸ¸c¬-¥V­ÊÐ/¿ä—Aƒ˜œRÒmÚÿúLœ=zÀÿýŸ$áBŒ×b¯wÓ&õ¬.Y¢{_°¶*Âe¿Ÿ†þýáí·Õ)îa`v±(ÒÞÍ›ÕNÏ?Þ}·Ä+ôg¿”tßùõ»BÄ ¥:V‘vÀÄ´49ú—-ó:ý׬Q‡%@ÕªröŸx¢Ò'$hºE‹ð~4Š´æ*{]?ÿø;¹öZUÐ[¾\QxnÚh¬ÝDα*ˆ}û” îÍ7•Y¥O¸á>¼èöê/‘¶¯¬]‡öX-m©#ò3 #tdf*kÀæÍøŽ·lQ7%H|ëÚµƒöí½ÓU«ºù Ã0ŽÅDaB6*Ðð£ шvRSÕ+²d‰W°n„U«B‡tî¬HÉΕç3À j¡šÜF˜W²7Ð8¢#ÓeÀóÝŠRƒò |ú©²g4l(1À%—¨¬F¸E{GaÔ–Ò€sgÍbeÇŽ|W·.]±ÒeËࡇ”QbÐ ‰zö ĚÛ0:®%ZoJ T¯®‚«C†Ö–Òéû5Àdd(aà 'À_ä¿L~»,ª:½SS¡wo-ôóÏÊ\Œíc™@¶S„†;•ødùr=Þüú+lØ GþjÕÔ¡èëìOH³?Ü{¢þüñvB½ï‚¹½TÕ¯Y³à´ÓŽÝ®µ›Àm'šÚM(X¶ ^~YúóJ•àòËᦛt . Ö®»Xh×C‡Jp2qbè¶i†<¨gõµkaýz kתË23SË4kætì¨jÀ;–êuÑ0 £T˜ Œ\ lZºl‹†8aAË—«·påJM'%éû–-õTѾ½†„õÎW¯^âMžœJºFÉ(ÍhQ£g€ß€ –ÎZ³Fb€O>‘8¦ys…f\ziñ"‡c™0jKGó0»:®XõþÅœ9ðàƒ 9:Tb€Òöæ…+at\KµÞªUáÕWaÔ¨ÀÚRR¢e¿§ž‚'ŸÔ%¸aÃc¿/ȼ¨êô¾új˜2EBÍV­‚·— p;5@`ÉÊÒù²|¹÷Q~ùrØ»Wß7k&aMçÎê(ìÔIiüÃ9²¿ bâüñv¢ÅéuèÚø AÊ"ãÏ6­Ý”|;ÑÒn‚Iv¶Rý¿ô’*;Â?þÿ{`"9­]~;±Ð®6„»ïVÉÃ0"ƒ¬,e X·.·8`Õ*=ÿ”-+a€Ï×¥‹+ùaF(0@‘´NƸl‹A$&ª'ñ×_½ÅA×­S˜(\ÈÉz ´iãWqÐã‘0åþ`Ú‰ä~åñ\4.ïò}çÌÏïM³ múKQ=…­ÓûÓ<š{ ÚÁâ×_%øøcåæjÕJµ™Ï;úö…rå‚oCiˆñ¶”íñp 0ø®gON^´èXÛ‹k_ALªÌ+VÀˆðè£Oƒ?®ùÚUœãš Þׇ.|;Î:l¿þ|)„;ô8ñðÃðÏû}a»¬ ³ ;4¾Ëô]ÞuägGqwqAöÊ|ãðÕWpÎ9Çü(ŽÜ?ðx8ÆØ|÷¹Ã \&¯Qìôbퟶí!÷ÿ9f_„i;u“£GÕá·t©"KùEè©©P¡‚z9g¨]Ûm«CLœÿEP’m¶ý¢ÖåÅÝ?…í÷ÒpÕUr´þúkî$vÖn¬Ý„šädxçiN·mÓ­üöÛ%P Ö®­]—„­[õŠú㪀hFdãñH°lYn1ðï¿ëû ¼‚€.] W/‰ƒ Ã0‰‰ÂŒ7Û€M@S—m1"˜ìl9D׬‘ôpíZïtJŠ–‰WˆQÛ¶8ã6mô*0¸Éµ?fçm½$oøyß,‹Zwil/‰m…|~Ýãán 8..Îޞŋá³ÏαfzÔÏ9GÑß§Ÿ5k†Þ¦‚°¶Dv¹rŒ;–É#G2èSÐoÙ–rr”Wñá‡ÕãwÕUpÿýØqõÿ7…Ù8l˜Â¯Æ¾μXدâÊ+aþ|95 ª[Ð.+É./Êœ_‡l vqÿcɾ÷^xüñcv掳þ¯Ï?–ñqðû:áó]Æ/cKÿßùùv|‡q; N/ÇÙ¿l™™™Jçß©“’uí '$Sùòn[\¢úü/‚`m»´¸ œÿÅdüxÝ?~øA:]lÍ;ßÚMìµ›@³q£Rþ§Ï£FÁm·©[$X»¶v]\&N„Ë.“PÅR‡Fôrà@naÀòåŠçËÊ‚ÆáÔS5ôì©wˆ‚Þ» Ã0üÁDaÆQTSû\à5—m1¢GrýÆ oÞì-`T·.´jÅg-ZвE º¶h¡ë-”z=VŸ>üéÌ.#Êßåáˆ*N„ÿ¯ÇÙÀ«áÒ¹¿i“ Uù¥ÒÀÇÅé zÈ ]ºÛãJb¼-y€Þz‹FŽä«J•\ÐzƒÕ–²²à½÷”Ï<1Q=-÷߯L)¥!Æ«_ëñç¸Þ?|ÿ½Âh ²Åö뱟Cpí]±B—Ï/¿„sÏ-x¹¢þ¦ïwþšÂÖ]Ôî+É2ùnkÿ~ytÛµƒiÓ”×1Ïó:ý‹úœë7þ|æùÓNýj‚Eٙߺ¸‹¤$uÐ-]êoØ ím|¼:èºvUéÒEÍ$Óù—–¨=ÿý 4·¢`܆Jr ´  ó¥wo¥¶~ôQÿlÍ;ß_û [‡µ›ÀØ Í¢EðôÓðùçêÒ¸õV¸æšÜ)‚µkk×Ååî»aæL]7 È-ŽQlÓܹºoÍŸ¯Òa+êý¢W/=Oõêee Ã(&CÆÿ6–ÆYYŠŒÝ°AÔß~cÚÖ­ôÚº•Z[·JŠ zãiØZ¶ÔtÞ¡yóè q*‰#*¿ßç·Ž’Îó—@9¢ Xoy‡ÌpíÜ?p@Åo¿Õ°{·ž˜‡ 3΀þýó/jLb¼-ݼLF¢·|—E[ÊÊR) §¸ùÈÝ­[ÉÖãǵÈõú{\'MRɆäd¨TÉökQë áµ÷ aϘ3§ðåüíX-Î<—Z§wv¶²Ë¬]«luëiØ1M/®çz¤‹òâR; {÷ævö/[&½¬ÇõëçvöwëFЪËD"Qyþ—€â:ù¢Õéµw¯¢ØÚ·W•‚„1Önrÿ¾¨uF{» Ó§ËùÿÃpòÉpß}J8*–µëÜ¿/jÖ®•lªCxãÀ¯Û0ŒÈcÉæÍÓ°f\¶n ƒ+éé€ÑSZÌ0Œà`"€0ä(Ð8°ç>ÃM*ï—<¨e[·ªÔ™Þ²Eã#Gô£²e•»¨E ŽX iSÍoÖ,róš•ô°¨7íhpD9„û-ÅãQ¾#˜?_0ôä<`€Duê׎nKOÃó[Þ!”m)'G¡AO] …•ÞÿùCsæÈ“PˆaMâ‡sÝw^´ŠÂôaË–Ü©8ù¶o×wÍšy#üqãÆîÚîDåù_ ÛV¬9½RSaà@%QY²¤ðÊ\Ön ÞV¬µ›Ò’­”êO?­kú™gÊù?`@èlp°v]ð¶¬]KV–®“/¿¬L†ay9|.„Ù³s'OìÞ]ïè§Ÿ§œ*¸j¦aa†‰Â”·[€u@K—m1b—Ѝ-Žôgá½{½Â€üÄééÞek×ö š4É:\…Euhõ֥ލe]Ýèå)-))ðóÏ ™5K`Gòû~ýTB woµÉ@ƒméu‡[€÷€+ [¯›miÆ xáøæhÛVb€+®PDº?ÄàqõË XÜãÚºµöû#ä^ƒí×â-.ºþø£è,…ÞÓ¾Q€ÿýn¼ñX£|VË¡ïñä^g\”—ÈgüµL<#= «Våvø¯X¡¤#eʨ&t—.rö;ÿãŽsÍ܈%êÎÿb4Ù@ÜŠ¢Åé•­KNôZQ5×­ÝX»)-éé0v,<÷œ.ç—.ÁßvAX»¶v]–.•#oÕ*8ñÄÀ®Û0ŒèäÀug~ÿ=|÷ÄÍÕªÁi§)ñégÀ '¸m¥anc"€0% e€œ°†áM€»;±²½{aÇøýw ùMç 4j¤òMšä?í†P .Îÿo>—v^qì.ÊŽ¼ó‹ÛÁ_Zä$øé'=EÏŸ¯pÀÌL‰œâ[}ûJ$P®\é¶cméË¡C¹à‹/x¸¿4ë kÖÀóÏÇê-êê«åükÕªðßÅØq-r{%=®ÿø‡¼ÍË–ygûµøë ›6©¾ù·ß 0sºÓ;3“¸ åsÍÿk¹ÚuàÜsaܸc ʳ‘¼Îó\ÛÊûýŸ_Æ„ ƒÁº|8Îþ_UÕ—ÌL=>vì(ÇPçÎ:uÒ¥Þ(=yþç³nsz•܆£GUÕçûïUÛÚŸ*KÖn¬Ý””#Gàõ×åüON†Q£àž{Š~dÖ®­]‡1càÞ{Õ%ª’†aD›6)®åûïç””¤÷ø‹.Ri¿®]ݶÐ0 70@óp°ƒ÷#é žÕ}…Û·kÈ;ŸP Y3Õtw2 4j¤ò [³·´8o|¾øóæZœß5Ï™_”S,?»ñ–ýçv× nõö„ŠÔTX´æÎUÓܹê]ª\YÞƒ=”º{wEt¼ó#†ÚÒJ ×‘#\ñþûü鍊rÿÎížÃ¢Ø½Þz Þ|vî„!Càæ›á¬³òãZè¼Ò×Y³`Ð e”iÙÒö«3Ï¥óåÎ;Õ‘°j•Ë´ËÙéí»î¢~_êe:wÑ= (ñaœ×yžÇ»ÂþxøkÛ…üi§¥ýᆱ˻L8´ÓŒ X½ZmsÕ*Eö¯^íMçß Ang—.º]—-Íùuç œ^y †}ű'(ç=ªìÙ³aêTÕ·.Ž­¾Û´vxûŠcO(ÛMI8|^}U ¼ÒÒôx~÷ÝP¯^p¶W¬]‹µë‚5 %ž2 Ã(-ÙÙ°`Lž¬!1Q¹ /”( G‚¯Õ†aD&c²€àT$0ŒPs!P˜è¶!¾ìÛ—[àˆvîÔôöíêp¨TI¢€Æ½Â€¦M½óš4ѼòåýÛ~qž z›ôýœw}ù9° { õ‡‚¶QÔwE-H#…œX»V€ŋUàô×_ÕãY³¦Bºw——¡(OCŒ´¥í@/ -ðm… ”ÏÌ ®Á";¾øB¡F3gê:rå•Z·ö.#ÇÕ¯ß—ÆÆ¬,]Ÿo¼QµØm¿ºv¾¤¤¨¹?ó \wÿ¿+¨ÓÔw^q–˻ޢ:bK´‹‰ƒûï‡'ž ®\îk·_»ôÏéä÷™——ü„.“×°|Ú@Aû(ßÿžgAöa¨ÚiNŽ4AŽ“åJ ›6érQ±"$$(QO‡ŠìïÒE"#ôDäù_ÌKtA×©ä¯ °¥ u—tæåàAu*/] Ó§CÏžþÛšw›ÖnŠ^¿?6–‚Ö¨vS\’“á•WäüÏÊ‚Ûn“X±NÀo+X»¶ví/ 0lŒœõ†»x<ê¾t›6)žî‚ 4ôîmH #š1@˜ó!0 X(†J¾BQ¼ÅáÃ^ÀÎ ìÚ•[,ðÇêQ½ÕÕ¯l¼bš5 +Œ¡ËéQ 1ppŸË¶¸ÎÑ£,Z¤§êeË”JÞÉ9Ü¡ƒ7ü°Ky&ªW‰¶” ôýszPÓE[ÊúõÊ×8~¼„IÂUWÁå—ÇÄq >¨ôë;wjÆÅéÍôž{àÉ'm¿†ˆ×^“#1QIPÜ&(‡ýÉ'á‘GtÝ.[N=U½!wÝŸC‡úgXžÿ‘xšìÚ¥¨þ•+½ã5k”œ§LhÙRéü;tиcGhÓ¦ôUzŒð'Û³›„rýö›ª¦¤¤À×_ëÑ7\°vS<Âu</¾/¿,o» î¸jÕrÛ2w×㮄ûþJNV¢ËI“àüóݶÆ0ŒhgÙ2øì3 Ö®• ¿Ã0¢„9ÙÀ‰@à—m1b€ë 겦ffJ˜˜;‹À®]š·k—>û–pHHÐZ­ZÞᥗ4T­ 5j¨—ºæŸ.O§g">^oŸ5jÈÉP½zÄöX \üÔwÙ–°äèQy.œbÄ+Wjœ”¤cŸ­åþñhß^fÍ E ¢àÖ|8 ØÌš¸kNpÈÌ„iÓ`ìX,Ÿ~ gŸ­ëCAB£`¾øBá0yIHP(0Ø~ ݺIçòì³n["‚Ò‰Û¡ƒ·M²•+§œÖãÆ•Þ0Ûi¸vz''ÃÖ­ŠBÙ°Aúur$îÝ«eê×÷:ùO§]øR­šŽwNŽÚ3öŽœ¼ã¾E$+Vôî“®lÙÜû¦\9-›•å]Wùò:_œ e}r›”-«v¹‹ 9Ó¹ÐÎ5 .Në+â|)1¾Â_‘„ïüš5½v:žÊ•5ÄÇ«'þ‘GŠÞVZTªXû‹KVœy¦Þ:Û´Qñoçx„›çƒ?âš(8_￾ÿ^õàd/ž IDATÔd}â NœLùmôÒKá­·ˆ«V´XÊCh ÇúÓ!{ŽY@öåä(AÒÞ½ºÅ¥¤èQ#)IÓμäd ¾ó’’´ì¹/—eÊ@ݺræ×­+ÝNóæÞÄ7-Z(rØW÷hªšÌþn??Be“ßçì™7O)Ù'O–@ì¿ÿ…Aƒ‚³­ÒbíÆ‹ÛíÆ_ÒÓUukôh=¢Þy§ªóÄzä¿/Ö®½DJ».Š¡Cõ<4q¢Û–†aè½îÝw%NÚ¼Yñ-·Ý¦ÒOþ^w ÃL!L.–]]¶Åˆ-ºgϸmˆ6ü l% ËD„;™™¹Ã,:=]^˜´4M<¨ñ‘#Êf‘‘ဤ¦zE'Ž(Ô3’šZ°#ÌO–vëÆM¯¿Î/¾Èe&äþ²bÅ‚³äÍDP¦Ì±Ù¿ï2¾Ž{g^~Q¸¾óÒÓåü‹Ó´ó3w~ZZézŽ*U’C;'Gã¸8Í«QCãÚµ5vö3.WNÛu²ETªä8T¬¨ÿš‘¡ýäñÈÎÌL¯÷.-Mm 9ÙÛ ÂÉ2qÜqœi'óD:ÞŒõêÉ–Ê•½Ç(o“â2mZîl+…á¤iÏÛ¾Œ€’“#‡íÝw«ænÔ’ BˆEѾ=,\±!ˆGŽxSîoØ»w+¡†3Þ³'·v ¼•jÔÐß®VMãøx}ç9Õ‘êÕËíø·N"ÈÖ¯W­ê>R–˜îÝ圽ôÒcÅ £$dfªÂÖãëõå–[à¾û,+Œ4l¨gî{îqÛÃ0 /990}º2ó|ó^‰ï½.»,ò“yF,a"€Áôj߸l‹[\ 즻mˆä-P»xÜ]SŒp ))—s<±reºWªÄéÀx÷¬ .¾ÿÙwÚ7³ƒ3ß8) V®T>ìß—³Þãñ–ý¨VM^³òååà/WλLžý} +J@¯õT­ª±ïç2e´þ£G½’ÔT…ô9â ï=rDßefJ¸àïãbÍš 4h o`£FpüñÊñݦBó‚\x¡rÎùKÍšÁ˜ç!hüô  fnõÆúõpBŶʕ“bâDèÓ'4v•’´4X¼–,ÑxÑ"زÅ{©iÝZÇ´qcª¾ãzõtz9— Ã0b“M›`öl ?ü êhõêÁEÁW@Ïžn[hD 990~<üç?*sÝuð¯É)j±ÀÖ­ÊŒôãЯŸÛÖ†aäÏš5ð쳊Å8î8‰–n¼Ñ›ÄÓ0ŒðÅDÄ,`08Í]SŒây”`·Û†aÁ÷À`ÐÒe[Œð"è‹Dk?aX63SNý¬,M>¬ÏN©‘´4 ‡~Q”)£mV­*o`­ZÚvåÊò –)ã]oJŠÂµP.ñôtïz*Uò–bpÊ&”+'1À)§hèÕK‘ØÇç-¡â/‹AÅûá7wß sç‚n[D\C~PœL<=Ö9ë³²tœfÍ’³nþ|òõëë9ùdèÐAi»[µòV1 ÃØ¿_ºk×*ÂÍwíÒ-ÿÔS¡ 'Ÿœ»¢’a”–o¿U´ÿš50r¤ªX5oî¶U†Z&NTTmr²^ó Ã0™;à…T* fM½._½e0ŒpÆDÆ@ 0ÏmCŒ˜ÁŸì¸l‹á>7+¹nb„Wß‹P¶£”dd(*1Qþ}Êà ‡{—MI‘³\9ååvRõW¯®ž$'Ow|¼Æ¾éþË•S†‚ä púùMû¾Ûw¨QC^G'Œ¸lY…w<(oÂÞ½ú\¦Œìr„ N¹ƒâP¾<üûßrÎAáøãáÚkáþûݶ$ˆ´k§Üøy)S:v„÷߇NBo—9¢”Œ_~ _­Ó¬E eo0@»¦MݶÒ0ŒP“-M38IˆvïÖ°}»nÉ;v(ºßIVT§Ž4y  uï.‘‰†Œ`°h‘œÿ³gÃùçÃO¨íF,r÷Ý0s&,_î¶%†aþóÇðä“0fŒ²E=ò\u•%k4ŒpÄDÆàdàs`¨Ë¶±Á~à8T†bˆË¶î’4îîrÙ#¼x¸• ä²-Fˆ8zôX±ÀÞ½ò(8î]ÿñ‡œÿ oBíÚ)8ëÈÈ(þöãâ’Õaêî±r¥|ßk×-?bY»öXCùòj[ÿ÷pÇaçýÊÈ€©Sáƒ=™™© çû›„†aŽÔTEf:$½Ý¡CÞ„:‡+ xä8IqÒÓõ¹(²³µî¼8?§"è:àèæò~Ÿ••¿F¯Z5Ýz›4QŠõÆU¤Q#‰…N<êÖõ¿FIÙ´I©þ'NT–‰gžÑØ0b™>}”±é7ܶÄ0 £øìØ!1ßÛoKGÿüó¤†>„WÏ–Q$ÝaÀ¿€sWÁ¦ÐXމby¨,Äùnb„?!À³˜ ¦¨PA% ø‘#&+KB€ÄD&Ï;$&úW¦ä õx4,Y"ïLÍš¥û/Æ1LªÚ¤Q+øôS9ýReʨÈõرaçMŸ;WI &M’£oà@xí5:T = Ã(™™°n¬_¯ŽK'*þ÷ßu»Ú·O·ÇÉŸ—¸8%×qˆ×<Ð-ɉ€ª^½p-Q… ª¼SκʕƒÖ­5Ï©ä»Ýòååèoâß!ÌôLF òÇðØcðÖ[ª õÙg0l˜ÛV†ûde©"ܨQn[b†Q27†×_‡ÛnSf“à‚ à¥—$@5 Ã},@²èŒF¸l‹ Eõ½?vÛÃUîf¿¸l‡>ìºý€\¶Åˆ`Ê—/ØÓRqqòŠ^pAàmŠqÎ8C©åß|ÓmK‚HÛ¶°q£Ú_ÅŠ*lxÍ5^OžË:~ÿûŸêswì¨zÉ#F(z×0 ÿY¶ fÌPªåU«”$3S§~“&:§œ(ù¦M•Ò´fMU¹ñתåö?1ŒÈ"-MO=¥óè±ÇàÊ+M˜bK—ªüʪUÊÊb†é|û-Ü~»ÊP 7Ýd% ÃmL¡Œækò.ÛbD?“P{3b—–À5€Uà6<À9À&`)PÝ]sŒHÅéù*!ÛúöeÑm·Ð #3³ £F 㦛–лw¢Ûæ…šÛ¶qƽ÷°³[7~¹þzÒÂÄ»—˜X“éÓ[3gNsrrâèÝ;‘3ÎØLëÖÜ6Í0"†ìì8–/oÀ’%Y¾¼û÷W&>>¶m÷Ó´i2ÍšihÐ …²e­;Ä0Çóæ5cüøŽ¤¤T`ذuœ{î*Tð/óÓðáÃl¡a„cÆÀ½÷*Ó“9É ÃˆÒÒT"à™g”lï­· }{·­2ŒØÅDÊ6 ðp“˶ÑÏ$àRàÊ`ÄKQ9’Õ@B˱Á³H28Ée[Œæ’K”–½ÔöÆPnÙ@#T&úøðz¶ùÄ]S|è Üœ l^Þºi”aDM€ë€kÀb`*0 å²²®Ã>§ žª“÷Ðîb­Áº)XaÔ(UF›9ÓmK Ã0ÏŠpíµ°r%<ù¤2„Iâ=È)LÁÜ| l )%h¥fÐXôtÙÃBbunb„‹»ê9Àb°R1bL˜ 7Á¸8ÈÉñ~W¾<ÄÇ“˜™ÉÁ*Uè|þùЪ•êµ·o•*ÁW¨]T¯-=}¤tÙQËSOÁõ×CíÚ®šáñÀW_ÁÓOüyл7Üwœ{®uކ¿ääÀwßéV0u*Ô©£Ê×]-[ºmaÄ[¶À¿þ §¦2]»o&L`Ĉ&0b†„6L)³ Ã0¢‘¬, úõƒ±cU~Ë0ŒÐa•¸"˜c‘æ—m1¢›Ö(Õ÷¯˜ V™\è¶FXŒ¢gÏnuÙ# :öìΡys¢oÖLÓññ<0bã_}õØßÏœ ûö…ÐàègÁ8å·­2÷ßïêæ33¥}yæ‰-Î9æÌ>}\5Ë0"Š={àÝwáÍ7aëV9LJóχ ܶÎ0b‡¤$¥ü}åhÝ&OÖyhFá$'ÃúõУ‡Û–†aråàá‡á¬³`äHèÔ ^{ .»ÌmË #v0@S¸ Ü€F0ˆ:ËÝ6Äp…ÀàM· 1‚€là]tm0ŒRqÉ%JJ™2P¯^àì‰q<X¸Ð¢‘‚ÅÑ£ðÆðÜs°{7\z)|ò tèà¶e†9,^¬ãÏ>ƒªU•æÆ-!Œa„Þx@â¶^P’rÖËh~±x±²Ùôêå¶%†aÁ§{wøåe¾»ürøâ eòr99ŸaÄeÜ6À(wµ°LFð邉b•Y@5TÕшmÞDe!ÆöœnÑdž pà@ d1990n´i£$çŸ7ÊybÃð™3að`8ùdØ´I‚š;àÅM`¡fÙ2e¯¹újÝÓÖ¯‡›o6€a‡E‹”»Et†#T® /¿ Ó§Ãܹб#|ÿ½ÛVFôc"€§2ð8ŠÈ\ã²-FtÓX äµ uÌúåÝ6Äp•ÀÀ£€e¬6ŒèdÑ"EÖšc:p|ñ…R^{-œy¦œÿ/½¤Š†aNN|þ¹„IƒkÞŒŠž5J‰†a„Žà–[Ͱd‰RúZŸaŸ  §ÕÛ4 #9ýtX¹úöÕ;ò}÷)«aÁÁDQÀH pŸÛ†QMg øÍmCŒ3 趆«dW]QÃ0¢“•+áÄ¡lY·-‰|~ú N=U’íÛêUª]Þ¸±Û–Fø“™©L;Â…B£F)͘ƒ¹maÄ99º‡µkS¦ÀرðóÏе«Û–Fä²x±‰ È]jÕ‚?†wÞ‘ °o_زÅm« #:1@PxøøÁe[Œè¥#P+ kl~»mˆá*Ï+€÷ÐuÀ0ŒèdåJHHpÛŠÈæ×_áœsà´Ó”UaáB˜8QŽÃ0 '- ^}U¥3®½VÑÆ+WÂgŸAn[g±É‚*ÃqË-0r$¬] W\qqn[f‘ËÖ­°{·Î-Ã0ŒXfÔ(eJO—¸ðÓOݶÈ0¢D ƒ!À½€Çe[Œè¤2ÐXæ¶!FH™‡D Fl²xx 8Þe[ Ã.+W*òÖ(>ûöÁ7ÂI'Áž=ªmøý÷æ¸4 ÈÊR”q›6Jú·¿©tƸq&L2 ·Ø»®¹z÷†êÕ%r{þy¨YÓmË #òY¼Ê•ó–Ö0 ÈeN8A¢ÃË/‡K.믇ÔT·­2ŒèÁDQÄ3(J{‚Û†QK`‰ÛF!e&*`7‹Ø$ ¸ è Üâ®)†a™ƒaÇèÐÁmK"‹œøßÿéÿå—Ja¾h‘·~¹aãñÀ'ŸÈÑÛm*ŸñÛoðÊ+м¹ÛÖFl’•¥s°m[‰Ù&L€~0AŽa’ T‚«J·-1 Ã*URF°)S`òdeJY³Æm« #:0¿NÑÕlþî²-FtÒ‰,ÛDlƒJŒ tÛÃ5FëwËøiÑÍæÍ…)?âââþɼyŠàºóN¥1ܵ«:—_G™2‘{Å Ö¾ ¢ù¿E"Ó§ëü¹ì2ÕD^·NŽÇ ܶÌ0b—„nÝàž{ছÔù~É%n[eÑÇÂ…pÊ)n[a†~ Ë–)óPÏž †Q:Le<ì^qÛ#*98ltÛ#$¬ö}Ý6Äp…åÀÿÏŒgÑOb"”)Mš¸mIàñx+_ܵ ®¼úôãŽS'ÅsÏÇs8 Ûqƒ@ï«p"šÿ[$±`ôïC†@ãÆ°|9|ð´lé¶e†»ìÚ#FÀ€Ш¬Z£GCµjn[fÑGV–ž­d”aFþ4k³g«,Ñ¥—Âw@f¦ÛVFäb"€(£pŠÞÜë²-FôѨ,vÛ#$,ªíÜ6Ä9™ÀÀ à—m1 #4lݪŽÿ ŠÿÛX‰¬ÎÊ‚^PÍÂ÷ßOdÒ$øî;K‘lþ°f"{zõR¹sUB£cG·-3ŒØ%+ ž^©ÿçχÏ>ƒo¾6mܶÌ0¢—_U­kË`†Q0åËË/ÂGÁ;ïÀÀ°s§ÛVFdb"€(äŸ@Uàa· 1¢ŽŠ@'L+,ºeÝ6Ä9Ï¿oae #VضMŠûâ+€+ä¼|ðA8tè à.¸Àm« #üIJ‚»î‚Îu™:~ú N=ÕmË #¶YºTNÈTúÿÕ«%Ô1 #¸,YÕ«Cûön[b†þ\z©2‰íÛ§’E?ýä¶E†y˜ © < ¼Ò9F é,rÛ#$,º»m„r~C¥ež»l‹a¡cÛ6hÑ¢x¿‰@F<ü°j—Wªéé' ©mšÛ¦FX““£¨6m”îÿµ×ät<ûl·-3ŒØæÈ¸ûn ªVUTò#@åÊn[f±Á‚*PÆzä Ã0üâÄaáBèÝ Rv>Ã0üÇ9¢”˳öN· 1¢Ž“‘¸$ËmCŒ ’ü tsÛ#äÜœ\ç¶!†ââ⎠ú®°ßå—ßr¥±%ÿÏ{ ûy3ekaû¬°íz_zŸú2otí /½¤Ž†Ÿ. ¬ÏwÛþØçï÷¥ÝÅmkÁÚÅmŸý6ËÁeþ| gn¼QuÆ7n„ë¯7‡‡a¸Í´iСŒ ¯¿®z»í¬ö›a„”… ¡gO·­0 È,jÔ€‰aôh¸÷^¸öZ8zÔm« #2°×ð(%xø˜è²-FtÑž­tÛ#¨¬BÇÙ2Ä€ÙÀØ‚ù8Ž@ǃÇã9æ{ßyy¿ÏﻼËäç/ÈŽ¸¸¸¿ìð]Oi•y×å»þüœ¡…ý'€ïï [_ÞÿRÐÿóg]y—÷g_wÝÅ!%þñèÛWˆ•+á–[ÀãÉ.ò?çµ±°ÏÎ:ŠZ¦ ýR˜8ß¶–ß> ¤½¸í³ ›¹¼\ví‚Ë.S”N:Š0~ñEˆwÛ2ÈmþøCçæ9ç(ÀÚµê<·Ë¤a„–ädX¿^™ Ã0Œâ'À—_¤IÊ °gÛVFøc}üQLàÿÙ»ïø¦«ý㯖–Q(”JBÙ›–Yd•¡ Ù–ÈT”+"àq W”+ÊP‘©€²Y?(«¥ì2Šl(Ð2º-tä÷Ç×ÖRÒ4i“œo’ÏóñÈ£m’~Ï;É÷›u>眗€q@²â,ÂyÔŠ¡M/œ×A 8PCua7qh³ÇüTœEˆüÊÚ)˜!§ŽZSLuîZÒ©oªÈÀZ,½­·AãMlìÃ3ä÷¾Ëk6Kï+kæØ´ aɘ76n„J•,ßN^ ?~L–Óý’[G·9÷‰µïCk´aëë ëº>ùjÖÔF8®X›7Cݺª“ áÚ mYŽ:u´:Ö¯‡_~2eT'Â5…‡kËå´h¡:‰B8®®]µYû®]ƒ'ž€£GU'BߤÀÉ}Üþ«:ˆpÐF‡ïSDØÔ~´¥äEÂuŒC+ðùê BXQn#áÍíHÍÎÜŽjSÛ55‚Ür»mYg88u*€®]=t™%ÛËÎX!†©mYr_YºmsÜ»o¾ ;k£³Nœ€Áƒ-Ú„Ñ9ýmêríŸÛ6Ì-17—-˜Ú,Ýg¬¹ËíØ ÀçŸÃ{ïÁ±cðÜsªS !N‚'ŸÔ–åø×¿´c³kWÕ©„pmûö¿?”-«:‰B8¶ºuµçÔjÕ´YÈ~ÿ]u"!ôKúwœ\9`"ðpEqá<‚Ð:‰…ó:ˆ¶.¼p »€o/ÅY„°kN¹ï 2~‹WC™ýû¡Iøùgm„äòåú%™}Í{sök™_ØRl, ¦u2Ö¨¡u0NœEЍN&„k{ð>üP+ι}BCaút(ZTu2!Dh(4k¦:…B8__mæ¾AƒàùçaÚ4Õ‰„Ð')po~ÀxÕA„ÓxmÍø{ªƒ›9 ÔRBØE ð*Ðè¬8‹¶big¨©iÙQ|fß‚©«9ÔTøøchÙ*TЦì×Ou*ã².-ý”]ÖýÝ•öca?K–hÓ‹oØË–ÁÚµy[6Ca]»vA£F0uª¶DGX˜Vä&„Їðp)Bkòô„テ3`üx9ÒÒT§B_¤À¦‹PÅY„sh ¤¡Î'Hj«"ìb|¥:ˆVf¬ƒÔX!€Lîš3œ9mÚÀ§Ÿj#6mÒ ]ÖÎ)Övî<ý4¼ô’6ÚæÄ èÓGu*!D|<¼þºöºV±¢63Ç¿ÿ ª“ !2\¸ÑÑÚúÕB!¬käHøí7øñGèÛ’’T'B?¤ÀE< ´C›@¾ùUmv‰}ŠsÛøëïŸ5”¦öp˜ LdYBá¬rZO^ü#>ŠWy—8w.4l÷ïkKŒ ΰ[Èèa+©©ðÅW¯BHÌš>>ª“ !Ö­ÓŽÍU«´Y:6l€Ê•U§Bd®æ©N"„ÎéÙgaëVر:t€[·T'B¤À…ü8ÌWœC8‡¦@¸êÂ&"¤SØLB+è¥:ˆv`nǨ-–Ð{áAB‚~:ól{_ùðÜs0bŒ¥­ËZ·® ›³"½ïCÂy9¢uXL™'ÂЪ•êTBˆ¸8<zô€'ŸÔfæèß_u*!DNBC¡^=ðòRD!œW‹°g6óJË–ÚLfB¸:)p!À›À8 Vqáøš!38«3@MÕ!„Íæ¢-à©8‹Öfi‡©­–Èm[vìZ2*<>^+0u?X:ÊÜÒmYr_å-gsà0ááðÿ§-àéO~ù݇rº\õ2¦öK÷kì¯âQ©©ðá‡Ð´©öüpäˆVP° êdBˆŒÑÿ›7Ú5°høúªN%„0%, š7WB!œ_ÍšZ!@‰ Ç«N$„ZRàb¦ uöLTD8¼VÀ9àŠê ÂêN"K¸‚Q@{ ›ê BØHöŽA=t º¹¹=t²f–¬·×ÒŽÝ„í²5¶—[Gµ¹Û2÷¾ÊmÛLŸãðahÝÚ¬f³gGº9÷‹¥ûX~ösYÚ†­¯/L;vLEóùç0u*lÛ5äÍ¡ÊÅÅÁK/i£ÿÛ·×¾ÔîÑCu*!DnRSáÐ!­°N!„í•)£}†©SÚ¶Õ–ÂUI€‹)ümô§Lå.ò£9àìRDXÝi Žê¦~v3TÂÆ²w†šê͸,/ͦ.Ë©]k# †ÌÛšS»9匇âÅÍ›Ûö²ÞcÎyÙ–¹÷•9Û¾uKëù÷¿S€÷øù心8§Ûœ—}ÄœÎksï—œþÎiļ©ûÐTž¼0gÿÌ-S~¯/…¹KKƒ/¾Ð¦ÿ÷ô„Ç᭷À]¾5B¹µkµ©Ä·nÕFÿ/\%KªN%„0Ç‘#pïžÌ „öT¬¬_¯- о=„„¨N$„òqÞõÚ#€4µQ„+ 4AW'œG Ú ÕU6sƒöP[q!l%£0ë)7¹u šÚž9mYš'/òš!ÍÈBKòZû¶çµí¬×ݵ 7†ˆØ»×ƒá †t«Ý÷ÆÚÌË>bÛš[®¬ç›»][ì§¶Ú̽¾=ŽAG©Í’1y2L™;wjSi !ÔŠ…Aƒ gOèØQ›©CFÿ áXöïoomDªBû)\V¬€nÝ KذAu"!ìOŠ\Ô·ÀQ´„È«Öh£‰…ó¸‚VPUua3_‰ÀŠs¡GÒ1èø m$ó“OjEʨ+!LIO‡¯¿ÖŽ—”í˜7 PL±f hÓÙ®] Èè!Qh¨¶€Ì¬#„öçé ‹ÁÀðì³ZQ€®DÞ~¸¨Úh#A'7gŽ+8Ä©"¬æêß?Ë)M!l%ø ˜È÷‡BüC¦w‰‰Ð»7üç?Ú:æ+WÂc©N%„~]¹:iþãÇÃÞ½P·®êTBˆØXí‹êgžÑŽÑcÇ {wÕ©„yÍš©N!„®«@˜=FŽ„þýµï „pªuþü Œæ«"T0`vò„s¸†VVVuaŸ¥WUBŒ­®J^Ь×Ë˪›³»“'áùç!>^[/¹ukÓ××Ã}î(ä¾rN+W«¯B©R°g4i¢:‘`õjxí5íËêuë´ék…Ž+!NÒfB¡Ž›ü÷¿ÚìýûÃòåZÁ¥ÎNfpa^hÓB/D¦tyóPQDXÍÀ©sF—Ñ–‚ùðTœE½qÔˬ>__â IDAT³ùÍÀÓŸV¬ÐFWùújk®æV ìÚû§°ž{÷´Îÿ^½´Â™ƒ¥@=ˆ‹ƒAƒ´ij;w†ˆ)„‡kKï´h¡:‰B€/¿„# o_øãÕi„°=éçqqÏ]€7€ƒÈ!,÷$°Eua5×€ ªC›˜ }UB'ôÔñŸ×,Öº ÷ïC¡BVÙ”]¥¥Á„ 0m¼þº¶®¹¹Å zzüõNõþ)¬çÀ0nÞÔfxî9Õ‰„ Í`3d¤¦Âúõе«êDBkÙ·üý¡¬L·(„º1}ºö¾ëùçµY˜ž~Zu"!lGfü8ý÷O!,Õ8ÜTDXÅUd)gtmÖ—O‹)„È.9ùá¿ïÜèhmMb½ºySû þÍ70>|û­cÏf „-¥§Ãԩв%T¨GŽH€zœ cÆ@ÇŽÚŒ6R „³ ÕŽo!„úáæÿû ¬lÛ¦:‘¶#¿Õ€ñÀ@À_iáhÚ€­@?µQ„\ª¨!¬nðZÑŽµ­Z ‚»;ܺññZ‡ÿƒàí­d˜?_ûP¬7Gjk÷¹¹ÁîÝШ‘êDBèWt4 ;wÂÇÿÿ­ÿBµÖŽÍË—µ×Û—^RHa ááÚk¯B}qsƒÙ³ÿ™`Ë RJë“"À8`ð:°NqáX¼'Ж"Çwh¥:„°ª½À`Ÿê B]ð÷‡ß7ïº]ºØ6‹1±±àë›óå«Wk&M›Â¯¿ÂcÙ/›Žfóf­cÑÛöî…ÆU'B¤¥iËØLž¬­¾~=Tª¤:•Â.\ЊñžxBu!„Ƹ¹ÁܹÚLƒ]»Âž=P½ºêTBX—ŒæЊ„°DG`³êÂ*®«!¬ê] / ŬBÐ*Û64=ØÍMë,,]Ú~¹2ôí Ÿ~úèù|ö™V¡?`üù§×öðfñËÒÒ`Ò$èÜZ·†ýû¥@{غÖ®Íùòóç¡];øàmfŽmÛ¤@g2²T!ô¬@XºµW®¨N$„uI€ÈÔ x èx X¡C€‹ÀiÕAD¾Å%T‡V³>RD¡+#Gš¾ÜÓž}Ö>Y²Ú²Eë@™8–,ùçüädmôÿ¤IÚº}³gk…pU11ðÊ+Ú²§N=|Yt´¶¾ø´iðÝw°|9/®&§®$.:t€ž=áÚµG/ÿé'­/!ö탱cei!œ]h(Ô«^^ª“!„0¥HX¹RûÙ¥‹ö~Mg!9ÄC> ²\•°D3´Žc™ À±%¤À™|¼ÔPD¡+ýû›þ2òÁèÖÍ~y@¹üº™ž®-mÓ£têGŽh³Ú!\Ç‘#pïžÌ „ަzuøí7m‰ÂÏ?WFˆü“"aÔ ´µÁ'«"F7 YÀ‘ÉLÎc°˜¨:ˆB·j׆àà¦ßÏšªM/nOŸ~úÏtæY¥¤À͛ЯŸö%ª®îƒ &æá‚Ðþ¾wOûÂJa?ƒ6Gr²ö{Vîîàçß~«M/+„p-û÷ƒ·7Ô©£:‰BKµisçÂûïÚ5ªÓ‘?R Œ* L¾)Î"ƒ/ÐYÀ‘ÉLÎc ð g…¦¼ù棉övÿ˜>Ýø¬ DD@ß¾ÿ, „+:tÈô±Úqrö¬ý2 áêfÌ€;µ×ªìRS!.N¦’ÂU…†jK¸Ë7ïBᆱc¡8zTu!òNÞŠˆ Z/£ð"7= @znWº$38‡@ð¾ê BÝ{öYðõýçowwm=ñbÅì—aìØÜ¯“’¢­«ÉmÿOKƒó絎I!„íýª:ˆÈ“»H€£ÛlCfB˜ïÕWÿéXLI®]íÓ®Á ì/PàÑËÜݵó‹ÑF?:—.i¿{xØ'Ÿzqù2ŒŸóhcíË©¢EµµÉ7nÔ¦(BØÎäÉ™saNÆë@ZaŽ©‚7!„s ×^·[´PD!D~yyÁo¿i3¼L™¢:–“¯ÑD®ÞVƒÑ¦™6ò]­™^~¦!UFŽ&Yu‘oSі娣:ˆÂaT¬]ºÀh¿×®mŸv—,ÇEéé©u’À›ojkïÙsi!ôèµ×íh,P@;v<< G0@+à)THMF!\É®]0uꣅ9¯a ÂSOÁ3ÏhSÇV¨ &§B}û´Y¬Ê–UD!„5Ô¬ óæAŸ>м¹ýOa R rUX4¾dvIaJ?à´ÉÁj£áRNkݪƒ!t'%%…;wîpûöm’’’¸sçƒøøxZµ*Å4¤\¹üúëö‡þ×ÍÍ Ÿ‡Îóôô¤X±b™—)R„"EŠÓ–è×vïÖ B…Ð;7ƒ!ë$œBä,hÜB‘ÎB‘³Ï€ÿQÈòŽäsàgà¨ê Âb×€ÊÀràµQ„°º°dÉÅIlïæÍ›œ={–³gÏrîÜ9®\¹Â•+WˆŠŠâêÕ«ÄÄÄÀWÀ,´wÖP¬X1Ê—/OéÒ¥)W®eË–¥lÙ²T¬X‘J•*Q¹reüñÌc[SRRR2‹Ë®\¹’ylÅÄÄ<Ôáct†Œ¢E‹>ÔI^¢D |||ú»H‘"+V OOÏGãg=æŒÍ®û@öYâããIII!11‘øøø‡ ¸~½qq}IIù?ààŸ×d///J•*EéÒ¥ñóóÃÏÏ/óïŒ×·råÊQ±bE‹fq5?ÿü3 xä9UGrá‚6:tÇhÓFu!„9.\¸@hh(‡æøñãœ8q‚ .žžŽ‡‡Gækx¥J•¨P¡eË–ÍÉïëëKÉ’%3 á3f&ÊúY;£´™’““‰ÍœE ã³ò¥K—¸|ù2—/_æâÅ‹$%%ðØc@:u¨_¿>Íš5£~ýúFß/ Û‹Ž†úõáÕWáãU§"wR ,rm”÷»À$ÅY„~ª[§g曬CŠÑx` p AHÂÙ8[Àƒ8qâDFFræÌ™ÌŽÿŒ–B… eväeí¯X±"?þ8åË—ÇÏÏO+–§§kÓÛÚéÓPº4xxÜ%::š«W¯réÒ%®^½úPÁCÆyƒ777*T¨YP½zuêÕ«G`` •+W¶}haÑÑÑDFFɹsç¸xñbæ):::óz>>>”/_ž²eËR®\9J—.ýH'xéÒ¥)Uª”ÑéÀQZšÖ‰P­š6ÈÍ›7AdEGG•¹\§§'þþþT®\™Š+R¹rejÖ¬IÍš5©]»¶tBºëׯsîÜ9Ξ=Ëùóç¹ví—/_Î|Ή‰Éìp-P eÊ”ÁÏÏÒ¥KgW¥J•ʬ:‰"ÃÕ«WÙ¸q#›6mbóæÍÄÆÆRµjUZ¶lÉO4*"<<œ»wïâëëK›6mèСíÛ·§víÚª£:¼7n°wï^BBBسg‡"99™¢E‹Ò AƒÌŽäF@áÂ…UG9¸uëäСC™ÅýõiiiøùùÑ¢E Z¶lIëÖ­iÒ¤ … RÙ©¥§§ó×_±ÿþÌÓÑ£G3GõW¬X‘Úµkg® ›Ñì#CœÖýû÷9}útfñÇÉ“'9~ü8§OŸ&%%OOOjÕªEãÆ "((ˆ àå`s‘K€pt©©P¢üï0l˜ê4B¸ž””Ö¬YìY³Ø¾};Å‹çÙgŸ¥oß¾´oßÞ) æÌÁ¯¿þʲeËøë¯¿¨Q£¯¼ò C† ¡T©Rªã9• E X´úõSFã¤@äÙ<àU`ð„â,BŸ¡NÞ©8‡0ÏxàOà ê ÂlK€×€Ë€|í+œ•žŠŽ;ÆŸþÉ–-[عs'÷îÝ# €öíÛLóæÍ)_¾¼ê˜"‹´´4Ž;FXXÛ·ogÛ¶mÄÄÄP¡BÚ·oO‡èܹ³|b†¨¨(¶nÝÊ®]»Ø½{7‘‘‘(P€ÆgN¥Ù°aCjÖ¬)³\8;wîpôèQ:Dhh(»wïæüùó.\˜¦M›ÒªU+Ú´iCÛ¶m®£Qo¢¢¢Øµkááá8p€ƒrûöm¼¼¼hÔ¨Mš4¡~ýúP»vmY"CdJIIáôéÓ?~œcÇŽqàÀöïßOLL Ô­[7³( yóæÔ¯__×ÏÏR ÝÇŽA½zªÓá:®]»Æœ9søþû‰¡G 6ŒN:Q° kÏ™yøða.\Èüùó¹wï}ûöå7Þ Y³fª£9É“á»ïàÄ Iî„I€È—nÀ9´NCYyUd·xˆj©"Ì0X‹,àHZ YªƒaC*‹ aaa¬ZµŠ•+WræÌüýýéС:tà©§ž¢lÙ²vÏ%òÎ`0Á–-[غu+!!!$%%Ѻukžþyžyæ*V¬¨:¦.|8þþþª£éNRR¿üò ³fÍbÿþýtìØ‘I“&¬:šÃ»_[ 0~ùEu!%E"_®¢- И©8‹ÐÚTå}Ïg¹ûø 8¥:ˆ0K8Ð 8ÔUœE[RQ°ÿ~æÏŸÏªU«¸zõ*<÷Üs<÷Üs²žž“INNfóæÍ¬ZµŠ5kÖKPP}úôaðàÁ”.]ZuD»ŠeÅŠ¬^½š;vpïÞ=š4iB§NèÔ©-[¶ÔU‡‘P+!!-[¶dŠDEEQ¡B:wîLïÞ½iß¾½ì/hKglذ?ÿü“;vpåÊŠ/Npp0­[·¦M›64mÚÔe¦¨jœ>}šBBBرc/^¤X±b´lÙ’:еkWê)º,EÂÑ —.ÁÖ­ª“áÜâââ˜ûŒÕ«WÀÛo¿Mß¾}e}sñˆóçÏóý÷ßóÝwßðÆoðÖ[o9äù;wî°hÑ"fΜɉ'hÛ¶-Æ ã™gž¡xñâªã 'uæÌ~ùåæÎ˵k×èÑ£o¾ù&O=õnnŽýÉ1**Š%K–°hÑ"Ž?N:u0`={ö$00Pu‹-bΜ9<ùä“ÄÆÆªŽåpºuƒ.]`äHšF¡Ò ¬¦Úšâгrƒ¦ IDAT}iþ÷éÕA„Iž@¢ê"W+8`¨ê B8˜»wï2~üx6lHLL ›7o&44”gžyÆáG¢ û(^¼8ãÇçüùó|üñÇÌš5‹zõê±bÅ ÕÑr”””ÄçŸNÕªU™7oÿùÏˆŠŠbΜ9Ô¯__u<áb<<<èÝ»7Û¶m#""‚'žx‚ÄÆUÇËUjj*‹/¦aÆtíÚ• °zõj¢¢¢˜1cMš4QQ«{üñÇyûí·9räG¥S§NLœ8‘Š+2yòd®_¿®:¢º Íš©N!„ó0 ¼ñÆL›6Å‹3gÎYZÉ @xx8ׯ_§]»vDGG«Žäp¾ú ‚ T'B#EªÞž^c\”°—7€ß€kªƒˆúû§cÅr=ß_ÕA„p Û·o§nݺ̞=›/¿ü’ððp:tè :–pP^^^¼ýöÛDFFÒ®];úôéC×®]¹qã†êhY¶lÕ«Wç“O>aÔ¨Qœ;wŽwÞyGÖκÀüùó9zô(þþþtéÒ…'Ÿ|’Ó§O«ŽöƒÁÀ¼yó¨^½:C† ¡~ýú>|˜ 6н{w™*U¸ŒÀÀ@¾ùæ.]ºÄèÑ£™={6UªTaôèÑÄÇË¢rµ…‡K€ÖôòË/3þ|Ö®]Ë‹/¾¨:ŽK©]»6!!!´mÛVwŸsõ®F ;Þ}äí‘Ð)VåÌ€Ñj£é <|§:ˆÈQ‰¿Êûý:솫"„™>}:;v¤yóæDFFòæ›oR @Õ±„(S¦ ,`ÇŽœ>}š   P?VBB¤ÿþtïÞ3gÎ0eʼ½½UGâõêÕcõêÕìÞ½›ÄÄD5jÄܹsUÇÊtèÐ!ZµjÅðáÃéÖ­gΜaÑ¢E2“†pi¾¾¾Lš4‰óçÏ3mÚ4–-[F­ZµX°`™ûV¸   :žxBu!œÃW_}ÅÒ¥KùóÏ?éÔ©“ê8.©lÙ²lß¾¢E‹Ò·o_RRRTGr(ãÇC‘"0eŠê$BH€°²À<à'`¹â,B? o3‘Y"ô*c\ è×hK¯©"„xðàýû÷gܸqL:•eË–Q¦LÕ±„jݺ5áááÌ’%K”eÙ³gõë×gÛ¶mlذ9sæÈ~/BË–- eôèÑŒ1‚=z§,Orr2£Fâ‰'žÀÍÍýû÷óí·ßR©R%e™„Ð///FŒAdd$}ûöeèС´mÛ–¿þúKu4!ì*<<< H>¨ ‘oÛ·oçÝwßåÇ$88Xu—æëëËš5k8~ü8ï¾û®ê8ÅË >ú¾ûÎSF¸:)6Ñ…6Zõ¢â,B?F M5?Kua”è[2°xEu!@ZZ/¼ð[¶laóæÍ¼ýöÛª# 'çããÃÚµkyçwúè#>ÿüs†Jhh¨ÝÚÞ¶mýúõcĈ¬\¹’R¥JÙ­m!¬­U«VìÝ»:wîLBB‚ÝÚ>}ú4­[·¦@bÈ!lÙ²Eu$!l*5‚¦M­·M7·NŽÀ^yÍi'?YòòŽöXéÙ½{÷˜2e ~ø!… VGd3eÊöîÝËü¡:ŠCyúixê)7Nuáʤ@ØT`60 X­8‹13ÏÖSŒ¶OØc†yŒÍWðÆü™ä¾µŸS@ú_ @ö ¡Zzz:¯¿þ:cƌᩧžRÇi r$[ê믿Æ`0ðå—_Ú¼­1cÆP»vm¾ùæ›·%lGÇ™êL~~~¬]»–µkײfÍ›·7räH¼¼¼X·nE‹µy{Ù©¾¿Íá…>Œ?ž1cÆ0pà@UÇÂfŽ{÷¬;€£=ÕÚ+¯9íØû¾s´ÇJÏþøã’’’èÕ«—ê(Â???ºtéÂâÅ‹UGq8_|Û¶ÁŸªN"\•› Gëø=«8‹³s”ÂÓw€ À¯Šs8"[?Æ>¸îrz>~~™aP_“Û9èé¶:Š7ræÌÆŽ«:ŠMÈÈˇ ÝvH*Tˆwß}—¯¿þÚ¦³?~œeË–1sæL (`³vœö9žÍS»vmÞ~ûm&MšdÓÇ,44”+VðÛo¿áå"‹:Ë>(lí³Ï>£R¥J2­³pjû÷ƒ··¶îs^ÉÓ±> Ò©¯ÒòåËéÚµ«’BLaž>}ú°víZ’’’TGq(MšÀ³Ï¨N"\•»˜Ôz÷gqVŽô™¡Ú´æbŸÙœ…=ã’¸f€žŸhËg¼ª:ˆèùq²6Wº­Ö´bÅ Úµkç”ë¡KgãéÕ«±±±„„„جŋÓ AmÖ†°>9ž-3dÈŽ9¡C‡lÖÆ7ß|CçΩQ£†ÍÚÐÙ…=(P€7Þxƒ¹sçrÿþ}Õq„°‰ÐPm)÷<~Ã.OÇBh‘ÛÿeßFNÛ5÷q²d1Õž9ç»=9Ýy½­Ž9Bƒ ìÚföõ‘­—œÓurÚŽ±Ë²_ÏÜÿ5÷:ælÃR¦î c׳$“9÷³©mÛƒ¯¯/•*UâÈ‘#6kcß¾}4kÖÌfÛ7ÅûuÖÿ5¶Í¼œ—SÖØ^N·Ë’}Ì’ýÓœüy½ßͽ}zP­Z5|}} ·Y;vì M›66Û~^Yãy=ã÷¬ç›³}KòYz ç”/§Û”Ûyy½9ÝG9µ‘—ËŒµeéõrkÓœçUÚµkGBB‚M‹x„P), òúV,ëaêæöð߯®›ýòŒó2Î7ö{Nç´œ2˜s¼°´ms¶“ßyÉh­®,**Š *X}»ùyÏ–lÛ’÷M*ßT¬XÐ+a™† ¡gOøðCÕI„+’"a7•ÅÀOÀ<…92^Í™ÆÙ-ÛuÜŒüžßé m'ëyÆ®›ýwC¶ße6gûöTx ˜¤ZyÛòçý1.D›¸\î[û?‹€žh³4葵ö‰ÜØâq2g1g¿±d{Ù³eÏ›};–ÜV‰‰‰x{{۵ͬÓS»¹¹=òwöë“õz×ÍúÁ=ëÿgŸÆ<·ÿ5ç:æl#/²ßncmšê˜2•ÉØ}jN{öV´hQ›®…O±bÅl¶}Sò³_g½ÌÒÇÕØy–ì[ùÙw2¾TË~Z2M½©ãÙœ Öºß-y¾Ðooo›K%KêëÝ–©ç0Kž×³ÿ¯¹û 9ùL½k/·|9W¿g¿­ùÍo,ƒ±Ë-=–Ì}N±äuËT›z:V³óññ´cLg“§Ni3äEÖC×ÔTôYŸ²þnêÐÏz™›Û£gÿ=kûÙŸ͹N^äµms¶c)K¶mªX!§ûY˜–””Äýû÷)Q¢„Õ·Ÿ÷ÎùùÌaɶs{ÿ¤—÷… ¦páÂÄÅÅÙ­Mg2iìÙ[¶¨N"\»ê¼¼ ¨¨·´óÎíg^·cIžœ:u2:Ï,iÓÖÛϯÿ—Ñ C¬Eãüm¿pÕ‚¶L‘û6ÿ®AVÞ®µXkŸ°v†¼?ï-ýÌ‘Ÿ÷å9ä%£5ݺu‹äädüq›lßÙ5n ݻÔ)ª“W#EÂî&Á@o\síqcܲŒÉÏË·­·ŸW•—g_!ÐQãÇ1=€9Ê}›?¾@gmß™ä÷q2vY~×ÜÚÊOç½9·ÕU³k×.Õ1LÒ×ò*:Ìšõ²ü#èá~ŽŒŒäÆ´nÝÚfmtìØ‘mÛ¶‘žžn³6Ìaª/§)-3.7õÿymÛÚÛ³7s3Xz¿ç÷¸ReçΤ¤¤Ð¾}{›µñÌ3Ïðûï¿Ûlû–²Ö~¨×ÂŽ 掆3u¾-2äÔ~Ö‡¼|‘ŸßëåöœjI{ö²zõjj×®M:uTGÂêöí([Övm˜{HëìÐ7KÖ¢z["lÄßߟK—.Ù´¼~fÉé­Uin±®ê÷öåÝ„ °k„†ªN"\‰»+,ÿBMç³Þr89Êöócpø^us”Ǹ,9Ï WŽrßæÅBàEÀÃNí92=?ϓџ—ŒŽv[íiÈ!=zTÖuY§^wD?þø#Í›7'00Ðfm 4ˆ¤¤$–.]j³6ò#££ÌØ)ƒ#uFg§×ì¦îsG<®¾úê+úõëGéÒ¥mÖÆ[o½ÅÅ‹ùå—_lÖ†=éý³$Ÿ­òç÷>Rq,åö|ª7QQQ̘1ƒ>ø@u!l"4š5S±¹¹ý3‹pm;vdóæÍJÚÖËë«©÷#zȸyófªT©BµjÕìÚ®3iÞZµ‚/¾PD¸)JøË€ ÀTÅY„Zå×€O»Š³m9€h…B­ch˦ VDXµ–Ī^½:ƒ b̘1¤¥¥©Ž#òAï£Wssúôi¾ûî;¦Øx®¿%J0iÒ$Þzë-¢¢¢lÚ–µé½“Ò˜ìéYÏsŽ˜yþüùlÛ¶?þئíøùùñÑGñòË/sàÀ›¶e/z?ÆLå35M¯½2˜âˆÇ’½Ý¹s‡Þ½{Ó Aúöí«:Ž6.EùaË©ü…ãéׯááá™ËȸŠìï%ôüÞâ×_¥OŸ>º|_éHÆŽ…5kàÌÕI„«"¡LK`0ت8‹jÆ^:­ùrjëíç×x´€ÿªbCŽòg¬êäHK8Ê}k©…@} ¡Úrzž³&Wº­y1mÚ4Ž=Êû￯:ŠpQ‰‰‰ôêÕ‹nݺѩS'›·7jÔ(êÖ­K×®]‰µy{–Èi Gï@Óû\SK/8’Í›73|øp¦M›F•*UlÞÞ›o¾ÉsÏ=G‡Ø»w¯ÍÛ³%½czȧ‡ –r”c;..ާŸ~šk×®±téR]f"¿.\€èhxâ ÕI„pM›6%((ˆo¿ýÖîmëáõ5/3#Ù3chh(Gå•W^±[›ÎªG¨Z¾þZuá*¤@(5 èôìQüdéÌnÙ~²ýÌïKmÖ¯²¶•×)¢³oÇÛ·?à=´"€üv>Ëcœ¿í—ûû§±ÇAî[û?ih˦ ²q;ùe­}ÂRzyœò+#gn×ÉøéÈ·Õžüüüøù矙6m_~ù¥]ÛÎønIÇ‚±uMýÖ6ÌùßœÖÌ~=sÛ·7SkêÑÝ»wéÞ½;III|ÿ½};rwwç×_%%%…Ö­[sùòe»´kŠ±ÑµÙ§Î6÷‹.=>þæ¬Éiîv²þÌ/sî÷¬çåôÿz¸Ïûí7zôèÁðáÃ1b„ÝÚ?>;wæÉ'ŸdΜ9vk׿>o›»¾¬¹×Íí³¿fä¶íÜÚÌé5ÈšûinkêæôÚ™õo{/æÛzpèÐ!š4iBtt4;vìÀÏÏOu$!l"<<< (È:ÛËx*±ÅSJömgÏX{YórÈš—Û*þñôÓOóÃ?ðî»ïòÆo’’b—v C®1¹u¼åöÅ@ÆõŒuòçö¿Y;-³^'·mä–?'ÆþÏÜó²çËþ%йÛÉ)-œ;wŽ–-[ráÂ6mÚD‰%lÚ^V~~~lß¾"EŠÐ¨Q#V¬Xaó6Íݯ³^žýqÍéü¬ÿ—Ó_¶>/§ÛjŒ¥Æn£¹òs¿çv\e½NöÛd¯Â€äädFMß¾}yë­·˜1c†]ÚÍàááÁ’%K˜0a#FŒ S§Nüõ×_viÛ’ýÐÜç~K_SÌaαӶ³ßsŠÞL}!žßNxsî#c¯yyÊ*/Ï=¦îwÇjvwîÜá½÷Þ£yóæT¯^°°0*W®¬$‹ö õê—Wþ¶“õ©ÇÍMûÛX§sVÆ rë(Ï©c:kGw^¯cnc¹²þn¬ÓÝXÛy¹N^YrÿdmS ò¦U«VôìÙ“pÿþ}«l3?ïóûYÂZK‰©~ðá‡röìY™mÑŠ Ò^?~øAuá ¤@(WXÜú €µ5C'S×Ém;ÖÌcÉùæä±tû*>æ'¬°=yŒMŸoJEr.0¶M¹o­üü <Å?33èµö KÛ2gû–f²öy9eÎíï¼ÜVñ°ýë_¬\¹’Å‹óä“OríÚ5»´klŠð¬S‡›ÙhÉu¬½}S—›³}sÛ4÷¼¬çû;/Û±åH‰M›6Ñ´iS *ÄîÝ»í2uyveÊ”aÇŽôîݛ޽{3tèPmÖ^~ö»ì™©ÿËío[g¬ÝŒNÀ¼æÞFSò{¼çvœû[?>LPP .dñâÅ|þùçJ:4ÝÝÝ™4i;wîäúõë2iÒ$’’’lÚ®¥Ïa¹=ÎY¯“[{ÖÊšÓ¶ý[>K2äõÿsË×c)¿Ç³¥¹½ÕìV­ZE½zõ˜3g_}õ7n¤T©RvÏ!„=……AóæÖÙ–ÁðÏ)ûßYis¯gªÜÚÏËu,É‘[.s¶Ÿ×ëäU~ïa™™3gråÊ^{í5«l/?ïóûYÂÜö3®——Ûaë÷«W¯æ£>bÞ¼yøøøX}û®ªH2fφôtÕi„³“"¡ å€ÕÀnàmÅY„:ƒ€`œê .® pNu– üôSD'ðÌ3ÏÆ­[·hÔ¨ .Tòå¸p^ñññŒ9’®]»Ò³gOBBBð÷÷W–§hѢ̞=›µkײ~ýz™7o©©©Ê29›ÜF ËݸqƒÑ£GÓ¬Y3üüü8rä/¾ø¢êX´lÙ’ýû÷3uêTf̘AÍš5ùꫯ¸}û¶êh.CŽ-ý2 ¬_¿ž¶mÛÒ«W/Ú¶mKdd$#FŒÀÝ]¾jÎ-5‚¦MU'Âùøùùñû￳|ùrÆ'ïÚ¶mdòäÉtïÞ]u§3|8\¾ ü¡:‰pvòÎ\èFc`0m‰ázÜiÀ:`‡â,®LŠÔÚ€Vð¼ê B8‰ÚµkF¯^½2dmÛ¶åèÑ£ªc g0X°`µk×fÙ²eüøãüôÓO.\Xu4ºwïNDD]»veøðá4hЀU«VÉ—hVbl]p¹o-wûöm&OžLÕªUùõ×_™1c[·n¥bÅŠª£eòðð`ôèÑDFFÒ§O&OžLÅŠ™8q"ÑÑѪã9¬Sï }zðà , 00=zàííMHH .¤L™2ªã aGŽÀ½{Ö› @¨ejª¡F“&MX²d _ý5#FŒ -Íó‹¬V¯^M×®]yñÅe©^:v„ï¾SD8;)ºÒmMø‘Àÿ)Îb‰œÖ†Îí$Õxèi6WzŒ«bß"Wºoͱè”TÄŽ\ùñöQ¼xq¾ýö[ÂÃÃyðàMš4áå—_æôéÓùÞ¶ÖáU!kGMN'gd0X·nÍ›7gèСôîÝ›¿þú‹Áƒ«ŽöˆÒ¥K3kÖ,NžŽ¡—„@B:„ ¡¤†.]Ô`C±®«®»ê»ÖÅׯ*««ìªì¢»ëbA\P)B轆@:%PÒß?©¤33÷”ó¹®çša2óÌoBòLæ¹Ï}î¸8>úè#FM`` ¯¼ò ¬[·ŽÃ‡óÆoh:¦RFmÞ }ûšN¡”kèÛ·/Û¶m#<<œÁƒóÇ?þ‘K—.™Žåt,X@Ïž=Ù½{7ëׯç÷¿ÿ½éH.¡n]xè!øüsÈÍ5F9+·-VvêÐè|Ô5GÙX:Ð ¸ø›á,®&ð–#K3(Û¹ ¨,0D);2yòdæÌ™c•ý°lÙ2>ùä–.]Š——“'Oæ×¿þ5]»vµÊs*û–——Ç?üÀþó~øá<<<¸ÿþûyâ‰'èØ±£éx“““Ã÷ßÏܹsY¶lcÇŽåî»ïf„ 4jÔÈpBå¨Nž<Éüùó™?>[·n% €»îº‹x€ž={šŽgU111,Z´ˆ¥K—²wï^¼½½7n7ß|3#GŽÄÃÃÃtD¥JÉËËcÓ¦M,Y²„%K–ýÜŽ;–[n¹…ñãÇÓ°aC›d™;w  IDAT.“'OÖN Ê®ed€—|ó DE™N£”ë(((àÿøS§N¥yóæüýïç¶Ûn3Ëá>|˜'Ÿ|’•+Wòàƒ2cÆ »ïtçlއöíañbé  ”¥i€²k›áȬðw gQ¶÷/àwÈÒ¡†³¸šVÀ›À¦ƒ¸tÀø¸Ãp¥ì‰µ‹JJLLä‹/¾à_ÿúG¥gÏžDEE1qâD¬þüÊœììlV¯^Í·ß~Ë·ß~ËéÓ§1b>ú(·Ür 40ѪΟ?Ïwß}ÇüùóùñÇ©W¯C‡eìØ±Œ3†:˜Ž¨ìXnn.7ndùòå,_¾œ;vЪU+î¸ã&MšDdd$uì¹g²•?~¼h`uݺuäååqà 70xð`† Bdd¤ždU6—››Ë–-[øùçŸY·nÑÑÑœ?žîÝ»3~üx&L˜@ß¾}üÎj€r«VÁÈ‘”¾¾¦Ó(åz’““yá…˜3g‘‘‘¼öÚk >Üt,‡sâÄ Þ~ûmþûßÿÒ¥KfΜÉÀMÇrYÆA«V°@g…)+Ð"e÷æ÷o0œEÙVÐðVÎâjúCw çp%³§€T@ç^*UÌ–E… ذa‹-báÂ…ÄÅÅѱcG&NœÈ-·ÜBŸ>}pww·Yeééé¬ZµŠï¾ûŽ%K–pþüy @TTwÜqÁÁÁ¦#qöìY–-[ƲeËøñÇIKK£C‡Œ3†‘#G‰———é˜Ê°C‡±~ýz–/_ΪU«ÈÈÈ <<œ1cÆ0f̆ BݺÚË­Pff&?ýôëׯgݺulß¾üü|ºwïÎ!C8p 7Þx#mÛ¶5U9™ôôtbccÙ´iëׯgãÆ\¼x‘ÌСC>|¸]¼çi€ro½³fA|¼é$J¹¶7òúë¯óã?É+¯¼ÂÈ‘#u û*9r„wß}—Ù³gÀË/¿Ìƒ>¨ç7 ûüsxôQHL„–-M§QÎF‹”Cø+ð"ð0Ùpe[?C€…H«te÷ç‘5ê•mÜ 4曢”1QPVll,ß~û- .dß¾}4oÞœ!C†0bÄnºé&ºuëf,›ª¾+W®°aÃÖ¬YêU«ˆ¥nݺ :”¨¨(n»í6|uJW)ùùùÄÆÆÍðþå—_ÈËË#44”Aƒ1`À"##iß¾½é¨ÊŠrrrضmÑÑÑlذèèhÒÒÒðððছn*ø×u«ïÂ… lذõë׳~ýz~ùårrrhÙ²%½{÷&""‚ˆˆz÷îmƒ³Ê1ddd°mÛ6bccÙºu+±±±=z”‚‚:wîÌ Aƒ2dC† !((ÈtÜkh€r·Ü èlM¥ìÅÆyã7X±b:uâñÇ硇Ò¢åòòòøþûïùøãY¹r%mÛ¶åå—_æþûï§^½z¦ã)àâEðóƒ?ÿžzÊtål´@9Œ—€÷eÈÊuLb€½È ©²¾·O惸ˆLÀø/0Ép¥ì=”têÔ)V¯^ͪU«X½z5IIIøúú2pà@ú÷ïOŸ>}èÝ»·®§n’““‰‰‰aóæÍE—W®\¡GEƒ ¢I“&¦£:ŒÌÌLbbbŠ‚7oÞÌ… ðõõ¥OŸ>ôìÙ“ž={¡—*''‡}ûöËŽ;ؾ};±±±\¾|™   "##0`ƒ ",,Lgû[HVV»ví*¸Ýºu+{÷î%77ºwïN·nÝèÚµ+]»v¥[·n´hÑÂtleHVVàÀìÞ½›°k×.Ž9BAAmÚ´)UHAK˜V¦EÊøùÁsÏÁóÏ›N¢”*iß¾}Ìš5‹Ï?ÿœììl¢¢¢˜4i£Frú¥Ý*²mÛ6æÏŸÏܹsILLdܸq<þøãŒ7Î%—ê²w<»vÁ–-¦“(g£EÊa Ë,~DÚ•+×tž¦Îâ*¾EÖ¥ÏD /lá¤ûB*ÐÜp¥ì½”µoß>V­Zņ ˆ‰‰!>>wwwºwïN¿~ýèÝ»7ááátíÚ•Æ›Žë´RSSÙµk»víâ—_~aÓ¦ÍÄÇ?BݺKèÞ=›þýû3dȆ †···é¸N#77—;w²aölÙÂŽ;8p๹¹xyyÑ«W/zõêExx8¡¡¡tîÜÓ±ÕU'OžäàÁƒ8p hÀÏž=dggÓ¬Y³¢¢Žþýû3pà@-ì°±+W®°cÇbccÙµk{öìaÿþýœ;w??¿¢Â€.]ºÐ®];Ú·oOpp°ÎêrÉÉÉ=z”cÇŽqðàAöïßÏž={8vì¹¹¹Ô¯_ŸÐÐPºtéBxxxÑÀ¿£¾Ïi€²wqqëÖÁàÁ¦Ó(¥ÊsñâEæÍ›ÇW_}ÅÚµkiÖ¬·Ür 'NdĈ4mÚÔtD«ÉËËcÛ¶m|÷Ýw|ýõ×>|˜Î;s÷ÝwóðÃë²SvnåJ5 †L§QÎD‹”CÉÆ»€]Çß?Û‘‚e]‡€ÎÀ ‡á,®à^ øÁt¥ì½”•””ÄæÍ›‰Žå‡† 94`yLÝo¾¡]»vtïÞððpÂÂÂèÚµ+íÚµsÙ™ µqöìYŽ9Âîݻٳg»wïf÷îݤ¦¦HŸ>}èÒe_|ñññ …É“á¾û@Ï{XߥK—ؽ{w©Yä{÷îåòåË€ \„††JHHmÚ´Ñß+8wîqqq9r¤hñàÁƒÊÑ£G‰'//€ àççG`` øûûD«V­hÙ²eÑæíím·mÖsss9sæÌ5[bb"IIIœ:uŠ„„III):ùߨQ#Ú·o_TÑ¢E/þûß ÄÅ5ã±ÇàõסºcÂ99Ò^ïË/áÛo!?Æ“‚€ñãA' ›“‘‘ÁñãÇ9qâDÑv\\\Ñ vaës€úõëããワ¯/¾¾¾´nÝ|||ðòò¢E‹E›§§'-Z´ ~ýú_]Ídff’žžÎ¹sçJmgÏž%!!¡hÀ?%%…ÔÔÔ¢uêÔÁßߟ6mÚ”* hÓ¦ mÚ´!$$Äág:©ÚËÉÉ)ˆ.yYxì'%%…œœœ¢Ç¸»»ÓªU«¢ÍÇÇooï¢{zzÒ¼yó¢ÍÓÓ<<<œfvzzz:çÏŸçüùóddd]OOOçôéÓ¥¶ÔÔTÒÒÒ8}útQç“BÞÞÞEïß…ïåÁÁÁE…ÁÁÁNÝž¸º´@Ù»ÈH ƒY³L'QJ]¯'N°qãÆ«KÉmbÇŽdeeѰaâBÙ°°0ÚµkGPPmÚ´ÁÏÏÏê§OŸæÔ©SÄÇÇsüøq8PÔùéÌ™3têÔ‰¾}û/ôèÑÃn TÍlÚÀöíг§é4ÊYh€rXGB€p`à8§÷ÔõxøØ(뙄tøÆt'÷8pXg:ˆRvÊ^‹ò5HaÚ" p'ÒÑ£ÿuî;;;›'N”¬IHHàÔ©S$%%ÏéÓ§ÉÊÊ*õ8www¼¼¼hÙ²%7¦E‹4jÔˆ† Ò¢E 6lH£FŠfýº»»Ó¬Y³RûhÖ¬Y©Á›K—.•zžüüü¢™ÅÙÙÙ\¼x‘óçÏsùòåk®’Þ¿ìóøûûãççW45 €ÀÀ@üüüŠGÊÊχٳaêT¸|Y.Ÿz j2Î{áüï0g¬Ypûí0i  zþľddd@JJ ‰‰‰¤¦¦Œ$''“œœLjj*gΜ)šé\R“&MŠ 4h€§§'õë×§I“&4iÒ„úõëãééI½zõŠ~êÔ©SnQMÙó999E-õ åæærá ø÷%++‹K—.‘™™INNçÎ+zlfffÑ`ÉØB7¦eË–Ež¾¾øùùáããC@@@ÑmUð ìO~~>)))¤¥¥‘––Fjjj…ƒÜ§OŸ&==ýš÷¡B7.*hÖ¬ 4 qãÆE—…ïG…ïQ…—…<==¯™ùîææ†§§ç5ÏuñâE²³³¯¹½ð÷­ðµedd——Çùóç‹~O / ³²²ŠüË{ï*™£dD«V­ðööÆÇǧÔm­[·ÆÏÏO—:©&-Pö,7WþfüàxäÓi”R––••U4ؾoß>öïßÏž={8qâDÑßîîîEÊ ½¼¼ðòò¢I“&EëEŸ3€¢¢æÂ¿G²³³‹ }Ïž=˹sç8sæ 'Nœ(Õ%Èßß¿hù´ððpBCCéÞ½»vkrbЮœ›xûmÓi”³Ð"åÐb‘¥n¾@[Ä»‚ó@`,ðoÃYœÝëÀ|`Ÿé N,ðþwヲ“(GýûÃŽУ‡é4ÊèŸ-Êá Gº|¼d8‹²»ÑÀo€k›¦*Ké|÷šâÄ– Kšh€Röç,ð 0ùý+2øîLñ òóaÞ<ç;,³øú RRäCòï~§O×|_:Á+¯È ¯={àÁañbèÛWZò½ôìÜiù× K2ÐÚt¥”RJÙTL Üx£(¥”²®¾}¥Ûá¢E¦“(g¡º(§p²&ï_€7 gQ¶1„yÏt'Öhl7ĉ-jѽZ)e%—ÀmÈR¿¿zù„¼÷ Ä1—Z»VZß;[@¡¡CaëV™¥µhtì(]ÊY&ºZºuƒiÓ¤;@l¬,ðÕWг'téS§ÊíÊõ$¾¦C(¥”Rʦ6o–¥”RÊšÜÜ * .4D9 -PNãA`ð:0ì ÚS7ㆳ8+7 '°Ít'´×"¥ÌJGÚüß´B–›¹ü H¾nê™ h!_~ й³é$ÖS§üêW2pÿ»ßɬþnÝ®¿‚þ†àwàøqظQ–øâ Y¶MxæX·òò,ó:”ýÊ@Š…üMQJ)¥”ÍddÀÁƒÒ @)¥”²¶¨(ؽ[Îm(u½´@9•Ç€÷å”s{hK»rþ÷?¸ÿ~ÓIl£iS™Åà€œ¬½ýv6 ¶_ç𛛬Í7cÄÅIçûîƒ+¤Ÿ<ú(,] YY–x%ÊÞ¤\½ÔNJ)¥”ëØ²E–Öê¯Þ•RJÙÀ!àí­K(ËÐ"åt~¬Óû4Ò@9¯úÈÿñ2àÃYœUO`' “-o)0¨k:ˆR.âð7`02‹÷ ²œP*°)&tƵ¾—,‹áî»M'±­à`˜;Wfï_¹"3÷y’’®ßnnÒYáφ}û¤ààÙgaçN˜0A>°OšóçÃ… ×ÿ|Ê>$^½ô3šB)¥”R¶ôË/¾Z¨”RÊêÖ…qãä\ŽR×K‹”Sú#ðð[à†³(ëŒÌàü=pÞl§tp8l:ˆ“ÉV¡K(eMyÀ&àO@o -ð:ÒAf>,î<ÍD´™¹saøp×=qÙ¯Ÿ|ù%¬Z:ÉàýåË–{ŽÎaÊ9Io½ii0y2´j£GKƒ-÷œÊö’wd饔RJ¹†˜èÛ×t ¥”R®dìXØ´ ÒÓM'QŽN‹”ÓšŠtxøÐpe]ï ë7¿b:ˆê4¶™âdV¹H'¥”åÄÿîZ€Ïd¦ ðp;ÐØLD›KO‡~€{ï5Ä,77¸ç™±?e LŸ¡¡Öi¯O> «WCJ |ò ´h!K„†BÇŽðÔS°l™t(PŽ# ðA?D+¥”R®dË-PJ)e[#GÊåÊ•fs(ǧç/”Sû#0ø?¤°rN­€w™è`µ¥¹áÀu.£¬ÊX ¼LQÊÁ]~@–ê„ a.#³þ÷#…£ed\ÍÂ…2>q¢é$ö¡Q#xùe8t† ƒÛo—ËíVz£kÙ|æÍ“‚€uëàÎ;á知½_Ë–0~<Ìœ qqÖÉ ,' YND)¥”R®!.’“¡OÓI”RJ¹//èß–.5D9:wÓ”²¶‘j—g™·Ï›£¬ä!`6²žóftuKŠ@‹+,m9Ò¥D)U=sçÎ%''‡‹ÞÞ¤·kǹÎtêÄéÐPòëÖÅ3>žÖ;w2dÇZ)¥”¥-X°Àt¥®±e ¸»CïÞ¦“(¥”r5ãÇ˲‚ùùPG§s«ZÒ"åžG…Ÿ. ³•sqþ‰¬aÿRü¡,£/ð%²¾¶W\¿½À)`´é JÙ©3À‰«[ðâ‹´ž2…ïBBÈnÚ·‚š&&âuô(ŒïÎ4ÔEÒÊ•“Ó„””pz÷že:ŠÝjÙò0ÇO%>~»wOæäÉþ„†~K§NK¨[7ÛªÏݨÑBBV²šü|wNŸ%)©))Ý9|xnnù´lyŸÝøøì¦eËÃÔ©“kÕLªr[·¦å¡C¦c(¥”SºóÎ;MGPê11Э4v•µÄ”RJÙѣᥗ¤saD„é4ÊQ¹˜¡”­|üx x8VÎå-àM¤}}¨á,Îâ ò½Üô0œÅÌþ‚´Öcrf™%¶ àüÕëéÈ@ÿi H+ñïSH±H -Ðè‰zõšÚè58ºÏ>ƒÇ—6ô¦Óؿ˗áý÷aúti½7}:Lš$Ë)ØZJ ¬Y«WêUpâ4iƒÁM7Áˆн»Î°5oà5àw†s(¥”RÊ6"#!, fiM­Rª†ÜÜ`θ÷^ÓI”£*(€À@øÍoà•WL§QŽJ‹”Ëù i?²F°Îlv.¹@?dÝçŸÑÿ_K(Z!Îâ Æ-/LQN«°‘ùàr%·¥#¿ßYÀ¥2·]¾zßdà¾ä>. ÇÚ²÷)¸úø’÷-OäwÀûêÖªÄæ ´Aþƒ‘c¹ª½[o•¶q‹›NâX’’`êT˜=[Ö1úõ3›éèÑâ‚€Ÿ~‚Ó§¡U+>\ FŒ€öíÍftv€æÀRä½\)¥”RÎ-7W i?øyÄt¥”£Ñ"e > »wKg¥jC‹”KZ Ü Ü|Ž28›Ý@oàmàYÃYœÅ8 5ð_ÓA\Ð)@ºßpe?²‘YðiÈàyá¬ùŒ×Ó¯n™W ¾_ x0>ȯás7]½Þ¢Ìmu‘/O¤sES ^5îSÿê¿›]Ýš^½,¼²¾óçÁÇGf-=ôé4ŽiûvxöYX·N:LŸÁÁ¦SIaÇÎR°z5üü3\¼!!¥‹||L'u.;‘N$ûÑnSJ)¥”+ˆ…Þ½aÏY@)¥jB‹”%,ZwÜÉÉàím:rDî¦(eÂxà¤`"°€âAåøÂ—©À¤´º>ý€¹¦C8Ÿ‘ÁÚ‘¦ƒ(›Èâ‘uíã‘5îSdŠýS(ž=_Ró«›G™Ë@äýªáÕÛê]½½pP¾òÇ]á} xp¿¼Û”óZ¼X‹o½ÕtÇÕ«—̺_´^|BC¥(`ÊhjpMŠ:u$[¯^ðüó ›6Éò«VÉ2yyе+ ƒË¥¯¯¹ÌÎà0RøÔÎt¥”RJÙÄ֭Ьtéb:‰RJ)W5|8Ô­ +WjA‰ªí \Ú/ÀXdÐø[d†¢r9@döé:dmiU{+ÑÈÀ¥—á,ŽìÀ `‡é Êbò€#H’]ÀQd°ÿ8„´Èœoƒ¬qï]bó¥¸%¾òû¥³å•%Lœ(kÜ/[f:‰sÈΆ?„iÓ¤àw¤;€›þ²^¸ Ý Ö¯—ËmÛ¤mh¨  C‡B@€é¤ŽeÒAìé J)¥”²‰‡†øx鼤”R5¥”¥ ~~òó¤TMi€ry{€1ÈúÄË?³q”í@ ÞþÏpG— N.A gTíôFjå2lEÞ;öûîuH‹è¶W·’kÛ·´uXåÒ23¥üGÁ¯~e:s9}^z >ýúô3 _?Ó©*wálØP\°e ää@ûöŃCÛ¶¦“Ú·ÉÈ,ß›¢”RJ)›èÚn» ÞzËt¥”#Ò"e)ï½'ïEiiÒP©šÐ"¥Y›cžåè:ŸÎäUà=d×ö†³8ºp xÃt•ŒÌÿ¸ÉpU=WAÿµÀOÀf ù z\½ ºRÜj_)ÓæÏ‡û$hÕÊtç´}», °nt˜>‚ƒM§ªž‹eù€õëaíZøåÈÊ‚6mdÙ€Â%:t0Ô¾ôD !ß6D)¥”RV—‘^^ðÍ7e:RÊi€²”]» GY¦&"Âtåh´@©«Îã‘¶ÎK¾fã( Éz#³Ø× Ë\ß"³ž×Îá¨æçÐÁb{–,‘…ÍNd IDATB€¶ÀP`ØÕKçS.ìî»áìYY3NY×¢Eðâ‹ ES¦ÈrŽäòeؼY Ö­ƒ˜¹- „ÈH0@N:¸»›NkF>²ÄÔ,àÃY”RJ)e}«VÁÈ‘RTëëk:RÊi€²”‚éöøÂ rþA©šÐñ0¥®j ¬FÿGº„®s¨Ì6!Tí EfB_1œÃQ­ú¡ö( ˜ ‚€—oàŸÀñ«Û‘-Pö.'V¬€ L'q QQ°w/¼ù&Ìœ :ÉRùù¦“U_£F²$À«¯Âš5pîüü3<ñ„t xí5èÝ<=aØ0˜:–/—r®â8Ò1¬‹é J)¥”²‰_~  -PJ)ež› .ü”ª)-Pª„&ÀwÀÀ­Àçfã( ¹x˜ ì0œÅ‘ F 6›â VÃM‡P¥¤/#íýZ#]RyÀCH¥It´ ÎÞ|³é$®£~}xî98|XŠ\Íõzƒ2ûÿå—aÉ8}vï†÷ß—%,€±c¥Enx¸¼ÞÏ>ƒ#GL'·ž€;²ü‹RJ)¥œ_L ôÕ¡J)¥ìÄðᲤ_NŽé$ÊÑh€Re¸ŸÏ"@oM£,åE` ppÉpGå „ëLq@ñÀ1¤¼2ïrLþ <œ¾nA»5(ÇöÝw20Û®é$®§U+é°s'´n-³æ'NtüÁq77 ƒÇƒÙ³áàAHM…… aôhسG :v??yÍï½7BV–éô–± éÐÈt¥”RJÙÄ–-Z ”RÊ~ &ú6ëìuuÏŸ—Ö…Ó¦¯/|ó Üv›,!Ц Üy§tX¿^ÚÚ‹S@*Z ”RJ¹Š˜éäÔX+Æ•RJÙ‘#`Ó&¸|ÙtåH´@©jèlB– 臬 ª×G@àaÀ;ÒåtD—¨‰#HñÐ0ÓA\Ô?þ€2“sœÙ8JYÕâÅ0v,ÔÑ¿ð펧'Ìœ)Z·– þ‰áÈÓÉl§~ýk—8{V¬€G…¬,)2<< GxøaøðCˆŽ†ÌL3¹·îÈ祔RJ9¿Í›¥“‘RJ)eO† “ÏÍ6˜N¢‰ž"Tªš‚Ÿ0d]ôïÌÆQסð%ð#0ÓpG4 Xm:„Y 4Gf¢+Û)žžþ¬Œ&RʺΞ•Šp] À¾uí Ë–Évð Ì2{þyHO7Ì OÏk—ˆ‹ƒ¹se9…S§àµ×`Ð ) èÒî½Þ{OÚ Úâû ô@ H•RJ)åÜrsaûv¸ñFÓI”RJ©Ò‚ƒ¡Cøé'ÓI”#q7@)Gâ,ž&o!ƒKÊñô^^Dµ»™ãPFŸ!k¬75œÅD#?ouMq!¹À#À<`.p—Ù8VçVâzA%·)ç¶t©´ž3ÆtUcÆÀM7Á'ŸÀ«¯ÂgŸÁë¯ÃcÉÿ£+kÓF¶»J¼ãâä„|l¬\þõ¯R0ЮÜpƒl½zADx{[.ÏF` åv§”RJ);¶s'\º¤”RJÙ§#¤ ^©êr+((ÐsÃJÕÂßç€ÉÀ'@³qT-ä"gV¯:ëzÎÞÀ÷ÀxÃYAà!`ªá®âp7°X„­¸‚ÂAÿ‚*nSÎë®» #CZ«+Ç’žÓ¦IÛûd–»sT-1±taÀ¶m/_ €îÝ‹·ðp …zõjöW"àÏ‘÷¥”RJ9·?†^¿Ït‰-¥Ôõpsƒ9s¤“™R–2oÜwŸtƒlÞÜtå´@©ë° ¸þø˜£já²Æëà ÃYI`ð7ÓAì\"Ò‚þ'`¨Ù(.!éÒ²XD˜cSÎTà†ãe6-/Zµ’™äO?m:ª­#GàÅaÑ")xï=Y>@Uß™3R °};ìÞ-Ûþý õëËráá²õè!—þþïo=² ØI ÐF¯A)¥”Ræ<ü°®Ö5•R×I‹”5¤¦‚¯/,^ ãuvžªo6©Ôõ lnúß!Êq"ƒÿãAÚGŒ¦q£YÖªrÑ@}¤hBYßSÀ*` ®UàLܪ¾‹*Ç–-2[iÔ(ÓIÔõèÐ.„µkáÙgeúñÇ¥K€§§étŽ¡eK9R¶B99pà€ìÚ%Û‡©SÅ),‡°0éàá!ç·E ”RJ)W±y3Üv›éJ)¥Tù||äóêúõZ ªG;(e§ÛíÀ`‚Ù8ª^>bÐBŽêЙqÕó4²ÔÄ&ÓA\ÀtdÉ……À-†³ØJyæup«à>ÕÙOmó”s{ÙÛÊË[QŽêîßQ; \?ÿYZ—¶BWŽ/?fφ©Seûõ×á±ÇÀ]K¸-æìY)(ì°s'ìÝ /Ê×àòð»Oï’.]»JÑ€RJ)¥œOFxyÁ7ß@T”é4J)G§”µ<ö˜|vݰÁtå´@) É~üøÓÕM—syÀ0 ´mj6ŽÝ˼€¿¿2œÅžÝ€¬Iÿ®é Nn)R|5xÂp[);Ð]Õ zE…ÕÙ%òTTPö¹*zþÚìß•þÀ2Ú·‡O?5DYZF¼ù¦Ì\ïÐA–3Æt*çUPqq°oì< zB^ƒ´äÿÀÛºu“ÙݺIa@×®Ò’Q)¥”RŽkÕ*é&””¤ïëJ©ë§EÊZ>ÿ}T>£6lh:²wZ ”…}‚ÌþtÐî­Ž#艴ºÿÒpG0)–øÊt;u)”ø²dˆ²Ž4 ;0øÜp[©lÀ¿&·U÷1µÉSÑs•¼ßõ¼ŽêìßUdfÊÌäÙ³áž{L§QÖrä¼ø",Z$Eï½'ÏÊz–7©@K !öï—½{‹¯Ÿ9#÷oÞ:u‚Ž¡sçâë:É×”RJ)eßÞz fÍÒîZJ)ËÐ"e-ÇC»v°n l:²wÚPR) { è,p#2ØÝh"U]þÀÀ8¤Õý£fãØ½ÑÀ«H…º†³Ø£M@>0Ðt'÷(ÐøÐtUn;ÿ²®g€ÞÚûwTë×K»ø#L'QÖÔ¡,\k׳ÏÊö=&Ë´je:sZ‰tô)ìþ ÛM7•¾_Zš> ‡Éå¼ypìdgË}|}¥0 cÇâ€ΥƒGýú6|QJ)¥”ªPL ôík:…RJ)U¹ùl­EªjZ ”ô¶w€“Œ&RÕ5˜üÐ)èPå <… vGÎb6›±žyÀ`5àa8‹²þ¼+ðWÇʕн;øø˜N¢laèPغU:?L sçÊåSOé`²¥­DºUÅÛ[þ_†-}{n.œ8!…‡ÁÁƒR °r¥Ì0,(€:u 0Pfq”ÜÚ·—K-ðPJ)¥lgËxî9Ó)”RJ©ªEFJ€RUÑ唲¢\ààoÀ3À;hå#ÈC–sH~A+Ó¸ xÛt;4™=ø…é N* nþe8‹­9ÊrUÝçz—¨ig.íáß}×tek™™0}:¼ÿ¾Ìx爊2Ê9œÚ?cBÇ+W¤0àèQÙŽ+ÞNœ(î мùµ!!ж­lºþ£RJ)eqqò«­••R–¢Ë(kúè#™pö¬—+U-Pʾ~,ð5 “õì_Ј¾£zm¨]ÑóÀÀ.ÓAì0xÚt'õ.ðpð3œÅÖìµ ¼Ç¹Õð¹*»­¦ûwII2øûÃR \S|í ”}úxðG½º˜£ÊHú]‘®®ÞàMà žê­#îŒ.!K,@–HP–³x8 ¸êd¼òÍy Ý‘³›öüó°f¬¡­”¥,Z¿ÿ=œ= S¦Ha@#©D½ #Ëü¦†­ìØì(EP»ÖzžÚf±äãòò¤X 5ä2)©¸Ë@bbq‚ôôÒûòñ)î,àë+…þþЦ\Èíº‡RÅlu ²=f:ÎÿUUÞz fÍ*.SJ)K©ª€£Oõ½Ï~ÿ¯ÂÃaÌx÷Ýš?ÖÞ_[YúsXóÇiºRvê6àà^ 7ð!ð+£‰TI~À÷@$ð ðÙ8va"ð'` R ኶yÀ¦ƒ8¡¥H— W-pFýÍêVÉ×jËû4):ZÖ}SÊ’¢¢äÄÁûïÃôéðÉ'r9i’óV~ ä÷™bšƒ(-y"¨nÝâAüîU´‡¸r¥¸0 5µø²ð¶ýû¥ 9¹8cýúÒ= (Hº_÷÷‡à`yîºZi¬œ›H93ý?11з¯éJ)g§ï}öÁYÿ"#åØúÿ@‹”²cÁÀZd`õQ` ðd¦±2¯ðpÒ ¦3ÇœM7 °×.ðMqB+M‡PVgqFg»¼tI:<óŒé$Ê5j/¿ ¿úL*­Ò?øfÌpîå'f¿ššb’ž ªµ† e–›6•ß/;[:œ< §NI@|¼lÜ(ד“¥ "K‘@@€\÷÷—b  )$¨_ßú¯Q)Kqö¢2åx¶lçž3B)åÌô½OY[d$|ú©œ/j\Áì)ý9t]º€Rb%ðÐ ø ˆ0G•ðgà `2SÙ•ýYÊâ é †Ü d‹Lq2{€p`/RpãJÊû½¢åÊ[›ººû©n†òÖ¼®è¶²ÏYn«ì _Ñ~Jþ»¢ýUgŸŽlíZ6LL§QÎnûvY`Ý:é0}º B:“µÀàPÅn‘rÏŸ”hÍWr9€²«’Ÿ¾+ÚOAÁµkþU¶`µŽež•C«úz…û/gßPþ §k^C5îS™J¿?eö]Ñ׫ú>ÛB^žÄÇK‘À©SR4P|=)I êÔ‘¢€¶m!$D.KnAAP¯ží_‡Rå©ì÷¼l{ÓòÚVt\¬ñ1³ŠcBuîs½m\kòÜ•=UûªNG>f^¯¸89v®[ƒ›N£”r6 ºê{_Õ÷©ìù«ÚWur8Û{߉ò·ÿO?ÁС×~]ÿsíŸCí ”ƒ lG žÆùf8:¢?û»€ ƒÙ8FݼìzÎbÂd&¡²¬•@®[PÙ€vÉû– /9îT“ý”§¼ý’_«ìþ%Ÿ³d¦ŠŠÊà¯ìù¡òçªhŸŽ,:ZNVj€²…^½äD¢Eðâ‹*ES¦@S'™6ÿ7`5/¸æ[Á±Ô1¬ ¸c©B’;,±¿ÂöE)óïŠò”w ,û“+*"+÷x^rà¿ ücuE'•jzŸª”=RÙ¾+jƒYÙ÷ÙVêÖ-žõ_‘‚)HH¢€¸8ÙŽ‡o¿•ë.”Þ_aQ@H´o/[‡àãcõ—¤T‘²'+Ròw¹äïaE¿çe¿Vé1³Ç„š7j¢¶Ï]ýÔ”³3¯×–-àî½{›N¢”rVsæÀäÉr]ßûô½ÏZÚ´‘âßèèò‹ôo°Ú=wuöSS&~µ@)â ,G ž~þ´W渟 ]& …F™s#ИëdÇLqB«B(WRÓëŠ×­5n«ç)«ä UEÏ[˜­ì}Et4 h:…r5QQ0~<|ø!L›&­§Mƒ‡’™ÈŽê°éP5>Ö¹]=T|Ì,ûù¿¼ï|©Ñ1°àÚÂ…ªNTµÿkî[æ59Ñd“gåí»ð{XÞk¯ÎI.{àæ&ËøùUe ‘‘Ò±//OºÕ”þ:/-PÊAõGZ®?‡¬Cþ=ð®;Ýø?‘ÀSÀ?ÌÆ1æ.`:ÒÿFÃYli'à…´­W–³ ¸„¬×¬ìOe³í+›éjiø¤VŽŒ ¸Ñ•®Êî´j3gÂï~'EÇäI0}:›NW}‡€¯¨~{VöèæVÁ,´ÿrïc‡³aTùÜܤ]hP víד“áðáââ€Ã‡añbxï=ÈÊ’ûH1@aq@h(têäXÇ¥L(9ÓK™fåæÂöíððæ“(¥”sÓ÷>ÛˆŒ”%Ávî„´Mí5\ùçP‹”r`M€YÀ­À#È äÙH[zeF8ðÒ ˜b6޽€ÎÀ<\«`7ÐÝt'´ù¾¶6D]Óºìà~UmúÕõÛ±êÕ“¶¥J™Öµ+,[K–À3ÏÈ à³ÏÊ샦MM§«Ú›ÈßÌ‘¦ƒ807g]wÅÅùúÊ6¨L‹Œ¼ü¦MƒO?•ˇ‚:uL§+ßA¤ À:ÓA,¤Üã€c•k©[Ú·—müøÒ_;s¦¸0ààAصK– 9yR¾îé)ï_ݺ„‡ƒ——í_‡RJlÝ*K›téb:‰RJ)uýêÔ¤àé§M§QöÄ­ ÀUë”rN_O"-É?ÊYRÙÈKÀûÀ2\¯;Ã^ ˆÎb ù€'0éÊ¡,#Öãš35ËΦ/ov}Ù™ø•ݧ²ýÔ4WÙýWwp¨ªn彞Š^We)yߊöéˆF†À@øÏL'Qª|§Oë¯Â'ŸÈßûïÃС¦S]+ YjfE-[á1Æ­DkÁ™‚2÷«÷«`‡¥Ž‰%`%Û–ZÓ°Äý+=º?®6Çßòö_êµ–ÉZö5=wy¯¡÷©ŽÚî»:ßgU;éé°gl»vÁÞ½rýìYùº¿¿„…A÷î!]EÜuºŠÓ*ï÷­Âã[5o«lßU=ÞR÷©ŽŠZÏê1ÓŒ‡†øxX½Út¥”³rsƒ9s`r‰ÙaúÞg½|5Éã¬ï}Ó§Ã@bâµ_Ó¿Á®å*?‡v:7 Ì®K IDATC)U[÷!3’ý€þÀ4 ×h"×õp'²4À~ÃYl­R0ßt9\@–ƒP–óÐ9–¹¢’ã*%ÿ^-; Söö²ûU´k*(s½ìQu_OÙ¨òòWõ=¨ª`Á‘lÛ¦mÝ”}kÕ fΔ»­[Ëzã'ʺâöb°x¯–¯ð˜ZâDJÉ/”;àîVâßTy`ªì~eÇÀòò¹•“Í­Ì‹)y¬¬ô[æ`[ö„Eɼ×Tz̬Á1¡¢ûÔö8UrzÌ4nófèÛ×t ¥”+Ð÷¾âëúÞg]‘‘”G^û5ý9,¾îj?‡Ú @)'U|€ÌFSßÑh"×” ŒNo³qlê-ào@PÏpk[„|dM gq&Q@c`Žé N¦¢beßâã¡MØ´I×.UŽcùrxî9)xê)˜:UMÉzƒ™æb”«¢b°ÏLöH¿_Ž-7W:ìØQzKO—¥:u‚ž=e»áÙt9U’jÆ•¿_rüøæˆŠ2F)å¬ÜܤÀ½÷Z÷9À5åµáì߯+W E ˜5 |ÐvÏëìßWK³õ÷K;(å¤Ü€ÿ¶"'<{ÿD}l­>ðõÕëÖ³®â>à 2›ÛÙí: –”‰´ižh:ˆRvbûv ×–#ÊŒ#]fÌ€Ï>ƒŽefo®¡6Uÿ’€7Ì<½RªîîУ‡œ°œ1~úöî;¾ézûãø+m-…Dd/EEY""**ˆ¢¢ ˆŠ¢×qëU¢q]ñ:p£à¸(\ÈR(£…Îß§¥¥t$i’OÆûùxä‘’¦ßïÉ7é·!ç|ΙacV­‚wßµ®";vX‹ÓÓNƒƒ‚&M`Àxüqë&°s§ëG!"‘ - òòàøXm9'""Q©zu¯5{¶ëH$œ¨@$ʵæÛ€3±•Ù:S±–ñƒ€\·á„Lcàd`œë@B`hŸñØ9KD¬ U+¨¡j#‰0 0l¬\iɽ[oµDß_„6ŽÍÀÀÃÀA¡ÝµYy-%²y<м9\pŒ S¦ÀºuÖætêT¸ê*Èʲ¢ž=måÓ‘GÂСð 6F';Ûõ£ /:gÂwßA£FP¿¾ëHDD$béo_÷î*W®^‡ Cæ—›€'€+ Ý|h±ã 0[‰ Þ®Öݸ·Ä~·þé:(r>6Fâ]×D™’çüüRn+Þ,º×¯¤¤À[o¹ŽD¤rV­‚;î€É“­ïèÑТEð÷{ð+Ö%+>ø»óI8ž›½™kªO¼±¨O6bÛØêÞï¾³Ë÷ß[ç€êÕ¡CèÔ :w¶ë–-3»SÂGÉç3Ôç3#K¿~P­Lœè:‰fÁ ¿}Eô·¯È”)öwnÓ&¨[7øûÓë°H¸¾Õ @$†tÿ®z¿;(¶tÞ^îsK¨ôªa;ZíÆº<å:(²ë0Ðu Q(¿Ä¥´ÛJ»ˆ{ßoóE"]‹0i|ö,_G#FØÜï`y øx•ð+€ð<7ççW| ob‰…ô¤|ÙÈ€Q£à«¯`Û6X²Ä:tèsçÂW@ëÖöh¿~ðØcðÍ7™é:z©,×çƒp:GéœY±´4èÒÅu""•ãú¼Nkô·¯H·n–ŒþöÛÐìÏõ1§ç=\_‡*‰1‰ÀãÀ·X[ÔöÀ¿<—AÅ~ÀkÀ£À Žc …ØŠîh °ûý9Úu QäM 8+ûò»Pâë@n7\ì³²J‹9G°ýõ¬_oI ‘hqúé°p¡µñ7ÎVæ>ÿ<ääv?`#±þ ¨ŽF$vÄÅA»vpùåðÜsÖ`çN˜7î¿ß:<û,ôèavºv…áíKÉÆ®£‘`Y½Ú~Ç;wv‰ˆˆHàÕ©cï5@ ©@$FuÆÚ¡ÞÜ œüâ4¢ØqVp#0Éq,¡0{­-qH,jMÇ-ò±nWUƒ¼¯Â$s0Š0]GbQsi1Gâã¶´JnH´IH€aÃ`åJ2n½Ž>¦M Ìöó±¿'­»³I‰`ÕªÙêß[nÿþÖ­ƒ_…×^ƒã޳@ƒм9\z©uX¼òT5/ÒÒìýGÇŽ®# ŽNP€Q€H « <€%hs€À#_KpÝ\ ¾rK°„%ÈßtG°,ŽD«–e°¸*DûË/å:“Ðe½~õºöM°Ž×O?A³f¶RQ$¥¦ÂOXëîÖ­¡O»,]Z¹í> ÌÃÞƒ„ãq¯Y3¸äëðÓO6F`êT»mãF¸óNhßÞVUy¦˜??ð]KD$4æÍ³QDII®# ŽîÝᇠ#Ãu$T "´ÇƌĊ:?:(6üô~vK0y€K @®ãX‚ágà(×AD‘ÇÓ€AÞ’ÛETÁ<^‹[;7‘h×¢Lš3fØŒ£†ë¯‡-[|ßÖ ¬èr4Ð*ÀqŠHôªYz÷†‡‚/¾°¢€Ÿ~‚‡†Zµl„I×®P»¶+sçª(@$RÌŸo¿Ã"""Ѫ{wÈʲî7"*€تæZظ€{=.ƒŠrà5à8à `•Ûp‚j°˜î: XŠuÊû˜Š( ¦ÒæÏÿº¢ùôåÍ«/ož}Yßó”q)oåÅPÞ~KÛNiÛôöùGY1Uæ¾å7ãñçù÷öùªhûe=†_~±K"±¢gOX°ÆŽµùÜ-[“OÚÞX \\ Z”" âã­ éÆáÝw­;ÀÒ¥ðøãÖ¡ç™g [7+ 8ã ø×¿¬( ;Ûuä"RRNŽÙêÔÉu$"""ÁÓ¤ 4l¨‘bT "ûi ÌžžŽæ¸ (ÊUþ4ú›Ý†4Í€q® °­ØsÖÚu QâQàxà” ï'¿Ä×%G”u_80[Ú÷Ê)PјÒ~®´ý•CI¥ÅTüg¼9#_UtœJÞ7¿Ä¿ýÙŽ¯ñ¿­´û–üº¬ãåëöK“—Ë–AÛ¶^ÜY$ŠÄÅÁС°b…u¸ÿ~+†ùä“ò.8h¼‚8E$ö´m ×^kE6X±ÞãÃAÁ³Ïî_ðè£ðí·*   Zkdu‘h×½»ŠÄ¨@DàÁVM-Nnv» *ŠÕ>.øú Ýa,ÁtVð°Ãu ´¼àZm†+o 0¸Çu å(LH—–¸õ6©[2 \ÞÏ•¶¿òb5bñ%ù]ü~e%ã+{JÛNiÅ…ÿÄãõuûkÖØ‡• ±*9FŽ´b˜Nଳ¬÷Ò¥Þ7¸ø˜„[Šˆ[›6VðöÛ°~½¯žzÊŠž{Î>„­SÎ>Û:”vþ‘à[°ÀF~¨¸VDD¢]÷îÖ*7góŠOT "ejŒµæ~ x 8‚¢dµÖÁX«üÍ@_l[´¹°àú=§QÖr û]‘ÊŽÆ8Óu åTâÝÛÕàþt(íþe%++ Å›‘•í6àïö—.Ç "±¬qcK°Í˜ýeí¹¯¿¶l)ºÏpà#ààPGqŠˆ´n W_mç¬?ÿ„åËaôh¨R|кšv\~9Œo#D$øæÍ³‚Â8}.""Qî„ =~þÙu$âšÞöˆH…†`sÏOúç8(:|¬Àޱ—co#F-¬=ï›®  @ Ÿ\5b¯ý'‰cÊzaâ9š’ö–_Æ%¶¿t©%?““HëÙÓVò “'CË–ðä“p{.üxèâ8F‘âZµ‚뮃I“¬piî\û÷ï¿Ã•W¡‡ÂQGÁðá0uªu‘À›?ºèM‚ˆˆÄ€öí!%ÅÆRIlS€ˆx¥Ö `:VÐKØå¸ * µ>æÑÖ±gð-ð«ë@d N‚•³¸„ÅŠP;ªm¾¸³|¹Z–Š”C‡ÂŠÖ ஽ðpsôwœˆH9âãmù}÷Á¬Yð÷ß0e œz*|ñœy&Ô® 'Ÿ > ß}§6®"žnï«;ur‰ˆˆHðÅÇÃñÇÃ7߸ŽD\S€ˆøäT`0¸kß=ÇiDѧ0ÅpÑ•¼; kÏûªë@d%ÐÒuî)`0Úu !T21+ÝÂYiÏA Ÿ—ÊlÕ*hÖ,€ÁˆD‘ädH y÷@×—á©.–8ûñGב‰ˆx'9ÙÿO?míZׯ‡W^Fà?ÿ±Uˇ]&ÀæÍ®#‰Lii—g ‘XУ|ýµë(Ä5ˆˆÏª`Ň`«w¯¶¹ *Êt&a-mouK ÅW¯ùãr±qÓí¿ÅÀÿ÷‡9Ž¥²¼Mè—,U!@y³è‹ß§´Xʺݾ>Þ’ûôq+^dU|_•ŸP|;ØþªUТ…ŸÁˆD±|àìoÈKÀÜkaÎس:v´Û6¸QDÄW À¥—›oZAÀÏ?Ã=÷XòèP¨_:w†‡*JjŠHžûΊkê×w‰ˆˆHhôèaÿ'^¹Òu$â’ŠDÄo-±9ÞoaÉзˆ®•ë.LÀæÛ>à8–@º ø˜ì:JZƒ2´rH„Ê.Žn ñ¾=>|]Ö÷K»­xbº¢m•—·1x{[ñóqñ9ô¥Å]x{ÉD{ñÛ+:Þ¨è8•¶ï’·•·ã)m_þ<ÿ…·—u}Ù~F†%T ²¿L` 6šêu¬À¬Åöœ90~øŽ>Úºtîl ÍË.ƒ÷Þƒ­[]G+¾æÍ³Î"""±¢S'HJ²T»T "•v1ð p>p9Ð Xî2 (rð2ð0Ö6=4Î^pH%-+¸ní4ŠÈu?ð+V8â}ç—¸”w»7÷-oÛemË›Ÿ)/b-ëßÞÆVÞ>|UÞã-ë>m§2|yM”·__KEñ·ß ?š7÷åшD·@Oà+às`H‰ï{<0h,[wÝ£FAÛ¶09Ò«E$æ%'ùçÂË/ÃÀ¢E0|8¬Y—\bcºuƒýËÆ¢ä«:_dŸ´4ˆˆHl©ZÕþöi$@lS€ˆD*ð<0Ø …­^׫ʻxAä'Î ]|Dªå@ –ë@"Ð,lõæ¿:)Û¯¿B\œŠD -º`#¨æ'•sßÄD¸÷^X±N: Î?N>Ùc""Ñ }{+vš5 ¶lwÞÖ­aÌ8öX8ôP¸ê*˜4 vír­ˆ;«WÃÆÖ=CDD$–œt’:Ä:ˆH@uÒ€ÑXâú(à3§E‡›G€ë×ǧM±®©„h€?þÂÆô¥¨}³ˆ”nÅ hتUs‰ˆ[Û[ŽXñØêÕƒË.ƒ÷߇]»\G+Ry99ðã–‰E=z¨ –©@DB¢ p°è\ œŒ}°+¾{ [I!¶b.R] ¤ß»ÄG« ®UàŸ°ññ׬ˆxgíZuÈ—ƒ„úxøpPh‰u7ú+{Xü€=äØ4€W_…  zu+¸øbû݉vqqpüñÖeéR+ŒºûnX½.ºêÖ…>}`ìXظÑu´"þY¸22Ô @DDbW°r¥€JìQ€ˆ„TàUà[lüqÀõÀv—AE ÖUáà|à ·áøíDà"¯Ào@­‚‘ØÒ²%Œa+Å6n„_´Î·Ý‡f ÿûß°nëHE¼·`Ô¬ mÛºŽDDDÄN€„uˆUžü|M?7ò€7€{±Ubc«…Uä½\`(ð>Öà$·áøå?À]À:"gNüÀ³Àׄ¹\ /Öä{à`·áˆD”eËìÃÊE‹l^¯H¨ìÒ .›±•ù›€À†b·ýUp{n±Ÿ­4š`M ¾n†uω„¿óYYðì³0r$$'ÃèѶ"Öãq™ˆˆ™™ðÙg6"àãaçNèÒú÷‡ .€¦M]G(R¶+®°?_~é:‰5L˜`ÆD\ëÚŽ=žÞu$j*ç¶#±yáí±äê N#Š,¹Øx…)X«ÝžN£ñ]:ÐøpƒãX¼u¶êq–ë@ÂÜmX—‡Y@GDZˆDšÏ?‡3΀mÛ 52§âÔ. {O• ìÄ:.í)¸-½‚˶b÷Ë-±íxà p(VÐÕ[±0pXÁ÷ëc-þ£Å–-Öûµ× sgxúiµÙ»¦O·Î)~h]‹Ž;Î?ߊZk^š„™víàÜsáÑG]G""±FENn¿>ý–,q‰„šŠD$l,nÅZÛ_„Ímà4¢Èé…ÿÀZ/vˆ—úuq® c/ðÖЃÇ"‰Þx®»ÎV߉;Û±–÷…ò9p„Q–t/n/QÊ÷÷`Éy€Ý@VÁ×éX‡¤¼‚¯)øÞîb?_˜Ôß%úÓKì§<)\R .%o¯‹%øcyü?Âðá0k–u5Jc:DD²³‹F©üï°i“u/ºà+8òH×J¬KO‡:u¬‹Åy繎FDbŠ$œL™ýúÙûµºu]G#¡¤" ;“±Ä›±6ññy²R¾\,Ùú1‘Wð=¶R|‘w;`ðë@ÂÔW@ààDZˆ„³½X;õMØJìllEwðñçðÕ÷0ânKúæb×¥ÙVÆí…?WRñäsIÅ“Ðᨲñ•–Ä¥š@BÁ×…«æ n¨NÑ{žd  Öb? ¨TÅ’õU ~&±àgjÜ–RÆýc9‰(“'ÃwÀŸZQÀ]wÙ¸Ü\+–š4ÉΗë×[W€¬  C×J,š>N; 6l€úõ]G#"±FEN¶o‡ƒ‚‰í½™ÄˆHXÊžFu°dëe@œË "@ñB€)ÀÉnÃñÉñX«áÿ¹Ä IÀóÀåŽãG+NÀYX%ž$–e«°N7Ë .`Iÿ ”Œ® dgBþVhr˜%ƒ“°änIeµ_¯…µq/©01\Rñäs¸ñPùYòþ´©/íX•v\Kn;¾à~…ÊzîÂÁ˜1c˜={¶ë0"F^^«VõaéÒþÄÇgqä‘ïÒ¤ÉL<ý—ZD¤P~¾‡¿ÿnźu]ùóÏ.ddÔ¥F¿hÔh.CJÊ®C”ñË/çñÛo§Ó·ïu®C‘4qâéÒe ëÿ[âÆM7ÝD÷îÝ÷ý»CèÑžyÆaPr ßED$ô{¡ÀƒX»ø1Xa@OgQ…¿x`p –„ý8ÅiDÞ»„%ÌZ8Ž¥<±"•&ŽãG›36À˨@bG&EIþ%×K±óY6VÀÖûÝh‡hÕ/¸‚¾IaÿDüe×X Ó? ÙÃ4þ|&NœÈ€\‡âârhÕêc?|&K– äûï¯fÕªÞsÌ›|°†+Šˆx<ùÔ­»œºu—sÌ1o²uk3Ö­;žµk»³lÙ¹¤¤¬áðÃgÓ¨Ñl’’þv®D±­[[Q§ÎJ×aˆˆˆ„Üĉ9÷Üs÷»­gOë’#±ED$",ÅFLÎþ´vQxË.>$r r€æÀ9XÁG¸š‡u-ø—ô~Ò€ƒÝ†#™X’ÿgàìoÓ/Àj¬M}¬ˆ©–ð?¢àº ¾¯²?ýt›;þÊ+ ]¤Tƒ`„ Ž#‰LK—Âm·Á´i6kxôhhΕŒ""åçÃ7ßÀÛo[+ÚíÛáÄað`¸à¨íOÛ‘r4h`§GŒp‰ˆÄ"—<&Làâb/À)S _?“S¯žÃà$¤ÔY[D"B;`jÁep$p=°ÅePa,kÅ~p66£=Ü%7¯ãv^sEVc±6tG¸¹ø+:Q€Dº|¬ÐçC`$0Kä×ÄÆ]\LÇZ¾þ‹ì.¸~¿àçð¯ÍþæÍš]*îÚµƒ©Sí²|9q„%vìp™ˆHøñx¬í‹/ڇϓ&ÙÐ7ßlÉÚó΃÷߇={\G*Ñ`õjظ:wv‰ˆˆHx8é$HH€¯"!Q £"‰(½EÀX`2Ðx[…,û+Y0Ím8^¹ªà:œ¾®Æ 4O§ÈHìµ6hï8_¥³€k°ùóͰÎ3¯ccï`­þwbE/oc£kÎÚbeãF8X5"¡woX¸ž~ƃ6màµ× /Ïud""á©jU8çxï={Ïóâ‹°{7\t‘A ³fY÷¤¥Y¢£cGבˆˆˆ„‡š5­8N#b‹ŠD$âÄa+/W`«1ïÇF¼ƒ­Þ”"……°b€ÿ¹ §B©ÀÀ³Øx€p´(îìwðY ¯ãXD*²øx;'6ÅÎ;'÷`«øFs°_±sçÃØ¹´5vn ¶íÛÕW$’$$À°a°r¥­f½æK<Ìœé:2‘ðV«\~9|þ9üñ<ð,Zdsk[¶„dzB_Ì›gz’’\G""">zõ‚/¿t…„’ŠD$b%c+—c3ï/ºa3Û¥H<¶’õJŠV²†³›€uÀ$×”a5ÐÜuaâ#l„ÃÃÀuŽc).+{¸8¨ œ‹­à¯\°X l¾žÃÆ[µÿwaÏ»¤¦: @Dü–š Ï=gêÕƒ“O†þýaÕ*ב‰ˆ„¿ àÖ[aÁ+èÛF†Æ­ÀêÓO!7×u” æÏ‡®]]G!""^N=Ö¬±âu‰ *‘ˆ×xX€%uºaÉîå.ƒ 3,±u p)áÝn¿6¾ài×”a5ê0›w~5pŸãX$¶e ±b§›€@ ¶bÿR`*p(ö:ýجÞîΊÂÉöív­"‘ÈÕ®Lj—åËm5âˆE¿ß""R¾öíá™gàÏ?áõ×íüyÖYЬ™u X»Öu„®rràÇ¡S'בˆˆˆ„—®]!9YÝb‰ŠD$jtf`m›ŽÄ”ë]F<ÀãØüê«ÿ¸ §\·c­«C>*X…jôÂÆˆ„J.°x¸è‚­Ö?|´žÒ€À¢‚ûß‚µý¯â˜ý¡"‘èÑ»·uxúi7ÎZ[?ÿ¼%(DD¤bÕ«ÃàÁ0c†U cÇBÓ¦pæ™ðÁí:J ' BF†:ˆˆˆ”T¥ ôèÓ§»ŽDBEE"uúaIŸW€Ï°•åwa«?FamÜsKYNº~Ýþö]âÐf Ð -ŠÙè»~ÃVìßôR±¯ë€ï±"€—€Ÿ±„ÿ<àE¬G¬;L$*,¨]Ûm" 0l˜µ\2ÄZ]÷™ IDAT}4L›æ:2‘ÈÒ²%Œü'‚ÇBÆp÷ݰzµë%,X5kBÛ¶®# ?½zYq¥F,ňHTІ`3¡ÁÆ4Å’Þ™ã w`îþé8–²Ü L©Ë㺂ëCFáN:pjÁ×Ic‘è³{]ÝôêÍK€/€–À“ÀÀ`.0¸ + H}ÈA£N"Ñ)5žx–,Ö­¡O»,]ê:2‘ÈR¥ ôïŸ|¿ÿ×]ãÇC‹pÞyÖâ6?ßu”âʼy6 NŸz‹ˆˆ OغæÎu‰„‚Þ‰HT«†%“ÅZGÄI/±Þ…õz¬[£ÀmX«ûpÒK¶‡S»ùÂÑ FáFp.° ˜ì6‰p™Àl,©?h„ý¾ŸLÄ î/¸O:ðvÞ¾ýR%ô!‡Ta@Íšnã)ÇãÙwQE|‰§E ˜4ÉV_üõ—u¸á†¢ßýHnÏA0…ê±FÃ1†ÇP–h~l‘¬qcxðA+x÷]ضÍV¸y$¼ðìÚå:B µùó¡K×Qˆˆˆ„§6ml¬ÒÔ©®#‘PP€ˆÄ„ZÀÃÀJ,‘y¶rôÂ/ùJC·°Dû0ÂëX$`# ^Âås›õ@"·Å¸¿²€‹€ÅÀ§Øêl_¬Æc¿ÓàDàqìõu0+2YVpß›±Ñ ±ØqbϨUËu"¥Ë“¥•áG!âéÙÓZkE-[ÂóÏCN„Tª†ÛsL¡z¬ÑpL£á1”%š[4HH€ .€™3m&ü 'Àˆ6*àÖ[m$‹D¿ôtX¾Ü:ˆˆˆHéz÷ÖxºX¡"‰)õ±6øK€cØìù¯\åØ låíkÀå@8º ëØ0Öu þsDˆåbÅ"³€)@{·áHHÇú#³€C€VÀ•@–Øül>îÁFM¤8ˆ7efB|¼ë(D$ââ`èP 0dˆ%ªŽ>ZÈÄ­& ž£Ž‚—^‚uëàž{àÿ³Uogži«Þòò\G(Á’–fÏïñÇ»ŽDDD$|õí ?þë×W|_‰l*‘˜ÔxX€­ì>›Aý½Ë :øx+ ÈrÎ>©À?€§˜þÄZ–ÇŠ|låöÀd@¥4+°¤þÕX‘Hà4¬}2–àÿØÌžÁÎ3M]!235 @$Ö¤¦ÂOÀ’%кµÍiìÓÇŠ$ú¨@$4j׆;î€U«àƒ +Ë>ônÓžyvît¡ÚwßA£FP¿¾ëHDDDÂ×)§@µj*>*‘˜Ö˜ ̶€óŸ]åÈX«÷iØ1Øã6œ}n¶o8Žb¯À=ÀKÀ{À)Žc‘ð°˜<‰V9hµó_ôÅŠ‰6k€w[€n@5ñFª¬,ki+"±§E  0cüõ—u¸þzزÅud(* ½øx8÷\˜>/†^½à¾û qc¸ë.­‚‹&óæAU¯‹ˆˆ”+1zôP@,P€ˆÐ[¡ú!Ö¢úlú2‡1¹pð¶j÷l Ãm8€%Ý/Ãf‡»‘»žØ)x¬à2èç8qg3Ö%ä. ;Ö®ÿà ìMäXQ@:ð50 8½"þÛ½jÔp…ˆw<Ͼ‹·÷ ÆýýýoU6_·Ý³',XcÇÂäÉpðÁÛñxFàñT+õç¼ÝeŽg(ørœ+º_  ”Ü–¯ÓÛï{sL|9¶¾¼†©ävƒùúuñz7ÚµƒçŸ‡?þ°€qã iS¸ürø9WD™´4ˆˆˆx£o_øüsÈÎv‰“ŠDDŠ9ø[ù¼8K@ÿê2¨ë| ,夻 °DãïÀDÇq¬'6Æ<Ü < v‹„ÖJà5àJl…ÿ!XRÿà`lÁ}6“°NÇU\Årr¬-›H¸óx<äç瓟Ÿ¿ïße%ýî[üö’÷-¾ÝŠî_\ñû–üYùOiÉÞòîWÚ¶ãâ`èPX±î½7xXÂäÉÞm¿äã÷%¦Òs°£e ã«ìã/K {ÉÇVÚëÊט+zœ…·yûœúóûZüþ|”Ü¿·ç›ÒC î/Ñ#5î¼V¯¶¢€´4ë¾rÖYÖE"ÏêÕ°q#tîì:‘ð×·/¤§ÃìÙ®#‘`R€ˆH à, þ&ðи ko :³°â‡S¿Ü†C `¶Ê¸òçû'ØJôwx¸x¸Þq,\ùÀRàE`öÚn܈uDLþÆF¤Œ†`¿\;v@õꮣ©XÉd¦??çÍ÷½ÝvñD^ ù¿E em;9FŽ{GšFÿþùôì™Ï?øV”àKLe=æ`%EK{îÊ;ξÆçÏsâïë;Pü->)+VŸSo{(Ž•¯ûöý%zT«W^ic>þ22lNnÇŽðî»Vœ)‘!-ÍFjuìè:‘ð×¼9´iŸ|â: &ˆˆ”!¸X ¼ÌÀdðÙðÑ®-0Øœ¬vµ#ÿ[‘캂ëhîðp5ðÖ @¢K°ƒ:ÕÇV÷ßuü¸²;ßú©.‚qÊ=H¤*oE¶7IµŠ²¾&ò*Ëßx|)ð­cÁZàbæÎõ°g%9®¾6oöý¸x»ò<Ô|]Íï-_8$ý)†)¼Oe:8øúûêêX•öøÊ‹)÷—èæñØŠ¸¯¾²q,-[Â¥—B‹ðïÃή#”ŠÌ›GII®#‰ g~è: &ˆˆT [ýº kþ ¶öܯ¶fX!@  –@tåhàLà_Žö¿¾àº¡£ýÛ¬ÛÅ=X€D¾\ x èÔÅ~²°1ßÛ€O±Ân¨µ¿ˆW°Zl—·:Rx{lºv…9s`üxøôSKTÙ€–ª%T3Ò}í˜êø¢?ÇLÇVbÕqÇÁ;ïÀªUpÞyðÏBãÆpÿý°e‹ëè¤,óçÛßHñÎ9çØûeË\G"Á¢"/UÁVI¯žÀæÓ7ÃVÑFóçõ±Ñm€“ ¾vån`Ž£Öc¯ƒì;Øþ‹ºÜ†M–È”ý~ŒÂ fj þ]Kþÿ„¯>†€x±ŠHì)9w;ÐÛŽdþ ²k®¿ì/ø&OLLÅÛЗ¼„BEÉg×ñE"_ŽY0_E"Éá‡ÃÓOÃÚµ0bŒ MšÀm·ÁŸ±Ð0‚ääÀ?B§N®#‰ÇuêÀ”)®#‘`Q€ˆˆªb³ÒWasÓÇMÛMã ¦ZÀTàT 7–@tá ð¨ƒ}oÀ "¢íçÀ`à&à1DZˆoö_ciŸ^XÒÿ¬cI 0X‚u,y{Ž&ú^Ã"þŠ'ƒ‘PŒä¶Ý•=6ÉÉ0r$X¹fçŸ'Ÿl‰HSÚ1ˆÄç4Òû÷U$¥¦Â½÷Âï¿Û9÷½÷lŽîµ×ÚmâÞÂ…‘¡N"""¾ˆ×H€h§ÏEDü”ˆø xx +¸KG›jÀ{Àe@àUGqÜ ||âýnê…xŸÁö!p10 xÒq,R±ÝÀtàŸXWŽÔ‚ëWCg€ÀŸÀ;Àµ@;@éq)Ô«‰#)iØc³¸˜9s`ÏèØ®¼ A¶Z%“Ï‘ôœF:­þ)_pË-ðÛo0f LŸ­ZÁ¥—ÂÒ¥®£‹m @͚ж­ëHDDD"ËYgÁܹ°u«ëH$T "RI5°¶Ú¿cóê ÇܬsW0Äc{`Bí  v¬Ci Ñ5 `20 ü%ŠÃÑn`VøÒ [é–ào¼„wVoW-]*"`þ$}ƒ™4ޤ$t×®0gŒoÉ)+»—ÌLß¶¹¼Dt8ÄitÌD§jU¸újÉòÆÖ}¥}{8ÿ|ø>ÔÕêÀ¼y6 NŸt‹ˆˆøäôÓ­#€FD'½5 D¬Ýö¯Øªê€æØ*ëÕîÂ Š‡€ÿ`+’oB¹Vȃ%E'ËB¸ßMDO'€€‹€«€çQ@¸Èfc¿_=€:@ì\r46zäO`%¶úÿ2 ‰‹@%è”§‘Håí*â²’‘%ò+Jbº ²ñø#Ûôx`Ð KNÁ(à.Ú´wÞŠx»x̾l7ØñEòh‰²Tö˜UôûêêX•v¾)/¦@Ü_¤¤„<-‚>€µk­KŸ>0{¶ëèbËüùÐ¥‹ë(DDD"OJ ôì©"€h¥"‘«†%þWb³¹§­±„ëoã ´aÀÛXù +„û>[ñÊN›ƒB¸¿`™ˆ\rDÏGÜ‘'ø +:KúŸ¼Ž½¾_ÇÆP,^amÿ%úÕª…Ï«vE\(ž8ó&‘Xxñ6©Vüg¼ý¹`wðçqø²Ý@&ÁÞ-µ¢W/¸äèÖÍVKú[ ã+m_¥ý»¢ŽÁŠÏ—×w ÷lÞ3_i(Ž•¯ûöýEŠ‹‹ƒsÏ…´4˜6ÍÞÇx"œzªŠB!=–/·N"""⻾}áóÏ!+”ðKH¨@D$Hªb‰ÖåÀ‹À,¬àr¬1k4¸øø8Ø¢ýÆa]ÞÁŽo(l!ò;¼ƒ%’oÆ ~ÅÚø_ˆ½ž:`k4“'°â¡ÕØJÿ‹úN¢תTѼ$ü_A[q‰šŠDDB$k›¿,Úçb…‘ì8à,™ÙX‚}vx+°¦Œ‚Ë!AÞO°Œ†`ÉçÇÇíÒ€›#±5–W`+ü¯À~O¶b4nŽAoÆä@Õ«ÛÊ1‘`èß–-ƒ»î‚Q£ MxçPNSD$ðN9¾þÚŠ22¬KŸ>6Ã^cÞ<èÒÅu"""‘íì³á£\G!¦ÏEDB,[Åþ30Kœœ |î0®ÊjÌÁÆ œ,Á>m ~7€M×y?Áð"0[uþ˜ãX¢ÑàKà^ +pp0èLÅ’þ_`E2UœD*‘¤Z5رÃu"ÍáÞ{aÅ èÕ .¹ÄSó"½2UD$Lr |ó |ñìÜ ]»ÚüÝ´4בE¾´4ˆˆˆTV¿~°z5üü³ëH$T "âˆ8˜‹µÓ¯ œ­ªÈsšß³€f@`f÷WØ à¿·è`sÁu¤ Ê$qK´È¾F§µ±1±UýïbE#ßc]z5œD*‘,9YD©øœyo/±¢AxõUX°Àºtë_ k×ú·½X:Ö±ôX+KÇJ¤H¯^0{6|ölÛ;ÛÊ»~pYdZ½6n´ã("""þëÔ 9D#¢ŠDDÂ@Oà3,qØ ¸h¼d¹ Ë/©XGƒ^XQÄ ïïàࡠ ’F Þ Ü<ƒ­Rÿ­^Á:xtÆ`¯‡ç±ñ+°® `ÝD*#1vH¬‘ˆÔ¡̘|`+*Û´ûîƒ]»\G&±¬x1€ $Úœ~:Ì™S§Â¦Mб# hãZÄ{ii`ÇODDDüg#‹T]T "FŽÅVÿ‚µÔ¿h%rw;ŒËWÕ÷€›€K î*ôÂn‹‚´M@"¤íR>p=¶ }p£Ûp"Ò¬e8ÐhÜ lî–ë·€+€Æn”(V»¶]oÝê6‘h‘ŸŸïó%Vw,Y? Ï=­ZÁk¯y_”KÇ:–keù{¬tü$ôîm£X&O†_~öíáŠ+`Íב…Ÿ5k 3sÿÛæÍƒ#Ž€¤HøÏºˆˆH˜ëÛæÎÕçQÑ$Áu""r VÀ«Øêö§°•Ü#±¤úõ@w¡y̓%¢›` Ôß±•ÒÁøÃs>–¬}˜Tâ{Ëdà0/·µxHÁVtׯæ»×ÄÚÀ§»T­dÜ–\Ž’LÄfÓ‹w–`‰ÿiÀ7@&öš:xoQÝYtkêœä·mƒº‘6‡DD"^ÕªpÛm0d<ð\s üç?ðÔSг§ëèDD¢ÇçœccÞ~|Њ°®¹î¹êGRKº 3Æþutï]ºÀ̙е«ëÈD$Ö=ù$üõ—­¤.Ô¦ |ú),*X±”—gß¿å×%|~º½N§M³1qù<ù*§ {Ï\öC[°Ñ‘à#àb ;–œ®„}LÆŠ~Àf³ÿ <€S¼ òr;›€z_Wò€ì2î{Ö¥!ìÅÆHLþ‡c²mÅŽÕXâV\s6Æâ4 ¡³è$Ö­^ M›Âüùšo*Á5xð`&Löð‰dK—ZQÀgŸÁEÁ¨QÐXmpDD‚&;Ûº°<ü0lß7ÞwÜQÔ-*V=û,Üt“}]¥ äæZR-1Ž?ºu³Â€Îm¦±ˆH¨Üx£ÍV«Vö}öîµëÜÜý‹D‚Áãñ0aÂ.ö#“Ê)Рèc‚è ÓˆH8[å¾ëðÖ-`ð½»°¼Ö˜,NÄZ©Ú¹ÀÑXׄ;±‰7 ¾·Ü‡íYðõ^Ê.¸ÆÇƒeИ…­fWÀr¹XaH7ìyŒu¸˜€¼‹µøW€¸T¸ú_í×D$´kg3«?úÈf/·i÷Ý»v¹ŽLD$:U©b]V®„‡‚W^fÍà‘GbûÜÛ¤IÑ×ÙÙE£j23aÆ =Úº)Ô«›69 QDbÔ…ÚõÞ½e_ªV…›oV€„¿¾}­@n®ëH$tʉ 5°«€ñÀJ #p ð 6>\uæY@WàçoÖ`:6B! KàÇË|ÜV?Êoõu5hç{˜~ÙSÎ÷¶a«Ö3±·˜?€W€ °¤7¬0äà=` öš¼èŒ=¯"á 9Ù>üU€ˆ„“³Î‚%KleêsÏY«ê×^+J”gÛ¶àÇ'"m­Ëo¿YûèÑ£¡ys[mš•å:ºÐ+^PR~~Ñ1ù×¿Ô @DBë„àÐCË¿OV–Ú«Kd8óLûÆÙ‡òaVŒ*ý°¤uIžXg…YX'„X–µö´Å^7™À?_€ß—±Ñ)nÂñJíÚð÷ß®£Ù_Õª–Z¹Î;ÏVªvìh3™Ë’—'ž¨v’""þªYx~ý.½n¿Ž8Þ}×’ßåÙ¾Þ?4q[yEññж-Œ’pDDöñxà²Ë¬˜¿,kÜŸD†¶míõúùç®#‘@P€ˆH„;K|.ÄVÛ_ƒ%Û¶;Œ«,µÏ°öõgbE Ååb®¥âü_U°ÇüwÁÏ–æ7,qï­.X×…²ÔÎña{•1 ›[VðQh ÐYð5Ð:Dñ„›UÀà llF¬¸älì¸ýuɸhã(FrlÙâ: ‘ÒÕ­kÝ.´¶Ë'Ÿ ýûêUÞ÷­·¬ƒÀ%—ÀW_ø}ñNݺðİ|9tëƒ[BiÆŒ²æÎ;aÀ€è8ÿÖ¬ µj•ýý¼Z°VüáÂ<‚µý¸xx‘¢Uû_ÿ+gõ±¹îÇSqR¾¢®%YÆíùXçPxX‰äaÅ §b£fõB‹Kë°þçb«ýÏÀVûŸ‡AlÞ.¸ Q$à;LE"9z÷¶äÓÓO[bªeKxþy5 ¶m³vÕ¹¹°gôê›7»ŽXD$ò}´a}õ•W=.¿Ö®µïaEX{÷Âi§EþûËV­ŠSqIIðøã¡GD¤¸!C àñX¡l»vnbñÇ©§ÚÿáfÍr‰T–ŠDD¢T-`Ö VÐè ¼ ”Ñ¡*äþ|üëZP\p#°§œŸOÅŠÊZ¹¶z¹qÁ㪃€ƒ}Ü–?vw³‡ƒlÄC½åxì1ÈÉ)ºOv6¬_oEîb‰&'Ÿ ii0~<|û-´iƒÁ‡µ¦ÎÉ­[­ ’Wõ5mz`‚-.F†ƒCñu‘r ´ÿ{_°÷È—]æ&Õ­ G_|á:©,ˆˆD¹àB`0h )¸luÚ> ®Kôç°doy±B‚‹(û›¯cŠËÆF„ÂãX¿䘃lì9»k-6c#".Á’û ®?þ>®Åž‘h§"‰T©©6³ºwïÒWkfg[Kê­;€ˆˆTžÇcɧ%K¬ Ë'ŸØ–â²³mD@¿~¡ÿ™lÒÄV&JH°W]å,$‘}š5ƒãŽÛÿ=pN\x¡»˜DüuÚi0}ºë(¤²T "Cºï¿cÉõFXbÕ×$y lÎÂ’Ûy¥|?ð{ÛIÞnâÀb‚l`±±õª|‡­JïêÇv|UXøSÆ÷³9XÂp%VàpÖ¹a%08¨î&Lg6„;ì""iæÎ…)SŠV –” Ó¦Á 7„6.‘hWµª­ÞÛµëÀÕ¨`çß9sll@~ÉŠóФÉþ[òòàå—­€ˆH8¸ôÒ¢"¬¸8èÜ?ÜmL"þèÕ –-Ó•H§·H""1¨10›µ>ø hœ |Á«Ï+âïgYX‚we'¼ ÝìÅö<ÀÓXb¹d!€?Eg°ÿjû’ã ‚å>*Nî瓱q ‘"cpp(Ð x hLÂVûŽçVŽb  Z¤¬_ï6_åç[r¿ä Ô’rsáÅáÉ'C—ˆH,سFŒ(½K¡œxï=¸çžÐÅ(Mš}]8†æ˜cœ…#"r€­@ ì\%%…¸‚صjÕ">>žäädªT©BRRռ͊HDKMµN,‹ÛåÇíü»i“}?!Á:Meûva!Ö¬YÐ¥KùÛß¾};dddžžN~~>Û·oØ÷éâçßÂsnÉóiyçâ²Îß…ì|fËf솙3÷ÿ~ñsq||<µ ª o¯V­III@ÑyµFT­Z•ÄÄD’’’HIIÙw‘È“››ËŽ;ö{¶oßN~~þ~ç¢Â÷…ŸýìÝ»—ŒŒ €ý>ïÞîÿ^4GVÖ› 8eß} ß§•¥øy«PṪJ•*$'[Íâïï ·GJJ `缪U«’’’rÀ{J_tí /¿ ™™Pâ¿/!T ""¥ª ŒÀV¦Ožú-°UñW5ÿPÔŽ>¸kñ>ß¿u°$÷MÀ÷XRúM,Á‡ä÷‡•²uëÖ±råJV¬XÁªU«X³f ëׯ砃bÇrû«¯rû­·î»õêÕIII!%%…š5kðjíÚµiúÕWìjЀÌåËù­à?…ÿ¡Ø»wï¾"‚;wîK\\õêÕãÐCåÐC¥aÆ4oÞœV­ZѪU+š5k¶ß‡ yÀ-5+‚ÈNÃÆ-ô&8í{v× öãmÀìuñ0{nºaú­¨H jÓ–,q…ˆÄªíÛ·“™™Iff&Û¶mÛ÷ua(33s_!eff&;wîÜ÷áia§ð=SñDQ;©^½9;w6#+«=pШIïÞ ÀÉØ §ò%$$P³fÍ}ÿ.Lâû}Z\ñäOEÊÚFirrrX»v­W÷ö}]rÅßO–VœZ…ïs«V­J5ö}\øasñ"„ÔÔTâããIII¡F$&&R«V-jÖ¬Ibb"ÉÉÉÔªU‹ÄÄDjÔ¨±ïfo­ˆGժСƒ]ŠÛ°asæì⇲X¼ØÃÒ¥‰¬]›LVVùùE…X½{ßHNÎ2vïÞMff&;vì`çÎdddìWtUžâ ¬ÂÄTÉsoEÅIÅ‹žJúûï¿iÐ`:M›¾Ío¿ý±ß÷Šÿ­ýÏ«……%‹ËÊSxžLII!))‰¤¤$RSS©Q£IIIÔ¬Y“ÚµkS§Nj×®½ïRüßÞþ‰e999¤§§“žžÎ¶mÛö}žžÎŽ;ö}½sçNÒÓÓÉÊÊbçÎûÞ+mÛ¶mß{Ð;w’ãíLª%Ù¡ôä|IÅ“íUªdÒ¸ñ74köå¾ïçææ²fÍšr·Qòåm‘‚7RRR¨V­ÉÉÉÔ¨QƒjÕª‘ššºï]«V­}…P…—ÔÔÔ}‹žRRR¨U«Öÿ³wçqQ]çãÇ? ‚,"²ï¸*‚¢à– *ؘEÔ,6Ö$j4­iš´ÍÏ4mšäÛ4É·iÒ6M4i¶&1³™ÅF“ãN¾I@0ŠÈ&›ìÈ"² ¿?è½™¹g¦Ѿ´}OZ[[©ªª¢²²’’’ŠŠŠ¸pá………RPP@ff&´µµaaaŸŸÓ§OgöìÙdýøÇìœ6 Úæ7úwÊúåí«%äѾê‚í«-ty|@íÏÇ>Ú/aOûÊ1´¯¶àdÀX…‰^|±ýº®.h‰®î¸ãvíÚ¥q$B_”ŽÂž:Pu;Y•ß_¾|™Ë—/S]]M}}½ÚÁØkkk¬­­ÕÁeXé?kkkµí©;ñÇ«}”•‹‹A‹þ›\ª›øTSSCSS555j°ªªŠÆÆF._¾Lmm-jÛ¿¡¡êêjµžÓ½ueôèÑœœœpvvÆÉÉI½9;;w¸999]µ–0333víÚÅÚµk½/xðAxøa=&ŒN’„Bô[5í—x’ö™ú]åØZÐ>¯ëKÚgùFZZ{yß‚n¿½ý—‘‘xegÊŒ3`Ê”)âÜÍ·­Àª««###C½%''“˜šÊ¹ýûÁÕ»{ïåÚ¢"ÍŸOdd$sæÌQgµéÓ«´¯ºÐFÇçï,í—¨ѾÌÿ> ˆö¤„˜ÿÜúL¡ø÷¿áÆÛ¯¯-×;† I¦«©©©CG©Ò‘ªt ^¼xQý½²*‘20Ñ•1cÆtlÕÕcoo¯všv7»»óÀ®¹”äÝ„‘žVP¶íœ”¢$ªtµ$¸²*îe·œœœpqqÁÑѱCsç›CYSSEEEäçç“——GAAäååQTT¤öwÔwrrÂÕÕWWWu@Yw6zW3Õå2!ú×ÚÚª&(‰ºÿWC;'n4ë\ŸÁÜÜ\]]Õ}||ðõõÅÓÓS½¯› '„!µ¶¶RZZJqq1.\ ¤¤„ .PZZJAA%%%jµ²²òªÇÛÛÛãêêÚa`ØÉÉ©ËÙågË%9LƒnÂFW·ªªª.“?***®Jµ±±Q“ÜÝÝqssÃÛÛWWW¼¼¼pssÃËË wwwùœ$}&¬\ 66ðþûzL$!„<`"í3Ä»3šöÙåÿó³¯ ùâ‹/8xð ÇŽ£¤¤GGG"""X°`V‹ÓÄo‡É¨ØY ¶¡NŸæäÉ“œ8q‚ØØX233±¶¶fÁ‚,^¼˜åË—Š™™Ù€Ëª6ŸÒž k4°˜DûÀÿ!Ú'Âi_â90sÀ% !ú+'&Nl_v-<\ëhÄp$IÆÓÔÔ¤vú—””PZZJaa¡:[S¹•••QQQqÕe† }½‹‹ËUƒžgQ+¨ºÿ—N4aª”¥}»ZµBwE Ý÷‡r뼤·¹¹y—‰º3m=<]’†¨+W®““Cff&éééœ;wN½Ÿ——§~–u7XªÜÜÜÜ4>!ú¦¶¶VMdQ’ZºKnqqqQ/ëïïO``  ûïcúLHLl_òܹöþ)1´H€Bˆ~û¸ý?÷•®®Và =_à/W®àöÞ{üóŸÿ$66î¼óNî¼óNBBB ò°SVVƇ~ÈÎ;‰ÇÏÏ 6pï½÷âîþß¹ûÀ:`?½?7£€mÀÏ µ¢¿~ó8v â㵎D G#=  ªªªÃ’ÌʲÌ=-»ëççwÕŒM///¼¼¼;v¬†G#„Ч¶¶6JKKÕë³+É?¯ÕÞØØ¨>ÆÝÝ]­&L˜Ðaiî &H’ÀVRRBbb" œ:uŠ3gÎpþüy®\¹‚••AAAê€ê´iÓ˜>}:&Le°…I),,$--MMXQ~VT´Oïpsscúôé̘1ƒððp q+2šªææf5éèÌ™3¤¤¤pîÜ9Ο?¯®rãææÆ”)SÔA΀€™8q¢Ìà#Fss3ùùùdee‘žžNFFéé餧§wX1EIÔ›2e 3gÎ$88˜àààa³z€>“._{{øäXµJÁ £’$!„ý–œ¡}ÙøK@ PÕé¾r»üŸ[“ÎãGýþ÷ü8'‡7²dÉFeÌð‡´´4Þ}÷]þùÏRUUÅš5køÕ¯~Eí¬YÜ”ÓûeæÀbà¡‚BôËÀÝwCM H?²Ð·ážÐÚÚJAAA‡A~ÝAe)I |}}Õe™}||ðññÁËËKõ+36…])..æÂ… êµJr€rÝ÷ÒÒRÌÍÍñööV“:_¿ÛÑÑQã#ŠÒÒRÕAÿÄÄD 077'00ÐÐPuötpp0“&M’ï³bH+..VΞ=KRR§OŸ¦®®Ž±cÇ2{öl #<<œ€€¹T…åææræÌ’““IJJ"99™´´4š››3fŒšxÔyÀßÞÞ^ëÐ…0iÍÍÍdgg«‰œ;wޤ¤$5!ÊÏÏàà`BBBÔÛÔ©S‡\bŸ>“&Nl¿$Àï¯—Ý #’$!„U^^Οþô'^yýul=<¸}ófnY¿žd.Œ~566òÞ{ïñÂÖ­$ÝpüéOêß,i_ê_¡,nÚÝ¥ª€q† SÑéé0e œ< ³fin†K@ss3™™™$''“ššªÎnKOOWgFÙÛÛwxÓýéçç'— BDmmíU HÊÿsssinnOÕ?~|‡™äÊòÜ^^^ÁðwþüyŽ;ƱcÇ8~ü8ÙÙÙ˜™™ØaàsÖ¬Y²â‹1ZZZHIIésúôippp ""‚ÈÈH-ZÄìÙ³¥5eeeÄÅÅG||<ñññTUUaffƤI“ !88˜3f‚¿¿¿œo!  °°PM¼Q’pΞ=Kcc#£GfæÌ™Ì›7O½™zB”¾“®¿<=á­·ô²;aD’ „ jkkyñÅùË_þ‚µµ5>ú(›6mÂÚÚZëІ½Rà•S§Øùùçdçå>>Q«V1ÞÙ™*Ú/  ü¬¦}•€JÚWk(Š€Ï€ëµ _¡£­ àŽF 7C-  ¹¹™sçΩ³Õ”ÿŒŒ š››=z4þþþÄÔ©SÕÁ~­ÃBˆZZZÈÏÏ';;›ÌÌLRRRÔkÌ_¸p€qãÆ©ÉS§NUg ûøøhýЕžžÎñãÇ9vìG¥  {{{"""X¸p!óçÏgöìÙ2£VˆNZZZHNN&!!ØØXŽ;Fnn.cÇŽåÚk¯U“æÎ+ƒÔÝhjjâäÉ“ê \\ÙÙÙŒ5Š   æÍ›Çܹs™9s&AAA²•kii!33“¤¤$ˆ‹‹#11‘Ë—/3~üxõ=;oÞ<æÏŸoR+;é; à´¾øB/»F$IB!ô¾âg?û•••üæ7¿áÁ”//hkkcÏž=<úè£deeñøãóÛßþvÈ-a%ÄH·t)øûë¯j‰nL9  ¥¥…ÔÔTÔ[RR Œ=šÀÀÀ«®Áˆ¥¥¥Ö¡ !Ä UVV’ššÚáÚÝ©©©äççàââ¢^³[ùéíí­qÔ¦©©©‰ãdzwï^öîÝËùóç?~<,^¼˜ÈÈHfÍš%Kú 1999?~œ£Grüøq²²²7nË–-#&&†o¼Ñ¤ÅŒ­µµ•Ó§OsèÐ! |))ZG"†SIhkkSü•%gO:ÕáZ´ááᄇ‡3sæLüýý%¡M1"UWW“ššÚa‰îÔÔTZZZðððè0wî\\]]µY/^äË/¿dïÞ½|õÕWÔÔÔΊ+¸ñÆ ÅÜÜ\ë0…v Ø¿?{÷îåàÁƒ466rÍ5×Ê+˜2eŠÖ!\vv6äСC>|˜òòr|}}Yºt)ÑÑÑDDDàëë«u˜B=ª©©!..ŽC‡qèÐ!Nž<ÉèÑ£¹æškˆŽŽféÒ¥„‡‡5áPßIÿ;üíoPP —Ý #’$!„zqöìYV¬XA]]¯¼ò «V­Ò:$ÑIff&›6m"..ŽW^y…»ï¾[ë„}pü8,ZEEàî®u4b8Ñ2 ==ÇsøðaŽ;Fii)¶¶¶Ìš5KÄ '00Pj„¢uuuüðÃjR@bb"iii´¶¶2}út¢¢¢X²d ‹-Ö3r›››ùòË/yûí·ùòË/=z4K—.%&&†åË—ã.(!Œª¾¾žC‡±wï^öíÛGaa!aaalذµk׫ú(--Ý»wóÑG‘œœŒ££#QQQDEE±téR´QaD/^äÈ‘#ê* 8;;së­·²zõj/^lð„}'ìÚÕ~‰ÊÆF½ìN‘$!„´/¿ü’5kÖ0gÎ>úè#œœœ´It£µµ•§žzŠ?þñlÙ²…?ÿùϲô¥&®¡ƇwÞÿXëhÄpbÌ$€œœŽ9¢v†âììÌâÅ‹Y²d .$((H>“„BjkkIHHàèÑ£:tˆøøxZZZ˜9s¦š9,–ŸNKKcûöíìØ±ƒ’’¢££ùéOÊòå˱¶¶Ö:}ÿý÷lß¾?ü††V¬XÁ† X¶lÙlÿ;wNø?sæ ¾¾¾ÜvÛm¬^½š¹sçJ«B•““çŸ~ÊîÝ»‰‹‹ÃÙÙ™[n¹Å  úN8x~ô#¨¨€a”Ã5"H€BˆAùä“O¸ýöÛ¹çž{ضm›,Ï;DìÞ½› 6pË-·°cÇÌÌÌ´Iу%K`Ú4øÇ?´ŽD '†Lhmmåûï¿ç_ÿú{öì!=={{{-Z¤@…„„H©BA]]ß|󚌕€™™ .dÕªU¬\¹???­Ãì³¶¶68À³Ï>Ë‘#G˜ù„7ÞxƒØØX|}}Ù²e 7nÄÖÖVëðzT[[Ë|Àk¯½FBB>>>êÀÿüùó¥_EÑ«¼¼<>þøc>úè#âããqwwçî»ïæ§?ý)&LÐ[9úN8u fÍ‚Ü\¦ÖÐ"IB!ìðáÃÜpà <öØc<þøãZ‡#úé»ï¾céÒ¥lÞ¼™çŸ^ëp„=xâ Ø½ΞÕ:1œ" 11‘;wòá‡R\\LHH+W®$&&†°°°!9ÓK!†›šš>ÌÞ½{ùüóÏ)//gΜ9üä'?áŽ;îÀÕÕUë»uàÀ~ÿûßsòäI®»î:~øa–,Y"ƒoB AYYY¼øâ‹¼õÖ[ØØØð»ßýŽûï¿KKK­Cë ¸¸˜¿ÿýï¼öÚk455±zõj6oÞÌ‚ ¤îB Xnn.Û·oç7Þ ¨¨ˆ•+WòÛßþ–yóæ zßúN8sfÌ$€¡H¦]!„¬¬,n¾ùf~ö³ŸIÀµ`Á>ÿüs^~ùe^{í5­ÃBô`ñbHM…ÒR­#âj—.]⥗^"((ˆððp<ȯ~õ+²²²HJJâ©§žbîܹ’ „&ÂÞÞžU«Vñæ›oR\\̱cǘ={6O?ý4žžžÄÄÄpàÀLiÞÐùóç¹ñÆY¶lœúˆÂÂBæÏŸÏu×]Ç?ü uxb˜$!„ýÖÖÖÆÏþs¢££Ùºu«ÖáˆAˆŽŽæ•W^áᇦ  @ëp„ÝX°ÆŽ…ýûµŽDˆÿ*//çá‡ÆÛÛ›Gy„%K–@rr2¿ûÝï˜4i’Ö! !„èŨQ£ˆŒŒäÕW_¥°°P½^÷õ×_ÏôéÓÙ¹s'­­­šÆøÚk¯BAAGŽaïÞ½„††j“Bœyæ™gÈÈÈ ""‚åË—³nÝ:._¾¬YLo¾ù&¼óÎ;üå/áüùóüæ7¿ÁQ.†-„гQ£Fqë­·òý÷ßsèÐ!.]ºDxx8›7oæÒ¥KZ‡'†8IBÑoï¾û. ¼üòËÍ|633So=ýÎÐejÍÐ1mܸ‘ˆˆ~ñ‹_dÿBˆÁ³²‚eË`ß>ã•ifößÛP`¬xûRÎ`bÈãŒý\µ´´ðç?ÿYí}üñÇÉÏÏçå—_&,,Ì8A‘1ÛÝ•ejmc0…s1ϻ٬¬¬¸õÖ[ùúë¯IJJbÞ¼ylܸ‘Y³fqäÈ£ÇsåÊ6oÞÌ}÷ÝÇ–-[HHH`ñâÅFc ä³Cˆþóòòb×®]ìÛ·¯¾úŠk®¹Æè“jjjXµj›7oæ®»î"##ƒû￟1cÆ5}z¨wºq›b y¢¢¢øöÛoÙ¹s'{öì!44”„„­ÃC˜$!„è—ÖÖVüqyä<<< ZVWËOzIJSZòRaŒ˜¶nÝʾ}ûˆ‹‹3xYBˆ‰‰i_  ±Ñ8å™`uØ#cÅÛ—rŒ6:à IDAT}îŒYž2CëÉ'ŸT—ü衇ppp0^F¤t«}`Ší­È¹B[ÁÁÁ¼ýöÛœ>}š‰'Í/ùKšššŒR~[[÷Üs|ðûöíãü£É]'¼;òÙ!ÄàÜtÓM$&&2jÔ(¢¢¢())1J¹¥¥¥,\¸“'OräÈžþù!ÛÆ•z¨wÏÑP<1<™™™±víZ’’’˜2e K–,áÀZ‡%†(IBÑ/¤¨¨ˆ 6hŠ^H†o»É“'³xñbÞ~ûm­CBt㦛 ®Ž3Ìþ¥:4 mm¦›€qöìY.\H[['Ožä‰'žÀÎÎNë° Î:ÛÚÚ ZþPjê\tu }ÞGŠ¡ôúÒ·ápìAAAìÙ³‡;w²sçNn¾ùf ^î?ÿùOvïÞÍ—_~É 7Ü`ðòôM>;Œ¿ßáð~ÓŠ)ž;oooŽ9‚½½=6l0ø{©©©‰[n¹€ï¿ÿž… ´wãÆã³Ï>ãÛo¿åã?6hY/¾ø"ÙÙÙìß¿OOOƒ–eh¦üœêÓ`Žs¤œ#ѽ¡ò5jÿøÇ?X¶l›6mÒ,ŽŠŠöŸNNš… H’„Bôˉ'˜?¾AËèÏu¸zÍ.Ýí{{|O×5S~ßÛ6ýùÛ`m æÌ™CMM¦™¥BˆžÅÄÀÞ½úݧnÓ×kÝwõ;å÷]ÝïîÿÝí§»ú²Í@ô·ì¾ìg°q $F}Åѕ矀O?ýtH^µ;Ý]´§vBwÛ ¦Ü¾nÛ×ýôô»Îïéïý‰«?íîkˆsÑ—¿uÞN_euµßþl{³«¿÷t|ƒ=få¾îï»ÚFŽ}è æ³Ï>ã…^0èw†íÛ·3nÜ8Ö¯_o°2£§×Vçmºúÿ@_½½æ»Û¶¯ûéký5Ø×÷@Þ7ý­Çûó>Ìs#u•áùøø°~ýz¶nÝj°2šššxþùçyâ‰' ~ÙK}‘zhpmŒ¾>¶·÷t_¶èñuW_öÝŸºo0õ¸Ô}ÆaffÆÖ­[9qâ‡Ö$†ÒR°²[[MŠƒ IB!ú¥°°wwwƒí_ixõeÉ033³Ûô§Ñ¦û¸žÊꮑؗØ:ï»só«¿õôxCS²Ý‹ŠŠŒRž¢ÿV®„ü|HLÔß>u«˜ž–¢×­¦tï÷TEéþÍÌìêÿw¾¯[~ç*½/Û Ä@ËîË~ú«?ûîîØ{:σ±gÏV¬X•••~v¨1¥³§óçlWK‚võyÝÖÖ6¨ÎÓîöÛ•ÞÚ(ÝÅ×Õ¶ï÷µ=ÔŸ¸ú_Ús9½ïîÎÁ@ÊêêqÝû¾Ì9îîï=í{°ç·óñiõúêîï=íÛ”ŽÝÔ-X°OOO¾üòKƒ•Oxx8ææ¦Õm)ŸW¯ï¼oR÷õ}>ØçFê*ã˜?>ñññ\¹rÅ û?wîÅÅÅCâR]½ïÁ´1ŒÝØ—ãë©íØ×}÷Vô÷¹ìi_]‘ºOÿ<<<˜:u*GÕ¤ü²2psÓ¤h1H¦ÕšBaò ™Ù]£¸;½uÒê#ž¾4;o×S¼/篿çA1røûÂðî»Æ-WXî­Zêi;åwÿ¦;ÀÝy[åo}ÙÆPº*{ Ûè³üžŽ½»ó<ø8L{vÄ` ä3w Ñ×g|Ú}mÏ 6ž¶…Ûž3f»©¿m<}žûþžc-^kÆj“¤cɆÂ9•ÏŽÁ1µçXçWê*alR†1ú»*£§rÓר]@÷Ó©ûŒK«ïåçÏÄ š-I’„Bô‹§§çˆ™)Þßd„Δƭn#WÙ~0 lC¹páÀ¿þÃÝ]wÁ{ïAK‹ñÊìëwæ¡øÝZ7iÁ„ªd“³råJþõ¯ÑÐРu(&AŸσéÜì®­Ñyÿ†Öß¶1âÑM.ЪݥÏs¯õ9î­C&cŒäc7Eß~û-EEEÄÄĬŒyóæ‘`°Y¿Z‘ÏŽŽ1ôµcÔãúxn¤®2œï¾ûŽyóæ1jÔ(ƒìÊ”)xxxpüøqƒìß”H=Ô7†êìí±ƒ=æþN@ÒGÝ$uŸq‘––Æ’%K4)?'G’†*IBÑ/sçÎ%..Në0†å Qçt\ÂÍTÄÇÇ3nÜ8¦Nªu(BˆüøÇP] hÉðafößU D×¶lÙ‚¹¹9«V­¢®®Nëpô®¯S]Í¢ÑROm S`*ñ™b»K_ŒuŽ»+GË÷ÄH>v­œ:uŠ›o¾™|ÀÀ@ƒ•³aÃjkkÙ¾}»ÁÊÐùìXÙŠþœ CÕãÆxn¤®œÜÜ\vìØÁ¯~õ+ƒ•aiiÉC=ÄO<¡NŽ*¤2M¦r|==׆ŽQê>ýikkã¿øsçÎeñâŚęپ2¥z$ @!D¿Üyç|õÕW”––jÊeªY¨ï¾û.kÖ¬ÁÂÂBëP„=pt„›n‚;´ŽdxPúL¬J69VVVìÙ³‡¤¤$.\HJJŠÖ! Jç¤<Ýßõõ±Êã…i3Õv×p2’ß#éØwìØÁâÅ‹™;w.O>ù¤AËrppà¯ý+¿üå/‰5hYý!ŸúÑßsaèz|$<7Cõ«ªª¸ù曉ˆˆà–[n1hY÷ß?\ýõ& õèMç×ÃHn‡×ü•+W¸÷Þ{9|ø0o¾ù¦&1ÔÕµ'Ìœ©Iñb$ @!D¿DGGãééÉ;ï¼£u(&¯§e¨LMff&GeÓ¦MZ‡"„èƒuëàóÏ¡¦FëHÄH2mÚ4¾ùæ,-- ãþç¸té’Öa Jg¥˜Ú€²©·5L=¾áÀX縻r´|OŒäc7¦””bbb¸ûî»Ù¸q#Ÿ|ò VVV/wÓ¦M¬Y³†åË—³oß>ƒ—×òÙ1ø²Mí\2©«&//%K–pùòe¶oßnðר¥¥%Ÿ|ò ÌŸ?Ÿ£G´¼Á’zÈ´™ÂñõVž¡c”ºoðŠ‹‹Y¾|9ï¿ÿ>»wïÖlåÖäd¸rfÌФx1H’ „¢_ÌÍÍyê©§øÓŸþDaa¡^÷­›ÑÜÊvƒmØuÞÏ`u•iÚÕò…Ý]¯ª¿çAxàV®\Éœ9sŒV¦bàn¸llàý÷õ»_¥Ú1DõÓyßJu¨üÔ-s Ûè#¾®Ž»«²²Í@õ÷Ø»;Ïú2iÒ$bccyúé§Ù¶m“&MâÙgŸåâÅ‹ú-ÈHr­J}\3³ó>ú»Ï¾¶5úCŸí¡þÄ7Øö\_Ïi_žãÞÎAWeiÕÁØÛ9îO{²§ãîËs9Ø2úk$»1>}šuëÖBAA‡âùçŸÇÒÒÒh1¼þúëÜqǬ\¹’G}”ÆÆF£•Ýùì¸:†þÄ2Ð÷Í@ëñÞb4Ô{SêªûüóÏ àðáø¸¸¥\Ž?Μ9sˆŽŽæÁ¤ªªÊ(e÷—ÔCWÇ` ¯]C_ç}÷¥ªü¿«2 c_ö/u_ïZ[[yë­· !##ƒcÇŽñ£ýH³xÁÉ &LÐ,1’ „¢ßîºë.æÎË}÷ÝÇ•+Wôºï®–6SþßyÝߤ¡Úy?mmmÝ–Ùùw½m×SŒºë®Ü—ó /o½õß}÷Û¶mÓû¾…†ai wß [·êgWwffíÿ×­nºªz”ßõ¶nÊß;Ǭ;Ð=ÐmúGWqéÞïjн«²²Í@õçüè–i¨1I ¶lÙBvv6÷ÜsþóŸñññaóæÍÄÇǦP#éª3µóg¯n{a0íݲzêÔH{¨¯í™®öÓßeÝ•Ñ×öZwçs 碫sÚŸv—òûžÚ„½-ÃÛŸsß›ÁžãîÚ“Ý=¾»ãèK9½uBwUFOFò±k©¾¾ž>úˆ%K–Ê©S§Ø¹s'‰‰‰š\ƒvÔ¨Qüãÿàõ×_gëÖ­Ìš5‹#GŽ=ŽÞÈgGÿ^ßý}ß ´ïÏû| ÏÔUú•——Çí·ßÎÊ•+‰‰‰áÿþïÿðòò2j cÇŽåÓO?åÍ7ßäÝwß% €­[·RWWgÔ8úKê¡Á·1ŒÑØ×ó4Ðvh_ ¶_Uê>ÃùꫯgóæÍ¬Y³†Ó§O3kÖ,Mcú戈Ð41’ „b@^}õUŽ=Ê< ÷}+_Ø;ßzÚFeõ´ß¾n××{êÌèÏy¬¯¾úŠŸÿüç<÷ÜsFÿr-„œ{ï…´48tH?ûkkë8®ûݪ§¯ÛõTFoåd›þÄÑ[\}Ùÿ@·¨ÁžC?~<Ï<ó üíoã»ï¾cÞ¼yL›6§žzŠôôtÃ1@º½}îwÕa¥ÏöGoå¤=Ô×öLo¿È1ôwÝíz{ì@Û†ýmw飬¾žûžèã÷çñ=m?˜÷„»þÛðúÔÒÒÂáǹçž{ðððàÎ;ïdüøñÈÏ~ö3­ÃBôÓäÉ/½¤u$b¤³µµåÞ{ï%))‰S§Nqà 7ðÚk¯1eʦOŸÎ£>J\\---Z‡ÚAo³N„b¸ª®®æ³Ï>cÆ ¸»»³téR’““yúé§¹páŸ~ú)ÑÑÑZ‡ÙÁ„ Ø·o‡¦¼¼œ°°0®»î:;„ПÌÌLxà&NœÈÎ;yöÙg9{ö,Ë–-Ó:4øë_ÿÊùóç¹çž{xî¹çðööfݺu|óÍ7š½÷¥bxÈÉÉá‰'ž`„ üä'?aÒ¤I$&&òÅ_¤uxdfB~>DEi‰(³6ù„B1{öìá¶ÛncÓ¦M¼ôÒKŒ=ZëD|øá‡Ü}÷ÝÜzë­ìر£_KÓ !LÇÑ£ çο¿ÖÑtM©^ä[GÏt«ac«;]»vé}ßmmmÄÇÇóÙgŸ±gÏÎ;ÇØ±cY´h‹/&**Š™3gj6»T_K‹Ì¦b`Fò9ÉÇP[[Ë7ß|Ñ#G8rä'OžÄÌÌŒE‹±jÕ*V­Z…···ÖaöË×_ͳÏ>Ë¡C‡˜þøcÞ~ûmbcc™0a[¶láî»ïÖtæ_Ô××óþûïóꫯrâÄ ¼½½¹í¶ÛX½z5 ,0J¿ŠÔCb8 uŸ"''‡?þ˜Ý»wsâÄ ÜÝÝÙ¸q#›7oÆÇÇGo嘙™±k×.Ö®];¨ý¼ø"<÷tì³C‡$!„´ÿûßüä'?aÖ¬Y|üñÇ899iO_¾xÔ¿ÖÖVžxâ ž~úizè!žyæF¥uXBˆA†¥Ká…´Žäj«ccW½}ù’j¬˜úú…Ù˜çÈIåååqøðau*??GGG-ZÄ’%KX´hAAAXXX<…¾gQ §ö‡¡¥«kÔŽ4Æ~½˜Ò9ÉÇn,555œ8q‚£GräÈâããimm%44”%K–°dÉ"##±³³Ó:ÔAKKKcûöíìܹ“ââb¢¢¢Ø°a7ß|³Aå³£{ÃéX@ê*}jmmåûï¿ç7Þàã?¦¹¹™U«VqÏ=÷¥ù%G"==Ý»w³{÷nNŸ>­&ÜvÛmÌŸ?ß ý,Ruo8‹V¤îÓ¿ììl>ýôSuàßÕÕ•[n¹…Õ«WiúB_IQQ0e ¼òŠžF'IB!ô"%%…+VP[[ËË/¿Ì­·ÞªuH¢“ôôt6nÜHBB¯¿þ:ëÖ­Ó:$!„¼ñ<ü0œ?ZG#†c&t–™™ÉáÇ9zô(‡¦¤¤kkkBCC cΜ9„……1uêTIVBˆÔÖÖrêÔ)Nœ8Abb" ¤§§LTT”šlå0Œ W®\᫯¾bûöíüë_ÿÂÜÜœèèhbbbX¾|9^^^Z‡(ĈRWWÇÁƒÙ»w/ûöí£¸¸˜°°06lØÀÚµkqttÔ:D½éœàààÀ’%KˆŽŽféÒ¥L™2Eë…FT^^Α#G8xð $;;777ƒüëÒG@y9xz¿þ7Ü Çà„QI€B½©®®fË–-¼õÖ[¬^½š­[·âææ¦uX#^KK /¼ðÿó?ÿôiÓxûí·™1c†Öa !ô¤¾&N„Í›áÔ:1”h™ÐÙ¹sçHHH 11‘'NpêÔ)jkk±³³cÖ¬Y„‡‡ÎŒ3 ÄÒÒRë…Âè*++IIIá‡~PýÓÒÒ¸rå ^^^„‡‡Fxx8sçÎÕ|…6­TVV²ÿ~>ÿüsöïßOuu5³gÏ&&&†›nº‰Y³fI‚™——ÇþýûÙ»w/‡¢¹¹™… ²|ùrV¬X¿©^¿Lrss9xð ‡âСC”––âííÍÒ¥K‰ŽŽfáÂ…øùùi¦Bª««ùî»ïÔÿS§Naiiɵ×^ËÒ¥KYºt)³gÏ6êª'úHxùexâ (,¹úïÐ%IB!ôîÀlÞ¼™òòr¶lÙÂC=4,–šjÚÚÚøä“OxôÑGÉÍÍåñÇç·¿ý­Q—ZBÇ‹/ÂþоÀøñZG#† SJèìÊ•+¤¥¥©I‰‰‰œ:uŠúúz,,, ((ˆiÓ¦ÌÔ©S™:u*VVVZ‡.„ƒVQQAJJ ©©©$''“ššJjj*.\ÀÍͭê)áááxxxhµijiiáøñãìÝ»—½{÷’••ŸqãX¸p!‘‘‘DFF&ß‘„€¬¬,bcc9zô(ÇŽ#''‡qãÆqà 7°bÅ ®¿þzÆà/'mmmœ9sF Kmm-nnnÌ›7¹sç2þ|æÌ™ƒ½½½Öá !ú ¥¥…¤¤$ââ∋‹#>>ž´´4ÌÌ̘={¶ºHDDcÆŒÑ,N}$\s „…Á¶mz L$!„0ˆºº:^|ñEž{î9FÍã?ΦM› r]FÑQ[[_ý5=ö‰‰‰¬Y³†'Ÿ|’É“'kšÂ@êëÁß~ZëhÄPaÊI]iii!##CKIIáìÙ³¤§§ÓÔÔĨQ£˜aaaÃúÒ B Dss3gΜáĉÄÆÆrìØ1 °··'""‚E‹Ixx¸$Õt£¹¹™“'OO||Y¾JJ .Ì͵ŽF˜*I0ž––uvqaa¡ºÌxqqq‡ÁÊŠŠ ÊÊʨ®®¾jvvv899©IJ¯‚ IDATrÀ¸qãÔÛøñã;ü_¹ÙØØhpÔBô®ªªŠêêêoõ•›²¿Â¢CR’D£ 껸¸¨nnn8::jtÔb¤jnn&''§Cr@^^žººLqq±:ˆkaa››[‡äwwwÜÜÜpqqép_’T†.ÝJ”I”û.\è°úP}}½ú8GGG¼½½ñõõU/A¢;è?vìX J ---j2ÉùóçÕ¯ ÕÁØ’’š››ÕÇX[[«õ‘‡‡jòª³³3®®®êg°³³³ÔO#XkkëUÉšåå唕•Q^^®~/*..¦¨¨ˆ‹/vx¼Ò^S^oJ§ úO˜0kkkŽÎô $  ¥¦N…eËàå— œ0*IBaò233‰åرc|÷ÝwdffÒÚÚŠ»»;³fÍbæÌ™À”)SpuuÕ:änÕÖÖ’™™Izz:™™™$''óÃ?žžNkk+nnnÌ™3‡ÈÈH"""gôèÑZ‡-„b22 $^xî½Wëh„©’$ÓÕÒÒÒå gW³žuKugÆè=z´šààà€ƒƒÃUIöööØÙÙammÍØ±c;v,ÖÖÖØÙÙu¸ooo/³SG°úúzêë멪ª¢®®Ž††õ~}}=ÕÕÕ\¾|™úúzjjj¸téR·ƒû}}½Ž?¾ËÕ1t”„!†²––ŠŠŠÈÏϧ  €‚‚õ¾2W\\L]]]‡Ç?þªäGGGÆßíM’Ãô¯¥¥…ÊÊÊ.o/^¤²²òªÁþ²²25ñÚë?uÖµ··w‡Á~å¾ | cRVÔQlun‹ŠŠ:´M[[[;<ÖÎήCr€ò™íàà€½½}‡ö¨nûÔÞÞ~Ø/×>´¶¶R]]Mee%ÕÕÕÔÔÔ¨í8Ýûºƒüº?;=Ž;µžSI”Ë.¹¹¹áåå…›››ô…Ò@’^}~ýkHO__'ŒJ’„B 9µµµüðÜ:uŠ“'Orúôi222ÔëòÚÛÛˆÞÞÞxxxàåå…§§'žžžê,9}v|477« c%cº¨¨ˆ‚‚Š‹‹ÉËË#;;› .í3;&NœHpp0¡¡¡„……Š———ÞbBŒl<o¼çΓ“ÖÑS$IÃS_fV+yÊ­®®ŽK—.qéÒ%êëëÕ6Uw,--±µµeܸqŒ3F½onnŽƒƒfffêÿÇŽ‹……vvvŒ=¬¬¬3f ÖÖÖXYYaccÃèÑ£±³³Ã¢à Fe?ºåŽt•••êý††uv¨ÒQÛÖÖ¦°WUUÑÖÖFuu5­­­\ºt‰––._¾LSSuuu466RnWN]K–9–êà¾2د üë–Û333°±±ÁÚÚšqãÆagg×åê²r…wùòe5! ¬¬¬ËûÊ seee‡äŠ1cÆtH P’¼ÆŽ‹ ¶¶¶êûÙÆÆF}?󯯬ïkssslmm±´´Tëð¡¢±±QM¦Pê¶K—.QWWÇåË—Õ䦺º:ª««»ü[mmm‡þK—.]UŽ………zŽ; |uußÙÙÙ¨çA}jkkër Xwö·òÝvhwíNˉ–XG[ãrÔEm7X[[3f̰´´ÄÎÎ;;;¬¬¬Ôv©Ò±²²ÂÎÎN­§ÌÍÍÕ„A¥ý9Ô577«ç¯¾¾ž†† ½^S깚šššš¨©©QÛ}•••455qùòe.]ºDcc#555\¾|¹Ã Wõ´Ÿ?%‰ÃÁÁ¡C‚‡òÓÅÅ¥ÃeΜ±´´4Ú¹éú›pù2øûÃÚµð·¿88aT’ „bØ(,,$##C½)³&ŠŠŠ¸páÂU£Gîi—§|VêÝ·ÎÛt¥§ºWùLéŠîwvøoÝyåÊ5þÎÛôD7É­s„r¿«UtWaeù…è]çÙælwßÎ×>_3¾v<¼òµ•µjNOƒØi3é¶•dÖÎíJè=q «ÇèÒM>êŠî€~W©­­U/ÍÐ[bfgJ=Ü[…­­m‡ìíí;¬"¦üMÚ|¦¯¿IO> ÿ;de\1kx‘$!„#Fee%………TVVªƒ÷ÊÏššš nÝT€š9 ÿí¶±CÂîã>6²{úvlBˆá­ólø¶¶6uP½«™õJrSKKK‡Ù¤=Õ¯ëý‚8f8bSÞ^ê~/ï¬sýªÔºucW+(õdW+!Œç<çùb;ðÄ“ßñ;îæn,éÿìñªª*¹|ù²:x®[é& (õ˜ný£$èÒ„ïJoI¡]%Du¦ÛþƒŽÉ«J'ü·ÞÒmƒê¶%°²²ÂÖÖ¶ÛÄX1¼õ' ?‚‚àñÇáᇜ0*IB!„bÛ°€ädÉèI€¢+)¤ð/±“˜aÆ:Öq?÷3•©Z‡&„aÌ0c»XK߯i,„Z2ÈàOü‰wy?üø=¿ç.îb42p-Ä@õ' àÇ?†S§àÌøOž‰F$¥Q!„Bˆaì…ÀÂ~ñ ­#B1Ä?øðO°ŸýÄ2–ñ_ÐJ×Kq !„BôU*©ÜÅ]Lcßñoò&i¤±‘’ „‘|ý5ìÞ Û¶IÀp%IB!„B cðÖ[ðá‡ðÑGZG#„b¨Ç8þÿtÒÙË^Úh#† äyž§šj­CB!Äs†3ü„ŸL0'9ÉvB ëX‡Z‡'ĈÑÐ<Ð~ ÉeË´ŽFŠ$!„B1Ì-] ÷Ý×~+.Ö:!„C‰9æÜÄMà)¤p=×óOà7÷q)¤h¢B!LÜ)Nq+·J(g9Ë|Àΰ–µ˜Ë0•F÷‡?´÷mݪu$¤vB!„bxöYpr‚Ûo‡æf­£B1Me*/ñðOqƒÌu\Çç|.— B!D $°’•Ìf6ç9Ï'|ÂiN³šÕ2ø/„Fâãáok¿y{k0$©e…B!„lmá“O !~Xëh„B eöØók~Mi|Á˜cÎ*Vá?ãoTQ¥uˆB!„ÐÐ÷|ÏMÜÄæPL1Ÿó9‰$²ŠU˜a¦uxBŒX°q#,^ÜþS o’ „B!Ä o½/¼ï¿¯u4B!†:s̹ØÏ~ÒHc9Ëy’'ñÆ›{¹—d’µQ!„FK,ËXÆPEÿæßÄÇr–Ëà¿&àw¿ƒü|xã 0“·ä°'IB!„BŒ ·ß>÷ÜIIZG#„b¸$­l%Ÿ|žáŽp„Ì`)KÙîpEë…Ba G8BQDI#ä ÿÇÿq=×kšâ?€_„—^‚‰µŽFƒ$!„B1Â<÷Ì™·Þ U²b³B=²Çžx€4Òø’/±Ä’[¹üù ¡’J­CB!„žà‘DEæ˜sô?ÿ¢‰Ö:4!„޲2X¿Ö¬»îÒ:a,fmmmmZ!„B!„0®ÒR ƒÀ@øòK°²Ò:"alwÜqï½÷žÖa!F‚à>`#`ì¶g´ JaòÚ€;i®aznæû§€o5H¡c×®]¬]»€ÖVX¾RRàÔ)ppÐ88a4’ „B!Äuú4,^ ðÉ'`i©uD˜âââÈËËÓ: !ÄRoQÏñ ÇÙ￟ c/0½t:×g^ÏœÂ9˜·Éb•BˆŽ~¼úÇü2î—DäEhŠh£DÏD>ú˜óãÏ3»h6·¦ÜŠÿE­CBt2oÞ<|}}øÃàφãÇaÞ<F%IB!„BŒ`qq°l,\ï¿vvZG$„b¸k£¯ùš­låßüo¼ù¿`›pÂIëð„& 3v±‹µ¬Õ:!F´VZÙÞäIþ?{÷Uïü5©ÔJè !¡„ŠR +xquQL@/(.-ˆe¯þ¼*» Xq•DDA¼*AT\pa±Ð‘Þ -´PC'í÷Ç—aÒ{r&Éû9ïc†9gÎùœ3s2ŸÏ÷ûÝÆ60€×xö´·:4ÉÂðÐCðñÇ0|¸ÕÑHiS™µˆˆˆˆHÖ¥ ,] 6˜B€¸8«#‘òΆ{¹—E,b/{ù a2“ñÅ—§xŠml³:D‘ /•Tæ2—Û¸ ¤-ØÊVæ3_"eÀ@x8 ¦€ŠJE"""""\h¨ùã sgøñGk㑊#@¦0…8â˜Â~çwnã6zÓ›yÌ#™d«C©P’If6³iMk §-mÙÆ6¾áÚÐÆêðD$ö®]aÚ4«£«¨@DDDDDðóƒU« OøÓŸàÙgáúu«£‘Š¢ÕÉHv°ƒ¥,¥5x”G €7y“Óœ¶:D‘r-™d>ã3‚ f(C %”]ì"šhZÓÚêðD$ŸÌ÷:õëÿþVG$VQ€ˆˆˆˆˆP­ÌžmÚ¬YСƒ) )-6lÜÃ=|Ï÷ìg?ðoñ¾ø2Œala‹Õ!Šˆˆ”+7¸ÁLfÒ‚ü•¿ÒƒÄÃç|NKZZžˆÀéÓp÷Ý`³Á’%P£†Õ‰•T """""„…Á֭Ф ôêeæ;­˜""RÊšÒ”wy—8âxŸ÷YÏzÚÓžžôä¾!‰$«C)³®søˆæ4g4£¹—{ÙË^>åS ´:<) óçáÞ{áòeøõWhØÐêˆÄj*‘,üýá‡àë¯áÇ¡U+xÿ}¸qÃêÈDD¤¢©JUþÊ_ÙÆ6~ægjS›0 €ÉL&«C)3®r•H" $çxŽx€`:ÓñÇßêðD¤N2Ó;ž= ¿ü[‘8ˆˆˆˆˆHŽ„Ý»Íh/¿ ÁÁðÕW–fud""RÑØ°Ñ‡>Ìg>ûÙÏc<Æ»¼‹/¾ e(›Øduˆ"""Në2—y÷ €—x‰ äˆ"ŠÆ(c(RVÅÅ™Q/_†•+ͨŽ" "Ƀ—¼õÄÄ@0x0tì ¨@DD¬á?oó6qÄI$ÙHG:r;·3—¹š*@DDä¦K\â-Þ"€Æ3žÁ &–XþÉ?iˆÆ )ËbbàŽ; reX±üü¬ŽHœ‰ŠDDDDD$_üüà³Ï`óf€‡†ví`Þù®]³::©¨îäN¾ã;b‰%œpÞç}šÐ„'x‚ l°:<‘RqŽsü¿ã?ïò.£Í!1‰Iøàcux"R þïÿàÞ{¡_?øñGðö¶:"qF*‘B ¯¾‚; [7xæ3÷Üøñpê”ÕщˆHEå‡oñG9ʇ|ȶЙÎt£s˜£©DD¤\:Ã^áüñ'’HÆ1ŽÃæüƒZÔ²:<)ÉÉðÜs0l¼ò |ñxzZ•8+[Zšfñ‘¢;u >ü¦O‡ÄDxä5 ºt±:2©èV°‚(¢XÀ|ða#xš§©O}«C‘ذM4a„YŠˆS;Å)¦0…iL£2•Ç8"ˆ :Õ­MDŠQB‚ùžeØ5 ´:"qv @DDDDDŠEݺðÀáÃ;wB׮СÌœ —.Y¡ˆˆTT½èÅ·|K,±<ÁDIš0„!¬cÕቈˆX<ñ<Ïó4¥)Ÿó9ãO,±¼ÌË*)gV¯†Ž!.Ö¬Q€äŠDDDDD¤XUªO>iªÓÿøÚµƒ±c¡qc>V®G&""VðÅ—7xƒ£e:ÓÙÁºÜ¼EÍ nX¢ˆˆH®ŽqŒ±Œ%€æ2—IL"–X^àªQÍêðD¤%'›){õ‚öíaýzhÓÆê¨¤¬P€ˆˆˆˆˆ”˜ÐP3Lݱcðúë°u«ùã50^{ öï·:B©ˆ*Q‰¡ e3›YÉJüñg(CiBÆ3žœ°:D‘ Žp„QŒ"@æ3Ÿwx‡`ã¨B«Ã‘bvð ùþäÝw!2,oo«£’²DE"""""RâjÖ„1c`Ý:ؽ ‚Ï?‡æÍ¡{wøøc8{Öê(ED¤"êA¾ækb‰eÃøˆðÇŸpÂYËZËâ²åq+êú9½.ýóbäç>ý.\€‡† `Ø0øÏàzéæ\DD¤‚óÄ“ÿæ¿ÙÈFV³š@y’'iB^åUŽsÜÒø ú¥}vë§OJuûe‘3%a¤ðt-®ç´›Ý a­hÅïüΧ|J 1 cî¸iÛºnŠN×””ÿüÚ¶…_…%K`Êðô´:*)ËT """""–«ZÕT»/] GŽÀøñ @ݺðØcðí·f(<‘ÒÒîÌeî­¡˜g0üyŒÇXëÃ+1å9‰£ä„®)MÛÙÎc>ðç?›ùñΟ·:R©(ш‰Lä0‡™ÉLö³ŸÛ¹Žtäs>/õ©Š"·œéåÔû3ýPÏÙ û\˜y§³ÛvNÏåg?™·›ùØsŠ=/ö¡¯ ²~aÏW~ÎOnûËïy¬Èt-d]'¿t-¯-láa¦íØÅ.æ2—ml#Œ0\œ,…£ë&ë:ù¥ëF2KM…iÓÌpÿ7ÂâÅðÕWæ{‘âà\¿ADDDDDDÒ©[ž~~üNž„?6Ï?ý4Ô«÷ß3gBB‚µqŠˆHÅà‰'ó8ëYÏïüNKZ2œáøâËÿò¿ãX‰ÇßLa×ÏM^ÛH¿/ûºÙ%P2Ï5Ó¶sÚ_nûI¿,sÂ"»9¯ó’~ûéç')R”ó•y.îÜææÎnÙ=.o½su-èZ(ë×Â60€t 9Èw|Ƕ0%–ü×u£ë¦¬_7åŶmpûíðÌ3ð׿Žз¯ÕQIy£")jÖ„!C`þ|“ôŸ=¼¼à¹ç ~} …‰aýzSQ/""R’ºÒ•9Ìá0‡ÉHf1‹¦4åQe«Šu_™“ùI dýÂÆ”Wâ!s£8bÉk?éÇqg—,É)Q’×v r¾²Û_A{f÷¸¬Óµq¿¹í'=] Y[i-k¹ŸûéLgâ‰çßü›läA,‘uÝdÜonûIO×MÖÇRt—.ÁK/AÇŽ`³Á¦Mðæ›P¹²Õ‘Iy¤")sªV…aî\8u .„ÎaÖ,S P¿>  _m¦)) hÀ?ø‡9Ì,fqˆCô¤'éÈg|Æ5®yùíq˜yý‚¾® 1e'¿=‹*¯ýGÂ(ó6²ë)š_¥u¾rÚOyéÁ©k¡àûѵ¿çKÃ*Vq/÷Òn\à‹YÌüAú—ègD×MÁ÷£ë&ÏKþ¥¦šï+Z´0#FFÂo¿A›6VG&噊DDDDD¤L«TÉL ðá‡pð ìÞ /¾GŽÀã›izõ‚7Þ€-[¬ŽVDDÊ+<Ì`þ¸y "ˆŒÀ_þÿ8⊼œzù9“ÌÉ£’J"å´Ÿôû*ÊyÊ)ISÜ=cKú|9óg¥(t-ä½] YùYYÆ2îâ.zÒ“Üàg~f5«éKéŽý­ë&ïýèºÉÈ™?+eÉòåЩ“öÿφ}û`ÄpQ†VJ˜>b"""""R®ÁóÏÃ/¿À™3f4€-`Ú4hß|}aøp3­À… VG+""åQ(¡DÍaAŸó9MiÊ@²‚EÚvQ“8e! TTÅ•ÄÉi›Î.ó{\–b/] yÓµ`íµ°”¥ô¤'wq.¸°üæ­}J5ŽôtÝäM×MÅøRví‚þýáÎ;Mç„­[Mç…:u¬ŽL* ˆˆˆˆˆH¹U­<ô̘GÂæÍ0jìÝk¦¨]ºv…W^eËàZÑGl¹¥>õy×8Ä!>çs∣7½iO{>åS®rÕê³U”a…sV¹8å´ŸÒJZ×1•Öù’ÂѵP¸ý×vÊêµð?ÐnÜÇ}T¥*«YÍÏüL/zYZ©ÐuS¸ý×vÊêuSžœ> £GÃm·ÁñãðÓO°x1[™T4¶´´4•ñˆˆˆˆˆH…sïçŸÍ¨{ö@åÊpûíp÷ÝЧ9ÀÕÕêHED¤<ÙÀ>à¾å[ªQ§xŠQŒÂ¿,ëæ–ŒÈnYA’é“ÙF~b²/Ïi>ä¼þùõ9ŘÝ~rzœÛk z,Ù%XJò|åçxòû)Kl؈&š0Ât-èZÈuy~·_’×Bi,d!˜À&6Ñ~¼Ê«„ZbûÌ‹®]7¹-ÏïöËêï+\¼S§Â»ïšï^þû¿5ì¿XGE""""""À±c¦À^pü8Ô¬ ½{›‚€»ï†–-­ŽRDDÊ‹“œd3øˆ8ÉI0€"èMo kO¾œæ¶/ËkýœäuùY· qg·Na’8é—Ù2Iœä$·cÉÏ6Šz¾ ’ŒÊíµe•½ œð ÏëZе[ ¹½¶$¤’Ê0 lcÀk¼F{Ú—ÈþòK¿CtÝ8óuSÞ\¼‘‘ðÞ{œ ãÆÁ /˜‘ E¬¤"‘lìÞ ¿þj –-ƒóç¡Q#SЧôì þþVG)""e]I|ÇwDÉÖЖ¶Œa á„S…*V‡W¢”dÈ]QÎOy8·éG(ïÊÃûU’œñZH%•oø†ILb»x˜‡y•WiC›bÝäL×Mîœñº)o.]2Éÿ)S ) žyž}Öt&q*ÉCJ lÜè( X½®^__èÕ î¸Ã´jeu¤""R–md#‘D2—¹T¡ ÃÎHFâ¿Õ¡•%rWÔNY?¯*;gº’If.s™Ä$ö²—A âù_‚ÑdߥM×Mîœéº)o.]‚?4Ãþ߸cÇšä­ZVG&’‘ŠDDDDDD èúuX¿V®„U«LQÀÅ‹àã=z˜‚€=à¶ÛÀÕÕêhED¤¬I Ì`Óˆ'žx€"¸‹»¬­X)“»‚žŸÂçí¬T vÎp-$“Ì—|ɼÁAF/ó2-Ñ|aVÑu“;g¸nÊ›‹aÚ4ÓóÿÚ5“üî9%ÿÅy©@DDDDD¤ˆRR`óføí7X±ÂÜŸ> ^^f”€=LëÜ<<¬ŽVDDÊŠ$’˜Ï|¢ˆb«!„1Œa0ƒ©JU«Ã+%rW˜ó“ßyªËŠŠR k!wV_ 7¸Áç|μAq a/ó2i»R4ºnrgõuSÞ?S§ÂÇ›¿ýnj矇ڵ­ŽL$w*)fii°{·c¤€+àØ1¨\ºt1#të¡¡ê5 ""ù³‰MDÅW|E%*ñO1ŠQ4¥©Õ¡‰”ˆŠR Îé:×™Å,ÞäMâ‰g(Cy‰—Êíô,"’Õ®]ðÞ{0{6Ô¬izþ ÞÞVG&’?*vÎw… IDAT)𢀕+ÍH{÷‚ÍAA¦ àöÛM@«Vàâbu´""â¬Nsš™ÌäC>ä8ÇéOÆ2–»¸+KÏ?‘²LEb…«\e&3y‹·8ÞäI^â%ÓØêÐD¤”,_ï¾ ?ü`þ>î9<<=­ŽL¤`T """""bÓ§á?à÷ßaõjX¿._†5LQ€½…†šçDDDÒK&™, Š(V°‚`‚Æ0„jT³:<‘"S€”¦Ë\æc>æÞ!‘DžæiþÆßhHC«C‘R’ÿú—Iþ¯[g¦óûŸÿ~ýLñ¾HY¤"'œ ;vÀš5¦0`͈5£C÷î¦ué-[ê‹qØÂ¢ˆbsðÄ“a c£4gµ”i*Òp‰K|ȇ¼Ç{\á #Á ¼@=êYšˆ”‚„øôSøøc8zz^xÁã‹”u*qR'OšÑÖ¬1møzjÕ‚®]¡sgG«[×êhEDÄjg8ÃLf2iÄÇýÜÏXÆr7wkª)sT %)‘D¦2•÷yŸÜ ‚Æ1|¬MDJÁÚµ0m|ó T­ ÆÁÈ‘`ud"ÅGE""""""eDRlÛf Ö®5SìßiiàïoŠBCÍ}‡P½ºÕ‹ˆˆRHá{¾'’H–³œ ‚Ãçqª£_R6¨@JÂ9Îñ0•©¤’Ê37oµ¨euh"R®\¯¾2ÉÿM› S'5  ‚Ê•­ŽN¤ø©@DDDDD¤ ;wÎØÛºup⸺BP£( sg¸í6pw·:b)MÛØFQD;î e(£Esš[šH®T Åé gø'ÿ$’HÜpcãËXjPÃêÐD¤„íÛÓ§ÃgŸ™‘õ}Ô$ÿ5ä¿”w*)gââEü7Â… àé íÚe1 E pq±:b)iç8Ç fðþõ÷‰÷ˆ§]|;îß?mãÛjªqJ |„±ŒåŽ#wXŠ”aîÃu›çw„#¼É›Ìb>øðïð$OR‰JV‡&"% 5–,1½þÿýoó÷꣚B€.]¬ŽNÄ9¨@DDDDDDSЮiƙ璓!&ÆlÞl fφK—ÌúmÚ8ŠÚµ3ÿ®VÍÚã‘‚ñÆ›xçxŽE,b*SéG?šÑŒÑŒf(CñÂËê0ED²8ÈA&3™/ø‚†4ä>`(Cñ@•ª"åÑÖ­¦×ÿܹ={§ŸÂCAåÊVG'â\T """"""9rsƒÓžxÂ<—š {÷:¦ظ¾ý.\0ó,6kf Ú¶u4jdíqˆˆHÞ\pá¿nÞv±‹(¢x…Wx•WyœÇ²:Lö±ÉLf6³iB>â#†0wÜ­MDŠÙ¡C0gŽi;wB‹ðä“0x0ZˆóR€ˆˆˆˆˆˆˆ‹ ™–~ÚÓƒaËÓ¶m3=24Ëj×vØ Zµ2£ ˆˆˆó &˜iLc2“™Å,¦Ý¼Ý˽DÁŸø“¦ ‘R·›ÝLf2_ñÍhƧ|Ja¸)Õ!R®œ9_mÿkÖ@ýúf¸ÿÏ>ƒÎ­ŽN¤lÐoF)M›šöç?;ž;ÞQ°u+,[‘‘pãxx˜ìÓØ ¼½­;ÉÈožã9Æ1Žø©Lå €F3ša £5¬SDʹílg2“ù†ohE+¾à 1HÅH"åÈ•+ðý÷&ñÿãP¥ŠùÛrüx¸ë.puµ:B‘²EE""""""Rb¼½¡woÓì’’`ÏǨ[·ÂÂ…`–7mjŠBBà¶ÛÌ}‹fj±† .ô¿y‹!†(¢Ïx^ã5†0„"hE+«Ã‘rf [˜ÈD°€B˜Ë\æa%ÿEʉ˗á‡Ìôr?üÉÉз/DGCÿþP¹²ÕŠ”]ú EDDDDDDJ•»»I쇄˜yíŽsŒ°e ,Xo¿m¾òô„à`Gq@Û¶æqÆÖ‡ˆHEDQD1‰I|ÆgLcÓ™ÎÝÜÍÆÐŸþJЉH‘l`™ÈBÒžö|Çw `6lV‡&"Etñ"üç?0o,^lþÞ»ûn3bÜ€P«–ÕŠ”*§Ð¨‘iýú9ž»~ví‚;`ûvS ðóÏpü¸Y^«–c´€6mEÕªYs ""I j0ŽqŒe,KXÂT¦ò â?cÃ0†áæx‘ü[ËZ&0Å,&”PþÍ¿éG?%ÿEʸÄDX´ÈôøÿñGHM…{îiÓLâ_S‰?ˆˆˆˆˆˆˆÓòô„öíMKïìY3ÀΦ0`ýzøì3¸t l63¥@Û¶G hÖLS ˆˆ†ÍæH¾¥¥¥eYî‚ ÷ß¼íe/QDñwþÎk¼Æ`A­i]âq”6g‹§4TÄc.Nåáü•Ô1¬b™ÈOüDwº³˜Åô¥o±m??ÊÃû#âLΞ5‰ÿテ¥KÍs÷ÝŸ|ÿõ_àåem|"å¾þ‘2§V-¸óNÓìÒÒààAS`9`ÞýxªW·:B‘ŠCE""""""R.Øl&¡>èxþÚ5ؽی`o³fÁ¡CfÊJ•La@p0´nmZHøûƒ‹¦´)/¼ˆ ‚1Œa Kˆ$’‡y?üÍhžäIjRÓê0EJŒÍfSoò\,e)¯ó:«XEúÜ*‘²%-ÍŒÊöý÷°p¡)Äöñþý!"Âôü¯RÅê(E*&ˆˆˆˆˆˆH¹V©RöS \¾œµ8à“OLq˜/«ZµrØ[“&¦à@DDòfÃÆŸnÞö±ù‰Ld<ã 'œ±Œ%„«Ã)VêMž³ø‰Ld-kéK_V³šît·:,)€k×à×_Moÿ… áøqhÑ €iÓ [7´&â T """"""RժЩ“ié]¼hжowÜ/[GšåÕ«›iÚ´1÷ÁÁ¦X@#ˆˆä®9ÍyŸ÷™ÈD¾à ¢ˆb3¸“;Ã0 ÐSˆ8 d•F YÈ&°‰Mô£ð¡„ZšˆäS\,YbÚ?•+&Ù?v¬IþY¡ˆd¦"‘tªW‡ÐPÓÒ»p!ã¨;wš/ÀŽ3Ë+W6_~µliŠì­E ðð(ýã))铜¹ wž]24--êTg4£Å(–²”H"È@R§Â4àSàLÞÛÏmÅ¡0Û.ê¹Ék[ym¿0¯É-®’Î>·Xs;yŕ۹Ím;Åqì™·‘Ÿs_”÷´°ç© Ÿí‚|†ÒK%•,`ØÆ60€Ì =í³ÝnI~VKó³-R$'Ú5ŽÄÿæÍP­ôéï¿<uëZ¥ˆäÆ–¦ßv"""""""…vñ"ÄÄÀ®]fä€Ý»Íãƒ!%ÜÜ ÀL%~䀠 3ˆHi  ::º@¯+hr9s’2ÏuáÙýÏ2‹YÜàWg^…H`[ö‰Ú¼ž+ŠÜö‘Û¾ó›X-ð¹)Âö SNÏåö|aäkZZ6lÌ)|\I çµ¬ ò»¢¾§¹S~ÏS~>ù]ß.•T¾á&1‰]ìâaæU^¥ mr<¶’Š©¨?»òËf³MXXX^'âLâãIÿ¥KáÜ9ó7K¿~pÿýpÇ*n)K4€ˆˆˆˆˆˆHT¯;›–Þõë¦8 }ÀÂ…0e ܸ64ib¾X³´jeF¨SÇšcÉKúÄXNIÌœ^—ÛºiûÍv'0/ù’ȧ"ÙýÔnXó˜Çƒ<ˆ[6_ew@úx3ÿ;·øm6[¶ ØÌÏç´¯¼Îca¶_Ð×ätÌù9†¢²ï#?IñÜâ*èû–Òê3W”÷´¨ç)»õr“ßë>™dæ2—ILbûx”Gùš¯ &8×íd¥µ¾HE’ëÖÁâÅ&ñ¿aƒݬwo˜<úö5Sž‰HÙ¤"‘àé ·ÝfZzÉÉk¦°,_Ó§ÃåËfÚµÍ4AAæ¾E SЬ™Ù®ˆˆ³È)јßDjæD\5ª1’‘Œ`?ó3Q½¢x”GiLcF2ê§³ÆP\r-TÈ#‘šùß9m«0ñ&¹ß×8C2ÔkaßË‚¼o¥YÜ›¢¼§¹McPÐýæ¤ 6É$ó%_òopƒ„ÎÐ’–Š-sœ™ß§Üb*ŽõE*‚ýûá§ŸLûõW3åY³fð§?Áë¯CÏžP©’ÕQŠHqP€ˆˆˆˆˆˆH)rss$öÓKKƒ#G`ï^ÓbbÌý¯¿šçÓÒÀÕÕôÆÉ\ Т4nlÉለä©0If6î¹y;ÈA¢ˆâ-Þ‚£ÀØÂÚÛÚ—ùä3$àíœ)–ôœ5.gS¨ë¬ˆçö7øœÏyƒ7ˆ#Ž! a1‹ $°HÛ‘âsö,üò‹#ñèx{Ã]wÁ›oÂÝw›")T """"""âìÓ4i÷Ü“qÙÕ«Žâ€½{aÏøí7˜5ËôÞ3-AúQZ¶t<®ZµôGD$Ëï…L86¥)S˜Â&Pm\5ˆ€ö´‡•ð ßðe;U€3+®sSœœµ ÂªáùËš‚Ä^äÏŸ'ð$4§9ñÄ3”¡¼ÄKøã_°íˆH±»qÖ¬q$ý7m2gtïÆ™¿3:w6ÅÅ"R¾•­ÿ‹ˆˆˆˆˆˆT@•+g?µÀÉ“ŽQì#DGÃÁƒfê_ßì üýÁÅ¥TED*ˆ‚ %ž_U© ŸÀÏ©?s÷™»y4åQ»š©†3|Šm%¥$ÎLE ¾(Ÿ¿«\e3àPà^â%£áˆD¬’’7²e¦ýö›™b,(È$ü_}U³:R)m*)ÃêÕ3­W¯ŒÏ'%AllÆíÛaÞÍ@Ë–P³f鋈”%žäNƒ>ô?þ7:Žw_x— L Œ0Æ0†t(™}‘ ÄJ…ýü]æ2ó1ïð‰$·À;u,ª¢‘ܤ¦ÂÖ­°|¹™6låJHL„† ¡OˆŒ4ÉM&"*)‡Üݽþ3;wÎ1­€½-Zdž»~ݬãã“qÔ{@` Ù¶ˆHq*Lì[Øÿ Î?Ç'—?a*SéHGºÓ±Œå!‚ÿЪ¨=Äñ˜ WaÁY½ JäªÁ[¼Å{¼Ç®0‚¼À Ô¶~ñîGDr”–»v™„ÿ²e&éæŒ)îÝÞ~ÛôôoÑÂêHEÄÙ¨@DDDDDD¤‚©Yºt1-½ÔT8|8kÀÒ¥pô¨YÇÍ š6u4kæh~~š_T¤¢ÉoÏâœæO?yvI̼›·^ž¶=MZZËXFQ„N}ê3‚ g8õ¨—çñ5žÂ(ð|ìÅÌŠc.¨¼â*Ì1¤Ÿ ,+êû—Ýñ'’ÈÄ´‰¼zæU^ºø/W™qŒ+Õé6²ûÙ’Û4ű¾ˆ3HM…;L²ÿ·ßLÿ“'¡vmèÙþþw“ô†2þãKDJ˜ŠDDDDDDD“àoÚî»/ã²Ë—Ó ìÙc¦X¹fÍ‚óçÍ:æµÍšAóæ š41"R¶¥O¦å•`*SI%>>€Ég'3)mR¶Û/θóû³¥4Ö)-II°aƒIø¯\ «W›Q»jÕ‚Ûo‡_4Iÿ¶mÍÿÕEDòË–fõÿ€DDDDDDD¤L;}öï7mß>ÇãýûáìY³Ž»;øû;ŠÒ øûkŠ‘Ò@ttt^gO å7¹š9ɘùù¼“Ù­“Óòìzé_{•«DM$‘lc]éÊXÆòþ’ëT…§ Ër;7…Ù~acÊï:Å™\Ïs_؈&š0ÂJ´ ¤ôÙ½ÏÅýžæ¶ÏœÖÍ.®3œ¡Î¤:µ¼j1ŽqŒe,5¨‘ãv‹«'}úíätmäöºâ\¿(Ÿo›ÍFtt4aaaù~TL—/Ø„ÿªU°v-\¹ šžþwÜaî[·VÒ_DŠF5ø"""""""R$uê˜ÖµkÖegÏf, Ø·Ö¯‡¯¾2Å`FhÒ$ãÈö"¦MÍ"b­ôîdýü>ŸŸmf›•©ÌS7o+XAQ<Îã<ÏóŒ`Oó4õÉ:Çyaã)ì²ì†«/ê6ò»,¿ëg²¼ Û*©u ³~Q¶[ÜïiaÖM¿Î)N1…)Lc>ÿëó<ËÆPêyn·$ΛÕï³úKJIˆ‡ß7=üW¯†MïÿæÍMÂÿñÇÍ}` Õ‘ŠHy£")1µjAh¨i™?Ÿ±@`ÿ~ؼ¾ýN2븺‚Ÿ_Æ{‘@@xz–îñˆHÙÖëæíGøˆˆ$’ÉLf ‰ ‚P²ùa%RΜàïò.Ó™Nuª3žñŒd$U©juh"eZj*ìÚkÖ˜öÛopà€ùÿlHˆéáÿì³Ð£4h`u´"RÞ©@DDDDDDD,áí :™–YbbÖ;`þ|Ó£ Ì©¾¾Y ì­R¥Ò=);üðã Þ`<ã™Ã"‰¤ ]%”gx†¿ð<Ð0$R¾ÄÇÛ¼ÍLfR“šLbOó4U¨buh"eÒÅ‹fhÿ5kLoÿ߇  F èÖÍôòïÞºtêÕóÞžˆHqR€ˆˆˆˆˆˆˆ8//èÐÁ´Ì.]ÊZ ‹Á±cf› 7ÎZhFб"å[æ¹½óceÚJ¢ˆâ žàyžçižf$#³*@ s®Ë°ëåé¸s˜·x‹YÌÂÞážäI*Q<Õråé\‰ä$5ÕüsýzX·Î í¿c¤¤˜ÿ[vïo¿mM±ªˆˆ•T """""""eJµjЮi™]¹’µ@`ÿ~X²ââÀžsðñ1_ØÚ[Ó¦ŽÇ›a[E¤béqóGݼ½É›ü…¿A]éjuˆ"rƒLf2_ð iÈ|ÀP†:Í(é‹l6› Ä©ÄÅ™dÿúõ¦·ÿÆf¤ªÊ•M‘êÝwÃøñ¦Ç}ÕŠ‰ˆR€ˆˆˆˆˆˆˆ”Uª@Û¶¦evíÄÆÂÁƒæÞÞ¾ÿÞÜ_¹bÖóð€&M2 ¤/¨Q£tID ®(ÉÄÆ4f“xט∢ÝèD'žá2O<‹1Ú²­¼&nËòqíc“™ÌlfÓ„&|ÄG aÈþ {®Êò9–òåüy“ì·÷ò_·Nœ0E¡ÁÁ ƒ™ûpSfMDÊý¨‘ ¡R%óEnppöËãã…öB;aáB3Í€=WQ»vöàë«QDÊ O<zó¶†5Le*ÃÆ ¼Àp†3ŠQ4 ÕaŠÜ²›ÝLf2_ñÍhƧ|Ja¸) rËõë°ysƤÿÞ½æÿyþþ&Ñÿüóй3tìU«Z±ˆHáØÒTn'"""""""’«ë×³Ž ¾`àÒ%³ž»»E ýôé›··µÇ!@tt´Å‘”MÇ8Æt¦3ƒœå,ó0DÐîV‡V¦=ÄCÌg>htë¹SœÂ ¯[óÖãU¨Â>öцV…ê”¶³ÉL澡­x™—Ä \Фä¥Åf³MXX˜Õ¡H:©©ãÖÝ:غ’’LQgh¨i;›V·®Õ‹ˆ•ŠˆˆˆˆˆˆˆäÁÓ‚‚LËΩSY‹bbà‡Ì(©©f½Zµ2N-¾@ÀÏOÃËŠ8»F4b"y…W˜Ë\¢ˆâvn§#‰ ‚A ÒT…ÐnÌg>Ç8–áù3œÉðo6¤³…-Ld" X@!Ìe.ó°’ÿRa=šqHÿ àâE3]TûöУ‡£—` ÕÑŠˆ”,ýi)"""""""RDuëšÖµkÖeׯÃáÃY‹–,1÷/šõÜÜL!@v#øû›k"â<ñ䉛·µ¬e*SÎpþÆßxš§ÉÈ ½Ú%wƒÄ‹¼H9Z놘PŠQ9¯ l`"YÈBÚÓžïøŽ À†ÍêÐDJEZìÛ[¶˜¡ý·l1->ÞLËÔºµIô?ö˜¹ Q¡¥ˆT<ú±'"""""""R‚<=¡E Ó²“qjØXóÅö?B\¤¤˜õªW7ÅþþfS4`NE"Öèzó6…)Lg:Ÿð oó6æÏŒa =èauˆNÏ_B e=ëI%5ÛuRHaƒJ92ç²–µL`‹YL(¡,d!÷s¿’ÿR®Ý¸;v8ý[¶˜!ýMb?(:v„_4÷:@ÕªVG-"b=ˆˆˆˆˆˆˆˆXÈÇÇ´.]².»qŽC‡2¶aÞ<8qÂô†ƒì‹Ò·š5KãhD*®4àüƒ—y™où–H"éIO:Ð1Œá1»5¿½dõO° Ù.sÁ…;¸£ÂN°ŠULd"?ñÝéΖp÷Y–H±KL4 ~{²ófS”d†ôo×δ!CÌðþ!!PI?VED²¥"'åáÍš™–ûT™‹Ö¯‡o¿5Ev5jd, È\(P£FI‰HÅá‰'ƒoÞֱ޸€Œàø†3œQŒ¢1­Óé d Dd»Ì†! )åˆJÆU®òÏI$ny|=¿ŒeL`ËYN/zñ3?Ó‡>¥©HɊϘì߸ь†”–fŠ#Ûµƒ{î¿ýÍá#>âÞáAd cèE¯|mg:Ó¹‹»hA{9P‡:ÜÃ=üÄO¤’a™ ñE‘ŸÜ ýXÆ2ºÓ=džù‘×yßø>ô¹U R¥¥™äþæÍ¦mÚdÿññfyÓ¦&Éÿøãæ¾}{ðõµ6f‘òÀ––f4NDDDDDDDD*’«WáàÁì ‚„Ǻµkg-H_( ùwˆððp¢££-ޤbºÁ æ1H"YËZÚÑŽ1Œ!Œ0*S9Ç×xâ À:ÖљΥr©šÍlžà RI½õœnÜÇ},b‘…‘Ý nð_ü¿ð )¤Ð”¦ìc.¸ÜZç~`"YËZúÒ—Wy•ît·0jÉ/›ÍFtt4aaaV‡b©sç`ûvع¶m3CùoÛf†ùwsƒ  ÇþíÛC‡àímuÔ""å“F© *W†à`Ó²sù²)È\(°|¹¹?sƱ®£0 Iðó3ýüÌ¿õ%¿xàAØÍÛ6ð0šÑ¼È‹ g8#‰~^3—¹¸àB/z±…åvHø Àw®sýÖs)¤”ù©npƒ‡y˜_ø…d’8ÈA¾æk1ˆ…,dØÄ&úÑ?øƒPB-ŽZ$gW¯Â®]&á¿k—IôïÜ qqfy͚ЦiC†˜dHTªdmÜ""‰F‘B¹xÑQ¾PàÈ8|NŸv¬ë啱0 }ó÷‡ ÀÅ%»½HqÒHÎç$'™Á ¦1Sœbˆ ‚Þô #ÙÂRIÅåæmsÈ@k/!ðó™+Y^‰Jœá U¨bqd…“DÈøÏ­cSÔá‹/Þx³m `¯ñíioa´RXåu$€”Ø¿ß$ûwìpôì5ËìÅ„mÚ@ëÖŽûÆ­Ž\DD4€ˆˆˆˆˆˆˆˆJõꎞ~Ù,nÂJªIDAT¹rÅQ¾mßÿù;É7sbîî&iy{kÒD=¥|ªG=^á^äE¾ã;"‰äNî¤-m¹ŸûÙĦ[릒Ji b $0ŠQF^23˜yÌÀwäÁ2[B ñ‹XD )–¥’ʎЈFle+mÈá©H)9zÔ$ùí ÿ;M/ÿk×ÀÕš53¿ïÃÃM¯þ¶m! À,ç£")Uªä>Ý@JŠ)8r$k±À† f4Ë—ë׫—µ0 }±@íÚ¥qT"%Ãwݼmd#‘DòOþ‰;î$‘tk½´›·ÑŒæ4§y×,Œºøõ¥/U©Ê%.‘DƒluH…b/XÀ‚,v6lœã!„”rtR‘;gý;wš^ýöþçϛ徾&É÷Ý0nœyܪ• ñDDÊM """"""""NëÌGaÀáÃY‹Nžt¬[µª) °&~º??hÔH=5@Ùq‚øá—aùÌlØÉH"‰Ä…ò3ŸÆ“<É,fQƒ$€;îV‡T )¤ð8ó5_çXÞ|æó –BdRRœq:€#G &vï6÷11&ñŸ`–׬龿m[“ì ookã‘â¡‘DDDDDDDDÄiÕ®mZû¦É¾vͤ/ 8töìŸ~2Ã'ÝìDíæf 2O7àëë¸÷ò*­#ÉÝ'|’ç:i¤1é$ÀlfãG)D–?‰‰‰¤¤¤páÂRSSoÝœ;w.Û×\ºt‰¤¤$×m ½À÷”/ V,ÀÛ͖ۛå5ÕªUÃÝÝ T¯^777¼¼¼puu½u_šRIeÃò]àŠ+/ó2€¬Ç'’›¤$Ø¿ß Û¿w¯¹ß½Ûü¼tɬããcýAAðàƒ¦WëÖæ÷¡ˆˆ”_*‘2«R%hÙҴ줦‰YG8r6o6÷‰‰ŽõkÔ0ÅMš@ãÆ¦¥/hÜ<=KåФ»Á ¢ˆÊu»TR™Ï|úÒ—óoªQ­ÐûMNNæôéÓ·Ú¹sç¸p቉‰·Ú… 8þü­Ç‰‰‰\½z•‹/’œœ|ë¾H\€ó°ã‘<²â‘¢m ¨Q£...x{{ãî—ÞÞÞÔ¨Q///¼¼¼2<¶/«U«uëÖÅÇLJʕ+繟4ÒxЧ˜ÍlRIÍu]W\qÃë\g7»ùèG¿"«”O/šžü{ö˜D¿½‡ÿ¦ÀÅÅ·µjwÞ #F˜©xZµ2=þED¤âQ€ˆˆˆˆˆˆˆˆ”[..¦·c£FpûíÙ¯sþ<ÄÅ™ââL³£üóÏæßׯ;Ö¯_?c€½H qcSÀÞ„½<D·D¨ ®u\ñêäEõêÕ©ãQ‡;·Ý‰oC_5jDÆ ñõõ¥~ýú¸»»[}8åNIÄžŽåÚ±k=z”cÇŽqüøqŽ=ʉ'8zô(GŽáâÅ‹xzzâïïO`` HPP·FL²Ãf³MXX`F9pöî͘ìß»Ž7¯qs3Cø7onzòÛ{ô›eDDDŠBE"""""""""¥àêÕì Ž1EGŽ˜¢vÞÞY üüÓøùA•*‹AEÎ->>ž;v°{÷î[÷;wîäìÙ³€™ÛÞž0¶ßÛûùù)yìä8pà±±±· :ìßÌ {zzDpp0­[·¾u`Ù¨ ’½ädós|ï^¸ÿþg¸çžÑ@ öï7ϧ¦‚Íf¦‹iÞÜÑZ´0÷ š))*qçÏ; Žu´#GàØ1³ìÚ5Çú5k: Ò4lhO¾¾P½ºc}8ØØXÖ¯_ÏÆÙ°a[¶láÜͱÀëׯŸ% ܪU+êÔ©cqÔRR®^½JLL 111lß¾˜˜vìØAll,)))xzzÒºuk:tè@§NèÔ©mÛ¶ÕÈ%,-ÍüÜÝ»öï7÷öÞý±±”d_ó-[Âí·×ÍðoÞ*W¶òDD¤¢R€ˆˆˆˆˆˆˆˆHrê”NúèQ“œ:v,ëã+Wë{y™Q|}aß¾T­z†ˆˆ‡2”дêrÓ©S§X½zõ­¤ÿúõë9wîÜvÛmtìØ‘öíÛÓªU+Z·nM­Zµ¬YœÄõë׉‰‰a×®]lÛ¶íVÑHæÏO§NèÞ½;­Zµ²:ä2çúu8xÐ ßkÚŽÛ ¯¼½M/þfÍ eËŒ=ûkÔÈ8€ˆˆˆÕT """"""""RΜ=k 6÷öi–,ÙÎÕ«µHIi”aê*Uö‚ÌËR'ôÔTS,aÕ¼ÚÇgùòå¬ZµŠ•+W²{÷nÜÜÜhݺõ­^Ü:u¢M›6xxxX¤”i™G’Ø´i.\ nݺôèу^½zÑ«W/BBBpqq)õøÖ¬öí§üéÓüéïãâL€ºuÍ0ý¦8ý¹ý ´ÙT ""ÎEE"""""""""DúésM .ÎLO`W©’)hØ0ëôöÇõê™9°­ ÀcÁ믛D^IJLLdéÒ¥,^¼˜•+W²ÿ~*W®L×®]éÕ«={ö¤k×®Tv–Œ¨”;iiiìܹ3CñI||<5kÖ¤GÜsÏ=ôïßÿcÅ xî9Ø´ ví‚Ò˜ 9ÙüÜÊœà·?¾pÁ¬çîMš8ý™ï«U+ÜþU ""ÎFE"""""""""Dú"€ü¸|ÙŒ pì˜i™?nzØÚ¹»›ä{ãÆ¦XÀ>š@ƒŽ‚FJ¾wðÆÐ©“yìâÂÿûpÛmÅ·°hÑ"-ZÄÊ•+èÝ»7½{÷¦gÏžtîÜY½üÅR111¬ZµŠåË—óÓO?‘@HHýû÷§ÿþtíÚWW×bÙ×O?Áøñðûïàê ))°d Üw_±l€„8tÈÑÒáø0$%™õjÔp$ö3÷ê÷õ7·â‹ÉNE""âlJà׈ˆˆˆˆˆˆˆˆ”U«šž¼¹õæ½zÕŒpâ„) 8qÂ1¢ÀºuðÝwpò¤#AP»¶£0 s€½h nÝÂÇ}ü¸ãqj*üë_ðÍ7pï½ðòËгgá¶»oß>¾üòKæÍ›ÇîÝ»©[·.ýúõcΜ9ÿ¿½{‰ê\Û8~Í ÂLUÄl(Èj•C UÔ&D I՚آi5öÀËK»c5&MZÛÚ´ÛÔ˜jM»Ýé‡êÖxˆÛ–´¾ØÒvÓ6¥*XSO5)°('+žrz?LgX0üÉÊÌ,Ö¬ç^+ýp_ëy”––¦aÝ}ŒèÑÑÑŠŽŽVff¦uäÈOpeݺu5j”æÍ›§Å‹kÖ¬Y]^6 ¹Yúê+Wó¿¨èNs½±Ñõ¾¼¼kõ¶mò»·²2×ë®ã,׿QQ®æ~rrë§ùÿö·® €/" Ûl6ךÙ=Ôñ1MM® @E…«Aÿûïw^ËË¥tMå}íÚïÜ „‡»Þ·¸{¼ \MȆ×gwáûï¥ÿþWš6MzóMiîÜ{/_ðÇè“O>ÑÎ;UPP ‡Ã¡gžyFÛ¶mÓÔ©S Yoè*‹Å¢¤¤$%%%iíÚµ*--Õ—_~©Ý»w+55U‡CO?ý´ž{î9EGGwz®æf)'GZ½Z:uÊÕ”—îüÞ\ãݸt©ý&ÿo¿µßäŒtmS§Þyïp¸þ2ä¾o >å€A¢«Ëô5÷ò-gh;Ã@U•ëIc·ààÖ³ „…I'OJ_~)9íãž®|âDW#sÑ¢»§?zô¨6lØ }ûöÉßß_O>ù¤–.]ª™3gÒø‡O)..ÖöíÛµ{÷nkÊ”)Z±b…-Z¤!-ºíMM®5ÞyG:wεÔFËßbK‹ïú]º›ýîÙìúFFºžæw7øÝÛ@lò³ ¿! ý=àÆF©²²õl-g¸xQª«“jk[?™Üw/ÿÁ¥U«¤çŸoV~þ7zï½÷´ÿ~M›6MË—/ׂ d³Ùzÿâ577ëàÁƒÚ¼y³öìÙ£ððp­\¹RÏ=÷?úâ‹¡zûm©¤Ä5{FSÓ½Ï"¥¦ÞÝäw8$ÿ^½”>GÐß _x#-MÊËëÞwM¦Õš=û”V­Z¡”””­ (ÊÊÊôþûêãr:?ÔõGóÃÂ\Á€ ¿ñ»÷!0p´]‹¼=þþR}½ëýTêÆMž\£µkŸQZZLïôscÆŒÑ?ÿ¹Q™™uúÇ?þO{÷ÈÏo¼bÔØhÒ!®Ù:Z@r-ÝÑÔtgÆ Ðwøï€O©¬lýÙdº3ý¸Å"Mš$-[&-]ºW6Û…‡ÏT^Þ0ý/ …øø eg§«¤ä=þø›jl´é±ÇVëÍ7ohþ|Énw×ò7æÖØèZžô=B|†Ó)ÕÕÝùlµJ3fH«VIß}']¹"íßUçÎÍÕž=OkÕªL¯®®N#GŽ4ºŒVL&S«éßÝÍ]÷kËéáÛkß똖ÜÇtuºù®ŒÓ¶Yíí9ÚÖÔÑy¼=®«u{Ë›ñ{êx;^0bÄI®ßèðy‘‘‘*++3ºŒVz¢1ß•ïôæ8îóßïšöÞž§³ãÚ«»§‚ßS÷ÀÛñú‹ÒÒRY­V…„„] ø !>ï‰'žÐ·ß~; ¦,ïÎÓë5ˆ»èê8¿+×ãmÞzr9€{ßS÷ÀÛñú‹œœÍ›7O~~~F—þB€ÏKOOט1côî»ï]ŠWÜëžx²¾?è©ëé wã½íf#îAo+((PNNŽV¯^mt) B|žŸŸŸ>üðC­_¿^ÙÙÙF—Ó©îL÷ß‘žž¿;zòz*_¼çÏŸ×Â… •••¥øøx£Ë-0(<öØcZ³f/^¬Ý»w]NŸéA#´w½ƒíô–ââb%''ËáphÆ F—Ú `Ðxíµ×´jÕ*-Y²D¯¾úª «ÅÝîè)ñŽÖ²ï¨©ßYƒ»;A€îŒÓ™Ž®§§µ¼-ïq˜Š¿¯îAoÊÍÍÕÔ©S¡¯¿þZþþþF—Ú `Pyçw´cÇýë_ÿRbb¢>ܧã·×¤n¹¯íûöšñ-÷µmpß«ÉÜÝ @gãtöÔý½®ÇÛóx{\Û1ÛÖq¯ót¤½ïy»¯;÷ +×Ûªªª´téRÍ›7O ,P^^žû´àB%K–èĉ ÑŒ3”‘‘¡ÚÚÚ>ßÝnÙnïï}îì·³ñºSkWÆï쳷繟ëõ¦îîÜo÷uçtõz{KSS“>úè#EGG+??_{÷îÕ–-[dµZûd|Ðu„ J=ôòòò´gÏ}óÍ7š0a‚Þxã UWW]`¸úúzmß¾] Z¹r¥²²²tæÌÍŸ?ßèÒÀ=0¨-\¸P¿üò‹^yåmÙ²Ecƌы/¾¨_ýÕèÒ€>wíÚ5mܸQãÆSff¦&Ož¬'Nhݺu:t¨Ñå/0è >\¯¿þºÊÊÊôÁèûï¿×ĉ5wî\eggËét]b2™L÷Üî‡TPP eË–Éápèí·ßVzzºŠ‹‹µ}ûvÅÄÄ]èBð«Õª¬¬,;wNÙÙÙ2›ÍZ¼x±BBB”••¥C‡õÙZ콩ízóímƒÉ`½åååZ³fbbb”””¤ƒê­·ÞRyy¹Þÿ}EDD]"è?£ €þÆl6kÁ‚Z°`ª««µgÏíØ±Cü±¢¢¢4þ|Í™3GÉÉÉò÷÷7º\Àk§NRnn®¾øâ (44T‹-Ò§Ÿ~ªøøx£Ë=€™ ÁÁÁZ¾|¹ uúôi=ÿüó:|ø°ÒÒÒd·Û•žž®íÛ·«¦¦ÆèR»8Nåååéå—_VTT”âããõÑG)>>^_}õ•ÊË˵qãFøf/ÅÆÆ*66V«W¯Vee¥rss•››«eË–éæÍ›Š‹‹ÓÌ™35sæL͘1C!!!F—ŒAæÖ­[:räˆòóó•ŸŸ¯üQN§SÓ¦MSff¦æÌ™£„„£Ë½ˆtChh¨222”‘‘¡Û·oëСCžÆëæÍ›åt:£ääd͘1CS¦LÑ„ d2™Œ.>¤ººZEEEúᇴÿ~;vLN§S±±±JNNVff¦RSSe·Û.ôBpŸ¬V«RSS•šš*Éõ4öÑ£Gµÿ~8p@;wîÔÍ›7¨ÄÄDÏ6eÊ7Ž`¼réÒ%ª¨¨H………*,,Ôùóçe6›§””­X±BÉÉÉ 6º\`BÐÃl6›gYIjhhÐéÓ§= Üüü|mÚ´IN§SAAAzä‘G£‡~Øóʓۃ׭[·tæÌ={V§NÒÙ³gõóÏ?«´´T&“IãÇWbb¢V¬X¡ÄÄDMžú(èaééér8F—€‡©¹¹¹Ùè"Àý3]è„ð„ð„ð„ð„ð„ð„ð„ð„ð„ð„ð„ð„ðÿ˜ÖŠÉ„§IEND®B`‚gfarm-2.4.1/doc/internal/png/Makefile0000644000000000000000000000025611507222722016120 0ustar rootrootTARGETS = gfmd-thread-dependency.png .SUFFIXES: .png .dot .dot.png: dot -Tpng -o $@ $*.dot all: $(TARGETS) dep_libgfarm.png: dep_libgfarm.dot clean: -rm -f $(TARGETS) gfarm-2.4.1/doc/internal/png/gfmd-thread-dependency.dot0000644000000000000000000000644611507222722021475 0ustar rootrootdigraph threads { graph [label = "Inter-Thread dependency of gfmd", labelloc = t, labeljust = l, fontsize = 18, compound = true]; accepting_loop; removal_finalizer; sigs_handler; callout_main; peer_watcher; replication_finalizer; remover; resumer; peer_closer; db_thread; protocol_main -> db_thread [label = "dbq_enter\ndbq_waitret\nfindxmlattr_dbq_enter", fontcolor = cyan, color = cyan ]; resuming_thread -> db_thread [label = "dbq_enter", fontcolor = cyan, color = cyan ]; replication_finalizer -> db_thread [label = "dbq_enter", fontcolor = cyan, color = cyan ]; removal_finalizer -> db_thread [label = "dbq_enter", fontcolor = cyan, color = cyan ]; peer_closer -> db_thread [label = "dbq_enter", fontcolor = cyan, color = cyan ]; sigs_handler -> db_thread [label = "db_terminate", fontcolor = cyan, color = cyan ]; subgraph cluster0 { label = "authentication_thread_pool"; try_auth; } accepting_loop -> try_auth [label = "thrpool_add_job", fontcolor = blue, color = blue]; subgraph cluster1 { label = "sync_protocol_thread_pool"; host_busyq_scanner; protocol_main; resuming_thread; } callout_main -> host_busyq_scanner [label = "thrpool_add_job", fontcolor = blue, color = blue]; try_auth -> protocol_main [label = "thrpool_add_job", fontcolor = blue, color = blue]; peer_watcher -> protocol_main [label = "thrpool_add_job", fontcolor = blue, color = blue]; resumer -> resuming_thread [label = "thrpool_add_job", fontcolor = blue, color = blue]; try_auth -> protocol_main [label = "giant_lock", fontcolor = red, color = red, lhead=cluster1]; replication_finalizer -> protocol_main [label = "giant_lock", fontcolor = red, color = red, lhead=cluster1]; removal_finalizer -> protocol_main [label = "giant_lock", fontcolor = red, color = red, lhead=cluster1]; peer_closer -> protocol_main [label = "giant_lock", fontcolor = red, color = red, lhead=cluster1]; sigs_handler -> protocol_main [label = "giant_lock", fontcolor = red, color = red, lhead=cluster1]; subgraph cluster2 { label = "back_channel_send_thread_pool"; gfs_client_status_request; gfs_client_fhremove_request; gfs_client_replication_request_request; } protocol_main -> gfs_client_replication_request_request [label = "thrpool_add_job", fontcolor = blue, color = blue]; protocol_main -> gfs_client_status_request [label = "thrpool_add_job", fontcolor = blue, color = blue]; callout_main -> gfs_client_status_request [label = "thrpool_add_job", fontcolor = blue, color = blue]; remover -> gfs_client_fhremove_request [label = "thrpool_add_job", fontcolor = blue, color = blue]; subgraph cluster3 { label = "back_channel_recv_thread_pool"; back_channel_main; } protocol_main -> back_channel_main [label = "thrpool_add_job", fontcolor = blue, color = blue]; peer_watcher -> back_channel_main [label = "thrpool_add_job", fontcolor = blue, color = blue]; gfs_client_status_request -> back_channel_main [label = "RPC request & reply", fontcolor = green, color = green]; gfs_client_fhremove_request -> back_channel_main [label = "RPC request & reply", fontcolor = green, color = green]; gfs_client_replication_request_request -> back_channel_main [label = "RPC request & reply", fontcolor = green, color = green]; } gfarm-2.4.1/doc/internal/ja/0000755000000000000000000000000011507222730014262 5ustar rootrootgfarm-2.4.1/doc/internal/ja/gfarm-v2-schema-phys.eps0000644000000000000000000006331511507222722020644 0ustar rootroot%!PS-Adobe-2.0 EPSF-1.2 %%Creator: idraw %%DocumentFonts: Helvetica GothicBBB-Medium-EUC-H Times-Roman Ryumin-Light-EUC-H %%Pages: 1 %%BoundingBox: 43 118 552 687 %%EndComments %%BeginProcSet: cmpfont.ps 1 2 % composite fonts for ASCII-EUC mixed string % Version 1.2 1/31/1990 % Author Ken'ichi HANDA (handa@etl.go.jp) % Modified Norio Katayama (katayama@rd.nacsis.ac.jp),1998% Anyone can freely copy, modify, distribute this program. /copyfont { % font-dic extra-entry-count copyfont font-dic 1 index maxlength add dict begin { 1 index /FID ne 2 index /UniqueID ne and {def} {pop pop} ifelse } forall currentdict end } bind def /compositefont { % ASCIIFontName EUCFontName compositefont font' userdict /fixeucfont_dict known not { userdict begin /fixeucfont_dict 2 dict begin /UpperByteEncoding [ 16#00 1 16#20 { pop 0 } for 16#21 1 16#28 { 16#20 sub } for 16#29 1 16#2F { pop 0 } for 16#30 1 16#74 { 16#27 sub } for 16#75 1 16#FF { pop 0 } for ] def /LowerByteEncoding [ 16#00 1 16#A0 { pop /.notdef } for 16#A1 1 16#FE { 16#80 sub 16 2 string cvrs (cXX) dup 1 4 -1 roll putinterval cvn } for /.notdef ] def currentdict end def end } if findfont dup /FontType get 0 eq { 12 dict begin % % 7+8 bit EUC font % 12 dict begin /EUCFont exch def /FontInfo (7+8 bit EUC font) readonly def /PaintType 0 def /FontType 0 def /FontMatrix matrix def % /FontName /Encoding fixeucfont_dict /UpperByteEncoding get def /FMapType 2 def EUCFont /WMode known { EUCFont /WMode get /WMode exch def } { /WMode 0 def } ifelse /FDepVector [ EUCFont /FDepVector get 0 get [ 16#21 1 16#28 {} for 16#30 1 16#74 {} for ] { 13 dict begin /EUCFont EUCFont def /UpperByte exch 16#80 add def % /FontName /FontInfo (EUC lower byte font) readonly def /PaintType 0 def /FontType 3 def /FontMatrix matrix def /FontBBox {0 0 0 0} def /Encoding fixeucfont_dict /LowerByteEncoding get def % /UniqueID % /WMode /BuildChar { gsave exch dup /EUCFont get setfont /UpperByte get 2 string dup 0 4 -1 roll put dup 1 4 -1 roll put dup stringwidth setcharwidth 0 0 moveto show grestore } bind def currentdict end /lowerbytefont exch definefont } forall ] def currentdict end /eucfont exch definefont exch findfont 1 copyfont dup begin /FontMatrix FontMatrix [1 0 0 1 0 0.05] matrix concatmatrix def end /asciifont exch definefont exch /FDepVector [ 4 2 roll ] def /FontType 0 def /WMode 0 def /FMapType 4 def /FontMatrix matrix def /Encoding [0 1] def /FontBBox {0 0 0 0} def currentdict end }{ pop findfont 0 copyfont } ifelse } def /slantfont { % FontName slant-degree slantfont font' exch findfont 1 copyfont begin [ 1 0 4 -1 roll 1 0 0 ] FontMatrix exch matrix concatmatrix /FontMatrix exch def currentdict end } def %%EndProcSet %%BeginProcSet: idraw 3 0 /IdrawDict 52 dict def IdrawDict begin /arrowHeight 8 def /arrowWidth 4 def % reencodeISO was modified to deal with a composite font correctly. % Modifier: Shigeru Chiba (chiba@is.s.u-tokyo.ac.jp) % Kazuhiro Kazama (kazama@expert-sun.ntt.jp) /reencodeISOa { % CompFontName font reencodeISOb font' dup length dict begin { 1 index /FID ne { def }{ pop pop } ifelse } forall /Encoding ISOLatin1Encoding def currentdict end definefont } def /reencodeISO { % FontName reencodeISO font dup dup findfont dup /FontType get 0 ne { reencodeISOa }{ dup length dict begin { 1 index dup /FID eq { pop pop pop }{ /FDepVector eq { dup length array copy dup dup 0 get 4 index exch reencodeISOa 0 exch put def }{ def } ifelse } ifelse } forall currentdict end definefont } ifelse } def /ISOLatin1Encoding [ /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef /space/exclam/quotedbl/numbersign/dollar/percent/ampersand/quoteright /parenleft/parenright/asterisk/plus/comma/minus/period/slash /zero/one/two/three/four/five/six/seven/eight/nine/colon/semicolon /less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N /O/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright /asciicircum/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m /n/o/p/q/r/s/t/u/v/w/x/y/z/braceleft/bar/braceright/asciitilde /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef /.notdef/dotlessi/grave/acute/circumflex/tilde/macron/breve /dotaccent/dieresis/.notdef/ring/cedilla/.notdef/hungarumlaut /ogonek/caron/space/exclamdown/cent/sterling/currency/yen/brokenbar /section/dieresis/copyright/ordfeminine/guillemotleft/logicalnot /hyphen/registered/macron/degree/plusminus/twosuperior/threesuperior /acute/mu/paragraph/periodcentered/cedilla/onesuperior/ordmasculine /guillemotright/onequarter/onehalf/threequarters/questiondown /Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE/Ccedilla /Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex /Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis /multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute /Thorn/germandbls/agrave/aacute/acircumflex/atilde/adieresis /aring/ae/ccedilla/egrave/eacute/ecircumflex/edieresis/igrave /iacute/icircumflex/idieresis/eth/ntilde/ograve/oacute/ocircumflex /otilde/odieresis/divide/oslash/ugrave/uacute/ucircumflex/udieresis /yacute/thorn/ydieresis ] def /none null def /numGraphicParameters 17 def /stringLimit 65535 def /Begin { save numGraphicParameters dict begin } def /End { end restore } def /SetB { dup type /nulltype eq { pop false /brushRightArrow idef false /brushLeftArrow idef true /brushNone idef } { /brushDashOffset idef /brushDashArray idef 0 ne /brushRightArrow idef 0 ne /brushLeftArrow idef /brushWidth idef false /brushNone idef } ifelse } def /SetCFg { /fgblue idef /fggreen idef /fgred idef } def /SetCBg { /bgblue idef /bggreen idef /bgred idef } def /SetF { /printSize idef /printFont idef } def /SetP { dup type /nulltype eq { pop true /patternNone idef } { dup -1 eq { /patternGrayLevel idef /patternString idef } { /patternGrayLevel idef } ifelse false /patternNone idef } ifelse } def /BSpl { 0 begin storexyn newpath n 1 gt { 0 0 0 0 0 0 1 1 true subspline n 2 gt { 0 0 0 0 1 1 2 2 false subspline 1 1 n 3 sub { /i exch def i 1 sub dup i dup i 1 add dup i 2 add dup false subspline } for n 3 sub dup n 2 sub dup n 1 sub dup 2 copy false subspline } if n 2 sub dup n 1 sub dup 2 copy 2 copy false subspline patternNone not brushLeftArrow not brushRightArrow not and and { ifill } if brushNone not { istroke } if 0 0 1 1 leftarrow n 2 sub dup n 1 sub dup rightarrow } if end } dup 0 4 dict put def /Circ { newpath 0 360 arc patternNone not { ifill } if brushNone not { istroke } if } def /CBSpl { 0 begin dup 2 gt { storexyn newpath n 1 sub dup 0 0 1 1 2 2 true subspline 1 1 n 3 sub { /i exch def i 1 sub dup i dup i 1 add dup i 2 add dup false subspline } for n 3 sub dup n 2 sub dup n 1 sub dup 0 0 false subspline n 2 sub dup n 1 sub dup 0 0 1 1 false subspline patternNone not { ifill } if brushNone not { istroke } if } { Poly } ifelse end } dup 0 4 dict put def /Elli { 0 begin newpath 4 2 roll translate scale 0 0 1 0 360 arc patternNone not { ifill } if brushNone not { istroke } if end } dup 0 1 dict put def /Line { 0 begin 2 storexyn newpath x 0 get y 0 get moveto x 1 get y 1 get lineto brushNone not { istroke } if 0 0 1 1 leftarrow 0 0 1 1 rightarrow end } dup 0 4 dict put def /MLine { 0 begin storexyn newpath n 1 gt { x 0 get y 0 get moveto 1 1 n 1 sub { /i exch def x i get y i get lineto } for patternNone not brushLeftArrow not brushRightArrow not and and { ifill } if brushNone not { istroke } if 0 0 1 1 leftarrow n 2 sub dup n 1 sub dup rightarrow } if end } dup 0 4 dict put def /Poly { 3 1 roll newpath moveto -1 add { lineto } repeat closepath patternNone not { ifill } if brushNone not { istroke } if } def /Rect { 0 begin /t exch def /r exch def /b exch def /l exch def newpath l b moveto l t lineto r t lineto r b lineto closepath patternNone not { ifill } if brushNone not { istroke } if end } dup 0 4 dict put def /Text { ishow } def /idef { dup where { pop pop pop } { exch def } ifelse } def /ifill { 0 begin gsave patternGrayLevel -1 ne { fgred bgred fgred sub patternGrayLevel mul add fggreen bggreen fggreen sub patternGrayLevel mul add fgblue bgblue fgblue sub patternGrayLevel mul add setrgbcolor eofill } { eoclip originalCTM setmatrix pathbbox /t exch def /r exch def /b exch def /l exch def /w r l sub ceiling cvi def /h t b sub ceiling cvi def /imageByteWidth w 8 div ceiling cvi def /imageHeight h def bgred bggreen bgblue setrgbcolor eofill fgred fggreen fgblue setrgbcolor w 0 gt h 0 gt and { l w add b translate w neg h scale w h true [w 0 0 h neg 0 h] { patternproc } imagemask } if } ifelse grestore end } dup 0 8 dict put def /istroke { gsave brushDashOffset -1 eq { [] 0 setdash 1 setgray } { brushDashArray brushDashOffset setdash fgred fggreen fgblue setrgbcolor } ifelse brushWidth setlinewidth originalCTM setmatrix stroke grestore } def /ishow { 0 begin gsave fgred fggreen fgblue setrgbcolor /fontDict printFont printSize scalefont dup setfont def /descender fontDict begin 0 [FontBBox] 1 get FontMatrix end transform exch pop def /vertoffset 1 printSize sub descender sub def { 0 vertoffset moveto show /vertoffset vertoffset printSize sub def } forall grestore end } dup 0 3 dict put def /patternproc { 0 begin /patternByteLength patternString length def /patternHeight patternByteLength 8 mul sqrt cvi def /patternWidth patternHeight def /patternByteWidth patternWidth 8 idiv def /imageByteMaxLength imageByteWidth imageHeight mul stringLimit patternByteWidth sub min def /imageMaxHeight imageByteMaxLength imageByteWidth idiv patternHeight idiv patternHeight mul patternHeight max def /imageHeight imageHeight imageMaxHeight sub store /imageString imageByteWidth imageMaxHeight mul patternByteWidth add string def 0 1 imageMaxHeight 1 sub { /y exch def /patternRow y patternByteWidth mul patternByteLength mod def /patternRowString patternString patternRow patternByteWidth getinterval def /imageRow y imageByteWidth mul def 0 patternByteWidth imageByteWidth 1 sub { /x exch def imageString imageRow x add patternRowString putinterval } for } for imageString end } dup 0 12 dict put def /min { dup 3 2 roll dup 4 3 roll lt { exch } if pop } def /max { dup 3 2 roll dup 4 3 roll gt { exch } if pop } def /midpoint { 0 begin /y1 exch def /x1 exch def /y0 exch def /x0 exch def x0 x1 add 2 div y0 y1 add 2 div end } dup 0 4 dict put def /thirdpoint { 0 begin /y1 exch def /x1 exch def /y0 exch def /x0 exch def x0 2 mul x1 add 3 div y0 2 mul y1 add 3 div end } dup 0 4 dict put def /subspline { 0 begin /movetoNeeded exch def y exch get /y3 exch def x exch get /x3 exch def y exch get /y2 exch def x exch get /x2 exch def y exch get /y1 exch def x exch get /x1 exch def y exch get /y0 exch def x exch get /x0 exch def x1 y1 x2 y2 thirdpoint /p1y exch def /p1x exch def x2 y2 x1 y1 thirdpoint /p2y exch def /p2x exch def x1 y1 x0 y0 thirdpoint p1x p1y midpoint /p0y exch def /p0x exch def x2 y2 x3 y3 thirdpoint p2x p2y midpoint /p3y exch def /p3x exch def movetoNeeded { p0x p0y moveto } if p1x p1y p2x p2y p3x p3y curveto end } dup 0 17 dict put def /storexyn { /n exch def /y n array def /x n array def n 1 sub -1 0 { /i exch def y i 3 2 roll put x i 3 2 roll put } for } def /SSten { fgred fggreen fgblue setrgbcolor dup true exch 1 0 0 -1 0 6 -1 roll matrix astore } def /FSten { dup 3 -1 roll dup 4 1 roll exch newpath 0 0 moveto dup 0 exch lineto exch dup 3 1 roll exch lineto 0 lineto closepath bgred bggreen bgblue setrgbcolor eofill SSten } def /Rast { exch dup 3 1 roll 1 0 0 -1 0 6 -1 roll matrix astore } def /arrowhead { 0 begin transform originalCTM itransform /taily exch def /tailx exch def transform originalCTM itransform /tipy exch def /tipx exch def /dy tipy taily sub def /dx tipx tailx sub def /angle dx 0 ne dy 0 ne or { dy dx atan } { 90 } ifelse def gsave originalCTM setmatrix tipx tipy translate angle rotate newpath arrowHeight neg arrowWidth 2 div moveto 0 0 lineto arrowHeight neg arrowWidth 2 div neg lineto patternNone not { originalCTM setmatrix /padtip arrowHeight 2 exp 0.25 arrowWidth 2 exp mul add sqrt brushWidth mul arrowWidth div def /padtail brushWidth 2 div def tipx tipy translate angle rotate padtip 0 translate arrowHeight padtip add padtail add arrowHeight div dup scale arrowheadpath ifill } if brushNone not { originalCTM setmatrix tipx tipy translate angle rotate arrowheadpath istroke } if grestore end } dup 0 9 dict put def /arrowheadpath { newpath arrowHeight neg arrowWidth 2 div moveto 0 0 lineto arrowHeight neg arrowWidth 2 div neg lineto } def /leftarrow { 0 begin y exch get /taily exch def x exch get /tailx exch def y exch get /tipy exch def x exch get /tipx exch def brushLeftArrow { tipx tipy tailx taily arrowhead } if end } dup 0 4 dict put def /rightarrow { 0 begin y exch get /tipy exch def x exch get /tipx exch def y exch get /taily exch def x exch get /tailx exch def brushRightArrow { tipx tipy tailx taily arrowhead } if end } dup 0 4 dict put def end %%EndProcSet %%EndProlog %%BeginSetup IdrawDict begin /Helvetica-Gothic /Helvetica /GothicBBB-Medium-EUC-H compositefont definefont pop /Helvetica-Gothic reencodeISO def /Times-Ryumin /Times-Roman /Ryumin-Light-EUC-H compositefont definefont pop /Times-Ryumin reencodeISO def %%EndSetup %I Idraw 10 Grid 8 8 %%Page: 1 1 Begin %I b u %I cfg u %I cbg u %I f u %I p u %I t [ 0.95606 0 0 0.95606 0 0 ] concat /originalCTM matrix currentmatrix def Begin %I Text %I cfg Black 0 0 0 SetCFg %I f Helvetica-Gothic-18 Helvetica-Gothic 18 SetF %I t [ 1 0 0 1 90.0019 331.984 ] concat %I [ (INode) ] Text End Begin %I Text %I cfg Black 0 0 0 SetCFg %I f Helvetica-Gothic-18 Helvetica-Gothic 18 SetF %I t [ 1 0 0 1 294 331 ] concat %I [ (FileCopy) ] Text End Begin %I Text %I cfg Black 0 0 0 SetCFg %I f Helvetica-Gothic-18 Helvetica-Gothic 18 SetF %I t [ 1 0 0 1 87 669 ] concat %I [ (User) ] Text End Begin %I Text %I cfg Black 0 0 0 SetCFg %I f Helvetica-Gothic-18 Helvetica-Gothic 18 SetF %I t [ 1 0 0 1 180 669 ] concat %I [ (GroupAssignment) ] Text End Begin %I Text %I cfg Black 0 0 0 SetCFg %I f Helvetica-Gothic-18 Helvetica-Gothic 18 SetF %I t [ 1 0 0 1 378 669 ] concat %I [ (Group) ] Text End Begin %I Text %I cfg Black 0 0 0 SetCFg %I f Helvetica-Gothic-18 Helvetica-Gothic 18 SetF %I t [ 1 0 0 1 469 455 ] concat %I [ (Host) ] Text End Begin %I Text %I cfg Black 0 0 0 SetCFg %I f Helvetica-Gothic-18 Helvetica-Gothic 18 SetF %I t [ 1 0 0 1 428 561 ] concat %I [ (HostNameAlias) ] Text End Begin %I Text %I cfg Black 0 0 0 SetCFg %I f Times-Ryumin-14 Times-Ryumin 14 SetF %I t [ 1 0 0 1 87 629 ] concat %I [ (username) ] Text End Begin %I Text %I cfg Black 0 0 0 SetCFg %I f Times-Ryumin-14 Times-Ryumin 14 SetF %I t [ 1 0 0 1 218 638 ] concat %I [ (username) (groupname) ] Text End Begin %I Text %I cfg Black 0 0 0 SetCFg %I f Times-Ryumin-14 Times-Ryumin 14 SetF %I t [ 1 0 0 1 382 624 ] concat %I [ (groupname) ] Text End Begin %I Text %I cfg Black 0 0 0 SetCFg %I f Times-Ryumin-14 Times-Ryumin 14 SetF %I t [ 1 0 0 1 462 421 ] concat %I [ (hostname) ] Text End Begin %I Text %I cfg Black 0 0 0 SetCFg %I f Times-Ryumin-14 Times-Ryumin 14 SetF %I t [ 1 0 0 1 456 529 ] concat %I [ (hostnamealias) (hostname) ] Text End Begin %I Text %I cfg Black 0 0 0 SetCFg %I f Helvetica-Gothic-18 Helvetica-Gothic 18 SetF %I t [ 1 0 0 1 270.075 475.061 ] concat %I [ (DirEntry) ] Text End Begin %I Rect %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg none SetP %I p n %I t [ 1 -0 -0 1 71 125 ] concat %I 7 481 80 516 Rect End Begin %I Rect %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg none SetP %I p n %I t [ 1 -0 -0 1 71 125 ] concat %I 123 475 237 519 Rect End Begin %I Rect %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg none SetP %I p n %I t [ 1 -0 -0 1 71 125 ] concat %I 294 476 386 520 Rect End Begin %I Rect %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg none SetP %I p n %I t [ 1 -0 -0 1 13 -8.00006 ] concat %I 430 504 537 541 Rect End Begin %I Rect %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg none SetP %I p n %I t [ 1 -0 -0 1 13 -8.00006 ] concat %I 440 412 510 435 Rect End Begin %I Rect %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg none SetP %I p n %I t [ 1 -0 -0 1 -53.9933 97.0644 ] concat %I 262 305 350 357 Rect End Begin %I Rect %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg none SetP %I p n %I t [ 1 -0 -0 1.26 18.0019 -103.736 ] concat %I 89 274 192 322 Rect End Begin %I Rect %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg none SetP %I p n %I t [ 1 -0 -0 1 -9.03558 81.9981 ] concat %I 299 181 379 222 Rect End Begin %I Line %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg none SetP %I p n %I t [ 1 -0 -0 1 71 125 ] concat %I 80 508 122 508 Line %I 1 End Begin %I Line %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg none SetP %I p n %I t [ 1 -0 -0 1 71 125 ] concat %I 237 491 294 491 Line %I 1 End Begin %I MLine %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg none SetP %I p n %I t [ 1 -0 -0 1 13 -8.00006 ] concat %I 4 429 516 410 516 410 425 438 425 4 MLine %I 1 End Begin %I MLine %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg none SetP %I p n %I t [ 1 -0 -0 1 -53.9933 97.0644 ] concat %I 2 262 325 351 325 2 MLine %I 1 End Begin %I Line %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg none SetP %I p n %I t [ 1 -0 -0 1 22.0019 -64.0165 ] concat %I 84 340 187 340 Line %I 1 End Begin %I Line %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg none SetP %I p n %I t [ 1 -0 -0 1 13 -8.00006 ] concat %I 430 524 537 524 Line %I 1 End Begin %I Elli %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p 0 SetP %I t [ 1 -0 -0 1 -205.992 119.035 ] concat %I 415 296 3 3 Elli End Begin %I Elli %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p 0 SetP %I t [ 1 -0 -0 1 -205.035 150.107 ] concat %I 415 296 3 3 Elli End Begin %I Elli %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p 0 SetP %I t [ 1 -0 -0 1 -44.0001 -17 ] concat %I 415 296 3 3 Elli End Begin %I Elli %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p 0 SetP %I t [ 1 -0 -0 1 29 211 ] concat %I 415 296 3 3 Elli End Begin %I Elli %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p 0 SetP %I t [ 1 -0 -0 1 -306.998 -28.0165 ] concat %I 415 296 3 3 Elli End Begin %I Elli %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p 0 SetP %I t [ 1 -0 -0 1 -306.998 -45.0165 ] concat %I 415 296 3 3 Elli End Begin %I Elli %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p 0 SetP %I t [ 1 -0 -0 1 -107 320 ] concat %I 415 296 3 3 Elli End Begin %I Elli %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p 0 SetP %I t [ 1 -0 -0 1 -221 337 ] concat %I 415 296 3 3 Elli End Begin %I Text %I cfg Black 0 0 0 SetCFg %I f Times-Ryumin-14 Times-Ryumin 14 SetF %I t [ 1 0 0 1 219.007 449.064 ] concat %I [ (dirINode) (entryName) (entryINode) ] Text End Begin %I Text %I cfg Black 0 0 0 SetCFg %I f Times-Ryumin-12 Times-Ryumin 12 SetF %I t [ 1 0 0 1 432 499 ] concat %I [ (P) ] Text End Begin %I Text %I cfg Black 0 0 0 SetCFg %I f Times-Ryumin-12 Times-Ryumin 12 SetF %I t [ 1 0 0 1 182 627 ] concat %I [ (P) ] Text End Begin %I Text %I cfg Black 0 0 0 SetCFg %I f Times-Ryumin-12 Times-Ryumin 12 SetF %I t [ 1 0 0 1 197.945 406.075 ] concat %I [ (Z) ] Text End Begin %I MLine %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg none SetP %I p n %I t [ 1.04651 -0 -0 1.04106 25.2791 118.088 ] concat %I 4 51 485 37 485 37 146 78 146 4 MLine %I 1 End Begin %I MLine %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg none SetP %I p n %I t [ 0.990712 -0 -0 1.03263 30.1393 119.855 ] concat %I 6 338 496 321 496 321 556 17 556 17 129 78 129 6 MLine %I 1 End Begin %I Text %I cfg Black 0 0 0 SetCFg %I f Times-Ryumin-14 Times-Ryumin 14 SetF %I t [ 1 0 0 1 117.984 589.993 ] concat %I [ (\245\260\245\353\241\274\245\327\244\313\302\260\244\271\244\353) ] Text End Begin %I Text %I cfg Black 0 0 0 SetCFg %I f Times-Ryumin-14 Times-Ryumin 14 SetF %I t [ 1 0 0 1 297.986 588.993 ] concat %I [ (\245\346\241\274\245\266\241\274\244\362\264\336\244\340) ] Text End Begin %I Text %I cfg Black 0 0 0 SetCFg %I f Times-Ryumin-14 Times-Ryumin 14 SetF %I t [ 1 0 0 1 126.007 715.992 ] concat %I [ (INode\244\316\245\260\245\353\241\274\245\327) ] Text End Begin %I Text %I cfg Black 0 0 0 SetCFg %I f Times-Ryumin-14 Times-Ryumin 14 SetF %I t [ 1 0 0 1 68.9981 531.05 ] concat %I [ (INode\244\316\245\252\241\274\245\312\241\274) ] Text End Begin %I Text %I cfg Black 0 0 0 SetCFg %I f Times-Ryumin-14 Times-Ryumin 14 SetF %I t [ 1 0 0 1 92.0067 472.047 ] concat %I [ (\245\307\245\243\245\354\245\257\245\310\245\352\244\313\275\352\302\260\244\271\244\353) ] Text End Begin %I Text %I cfg Black 0 0 0 SetCFg %I f Times-Ryumin-14 Times-Ryumin 14 SetF %I t [ 1 0 0 1 200.903 370.998 ] concat %I [ (\245\321\245\271\314\276\244\254\273\330\244\271) ] Text End Begin %I Text %I cfg Black 0 0 0 SetCFg %I f Times-Ryumin-14 Times-Ryumin 14 SetF %I t [ 1 0 0 1 279.991 505.004 ] concat %I [ (\245\333\245\271\245\310\314\276\244\253\312\314\314\276\244\362\273\375\244\304) ] Text End Begin %I Text %I cfg Black 0 0 0 SetCFg %I f Times-Ryumin-14 Times-Ryumin 14 SetF %I t [ 1 0 0 1 397.977 265.991 ] concat %I [ (\245\354\245\327\245\352\245\253\244\362\312\335\273\375\244\271\244\353) ] Text End Begin %I Text %I cfg Black 0 0 0 SetCFg %I f Times-Ryumin-14 Times-Ryumin 14 SetF %I t [ 1 0 0 1 219.963 253.99 ] concat %I [ (\245\354\245\327\245\352\245\253\244\316\275\352\272\337) ] Text End Begin %I MLine %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg none SetP %I p n %I t [ 0.936382 -0 -0 1.11826 38.7146 102.122 ] concat %I 3 181 307 152 307 152 181 3 MLine %I 1 End Begin %I MLine %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg none SetP %I p n %I t [ 0.8832 -0 -0 1.14395 48.3406 98.6666 ] concat %I 3 181 276 166 276 166 180 3 MLine %I 1 End Begin %I Elli %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p 0 SetP %I t [ 1 -0 -0 1 -124.016 -2.30978 ] concat %I 415 296 3 3 Elli End Begin %I Line %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg none SetP %I p n %I t [ 0.756949 -0 -0 0.50048 91.4449 216.208 ] concat %I 264 156 182 156 Line %I 1 End Begin %I Text %I cfg Black 0 0 0 SetCFg %I f Times-Ryumin-14 Times-Ryumin 14 SetF %I t [ 1 0 0 1 300.964 298.998 ] concat %I [ (inode) (hostname) ] Text End Begin %I MLine %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg none SetP %I p n %I t [ 1 -0 -0 1 27 138 ] concat %I 4 344 140 520 140 520 278 496 278 4 MLine %I 1 End Begin %I Text %I cfg Black 0 0 0 SetCFg %I f Times-Ryumin-14 Times-Ryumin 14 SetF %I t [ 1 0 0 1 126.002 290.984 ] concat %I [ (inode) (username) (groupname) ] Text End Begin %I Poly %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg none SetP %I p n %I t [ 0.242424 -0 -0 0.242424 144.091 278.97 ] concat %I 4 309 94 277 62 309 30 341 62 4 Poly End Begin %I Rect %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg none SetP %I p n %I t [ 0.987805 -0 -0 1.2093 -0.416748 -94.3671 ] concat %I 299 181 379 222 Rect End Begin %I Elli %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p 0 SetP %I t [ 1 -0 -0 1 -40.0032 -146.9 ] concat %I 415 296 3 3 Elli End Begin %I Elli %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p 0 SetP %I t [ 1 -0 -0 1 -120.019 -132.21 ] concat %I 415 296 3 3 Elli End Begin %I Poly %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg none SetP %I p n %I t [ 0.242424 -0 -0 0.242424 123.107 218.017 ] concat %I 4 309 94 277 62 309 30 341 62 4 Poly End Begin %I Text %I cfg Black 0 0 0 SetCFg %I f Helvetica-Gothic-18 Helvetica-Gothic 18 SetF %I t [ 1 0 0 1 279.012 201.1 ] concat %I [ (DeadFileCopy) ] Text End Begin %I Text %I cfg Black 0 0 0 SetCFg %I f Times-Ryumin-14 Times-Ryumin 14 SetF %I t [ 1 0 0 1 304.961 169.098 ] concat %I [ (inode) (igen) (hostname) ] Text End Begin %I MLine %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg none SetP %I p n %I t [ 0.999231 -0 -0 0.999231 -113.912 48.9623 ] concat %I 3 311 176 311 116 408 116 3 MLine %I 1 End Begin %I MLine %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg none SetP %I p n %I t [ 0.999231 -0 -0 0.999231 -113.912 48.9623 ] concat %I 4 490 100 691 100 691 373 638 373 4 MLine %I 1 End Begin %I Text %I cfg Black 0 0 0 SetCFg %I f Times-Ryumin-14 Times-Ryumin 14 SetF %I t [ 1 0 0 1 161.008 154.067 ] concat %I [ (\270\305\244\244\245\354\245\327\245\352\245\253\244\316\275\352\272\337) ] Text End Begin %I Text %I cfg Black 0 0 0 SetCFg %I f Times-Ryumin-14 Times-Ryumin 14 SetF %I t [ 1 0 0 1 405.971 169.066 ] concat %I [ (\270\305\244\244\245\354\245\327\245\352\245\253\244\362\312\335\273\375\244\271\244\353) ] Text End End %I eop showpage %%Trailer end gfarm-2.4.1/doc/internal/ja/gfmd-internal.txt0000644000000000000000000005001211507222722017551 0ustar rootroot¢£ Àß·×»Ø¿Ë ¡û giant_lock ÊÝ»ýÃæ¤ÏµÙ̲¤·¤Æ¤Ï¤¤¤±¤Ê¤¤¡£XXX ÍײòÀâ ÅöÁ³¡¢I/O ¤â¹Ô¤Ê¤Ã¤Æ¤Ï¤¤¤±¤Ê¤¤¡£ Í£°ì¤ÎÎã³°¤Ï¡¢dbq ÂÔ¤Á¤ÎµÙ̲¡£¤³¤ì¤Ï»ÅÊý¤Ê¤¤¡£ ¼êÈ´¤­¤Ç¡¢¥Í¥Ã¥È¥ï¡¼¥¯Á÷¿®¤ò¡¢giant_lock ¤òÊÝ»ý¤·¤¿¤Þ¤Þ¤ä¤Ã¤Æ¤¤¤ë ¤È¤³¤í¤¬¤¢¤ë¡£½ÐÎÏ¤Ï nonblocking ¥â¡¼¥É¤Ç¹Ô¤Ê¤Ã¤Æ¤¤¤ë(Ȧ?)¤Ê¤Î¤Ç¡¢ ½ÐÎÏÆâÍÆ¤¬¥Ð¥Ã¥Õ¥¡¤è¤ê¤â¾®¤µ¤±¤ì¤Ð¡¢µÙ̲¤·¤Ê¤¤È¦¡£ °ì±þ¡¢/* XXX FIXME too long giant lock */ ¤È¤¤¤¦¥³¥á¥ó¥È¤Ç¡¢ Á´¤Æ¤Î²Õ½ê¤ò¥Þ¡¼¥¯¤·¤Æ¤¢¤ëȦ¤À¤¬¡Ä ¡û Á´¥á¥¿¥Ç¡¼¥¿¤ò¡¢¥á¥â¥ê¤Ë¥­¥ã¥Ã¥·¥å¤¹¤ë¡£ À­Ç½Í¥Àè¡Ü¥³¡¼¥Ç¥£¥ó¥°¤ò´Êñ¤Ë¤¹¤ë¤Î¤¬ÌÜŪ¡£ ¥Ç¡¼¥¿¤Ï gfmdµ¯Æ°»þ¤ËÁ´¤Æ¥á¥â¥ê¤ËÆÉ¤ß¹þ¤ß¡¢¹¹¿·¤Î¤¿¤Ó¤Ë dbq ·Ðͳ¤Ç DB ¤Ë ½ñ¤­½Ð¤¹¡£½é´ü²½¤ò½ü¤¯¤È¡¢µ¯Æ°Ãæ¤Ë DB ¤«¤éÆÉ¤ß¹þ¤ß¤ò¹Ô¤Ê¤¦¤³¤È¤Ï¤Ê¤¤¡£ ¤¿¤À¤·¡¢xattr ¤À¤±¤ÏÎã³°¡£ Íýͳ¤Ï¡¢ ¡¦xattr ¤È¤·¤Æ¤«¤Ê¤êÂ礭¤Ê¥Ç¡¼¥¿¤òÁÛÄꤷ¤Æ¤¤¤¿ ¡¦Àß·×¼Ô¤¬Â¾¤ÎÉôʬ¤È¤ÏÊÌ ¤Ç¤¢¤ë¤¿¤á¡£ µÕ¤Ë¡¢¤¿¤È¤¨¥Ç¡¼¥¿¥µ¥¤¥º¤¬¾®¤µ¤¯¤Æ¤â¡¢xattr ¤Ø¤Î¥¢¥¯¥»¥¹¤ÏÁ´¤¯¥­¥ã¥Ã¥·¥å ¤µ¤ì¤Æ¤ª¤é¤º¡¢Èó¾ï¤ËÃÙ¤¤¤È¤¤¤¦À©¸Â»ö¹à¤¬¤¢¤Ã¤¿¡£¸½ºß¤Ï¡¢¥æ¡¼¥¶¤¬»ØÄꤷ¤¿ xattr ¤Ï¥­¥ã¥Ã¥·¥å¤Ç¤­¤ë¡£¤Þ¤¿¡¢gfarm.ncopy ¤Ï¾ï¤Ë¥­¥ã¥Ã¥·¥å¤¹¤ë¡£ ¢£ mutex °ìÍ÷ mutex ´Ö¤Î°Í¸´Ø·¸¤Ë¥ë¡¼¥×¤¬¤¢¤Ã¤Æ¤Ï¤¤¤±¤Ê¤¤¡£¥Ç¥Ã¥É¥í¥Ã¥¯¤¹¤ë¡£¡ú½ÅÍסú Ʊ»þ¤ËÊ£¿ô¤Î mutex ¤Î³ÍÆÀ¤ò¹Ô¤Ê¤¦¾ì¹ç¤Î³ÍÆÀ½ç½ø¤Ï¡¢¤¹¤Ù¤ÆÊ¸½ñ²½¤¬É¬Íס£ mutex ³ÍÆÀ½ç½ø¤Ï¡¢server/gfmd/README »²¾È XXX Êݼ餵¤ì¤Æ¤Ê¤¤¡£Í×¹¹¿· ¡¦giant_lock -> struct host::replication_mutex -> dbq.mutex cf. host_peer_set() ¡¦giant_lock -> dfc_allq.mutex ¡¦giant_lock -> busyq.mutex -> removeq.mutex -> host:back_channel_mutex °Ê²¼¤Î¾ò·ï¤ÎÊ£¹ç¤Ë¤è¤ë¡£ giant_lock -> removeq.mutex busyq.mutex -> removeq.mutex busyq.mutex -> host:back_channel_mutex (for host_is_up()) ¡û giant_lock ¤òÊÝ»ý¤·¤¿¤Þ¤Þ¡¢µÙ̲¤·¤ÆÎɤ¤¥¹¥ì¥Ã¥É °Ê²¼¤Î¥¹¥ì¥Ã¥É¤Î¤ß¡¢giant_lock ¤òÊÝ»ý¤·¤¿¤Þ¤ÞµÙ̲¤·¤Æ¤ÏÎɤ¤¡£ ¤³¤ì°Ê³°¤Î¥¹¥ì¥Ã¥É¤¬µÙ̲¤¹¤ë¤Î¤Ï¡¢°Í¸´Ø·¸¤Î¥ë¡¼¥×¤òÀ¸¤¸¤ë´í¸±¤¬¤¢¤ë¤¿¤á ¶Ø»ß¡£ ¡¦sync_protocol_thread_pool ¤Ë°¤¹¤ë¥¹¥ì¥Ã¥É ¡û leaf routine ¤Î¤ß¤Ç³ÍÆÀ¤·¤Æ¤¤¤ë mutex ¤³¤ì¤é¤Î mutex ¤òÊÝ»ý¤·¤¿¤Þ¤Þ¡¢Â¾¤Î mutex ¤ò³ÍÆÀ¤¹¤ë¤³¤È¤Ï¤Ê¤¤¤·¡¢ ¤·¤Æ¤Ï¤¤¤±¤Ê¤¤¡£ ¡¦callout_module.mutex ¢£ ¥¹¥ì¥Ã¥É°ìÍ÷ ¥¹¥ì¥Ã¥É´Ö¤Î°Í¸´Ø·¸¤Ë¥ë¡¼¥×¤¬¤¢¤Ã¤Æ¤Ï¤¤¤±¤Ê¤¤¡£¥Ç¥Ã¥É¥í¥Ã¥¯¤¹¤ë¡£¡ú½ÅÍסú thrpool_add_job() ¤¹¤ë¾ì¹ç¡¢ thrpool_add_job() ¤ò¸Æ¤Ó½Ð¤¹¥¹¥ì¥Ã¥É¤Ï¡¢ thrpool_add_job() ¤µ¤ì¤ë¥¹¥ì¥Ã¥É¥×¡¼¥ë¤Ë¡¢ °Í¸¤·¤Æ¤·¤Þ¤¦¡£ ¤¹¤Ê¤ï¤Á¡¢thrpool_add_job() ¤µ¤ì¤ë¥¹¥ì¥Ã¥É¥×¡¼¥ë¤¬ËþÇդξì¹ç¡¢ thrpool_add_job() ¤¹¤ë¥¹¥ì¥Ã¥É¤ÏµÙ̲¤¹¤ë¡£ ¥¹¥ì¥Ã¥É¥×¡¼¥ë¤Ë°¤¹¤ë¥¹¥ì¥Ã¥É¤¬¡¢ ¼«¿È¤Î¥¹¥ì¥Ã¥É¥×¡¼¥ë¤ËÂФ·¤Æ thrpool_add_job() ¤¹¤ë¤Î¤âÂÌÌÜ¡£¡ú½ÅÍסú ¤½¤Î¥¹¥ì¥Ã¥É¥×¡¼¥ë¤ÎÁ´¥¹¥ì¥Ã¥É¤¬¡¢ ¤¿¤Þ¤¿¤ÞÁ´¤ÆÆ±»þ¤Ë¼«¥¹¥ì¥Ã¥É¥×¡¼¥ë¤ËÂФ·¤Æ thrpool_add_job() ¤¹¤ë¤È¡¢ ¥×¡¼¥ë¤Ë¶õ¤­¤¬¤Ê¤¤¤Î¤Ç¡¢Á´¤ÆµÙ̲¤·¡¢¤½¤Î¤Þ¤Þ¿²¤¿¤­¤ê¤Ë¤Ê¤ë¡£ ¤â¤Ã¤È¤âÄ̾ï¤ÎÉé²Ù¤Ç¤¢¤ì¤Ð¡¢gfarm_metadb_job_queue_length ¤ÎŤµ¤¬¤¢¤ë ¥­¥å¡¼¤Ë¤è¤Ã¤Æ´Ë¾×¤µ¤ì¤ë¤¿¤á¡¢¤³¤Î¥Ç¥Ã¥É¥í¥Ã¥¯¤ÏȯÀ¸¤·¤Ê¤¤¡£¹âÉé²Ù¤Ç ¥­¥å¡¼¤¬°ìÇդλþ¤Ë¾åµ­¤Î¾õ¶·¤¬È¯À¸¤¹¤ë¤È¤Þ¤º¤¤¡£ ¥¹¥ì¥Ã¥É¥×¡¼¥ë´Ö¤Î°Í¸´Ø·¸¤Ë¥ë¡¼¥×¤¬¤¢¤ë¤Î¤âÂÌÌÜ¡£¡ú½ÅÍסú back_channel_send_thread_pool ¤Ï¡¢ÄÌ¿®¤ò²ò¤·¤Æ°Å¤Ë, back_channel_recv_thread_pool ¤Ë°Í¸¤·¤Æ¤¤¤ë¤Î¤ÇÍ×Ãí°Õ¡£¡ú½ÅÍסú °Í¸´Ø·¸¤Î¿Þ¤Ï doc/internal/png/gfmd-thread-dependency.png ¤Ë¤¢¤ë¤¬¡¢¤³¤Î¿Þ¤Ç¡¢ ¡¦Ìð°õ¤ò´Ý(¥¹¥ì¥Ã¥É)¤òé¤Ã¤¿»þ¡¢¥¹¥ì¥Ã¥É´Ö¤¬¥ë¡¼¥×¤Ë¤Ê¤Ã¤Æ¤¤¤Æ¤Ï¤¤¤±¤Ê¤¤¡£ ¡¦Ìð°õ¤ÇÈ¢(¥¹¥ì¥Ã¥É¥×¡¼¥ë)¤òé¤Ã¤¿»þ¡¢¥×¡¼¥ë´Ö¤¬¥ë¡¼¥×¤Ë¤Ê¤Ã¤Æ¤¤¤Æ¤Ï¤¤¤±¤Ê¤¤¡£ ¡¦Æ±°ì¤ÎÈ¢(Ʊ°ì¤Î¥¹¥ì¥Ã¥É¥×¡¼¥ë)¤ÎÃæ¤Ë¤¢¤ë¥¹¥ì¥Ã¥É´Ö¤Ë¡¢ thrpool_add_job()¤ÎÌð°õ´Ø·¸¤¬¤¢¤Ã¤Æ¤Ï¤¤¤±¤Ê¤¤¡£ ¡û main ¥¹¥ì¥Ã¥É: accepting_loop() TCP ÀܳÂÔ¤Á¤ò¹Ô¤Ê¤¦¤Î¤¬Ìò³ä¡£ ¡û create_detached_thread() ¤ÇºîÀ®¤µ¤ì¤ë¡¢ÆÈΩ¤·¤¿¥¹¥ì¥Ã¥É¡£ ¡¡¡¦¥·¥°¥Ê¥ë´Æ»ëÍÑ sigs_handler() ¡¡¡¦callout »þ¹ï´Æ»ëÍÑ callout_main() ¡ß CALLOUT_NTHREADS callout_main() ¤¬ thrpool_add_job() ¤¹¤ë¥¹¥ì¥Ã¥É¥×¡¼¥ë¤Î¿ô¤À¤± callout_main() ¥¹¥ì¥Ã¥É¤òÍѰդ·¤¿Êý¤¬Îɤ¤¡£¤µ¤â¤Ê¤¤¤È¡¢¤¢¤ë¥¹¥ì¥Ã¥É ¥×¡¼¥ë¤¬ËþÇդȤʤ俤Ȥ­¡¢´Ø·¸¤Ê¤¤¥¹¥ì¥Ã¥É¤Î½èÍý¤Þ¤ÇÃٱ䤷¤Æ¤·¤Þ¤¦¡£ ¸½ºß¤Ï¡¢back_channel_send_thread_pool ¤Î¤ß¤Ç¤¢¤ë¤¿¤á¡¢CALLOUT_NTHREADS == 1 callout_reset() ¤·¤Æ¤¤¤ë¤Î¤Ï¡¢back_channel_recv_thread_pool ¤Ë°¤¹¤ë gfs_async_client_status_result() ¤À¤¬¡¢callout_reset() ¤Ï cond_signal() ¤·¤Æ¤¤¤ë¤À¤±¤Ê¤Î¤Ç¡¢callout_reset() ¤Ç¤Ï°Í¸¤Ïµ¯¤­¤Ê¤¤¡£ ¡¦db_thread() ¡¡¡¦¥Í¥Ã¥È¥ï¡¼¥¯¼õ¿®´Æ»ëÍÑ peer_watcher() ¡ß 1 peer_watcher() ¤¬ thrpool_add_job() ¤¹¤ë¥¹¥ì¥Ã¥É¥×¡¼¥ë¤Î¿ô¤À¤±¡¢ peer_watcher() ¥¹¥ì¥Ã¥É¤òÍѰդ·¤¿Êý¤¬Îɤ¤¡£¤µ¤â¤Ê¤¤¤È¡¢¤¢¤ë¥¹¥ì¥Ã¥É ¥×¡¼¥ë¤¬ËþÇդȤʤ俤Ȥ­¡¢´Ø·¸¤Ê¤¤¥¹¥ì¥Ã¥É¤Î½èÍý¤Þ¤ÇÃٱ䤷¤Æ¤·¤Þ¤¦¡£ ¸½ºß¡¢sync_protocol_thread_pool ¤È back_channel_recv_thread_pool ¤Î 2¤Ä ¤¢¤ë¤¿¤á peer_watcher() ¥¹¥ì¥Ã¥É¤â 2¤Ä¤Ë¤·¤¿¤¤¤¬¡¢¸½¹Ô¤Î peer_watcher() ¤Î ¼ÂÁõ¤¬¤½¤ì¤òµö¤·¤Æ¤Ê¤µ¤½¤¦¤Ê¤¿¤á¡¢1¤Ä¤Î¤Þ¤Þ¡£ ¢ª peer_watcher() ¤ò 2¥¹¥ì¥Ã¥É¤Çư¤«¤»¤ë¤è¤¦¤ËÊѹ¹¤¹¤ëͽÄê¡£XXX XXX DEADLOCK ¸½¾õ¡¢°Ê²¼¤ÎÍýͳ¤Ç¡¢deadlock ¤Î´í¸±¤¬¤¢¤ë¡£ peer_watcher() ¤¬¸Æ¤Ó½Ð¤¹ 2¤Ä¤Î¥¹¥ì¥Ã¥É¥×¡¼¥ë¡¢sync_protocol_thread_pool ¤ª¤è¤Ó back_channel_recv_thread_pool ¤Ï¡¢back_channel_send_thread_pool ¤Î ¤è¤¦¤Ë¡¢È󯱴ü¤ËÂçÎ̤ÎÁ÷¿®¤ò°ìÅ٤˹ԤʤäƵͤޤ뿴ÇۤϤʤ¤¡£¤·¤«¤·¡¢ sync_protocol_thread_pool ¤Ï back_channel_send_thread_pool ¤Ë°Í¸¤· ¤Æ¤¤¤ë¤¿¤á¡¢back_channel_send_thread_pool ¤Î¦¤ÎÌäÂê¤Ç¡¢peer_watcher() ¤Ë ¤è¤ë sync_protocol_thread_pool ¤ËÂФ¹¤ë thrpool_add_job() ¤¬µÍ¤Þ¤ë ²ÄǽÀ­¤Ï»Ä¤ë¡£ peer_watcher() ¤¬ 1¥¹¥ì¥Ã¥É¤Î¤ß¤À¤È¡¢peer_watcher() ¼«ÂΤ¬»ß¤Þ¤Ã¤Æ ¤·¤Þ¤¦¤¿¤á¡¢back_channel_recv_thread_pool ¤â´¬¤­Åº¤¨¤ò¤¯¤Ã¤Æ¡¢»ß¤Þ¤ë¡£ ¤½¤Î·ë²Ì¡¢back_channel_recv_thread_pool ¤Ë°Í¸¤·¤Æ¤¤¤ë back_channel_send_thread_pool ¤âư¤«¤Ê¤¯¤Ê¤ê¡¢°Í¸´Ø·¸¤Î¥ë¡¼¥×¤È¤Ê¤Ã¤Æ¡¢ deadlock ¤¹¤ë¡£ ¡¦peer_closer() ¡¦µìbackend_protocol¤Î¾ì¹ç¡¢³Æfilesystem node¤ËÂФ· remover() ¡ß ÂçÎÌ Çѻߤ·¤Æ¡¢back_channel_recv_thread_pool ¤ò»È¤¦¤è¤¦¤Ë¤¹¤ëͽÄê¡£ ¡û ¥¹¥ì¥Ã¥É¥×¡¼¥ë ¥×¡¼¥ëÃæ¤Î³Æ¥¹¥ì¥Ã¥É¤Î¼ÂÂΤϡ¢thrpool_worker()¡£ ¡¡¡Ý authentication_thread_pool ¤³¤Î¥×¡¼¥ë¤òÍѤ¤¤Æµ¯Æ°¤µ¤ì¤ë¤Î¤Ï¡¢°Ê²¼¤Î¥¹¥ì¥Ã¥É¡£ ¡¦try_auth() accepting_loop() ¤¬ thrpool_add_job() ¤¹¤ë¡£ ¡¡¡Ý sync_protocol_thread_pool ¤³¤Î¥×¡¼¥ë¤òÍѤ¤¤Æµ¯Æ°¤µ¤ì¤ë¤Î¤Ï¡¢°Ê²¼¤Î¥¹¥ì¥Ã¥É¡£ ¡¦protocol_main() - try_auth() ¤¬¡¢peer_authorized() ·Ðͳ¤Ç¡¢thrpool_add_job() ¤¹¤ë¡£ - peer_watcher() ¤¬¡¢thrpool_add_job() ¤¹¤ë¡£ ¡¡¡Ý back_channel_send_thread_pool ¤³¤Î¥×¡¼¥ë¤òÍѤ¤¤Æµ¯Æ°¤µ¤ì¤ë¤Î¤Ï¡¢°Ê²¼¤Î¥¹¥ì¥Ã¥É¡£ ¡¦gfs_async_client_status_request() - protocol_main() ¤¬¡¢gfm_server_switch_async_back_channel() ·Ðͳ¤Ç¡¢ thrpool_add_job() ¤¹¤ë¡£ - callout_main() ¤¬¡¢thrpool_add_job() ¤¹¤ë¡£ callout ¤Ëµ¯¾²¤ò°ÍÍꤷ¤Æ¤¤¤ë¤Î¤Ï¡¢back_channel_recv_thread_pool ¤Ë°¤¹¤ë gfs_async_client_status_result() ¤À¤¬¡¢callout_reset() ¤ò»È¤Ã¤Æ¤¤¤ë¤Î¤Ç °Í¸¤Ïµ¯¤­¤Ê¤¤¡£ ¡¦gfs_async_client_replication_request_request() - protocol_main() ¤¬¡¢async_back_channel_replication_request() ·Ðͳ¤Ç¡¢ thrpool_add_job() ¤¹¤ë¡£ ¡¡¡Ý back_channel_recv_thread_pool ¤³¤Î¥×¡¼¥ë¤òÍѤ¤¤Æµ¯Æ°¤µ¤ì¤ë¤Î¤Ï¡¢°Ê²¼¤Î¥¹¥ì¥Ã¥É¡£ ¡¦async_back_channel_main() - protocol_main() ¤¬¡¢gfm_server_switch_async_back_channel() ·Ðͳ¤Ç¡¢ thrpool_add_job() ¤¹¤ë¡£ - peer_watcher() ¤¬¡¢thrpool_add_job() ¤¹¤ë¡£ ¤³¤ì¤¬È¯À¸¤¹¤ë¤Î¤Ï¡¢gfsd ¤«¤é¤Î async RPC request ¤«¡¢¤¢¤ë¤¤¤Ï¡¢ gfmd ¤«¤é¤Î async RPC request ¤ËÂФ·¤Æ gfsd ¤¬ reply ¤·¤¿¾ì¹ç¡£ ¸å¼Ô¤Î gfmd¢ªgfsd ¤Î async RPC request ¤Ï¡¢back_channel_send_thread_pool ¤òÍѤ¤¤Æ¹Ô¤Ê¤ï¤ì¤ë¡£¤³¤Î¤¿¤á¡¢async_back_channel_main() ¤Î½èÍý¤¬ µÍ¤Þ¤ë¤È¡¢·ë²Ì¤È¤·¤Æ¡¢back_channel_send_thread_pool ¤Þ¤Ç¤âµÍ¤Þ¤ë ²ÄǽÀ­¤¬¤¢¤ë¡£ ¤³¤Î¤¿¤á¡¢back_channel_recv_thread_pool ¤Ë°¤¹¤ë¥¹¥ì¥Ã¥É¤Ï¡¢ °Ê²¼¤Î¥×¡¼¥ë¤Ë°¤¹¤ë»ñ¸»¤òÂԤäƤϤ¤¤±¤Ê¤¤¡£¡ú½ÅÍסú * authentication_thread_pool * sync_protocol_thread_pool * back_channel_send_thread_pool ¤â¤·¹Ô¤Ê¤¦¤È¡¢°Í¸´Ø·¸¤¬¥ë¡¼¥×¤ò¹½À®¤·¡¢deadlock ¤Î´í¸±¤¬À¸¤¸¤ë¡£ ÅöÁ³¡¢¾åµ­¤Î¥×¡¼¥ë¤Ë thrpool_add_job() ¤·¤Æ¤â¤¤¤±¤Ê¤¤¡£ ¤Þ¤¿¡¢¾åµ­¤Î¥×¡¼¥ë¤Ë°¤¹¤ë»ñ¸»ÂÔ¤Á¤Î mutex ¤òÂԤäƤ⤤¤±¤Ê¤¤¡£ ¤·¤¿¤¬¤Ã¤Æ¡¢giant_lock() ¤ò¹Ô¤Ê¤Ã¤Æ¤âÂÌÌÜ¡£ ¤¿¤À¤·¡¢¾åµ­¤Î¥×¡¼¥ë¤È¶¥¹ç¤¹¤ë¤¬¡¢¤½¤ì¼«¿È¤Ç¤Ï cond_wait() Åù¤ò ¹Ô¤Ê¤ï¤Ê¤¤¡¢¥ê¡¼¥Õ¤Î mutex ¤òÂԤĤÀ¤±¤Ê¤éÌäÂê¤Ê¤¤¡£ ¤Þ¤¿¡¢gfm_async_server_replication_result() ¤Ï¡¢Ä¾ÀÜ¡¢°Ê²¼¤ò ¹Ô¤Ê¤Ã¤Æ¤Ï¤¤¤±¤Ê¤¤¡£ ¡¦·ë²Ì¤Î½èÍý¤Î¤¿¤á¤Î host_replicated() ¡¦·ë²Ì¤ÎÁ÷¿® peer_sender_lock() ¤òÂԤĤ³¤È¤¬¤¢¤ë¡£ ¢ª Á÷¿®Â¦¤òÂԤĤ³¤È¤¬¤¢¤ë¡£XXX DEADLOCK ¢£ ¥Õ¥¡¥¤¥ë¤Îºï½ü¤Ë¤Ä¤¤¤Æ ¼ÂºÝ¤Ë¥á¥â¥ê¾å¤«¤éºï½ü¤¹¤ë¡Ýinode_remove()¤ò¸Æ¤Ö¡Ý¤Î¤Ï¡¢ °Ê²¼¤Î¾ò·ï¤¬¤¹¤Ù¤ÆÀ®¤êΩ¤Ã¤¿»þ¡£ (1) nlink ¤¬ 0 (2) ¥Õ¥¡¥¤¥ë¤¬¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤Ê¤¤ (3) gfmd ¼çƳ¤Î replication ¤¬¼Â¹ÔÃæ¤Ç¤Ê¤¤ ¤¹¤Ê¤ï¤Á if (inode->i_nlink == 0 && inode->u.c.state == NULL && (!inode_is_file(inode) || inode->u.c.s.f.rstate == NULL)) inode_remove(inode); ¢£ back_channel ¤Ë´Ø¤¹¤ëÀß·× ¡û back_channel ¤ËɬÍפʻñ¸» (callout ¤Ê¤É) ¤ò¡¢ (1) peer ¤Ëµ¢Â°¤µ¤»¤ë¤« (2) host ¤Ëµ¢Â°¤µ¤»¤ë¤« (3) back_channel ÄÌ¿®¤Î¤¿¤á¤Î¹½Â¤ÂΤòºîÀ®¤·¡¢¤½¤³¤Ëµ¢Â°¤µ¤»¤ë¤« ¤È¤¤¤¦ÁªÂò»è¤¬¤¢¤ë¡£ back_channel ÄÌ¿®½ªÎ»»þ¤ÎƱ´ü½èÍý¤ò¹Í¤¨¤ë¤È¡¢¤½¤ÎÀ¸Â¸¶è´Ö¤¬ gfmd µ¯Æ°Ãæ ¤Ç¤¢¤ë (1) ¤« (2) ¤ÎÊý¤¬¡¢¥Ç¡¼¥¿¹½Â¤¼«ÂΤ¬¾Ã¤¨¤Æ¤·¤Þ¤¦¤¿¤áƱ´üÍѤËÊÌÎÎ°è ¤Î³ÎÊݤ¬É¬ÍפȤʤë (3) ¤è¤ê¤â¥×¥í¥°¥é¥à¤Îºî¤ê¤¬´Êñ¤Ë¤Ê¤ë¡£ ¤Þ¤¿°Ê²¼¤Î¤è¤¦¤Ë peer ¤ÎÊý¤¬¡¢host ¤è¤ê¤â¿ô¤¬Â¿¤¯ (peer ¤Î¿ô == ¥¯¥é¥¤¥¢¥ó¥È¤Î¿ô¡ß 2 ¡Ü host ¤Î¿ô) ¥á¥â¥ê¾ÃÈñŪ¤Ë¤Ï (2) ¤ÎÊý¤¬Í­Íø¤Ê¤Î¤Ç¡¢host ¤Ëµ¢Â°¤µ¤»¤ë¤³¤È¤Ë¤·¤¿¡£ ¤¿¤À¤· async ¤Ë¤Ä¤¤¤Æ¤Ï¡¢conn ¤ÈƱÍͤÊÄÌ¿®½èÍý»þ¤ËɬÍפʥǡ¼¥¿¤Ç¤¢¤ê¡¢ back_channel ¤¬¿·¤·¤¤¥³¥Í¥¯¥·¥ç¥ó¤ËÀÚ¤êÂØ¤ï¤Ã¤Æ¤¤¤ë¤¬¡¢ ¸Å¤¤¥³¥Í¥¯¥·¥ç¥ó¤â¤Þ¤À»Ä¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ë»È¤ï¤ì¤ë²ÄǽÀ­¤ò¹Íθ¤·¤Æ (1) ¤È¤¹¤ë¡£ ¡¦host_receiver_lock() ¤¬É¬ÍפÊÍýͳ ¼õ¿®¤Ï peer_watch() ¤«¤é¸Æ¤Ó½Ð¤µ¤ì¡¢Æ±°ì peer ¤Ê¤éƱ°ì¥¹¥ì¥Ã¥É¤Çưºî ¤¹¤ë¤¿¤á¡¢peer ´Ö¤Î¼õ¿®¶¥¹ç¤ÏȯÀ¸¤·¤Ê¤¤¡£ host_receiver_lock() ¤·¤Æ¤¤¤ëÍýͳ¤Ï¡¢peer_free_request() ¤È¤Î¶¥¹ç²óÈò ¤Î¤¿¤á¡£ ¡¦host_sender_lock()/_trylock() ¤¬É¬ÍפÊÍýͳ - host_receiver_lock() ¤ÈƱÍÍ peer_free_request() ¤È¤Î¶¥¹ç²óÈò - Á÷¿®¤Î¾ì¹ç¤ÏƱ°ì peer ¤Ç¤âÊ£¿ô¥¹¥ì¥Ã¥É¤Ç¶¥¹ç¤¹¤ë¤Î¤Ç¤½¤Î²óÈò - Á÷¿®Â¦¤¬µÍ¤Þ¤Ã¤¿¾ì¹ç¤Ë¡¢Æ±°ì peer °¸¤Î¥¹¥ì¥Ã¥É¤Ç¡¢¥¹¥ì¥Ã¥É¥×¡¼¥ë¤¬ Ëä¤á¿Ô¤¯¤µ¤ì¤ë¤Î¤òËɤ°¤¿¤á¤Ë host_sender_trylock() ¤Ç»öÁ°¸¡ºº¤¹¤ë¡£ gfm_async_server_replication_result() ¤Î¤ß¤Ï _trylock() ¤Ç¤Ï¤Ê¤¯ _lock() ¤ò»È¤Ã¤Æ¤¤¤ë¤Î¤Ç¡¢Ê£¿ô¤Î¥¹¥ì¥Ã¥É¥×¡¼¥ë¤òÀêÍ­¤·¤Æ¤·¤Þ¤¦ ²ÄǽÀ­¤¬¤¢¤ë¤¬¡¢¤³¤ì¤ÏÊÖÅú¤Ç¤¢¤ë¤¿¤á¡¢¼Â¼ÁŪ¤Ê´í¸±À­¤Ï¤«¤Ê¤êÄ㤤¡£ ¡¦host_disconnect_request() ¤Î¸Æ¤Ó½Ð¤·¤Ë¤Ä¤¤¤Æ Ê£¿ô¤Î back_channel ¥¹¥ì¥Ã¥É¤«¤é¤ä¡¢¥Õ¥©¥¢¥°¥é¥¦¥ó¥É¤Î gfm_server_switch_back_channel_common() ¤«¤éƱ»þ¤Ë¸Æ¤Ó½Ð¤µ¤ì¤ë ²ÄǽÀ­¤¬¤¢¤ë¡£ ÆÃ¤Ë¡¢¥Õ¥©¥¢¥°¥é¥¦¥ó¥É¤ÇÀÚÃÇ¢ª¥Õ¥©¥¢¥°¥é¥¦¥ó¥É¤ÇºÆÀܳ¢ª¸Å¤¤ back_channel ¤¬¡¢¿·¤·¤¤Àܳ¤òÀÚÃÇ ¤È¤Ê¤ë¤È¤Þ¤º¤¤¡£ ¤³¤ÎÂкö¤È¤·¤Æ¡¢°Ê²¼¤Î¤è¤¦¤Ë¤¹¤ë¡£ - °ú¿ô¤Ç peer ¤òÅϤ·¡¢¤³¤ì¤¬°Û¤Ê¤Ã¤Æ¤¤¤¿¤é¡¢¤Ê¤Ë¤â¤·¤Ê¤¤¡£ ¥Õ¥©¥¢¥°¥é¥ó¥É¤«¤é¸Æ¤Ó½Ð¤¹»þ¤Ï peer ¤È¤·¤Æ NULL ¤òÅϤ¹¡£ ¤³¤Î¾ì¹ç¤Ë¤Ï¡¢Í­Ìµ¤ò¤¤¤ï¤µ¤ºÀÚÃǤ¹¤ë¡£ - ´û¤Ë host->peer == NULL ¤Ê¤é¡¢¤Ê¤Ë¤â¤·¤Ê¤¤ ¤Þ¤¿¡¢host_sender_unlock() ¤ä host_receiver_unlock() »þ¤Ë¤Ï¡¢´û¤Ë ÀÚÃǤµ¤ì¤Æ¤¤¤ë²ÄǽÀ­¤¬¤¢¤ë¤¿¤á¡¢°ú¿ô¤Ç peer ¤òÅϤ·¡¢¤³¤ì¤¬°Û¤Ê¤Ã¤Æ¤¤ ¤¿¤é¡¢¤Ê¤Ë¤â¤·¤Ê¤¤¡£ back_channel.c ¤Ç¤Ï¡¢¥í¥Ã¥¯¤ò¤«¤±¤º¤Ë host_get_peer() ¤·¤Æ¤ª¤­¡¢¤¢¤È¤Ç if (peer != NULL) /* to make the race condition harmless */ host_disconnect_request(host, peer); ¤È¤·¤Æ¤¤¤ëÉôʬ¤¬¤¢¤ë¤¬¡¢¤³¤ì¤Ï host_get_peer() °Ê¹ß¡¢¥Õ¥©¥¢¥°¥é¥ó¥É¤Ç host_peer_set() ¤¬¹Ô¤Ê¤ï¤ì¤¿¾ì¹ç¤ÎÂкö¡£¤³¤Î¾ì¹ç¡¢GFS_PROTO_STATUS ¤Ø ¤ÎÊÖ»ö¤¬¤Ê¤¤¤Ë¤â´Ø¤ï¤é¤º¡¢host_disconnect_request() ¤¬¤³¤Î if ¾ò·ï¤Î ¤¿¤á¤Ë¸Æ¤Ð¤ì¤Ê¤¤²ÄǽÀ­¤â¤ï¤º¤«¤Ë¤¢¤ë¤¬¡¢¤½¤ì¤Ï¼¡²ó¤Î GFS_PROTO_STATUS ¤Ç µßºÑ¤Ç¤­¤ë¡£ ¡¦¥Û¥¹¥È down Âкö - ¡¦gfs_client_status_request() ¤Ç¡¢Á°²ó¤«¤é¤Þ¤ÀÅú¤¬¤Ê¤«¤Ã¤¿ ¾ì¹ç¡¢¤¹¤Ê¤ï¤Á host_status_reply_is_waiting() ¤¬À®¤êΩ¤Ã¤Æ¤¤¤¿ »þ¤Ë¤Ï¡¢¥³¥Í¥¯¥·¥ç¥ó¤òÀÚÃǤ¹¤ë¡£(down ¾õÂ֤Ȥʤë) - Á÷¿®½èÍý¤Î»þ¤Ë host_sender_try_lock() ¤ÇÁ÷¿®²Äǽ¤«¤É¤¦¤«¤ò ³Îǧ¤·¡¢Á÷¿®¤¬ÂÚα¤·¤Æ¤¤¤¿¾ì¹ç¤Ë¤Ï¡¢host_peer_busy() ¤Ç ¥³¥Í¥¯¥·¥ç¥ó¤òÀÚÃǤ¹¤ë ¢£ ¥Õ¥¡¥¤¥ëÊ£À½´ÉÍý ¡û ´ðËÜŪ¤Ë¤Ï¡¢Æ±°ì¤ÎÀ¤ÂåÈÖ¹æ¤ò»ý¤Ä¥ì¥×¥ê¥«¤ÏÁ´¤ÆÆ±°ì¤ÎÆâÍÆ¤ò»ý¤Ä¡£ Îã³°¤Ï°Ê²¼¤Î2¼ïÎà¡£ - ¹¹¿·ÂоݤȤ·¤Æ¡¢½ñ¤­¹þ¤ßÍѤ˥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¥ì¥×¥ê¥« ¤³¤ì¤Ï¡¢Á´¥ì¥×¥ê¥«Ãæ¡¢°ì¤Ä¤À¤±Â¸ºß¤·¤¦¤ë¡£ gfmd Ū¤Ë¤Ï¡¢ (accmode_to_op(struct file_opening::flag) & GFS_W_OK) != 0 ¤È¤¤¤¦¾ò·ï¤¬À®¤êΩ¤Ã¤Æ¤¤¤ë¾ì¹ç¤Î struct file_opening::u.f.spool_host ¤¬¡¢¤½¤Î¥Û¥¹¥È¡£ ¥¯¥í¡¼¥º»þ¤Ë¡¢¤³¤Î¥ì¥×¥ê¥«¤ÎÀ¤ÂåÈÖ¹æ¤ò¾å¤²¤Æ²ò·è¤¹¤ë¡£ - ¥ì¥×¥ê¥±¡¼¥·¥ç¥óÅÓÃæ¤Î¥Õ¥¡¥¤¥ë ¥ì¥×¥ê¥±¡¼¥·¥ç¥óÀè¤Ï¡¢Å¾Á÷ÅÓÃæ¤ÎÉÔ´°Á´¤ÊÆâÍÆ¤ò»ý¤Ä¡£ ¤³¤Î¾ì¹ç¡¢FILE_COPY_IS_VALID(struct file_copy *) ¤¬µ¶¤È¤Ê¤ë¡£ FILE_COPY_IS_VALID(struct file_copy *) ¤¬µ¶¤È¤Ê¤ë¤Î¤Ï¡¢¤³¤ì°Ê³°¤Ë¡¢ ÆâÍÆ¤Ï´°Á´¤À¤¬¡¢ºï½üÅÓÃæ¤Î¥ì¥×¥ê¥«¤¹¤Ê¤ï¤Á FILE_COPY_IS_BEING_REMOVED(struct file_copy *) ¤¬¿¿¤È¤Ê¤ë¥ì¥×¥ê¥« ¤¬¤¢¤ë¡£ ¡û ´ðËÜŪ¤Ë¤Ï¡¢ºï½üÍ׵᤬½Ð¤ë (dead_file_copy ¤¬¤Ç¤­¤ë) ¤Î¤Ï¡¢µìÀ¤Âå¤Î¤ß Îã³°¤Ï°Ê²¼¤Î2¼ïÎà - ¤Ê¤ó¤é¤«¤ÎÍýͳ¤Ç¥ì¥×¥ê¥±¡¼¥·¥ç¥ó¤¬¼ºÇÔ¤·¤Æ¡¢¤½¤Îºï½ü¤òÍ׵᤹¤ë¾ì¹ç - ¡Ögfrm -h ¥Î¡¼¥É¡×¤¹¤Ê¤ï¤Á gfs_replica_remove_by_file() ¤ÇÍ׵ᤵ¤ì¤¿¾ì¹ç ¤³¤Î2¼ïÎà¤ÎÎã³°¤Ë¤Ä¤¤¤Æ¤Ï¡¢dead_file_copy ¤Ë²Ã¤¨¤Æ¡¢ FILE_COPY_IS_BEING_REMOVED(struct file_copy *) ¤ò¿¿¤È¤·¤Æ¡¢´ÉÍý/´Æ»ë¤¹¤ë¡£ dead_file_copy ¤Î load »þ¤Ë¤Ï¡¢¤³¤Î¤¿¤á¤Î struct file_copy ÀßÄê¤âɬÍפȤʤ롣 ¢£ ¥Õ¥¡¥¤¥ëÊ£À½½èÍý¤Î¾õÂÖ ¡û ¸½¹Ô¤Î gfmd ¼çƳ¥ê¥×¥ê¥±¡¼¥·¥ç¥ó¤Î³µÍ× ¡Ý ·Àµ¡ ¡¦¥æ¡¼¥¶¤«¤é¤ÎÊ£À½Í×µá ¡¦¥Õ¥¡¥¤¥ë¤Î¹¹¿· ¥Õ¥¡¥¤¥ë¤¬¹¹¿·¤µ¤ì¤¿¾ì¹ç¡¢¤½¤ì¤Þ¤ÇÊ£À½¤¬¤¢¤Ã¤¿¥Î¡¼¥É¤Ë¡¢¹¹¿·¸å¤ÎÊ£À½¤òÇۤ롣 ¶ñÂÎŪ¤Ë¤Ï¡¢inode_remove_every_other_replicas() ¤Ç¡¢to_be_replicated ¤Ë ÇÛÉÛÀè¤ò½¸¤á¡¢ remove_replica_entity(¡Á, &deferred_cleanup) file_replicating_new() async_back_channel_replication_request() ¤È¤·¤Æ¤¤¤ë¤È¤³¤í¤¬¡¢¤½¤ì¡£ ¤³¤³¤Ç¡¢dead_file_copy ¤ÏºîÀ®¤·¤Æ¤¤¤ë¤¬¡¢¼ÂºÝ¤Ëºï½üÍ×µáRPC¤Ï¹Ô¤Ê¤Ã¤Æ¤¤¤Ê¤¤¡£ ºîÀ®¤·¤¿ dead_file_copy ¤Ï deferred_cleanup ¤È¤·¤Æ¼õ¤±¼è¤ê¡¢ struct file_replicating ¤ËÊݸ¤·¡¢Ê£À½½èÍý´°Î»¸å¤Ë¡¢ºï½üÍ×µá¤ò¹Ô¤Ê¤¦¡£ ¤³¤Î´Ö¡¢¤³¤Î dead_file_copy ¤Ï dead_file_copy_mark_kept() ¤Ë¤è¤ê Êݸ¤ì¤Æ¤¤¤ë¡£ ¤Ê¤ª¡¢¤³¤³¤Ç (¤¹¤Ê¤ï¤Á schedule_replication() ¤Ç) FILE_COPY_IS_BEING_REMOVED(copy) ¤Ê¥Î¡¼¥É¤â¹¹¿··ë²Ì¤ÎÇÛÉÛÀ褫¤é½ü³°¤·¤Æ ¤¤¤ë¤¬¡¢¤³¤Î¸¡ºº¤Ï¤Ê¤¯¤Æ¤âÎɤ¤¡£ ¤Ê¤¼¤Ê¤é¡¢ÇÛ¤í¤¦¤È¤·¤Æ¤¤¤ë¤Î¤Ï¿·¤·¤¤À¤Âå¤Î¥ì¥×¥ê¥«¤Ç¤¢¤ë¤¿¤á¡¢µìÀ¤Âå¤Î ¥ì¥×¥ê¥«¤ÎÇÛÁ÷¤¬ÅÓÃæ¤Ç¤â¡¢Ê¹Ԥ·¤ÆÇÛÁ÷¤Ç¤­¤ë¤¿¤á¡£ ¤¿¤À¤·¡¢°Ê²¼¤Î¤è¤¦¤ÊÍýͳ¤«¤é¡¢¤³¤Î¸¡ºº¤ò¹Ô¤Ê¤Ã¤Æ¤¤¤ë¡£ - ľÁ°¤ËÊ£À½¤Ë¼ºÇÔ¤·¤Æ¤¤¤ì¤Ð¡¢º£²ó¤â¼ºÇÔ¤¹¤ë²ÄǽÀ­¤¬¹â¤¤¤À¤í¤¦¤È»×¤ï¤ì¤ë - ¡Ögfrm -h ¥Î¡¼¥É¡×¤ÇÌÀ¼¨Åª¤Ëºï½ü¤µ¤ì¤¿¤Ê¤é¡¢ÇÛ¤ë¤Ù¤­¤Ç¤Ï¤Ê¤¤¡£ ¡Ý ¥Ç¡¼¥¿¹½Â¤ Ê£À½½èÍý¼Â¹ÔÃæ¤Ï¡¢!FILE_COPY_IS_VALID() ¤È¤Ê¤Ã¤Æ¤¤¤ë¡£ Ê£À½½èÍý´°Î»»þ¤Ë inode_replicated() ¤«¤é¡¢inode_add_replica(inode, fr->dst, 1) ¤ò¸Æ¤Ó½Ð¤·¡¢valid = 1 ¤ËÊѹ¹¤·¤Æ¤¤¤ë¡£ Ê£À½½èÍý¤¬¼ºÇԤ˽ª¤Ã¤¿»þ¤Ë¤Ï¡¢inode_replicated() ¤«¤é¡¢ inode_remove_replica_gen_deferred(¡Á, &dfc) ¤ò¸Æ¤Ó½Ð¤·¡¢ Ê֤äƤ­¤¿ dfc ¤ò removal_pendingq_enqueue() ¤ËÅϤ·¤Æºï½üÍ×µá¤ò½Ð¤¹¡£ removal_pendingq_enqueue() ¦¤Ç¤Ï¡¢°Ê²¼¤Î½èÍý¤ò¹Ô¤Ê¤Ã¤Æ¤¤¤ë¡£ ¼ºÇÔ¤·¤¿Ê£À½½èÍý¤¬ºÇ¿·À¤Âå¤ËÂФ¹¤ë¤â¤Î¤Ç¤¢¤ì¤Ð¡¢ remove_replica_entity() ¤Ç dead_file_copy ¤òºîÀ®¤¹¤ë¡£(DB¤Ë¤â½ñ¤¯) valid == 0 ¤Ç¤¢¤ê¡¢¤Þ¤À file_copy ¤Ï DB ¤Ë½ñ¤«¤ì¤Æ¤Ê¤¤¤Î¤Ç¡¢ DB ¤ËÂФ¹¤ë file_copy ¤Îºï½ü¤Ï¹Ô¤Ê¤ï¤Ê¤¤¡£ file_copy ¤Ï free() ¤¹¤ë¡£ XXX FIXME ºï½ü¤¬´°Î»¤¹¤ë¤Þ¤Ç¤Ï¡¢file_copy ¤Î free() ¤ò¹Ô¤Ê¤Ã¤Æ¤Ï ¤¤¤±¤Ê¤¤¡£¤Ç¤Ê¤¤¤È¡¢ºï½ü¤¬´°Î»¤¹¤ëÁ°¤Ë¡¢Æ±°ìÀ¤ÂåÈÖ¹æ¤Ç¿·¤·¤¤Ê£À½¤¬ ºîÀ®¤µ¤ì¤¿¤ê¡¢¤¢¤ë¤¤¤Ï truncate ¤Î¾ì¹ç¤Ë¤Ï¡¢½ñ¤­¹þ¤ßÍÑ¥ì¥×¥ê¥«¤È ¤·¤ÆÁªÂò¤µ¤ì¤Æ¤·¤Þ¤¦´í¸±¤Þ¤Ç¤¢¤ë¡£¤½¤Î¾ì¹ç¡¢¸å¤«¤éÆÏ¤¤¤¿ºï½üÍ×µá ¤Ë¤è¤Ã¤Æ¡¢¸í¤Ã¤Æ¥Õ¥¡¥¤¥ë¤¬¾Ã¤µ¤ì¤Æ¤·¤Þ¤¦¡ª ºÇ¿·À¤Âå¤Îºï½ü¤Ï gfrm -h ¤¹¤Ê¤ï¤Á gfs_replica_remove_by_file() ¤¹¤Ê¤ï¤Á GFM_PROTO_REPLICA_REMOVE_BY_FILE ¢ª inode_remove_replica() ¤Ç¤â¹Ô¤Ê¤Ã¤Æ¤¤¤ë¡£ ¤³¤ÎÌäÂê¤Ï¡¢°Ê²¼¤Çǧ¼±¤µ¤ì¡¢ https://sourceforge.net/apps/trac/gfarm/ticket/88 #88 - race condition between a replication failure and another replication replication¤Ë´Ø¤·¤Æ¤Ï¡¢r4657, r4659 ¤Ç dead_file_copy_remove() ¤ò ƳÆþ¤¹¤ë¤³¤È¤Ë¤è¤ê(¸úΨ¤Ï°­¤¤¤¬)¡¢°ì±þÂкö¤µ¤ì¤¿¡£ ¤·¤«¤·¡¢r4955 ¤Ç¡¢¾å½ñ¤­»þ¤Ë¤Ï¡¢¤½¤ì¤Þ¤Ç¥ì¥×¥ê¥«¤Î¸ºß¤·¤Ê¤«¤Ã¤¿ ¥Î¡¼¥É¤Ë¤âƱ°ìÀ¤Âå¤Î¥Õ¥¡¥¤¥ë¤òºîÀ®¤¹¤ë¥±¡¼¥¹¤¬À¸¤Þ¤ì¤¿¤¿¤á¡¢ ºÆÅÙÌäÂê¤Ë¤Ê¤Ã¤¿¡£ ¤Þ¤¿¡¢´ØÏ¢¤·¤Æ https://sourceforge.net/apps/trac/gfarm/ticket/78 #78 annoying pgsql error messages about deadfilecopy https://sourceforge.net/apps/trac/gfarm/ticket/144 #144 INode table in the PostgreSQL backend may not be corectly updated ¼ºÇÔ¤·¤¿Ê£À½½èÍý¤¬µìÀ¤Âå¤ËÂФ¹¤ë¤â¤Î¤Ç¤¢¤ì¤Ð¡¢ ñ¤Ë remove_replica_entity() ¤Ç dead_file_copy ¤òºîÀ®¤¹¤ë¡£(DB¤Ë¤â½ñ¤¯) file_copy ¤Ë¤Ä¤¤¤Æ¤Ï¸ºß¤·¤Ê¤¤¤Î¤Ç¡¢²¿¤â¹Ô¤Ê¤ï¤Ê¤¤¡£ ¤â¤·¡¢¥Õ¥¡¥¤¥ë¤Î¹¹¿·¤¬¤¢¤Ã¤¿»þ¤Ë¡¢¸Å¤¤À¤Âå¤Ë¤Ä¤¤¤ÆÊ£À½½èÍý¤¬¼Â¹ÔÃæ¤Ç ¤¢¤ì¤Ð¡¢¸Å¤¤ struct file_copy ¤Ïºï½ü¤·¡¢dead_file_copy ¤òºîÀ®¤·¡¢ ºï½üÍ×µá¤â½Ð¤¹¡£¤³¤ì¤Ï inode_remove_every_other_replicas() ¤Î remove_replica_entity(¡Á, NULL) ¤Ç¹Ô¤Ê¤Ã¤Æ¤¤¤ë¡£remove_replica_entity() ¤ÏºÇ½ª°ú¿ô¤¬ NULL ¤Ç¤¢¤ì¤Ð¡¢ ºï½üÍ×µá¤âȯ¹Ô¤¹¤ë¡£ XXX FIXME: race condition ¤³¤³¤Ç¡¢Ê£À½½èÍý¤Ï gfsd ¦¤Ç¥­¥å¡¼¤Ëί¤ë¤Î¤Ç¸Å¤¤Ê£À½¤Îºï½üÍ׵᤬¡¢ ¸Å¤¤Ê£À½¤ÎÊ£À½Í×µá¤è¤ê¤âÀè¤Ë¼Â¹Ô¤µ¤ì¤ë²ÄǽÀ­¤¬¡¢ÍýÏÀŪ¤Ë¤Ï¤¢¤ê¤¦¤ë¡£ ¤¿¤À¤·¡¢¤³¤Î¾ì¹ç¡¢¥¹¥×¡¼¥ë¤Ë¥´¥ß¤¬»Ä¤ë¤À¤±¤Ê¤Î¤Ç¡¢¥Õ¥¡¥¤¥ë¤ò¼º¤¦¤È ¤¤¤Ã¤¿ÌäÂê¤Ïµ¯¤­¤Ê¤¤¡£ ¡û 2.4.0 ¥ê¥ê¡¼¥¹¤Îº¢¤Ë¡¢º£¸å¤ÎͽÄê¤È¤·¤Æ¹Í¤¨¤Æ¤¤¤¿¤â¤Î (¸Å¤¤¡£º£¤Ï¤µ¤é¤Ë²þÄû) replication_pendingq replication_confirmingq replication_finishedq replication_busyq requested ½é´ü¾õÂÖ newgen_waiting À¤ÂåÈֹ湹¿·ÂÔ¤Á pending GFS_PROTO_REPLICATION_REQUEST¤ÎÁ÷¿®ÂÔ¤Á¥­¥å¡¼ in_flight GFS_PROTO_REPLICATION_REQUESTÍ×µáÁ÷¿® replicating GFS_PROTO_REPLICATION_REQUESTÊÖÅú¼õ¿®¡¢ GFM_PROTO_REPLICATION_RESULTÍ×µá¤Î¼õ¿®ÂÔ¤Á replicated GFS_PROTO_REPLICATION_REQUESTÊÖÅú¤Ï̤¼õ¿®¤Ë¤â´Ø¤ï¤é¤º¡¢ GFM_PROTO_REPLICATION_RESULTÍ×µá¤ò¼õ¿®¤·¤¿ race condition GFS_PROTO_REPLICATION_REQUESTÊÖÅú¤Î¼õ¿®ÂÔ¤Á confirming GFS_PROTO_REPLICATION_REQUESTÊÖÅú¤È GFM_PROTO_REPLICATION_RESULTÍ×µá¤ÎξÊý¤ò¼õ¿®¤·¡¢ GFM_PROTO_REPLICATION_RESULTÊÖÅú¤ÎÁ÷¿®ÂÔ¤Á¥­¥å¡¼ finished GFM_PROTO_REPLICATION_RESULTÊÖÅú¤òÁ÷¿®¤·¤¿¸å¤Î finalizing ÂÔ¤Á¥­¥å¡¼ finalizing ½ªÎ»½èÍýÃæ removal_waiting Ê£À½½èÍý¤Ë¼ºÇÔ¤·¡¢ÉÔ´°Á´¤Ê¥ì¥×¥ê¥«¤Îºï½üÂÔ¤Á¡£ ºï½ü´°Î»¤Þ¤Ç¤Ï¡¢copy->valid == 0 ¤Ê¾õÂ֤ϰݻý¤·¤Æ¤¤¤ë¡£ replication_waiting ºï½üÂÔ¤ÁÃæ¤Ë¡¢¿·¤¿¤Ê¥ì¥×¥ê¥±¡¼¥·¥ç¥ó¤ò°ÍÍꤵ¤ì¤¿¡£ ¤³¤Î¾ì¹ç¡¢É¬¤º¥ê¥È¥é¥¤¤¹¤ë¡£ busy back_channel Á÷¿®¤¬busy¾õÂ֤Τ¿¤á¡¢ GFS_PROTO_REPLICATION_REQUEST¤ÎÁ÷¿®¤Ê¤¤¤· GFM_PROTO_REPLICATION_RESULTÊÖÅú¤ÎÁ÷¿®¤¬ ²Äǽ¤Ë¤Ê¤ë¤Î¤òÂԤäƤ¤¤ë XXX ¡û ¥­¥ã¥ó¥»¥ë¤Î¼ÂÁõ kill ¤·¤¿¾ì¹ç¡¢¥×¥í¥È¥³¥ë¤ÎƱ´ü¤¬¼º¤ï¤ì¤ë¤Î¤Ç¡¢ gfsd connection cache ¤Î purge ¤¬É¬Íס£ XXX ¡û ¼ºÇÔ¤·¤¿¾ì¹ç¡¢²Äǽ¤Ê¤é¥ê¥È¥é¥¤¤·¤¿¤¤¡£ XXX ¡û inode:rstate ¤Ë on going replication ¤¬ÊÝ»ý¤µ¤ì¤Æ¤¤¤ë»þ¡¢ inode ¤¬¥ê¥à¡¼¥Ö¤µ¤ì¤ë¤È¡¢inode ¤Ï DB ¤«¤é¾Ã¤¨¤ë¤¬¡¢¥á¥â¥ê¾å¤Ë¤Ï»Ä¤ë¡£ ¤³¤Î¤È¤­¡¢file_copy ¤Ï DB ¤«¤é¤â¥á¥â¥ê¤«¤é¤â¾Ã¤¨¤Æ¤Ê¤¤¡£ ¤³¤Î»þ¡¢gfmd ¤¬»¦¤µ¤ì¤ë¤È¡¢file_copy ¤¬ orphan ¤Ë¤Ê¤ë¡£ ¡û ¥Õ¥¡¥¤¥ëÊ£À½¤Ë¼ºÇÔ¤·¤¿¾ì¹ç¡¢°¸Àè¥Û¥¹¥È¤ÎÉÔ´°Á´¤ÊÊ£À½¤Ï¡¢ gfmd ¤¬ dead_file_copy ¤ò»È¤Ã¤Æ¾Ã¤·¤¿Êý¤¬Îɤ¤¤«¡© ¤½¤ì¤È¤â gfsd ¤¬¼«Ê¬¤Ç¾Ã¤·¤Æ¤«¤é¡¢¥Õ¥¡¥¤¥ëÊ£À½½èÍý·ë²Ì¤òÊó¹ð¤¹¤ë ¤Î¤¬Îɤ¤¤«¡© race condition ¤òÈò¤±¤ë°ÕÌ£¤Ç¤Ï¡¢gfsd ¤¬¾Ã¤·¤¿Êý¤¬´Êñ¡£ ¤·¤«¤·¡¢¤½¤Î¾ì¹ç¡¢gfsd ¤¬¥¯¥é¥Ã¥·¥å¤¹¤ë¤È¡¢ÉÔ´°Á´¤Ê¥ì¥×¥ê¥«¤Î¥´¥ß¤¬ »Ä¤Ã¤Æ¤·¤Þ¤¦¤³¤È¤Ë¤Ê¤ë¡£ ¤½¤¦¤¤¤¦°ÕÌ£¤Ç¡¢gfmd ¤¬¾Ã¤·¤¿Êý¤¬Îɤ¤¡£ ¤¿¤À¤·¡¢gfmd ¤Ï¡¢¾Ãµî¤¬´°Î»¤¹¤ë¤Þ¤Ç´Æ»ë¤·¡¢¤½¤Î´Ö¤Ï incomplete ¤Ê ¥ì¥×¥ê¥«¾õÂÖ¤ò°Ý»ý¤·¡¢¶¥¹ç¤òÈò¤±¤ëɬÍפ¬¤¢¤ë¡£ ¤Ê¤ª¡¢¤³¤Î¾Ãµî´°Î»ÂÔ¤Á¤Ï¡¢Ê£À½ºîÀ®¼ºÇԤλþ¤À¤±¹Ô¤Ê¤¨¤ÐÎɤ¤¤ï¤±¤Ç¤Ï¤Ê¤¤¡£ ñ¤Ê¤ë¥ì¥×¥ê¥«ºï½ü¤Î¾ì¹ç¤â¡¢incomplete ¾õÂ֤ΰݻý¤ÏɬÍס£ ¤µ¤â¤Ê¤¤¤È¡¢¤½¤ì¤ÈʹԤ·¤ÆÊ£À½ºîÀ®¤¬¹Ô¤Ê¤ï¤ì¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ ¤Á¤Ê¤ß¤Ë gfarm-2.3.0 °ÊÁ°¤Ç¤â¡¢gfmd ¤¬¾Ã¤·¤Æ¤¤¤¿¡£ ¤³¤Î·ï¤¬ http://sourceforge.net/apps/trac/gfarm/ticket/88 https://dev.chubu.sra.co.jp/trac/gfarm/nttcom/ticket/5 https://xi.lab.sphere.ad.jp/trac/gfarm/ticket/62 ¤È¤·¤ÆÌäÂê¤È¤Ê¤Ã¤¿¡£ ¡û Ê£À½½èÍý¤Î¼ºÇÔ (a1) gfmd ¤¬ gfsd ¤ØÊ£À½Í×µá¤ò½Ð¤¹ (a2) Ê£À½½èÍý¤Ë¼ºÇÔ¤¹¤ë (a3) gfmd ¤¬¡¢Ê£À½Àè¤Î¼ÂÂΤò¾Ã¤¹Í×µá (== dead_file_copy) ¤òºî¤ë (a4) gfmd ¤«¤é gfsd ¤ØÍ׵᤬ÅÁ㤵¤ì¡¢¼ÂÂΤ¬¾Ã¤¨¤ë ¡û ¤â¤¦°ì¤Ä¤ÎÊ£À½½èÍý (b1) Ʊ¤¸¥Õ¥¡¥¤¥ë¤Ë´Ø¤·¡¢Æ±°ì¤ÎÊ£À½Àè¤Ø¤ÎÊ£À½½èÍý¤¬Í׵᤬½Ð¤ë (b2) gfsd ¤¬Ê£À½¤òºîÀ®¤¹¤ë ¤È¤¤¤¦ 2¤Ä¤Î½èÍý¤¬¡¢ (a1) ¢ª (a2) ¢ª (a3) ¢ª (a4) ¢ª (b1) ¢ª (b2) ¤È¤¤¤¦½ç½ø¤Ç¼Â¹Ô¤µ¤ì¤ì¤ÐÌäÂê¤Ê¤¤¤¬¡¢ (a1) ¢ª (a2) ¢ª (a3) ¢ª (b1) ¢ª (b2) ¢ª (a4) ¤È¤¤¤¦½ç½ø¤Ç¼Â¹Ô¤µ¤ì¤ë¡¢Ê£À½¤µ¤ì¤¿¼ÂÂΤ¬¸í¤Ã¤Æ a4 ¤Ç¾Ã¤µ¤ì¤Æ¤·¤Þ¤¦¤Î¤Ç¤Þ¤º¤¤ Âкö¤È¤·¤Æ¡¢ Ê£À½Í׵᤬½Ð¤¿»þ¡¢Æ±°ì¥ì¥×¥ê¥«¤ËÂФ¹¤ëdead_file_copy¤¬¤¢¤Ã¤¿¤é¡¢ ¾õÂÖ¤¬ kept/in_flight/finished/finalizing ¤Ê¤é¤Ð¡¢ ½èÍý´°Î»¤Þ¤ÇÂÔ¤Ä ¤µ¤â¤Ê¤¯¤Ð ¤½¤Îdead_file_copy¤ò¾Ã¤¹ ¤È¤¤¤¦¼ê¤¬¹Í¤¨¤é¤ì¤ë¡£¤·¤«¤·¡¢½èÍý´°Î»¤Þ¤ÇÂԤĤΤÏgfmd¤ÎÆâÉô¹½Â¤Åª¤Ë ÌÌÅݤʤΤǡ¢¤È¤ê¤¢¤¨¤º¤Î¼ê¤È¤·¤Æ¡¢ ¾õÂÖ¤¬ kept/in_flight/finished/finalizing ¤Î¥±¡¼¥¹¤Ë¤Ä¤¤¤Æ¤Ï¡¢ ñ¤Ë BUSY ¤òÊÖ¤¹ ¤È¤¤¤¦ÊýË¡¤â¤¢¤ë¡£ ¡ù Ãí°Õ»ö¹à: async_back_channel_replication_request() ¤ò¸Æ¤ÖÁ°¤Ë¤Ï¡¢ dead_file_copy_remove() == GFARM_ERR_NO_ERROR ¤ò³Îǧ¤·¤Æ¤ª¤¯É¬Íפ¬¤¢¤ë¡£ ¤µ¤â¤Ê¤¤¤È¡¢¾åµ­ race condition ¤¬È¯À¸¤¹¤ë¡£ ¢£ XXX ̤µ­ºÜ TO-DO ¡¦protocol_main() ¤Ç¼õ¤±¤¿½èÍý¤Ï resuming_thread() ¤Ç¤ÎÊÖÅúÂÔ¤Á¤Ë¤Ê¤ë ¤â¤Î¤¬¤¢¤ë¤¬¡¢resume ¤¬ callback ¤Ç¼Â¸½¤µ¤ì¤Æ¤¤¤ë¤¿¤á¡¢¥¹¥ì¥Ã¥É¥×¡¼ ¥ë»ñ¸»ÂÔ¤Á¤Î¥Ç¥Ã¥É¥í¥Ã¥¯¤Ë¤Ï¤Ê¤é¤Ê¤¤¡£ gfarm-2.4.1/doc/internal/ja/gflog-msgno.txt0000644000000000000000000000226311507222722017246 0ustar rootroot¢£ gflog¥á¥Ã¥»¡¼¥¸ÈÖ¹æ¤Î³ä¤ê¿¶¤ê¼ê½ç ¥á¥Ã¥»¡¼¥¸ÈÖ¹æ¤Î³ä¤ê¿¶¤ê¤Ï¡¢make msgno ¤Ç¼Â¹Ô¤µ¤ì¤Þ¤¹¡£¥á¥Ã¥»¡¼¥¸ÈÖ¹æ ¤Î³ä¤ê¿¶¤ê¤Ï¥³¥ó¥Ñ¥¤¥ëÂоݥե¡¥¤¥ë¤Ë¤Ä¤¤¤Æ¹Ô¤ï¤ì¤ë¤Î¤Ç¡¢ configure ¤Ç µ¡Ç½¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤Ê¤¤¤ÈÈÖ¹æ¤Î³ä¤ê¿¶¤ê¤¬¹Ô¤ï¤ì¤Ê¤¤¥Õ¥¡¥¤¥ë¤¬¤Ç¤­¤ë¤Î ¤ÇÃí°Õ¤¬É¬ÍפǤ¹¡£ ¥á¥Ã¥»¡¼¥¸ÈÖ¹æ¤Î³ä¤ê¿¶¤ê¤Ï°Ê²¼¤Î¼ê½ç¤Ç¼Â¹Ô¤·¤Þ¤¹¡£ + ¥ì¥Ý¥¸¥È¥ê¤Î¥ï¡¼¥­¥ó¥°¥³¥Ô¡¼¤ò¥¢¥Ã¥×¥Ç¡¼¥È¤¹¤ë(svn update)¡£ + ¥³¥ó¥Õ¥ê¥¯¥È¡¢Êѹ¹¤¬¤Ê¤¤¤³¤È¤ò³Îǧ¤¹¤ë(svn status)¡£ + configure¤ò¼Â¹Ô¤¹¤ë¡£ - globus, LDAP, postgreSQL¤¬Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤³¤È¤ò³Îǧ¤¹¤ë¡£ - --with-private-srcdir¤Ï»ØÄꤷ¤Ê¤¤¡£ + ¥½¡¼¥¹¤Î¥È¥Ã¥×¥Ç¥£¥ì¥¯¥È¥ê¤Çmake msgno¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤¹¤ë¡£ + GFARM_MSG_UNFIXED¤È.msgno¤Î¥Õ¥¡¥¤¥ë°Ê³°¤¬Êѹ¹¤µ¤ì¤Æ¤¤¤Ê¤¤¤³¤È¤ò³Îǧ¤¹¤ë¡£ + Êѹ¹¤µ¤ì¤¿¥³¡¼¥É¤Èmakes/.msgno¤ò¥³¥ß¥Ã¥È¤¹¤ë¡£ gfarm2fs¤Ë¤Ä¤¤¤Æ¤âƱÍͤ˰ʲ¼¤Î¼ê½ç¤Ç¼Â¹Ô¤·¤Þ¤¹¡£ + ¥ì¥Ý¥¸¥È¥ê¤Î¥ï¡¼¥­¥ó¥°¥³¥Ô¡¼¤ò¥¢¥Ã¥×¥Ç¡¼¥È¤¹¤ë(svn update)¡£ + ¥³¥ó¥Õ¥ê¥¯¥È¡¢Êѹ¹¤¬¤Ê¤¤¤³¤È¤ò³Îǧ¤¹¤ë(svn status)¡£ + configure¤ò¼Â¹Ô¤¹¤ë¡£ - --with-private-srcdir¤Ï»ØÄꤷ¤Ê¤¤¡£ + ¥½¡¼¥¹¤Î¥È¥Ã¥×¥Ç¥£¥ì¥¯¥È¥ê¤Çmake msgno¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤¹¤ë¡£ + GFARM_MSG_UNFIXED¤È.msgno¤Î¥Õ¥¡¥¤¥ë°Ê³°¤¬Êѹ¹¤µ¤ì¤Æ¤¤¤Ê¤¤¤³¤È¤ò³Îǧ¤¹¤ë¡£ + Êѹ¹¤µ¤ì¤¿¥³¡¼¥É¤Èmsgno/.msgno¤ò¥³¥ß¥Ã¥È¤¹¤ë¡£ gfarm-2.4.1/doc/internal/ja/gfarm-v2-protocol-gfs.txt0000644000000000000000000000425411507222722021066 0ustar rootrootµ­¹æ¤Î°ÕÌ£: i, l, s ¤Ï¡¢xxx_proto.c ¤Î°·¤¦¥Õ¥©¡¼¥Þ¥Ã¥Èʸ»ú ¥Õ¥©¡¼¥Þ¥Ã¥Èʸ»ú[ÊÑ¿ô] ¤Ï¡¢ ¡Ö¤½¤Î¥Õ¥©¡¼¥Þ¥Ã¥Èʸ»ú¤ËÂбþ¤¹¤ë·¿¡×¤Î¡ÖÊÑ¿ô¡×²ó¤Î·«¤êÊÖ¤·¡£ Îã: s[npaths] ¡Ä ʸ»úÎó(s) ¤Î npaths ²ó¤Î·«¤êÊÖ¤· ------------------------------------------------------------------------ gfsd ¥×¥í¥È¥³¥ë ¥¯¥é¥¤¥¢¥ó¥È, gfsd ¤«¤é¤Î¥¢¥¯¥»¥¹ GFS_PROTO_PROCESS_SET, ÆþÎÏ: i:type, b:shared_key, l:pid ½ÐÎÏ: i:¥¨¥é¡¼ GFS_PROTO_OPEN, ÆþÎÏ: i:fd ½ÐÎÏ: i:¥¨¥é¡¼ GFS_PROTO_OPEN_LOCAL, ÆþÎÏ: i:fd ½ÐÎÏ: i:¥¨¥é¡¼ ¥¨¥é¡¼ == GFARM_ERR_NOERROR ¤Î¾ì¹ç: ¥Ç¥£¥¹¥¯¥ê¥×¥¿¥Ñ¥Ã¥·¥ó¥°¤òÍѤ¤¤Æ¡¢local fd ¤òÊÖ¤¹¡£ GFS_PROTO_CLOSE, ÆþÎÏ: i:fd ½ÐÎÏ: i:¥¨¥é¡¼ GFS_PROTO_PREAD, ÆþÎÏ: i:fd, i:size, l:offset ½ÐÎÏ: i:¥¨¥é¡¼, b:data GFS_PROTO_PWRITE, ÆþÎÏ: i:fd, b:buffer, l:offset, ½ÐÎÏ: i:¥¨¥é¡¼, i:length GFS_PROTO_FTRUNCATE ÆþÎÏ: i:fd, l:length, ½ÐÎÏ: i:¥¨¥é¡¼ GFS_PROTO_FSYNC ÆþÎÏ: i:fd, i:operation, ½ÐÎÏ: i:¥¨¥é¡¼ GFS_PROTO_FSTAT, ÆþÎÏ: i:fd ½ÐÎÏ: i:¥¨¥é¡¼ ¥¨¥é¡¼ == GFARM_ERR_NOERROR ¤Î¾ì¹ç: l:size, l:atime_sec, i:atime_nsec l:mtime_sec, i:mtime_nsec GFS_PROTO_CKSUM_SET, ÆþÎÏ: i:fd, s:cksum_type, b:cksum ½ÐÎÏ: i:¥¨¥é¡¼ GFS_PROTO_LOCK, ÆþÎÏ: i:fd, l:start, l:len, i:type, i:whence ½ÐÎÏ: i:¥¨¥é¡¼ GFS_PROTO_TRYLOCK, ÆþÎÏ: i:fd, l:start, l:len, i:type, i:whence ½ÐÎÏ: i:¥¨¥é¡¼ GFS_PROTO_UNLOCK, ÆþÎÏ: i:fd, l:start, l:len, i:type, i:whence ½ÐÎÏ: i:¥¨¥é¡¼ GFS_PROTO_LOCK_INFO, ÆþÎÏ: i:fd, l:start, l:len, i:type, i:whence ½ÐÎÏ: i:¥¨¥é¡¼ ¥¨¥é¡¼ == GFARM_ERR_NOERROR ¤Î¾ì¹ç: l:start, l:len, i:type, s:host, l:pid GFS_PROTO_REPLICA_ADD, ÆþÎÏ: i:fd ½ÐÎÏ: i:¥¨¥é¡¼ GFS_PROTO_REPLICA_RECV, XXX ½ÐÎÏ: i:¥¨¥é¡¼ ¾¤Î gfsd ¤«¤é¤Î¥¢¥¯¥»¥¹ replication manager ¤«¤é¤Î¥¢¥¯¥»¥¹? GFS_PROTO_COMMAND, ¤¤¤Þ¤Î¤È¤³¤í v1 ¤ÈƱ¤¸ gfmd ¤«¤é¤Î back channel /* from gfmd */ GFS_PROTO_FHSTAT ÆþÎÏ l:i_node_number, l:i_node_generation ½ÐÎÏ: i:¥¨¥é¡¼ ¥¨¥é¡¼ == GFARM_ERR_NOERROR ¤Î¾ì¹ç: l:size l:atime_sec, i:atime_nsec, l:mtime_sec, i:mtime_nsec, gfmd ¤«¤é gfsd ¤ËÂФ·¤Æ¡¢i-node ÈÖ¹æ¤ò»ØÄꤷ¤Æ¡¢ struct gfs_stat ¤òÌ䤤¹ç¤ï¤»¤ë¡£ GFS_PROTO_FHREMOVE ÆþÎÏ: l:i_node_number, l:i_node_generation ½ÐÎÏ: i:¥¨¥é¡¼ gfarm-2.4.1/doc/internal/ja/gfarm-v2-schema-phys.gif0000644000000000000000000002247511507222722020624 0ustar rootrootGIF87aFjòE2‹eÃGþþþÿì‹ÿÿÿ,FjþHºÜþ0ÊI«½8ëÍ»ÿ`(Ždižhª®lë¾p,Ïtmßx®ï|ïÿÀ pH,ȤrÉl:ŸÐ¨tJ­Z¯Ø¬vËíz¿à°xL.›Ïè´zÍn»ß6 ‡Ûïø|}Q߯úy‚ƒ.t}t|ˆŠ†~ ‡r ”{Ž€„›œ~Œ’–“•†¢”˜ŸŒ“¤ž±²³ ¢§°·¶» ¬¨º!¹³Ã㵊 ¡Ž‰¾À¼°šÁÅÔÕ›µ¶˜¯•šÎÎÏßÒÒÌ¡Öèép؈޺‡©ïç|½ãåæ¿êûügتônù²DN^ÀÝ>ëǰ!•¦ |P0š½€ /:ÜÈþÑÊ?IÚ@rI2¯gõ챣˗AâÅ6dÄe)KÎCØ«¥J˜@ƒºÉ—SÜÎ >…*]J&)Ó§P£JJµªÕ«X³jÝʵ«×¯`ÊK¶¬Ù³hÓª]˶­Û·K3ÉK·®Ý»xóêÝË·¯ß¿€ L/\6NU¬&1ã5ŽW‰,Ù_e3”/7Õ¼™³ Ìž™€íe4i$¦OkI­šëÖasy-{ íÚ=nã~¢{wŽÞ¾—^c8ñ#ÆÇH®|óæ-žCÿ!}zŠêÖw`Ï^b;÷Þ¿O_š¼’ðæ—§G½~ úöÞÃÿ3ßuý+òï/Ò?™?þüþ`€G±@QøáTÜhÚ¦B&Ž2A>Hׂ 4øh½Õá~/X! 5Ù4ƒ‚XhˆË %–øa=!R螌2 ˜ B,Òø¢Q1R”Œ9(¶3bO4 ‰OOHŠd#Iùب 2© O"#UYN’2AÈÁm.2¹ 75A9Ò’°U'">Ú<ù¥** šXÎUŠ•`Î$—•º™¥M¯¸¢¥žB’)aw ɧÉÔ)èif’NR9ç"b♨‰tVZ’”Tnz)¢`†êeœê„” m†Yj¥ îÖ¨tvZe›à5ƒ“¦³~j«¬žÂ*N$qki¦Àû ª¶îþÉë¨))S¯þªhšZÒG²œ.›m®“Ѝšpšº-³½z;®Ÿ8Zв±ž[l¬­EÛí¡ðÖËC—îNÊê®æªêo¶Îk,¹ó¢{,¡Ž&Ù¬®ó–9¡¯ú’bíµ¾âJð¸×{fÆù–›1¯³”cÅ—.,ì²ñ.Ço¹­N¼`²í®š¦¨›ÌíÍž¾»­Á-—ì2E9Â,®ÌÌÐüócØy8-‘·>ûkžÎþ a¤ÕJÜç·­ö+°Ç~V­p—t¨tÔàš'nÞýyåº%»¶ ÆôÉm¸ÒòɶÂvw2”¸ZŸ…Q¾«èºsƒ­šÓ²M"âaóÆxTw¢x0¥þ:9¥Ð]~MxrB¡9BŸ+úgï~žã™ïØÄèæ±®:J¯«{®‹W»ê·s—û‹»[×{„¿§>;{ßX®¨æ\{WØñµ+I­¢'™.:µ¦‚•kP×â £G9â¨ê8LÂæ”³ çc™ÈV\²h?5b%#•·×¾•Rdlí((R õ†+å-K%ûL’.ô~þu¨±êœÉÑ…‘‘X»Y‘"—²fµ—Rí£ÈÝj—¸ºmå^KVìš•2¹ý¬?w‹^çîs¤ ïé’kÂõ†•‘ã=ãd™ÚÏî~aº³Q-yçkÞvú÷¾ðÝ®uËËßú˜º=T0è KáæòªßKu­à÷ê2ÃHp1:œ!ûB ñE‰+»J{eÃÕXñÁ¼ùÎ⦘ÃÖA…wì—ËwÄ<²a——"ùÈQ€1’—¼T 3ùÉ×½1”§L<ãRùÊBP2–·Lc)sù˶2˜Ç\#›ø:É‘1™éeÏã9rÅ­ULNý QÌF}–Ý,S:°Z¨…þ]9=¥vâµÍúõ3îÌüYŸ®"ÐöH¬2˜Æ6µuîÇi8FžÇ¹& „fÃÛóoŽzè;¿¹rØÊ«>CèR1§ªš¨Á³Ü7û0Ñ(™³„A¾™ÍxŽ‘¾t­7­ŸYdz‚}Zƒ>½"aqÂîeS±ú¦è.wÙ¾ÆÛ‡ŒÍÓaÃÈž¥sKØÊì|N?Ù´ôC‡]¦]ÑIŽÕ3£»Ú87׿pöÚôÙë]¿º(ºþZFMìmÏ[½â,5¢O;-ßM¾·µQ6àN«Y(Ü>¶˜Âç$ ä9ƒˆ|Ih}kRrÎ÷‚O(vŸ÷…L†bˆddX†Dv†h˜u‘e·þÇ^ئ–¤G/h)\TÓ`l¦œÂ³P`S‚’ µ¸ŽAKœf›^©‹m@—牞Ávh0inÚRõämd"5Ê zb¥9›Êñn˜æ‹éHz'Ù•‰õXð‰›ØøŒ•˜œú¡%gQw‘2qNëÆÇ’c³sy™åã¢I«Huþ¹qˆF) <éž)æÌ(”%¹¡®Blú]ëo8Z{X(h;¤-â`¤Ùaoç £ŽEs w£Êö$Ly f¦çÖ¢aš Äa”©J¶D“˜b¡Kw¢—¢¡Õ’ݘb:[¤mÙÉ×Fj­–•Ü¡™5‡j~y©|aþ¨t:¥Æt ²øpH:œ—h1W‘õy‹Þ©yHߠХZi_*_Nº©m±ª¬›<7?~©ÌW7Ì壪ê’ËYROj?ÄZ¬Ç›k«Êz¬dÊ*¥Ãú›ÓÊŸœá¬Å ­ š¬×Ú£¡¡­ËÉ­¾'­ßj«Íè­ßJ®¡®×Ê®á®Ó ¯™&¯Ïú¡öº­øj­çzŠ¹Ê¯ý*¬áš¯i¦^šªŸ±¯æÚŒ)—‚4ŠH§°ÔªªBƒ9¹G˜uJ°PêR •LI‚Þ%§ °éÓS¿ZB©€²šš G“’Ø&*óh(°¤µ±ª3Ãqu™~à(¨°yªLú§Sþ¨³4‚¾ W“´å7«!±ØÊ^„ê•5ê£Ñ“&x°A‚ ‰MFë}°Dƒ–úOK²l—x§¡‡|¡z\Îù¢ˆÕµï–5F¨|:² ëL_å¯U iUûuH*5ûo#“ƒìG©%¨EF¯…J¶þ6¤–™¦*Ò·ƒÂ§±„uÚ…°:·«)X8’M{âºi†©¨z¹@)Ÿ&j•Ò±[•·~À:·“ú_Në¶Ü)³/ÕsUÚ©§Û@”«´^ZqR±£y÷w75Æ©wkšfJ¥‡º«©—¥GȲ«VX Û/Ĺ#ù}û(â긫˜&[¦9zt E´õŒçõ«þìÇ–ªH…Ü¥¾¡­êɩŸ<*„¸X¹¶¹»¦²+¦¸–Á¸þŠ¥*µ®ˆŒº¬e”B\»ÏŸO ¥à«¢*uŸ¿n#cü£Ë»<Ì*›h£±´ÙÁÈJÀkŠ9±)L1±+:$|š¥ƒ{™;b1lB˜*d*æÂ { *œ ?\ž‹còÂ5L ¡[uFĨi¼ÛD|A¼±?›ÓÅèšyÀ:}4äŽ";Á1ÂH 3L~3¸¥±ÄËÄÅò‹Äײ£úlŒÂž oºù4F“*عÃEüÆÈ´s|Ã뀠’ 2|Å»ÇtË7füÇrL?ís¨µ‘yÌĵiþ´·È’È6‹XX8•«§ÓfŒ}š‰bÌï{¸-˜É,¶ q¡ɧ7ÙšæÛ›6ŒÈ²„êfÅQ»ËÛÊ)ˆG)LÑ ’ܫ˖¹8N,{*XË…¼K¼öÖìp·K lÈœsá[Š•”ÔüÌÖ ºš<§, ±«IG¯›’ EÊÌl·,ìbóFIàb½Uhv£«‰sÍÜ­ø¬©ù,ΫL»ý¼Ég¬ÏÇÌÏìü¹1fЋÐÚœÆÜÐÙ:ÎæÙ±€´áÇcÛÌðLÀͳ·]´ÐÍÑÉ[ÍÁJt­KËíÎ^¼¸ mÇeŸ[¬•ôDL£<Šz¼Ñï\Òà|•¤þeDÑÙ~7õš¥ZÊ#½Ó¬lÑGr›¹¸Y|˜ÑR<Ñ`JkÏI¾¾”(ùͼlgGÝÒüÒ,)3ÔÍÓl‘¶›°±—ÃqÈ$Ô*Ý-89ËÁ,ÔPMžRýÕqÍ™ñZÕu{Õ˜T„êVÏòˆŸ?¹Öà²ûåÐbÍ‚MÖÈ)Ò·Æ`Ž­Ø-Ù%V!{Ò˜}——Á½ìZn½c”<ÐXÚ`\¶ŸíÒ]d§­ÙÎÑbrùØ',Û.Õ§dt4 ®V¦Á uµÝÚcýÚ'-YqªØ½=Å/X«Ô9ÜeØK IIפu¥Ü9L¶zBƒ)ÜH-ФýŸê¼Å„M¡Å¨Èþ=Õ‹ =!×¾‡-KDXQùèÛzÝØ|Ûë‹/å8@}t±œõ†H;Z[ ©vÚ/}ÁÚÑÝ×VŠ™º¦Œ•›VÕE$¸V§Su§Rõ dÜ&]™÷½ÂáGÇ j¾'ÍH)ÝFmrÄ™›í™”=ã¶]Ùßýà„Ç‹'~Ý+ÙÔnª#Þ~Ý ‰•2.ÑHNÜ äM¥1{Öf½¢=ià1 ¨4îC>S]}àW)å!ÞÓ"¾Ïåú¼d™DTó¾<[Óò˜|bþ˜Rõ9ÓÁ…à‰Í×W.Úõ}ã½ZÆÁÙÞØåŒÚúyç®ÀläçWq;Õ-èÏ­äømèÈþfU¡è æOGèÅ é{.”ÙÇÝàz>ÝQ§²89€þéžÞèxÚ<â3à=é§®®ˆîà›Îs Û®ÚQ鎘¡>ÄÄ…s¥~ˆBìë5îÌ¡E ºþÈTÆØ íè$®À-˜ÎnßmžÙ£°q=ë¿®Ð3jçãºä“Ýíí»Z{®ÕŽp´.êLœéîÝÇÞäËíïnìÐŽìàÞÂÅêñÎÓê­ï6ï÷.ïÚŽêsí˜ý.טþ®âæ ÿè×Þ¯õÎïïïù.ñ éI^¯ /Ãï×_è!¿®?è/ò¯ûŽð¯ð'Oò+?î?ìî%¯êíîòÿþŽñ1ïð/Ù#Ïð=¯ñ;ò??¯7Ÿç3_ëEóoï«>æ9ïñCò)ïžÍóOOñQß®KߘÏò]íS¿™a/ó-ÿêeO™gïóMôWîUoòoñqïîIo íyän—mOô5Ÿéûì\Î=ËwÂyOš}σxîÕ9nk/~øÇó÷VôÑ~ÌIê°Z ÔÂnj\‡sóAo÷ m‚Ê»iÏk:íúJŸö4ï¨=j5#Š»Ð\½rGùtøp¯¥|Ëi4zÎV;´¹Ÿøh÷õÀ.¦·¾DËàJ…`hü‰´îÉxàFêÞ^—õ×)ý!½øþ\º•rþÎ6hVÞŽóîæÞÜkÏî Å£w ´%jr©šþX¾þ®ûLï§x ŸÀhO@ºëI(«½8ëÍ»ÿ`(ŽdYRf”®Í‡²p,+ïU× à|¥Ó-› (œȤr©Ä˜gJeJsÐV;¼ê¶ÎkuL.›ÏC–¸ºÆ¢ßÏM{uíÒ=¸~Ïï‡æ€K‚‚~om…†Š‹Œ†‰G„ŽŒˆ•˜™š›c’ž3”œ{—£¦§¨© ¬1¢ªe¥±´µ¶Š®|°·V¹½ÁÂÃr2Àt.ÄM¿ÊÍÎÏvÆ»ÉÐÒÅÕØÙÐÇDz¼Úq‘àãä¶ÜAÞÔå#³ëîï•ççáÌþðÑ×öùúé¯ÓûQêHÐW?Rê ¶¨°¡Ãòü|¨ Å‹-"Cø/#ºUCŠL³‘ßÄŒíFª|‘ãIŒ)WÊ$ØÒ$Ë1gêÌWÎ7Š9w ]×óPBœ7‡*%WÍO–I—JÅÖôÌS‡A§jUVÕÌÕ†Y·ŠíÕUÖQ QǪ5gͦF´o×ÊU–ÌW…açêÝT·ÓYwhðØí”½ˆMõeó—Ý—„çN ÌÁ˜]N¬j1•»v¿(Z"Hx–¹4€@zUjÉœ³´õÙXDáÍ"›þd¯µ D­UÇæäYvG:_Vç@ÆÒ¸Çç»pëþÃG7øÒÄmÖÉ7Ïm™¼ðÏ”µUÏ ýüùOÑïÄg;ûÇ’´C ÿ=·ÿÿ«·œ_ÓU&E`ßá¶Þå‰7žrÚ7~Féç]x"8š€B˜zª—Úv¸`‡ ×_„Â°Ý µýa‰²·¡ƒÑqwÚ;¯‘È¡rÜXcŠ?¶x‹»‰£†ÊÑè#ƒz•^6 ÒØãØ™(d†õÙ÷â2žÀd€Er %–*Éã®÷žsgÇ_—Ù}™h.Œ© “ ŠÇ"Œ!RÉ&¿e)g”5²f¤v"§fªØ Ž’>hœšîTÙæŠ28ãc,æ¸(…%¹ãþ~&*êeíèè”T J¤¥¯Ñ÷à•(ŽŠä‘ùu¦DÉÚj¢’I™Yêºë²½Â:P^‰¹Š¦²“ñZ¡¯PíÒR¦w¦òæ´ˆø¦·Õ2{­³‘»—¹Ý¢Ëî·RÒ Ö¼òækÛ„NÅX»úìïᆔ¶'Œ-=ë"Ü.¾ Gì¿V ü,Äg|_©.aŒšÇ+Üè$?ìpÈÌhÉûŒ²Ä*‡Â²>.¿,2Åõ.|ïÉ6ßlm¿öö,K­DmôÑH-t7j¼ÐÒ†ÑBg¹8›ô$Ig­õÖ\om0qÂLýnÕvÍÜ4Í ‰Mr0jÏ3Ù§Ùþ[ÜgÒ¶tB¿ýó©—ÎíIv‡ µÞê«ãÇ€×íˆÄ»vÞpã 2Ã<&Î4&ç^~5˜ïóäéú͸&–’*¹Í„Ÿ­ó«h—Òõë°¿)Ÿ­.×'ˆ^ñæ2Ó ÈÝŽ•NÄì˜YÙMÛÀ«•ºéâž^yÍ^MêÆè(:|±÷¼<Ç«gøèvco}Ô—ouîª7Ësúˆ+îþ"™“¯‚ù߯}七Îξ2bþ÷ÿ;Mùh' '©-ycÙ¸x‡?ºÝcq±áÃ* ÙŠ|ñëú˜g¿õqpeñ ?ˆŠnE”ãÛá~A@UÙ TH[ ·4†ÎƒþÜ£ñšÔ¦ãÅði§0á×ÀªP÷ Ÿü®—Áϱ…mDô\ ‡DÎïŠõ³ ¥(êΉT䜳¸Ä2âb‹_Ó_QWÄ*âpIœ_ yø!!ñà{`ô'/îR¤às,h; ò±oOäMíÈc¬9ú‰Žî‰—ð2æGþu„™kÞ2Á- $^‘ÅÏÚbYÎ"T/Ç|inU©¾›¥É[áI˜3ÙS.¦±’w-L©Ãý…5VÁ2k.RÓnæ5m³Ó÷X~¬N¶°CHl¯¢0”'¤õ:á[•3É¡¦Õ³§ÝE¬y΋öžÁÍÞú]¹Åä&P²XÀ1ú0÷ž­ ]‡åÆ;©;/°Ô}G;ßV×о\€ÿ­˜_Ñ÷T÷&³Û½Ý¤VÙ ·õ¿þZ&ˆ‡‘Ò/²Q+žq¾8¼}_ö8—aÌØî3Ì%—w¶îšÝn{K\ü¶½ƒóF Û­›ú2;¼í!¼ç&GúÏ‘¾’¥s&äL™Ó©†ñ¨lêz¡´ÕaVòÿnë ¿÷׆uåÙ|ìÊ*»X ‡öá¨]+¿kûÕÿÍv¹G+ìg·{‹Þ¾ö[ë]W|ï{¢ÿ>ªÀ Ñ„÷RÏÇxj>Òn¼„¿vÊKž:J¿üܯy}YîÏ×ç§2úÐo#ó¦÷Vé—²úÔsõ®<ìc¿¨ÖÅö´5Þs_ûÙó^ñœÿýÞ}/üØà~'Ç/~bcž|å›ùίñ£þŸõéS_.Í—Iö¯ðŒoŸûÔ†>øÇüñ»Íú8õ÷’(…àiý¾QÿþH¶Ïsý³ANjµµã~©mHe’söTHz'"Aa ˜,5'Øt11lVb†òB¨2¹²M˜,“Rjì·€„ÒHdl r+QPiÄPùg@Ÿr{r‚Ø€³ í‘Q/ˆ\!ªrmCbA,ˆƒù'€9H$wæE]„8‚ãq(îg%%-TH…KèØBè&V'Âb‚Þ%$Z˜„\X~Áå€Ó²"Y8†MØ„I8‡¤õƒ­%~à '0dœÒ~øi·þsaLˆÿg‡«Ô…{•a¥å'•2…pÈ~Í6,8i†xˆjÈ6ê‡,…4,[ø$ÖN2ÈÅBoS‰378®–eˆ3©¸S¦ˆ.è¤XŠ«hJ²øŠ˜w‰æyº¸‹'T‹¾8¸ˆÁ¸øqÅÈ‹x˜Œ ×‹Ìx{ÀøŒ Ò„ÎXÂHÁ%tÜxŒÈ¸ŒLáZOxT!ŽÞ§æHLç“)é¨SðWÍ…jôX\»w‡jÕJD6bWþÈ_Ò£u‰¶_º¤Šîèw:HtŠõ1¶^"·l)‚‰¾&;òÁTävŒñSkñeJƒ'±årC&H¶UÞ¦‚uWuþä5Œû·ùÓV¨&ƒ…_6ŠJ²\É‘‡ÂÖ>ù:_µ`r%ˆF–stÕ•^ Rp²dF%<ÞµRØÈ³fN VReåF¬3:ùðfq¨õOüE^·N è ìØuU9eê„[E¹$8ù¹Å“_™]ù”KÙ^Gù•y7•ß”9<¶c*¹ØR‡g"—ƒ–Ly^×]D–Ö8~鯶f‚¹“W•BŸut|ÉbŠu±tq±¥lH9˜™6™Z9=éDhuTY»4Z³ r·–“W–E:FUE7Q§†š©I) vA÷÷’Sšc..Ùe&š/W›#é~}É›ö¨ŽYþlAòœJ†s§IqþE—ˆ—˜Ð©“Ý)žÜ•1™€¹I”3ù®9CèXxVie©WÏŽ”Gqô\¬0‚ÖœIGŽ´ˆŸ@4…«FŸš8€é™i†—–Fƒ™®Öe'›½‰’Åv|ç¶V *%“.©˜x#mvEÑ&Y"X)W¹G³XCltsÞé•J9šË©šÉx2Úkk¦eŸAõÕ¡áYt9‰uÉnjs‰g$G‰™¯ð“P¥RN)“aϦuýXa´6V5y¡ýF¬¦]:§i-Éž©¥°)g*¢hŠ›We‡™l'úh\Ê¢@j¦‘© œ© µþ1q §š,‡q'z˜ÊŸ-ЧÍP–Ý‚£¦ `jj_uj™Jú~¦FjýÔ‘ˆÚŽ1É ÆÙÈÙrº6n|Yu£ÊZ™ê;™èPZØÉ†‘Z‘©zÎYf§Šr㹕oÔu–MXw§µjvº÷«Å'+`#¬Ô·¦ýIžÆú{Èš Ú¶¬¹7fFWͱH5­Ö ­’'‹f"¦Éa<¡„•‘ç«ÚÊz¾ôc‘j†5äZ®ÐØ< •"Áä¥Ö´žî{ƒš•2Åfõ¢÷ÚyùúImiVUe–)ù¯cÇ&s¥¢æ±°vE­Á©FËÁ:±š§¡‹¯ï˜±‡±kzû±;¥?%²/&{²(›²*»²,Û².û²0³2;³4[³6{³8›³:»³<Û³>û³@´Bû ;gfarm-2.4.1/doc/internal/ja/gfarm-v2-protocol-gfm.txt0000644000000000000000000005345411507222722021066 0ustar rootrootµ­¹æ¤Î°ÕÌ£: i, l, s ¤Ï¡¢xxx_proto.c ¤Î°·¤¦¥Õ¥©¡¼¥Þ¥Ã¥Èʸ»ú i: 32bit À°¿ô l: 64bit À°¿ô s: Ǥ°ÕŤÎʸ»úÎó (Ťµ¤Ï 32bit À°¿ô¤Çɽ¸½) b: Ǥ°ÕĹ¤Î¥Ð¥¤¥Ê¥ê¥Ç¡¼¥¿ (Ťµ¤Ï 32bit À°¿ô¤Çɽ¸½) ¥Õ¥©¡¼¥Þ¥Ã¥Èʸ»ú[ÊÑ¿ô] ¤Ï¡¢ ¡Ö¤½¤Î¥Õ¥©¡¼¥Þ¥Ã¥Èʸ»ú¤ËÂбþ¤¹¤ë·¿¡×¤Î¡ÖÊÑ¿ô¡×²ó¤Î·«¤êÊÖ¤·¡£ Îã: s[npaths] ¡Ä ʸ»úÎó(s) ¤Î npaths ²ó¤Î·«¤êÊÖ¤· ------------------------------------------------------------------------ ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¡¼¥×¥í¥È¥³¥ë Àܳ»þ: canonical_host, (job id, paralleism, index, pid) ¤òÅϤ¹ ¢ª ¥³¥Þ¥ó¥Éµ¯Æ°»þ¤Î¥ª¥×¥·¥ç¥ó¤È¤·¤Æ --gfarm_nfrag, --gfarm_index ¤Î¾¤Ë --gfarm_job ¤òÁý¤ä¤¹ ´ÉÍý¼Ô: ¥°¥ë¡¼¥×¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ç¡¢"gfadmin" ¥°¥ë¡¼¥×¤Ë°¤¹¤ë¥æ¡¼¥¶¡¼ ¾õÂÖ COMPOUND ¤ÎÆâ¦¤Ç¤Ï¡¢ 2¤Ä¤Î file descriptor ¤òÆâÉô¾õÂ֤Ȥ·¤Æ¤â¤Ä¡£ ¿¤¯¤ÎÁàºî¤Ï current file descriptor ¤òÂоݤȤ¹¤ë¡£ - current file descriptor - saved file descriptor ¤³¤ì¤é¤Ï¡¢°Ê²¼¤Î¾ì¹ç¤Ë¡¢¼«Æ°Åª¤Ë CLOSE ¤µ¤ì¤ë¡£ - COMPOUND ¤ò½ªÎ»¤·¤¿»þ - ¾¤Î file descriptor ¤Ç¾å½ñ¤­¤µ¤ì¤¿»þ ¤¿¤À¤·¡¢³°Éô²½¤µ¤ì¤¿ ¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ò½ü¤¯¡£ ³°Éô²½¤µ¤ì¤¿¥Ç¥£¥¹¥¯¥ê¥×¥¿¤È¤Ï¡¢²¼µ­¤Î¤â¤Î¤ò»Ø¤¹¡£ - GET_FD ¤Ç³°Éô²½¤µ¤ì¤¿¤â¤Î¡£ - PUT_FD ¤Ç³°Éô¤«¤éÅϤµ¤ì¤¿¤â¤Î¡£ ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿ÁàºîÅù GFM_PROTO_COMPOUND_BEGIN ÆþÎÏ: ¤Ê¤· ½ÐÎÏ: i:¥¨¥é¡¼ ¢¨ ¤¿¤È¤¨(¥Í¥¹¥Æ¥£¥ó¥°¤¬¿¼¤¤Åù¤ÎÍýͳ¤Ç)¼ºÇÔ¤·¤¿¾ì¹ç¤Ç¤â¡¢ ¤³¤Î¼¡¤Î GFM_PROTO_COMPOUND_END ¤Þ¤Çɬ¤ºÆÉ¤ß¤È¤Ð¤¹ GFM_PROTO_COMPOUND_END ÆþÎÏ: ¤Ê¤· ½ÐÎÏ: i:¥¨¥é¡¼ GFM_PROTO_COMPOUND_ON_ERROR ÆþÎÏ: i:Âоݥ¨¥é¡¼¥³¡¼¥É ½ÐÎÏ: i:¥¨¥é¡¼ ¢¨ ¤¿¤È¤¨(Ʊ¤¸¥¨¥é¡¼¥³¡¼¥É¤òÊ£¿ô²ó»ØÄꤷ¤¿Åù¤ÎÍýͳ¤Ç) ¼ºÇÔ¤·¤¿¾ì¹ç¤Ç¤â¡¢ ¤³¤Î¼¡¤Î GFM_PROTO_COMPOUND_{ON_ERROR,END} ¤Þ¤Ç ɬ¤ºÆÉ¤ß¤È¤Ð¤¹ GFM_PROTO_GET_FD °ÅÌÛ¤ÎÆþÎÏ: i:current file descriptor ÆþÎÏ: ¤Ê¤· ½ÐÎÏ: i:¥¨¥é¡¼ ¥¨¥é¡¼ == GFARM_ERR_NO_ERROR ¤Î¾ì¹ç: i:fd ÉûºîÍÑ (À®¸ù»þ): current file descriptor ¤Ï³°Éô²½¤µ¤ì¤ë¤¿¤á¡¢ ¼«Æ°Åª¤Ë CLOSE ¤µ¤ì¤Ê¤¯¤Ê¤ë¡£ ¢¨ ¥¨¥é¡¼¤È¤·¤Æ GFARM_ERR_TOO_MANY_OPEN_FILES ¤âÀ¸¤¸¤ë²ÄǽÀ­¤¬¤¢¤ë¡£ ¢¨ ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òÀ°¿ôÃͤȤ·¤ÆÆÉ¤ß¤È¤ëÍ£°ì¤ÎÁàºî GFM_PROTO_PUT_FD ÆþÎÏ: i:file_descriptor ½ÐÎÏ: i:¥¨¥é¡¼ ÉûºîÍÑ (À®¸ù»þ): current file descriptor <- new file_descriptor ¢¨ current file descriptor ¤Ï³°Éô²½¤µ¤ì¤Æ¤¤¤ë¤¿¤á¡¢ ¼«Æ°Åª¤Ë¤Ï CLOSE ¤µ¤ì¤Ê¤¤¡£ GFM_PROTO_SAVE_FD °ÅÌÛ¤ÎÆþÎÏ: i:current file descriptor ÆþÎÏ: ¤Ê¤· ½ÐÎÏ: i:¥¨¥é¡¼ ÉûºîÍÑ (À®¸ù»þ): saved file descriptor <- current file descriptor ¢¨ current file descriptor ¤ÎÃͤÏÊѤï¤é¤Ê¤¤¡£ GFM_PROTO_RESTORE_FD °ÅÌÛ¤ÎÆþÎÏ: i:saved file descriptor ÆþÎÏ: ¤Ê¤· ½ÐÎÏ: i:¥¨¥é¡¼ ÉûºîÍÑ (À®¸ù»þ): current file descriptor <- saved file descriptor ¢¨ saved file descriptor ¤ÎÃͤÏÊѤï¤é¤Ê¤¤¡£ GFM_PROTO_VERIFY_TYPE_NOT °ÅÌÛ¤ÎÆþÎÏ: i:current file descriptor (target) ÆþÎÏ: i:¥¿¥¤¥× ½ÐÎÏ: i:¥¨¥é¡¼ ¢¨ ¥¿¥¤¥×¤È¤·¤Æ¥Ç¥£¥ì¥¯¥È¥ê¤ò»ØÄꤷ¤¿¾ì¹ç¡¢ ¥¨¥é¡¼¤Ï GFARM_ERR_IS_A_DIRECTORY ¥¿¥¤¥×¤È¤·¤Æ¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤ò»ØÄꤷ¤¿¾ì¹ç¡¢ ¥¨¥é¡¼¤Ï GFARM_ERR_IS_A_SYMBOLIC_LINK GFM_PROTO_VERIFY_TYPE °ÅÌÛ¤ÎÆþÎÏ: i:current file descriptor (target) ÆþÎÏ: i:¥¿¥¤¥× ½ÐÎÏ: i:¥¨¥é¡¼ ¢¨ ¥¿¥¤¥×¤È¤·¤Æ¥Ç¥£¥ì¥¯¥È¥ê¤ò»ØÄꤷ¤¿¾ì¹ç¡¢ ¥¨¥é¡¼¤Ï GFARM_ERR_NOT_A_DIRECTORY GFM_PROTO_BEQUEATH_FD °ÅÌÛ¤ÎÆþÎÏ: i:current file descriptor ÆþÎÏ: ¤Ê¤· ½ÐÎÏ: i:¥¨¥é¡¼ ÉûºîÍÑ (À®¸ù»þ): ¤½¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤ËÂФ¹¤ë¡¢ (GFM_PROTO_PROCESS_ALLOC_CHILD ¤ÇºîÀ®¤·¤¿)»Ò¥×¥í¥»¥¹¤«¤é¤Î ¥¢¥¯¥»¥¹¤òµö¤¹¡£ ¢¨ current file descriptor ¤Î³°Éô²½¤ò¼«Æ°Åª¤Ë¹Ô¤Ê¤¦¤³¤È¤Ï¤·¤Ê¤¤¡£ ¢¨ ¸½ºß¤Î¤È¤³¤í¡¢¥«¥ì¥ó¥È¥Ç¥£¥ì¥¯¥È¥ê¤Î¼õÅϤ·ÍÑÅӤȤ·¤Æ¤·¤« ¹Í¤¨¤Æ¤¤¤Ê¤¤¡£ GFM_PROTO_INHEIRIT_FD ÆþÎÏ: i:¿Æ¤Îfile descriptorÈÖ¹æ ½ÐÎÏ: i:¥¨¥é¡¼ ÉûºîÍÑ (À®¸ù»þ): current file descriptor <- new file_descriptor ¢¨ current file descriptor ¤Î³°Éô²½¤ò¼«Æ°Åª¤Ë¹Ô¤Ê¤¦¤³¤È¤Ï¤·¤Ê¤¤¡£ ¢¨ ¿Æ¤Îfile descriptorÈֹ椬¡¢GFM_PROTO_BEQUEATH_FD ¤Ç »ØÄꤵ¤ì¤¿¤â¤Î°Ê³°¤À¤Ã¤¿¤é¡¢GFARM_ERR_BAD_FILE_DESCRIPTOR ¢¨ »Ò¥×¥í¥»¥¹¤¬¡¢GFM_PROTO_PROCESS_ALLOC_CHILD ¤¹¤ëÁ°¡¢ ¤¢¤ë¤¤¤Ï GFM_PROTO_INHERIT_FD ¤¹¤ëÁ°¤Ë¡¢¿Æ¥×¥í¥»¥¹¤¬½ªÎ»¤·¤Æ ¤·¤Þ¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢Àµ¤·¤¯Æ°ºî¤·¤Ê¤¤¤È¤¤¤¦ÌäÂ꤬¤¢¤ë¡£ ¢¨ ¸½ºß¤Î¤È¤³¤í¡¢¥«¥ì¥ó¥È¥Ç¥£¥ì¥¯¥È¥ê¤Î¼õÅϤ·ÍÑÅӤȤ·¤Æ¤·¤« ¹Í¤¨¤Æ¤¤¤Ê¤¤¡£ gfs ·Ï / ¥¯¥é¥¤¥¢¥ó¥È¤«¤é¤Î¥¢¥¯¥»¥¹ GFM_PROTO_CREATE °ÅÌÛ¤ÎÆþÎÏ: i:current file descriptor (target directory) ÆþÎÏ: s:name, i:flags, i: mode ½ÐÎÏ: i:¥¨¥é¡¼ ¥¨¥é¡¼ == GFARM_ERR_NO_ERROR ¤Î¾ì¹ç: l:i_node_number, l:generation, i:mode ÉûºîÍÑ (À®¸ù»þ): current file descriptor <- new file_descriptor ¢¨ GFM_PROTO_OPEN ¤â»²¾È ¢¨ current file descriptor ¤¬¥Ç¥£¥ì¥¯¥È¥ê¤«¤É¤¦¤«¤ò¸¡ºº¤¹¤ë¡£ ¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤±¤ì¤Ð GFARM_ERR_NOT_A_DIRECTORY ¤òÊÖ¤¹¡£ ¢¨ ¥Ç¥£¥ì¥¯¥È¥ê¤ËÂФ·¤Æ¤Ï LOOKUP ¤« RDONLY ¤·¤«µö¤µ¤Ê¤¤¡£ ¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤ËÂФ·¤Æ¤Ï LOOKUP ¤·¤«µö¤µ¤Ê¤¤¡£ ¢¨ ´û¸¤Î¥Ç¥£¥ì¥¯¥È¥ê¤ËÂФ·¤Æ¹Ô¤Ê¤Ã¤¿¾ì¹ç¤Ë¤ÏÀ®¸ù¤¹¤ë¡£ GFM_PROTO_OPEN °ÅÌÛ¤ÎÆþÎÏ: i:current file descriptor (target directory) ÆþÎÏ: s:name, i:flags ½ÐÎÏ: i:¥¨¥é¡¼ ¥¨¥é¡¼ == GFARM_ERR_NO_ERROR ¤Î¾ì¹ç: l:i_node_number, l:generation, i:mode ÉûºîÍÑ (À®¸ù»þ): current file descriptor <- new file_descriptor ¢¨ GFM_PROTO_CREATE ¤â»²¾È ¢¨ current file descriptor ¤¬¥Ç¥£¥ì¥¯¥È¥ê¤«¤É¤¦¤«¤ò¸¡ºº¤¹¤ë¡£ ¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤±¤ì¤Ð GFARM_ERR_NOT_A_DIRECTORY ¤òÊÖ¤¹¡£ ¢¨ ¥Ç¥£¥ì¥¯¥È¥ê¤ËÂФ·¤Æ¤Ï LOOKUP ¤« RDONLY ¤·¤«µö¤µ¤Ê¤¤¡£ ¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤ËÂФ·¤Æ¤Ï LOOKUP ¤·¤«µö¤µ¤Ê¤¤¡£ GFM_PROTO_OPEN_ROOT ÆþÎÏ: i:flags ½ÐÎÏ: i:¥¨¥é¡¼ ÉûºîÍÑ (À®¸ù»þ): current file descriptor <- new file_descriptor ¢¨ flags ¤Ï¡¢GFARM_FILE_LOOKUP ¤¢¤ë¤¤¤Ï GFARM_FILE_RDONLY ¤Î¤ß GFM_PROTO_OPEN_PARENT °ÅÌÛ¤ÎÆþÎÏ: i:current file descriptor (target directory) ÆþÎÏ: i:flags ½ÐÎÏ: i:¥¨¥é¡¼ ÉûºîÍÑ (À®¸ù»þ): current file descriptor <- new file_descriptor ¢¨ current file descriptor ¤¬¥Ç¥£¥ì¥¯¥È¥ê¤«¤É¤¦¤«¤ò¸¡ºº¤¹¤ë¡£ ¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤±¤ì¤Ð GFARM_ERR_NOT_A_DIRECTORY ¤òÊÖ¤¹¡£ ¢¨ flags ¤Ï¡¢GFARM_FILE_LOOKUP ¤¢¤ë¤¤¤Ï GFARM_FILE_RDONLY ¤Î¤ß GFM_PROTO_FCHMOD °ÅÌÛ¤ÎÆþÎÏ: i:current file descriptor ÆþÎÏ: i: mode ½ÐÎÏ: i:¥¨¥é¡¼ GFM_PROTO_FCHOWN °ÅÌÛ¤ÎÆþÎÏ: i:current file descriptor ÆþÎÏ: s: user, s:group ½ÐÎÏ: i:¥¨¥é¡¼ ¢¨ ´ÉÍý¼Ô¸¢¸Â¤¬É¬Í× GFM_PROTO_REMOVE °ÅÌÛ¤ÎÆþÎÏ: i:current file descriptor (target directory) ÆþÎÏ: s:target ½ÐÎÏ: i:¥¨¥é¡¼ GFM_PROTO_RENAME °ÅÌÛ¤ÎÆþÎÏ: i:saved file descriptor (source directory) i:current file descriptor (target directory) ÆþÎÏ: s:src_name, s: target_name ½ÐÎÏ: i:¥¨¥é¡¼ GFM_PROTO_FLINK °ÅÌÛ¤ÎÆþÎÏ: i:saved file descriptor (content) i:current file descriptor (target directory) ÆþÎÏ: s:target_name ½ÐÎÏ: i:¥¨¥é¡¼ ¢¨ current file descriptor ¤¬¥Ç¥£¥ì¥¯¥È¥ê¤«¤É¤¦¤«¤ò¸¡ºº¤¹¤ë¡£ ¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤¢¤ì¤Ð GFARM_ERR_IS_A_DIRECTORY ¤òÊÖ¤¹¡£ GFM_PROTO_MKDIR °ÅÌÛ¤ÎÆþÎÏ: i:current file descriptor (target directory) ÆþÎÏ: s: name, i: mode ½ÐÎÏ: i:¥¨¥é¡¼ ¢¨ current file descriptor ¤¬¥Ç¥£¥ì¥¯¥È¥ê¤«¤É¤¦¤«¤ò¸¡ºº¤¹¤ë¡£ ¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤±¤ì¤Ð GFARM_ERR_NOT_A_DIRECTORY ¤òÊÖ¤¹¡£ GFM_PROTO_SYMLINK °ÅÌÛ¤ÎÆþÎÏ: i:current file descriptor (directory to create the link) ÆþÎÏ: s:source_path, s: new_name ½ÐÎÏ: i:¥¨¥é¡¼ ¢¨ current file descriptor ¤¬¥Ç¥£¥ì¥¯¥È¥ê¤«¤É¤¦¤«¤ò¸¡ºº¤¹¤ë¡£ ¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤±¤ì¤Ð GFARM_ERR_NOT_A_DIRECTORY ¤òÊÖ¤¹¡£ GFM_PROTO_READLINK °ÅÌÛ¤ÎÆþÎÏ: i:current file descriptor (symbolic link) ÆþÎÏ: ¤Ê¤· ½ÐÎÏ: i:¥¨¥é¡¼ ¥¨¥é¡¼ == GFARM_ERR_NO_ERROR ¤Î¾ì¹ç: s:target_path ¢¨ current file descriptor ¤¬¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤«¤É¤¦¤«¤ò¸¡ºº¤¹¤ë¡£ ¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤±¤ì¤Ð GFARM_ERR_INVAILD_ARGUMENT ¤òÊÖ¤¹¡£ GFM_PROTO_GETDIRPATH °ÅÌÛ¤ÎÆþÎÏ: i:current file descriptor (target directory) ÆþÎÏ: ¤Ê¤· ½ÐÎÏ: i:¥¨¥é¡¼ ¥¨¥é¡¼ == GFARM_ERR_NO_ERROR ¤Î¾ì¹ç: s:path ¢¨ current file descriptor ¤¬¥Ç¥£¥ì¥¯¥È¥ê¤«¤É¤¦¤«¤ò¸¡ºº¤¹¤ë¡£ ¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤±¤ì¤Ð GFARM_ERR_NOT_A_DIRECTORY ¤òÊÖ¤¹¡£ GFM_PROTO_GETDIRENTS °ÅÌÛ¤ÎÆþÎÏ: i:current file descriptor (target directory) ÆþÎÏ: i:n_entries, ½ÐÎÏ: i:¥¨¥é¡¼ ¥¨¥é¡¼ == GFARM_ERR_NO_ERROR ¤Î¾ì¹ç: i:n_entries, s[n_entries]:ent_names, i[n_entries]:ent_types, l[n_entries]:inode_numbers ¢¨ n_entries == 0 ¤òÊÖ¤·¤¿»þ¤¬¡¢¥Ç¥£¥ì¥¯¥È¥ê¤ÎËöÈø ¢¨ current file descriptor ¤¬¥Ç¥£¥ì¥¯¥È¥ê¤«¤É¤¦¤«¤ò¸¡ºº¤¹¤ë¡£ ¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤±¤ì¤Ð GFARM_ERR_NOT_A_DIRECTORY ¤òÊÖ¤¹¡£ GFM_PROTO_SEEK °ÅÌÛ¤ÎÆþÎÏ: i:current file descriptor (target directory) ÆþÎÏ: l:offset, i:whence ½ÐÎÏ: i:¥¨¥é¡¼, ¥¨¥é¡¼ == GFARM_ERR_NO_ERROR ¤Î¾ì¹ç: l:offset ¢¨ current file descriptor ¤¬¥Ç¥£¥ì¥¯¥È¥ê¤«¤É¤¦¤«¤ò¸¡ºº¤¹¤ë¡£ ¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤±¤ì¤Ð GFARM_ERR_NOT_A_DIRECTORY ¤òÊÖ¤¹¡£ GFM_PROTO_GETDIRENTSPLUS °ÅÌÛ¤ÎÆþÎÏ: i:current file descriptor (target directory) ÆþÎÏ: i:n_entries, ½ÐÎÏ: i:¥¨¥é¡¼ ¥¨¥é¡¼ == GFARM_ERR_NO_ERROR ¤Î¾ì¹ç: i:n_entries ²¼µ­¤Î¡¢n_entries ²ó¤Î·«¤êÊÖ¤·: s:entry_name, l:i_node_number, l:generation, i:mode, l:nlinks, s:user, s:group, l:size, l:ncopies, l:atime_sec, i:atime_nsec, l:mtime_sec, i:mtime_nsec, l:ctime_sec, i:ctime_nsec ¢¨ n_entries == 0 ¤òÊÖ¤·¤¿»þ¤¬¡¢¥Ç¥£¥ì¥¯¥È¥ê¤ÎËöÈø ¢¨ current file descriptor ¤¬¥Ç¥£¥ì¥¯¥È¥ê¤«¤É¤¦¤«¤ò¸¡ºº¤¹¤ë¡£ ¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤±¤ì¤Ð GFARM_ERR_NOT_A_DIRECTORY ¤òÊÖ¤¹¡£ GFM_PROTO_XATTR_SET GFM_PROTO_XMLATTR_SET °ÅÌÛ¤ÎÆþÎÏ: i:current file descriptor (target file) ÆþÎÏ: s:name, B:value i:flags ½ÐÎÏ: i:¥¨¥é¡¼ GFM_PROTO_XATTR_GET GFM_PROTO_XMLATTR_GET °ÅÌÛ¤ÎÆþÎÏ: i:current file descriptor (target file) ÆþÎÏ: s:name ½ÐÎÏ: i:¥¨¥é¡¼, b:value ¢¨ ³Èĥ°À­¥Ç¡¼¥¿¤Î¥µ¥¤¥ºÌ䤤¹ç¤ï¤»¤Ï¤Ê¤¤¡£ GFM_PROTO_XATTR_REMOVE GFM_PROTO_XMLATTR_REMOVE °ÅÌÛ¤ÎÆþÎÏ: i:current file descriptor (target file) ÆþÎÏ: s:name ½ÐÎÏ: i:¥¨¥é¡¼ GFM_PROTO_XATTR_LIST GFM_PROTO_XMLATTR_LIST °ÅÌÛ¤ÎÆþÎÏ: i:current file descriptor (target file) ÆþÎÏ: ¤Ê¤· ½ÐÎÏ: i:¥¨¥é¡¼, b:value ¢¨ ³Èĥ°À­Ì¾¤ò\0¤Ç¶èÀڤä¿Ê¸»úÎó¤òÊÖ¤¹¡£ GFM_PROTO_XMLATTR_FIND °ÅÌÛ¤ÎÆþÎÏ: i:current file descriptor (target file) ÆþÎÏ: s:expr, i:depth, i:nentry, s:cookie_path, s:cookie_name ½ÐÎÏ: i:¥¨¥é¡¼, i:eof,i:n_entries, s[n_entries]:path, s[n_entries]:name ¢¨ ¥µ¥¤¥ºÌ䤤¹ç¤ï¤»¤Ï¤Ê¤¤¡£ Í׵᥵¥¤¥º¤Ë¶á¤¤Å¬Åö¤Ê¶èÀÚ¤ê¤Î̾Á°¤Þ¤Ç¤òÊÖ¤¹¡£ entry ¤Ï ³Èĥ°À­¤ò»ý¤Ä¥Õ¥¡¥¤¥ë¤ÎÁêÂХѥ¹¤È³Èĥ°À­Ì¾¤«¤éÀ®¤ë¡£ Í×µá¥Õ¥¡¥¤¥ë¼«¿È¤Î³Èĥ°À­¤Î»þ¤Ë¤Ï¥Ñ¥¹¤Ï"."¤È¤¹¤ë¡£ Í×µá¤Îcookie¤Ïentry¤Ç¡¢½é²ó¤ÎÍ×µá¤Ç¤Ï³Èĥ°À­Ì¾¤¬NULL¤ò¤·¤á¤¹¡£ ·Ñ³Í×µá¤Î¾ì¹ç¤Ï¡¢ºÇ¸å¤ËÊÖ¤µ¤ì¤¿entry¤òcookie¤È¤·¤ÆÅϤ¹¡£ eof ¤Î¾ì¹ç¤Ï eof ¥Õ¥é¥°¤¬1¤Ç¤¢¤ë¡£ GFM_PROTO_CKSUM_GET °ÅÌÛ¤ÎÆþÎÏ: i:current file descriptor (target file) ½ÐÎÏ: i:¥¨¥é¡¼ ¥¨¥é¡¼ == GFARM_ERR_NO_ERROR ¤Î¾ì¹ç: s:cksum_type, b:cksum, i:flags ¥Á¥§¥Ã¥¯¥µ¥à¤¬¤Ê¤¤¾ì¹ç¤Ï¡¢cksum_type == "", cksum = [] ¤È¤Ê¤ë¡£ ¢¨ flags ¤Ë¤Ï¡¢²¼µ­¤Î¾ðÊ󤬴ޤޤì¤ë¡£ ¤³¤Î¥ì¥×¥ê¥«¤¬¸½ºß½ñ¤­¹þ¤ß¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¤« GFM_PROTO_CKSUM_SET °ÅÌÛ¤ÎÆþÎÏ: i:current file descriptor (target file) ÆþÎÏ: s:cksum_type, b:cksum i:flags, l:mtime_sec, i:mtime_nsec ½ÐÎÏ: i:¥¨¥é¡¼ ¢¨ flags ¤Ë¤Ï¡¢²¼µ­¤Î¾ðÊ󤬴ޤޤì¤ë mtime_{,n}sec ¤¬Í­¸ú¤« ¡Ä ¤½¤Î¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ë½ñ¤­¹þ¤ß¤¬¹Ô¤Ê¤ï¤ì¤¿¾ì¹ç¤Ë¿¿ GFM_PROTO_SCHEDULE_FILE °ÅÌÛ¤ÎÆþÎÏ: i:current file descriptor (file) ÆþÎÏ: s:domain ½ÐÎÏ: i:¥¨¥é¡¼ ¥¨¥é¡¼ == GFARM_ERR_NO_ERROR ¤Î¾ì¹ç: i:n_hosts, ²¼µ­¤Î¡¢n_hosts ²ó¤Î·«¤êÊÖ¤·: s:host, i:port, i:loadavg*65536, l:cache_time, l:usedsize, l:availsize, l:rtt_cache_time, i:rtt_usec, i:rtt_flags ¢¨ ¸õÊä¤È¤Ê¤ë¥Û¥¹¥È¤Î¥ê¥¹¥È¤òÊÖ¤¹ ¢¨ domain ¥Ñ¥é¥á¡¼¥¿¤¬¤¢¤Ã¤¿Êý¤¬Îɤ¤? ¢¨ ¥Û¥¹¥È¿ô¤òÀ©¸Â¤¹¤ë¤Ë¤Ï¡© GFM_PROTO_SCHEDULE_FILE_WITH_PROGRAM °ÅÌÛ¤ÎÆþÎÏ: i:saved file descriptor (program) i:current file descriptor (file) ÆþÎÏ: s:domain ½ÐÎÏ: i:¥¨¥é¡¼ ¥¨¥é¡¼ == GFARM_ERR_NO_ERROR ¤Î¾ì¹ç: i:n_hosts, ²¼µ­¤Î¡¢n_hosts ²ó¤Î·«¤êÊÖ¤·: s:host, i:port, i:loadavg*65536, l:cache_time, l:usedsize, l:availsize, l:rtt_cache_time, i:rtt_usec, i:rtt_flags ¢¨ ¸õÊä¤È¤Ê¤ë¥Û¥¹¥È¤Î¥ê¥¹¥È¤òÊÖ¤¹ ¢¨ domain ¥Ñ¥é¥á¡¼¥¿¤¬¤¢¤Ã¤¿Êý¤¬Îɤ¤? ¢¨ ¥Û¥¹¥È¿ô¤òÀ©¸Â¤¹¤ë¤Ë¤Ï¡© GFM_PROTO_REPLICA_LIST_BY_NAME °ÅÌÛ¤ÎÆþÎÏ: i:current file descriptor ÆþÎÏ: ¤Ê¤· ½ÐÎÏ: i:¥¨¥é¡¼ ¥¨¥é¡¼ == GFARM_ERR_NO_ERROR ¤Î¾ì¹ç: i:n_replicas, s[n_replicas]:replica_hosts, i[n_replicas]:replica_ports GFM_PROTO_REPLICA_LIST_BY_HOST ÆþÎÏ: s:host, i:port ½ÐÎÏ: i:¥¨¥é¡¼ ¥¨¥é¡¼ == GFARM_ERR_NO_ERROR ¤Î¾ì¹ç: i:n_replicas, o[n_replicas]:i_node_numbers ¢¨ ´ÉÍý¼Ô¸¢¸Â¤¬É¬Í× GFM_PROTO_REPLICA_REMOVE_BY_HOST ÆþÎÏ: s:host, i:port ½ÐÎÏ: i:¥¨¥é¡¼ ¢¨ ´ÉÍý¼Ô¸¢¸Â¤¬É¬Í× gfs ·Ï / gfsd ¤«¤é¤Î¥¢¥¯¥»¥¹ CERT: ¥Û¥¹¥È¾ÚÌÀ½ñ/LDAP¾ÚÌÀ½ñÎà»÷¤Î¡¢gfsd¾ÚÌÀ½ñ¤ò¤Ä¤¯¤ë GFM_PROTO_REOPEN °ÅÌÛ¤ÎÆþÎÏ: i:current file descriptor ½ÐÎÏ: i:¥¨¥é¡¼ ¥¨¥é¡¼ == GFARM_ERR_NO_ERROR ¤Î¾ì¹ç: l:i_node_number, l:generation, i:mode, i:flags, i:to_create ¢¨ GFM_PROTO_OPEN, GFM_PROTO_CREATE ¤Î¤É¤Á¤é¤Î¾ì¹ç¤â ¤³¤ì¤òÍѤ¤¤ë¡£ ¢ª gfarm-v2-outline: [old-replica] ¤â»²¾È GFM_PROTO_CLOSE_READ °ÅÌÛ¤ÎÆþÎÏ: i:current file descriptor ÆþÎÏ: l:atime_sec, i:atime_nsec ½ÐÎÏ: i:¥¨¥é¡¼ ¢¨ GFM_PROTO_CLOSE, GFM_PROTO_CLOSE_WRITE ¤â»²¾È GFM_PROTO_CLOSE_WRITE °ÅÌÛ¤ÎÆþÎÏ: i:current file descriptor ÆþÎÏ: l:size l:atime_sec, i:atime_nsec l:mtime_sec, i:mtime_nsec ½ÐÎÏ: i:¥¨¥é¡¼ ¢¨ GFM_PROTO_CLOSE, GFM_PROTO_CLOSE_READ ¤â»²¾È ¢ª gfarm-v2-outline: [invalidate-replica] ¤â»²¾È GFM_PROTO_LOCK °ÅÌÛ¤ÎÆþÎÏ: i:current file descriptor ÆþÎÏ: l:start, l:len, i:type, i:whence ½ÐÎÏ: i:¥¨¥é¡¼ GFM_PROTO_TRYLOCK °ÅÌÛ¤ÎÆþÎÏ: i:current file descriptor ÆþÎÏ: l:start, l:len, i:type, i:whence ½ÐÎÏ: i:¥¨¥é¡¼ GFM_PROTO_UNLOCK °ÅÌÛ¤ÎÆþÎÏ: i:current file descriptor ÆþÎÏ: l:start, l:len, i:type, i:whence ½ÐÎÏ: i:¥¨¥é¡¼ GFM_PROTO_LOCK_INFO °ÅÌÛ¤ÎÆþÎÏ: i:current file descriptor ÆþÎÏ: l:start, l:len, i:type, i:whence ½ÐÎÏ: i:¥¨¥é¡¼ ¥¨¥é¡¼ == GFARM_ERR_NO_ERROR ¤Î¾ì¹ç: l:start, l:len, i:type, s:host, l:pid GFM_PROTO_REPLICA_ADDING °ÅÌÛ¤ÎÆþÎÏ: i:current file descriptor ½ÐÎÏ: i:¥¨¥é¡¼ ¥¨¥é¡¼ == GFARM_ERR_NO_ERROR ¤Î¾ì¹ç: l:i_node_number, l:generation, l:st_mtime_sec, i:st_mtime_nsec GFM_PROTO_REPLICA_ADDED °ÅÌÛ¤ÎÆþÎÏ: i:current file descriptor ÆþÎÏ: i:flags, l:st_mtime_sec, i:st_mtime_nsec ½ÐÎÏ: i:¥¨¥é¡¼ ¢¨ flags ¤Ë¤Ï¡¢²¼µ­¤Î¾ðÊ󤬴ޤޤì¤ë mtime_{,n}sec ¤¬Í­¸ú¤« ¡Ä Ê£À½¸µ¥Î¡¼¥É¤Ç½ñ¤­¹þ¤ß¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¿¿ GFM_PROTO_REPLICA_LOST ÆþÎÏ: l:i_node_number, l:generation ½ÐÎÏ: i:¥¨¥é¡¼ gfs ·Ï / ¥¯¥é¥¤¥¢¥ó¥È¤È gfsd ¤ÎξÊý¤«¤é¤Î¥¢¥¯¥»¥¹ GFM_PROTO_CLOSE °ÅÌÛ¤ÎÆþÎÏ: i:current file descriptor ÆþÎÏ: ¤Ê¤· ½ÐÎÏ: i:¥¨¥é¡¼ ¢¨ GFM_PROTO_CLOSE_READ, GFM_PROTO_CLOSE_WRITE ¤â»²¾È GFM_PROTO_FSTAT °ÅÌÛ¤ÎÆþÎÏ: i:current file descriptor ÆþÎÏ: ¤Ê¤· ½ÐÎÏ: i:¥¨¥é¡¼ ¥¨¥é¡¼ == GFARM_ERR_NO_ERROR ¤Î¾ì¹ç: l:i_node_number, l:generation, i:mode, l:nlinks, s:user, s:group, l:size, l:ncopies, l:atime_sec, i:atime_nsec, l:mtime_sec, i:mtime_nsec, l:ctime_sec, i:ctime_nsec GFM_PROTO_FUTIMES °ÅÌÛ¤ÎÆþÎÏ: i:current file descriptor ÆþÎÏ: l:atime_sec, i:atime_nsec, l:mtime_sec, i:mtime_nsec ½ÐÎÏ: i:¥¨¥é¡¼ gfs_pio ·Ï GFM_PROTO_GLOB XXX need to rethink ÆþÎÏ: i:n_globs, s[n_globs]:globs ½ÐÎÏ: i:¥¨¥é¡¼ ¥¨¥é¡¼ == GFARM_ERR_NO_ERROR ¤Î¾ì¹ç: ²¼µ­¤Î¡¢n_globs ²ó¤Î·«¤êÊÖ¤·: i:¥¨¥é¡¼ ¥¨¥é¡¼ == GFARM_ERR_NO_ERROR ¤Î¾ì¹ç: i:n_entries, s[n_entries]:entries, i[n_entries]:ent_types, l[n_entries]:inode_numbers ¢¨ Ê£¿ô¤Î glob ¤òÍ¿¤¨¤é¤ì¤ë¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤È¤·¤Æ¤¤¤ë¤Î¤Ï round trip ¤Î²ó¿ô¤ò¸º¤é¤¹¤¿¤á GFM_PROTO_SCHEDULE XXX need to rethink ÆþÎÏ: i:n, s:gfarm_program, s:parallel_file, s:domain, mode:open_mode ½ÐÎÏ: i:¥¨¥é¡¼ ¥¨¥é¡¼ == GFARM_ERR_NO_ERROR ¤Î¾ì¹ç: i:n_hosts ²¼µ­¤Î¡¢n_hosts ²ó¤Î·«¤êÊÖ¤·: s:hostname, i:n_host_aliases, s[n_host_aliases]:host_aliases, s:architecture, i:ncpu, i:port, i:flags ¢¨ gfarm_program/parallel_file/domain ¤ÏÁ´¤Æ "" ¤Ç¤âÎɤ¤ ¤Þ¤¿ n ¤â 0 ¤Ç¤âÎɤ¤¡£ ¤½¤Î¾ì¹ç¡¢¤³¤ì¤é¤Î¥Ñ¥é¥á¡¼¥¿¤Ï̵»ë¤µ¤ì¤ë¡£ ¤µ¤â¤Ê¤¯¤Ð AND ¾ò·ï¤È¸«¤Ê¤µ¤ì¤ë¡£ open_mode ¤Ë¤Ï¡¢CPU³ä¤êÅö¤Æ¤¬É¬Íפ«¡¢½ñ¤­¹þ¤ß¤¬É¬Íפ«Åù ¤Î¾ðÊó¤òÅϤ¹¡£½ñ¤­¹þ¤ß¾ðÊó¤òÅϤ¹¤Î¤Ï¡¢½ñ¤­¹þ¤ß¤ò½¸Ã椵¤»¤ë¤¿¤á¡£ GFM_PROTO_PIO_OPEN XXX need to rethink ÆþÎÏ: s:parallel_file, i:open_flags ½ÐÎÏ: i:¥¨¥é¡¼ ¥¨¥é¡¼ == GFARM_ERR_NO_ERROR ¤Î¾ì¹ç: i:n_files, s[n_files]:filenames ÉûºîÍÑ (À®¸ù»þ): current file descriptor <- new file_descriptor ¢¨ parallel_file ¤¬ gfs °Ê³°¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥Ñ¥¹Ì¾¤ò´Þ¤à¾ì¹ç¡¢ n_files ¤Ï 0 ¤òÊÖ¤¹¡£¤³¤Î¾ì¹ç¡¢GFM_PROTO_PIO_SET_PATHS ¤Ç¡¢ parallel_file ¤¬É½¤¹¥Ñ¥¹Ì¾¤Î¥ê¥¹¥È¤òÅÁ¤¨¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ ¢¨ pio_open() ¤Ç¤Ï¡¢remove/rename ¤Ë´Ø¤¹¤ëposix semantics¤ÏÊݸ¤·¤Ê¤¤ open_flags ¤Ë¤Ï¡¢¾¯¤Ê¤¯¤È¤â write, create ¤ÏɬÍ× GFM_PROTO_PIO_SET_PATHS XXX need to rethink ÆþÎÏ: i:file_descriptor i:n_files, s[n_files]:filenames ½ÐÎÏ: i:¥¨¥é¡¼ GFM_PROTO_PIO_CLOSE XXX need to rethink °ÅÌÛ¤ÎÆþÎÏ: i:current file descriptor ÆþÎÏ: ¤Ê¤· ½ÐÎÏ: i:¥¨¥é¡¼ GFM_PROTO_PIO_VISIT °ÅÌÛ¤ÎÆþÎÏ: i:current file descriptor ÆþÎÏ: i:index ½ÐÎÏ: i:¥¨¥é¡¼ ¥¨¥é¡¼ == GFARM_ERR_NO_ERROR ¤Î¾ì¹ç: i:flags ¢¨ flags ¤Ë¤Ï¡¢²¼µ­¤Î¾ðÊ󤬴ޤޤì¤ë¡£ ¤½¤Î¥Õ¥é¥°¥á¥ó¥È¤ËÂФ¹¤ëºÇ½é¤ÎˬÌ䤫¡© ¥á¥¿¥Ç¡¼¥¿¡¦¥¢¥¯¥»¥¹ GFM_PROTO_HOST_INFO_GET_ALL ÆþÎÏ: ¤Ê¤· ½ÐÎÏ: i:¥¨¥é¡¼ ¥¨¥é¡¼ == GFARM_ERR_NO_ERROR ¤Î¾ì¹ç: i:n_hosts, ²¼µ­¤Î¡¢n_hosts ²ó¤Î·«¤êÊÖ¤·: s:hostname, i:n_host_aliases, s[n_host_aliases]:host_aliases, s:architecture, i:ncpu, i:port, i:flags GFM_PROTO_HOST_INFO_GET_BY_ARCHITECTURE ÆþÎÏ: s:architecture ½ÐÎÏ: i:n_hosts, ²¼µ­¤Î¡¢n_hosts ²ó¤Î·«¤êÊÖ¤·: s:hostname, i:n_host_aliases, s[n_host_aliases]:host_aliases, s:architecture, i:ncpu, i:port, i:flags GFM_PROTO_HOST_INFO_GET_BY_NAMES ÆþÎÏ: i: n_hostnames, s[n_hostnames]:hostnames ½ÐÎÏ: i:¥¨¥é¡¼ ¥¨¥é¡¼ == GFARM_ERR_NO_ERROR ¤Î¾ì¹ç: ²¼µ­¤Î¡¢n_hostnames ²ó¤Î·«¤êÊÖ¤·: i:¥¨¥é¡¼, ¥¨¥é¡¼ == GFARM_ERR_NO_ERROR ¤Î¾ì¹ç: s:hostname, i:n_host_aliases, s[n_host_aliases]:host_aliases, s:architecture, i:ncpu, i:port, i:flags GFM_PROTO_HOST_INFO_GET_BY_NAMEALIASES ÆþÎÏ: i: n_hostnames, s[n_hostnames]:hostnames ½ÐÎÏ: i:¥¨¥é¡¼ ¥¨¥é¡¼ == GFARM_ERR_NO_ERROR ¤Î¾ì¹ç: ²¼µ­¤Î¡¢n_hostnames ²ó¤Î·«¤êÊÖ¤·: i:¥¨¥é¡¼ ¥¨¥é¡¼ == GFARM_ERR_NO_ERROR ¤Î¾ì¹ç: s:hostname, i:n_host_aliases, s[n_host_aliases]:host_aliases, s:architecture, i:ncpu, i:port, i:flags GFM_PROTO_HOST_INFO_SET ÆþÎÏ: s:hostname, i:n_host_aliases, s[n_host_aliases]:host_aliases, s:architecture, i:ncpu, i:port, i:flags ½ÐÎÏ: i:¥¨¥é¡¼ ¢¨ ´ÉÍý¼Ô¸¢¸Â¤¬É¬Í× GFM_PROTO_HOST_INFO_MODIFY ÆþÎÏ: s:hostname, i:n_host_aliases, s[n_host_aliases]:host_aliases, s:architecture, i:ncpu, i:port, i:flags ½ÐÎÏ: i:¥¨¥é¡¼ ¢¨ ´ÉÍý¼Ô¸¢¸Â¤¬É¬Í× GFM_PROTO_HOST_INFO_REMOVE ÆþÎÏ: s:hostname ½ÐÎÏ: i:¥¨¥é¡¼ ¢¨ ´ÉÍý¼Ô¸¢¸Â¤¬É¬Í× GFM_PROTO_USER_INFO_GET_ALL ÆþÎÏ: ¤Ê¤· ½ÐÎÏ: i:n_users ²¼µ­¤Î¡¢n_users ²ó¤Î·«¤êÊÖ¤·: s:username, s:real_name, s:gfarm_homedir, s:gsi_dn GFM_PROTO_USER_INFO_GET_BY_NAMES ÆþÎÏ: i:n_usernames, s[n_usernames]:usernames ½ÐÎÏ: i:¥¨¥é¡¼ ¥¨¥é¡¼ == GFARM_ERR_NO_ERROR ¤Î¾ì¹ç: ²¼µ­¤Î¡¢n_usernames ²ó¤Î·«¤êÊÖ¤·: i:¥¨¥é¡¼ ¥¨¥é¡¼ == GFARM_ERR_NO_ERROR ¤Î¾ì¹ç: s:username, s:real_name, s:gfarm_homedir, s:gsi_dn ¢¨ gfsd ¤¬¤³¤Î¥×¥í¥È¥³¥ë¤òÍѤ¤¤ë¤Î¤òµö¤¹É¬Íפ¬¤¢¤ë¡£ ¤³¤ì¤Ï gfarm_metadb_verify_username() ¤ò¼ÂÁõ¤¹¤ë¤¿¤á¡£ GFM_PROTO_USER_INFO_SET ÆþÎÏ: s:username, s:real_name, s:gfarm_homedir, s:gsi_dn ½ÐÎÏ: i:¥¨¥é¡¼ ¢¨ ´ÉÍý¼Ô¸¢¸Â¤¬É¬Í× GFM_PROTO_USER_INFO_MODIFY ÆþÎÏ: s:username, s:real_name, s:gfarm_homedir, s:gsi_dn ½ÐÎÏ: i:¥¨¥é¡¼ ¢¨ ´ÉÍý¼Ô¸¢¸Â¤¬É¬Í× GFM_PROTO_USER_INFO_REMOVE ÆþÎÏ: s:username ½ÐÎÏ: i:¥¨¥é¡¼ ¢¨ ´ÉÍý¼Ô¸¢¸Â¤¬É¬Í× GFM_PROTO_GROUP_INFO_GET_ALL ÆþÎÏ: ¤Ê¤· ½ÐÎÏ: i:n_groups ²¼µ­¤Î¡¢n_groups ²ó¤Î·«¤êÊÖ¤·: s:groupname, i:n_users, s[n_users]:users GFM_PROTO_GROUP_INFO_GET_BY_NAMES ÆþÎÏ: i:n_groupnames, s[n_groupnames]:groupnames ½ÐÎÏ: i:¥¨¥é¡¼ ¥¨¥é¡¼ == GFARM_ERR_NO_ERROR ¤Î¾ì¹ç: ²¼µ­¤Î¡¢n_groupnames ²ó¤Î·«¤êÊÖ¤·: i:¥¨¥é¡¼ ¥¨¥é¡¼ == GFARM_ERR_NO_ERROR ¤Î¾ì¹ç: s:groupname, i:n_users, s[n_users]:users GFM_PROTO_GROUP_INFO_SET ÆþÎÏ: s:groupname, i:n_users, s[n_users]:users ½ÐÎÏ: i:¥¨¥é¡¼ ¢¨ ´ÉÍý¼Ô¸¢¸Â¤¬É¬Í× GFM_PROTO_GROUP_INFO_MODIFY ÆþÎÏ: s:groupname, i:n_users, s[n_users]:users ½ÐÎÏ: i:¥¨¥é¡¼ ¢¨ ´ÉÍý¼Ô¸¢¸Â¤¬É¬Í× GFM_PROTO_GROUP_INFO_REMOVE ÆþÎÏ: s:groupname ½ÐÎÏ: i:¥¨¥é¡¼ ¢¨ ´ÉÍý¼Ô¸¢¸Â¤¬É¬Í× GFM_PROTO_GROUP_INFO_ADD_USERS ÆþÎÏ: s:groupname, i:n_users, s[n_users]:users ½ÐÎÏ: i:¥¨¥é¡¼ i[n_users]:user¥¨¥é¡¼ ¢¨ ´ÉÍý¼Ô¸¢¸Â¤¬É¬Í× GFM_PROTO_GROUP_INFO_REMOVE_USERS ÆþÎÏ: s:groupname, i:n_users, s[n_users]:users ½ÐÎÏ: i:¥¨¥é¡¼ i[n_users]:user¥¨¥é¡¼ ¢¨ ´ÉÍý¼Ô¸¢¸Â¤¬É¬Í× GFM_PROTO_GROUP_NAMES_GET_BY_USERS ÆþÎÏ: i:n_usernames, s[n_usernames]:usernames ½ÐÎÏ: i:¥¨¥é¡¼ ¥¨¥é¡¼ == GFARM_ERR_NO_ERROR ¤Î¾ì¹ç: ²¼µ­¤Î¡¢n_usernames ²ó¤Î·«¤êÊÖ¤·: i:¥¨¥é¡¼ ¥¨¥é¡¼ == GFARM_ERR_NO_ERROR ¤Î¾ì¹ç: i:n_groups, s[n_groups]:groupnames replication manager ·Ï: ºï½ü¤¹¤ë¥ì¥×¥ê¥«¤òÆÀ¤ë gfsck ·Ï: ÆþÎÏ: ½ÐÎÏ: process ´ÉÍý·Ï GFM_PROTO_PROCESS_ALLOC ÆþÎÏ: i:key_type, b:shared_key ½ÐÎÏ: i:¥¨¥é¡¼ ¥¨¥é¡¼ == GFARM_ERR_NO_ERROR ¤Î¾ì¹ç: l:pid GFM_PROTO_PROCESS_ALLOC_CHILD ÆþÎÏ: i:parent_key_type, b:parent_shared_key, l:parent_pid, i:my_key_type, b:my_shared_key ½ÐÎÏ: i:¥¨¥é¡¼ ¥¨¥é¡¼ == GFARM_ERR_NO_ERROR ¤Î¾ì¹ç: l:my_pid ¢¨ ¿Æ¥×¥í¥»¥¹¤È»Ò¥×¥í¥»¥¹¤Î´Ö¤Ç¤Î¡¢¥«¥ì¥ó¥È¥Ç¥£¥ì¥¯¥È¥ê¤Î¼õÅϤ·¤Î ¤¿¤á¤Ë»È¤¦¡£GFM_PROTO_EXPORT_FD/GFM_PROTO_IMPORT_FD ¤â»²¾È¡£ GFM_PROTO_PROCESS_FREE ÆþÎÏ: ¤Ê¤· ½ÐÎÏ: i:¥¨¥é¡¼ GFM_PROTO_PROCESS_SET ÆþÎÏ: i:key_type, b:shared_key, l:pid ½ÐÎÏ: i:¥¨¥é¡¼ ------------------------------------------------------------------------ ¥á¥â ¥Õ¥¡¥¤¥ë¥ª¡¼¥×¥óÁàºî Îã: "dir1/dir2/file" GFM_PROTO_COMPOUND_BEGIN GFM_PROTO_PUT_FD(cwd_fd) GFM_PROTO_OPEN("dir1", LOOKUP) GFM_PROTO_OPEN("dir2", LOOKUP) GFM_PROTO_OPEN("file", RDONLY) GFM_PROTO_GET_FD: gfm_fd GFM_PROTO_COMPOUND_ON_ERROR(IS_A_SYMBOLIC_LINK) GFM_PROTO_READLINK GFM_PROTO_COMPOUND_END gfarm-2.4.1/doc/internal/ja/gfarm-v2-schema.gif0000644000000000000000000002475111507222722017642 0ustar rootrootGIF87aEO÷!"(01;BKV@I9HYkHY¤NW—@p„[nxŒ“‚ Pgov~Œ_grx|„ P k q y b l z d n Ž P X Y b i o { o | b‡{W7o{o~wdrIWf–!!†##%%w&&l&&…(&i,>9#;*"=4%E2FX¾IJØQQôRR÷RRøSSùSSúSSûTD}TTüTTýTTþUUÿ[Wæ\\þ^^ÿcdõddþfDPi\ÇjjýmmýrrürrÿwwþyoÎ{|ø||þ‚ú„+……ü‰‰ÿ‹e‹Šú‹™µ‘‘ÿ‘’ü—ïý£¢û¨¨ý­tS¯®ý²ÀÜ·¸ý¿¿þÃGÆÕâÊÄùËÍüÕ1DØÓïÞª“âqìAZóæáôõõö3H÷÷÷øøøùÓ¢ùùùúCXúúúûûûüüüýýýþþþÿì‹ÿÿÿ,EOþC H° Áƒ*\Ȱ¡Ã‡#JœH±¢Å‹3jÜȱ£Ç CŠI²¤É“(Sª\ɲ¥Ë—0cÊœI³¦Í›8sêÜɳ§ÏŸ@ƒ J´¨Ñ£H“*]Ê´©Ó§P£JJµªÕ«X³jÝʵ«×¯`ÊK¶¬Ù³hÓª]˶­Û·pãÊK·®Ý»xóêÝË·¯ß¿€ L¸°áÈ+^Ì&[}Lù¥ä‹—éRÎÜ81矟nÝ2´DÓ3Q;]¹3bÓª•¶;äæ©µYθÛõ`Ø¥_y[xðšÃ}Nλwñæ¡rëN.93iÚ/Wï=xèçÍ­þï¾:yìÝÑÓæ¬½=øÕãÑ—Ï~|{òñ•seÎzýìù6å6kÇÕGß{÷ew~ 2ØÚvBvÛsýAGZ…2 (¡wè tú‡òÙÇa~4ih¢zþ·"‹’hžx †Wâ‰3¾è¢z©¡XÐn4š—cŒ!zEŠ-úØãÅyXbéA¥ÌAùYƒQ™¥Ž/N¹¤‚J™£•ñX¤SGRH 8]Ùd—c>)%1ª©&›[’ ãaî‰\™oŠ™§œ<žyU•סfætHʈ'–XnI'˜õõé&› ©h—‹šÄÝ : *ž†VU%¡Lòt¤ Š:*©þ^Êy©—™+Z¦Ø(¦€òj©ZÍ:¥{¨¶é¦«ZЇ#•ùÕÊì³6ÒꨦÔΩ¤KÎEšlÑÞ ,UtÖ d…2ºf¬ç2(i¢>Bèâ|¶ í°ärZnIá"Ûá„'.ø-VþÒgx÷š»!©[ºa®d '¿¾Ò‹ë¸bŒ/Ä·&œ »ÿv<”Ŭ—È—\Úµ"1ÌÉ&·ŒË¥ÛÌ.ל2Ê#}º2Î6÷ìóÏ@-ôÐDmôÑH'­ôÒL7íôÓPG-õÔTW­R¾Xg­õÖ\wM³Õfy-öØd—Mv›[ñ ö\jÕvJo/÷ÚnÍý•Ýø¦M·þBf÷íwÀyÃ…7IƒUxӇǔøiq-þ‘ãAAŽ´äº]Ý8ÚÁîåÄY.8æYq^´èp{þé¡®“êA³øI:£å:E³¨9Bµ§üò{jå‘ï©ÝR¹Ë Q­ÜF§n¥. fΠ,üÀÄÿ]vEò¦½òÛW—ÞÆÍÌýøGèô?;†ŒwoâƒÙ–êøÙ«k›ù“¡ÿQųÿ»üT¢é'¡íÑπл ð2¤¿Åw€;žµ#@z€õã^íè:¦$ ðb×Añ]pXä«è>† ¦!ùDh:‹”g\²Q„漪΃þ "¶d(DpÎ3dK7§7.1uå{ÔåØÄ¶kZÊÒÞ…Þ׼󬇉±Oú>GÅÌ9Œì 8 æp…I ¡ õD Ô±‚Ò;#îÖH©Zp~ìW»Ç»;úÄû Ñh«$ŠÑ‚da"ºk!RU0×"÷ˆ@8Nƒ ücÇøB4Ö-“¸Ù䈲ÔB-&RF~TaÉKfdB^TØ÷Hļ]z±[P,ãñ*ã¼\òÒ„â‹Ö {É7U®2‡þ1f1‰IÍiê숪Iœ÷,äK¶qPÇ4¡ iGÂÊ “€Êï¾]ŠSޤÔß%Û÷²`NR”*þ å á(Ër6$‚–ùŸK|ºŸk,ç<õ³P –3n|¥AŠÎ‚R4uH è9ïéM}Zô{¢ä(%IÇBt–ù¤¨ESÚQ#Zï¥Æû§u$ÚÒ{®” ðä¤ÕgRÆó›ì\iDñ9ËÓdtˆ 2ó„PVJrZÍÔ£ájˆ½j>;Þ#Öñsž”w&4yCII“«VåjTwÊ?ªÆŒ–]XÃÚA¸>¤ˆ õM^ëÚSrÂêŸ=™+RïꪻÒ}{l_É98*•›³˜cï'Õºu- MlÙ:ÕÅb²QÑìÊxZO2ÚÎŒœµ¬g{Z¨ˆv1¯5þ¥§¦xZE:¦¸íÚeY+Ì<ʯa‰íc{{¾ß,Âý qóg\Å—¶È©bs׊\è¦HºÓÕiuMû§Üz7·Ù©X¾KÞòêö,É^zÃkNöϽJ„ï{å›–õjξô}]~K³_Ùõw°µÜáð‚·¶ÙR¿ÿ]­a÷·Á‹òmR²}%~Ã(ÒQ¼ LðnšÕáaÏ?¥.N™Äbnוq»`l"9ÆÉ~XÃ&,+X¸ÿЊR$f_L=|bÿN¡ãü¥·ì cØÙSI~¼¥‡s¨l^¸¤B~kN-Œ;ÇsÊ/.²‘}dsùÊr<êE,øIY´£eþ6“'("kyÀ_>0KAáQRoÇ…¥3iÃL0\ÚUcıs°¼‘ ¯­Æve0A fBËo¨¤¼b¢í8"Á†TБ-”v½¼Ù7ÃYÊ„†tšy<Ò«µÑøÕf—ŸüWT߸Ӟ֒éh2¸ÊV&uNíËhV«úŠÆû¬c ’Å¡,{ˆf¢†l;Û“ªBf‚9H<†yØÄ¦ð´© 2œ‰k¦áªó¢Ý¶m[7ËÚs̶¬³¼édcXÙº^õ¥ïææJgTÌåV7¶©<_N6 I25t¡]ZÈxoYßûFxhžp†£É᥄x*%žnŠ/ÜâõƸÜ4žoŽoÜã£ùÇþEžT’ïÙäÎEygUžr–Ìå-‡9¥enkšcÒæ›ÆùÍuÞhž·æGyЫ6t’}jGyÒ£¶tŽ7ýiOÇxÔçóCV}ÒW¿nÖí¼õáf}êûÒÄq²'Íì GûÑÔŽp¶®ë9q;Ñäžmº Íî±Æ;Ðôþf¾ûÌïE¼Í¯a»ÌðÿMî© ºJOý»Õ‡{m²ø¹Í¶yü5)ùÉrW6×ü—­w¾ßŸo|U£‰yB «+ˆï¯âA f»‡šÒÒ3¨Æìˆ)‹÷²9}t#G{™õçøXÔaP9Æ'@rIùßzì÷;ûpÏk[„rÖYGþÅd[i_eP>×ÃX¦2çëWCÆ~Æ´ÏýFJlýy>ùÎ;þ÷Ï6…æoü¬tÜHäõéýV€Xô&–9•Ö-þ"Xk1§DeªGI±ÃKqän‰‚uqz¯· ÝgV»ç}Àv.Ó*.¶Õ†)ÇUe†n!Ç]ì‘‚Ï´ki¡‡låG|ú×+½7/€ýßKÉ·ƒò×I’ôn<†R¶—b96}xÄbjsl·FSK`g‚Å÷ƒ~‚.ÿÇ~)à4„à÷r¤öNdõ.4¨T½& ˆ^ñãI8Äf—vƒS–dô'oÆ¢zéÂ…µU]øƒ[¤‚#hMmhue¨RþKeSSèlt¨{èöo%xqE$íH•†þ¦OŽØsã§@´g?¬§'Dˆ{ï'-cøMÊŠIq‚…U{ó6H8YRˆ¾ÕŠOET6B„e…oòæ„ÊÍ6Q+h‡È€¬æ‚6bs¦‰s(^ÈXr,¨sÄØŒÆ8vpÊXsñ…S–XSІu¶‚üV8w{T”NˆçxJJ…UÇÔŽË6JRèJì–s÷’¿E“z“ ´u6YYd^>é“®…“^·rn(B©\mU_Ay”¦Zþe”LÉ_EHnP•3•­g‘ƒÁg•W™”HÈ• ä8M·“©å”Þ˜–ÅqMa–ò´Š€ÅL]ˆc¶L\tyÉ„C –^YZ|™iì8I”KáãT¸(˜3Âièø—+ó5á%pùНv„†ÙOû7ljŒ¹>—§i%vpék!5S¥Iá¸+¶M›Ç™D 7¢—•(šXIS(õ‹Ù-bÒQ–'£Š­ù`´Ù™4ÖEˆIT*ÅGZ4T„iŽ®‰–°ISH¤(y7šFˆŸþ¹E8Â/„È-"˜U ¸”Ä‚0â/h‹ò%™¼õpÓ‘}Zxžãiì©”Uy5ñ©-ú2Ÿ}·Š?ùŸßEžøé'ú‰~¹¦eõù”îYžó*œ‡™†]#7 ¡ò ûç–òHœÏy…3· Ê…êÇ,Ë¡ù• jÉxŸÑ‰0¿‡v¢žî…¢Êv—ÐWÆäN‰`Ú¢ÞR)A §vÕ³bKµB±”ˆát™×–}c%f,%*á(Î(£É:=ˆô7´öTUJ‰¥ÙÇ¢Oúi9)c‚5¥V⌔éœëæ¤gÚ¤CpkºNÌy¥ÉÙJ[9k :§–¦jŠdþЄ†tæ‡VåU÷÷§€JY2i§EɨÚp_W‘*§“§u*–ã% ™J©Pª¢j¦Ÿj…ºŒaã©¥jª‚ÚG˜ª¤ºª~ÚªVF¢ª²:«›úIxHo±š«YŠ”4ö>Z¬Öƒ«À¬‡ÕG÷•¬¬º«dê4[ª^Ãç¡V“XÆš­×ó-]ª‘D7£J’ÕJb\ ®ÏÅ­ãj\Øš‘2e‚ÿÒ­*i®ñ¸—Ð “Z7]ëª`´Ê’éZ“òÚ®B‡ŸY¯Ê¯øú¯ŠTÍYTËʯ÷ê’ûdlêMXª©gb°뮣6±Ïxªöê±o©±gF™»¯!‚±ê±Òˆ§Æiþš{“›²"ûcÞy†¨‰Š’ýJRËez:³þ:³áZ*(û²ÊêmH¸tùJÓªm ­ÖêšÏægÜ– ù«OK¡›µÎ¶£¶zTå莎8*Ʀ~Æ¢­jË5ﺳ‹Ù$¢ªf:u%oxmAV˜™³=ë«â ´T€HDEÅf½(¶:ص"vƒtkˆr%xMË–õº†ä¸²µø‹b„b«]çf} X«žÈS—Ës—véµÊz²nÛ¡\wM(K؈š¼Šk%šŒôÚ#k;6I•§-t0•ØC!–ºk²éƒ´`´b6¸ºÙºîw·œ*8ÀXœ¦‡…› þx‡ª ¸¡dKÊ+ƒþðфŒØzXƒªš½˜è²³+¦¹Ø§–ú³ ¼‹ˆ‡%&·™˜dõ{g¶7¿Q ½8{›v››í{Dm«½íË* møW‡±›˜`6 ül}³ÝäFňœŠÈ§ÆVÀ§z¸˜Wµd–OÝëÁŽôœlQc¾ ¤g…¨ot{G´« šô¤·²j‡;‹Òfµ‘k¾>{±3Ü«·[Âæ$ã¤Ã‰KÂax=\¦\Û°ú·OlQ,ÃüuU ¿Ä‹ÅeÑÄ1l´3™Å@|ÅW§Ââ¹,ì˜Ê´Â6ú¾c<ÅéWbªN½[NõÂópR¼ÅeœeøK²þoêÀ[‚gÛE w%jû¦Û”šŒU±¿ÄUgÆë+À‹lŒ4 ÉK,Éa¼+˜t|˜Ö«¾l˜»¦|Ê[ÃÉ™‘YƒÅt† ¥U²ü )V{{vØò‰1ãÅqÇn ·ŒË¿I„~…t«g¢ýªå:Ì£WÌRCÉŒ¥Ê·#DˆB·Ì{<´ûž£È‡ÕDÁ?ÃÄ&™ËÖWŠ#Êtb´S/Χ‚ÆÜÅãÌÌ¢x#ƒt¨|Ïšü­ò\,@Ú¼ú\©P¼ÏqšcøÌR9ɹ¬‡ñYŠ`D¼Ôœ…ˆžØl2ÍÅÜÜÌ€¦y }ÐÌ”ÝÇQÒ=ÒÐ }þÒTlÒíõÑGIÒ.-”0Ò/­ÒqœÒ-MÓ2mÓi•3½Ò8 Ð@Mpøì5“ÃÓ4G9¼vÔ9=Ôºú¡o×Ô7ýÅvdÊ)ŒÔ2§ÔЩ¯uñÓSýÔ”×”#ƒÕ@'¹P­ÌráÕ=ý¬JÌÇ|›jÔf-Ä‹9×t:ÖR½ÖN\×qk׋ÊqÕ0ÕµrùÍ›ÆrI×ké=§„ÊT¼[Á<—yLÍW×:Â<¦mª‹Aê¥5¼}¦š ¦·Æ¾Žì­ójµFÖ¤ý¥<ÀŒì‹T=Ä6\Ô§ìÚOZÚt<Ê«©œûTÛ>ìÆ®ñÐkÛ'dÜy£sY˶jÛ¬«Úžþ¬K Öýڣ•«Õq×ý¼°EÝ[Ý‚Ø Ý†aÜ%³ÝØËÚã­æí1è-¼)ªÞÙ-«ïÍ®ÝMÞËAݸmÔÖ-ßøMí­×Ä=à j– ¾|-ÍΊ¬þ}ßögàºf½›[.ס}áQu›!ø¹9¤:¬² yîÝĬVê(½‡J»àŒÙ!ÎyÔˆáü{…¤œ<ÜÉ Ç-®¥ã1îj›‹c"E¬AzÖ9Î\/~äö[g$L…Kîo¯UáY½ãHÀQ›‡y£Âµ,^ä ßiYãú«âƒÆgJ¸„”å )åΊ󛿚;¬–¦Y`Èå].Ý5×½R$È•<·þ•‹… NçêåJ¾V°o"ü¥ ¼:è’êà ^h{Œ˜vãbýÜŒ^fj¾Þ{M¦ê  …æ"g7‡êðHê'êé}a{é=JâÉvÎêDþßѽɔ.ëaÍã®à·ŽëŽ;â´žÂþìëµë}íMìºýçÆn$ûí7Êî—ÀîèÑ.{™¾ëÕ~¢×ìÙ¯ºÎíݾÍÓþêá.’ÛNíå>£çNîéÞÊߎîíîíSŽíñ~°ïÎîõ.³óîóì}“ï~-èǾ¡} ð›Nï½nŸv?äà¯ÊìÍ®åŠýY½\w«‘“ÙLÆgÂŒÄæñíYð0fåØþá ¼œ{Ôˆ‚¤ÀdËšµ>ñ ¯ "_x„kƒOøåÈ‹°8¶”«¸ûï!ïyôÉã,äU/WÛà«þñ/¯ð3Ÿ`LhJOEÙét (µë.ðA¯àôõœ+õfžK6îã-F¨®{ï\ïôBߟœhå>¿OÃÎCyË‚þ‚ /ñzÏ´Š®n_ê“Vô䋺å›cæš¾ö2ßöúºk^¹'8cH¿ÕˆøLoé¿ðrÕ³j‡àœÞn™X…uÂjif˜óy¿ø^o±|…ç©ïª]Öù­ ö4èña~ÀpZŽ…®ö¯údÌÕßöæ´]Ê5ßû†÷™Äù÷žø»þ¶õÆŸÎ8þÖäŠò?…óæg®ZÈÒo­HôðA8ð9Ïû}ïÖè(ø›X¥j¤û_ýåÿš¦{IÂu?…¤Ï¨?Íðó—ÊøJà@‚ Dˆ@B… |x0b¨‰'R$øp¡Fƒ~RäH’%MžD™ReÆ“Mº\SæÌ—4mB¼¹Ò%L…UjHŸuNÅšõcU­ ¹vMÚÓêX±A–Ý)tcYˆÁ¾…ìW³)éÊÅ[3/Ù½a«ÞeÛQèO¢ÝztÛWñbÆ õÚmy$`¸”§ZäKÕñYŒicþF;XòhÒs[^-ZtdËR7þ-É3L¢ž“Ú«Z÷n™­s?æ=Ú·ÖáO›z½¹'×ãŸWSd=øtꚟ®ÎºtqÝ€‡ûÄ]üxÁ×Í“—Ëý2zöíÝ«ö­^ý{ÔÂéßÇŸ¿küúú³Î @ÿ$0?þT°À­¶S°A|Î:È t*Á )Ä0ÃûœPÙ,Ì DG$+QÃiZ±D_ì »a$—d²¿ÉœlÒ0£¤²ÊüÑÊ$%RK/42¹/ÓnL3› “¤. \Å3ßD2Í'Ílþ³G8ï„QÎ,éœO?]ÔSÂ/ëÄòOC tÇ3 óPG)LôJã¢k:¯,¢í;UAJ›•®ã*]EN¡û´TK'cêQÅ"Íì¦O›#µ­¶vÒôÃ>[šUÕZ;ÂWSãšU#cìÕU¼`EªJ—BöÖÚ†‘4î~5LÔ`§å•Xm©z[e×+TQg…WÚl© r×—¾ÝqÛu»­ Þ­2—X;ËõT¢c- ÕVZ‹‚6Û£W¹2ÙVÕ帨ŒZ5øµ‰î ¼&Ü‚K¥ØáUóm¶Q7Ïõ×W‹GØáT¥ ™R“¦7e–¥³UåœQ ™ç˜qþFY¡eùR “9i’·œsÆñ]õã›]Ætç›7VZR.=%:j¬G­zjª'¾UdŒ¹>úß‹zçÁ&{i…÷tZV¨[v;l¼uŽ{í¦·¶ëe¯Í[ì½ï[âs»nÙoŒ!Vî¬åæŒî“'µùpɇ¼sÁ¥ùÝKUf¼ðƹõ¼ë 5&çÇQçqÊ™¶|_›j=}Þ¤ÆZv¾/œáy{÷•=¾Nls÷—9Øu'~öß@ç7ð†ûâÞ5ï}æÆ®eÝwèkã¾èèƒÎ¼{«sF¾x¤NÕ‘Ù¹o'ŸýØÃÝÜoT^_ëÐc _¨LW8Žå­x{Ûþ–§¶üáÏ€ü3ŸÔ¤W9êy~Ÿ+Û4Ÿm°gæR’ð³k[RCÚçž6º«õ¬XÚóà'7AùÕeuªßæÜÇÁ"¬5ð« «XèÃñÙŒc¸âö.@‚ÉF†>#ÛÏF²ÒÎJ@áßò:-Z1‹¶«ý×Åÿ|eŠùª¢”ød-2nñ/gD#ÿæ%1ƪ®yci”Æ…Ñ]w$cøHA?²1‡¤k§%=ÎNÅ‚d$%9IJJRzƒ$#ÿx§FÞî’Š "•:éÅ7RW³Ãäô ÂîPǔբ\*_YFUÒ–·Ä¥ Å2Ë’½‡—lå_þ•Kb3—!"m~IÊñ,LÁc_œY½N5S„ ž#ﵬORS›Ü¤ˆ¦ÉÚì†9ÀÛb7-XÍïm™ÖÌ$6‡ Ç9š•дã^ÆÉN%3ž}Ô'#f¼&–8êä'>íéËwŠg-”¦@ s<ІæŸº§7mh#wÊ*™Þ1fHmÙ,Дt¢ Bë¹Î¼ìs¥PšÎC£Pª…07µèBå&Ël¶GœþT¥<[úDœ¾¯¨IgFYºHivÔ“ð ê2‰šÓc okr©SªÑÿhõ”Ð8ó-"ì}(u–J™ºÕ¦†³¡Ù) @÷SÓ‹Bu§ ýfz¼ þK¸&©‘j_•ÊV¶t¯í²+N:™¹‚u°/…,8êÑÄv¡¸ÃOVÝÊÕk&r³Ou,|ˆúFZª5”k5ìgûYYVæ5•ˆ%^7úªÃÂ48b…hcóJ®ØrV·•©-‚€ ŸÜ*¶ce“™YöšãžöQ<ý_qiKÙÐn'aΨ¨ZѳîO»uý­¡ û=‘–×¼S ÜyÕ;RŸJ ©Ý g¾{›#zL³íõ­e[‰ÈðºÒ½l1]|Aà¢Ú÷¾ìïpù+Óɖ콊Q©Zà{Ñõ¹²eæmùK`ÕÖ¥ªH}ðD'Œ–7o½'FqЉáβ¶quO÷7cþC±¬ÌeîŒÑÛÁCʶþEd9cÎR>ø $x†LdzÒðÇ1=ä9œÙ ïv¦@¾£¨¦Ü?YÃY~Ò‰uºä*·8¿í4²sÑÉÛ—Y¿½t±“ó Û®r9È^æMŸiå5»†Ênî/Ÿ‰{ç 㙺mô‘·Lè7÷9¥v޲¡÷ÛeðòÕDt¥¯ å*38­sUq¨-™iMϙӮ3©%éA«úÓ®“¢Ñ£g<ÑÖÓ­›`oýÖ]¯ÒÑXîõjƒík÷tج>ö‹d­àd ·ÙhBö&Ÿ½Ôiç)Ú†¬ö¯³­ìk·vÛ‘ý6‰–çpùÜÜvö¬Ï]ØuþkhÜÕm·©ãíãt3{Óˆªwtç¡wëúJ–ñŽt禭˜UÌÂì¥÷]¢~—Ö¯ ª¹IŠYÿ…ÇcV,q} qã,œáÝ66K]hƒ Yk¸ù`«œˆA‰’œ×WÈõÝç€ÿSË•ÚaTI>%ßûÕ0ç·ÌѼšËÆrFÏ"ŒŸÃ‘Òýºzº»…îYƒ£ö.¿ØÉÍ옇F—ð5q-£.õ|Ã{¶ø–z¾<¢# â¹éz<±n¶1ÝA ¶#g”“S9JKÜ•Òr)žýçv¿ûÔ9*ol2ö›÷«ßáþBs#=Õ>GÕmZvY↧ï½!/%O_þ3ã£êÌçK¾Ô¶>ðªçx¼ ú4—Ýß.ê uKË«.ˆA3îg5 ü„üÖ+&{؃Ùö§=)ÏvóPšñ,ˆ1¼”cÿò#öŠ÷Ìßeßaÿv$–~’‘~~Þ½}Æ—6s6©î~‹V6ç]ʇÛafzùî’,¶Þ³\ƒ>Ä»:½Ã½ºr<("“Ó9ß›;ç@õ‹º½äÛ´¼>ç ¦Ë$ „@mó<tˆà;=3ë¹^:A¿è?uy/ã:89‹ÀSA‰Ó9÷;yó@ÇkAäó¿ÉÛ¼¥Á;´»÷k1óë,"¬>ý¼ìÁ‘ë­ Á!´£Øù¿öëþ£%ü û=ܰ ŒÂ±CBœÓ q½È39 ° DµôB0Á¯K+$$*4" ì@Ê«=(Ì3Q¡_ÁCe C'|´â«ÀÔ"/ÜÃ!Á•k9ù£#Ä£7=4'>D»mª™ADAÄITÄë±DÑY£LÄ76üB빫Z™ô1•³ýÙ#QLµ¸d/rSD8DKŽG:Ë5”Ä ä>‹ìJJÌ:úa›‰šú5·4JK+IuÃ#OìDݳÁ{tÄLSÌ¡ë¸ftÌš‚¡å³ÆD¡és!Û¡°\¼þ¾ÜÆ—,ÇÀŒÌñù™ë¾Ð̹Ÿ1°cœÆþ©µ‹Ô'â&פÇt´|¼±ÜÍÂôÄcÄGÉ\5YœIÖA¹ d\Ç¿,E»‰F Ê b úDì1ÔLM \ͧ¹9ËÛ`TM¨Äœnl:‰ôÎhL.ŠÏìaË%¹L´úk,ìs¿ÃÀöNOÚOêœÈ Ÿ?ÉÏñÜÏÑ"«µØ;ãB>"9:»½ÕIN'ÎúÎìÆ¥;ö‹5ÞL­’"0”°åòÃÐÕÐÁ¤±« ¼<­ÄªFþä$]¹D«øSºª°’2HB\J¸ÔH¢‰Ð‚Ïìdþ¹)ÍšºO&iP6-œ*RÅ:R cL |Ðu "2PimÍ>ÅÓZ³T@|SÀÔÔ åÊëôÊEÍÔMU¿TTqEº4K!…UDÝLò<ȹPÎú“Ѻ#Jô[O²C¶GU8WõMœL²OÉõ”)¬šUà‚´C4VH“HâVdºŒVÙ¼Ðx,O]]V^¥U_ÝŒ0 ýÒÛ±›/ëÎaIFûÖ {Ãt…ÑÐë.tÙB”CöL*mþ…Ì}¥´^…×Ê;*Òs‰ ±œRR}åÖõcXÐú×w¹X©S¯+Ør ½ï[×I¹Ò•üª‡-J›ŒN:×$ÈER¡²5NÃ$R.IõQë|±gí0ó.iåÅëjÕ±—%Qk‰UHš¸ìR›‘DÍÉVÍLŒŒ»<؉ո`5ÚU‘)=¨¥FlÚíÙ;u×½»ŸÛ½ŒôÊÚSÙ2ÃÔ<Õ«%CK"e™ËëÚ£ÕLP9žm2YeWƒ“ÍÑì:žåZoõZ¤EÖROü7 CJ½Ö|u7¶ÄX‘MX•ÙÉY\´•Ù›ªk­/]´Ö¨ÔØ”Gp=Ãþv\º‰:Ùt%×y•S¸ýS”’á»\¾„Ø“T]ŠqÚ4<ŒdÕÚÜZMÜRÇ=ǹ °EÞóš­ÝõÒ ”\“9ÆIí#Õ˜}®áÕÀd¬Ù°X}ä×€ýÞê%#é Òoô]z]Á (Ø}@ÊíÉñ“z[«Ú<•=tµÙÓ,Æë3«U¤Þ=zºÀ;ßz"òÍUû-ÚÕ¤×#± ^&íBOí¸¿*QFX¢-#À},7P¥½"÷B=þs#àå¼0ò=Â%¶È; ô%±ÝàÑPMáÁ¬Òš­%~ÂG²@P…a­Žäâ .&NåXJÅÒhaÎ¡ÚØT-£è#þÖ¥e•i2`0dD!–Ë žY&öY-&-#Öbœâæ ߆uØ/öY&Çÿ=\5ã6ÆÌ hYŽPÞÅæ]7Æã…µÅ=–°ªi[<ý ã<ž7íkÚÄ8½ƒ=+ dBn7C†Ñ¦Wò³ØRuäKN`f@E.Û‹Õ(øYb'VWÙÅdv0>~Ý“…^³¬2¼]ïE@çÂ1B\„ÓÍR¦H£ÙÙ`ùÌcÓ'•TÌûÁ ;>•§µ›!Oë]×ÑK$z`\ŽÄ'6ÆäÊÊ·ÉG¹+’R££iæéƒfü<Öܺ¿LÁ"-<æ Þ½oçf½Â´c·äfµ„eôzÙFfç¬<àÏKÁ­EÂrÖKù½AŒ3‹Òà}ŽØ,îfZ&Ù¥k>4fp<Á)] NO…îÅp>;&4Ä¥^ô4ç¿#•HhƒÖhkkÖÒ5Â9´Ük¼óR^Æh1tâ”®\i«Êô0ÇEO™ê×eÑ@D;}ÆéZU”ž?ÉtåŠåIv^¢ £>êaÞÖ†6É~): , ¼hR~æªÞI+3ˆÒ£šKÓ’6Áqž¿Pë·†ë¸–ë¹¦ëº¶ë»Æë¼Öë½æë¾öë¿ìÀìÁ&ìÂ6ìÃFìÄVìÅfìÆvìdžìÈ–ìɦìʶìËÖŠ€;gfarm-2.4.1/doc/internal/ja/gfarm-v2-schema.txt0000644000000000000000000001402311507222722017703 0ustar rootrootµ­¹æ¤Î°ÕÌ£: ¡ß1 ¤Ï¡¢¤½¤Î°À­¤òɬ¤º1¤Ä¤À¤±»ý¤Ä¤³¤È¤ò°ÕÌ£¤¹¤ë primary key ¤Ï¡¢É¬¤º ¡ß1 ¤È¤Ê¤ë¡£ ¡ß0¡Á1 ¤Ï¡¢¤½¤Î°À­¤ò1¤Ä»ý¤Ä¤³¤È¤¬¤¢¤ë(optional)¤ò°ÕÌ£¤¹¤ë ¡ß0¡ÁN ¤Ï¡¢¤½¤Î°À­¤òÊ£¿ô(0°Ê¾å)»ý¤Á¤¦¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë ¡ß1¡ÁN ¤Ï¡¢¤½¤Î°À­¤òÊ£¿ô(1°Ê¾å)»ý¤Á¤¦¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë (PK) ¡Ä primary key (FK) ¡Ä foregin key (IE) ¡Ä inversion entry (º÷°ú¤Å¤±¸õÊä) [CI] ¡Ä case insensitive ¤Êʸ»úÎó ¤³¤ÎÃí¼á¤Î¤Ê¤¤Ê¸»úÎó¤Ï case sensitive ------------------------------------------------------------------------ gfarm-2.x ¤Î¥¹¥­¡¼¥Þ (ÏÀÍýÀß·×´ó¤ê) ¼ÂÂÎ: Host °À­: hostname: ʸ»úÎó [CI], ¡ß1 (PK) architecture: ʸ»úÎó, ¡ß1 (IE) ncpu: À°¿ô, ¡ß1 ncpu == 0 ¤Î¥Þ¥·¥ó¤Ï¡¢CPU ¤òÄ󶡤»¤º¡¢ ¥Ç¥£¥¹¥¯¥µ¡¼¥Ð¡¼¤È¤·¤Æ¤Î¤ßưºî¤µ¤»¤ë¡£ ¤½¤¦¤¤¤¦¥Þ¥·¥ó¤Ç¤Ï¡¢gfrcmd ¤âµö¤µ¤Ê¤¤¡£ port: À°¿ô, ¡ß1 gfsd ¤Î¥Ý¡¼¥ÈÈÖ¹æ hasDisk: ¿¿µ¶ÃÍ, ¡ß1 ¥Ç¥£¥¹¥¯Îΰè¤òÄ󶡤¹¤ë¤³¤È¤ò¼¨¤¹¡£ gfarm-2.x ¤ÎÅö½é¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï¤Ï¾ï¤Ë 1 ¤òͽÄê¡£ ´ØÏ¢: - ¡Ö¥Û¥¹¥È̾¤«ÊÌ̾¤ò»ý¤Ä¡×»²¾È - ¡Ö¥ì¥×¥ê¥«¤òÊÝ»ý¤¹¤ë¡×»²¾È ¼ÂÂÎ: HostNameAlias °À­: hostnamealias: ʸ»úÎó [CI], ¡ß1 (PK) ¤³¤³¤Ë¤Ï¡¢hostname ¤È hostalias ¤òξÊýÅÐÏ¿¤¹¤ë hostname: ʸ»úÎó [CI], ¡ß1 (FK) (IE) ´ØÏ¢: - ¥Û¥¹¥È̾¤«ÊÌ̾¤ò»ý¤Ä: Host(hostname) : HostNameAliases(hostname) = 1 : 1¡ÁN ¼ÂÂÎ: User °À­: username: ʸ»úÎó, ¡ß1 (PK) userRealName: ʸ»úÎó, ¡ß1 gfarmHomeDir: ʸ»úÎó, ¡ß1 gsiDN: ʸ»úÎó, ¡ß0¡Á1 (IE) ´ØÏ¢: - ¡Ö¥°¥ë¡¼¥×¤Ë°¤¹¤ë¡×»²¾È - ¡ÖINode ¤Î¥ª¡¼¥Ê¡¼¡×»²¾È ¼ÂÂÎ: Group °À­: groupname: ʸ»úÎó, ¡ß1 (PK) ´ØÏ¢: - ¡Ö¥æ¡¼¥¶¡¼¤ò´Þ¤à¡×»²¾È - ¡ÖInode ¤Î¥°¥ë¡¼¥×¡×»²¾È ¢¨ groupname=="gfadmin" ¤ò´ÉÍý¼Ô¸¢¸Â¤ò»ý¤Ä¥°¥ë¡¼¥×¤È¤¹¤ë ´ØÏ¢¼ÂÂÎ: GroupAssignment °À­: username: ʸ»úÎó, ¡ß1 (PK) (FK) groupname: ʸ»úÎó, ¡ß1 (PK) (FK) ´ØÏ¢: - ¥°¥ë¡¼¥×¤Ë°¤¹¤ë: User(username) : GroupAssignment(username) = 1 : 1¡ÁN - ¥æ¡¼¥¶¡¼¤ò´Þ¤à: Group(groupname) : GroupAssignment(groupname) = 1 : 0¡ÁN ¼ÂÂÎ: INode (mode ¤ÎÃͤˤè¤Ã¤Æ¡¢¥µ¥Ö¥¿¥¤¥× DirINode, FileINode ¤ËʬÎà) °À­: inode: ¿ô»ú, ¡ß1 (PK) inode==2 ¤ò root directory ¤È¤¹¤ë¡£ mode: À°¿ô, ¡ß1 username: ʸ»úÎó, ¡ß1 (FK) groupname: ʸ»úÎó, ¡ß1 (FK) atimesec: À°¿ô, ¡ß1 atimensec: À°¿ô, ¡ß1 mtimesec: À°¿ô, ¡ß1 mtimensec: À°¿ô, ¡ß1 ctimesec: À°¿ô, ¡ß1 ctimensec: À°¿ô, ¡ß1 ´ØÏ¢: - INode ¤Î¥ª¡¼¥Ê¡¼: INode(username) : User(username) = 0¡ÁN : 1 - INode ¤Î¥°¥ë¡¼¥×: INode(groupname) : Group(groupname) = 0¡ÁN : 1 - ¡Ö¥Ñ¥¹Ì¾¤¬»Ø¤¹¡×»²¾È ¢¨ ʪÍýÀ߷פǤÎÊѹ¹ÅÀ °À­¤ÎÄɲÃ: DirINode ¤Î¾ì¹ç¤È FileInode ¤Î¾ì¹ç¤ÎξÊý nlink: À°¿ô, ¡ß1 ¥Ï¡¼¥É¥ê¥ó¥¯¿ô¡£¤¹¤Ê¤ï¤Á´ØÏ¢¡Ö¥Ñ¥¹Ì¾¤¬»Ø¤¹¡×¤Î¿ô¡£ generation: À°¿ô, ¡ß1 À¤ÂåÈֹ桢¤¹¤Ê¤ï¤Á inode Èֹ椬ºÆÍøÍѤµ¤ì¤¿²ó¿ô¡£ FileINode ¤Î¾ì¹ç¡¢ filesize: À°¿ô, ¡ß1 checksumType: ʸ»úÎó, ¡ß1 checksum: ʸ»úÎó, ¡ß1 ´ØÏ¢¤Î°Üư: DirINode ¤Î¾ì¹ç¡¢ - ¡Ö¥Ç¥£¥ì¥¯¥È¥ê¤Ë½ê°¤¹¤ë¡×»²¾È FileINode ¤Î¾ì¹ç¡¢ - ¡Ö¥ì¥×¥ê¥«¤Î½êºß¡×»²¾È ¢¨ ¥Ç¥£¥¹¥¯ÍÆÎÌÀáÌó¤Î¤¿¤á¡¢RDB ÍѤΠSQL ¥¹¥­¡¼¥Þ¤Ç¤Ï¡¢¾Êά²Äǽ¤Ê checksumType, checksum ¤Ï¡¢Ê̥ơ¼¥Ö¥ë FileInfo ¤ËÄɤ¤½Ð¤¹¡£ ¢¨ ¾­ÍèŪ¤Ë¡¢²¼µ­¤Î°À­¤òÄɲä·¤¿Êý¤¬Îɤ¤¤È»×¤ï¤ì¤ë¡£ desiredCopies: À°¿ô, ¡ß1 ´üÂÔ¤µ¤ì¤ë¥ì¥×¥ê¥«¤Î¿ô¡£ DirINode ¤Î¾ì¹ç¤È FileInode ¤Î¾ì¹ç¤ÎξÊý¤ÇÍѤ¤¤é¤ì¤ë¡£ ¥Ç¥£¥ì¥¯¥È¥ê¤Î¾ì¹ç¤Ï¡¢¤½¤Îľ²¼¤Ëºî¤é¤ì¤ë ¥Õ¥¡¥¤¥ë/¥Ç¥£¥ì¥¯¥È¥ê¤Î desiredCopies ¤Î½é´üÃͤȤ·¤Æ »È¤ï¤ì¤ë¡£¥Ç¥Õ¥©¡¼¥ë¥È¤Ï 1¡£ ncopies: À°¿ô, ¡ß0¡Á1 FileInode ÍÑ¡£ Í­¸ú¤Ê (valid==¿¿¤Ç¤¢¤ë) FileCopy ¤Î¿ô (¥ì¥×¥ê¥«¤Î¿ô)¡£ ʪÍýÀ߷פΤߤÇÍѤ¤¤ë¡£Æ³Æþ¤ÎÌÜŪ¤ÏÀ­Ç½¸þ¾å¡£ ¼ÂÂÎ: DirINode (INode ¤Î¥µ¥Ö¥¿¥¤¥×) °À­: ¤Ê¤· ´ØÏ¢: - ¡Ö¥Ç¥£¥ì¥¯¥È¥ê¤Ë½ê°¤¹¤ë¡×»²¾È ¢¨ ʪÍýÀ߷פǤÎÊѹ¹ÅÀ DirINode ¤ÏÇѻߤ·¡¢INode ¤ËÅý¹ç¤¹¤ë¡£ ´ØÏ¢¤Î°Üư: - ¡Ö¥Ç¥£¥ì¥¯¥È¥ê¤Ë½ê°¤¹¤ë¡×»²¾È ¼ÂÂÎ: FileINode (INode ¤Î¥µ¥Ö¥¿¥¤¥×) °À­: filesize: À°¿ô, ¡ß1 checksumType: ʸ»úÎó, ¡ß1 checksum: ʸ»úÎó, ¡ß1 ´ØÏ¢: - ¡Ö¥ì¥×¥ê¥«¤Î½êºß¡×»²¾È ¢¨ ʪÍýÀ߷פǤÎÊѹ¹ÅÀ FileINode ¤ÏÇѻߤ·¡¢INode ¤ËÅý¹ç¤¹¤ë¡£ °À­¤Î°Üư: FileInode ¤Î°À­¤Ï INode ¤ÇÊÝ»ý¤¹¤ë¡£ ¤¿¤À¤·¡¢RDB ÍѤΠSQL ¥¹¥­¡¼¥Þ¤Ç¤Ï¡¢ ¾Êά²Äǽ¤Ê checksumType, checksum ¤Ï¡¢ Ê̥ơ¼¥Ö¥ë FileInfo ¤Ëµ­Ï¿¤¹¤ë¡£ ´ØÏ¢¤Î°Üư: - ¡Ö¥ì¥×¥ê¥«¤Î½êºß¡×»²¾È ´ØÏ¢¼ÂÂÎ: FileCopy °À­: inode: ¿ô»ú, ¡ß1 (PK) hostname: ʸ»úÎó [CI], ¡ß1 (PK) ´ØÏ¢: - ¥ì¥×¥ê¥«¤Î½êºß: FileINode(inode) : FileCopy(inode) = 0¡Á1 : 1¡ÁN - ¥ì¥×¥ê¥«¤òÊÝ»ý¤¹¤ë: Host(hostname) : FileCopy(hostname) = 1 : 0¡ÁN ¢¨ ʪÍýÀ߷פǤÎÊѹ¹ÅÀ - ¥ì¥×¥ê¥«¤Î½êºß: FileINode(inode) : FileCopy(inode) = 0¡Á1 : 1¡ÁN ¤Ï INode(inode) : FileCopy(inode) = 0¡Á1 : 0¡ÁN ¤È¤Ê¤ë¡£ FileCopy ¦¤¬ 0 ¤Ë¤Ê¤ë¤Î¤Ï¡¢INode ¤¬¥Õ¥¡¥¤¥ë°Ê³°¤Î¾ì¹ç¡£ ´ØÏ¢¼ÂÂÎ: DeadFileCopy °À­: inode: ¿ô»ú, ¡ß1 (PK) igen: ¿ô»ú, ¡ß1 (PK) hostname: ʸ»úÎó [CI], ¡ß1 (PK) ´ØÏ¢: - ¸Å¤¤¥ì¥×¥ê¥«¤Î½êºß: FileINode(inode) : DeadFileCopy(inode) = 0¡Á1 : 0¡ÁN - ¸Å¤¤¥ì¥×¥ê¥«¤òÊÝ»ý¤¹¤ë: Host(hostname) : DeadFileCopy(hostname) = 1 : 0¡ÁN ¢¨ ʪÍýÀ߷פǤÎÊѹ¹ÅÀ - ¸Å¤¤¥ì¥×¥ê¥«¤Î½êºß: FileINode(inode) : DeadFileCopy(inode) = 0¡Á1 : 0¡ÁN ¤Ï INode(inode) : DeadFileCopy(inode) = 0¡Á1 : 0¡ÁN ¤È¤Ê¤ë¡£ ´ØÏ¢¼ÂÂÎ: DirEntry °À­: dirINode: ¿ô»ú, ¡ß1 (PK) (FK) dirINode==1 ¤ò root directory ¤È¤¹¤ë¡£ entryName: ʸ»úÎó, ¡ß1 (PK) entryINode: ¿ô»ú, ¡ß1 (FK) entryINode ¤Ï ·è¤·¤Æ 1 (root directory) ¤ò»Ø¤µ¤Ê¤¤¡£ ´ØÏ¢: - ¥Ç¥£¥ì¥¯¥È¥ê¤Ë½ê°¤¹¤ë: DirINode(inode) : DirEntry(dirINode) = 1 : 0¡ÁN DirEntry ¤¬ 0 ¤È¤Ê¤ë¤Î¤Ï¶õ¥Ç¥£¥ì¥¯¥È¥ê¤Î¾ì¹ç¡£ - ¥Ñ¥¹Ì¾¤¬»Ø¤¹ DirEntry(entryINode) : INode(inode) = 0¡Á1 : 1 DirEntry ¤¬ 0 ¤È¤Ê¤ë¤Î¤Ï root directory ¤Î¤ß¡£ hardlink ¤òµö¤¹¤Ê¤é DirEntry ¦¤Ï¡¢0¡ÁN ¤È¤Ê¤ë¡£ ¢¨ ʪÍýÀ߷פǤÎÊѹ¹ÅÀ ´ØÏ¢¤Î°Üư: - ¥Ç¥£¥ì¥¯¥È¥ê¤Ë½ê°¤¹¤ë: DirINode(inode) : DirEntry(dirINode) = 1 : 0¡ÁN ¤Ï¡¢ INode(inode) : DirEntry(dirINode) = 1 : 0¡ÁN ¤È¤Ê¤ë¡£ DirEntry ¤¬ 0 ¤È¤Ê¤ë¾ì¹ç¤È¤·¤Æ¡¢¶õ¥Ç¥£¥ì¥¯¥È¥ê¤Î¾ì¹ç¤Î ¾¤Ë¡¢¤½¤Î INode ¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤¤¾ì¹ç¤¬Áý¤¨¤ë¡£ ¼ÂÂÎ: XAttr °À­: inumber: ¿ô»ú, ¡ß1 (PK) attrname: ʸ»úÎó, ¡ß1 (PK) attrvalue: ¥Ð¥¤¥Ê¥ê, ¡ß1 ´ØÏ¢: ¼ÂÂÎ: XmlAttr °À­: inumber: ¿ô»ú, ¡ß1 (PK) attrname: ʸ»úÎó, ¡ß1 (PK) attrvalue: XML, ¡ß1 ´ØÏ¢: TODO: ACL ¥µ¥Ý¡¼¥È gfarm-2.4.1/doc/internal/ja/gfarm-coding-style.txt0000644000000000000000000000645211507222722020526 0ustar rootroot¢£ ¥³¡¼¥Ç¥£¥ó¥°¡¦¥¹¥¿¥¤¥ë³µÍ× 2001ǯÅö»þ¤Î NetBSD KNF (kernel normal form) ¤Ë¡¢¤ª¤ª¤è¤½½¾¤Ã¤Æ¤¤¤Þ¤¹¡£ NetBSD KNF: http://cvsweb.netbsd.org/bsdweb.cgi/src/share/misc/style?rev=1.20&content-type=text/x-cvsweb-markup ¤¿¤À¤·¡¢°Ê²¼¤Î¤è¤¦¤Ê¡¢NetBSD ¸ÇÍ­¤Î½¬´·¤Ë¤Ï½¾¤Ã¤Æ¤¤¤Þ¤»¤ó¡£ ¡¦#ifndef _lint ¡¦__COPYRIGHT ¡¦__RCSID( ¡¦setprogname()/getprogname() ¤Þ¤¿¡¢°Ê²¼¤Î¤è¤¦¤ÊÅÀ¤¬Â礭¤¯°ã¤¤¤Þ¤¹¡£ ¡¦´Ø¿ô¤ÎÄêµÁ¤Ï¡¢¸Æ¤Ð¤ì¤ë¦¤¬Àè¡¢¸Æ¤Ö¦¤¬¸å¡¢¤³¤Î¤¿¤á¡¢Áê¸ßºÆµ¢¤¹¤ë¤è¤¦ ¤Ê¾ì¹ç¤ò½ü¤­¡¢static ¤Ê´Ø¿ô¤Î´Ø¿ô¥×¥í¥È¥¿¥¤¥×Àë¸À¤Ï¹Ô¤Ê¤ï¤Ê¤¤¡£ ¡¦¥Ø¥Ã¥À¤ÎÆó½Å¥¤¥ó¥¯¥ë¡¼¥É¤«¤é¤ÎÊݸî¤Ï¤·¤Ê¤¤¡£ ¥Ø¥Ã¥À¤Î¥Í¥¹¥È¤Ï´ðËÜŪ¤Ï¹Ô¤Ê¤ï¤Ê¤¤¤¿¤á¡£( Åù¤ÏÎã³°) ¡¦¹½Â¤ÂΤä enum ¤ËÂФ¹¤ë typedef ¤Ï¹Ô¤Ê¤ï¤º¡¢struct XXX ¤ä enum YYYY ¤È½ñ¤¯¡£ ¤³¤ì¤Ï¥Ø¥Ã¥À¤Î¥Í¥¹¥È¤òÈò¤±¤ë¤¿¤á¡£ ÍøÍÑÎã¤Ï gfs_client.h ¤ÎÀèÆ¬¤Î struct ¤ä enum ¤ÎÀë¸À¤ò»²¾È¡£ ¢£ ¥³¥ó¥Ñ¥¤¥é¤«¤é¤Î·Ù¹ð¤Ë¤Ä¤¤¤Æ ¥³¥ß¥Ã¥È¤¹¤ëÁ°¤Ë¡¢¥³¥ó¥Ñ¥¤¥é¤«¤é¤Î·Ù¹ð¤¬¤Ê¤¤¤³¤È¤ò³Îǧ¤·¤Æ¤¯¤À¤µ¤¤¡£ ¤¿¤À¤·¡¢°Ê²¼¤Î OpenMP ¤Ë´Ø¤¹¤ë·Ù¹ð¤Î¤ß¤ÏÌäÂꤢ¤ê¤Þ¤»¤ó¡£ warning: ignoring #pragma omp ¡Á ¢£ ̿̾µ¬Ìó¤Ë¤Ä¤¤¤Æ ¥é¥¤¥Ö¥é¥êÃæ¤Î¸ø³«¤µ¤ì¤Æ¤¤¤ë¥·¥ó¥Ü¥ë¤Ï¡¢É¬¤º gfarm_ ¤Î¤è¤¦¤Ê ¥×¥ê¥Õ¥£¥Ã¥¯¥¹¤ò¤Ä¤±¡¢¥æ¡¼¥¶¡¼¡¦¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Î¥·¥ó¥Ü¥ë¤È ½Å¤Ê¤é¤Ê¤¤¤è¤¦¤Ë¤·¤Æ¤¤¤Þ¤¹¡£ ¢£ ¥¨¥é¡¼¥³¡¼¥É¤Ë¤Ä¤¤¤Æ ¾­Íè¤ËÅϤäơ¢·è¤·¤Æ¥¨¥é¡¼¤òÊÖ¤µ¤Ê¤¤¤³¤È¤¬³ÎÄꤷ¤Æ¤¤¤ë °ìÉô¤ÎÎã³°¤ò½ü¤­¡¢¤Û¤ÜÁ´¤Æ¤Î´Ø¿ô¤Ï¡¢Ìá¤êÃͤȤ·¤Æ¥¨¥é¡¼ ¥³¡¼¥É¤òÊÖ¤¹¤â¤Î¤È¤·¤Þ¤¹¡£ ¢£ ¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤Î #include ¤òµ­½Ò¤¹¤ë½ç½ø¤Î¸¶Â§¤Ï¡¢²¼µ­¤ÎÄ̤ê¤Ç¤¹¡£ - OSÉÕ°¤Î¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë·² - ¥µ¡¼¥É¥Ñ¡¼¥Æ¥£¡¼À½¤Î¥½¥Õ¥È¥¦¥§¥¢¤Î¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë·² Ê£¿ô¤Î¥µ¡¼¥É¥Ñ¡¼¥Æ¥£¡¼À½¥½¥Õ¥È¥¦¥§¥¢¤òÍøÍѤ·¤Æ¤¤¤ë¾ì¹ç¡¢ ¡¦¥µ¡¼¥É¥Ñ¡¼¥Æ¥£¡¼À½¥½¥Õ¥È¥¦¥§¥¢´Ö¤Ë»²¾È´Ø·¸¤¬¤¢¤ë¾ì¹ç¤Ë¤Ï¡¢ »²¾È¤µ¤ì¤ë¦(¥½¥Õ¥È¥¦¥§¥¢³¬ÁؤȤ·¤Æ²¼¤Ë°ÌÃÖ¤¹¤ëÊý)¤Î¥½¥Õ¥È¥¦¥§¥¢¤ò Àè¤Ë½ñ¤¯¡£ »²¾È¤¹¤ë¦(¥½¥Õ¥È¥¦¥§¥¢³¬ÁؤȤ·¤Æ¾å¤Ë°ÌÃÖ¤¹¤ëÊý)¤Î¥½¥Õ¥È¥¦¥§¥¢¤ò ¸å¤Ë½ñ¤¯¡£ ¡¦Æ±°ì¤Î¥½¥Õ¥È¥¦¥§¥¢¤ËÉÕ°¤¹¤ë¥Ø¥Ã¥À¤Ï¡¢¤Þ¤È¤á¤Æ½ñ¤¯¡£ - gfarm ¤Î¸ø³«¥Ø¥Ã¥À () libgfarm ¤ÎÍøÍѼԤؤθø³«¾ðÊó¡£ ÆâÉô¼ÂÁõ¤Ë´Ø¤¹¤ë¾ðÊó¤Ï¤³¤³¤Ë¤ÏÃÖ¤«¤Ê¤¤¡£ - gfarm ¤ÎÈó¸ø³«¥Ø¥Ã¥À ("¡ß¡ß.h") ¡¦¥Ø¥Ã¥À´Ö¤Î½ç½ø¤Ï¡¢ »²¾È¤µ¤ì¤ë¦(¥½¥Õ¥È¥¦¥§¥¢³¬ÁؤȤ·¤Æ²¼¤Ë°ÌÃÖ¤¹¤ëÊý)¤Î¥½¥Õ¥È¥¦¥§¥¢¤ò Àè¤Ë½ñ¤¯¡£ »²¾È¤¹¤ë¦(¥½¥Õ¥È¥¦¥§¥¢³¬ÁؤȤ·¤Æ¾å¤Ë°ÌÃÖ¤¹¤ëÊý)¤Î¥½¥Õ¥È¥¦¥§¥¢¤ò ¸å¤Ë½ñ¤¯¡£ ¡¦libgfarm/gfutil, libgfarm/gfsl, libgfarm/gfarm ¤Î»°¼Ô¤Ë¤Ä¤¤¤Æ¤Ï¡¢ Ʊ°ì¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë½ê°¤¹¤ë¥Ø¥Ã¥À¤Ï¤Þ¤È¤á¤Æ½ñ¤¯¡£ #include ¤¹¤ë½ç½ø¤Ï¡¢ 1. libgfarm/gfutil 2. libgfarm/gfsl 3. libgfarm/gfarm ¤Î½çÈ֤Ȥ¹¤ë¡£(¥½¥Õ¥È¥¦¥§¥¢³¬Áؤ¬¡¢¤³¤Î½ç¤Ç²¼¢ª¾å¤È¤Ê¤Ã¤Æ¤¤¤ë¤¿¤á) ¥½¥Õ¥È¥¦¥§¥¢¤Î³¬Áشط¸¤È¤·¤Æ¤Ï¡¢gfutil ¤¬°ìÈÖÄãÁØ¡¢gfsl ¤¬¤½¤Î¾å¡¢ libgfarm/gfarm ¤Ï°ìÈÖ¾åÁؤȤʤ롣gfutil ¤ä gfsl ¤Ç¤Ï¡¢libgfarm/gfarm/ ¤Îµ¡Ç½¤ÏÍøÍѤ·¤Ê¤¤¡£¤¿¤È¤¨¤Ð gfarm_error_t ¤â»È¤ï¤Ê¤¤¡£ ¡¦¶ñÂÎŪ¤Ë¤Ï²¼µ­¤ÎÄ̤ꡣ /* gfutil */ #include "hash.h" #include "gfevent.h" #include "gfutil.h" /* gfsl public */ #include "gfsl_config.h" #include "gfarm_gsi.h" #include "gfarm_auth.h" #include "gfarm_secure_session.h" /* gfsl private */ #include "tcputil.h" #include "misc.h" /* gfarm */ #include "iobuffer.h" #include "gfp_xdr.h" #include "io_fd.h" #include "io_gfsl.h" #include "hostspec.h" #include "host.h" #include "param.h" #include "sockopt.h" #include "auth.h" #include "auth_gsi.h" #include "gfm_proto.h" #include "gfs_proto.h" #include "gfs_client.h" #include "gfj_client.h" #include "gfs_pio.h" #include "config.h" gfarm-2.4.1/doc/internal/ja/gfarm-v2-schema.eps0000644000000000000000000006761511507222722017672 0ustar rootroot%!PS-Adobe-2.0 EPSF-1.2 %%Creator: idraw %%DocumentFonts: Helvetica GothicBBB-Medium-EUC-H Times-Roman Ryumin-Light-EUC-H %%Pages: 1 %%BoundingBox: 44 134 586 669 %%EndComments %%BeginProcSet: cmpfont.ps 1 2 % composite fonts for ASCII-EUC mixed string % Version 1.2 1/31/1990 % Author Ken'ichi HANDA (handa@etl.go.jp) % Modified Norio Katayama (katayama@rd.nacsis.ac.jp),1998% Anyone can freely copy, modify, distribute this program. /copyfont { % font-dic extra-entry-count copyfont font-dic 1 index maxlength add dict begin { 1 index /FID ne 2 index /UniqueID ne and {def} {pop pop} ifelse } forall currentdict end } bind def /compositefont { % ASCIIFontName EUCFontName compositefont font' userdict /fixeucfont_dict known not { userdict begin /fixeucfont_dict 2 dict begin /UpperByteEncoding [ 16#00 1 16#20 { pop 0 } for 16#21 1 16#28 { 16#20 sub } for 16#29 1 16#2F { pop 0 } for 16#30 1 16#74 { 16#27 sub } for 16#75 1 16#FF { pop 0 } for ] def /LowerByteEncoding [ 16#00 1 16#A0 { pop /.notdef } for 16#A1 1 16#FE { 16#80 sub 16 2 string cvrs (cXX) dup 1 4 -1 roll putinterval cvn } for /.notdef ] def currentdict end def end } if findfont dup /FontType get 0 eq { 12 dict begin % % 7+8 bit EUC font % 12 dict begin /EUCFont exch def /FontInfo (7+8 bit EUC font) readonly def /PaintType 0 def /FontType 0 def /FontMatrix matrix def % /FontName /Encoding fixeucfont_dict /UpperByteEncoding get def /FMapType 2 def EUCFont /WMode known { EUCFont /WMode get /WMode exch def } { /WMode 0 def } ifelse /FDepVector [ EUCFont /FDepVector get 0 get [ 16#21 1 16#28 {} for 16#30 1 16#74 {} for ] { 13 dict begin /EUCFont EUCFont def /UpperByte exch 16#80 add def % /FontName /FontInfo (EUC lower byte font) readonly def /PaintType 0 def /FontType 3 def /FontMatrix matrix def /FontBBox {0 0 0 0} def /Encoding fixeucfont_dict /LowerByteEncoding get def % /UniqueID % /WMode /BuildChar { gsave exch dup /EUCFont get setfont /UpperByte get 2 string dup 0 4 -1 roll put dup 1 4 -1 roll put dup stringwidth setcharwidth 0 0 moveto show grestore } bind def currentdict end /lowerbytefont exch definefont } forall ] def currentdict end /eucfont exch definefont exch findfont 1 copyfont dup begin /FontMatrix FontMatrix [1 0 0 1 0 0.05] matrix concatmatrix def end /asciifont exch definefont exch /FDepVector [ 4 2 roll ] def /FontType 0 def /WMode 0 def /FMapType 4 def /FontMatrix matrix def /Encoding [0 1] def /FontBBox {0 0 0 0} def currentdict end }{ pop findfont 0 copyfont } ifelse } def /slantfont { % FontName slant-degree slantfont font' exch findfont 1 copyfont begin [ 1 0 4 -1 roll 1 0 0 ] FontMatrix exch matrix concatmatrix /FontMatrix exch def currentdict end } def %%EndProcSet %%BeginProcSet: idraw 3 0 /IdrawDict 52 dict def IdrawDict begin /arrowHeight 8 def /arrowWidth 4 def % reencodeISO was modified to deal with a composite font correctly. % Modifier: Shigeru Chiba (chiba@is.s.u-tokyo.ac.jp) % Kazuhiro Kazama (kazama@expert-sun.ntt.jp) /reencodeISOa { % CompFontName font reencodeISOb font' dup length dict begin { 1 index /FID ne { def }{ pop pop } ifelse } forall /Encoding ISOLatin1Encoding def currentdict end definefont } def /reencodeISO { % FontName reencodeISO font dup dup findfont dup /FontType get 0 ne { reencodeISOa }{ dup length dict begin { 1 index dup /FID eq { pop pop pop }{ /FDepVector eq { dup length array copy dup dup 0 get 4 index exch reencodeISOa 0 exch put def }{ def } ifelse } ifelse } forall currentdict end definefont } ifelse } def /ISOLatin1Encoding [ /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef /space/exclam/quotedbl/numbersign/dollar/percent/ampersand/quoteright /parenleft/parenright/asterisk/plus/comma/minus/period/slash /zero/one/two/three/four/five/six/seven/eight/nine/colon/semicolon /less/equal/greater/question/at/A/B/C/D/E/F/G/H/I/J/K/L/M/N /O/P/Q/R/S/T/U/V/W/X/Y/Z/bracketleft/backslash/bracketright /asciicircum/underscore/quoteleft/a/b/c/d/e/f/g/h/i/j/k/l/m /n/o/p/q/r/s/t/u/v/w/x/y/z/braceleft/bar/braceright/asciitilde /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef /.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef/.notdef /.notdef/dotlessi/grave/acute/circumflex/tilde/macron/breve /dotaccent/dieresis/.notdef/ring/cedilla/.notdef/hungarumlaut /ogonek/caron/space/exclamdown/cent/sterling/currency/yen/brokenbar /section/dieresis/copyright/ordfeminine/guillemotleft/logicalnot /hyphen/registered/macron/degree/plusminus/twosuperior/threesuperior /acute/mu/paragraph/periodcentered/cedilla/onesuperior/ordmasculine /guillemotright/onequarter/onehalf/threequarters/questiondown /Agrave/Aacute/Acircumflex/Atilde/Adieresis/Aring/AE/Ccedilla /Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex /Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis /multiply/Oslash/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute /Thorn/germandbls/agrave/aacute/acircumflex/atilde/adieresis /aring/ae/ccedilla/egrave/eacute/ecircumflex/edieresis/igrave /iacute/icircumflex/idieresis/eth/ntilde/ograve/oacute/ocircumflex /otilde/odieresis/divide/oslash/ugrave/uacute/ucircumflex/udieresis /yacute/thorn/ydieresis ] def /none null def /numGraphicParameters 17 def /stringLimit 65535 def /Begin { save numGraphicParameters dict begin } def /End { end restore } def /SetB { dup type /nulltype eq { pop false /brushRightArrow idef false /brushLeftArrow idef true /brushNone idef } { /brushDashOffset idef /brushDashArray idef 0 ne /brushRightArrow idef 0 ne /brushLeftArrow idef /brushWidth idef false /brushNone idef } ifelse } def /SetCFg { /fgblue idef /fggreen idef /fgred idef } def /SetCBg { /bgblue idef /bggreen idef /bgred idef } def /SetF { /printSize idef /printFont idef } def /SetP { dup type /nulltype eq { pop true /patternNone idef } { dup -1 eq { /patternGrayLevel idef /patternString idef } { /patternGrayLevel idef } ifelse false /patternNone idef } ifelse } def /BSpl { 0 begin storexyn newpath n 1 gt { 0 0 0 0 0 0 1 1 true subspline n 2 gt { 0 0 0 0 1 1 2 2 false subspline 1 1 n 3 sub { /i exch def i 1 sub dup i dup i 1 add dup i 2 add dup false subspline } for n 3 sub dup n 2 sub dup n 1 sub dup 2 copy false subspline } if n 2 sub dup n 1 sub dup 2 copy 2 copy false subspline patternNone not brushLeftArrow not brushRightArrow not and and { ifill } if brushNone not { istroke } if 0 0 1 1 leftarrow n 2 sub dup n 1 sub dup rightarrow } if end } dup 0 4 dict put def /Circ { newpath 0 360 arc patternNone not { ifill } if brushNone not { istroke } if } def /CBSpl { 0 begin dup 2 gt { storexyn newpath n 1 sub dup 0 0 1 1 2 2 true subspline 1 1 n 3 sub { /i exch def i 1 sub dup i dup i 1 add dup i 2 add dup false subspline } for n 3 sub dup n 2 sub dup n 1 sub dup 0 0 false subspline n 2 sub dup n 1 sub dup 0 0 1 1 false subspline patternNone not { ifill } if brushNone not { istroke } if } { Poly } ifelse end } dup 0 4 dict put def /Elli { 0 begin newpath 4 2 roll translate scale 0 0 1 0 360 arc patternNone not { ifill } if brushNone not { istroke } if end } dup 0 1 dict put def /Line { 0 begin 2 storexyn newpath x 0 get y 0 get moveto x 1 get y 1 get lineto brushNone not { istroke } if 0 0 1 1 leftarrow 0 0 1 1 rightarrow end } dup 0 4 dict put def /MLine { 0 begin storexyn newpath n 1 gt { x 0 get y 0 get moveto 1 1 n 1 sub { /i exch def x i get y i get lineto } for patternNone not brushLeftArrow not brushRightArrow not and and { ifill } if brushNone not { istroke } if 0 0 1 1 leftarrow n 2 sub dup n 1 sub dup rightarrow } if end } dup 0 4 dict put def /Poly { 3 1 roll newpath moveto -1 add { lineto } repeat closepath patternNone not { ifill } if brushNone not { istroke } if } def /Rect { 0 begin /t exch def /r exch def /b exch def /l exch def newpath l b moveto l t lineto r t lineto r b lineto closepath patternNone not { ifill } if brushNone not { istroke } if end } dup 0 4 dict put def /Text { ishow } def /idef { dup where { pop pop pop } { exch def } ifelse } def /ifill { 0 begin gsave patternGrayLevel -1 ne { fgred bgred fgred sub patternGrayLevel mul add fggreen bggreen fggreen sub patternGrayLevel mul add fgblue bgblue fgblue sub patternGrayLevel mul add setrgbcolor eofill } { eoclip originalCTM setmatrix pathbbox /t exch def /r exch def /b exch def /l exch def /w r l sub ceiling cvi def /h t b sub ceiling cvi def /imageByteWidth w 8 div ceiling cvi def /imageHeight h def bgred bggreen bgblue setrgbcolor eofill fgred fggreen fgblue setrgbcolor w 0 gt h 0 gt and { l w add b translate w neg h scale w h true [w 0 0 h neg 0 h] { patternproc } imagemask } if } ifelse grestore end } dup 0 8 dict put def /istroke { gsave brushDashOffset -1 eq { [] 0 setdash 1 setgray } { brushDashArray brushDashOffset setdash fgred fggreen fgblue setrgbcolor } ifelse brushWidth setlinewidth originalCTM setmatrix stroke grestore } def /ishow { 0 begin gsave fgred fggreen fgblue setrgbcolor /fontDict printFont printSize scalefont dup setfont def /descender fontDict begin 0 [FontBBox] 1 get FontMatrix end transform exch pop def /vertoffset 1 printSize sub descender sub def { 0 vertoffset moveto show /vertoffset vertoffset printSize sub def } forall grestore end } dup 0 3 dict put def /patternproc { 0 begin /patternByteLength patternString length def /patternHeight patternByteLength 8 mul sqrt cvi def /patternWidth patternHeight def /patternByteWidth patternWidth 8 idiv def /imageByteMaxLength imageByteWidth imageHeight mul stringLimit patternByteWidth sub min def /imageMaxHeight imageByteMaxLength imageByteWidth idiv patternHeight idiv patternHeight mul patternHeight max def /imageHeight imageHeight imageMaxHeight sub store /imageString imageByteWidth imageMaxHeight mul patternByteWidth add string def 0 1 imageMaxHeight 1 sub { /y exch def /patternRow y patternByteWidth mul patternByteLength mod def /patternRowString patternString patternRow patternByteWidth getinterval def /imageRow y imageByteWidth mul def 0 patternByteWidth imageByteWidth 1 sub { /x exch def imageString imageRow x add patternRowString putinterval } for } for imageString end } dup 0 12 dict put def /min { dup 3 2 roll dup 4 3 roll lt { exch } if pop } def /max { dup 3 2 roll dup 4 3 roll gt { exch } if pop } def /midpoint { 0 begin /y1 exch def /x1 exch def /y0 exch def /x0 exch def x0 x1 add 2 div y0 y1 add 2 div end } dup 0 4 dict put def /thirdpoint { 0 begin /y1 exch def /x1 exch def /y0 exch def /x0 exch def x0 2 mul x1 add 3 div y0 2 mul y1 add 3 div end } dup 0 4 dict put def /subspline { 0 begin /movetoNeeded exch def y exch get /y3 exch def x exch get /x3 exch def y exch get /y2 exch def x exch get /x2 exch def y exch get /y1 exch def x exch get /x1 exch def y exch get /y0 exch def x exch get /x0 exch def x1 y1 x2 y2 thirdpoint /p1y exch def /p1x exch def x2 y2 x1 y1 thirdpoint /p2y exch def /p2x exch def x1 y1 x0 y0 thirdpoint p1x p1y midpoint /p0y exch def /p0x exch def x2 y2 x3 y3 thirdpoint p2x p2y midpoint /p3y exch def /p3x exch def movetoNeeded { p0x p0y moveto } if p1x p1y p2x p2y p3x p3y curveto end } dup 0 17 dict put def /storexyn { /n exch def /y n array def /x n array def n 1 sub -1 0 { /i exch def y i 3 2 roll put x i 3 2 roll put } for } def /SSten { fgred fggreen fgblue setrgbcolor dup true exch 1 0 0 -1 0 6 -1 roll matrix astore } def /FSten { dup 3 -1 roll dup 4 1 roll exch newpath 0 0 moveto dup 0 exch lineto exch dup 3 1 roll exch lineto 0 lineto closepath bgred bggreen bgblue setrgbcolor eofill SSten } def /Rast { exch dup 3 1 roll 1 0 0 -1 0 6 -1 roll matrix astore } def /arrowhead { 0 begin transform originalCTM itransform /taily exch def /tailx exch def transform originalCTM itransform /tipy exch def /tipx exch def /dy tipy taily sub def /dx tipx tailx sub def /angle dx 0 ne dy 0 ne or { dy dx atan } { 90 } ifelse def gsave originalCTM setmatrix tipx tipy translate angle rotate newpath arrowHeight neg arrowWidth 2 div moveto 0 0 lineto arrowHeight neg arrowWidth 2 div neg lineto patternNone not { originalCTM setmatrix /padtip arrowHeight 2 exp 0.25 arrowWidth 2 exp mul add sqrt brushWidth mul arrowWidth div def /padtail brushWidth 2 div def tipx tipy translate angle rotate padtip 0 translate arrowHeight padtip add padtail add arrowHeight div dup scale arrowheadpath ifill } if brushNone not { originalCTM setmatrix tipx tipy translate angle rotate arrowheadpath istroke } if grestore end } dup 0 9 dict put def /arrowheadpath { newpath arrowHeight neg arrowWidth 2 div moveto 0 0 lineto arrowHeight neg arrowWidth 2 div neg lineto } def /leftarrow { 0 begin y exch get /taily exch def x exch get /tailx exch def y exch get /tipy exch def x exch get /tipx exch def brushLeftArrow { tipx tipy tailx taily arrowhead } if end } dup 0 4 dict put def /rightarrow { 0 begin y exch get /tipy exch def x exch get /tipx exch def y exch get /taily exch def x exch get /tailx exch def brushRightArrow { tipx tipy tailx taily arrowhead } if end } dup 0 4 dict put def end %%EndProcSet %%EndProlog %%BeginSetup IdrawDict begin /Helvetica-Gothic /Helvetica /GothicBBB-Medium-EUC-H compositefont definefont pop /Helvetica-Gothic reencodeISO def /Times-Ryumin /Times-Roman /Ryumin-Light-EUC-H compositefont definefont pop /Times-Ryumin reencodeISO def %%EndSetup %I Idraw 10 Grid 8 8 %%Page: 1 1 Begin %I b u %I cfg u %I cbg u %I f u %I p u %I t [ 0.95606 0 0 0.95606 0 0 ] concat /originalCTM matrix currentmatrix def Begin %I Text %I cfg Black 0 0 0 SetCFg %I f Helvetica-Gothic-18 Helvetica-Gothic 18 SetF %I t [ 1 0 0 1 129.034 535.013 ] concat %I [ (INode) ] Text End Begin %I Text %I cfg Black 0 0 0 SetCFg %I f Helvetica-Gothic-18 Helvetica-Gothic 18 SetF %I t [ 1 0 0 1 82.0337 338.013 ] concat %I [ (DirINode) ] Text End Begin %I Text %I cfg Black 0 0 0 SetCFg %I f Helvetica-Gothic-18 Helvetica-Gothic 18 SetF %I t [ 1 0 0 1 252.034 338.013 ] concat %I [ (FileINode) ] Text End Begin %I Text %I cfg Black 0 0 0 SetCFg %I f Helvetica-Gothic-18 Helvetica-Gothic 18 SetF %I t [ 1 0 0 1 78.0337 695.013 ] concat %I [ (User) ] Text End Begin %I Text %I cfg Black 0 0 0 SetCFg %I f Helvetica-Gothic-18 Helvetica-Gothic 18 SetF %I t [ 1 0 0 1 171.034 695.013 ] concat %I [ (GroupAssignment) ] Text End Begin %I Text %I cfg Black 0 0 0 SetCFg %I f Helvetica-Gothic-18 Helvetica-Gothic 18 SetF %I t [ 1 0 0 1 369.034 695.013 ] concat %I [ (Group) ] Text End Begin %I Text %I cfg Black 0 0 0 SetCFg %I f Helvetica-Gothic-18 Helvetica-Gothic 18 SetF %I t [ 1 0 0 1 504.034 465.01 ] concat %I [ (Host) ] Text End Begin %I Text %I cfg Black 0 0 0 SetCFg %I f Helvetica-Gothic-18 Helvetica-Gothic 18 SetF %I t [ 1 0 0 1 470.041 573.012 ] concat %I [ (HostNameAlias) ] Text End Begin %I Text %I cfg Black 0 0 0 SetCFg %I f Times-Ryumin-14 Times-Ryumin 14 SetF %I t [ 1 0 0 1 78.0337 655.013 ] concat %I [ (username) ] Text End Begin %I Text %I cfg Black 0 0 0 SetCFg %I f Times-Ryumin-14 Times-Ryumin 14 SetF %I t [ 1 0 0 1 209.034 664.013 ] concat %I [ (username) (groupname) ] Text End Begin %I Text %I cfg Black 0 0 0 SetCFg %I f Times-Ryumin-14 Times-Ryumin 14 SetF %I t [ 1 0 0 1 373.034 650.013 ] concat %I [ (groupname) ] Text End Begin %I Text %I cfg Black 0 0 0 SetCFg %I f Times-Ryumin-14 Times-Ryumin 14 SetF %I t [ 1 0 0 1 497.034 434.013 ] concat %I [ (hostname) ] Text End Begin %I Text %I cfg Black 0 0 0 SetCFg %I f Times-Ryumin-14 Times-Ryumin 14 SetF %I t [ 1 0 0 1 491.034 542.013 ] concat %I [ (hostnamealias) (hostname) ] Text End Begin %I Text %I cfg Black 0 0 0 SetCFg %I f Times-Ryumin-14 Times-Ryumin 14 SetF %I t [ 1 0 0 1 167.034 503.013 ] concat %I [ (inode) (username) (groupname) ] Text End Begin %I Text %I cfg Black 0 0 0 SetCFg %I f Helvetica-Gothic-18 Helvetica-Gothic 18 SetF %I t [ 1 0 0 1 149.954 240.669 ] concat %I [ (DirEntry) ] Text End Begin %I Rect %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg none SetP %I p n %I t [ 1 -0 -0 1 62.0337 151.013 ] concat %I 7 481 80 516 Rect End Begin %I Rect %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg none SetP %I p n %I t [ 1 -0 -0 1 62.0337 151.013 ] concat %I 123 475 237 519 Rect End Begin %I Rect %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg none SetP %I p n %I t [ 1 -0 -0 1 62.0337 151.013 ] concat %I 294 476 386 520 Rect End Begin %I Rect %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg none SetP %I p n %I t [ 1 -0 -0 1 48.0337 5.01245 ] concat %I 430 504 537 541 Rect End Begin %I Rect %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg none SetP %I p n %I t [ 1 -0 -0 1 48.0337 5.01245 ] concat %I 440 412 510 435 Rect End Begin %I Rect %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg none SetP %I p n %I t [ 1 -0 -0 1 -103.046 -141.331 ] concat %I 262 305 350 357 Rect End Begin %I Rect %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg none SetP %I p n %I t [ 1 -0 -0 1 57.0337 183.013 ] concat %I 89 274 192 322 Rect End Begin %I Rect %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg none SetP %I p n %I t [ 1 -0 -0 1 50.0337 97.0125 ] concat %I 164 197 236 218 Rect End Begin %I Rect %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg none SetP %I p n %I t [ 1 -0 -0 1 63.0337 97.0125 ] concat %I 299 181 379 222 Rect End Begin %I Rect %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg none SetP %I p n %I t [ 1 -0 -0 1 63.0337 94.0125 ] concat %I 41 200 120 220 Rect End Begin %I Line %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg none SetP %I p n %I t [ 1 -0 -0 1 62.0337 151.013 ] concat %I 80 508 122 508 Line %I 1 End Begin %I Line %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg none SetP %I p n %I t [ 1 -0 -0 1 62.0337 151.013 ] concat %I 237 491 294 491 Line %I 1 End Begin %I MLine %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg none SetP %I p n %I t [ 1 -0 -0 1 48.0337 5.01245 ] concat %I 4 429 516 410 516 410 425 438 425 4 MLine %I 1 End Begin %I MLine %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg none SetP %I p n %I t [ 1 -0 -0 1 -103.046 -141.331 ] concat %I 2 262 325 351 325 2 MLine %I 1 End Begin %I MLine %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg none SetP %I p n %I t [ 1 -0 -0 1 62.0337 151.013 ] concat %I 3 23 480 23 333 82 333 3 MLine %I 1 End Begin %I Elli %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg none SetP %I p n %I t [ 1 -0 -0 1 76.0337 117.013 ] concat %I 122 284 6 6 Elli End Begin %I Line %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg none SetP %I p n %I t [ 1.4717 -0 -0 1.4717 2.53368 -1.87429 ] concat %I 106 269 159 269 Line %I 1 End Begin %I Line %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg none SetP %I p n %I t [ 1.44445 -0 -0 1.44445 5.92258 10.3458 ] concat %I 106 258 160 258 Line %I 1 End Begin %I MLine %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg none SetP %I p n %I t [ 1 -0 -0 1 62.0337 151.013 ] concat %I 3 342 475 342 315 188 315 3 MLine %I 1 End Begin %I Line %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg none SetP %I p n %I t [ 0.789028 -0 -0 1.25 125.114 111.763 ] concat %I 225 157 299 157 Line %I 1 End Begin %I Line %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg none SetP %I p n %I t [ 1 -0 -0 1 62.0337 148.013 ] concat %I 84 340 187 340 Line %I 1 End Begin %I Line %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg none SetP %I p n %I t [ 1 -0 -0 1 48.0337 5.01245 ] concat %I 430 524 537 524 Line %I 1 End Begin %I Elli %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p 0 SetP %I t [ 1 -0 -0 1 -255.045 -90.3329 ] concat %I 415 296 3 3 Elli End Begin %I Elli %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p 0 SetP %I t [ 1 -0 -0 1 -255.089 -119.318 ] concat %I 415 296 3 3 Elli End Begin %I Elli %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p 0 SetP %I t [ 1 -0 -0 1 -53.9663 12.0125 ] concat %I 415 296 3 3 Elli End Begin %I Elli %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p 0 SetP %I t [ 1 -0 -0 1 27.0339 -4.9875 ] concat %I 415 296 3 3 Elli End Begin %I Elli %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p 0 SetP %I t [ 1 -0 -0 1 64.0337 224.013 ] concat %I 415 296 3 3 Elli End Begin %I Elli %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p 0 SetP %I t [ 1 -0 -0 1 -267.966 187.013 ] concat %I 415 296 3 3 Elli End Begin %I Elli %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p 0 SetP %I t [ 1 -0 -0 1 -164.966 171.013 ] concat %I 415 296 3 3 Elli End Begin %I Elli %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p 0 SetP %I t [ 1 -0 -0 1 -115.966 346.013 ] concat %I 415 296 3 3 Elli End Begin %I Elli %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p 0 SetP %I t [ 1 -0 -0 1 -229.966 363.013 ] concat %I 415 296 3 3 Elli End Begin %I Text %I cfg Black 0 0 0 SetCFg %I f Times-Ryumin-14 Times-Ryumin 14 SetF %I t [ 1 0 0 1 169.954 210.669 ] concat %I [ (dirINode) (entryName) (entryINode) ] Text End Begin %I Text %I cfg Black 0 0 0 SetCFg %I f Times-Ryumin-12 Times-Ryumin 12 SetF %I t [ 1 0 0 1 467.034 512.013 ] concat %I [ (P) ] Text End Begin %I Text %I cfg Black 0 0 0 SetCFg %I f Times-Ryumin-12 Times-Ryumin 12 SetF %I t [ 1 0 0 1 173.034 653.013 ] concat %I [ (P) ] Text End Begin %I Text %I cfg Black 0 0 0 SetCFg %I f Times-Ryumin-12 Times-Ryumin 12 SetF %I t [ 1 0 0 1 348.034 303.013 ] concat %I [ (P) ] Text End Begin %I Text %I cfg Black 0 0 0 SetCFg %I f Times-Ryumin-12 Times-Ryumin 12 SetF %I t [ 1 0 0 1 147.891 168.681 ] concat %I [ (Z) ] Text End Begin %I Line %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg none SetP %I p n %I t [ 1 -0 -0 1 62.0337 151.013 ] concat %I 136 256 136 306 Line %I 1 End Begin %I Line %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg none SetP %I p n %I t [ 1 -0 -0 1 62.0337 151.013 ] concat %I 168 164 168 231 Line %I 1 End Begin %I Line %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg none SetP %I p n %I t [ 1 -0 -0 1 62.0337 151.013 ] concat %I 109 163 109 232 Line %I 1 End Begin %I MLine %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg none SetP %I p n %I t [ 1.00096 -0 -0 1.00096 -54.052 110.106 ] concat %I 3 213 95 177 95 177 184 3 MLine %I 1 End Begin %I MLine %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg none SetP %I p n %I t [ 1.00096 -0 -0 1.00096 -54.052 110.106 ] concat %I 5 214 66 102 66 102 314 206 314 206 346 5 MLine %I 1 End Begin %I Text %I cfg Black 0 0 0 SetCFg %I f Times-Ryumin-14 Times-Ryumin 14 SetF %I t [ 1 0 0 1 104.979 618.996 ] concat %I [ (\245\260\245\353\241\274\245\327\244\313\302\260\244\271\244\353) ] Text End Begin %I Text %I cfg Black 0 0 0 SetCFg %I f Times-Ryumin-14 Times-Ryumin 14 SetF %I t [ 1 0 0 1 276.998 618.996 ] concat %I [ (\245\346\241\274\245\266\241\274\244\362\264\336\244\340) ] Text End Begin %I Text %I cfg Black 0 0 0 SetCFg %I f Times-Ryumin-14 Times-Ryumin 14 SetF %I t [ 1 0 0 1 278.988 370.099 ] concat %I [ (\245\354\245\327\245\352\245\253\244\316\275\352\272\337) ] Text End Begin %I Text %I cfg Black 0 0 0 SetCFg %I f Times-Ryumin-14 Times-Ryumin 14 SetF %I t [ 1 0 0 1 91.9971 566.053 ] concat %I [ (INode\244\316\245\252\241\274\245\312\241\274) ] Text End Begin %I Text %I cfg Black 0 0 0 SetCFg %I f Times-Ryumin-14 Times-Ryumin 14 SetF %I t [ 1 0 0 1 293.003 566.053 ] concat %I [ (INode\244\316\245\260\245\353\241\274\245\327) ] Text End Begin %I Text %I cfg Black 0 0 0 SetCFg %I f Times-Ryumin-14 Times-Ryumin 14 SetF %I t [ 1 0 0 1 55.0212 413.959 ] concat %I [ (\245\321\245\271\314\276\244\254\273\330\244\271) ] Text End Begin %I Text %I cfg Black 0 0 0 SetCFg %I f Times-Ryumin-14 Times-Ryumin 14 SetF %I t [ 1 0 0 1 127.995 262.981 ] concat %I [ (\245\307\245\243\245\354\245\257\245\310\245\352\244\313\275\352\302\260\244\271\244\353) ] Text End Begin %I Text %I cfg Black 0 0 0 SetCFg %I f Times-Ryumin-14 Times-Ryumin 14 SetF %I t [ 1 0 0 1 465 489.988 ] concat %I [ (\245\333\245\271\245\310\314\276\244\253\312\314\314\276\244\362\273\375\244\304) ] Text End Begin %I Text %I cfg Black 0 0 0 SetCFg %I f Times-Ryumin-14 Times-Ryumin 14 SetF %I t [ 1 0 0 1 373.034 314.013 ] concat %I [ (inode) (hostname) ] Text End Begin %I Text %I cfg Black 0 0 0 SetCFg %I f Helvetica-Gothic-18 Helvetica-Gothic 18 SetF %I t [ 1 0 0 1 364.034 338.013 ] concat %I [ (FileCopy) ] Text End Begin %I MLine %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg none SetP %I p n %I t [ 1 -0 -0 1 -37 119 ] concat %I 4 479 172 622 172 622 309 595 309 4 MLine %I 1 End Begin %I Poly %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg none SetP %I p n %I t [ 0.242424 -0 -0 0.242424 220.091 292.97 ] concat %I 4 309 94 277 62 309 30 341 62 4 Poly End Begin %I Rect %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg none SetP %I p n %I t [ 1 -0 -0 1.32333 69.0291 -96.6732 ] concat %I 299 181 379 222 Rect End Begin %I Elli %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p 0 SetP %I t [ 1 -0 -0 1 -47.9709 -109.894 ] concat %I 415 296 3 3 Elli End Begin %I Elli %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg %I p 0 SetP %I t [ 1 -0 -0 1 33.0293 -126.894 ] concat %I 415 296 3 3 Elli End Begin %I Text %I cfg Black 0 0 0 SetCFg %I f Times-Ryumin-12 Times-Ryumin 12 SetF %I t [ 1 0 0 1 354.029 181.107 ] concat %I [ (P) ] Text End Begin %I Text %I cfg Black 0 0 0 SetCFg %I f Helvetica-Gothic-18 Helvetica-Gothic 18 SetF %I t [ 1 0 0 1 356.04 216.107 ] concat %I [ (DeadFileCopy) ] Text End Begin %I Text %I cfg Black 0 0 0 SetCFg %I f Times-Ryumin-14 Times-Ryumin 14 SetF %I t [ 1 0 0 1 379.029 192.107 ] concat %I [ (inode) (igen) (hostname) ] Text End Begin %I Poly %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg none SetP %I p n %I t [ 0.242424 -0 -0 0.242424 206.102 269.988 ] concat %I 4 309 94 277 62 309 30 341 62 4 Poly End Begin %I MLine %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg none SetP %I p n %I t [ 0.999231 -0 -0 0.999231 -71.9447 2.99769 ] concat %I 4 363 282 392 282 392 184 440 184 4 MLine %I 1 End Begin %I MLine %I b 65535 0 0 0 [] 0 SetB %I cfg Black 0 0 0 SetCFg %I cbg White 1 1 1 SetCBg none SetP %I p n %I t [ 0.999231 -0 -0 0.999231 -71.9447 2.99769 ] concat %I 4 521 164 677 164 677 434 631 434 4 MLine %I 1 End Begin %I Text %I cfg Black 0 0 0 SetCFg %I f Times-Ryumin-14 Times-Ryumin 14 SetF %I t [ 1 0 0 1 327.95 254.188 ] concat %I [ (\270\305\244\244\245\354\245\327\245\352\245\253\244\316\275\352\272\337) ] Text End Begin %I Text %I cfg Black 0 0 0 SetCFg %I f Times-Ryumin-14 Times-Ryumin 14 SetF %I t [ 1 0 0 1 454.992 380.002 ] concat %I [ (\245\354\245\327\245\352\245\253\244\362\312\335\273\375\244\271\244\353) ] Text End Begin %I Text %I cfg Black 0 0 0 SetCFg %I f Times-Ryumin-14 Times-Ryumin 14 SetF %I t [ 1 0 0 1 458.989 155.175 ] concat %I [ (\270\305\244\244\245\354\245\327\245\352\245\253\244\362\312\335\273\375\244\271\244\353) ] Text End End %I eop showpage %%Trailer end gfarm-2.4.1/doc/internal/ja/gfarm-source-tree.txt0000644000000000000000000001620011507222722020352 0ustar rootroot¥½¡¼¥¹¥³¡¼¥É¤Î¹½À®¤Ï¡¢²¼µ­¤Î¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£ makes/ make ¤ËÍøÍѤ·¤Æ¤¤¤ë»ÅÁÈ¤ß include/gfarm ¤ª¤è¤Ó ¢ª À¸À®Êª ${prefix}/include/gfarm/*.h gfarm ¥é¥¤¥Ö¥é¥ê¤Î¥æ¡¼¥¶¡¼ ¤Ø¤Î¸ø³«¥Ø¥Ã¥À lib/libgfarm/ ¢ª À¸À®Êª ${prefix}/lib/libgfarm.a gfarm ¥é¥¤¥Ö¥é¥ê ¥æ¡¼¥¶¡¼¤Ø¸ø³«¤·¤Ê¤¤´Ø¿ô¤Î prototype Àë¸À¤Ï¡¢ ¤³¤Á¤é¤Î¥Ç¥£¥ì¥¯¥È¥ê°Ê²¼¤Î *.h ¤Ë¤¢¤ë¡£¤³¤Á¤é¤Î¥Ø¥Ã¥À ¤Ï¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Ê¤¤¡£ gfutil/ gfarm ¤È GFSL ¤ÎÁÐÊý¤«¤éÍøÍѤµ¤ì¤ëÉôʬ¤ò ÀÚ¤ê½Ð¤·¤¿¤â¤Î¡£ libgfarm/gfsl ¢ª libgfarm/gfutil libgfarm/gfarm ¢ª libgfarm/gfsl libgfarm/gfarm ¢ª libgfarm/gfutil ¤È¤¤¤¦°Í¸´Ø·¸¤Ë¤Ê¤ë¡£ gfsl/ GFSL - GFarm Security Layer¡£ globus ¤Î security layer ¤Ç¤¢¤ë GSI ¤È¤Î glue¡£ devtty@SourceForge ºîÀ®¡£ /usr/prj/etl/doc/GFSL/ »²¾È¡£ ¤«¤Ä¤Æ¤Ï¡¢${prefix}/lib/libgfsl.a ¤È¤¤¤¦ÆÈΩ¤·¤¿ ¥é¥¤¥Ö¥é¥ê¤À¤Ã¤¿¡£ gfarm/ gfarm ¥é¥¤¥Ö¥é¥ê¤ÎËÜÂÎ lib/gfs_hook/ ¢ª À¸À®Êª ${prefix}/lib/{gfs_hook.o,gfs_hook_debug.o} open(2) ¤ä read(2), write(2) ¤Ê¤É¡¢UNIX ɸ½à¤Î ´Ø¿ô¤òÃÖ¤­´¹¤¨¡¢"gfarm:¡ß¡ß" ¤È¤¤¤¦¥Õ¥¡¥¤¥ë¤Ø¤Î ¥¢¥¯¥»¥¹¤Ï¡¢gfarm ¥é¥¤¥Ö¥é¥ê¤Ø¤Î¸Æ¤Ó¤À¤·¤ËÊѹ¹ ¤¹¤ë»ÅÁȤߡ£ server/gfmd/ ¢ª À¸À®Êª ${prefix}/sbin/gfmd ¥á¥¿¥Ç¡¼¥¿¡¦¥µ¡¼¥Ð¡¼ server/gfsd/ ¢ª À¸À®Êª ${prefix}/sbin/gfsd ³Æ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Çưºî¤·¡¢¥Õ¥¡¥¤¥ëÆâÍÆ¤Ø¤Î¥¢¥¯¥»¥¹¤ò Ä󶡤¹¤ë¥µ¡¼¥Ð¡¼¡£ gftools/ ¢ª ${prefix}/bin/* gfarm ´Ø·¸¤Î³Æ¼ï¥³¥Þ¥ó¥É ¾Ü¤·¤¯¤Ï man1, man8 »²¾È gfptools/ ¢ª ${prefix}/bin/* gfarm ¥¹¥×¡¼¥ë (gfarm:...) ¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤ë¥Ð¥¤¥Ê¥ê bench/ ¢ª ${prefix}/bin/* (¥Ç¥Õ¥©¡¼¥ë¥È¤Ç¤ÏÀ¸À®¤·¤Ê¤¤) gfarm ¤ÇÍøÍѤ·¤Æ¤¤¤ë¥Ù¥ó¥Á¥Þ¡¼¥¯¡¦¥×¥í¥°¥é¥à doc/ ¢ª À¸À®Êª ${prefix}/share/doc/ doc/docbook/{en,ja}/ref/ ¢ª ¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Ê¤¤ ¤Û¤È¤ó¤É¤Î man page ¤È HTML ¥Õ¥¡¥¤¥ë¤Ï¡¢¤³¤³¤Ë ¤¢¤ë DocBook ·Á¼°¤Î SGML ¥Õ¥¡¥¤¥ë¤«¤é¼«Æ°À¸À® ¤µ¤ì¤Æ¤¤¤ë¡£ Êѹ¹¼ê½ç¤Ï¡¢²¼µ­¤ÎÄ̤ꡣ 1. doc/docbook/{en,ja}/ref/ ¤Î²¼¤ò½¤Àµ¡¢¥³¥ß¥Ã¥È 2. "make man" ¤ò¼Â¹Ô¤·¡¢man page ¤òºÆÀ¸À®¤¹¤ë¡£ 3. "make html" ¤ò¼Â¹Ô¤·¡¢html ¥Õ¥¡¥¤¥ë¤òºÆÀ¸À®¤¹¤ë¡£ 4. man page ¤È html ¥Õ¥¡¥¤¥ë¤ò¥³¥ß¥Ã¥È doc/html/{en,ja}/ref/ ¢ª À¸À®Êª ${prefix}/share/doc/html/ ¤³¤³¤Ë¤¢¤ë¥Õ¥¡¥¤¥ë¤Ï¡¢¤Û¤È¤ó¤ÉÁ´¤Æ doc/docbook/{en,ja}/ref/ ¤«¤éÀ¸À®¤µ¤ì¤Æ¤¤¤ë¡£ ½¾¤Ã¤Æ¡¢¥Þ¥Ë¥å¥¢¥ë¤Î¹¹¿·¤Ï¡¢Ä¾Àܤ³¤³¤òÊѹ¹¤¹¤ë ¤Î¤Ç¤Ï¤Ê¤¯¡¢doc/docbook/{en,ja}/ref/ ¤òÊѹ¹¤¹¤ë ɬÍפ¬¤¢¤ë¡£ doc/docbook/{en,ja}/ref/ ¤ò»²¾È¡£ ¤¿¤À¤·¡¢°Ê²¼¤Î¥Õ¥¡¥¤¥ë¤ÏÎã³°¤Ç¡¢ÊÌÅÓ¼ê¤ÇÊݼ餹¤ë¡£ doc/html/index.html doc/html/pic/* doc/html/en/ref/index.html doc/html/ja/ref/index.html doc/html/en/user/* doc/html/ja/user/* man/ ¢ª À¸À®Êª ${prefix}/man/ ¤³¤³¤Ë¤¢¤ë¥Õ¥¡¥¤¥ë¤Ï¡¢Á´¤Æ doc/docbook/{en,ja}/ref/ ¤«¤éÀ¸À®¤µ¤ì¤Æ¤¤¤ë¡£ ½¾¤Ã¤Æ¡¢¥Þ¥Ë¥å¥¢¥ë¤Î¹¹¿·¤Ï¡¢Ä¾Àܤ³¤³¤òÊѹ¹¤¹¤ë¤Î¤Ç¤Ï¤Ê¤¯¡¢ doc/docbook/{en,ja}/ref/ ¤òÊѹ¹¤¹¤ëɬÍפ¬¤¢¤ë¡£ doc/docbook/{en,ja}/ref/ ¤ò»²¾È¡£ ³Æ¥½¡¼¥¹¡¦¥Õ¥¡¥¤¥ë¤Ï¡¢²¼µ­¤Î¤è¤¦¤Êµ¡Ç½Ê¬Ã´¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£ ChangeLog Êѹ¹¥í¥°¡£gfarm-cvs@apgrid.org ¤Ëή¤ì¤¿¥á¡¼¥ë¤ò¸µ¤Ë¡¢ ·úÉô¤µ¤ó¤¬»þ¡¹À¸À®¡£ INSTALL.en ¥¤¥ó¥¹¥È¡¼¥ë¡¦¥É¥­¥å¥á¥ó¥È ±Ñ¸ìÈÇ INSTALL.ja ¥¤¥ó¥¹¥È¡¼¥ë¡¦¥É¥­¥å¥á¥ó¥È ÆüËܸìÈÇ Makefile.in Makefile ¤Î¥Æ¥ó¥×¥ì¡¼¥È configure ¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤¹¤ë¤È¡¢¤³¤ì¤ò¸µ¤Ë Makefile ¤òºîÀ®¤¹¤ë¡£ configure.ac configure ¥¹¥¯¥ê¥×¥È¤Î¥½¡¼¥¹¥³¡¼¥É configure autoconf ¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤¹¤ë¤È¡¢ configure.in ¤ò¸µ¤Ë¼«Æ°À¸À®¤µ¤ì¤ë¡£ include/gfarm/gfarm_config.h.in gfarm_config.h ¤Î¥Æ¥ó¥×¥ì¡¼¥È autoheader ¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤¹¤ë¤È¡¢ configure.ac ¤ò¸µ¤Ë¼«Æ°À¸À®¤µ¤ì¤ë¡£ makes/ config.mk.in config.mk ¤Î¥Æ¥ó¥×¥ì¡¼¥È configure ¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤¹¤ë¤È¡¢¤³¤ì¤ò¸µ¤Ë config.mk ¤òºîÀ®¤¹¤ë¡£ Ä̾ï¤Î Makefile ¤Ï¡¢var.mk ·Ðͳ¤Ç¡¢´ÖÀÜŪ¤Ë config.mk ¤òÆÉ¤ß¹þ¤à¡£ man.mk man ¥Ç¥£¥ì¥¯¥È¥êÍѤζ¦ÄÌ Makefile prog.mk ¥×¥í¥°¥é¥à¡¦¥Ç¥£¥ì¥¯¥È¥êÍѤζ¦ÄÌ Makefile subdir.mk ¥µ¥Ö¥Ç¥£¥ì¥¯¥È¥ê¤ËÂФ·¤Æ make ¤ò¸Æ¤Ó½Ð¤¹¾ì¹çÍѤΠ¶¦ÄÌ Makefile var.mk ³Æ Makefile ¤Ë¶¦Ä̤¹¤ë make ÊÑ¿ôÀßÄê ³Æ Makefile ¤Ï²¼µ­¤Î¹Ô¤ò´Þ¤à¡£ include $(top_srcdir)/makes/var.mk install-sh ¥¤¥ó¥¹¥È¡¼¥ë¥³¥Þ¥ó¥É config.guess autoconf ¥Ñ¥Ã¥±¡¼¥¸¤Î°ìÉô¡£ configure ¤¬¸Æ¤Ó½Ð¤¹¥µ¥Ö¡¦¥³¥Þ¥ó¥É¡£ config.sub autoconf ¥Ñ¥Ã¥±¡¼¥¸¤Î°ìÉô¡£ configure ¤¬¸Æ¤Ó½Ð¤¹¥µ¥Ö¡¦¥³¥Þ¥ó¥É¡£ include/gfarm/ ¤³¤³¤Î Makefile ¤Ï¡¢²¼µ­¤Î·Á¼°¤ÇÆÉ¤ß¹þ¤à¡£ #include error.h ¥¨¥é¡¼¥³¡¼¥ÉÄêµÁ gfs.h gfarm ¥Õ¥¡¥¤¥ë¥¢¥¯¥»¥¹ gfarm_misc.h ¤½¤Î¾¤â¤í¤â¤í gfarm.h ¾åµ­¤¹¤Ù¤Æ¤Î¥Ø¥Ã¥À¤ª¤è¤Ó ¤ò ¤Þ¤È¤á¤ÆÆÉ¤ß¹þ¤à lib/Makefile lib/libgfarm/gfutil/ hash.h ¥Ï¥Ã¥·¥å´Ø¿ô hash.c gfevent.h ÊÂÎó¥¢¥¯¥»¥¹ÍÑ select()/poll() wrapper gfevent.c gfutil.h logutil.c ¥Ç¡¼¥â¥óÍÑ¥í¥°´Ø¿ô daemon.c deamon(3) ¥æ¡¼¥Æ¥£¥ê¥Æ¥£´Ø¿ô¡£¥Ç¡¼¥â¥óÍÑ¡£ limit.c limit ´Ø·¸ ¥æ¡¼¥Æ¥£¥ê¥Æ¥£´Ø¿ô¡£¥Ç¡¼¥â¥ó¤«¤é¸Æ¤Ð¤ì¤ë¡£ lib/libgfarm/gfarm/ Makefile.in liberror.c ¤Î¥¨¥é¡¼¥³¡¼¥ÉÄêµÁ iobuffer.h Æþ½ÐÎÏÍÑ fifo ¥Ð¥Ã¥Õ¥¡¡£gfp_xdr ¤Î²¼ÀÁ¤±¤À¤¬¡¢ gfp_xdr ¤ÎÍøÍѼԤ«¤éľÀܸƤӤÀ¤µ¤ì¤ë¤³¤È¤â¤¢¤ë¡£ iobuffer.c gfp_xdr.h ÄÌ¿®¡¢RPC ¤Ë¤ª¤¤¤Æ XDR ¤ËÁêÅö¤¹¤ë½èÍý gfp_xdr.c io_fd.h gfp_xdr ¤Î²¼ÀÁ¤±¡£file descriptor ·Ðͳ¤Î I/O ¤òÄó¶¡ io_fd.c io_gfsl.c gfp_xdr ¤Î²¼ÀÁ¤±¡£GFSL ·Ðͳ¤Î I/O ¤òÄó¶¡ io_gfsl.h hostspec.h ÀßÄê¥Õ¥¡¥¤¥ëÃæ¤Î¥Û¥¹¥È¡¦¥Í¥Ã¥È¥ï¡¼¥¯¡¦¥¢¥É¥ì¥¹½èÍý hostspec.c param.h ÀßÄê¥Õ¥¡¥¤¥ëÃæ¤Î netparam ¥ª¥×¥·¥ç¥ó½èÍý param.c sockopt.c ÀßÄê¥Õ¥¡¥¤¥ëÃæ¤Î sockopt ¥ª¥×¥·¥ç¥ó½èÍý sockopt.h config.c ÀßÄê¥Õ¥¡¥¤¥ëÆÉ¤ß¹þ¤ß host.h host ¤Î¥¢¥É¥ì¥¹²ò·èÅù host.c host.h ¤Î canonical_hostname ¤Ë´Ø¤¹¤ë½èÍý¤Ï¡¢¥á¥¿¥Ç¡¼¥¿¤Ø¤Î ¥¢¥¯¥»¥¹¤¬¤¢¤ë¤Î¤Ç¡¢Ãí°Õ¤¬É¬Íס£ ¤½¤ì¤é¤Ë¤Ä¤¤¤Æ¤Ï¡¢gfs_client ¤ª¤è¤Ó gfsd/gfmd ¤«¤é¤Ï ¸Æ¤Ó½Ð¤»¤Ê¤¤¡£ auth.h ǧ¾Ú¥é¥¤¥Ö¥é¥ê auth_common.c ǧ¾ÚÍѤζ¦ÄÌ´Ø¿ô auth_client.c ǧ¾Ú¡¢¥¯¥é¥¤¥¢¥ó¥È¦ auth_client_gsi.c GFSL/GSI ǧ¾Ú¡¢¥¯¥é¥¤¥¢¥ó¥È¦ auth_server.c ǧ¾Ú¡¢¥µ¡¼¥Ð¡¼Â¦ auth_server_gsi.c GFSL/GSI ǧ¾Ú¡¢¥µ¡¼¥Ð¡¼Â¦ auth_config.c ǧ¾Ú¤Ë´Ø¤¹¤ëÀßÄê¥Õ¥¡¥¤¥ë¤Î½èÍý gfm_proto.h gfmd ¥×¥í¥È¥³¥ëÄêµÁ gfm_client.c gfmd ¥¯¥é¥¤¥¢¥ó¥È¦ RPC stub gfs_proto.h gfsd ¥×¥í¥È¥³¥ëÄêµÁ gfs_proto.c gfs ¥×¥í¥È¥³¥ë¶¦ÄÌ´Ø¿ô gfs_client.h gfs ¥¯¥é¥¤¥¢¥ó¥È¦ RPC ´Ø¿ôÄêµÁ gfs_client.c gfs ¥¯¥é¥¤¥¢¥ó¥È¦ RPC stub gfs_pio.h ¤ÇÄêµÁ¤µ¤ì¤¿ gfarm ¥Õ¥¡¥¤¥ë¥¢¥¯¥»¥¹ gfs_pio.c ¼ç¥ë¡¼¥Á¥ó gfs_pio_local.c local file store ¤Ø¤Î¥¢¥¯¥»¥¹½èÍý gfs_pio_remote.c remote file store (gfsd) ¤Ø¤Î¥¢¥¯¥»¥¹½èÍý gfs_pio_default.c default view ¤Ë´Ø¤¹¤ë½èÍý gfs_pio_global.c global view ¤Ë´Ø¤¹¤ë½èÍý gfs_pio_section.c index view, section view ¤Ë´Ø¤¹¤ë½èÍý gfs_pio_misc.c gfs_pio_*() °Ê³°¤Î ´Ø¿ô import_help.c gfimport_{text,fixed} Åù¤Ø¤Î¥Ø¥ë¥Ñ´Ø¿ô metadb_ldap.c LDAP ¥¢¥¯¥»¥¹½èÍý¡£ ¤Î¼ÂÁõ metadb_misc.c metadb ´Ø·¸¤Î¤¤¤í¤¤¤í¤Ê½èÍý schedule.c ¥ì¥×¥ê¥«¤ä·×»»¥Î¡¼¥É¤Ø¤Î¥¢¥¯¥»¥¹¤Î¥¹¥±¥¸¥å¡¼¥ê¥ó¥° stringlist.c ʸ»úÎó¥ê¥¹¥È url.c gfarm ¥Õ¥¡¥¤¥ë̾¤Î½èÍý lib/gfs_hook/ Makefile.in hooks.c gfs_hook ¤Î¼ç½èÍý hooks_64.c 64bit API ¤Ë´Ø¤¹¤ë gfs_hook hooks_common.c hooks.c ¤È hooks_64.c ¤ÎξÊý¤«¤é#include¤µ¤ì¤ë hooks_subr.h gfs_hook ´Ø·¸¤Î¥µ¥Ö¥ë¡¼¥Á¥ó hooks_subr.c sysdep/linux/ gfs_hook ¤Î Linux °Í¸Éô server/gfsd/ Makefile loadavg.c ¥í¡¼¥É¡¦¥¢¥Ù¥ì¡¼¥¸¤òÆÀ¤ë OS °Í¸½èÍý gfsd.c gfsd ¤Î¥á¥¤¥ó¡¦¥×¥í¥°¥é¥à server/gfmd/ Makefile gfmd.c gfmd ¤Î¥á¥¤¥ó¡¦¥×¥í¥°¥é¥à¡£ bench/ Makefile bwlat-syscache/bwlat-syscache.c nconnect/nconnect.c thput-fsys/thput-fsys.c thput-gfpio/thput-gfpio.c thput-pvfs/thput-pvfs.c thput-fsstripe/thput-fsstripe.c package/ redhat/ solaris/ debian/ gfarm-2.4.1/doc/docbook/0000755000000000000000000000000011507222730013474 5ustar rootrootgfarm-2.4.1/doc/docbook/en/0000755000000000000000000000000011507222730014076 5ustar rootrootgfarm-2.4.1/doc/docbook/en/ref/0000755000000000000000000000000011507222730014652 5ustar rootrootgfarm-2.4.1/doc/docbook/en/ref/man5/0000755000000000000000000000000011507222730015512 5ustar rootrootgfarm-2.4.1/doc/docbook/en/ref/man5/Makefile.inc0000644000000000000000000000003311507222720017715 0ustar rootrootDOCBOOK = \ gfarm2.conf.5 gfarm-2.4.1/doc/docbook/en/ref/man5/gfarm2.conf.5.docbook0000644000000000000000000014303311507222720021324 0ustar rootroot 12 Apr 2010 gfarm2.conf 5 Gfarm gfarm2.conf Gfarm configuration file DESCRIPTION gfarm2.conf is a text file that contains a Gfarm configuration. Gfarm server processes gfmd and gfsd refer to %%SYSCONFDIR%%/gfmd.conf and %%SYSCONFDIR%%/gfarm2.conf, respectively, by default. Since this configuration file is only read at startup, it is necessary to restart servers when the contents of the configuration file are updated. Application programs, such as gfls and gfhost, refer to both %%SYSCONFDIR%%/gfarm2.conf, and a file specified by an environment variable, GFARM_CONFIG_FILE. If both configuration files exist, the file specified by the environment variable, GFARM_CONFIG_FILE, is read first. Both files have the same grammar. If the environment variable GFARM_CONFIG_FILE doesn't exist, ~/.gfarm2rc in a user's home directory is used instead. Each line of gfarm2.conf consists of one statement. When the line ends with the character ``\'', the line continues for the next line. A word beginning with ``#'' causes that word and all remaining characters on that line to be ignored. Host_specification Host_specification has the following forms. III.JJJ.KKK.LLL Specifies an IP address with four octets from 0 to 255, separated by ".". III.JJJ.KKK.LLL/MM Specifies a network address with an IP address and a netmask from 0 to 31 separated by "/". domain.name Specifies a host name. .domain.name Specifies all hosts which belong to the domain.name. * Specifies all hosts. Statement The following statements are supported. spool directory The spool statement specifies a spool directory for a Gfarm filesystem on this filesystem node. For example, spool /var/spool/gfarm spool_server_listen_address IP-address The spool_server_listen_address statement specifies the IP address at which the gfsd accepts TCP and UDP requests. The default address is all IP addresses of the host. This option is useful when one wants to invoke multiple gfsd to provide multiple spool directories on the host. For example, spool_server_listen_address 192.168.121.1 spool_server_cred_type cred_type This statement specifies the type of credential used by gfsd for GSI authentication. This is ignored when you are using sharedsecret authentication. If this statement isn't used on the server side, the server uses a host certificate, if the server is invoked with root privileges. Or, if the server is invoked as a non-privileged user, the server uses the user's certificate. If this statement isn't used on the client side, the client assumes that the server that the client is going to connect is using a host certificate of the server host. Thus, if the server is not invoked with root privileges, but invoked with user privileges where the user is the same as the user who invoked the client, the client side needs to specify the following one line. Example: spool_server_cred_type self The possible types of cred_type are ``self'', ``host'', ``user'' and ``mechanism-specific''. And those are used with the spool_server_cred_service and spool_server_cred_name statements as follows: self This keyword specifies that the certificate that the user currently has is used. You must not use either the spool_server_cred_service or spool_server_cred_name statement, if you are using this type. host This keyword specifies that a host certificate or a service certificate is used. To choose a service certificate, the name of the service may be specified by the spool_server_cred_service statement. If ``host'' is specified as the service name, a host certificate in the file ``/etc/grid-security/hostcert.pem'' will be used. If any server name other than ``host'' is specified, a service certificate in the file ``/etc/grid-security/SERVICE/SERVICEcert.pem'' will be used. If the service name is omitted, ``host'' will be used as the service name by default. Only the Common Name field of a certificate will be used to check the server's identity for both a host certificate and a service certificate. And the Common Name field must be in the ``CN=SERVERNAME/HOSTNAME'' format. Also, the hostname must match the canonical name configured by the gfhost command exactly. Alias hostnames are not allowed. This feature corresponds to the GSS_C_NT_HOSTBASED_SERVICE feature in GSSAPI (RFC2743/RFC2744). Example: spool_server_cred_type host spool_server_cred_service host user This keyword specifies that a user certificate is used. The account name of the user may be specified by the spool_server_cred_name statement. If the account name is omitted, the user who invoked the command will be used by default. You must not specify a service name using the spool_server_cred_service statement, if you are using a user certificate. To map from the account name to a Distinguished Name of a certificate, file ``/etc/grid-security/grid-mapfile'' is used. Thus, if there isn't such a file, or if the user isn't specified in this file, this feature cannot be used. This feature corresponds to the GSS_C_NT_USER_NAME feature in GSSAPI (RFC2743/RFC2744). Example: spool_server_cred_type user spool_server_cred_name guest mechanism-specific This keyword specifies that spool_server_cred_name is treated as a raw X.509 Distinguished Name serving as a server's certificate. You must not specify a service name using a spool_server_cred_service statement, if you are using this type. This feature corresponds to a case where GSS_C_NO_OID is specified as a Name Type in GSSAPI (RFC2743/RFC2744). Example: spool_server_cred_type mechanism-specific spool_server_cred_name "/O=Grid/O=Globus/OU=example.com/CN=John Smith" spool_server_cred_service cred_service This statement specifies the service name of a service certificate used by gfsd for GSI authentication, when ``host'' is specified in spool_server_cred_type statement. This is ignored when you are using sharedsecret authentication. Please read the description of the spool_server_cred_type statement for details. spool_server_cred_name cred_name This statement specifies the setting of a certificate used by gfsd for GSI authentication. What this setting means depends on the type specified in the spool_server_cred_type statement. This is ignored when you are using sharedsecret authentication. Please read the description of the spool_server_cred_type statement for details. metadb_server_host hostname The metadb_server_host statement specifies the host name on which gfmd is running. This statement cannot be omitted. For example, metadb_server_host ldap.example.com metadb_server_port port The metadb_server_port statement specifies the tcp port number the gfmd is listening on. The default port number is 601. For example, metadb_server_port 601 metadb_server_cred_type cred_type This statement specifies the type of credential used by gfmd for GSI authentication. This is ignored when you are using sharedsecret authentication. Please read the description of the spool_server_cred_type statement on the configuration of this statement. metadb_server_cred_service cred_service This statement specifies the service name of a service certificate used by gfmd for GSI authentication, when ``host'' is specified in metadb_server_cred_type statement. This is ignored when you are using sharedsecret authentication. Please read the description of the spool_server_cred_type statement on the configuration of this statement. metadb_server_cred_name cred_name This statement specifies the setting of a certificate used by gfmd for GSI authentication. What this setting means depends on the type specified in the metadb_server_cred_type statement. This is ignored when you are using sharedsecret authentication. Please read the description of the spool_server_cred_type statement on the configuration of this statement. metadb_server_stack_size bytes This directive specifies the size of each thread in the gfmd metadata server process. If not specified, the default size of the OS is used. This parameter is used to cut down the size of virtual memory space used by gfmd. For example, the default stack size on CentOS 5/i386 is 10MB, thus, you can decrease the size of the virtual memory space of gfmd to 1/40, by specifying 256KB as this parameter. This parameter is only available in gfmd.conf, and ignored in gfarm2.conf. For example, metadb_server_stack_size 262144 metadb_server_thread_pool_size size This directive specifies the maximum number of threads in a thread pool in the gfmd. It is effective to specify around the number of CPU cores of the metadata server node. Default is 16. This parameter is only available in gfmd.conf, and ignored in gfarm2.conf. For example, metadb_server_thread_pool_size 16 metadb_server_job_queue_length length This directive specifies the length of job queue in the gfmd. It is effective to specify around the maximum number of clients that access the Gfarm file system at the same time. Default is 16000. This parameter is only available in gfmd.conf, and ignored in gfarm2.conf. For example, metadb_server_job_queue_length 160 metadb_server_heartbeat_interval seconds This directive specifies the interval of heartbeat in seconds for gfmd to check availability of each gfsd. Default is 180 seconds. Until gfarm-2.3.0, this parameter was only available in gfmd.conf, and ignored in gfarm2.conf. But since gfarm-2.4.0, gfsd also uses this parameter to detect whether gfmd is down or not, this parameter has to be specified in both gfarm2.conf and gfmd.conf. For example, metadb_server_heartbeat_interval 180 metadb_server_dbq_size size This directive specifies the queue length of metadata updates for a backend database in gfmd. Longer queue length may avoid slow down due to waiting backend database updates in case of frequent metadata operations. Default is 65536. This parameter is only available in gfmd.conf, and ignored in gfarm2.conf. For example, metadb_server_dbq_size 65536 ldap_server_host hostname The ldap_server_host statement specifies the host name on which an LDAP server is running. This statement is required when the LDAP server is used for a backend database of gfmd. This statement is used in gfmd.conf not gfarm2.conf. For example, ldap_server_host ldap.example.com ldap_server_port port The ldap_server_port statement specifies the tcp port number of the LDAP server. This statement cannot be omitted if ldap_server_host is specified. For example, ldap_server_port 602 ldap_base_dn LDAP_base_distinguished_name The ldap_base_dn statement specifies the base-distinguished name of the LDAP database. This statement cannot be omitted if ldap_server_host is specified. For example, ldap_base_dn "dc=example, dc=com" ldap_bind_dn LDAP_bind_distinguished_name The ldap_bind_dn statement specifies the distinguished name for the bind operation which is used for authentication to the LDAP database. For example, ldap_bind_dn "cn=gfarmuser, dc=example, dc=com" ldap_bind_password password The ldap_bind_password statement specifies the password for the bind operation which is used for authentication to the LDAP database. For example, ldap_bind_password "secret-ldap-password" postgresql_server_host hostname The postgresql_server_host statement specifies the host name on which a PostgreSQL server is running. This statement is required when the PostgreSQL server is used for a backend database of gfmd. This statement is used in gfmd.conf not gfarm2.conf. For example, postgresql_server_host postgresql.example.com postgresql_server_port port The postgresql_server_port statement specifies the tcp port number of the PostgreSQL server. This statement cannot be omitted if postgresql_server_host is specified. For example, postgresql_server_port 602 postgresql_dbname dbname The postgresql_dbname statement specifies the database name of the PostgreSQL database. This statement cannot be omitted if postgresql_server_host is specified. For example, postgresql_dbname gfarm postgresql_user user The postgresql_user statement specifies the username used to connect the PostgreSQL database. For example, postgresql_user gfarm postgresql_password password The postgresql_password statement specifies the password used to connect the PostgreSQL database. For example, postgresql_password gfarm postgresql_conninfo connection_info The postgresql_conninfo statement specifies the connection option used to connect the PostgreSQL database. For example, postgresql_conninfo "sslmode=require connect_timeout=30" auth validity method Host_specification This statement specifies the authentication method when communicating with the host(s) specified by the third argument. The first argument should be either the enable or disable keyword. The second argument, auth method, should be the gsi, gsi_auth, or sharedsecret keyword. The third argument specifies the host(s) by using Host specification. The auth statement may be specified any number of times. For each authentication method, it becomes a candidate when the first entry whose host_specification matches the target host has the enable keyword. When there is no corresponding entry, or when the first corresponding entry has the disable keyword, the authentication method does not become a candidate. This process takes place on both client and server sides. Candidates for authentication method on both sides will be tried. The order of statements with different authentication methods is not relevant. When there are several candidates for the authentication method for the host, the order of the authentication trial is sharedsecret, gsi_auth, and then gsi. The GSI methods are available if and only if the --with-globus option is specified at configuration. When the methods are not available, an auth statement with gsi or gsi_auth will be ignored. This statement cannot be omitted. For example, auth disable sharedsecret 192.168.0.100 auth disable sharedsecret 192.168.0.101 auth enable sharedsecret 192.168.0.0/24 auth enable gsi_auth 10.0.0.0/8 auth enable gsi * In this example, all hosts which belong to the network address 192.168.0.0/24, except for two hosts, 192.168.0.100 and 192.168.0.101, will be tested for authenticated by both sharedsecret and gsi; all hosts which belong to the network address 10.0.0.0/8 will be tested for authentication by both gsi_auth and gsi; and all other hosts will be authenticated by gsi. Note that two hosts, 192.168.0.100 and 192.168.0.101, will be tested for authentication by gsi only. sockopt option[=value] [LISTENER | Host_specification] The sockopt parameter specifies the socket option option via the setsockopt(2) system call. When LISTENER (all capital letters) is specified by the second argument, the socket option is applied to any socket on the server side (accepting side). When the host_specification is specified by the second argument, the socket option is applied to sockets that connect to the specified host(s). If the second argument is "*", the socket option is applied to any hosts on the client side (connecting side). If the second argument is omitted, the socket option is applied to every socket. The following socket options can be specified. debug. The SO_DEBUG socket option is specified. A value is not necessary. keepalive. The SO_KEEPALIVE socket option is specified. A value is not necessary. sndbuf. The SO_SNDBUF socket option is specified with a value. rcvbuf. The SO_RCVBUF socket option is specified with a value. tcp_nodelay. The TCP_NODELAY socket option is specified. A value is not necessary. For example, sockopt tcp_nodelay 192.168.0.0/24 sockopt sndbuf=1048576 10.0.0.0/8 sockopt sndbuf=1048576 LISTENER sockopt rcvbuf=1048576 10.0.0.0/8 sockopt rcvbuf=1048576 LISTENER known_network Host_specification The known_network statement specifies a network address for file system nodes. It is used to group file system nodes at file systen node scheduling. File system nodes that are not specified in this directive are assumed to be in an IPv4 class C network. For example, known_network 192.168.0.0/24 admin_user user This directive specifies an administrator user name, which is specified in gfmd.conf. admin_user_gsi_dn user_gsi_dn This directive specifies a subject DN of an administrator, which is specified in gfmd.conf. local_user_map user-map-file This directive specifies a file name user-map-file for mapping local user names to global user names. This map file is used only for sharedsecret authentication. When this file is not specified, a global user name is assumed to be same as the local user name. user-map-file is needed when you have to use the sharedsecret authentication method in the case where you have different unix account names on different filesystem nodes. In such a case, the user-map-file on each filesystem node should have an entry from each local user name to a unique global user name. Example: local_user_map /etc/gfarm/gfarm-usermap Each line of the user-map-file consists of two fields separated by spaces; the first field is a global user name, and the second field is a local user name. Example of the user mapping file: foobar foo quux baz According to the first line of this mapping file, a global user name, "foobar", is mapped to a local user name, "foo", on this node. local_group_map group-map-file This directive specifies a file name group-map-file for mapping global group names to local group names. This map file is used by legacy clients that use local group id such as gfarm2fs and gfarm dsi for Globus GridFTP to display mapped local groups. When this file is not specified, a local group name is assumed to be same as the global group name. Example: local_group_map /etc/gfarm/gfarm-groupmap Each line of the group-map-file consists of two fields separated by spaces; the first field is a global group name, and the second field is a local group name. schedule_cache_timeout seconds This directive specifies the time (in seconds) until the cache used for filesystem node scheduling expires. The cache holds information on each filesystem node, e.g. load average, disk free space, and whether authentication succeeds or not. The default time is 600 seconds, i.e. ten minutes. For example, schedule_cache_timeout 60 schedule_idle_load_thresh load-average This directive specifies the threshold of CPU load average to be considered idle. The file system nodes whose CPU load average is equal to or below the specified CPU load average are to be scheduled at first. The default load average is 0.1. For example, schedule_idle_load_thresh 0.1 schedule_busy_load_thresh load-average This directive specifies the threshold of CPU load average to be considered busy. The file system nodes whose CPU load average is above the specified CPU load average are to be scheduled lastly. The default load average is 0.5. For example, schedule_busy_load_thresh 0.5 schedule_virtual_load load-average This directive specifies the virtual CPU load average. The virtual CPU load is added when the host is scheduled to avoid scheduling the same host multiple times. The default load average is 0.3. For example, schedule_virtual_load 0.3 minimum_free_disk_space bytes This directive specifies free disk space (in bytes) which is required on filesystem nodes. The Gfarm scheduler excludes filesystem nodes which have less free space than this parameter, when it schedules nodes for jobs which may write files. The free space value may have a suffix like ``k'' (kilo bytes), ``M'' (mega bytes), ``G'' (giga bytes) and ``T'' (tera bytes). The default size is 128M bytes. This directive has to be specified in both gfarm2.conf and gfmd.conf. After restarting the gfmd and the Gfarm client, it is effective. For example, minimum_free_disk_space 1G simultaneous_replication_receivers number This directive specifies maximum number of simultaneous gfmd-initiated replications to same host. The default is 20. For example, simultaneous_replication_receivers 40 gfsd_connection_cache number This directive specifies maximum number of cached gfsd connections. The default is 16. For example, gfsd_connection_cache 32 attr_cache_limit number This directive specifies maximum number of cached attributes in gfarm library. The default is 40000. For example, attr_cache_limit 100000 attr_cache_timeout milliseconds This directive specifies maximum time until cached attributes expire in milliseconds. The default is 1000, i.e. 1 second. For example, attr_cache_timeout 3600000 log_level priority_level This directive specifies a level of log priority. The log output, which priority is inferior to this level, will not be sent to syslog or standard error. The priority levels are "emerg", "alert", "crit", "err", "warning", "notice", "info" and "debug" in highest first order. The default level is "info". It's not recommended to specify a level higher or equal to "crit". For example, log_level debug log_message_verbose_level level This directive specifies how verbose the log message is. The default value is 0, which outputs the log message id. The level 1 additionally outputs the file name and the line of source code. The level 2 additionally outputs the function name. For example, log_message_verbose_level 1 no_file_system_node_timeout seconds If there is no file system node available, Gfarm client library periodically tries to find a file system node. This directive specifies the timeout to try in seconds. The default is 30 seconds. For example, no_file_system_node_timeout 30 gfmd_reconnection_timeout seconds If the connection to the metadata server is disconnected, Gfarm client library periodically tries to reconnect. This directive specifies the timeout to try in seconds. The default is 30 seconds. For example, gfmd_reconnection_timeout 30 GRAMMAR This is a grammar of gfarm2.conf described by the BNF notation. <statement> ::=   <spool_statement> |   <spool_server_listen_address_statement> |   <spool_server_cred_type_statement> |   <spool_server_cred_service_statement> |   <spool_server_cred_name_statement> |   <metadb_server_host_statement> |   <metadb_server_port_statement> |   <metadb_server_cred_type_statement> |   <metadb_server_cred_service_statement> |   <metadb_server_cred_name_statement> |   <metadb_server_stack_size_statement> |   <metadb_server_thread_pool_size_statement> |   <metadb_server_job_queue_length_statement> |   <metadb_server_heartbeat_interval_statement> |   <metadb_server_dbq_size_statement> |   <ldap_server_host_statement> |   <ldap_server_port_statement> |   <ldap_base_dn_statement> |   <ldap_bind_dn_statement> |   <ldap_bind_password_statement> |   <postgresql_server_host_statement> |   <postgresql_server_port_statement> |   <postgresql_dbname_statement> |   <postgresql_user_statement> |   <postgresql_password_statement> |   <postgresql_conninfo_statement> |   <auth_statement> |   <sockopt_statement> |   <known_network_statement> |   <admin_user_statement> |   <admin_user_gsi_dn_statement> |   <local_user_map_statement> |   <local_group_map_statement> |   <schedule_cache_timeout_statement> |   <schedule_idle_load_thresh_statement> |   <schedule_busy_load_thresh_statement> |   <schedule_virtual_load_statement> |   <minimum_free_disk_space_statement> |   <simultaneous_replication_receivers> |   <gfsd_connection_cache_statement> |   <attr_cache_limit_statement> |   <attr_cache_timeout_statement> |   <log_level_statement> |   <log_message_verbose_level_statement> <spool_statement> ::= "spool" <pathname> <spool_server_listen_address_statement> ::=   "spool_server_listen_address" <ipv4_address> <spool_server_cred_type_statement> ::=   "spool_server_cred_type" <cred_type> <spool_server_cred_service_statement> ::=   "spool_server_cred_service" <cred_service> <spool_server_cred_name_statement> ::=   "spool_server_cred_name" <cred_name> <metadb_server_host_statement> ::= "metadb_server_host" <hostname> <metadb_server_port_statement> ::= "metadb_server_port" <portnumber> <metadb_server_cred_type_statement> ::=   "metadb_server_cred_type" <cred_type> <metadb_server_cred_service_statement> ::=   "metadb_server_cred_service" <cred_service> <metadb_server_cred_name_statement> ::=   "metadb_server_cred_name" <cred_name> <metadb_server_stack_size_statement> ::=   "metadb_server_stack_size" <number> <metadb_server_thread_pool_size_statement> ::=   "metadb_server_thread_pool_size" <number> <metadb_server_job_queue_length_statement> ::=   "metadb_server_job_queue_length" <number> <metadb_server_heartbeat_interval_statement> ::=   "metadb_server_heartbeat_interval" <number> <metadb_server_dbq_size_statement> ::=   "metadb_server_dbq_size" <number> <ldap_server_host_statement> ::= "ldap_server_host" <hostname> <ldap_server_port_statement> ::= "ldap_server_port" <portnumber> <ldap_base_dn_statement> ::= "ldap_base_dn" <string> <ldap_bind_dn_statement> ::= "ldap_bind_dn" <string> <ldap_bind_password_statement> ::= "ldap_bind_password" <string> <postgresql_server_host_statement> ::= "postgresql_server_host" <hostname> <postgresql_server_port_statement> ::= "postgresql_server_port" <portnumber> <postgresql_dbname_statement> ::= "postgresql_dbname" <string> <postgresql_user_statement> ::= "postgresql_user" <string> <postgresql_password_statement> ::= "postgresql_password" <string> <postgresql_conninfo_statement> ::= "postgresql_conninfo" <string> <auth_statement> ::=   "auth" <validity> <auth_method> <hostspec> <auth_command> ::= "enable" | "disable" <auth_method> ::= "gsi" | "gsi_auth" | "sharedsecret" <sockopt_statement> ::=   "sockopt" <socket_option>[=<number>] [""LISTENER" | <hostspec>] <socket_option> = "debug" | "keepalive" | "sndbuf" | "rcvbuf" |   "tcp_nodelay" <known_network_statement> ::= "known_network" <hostspec> <admin_user_statement> ::= "admin_user" <string> <admin_user_gsi_dn_statement> ::= "admin_user_gsi_dn" <string> <local_user_map_statement> ::= "local_user_map" <pathname> <local_group_map_statement> ::= "local_group_map" <pathname> <schedule_cache_timeout_statement> ::= "schedule_cache_timeout" <number> <schedule_idle_load_thresh_statement> ::= "schedule_idle_load_thresh" <load> <schedule_busy_load_thresh_statement> ::= "schedule_busy_load_thresh" <load> <schedule_virtual_load_statement> ::= "schedule_virtual_load" <load> <minimum_free_disk_space_statement> ::=   "minimum_free_disk_space" <size> <simultaneous_replication_receivers> ::= "simultaneous_replication_receivers" <number> <gfsd_connection_cache_statement> ::= "gfsd_connection_cache" <number> <attr_cache_limit_statement> ::= "attr_cache_limit" <number> <attr_cache_timeout_statement> ::= "attr_cache_timeout" <number> <log_level_statement> ::= "log_level" <log_priority> <log_message_verbose_level_statement> ::= "log_message_verbose_level" <number> <no_file_system_node_timeout_statement> ::= "no_file_system_node_timeout" <number> <gfmd_reconnection_timeout_statement> ::= "gfmd_reconnection_timeout" <number> <hostspec> ::= <ipv4_address> | <ipv4_address> "/" <address_mask> |   <hostname> | "." <domain_name> | "*" <pathname> ::= <pathname_character> <pathname_character>* <pathname_character> ::= <hostname_character> | "," | "/" | "_" <hostname> ::= <hostname_character> <hostname_character>* <hostname_character> ::= <alphabet> | <digit> | "-" | "." <portnumber> ::= <number> <size> ::= <number> [ "k" | "M" | "G" | "T" ] <number> ::= <digit> [<digit>*] <digit> ::= "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" <string> ::= """ <double_quoted_character>* """ <double_quoted_character> ::=   <any_character_except_backslash_and_double_quotation> |   "\\" | "\"" <validity> ::= "enable" | "disable" <log_priority> ::= "emerg" | "alert" | "crit" | "err" | "warning" |   "notice" | "info" | "debug" EXAMPLES The following is an example usin PostgreSQL to store the metadata, and to allow access from filesystem nodes and clients at IP address 192.168.0.0/24, via sharedsecret authentication. spool /var/spool/gfarm metadb_server_host metadb.example.org metadb_server_port 601 postgresql_server_host metadb.example.org postgresql_server_port 5432 postgresql_dbname gfarm postgresql_user gfarm postgresql_password "secret-postgresql-password" auth enable sharedsecret 192.168.0.0/24 sockopt keepalive The following is an example using LDAP to store the metadata, and to allow access from filesystem nodes and clients at any IP address, via GSI authentication. spool /var/spool/gfarm metadb_server_host metadb.example.com metadb_server_port 601 ldap_server_host metadb.example.com ldap_server_port 602 ldap_base_dn "dc=example, dc=com" ldap_bind_dn "cn=gfarmuser, dc=example, dc=com" ldap_bind_password "secret-ldap-password" auth enable gsi * sockopt keepalive FILES %%SYSCONFDIR%%/gfarm2.conf $HOME/.gfarm2rc SEE ALSO gfmd8, gfsd8, setsockopt2 gfarm-2.4.1/doc/docbook/en/ref/man3/0000755000000000000000000000000011507222730015510 5ustar rootrootgfarm-2.4.1/doc/docbook/en/ref/man3/gfs_stat_free.3.docbook0000644000000000000000000000233511507222720022030 0ustar rootroot 1 May 2002 gfs_stat_free 3 Gfarm gfs_stat_free free dynamic memory of file status #include <gfarm/gfarm.h> void gfs_stat_free struct gfs_stat * status DESCRIPTION gfs_stat_free() frees frees the memory space of file status status allocated by gfs_stat(3). SEE ALSO gfs_stat3 gfarm-2.4.1/doc/docbook/en/ref/man3/gfs_stat.3.docbook0000644000000000000000000000536711507222720021037 0ustar rootroot 1 May 2002 gfs_stat 3 Gfarm gfs_stat get file status #include <gfarm/gfarm.h> char *gfs_stat const char * gfarm_url struct gfs_stat * status DESCRIPTION gfs_stat() return information about the specified file pointed to by gfarm_url, and fills in the buffer pointed to by status. Since status includes a pointer to dynamically allocated memory space, it is necessary to free the memory space by gfs_stat_free(3). RETURN VALUES NULL The function terminated successfully. GFARM_ERR_NO_MEMORY Insufficient memory was available. GFARM_ERR_AUTHENTICATION User authentication failed when connecting to gfmd(8). GFARM_ERR_PERMISSION_DENIED gfarm_url points outside your accessible address space. GFARM_ERR_NO_SUCH_OBJECT gfarm_url does not exist. GFARM_ERR_NOT_A_DIRECTORY A component of the path prefix is not a directory. Others An error except the above occurred. The reason is shown by its pointed strings. SEE ALSO gfs_stat_free3 gfarm-2.4.1/doc/docbook/en/ref/man3/gfs_pio_set_local.3.docbook0000644000000000000000000000357411507222720022676 0ustar rootroot 1 May 2002 gfs_pio_set_local 3 Gfarm gfs_pio_set_local initialize the local file view environment #include <gfarm/gfarm.h> char *gfs_pio_set_local int node int nnode DESCRIPTION gfs_pio_set_local() initializes the environment for the local file view with the node number node and the total number of nodes nnode. RETURN VALUES NULL The function terminated successfully. Others An error except the above occurred. The reason is shown by its pointed strings. SEE ALSO gfs_pio_set_view_local3, gfs_pio_set_view_index3 gfarm-2.4.1/doc/docbook/en/ref/man3/gfs_pio_datasync.3.docbook0000644000000000000000000000454211507222720022533 0ustar rootroot 1 Jun 2005 gfs_pio_datasync 3 Gfarm gfs_pio_datasync output a file's data on memroy to disk #include <gfarm/gfarm.h> char *gfs_pio_datasync GFS_File gf DESCRIPTION The function gfs_pio_datasync copies data on memory of the gf, and waits for the I/O to complete before returning. It does nod update metadtata stat information, while another function gfs_pio_sync updates the metadata in addition to the contents. RETURN VALUES NULL The function terminated successfully. GFARM_ERR_NO_MEMORY Insufficient memory was available. Others An error except the above occurred. The reason is shown by its pointed strings. SEE ALSO gfs_pio_sync3, gfs_pio_create3, gfs_pio_open3, gfs_pio_write3, gfs_pio_flush3 gfarm-2.4.1/doc/docbook/en/ref/man3/Makefile.inc0000644000000000000000000000207311507222720017721 0ustar rootrootDOCBOOK = \ gfarm.3 \ gfarm_initialize.3 \ gfarm_terminate.3 \ gfs_pio_close.3 \ gfs_pio_create.3 \ gfs_pio_open.3 \ gfs_pio_read.3 \ gfs_pio_write.3 #DOCBOOK = \ # gfarm_strings_free_deeply.3 \ # gfarm_url_fragments_replicate.3 \ # gfarm_url_hosts_schedule.3 \ # gfarm_url_section_replicate_from_to.3 \ # gfarm_url_section_replicate_to.3 \ # gfs_chdir.3 \ # gfs_chmod.3 \ # gfs_closedir.3 \ # gfs_mkdir.3 \ # gfs_opendir.3 \ # gfs_pio_datasync.3 \ # gfs_pio_eof.3 \ # gfs_pio_error.3 \ # gfs_pio_flush.3 \ # gfs_pio_getc.3 \ # gfs_pio_getline.3 \ # gfs_pio_gets.3 \ # gfs_pio_putc.3 \ # gfs_pio_putline.3 \ # gfs_pio_puts.3 \ # gfs_pio_readdelim.3 \ # gfs_pio_readline.3 \ # gfs_pio_seek.3 \ # gfs_pio_sync.3 \ # gfs_pio_set_local.3 \ # gfs_pio_set_view_index.3 \ # gfs_pio_set_view_local.3 \ # gfs_pio_truncate.3 \ # gfs_pio_ungetc.3 \ # gfs_readdir.3 \ # gfs_realpath.3 \ # gfs_rename.3 \ # gfs_rmdir.3 \ # gfs_stat.3 \ # gfs_stat_free.3 \ # gfs_unlink.3 \ # gfs_unlink_section.3 \ # gfs_utimes.3 \ # gfs_glob_init.3 \ # gfs_glob.3 \ # gfs_glob_add.3 \ # gfs_glob_free.3 gfarm-2.4.1/doc/docbook/en/ref/man3/gfs_pio_gets.3.docbook0000644000000000000000000001003611507222720021662 0ustar rootroot 13 May 2004 gfs_pio_gets 3 Gfarm gfs_pio_gets read one line #include <gfarm/gfarm.h> char *gfs_pio_gets GFS_File f char * s size_t size DESCRIPTION gfs_pio_gets() reads one line from the file specified by the parameter gf to the buffer specified by the parameter s. You need to specify the size of the buffer by the parameter size. Unlike gfs_pio_getline(3), this function doesn't remove newline character at the end of the buffer. But if whole contents of the line cannot be stored to the buffer due to its length, or if the file reaches the end without newline, there will be no newline at the end of the buffer. In any case, one '\0' character is appended to the end of the buffer. If the file reaches its end, the length of the string in the buffer becomes 0. RETURN VALUES NULL The function terminated successfully. GFARM_ERR_NO_MEMORY Insufficient memory was available. Others An error except the above occurred. The reason is shown by its pointed strings. EXAMPLES Example of <function>gfs_pio_gets</function> function #include <stdio.h> #include <stdlib.h> #include <gfarm/gfarm.h> int main(int argc, char **argv) { char *e; GFS_File gf; char buffer[512]; e = gfarm_initialize(&argc, &argv); if (e != NULL) { fprintf(stderr, "gfarm_initialize: %s\n", e); return (EXIT_FAILURE); } if (argc <= 1) { fprintf(stderr, "missing gfarm filename\n"); return (EXIT_FAILURE); } e = gfs_pio_open(argv[1], GFARM_FILE_RDONLY, &gf); if (e != NULL) { fprintf(stderr, "%s: %s\n", argv[1], e); return (EXIT_FAILURE); } e = gfs_pio_set_view_global(gf, 0); if (e != NULL) { fprintf(stderr, "%s: gfs_pio_set_view_global: %s\n", argv[1], e); return (EXIT_FAILURE); } while ((e = gfs_pio_gets(gf, buffer, sizeof buffer)) != NULL && *buffer != '\0') { printf("got: %s", buffer); } if (e != NULL) { fprintf(stderr, "ERROR: %s\n", e); return (EXIT_FAILURE); } e = gfs_pio_close(gf); if (e != NULL) { fprintf(stderr, "gfs_pio_close: %s\n", e); return (EXIT_FAILURE); } e = gfarm_terminate(); if (e != NULL) { fprintf(stderr, "gfarm_initialize: %s\n", e); return (EXIT_FAILURE); } return (EXIT_SUCCESS); } SEE ALSO gfs_pio_open3, gfs_pio_getline3, gfs_pio_readline3, gfs_pio_readdelim3 gfarm-2.4.1/doc/docbook/en/ref/man3/gfs_pio_close.3.docbook0000644000000000000000000000431211507222720022025 0ustar rootroot 27 Jun 2010 gfs_pio_close 3 Gfarm gfs_pio_close close a file in the Gfarm file system #include <gfarm/gfarm.h> gfarm_error_t gfs_pio_close GFS_File gfp DESCRIPTION gfs_pio_close() closes a file gfp, so that it no longer refers to any file and may be reused. RETURN VALUES GFARM_ERR_NO_ERROR The function terminated successfully. GFARM_ERR_BAD_FILE_DESCRIPTOR The file descripter specified by gfp is not a valid open file descriptor. GFARM_ERR_NO_MEMORY Insufficient memory was available. Others An error except the above occurred. The reason is shown by gfarm_error_string3. SEE ALSO gfs_pio_create3, gfs_pio_open3 gfarm-2.4.1/doc/docbook/en/ref/man3/gfs_glob.3.docbook0000644000000000000000000000603311507222720020776 0ustar rootroot 11 Sep 2003 gfs_glob 3 Gfarm gfs_glob find path names matching a pattern #include <gfarm/gfarm.h> char *gfs_glob const char * pattern gfarm_stringlist * paths gfs_glob_t * types DESCRIPTION gfs_glob() searches for all the path names matching pattern that may include a wildcard, and returns paths. The returned path names are accessed by gfarm_stringlist_length(3) and gfarm_stringlist_elem(3). It is necessary to allocate memory space dynamically pointed to by types using gfs_glob_init(3) before calling gfs_glob(3). The allocated memory space needs to be free'ed by gfs_glob_free(3). RETURN VALUES NULL The function terminated successfully. GFARM_ERR_NO_MEMORY Insufficient memory was available. GFARM_ERR_PATHNAME_TOO_LONG Too long pattern or path name to process. Others An error except the above occurred. The reason is shown by its pointed strings. SEE ALSO gfs_glob_init3 gfs_glob_free3 gfarm_stringlist_init3 gfarm_stringlist_length3 gfarm_stringlist_elem3 gfarm_stringlist_free3 gfarm_stringlist_free_deeply3 gfarm-2.4.1/doc/docbook/en/ref/man3/gfs_pio_truncate.3.docbook0000644000000000000000000000427611507222720022556 0ustar rootroot 12 Jan 2005 gfs_pio_truncate 3 Gfarm gfs_pio_truncate truncate a file to a specified length #include <gfarm/gfarm.h> char *gfs_pio_truncate GFS_File gf file_offset_t length DESCRIPTION The gfs_pio_truncate() function truncates the regular file gf to the length bytes. If the file was previously shorter than the length, it is extended, and the extended part is filled by zero bytes. The file pointer is not changed. You must specify GFS_FILE_MODE_WRITE in opening the file, because it must be open for writing. RETURN VALUES NULL The function terminated successfully. GFARM_ERR_NO_MEMORY Insufficient memory was available. Others An error except the above occurred. The reason is shown by its pointed strings. SEE ALSO gfs_pio_create3, gfs_pio_open3 gfarm-2.4.1/doc/docbook/en/ref/man3/gfs_pio_read.3.docbook0000644000000000000000000000564411507222720021644 0ustar rootroot 27 Jun 2010 gfs_pio_read 3 Gfarm gfs_pio_read binary stream input #include <gfarm/gfarm.h> gfarm_error_t gfs_pio_read GFS_File gf void * buffer int size int * np DESCRIPTION gfs_pio_read() attempts to read up to size bytes from the file referenced by gf into the buffer starting at buffer, and returns the number of bytes read to the address pointed by np. On end of file, the number of bytes read is zero. RETURN VALUES GFARM_ERR_NO_ERROR The function terminated successfully. GFARM_ERR_OPERATION_NOT_PERMITTED gf does not specify a regular file. GFARM_ERR_BAD_FILE_DESCRIPTOR The file descripter specified by gf is not a valid or is not open for reading. GFARM_ERR_NO_FILE_SYSTEM_NODE There is no available file system node. GFARM_ERR_NO_MEMORY Insufficient memory was available. Others An error except the above occurred. The reason is shown by gfarm_error_string3. SEE ALSO gfs_pio_create3, gfs_pio_open3 gfarm-2.4.1/doc/docbook/en/ref/man3/gfs_chdir.3.docbook0000644000000000000000000000443211507222720021145 0ustar rootroot 11 Sep 2002 gfs_chdir 3 Gfarm gfs_chdir change working directory #include <gfarm/gfarm.h> char *gfs_chdir const char * gfarm_url DESCRIPTION gfs_chdir() changes the current working directory to that specified by gfarm_url. RETURN VALUES NULL The function terminated successfully. GFARM_ERR_NO_MEMORY Insufficient memory was available. GFARM_ERR_AUTHENTICATION User authentication failed when connecting to gfmd(8). GFARM_ERR_PERMISSION_DENIED gfarm_url points outside your accessible address space. GFARM_ERR_NO_SUCH_OBJECT Directory does not exist. GFARM_ERR_NOT_A_DIRECTORY A component of the path prefix is not a directory. Others An error except the above occurred. The reason is shown by its pointed strings. gfarm-2.4.1/doc/docbook/en/ref/man3/gfs_pio_open.3.docbook0000644000000000000000000002260711507222720021670 0ustar rootroot 26 Jun 2010 gfs_pio_open 3 Gfarm gfs_pio_open open a file in the Gfarm file system #include <gfarm/gfarm.h> gfarm_error_t gfs_pio_open const char * gfarm_url int flags GFS_File * gfp DESCRIPTION gfs_pio_open() opens a file in the Gfarm file system specified by gfarm_url, and returns a GFS_File structure to the address pointed by gfp. gfarm_url is a path name in the Gfarm file system, or a Gfarm URL in the form of gfarm://metaserver:port/path/name. Values of flags are constructed by a bitwise-inclusive-OR of the following list. Exactly one of the first three values should be specified: GFARM_FILE_RDONLY Open for reading only. GFARM_FILE_WRONLY Open for writing only. GFARM_FILE_RDWR Open for reading and writing. GFARM_FILE_TRUNC If the file already exist and is a regular file, it will be truncated to length 0 if the open mode allows writing. RETURN VALUES GFARM_ERR_NO_ERROR The function terminated successfully. GFARM_ERR_IS_A_DIRECTORY gfarm_url refers to a directory. GFARM_ERR_IS_A_SYMBOLIC_LINK gfarm_url refers to a symbolic link. GFARM_ERR_OPERATION_NOT_PERMITTED gfarm_url refers to not a regular file. GFARM_ERR_NO_SUCH_OBJECT A component used as a directory in gfarm_url does not exist. GFARM_ERR_NOT_A_DIRECTORY A component used as a directory in gfarm_url is not, in fact, a directory. GFARM_ERR_PERMISSION_DENIED The requested access to the file is not allowed, or one of the directories in gfarm_url did not allow search (execute) permission. Or, the authentication to the metadata server fails. GFARM_ERR_NO_MEMORY Insufficient memory was available. GFARM_ERR_INVALID_ARGUMENT flags is not valid. GFARM_ERR_GFARM_URL_HOST_IS_MISSING gfarm_url does not include a metadata server. GFARM_ERR_GFARM_URL_PORT_IS_MISSING gfarm_url does not include a port number of the metadata server. GFARM_ERR_UNKNOWN_HOST The metadata server cannot be resolved. GFARM_ERR_TOO_MANY_OPEN_FILES The process opens too many files. GFARM_ERR_TOO_MANY_OPEN_FILES_IN_SYSTEM The system limit on the total number of open files has been reached. GFARM_ERR_NETWORK_IS_UNREACHABLE Network is unrechable. GFARM_ERR_OPERATION_TIMED_OUT Connetion timeout occurs. GFARM_ERR_PROTOCOL Protocol error occurs. GFARM_ERR_BROKEN_PIPE Connection to the metadata server is broken. GFARM_ERR_PROTOCOL_NOT_SUPPORTED Specified authentication protocol is not supported. GFARM_ERR_AUTHENTICATION User authentication failed when connecting to the metadata server. Others An error except the above occurred. The reason is shown by gfarm_error_string3. SEE ALSO gfs_pio_close3, gfs_pio_create3, gfs_pio_eof3, gfs_pio_error3, gfs_pio_flush3, gfs_pio_getc3, gfs_pio_getline3, gfs_pio_open3, gfs_pio_putc3, gfs_pio_putline3, gfs_pio_puts3, gfs_pio_read3, gfs_pio_seek3, gfs_pio_ungetc3, gfs_pio_write3 gfarm-2.4.1/doc/docbook/en/ref/man3/gfs_pio_write.3.docbook0000644000000000000000000000615511507222720022061 0ustar rootroot 27 Jun 2010 gfs_pio_write 3 Gfarm gfs_pio_write write to a file #include <gfarm/gfarm.h> gfarm_error_t gfs_pio_write GFS_File gf const void * buffer int size int * np DESCRIPTION gfs_pio_write() writes up to size bytes to the file gf from the buffer starting at buffer. It returns the number of bytes written to the address pointed by np. RETURN VALUES GFARM_ERR_NO_ERROR The function terminated successfully. GFARM_ERR_OPERATION_NOT_PERMITTED gf does not specify a regular file. GFARM_ERR_BAD_FILE_DESCRIPTOR The file descripter specified by gfp is not a valid or is not open for writing. GFARM_ERR_NO_SPACE The file system node has no room to store data GFARM_ERR_NO_FILE_SYSTEM_NODE There is no available file system node. GFARM_ERR_NO_MEMORY Insufficient memory was available. Others An error except the above occurred. The reason is shown by gfarm_error_string3. SEE ALSO gfs_pio_create3, gfs_pio_flush3, gfs_pio_open3 gfarm-2.4.1/doc/docbook/en/ref/man3/gfarm_strings_free_deeply.3.docbook0000644000000000000000000000233111507222720024421 0ustar rootroot 1 May 2002 gfarm_strings_free_deeply 3 Gfarm gfarm_strings_free_deeply free an array of strings #include <gfarm/gfarm.h> void gfarm_strings_free_deeply int n char ** strings DESCRIPTION gfarm_string_free_deeply() frees the memory space of an array of strings strings with the size n. This also frees every string in the array. gfarm-2.4.1/doc/docbook/en/ref/man3/gfs_pio_readline.3.docbook0000644000000000000000000001250111507222720022502 0ustar rootroot 13 May 2004 gfs_pio_readline 3 Gfarm gfs_pio_readline read one line #include <gfarm/gfarm.h> char *gfs_pio_readline GFS_File f char **bufp size_t *sizep size_t *lenp DESCRIPTION gfs_pio_readline() reads one line from the file specified by the parameter gf. Parameter bufp specifies an address of a pointer variable initialzed by NULL at first. gfs_pio_readline() allocates a buffer for I/O dynamically, and stores the address of the buffer to this variable pointed by bufp. Parameter sizep specifies an address of a size_t variable initialized by 0. This size_t variable is used to record the size of the buffer. Or, you can specify a buffer allocated by malloc(3) in the variable pointed by the parameter bufp. In this case, you have to specify the size of the allocated buffer by the parameter sizep. If the length of the line exceeds the size of the buffer, the buffer will be automatically realloc(3)ed, and the variable pointed by bufp and sizep will be updated respectively. Note that you are responsible to free(3) this buffer. This function returns the length of the line to a variable pointed by the parameter lenp. This length includes newline character. Just like gfs_pio_gets(3), this function doesn't remove newline character at the end of lines. Also, this function always appends '\0' at the end of strings. You can deal with lines which include '\0' character by using the variable pointed by the parameter lenp. If the file reaches its end, the length of the result string becomes 0. This function is equivalent to gfs_pio_readdelim(f, bufp, sizep, lenp, "\n", 1). RETURN VALUES NULL The function terminated successfully. GFARM_ERR_NO_MEMORY Insufficient memory was available. Note that you need to free(3) the buffer pointed by the parameter bufp Others An error except the above occurred. The reason is shown by its pointed strings. EXAMPLES Example of <function>gfs_pio_readline</function> function #include <stdio.h> #include <stdlib.h> #include <gfarm/gfarm.h> int main(int argc, char **argv) { char *e; GFS_File gf; size_t bufsize = 0, len; char *buffer = NULL; e = gfarm_initialize(&argc, &argv); if (e != NULL) { fprintf(stderr, "gfarm_initialize: %s\n", e); return (EXIT_FAILURE); } if (argc <= 1) { fprintf(stderr, "missing gfarm filename\n"); return (EXIT_FAILURE); } e = gfs_pio_open(argv[1], GFARM_FILE_RDONLY, &gf); if (e != NULL) { fprintf(stderr, "%s: %s\n", argv[1], e); return (EXIT_FAILURE); } e = gfs_pio_set_view_global(gf, 0); if (e != NULL) { fprintf(stderr, "%s: gfs_pio_set_view_global: %s\n", argv[1], e); return (EXIT_FAILURE); } while ((e = gfs_pio_readline(gf, &buffer, &bufsize, &len)) == NULL && len > 0) { printf("<%6d/%6d >%s", len, bufsize, buffer); } if (buffer != NULL) free(buffer); if (e != NULL) { fprintf(stderr, "ERROR: %s\n", e); return (EXIT_FAILURE); } e = gfs_pio_close(gf); if (e != NULL) { fprintf(stderr, "gfs_pio_close: %s\n", e); return (EXIT_FAILURE); } e = gfarm_terminate(); if (e != NULL) { fprintf(stderr, "gfarm_initialize: %s\n", e); return (EXIT_FAILURE); } return (EXIT_SUCCESS); } SEE ALSO gfs_pio_open3, gfs_pio_getline3, gfs_pio_gets3, gfs_pio_readdelim3 gfarm-2.4.1/doc/docbook/en/ref/man3/gfarm_url_section_replicate_to.3.docbook0000644000000000000000000000560511507222720025454 0ustar rootroot 6 Sep 2005 gfarm_url_section_replicate_to 3 Gfarm gfarm_url_section_replicate_to Create a file replica of a file section #include <gfarm/gfarm.h> char *gfarm_url_section_replicate_to const char *gfarm_url char *section char *dsthost DESCRIPTION gfarm_url_section_replicate_to() creates a file replica of a file section section of a file gfarm_url to a destination host dsthost. File section is an architecture name for executable files, or is a fragment index for a regular file. Note that a fragment index needs to be specified in string without any unnecessary space character and zero padding. RETURN VALUES NULL The function terminated successfully. GFARM_ERR_NO_MEMORY Insufficient memory was available. GFARM_ERR_NO_SUCH_OBJECT A component used as a directory in gfarm_url does not exist. GFARM_ERR_TEXT_FILE_BUSY The file gfarm_url cannot be replicated because it is being updated by another process. Others An error except the above occurred. The reason is shown by its pointed strings. SEE ALSO gfarm_url_section_replicate_from_to3, gfarm_url_fragments_replicate3 gfarm-2.4.1/doc/docbook/en/ref/man3/gfs_pio_putline.3.docbook0000644000000000000000000000364111507222720022404 0ustar rootroot 1 May 2002 gfs_pio_putline 3 Gfarm gfs_pio_putline output of a line #include <gfarm/gfarm.h> char *gfs_pio_putline GFS_File gf char * s DESCRIPTION gfs_pio_putline() writes the string s and a trailing newline to gf. RETURN VALUES NULL The function terminated successfully. GFARM_ERR_NO_MEMORY Insufficient memory was available. Others An error except the above occurred. The reason is shown by its pointed strings. SEE ALSO gfs_pio_create3, gfs_pio_open3 gfarm-2.4.1/doc/docbook/en/ref/man3/gfs_utimes.3.docbook0000644000000000000000000000624411507222720021365 0ustar rootroot 4 Dec 2003 gfs_utimes 3 Gfarm gfs_utimes set file access and modification times #include <gfarm/gfarm.h> char *gfs_utimes const char * gfarm_url const struct gfarm_timespec * tsp DESCRIPTION gfs_utimes() sets the access and modification times of the file pointed to by the gfarm_url argument to the value of the tsp argument. The tsp argument is an array of gfarm_timespec structures. The first array member represents the access time, and the second member represents the modification time. The gfarm_timespec structure is: struct gfarm_timespec { unsigned int tv_sec; /* seconds */ unsigned int tv_nsec; /* nanoseconds */ }; If the tsp argument is a null pointer, the access and modification times of the file are set to the current time. RETURN VALUES NULL The function terminated successfully. GFARM_ERR_GFARM_URL_PREFIX_IS_MISSING gfarm_url does not start with the gfarm: prefix. GFARM_ERR_NO_MEMORY Insufficient memory was available. GFARM_ERR_AUTHENTICATION User authentication failed when connecting to gfmd(8). GFARM_ERR_PERMISSION_DENIED gfarm_url points outside your accessible address space. GFARM_ERR_NO_SUCH_OBJECT gfarm_url does not exist. Others An error except the above occurred. The reason is shown by its pointed strings. SEE ALSO gfs_stat3 gfarm-2.4.1/doc/docbook/en/ref/man3/gfarm_terminate.3.docbook0000644000000000000000000000333411507222720022361 0ustar rootroot 26 Jun 2010 gfarm_terminate 3 Gfarm gfarm_terminate terminate the Gfarm execution environment for client #include <gfarm/gfarm.h> gfarm_error_t gfarm_terminate void DESCRIPTION gfarm_terminate() terminates the Gfarm execution environment for client application. RETURN VALUES GFARM_ERR_NO_ERROR The function terminated successfully. Others An error except the above occurred. The reason is shown by gfarm_error_string3. SEE ALSO gfarm_initialize3 gfarm-2.4.1/doc/docbook/en/ref/man3/gfs_pio_error.3.docbook0000644000000000000000000000343411507222720022055 0ustar rootroot 1 May 2002 gfs_pio_error 3 Gfarm gfs_pio_error check file status #include <gfarm/gfarm.h> char *gfs_pio_error GFS_File gf DESCRIPTION The function gfs_pio_error() tests the error indicator for the file pointed to by gf, returning non-zero if it is set. RETURN VALUES NULL There is no error. Others An error occurred. The reason is shown by its pointed strings. SEE ALSO gfs_pio_create3, gfs_pio_eof3, gfs_pio_open3 gfarm-2.4.1/doc/docbook/en/ref/man3/gfs_chmod.3.docbook0000644000000000000000000000670211507222720021150 0ustar rootroot 22 Feb 2005 gfs_chmod 3 Gfarm gfs_chmod change permissions of a file #include <gfarm/gfarm.h> char *gfs_chmod char * gfarm_url mode_t mode DESCRIPTION gfs_chmod() changes the mode of the file given by gfarm_url. Permission bit masks of mode are similar to ones of mode parameter to chmod(2), though only the least 9 bit are effective. An executable file cannot be changed to a non-executable file and vice versa, unless the number of fragment of the file is only one. In detail, a file has multiple fragments with any execution bit should not be changed to that with no execution bit. It is necessary to have at least one execution bit. Similarly, a file has multiple fragments with no execution bit should not be changed to that with any execution bit. RETURN VALUES NULL The function terminated successfully. GFARM_ERR_NO_MEMORY Insufficient memory was available. GFARM_ERR_AUTHENTICATION User authentication failed when connecting to gfmd(8) or gfsd(8). GFARM_ERR_PERMISSION_DENIED The parent directory of gfarm_url did not allow write permission. GFARM_ERR_OPERATION_NOT_PERMITTED The effective UID does not match the owner of the file, and is not zero. Or an attempt was made to change an executable file with more than one fragment to a non-executable file, or vice versa. GFARM_ERR_NO_SUCH_OBJECT The file does not exist. GFARM_ERR_NOT_A_DIRECTORY A component of the path prefix is not a directory. Others An error except the above occurred. The reason is shown by its pointed strings. gfarm-2.4.1/doc/docbook/en/ref/man3/gfs_pio_set_view_local.3.docbook0000644000000000000000000000711611507222720023724 0ustar rootroot 1 May 2002 gfs_pio_set_view_local 3 Gfarm gfs_pio_set_view_local change file view to the corresponding fragment #include <gfarm/gfarm.h> char *gfs_pio_set_view_local GFS_File gf int flags DESCRIPTION gfs_pio_set_view_local() changes the process's view of the data in the file specified by gf to a file fragment in the local file view. The local file view model assumes each process has its own file fragment which is specified by the argument node of gfs_pio_set_local(3). The total number of file fragments is also specified by the argument nnode of gfs_pio_set_local(3). If it is different from the total fragment number of the existent file, it is erroneous. Before changing to the local file view, it is necessary to call gfs_pio_set_local(3) in advance. Values of flag are constructed by a bitwise-inclusive-OR of GFARM_FILE_SEQUENTIAL, GFARM_FILE_REPLICATE, and GFARM_FILE_NOT_REPLICATE. For details, refer to gfs_pio_set_view_index(3). By default, Gfarm files are accessed as a whole file in global file view where each fragment can be seamlessly accessed. RETURN VALUES NULL The function terminated successfully. GFARM_ERR_NO_MEMORY Insufficient memory was available. GFARM_ERR_OPERATION_NOT_PERMITTED The file is not a fragmented file. GFARM_ERR_FRAGMENT_NUMBER_DOES_NOT_MATCH The total number of file fragments is different from the existence one. Others An error except the above occurred. The reason is shown by its pointed strings. SEE ALSO gfs_pio_create3, gfs_pio_open3, gfs_pio_set_local3, gfs_pio_set_view_index3 gfarm-2.4.1/doc/docbook/en/ref/man3/gfarm_url_hosts_schedule.3.docbook0000644000000000000000000000455311507222720024273 0ustar rootroot 1 May 2002 gfarm_url_hosts_schedule 3 Gfarm gfarm_url_hosts_schedule schedule filesystem nodes using file-affinity scheduling #include <gfarm/gfarm.h> char *gfarm_url_hosts_schedule char * gfarm_url char * option int * nhostsp char *** hostsp DESCRIPTION The gfarm_url_hosts_schedule() function schedules filesystem nodes using file-affinity scheduling with a Gfarm file gfarm_url, and returns an array of filesystem hostnames hostsp and the number of scheduled hosts nhostsp. The returned array of hostnames hostsp should be free'ed with gfarm_strings_free_deeply(3). RETURN VALUES NULL The function terminated successfully. GFARM_ERR_NO_MEMORY Insufficient memory was available. Others An error except the above occurred. The reason is shown by its pointed strings. NOTES The argument option is reserved to specify options for scheduling, although it is not used in the current implementation. gfarm-2.4.1/doc/docbook/en/ref/man3/gfs_unlink.3.docbook0000644000000000000000000000474211507222720021360 0ustar rootroot 1 May 2002 gfs_unlink 3 Gfarm gfs_unlink delete a file #include <gfarm/gfarm.h> char *gfs_unlink char * gfarm_url DESCRIPTION gfs_unlink() deletes the file whose name is the string specified by gfarm_url. RETURN VALUES NULL The function terminated successfully. GFARM_ERR_NO_MEMORY Insufficient memory was available. GFARM_ERR_AUTHENTICATION User authentication failed when connecting to gfmd(8). GFARM_ERR_PERMISSION_DENIED gfarm_url points outside your accessible address space. GFARM_ERR_NO_SUCH_OBJECT gfarm_url does not exist. GFARM_ERR_NOT_A_DIRECTORY A component of the path prefix is not a directory. Others An error except the above occurred. The reason is shown by its pointed strings. gfarm-2.4.1/doc/docbook/en/ref/man3/gfs_pio_seek.3.docbook0000644000000000000000000000473411507222720021657 0ustar rootroot 1 May 2002 gfs_pio_seek 3 Gfarm gfs_pio_seek reposition a stream #include <gfarm/gfarm.h> char *gfs_pio_seek GFS_File gf file_offset_t offset int whence file_offset_t * result DESCRIPTION The gfs_pio_seek() function sets the file position indicator for the file gf. The new position, measured in bytes, is obtained by adding offset bytes to the position specified by whence. If whence is set to 0, 1, or 2, the offset is relative to the start of the file, the current position indicator, or end-of-file, respectively. When result is not NULL, the new position returns to the address pointed by result. RETURN VALUES NULL The function terminated successfully. GFARM_ERR_NO_MEMORY Insufficient memory was available. Others An error except the above occurred. The reason is shown by its pointed strings. SEE ALSO gfs_pio_create3, gfs_pio_open3 gfarm-2.4.1/doc/docbook/en/ref/man3/gfs_mkdir.3.docbook0000644000000000000000000000572011507222720021163 0ustar rootroot 1 May 2002 gfs_mkdir 3 Gfarm gfs_mkdir create a directory #include <gfarm/gfarm.h> char *gfs_mkdir char * gfarm_url gfarm_mode_t mode DESCRIPTION gfs_mkdir() attempts to create a directory named gfarm_url. mode speficies the permissions to use. It is modified by the process's umask in the usual way: the permissions of the created file are (mode & ~umask). RETURN VALUES NULL The function terminated successfully. GFARM_ERR_NO_MEMORY Insufficient memory was available. GFARM_ERR_ALREADY_EXISTS gfarm_url already exists (not necessarily as a directory). This includes the case where gfarm_url is a symbolic link, dangling or not. GFARM_ERR_NO_SUCH_OBJECT The parent directory of gfarm_url does not exist. GFARM_ERR_NOT_A_DIRECTORY A component of the path prefix is not a directory. Others An error except the above occurred. The reason is shown by its pointed strings. gfarm-2.4.1/doc/docbook/en/ref/man3/gfarm_url_fragments_replicate.3.docbook0000644000000000000000000000520411507222720025267 0ustar rootroot 6 Sep 2005 gfarm_url_fragments_replicate 3 Gfarm gfarm_url_fragments_replicate Create a file replica of a file #include <gfarm/gfarm.h> char *gfarm_url_fragments_replicate const char *gfarm_url int ndsthosts char **dsthosts DESCRIPTION gfarm_url_fragments_replicate() creates a file replica of a file gfarm_url to destination hosts specified by a string array dsthosts with a length ndsthosts. It cannot replicate an executable file. When the total number of file fragments is greater than the specified total number of hosts ndsthosts, destination hosts are allocated in round robin. RETURN VALUES NULL The function terminated successfully. GFARM_ERR_NO_MEMORY Insufficient memory was available. GFARM_ERR_OPERATION_NOT_PERMITTED The file is not a regular fragmented file. Others An error except the above occurred. The reason is shown by its pointed strings. SEE ALSO gfarm_url_section_replicate_from_to3, gfarm_url_section_replicate_from_to3 gfarm-2.4.1/doc/docbook/en/ref/man3/gfs_chown.3.docbook0000644000000000000000000000540311507222720021171 0ustar rootroot 1 May 2002 gfs_chown 3 Gfarm gfs_chown change ownership of a file #include <gfarm/gfarm.h> char *gfs_chown char * gfarm_url char * user char * group DESCRIPTION The owner of the file specified by gfarm_url is changed. RETURN VALUES NULL The function terminated successfully. GFARM_ERR_NO_MEMORY Insufficient memory was available. GFARM_ERR_AUTHENTICATION User authentication failed when connecting to gfmd(8) or gfsd(8). GFARM_ERR_PERMISSION_DENIED gfarm_url points outside your accessible address space. GFARM_ERR_OPERATION_NOT_PERMITTED The effective UID does not match the owner of the file, and is not zero. GFARM_ERR_NO_SUCH_OBJECT The file does not exist. GFARM_ERR_NOT_A_DIRECTORY A component of the path prefix is not a directory. Others An error except the above occurred. The reason is shown by its pointed strings. gfarm-2.4.1/doc/docbook/en/ref/man3/gfs_glob_init.3.docbook0000644000000000000000000000372611507222720022027 0ustar rootroot 11 Sep 2003 gfs_glob_init 3 Gfarm gfs_glob_init allocates memory for types of path names #include <gfarm/gfarm.h> char *gfs_glob_init gfs_glob_t * listp DESCRIPTION gfs_glob_init() allocates memory space for gfs_glob(3) and gfs_glob_add(3). The memory space is stored to listp. RETURN VALUES NULL The function terminated successfully. GFARM_ERR_NO_MEMORY Insufficient memory was available. Others An error except the above occurred. The reason is shown by its pointed strings. SEE ALSO gfs_glob3 gfs_glob_add3 gfs_glob_free3 gfarm-2.4.1/doc/docbook/en/ref/man3/gfs_pio_putc.3.docbook0000644000000000000000000000357511507222720021705 0ustar rootroot 1 May 2002 gfs_pio_putc 3 Gfarm gfs_pio_putc output of a character #include <gfarm/gfarm.h> char *gfs_pio_putc GFS_File gf int c DESCRIPTION gfs_pio_putc() writes the charecter c to gf. RETURN VALUES NULL The function terminated successfully. GFARM_ERR_NO_MEMORY Insufficient memory was available. Others An error except the above occurred. The reason is shown by its pointed strings. SEE ALSO gfs_pio_create3, gfs_pio_open3 gfarm-2.4.1/doc/docbook/en/ref/man3/gfs_pio_sync.3.docbook0000644000000000000000000000447211507222720021703 0ustar rootroot 1 Jun 2005 gfs_pio_sync 3 Gfarm gfs_pio_sync output a file's data on memroy to disk #include <gfarm/gfarm.h> char *gfs_pio_sync GFS_File gf DESCRIPTION The function gfs_pio_sync copies data on memory of the gf, and waits for the I/O to complete before returning. It also updates metadtata stat information, while another function gfs_pio_datasync does not update the metadata. RETURN VALUES NULL The function terminated successfully. GFARM_ERR_NO_MEMORY Insufficient memory was available. Others An error except the above occurred. The reason is shown by its pointed strings. SEE ALSO gfs_pio_datasync3, gfs_pio_create3, gfs_pio_open3, gfs_pio_write3, gfs_pio_flush3 gfarm-2.4.1/doc/docbook/en/ref/man3/gfs_closedir.3.docbook0000644000000000000000000000342411507222720021660 0ustar rootroot 1 May 2002 gfs_closedir 3 Gfarm gfs_closedir close a directory #include <gfarm/gfarm.h> char * gfs_closedir GFS_Dir dir DESCRIPTION The gfs_closedir() function closes the directory stream associated with dir. The directory stream descriptor dir is not available after this call. RETURN VALUES NULL The function terminated successfully. Others An error except the above occurred. The reason is shown by its pointed strings. SEE ALSO gfs_opendir3, gfs_readdir3 gfarm-2.4.1/doc/docbook/en/ref/man3/gfs_pio_eof.3.docbook0000644000000000000000000000340111507222720021467 0ustar rootroot 1 May 2002 gfs_pio_eof 3 Gfarm gfs_pio_eof check file status #include <gfarm/gfarm.h> int gfs_pio_eof GFS_File gf DESCRIPTION The function gfs_pio_eof() tests the end-of-file indicator for the file pointed to by gf. RETURN VALUES zero The end-of-file indicator is not set. non-zero The end-of-file indicator is set. SEE ALSO gfs_pio_create3, gfs_pio_error3, gfs_pio_open3 gfarm-2.4.1/doc/docbook/en/ref/man3/gfs_glob_add.3.docbook0000644000000000000000000000341511507222720021607 0ustar rootroot 11 Sep 2003 gfs_glob_add 3 Gfarm gfs_glob_add adds the type of path name #include <gfarm/gfarm.h> char *gfs_glob_add gfs_glob_t * listp int dtype DESCRIPTION gfs_glob_add() adds the type of path name dtype to listp. RETURN VALUES NULL The function terminated successfully. GFARM_ERR_NO_MEMORY Insufficient memory was available. SEE ALSO gfs_glob_init3 gfs_glob3 gfs_glob_free3 gfarm-2.4.1/doc/docbook/en/ref/man3/gfs_opendir.3.docbook0000644000000000000000000000513011507222720021510 0ustar rootroot 1 May 2002 gfs_opendir 3 Gfarm gfs_opendir open a directory #include <gfarm/gfarm.h> char *gfs_opendir const char * gfarm_url GFS_Dir * dirp DESCRIPTION The gfs_opendir() function opens a directory stream corresponding to the directory gfarm_url, and returns the directory stream to the address pointed by dirp. The stream is positioned at the first entry in the directory. RETURN VALUES NULL The function terminated successfully. GFARM_ERR_NO_MEMORY Insufficient memory was available. GFARM_ERR_AUTHENTICATION User authentication failed when connecting to gfmd(8). GFARM_ERR_PERMISSION_DENIED gfarm_url points outside your accessible address space. GFARM_ERR_NO_SUCH_OBJECT Directory does not exist. Others An error except the above occurred. The reason is shown by its pointed strings. SEE ALSO gfs_closedir3, gfs_readdir3 gfarm-2.4.1/doc/docbook/en/ref/man3/gfs_pio_ungetc.3.docbook0000644000000000000000000000405411507222720022210 0ustar rootroot 1 May 2002 gfs_pio_ungetc 3 Gfarm gfs_pio_ungetc push a character back #include <gfarm/gfarm.h> int gfs_pio_ungetc GFS_File gf int c DESCRIPTION gfs_pio_ungetc() pushes a character c back to the file gf. gfs_pio_ungetc() is needed to follow gfs_pio_getc(3). RETURN VALUES EOF gfs_pio_ungetc() does not follow gfs_pio_getc(3). Others The function terminated successfully. SEE ALSO gfs_pio_create3, gfs_pio_error3, gfs_pio_getc3, gfs_pio_open3 gfarm-2.4.1/doc/docbook/en/ref/man3/gfs_rmdir.3.docbook0000644000000000000000000000472711507222720021200 0ustar rootroot 1 May 2002 gfs_rmdir 3 Gfarm gfs_rmdir delete a directory #include <gfarm/gfarm.h> char *gfs_rmdir char * gfarm_url DESCRIPTION gfs_rmdir() deletes a directory whose name is the string specified by gfarm_url. The directory must be empty. RETURN VALUES NULL The function terminated successfully. GFARM_ERR_NO_MEMORY Insufficient memory was available. GFARM_ERR_PERMISSION_DENIED gfarm_url points outside your accessible address space. GFARM_ERR_DIRECTORY_NOT_EMPTY Directory is not empty. GFARM_ERR_NO_SUCH_OBJECT Directory does not exist. GFARM_ERR_NOT_A_DIRECTORY A component of the path prefix is not a directory. Others An error except the above occurred. The reason is shown by its pointed strings. gfarm-2.4.1/doc/docbook/en/ref/man3/gfs_pio_readdelim.3.docbook0000644000000000000000000001516311507222720022654 0ustar rootroot 13 May 2004 gfs_pio_readdelim 3 Gfarm gfs_pio_readdelim read one record #include <gfarm/gfarm.h> char *gfs_pio_readdelim GFS_File f char **bufp size_t *sizep size_t *lenp char *delimiter size_t delimlen DESCRIPTION gfs_pio_readdelim() works like gfs_pio_readline(), except a delimiter of input records is not always newline, and can be specified. This function reads one record from the file specified by the parameter gf, by using the parameter delimiter as the delimiter of the input records. You can include '\0' character in the delimiter, So, you have to specify the length of the delimiter by the parameter delimlen. If parameter delimiter is NULL, this function reads entire file as one record. Otherwise, and if the parameter delimlen is 0, this function treats two or more consecutive empty lines (/\n\n+/ in a regular expression) as the input delimiter. This feature is derived from INPUT_RECORD_SEPARATOR in perl language. Parameter bufp specifies an address of a pointer variable initialzed by NULL at first. gfs_pio_readdelim() allocates a buffer for I/O dynamically, and stores the address of the buffer to this variable pointed by bufp. Parameter sizep specifies an address of a size_t variable initialized by 0. This size_t variable is used to record the size of the buffer. Or, you can specify a buffer allocated by malloc(3) in the variable pointed by the parameter bufp. In this case, you have to specify the size of the allocated buffer by the parameter sizep. If the length of the record exceeds the size of the buffer, the buffer will be automatically realloc(3)ed, and the variable pointed by bufp and sizep will be updated respectively. Note that you are responsible to free(3) this buffer. This function returns the length of the record to a variable pointed by the parameter lenp. This length includes the length of the record delimiter. This function doesn't remove the delimiter at the end of records. Also, despite that you can use the value returned by the variable pointed by lenp, this function always appends \0' character at the end of records. If the file reaches its end, the length of the result record becomes 0. gfs_pio_readdelim(f, bufp, sizep, lenp, "\n", 1) is equivalent to gfs_pio_readline() function. RETURN VALUES NULL The function terminated successfully. GFARM_ERR_NO_MEMORY Insufficient memory was available. Note that you need to free(3) the buffer pointed by the parameter bufp Others An error except the above occurred. The reason is shown by its pointed strings. EXAMPLES Example of <function>gfs_pio_readdelim</function> function #include <stdio.h> #include <stdlib.h> #include <string.h> #include <gfarm/gfarm.h> int main(int argc, char **argv) { char *e; GFS_File gf; size_t bufsize = 0, delimlen = 1, len; char *buffer = NULL, *delim = "\n"; e = gfarm_initialize(&argc, &argv); if (e != NULL) { fprintf(stderr, "gfarm_initialize: %s\n", e); return (EXIT_FAILURE); } while ((c = getopt(argc, argv, "d:D")) != -1) { switch (c) { case 'd': delim = optarg; delimlen = strlen(optarg); break; case 'D': delim = NULL; delimlen = 0; break; case '?': default: fprintf(stderr, "invalid option: %c\n", c); return (EXIT_FAILURE); } } if (optind >= argc) { fprintf(stderr, "missing gfarm filename\n"); return (EXIT_FAILURE); } e = gfs_pio_open(argv[optind], GFARM_FILE_RDONLY, &gf); if (e != NULL) { fprintf(stderr, "%s: %s\n", argv[optind], e); return (EXIT_FAILURE); } e = gfs_pio_set_view_global(gf, 0); if (e != NULL) { fprintf(stderr, "%s: gfs_pio_set_view_global: %s\n", argv[optind], e); return (EXIT_FAILURE); } while ((e = gfs_pio_readdelim(gf, &buffer, &bufsize, &len, delim, delimlen)) == NULL && len > 0) { printf("<%6d/%6d >%s", len, bufsize, buffer); } if (buffer != NULL) free(buffer); if (e != NULL) { fprintf(stderr, "ERROR: %s\n", e); return (EXIT_FAILURE); } e = gfs_pio_close(gf); if (e != NULL) { fprintf(stderr, "gfs_pio_close: %s\n", e); return (EXIT_FAILURE); } e = gfarm_terminate(); if (e != NULL) { fprintf(stderr, "gfarm_initialize: %s\n", e); return (EXIT_FAILURE); } return (EXIT_SUCCESS); } SEE ALSO gfs_pio_open3, gfs_pio_getline3, gfs_pio_gets3, gfs_pio_readline3 gfarm-2.4.1/doc/docbook/en/ref/man3/gfs_pio_getline.3.docbook0000644000000000000000000000451111507222720022350 0ustar rootroot 1 May 2002 gfs_pio_getline 3 Gfarm gfs_pio_getline read a line #include <gfarm/gfarm.h> char *gfs_pio_getline GFS_File f char * s size_t size int * eofp DESCRIPTION gfs_pio_getline() reads a line from the file gf, and stores to the buffer starting at s at most size - 1 bytes. It is indistinguishable whether the length of a line is more than size or equal to size - 1. It sets 1 into the address pointed by eofp on end of file, otherwise it sets 0. RETURN VALUES NULL The function terminated successfully. GFARM_ERR_NO_MEMORY Insufficient memory was available. Others An error except the above occurred. The reason is shown by its pointed strings. SEE ALSO gfs_pio_create3, gfs_pio_open3 gfarm-2.4.1/doc/docbook/en/ref/man3/gfs_pio_set_view_index.3.docbook0000644000000000000000000001116311507222720023736 0ustar rootroot 1 May 2002 gfs_pio_set_view_index 3 Gfarm gfs_pio_set_view_index change file view to an individual fragment #include <gfarm/gfarm.h> char *gfs_pio_set_view_index GFS_File gf int fragment_number int fragment_index char *host int flags DESCRIPTION gfs_pio_set_view_index() changes the process's view of the data in the file specified by gf to a file fragment with the index fragment_index. When creating a new file, it is necessary to specify the total number of file fragments fragment_number. Every parallel process should specify the same fragment_number for the corresponding file. When the file exists, GFARM_FILE_DONTCARE can be specified. If fragment_number is different from the total fragment number of the existent file, it is erroneous. host is used for explicitly specifying a filesystem node. If host is NULL, appropriate filesystem node is chosen. Values of flag are constructed by a bitwise-inclusive-OR of the following list. GFARM_FILE_SEQUENTIAL File will be accessed sequentially. GFARM_FILE_REPLICATE File may be replicated to a local filesystem when accessing remotely. This flag cannot be specified with GFARM_FILE_NOT_REPLICATE. GFARM_FILE_NOT_REPLICATE File may not be replicated to a local filesystem when accessing remotely. This flag cannot be specified with GFARM_FILE_REPLICATE. By default, Gfarm files are accessed as a whole file in global file view where each fragment can be seamlessly accessed. RETURN VALUES NULL The function terminated successfully. GFARM_ERR_NO_MEMORY Insufficient memory was available. GFARM_ERR_OPERATION_NOT_PERMITTED The file is not a regular fragmented file. GFARM_ERR_FRAGMENT_NUMBER_DOES_NOT_MATCH The total number of file fragments is different from the existence one. GFARM_ERR_INVALID_ARGUMENT Invalid arguments are specified, for instance, GFARM_FILE_DONTCARE is specified as the total number of fragments of a newly created file. Others An error except the above occurred. The reason is shown by its pointed strings. SEE ALSO gfs_pio_create3, gfs_pio_open3, gfs_pio_set_view_local3 gfarm-2.4.1/doc/docbook/en/ref/man3/gfs_unlink_section.3.docbook0000644000000000000000000000523611507222720023103 0ustar rootroot 19 May 2005 gfs_unlink_section 3 Gfarm gfs_unlink_section delete a file #include <gfarm/gfarm.h> char *gfs_unlink_section char * gfarm_url char * section DESCRIPTION gfs_unlink_section() deletes the file section whose name is the string specifiedby gfarm_url and section. RETURN VALUES NULL The function terminated successfully. GFARM_ERR_NO_MEMORY Insufficient memory was available. GFARM_ERR_AUTHENTICATION User authentication failed when connecting to gfmd(8). GFARM_ERR_PERMISSION_DENIED gfarm_url points outside your accessible address space. GFARM_ERR_NO_SUCH_OBJECT section of gfarm_url does not exist. GFARM_ERR_NOT_A_DIRECTORY A component of the path prefix is not a directory. Others An error except the above occurred. The reason is shown by its pointed strings. gfarm-2.4.1/doc/docbook/en/ref/man3/gfs_realpath.3.docbook0000644000000000000000000000535611507222720021662 0ustar rootroot 30 Sep 2003 gfs_realpath 3 Gfarm gfs_realpath resolve pathname in Gfarm filesystem #include <gfarm/gfarm.h> char *gfs_realpath const char * gfarm_url char ** resolved_pathp DESCRIPTION gfs_realpath expands a home directory '~' and resolves references to '.', '..' and extra '/' characters in the null terminated string pointed to by gfarm_url and stores the canonicalized absolute pathname to dynamically allocated memory space whose pointer is returned to resolved_pathp. It will be necessary to free the dynamically allocated memory space pointed to by resolved_pathp. RETURN VALUES NULL The function terminated successfully. GFARM_ERR_NO_MEMORY Insufficient memory was available. GFARM_ERR_NOT_A_DIRECTORY A component of the path prefix is not a directory. GFARM_ERR_INVALID_ARGUMENT gfarm_url is NULL. GFARM_ERR_PERMISSION_DENIED gfarm_url points outside your accessible address space. GFARM_ERR_NO_SUCH_OBJECT gfarm_url does not exist. Others An error except the above occurred. The reason is shown by its pointed strings. gfarm-2.4.1/doc/docbook/en/ref/man3/gfs_glob_free.3.docbook0000644000000000000000000000253211507222720021777 0ustar rootroot 11 Sep 2003 gfs_glob_free 3 Gfarm gfs_glob_free free memory for types of path names #include <gfarm/gfarm.h> char *gfs_glob_free gfs_glob_t * listp DESCRIPTION gfs_glob_free() frees the dynamically allocated storage from an earlier call to gfs_glob_init(3) SEE ALSO gfs_glob_init3 gfs_glob3 gfs_glob_add3 gfarm-2.4.1/doc/docbook/en/ref/man3/gfs_readdir.3.docbook0000644000000000000000000000421111507222720021461 0ustar rootroot 1 May 2002 gfs_readdir 3 Gfarm gfs_readdir read directory entry #include <gfarm/gfarm.h> char *gfs_readdir GFS_Dir dir struct gfs_dirent ** entryp DESCRIPTION The gfs_readdir() function reads a directory entry from dir, and returns the pointer of the entry to the address pointed to by entryp. The buffer pointed to by entryp is destroyed when calling succeeding gfs_readdir() or gfs_closedir() with the same argument dir. RETURN VALUES NULL The function terminated successfully. Others An error except the above occurred. The reason is shown by its pointed strings. SEE ALSO gfs_closedir3, gfs_opendir3, gfs_readdir3 gfarm-2.4.1/doc/docbook/en/ref/man3/gfs_rename.3.docbook0000644000000000000000000000716111507222720021325 0ustar rootroot 21 Feb 2005 gfs_rename 3 Gfarm gfs_rename change the name or location of a file #include <gfarm/gfarm.h> char *gfs_rename char * gfarm_url_from char * gfarm_url_to DESCRIPTION gfs_rename renames a file or directory gfarm_url_from to gfarm_url_to. If gfarm_url_to already exists, it will be replaced. In this case, when gfarm_url_from is a file gfarm_url_to also must be a file, when gfarm_url_from is a directory, gfarm_url_to must be a empty directory. Gfs_rename() can't rename a directory to a subdirectory of itself. RETURN VALUES NULL The function terminated successfully. GFARM_ERR_NO_MEMORY Insufficient memory was available. GFARM_ERR_AUTHENTICATION User authentication failed when connecting to gfmd(8). GFARM_ERR_PERMISSION_DENIED The parent directory of gfarm_url_from or gfarm_url_to did not allow write permission. GFARM_ERR_INVALID_ARGUMENT A attempt was made to rename the directory gfarm_url_from to a subdirectory of itself. GFARM_ERR_NO_SUCH_OBJECT gfarm_url_from does not exist. GFARM_ERR_IS_A_DIRECTORY gfarm_url_to is a existing directory, though gfarm_url_from is not a directory. GFARM_NOT_IS_A_DIRECTORY gfarm_url_to is not a directory. though gfarm_url_from is a directory. Others An error except the above occurred. The reason is shown by its pointed strings. gfarm-2.4.1/doc/docbook/en/ref/man3/gfs_pio_create.3.docbook0000644000000000000000000002031511507222720022164 0ustar rootroot 27 Jun 2010 gfs_pio_create 3 Gfarm gfs_pio_create create a file in the Gfarm file system #include <gfarm/gfarm.h> gfarm_error_t gfs_pio_create const char * gfarm_url int flags gfarm_mode_t mode GFS_File * gfp DESCRIPTION gfs_pio_create() creates a new file in the Gfarm file system whose name is the string pointed to by gfarm_url with the access mode mode, and returns a GFS_File structure to the address pointed to by gfp. Mode specifies the file permissions to be created, and is modified by the process's umask. The flags argument has the same meaning as the second argument of gfs_pio_open(), including the point such that exactly one of GFARM_FILE_RDONLY, GFARM_FILE_WRONLY, and GFARM_FILE_RDWR should be specified. Note that GFARM_FILE_TRUNC must be explicitly specified by the flags argument if needed. RETURN VALUES GFARM_ERR_NO_ERROR The function terminated successfully. GFARM_ERR_IS_A_DIRECTORY gfarm_url refers to a directory. GFARM_ERR_IS_A_SYMBOLIC_LINK gfarm_url refers to a symbolic link. GFARM_ERR_OPERATION_NOT_PERMITTED gfarm_url refers to not a regular file. GFARM_ERR_NOT_A_DIRECTORY A component used as a directory in gfarm_url is not, in fact, a directory. GFARM_ERR_PERMISSION_DENIED The requested access to the file is not allowed, or one of the directories in gfarm_url did not allow search (execute) permission, or the file did not exist yet and write access to the parent directory is not allowed. Or, the authentication to the metadata server fails. GFARM_ERR_NO_MEMORY Insufficient memory was available. GFARM_ERR_INVALID_ARGUMENT flags is not valid. GFARM_ERR_GFARM_URL_HOST_IS_MISSING gfarm_url does not include a metadata server. GFARM_ERR_GFARM_URL_PORT_IS_MISSING gfarm_url does not include a port number of the metadata server. GFARM_ERR_UNKNOWN_HOST The metadata server cannot be resolved. GFARM_ERR_TOO_MANY_OPEN_FILES The process opens too many files. GFARM_ERR_TOO_MANY_OPEN_FILES_IN_SYSTEM The system limit on the total number of open files has been reached. GFARM_ERR_NETWORK_IS_UNREACHABLE Network is unrechable. GFARM_ERR_OPERATION_TIMED_OUT Connetion timeout occurs. GFARM_ERR_PROTOCOL Protocol error occurs. GFARM_ERR_BROKEN_PIPE Connection to the metadata server is broken. GFARM_ERR_PROTOCOL_NOT_SUPPORTED Specified authentication protocol is not supported. GFARM_ERR_AUTHENTICATION User authentication failed when connecting to the metadata server. Others An error except the above occurred. The reason is shown by gfarm_error_string3. SEE ALSO gfs_pio_close3, gfs_pio_create3, gfs_pio_eof3, gfs_pio_error3, gfs_pio_flush3, gfs_pio_getc3, gfs_pio_getline3, gfs_pio_open3, gfs_pio_putc3, gfs_pio_putline3, gfs_pio_puts3, gfs_pio_read3, gfs_pio_seek3, gfs_pio_ungetc3, gfs_pio_write3 gfarm-2.4.1/doc/docbook/en/ref/man3/gfs_pio_puts.3.docbook0000644000000000000000000000357211507222720021722 0ustar rootroot 1 May 2002 gfs_pio_puts 3 Gfarm gfs_pio_puts output of a string #include <gfarm/gfarm.h> char *gfs_pio_puts GFS_File gf char * s DESCRIPTION gfs_pio_puts() writes the string s to gf. RETURN VALUES NULL The function terminated successfully. GFARM_ERR_NO_MEMORY Insufficient memory was available. Others An error except the above occurred. The reason is shown by its pointed strings. SEE ALSO gfs_pio_create3, gfs_pio_open3 gfarm-2.4.1/doc/docbook/en/ref/man3/gfs_pio_getc.3.docbook0000644000000000000000000000414011507222720021641 0ustar rootroot 1 May 2002 gfs_pio_getc 3 Gfarm gfs_pio_getc input of a charactor #include <gfarm/gfarm.h> int gfs_pio_getc GFS_File gf DESCRIPTION gfs_pio_getc() reads the next character from gf. RETURN VALUES EOF gfs_pio_getc() encountered end of file or error. EOF is defined in <stdio.h>. gfs_pio_error(3) is used to know end of file or error. Others gfs_pio_getc() returns the next character from the file. SEE ALSO gfs_pio_create3, gfs_pio_eof3, gfs_pio_error3, gfs_pio_open3, gfs_pio_ungetc3 gfarm-2.4.1/doc/docbook/en/ref/man3/gfarm.3.docbook0000644000000000000000000002354511507222720020317 0ustar rootroot 26 Jun 2010 gfarm 3 Gfarm gfarm Gfarm file system API library #include <gfarm/gfarm.h> DESCRIPTION The Gfarm library provides an interface layer to the Gfarm file system. This manual gives an overview of the library. For details, refer to a manual page of each function. Initialize / Finalize gfarm_initialize3 function is used for the initilization of the Gfarm library, and gfarm_terminate3 function is used for the termination of the library. File input/output operations To open an existing file as a stream, gfs_pio_open3 function is used. To create an file and open the file as a stream, gfs_pio_create3 function is used. gfs_pio_close3 function is used to close such streams. gfs_pio_error3 function is used to see whether an error happens or not about a stream. gfs_pio_eof3 function is used to see whether a stream, which is opened for read, already reaches end-of-file or not. gfs_pio_seek3 function changes the current position of the stream. gfs_pio_getc3 function reads a character from a stream, and gfs_pio_ungetc3 function puts back a character to a stream. gfs_pio_getline3 function, gfs_pio_gets3 function, and gfs_pio_readline3 function read one line from a stream, and gfs_pio_readdelim3 function reads from stream until delimiter character, specified by the function argument, appears. gfs_pio_read3 function reads specified bytes from a stream. gfs_pio_putc3 function writes one character to a stream, and gfs_pio_putline3 function and gfs_pio_puts3 function write one line to a stream. gfs_pio_write3 function writes specified bytes to a stream. gfs_pio_flush3 function, gfs_pio_sync3 function and gfs_pio_datasync3 function moves buffered data to a storage device. gfs_pio_truncate3 function truncates a file. Directory access gfs_opendir3 function opens a directory, and gfs_readdir3 function retrieves entries of the directory. gfs_closedir3 function closes the directory. A gfs_glob_t data, which is initialized by gfs_glob_init3 function, can be passed to gfs_glob3 function, and the gfs_glob function returns list of matched file/directory names in the gfs_glob_t. The gfs_glob_t must be released by gfs_glob_free3 function. gfs_glob_add3 function is used add an entry to gfs_glob_t. File / Directory manipulation gfs_chmod3 function changes the mode of a file, and gfs_chown3 function changes the owner of a file, and gfs_utimes3 function changes file's modification time and access time. gfs_mkdir3 function creates a directory, and gfs_rmdir3 function removes a directory. gfs_unlink3 function removes a file, and gfs_rename3 function renames a file or a directory. gfs_stat3 function returns information like size, modified/access time, etc. The struct gfs_stat returned by gfs_stat function must be released by gfs_stat_free3 function. Error handling Most Gfarm API returns the Gfarm error code in gfarm_error_t. gfarm_error_string3 function returns a string describing the Gfarm error code. gfarm_errno_to_error3 function translates the error number (errno) to the Gfarm error code. gfarm_error_to_errno3 function translates the Gfarm error code to the error number. String Array manipulation utilities A gfarm_stringlist type variable represents an array of strings, and this type is initialized by gfarm_stringlist_init3 function. gfarm_stringlist_add3 function is used to add a string to a gfarm_stringlist. gfarm_stringlist_cat3 function is used to add strings to a gfarm_stringlist. gfarm_stringlist_free3 function releases gfarm_stringlist. gfarm_stringlist_elem3 function or GFARM_STRINGLIST_ELEM() macro can be used to access each string of an array. gfarm_stringlist_length3 function can be used to see number of strings in an array. gfarm_strings_free_deeply3 function releases a string array and each element of the array by calling standard library function free(). String Array manipulation macros GFARM_STRINGLIST_ELEM(list, i) represents i-th element of the list argument which type is gfarm_stringlist. This macro can be used as a L-value. If this macro is used as a value, it returns same result with gfarm_stringlist_elem3 function. GFARM_STRINGLIST_STRARRAY(list) returns pointer to first element of the list argument which type is gfarm_stringlist. The type of the return value is a pointer to pointer to a character. gfarm-2.4.1/doc/docbook/en/ref/man3/gfarm_url_section_replicate_from_to.3.docbook0000644000000000000000000000636711507222720026505 0ustar rootroot 6 Sep 2005 gfarm_url_section_replicate_from_to 3 Gfarm gfarm_url_section_replicate_from_to Create a file replica of a file section #include <gfarm/gfarm.h> char *gfarm_url_section_replicate_from_to const char *gfarm_url char *section char *srchost char *dsthost DESCRIPTION gfarm_url_section_replicate_from_to() creates a file replica of a file section section of a file gfarm_url from a source host srchost to a destination host dsthost. File section is an architecture name for executable files, or is a fragment index for a regular file. Note that a fragment index needs to be specified in string without any unnecessary space character and zero padding. When there is no file copy on a host specified by srchost, gfarm_url_section_replicate_from_to() returns error. RETURN VALUES NULL The function terminated successfully. GFARM_ERR_NO_MEMORY Insufficient memory was available. GFARM_ERR_NO_SUCH_OBJECT A component used as a directory in gfarm_url does not exist, or a file copy does not exist on the specified source host. GFARM_ERR_TEXT_FILE_BUSY The file gfarm_url cannot be replicated because it is being updated by another process. Others An error except the above occurred. The reason is shown by its pointed strings. SEE ALSO gfarm_url_section_replicate_to3, gfarm_url_fragments_replicate3 gfarm-2.4.1/doc/docbook/en/ref/man3/gfs_pio_flush.3.docbook0000644000000000000000000000371111507222720022043 0ustar rootroot 1 May 2002 gfs_pio_flush 3 Gfarm gfs_pio_flush flush a stream #include <gfarm/gfarm.h> char *gfs_pio_flush GFS_File gf DESCRIPTION The function gfs_pio_flush() forces a write of all user-space buffered data for the given output gf. RETURN VALUES NULL The function terminated successfully. GFARM_ERR_NO_MEMORY Insufficient memory was available. Others An error except the above occurred. The reason is shown by its pointed strings. SEE ALSO gfs_pio_create3, gfs_pio_open3, gfs_pio_write3 gfarm-2.4.1/doc/docbook/en/ref/man3/gfarm_initialize.3.docbook0000644000000000000000000000716211507222720022535 0ustar rootroot 26 Jun 2010 gfarm_initialize 3 Gfarm gfarm_initialize initialize the Gfarm execution environment for client #include <gfarm/gfarm.h> gfarm_error_t gfarm_initialize int *argcp char *** argvp DESCRIPTION gfarm_initialize() initializes the Gfarm execution environment for client application. This function should be called before any Gfarm library API. argcp is a pointer to the number of arguments and argvp is a pointer to the argument vector. RETURN VALUES GFARM_ERR_NO_ERROR The function terminated successfully. GFARM_ERR_NO_MEMORY Insufficient memory was available. GFARM_ERR_UNKNOWN_HOST The metadata server cannot be resolved. GFARM_ERR_NETWORK_IS_UNREACHABLE Network is unrechable. GFARM_ERR_OPERATION_TIMED_OUT Connetion timeout occurs. GFARM_ERR_PROTOCOL Protocol error occurs. GFARM_ERR_BROKEN_PIPE Connection to the metadata server is broken. GFARM_ERR_PERMISSION_DENIED The requested access to the file is not allowed, or one of the directories in gfarm_url did not allow search (execute) permission. Or, the authentication to the metadata server fails. GFARM_ERR_PROTOCOL_NOT_SUPPORTED Specified authentication protocol is not supported. GFARM_ERR_AUTHENTICATION User authentication failed when connecting to the metadata server. Others An error except the above occurred. The reason is shown by its gfarm_error_string3. SEE ALSO gfarm_terminate3 gfarm-2.4.1/doc/docbook/en/ref/man8/0000755000000000000000000000000011507222730015515 5ustar rootrootgfarm-2.4.1/doc/docbook/en/ref/man8/Makefile.inc0000644000000000000000000000003611507222720017723 0ustar rootrootDOCBOOK = \ gfmd.8 \ gfsd.8 gfarm-2.4.1/doc/docbook/en/ref/man8/gfmd.8.docbook0000644000000000000000000000736611507222720020155 0ustar rootroot 14 Feb 2008 gfmd 8 Gfarm gfmd(8) Gfarm metadata server gfmd options DESCRIPTION gfmd is a Gfarm filesystem metadata server for accessing the filesystem metadata of the Gfarm filesystem. gfmd must be running on a metadata server node in advance. It is possible for gfmd to be executed as a non-privileged user process, although only the user that executes the gfmd can be authenticated. Other users cannot use it. For details, see SETUP.private.en document To access gfmd, the hostname and the port number should be specified by the metadb_server_host and metadb_server_port statements, respectively, in ~/.gfarm2rc or in %%SYSCONFDIR%%/gfarm2.conf on a client node. OPTIONS log-level Specifies a log priority level. The log output, which priority is higher or equal to this level, will be sent to syslog or standard error. Please refer gfarm2.conf(5) for the priority levels which can be specified by this option. pid-file Specifies a file name to be used to record the process ID of gfmd. Specifies the debug mode. With the -d option, gfmd runs as a foreground process, not a daemon. If this option is specified and is not specified, the log level is set to "debug". config-file Specifies a configuration file that is read instead of the default configuration file. port Specifies a port number to be used by gfmd. syslog-facility Specifies a syslog facility to report errors encountered by gfmd. By default, local0 is used. Makes gfmd output verbose log message on authentication. This is useful, when one has to resolve an issue about GSI authenticaion. Displays a list of command options. FILES %%SYSCONFDIR%%/gfmd.conf configuration file SEE ALSO gfarm2.conf5 gfarm-2.4.1/doc/docbook/en/ref/man8/gfsd.8.docbook0000644000000000000000000001121011507222720020142 0ustar rootroot 14 Feb 2008 gfsd 8 Gfarm gfsd(8) Gfarm filesystem daemon gfsd options DESCRIPTION gfsd is a filesystem daemon for the Gfarm filesystem, which runs on every filesystem node, usually, with root privileges. gfsd provides remote file operations with access control in the Gfarm filesystem as well as user authentication, file replication, and node resource status monitoring. It is possible for gfsd to be executed as a non-privileged user process, although only the user that executes the gfsd can be authenticated. Other users cannot use it. For details, see SETUP.private.en document. OPTIONS log-level Specifies a log priority level. The log output, which priority is higher or equal to this level, will be sent to syslog or standard error. Please refer gfarm2.conf(5) for the priority levels which can be specified by this option. pid-file Specifies a file name which records the process ID of gfsd. When starting up, gfsd investigates all files stored in a spool directory. This option is useful when a hostname of a file system node is changed. Valid file copies will be registered to the metadata server. When the option is specified more than once, invalid file copies that are not registered in the metadata server are deleted. Specifies the debug mode. With the -d option, gfsd runs as a foreground process, not a daemon. If this option is specified and is not specified, the log level is set to "debug". config-file Specifies a configuration file that is read instead of the default configuration file. hostname Specifies my own canonical host name. IP-address Specifies the IP address from which the gfsd accepts TCP and UDP requests. The default address is all IP addresses of the host. This option is useful to invoke multiple instances of gfsd to provide multiple spool directories on the host. directory Specifies a spool directory for a Gfarm filesystem on this filesystem node. syslog-facility Specifies a syslog facility to report errors by gfsd. By default, local0 is used. Makes gfsd output verbose log message on authentication. This is useful, when one has to resolve an issue about GSI authenticaion. Displays a list of command options. FILES %%SYSCONFDIR%%/gfarm2.conf configuration file SEE ALSO gfarm2.conf5 gfarm-2.4.1/doc/docbook/en/ref/man1/0000755000000000000000000000000011507222730015506 5ustar rootrootgfarm-2.4.1/doc/docbook/en/ref/man1/gfpwd.1.docbook0000644000000000000000000000166511507222720020325 0ustar rootroot 2 Jul 2003 gfpwd 1 Gfarm gfpwd print Gfarm working directory name gfpwd DESCRIPTION gfpwd prints current Gfarm working directory name. SEE ALSO gfcd1 , gfsetdir1 gfarm-2.4.1/doc/docbook/en/ref/man1/Makefile.inc0000644000000000000000000000101611507222720017713 0ustar rootrootDOCBOOK = \ gfchgrp.1 \ gfchmod.1 \ gfchown.1 \ gfdf.1 \ gffindxmlattr.1 \ gfgroup.1 \ gfhost.1 \ gfkey.1 \ gfln.1 \ gfls.1 \ gfmkdir.1 \ gfmv.1 \ gfrep.1 \ gfrmdir.1 \ gfsched.1 \ gfstat.1 \ gfstatus.1 \ gfuser.1 \ gfwhere.1 \ gfwhoami.1 \ gfxattr.1 # gfarm_agent.1 \ # gfcd.1 \ # gfexec.1 \ # gfexport.1 \ # gfgrep.1 \ # gfimport_fixed.1 \ # gfimport_text.1 \ # gfmpirun_p4.1 \ # gfps.1 \ # gfpwd.1 \ # gfrcmd.1 \ # gfreg.1 \ # gfrm.1 \ # gfront.1 \ # gfrun.1 \ # gfsetdir.1 \ # gfusage.1 \ # gfwc.1 \ gfarm-2.4.1/doc/docbook/en/ref/man1/gfstat.1.docbook0000644000000000000000000000231011507222720020472 0ustar rootroot 4 Jan 2010 gfstat 1 Gfarm gfstat display file or directory status gfstat options path DESCRIPTION gfstat displays information about the specified files or directories in the Gfarm filesystem. OPTIONS displays only the number of file replicas. displays a list of command options. gfarm-2.4.1/doc/docbook/en/ref/man1/gfchmod.1.docbook0000644000000000000000000000206411507222720020617 0ustar rootroot 21 Dec 2008 gfchmod 1 Gfarm gfchmod change Gfarm file permission gfchmod options mode path DESCRIPTION gfchmod changes a permission of Gfarm files. OPTIONS Displays a list of command options. gfarm-2.4.1/doc/docbook/en/ref/man1/gfchgrp.1.docbook0000644000000000000000000000205311507222720020626 0ustar rootroot 21 Dec 2008 gfchgrp 1 Gfarm gfchgrp change Gfarm file group gfchgrp options group path DESCRIPTION gfchgrp changes a group of Gfarm files. OPTIONS Displays a list of command options. gfarm-2.4.1/doc/docbook/en/ref/man1/gfreg.1.docbook0000644000000000000000000001634011507222720020304 0ustar rootroot 5 Apr 2006 gfreg 1 Gfarm gfreg register a Gfarm file, Gfarm file fragments, or a Gfarm directory gfreg -p -h filesystem-node -H hostfile -D domainname -a architecture program ... gfarm-URL gfreg -i -h filesystem-node -H hostfile -D domainname localfile ... gfarm-URL gfreg -N total-num-of-fragments -I fragment-index -h filesystem-node -H hostfile -D domainname localfile ... gfarm-URL gfreg -r -h filesystem-node -H hostfile -D domainname -a architecture directory program localfile ... gfarm-URL DESCRIPTION The first form copies and registers the program as a Gfarm file gfarm-URL in the Gfarm filesystem. When gfarm-URL is a directory, multiple programs can be specified. After the registration, the gfarm-URL can be specified as a program name of gfrun(1) and gfmpirun_p4(1). Without the option, only executable file can be specified. With the option, non-executable file can be specified as well. Without the option or the option, architecture of the program is assumed to be the same architecture as the client host on that gfreg(1) is executed, which is obtained by the Gfarm metaserver. The second form registers one or more localfiles as a single Gfarm file. Without the option, only non-executable file can be specified as localfile. With the option, both excutable and non-executable file can be specified as localfile. The destination filesystem node will be automatically selected by CPU load average. With any one of , , options, filesystem node can be limited. The third form registers localfile as a file fragment of a Gfarm file. The total number of fragments and the fragment index are specified by the option and the option, respectively. When gfarm-URL is a directory, multiple localfiles can be specified. The destination filesystemnode will be automatically decided by CPU load average unless any one of , , options is explicitly specified. When the gfreg command of this form is executed on a filesystem node, the local filesystem node is always selected rather than a remote filesystemnode. In this case, , , options help to store files dispersively. The fourth form registers the directory as a Gfarm directory gfarm-URL, the program or the localfile as a Gfarm file gfarm-URL. If directory have some sub directories and/or files, they will be registered recursively. The non-executable file localfile will be registered as a file has one fragment. A non-executable file in the directory will be registered in the same way. When gfarm-URL already exists as a directory, multiple directories, programs, and localfiles can be specified and they will be registered in gfarm-URL. They can be mixed in parameteres, while other forms inhibit this manner. If gfarm-URL does not exist, one directory or one program, or one localfile can be specified and it will be registered as gfarm-URL. Refer to the first form's part above to specify filesystem node thatprogfarms and files will reside with the option or the option. OPTIONS overwrites gfarm-URL even if it exits as a Gfarm file. displays a list of command options. gfarm-2.4.1/doc/docbook/en/ref/man1/gfusage.1.docbook0000644000000000000000000000213611507222720020631 0ustar rootroot 12 Nov 2006 gfusage 1 Gfarm gfusage display Gfarm filesystem space usage gfusage -c DESCRIPTION gfusage displays Gfarm filesystem space usage for each user. OPTIONS Calculates total size, taking replicas into account. SEE ALSO gfdf1 gfarm-2.4.1/doc/docbook/en/ref/man1/gfront.1.docbook0000644000000000000000000000262611507222720020513 0ustar rootroot 19 Aug 2003 gfront 1 Gfarm gfront Gfarm filesystem browser gfront DESCRIPTION GFront is a graphical user interface for a Gfarm filesystem. It provides functionalities for browsing a directory tree, and manupulating Gfarm files and directories. GFront internally executes Gfarm client commands. It is necessary that Gfarm client commands are successfully installed, and the Gfarm configuration file is properly set up. SEE ALSO gfexport1 , gfhost1 , gfrm1 , gfreg1 gfarm-2.4.1/doc/docbook/en/ref/man1/gfwhoami.1.docbook0000644000000000000000000000217611507222720021015 0ustar rootroot 12 Nov 2006 gfwhoami 1 Gfarm gfwhoami print user name on the Gfarm filesystem gfwhoami options DESCRIPTION gfwhoami prints a global user name on the Gfarm filesystem. OPTIONS Prints the Subject DN of the user for GSI authentication. Displays a list of command options. gfarm-2.4.1/doc/docbook/en/ref/man1/gfwc.1.docbook0000644000000000000000000000200111507222720020125 0ustar rootroot 1 May 2002 gfwc 1 Gfarm gfwc print the number of bytes, words, and lines in Gfarm files gfmpirun_p4 gfarm:gfwc input-gfarm-URL DESCRIPTION This is a sample application invoked with gfmpirun_p4(1). gfwc reads from input-gfarm-URL and prints the numbers of bytes, words, and lines to the standard output. gfarm-2.4.1/doc/docbook/en/ref/man1/gfsched.1.docbook0000644000000000000000000001506011507222720020613 0ustar rootroot 28 Dec 2010 gfsched 1 Gfarm gfsched schedule and display available file system nodes gfsched -f gfarm-URL -D domain-name -n number -LMclw gfsched -P gfarm-URL -D domain-name -n number -LMlw DESCRIPTION The gfsched command with the gfarm-URL option displays available file system nodes which have a file replica of the specified gfarm-URL. When the gfarm-URL option is not specified, the gfsched command just displays available file system nodes. In this case, you can specify a metadata server by the gfarm-URL option, if necessary. OPTIONS domain-name Limits file system node by specifying a domain name or a hostname. Displays scheduling information for a file creation, if the file specified by doesn't exist. Currently, this option creates the specified file. But please note that this behavior may be changed in future. Suppresses authentication check. Without this option, the scheduler checks whether the user will be successfully authenticated with the hosts or not. This option omits the check to make scheduling faster, but that creates a risk that hosts which fail authentication with the user may be scheduled. Suppresses client-side scheduling and only performs metadata-server-side scheduling. This option makes scheduling faster, but also creates a risk that hosts which is network-unreachable or fails authentication with the user may be scheduled. gfarm-URL Specifies a gfarm-URL or a pathname to identify a metadata server which is used for the scheduling. This option conflicts with the option. gfarm-URL The gfsched command schedules file system nodes which have a replica of a file specified by this option. This option conflicts with the option. Long format. This option displays port numbers as well as hostnames. Note that the display format of this option may be changed in future. number Displays specified number of file system nodes at most. If this option is not specified, it displays all available nodes. Schedules with write-mode. When this option is specified, file system nodes which don't have enough free space won't be displayed. When both this option and the are specified, and if the file is already opened by an existing process with write-mode, the gfsched command only displays one file system node which is assigned for writing to the file. Displays a list of command options. EXAMPLES The following is an example to inquire file system nodes that the metadata server thinks they are currently working. $ gfsched -M gfarm-2.4.1/doc/docbook/en/ref/man1/gfimport_fixed.1.docbook0000644000000000000000000001027511507222720022221 0ustar rootroot 5 Jun 2003 gfimport_fixed 1 Gfarm gfimport_fixed divide and register a fixed-size data file gfimport_fixed options file DESCRIPTION gfimport_fixed is a sample program for dividing a file to file fragments and registering it to the Gfarm filesystem. OPTIONS hostfile specifies a hostname list of filesystem nodes. The hostfile consists of a hostname of a filesystem node in each line. The file is uniformly divided into file fragments, each file fragment except the last one having the same size. if ``-'' is specified, standard input is used to read the host list. fragment file specifies a fragment file that consists of a fragment size and a filesystem node separated by a white space in each line. if ``-'' is specified, standard input is used. record size specifies the size of fixed-size records in bytes. With this option, file is divided by the multiple size of the record size. Default size is 1. gfarm-URL specifies an output file. displays a list of command options. EXAMPLES Importing by splitting to specified number of fragments The following is an example using gfimport_fixed to import a source_file as gfarm:file by splitting to 8 fragments. gfsched -N 8 | gfimport_fixed -H - -o gfarm:file source_file Importing by splitting to specified number of fragments for particular program The following is an example using gfimport_fixed to import a source_file as gfarm:file by splitting to 8 fragments to be processed by gfarm:prog program. gfsched -N 8 -p gfarm:prog | gfimport_fixed -H - -o gfarm:file source_file Importing into same disposition with an existing gfarm file The following is an example using gfimport_fixed to import a source_file as gfarm:file into same disposition with existing file gfarm:template. gfsched gfarm:template | gfimport_fixed -H - -o gfarm:file source_file SEE ALSO gfimport_text1 , gfsched1 , gfarm.conf5 gfarm-2.4.1/doc/docbook/en/ref/man1/gfrm.1.docbook0000644000000000000000000001176211507222720020150 0ustar rootroot 12 Nov 2006 gfrm 1 Gfarm gfrm remove Gfarm files, directories, or file replicas gfrm -frRnqv -I file-section -h filesystem-node -D domain-name -H hostfile -N num-of-replicas -j num-of-threads gfarm-URL DESCRIPTION gfrm removes each specified file. It does not remove directories unless the or option is specified. '.' or '..' cannot be removed. When the option is specified, gfrm removes the specified file section. File section is an architecture name for executable files, or a fragment index for a regular file. With the , , or option, gfrm removes file replicas of each specified file or file section on the specified filesystem node(s). All file replicas of a file cannot be removed, unless the option is specified. OPTIONS Even when all file replicas are specified by the , , or option, forcibly deletes all the file replica. In this case, the specified file will be deleted. num-of-threads Specifies the number of threads to delete file replicas simultaneously. This option is only available when gfrm is compiled by an OpenMP C compiler. Prints file names to be deleted, but does not delete them. Does not print any verbose message. , Removes all entries under the directories specified by the command-line argument recursively. Prints verbose messages. filesystem-node Specifies a filesystem node from which file replicas will be removed. With the option, a file replica of the specified file section will be removed. domain-name Specifies a domain name of filesystem nodes on which file replicas will be removed. With the option, a file replica of the specified file section will be removed. hostfile Specifies a hostfile that lists filesystem nodes on which file replicas will be removed. With the option, a file replica of the specified file section will be removed. if ``-'' is specified, standard input is used to read the host list. file-section Specifies the file section to be removed. File section is an architecture name, such as sparc-sun-solaris8, for executable files, and a fragment index for regular files. num-of-replicas Specifies the maximum number of file replicas. If files has more number of file replicas than specified, reduce the number of file replicas. Displays a list of command options. gfarm-2.4.1/doc/docbook/en/ref/man1/gfhost.1.docbook0000644000000000000000000004166211507222720020511 0ustar rootroot 20 Jan 2010 gfhost 1 Gfarm gfhost Gfarm host maintenance command gfhost -H -l -M -iLprUv -P path -a architecture -D domain-name -j concurrency hostname gfhost -c -P path -a architecture -p port-number -n number-of-CPUs hostname host-alias gfhost -m -P path -a architecture -p port-number -n number-of-CPUs -A hostname host-alias gfhost -d -P path hostname gfhost -R -P path DESCRIPTION gfhost is used to display and maintain information about filesystem nodes. The function that gfhost performs is determined by an option, -c, -d, -H, -l, -M, -m, -R. These functions are mutually exclusive, and only one option among them can be specified. If none of them is specified, host name will be displayed as the default function of gfhost. FUNCTIONS Metadata in the metadata server will be accessed by function -c, -d, -M, -m or -R. These functions add/delete/display/modify/restore host information in the metadata. If -H, -l or -M is specified, or none of the functions are specified, gfhost displays filesystem node information. The -M function only accesses information in the metadata server. Display functions other than -M also access gfsd, which is running on filesystem nodes. For functions which access gfhost, the access option can be specified by options -i, -j, -U and -v. You don't have to specify hostnames for display functions. In that case, all hosts which are registered in metadata will be displayed, but you can limit the type of hosts displayed by the -a or -D option. By default, hosts are displayed in alphabetical order, but you can change this by the -L, -p, or -r options. Although the -L option is ignored in the -M function and in the default function. . The following is a list of the functions of the gfhost command. You shouldn't specify more than one functions at a time. <none> If you don't specify any of the functions, gfhost accesses gfsd, and displays the names of hosts which are currently available as its default function. Hostnames are displayed in alphabetical order, by default. Creates the metadata information for the host that is specified in the argument. Option -a is mandatory for this function, this option specifies the architecture of the host. Option -p is mandatory in this function too, this option specifies the port number of gfsd on the host. Option -n may be used to specify the number of CPUs of the host, and 1 CPU is assumed, if -n is omitted. You can specifiy multiple hostnames in this function. In that case, the first hostname is treated as the identifier of the host, and the host identifier is used for replication information management. The rest of the hostnames are used as aliases of the host. If a host has multiple network interfaces, and each interface has a unique hostname, all of the hostnames must be registered as either host identifiers or host aliases. If /etc/hosts or the NIS hosts database doesn't contain a DNS domain name part in its hostnames (i.e. these hostnames are not Fully Qualified Domain Names), you must register a host alias. In that case, you must register FQDN (a hostname which contain a domain name part) as the host identifier, and register names without the domain part as the host alias. Deletes host information from metadata. Currently, even hosts which are referred by replica catalog can be deleted. But be careful, because such deletions cause inconsistencies of metadata. Only a host identifier can be used as a hostname in this function. Displays load average and authentication method. With this function, the exact hostname passed by the gfhost command arguments will be displayed instead of the canonical host identifier. Also, this function displays the IP address used to access gfsd in parentheses just after the hostname. If the host cannot be accessed due to a machine down or network problem, etc., x.xx/x.xx/x.xx will be displayed in the load average field. If the host is up, but gfsd on the host cannot be accessed, -.--/-.--/-.-- will be displayed. The next field is the authentication method used with the host. `G' in this field means GSI authentication and encryption, `g' means only authentication is performed by GSI and actual communication is unprotected plain data (gsi_auth), `s' means gfarm sharedsecret authentication, `x' means that the authentication failed, and `-' means that the authentication wasn't actually tried. If the -U option is specified, this authentication method field won't be provided. Hostnames are displayed in alphabetical order, by default. Displays in the long format. This function displays both information retrieved from gfsd and the metadata server. The types of information retrieved from gfsd are load average and authentication method. And the types of information retrieved from the metadata server are architecture name, number of CPUs, host identifier, and host aliases (if any). IP address will be displayed in parentheses just after the hostname used for the access to gfsd. If the host cannot be accessed due to a machine down or network problem, etc., x.xx/x.xx/x.xx will be displayed in the load average field. If the host is up, but gfsd on the host cannot be accessed , -.--/-.--/-.-- will be displayed. The next field is the authentication method used with the host. `G' in this field means GSI authentication and encryption, `g' means only authentication is performed by GSI and actual communication is unprotected plain data (gsi_auth), `s' means gfarm sharedsecret authentication, `x' means that the authentication failed, and `-' means that the authentication wasn't actually tried. If that -U option is specified, this authentication method field won't be provided. Hostnames are displayed in alphabetical order, by default. The metadata information of the hosts will be displayed. Hostnames are displayed in alphabetical order, by default. Modifies metadata information of the host, by specifying the host identifier. The -a and -n options overwrite the current value of each option. By contrast, host aliases will be added in this function by default. If you want to replace or delete host aliases, please specify the -A option with this function. In that case, all host aliases will be replaced by specified aliases (if any). Restores metadata information read from standard input. The format of the metadata is same as the format that the -M function displays. Prints usage. OPTIONS Alter. This option is used with the -m function to replace, rather than add, host aliases. architecture This option specifies the CPU architecture using a format like sparc-sun-solaris8 or i386-redhat8.0-linux, etc. If this option is used with the -c or -m function, this means the architecture used to add/modify the metadata information. If this option is used with -H, -l, -M function or default function, this limits hosts to the specified architecture. domain-name This option is used with the -H, -l, -M function or the default function to limit hosts to the specified domain. There is an "address_use" directive in %%SYSCONFDIR%%/gfarm2.conf and $HOME/.gfarm2rc to give priorities of network addresses for gfarm access. This directive works with the gfhost command, but will be ignored, if you specified the -i option with gfhost. concurrency This option specifies the concurrency used for access to gfsd. The default value is 10. Sorts by load average order. This option is effective only with the -H and -l functions. number-of-CPUs This option is used with the -c or -m function, and specifies the number of CPUs of the host. port-number This option is used with -c or -m function, and specifies the port number of gfsd on the host. path This option specifies a pathname or a Gfarm URL to identify a metadata server which will be accessed by this command. If not specified, "/" is used as the default value. Reverses the order of sort. Plain order. This option stops sorting on the -H, -l, -M function or the default function. With the -M function, command argument order (if any), or the order that the metadata server answers is used for display. With the -H, -l function or the default function, the result is displayed in the order that each gfsd answers. Suppresses authentication attempts by TCP, and only queries load average by UDP. This option only makes sense if you specified the -H or -l function, or if you didn't specify any function. This option makes the gfhost command run faster. If the -H or -l function is specified, this option makes the authentication method field disappear. The -H, -l function and the default function don't produce error reports on gfsd accesses; these error reports will be produced by this option. SEE ALSO gfarm2.conf5 , gfsd8 gfarm-2.4.1/doc/docbook/en/ref/man1/gfmkdir.1.docbook0000644000000000000000000000267611507222720020644 0ustar rootroot 15 May 2008 gfmkdir 1 Gfarm gfmkdir make Gfarm directories gfmkdir options path DESCRIPTION gfmkdir makes directories specified in the arguments. The arguments must be a pathname in Gfarm file system. OPTIONS Even if the specified directory exists, do not return error. Create parent directories if needed. displays a list of command options. SEE ALSO gfrmdir1 gfarm-2.4.1/doc/docbook/en/ref/man1/gfexport.1.docbook0000644000000000000000000000412311507222720021044 0ustar rootroot 1 May 2002 gfexport 1 Gfarm gfexport print on the standard output gfexport -H hostfile -I fragment-index gfarm-URL DESCRIPTION gfexport outputs a Gfarm file specified by gfarm-URL to the standard output. OPTIONS hostfile specifies a list of filesystem nodes explicitly to be accessed. hostfile contains of a hostname that stores the corresponding file fragment in each line. When the -H option is specified, the -I option cannot be specified. if ``-'' is specified, the standard input is used to read the host list. fragment-index outputs the only specified fragment index. If the gfarm-URL is an executable file, an architecture name, for example, sparc-sun-solaris8, can be used to specify the executable architecture. When the -I option is specified, the -H option cannot be specified. displays a list of command options. gfarm-2.4.1/doc/docbook/en/ref/man1/gfstatus.1.docbook0000644000000000000000000000127211507222720021050 0ustar rootroot 19 Dec 2008 gfstatus 1 Gfarm gfstatus display Gfarm configuration status gfstatus DESCRIPTION gfstatus displays information about the Gfarm file system. gfarm-2.4.1/doc/docbook/en/ref/man1/gfexec.1.docbook0000644000000000000000000000361011507222720020447 0ustar rootroot 12 Nov 2006 gfexec 1 Gfarm gfexec execute other commands in the Gfarm filesystem gfexec -N number-of-nodes -I node-index -s command args DESCRIPTION gfexec executes the specified command in Gfarm filesystem. gfexec has to be executed on a filesystem node. OPTIONS number-of-nodes Changes the number of nodes for the invoked program to the argument. node-index Changes the index of the node for the invoked program to the argument. This option is equivalent to the `` 1 0'' option. Prints usage. gfarm-2.4.1/doc/docbook/en/ref/man1/gfls.1.docbook0000644000000000000000000000702311507222720020143 0ustar rootroot 27 Apr 2007 gfls 1 Gfarm gfls list contents of Gfarm directory gfls options path DESCRIPTION List information of files or contents of directories specified by path. OPTIONS Do not hide entries starting with ``.''. Do not list ``.'' and ``..''. Multi-column output. This is the default output format. List directory entries instead of the contents. seconds Specifies seconds to hold attribute cache. If 0 is specified, attributes won't be cached. Append indicator (one of */=@|) to entries. Display inode number. List in long format, including mode, owner, group, size in bytes, time of last modification for each file. Reverse the order while sorting. Recursively lists subdirectories encountered. Sort by file size. Sort by time stamp instead of by name. With the option, show complete date format. Prints one entry per line of output. displays a list of command options. gfarm-2.4.1/doc/docbook/en/ref/man1/gfgrep.1.docbook0000644000000000000000000000462111507222720020463 0ustar rootroot 1 May 2002 gfgrep 1 Gfarm gfgrep search a file for a pattern gfrun gfarm:gfgrep -o output-gfarm-URL pattern input-gfarm-URL gfrun gfarm:gfgrep -o output-gfarm-URL -e pattern input-gfarm-URL DESCRIPTION gfgrep is a sample program of parallel applications executed by gfrun(1) as well as an example to create a Gfarm file in the local file view. gfgrep searches a pattern from input-gfarm-URL, and outputs to output-gfarm-URL. Every parallel application executed by gfrun(1) should interpret the and options that show the rank and the size of the parallel program, respectively, and call gfs_pio_set_local(). OPTIONS pattern is useful to protect patterns beginning with -. gfarm-URL specifies an output Gfarm file. displays a list of command options. gfarm-2.4.1/doc/docbook/en/ref/man1/gfrep.1.docbook0000644000000000000000000001217111507222720020313 0ustar rootroot 31 May 2008 gfrep 1 Gfarm gfrep replicate Gfarm files gfrep -mnqvx -S source-domainname -D destination-domainname -h source-hostfile -H destination-hostfile -N num-of-replicas -j num-of-threads path DESCRIPTION gfrep creates specified number of replicas of Gfarm files specified by the path to specified set of destination hosts. When set of source hosts are specified, only files stored on the set of source hosts are replicated. A set of hosts can be specified by a domain name and/or a host file. When both a domain name and a host file are specified, a set of hosts is determined by both conditions. If the path parameter is a directory, files under the directory will be copied recursively. OPTIONS source-domainname Specifies the domain name of source filesystem nodes from which replicas will be copied. destination-domainname Specifies the domain name of destination filesystem nodes to which replicas will be copied. If neither this nor the option is specified, replicas may be copied to any available host. source-hostfile Specifies a file which describes hostnames of source filesystem nodes from which the replica will be made. The source-hostfile consists of a filesystem node name on each line. if ``-'' is specified, standard input is used to read the host list. destination-hostfile Specifies a file which describes hostnames of destination filesystem nodes on which the replica will be made. The destination-hostfile consists of a filesystem node name on each line. if ``-'' is specified, standard input is used to read the host list. num-of-replicas Specifies the required number of file replicas, counting already existing ones. If there are a sufficient number of replicas in the destination hosts, neither any copying nor any removal will be done. If this option is not specified, is assumed. num-of-threads Specifies the number of threads to create file replicas simultaneously. This option is only available when compiled by an OpenMP C compiler. By default, it will be the smallest among the number of total files, the number of source hosts, and the number of destination hosts. Lets gfrep command do a migrate/move, instead of doing replication. Removes file replicas when a set of destination nodes has more file replicas than specified. Displays files to be replicated, but does nothing. Suppresses non-error messages. Displays verbose output. Displays a list of command options. BUGS A source host is not always selected within a set of source hosts. gfarm-2.4.1/doc/docbook/en/ref/man1/gfgroup.1.docbook0000644000000000000000000000634111507222720020663 0ustar rootroot 20 Jan 2010 gfgroup 1 Gfarm gfgroup Gfarm group maintenance command gfgroup -P path -l group gfgroup -P path -c groupname user gfgroup -P path -m groupname user gfgroup -P path -d groupname DESCRIPTION gfgroup manages Gfarm groups in Gfarm file system. Default action displays all registered groups. When group names are specified, specified groups are displayed. Gfarm administrator can creates, modifies, and deletes a Gfarm group by -c, -m, and -d options, respectively. OPTIONS path This option specifies a pathname or a Gfarm URL to identify a metadata server which will be accessed by this command. If not specified, "/" is used as the default value. Displays group names and the group members. Creates a group in Gfarm file system by specifying a group name and initial group members. This option can be used by Gfarm administrators. Replaces group members of the group with new group members. This option can be used by Gfarm administrators. Deletes a group. This option can be used by Gfarm administrators. Displays a list of command options. SEE ALSO gfuser1 gfarm-2.4.1/doc/docbook/en/ref/man1/gfln.1.docbook0000644000000000000000000000240211507222720020132 0ustar rootroot 19 Mar 2009 gfln 1 Gfarm gfln create a hardlink or a symbolic link gfln options target link_name DESCRIPTION gfln creates a hardlink link_name linked to target. When the -s option is specified, it creates a symbolic link. OPTIONS Creates a symbolic link. Displays a list of command options. gfarm-2.4.1/doc/docbook/en/ref/man1/gfcd.1.docbook0000644000000000000000000000316511507222720020116 0ustar rootroot 2 Jul 2003 gfcd 1 Gfarm gfcd change Gfarm working directory gfcd directory DESCRIPTION gfcd changes Gfarm working directory to the directory specified in the argument. If no argument is specified, working directory is changed to the user's home directory that is gfarm:/global_user_name. To use this command, please add the following setting to the shell rc file of each user. for shells derived from Bourne shell gfcd() { eval "`gfsetdir $1`"; } for csh or tcsh alias gfcd 'eval `gfsetdir \!*`' SEE ALSO gfpwd1 , gfsetdir1 gfarm-2.4.1/doc/docbook/en/ref/man1/gfwhere.1.docbook0000644000000000000000000000247011507222720020640 0ustar rootroot 12 Mov 2006 gfwhere 1 Gfarm gfwhere print replica locations gfwhere -r, -R path DESCRIPTION gfwhere prints replica locations of specified files. When -r or -R option is specified, prints replica locations of subentries in specified directories recursively. OPTIONS Displays subdirectories recursively. Displays a list of command options. gfarm-2.4.1/doc/docbook/en/ref/man1/gfuser.1.docbook0000644000000000000000000000677411507222720020517 0ustar rootroot 20 Jan 2010 gfuser 1 Gfarm gfuser Gfarm user maintenance command gfuser -P path -l user gfuser -P path -c username realname homedir gsi_dn gfuser -P path -m username realname homedir gsi_dn gfuser -P path -d username DESCRIPTION gfuser manages Gfarm global users in Gfarm file system. Default action displays all registered users. When user names are specified, specified users are displayed. Gfarm administrator can creates, modifies, and deletes a Gfarm user by -c, -m, and -d options, respectively. OPTIONS path This option specifies a pathname or a Gfarm URL to identify a metadata server which will be accessed by this command. If not specified, "/" is used as the default value. Displays verbose information of registered users. Creates a user by specifying a global username in Gfarm file system, a real username, a home directory in Gfarm, and a Subject DN used in GSI. When the real username or the Subject DN includes spaces, it is needed to be quoted. This option can be used by Gfarm administrators. Replaces a user information of the specified global user with specified real name, home directory and Subject DN. This option can be used by Gfarm administrators. Deletes a registered user. This option can be used by Gfarm administrators. Displays a list of command options. SEE ALSO gfgroup1 gfarm-2.4.1/doc/docbook/en/ref/man1/gfchown.1.docbook0000644000000000000000000000246111507222720020644 0ustar rootroot 21 Dec 2008 gfchown 1 Gfarm gfchown change Gfarm file owner and group gfchown options owner[:group] path gfchown options :group path DESCRIPTION gfchown changes an owner and a group of Gfarm files. OPTIONS Displays a list of command options. gfarm-2.4.1/doc/docbook/en/ref/man1/gfimport_text.1.docbook0000644000000000000000000000753611507222720022114 0ustar rootroot 5 Jun 2003 gfimport_text 1 Gfarm gfimport_text divide and register a text file gfimport_text options file DESCRIPTION gfimport_text is a sample program for dividing a text file to file fragments by the line and registering it to the Gfarm filesystem. OPTIONS hostfile specifies a list of filesystem nodes. The hostfile consists of a hostname of a filesystem node in each line. The file is almost uniformly divided into file fragments. if ``-'' is specified, standard input is used to read the host list. fragment-file specifies a fragment-file that consists of a fragment size in byte and a filesystem node separated by a white space in each line. if ``-'' is specified, standard input is used. gfarm-URL specifies an output file. displays a list of command options. EXAMPLES Importing by splitting to specified number of fragments The following is an example using gfimport_text to import a source_file as gfarm:file by splitting to 8 fragments. gfsched -N 8 | gfimport_text -H - -o gfarm:file source_file Importing by splitting to specified number of fragments for particular program The following is an example using gfimport_text to import a source_file as gfarm:file by splitting to 8 fragments to be processed by gfarm:prog program. gfsched -N 8 -p gfarm:prog | gfimport_text -H - -o gfarm:file source_file Importing into same disposition with an existing gfarm file The following is an example using gfimport_text to import a source_file as gfarm:file into same disposition with existing file gfarm:template. gfsched gfarm:template | gfimport_text -H - -o gfarm:file source_file SEE ALSO gfimport_fixed1 , gfsched1 , gfarm.conf5 gfarm-2.4.1/doc/docbook/en/ref/man1/gfmpirun_p4.1.docbook0000644000000000000000000000533711507222720021450 0ustar rootroot 1 May 2002 gfmpirun_p4 1 Gfarm gfmpirun_p4 run Gfarm parallel programs with mpirun gfmpirun_p4 options command args DESCRIPTION gfmpirun_p4 executes a parallel command on filesystem nodes with mpirun provided by MPICH/p4, which is determined by the option, the option, or the option. , , and options are exclusive. When none of , , and options are not specified, gfmpirun_p4 schedules filesystem nodes by the file-affinity scheduling using the first existent Gfarm file in the argument list args. Command can be specified by a gfarm-URL that is registered using gfreg(1). OPTIONS gfarm-URL specifies a Gfarm file gfarm-URL for file-affinity scheduling. hostfile specifies a hostfile that lists filesystem nodes. if ``-'' is specified, standard input is used to read the host list. np specifies the number of nodes np, which are selected by the increasing order of load average. BUGS gfmpirun_p4 can only work with the MPICH/p4. SEE ALSO gfrun1 gfarm-2.4.1/doc/docbook/en/ref/man1/gfsetdir.1.docbook0000644000000000000000000000462011507222720021017 0ustar rootroot 2 Jul 2003 gfsetdir 1 Gfarm gfsetdir helper command for gfcd gfsetdir -s -c directory DESCRIPTION gfsetdir prints shell commands which change Gfarm working directory to the directory specified in the argument. If no argument is specified, it prints commands which change the working directory to the user's home directory that is gfarm:/global_user_name. This command automatically detects user's shell type, and prints appropriate commands for the shell. Please add the following definition to the shell rc file of each user, to define gfcd command. for shells derived from Bourne shell gfcd() { eval "`gfsetdir $1`"; } for csh or tcsh alias gfcd 'eval `gfsetdir \!*`' OPTIONS generates Bourne shell commands. generates C-shell commands. displays a list of command options. SEE ALSO gfcd1 , gfpwd1 gfarm-2.4.1/doc/docbook/en/ref/man1/gfdf.1.docbook0000644000000000000000000000547411507222720020126 0ustar rootroot 30 Dec 2010 gfdf 1 Gfarm gfdf display disk free space of Gfarm file system gfdf options DESCRIPTION gfdf displays disk usage and free space of Gfarm file system. OPTIONS Displays only summary information of the Gfarm file system. Displays numbers in human readable format by adding a prefix multiplier symbol like "M" (mega). Since this option uses powers of 1024, "M" means 1,048,576. Displays numbers in human readable format by adding a prefix multiplier symbol like "M" (mega). Since this option uses powers of 1000, "M" means 1,000,000. Displays hostnames of available Gfarm file system nodes. Sort output in the reverse order. Sort output in the increasing order of the available disk capacity. path Specifies a path name to specify a metadata server instead of the root metadata server. Note that this option is not effective with the -a option. domainname Specifies a domain name of filesystem nodes to list the status of disk free space. Displays a list of command options. SEE ALSO gfhost1 , gfarm2.conf5 gfarm-2.4.1/doc/docbook/en/ref/man1/gfrmdir.1.docbook0000644000000000000000000000220611507222720020640 0ustar rootroot 15 May 2008 gfrmdir 1 Gfarm gfrmdir remove Gfarm directories gfrmdir path DESCRIPTION gfrmdir removes directories specified in the arguments. OPTIONS displays a list of command options. SEE ALSO gfmkdir1 gfarm-2.4.1/doc/docbook/en/ref/man1/gfrun.1.docbook0000644000000000000000000001473111507222720020335 0ustar rootroot 12 Nov 2006 gfrun 1 Gfarm gfrun gfrsh gfssh run Gfarm parallel programs gfrun options command arg gfrsh options command arg gfssh options command arg DESCRIPTION gfrun executes a parallel command on filesystem nodes, which is determined by the option, the option, or the option. The option specifies the gfarm-URL, which will be used by file-affinity scheduling. In this case, gfrun schedules the same number of filesystem nodes as the number of Gfarm fragments, taking into consideration the physical locations of each fragment replica of the Gfarm file, and filesystem node status. The option specifies the hostfile that lists filesystem nodes. The option specifies the number of filesystem nodes. The , , and options are exclusive. When none of the , , or options are specified, gfrun schedules filesystem nodes by file-affinity scheduling using the first existent Gfarm file in the argument list, args. If there are no existent Gfarm files in the argument list, an appropriate filesystem node is selected to be executed. gfrsh and gfssh utilize rsh and ssh, respectively, instead of gfrcmd. A command can be specified by a gfarm-URL that is registered using gfreg(1). OPTIONS gfarm-URL Specifies a Gfarm file gfarm-URL for file-affinity scheduling. Please read the DESCRIPTION section about how file-affinity scheduling works. hostfile Specifies a hostfile that lists filesystem nodes. if ``-'' is specified, standard input is used to read the host list. np Specifies the number of nodes, np, which are selected in the increasing order of load average. Specifies an on-demand replication mode. In this mode, every file will be replicated before it is accessed remotely. gfarm-URL Specifies a Gfarm file that the standard output of the executed program will be redirected to. gfarm-URL Specifies a Gfarm file that the standard error of the executed program will be redirected to. fragment-index Specifies a Gfarm fragment index executed by the gfrun command. This option is available only when either file-affinity scheduling is selected by the option or a gfarm file in the argument list, or the option is specified. Displays error message verbosely. Displays the elapsed time of each Gfarm parallel I/O API after the program terminates. Explicitly specifies that the command is a Gfarm program. Gfarm specific options will be passed to the command as the result. Explicitly specifies that the command is an ordinary program, and does not take Gfarm specific options. Specifies global file view as the default file view for programs linked with the Gfarm syscall-hooking library. If this option is not specified, the default is local file view. Displays a list of command options. ENVIRONMENT VARIABLES GFRUN_CMD Specifies a remote shell command. If globus-job-run is specified, gfrun executes each process using globus-job-run. SEE ALSO gfmpirun_p41 gfarm-2.4.1/doc/docbook/en/ref/man1/gfmv.1.docbook0000644000000000000000000000206311507222720020146 0ustar rootroot 21 Dec 2008 gfmv 1 Gfarm gfmv move (rename) Gfarm file gfmv options src dest DESCRIPTION gfmv moves or renames a Gfarm file from src to dest. OPTIONS Displays a list of command options. gfarm-2.4.1/doc/docbook/en/ref/man1/gfarm_agent.1.docbook0000644000000000000000000000740411507222720021465 0ustar rootroot 10 Nov 2006 gfarm_agent 1 Gfarm gfarm_agent Gfarm Filesystem Metadata Cache Server gfarm_agent options DESCRIPTION gfarm_agent is a cache server for a Gfarm metadata server that can be shared by multiple hosts and multiple users. The cache server greatly improves performance and response time for a Gfarm filesystem by reducing network communication to a distant metadata server. Any number of gfarm_agents can be running on different nodes (or even on the same node) at the same time. Consistency among multiple cache servers and a metadata server is maintained. OPTIONS log-level Specifies a log priority level. The log output, which priority is higher or equal to this level, will be sent to syslog or standard error. Please refer gfarm.conf(5) for the priority levels which can be specified by this option. pid-file Specifies a file name which records the process ID of gfarm_agent. syslog-facility Specifies a syslog facility used to report errors by gfarm_agent. By default, local0 is used. Specifies the debug mode. gfarm_agent runs in the foreground, not in the background. If this option is specified and is not specified, the log level is set to "debug". config-file Specifies a configuration file that is read instead of the default configuration file. Specifies the master mode. This improves metadata access performance by caching the path information. This option is only available when there is a single gfarm_agent running. port-number Specifies a port number for TCP, to be used by gfarm_agent. Displays verbose error messages in authentication. Displays a list of command options. FILES %%SYSCONFDIR%%/gfarm.conf configuration file SEE ALSO gfarm.conf5 gfarm-2.4.1/doc/docbook/en/ref/man1/gfkey.1.docbook0000644000000000000000000000600711507222720020316 0ustar rootroot 25 Feb 2010 gfkey 1 Gfarm gfkey management of Gfarm session keys gfkey options DESCRIPTION gfkey manages the session key file, $HOME/.gfarm_shared_key, that is used for user authentication by a shared secret key in a trusted environment when connecting to gfsd and/or gfmd. When the home directory is shared among filesystem nodes, it is not necessary to use this command. If not, it is necessary to distribute a session key created with the -c or -f option to every filesystem node, in advance. OPTIONS Creates a new session key when there is no valid session key. If a valid session key already exists, no operation is performed. Forces the creation of a new session key, even if a valid session key already exists. period Specifies the term of validity in seconds. This option has to be used with the -c or -f option. Displays the current key. Displays the expiration date of the current key. message-priority-level Specifies a level of the log priority. The log messages that have higher or the same priority than the specified priority are displayed to the standard error. The default priority is info. Refer to the log_level directive described in the manual page of gfarm2.conf(5) for the priority level which can be specified by this option. Displays a list of command options. FILES $HOME/.gfarm_shared_key a file for a session key gfarm-2.4.1/doc/docbook/en/ref/man1/gfps.1.docbook0000644000000000000000000000312411507222720020145 0ustar rootroot 12 Nov 2006 gfps 1 Gfarm gfps report process status gfps options jobID DESCRIPTION gfps prints information about processes specified by the arguments. If the argments are missing, it prints information about all processes that have the same effective user ID. OPTIONS Lists information about all jobs. Displays using the long format. Displays error messages verbosely. Displays a list of command options. gfarm-2.4.1/doc/docbook/en/ref/man1/gffindxmlattr.1.docbook0000644000000000000000000000530011507222720022055 0ustar rootroot 18 Aug 2008 gffindxmlattr 1 Gfarm gffindxmlattr Find XML extended attributes by XPath query gffindxmlattr -d depth -F delim XPath -f XPath-file path DESCRIPTION gffindxmlattr finds XML extended attributes by a specified XPath expression, and displays path names and the corresponding XML extended attribute names. When a file is specified, XML extended attributes associated to the file are searched if there is the read permission. When a directory is specified, files or directories within the depth are recursively searched. When 0 is specified for the depth, the specified directory is searched. If the depth is not specified, all files and directories under the specified directory are searched. If the negative value is specified, gffindxmlattr returns error. Directories that do not have execute permission cannot be searched. gffindxmlattr displays path names and the corresponding XML extended attribute separated by the delim. OPTIONS depth specifies the depth to be searched recursively. delim specifies a delimiter that separates the path name and the XML extended attribute name. By detault, the delimiter is TAB. XPath-file specifies a file that contains XPath expression. displays usage. SEE ALSO gfxattr1 gfarm-2.4.1/doc/docbook/en/ref/man1/gfrcmd.1.docbook0000644000000000000000000000746711507222720020466 0ustar rootroot 12 Nov 2006 gfrcmd 1 Gfarm gfrcmd Gfarm remote shell gfrcmd host command DESCRIPTION gfrcmd logs into a filesystem node host and executes commands on the filesystem node. It provides a similar functionality to rsh. The following is a list of differences, however. A remote server is not executed by inetd, but is incorporated with gfsd(8). The user is authenticated and authorized by the Gfarm security mechanism. Since this does not rely on privileged TCP ports for authentication like rsh, the maximum number of remote executions is not limited by the number of privileged ports. Unlike rsh, gfrcmd utilizes a single TCP connection to a filesystem node. It requires less kernel resources than rsh when several processes are executed. gfrcmd inherits the environment variable DISPLAY and the authentication information of the X Window System. On the filesystem node, the current working directory is not the home directory that is often shared using NFS, but a spool directory of the Gfarm filesystem, which makes it possible to leave core files on each filesystem node when debugging. It has functionality that invokes a debugger when a fatal signal occurs. OPTIONS username Specifies a username on a remote host. Redirects the standard input from the special device /dev/null. Executes a remote command directly without using a login shell. Inherits the environment variable, DISPLAY. Inherits the authentication information of the X Window System. It is useful in a situation where the home directory is not shared. Displays error message verbosely. Displays a list of command options. ENVIRONMENT VARIABLES GFARM_DEBUG_MODE Specifies the debugger command that is invoked when a remotely executed command aborts with a fatal signal. When gdb is specified, xterm and the GNU debugger gdb are executed. To utilize this functionality, it is necessary to invoke gfrcmd on the X Window System. BUGS The -l option is not implemented yet. gfarm-2.4.1/doc/docbook/en/ref/man1/gfxattr.1.docbook0000644000000000000000000001001111507222720020656 0ustar rootroot 18 Aug 2008 gfxattr 1 Gfarm gfxattr Manipulate extended attributes in Gfarm file system gfxattr -s -g -l -r -x -c -m -f xattrfile file xattrname DESCRIPTION gfxattr manipulates extended attributes and XML extended attributes of a specified file. An extended attribute consists of an attribute name and an attribute value, which are arbitrary strings. An XML extended attribute is an extended attribute having an XML attribute value. Since XML extended attributes have a different name space from extended attributes, the same attribute name can be used. When the -x option is specified, XML extended attributes are manipulated. It is possible to search XML extended attributes by XPath query using gffindxmlattr command. All files and directories in Gfarm file system can keep extended attributes. When removing a file or directory, the associated extended attributes are also removed. Either -s, -g, -l, or -r option should be specified. OPTIONS sets a new value with an extended attribute xattrname for a specified file. With the -f option, the value can be specified by the file xattrfile instead of by the standard input. When neither -c nor -m option is specified, the extended attribute is overwritten if it is already set. reads a value with an extended attribute xattrname for a specified file. display a list of extended attributes for a specified file. removes a extended attribute xattrname for a specified file. manipulates XML extended attributes. sets a new extended attribute if it is not set. This option is used with the -s option. modifies the extended attribute if there it is. This option is used with the -s option. xattrfile With the -s option, reads an extended attribute from the specified xattrfile instead of from the standard input. With the -g option, writes the extended attribute to the specified xattrfile instead of to the standard output. displays usage. SEE ALSO gffindxmlattr1 gfarm-2.4.1/doc/docbook/ja/0000755000000000000000000000000011507222730014066 5ustar rootrootgfarm-2.4.1/doc/docbook/ja/ref/0000755000000000000000000000000011507222730014642 5ustar rootrootgfarm-2.4.1/doc/docbook/ja/ref/man5/0000755000000000000000000000000011507222730015502 5ustar rootrootgfarm-2.4.1/doc/docbook/ja/ref/man5/Makefile.inc0000644000000000000000000000003311507222720017705 0ustar rootrootDOCBOOK = \ gfarm2.conf.5 gfarm-2.4.1/doc/docbook/ja/ref/man5/gfarm2.conf.5.docbook0000644000000000000000000013414211507222720021315 0ustar rootroot 12 Apr 2010 gfarm2.conf 5 Gfarm gfarm2.conf GfarmÀßÄê¥Õ¥¡¥¤¥ë DESCRIPTION gfarm2.conf¥Õ¥¡¥¤¥ë¤Ï¡¢gfarm¥×¥í¥°¥é¥à¤ÎÀßÄê¥Õ¥¡¥¤¥ë¤Ç¤¹¡£ ¥µ¡¼¥Ð¡¼¡¦¥×¥í¥»¥¹¤Ç¤¢¤ëgfsd¤Ï¡¢¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢ ¤³¤Î%%SYSCONFDIR%%/gfarm2.conf¤òÀßÄê¥Õ¥¡¥¤¥ë¤È¤·¤Æ»²¾È¤·¤Þ¤¹¡£ ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¡¼¡¦¥×¥í¥»¥¹¤Ç¤¢¤ëgfmd¤Ï¡¢%%SYSCONFDIR%%/gfmd.conf¤ò ÆÉ¤ß¹þ¤ß¤Þ¤¹¡£gfmd.conf¤Î·Á¼°¤Ï¡¢gfarm2.conf¤ÈƱ°ì¤Ç¤¹¡£ ¤Ê¤ª¡¢ÀßÄêÆâÍÆ¤¬ÆÉ¤ß¹þ¤Þ¤ì¤ë¤Î¤Ïµ¯Æ°»þ¤À¤±¤Ê¤Î¤Ç¡¢ ÀßÄêÆâÍÆ¤òÊѹ¹¤·¤¿¾ì¹ç¡¢¥µ¡¼¥Ð¡¼¤òºÆµ¯Æ°¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£ ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¥×¥í¥°¥é¥à¤Ï¡¢´Ä¶­ÊÑ¿ôGFARM_CONFIG_FILE¤Ç »ØÄꤷ¤¿¥Õ¥¡¥¤¥ë¤È¡¢%%SYSCONFDIR%%/gfarm2.conf¤ò¡¢ÀßÄê¥Õ¥¡¥¤¥ë ¤È¤·¤Æ»²¾È¤·¤Þ¤¹¡£¤³¤ÎÆó¤Ä¤Î¥Õ¥¡¥¤¥ë¤Ç¤Ï¡¢´Ä¶­ÊÑ¿ôGFARM_CONFIG_FILE¤Ç »ØÄꤷ¤¿¥Õ¥¡¥¤¥ë¤ÎÀßÄê¤ÎÊý¤¬Àè¤ËÆÉ¤ß¹þ¤Þ¤ì¤Þ¤¹¡£ ¤É¤Á¤é¤ÎÀßÄê¥Õ¥¡¥¤¥ë¤â¡¢Æ±°ì¤Îʸˡ¤Çµ­½Ò¤·¤Þ¤¹¡£ Ʊ°ì¤Î»ØÄêʸ¤¬Ê£¿ô¤¢¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢Àè¤Ë»ØÄꤵ¤ì¤Æ¤¤¤¿Êý¤¬Í¥À褵¤ì¤Þ¤¹¡£ ´Ä¶­ÊÑ¿ôGFARM_CONFIG_FILE¤¬ÀßÄꤵ¤ì¤Æ¤Ê¤¤¾ì¹ç¡¢Âå¤ï¤ê¤Ë ¥æ¡¼¥¶¡¼¤Î¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤¢¤ë.gfarm2rc¥Õ¥¡¥¤¥ë¤ò»ÈÍѤ·¤Þ¤¹¡£ gfarm2.conf¤Ï¡¢°ì¹Ô¤Ë°ìʸ¤Î·Á¼°¤ÇÀßÄꤷ¤Þ¤¹¡£ ¤¿¤À¤·¡¢¹ÔËö¤Ëʸ»ú``\''¤òµ­½Ò¤¹¤ë¤³¤È¤Ë¤è¤Ã¤Æ¡¢¹Ô¤ò·Ñ³¤µ¤»¤ë¤³¤È¤¬ ¤Ç¤­¤Þ¤¹¡£¤Þ¤¿¡¢Ê¸»ú``#''¤«¤é¹ÔËö¤Þ¤Ç¤Ï¡¢¥³¥á¥ó¥È¤È¤·¤Æ°·¤ï¤ì¡¢Ìµ»ë ¤µ¤ì¤Þ¤¹¡£ ¥Û¥¹¥È»ØÄê °ú¿ô¤È¤·¤Æ¡¢¥Û¥¹¥È»ØÄê¤òµ­½Ò¤Ç¤­¤ëʸ¤¬¤¤¤¯¤Ä¤«¤¢¤ê¤Þ¤¹¤¬¡¢ ¤³¤Î¾ì¹ç¡¢¥Û¥¹¥È»ØÄê¤Ë¤Ï¡¢²¼µ­¤Î¤¤¤º¤ì¤«¤òµ­½Ò¤Ç¤­¤Þ¤¹¡£ III.JJJ.KKK.LLL "."¤Ç¶èÀÚ¤é¤ì¤¿0¡Á255¤Þ¤Ç¤Î¿ô»ú4¤Ä¤Ç¡¢IP¥¢¥É¥ì¥¹¤ò»ØÄꤷ¤Þ¤¹¡£ III.JJJ.KKK.LLL/MM IP¥¢¥É¥ì¥¹¤È¡¢"/"¤Ç¶èÀÚ¤é¤ì¤¿0¡Á31¤Þ¤Ç¤Î¿ô»ú¤Ç¡¢¥Í¥Ã¥È¥ï¡¼¥¯¤ò »ØÄꤷ¤Þ¤¹¡£"/"°Ê¹ß¤Î¿ô»ú¤Ïnetmask¤Î¥Ó¥Ã¥ÈŤǤ¹¡£ domain.name ¥Û¥¹¥È̾¤ò¥É¥á¥¤¥ó̾¤Ç»ØÄꤷ¤Þ¤¹¡£ .domain.name ¥É¥á¥¤¥ó̾¤ÎÀèÆ¬¤¬"."¤Ç¤Ï¤¸¤Þ¤ë¾ì¹ç¡¢¤³¤Î¥É¥á¥¤¥ó̾¤Ë½ê°¤¹¤ëÁ´¤Æ¤Î ¥Û¥¹¥È¤ò°ÕÌ£¤·¤Þ¤¹¡£ * "*"¤Èµ­½Ò¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢Á´¤Æ¤Î¥Û¥¹¥È¤ò°ÕÌ£¤·¤Þ¤¹¡£ LISTENER Á´¤ÆÂçʸ»ú¤Ç"LISTENER"¤Èµ­½Ò¤¹¤ë¤È¡¢ÄÌ¿®¤¹¤ëÁê¼ê¤Ë´Ø·¸¤Ê¤¯¡¢ ¥µ¡¼¥Ð¡¼Â¦(Ãå¸ÆÂ¦)¤Î¥½¥±¥Ã¥È¤ò°ÕÌ£¤·¤Þ¤¹¡£ ʸ ʸ¤Ë¤Ï¡¢²¼µ­¤Î¼ïÎब¤¢¤ê¤Þ¤¹¡£ spool gfsd¥¹¥×¡¼¥ë¡¦¥Ç¥£¥ì¥¯¥È¥ê gfsd¤¬¡¢gfarm¥Õ¥¡¥¤¥ë¤Î¼ÂÂΤòÊÝ»ý¤¹¤ë¥Ç¥£¥ì¥¯¥È¥ê̾¤ò »ØÄꤷ¤Þ¤¹¡£ Îã: spool /var/spool/gfarm spool_server_listen_address IP¥¢¥É¥ì¥¹ gfsd¤¬TCP¤ª¤è¤ÓUDP¤ÎÍ×µá¤ò¼õ¤±ÉÕ¤±¤ëIP¥¢¥É¥ì¥¹¤ò»ØÄꤷ¤Þ¤¹¡£ ¾Êά»þ¤Ï¡¢¤½¤Î¥Û¥¹¥È¤ÎÁ´¤Æ¤ÎIP¥¢¥É¥ì¥¹¤Ç¼õ¤±ÉÕ¤±¤Þ¤¹¡£ ¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢°ì¤Ä¤Î¥Î¡¼¥É¤ÇÊ£¿ô¤Î¥¹¥×¡¼¥ë¤òÄ󶡤¹¤ë¾ì¹ç¤Ë¡¢ ¤½¤ì¤¾¤ì¤Î¥¹¥×¡¼¥ë¤´¤È¤Ë¡¢ÊÌ¡¹¤ÎIP¥¢¥É¥ì¥¹¤ò»È¤Ã¤Ægfsd¤òµ¯Æ°¤¹¤ë ¤¿¤á¤ËÍѤ¤¤Þ¤¹¡£ Îã: spool_server_listen_address 192.168.121.1 spool_server_cred_type cred_type GSIǧ¾Ú¤Ë¤ª¤¤¤Æ¡¢gfsd¤¬ÍѤ¤¤ë¾ÚÌÀ½ñ¤Î¼ïÎà¤ò»ØÄꤷ¤Þ¤¹¡£ sharedsecretÍøÍÑ»þ¤Ë¤Ï¡¢¤³¤Î»ØÄê¤Ïñ¤Ë̵»ë¤µ¤ì¤Þ¤¹¡£ ¥µ¡¼¥Ð¦¤Ç¤³¤Î»ØÄê¤ò¾Êά¤·¤¿¾ì¹ç¡¢¥µ¡¼¥Ð¤òroot¸¢¸Â¤Çµ¯Æ°¤·¤¿¾ì¹ç¤Ï ¥Û¥¹¥È¾ÚÌÀ½ñ¤òÍѤ¤¤Þ¤¹¡£¤Þ¤¿¥µ¡¼¥Ð¤ò°ìÈ̥桼¥¶¸¢¸Â¤Çµ¯Æ°¤·¤¿¾ì¹ç¤Ï ¥æ¡¼¥¶¾ÚÌÀ½ñ¤òÍѤ¤¤Þ¤¹¡£ ¥¯¥é¥¤¥¢¥ó¥È¦¤Ç¤³¤Î»ØÄê¤ò¾Êά¤·¤¿¾ì¹ç¡¢¥µ¡¼¥Ð¤¬¥Û¥¹¥È¾ÚÌÀ½ñ¤òÍøÍѤ·¤Æ¤¤¤ë ¤È²¾Äꤷ¤Æ¥µ¡¼¥Ðǧ¾Ú¤ò¹Ô¤¤¤Þ¤¹¡£¤³¤Î¤¿¤á¥µ¡¼¥Ð¤ò¥¯¥é¥¤¥¢¥ó¥È¤ÈƱ¤¸¥æ¡¼¥¶ ¸¢¸Â¤Çµ¯Æ°¤·¤Æ¤¤¤ë¾ì¹ç¡¢¥¯¥é¥¤¥¢¥ó¥È¦¤Ç¤Ï¡¢²¼µ­¤Î°ì¹Ô¤òÀßÄꤷ¤Æ ¤ª¤¯É¬Íפ¬¤¢¤ê¤Þ¤¹¡£ Îã: spool_server_cred_type self »ØÄê²Äǽ¤Êcred_type¤È¤·¤Æ¤Ï¡¢ ¡Öself¡×¡¢ ¡Öhost¡×¡¢¡Öuser¡×¡¢ ¡Ömechanism-specific¡×¤¬¤¢¤ê¡¢ spool_server_cred_service¤ª¤è¤Ó spool_server_cred_name¤ÈÁȤ߹ç¤ï¤»¤Æ ²¼µ­¤Î¤è¤¦¤ËÍѤ¤¤Þ¤¹¡£ self ¤½¤Î¥æ¡¼¥¶¤¬¸½ºß½ê»ý¤·¤Æ¤¤¤ë¥æ¡¼¥¶¾ÚÌÀ½ñ¤òÍѤ¤¤ë¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ ¤³¤Î»ØÄê¤òÍøÍѤ¹¤ëºÝ¤Ë¤Ï¡¢ spool_server_cred_service¤ª¤è¤Ó spool_server_cred_name¤Î »ØÄê¤ò¹Ô¤Ã¤Æ¤Ï¤¤¤±¤Þ¤»¤ó¡£ host ¥Û¥¹¥È¾ÚÌÀ½ñ¤¢¤ë¤¤¤Ï¥µ¡¼¥Ó¥¹¾ÚÌÀ½ñ¤òÍѤ¤¤ë¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ ¥µ¡¼¥Ó¥¹¾ÚÌÀ½ñ¤òÍѤ¤¤ë¾ì¹ç¡¢¤½¤Î¥µ¡¼¥Ó¥¹¤Î̾Á°¤ò spool_server_cred_service¤Ç»ØÄꤷ¤Þ¤¹¡£ ¥µ¡¼¥Ó¥¹Ì¾¤Ë¡Öhost¡×¤ò»ØÄꤷ¤¿¾ì¹ç¡¢ ¥Õ¥¡¥¤¥ë``/etc/grid-security/hostcert.pem''¤Ë ¤¢¤ë¥Û¥¹¥È¾ÚÌÀ½ñ¤òÍѤ¤¤Þ¤¹¡£ ¤½¤ì°Ê³°¤Î¥µ¡¼¥Ó¥¹Ì¾¤ò»ØÄꤷ¤¿¾ì¹ç¡¢ ¥Õ¥¡¥¤¥ë``/etc/grid-security/¥µ¡¼¥Ó¥¹/¥µ¡¼¥Ó¥¹cert.pem'' ¤Ë¤¢¤ë¥µ¡¼¥Ó¥¹¾ÚÌÀ½ñ¤òÍѤ¤¤Þ¤¹¡£ ¥µ¡¼¥Ó¥¹Ì¾¤ò¾Êά¤·¤¿¾ì¹ç¡¢¡Öhost¡×¤¬»ØÄꤵ¤ì¤¿¤È¤ß¤Ê¤·¤Þ¤¹¡£ ¥Û¥¹¥È¾ÚÌÀ½ñ¤ª¤è¤Ó¥µ¡¼¥Ó¥¹¾ÚÌÀ½ñ¤Î¾ì¹ç¡¢¾ÚÌÀ½ñ¤ÎCommon NameÍó¤Î¤ß¤ò Èæ³Ó¤·¤Þ¤¹¡£Common Name¤Ï¡¢¡ÖCN=¥µ¡¼¥Ó¥¹Ì¾/¥Û¥¹¥È̾¡×¤Î·Á¼°¤Ç¤¢¤ëɬÍפ¬ ¤¢¤ê¤Þ¤¹¡£¤Þ¤¿¡¢¥Û¥¹¥È̾¤Ï¡¢gfhost¥³¥Þ¥ó¥É¤Ç»ØÄꤷ¤¿ Àµ¼°Ì¾¤ÈÀµ³Î¤Ë°ìÃפ·¤Æ¤¤¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£¥Û¥¹¥ÈÊÌ̾¤Ïµö¤µ¤ì¤Þ¤»¤ó¡£ ¤³¤ì¤Ï¡¢GSSAPI (RFC2743/RFC2744)¤ÎGSS_C_NT_HOSTBASED_SERVICE¤Ë Âбþ¤¹¤ëµ¡Ç½¤Ç¤¹¡£ Îã: spool_server_cred_type host spool_server_cred_service host user ¥æ¡¼¥¶¾ÚÌÀ½ñ¤òÍѤ¤¤ë¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ ¥æ¡¼¥¶¤Î¥¢¥«¥¦¥ó¥È̾¤òspool_server_cred_name¤Ç»ØÄꤷ¤Þ¤¹¡£ ¥¢¥«¥¦¥ó¥È̾¤ò¾Êά¤·¤¿¾ì¹ç¤Ë¤Ï¡¢¤½¤Î¥³¥Þ¥ó¥É¤òµ¯Æ°¤·¤¿¥æ¡¼¥¶Ì¾¤¬»È¤ï¤ì¤Þ¤¹¡£ ¤³¤Î»ØÄê¤òÍøÍѤ¹¤ëºÝ¤Ë¤Ï¡¢spool_server_cred_service¤Î »ØÄê¤ò¹Ô¤Ã¤Æ¤Ï¤¤¤±¤Þ¤»¤ó¡£ ¥æ¡¼¥¶Ì¾¤È¾ÚÌÀ½ñ¤ÎDistinguished Name¤ÎÂбþ¤ò¤È¤ë¤¿¤á¡¢ ``/etc/grid-security/grid-mapfile''¤òÍѤ¤¤Þ¤¹¡£ ¤³¤Î¤¿¤á¡¢¤³¤Î¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Ê¤«¤Ã¤¿¤ê¡¢¤¢¤ë¤¤¤Ï¤³¤Î¥Õ¥¡¥¤¥ë¤ËÅÐÏ¿ ¤µ¤ì¤Æ¤Ê¤¤¥æ¡¼¥¶¤Ï¡¢¤³¤Îµ¡Ç½¤òÍѤ¤¤ë¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£ ¤³¤ì¤Ï¡¢GSSAPI (RFC2743/RFC2744)¤ÎGSS_C_NT_USER_NAME¤ËÂбþ¤¹¤ëµ¡Ç½¤Ç¤¹¡£ Îã: spool_server_cred_type user spool_server_cred_name guest mechanism-specific ¥µ¡¼¥Ð¤ÎX.509 Distinguished Name¤òspool_server_cred_name¤Ç ľÀÜ»ØÄꤷ¤Þ¤¹¡£ ¤³¤Î»ØÄê¤òÍøÍѤ¹¤ëºÝ¤Ë¤Ï¡¢spool_server_cred_service¤Î »ØÄê¤ò¹Ô¤Ã¤Æ¤Ï¤¤¤±¤Þ¤»¤ó¡£ ¤³¤ì¤Ï¡¢GSSAPI (RFC2743/RFC2744)¤ÇName Type¤È¤·¤ÆGSS_C_NO_OID¤ò »ØÄꤷ¤¿¾ì¹ç¤ËÂбþ¤¹¤ëµ¡Ç½¤Ç¤¹¡£ Îã: spool_server_cred_type mechanism-specific spool_server_cred_name "/O=Grid/O=Globus/OU=example.com/CN=John Smith" spool_server_cred_service cred_service GSIǧ¾Ú¤Ë¤ª¤¤¤Æ¡¢spool_server_cred_type¤È¤·¤Æ ¡Öhost¡×¤ò»ØÄꤷ¤Æ¤¤¤ë¾ì¹ç¤Ë¡¢gfsd¤¬ÍѤ¤¤ë¥µ¡¼¥Ó¥¹¾ÚÌÀ½ñ¤Î ¼ïÎà¤ò»ØÄꤷ¤Þ¤¹¡£ sharedsecretÍøÍÑ»þ¤Ë¤Ï¡¢¤³¤Î»ØÄê¤Ïñ¤Ë̵»ë¤µ¤ì¤Þ¤¹¡£ ¾Ü¤·¤¯¤Ïspool_server_cred_type¤Î¹à¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£ spool_server_cred_name cred_name GSIǧ¾Ú¤Ë¤ª¤¤¤Æ¡¢spool_server_cred_type¤Ç»ØÄꤷ¤¿ÃÍ¤Ë ±þ¤¸¤Æ¡¢gfsd¤¬ÍѤ¤¤ë¾ÚÌÀ½ñ¤ÎÀßÄê¤ò¹Ô¤¤¤Þ¤¹¡£ sharedsecretÍøÍÑ»þ¤Ë¤Ï¡¢¤³¤Î»ØÄê¤Ïñ¤Ë̵»ë¤µ¤ì¤Þ¤¹¡£ ¾Ü¤·¤¯¤Ïspool_server_cred_type¤Î¹à¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£ metadb_server_host gfmd¥Û¥¹¥È̾ gfmd¤¬Æ°ºî¤·¤Æ¤¤¤ë¥Û¥¹¥È̾¤ò»ØÄꤷ¤Þ¤¹¡£ ¤³¤ÎÀßÄê¤Ïɬ¿Ü¤Ç¤¹¡£ Îã: metadb_server_host ldap.example.com metadb_server_port gfmd¥Ý¡¼¥ÈÈÖ¹æ gfmd¤¬ÍøÍѤ¹¤ëTCP¥Ý¡¼¥È¤ÎÈÖ¹æ¤ò»ØÄꤷ¤Þ¤¹¡£ ¾Êά»þ¤Î¥Ç¥Õ¥©¥ë¥È¡¦¥Ý¡¼¥ÈÈÖ¹æ¤Ï601È֤Ǥ¹¡£ Îã: metadb_server_port 601 metadb_server_cred_type cred_type GSIǧ¾Ú¤Ë¤ª¤¤¤Æ¡¢gfmd¤¬ÍѤ¤¤ë¾ÚÌÀ½ñ¤Î¼ïÎà¤ò»ØÄꤷ¤Þ¤¹¡£ sharedsecretÍøÍÑ»þ¤Ë¤Ï¡¢¤³¤Î»ØÄê¤Ïñ¤Ë̵»ë¤µ¤ì¤Þ¤¹¡£ ÀßÄê¤Î°ÕÌ£¤Ë¤Ä¤¤¤Æ¤Ïspool_server_cred_type¤Î¹à¤ò »²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£ metadb_server_cred_service cred_service GSIǧ¾Ú¤Ë¤ª¤¤¤Æ¡¢metadb_server_cred_type¤È¤·¤Æ ¡Öhost¡×¤ò»ØÄꤷ¤Æ¤¤¤ë¾ì¹ç¤Ë¡¢gfmd¤¬ÍѤ¤¤ë¥µ¡¼¥Ó¥¹¾ÚÌÀ½ñ¤Î ¼ïÎà¤ò»ØÄꤷ¤Þ¤¹¡£ sharedsecretÍøÍÑ»þ¤Ë¤Ï¡¢¤³¤Î»ØÄê¤Ïñ¤Ë̵»ë¤µ¤ì¤Þ¤¹¡£ ÀßÄê¤Î°ÕÌ£¤Ë¤Ä¤¤¤Æ¤Ïspool_server_cred_type¤Î¹à¤ò »²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£ metadb_server_cred_name cred_name GSIǧ¾Ú¤Ë¤ª¤¤¤Æ¡¢metadb_server_cred_type¤Ç»ØÄꤷ¤¿ÃÍ¤Ë ±þ¤¸¤Æ¡¢gfmd¤¬ÍѤ¤¤ë¾ÚÌÀ½ñ¤ÎÀßÄê¤ò¹Ô¤¤¤Þ¤¹¡£ sharedsecretÍøÍÑ»þ¤Ë¤Ï¡¢¤³¤Î»ØÄê¤Ïñ¤Ë̵»ë¤µ¤ì¤Þ¤¹¡£ ÀßÄê¤Î°ÕÌ£¤Ë¤Ä¤¤¤Æ¤Ïspool_server_cred_type¤Î¹à¤ò »²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£ metadb_server_stack_size ¥Ð¥¤¥È¿ô ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥ÐgfmdÆâ¤Î³Æ¥¹¥ì¥Ã¥É¤¬ÍøÍѤ¹¤ë¥¹¥¿¥Ã¥¯¤Î¥µ¥¤¥º¤ò »ØÄꤷ¤Þ¤¹¡£¾Êά¤µ¤ì¤¿¾ì¹çOS¤Î¥Ç¥Õ¥©¥ë¥ÈÃͤ¬»È¤ï¤ì¤Þ¤¹¡£ ¤³¤Î¥Ñ¥é¥á¡¼¥¿¤Ï¡¢gfmd¤Î¾ÃÈñ¤¹¤ë²¾ÁÛ¥á¥â¥ê¶õ´Ö¤Î¥µ¥¤¥º¤òÀáÌ󤹤뤿¤á¤Ë ÍѤ¤¤Þ¤¹¡£ ¤¿¤È¤¨¤Ð¡¢CentOS 5/i386¤Î¾ì¹ç¡¢¥Ç¥Õ¥©¥ë¥È¤Î¥¹¥¿¥Ã¥¯¥µ¥¤¥º¤Ï10MB¤Ç¤¹ ¤Î¤Ç¡¢¤³¤Î¥Ñ¥é¥á¡¼¥¿¤Ç¥¹¥¿¥Ã¥¯¥µ¥¤¥º¤ò256KB¤ËÍÞ¤¨¤ë¤È¡¢gfmd¤Î¥¹¥¿¥Ã¥¯ ¤¬¾ÃÈñ¤¹¤ë²¾ÁÛ¥á¥â¥ê¶õ´Ö¤Î¥µ¥¤¥º¤ò¡¢1/40¤Ë¸º¤é¤¹¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ ¤³¤Îʸ¤Ïgfmd.conf¤Î¤ß¤ÇÍ­¸ú¤Ç¤¢¤ê¡¢gfarm2.conf¤Ç¤Ï̵»ë¤µ¤ì¤Þ¤¹¡£ Îã: metadb_server_stack_size 262144 metadb_server_thread_pool_size ¥¹¥ì¥Ã¥É¿ô ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ðgfmd¤Î¥¹¥ì¥Ã¥É¥×¡¼¥ë¤Î¥¹¥ì¥Ã¥É¿ô¤ò»ØÄꤷ¤Þ¤¹¡£ ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¥Î¡¼¥É¤Î¥³¥¢¿ô¤¯¤é¤¤¤ËÀßÄꤹ¤ë¤È¸ú²ÌŪ¤Ç¤¹¡£ ¥Ç¥Õ¥©¥ë¥ÈÃͤÏ16¤Ç¤¹¡£ ¤³¤Îʸ¤Ïgfmd.conf¤Î¤ß¤ÇÍ­¸ú¤Ç¤¢¤ê¡¢gfarm2.conf¤Ç¤Ï̵»ë¤µ¤ì¤Þ¤¹¡£ Îã: metadb_server_thread_pool_size 16 metadb_server_job_queue_length ¥­¥å¡¼Ä¹ ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ðgfmd¤Î¥¸¥ç¥Ö¥­¥å¡¼¤Î¥­¥å¡¼Ä¹¤ò»ØÄꤷ¤Þ¤¹¡£ °ìÅÙ¤ËÀܳ¤¹¤ëºÇÂ祯¥é¥¤¥¢¥ó¥È¤Î¿ô¤¯¤é¤¤¤ËÀßÄꤹ¤ë¤È¸ú²ÌŪ¤Ç¤¹¡£ ¥Ç¥Õ¥©¥ë¥ÈÃͤÏ16000¤Ç¤¹¡£ ¤³¤Îʸ¤Ïgfmd.conf¤Î¤ß¤ÇÍ­¸ú¤Ç¤¢¤ê¡¢gfarm2.conf¤Ç¤Ï̵»ë¤µ¤ì¤Þ¤¹¡£ Îã: metadb_server_job_queue_length 160 metadb_server_heartbeat_interval Éÿô ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ðgfmd¤¬³Æ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥µ¡¼¥Ðgfsd ¤ËÂФ·Æ°ºî³Îǧ¤ò¹Ô¤¦¥Ï¡¼¥È¥Ó¡¼¥È¤Î´Ö³Ö¤òÉÿô¤Ç»ØÄꤷ¤Þ¤¹¡£ ¥Ç¥Õ¥©¥ë¥ÈÃͤÏ180ÉäǤ¹¡£ Gfarm-2.3.0¤Þ¤Ç¤Ï¤³¤Îʸ¤Ïgfmd.conf¤Î¤ß¤ÇÍ­¸ú¤Ç¤¢¤ê¡¢gfarm2.conf¤Ç¤Ï ̵»ë¤µ¤ì¤Æ¤¤¤Þ¤·¤¿¤¬¡¢Gfarm-2.4.0°Ê¹ß¤Ïgfsd¤â¤³¤Î¥Ñ¥é¥á¡¼¥¿¤òÍøÍѤ· gfmdÄä»ß¤ò¸¡ÃΤ¹¤ë¤¿¤á¡¢ gfarm2.conf¤Ègfmd.conf¤ÎξÊý¤Ç»ØÄꤹ¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£ Îã: metadb_server_heartbeat_interval 180 metadb_server_dbq_size ¥­¥å¡¼Ä¹ ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ðgfmd¤Ç¤Ï¥á¥¿¥Ç¡¼¥¿¤ÎÊѹ¹¤ò¥Ð¥Ã¥¯¥¨¥ó¥ÉDB¤Ë È󯱴üŪ¤ËÈ¿±Ç¤·¤Þ¤¹¤¬¡¤¤½¤Î¥­¥å¡¼¤ÎŤµ¤ò»ØÄꤷ¤Þ¤¹¡£ ¥­¥å¡¼Ä¹¤òŤ¯¤¹¤ë¤È¡¤¥Ð¥Ã¥¯¥¨¥ó¥ÉDB¤Î¹¹¿·Â®ÅÙ¤ËΧ®¤µ¤ì¤Ë¤¯¤¯¤Ê¤ê¤Þ¤¹¡£ ¥Ç¥Õ¥©¥ë¥ÈÃͤÏ65536¤Ç¤¹¡£ ¤³¤Îʸ¤Ïgfmd.conf¤Î¤ß¤ÇÍ­¸ú¤Ç¤¢¤ê¡¢gfarm2.conf¤Ç¤Ï̵»ë¤µ¤ì¤Þ¤¹¡£ Îã: metadb_server_dbq_size 65536 ldap_server_host LDAP¥µ¡¼¥Ð¡¼¡¦¥Û¥¹¥È̾ gfmd¤Î¥Ð¥Ã¥¯¥¨¥ó¥É¡¦¥Ç¡¼¥¿¥Ù¡¼¥¹¤È¤·¤Æ LDAP¥µ¡¼¥Ð¤òÁªÂò¤¹¤ë¾ì¹ç¡¢ LDAP¥µ¡¼¥Ð¡¼¤¬Æ°ºî¤·¤Æ¤¤¤ë¥Û¥¹¥È̾¤ò»ØÄꤷ¤Þ¤¹¡£ ¤³¤Îʸ¤Ïgfmd.conf¤ÇÍѤ¤¤é¤ì¡¢gfarm2.conf¤Ç¤ÏÍѤ¤¤é¤ì¤Þ¤»¤ó¡£ Îã: ldap_server_host ldap.example.com ldap_server_port LDAP¥µ¡¼¥Ð¡¼¡¦¥Ý¡¼¥ÈÈÖ¹æ LDAP¥µ¡¼¥Ð¡¼¤¬ÍøÍѤ¹¤ëTCP¥Ý¡¼¥È¤ÎÈÖ¹æ¤ò»ØÄꤷ¤Þ¤¹¡£ ldap_server_host¤ò»ØÄꤹ¤ë¾ì¹ç¤Ë¤Ï¡¢ ¤³¤ÎÀßÄê¤Ïɬ¿Ü¤Ç¤¹¡£ Îã: ldap_server_port 602 ldap_base_dn LDAP_base_distinguished_name LDAP¥Ç¡¼¥¿¥Ù¡¼¥¹¤ÇÊÝ»ý¤¹¤ë¥Ç¡¼¥¿¤Î¥­¡¼¤Îº¬¤È¤Ê¤ë¥Î¡¼¥É¤Î ̾¾Î¡¢base distinguished name¤ò»ØÄꤷ¤Þ¤¹¡£ ldap_server_host¤ò»ØÄꤹ¤ë¾ì¹ç¤Ë¤Ï¡¢ ¤³¤ÎÀßÄê¤Ïɬ¿Ü¤Ç¤¹¡£ Îã: ldap_base_dn "dc=example, dc=com" ldap_bind_dn LDAP_bind_distinguished_name LDAP¥Ç¡¼¥¿¥Ù¡¼¥¹¤ËÀܳ¤¹¤ëºÝ¤Îǧ¾Ú¤ËÍѤ¤¤ë̾¾Î¤ò¡¢distinguished name¤Ç»ØÄꤷ¤Þ¤¹¡£ Îã: ldap_bind_dn "cn=gfarmuser, dc=example, dc=com" ldap_bind_password password LDAP¥Ç¡¼¥¿¥Ù¡¼¥¹¤ËÀܳ¤¹¤ëºÝ¤Îǧ¾Ú¥Ñ¥¹¥ï¡¼¥É¤ò»ØÄꤷ¤Þ¤¹¡£ Îã: ldap_bind_password "secret-ldap-password" postgresql_server_host PostgreSQL¥µ¡¼¥Ð¡¼¡¦¥Û¥¹¥È̾ gfmd¤Î¥Ð¥Ã¥¯¥¨¥ó¥É¡¦¥Ç¡¼¥¿¥Ù¡¼¥¹¤È¤·¤Æ PostgreSQL¥µ¡¼¥Ð¤òÁªÂò¤¹¤ë¾ì¹ç¡¢ PostgreSQL¥µ¡¼¥Ð¡¼¤¬Æ°ºî¤·¤Æ¤¤¤ë¥Û¥¹¥È̾¤ò»ØÄꤷ¤Þ¤¹¡£ ¤³¤Îʸ¤Ïgfmd.conf¤ÇÍѤ¤¤é¤ì¡¢gfarm2.conf¤Ç¤ÏÍѤ¤¤é¤ì¤Þ¤»¤ó¡£ Îã: postgresql_server_host postgresql.example.com postgresql_server_port PostgreSQL¥µ¡¼¥Ð¡¼¡¦¥Ý¡¼¥ÈÈÖ¹æ PostgreSQL¥µ¡¼¥Ð¡¼¤¬ÍøÍѤ¹¤ëTCP¥Ý¡¼¥È¤ÎÈÖ¹æ¤ò»ØÄꤷ¤Þ¤¹¡£ postgresql_server_host¤ò»ØÄꤹ¤ë¾ì¹ç¤Ë¤Ï¡¢ ¤³¤ÎÀßÄê¤Ïɬ¿Ü¤Ç¤¹¡£ Îã: postgresql_server_port 602 postgresql_dbname dbname PostgreSQL¥Ç¡¼¥¿¥Ù¡¼¥¹Ì¾¤ò»ØÄꤷ¤Þ¤¹¡£ postgresql_server_host¤ò»ØÄꤹ¤ë¾ì¹ç¤Ë¤Ï¡¢ ¤³¤ÎÀßÄê¤Ïɬ¿Ü¤Ç¤¹¡£ Îã: postgresql_dbname gfarm postgresql_user user PostgreSQL¥Ç¡¼¥¿¥Ù¡¼¥¹¤ËÀܳ¤¹¤ë¥Ç¡¼¥¿¥Ù¡¼¥¹´ÉÍý²¼¤Î¥æ¡¼¥¶Ì¾¤ò»ØÄꤷ¤Þ¤¹¡£ Îã: postgresql_user gfarm postgresql_password password PostgreSQL¥Ç¡¼¥¿¥Ù¡¼¥¹¤ËÀܳ¤¹¤ë¥Ç¡¼¥¿¥Ù¡¼¥¹´ÉÍý²¼¤Î¥æ¡¼¥¶¤Î¥Ñ¥¹¥ï¡¼¥É¤ò»ØÄꤷ¤Þ¤¹¡£ Îã: postgresql_password "secret-postgresql-password" postgresql_conninfo connection_info PostgreSQL¥Ç¡¼¥¿¥Ù¡¼¥¹¤ËÀܳ¤¹¤ë¤È¤­¤ÎÀܳ¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Þ¤¹¡£ Îã: postgresql_conninfo "sslmode=require connect_timeout=30" auth Í­¸úÀ­  ǧ¾ÚÊýË¡  ¥Û¥¹¥È»ØÄê ¤³¤Îʸ¤Ï¡¢Âè3°ú¿ô¤Ç»ØÄꤷ¤¿¥Û¥¹¥È¤È¤ÎÄÌ¿®¤ËÍѤ¤¤ëǧ¾ÚÊýË¡¤òÀßÄꤷ¤Þ¤¹¡£ Âè1°ú¿ô¤ÎÍ­¸úÀ­Éô¤Ë¤Ï¡¢enable¤Ê¤¤¤·disable ¥­¡¼¥ï¡¼¥É¤ò»ØÄꤷ¤Þ¤¹¡£ Âè2°ú¿ô¤Îǧ¾ÚÊýË¡Éô¤Ë¤Ï¡¢gsi¡¢ gsi_auth¤Ê¤¤¤·sharedsecret ¥­¡¼¥ï¡¼¥É¤ò»ØÄꤷ¤Þ¤¹¡£ Âè3°ú¿ô¤Ë¤Ï¡¢¥Û¥¹¥È»ØÄê¤òµ­½Ò¤·¤Þ¤¹¡£ ¤³¤Îʸ¤ÏÊ£¿ô»ØÄê²Äǽ¤Ç¤¹¡£³ÆÇ§¾ÚÊýË¡¤´¤È¤Ë¡¢ÀèÆ¬¤«¤é½ç¤Ë¥Û¥¹¥È»ØÄê¤Ë Ŭ¹ç¤¹¤ë¤«¤É¤¦¤«Ä´¤Ù¡¢Í­¸ú¤Ç¤¢¤ë¤È¤Î»ØÄê¤ËŬ¹ç¤·¤¿¾ì¹ç¡¢¤½¤Îǧ¾ÚÊýË¡¤¬ ÍøÍѸõÊä¤Ë¤Ê¤ê¤Þ¤¹¡£Í­¸ú¤Ç¤¢¤ë¤È¤Î»ØÄê¤ËŬ¹ç¤·¤Ê¤¤¾ì¹ç¤ä¡¢¤¢¤ë¤¤¤Ï Í­¸ú¤Ç¤¢¤ë¤È¤Î»ØÄê¤ËŬ¹ç¤¹¤ë¤è¤ê¤âÁ°¤Ë̵¸ú¤Ç¤¢¤ë¤È¤Î»ØÄê¤ËŬ¹ç¤·¤¿ ¾ì¹ç¡¢¤½¤Îǧ¾ÚÊýË¡¤Ï¡¢¸õÊä¤Ë¤Ê¤ê¤Þ¤»¤ó¡£ ¤³¤Î»ØÄê¤Ï¡¢¥µ¡¼¥Ð¡¼Â¦¤È¥¯¥é¥¤¥¢¥ó¥È¦¤ÎξÊý¤Ç²ò¼á¤µ¤ì¡¢ ÁÐÊý¤È¤â¤ÇÍ­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ëǧ¾ÚÊýË¡¤Î¤ß¤¬ÍѤ¤¤é¤ì¤Þ¤¹¡£ ǧ¾ÚÊýË¡¤¬°Û¤Ê¤ë¤â¤Î¤Ë´Ø¤·¤Æ¤Ï¡¢»ØÄê¤Î½ç½ø¤Ï°ÕÌ£¤¬¤¢¤ê¤Þ¤»¤ó¡£ Ê£¿ô¤Îǧ¾ÚÊýË¡¤¬¸õÊä¤È¤Ê¤Ã¤¿¾ì¹ç¡¢sharedsecret¡¢ gsi_auth¡¢gsiǧ¾Ú¤Î½ç½ø¤Ç»î¤ß¤Þ¤¹¡£ Gfarm¤Î¥³¥ó¥Ñ¥¤¥ë»þ¤Ëglobus¤È¤Î¥ê¥ó¥¯¤ò»ØÄꤷ¤Ê¤«¤Ã¤¿¾ì¹ç¡¢ GSI¤ÏÍøÍѤǤ­¤Þ¤»¤ó¡£¤³¤Î¾ì¹ç¡¢gsi¤ª¤è¤Ó gsi_authǧ¾Ú¤Î»ØÄê¤Ïñ¤Ë̵»ë¤µ¤ì¤Þ¤¹¡£ ¤³¤ÎÀßÄê¤Ïɬ¿Ü¤Ç¤¹¡£ Îã: auth disable sharedsecret 192.168.0.100 auth disable sharedsecret 192.168.0.101 auth enable sharedsecret 192.168.0.0/24 auth enable gsi_auth 10.0.0.0/8 auth enable gsi * ¤³¤ÎÎã¤Ç¤Ï¡¢¥Û¥¹¥È192.168.0.100¤È192.168.0.101¤Î2¤Ä¤Î¥Û¥¹¥È¤ò ½ü¤¤¤¿192.168.0.0/24¥Í¥Ã¥È¥ï¡¼¥¯¤Ë°¤¹¥Û¥¹¥È¤Ë¤Ï sharedsecret¤Ègsi¤ÎξÊý¤ò¡¢ 10.0.0.0/8¥Í¥Ã¥È¥ï¡¼¥¯¤Ë°¤¹¥Û¥¹¥È¤Ë¤Ïgsi_auth¤ª¤è¤Ó gsi¤ÎξÊý¤ò¡¢ ¤½¤ì°Ê³°¤ÎÁ´¤Æ¤Î¥Û¥¹¥È¤Ë¤Ïgsiǧ¾Ú¤Î¤ß¤ò»î¤ß¤Þ¤¹¡£ ¤¹¤Ê¤ï¤Á¡¢¥Û¥¹¥È192.168.0.100¤È192.168.0.101¤Î2¤Ä¤Î¥Û¥¹¥È¤Ï¡¢ gsiǧ¾Ú¤Î¤ß¤ò»î¤ß¤ë¤³¤È¤Ë¤Ê¤ê¤Þ¤¹¡£ sockopt ¥ª¥×¥·¥ç¥ó[=ÃÍ] [LISTENER | ¥Û¥¹¥È»ØÄê] ÄÌ¿®socket(2)¤ËÂФ·¤Æ¡¢setsockopt(2)¥·¥¹¥Æ¥à¥³¡¼¥ë¤ò»È¤Ã¤Æ ¥½¥±¥Ã¥È¡¦¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Þ¤¹¡£ Âè2°ú¿ô¤ËÁ´¤ÆÂçʸ»ú¤ÇLISTENER¤ò»ØÄꤷ¤¿¾ì¹ç¡¢ ¥µ¡¼¥Ð¡¼Â¦(Ãå¸ÆÂ¦)¤Î¥½¥±¥Ã¥È¤Ë»ØÄꤹ¤ë¥ª¥×¥·¥ç¥ó¤Ë¤Ê¤ê¤Þ¤¹¡£ ¤³¤Î¾ì¹ç¡¢ÄÌ¿®¤¹¤ëÁê¼ê¤Ë´Ø·¸¤Ê¤¯¡¢ °ìΧ¤Ë¥½¥±¥Ã¥È¡¦¥ª¥×¥·¥ç¥ó¤¬ÀßÄꤵ¤ì¤Þ¤¹¡£ Âè2°ú¿ô¤Ë¥Û¥¹¥È»ØÄê¤òµ­½Ò¤·¤¿¾ì¹ç¡¢¥¯¥é¥¤¥¢¥ó¥È¦(ȯ¸ÆÂ¦)¤Î ¥½¥±¥Ã¥È¤Ë»ØÄꤹ¤ë¥ª¥×¥·¥ç¥ó¤Ë¤Ê¤ê¤Þ¤¹¡£¤³¤Î¾ì¹ç¡¢ÄÌ¿®¤¹¤ëÁê¼êËè¤Ë ¥½¥±¥Ã¥È¡¦¥ª¥×¥·¥ç¥ó¤òÊѤ¨¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ ¤Ê¤ª¡¢Âè2°ú¿ô¤Ë"*"¤Èµ­½Ò¤¹¤ë¤È¡¢¥¯¥é¥¤¥¢¥ó¥È¦(ȯ¸ÆÂ¦)¤ÎÁ´¤Æ¤Î ¥Û¥¹¥È¤ò°ÕÌ£¤¹¤ë¤³¤È¤Ë¤Ê¤ê¡¢¥µ¡¼¥Ð¡¼Â¦(Ãå¸ÆÂ¦)¤Ë¤ÏŬÍѤµ¤ì¤Þ¤»¤ó¡£ Âè2°ú¿ô¤ò¾Êά¤·¤¿¾ì¹ç¡¢¥µ¡¼¥Ð¡¼Â¦¤È¥¯¥é¥¤¥¢¥ó¥È¦¤ÎξÊý¤Ç¡¢ Á´¤Æ¤ÎÄÌ¿®Áê¼ê¤ËÂФ·¤ÆÆ±¤¸¥½¥±¥Ã¥È¡¦¥ª¥×¥·¥ç¥ó¤òÀßÄꤷ¤Þ¤¹¡£ »ØÄê²Äǽ¤Ê¥½¥±¥Ã¥È¡¦¥ª¥×¥·¥ç¥ó¤Ë¤Ï¼¡¤Î¤â¤Î¤¬¤¢¤ê¤Þ¤¹¡£ debug¡£setsockopt(2)¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ç¡¢SO_DEBUG¥½¥±¥Ã¥È¡¦¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Þ¤¹¡£Ãͤòµ­½Ò¤¹¤ëɬÍפϤ¢¤ê¤Þ¤»¤ó¡£ keepalive¡£setsockopt(2)¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ç¡¢SO_KEEPALIVE ¥½¥±¥Ã¥È¡¦¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Þ¤¹¡£Ãͤòµ­½Ò¤¹¤ëɬÍפϤ¢¤ê¤Þ¤»¤ó¡£ sndbuf¡£setsockopt(2)¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ç¡¢SO_SNDBUF ¥½¥±¥Ã¥È¡¦¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Þ¤¹¡£ÃͤλØÄ꤬ɬÍפǤ¹¡£ rcvbuf¡£setsockopt(2)¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ç¡¢SO_RCVBUF ¥½¥±¥Ã¥È¡¦¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Þ¤¹¡£ÃͤλØÄ꤬ɬÍפǤ¹¡£ tcp_nodelay¡£setsockopt(2)¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ç¡¢TCP_NODELAY ¥½¥±¥Ã¥È¡¦¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Þ¤¹¡£Ãͤòµ­½Ò¤¹¤ëɬÍפϤ¢¤ê¤Þ¤»¤ó¡£ Îã: sockopt tcp_nodelay 192.168.0.0/24 sockopt sndbuf=1048576 10.0.0.0/8 sockopt sndbuf=1048576 LISTENER sockopt rcvbuf=1048576 10.0.0.0/8 sockopt rcvbuf=1048576 LISTENER known_network ¥Û¥¹¥È»ØÄê ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Î¥Í¥Ã¥È¥ï¡¼¥¯¤ò»ØÄꤷ¤Þ¤¹¡£ Ëܥͥåȥ¥¯¤Ï¡¢ ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥ÉÁªÂò»þ¤Î¥°¥ë¡¼¥Ô¥ó¥°¤ËÍøÍѤµ¤ì¤Þ¤¹¡£ ¤³¤Îʸ¤Ç»ØÄꤷ¤¿¥¢¥É¥ì¥¹¤ËŬ¹ç¤·¤Ê¤¤IP¥¢¥É¥ì¥¹¤Î¾ì¹ç¡¢ IPv4¤Î¥¯¥é¥¹C¥Í¥Ã¥È¥ï¡¼¥¯¤¬²¾Äꤵ¤ì¤Þ¤¹¡£ Îã: known_network 192.168.0.0/24 admin_user ¥æ¡¼¥¶Ì¾ gfmd.confÆâ¤Î¤³¤Îʸ¤Ç»ØÄꤵ¤ì¤¿¥æ¡¼¥¶¤¬¡¢ ¥Ç¥Õ¥©¥ë¥È¤ÎÆÃ¸¢¥æ¡¼¥¶¤È¤Ê¤ê¤Þ¤¹¡£ admin_user_gsi_dn DN gfmd.confÆâ¤Îadmin_userʸ¤Ç»ØÄꤵ¤ì¤¿ÆÃ¸¢¥æ¡¼¥¶¤ÎSubject DN¤ò»ØÄꤷ¤Þ¤¹¡£ local_user_map ¥æ¡¼¥¶¥Þ¥Ã¥×¥Õ¥¡¥¤¥ë¥Ñ¥¹Ì¾ sharedsecretǧ¾Ú¤Ë¤ª¤¤¤Æ¡¢ ¥°¥í¡¼¥Ð¥ë¥æ¡¼¥¶Ì¾¤È¥í¡¼¥«¥ë¥æ¡¼¥¶Ì¾¤ÎÂбþ´Ø·¸¤òµ­½Ò¤·¤¿ ¥æ¡¼¥¶¥Þ¥Ã¥×¥Õ¥¡¥¤¥ë¥Ñ¥¹Ì¾¤ò»ØÄꤷ¤Þ¤¹¡£ ¤³¤ÎÀßÄê¤Ïɬ¿Ü¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¤¬¡¢ ¤½¤Î¾ì¹ç¥í¡¼¥«¥ë¥æ¡¼¥¶Ì¾¤¬¥°¥í¡¼¥Ð¥ë¥æ¡¼¥¶Ì¾¤ËÊÑ´¹¤µ¤ì¤Þ¤¹¡£ Ʊ°ì¥æ¡¼¥¶¡¼¤ËÂФ·¤Æ¡¢ °Û¤Ê¤ë¥í¡¼¥«¥ë¥¢¥«¥¦¥ó¥È̾¤òÍ¿¤¨¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤¬¤¢¤ë¾ì¹ç¤ä¡¢ ¥í¡¼¥«¥ë¥æ¡¼¥¶Ì¾¤È¤Ï°Û¤Ê¤ë¥°¥í¡¼¥Ð¥ë¥æ¡¼¥¶Ì¾¤òÍøÍѤ·¤¿¤¤¾ì¹ç¡¢ ¤³¤Î¥Õ¥¡¥¤¥ë¤Ç¡¢³Æ¥Î¡¼¥É¤Î¥í¡¼¥«¥ë¤Ê¥æ¡¼¥¶Ì¾¤ËÂФ·¤Æ¡¢Ã±°ì¤Î ¥°¥í¡¼¥Ð¥ë¥æ¡¼¥¶Ì¾¤òÄêµÁ¤·¤Þ¤¹¡£ Îã: local_user_map /etc/gfarm/gfarm-usermap ¥æ¡¼¥¶¡¼¥Þ¥Ã¥×¥Õ¥¡¥¤¥ë¤Ï¡¢¥°¥í¡¼¥Ð¥ë¥æ¡¼¥¶¡¼Ì¾¤È ¥í¡¼¥«¥ë¥æ¡¼¥¶¡¼Ì¾¤ò¡¢¶õÇò¤Ç¶èÀڤäƳƹԤ˵­½Ò¤·¤Þ¤¹¡£ ¥æ¡¼¥¶¥Þ¥Ã¥×¥Õ¥¡¥¤¥ë¤ÎÆâÍÆÎã: foobar foo quux baz ¤³¤ÎÎã¤Î1¹ÔÌܤλØÄê¤Ç¤Ï¡¢¤³¤Î¥Î¡¼¥É¤Î¥í¡¼¥«¥ë¥æ¡¼¥¶Ì¾foo¤Ë ÂФ·¤Æ¥°¥í¡¼¥Ð¥ë¥æ¡¼¥¶Ì¾foobar¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£ local_group_map ¥°¥ë¡¼¥×¥Þ¥Ã¥×¥Õ¥¡¥¤¥ë¥Ñ¥¹Ì¾ ¥°¥í¡¼¥Ð¥ë¥°¥ë¡¼¥×̾¤È¥í¡¼¥«¥ë¥°¥ë¡¼¥×̾¤ÎÂбþ´Ø·¸¤òµ­½Ò¤·¤¿ ¥°¥ë¡¼¥×¥Þ¥Ã¥×¥Õ¥¡¥¤¥ë¥Ñ¥¹Ì¾¤ò»ØÄꤷ¤Þ¤¹¡£ ¤³¤Î¥Þ¥Ã¥×¥Õ¥¡¥¤¥ë¤Ï¡¤¥í¡¼¥«¥ë¥·¥¹¥Æ¥à¤Î¥°¥ë¡¼¥×ID¤òÍøÍѤ¹¤ëgfarm2fs¤ä Globus GridFTP¤ÎGfarm DSI¤Ê¤É¤ÇÍøÍѤµ¤ì¤Þ¤¹¡£ ¤³¤ÎÀßÄê¤Ïɬ¿Ü¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¤¬¡¢ ¤½¤Î¾ì¹ç¥í¡¼¥«¥ë¥°¥ë¡¼¥×̾¤Ï¥°¥í¡¼¥Ð¥ë¥°¥ë¡¼¥×̾¤ÈÅù¤·¤¤¤È²¾Äꤵ¤ì¤Þ¤¹¡£ Îã: local_group_map /etc/gfarm/gfarm-groupmap ¥°¥ë¡¼¥×¥Þ¥Ã¥×¥Õ¥¡¥¤¥ë¤Ï¡¢¥°¥í¡¼¥Ð¥ë¥°¥ë¡¼¥×̾¤È ¥í¡¼¥«¥ë¥°¥ë¡¼¥×̾¤ò¡¢¶õÇò¤Ç¶èÀڤäƳƹԤ˵­½Ò¤·¤Þ¤¹¡£ schedule_cache_timeout Éÿô gfarm¥é¥¤¥Ö¥é¥ê¤¬ÆâÉôŪ¤ËÊÝ»ý¤·¤Æ¤¤¤ë¡¢¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É ¤Î¥¹¥±¥¸¥å¡¼¥ê¥ó¥°½èÍý¤Ë´Ø¤ï¤ë¾ðÊ󡢤¹¤Ê¤ï¤Á¥í¡¼¥É¥¢¥Ù¥ì¡¼¥¸¡¢ ¥Ç¥£¥¹¥¯¶õ¤­ÍÆÎÌ¡¢Ç§¾Ú¤¬Ä̤뤫Èݤ«Åù¤Î¥­¥ã¥Ã¥·¥å¤ÎÍ­¸ú´ü¸Â¤òÉÿô¤Ç»ØÄꤷ¤Þ¤¹¡£ Ää»ß¤·¤Æ¤¤¤¿¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤¬Éü³è¤·¤¿¤è¤¦¤Ê¾ì¹ç¡¢¤³¤Î´ü¸Â¤¬ ÀÚ¤ì¤ë¤Þ¤Ç¤Ï¡¢¤½¤Î¥Î¡¼¥É¤¬¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¤µ¤ì¤Ê¤¤¤³¤È¤¬¤¢¤ê¤Þ¤¹¡£ ¥Ç¥Õ¥©¥ë¥È¤Ï600É乤ʤï¤Á10ʬ¤Ç¤¹¡£ Îã: schedule_cache_timeout 60 schedule_idle_load_thresh CPUÉé²Ù ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Î¥¹¥±¥¸¥å¡¼¥ê¥ó¥°»þ¤Ë¡¢ CPUÉé²Ù¤¬Ä㤤¤È¤ß¤Ê¤µ¤ì¤ëCPUÉé²Ù¤ò»ØÄꤷ¤Þ¤¹¡£ ¤³¤³¤Ç»ØÄꤵ¤ì¤ëCPUÉé²Ù¤è¤êÄ㤤CPUÉé²Ù¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤¬ ¤Þ¤º¤Ï¥¹¥±¥¸¥å¡¼¥ëÂоݤȤʤê¤Þ¤¹¡£ ¥Ç¥Õ¥©¥ë¥ÈÃͤÏ0.1¤Ç¤¹¡£ Îã: schedule_idle_load_thresh 0.1 schedule_busy_load_thresh CPUÉé²Ù ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Î¥¹¥±¥¸¥å¡¼¥ê¥ó¥°»þ¤Ë¡¢ CPUÉé²Ù¤¬¹â¤¤¤È¤ß¤Ê¤µ¤ì¤ëCPUÉé²Ù¤ò»ØÄꤷ¤Þ¤¹¡£ ¤³¤³¤Ç»ØÄꤵ¤ì¤ëCPUÉé²Ù¤è¤ê¹â¤¤CPUÉé²Ù¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Ï Åö½é¥¹¥±¥¸¥å¡¼¥ëÂоݤȤʤê¤Þ¤»¤ó¡£ ¥Ç¥Õ¥©¥ë¥ÈÃͤÏ0.5¤Ç¤¹¡£ Îã: schedule_busy_load_thresh 0.5 schedule_virtual_load CPUÉé²Ù ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤¬ÁªÂò¤µ¤ì¤¿¤È¤­¡¢ CPUÉé²Ù¤Î¥¯¥é¥¤¥¢¥ó¥È¥­¥ã¥Ã¥·¥å¤Ë¤³¤³¤Ç»ØÄꤵ¤ì¤ëCPUÉé²Ù¤¬²Ã¤¨¤é¤ì¤Þ¤¹¡£ ¤³¤ì¤Ë¤è¤ê¡¢ °ìÅÙ¥¹¥±¥¸¥å¡¼¥ë¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤¬²¿Å٤⥹¥±¥¸¥å¡¼¥ë¤µ¤ì¤ë¤³¤È¤òËɤ¤¤Ç¤¤¤Þ¤¹¡£ ¥Ç¥Õ¥©¥ë¥ÈÃͤÏ0.3¤Ç¤¹¡£ Îã: schedule_virtual_load 0.3 minimum_free_disk_space ¥Ð¥¤¥È¿ô ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤ÇɬÍפʺǾ®¸ÂÅ٤Υǥ£¥¹¥¯¶õ¤­ÍÆÎ̤ò»ØÄê ¤·¤Þ¤¹¡£¤³¤Î¥µ¥¤¥º°Ê²¼¤Î¶õ¤­ÍÆÎ̤·¤«¤Ê¤¤¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Ï¡¢ ¥Õ¥¡¥¤¥ë½ñ¤­¹þ¤ß¤ò¹Ô¤¦²ÄǽÀ­¤Î¤¢¤ëÁàºî¤ò¹Ô¤¦ºÝ¤Ë¡¢ÁªÂò¤µ¤ì¤Ë¤¯¤¯¤Ê¤ê¤Þ¤¹¡£ »ØÄê¤Ï¥Ð¥¤¥Èñ°Ì¤Ç¹Ô¤¤¤Þ¤¹¤¬¡¢¿ô»ú¤ÎËöÈø¤Ë¶õÇò¤ò³«¤±¤º¤Ëk/M/G/T¤ò»ØÄê ¤¹¤ë¤³¤È¤Ç¡¢¤½¤ì¤¾¤ì1k¥Ð¥¤¥È¡¿1M¥Ð¥¤¥È¡¿1G¥Ð¥¤¥È¡¿1T¥Ð¥¤¥È¤òñ°Ì¤È¤¹¤ë ¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ ¥Ç¥Õ¥©¥ë¥È¤Ï128M¥Ð¥¤¥È¤Ç¤¹¡£ ¤³¤Î¥Ñ¥é¥á¡¼¥¿¤Ï¡¢gfarm2.conf¤Ègfmd.conf¤ÎξÊý¤Ç»ØÄꤹ¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£ Í­¸ú¤Ë¤¹¤ë¤¿¤á¤Ë¤Ï gfmd ¤ª¤è¤Ó Gfarm¥¯¥é¥¤¥¢¥ó¥È¤òºÆµ¯Æ°¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£ Îã: minimum_free_disk_space 1G simultaneous_replication_receivers Ʊ»þ½èÍý¿ô gfmd ¼çƳ¤ÎÊ£À½½èÍý¤ò¡¢Ã±°ìÊ£À½ºîÀ®¥Û¥¹¥È¤ËÂФ·¤Æ¡¢ Ʊ»þ¤¤¤¯¤Ä¤Þ¤ÇʹԤ·¤Æ¹Ô¤Ê¤¦¤³¤È¤òµö¤¹¤«¤òÀßÄꤷ¤Þ¤¹¡£ ¥Ç¥Õ¥©¥ë¥È¤Ï 20¤Ç¤¹¡£ Îã: simultaneous_replication_receivers 40 gfsd_connection_cache ¥³¥Í¥¯¥·¥ç¥ó¿ô gfarm¥é¥¤¥Ö¥é¥ê¤¬gfsd¤È¤ÎÄÌ¿®¤ËÍѤ¤¤ë¥³¥Í¥¯¥·¥ç¥ó¤ò¡¢¤¤¤¯¤Ä ¤Þ¤Ç¥­¥ã¥Ã¥·¥å¤¹¤ë¤«¤ò»ØÄꤷ¤Þ¤¹¡£ ¥Ç¥Õ¥©¥ë¥È¤Ï16¥³¥Í¥¯¥·¥ç¥ó¤Ç¤¹¡£ Îã: gfsd_connection_cache 32 attr_cache_limit ¸Ä¿ô gfarm¥é¥¤¥Ö¥é¥ê¤¬¥­¥ã¥Ã¥·¥å¤¹¤ë°À­¤ÎºÇÂç¿ô¤ò»ØÄꤷ¤Þ¤¹¡£ ¥Ç¥Õ¥©¥ë¥È¤Ï40000¸Ä¤Ç¤¹¡£ Îã: attr_cache_limit 100000 attr_cache_timeout ¥ß¥êÉÿô gfarm¥é¥¤¥Ö¥é¥ê¤¬Â°À­¤ò¥­¥ã¥Ã¥·¥å¤·¤Æ¤¤¤ë»þ´Ö¤ò¡¢¥ß¥êÉÃñ°Ì¤Ç»ØÄꤷ¤Þ¤¹¡£ ¥Ç¥Õ¥©¥ë¥È¤Ï 1000¥ß¥êÉ乤ʤï¤Á 1ÉäǤ¹¡£ Îã: attr_cache_timeout 3600000 log_level Í¥ÀèÅÙ¥ì¥Ù¥ë ¤É¤ÎÍ¥ÀèÅÙ¥ì¥Ù¥ë°Ê¾å¤Î¥í¥°¤ò½ÐÎϤ¹¤ë¤«¤ò»ØÄꤷ¤Þ¤¹¡£ ¤³¤³¤Ç»ØÄꤷ¤¿¥ì¥Ù¥ë̤Ëþ¤ÎÍ¥ÀèÅÙ¤Î¥í¥°¤Ï¡¢syslog¤äɸ½à¥¨¥é¡¼¤Ø Á÷¤é¤ì¤Þ¤»¤ó¡£ ¥ì¥Ù¥ë¤Ï¡¢Í¥ÀèÅ٤ι⤤½ç¤Ë"emerg", "alert", "crit", "err", "warning", "notice", "info", "debug"¤Ç¤¹¡£ ¥Ç¥Õ¥©¥ë¥È¤Î½ÐÎÏ¥ì¥Ù¥ë¤Ï"info"¤Ç¤¹¡£ "crit"°Ê¾å¤ÎÍ¥ÀèÅÙ¤ò»ØÄꤹ¤ë¤³¤È¤Ï¡¢¤ª´«¤á¤Ç¤­¤Þ¤»¤ó¡£ Îã: log_level debug log_message_verbose_level ¥ì¥Ù¥ë ¥í¥°¥á¥Ã¥»¡¼¥¸¤Î¾éĹÅÙ¤ò»ØÄꤷ¤Þ¤¹¡£ ¥Ç¥Õ¥©¥ë¥È¤Ï0¤Ç¤¹¡£¥ì¥Ù¥ë0¤Ç¤Ï¡¢¥í¥°ID¤¬½ÐÎϤµ¤ì¤Þ¤¹¡£ ¥ì¥Ù¥ë1¤Ç¤Ï¡¢¥ì¥Ù¥ë0¤Ë²Ã¤¨¥½¡¼¥¹¥³¡¼¥É¤Î¥Õ¥¡¥¤¥ë̾¤È¹ÔÈֹ椬½ÐÎϤµ¤ì¤Þ¤¹¡£ ¥ì¥Ù¥ë2¤Ç¤Ï¡¢¥ì¥Ù¥ë1¤Ë²Ã¤¨´Ø¿ô̾¤¬½ÐÎϤµ¤ì¤Þ¤¹¡£ Îã: log_message_verbose_level 1 no_file_system_node_timeout Éÿô ÍøÍѲÄǽ¤Ê¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤¬Â¸ºß¤·¤Ê¤¤¾ì¹ç¡¤ Gfarm¥¯¥é¥¤¥¢¥ó¥È¥é¥¤¥Ö¥é¥ê¤Ï¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤¬ÍøÍѲÄǽ¤Ë¤Ê¤ë¤Þ¤Ç»î¹Ô¤ò·«¤êÊÖ¤·¤Þ¤¹¤¬¡¢ ¤½¤Î¥¿¥¤¥à¥¢¥¦¥È»þ´Ö¤òÉÃñ°Ì¤Ç»ØÄꤷ¤Þ¤¹¡£ ¥Ç¥Õ¥©¥ë¥È¤Ï 30ÉäǤ¹¡£ Îã: no_file_system_node_timeout 30 gfmd_reconnection_timeout Éÿô ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤Ø¤ÎÀܳ¤¬ÀÚÃǤµ¤ì¤¿¾ì¹ç¡¤ ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤Ø¤ÎºÆÀܳ¤ò·«¤êÊÖ¤·¤Þ¤¹¤¬¡¤ ¤½¤Î¥¿¥¤¥à¥¢¥¦¥È»þ´Ö¤òÉÃñ°Ì¤Ç»ØÄꤷ¤Þ¤¹¡£ ¥Ç¥Õ¥©¥ë¥È¤Ï 30ÉäǤ¹¡£ Îã: gfmd_reconnection_timeout 30 GRAMMAR gfarm2.conf¤Îʸˡ¤òBNF¤Çµ­½Ò¤¹¤ë¤È¡¢²¼µ­¤Î¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡£ <statement> ::=   <spool_statement> |   <spool_server_listen_address_statement> |   <spool_server_cred_type_statement> |   <spool_server_cred_service_statement> |   <spool_server_cred_name_statement> |   <metadb_server_host_statement> |   <metadb_server_port_statement> |   <metadb_server_cred_type_statement> |   <metadb_server_cred_service_statement> |   <metadb_server_cred_name_statement> |   <metadb_server_stack_size_statement> |   <metadb_server_thread_pool_size_statement> |   <metadb_server_job_queue_length_statement> |   <metadb_server_heartbeat_interval_statement> |   <metadb_server_dbq_size_statement> |   <ldap_server_host_statement> |   <ldap_server_port_statement> |   <ldap_base_dn_statement> |   <ldap_bind_dn_statement> |   <ldap_bind_password_statement> |   <postgresql_server_host_statement> |   <postgresql_server_port_statement> |   <postgresql_dbname_statement> |   <postgresql_user_statement> |   <postgresql_password_statement> |   <postgresql_conninfo_statement> |   <auth_statement> |   <sockopt_statement> |   <known_network_statement> |   <admin_user_statement> |   <admin_user_gsi_dn_statement> |   <local_user_map_statement> |   <local_group_map_statement> |   <schedule_cache_timeout_statement> |   <schedule_idle_load_thresh_statement> |   <schedule_busy_load_thresh_statement> |   <schedule_virtual_load_statement> |   <minimum_free_disk_space_statement> |   <simultaneous_replication_receivers> |   <gfsd_connection_cache_statement> |   <attr_cache_limit_statement> |   <attr_cache_timeout_statement> |   <log_level_statement> |   <log_message_verbose_level_statement> <spool_statement> ::= "spool" <pathname> <spool_server_listen_address_statement> ::=   "spool_server_listen_address" <ipv4_address> <spool_server_cred_type_statement> ::=   "spool_server_cred_type" <cred_type> <spool_server_cred_service_statement> ::=   "spool_server_cred_service" <cred_service> <spool_server_cred_name_statement> ::=   "spool_server_cred_name" <cred_name> <metadb_server_host_statement> ::= "metadb_server_host" <hostname> <metadb_server_port_statement> ::= "metadb_server_port" <portnumber> <metadb_server_cred_type_statement> ::=   "metadb_server_cred_type" <cred_type> <metadb_server_cred_service_statement> ::=   "metadb_server_cred_service" <cred_service> <metadb_server_cred_name_statement> ::=   "metadb_server_cred_name" <cred_name> <metadb_server_stack_size_statement> ::=   "metadb_server_stack_size" <number> <metadb_server_thread_pool_size_statement> ::=   "metadb_server_thread_pool_size" <number> <metadb_server_job_queue_length_statement> ::=   "metadb_server_job_queue_length" <number> <metadb_server_heartbeat_interval_statement> ::=   "metadb_server_heartbeat_interval" <number> <metadb_server_dbq_size_statement> ::=   "metadb_server_dbq_size" <number> <ldap_server_host_statement> ::= "ldap_server_host" <hostname> <ldap_server_port_statement> ::= "ldap_server_port" <portnumber> <ldap_base_dn_statement> ::= "ldap_base_dn" <string> <ldap_bind_dn_statement> ::= "ldap_bind_dn" <string> <ldap_bind_password_statement> ::= "ldap_bind_password" <string> <postgresql_server_host_statement> ::= "postgresql_server_host" <hostname> <postgresql_server_port_statement> ::= "postgresql_server_port" <portnumber> <postgresql_dbname_statement> ::= "postgresql_dbname" <string> <postgresql_user_statement> ::= "postgresql_user" <string> <postgresql_password_statement> ::= "postgresql_password" <string> <postgresql_conninfo_statement> ::= "postgresql_conninfo" <string> <auth_statement> ::=   "auth" <validity> <auth_method> <hostspec> <auth_command> ::= "enable" | "disable" <auth_method> ::= "gsi" | "gsi_auth" | "sharedsecret" <sockopt_statement> ::=   "sockopt" <socket_option>[=<number>] [""LISTENER" | <hostspec>] <socket_option> = "debug" | "keepalive" | "sndbuf" | "rcvbuf" |   "tcp_nodelay" <known_network_statement> ::= "known_network" <hostspec> <admin_user_statement> ::= "admin_user" <string> <admin_user_gsi_dn_statement> ::= "admin_user_gsi_dn" <string> <local_user_map_statement> ::= "local_user_map" <pathname> <local_group_map_statement> ::= "local_group_map" <pathname> <schedule_cache_timeout_statement> ::= "schedule_cache_timeout" <number> <schedule_idle_load_thresh_statement> ::= "schedule_idle_load_thresh" <load> <schedule_busy_load_thresh_statement> ::= "schedule_busy_load_thresh" <load> <schedule_virtual_load_statement> ::= "schedule_virtual_load" <load> <minimum_free_disk_space_statement> ::=   "minimum_free_disk_space" <size> <simultaneous_replication_receivers> ::= "simultaneous_replication_receivers" <number> <gfsd_connection_cache_statement> ::= "gfsd_connection_cache" <number> <attr_cache_limit_statement> ::= "attr_cache_limit" <number> <attr_cache_timeout_statement> ::= "attr_cache_timeout" <number> <log_level_statement> ::= "log_level" <log_priority> <log_message_verbose_level_statement> ::= "log_message_verbose_level" <number> <no_file_system_node_timeout_statement> ::= "no_file_system_node_timeout" <number> <gfmd_reconnection_timeout_statement> ::= "gfmd_reconnection_timeout" <number> <hostspec> ::= <ipv4_address> | <ipv4_address> "/" <address_mask> |   <hostname> | "." <domain_name> | "*" <pathname> ::= <pathname_character> <pathname_character>* <pathname_character> ::= <hostname_character> | "," | "/" | "_" <hostname> ::= <hostname_character> <hostname_character>* <hostname_character> ::= <alphabet> | <digit> | "-" | "." <portnumber> ::= <number> <size> ::= <number> [ "k" | "M" | "G" | "T" ] <number> ::= <digit> [<digit>*] <digit> ::= "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" <string> ::= """ <double_quoted_character>* """ <double_quoted_character> ::=   <any_character_except_backslash_and_double_quotation> |   "\\" | "\"" <validity> ::= "enable" | "disable" <log_priority> ::= "emerg" | "alert" | "crit" | "err" | "warning" |   "notice" | "info" | "debug" EXAMPLES ¥á¥¿¥Ç¡¼¥¿¤ÎÊݸ¤ËPostgreSQL¤ò»È¤¤¡¢IP¥¢¥É¥ì¥¹192.168.0.0/24¤Î ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤ä¥¯¥é¥¤¥¢¥ó¥È¤ËÂФ·¤Æ¡¢sharedsecretǧ¾Ú¤ò »È¤¦Îã¤Ç¤¹¡£ spool /var/spool/gfarm metadb_server_host metadb.example.org metadb_server_port 601 postgresql_server_host metadb.example.org postgresql_server_port 5432 postgresql_dbname gfarm postgresql_user gfarm postgresql_password "secret-postgresql-password" auth enable sharedsecret 192.168.0.0/24 sockopt keepalive ¥á¥¿¥Ç¡¼¥¿¤ÎÊݸ¤ËLDAP¤ò»È¤¤¡¢Ç¤°Õ¤ÎIP¥¢¥É¥ì¥¹¤ò»È¤¦ ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤ä¥¯¥é¥¤¥¢¥ó¥È¤ËÂФ·¤Æ¡¢GSIǧ¾Ú¤ò»È¤¦Îã¤Ç¤¹¡£ spool /var/spool/gfarm metadb_server_host metadb.example.com metadb_server_port 601 ldap_server_host metadb.example.com ldap_server_port 602 ldap_base_dn "dc=example, dc=com" ldap_bind_dn "cn=gfarmuser, dc=example, dc=com" ldap_bind_password "secret-ldap-password" auth enable gsi * sockopt keepalive FILES %%SYSCONFDIR%%/gfarm2.conf $HOME/.gfarm2rc SEE ALSO gfmd8, gfsd8, setsockopt2 gfarm-2.4.1/doc/docbook/ja/ref/man3/0000755000000000000000000000000011507222730015500 5ustar rootrootgfarm-2.4.1/doc/docbook/ja/ref/man3/gfarm_url_program_register.3.docbook0000644000000000000000000000444611507222721024624 0ustar rootroot 10 Sep 2002 gfarm_url_program_register 3 Gfarm gfarm_url_program_register ¥×¥í¥°¥é¥à¤òÅÐÏ¿¤¹¤ë #include <gfarm/gfarm.h> char *gfarm_url_program_register char *gfarm_url char *architecture char *filename int nreplicas DESCRIPTION °ú¿ô architecture ¤Ç»ØÄꤷ¤¿µ¡¼ï¸þ¤±¤Î¼Â¹Ô·Á¼°¥Õ¥¡¥¤¥ë filename ¤ò¡¢ gfarm_url ¤Ç»ØÄꤷ¤¿¥Ñ¥¹Ì¾¤ËÅÐÏ¿¤·¤Þ¤¹¡£ ¤Þ¤¿¡¢ nreplicas ¤Ë¡¢ºîÀ®¤¹¤ë¥ì¥×¥ê¥«¤Î¿ô¤ò»ØÄꤷ¤Þ¤¹¡£ °ú¿ô nreplicas ¤Ï¡¢¾­Íè¤Î¥Ð¡¼¥¸¥ç¥ó¤Çºï½ü¤µ¤ì¤ëͽÄê¤Ç¤¹¡£ RETURN VALUES NULL Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ GFARM_ERR_NO_MEMORY ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ GFARM_ERR_OPERATION_NOT_PERMITTED »ØÄꤷ¤¿¥Õ¥¡¥¤¥ë¤Ë¡¢¼Â¹Ô²Äǽ¥Ó¥Ã¥È¤¬Î©¤Ã¤Æ¤¤¤Þ¤»¤ó¤Ç¤·¤¿¡£ ¤½¤Î¾ ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ SEE ALSO gfarm_url_program_deliver3 gfarm-2.4.1/doc/docbook/ja/ref/man3/gfs_stat_free.3.docbook0000644000000000000000000000207711507222721022024 0ustar rootroot 1 May 2002 gfs_stat_free 3 Gfarm gfs_stat_free ¥Õ¥¡¥¤¥ë°À­¾ðÊó²òÊü #include <gfarm/gfarm.h> void gfs_stat_free struct gfs_stat * status DESCRIPTION gfs_stat(3) ¤Ç¼èÆÀ¤·¤¿Â°À­¾ðÊó¤ÎÊÝ»ý¤¹¤ë¥á¥â¥ê¤ò²òÊü¤·¤Þ¤¹¡£ SEE ALSO gfs_stat3 gfarm-2.4.1/doc/docbook/ja/ref/man3/gfs_stat.3.docbook0000644000000000000000000000503711507222721021022 0ustar rootroot 1 May 2002 gfs_stat 3 Gfarm gfs_stat ¥Õ¥¡¥¤¥ë°À­¼èÆÀ #include <gfarm/gfarm.h> char *gfs_stat const char * gfarm_url struct gfs_stat * status DESCRIPTION °ú¿ô gfarm_url ¤Î¥Õ¥¡¥¤¥ë°À­¤ò status ¤Î»Ø¤¹Àè¤Ë¼èÆÀ¤·¤Þ¤¹¡£ status ¤Ë¤Ï¡¢Æ°Åª¤Ë³ÎÊݤµ¤ì¤¿¥á¥â¥ê¤Ø¤Î¥Ý¥¤¥ó¥¿¤¬´Þ¤Þ¤ì¤ë¤Î¤Ç¡¢ ¤³¤Î¸å¡¢gfs_stat_free(3) ¤ò»È¤Ã¤Æ¤½¤Î¥á¥â¥ê¤ò²òÊü¤¹¤ëɬÍפ¬ ¤¢¤ê¤Þ¤¹¡£ RETURN VALUES NULL Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ GFARM_ERR_NO_MEMORY ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ GFARM_ERR_AUTHENTICATION gfmd(8) ¤ËÂФ¹¤ë¥æ¡¼¥¶¡¼Ç§¾Ú¤¬¼ºÇÔ¤·¤Þ¤·¤¿¡£ GFARM_ERR_PERMISSION_DENIED »ØÄꤵ¤ì¤¿¥Ñ¥¹¤Ø¥¢¥¯¥»¥¹¤¹¤ë¸¢¸Â¤¬¡¢¤¢¤ê¤Þ¤»¤ó¡£ GFARM_ERR_NO_SUCH_OBJECT »ØÄꤵ¤ì¤¿¥Ñ¥¹Ì¾¤¬Â¸ºß¤·¤Þ¤»¤ó¡£ GFARM_ERR_NOT_A_DIRECTORY »ØÄꤷ¤¿¥Ñ¥¹Ì¾¤Î¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤¬¡¢¼ÂºÝ¤Ë¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤«¤Ã¤¿¤³¤È¤ò ¼¨¤·¤Þ¤¹¡£ ¤½¤Î¾ ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ SEE ALSO gfs_stat_free3 gfarm-2.4.1/doc/docbook/ja/ref/man3/gfarm_stringlist_length.3.docbook0000644000000000000000000000374511507222721024133 0ustar rootroot 1 May 2002 gfarm_stringlist_length 3 Gfarm gfarm_stringlist_length stringlist ¤Îʸ»úÎó¿ô¤òÊÖ¤¹ #include <gfarm/gfarm.h> int gfarm_stringlist_length gfarm_stringlist * listp DESCRIPTION listp ¤Îɽ¤¹Ê¸»úÎóÇÛÎó¤ÎÇÛÎóÍ×ÁÇ¿ô¤òÊÖ¤·¤Þ¤¹¡£ RETURN VALUES ʸ»úÎó¤Î¿ô¤òÊÖ¤·¤Þ¤¹¡£ SEE ALSO GFARM_STRINGLIST_ELEM3, GFARM_STRINGLIST_STRARRAY3, gfarm_stringlist_add3, gfarm_stringlist_cat3, gfarm_stringlist_elem3, gfarm_stringlist_free3, gfarm_stringlist_free_deeply3, gfarm_stringlist_init3 gfarm-2.4.1/doc/docbook/ja/ref/man3/gfs_pio_set_local.3.docbook0000644000000000000000000000340511507222721022660 0ustar rootroot 1 May 2002 gfs_pio_set_local 3 Gfarm gfs_pio_set_local ¥í¡¼¥«¥ë¥Õ¥¡¥¤¥ë¥Ó¥å¡¼¤Î½é´ü²½ #include <gfarm/gfarm.h> char *gfs_pio_set_local int node int nnode DESCRIPTION ¥í¡¼¥«¥ë¥Õ¥¡¥¤¥ë¥Ó¥å¡¼¤òÍøÍѤ¹¤ëÊÂÎó¥×¥í¥»¥¹¤Ï¡¢¤½¤Î½èÍý¤ÎºÇ½é¤Ë¡¢ ¤½¤Î¥Î¡¼¥É¤Î¥Î¡¼¥ÉÈÖ¹æ¤ò node ¤Ë¡¢ÊÂÎó¥×¥í¥»¥¹¤ò¹½À®¤¹¤ëÁí¥Î¡¼¥É¿ô¤ò nnode ¤ËÍ¿¤¨¤Æ¡¢¤³¤Î´Ø¿ô¤ò¸Æ¤Ó½Ð¤·¤Þ¤¹¡£ RETURN VALUES NULL Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ ¤½¤Î¾ ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ SEE ALSO gfs_pio_set_view_local3, gfs_pio_set_view_index3 gfarm-2.4.1/doc/docbook/ja/ref/man3/gfarm_stringlist_free.3.docbook0000644000000000000000000000433111507222721023563 0ustar rootroot 1 May 2002 gfarm_stringlist_free 3 Gfarm gfarm_stringlist_free gfarm_stringlist_free_deeply stringlist ¤ò²òÊü¤¹¤ë #include <gfarm/gfarm.h> void gfarm_stringlist_free gfarm_stringlist * listp void gfarm_stringlist_free_deeply gfarm_stringlist * listp DESCRIPTION ưŪ¤Ë³ÎÊݤ·¤¿¥á¥â¥ê¤ò²òÊü¤·¤Þ¤¹¡£ ´Ø¿ô gfarm_stringlist_free() ¤Ï¡¢ÊÑ¿ô listp ¤¬É½¤¹Ê¸»úÎóÇÛÎó¤ÎÍ×ÁǤǤ¢¤ë³ÆÊ¸»úÎó¤Ë¤Ä¤¤¤Æ¤Ï²òÊü¤·¤Þ¤»¤ó¡£ ¤³¤ì¤ËÂФ·¡¢´Ø¿ô gfarm_stringlist_free_deeply() ¤Ï¡¢Ê¸»úÎóÇÛÎó¤ÎÍ×ÁÇ¤Ç ¤¢¤ë³ÆÊ¸»úÎó¤â²òÊü¤·¤Þ¤¹¡£ SEE ALSO GFARM_STRINGLIST_ELEM3, GFARM_STRINGLIST_STRARRAY3, gfarm_stringlist_add3, gfarm_stringlist_cat3, gfarm_stringlist_elem3, gfarm_stringlist_init3, gfarm_stringlist_length3 gfarm-2.4.1/doc/docbook/ja/ref/man3/gfs_pio_datasync.3.docbook0000644000000000000000000000431111507222721022516 0ustar rootroot 1 Jun 2005 gfs_pio_datasync 3 Gfarm gfs_pio_datasync ¥á¥â¥ê¾å¤Î¥Õ¥¡¥¤¥ë¤ÎÆâÍÆ¤ò¥Ç¥£¥¹¥¯¤ËÈ¿±Ç¤µ¤»¤ë #include <gfarm/gfarm.h> char *gfs_pio_datasync GFS_File gf DESCRIPTION ½ñ¤­¹þ¤ßÍѤ˥ª¡¼¥×¥ó¤·¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë gf ¤Î¡¢¥á¥â¥ê¾å¤Ë¤¢¤ë¥Ç¡¼¥¿¤ò¼ÂºÝ¤Ë¥Ç¥£¥¹¥¯¤Ë½ñ¤­¹þ¤ß¡¤ Æþ½ÐÎϤδ°Î»¤òÂԤäƤ«¤éÌá¤ê¤Þ¤¹¡¥¥á¥¿¥Ç¡¼¥¿¤Ï¹¹¿·¤·¤Þ¤»¤ó¡¥ Ê̤δؿô gfs_pio_sync ¤Ï¡¤¥Õ¥¡¥¤¥ë¥Ç¡¼¥¿¤Ë²Ã¤¨¤Æ¥á¥¿¥Ç¡¼¥¿¤â¥Ç¥£¥¹¥¯¤Ë½ñ¤­¹þ¤ß¤Þ¤¹¡¥ RETURN VALUES NULL Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡¥ GFARM_ERR_NO_MEMORY ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡¥ ¤½¤Î¾ ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡¥ SEE ALSO gfs_pio_sync3, gfs_pio_create3, gfs_pio_open3, gfs_pio_write3, gfs_pio_flush3 gfarm-2.4.1/doc/docbook/ja/ref/man3/Makefile.inc0000644000000000000000000000266611507222721017722 0ustar rootrootDOCBOOK = \ gfarm.3 \ gfarm_initialize.3 \ gfarm_terminate.3 \ gfs_pio_close.3 \ gfs_pio_create.3 \ gfs_pio_open.3 \ gfs_pio_read.3 \ gfs_pio_write.3 #DOCBOOK = \ # gfarm_hostlist_read.3 \ # gfarm_import_fragment_config_read.3 \ # gfarm_import_fragment_size_alloc.3 \ # gfarm_stringlist_add.3 \ # gfarm_stringlist_cat.3 \ # gfarm_stringlist_elem.3 \ # gfarm_stringlist_free.3 \ # gfarm_stringlist_init.3 \ # gfarm_stringlist_length.3 \ # gfarm_strings_free_deeply.3 \ # gfarm_terminate.3 \ # gfarm_url_fragments_replicate.3 \ # gfarm_url_hosts_schedule.3 \ # gfarm_url_program_deliver.3 \ # gfarm_url_program_register.3 \ # gfarm_url_section_replicate_from_to.3 \ # gfarm_url_section_replicate_to.3 \ # gfs_chdir.3 \ # gfs_chmod.3 \ # gfs_closedir.3 \ # gfs_mkdir.3 \ # gfs_opendir.3 \ # gfs_pio_datasync.3 \ # gfs_pio_eof.3 \ # gfs_pio_error.3 \ # gfs_pio_flush.3 \ # gfs_pio_getc.3 \ # gfs_pio_getline.3 \ # gfs_pio_gets.3 \ # gfs_pio_putc.3 \ # gfs_pio_puts.3 \ # gfs_pio_putline.3 \ # gfs_pio_puts.3 \ # gfs_pio_readdelim.3 \ # gfs_pio_readline.3 \ # gfs_pio_seek.3 \ # gfs_pio_sync.3 \ # gfs_pio_set_local.3 \ # gfs_pio_set_view_index.3 \ # gfs_pio_set_view_local.3 \ # gfs_pio_truncate.3 \ # gfs_pio_ungetc.3 \ # gfs_readdir.3 \ # gfs_rename.3 \ # gfs_realpath.3 \ # gfs_rmdir.3 \ # gfs_stat.3 \ # gfs_stat_free.3 \ # gfs_unlink.3 \ # gfs_unlink_section.3 \ # gfs_utimes.3 \ # gfs_glob_init.3 \ # gfs_glob.3 \ # gfs_glob_add.3 \ # gfs_glob_free.3 gfarm-2.4.1/doc/docbook/ja/ref/man3/gfarm_hostlist_read.3.docbook0000644000000000000000000000456011507222721023230 0ustar rootroot 1 May 2002 gfarm_hostlist_read 3 Gfarm gfarm_hostlist_read ¥Û¥¹¥È¹½À®¥Õ¥¡¥¤¥ë¤òÆÉ¤ß¹þ¤à #include <gfarm/gfarm.h> char *gfarm_hostlist_read char *filename int *np char ***line_table_p int *error_line_p DESCRIPTION Gfarm¥Õ¥¡¥¤¥ë¤ò¥¤¥ó¥Ý¡¼¥È¤¹¤ë¥¢¥×¥ê¥±¡¼¥·¥ç¥óÍѤÎÊä½õ´Ø¿ô¤Î°ì¤Ä¤Ç¤¹¡£ ¥Û¥¹¥È¹½À®¥Õ¥¡¥¤¥ë̾¤ò filename ¤Ë»ØÄꤹ¤ë¤È¡¢¤½¤Î¥Õ¥¡¥¤¥ë¤«¤é¡¢ ¥Û¥¹¥È¤ÎÇÛÎó¤ò line_table_p ¤Î»Ø¤¹Àè¤Ë¤ËÊÖ¤·¤Þ¤¹¡£ ¹½À®¥Õ¥¡¥¤¥ë¤Ë¹½Ê¸¥¨¥é¡¼¤¬À¸¤¸¤¿¾ì¹ç¤Ë¤Ï¡¢ error_line_p ¤Î»Ø¤¹Àè¤Ë¡¢¥Õ¥¡¥¤¥ë¤Î¹ÔÈÖ¹æ¤òÊÖ¤·¤Þ¤¹¡£¤³¤ÎÃͤ¬ -1 ¤Î¾ì¹ç¤Ë¤Ï¡¢¹½Ê¸°Ê³°¤Î¥¨¥é¡¼¸¶°ø¤Ç¤¹¡£ ¤³¤³¤ÇÆÀ¤¿¥Û¥¹¥È¤ÎÇÛÎó¤Ï gfarm_strings_free_deeply() ¤òÍѤ¤¤Æ²òÊü ¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£ RETURN VALUES NULL Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ GFARM_ERR_NO_MEMORY ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ ¤½¤Î¾ ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ SEE ALSO gfarm_import_fragment_config_read3, gfarm_import_fragment_size_alloc3 gfarm-2.4.1/doc/docbook/ja/ref/man3/gfs_pio_gets.3.docbook0000644000000000000000000000751211507222721021660 0ustar rootroot 13 May 2004 gfs_pio_gets 3 Gfarm gfs_pio_gets °ì¹ÔÆÉ¤ß¹þ¤ß #include <gfarm/gfarm.h> char *gfs_pio_gets GFS_File f char * s size_t size DESCRIPTION ¥Õ¥¡¥¤¥ë gf ¤«¤é¡¢Ê¸»úÎó s ¤Ë¡¢°ì¹ÔÆÉ¤ß¹þ¤ß¤Þ¤¹¡£ °ú¿ô size ¤Ëʸ»úÇÛÎó s ¤ÎÂ礭¤µ¤ò»ØÄꤷ¤Þ¤¹¡£ ´Ø¿ô gfs_pio_getline(3) ¤È°Û¤Ê¤ê¡¢¤³¤Î´Ø¿ô¤Ï¹ÔËö¤Î²þ¹Ôµ­¹æ¤òºï½ü ¤·¤Þ¤»¤ó¡£°ì¹Ô¤ÎÆâÍÆ¤òʸ»úÇÛÎó¤ËǼ¤á¤­¤ì¤Ê¤¤¾ì¹ç¡¢¤¢¤ë¤¤¤Ï¥Õ¥¡¥¤¥ë ËöÈø¤Ë²þ¹Ôµ­¹æ¤¬Â¸ºß¤·¤Ê¤¤¾ì¹ç¡¢ÆþÎÏ·ë²Ì¤Îʸ»úÇÛÎó¤ÎËöÈø¤Ë²þ¹Ôµ­¹æ ¤¬¤Ä¤­¤Þ¤»¤ó¡£¤·¤«¤·Ê¸»úÎó¤Î½ª¤ï¤ê¤ò¼¨¤¹ '\0' ʸ»ú¤Ï¡¢¤É¤Á¤é¤Î¾ì¹ç ¤Ç¤âÉղ䵤ì¤Þ¤¹¡£ EOF ¤Ï¡¢ÆþÎÏ·ë²Ì¤Îʸ»úÇÛÎó¤ÎŤµ¤¬ 0 ʸ»ú¤Ç¤¢¤ë¤³¤È¤ÇȽÃǤ·¤Þ¤¹¡£ RETURN VALUES NULL Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ GFARM_ERR_NO_MEMORY ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ ¤½¤Î¾ ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ EXAMPLES <function>gfs_pio_gets</function> ´Ø¿ô¤Î»ÈÍÑÎã #include <stdio.h> #include <stdlib.h> #include <gfarm/gfarm.h> int main(int argc, char **argv) { char *e; GFS_File gf; char buffer[512]; e = gfarm_initialize(&argc, &argv); if (e != NULL) { fprintf(stderr, "gfarm_initialize: %s\n", e); return (EXIT_FAILURE); } if (argc <= 1) { fprintf(stderr, "missing gfarm filename\n"); return (EXIT_FAILURE); } e = gfs_pio_open(argv[1], GFARM_FILE_RDONLY, &gf); if (e != NULL) { fprintf(stderr, "%s: %s\n", argv[1], e); return (EXIT_FAILURE); } e = gfs_pio_set_view_global(gf, 0); if (e != NULL) { fprintf(stderr, "%s: gfs_pio_set_view_global: %s\n", argv[1], e); return (EXIT_FAILURE); } while ((e = gfs_pio_gets(gf, buffer, sizeof buffer)) != NULL && *buffer != '\0') { printf("got: %s", buffer); } if (e != NULL) { fprintf(stderr, "ERROR: %s\n", e); return (EXIT_FAILURE); } e = gfs_pio_close(gf); if (e != NULL) { fprintf(stderr, "gfs_pio_close: %s\n", e); return (EXIT_FAILURE); } e = gfarm_terminate(); if (e != NULL) { fprintf(stderr, "gfarm_initialize: %s\n", e); return (EXIT_FAILURE); } return (EXIT_SUCCESS); } SEE ALSO gfs_pio_open3, gfs_pio_getline3, gfs_pio_readline3, gfs_pio_readdelim3 gfarm-2.4.1/doc/docbook/ja/ref/man3/gfs_pio_close.3.docbook0000644000000000000000000000405511507222721022022 0ustar rootroot 27 Jun 2010 gfs_pio_close 3 Gfarm gfs_pio_close Gfarm¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥Õ¥¡¥¤¥ë¤Î¥¯¥í¡¼¥º #include <gfarm/gfarm.h> gfarm_error_t gfs_pio_close GFS_File gfp DESCRIPTION ¥Õ¥¡¥¤¥ë gfp ¤ò¥¯¥í¡¼¥º¤·¤Þ¤¹¡£ RETURN VALUES GFARM_ERR_NO_ERROR Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ GFARM_ERR_BAD_FILE_DESCRIPTOR gfp ¤Ç»ØÄꤵ¤ì¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬ÉÔÀµ¤Ç¤¹¡£ GFARM_ERR_NO_MEMORY ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ ¤½¤Î¾ ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ gfarm_error_string3 ¤Ë¤è¤ê¥¨¥é¡¼¤Î¸¶°ø¤òʸ»úÎó¤ËÊÑ´¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ SEE ALSO gfs_pio_create3, gfs_pio_open3 gfarm-2.4.1/doc/docbook/ja/ref/man3/gfs_glob.3.docbook0000644000000000000000000000554211507222721020773 0ustar rootroot 2 Sep 2003 gfs_glob 3 Gfarm gfs_glob ¥Ñ¥¿¡¼¥ó¤Ë¥Þ¥Ã¥Á¤¹¤ë¥Ñ¥¹Ì¾¤ò¼èÆÀ¤¹¤ë #include <gfarm/gfarm.h> char *gfs_glob const char * pattern gfarm_stringlist * paths gfs_glob_t * types DESCRIPTION ¥ï¥¤¥ë¥É¥«¡¼¥É¤ò´Þ¤à°ú¿ô pattern ¤Ë¥Þ¥Ã¥Á¤¹¤ëÁ´¤Æ¤Î¥Ñ¥¹Ì¾¤ò paths ¤ËÊÖ¤·¤Þ¤¹¡£ ÊÖ¤µ¤ì¤¿¸Ä¡¹¤Î¥Ñ¥¹Ì¾¤ò»²¾È¤¹¤ë¤Ë¤Ï¡¢ gfarm_stringlist_length(3)¡¢ gfarm_stringlist_elem(3) ¤ò»È¤¤¤Þ¤¹¡£ gfs_glob(3) ¤ò»ÈÍѤ¹¤ëÁ°¤Ë¡¢°ú¿ô types ¤¬»Ø¤¹Îΰè¤ògfs_glob_init(3) ¤ÇưŪ¤Ë³ÎÊݤ·¡¢ »ÈÍѸå gfs_glob_free(3) ¤Ç²òÊü¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£ RETURN VALUES NULL Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ GFARM_ERR_NO_MEMORY ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ GFARM_ERR_PATHNAME_TOO_LONG ¥Ñ¥¿¡¼¥ó¤¢¤ë¤¤¤Ï¥Ñ¥¹Ì¾¤¬Ä¹¤¹¤®¤Æ½èÍý¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿¡£ ¤½¤Î¾ ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ SEE ALSO gfs_glob_init3 gfs_glob_free3 gfarm_stringlist_init3 gfarm_stringlist_length3 gfarm_stringlist_elem3 gfarm_stringlist_free3 gfarm_stringlist_free_deeply3 gfarm-2.4.1/doc/docbook/ja/ref/man3/gfs_pio_truncate.3.docbook0000644000000000000000000000436211507222721022543 0ustar rootroot 17 Nov 2004 gfs_pio_truncate 3 Gfarm gfs_pio_truncate »ØÄꤷ¤¿Ä¹¤µ¤Ë¥Õ¥¡¥¤¥ëÀÚ¤êµÍ¤á¤ë¡£¤â¤·¤¯¤Ï³ÈÄ¥¤¹¤ë¡£ #include <gfarm/gfarm.h> char *gfs_pio_truncate GFS_File gf file_offset_t length DESCRIPTION ¥Õ¥¡¥¤¥ë gf ¤ÎŤµ¤òÊѹ¹¤·¤Þ¤¹¡£ °ú¿ô length ¤¬¥Õ¥¡¥¤¥ë gf ¤è¤ê¤âû¤«¤±¤ì¤ÐÀÚ¤êµÍ¤á¤Þ¤¹¡£ °ú¿ô length ¤¬¥Õ¥¡¥¤¥ë gf ¤è¤ê¤âŤ±¤ì¤Ð³ÈÄ¥¤·¤Þ¤¹¡£³ÈÄ¥¤µ¤ì¤¿Éôʬ¤òÆÉ¤ó¤À¾ì¹ç¤Ï¥¼¥í¤òÊÖ¤·¤Þ¤¹¡£ ¥Õ¥¡¥¤¥ë¥Ý¥¤¥ó¥¿¤ÏÊѹ¹¤·¤Þ¤»¤ó¡£ ¥Õ¥¡¥¤¥ë¤Ï½ñ¤­¹þ¤ßÍѤ˥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£ ¤³¤Î¤¿¤á¡¢¥ª¡¼¥×¥ó»þ¤Ë GFS_FILE_MODE_WRITE ¥Õ¥é¥°¤ò»ØÄꤹ¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£ RETURN VALUES NULL Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ GFARM_ERR_NO_MEMORY ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ ¤½¤Î¾ ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ SEE ALSO gfs_pio_create3, gfs_pio_open3 gfarm-2.4.1/doc/docbook/ja/ref/man3/gfs_pio_read.3.docbook0000644000000000000000000000550211507222721021626 0ustar rootroot 27 Jun 2010 gfs_pio_read 3 Gfarm gfs_pio_read ¥Õ¥¡¥¤¥ë¤ÎÆÉ¤ß¹þ¤ß #include <gfarm/gfarm.h> gfarm_error_t gfs_pio_read GFS_File gf void * buffer int size int * np DESCRIPTION buffer¤«¤é size ¥Ð¥¤¥È¤À¤±¡¢¥Õ¥¡¥¤¥ë gf ¤ÎÆâÍÆ¤òÆÉ¤ß¹þ¤ß¤Þ¤¹¡£ ÆÉ¤ß¹þ¤Þ¤ì¤¿¥Ð¥¤¥È¿ô¤Ï np ¤Î»Ø¤¹Àè¤ËÊÖ¤·¤Þ¤¹¡£¤³¤ÎÃͤ¬ 0 ¤Î¾ì¹ç¤Ë¤Ï EOF ¤ò°ÕÌ£¤·¤Þ¤¹¡£ RETURN VALUES GFARM_ERR_NO_ERROR Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ GFARM_ERR_OPERATION_NOT_PERMITTED gf ¤Ç»ØÄꤵ¤ì¤ë¥Õ¥¡¥¤¥ë¤¬¥ì¥®¥å¥é¡¼¥Õ¥¡¥¤¥ë¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£ GFARM_ERR_BAD_FILE_DESCRIPTOR gf ¤Ç»ØÄꤵ¤ì¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬ÉÔÀµ¡¢ ¤¢¤ë¤¤¤ÏÆÉ¹þ²Äǽ¤Ç¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£ GFARM_ERR_NO_FILE_SYSTEM_NODE ÍøÍѲÄǽ¤Ê¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤¬¤¢¤ê¤Þ¤»¤ó¡£ GFARM_ERR_NO_MEMORY ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ ¤½¤Î¾ ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ gfarm_error_string3 ¤Ë¤è¤ê¥¨¥é¡¼¤Î¸¶°ø¤òʸ»úÎó¤ËÊÑ´¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ SEE ALSO gfs_pio_create3, gfs_pio_open3 gfarm-2.4.1/doc/docbook/ja/ref/man3/gfs_chdir.3.docbook0000644000000000000000000000417611507222721021143 0ustar rootroot 11 Sep 2003 gfs_chdir 3 Gfarm gfs_chdir ºî¶È¥Ç¥£¥ì¥¯¥È¥ê¤ÎÊѹ¹ #include <gfarm/gfarm.h> char *gfs_chdir const char * gfarm_url DESCRIPTION ºî¶È¥Ç¥£¥ì¥¯¥È¥ê¤ò°ú¿ô gfarm_url ¤Ë»ØÄꤷ¤¿¥Ç¥£¥ì¥¯¥È¥ê¤ËÊѹ¹¤·¤Þ¤¹¡£ RETURN VALUES NULL Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ GFARM_ERR_NO_MEMORY ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ GFARM_ERR_AUTHENTICATION gfmd(8) ¤ËÂФ¹¤ë¥æ¡¼¥¶¡¼Ç§¾Ú¤¬¼ºÇÔ¤·¤Þ¤·¤¿¡£ GFARM_ERR_PERMISSION_DENIED »ØÄꤷ¤¿¥Ç¥£¥ì¥¯¥È¥ê¤ËÊѹ¹¤¹¤ë¸¢¸Â¤¬¤¢¤ê¤Þ¤»¤ó¡£ GFARM_ERR_NO_SUCH_OBJECT »ØÄꤵ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¤¬Â¸ºß¤·¤Þ¤»¤ó¡£ GFARM_ERR_NOT_A_DIRECTORY »ØÄꤷ¤¿¥Ñ¥¹Ì¾¤Î¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤¬¡¢¼ÂºÝ¤Ë¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤«¤Ã¤¿¤³¤È¤ò ¼¨¤·¤Þ¤¹¡£ ¤½¤Î¾ ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ gfarm-2.4.1/doc/docbook/ja/ref/man3/gfarm_import_fragment_size_alloc.3.docbook0000644000000000000000000000455311507222721025767 0ustar rootroot 1 May 2002 gfarm_import_fragment_size_alloc 3 Gfarm gfarm_import_fragment_size_alloc ¥Õ¥é¥°¥á¥ó¥È¥µ¥¤¥º¤ÎÇÛÎó¤ò³ä¤êÅö¤Æ¤ë #include <gfarm/gfarm.h> file_offset_t *gfarm_import_fragment_size_alloc file_offset_t total_size int n DESCRIPTION Gfarm¥Õ¥¡¥¤¥ë¤ò¥¤¥ó¥Ý¡¼¥È¤¹¤ë¥¢¥×¥ê¥±¡¼¥·¥ç¥óÍѤÎÊä½õ´Ø¿ô¤Î°ì¤Ä¤Ç¤¹¡£ ¥¤¥ó¥Ý¡¼¥È½èÍý¤Ë¤Ï¡¢¥Õ¥¡¥¤¥ë¤ò¡¢¤É¤ì¤¯¤é¤¤¤Î¥µ¥¤¥º¤Î¥Õ¥é¥°¥á¥ó¥È¤Ë ʬ³ä¤¹¤ë¤«¤È¤¤¤¦¾ðÊó¤¬É¬ÍפǤ¹¡£¸µ¥Õ¥¡¥¤¥ë¤Î¥µ¥¤¥º¤ò°ú¿ô total_size ¤Ë¡¢¥Õ¥é¥°¥á¥ó¥È¿ô¤ò°ú¿ô n ¤ËÍ¿¤¨¤ë¤È¡¢¤³¤Î´Ø¿ô¤Ï·ë²Ì¤È¤·¤Æ¡¢³Æ¥Õ¥é¥°¥á¥ó¥È¤Îʬ³ä¥µ¥¤¥º¤ÎÌܰ¤ò¡¢ Í×ÁÇ¿ô n ¤ÎÇÛÎó¤È¤·¤ÆÊÖ¤·¤Þ¤¹¡£ ¤³¤Î´Ø¿ô¤È gfarm_hostlist_read(3) ´Ø¿ô¤Î·ë²Ì¤òÁȤ߹ç¤ï¤»¤ë¤³¤È¤Ë¤è¤Ã¤Æ¡¢ gfarm_import_fragment_config_read(3) ´Ø¿ô¤¬ÊÖ¤¹¥Õ¥é¥°¥á¥ó¥Èʬ³ä¾ðÊó ¤ÈƱ¤¸·Á¼°¤Î¾ðÊó¤òÆÀ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ ¤³¤Î´Ø¿ô¤ÇÆÀ¤¿ÇÛÎó¤Ï free(3) ¤òÍѤ¤¤Æ²òÊü¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£ RETURN VALUES NULL ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ ¤½¤Î¾ ½èÍý¤ËÀ®¸ù¤·¤¿¾ì¹ç¡¢ file_offset_t ·¿¤ÎÇÛÎó¤ÎÀèÆ¬Í×ÁǤؤΥݥ¤¥ó¥¿¤òÊÖ¤·¤Þ¤¹¡£ SEE ALSO gfarm_hostlist_read3, gfarm_import_fragment_config_read3 gfarm-2.4.1/doc/docbook/ja/ref/man3/gfs_pio_open.3.docbook0000644000000000000000000002236711507222721021664 0ustar rootroot 26 Jun 2010 gfs_pio_open 3 Gfarm gfs_pio_open Gfarm¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥Õ¥¡¥¤¥ë¤Î¥ª¡¼¥×¥ó #include <gfarm/gfarm.h> gfarm_error_t gfs_pio_open const char * gfarm_url int flags GFS_File * gfp DESCRIPTION gfarm_url ¤Ç»ØÄꤷ¤¿¥Õ¥¡¥¤¥ë¤ò¥ª¡¼¥×¥ó¤·¡¢GFS_File ¹½Â¤ÂΤò gfp ¤Î»Ø¤¹Àè¤ËÊÖ¤·¤Þ¤¹¡£ gfarm_url ¤ÏGfarm¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥Ñ¥¹Ì¾¡¢¤¢¤ë¤¤¤Ï gfarm://metaserver:port/path/name ·Á¼°¤ÎGfarm URL¤Ç¤¹¡£ flags ¤Ï¡¢°Ê²¼¤Î¥Õ¥é¥°¤Î bitwise-or ¤Ç»ØÄꤷ¤Þ¤¹¡£ ¤Ï¤¸¤á¤Î»°¤Ä¤Î¥Õ¥é¥°¤Ï¤É¤ì¤«¤¬»ØÄꤵ¤ì¤Æ¤¤¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£ GFARM_FILE_RDONLY ÆÉ¹þ¤ß¥â¡¼¥É¤Ç¥Õ¥¡¥¤¥ë¤ò¥ª¡¼¥×¥ó¤·¤Þ¤¹¡£ GFARM_FILE_WRONLY ½ñ¹þ¤ß¥â¡¼¥É¤Ç¥Õ¥¡¥¤¥ë¤ò¥ª¡¼¥×¥ó¤·¤Þ¤¹¡£ GFARM_FILE_RDWR ÆÉ¤ß½ñ¤­¥â¡¼¥É¤Ç¥Õ¥¡¥¤¥ë¤ò¥ª¡¼¥×¥ó¤·¤Þ¤¹¡£ GFARM_FILE_TRUNC ¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¡¢¥ì¥®¥å¥é¡¼¥Õ¥¡¥¤¥ë¤Ç½ñ¹þ¤ß¤¬µö¤µ¤ì¤ë¾ì¹ç¡¢¥Õ¥¡¥¤¥ë¥µ¥¤¥º¤ò0¤Ë¤·¤Þ¤¹¡£ RETURN VALUES GFARM_ERR_NO_ERROR Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ GFARM_ERR_IS_A_DIRECTORY »ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤¹¡£ GFARM_ERR_IS_A_SYMBOLIC_LINK »ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤Ï¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Ç¤¹¡£ GFARM_ERR_OPERATION_NOT_PERMITTED »ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤Ï¥Õ¥¡¥¤¥ë¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£ GFARM_ERR_NO_SUCH_OBJECT »ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Þ¤»¤ó¡£ GFARM_ERR_NOT_A_DIRECTORY »ØÄꤷ¤¿¥Ñ¥¹Ì¾¤Î¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤¬¡¢¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£ GFARM_ERR_PERMISSION_DENIED »ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤ËÂФ·¡¢ flags ¤Ç»ØÄꤵ¤ì¤¿¥â¡¼¥É¤Ç¥¢¥¯¥»¥¹¤¹¤ë¸¢¸Â¤¬¤Ê¤¤¤«¡¢ ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤Ø¤Îǧ¾Ú¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£ GFARM_ERR_NO_MEMORY ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ GFARM_ERR_INVALID_ARGUMENT flags ¤Î»ØÄ꤬ÉÔÀµ¤Ç¤¹¡£ GFARM_ERR_GFARM_URL_HOST_IS_MISSING gfarm_url ¤Ç»ØÄꤵ¤ì¤¿Gfarm URL¤Ë¤ª¤¤¤Æ¡¢ ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤¬»ØÄꤵ¤ì¤Æ¤¤¤Þ¤»¤ó¡£ GFARM_ERR_GFARM_URL_PORT_IS_MISSING gfarm_url ¤Ç»ØÄꤵ¤ì¤¿Gfarm URL¤Ë¤ª¤¤¤Æ¡¢ ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤Î¥Ý¡¼¥ÈÈֹ椬»ØÄꤵ¤ì¤Æ¤¤¤Þ¤»¤ó¡£ GFARM_ERR_UNKNOWN_HOST »ØÄꤵ¤ì¤¿¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤Î¥¢¥É¥ì¥¹²ò·è¤¬¤Ç¤­¤Þ¤»¤ó¡£ GFARM_ERR_TOO_MANY_OPEN_FILES ¥×¥í¥»¥¹¤Ë¤ª¤±¤ë¥ª¡¼¥×¥ó²Äǽ¤Ê¥Õ¥¡¥¤¥ë¿ô¤Î¸Â³¦¤Ë㤷¤Þ¤·¤¿¡£ GFARM_ERR_TOO_MANY_OPEN_FILES_IN_SYSTEM ¥·¥¹¥Æ¥à¤Ë¤ª¤±¤ë¥ª¡¼¥×¥ó¤Ç¤­¤ë¥Õ¥¡¥¤¥ë¿ô¤Î¸Â³¦¤Ë㤷¤Þ¤·¤¿¡£ GFARM_ERR_NETWORK_IS_UNREACHABLE ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤ËÅþã¤Ç¤­¤Þ¤»¤ó¡£ GFARM_ERR_OPERATION_TIMED_OUT ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤Ø¤ÎÀܳ¤¬¥¿¥¤¥à¥¢¥¦¥È¤ò¤ª¤³¤·¤Þ¤·¤¿¡£ GFARM_ERR_PROTOCOL ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤È¤ÎÄÌ¿®¤Ë¥×¥í¥È¥³¥ë¥¨¥é¡¼¤¬È¯À¸¤·¤Þ¤·¤¿¡£ GFARM_ERR_BROKEN_PIPE ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤È¤ÎÄÌ¿®¤¬ÀÚÃǤ·¤Þ¤·¤¿¡£ GFARM_ERR_PROTOCOL_NOT_SUPPORTED »ØÄꤵ¤ì¤¿Ç§¾Ú¥×¥í¥È¥³¥ë¤Ï¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Þ¤»¤ó¡£ GFARM_ERR_AUTHENTICATION ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤ËÂФ¹¤ëǧ¾Ú¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£ ¤½¤Î¾ ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ gfarm_error_string3 ¤Ë¤è¤ê¥¨¥é¡¼¤Î¸¶°ø¤òʸ»úÎó¤ËÊÑ´¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ SEE ALSO gfs_pio_close3, gfs_pio_create3, gfs_pio_eof3, gfs_pio_error3, gfs_pio_flush3, gfs_pio_getc3, gfs_pio_getline3, gfs_pio_open3, gfs_pio_putc3, gfs_pio_putline3, gfs_pio_puts3, gfs_pio_read3, gfs_pio_seek3, gfs_pio_ungetc3, gfs_pio_write3 gfarm-2.4.1/doc/docbook/ja/ref/man3/gfs_pio_write.3.docbook0000644000000000000000000000601211507222721022042 0ustar rootroot 27 Jun 2010 gfs_pio_write 3 Gfarm gfs_pio_write ¥Õ¥¡¥¤¥ë¤Î½ñ¤­¹þ¤ß #include <gfarm/gfarm.h> gfarm_error_t gfs_pio_write GFS_File gf const void * buffer int size int * np DESCRIPTION buffer¤«¤é size ¥Ð¥¤¥È¤À¤±¡¢¥Õ¥¡¥¤¥ë gf ¤Ø½ñ¤­¹þ¤ß¤Þ¤¹¡£ ¼ÂºÝ¤Ë½ñ¤­¹þ¤Þ¤ì¤¿¥Ð¥¤¥È¿ô¤Ï np ¤Î»Ø¤¹Àè¤ËÊÖ¤·¤Þ¤¹¡£ RETURN VALUES GFARM_ERR_NO_ERROR Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ GFARM_ERR_OPERATION_NOT_PERMITTED gf ¤Ç»ØÄꤵ¤ì¤ë¥Õ¥¡¥¤¥ë¤¬¥ì¥®¥å¥é¡¼¥Õ¥¡¥¤¥ë¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£ GFARM_ERR_BAD_FILE_DESCRIPTOR gf ¤Ç»ØÄꤵ¤ì¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬ÉÔÀµ¡¢ ¤¢¤ë¤¤¤Ï½ñ¹þ²Äǽ¤Ç¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£ GFARM_ERR_NO_SPACE ½ñ¤­¹þ¤ß¥¹¥Ú¡¼¥¹¤¬¤¢¤ê¤Þ¤»¤ó¡£ GFARM_ERR_NO_FILE_SYSTEM_NODE ÍøÍѲÄǽ¤Ê¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤¬¤¢¤ê¤Þ¤»¤ó¡£ GFARM_ERR_NO_MEMORY ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ ¤½¤Î¾ ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ gfarm_error_string3 ¤Ë¤è¤ê¥¨¥é¡¼¤Î¸¶°ø¤òʸ»úÎó¤ËÊÑ´¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ SEE ALSO gfs_pio_create3, gfs_pio_flush3, gfs_pio_open3 gfarm-2.4.1/doc/docbook/ja/ref/man3/gfarm_strings_free_deeply.3.docbook0000644000000000000000000000206611507222721024417 0ustar rootroot 1 May 2002 gfarm_strings_free_deeply 3 Gfarm gfarm_strings_free_deeply ʸ»úÎó¤ò²òÊü¤¹¤ë #include <gfarm/gfarm.h> void gfarm_strings_free_deeply int n char ** strings DESCRIPTION Í×ÁÇ¿ô n ¤Îʸ»úÎóÇÛÎó strings ¤ò²òÊü¤·¤Þ¤¹¡£ ¤Þ¤¿¡¢ÇÛÎóÍ×ÁǤγÆÊ¸»úÎó¤â¡¢²òÊü¤·¤Þ¤¹¡£ gfarm-2.4.1/doc/docbook/ja/ref/man3/gfs_pio_readline.3.docbook0000644000000000000000000001206511507222721022500 0ustar rootroot 13 May 2004 gfs_pio_readline 3 Gfarm gfs_pio_readline °ì¹ÔÆÉ¤ß¹þ¤ß #include <gfarm/gfarm.h> char *gfs_pio_readline GFS_File f char **bufp size_t *sizep size_t *lenp DESCRIPTION ¥Õ¥¡¥¤¥ë gf ¤«¤é¡¢°ì¹ÔÆÉ¤ß¹þ¤ß¤Þ¤¹¡£ °ú¿ô bufp ¤Ï¡¢ºÇ½é¤Ï NULL ¤Ç½é´ü²½¤µ¤ì¤¿¥Ý¥¤¥ó¥¿ÊÑ¿ô¤Î¥¢¥É¥ì¥¹¤ò»ØÄꤷ¤Þ¤¹¡£ ´Ø¿ô gfs_pio_readline() ¤Ï¡¢Æþ½ÐÎϤËÍѤ¤¤ë ¥Ð¥Ã¥Õ¥¡¤òưŪ¤Ë³ä¤êÅö¤Æ¡¢¤½¤Î¥¢¥É¥ì¥¹¤ò¤³¤Î¥Ý¥¤¥ó¥¿ÊÑ¿ô¤Ëµ­Ï¿¤·¤Þ¤¹¡£ °ú¿ô sizep ¤Ï¡¢0 ¤Ç½é´ü²½¤·¤¿ size_t ·¿¤ÎÊÑ¿ô ¤Î¥¢¥É¥ì¥¹¤ò»ØÄꤷ¤Þ¤¹¡£¤³¤ÎÊÑ¿ô¤Ï¡¢¥Ð¥Ã¥Õ¥¡¤Î¥µ¥¤¥º¤òµ­Ï¿¤¹¤ë¤¿¤á¤Ë »È¤ï¤ì¤Þ¤¹¡£ ¤¢¤ë¤¤¤Ï¡¢malloc(3) ¤Ç³ä¤êÅö¤Æ¤¿¥Ð¥Ã¥Õ¥¡¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Î¥¢¥É¥ì¥¹¤ò °ú¿ô bufp ¤Ë»ØÄꤹ¤ë¤³¤È¤â¤Ç¤­¤Þ¤¹¡£¤³¤Î¾ì¹ç¡¢ °ú¿ô sizep ¤Ï¡¢³ä¤êÅö¤Æ¤¿¥Ð¥Ã¥Õ¥¡¤Î¥µ¥¤¥º¤Ç½é´ü²½¤·¤Æ¤ª¤­¤Þ¤¹¡£ ¹Ô¤ÎŤµ¤¬¥Ð¥Ã¥Õ¥¡¤Î¥µ¥¤¥º¤ò±Û¤¨¤ë¾ì¹ç¤Ë¤Ï¡¢¥Ð¥Ã¥Õ¥¡¤Ï¼«Æ°Åª¤Ë realloc(3) ¤µ¤ì¡¢ °ú¿ô bufp ¤ª¤è¤Ó °ú¿ô sizep ¤Ç»ØÄꤵ¤ì¤¿ÊÑ¿ô¤â¤½¤ì¤Ë½¾¤Ã¤Æ¹¹¿·¤µ¤ì¤Þ¤¹¡£ ¥Õ¥¡¥¤¥ë¤òÆÉ¤ß½ª¤ï¤Ã¤¿¤é¡¢¤³¤Î¥Ý¥¤¥ó¥¿¤ò free(3) ¤Ç²òÊü¤¹¤ëɬÍפ¬ ¤¢¤ê¤Þ¤¹¡£ °ú¿ô lenp ¤Î»Ø¤¹ÊÑ¿ô¤Ë¤Ï¡¢ÆÉ¤ß¹þ¤ó¤ÀŤµ¤òÊÖ¤·¤Þ¤¹¡£ ¤³¤ÎŤµ¤Ë¤Ï¡¢¹ÔËöµ­¹æ¤Îʬ¤â´Þ¤ß¤Þ¤¹¡£ ´Ø¿ô gfs_pio_gets(3) ¤ÈƱÍÍ¡¢¤³¤Î´Ø¿ô¤Ï¹ÔËö¤Î²þ¹Ôµ­¹æ¤òºï½ü¤·¤Þ¤»¤ó¡£ ¤Þ¤¿¡¢Ê¸»úÎó¤Î½ª¤ï¤ê¤ò¼¨¤¹ '\0' ʸ»ú¤ò¡¢¾ï¤ËÉղä·¤Þ¤¹¡£ ¤Þ¤¿¡¢ °ú¿ô lenp ¤Î»Ø¤¹ÊÑ¿ô¤ËÊ֤ä¿Ãͤò»È¤¨¤Ð¡¢Ê¸»ú '\0' ¤ò´Þ¤à¹Ô¤ò°·¤¦¤³¤È¤â¤Ç¤­¤Þ¤¹¡£ EOF ¤Ï¡¢ÆþÎϤÎŤµ¤¬ 0 ʸ»ú¤Ç¤¢¤ë¤³¤È¤ÇȽÃǤ·¤Þ¤¹¡£ ¤³¤Î´Ø¿ô¤Ï¡¢gfs_pio_readdelim(f, bufp, sizep, lenp, "\n", 1) ¤È Åù²Á¤Ç¤¹¡£ RETURN VALUES NULL Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ GFARM_ERR_NO_MEMORY ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ ¤³¤Î¾ì¹ç¤â¡¢bufp ¤Î»Ø¤¹¥Ý¥¤¥ó¥¿ÊÑ¿ô¤Î »Ø¤¹Îΰè¤ò free(3) ¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¤«¤éÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡£ ¤½¤Î¾ ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ EXAMPLES <function>gfs_pio_readline</function> ´Ø¿ô¤Î»ÈÍÑÎã #include <stdio.h> #include <stdlib.h> #include <gfarm/gfarm.h> int main(int argc, char **argv) { char *e; GFS_File gf; size_t bufsize = 0, len; char *buffer = NULL; e = gfarm_initialize(&argc, &argv); if (e != NULL) { fprintf(stderr, "gfarm_initialize: %s\n", e); return (EXIT_FAILURE); } if (argc <= 1) { fprintf(stderr, "missing gfarm filename\n"); return (EXIT_FAILURE); } e = gfs_pio_open(argv[1], GFARM_FILE_RDONLY, &gf); if (e != NULL) { fprintf(stderr, "%s: %s\n", argv[1], e); return (EXIT_FAILURE); } e = gfs_pio_set_view_global(gf, 0); if (e != NULL) { fprintf(stderr, "%s: gfs_pio_set_view_global: %s\n", argv[1], e); return (EXIT_FAILURE); } while ((e = gfs_pio_readline(gf, &buffer, &bufsize, &len)) == NULL && len > 0) { printf("<%6d/%6d >%s", len, bufsize, buffer); } if (buffer != NULL) free(buffer); if (e != NULL) { fprintf(stderr, "ERROR: %s\n", e); return (EXIT_FAILURE); } e = gfs_pio_close(gf); if (e != NULL) { fprintf(stderr, "gfs_pio_close: %s\n", e); return (EXIT_FAILURE); } e = gfarm_terminate(); if (e != NULL) { fprintf(stderr, "gfarm_initialize: %s\n", e); return (EXIT_FAILURE); } return (EXIT_SUCCESS); } SEE ALSO gfs_pio_open3, gfs_pio_getline3, gfs_pio_gets3, gfs_pio_readdelim3 gfarm-2.4.1/doc/docbook/ja/ref/man3/gfarm_url_section_replicate_to.3.docbook0000644000000000000000000000544011507222721025442 0ustar rootroot 4 Sep 2005 gfarm_url_section_replicate_to 3 Gfarm gfarm_url_section_replicate_to ¥Õ¥¡¥¤¥ë¥»¥¯¥·¥ç¥ó¤Î¥ì¥×¥ê¥«¤òºîÀ®¤¹¤ë #include <gfarm/gfarm.h> char *gfarm_url_section_replicate_to const char *gfarm_url char *section char *dsthost DESCRIPTION ¥Õ¥¡¥¤¥ë gfarm_url ¤Î¥Õ¥¡¥¤¥ë¥»¥¯¥·¥ç¥ó section ¤ÎÊ£À½¤ò¡¢ dsthost ¤ËºîÀ®¤·¤Þ¤¹¡£ ¥Õ¥¡¥¤¥ë¥»¥¯¥·¥ç¥ó¤È¤Ï¡¢¼Â¹Ô·Á¼°¤Î¥Õ¥¡¥¤¥ë¤Î¾ì¹ç¤Ï¥¢¡¼¥­¥Æ¥¯¥Á¥ã̾¡¢ Ä̾ï¥Õ¥¡¥¤¥ë¤Î¾ì¹ç¤Ï¥Õ¥¡¥¤¥ë¥¤¥ó¥Ç¥Ã¥¯¥¹ÈÖ¹æ¤È¤Ê¤ê¤Þ¤¹¡£ ¥Õ¥¡¥¤¥ë¥¤¥ó¥Ç¥Ã¥¯¥¹ÈÖ¹æ¤òÀ°¿ô¤Ç¤Ï¤Ê¤¯¡¢Ê¸»úÎó section ¤Ç»ØÄꤹ¤ëɬÍפ¬¤¢¤ë¤³¤È¤ËÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡£¤Þ¤¿¡¢¤Þ¤¿¤³¤Îʸ»úÎó¤Ï¡¢ ;ʬ¤Ê¶õÇò¤ä¡¢Àè¹Ô 0 ¤ò´Þ¤ó¤Ç¤Ï¤¤¤±¤Þ¤»¤ó¡£ RETURN VALUES NULL Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ GFARM_ERR_NO_MEMORY ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ GFARM_ERR_NO_SUCH_OBJECT »ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Þ¤»¤ó¡£ GFARM_ERR_TEXT_FILE_BUSY »ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤¬¸½ºß¡Ê¾¤Î¥×¥í¥»¥¹¤Ë¤è¤ê¡Ë¹¹¿·Ãæ¤Î¤¿¤á¡¢ ¥Õ¥¡¥¤¥ë¤ÎÊ£À½¤¬ºîÀ®¤Ç¤­¤Þ¤»¤ó¡£ ¤½¤Î¾ ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ SEE ALSO gfarm_url_section_replicate_from_to3, gfarm_url_fragments_replicate3 gfarm-2.4.1/doc/docbook/ja/ref/man3/gfarm_import_fragment_config_read.3.docbook0000644000000000000000000000513111507222721026074 0ustar rootroot 1 May 2002 gfarm_import_fragment_config_read 3 Gfarm gfarm_import_fragment_config_read ¥Õ¥é¥°¥á¥ó¥È¹½À®¥Õ¥¡¥¤¥ë¤òÆÉ¤ß¹þ¤à #include <gfarm/gfarm.h> char *gfarm_import_fragment_config_read char *config int *np char ***host_table_p file_offset_t **size_table_p int *error_line_p DESCRIPTION Gfarm¥Õ¥¡¥¤¥ë¤ò¥¤¥ó¥Ý¡¼¥È¤¹¤ë¥¢¥×¥ê¥±¡¼¥·¥ç¥óÍѤÎÊä½õ´Ø¿ô¤Î°ì¤Ä¤Ç¤¹¡£ import ¤Î¹½À®¥Õ¥¡¥¤¥ë̾¤ò config ¤Ë»ØÄꤹ¤ë¤È¡¢¤½¤Î¥Õ¥¡¥¤¥ë¤«¤é¡¢ ¥Û¥¹¥È¤ÎÇÛÎó¤ò host_table_p ¤Î»Ø¤¹Àè¤Ë¡¢¤Þ¤¿¡¢¥µ¥¤¥º¤ÎÇÛÎó¤ò size_table_p ¤Î»Ø¤¹Àè¤ËÊÖ¤·¤Þ¤¹¡£¹½À®¥Õ¥¡¥¤¥ë¤Ë¹½Ê¸¥¨¥é¡¼¤¬À¸¤¸¤¿¾ì¹ç¤Ë¤Ï¡¢ error_line_p ¤Î»Ø¤¹Àè¤Ë¡¢¥Õ¥¡¥¤¥ë¤Î¹ÔÈÖ¹æ¤òÊÖ¤·¤Þ¤¹¡£¤³¤ÎÃͤ¬ -1 ¤Î¾ì¹ç¤Ë¤Ï¡¢¹½Ê¸°Ê³°¤Î¥¨¥é¡¼¸¶°ø¤Ç¤¹¡£ ¹½À®¥Õ¥¡¥¤¥ë¤Ï¡¢³Æ¹Ô¤¬¡¢¶õÇò¤Ç¶èÀÚ¤é¤ì¤¿¥µ¥¤¥º¤È¥Û¥¹¥È̾¤«¤é¤Ê¤ë·Á¼°¤Ç¤¹¡£ ¤³¤³¤ÇÆÀ¤¿¥Û¥¹¥È¤ÎÇÛÎó¤Ï gfarm_strings_free_deeply() ¤òÍѤ¤¤Æ²òÊü ¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£ ¤Þ¤¿¡¢¤³¤³¤ÇÆÀ¤¿¥µ¥¤¥º¤ÎÇÛÎó¤Ï free() ¤òÍѤ¤¤Æ²òÊü¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£ RETURN VALUES NULL Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ GFARM_ERR_NO_MEMORY ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ ¤½¤Î¾ ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ SEE ALSO gfarm_hostlist_read3 gfarm-2.4.1/doc/docbook/ja/ref/man3/gfs_pio_putline.3.docbook0000644000000000000000000000340611507222721022374 0ustar rootroot 1 May 2002 gfs_pio_putline 3 Gfarm gfs_pio_putline °ì¹Ô½ñ¤­¹þ¤ß #include <gfarm/gfarm.h> char *gfs_pio_putline GFS_File gf char * s DESCRIPTION ʸ»úÎó s ¤ò¥Õ¥¡¥¤¥ë gf ¤Ë½ñ¤­¹þ¤ß¡¢¤½¤Î¸å²þ¹Ô¤ò½ñ¤­¹þ¤ß¤Þ¤¹¡£ RETURN VALUES NULL Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ GFARM_ERR_NO_MEMORY ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ ¤½¤Î¾ ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ SEE ALSO gfs_pio_create3, gfs_pio_open3 gfarm-2.4.1/doc/docbook/ja/ref/man3/gfs_utimes.3.docbook0000644000000000000000000000536711507222721021363 0ustar rootroot 4 Dec 2003 gfs_utimes 3 Gfarm gfs_utimes ¥Õ¥¡¥¤¥ë¥¢¥¯¥»¥¹»þ¹ï/½¤Àµ»þ¹ïÊѹ¹ #include <gfarm/gfarm.h> char *gfs_utimes const char * gfarm_url const struct gfarm_timespec * tsp DESCRIPTION °ú¿ô gfarm_url ¤Î¥Õ¥¡¥¤¥ë¥¢¥¯¥»¥¹»þ¹ï/½¤Àµ»þ¹ï¤ò tsp ¤ÎÃͤËÊѹ¹¤·¤Þ¤¹¡£ tsp[0] ¤ÎÃͤò¥¢¥¯¥»¥¹»þ¹ï¤Ë¡¢ tsp[1] ¤ÎÃͤò½¤Àµ»þ¹ï¤Ë»ÈÍѤ·¤Þ¤¹¡£ ¹½Â¤ÂÎ gfarm_timespec ¤Ï°Ê²¼¤Î¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£ struct gfarm_timespec { unsigned int tv_sec; /* seconds */ unsigned int tv_nsec; /* nanoseconds */ }; tsp ¤¬ NULL ¤Î¾ì¹ç¡¢¸½ºß¤Î»þ¹ï¤òÀßÄꤷ¤Þ¤¹¡£ RETURN VALUES NULL Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ GFARM_ERR_GFARM_URL_PREFIX_IS_MISSING ¥Õ¥¡¥¤¥ë̾¤Ë Gfarm URL ¤Î gfarm: ¤¬¤¢¤ê¤Þ¤»¤ó¡£ GFARM_ERR_NO_MEMORY ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ GFARM_ERR_AUTHENTICATION gfmd(8) ¤ËÂФ¹¤ë¥æ¡¼¥¶¡¼Ç§¾Ú¤¬¼ºÇÔ¤·¤Þ¤·¤¿¡£ GFARM_ERR_PERMISSION_DENIED »ØÄꤵ¤ì¤¿¥Ñ¥¹¤Ø¥¢¥¯¥»¥¹¤¹¤ë¸¢¸Â¤¬¡¢¤¢¤ê¤Þ¤»¤ó¡£ GFARM_ERR_NO_SUCH_OBJECT »ØÄꤵ¤ì¤¿¥Ñ¥¹Ì¾¤¬Â¸ºß¤·¤Þ¤»¤ó¡£ ¤½¤Î¾ ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ SEE ALSO gfs_stat3 gfarm-2.4.1/doc/docbook/ja/ref/man3/gfarm_terminate.3.docbook0000644000000000000000000000267311507222721022357 0ustar rootroot 26 Jun 2010 gfarm_terminate 3 Gfarm gfarm_terminate gfarm ¥é¥¤¥Ö¥é¥ê¤Ë´Ø¤¹¤ë½ªÎ»½èÍý¤ò¤¹¤ë #include <gfarm/gfarm.h> gfarm_error_t gfarm_terminate void DESCRIPTION Gfarm ¥é¥¤¥Ö¥é¥ê¤Ë¤Ä¤¤¤Æ¡¢½ªÎ»½èÍý¤ò¹Ô¤¤¤Þ¤¹¡£ RETURN VALUES GFARM_ERR_NO_ERROR Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ ¤½¤Î¾ ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ SEE ALSO gfarm_initialize3 gfarm-2.4.1/doc/docbook/ja/ref/man3/gfs_pio_error.3.docbook0000644000000000000000000000317011507222721022043 0ustar rootroot 1 May 2002 gfs_pio_error 3 Gfarm gfs_pio_error ¥¨¥é¡¼¾õ¶· #include <gfarm/gfarm.h> char *gfs_pio_error GFS_File gf DESCRIPTION ¥Õ¥¡¥¤¥ë gf ¤Î¥¨¥é¡¼¾õ¶·¤ò¼¨¤·¤Þ¤¹¡£ RETURN VALUES NULL ÆÃ¤Ë¥¨¥é¡¼¤Ï¡¢À¸¤¸¤Æ¤¤¤Þ¤»¤ó¡£ ¤½¤Î¾ ¥¨¥é¡¼¤¬À¸¤¸¤Æ¤¤¤Þ¤¹¡£¥¨¥é¡¼¤ò¼¨¤¹Ê¸»úÎó¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤·¤Þ¤¹¡£ SEE ALSO gfs_pio_create3, gfs_pio_eof3, gfs_pio_open3 gfarm-2.4.1/doc/docbook/ja/ref/man3/gfs_chmod.3.docbook0000644000000000000000000000624411507222721021142 0ustar rootroot 21 Feb 2005 gfs_chmod 3 Gfarm gfs_chmod ¥â¡¼¥ÉÊѹ¹ #include <gfarm/gfarm.h> char *gfs_chmod char * gfarm_url mode_t mode DESCRIPTION °ú¿ô gfarm_url ¤Ë»ØÄꤷ¤¿Ì¾Á°¤Î¥Õ¥¡¥¤¥ë¡¦¥Ç¥£¥ì¥¯¥È¥ê¤Î¥â¡¼¥É¤ò¡¢ mode ¤ËÊѹ¹¤·¤Þ¤¹¡£¤³¤Î mode ¤ÎÃͤΰÕÌ£¤Ï chmod(2) ¤ÈƱÍͤǤ¹¤¬¡¢²¼°Ì9¥Ó¥Ã¥È¤Î¤ßÍ­¸ú¤Ç¤¹¡£ Ê£¿ô¤Î¥Õ¥é¥°¥á¥ó¥È¤«¤é¤Ê¤ë¥Õ¥¡¥¤¥ë¤Î¼Â¹Ô°À­¤ÎÊѹ¹¤Ë¤ÏÀ©Ìó¤¬ ¤¢¤ê¤Þ¤¹¡£¼Â¹Ô°À­¤¬¤¢¤ë¾ì¹ç¤Ë¤Ï¼Â¹Ô°À­¤ò¤¹¤Ù¤ÆÍ¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó¡£ ¾¯¤Ê¤¯¤È¤â°ì¤Ä¤Î¼Â¹Ô¥Ó¥Ã¥È¤Ï»Ä¤·¤Æ¤ª¤¯É¬Íפ¬¤¢¤ê¤Þ¤¹¡£ µÕ¤Ë¡¢¼Â¹Ô°À­¤¬Á´¤¯¤Ê¤¤¾ì¹ç¤Ë¼Â¹Ô°À­¤òΩ¤Æ¤ë¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó¡£ RETURN VALUES NULL Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ GFARM_ERR_NO_MEMORY ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ GFARM_ERR_AUTHENTICATION gfmd(8) ¤¢¤ë¤¤¤Ï gfsd(8) ¤ËÂФ¹¤ë¥æ¡¼¥¶¡¼Ç§¾Ú¤¬¼ºÇÔ¤·¤Þ¤·¤¿¡£ GFARM_ERR_PERMISSION_DENIED »ØÄꤷ¤¿¥Ñ¥¹Ì¾¤Î¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤Ø¤Î¥¢¥¯¥»¥¹¤¹¤ë¸¢¸Â¤¬¤¢¤ê¤Þ¤»¤ó¡£ GFARM_ERR_OPERATION_NOT_PERMITTED ¥×¥í¥»¥¹¤ò¼Â¹Ô¤·¤Æ¤¤¤ë¥æ¡¼¥¶¡¼¤¬¡¢¥Õ¥¡¥¤¥ë¤Î½êÍ­¼Ô¤Ç¤â¡¢¥·¥¹¥Æ¥à´ÉÍý¼Ô ¤Ç¤â¤¢¤ê¤Þ¤»¤ó¡£¤Þ¤¿¤Ï¡¢Ê£¿ô¤Î¥Õ¥é¥°¥á¥ó¥È¤ò¤â¤Ä¥Õ¥¡¥¤¥ë¤Î¼Â¹Ô¥Ó¥Ã¥È¤ò ¾¯¤Ê¤¯¤È¤â°ì¤Ä¤Ï¤¢¤ë¾õÂÖ¤«¤éÁ´¤¯¤Ê¤¤¾õÂ֤ˡ¢¤¢¤ë¤¤¤Ï¤½¤ÎµÕ¤ËÊѹ¹¤·¤è¤¦¤È ¤·¤Þ¤·¤¿¡£ GFARM_ERR_NO_SUCH_OBJECT »ØÄꤵ¤ì¤¿¥Ñ¥¹Ì¾¤¬Â¸ºß¤·¤Þ¤»¤ó¡£ GFARM_ERR_NOT_A_DIRECTORY »ØÄꤷ¤¿¥Ñ¥¹Ì¾¤Î¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤¬¡¢¼ÂºÝ¤Ë¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤«¤Ã¤¿¤³¤È¤ò ¼¨¤·¤Þ¤¹¡£ ¤½¤Î¾ ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ gfarm-2.4.1/doc/docbook/ja/ref/man3/gfs_pio_set_view_local.3.docbook0000644000000000000000000000634011507222721023713 0ustar rootroot 1 May 2002 gfs_pio_set_view_local 3 Gfarm gfs_pio_set_view_local ÊÂÎó¥×¥í¥»¥¹¤ËÂбþ¤·¤¿ fragment ñ°Ì¤Î¥¢¥¯¥»¥¹¤ò¹Ô¤¦ #include <gfarm/gfarm.h> char *gfs_pio_set_view_local GFS_File gf int flags DESCRIPTION ¥Õ¥¡¥¤¥ë¤ò¥Õ¥é¥°¥á¥ó¥Èñ°Ì¤Ç¥¢¥¯¥»¥¹¤¹¤ë¤³¤È¤ò»ØÄꤷ¤Þ¤¹¡£ ¥¢¥¯¥»¥¹¤¹¤ë¥Õ¥é¥°¥á¥ó¥È¤Ï¡¢GfarmÊÂÎó¥×¥í¥»¥¹¤Î¥Î¡¼¥ÉÈÖ¹æ¤ËÂбþ¤·¤¿ ¤â¤Î¤Ë¤Ê¤ê¤Þ¤¹¡£¤¹¤Ê¤ï¤Á¡¢´Ø¿ô gfs_pio_set_local(3) ¤Î node °ú¿ô¤Ë»ØÄꤷ¤¿¥Õ¥é¥°¥á¥ó¥È¤Ç¤¹¡£ ¥Õ¥é¥°¥á¥ó¥È¤ÎÁí¿ô¤Ï¡¢GfarmÊÂÎó¥×¥í¥»¥¹¤Î¥Î¡¼¥É¤ÎÁí¿ô¡¢¤¹¤Ê¤ï¤Á gfs_pio_set_local(3) ¤Î nnode °ú¿ô¤ÈƱ°ì¤Ë¤Ê¤ê¤Þ¤¹¡£ ¤â¤·¡¢´û¸¤Î¥Õ¥¡¥¤¥ë¤ò³«¤¯¤È¤­¤Ë¡¢¥Õ¥é¥°¥á¥ó¥È¤ÎÁí¿ô¤È¥Î¡¼¥É¤ÎÁí¿ô¤¬ °Û¤Ê¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢¤³¤Î´Ø¿ô¤Ï¥¨¥é¡¼¤È¤Ê¤ê¤Þ¤¹¡£ °ú¿ô flag ¤Ë¤Ï¡¢ GFARM_FILE_SEQUENTIAL¡¢ GFARM_FILE_REPLICATE¡¢ GFARM_FILE_NOT_REPLICATE ¤ÎÏÀÍýϤ¬»ØÄê¤Ç¤­¤Þ¤¹¡£ ÃͤΰÕÌ£¤Ï gfs_pio_set_view_index(3) ¤Î²òÀâ¤ò»²¾È¤¯¤À¤µ¤¤¡£ ¤³¤Î´Ø¿ô¤ò¸Æ¤Ð¤Ê¤¤¾õÂ֤Ǥϡ¢Gfarm¥Õ¥¡¥¤¥ë¤Ï global view ¾õÂ֤ȤʤäƤª¤ê¡¢Á´¤Æ¤Î¥Õ¥é¥°¥á¥ó¥È¤¬·ë¹ç¤µ¤ì¤¿Ã±°ì¥Õ¥¡¥¤¥ë¤Ë¸«¤¨¤Þ¤¹¡£ RETURN VALUES NULL Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ GFARM_ERR_NO_MEMORY ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ GFARM_ERR_OPERATION_NOT_PERMITTED »ØÄꤷ¤¿¥Ñ¥¹Ì¾¤¬¡¢¥Õ¥é¥°¥á¥ó¥È²½¥Õ¥¡¥¤¥ë¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£ GFARM_ERR_FRAGMENT_NUMBER_DOES_NOT_MATCH ¥Î¡¼¥É¿ô¤È¡¢¥Õ¥é¥°¥á¥ó¥ÈÁí¿ô¤¬¡¢Å¬¹ç¤·¤Þ¤»¤ó¡£ ¤½¤Î¾ ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ SEE ALSO gfs_pio_create3, gfs_pio_open3, gfs_pio_set_local3, gfs_pio_set_view_index3 gfarm-2.4.1/doc/docbook/ja/ref/man3/gfarm_url_hosts_schedule.3.docbook0000644000000000000000000000405211507222721024256 0ustar rootroot 1 May 2002 gfarm_url_hosts_schedule 3 Gfarm gfarm_url_hosts_schedule gfarm ¥¿¥¹¥¯¤ò¥¹¥±¥¸¥å¡¼¥ë¤¹¤ë #include <gfarm/gfarm.h> char *gfarm_url_hosts_schedule char * gfarm_url char * option int * nhostsp char *** hostsp DESCRIPTION »ØÄꤷ¤¿ Gfarm URL ¤ò¥¢¥¯¥»¥¹¤¹¤ë¥¿¥¹¥¯¤ò¼Â¹Ô¤¹¤ë¤Î¤ËŬ¤·¤¿ ¥Û¥¹¥È¤ÎÇÛÎó¤ò hostsp ¤Î»Ø¤¹Àè¤ËÊÖ¤·¤Þ¤¹¡£¥Û¥¹¥È¿ô¤Ï nhostsp ¤Î»Ø¤¹Àè¤ËÊÖ¤ê¤Þ¤¹¡£ ¤³¤³¤ÇÆÀ¤¿¥Û¥¹¥È¤ÎÇÛÎó¤Ï gfarm_strings_free_deeply() ¤òÍѤ¤¤Æ²òÊü ¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£ RETURN VALUES NULL Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ GFARM_ERR_NO_MEMORY ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ ¤½¤Î¾ ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ NOTES °ú¿ô option ¤Ë¤Ï¡¢¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¤Ë´Ø¤¹¤ë¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Þ¤¹¤¬¡¢ ¸½ºß¤Î¼ÂÁõ¤Ç¤Ï¡¢¤³¤Î°ú¿ô¤ÏÍøÍѤµ¤ì¤Æ¤¤¤Þ¤»¤ó¡£ gfarm-2.4.1/doc/docbook/ja/ref/man3/gfs_unlink.3.docbook0000644000000000000000000000451711507222721021351 0ustar rootroot 1 May 2002 gfs_unlink 3 Gfarm gfs_unlink ¥Õ¥¡¥¤¥ëºï½ü #include <gfarm/gfarm.h> char *gfs_unlink char * gfarm_url DESCRIPTION °ú¿ô gfarm_url ¤Ë»ØÄꤷ¤¿Ì¾Á°¤Î¥Õ¥¡¥¤¥ë¤òºï½ü¤·¤Þ¤¹¡£ RETURN VALUES NULL Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ GFARM_ERR_NO_MEMORY ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ GFARM_ERR_AUTHENTICATION gfmd(8) ¤ËÂФ¹¤ë¥æ¡¼¥¶¡¼Ç§¾Ú¤¬¼ºÇÔ¤·¤Þ¤·¤¿¡£ GFARM_ERR_PERMISSION_DENIED gfarm_url ¤Î¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤Ø½ñ¤­¹þ¤ß¥¢¥¯¥»¥¹¤¹¤ë¸¢¸Â¤¬¤¢¤ê¤Þ¤»¤ó¡£ GFARM_ERR_NO_SUCH_OBJECT »ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Þ¤»¤ó¡£ GFARM_ERR_NOT_A_DIRECTORY »ØÄꤷ¤¿¥Ñ¥¹Ì¾¤Î¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤¬¡¢¼ÂºÝ¤Ë¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤«¤Ã¤¿¤³¤È¤ò ¼¨¤·¤Þ¤¹¡£ ¤½¤Î¾ ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ gfarm-2.4.1/doc/docbook/ja/ref/man3/gfs_pio_seek.3.docbook0000644000000000000000000000440711507222721021645 0ustar rootroot 1 May 2002 gfs_pio_seek 3 Gfarm gfs_pio_seek »ØÄꤷ¤¿°ÌÃ֤˥·¡¼¥¯¤¹¤ë #include <gfarm/gfarm.h> char * gfs_pio_seek GFS_File gf file_offset_t offset int whence file_offset_t * result DESCRIPTION ¥Õ¥¡¥¤¥ë gf ¤ò¡¢ whence ¤È offset ¤Ç»ØÄꤷ¤¿°ÌÃ֤˥·¡¼¥¯¤·¤Þ¤¹¡£ °ú¿ô offset ¤Ï¡¢ whence ¤¬ 0 ¤Î¾ì¹ç¤Ë¤Ï¥Õ¥¡¥¤¥ëÀèÆ¬¤«¤é¡¢ 1 ¤Î¾ì¹ç¤Ë¤Ï¸½ºß¤Î¥·¡¼¥¯°ÌÃÖ¤«¤é¡¢ 2 ¤Î¾ì¹ç¤Ë¤Ï¥Õ¥¡¥¤¥ëËöÈø¤«¤é¤Î¥ª¥Õ¥»¥Ã¥È¤Ç¤¹¡£ °ú¿ô result ¤¬ NULL ¤Ç¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢°Üư¸å¤Î°ÌÃÖ¤ò result ¤Î»Ø¤¹Àè¤ËÊÖ¤·¤Þ¤¹¡£ RETURN VALUES NULL Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ GFARM_ERR_NO_MEMORY ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ ¤½¤Î¾ ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ SEE ALSO gfs_pio_create3, gfs_pio_open3 gfarm-2.4.1/doc/docbook/ja/ref/man3/gfarm_url_program_deliver.3.docbook0000644000000000000000000000471611507222721024432 0ustar rootroot 10 Sep 2002 gfarm_url_program_deliver 3 Gfarm gfarm_url_program_deliver ¥×¥í¥°¥é¥à¤ò»ØÄꤷ¤¿¥Û¥¹¥È¤ËÇÛÉÛ¤¹¤ë #include <gfarm/gfarm.h> char *gfarm_url_program_deliver char *gfarm_url int nhosts char **hosts char ***delivered_paths DESCRIPTION gfarm_url¤Ç»ØÄꤷ¤¿¥×¥í¥°¥é¥à¤ò¡¢ nhosts ¸Ä¤ÎÍ×ÁǤò»ý¤Äʸ»úÎóÇÛÎó hosts ¤Ç»ØÄꤷ¤¿¥Û¥¹¥È¤ËÇÛÉÛ¤·¤Þ¤¹¡£ ÇÛÉÛ¤µ¤ì¤¿³Æ¥Û¥¹¥È¾å¤Ç¤Î¥×¥í¥°¥é¥à¤ÎÀäÂХѥ¹¤ò¡¢ nhosts ¸Ä¤ÎÍ×ÁǤò»ý¤Äʸ»úÎóÇÛÎó¤Ë³ÊǼ¤·¡¢¤½¤ÎÇÛÎó¤Î¥¢¥É¥ì¥¹¤ò delivered_paths ¤¬»Ø¤¹Àè¤ËÊÖ¤·¤Þ¤¹¡£ delivered_paths ¤ËÆÀ¤¿Ê¸»úÎóÇÛÎó¤Ï¡¢ÉÔÍפˤʤ俤é gfarm_strings_free_deeply3 ¤Ç²òÊü¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£ RETURN VALUES NULL Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ GFARM_ERR_NO_MEMORY ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ ¤½¤Î¾ ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ SEE ALSO gfarm_url_program_deliver3, gfarm_strings_free_deeply3 gfarm-2.4.1/doc/docbook/ja/ref/man3/gfs_mkdir.3.docbook0000644000000000000000000000475511507222721021163 0ustar rootroot 1 May 2002 gfs_mkdir 3 Gfarm gfs_mkdir ¥Ç¥£¥ì¥¯¥È¥êºîÀ® #include <gfarm/gfarm.h> char *gfs_mkdir char * gfarm_url gfarm_mode_t mode DESCRIPTION °ú¿ô gfarm_url ¤Ë»ØÄꤷ¤¿Ì¾Á°¤Î¥Ç¥£¥ì¥¯¥È¥ê¤ò¡¢¥â¡¼¥É mode ¤ÇºîÀ®¤·¤Þ¤¹¡£ RETURN VALUES NULL Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ GFARM_ERR_NO_MEMORY ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ GFARM_ERR_ALREADY_EXISTS »ØÄꤷ¤¿¥Ç¥£¥ì¥¯¥È¥ê¤¬´û¤Ë¸ºß¤·¤Þ¤¹¡£ GFARM_ERR_NO_SUCH_OBJECT »ØÄꤷ¤¿¥Ñ¥¹Ì¾¤Î¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤¬¡¢¼ÂºÝ¤Ë¤Ï¸ºß¤·¤Ê¤«¤Ã¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ GFARM_ERR_NOT_A_DIRECTORY »ØÄꤷ¤¿¥Ñ¥¹Ì¾¤Î¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤¬¡¢¼ÂºÝ¤Ë¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤«¤Ã¤¿¤³¤È¤ò ¼¨¤·¤Þ¤¹¡£ ¤½¤Î¾ ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ gfarm-2.4.1/doc/docbook/ja/ref/man3/gfarm_url_fragments_replicate.3.docbook0000644000000000000000000000506411507222721025264 0ustar rootroot 4 Sep 2005 gfarm_url_fragments_replicate 3 Gfarm gfarm_url_fragments_replicate ¥Õ¥¡¥¤¥ë¤Î¥ì¥×¥ê¥«¤òºîÀ®¤¹¤ë #include <gfarm/gfarm.h> char *gfarm_url_fragments_replicate const char *gfarm_url int ndsthosts char **dsthosts DESCRIPTION ¥Õ¥¡¥¤¥ë gfarm_url ¤ÎÊ£À½¤ò¡¢Ä¹¤µ ndsthosts ¤Îʸ»úÎóÇÛÎó dsthosts ¤Ç»ØÄꤷ¤¿¥Û¥¹¥È¤ËºîÀ®¤·¤Þ¤¹¡£ ¤³¤Î´Ø¿ô¤Ç¤Ï¡¢¼Â¹Ô·Á¼°¤Î¥Õ¥¡¥¤¥ë¤ÎÊ£À½¤Ë¤ÏÍøÍѤǤ­¤Þ¤»¤ó¡£ ¥Õ¥¡¥¤¥ë¤Î¥Õ¥¡¥¤¥ë¥¤¥ó¥Ç¥Ã¥¯¥¹¤ÎÁí¿ô¤è¤ê¡¢»ØÄꤵ¤ì¤¿¥Û¥¹¥È¤ÎÁí¿ô ndsthosts ¤¬¾¯¤Ê¤¤¾ì¹ç¤Ï¡¢»ØÄꤵ¤ì¤¿¥Û¥¹¥È¤¬¥é¥¦¥ó¥É¥í¥Ó¥ó¤Ç³ä¤êÅö¤Æ¤é¤ì¤Þ¤¹¡£ RETURN VALUES NULL Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ GFARM_ERR_NO_MEMORY ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ GFARM_ERR_OPERATION_NOT_PERMITTED °ú¿ô¤È¤·¤Æ¡¢¼Â¹Ô·Á¼°¤Î¥Õ¥¡¥¤¥ë¡¢ ¥Ç¥£¥ì¥¯¥È¥ê¤Ê¤ÉÄ̾ï¥Õ¥¡¥¤¥ë°Ê³°¤Î¥Õ¥¡¥¤¥ë¤ò»ØÄꤷ¤Þ¤·¤¿¡£ ¤½¤Î¾ ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ SEE ALSO gfarm_url_section_replicate_from_to3, gfarm_url_section_replicate_from_to3 gfarm-2.4.1/doc/docbook/ja/ref/man3/gfs_chown.3.docbook0000644000000000000000000000533411507222721021165 0ustar rootroot 1 May 2002 gfs_chown 3 Gfarm gfs_chown ½êÍ­¼Ô¡¢¥°¥ë¡¼¥×Êѹ¹ #include <gfarm/gfarm.h> char *gfs_chown char * gfarm_url char * user char * group DESCRIPTION °ú¿ô gfarm_url ¤Î½êÍ­¼Ô¤ò user ¤Ë¡¢¥°¥ë¡¼¥×¤ò group ¤ËÊѹ¹¤·¤Þ¤¹¡£ RETURN VALUES NULL Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ GFARM_ERR_NO_MEMORY ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ GFARM_ERR_AUTHENTICATION gfmd(8) ¤¢¤ë¤¤¤Ï gfsd(8) ¤ËÂФ¹¤ë¥æ¡¼¥¶¡¼Ç§¾Ú¤¬¼ºÇÔ¤·¤Þ¤·¤¿¡£ GFARM_ERR_PERMISSION_DENIED »ØÄꤷ¤¿¥Ñ¥¹Ì¾¤Î¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤Ø¤Î¥¢¥¯¥»¥¹¤¹¤ë¸¢¸Â¤¬¤¢¤ê¤Þ¤»¤ó¡£ GFARM_ERR_OPERATION_NOT_PERMITTED ¥×¥í¥»¥¹¤ò¼Â¹Ô¤·¤Æ¤¤¤ë¥æ¡¼¥¶¡¼¤¬¡¢¥Õ¥¡¥¤¥ë¤Î½êÍ­¼Ô¤Ç¤â¡¢¥·¥¹¥Æ¥à´ÉÍý¼Ô ¤Ç¤â¤¢¤ê¤Þ¤»¤ó¡£ GFARM_ERR_NO_SUCH_OBJECT »ØÄꤵ¤ì¤¿¥Ñ¥¹Ì¾¤¬Â¸ºß¤·¤Þ¤»¤ó¡£ GFARM_ERR_NOT_A_DIRECTORY »ØÄꤷ¤¿¥Ñ¥¹Ì¾¤Î¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤¬¡¢¼ÂºÝ¤Ë¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤«¤Ã¤¿¤³¤È¤ò ¼¨¤·¤Þ¤¹¡£ ¤½¤Î¾ ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ gfarm-2.4.1/doc/docbook/ja/ref/man3/gfs_glob_init.3.docbook0000644000000000000000000000365311507222721022017 0ustar rootroot 2 Sep 2003 gfs_glob_init 3 Gfarm gfs_glob_init ¥Ñ¥¹¤Î¥¿¥¤¥×¤ò³ÊǼ¤¹¤ëÎΰè¤ò³ÎÊݤ¹¤ë #include <gfarm/gfarm.h> char *gfs_glob_init gfs_glob_t * listp DESCRIPTION ¥Ñ¥¿¡¼¥ó¤Ë¥Þ¥Ã¥Á¤¹¤ë¥Ñ¥¹Ì¾¤ò¼èÆÀ¤¹¤ë´Ø¿ô gfs_glob(3)¡¢ ¥Ñ¥¹¤Î¥¿¥¤¥×¤òÄɲä¹¤ë´Ø¿ô gfs_glob_add() ¤¬¥Ñ¥¹¤Î¥¿¥¤¥×¤ò ³ÊǼ¤¹¤ë¤¿¤á¤Ë»ÈÍѤ¹¤ëÎΰè¤òưŪ¤Ë³ÎÊݤ·¡¢¤½¤Î¥¢¥É¥ì¥¹¤ò°ú¿ô listp ¤ËÀßÄꤷ¤Þ¤¹¡£ RETURN VALUES NULL Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ GFARM_ERR_NO_MEMORY ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ ¤½¤Î¾ ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ SEE ALSO gfs_glob3 gfs_glob_add3 gfs_glob_free3 gfarm-2.4.1/doc/docbook/ja/ref/man3/gfs_pio_putc.3.docbook0000644000000000000000000000336211507222721021670 0ustar rootroot 1 May 2002 gfs_pio_putc 3 Gfarm gfs_pio_putc °ìʸ»ú½ñ¤­¹þ¤ß #include <gfarm/gfarm.h> char *gfs_pio_putc GFS_File gf int c DESCRIPTION ¥Õ¥¡¥¤¥ë gf ¤Ë 1¥Ð¥¤¥È (1ʸ»ú) ¤ÎÃÍ c ¤ò½ñ¤­¹þ¤ß¤Þ¤¹¡£ RETURN VALUES NULL Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ GFARM_ERR_NO_MEMORY ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ ¤½¤Î¾ ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ SEE ALSO gfs_pio_create3, gfs_pio_open3 gfarm-2.4.1/doc/docbook/ja/ref/man3/gfs_pio_sync.3.docbook0000644000000000000000000000434311507222721021671 0ustar rootroot 1 Jun 2005 gfs_pio_sync 3 Gfarm gfs_pio_sync ¥á¥â¥ê¾å¤Î¥Õ¥¡¥¤¥ë¤ÎÆâÍÆ¤ò¥Ç¥£¥¹¥¯¤ËÈ¿±Ç¤µ¤»¤ë #include <gfarm/gfarm.h> char *gfs_pio_sync GFS_File gf DESCRIPTION ½ñ¤­¹þ¤ßÍѤ˥ª¡¼¥×¥ó¤·¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë gf ¤Î¡¢¥á¥â¥ê¾å¤Ë¤¢¤ë¥Ç¡¼¥¿¤ò¼ÂºÝ¤Ë¥Ç¥£¥¹¥¯¤Ë½ñ¤­¹þ¤ß¡¤ Æþ½ÐÎϤδ°Î»¤òÂԤäƤ«¤éÌá¤ê¤Þ¤¹¡¥¤Þ¤¿¡¤ ¥Õ¥¡¥¤¥ë¤Î¥á¥¿¥Ç¡¼¥¿¤â¹¹¿·¤·¤Þ¤¹¡¥ Ê̤δؿô gfs_pio_datasync ¤â¥á¥â¥ê¾å¤Î¥Õ¥¡¥¤¥ë¥Ç¡¼¥¿¤ò¥Ç¥£¥¹¥¯¤Ë½ñ¤­¹þ¤ß¤Þ¤¹¤¬¡¤ ¥á¥¿¥Ç¡¼¥¿¤Ï¹¹¿·¤·¤Þ¤»¤ó¡¥ RETURN VALUES NULL Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡¥ GFARM_ERR_NO_MEMORY ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡¥ ¤½¤Î¾ ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡¥ SEE ALSO gfs_pio_datasync3, gfs_pio_create3, gfs_pio_open3, gfs_pio_write3, gfs_pio_flush3 gfarm-2.4.1/doc/docbook/ja/ref/man3/gfs_closedir.3.docbook0000644000000000000000000000301211507222721021642 0ustar rootroot 1 May 2002 gfs_closedir 3 Gfarm gfs_closedir ¥Ç¥£¥ì¥¯¥È¥ê¤ò¥¯¥í¡¼¥º¤¹¤ë #include <gfarm/gfarm.h> char *gfs_closedir GFS_Dir dir DESCRIPTION °ú¿ô dir ¤Ç»ØÄꤷ¤¿¥Ç¥£¥ì¥¯¥È¥ê¤ò¥¯¥í¡¼¥º¤·¤Þ¤¹¡£ RETURN VALUES NULL Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ ¤½¤Î¾ ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ SEE ALSO gfs_opendir3, gfs_readdir3 gfarm-2.4.1/doc/docbook/ja/ref/man3/gfs_pio_eof.3.docbook0000644000000000000000000000316511507222721021467 0ustar rootroot 1 May 2002 gfs_pio_eof 3 Gfarm gfs_pio_eof ¥Õ¥¡¥¤¥ëËöÈøÈ½ÊÌ #include <gfarm/gfarm.h> int gfs_pio_eof GFS_File gf DESCRIPTION ¥Õ¥¡¥¤¥ë gf ¤ÎÆÉ¤ß¹þ¤ß½èÍý¤¬¡¢¥Õ¥¡¥¤¥ëËöÈø¤Ë㤷¤¿¤«Èݤ«¤ò¼¨¤·¤Þ¤¹¡£ RETURN VALUES 0 ¤Þ¤ÀËöÈø¤Ë㤷¤Æ¤¤¤Þ¤»¤ó¡£ ¤½¤Î¾ ¥Õ¥¡¥¤¥ë¤ÎËöÈø¤Ë㤷¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ SEE ALSO gfs_pio_create3, gfs_pio_error3, gfs_pio_open3 gfarm-2.4.1/doc/docbook/ja/ref/man3/gfarm_stringlist_init.3.docbook0000644000000000000000000000526311507222721023612 0ustar rootroot 1 May 2002 gfarm_stringlist_init 3 Gfarm gfarm_stringlist_init stringlist ¤ò½é´ü²½¤¹¤ë #include <gfarm/gfarm.h> char *gfarm_stringlist_init gfarm_stringlist * listp DESCRIPTION gfarm_stringlist ¤Ï¡¢Ê¸»úÎóÇÛÎó¤ÎưŪ³ÎÊݤòÊä½õ¤¹¤ë·¿¤Ç¤¹¡£ ưŪ¤Ë³ÎÊݤµ¤ì¤ë¤Î¤Ï¡¢ÇÛÎó¤À¤±¤Ç¤¢¤ê¡¢ÇÛÎóÍ×ÁǤǤ¢¤ë³ÆÊ¸»úÎó¤Ë¤Ä¤¤¤Æ¤Ï¡¢ ¤³¤Î·¿¤Î´ÉÍý³°¤Ë¤Ê¤ê¤Þ¤¹¡£ ¤³¤Î´Ø¿ô¤Ï¡¢ listp ¤Î»Ø¤¹ gfarm_stringlist ·¿¤ÎÊÑ¿ô¤ò½é´ü²½¤·¤Þ¤¹¡£ ¤³¤Î·¿¤ÎÍøÍѤò½ª¤¨¤¿»þ¤Ë¤Ï¡¢gfarm_stringlist_free() ¤òÍѤ¤¤Æ¡¢ ưŪ¤Ë³ÎÊݤ·¤¿¥á¥â¥ê¤ò²òÊü¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£ RETURN VALUES NULL Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ GFARM_ERR_NO_MEMORY ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ ¤½¤Î¾ ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ SEE ALSO GFARM_STRINGLIST_ELEM3, GFARM_STRINGLIST_STRARRAY3, gfarm_stringlist_add3, gfarm_stringlist_cat3, gfarm_stringlist_elem3, gfarm_stringlist_free3, gfarm_stringlist_free_deeply3, gfarm_stringlist_length3 gfarm-2.4.1/doc/docbook/ja/ref/man3/gfs_glob_add.3.docbook0000644000000000000000000000335111507222721021577 0ustar rootroot 2 Sep 2003 gfs_glob_add 3 Gfarm gfs_glob_add ¥Ñ¥¹¤Î¥¿¥¤¥×¤ò¥ê¥¹¥È¤ËÄɲ乤ë #include <gfarm/gfarm.h> char *gfs_glob_add gfs_glob_t * listp int dtype DESCRIPTION °ú¿ô listp ¤Ë°ú¿ô dtype ¤ò¥Ñ¥¹¤Î¥¿¥¤¥×¤È¤·¤ÆÄɲä·¤Þ¤¹¡£ RETURN VALUES NULL Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ GFARM_ERR_NO_MEMORY ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ SEE ALSO gfs_glob_init3 gfs_glob3 gfs_glob_free3 gfarm-2.4.1/doc/docbook/ja/ref/man3/gfs_opendir.3.docbook0000644000000000000000000000440111507222721021501 0ustar rootroot 1 May 2002 gfs_opendir 3 Gfarm gfs_opendir ¥Ç¥£¥ì¥¯¥È¥ê¤Î¥ª¡¼¥×¥ó #include <gfarm/gfarm.h> char *gfs_opendir const char * gfarm_url GFS_Dir * dirp DESCRIPTION gfarm_url ¤Ç»ØÄꤷ¤¿¥Ç¥£¥ì¥¯¥È¥ê¤ò¥ª¡¼¥×¥ó¤·¤Þ¤¹¡£ RETURN VALUES NULL Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ GFARM_ERR_NO_MEMORY ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ GFARM_ERR_AUTHENTICATION gfmd(8) ¤ËÂФ¹¤ë¥æ¡¼¥¶¡¼Ç§¾Ú¤¬¼ºÇÔ¤·¤Þ¤·¤¿¡£ GFARM_ERR_PERMISSION_DENIED gfarm_url ¤Ø¥¢¥¯¥»¥¹¤¹¤ë¸¢¸Â¤¬¡¢¤¢¤ê¤Þ¤»¤ó¡£ GFARM_ERR_NO_SUCH_OBJECT »ØÄꤵ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¤¬Â¸ºß¤·¤Þ¤»¤ó¡£ ¤½¤Î¾ ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ SEE ALSO gfs_closedir3, gfs_readdir3 gfarm-2.4.1/doc/docbook/ja/ref/man3/gfs_pio_ungetc.3.docbook0000644000000000000000000000366611507222721022211 0ustar rootroot 1 May 2002 gfs_pio_ungetc 3 Gfarm gfs_pio_ungetc ÆÉ¤ß¹þ¤ó¤Àʸ»ú¤òÌ᤹ #include <gfarm/gfarm.h> int gfs_pio_ungetc GFS_File gf int c DESCRIPTION ¥Õ¥¡¥¤¥ë gf ¤«¤éÆÉ¤ß¹þ¤ó¤Àʸ»ú c ¤ò¡¢ÆÉ¤ß¹þ¤Þ¤Ê¤«¤Ã¤¿¤³¤È¤Ë¤·¤Þ¤¹¡£ RETURN VALUES EOF gfs_pio_ungetc() ¤Ï¡¢´Ø¿ô gfs_pio_getc(3) ¤Î¸Æ¤Ó¤À¤·¤Îľ¸å¤Ë¤·¤« ¸Æ¤Ö¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£¤³¤ÎÀ©Ìó¤ËÈ¿¤·¤¿¾ì¹ç¡¢ EOF ¤ò¥¨¥é¡¼¤È¤·¤ÆÊÖ¤·¤Þ¤¹¡£ ¤½¤Î¾ Àµ¾ï¤Ë½èÍý¤¬´°Î»¤·¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ SEE ALSO gfs_pio_create3, gfs_pio_error3, gfs_pio_getc3, gfs_pio_open3 gfarm-2.4.1/doc/docbook/ja/ref/man3/gfs_rmdir.3.docbook0000644000000000000000000000453711507222721021170 0ustar rootroot 1 May 2002 gfs_rmdir 3 Gfarm gfs_rmdir ¥Ç¥£¥ì¥¯¥È¥êºï½ü #include <gfarm/gfarm.h> char *gfs_rmdir char * gfarm_url DESCRIPTION °ú¿ô gfarm_url ¤Ë»ØÄꤷ¤¿Ì¾Á°¤Î¥Ç¥£¥ì¥¯¥È¥ê¤òºï½ü¤·¤Þ¤¹¡£ RETURN VALUES NULL Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ GFARM_ERR_NO_MEMORY ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ GFARM_ERR_PERMISSION_DENIED gfarm_url ¤Î¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤Ø½ñ¤­¹þ¤ß¥¢¥¯¥»¥¹¤¹¤ë¸¢¸Â¤¬¤¢¤ê¤Þ¤»¤ó¡£ GFARM_ERR_DIRECTORY_NOT_EMPTY »ØÄꤵ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¤¬¡¢¶õ¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£ GFARM_ERR_NO_SUCH_OBJECT »ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Þ¤»¤ó¡£ GFARM_ERR_NOT_A_DIRECTORY »ØÄꤷ¤¿¥Ñ¥¹Ì¾¤Î¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤¬¡¢¼ÂºÝ¤Ë¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤«¤Ã¤¿¤³¤È¤ò ¼¨¤·¤Þ¤¹¡£ ¤½¤Î¾ ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ gfarm-2.4.1/doc/docbook/ja/ref/man3/gfarm_stringlist_elem.3.docbook0000644000000000000000000000404111507222721023562 0ustar rootroot 1 May 2002 gfarm_stringlist_elem 3 Gfarm gfarm_stringlist_elem stringlist ¤ÎÍ×ÁÇʸ»ú¤òÊÖ¤¹ #include <gfarm/gfarm.h> intgfarm_stringlist_elem gfarm_stringlist * listp int i DESCRIPTION listp¤Î i ÈÖÌܤÎÇÛÎóÍ×ÁǤòÊÖ¤·¤Þ¤¹¡£ RETURN VALUES ʸ»úÎóÇÛÎó¤ÎÍ×ÁǤǤ¹¡£ SEE ALSO GFARM_STRINGLIST_ELEM3, GFARM_STRINGLIST_STRARRAY3, gfarm_stringlist_add3, gfarm_stringlist_cat3, gfarm_stringlist_free3, gfarm_stringlist_free_deeply3, gfarm_stringlist_init3, gfarm_stringlist_length3 gfarm-2.4.1/doc/docbook/ja/ref/man3/gfs_pio_readdelim.3.docbook0000644000000000000000000001444511507222721022647 0ustar rootroot 13 May 2004 gfs_pio_readdelim 3 Gfarm gfs_pio_readdelim °ì¥ì¥³¡¼¥ÉÆÉ¤ß¹þ¤ß #include <gfarm/gfarm.h> char *gfs_pio_readdelim GFS_File f char **bufp size_t *sizep size_t *lenp char *delimiter size_t delimlen DESCRIPTION ¤³¤Î´Ø¿ô¤Ï¡¢gfs_pio_readline(3) ¤ÈƱÍÍ¤ËÆ¯¤­¤Þ¤¹¤¬¡¢¤¿¤À¤·¡¢ ÆþÎϤΥ»¥Ñ¥ì¡¼¥¿¤ò²þ¹Ôʸ»ú¤Ë¸Â¤é¤º¡¢°ìÈÌŪ¤Ë»ØÄê¤Ç¤­¤ë¤è¤¦¤Ë ¤·¤¿¤â¤Î¤Ç¤¹¡£ ¤³¤Î´Ø¿ô¤Ï¡¢¥Õ¥¡¥¤¥ë gf ¤«¤é¡¢ °ú¿ô delimiter ¤Ç»ØÄꤵ¤ì¤¿¥Ð¥¤¥ÈÎó¤ò¥ì¥³¡¼¥É´Ö¶èÀÚ¤ê¤È¤·¤Æ¡¢1¥ì¥³¡¼¥ÉÆÉ¤ß¤È¤ê ¤Þ¤¹¡£ °ú¿ô delimiter ¤Ë¤Ïʸ»ú '\0' ¤ò´Þ¤à¤³¤È¤â¤Ç¤­¤Þ¤¹¡£¤³¤Î¤¿¤á¡¢¶èÀÚ¤ê¤ÎŤµ¤ò °ú¿ô delimlen ¤Ç»ØÄꤷ¤Þ¤¹¡£ ¤Ê¤ª¡¢ °ú¿ô delimiter ¤¬ NULL ¤Î¾ì¹ç¡¢¥Õ¥¡¥¤¥ëÁ´ÂΤò1¥ì¥³¡¼¥É¤È¤·¤Æ¥á¥â¥ê¾å¤ËÆÉ¤ß¹þ¤ß¤Þ¤¹¡£ ¤½¤¦¤Ç¤Ï¤Ê¤¯¡¢¤«¤Ä °ú¿ô delimlen ¤¬ 0 ¤Î¾ì¹ç¡¢°ì¸Ä°Ê¾å¤ÎϢ³¤¹¤ë¶õ¹Ô (Àµµ¬É½¸½¤Ç¤Ï /\n\n+/) ¤ò ¥ì¥³¡¼¥É¶èÀÚ¤ê¤È¸«¤Ê¤·¤Þ¤¹¡£¤³¤Î»ÅÍÍ¤Ï perl ¸À¸ì¤Î INPUT_RECORD_SEPARATOR ¤ò»²¹Í¤Ë¤·¤Æ¤¤¤Þ¤¹¡£ °ú¿ô bufp ¤Ï¡¢ºÇ½é¤Ï NULL ¤Ç½é´ü²½¤µ¤ì¤¿¥Ý¥¤¥ó¥¿ÊÑ¿ô¤Î¥¢¥É¥ì¥¹¤ò»ØÄꤷ¤Þ¤¹¡£ ´Ø¿ô gfs_pio_readdelim() ¤Ï¡¢Æþ½ÐÎϤËÍѤ¤¤ë ¥Ð¥Ã¥Õ¥¡¤òưŪ¤Ë³ä¤êÅö¤Æ¡¢¤½¤Î¥¢¥É¥ì¥¹¤ò¤³¤Î¥Ý¥¤¥ó¥¿ÊÑ¿ô¤Ëµ­Ï¿¤·¤Þ¤¹¡£ °ú¿ô sizep ¤Ï¡¢0 ¤Ç½é´ü²½¤·¤¿ size_t ·¿¤ÎÊÑ¿ô ¤Î¥¢¥É¥ì¥¹¤ò»ØÄꤷ¤Þ¤¹¡£¤³¤ÎÊÑ¿ô¤Ï¡¢¥Ð¥Ã¥Õ¥¡¤Î¥µ¥¤¥º¤òµ­Ï¿¤¹¤ë¤¿¤á¤Ë »È¤ï¤ì¤Þ¤¹¡£ ¤¢¤ë¤¤¤Ï¡¢malloc(3) ¤Ç³ä¤êÅö¤Æ¤¿¥Ð¥Ã¥Õ¥¡¤ò»Ø¤¹¥Ý¥¤¥ó¥¿¤Î¥¢¥É¥ì¥¹¤ò °ú¿ô bufp ¤Ë»ØÄꤹ¤ë¤³¤È¤â¤Ç¤­¤Þ¤¹¡£¤³¤Î¾ì¹ç¡¢ °ú¿ô sizep ¤Ï¡¢³ä¤êÅö¤Æ¤¿¥Ð¥Ã¥Õ¥¡¤Î¥µ¥¤¥º¤Ç½é´ü²½¤·¤Æ¤ª¤­¤Þ¤¹¡£ ¹Ô¤ÎŤµ¤¬¥Ð¥Ã¥Õ¥¡¤Î¥µ¥¤¥º¤ò±Û¤¨¤ë¾ì¹ç¤Ë¤Ï¡¢¥Ð¥Ã¥Õ¥¡¤Ï¼«Æ°Åª¤Ë realloc(3) ¤µ¤ì¡¢ °ú¿ô bufp ¤ª¤è¤Ó °ú¿ô sizep ¤Ç»ØÄꤵ¤ì¤¿ÊÑ¿ô¤â¤½¤ì¤Ë½¾¤Ã¤Æ¹¹¿·¤µ¤ì¤Þ¤¹¡£ ¥Õ¥¡¥¤¥ë¤òÆÉ¤ß½ª¤ï¤Ã¤¿¤é¡¢¤³¤Î¥Ý¥¤¥ó¥¿¤ò free(3) ¤Ç²òÊü¤¹¤ëɬÍפ¬ ¤¢¤ê¤Þ¤¹¡£ °ú¿ô lenp ¤Î»Ø¤¹ÊÑ¿ô¤Ë¤Ï¡¢ÆÉ¤ß¹þ¤ó¤À¥ì¥³¡¼¥É¤ÎŤµ¤òÊÖ¤·¤Þ¤¹¡£ ¤³¤ÎŤµ¤Ë¤Ï¡¢¥ì¥³¡¼¥É¶èÀÚ¤ê¤Îʬ¤â´Þ¤ß¤Þ¤¹¡£ ¤³¤Î´Ø¿ô¤Ï¥ì¥³¡¼¥ÉËö¤Î¶èÀÚ¤ê¤òºï½ü¤·¤Þ¤»¤ó¡£ ¤Þ¤¿¡¢ °ú¿ô lenp ¤Î»Ø¤¹ÊÑ¿ô¤ËÊ֤ä¿ÃͤòÍøÍѤ¹¤ì¤ÐÎɤ¤¤Î¤Ç¾éŤǤ¹¤¬¡¢ ¥ì¥³¡¼¥ÉËö¤Ë '\0' ʸ»ú¤òÉղä·¤Þ¤¹¡£ EOF ¤Ï¡¢ÆþÎϤÎŤµ¤¬ 0 ¥Ð¥¤¥È¤Ç¤¢¤ë¤³¤È¤ÇȽÃǤ·¤Þ¤¹¡£ °ú¿ô¤È¤·¤Æ gfs_pio_readdelim(f, bufp, sizep, lenp, "\n", 1) ¤È»ØÄꤹ¤ë¤È¡¢´Ø¿ô gfs_pio_readline() ¤È Åù²Á¤Ë¤Ê¤ê¤Þ¤¹¡£ RETURN VALUES NULL Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ GFARM_ERR_NO_MEMORY ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ ¤³¤Î¾ì¹ç¤â¡¢bufp ¤Î»Ø¤¹¥Ý¥¤¥ó¥¿ÊÑ¿ô¤Î »Ø¤¹Îΰè¤ò free(3) ¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¤«¤éÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡£ ¤½¤Î¾ ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ EXAMPLES <function>gfs_pio_readdelim</function> ´Ø¿ô¤Î»ÈÍÑÎã #include <stdio.h> #include <stdlib.h> #include <string.h> #include <gfarm/gfarm.h> int main(int argc, char **argv) { char *e; GFS_File gf; size_t bufsize = 0, delimlen = 1, len; char *buffer = NULL, *delim = "\n"; e = gfarm_initialize(&argc, &argv); if (e != NULL) { fprintf(stderr, "gfarm_initialize: %s\n", e); return (EXIT_FAILURE); } while ((c = getopt(argc, argv, "d:D")) != -1) { switch (c) { case 'd': delim = optarg; delimlen = strlen(optarg); break; case 'D': delim = NULL; delimlen = 0; break; case '?': default: fprintf(stderr, "invalid option: %c\n", c); return (EXIT_FAILURE); } } if (optind >= argc) { fprintf(stderr, "missing gfarm filename\n"); return (EXIT_FAILURE); } e = gfs_pio_open(argv[optind], GFARM_FILE_RDONLY, &gf); if (e != NULL) { fprintf(stderr, "%s: %s\n", argv[optind], e); return (EXIT_FAILURE); } e = gfs_pio_set_view_global(gf, 0); if (e != NULL) { fprintf(stderr, "%s: gfs_pio_set_view_global: %s\n", argv[optind], e); return (EXIT_FAILURE); } while ((e = gfs_pio_readdelim(gf, &buffer, &bufsize, &len, delim, delimlen)) == NULL && len > 0) { printf("<%6d/%6d >%s", len, bufsize, buffer); } if (buffer != NULL) free(buffer); if (e != NULL) { fprintf(stderr, "ERROR: %s\n", e); return (EXIT_FAILURE); } e = gfs_pio_close(gf); if (e != NULL) { fprintf(stderr, "gfs_pio_close: %s\n", e); return (EXIT_FAILURE); } e = gfarm_terminate(); if (e != NULL) { fprintf(stderr, "gfarm_initialize: %s\n", e); return (EXIT_FAILURE); } return (EXIT_SUCCESS); } SEE ALSO gfs_pio_open3, gfs_pio_getline3, gfs_pio_gets3, gfs_pio_readline3 gfarm-2.4.1/doc/docbook/ja/ref/man3/gfs_pio_getline.3.docbook0000644000000000000000000000430511507222721022342 0ustar rootroot 1 May 2002 gfs_pio_getline 3 Gfarm gfs_pio_getline °ì¹ÔÆÉ¤ß¹þ¤ß #include <gfarm/gfarm.h> char *gfs_pio_getline GFS_File f char * s size_t size int * eofp DESCRIPTION ¥Õ¥¡¥¤¥ë gf ¤«¤é¡¢Ê¸»úÎó s ¤Ë¡¢°ì¹ÔÆÉ¤ß¹þ¤ß¤Þ¤¹¡£ °ú¿ô size ¤Ëʸ»úÇÛÎó s ¤ÎÂ礭¤µ¤ò»ØÄꤷ¤Þ¤¹¡£¹Ô¤¬ size ¤ò±Û¤¨¤¿¾ì¹ç¤È¡¢°ì¹Ô¤ÎŤµ¤¬¤Á¤ç¤¦¤É size - 1 ¤À¤Ã¤¿¾ì¹ç¤ò¶èÊ̤¹¤ë¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó¡£ EOF ¤Î¾ì¹ç¤Ë¤Ï eofp ¤Î»Ø¤¹Àè¤Ë 1 ¤òÊÖ¤·¡¢¤µ¤â¤Ê¤¯¤Ð 0 ¤òÊÖ¤·¤Þ¤¹¡£ RETURN VALUES NULL Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ GFARM_ERR_NO_MEMORY ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ ¤½¤Î¾ ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ SEE ALSO gfs_pio_create3, gfs_pio_open3 gfarm-2.4.1/doc/docbook/ja/ref/man3/gfs_pio_set_view_index.3.docbook0000644000000000000000000001073711507222721023735 0ustar rootroot 1 May 2002 gfs_pio_set_view_index 3 Gfarm gfs_pio_set_view_index fragment ñ°Ì¤Î¥¢¥¯¥»¥¹¤ò»ØÄꤹ¤ë #include <gfarm/gfarm.h> char *gfs_pio_set_view_index GFS_File gf int fragment_number int fragment_index char *host int flags DESCRIPTION ¥Õ¥¡¥¤¥ë¤ò¥Õ¥é¥°¥á¥ó¥Èñ°Ì¤Ç¥¢¥¯¥»¥¹¤¹¤ë¤³¤È¤ò»ØÄꤷ¤Þ¤¹¡£ ¿·µ¬ºîÀ®¤·¤¿¥Õ¥¡¥¤¥ë¤Î¾ì¹ç¡¢É¬¤º°ú¿ô fragment_number ¤Ë¥Õ¥é¥°¥á¥ó¥È ¤ÎÁí¿ô¤ò»ØÄꤹ¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£¤³¤ÎÃͤϡ¢¤³¤ÎÊÂÎó¥Õ¥¡¥¤¥ë¤ò³«¤¯Á´¤Æ ¤Î¥Î¡¼¥É¤Ç¡¢Æ±¤¸ÃͤǤʤ¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡£´û¸¤Î¥Õ¥¡¥¤¥ë¤Î¾ì¹ç¤Ë¤Ï¡¢ ¤³¤³¤Ë GFARM_FILE_DONTCARE ¤È½ñ¤±¤Ð¡¢»ØÄê¤ò¾Êά¤Ç¤­¤Þ¤¹¡£¤â¤· ¤â¤·¼ÂºÝ¤È°Û¤Ê¤ë¿ô¤ò»ØÄꤷ¤¿¾ì¹ç¤Ë¤Ï¡¢¤³¤Î´Ø¿ô¤Ï¥¨¥é¡¼¤Ç¼ºÇÔ¤·¤Þ¤¹¡£ °ú¿ô fragment_index ¤Ë¤Ï¡¢ ¥¢¥¯¥»¥¹¤¹¤ë¥Õ¥é¥°¥á¥ó¥È¤ÎÈÖ¹æ¤ò»ØÄꤷ¤Þ¤¹¡£ °ú¿ô host ¤Ï¡¢¥¢¥¯¥»¥¹¤·¤¿¤¤¥Û¥¹¥È¤òÌÀ¼¨Åª¤Ë»ØÄꤷ¤¿¤¤»þ¤ËÍøÍѤ·¤Þ¤¹¡£ »ØÄ꤬ÉÔÍפʤé NULL ¤òÅϤ»¤Ð¾Êά¤Ç¤­¤Þ¤¹¡£ °ú¿ô flag ¤Ë¤Ï¡¢ GFARM_FILE_SEQUENTIAL ¡¢ GFARM_FILE_REPLICATE ¡¢ GFARM_FILE_NOT_REPLICATE ¤ÎÏÀÍýϤ¬»ØÄê¤Ç¤­¤Þ¤¹¡£ ¤³¤ì¤é¤Ï¡¢²¼µ­¤ò°ÕÌ£¤·¤Þ¤¹¡£ GFARM_FILE_SEQUENTIAL ¤³¤Î¥Õ¥é¥°¥á¥ó¥È¤Ë´Ø¤·¤Æ¤Ï¥·¡¼¥±¥ó¥·¥ã¥ë¡¦¥¢¥¯¥»¥¹¤Î¤ß¤ò¹Ô¤Ê¤¦¤³¤È ¤ò¼¨¤·¤Þ¤¹¡£ GFARM_FILE_REPLICATE ¤¢¤é¤«¤¸¤á¡¢¥í¡¼¥«¥ë¡¦¥Î¡¼¥É¤Ë¥ì¥×¥ê¥«¤òÍѰդ·¤Æ¤«¤é¥¢¥¯¥»¥¹¤¹¤ë¤³¤È¤ò »ØÄꤷ¤Þ¤¹¡£GFARM_FILE_NOT_REPLICATE ¤È¤ÏÇÓ¾Ū¤Ê¥ª¥×¥·¥ç¥ó¤Ç¤¹¡£ GFARM_FILE_NOT_REPLICATE ´û¤Ë¥ì¥×¥ê¥«¤¬¤¢¤ë¾ì¹ç¤ò½ü¤­¡¢¤³¤Î¥Î¡¼¥É¤Ë¥ì¥×¥ê¥«¤òÍѰդ·¤Ê¤¤¤³¤È ¤ò»ØÄꤷ¤Þ¤¹¡£GFARM_FILE_REPLICATE ¤È¤ÏÇÓ¾Ū¤Ê¥ª¥×¥·¥ç¥ó¤Ç¤¹¡£ ¤³¤Î´Ø¿ô¤ò¸Æ¤Ð¤Ê¤¤¾õÂ֤Ǥϡ¢Gfarm ¥Õ¥¡¥¤¥ë¤Ï global view ¾õÂ֤ȤʤäƤª¤ê¡¢Á´¤Æ¤Î¥Õ¥é¥°¥á¥ó¥È¤¬·ë¹ç¤µ¤ì¤¿Ã±°ì¥Õ¥¡¥¤¥ë¤Ë¸«¤¨¤Þ¤¹¡£ RETURN VALUES NULL Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ GFARM_ERR_NO_MEMORY ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ GFARM_ERR_OPERATION_NOT_PERMITTED »ØÄꤷ¤¿¥Ñ¥¹Ì¾¤¬¡¢¥Õ¥é¥°¥á¥ó¥È²½¥Õ¥¡¥¤¥ë¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£ GFARM_ERR_FRAGMENT_NUMBER_DOES_NOT_MATCH »ØÄꤷ¤¿¥Õ¥é¥°¥á¥ó¥ÈÁí¿ô¤¬¡¢ÉÔŬÀڤǤ¹¡£ GFARM_ERR_INVALID_ARGUMENT ´Ø¿ô°ú¿ô¤¬ÉÔŬÀڤǤ¹¡£¤¿¤È¤¨¤Ð¡¢¥Õ¥¡¥¤¥ë¤Î¿·µ¬ºîÀ®»þ¤Ë¡¢ ¥Õ¥é¥°¥á¥ó¥ÈÁí¿ô¤È¤·¤Æ GFARM_FILE_DONTCARE ¤ò»ØÄꤹ¤ë¤È¡¢¤³¤Î¥¨¥é¡¼¤¬À¸¤¸¤Þ¤¹¡£ ¤½¤Î¾ ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ SEE ALSO gfs_pio_create3, gfs_pio_open3, gfs_pio_set_view_local3 gfarm-2.4.1/doc/docbook/ja/ref/man3/gfarm_stringlist_cat.3.docbook0000644000000000000000000000475111507222721023417 0ustar rootroot 1 May 2002 gfarm_stringlist_cat 3 Gfarm gfarm_stringlist_cat stringlist ¤Ëʸ»úÎóÇÛÎó¤òÄɲ乤ë #include <gfarm/gfarm.h> char *gfarm_stringlist_cat gfarm_stringlist * listp char ** v DESCRIPTION listp ¤Îɽ¤¹Ê¸»úÎóÇÛÎó¤ÎËöÈø¤Ë¡¢NULL ¤Ç½ªÎ»¤¹¤ëʸ»úÎóÇÛÎó v ¤òÄɲä·¤Þ¤¹¡£ RETURN VALUES NULL Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ GFARM_ERR_NO_MEMORY ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ ¤½¤Î¾ ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ SEE ALSO GFARM_STRINGLIST_ELEM3, GFARM_STRINGLIST_STRARRAY3, gfarm_stringlist_add3, gfarm_stringlist_elem3, gfarm_stringlist_free3, gfarm_stringlist_free_deeply3, gfarm_stringlist_init3, gfarm_stringlist_length3 gfarm-2.4.1/doc/docbook/ja/ref/man3/gfs_unlink_section.3.docbook0000644000000000000000000000474711507222721023102 0ustar rootroot 19 May 2005 gfs_unlink_section 3 Gfarm gfs_unlink_section ¥Õ¥¡¥¤¥ë¥»¥¯¥·¥ç¥óºï½ü #include <gfarm/gfarm.h> char *gfs_unlink_section char * gfarm_url char * section DESCRIPTION °ú¿ô gfarm_url, section ¤Ë»ØÄꤷ¤¿¥Õ¥¡¥¤¥ë¥»¥¯¥·¥ç¥ó¤òºï½ü¤·¤Þ¤¹¡£ RETURN VALUES NULL Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ GFARM_ERR_NO_MEMORY ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ GFARM_ERR_AUTHENTICATION gfmd(8) ¤ËÂФ¹¤ë¥æ¡¼¥¶¡¼Ç§¾Ú¤¬¼ºÇÔ¤·¤Þ¤·¤¿¡£ GFARM_ERR_PERMISSION_DENIED gfarm_url ¤Î¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤Ø½ñ¤­¹þ¤ß¥¢¥¯¥»¥¹¤¹¤ë¸¢¸Â¤¬¤¢¤ê¤Þ¤»¤ó¡£ GFARM_ERR_NO_SUCH_OBJECT »ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¥»¥¯¥·¥ç¥ó¤¬Â¸ºß¤·¤Þ¤»¤ó¡£ GFARM_ERR_NOT_A_DIRECTORY »ØÄꤷ¤¿¥Ñ¥¹Ì¾¤Î¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤¬¡¢¼ÂºÝ¤Ë¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤«¤Ã¤¿¤³¤È¤ò ¼¨¤·¤Þ¤¹¡£ ¤½¤Î¾ ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ gfarm-2.4.1/doc/docbook/ja/ref/man3/gfs_realpath.3.docbook0000644000000000000000000000507711507222721021653 0ustar rootroot 30 Sep 2003 gfs_realpath 3 Gfarm gfs_realpath Àµµ¬²½¤µ¤ì¤¿ÀäÂХѥ¹Ì¾¤òÊÖ¤¹ #include <gfarm/gfarm.h> char *gfs_realpath const char * gfarm_url char ** resolved_pathp DESCRIPTION gfs_realpath ¤Ï¡¤ gfarm_url ¤ÇÍ¿¤¨¤é¤ì¤¿¥Ñ¥¹Ì¾¤Î¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê¤òŸ³«¤·¡¤ '.'¡¤'..' ¤ä;ʬ¤Ê '/' ¤ò²ò·è¤·¤Æ¡¤ Àµµ¬²½¤µ¤ì¤¿ÀäÂХѥ¹Ì¾¤òưŪ¤Ë³ÎÊݤµ¤ì¤ë¥á¥â¥ê¤Ë³ÊǼ¤·¤Þ¤¹¡¥ ưŪ¤Ë³ÎÊݤµ¤ì¤¿¥á¥â¥ê¤Î¥Ý¥¤¥ó¥¿¤Ï resolved_pathp ¤ËÊÖ¤µ¤ì¤Þ¤¹¡¥ ¤³¤Î¥á¥â¥êÎΰè¤Ï¤³¤Î¸å free(3) ¤Ë¤è¤ê³«Êü¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡¥ RETURN VALUES NULL Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡¥ GFARM_ERR_NO_MEMORY ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡¥ GFARM_ERR_NOT_A_DIRECTORY »ØÄꤷ¤¿¥Ñ¥¹Ì¾¤Î¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤¬¡¢¼ÂºÝ¤Ë¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ê¤«¤Ã¤¿ ¤³¤È¤ò¼¨¤·¤Þ¤¹¡¥ GFARM_ERR_INVALID_ARGUMENT gfarm_url ¤¬ NULL ¥Ý¥¤¥ó¥¿¤Ç¤¹¡¥ GFARM_ERR_PERMISSION_DENIED »ØÄꤵ¤ì¤¿¥Ñ¥¹¤Ø¥¢¥¯¥»¥¹¤¹¤ë¸¢¸Â¤¬¤¢¤ê¤Þ¤»¤ó¡¥ GFARM_ERR_NO_SUCH_OBJECT »ØÄꤵ¤ì¤¿¥Ñ¥¹Ì¾¤¬Â¸ºß¤·¤Þ¤»¤ó¡¥ ¤½¤Î¾ ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡¥ gfarm-2.4.1/doc/docbook/ja/ref/man3/gfs_glob_free.3.docbook0000644000000000000000000000241611507222721021771 0ustar rootroot 2 Sep 2003 gfs_glob_free 3 Gfarm gfs_glob_free ¥Ñ¥¹¤Î¥¿¥¤¥×¤ò³ÊǼ¤·¤Æ¤¤¤ëÎΰè¤ò²òÊü¤¹¤ë #include <gfarm/gfarm.h> char *gfs_glob_free gfs_glob_t * listp DESCRIPTION ¥Ñ¥¹¤Î¥¿¥¤¥×¤ò³ÊǼ¤¹¤ë¤¿¤á¤ËưŪ¤Ë³ÎÊݤ·¤¿Îΰè¤ò²òÊü¤·¤Þ¤¹¡£ SEE ALSO gfs_glob_init3 gfs_glob3 gfs_glob_add3 gfarm-2.4.1/doc/docbook/ja/ref/man3/gfs_readdir.3.docbook0000644000000000000000000000365011507222721021460 0ustar rootroot 1 May 2002 gfs_readdir 3 Gfarm gfs_readdir ¥Ç¥£¥ì¥¯¥È¥êÆâÍÆÆÉ¤ß¹þ¤ß #include <gfarm/gfarm.h> char *gfs_readdir GFS_Dir dir struct gfs_dirent ** entryp DESCRIPTION °ú¿ô dir ¤Ç»ØÄꤷ¤¿¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¡¢1 ¤Ä¤Î¥Ç¥£¥ì¥¯¥È¥ê¡¦¥¨¥ó¥È¥ê ¤òÆÉ¤ß¹þ¤ß¡¢¤½¤Î¥Ý¥¤¥ó¥¿¤ò entryp ¤Î»Ø¤¹Àè¤ËÊÖ¤·¤Þ¤¹¡£ entryp ¤Î»Ø¤¹Îΰè¤Ï¡¢¼¡¤ËƱ¤¸ dir °ú¿ô¤Ç gfs_readdir() ¤Ê¤¤¤· gfs_closedir() ¤ò¸Æ¤Ó½Ð¤·¤¿»þ¤Ë¼º¤ï¤ì¤Þ¤¹¡£ RETURN VALUES NULL Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ ¤½¤Î¾ ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ SEE ALSO gfs_closedir3, gfs_opendir3, gfs_readdir3 gfarm-2.4.1/doc/docbook/ja/ref/man3/gfs_rename.3.docbook0000644000000000000000000000663211507222721021320 0ustar rootroot 21 Feb 2005 gfs_rename 3 Gfarm gfs_rename ¥Õ¥¡¥¤¥ë¤ò²þ̾¤¹¤ë #include <gfarm/gfarm.h> char *gfs_rename char * gfarm_url_from char * gfarm_url_to DESCRIPTION ¥Õ¥¡¥¤¥ë¤Þ¤¿¤Ï¥Ç¥£¥ì¥¯¥È¥ê gfarm_url_from ¤ò gfarm_url_to ¤Ë²þ̾¤·¤Þ¤¹¡£ gfarm_url_to ¤¬´û¸¤Î¾ì¹ç¤Ïºï½ü¤µ¤ì¤Þ¤¹¡£¤³¤Î¤È¤­ gfarm_url_from ¤¬¥Õ¥¡¥¤¥ë¤Ê¤é¤Ð gfarm_url_to ¤â¥Õ¥¡¥¤¥ë¡¢ gfarm_url_from ¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Ê¤é¤Ð gfarm_url_to ¤â¥Ç¥£¥ì¥¯¥È¥ê¤Ç¡¢¤·¤«¤â¶õ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£ ¥Ç¥£¥ì¥¯¥È¥ê gfarm_url_from ¤ò¤½¤Î¥µ¥Ö¥Ç¥£¥ì¥¯¥È¥ê¤Ë²þ̾¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó¡£ RETURN VALUES NULL Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ GFARM_ERR_NO_MEMORY ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ GFARM_ERR_AUTHENTICATION gfmd(8) ¤ËÂФ¹¤ë¥æ¡¼¥¶¡¼Ç§¾Ú¤¬¼ºÇÔ¤·¤Þ¤·¤¿¡£ GFARM_ERR_PERMISSION_DENIED ¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤Ø½ñ¤­¹þ¤ß¥¢¥¯¥»¥¹¤¹¤ë¸¢¸Â¤¬¤¢¤ê¤Þ¤»¤ó¡£ GFARM_ERR_INVALID_ARGUMENT ¥Ç¥£¥ì¥¯¥È¥ê gfarm_url_from ¤ò¡¢¤½¤ì¼«¿È¤Î¥µ¥Ö¥Ç¥£¥ì¥¯¥È¥ê¤ËÊѹ¹¤·¤è¤¦¤È¤·¤Þ¤·¤¿¡£ GFARM_ERR_NO_SUCH_OBJECT »ØÄꤵ¤ì¤¿¥Ñ¥¹ gfarm_url_from ¤¬Â¸ºß¤·¤Þ¤»¤ó¡£ GFARM_ERR_IS_A_DIRECTORY gfarm_url_from ¤¬¥Õ¥¡¥¤¥ë¤Ç¤¢¤ë¤Î¤Ë¡¢ gfarm_url_to ¤Ï´û¸¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤¹¡£ GFARM_NOT_IS_A_DIRECTORY gfarm_url_from ¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤¢¤ë¤Î¤Ë¡¢ gfarm_url_to ¤Ï´û¸¤Î¥Õ¥¡¥¤¥ë¤Ç¤¹¡£ ¤½¤Î¾ ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ gfarm-2.4.1/doc/docbook/ja/ref/man3/gfs_pio_create.3.docbook0000644000000000000000000001754611507222721022171 0ustar rootroot 27 Jun 2010 gfs_pio_create 3 Gfarm gfs_pio_create Gfarm¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥Õ¥¡¥¤¥ë¤ÎºîÀ® #include <gfarm/gfarm.h> gfarm_error_t gfs_pio_create const char * gfarm_url int flags gfarm_mode_t mode GFS_File * gfp DESCRIPTION »ØÄꤷ¤¿ gfarm_url ¤Ë¡¢¥â¡¼¥É mode ¤Ç¥Õ¥¡¥¤¥ë¤ò¿·µ¬ºîÀ®¤·¡¢ GFS_File ¹½Â¤ÂΤò gfp ¤Î»Ø¤¹Àè¤ËÊÖ¤·¤Þ¤¹¡£ °ú¿ô flags ¤Ï¡¢ gfs_pio_open() ¤ÎÂèÆó°ú¿ô¤ÈƱ¤¸°ÕÌ£¤ò»ý¤Á¤Þ¤¹¡£ GFARM_FILE_RDONLY¡¢ GFARM_FILE_WRONLY¡¢ GFARM_FILE_RDWR ¤Î¤¤¤º¤ì¤«°ì¤Ä¤Î¥Õ¥é¥°¤òɬ¤º»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤ÅÀ¤âƱ¤¸¤Ç¤¹¡£ °ú¿ô flags ¤ÎÃͤȤ·¤Æ GFARM_FILE_TRUNC ¤¬É¬Íפʾì¹ç¤Ï¡¢ ÌÀ¼¨Åª¤Ë»ØÄꤹ¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¤Î¤Ç¡¢¤´Ãí°Õ¤¯¤À¤µ¤¤¡£ RETURN VALUES GFARM_ERR_NO_ERROR Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ GFARM_ERR_IS_A_DIRECTORY »ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤¹¡£ GFARM_ERR_IS_A_SYMBOLIC_LINK »ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤Ï¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Ç¤¹¡£ GFARM_ERR_OPERATION_NOT_PERMITTED »ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤Ï¥Õ¥¡¥¤¥ë¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£ GFARM_ERR_NOT_A_DIRECTORY »ØÄꤷ¤¿¥Ñ¥¹Ì¾¤Î¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤¬¡¢¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£ GFARM_ERR_PERMISSION_DENIED »ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤ËÂФ·¡¢ flags ¤Ç»ØÄꤵ¤ì¤¿¥â¡¼¥É¤Ç¥¢¥¯¥»¥¹¤¹¤ë¸¢¸Â¤¬¤Ê¤¤¤«¡¢¤½¤Î¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤Ø¤Î ½ñ¤­¹þ¤ß¸¢¸Â¤¬¤¢¤ê¤Þ¤»¤ó¡£ ¤¢¤ë¤¤¤Ï¡¢¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤Ø¤Îǧ¾Ú¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£ GFARM_ERR_NO_MEMORY ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ GFARM_ERR_INVALID_ARGUMENT flags ¤Î»ØÄ꤬ÉÔÀµ¤Ç¤¹¡£ GFARM_ERR_GFARM_URL_HOST_IS_MISSING gfarm_url ¤Ç»ØÄꤵ¤ì¤¿Gfarm URL¤Ë¤ª¤¤¤Æ¡¢ ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤¬»ØÄꤵ¤ì¤Æ¤¤¤Þ¤»¤ó¡£ GFARM_ERR_GFARM_URL_PORT_IS_MISSING gfarm_url ¤Ç»ØÄꤵ¤ì¤¿Gfarm URL¤Ë¤ª¤¤¤Æ¡¢ ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤Î¥Ý¡¼¥ÈÈֹ椬»ØÄꤵ¤ì¤Æ¤¤¤Þ¤»¤ó¡£ GFARM_ERR_UNKNOWN_HOST »ØÄꤵ¤ì¤¿¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤Î¥¢¥É¥ì¥¹²ò·è¤¬¤Ç¤­¤Þ¤»¤ó¡£ GFARM_ERR_TOO_MANY_OPEN_FILES ¥×¥í¥»¥¹¤Ë¤ª¤±¤ë¥ª¡¼¥×¥ó²Äǽ¤Ê¥Õ¥¡¥¤¥ë¿ô¤Î¸Â³¦¤Ë㤷¤Þ¤·¤¿¡£ GFARM_ERR_TOO_MANY_OPEN_FILES_IN_SYSTEM ¥·¥¹¥Æ¥à¤Ë¤ª¤±¤ë¥ª¡¼¥×¥ó¤Ç¤­¤ë¥Õ¥¡¥¤¥ë¿ô¤Î¸Â³¦¤Ë㤷¤Þ¤·¤¿¡£ GFARM_ERR_NETWORK_IS_UNREACHABLE ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤ËÅþã¤Ç¤­¤Þ¤»¤ó¡£ GFARM_ERR_OPERATION_TIMED_OUT ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤Ø¤ÎÀܳ¤¬¥¿¥¤¥à¥¢¥¦¥È¤ò¤ª¤³¤·¤Þ¤·¤¿¡£ GFARM_ERR_PROTOCOL ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤È¤ÎÄÌ¿®¤Ë¥×¥í¥È¥³¥ë¥¨¥é¡¼¤¬È¯À¸¤·¤Þ¤·¤¿¡£ GFARM_ERR_BROKEN_PIPE ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤È¤ÎÄÌ¿®¤¬ÀÚÃǤ·¤Þ¤·¤¿¡£ GFARM_ERR_PROTOCOL_NOT_SUPPORTED »ØÄꤵ¤ì¤¿Ç§¾Ú¥×¥í¥È¥³¥ë¤Ï¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Þ¤»¤ó¡£ GFARM_ERR_AUTHENTICATION ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤ËÂФ¹¤ëǧ¾Ú¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£ ¤½¤Î¾ ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ gfarm_error_string3 ¤Ë¤è¤ê¥¨¥é¡¼¤Î¸¶°ø¤òʸ»úÎó¤ËÊÑ´¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ SEE ALSO gfs_pio_close3, gfs_pio_create3, gfs_pio_eof3, gfs_pio_error3, gfs_pio_flush3, gfs_pio_getc3, gfs_pio_getline3, gfs_pio_open3, gfs_pio_putc3, gfs_pio_putline3, gfs_pio_puts3, gfs_pio_read3, gfs_pio_seek3, gfs_pio_ungetc3, gfs_pio_write3 gfarm-2.4.1/doc/docbook/ja/ref/man3/gfs_pio_puts.3.docbook0000644000000000000000000000334611507222721021712 0ustar rootroot 1 May 2002 gfs_pio_puts 3 Gfarm gfs_pio_puts ʸ»úÎó½ñ¤­¹þ¤ß #include <gfarm/gfarm.h> char *gfs_pio_puts GFS_File gf char * s DESCRIPTION ʸ»úÎó s ¤ò¥Õ¥¡¥¤¥ë gf ¤Ë½ñ¤­¹þ¤ß¤Þ¤¹¡£ RETURN VALUES NULL Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ GFARM_ERR_NO_MEMORY ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ ¤½¤Î¾ ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ SEE ALSO gfs_pio_create3, gfs_pio_open3 gfarm-2.4.1/doc/docbook/ja/ref/man3/gfs_pio_getc.3.docbook0000644000000000000000000000370411507222721021637 0ustar rootroot 1 May 2002 gfs_pio_getc 3 Gfarm gfs_pio_getc °ìʸ»úÆÉ¤ß¹þ¤ß #include <gfarm/gfarm.h> int gfs_pio_getc GFS_File gf DESCRIPTION ¥Õ¥¡¥¤¥ë gf ¤«¤é°ìʸ»úÆÉ¤ß¹þ¤ß¤Þ¤¹¡£ RETURN VALUES EOF ¥Õ¥¡¥¤¥ë¤ÎËöÈø¤Ë㤷¤¿¾ì¹ç¡¢¤¢¤ë¤¤¤Ï¥¨¥é¡¼¤¬À¸¤¸¤¿¾ì¹ç¡¢<stdio.h> ¤Ç ÄêµÁ¤µ¤ì¤Æ¤¤¤ëÄê¿ô EOF ¤òÊÖ¤·¤Þ¤¹¡£ ¥Õ¥¡¥¤¥ëËöÈø¤Ê¤Î¤«¡¢¥¨¥é¡¼¤Ê¤Î¤«¤Ï¡¢´Ø¿ô gfs_pio_error(3) ¤ÇÃÎ¤ë ¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ ¤½¤Î¾ ¥Õ¥¡¥¤¥ë¤«¤éÆÉ¤ß¹þ¤ó¤Àʸ»ú¤òÊÖ¤·¤Þ¤¹¡£ SEE ALSO gfs_pio_create3, gfs_pio_eof3, gfs_pio_error3, gfs_pio_open3, gfs_pio_ungetc3 gfarm-2.4.1/doc/docbook/ja/ref/man3/gfarm.3.docbook0000644000000000000000000002315611507222721020306 0ustar rootroot 26 Jun 2010 gfarm 3 Gfarm gfarm Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à API ¥é¥¤¥Ö¥é¥ê #include <gfarm/gfarm.h> DESCRIPTION Gfarm ¥é¥¤¥Ö¥é¥ê¤Ï¡¤Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ä¡¤¥¹¥±¥¸¥å¡¼¥ê¥ó¥° µ¡Ç½¤ËÂФ¹¤ë¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤òÄ󶡤·¤Þ¤¹¡¥¤³¤Î¥Þ¥Ë¥å¥¢¥ë¤Ï¥é¥¤¥Ö¥é¥ê ¤Î³µÍפòµ­½Ò¤·¤Þ¤¹¡¥³Æ´Ø¿ô¤Î¾ÜºÙ¤Ï¡¤´Ø¿ôñ°Ì¤Î¥Þ¥Ë¥å¥¢¥ë¤ò»²¾È¤·¤Æ ¤¯¤À¤µ¤¤¡¥ ½é´ü²½¡¿½ªÎ»½èÍý gfarm_initialize3 ´Ø¿ô¤Ï Gfarm ¥é¥¤¥Ö¥é¥ê¤Î½é´ü²½¤Ë¡¤ gfarm_terminate3 ´Ø¿ô¤Ï Gfarm ¥é¥¤¥Ö¥é¥ê¤Î½ªÎ»½èÍý¤ËÍѤ¤¤Þ¤¹¡¥ ¥Õ¥¡¥¤¥ëÆþ½ÐÎϽèÍý ´û¸¤Î¥Õ¥¡¥¤¥ë¤ò¥¹¥È¥ê¡¼¥à¤È¤·¤Æ¥ª¡¼¥×¥ó¤¹¤ë¤Ë¤Ï gfs_pio_open3 ´Ø¿ô¤ò¡¤ ¿·µ¬¥Õ¥¡¥¤¥ë¤òºîÀ®¤·¤Æ¥¹¥È¥ê¡¼¥à¤È¤·¤Æ¥ª¡¼¥×¥ó¤¹¤ë¤Ë¤Ï gfs_pio_create3 ´Ø¿ô¤òÍѤ¤¤Þ¤¹¡¥ ¥Õ¥¡¥¤¥ë¤Î¥¯¥í¡¼¥º¤Ï gfs_pio_close3 ´Ø¿ô¤ò»È¤¤¤Þ¤¹¡¥ gfs_pio_error3 ´Ø¿ô¤Ï¥ª¡¼¥×¥ó¤·¤Æ¤¤¤ë¥¹¥È¥ê¡¼¥à¤Ë´Ø¤·¤Æ¥¨¥é¡¼¤¬À¸¤¸¤Æ¤¤¤ë¤« ¤òȽÊ̤·¡¤ gfs_pio_eof3 ´Ø¿ô¤ÏÆÉ¤ß¹þ¤ß¥ª¡¼¥×¥ó¤·¤Æ¤¤¤ë¥¹¥È¥ê¡¼¥à¤¬¥Õ¥¡¥¤¥ë ËöÈø¤Ë㤷¤Æ¤¤¤ë¤«¤òȽÊ̤·¤Þ¤¹¡¥ gfs_pio_seek3 ´Ø¿ô¤Ï¡¤¥¹¥È¥ê¡¼¥àÃæ¤Î¸½ºß°ÌÃÖ¤òÊѹ¹¤·¤Þ¤¹¡¥ gfs_pio_getc3 ´Ø¿ô¤Ï¥¹¥È¥ê¡¼¥à¤«¤é°ìʸ»úÆÉ¤ß¹þ¤ß¡¤ gfs_pio_ungetc3 ´Ø¿ô¤ÏµÕ¤ËÆÉ¤ß¹þ¤ó¤À°ìʸ»ú¤ò¥¹¥È¥ê¡¼¥à¤ËÌᤷ¤Þ¤¹¡¥ gfs_pio_getline3 ´Ø¿ô¤ä gfs_pio_gets3 ´Ø¿ô¡¤ gfs_pio_readline3 ´Ø¿ô¤Ï¡¤¥¹¥È¥ê¡¼¥à¤«¤é°ì¹Ô¤òÆÉ¤ß¹þ¤ß¡¤ gfs_pio_readdelim3 ´Ø¿ô¤Ï¡¤¥¹¥È¥ê¡¼¥à¤«¤é»ØÄꤷ¤¿¥Ç¥ê¥ß¥¿¤Þ¤Ç¤òÆÉ¤ß¹þ¤ß¤Þ¤¹¡¥ gfs_pio_read3 ´Ø¿ô¤Ï¡¤¥¹¥È¥ê¡¼¥à¤«¤é»ØÄꤷ¤¿¥Ð¥¤¥È¿ô¤À¤±ÆÉ¤ß¹þ¤ß¤Þ¤¹¡¥ gfs_pio_putc3 ´Ø¿ô¤Ï¥¹¥È¥ê¡¼¥à¤Ø°ìʸ»ú½ñ¤­¤À¤·¡¤ gfs_pio_putline3 ´Ø¿ô¤ä gfs_pio_puts3 ´Ø¿ô¤Ï¥¹¥È¥ê¡¼¥à¤Ø°ì¹Ô½ñ¤­¤À¤·¤Þ¤¹¡¥ gfs_pio_write3 ´Ø¿ô¤Ï¡¤¥¹¥È¥ê¡¼¥à¤Ø»ØÄꤷ¤¿¥Ð¥¤¥È¿ô¤À¤±½ñ¤­¹þ¤ß¤Þ¤¹¡¥ gfs_pio_flush3 ´Ø¿ô¤ä¡¤ gfs_pio_sync3 ´Ø¿ô¡¤ gfs_pio_datasync3 ´Ø¿ô¤Ï¡¤¥Ð¥Ã¥Õ¥¡¥ê¥ó¥°¤·¤Æ¤¤¤ë¥Ç¡¼¥¿¤òµ­²±ÁõÃ֤˽ñ¤­½Ð¤·¤Þ¤¹¡¥ gfs_pio_truncate3 ´Ø¿ô¤Ï¡¤¥Õ¥¡¥¤¥ë¤Î¥µ¥¤¥º¤òÊѹ¹¤·¤Þ¤¹¡¥ ¥Ç¥£¥ì¥¯¥È¥ê¥¢¥¯¥»¥¹ gfs_opendir3 ´Ø¿ô¤Ç¥Ç¥£¥ì¥¯¥È¥ê¤ò¥ª¡¼¥×¥ó¤¹¤ë¤È¡¤ gfs_readdir3 ´Ø¿ô¤Ç¡¤¤½¤Î¥Ç¥£¥ì¥¯¥È¥ê¤ò¹½À®¤¹¤ë¥¨¥ó¥È¥ê¤òÆÀ¤ë¤³¤È¤¬ ¤Ç¤­¤Þ¤¹¡¥¥ª¡¼¥×¥ó¤·¤¿¥Ç¥£¥ì¥¯¥È¥ê¤Ø¤Î¥¢¥¯¥»¥¹¤Ï¡¤ gfs_closedir3 ´Ø¿ô¤Ç½ªÎ»¤·¤Þ¤¹¡¥ gfs_glob_init3 ´Ø¿ô¤Ç½é´ü²½¤·¤¿ gfs_glob_t ¤ò gfs_glob3 ´Ø¿ô¤ËÅϤ¹¤³¤È¤Ç¡¤¥ï¥¤¥ë¥É¥«¡¼¥É¤ÎŸ³«¤ò¹Ô¤¦¤³¤È¤¬ ¤Ç¤­¤Þ¤¹¡¥ ÍøÍѤ¬½ª¤ï¤Ã¤¿¤é¡¤¤³¤ÎÎΰè¤Ï gfs_glob_free3 ´Ø¿ô¤Ç³«Êü¤·¤Þ¤¹¡¥ gfs_glob_add3 ´Ø¿ô¤Ï¡¤gfs_glob_t ¤Ë¥¨¥ó¥È¥ê¤òÄɲ乤ë¤Î¤ËÍѤ¤¤Þ¤¹¡¥ ¥Õ¥¡¥¤¥ë¡¿¥Ç¥£¥ì¥¯¥È¥êÁàºî gfs_chmod3 ´Ø¿ô¤Ç¥Õ¥¡¥¤¥ë¤Î¥â¡¼¥É¤òÊѹ¹¤·¡¤ gfs_chown3 ´Ø¿ô¤Ç¥Õ¥¡¥¤¥ë¤Î½êÍ­¼Ô¤òÊѹ¹¤·¡¤ gfs_utimes3 ´Ø¿ô¤Ç¥Õ¥¡¥¤¥ë¤Î¹¹¿·»þ¹ï¤È¥¢¥¯¥»¥¹»þ¹ï¤òÊѹ¹¤·¤Þ¤¹¡¥ gfs_mkdir3 ´Ø¿ô¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤òºîÀ®¤·¡¤ gfs_rmdir3 ´Ø¿ô¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤òºï½ü¤·¤Þ¤¹¡¥ gfs_unlink3 ´Ø¿ô¤Ï¥Õ¥¡¥¤¥ë¤òºï½ü¤·¡¤ gfs_rename3 ´Ø¿ô¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤ä¥Õ¥¡¥¤¥ë¤ò²þ̾¤·¤Þ¤¹¡¥ gfs_stat3 ´Ø¿ô¤Ï»ØÄꤷ¤¿¥Õ¥¡¥¤¥ë¤¢¤ë¤¤¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤Î¥µ¥¤¥º¤ä ¹¹¿·»þ¹ï¤Ê¤É¤Î¾ðÊó¤òÊÖ¤·¤Þ¤¹¡¥ ¤³¤Î´Ø¿ô¤¬ÊÖ¤·¤¿ gfs_stat ¹½Â¤ÂÎ¤Ï gfs_stat_free3 ´Ø¿ô¤òÍѤ¤¤Æ²òÊü¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡¥ ¥¨¥é¡¼¥³¡¼¥É ¤Û¤È¤ó¤É¤Î Gfarm ¥é¥¤¥Ö¥é¥ê¤Î´Ø¿ô¤Ï gfarm_error_t ·¿¤Î Gfarm ¥¨¥é¡¼¥³¡¼ ¥É¤òÊÖ¤·¤Þ¤¹¡£ gfarm_error_string3 ´Ø¿ô¤Ï Gfarm ¥¨¥é¡¼¥³¡¼¥É¤òɽ¤¹Ê¸»úÎó¤òÊÖ¤·¤Þ¤¹¡£ gfarm_errno_to_error3 ´Ø¿ô¤Ï errno ¤ò Gfarm ¥¨¥é¡¼¥³¡¼¥É¤ËÊÑ´¹¤·¤Þ¤¹¡£ gfarm_error_to_errno3 ´Ø¿ô¤Ï Gfarm ¥¨¥é¡¼¥³¡¼¥É¤ò errno ¤ËÊÑ´¹¤·¤Þ¤¹¡£ ʸ»úÎóÇÛÎóÁàºî¥æ¡¼¥Æ¥£¥ê¥Æ¥£ ʸ»úÎóÇÛÎó¤òɽ¤¹ gfarm_stringlist ·¿¤ÎÊÑ¿ô¤Ï¡¤ gfarm_stringlist_init3 ´Ø¿ô¤Ç½é´ü²½¤·¡¤ gfarm_stringlist_add3 ´Ø¿ô¤Çʸ»úÎó¤ò°ì¤ÄÄɲä·¡¤ gfarm_stringlist_cat3 ´Ø¿ô¤Çʸ»úÎó¤òÊ£¿ôÄɲä·¡¤ gfarm_stringlist_free3 ´Ø¿ô¤Ç²òÊü¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡¥ ʸ»úÎóÇÛÎó¤Î³ÆÍ×ÁÇʸ»úÎó¤Ë¤Ï gfarm_stringlist_elem3 ´Ø¿ô¤¢¤ë¤¤¤Ï GFARM_STRINGLIST_ELEM() ¥Þ¥¯¥í¤Ç¥¢¥¯¥»¥¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡¥ ¤Þ¤¿¡¤Ê¸»úÎóÇÛÎó¤ò¹½À®¤¹¤ëʸ»úÎó¤Î¿ô¤Ï gfarm_stringlist_length3 ´Ø¿ô¤ÇÆÀ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡¥ gfarm_strings_free_deeply3 ´Ø¿ô¤Ï¡¤Ê¸»úÎóÇÛÎ󤪤è¤Ó¤½¤ì¤ò¹½À®¤¹¤ë³ÆÊ¸»úÎó¤ËÂФ·¤Æ ɸ½à¥é¥¤¥Ö¥é¥ê´Ø¿ô¤Î free() ¤ò¸Æ¤Ó½Ð¤·¤Æ²òÊü¤·¤Þ¤¹¡¥ ʸ»úÎóÇÛÎóÁàºî¥æ¡¼¥Æ¥£¥ê¥Æ¥£¥Þ¥¯¥í GFARM_STRINGLIST_ELEM(list, i) gfarm_stringlist ·¿¤Î list °ú¿ô¤¬É½¤¹Ê¸»úÎóÇÛÎó¤Î i ÈÖÌܤÎÍ×ÁǤò ɽ¤¹¥Þ¥¯¥í¤Ç¤¹¡¥¤³¤Î¥Þ¥¯¥í¤Ïº¸ÊÕÃͤȤ·¤Æ»È¤¨¤Þ¤¹¡¥ ÃͤȤ·¤ÆÉ¾²Á¤·¤¿¾ì¹ç¤Ë¤Ï gfarm_stringlist_elem3 ´Ø¿ô¤ÈƱ°ì¤Î·ë²Ì¤òÊÖ¤·¤Þ¤¹¡¥ GFARM_STRINGLIST_STRARRAY(list) gfarm_stringlist ·¿¤Î list °ú¿ô¤¬ ɽ¤¹Ê¸»úÎóÇÛÎó¤ÎÀèÆ¬Í×ÁǤؤΥݥ¤¥ó¥¿¤òÊÖ¤·¤Þ¤¹¡¥ ÊÖ¤êÃͤϡ¤Ê¸»ú¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ø¤Î¥Ý¥¤¥ó¥¿¤È¤Ê¤ê¤Þ¤¹¡¥ gfarm-2.4.1/doc/docbook/ja/ref/man3/gfarm_url_section_replicate_from_to.3.docbook0000644000000000000000000000605611507222721026471 0ustar rootroot 4 Sep 2005 gfarm_url_section_replicate_from_to 3 Gfarm gfarm_url_section_replicate_from_to ¥Õ¥¡¥¤¥ë¥»¥¯¥·¥ç¥ó¤Î¥ì¥×¥ê¥«¤òºîÀ®¤¹¤ë #include <gfarm/gfarm.h> char *gfarm_url_section_replicate_from_to const char *gfarm_url char *section char *srchost char *dsthost DESCRIPTION ¥Õ¥¡¥¤¥ë gfarm_url ¤Î¥Õ¥¡¥¤¥ë¥»¥¯¥·¥ç¥ó section ¤ÎÊ£À½¤ò¡¢ srchost¤«¤é dsthost ¤ËºîÀ®¤·¤Þ¤¹¡£ ¥Õ¥¡¥¤¥ë¥»¥¯¥·¥ç¥ó¤È¤Ï¡¢¼Â¹Ô·Á¼°¤Î¥Õ¥¡¥¤¥ë¤Î¾ì¹ç¤Ï¥¢¡¼¥­¥Æ¥¯¥Á¥ã̾¡¢ Ä̾ï¥Õ¥¡¥¤¥ë¤Î¾ì¹ç¤Ï¥Õ¥¡¥¤¥ë¥¤¥ó¥Ç¥Ã¥¯¥¹ÈÖ¹æ¤È¤Ê¤ê¤Þ¤¹¡£ ¥Õ¥¡¥¤¥ë¥¤¥ó¥Ç¥Ã¥¯¥¹ÈÖ¹æ¤òÀ°¿ô¤Ç¤Ï¤Ê¤¯¡¢Ê¸»úÎó section ¤Ç»ØÄꤹ¤ëɬÍפ¬¤¢¤ë¤³¤È¤ËÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡£¤Þ¤¿¡¢¤Þ¤¿¤³¤Îʸ»úÎó¤Ï¡¢ ;ʬ¤Ê¶õÇò¤ä¡¢Àè¹Ô 0 ¤ò´Þ¤ó¤Ç¤Ï¤¤¤±¤Þ¤»¤ó¡£ »ØÄꤷ¤¿ srchost ¤Ë¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï¥¨¥é¡¼¤Ë¤Ê¤ê¤Þ¤¹¡£ RETURN VALUES NULL Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ GFARM_ERR_NO_MEMORY ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ GFARM_ERR_NO_SUCH_OBJECT »ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¡¢ ¤¢¤ë¤¤¤ÏÊ£À½ºîÀ®¸µ¤Î¥Û¥¹¥È¤Ë¥Õ¥¡¥¤¥ë¤ÎÊ£À½¤¬Â¸ºß¤·¤Þ¤»¤ó¡£ GFARM_ERR_TEXT_FILE_BUSY »ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤¬¸½ºß¡Ê¾¤Î¥×¥í¥»¥¹¤Ë¤è¤ê¡Ë¹¹¿·Ãæ¤Î¤¿¤á¡¢ ¥Õ¥¡¥¤¥ë¤ÎÊ£À½¤¬ºîÀ®¤Ç¤­¤Þ¤»¤ó¡£ ¤½¤Î¾ ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ SEE ALSO gfarm_url_section_replicate_to3, gfarm_url_fragments_replicate3 gfarm-2.4.1/doc/docbook/ja/ref/man3/gfs_pio_flush.3.docbook0000644000000000000000000000352211507222721022034 0ustar rootroot 1 May 2002 gfs_pio_flush 3 Gfarm gfs_pio_flush ½ñ¤­¹þ¤ß¤ò¥Õ¥é¥Ã¥·¥å¤¹¤ë¡£ #include <gfarm/gfarm.h> char *gfs_pio_flush GFS_File gf DESCRIPTION ½ñ¤­¹þ¤ßÍѤ˥ª¡¼¥×¥ó¤·¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë gf ¤Î¡¢½ñ¤­¹þ¤ß¥Ð¥Ã¥Õ¥¡¤Ëί¤Þ¤Ã¤Æ¤¤¤ë¥Ç¡¼¥¿¤ò¼ÂºÝ¤Ë¥Ç¥£¥¹¥¯¤Ë½ñ¤­¹þ¤ß¤Þ¤¹¡£ RETURN VALUES NULL Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ GFARM_ERR_NO_MEMORY ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ ¤½¤Î¾ ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ SEE ALSO gfs_pio_create3, gfs_pio_open3, gfs_pio_write3 gfarm-2.4.1/doc/docbook/ja/ref/man3/gfarm_stringlist_add.3.docbook0000644000000000000000000000471711507222721023402 0ustar rootroot 1 May 2002 gfarm_stringlist_add 3 Gfarm gfarm_stringlist_add stringlist ¤Ëʸ»úÎó¤òÄɲ乤ë #include <gfarm/gfarm.h> char *gfarm_stringlist_add gfarm_stringlist * listp char * s DESCRIPTION listp¤Îɽ¤¹Ê¸»úÎóÇÛÎó¤ÎËöÈø¤Ë¡¢Ê¸»úÎó s ¤òÄɲä·¤Þ¤¹¡£ RETURN VALUES NULL Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ GFARM_ERR_NO_MEMORY ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ ¤½¤Î¾ ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ SEE ALSO GFARM_STRINGLIST_ELEM3, GFARM_STRINGLIST_STRARRAY3, gfarm_stringlist_cat3, gfarm_stringlist_elem3, gfarm_stringlist_free3, gfarm_stringlist_free_deeply3, gfarm_stringlist_init3, gfarm_stringlist_length3 gfarm-2.4.1/doc/docbook/ja/ref/man3/gfarm_initialize.3.docbook0000644000000000000000000000700711507222721022524 0ustar rootroot 26 Jun 2010 gfarm_initialize 3 Gfarm gfarm_initialize Gfarm ¥é¥¤¥Ö¥é¥ê¤ò½é´ü²½¤¹¤ë #include <gfarm/gfarm.h> gfarm_error_t gfarm_initialize int * argcp char *** argvp DESCRIPTION Gfarm ¥é¥¤¥Ö¥é¥ê¤ò½é´ü²½¤·¤Þ¤¹¡£ Gfarm ¥é¥¤¥Ö¥é¥ê API ¤òÍøÍѤ¹¤ëÁ°¤Ëɬ¤º¸Æ¤ÖɬÍפ¬¤¢¤ê¤Þ¤¹¡£ °ú¿ô¤Ë¤Ï¡¢¥×¥í¥°¥é¥à¤Î main ´Ø¿ô¤Î argc °ú¿ô¤Ø¤Î¥Ý¥¤¥ó¥¿¤È¡¢ argv °ú¿ô¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÅϤ·¤Þ¤¹¡£ RETURN VALUES GFARM_ERR_NO_ERROR Àµ¾ï½ªÎ»¤ò¼¨¤·¤Þ¤¹¡£ GFARM_ERR_NO_MEMORY ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ GFARM_ERR_UNKNOWN_HOST »ØÄꤵ¤ì¤¿¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤Î¥¢¥É¥ì¥¹²ò·è¤¬¤Ç¤­¤Þ¤»¤ó¡£ GFARM_ERR_NETWORK_IS_UNREACHABLE ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤ËÅþã¤Ç¤­¤Þ¤»¤ó¡£ GFARM_ERR_OPERATION_TIMED_OUT ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤Ø¤ÎÀܳ¤¬¥¿¥¤¥à¥¢¥¦¥È¤ò¤ª¤³¤·¤Þ¤·¤¿¡£ GFARM_ERR_PROTOCOL ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤È¤ÎÄÌ¿®¤Ë¥×¥í¥È¥³¥ë¥¨¥é¡¼¤¬È¯À¸¤·¤Þ¤·¤¿¡£ GFARM_ERR_BROKEN_PIPE ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤È¤ÎÄÌ¿®¤¬ÀÚÃǤ·¤Þ¤·¤¿¡£ GFARM_ERR_PERMISSION_DENIED ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤Ø¤Îǧ¾Ú¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£ GFARM_ERR_PROTOCOL_NOT_SUPPORTED »ØÄꤵ¤ì¤¿Ç§¾Ú¥×¥í¥È¥³¥ë¤Ï¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Þ¤»¤ó¡£ GFARM_ERR_AUTHENTICATION ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤ËÂФ¹¤ëǧ¾Ú¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£ GFARM_ERR_NO_MEMORY ¥á¥â¥êÉÔ­¤Î¤¿¤á½èÍý¤òÃæ»ß¤·¤Þ¤·¤¿¡£ ¤½¤Î¾ ¾åµ­°Ê³°¤Î¥¨¥é¡¼¤¬À¸¤¸¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ gfarm_error_string3 ¤Ë¤è¤ê¥¨¥é¡¼¤Î¸¶°ø¤òʸ»úÎó¤ËÊÑ´¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ SEE ALSO gfarm_terminate3 gfarm-2.4.1/doc/docbook/ja/ref/man8/0000755000000000000000000000000011507222730015505 5ustar rootrootgfarm-2.4.1/doc/docbook/ja/ref/man8/Makefile.inc0000644000000000000000000000003611507222720017713 0ustar rootrootDOCBOOK = \ gfmd.8 \ gfsd.8 gfarm-2.4.1/doc/docbook/ja/ref/man8/gfmd.8.docbook0000644000000000000000000000667011507222720020142 0ustar rootroot 14 Feb 2008 gfmd 8 Gfarm gfmd(8) Gfarm¥á¥¿DB¡¦¥Ç¡¼¥â¥ó gfmd ¥ª¥×¥·¥ç¥ó DESCRIPTION gfmd¤Ï¡¢Gfarm¥é¥¤¥Ö¥é¥ê¤È¶¨Ä´¤·¤ÆÆ°ºî¤·¡¢Gfarm¥Õ¥¡¥¤¥ë¥·¥¹¥Æ ¥à¤Î¥á¥¿¥Ç¡¼¥¿¤Ø¤Î¥¢¥¯¥»¥¹¤òÄ󶡤¹¤ë¥Ç¡¼¥â¥ó¥×¥í¥°¥é¥à¤Ç¤¹¡£ gfmd¤ÏGfarm¤Î¥á¥¿DB¥µ¡¼¥Ð¡¼¡¦¥Û¥¹¥È¾å¤Ç¡¢ ¤¢¤é¤«¤¸¤áΩ¤Á¾å¤²¤Æ¤ª¤¯É¬Íפ¬¤¢¤ê¤Þ¤¹¡£ gfmd¤Ï¥æ¡¼¥¶¸¢¸Â¤Çưºî¤µ¤»¤ë¤³¤È¤â²Äǽ¤Ç¤¹¤¬¡¢¤³¤Î¾ì¹ç¾¤Î¥æ¡¼¥¶¤Ï¤³ ¤Îgfmd¤òÍøÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£ ¾ÜºÙ¤ÏSETUP.private.ja¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£ gfmd¤òÍøÍѤ¹¤ë¤¿¤á¤Ë¤Ï¡¤ ¥¯¥é¥¤¥¢¥ó¥È¥Î¡¼¥É¤Î~/.gfarm2rc¤¢¤ë¤¤¤Ï%%SYSCONFDIR%%/gfarm2.conf¤Î metadb_server_host¤ÇÍøÍѤ·¤¿¤¤gfmd¤Î¥Û¥¹¥È̾¡¤ metadb_server_port¤Ç¥Ý¡¼¥ÈÈÖ¹æ¤ò»ØÄꤹ¤ëɬÍפ¬¤¢¤ê¤Þ ¤¹¡¥ OPTIONS ¥í¥°¥ì¥Ù¥ë ¤³¤Î¥ª¥×¥·¥ç¥ó¤Ç»ØÄꤷ¤¿¥ì¥Ù¥ë°Ê¾å¤ÎÍ¥ÀèÅÙ¤Î¥í¥°¤ò½ÐÎϤ·¤Þ¤¹¡£ »ØÄê¤Ç¤­¤ëÃͤÏgfarm2.conf(5)¤Îlog_level¤Î¹à¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£ PID¥Õ¥¡¥¤¥ë gfmd¤Îprocess ID¤ò¡¢»ØÄꤷ¤¿¥Õ¥¡¥¤¥ë¤Ëµ­Ï¿¤·¤Þ¤¹¡£ ¥Ç¥Ð¥Ã¥°¥ª¥×¥·¥ç¥ó¤Ç¤¹¡£¥Ç¡¼¥â¥ó¤È¤·¤Æ¤Ç¤Ï¤Ê¤¯¡¢¥Õ¥©¥¢¥°¥é¥¦¥ó¥É¡¦ ¥×¥í¥»¥¹¤È¤·¤ÆÎ©¤Á¾å¤¬¤ê¤Þ¤¹¡£ ¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¡¢¤«¤Ä¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Ê¤«¤Ã¤¿ ¾ì¹ç¡¢¥í¥°¥ì¥Ù¥ë¤Ïdebug¤È¤Ê¤ê¤Þ¤¹¡£ ÀßÄê¥Õ¥¡¥¤¥ë µ¯Æ°»þ¤ËÆÉ¤ß¹þ¤àÀßÄê¥Õ¥¡¥¤¥ë¤ò»ØÄꤷ¤Þ¤¹¡¥ ¥Ý¡¼¥ÈÈÖ¹æ gfmd¤¬ÍøÍѤ¹¤ëTCP¤Î¥Ý¡¼¥ÈÈÖ¹æ¤ò»ØÄꤷ¤Þ¤¹¡£ syslog¥Õ¥¡¥·¥ê¥Æ¥£ gfmd¤¬¥¨¥é¡¼Êó¹ð¤ËÍѤ¤¤ësyslog¤Î¥Õ¥¡¥·¥ê¥Æ¥£¤ò»ØÄꤷ¤Þ¤¹¡£¾Êά ¤·¤¿¾ì¹ç¤Ë¤Ï¡¢local0¤ò»ÈÍѤ·¤Þ¤¹¡£ ǧ¾Ú½èÍý¤Ë´Ø¤¹¤ë¥í¥°¤ò¾Ü¤·¤¯½ÐÎϤ·¤Þ¤¹¡£ GSIǧ¾Ú¤ÎÌäÂê¤ò²ò·è¤¹¤ë¾ì¹ç¤ËÍ­ÍѤʥª¥×¥·¥ç¥ó¤Ç¤¹¡£ °ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡£ FILES %%SYSCONFDIR%%/gfmd.conf gfmd¤¬»²¾È¤¹¤ëÀßÄê¥Õ¥¡¥¤¥ë¤Ç¤¹¡£ SEE ALSO gfarm2.conf5 gfarm-2.4.1/doc/docbook/ja/ref/man8/gfsd.8.docbook0000644000000000000000000001054211507222720020141 0ustar rootroot 14 Feb 2008 gfsd 8 Gfarm gfsd(8) Gfarm¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¡¦¥Ç¡¼¥â¥ó gfsd ¥ª¥×¥·¥ç¥ó DESCRIPTION gfsd¤Ï¡¢Gfarm¥é¥¤¥Ö¥é¥ê¤È¶¨Ä´¤·¤ÆÆ°ºî¤·¡¢Gfarm¥Õ¥¡¥¤¥ë¥·¥¹¥Æ ¥à¤ò¼Â¸½¤¹¤ë¥Ç¡¼¥â¥ó¥×¥í¥°¥é¥à¤Ç¤¹¡£ gfsd¤Ï¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤ÎÁ´¥Û¥¹¥È¾å¤Ç¡¢ root¸¢¸Â¤Ç¤¢¤é¤«¤¸¤áΩ¤Á¾å¤²¤Æ¤ª¤¯É¬Íפ¬¤¢¤ê¤Þ¤¹¡£ gfsd¤¬Ä󶡤¹¤ë¤Î¤Ï¡¢¥Õ¥¡¥¤¥ë¤Î¼ÂÂΤؤΥ¢¥¯¥»¥¹¤Ç¤¹¡£ gfsd ¤¬ÍøÍѤ¹¤ë¥Ý¡¼¥ÈÈÖ¹æ¤Ï¡¢gfmd ¤¬´ÉÍý¤¹¤ë¥á¥¿¥Ç¡¼¥¿¤«¤é¼èÆÀ¤·¤Þ¤¹¡£ gfsd¤Ï¥æ¡¼¥¶¸¢¸Â¤Çưºî¤µ¤»¤ë¤³¤È¤â²Äǽ¤Ç¤¹¤¬¡¤¤³¤Î¾ì¹ç¾¤Î¥æ¡¼¥¶¤Ï¤³ ¤Îgfsd¤òÍøÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£ ¾ÜºÙ¤ÏSETUP.private.ja¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£ OPTIONS ¥í¥°¥ì¥Ù¥ë ¤³¤Î¥ª¥×¥·¥ç¥ó¤Ç»ØÄꤷ¤¿¥ì¥Ù¥ë°Ê¾å¤ÎÍ¥ÀèÅÙ¤Î¥í¥°¤ò½ÐÎϤ·¤Þ¤¹¡£ »ØÄê¤Ç¤­¤ëÃͤÏgfarm2.conf(5)¤Îlog_level¤Î¹à¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£ PID¥Õ¥¡¥¤¥ë gfsd¤Îprocess ID¤ò¡¢»ØÄꤷ¤¿¥Õ¥¡¥¤¥ë¤Ëµ­Ï¿¤·¤Þ¤¹¡£ µ¯Æ°»þ¤Ë¡¢¥¹¥×¡¼¥ë¥Ç¥£¥ì¥¯¥È¥ê¤Î¸¡ºº¤ò¹Ô¤¤¤Þ¤¹¡£ ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Î¥Û¥¹¥È̾¤¬ÊѤï¤Ã¤¿¤È¤­¤ËÍøÍѤ¹¤ë¤È¡¢ Àµ¤·¤¯³ÊǼ¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¤ò¥á¥¿¥Ç¡¼¥¿¤ËÅÐÏ¿¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ ¥ª¥×¥·¥ç¥ó¤ò¤â¤¦°ìÅÙ»ØÄꤹ¤ë¤È¡¢ ̵¸ú¤Ê¥Õ¥¡¥¤¥ë¤Ê¤É¤ò¾Ãµî¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ ¥Ç¥Ð¥Ã¥°¥ª¥×¥·¥ç¥ó¤Ç¤¹¡£¥Ç¡¼¥â¥ó¤È¤·¤Æ¤Ç¤Ï¤Ê¤¯¡¢¥Õ¥©¥¢¥°¥é¥¦¥ó¥É¡¦ ¥×¥í¥»¥¹¤È¤·¤ÆÎ©¤Á¾å¤¬¤ê¤Þ¤¹¡£ ¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¡¢¤«¤Ä¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Ê¤«¤Ã¤¿ ¾ì¹ç¡¢¥í¥°¥ì¥Ù¥ë¤Ïdebug¤È¤Ê¤ê¤Þ¤¹¡£ ÀßÄê¥Õ¥¡¥¤¥ë µ¯Æ°»þ¤ËÆÉ¤ß¹þ¤àÀßÄê¥Õ¥¡¥¤¥ë¤ò»ØÄꤷ¤Þ¤¹¡£ ¥Û¥¹¥È̾ ¼«¥Û¥¹¥È¤Î¥«¥Î¥Ë¥«¥ë¤Ê¥Û¥¹¥È̾¤ò»ØÄꤷ¤Þ¤¹¡¥ IP¥¢¥É¥ì¥¹ gfsd¤¬TCP¤ª¤è¤ÓUDP¤ÎÍ×µá¤ò¼õ¤±ÉÕ¤±¤ëIP¥¢¥É¥ì¥¹¤ò»ØÄꤷ¤Þ¤¹¡£ ¥ª¥×¥·¥ç¥ó¾Êά»þ¤Ï¡¢¤½¤Î¥Û¥¹¥È¤ÎÁ´¤Æ¤ÎIP¥¢¥É¥ì¥¹¤Ç¼õ¤±ÉÕ¤±¤Þ¤¹¡£ ¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢°ì¤Ä¤Î¥Î¡¼¥É¤ÇÊ£¿ô¤Î¥¹¥×¡¼¥ë¤òÄ󶡤¹¤ë¾ì¹ç¤Ë¡¢ ¤½¤ì¤¾¤ì¤Î¥¹¥×¡¼¥ë¤´¤È¤Ë¡¢ÊÌ¡¹¤ÎIP¥¢¥É¥ì¥¹¤ò»È¤Ã¤Ægfsd¤òµ¯Æ°¤¹¤ë ¤¿¤á¤ËÍѤ¤¤Þ¤¹¡£ ¥¹¥×¡¼¥ë¡¦¥Ç¥£¥ì¥¯¥È¥ê gfsd¤¬¡¢¥Õ¥¡¥¤¥ë¤Î¼ÂÂΤòÊÝ»ý¤¹¤ë¥Ç¥£¥ì¥¯¥È¥ê̾¤ò»ØÄꤷ¤Þ¤¹¡£ syslog¥Õ¥¡¥·¥ê¥Æ¥£ gfsd¤¬¥¨¥é¡¼Êó¹ð¤ËÍѤ¤¤ësyslog¤Î¥Õ¥¡¥·¥ê¥Æ¥£¤ò»ØÄꤷ¤Þ¤¹¡£¾Êά ¤·¤¿¾ì¹ç¤Ë¤Ï¡¢local0¤ò»ÈÍѤ·¤Þ¤¹¡£ ǧ¾Ú½èÍý¤Ë´Ø¤¹¤ë¥í¥°¤ò¾Ü¤·¤¯½ÐÎϤ·¤Þ¤¹¡£ GSIǧ¾Ú¤ÎÌäÂê¤ò²ò·è¤¹¤ë¾ì¹ç¤ËÍ­ÍѤʥª¥×¥·¥ç¥ó¤Ç¤¹¡£ °ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡£ FILES %%SYSCONFDIR%%/gfarm2.conf gfsd¤¬»²¾È¤¹¤ëÀßÄê¥Õ¥¡¥¤¥ë¤Ç¤¹¡£ SEE ALSO gfarm2.conf5 gfarm-2.4.1/doc/docbook/ja/ref/man1/0000755000000000000000000000000011507222730015476 5ustar rootrootgfarm-2.4.1/doc/docbook/ja/ref/man1/gfpwd.1.docbook0000644000000000000000000000166211507222720020312 0ustar rootroot 2 Jul 2003 gfpwd 1 Gfarm gfpwd ¸½ºß¤Î Gfarm ºî¶È¥Ç¥£¥ì¥¯¥È¥ê̾¤òɽ¼¨¤¹¤ë¡£ gfpwd DESCRIPTION ¸½ºß¤Î Gfarm ºî¶È¥Ç¥£¥ì¥¯¥È¥ê¤Î Gfarm-URL ¤òɽ¼¨¤·¤Þ¤¹¡£ SEE ALSO gfcd1 , gfsetdir1 gfarm-2.4.1/doc/docbook/ja/ref/man1/Makefile.inc0000644000000000000000000000101611507222720017703 0ustar rootrootDOCBOOK = \ gfchgrp.1 \ gfchmod.1 \ gfchown.1 \ gfdf.1 \ gffindxmlattr.1 \ gfgroup.1 \ gfhost.1 \ gfkey.1 \ gfln.1 \ gfls.1 \ gfmkdir.1 \ gfmv.1 \ gfrep.1 \ gfrmdir.1 \ gfsched.1 \ gfstat.1 \ gfstatus.1 \ gfuser.1 \ gfwhere.1 \ gfwhoami.1 \ gfxattr.1 # gfarm_agent.1 \ # gfcd.1 \ # gfexec.1 \ # gfexport.1 \ # gfgrep.1 \ # gfimport_fixed.1 \ # gfimport_text.1 \ # gfmpirun_p4.1 \ # gfps.1 \ # gfpwd.1 \ # gfrcmd.1 \ # gfreg.1 \ # gfrm.1 \ # gfront.1 \ # gfrun.1 \ # gfsetdir.1 \ # gfusage.1 \ # gfwc.1 \ gfarm-2.4.1/doc/docbook/ja/ref/man1/gfstat.1.docbook0000644000000000000000000000221511507222720020466 0ustar rootroot 4 Jan 2010 gfstat 1 Gfarm gfstat Gfarm ¥Õ¥¡¥¤¥ë¤Þ¤¿¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤Î¾ðÊó¤òɽ¼¨¤¹¤ë gfstat options path DESCRIPTION »ØÄꤷ¤¿¥Õ¥¡¥¤¥ë¤¢¤ë¤¤¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤Î¾ðÊó¤òɽ¼¨¤·¤Þ¤¹¡¥ OPTIONS ¥Õ¥¡¥¤¥ëÊ£À½¤Î¿ô¤òɽ¼¨¤·¤Þ¤¹¡¥ °ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡¥ gfarm-2.4.1/doc/docbook/ja/ref/man1/gfchmod.1.docbook0000644000000000000000000000204211507222720020603 0ustar rootroot 21 Dec 2008 gfchmod 1 Gfarm gfchmod Gfarm ¥Õ¥¡¥¤¥ë¤Î¥¢¥¯¥»¥¹¸¢¸Â¤òÊѹ¹¤¹¤ë gfchmod options mode path DESCRIPTION Gfarm ¥Õ¥¡¥¤¥ë¤Î¥¢¥¯¥»¥¹¸¢¸Â¤òÊѹ¹¤·¤Þ¤¹¡¥ OPTIONS °ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡¥ gfarm-2.4.1/doc/docbook/ja/ref/man1/gfchgrp.1.docbook0000644000000000000000000000204311507222720020615 0ustar rootroot 21 Dec 2008 gfchgrp 1 Gfarm gfchgrp Gfarm ¥Õ¥¡¥¤¥ë¤Î½êÍ­¥°¥ë¡¼¥×¤òÊѹ¹¤¹¤ë gfchgrp options group path DESCRIPTION Gfarm ¥Õ¥¡¥¤¥ë¤Î½êÍ­¥°¥ë¡¼¥×¤òÊѹ¹¤·¤Þ¤¹¡¥ OPTIONS °ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡¥ gfarm-2.4.1/doc/docbook/ja/ref/man1/gfreg.1.docbook0000644000000000000000000001426611507222720020301 0ustar rootroot 5 Apr 2006 gfreg 1 Gfarm gfreg Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ø¤Î¥Õ¥¡¥¤¥ë¡¤¥Õ¥¡¥¤¥ë¥Õ¥é¥°¥á¥ó¥È¡¤¥Ç¥£¥ì¥¯¥È¥ê¤ÎÅÐÏ¿ gfreg -p -h ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É -H ¥Û¥¹¥È¥Õ¥¡¥¤¥ë̾ -D ¥É¥á¥¤¥ó̾ -a architecture program ... gfarm-URL gfreg -i -h ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É -H ¥Û¥¹¥È¥Õ¥¡¥¤¥ë̾ -D ¥É¥á¥¤¥ó̾ localfile ... gfarm-URL gfreg -N ¥Õ¥é¥°¥á¥ó¥ÈÁí¿ô -I ¥Õ¥é¥°¥á¥ó¥ÈÈÖ¹æ -h ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É -H ¥Û¥¹¥È¥Õ¥¡¥¤¥ë̾ -D ¥É¥á¥¤¥ó̾ localfile ... gfarm-URL gfreg -r -h ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É -H ¥Û¥¹¥È¥Õ¥¡¥¤¥ë̾ -D ¥É¥á¥¤¥ó̾ -a architecture directory program localfile ... gfarm-URL DESCRIPTION Âè1¤Î·Á¼°¤Î¾ì¹ç¡¤°ú¿ô program ¤Ë»ØÄꤷ¤¿¥í¡¼¥«¥ë¥Ç¥£¥¹¥¯¾å¤Î ¥×¥í¥°¥é¥à¡¦¥Õ¥¡¥¤¥ë¤ò¡¤gfarm-URL ¤ËÅÐÏ¿¤·¤Þ¤¹¡¥gfarm-URL ¤¬¥Ç¥£¥ì¥¯¥È ¥ê¤Î¾ì¹ç¤Ï¡¤Ê£¿ô¤Î program ¤ò»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡¥¤³¤ì°Ê¹ß¡¤ gfrun ¤ª¤è¤Ó gfmpirun_p4 ¤Ç»ØÄꤹ¤ë¥×¥í¥°¥é¥à̾¤È¤·¤Æ¡¤¤³¤Î URL ¤¬ »È¤¨¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡¥¥ª¥×¥·¥ç¥ó -p ¤¬¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¤¼Â¹Ô¤¬µö²Ä¤µ¤ì¤Æ¤¤ ¤ë program ¤Î¤ß»ØÄê¤Ç¤­¤Þ¤¹¡¥¤¢¤ë¾ì¹ç¤Ë¤Ï¡¤¼Â¹Ô¤¬µö²Ä¤µ¤ì¤Æ¤¤¤Ê¤¤¥Õ¥¡¥¤ ¥ë¤â»ØÄê¤Ç¤­¤Þ¤¹¤¬¡¤¤³¤Î¥Õ¥¡¥¤¥ë̾¤ò gfrun ¤ª¤è¤Ó gfmpirun_p4 ¤Ç»ØÄꤷ ¤Æ¤â¡¤¼Â¹Ô¤Ç¤­¤Þ¤»¤ó¡¥¥ª¥×¥·¥ç¥ó -a ¤Ç¥×¥í¥°¥é¥à¤Îưºî¤¹¤ë¥¢¡¼¥­¥Æ ¥¯¥Á¥ã¤ò»ØÄꤷ¤Ê¤«¤Ã¤¿¾ì¹ç¡¤¤¢¤ë¤¤¤Ï¥ª¥×¥·¥ç¥ó -h ¤ÇÅÐÏ¿¤¹¤ë¥Õ¥¡¥¤¥ë¥· ¥¹¥Æ¥à¥Î¡¼¥É¤ò»ØÄꤷ¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¤gfreg ¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤·¤¿¥Û¥¹¥È¤Î ¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤ÈƱ¤¸¤Ç¤¢¤ë¤È²¾Äꤷ¤Þ¤¹¡¥¤¿¤À¤·¡¤¤½¤Î¥Û¥¹¥È¤¬ Gfarm ¥á ¥¿¥µ¡¼¥Ð¤ËÅÐÏ¿¤µ¤ì¤Æ¤¤¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡¥ Âè2¤Î·Á¼°¤Î¾ì¹ç¡¤°ì¤Ä°Ê¾å¤ÎÊ£¿ô¤Îlocalfile¤òGfarm¥Õ¥¡¥¤¥ë¤È¤·¤Æ ÅÐÏ¿¤·¤Þ¤¹¡¥¥ª¥×¥·¥ç¥ó -i ¤¬¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¤¼Â¹Ô¤¬µö²Ä¤µ¤ì¤Æ¤¤¤Ê¤¤ localfile ¤Î¤ß¤ò»ØÄê¤Ç¤­¤Þ¤¹¡¥¤¢¤ë¾ì¹ç¤Ë¤Ï¡¤¼Â¹Ôµö²Ä¤È¤Ï̵´Ø·¸¤Ë localfile ¤ò»ØÄê¤Ç¤­¤Þ¤¹¡¥¥Õ¥¡¥¤¥ë¤ÎÊ£À½¤¬ºîÀ®¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¥·¥¹ ¥Æ¥à¥Î¡¼¥É¤Ï¼«Æ°Åª¤ËCPUÉé²Ù¤Ë¤è¤êÁª¤Ð¤ì¤Þ¤¹¤¬¡¤¥ª¥×¥·¥ç¥ó -h, -H, -D ¤Î¤¤¤º¤ì¤«¤Ë¤è¤êÁªÂò¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤òÀ©¸Â¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡¥ Âè3¤Î·Á¼°¤Î¾ì¹ç¡¤localfile¤òGfarm¥Õ¥¡¥¤¥ë¤Î¥Õ¥é¥°¥á¥ó¥È¤È¤·¤ÆÅÐ Ï¿¤·¤Þ¤¹¡¥¥ª¥×¥·¥ç¥ó -N ¤È -I ¤Ç¡¤Áí¥Õ¥é¥°¥á¥ó¥È¿ô¤È¡¤¤³¤Îlocalfile¤Î ¥Õ¥é¥°¥á¥ó¥ÈÈÖ¹æ¤òɬ¤º»ØÄꤹ¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡¥Gfarm-URL ¤¬¥Ç¥£¥ì¥¯¥È¥ê ¤Î¾ì¹ç¤Ï localfile ¤òÊ£¿ô»ØÄꤹ¤ë¤³¤È¤¬²Äǽ¤Ç¤¹¡¥¥Õ¥¡¥¤¥ë¤ÎÊ£À½¤¬ºîÀ® ¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Ï¼«Æ°Åª¤ËCPUÉé²Ù¤Ë¤è¤êÁª¤Ð¤ì¤Þ¤¹¤¬¡¤¥ª¥× ¥·¥ç¥ó -h, -H, -D ¤Î¤¤¤º¤ì¤«¤Ë¤è¤ê¤Ë¤è¤êÌÀ¼¨Åª¤Ë»ØÄꤹ¤ë¤³¤È¤â¤Ç¤­¤Þ¤¹¡¥ ¤¿¤À¡¤¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Ç gfreg ¤ò¼Â¹Ô¤·¤¿¾ì¹ç¤Ï¾ï¤Ë¼«¥Î¡¼¥É¤¬ Áª¤Ð¤ì¤Æ¤·¤Þ¤¦¤¿¤á¡¤¥Õ¥¡¥¤¥ë¤òʬ»¶¤µ¤»¤ÆÇÛÃÖ¤·¤¿¤¤¾ì¹ç¤Ï¥ª¥×¥·¥ç¥ó -h, -H, -D ¤Î¤¤¤º¤ì¤«¤ò»ØÄꤹ¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡¥ Âè4¤Î·Á¼°¤Î¾ì¹ç¡¤directory, program, localfile ¤ò gfarm-URL ¤Ë ÅÐÏ¿¤·¤Þ¤¹¡¥directory ¤Ë¥µ¥Ö¥Ç¥£¥ì¥¯¥È¥ê¤ä¥Õ¥¡¥¤¥ë¤¬´Þ¤Þ¤ì¤Æ¤¤¤ì¤ÐºÆµ¢ Ū¤ËÅÐÏ¿¤·¤Þ¤¹¡¥¥Ç¥£¥ì¥¯¥È¥ê¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë¡¤¤¢¤ë¤¤¤Ï¡¤°ú¿ô localfile ¤Ç»ØÄꤵ¤ì¤Æ¤¤¤ëÈó¼Â¹Ô¥Õ¥¡¥¤¥ë¤Ï¡¤°ì¤Ä¤Î¥Õ¥é¥°¥á¥ó¥È¤«¤é¤Ê¤ë Gfarm¥Õ¥¡ ¥¤¥ë¤È¤·¤ÆÅÐÏ¿¤µ¤ì¤Þ¤¹¡¥ Gfarm-URL ¤¬¥Ç¥£¥ì¥¯¥È¥ê¤È¤·¤ÆÂ¸ºß¤¹¤ë¾ì¹ç¤Ï¡¤Ê£¿ô¤Î directory, program, localfile ¤ò Gfarm-URL ¥Ç¥£¥ì¥¯¥È¥ê¤ËÅÐÏ¿¤·¤Þ¤¹¡¥ ¾¤Î·Á¼°¤È°Û¤Ê¤ê¡¤¤³¤ì¤é¤ò¤¤¤Ã¤·¤ç¤Ë°ú¿ô¤È¤·¤Æ»ØÄꤹ¤ë¤³¤È¤â¤Ç¤­¤Þ¤¹¡¥ gfarm_URL ¤¬Â¸ºß¤·¤Ê¤¤¾ì¹ç¤Ï¡¤directory, program, localfile ¤Î¤¤¤º¤ì¤« °ì¤Ä¤òÅÐÏ¿¤Ç¤­¤Þ¤¹¡¥ ¥Õ¥¡¥¤¥ë¤¬ÅÐÏ¿¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤È¥ª¥×¥·¥ç¥ó -a -h ¤Ë¤Ä¤¤¤Æ ¤Ï¡¤¾åµ­¤ÎÂè1¤Î·Á¼°¤Ç¤ÎÀâÌÀ¤ò»²¾È¤·¤¯¤À¤µ¤¤¡¥ OPTIONS gfarm-URL ¤¬¥Õ¥¡¥¤¥ë¤È¤·¤ÆÂ¸ºß¤·¤Æ¤¤¤Æ¤â¡¤¶¯À©Åª¤Ë¾å½ñ¤­¤·¤Þ¤¹¡¥ °ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡¥ gfarm-2.4.1/doc/docbook/ja/ref/man1/gfusage.1.docbook0000644000000000000000000000212511507222720020617 0ustar rootroot 24 July 2006 gfusage 1 Gfarm gfusage Gfarm ¤Î»ÈÍÑÎ̤òɽ¼¨¤¹¤ë gfusage -c DESCRIPTION gfusage ¤Ï¡¢¥æ¡¼¥¶¤´¤È¤Ë Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î»ÈÍÑÎ̤òɽ¼¨¤·¤Þ¤¹¡£ OPTIONS ¥Õ¥¡¥¤¥ëÊ£À½¤ò¹Íθ¤·¤Æ¹ç·×¥µ¥¤¥º¤ò·×»»¤·¤Þ¤¹¡£ SEE ALSO gfdf1 gfarm-2.4.1/doc/docbook/ja/ref/man1/gfront.1.docbook0000644000000000000000000000254711507222720020505 0ustar rootroot 19 Aug 2003 gfront 1 Gfarm gfront Gfarm ¥Õ¥¡¥¤¥ë¤òÁàºî¤¹¤ë¡£ gfront DESCRIPTION GFront¤Ï¡¢gfarm¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤òÁàºî¤¹¤ëGUI¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤¢¤ë¡£ GFront¤Ï¡¢gfarm¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤òÍøÍѼԤ¬ÂÐÏÃŪ¤ËÁàºî¤¹¤ë¤³¤È¤ò²Äǽ¤È¤¹¤ë¡£ gfarm¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ËÂФ¹¤ë´ðËÜÁàºî¤Ï¤¹¤Ç¤Ë¥³¥Þ¥ó¥É¤È¤·¤Æ¼Â¸½¤µ¤ì¤Æ¤ª¤ê¡¢GFront¤Ç¤Ïgfarm¤Î¥³¥Þ¥ó¥É¤ËÁêÅö¤¹¤ëµ¡Ç½¤ò¼Â¹Ô¤¹¤ë¤¿¤á¤Î¥Õ¥í¥ó¥È¥¨¥ó¥Éµ¡Ç½¤òÄ󶡤¹¤ë¡£ SEE ALSO gfexport1 , gfhost1 , gfrm1 , gfreg1 gfarm-2.4.1/doc/docbook/ja/ref/man1/gfwhoami.1.docbook0000644000000000000000000000216011507222720020776 0ustar rootroot 2 Apr 2004 gfwhoami 1 Gfarm gfwhoami Gfarm ¥°¥í¡¼¥Ð¥ë¥æ¡¼¥¶Ì¾¤òɽ¼¨¤·¤Þ¤¹ gfwhoami ¥ª¥×¥·¥ç¥ó DESCRIPTION Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¾å¤ÇÍѤ¤¤é¤ì¤ë¥°¥í¡¼¥Ð¥ë¥æ¡¼¥¶Ì¾¤ò ɽ¼¨¤·¤Þ¤¹¡£ OPTIONS GSI ǧ¾Ú¤òÍѤ¤¤Æ¤¤¤ë¾ì¹ç¡¢ÍøÍѼԤΠSubject DN ¤âɽ¼¨¤·¤Þ¤¹¡£ °ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡£ gfarm-2.4.1/doc/docbook/ja/ref/man1/gfwc.1.docbook0000644000000000000000000000211411507222720020122 0ustar rootroot 1 May 2002 gfwc 1 Gfarm gfwc ÊÂÎó¥Õ¥¡¥¤¥ë¤ò wc ¤¹¤ë gfmpirun_p4 gfarm:gfwc ÆþÎÏgfarm-URL DESCRIPTION gfmpirun_p4 ¤«¤é¸Æ¤Ó½Ð¤µ¤ì¤ë¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Î¥µ¥ó¥×¥ë¡¦¥×¥í¥°¥é¥à¤Ç¤¹¡£ ÆþÎÏ gfarm-URL ¤òÆÉ¤ß¹þ¤ß¡¢¥Ð¥¤¥È¿ô¡¦Ã±¸ì¿ô¡¦¹Ô¿ô¤ò¡¢É¸½à½ÐÎϤ˽ÐÎÏ ¤·¤Þ¤¹¡£ gfarm-2.4.1/doc/docbook/ja/ref/man1/gfsched.1.docbook0000644000000000000000000001446711507222720020615 0ustar rootroot 28 Dec 2010 gfsched 1 Gfarm gfsched ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤ò¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¤·¡¢ÍøÍѲÄǽ¤Ê¥Î¡¼¥É¤òɽ¼¨ gfsched -f gfarm-URL -D ¥É¥á¥¤¥ó̾ -n ¥Î¡¼¥É¿ô -LMclw gfsched -P gfarm-URL -D ¥É¥á¥¤¥ó̾ -n ¥Î¡¼¥É¿ô -LMlw DESCRIPTION gfsched ¤Ë gfarm-URL ¥ª¥×¥·¥ç¥ó¤ò »ØÄꤷ¤¿¾ì¹ç¡¢¤½¤Îgfarm¥Õ¥¡¥¤¥ë¤òÊÝ»ý¤¹¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Î ¤¦¤Á¤Ç¡¢¸½ºßÍøÍѲÄǽ¤Ê¤â¤Îɽ¼¨¤·¤Þ¤¹¡£ ¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Ê¤«¤Ã¤¿¾ì¹ç¡¢ÍøÍѲÄǽ¤Ê ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤òɽ¼¨¤·¤Þ¤¹¡£¤³¤Î¾ì¹ç¡¢ gfarm-URL ¥ª¥×¥·¥ç¥ó¤Ç ¥Ñ¥¹Ì¾¤« gfarm URL ¤ò»ØÄꤹ¤ë¤³¤È¤Ë¤è¤ê¡¢É½¼¨ÂоݤΥ᥿¥Ç¡¼¥¿¥µ¡¼¥Ð¤ò ÀÚÂØ¤¨¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ OPTIONS ¥É¥á¥¤¥ó̾ ¥É¥á¥¤¥ó̾¤Ê¤¤¤·¥Û¥¹¥È̾¤ò»ØÄꤷ¡¢¸¡º÷ÂоݤΥե¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤ò ¹Ê¤ê¤Þ¤¹¡£ ¤½¤Î¥Û¥¹¥È¤ËÂФ·¤Æ¡¢Ç§¾Ú¤¬À®¸ù¤¹¤ë¤«Èݤ«¤Î³Îǧ¤ò¾Êά¤·¤Þ¤¹¡£ ¹â®¤Ë¤Ê¤ê¤Þ¤¹¤¬¡¢Ç§¾ÚÉÔǽ¤Ê¥Û¥¹¥È¤¬¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¤µ¤ì¤Æ¤·¤Þ¤¦ ´í¸±¤¬¤¢¤ê¤Þ¤¹¡£ ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤ËÌ䤤¹ç¤ï¤»¤¿·ë²Ì¤Î¤ß¤òɽ¼¨¤·¡¢¥¯¥é¥¤¥¢¥ó¥È¦¤Ç¤Î ¥¹¥±¥¸¥å¡¼¥ê¥ó¥°½èÍý¤ò¹Ô¤Ê¤¤¤Þ¤»¤ó¡£ ¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»ØÄꤹ¤ë¤È¡¢Æ°ºî¤Ï¹â®¤Ë¤Ê¤ê¤Þ¤¹¤¬¡¢¥Í¥Ã¥È¥ï¡¼¥¯Åª¤ËÅþ ãÉÔǽ¤Ê¥Û¥¹¥È¤ä¡¢Ç§¾ÚÉÔǽ¤Ê¥Û¥¹¥È¤¬É½¼¨¤µ¤ì¤ë´í¸±¤¬¤¢¤ê¤Þ¤¹¡£ gfarm-URL ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤ò´ÉÍý¤¹¤ë¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤òÆÃÄꤹ¤ë ¤¿¤á¤Ë¡¢gfarm-URL ¤Ê¤¤¤·¥Ñ¥¹Ì¾¤ò»ØÄꤷ¤Þ¤¹¡£ ¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢ ¥ª¥×¥·¥ç¥ó¤ÈÇÓ¾Ū¤Ç¤¹¡£ gfarm-URL »ØÄꤷ¤¿¥Õ¥¡¥¤¥ë¤Ë¤Ä¤¤¤Æ¡¢¤½¤ÎÊ£À½¤òÊÝ»ý¤¹¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤ò ¸¡º÷¤·¤Þ¤¹¡£ ¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢ ¥ª¥×¥·¥ç¥ó¤ÈÇÓ¾Ū¤Ç¤¹¡£ ¥ª¥×¥·¥ç¥ó¡Ö¡×¤Ç»ØÄꤷ¤¿¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Ê¤¤ ¾ì¹ç¤Ç¡¢¤«¤Ä¡¢¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤¿¾ì¹ç¡¢¥Õ¥¡¥¤¥ë¤ò¿·µ¬ºîÀ®¤·¤¿ ¾ì¹ç¤Î¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¾ðÊó¤òɽ¼¨¤·¤Þ¤¹¡£ ¸½ºß¡¢¤³¤Î¥ª¥×¥·¥ç¥ó¤òÍøÍѤ¹¤ë¤È¡¢»ØÄꤷ¤¿¥Õ¥¡¥¤¥ë¤ò¿·µ¬ºîÀ®¤·¤Þ¤¹¡£ ¤³¤Îµóư¤Ï¾­ÍèÊѹ¹¤µ¤ì¤ë²ÄǽÀ­¤¬¤¢¤ë¤Î¤Ç¤´Ãí°Õ¤¯¤À¤µ¤¤¡£ ¥Û¥¹¥È̾¤Î¤ß¤Ê¤é¤º¡¢¥Ý¡¼¥ÈÈÖ¹æ¤âɽ¼¨¤·¤Þ¤¹¡£ ¤³¤Î¥ª¥×¥·¥ç¥ó¤Îɽ¼¨·Á¼°¤Ï¡¢¾­ÍèÊѹ¹¤µ¤ì¤ë²ÄǽÀ­¤¬¤¢¤ê¤Þ¤¹¤Î¤Ç¤´Ãí°Õ¤¯¤À¤µ¤¤¡£ ¥Î¡¼¥É¿ô »ØÄꤷ¤¿¿ô¤ò¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Îɽ¼¨¤ò»î¤ß¤Þ¤¹¡£ ¥Î¡¼¥É¿ô¤¬¤½¤Î¿ô¤ËËþ¤¿¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢¤½¤³¤Çɽ¼¨¤òÂǤÁÀÚ¤ê¤Þ¤¹¡£ ¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Ê¤¤¾ì¹ç¡¢¾ò·ï¤òËþ¤¿¤¹Á´¥Î¡¼¥É¤òɽ¼¨¤·¤Þ¤¹¡£ ¥Õ¥¡¥¤¥ë¤Î½ñ¤­¹þ¤ß¤ò¹Ô¤Ê¤¦Á°Äó¤Ç¡¢¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¤ò¹Ô¤Ê¤¤¤Þ¤¹¡£ ¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤¿¾ì¹ç¡¢¥Ç¥£¥¹¥¯¤Î¶õ¤­ÍÆÎ̤¬Â­¤ê¤Ê¤¤¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à ¥Î¡¼¥É¤Ï½ü³°¤µ¤ì¤Þ¤¹¡£ ¤³¤Î¥ª¥×¥·¥ç¥ó¤È¡¢ ¥ª¥×¥·¥ç¥ó¤òƱ»þ¤Ë»ØÄꤷ¡¢ ¤«¤Ä¡¢¤½¤Î¥Õ¥¡¥¤¥ë¤¬´û¸¤Î¥×¥í¥»¥¹¤Ë¤è¤Ã¤Æ½ñ¤­¹þ¤ß¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢ ¤Î»ØÄê¤Ë´Ø¤ï¤é¤º¡¢¸½ºß¤³¤Î¥Õ¥¡¥¤¥ë¤Î½ñ¤­¹þ¤ßÍÑ¤Ë ³ä¤êÅö¤Æ¤é¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É 1¤Ä¤Î¤ß¤òɽ¼¨¤·¤Þ¤¹¡£ °ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡£ EXAMPLES °Ê²¼¤Ï¡¢¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤¬Æ°ºîÃæ¤Ç¤¢¤ë¤ÈÇİ®¤·¤Æ¤¤¤ë¡¢¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤ò Ì䤤¹ç¤ï¤»¤ëÎã¤Ç¤¹¡£ $ gfsched -M gfarm-2.4.1/doc/docbook/ja/ref/man1/gfimport_fixed.1.docbook0000644000000000000000000000776611507222720022224 0ustar rootroot 5 Jun 2003 gfimport_fixed 1 Gfarm gfimport_fixed ¸ÇÄêĹ¥Ç¡¼¥¿¤ò¥Õ¥é¥°¥á¥ó¥È¤Ëʬ¤±¤Æ¼è¤ê¹þ¤à gfimport_fixed ¥ª¥×¥·¥ç¥ó ÆþÎÏ¥Õ¥¡¥¤¥ë DESCRIPTION °ú¿ô¤Ë»ØÄꤷ¤¿¸ÇÄêĹ¥Ç¡¼¥¿¤«¤é¤Ê¤ë¥Õ¥¡¥¤¥ë¤ò¡¢¥Õ¥é¥°¥á¥ó¥È¤Ëʬ¤±¤Æ Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë¼è¤ê¹þ¤à¥µ¥ó¥×¥ë¡¦¥×¥í¥°¥é¥à¤Ç¤¹¡£ OPTIONS ¥Û¥¹¥È»ØÄê¥Õ¥¡¥¤¥ë ¥Õ¥é¥°¥á¥ó¥È¤òÇÛÃÖ¤¹¤ë¥Û¥¹¥È̾¤Î¥ê¥¹¥È¤òµ­ºÜ¤·¤¿¥Õ¥¡¥¤¥ë̾¤ò»ØÄꤷ¤Þ¤¹¡£ ¥Û¥¹¥È̾¤Ï¡¢³Æ¹Ô¤Ë°ì¥Û¥¹¥È¤º¤Äµ­½Ò¤·¤Þ¤¹¡£ -l ¥ª¥×¥·¥ç¥ó¤ò¾Êά¤·¤¿¾ì¹ç¤Ï¡¢ÆþÎÏ¥Õ¥¡¥¤¥ë¤Ï¡¢¤³¤Î¥ª¥×¥·¥ç¥ó¤Ç »ØÄꤷ¤¿¥Û¥¹¥È¤Ë¡¢Åùʬ³ä¤·¤¿¥Õ¥é¥°¥á¥ó¥È¤È¤·¤ÆÇÛÃÖ¤µ¤ì¤Þ¤¹¡£ ¥Õ¥¡¥¤¥ë̾¤È¤·¤Æ ``-'' ¤ò»ØÄꤷ¤¿¾ì¹ç¡¢É¸½àÆþÎϤ«¤é¥Û¥¹¥È̾¤Î¥ê¥¹¥È¤ò ÆÉ¤ß¹þ¤ß¤Þ¤¹¡£ ¥Õ¥é¥°¥á¥ó¥È¹½À®¥Õ¥¡¥¤¥ë ³Æ¥Õ¥é¥°¥á¥ó¥È¤Î¤ª¤ª¤è¤½¤Î¥µ¥¤¥º¤È¡¢ÇÛÃÖ¤¹¤ë¥Û¥¹¥È¤òµ­ºÜ¤·¤¿¥Õ¥¡¥¤ ¥ë̾¤ò»ØÄꤷ¤Þ¤¹¡£ ¹½À®¥Õ¥¡¥¤¥ë¤Ï¡¢³Æ¹Ô¤¬¡¢¶õÇò¤Ç¶èÀÚ¤é¤ì¤¿¥µ¥¤¥º¤È¥Û¥¹¥È̾¤«¤é¤Ê¤ë·Á¼°¤Ç¤¹¡£ ¥Õ¥¡¥¤¥ë̾¤È¤·¤Æ ``-'' ¤ò»ØÄꤷ¤¿¾ì¹ç¡¢É¸½àÆþÎϤ«¤é¥Õ¥é¥°¥á¥ó¥È¹½À®¤ò ÆÉ¤ß¹þ¤ß¤Þ¤¹¡£ ¥ì¥³¡¼¥ÉĹ ¸ÇÄêĹ¥Ç¡¼¥¿¤Î¥ì¥³¡¼¥ÉŤò¥Ð¥¤¥È¿ô¤Ç»ØÄꤷ¤Þ¤¹¡£¥Õ¥é¥°¥á¥ó¥Èʬ³ä¤Ï¡¢ ¤³¤Î¥ì¥³¡¼¥ÉŤÎÀ°¿ôÇܤΰÌÃ֤ǤΤߡ¢¹Ô¤ï¤ì¤Þ¤¹¡£¾Êά»þ¤Î¥ì¥³¡¼¥ÉĹ ¤Ï 1 ¥Ð¥¤¥È¤Ç¤¹¡£ gfarm-URL ½ÐÎÏ Gfarm ¥Õ¥¡¥¤¥ë¤Î URL ¤ò»ØÄꤷ¤Þ¤¹¡£ °ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡£ EXAMPLES »ØÄꤷ¤¿¸Ä¿ô¤Ëʬ³ä¤·¤Æ¼è¤ê¹þ¤à °Ê²¼¤Ï¡¢¥Õ¥¡¥¤¥ë¤ò8¸Ä¤Î¥Õ¥é¥°¥á¥ó¥È¤Ëʬ³ä¤·¡¢ ¥Õ¥¡¥¤¥ë gfarm:file ¤È¤·¤Æ¼è¤ê¹þ¤àÎã¤Ç¤¹¡£ gfsched -N 8 | gfimport_fixed -H - -o gfarm:file source_file ½èÍý¤¹¤ë¥×¥í¥°¥é¥à¤ò»ØÄꤷ¡¢ÆÃÄê¤Î¸Ä¿ô¤Ëʬ³ä¤·¤Æ¼è¤ê¹þ¤à °Ê²¼¤Ï¡¢¥Õ¥¡¥¤¥ë¤ò8¸Ä¤Î¥Õ¥é¥°¥á¥ó¥È¤Ëʬ³ä¤·¡¢ »ØÄꤷ¤¿¥×¥í¥°¥é¥à gfarm:prog ¤ò¼Â¹Ô²Äǽ¤Ê¥Û¥¹¥È¤Ë¡¢ ¥Õ¥¡¥¤¥ë gfarm:file ¤È¤·¤Æ¼è¤ê¹þ¤àÎã¤Ç¤¹¡£ gfsched -N 8 -p gfarm:prog | gfimport_fixed -H - -o gfarm:file source_file ´û¸¤Î gfarm ¥Õ¥¡¥¤¥ë¤ÈƱ¤¸ÇÛÃ֤Ǽè¤ê¹þ¤à °Ê²¼¤Ï¡¢´û¸¤Î gfarm ¥Õ¥¡¥¤¥ë gfarm:template ¤È Ʊ¤¸¸Ä¿ô¤Î¥Õ¥é¥°¥á¥ó¥È¤Ëʬ³ä¤·¡¢ gfarm:template ¤¬Â¸ºß¤¹¤ë¤Î¤ÈƱ¤¸¥Û¥¹¥È¤Ë¡¢ ¥Õ¥¡¥¤¥ë gfarm:file ¤È¤·¤Æ¼è¤ê¹þ¤àÎã¤Ç¤¹¡£ gfsched gfarm:template | gfimport_fixed -H - -o gfarm:file source_file SEE ALSO gfimport_text1 , gfsched1 , gfarm.conf5 gfarm-2.4.1/doc/docbook/ja/ref/man1/gfrm.1.docbook0000644000000000000000000001200411507222720020126 0ustar rootroot 3 Nov 2006 gfrm 1 Gfarm gfrm Gfarm ¥Õ¥¡¥¤¥ë¡¤¥Ç¥£¥ì¥¯¥È¥ê¡¤¥Õ¥¡¥¤¥ëÊ£À½¤òºï½ü¤¹¤ë¡¥ gfrm -frRnqv -I ¥Õ¥¡¥¤¥ë¥»¥¯¥·¥ç¥ó -h ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É -D ¥É¥á¥¤¥ó̾ -H ¥Û¥¹¥È»ØÄê¥Õ¥¡¥¤¥ë -N Ê£À½¿ô -j ¥¹¥ì¥Ã¥É¿ô gfarm-URL DESCRIPTION Gfarm-URL ¤Ë»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤òºï½ü¤·¤Þ¤¹¡¥ ¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤Îºï½ü¤Ï¹Ô¤¤¤Þ¤»¤ó¤¬¡¤ ¤¢¤ë¤¤¤Ï ¥ª¥×¥·¥ç¥ó¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¤ »ØÄꤵ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê°Ê²¼¤Î¥Õ¥¡¥¤¥ë¤ª¤è¤Ó¥Ç¥£¥ì¥¯¥È¥ê¤¬ºÆµ¢Åª¤Ë¾Ãµî¤µ¤ì¤Þ¤¹¡¥ ¤Ê¤ª¡¤. ¤¢¤ë¤¤¤Ï .. ¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¤Ï¥¨¥é¡¼¤Ë¤Ê¤ê¤Þ¤¹¡¥ ¥ª¥×¥·¥ç¥ó¤ò»ØÄꤹ¤ë¤³¤È¤Ë¤è¤ê¡¤ ¥Õ¥¡¥¤¥ë¤ÎÆÃÄê¤Î¥Õ¥¡¥¤¥ë¥»¥¯¥·¥ç¥ó¤òºï½ü¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡¥ ¥Õ¥¡¥¤¥ë¥»¥¯¥·¥ç¥ó¤È¤Ï¡¤¼Â¹Ô·Á¼°¤Î¥Õ¥¡¥¤¥ë¤Î¾ì¹ç¤Ï¥¢¡¼¥­¥Æ¥¯¥Á¥ã̾¡¤ Ä̾ï¥Õ¥¡¥¤¥ë¤Î¾ì¹ç¤Ï¥Õ¥¡¥¤¥ë¥¤¥ó¥Ç¥Ã¥¯¥¹ÈÖ¹æ¤È¤Ê¤ê¤Þ¤¹¡¥ ¡¤¡¤ ¥ª¥×¥·¥ç¥ó¤Ç¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤ò»ØÄꤹ¤ë¤³¤È¤Ë¤è¤ê¡¤ »ØÄꤵ¤ì¤¿¥Î¡¼¥É¤Ë³ÊǼ¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ëÊ£À½¤òºï½ü¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡¥ ¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¤ ¥Õ¥¡¥¤¥ë¤Îºï½ü¤È¤Ê¤Ã¤Æ¤·¤Þ¤¦Á´¤Æ¤Î¥Õ¥¡¥¤¥ëÊ£À½¤Îºï½ü¤Ï¤Ç¤­¤Þ¤»¤ó¤¬¡¤ ¥ª¥×¥·¥ç¥ó¤ò¤Ä¤±¤ë¤³¤È¤Ë¤è¤êºï½ü¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡¥ OPTIONS ¥Õ¥¡¥¤¥ëÊ£À½ºï½ü¤Î¾ì¹ç¤Ë¡¤ Á´¤Æ¤Î¥Õ¥¡¥¤¥ëÊ£À½¤òºï½ü¤¹¤ë¤³¤È¤Ë¤Ê¤Ã¤Æ¤â¥Õ¥¡¥¤¥ëÊ£À½¤òºï½ü¤·¤Þ¤¹¡¥ ¤³¤Î»þ¡¤¥Õ¥¡¥¤¥ë¼«ÂΤ¬ºï½ü¤µ¤ì¤ë¤³¤È¤Ë¤Ê¤ê¤Þ¤¹¡¥ ¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï ¡¤¡¤ ¤Î¤¤¤º¤ì¤«¤Î¥ª¥×¥·¥ç¥ó¤È¤È¤â¤Ë»ØÄꤵ¤ì¤¿¾ì¹ç¤ËÍ­¸ú¤Ç¤¹¡¥ ¥¹¥ì¥Ã¥É¿ô »ØÄꤵ¤ì¤¿¥¹¥ì¥Ã¥É¿ô¤ÇÊÂÎó¤Ë¥Õ¥¡¥¤¥ë¡¿¥Õ¥¡¥¤¥ëÊ£À½¤òºï½ü¤·¤Þ¤¹¡¥ ¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï gfrm ¤¬ OpenMP C ¥³¥ó¥Ñ¥¤¥é¤Ç¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤¿¤È¤­¤Ë ¸Â¤êÍ­¸ú¤Ç¤¹¡¥ ¾Ãµî¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¤òɽ¼¨¤·¤Þ¤¹¡¥ ¼ÂºÝ¤Ë¤Ï²¿¤â¼Â¹Ô¤µ¤ì¤Þ¤»¤ó¡¥ ;ʬ¤Ê¥á¥Ã¥»¡¼¥¸¤òɽ¼¨¤·¤Þ¤»¤ó¡¥ , °ú¿ô¤¬¥Ç¥£¥ì¥¯¥È¥ê¤À¤Ã¤¿¾ì¹ç¡¤¤½¤Î¥Ç¥£¥ì¥¯¥È¥ê°Ê²¼¤ò Á´¤Æ¡¤ºÆµ¢Åª¤Ëºï½ü¤·¤Þ¤¹¡¥ ¾éĹ¤Ë¥á¥Ã¥»¡¼¥¸¤òɽ¼¨¤·¤Þ¤¹¡¥ ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É Ê£À½¤òºï½ü¤¹¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É̾¤ò»ØÄꤷ¤Þ¤¹¡¥ ¥ª¥×¥·¥ç¥ó¤È¶¦¤ËÍѤ¤¤ë¤³¤È¤Ë¤è¤ê¡¤ ÆÃÄê¤Î¥Õ¥¡¥¤¥ë¥»¥¯¥·¥ç¥ó¤ÎÊ£À½¤òºï½ü¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡¥ ¥É¥á¥¤¥ó̾ Ê£À½¤òºï½ü¤¹¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Î¥É¥á¥¤¥ó̾¤ò»ØÄꤷ¤Þ¤¹¡¥ ¥Û¥¹¥È»ØÄê¥Õ¥¡¥¤¥ë Ê£À½¤òºï½ü¤¹¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É·²¤òµ­ºÜ¤·¤¿¥Õ¥¡¥¤¥ë̾¤ò»ØÄꤷ¤Þ¤¹¡¥ ¥Û¥¹¥È̾¤Ï¡¤³Æ¹Ô¤Ë°ì¥Û¥¹¥È¤º¤Äµ­½Ò¤·¤Þ¤¹¡¥ ¥Õ¥¡¥¤¥ë̾¤È¤·¤Æ ``-'' ¤ò»ØÄꤷ¤¿¾ì¹ç¡¤É¸½àÆþÎϤ«¤é¥Û¥¹¥È̾¤Î¥ê¥¹¥È¤ò ÆÉ¤ß¹þ¤ß¤Þ¤¹¡¥ ¥Õ¥¡¥¤¥ë¥»¥¯¥·¥ç¥ó ºï½ü¤¹¤ë¥Õ¥¡¥¤¥ë¥»¥¯¥·¥ç¥ó¤ò»ØÄꤷ¤Þ¤¹¡¥ ¥Õ¥¡¥¤¥ë¥»¥¯¥·¥ç¥ó¤È¤Ï¡¤ ¼Â¹Ô·Á¼°¤Î¥Õ¥¡¥¤¥ë¤Î¾ì¹ç¤Ï¡¤¥¢¡¼¥­¥Æ¥¯¥Á¥ã̾(Îã ¡Ösparc-sun-solaris8¡×)¡¤ Ä̾ï¥Õ¥¡¥¤¥ë¤Î¾ì¹ç¤Ï¡¤¥Õ¥¡¥¤¥ë¥¤¥ó¥Ç¥Ã¥¯¥¹ÈÖ¹æ¤Î¤³¤È¤Ç¤¹¡¥ Ê£À½¿ô »ØÄꤵ¤ì¤¿Ê£À½¿ô¤è¤ê¿¤¯¤ÎÊ£À½¤ò¤â¤Ä¥Õ¥¡¥¤¥ë¤ËÂФ·¡¤ Ê£À½¤ò¾Ãµî¤·»ØÄꤵ¤ì¤¿Ê£À½¿ô¤Ë¤·¤Þ¤¹¡¥ °ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡¥ gfarm-2.4.1/doc/docbook/ja/ref/man1/gfhost.1.docbook0000644000000000000000000003776011507222720020505 0ustar rootroot 20 Jan 2010 gfhost 1 Gfarm gfhost gfarm ¥Û¥¹¥È´ÉÍý¥³¥Þ¥ó¥É gfhost -H -l -M -iLprUv -P path -a ¥¢¡¼¥­¥Æ¥¯¥Á¥ã -D ¥É¥á¥¤¥ó̾ -j ÊÂÎóÅÙ ¥Û¥¹¥È̾ gfhost -c -P path -a¥¢¡¼¥­¥Æ¥¯¥Á¥ã -p¥Ý¡¼¥ÈÈÖ¹æ -nCPU¿ô ¥Û¥¹¥È̾ ¥Û¥¹¥ÈÊÌ̾ gfhost -m -P path -a¥¢¡¼¥­¥Æ¥¯¥Á¥ã -p¥Ý¡¼¥ÈÈÖ¹æ -nCPU¿ô -A ¥Û¥¹¥È̾ ¥Û¥¹¥ÈÊÌ̾ gfhost -d -P path ¥Û¥¹¥È̾ gfhost -R -P path DESCRIPTION gfhost ¤Ï¡¢gfarm ¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Ë ´Ø¤¹¤ë¾ðÊó¤Îɽ¼¨¤ä´ÉÍý¤ò¹Ô¤Ê¤¤¤Þ¤¹¡£gfhost ¤¬ ¼Â¹Ô¤¹¤ëµ¡Ç½¤Ï¡¢-c, -d, -H, -l, -M, -m, -R ¤Î¥ª¥×¥·¥ç¥ó¤Ç»ØÄꤷ¤Þ¤¹¡£ ¤³¤ì¤éµ¡Ç½¤Î»ØÄê¤ÏÇÓ¾Ū¤Ç¤¢¤ê¡¢¤É¤ì¤«°ì¤Ä¤À¤±¤ò»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ ¤Þ¤¿¡¢°ì¤Ä¤â»ØÄꤷ¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢¥Ç¥Õ¥©¡¼¥ë¥È¤Îµ¡Ç½¤Ç¤¢¤ë¥Û¥¹¥È̾ ɽ¼¨¤¬¹Ô¤Ê¤ï¤ì¤Þ¤¹¡£ FUNCTIONS µ¡Ç½»ØÄê¤Î¤¦¤Á¡¢-c, -d, -M, -m, -R ¤Ï¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¡¼¤Î¤ß¤ò ¥¢¥¯¥»¥¹¤·¡¢ÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë¥Û¥¹¥È¾ðÊó¤ÎÄɲᢺï½ü¡¢É½¼¨¡¢Êѹ¹¤ò¹Ô¤Ê¤¤¤Þ¤¹¡£ µ¡Ç½»ØÄê¤Î¤¦¤Á¡¢-H, -l, -M, ¤ª¤è¤ÓÆÃ¤Ëµ¡Ç½¤ò»ØÄꤷ¤Ê¤«¤Ã¤¿¾ì¹ç¤Ï¡¢ ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Ë´Ø¤¹¤ë¾ðÊó¤òɽ¼¨¤·¤Þ¤¹¡£ ¤³¤Î¤¦¤Á -M ¤Ï¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¡¼¤Î¤ß¤ò¥¢¥¯¥»¥¹¤·¤Þ¤¹¤¬¡¢ ¤½¤ì°Ê³°¤Îµ¡Ç½¤Ï¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Çưºî¤·¤Æ¤¤¤ë gfsd ¤Ë¤â¥¢¥¯¥»¥¹¤·¤Þ¤¹¡£ gfsd ¤Ë¥¢¥¯¥»¥¹¤¹¤ëµ¡Ç½¤Ë´Ø¤·¤Æ¤Ï¡¢¤½¤Î¥¢¥¯¥»¥¹¤Ë ´Ø¤¹¤ë¥ª¥×¥·¥ç¥ó¤ò -i, -j, -U, -v ¤Ç»ØÄê¤Ç¤­¤Þ¤¹¡£ ɽ¼¨µ¡Ç½¤Ë´Ø¤·¤Æ¤Ï¡¢¥Û¥¹¥È̾¤Î»ØÄê¤ò¾Êά¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¤³¤Î¾ì¹ç¡¢ ¥á¥¿¥Ç¡¼¥¿¤ËÅÐÏ¿¤µ¤ì¤Æ¤¤¤ëÁ´¤Æ¤Î¥Û¥¹¥È¤Ë´Ø¤¹¤ëɽ¼¨¤ò»î¤ß¤Þ¤¹¡£ ¤Þ¤¿¡¢-a ¤ª¤è¤Ó -D ¥ª¥×¥·¥ç¥ó¤Çɽ¼¨¤¹¤ë¥Û¥¹¥È¤Î¼ïÎà¤ò¸ÂÄê ¤¹¤ë¤³¤È¤â¤Ç¤­¤Þ¤¹¡£ ɽ¼¨¤Î½ç½ø¤Ï¡¢¥Û¥¹¥È̾¤Î¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È½ç¤Ç¤¹¤¬¡¢-L, -r, -u ¥ª¥×¥·¥ç¥ó¤Ç ½ç½ø¤òÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¤¿¤À¤·¡¢-M µ¡Ç½ ¤È¡¢µ¡Ç½¤ò»ØÄꤷ¤Ê¤«¤Ã¤¿¾ì¹ç ¤Ë´Ø¤·¤Æ¤Ï -L ¥ª¥×¥·¥ç¥ó¤Ï̵¸ú¤Ç¤¹¡£ ²¼µ­¤Ï¡¢gfhost ¥³¥Þ¥ó¥É¤Îµ¡Ç½°ìÍ÷¤Ç¤¹¡£Æó¤Ä°Ê¾å¤Îµ¡Ç½¤òƱ»þ¤Ë »ØÄꤹ¤ë¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó¡£ ̵»ØÄê µ¡Ç½¤òÆÃ¤Ë»ØÄꤷ¤Ê¤«¤Ã¤¿¾ì¹ç¡¢gfsd ¤Ø¤Î Ì䤤¹ç¤ï¤»¤ò¹Ô¤Ê¤¤¡¢Æ°ºî¤·¤Æ¤¤¤ë¥Û¥¹¥È¤Î¥Û¥¹¥È̾¤Î¤ß¤òɽ¼¨¤·¤Þ¤¹¡£ ¥Ç¥Õ¥©¡¼¥ë¥È¤Ç¤Ï¡¢¥Û¥¹¥È̾¤Î¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È½ç¤Çɽ¼¨¤·¤Þ¤¹¡£ °ú¿ô¤Ç»ØÄꤷ¤¿¥Û¥¹¥È¤ò¥á¥¿¥Ç¡¼¥¿¤ØÅÐÏ¿¤·¤Þ¤¹¡£ ¥ª¥×¥·¥ç¥ó -a ¤Ç¡¢¤½¤Î¥Û¥¹¥È¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤ò»ØÄꤹ¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£ ƱÍͤ˥ª¥×¥·¥ç¥ó -p ¤Ç¡¢¤½¤Î¥Û¥¹¥È¤Î¥Ý¡¼¥ÈÈÖ¹æ¤ò»ØÄꤹ¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£ ¥ª¥×¥·¥ç¥ó -n ¤Ç¡¢¤½¤Î¥Û¥¹¥È¤Î CPU ¿ô¤ò»ØÄꤷ¤Þ¤¹¡£¾Êά¤·¤¿¾ì¹ç¤Ë¤Ï 1 CPU ¤À¤È¤ß¤Ê¤·¤Þ¤¹¡£ ¥Û¥¹¥È̾¤Ï¡¢°ì¤Ä¤Î¥³¥Þ¥ó¥É¤ÇÊ£¿ôµ­½Ò¤Ç¤­¤Þ¤¹¡£¤³¤Î¾ì¹ç¡¢ºÇ½é¤Ë »ØÄꤷ¤¿Ì¾Á°¤¬¡¢¤½¤Î¥Û¥¹¥È¤Î¸ÇÍ­¼±Ê̻ҤȤ·¤Æ¡¢Ê£À½¾ðÊó¤Î´ÉÍý¤Ë ÍѤ¤¤é¤ì¤Þ¤¹¡£»Ä¤ê¤Î¥Û¥¹¥È̾¤Ï¡¢¤½¤Î¥Û¥¹¥È¤ËÂФ¹¤ëÊÌ̾¤È¤·¤Æ °·¤ï¤ì¤Þ¤¹¡£ ¤¢¤ë¥Û¥¹¥È¤¬Ê£¿ô¤Î¥Í¥Ã¥È¥ï¡¼¥¯¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤ò»ý¤Á¡¢¤½¤ì¤¾¤ì¤Î ¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤ËÊÌ¡¹¤Î¥Û¥¹¥È̾¤¬³ä¤êÅö¤Æ¤é¤ì¤Æ¤¤¤ë¾ì¹ç¡¢¤½¤ì¤é Á´¤Æ¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î¥Û¥¹¥È̾¤ò¡¢¸ÇÍ­¼±Ê̻Ҥ¢¤ë¤¤¤ÏÊÌ̾¤È¤·¤Æ ÅÐÏ¿¤·¤Æ¤¯¤À¤µ¤¤¡£ ¤Þ¤¿¡¢/etc/hosts ¥Õ¥¡¥¤¥ë¤ä NIS ¤Î hosts ¥Ç¡¼¥¿¥Ù¡¼¥¹¤ËÅÐÏ¿¤µ¤ì¤¿ ¥Û¥¹¥È̾¤¬¡¢¥É¥á¥¤¥óÉô¤ò´Þ¤ó¤Ç¤Ê¤¤¤è¤¦¤Ê¾ì¹ç (/etc/hosts ¤ä NIS hosts ¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ë FQDN ¤¬ÅÐÏ¿¤µ¤ì¤Æ¤Ê¤¤¤è¤¦¤Ê¾ì¹ç) ¤â¡¢ ɬ¤º¥Û¥¹¥È¤ÎÊÌ̾ÅÐÏ¿¤¬É¬ÍפȤʤê¤Þ¤¹¡£¤³¤Î¤è¤¦¤Ê¾ì¹ç¡¢¸ÇÍ­¼±ÊÌ»Ò ¤È¤·¤Æ¥É¥á¥¤¥ó̾¤ò´Þ¤à¥Û¥¹¥È̾ (FQDN) ¤ò¡¢ÊÌ̾¤È¤·¤Æ¥É¥á¥¤¥ó̾¤ò ´Þ¤Þ¤Ê¤¤¥Û¥¹¥È̾¤òÅÐÏ¿¤·¤Æ¤¯¤À¤µ¤¤¡£ °ú¿ô¤Ë»ØÄꤷ¤¿¥Û¥¹¥È¾ðÊó¤ò¥á¥¿¥Ç¡¼¥¿¤«¤éºï½ü¤·¤Þ¤¹¡£ ¸½ºß¤Î¤È¤³¤í¡¢Ê£À½¾ðÊó¤È¤·¤Æ»²¾È¤µ¤ì¤Æ¤¤¤ë¥Û¥¹¥È¤â ºï½ü¤Ç¤­¤Æ¤·¤Þ¤¤¤Þ¤¹¤¬¡¢¤³¤ì¤ò¹Ô¤Ê¤¦¤ÈÊ£À½¥Ç¡¼¥¿¥Ù¡¼¥¹¤¬ÉÔÀ°¹ç ¾õÂ֤ȤʤäƤ·¤Þ¤¤¤Þ¤¹¤Î¤ÇÃí°Õ¤¬É¬ÍפǤ¹¡£ ¥Û¥¹¥È̾¤Ë»ØÄê¤Ç¤­¤ë¤Î¤Ï ¸ÇÍ­¼±Ê̻ҤΤߤǤ¹¡£ gfsd ¤ËÌ䤤¹ç¤ï¤»¤ÆÆÀ¤¿¾ðÊ󡢤¹¤Ê¤ï¤Á ¥í¡¼¥É¥¢¥Ù¥ì¡¼¥¸¤Èǧ¾Ú¼êÃʤòɽ¼¨¤·¤Þ¤¹¡£ ¤³¤Îµ¡Ç½¤Ë´Ø¤·¤Æ¤Ï¡¢°ú¿ô¤Ç¥Û¥¹¥È̾¤ò»ØÄꤷ¤¿¾ì¹ç¡¢É½¼¨¤µ¤ì¤ë ¤Î¤Ï¡¢¸ÇÍ­¼±Ê̻ҤȤ·¤ÆÍѤ¤¤é¤ì¤Æ¤¤¤ë¥Û¥¹¥È̾¤Ç¤Ï¤Ê¤¯¡¢°ú¿ô ¤Ç»ØÄꤷ¤¿Ì¾Á°¤Ë¤Ê¤ê¤Þ¤¹¡£ ¤Þ¤¿¡¢¥Û¥¹¥È̾¤Î¸å¤Ë¡¢¥¢¥¯¥»¥¹¤ËÍѤ¤¤é¤ì¤¿ IP ¥¢¥É¥ì¥¹¤ò³ç¸Ì¤Ç °Ï¤Ã¤ÆÉ½¼¨¤·¤Þ¤¹¡£ ¥Û¥¹¥È¤¬Ää»ß¤ä¥Í¥Ã¥È¥ï¡¼¥¯¾ã³²¤Î¤¿¤á¤Ë¥¢¥¯¥»¥¹¤Ç¤­¤Ê¤«¤Ã¤¿¾ì¹ç¡¢ ¥í¡¼¥É¥¢¥Ù¥ì¡¼¥¸¤ÎÉôʬ¤Ë x.xx/x.xx/x.xx ¤Èɽ¼¨¤·¤Þ¤¹¡£ ¥Û¥¹¥È¤¬Æ°ºî¤·¤Æ¤¤¤ë¤¬¡¢¤½¤Î¥Û¥¹¥È¤Î gfsd ¤Ø ¥¢¥¯¥»¥¹¤Ç¤­¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï -.--/-.--/-.-- ¤Èɽ¼¨¤·¤Þ¤¹¡£ ¤½¤Î¼¡¤Î°ì·å¤ÎÍó¤Ïǧ¾Ú¼êÃʤǡ¢¡ÖG¡×¤Ï GSI ǧ¾Ú¤ª¤è¤Ó°Å¹æ²½¡¢ ¡Ög¡×¤Ïǧ¾Ú½èÍý¤Î¤ß GSI ¤Çǧ¾Ú¸å¤ÏÊݸî¤Î¤Ê¤¤À¸¥Ç¡¼¥¿ (gsi_auth)¡¢ ¡Ös¡×¤Ï sharedsecret ǧ¾Ú¡¢¡Öx¡×¤Ïǧ¾Ú¼ºÇÔ¡¢¡Ö-¡×¤Ïǧ¾Ú¤ò »î¤ß¤Ê¤«¤Ã¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£¤Þ¤¿¡¢¡Ö-U¡×¥ª¥×¥·¥ç¥ó»ØÄê»þ¤Ë¤Ï¡¢ ¤³¤Îǧ¾Ú¼êÃʤÎɽ¼¨Íó¤Ï¤Ê¤¯¤Ê¤ê¤Þ¤¹¡£ ¥Ç¥Õ¥©¡¼¥ë¥È¤Ç¤Ï¡¢¥Û¥¹¥È̾¤Î¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È½ç¤Çɽ¼¨¤·¤Þ¤¹¡£ gfsd ¤ËÌ䤤¹ç¤ï¤»¤ÆÆÀ¤¿¾ðÊó¡¢ ¤¹¤Ê¤ï¤Á¥í¡¼¥É¥¢¥Ù¥ì¡¼¥¸¤ª¤è¤Óǧ¾Ú¼êÃʤȡ¢ ¥á¥¿¥Ç¡¼¥¿¡¦¥µ¡¼¥Ð¡¼¤ËÌ䤤¹ç¤ï¤»¤ÆÆÀ¤¿¾ðÊó¡¢ ¤¹¤Ê¤ï¤Á¥¢¡¼¥­¥Æ¥¯¥Á¥ã̾¡¢CPU¿ô¤ª¤è¤Ó¥Û¥¹¥ÈÊÌ̾¤ò Á´¤ÆÉ½¼¨¤·¤Þ¤¹¡£¤Þ¤¿¥¢¥¯¥»¥¹¤ËÍѤ¤¤é¤ì¤¿¥Û¥¹¥È̾¤Î¸å¤Ë¡¢ IP ¥¢¥É¥ì¥¹¤ò³ç¸Ì¤Ç°Ï¤Ã¤ÆÉ½¼¨¤·¤Þ¤¹¡£ ¥Û¥¹¥È¤¬Ää»ß¤ä¥Í¥Ã¥È¥ï¡¼¥¯¾ã³²¤Î¤¿¤á¤Ë¥¢¥¯¥»¥¹¤Ç¤­¤Ê¤«¤Ã¤¿¾ì¹ç¡¢ ¥í¡¼¥É¥¢¥Ù¥ì¡¼¥¸¤ÎÉôʬ¤Ë x.xx/x.xx/x.xx ¤Èɽ¼¨¤·¤Þ¤¹¡£ ¥Û¥¹¥È¤¬Æ°ºî¤·¤Æ¤¤¤ë¤¬¡¢¤½¤Î¥Û¥¹¥È¤Î gfsd ¤Ø ¥¢¥¯¥»¥¹¤Ç¤­¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï -.--/-.--/-.-- ¤Èɽ¼¨¤·¤Þ¤¹¡£ ¤½¤Î¼¡¤Î°ì·å¤ÎÍó¤Ïǧ¾Ú¼êÃʤǡ¢¡ÖG¡×¤Ï GSI ǧ¾Ú¤ª¤è¤Ó°Å¹æ²½¡¢ ¡Ög¡×¤Ïǧ¾Ú½èÍý¤Î¤ß GSI ¤Çǧ¾Ú¸å¤ÏÊݸî¤Î¤Ê¤¤À¸¥Ç¡¼¥¿ (gsi_auth)¡¢ ¡Ös¡×¤Ï sharedsecret ǧ¾Ú¡¢¡Öx¡×¤Ïǧ¾Ú¼ºÇÔ¡¢¡Ö-¡×¤Ïǧ¾Ú¤ò »î¤ß¤Ê¤«¤Ã¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£¤Þ¤¿¡¢¡Ö-U¡×¥ª¥×¥·¥ç¥ó»ØÄê»þ¤Ë¤Ï¡¢ ¤³¤Îǧ¾Ú¼êÃʤÎɽ¼¨Íó¤Ï¤Ê¤¯¤Ê¤ê¤Þ¤¹¡£ ¥Ç¥Õ¥©¡¼¥ë¥È¤Ç¤Ï¡¢¥Û¥¹¥È̾¤Î¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È½ç¤Çɽ¼¨¤·¤Þ¤¹¡£ ¥á¥¿¥Ç¡¼¥¿¤ËÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë¥Û¥¹¥È¾ðÊó¤òɽ¼¨¤·¤Þ¤¹¡£ ¥Ç¥Õ¥©¡¼¥ë¥È¤Ç¤Ï¡¢¥Û¥¹¥È̾¤Î¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È½ç¤Çɽ¼¨¤·¤Þ¤¹¡£ ¸ÇÍ­¼±Ê̻ҤȤ·¤ÆÍѤ¤¤é¤ì¤Æ¤¤¤ë¥Û¥¹¥È̾¤ò»ØÄꤷ¡¢¥á¥¿¥Ç¡¼¥¿ ¤ËÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë¥Û¥¹¥È¾ðÊó¤òÊѹ¹¤·¤Þ¤¹¡£ -a ¥ª¥×¥·¥ç¥ó¤ª¤è¤Ó -n ¥ª¥×¥·¥ç¥ó¤Ï¡¢¤½¤ì¤¾¤ì´û¸¤ÎÃͤòÃÖ¤­´¹¤¨¤Þ¤¹¡£ ¤³¤ì¤ËÂФ·¡¢¥Û¥¹¥È¤ÎÊÌ̾¤Ë´Ø¤·¤Æ¤Ï¡¢Äɲäò°ÕÌ£¤·¤Þ¤¹¡£ ÄɲäǤϤʤ¯¡¢ÊÌ̾¤ÎÃÖ¤­´¹¤¨¤äºï½ü¤ò¹Ô¤Ê¤¤¤¿¤¤¾ì¹ç¤Ë¤Ï¡¢-A ¥ª¥×¥·¥ç¥ó ¤ò»ØÄꤷ¤Æ¤¯¤À¤µ¤¤¡£¤³¤Î¾ì¹ç¡¢Á´¤Æ¤ÎÊÌ̾¤òºï½ü¤·¤Æ¤«¤é¡¢(¤â¤·¤¢¤ì¤Ð) °ú¿ô¤Ç»ØÄꤷ¤¿ÊÌ̾¤òÄɲä·¤Þ¤¹¡£ ɸ½àÆþÎϤ«¤é¥Û¥¹¥È¤Ë´Ø¤¹¤ë¾ðÊó¤òÆÉ¤ß¹þ¤ß¡¢¥á¥¿¥Ç¡¼¥¿¤Ë Äɲä·¤Þ¤¹¡£Í¿¤¨¤ë¾ðÊó¤Î·Á¼°¤Ï¡¢-M µ¡Ç½¤Îɽ¼¨·Á¼°¤ÈƱ¤¸¤Ç¤¹¡£ °ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡£ OPTIONS -m µ¡Ç½¤Ç¥Û¥¹¥È¾ðÊó¤òÊѹ¹¤¹¤ëºÝ¤Ë¡¢¥Û¥¹¥È¤ÎÊÌ̾¤ò ÄɲäǤϤʤ¯ÃÖ¤­´¹¤¨¤¿¤¤¾ì¹ç¤Ë¡¢¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Þ¤¹¡£ ¥¢¡¼¥­¥Æ¥¯¥Á¥ã CPU¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤ò¡¢sparc-sun-solaris8 ¤ä i386-redhat8.0-linux ¤Î ¤è¤¦¤Ê·Á¼°¤Ç»ØÄꤷ¤Þ¤¹¡£ -c ¤ª¤è¤Ó -m µ¡Ç½¤Î¾ì¹ç¤Ë¤Ï¡¢Äɲá¦Êѹ¹¤¹¤ë¥Û¥¹¥È¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤È ¤·¤Æ¡¢¤³¤Î¥ª¥×¥·¥ç¥ó¤òÍѤ¤¤Þ¤¹¡£ -H, -l, -M ¤ª¤è¤ÓÆÃ¤Ëµ¡Ç½¤ò»ØÄꤷ¤Ê¤«¤Ã¤¿¾ì¹ç¤Ç¡¢¤«¤Ä ¥Û¥¹¥È̾¤ò¾Êά¤·¤¿¾ì¹ç¤Ë¤Ï¡¢»ØÄꤷ¤¿¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Î¥Û¥¹¥È¤Ë ´Ø¤·¤Æ¤Î¤ßɽ¼¨¤ò¹Ô¤Ê¤¤¤Þ¤¹¡£ ¥É¥á¥¤¥ó̾ -H, -l, -M ¤ª¤è¤ÓÆÃ¤Ëµ¡Ç½¤ò»ØÄꤷ¤Ê¤«¤Ã¤¿¾ì¹ç¤Ç¡¢¤«¤Ä ¥Û¥¹¥È̾¤ò¾Êά¤·¤¿¾ì¹ç¤Ë¡¢¤³¤Î¥ª¥×¥·¥ç¥ó¤Ç¡¢É½¼¨¤¹¤ë¥É¥á¥¤¥ó̾¤ò ¸ÂÄê¤Ç¤­¤Þ¤¹¡£ %%SYSCONFDIR%%/gfarm2.conf ¤Ê¤¤¤· $HOME/.gfarm2rc Ãæ¤Ç¡Öaddress_use¡×¤ò»ØÄꤹ¤ë¤È¡¢ ¥¢¥¯¥»¥¹¤ËÍѤ¤¤ë¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¤ËÍ¥Àè½ç°Ì¤ò¤Ä¤±¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ gfhost ¥³¥Þ¥ó¥É¤ËÂФ·¤Æ¤â¡¢¤³¤ÎÍ¥Àè½ç°Ì¤Ï±Æ¶Á¤·¤Þ¤¹¤¬¡¢-i ¥ª¥×¥·¥ç¥ó¤ò ¤Ä¤±¤ë¤È¡¢¤³¤Î»ØÄê¤ò̵»ë¤·¤Æ gfsd ¤Ë¥¢¥¯¥»¥¹ ¤¹¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡£ ÊÂÎóÅÙ gfsd ¤Ë¥¢¥¯¥»¥¹¤¹¤ëºÝ¤ÎÊÂÎóÅÙ¤ò»ØÄꤷ¤Þ¤¹¡£ ¥Ç¥Õ¥©¡¼¥ë¥È¤Ï 10 ¤Ç¤¹¡£ -H¡¢-l µ¡Ç½¤Î¾ì¹ç ¡¢¤³¤Î¥ª¥×¥·¥ç¥ó¤Ç¡¢ ɽ¼¨½ç½ø¤ò¡¢¥í¡¼¥É¥¢¥Ù¥ì¡¼¥¸½ç¤ËÊѹ¹¤·¤Þ¤¹¡£ CPU¿ô -c ¤ª¤è¤Ó -m µ¡Ç½¤Ç¡¢¥Û¥¹¥È¾ðÊó¤òÄɲá¦Êѹ¹¤¹¤ëºÝ¤Ë¡¢ ¤½¤Î¥Û¥¹¥È¤¬»ý¤Ä CPU ¤Î¿ô¤ò»ØÄꤷ¤Þ¤¹¡£ ¥Ý¡¼¥ÈÈÖ¹æ -c ¤ª¤è¤Ó -m µ¡Ç½¤Ç¡¢¥Û¥¹¥È¾ðÊó¤òÄɲá¦Êѹ¹¤¹¤ëºÝ¤Ë¡¢ ¤½¤Î¥Û¥¹¥È¤Î gfsd ¤¬ÍѤ¤¤ë¥Ý¡¼¥ÈÈÖ¹æ¤ò»ØÄꤷ¤Þ¤¹¡£ ¥Ñ¥¹Ì¾ ¤³¤Î¥³¥Þ¥ó¥É¤¬¥¢¥¯¥»¥¹¤¹¤ë¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤òÆÃÄꤹ¤ë¤¿¤á¤Î ¥Ñ¥¹Ì¾¤Þ¤¿¤Ï Gfarm URL ¤ò»ØÄꤷ¤Þ¤¹¡£ ¾Êά¤·¤¿¾ì¹ç¤Ï¡¢¡Ö/¡×¤ò»ØÄꤷ¤¿¤Î¤ÈƱ¤¸°ÕÌ£¤Ë¤Ê¤ê¤Þ¤¹¡£ ɽ¼¨¤òÀ°Î󤷤Ƥ¤¤ë¾ì¹ç¡¢É½¼¨¤Î½ç½ø¤òµÕ¤Ë¤·¤Þ¤¹¡£ -H, -l, -M ¤ª¤è¤ÓÆÃ¤Ëµ¡Ç½¤ò»ØÄꤷ¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¡¢É½¼¨¤¹¤ë½ç½ø¤ò ¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È½ç¤ËÀ°Î󤹤ë¤Î¤ò»ß¤á¤Þ¤¹¡£ -M µ¡Ç½¤Î¾ì¹ç¡¢°ú¿ô¤Ç¥Û¥¹¥È̾¤ò»ØÄꤷ¤¿¾ì¹ç¤Ë¤Ï ¤½¤Î½ç½ø¡¢¤µ¤â¤Ê¤¯¤Ð¥á¥¿¥Ç¡¼¥¿¤«¤é¼èÆÀ¤·¤¿½ç½ø¤Çɽ¼¨¤·¤Þ¤¹¡£ -H, -l µ¡Ç½¤Î¾ì¹ç¤ª¤è¤ÓÆÃ¤Ëµ¡Ç½¤ò»ØÄꤷ¤Ê¤«¤Ã¤¿¾ì¹ç¡¢ ¥Û¥¹¥È¤Ë½ç¤ËÌ䤤¹ç¤ï¤»¤ò¹Ô¤¤¡¢ÊÖ»ö¤ÎÊ֤äƤ­¤¿½ç½ø¤Çɽ¼¨¤·¤Þ¤¹¡£ TCP ¤Ë¤è¤ëǧ¾Ú¤ò¤ä¤á¡¢ UDP ¤Ë¤è¤ë¥í¡¼¥É¥¢¥Ù¥ì¡¼¥¸¤ÎÌ䤤¹ç¤ï¤»¤Î¤ß¤ò¹Ô¤¦¤è¤¦¤Ë¤·¤Þ¤¹¡£ ¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢-H ¤Ê¤¤¤· -l µ¡Ç½¤ò»ØÄꤷ¤¿¾ì¹ç¤ª¤è¤Ó ÆÃ¤Ëµ¡Ç½¤ò»ØÄꤷ¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë°ÕÌ£¤Î¤¢¤ë¥ª¥×¥·¥ç¥ó¤Ç¡¢ ¼Â¹Ô®ÅÙ¤¬Â®¤¯¤Ê¤ë¸ú²Ì¤¬¤¢¤ê¤Þ¤¹¡£ -H ¤Ê¤¤¤· -l ¤ò»ØÄꤷ¤Æ¤¤¤ë¾ì¹ç¡¢¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»ØÄꤹ¤ë¤È¡¢ ǧ¾ÚÊý¼°¤Îɽ¼¨Í󤬤ʤ¯¤Ê¤ê¤Þ¤¹¡£ -H ¤Ê¤¤¤· -l µ¡Ç½¤ò»ØÄꤷ¤¿¾ì¹ç¤ª¤è¤ÓÆÃ¤Ëµ¡Ç½¤ò»ØÄꤷ¤Ê¤«¤Ã¤¿¾ì¹ç¡¢ ¥Ç¥Õ¥©¡¼¥ë¥È¤Ç¤Ï¡¢gfsd ¤ËÂФ¹¤ëÌ䤤¹ç¤ï¤»¤Ë´Ø¤¹¤ë¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸ ¤òɽ¼¨¤·¤Þ¤»¤ó¡£-v ¥ª¥×¥·¥ç¥ó¤ò»ØÄꤹ¤ë¤È¡¢¤³¤Î¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤ò ɽ¼¨¤¹¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡£ SEE ALSO gfarm2.conf5 , gfsd8 gfarm-2.4.1/doc/docbook/ja/ref/man1/gfmkdir.1.docbook0000644000000000000000000000255711507222720020632 0ustar rootroot 15 May 2008 gfmkdir 1 Gfarm gfmkdir Gfarm ¥Ç¥£¥ì¥¯¥È¥ê¤òºîÀ®¤¹¤ë¡£ gfmkdir ¥ª¥×¥·¥ç¥ó gfarm¥Ñ¥¹ DESCRIPTION Gfarm¥Ñ¥¹¤Ë»ØÄꤷ¤¿¥Ç¥£¥ì¥¯¥È¥ê¤òºîÀ®¤·¤Þ¤¹¡£ OPTIONS »ØÄꤷ¤¿¥Ç¥£¥ì¥¯¥È¥ê¤¬Â¸ºß¤·¤Æ¤â¥¨¥é¡¼¤Ë¤·¤Þ¤»¤ó¡£ ɬÍפ˱þ¤¸¤Æ¿Æ¥Ç¥£¥ì¥¯¥È¥ê¤òºîÀ®¤·¤Þ¤¹¡£ °ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡£ SEE ALSO gfrmdir1 gfarm-2.4.1/doc/docbook/ja/ref/man1/gfexport.1.docbook0000644000000000000000000000356211507222720021042 0ustar rootroot 1 May 2002 gfexport 1 Gfarm gfexport Gfarm ¥Õ¥¡¥¤¥ë¤òÄ̾ï¤Î¥Õ¥¡¥¤¥ë¤ËÊÑ´¹¤¹¤ë gfexport -H ¥Û¥¹¥È»ØÄê¥Õ¥¡¥¤¥ë -I ¥Õ¥é¥°¥á¥ó¥ÈÈÖ¹æ gfarm-URL DESCRIPTION »ØÄꤷ¤¿ Gfarm URL ¤Îɽ¤¹ Gfarm ÊÂÎó¥Õ¥¡¥¤¥ë¤ò¡¢Ä̾ï¤Î¥Õ¥¡¥¤¥ë¤ËÊÑ´¹ ¤·¤ÆÉ¸½à½ÐÎϤ˽ÐÎϤ·¤Þ¤¹¡£ OPTIONS ¥Û¥¹¥È»ØÄê¥Õ¥¡¥¤¥ë ¥Õ¥é¥°¥á¥ó¥È¤ò¼è¤ê½Ð¤¹¥Û¥¹¥È̾¤Î¥ê¥¹¥È¤ò»ØÄꤷ¤Þ¤¹¡£ ¥Û¥¹¥È̾¤Ï¡¢³Æ¹Ô¤Ë°ì¥Û¥¹¥È¤º¤Äµ­½Ò¤·¤Þ¤¹¡£ ¾Êά¤·¤¿¾ì¹ç¤Ë¤Ï¡¢¼«Æ°Åª¤ËÁª¤Ð¤ì¤¿¥Û¥¹¥È¤«¤é¥Õ¥é¥°¥á¥ó¥È¤òÆÀ¤Þ¤¹¡£ ¥Õ¥¡¥¤¥ë̾¤È¤·¤Æ ``-'' ¤ò»ØÄꤷ¤¿¾ì¹ç¡¢É¸½àÆþÎϤ«¤é¥Û¥¹¥È̾¤Î¥ê¥¹¥È¤ò ÆÉ¤ß¹þ¤ß¤Þ¤¹¡£ ¥Õ¥é¥°¥á¥ó¥ÈÈÖ¹æ ÊÂÎó¥Õ¥¡¥¤¥ëÃæ¤Î¡¢»ØÄꤷ¤¿¥Õ¥é¥°¥á¥ó¥È¤Î¤ß¤ò¼è¤ê½Ð¤·¤Þ¤¹¡£ ¼Â¹Ô·Á¼°¤Î¥Õ¥¡¥¤¥ë¤Î¾ì¹ç¤Ë¤Ï¡¢¤³¤Î¥ª¥×¥·¥ç¥ó¤Ç¼Â¹Ô¥¢¡¼¥­¥Æ¥¯¥Á¥ã (Îã ¡Ösparc-sun-solaris8¡×) ¤ò»ØÄꤹ¤ë¤³¤È¤Ë¤è¤Ã¤Æ¡¢»ØÄꤷ¤¿¥¢¡¼¥­ ¥Æ¥¯¥Á¥ã¤Î¼Â¹Ô¥Õ¥¡¥¤¥ë¤ò¼è¤ê½Ð¤»¤Þ¤¹¡£ °ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡£ gfarm-2.4.1/doc/docbook/ja/ref/man1/gfstatus.1.docbook0000644000000000000000000000123111507222720021033 0ustar rootroot 19 Dec 2008 gfstatus 1 Gfarm gfstatus Gfarm¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¾ðÊó¤òɽ¼¨¤¹¤ë gfstatus DESCRIPTION Gfarm¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¾ðÊó¤òɽ¼¨¤·¤Þ¤¹¡¥ gfarm-2.4.1/doc/docbook/ja/ref/man1/gfexec.1.docbook0000644000000000000000000000345211507222720020443 0ustar rootroot 22 Apr 2004 gfexec 1 Gfarm gfexec Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ë gfexec -N ¥Î¡¼¥ÉÁí¿ô -I ¥Î¡¼¥ÉÈÖ¹æ -s ¥×¥í¥°¥é¥à̾ °ú¿ô DESCRIPTION Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤·¤Þ¤¹¡¥ËÜ¥³¥Þ¥ó¥É¤Ï¥Õ¥¡ ¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¾å¤Ç¼Â¹Ô¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡¥ OPTIONS ¥Î¡¼¥É¿ô ¸Æ¤Ó½Ð¤¹¥×¥í¥°¥é¥à¤Î¥Î¡¼¥ÉÁí¿ô¤òÊѹ¹¤·¤Þ¤¹¡¥ ¥Î¡¼¥ÉÈÖ¹æ ¸Æ¤Ó½Ð¤¹¥×¥í¥°¥é¥à¤Î¥Î¡¼¥ÉÈÖ¹æ¤òÊѹ¹¤·¤Þ¤¹¡¥ ¡Ö 1 0¡×¤È»ØÄꤷ¤¿¤Î¤ÈÅù²Á¤Ç¤¹¡¥ °ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡¥ gfarm-2.4.1/doc/docbook/ja/ref/man1/gfls.1.docbook0000644000000000000000000000676511507222720020147 0ustar rootroot 27 Apr 2007 gfls 1 Gfarm gfls Gfarm ¥Ç¥£¥ì¥¯¥È¥ê¤ÎÆâÍÆ¤òɽ¼¨¤¹¤ë¡£ gfls ¥ª¥×¥·¥ç¥ó path DESCRIPTION path ¤Ë»ØÄꤷ¤¿¥Õ¥¡¥¤¥ë¤Ê¤¤¤·¥Ç¥£¥ì¥¯¥È¥ê¤Î̾Á°¤È ´ØÏ¢¤¹¤ë¾ðÊó¤òɽ¼¨¤·¤Þ¤¹¡£ OPTIONS ``.''¤Ç»Ï¤Þ¤ë¥Ñ¥¹Ì¾¤âɽ¼¨¤·¤Þ¤¹¡£ ``.''¤È``..''¤Ïɽ¼¨¤·¤Þ¤»¤ó¡£ ¥Þ¥ë¥Á¥«¥é¥à½ÐÎϤò¹Ô¤Ê¤¤¤Þ¤¹¡£¤³¤ì¤Ï¥Ç¥Õ¥©¥ë¥È¤Î½ÐÎÏ·Á¼°¤Ç¤¹¡£ ¤½¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë°¤¹¤ëÆâÍÆ¤Ç¤Ï¤Ê¤¯¡¢¥Ç¥£¥ì¥¯¥È¥ê¼«¿È¤òɽ¼¨¤·¤Þ¤¹¡£ Éÿô °À­¥­¥ã¥Ã¥·¥å¤òÊÝ»ý¤¹¤ëÉÿô¤ò»ØÄꤷ¤Þ¤¹¡£ 0 ¤ò»ØÄꤷ¤¿¾ì¹ç¡¢Â°À­¤ò¥­¥ã¥Ã¥·¥å¤·¤Þ¤»¤ó¡£ ̾¾Î¤Îľ¸å¤Ë¡¢¤½¤Î¼ïÎà¤òɽ¤¹Ê¸»ú (*/=@| ¤Î¤¤¤º¤ì¤«) ¤òɽ¼¨¤·¤Þ¤¹¡£ inode ÈÖ¹æ¤âɽ¼¨¤·¤Þ¤¹¡£ ¥Õ¥¡¥¤¥ë¤Î¥µ¥¤¥º¡¢½êÍ­¼Ô¡¢¥°¥ë¡¼¥×¡¢¹¹¿·»þ¹ï¤Ê¤É¤Î°À­¾ðÊó¤â ɽ¼¨¤·¤Þ¤¹¡£ µÕ½ç¤ËÀ°Îó¤·¤ÆÉ½¼¨¤·¤Þ¤¹¡£ ¥Ç¥£¥ì¥¯¥È¥ê¤ÎÆâÍÆ¤òºÆµ¢Åª¤Ëɽ¼¨¤·¤Þ¤¹¡£ ¥Õ¥¡¥¤¥ë¥µ¥¤¥º¤ÇÀ°Îó¤·¤Þ¤¹¡£ ¥Õ¥¡¥¤¥ë̾¤Ç¤Ï¤Ê¤¯¡¢¥Õ¥¡¥¤¥ë¤Î»þ¹ï¤ò´ð½à¤ËÀ°Îó¤·¤Þ¤¹¡£ ¥ª¥×¥·¥ç¥ó¤ÈƱ»þ¤Ë»ØÄꤹ¤ë¤È¡¢»þ¹ï¤ò´°Á´¤Ê·Á¼°¤Çɽ¼¨¤·¤Þ¤¹¡£ 1¹Ô¤Ë1¥¨¥ó¥È¥ê¤º¤Äɽ¼¨¤·¤Þ¤¹¡£ °ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡£ gfarm-2.4.1/doc/docbook/ja/ref/man1/gfgrep.1.docbook0000644000000000000000000000423611507222720020455 0ustar rootroot 1 May 2002 gfgrep 1 Gfarm gfgrep ÊÂÎó¥Õ¥¡¥¤¥ë¤ò grep ¤¹¤ë gfrun gfarm:gfgrep -o ½ÐÎÏgfarm-URL Àµµ¬É½¸½ ÆþÎÏgfarm-URL gfrun gfarm:gfgrep -o ½ÐÎÏgfarm-URL -e Àµµ¬É½¸½ ÆþÎÏgfarm-URL DESCRIPTION gfrun ¤«¤é¸Æ¤Ó½Ð¤µ¤ì¤ë¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Î¥µ¥ó¥×¥ë¡¦¥×¥í¥°¥é¥à¤Ç¤¹¡£ ¤Þ¤¿¡¢¥í¡¼¥«¥ë¥Õ¥¡¥¤¥ë¥Ó¥å¡¼¤òÍøÍѤ·¤Æ Gfarm ¥Õ¥¡¥¤¥ë¤Ë½ÐÎϤ¹¤ëÎã¤Ë¤â ¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£ ÆþÎÏ gfarm-URL ¤«¤éÀµµ¬É½¸½¤ò¸¡º÷¤·¡¢·ë²Ì¤ò ½ÐÎÏ gfarm-URL ¤Ë½ÐÎϤ· ¤Þ¤¹¡£ ¥½¡¼¥¹¤ò¸«¤ë¤Èʬ¤«¤ëÄ̤ꡢgfrun ¤«¤é¸Æ¤Ó½Ð¤µ¤ì¤ë¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¡¢ -I ¤ª¤è¤Ó -N ¥ª¥×¥·¥ç¥ó¤ò²ò¼á¤·¡¢¤³¤³¤«¤éÆÀ¤¿ÃÍ¤Ç gfs_pio_set_local() ¤ò¸Æ¤Ó½Ð¤¹É¬Íפ¬¤¢¤ê¤Þ¤¹¡£ OPTIONS Àµµ¬É½¸½ ¡Ö-¡×¤Ç»Ï¤Þ¤ëÀµµ¬É½¸½¤ò»ØÄꤷ¤¿¤¤¾ì¹ç¤ËÍѤ¤¤Þ¤¹¡£ gfarm-URL ½ÐÎÏ Gfarm ¥Õ¥¡¥¤¥ë¤Î URL ¤ò»ØÄꤷ¤Þ¤¹¡£ °ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡£ gfarm-2.4.1/doc/docbook/ja/ref/man1/gfrep.1.docbook0000644000000000000000000001130511507222720020301 0ustar rootroot 31 May 2008 gfrep 1 Gfarm gfrep Gfarm ¥Õ¥¡¥¤¥ë¤ÎÊ£À½¤òºîÀ®¤¹¤ë¡¥ gfrep -mnqvx -S Ê£À½¸µ¥É¥á¥¤¥ó̾ -D Ê£À½Àè¥É¥á¥¤¥ó̾ -h Ê£À½¸µ¥Û¥¹¥È»ØÄê¥Õ¥¡¥¤¥ë -H Ê£À½Àè¥Û¥¹¥È»ØÄê¥Õ¥¡¥¤¥ë -N Ê£À½¿ô -j ÊÂÎó¿ô path DESCRIPTION °ú¿ô path ¤Ç»ØÄꤷ¤¿¥Õ¥¡¥¤¥ë¤ÎÊ£À½¤ò¡¤ »ØÄꤵ¤ì¤¿¥Û¥¹¥È·²¤Ë¡¤»ØÄꤵ¤ì¤¿Ê£À½¤Î¿ô¤À¤±ºîÀ®¤·¤Þ¤¹¡¥ Ê£À½ºîÀ®¸µ¤Î¥Û¥¹¥È·²¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¤ ¤½¤Î¥Û¥¹¥È·²¤Ë¥Õ¥¡¥¤¥ë¤ÎÊ£À½¤¬¤¢¤ë¤È¤­¤Ë¸Â¤ê¡¤ Ê£À½¤¬ºîÀ®¤µ¤ì¤Þ¤¹¡¥ ¥Û¥¹¥È·²¤Ï¡¤¥É¥á¥¤¥ó̾¤È¥Û¥¹¥È»ØÄê¥Õ¥¡¥¤¥ë¤Ë¤è¤ê»ØÄê²Äǽ¤Ç¤¹¤¬¡¤ ξÊý¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¤ÏξÊý¤Î¾ò·ï¤òËþ¤¿¤¹¥Û¥¹¥È·²¤¬»ØÄꤵ¤ì¤¿¤³¤È¤Ë¤Ê¤ê¤Þ¤¹¡¥ path ¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Î¾ì¹ç¡¤ ¤½¤Î¥Ç¥£¥ì¥¯¥È¥ê°Ê²¼¤Î¥Õ¥¡¥¤¥ë¤ÎÊ£À½¤òºÆµ¢Åª¤ËºîÀ®¤·¤Þ¤¹¡¥ OPTIONS Ê£À½¸µ¥É¥á¥¤¥ó̾ ¥Õ¥¡¥¤¥ëÊ£À½¸µ¤Î¥Û¥¹¥È¤Î¥É¥á¥¤¥ó̾¤ò»ØÄꤷ¤Þ¤¹¡¥ Ê£À½Àè¥É¥á¥¤¥ó̾ ¥Õ¥¡¥¤¥ëÊ£À½ºîÀ®Àè¤Î¥Û¥¹¥È¤Î¥É¥á¥¤¥ó̾¤ò»ØÄꤷ¤Þ¤¹¡¥ ¤³¤Î¥ª¥×¥·¥ç¥ó¤â ¥ª¥×¥·¥ç¥ó¤â»ØÄꤷ¤Ê¤¤¾ì¹ç¡¤ ÍøÍѲÄǽ¤ÊÁ´¥Û¥¹¥È·²¤òÂоݤȤ·¤Æ¥Õ¥¡¥¤¥ëÊ£À½¤òºîÀ®¤·¤Þ¤¹¡¥ Ê£À½¸µ¥Û¥¹¥È»ØÄê¥Õ¥¡¥¤¥ë ¥Õ¥¡¥¤¥ëÊ£À½¸µ¤Î¥Û¥¹¥È̾¤Î¥ê¥¹¥È¤òµ­½Ò¤·¤¿ ¥Õ¥¡¥¤¥ë̾¤ò»ØÄꤷ¤Þ¤¹¡¥ ¥Û¥¹¥È̾¤Ï¡¤¥Õ¥¡¥¤¥ëÃæ¤Î³Æ¹Ô¤Ë°ì¥Û¥¹¥È¤º¤Äµ­½Ò¤·¤Þ¤¹¡¥ ¥Õ¥¡¥¤¥ë̾¤È¤·¤Æ ``-'' ¤ò»ØÄꤷ¤¿¾ì¹ç¡¤É¸½àÆþÎϤ«¤é¥Û¥¹ ¥È̾¤Î¥ê¥¹¥È¤òÆÉ¤ß¹þ¤ß¤Þ¤¹¡¥ Ê£À½Àè¥Û¥¹¥È»ØÄê¥Õ¥¡¥¤¥ë ¥Õ¥¡¥¤¥ë¤ÎÊ£À½¤òºîÀ®¤¹¤ë¥Û¥¹¥È̾¤Î¥ê¥¹¥È¤òµ­½Ò¤·¤¿ ¥Õ¥¡¥¤¥ë̾¤ò»ØÄꤷ¤Þ¤¹¡¥ ¥Û¥¹¥È̾¤Ï¡¤¥Õ¥¡¥¤¥ëÃæ¤Î³Æ¹Ô¤Ë°ì¥Û¥¹¥È¤º¤Äµ­½Ò¤·¤Þ¤¹¡¥ ¥Õ¥¡¥¤¥ë̾¤È¤·¤Æ ``-'' ¤ò»ØÄꤷ¤¿¾ì¹ç¡¤É¸½àÆþÎϤ«¤é¥Û¥¹ ¥È̾¤Î¥ê¥¹¥È¤òÆÉ¤ß¹þ¤ß¤Þ¤¹¡¥ Ê£À½¿ô ɬÍפÊÊ£À½¤Î¿ô¤ò»ØÄꤷ¤Þ¤¹¡¥ Ê£À½Àè¤Ë¡¤»ØÄꤵ¤ì¤¿¿ô°Ê¾å¤ÎÊ£À½¤¬´û¤Ë¸ºß¤¹¤ë¾ì¹ç¤Ï¡¤ Ê£À½¤ÎºîÀ®¤âºï½ü¤â¹Ô¤¤¤Þ¤»¤ó¡¥ ¤³¤Î¥ª¥×¥·¥ç¥ó¤ò¾Êά¤¹¤ë¤È ¤È»ØÄꤵ¤ì¤¿¤â¤Î¤È¤ß¤Ê¤µ¤ì¤Þ¤¹¡¥ ÊÂÎó¿ô »ØÄꤵ¤ì¤¿ÊÂÎó¿ô¤Ç¥Õ¥¡¥¤¥ëÊ£À½¤òºîÀ®¤·¤Þ¤¹¡¥ ¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï OpenMP C ¥³¥ó¥Ñ¥¤¥é¤Ç¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤¿¤È¤­¤Ë ¸Â¤êÍ­¸ú¤Ç¤¹¡¥¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¤»ØÄꤵ¤ì¤¿Áí¥Õ¥¡¥¤¥ë¿ô¡¤ Ê£À½¸µ¥Û¥¹¥È¿ô¡¤Ê£À½Àè¥Û¥¹¥È¿ô¤Î¤¦¤Á¤ÎºÇ¾®¤È¤Ê¤ê¤Þ¤¹¡¥ Ê£À½¤Ç¤Ï¤Ê¤¯°Üư¤ò¹Ô¤¤¤Þ¤¹¡¥ Ê£À½Àè¤Ë¡¤»ØÄꤵ¤ì¤¿¿ô°Ê¾å¤ÎÊ£À½¤¬Â¸ºß¤¹¤ë¾ì¹ç¤Ï¡¤ Ê£À½¤ò¾Ãµî¤·¡¤»ØÄꤵ¤ì¤¿¿ô¤Ë¤·¤Þ¤¹¡¥ ¥Õ¥¡¥¤¥ëÊ£À½¤¬ºîÀ®¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¤òɽ¼¨¤·¤Þ¤¹¡¥ ¼ÂºÝ¤Ë¤Ï²¿¤â¼Â¹Ô¤µ¤ì¤Þ¤»¤ó¡¥ ¥¨¥é¡¼¤Ç¤Ï¤Ê¤¤¥á¥Ã¥»¡¼¥¸¤Î½ÐÎϤò¹Ô¤¤¤Þ¤»¤ó¡¥ Ê£À½½èÍý¤Ë´Ø¤·¤Æ¡¤¾éŤÊɽ¼¨¤ò¹Ô¤¤¤Þ¤¹¡¤ °ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡¥ BUGS Ê£À½ºîÀ®¸µ¤È¤Ê¤ë¥Û¥¹¥È¤Ï¡¤ ¼ÂºÝ¤Ë¤ÏÊ£À½ºîÀ®¸µ¤È¤·¤Æ»ØÄꤵ¤ì¤¿¥Û¥¹¥È·²¤«¤éÁª¤Ð¤ì¤ë¤È¤Ï¸Â¤ê¤Þ¤»¤ó¡¥ gfarm-2.4.1/doc/docbook/ja/ref/man1/gfgroup.1.docbook0000644000000000000000000000626111507222720020654 0ustar rootroot 20 Jan 2010 gfgroup 1 Gfarm gfgroup Gfarm ¥°¥ë¡¼¥×´ÉÍý¥³¥Þ¥ó¥É gfgroup -P path -l group gfgroup -P path -c groupname user gfgroup -P path -m groupname user gfgroup -P path -d groupname DESCRIPTION Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë¤ª¤±¤ë¥°¥ë¡¼¥×´ÉÍý¤ò¹Ô¤¤¤Þ¤¹¡¥ ¥Ç¥Õ¥©¥ë¥È¤Ç¤ÏÁ´ÅÐÏ¿¥°¥ë¡¼¥×¤òɽ¼¨¤·¤Þ¤¹¡¥ ¥°¥ë¡¼¥×̾¤¬»ØÄꤵ¤ì¤¿¤é¡¤»ØÄꤵ¤ì¤¿¥°¥ë¡¼¥×¤òɽ¼¨¤·¤Þ¤¹¡¥ Gfarm¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î´ÉÍý¼Ô¤Ï¡¤-c¡¤-m¡¤-d ¥ª¥×¥·¥ç¥ó¤ò»ØÄꤹ¤ë¤³¤È¤Ë¤è¤ê¡¤¤½¤ì¤¾¤ì¥°¥ë¡¼¥×ºîÀ®¡¤ ¥°¥ë¡¼¥×¥á¥ó¥ÐÊѹ¹¡¤¥°¥ë¡¼¥×ºï½ü¤ò¹Ô¤¦¤³¤È¤¬¤Ç¤­¤Þ¤¹¡¥ OPTIONS ¥Ñ¥¹Ì¾ ¤³¤Î¥³¥Þ¥ó¥É¤¬¥¢¥¯¥»¥¹¤¹¤ë¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤òÆÃÄꤹ¤ë¤¿¤á¤Î ¥Ñ¥¹Ì¾¤Þ¤¿¤Ï Gfarm URL ¤ò»ØÄꤷ¤Þ¤¹¡£ ¾Êά¤·¤¿¾ì¹ç¤Ï¡¢¡Ö/¡×¤ò»ØÄꤷ¤¿¤Î¤ÈƱ¤¸°ÕÌ£¤Ë¤Ê¤ê¤Þ¤¹¡£ ¥°¥ë¡¼¥×̾¤È¥°¥ë¡¼¥×¥á¥ó¥Ð¤Î¾ðÊó¤òɽ¼¨¤·¤Þ¤¹¡¥ ¥°¥ë¡¼¥×¤ÎºîÀ®¤ò¹Ô¤¤¤Þ¤¹¡¥ ÅÐÏ¿¤Ë¤Ï½é´ü¥°¥ë¡¼¥×¥á¥ó¥Ð¤â»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡¥ Gfarm¤Î´ÉÍý¼Ô¤¬¼Â¹Ô²Äǽ¤Ç¤¹¡¥ ¥°¥ë¡¼¥×¥á¥ó¥Ð¤ÎÊѹ¹¤ò¹Ô¤¤¤Þ¤¹¡¥ Êѹ¹¤·¤¿¤¤¥°¥ë¡¼¥×̾¤È¥á¥ó¥Ð¤Î¥ê¥¹¥È»ØÄꤷ¤Þ¤¹¡¥ Gfarm¤Î´ÉÍý¼Ô¤¬¼Â¹Ô²Äǽ¤Ç¤¹¡¥ ¥°¥ë¡¼¥×¤ò¾Ãµî¤·¤Þ¤¹¡¥ Gfarm¤Î´ÉÍý¼Ô¤¬¼Â¹Ô²Äǽ¤Ç¤¹¡¥ °ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡¥ SEE ALSO gfuser1 gfarm-2.4.1/doc/docbook/ja/ref/man1/gfln.1.docbook0000644000000000000000000000236511507222720020132 0ustar rootroot 19 Mar 2009 gfln 1 Gfarm gfln ¥Ï¡¼¥É¥ê¥ó¥¯¡¤¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤òºîÀ®¤¹¤ë gfln options target link_name DESCRIPTION target¤ËÂФ¹¤ë¥Ï¡¼¥É¥ê¥ó¥¯¤ò link_name¤ËºîÀ®¤·¤Þ¤¹¡¥ -s ¥ª¥×¥·¥ç¥ó¤¬»ØÄꤵ¤ì¤ë¤È¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤òºîÀ®¤·¤Þ¤¹¡¥ OPTIONS ¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤òºîÀ®¤·¤Þ¤¹¡¥ °ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡¥ gfarm-2.4.1/doc/docbook/ja/ref/man1/gfcd.1.docbook0000644000000000000000000000313711507222720020105 0ustar rootroot 2 Jul 2003 gfcd 1 Gfarm gfcd Gfarm ºî¶È¥Ç¥£¥ì¥¯¥È¥ê¤òÊѹ¹¤¹¤ë¡£ gfcd ¥Ç¥£¥ì¥¯¥È¥ê DESCRIPTION Gfarm ºî¶È¥Ç¥£¥ì¥¯¥È¥ê¤ò »ØÄꤷ¤¿¥Ç¥£¥ì¥¯¥È¥ê¤ËÊѹ¹¤·¤Þ¤¹¡£ ¥Ç¥£¥ì¥¯¥È¥ê¤ò»ØÄꤷ¤Ê¤¤¾ì¹ç¤Ï¡¢¥æ¡¼¥¶¤Î Gfarm ¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤¢¤ë gfarm:/¥°¥í¡¼¥Ð¥ë¥æ¡¼¥¶ ¤ËÊѹ¹¤·¤Þ¤¹¡£ ³ÆGfarm ¥³¥Þ¥ó¥É¤¬ºî¶È¥Ç¥£¥ì¥¯¥È¥ê¤ò»²¾È¤Ç¤­¤ë¤è¤¦¤Ë¡¢³Æ¥æ¡¼¥¶¤Î ¥·¥§¥ëÀßÄê¥Õ¥¡¥¤¥ë¤Ë°Ê²¼¤ÎÄêµÁ¤òÄɲ䷤Ƥ¯¤À¤µ¤¤¡£ Bourne shell ·Ï¥·¥§¥ë¤Î¾ì¹ç gfcd() { eval "`gfsetdir $1`"; } csh ·Ï¥·¥§¥ë¤Î¾ì¹ç alias gfcd 'eval `gfsetdir \!*`' SEE ALSO gfpwd1 , gfsetdir1 gfarm-2.4.1/doc/docbook/ja/ref/man1/gfwhere.1.docbook0000644000000000000000000000242111507222720020624 0ustar rootroot 14 May 2008 gfwhere 1 Gfarm gfwhere Gfarm ¥Õ¥¡¥¤¥ë¤Î¥ì¥×¥ê¥«¤Î½êºß¤òɽ¼¨¤¹¤ë¡£ gfwhere -r, -R path DESCRIPTION »ØÄꤷ¤¿¥Õ¥¡¥¤¥ë¤Ë¤Ä¤¤¤Æ¡¢¥ì¥×¥ê¥«¤Î½êºß¤òɽ¼¨¤·¤Þ¤¹¡£ -r ¤¢¤ë¤¤¤Ï -R ¥ª¥×¥·¥ç¥ó¤òÉÕ¤±¤ë¤È¡¢ »ØÄꤵ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¤Ë´Þ¤Þ¤ì¤ë¥Õ¥¡¥¤¥ë¤Î¥ì¥×¥ê¥«¤Î½êºß¤ò ºÆµ¢Åª¤Ëɽ¼¨¤·¤Þ¤¹¡£ OPTIONS ¥Ç¥£¥ì¥¯¥È¥ê¤Ë´Þ¤Þ¤ì¤ë¥Õ¥¡¥¤¥ë¤Î¥ì¥×¥ê¥«¤Î½êºß¤ò ºÆµ¢Åª¤Ëɽ¼¨¤·¤Þ¤¹¡£ °ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡£ gfarm-2.4.1/doc/docbook/ja/ref/man1/gfuser.1.docbook0000644000000000000000000000704111507222720020473 0ustar rootroot 20 Jan 2010 gfuser 1 Gfarm gfuser Gfarm ¥æ¡¼¥¶´ÉÍý¥³¥Þ¥ó¥É gfuser -P path -l user gfuser -P path -c username realname homedir gsi_dn gfuser -P path -m username realname homedir gsi_dn gfuser -P path -d username DESCRIPTION Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë¤ª¤±¤ëÍøÍѥ桼¥¶¤Î´ÉÍý¤ò¹Ô¤¤¤Þ¤¹¡¥ ¥Ç¥Õ¥©¥ë¥È¤Ç¤ÏÅÐÏ¿¥æ¡¼¥¶¤òɽ¼¨¤·¤Þ¤¹¡¥ ¥æ¡¼¥¶Ì¾¤¬»ØÄꤵ¤ì¤¿¤é¡¤»ØÄꤵ¤ì¤¿¥æ¡¼¥¶¤òɽ¼¨¤·¤Þ¤¹¡¥ Gfarm¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î´ÉÍý¼Ô¤Ï¡¤-c¡¤-m¡¤-d ¥ª¥×¥·¥ç¥ó¤ò»ØÄꤹ¤ë¤³¤È¤Ë¤è¤ê¡¤¤½¤ì¤¾¤ì¥æ¡¼¥¶¤ÎÅÐÏ¿¡¤ ÅÐÏ¿¾ðÊóÊѹ¹¡¤ÅÐÏ¿ºï½ü¤ò¹Ô¤¦¤³¤È¤¬¤Ç¤­¤Þ¤¹¡¥ OPTIONS ¥Ñ¥¹Ì¾ ¤³¤Î¥³¥Þ¥ó¥É¤¬¥¢¥¯¥»¥¹¤¹¤ë¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤òÆÃÄꤹ¤ë¤¿¤á¤Î ¥Ñ¥¹Ì¾¤Þ¤¿¤Ï Gfarm URL ¤ò»ØÄꤷ¤Þ¤¹¡£ ¾Êά¤·¤¿¾ì¹ç¤Ï¡¢¡Ö/¡×¤ò»ØÄꤷ¤¿¤Î¤ÈƱ¤¸°ÕÌ£¤Ë¤Ê¤ê¤Þ¤¹¡£ ÅÐÏ¿¥æ¡¼¥¶¤Î¾ðÊó¤ò¾ÜºÙ¤Ëɽ¼¨¤·¤Þ¤¹¡¥ ¥æ¡¼¥¶¤ÎÅÐÏ¿¤ò¹Ô¤¤¤Þ¤¹¡¥ ÅÐÏ¿¤Ë¤ÏGfarm¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ËÃÖ¤±¤ë¥°¥í¡¼¥Ð¥ë¥æ¡¼¥¶Ì¾¡¤ ¼Â¥æ¡¼¥¶Ì¾¡¤Gfarm¾å¤Î¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê¡¤GSIǧ¾Ú¤Ë¤ª¤±¤ë ¥æ¡¼¥¶¾ÚÌÀ½ñ¤ÎSubject DN¤ò»ØÄꤷ¤Þ¤¹¡¥ ¼Â¥æ¡¼¥¶Ì¾¡¤Subject DN¤Ê¤É¤Ë¶õÇò¤¬´Þ¤Þ¤ì¤ë¾ì¹ç¤Ï¡¤ ¥À¥Ö¥ë¥¯¥ª¡¼¥È¤Ê¤É¤Ç³ç¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡¥ Gfarm¤Î´ÉÍý¼Ô¤¬¼Â¹Ô²Äǽ¤Ç¤¹¡¥ ÅÐÏ¿¥æ¡¼¥¶¤Î¾ðÊó¤ÎÊѹ¹¤ò¹Ô¤¤¤Þ¤¹¡¥ Êѹ¹¤·¤¿¤¤¥°¥í¡¼¥Ð¥ë¥æ¡¼¥¶Ì¾¡¤ ¼Â¥æ¡¼¥¶Ì¾¡¤Gfarm¾å¤Î¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê¡¤GSIǧ¾Ú¤Ë¤ª¤±¤ë ¥æ¡¼¥¶¾ÚÌÀ½ñ¤ÎSubject DN¤ò»ØÄꤷ¤Þ¤¹¡¥ Gfarm¤Î´ÉÍý¼Ô¤¬¼Â¹Ô²Äǽ¤Ç¤¹¡¥ ÅÐÏ¿¥æ¡¼¥¶¤Î¾ðÊó¤ò¾Ãµî¤·¤Þ¤¹¡¥ ¾Ãµî¤·¤¿¤¤¥°¥í¡¼¥Ð¥ë¥æ¡¼¥¶Ì¾¤ò»ØÄꤷ¤Þ¤¹¡¥ Gfarm¤Î´ÉÍý¼Ô¤¬¼Â¹Ô²Äǽ¤Ç¤¹¡¥ °ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡¥ SEE ALSO gfgroup1 gfarm-2.4.1/doc/docbook/ja/ref/man1/gfchown.1.docbook0000644000000000000000000000244211507222720020633 0ustar rootroot 21 Dec 2008 gfchown 1 Gfarm gfchown Gfarm ¥Õ¥¡¥¤¥ë¤Î½êÍ­¼Ô¡¤½êÍ­¥°¥ë¡¼¥×¤òÊѹ¹¤¹¤ë gfchown options owner[:group] path gfchown options :group path DESCRIPTION Gfarm ¥Õ¥¡¥¤¥ë¤Î½êÍ­¼Ô¡¤½êÍ­¥°¥ë¡¼¥×¤òÊѹ¹¤·¤Þ¤¹¡¥ OPTIONS °ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡¥ gfarm-2.4.1/doc/docbook/ja/ref/man1/gfimport_text.1.docbook0000644000000000000000000000733211507222720022076 0ustar rootroot 5 Jun 2003 gfimport_text 1 Gfarm gfimport_text ¥Æ¥­¥¹¥È¡¦¥Õ¥¡¥¤¥ë¤ò¥Õ¥é¥°¥á¥ó¥È¤Ëʬ¤±¤Æ¼è¤ê¹þ¤à gfimport_text ¥ª¥×¥·¥ç¥ó ÆþÎÏ¥Õ¥¡¥¤¥ë DESCRIPTION °ú¿ô¤Ë»ØÄꤷ¤¿¥Æ¥­¥¹¥È¡¦¥Õ¥¡¥¤¥ë¤ò¡¢°ì¹Ô¤òÊ£¿ô¤Î¥Õ¥é¥°¥á¥ó¥È¤Ëʬ³ä¤¹ ¤ë¤³¤È¤Î¤Ê¤¤¤è¤¦¤Ëʬ³ä¤·¤Æ Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë¼è¤ê¹þ¤à ¥µ¥ó¥×¥ë¡¦¥×¥í¥°¥é¥à¤Ç¤¹¡£ OPTIONS ¥Û¥¹¥È»ØÄê¥Õ¥¡¥¤¥ë ¥Õ¥é¥°¥á¥ó¥È¤òÇÛÃÖ¤¹¤ë¥Û¥¹¥È̾¤Î¥ê¥¹¥È¤òµ­ºÜ¤·¤¿¥Õ¥¡¥¤¥ë̾¤ò»ØÄꤷ¤Þ¤¹¡£ ¥Û¥¹¥È̾¤Ï¡¢³Æ¹Ô¤Ë°ì¥Û¥¹¥È¤º¤Äµ­½Ò¤·¤Þ¤¹¡£ ÆþÎÏ¥Õ¥¡¥¤¥ë¤Ï¤½¤ì¤¾¤ì¤Î¥Õ¥é¥°¥á¥ó¥È¥µ¥¤¥º¤¬¤Û¤Ü¶ÑÅù¤È¤Ê¤ë¤è¤¦¤Ë ʬ³ä¤µ¤ì¤Þ¤¹¡£ ¥Õ¥¡¥¤¥ë̾¤È¤·¤Æ ``-'' ¤ò»ØÄꤷ¤¿¾ì¹ç¡¢É¸½àÆþÎϤ«¤é¥Û¥¹¥È̾¤Î¥ê¥¹¥È¤ò ÆÉ¤ß¹þ¤ß¤Þ¤¹¡£ ¥Õ¥é¥°¥á¥ó¥È¹½À®¥Õ¥¡¥¤¥ë ³Æ¥Õ¥é¥°¥á¥ó¥È¤Î¤ª¤ª¤è¤½¤Î¥µ¥¤¥º¤È¡¢ÇÛÃÖ¤¹¤ë¥Û¥¹¥È¤òµ­ºÜ¤·¤¿¥Õ¥¡¥¤ ¥ë̾¤ò»ØÄꤷ¤Þ¤¹¡£ ¹½À®¥Õ¥¡¥¤¥ë¤Ï¡¢³Æ¹Ô¤¬¡¢¶õÇò¤Ç¶èÀÚ¤é¤ì¤¿¥µ¥¤¥º¤È¥Û¥¹¥È̾¤«¤é¤Ê¤ë·Á¼°¤Ç¤¹¡£ ¥Õ¥¡¥¤¥ë̾¤È¤·¤Æ ``-'' ¤ò»ØÄꤷ¤¿¾ì¹ç¡¢É¸½àÆþÎϤ«¤é¥Õ¥é¥°¥á¥ó¥È¹½À®¤ò ÆÉ¤ß¹þ¤ß¤Þ¤¹¡£ gfarm-URL ½ÐÎÏ Gfarm ¥Õ¥¡¥¤¥ë¤Î URL ¤ò»ØÄꤷ¤Þ¤¹¡£ °ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡£ EXAMPLES »ØÄꤷ¤¿¸Ä¿ô¤Ëʬ³ä¤·¤Æ¼è¤ê¹þ¤à °Ê²¼¤Ï¡¢¥Õ¥¡¥¤¥ë¤ò8¸Ä¤Î¥Õ¥é¥°¥á¥ó¥È¤Ëʬ³ä¤·¡¢ ¥Õ¥¡¥¤¥ë gfarm:file ¤È¤·¤Æ¼è¤ê¹þ¤àÎã¤Ç¤¹¡£ gfsched -N 8 | gfimport_text -H - -o gfarm:file source_file ½èÍý¤¹¤ë¥×¥í¥°¥é¥à¤ò»ØÄꤷ¡¢ÆÃÄê¤Î¸Ä¿ô¤Ëʬ³ä¤·¤Æ¼è¤ê¹þ¤à °Ê²¼¤Ï¡¢¥Õ¥¡¥¤¥ë¤ò8¸Ä¤Î¥Õ¥é¥°¥á¥ó¥È¤Ëʬ³ä¤·¡¢ »ØÄꤷ¤¿¥×¥í¥°¥é¥à gfarm:prog ¤ò¼Â¹Ô²Äǽ¤Ê¥Û¥¹¥È¤Ë¡¢ ¥Õ¥¡¥¤¥ë gfarm:file ¤È¤·¤Æ¼è¤ê¹þ¤àÎã¤Ç¤¹¡£ gfsched -N 8 -p gfarm:prog | gfimport_text -H - -o gfarm:file source_file ´û¸¤Î gfarm ¥Õ¥¡¥¤¥ë¤ÈƱ¤¸ÇÛÃ֤Ǽè¤ê¹þ¤à °Ê²¼¤Ï¡¢´û¸¤Î gfarm ¥Õ¥¡¥¤¥ë gfarm:template ¤È Ʊ¤¸¸Ä¿ô¤Î¥Õ¥é¥°¥á¥ó¥È¤Ëʬ³ä¤·¡¢ gfarm:template ¤¬Â¸ºß¤¹¤ë¤Î¤ÈƱ¤¸¥Û¥¹¥È¤Ë¡¢ ¥Õ¥¡¥¤¥ë gfarm:file ¤È¤·¤Æ¼è¤ê¹þ¤àÎã¤Ç¤¹¡£ gfsched gfarm:template | gfimport_text -H - -o gfarm:file source_file SEE ALSO gfimport_fixed1 , gfsched1 , gfarm.conf5 gfarm-2.4.1/doc/docbook/ja/ref/man1/gfmpirun_p4.1.docbook0000644000000000000000000000470711507222720021440 0ustar rootroot 1 May 2002 gfmpirun_p4 1 Gfarm gfmpirun_p4 mpirun ¥³¥Þ¥ó¥É¤Î Gfarm ÍÑ¥Õ¥í¥ó¥È¥¨¥ó¥É gfmpirun_p4 options ¥×¥í¥°¥é¥à̾ °ú¿ô DESCRIPTION MPIÊÂÎó¥×¥í¥°¥é¥à¤ò MPICH/p4 ¤ÇÄ󶡤µ¤ì¤ë mpirun ¤òÍøÍѤ·¤Æ¼Â¹Ô ¤·¤Þ¤¹¡¥¼Â¹Ô¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Ï¡¤-G ¥ª¥×¥·¥ç¥ó¡¤-H ¥ª¥×¥·¥ç ¥ó¤¢¤ë¤¤¤Ï -N ¥ª¥×¥·¥ç¥ó¤Ë¤è¤ê·èÄꤵ¤ì¤Þ¤¹¡¥ -G ¥ª¥×¥·¥ç¥ó¡¤-H ¥ª¥×¥·¥ç¥ó¡¤-N ¥ª¥×¥·¥ç¥ó¤ÏƱ»þ¤ËÆó¤Ä°Ê¾å»ØÄꤹ¤ë¤³ ¤È¤Ï¤Ç¤­¤Þ¤»¤ó¡¥¤Þ¤¿¡¤-G ¥ª¥×¥·¥ç¥ó¡¤-H ¥ª¥×¥·¥ç¥ó¡¤-N ¥ª¥×¥·¥ç¥ó¤¬¤¤ ¤º¤ì¤â»ØÄꤵ¤ì¤Ê¤¤¾ì¹ç¤Ï¡¤°ú¿ô¤Ë»ØÄꤵ¤ì¤¿´û¤Ë¸ºß¤¹¤ë Gfarm¥Õ¥¡¥¤¥ë¤Î ¤¦¤Á°ìÈ֤Ϥ¸¤á¤Î¥Õ¥¡¥¤¥ë¤òÍøÍѤ·¤¿¥Õ¥¡¥¤¥ë¡¦¥¢¥Õ¥£¥Ë¥Æ¥£¡¦¥¹¥±¥¸¥å¡¼¥ê ¥ó¥°¤Ë¤è¤ê·èÄꤵ¤ì¤Þ¤¹¡¥ ¥×¥í¥°¥é¥à̾¤È¤·¤Æ¤Ï¡¢gfreg ¥³¥Þ¥ó¥É¤ÇÅÐÏ¿¤·¤¿¥×¥í¥°¥é¥à¤Î gfarm-URL ¤â»ØÄê¤Ç¤­¤Þ¤¹¡£ OPTIONS gfarm-URL gfarm-URL ¤Î¥Õ¥¡¥¤¥ë¡¦¥¢¥Õ¥£¥Ë¥Æ¥£¡¦¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¤Ë¤è¤ê ÊÂÎó¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤·¤Þ¤¹¡¥ ¥Û¥¹¥È»ØÄê¥Õ¥¡¥¤¥ë ÊÂÎó¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É·²¤òµ­ºÜ¤·¤¿¥Õ¥¡¥¤¥ë̾¤ò »ØÄꤷ¤Þ¤¹¡¥ ¥Û¥¹¥È̾¤Ï¡¤³Æ¹Ô¤Ë°ì¥Û¥¹¥È¤º¤Äµ­½Ò¤·¤Þ¤¹¡¥ ¥Õ¥¡¥¤¥ë̾¤È¤·¤Æ ``-'' ¤ò»ØÄꤷ¤¿¾ì¹ç¡¤É¸½àÆþÎϤ«¤é¥Û¥¹¥È̾¤Î¥ê¥¹¥È¤ò ÆÉ¤ß¹þ¤ß¤Þ¤¹¡¥ ¥Î¡¼¥É¿ô ÊÂÎó¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Î¥Î¡¼¥É¿ô¤ò»ØÄꤷ¤Þ¤¹¡¥ ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤ÏÉé²Ù¤Î¾®¤µ¤¤¥Î¡¼¥É¤«¤é½ç¤Ë¥Î¡¼¥É¿ôʬÁª¤Ð¤ì¤Þ¤¹¡¥ BUGS ¸½¥Ð¡¼¥¸¥ç¥ó¤Ï¡¢MPICH/p4 ¤È¤ÎÁȹ礻¤Ç¤Ê¤¤¤Èưºî¤·¤Þ¤»¤ó¡£ gfarm-2.4.1/doc/docbook/ja/ref/man1/gfsetdir.1.docbook0000644000000000000000000000466011507222720021013 0ustar rootroot 2 Jul 2003 gfsetdir 1 Gfarm gfsetdir Gfarm ºî¶È¥Ç¥£¥ì¥¯¥È¥ê¤òÊѹ¹¤¹¤ë¥³¥Þ¥ó¥ÉÎó¤ò½ÐÎϤ¹¤ë¡£ gfsetdir -s -c ¥Ç¥£¥ì¥¯¥È¥ê DESCRIPTION Gfarm ºî¶È¥Ç¥£¥ì¥¯¥È¥ê¤ò »ØÄꤷ¤¿¥Ç¥£¥ì¥¯¥È¥ê¤ËÊѹ¹¤¹¤ë¥·¥§¥ë¥³ ¥Þ¥ó¥É¤òɸ½à½ÐÎϤ˽ÐÎϤ·¤Þ¤¹¡£¥Ç¥£¥ì¥¯¥È¥ê¤ò»ØÄꤷ¤Ê¤¤¾ì¹ç¤Ï¡¢¥æ¡¼¥¶¤Î Gfarm ¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤¢¤ë gfarm:/¥°¥í¡¼¥Ð¥ë¥æ¡¼¥¶ ¤ËÊѹ¹¤¹¤ë ¥³¥Þ¥ó¥É¤ò½ÐÎϤ·¤Þ¤¹¡£ ¥æ¡¼¥¶¤¬»ÈÍѤ·¤Æ¤¤¤ë¥·¥§¥ë¤ò¼«Æ°Åª¤ËȽÄꤷ¤Æ¤½¤Î¥·¥§¥ë¤¬¼Â¹Ô²Äǽ¤Ê ¥³¥Þ¥ó¥É¤ò½ÐÎϤ·¤Þ¤¹¡£ ½ÐÎÏ¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤·¤Æ Gfarm ºî¶È¥Ç¥£¥ì¥¯¥È¥ê¤òÊѹ¹¤¹¤ë gfcd ¤òÍøÍѤ¹¤ë¤¿¤á¤Ë¡¢³Æ¥æ¡¼¥¶¤Î¥·¥§¥ëÀßÄê¥Õ¥¡¥¤¥ë¤Ë°Ê²¼¤ÎÄêµÁ¤òÄɲä·¤Æ ¤¯¤À¤µ¤¤¡£ Bourne shell ·Ï¥·¥§¥ë¤Î¾ì¹ç gfcd() { eval "`gfsetdir $1`"; } csh ·Ï¥·¥§¥ë¤Î¾ì¹ç alias gfcd 'eval `gfsetdir \!*`' OPTIONS Bourne shell ·Ï¥·¥§¥ëÍѤΥ³¥Þ¥ó¥É¤ò½ÐÎϤ·¤Þ¤¹¡£ csh ·Ï¥·¥§¥ëÍѤΥ³¥Þ¥ó¥É¤ò½ÐÎϤ·¤Þ¤¹¡£ °ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡£ SEE ALSO gfcd1 , gfpwd1 gfarm-2.4.1/doc/docbook/ja/ref/man1/gfdf.1.docbook0000644000000000000000000000521311507222720020105 0ustar rootroot 30 Dec 2010 gfdf 1 Gfarm gfdf ¥Ç¥£¥¹¥¯¶õ¤­ÍÆÎ̼èÆÀ gfdf ¥ª¥×¥·¥ç¥ó DESCRIPTION gfdf ¤Ï¡¢Gfarm¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î ¥Ç¥£¥¹¥¯¶õ¤­ÍÆÎ̤òɽ¼¨¤·¤Þ¤¹¡£ OPTIONS Gfarm¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥àÁ´ÂΤΥǥ£¥¹¥¯¶õ¤­ÍÆÎ̤òɽ¼¨¤·¤Þ¤¹¡£ ¿ô»ú¤ò¡ÖM(¥á¥¬)¡×¤Î¤è¤¦¤Êñ°Ì¤Ä¤­¤ÇÆÉ¤ß¤ä¤¹¤¯É½¼¨¤·¤Þ¤¹¡£ ñ°Ì¤Ë¤Ï2¤ÎÎß¾è¤òÍѤ¤¤Þ¤¹¤Î¤Ç¡¢¡ÖM¡×¤Ï 1,048,576 ¤ò°ÕÌ£¤·¤Þ¤¹¡£ ¿ô»ú¤ò¡ÖM(¥á¥¬)¡×¤Î¤è¤¦¤Êñ°Ì¤Ä¤­¤ÇÆÉ¤ß¤ä¤¹¤¯É½¼¨¤·¤Þ¤¹¡£ ñ°Ì¤Ë¤Ï10¤ÎÎß¾è¤òÍѤ¤¤Þ¤¹¤Î¤Ç¡¢¡ÖM¡×¤Ï 1,000,000 ¤ò°ÕÌ£¤·¤Þ¤¹¡£ ÍøÍѲÄǽ¤Ê¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Î¥Û¥¹¥È̾¤òɽ¼¨¤·¤Þ¤¹¡£ µÕ½ç¤ËÀ°Î󤷤ƽÐÎϤ·¤Þ¤¹¡£ ¶õ¤­ÍÆÎ̤νç¤ËÀ°Î󤷤ƽÐÎϤ·¤Þ¤¹¡£ ¥Ñ¥¹Ì¾ »ØÄꤷ¤¿¥Ñ¥¹Ì¾¤Ë¤è¤êÆÃÄê¤Î¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤ò»ØÄꤷ¤Þ¤¹¡¥ ¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï -a ¥ª¥×¥·¥ç¥ó¤ÈƱ»þ¤ËÍøÍѤ¹¤ë¤È̵»ë¤µ¤ì¤Þ¤¹¡¥ ¥É¥á¥¤¥ó̾ »ØÄꤷ¤¿¥É¥á¥¤¥ó̾¤Ë´Þ¤Þ¤ì¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Î¾õÂÖ¤òɽ¼¨¤·¤Þ¤¹¡£ °ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡£ SEE ALSO gfhost1 , gfarm2.conf5 gfarm-2.4.1/doc/docbook/ja/ref/man1/gfrmdir.1.docbook0000644000000000000000000000215511507222720020633 0ustar rootroot 15 May 2008 gfrmdir 1 Gfarm gfrmdir Gfarm ¥Ç¥£¥ì¥¯¥È¥ê¤òºï½ü¤¹¤ë¡£ gfrmdir gfarm¥Ñ¥¹ DESCRIPTION Gfarm¥Ñ¥¹¤Ë»ØÄꤷ¤¿¥Ç¥£¥ì¥¯¥È¥ê¤òºï½ü¤·¤Þ¤¹¡£ OPTIONS °ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡£ SEE ALSO gfmkdir1 gfarm-2.4.1/doc/docbook/ja/ref/man1/gfrun.1.docbook0000644000000000000000000001461211507222720020323 0ustar rootroot 1 May 2002 gfrun 1 Gfarm gfrun gfrsh gfssh ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Ç gfarm ÊÂÎó¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤¹¤ë gfrun ¥ª¥×¥·¥ç¥ó ¥×¥í¥°¥é¥à̾ °ú¿ô gfrsh ¥ª¥×¥·¥ç¥ó ¥×¥í¥°¥é¥à̾ °ú¿ô gfssh ¥ª¥×¥·¥ç¥ó ¥×¥í¥°¥é¥à̾ °ú¿ô DESCRIPTION ÊÂÎó¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤·¤Þ¤¹¡¥¼Â¹Ô¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Ï¡¤ -G ¥ª¥×¥·¥ç¥ó¡¤-H ¥ª¥×¥·¥ç¥ó¤¢¤ë¤¤¤Ï -N ¥ª¥×¥·¥ç¥ó¤Ë¤è¤ê·èÄꤵ¤ì¤Þ¤¹¡¥ -G ¥ª¥×¥·¥ç¥ó¤Ï¥Õ¥¡¥¤¥ë¡¦¥¢¥Õ¥£¥Ë¥Æ¥£¡¦¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¤Î¤¿¤á¤Î Gfarm ¥Õ¥¡¥¤¥ë gfarm-URL ¤ò»ØÄꤷ¤Þ¤¹¡¥ ¥Õ¥¡¥¤¥ë¡¦¥¢¥Õ¥£¥Ë¥Æ¥£¡¦¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¤Ç¤Ï¡¤»ØÄꤵ¤ì¤¿ Gfarm ¥Õ¥¡¥¤¥ë¤Î¤½¤ì¤¾¤ì¤Î¥Õ¥¡¥¤¥ëÃÇÊÒ¤ËÂФ·¡¤Ê£À½¤¬³ÊǼ¤µ¤ì¤Æ¤¤¤ë ¥Î¡¼¥É¤Î¤¦¤Á°ì¥Î¡¼¥É¤¬Áª¤Ð¤ì¤Þ¤¹¡¥¤Ä¤Þ¤ê¡¤¥Õ¥¡¥¤¥ëÃÇÊҤοô¤È Ʊ¿ô¤Î¥×¥í¥»¥¹¤¬¡¤¥Õ¥¡¥¤¥ëÃÇÊÒ¤ò³ÊǼ¤·¤Æ¤¤¤ë¥Î¡¼¥É¤Ç¼Â¹Ô¤µ¤ì ¤ë¤È¤¤¤¦¤³¤È¤Ë¤Ê¤ê¤Þ¤¹¡¥ -H ¥ª¥×¥·¥ç¥ó¤Ï ¥Û¥¹¥È»ØÄê¥Õ¥¡¥¤¥ë ¤ò»ØÄꤷ¤Þ¤¹¡¥ ¤³¤Î¾ì¹ç¡¤¤½¤Î¥Õ¥¡¥¤¥ë¤Ëµ­½Ò¤µ¤ì¤¿¥Î¡¼¥É¤ÇÊÂÎó¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤·¤Þ¤¹¡¥ -N ¥ª¥×¥·¥ç¥ó¤Ï¼Â¹Ô¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Î ¥Î¡¼¥É¿ô ¤ò»ØÄꤷ¤Þ¤¹¡¥ -G ¥ª¥×¥·¥ç¥ó¡¤-H ¥ª¥×¥·¥ç¥ó¡¤-N ¥ª¥×¥·¥ç¥ó¤ÏƱ»þ¤ËÆó¤Ä°Ê¾å»ØÄꤹ¤ë¤³ ¤È¤Ï¤Ç¤­¤Þ¤»¤ó¡¥¤Þ¤¿¡¤-G ¥ª¥×¥·¥ç¥ó¡¤-H ¥ª¥×¥·¥ç¥ó¡¤-N ¥ª¥×¥·¥ç¥ó¤¬¤¤ ¤º¤ì¤â»ØÄꤵ¤ì¤Ê¤¤¾ì¹ç¤Ï¡¤°ú¿ô¤Ë»ØÄꤵ¤ì¤¿´û¤Ë¸ºß¤¹¤ë Gfarm¥Õ¥¡¥¤¥ë¤Î ¤¦¤Á°ìÈ֤Ϥ¸¤á¤Î¥Õ¥¡¥¤¥ë¤òÍøÍѤ·¤¿¥Õ¥¡¥¤¥ë¡¦¥¢¥Õ¥£¥Ë¥Æ¥£¡¦¥¹¥±¥¸¥å¡¼¥ê ¥ó¥°¤Ë¤è¤ê·èÄꤵ¤ì¤Þ¤¹¡¥°ú¿ôÃæ¤Ë´û¤Ë¸ºß¤¹¤ë Gfarm ¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Ê ¤¤¾ì¹ç¤Ï¡¤Å¬Åö¤Ê¥Î¡¼¥É¤¬1 ¥Î¡¼¥ÉÁªÂò¤µ¤ì¡¤Ã༡¼Â¹Ô¤È¤Ê¤ê¤Þ¤¹¡¥ gfrsh ¤ä gfssh ¥³¥Þ¥ó¥É¤Ï¡¤gfrcmd ¤ÎÂå¤ï¤ê¤Ë rsh¡¤ssh ¤ò ÍøÍѤ¹¤ë¤³¤È¤ò½ü¤¤¤Æ¡¤gfrun ¤ÈƱÍͤǤ¹¡¥ ¥×¥í¥°¥é¥à̾¤È¤·¤Æ¤Ï¡¤gfreg ¥³¥Þ¥ó¥É¤ÇÅÐÏ¿¤·¤¿¥×¥í¥°¥é¥à¤Î gfarm-URL ¤â»ØÄê¤Ç¤­¤Þ¤¹¡¥ OPTIONS gfarm-URL gfarm-URL ¤Î¥Õ¥¡¥¤¥ë¡¦¥¢¥Õ¥£¥Ë¥Æ¥£¡¦¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¤Ë¤è¤ê ÊÂÎó¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤·¤Þ¤¹¡¥ ¥Õ¥¡¥¤¥ë¡¦¥¢¥Õ¥£¥Ë¥Æ¥£¡¦¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¤Îưºî¤Ë¤Ä¤¤¤Æ¤Ï¡¤DESCRIPTION Àá¤ò »²¾È¤·¤Æ¤¯¤À¤µ¤¤¡¥ ¥Û¥¹¥È»ØÄê¥Õ¥¡¥¤¥ë ÊÂÎó¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É·²¤òµ­ºÜ¤·¤¿¥Õ¥¡¥¤¥ë̾¤ò »ØÄꤷ¤Þ¤¹¡¥ ¥Û¥¹¥È̾¤Ï¡¤³Æ¹Ô¤Ë°ì¥Û¥¹¥È¤º¤Äµ­½Ò¤·¤Þ¤¹¡¥ ¥Õ¥¡¥¤¥ë̾¤È¤·¤Æ ``-'' ¤ò»ØÄꤷ¤¿¾ì¹ç¡¤É¸½àÆþÎϤ«¤é¥Û¥¹¥È̾¤Î¥ê¥¹¥È¤ò ÆÉ¤ß¹þ¤ß¤Þ¤¹¡¥ ¥Î¡¼¥É¿ô ÊÂÎó¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Î¥Î¡¼¥É¿ô¤ò»ØÄꤷ¤Þ¤¹¡¥ ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤ÏÉé²Ù¤Î¾®¤µ¤¤¥Î¡¼¥É¤«¤é½ç¤Ë¥Î¡¼¥É¿ôʬÁª¤Ð¤ì¤Þ¤¹¡¥ ¥Õ¥¡¥¤¥ë¤ò±ó³Ö»²¾È¤¹¤ë¾ì¹ç¡¤»²¾È¤ËÀèΩ¤Á¼«¥Û¥¹¥È¤Ë¥Õ¥¡¥¤¥ëÊ£À½¤ò ºîÀ®¤·¤Þ¤¹¡¥ gfarm-URL ¼Â¹Ô¤µ¤ì¤ëÊÂÎó¥×¥í¥°¥é¥à¤Îɸ½à½ÐÎϤò gfarm-URL ¤Ë½ñ¤­½Ð¤·¤Þ¤¹¡¥ gfarm-URL ¼Â¹Ô¤µ¤ì¤ëÊÂÎó¥×¥í¥°¥é¥à¤Îɸ½à¥¨¥é¡¼½ÐÎϤò gfarm-URL ¤Ë½ñ¤­½Ð¤·¤Þ¤¹¡¥ ¥Õ¥é¥°¥á¥ó¥ÈÈÖ¹æ »ØÄꤵ¤ì¤¿¥Õ¥é¥°¥á¥ó¥ÈÈÖ¹æ¤Î¥×¥í¥»¥¹¤À¤±¤¬¼Â¹Ô¤µ¤ì¤Þ¤¹¡¥ ¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¤ ¥ª¥×¥·¥ç¥ó¤¢¤ë¤¤¤Ï°ú¿ô¤ËÍ¿¤¨¤¿ Gfarm ¥Õ¥¡¥¤¥ë¤Ë¤è¤Ã¤Æ¡¤¥Õ¥¡¥¤¥ë¡¦¥¢¥Õ¥£¥Ë¥Æ¥£¡¦¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¤¬ÁªÂò¤µ¤ì¤Æ¤¤¤ë ¾ì¹ç¡¤¤ª¤è¤Ó ¥ª¥×¥·¥ç¥ó¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Î¤ßÍø ÍѲÄǽ¤Ç¤¹¡¥ ¾ÜºÙ¤Ë¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤òɽ¼¨¤·¤Þ¤¹¡¥ ¥×¥í¥°¥é¥à¼Â¹Ô¸å¤Ë Gfarm ÊÂÎóI/O API¤Î½êÍ×»þ´Ö¤òɽ¼¨¤·¤Þ¤¹¡¥ ¼Â¹Ô¤µ¤ì¤ë¥×¥í¥°¥é¥à¤ò gfarm ²½¤µ¤ì¤¿¥×¥í¥°¥é¥à¤À¤ÈÌÀ¼¨Åª¤Ë»ØÄꤷ¤Þ¤¹¡¥ ¤³¤Î·ë²Ì¡¤¥×¥í¥°¥é¥à¤Ë¤Ï Gfarm ÆÃÍ­¤Î¥ª¥×¥·¥ç¥ó¤¬ÅϤµ¤ì¤Þ¤¹¡¥ ¼Â¹Ô¤µ¤ì¤ë¥×¥í¥°¥é¥à¤òÄ̾ï¤Î¥×¥í¥°¥é¥à¤Ç¤¢¤ë¤ÈÌÀ¼¨Åª¤Ë»ØÄꤷ¤Þ¤¹¡¥ ¤³¤Î¾ì¹ç¡¤¥×¥í¥°¥é¥à¤Ë Gfarm ÆÃÍ­¤Î¥ª¥×¥·¥ç¥ó¤¬ÅϤµ¤ì¤ë¤³¤È¤Ï¤¢¤ê¤Þ¤»¤ó¡¥ Gfarm ¥·¥¹¥Æ¥à¥³¡¼¥ë¡¦¥Õ¥Ã¥¯¡¦¥é¥¤¥Ö¥é¥ê¤òÍøÍѤ·¤Æ¼Â¹Ô¤µ¤ì¤ë¥×¥í¥°¥é¥à¤Ë¤ª¤¤¤Æ¡¤ ¥Ç¥Õ¥©¥ë¥È¤Î¥Õ¥¡¥¤¥ë¡¦¥Ó¥å¡¼¤ò¥°¥í¡¼¥Ð¥ë¡¦¥Õ¥¡¥¤¥ë¡¦¥Ó¥å¡¼¤ËÀßÄꤷ¤Þ¤¹¡¥ ¤³¤Î¥ª¥×¥·¥ç¥ó¤ò¤Ä¤±¤Ê¤¤¤È¡¤ ¥Ç¥Õ¥©¥ë¥È¤Î¥Õ¥¡¥¤¥ë¡¦¥Ó¥å¡¼¤Ï¥í¡¼¥«¥ë¡¦¥Õ¥¡¥¤¥ë¡¦¥Ó¥å¡¼¤È¤Ê¤ê¤Þ¤¹¡¥ °ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡¥ ENVIROMNENT VARIABLES GFRUN_CMD ±ó³Öµ¯Æ°¥³¥Þ¥ó¥É¤ò»ØÄꤷ¤Þ¤¹¡¥Î㤨¤Ð globus-job-run ¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¤ gfrun ¤Ï globus-job-run ¤ò»È¤Ã¤Æ¤½¤ì¤¾¤ì¤Î¥×¥í¥»¥¹¤òµ¯Æ°¤·¤Þ¤¹¡¥ gfarm-2.4.1/doc/docbook/ja/ref/man1/gfmv.1.docbook0000644000000000000000000000205111507222720020133 0ustar rootroot 21 Dec 2008 gfmv 1 Gfarm gfmv Gfarm ¥Õ¥¡¥¤¥ë¤ò̾¾ÎÊѹ¹¡¤°Üư¤¹¤ë gfmv options src dest DESCRIPTION Gfarm ¥Õ¥¡¥¤¥ë¤òsrc¤«¤é dest¤Ë̾¾ÎÊѹ¹¤¢¤ë¤¤¤Ï°Üư¤·¤Þ¤¹¡¥ OPTIONS °ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡¥ gfarm-2.4.1/doc/docbook/ja/ref/man1/gfarm_agent.1.docbook0000644000000000000000000000714611507222720021460 0ustar rootroot 7 Nov 2006 gfarm_agent 1 Gfarm gfarm_agent Gfarm ¥á¥¿¥Ç¡¼¥¿¥­¥ã¥Ã¥·¥å¥µ¡¼¥Ð gfarm_agent ¥ª¥×¥·¥ç¥ó DESCRIPTION gfarm_agent ¤Ï¡¢ Ê£¿ô¥Î¡¼¥É¡¢Ê£¿ô¥æ¡¼¥¶¤Ç¶¦Í­²Äǽ¤Ê Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¡¦¥á¥¿¥Ç¡¼¥¿¤Î¥­¥ã¥Ã¥·¥å¥µ¡¼¥Ð¤Ç¤¹¡£ ¥­¥ã¥Ã¥·¥å¥µ¡¼¥Ð¤Ë¤è¤ê¡¢ ±ó³Ö¤Î¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤ËÂФ¹¤ë̵Â̤ʥͥåȥ¥¯Å¾Á÷¤¬ÍÞÀ©¤µ¤ì¡¢ Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ËÂФ¹¤ë¥ì¥¹¥Ý¥ó¥¹¤òÂçÉý¤Ë²þÁ±¤·¤Þ¤¹¡£ gfarm_agent ¤Ï¡¢ Ʊ»þ¤ËÊ£¿ô¤Î¥Î¡¼¥É¤Ç¼Â¹Ô¤¹¤ë¤³¤È¤¬²Äǽ¤Ç¤¹¡£ ¤½¤Î¾ì¹ç¡¢Ê£¿ô¤Î gfarm_agent ¤ª¤è¤Ó Gfarm ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð´Ö¤Î°ì´ÓÀ­¤ÏÊݾڤµ¤ì¤Þ¤¹¡£ OPTIONS ¥í¥°¥ì¥Ù¥ë ¤³¤Î¥ª¥×¥·¥ç¥ó¤Ç»ØÄꤷ¤¿¥ì¥Ù¥ë°Ê¾å¤ÎÍ¥ÀèÅÙ¤Î¥í¥°¤ò½ÐÎϤ·¤Þ¤¹¡£ »ØÄê¤Ç¤­¤ëÃÍ¤Ï gfarm.conf(5) ¤Î log_level ¤Î¹à¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£ PID¥Õ¥¡¥¤¥ë gfarm_agent ¤Î process ID ¤ò¡¢ »ØÄꤷ¤¿¥Õ¥¡¥¤¥ë¤Ëµ­Ï¿¤·¤Þ¤¹¡£ syslog¥Õ¥¡¥·¥ê¥Æ¥£ gfarm_agent ¤¬¥¨¥é¡¼Êó¹ð¤ËÍѤ¤¤ë syslog ¤Î¥Õ¥¡¥·¥ê¥Æ¥£¤ò»ØÄꤷ¤Þ¤¹¡£ ¾Êά¤·¤¿¾ì¹ç¤Ë¤Ï¡¢local0 ¤ò»ÈÍѤ·¤Þ¤¹¡£ ¥Ç¥Ð¥Ã¥°¥ª¥×¥·¥ç¥ó¤Ç¤¹¡£¥Ç¡¼¥â¥ó¤È¤·¤Æ¤Ç¤Ï¤Ê¤¯¡¢¥Õ¥©¥¢¥°¥é¥¦¥ó¥É¡¦ ¥×¥í¥»¥¹¤È¤·¤ÆÎ©¤Á¾å¤¬¤ê¤Þ¤¹¡£ ¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¡¢¤«¤Ä ¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Ê¤«¤Ã¤¿ ¾ì¹ç¡¢¥í¥°¥ì¥Ù¥ë¤Ï debug ¤È¤Ê¤ê¤Þ¤¹¡£ ÀßÄê¥Õ¥¡¥¤¥ë µ¯Æ°»þ¤ËÆÉ¤ß¹þ¤àÀßÄê¥Õ¥¡¥¤¥ë¤ò»ØÄꤷ¤Þ¤¹¡£ ñ°ì¤Î gfarm_agent ¤òÍøÍѤ¹¤ë¾ì¹ç¤ËÍøÍѲÄǽ¤Ç¤¹¡£ ¤³¤Î¥ª¥×¥·¥ç¥ó¤òÍøÍѤ¹¤ë¤È¥Ñ¥¹¾ðÊó¤â¥­¥ã¥Ã¥·¥å¤¹¤ë¤è¤¦¤Ë¤Ê¤ë¤¿¤á¡¢ ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤Ø¤Î¥¢¥¯¥»¥¹¿ô¤¬¸º¤ê¡¢¹â®¤Ë¤Ê¤ê¤Þ¤¹¡£ ¥Ý¡¼¥ÈÈÖ¹æ gfarm_agent ¤¬ÍøÍѤ¹¤ë TCP ¤Î¥Ý¡¼¥ÈÈÖ¹æ¤ò»ØÄꤷ¤Þ¤¹¡£ ǧ¾Ú»þ¤Î¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤Î¾ÜºÙ¤òɽ¼¨¤·¤Þ¤¹¡£ °ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡£ FILES %%SYSCONFDIR%%/gfarm.conf gfarm_agent ¤¬»²¾È¤¹¤ëÀßÄê¥Õ¥¡¥¤¥ë¤Ç¤¹¡£ SEE ALSO gfarm.conf5 gfarm-2.4.1/doc/docbook/ja/ref/man1/gfkey.1.docbook0000644000000000000000000000543311507222720020310 0ustar rootroot 25 Feb 2010 gfkey 1 Gfarm gfkey Gfarm ¥»¥Ã¥·¥ç¥ó¡¦¥­¡¼´ÉÍý¥³¥Þ¥ó¥É gfkey ¥ª¥×¥·¥ç¥ó DESCRIPTION ¿®Íꤵ¤ì¤¿´Ä¶­¤Ç gfsd¡¢gfmd ¤ò¶¦Í­ÈëÌ©¸°Ç§¾Ú¤Ç¥¢¥¯¥»¥¹¤¹¤ë¤Î¤Ë ɬÍפʥ»¥Ã¥·¥ç¥ó¡¦¥­¡¼¡¦¥Õ¥¡¥¤¥ë ¤ò°·¤¦¥³¥Þ¥ó¥É¤Ç¤¹¡£ ¥Û¡¼¥à¡¦¥Ç¥£¥ì¥¯¥È¥ê¤ò¶¦Í­¤·¤Æ¤¤¤ë´Ä¶­¤Ç¤Ï¡¢¤³¤Î¥³¥Þ¥ó¥É¤ò»È¤¦É¬Í×À­ ¤Ï¤¢¤Þ¤ê¤¢¤ê¤Þ¤»¤ó¤¬¡¢¤½¤¦¤Ç¤Ê¤¤´Ä¶­¤Ç¤Ï¡¢¤³¤Î¥³¥Þ¥ó¥É¤Ç¥­¡¼¤òÀ¸À®¤· ¤¿¸å¡¢Á´¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Ë¥­¡¼¤òÇÛÉÕ¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£ OPTIONS ¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»ØÄꤹ¤ë¤È¡¢Í­¸ú¤Ê¥»¥Ã¥·¥ç¥ó¡¦¥­¡¼¤¬¤Ê¤¤¾ì¹ç¤Ë¡¢¥»¥Ã ¥·¥ç¥ó¡¦¥­¡¼¡¦¥Õ¥¡¥¤¥ë¤òºîÀ®¤·¤Þ¤¹¡£´û¤ËÍ­¸ú¤Ê¥»¥Ã¥·¥ç¥ó¡¦¥­¡¼¤¬Â¸ ºß¤¹¤ë¾ì¹ç¤Ë¤Ï²¿¤â¤·¤Þ¤»¤ó¡£ ¶¯À©Åª¤Ë¥»¥Ã¥·¥ç¥ó¡¦¥­¡¼¤òºîÀ®¤·¤Þ¤¹¡£ ´û¤ËÍ­¸ú¤Ê¥»¥Ã¥·¥ç¥ó¡¦¥­¡¼¤¬Â¸ºß¤¹¤ë¾ì¹ç¤Ç¤â¡¢¤½¤Î¥­¡¼¤ò¼Î¤Æ¤Æ¿·¤¿ ¤Ë¥­¡¼¤òºîÀ®¤·¤Þ¤¹¡£ period ¥»¥Ã¥·¥ç¥ó¡¦¥­¡¼¤ÎÍ­¸ú´ü¸Â¤ò»ØÄꤷ¤Þ¤¹¡£Ã±°Ì¤ÏÉäǤ¹¡£ ¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï -c ¥ª¥×¥·¥ç¥ó¤¢¤ë¤¤¤Ï -f ¥ª¥×¥·¥ç¥ó¤ÈƱ»þ¤Ë»ØÄꤹ¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£ ¸½ºß¤Î¥­¡¼¤òɽ¼¨¤·¤Þ¤¹¡£ ¸½ºß¤Î¥­¡¼¤Î´ü¸Â¤¬ÀÚ¤ì¤ë»þ¹ï¤òɽ¼¨¤·¤Þ¤¹¡£ message-priority-level ¤³¤Î¥ª¥×¥·¥ç¥ó¤Ç»ØÄꤷ¤¿¥ì¥Ù¥ë°Ê¾å¤ÎÍ¥ÀèÅ٤Υá¥Ã¥»¡¼¥¸¤ò½ÐÎϤ·¤Þ¤¹¡£ ¥Ç¥Õ¥©¥ë¥È¤Ïinfo¤Ç¤¹¡£ »ØÄê¤Ç¤­¤ëÃͤÏgfarm2.conf(5)¤Îlog_level¤Î¹à¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£ °ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡£ FILES $HOME/.gfarm_shared_key ¥»¥Ã¥·¥ç¥ó¡¦¥­¡¼¡¦¥Õ¥¡¥¤¥ë¤Ç¤¹¡£ gfarm-2.4.1/doc/docbook/ja/ref/man1/gfps.1.docbook0000644000000000000000000000272011507222720020136 0ustar rootroot 11 Oct 2005 gfps 1 Gfarm gfps ¸½ºß¼Â¹ÔÃæ¤Î¥¸¥ç¥Ö¤òɽ¼¨¤¹¤ë¡£ gfps ¥ª¥×¥·¥ç¥ó ¥¸¥ç¥ÖID DESCRIPTION °ú¿ô¤Ë»ØÄꤷ¤¿¥¸¥ç¥ÖID¤Ë´Ø¤¹¤ë¾ðÊó¤òɽ¼¨¤·¤Þ¤¹¡£ °ú¿ô¤ò¾Êά¤·¤¿¾ì¹ç¤Ë¤Ï¡¢¼«¥æ¡¼¥¶¡¼¸¢¸Â¤Ç¼Â¹ÔÃæ¤Î¥¸¥ç¥ÖÁ´¤Æ¤òɽ¼¨¤·¤Þ ¤¹¡£ OPTIONS Á´¤Æ¤Î¥æ¡¼¥¶¡¼¤Î¥¸¥ç¥Ö¤òɽ¼¨¤·¤Þ¤¹¡£ ¤è¤ê¾ÜºÙ¤Ê¾ðÊó¤òɽ¼¨¤·¤Þ¤¹¡£ ¾ÜºÙ¤Ë¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤òɽ¼¨¤·¤Þ¤¹¡¥ °ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡£ gfarm-2.4.1/doc/docbook/ja/ref/man1/gffindxmlattr.1.docbook0000644000000000000000000000472611507222720022060 0ustar rootroot 18 Aug 2008 gffindxmlattr 1 Gfarm gffindxmlattr ¥Õ¥¡¥¤¥ë¤ÎXML³Èĥ°À­¤òXPath¤Ë¤è¤ê¸¡º÷¤¹¤ë gffindxmlattr -d depth -F delim XPath -f XPath-file path DESCRIPTION »ØÄꤵ¤ì¤¿XPath¼°¤Ë°ìÃפ¹¤ëXML³Èĥ°À­¤ò¸¡º÷¤·¡¤ °ìÃפ·¤¿¥Ñ¥¹Ì¾¤ÈXML³Èĥ°À­Ì¾¤òɽ¼¨¤·¤Þ¤¹¡¥ »ØÄꤵ¤ì¤¿path¤¬¥Õ¥¡¥¤¥ë¤Î¾ì¹ç¡¤¤½¤Î¥Õ¥¡¥¤¥ë¤ÎXML³Èĥ°À­¤ò¸¡º÷¤·¤Þ¤¹¡¥ ÆÉ¤ß¹þ¤ß¸¢¸Â¤Î¤Ê¤¤¥Õ¥¡¥¤¥ë¤Ï̵»ë¤µ¤ì¤Þ¤¹¡¥ »ØÄꤵ¤ì¤¿path¤¬¥Ç¥£¥ì¥¯¥È¥ê¤Î¾ì¹ç¡¤depth¤Ç»ØÄꤵ¤ì¤¿¿¼¤µ¤Þ¤ÇºÆµ¢Åª¤Ë¸¡º÷¤·¤Þ¤¹¡¥ 0¤Î¾ì¹ç¡¤»ØÄꤵ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¤ò¸¡º÷¤·¤Þ¤¹¡¥ depth¤¬»ØÄꤵ¤ì¤Ê¤¤¾ì¹ç¡¤ÌµÀ©¸Â¤Ë¸¡º÷¤·¤Þ¤¹¡¥ Éé¤ÎÃͤ¬»ØÄꤵ¤ì¤¿¾ì¹ç¤Ï¥¨¥é¡¼¤È¤Ê¤ê¤Þ¤¹¡¥ ¤Þ¤¿¡¤¼Â¹Ô¸¢¸Â¤Î¤Ê¤¤¥Ç¥£¥ì¥¯¥È¥ê¤Ï¸¡º÷¤µ¤ì¤Þ¤»¤ó¡¥ ½ÐÎÏ·ë²Ì¤Ï¡¤°ìÃפ·¤¿¥Ñ¥¹Ì¾¤ÈXML°À­Ì¾¤¬¶èÀÚ¤êʸ»údelim¤Ç¶èÀڤäÆÉ½¼¨¤µ¤ì¤Þ¤¹¡¥ OPTIONS depth depth¤Ç»ØÄꤵ¤ì¤¿¿¼¤µ¤Þ¤ÇºÆµ¢Åª¤Ë¸¡º÷¤·¤Þ¤¹¡¥ delim °ìÃפ·¤¿¥Ñ¥¹Ì¾¤ÈXML³Èĥ°À­Ì¾¤Î¶èÀÚ¤êʸ»ú¤ò»ØÄꤷ¤Þ¤¹¡¥ -F¥ª¥×¥·¥ç¥ó¤¬»ØÄꤵ¤ì¤Ê¤¤¾ì¹ç¤Ï¥¿¥Ö¤È¤Ê¤ê¤Þ¤¹¡¥ XPath-file ¸¡º÷¤¹¤ëXPath¼°¤òÆÉ¤ß¹þ¤à¥Õ¥¡¥¤¥ë¤ò»ØÄꤷ¤Þ¤¹¡¥ °ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡¥ SEE ALSO gfxattr1 gfarm-2.4.1/doc/docbook/ja/ref/man1/gfrcmd.1.docbook0000644000000000000000000000675611507222720020456 0ustar rootroot 1 May 2002 gfrcmd 1 Gfarm gfrcmd(1) Gfarm ·×»»¥×¡¼¥ë¤Î¥Û¥¹¥È¤Ç¡¢¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤¹¤ë¡£ gfrcmd ¥Û¥¹¥È̾ ¥³¥Þ¥ó¥É DESCRIPTION Âè°ì°ú¿ô¤Ë»ØÄꤷ¤¿·×»»¥×¡¼¥ë¤Î¥Û¥¹¥È¤Ç¡¢ÂèÆó°ú¿ô°Ê¹ß¤Î¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤·¤Þ¤¹¡£ UNIX ɸ½à¤Î rsh ¤Ë»÷¤¿µ¡Ç½¤ò»ý¤Á¤Þ¤¹¤¬¡¢²¼µ­¤ÎÅÀ¤¬°Û¤Ê¤ê¤Þ¤¹¡£ ¥µ¡¼¥Ð¡¼¤Ï¡¢inetd ¤«¤éµ¯Æ°¤¹¤ë¤Î¤Ç¤Ï¤Ê¤¯¡¢gfsd ¤ËÁȤ߹þ¤Þ¤ì¤Æ¤¤¤ë¡£ gfarm ¤Îǧ¾Úµ¡¹½¤òÍѤ¤¤ë¡£rsh ¤Î¤è¤¦¤ËTCP¤ÎÆÃ¸¢¥Ý¡¼¥È¤òǧ¾Ú¤Ë ÍѤ¤¤ë¤³¤È¤Ï¤Ê¤¤¤Î¤Ç¡¢Æ±»þ¼Â¹Ô²Äǽ¤Ê¥³¥Þ¥ó¥É¿ô¤¬¡¢ÆÃ¸¢¥Ý¡¼¥È¤Î¿ô¤Ë À©Ì󤵤ì¤Ê¤¤¡£ rsh ¤È°Û¤Ê¤ê¡£Ã±°ì¤ÎTCP¥³¥Í¥¯¥·¥ç¥ó¾å¤Çưºî¤¹¤ë¤Î¤Ç¡¢Æ±»þ¤Ë ¿¿ôµ¯Æ°¤·¤¿¾ì¹ç¤Î¡¢¥«¡¼¥Í¥ë¤Ø¤ÎÉé²Ù¤¬¼ã´³·Ú¤¤¡£ ´Ä¶­ÊÑ¿ôDISPLAY¤òÅÁ¤¨¤ë¤³¤È¤¬¤Ç¤­¤ë¡£¤Þ¤¿¡¢¤³¤Î»þ X Window System ¤Îǧ¾Ú¾ðÊó¤âÅϤ¹¤³¤È¤¬½ÐÍè¤ë¡£ ±ó³Ö¥Û¥¹¥È¤Ë¤ª¤±¤ë¥«¥ì¥ó¥È¡¦¥Ç¥£¥ì¥¯¥È¥ê¤Ï¡¢NFS¤Ç¶¦Í­¤µ¤ì¤Æ¤¤ ¤ë¤³¤È¤Î¿¤¤¥Û¡¼¥à¡¦¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ï¤Ê¤¯¡¢gfarm¤Î¥¹¥×¡¼¥ë¡¦¥Ç¥£¥ì ¥¯¥È¥ê¤Ë¤Ê¤ë¤Î¤Ç¡¢¥Ç¥Ð¥Ã¥°»þ¤Ë¡¢¥Û¥¹¥ÈËè¤Ëcore¥Õ¥¡¥¤¥ë¤ò»Ä¤¹¤³¤È¤¬ ÍÆ°×¡£ gfarm¥é¥¤¥Ö¥é¥ê¤È¶¨Ä´¤·¤Æ¡¢¥³¥Þ¥ó¥É¤¬Ã×̿Ū¤Ê¥·¥°¥Ê¥ë¤òȯÀ¸¤µ ¤»¤¿¾ì¹ç¤Ë¥Ç¥Ð¥Ã¥¬¤ò¸Æ¤Ó½Ð¤¹µ¡Ç½¤òÈ÷¤¨¤ë¡£ OPTIONS ¥æ¡¼¥¶¡¼Ì¾ ±ó³Ö¥Û¥¹¥È¤Ç¤Î¥æ¡¼¥¶¡¼Ì¾¤ò»ØÄꤷ¤Þ¤¹¡£ ɸ½àÆþÎÏ¤ÎÆâÍÆ¤ò¡¢±ó³Ö¥Û¥¹¥È¤ËÁ÷¤é¤Ê¤¯¤·¤Þ¤¹¡£ ±ó³Ö¥Û¥¹¥È¤Î¥í¥°¥¤¥ó¥·¥§¥ë¤òÍøÍѤ·¤Ê¤¤¤Ç¡¤ »ØÄꤵ¤ì¤¿¥³¥Þ¥ó¥É¤òľÀܼ¹Ԥ·¤Þ¤¹¡£ ´Ä¶­ÊÑ¿ôDISPLAY¤ò±ó³Ö¥Û¥¹¥È¤ËÅÁ¤¨¤Þ¤¹¡£ ´Ä¶­ÊÑ¿ô X Window System ¤Îǧ¾Ú¾ðÊó¤ò¡¢±ó³Ö¥Û¥¹¥È¤ËÅÁ¤¨¤Þ¤¹¡£ ¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê¤ò¶¦Í­¤·¤Æ¤¤¤Ê¤¤¤è¤¦¤Ê¾ì¹ç¤ËÍ­ÍѤǤ¹¡£ ¾ÜºÙ¤Ë¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤òɽ¼¨¤·¤Þ¤¹¡¥ °ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡£ ENVIRONMENT GFARM_DEBUG_MODE ¤³¤Î´Ä¶­ÊÑ¿ô¤ËÃÍ gdb ¤òÀßÄꤹ¤ë¤È¡¢±ó³Ö¥Û¥¹¥È¤Î¥³¥Þ¥ó¥É¤¬ ¥·¥°¥Ê¥ë¤Ç½ªÎ»¤¹¤ëºÝ¤Ë¡¢xterm ¤ª¤è¤Ó ¤½¤Î¾å¤Çưºî¤¹¤ë GNU debugger gdb ¤ò¡¢¥³¥Þ¥ó¥É¤Ë´ØÏ¢¤Å¤±¤¿¾õÂ֤ǡ¢µ¯Æ°¤·¤Þ¤¹¡£ ¤³¤Îµ¡Ç½¤òÍøÍѤ¹¤ë¤Ë¤Ï¡¢X Window System ²¼¤Ç gfrcmd ¤òÍøÍѤ¹¤ëɬÍ× ¤¬¤¢¤ê¤Þ¤¹¡£ BUGS -l ¥ª¥×¥·¥ç¥ó¤Ï¤Þ¤À¼ÂÁõ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£ gfarm-2.4.1/doc/docbook/ja/ref/man1/gfxattr.1.docbook0000644000000000000000000000741011507222720020657 0ustar rootroot 18 Aug 2008 gfxattr 1 Gfarm gfxattr Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥Õ¥¡¥¤¥ë¤Î³Èĥ°À­¤òÁàºî¤¹¤ë gfxattr -s -g -l -r -x -c -m -f xattrfile file xattrname DESCRIPTION »ØÄꤷ¤¿¥Õ¥¡¥¤¥ë¤Î³Èĥ°À­¤ª¤è¤ÓXML³Èĥ°À­¤òÁàºî¤·¤Þ¤¹¡¥ ³Èĥ°À­¤Ï°À­Ì¾¤È°À­Ãͤ«¤é¤Ê¤ê¡¤¤¤¤º¤ì¤âǤ°Õ¤Îʸ»úÎó¤Ç¤¹¡¥ XML³Èĥ°À­¤Ï°À­Ãͤ¬XML·¿¤Ç¤¢¤ë³Èĥ°À­¤Ç¤¹¡¥ XML³Èĥ°À­¤ÏÄ̾ï¤Î³Èĥ°À­¤È¤ÏÆÈΩ¤Ë°·¤ï¤ì¤ë¤¿¤á¡¤ Ʊ°ì¤Î°À­Ì¾¤¬ÍøÍѲÄǽ¤Ç¤¹¡¥ XML³Èĥ°À­¤òÁàºî¤¹¤ë¾ì¹ç¡¤-x¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Þ¤¹¡¥ XML³Èĥ°À­¤Ïgffindxmlattr¥³¥Þ¥ó¥É¤òÍøÍѤ¹¤ë¤³¤È¤Ë¤è¤ê XPath¸¡º÷¤ÎÂоݤȤʤê¤Þ¤¹¡¥ ³Èĥ°À­¤ÏGfarm¤ÎÁ´¤Æ¤Î¥Õ¥¡¥¤¥ë¡¤¥Ç¥£¥ì¥¯¥È¥ê¤ËÀßÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡¥ ¥Õ¥¡¥¤¥ë¤òºï½ü¤¹¤ë¤È¡¤¤½¤Î¥Õ¥¡¥¤¥ë¤ËÀßÄꤵ¤ì¤Æ¤¤¤¿³Èĥ°À­¤âÁ´¤Æºï½ü¤µ¤ì¤Þ¤¹¡¥ -s¡¤-g¡¤-l¡¤-r¥ª¥×¥·¥ç¥ó¤Ïɬ¤º²¿¤ì¤«¤¬»ØÄꤵ¤ì¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡¥ OPTIONS »ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤Ë°À­Ì¾xattrname¤Î³Èĥ°À­¤òÀßÄꤷ¤Þ¤¹¡¥ °À­ÃͤÏ-f¥ª¥×¥·¥ç¥ó¤Ç»ØÄꤵ¤ì¤¿xattrfile¤ÎÆâÍÆ¤È¤Ê¤ê¤Þ¤¹¡¥ -f¥ª¥×¥·¥ç¥ó¤¬»ØÄꤵ¤ì¤Ê¤¤¾ì¹ç¤Ïɸ½àÆþÎϤ«¤é¤ÎÆþÎÏÆâÍÆ¤È¤Ê¤ê¤Þ¤¹¡¥ -c¡¤-m¥ª¥×¥·¥ç¥ó¤¬»ØÄꤵ¤ì¤Ê¤¤¾ì¹ç¡¤ ¤¹¤Ç¤Ë³Èĥ°À­¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Æ¤â¾å½ñ¤­¤µ¤ì¤Þ¤¹¡¥ »ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤Î°À­Ì¾xattrname¤Î³Èĥ°À­¤òɽ¼¨¤·¤Þ¤¹¡¥ »ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤Î°À­Ì¾¤Î°ìÍ÷¤òɽ¼¨¤·¤Þ¤¹¡¥ »ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤Î°À­Ì¾xattrname¤Î³Èĥ°À­¤ò¾Ãµî¤·¤Þ¤¹¡¥ XML³Èĥ°À­¤ò½èÍý¤·¤Þ¤¹¡¥ -s¥ª¥×¥·¥ç¥ó¤È¶¦¤ËÍѤ¤¤é¤ì¡¤³Èĥ°À­¤ò¿·µ¬¤ËÀßÄꤷ¤Þ¤¹¡¥ ¤³¤Î¤È¤­´û¤Ë³Èĥ°À­¤¬ÀßÄêºÑ¤ß¤Ç¤¢¤ì¤Ð¥¨¥é¡¼¤È¤Ê¤ê¤Þ¤¹¡¥ -s¥ª¥×¥·¥ç¥ó¤È¶¦¤ËÍѤ¤¤é¤ì¡¤³Èĥ°À­¤ÎÊѹ¹¤ò¹Ô¤¤¤Þ¤¹¡¥ ¤³¤Î¤È¤­³Èĥ°À­¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¥¨¥é¡¼¤È¤Ê¤ê¤Þ¤¹¡¥ xattrfile -s¥ª¥×¥·¥ç¥ó¤È¶¦¤ËÍѤ¤¤ë¤È¡¤»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤«¤é³Èĥ°À­¤òÆÉ¹þ¤ß¤Þ¤¹¡¥ -g¥ª¥×¥·¥ç¥ó¤È¶¦¤ËÍѤ¤¤ë¤È¡¤»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤Ë³Èĥ°À­¤ò½ñ¹þ¤ß¤Þ¤¹¡¥ °ú¿ô¥ª¥×¥·¥ç¥ó¤òɽ¼¨¤·¤Þ¤¹¡¥ SEE ALSO gffindxmlattr1 gfarm-2.4.1/doc/xattr-install.ja0000644000000000000000000000167511507222722015210 0ustar rootroot XML ³Èĥ°À­ Gfarm ¤Ç¤ÏÄ̾ï¤Î³Èĥ°À­¤Ë²Ã¤¨¡¤³Èĥ°À­¤ÎÃͤȤ·¤Æ XML ¥Ç¡¼¥¿¤ò³ÊǼ¤¹ ¤ë XML ³Èĥ°À­¤¬ÍøÍѲÄǽ¤Ç¤¹¡¥XML ³Èĥ°À­¤Ë¤Ä¤¤¤Æ¤Ï¡¤XPath ¤Ë¤è¤ë¥Õ¥¡ ¥¤¥ë¸¡º÷¤¬²Äǽ¤Ç¤¹¡¥ *** ½àÈ÷ XML ³Èĥ°À­¤òÍøÍѤ¹¤ë¤¿¤á¤Ë¤Ï¡¤¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤Î¥Ð¥Ã¥¯¥¨¥ó¥É¥Ç¡¼¥¿¥Ù¡¼ ¥¹¤È¤·¤Æ¡¤XML ¥Ç¡¼¥¿·¿¤ò¥µ¥Ý¡¼¥È¤·¤¿ PostgreSQL ¥µ¡¼¥Ð¤¬É¬Íפˤʤê¤Þ¤¹¡¥ ¤½¤Î¤¿¤á¤Ë¤Ï¡¤PostgreSQL 8.3.X °Ê¹ß¤òÍøÍѤ·¡¤configure ¥ª¥×¥·¥ç¥ó¤Ë --with-libxml ¤ò»ØÄꤷ¤Æ PostgreSQL ¥µ¡¼¥Ð¤ò¹½ÃÛ¤·¤Þ¤¹¡¥ PostgreSQL ¤Î XML ·¿¤ÎÍøÍѤˤĤ¤¤Æ¤Ï¡¢°Ê²¼¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡¥ http://www.postgresql.jp/document/pg836doc/html/datatype-xml.html *** ¥¤¥ó¥¹¥È¡¼¥ëÊýË¡ configure ¥³¥Þ¥ó¥É¤Î¥ª¥×¥·¥ç¥ó¤Ç --enable-xmlattr ¤ò»ØÄꤷ¤Þ¤¹¡¥ *** ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥ÐÀßÄêÊýË¡ config-gfarm ¤Î¥ª¥×¥·¥ç¥ó¤Ç -X ¤ò»ØÄꤷ¤Þ¤¹¡¥ ´û¸¤Î¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤ò¹¹¿·¤¹¤ë¾ì¹ç¡¤config-gfarm-update ¤Î¥ª¥×¥·¥ç¥ó ¤Ç -X ¤ò»ØÄꤷ¤Æ¼Â¹Ô¤·¤Þ¤¹¡¥ ¤Ê¤ª¡¤¥Ð¥Ã¥¯¥¨¥ó¥É¥Ç¡¼¥¿¥Ù¡¼¥¹¤¬ OpenLDAP ¥µ¡¼¥Ð¤Î¾ì¹ç¤Ï XML ³Èĥ°À­ ¤ÏÍøÍѤǤ­¤Þ¤»¤ó¡¥ gfarm-2.4.1/doc/Gfarm-FAQ.en0000644000000000000000000002170611507222722014050 0ustar rootrootGfarm FAQ - Frequently Asked Questions about Gfarm Copyright (c) 2003-2008 National Institute of Advanced Industrial Science and Technology (AIST). All Rights Reserved. Copyright (c) 2006-2008 Osamu Tatebe. All Rights Reserved. Table of Contents: ****************** 1. General 1.1 What is Gfarm? 1.2 Where can I download Gfarm? 2. Trouble Shooting 2.1 We cannot connect to filesystem nodes and/or a metadata server. 2.2 "Authentication error" or "no filesystem node" error occurs when accessing or replicating files. 2.3 Due to a disk crash, all files in a filesystem node are lost. What do we have to do? 2.4 Sometimes a gfarm client or gfsd stops without doing anything. 2.5 The modification time seems to be strange. 3. Security 3.1 It is safe to use Gfarm in an environment that is NOT protected by a firewall? 3.2 What is the difference in sharedsecret authentication, the gsi_auth method, and gsi authentication? 4. Limitations 4.1 The following functionality is partially supported. 4.2 The following functionalities supported by Gfarm-1.x are not supported yet. 4.3 The following functionality supported by Gfarm-1.x is not supported. 1. General ********** 1.1 What is Gfarm? Please refer to the following URL: http://datafarm.apgrid.org/ 1.2 Where can I download Gfarm? It is available at the following URL: http://sourceforge.net/projects/gfarm/ Current source code can be obtained by $ svn co https://gfarm.svn.sourceforge.net/svnroot/gfarm/gfarm_v2/trunk gfarm_v2 $ svn co https://gfarm.svn.sourceforge.net/svnroot/gfarm/gfarm2fs/trunk gfarm2fs 2. Trouble Shooting ******************* 2.1 We cannot connect to filesystem nodes and/or a metadata server. As the default setting, 600/tcp and 600/udp have to be opened for filesystem nodes, and 601/tcp have to be opened for a metadata server. When 'gfhost -lv' reports 'x.xx/x.xx/x.xx', these filesystem nodes cannot be connected by a client using 600/udp. The port number can be specified by a command-line option of config-gfarm and config-gfsd. For details, refer to the installation manual. 2.2 "Authentication error" or "no filesystem node" error occurs when accessing or replicating files. Authentication to file system nodes may fail. It is necessary to set up a shared secret key or the GSI configuration correctly. Regarding the shared secret authentication, make sure the same shared secret key file (~/.gfarm_shared_key) is located on a home directory on all file system nodes. Regarding the GSI authentication, follow the error message. When executing with the -v option, gfmd and gfsd output verbose authentication error messages to /var/log/messages (or /var/adm/messages). Detailed descriptions are available at http://www.globus.org. If the problem is still there, call administrators of a Gfarm file system. A shared secret key setting or the GSI setting might be incorrect for a _gfarmfs user. Here are some hints on typical cases involving this error in GSI: (1) Is a valid entry included in the grid-mapfile on file system nodes and filesystem metadata node? Note that the subject names displayed for certain certificates have been changed between Globus Toolkit version 2 (GT2) and version 3 (GT3). The 'Email' field in GT2 has become 'emailAddress' in GT3 or later. The 'USERID' field in GT2 has become 'UID' in GT3 or later. For compatibility, you need to register both entries in grid-mapfile. (2) Are permissions of user certificate (~/.globus/usercert.pem) and/or host certificate (/etc/grid-security/hostcert.pem) not permissive? The maximum allowable permissions are limited to 644. (3) Are both user certificate and host certificates valid, and not yet expired? (4) Is a valid certificate for the CAs that sign user or host certificates, registered in /etc/grid-security/certificates? Has this registration expired? Note that CA subject name in the signing_policy files is also affected in the same way as the items in (1), above. To use the same signing_policy file for GT2 and GT3, you need both entries in the signing_policy file. (5) Has the CRL, which is registered in /etc/grid-security/certificates, expired? (7) Does the hostname, which is specified by metadb_serverhost in the gfarm.conf file, match the name in the host certificate? (7) Do the host identifiers, which are registered by gfhost, match the hostnames which are written in the host certificates? (8) Are the clocks of all filesystem nodes, the filesystem metadata node, and the client synchronized? The GSI library provided by Globus fails to authenticate these properly when the time difference is more than five minutes. 2.3 Due to a disk crash, all files in a filesystem node are lost. What do we have to do? When a filesystem node is down, there is nothing you have to do when there is at least one file copy, since the unavailable filesystem node is not used. However, when you re-join the filesystem node that loses files to the Gfarm file system, a problem occurs since invalid metadata of lost file replicas remains in a metadata database. We have a plan to provide an administration command to re-join the filesystem node. 2.4 Sometimes a gfarm client or gfsd stops without doing anything. If your network interface card or your network itself has a trouble that lasts more than a few minutes, such symptoms may occur. The possibility increases if you are using a wide area network for communication between a gfarm client and a server. A stopped gfarm client or gfsd is able to exit automatically with an error, if you add a "sockopt keepalive" setting to your gfarm.conf. The config-gfarm command generates this setting by default, since gfarm 1.3.1. Or, if you are using "ldap" in /etc/nsswitch.conf on some Linux distributions, this problem may occur too. This problem is observed in Fedora Core 3, Fedora Coer 5 and CentOS 4.4, but haven't been observed in Red Hat 8. The cause of this problem is a bug of system-supplied libraries. The detailed condition of this bug is described in KNOWN_PROBLEMS.en. For this problem, currently no workaround is known except disabling the "ldap" feature. 2.5 The modification date seems to be strange. The modification date will be set by the file system node where the physical file is stored. When clocks of file system nodes are not synchronized, the modification date may be strange. Check and synchronize clocks of all file system nodes. 3. Security *********** 3.1 It is safe to use Gfarm in an environment that is NOT protected by a firewall? Gfarm-2.x supports three authentication methods, namely, sharedsecret authentication, the gsi_auth method, and gsi authentication. The sharedsecret authentication and gsi_auth methods are not safe enough in the Internet environment. Please refer to the next question for further information about this issue. 3.2 What is the difference in sharedsecret authentication, the gsi_auth method, and gsi authentication? The "sharedsecret" authentication method in Gfarm is authentication based on a shared key, which provides only authentication service, not data signing and data encryption services. Thus, this method still has risks of packet sniffing and TCP session hijacking. For this reason, we recommend that you use the sharedsecret authentication only in a safe environment, protected by a firewall. The reason we provide this authentication method is that it is fast, and it does not require you to acquire a public key. The "gsi" (Grid Security Infrastructure) authentication method is authentication based on a public key infrastructure. Gfarm uses the Globus GSI library for this authentication. Because the Globus GSI library supports data encryption, the gsi authentication is considered more secure than the sharedsecret authentication in Gfarm. But please note that some exportable versions of Globus don't support encryption. We recommend that you confirm that your Globus version does, in fact, support encryption. The "gsi_auth" method uses the GSI library only for the authentication. The actual data communication is not protected by data signing or data encryption services with this method. Thus, the gsi_auth method has risks of packet sniffing and TCP session hijacking, just like sharedsecret authentication. For this reason, we recommend you use the gsi_auth method only in a safe environment, protected by a firewall. The reason we provide this method is that it allows for fast data transfer. The gsi authentication and gsi_auth methods are only available when you use the --with-globus option at thetime you do the source code "configure" operation. Please see the following URL for more about the GSI: http://www.globus.org/ 4. Limitations ************* 4.1 The following functionality supported by Gfarm-1.x are not supported. File view 4.2 There is no plan to support the following functionality supported by Gfarm-1.x. Remote program execution gfarm-2.4.1/doc/Gfarm-FAQ.ja0000644000000000000000000002047711507222722014044 0ustar rootrootGfarm FAQ - Gfarm ¤Ë´Ø¤¹¤ë¤è¤¯¤¢¤ë¼ÁÌä Copyright (c) 2003-2008 National Institute of Advanced Industrial Science and Technology (AIST). All Rights Reserved. Copyright (c) 2006-2008 Osamu Tatebe. All Rights Reserved. Ìܼ¡: ***** 1. °ìÈÌ 1.1 Gfarm ¤È¤Ï²¿¤Ç¤¹¤«¡© 1.2 Gfarm ¤Ï¤É¤³¤«¤é¥À¥¦¥ó¥í¡¼¥É¤Ç¤­¤Þ¤¹¤«¡© 2. ¥È¥é¥Ö¥ë¡¦¥·¥å¡¼¥Æ¥£¥ó¥° 2.1 ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¡¤¥á¥¿¥µ¡¼¥Ð¤ËÀܳ¤Ç¤­¤Þ¤»¤ó¡¥ 2.2 ¥Õ¥¡¥¤¥ë¥¢¥¯¥»¥¹»þ¡¤¥Õ¥¡¥¤¥ëÊ£À½ºîÀ®»þ¤Ê¤É¤Ëǧ¾Ú¥¨¥é¡¼¤¬ µ¯¤­¤Æ¤·¤Þ¤¤¤Þ¤¹¡¥¤¢¤ë¤¤¤Ï¡¤no filesystem node ¤È¤¤¤¦¥¨¥é¡¼¤¬È¯À¸ ¤·¤Æ¤·¤Þ¤¤¤Þ¤¹¡¥ 2.3 ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Î¥Ç¥£¥¹¥¯¤¬¥¯¥é¥Ã¥·¥å¤·¤Æ¤·¤Þ¤¤¤Þ¤·¤¿¡¥¤É ¤¦¤¹¤ì¤Ð¤¤¤¤¤Ç¤·¤ç¤¦¤«¡© 2.4 ̵ÄÌ¿®¾õÂ֤ǻߤޤäƤ¤¤ë gfarm ¥¯¥é¥¤¥¢¥ó¥È¤ä gfsd ¤¬»Ä¤ë¤³¤È¤¬ ¤¢¤ë¤Î¤Ç¤¹¤¬¡© 2.5 ¥Õ¥¡¥¤¥ë¤Î¹¹¿·»þ¹ï¤¬¤ª¤«¤·¤¤¤è¤¦¤Ç¤¹¡¥ 3. ¥»¥­¥å¥ê¥Æ¥£ 3.1 Gfarm ¤Ï firewall ¤Ë¼é¤é¤ì¤Æ¤¤¤Ê¤¤´Ä¶­¤Ç°ÂÁ´¤Ë±¿ÍѤǤ­¤Þ¤¹¤«¡© 3.2 sharedsecret ǧ¾Ú¡¤gsi_auth ¼êË¡¡¤gsi ǧ¾Ú¤Î°ã¤¤¤Ï¡© 4. À©¸Â»ö¹à 4.1 °Ê²¼¤Îµ¡Ç½¤Ï¤Þ¤ÀÉôʬŪ¤Ë¤·¤«¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡¥ 4.2 Gfarm-1.x¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤¿°Ê²¼¤Îµ¡Ç½¤Ï¤Þ¤À¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Þ ¤»¤ó¡¥ 4.3 Gfarm-1.x¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤¿°Ê²¼¤Îµ¡Ç½¤Ï¥µ¥Ý¡¼¥È¤µ¤ì¤ëͽÄê¤Ï¤¢ ¤ê¤Þ¤»¤ó¡¥ 1. °ìÈÌ ********** 1.1 Gfarm ¤È¤Ï²¿¤Ç¤¹¤«¡© ²¼µ­¤Î URL ¤ò¤´Í÷¤¯¤À¤µ¤¤¡¥ http://datafarm.apgrid.org/ 1.2 Gfarm ¤Ï¤É¤³¤«¤é¥À¥¦¥ó¥í¡¼¥É¤Ç¤­¤Þ¤¹¤«¡© ²¼µ­¤Î URL ¤«¤éÇÛÉÛ¤µ¤ì¤Æ¤¤¤Þ¤¹¡¥ http://sourceforge.net/projects/gfarm/ ¤Ê¤ª¡¤³«È¯ÈǤΥ½¡¼¥¹¥³¡¼¥É¤Ï°Ê²¼¤Î¥³¥Þ¥ó¥É¤ÇÆþ¼ê¤Ç¤­¤Þ¤¹¡¥ $ svn co https://gfarm.svn.sourceforge.net/svnroot/gfarm/gfarm_v2/trunk gfarm_v2 $ svn co https://gfarm.svn.sourceforge.net/svnroot/gfarm/gfarm2fs/trunk gfarm2fs 2. ¥È¥é¥Ö¥ë¡¦¥·¥å¡¼¥Æ¥£¥ó¥° ******************* 2.1 ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¡¤¥á¥¿¥µ¡¼¥Ð¤ËÀܳ¤Ç¤­¤Þ¤»¤ó¡¥ ¥Ç¥Õ¥©¥ë¥È¤ÎÀßÄê¤Ç¤Ï¡¤¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Ï 600/tcp ¤È 600/udp ¤òÍøÍѤ·¡¤¥á¥¿¥µ¡¼¥Ð¥Î¡¼¥É¤Ï 601/tcp ¤òÍøÍѤ·¤Þ¤¹¡¥ ÆÃ¤Ë 'gfhost -lv' ¤Ç¡¤'x.xx/x.xx/x.xx' ¤Èɽ¼¨¤µ¤ì¤ë¥Õ¥¡¥¤¥ë¥·¥¹ ¥Æ¥à¥Î¡¼¥É¤Ï¡¤600/udp ¤Ç¤ÎÀܳ¤Ë¼ºÇÔ¤·¤Æ¤¤¤Þ¤¹¡¥ ¥Ç¥Õ¥©¥ë¥È¤Î¥Ý¡¼¥ÈÈÖ¹æ¤Ï¡¤config-gfarm¡¤config-gfsd ¤Î¥ª¥× ¥·¥ç¥ó¤ÇÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡¥¾ÜºÙ¤Ï¥¤¥ó¥¹¥È¡¼¥ë¥¬¥¤¥É¤ò»²¾È ¤·¤Æ¤¯¤À¤µ¤¤¡¥ 2.2 ¥Õ¥¡¥¤¥ë¥¢¥¯¥»¥¹»þ¡¤¥Õ¥¡¥¤¥ëÊ£À½ºîÀ®»þ¤Ê¤É¤Ëǧ¾Ú¥¨¥é¡¼¤¬ µ¯¤­¤Æ¤·¤Þ¤¤¤Þ¤¹¡¥¤¢¤ë¤¤¤Ï¡¤no filesystem node ¤È¤¤¤¦¥¨¥é¡¼¤¬È¯À¸ ¤·¤Æ¤·¤Þ¤¤¤Þ¤¹¡¥ ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤ËÂФ¹¤ë¶¦Í­¸°¤¢¤ë¤¤¤Ï GSI ¤ÎÀßÄ꤬Àµ¤· ¤¯¤Ê¤µ¤ì¤Æ¤¤¤Ê¤¤²ÄǽÀ­¤¬¤¢¤ê¤Þ¤¹¡¥ ¶¦Í­¸°Ç§¾Ú¤Î¾ì¹ç¤Ï¡¤³Æ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Î¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È ¥ê¤ËƱ°ì¤Î¶¦Í­¸°¥Õ¥¡¥¤¥ë(~/.gfarm_shared_key) ¤¬ÃÖ¤«¤ì¤Æ¤¤¤ë¤« ³Îǧ¤·¤Æ¤¯¤À¤µ¤¤¡¥ GSIǧ¾Ú¤Î¾ì¹ç¤Ï¡¤É½¼¨¤µ¤ì¤ë¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤Ë½¾¤¤Âбþ¤·¤Æ¤¯¤À ¤µ¤¤¡¥¥µ¡¼¥Ð¦¤Ç¤Î¥¨¥é¡¼¤Î¾ÜºÙ¤Ï gfmd ¤ª¤è¤Ó gfsd ¤Îµ¯Æ°¥ª¥×¥·¥ç ¥ó¤Ë -v ¤ò²Ã¤¨¤ë¤³¤È¤Ë¤è¤ê /var/log/messages (¤Ê¤¤¤· /var/adm/messages) ¤Ëµ­Ï¿¤µ¤»¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡¥ ǧ¾Ú¥¨¥é¡¼¤Ë´Ø¤¹¤ë¾ÜºÙ¤Ê¾ðÊó¤Ï http://www.globus.org ¤è¤êÆÀ¤é ¤ì¤Þ¤¹¡¥ ¤½¤ì¤Ç¤âǧ¾Ú¥¨¥é¡¼¤¬À¸¤¸¤ë¾ì¹ç¤Ï¡¤Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î´ÉÍý ¼Ô¤ËÏ¢Íí¤·¤Æ¤¯¤À¤µ¤¤¡¥¤³¤Î¾ì¹ç¡¤_gfarmfs ¥æ¡¼¥¶¤Î¶¦Í­¸°¡¢GSI¤Î ÀßÄ꤬Àµ¤·¤¯¤Ê¤µ¤ì¤Æ¤¤¤Ê¤¤²ÄǽÀ­¤¬¤¢¤ê¤Þ¤¹¡¥ ¤Ê¤ª¡¤GSIǧ¾Ú¤Ë¤ª¤¤¤Æ¤Ï°Ê²¼¤Î¤è¤¦¤ÊÅÀ¤ËÃí°Õ¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡¥ (1) ÍøÍѤ¹¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤ª¤è¤Ó¡¤¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤Î¥° ¥ê¥Ã¥É¥Þ¥Ã¥×¥Õ¥¡¥¤¥ë(/etc/grid-security/grid-mapfile) ¤ËÀµ¤·¤¤¥¨¥ó¥È¥ê¤¬ÅÐÏ¿¤µ¤ì¤Æ¤¤¤Þ¤¹¤«¡© ÆÃ¤Ë¡¤Globus Toolkit version 2 (GT2) ¤È version 3 (GT3) °Ê¹ß¤Ç¤Ï¡¤ ¥µ¥Ö¥¸¥§¥¯¥È̾¤Ë°ã¤¤¤¬¤¢¤ë¤Î¤ÇɬÍפǤ¹¡¥GT2 ¤Î Email ¥Õ¥£¡¼¥ë¥É ¤Ï¡¤GT3 °Ê¹ß¤Ç¤Ï emailAddress ¤È¤Ê¤ê¤Þ¤¹¡¥¤Þ¤¿ GT2 ¤Î USERID ¥Õ¥£¡¼¥ë¥É¤Ï GT3 °Ê¹ß¤Ç¤Ï UID ¤È¤Ê¤ê¤Þ¤¹¡¥Î¾Êý¤Î¥é¥¤¥Ö¥é¥ê¤òÍøÍÑ ¤¹¤ë¾ì¹ç¤Ï¡¤¸ß´¹À­¤Î¤¿¤á¤Ë¡¤Î¾Êý¤Î¥¨¥ó¥È¥ê¤ò grid-mapfile ¤ËÅÐÏ¿ ¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡¥ (2) ¥æ¡¼¥¶¾ÚÌÀ½ñ(~/.globus/usercert.pem)¡¤¥Û¥¹¥È¾ÚÌÀ½ñ (/etc/grid-security/hostcert.pem)¤Î¥Ñ¥ß¥Ã¥·¥ç¥ó¤¬ 0644 ¤Ë¤Ê¤Ã¤Æ ¤¤¤Þ¤¹¤«¡© (3) ¥æ¡¼¥¶¾ÚÌÀ½ñ¡¤¥Û¥¹¥È¾ÚÌÀ½ñ¤ÎÍ­¸ú´ü¸Â¤ÏÀÚ¤ì¤Æ¤¤¤Þ¤»¤ó¤«¡© (4) ¥æ¡¼¥¶¾ÚÌÀ½ñ¡¤¥Û¥¹¥È¾ÚÌÀ½ñ¤Ë½ð̾¤·¤Æ¤¤¤ë CA ¤Î¾ÚÌÀ½ñ¤ÏÍ­ ¸ú¤Ê¤â¤Î¤¬Àµ¤·¤¯ /etc/grid-security/certificates ¤ËÅÐÏ¿¤µ¤ì¤Æ¤¤ ¤Þ¤¹¤«¡© Í­¸ú´ü¸Â¤¬ÀÚ¤ì¤Æ¤¤¤Þ¤»¤ó¤«¡© signing_policy ¥Õ¥¡¥¤¥ë¤Ë¤ª¤±¤ë CA ¤Î¥µ¥Ö¥¸¥§¥¯¥È̾¤â (1) ¤ÈƱ ÍͤËÊѲ½¤¹¤ë¤Î¤ÇÃí°Õ¤¬É¬ÍפǤ¹¡¥ (5) /etc/grid-security/certificates ¤ËÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë CRL ¤Î Í­¸ú´ü¸Â¤¬ÀÚ¤ì¤Æ¤¤¤Þ¤»¤ó¤«¡© (6) gfarm.conf ¤Î metadb_serverhost ¤Î¹à¤Ç»ØÄꤷ¤Æ¤¤¤ë¥á¥¿¥Ç¡¼¥¿ ¥µ¡¼¥Ð¤Î¥Û¥¹¥È̾¤Ï¡¢¥Û¥¹¥È¾ÚÌÀ½ñ¤Ë½ñ¤«¤ì¤Æ¤¤¤ë¥Û¥¹¥È̾¤È°ìÃפ·¤Æ ¤¤¤Þ¤¹¤«¡© (7) gfhost ¥³¥Þ¥ó¥É¤ÇÅÐÏ¿¤¹¤ë¥Û¥¹¥È¤Î¸ÇÍ­¼±Ê̻Ҥϡ¤¥Û¥¹¥È¾ÚÌÀ½ñ ¤Ë½ñ¤«¤ì¤Æ¤¤¤ë¥Û¥¹¥È̾¤È°ìÃפ·¤Æ¤¤¤Þ¤¹¤«¡© (8) Á´¤Æ¤Î¥Û¥¹¥È¤Ç»þ¹ï¤¬Àµ¤·¤¯ÀßÄꤵ¤ì¤Æ¤¤¤Þ¤¹¤«¡© Globus ¤Î GSI ¥é¥¤¥Ö¥é¥ê¤Î¾ì¹ç¡¤¥Û¥¹¥È´Ö¤Ç 5ʬ°Ê¾å»þ¹ï¤¬¶¸¤Ã¤Æ¤¤¤ë¤Èǧ¾Ú ¤Ë¼ºÇÔ¤·¤Æ¤·¤Þ¤¤¤Þ¤¹¡¥ 2.3 ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Î¥Ç¥£¥¹¥¯¤¬¥¯¥é¥Ã¥·¥å¤·¤Æ¤·¤Þ¤¤¤Þ¤·¤¿¡¥¤É ¤¦¤¹¤ì¤Ð¤¤¤¤¤Ç¤·¤ç¤¦¤«¡© ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤¬Íî¤Á¤Æ¤¤¤ë´Ö¤Ï¡¤¤½¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼ ¥É¤ÏÍøÍѤµ¤ì¤Þ¤»¤ó¤Î¤Ç¡¤Ê£À½¤¬Â¾¤Î¥Î¡¼¥É¤Ë¸ºß¤·¤Æ¤¤¤ì¤ÐÌäÂê¤Ê ¤¯¥¢¥¯¥»¥¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡¥ ¤¿¤À¤·¡¤¥Õ¥¡¥¤¥ë¤¬¼º¤ï¤ì¤Æ¤·¤Þ¤Ã¤¿¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤ò Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ËÀܳ¤¹¤ë¤ÈÌäÂ꤬À¸¤¸¤Þ¤¹¡¥¤³¤Î¤¿¤á¤Î´É Íý¥³¥Þ¥ó¥É¤Ïº£¸åÄ󶡤µ¤ì¤ëͽÄê¤Ç¤¹¡¥ 2.4 ̵ÄÌ¿®¾õÂ֤ǻߤޤäƤ¤¤ë gfarm ¥¯¥é¥¤¥¢¥ó¥È¤ä gfsd ¤¬»Ä¤ë¤³¤È¤¬ ¤¢¤ë¤Î¤Ç¤¹¤¬¡© ¥Í¥Ã¥È¥ï¡¼¥¯¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¥«¡¼¥É¤ÎÌäÂê¤ä¡¢¥Í¥Ã¥È¥ï¡¼¥¯¼«ÂΤΠ¥È¥é¥Ö¥ë¤Ç¡¢¿ôʬ´Ö¤Ë¤è¤Ã¤ÆÄÌ¿®¤¬ÅÓÀ䤷¤¿¾ì¹ç¡¢¤³¤Î¤è¤¦¤Ê¤³¤È¤¬ µ¯¤­¤ë²ÄǽÀ­¤¬¤¢¤ê¤Þ¤¹¡£ÆÃ¤Ë¹­°è¥Í¥Ã¥È¥ï¡¼¥¯¤òÄ̤·¤ÆÄÌ¿®¤·¤Æ ¤¤¤ë¾ì¹ç¤Ï¤³¤Î¤è¤¦¤Ê²ÄǽÀ­¤¬Áý¤¨¤Þ¤¹¡£¤½¤Î¤è¤¦¤Ê¾ì¹ç¡¢ gfarm.conf ¤Ë¡Ösockopt keepalive¡×¤È¤¤¤¦ÀßÄê¤ò²Ã¤¨¤ë¤³¤È¤Ç¡¢ Ää»ß¤·¤¿¥×¥í¥°¥é¥à¤ò¼«Æ°Åª¤Ë¥¨¥é¡¼¤Ç½ªÎ»¤µ¤»¤ë¤³¤È¤¬¤Ç¤­¤ë¤è¤¦ ¤Ë¤Ê¤ê¤Þ¤¹¡£Gfarm 1.3.1 °Ê¹ß¤Î config-gfarm ¤ÇÀ¸À®¤·¤¿ gfarm.conf ¤Ï¡¢¥Ç¥Õ¥©¥ë¥È¤Ç¤³¤ÎÀßÄê¤ò´Þ¤ó¤Ç¤¤¤Þ¤¹¡£ ¤¢¤ë¤¤¤Ï¡¤¤â¤· /etc/nsswitch.conf ¤Ç¡Öldap¡×¤ò»ØÄꤷ¤Æ¤¤¤ë¾ì¹ç¡¤ ¤¤¤¯¤Ä¤«¤Î Linux ¥Ç¥£¥¹¥È¥ê¥Ó¥å¡¼¥·¥ç¥ó¤Ç¡¤¤³¤Î¤è¤¦¤ÊÌäÂ꤬ À¸¤¸¤Æ¤¤¤Þ¤¹¡¥¶ñÂÎŪ¤Ë¤Ï Fedora Core 3¡¤Fedora Core 5¡¤CentOS 4.4 ¤Ê¤É¤Ç¤¹¡¥Red Hat 8 ¤Ç¤Ï¡¤¤³¤ÎÌäÂê¤ÏÀ¸¤¸¤Æ¤¤¤Þ¤»¤ó¡¥ ¤³¤ì¤Ï¥·¥¹¥Æ¥àÉí°¤Î¥é¥¤¥Ö¥é¥ê¤Î¥Ð¥°¤¬¸¶°ø¤ÇÀ¸¤¸¤ëÌäÂê¤Ç¤¢¤ê¡¤ ¤½¤Î¶ñÂÎŪ¤Ê¾ò·ï¤Ï¡¤¥Õ¥¡¥¤¥ë KNOWN_PROBLEMS.ja ¤Ëµ­ºÜ¤·¤Æ¤¢¤ê¤Þ¤¹¡¥ ¤³¤ÎÌäÂê¤Î¾ì¹ç¡¤¡Öldap¡×¤Î»ØÄê¤ò¼è¤ê½ü¤¯¤³¤È¤Î¾¤Ë¤Ï¡¤¸½ºß¤Î ¤È¤³¤í²óÈòºö¤¬ÃΤé¤ì¤Æ¤¤¤Þ¤»¤ó¡¥ 2.5 ¥Õ¥¡¥¤¥ë¤Î¹¹¿·»þ¹ï¤¬¤ª¤«¤·¤¤¤è¤¦¤Ç¤¹¡¥ ¥Õ¥¡¥¤¥ë¤Î¹¹¿·»þ¹ï¤Ï¼ÂºÝ¤Î¥Õ¥¡¥¤¥ë¤òºîÀ®¤·¤¿¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼ ¥É¤Î¹¹¿·»þ¹ï¤È¤Ê¤ê¤Þ¤¹¡¥¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Î»þ¹ï¤¬Àµ¤·¤¯Àß Äꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¤¤½¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Ë½ñ¤­¹þ¤Þ¤ì¤¿¥Õ¥¡ ¥¤¥ë¤Î¹¹¿·»þ¹ï¤Ê¤É¤¬¤ª¤«¤·¤¯¤Ê¤Ã¤Æ¤·¤Þ¤¤¤Þ¤¹¡¥NTP¤Ê¤É¤òÍøÍѤ· ¤Æ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Î»þ¹ï¤òÀµ¤·¤¯ÀßÄꤷ¤Æ¤¯¤À¤µ¤¤¡¥ 3. ¥»¥­¥å¥ê¥Æ¥£ *************** 3.1 Gfarm ¤Ï firewall ¤Ë¼é¤é¤ì¤Æ¤¤¤Ê¤¤´Ä¶­¤Ç°ÂÁ´¤Ë±¿ÍѤǤ­¤Þ¤¹¤«¡© Gfarm-2.x ¤Ï¡¤sharedsecret ǧ¾Ú¡¤gsi_auth ¼êË¡¡¤gsi ǧ¾Ú¤Î 3 ¼ïÎà¤Îǧ¾ÚÊýË¡¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Þ¤¹¤¬¡¤ Internet ´Ä¶­¤Ç¤Ï¡¤sharedsecret ǧ¾Ú¤ä gsi_auth ¼êË¡¤Ç¤Ï °ÂÁ´¤È¤Ï¸À¤¨¤Þ¤»¤ó¡¥gsi ǧ¾Ú¤ÎÍøÍѤò¿ä¾©¤·¤Þ¤¹¡¥ ¤³¤ì¤Ë¤Ä¤¤¤Æ¤Ï¡¤¼¡¤Î¹àÌܤò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡¥ 3.2 sharedsecret ǧ¾Ú¡¤gsi_auth ¼êË¡¡¤gsi ǧ¾Ú¤Î°ã¤¤¤Ï¡© ¡Ösharedsecret¡×ǧ¾Ú¤Ï¡¤¶¦Í­¸°¤òÍѤ¤¤¿Ç§¾Ú¤Ç¤¹¡¥ Gfarm ¤Î sharedsecret ǧ¾Ú¤Î¾ì¹ç¡¤Ä󶡤·¤Æ¤¤¤ë¥µ¡¼¥Ó¥¹¤¬Ç§¾Ú¤À ¤±¤Ç¤¢¤ê¡¤¥Ç¡¼¥¿¤ËÂФ¹¤ë½ð̾¤ä°Å¹æ²½¤òÄ󶡤·¤Æ¤¤¤ë¤ï¤±¤Ç¤Ï¤¢¤ê ¤Þ¤»¤ó¤«¤é¡¤¥Ñ¥±¥Ã¥ÈÅðݤ䡤TCP ¥»¥Ã¥·¥ç¥ó¤Î¾è¤Ã¼è¤ê¤Ê¤É¤Î´í¸± ¤¬»Ä¤ê¤Þ¤¹¡¥ ½¾¤Ã¤Æ¡¤firewall ¤Ç¼é¤é¤ì¤Æ¤¤¤ë´Ä¶­Æâ¤Î¤ß¤Ç¤ÎÍøÍѤò¤ª´«¤á¤·¤Þ ¤¹¡¥sharedsecret ǧ¾Ú¤òÄ󶡤·¤Æ¤¤¤ëÍýͳ¤Ï¡¤¹â®¤Ê¤³¤È¤È¡¤¸ø³« ¸°¤Î¼èÆÀ¤Î¼ê´Ö¤ò¾Ê¤±¤ë¤³¤È¤Ç¤¹¡¥ ¡Ögsi¡×(Grid Security Infrastructure) ǧ¾Ú¤Ï¡¤¸ø³«¸°¤Ë´ð¤Å¤¤¤¿Ç§ ¾ÚÊýË¡¤Ç¤¹¡¥Gfarm ¤Ï Globus ¤ÎÄ󶡤¹¤ë GSI ¥é¥¤¥Ö¥é¥ê¤òÍѤ¤¤Æ ¤¤¤Þ¤¹¡¥Globus ¤¬¥Ç¡¼¥¿¤Î°Å¹æ²½¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¤¿¤á¡¤ sharedsecret ǧ¾Ú¤è¤ê¤â°ÂÁ´¤Ç¤¢¤ë¤È¹Í¤¨¤é¤ì¤Þ¤¹¡¥¤¿¤À¤·¡¤Í¢½Ð ÈǤΠGlobus ¤Î¾ì¹ç¡¤¥Ð¡¼¥¸¥ç¥ó¤Ë¤è¤Ã¤Æ¤Ï°Å¹æ²½¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤ ¤Ê¤¤¤³¤È¤¬¤¢¤ê¤Þ¤¹¡¥¤ª»È¤¤¤Î Globus ¤¬¡¤°Å¹æ²½¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤ ¤ë¥Ð¡¼¥¸¥ç¥ó¤Ç¤¢¤ë¤«³Îǧ¤·¤Æ¤ª¤¯¤³¤È¤ò¤ª´«¤á¤·¤Þ¤¹¡¥ ¡Ögsi_auth¡×¼êË¡¤Î¾ì¹ç¡¤Ç§¾Ú½èÍý¤Î¤ß¤Ë GSI ¥é¥¤¥Ö¥é¥ê¤òÍѤ¤¡¤ ¤½¤Î¸å¤ÎÄÌ¿®¤Ë¤Ï¥Ç¡¼¥¿¤ËÂФ¹¤ë½ð̾¤ä°Å¹æ²½½èÍý¤Ë¤è¤ëÊݸî¤Î¤Ê¤¤¡¤ À¸¤Î¥Ç¡¼¥¿Å¾Á÷¤òÍѤ¤¤Þ¤¹¡¥¤³¤Î¤¿¤á sharedsecret ǧ¾Ú¤ÈƱÍÍ¡¤ ¥Ñ¥±¥Ã¥ÈÅðݤ䡤TCP ¥»¥Ã¥·¥ç¥ó¤Î¾è¤Ã¼è¤ê¤Ê¤É¤Î´í¸±¤¬»Ä¤ê¤Þ¤¹¡¥ ½¾¤Ã¤Æ¡¤firewall ¤Ç¼é¤é¤ì¤Æ¤¤¤ë´Ä¶­Æâ¤Î¤ß¤Ç¤ÎÍøÍѤò¤ª´«¤á¤·¤Þ ¤¹¡¥gsi_auth ¼êË¡¤òÄ󶡤·¤Æ¤¤¤ëÍýͳ¤Ï¡¤¥Ç¡¼¥¿Å¾Á÷¤¬¹â®¤Ê¤³¤È ¤Ç¤¹¡¥ gsi ǧ¾Ú¤ä gsi_auth ¼êË¡¤Ï¡¤¥½¡¼¥¹¥³¡¼¥É¤Î configure »þ¤Ë --with-globus ¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Ê¤¤¤È¡¤Í­¸ú¤Ë¤Ê¤ê¤Þ¤»¤ó¡¥ GSI ¤Ë´Ø¤¹¤ë¾Ü¤·¤¤¾ðÊó¤Ï¡¤http://www.globus.org/ ¤ò»²¾È¤· ¤Æ¤¯¤À¤µ¤¤¡¥ 4. À©¸Â»ö¹à *********** 4.1 Gfarm-1.x¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤¿°Ê²¼¤Îµ¡Ç½¤Ï¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡¥ ¥Õ¥¡¥¤¥ë¥Ó¥å¡¼¡¤¥Õ¥¡¥¤¥ë¤Îʬ³ä³ÊǼ 4.2 Gfarm-1.x¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤¿°Ê²¼¤Îµ¡Ç½¤Ï¥µ¥Ý¡¼¥È¤µ¤ì¤ëͽÄê¤Ï¤¢ ¤ê¤Þ¤»¤ó¡¥ ¥ê¥â¡¼¥È¥×¥í¥°¥é¥à¤Îµ¯Æ° gfarm-2.4.1/doc/SETUP.private.ja0000644000000000000000000001730211507222722014745 0ustar rootroot[This is written in Japanese, please look at SETUP.private.en for English version.] ¥×¥é¥¤¥Ù¡¼¥È Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥àÀßÄê¥Þ¥Ë¥å¥¢¥ë ¡ü Ëܥɥ­¥å¥á¥ó¥È¤Ë¤Ä¤¤¤Æ ========================= Ëܥɥ­¥å¥á¥ó¥È¤Ï¥æ¡¼¥¶¸¢¸Â¤Ç¹½ÃÛ²Äǽ¤ÊÆÃÄê¥æ¡¼¥¶ÀìÍѤΥץ饤¥Ù¡¼¥È Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¹½ÃÛÊýË¡¤òµ­½Ò¤·¤¿¤â¤Î¤Ç¤¹¡¥ ¤Ê¤Ë¤«ÌäÂ꤬À¸¤¸¤¿¾ì¹ç¤Ë¤Ï¡¤Gfarm-FAQ.ja ¤Î¥È¥é¥Ö¥ë¡¦¥·¥å¡¼¥Æ¥£¥ó¥°¤Î ¹à¤â»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡¥ ¡ü ³µÍ× ========================= Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ò¥½¡¼¥¹¤«¤é¹½ÃÛ¤·¡¤¤½¤Î¸å¡¤¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¡¤ ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¡¤¥¯¥é¥¤¥¢¥ó¥È¥Î¡¼¥É¤ÎÀßÄê¤ò¹Ô¤¤¤Þ¤¹¡¥ ¡ü Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¹½ÃÛ =============================== Ëܥɥ­¥å¥á¥ó¥È¤Ç¤Ï¡¤¥¤¥ó¥¹¥È¡¼¥ëÀè¤ò $HOME/local/gfarm_v2 ¤È¤·¤ÆÀâÌÀ¤· ¤Þ¤¹¡¥¤Þ¤º¡¤¥¤¥ó¥¹¥È¡¼¥ëÀè¤ò´Ä¶­ÊÑ¿ô PREFIX ¤ËÀßÄꤷ¤Þ¤¹¡¥ % export PREFIX=$HOME/local/gfarm_v2 ¥¤¥ó¥¹¥È¡¼¥ëÀè¤òÀßÄꤷ¤Æ¡¤¥½¡¼¥¹¥³¡¼¥É¤«¤é Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤òƳ Æþ¤·¤Þ¤¹¡¥ % ./configure --prefix=$PREFIX % make % make install ƳÆþ¤Ë´Ø¤¹¤ë¾ÜºÙ¤Ï INSTALL.ja ¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡¥ ¡ü ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤ÎÀßÄê ========================= ¢¦ Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ÎÀßÄê ¤Þ¤º¡¤´Ä¶­ÊÑ¿ô PATH ¤òÀßÄꤷ¡¤$PREFIX ¤Ë°Ü¤ê¤Þ¤¹¡¥ % export PATH=$PREFIX/bin:$PATH % cd $PREFIX ¼¡¤Ë¡¤config-gfarm ¤Ë¤è¤ê Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¹½ÃÛ¤ò¹Ô¤¤¤Þ¤¹¡¥ % config-gfarm --prefix $PREFIX -S -m -p ¤³¤³¤Ç¡¤ ¤Ï gfmd ¤¬ listen ¤¹¤ë¥Ý¡¼¥ÈÈÖ¹æ¤Ç¡¤db_port ¤Ï¥Ð¥Ã ¥¯¥¨¥ó¥É¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤¬ listen ¤¹¤ë¥Ý¡¼¥ÈÈÖ¹æ¤Ç¤¹¡¥¥æ¡¼¥¶¸¢¸Â¤ÇÍøÍÑ ¤¹¤ë¤¿¤á¡¤1024 °Ê¾å¤Î¥Ý¡¼¥ÈÈÖ¹æ¤òÍøÍѤ¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡¥ ¤Ï TCP ¤Ç³°¤«¤é¥¢¥¯¥»¥¹¤Ç¤­¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡¥ -S ¤Ï¡¤¥×¥é¥¤¥Ù¡¼¥È¤Ê Gfarm ¤ò¹½À®¤¹¤ë¤¿¤á¤Î¥ª¥×¥·¥ç¥ó¤Ç¤¹¡¥ config-gfarm ¥³¥Þ¥ó¥É¤Ë¤è¤Ã¤Æ¡¢$PREFIX/etc/gfarm2.conf ¤ä $PREFIX/etc/gfmd.conf ¤Ê¤É¤¬ºîÀ®¤µ¤ì¤¿È¦¤Ç¤¹¡£ ¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê¤Ëǧ¾Ú¸°¥Õ¥¡¥¤¥ë¡Ö.gfarm_shared_key¡×¤òºîÀ®¤·¤Þ¤¹¡£ % cd % gfkey -f -p 31536000 ¤³¤³¤Ç¤Ï¡¢Ç§¾Ú¸°¤Î´ü¸Â¤ò¡¢¤Û¤Ü1ǯ(31536000ÉÃ) ¤ËÀßÄꤷ¤Æ¤¤¤Þ¤¹¡£ °Ê¾å¤Ç¡¢¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¡¼¾å¤Ç¤ÎÀßÄê¤Ï´°Î»¤Ç¤¹¡£ ²¼µ­¤ò¼Â¹Ô¤·¤Æ¡¢gfmd ¤¬Æ°ºî¤·¤Æ¤¤¤ë¤³¤È¤ò³Îǧ¤·¤Æ¤¯¤À¤µ¤¤¡£ % etc/init.d/gfmd status ¾åµ­ºî¶È¤Ë¤è¤Ã¤ÆºîÀ®¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤ò¾Ãµî¤·¤¿¤¤¾ì¹ç¤Ë¤Ï¡¢²¼µ­¤Î¥³¥Þ¥ó¥É ¤Ç gfmd ¤ª¤è¤Ó¥Ð¥Ã¥¯¥¨¥ó¥É¥Ç¡¼¥¿¥Ù¡¼¥¹¥µ¡¼¥Ð¤òÄä»ß¤µ¤»¤¿¤Î¤Á¡¢ % etc/init.d/gfmd stop (¾ì¹ç¤Ë¤è¤Ã¤Æ¤Ï % killall gfmd) % etc/init.d/gfarm-pgsql stop (¤¢¤ë¤¤¤Ï % etc/init.d/gfarm-slapd stop) ²¼µ­¤Î¥³¥Þ¥ó¥É¤Çºï½ü¤Ç¤­¤Þ¤¹¡£ % cd $PREFIX % rm -f etc/gfarm2.conf etc/gfmd.conf % rm -f etc/gfsd.conf etc/usermap % rm -f etc/init.d/gfarm-* etc/init.d/gfmd % rm -rf var/gfarm-* ¢¦ ¥Õ¥¡¥¤¥¢¥¦¥©¡¼¥ë¤ÎÀßÄê ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¾å¤Ç¤Ï¡¤config-gfarm ¤Î -m ¥ª¥×¥·¥ç¥ó¤Ç»ØÄꤷ¤¿¥Ý¡¼¥È ¤Ë¤Ä¤¤¤Æ¡¤TCP ¤Ç¤Î¥³¥Í¥¯¥·¥ç¥ó¤ò¼õ¤±ÉÕ¤±¤ë¤è¤¦¤ËÀßÄꤷ¤Æ¤ª¤¯É¬Íפ¬¤¢¤ê ¤Þ¤¹¡¥ ¡ü ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤ÎÀßÄê =============================== ¢¦ ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤ÎÀßÄê ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Ç $PREFIX ¤¬¶¦Í­¤µ¤ì¤Æ¤¤¤Ê¤¤ ¾ì¹ç¤Ï¡¤¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤ÇÀ¸À®¤µ¤ì¤¿ $PREFIX/etc/gfarm2.conf $PREFIX/etc/gfsd.conf $PREFIX/etc/usermap ¤ò¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Î $PREFIX/etc ¤Ë¥³¥Ô¡¼¤·¤Þ¤¹¡£ ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¾å¤Ç°Ê²¼¤Î¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤·¤Æ¡¢¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼ ¥É¤ÎÀßÄê¤ò¹Ô¤¤¤Þ¤¹¡¥ % config-gfsd --prefix $PREFIX -S -p ¤Ï gfsd ¤¬ listen ¤¹¤ë¥Ý¡¼¥ÈÈÖ¹æ¤Ç¤¹¡¥¥æ¡¼¥¶¸¢¸Â¤ÇÍøÍѤ¹ ¤ë¤¿¤á¡¤1024 °Ê¾å¤Î¥Ý¡¼¥ÈÈÖ¹æ¤òÍøÍѤ¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡¥ ¤Ï TCP ¤È UDP ¤Ç³°¤«¤é¥¢¥¯¥»¥¹¤Ç¤­¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡¥ -S ¤Ï¡¤¥×¥é¥¤¥Ù¡¼¥È¤Ê Gfarm ¤ò¹½À®¤¹¤ë¤¿¤á¤Î¥ª¥×¥·¥ç¥ó¤Ç¤¹¡¥ config-gfsd ¥³¥Þ¥ó¥É¤ÎºÇ¸å¤Î°ú¿ô¤Ï Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¼ÂÂÎ¥Õ¥¡ ¥¤¥ë¤¬³ÊǼ¤µ¤ì¤ë¥¹¥×¡¼¥ë¡¦¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤¹¡¥¥¹¥×¡¼¥ë¡¦¥Ç¥£¥ì¥¯¥È¥ê¤Ï¡¤ ¾¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤È¶¦Í­¤µ¤ì¤Ê¤¤Îΰè¤ò¥Õ¥ë¥Ñ¥¹¤Ç»ØÄꤷ¤Æ¤¯¤À ¤µ¤¤¡¥¾Êά¤¹¤ë¤È¡¤$PREFIX/var/gfarm-spool ¤Ë¤Ê¤ê¤Þ¤¹¡¥ °Ê¾å¤ÇÀßÄê¤Ï´°Î»¤Ç¤¹¡£ ¾åµ­ºî¶È¤Ë¤è¤Ã¤ÆºîÀ®¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤ò¾Ãµî¤·¤¿¤¤¾ì¹ç¤Ë¤Ï¡¢ ²¼µ­¤Î¥³¥Þ¥ó¥É¤Ç gfsd ¤òÄä»ß¤µ¤»¤¿¤Î¤Á¡¢ % $PREFIX/etc/init.d/gfsd stop (¾ì¹ç¤Ë¤è¤Ã¤Æ¤Ï % killall gfsd) ²¼µ­¤Î¥³¥Þ¥ó¥É¤Çºï½ü¤Ç¤­¤Þ¤¹¡£ % rm -f $PREFIX/etc/{gfarm2,gfsd}.conf % rm -f $PREFIX/etc/init.d/gfsd % rm -rf $PREFIX/var/gfarm-spool (¤¢¤ë¤¤¤Ï»ØÄꤷ¤¿¥¹¥×¡¼¥ë¥Ç¥£¥ì¥¯¥È¥ê¤ò¾Ãµî) ¢¦ ¥Õ¥¡¥¤¥¢¥¦¥©¡¼¥ë¤ÎÀßÄê ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¾å¤Ç¤Ï¡¤config-gfsd ¤Î -p ¥ª¥×¥·¥ç¥ó¤Ç»ØÄꤷ¤¿ ¥Ý¡¼¥È¤Ë¤Ä¤¤¤Æ¡¤TCP ¤Î¥³¥Í¥¯¥·¥ç¥ó¤Î¼õ¤±ÉÕ¤±¤È¡¤UDP ¥Ñ¥±¥Ã¥È¤ÎÃå¿®¤È Á÷¿®¤¬¤Ç¤­¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡¥ ¤µ¤é¤Ë¡¤¥¯¥é¥¤¥¢¥ó¥È¥Î¡¼¥É¤ÈƱÍͤÊÀßÄê¤âɬÍפǤ¹¡£ ¡ü ¥¯¥é¥¤¥¢¥ó¥È¥Î¡¼¥É¤ÎÀßÄê =========================== Á°¾Ï¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤ÎÀßÄê¤Ë¥¯¥é¥¤¥¢¥ó¥È¥Î¡¼¥É¤ÎÀßÄê¤Ï´Þ¤Þ¤ì¤Æ ¤¤¤Þ¤¹¤¬¡¤¤³¤Î¾Ï¤Ç¤Ï¥¯¥é¥¤¥¢¥ó¥È¥Î¡¼¥É¤À¤±¤ÎÀßÄê¤òÀâÌÀ¤·¤Þ¤¹¡¥ ¢¦ ¥¯¥é¥¤¥¢¥ó¥È¥Î¡¼¥É¤ÎÀßÄê ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤ÇÀ¸À®¤µ¤ì¤¿ $PREFIX/etc/gfarm2.conf ¥Õ¥¡¥¤¥ë¤ò $PREFIX/etc ¤¢¤ë¤¤¤Ï ~/.gfarm2rc ¤Ë¥³¥Ô¡¼¤·¤Þ¤¹¡£ ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤ä¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤È¤Î´Ö¤Ç¡¢¥æ¡¼¥¶¤Î¥Û¡¼¥à¥Ç¥£¥ì ¥¯¥È¥ê¤¬ NFS ¤Ç¶¦Í­¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢°Ê¾å¤ÇÀßÄê¤Ï´°Î»¤Ç¤¹¡£ ¶¦Í­¤µ¤ì¤Æ¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢Ç§¾Ú¸°¥Õ¥¡¥¤¥ë¡Ö.gfarm_shared_key¡×¤ò¥æ¡¼¥¶ ¤Î¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê¤Ø¥³¥Ô¡¼¤·¤Þ¤¹¡£ ¢¦ ¥Õ¥¡¥¤¥¢¥¦¥©¡¼¥ë¤ÎÀßÄê ¥¯¥é¥¤¥¢¥ó¥È¥Î¡¼¥É¤Ç¤Ï¡¤config-gfarm ¤Î -m ¥ª¥×¥·¥ç¥ó¤Ç»ØÄꤷ¤¿¥Ý¡¼¥È ¤Ë¤Ä¤¤¤Æ¡¤¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤ËÂФ¹¤ë TCP ¥³¥Í¥¯¥·¥ç¥ó¤òȯ¸Æ¤Ç¤­¤ëɬÍפ¬ ¤¢¤ê¤Þ¤¹¡¥ ¤µ¤é¤Ë¡¤config-gfsd ¤Î -p ¥ª¥×¥·¥ç¥ó¤Ç»ØÄꤷ¤¿¥Ý¡¼¥È¤ËÂФ·¤Æ¡¤ ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Ø TCP ¥³¥Í¥¯¥·¥ç¥ó¤Îȯ¸Æ¤È¡¤UDP ¥Ñ¥±¥Ã¥È¤Î Á÷¼õ¿®¤¬¤Ç¤­¤ëɬÍפ⤢¤ê¤Þ¤¹¡¥ ¡ü Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ÎÍøÍѳÎǧ =================================== Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ï¡¤¥¯¥é¥¤¥¢¥ó¥È¤ÎÀßÄê¤ò¤·¤Æ¤¤¤ë¥Î¡¼¥É¤Ç¤¢¤ì¤Ð¡¤ ¤É¤Î¥Î¡¼¥É¤Ç¤âÍøÍѡʶ¦Í­¡Ë¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡¥ ¡þ gfls - ¥Ç¥£¥ì¥¯¥È¥ê¡¦¥ê¥¹¥Æ¥£¥ó¥° % gfls -la drwxrwxr-x gfarmadm gfarmadm 4 Aug 23 06:33 . drwxrwxr-x gfarmadm gfarmadm 4 Aug 23 06:33 .. drwxr-xr-x tatebe gfarmadm 0 Aug 22 16:08 tmp ¡þ gfhost - ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¾ðÊó¤Îɽ¼¨ ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤¬Àµ¤·¤¯ÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë¤«¤É¤¦¤«¡¤gfhost ¥³¥Þ¥ó¥É¤Ç ³Îǧ¤·¤Þ¤¹¡¥ % gfhost -M i386-fedora3-linux 2 linux-1.example.com 600 0 i386-fedora3-linux 2 linux-2.example.com 600 0 i386-fedora3-linux 2 linux-3.example.com 600 0 i386-redhat8.0-linux 1 linux-4.example.com 600 0 sparc-sun-solaris8 1 solaris-1.example.com 600 0 sparc-sun-solaris8 1 solaris-2.example.com 600 0 ... ¼¡¤Ë¡¤ÍøÍѲÄǽ¤«¤É¤¦¤«³Îǧ¤·¤Þ¤¹¡¥ % gfhost -lv 0.01/0.03/0.03 s i386-fedora3-linux 2 linux-1.example.com 600 0(10.0.0.1) 0.00/0.00/0.00 s i386-fedora3-linux 2 linux-2.example.com 600 0(10.0.0.2) -.--/-.--/-.-- - i386-fedora3-linux 2 linux-3.example.com 600 0(10.0.0.3) 0.00/0.02/0.00 x i386-redhat8.0-linux 1 linux-4.example.com 600 0(10.0.0.4) 0.10/0.00/0.00 G sparc-sun-solaris8 1 solaris-1.example.com 600 0(10.0.1.1) x.xx/x.xx/x.xx - sparc-sun-solaris8 1 solaris-2.example.com 600 0(10.0.1.2) ... º¸¤«¤éÆóÈÖÌܤÎʸ»ú¤¬ 's', 'g', 'G' ¤Ç¤¢¤ì¤Ð¡¤¤½¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É ¤¬ÍøÍѲÄǽ¤Ç¤¹¡¥'x' ¤Î¾ì¹ç¤Ïǧ¾Ú¤Ë¼ºÇÔ¤·¤Æ¤¤¤Þ¤¹¡¥ ¤Þ¤¿¡¤°ìÈÖº¸¤¬ '-.--/-.--/-.--' ¤Èɽ¼¨¤µ¤ì¤ë¾ì¹ç¤Ï¡¤gfsd ¤¬Àµ¤·¤¯µ¯Æ°¤· ¤Æ¤¤¤Ê¤¤¤³¤È¤ò¼¨¤·¤Æ¤ª¤ê¡¤'x.xx/x.xx/x.xx' ¤Èɽ¼¨¤µ¤ì¤ë¾ì¹ç¤Ï¡¤¤½¤Î¥Î¡¼ ¥É¤ËÀܳ¤Ç¤­¤Ê¤¤¡ÊÍî¤Á¤Æ¤¤¤ë¡Ë¤³¤È¤ò¼¨¤·¤Æ¤¤¤Þ¤¹¡¥ ¤Ê¤ª¡¤¾åµ­¥³¥Þ¥ó¥É¤Î¾ÜºÙ¤Ï¡¤man ¥Ú¡¼¥¸¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡¥ ¡ü Gfarm ¤Î¿Ê¤ó¤ÀÍøÍÑ ===================== ¢¦ ¥Õ¥¡¥¤¥ë¤ÎÊ£À½ Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç¤Ï¡¤¥Õ¥¡¥¤¥ë¤Ï¤É¤³¤«¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Ë ³ÊǼ¤µ¤ì¤Þ¤¹¤¬¡¤Æó¤Ä°Ê¾å¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Ë¥Õ¥¡¥¤¥ë¤ÎÊ£À½¤òÊÝ»ý ¤¹¤ë¤³¤È¤â¤Ç¤­¤Þ¤¹¡¥ ¥Õ¥¡¥¤¥ë¤ÎÊ£À½¤òÊÝ»ý¤¹¤ë¤³¤È¤Ë¤è¤ê¡¤¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Î¾ã³²»þ¤Ç¤â¡¤ ¥Õ¥¡¥¤¥ë¥¢¥¯¥»¥¹¤¬²Äǽ¤Ë¤Ê¤ë¾¡¤¥Õ¥¡¥¤¥ë¥¢¥¯¥»¥¹¤Îʬ»¶¤Ë¤è¤ê¥Õ¥¡¥¤¥ë¥¢ ¥¯¥»¥¹À­Ç½¤ÎÎô²½¤òËɤ°¤³¤È¤¬¤Ç¤­¤Þ¤¹¡¥ ¥Õ¥¡¥¤¥ë¤¬¤É¤³¤Ë³ÊǼ¤µ¤ì¤Æ¤¤¤ë¤«¤òÃΤ뤿¤á¤Ë¤Ï gfwhere ¥³¥Þ¥ó¥É¤òÍøÍѤ· ¤Þ¤¹¡¥ % gfwhere .bashrc linux-1.example.com ¥Õ¥¡¥¤¥ëÊ£À½¤òºîÀ®¤¹¤ë¤¿¤á¤Ë¤Ï gfrep ¥³¥Þ¥ó¥É¤¬½àÈ÷¤µ¤ì¤Æ¤¤¤Þ¤¹¡¥Î㤨¤Ð¡¤ ¤â¤¦°ì¤Ä¥Õ¥¡¥¤¥ëÊ£À½¤òºîÀ®¤·¤¿¤¤¾ì¹ç¤Ï¡¤°Ê²¼¤Î¤è¤¦¤Ë¤·¤Þ¤¹¡¥ % gfrep -s linux-1.example.com -d linux-2.example.com .bashrc % gfwhere .bashrc linux-1.example.com linux-2.example.com ¤³¤Î¾ì¹ç¡¤linux-1 ¤È linux-2 ¤Ë¡¤¥Õ¥¡¥¤¥ë¤¬Ê£À½¤µ¤ì¤Æ³ÊǼ¤µ¤ì¤Æ¤¤¤Þ¤¹¡¥ gfarm-2.4.1/doc/KNOWN_PROBLEMS.en0000644000000000000000000001741611507222722014611 0ustar rootroot*** General problems with Gfarm - On some Linux distributions, gfmd leaks memory, if ldap is specified in /etc/nsswitch.conf. This is not a bug of Gfarm itself, but a bug of system supplied libraries. The Linux distribution which this problem is observed on: CentOS 5.4 with glibc-2.5-49.x86_64.rpm CentOS 5.5 with glibc-2.5-49.el5_5.7.x86_64.rpm Countermeasure: This problem is workarounded by using nscd. - On some Linux distributions, gfarm programs and gfsd sometimes hang, if ldap is specified in /etc/nsswitch.conf. This is not a bug of Gfarm itself, but a bug of system supplied libraries. More specifically, this problem occurs when the following conditions are all satisfied: 1. A program calls fork(2) system call. 2. The program calls a function like getpwuid(3) that indirectly calls nss_ldap module before calling fork(2). 3. Both the parent process and the child process of the program call such functions after calling fork(2). 4. The program is linked with pthread library. This symptom is observed in Fedora Core 3, Fedora Core 5 and CentOS 4.4, but haven't been observed in Red Hat 8. Plans for fixes: For original vendor of the nss_ldap, please refer the following bug database: http://bugzilla.padl.com/show_bug.cgi?id=271 http://bugzilla.padl.com/show_bug.cgi?id=414 The concrete solution depends on each Linux distributon vendors. For Fedore Core Linux, please refer the following bug database: https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=154314 For Red Hat Enterprise Linux, please refer the following bug database: https://bugzilla.redhat.com/show_bug.cgi?id=474181 For Red Hat Enterprise Linux 5 and CentOS 5, nss_ldap-253-17.el5 RPM or later version may mitigate this problem, but we haven't tested it yet. Please refer RHBA-2009:0241-4 below for the changes in the RPM: http://rhn.redhat.com/errata/RHBA-2009-0241.html - Automatic replication by the extended attribute gfarm.ncopy may be canceled in some cases (for example, under a heavy load), the number of replicas remains fewer than gfarm.ncopy in such cases. Plans for fixes: We are planning a fix until March 2011. - gfs_pio_sync() doesn't really update the metadata now. Plans for fixes: Not determined yet. - When a gfsd is stopped unexpectedly while the gfsd is being used to access a file via an OPEN operation, the access stops working. You have to reopen the file to access it again. For example, this symptom happens when the filesystem node, which is running the gfsd, is rebooted. Plans for fixes: Not determined yet. - File view is not implemented. Plans for fixes: Not determined yet. - The stat API doesn't return the exact file size until the file is closed. Plans for fixes: Not determined yet. - If a program, which has already begun to use the gfarm library, makes a fork(2) system call, either the parent process or child process is allowed to call gfarm APIs. If both of them call a gfarm API, it's possible that the call won't work correctly, because requests to a gfsd server from the parent process and the child process may be mixed. This problem may occur even if the parent and the child process access different files, because the connection to the gfsd server will be shared if the connection was established before fork(2), and both files belong to the same gfsd server. Also, the child process must complete the file access before the parent process calls exit(3), if the child process accesses a file which was opened by the parent before fork(2). This is because the parent process requests a close operation from the gfsd at the time of exit(3). Thus, the access from the child process will fail after the parent process performs exit(3). Furthermore, no close request will be sent to the gfsd, when the child process performs a close operation on a file which was opened by the parent process before fork(2). Thus, it's possible that step 3 of the following scenario will fail: 1. The parent process performs fork(2) while opening many files which belong to the same gfsd. 2. The child process closes all such files. 3. The child process tries to open many files that belong to the same gfsd. This is because the close request in step 2 won't be sent to the gfsd, and the gfsd is still opening the descriptors of the files in step 1. Plans for fixes: Not determined yet. - There is no way to stop a replication process. Even if you kill a gfrep command, a network copy process cannot be stopped until the copy completes for the ongoing file fragment. The metadata for the replica won't be updated, though. Plans for fixes: Not determined yet. - The Gfarm library isn't multithread safe. Plans for fixes: Not determined yet. - The Gfarm library doesn't support a process that uses multiple user privileges with setuid(), seteuid(), setgid() or setegid(). Plans for fixes: Not determined yet. - It's known that some combinations of NFS server and NFS client sometimes make sharedsecret authentication fail. You can see whether you have this problem or not by trying the following command to see if the second field of gfhost output is "x" instead of "s". sh -c 'seq 60 | while read n; do gfkey -f; gfhost -l OTHER-HOST; done' The "OTHER-HOST" here is a remote host that shares your home directory (via NFS) with the machine from which ???on which you are invoking this command. You can work around this problem in one of the following ways: - You can use a longer expiration period of the key by using the "gfkey -f -p " command. If you specify a long enough period, key regeneration won't happen while you are running a job. The default period is 1 day. - You can use "gsi_auth" or "gsi" authentication instead of "sharedsecret". - Or, maybe you can change your NFS server to another OS. Combinations with which this symptom has been observed: NFS server: NFS client: Linux 2.6.12 (Fedora Core 4) Linux 2.4.20 (RedHat 8) Linux 2.6.12 (Fedora Core 4) Linux 2.6.9 (Fedora Core 3) Linux 2.6.12 (Fedora Core 4) Linux 2.6.11 (Fedora Core 4) Combinations with which this symptom has never been observed: NFS server: NFS client: Solaris 2.6 Linux 2.4.18 (RedHat 8) NetBSD 3.0 Linux 2.4.18 (RedHat 8) - We don't have manual pages about environment variables supported by Gfarm. Plans for fixes: Not determined yet. *** Problems with gfarm commands - The following commands are not provided yet: gfdump, gfcd, gfpwd, gfsck, gftest Plans for fixes: Not determined yet. - There is no reference manual for the following commands: config-gfarm, config-gfarm-update, config-gfsd, gfarm.arch.guess, gfexport, gfreg, gfrm, gfarm-pcp, gfarm-prun, gfquota, gfedquota, gfquotacheck, gfusage, gfvoms-sync Plans for fixes: Not determined yet. *** Problems with gfarm2fs commands - When multiple different open(2) calls are made against same file, the consistency which is usually expected in read(2)/write(2) system calls is not always achieved. This is because gfarm2fs uses distinct gfs_pio_open() call or gfs_pio_create() call for each open(2) call, and as the result, the gfarm library and the kernel network layer use different buffers for the calls. For example, database files for PostgreSQL cannot be provided by gfarm2fs due to this problem. Plans for fixes: Not determined yet. - After a ftruncate(2) system call, a read(2) system call against same file may return short size than expected. This is because FUSE uses the "getattr" entry point (instead of "fgetattr") in this case, and the read(2) size will be affected by the problem that "the stat API doesn't return the exact file size until the file is closed" which is described above. Plans for fixes: We are planning a fix. gfarm-2.4.1/include/0000755000000000000000000000000011507222730012732 5ustar rootrootgfarm-2.4.1/include/gfarm/0000755000000000000000000000000011507222730014026 5ustar rootrootgfarm-2.4.1/include/gfarm/gflog.h0000644000000000000000000000670511507222717015312 0ustar rootroot#include #include #ifndef GFARM_DEFAULT_FACILITY #define GFARM_DEFAULT_FACILITY LOG_LOCAL0 #endif #ifndef GFARM_DEFAULT_PRIORITY_LEVEL_TO_LOG #define GFARM_DEFAULT_PRIORITY_LEVEL_TO_LOG LOG_INFO #endif #ifdef __GNUC__ #define GFLOG_PRINTF_ARG(M, N) __attribute__((__format__(__printf__, M, N))) #else #define GFLOG_PRINTF_ARG(M, N) #endif #if __STDC_VERSION__ < 199901L && !defined(__func__) #if __GNUC__ >= 2 #define __func__ __FUNCTION__ #else #define __func__ "" #endif #endif #ifdef GFLOG_USE_STDARG /* to make optional to use */ void gflog_vmessage(int, int, const char *, int, const char *, const char *, va_list) GFLOG_PRINTF_ARG(6, 0); void gflog_vmessage_errno(int, int, const char *, int, const char*, const char *, va_list) GFLOG_PRINTF_ARG(6, 0); #endif void gflog_message(int, int, const char *, int, const char*, const char *, ...) GFLOG_PRINTF_ARG(6, 7); void gflog_message_errno(int, int, const char *, int, const char*, const char *, ...) GFLOG_PRINTF_ARG(6, 7); void gflog_fatal_message(int, int, const char *, int, const char*, const char *, ...) GFLOG_PRINTF_ARG(6, 7); void gflog_fatal_message_errno(int, int, const char *, int, const char*, const char *, ...) GFLOG_PRINTF_ARG(6, 7); #define gflog_error(msg_no, ...) \ gflog_message(msg_no, LOG_ERR,\ __FILE__, __LINE__, __func__, __VA_ARGS__) #define gflog_warning(msg_no, ...) \ gflog_message(msg_no, LOG_WARNING,\ __FILE__, __LINE__, __func__, __VA_ARGS__) #define gflog_notice(msg_no, ...) \ gflog_message(msg_no, LOG_NOTICE,\ __FILE__, __LINE__, __func__, __VA_ARGS__) #define gflog_info(msg_no, ...) \ gflog_message(msg_no, LOG_INFO,\ __FILE__, __LINE__, __func__, __VA_ARGS__) #define gflog_debug(msg_no, ...) \ gflog_message(msg_no, LOG_DEBUG,\ __FILE__, __LINE__, __func__, __VA_ARGS__) #define gflog_fatal(msg_no, ...) \ gflog_fatal_message(msg_no, LOG_ERR,\ __FILE__, __LINE__, __func__, __VA_ARGS__) #define gflog_auth_error(msg_no, ...)\ gflog_message(msg_no, LOG_ERR,\ __FILE__, __LINE__, __func__, __VA_ARGS__) #define gflog_auth_warning(msg_no, ...)\ gflog_message(msg_no, LOG_WARNING,\ __FILE__, __LINE__, __func__, __VA_ARGS__) #define gflog_fatal_errno(msg_no, ...) \ gflog_fatal_message_errno(msg_no, LOG_ERR,\ __FILE__, __LINE__, __func__, __VA_ARGS__) #define gflog_error_errno(msg_no, ...) \ gflog_message_errno(msg_no, LOG_ERR,\ __FILE__, __LINE__, __func__, __VA_ARGS__) #define gflog_warning_errno(msg_no, ...) \ gflog_message_errno(msg_no, LOG_WARNING,\ __FILE__, __LINE__, __func__, __VA_ARGS__) #define gflog_notice_errno(msg_no, ...) \ gflog_message_errno(msg_no, LOG_NOTICE,\ __FILE__, __LINE__, __func__, __VA_ARGS__) #define gflog_info_errno(msg_no, ...) \ gflog_message_errno(msg_no, LOG_INFO,\ __FILE__, __LINE__, __func__, __VA_ARGS__) #define gflog_debug_errno(msg_no, ...) \ gflog_message_errno(msg_no, LOG_DEBUG,\ __FILE__, __LINE__, __func__, __VA_ARGS__) void gflog_initialize(void); void gflog_terminate(void); void gflog_set_priority_level(int); void gflog_set_identifier(const char *); void gflog_set_auxiliary_info(char *); char *gflog_get_auxiliary_info(void); void gflog_syslog_open(int, int); int gflog_syslog_enabled(void); int gflog_set_message_verbose(int); int gflog_syslog_name_to_facility(const char *); int gflog_syslog_name_to_priority(const char *); /* logutil - gflog_auth_*() */ int gflog_auth_set_verbose(int); int gflog_auth_get_verbose(void); gfarm-2.4.1/include/gfarm/gfarm_misc.h0000644000000000000000000001140211507222717016311 0ustar rootroot/* * $Id: gfarm_misc.h 5015 2010-12-30 04:23:02Z n-soda $ */ #include /* * basic types */ typedef unsigned char gfarm_uint8_t; typedef unsigned short gfarm_uint16_t; typedef unsigned int gfarm_uint32_t; typedef char gfarm_int8_t; typedef short gfarm_int16_t; typedef int gfarm_int32_t; typedef gfarm_int64_t gfarm_pid_t; /* XXX - need better place */ /* * username handling * * XXX these functions do not care about a metadata server. * do not use. */ /* the return value of the following functions should be free(3)ed */ gfarm_error_t gfarm_global_to_local_username(char *, char **); gfarm_error_t gfarm_local_to_global_username(char *, char **); gfarm_error_t gfarm_global_to_local_groupname(char *, char **); gfarm_error_t gfarm_local_to_global_groupname(char *, char **); /* * the return value of the following gfarm_get_*() funtions should not be * trusted (maybe forged) on client side, because any user can forge * the name by simply setting $USER. */ gfarm_error_t gfarm_set_global_username(char *); gfarm_error_t gfarm_set_local_username(char *); gfarm_error_t gfarm_set_local_homedir(char *); char *gfarm_get_global_username(void); char *gfarm_get_local_username(void); char *gfarm_get_local_homedir(void); gfarm_error_t gfarm_set_local_user_for_this_local_account(void); gfarm_error_t gfarm_set_global_user_for_this_local_account(void); /* * gfarm.conf */ /* the following functions are for client, */ /* server/daemon process shouldn't call follows: */ gfarm_error_t gfarm_initialize(int *, char ***); gfarm_error_t gfarm_terminate(void); gfarm_error_t gfarm_config_read(void); /* the following function is for server. */ gfarm_error_t gfarm_server_initialize(void); gfarm_error_t gfarm_server_terminate(void); gfarm_error_t gfarm_server_config_read(void); void gfarm_config_set_filename(char *); /* * GFarm URL and pathname handling */ gfarm_error_t gfarm_canonical_path(const char *, char **); gfarm_error_t gfarm_canonical_path_for_creation(const char *, char **); gfarm_error_t gfarm_url_make_path(const char *, char **); gfarm_error_t gfarm_url_make_path_for_creation(const char *, char **); int gfarm_is_url(const char *); gfarm_error_t gfarm_path_canonical_to_url(const char *, char **); const char *gfarm_url_prefix_skip(const char *); gfarm_error_t gfarm_url_prefix_add(const char *); const char *gfarm_path_dir_skip(const char *); char *gfarm_path_dir(const char *); char *gfarm_url_dir(const char *); extern const char GFARM_URL_PREFIX[]; #define GFARM_URL_PREFIX_LENGTH 6 extern const char GFARM_PATH_ROOT[]; /* * File System Node Scheduling * XXX - will be separated to ? */ struct gfarm_host_sched_info; gfarm_error_t gfarm_schedule_hosts_domain_all(const char *, const char *, int *, struct gfarm_host_sched_info **); gfarm_error_t gfarm_schedule_hosts_domain_by_file( const char *, int, const char *, int *, struct gfarm_host_sched_info **); void gfarm_host_sched_info_free(int, struct gfarm_host_sched_info *); void gfarm_schedule_search_mode_use_loadavg(void); gfarm_error_t gfarm_schedule_hosts(const char *, int, struct gfarm_host_sched_info *, int, char **, int *); gfarm_error_t gfarm_schedule_hosts_to_write(const char *, int, struct gfarm_host_sched_info *, int, char **, int *); gfarm_error_t gfarm_schedule_hosts_acyclic(const char *, int, struct gfarm_host_sched_info *, int *, char **, int *); gfarm_error_t gfarm_schedule_hosts_acyclic_to_write(const char *, int, struct gfarm_host_sched_info *, int *, char **, int *); /* for debugging */ void gfarm_schedule_cache_dump(void); /* * helper functions for import */ gfarm_error_t gfarm_hostlist_read(char *, int *, char ***, int *); /* * hostspec */ int gfarm_host_is_in_domain(const char *, const char *); /* * host */ char *gfarm_host_get_self_name(void); /* * Miscellaneous */ #define GFARM_INT32STRLEN 11 /* max strlen(sprintf(s, "%d", int32)) */ #define GFARM_INT64STRLEN 22 /* max strlen(sprintf(s, "%lld", int64)) */ #define GFARM_ARRAY_LENGTH(array) (sizeof(array)/sizeof(array[0])) #define GFARM_MALLOC(p) ((p) = malloc(sizeof(*(p)))) #define GFARM_CALLOC_ARRAY(p,n) ((p) = gfarm_calloc_array((n), sizeof(*(p)))) #define GFARM_MALLOC_ARRAY(p,n) ((p) = gfarm_malloc_array((n), sizeof(*(p)))) #define GFARM_REALLOC_ARRAY(d,s,n) ((d) = gfarm_realloc_array((s), (n), sizeof(*(d)))) void *gfarm_calloc_array(size_t, size_t); void *gfarm_malloc_array(size_t, size_t); void *gfarm_realloc_array(void *, size_t, size_t); gfarm_error_t gfarm_fixedstrings_dup(int, char **, char **); void gfarm_strings_free_deeply(int, char **); int gfarm_strarray_length(char **); char **gfarm_strarray_dup(char **); void gfarm_strarray_free(char **); int gfarm_attach_debugger(void); size_t gfarm_humanize_number(char *, size_t, unsigned long long, int); #define GFARM_HUMANIZE_BINARY 1 gfarm-2.4.1/include/gfarm/host_info.h0000644000000000000000000000064011507222717016174 0ustar rootroot/* * GFarm host table: * (hostname) -> (architecture, ncpu) */ struct gfarm_host_info { char *hostname; int port; int nhostaliases; char **hostaliases; char *architecture; int ncpu; int flags; }; #define GFARM_HOST_INFO_NCPU_NOT_SET (-1) #define GFARM_HOST_INFO_FLAGS_HAS_DISK 0x00000001 void gfarm_host_info_free(struct gfarm_host_info *); void gfarm_host_info_free_all(int, struct gfarm_host_info *); gfarm-2.4.1/include/gfarm/gfs_glob.h0000644000000000000000000000072411507222717015771 0ustar rootroottypedef struct { unsigned char *array; int length, size; } gfs_glob_t; #define GFS_GLOB_ARRAY(glob) (glob).array #define GFS_GLOB_ELEM(glob, i) (glob).array[i] #define gfs_glob_length(glob) (glob)->length #define gfs_glob_elem(glob, i) \ GFS_GLOB_ELEM(*(glob), i) gfarm_error_t gfs_glob(const char *, gfarm_stringlist *, gfs_glob_t *); gfarm_error_t gfs_glob_init(gfs_glob_t *); void gfs_glob_free(gfs_glob_t *); gfarm_error_t gfs_glob_add(gfs_glob_t *, int); gfarm-2.4.1/include/gfarm/gfarm_config.h.in0000644000000000000000000001564611507222717017246 0ustar rootroot/* include/gfarm/gfarm_config.h.in. Generated from configure.ac by autoheader. */ #ifndef GFARM_CONFIG_H #define GFARM_CONFIG_H /* Define if building universal (internal helper macro) */ #undef AC_APPLE_UNIVERSAL_BUILD /* support XML extended attributs and searching by XPath */ #undef ENABLE_XMLATTR /* Define to 1 if you have the header file. */ #undef HAVE_CRYPT_H /* Define to 1 if you have the `daemon' function. */ #undef HAVE_DAEMON /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* struct dirent has d_namlen member */ #undef HAVE_D_NAMLEN /* struct dirent has d_off member */ #undef HAVE_D_OFF /* struct dirent has d_type member */ #undef HAVE_D_TYPE /* Define to 1 if epoll functions are implemented. */ #undef HAVE_EPOLL /* Define to 1 if you have the `fdatasync' function. */ #undef HAVE_FDATASYNC /* Define to 1 if you have the `fdopendir' function. */ #undef HAVE_FDOPENDIR /* Define to 1 if you have the `getdents' function. */ #undef HAVE_GETDENTS /* Define to 1 if you have the `getloadavg' function. */ #undef HAVE_GETLOADAVG /* Define to 1 if you have the `getpassphrase' function. */ #undef HAVE_GETPASSPHRASE /* 5 arguments getpwnam_r() which is compatible with SUSv2 exists */ #undef HAVE_GETPWNAM_R /* 5 arguments getspnam_r() exists */ #undef HAVE_GETSPNAM_R /* Grid Security Infrastructure exists */ #undef HAVE_GSI /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* LDAP library exists */ #undef HAVE_LDAP /* Define to 1 if you have the `ldap_memfree' function. */ #undef HAVE_LDAP_MEMFREE /* Define to 1 if you have the `ldap_perror' function. */ #undef HAVE_LDAP_PERROR /* Define to 1 if you have the `ldap_set_option' function. */ #undef HAVE_LDAP_SET_OPTION /* Define to 1 if you have the `ldap_start_tls_s' function. */ #undef HAVE_LDAP_START_TLS_S /* Define to 1 if you have the `cext' library (-lcext). */ #undef HAVE_LIBCEXT /* Define to 1 if you have the `compat' library (-lcompat). */ #undef HAVE_LIBCOMPAT /* Define to 1 if you have the `crypt' library (-lcrypt). */ #undef HAVE_LIBCRYPT /* Define to 1 if you have the `dl' library (-ldl). */ #undef HAVE_LIBDL /* Define to 1 if you have the `gen' library (-lgen). */ #undef HAVE_LIBGEN /* Define to 1 if you have the `nsl' library (-lnsl). */ #undef HAVE_LIBNSL /* Define to 1 if you have the `perfstat' library (-lperfstat). */ #undef HAVE_LIBPERFSTAT /* Define to 1 if you have the `rt' library (-lrt). */ #undef HAVE_LIBRT /* Define to 1 if you have the `socket' library (-lsocket). */ #undef HAVE_LIBSOCKET /* Define to 1 if you have the header file. */ #undef HAVE_MACHINE_ENDIAN_H /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `mkdtemp' function. */ #undef HAVE_MKDTEMP /* getaddrinfo(3) and getnameinfo(3) are MT-Safe */ #undef HAVE_MTSAFE_NETDB /* Define to 1 if you have the `poll' function. */ #undef HAVE_POLL /* PostgreSQL library exists */ #undef HAVE_POSTGRESQL /* Define to 1 if you have the `pread' function. */ #undef HAVE_PREAD /* Define to 1 if you have the `printf' function. */ #undef HAVE_PRINTF /* pthread library exists */ #undef HAVE_PTHREAD /* pthread_attr_setstacksize() exists */ #undef HAVE_PTHREAD_ATTR_SETSTACKSIZE /* Define to 1 if you have the `pwrite' function. */ #undef HAVE_PWRITE /* Define to 1 if you have the `random' function. */ #undef HAVE_RANDOM /* readline-compatible library exists */ #undef HAVE_READLINE /* Define to 1 if you have the `setlogin' function. */ #undef HAVE_SETLOGIN /* Define to 1 if you have the `setrlimit' function. */ #undef HAVE_SETRLIMIT /* Define to 1 if you have the header file. */ #undef HAVE_SHADOW_H /* Define to 1 if you have the `snprintf' function. */ #undef HAVE_SNPRINTF /* Define to 1 if you have the `statfs' function. */ #undef HAVE_STATFS /* Define to 1 if you have the `statvfs' function. */ #undef HAVE_STATVFS /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDIO_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strtoll' function. */ #undef HAVE_STRTOLL /* Define to 1 if you have the `strtoq' function. */ #undef HAVE_STRTOQ /* Define to 1 if you have the header file. */ #undef HAVE_SYS_LOADAVG_H /* sys_nerr is defined */ #undef HAVE_SYS_NERR /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* The size of `long', as computed by sizeof. */ #undef SIZEOF_LONG /* The size of `long long', as computed by sizeof. */ #undef SIZEOF_LONG_LONG /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD # if defined __BIG_ENDIAN__ # define WORDS_BIGENDIAN 1 # endif #else # ifndef WORDS_BIGENDIAN # undef WORDS_BIGENDIAN # endif #endif /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #undef YYTEXT_POINTER /* 3rd argument type of bind(2)/connect(2), if doesn't define */ #undef socklen_t /* Grid Security Infrastructure exists */ #undef HAVE_GSI /* 5 arguments getpwnam_r() which is compatible with SUSv2 exists */ #undef HAVE_GETPWNAM_R /* 5 arguments getspnam_r() exists */ #undef HAVE_GETSPNAM_R /* sys_nerr is defined */ #undef HAVE_SYS_NERR /* 3rd argument type of bind(2)/connect(2), if doesn't define */ #undef socklen_t #if SIZEOF_LONG == 8 typedef long gfarm_int64_t; typedef unsigned long gfarm_uint64_t; # define GFARM_INT64_MAX 0x7fffffffffffffffL # define GFARM_PRId64 "ld" # define gfarm_strtoi64(s, endptr) strtol(s, endptr, 0) #elif SIZEOF_LONG_LONG == 8 typedef long long gfarm_int64_t; typedef unsigned long long gfarm_uint64_t; # define GFARM_INT64_MAX 0x7fffffffffffffffLL # define GFARM_PRId64 "lld" # define gfarm_strtoi64(s, endptr) strtoll(s, endptr, 0) #else error! cannot find 64bit integer type #endif #endif /* GFARM_CONFIG_H */ gfarm-2.4.1/include/gfarm/gfarm_stringlist.h0000644000000000000000000000150011507222717017556 0ustar rootroot/* * stringlist */ typedef struct gfarm_stringlist { char **array; int length, size; } gfarm_stringlist; #define GFARM_STRINGLIST_STRARRAY(stringlist) (stringlist).array #define GFARM_STRINGLIST_ELEM(stringlist, i) (stringlist).array[i] #define gfarm_stringlist_length(stringlist) (stringlist)->length #define gfarm_stringlist_elem(stringlist, i) \ GFARM_STRINGLIST_ELEM(*(stringlist), i) gfarm_error_t gfarm_stringlist_init(gfarm_stringlist *); gfarm_error_t gfarm_stringlist_add_list(gfarm_stringlist *, gfarm_stringlist *); gfarm_error_t gfarm_stringlist_add(gfarm_stringlist *, char *); gfarm_error_t gfarm_stringlist_cat(gfarm_stringlist *, char **); void gfarm_stringlist_free(gfarm_stringlist *); void gfarm_stringlist_free_deeply(gfarm_stringlist *); char **gfarm_strings_alloc_from_stringlist(gfarm_stringlist *); gfarm-2.4.1/include/gfarm/user_info.h0000644000000000000000000000032211507222717016172 0ustar rootrootstruct gfarm_user_info { char *username; char *realname; char *homedir; char *gsi_dn; }; void gfarm_user_info_free(struct gfarm_user_info *); void gfarm_user_info_free_all(int, struct gfarm_user_info *); gfarm-2.4.1/include/gfarm/gfarm.h0000644000000000000000000000054411507222717015303 0ustar rootroot#ifdef __cplusplus extern "C" { #endif #include #include #include #include #include #include #include #include #include #include #ifdef __cplusplus } #endif gfarm-2.4.1/include/gfarm/Makefile0000644000000000000000000000062711507222717015500 0ustar rootroottop_builddir = ../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk includedir=$(default_includedir)/gfarm exec_includedir=$(default_exec_includedir)/gfarm EXEC_INCS= gfarm_config.h INCS= gfarm.h error.h gfarm_misc.h gfarm_stringlist.h gflog.h \ host_info.h user_info.h group_info.h \ gfs.h gfs_glob.h gfarm_msg_enums.h # gfs_hook.h include $(top_srcdir)/makes/include.mk gfarm-2.4.1/include/gfarm/gfs.h0000644000000000000000000003010211507222717014757 0ustar rootroot/* * $Id: gfs.h 5003 2010-12-29 22:03:52Z n-soda $ */ /* * basic types */ typedef gfarm_int64_t gfarm_time_t; struct gfarm_timespec { gfarm_time_t tv_sec; gfarm_int32_t tv_nsec; }; typedef gfarm_int64_t gfarm_off_t; typedef gfarm_uint64_t gfarm_ino_t; typedef gfarm_uint32_t gfarm_mode_t; #define GFARM_S_ALLPERM 0007777 /* all access permissions */ #define GFARM_S_IFMT 0170000 /* type of file mask */ #define GFARM_S_IFDIR 0040000 /* directory */ #define GFARM_S_IFREG 0100000 /* regular file */ #define GFARM_S_IFLNK 0120000 /* symbolic link */ #define GFARM_S_ISDIR(m) (((m) & GFARM_S_IFMT) == GFARM_S_IFDIR) #define GFARM_S_ISREG(m) (((m) & GFARM_S_IFMT) == GFARM_S_IFREG) #define GFARM_S_ISLNK(m) (((m) & GFARM_S_IFMT) == GFARM_S_IFLNK) #define GFARM_S_IS_PROGRAM(m) \ (GFARM_S_ISREG(m) && ((m) & 0111) != 0) struct gfs_stat { gfarm_ino_t st_ino; gfarm_uint64_t st_gen; gfarm_mode_t st_mode; gfarm_uint64_t st_nlink; char *st_user; char *st_group; gfarm_off_t st_size; gfarm_uint64_t st_ncopy; struct gfarm_timespec st_atimespec; struct gfarm_timespec st_mtimespec; struct gfarm_timespec st_ctimespec; }; /* * File/Directory operations */ #if 0 /* not yet on Gfarm v2 */ typedef struct gfs_desc *GFS_Desc; gfarm_error_t gfs_desc_create(const char *, int, gfarm_mode_t, GFS_Desc *); gfarm_error_t gfs_desc_open(const char *, int, GFS_Desc *); gfarm_error_t gfs_desc_close(GFS_Desc); int gfs_desc_fileno(GFS_Desc); #endif /* not yet on Gfarm v2 */ #define GFARM_FILE_RDONLY 0 #define GFARM_FILE_WRONLY 1 #define GFARM_FILE_RDWR 2 #define GFARM_FILE_ACCMODE 3 /* RD/WR/RDWR mode mask */ #ifdef GFARM_INTERNAL_USE /* internal use only */ #define GFARM_FILE_LOOKUP 3 #define GFARM_FILE_CREATE 0x00000200 #endif #define GFARM_FILE_TRUNC 0x00000400 #if 0 /* not yet on Gfarm v2 */ #define GFARM_FILE_APPEND 0x00000800 #define GFARM_FILE_EXCLUSIVE 0x00001000 #endif #ifdef GFARM_INTERNAL_USE /* internal use only */ #define GFARM_FILE_TRUNC_PENDING 0x00800000 /* used by gfmd only */ #endif #if 0 /* the followings are just hints */ #define GFARM_FILE_SEQUENTIAL 0x01000000 #define GFARM_FILE_REPLICATE 0x02000000 #define GFARM_FILE_NOT_REPLICATE 0x04000000 #define GFARM_FILE_NOT_RETRY 0x08000000 #endif #define GFARM_FILE_UNBUFFERED 0x10000000 #define GFARM_FILE_CREATE_REPLICA 0x20000000 #ifdef GFARM_INTERNAL_USE /* internal use only */ #define GFARM_FILE_BEQUEATHED 0x40000000 #define GFARM_FILE_CKSUM_INVALIDATED 0x80000000 #if 0 /* not yet on Gfarm v2 */ #define GFARM_FILE_USER_MODE (GFARM_FILE_ACCMODE|GFARM_FILE_TRUNC| \ GFARM_FILE_APPEND|GFARM_FILE_EXCLUSIVE|GFARM_FILE_SEQUENTIAL| \ GFARM_FILE_REPLICATE|GFARM_FILE_NOT_REPLICATE| \ GFARM_FILE_UNBUFFERED) #else #define GFARM_FILE_USER_MODE (GFARM_FILE_ACCMODE|GFARM_FILE_TRUNC| \ GFARM_FILE_UNBUFFERED|GFARM_FILE_CREATE_REPLICA) #endif /* not yet on Gfarm v2 */ #endif /* GFARM_INTERNAL_USE */ #if 0 /* not yet on Gfarm v2 */ gfarm_error_t gfs_desc_seek(GFS_Desc, gfarm_off_t, int, gfarm_off_t *); #endif /* not yet on Gfarm v2 */ #define GFARM_SEEK_SET 0 #define GFARM_SEEK_CUR 1 #define GFARM_SEEK_END 2 #if 0 /* not yet on Gfarm v2 */ gfarm_error_t gfs_desc_chown(GFS_Desc, char *, char *); gfarm_error_t gfs_desc_chmod(GFS_Desc, gfarm_mode_t); gfarm_error_t gfs_desc_utimes(GFS_Desc, const struct gfarm_timespec *); gfarm_error_t gfs_desc_stat(GFS_Desc, struct gfs_stat *); #endif /* not yet on Gfarm v2 */ void gfs_stat_free(struct gfs_stat *); gfarm_error_t gfs_stat_copy(struct gfs_stat *, const struct gfs_stat *); void gfs_client_connection_gc(void); /* * File operations */ typedef struct gfs_file *GFS_File; gfarm_error_t gfs_pio_open(const char *, int, GFS_File *); gfarm_error_t gfs_pio_create(const char *, int, gfarm_mode_t mode, GFS_File *); #if 0 /* not yet on Gfarm v2 */ gfarm_error_t gfs_pio_set_local(int, int); gfarm_error_t gfs_pio_set_local_check(void); gfarm_error_t gfs_pio_get_node_rank(int *); gfarm_error_t gfs_pio_get_node_size(int *); gfarm_error_t gfs_pio_set_view_local(GFS_File, int); gfarm_error_t gfs_pio_set_view_index(GFS_File, int, int, char *, int); gfarm_error_t gfs_pio_set_view_section(GFS_File, const char *, char *, int); gfarm_error_t gfs_pio_set_view_global(GFS_File, int); /* as total fragment number */ #define GFARM_FILE_DONTCARE (-1) #endif gfarm_error_t gfs_pio_close(GFS_File); int gfs_pio_eof(GFS_File); gfarm_error_t gfs_pio_error(GFS_File); void gfs_pio_clearerr(GFS_File); #if 0 /* not yet on Gfarm v2 */ gfarm_error_t gfs_pio_get_nfragment(GFS_File, int *); #endif gfarm_error_t gfs_pio_seek(GFS_File, gfarm_off_t, int, gfarm_off_t *); gfarm_error_t gfs_pio_read(GFS_File, void *, int, int *); gfarm_error_t gfs_pio_write(GFS_File, const void *, int, int *); gfarm_error_t gfs_pio_flush(GFS_File); gfarm_error_t gfs_pio_sync(GFS_File); gfarm_error_t gfs_pio_datasync(GFS_File); gfarm_error_t gfs_pio_truncate(GFS_File, gfarm_off_t); int gfs_pio_getc(GFS_File); int gfs_pio_ungetc(GFS_File, int); gfarm_error_t gfs_pio_putc(GFS_File, int); gfarm_error_t gfs_pio_puts(GFS_File, const char *); gfarm_error_t gfs_pio_gets(GFS_File, char *, size_t); gfarm_error_t gfs_pio_getline(GFS_File, char *, size_t, int *); gfarm_error_t gfs_pio_putline(GFS_File, const char *); gfarm_error_t gfs_pio_readline(GFS_File, char **, size_t *, size_t *); gfarm_error_t gfs_pio_readdelim(GFS_File, char **, size_t *, size_t *, const char *, size_t); gfarm_error_t gfs_pio_stat(GFS_File, struct gfs_stat *); /* * Directory operations */ #define GFS_MAXNAMLEN 255 struct gfs_dirent { gfarm_ino_t d_fileno; unsigned short d_reclen; unsigned char d_type; unsigned char d_namlen; char d_name[GFS_MAXNAMLEN + 1]; }; /* File types */ #define GFS_DT_UNKNOWN 0 /* gfs_hook.c depends on it that this is 0 */ #define GFS_DT_DIR 4 #define GFS_DT_REG 8 #define GFS_DT_LNK 10 int gfs_mode_to_type(gfarm_mode_t); typedef struct gfs_dir *GFS_Dir; gfarm_error_t gfs_opendir(const char *, GFS_Dir *); gfarm_error_t gfs_closedir(GFS_Dir); gfarm_error_t gfs_seekdir(GFS_Dir, gfarm_off_t); gfarm_error_t gfs_telldir(GFS_Dir, gfarm_off_t *); gfarm_error_t gfs_readdir(GFS_Dir, struct gfs_dirent **); typedef struct gfs_dirplus *GFS_DirPlus; gfarm_error_t gfs_opendirplus(const char *, GFS_DirPlus *); gfarm_error_t gfs_closedirplus(GFS_DirPlus); gfarm_error_t gfs_readdirplus(GFS_DirPlus, struct gfs_dirent **, struct gfs_stat **); gfarm_error_t gfs_realpath(const char *, char **); /* * Symbolic link operations */ gfarm_error_t gfs_symlink(const char *, const char *); gfarm_error_t gfs_readlink(const char *, char **); /* * Meta operations */ gfarm_error_t gfs_remove(const char *); /* XXX shouldn't be exported? */ gfarm_error_t gfs_unlink(const char *); #if 0 /* not yet on Gfarm v2 */ gfarm_error_t gfs_unlink_section(const char *, const char *); gfarm_error_t gfs_unlink_section_replica(const char *, const char *, int, char **, int); gfarm_error_t gfs_unlink_replicas_on_host(const char *, const char *, int); #endif gfarm_error_t gfs_mkdir(const char *, gfarm_mode_t); gfarm_error_t gfs_rmdir(const char *); gfarm_error_t gfs_chdir(const char *); gfarm_error_t gfs_getcwd(char *, int); gfarm_error_t gfs_chown(const char *, const char *, const char *); gfarm_error_t gfs_chmod(const char *, gfarm_mode_t); gfarm_error_t gfs_link(const char *, const char *); gfarm_error_t gfs_utimes(const char *, const struct gfarm_timespec *); gfarm_error_t gfs_rename(const char *, const char *); gfarm_error_t gfs_stat(const char *, struct gfs_stat *); gfarm_error_t gfs_lstat(const char *, struct gfs_stat *); gfarm_error_t gfs_fstat(GFS_File, struct gfs_stat *); #if 0 gfarm_error_t gfs_stat_section(const char *, const char *, struct gfs_stat *); gfarm_error_t gfs_stat_index(char *, int, struct gfs_stat *); #endif gfarm_error_t gfs_access(const char *, int); #define GFS_F_OK 0 #define GFS_X_OK 1 #define GFS_W_OK 2 #define GFS_R_OK 4 /* 5th argument (flags) of gfs_setxattr() and gfs_fsetxattr() */ #define GFS_XATTR_CREATE 0x1 /* set value, fail if attr already exists */ #define GFS_XATTR_REPLACE 0x2 /* set value, fail if attr does not exist */ gfarm_error_t gfs_setxattr(const char *path, const char *name, const void *value, size_t size, int flags); gfarm_error_t gfs_getxattr(const char *path, const char *name, void *value, size_t *size); gfarm_error_t gfs_listxattr(const char *path, char *list, size_t *size); gfarm_error_t gfs_removexattr(const char *path, const char *name); gfarm_error_t gfs_fsetxattr(GFS_File gf, const char *name, const void *value, size_t size, int flags); gfarm_error_t gfs_fgetxattr(GFS_File gf, const char *name, void *value, size_t *size); gfarm_error_t gfs_fremovexattr(GFS_File gf, const char *name); gfarm_error_t gfs_setxmlattr(const char *path, const char *name, const void *value, size_t size, int flags); gfarm_error_t gfs_getxmlattr(const char *path, const char *name, void *value, size_t *size); gfarm_error_t gfs_listxmlattr(const char *path, char *list, size_t *size); gfarm_error_t gfs_removexmlattr(const char *path, const char *name); struct gfs_xmlattr_ctx; gfarm_error_t gfs_findxmlattr(const char *path, const char *expr, int depth, struct gfs_xmlattr_ctx **ctxpp); gfarm_error_t gfs_getxmlent(struct gfs_xmlattr_ctx *ctxp, char **fpathp, char **namep); gfarm_error_t gfs_closexmlattr(struct gfs_xmlattr_ctx *ctxp); gfarm_error_t gfs_replicate_to(char *, char *, int); gfarm_error_t gfs_replicate_from_to(char *, char *, int, char *, int); gfarm_error_t gfs_migrate_to(char *, char *, int); gfarm_error_t gfs_migrate_from_to(char *, char *, int, char *, int); #define GFS_REPLICATE_FILE_FORCE 1 /* no BUSY */ #ifdef GFARM_INTERNAL_USE /* internal use only */ #define GFS_REPLICATE_FILE_WAIT 2 #define GFS_REPLICATE_FILE_MIGRATE 4 #endif gfarm_error_t gfs_replicate_file_from_to_request( const char *, const char *, const char *, int); gfarm_error_t gfs_replicate_file_to_request(const char *, const char *, int); gfarm_error_t gfs_replicate_file_from_to( const char *, const char *, const char *, int); gfarm_error_t gfs_replicate_file_to(const char *, const char *, int); #define GFS_REPLICA_INFO_INCLUDING_DEAD_HOST 1 #define GFS_REPLICA_INFO_INCLUDING_INCOMPLETE_COPY 2 #define GFS_REPLICA_INFO_INCLUDING_DEAD_COPY 4 struct gfs_replica_info; gfarm_error_t gfs_replica_info_by_name(const char *, int, struct gfs_replica_info **); int gfs_replica_info_number(struct gfs_replica_info *); const char *gfs_replica_info_nth_host(struct gfs_replica_info *, int); gfarm_uint64_t gfs_replica_info_nth_gen(struct gfs_replica_info *, int); int gfs_replica_info_nth_is_incomplete(struct gfs_replica_info *, int); int gfs_replica_info_nth_is_dead_host(struct gfs_replica_info *, int); int gfs_replica_info_nth_is_dead_copy(struct gfs_replica_info *, int); void gfs_replica_info_free(struct gfs_replica_info *); gfarm_error_t gfs_replica_list_by_name(const char *, int *, char ***); gfarm_error_t gfs_replica_remove_by_file(const char *, const char *); gfarm_error_t gfs_replicate_to_local(GFS_File, char *, int); #if 0 gfarm_error_t gfs_execve(const char *, char *const *, char *const *); #endif gfarm_error_t gfs_statfs(gfarm_off_t *, gfarm_off_t *, gfarm_off_t *); gfarm_error_t gfs_statfsnode(char *, int, gfarm_int32_t *, gfarm_off_t *, gfarm_off_t *, gfarm_off_t *, gfarm_off_t *, gfarm_off_t *, gfarm_off_t *); /* * Client-side Metadata cache (preliminary version) */ void gfs_stat_cache_enable(int); /* enabled by default */ gfarm_error_t gfs_stat_cache_init(void); void gfs_stat_cache_clear(void); void gfs_stat_cache_expire(void); void gfs_stat_cache_expiration_set(long); /* per milli-second */ gfarm_error_t gfs_stat_cache_purge(const char *); gfarm_error_t gfs_stat_cached(const char *, struct gfs_stat *); gfarm_error_t gfs_stat_caching(const char *, struct gfs_stat *); gfarm_error_t gfs_lstat_cached(const char *, struct gfs_stat *); gfarm_error_t gfs_lstat_caching(const char *, struct gfs_stat *); gfarm_error_t gfs_getxattr_cached(const char *path, const char *name, void *value, size_t *size); gfarm_error_t gfs_getxattr_caching(const char *path, const char *name, void *value, size_t *size); int gfarm_xattr_caching(const char *); gfarm_error_t gfarm_xattr_caching_pattern_add(const char *); gfarm_error_t gfs_opendir_caching(const char *, GFS_Dir *); gfarm-2.4.1/include/gfarm/group_info.h0000644000000000000000000000050211507222717016350 0ustar rootrootstruct gfarm_group_info { char *groupname; int nusers; char **usernames; }; struct gfarm_group_names { int ngroups; char **groupnames; }; void gfarm_group_info_free(struct gfarm_group_info *); void gfarm_group_info_free_all(int, struct gfarm_group_info *); void gfarm_group_names_free(struct gfarm_group_names *); gfarm-2.4.1/include/gfarm/error.h0000644000000000000000000001052711507222717015342 0ustar rootroot/* * address constants which represents error conditions * * $Id: error.h 4647 2010-04-13 09:45:35Z n-soda $ */ /* * DO NOT ADD NEW ERROR AT MIDDLE OF THIS DEFINITION. * ADD IT AT THE END OF THIS LIST. */ enum gfarm_errcode { /* 0 */ GFARM_ERR_NO_ERROR, /* classic errno (1..10) */ /* 1 */ GFARM_ERR_OPERATION_NOT_PERMITTED, /* forbidden entirely */ /* 2 */ GFARM_ERR_NO_SUCH_FILE_OR_DIRECTORY, /* 3 */ GFARM_ERR_NO_SUCH_PROCESS, /* 4 */ GFARM_ERR_INTERRUPTED_SYSTEM_CALL, /* 5 */ GFARM_ERR_INPUT_OUTPUT, /* 6 */ GFARM_ERR_DEVICE_NOT_CONFIGURED, /* 7 */ GFARM_ERR_ARGUMENT_LIST_TOO_LONG, /* 8 */ GFARM_ERR_EXEC_FORMAT, /* 9 */ GFARM_ERR_BAD_FILE_DESCRIPTOR, /* 10 */ GFARM_ERR_NO_CHILD_PROCESS, /* non classic, POSIX (EAGAIN == EWOULDBLOCK) */ /* 11 */ GFARM_ERR_RESOURCE_TEMPORARILY_UNAVAILABLE, /* classic errno (12..34) */ /* 12 */ GFARM_ERR_NO_MEMORY, /* 13 */ GFARM_ERR_PERMISSION_DENIED, /* prohibited by access control */ /* 14 */ GFARM_ERR_BAD_ADDRESS, /* 15 */ GFARM_ERR_BLOCK_DEVICE_REQUIRED, /* non POSIX, non X/Open */ /* 16 */ GFARM_ERR_DEVICE_BUSY, /* 17 */ GFARM_ERR_ALREADY_EXISTS, /* 18 */ GFARM_ERR_CROSS_DEVICE_LINK, /* 19 */ GFARM_ERR_OPERATION_NOT_SUPPORTED_BY_DEVICE, /* 20 */ GFARM_ERR_NOT_A_DIRECTORY, /* 21 */ GFARM_ERR_IS_A_DIRECTORY, /* 22 */ GFARM_ERR_INVALID_ARGUMENT, /* 23 */ GFARM_ERR_TOO_MANY_OPEN_FILES_IN_SYSTEM, /* 24 */ GFARM_ERR_TOO_MANY_OPEN_FILES, /* 25 */ GFARM_ERR_INAPPROPRIATE_IOCTL_FOR_DEVICE, /* 26 */ GFARM_ERR_TEXT_FILE_BUSY, /* non POSIX */ /* 27 */ GFARM_ERR_FILE_TOO_LARGE, /* 28 */ GFARM_ERR_NO_SPACE, /* 29 */ GFARM_ERR_ILLEGAL_SEEK, /* 30 */ GFARM_ERR_READ_ONLY_FILE_SYSTEM, /* 31 */ GFARM_ERR_TOO_MANY_LINKS, /* 32 */ GFARM_ERR_BROKEN_PIPE, /* 33 */ GFARM_ERR_NUMERICAL_ARGUMENT_OUT_OF_DOMAIN, /* 34 */ GFARM_ERR_RESULT_OUT_OF_RANGE, /* ISO-C standard amendment, wide/multibyte-character handling */ /* 35 */ GFARM_ERR_ILLEGAL_BYTE_SEQUENCE, /* POSIX */ /* 36 */ GFARM_ERR_RESOURCE_DEADLOCK_AVOIDED, GFARM_ERR_FILE_NAME_TOO_LONG, GFARM_ERR_DIRECTORY_NOT_EMPTY, GFARM_ERR_NO_LOCKS_AVAILABLE, GFARM_ERR_FUNCTION_NOT_IMPLEMENTED, /* X/Open */ GFARM_ERR_OPERATION_NOW_IN_PROGRESS, GFARM_ERR_OPERATION_ALREADY_IN_PROGRESS, /* X/Open - ipc/network software -- argument errors */ GFARM_ERR_SOCKET_OPERATION_ON_NON_SOCKET, GFARM_ERR_DESTINATION_ADDRESS_REQUIRED, GFARM_ERR_MESSAGE_TOO_LONG, GFARM_ERR_PROTOCOL_WRONG_TYPE_FOR_SOCKET, GFARM_ERR_PROTOCOL_NOT_AVAILABLE, GFARM_ERR_PROTOCOL_NOT_SUPPORTED, GFARM_ERR_OPERATION_NOT_SUPPORTED, GFARM_ERR_ADDRESS_FAMILY_NOT_SUPPORTED_BY_PROTOCOL_FAMILY, GFARM_ERR_ADDRESS_ALREADY_IN_USE, GFARM_ERR_CANNOT_ASSIGN_REQUESTED_ADDRESS, /* X/Open - ipc/network software -- operational errors */ GFARM_ERR_NETWORK_IS_DOWN, GFARM_ERR_NETWORK_IS_UNREACHABLE, GFARM_ERR_CONNECTION_ABORTED, GFARM_ERR_CONNECTION_RESET_BY_PEER, GFARM_ERR_NO_BUFFER_SPACE_AVAILABLE, GFARM_ERR_SOCKET_IS_ALREADY_CONNECTED, GFARM_ERR_SOCKET_IS_NOT_CONNECTED, GFARM_ERR_OPERATION_TIMED_OUT, GFARM_ERR_CONNECTION_REFUSED, GFARM_ERR_NO_ROUTE_TO_HOST, /* X/Open */ GFARM_ERR_TOO_MANY_LEVELS_OF_SYMBOLIC_LINK, GFARM_ERR_DISK_QUOTA_EXCEEDED, GFARM_ERR_STALE_FILE_HANDLE, /* X/Open - System-V IPC */ GFARM_ERR_IDENTIFIER_REMOVED, GFARM_ERR_NO_MESSAGE_OF_DESIRED_TYPE, GFARM_ERR_VALUE_TOO_LARGE_TO_BE_STORED_IN_DATA_TYPE, /* ipc/network errors */ GFARM_ERR_AUTHENTICATION, GFARM_ERR_EXPIRED, GFARM_ERR_PROTOCOL, /* gfarm specific errors */ GFARM_ERR_UNKNOWN_HOST, GFARM_ERR_CANNOT_RESOLVE_AN_IP_ADDRESS_INTO_A_HOSTNAME, GFARM_ERR_NO_SUCH_OBJECT, GFARM_ERR_CANT_OPEN, GFARM_ERR_UNEXPECTED_EOF, GFARM_ERR_GFARM_URL_PREFIX_IS_MISSING, GFARM_ERR_TOO_MANY_JOBS, GFARM_ERR_FILE_MIGRATED, GFARM_ERR_NOT_A_SYMBOLIC_LINK, GFARM_ERR_IS_A_SYMBOLIC_LINK, GFARM_ERR_UNKNOWN, GFARM_ERR_INVALID_FILE_REPLICA, GFARM_ERR_NO_SUCH_USER, GFARM_ERR_CANNOT_REMOVE_LAST_REPLICA, GFARM_ERR_NO_SUCH_GROUP, GFARM_ERR_GFARM_URL_USER_IS_MISSING, GFARM_ERR_GFARM_URL_HOST_IS_MISSING, GFARM_ERR_GFARM_URL_PORT_IS_MISSING, GFARM_ERR_GFARM_URL_PORT_IS_INVALID, GFARM_ERR_FILE_BUSY, GFARM_ERR_NUMBER }; /* enum gfarm_errcode | enum gfarm_errmsg | enum gfarm_errstat */ typedef int gfarm_error_t; const char *gfarm_error_string(gfarm_error_t); gfarm_error_t gfarm_errno_to_error(int); /* for gfs_hook */ int gfarm_error_to_errno(gfarm_error_t); gfarm-2.4.1/include/gfarm/gfarm_msg_enums.h0000644000000000000000000024725111507222717017370 0ustar rootroot#define GFARM_MSG_UNUSED 0 #define GFARM_MSG_UNFIXED 1000000 #define GFARM_MSG_1000001 1000001 #define GFARM_MSG_1000002 1000002 #define GFARM_MSG_1000003 1000003 #define GFARM_MSG_1000004 1000004 #define GFARM_MSG_1000005 1000005 #define GFARM_MSG_1000006 1000006 #define GFARM_MSG_1000007 1000007 #define GFARM_MSG_1000008 1000008 #define GFARM_MSG_1000009 1000009 #define GFARM_MSG_1000010 1000010 #define GFARM_MSG_1000011 1000011 #define GFARM_MSG_1000012 1000012 #define GFARM_MSG_1000013 1000013 #define GFARM_MSG_1000014 1000014 #define GFARM_MSG_1000015 1000015 #define GFARM_MSG_1000016 1000016 #define GFARM_MSG_1000017 1000017 #define GFARM_MSG_1000018 1000018 #define GFARM_MSG_1000019 1000019 #define GFARM_MSG_1000020 1000020 #define GFARM_MSG_1000021 1000021 #define GFARM_MSG_1000022 1000022 #define GFARM_MSG_1000023 1000023 #define GFARM_MSG_1000024 1000024 #define GFARM_MSG_1000025 1000025 #define GFARM_MSG_1000026 1000026 #define GFARM_MSG_1000027 1000027 #define GFARM_MSG_1000028 1000028 #define GFARM_MSG_1000029 1000029 #define GFARM_MSG_1000030 1000030 #define GFARM_MSG_1000031 1000031 #define GFARM_MSG_1000032 1000032 #define GFARM_MSG_1000033 1000033 #define GFARM_MSG_1000034 1000034 #define GFARM_MSG_1000035 1000035 #define GFARM_MSG_1000036 1000036 #define GFARM_MSG_1000037 1000037 #define GFARM_MSG_1000038 1000038 #define GFARM_MSG_1000039 1000039 #define GFARM_MSG_1000040 1000040 #define GFARM_MSG_1000041 1000041 #define GFARM_MSG_1000042 1000042 #define GFARM_MSG_1000043 1000043 #define GFARM_MSG_1000044 1000044 #define GFARM_MSG_1000045 1000045 #define GFARM_MSG_1000046 1000046 #define GFARM_MSG_1000047 1000047 #define GFARM_MSG_1000048 1000048 #define GFARM_MSG_1000049 1000049 #define GFARM_MSG_1000050 1000050 #define GFARM_MSG_1000051 1000051 #define GFARM_MSG_1000052 1000052 #define GFARM_MSG_1000053 1000053 #define GFARM_MSG_1000054 1000054 #define GFARM_MSG_1000055 1000055 #define GFARM_MSG_1000056 1000056 #define GFARM_MSG_1000057 1000057 #define GFARM_MSG_1000058 1000058 #define GFARM_MSG_1000059 1000059 #define GFARM_MSG_1000060 1000060 #define GFARM_MSG_1000061 1000061 #define GFARM_MSG_1000062 1000062 #define GFARM_MSG_1000063 1000063 #define GFARM_MSG_1000064 1000064 #define GFARM_MSG_1000065 1000065 #define GFARM_MSG_1000066 1000066 #define GFARM_MSG_1000067 1000067 #define GFARM_MSG_1000068 1000068 #define GFARM_MSG_1000069 1000069 #define GFARM_MSG_1000070 1000070 #define GFARM_MSG_1000071 1000071 #define GFARM_MSG_1000072 1000072 #define GFARM_MSG_1000073 1000073 #define GFARM_MSG_1000074 1000074 #define GFARM_MSG_1000075 1000075 #define GFARM_MSG_1000076 1000076 #define GFARM_MSG_1000077 1000077 #define GFARM_MSG_1000078 1000078 #define GFARM_MSG_1000079 1000079 #define GFARM_MSG_1000080 1000080 #define GFARM_MSG_1000081 1000081 #define GFARM_MSG_1000082 1000082 #define GFARM_MSG_1000083 1000083 #define GFARM_MSG_1000084 1000084 #define GFARM_MSG_1000085 1000085 #define GFARM_MSG_1000086 1000086 #define GFARM_MSG_1000087 1000087 #define GFARM_MSG_1000088 1000088 #define GFARM_MSG_1000089 1000089 #define GFARM_MSG_1000090 1000090 #define GFARM_MSG_1000091 1000091 #define GFARM_MSG_1000092 1000092 #define GFARM_MSG_1000093 1000093 #define GFARM_MSG_1000094 1000094 #define GFARM_MSG_1000095 1000095 #define GFARM_MSG_1000096 1000096 #define GFARM_MSG_1000097 1000097 #define GFARM_MSG_1000098 1000098 #define GFARM_MSG_1000099 1000099 #define GFARM_MSG_1000100 1000100 #define GFARM_MSG_1000101 1000101 #define GFARM_MSG_1000102 1000102 #define GFARM_MSG_1000103 1000103 #define GFARM_MSG_1000104 1000104 #define GFARM_MSG_1000105 1000105 #define GFARM_MSG_1000106 1000106 #define GFARM_MSG_1000107 1000107 #define GFARM_MSG_1000108 1000108 #define GFARM_MSG_1000109 1000109 #define GFARM_MSG_1000110 1000110 #define GFARM_MSG_1000111 1000111 #define GFARM_MSG_1000112 1000112 #define GFARM_MSG_1000113 1000113 #define GFARM_MSG_1000114 1000114 #define GFARM_MSG_1000115 1000115 #define GFARM_MSG_1000116 1000116 #define GFARM_MSG_1000117 1000117 #define GFARM_MSG_1000118 1000118 #define GFARM_MSG_1000119 1000119 #define GFARM_MSG_1000120 1000120 #define GFARM_MSG_1000121 1000121 #define GFARM_MSG_1000122 1000122 #define GFARM_MSG_1000123 1000123 #define GFARM_MSG_1000124 1000124 #define GFARM_MSG_1000125 1000125 #define GFARM_MSG_1000126 1000126 #define GFARM_MSG_1000127 1000127 #define GFARM_MSG_1000128 1000128 #define GFARM_MSG_1000129 1000129 #define GFARM_MSG_1000130 1000130 #define GFARM_MSG_1000131 1000131 #define GFARM_MSG_1000132 1000132 #define GFARM_MSG_1000133 1000133 #define GFARM_MSG_1000134 1000134 #define GFARM_MSG_1000135 1000135 #define GFARM_MSG_1000136 1000136 #define GFARM_MSG_1000137 1000137 #define GFARM_MSG_1000138 1000138 #define GFARM_MSG_1000139 1000139 #define GFARM_MSG_1000140 1000140 #define GFARM_MSG_1000141 1000141 #define GFARM_MSG_1000142 1000142 #define GFARM_MSG_1000143 1000143 #define GFARM_MSG_1000144 1000144 #define GFARM_MSG_1000145 1000145 #define GFARM_MSG_1000146 1000146 #define GFARM_MSG_1000147 1000147 #define GFARM_MSG_1000148 1000148 #define GFARM_MSG_1000149 1000149 #define GFARM_MSG_1000150 1000150 #define GFARM_MSG_1000151 1000151 #define GFARM_MSG_1000152 1000152 #define GFARM_MSG_1000153 1000153 #define GFARM_MSG_1000154 1000154 #define GFARM_MSG_1000155 1000155 #define GFARM_MSG_1000156 1000156 #define GFARM_MSG_1000157 1000157 #define GFARM_MSG_1000158 1000158 #define GFARM_MSG_1000159 1000159 #define GFARM_MSG_1000160 1000160 #define GFARM_MSG_1000161 1000161 #define GFARM_MSG_1000162 1000162 #define GFARM_MSG_1000163 1000163 #define GFARM_MSG_1000164 1000164 #define GFARM_MSG_1000165 1000165 #define GFARM_MSG_1000166 1000166 #define GFARM_MSG_1000167 1000167 #define GFARM_MSG_1000168 1000168 #define GFARM_MSG_1000169 1000169 #define GFARM_MSG_1000170 1000170 #define GFARM_MSG_1000171 1000171 #define GFARM_MSG_1000172 1000172 #define GFARM_MSG_1000173 1000173 #define GFARM_MSG_1000174 1000174 #define GFARM_MSG_1000175 1000175 #define GFARM_MSG_1000176 1000176 #define GFARM_MSG_1000177 1000177 #define GFARM_MSG_1000178 1000178 #define GFARM_MSG_1000179 1000179 #define GFARM_MSG_1000180 1000180 #define GFARM_MSG_1000181 1000181 #define GFARM_MSG_1000182 1000182 #define GFARM_MSG_1000183 1000183 #define GFARM_MSG_1000184 1000184 #define GFARM_MSG_1000185 1000185 #define GFARM_MSG_1000186 1000186 #define GFARM_MSG_1000187 1000187 #define GFARM_MSG_1000188 1000188 #define GFARM_MSG_1000189 1000189 #define GFARM_MSG_1000190 1000190 #define GFARM_MSG_1000191 1000191 #define GFARM_MSG_1000192 1000192 #define GFARM_MSG_1000193 1000193 #define GFARM_MSG_1000194 1000194 #define GFARM_MSG_1000195 1000195 #define GFARM_MSG_1000196 1000196 #define GFARM_MSG_1000197 1000197 #define GFARM_MSG_1000198 1000198 #define GFARM_MSG_1000199 1000199 #define GFARM_MSG_1000200 1000200 #define GFARM_MSG_1000201 1000201 #define GFARM_MSG_1000202 1000202 #define GFARM_MSG_1000203 1000203 #define GFARM_MSG_1000204 1000204 #define GFARM_MSG_1000205 1000205 #define GFARM_MSG_1000206 1000206 #define GFARM_MSG_1000207 1000207 #define GFARM_MSG_1000208 1000208 #define GFARM_MSG_1000209 1000209 #define GFARM_MSG_1000210 1000210 #define GFARM_MSG_1000211 1000211 #define GFARM_MSG_1000212 1000212 #define GFARM_MSG_1000213 1000213 #define GFARM_MSG_1000214 1000214 #define GFARM_MSG_1000215 1000215 #define GFARM_MSG_1000216 1000216 #define GFARM_MSG_1000217 1000217 #define GFARM_MSG_1000218 1000218 #define GFARM_MSG_1000219 1000219 #define GFARM_MSG_1000220 1000220 #define GFARM_MSG_1000221 1000221 #define GFARM_MSG_1000222 1000222 #define GFARM_MSG_1000223 1000223 #define GFARM_MSG_1000224 1000224 #define GFARM_MSG_1000225 1000225 #define GFARM_MSG_1000226 1000226 #define GFARM_MSG_1000227 1000227 #define GFARM_MSG_1000228 1000228 #define GFARM_MSG_1000229 1000229 #define GFARM_MSG_1000230 1000230 #define GFARM_MSG_1000231 1000231 #define GFARM_MSG_1000232 1000232 #define GFARM_MSG_1000233 1000233 #define GFARM_MSG_1000234 1000234 #define GFARM_MSG_1000235 1000235 #define GFARM_MSG_1000236 1000236 #define GFARM_MSG_1000237 1000237 #define GFARM_MSG_1000238 1000238 #define GFARM_MSG_1000239 1000239 #define GFARM_MSG_1000240 1000240 #define GFARM_MSG_1000241 1000241 #define GFARM_MSG_1000242 1000242 #define GFARM_MSG_1000243 1000243 #define GFARM_MSG_1000244 1000244 #define GFARM_MSG_1000245 1000245 #define GFARM_MSG_1000246 1000246 #define GFARM_MSG_1000247 1000247 #define GFARM_MSG_1000248 1000248 #define GFARM_MSG_1000249 1000249 #define GFARM_MSG_1000250 1000250 #define GFARM_MSG_1000251 1000251 #define GFARM_MSG_1000252 1000252 #define GFARM_MSG_1000253 1000253 #define GFARM_MSG_1000254 1000254 #define GFARM_MSG_1000255 1000255 #define GFARM_MSG_1000256 1000256 #define GFARM_MSG_1000257 1000257 #define GFARM_MSG_1000258 1000258 #define GFARM_MSG_1000259 1000259 #define GFARM_MSG_1000260 1000260 #define GFARM_MSG_1000261 1000261 #define GFARM_MSG_1000262 1000262 #define GFARM_MSG_1000263 1000263 #define GFARM_MSG_1000264 1000264 #define GFARM_MSG_1000265 1000265 #define GFARM_MSG_1000266 1000266 #define GFARM_MSG_1000267 1000267 #define GFARM_MSG_1000268 1000268 #define GFARM_MSG_1000269 1000269 #define GFARM_MSG_1000270 1000270 #define GFARM_MSG_1000271 1000271 #define GFARM_MSG_1000272 1000272 #define GFARM_MSG_1000273 1000273 #define GFARM_MSG_1000274 1000274 #define GFARM_MSG_1000275 1000275 #define GFARM_MSG_1000276 1000276 #define GFARM_MSG_1000277 1000277 #define GFARM_MSG_1000278 1000278 #define GFARM_MSG_1000279 1000279 #define GFARM_MSG_1000280 1000280 #define GFARM_MSG_1000281 1000281 #define GFARM_MSG_1000282 1000282 #define GFARM_MSG_1000283 1000283 #define GFARM_MSG_1000284 1000284 #define GFARM_MSG_1000285 1000285 #define GFARM_MSG_1000286 1000286 #define GFARM_MSG_1000287 1000287 #define GFARM_MSG_1000288 1000288 #define GFARM_MSG_1000289 1000289 #define GFARM_MSG_1000290 1000290 #define GFARM_MSG_1000291 1000291 #define GFARM_MSG_1000292 1000292 #define GFARM_MSG_1000293 1000293 #define GFARM_MSG_1000294 1000294 #define GFARM_MSG_1000295 1000295 #define GFARM_MSG_1000296 1000296 #define GFARM_MSG_1000297 1000297 #define GFARM_MSG_1000298 1000298 #define GFARM_MSG_1000299 1000299 #define GFARM_MSG_1000300 1000300 #define GFARM_MSG_1000301 1000301 #define GFARM_MSG_1000302 1000302 #define GFARM_MSG_1000303 1000303 #define GFARM_MSG_1000304 1000304 #define GFARM_MSG_1000305 1000305 #define GFARM_MSG_1000306 1000306 #define GFARM_MSG_1000307 1000307 #define GFARM_MSG_1000308 1000308 #define GFARM_MSG_1000309 1000309 #define GFARM_MSG_1000310 1000310 #define GFARM_MSG_1000311 1000311 #define GFARM_MSG_1000312 1000312 #define GFARM_MSG_1000313 1000313 #define GFARM_MSG_1000314 1000314 #define GFARM_MSG_1000315 1000315 #define GFARM_MSG_1000316 1000316 #define GFARM_MSG_1000317 1000317 #define GFARM_MSG_1000318 1000318 #define GFARM_MSG_1000319 1000319 #define GFARM_MSG_1000320 1000320 #define GFARM_MSG_1000321 1000321 #define GFARM_MSG_1000322 1000322 #define GFARM_MSG_1000323 1000323 #define GFARM_MSG_1000324 1000324 #define GFARM_MSG_1000325 1000325 #define GFARM_MSG_1000326 1000326 #define GFARM_MSG_1000327 1000327 #define GFARM_MSG_1000328 1000328 #define GFARM_MSG_1000329 1000329 #define GFARM_MSG_1000330 1000330 #define GFARM_MSG_1000331 1000331 #define GFARM_MSG_1000332 1000332 #define GFARM_MSG_1000333 1000333 #define GFARM_MSG_1000334 1000334 #define GFARM_MSG_1000335 1000335 #define GFARM_MSG_1000336 1000336 #define GFARM_MSG_1000337 1000337 #define GFARM_MSG_1000338 1000338 #define GFARM_MSG_1000339 1000339 #define GFARM_MSG_1000340 1000340 #define GFARM_MSG_1000341 1000341 #define GFARM_MSG_1000342 1000342 #define GFARM_MSG_1000343 1000343 #define GFARM_MSG_1000344 1000344 #define GFARM_MSG_1000345 1000345 #define GFARM_MSG_1000346 1000346 #define GFARM_MSG_1000347 1000347 #define GFARM_MSG_1000348 1000348 #define GFARM_MSG_1000349 1000349 #define GFARM_MSG_1000350 1000350 #define GFARM_MSG_1000351 1000351 #define GFARM_MSG_1000352 1000352 #define GFARM_MSG_1000353 1000353 #define GFARM_MSG_1000354 1000354 #define GFARM_MSG_1000355 1000355 #define GFARM_MSG_1000356 1000356 #define GFARM_MSG_1000357 1000357 #define GFARM_MSG_1000358 1000358 #define GFARM_MSG_1000359 1000359 #define GFARM_MSG_1000360 1000360 #define GFARM_MSG_1000361 1000361 #define GFARM_MSG_1000362 1000362 #define GFARM_MSG_1000363 1000363 #define GFARM_MSG_1000364 1000364 #define GFARM_MSG_1000365 1000365 #define GFARM_MSG_1000366 1000366 #define GFARM_MSG_1000367 1000367 #define GFARM_MSG_1000368 1000368 #define GFARM_MSG_1000369 1000369 #define GFARM_MSG_1000370 1000370 #define GFARM_MSG_1000371 1000371 #define GFARM_MSG_1000372 1000372 #define GFARM_MSG_1000373 1000373 #define GFARM_MSG_1000374 1000374 #define GFARM_MSG_1000375 1000375 #define GFARM_MSG_1000376 1000376 #define GFARM_MSG_1000377 1000377 #define GFARM_MSG_1000378 1000378 #define GFARM_MSG_1000379 1000379 #define GFARM_MSG_1000380 1000380 #define GFARM_MSG_1000381 1000381 #define GFARM_MSG_1000382 1000382 #define GFARM_MSG_1000383 1000383 #define GFARM_MSG_1000384 1000384 #define GFARM_MSG_1000385 1000385 #define GFARM_MSG_1000386 1000386 #define GFARM_MSG_1000387 1000387 #define GFARM_MSG_1000388 1000388 #define GFARM_MSG_1000389 1000389 #define GFARM_MSG_1000390 1000390 #define GFARM_MSG_1000391 1000391 #define GFARM_MSG_1000392 1000392 #define GFARM_MSG_1000393 1000393 #define GFARM_MSG_1000394 1000394 #define GFARM_MSG_1000395 1000395 #define GFARM_MSG_1000396 1000396 #define GFARM_MSG_1000397 1000397 #define GFARM_MSG_1000398 1000398 #define GFARM_MSG_1000399 1000399 #define GFARM_MSG_1000400 1000400 #define GFARM_MSG_1000401 1000401 #define GFARM_MSG_1000402 1000402 #define GFARM_MSG_1000403 1000403 #define GFARM_MSG_1000404 1000404 #define GFARM_MSG_1000405 1000405 #define GFARM_MSG_1000406 1000406 #define GFARM_MSG_1000407 1000407 #define GFARM_MSG_1000408 1000408 #define GFARM_MSG_1000409 1000409 #define GFARM_MSG_1000410 1000410 #define GFARM_MSG_1000411 1000411 #define GFARM_MSG_1000412 1000412 #define GFARM_MSG_1000413 1000413 #define GFARM_MSG_1000414 1000414 #define GFARM_MSG_1000415 1000415 #define GFARM_MSG_1000416 1000416 #define GFARM_MSG_1000417 1000417 #define GFARM_MSG_1000418 1000418 #define GFARM_MSG_1000419 1000419 #define GFARM_MSG_1000420 1000420 #define GFARM_MSG_1000421 1000421 #define GFARM_MSG_1000422 1000422 #define GFARM_MSG_1000423 1000423 #define GFARM_MSG_1000424 1000424 #define GFARM_MSG_1000425 1000425 #define GFARM_MSG_1000426 1000426 #define GFARM_MSG_1000427 1000427 #define GFARM_MSG_1000428 1000428 #define GFARM_MSG_1000429 1000429 #define GFARM_MSG_1000430 1000430 #define GFARM_MSG_1000431 1000431 #define GFARM_MSG_1000432 1000432 #define GFARM_MSG_1000433 1000433 #define GFARM_MSG_1000434 1000434 #define GFARM_MSG_1000435 1000435 #define GFARM_MSG_1000436 1000436 #define GFARM_MSG_1000437 1000437 #define GFARM_MSG_1000438 1000438 #define GFARM_MSG_1000439 1000439 #define GFARM_MSG_1000440 1000440 #define GFARM_MSG_1000441 1000441 #define GFARM_MSG_1000442 1000442 #define GFARM_MSG_1000443 1000443 #define GFARM_MSG_1000444 1000444 #define GFARM_MSG_1000445 1000445 #define GFARM_MSG_1000446 1000446 #define GFARM_MSG_1000447 1000447 #define GFARM_MSG_1000448 1000448 #define GFARM_MSG_1000449 1000449 #define GFARM_MSG_1000450 1000450 #define GFARM_MSG_1000451 1000451 #define GFARM_MSG_1000452 1000452 #define GFARM_MSG_1000453 1000453 #define GFARM_MSG_1000454 1000454 #define GFARM_MSG_1000455 1000455 #define GFARM_MSG_1000456 1000456 #define GFARM_MSG_1000457 1000457 #define GFARM_MSG_1000458 1000458 #define GFARM_MSG_1000459 1000459 #define GFARM_MSG_1000460 1000460 #define GFARM_MSG_1000461 1000461 #define GFARM_MSG_1000462 1000462 #define GFARM_MSG_1000463 1000463 #define GFARM_MSG_1000464 1000464 #define GFARM_MSG_1000465 1000465 #define GFARM_MSG_1000466 1000466 #define GFARM_MSG_1000467 1000467 #define GFARM_MSG_1000468 1000468 #define GFARM_MSG_1000469 1000469 #define GFARM_MSG_1000470 1000470 #define GFARM_MSG_1000471 1000471 #define GFARM_MSG_1000472 1000472 #define GFARM_MSG_1000473 1000473 #define GFARM_MSG_1000474 1000474 #define GFARM_MSG_1000475 1000475 #define GFARM_MSG_1000476 1000476 #define GFARM_MSG_1000477 1000477 #define GFARM_MSG_1000478 1000478 #define GFARM_MSG_1000479 1000479 #define GFARM_MSG_1000480 1000480 #define GFARM_MSG_1000481 1000481 #define GFARM_MSG_1000482 1000482 #define GFARM_MSG_1000483 1000483 #define GFARM_MSG_1000484 1000484 #define GFARM_MSG_1000485 1000485 #define GFARM_MSG_1000486 1000486 #define GFARM_MSG_1000487 1000487 #define GFARM_MSG_1000488 1000488 #define GFARM_MSG_1000489 1000489 #define GFARM_MSG_1000490 1000490 #define GFARM_MSG_1000491 1000491 #define GFARM_MSG_1000492 1000492 #define GFARM_MSG_1000493 1000493 #define GFARM_MSG_1000494 1000494 #define GFARM_MSG_1000495 1000495 #define GFARM_MSG_1000496 1000496 #define GFARM_MSG_1000497 1000497 #define GFARM_MSG_1000498 1000498 #define GFARM_MSG_1000499 1000499 #define GFARM_MSG_1000500 1000500 #define GFARM_MSG_1000501 1000501 #define GFARM_MSG_1000502 1000502 #define GFARM_MSG_1000503 1000503 #define GFARM_MSG_1000504 1000504 #define GFARM_MSG_1000505 1000505 #define GFARM_MSG_1000506 1000506 #define GFARM_MSG_1000507 1000507 #define GFARM_MSG_1000508 1000508 #define GFARM_MSG_1000509 1000509 #define GFARM_MSG_1000510 1000510 #define GFARM_MSG_1000511 1000511 #define GFARM_MSG_1000512 1000512 #define GFARM_MSG_1000513 1000513 #define GFARM_MSG_1000514 1000514 #define GFARM_MSG_1000515 1000515 #define GFARM_MSG_1000516 1000516 #define GFARM_MSG_1000517 1000517 #define GFARM_MSG_1000518 1000518 #define GFARM_MSG_1000519 1000519 #define GFARM_MSG_1000520 1000520 #define GFARM_MSG_1000521 1000521 #define GFARM_MSG_1000522 1000522 #define GFARM_MSG_1000523 1000523 #define GFARM_MSG_1000524 1000524 #define GFARM_MSG_1000525 1000525 #define GFARM_MSG_1000526 1000526 #define GFARM_MSG_1000527 1000527 #define GFARM_MSG_1000528 1000528 #define GFARM_MSG_1000529 1000529 #define GFARM_MSG_1000530 1000530 #define GFARM_MSG_1000531 1000531 #define GFARM_MSG_1000532 1000532 #define GFARM_MSG_1000533 1000533 #define GFARM_MSG_1000534 1000534 #define GFARM_MSG_1000535 1000535 #define GFARM_MSG_1000536 1000536 #define GFARM_MSG_1000537 1000537 #define GFARM_MSG_1000538 1000538 #define GFARM_MSG_1000539 1000539 #define GFARM_MSG_1000540 1000540 #define GFARM_MSG_1000541 1000541 #define GFARM_MSG_1000542 1000542 #define GFARM_MSG_1000543 1000543 #define GFARM_MSG_1000544 1000544 #define GFARM_MSG_1000545 1000545 #define GFARM_MSG_1000546 1000546 #define GFARM_MSG_1000547 1000547 #define GFARM_MSG_1000548 1000548 #define GFARM_MSG_1000549 1000549 #define GFARM_MSG_1000550 1000550 #define GFARM_MSG_1000551 1000551 #define GFARM_MSG_1000552 1000552 #define GFARM_MSG_1000553 1000553 #define GFARM_MSG_1000554 1000554 #define GFARM_MSG_1000555 1000555 #define GFARM_MSG_1000556 1000556 #define GFARM_MSG_1000557 1000557 #define GFARM_MSG_1000558 1000558 #define GFARM_MSG_1000559 1000559 #define GFARM_MSG_1000560 1000560 #define GFARM_MSG_1000561 1000561 #define GFARM_MSG_1000562 1000562 #define GFARM_MSG_1000563 1000563 #define GFARM_MSG_1000564 1000564 #define GFARM_MSG_1000565 1000565 #define GFARM_MSG_1000566 1000566 #define GFARM_MSG_1000567 1000567 #define GFARM_MSG_1000568 1000568 #define GFARM_MSG_1000569 1000569 #define GFARM_MSG_1000570 1000570 #define GFARM_MSG_1000571 1000571 #define GFARM_MSG_1000572 1000572 #define GFARM_MSG_1000573 1000573 #define GFARM_MSG_1000574 1000574 #define GFARM_MSG_1000575 1000575 #define GFARM_MSG_1000576 1000576 #define GFARM_MSG_1000577 1000577 #define GFARM_MSG_1000578 1000578 #define GFARM_MSG_1000579 1000579 #define GFARM_MSG_1000580 1000580 #define GFARM_MSG_1000581 1000581 #define GFARM_MSG_1000582 1000582 #define GFARM_MSG_1000583 1000583 #define GFARM_MSG_1000584 1000584 #define GFARM_MSG_1000585 1000585 #define GFARM_MSG_1000586 1000586 #define GFARM_MSG_1000587 1000587 #define GFARM_MSG_1000588 1000588 #define GFARM_MSG_1000589 1000589 #define GFARM_MSG_1000590 1000590 #define GFARM_MSG_1000591 1000591 #define GFARM_MSG_1000592 1000592 #define GFARM_MSG_1000593 1000593 #define GFARM_MSG_1000594 1000594 #define GFARM_MSG_1000595 1000595 #define GFARM_MSG_1000596 1000596 #define GFARM_MSG_1000597 1000597 #define GFARM_MSG_1000598 1000598 #define GFARM_MSG_1000599 1000599 #define GFARM_MSG_1000600 1000600 #define GFARM_MSG_1000601 1000601 #define GFARM_MSG_1000602 1000602 #define GFARM_MSG_1000603 1000603 #define GFARM_MSG_1000604 1000604 #define GFARM_MSG_1000605 1000605 #define GFARM_MSG_1000606 1000606 #define GFARM_MSG_1000607 1000607 #define GFARM_MSG_1000608 1000608 #define GFARM_MSG_1000609 1000609 #define GFARM_MSG_1000610 1000610 #define GFARM_MSG_1000611 1000611 #define GFARM_MSG_1000612 1000612 #define GFARM_MSG_1000613 1000613 #define GFARM_MSG_1000614 1000614 #define GFARM_MSG_1000615 1000615 #define GFARM_MSG_1000616 1000616 #define GFARM_MSG_1000617 1000617 #define GFARM_MSG_1000618 1000618 #define GFARM_MSG_1000619 1000619 #define GFARM_MSG_1000620 1000620 #define GFARM_MSG_1000621 1000621 #define GFARM_MSG_1000622 1000622 #define GFARM_MSG_1000623 1000623 #define GFARM_MSG_1000624 1000624 #define GFARM_MSG_1000625 1000625 #define GFARM_MSG_1000626 1000626 #define GFARM_MSG_1000627 1000627 #define GFARM_MSG_1000628 1000628 #define GFARM_MSG_1000629 1000629 #define GFARM_MSG_1000630 1000630 #define GFARM_MSG_1000631 1000631 #define GFARM_MSG_1000632 1000632 #define GFARM_MSG_1000633 1000633 #define GFARM_MSG_1000634 1000634 #define GFARM_MSG_1000635 1000635 #define GFARM_MSG_1000636 1000636 #define GFARM_MSG_1000637 1000637 #define GFARM_MSG_1000638 1000638 #define GFARM_MSG_1000639 1000639 #define GFARM_MSG_1000640 1000640 #define GFARM_MSG_1000641 1000641 #define GFARM_MSG_1000642 1000642 #define GFARM_MSG_1000643 1000643 #define GFARM_MSG_1000644 1000644 #define GFARM_MSG_1000645 1000645 #define GFARM_MSG_1000646 1000646 #define GFARM_MSG_1000647 1000647 #define GFARM_MSG_1000648 1000648 #define GFARM_MSG_1000649 1000649 #define GFARM_MSG_1000650 1000650 #define GFARM_MSG_1000651 1000651 #define GFARM_MSG_1000652 1000652 #define GFARM_MSG_1000653 1000653 #define GFARM_MSG_1000654 1000654 #define GFARM_MSG_1000655 1000655 #define GFARM_MSG_1000656 1000656 #define GFARM_MSG_1000657 1000657 #define GFARM_MSG_1000658 1000658 #define GFARM_MSG_1000659 1000659 #define GFARM_MSG_1000660 1000660 #define GFARM_MSG_1000661 1000661 #define GFARM_MSG_1000662 1000662 #define GFARM_MSG_1000663 1000663 #define GFARM_MSG_1000664 1000664 #define GFARM_MSG_1000665 1000665 #define GFARM_MSG_1000666 1000666 #define GFARM_MSG_1000667 1000667 #define GFARM_MSG_1000668 1000668 #define GFARM_MSG_1000669 1000669 #define GFARM_MSG_1000670 1000670 #define GFARM_MSG_1000671 1000671 #define GFARM_MSG_1000672 1000672 #define GFARM_MSG_1000673 1000673 #define GFARM_MSG_1000674 1000674 #define GFARM_MSG_1000675 1000675 #define GFARM_MSG_1000676 1000676 #define GFARM_MSG_1000677 1000677 #define GFARM_MSG_1000678 1000678 #define GFARM_MSG_1000679 1000679 #define GFARM_MSG_1000680 1000680 #define GFARM_MSG_1000681 1000681 #define GFARM_MSG_1000682 1000682 #define GFARM_MSG_1000683 1000683 #define GFARM_MSG_1000684 1000684 #define GFARM_MSG_1000685 1000685 #define GFARM_MSG_1000686 1000686 #define GFARM_MSG_1000687 1000687 #define GFARM_MSG_1000688 1000688 #define GFARM_MSG_1000689 1000689 #define GFARM_MSG_1000690 1000690 #define GFARM_MSG_1000691 1000691 #define GFARM_MSG_1000692 1000692 #define GFARM_MSG_1000693 1000693 #define GFARM_MSG_1000694 1000694 #define GFARM_MSG_1000695 1000695 #define GFARM_MSG_1000696 1000696 #define GFARM_MSG_1000697 1000697 #define GFARM_MSG_1000698 1000698 #define GFARM_MSG_1000699 1000699 #define GFARM_MSG_1000700 1000700 #define GFARM_MSG_1000701 1000701 #define GFARM_MSG_1000702 1000702 #define GFARM_MSG_1000703 1000703 #define GFARM_MSG_1000704 1000704 #define GFARM_MSG_1000705 1000705 #define GFARM_MSG_1000706 1000706 #define GFARM_MSG_1000707 1000707 #define GFARM_MSG_1000708 1000708 #define GFARM_MSG_1000709 1000709 #define GFARM_MSG_1000710 1000710 #define GFARM_MSG_1000711 1000711 #define GFARM_MSG_1000712 1000712 #define GFARM_MSG_1000713 1000713 #define GFARM_MSG_1000714 1000714 #define GFARM_MSG_1000715 1000715 #define GFARM_MSG_1000716 1000716 #define GFARM_MSG_1000717 1000717 #define GFARM_MSG_1000718 1000718 #define GFARM_MSG_1000719 1000719 #define GFARM_MSG_1000720 1000720 #define GFARM_MSG_1000721 1000721 #define GFARM_MSG_1000722 1000722 #define GFARM_MSG_1000723 1000723 #define GFARM_MSG_1000724 1000724 #define GFARM_MSG_1000725 1000725 #define GFARM_MSG_1000726 1000726 #define GFARM_MSG_1000727 1000727 #define GFARM_MSG_1000728 1000728 #define GFARM_MSG_1000729 1000729 #define GFARM_MSG_1000730 1000730 #define GFARM_MSG_1000731 1000731 #define GFARM_MSG_1000732 1000732 #define GFARM_MSG_1000733 1000733 #define GFARM_MSG_1000734 1000734 #define GFARM_MSG_1000735 1000735 #define GFARM_MSG_1000736 1000736 #define GFARM_MSG_1000737 1000737 #define GFARM_MSG_1000738 1000738 #define GFARM_MSG_1000739 1000739 #define GFARM_MSG_1000740 1000740 #define GFARM_MSG_1000741 1000741 #define GFARM_MSG_1000742 1000742 #define GFARM_MSG_1000743 1000743 #define GFARM_MSG_1000744 1000744 #define GFARM_MSG_1000745 1000745 #define GFARM_MSG_1000746 1000746 #define GFARM_MSG_1000747 1000747 #define GFARM_MSG_1000748 1000748 #define GFARM_MSG_1000749 1000749 #define GFARM_MSG_1000750 1000750 #define GFARM_MSG_1000751 1000751 #define GFARM_MSG_1000752 1000752 #define GFARM_MSG_1000753 1000753 #define GFARM_MSG_1000754 1000754 #define GFARM_MSG_1000755 1000755 #define GFARM_MSG_1000756 1000756 #define GFARM_MSG_1000757 1000757 #define GFARM_MSG_1000758 1000758 #define GFARM_MSG_1000759 1000759 #define GFARM_MSG_1000760 1000760 #define GFARM_MSG_1000761 1000761 #define GFARM_MSG_1000762 1000762 #define GFARM_MSG_1000763 1000763 #define GFARM_MSG_1000764 1000764 #define GFARM_MSG_1000765 1000765 #define GFARM_MSG_1000766 1000766 #define GFARM_MSG_1000767 1000767 #define GFARM_MSG_1000768 1000768 #define GFARM_MSG_1000769 1000769 #define GFARM_MSG_1000770 1000770 #define GFARM_MSG_1000771 1000771 #define GFARM_MSG_1000772 1000772 #define GFARM_MSG_1000773 1000773 #define GFARM_MSG_1000774 1000774 #define GFARM_MSG_1000775 1000775 #define GFARM_MSG_1000776 1000776 #define GFARM_MSG_1000777 1000777 #define GFARM_MSG_1000778 1000778 #define GFARM_MSG_1000779 1000779 #define GFARM_MSG_1000780 1000780 #define GFARM_MSG_1000781 1000781 #define GFARM_MSG_1000782 1000782 #define GFARM_MSG_1000783 1000783 #define GFARM_MSG_1000784 1000784 #define GFARM_MSG_1000785 1000785 #define GFARM_MSG_1000786 1000786 #define GFARM_MSG_1000787 1000787 #define GFARM_MSG_1000788 1000788 #define GFARM_MSG_1000789 1000789 #define GFARM_MSG_1000790 1000790 #define GFARM_MSG_1000791 1000791 #define GFARM_MSG_1000792 1000792 #define GFARM_MSG_1000793 1000793 #define GFARM_MSG_1000794 1000794 #define GFARM_MSG_1000795 1000795 #define GFARM_MSG_1000796 1000796 #define GFARM_MSG_1000797 1000797 #define GFARM_MSG_1000798 1000798 #define GFARM_MSG_1000799 1000799 #define GFARM_MSG_1000800 1000800 #define GFARM_MSG_1000801 1000801 #define GFARM_MSG_1000802 1000802 #define GFARM_MSG_1000803 1000803 #define GFARM_MSG_1000804 1000804 #define GFARM_MSG_1000805 1000805 #define GFARM_MSG_1000806 1000806 #define GFARM_MSG_1000807 1000807 #define GFARM_MSG_1000808 1000808 #define GFARM_MSG_1000809 1000809 #define GFARM_MSG_1000810 1000810 #define GFARM_MSG_1000811 1000811 #define GFARM_MSG_1000812 1000812 #define GFARM_MSG_1000813 1000813 #define GFARM_MSG_1000814 1000814 #define GFARM_MSG_1000815 1000815 #define GFARM_MSG_1000816 1000816 #define GFARM_MSG_1000817 1000817 #define GFARM_MSG_1000818 1000818 #define GFARM_MSG_1000819 1000819 #define GFARM_MSG_1000820 1000820 #define GFARM_MSG_1000821 1000821 #define GFARM_MSG_1000822 1000822 #define GFARM_MSG_1000823 1000823 #define GFARM_MSG_1000824 1000824 #define GFARM_MSG_1000825 1000825 #define GFARM_MSG_1000826 1000826 #define GFARM_MSG_1000827 1000827 #define GFARM_MSG_1000828 1000828 #define GFARM_MSG_1000829 1000829 #define GFARM_MSG_1000830 1000830 #define GFARM_MSG_1000831 1000831 #define GFARM_MSG_1000832 1000832 #define GFARM_MSG_1000833 1000833 #define GFARM_MSG_1000834 1000834 #define GFARM_MSG_1000835 1000835 #define GFARM_MSG_1000836 1000836 #define GFARM_MSG_1000837 1000837 #define GFARM_MSG_1000838 1000838 #define GFARM_MSG_1000839 1000839 #define GFARM_MSG_1000840 1000840 #define GFARM_MSG_1000841 1000841 #define GFARM_MSG_1000842 1000842 #define GFARM_MSG_1000843 1000843 #define GFARM_MSG_1000844 1000844 #define GFARM_MSG_1000845 1000845 #define GFARM_MSG_1000846 1000846 #define GFARM_MSG_1000847 1000847 #define GFARM_MSG_1000848 1000848 #define GFARM_MSG_1000849 1000849 #define GFARM_MSG_1000850 1000850 #define GFARM_MSG_1000851 1000851 #define GFARM_MSG_1000852 1000852 #define GFARM_MSG_1000853 1000853 #define GFARM_MSG_1000854 1000854 #define GFARM_MSG_1000855 1000855 #define GFARM_MSG_1000856 1000856 #define GFARM_MSG_1000857 1000857 #define GFARM_MSG_1000858 1000858 #define GFARM_MSG_1000859 1000859 #define GFARM_MSG_1000860 1000860 #define GFARM_MSG_1000861 1000861 #define GFARM_MSG_1000862 1000862 #define GFARM_MSG_1000863 1000863 #define GFARM_MSG_1000864 1000864 #define GFARM_MSG_1000865 1000865 #define GFARM_MSG_1000866 1000866 #define GFARM_MSG_1000867 1000867 #define GFARM_MSG_1000868 1000868 #define GFARM_MSG_1000869 1000869 #define GFARM_MSG_1000870 1000870 #define GFARM_MSG_1000871 1000871 #define GFARM_MSG_1000872 1000872 #define GFARM_MSG_1000873 1000873 #define GFARM_MSG_1000874 1000874 #define GFARM_MSG_1000875 1000875 #define GFARM_MSG_1000876 1000876 #define GFARM_MSG_1000877 1000877 #define GFARM_MSG_1000878 1000878 #define GFARM_MSG_1000879 1000879 #define GFARM_MSG_1000880 1000880 #define GFARM_MSG_1000881 1000881 #define GFARM_MSG_1000882 1000882 #define GFARM_MSG_1000883 1000883 #define GFARM_MSG_1000884 1000884 #define GFARM_MSG_1000885 1000885 #define GFARM_MSG_1000886 1000886 #define GFARM_MSG_1000887 1000887 #define GFARM_MSG_1000888 1000888 #define GFARM_MSG_1000889 1000889 #define GFARM_MSG_1000890 1000890 #define GFARM_MSG_1000891 1000891 #define GFARM_MSG_1000892 1000892 #define GFARM_MSG_1000893 1000893 #define GFARM_MSG_1000894 1000894 #define GFARM_MSG_1000895 1000895 #define GFARM_MSG_1000896 1000896 #define GFARM_MSG_1000897 1000897 #define GFARM_MSG_1000898 1000898 #define GFARM_MSG_1000899 1000899 #define GFARM_MSG_1000900 1000900 #define GFARM_MSG_1000901 1000901 #define GFARM_MSG_1000902 1000902 #define GFARM_MSG_1000903 1000903 #define GFARM_MSG_1000904 1000904 #define GFARM_MSG_1000905 1000905 #define GFARM_MSG_1000906 1000906 #define GFARM_MSG_1000907 1000907 #define GFARM_MSG_1000908 1000908 #define GFARM_MSG_1000909 1000909 #define GFARM_MSG_1000910 1000910 #define GFARM_MSG_1000911 1000911 #define GFARM_MSG_1000912 1000912 #define GFARM_MSG_1000913 1000913 #define GFARM_MSG_1000914 1000914 #define GFARM_MSG_1000915 1000915 #define GFARM_MSG_1000916 1000916 #define GFARM_MSG_1000917 1000917 #define GFARM_MSG_1000918 1000918 #define GFARM_MSG_1000919 1000919 #define GFARM_MSG_1000920 1000920 #define GFARM_MSG_1000921 1000921 #define GFARM_MSG_1000922 1000922 #define GFARM_MSG_1000923 1000923 #define GFARM_MSG_1000924 1000924 #define GFARM_MSG_1000925 1000925 #define GFARM_MSG_1000926 1000926 #define GFARM_MSG_1000927 1000927 #define GFARM_MSG_1000928 1000928 #define GFARM_MSG_1000929 1000929 #define GFARM_MSG_1000930 1000930 #define GFARM_MSG_1000931 1000931 #define GFARM_MSG_1000932 1000932 #define GFARM_MSG_1000933 1000933 #define GFARM_MSG_1000934 1000934 #define GFARM_MSG_1000935 1000935 #define GFARM_MSG_1000936 1000936 #define GFARM_MSG_1000937 1000937 #define GFARM_MSG_1000938 1000938 #define GFARM_MSG_1000939 1000939 #define GFARM_MSG_1000940 1000940 #define GFARM_MSG_1000941 1000941 #define GFARM_MSG_1000942 1000942 #define GFARM_MSG_1000943 1000943 #define GFARM_MSG_1000944 1000944 #define GFARM_MSG_1000945 1000945 #define GFARM_MSG_1000946 1000946 #define GFARM_MSG_1000947 1000947 #define GFARM_MSG_1000948 1000948 #define GFARM_MSG_1000949 1000949 #define GFARM_MSG_1000950 1000950 #define GFARM_MSG_1000951 1000951 #define GFARM_MSG_1000952 1000952 #define GFARM_MSG_1000953 1000953 #define GFARM_MSG_1000954 1000954 #define GFARM_MSG_1000955 1000955 #define GFARM_MSG_1000956 1000956 #define GFARM_MSG_1000957 1000957 #define GFARM_MSG_1000958 1000958 #define GFARM_MSG_1000959 1000959 #define GFARM_MSG_1000960 1000960 #define GFARM_MSG_1000961 1000961 #define GFARM_MSG_1000962 1000962 #define GFARM_MSG_1000963 1000963 #define GFARM_MSG_1000964 1000964 #define GFARM_MSG_1000965 1000965 #define GFARM_MSG_1000966 1000966 #define GFARM_MSG_1000967 1000967 #define GFARM_MSG_1000968 1000968 #define GFARM_MSG_1000969 1000969 #define GFARM_MSG_1000970 1000970 #define GFARM_MSG_1000971 1000971 #define GFARM_MSG_1000972 1000972 #define GFARM_MSG_1000973 1000973 #define GFARM_MSG_1000974 1000974 #define GFARM_MSG_1000975 1000975 #define GFARM_MSG_1000976 1000976 #define GFARM_MSG_1000977 1000977 #define GFARM_MSG_1000978 1000978 #define GFARM_MSG_1000979 1000979 #define GFARM_MSG_1000980 1000980 #define GFARM_MSG_1000981 1000981 #define GFARM_MSG_1000982 1000982 #define GFARM_MSG_1000983 1000983 #define GFARM_MSG_1000984 1000984 #define GFARM_MSG_1000985 1000985 #define GFARM_MSG_1000986 1000986 #define GFARM_MSG_1000987 1000987 #define GFARM_MSG_1000988 1000988 #define GFARM_MSG_1000989 1000989 #define GFARM_MSG_1000990 1000990 #define GFARM_MSG_1000991 1000991 #define GFARM_MSG_1000992 1000992 #define GFARM_MSG_1000993 1000993 #define GFARM_MSG_1000994 1000994 #define GFARM_MSG_1000995 1000995 #define GFARM_MSG_1000996 1000996 #define GFARM_MSG_1000997 1000997 #define GFARM_MSG_1000998 1000998 #define GFARM_MSG_1000999 1000999 #define GFARM_MSG_1001000 1001000 #define GFARM_MSG_1001001 1001001 #define GFARM_MSG_1001002 1001002 #define GFARM_MSG_1001003 1001003 #define GFARM_MSG_1001004 1001004 #define GFARM_MSG_1001005 1001005 #define GFARM_MSG_1001006 1001006 #define GFARM_MSG_1001007 1001007 #define GFARM_MSG_1001008 1001008 #define GFARM_MSG_1001009 1001009 #define GFARM_MSG_1001010 1001010 #define GFARM_MSG_1001011 1001011 #define GFARM_MSG_1001012 1001012 #define GFARM_MSG_1001013 1001013 #define GFARM_MSG_1001014 1001014 #define GFARM_MSG_1001015 1001015 #define GFARM_MSG_1001016 1001016 #define GFARM_MSG_1001017 1001017 #define GFARM_MSG_1001018 1001018 #define GFARM_MSG_1001019 1001019 #define GFARM_MSG_1001020 1001020 #define GFARM_MSG_1001021 1001021 #define GFARM_MSG_1001022 1001022 #define GFARM_MSG_1001023 1001023 #define GFARM_MSG_1001024 1001024 #define GFARM_MSG_1001025 1001025 #define GFARM_MSG_1001026 1001026 #define GFARM_MSG_1001027 1001027 #define GFARM_MSG_1001028 1001028 #define GFARM_MSG_1001029 1001029 #define GFARM_MSG_1001030 1001030 #define GFARM_MSG_1001031 1001031 #define GFARM_MSG_1001032 1001032 #define GFARM_MSG_1001033 1001033 #define GFARM_MSG_1001034 1001034 #define GFARM_MSG_1001035 1001035 #define GFARM_MSG_1001036 1001036 #define GFARM_MSG_1001037 1001037 #define GFARM_MSG_1001038 1001038 #define GFARM_MSG_1001039 1001039 #define GFARM_MSG_1001040 1001040 #define GFARM_MSG_1001041 1001041 #define GFARM_MSG_1001042 1001042 #define GFARM_MSG_1001043 1001043 #define GFARM_MSG_1001044 1001044 #define GFARM_MSG_1001045 1001045 #define GFARM_MSG_1001046 1001046 #define GFARM_MSG_1001047 1001047 #define GFARM_MSG_1001048 1001048 #define GFARM_MSG_1001049 1001049 #define GFARM_MSG_1001050 1001050 #define GFARM_MSG_1001051 1001051 #define GFARM_MSG_1001052 1001052 #define GFARM_MSG_1001053 1001053 #define GFARM_MSG_1001054 1001054 #define GFARM_MSG_1001055 1001055 #define GFARM_MSG_1001056 1001056 #define GFARM_MSG_1001057 1001057 #define GFARM_MSG_1001058 1001058 #define GFARM_MSG_1001059 1001059 #define GFARM_MSG_1001060 1001060 #define GFARM_MSG_1001061 1001061 #define GFARM_MSG_1001062 1001062 #define GFARM_MSG_1001063 1001063 #define GFARM_MSG_1001064 1001064 #define GFARM_MSG_1001065 1001065 #define GFARM_MSG_1001066 1001066 #define GFARM_MSG_1001067 1001067 #define GFARM_MSG_1001068 1001068 #define GFARM_MSG_1001069 1001069 #define GFARM_MSG_1001070 1001070 #define GFARM_MSG_1001071 1001071 #define GFARM_MSG_1001072 1001072 #define GFARM_MSG_1001073 1001073 #define GFARM_MSG_1001074 1001074 #define GFARM_MSG_1001075 1001075 #define GFARM_MSG_1001076 1001076 #define GFARM_MSG_1001077 1001077 #define GFARM_MSG_1001078 1001078 #define GFARM_MSG_1001079 1001079 #define GFARM_MSG_1001080 1001080 #define GFARM_MSG_1001081 1001081 #define GFARM_MSG_1001082 1001082 #define GFARM_MSG_1001083 1001083 #define GFARM_MSG_1001084 1001084 #define GFARM_MSG_1001085 1001085 #define GFARM_MSG_1001086 1001086 #define GFARM_MSG_1001087 1001087 #define GFARM_MSG_1001088 1001088 #define GFARM_MSG_1001089 1001089 #define GFARM_MSG_1001090 1001090 #define GFARM_MSG_1001091 1001091 #define GFARM_MSG_1001092 1001092 #define GFARM_MSG_1001093 1001093 #define GFARM_MSG_1001094 1001094 #define GFARM_MSG_1001095 1001095 #define GFARM_MSG_1001096 1001096 #define GFARM_MSG_1001097 1001097 #define GFARM_MSG_1001098 1001098 #define GFARM_MSG_1001099 1001099 #define GFARM_MSG_1001100 1001100 #define GFARM_MSG_1001101 1001101 #define GFARM_MSG_1001102 1001102 #define GFARM_MSG_1001103 1001103 #define GFARM_MSG_1001104 1001104 #define GFARM_MSG_1001105 1001105 #define GFARM_MSG_1001106 1001106 #define GFARM_MSG_1001107 1001107 #define GFARM_MSG_1001108 1001108 #define GFARM_MSG_1001109 1001109 #define GFARM_MSG_1001110 1001110 #define GFARM_MSG_1001111 1001111 #define GFARM_MSG_1001112 1001112 #define GFARM_MSG_1001113 1001113 #define GFARM_MSG_1001114 1001114 #define GFARM_MSG_1001115 1001115 #define GFARM_MSG_1001116 1001116 #define GFARM_MSG_1001117 1001117 #define GFARM_MSG_1001118 1001118 #define GFARM_MSG_1001119 1001119 #define GFARM_MSG_1001120 1001120 #define GFARM_MSG_1001121 1001121 #define GFARM_MSG_1001122 1001122 #define GFARM_MSG_1001123 1001123 #define GFARM_MSG_1001124 1001124 #define GFARM_MSG_1001125 1001125 #define GFARM_MSG_1001126 1001126 #define GFARM_MSG_1001127 1001127 #define GFARM_MSG_1001128 1001128 #define GFARM_MSG_1001129 1001129 #define GFARM_MSG_1001130 1001130 #define GFARM_MSG_1001131 1001131 #define GFARM_MSG_1001132 1001132 #define GFARM_MSG_1001133 1001133 #define GFARM_MSG_1001134 1001134 #define GFARM_MSG_1001135 1001135 #define GFARM_MSG_1001136 1001136 #define GFARM_MSG_1001137 1001137 #define GFARM_MSG_1001138 1001138 #define GFARM_MSG_1001139 1001139 #define GFARM_MSG_1001140 1001140 #define GFARM_MSG_1001141 1001141 #define GFARM_MSG_1001142 1001142 #define GFARM_MSG_1001143 1001143 #define GFARM_MSG_1001144 1001144 #define GFARM_MSG_1001145 1001145 #define GFARM_MSG_1001146 1001146 #define GFARM_MSG_1001147 1001147 #define GFARM_MSG_1001148 1001148 #define GFARM_MSG_1001149 1001149 #define GFARM_MSG_1001150 1001150 #define GFARM_MSG_1001151 1001151 #define GFARM_MSG_1001152 1001152 #define GFARM_MSG_1001153 1001153 #define GFARM_MSG_1001154 1001154 #define GFARM_MSG_1001155 1001155 #define GFARM_MSG_1001156 1001156 #define GFARM_MSG_1001157 1001157 #define GFARM_MSG_1001158 1001158 #define GFARM_MSG_1001159 1001159 #define GFARM_MSG_1001160 1001160 #define GFARM_MSG_1001161 1001161 #define GFARM_MSG_1001162 1001162 #define GFARM_MSG_1001163 1001163 #define GFARM_MSG_1001164 1001164 #define GFARM_MSG_1001165 1001165 #define GFARM_MSG_1001166 1001166 #define GFARM_MSG_1001167 1001167 #define GFARM_MSG_1001168 1001168 #define GFARM_MSG_1001169 1001169 #define GFARM_MSG_1001170 1001170 #define GFARM_MSG_1001171 1001171 #define GFARM_MSG_1001172 1001172 #define GFARM_MSG_1001173 1001173 #define GFARM_MSG_1001174 1001174 #define GFARM_MSG_1001175 1001175 #define GFARM_MSG_1001176 1001176 #define GFARM_MSG_1001177 1001177 #define GFARM_MSG_1001178 1001178 #define GFARM_MSG_1001179 1001179 #define GFARM_MSG_1001180 1001180 #define GFARM_MSG_1001181 1001181 #define GFARM_MSG_1001182 1001182 #define GFARM_MSG_1001183 1001183 #define GFARM_MSG_1001184 1001184 #define GFARM_MSG_1001185 1001185 #define GFARM_MSG_1001186 1001186 #define GFARM_MSG_1001187 1001187 #define GFARM_MSG_1001188 1001188 #define GFARM_MSG_1001189 1001189 #define GFARM_MSG_1001190 1001190 #define GFARM_MSG_1001191 1001191 #define GFARM_MSG_1001192 1001192 #define GFARM_MSG_1001193 1001193 #define GFARM_MSG_1001194 1001194 #define GFARM_MSG_1001195 1001195 #define GFARM_MSG_1001196 1001196 #define GFARM_MSG_1001197 1001197 #define GFARM_MSG_1001198 1001198 #define GFARM_MSG_1001199 1001199 #define GFARM_MSG_1001200 1001200 #define GFARM_MSG_1001201 1001201 #define GFARM_MSG_1001202 1001202 #define GFARM_MSG_1001203 1001203 #define GFARM_MSG_1001204 1001204 #define GFARM_MSG_1001205 1001205 #define GFARM_MSG_1001206 1001206 #define GFARM_MSG_1001207 1001207 #define GFARM_MSG_1001208 1001208 #define GFARM_MSG_1001209 1001209 #define GFARM_MSG_1001210 1001210 #define GFARM_MSG_1001211 1001211 #define GFARM_MSG_1001212 1001212 #define GFARM_MSG_1001213 1001213 #define GFARM_MSG_1001214 1001214 #define GFARM_MSG_1001215 1001215 #define GFARM_MSG_1001216 1001216 #define GFARM_MSG_1001217 1001217 #define GFARM_MSG_1001218 1001218 #define GFARM_MSG_1001219 1001219 #define GFARM_MSG_1001220 1001220 #define GFARM_MSG_1001221 1001221 #define GFARM_MSG_1001222 1001222 #define GFARM_MSG_1001223 1001223 #define GFARM_MSG_1001224 1001224 #define GFARM_MSG_1001225 1001225 #define GFARM_MSG_1001226 1001226 #define GFARM_MSG_1001227 1001227 #define GFARM_MSG_1001228 1001228 #define GFARM_MSG_1001229 1001229 #define GFARM_MSG_1001230 1001230 #define GFARM_MSG_1001231 1001231 #define GFARM_MSG_1001232 1001232 #define GFARM_MSG_1001233 1001233 #define GFARM_MSG_1001234 1001234 #define GFARM_MSG_1001235 1001235 #define GFARM_MSG_1001236 1001236 #define GFARM_MSG_1001237 1001237 #define GFARM_MSG_1001238 1001238 #define GFARM_MSG_1001239 1001239 #define GFARM_MSG_1001240 1001240 #define GFARM_MSG_1001241 1001241 #define GFARM_MSG_1001242 1001242 #define GFARM_MSG_1001243 1001243 #define GFARM_MSG_1001244 1001244 #define GFARM_MSG_1001245 1001245 #define GFARM_MSG_1001246 1001246 #define GFARM_MSG_1001247 1001247 #define GFARM_MSG_1001248 1001248 #define GFARM_MSG_1001249 1001249 #define GFARM_MSG_1001250 1001250 #define GFARM_MSG_1001251 1001251 #define GFARM_MSG_1001252 1001252 #define GFARM_MSG_1001253 1001253 #define GFARM_MSG_1001254 1001254 #define GFARM_MSG_1001255 1001255 #define GFARM_MSG_1001256 1001256 #define GFARM_MSG_1001257 1001257 #define GFARM_MSG_1001258 1001258 #define GFARM_MSG_1001259 1001259 #define GFARM_MSG_1001260 1001260 #define GFARM_MSG_1001261 1001261 #define GFARM_MSG_1001262 1001262 #define GFARM_MSG_1001263 1001263 #define GFARM_MSG_1001264 1001264 #define GFARM_MSG_1001265 1001265 #define GFARM_MSG_1001266 1001266 #define GFARM_MSG_1001267 1001267 #define GFARM_MSG_1001268 1001268 #define GFARM_MSG_1001269 1001269 #define GFARM_MSG_1001270 1001270 #define GFARM_MSG_1001271 1001271 #define GFARM_MSG_1001272 1001272 #define GFARM_MSG_1001273 1001273 #define GFARM_MSG_1001274 1001274 #define GFARM_MSG_1001275 1001275 #define GFARM_MSG_1001276 1001276 #define GFARM_MSG_1001277 1001277 #define GFARM_MSG_1001278 1001278 #define GFARM_MSG_1001279 1001279 #define GFARM_MSG_1001280 1001280 #define GFARM_MSG_1001281 1001281 #define GFARM_MSG_1001282 1001282 #define GFARM_MSG_1001283 1001283 #define GFARM_MSG_1001284 1001284 #define GFARM_MSG_1001285 1001285 #define GFARM_MSG_1001286 1001286 #define GFARM_MSG_1001287 1001287 #define GFARM_MSG_1001288 1001288 #define GFARM_MSG_1001289 1001289 #define GFARM_MSG_1001290 1001290 #define GFARM_MSG_1001291 1001291 #define GFARM_MSG_1001292 1001292 #define GFARM_MSG_1001293 1001293 #define GFARM_MSG_1001294 1001294 #define GFARM_MSG_1001295 1001295 #define GFARM_MSG_1001296 1001296 #define GFARM_MSG_1001297 1001297 #define GFARM_MSG_1001298 1001298 #define GFARM_MSG_1001299 1001299 #define GFARM_MSG_1001300 1001300 #define GFARM_MSG_1001301 1001301 #define GFARM_MSG_1001302 1001302 #define GFARM_MSG_1001303 1001303 #define GFARM_MSG_1001304 1001304 #define GFARM_MSG_1001305 1001305 #define GFARM_MSG_1001306 1001306 #define GFARM_MSG_1001307 1001307 #define GFARM_MSG_1001308 1001308 #define GFARM_MSG_1001309 1001309 #define GFARM_MSG_1001310 1001310 #define GFARM_MSG_1001311 1001311 #define GFARM_MSG_1001312 1001312 #define GFARM_MSG_1001313 1001313 #define GFARM_MSG_1001314 1001314 #define GFARM_MSG_1001315 1001315 #define GFARM_MSG_1001316 1001316 #define GFARM_MSG_1001317 1001317 #define GFARM_MSG_1001318 1001318 #define GFARM_MSG_1001319 1001319 #define GFARM_MSG_1001320 1001320 #define GFARM_MSG_1001321 1001321 #define GFARM_MSG_1001322 1001322 #define GFARM_MSG_1001323 1001323 #define GFARM_MSG_1001324 1001324 #define GFARM_MSG_1001325 1001325 #define GFARM_MSG_1001326 1001326 #define GFARM_MSG_1001327 1001327 #define GFARM_MSG_1001328 1001328 #define GFARM_MSG_1001329 1001329 #define GFARM_MSG_1001330 1001330 #define GFARM_MSG_1001331 1001331 #define GFARM_MSG_1001332 1001332 #define GFARM_MSG_1001333 1001333 #define GFARM_MSG_1001334 1001334 #define GFARM_MSG_1001335 1001335 #define GFARM_MSG_1001336 1001336 #define GFARM_MSG_1001337 1001337 #define GFARM_MSG_1001338 1001338 #define GFARM_MSG_1001339 1001339 #define GFARM_MSG_1001340 1001340 #define GFARM_MSG_1001341 1001341 #define GFARM_MSG_1001342 1001342 #define GFARM_MSG_1001343 1001343 #define GFARM_MSG_1001344 1001344 #define GFARM_MSG_1001345 1001345 #define GFARM_MSG_1001346 1001346 #define GFARM_MSG_1001347 1001347 #define GFARM_MSG_1001348 1001348 #define GFARM_MSG_1001349 1001349 #define GFARM_MSG_1001350 1001350 #define GFARM_MSG_1001351 1001351 #define GFARM_MSG_1001352 1001352 #define GFARM_MSG_1001353 1001353 #define GFARM_MSG_1001354 1001354 #define GFARM_MSG_1001355 1001355 #define GFARM_MSG_1001356 1001356 #define GFARM_MSG_1001357 1001357 #define GFARM_MSG_1001358 1001358 #define GFARM_MSG_1001359 1001359 #define GFARM_MSG_1001360 1001360 #define GFARM_MSG_1001361 1001361 #define GFARM_MSG_1001362 1001362 #define GFARM_MSG_1001363 1001363 #define GFARM_MSG_1001364 1001364 #define GFARM_MSG_1001365 1001365 #define GFARM_MSG_1001366 1001366 #define GFARM_MSG_1001367 1001367 #define GFARM_MSG_1001368 1001368 #define GFARM_MSG_1001369 1001369 #define GFARM_MSG_1001370 1001370 #define GFARM_MSG_1001371 1001371 #define GFARM_MSG_1001372 1001372 #define GFARM_MSG_1001373 1001373 #define GFARM_MSG_1001374 1001374 #define GFARM_MSG_1001375 1001375 #define GFARM_MSG_1001376 1001376 #define GFARM_MSG_1001377 1001377 #define GFARM_MSG_1001378 1001378 #define GFARM_MSG_1001379 1001379 #define GFARM_MSG_1001380 1001380 #define GFARM_MSG_1001381 1001381 #define GFARM_MSG_1001382 1001382 #define GFARM_MSG_1001383 1001383 #define GFARM_MSG_1001384 1001384 #define GFARM_MSG_1001385 1001385 #define GFARM_MSG_1001386 1001386 #define GFARM_MSG_1001387 1001387 #define GFARM_MSG_1001388 1001388 #define GFARM_MSG_1001389 1001389 #define GFARM_MSG_1001390 1001390 #define GFARM_MSG_1001391 1001391 #define GFARM_MSG_1001392 1001392 #define GFARM_MSG_1001393 1001393 #define GFARM_MSG_1001394 1001394 #define GFARM_MSG_1001395 1001395 #define GFARM_MSG_1001396 1001396 #define GFARM_MSG_1001397 1001397 #define GFARM_MSG_1001398 1001398 #define GFARM_MSG_1001399 1001399 #define GFARM_MSG_1001400 1001400 #define GFARM_MSG_1001401 1001401 #define GFARM_MSG_1001402 1001402 #define GFARM_MSG_1001403 1001403 #define GFARM_MSG_1001404 1001404 #define GFARM_MSG_1001405 1001405 #define GFARM_MSG_1001406 1001406 #define GFARM_MSG_1001407 1001407 #define GFARM_MSG_1001408 1001408 #define GFARM_MSG_1001409 1001409 #define GFARM_MSG_1001410 1001410 #define GFARM_MSG_1001411 1001411 #define GFARM_MSG_1001412 1001412 #define GFARM_MSG_1001413 1001413 #define GFARM_MSG_1001414 1001414 #define GFARM_MSG_1001415 1001415 #define GFARM_MSG_1001416 1001416 #define GFARM_MSG_1001417 1001417 #define GFARM_MSG_1001418 1001418 #define GFARM_MSG_1001419 1001419 #define GFARM_MSG_1001420 1001420 #define GFARM_MSG_1001421 1001421 #define GFARM_MSG_1001422 1001422 #define GFARM_MSG_1001423 1001423 #define GFARM_MSG_1001424 1001424 #define GFARM_MSG_1001425 1001425 #define GFARM_MSG_1001426 1001426 #define GFARM_MSG_1001427 1001427 #define GFARM_MSG_1001428 1001428 #define GFARM_MSG_1001429 1001429 #define GFARM_MSG_1001430 1001430 #define GFARM_MSG_1001431 1001431 #define GFARM_MSG_1001432 1001432 #define GFARM_MSG_1001433 1001433 #define GFARM_MSG_1001434 1001434 #define GFARM_MSG_1001435 1001435 #define GFARM_MSG_1001436 1001436 #define GFARM_MSG_1001437 1001437 #define GFARM_MSG_1001438 1001438 #define GFARM_MSG_1001439 1001439 #define GFARM_MSG_1001440 1001440 #define GFARM_MSG_1001441 1001441 #define GFARM_MSG_1001442 1001442 #define GFARM_MSG_1001443 1001443 #define GFARM_MSG_1001444 1001444 #define GFARM_MSG_1001445 1001445 #define GFARM_MSG_1001446 1001446 #define GFARM_MSG_1001447 1001447 #define GFARM_MSG_1001448 1001448 #define GFARM_MSG_1001449 1001449 #define GFARM_MSG_1001450 1001450 #define GFARM_MSG_1001451 1001451 #define GFARM_MSG_1001452 1001452 #define GFARM_MSG_1001453 1001453 #define GFARM_MSG_1001454 1001454 #define GFARM_MSG_1001455 1001455 #define GFARM_MSG_1001456 1001456 #define GFARM_MSG_1001457 1001457 #define GFARM_MSG_1001458 1001458 #define GFARM_MSG_1001459 1001459 #define GFARM_MSG_1001460 1001460 #define GFARM_MSG_1001461 1001461 #define GFARM_MSG_1001462 1001462 #define GFARM_MSG_1001463 1001463 #define GFARM_MSG_1001464 1001464 #define GFARM_MSG_1001465 1001465 #define GFARM_MSG_1001466 1001466 #define GFARM_MSG_1001467 1001467 #define GFARM_MSG_1001468 1001468 #define GFARM_MSG_1001469 1001469 #define GFARM_MSG_1001470 1001470 #define GFARM_MSG_1001471 1001471 #define GFARM_MSG_1001472 1001472 #define GFARM_MSG_1001473 1001473 #define GFARM_MSG_1001474 1001474 #define GFARM_MSG_1001475 1001475 #define GFARM_MSG_1001476 1001476 #define GFARM_MSG_1001477 1001477 #define GFARM_MSG_1001478 1001478 #define GFARM_MSG_1001479 1001479 #define GFARM_MSG_1001480 1001480 #define GFARM_MSG_1001481 1001481 #define GFARM_MSG_1001482 1001482 #define GFARM_MSG_1001483 1001483 #define GFARM_MSG_1001484 1001484 #define GFARM_MSG_1001485 1001485 #define GFARM_MSG_1001486 1001486 #define GFARM_MSG_1001487 1001487 #define GFARM_MSG_1001488 1001488 #define GFARM_MSG_1001489 1001489 #define GFARM_MSG_1001490 1001490 #define GFARM_MSG_1001491 1001491 #define GFARM_MSG_1001492 1001492 #define GFARM_MSG_1001493 1001493 #define GFARM_MSG_1001494 1001494 #define GFARM_MSG_1001495 1001495 #define GFARM_MSG_1001496 1001496 #define GFARM_MSG_1001497 1001497 #define GFARM_MSG_1001498 1001498 #define GFARM_MSG_1001499 1001499 #define GFARM_MSG_1001500 1001500 #define GFARM_MSG_1001501 1001501 #define GFARM_MSG_1001502 1001502 #define GFARM_MSG_1001503 1001503 #define GFARM_MSG_1001504 1001504 #define GFARM_MSG_1001505 1001505 #define GFARM_MSG_1001506 1001506 #define GFARM_MSG_1001507 1001507 #define GFARM_MSG_1001508 1001508 #define GFARM_MSG_1001509 1001509 #define GFARM_MSG_1001510 1001510 #define GFARM_MSG_1001511 1001511 #define GFARM_MSG_1001512 1001512 #define GFARM_MSG_1001513 1001513 #define GFARM_MSG_1001514 1001514 #define GFARM_MSG_1001515 1001515 #define GFARM_MSG_1001516 1001516 #define GFARM_MSG_1001517 1001517 #define GFARM_MSG_1001518 1001518 #define GFARM_MSG_1001519 1001519 #define GFARM_MSG_1001520 1001520 #define GFARM_MSG_1001521 1001521 #define GFARM_MSG_1001522 1001522 #define GFARM_MSG_1001523 1001523 #define GFARM_MSG_1001524 1001524 #define GFARM_MSG_1001525 1001525 #define GFARM_MSG_1001526 1001526 #define GFARM_MSG_1001527 1001527 #define GFARM_MSG_1001528 1001528 #define GFARM_MSG_1001529 1001529 #define GFARM_MSG_1001530 1001530 #define GFARM_MSG_1001531 1001531 #define GFARM_MSG_1001532 1001532 #define GFARM_MSG_1001533 1001533 #define GFARM_MSG_1001534 1001534 #define GFARM_MSG_1001535 1001535 #define GFARM_MSG_1001536 1001536 #define GFARM_MSG_1001537 1001537 #define GFARM_MSG_1001538 1001538 #define GFARM_MSG_1001539 1001539 #define GFARM_MSG_1001540 1001540 #define GFARM_MSG_1001541 1001541 #define GFARM_MSG_1001542 1001542 #define GFARM_MSG_1001543 1001543 #define GFARM_MSG_1001544 1001544 #define GFARM_MSG_1001545 1001545 #define GFARM_MSG_1001546 1001546 #define GFARM_MSG_1001547 1001547 #define GFARM_MSG_1001548 1001548 #define GFARM_MSG_1001549 1001549 #define GFARM_MSG_1001550 1001550 #define GFARM_MSG_1001551 1001551 #define GFARM_MSG_1001552 1001552 #define GFARM_MSG_1001553 1001553 #define GFARM_MSG_1001554 1001554 #define GFARM_MSG_1001555 1001555 #define GFARM_MSG_1001556 1001556 #define GFARM_MSG_1001557 1001557 #define GFARM_MSG_1001558 1001558 #define GFARM_MSG_1001559 1001559 #define GFARM_MSG_1001560 1001560 #define GFARM_MSG_1001561 1001561 #define GFARM_MSG_1001562 1001562 #define GFARM_MSG_1001563 1001563 #define GFARM_MSG_1001564 1001564 #define GFARM_MSG_1001565 1001565 #define GFARM_MSG_1001566 1001566 #define GFARM_MSG_1001567 1001567 #define GFARM_MSG_1001568 1001568 #define GFARM_MSG_1001569 1001569 #define GFARM_MSG_1001570 1001570 #define GFARM_MSG_1001571 1001571 #define GFARM_MSG_1001572 1001572 #define GFARM_MSG_1001573 1001573 #define GFARM_MSG_1001574 1001574 #define GFARM_MSG_1001575 1001575 #define GFARM_MSG_1001576 1001576 #define GFARM_MSG_1001577 1001577 #define GFARM_MSG_1001578 1001578 #define GFARM_MSG_1001579 1001579 #define GFARM_MSG_1001580 1001580 #define GFARM_MSG_1001581 1001581 #define GFARM_MSG_1001582 1001582 #define GFARM_MSG_1001583 1001583 #define GFARM_MSG_1001584 1001584 #define GFARM_MSG_1001585 1001585 #define GFARM_MSG_1001586 1001586 #define GFARM_MSG_1001587 1001587 #define GFARM_MSG_1001588 1001588 #define GFARM_MSG_1001589 1001589 #define GFARM_MSG_1001590 1001590 #define GFARM_MSG_1001591 1001591 #define GFARM_MSG_1001592 1001592 #define GFARM_MSG_1001593 1001593 #define GFARM_MSG_1001594 1001594 #define GFARM_MSG_1001595 1001595 #define GFARM_MSG_1001596 1001596 #define GFARM_MSG_1001597 1001597 #define GFARM_MSG_1001598 1001598 #define GFARM_MSG_1001599 1001599 #define GFARM_MSG_1001600 1001600 #define GFARM_MSG_1001601 1001601 #define GFARM_MSG_1001602 1001602 #define GFARM_MSG_1001603 1001603 #define GFARM_MSG_1001604 1001604 #define GFARM_MSG_1001605 1001605 #define GFARM_MSG_1001606 1001606 #define GFARM_MSG_1001607 1001607 #define GFARM_MSG_1001608 1001608 #define GFARM_MSG_1001609 1001609 #define GFARM_MSG_1001610 1001610 #define GFARM_MSG_1001611 1001611 #define GFARM_MSG_1001612 1001612 #define GFARM_MSG_1001613 1001613 #define GFARM_MSG_1001614 1001614 #define GFARM_MSG_1001615 1001615 #define GFARM_MSG_1001616 1001616 #define GFARM_MSG_1001617 1001617 #define GFARM_MSG_1001618 1001618 #define GFARM_MSG_1001619 1001619 #define GFARM_MSG_1001620 1001620 #define GFARM_MSG_1001621 1001621 #define GFARM_MSG_1001622 1001622 #define GFARM_MSG_1001623 1001623 #define GFARM_MSG_1001624 1001624 #define GFARM_MSG_1001625 1001625 #define GFARM_MSG_1001626 1001626 #define GFARM_MSG_1001627 1001627 #define GFARM_MSG_1001628 1001628 #define GFARM_MSG_1001629 1001629 #define GFARM_MSG_1001630 1001630 #define GFARM_MSG_1001631 1001631 #define GFARM_MSG_1001632 1001632 #define GFARM_MSG_1001633 1001633 #define GFARM_MSG_1001634 1001634 #define GFARM_MSG_1001635 1001635 #define GFARM_MSG_1001636 1001636 #define GFARM_MSG_1001637 1001637 #define GFARM_MSG_1001638 1001638 #define GFARM_MSG_1001639 1001639 #define GFARM_MSG_1001640 1001640 #define GFARM_MSG_1001641 1001641 #define GFARM_MSG_1001642 1001642 #define GFARM_MSG_1001643 1001643 #define GFARM_MSG_1001644 1001644 #define GFARM_MSG_1001645 1001645 #define GFARM_MSG_1001646 1001646 #define GFARM_MSG_1001647 1001647 #define GFARM_MSG_1001648 1001648 #define GFARM_MSG_1001649 1001649 #define GFARM_MSG_1001650 1001650 #define GFARM_MSG_1001651 1001651 #define GFARM_MSG_1001652 1001652 #define GFARM_MSG_1001653 1001653 #define GFARM_MSG_1001654 1001654 #define GFARM_MSG_1001655 1001655 #define GFARM_MSG_1001656 1001656 #define GFARM_MSG_1001657 1001657 #define GFARM_MSG_1001658 1001658 #define GFARM_MSG_1001659 1001659 #define GFARM_MSG_1001660 1001660 #define GFARM_MSG_1001661 1001661 #define GFARM_MSG_1001662 1001662 #define GFARM_MSG_1001663 1001663 #define GFARM_MSG_1001664 1001664 #define GFARM_MSG_1001665 1001665 #define GFARM_MSG_1001666 1001666 #define GFARM_MSG_1001667 1001667 #define GFARM_MSG_1001668 1001668 #define GFARM_MSG_1001669 1001669 #define GFARM_MSG_1001670 1001670 #define GFARM_MSG_1001671 1001671 #define GFARM_MSG_1001672 1001672 #define GFARM_MSG_1001673 1001673 #define GFARM_MSG_1001674 1001674 #define GFARM_MSG_1001675 1001675 #define GFARM_MSG_1001676 1001676 #define GFARM_MSG_1001677 1001677 #define GFARM_MSG_1001678 1001678 #define GFARM_MSG_1001679 1001679 #define GFARM_MSG_1001680 1001680 #define GFARM_MSG_1001681 1001681 #define GFARM_MSG_1001682 1001682 #define GFARM_MSG_1001683 1001683 #define GFARM_MSG_1001684 1001684 #define GFARM_MSG_1001685 1001685 #define GFARM_MSG_1001686 1001686 #define GFARM_MSG_1001687 1001687 #define GFARM_MSG_1001688 1001688 #define GFARM_MSG_1001689 1001689 #define GFARM_MSG_1001690 1001690 #define GFARM_MSG_1001691 1001691 #define GFARM_MSG_1001692 1001692 #define GFARM_MSG_1001693 1001693 #define GFARM_MSG_1001694 1001694 #define GFARM_MSG_1001695 1001695 #define GFARM_MSG_1001696 1001696 #define GFARM_MSG_1001697 1001697 #define GFARM_MSG_1001698 1001698 #define GFARM_MSG_1001699 1001699 #define GFARM_MSG_1001700 1001700 #define GFARM_MSG_1001701 1001701 #define GFARM_MSG_1001702 1001702 #define GFARM_MSG_1001703 1001703 #define GFARM_MSG_1001704 1001704 #define GFARM_MSG_1001705 1001705 #define GFARM_MSG_1001706 1001706 #define GFARM_MSG_1001707 1001707 #define GFARM_MSG_1001708 1001708 #define GFARM_MSG_1001709 1001709 #define GFARM_MSG_1001710 1001710 #define GFARM_MSG_1001711 1001711 #define GFARM_MSG_1001712 1001712 #define GFARM_MSG_1001713 1001713 #define GFARM_MSG_1001714 1001714 #define GFARM_MSG_1001715 1001715 #define GFARM_MSG_1001716 1001716 #define GFARM_MSG_1001717 1001717 #define GFARM_MSG_1001718 1001718 #define GFARM_MSG_1001719 1001719 #define GFARM_MSG_1001720 1001720 #define GFARM_MSG_1001721 1001721 #define GFARM_MSG_1001722 1001722 #define GFARM_MSG_1001723 1001723 #define GFARM_MSG_1001724 1001724 #define GFARM_MSG_1001725 1001725 #define GFARM_MSG_1001726 1001726 #define GFARM_MSG_1001727 1001727 #define GFARM_MSG_1001728 1001728 #define GFARM_MSG_1001729 1001729 #define GFARM_MSG_1001730 1001730 #define GFARM_MSG_1001731 1001731 #define GFARM_MSG_1001732 1001732 #define GFARM_MSG_1001733 1001733 #define GFARM_MSG_1001734 1001734 #define GFARM_MSG_1001735 1001735 #define GFARM_MSG_1001736 1001736 #define GFARM_MSG_1001737 1001737 #define GFARM_MSG_1001738 1001738 #define GFARM_MSG_1001739 1001739 #define GFARM_MSG_1001740 1001740 #define GFARM_MSG_1001741 1001741 #define GFARM_MSG_1001742 1001742 #define GFARM_MSG_1001743 1001743 #define GFARM_MSG_1001744 1001744 #define GFARM_MSG_1001745 1001745 #define GFARM_MSG_1001746 1001746 #define GFARM_MSG_1001747 1001747 #define GFARM_MSG_1001748 1001748 #define GFARM_MSG_1001749 1001749 #define GFARM_MSG_1001750 1001750 #define GFARM_MSG_1001751 1001751 #define GFARM_MSG_1001752 1001752 #define GFARM_MSG_1001753 1001753 #define GFARM_MSG_1001754 1001754 #define GFARM_MSG_1001755 1001755 #define GFARM_MSG_1001756 1001756 #define GFARM_MSG_1001757 1001757 #define GFARM_MSG_1001758 1001758 #define GFARM_MSG_1001759 1001759 #define GFARM_MSG_1001760 1001760 #define GFARM_MSG_1001761 1001761 #define GFARM_MSG_1001762 1001762 #define GFARM_MSG_1001763 1001763 #define GFARM_MSG_1001764 1001764 #define GFARM_MSG_1001765 1001765 #define GFARM_MSG_1001766 1001766 #define GFARM_MSG_1001767 1001767 #define GFARM_MSG_1001768 1001768 #define GFARM_MSG_1001769 1001769 #define GFARM_MSG_1001770 1001770 #define GFARM_MSG_1001771 1001771 #define GFARM_MSG_1001772 1001772 #define GFARM_MSG_1001773 1001773 #define GFARM_MSG_1001774 1001774 #define GFARM_MSG_1001775 1001775 #define GFARM_MSG_1001776 1001776 #define GFARM_MSG_1001777 1001777 #define GFARM_MSG_1001778 1001778 #define GFARM_MSG_1001779 1001779 #define GFARM_MSG_1001780 1001780 #define GFARM_MSG_1001781 1001781 #define GFARM_MSG_1001782 1001782 #define GFARM_MSG_1001783 1001783 #define GFARM_MSG_1001784 1001784 #define GFARM_MSG_1001785 1001785 #define GFARM_MSG_1001786 1001786 #define GFARM_MSG_1001787 1001787 #define GFARM_MSG_1001788 1001788 #define GFARM_MSG_1001789 1001789 #define GFARM_MSG_1001790 1001790 #define GFARM_MSG_1001791 1001791 #define GFARM_MSG_1001792 1001792 #define GFARM_MSG_1001793 1001793 #define GFARM_MSG_1001794 1001794 #define GFARM_MSG_1001795 1001795 #define GFARM_MSG_1001796 1001796 #define GFARM_MSG_1001797 1001797 #define GFARM_MSG_1001798 1001798 #define GFARM_MSG_1001799 1001799 #define GFARM_MSG_1001800 1001800 #define GFARM_MSG_1001801 1001801 #define GFARM_MSG_1001802 1001802 #define GFARM_MSG_1001803 1001803 #define GFARM_MSG_1001804 1001804 #define GFARM_MSG_1001805 1001805 #define GFARM_MSG_1001806 1001806 #define GFARM_MSG_1001807 1001807 #define GFARM_MSG_1001808 1001808 #define GFARM_MSG_1001809 1001809 #define GFARM_MSG_1001810 1001810 #define GFARM_MSG_1001811 1001811 #define GFARM_MSG_1001812 1001812 #define GFARM_MSG_1001813 1001813 #define GFARM_MSG_1001814 1001814 #define GFARM_MSG_1001815 1001815 #define GFARM_MSG_1001816 1001816 #define GFARM_MSG_1001817 1001817 #define GFARM_MSG_1001818 1001818 #define GFARM_MSG_1001819 1001819 #define GFARM_MSG_1001820 1001820 #define GFARM_MSG_1001821 1001821 #define GFARM_MSG_1001822 1001822 #define GFARM_MSG_1001823 1001823 #define GFARM_MSG_1001824 1001824 #define GFARM_MSG_1001825 1001825 #define GFARM_MSG_1001826 1001826 #define GFARM_MSG_1001827 1001827 #define GFARM_MSG_1001828 1001828 #define GFARM_MSG_1001829 1001829 #define GFARM_MSG_1001830 1001830 #define GFARM_MSG_1001831 1001831 #define GFARM_MSG_1001832 1001832 #define GFARM_MSG_1001833 1001833 #define GFARM_MSG_1001834 1001834 #define GFARM_MSG_1001835 1001835 #define GFARM_MSG_1001836 1001836 #define GFARM_MSG_1001837 1001837 #define GFARM_MSG_1001838 1001838 #define GFARM_MSG_1001839 1001839 #define GFARM_MSG_1001840 1001840 #define GFARM_MSG_1001841 1001841 #define GFARM_MSG_1001842 1001842 #define GFARM_MSG_1001843 1001843 #define GFARM_MSG_1001844 1001844 #define GFARM_MSG_1001845 1001845 #define GFARM_MSG_1001846 1001846 #define GFARM_MSG_1001847 1001847 #define GFARM_MSG_1001848 1001848 #define GFARM_MSG_1001849 1001849 #define GFARM_MSG_1001850 1001850 #define GFARM_MSG_1001851 1001851 #define GFARM_MSG_1001852 1001852 #define GFARM_MSG_1001853 1001853 #define GFARM_MSG_1001854 1001854 #define GFARM_MSG_1001855 1001855 #define GFARM_MSG_1001856 1001856 #define GFARM_MSG_1001857 1001857 #define GFARM_MSG_1001858 1001858 #define GFARM_MSG_1001859 1001859 #define GFARM_MSG_1001860 1001860 #define GFARM_MSG_1001861 1001861 #define GFARM_MSG_1001862 1001862 #define GFARM_MSG_1001863 1001863 #define GFARM_MSG_1001864 1001864 #define GFARM_MSG_1001865 1001865 #define GFARM_MSG_1001866 1001866 #define GFARM_MSG_1001867 1001867 #define GFARM_MSG_1001868 1001868 #define GFARM_MSG_1001869 1001869 #define GFARM_MSG_1001870 1001870 #define GFARM_MSG_1001871 1001871 #define GFARM_MSG_1001872 1001872 #define GFARM_MSG_1001873 1001873 #define GFARM_MSG_1001874 1001874 #define GFARM_MSG_1001875 1001875 #define GFARM_MSG_1001876 1001876 #define GFARM_MSG_1001877 1001877 #define GFARM_MSG_1001878 1001878 #define GFARM_MSG_1001879 1001879 #define GFARM_MSG_1001880 1001880 #define GFARM_MSG_1001881 1001881 #define GFARM_MSG_1001882 1001882 #define GFARM_MSG_1001883 1001883 #define GFARM_MSG_1001884 1001884 #define GFARM_MSG_1001885 1001885 #define GFARM_MSG_1001886 1001886 #define GFARM_MSG_1001887 1001887 #define GFARM_MSG_1001888 1001888 #define GFARM_MSG_1001889 1001889 #define GFARM_MSG_1001890 1001890 #define GFARM_MSG_1001891 1001891 #define GFARM_MSG_1001892 1001892 #define GFARM_MSG_1001893 1001893 #define GFARM_MSG_1001894 1001894 #define GFARM_MSG_1001895 1001895 #define GFARM_MSG_1001896 1001896 #define GFARM_MSG_1001897 1001897 #define GFARM_MSG_1001898 1001898 #define GFARM_MSG_1001899 1001899 #define GFARM_MSG_1001900 1001900 #define GFARM_MSG_1001901 1001901 #define GFARM_MSG_1001902 1001902 #define GFARM_MSG_1001903 1001903 #define GFARM_MSG_1001904 1001904 #define GFARM_MSG_1001905 1001905 #define GFARM_MSG_1001906 1001906 #define GFARM_MSG_1001907 1001907 #define GFARM_MSG_1001908 1001908 #define GFARM_MSG_1001909 1001909 #define GFARM_MSG_1001910 1001910 #define GFARM_MSG_1001911 1001911 #define GFARM_MSG_1001912 1001912 #define GFARM_MSG_1001913 1001913 #define GFARM_MSG_1001914 1001914 #define GFARM_MSG_1001915 1001915 #define GFARM_MSG_1001916 1001916 #define GFARM_MSG_1001917 1001917 #define GFARM_MSG_1001918 1001918 #define GFARM_MSG_1001919 1001919 #define GFARM_MSG_1001920 1001920 #define GFARM_MSG_1001921 1001921 #define GFARM_MSG_1001922 1001922 #define GFARM_MSG_1001923 1001923 #define GFARM_MSG_1001924 1001924 #define GFARM_MSG_1001925 1001925 #define GFARM_MSG_1001926 1001926 #define GFARM_MSG_1001927 1001927 #define GFARM_MSG_1001928 1001928 #define GFARM_MSG_1001929 1001929 #define GFARM_MSG_1001930 1001930 #define GFARM_MSG_1001931 1001931 #define GFARM_MSG_1001932 1001932 #define GFARM_MSG_1001933 1001933 #define GFARM_MSG_1001934 1001934 #define GFARM_MSG_1001935 1001935 #define GFARM_MSG_1001936 1001936 #define GFARM_MSG_1001937 1001937 #define GFARM_MSG_1001938 1001938 #define GFARM_MSG_1001939 1001939 #define GFARM_MSG_1001940 1001940 #define GFARM_MSG_1001941 1001941 #define GFARM_MSG_1001942 1001942 #define GFARM_MSG_1001943 1001943 #define GFARM_MSG_1001944 1001944 #define GFARM_MSG_1001945 1001945 #define GFARM_MSG_1001946 1001946 #define GFARM_MSG_1001947 1001947 #define GFARM_MSG_1001948 1001948 #define GFARM_MSG_1001949 1001949 #define GFARM_MSG_1001950 1001950 #define GFARM_MSG_1001951 1001951 #define GFARM_MSG_1001952 1001952 #define GFARM_MSG_1001953 1001953 #define GFARM_MSG_1001954 1001954 #define GFARM_MSG_1001955 1001955 #define GFARM_MSG_1001956 1001956 #define GFARM_MSG_1001957 1001957 #define GFARM_MSG_1001958 1001958 #define GFARM_MSG_1001959 1001959 #define GFARM_MSG_1001960 1001960 #define GFARM_MSG_1001961 1001961 #define GFARM_MSG_1001962 1001962 #define GFARM_MSG_1001963 1001963 #define GFARM_MSG_1001964 1001964 #define GFARM_MSG_1001965 1001965 #define GFARM_MSG_1001966 1001966 #define GFARM_MSG_1001967 1001967 #define GFARM_MSG_1001968 1001968 #define GFARM_MSG_1001969 1001969 #define GFARM_MSG_1001970 1001970 #define GFARM_MSG_1001971 1001971 #define GFARM_MSG_1001972 1001972 #define GFARM_MSG_1001973 1001973 #define GFARM_MSG_1001974 1001974 #define GFARM_MSG_1001975 1001975 #define GFARM_MSG_1001976 1001976 #define GFARM_MSG_1001977 1001977 #define GFARM_MSG_1001978 1001978 #define GFARM_MSG_1001979 1001979 #define GFARM_MSG_1001980 1001980 #define GFARM_MSG_1001981 1001981 #define GFARM_MSG_1001982 1001982 #define GFARM_MSG_1001983 1001983 #define GFARM_MSG_1001984 1001984 #define GFARM_MSG_1001985 1001985 #define GFARM_MSG_1001986 1001986 #define GFARM_MSG_1001987 1001987 #define GFARM_MSG_1001988 1001988 #define GFARM_MSG_1001989 1001989 #define GFARM_MSG_1001990 1001990 #define GFARM_MSG_1001991 1001991 #define GFARM_MSG_1001992 1001992 #define GFARM_MSG_1001993 1001993 #define GFARM_MSG_1001994 1001994 #define GFARM_MSG_1001995 1001995 #define GFARM_MSG_1001996 1001996 #define GFARM_MSG_1001997 1001997 #define GFARM_MSG_1001998 1001998 #define GFARM_MSG_1001999 1001999 #define GFARM_MSG_1002000 1002000 #define GFARM_MSG_1002001 1002001 #define GFARM_MSG_1002002 1002002 #define GFARM_MSG_1002003 1002003 #define GFARM_MSG_1002004 1002004 #define GFARM_MSG_1002005 1002005 #define GFARM_MSG_1002006 1002006 #define GFARM_MSG_1002007 1002007 #define GFARM_MSG_1002008 1002008 #define GFARM_MSG_1002009 1002009 #define GFARM_MSG_1002010 1002010 #define GFARM_MSG_1002011 1002011 #define GFARM_MSG_1002012 1002012 #define GFARM_MSG_1002013 1002013 #define GFARM_MSG_1002014 1002014 #define GFARM_MSG_1002015 1002015 #define GFARM_MSG_1002016 1002016 #define GFARM_MSG_1002017 1002017 #define GFARM_MSG_1002018 1002018 #define GFARM_MSG_1002019 1002019 #define GFARM_MSG_1002020 1002020 #define GFARM_MSG_1002021 1002021 #define GFARM_MSG_1002022 1002022 #define GFARM_MSG_1002023 1002023 #define GFARM_MSG_1002024 1002024 #define GFARM_MSG_1002025 1002025 #define GFARM_MSG_1002026 1002026 #define GFARM_MSG_1002027 1002027 #define GFARM_MSG_1002028 1002028 #define GFARM_MSG_1002029 1002029 #define GFARM_MSG_1002030 1002030 #define GFARM_MSG_1002031 1002031 #define GFARM_MSG_1002032 1002032 #define GFARM_MSG_1002033 1002033 #define GFARM_MSG_1002034 1002034 #define GFARM_MSG_1002035 1002035 #define GFARM_MSG_1002036 1002036 #define GFARM_MSG_1002037 1002037 #define GFARM_MSG_1002038 1002038 #define GFARM_MSG_1002039 1002039 #define GFARM_MSG_1002040 1002040 #define GFARM_MSG_1002041 1002041 #define GFARM_MSG_1002042 1002042 #define GFARM_MSG_1002043 1002043 #define GFARM_MSG_1002044 1002044 #define GFARM_MSG_1002045 1002045 #define GFARM_MSG_1002046 1002046 #define GFARM_MSG_1002047 1002047 #define GFARM_MSG_1002048 1002048 #define GFARM_MSG_1002049 1002049 #define GFARM_MSG_1002050 1002050 #define GFARM_MSG_1002051 1002051 #define GFARM_MSG_1002052 1002052 #define GFARM_MSG_1002053 1002053 #define GFARM_MSG_1002054 1002054 #define GFARM_MSG_1002055 1002055 #define GFARM_MSG_1002056 1002056 #define GFARM_MSG_1002057 1002057 #define GFARM_MSG_1002058 1002058 #define GFARM_MSG_1002059 1002059 #define GFARM_MSG_1002060 1002060 #define GFARM_MSG_1002061 1002061 #define GFARM_MSG_1002062 1002062 #define GFARM_MSG_1002063 1002063 #define GFARM_MSG_1002064 1002064 #define GFARM_MSG_1002065 1002065 #define GFARM_MSG_1002066 1002066 #define GFARM_MSG_1002067 1002067 #define GFARM_MSG_1002068 1002068 #define GFARM_MSG_1002069 1002069 #define GFARM_MSG_1002070 1002070 #define GFARM_MSG_1002071 1002071 #define GFARM_MSG_1002072 1002072 #define GFARM_MSG_1002073 1002073 #define GFARM_MSG_1002074 1002074 #define GFARM_MSG_1002075 1002075 #define GFARM_MSG_1002076 1002076 #define GFARM_MSG_1002077 1002077 #define GFARM_MSG_1002078 1002078 #define GFARM_MSG_1002079 1002079 #define GFARM_MSG_1002080 1002080 #define GFARM_MSG_1002081 1002081 #define GFARM_MSG_1002082 1002082 #define GFARM_MSG_1002083 1002083 #define GFARM_MSG_1002084 1002084 #define GFARM_MSG_1002085 1002085 #define GFARM_MSG_1002086 1002086 #define GFARM_MSG_1002087 1002087 #define GFARM_MSG_1002088 1002088 #define GFARM_MSG_1002089 1002089 #define GFARM_MSG_1002090 1002090 #define GFARM_MSG_1002091 1002091 #define GFARM_MSG_1002092 1002092 #define GFARM_MSG_1002093 1002093 #define GFARM_MSG_1002094 1002094 #define GFARM_MSG_1002095 1002095 #define GFARM_MSG_1002096 1002096 #define GFARM_MSG_1002097 1002097 #define GFARM_MSG_1002098 1002098 #define GFARM_MSG_1002099 1002099 #define GFARM_MSG_1002100 1002100 #define GFARM_MSG_1002101 1002101 #define GFARM_MSG_1002102 1002102 #define GFARM_MSG_1002103 1002103 #define GFARM_MSG_1002104 1002104 #define GFARM_MSG_1002105 1002105 #define GFARM_MSG_1002106 1002106 #define GFARM_MSG_1002107 1002107 #define GFARM_MSG_1002108 1002108 #define GFARM_MSG_1002109 1002109 #define GFARM_MSG_1002110 1002110 #define GFARM_MSG_1002111 1002111 #define GFARM_MSG_1002112 1002112 #define GFARM_MSG_1002113 1002113 #define GFARM_MSG_1002114 1002114 #define GFARM_MSG_1002115 1002115 #define GFARM_MSG_1002116 1002116 #define GFARM_MSG_1002117 1002117 #define GFARM_MSG_1002118 1002118 #define GFARM_MSG_1002119 1002119 #define GFARM_MSG_1002120 1002120 #define GFARM_MSG_1002121 1002121 #define GFARM_MSG_1002122 1002122 #define GFARM_MSG_1002123 1002123 #define GFARM_MSG_1002124 1002124 #define GFARM_MSG_1002125 1002125 #define GFARM_MSG_1002126 1002126 #define GFARM_MSG_1002127 1002127 #define GFARM_MSG_1002128 1002128 #define GFARM_MSG_1002129 1002129 #define GFARM_MSG_1002130 1002130 #define GFARM_MSG_1002131 1002131 #define GFARM_MSG_1002132 1002132 #define GFARM_MSG_1002133 1002133 #define GFARM_MSG_1002134 1002134 #define GFARM_MSG_1002135 1002135 #define GFARM_MSG_1002136 1002136 #define GFARM_MSG_1002137 1002137 #define GFARM_MSG_1002138 1002138 #define GFARM_MSG_1002139 1002139 #define GFARM_MSG_1002140 1002140 #define GFARM_MSG_1002141 1002141 #define GFARM_MSG_1002142 1002142 #define GFARM_MSG_1002143 1002143 #define GFARM_MSG_1002144 1002144 #define GFARM_MSG_1002145 1002145 #define GFARM_MSG_1002146 1002146 #define GFARM_MSG_1002147 1002147 #define GFARM_MSG_1002148 1002148 #define GFARM_MSG_1002149 1002149 #define GFARM_MSG_1002150 1002150 #define GFARM_MSG_1002151 1002151 #define GFARM_MSG_1002152 1002152 #define GFARM_MSG_1002153 1002153 #define GFARM_MSG_1002154 1002154 #define GFARM_MSG_1002155 1002155 #define GFARM_MSG_1002156 1002156 #define GFARM_MSG_1002157 1002157 #define GFARM_MSG_1002158 1002158 #define GFARM_MSG_1002159 1002159 #define GFARM_MSG_1002160 1002160 #define GFARM_MSG_1002161 1002161 #define GFARM_MSG_1002162 1002162 #define GFARM_MSG_1002163 1002163 #define GFARM_MSG_1002164 1002164 #define GFARM_MSG_1002165 1002165 #define GFARM_MSG_1002166 1002166 #define GFARM_MSG_1002167 1002167 #define GFARM_MSG_1002168 1002168 #define GFARM_MSG_1002169 1002169 #define GFARM_MSG_1002170 1002170 #define GFARM_MSG_1002171 1002171 #define GFARM_MSG_1002172 1002172 #define GFARM_MSG_1002173 1002173 #define GFARM_MSG_1002174 1002174 #define GFARM_MSG_1002175 1002175 #define GFARM_MSG_1002176 1002176 #define GFARM_MSG_1002177 1002177 #define GFARM_MSG_1002178 1002178 #define GFARM_MSG_1002179 1002179 #define GFARM_MSG_1002180 1002180 #define GFARM_MSG_1002181 1002181 #define GFARM_MSG_1002182 1002182 #define GFARM_MSG_1002183 1002183 #define GFARM_MSG_1002184 1002184 #define GFARM_MSG_1002185 1002185 #define GFARM_MSG_1002186 1002186 #define GFARM_MSG_1002187 1002187 #define GFARM_MSG_1002188 1002188 #define GFARM_MSG_1002189 1002189 #define GFARM_MSG_1002190 1002190 #define GFARM_MSG_1002191 1002191 #define GFARM_MSG_1002192 1002192 #define GFARM_MSG_1002193 1002193 #define GFARM_MSG_1002194 1002194 #define GFARM_MSG_1002195 1002195 #define GFARM_MSG_1002196 1002196 #define GFARM_MSG_1002197 1002197 #define GFARM_MSG_1002198 1002198 #define GFARM_MSG_1002199 1002199 #define GFARM_MSG_1002200 1002200 #define GFARM_MSG_1002201 1002201 #define GFARM_MSG_1002202 1002202 #define GFARM_MSG_1002203 1002203 #define GFARM_MSG_1002204 1002204 #define GFARM_MSG_1002205 1002205 #define GFARM_MSG_1002206 1002206 #define GFARM_MSG_1002207 1002207 #define GFARM_MSG_1002208 1002208 #define GFARM_MSG_1002209 1002209 #define GFARM_MSG_1002210 1002210 #define GFARM_MSG_1002211 1002211 #define GFARM_MSG_1002212 1002212 #define GFARM_MSG_1002213 1002213 #define GFARM_MSG_1002214 1002214 #define GFARM_MSG_1002215 1002215 #define GFARM_MSG_1002216 1002216 #define GFARM_MSG_1002217 1002217 #define GFARM_MSG_1002218 1002218 #define GFARM_MSG_1002219 1002219 #define GFARM_MSG_1002220 1002220 #define GFARM_MSG_1002221 1002221 #define GFARM_MSG_1002222 1002222 #define GFARM_MSG_1002223 1002223 #define GFARM_MSG_1002224 1002224 #define GFARM_MSG_1002225 1002225 #define GFARM_MSG_1002226 1002226 #define GFARM_MSG_1002227 1002227 #define GFARM_MSG_1002228 1002228 #define GFARM_MSG_1002229 1002229 #define GFARM_MSG_1002230 1002230 #define GFARM_MSG_1002231 1002231 #define GFARM_MSG_1002232 1002232 #define GFARM_MSG_1002233 1002233 #define GFARM_MSG_1002234 1002234 #define GFARM_MSG_1002235 1002235 #define GFARM_MSG_1002236 1002236 #define GFARM_MSG_1002237 1002237 #define GFARM_MSG_1002238 1002238 #define GFARM_MSG_1002239 1002239 #define GFARM_MSG_1002240 1002240 #define GFARM_MSG_1002241 1002241 #define GFARM_MSG_1002242 1002242 #define GFARM_MSG_1002243 1002243 #define GFARM_MSG_1002244 1002244 #define GFARM_MSG_1002245 1002245 #define GFARM_MSG_1002246 1002246 #define GFARM_MSG_1002247 1002247 #define GFARM_MSG_1002248 1002248 #define GFARM_MSG_1002249 1002249 #define GFARM_MSG_1002250 1002250 #define GFARM_MSG_1002251 1002251 #define GFARM_MSG_1002252 1002252 #define GFARM_MSG_1002253 1002253 #define GFARM_MSG_1002254 1002254 #define GFARM_MSG_1002255 1002255 #define GFARM_MSG_1002256 1002256 #define GFARM_MSG_1002257 1002257 #define GFARM_MSG_1002258 1002258 #define GFARM_MSG_1002259 1002259 #define GFARM_MSG_1002260 1002260 #define GFARM_MSG_1002261 1002261 #define GFARM_MSG_1002262 1002262 #define GFARM_MSG_1002263 1002263 #define GFARM_MSG_1002264 1002264 #define GFARM_MSG_1002265 1002265 #define GFARM_MSG_1002266 1002266 #define GFARM_MSG_1002267 1002267 #define GFARM_MSG_1002268 1002268 #define GFARM_MSG_1002269 1002269 #define GFARM_MSG_1002270 1002270 #define GFARM_MSG_1002271 1002271 #define GFARM_MSG_1002272 1002272 #define GFARM_MSG_1002273 1002273 #define GFARM_MSG_1002274 1002274 #define GFARM_MSG_1002275 1002275 #define GFARM_MSG_1002276 1002276 #define GFARM_MSG_1002277 1002277 #define GFARM_MSG_1002278 1002278 #define GFARM_MSG_1002279 1002279 #define GFARM_MSG_1002280 1002280 #define GFARM_MSG_1002281 1002281 #define GFARM_MSG_1002282 1002282 #define GFARM_MSG_1002283 1002283 #define GFARM_MSG_1002284 1002284 #define GFARM_MSG_1002285 1002285 #define GFARM_MSG_1002286 1002286 #define GFARM_MSG_1002287 1002287 #define GFARM_MSG_1002288 1002288 #define GFARM_MSG_1002289 1002289 #define GFARM_MSG_1002290 1002290 #define GFARM_MSG_1002291 1002291 #define GFARM_MSG_1002292 1002292 #define GFARM_MSG_1002293 1002293 #define GFARM_MSG_1002294 1002294 #define GFARM_MSG_1002295 1002295 #define GFARM_MSG_1002296 1002296 #define GFARM_MSG_1002297 1002297 #define GFARM_MSG_1002298 1002298 #define GFARM_MSG_1002299 1002299 #define GFARM_MSG_1002300 1002300 #define GFARM_MSG_1002301 1002301 #define GFARM_MSG_1002302 1002302 #define GFARM_MSG_1002303 1002303 #define GFARM_MSG_1002304 1002304 #define GFARM_MSG_1002305 1002305 #define GFARM_MSG_1002306 1002306 #define GFARM_MSG_1002307 1002307 #define GFARM_MSG_1002308 1002308 #define GFARM_MSG_1002309 1002309 #define GFARM_MSG_1002310 1002310 #define GFARM_MSG_1002311 1002311 #define GFARM_MSG_1002312 1002312 #define GFARM_MSG_1002313 1002313 #define GFARM_MSG_1002314 1002314 #define GFARM_MSG_1002315 1002315 #define GFARM_MSG_1002316 1002316 #define GFARM_MSG_1002317 1002317 #define GFARM_MSG_1002318 1002318 #define GFARM_MSG_1002319 1002319 #define GFARM_MSG_1002320 1002320 #define GFARM_MSG_1002321 1002321 #define GFARM_MSG_1002322 1002322 #define GFARM_MSG_1002323 1002323 #define GFARM_MSG_1002324 1002324 #define GFARM_MSG_1002325 1002325 #define GFARM_MSG_1002326 1002326 #define GFARM_MSG_1002327 1002327 #define GFARM_MSG_1002328 1002328 #define GFARM_MSG_1002329 1002329 #define GFARM_MSG_1002330 1002330 #define GFARM_MSG_1002331 1002331 #define GFARM_MSG_1002332 1002332 #define GFARM_MSG_1002333 1002333 #define GFARM_MSG_1002334 1002334 #define GFARM_MSG_1002335 1002335 #define GFARM_MSG_1002336 1002336 #define GFARM_MSG_1002337 1002337 #define GFARM_MSG_1002338 1002338 #define GFARM_MSG_1002339 1002339 #define GFARM_MSG_1002340 1002340 #define GFARM_MSG_1002341 1002341 #define GFARM_MSG_1002342 1002342 #define GFARM_MSG_1002343 1002343 #define GFARM_MSG_1002344 1002344 #define GFARM_MSG_1002345 1002345 #define GFARM_MSG_1002346 1002346 #define GFARM_MSG_1002347 1002347 #define GFARM_MSG_1002348 1002348 #define GFARM_MSG_1002349 1002349 #define GFARM_MSG_1002350 1002350 #define GFARM_MSG_1002351 1002351 #define GFARM_MSG_1002352 1002352 #define GFARM_MSG_1002353 1002353 #define GFARM_MSG_1002354 1002354 #define GFARM_MSG_1002355 1002355 #define GFARM_MSG_1002356 1002356 #define GFARM_MSG_1002357 1002357 #define GFARM_MSG_1002358 1002358 #define GFARM_MSG_1002359 1002359 #define GFARM_MSG_1002360 1002360 #define GFARM_MSG_1002361 1002361 #define GFARM_MSG_1002362 1002362 #define GFARM_MSG_1002363 1002363 #define GFARM_MSG_1002364 1002364 #define GFARM_MSG_1002365 1002365 #define GFARM_MSG_1002366 1002366 #define GFARM_MSG_1002367 1002367 #define GFARM_MSG_1002368 1002368 #define GFARM_MSG_1002369 1002369 #define GFARM_MSG_1002370 1002370 #define GFARM_MSG_1002371 1002371 #define GFARM_MSG_1002372 1002372 #define GFARM_MSG_1002373 1002373 #define GFARM_MSG_1002374 1002374 #define GFARM_MSG_1002375 1002375 #define GFARM_MSG_1002376 1002376 #define GFARM_MSG_1002377 1002377 #define GFARM_MSG_1002378 1002378 #define GFARM_MSG_1002379 1002379 #define GFARM_MSG_1002380 1002380 #define GFARM_MSG_1002381 1002381 #define GFARM_MSG_1002382 1002382 #define GFARM_MSG_1002383 1002383 #define GFARM_MSG_1002384 1002384 #define GFARM_MSG_1002385 1002385 #define GFARM_MSG_1002386 1002386 #define GFARM_MSG_1002387 1002387 #define GFARM_MSG_1002388 1002388 #define GFARM_MSG_1002389 1002389 #define GFARM_MSG_1002390 1002390 #define GFARM_MSG_1002391 1002391 #define GFARM_MSG_1002392 1002392 #define GFARM_MSG_1002393 1002393 #define GFARM_MSG_1002394 1002394 #define GFARM_MSG_1002395 1002395 #define GFARM_MSG_1002396 1002396 #define GFARM_MSG_1002397 1002397 #define GFARM_MSG_1002398 1002398 #define GFARM_MSG_1002399 1002399 #define GFARM_MSG_1002400 1002400 #define GFARM_MSG_1002401 1002401 #define GFARM_MSG_1002402 1002402 #define GFARM_MSG_1002403 1002403 #define GFARM_MSG_1002404 1002404 #define GFARM_MSG_1002405 1002405 #define GFARM_MSG_1002406 1002406 #define GFARM_MSG_1002407 1002407 #define GFARM_MSG_1002408 1002408 #define GFARM_MSG_1002409 1002409 #define GFARM_MSG_1002410 1002410 #define GFARM_MSG_1002411 1002411 #define GFARM_MSG_1002412 1002412 #define GFARM_MSG_1002413 1002413 #define GFARM_MSG_1002414 1002414 #define GFARM_MSG_1002415 1002415 #define GFARM_MSG_1002416 1002416 #define GFARM_MSG_1002417 1002417 #define GFARM_MSG_1002418 1002418 #define GFARM_MSG_1002419 1002419 #define GFARM_MSG_1002420 1002420 #define GFARM_MSG_1002421 1002421 #define GFARM_MSG_1002422 1002422 #define GFARM_MSG_1002423 1002423 #define GFARM_MSG_1002424 1002424 #define GFARM_MSG_1002425 1002425 #define GFARM_MSG_1002426 1002426 #define GFARM_MSG_1002427 1002427 #define GFARM_MSG_1002428 1002428 #define GFARM_MSG_1002429 1002429 #define GFARM_MSG_1002430 1002430 #define GFARM_MSG_1002431 1002431 #define GFARM_MSG_1002432 1002432 #define GFARM_MSG_1002433 1002433 #define GFARM_MSG_1002434 1002434 #define GFARM_MSG_1002435 1002435 #define GFARM_MSG_1002436 1002436 #define GFARM_MSG_1002437 1002437 #define GFARM_MSG_1002438 1002438 #define GFARM_MSG_1002439 1002439 #define GFARM_MSG_1002440 1002440 #define GFARM_MSG_1002441 1002441 #define GFARM_MSG_1002442 1002442 #define GFARM_MSG_1002443 1002443 #define GFARM_MSG_1002444 1002444 #define GFARM_MSG_1002445 1002445 #define GFARM_MSG_1002446 1002446 #define GFARM_MSG_1002447 1002447 #define GFARM_MSG_1002448 1002448 #define GFARM_MSG_1002449 1002449 #define GFARM_MSG_1002450 1002450 #define GFARM_MSG_1002451 1002451 #define GFARM_MSG_1002452 1002452 #define GFARM_MSG_1002453 1002453 #define GFARM_MSG_1002454 1002454 #define GFARM_MSG_1002455 1002455 #define GFARM_MSG_1002456 1002456 #define GFARM_MSG_1002457 1002457 #define GFARM_MSG_1002458 1002458 #define GFARM_MSG_1002459 1002459 #define GFARM_MSG_1002460 1002460 #define GFARM_MSG_1002461 1002461 #define GFARM_MSG_1002462 1002462 #define GFARM_MSG_1002463 1002463 #define GFARM_MSG_1002464 1002464 #define GFARM_MSG_1002465 1002465 #define GFARM_MSG_1002466 1002466 #define GFARM_MSG_1002467 1002467 #define GFARM_MSG_1002468 1002468 #define GFARM_MSG_1002469 1002469 #define GFARM_MSG_1002470 1002470 #define GFARM_MSG_1002471 1002471 #define GFARM_MSG_1002472 1002472 #define GFARM_MSG_1002473 1002473 #define GFARM_MSG_1002474 1002474 #define GFARM_MSG_1002475 1002475 #define GFARM_MSG_1002476 1002476 #define GFARM_MSG_1002477 1002477 #define GFARM_MSG_1002478 1002478 #define GFARM_MSG_1002479 1002479 #define GFARM_MSG_1002480 1002480 #define GFARM_MSG_1002481 1002481 #define GFARM_MSG_1002482 1002482 #define GFARM_MSG_1002483 1002483 #define GFARM_MSG_1002484 1002484 #define GFARM_MSG_1002485 1002485 #define GFARM_MSG_1002486 1002486 #define GFARM_MSG_1002487 1002487 #define GFARM_MSG_1002488 1002488 #define GFARM_MSG_1002489 1002489 #define GFARM_MSG_1002490 1002490 #define GFARM_MSG_1002491 1002491 #define GFARM_MSG_1002492 1002492 #define GFARM_MSG_1002493 1002493 #define GFARM_MSG_1002494 1002494 #define GFARM_MSG_1002495 1002495 #define GFARM_MSG_1002496 1002496 #define GFARM_MSG_1002497 1002497 #define GFARM_MSG_1002498 1002498 #define GFARM_MSG_1002499 1002499 #define GFARM_MSG_1002500 1002500 #define GFARM_MSG_1002501 1002501 #define GFARM_MSG_1002502 1002502 #define GFARM_MSG_1002503 1002503 #define GFARM_MSG_1002504 1002504 #define GFARM_MSG_1002505 1002505 #define GFARM_MSG_1002506 1002506 #define GFARM_MSG_1002507 1002507 #define GFARM_MSG_1002508 1002508 #define GFARM_MSG_1002509 1002509 #define GFARM_MSG_1002510 1002510 #define GFARM_MSG_1002511 1002511 #define GFARM_MSG_1002512 1002512 #define GFARM_MSG_1002513 1002513 #define GFARM_MSG_1002514 1002514 #define GFARM_MSG_1002515 1002515 #define GFARM_MSG_1002516 1002516 #define GFARM_MSG_1002517 1002517 #define GFARM_MSG_1002518 1002518 gfarm-2.4.1/include/gfarm/gfs_hook.h0000644000000000000000000000101011507222717015773 0ustar rootroot/* * $Id: gfs_hook.h 1210 2004-07-08 16:21:38Z tatebe $ */ void gfs_hook_set_default_view_local(); void gfs_hook_set_default_view_index(int index, int nfrags); void gfs_hook_set_default_view_global(); void gfs_hook_set_default_view_section(char *); char *gfs_hook_set_view_local(int fd, int flags); char *gfs_hook_set_view_index( int fd, int nfrags, int index, char *host, int flags); char *gfs_hook_set_view_global(int fd, int flags); char *gfs_hook_set_view_section(int fd, char *section, char *host, int flags); gfarm-2.4.1/debian/0000755000000000000000000000000011507222730012531 5ustar rootrootgfarm-2.4.1/debian/gfarm-client.install0000644000000000000000000000172311507222716016500 0ustar rootrootdebian/tmp/usr/bin/gfarm-pcp debian/tmp/usr/bin/gfarm-prun debian/tmp/usr/bin/gfarm-ptool debian/tmp/usr/bin/gfdf debian/tmp/usr/bin/gfexport debian/tmp/usr/bin/gfhost debian/tmp/usr/bin/gfifo.sh debian/tmp/usr/bin/gfimport_fixed debian/tmp/usr/bin/gfimport_text debian/tmp/usr/bin/gfkey debian/tmp/usr/bin/gfls debian/tmp/usr/bin/gfmkdir debian/tmp/usr/bin/gfmpirun_p4 debian/tmp/usr/bin/gfps debian/tmp/usr/bin/gfpwd debian/tmp/usr/bin/gfq.sh debian/tmp/usr/bin/gfq_commit.sh debian/tmp/usr/bin/gfq_setup.sh debian/tmp/usr/bin/gfrcmd debian/tmp/usr/bin/gfreg debian/tmp/usr/bin/gfrep debian/tmp/usr/bin/gfrm debian/tmp/usr/bin/gfrmdir debian/tmp/usr/bin/gfrsh debian/tmp/usr/bin/gfrshl debian/tmp/usr/bin/gfrun debian/tmp/usr/bin/gfsched debian/tmp/usr/bin/gfsck debian/tmp/usr/bin/gfsetdir debian/tmp/usr/bin/gfssh debian/tmp/usr/bin/gfsshl debian/tmp/usr/bin/gfstat debian/tmp/usr/bin/gfstatus debian/tmp/usr/bin/gftest debian/tmp/usr/bin/gfwhere debian/tmp/usr/bin/gfwhoami gfarm-2.4.1/debian/libgfarm-dev.install0000644000000000000000000000024311507222716016463 0ustar rootrootdebian/tmp/usr/lib/*.o debian/tmp/usr/lib/hooks_init_mpi.c debian/tmp/usr/lib/lib*.a debian/tmp/usr/lib/lib*.la debian/tmp/usr/include/ debian/tmp/usr/lib/lib*.so gfarm-2.4.1/debian/gfmd.init0000644000000000000000000000132211507222716014335 0ustar rootroot#! /bin/bash # # gfmd Start the gfmd server. # PATH=/sbin:/bin:/usr/sbin:/usr/bin NAME=gfmd FILE=$NAME DAEMON=/usr/sbin/$NAME PIDFILE=/var/run/$FILE.pid CONF=/etc/gfarm.conf OPTIONS= trap "" 1 export LANG=C export PATH test -f $DAEMON || exit 0 test -f $CONF || exit 0 case "$1" in start) echo -n "Starting gfarm server: $FILE" start-stop-daemon --quiet --start \ --pidfile $PIDFILE --exec $DAEMON -- -P $PIDFILE $OPTIONS echo "." ;; stop) echo -n "Stopping gfarm server: $FILE" start-stop-daemon --stop --quiet --pidfile $PIDFILE --exec $DAEMON echo "." ;; restart|force-reload) $0 stop $0 start ;; *) echo "Usage: /etc/init.d/$FILE {start|stop|restart}" exit 1 ;; esac exit 0 gfarm-2.4.1/debian/gfmd.install0000644000000000000000000000267111507222716015050 0ustar rootrootdebian/tmp/usr/bin/config-gfarm debian/tmp/usr/bin/gfdump debian/tmp/usr/bin/gfusage debian/tmp/usr/sbin/gfmd debian/tmp/etc/init.d/gfmd debian/tmp/usr/share/gfarm/config/bdb.DB_CONFIG.in debian/tmp/usr/share/gfarm/config/config-gfarm.ldap debian/tmp/usr/share/gfarm/config/config-gfarm.postgresql debian/tmp/usr/share/gfarm/config/gfarm.conf-ldap.in debian/tmp/usr/share/gfarm/config/gfarm.conf-postgresql.in debian/tmp/usr/share/gfarm/config/gfarm.schema debian/tmp/usr/share/gfarm/config/gfarm.schema-1.sql debian/tmp/usr/share/gfarm/config/gfarm.schema-2.sql debian/tmp/usr/share/gfarm/config/initial.ldif.in debian/tmp/usr/share/gfarm/config/linux/debian/gfarm-pgsql.in debian/tmp/usr/share/gfarm/config/linux/debian/gfarm-slapd.in debian/tmp/usr/share/gfarm/config/linux/debian/gfmd.in debian/tmp/usr/share/gfarm/config/linux/default/gfarm-pgsql.in debian/tmp/usr/share/gfarm/config/linux/default/gfarm-slapd.in debian/tmp/usr/share/gfarm/config/linux/default/gfmd.in debian/tmp/usr/share/gfarm/config/linux/redhat/gfarm-pgsql.in debian/tmp/usr/share/gfarm/config/linux/redhat/gfarm-slapd.in debian/tmp/usr/share/gfarm/config/linux/redhat/gfmd.in debian/tmp/usr/share/gfarm/config/linux/suse/gfarm-pgsql.in debian/tmp/usr/share/gfarm/config/linux/suse/gfarm-slapd.in debian/tmp/usr/share/gfarm/config/linux/suse/gfmd.in debian/tmp/usr/share/gfarm/config/slapd.conf-2.0.in debian/tmp/usr/share/gfarm/config/slapd.conf-2.1.in debian/tmp/etc/default/gfarm-slapd gfarm-2.4.1/debian/gfsd.init0000644000000000000000000000132211507222716014343 0ustar rootroot#! /bin/bash # # gfsd Start the gfsd server. # PATH=/sbin:/bin:/usr/sbin:/usr/bin NAME=gfsd FILE=$NAME DAEMON=/usr/sbin/$NAME PIDFILE=/var/run/$FILE.pid CONF=/etc/gfarm.conf OPTIONS= trap "" 1 export LANG=C export PATH test -f $DAEMON || exit 0 test -f $CONF || exit 0 case "$1" in start) echo -n "Starting gfarm server: $FILE" start-stop-daemon --quiet --start \ --pidfile $PIDFILE --exec $DAEMON -- -P $PIDFILE $OPTIONS echo "." ;; stop) echo -n "Stopping gfarm server: $FILE" start-stop-daemon --stop --quiet --pidfile $PIDFILE --exec $DAEMON echo "." ;; restart|force-reload) $0 stop $0 start ;; *) echo "Usage: /etc/init.d/$FILE {start|stop|restart}" exit 1 ;; esac exit 0 gfarm-2.4.1/debian/control.gsi0000644000000000000000000000335311507222716014725 0ustar rootrootPackage: gfarm-gsi-gfptool Section: utils Architecture: i386 amd64 Depends: gfarm-gsi-client (= ${Source-Version}) Conflicts: gfarm-gfptool Description: Parallel tools installed under the Gfarm filesystem with GSI Registration the Gfarm parallel commands such as a parallel file copy command and a parallel grep command to the Gfarm filesystem by the 'gfregister' command. Package: gfmd-gsi Section: net Architecture: i386 amd64 Depends: libgfarm-gsi (= ${Source-Version}) Suggests: postgresql, slapd Conflicts: gfmd Description: The Gfarm metadata server with GSI The Gfarm filesystem metadata server for accessing filesystem metadata of the Gfarm filesystem. Package: gfarm-gsi-client Section: utils Architecture: i386 amd64 Depends: libgfarm-gsi (= ${Source-Version}) Conflicts: gfarm-client Description: The Gfarm clients with GSI This package contains client programs for the Gfarm. Package: gfsd-gsi Section: net Architecture: i386 amd64 Depends: libgfarm-gsi (= ${Source-Version}), gfarm-gsi-client (= ${Source-Version}) Conflicts: gfsd Description: The Gfarm filesystem daemon with GSI A filesystem daemon for the Gfarm filesystem, which has been running on every filesystem node, usually, with a root privilege. Package: libgfarm-gsi Section: libs Architecture: i386 amd64 Depends: libldap2 Conflicts: libgfarm Description: Runtime libraries for the Gfarm libgfarm is a library implementing interfaces for reading and writing files on the Gfarm filesystem. Package: libgfarm-gsi-dev Section: devel Architecture: i386 amd64 Depends: libgfarm-gsi (= ${Source-Version}) Conflicts: libgfarm-dev Description: Development files for the Gfarm with GSI Install this package if you wish to develop your own programs using the Gfarm filesystem library. gfarm-2.4.1/debian/gfarm-slapd.default0000644000000000000000000000175111507222716016304 0ustar rootroot# Default location of the slapd.conf file SLAPD_CONF=/etc/gfarm-ldap/slapd.conf # System account to run the slapd server under. If empty the server # will run as root. SLAPD_USER= # System group to run the slapd server under. If empty the server will # run in the primary group of its user. SLAPD_GROUP= # Path to the pid file of the slapd server. If not set the init.d script # will try to figure it out from $SLAPD_CONF (/etc/ldap/slapd.conf) SLAPD_PIDFILE= # Configure if the slurpd daemon should be started. Possible values: # - yes: Always start slurpd # - no: Never start slurpd # - auto: Start slurpd if a replica option is found in slapd.conf (default) SLURPD_START=auto # slapd normally serves ldap only on all TCP-ports 389. slapd can also # service requests on TCP-port 636 (ldaps) and requests via unix # sockets. # Example usage: # SLAPD_SERVICES="ldap://127.0.0.1:389/ ldaps:/// ldapi:///" # Additional options to pass to slapd and slurpd SLAPD_OPTIONS="" SLURPD_OPTIONS="" gfarm-2.4.1/debian/control.common0000644000000000000000000000116711507222716015434 0ustar rootrootSource: gfarm Section: net Priority: optional Maintainer: Naotaka YAMAMOTO Build-Depends: debhelper, libreadline4-dev, libssl-dev, libldap2-dev, bison Standards-Version: 3.5.10 Package: gfarm-doc Section: doc Architecture: all Description: Documents for the Gfarm Contains all README files and HTML documents. Package: gfarm-gfront Section: utils Architecture: all Depends: gfarm-gsi-client (= ${Source-Version}) | gfarm-client (= ${Source-Version}) Description: Front-end java application for the Gfarm This package contains client and administrative front-end application fot the Gfarm using JAVA. gfarm-2.4.1/debian/control0000644000000000000000000000476411507222716014153 0ustar rootrootSource: gfarm Section: net Priority: optional Maintainer: Naotaka YAMAMOTO Build-Depends: debhelper, libreadline4-dev, libssl-dev, libldap2-dev, bison Standards-Version: 3.5.10 Package: gfarm-doc Section: doc Architecture: all Description: Documents for the Gfarm Contains all README files and HTML documents. Package: gfarm-gfront Section: utils Architecture: all Depends: gfarm-gsi-client (= ${Source-Version}) | gfarm-client (= ${Source-Version}) Description: Front-end java application for the Gfarm This package contains client and administrative front-end application fot the Gfarm using JAVA. Package: gfarm-gfptool Section: utils Architecture: i386 amd64 Depends: gfarm-client (= ${Source-Version}) Conflicts: gfarm-gsi-gfptool Description: Parallel tools installed under the Gfarm filesystem Registration the Gfarm parallel commands such as a parallel file copy command and a parallel grep command to the Gfarm filesystem by the 'gfregister' command. Package: gfmd Section: net Architecture: i386 amd64 Depends: libgfarm (= ${Source-Version}) Suggests: gfarm-agent, postgresql, slapd Conflicts: gfmd-gsi Description: The Gfarm metadata server The Gfarm filesystem metadata server for accessing filesystem metadata of the Gfarm filesystem. Package: gfarm-client Section: utils Architecture: i386 amd64 Depends: libgfarm (= ${Source-Version}) Conflicts: gfarm-gsi-client Description: The Gfarm clients This package contains client programs for the Gfarm. Package: gfarm-agent Section: utils Architecture: i386 Depends: libgfarm (= ${Source-Version}) Description: Metadata cache server for Gfarm metadata cache server for gfarm Package: gfsd Section: net Architecture: i386 amd64 Depends: libgfarm (= ${Source-Version}), gfarm-client (= ${Source-Version}) Conflicts: gfsd-gsi Description: The Gfarm filesystem daemon A filesystem daemon for the Gfarm filesystem, which has been running on every filesystem node, usually, with a root privilege. Package: libgfarm Section: libs Architecture: i386 amd64 Depends: libssl0.9.7 | libssl0.9.6, libldap2 Conflicts: libgfarm-gsi Description: Runtime libraries for the Gfarm libgfarm is a library implementing interfaces for reading and writing files on the Gfarm filesystem. Package: libgfarm-dev Section: devel Architecture: i386 amd64 Depends: libgfarm (= ${Source-Version}) Conflicts: libgfarm-gsi-dev Description: Development files for the Gfarm Install this package if you wish to develop your own programs using the Gfarm filesystem library. gfarm-2.4.1/debian/gfsd.conffiles0000644000000000000000000000002111507222716015343 0ustar rootroot/etc/init.d/gfsd gfarm-2.4.1/debian/gfarm-client.manpages0000644000000000000000000000067511507222716016632 0ustar rootrootman/man1/gfcd.1 man/man1/gfdf.1 man/man1/gfexport.1 man/man1/gfhost.1 man/man1/gfimport_fixed.1 man/man1/gfimport_text.1 man/man1/gfkey.1 man/man1/gfls.1 man/man1/gfmkdir.1 man/man1/gfmpirun_p4.1 man/man1/gfps.1 man/man1/gfpwd.1 man/man1/gfrcmd.1 man/man1/gfreg.1 man/man1/gfrep.1 man/man1/gfrm.1 man/man1/gfrmdir.1 man/man1/gfrun.1 man/man1/gfsched.1 man/man1/gfsetdir.1 man/man1/gfstat.1 man/man1/gfwc.1 man/man1/gfwhere.1 man/man1/gfwhoami.1 gfarm-2.4.1/debian/gfarm-server.init0000644000000000000000000000462011507222716016024 0ustar rootroot#! /bin/sh PATH=/sbin:/bin:/usr/sbin:/usr/bin # gfarmd DAEMON_GFARMD=/usr/sbin/gfarmd NAME_GFARMD=gfarmd DESC_GFARMD="gfarmd" # gfmd DAEMON_GFMD=/usr/sbin/gfmd NAME_GFMD=gfmd DESC_GFMD="gfmd" test -f $DAEMON_GFARMD || exit 0 test -f $DAEMON_GFMD || exit 0 set -e case "$1" in start) # gfarmd echo -n "Starting $DESC_GFARMD: " start-stop-daemon --start --quiet --exec $DAEMON_GFARMD echo "$NAME_GFARMD." # gfmd echo -n "Starting $DESC_GFMD: " start-stop-daemon --start --quiet --exec $DAEMON_GFMD echo "$NAME_GFMD." ;; stop) # gfarmd echo -n "Stopping $DESC_GFARMD: " # start-stop-daemon --stop --oknodo --quiet --exec $DAEMON_GFARMD # to avoid post-installation script abort on non-zero return value. echo `killall $NAME_GFARMD`&>/dev/null echo "$NAME_GFARMD." # gfmd echo -n "Stopping $DESC_GFMD: " # start-stop-daemon --stop --oknodo --quiet --exec $DAEMON_GFMD # to avoid post-installation script abort on non-zero return value. echo `killall $NAME_GFMD`&>/dev/null echo "$NAME_GFMD." ;; #reload) # # If the daemon can reload its config files on the fly # for example by sending it SIGHUP, do it here. # # If the daemon responds to changes in its config file # directly anyway, make this a do-nothing entry. # # echo "Reloading $DESC_GFARMD configuration files." # start-stop-daemon --stop --signal 1 --quiet --pidfile \ # /var/run/$NAME_GFARMD.pid --exec $DAEMON_GFARMD #;; restart|force-reload) # # If the "reload" option is implemented, move the "force-reload" # option to the "reload" entry above. If not, "force-reload" is # just the same as "restart". # # gfarmd echo -n "Restarting $DESC_GFARMD: " # start-stop-daemon --stop --oknodo --quiet --exec $DAEMON_GFARMD # to avoid post-installation script abort on non-zero return value. echo `killall $NAME_GFARMD`&>/dev/null sleep 1 start-stop-daemon --start --quiet --exec $DAEMON_GFARMD echo "$NAME_GFARMD." # gfmd echo -n "Restarting $DESC_GFMD: " # start-stop-daemon --stop --oknodo --quiet --exec $DAEMON_GFMD # to avoid post-installation script abort on non-zero return value. echo `killall $NAME_GFMD`&>/dev/null sleep 1 start-stop-daemon --start --quiet --exec $DAEMON_GFMD echo "$NAME_GFMD." ;; *) N="/etc/init.d/gfarm-server" # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2 echo "Usage: $N {start|stop|restart|force-reload}" >&2 exit 1 ;; esac exit 0 gfarm-2.4.1/debian/gfmd.conffiles0000644000000000000000000000005211507222716015341 0ustar rootroot/etc/init.d/gfmd /etc/default/gfarm-slapd gfarm-2.4.1/debian/rules0000755000000000000000000002101711507222716013616 0ustar rootroot#!/usr/bin/make -f # Sample debian/rules that uses debhelper. # GNU copyright 1997 by Joey Hess. # # This version is for a hypothetical package that builds an # architecture-dependant package, as well as an architecture-independent # package. # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 # This is the debhelper compatability version to use. export DH_COMPAT=2 # This has to be exported to make some magic below work. export DH_OPTIONS export CC=gcc CLIENT_PKG = gfarm-client GFRONT_PKG = gfarm-gfront DOC_PKG = gfarm-doc GFPTOOL_PKG = gfarm-gfptool GFMD_PKG = gfmd GFSD_PKG=gfsd DEV_PKG = libgfarm-dev LIBS_PKG = libgfarm AGENT_PKG = gfarm-agent CLIENT_GSI_PKG = gfarm-gsi-client GFPTOOL_GSI_PKG = gfarm-gsi-gfptool GFMD_GSI_PKG = gfmd-gsi GFSD_GSI_PKG=gfsd-gsi DEV_GSI_PKG = libgfarm-gsi-dev LIBS_GSI_PKG = libgfarm-gsi CONFIGURE = ../configure --prefix=/usr --libexecdir=/usr/lib/gfarm --sysconfdir=/etc GLOBUS_PREFIX ?= undefined BUILD_BOTH ?= undefined GLOBUS_STATIC ?= undefined non-globus=yes globus=no globus_static=no ifneq ($(GLOBUS_PREFIX),undefined) globus=yes GLOBUS_FLAVOR ?= gcc32dbg ifneq ($(GLOBUS_STATIC),undefined) globus_static=yes endif ifeq ($(BUILD_BOTH), undefined) non-globus=no else build_both=yes endif endif tmpdirs=tmp ifeq ($(build_both), yes) tmpdirs=tmp tmp_gsi endif configure: configure-stamp configure-stamp: cp debian/control.common debian/control ifeq ($(non-globus),yes) cat debian/control.non-gsi >> debian/control endif ifeq ($(globus),yes) cat debian/control.gsi >> debian/control endif dh_testdir -rm -rf ns/ ifeq ($(non-globus),yes) install -d build && cd build && $(CONFIGURE) endif ifeq ($(globus),yes) install -d build_gsi && cd build_gsi && $(CONFIGURE) --with-globus=$(GLOBUS_PREFIX) --with-globus-flavor=$(GLOBUS_FLAVOR) $(GLOBUS_STATIC) ifneq ($(build_both),yes) ln -s build_gsi build ln -s tmp_gsi debian/tmp endif endif ln -s $(GFMD_PKG).docs debian/$(GFSD_PKG).docs ifeq ($(globus), yes) ln -s $(CLIENT_PKG).install debian/$(CLIENT_GSI_PKG).install ln -s $(GFPTOOL_PKG).install debian/$(GFPTOOL_GSI_PKG).install ln -s $(GFMD_PKG).install debian/$(GFMD_GSI_PKG).install ln -s $(GFSD_PKG).install debian/$(GFSD_GSI_PKG).install ln -s $(DEV_PKG).install debian/$(DEV_GSI_PKG).install ln -s $(LIBS_PKG).install debian/$(LIBS_GSI_PKG).install ln -s $(CLIENT_PKG).links debian/$(CLIENT_GSI_PKG).links ln -s $(GFMD_PKG).docs debian/$(GFMD_GSI_PKG).docs ln -s $(GFSD_PKG).docs debian/$(GFSD_GSI_PKG).docs ln -s $(GFMD_PKG).init debian/$(GFMD_GSI_PKG).$(GFMD_PKG).init ln -s $(GFSD_PKG).init debian/$(GFSD_GSI_PKG).$(GFSD_PKG).init ln -s $(GFMD_PKG).conffiles debian/$(GFMD_GSI_PKG).conffiles ln -s $(GFSD_PKG).conffiles debian/$(GFSD_GSI_PKG).conffiles ln -s $(CLIENT_PKG).manpages debian/$(CLIENT_GSI_PKG).manpages ln -s $(GFPTOOL_PKG).manpages debian/$(GFPTOOL_GSI_PKG).manpages ln -s $(GFMD_PKG).manpages debian/$(GFMD_GSI_PKG).manpages ln -s $(GFSD_PKG).manpages debian/$(GFSD_GSI_PKG).manpages ln -s $(DEV_PKG).manpages debian/$(DEV_GSI_PKG).manpages endif touch configure-stamp build: configure-stamp build-stamp build-stamp: dh_testdir # Add here commands to compile the package. ifeq ($(non-globus),yes) cd build && $(MAKE) endif ifeq ($(globus),yes) cd build_gsi && $(MAKE) endif touch build-stamp clean: dh_testdir dh_testroot rm -f build-stamp # Add here commands to clean up after the build process. -rm -f configure-stamp -rm -rf build build_gsi find . -name '*.o' -o -name '_libs' -o -name '*.lo' -o -name '*.a' -o -name '.deps' | xargs rm -rf -rm -rf debian/tmp_gsi debian/tmp_nogsi debian/tmp -rm -f debian/$(GFSD_PKG).docs rm -f debian/$(CLIENT_GSI_PKG).install rm -f debian/$(GFPTOOL_GSI_PKG).install rm -f debian/$(GFMD_GSI_PKG).install rm -f debian/$(GFSD_GSI_PKG).install rm -f debian/$(DEV_GSI_PKG).install rm -f debian/$(LIBS_GSI_PKG).install -rm -f debian/$(CLIENT_GSI_PKG).links -rm -f debian/$(GFMD_GSI_PKG).docs -rm -f debian/$(GFSD_GSI_PKG).docs -rm -f debian/{$(GFMD_GSI_PKG).$(GFMD_PKG),$(GFSD_GSI_PKG).$(GFSD_PKG)}.init rm -f debian/$(GFMD_GSI_PKG).conffiles rm -f debian/$(GFSD_GSI_PKG).conffiles rm -f debian/$(CLIENT_GSI_PKG).manpages rm -f debian/$(GFPTOOL_GSI_PKG).manpages rm -f debian/$(GFMD_GSI_PKG).manpages rm -f debian/$(GFSD_GSI_PKG).manpages rm -f debian/$(DEV_GSI_PKG).manpages #### FIEXME rm -f debian/gf{s,m}d-gsi.p* dh_clean cp debian/control.common debian/control cat debian/control.non-gsi >> debian/control install: DH_OPTIONS= install: build dh_testdir dh_testroot dh_clean -k dh_installdirs # Add here commands to install the package into debian/tmp. ifeq ($(non-globus),yes) cd build && $(MAKE) install prefix=`pwd`/../debian/tmp/usr \ default_libexecdir=`pwd`/../debian/tmp/usr/lib/gfarm endif ifeq ($(globus),yes) cd build_gsi && $(MAKE) install prefix=`pwd`/../debian/tmp_gsi/usr \ default_libexecdir=`pwd`/../debian/tmp_gsi/usr/lib/gfarm endif # LICENSE file is stored in debian/copyright (Debian policy) rm -f debian/tmp/usr/share/doc/gfarm/LICENSE mv debian/tmp/usr/share/doc/gfarm debian/tmp/usr/share/doc/gfarm-doc # hoax gfarm's Makefile. for tmp_dir in $(tmpdirs); do \ install -d debian/$$tmp_dir/etc/init.d/; \ install -m 444 doc/conf/gfarm.conf debian/$$tmp_dir/etc/; \ install -d debian/$$tmp_dir/usr/share/doc/gfarm/; \ install debian/gfmd.init debian/$$tmp_dir/etc/init.d/gfmd; \ install -d debian/$$tmp_dir/etc/ldap/schema/; \ install -d debian/$$tmp_dir/usr/share/gfarm/config; \ install -d debian/$$tmp_dir/etc/default/; \ install -m 644 debian/gfarm-slapd.default debian/$$tmp_dir/etc/default/gfarm-slapd; \ done install -d debian/tmp/usr/share/man mv debian/tmp/usr/man/ja/ debian/tmp/usr/share/man/ dh_install -p$(GFRONT_PKG) ifeq ($(non-globus),yes) dh_install -p$(CLIENT_PKG) dh_install -p$(DOC_PKG) dh_install -p$(GFPTOOL_PKG) dh_install -p$(GFMD_PKG) dh_install -p$(GFSD_PKG) dh_install -p$(DEV_PKG) dh_install -p$(LIBS_PKG) dh_install -p$(AGENT_PKG) endif ifeq ($(build_both),yes) mv debian/tmp debian/tmp_nogsi mv debian/tmp_gsi debian/tmp endif ifeq ($(globus),yes) dh_install -p$(CLIENT_GSI_PKG) dh_install -p$(GFPTOOL_GSI_PKG) dh_install -p$(GFMD_GSI_PKG) dh_install -p$(GFSD_GSI_PKG) dh_install -p$(DEV_GSI_PKG) dh_install -p$(LIBS_GSI_PKG) endif # -dh_movefiles # Build architecture-independent files here. # Pass -i to all debhelper commands in this target to reduce clutter. binary-indep: DH_OPTIONS=-i binary-indep: build install # Need this version of debhelper for DH_OPTIONS to work. dh_testversion 1.1.17 dh_testdir dh_testroot # dh_installdebconf dh_installdocs # manpages for gfarm-gfront package dh_installman -p$(GFRONT_PKG) # dh_installexamples # dh_installmenu # dh_installemacsen # dh_installpam # dh_installinit # dh_installcron # dh_installmanpages # dh_installinfo # dh_undocumented dh_installchangelogs dh_link dh_compress dh_fixperms # You may want to make some executables suid here. # dh_suidregister dh_installdeb # dh_perl dh_gencontrol dh_md5sums dh_builddeb # Build architecture-dependent files here. # Pass -a to all debhelper commands in this target to reduce clutter. # binary-arch: DH_OPTIONS=-a binary-arch: build install # Need this version of debhelper for DH_OPTIONS to work. dh_testversion 1.1.17 dh_testdir dh_testroot # dh_installdebconf dh_installdocs # dh_installexamples -pgfmd # dh_installmenu # dh_installemacsen # dh_installpam ifeq ($(non-globus),yes) dh_installinit endif ifeq ($(globus),yes) dh_installinit -pgfsd-gsi --name=gfsd dh_installinit -pgfmd-gsi --name=gfmd endif # dh_installcron dh_installman # dh_installinfo # dh_undocumented dh_installchangelogs ifeq ($(globus_static),yes) ifeq ($(non-globus),yes) for pkg in $(CLIENT_PKG) $(GFPTOOL_PKG) $(GFMD_PKG) $(GFSD_PKG) $(DEV_PKG) $(LIBS_PKG) $(AGENT_PKG); do \ dh_strip -p$$pkg; \ done endif else dh_strip endif dh_link dh_compress dh_fixperms # You may want to make some executables suid here. # dh_suidregister dh_installdeb dh_makeshlibs # dh_perl dh_shlibdeps dh_gencontrol dh_md5sums ifeq ($(build_both),yes) dh_builddeb else ifeq ($(non-globus),yes) for pkg in $(CLIENT_PKG) $(GFPTOOL_PKG) $(GFMD_PKG) $(GFSD_PKG) $(DEV_PKG) $(LIBS_PKG) $(AGENT_PKG); do \ dh_builddeb -p$$pkg; \ done else for pkg in $(CLIENT_GSI_PKG) $(GFPTOOL_GSI_PKG) $(GFMD_GSI_PKG) $(GFSD_GSI_PKG) $(DEV_GSI_PKG) $(LIBS_GSI_PKG); do \ dh_builddeb -p$$pkg; \ done endif endif binary: binary-arch binary-indep .PHONY: build clean binary-indep binary-arch binary install configure gfarm-2.4.1/debian/gfmd.docs0000644000000000000000000000003611507222716014323 0ustar rootrootINSTALL.RPM.en INSTALL.RPM.ja gfarm-2.4.1/debian/gfarm-doc.install0000644000000000000000000000010111507222716015754 0ustar rootrootdebian/tmp/usr/share/doc/gfarm-doc/ debian/tmp/usr/share/man/ja/ gfarm-2.4.1/debian/gfarm-client.links0000644000000000000000000000033311507222716016146 0ustar rootrootusr/share/man/man1/gfrun.1 usr/share/man/man1/gfssh.1 usr/share/man/man1/gfrun.1 usr/share/man/man1/gfsshl.1 usr/share/man/man1/gfrun.1 usr/share/man/man1/gfrsh.1 usr/share/man/man1/gfrun.1 usr/share/man/man1/gfrshl.1 gfarm-2.4.1/debian/libgfarm.install0000644000000000000000000000012311507222716015704 0ustar rootrootdebian/tmp/usr/lib/lib*.so.* debian/tmp/usr/share/gfarm/config/config-gfarm.sysdep gfarm-2.4.1/debian/gfarm-gfront.install0000644000000000000000000000007711507222716016522 0ustar rootrootdebian/tmp/usr/bin/gfront debian/tmp/usr/share/java/gfront.jar gfarm-2.4.1/debian/gfarm-slapd.init0000755000000000000000000001110311507222716015616 0ustar rootroot#! /bin/sh # Kill me on all errors set -e # Stop processing if slapd is not there [ -x /usr/sbin/slapd ] || exit 0 # Source the init script configuration if [ -f "/etc/default/gfarm-slapd" ]; then . /etc/default/gfarm-slapd fi # Load the default location of the slapd config file if [ -z "$SLAPD_CONF" ]; then SLAPD_CONF="/etc/ldap/slapd.conf" else SLAPD_OPTIONS="-f $SLAPD_CONF $SLAPD_OPTIONS" SLURPD_OPTIONS="-f $SLAPD_CONF $SLURPD_OPTIONS" fi # Stop processing if the config file is not there if [ ! -r "$SLAPD_CONF" ]; then cat <&2 No configuration file was found for slapd at $SLAPD_CONF. If you have moved the slapd configuration file please modify /etc/default/slapd to reflect this. If you chose to not configure slapd during installation then you need to do so prior to attempting to start slapd. An example slapd.conf is in /usr/share/slapd EOF exit 0 # Should this be 1? fi # Figure out some default settings # Check wether slurpd should get started if [ "$SLURPD_START" != "yes" ] && [ "$SLURPD_START" != "no" ]; then if grep -q '^replica' "$SLAPD_CONF" > /dev/null 2>&1 ; then SLURPD_START=yes else SLURPD_START=no fi fi # Find out the name of slapd's pid file if [ -z "$SLAPD_PIDFILE" ]; then SLAPD_PIDFILE=`sed -ne 's/^pidfile[[:space:]]\+\(.\+\)/\1/p' \ "$SLAPD_CONF"` fi # XXX: Breaks upgrading if there is no pidfile (invoke-rc.d stop will fail) # -- Torsten if [ -z "$SLAPD_PIDFILE" ]; then cat <&2 The pidfile for slapd is neither specified in "$SLAPD_CONF" nor in /etc/default/slapd. Consequently, slapd will not be started. EOF exit 1 fi # Pass the user and group to run under to slapd if [ "$SLAPD_USER" ]; then SLAPD_OPTIONS="-u $SLAPD_USER $SLAPD_OPTIONS" fi if [ "$SLAPD_GROUP" ]; then SLAPD_OPTIONS="-g $SLAPD_GROUP $SLAPD_OPTIONS" fi # Tell the user that something went wrong and give some hints for # resolving the problem. report_failure() { if [ -n "$reason" ]; then echo " - failed: " echo "$reason" else echo " - failed." cat <&1`" else reason="`start-stop-daemon --start --quiet --oknodo \ --pidfile "$SLAPD_PIDFILE" \ --exec /usr/sbin/slapd -- -h "$SLAPD_SERVICES" $SLAPD_OPTIONS 2>&1`" fi } # Start the slurpd daemon and capture the error message if any to # $reason. start_slurpd() { if [ "$SLURPD_START" != yes ]; then return 0 fi echo -n " slurpd" reason="`start-stop-daemon --start --quiet --oknodo \ --exec /usr/sbin/slurpd -- $SLURPD_OPTIONS 2>&1`" } # Stop the slapd daemon and capture the error message (if any) to # $reason. stop_slapd() { echo -n " slapd" reason="`start-stop-daemon --stop --quiet --oknodo --retry 10 \ --pidfile "$SLAPD_PIDFILE" \ --exec /usr/sbin/slapd 2>&1`" } # Stop the slurpd daemon and capture the error message (if any) to # $reason. stop_slurpd() { if [ "$SLURPD_START" != yes ]; then return 0 fi echo -n " slurpd" reason="`start-stop-daemon --stop --quiet --oknodo --retry 10 \ --exec /usr/sbin/slurpd 2>&1`" } # Start the OpenLDAP daemons start() { echo -n "Starting OpenLDAP:" trap 'report_failure' 0 start_slapd start_slurpd trap "-" 0 echo . } # Stop the OpenLDAP daemons stop() { echo -n "Stopping OpenLDAP:" trap 'report_failure' 0 stop_slurpd stop_slapd trap "-" 0 echo . } case "$1" in start) start ;; stop) stop ;; restart|force-reload) stop start ;; *) echo "Usage: $0 {start|stop|restart|force-reload}" exit 1 ;; esac gfarm-2.4.1/debian/gfmd.manpages0000644000000000000000000000007111507222716015165 0ustar rootrootman/man1/gfusage.1 man/man5/gfarm.conf.5 man/man8/gfmd.8 gfarm-2.4.1/debian/gfarm-gfront.manpages0000644000000000000000000000002211507222716016635 0ustar rootrootman/man1/gfront.1 gfarm-2.4.1/debian/copyright0000644000000000000000000000332211507222716014470 0ustar rootrootThis package was debianized by Yasuhito Takamiya on Mon, 10 Sep 2001 02:57:35 +0900. It was downloaded from http://datafarm.apgrid.org/index.en.html Upstream Author: Osamu Tatebe and collaborators High Energy Accelerator Research Organization (KEK), National Institute of Advanced Industrial Science and Technology (AIST), the University of Tokyo, and Tokyo Institute of Technology. Copyright: Copyright (c) 2003, 2004, 2005 National Institute of Advanced Industrial Science and Technology (AIST). All Rights Reserved. The authors hereby grant permission to use, copy, modify, and distribute this software and its documentation for any purpose, provided that existing copyright notices are retained in all copies and that this notice is included verbatim in any distributions. The name of AIST may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS OR DISTRIBUTORS 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, ITS DOCUMENTATION, OR ANY DERIVATIVES THEREOF, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. gfarm-2.4.1/debian/gfarm-gfptool.manpages0000644000000000000000000000002211507222716017010 0ustar rootrootman/man1/gfgrep.1 gfarm-2.4.1/debian/libgfarm-dev.manpages0000644000000000000000000000244711507222716016620 0ustar rootrootman/man3/gfarm.3 man/man3/gfarm_initialize.3 man/man3/gfarm_strings_free_deeply.3 man/man3/gfarm_terminate.3 man/man3/gfarm_url_fragments_replicate.3 man/man3/gfarm_url_hosts_schedule.3 man/man3/gfarm_url_section_replicate_from_to.3 man/man3/gfarm_url_section_replicate_to.3 man/man3/gfs_chdir.3 man/man3/gfs_chmod.3 man/man3/gfs_closedir.3 man/man3/gfs_glob.3 man/man3/gfs_glob_add.3 man/man3/gfs_glob_free.3 man/man3/gfs_glob_init.3 man/man3/gfs_mkdir.3 man/man3/gfs_opendir.3 man/man3/gfs_pio_close.3 man/man3/gfs_pio_create.3 man/man3/gfs_pio_datasync.3 man/man3/gfs_pio_eof.3 man/man3/gfs_pio_error.3 man/man3/gfs_pio_flush.3 man/man3/gfs_pio_getc.3 man/man3/gfs_pio_getline.3 man/man3/gfs_pio_gets.3 man/man3/gfs_pio_open.3 man/man3/gfs_pio_putc.3 man/man3/gfs_pio_putline.3 man/man3/gfs_pio_puts.3 man/man3/gfs_pio_read.3 man/man3/gfs_pio_readdelim.3 man/man3/gfs_pio_readline.3 man/man3/gfs_pio_seek.3 man/man3/gfs_pio_set_local.3 man/man3/gfs_pio_set_view_index.3 man/man3/gfs_pio_set_view_local.3 man/man3/gfs_pio_sync.3 man/man3/gfs_pio_truncate.3 man/man3/gfs_pio_ungetc.3 man/man3/gfs_pio_write.3 man/man3/gfs_readdir.3 man/man3/gfs_realpath.3 man/man3/gfs_rename.3 man/man3/gfs_rmdir.3 man/man3/gfs_stat.3 man/man3/gfs_stat_free.3 man/man3/gfs_unlink.3 man/man3/gfs_unlink_section.3 man/man3/gfs_utimes.3 gfarm-2.4.1/debian/README.Debian0000644000000000000000000000214411507222716014577 0ustar rootrootgfarm for Debian ------------------ Gfarm is a reference implementation of the Grid Datafarm that is designed for facilitating reliable file sharing and high-performance distributed and parallel data computing in a Grid across administrative domains by providing a Grid file system. A Grid file system is a virtual file system that federates multiple file systems. It is possible to share files or data by mounting the virtual file system. Please see http://datafarm.apgrid.org/ for details. Configuratoin ============= Gfarm packages are built by debuild -eGLOBUS_PREFIX=$GLOBUS_LOCATION -eGFARM_CONFIGURE_OPTION=--with-globus-static -eBUILD_BOTH to link statistically with globus toolkit binaries. If you have globus tool kit libraries and want to build debian package for yourself, you can build "debuild".And if you want to build with MPI libraries, please add configure option to debian/rules file. NOTE ==== The pdiff and pcat commands are not included in binary package due to conflict with a2ps and tct packages, respectively. -- Naotaka YAMAMOTO , Mon, 23 May 2005 16:24:00 +0900 gfarm-2.4.1/debian/changelog0000644000000000000000000001222311507222716014407 0ustar rootrootgfarm (1:1.4-1) unstable; urgency=low * New upstream release -- Naotaka YAMAMOTO Mon, 13 Nov 2006 00:00:00 +0900 gfarm (1:1.3.1-1) unstable; urgency=low * New upstream release -- Naotaka YAMAMOTO Thu, 27 Jul 2006 12:43:45 +0900 gfarm (1:1.3-1) unstable; urgency=low * New upstream release -- Naotaka YAMAMOTO Mon, 29 May 2006 17:47:38 +0900 gfarm (1:1.2.9-1) unstable; urgency=low * New upstream release -- Naotaka YAMAMOTO Mon, 23 Jan 2006 11:27:54 +0900 gfarm (1:1.2-2) unstable; urgency=low * New upstream release, version number is still 1.2 -- Naotaka YAMAMOTO Mon, 12 Sep 2005 05:41:27 +0900 gfarm (1:1.2-1) unstable; urgency=low * New upstream release -- Naotaka YAMAMOTO Mon, 22 Aug 2005 16:08:00 +0900 gfarm (1:1.1.1-2) unstable; urgency=low * changed build environments (Bug#14) * fixed some problems to build package -- Naotaka YAMAMOTO Thu, 2 Jun 2005 10:40:48 +0900 gfarm (1:1.1.1-1) unstable; urgency=low * New upstream release * added some manpages -- Naotaka YAMAMOTO Wed, 13 Apr 2005 09:06:42 +0900 gfarm (1:1.1.0-2) unstable; urgency=low * fixed invalid dependencies -- Naotaka YAMAMOTO Mon, 14 Mar 2005 14:52:24 +0900 gfarm (1:1.1.0-1) unstable; urgency=low * New upstream release -- Naotaka YAMAMOTO Wed, 16 Feb 2005 13:36:17 +0900 gfarm (1:1.0.4-1) unstable; urgency=low * New upstream release -- Naotaka YAMAMOTO Tue, 24 Aug 2004 16:56:30 +0900 gfarm (1:1.0.3.1-1) unstable; urgency=low * upstream release -- Naotaka YAMAMOTO Mon, 5 Jul 2004 13:49:12 +0900 gfarm (1:1.0.3-1) unstable; urgency=low * upstream release -- Naotaka YAMAMOTO Thu, 13 May 2004 15:54:04 +0900 gfarm (1:1.0.2-1) unstable; urgency=low * upstream release version 1.0.1 -- Naotaka YAMAMOTO Mon, 12 Apr 2004 11:26:58 +0900 gfarm (1:1.0.1-1) unstable; urgency=low * upstream release version 1.0.1 -- Naotaka YAMAMOTO Fri, 5 Dec 2003 12:17:57 +0900 gfarm (1:1.0-1) unstable; urgency=low * upstream release version 1.0 -- Naotaka YAMAMOTO Tue, 25 Nov 2003 13:00:00 +0900 gfarm (1.0b5-1) unstable; urgency=low * new beta release -- Naotaka YAMAMOTO Fri, 3 Oct 2003 10:30:01 +0900 gfarm (1.0b4-2) unstable; urgency=low * fixed a miss packaging for gfarm-client -- Naotaka YAMAMOTO Wed, 10 Sep 2003 13:54:32 +0900 gfarm (1.0b4-1) unstable; urgency=low * new beta release -- Naotaka YAMAMOTO Fri, 5 Sep 2003 06:08:03 +0900 gfarm (1.0b3-2) unstable; urgency=low * gfront.jar was not in previous gfarm-gfront package -- Naotaka YAMAMOTO Fri, 22 Aug 2003 00:14:20 +0900 gfarm (1.0b3-1) unstable; urgency=low * new beta version was released -- Naotaka YAMAMOTO Wed, 20 Aug 2003 17:00:00 +0900 gfarm (1.0b2-1) unstable; urgency=low * new beta version was released -- Naotaka YAMAMOTO Mon, 19 May 2003 11:51:20 +0900 gfarm (1.0b1-4) unstable; urgency=low * fixed some bugs in these packages * missing directory in gfarm-doc * japanese manpages were installed in default path * rewriten init.d script for gfmd and gfsd -- Naotaka YAMAMOTO Wed, 14 May 2003 10:22:22 +0900 gfarm (1.0b1-3) unstable; urgency=low * faild dependencies -- Naotaka YAMAMOTO Mon, 28 Apr 2003 15:13:12 +0900 gfarm (1.0b1-2) unstable; urgency=low * change package name to gfarm-gfptool from gfarm * build --with-globus packages -- Naotaka YAMAMOTO Mon, 28 Apr 2003 10:57:22 +0900 gfarm (1.0b1-1) unstable; urgency=low * beta release version -- Naotaka YAMAMOTO Sat, 26 Apr 2003 01:38:57 +0900 gfarm (0.0.cvs20030409-1) unstable; urgency=low * new cvs version and re-packaging. * added libssl-dev, libldap2-dev to Build-Depends. * removal of gfarm-doc.files. * removal of {libgfarm-dev,gfarm-server,gfarm-client,gfarm-doc}.dirs. * removed gfarm-pool.* * removed gfarm-fsnode.{conffiles,install,dirs}. * divided gfarm package into gfarm, gfarmd and gfmd package. * gfarm-fnode -> gfsd. * reasonable sections for all packages. -- Yasuhito Takamiya Wed, 9 Apr 2003 00:30:29 +0900 gfarm (0.0.cvs20030404-1) unstable; urgency=low * correct debuild failure -- Naotaka YAMAMOTO Fri, 4 Apr 2003 16:09:56 +0900 gfarm (0.0.cvs20021101-1) unstable; urgency=low * New upstream release. -- Yasuhito Takamiya Fri, 1 Nov 2002 17:57:31 +0900 gfarm (0.0.cvs20021005-1) unstable; urgency=low * cvs 20021005 release. -- Yasuhito Takamiya Fri, 1 Nov 2002 17:56:29 +0900 gfarm-2.4.1/debian/gfarm-gfptool.install0000644000000000000000000000037511507222716016676 0ustar rootrootdebian/tmp/usr/bin/gfcombine debian/tmp/usr/bin/gfcombine_hook debian/tmp/usr/bin/gfcp debian/tmp/usr/bin/gfcp_hook debian/tmp/usr/bin/gfgrep debian/tmp/usr/lib/gfarm/gfrepbe_client debian/tmp/usr/lib/gfarm/gfrepbe_server debian/tmp/usr/sbin/gfregister gfarm-2.4.1/debian/gfmd.postinst0000644000000000000000000000037611507222716015265 0ustar rootroot#!/bin/sh -e . /usr/share/debconf/confmodule echo 'Run /usr/bin/config-gfarm, if you want to setup gfmd and slapd for Gfarm filesystem metadata server. Please see /usr/share/doc/gfmd/INSTALL.RPM.* for more details.' >&2 db_stop || true #DEBHELPER# gfarm-2.4.1/debian/control.non-gsi0000644000000000000000000000357511507222716015523 0ustar rootrootPackage: gfarm-gfptool Section: utils Architecture: i386 amd64 Depends: gfarm-client (= ${Source-Version}) Conflicts: gfarm-gsi-gfptool Description: Parallel tools installed under the Gfarm filesystem Registration the Gfarm parallel commands such as a parallel file copy command and a parallel grep command to the Gfarm filesystem by the 'gfregister' command. Package: gfmd Section: net Architecture: i386 amd64 Depends: libgfarm (= ${Source-Version}) Suggests: gfarm-agent, postgresql, slapd Conflicts: gfmd-gsi Description: The Gfarm metadata server The Gfarm filesystem metadata server for accessing filesystem metadata of the Gfarm filesystem. Package: gfarm-client Section: utils Architecture: i386 amd64 Depends: libgfarm (= ${Source-Version}) Conflicts: gfarm-gsi-client Description: The Gfarm clients This package contains client programs for the Gfarm. Package: gfarm-agent Section: utils Architecture: i386 Depends: libgfarm (= ${Source-Version}) Description: Metadata cache server for Gfarm metadata cache server for gfarm Package: gfsd Section: net Architecture: i386 amd64 Depends: libgfarm (= ${Source-Version}), gfarm-client (= ${Source-Version}) Conflicts: gfsd-gsi Description: The Gfarm filesystem daemon A filesystem daemon for the Gfarm filesystem, which has been running on every filesystem node, usually, with a root privilege. Package: libgfarm Section: libs Architecture: i386 amd64 Depends: libssl0.9.7 | libssl0.9.6, libldap2 Conflicts: libgfarm-gsi Description: Runtime libraries for the Gfarm libgfarm is a library implementing interfaces for reading and writing files on the Gfarm filesystem. Package: libgfarm-dev Section: devel Architecture: i386 amd64 Depends: libgfarm (= ${Source-Version}) Conflicts: libgfarm-gsi-dev Description: Development files for the Gfarm Install this package if you wish to develop your own programs using the Gfarm filesystem library. gfarm-2.4.1/debian/gfsd.manpages0000644000000000000000000000004211507222716015171 0ustar rootrootman/man1/gfexec.1 man/man8/gfsd.8 gfarm-2.4.1/debian/gfsd.install0000644000000000000000000000061311507222716015050 0ustar rootrootdebian/tmp/usr/bin/config-gfsd debian/tmp/usr/bin/gfarm.arch.guess debian/tmp/usr/bin/gfexec debian/tmp/usr/bin/gfsplck debian/tmp/usr/bin/thput-gfpio debian/tmp/usr/sbin/gfsd debian/tmp/usr/share/gfarm/config/linux/debian/gfsd.in debian/tmp/usr/share/gfarm/config/linux/default/gfsd.in debian/tmp/usr/share/gfarm/config/linux/redhat/gfsd.in debian/tmp/usr/share/gfarm/config/linux/suse/gfsd.in gfarm-2.4.1/debian/dirs0000644000000000000000000000002111507222716013412 0ustar rootrootusr/bin usr/sbin gfarm-2.4.1/debian/gfsd.postinst0000644000000000000000000000036011507222716015264 0ustar rootroot#!/bin/sh -e . /usr/share/debconf/confmodule echo 'Run /usr/bin/config-gfsd, if you want to setup gfsd for Gfarm filesystem filesysm node. Please see /usr/share/doc/gfsd/INSTALL.RPM.* for more details.' >&2 db_stop || true #DEBHELPER# gfarm-2.4.1/LICENSE0000644000000000000000000000343611507222727012330 0ustar rootrootCopyright (c) 2003-2008 National Institute of Advanced Industrial Science and Technology (AIST). All Rights Reserved. Copyright (c) 2006-2010 Osamu Tatebe. All Rights Reserved. The authors hereby grant permission to use, copy, modify, and distribute this software and its documentation for any purpose, provided that existing copyright notices are retained in all copies and that this notice is included verbatim in any distributions. The name of AIST may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS OR DISTRIBUTORS 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, ITS DOCUMENTATION, OR ANY DERIVATIVES THEREOF, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. There are the following exceptions about the terms of the license: All files under the lib/gfs_hook/sysdep/linux/ directory can be redistributed and/or modified under the terms of the GNU Lesser General Public License as published by the Free Software Foundation. All files under the lib/gfs_hook/sysdep/solaris/ directory can be redistributed and/or modified under the terms of the Common Development and Distribution License (CDDL), Version 1.0 by Sun Microsystems, Inc. gfarm-2.4.1/snmptool/0000755000000000000000000000000011507222730013162 5ustar rootrootgfarm-2.4.1/snmptool/gmonitor3/0000755000000000000000000000000011507222730015103 5ustar rootrootgfarm-2.4.1/snmptool/gmonitor3/INSTALL0000644000000000000000000000013511507222726016140 0ustar rootroot** install jar and manual for gmonitor3 $ ./configure --prefix=/(install dir) $ make install gfarm-2.4.1/snmptool/gmonitor3/Makefile.in0000644000000000000000000000151511507222726017157 0ustar rootroottop_objdir = @top_objdir@ top_srcdir = @top_srcdir@ srcdir = @srcdir@ include config.mk javadir = $(prefix)/share/java SCRIPT = gmonitor3 JAR = gmonitor3.jar CLASS = gmonitor/*/*.class SRC = gmonitor/*/*.java all: @echo "make (ant, jar, install, doc, clean) ?" ant: ant jar: javac jar cvfm $(JAR) gmonitor.mani $(CLASS) javac: javac $(SRC) doc: (cd docbook; $(MAKE)) install: (cd docbook; $(MAKE) install) @for i in / $(SCRIPT); do \ case $$i in /) continue;; esac; \ ( set -x; $(INSTALL_PROGRAM) $${i} $(bindir)/$${i} ); \ done @for i in / $(JAR); do \ case $$i in /) continue;; esac; \ ( set -x; $(INSTALL_DATA) $(srcdir)/$${i} $(javadir)/$${i} ); \ done clean: rm -rf $(CLASS) class/ *~ distclean: clean (cd docbook; $(MAKE) clean) rm -f config.status config.log \ Makefile config.mk docbook/doc.mk gmonitor3 gfarm-2.4.1/snmptool/gmonitor3/configure.in0000644000000000000000000000026711507222726017426 0ustar rootrootAC_INIT(gmonitor.mani) AC_CONFIG_SRCDIR(gmonitor.mani) top_objdir=`pwd` AC_SUBST(top_objdir) AC_PROG_INSTALL AC_CONFIG_FILES(Makefile config.mk docbook/doc.mk gmonitor3) AC_OUTPUT gfarm-2.4.1/snmptool/gmonitor3/gmonitor3.in0000755000000000000000000000013411507222726017362 0ustar rootroot#!/bin/sh GMONITOR=@prefix@/share/java/gmonitor3.jar java -jar ${GMONITOR} $@ > /dev/null gfarm-2.4.1/snmptool/gmonitor3/.cvsignore0000644000000000000000000000003111507222726017102 0ustar rootroot.classpath gmonitor3.jar gfarm-2.4.1/snmptool/gmonitor3/gmonitor.mani0000644000000000000000000000005311507222726017612 0ustar rootrootMain-Class: gmonitor.app.SimpleGrapherApp gfarm-2.4.1/snmptool/gmonitor3/docbook/0000755000000000000000000000000011507222730016523 5ustar rootrootgfarm-2.4.1/snmptool/gmonitor3/docbook/en/0000755000000000000000000000000011507222730017125 5ustar rootrootgfarm-2.4.1/snmptool/gmonitor3/docbook/en/gmonitor3.1.html0000644000000000000000000000543311507222726022105 0ustar rootroot gmonitor3

gmonitor3

Name

gmonitor3 -- GLogger 3.0 data is displayed in graph.

Synopsis

gmonitor3 [OPTIONS]

DESCRIPTION

The output data from GLogger 3.0 is displayed in graph. The environmet which installed JRE 1.4 (or later) is required. The check of operation is carried out in the environment which installed Java2 SDK 1.4.2 on Linux.

OPTIONS

-d [directory]

Run gmonitor in AutoUpdate mode. The files in this directory is displayed in graph automatically.

-h [host name]

The data for this host name is displayed when specifying AutoUpdate mode. It will ignore, if there is no corresponding this host name.

-e [OID nick name]

The data for this OID nick name is displayed when specifying AutoUpdate mode. It will ignore, if there is no corresponding this OID nick name.

-u [unit]

Display in This unit. "bps", "KB" and "Load" can be specified as this unit.

--help

display help and exit.

--no-line

lines of graph is not drawn.

--no-bar

bars of graph is not drawn.

--no-plot

points (dots) of graph. is not drawn.

--no-information

Information portion is hidden.

--no-style

Graph Style portion is hidden.

--no-unit

Unit portion is hidden.

--no-controller

Controller portion is hidden.

SEE ALSO

glogger(8), glogger_logdata(5)

gfarm-2.4.1/snmptool/gmonitor3/docbook/en/Makefile0000644000000000000000000000003711507222726020572 0ustar rootrootdoclang = ./ include ../doc.mk gfarm-2.4.1/snmptool/gmonitor3/docbook/en/gmonitor3.10000644000000000000000000000331211507222726021134 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GMONITOR3" "1" "06 November 2003" "snmptool" "" .SH NAME gmonitor3 \- GLogger 3.0 data is displayed in graph. .SH SYNOPSIS \fBgmonitor3\fR [ \fB\fIOPTIONS\fB\fR ] .SH "DESCRIPTION" .PP The output data from GLogger 3.0 is displayed in graph. The environmet which installed JRE 1.4 (or later) is required. The check of operation is carried out in the environment which installed Java2 SDK 1.4.2 on Linux. .SH "OPTIONS" .TP \fB-d [directory]\fR Run gmonitor in AutoUpdate mode. The files in this directory is displayed in graph automatically. .TP \fB-h [host name]\fR The data for this host name is displayed when specifying AutoUpdate mode. It will ignore, if there is no corresponding this host name. .TP \fB-e [OID nick name]\fR The data for this OID nick name is displayed when specifying AutoUpdate mode. It will ignore, if there is no corresponding this OID nick name. .TP \fB-u [unit]\fR Display in This unit. "bps", "KB" and "Load" can be specified as this unit. .TP \fB--help\fR display help and exit. .TP \fB--no-line\fR lines of graph is not drawn. .TP \fB--no-bar\fR bars of graph is not drawn. .TP \fB--no-plot\fR points (dots) of graph. is not drawn. .TP \fB--no-information\fR Information portion is hidden. .TP \fB--no-style\fR Graph Style portion is hidden. .TP \fB--no-unit\fR Unit portion is hidden. .TP \fB--no-controller\fR Controller portion is hidden. .SH "SEE ALSO" .PP \fBglogger\fR(8), \fBglogger_logdata\fR(5) gfarm-2.4.1/snmptool/gmonitor3/docbook/en/gmonitor3.1.docbook0000644000000000000000000000634511507222726022564 0ustar rootroot 10 Oct 2003 gmonitor3 1 snmptool gmonitor3 GLogger 3.0 data is displayed in graph. gmonitor3 OPTIONS DESCRIPTION The output data from GLogger 3.0 is displayed in graph. The environmet which installed JRE 1.4 (or later) is required. The check of operation is carried out in the environment which installed Java2 SDK 1.4.2 on Linux. OPTIONS Run gmonitor in AutoUpdate mode. The files in this directory is displayed in graph automatically. The data for this host name is displayed when specifying AutoUpdate mode. It will ignore, if there is no corresponding this host name. The data for this OID nick name is displayed when specifying AutoUpdate mode. It will ignore, if there is no corresponding this OID nick name. Display in This unit. "bps", "KB" and "Load" can be specified as this unit. display help and exit. lines of graph is not drawn. bars of graph is not drawn. points (dots) of graph. is not drawn. Information portion is hidden. Graph Style portion is hidden. Unit portion is hidden. Controller portion is hidden. SEE ALSO glogger8 , glogger_logdata5 gfarm-2.4.1/snmptool/gmonitor3/docbook/Makefile0000644000000000000000000000044011507222726020166 0ustar rootrootDIR = en ja all: @for i in $(DIR); do \ (cd $$i; $(MAKE)); \ done install: @for i in $(DIR); do \ (cd $$i; $(MAKE) install); \ done clean: @for i in $(DIR); do \ (cd $$i; $(MAKE) clean); \ done veryclean: @for i in $(DIR); do \ (cd $$i; $(MAKE) veryclean); \ done gfarm-2.4.1/snmptool/gmonitor3/docbook/doc.mk.in0000644000000000000000000000170011507222726020231 0ustar rootrootSRC = gmonitor3.1 RM = rm -f top_objdir = @top_objdir@ top_srcdir = @top_srcdir@ srcdir = @srcdir@ include $(top_objdir)/config.mk all: html man html: for i in / $(SRC); do \ case $$i in /) continue;; esac; \ $(MAKE) srcsubst=$${i}.docbook \ htmlsubst=$${i}.html $${i}.html; \ done man: for i in / $(SRC); do \ case $$i in /) continue;; esac; \ $(MAKE) srcsubst=$${i}.docbook \ mansubst=$${i} $${i}; \ done $(htmlsubst): $(srcsubst) jw -b html -u $(srcsubst) $(mansubst): $(srcsubst) jw -b man $(srcsubst) install: @for i in / $(SRC); do \ case $$i in /) continue;; esac; \ suffix=`expr $$i : '.*\.\([^.]*\)$$'`; \ ( set -x; $(INSTALL_DATA) $${i} $(mandir)/$(doclang)man$$suffix/$$i ); \ done @for i in / $(SRC); do \ case $$i in /) continue;; esac; \ ( set -x; $(INSTALL_DATA) $${i}.html $(htmldir)/$(doclang)$${i}.html ); \ done clean: $(RM) *.refs *.links *~ veryclean: clean $(RM) *.html $(SRC) gfarm-2.4.1/snmptool/gmonitor3/docbook/ja/0000755000000000000000000000000011507222730017115 5ustar rootrootgfarm-2.4.1/snmptool/gmonitor3/docbook/ja/gmonitor3.1.html0000644000000000000000000000521211507222726022070 0ustar rootroot gmonitor3

gmonitor3

Name

gmonitor3 -- GLogger 3.0 ¤Î¥Õ¥¡¥¤¥ë¤ò¥°¥é¥Õ¤Çɽ¼¨¤¹¤ë¡£

Synopsis

gmonitor3 [¥ª¥×¥·¥ç¥ó]

DESCRIPTION

GLogger 3.0 ¤Ç½ÐÎϤ·¤¿´Ñ¬¥Ç¡¼¥¿¥Õ¥¡¥¤¥ë¤ò¥°¥é¥Õ¤Çɽ¼¨¤·¤Þ¤¹¡£ JRE 1.4 °Ê¹ß¤Î´Ä¶­¤¬É¬ÍפǤ¹¡£ Linux ¾å¤Î Java2 SDK 1.4.2 ¤Çưºî³Îǧ¤·¤Æ¤¤¤Þ¤¹¡£

OPTIONS

-d [¥Ç¥£¥ì¥¯¥È¥ê̾]

¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤ËÂФ·¤Æ¡¢AutoUpdate ¥â¡¼¥É¤Çµ¯Æ°¤·¤Þ¤¹¡£

-h [¥Û¥¹¥È̾]

AutoUpdate ¥ª¥×¥·¥ç¥ó»ØÄê»þ¤Ë¡¢¤³¤Î¥Û¥¹¥È̾¤Î¥Ç¡¼¥¿¤òɽ¼¨¤·¤Þ¤¹¡£ ³ºÅö¥Û¥¹¥È̾¤¬Ìµ¤±¤ì¤Ð¡¢Ìµ»ë¤·¤Þ¤¹¡£

-e [´Ñ¬»ö¾Ý¤Î¥Ë¥Ã¥¯¥Í¡¼¥à]

AutoUpdate ¥ª¥×¥·¥ç¥ó»ØÄê»þ¤Ë¡¢¤³¤Î´Ñ¬»ö¾Ý¤Î¥Ë¥Ã¥¯¥Í¡¼¥à¤Î¥Ç¡¼¥¿¤òɽ¼¨¤·¤Þ¤¹¡£ GLogger ¤ÎÀßÄê¤Ç¡¢OID ¤ËÂФ·¤Æ¤Ä¤±¤¿¥Ë¥Ã¥¯¥Í¡¼¥à¤Ç¤¹¡£ ³ºÅö¥Ë¥Ã¥¯¥Í¡¼¥à¤¬Ìµ¤±¤ì¤Ð¡¢Ìµ»ë¤·¤Þ¤¹¡£

-u [ñ°Ì]

¤³¤Îñ°Ì¤Çɽ¼¨¤·¤Þ¤¹¡£ ñ°Ì¤Ë¤Ï bps, KB, Load ¤¬»ØÄê¤Ç¤­¤Þ¤¹¡£

--help

¥Ø¥ë¥×¤òɽ¼¨¤·¤Þ¤¹¡£

--no-line

¥°¥é¥Õ¤ÎÀþ¤ò¾Ã¤·¤Þ¤¹¡£

--no-bar

¥°¥é¥Õ¤ÎËÀ¤ò¾Ã¤·¤Þ¤¹¡£

--no-plot

¥°¥é¥Õ¤ÎÅÀ¤ò¾Ã¤·¤Þ¤¹¡£

--no-information

Information Éôʬ¤ò±£¤·¤Þ¤¹¡£

--no-style

Graph Style Éôʬ¤ò±£¤·¤Þ¤¹¡£

--no-unit

Unit Éôʬ¤ò±£¤·¤Þ¤¹¡£

--no-controller

Controller Éôʬ¤ò±£¤·¤Þ¤¹¡£

SEE ALSO

glogger(8), glogger_logdata(5)

gfarm-2.4.1/snmptool/gmonitor3/docbook/ja/Makefile0000644000000000000000000000004011507222726020554 0ustar rootrootdoclang = ja/ include ../doc.mk gfarm-2.4.1/snmptool/gmonitor3/docbook/ja/gmonitor3.10000644000000000000000000000307111507222726021126 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GMONITOR3" "1" "06 November 2003" "snmptool" "" .SH NAME gmonitor3 \- GLogger 3.0 ¤Î¥Õ¥¡¥¤¥ë¤ò¥°¥é¥Õ¤Çɽ¼¨¤¹¤ë¡£ .SH SYNOPSIS \fBgmonitor3\fR [ \fB\fI¥ª¥×¥·¥ç¥ó\fB\fR ] .SH "DESCRIPTION" .PP GLogger 3.0 ¤Ç½ÐÎϤ·¤¿´Ñ¬¥Ç¡¼¥¿¥Õ¥¡¥¤¥ë¤ò¥°¥é¥Õ¤Çɽ¼¨¤·¤Þ¤¹¡£ JRE 1.4 °Ê¹ß¤Î´Ä¶­¤¬É¬ÍפǤ¹¡£ Linux ¾å¤Î Java2 SDK 1.4.2 ¤Çưºî³Îǧ¤·¤Æ¤¤¤Þ¤¹¡£ .SH "OPTIONS" .TP \fB-d [¥Ç¥£¥ì¥¯¥È¥ê̾]\fR ¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤ËÂФ·¤Æ¡¢AutoUpdate ¥â¡¼¥É¤Çµ¯Æ°¤·¤Þ¤¹¡£ .TP \fB-h [¥Û¥¹¥È̾]\fR AutoUpdate ¥ª¥×¥·¥ç¥ó»ØÄê»þ¤Ë¡¢¤³¤Î¥Û¥¹¥È̾¤Î¥Ç¡¼¥¿¤òɽ¼¨¤·¤Þ¤¹¡£ ³ºÅö¥Û¥¹¥È̾¤¬Ìµ¤±¤ì¤Ð¡¢Ìµ»ë¤·¤Þ¤¹¡£ .TP \fB-e [´Ñ¬»ö¾Ý¤Î¥Ë¥Ã¥¯¥Í¡¼¥à]\fR AutoUpdate ¥ª¥×¥·¥ç¥ó»ØÄê»þ¤Ë¡¢¤³¤Î´Ñ¬»ö¾Ý¤Î¥Ë¥Ã¥¯¥Í¡¼¥à¤Î¥Ç¡¼¥¿¤òɽ¼¨¤·¤Þ¤¹¡£ GLogger ¤ÎÀßÄê¤Ç¡¢OID ¤ËÂФ·¤Æ¤Ä¤±¤¿¥Ë¥Ã¥¯¥Í¡¼¥à¤Ç¤¹¡£ ³ºÅö¥Ë¥Ã¥¯¥Í¡¼¥à¤¬Ìµ¤±¤ì¤Ð¡¢Ìµ»ë¤·¤Þ¤¹¡£ .TP \fB-u [ñ°Ì]\fR ¤³¤Îñ°Ì¤Çɽ¼¨¤·¤Þ¤¹¡£ ñ°Ì¤Ë¤Ï bps, KB, Load ¤¬»ØÄê¤Ç¤­¤Þ¤¹¡£ .TP \fB--help\fR ¥Ø¥ë¥×¤òɽ¼¨¤·¤Þ¤¹¡£ .TP \fB--no-line\fR ¥°¥é¥Õ¤ÎÀþ¤ò¾Ã¤·¤Þ¤¹¡£ .TP \fB--no-bar\fR ¥°¥é¥Õ¤ÎËÀ¤ò¾Ã¤·¤Þ¤¹¡£ .TP \fB--no-plot\fR ¥°¥é¥Õ¤ÎÅÀ¤ò¾Ã¤·¤Þ¤¹¡£ .TP \fB--no-information\fR Information Éôʬ¤ò±£¤·¤Þ¤¹¡£ .TP \fB--no-style\fR Graph Style Éôʬ¤ò±£¤·¤Þ¤¹¡£ .TP \fB--no-unit\fR Unit Éôʬ¤ò±£¤·¤Þ¤¹¡£ .TP \fB--no-controller\fR Controller Éôʬ¤ò±£¤·¤Þ¤¹¡£ .SH "SEE ALSO" .PP \fBglogger\fR(8), \fBglogger_logdata\fR(5) gfarm-2.4.1/snmptool/gmonitor3/docbook/ja/gmonitor3.1.docbook0000644000000000000000000000612411507222726022547 0ustar rootroot 10 Oct 2003 gmonitor3 1 snmptool gmonitor3 GLogger 3.0 ¤Î¥Õ¥¡¥¤¥ë¤ò¥°¥é¥Õ¤Çɽ¼¨¤¹¤ë¡£ gmonitor3 ¥ª¥×¥·¥ç¥ó DESCRIPTION GLogger 3.0 ¤Ç½ÐÎϤ·¤¿´Ñ¬¥Ç¡¼¥¿¥Õ¥¡¥¤¥ë¤ò¥°¥é¥Õ¤Çɽ¼¨¤·¤Þ¤¹¡£ JRE 1.4 °Ê¹ß¤Î´Ä¶­¤¬É¬ÍפǤ¹¡£ Linux ¾å¤Î Java2 SDK 1.4.2 ¤Çưºî³Îǧ¤·¤Æ¤¤¤Þ¤¹¡£ OPTIONS ¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤ËÂФ·¤Æ¡¢AutoUpdate ¥â¡¼¥É¤Çµ¯Æ°¤·¤Þ¤¹¡£ AutoUpdate ¥ª¥×¥·¥ç¥ó»ØÄê»þ¤Ë¡¢¤³¤Î¥Û¥¹¥È̾¤Î¥Ç¡¼¥¿¤òɽ¼¨¤·¤Þ¤¹¡£ ³ºÅö¥Û¥¹¥È̾¤¬Ìµ¤±¤ì¤Ð¡¢Ìµ»ë¤·¤Þ¤¹¡£ AutoUpdate ¥ª¥×¥·¥ç¥ó»ØÄê»þ¤Ë¡¢¤³¤Î´Ñ¬»ö¾Ý¤Î¥Ë¥Ã¥¯¥Í¡¼¥à¤Î¥Ç¡¼¥¿¤òɽ¼¨¤·¤Þ¤¹¡£ GLogger ¤ÎÀßÄê¤Ç¡¢OID ¤ËÂФ·¤Æ¤Ä¤±¤¿¥Ë¥Ã¥¯¥Í¡¼¥à¤Ç¤¹¡£ ³ºÅö¥Ë¥Ã¥¯¥Í¡¼¥à¤¬Ìµ¤±¤ì¤Ð¡¢Ìµ»ë¤·¤Þ¤¹¡£ ¤³¤Îñ°Ì¤Çɽ¼¨¤·¤Þ¤¹¡£ ñ°Ì¤Ë¤Ï bps, KB, Load ¤¬»ØÄê¤Ç¤­¤Þ¤¹¡£ ¥Ø¥ë¥×¤òɽ¼¨¤·¤Þ¤¹¡£ ¥°¥é¥Õ¤ÎÀþ¤ò¾Ã¤·¤Þ¤¹¡£ ¥°¥é¥Õ¤ÎËÀ¤ò¾Ã¤·¤Þ¤¹¡£ ¥°¥é¥Õ¤ÎÅÀ¤ò¾Ã¤·¤Þ¤¹¡£ Information Éôʬ¤ò±£¤·¤Þ¤¹¡£ Graph Style Éôʬ¤ò±£¤·¤Þ¤¹¡£ Unit Éôʬ¤ò±£¤·¤Þ¤¹¡£ Controller Éôʬ¤ò±£¤·¤Þ¤¹¡£ SEE ALSO glogger8 , glogger_logdata5 gfarm-2.4.1/snmptool/gmonitor3/gmonitor/0000755000000000000000000000000011507222730016741 5ustar rootrootgfarm-2.4.1/snmptool/gmonitor3/gmonitor/gui/0000755000000000000000000000000011507222730017525 5ustar rootrootgfarm-2.4.1/snmptool/gmonitor3/gmonitor/gui/ViewDataElement.java0000644000000000000000000000202011507222726023405 0ustar rootrootpackage gmonitor.gui; /* * Created on 2003/06/04 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments */ /** * @author hkondo * * To change the template for this generated type comment go to * Window>Preferences>Java>Code Generation>Code and Comments */ public class ViewDataElement { /** * ‚±‚Ì•`‰æƒf[ƒ^—v‘f‚ª•`‰æ‘ÎۂƂȂé‚ׂ«‚©‚Ç‚¤‚© */ private boolean valid = false; /** * ‚±‚Ì•`‰æƒf[ƒ^—v‘f‚Ì‚‚³(ƒsƒNƒZƒ‹”) */ private int height = 0; /** * ‚±‚Ì•`‰æƒf[ƒ^—v‘f‚̉¡ˆÊ’u(Œ´“_‚©‚ç‚̃sƒNƒZƒ‹”) */ private int pos = 0; /** * @return */ public int getHeight() { return height; } /** * @return */ public boolean isValid() { return valid; } /** * @return */ public int getPos() { return pos; } /** * @param i */ public void setHeight(int i) { height = i; } /** * @param b */ public void setValid(boolean b) { valid = b; } /** * @param i */ public void setPos(int i) { pos = i; } } gfarm-2.4.1/snmptool/gmonitor3/gmonitor/gui/GraphMonitorModel.java0000644000000000000000000001111211507222726023763 0ustar rootrootpackage gmonitor.gui; import java.util.ArrayList; /* * Created on 2003/06/04 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments */ /** * @author hkondo * * To change the template for this generated type comment go to * Window>Preferences>Java>Code Generation>Code and Comments */ public class GraphMonitorModel { /** * Œv‘ªƒf[ƒ^‚ÌŒn—ñ(“à•”‚É‚Í RawData Œ^‚Ì‚Ý‚ð‹–—e‚·‚邱‚ÆBRawData[] ‚Æ‚µ‚Ĉµ‚¤) * •¡”Œn—ñ‚̃Tƒ|[ƒg‚Ì‚½‚ßB */ private ArrayList rawdata; /** * ‡ŽZƒ‚[ƒh‚Å“®ì‚·‚ׂ«‚©‚Ç‚¤‚©‚̃tƒ‰ƒO */ private boolean sumMode = false; /** * •\ަ‚³‚ê‚é‚ׂ«ŽžŠÔ”͈͂̊JŽn“úŽž(JavaŽžŠÔƒ~ƒŠ•b’PˆÊ) */ private long begin; /** * •\ަ‚³‚ê‚é‚ׂ«ŽžŠÔ•(JavaŽžŠÔƒ~ƒŠ•b’PˆÊ) */ private long term; /** * Ú“ªŽ«‚Ì”‘å‚«‚³(K, M, G, T, ... ‚Ì”{—¦B‚½‚Æ‚¦‚ÎK‚Ìê‡1000‚Æ‚·‚é) * @return */ private long prefixFactor = 1; /** * Œv‘ª’lŒn—ñŒQ’†‚ÌÅ‘å’l(Œn—ñŒQ‚Ì’†‚Å‚ÌÅ‘å’l) */ private long maxValue; private long maxValueTime; private long minValue; private long minValueTime; private long latestValue; private long latestValueTime; private double avgValue; /** * Œv‘ª’lŒn—ñŒQ’†‚̃Oƒ‰ƒtc޲‚ÌÅ‘å’l(10, 100, 1000, 10000, ...) * @return */ private long topValue; /** * @return */ public long getBegin() { return begin; } /** * @return */ public ArrayList getRawDataSeries() { return rawdata; } /** * @return */ public boolean isSumMode() { return sumMode; } /** * @return */ public long getTerm() { return term; } /** * @param l */ public void setBegin(long l) { begin = l; } private long findMaxValue(RawDataElement[] rde) { long max = 0; for(int i = 0; i < rde.length; i++){ if((rde[i].getValue() > max) && rde[i].isValid()) { max = rde[i].getValue(); maxValueTime = rde[i].getTime(); } } return max; } private long findMinValue(RawDataElement[] rde) { long min = -1; for(int i = 0; i < rde.length; i++){ if((min == -1 || rde[i].getValue() < min) && rde[i].isValid()){ min = rde[i].getValue(); minValueTime = rde[i].getTime(); } } return min; } private double calcAverage(RawDataElement[] rde) { double avg = 0; int invalidCount = 0; for(double i = 0; i < rde.length; i++){ //avg = avg * (i/(i+1)) + (double)rde[(int)i].getValue() / (i+1) ; if(rde[(int)i].isValid() == false){ invalidCount++; } else { avg = (avg * (i-invalidCount) + (double)rde[(int)i].getValue()) / (i+1-invalidCount) ; } //System.out.print(avg + " "); } return avg; } /* 5, 10, 50, 100, 500, 1000 */ private long findTopValue(long v) { long top = 1L; while(top < v){ top *= 5L; if(top >= v){ break; } top *= 2L; } return top; } /** * @param list */ public void setRawDataSeries(ArrayList list, long magnification) { // ƒZƒbƒg rawdata = list; // TopValue, MaxValue ‚ðŒvŽZ‚µ‚ÄŠo‚¦‚Ä‚¨‚­B long tTmp = 0; long maxTmp = 0; long minTmp = -1; double avgTmp = 0; //System.out.println("list.size(): " + list.size()); for(int i = 0; i < list.size(); i++){ RawData rd = (RawData) list.get(i); RawDataElement[] rde = rd.getData(); if(rde.length <= 0){ continue; } long maxv = findMaxValue(rde); if(maxTmp < maxv) maxTmp = maxv; long tv = findTopValue(maxTmp); if(tTmp < tv) tTmp = tv; long minv = findMinValue(rde); if(minTmp == -1 || minTmp > minv) minTmp = minv; avgTmp = calcAverage(rde); latestValue = rde[rde.length-1].getValue(); latestValueTime = rde[rde.length-1].getTime(); begin = rde[0].getTime(); // for fit graph and diff mode } //System.out.println("rde[0].getTime() " + begin); term = latestValueTime - begin; topValue = tTmp / magnification; maxValue = maxTmp; minValue = minTmp; avgValue = avgTmp; } /** * @param b */ public void setSumMode(boolean b) { sumMode = b; } /** * @param l */ public void setTerm(long l) { term = l; } /** * @return */ public long getPrefixFactor() { return prefixFactor; } /** * @param l */ public void setPrefixFactor(long l) { prefixFactor = l; } /** * @return */ public long getTopValue() { return topValue; } /** * @return */ public long getMaxValue() { return maxValue; } public long getMaxValueTime() { return maxValueTime; } public long getMinValue() { return minValue; } public long getMinValueTime() { return minValueTime; } public long getLatestValue() { return latestValue; } public long getLatestValueTime() { return latestValueTime; } public double getAvgValue() { return avgValue; } } gfarm-2.4.1/snmptool/gmonitor3/gmonitor/gui/RawDataElement.java0000644000000000000000000000222411507222726023232 0ustar rootrootpackage gmonitor.gui; /* * Created on 2003/06/04 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments */ /** * @author hkondo * * To change the template for this generated type comment go to * Window>Preferences>Java>Code Generation>Code and Comments */ public class RawDataElement { /** * ‚±‚Ì—v‘f‚ªŽ¦‚·Œv‘ªƒ|ƒCƒ“ƒg‚ÌŒv‘ª’l‚ª—LŒø‚©‚Ç‚¤‚© */ private boolean valid = false; /** * ‚±‚Ì—v‘f‚ªŽ¦‚·Œv‘ªƒ|ƒCƒ“ƒg‚ÌŒv‘ª’l * valid ‚ª false ‚Å‚ ‚Á‚½ê‡‚ÍAˆÓ–¡‚Ì‚ ‚é’l‚Æ‚µ‚ÄŽQÆ‚µ‚Ă͂Ȃç‚È‚¢ */ private long value = 0L; /** * ‚±‚Ì—v‘f‚ªŽ¦‚·Œv‘ªƒ|ƒCƒ“ƒg‚ÌŽž * valid ‚ª‚¢‚©‚È‚é’l‚Å‚ ‚Á‚Ä‚àAŽž‚ͳ‚µ‚¢‚à‚̂Ƃµ‚ÄŽQÆ‚µ‚Ă悢 */ private long time = 0L; /** * @return */ public boolean isValid() { return valid; } /** * @return */ public long getValue() { return value; } /** * @param b */ public void setValid(boolean b) { valid = b; } /** * @param l */ public void setValue(long l) { value = l; } /** * @return */ public long getTime() { return time; } /** * @param l */ public void setTime(long l) { time = l; } } gfarm-2.4.1/snmptool/gmonitor3/gmonitor/gui/GraphMonitor.java0000644000000000000000000006724411507222726023023 0ustar rootrootpackage gmonitor.gui; import java.awt.Color; import java.awt.Font; import java.awt.FontMetrics; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Rectangle; import java.awt.event.ComponentEvent; import java.awt.event.ComponentListener; import java.awt.geom.Rectangle2D; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; import javax.swing.JPanel; /* * Created on 2003/06/04 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments */ /** * @author hkondo * * To change the template for this generated type comment go to * Window>Preferences>Java>Code Generation>Code and Comments */ public class GraphMonitor extends JPanel implements ComponentListener { private boolean stylePlot = true; private boolean styleJoin = true; private boolean styleFill = true; /** * ƒOƒ‰ƒtŠiŽq‚Ì•`‰æF */ private Color gridColor = Color.GRAY; /** * ƒOƒ‰ƒt‚Ì”wŒiF */ private Color backColor = Color.WHITE; /** * ƒOƒ‰ƒt‚̃‰ƒxƒ‹‚ÌF */ private Color labelColor = Color.BLACK; /** * ƒOƒ‰ƒt‚̃^ƒCƒgƒ‹ */ private String title = ""; /** * Y ޲‚ÌÅ‘å’l(ƒOƒ‰ƒtc޲‚Ì’lˆæ‚ÌÅ‘å’l) */ private long maxValue = Long.MAX_VALUE; /** * X ޲•ûŒü‚̂ݕ(ƒsƒNƒZƒ‹’PˆÊ) */ private int unitX = 2; /** * Y ޲•ûŒü‚̂ݕ(ƒsƒNƒZƒ‹’PˆÊ) */ private int unitY = 2; /** * X ޲•ûŒü‚Ì’PˆÊƒ‰ƒxƒ‹ */ private String[] unitLabelX; /** * Y ޲•ûŒü‚Ì’PˆÊƒ‰ƒxƒ‹ */ private String[] unitLabelY; /** * ƒOƒŠƒbƒh‚Ìcü‚̉¡•ûŒü‚̃IƒtƒZƒbƒg(ƒXƒNƒ[ƒ‹—p) */ private int offsetX; /** * X ޲‚̃‰ƒxƒ‹ */ private String axisLabelX = ""; /** * Y ޲‚̃‰ƒxƒ‹ */ private String axisLabelY = ""; /** * Y ޲‚Ì’l‚Ì’PˆÊ(ƒvƒŒƒtƒBƒNƒX‚àŠÜ‚Þ) */ private String valueUnit = ""; /** * •`‰æƒf[ƒ^‚ÌŒn—ñ(“à•”‚É‚Í ViewData Œ^‚Ì‚Ý‚ð‹–—e‚·‚邱‚Æ) */ private ArrayList viewdata = new ArrayList(); /** * ‚±‚̃Oƒ‰ƒt•\ަƒRƒ“ƒ|[ƒlƒ“ƒg‚ɂ‚¢‚ÄAŒv‘ªƒf[ƒ^‚ð•ÛŽ‚µ‚Ä‚¢‚éuƒf[ƒ^ƒ‚ƒfƒ‹v‚ðŽQÆ‚·‚é */ private GraphMonitorModel model; /** * Y ޲ƒ‰ƒxƒ‹‚ÌÅ‘å•(ƒsƒNƒZƒ‹’PˆÊ) */ private int y_label_width_max; private int x_label_width_max; /** * ƒOƒ‰ƒt•\ަ•”•ª‚Ì•(ƒsƒNƒZƒ‹’PˆÊ) */ private int grid_width; /** * ƒOƒ‰ƒt•\ަ•”•ª‚Ì‚‚³(ƒsƒNƒZƒ‹’PˆÊ) */ private int grid_height; private DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss"); public GraphMonitor(){ super(); addComponentListener(this); } /** * Ä•`‰æ * @see java.awt.Component#paint(java.awt.Graphics) */ public void paint(Graphics g) { Rectangle r = getBounds(); g.clearRect(0, 0, r.width, r.height); if(model == null){ // ƒf[ƒ^ƒ‚ƒfƒ‹‚ªÝ’肳‚ê‚Ä‚¢‚È‚¢‚Ì‚ÅA‚»‚ÌŽ|‚ð•`‰æ‚·‚é draw_nodata(g); return; } synchronized(model){ recalc(); // ƒfƒRƒŒ[ƒVƒ‡ƒ“‚ð¶¬XV‚·‚é createDecoration(); // ƒfƒRƒŒ[ƒVƒ‡ƒ“‚àŠÜ‚ß‚ÄÀ•W‚ðŒvŽZ‚µ‚È‚¨‚·B recalc(); // ƒOƒ‰ƒt–{‘̂̕`‰æ draw_graph(g); // ƒfƒRƒŒ[ƒVƒ‡ƒ“(ƒOƒ‰ƒtŠiŽq, ŠeŽíƒ‰ƒxƒ‹, ƒOƒ‰ƒt‚̃^ƒCƒgƒ‹)‚Ì•`‰æ draw_decoration(g); //System.out.println("Model.begin: " + dateFormat.format(new Date(model.getBegin()))); //System.out.println("Model.term : " + model.getTerm()); } } /** * ƒOƒ‰ƒt–{‘Ì‚ð•`‰æ‚·‚é * @param g Ä•`‰æ‚É—p‚¢‚é Graphics */ private void draw_graph(Graphics g) { ArrayList l = viewdata; if(l == null){ return; } int sz = l.size(); Graphics org_g = g; FontMetrics fm = getFontMetrics(getFont()); ViewData vd; int fh = fm.getHeight(); int grid_y_origin = 0 + fh + grid_height; int grid_x_origin = 0 + fh + y_label_width_max; // int grid_x_origin = 0 + fh + y_label_width_max + 1; // int grid_x_origin = 0 + fh + x_label_width_max / 2; for(int i = 0; i < sz; i++){ g = org_g.create(); vd = (ViewData)l.get(i); if(vd == null || vd.isValid() != true){ // Œn—ñi‚Í–³Œø‚È•`‰æƒf[ƒ^‚Ȃ̂ÅA•`‰æ‚µ‚È‚¢‚ŃXƒLƒbƒv //break; continue; } ViewDataElement[] vde = vd.getData(); g.setClip(grid_x_origin, grid_y_origin - grid_height, grid_width, grid_height); int previous_point_x = grid_x_origin; int previous_point_y = 0; boolean previous_point_valid = false; int y = grid_y_origin; if(vde != null){ Color fillColor = vd.getFillColor(); Color joinColor = vd.getJoinColor(); //System.out.println("vde len:" + vde.length); for(int j = 0; j < vde.length; j++){ if(vde[j].isValid() != true){ // –³Œø‚ȃ|ƒCƒ“ƒg‚Ȃ̂ŕ`‰æ‚µ‚È‚¢ // ’¼‘Oƒ|ƒCƒ“ƒg‚à–³Œø‚É‚µ‚Ä‚¨‚­ previous_point_valid = false; //break; continue; } int x = vde[j].getPos() + grid_x_origin; int h = vde[j].getHeight(); if(vd.isFill() == true){ // –_‚Ì“h‚è‚‚Ԃµ int lefthalf = 0; if(previous_point_valid == true){ lefthalf = (x - previous_point_x) / 2; // ’†’l }else{ lefthalf = 0; } int nextIdx = j + 1; if(nextIdx >= vde.length){ nextIdx = j; } int righthalf= (int) Math.ceil((vde[nextIdx].getPos() + grid_x_origin - x) / 2.0); // ’†’l int w = lefthalf + righthalf; g.setColor(fillColor); g.fillRect(x - lefthalf, y - h, w, h); } if(vd.isJoin() == true){ // line if(previous_point_valid == true){ // ˜AŒ‹‚·‚é g.setColor(joinColor); g.drawLine(previous_point_x, previous_point_y, x, y - h); g.drawLine(previous_point_x, previous_point_y-1, x, y - h-1); // bold }else{ // ˜AŒ‹‚µ‚È‚¢ } } previous_point_x = x; previous_point_y = y - h; previous_point_valid = true; } if(vd.isPlot() == true){ // ’¸“_‚Ì•`‰æ‚ðs‚¤ int r = vd.getPlotRadius(); int r2 = r*2; Color vdColor = vd.getPlotColor(); Color vdColorD = vdColor.darker(); Color error = Color.ORANGE; // error color Color errorD = error.darker(); for(int j = 0; j < vde.length; j++){ int x = vde[j].getPos() + grid_x_origin; int h = vde[j].getHeight(); if(vde[j].isValid() != true){ g.setColor(error); g.fillOval(x - r, grid_y_origin - r, r2, r2); g.setColor(errorD); g.drawOval(x - r, grid_y_origin - r, r2, r2); } else { g.setColor(vdColor); g.fillOval(x - r, y - h - r, r2, r2); g.setColor(vdColorD); g.drawOval(x - r, y - h - r, r2, r2); } } } if(vd.isLevel() == true){ //if(true){ // ÅI—v‘f(ÅV—v‘f)‚Ì’l‚𖾎¦‚·‚邽‚߂̃o[‚ð•`‰æ‚·‚é if(vde.length == 0){ break; } int h = vde[vde.length - 1].getHeight(); g.setColor(vd.getLevelColor()); g.drawLine(grid_x_origin, grid_y_origin - h, grid_x_origin + grid_width - fh, grid_y_origin - h); g.drawLine(grid_x_origin, grid_y_origin - h - 1, grid_x_origin + grid_width - fh, grid_y_origin - h - 1); } }else{ //System.out.println("Null view data."); } } } /** * ƒf[ƒ^ƒ‚ƒfƒ‹‚ªÝ’肳‚ê‚Ä‚¢‚È‚¢‚±‚Æ‚ð•`‰æ‚·‚é * @param g Ä•`‰æ‚É—p‚¢‚é Graphics */ private void draw_nodata(Graphics g) { FontMetrics fm = g.getFontMetrics(); int fh = fm.getHeight(); g.drawString("No data model.", 0, fh); } /** * ƒRƒ“ƒ|[ƒlƒ“ƒg‚ªresize‚³‚ꂽ‚Æ‚«“™‚ɌĂ΂êAŠeŽíÀ•W‚ðÄŒvŽZ‚·‚é */ private void recalc(){ // y_label_width_max = 0; // Rectangle rect = getBounds(); // Font f = getFont(); // Graphics g = getGraphics(); // FontMetrics fm = getFontMetrics(f); // int fh = fm.getHeight(); // // // Y޲ƒ‰ƒxƒ‹ŒQ‚Ìő啂ð‹‚ß‚é // String[] l = getUnitLabelY(); // if (l != null) { // for (int i = 0; i < l.length; i++) { // Rectangle2D fr2 = fm.getStringBounds(l[i], g); // Rectangle fr = fr2.getBounds(); // if (fr.width > y_label_width_max) { // y_label_width_max = fr.width; // } // } // } // // // ƒ‰ƒxƒ‹‚Ì•‚ªŒˆ‚Ü‚Á‚½‚Ì‚ÅAƒOƒ‰ƒt•`‰æƒGƒŠƒA‚̃TƒCƒY‚ðŒˆ’è‚Å‚«‚é // grid_width = rect.width - y_label_width_max - fh - fh; // grid_height = rect.height - fh - fh - fh - fh; } /** * ƒfƒRƒŒ[ƒVƒ‡ƒ“‚Ì•`‰æ * @param g •`‰æ‚É—p‚¢‚é Graphics */ private void draw_decoration(Graphics g) { FontMetrics fm = getFontMetrics(getFont()); int fh = fm.getHeight(); int ystep = getUnitY(); int xstep = getUnitX(); Rectangle rect = getBounds(); int ascent = fm.getAscent(); // int descent= fm.getDescent(); int descent= 0; // draw_axis_x_label() -> int offset = getOffsetX(); /* draw_title() */ { g.setColor(getLabelColor()); String t = getTitle(); Rectangle2D fr2 = fm.getStringBounds(t, g); Rectangle fr = fr2.getBounds(); int x = rect.width / 2 - fr.width / 2; int y = ascent; g.drawString(t, x, y); } /* draw_axis_y_label() */{ g.setColor(getLabelColor()); Graphics2D gc = (Graphics2D) g.create(); gc.setColor(getLabelColor()); String t = getAxisLabelY(); Rectangle2D fr2 = fm.getStringBounds(t, g); Rectangle fr = fr2.getBounds(); int x = 0 + ascent; // int y = (rect.height - fh) / 2 + (fr.width / 2); int y = (rect.height - fh - fh - fh - fh) / 2 + (fr.width / 2); gc.translate(x, y); gc.rotate(-1.0 * (Math.PI / 2.0)); gc.drawString(t, 0.0f, 0.0f); } /* draw_unit_y_label() */{ g.setColor(getLabelColor()); int x = 0 + fh; int i = 0; // drawing y value label. String[] ylabel = getUnitLabelY(); if(ylabel == null){ ylabel = new String[]{"0", }; } for(int y = fh + grid_height; y >= (0 + fh); y -= ystep){ String lbl = ylabel[i]; if(lbl == null){ lbl = ""; } Rectangle2D fr2 = fm.getStringBounds(lbl, g); Rectangle fr = fr2.getBounds(); g.clearRect(x, y - fh, fr.width, fh); // g.drawString(lbl, x, y - descent); g.drawString(lbl, x + (y_label_width_max - fr.width), y - descent); i++; if(i >= ylabel.length){ break; } } } /* draw_axis_x_label() */ /* { g.setColor(getLabelColor()); String t = getAxisLabelX(); Rectangle2D fr2 = fm.getStringBounds(t, g); Rectangle fr = fr2.getBounds(); int x = rect.width / 2 - fr.width / 2; int y = rect.height - descent; g.drawString(t, x, y); } */ /* draw_unit_x_label() */{ g.setColor(getLabelColor()); int y = 0 + fh + grid_height; int i = 0; String[] xlabel = getUnitLabelX(); if(xlabel == null){ xlabel = new String[]{"0", }; } for(int x = 0 + y_label_width_max + fh + offset; x <= grid_width + y_label_width_max + fh; x += xstep){ String lbl = xlabel[i]; if(lbl == null){ lbl = ""; } String[] row = lbl.split("\n", 2); for(int j = 0; j < row.length; j++){ Rectangle2D fr2 = fm.getStringBounds(row[j], g); Rectangle fr = fr2.getBounds(); int cx = x - (fr.width / 2); // g.clearRect(cx, y + 1, fr.width, fh); g.drawString(row[j], cx, y + ascent + fh * j); } i++; if(i >= xlabel.length){ break; } } } /* draw_grid() */{ // set a color. g.setColor(getGridColor()); // draw vertical lines. for(int x = 0 + y_label_width_max + fh + offset; x <= grid_width + y_label_width_max + fh + offset; x += xstep){ g.drawLine(x, (0 + fh), x, (fh + grid_height)); } // draw horizontal lines. for(int y = fh + grid_height; y >= (0 + fh); y -= ystep){ g.drawLine((0 + y_label_width_max + fh), y, (y_label_width_max + grid_width + fh), y); } } } // private void draw_decoration_XXX(Graphics g) { // FontMetrics fm = getFontMetrics(getFont()); // int fh = fm.getHeight(); // int ystep = getUnitY(); // int xstep = getUnitX(); // Rectangle rect = getBounds(); // int ascent = fm.getAscent(); // int descent= fm.getDescent(); // int offset = getOffsetX(); // // /* draw_title() */ { // g.setColor(getLabelColor()); // String t = getTitle(); // Rectangle2D fr2 = fm.getStringBounds(t, g); // Rectangle fr = fr2.getBounds(); // int x = rect.width / 2 - fr.width / 2; // int y = ascent; // g.drawString(t, x, y); // } // // /* draw_axis_y_label() */{ // g.setColor(getLabelColor()); // Graphics2D gc = (Graphics2D) g.create(); // // gc.setColor(getLabelColor()); // String t = getAxisLabelY(); // Rectangle2D fr2 = fm.getStringBounds(t, g); // Rectangle fr = fr2.getBounds(); // int x = 0 + ascent; // int y = (rect.height - fh) / 2 + (fr.width / 2); // gc.translate(x, y); // gc.rotate(-1.0 * (Math.PI / 2.0)); // gc.drawString(t, 0.0f, 0.0f); // } // // /* draw_unit_y_label() */{ // g.setColor(getLabelColor()); // int x = 0 + fh; // int i = 0; // // drawing y value label. // String[] ylabel = getUnitLabelY(); // if(ylabel == null){ // ylabel = new String[]{"0", // }; // } // for(int y = fh + grid_height; y >= (0 + fh); y -= ystep){ // String lbl = ylabel[i]; // if(lbl == null){ // lbl = ""; // } // Rectangle2D fr2 = fm.getStringBounds(lbl, g); // Rectangle fr = fr2.getBounds(); // g.clearRect(x, y - fh, fr.width, fh); // g.drawString(lbl, x, y - descent); // i++; // if(i >= ylabel.length){ // break; // } // } // } // // /* draw_axis_x_label() */{ // g.setColor(getLabelColor()); // String t = getAxisLabelX(); // Rectangle2D fr2 = fm.getStringBounds(t, g); // Rectangle fr = fr2.getBounds(); // int x = rect.width / 2 - fr.width / 2; // int y = rect.height - descent; // g.drawString(t, x, y); // } // // /* draw_unit_x_label() */{ // g.setColor(getLabelColor()); // int y = 0 + fh + grid_height; // int i = 0; // String[] xlabel = getUnitLabelX(); // if(xlabel == null){ // xlabel = new String[]{"0", // }; // } // for(int x = 0 + y_label_width_max + fh + offset; x < grid_width + y_label_width_max; x += xstep){ // String lbl = xlabel[i]; // if(lbl == null){ // lbl = ""; // } // Rectangle2D fr2 = fm.getStringBounds(lbl, g); // Rectangle fr = fr2.getBounds(); // int cx = x - (fr.width / 2); // g.clearRect(cx, y + 1, fr.width, fh); // g.drawString(lbl, cx, y + ascent); // i++; // if(i >= xlabel.length){ // break; // } // } // } // // /* draw_grid() */{ // // set a color. // g.setColor(getGridColor()); // // draw vertical lines. // for(int x = 0 + y_label_width_max + fh + offset; x < grid_width + y_label_width_max; x += xstep){ // g.drawLine(x, (0 + fh), x, (fh + grid_height)); // } // // draw horizontal lines. // for(int y = fh + grid_height; y >= (0 + fh); y -= ystep){ // g.drawLine((0 + y_label_width_max + fh), y, (y_label_width_max + grid_width + fh), y); // } // } // // } /* (non-Javadoc) * @see java.awt.event.ComponentListener#componentHidden(java.awt.event.ComponentEvent) */ public void componentHidden(ComponentEvent arg0) { // Nothing to do. } /* (non-Javadoc) * @see java.awt.event.ComponentListener#componentMoved(java.awt.event.ComponentEvent) */ public void componentMoved(ComponentEvent arg0) { // Nothing to do. } /* (non-Javadoc) * @see java.awt.event.ComponentListener#componentShown(java.awt.event.ComponentEvent) */ public void componentShown(ComponentEvent arg0) { // Nothing to do. } /* (non-Javadoc) * @see java.awt.event.ComponentListener#componentResized(java.awt.event.ComponentEvent) */ public void componentResized(ComponentEvent evt) { if(model == null){ return; } synchronized(model){ recalc(); // ƒŠƒTƒCƒY‚³‚ꂽ‚̂ł܂¸À•W‚ðXV‚·‚éB createDecoration(); // ƒfƒRƒŒ[ƒVƒ‡ƒ“‚ðXV‚·‚éB recalc(); // ƒfƒRƒŒ[ƒVƒ‡ƒ“‚àŠÜ‚ß‚ÄÀ•W‚ðŒvŽZ‚µ‚È‚¨‚·B createViewData(); // •`‰æƒf[ƒ^‚ðXV‚·‚éB } } protected String[] createYLabels(int div, long min, long max, long prefixFactor) { String[] ret = new String[div + 1]; long tick = (max - min) / prefixFactor / div; //System.out.println("tick " + tick); if(tick == 0){ tick = 1; } for(int i = 0; i < div + 1; i++){ ret[i] = Long.toString(min + tick * i); } return ret; } protected String[] createXLabels(int div, long begin, long term) { String[] ret = new String[div + 1]; long tick = term / div; Date d = new Date(begin); for(int i = 0; i < div + 1; i++){ long t = begin + tick * i; d.setTime(t); ret[i] = dateFormat.format(d); ret[i] = ret[i].replace(' ', '\n'); } return ret; } private int calc_division(int[] divs, int pix, int thr) { for(int i = 0; i < divs.length; i++){ int allover = thr * divs[i]; if(allover < pix){ return divs[i]; } } return divs[divs.length - 1]; } private static final int[] X_DIVISION = new int[]{100, 50, 25, 10, 5, 2, 1, }; private static final int[] Y_DIVISION = new int[]{100, 50, 25, 10, 5, 2, 1, }; private void createDecoration() { y_label_width_max = 0; Rectangle rect = getBounds(); Font f = getFont(); Graphics g = getGraphics(); FontMetrics fm = getFontMetrics(f); int fh = fm.getHeight(); int tmp_height = rect.height - fh - fh - fh - fh; int y_div = calc_division(Y_DIVISION, tmp_height, 16);// 16 is adhoc //if((model.getTopValue() / model.getPrefixFactor()) <= 5){ //System.out.println("y_div,getTopValue,getPrefixFactor " + y_div +" "+ model.getTopValue() +" "+ model.getPrefixFactor()); long ylabeltop = model.getTopValue() / model.getPrefixFactor(); //System.out.println("ylabeltop " + ylabeltop); if(ylabeltop < y_div){ y_div = (int)ylabeltop; } if(y_div <= 0){ y_div = 1; } grid_height = (tmp_height / y_div) * y_div; // y_div ‚Ì”{”‚ÉŠÛ‚ß‚é //String[] ylabels = createYLabels(y_div, 0, model.getTopValue() / model.getPrefixFactor()); String[] ylabels = createYLabels(y_div, 0, model.getTopValue(), model.getPrefixFactor()); setMaxValue(Long.parseLong(ylabels[ylabels.length-1]) * model.getPrefixFactor()); setUnitLabelY(ylabels); // Y ޲•ûŒü‚̃‰ƒxƒ‹”z—ñ‚ðÝ’è‚·‚é String[] l = getUnitLabelY(); // Y޲ƒ‰ƒxƒ‹ŒQ‚Ìő啂ð‹‚ß‚é /* if (l != null) { for (int i = 0; i < l.length; i++) { Rectangle2D fr2 = fm.getStringBounds(l[i], g); Rectangle fr = fr2.getBounds(); if (fr.width > y_label_width_max) { y_label_width_max = fr.width; } } } */ Rectangle2D fr2 = fm.getStringBounds("0000", g); Rectangle fr = fr2.getBounds(); y_label_width_max = fr.width; //int[] fw = fm.getWidths(); //x_label_width_max = 0; //l = getUnitLabelX(); // X޲ƒ‰ƒxƒ‹ŒQ‚Ìő啂ð‹‚ß‚é /* if (l != null) { for (int i = 0; i < l.length; i++) { Rectangle2D fr2 = fm.getStringBounds(l[i], 0, 10, g); // yyyy/mm/dd Rectangle fr = fr2.getBounds(); if (fr.width > x_label_width_max) { x_label_width_max = fr.width; } } } */ fr2 = fm.getStringBounds("0000/00/00", g); fr = fr2.getBounds(); x_label_width_max = fr.width; //System.out.println("x_label_width_max " + x_label_width_max); // ƒ‰ƒxƒ‹‚Ì•‚ªŒˆ‚Ü‚Á‚½‚Ì‚ÅAƒOƒ‰ƒt•`‰æƒGƒŠƒA‚̃TƒCƒY‚ðŒˆ’è‚Å‚«‚é int tmp_width = rect.width - y_label_width_max - fh - x_label_width_max / 2; // Še޲‚Ì•ªŠ„”‚ðŒvŽZ int x_div = calc_division(X_DIVISION, tmp_width, x_label_width_max + 10); // 10 is adhoc. grid_width = (tmp_width / x_div) * x_div; // x_div ‚Ì”{”‚ÉŠÛ‚ß‚é //System.out.println("grid_width " + grid_width + ", x_label_width_max " + x_label_width_max + ", x_div " + x_div); // grid_width = 0; // x_div ‚Ì”{”‚ÉŒˆ’è; // Še޲•ªŠ„Žž‚̃sƒNƒZƒ‹•‚ðŒvŽZ int x_unit = getGrid_width() / x_div; int y_unit = getGrid_height()/ y_div; setUnitX(x_unit); // X ޲•ûŒü‚Ý•‚ðÝ’è‚·‚é setUnitY(y_unit); // Y ޲•ûŒü‚Ý•‚ðÝ’è‚·‚é // Še޲‚Ì’PˆÊƒ‰ƒxƒ‹‚𶬠String[] xlabels = createXLabels(x_div, model.getBegin(), model.getTerm()); setUnitLabelX(xlabels); // X ޲•ûŒü‚̃‰ƒxƒ‹”z—ñ‚ðÝ’è‚·‚é } //private void createDecoration() //{ // // Še޲‚Ì•ªŠ„”‚ðŒvŽZ // int x_div = calc_division(X_DIVISION, getGrid_width(), 64); // 64 is adhoc. // int y_div = calc_division(Y_DIVISION, getGrid_height(), 16);// 16 is adhoc. // // // Še޲•ªŠ„Žž‚̃sƒNƒZƒ‹•‚ðŒvŽZ // int x_unit = getGrid_width() / x_div; // int y_unit = getGrid_height()/ y_div; // setUnitX(x_unit); // X ޲•ûŒü‚Ý•‚ðÝ’è‚·‚é // setUnitY(y_unit); // Y ޲•ûŒü‚Ý•‚ðÝ’è‚·‚é // // // Še޲‚Ì’PˆÊƒ‰ƒxƒ‹‚𶬠// String[] xlabels = createXLabels(x_div, model.getBegin(), model.getTerm()); // String[] ylabels = createYLabels(y_div, 0, model.getTopValue() / model.getPrefixFactor()); // setUnitLabelX(xlabels); // X ޲•ûŒü‚̃‰ƒxƒ‹”z—ñ‚ðÝ’è‚·‚é // setUnitLabelY(ylabels); // Y ޲•ûŒü‚̃‰ƒxƒ‹”z—ñ‚ðÝ’è‚·‚é //} public void setStylePlot(boolean f) { stylePlot = f; } public void setStyleJoin(boolean f) { styleJoin = f; } public void setStyleFill(boolean f) { styleFill = f; } /** * Œ»Ý‚Ì”ƒpƒ‰ƒ[ƒ^‚É]‚Á‚Ä•`‰æƒf[ƒ^‚ðV‚½‚Éì‚è’¼‚· */ private void createViewData() { if(model == null){ // “K؂ȃ‚ƒfƒ‹‚ªÝ’肳‚ê‚Ä‚¢‚È‚¢‚̂ŕ`‰æƒf[ƒ^‚ðXV‚Å‚«‚È‚¢ return; } synchronized(model){ ArrayList newView = new ArrayList(); ArrayList rawDataList = model.getRawDataSeries(); long begin_time_to_paint = model.getBegin(); long term_to_paint = model.getTerm(); for(int i = 0; i < rawDataList.size(); i++){ RawData rd = (RawData) rawDataList.get(i); if(rd.isValid() == true){ ViewDataElement[] vds = renderRawData(rd, begin_time_to_paint, term_to_paint); ViewData vd = new ViewData(); vd.setData(vds); vd.setValid(true); vd.setPlot(stylePlot); vd.setJoin(styleJoin); vd.setFill(styleFill); vd.setPlotColor(rd.getPlotColor()); vd.setFillColor(rd.getBarColor()); vd.setJoinColor(rd.getLineColor()); vd.setLevelColor(rd.getLevelColor()); newView.add(vd); } } // Ä\’zŒã‚Ì•`‰æƒf[ƒ^‚ðÝ’è‚·‚é setViewdata(newView); } } /** * Œv‘ªƒf[ƒ^‚ðƒŒƒ“ƒ_ƒŠƒ“ƒO‚µ‚Ä•`‰æƒf[ƒ^‚𶬂·‚é * @param rd ƒŒƒ“ƒ_ƒŠƒ“ƒO‚·‚ׂ«Œv‘ªƒf[ƒ^ * @return */ // private ViewDataElement[] renderRawData(RawData rd, long begin, long term) { // ArrayList elmList = new ArrayList(); // RawDataElement[] rds = rd.getData(); // int first_idx = search_first_valid_element(rds); // int last_idx = search_last_valid_element(rds); //// long begin = rd.getBegin(); //if(first_idx < 0 || last_idx < 0){ // // No valid element. // return null; //} //System.out.println("Rendering RawData:"); // long first = rds[first_idx].getTime(); // long last = rds[last_idx].getTime(); //// long term = last - first; // for(int i = 0; i < rds.length; i++){ // RawDataElement e = rds[i]; // long t = e.getTime() - first; // long v = e.getValue(); //System.out.println(v); // int x = (int) ((t * grid_width) / term); // e ‚̑Ήž‚·‚éXÀ•W // int y = (int) ((v * grid_height) / maxValue); // e ‚̑Ήž‚·‚éYÀ•W // ViewDataElement ve = new ViewDataElement(); // ve.setPos(x); // ve.setHeight(y); // if(e.isValid() == true){ // ve.setValid(true); // }else{ // ve.setValid(false); // } // elmList.add(ve); // } // ViewDataElement[] vda = new ViewDataElement[elmList.size()]; // vda = (ViewDataElement[]) elmList.toArray(vda); // // return vda; // } private ViewDataElement[] renderRawData(RawData rd, long begin, long term) { ArrayList elmList = new ArrayList(); RawDataElement[] rds = rd.getData(); int first_idx = search_first_valid_element(rds); int last_idx = search_last_valid_element(rds); if(first_idx < 0 || last_idx < 0 || term <= 0 || maxValue <= 0){ // No valid element. return null; } //System.out.println("Rendering RawData:"); long first = rds[first_idx].getTime(); long last = rds[last_idx].getTime(); //SimpleDateFormat dtFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss"); // int mute_offpix = (int) (((first - begin) * grid_width) / term); //int mute_offpix = (int) Math.rint(((double)(first - begin) * (double)(grid_width)) / (double)term); //System.out.println("Mute_OffPix: " + mute_offpix); for(int i = 0; i < rds.length; i++){ RawDataElement e = rds[i]; long t = e.getTime() - first; long v = e.getValue(); //System.out.println("Time: " + dtFormat.format(new Date(e.getTime())) + " Value: " + v); int x = (int) ((t * grid_width) / term); // e ‚̑Ήž‚·‚éXÀ•W int y = (int) ((v * grid_height) / maxValue); // e ‚̑Ήž‚·‚éYÀ•W //x += mute_offpix; ViewDataElement ve = new ViewDataElement(); ve.setPos(x); ve.setHeight(y); if(e.isValid() == true){ ve.setValid(true); }else{ ve.setValid(false); } elmList.add(ve); } ViewDataElement[] vda = new ViewDataElement[elmList.size()]; vda = (ViewDataElement[]) elmList.toArray(vda); return vda; } /** * @param rds * @return */ private int search_last_valid_element(RawDataElement[] rds) { int idx = -1; for(int i = rds.length - 1; i >= 0; i--){ if(rds[i].isValid() == true){ idx = i; break; } } return idx; } /** * @param rds * @return */ private int search_first_valid_element(RawDataElement[] rds) { int idx = -1; for(int i = 0; i < rds.length; i++){ if(rds[i].isValid() == true){ idx = i; break; } } return idx; } /** * @return */ public String getAxisLabelX() { return axisLabelX; } /** * @return */ public String getAxisLabelY() { return axisLabelY; } /** * @return */ public Color getBackColor() { return backColor; } /** * @return */ public int getGrid_height() { return grid_height; } /** * @return */ public int getGrid_width() { return grid_width; } /** * @return */ public Color getGridColor() { return gridColor; } /** * @return */ public long getMaxValue() { return maxValue; } /** * @return */ public int getOffsetX() { return offsetX; } /** * @return */ public String getTitle() { return title; } /** * @return */ public String[] getUnitLabelX() { return unitLabelX; } /** * @return */ public String[] getUnitLabelY() { return unitLabelY; } /** * @return */ public int getUnitX() { return unitX; } /** * @return */ public int getUnitY() { return unitY; } /** * @return */ public ArrayList getViewdata() { return viewdata; } /** * @return */ public int getY_label_width_max() { return y_label_width_max; } /** * @param string */ public void setAxisLabelX(String string) { axisLabelX = string; } /** * @param string */ public void setAxisLabelY(String string) { axisLabelY = string; } /** * @param color */ public void setBackColor(Color color) { backColor = color; } /** * @param i */ public void setGrid_height(int i) { grid_height = i; } /** * @param i */ public void setGrid_width(int i) { grid_width = i; } /** * @param color */ public void setGridColor(Color color) { gridColor = color; } /** * @param l */ public void setMaxValue(long l) { maxValue = l; } /** * @param i */ public void setOffsetX(int i) { offsetX = i; } /** * @param string */ public void setTitle(String string) { title = string; } /** * @param strings */ public void setUnitLabelX(String[] strings) { unitLabelX = strings; } /** * @param strings */ public void setUnitLabelY(String[] strings) { unitLabelY = strings; } /** * @param i */ public void setUnitX(int i) { unitX = i; } /** * @param i */ public void setUnitY(int i) { unitY = i; } /** * @param list */ public void setViewdata(ArrayList list) { viewdata = list; } /** * @param i */ public void setY_label_width_max(int i) { y_label_width_max = i; } /** * @return MVCƒ‚ƒfƒ‹‚É‚¨‚¯‚éGraphMonitor‚̃‚ƒfƒ‹ */ public GraphMonitorModel getModel() { return model; } /** * @param model ‚±‚ÌGraphMonitor‚É•`‰æ‚³‚¹‚½‚¢ƒf[ƒ^ƒ‚ƒfƒ‹ */ public void setModel(GraphMonitorModel model) { this.model = model; if(model != null){ setMaxValue(model.getTopValue()); //recalc(); createDecoration(); //recalc(); createViewData(); } } /** * @return */ public boolean isStyleFill() { return styleFill; } /** * @return */ public boolean isStyleJoin() { return styleJoin; } /** * @return */ public boolean isStylePlot() { return stylePlot; } /** * @return */ public Color getLabelColor() { return labelColor; } /** * @param color */ public void setLabelColor(Color color) { labelColor = color; } /** * @return */ public String getValueUnit() { return valueUnit; } /** * @param string */ public void setValueUnit(String string) { valueUnit = string; } } gfarm-2.4.1/snmptool/gmonitor3/gmonitor/gui/DataTimeSpace.java0000644000000000000000000005112711507222726023047 0ustar rootroot/* * Created on 2003/07/09 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments */ package gmonitor.gui; import gmonitor.logdata.DataBlock; import gmonitor.logdata.DataBlockGroupElement; import gmonitor.logdata.DataBlockGroupTable; import gmonitor.logdata.DataElement; import gmonitor.logdata.DataFile; import gmonitor.logdata.FirstMetaBlock; import gmonitor.logdata.HostDefBlock; import gmonitor.logdata.HostDefElement; import gmonitor.logdata.OIDDefBlock; import gmonitor.logdata.OIDDefElement; import gmonitor.logdata.SecondMetaBlock; import java.io.IOException; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Collections; import java.util.Date; import java.util.TreeSet; /** * @author hkondo * * To change the template for this generated type comment go to * Window>Preferences>Java>Code Generation>Code and Comments */ public class DataTimeSpace { ArrayList files = new ArrayList(); // DataFile ‚ÌƒŠƒXƒg TreeSet hostnames = new TreeSet(); TreeSet eventnames= new TreeSet(); long largestGroupInterval = 1; long smallestGroupInterval = 1; private long COUNTMAX = 4294967296L; // 32bit private long MAXbps = 1500L*1000L*1000L; // 1.5Gbps public long getBeginDateTime() throws IOException { if(files != null && files.size() > 0 ){ // compared DataFile f = (DataFile) files.get(0); return f.getBeginDateTime(); } else { throw new IOException(); } } public long getLatestDateTime() throws IOException { if(files != null && files.size() > 0 ){ // compared DataFile f = (DataFile) files.get(files.size() - 1); return f.getLatestDateTime(); } else { throw new IOException(); } } // ƒtƒ@ƒCƒ‹–¼‚Ì”z—ñ‚ð—^‚¦A‘ÎÛ‚Æ‚·‚鎞‹óŠÔ‚ðÝ’è‚·‚é public DataTimeSpace(String[] list) throws IOException { largestGroupInterval = 1; smallestGroupInterval = Long.MAX_VALUE; for(int i = 0; i < list.length; i++){ DataFile f = DataFile.getInstance(list[i]); // f.reload(); SecondMetaBlock smb = f.getSecondMetaBlock(); FirstMetaBlock fmb = f.getFirstMetaBlock(); long intv = fmb.getGroupInterval(); if(largestGroupInterval < intv) largestGroupInterval = intv; if(smallestGroupInterval > intv) smallestGroupInterval = intv; // Extract all hostnames for Human readable interface. HostDefBlock hdb = smb.getHostDefBlock(); int hdb_count = hdb.getCount(); for(int j = 0; j < hdb_count; j++){ HostDefElement e = hdb.getHostDefElement(j); String h = e.getNameAndNick(); hostnames.add(h); } // Extract all eventnames for Human readable interface. OIDDefBlock odb = smb.getOIDDefBlock(); int odb_count = odb.getCount(); for(int j = 0; j < odb_count; j++){ OIDDefElement e = odb.getOIDDefElement(j); String n = e.getNameAndNick(); eventnames.add(n); } // Add file to file list. files.add(f); } Collections.sort(files); } public String[] getHostnames() { String[] hosts; synchronized(hostnames){ hosts = new String[hostnames.size()]; hosts = (String[]) hostnames.toArray(hosts); } return hosts; } public String[] getEvents() { String[] events; synchronized(eventnames){ events = new String[eventnames.size()]; events = (String[]) eventnames.toArray(events); } return events; } private ArrayList extract_aList(String host) { ArrayList aList = new ArrayList(); //System.out.println("ALIST:"); for(int i = 0; i < files.size(); i++){ DataFile f = (DataFile) files.get(i); if(f.containsHost(host) == true){ aList.add(f); //System.out.println(f.getUrl()); } } return aList; } private ArrayList extract_bList(ArrayList aList, String event) { ArrayList bList = new ArrayList(); //System.out.println("BLIST:"); for(int i = 0; i < aList.size(); i++){ DataFile f = (DataFile) aList.get(i); if(f.containsEvent(event) == true){ bList.add(f); //System.out.println(f.getUrl()); } } Collections.sort(bList); return bList; } private DataFile extract_file(ArrayList bList, long begin) throws IOException { DataFile file = null; for(int i = 0; i < bList.size(); i++){ DataFile f = (DataFile) bList.get(i); if(f.containsDateTime(begin) == true){ file = f; break; } } return file; } private ArrayList extract_cList(ArrayList bList, long begin, long term) throws IOException { SimpleDateFormat dtf = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss"); if(bList == null || bList.size() == 0){ return null; } TreeSet set = new TreeSet(); //System.out.println("CLIST: begin: " + dtf.format(new Date(begin)) + " term: " + term); for(int i = 1; i < bList.size(); i++){ //System.out.println("***** index = " + i); DataFile f1 = (DataFile) bList.get(i - 1); DataFile f2 = (DataFile) bList.get(i); long b1 = f1.getBeginDateTime(); long b2 = f2.getBeginDateTime(); //System.out.println(" f1: " + f1.getUrl() + " b1: " + dtf.format(new Date(b1))); //System.out.println(" f2: " + f2.getUrl() + " b2: " + dtf.format(new Date(b2))); if(begin <= b1 && b1 <= (begin + term)){ //System.out.println(" Rule 1 matched, add " + f1.getUrl()); set.add(f1); }else if(b1 <= begin && begin < b2){ //System.out.println(" Rule 2 matched, add " + f1.getUrl()); set.add(f1); }else{ // Nothing to do. } } // ÅŒã‚̃tƒ@ƒCƒ‹‚¾‚¯“Á•ÊB DataFile f = (DataFile) bList.get(bList.size() - 1); long b = f.getBeginDateTime(); //System.out.println(" f: " + f.getUrl() + " b: " + b + " " + dtf.format(new Date(b))); if(b<= (begin + term)){ //System.out.println(" Special rule matched."); set.add(f); } //System.out.println(set); ArrayList cList = new ArrayList(); cList.addAll(set); return cList; } // private ArrayList extract_cList(ArrayList bList, long begin, long term) throws IOException // { // if(bList == null || bList.size() == 0){ // return null; // } // TreeSet set = new TreeSet(); //System.out.println("CLIST:"); // for(int i = 1; i < bList.size(); i++){ // DataFile f1 = (DataFile) bList.get(i - 1); // DataFile f2 = (DataFile) bList.get(i); // long b1 = f1.getBeginDateTime(); // long b2 = f2.getBeginDateTime(); // if(begin <= b1 && b1 <= (begin + term)){ // set.add(f1); //System.out.println(f1.getUrl()); // } // if(b1 <= begin && begin <= b2){ // set.add(f1); //System.out.println(f1.getUrl()); // } // if(begin <= b2 && b2 <= (begin + term)){ // set.add(f2); //System.out.println(f2.getUrl()); // }else{ // // Nothing to do. // } // } // ArrayList cList = new ArrayList(); // cList.addAll(set); // return cList; // } public ArrayList convertDateDataPairListToRawDataElements(ArrayList l) { ArrayList list = new ArrayList(); for(int i = 0; i <= l.size()-2; i += 2){ Date date = (Date) l.get(i); DataElement de = (DataElement) l.get(i + 1); RawDataElement re = new RawDataElement(); re.setTime(date.getTime()); re.setValue(de.getValue()); if(de.getFlag(DataElement.VALID_FLAG) == true && de.getFlag(DataElement.SUCCESS_FLAG) == true){ re.setValid(true); }else{ // Nothing to do. } list.add(re); } return list; } public ArrayList convertDateDataPairListToRawDataElements(ArrayList l, boolean diffmode) { ArrayList list = new ArrayList(); if(diffmode == false){ return convertDateDataPairListToRawDataElements(l); } if(l.size() <= 2){ RawDataElement re = new RawDataElement(); re.setValid(false); re.setValue(0); list.add(re); return list; } Date prevDate = null; DataElement prevDataElement = null; int offset; for(offset=0; offset <= l.size()-4; offset += 2){ prevDataElement = (DataElement) l.get(offset+1); if(prevDataElement.getFlag(DataElement.VALID_FLAG) && prevDataElement.getFlag(DataElement.SUCCESS_FLAG)){ prevDate = (Date) l.get(offset); break; } } if(offset > l.size()-4){ return null; } for(int i = 2+offset; i <= l.size()-2; i += 2){ Date date = (Date) l.get(i); DataElement de = (DataElement) l.get(i + 1); RawDataElement re = new RawDataElement(); re.setTime(date.getTime()); if(de.getFlag(DataElement.VALID_FLAG) == false || de.getFlag(DataElement.SUCCESS_FLAG) == false){ re.setValue(0); re.setValid(false); } else { long during = date.getTime() - prevDate.getTime(); long value = de.getValue() - prevDataElement.getValue(); if(value < 0){ value = COUNTMAX + value; // MAX - prev + now } value = (long) Math.rint((double)(value * 1000) / (double)during); // per second (v / (d / 1000)); if(value >= 0){ re.setValid(true); re.setValue(value); } else { //System.out.println("invalid value: " + value + "(during="+during+")"); re.setValue(0); re.setValid(false); } prevDate = date; prevDataElement = de; } list.add(re); } return list; } public ArrayList convertDateDataPairListToRawDataElementsByUptime(ArrayList l, ArrayList uptimeList) { if(l.size() != uptimeList.size()){ //System.out.println("l != uptime: " + l.size() + ", " + uptimeList.size()); return null; } ArrayList list = new ArrayList(); if(l.size() <= 2){ RawDataElement re = new RawDataElement(); re.setValid(false); re.setValue(0); list.add(re); return list; } Date prevDate = null; DataElement prevDataElement = null; DataElement prevUptimeElement = null; int offset; for(offset=0; offset <= l.size()-4; offset += 2){ prevDataElement = (DataElement) l.get(offset+1); prevUptimeElement = (DataElement) uptimeList.get(offset+1); if(prevDataElement.getFlag(DataElement.VALID_FLAG) && prevDataElement.getFlag(DataElement.SUCCESS_FLAG) && prevUptimeElement.getFlag(DataElement.VALID_FLAG) && prevUptimeElement.getFlag(DataElement.SUCCESS_FLAG)){ prevDate = (Date) l.get(offset); break; } } if(offset > l.size()-4){ return null; } for(int i = 2+offset; i <= l.size()-2; i += 2){ Date date = (Date) l.get(i); DataElement de = (DataElement) l.get(i + 1); DataElement uptime = (DataElement) uptimeList.get(i + 1); RawDataElement re = new RawDataElement(); re.setTime(date.getTime()); if(de.getFlag(DataElement.VALID_FLAG) == false || de.getFlag(DataElement.SUCCESS_FLAG) == false || uptime.getFlag(DataElement.VALID_FLAG) == false || uptime.getFlag(DataElement.SUCCESS_FLAG) == false){ re.setValue(0); re.setValid(false); } else { long during = uptime.getValue() - prevUptimeElement.getValue(); long value = de.getValue() - prevDataElement.getValue(); if(value < 0){ value = COUNTMAX + value; // MAX - prev + now } value = (long) Math.rint((double)(value * 100) / (double)during); // per second (v / (d / 1000)); if(value >= 0){ re.setValid(true); re.setValue(value); prevDate = date; } else { //System.out.println("invalid value: " + value + " (during:"+during+"=" + uptime.getValue() + "-" + prevUptimeElement.getValue() +")"); re.setValue(0); re.setValid(false); } prevDataElement = de; prevUptimeElement = uptime; } list.add(re); } return list; } private final int JUST_BEFORE = 0; private final int ESTIMATE = 1; private static long savedBeginTime = -1; public void initResampingMode(){ savedBeginTime = -1; } private ArrayList resampleDateDataPair(ArrayList l, long resampleResolution, int mode){ long resample = resampleResolution * 1000; ArrayList list = new ArrayList(); Date prevDate = (Date) l.get(0); DataElement prevDataElement = (DataElement) l.get(1); long term = ((Date)l.get(l.size()-2)).getTime() - prevDate.getTime(); long newPointNum = term/resample; long newBegin = prevDate.getTime() + term%resample; //long newBegin = prevDate.getTime(); if(savedBeginTime - resample > newBegin){ // expand Time Range savedBeginTime = -1; } if(savedBeginTime > 0){ long newBeginTmp = savedBeginTime; while(newBegin > newBeginTmp){ // shrink Time Range newBeginTmp = newBeginTmp + resample; } newBegin = newBeginTmp; } //System.out.println("resample: " + term +" "+ newPointNum +" "+ newBegin +" "+term%resample+" "+savedBeginTime); savedBeginTime = newBegin; int j = 0; if(mode == JUST_BEFORE){ for(int i = 0; i <= newPointNum; i++){ long currentTime = newBegin + i*resample; Date newTime = new Date(currentTime); //System.out.println(currentTime); list.add(newTime); DataElement de = null; DataElement prev = null; while(j <= l.size()-4) { prev = (DataElement) l.get(j + 1); long nextTime = ((Date)l.get(j+2)).getTime(); if(currentTime < nextTime){ de = prev; break; } else if(currentTime == nextTime){ de = (DataElement) l.get(j + 3); break; } j += 2; } if(j > l.size()-4){ break; } if(de == null){ de = new DataElement((byte)0x00, 0); } list.add(de); // System.out.println("---"); } } else { // Interpolate //System.out.println("===== Interpolate ====="); for(int i = 0; i <= newPointNum; i++){ //System.out.println("--- new point ---"); long currentTime = newBegin + i*resample; Date newTime = new Date(currentTime); list.add(newTime); DataElement de = null; DataElement prev = null; while(j <= l.size()-4) { long prevTime = ((Date) l.get(j)).getTime(); prev = (DataElement) l.get(j + 1); long nextTime = ((Date)l.get(j + 2)).getTime(); long nextVal = ((DataElement) l.get(j + 3)).getValue(); //System.out.println("prevTime " + prevTime + ", prevVal " + prev.getValue() + ", nextTime " + nextTime + ", nextVal " + nextVal); if(currentTime < nextTime){ long valDiff = nextVal - prev.getValue(); long timeDiff = nextTime - prevTime; long increase = (long) Math.rint((double) valDiff * ((double) (currentTime - prevTime) / (double) timeDiff)); //System.out.println("valDiff " + valDiff + ", timeDiff " + timeDiff + ", zoukaritu " + increase); long value = prev.getValue() + increase; de = new DataElement(prev.getFlagByte(), value); break; } else if(currentTime == nextTime){ de = (DataElement) l.get(j + 3); break; } j += 2; } if(j > l.size()-4){ break; } if(de == null){ de = new DataElement((byte)0x00, 0); } //System.out.print("time " + currentTime + ", value " + de.getValue()); list.add(de); // System.out.println("---"); } } return list; } // Just Before public ArrayList resampleBeforeDateDataPairListToRawDataElements(ArrayList l, long resampleInterval) { return resampleDateDataPair(l, resampleInterval, JUST_BEFORE); } // Estimate public ArrayList resampleEstimateDateDataPairListToRawDataElements(ArrayList l, long resampleInterval) { return resampleDateDataPair(l, resampleInterval, ESTIMATE); } public ArrayList getMeasurementData(String host, String event, long begin, long term) throws IOException { ArrayList a_list = extract_aList(host); ArrayList b_list = extract_bList(a_list, event); ArrayList c_list = extract_cList(b_list, begin, term); // target file list ArrayList data = new ArrayList(); if(c_list == null || c_list.size() == 0){ throw new IOException("File not matched, no measurement data."); } // 1. seek starting point int startingFileIndex = -1; long db_idx = 0; for(int i = 0; i < c_list.size(); i++){ if(startingFileIndex >= 0){ // found break; } DataFile file = (DataFile) c_list.get(i); db_idx = 0; SecondMetaBlock smb = file.getSecondMetaBlock(); HostDefBlock hdb = smb.getHostDefBlock(); int hidx = hdb.getHostIndex(host); OIDDefBlock odb = smb.getOIDDefBlock(); int oidx = odb.getOIDIndex(event); DataBlockGroupTable tbl = smb.getDataBlockGroupTable(); ArrayList dbgeList = (ArrayList) tbl.getDataBlockGroupElements(); int dbgCount = dbgeList.size(); while(true){ if(file.readDataBlock(db_idx) == null){ // end break; } long dbg_idx = db_idx % dbgCount; DataBlockGroupElement row[] = (DataBlockGroupElement[]) dbgeList.get((int)dbg_idx); int columns = -1; for(int j = 0; j < row.length; j++){ boolean matched = row[j].isPairOfHIDandOID(hidx, oidx); if(matched == true){ columns = j; break; } } if(columns >= 0){ DataBlock db = file.readDataBlock(db_idx); if(db == null){ // nexe file break; } if(db.getTime() >= begin){ // found startingFileIndex = i; break; } } db_idx++; } } if(startingFileIndex < 0){ throw new IOException("File not mathed, no starting point."); } // 2. set a data from a data block long dbidx = db_idx; long endingTime = begin + term; for(int i = startingFileIndex; i < c_list.size(); i++){ DataFile file = (DataFile) c_list.get(i); SecondMetaBlock smb = file.getSecondMetaBlock(); HostDefBlock hdb = smb.getHostDefBlock(); int hidx = hdb.getHostIndex(host); OIDDefBlock odb = smb.getOIDDefBlock(); int oidx = odb.getOIDIndex(event); DataBlockGroupTable tbl = smb.getDataBlockGroupTable(); ArrayList rows = (ArrayList) tbl.getDataBlockGroupElements(); int dbgCount = rows.size(); while(true){ if(file.readDataBlock(dbidx) == null){ // end break; } int dbg_idx = (int) (dbidx % dbgCount); DataBlockGroupElement[] row = (DataBlockGroupElement[]) rows.get(dbg_idx); int columns = -1; for(int j = 0; j < row.length; j++){ boolean matched = row[j].isPairOfHIDandOID(hidx, oidx); if(matched == true){ columns = j; break; } } //System.out.println("dbidx:" + dbidx + ", columns:" + columns + ", dbg_idx:" + dbg_idx + ", i:" + i); // found if(columns >= 0){ DataBlock db = file.readDataBlock(dbidx); if(db == null){ // next file //System.out.println("file termination."); break; } long dt = db.getTime(); ArrayList dbdata = db.getData(); DataElement de = (DataElement) dbdata.get(columns); data.add(new Date(dt)); //System.out.println(gmonitor.app.SimpleGrapherApp.dateString(dt)); data.add(de); if(dt > endingTime){ //System.out.println("time exceeded, finish."); break; } }else{ //System.out.println("data not exists in this datablock."); } dbidx++; } // next file: reset dbidx = 0; } return data; } // public ArrayList getMeasurementDataXXX(String host, String event, long begin, long term) // throws IOException // { // // ƒtƒ@ƒCƒ‹‚©‚çŒv‘ªƒf[ƒ^‚ð“ǂݞ‚Þ // ArrayList a_list = extract_aList(host); // ArrayList b_list = extract_bList(a_list, event); // DataFile file = extract_file(b_list, begin); // int file_idx = b_list.indexOf(file); // ArrayList result = new ArrayList(); // if(file == null){ // // ŠY“–‚·‚éƒtƒ@ƒCƒ‹‚ª‚È‚©‚Á‚½‚Ì‚ÅAŒv‘ªƒf[ƒ^‚ª‚È‚¢ //System.out.println("No suitable file in DataTimeSpace, no measurement data."); // return result; // } // // SecondMetaBlock smb = file.getSecondMetaBlock(); // HostDefBlock hdb = smb.getHostDefBlock(); // int hidx = hdb.getHostIndex(host); // OIDDefBlock odb = smb.getOIDDefBlock(); // int oidx = odb.getOIDIndex(event); // DataBlockGroupTable tbl = smb.getDataBlockGroupTable(); // long dbg_idx = file.getDataBlockGroupIndex(begin); // // while(file != null){ // DataBlockGroup dbg = file.getDataBlockGroup(dbg_idx); // ArrayList date_data_list = dbg.pickData(tbl, hidx, oidx); // if(date_data_list.size() == 0){ // // ˆê؃f[ƒ^‚ªŽæ‚ê‚È‚©‚Á‚½‚Ì‚ÅA‚±‚±‚ŃMƒuƒAƒbƒv‚·‚éB // break; // } // // Date date = null; // DataElement elm = null; // for(int i = 0; i < date_data_list.size(); i+= 2){ // date = (Date) date_data_list.get(i); // elm = (DataElement) date_data_list.get(i + 1); // result.add(date); // result.add(elm); // if(date.getTime() >= (begin + term)){ // // —v‹‚³‚ê‚½ŽžŠÔ”ÍˆÍ‚ð‚·‚×‚ÄŽæ‚Á‚½‚Ì‚ÅA‚±‚±‚ÅI—¹‚·‚éB // file = null; // break; // } // } // if(date.getTime() < (begin + term)){ // // ‚Ü‚¾—v‹‚³‚ê‚½ŽžŠÔ”ÍˆÍ‚ð‚·‚×‚ÄŽæ‚è‚«‚Á‚Ä‚¢‚È‚¢‚Ì‚ÅA‘±s‚ðŽŽ‚Ý‚éB // // ‚Ü‚¸AuŽŸ‚Ìvƒf[ƒ^ƒuƒƒbƒNƒOƒ‹[ƒv‚ð‘I‘ð‚µ‚Ä‚Ý‚éB // dbg_idx++; // if(dbg_idx >= file.getLength()){ // // uŽŸ‚Ìvƒf[ƒ^ƒuƒƒbƒNƒOƒ‹[ƒv‚ÍA‚±‚̃tƒ@ƒCƒ‹‚ɂ͑¶Ý‚µ‚È‚¢‚Ì‚ÅAuŽŸ‚Ìvƒtƒ@ƒCƒ‹‚ð // // ŽŽs‚·‚éB // file_idx++; // if(file_idx >= b_list.size()){ // // uŽŸ‚Ìvƒtƒ@ƒCƒ‹‚Í‘¶Ý‚µ‚È‚¢‚Ì‚ÅA‚±‚êˆÈã“ǂ߂Ȃ¢ // file = null; // break; // // ‚±‚±‚ÅI—¹‚·‚éB // } // file = (DataFile) b_list.get(file_idx); // // ƒtƒ@ƒCƒ‹‚ðØ‚è‘Ö‚¦‚½‚Ì‚ÅAʼn‚̃f[ƒ^ƒuƒƒbƒNƒOƒ‹[ƒv‚ð“ǂނׂ« // dbg_idx = 0; // } // } // } // while(file != null); // // return result; // } /** * @return */ public long getLargestGroupInterval() { return largestGroupInterval; } /** * @return */ public long getSmallestGroupInterval() { return smallestGroupInterval; } } gfarm-2.4.1/snmptool/gmonitor3/gmonitor/gui/RawData.java0000644000000000000000000000737011507222726021727 0ustar rootrootpackage gmonitor.gui; import java.awt.Color; /* * Created on 2003/06/04 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments */ /** * @author hkondo * * To change the template for this generated type comment go to * Window>Preferences>Java>Code Generation>Code and Comments */ public class RawData { private Color plotColor = Color.GREEN; private Color lineColor = Color.BLUE; private Color barColor = Color.RED; private Color levelColor = Color.YELLOW; /** * ‚±‚ÌŒv‘ªƒf[ƒ^Œn—ñ‚Ì‚à‚Á‚Æ‚àŒÃ‚¢ƒf[ƒ^‚Ì“úŽž(Java“úŽž) */ // private long epoch; // XXXtodoXXX —vÄl: ‚±‚±‚É‚ ‚é‚ׂ«‚ł͂Ȃ¢‚悤‚È‹C‚ª‚·‚é /** * ‚±‚̃IƒuƒWƒFƒNƒg‚ª•ÛŽ‚µ‚Ä‚¢‚éŒv‘ªƒf[ƒ^‚Ìʼn‚Ì“úŽž(Java“úŽž) */ // private long begin; // XXXtodoXXX —vÄl: ‚±‚±‚É‚ ‚é‚ׂ«‚ł͂Ȃ¢‚悤‚È‹C‚ª‚·‚é /** * ‚±‚̃IƒuƒWƒFƒNƒg‚ª•ÛŽ‚µ‚Ä‚¢‚éŒv‘ªƒf[ƒ^‚ÌŒ^(·•ª•¨‚Æ‚µ‚Ĉµ‚¤‚©‚Ç‚¤‚©) */ private boolean diffmode = false; /** * ‚±‚ÌŠÏ‘ª‘ÎÛ‚É‚¨‚¢‚ÄASNMP ƒJƒEƒ“ƒ^[’l‚ÌÜ‚è•Ô‚µ‚ª”­¶‚·‚é”’l */ private long max = 4294967295L; // SNMP int32 max. /** * ‚±‚ÌŒv‘ªƒf[ƒ^Œn—ñ‚Ì‘ÎÛƒzƒXƒg–¼ */ // private String host; /** * ‚±‚ÌŒv‘ªƒf[ƒ^Œn—ñ‚Ì‘ÎÛŽ–Û–¼ */ // private String event; /** * ‚±‚ÌŒv‘ªƒf[ƒ^Œn—ñ‚ÌŒv‘ªŠÔŠu(in milli-seconds) */ // private long interval; /** * ‚±‚ÌŒv‘ªƒf[ƒ^‚̃qƒ“ƒg–¼ */ // private String hint; /** * ‚±‚ÌŒv‘ªƒf[ƒ^‚ªˆ—‘ÎÛ‚Æ‚µ‚ij‚µ‚¢ó‘Ô‚É‚ ‚é‚©‚Ç‚¤‚© */ private boolean valid; /** * Œv‘ªƒf[ƒ^‚»‚Ì‚à‚Ì */ private RawDataElement[] data; /** * @return */ // public long getBegin() { // return begin; // } /** * @return */ public RawDataElement[] getData() { return data; } /** * @return */ public boolean isDiffmode() { return diffmode; } /** * @return */ // public long getEpoch() { // return epoch; // } /** * @return */ // public String getEvent() { // return event; // } /** * @return */ // public String getHint() { // return hint; // } /** * @return */ // public String getHost() { // return host; // } /** * @return */ // public long getInterval() { // return interval; // } /** * @return */ public long getMax() { return max; } /** * @return */ public boolean isValid() { return valid; } /** * @param l */ // public void setBegin(long l) { // begin = l; // } /** * @param elements */ public void setData(RawDataElement[] elements) { data = elements; } /** * @param b */ public void setDiffMode(boolean b) { diffmode = b; } /** * @param l */ // public void setEpoch(long l) { // epoch = l; // } /** * @param string */ // public void setEvent(String string) { // event = string; // } /** * @param string */ // public void setHint(String string) { // hint = string; // } /** * @param string */ // public void setHost(String string) { // host = string; // } /** * @param l */ // public void setInterval(long l) { // interval = l; // } /** * @param l */ public void setMax(long l) { max = l; } /** * @param b */ public void setValid(boolean b) { valid = b; } /** * @return */ public Color getBarColor() { return barColor; } /** * @return */ public Color getLineColor() { return lineColor; } /** * @return */ public Color getPlotColor() { return plotColor; } /** * @param color */ public void setBarColor(Color color) { barColor = color; } /** * @param color */ public void setLineColor(Color color) { lineColor = color; } /** * @param color */ public void setPlotColor(Color color) { plotColor = color; } /** * @return */ public Color getLevelColor() { return levelColor; } /** * @param color */ public void setLevelColor(Color color) { levelColor = color; } } gfarm-2.4.1/snmptool/gmonitor3/gmonitor/gui/ViewData.java0000644000000000000000000000620111507222726022100 0ustar rootrootpackage gmonitor.gui; import java.awt.Color; /* * Created on 2003/06/04 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments */ /** * @author hkondo * * To change the template for this generated type comment go to * Window>Preferences>Java>Code Generation>Code and Comments */ public class ViewData { /** * ‚±‚Ì•`‰æƒf[ƒ^‚ð•`‰æ‘ÎÛ‚Æ‚µ‚Ă悢‚©‚Ç‚¤‚© */ private boolean valid = false; /** * ‚±‚Ì•`‰æƒf[ƒ^‚ð‰æ–Êã‚Ŭ‚³‚È“_(ƒvƒƒbƒg)‚Æ‚µ‚Ä•`‰æ‚·‚ׂ«‚©‚Ç‚¤‚© */ private boolean plot = false; /** * ‚±‚Ì•`‰æƒf[ƒ^‚̃vƒƒbƒg‚ð•`‰æ‚·‚ׂ«F */ private Color plotColor = Color.GREEN; /** * ‚±‚Ì•`‰æƒf[ƒ^‚©‚ç‚’¼‰ºŒü‚«‚É“h‚è‚‚Ԃµ‚ðs‚¤‚ׂ«‚©‚Ç‚¤‚©(–_ƒOƒ‰ƒt‚̂悤‚ÉŒ©‚¦‚é) */ private boolean fill = false; /** * ‚±‚Ì•`‰æƒf[ƒ^‚ð‚’¼‰ºŒü‚«‚É“h‚è‚‚Ԃ·‚ׂ«F */ private Color fillColor = Color.RED; /** * ‚±‚Ì•`‰æƒf[ƒ^‚Æ—×Ú‚·‚é—LŒø‚È•`‰æƒf[ƒ^‚Æ‚ðü•ª‚ŘAŒ‹‚µ‚Ä•`‰æ‚·‚ׂ«‚©‚Ç‚¤‚© */ private boolean join = false; /** * •`‰æƒf[ƒ^‚ð˜AŒ‹‚·‚éü•ª‚ð•`‰æ‚·‚ׂ«F */ private Color joinColor = Color.YELLOW; /** * ÅVƒf[ƒ^‚ðŽ¦‚·…•½ü(ƒŒƒxƒ‹ƒ[ƒ^)‚ð•`‰æ‚·‚ׂ«‚©‚Ç‚¤‚© */ private boolean level = false; /** * ƒŒƒxƒ‹ƒ[ƒ^‚ð•`‰æ‚·‚ׂ«F */ private Color levelColor = Color.BLUE; /** * •`‰æƒf[ƒ^—v‘f‚Ì”z—ñ */ private ViewDataElement[] data; /** * ƒvƒƒbƒg‚Ì”¼Œa(ƒsƒNƒZƒ‹’PˆÊ) */ private int plotRadius = 2; /** * @return */ public ViewDataElement[] getData() { return data; } /** * @return */ public boolean isFill() { return fill; } /** * @return */ public Color getFillColor() { return fillColor; } /** * @return */ public boolean isJoin() { return join; } /** * @return */ public Color getJoinColor() { return joinColor; } /** * @return */ public boolean isLevel() { return level; } /** * @return */ public Color getLevelColor() { return levelColor; } /** * @return */ public boolean isPlot() { return plot; } /** * @return */ public Color getPlotColor() { return plotColor; } /** * @return */ public boolean isValid() { return valid; } /** * @param elements */ public void setData(ViewDataElement[] elements) { data = elements; } /** * @param b */ public void setFill(boolean b) { fill = b; } /** * @param color */ public void setFillColor(Color color) { fillColor = color; } /** * @param b */ public void setJoin(boolean b) { join = b; } /** * @param color */ public void setJoinColor(Color color) { joinColor = color; } /** * @param b */ public void setLevel(boolean b) { level = b; } /** * @param color */ public void setLevelColor(Color color) { levelColor = color; } /** * @param b */ public void setPlot(boolean b) { plot = b; } /** * @param color */ public void setPlotColor(Color color) { plotColor = color; } /** * @param b */ public void setValid(boolean b) { valid = b; } /** * @return */ public int getPlotRadius() { return plotRadius; } /** * @param i */ public void setPlotRadius(int i) { plotRadius = i; } } gfarm-2.4.1/snmptool/gmonitor3/gmonitor/tools/0000755000000000000000000000000011507222730020101 5ustar rootrootgfarm-2.4.1/snmptool/gmonitor3/gmonitor/tools/SumRawDataSeries.java0000644000000000000000000000565211507222726024144 0ustar rootroot/* * Created on 2003/07/29 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments */ package gmonitor.tools; import gmonitor.gui.RawData; import gmonitor.gui.RawDataElement; import java.util.ArrayList; /** * @author hkondo * * To change the template for this generated type comment go to * Window>Preferences>Java>Code Generation>Code and Comments */ public class SumRawDataSeries { public RawDataElement[] total(RawData[] rda) { RawData newData = new RawData(); ArrayList newList = new ArrayList(); long time = 0; int series = rda.length; RawDataElement[] totalBuffer = new RawDataElement[series]; int[] scanIndex = new int[series]; long endTime[] = new long[series]; fillEndTime(endTime, rda); while(true){ // totalBuffer ‚ðXV‚µ‚Ä–ß‚éB time = scanNext(time, rda, scanIndex, totalBuffer); // ‡ŽZƒoƒbƒtƒ@‚ð‡Œv‚µAV‚½‚È—v‘f‚Æ‚·‚é long v = addup(totalBuffer); RawDataElement ne = new RawDataElement(); ne.setTime(time); ne.setValue(v); newList.add(ne); // I—¹ðŒH if(isFinishedTime(time, endTime) == true){ break; } } RawDataElement[] rde = new RawDataElement[newList.size()]; rde = (RawDataElement[]) newList.toArray(rde); return rde; } private long scanNext(long time, RawData[] rda, int[] si, RawDataElement[] tb) { int series = rda.length; // ‚·‚ׂĂ̌n—ñ‚ɂ‚¢‚ÄA long t = Long.MAX_VALUE; for(int s = 0; s < series; s++){ RawDataElement[] rde = rda[s].getData(); // time ‚æ‚è‘å‚«‚¢—v‘f‚̃Cƒ“ƒfƒNƒX‚ð’T‚·B int idx = findFirstExceededTime(time, rde); // ‚»‚Ì’†‚ÅAŌẪ^ƒCƒ€ƒXƒ^ƒ“ƒv‚Ì—v‘f‚ðuƒ}ƒbƒ`‚µ‚½v‚Æ‚·‚é if(idx < 0){ // ‚±‚ÌŒn—ñ‚ł͌©‚‚©‚ç‚È‚©‚Á‚½B }else{ // ‚Ƃ肠‚¦‚¸Šo‚¦‚Ä‚¨‚­B si[s] = idx; long tt = rde[idx].getTime(); if(t < tt){ t = tt; } } } // ƒ}ƒbƒ`‚µ‚½—v‘f‚ðtb‚ÉŠo‚¦‚éB•¡”ƒ}ƒbƒ`‚µ‚½ê‡‚ɂ͂·‚ׂĊo‚¦‚éB for(int s = 0; s < series; s++){ RawDataElement[] rde = rda[s].getData(); if(rde[si[s]].getTime() == t){ // ‡ŽZƒoƒbƒtƒ@‚É’~‚¦‚é‚ׂ«B tb[s] = rde[si[s]]; } } return t; } /** * @param time * @param rde * @return */ private int findFirstExceededTime(long time, RawDataElement[] rde) { for(int i = 0; i < rde.length; i++){ if(rde[i].isValid() == true){ if(rde[i].getTime() > time){ return i; } } } return -1; } private boolean isFinishedTime(long t, long[] endTime) { for(int i = 0; i < endTime.length; i++){ if(t < endTime[i]){ return false; } } // t >= endTime[all of]; return true; } private void fillEndTime(long[] endTime, RawData[] rda) { for(int i = 0; i < rda.length; i++){ RawDataElement[] rde = rda[i].getData(); endTime[i] = rde[rde.length + 1].getTime(); } return; } private long addup(RawDataElement[] rde) { long s = 0; for(int i = 0; i < rde.length; i++){ s += rde[i].getValue(); } return s; } } gfarm-2.4.1/snmptool/gmonitor3/gmonitor/tools/DumpLogFile.java0000644000000000000000000000325511507222726023125 0ustar rootroot/* * Created on 2003/06/27 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments */ package gmonitor.tools; import gmonitor.logdata.FirstMetaBlock; import gmonitor.logdata.SecondMetaBlock; import gmonitor.logdata.UTY; import java.io.File; import java.io.FileInputStream; import java.io.IOException; /** * @author hkondo * * ƒƒOƒtƒ@ƒCƒ‹‚Ì\‘¢‚ð“ǂݎæ‚èAprintable ‚ȃeƒLƒXƒgŒ`Ž®‚Ń_ƒ“ƒv‚·‚éŠJ”­—pƒc[ƒ‹ */ public class DumpLogFile { protected boolean swFMBOutput = true; protected boolean swSMBOutput = true; protected boolean swDBOoutput = true; protected String filename = "glogger.bin"; public DumpLogFile() { } public DumpLogFile(String args[]) { for(int i = 0; i < args.length; i++){ if(args[i].startsWith("-")){ // ƒIƒvƒVƒ‡ƒ“‚̈— }else{ // ƒtƒ@ƒCƒ‹–¼‚̈— filename = args[i]; } } } public void run() { FirstMetaBlock fmb; SecondMetaBlock smb; try { File f = new File(filename); FileInputStream fis = new FileInputStream(f); /* FirstMetaBlock */{ byte[] bytes = new byte[2]; fis.read(bytes); int sz = UTY.byte2int(bytes); fmb = FirstMetaBlock.newInstance(fis, sz); } /* SecondMetaBlock */{ byte[] bytes = new byte[4]; fis.read(bytes); int sz = UTY.byte2int(bytes); smb = SecondMetaBlock.newInstance(fis, sz); } if(swFMBOutput == true){ System.out.println(fmb.asDump()); } if(swSMBOutput == true){ System.out.println(smb.asDump()); } } catch (IOException e) { e.printStackTrace(); } } public static void main(String args[]) { DumpLogFile dlf = new DumpLogFile(args); dlf.run(); } } gfarm-2.4.1/snmptool/gmonitor3/gmonitor/tools/ScanLogDir.java0000644000000000000000000000314711507222726022743 0ustar rootroot/* * Created on 2003/07/08 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments */ package gmonitor.tools; import gmonitor.logdata.DataFile; import java.io.IOException; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; /** * @author hkondo * * To change the template for this generated type comment go to * Window>Preferences>Java>Code Generation>Code and Comments */ public class ScanLogDir { ArrayList files = new ArrayList(); public ScanLogDir(String args[]) { for(int i = 0; i < args.length; i++){ if(args[i].startsWith("-") == true){ // option parsing. }else{ // add to target list. files.add(args[i]); } } } public void run() { SimpleDateFormat df = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss"); System.out.println("Processing files are:"); for(int i = 0; i < files.size(); i++){ String fn = (String) files.get(i); System.out.print(fn + "\t"); try { DataFile f = DataFile.getInstance(fn); long begin = f.getBeginDateTime(); long end = f.getLatestDateTime(); System.out.print("Begin:" + df.format(new Date(begin))); System.out.print(" End:" + df.format(new Date(end))); System.out.print('\n'); } catch (IOException e) { System.out.println("*** IOException ***"); } } } public static void main(String args[]) { ScanLogDir app = new ScanLogDir(args); long b = System.currentTimeMillis(); app.run(); long e = System.currentTimeMillis(); System.out.println("Elapsed in realtime: " + (e - b) + " milli-seconds."); } } gfarm-2.4.1/snmptool/gmonitor3/gmonitor/tools/GlogDump.java0000644000000000000000000000350311507222726022470 0ustar rootroot/* * Created on 2003/07/07 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments */ package gmonitor.tools; import java.io.IOException; import java.util.ArrayList; import gmonitor.logdata.DataBlock; import gmonitor.logdata.DataFile; import gmonitor.logdata.FirstMetaBlock; import gmonitor.logdata.SecondMetaBlock; /** * @author hkondo * * To change the template for this generated type comment go to * Window>Preferences>Java>Code Generation>Code and Comments */ public class GlogDump { protected boolean swFMBOutput = true; protected boolean swSMBOutput = true; protected boolean swDBOutput = true; protected String filename = "glogger.bin"; public GlogDump() { } public GlogDump(String args[]) { for(int i = 0; i < args.length; i++){ if(args[i].startsWith("-")){ // ƒIƒvƒVƒ‡ƒ“‚̈— }else{ // ƒtƒ@ƒCƒ‹–¼‚̈— filename = args[i]; } } } public void run() { FirstMetaBlock fmb; SecondMetaBlock smb; try { DataFile f = DataFile.getInstance(filename); /* FirstMetaBlock */{ fmb = f.getFirstMetaBlock(); } /* SecondMetaBlock */{ smb = f.getSecondMetaBlock(); } if(swFMBOutput == true){ System.out.println(fmb.asDump()); } if(swSMBOutput == true){ System.out.println(smb.asDump()); } if(swDBOutput == true){ int count = (int) f.getLength(); int dbc = 0; for(int i = 0; i < count; i++){ ArrayList l = f.getDataBlockGroup((long) i); for(int j = 0; j < l.size(); j++){ DataBlock db = (DataBlock) l.get(j); System.out.print(db.asDump(dbc, smb.getIntervalDefBlock())); dbc++; } } } } catch (IOException e) { e.printStackTrace(); } } public static void main(String args[]) { GlogDump dlf = new GlogDump(args); dlf.run(); } } gfarm-2.4.1/snmptool/gmonitor3/gmonitor/logdata/0000755000000000000000000000000011507222730020354 5ustar rootrootgfarm-2.4.1/snmptool/gmonitor3/gmonitor/logdata/UTY.java0000644000000000000000000000745211507222726021715 0ustar rootrootpackage gmonitor.logdata; import java.io.UnsupportedEncodingException; import java.lang.reflect.Field; import java.math.BigInteger; import java.util.ArrayList; /* * Created on 2003/05/14 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments */ /** * @author hkondo * * To change the template for this generated type comment go to * Window>Preferences>Java>Code Generation>Code and Comments */ public class UTY { public static final String ENCODING = "ASCII"; public static final String byte2String(byte b[], int off, int len) throws UnsupportedEncodingException { return new String(b, off, len, ENCODING); } public static final long byte2long(byte b[]){ return ( ((b[0]&0xFFL)<<56) | ((b[1]&0xFFL)<<48) | ((b[2]&0xFFL)<<40) | ((b[3]&0xFFL)<<32) | ((b[4]&0xFFL)<<24) | ((b[5]&0xFFL)<<16) | ((b[6]&0xFFL)<<8) | (b[7]&0xFFL) ); // long val = 0; // for(int i = 0; i < 8; i++){ // val |= (b[i] & 0xFF) << (8*(7-i)); // } // return val; //BigInteger bi = new BigInteger(b); //return bi.longValue(); } public static final int byte2int4(byte b[]){ return ( ((b[0]&0xFF)<<24) | ((b[1]&0xFF)<<16) | ((b[2]&0xFF)<<8) | (b[3]&0xFF) ); } public static final int byte2int(byte b[]){ BigInteger bi = new BigInteger(b); return bi.intValue(); } public static String toStringLine(String[] fields, char delim) { StringBuffer b = new StringBuffer(); b.append(fields[0]); for(int i = 1; i < fields.length; i++){ b.append(delim); b.append(fields[i]); } return b.toString(); } public static String toStringLine(ArrayList fields, char delim) { String[] tokens = new String[fields.size()]; tokens = (String[]) fields.toArray(tokens); return toStringLine(tokens, delim); } public static String toStringLine(Object obj, String name, String info, String[] label, String[] fields) { return toStringLine(obj, name, info, label, fields, ':'); } public static String toStringLine(Object obj, String name, String info, String[] label, String[] fields, char delim) { StringBuffer b = new StringBuffer(); Class c = obj.getClass(); Field f = null; b.append(name); b.append(delim); b.append(info); for(int i = 0; i < label.length; i++){ try { f = c.getDeclaredField(fields[i]); Object val = f.get(obj); b.append(delim); b.append(val); } catch (SecurityException e) { b.append("sssss"); } catch (NoSuchFieldException e) { b.append("nnnnn"); } catch (IllegalArgumentException e1) { b.append("xxxxx"); } catch (IllegalAccessException e1) { b.append("zzzzz"); } } return b.toString(); } public static String toString(Object obj, String name, String info, String[] label, String[] fields) { StringBuffer b = new StringBuffer(); Class c = obj.getClass(); Field f = null; b.append("[ "); if(name != null && name.equals("") == false){ b.append(name); b.append(' '); } if(info != null && info.equals("") == false){ b.append('('); b.append(info); b.append(") "); } b.append("]\n"); for(int i = 0; i < label.length; i++){ b.append(" - "); b.append(label); b.append(" = "); try { f = c.getDeclaredField(fields[i]); Object val = f.get(obj); b.append(val); b.append("\n"); b.append(val); b.append("\n"); } catch (SecurityException e) { b.append("--- Security Violation ---\n"); } catch (NoSuchFieldException e) { b.append("--- No Such Field "); b.append(fields[i]); b.append(" ---\n"); } catch (IllegalArgumentException e1) { b.append("--- Illegal Argument Exception ---\n"); } catch (IllegalAccessException e1) { b.append("--- IllegalAccessException ---\n"); } } return b.toString(); } public static final int byte2int(byte b) { return (((int)b) & 0x000000ff); } } gfarm-2.4.1/snmptool/gmonitor3/gmonitor/logdata/DataBlockGroupElement.java0000644000000000000000000000251711507222726025404 0ustar rootroot/* * Created on 2003/05/14 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments */ package gmonitor.logdata; //TODO: Is this changed into immutable? (and DataBlockGroupTable) /** * @author hkondo * * To change the template for this generated type comment go to * Window>Preferences>Java>Code Generation>Code and Comments */ public class DataBlockGroupElement { private int oidIndex; private int hostIndex; public String toString() { return String.valueOf(hostIndex) + '-' + String.valueOf(oidIndex); } /** * @return */ public int getHostIndex() { return hostIndex; } /** * @return */ public int getOidIndex() { return oidIndex; } /** * @param i */ public void setHostIndex(int i) { hostIndex = i; } /** * @param i */ public void setOidIndex(int i) { oidIndex = i; } public int seekPairOfHIDandOID(int hidx, String event, OIDDefBlock odb) { int next = 1; int oidx; while(true){ oidx = odb.getOIDIndexNext(event, next); if(oidx == -1){ return -1; } else if( (hidx == hostIndex) && (oidx == oidIndex) ){ return oidx; } else{ next++; } } } public boolean isPairOfHIDandOID(int hidx, int oidx) { if( (hidx == hostIndex) && (oidx == oidIndex) ){ return true; } else{ return false; } } } gfarm-2.4.1/snmptool/gmonitor3/gmonitor/logdata/SecondMetaBlock.java0000644000000000000000000000522311507222726024223 0ustar rootrootpackage gmonitor.logdata; import java.io.IOException; import java.io.InputStream; /* * Created on 2003/05/14 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments */ /** * @author hkondo * * To change the template for this generated type comment go to * Window>Preferences>Java>Code Generation>Code and Comments */ public class SecondMetaBlock extends BinaryBlock{ HostDefBlock hdb; OIDDefBlock odb; IntervalDefBlock idb; DataBlockGroupTable dbgt; // int szHostDef; // (2bytes) // ArrayList lsHost; // (varibale) // int szOIDDef; // (2bytes) // ArrayList lsOID; // (variable) // int szIntervalDef; // (2bytes) // ArrayList lsInterval; // (variable) // int szReserved; // (2bytes) public HostDefBlock getHostDefBlock() { return hdb; } public OIDDefBlock getOIDDefBlock() { return odb; } public IntervalDefBlock getIntervalDefBlock() { return idb; } public DataBlockGroupTable getDataBlockGroupTable() { return dbgt; } public String asDump() { StringBuffer b = new StringBuffer(); b.append("# Second Meta Block\n"); b.append("SecondMetaBlockSize::"); b.append(size); b.append('\n'); b.append(hdb.toString()); b.append('\n'); b.append(odb.toString()); b.append('\n'); b.append(idb.toString()); b.append('\n'); b.append(dbgt.toString());b.append('\n'); return b.toString(); } // private static final int findzero(byte[] b, int off) // { // int i = off; // while(b[i] != 0)i++; // return i; // } public static SecondMetaBlock newInstance(InputStream is, int sz) throws IOException { SecondMetaBlock bb = new SecondMetaBlock(); bb.deserialize(is, sz); return bb; } /* (non-Javadoc) * @see BinaryBlock#parse_binary_block(java.io.ByteArrayInputStream) */ protected void parse_binary_block(InputStream is) throws IOException { // parsing and de-serializing Host Definition part. int sz = this.read2bytesInt(is); hdb = HostDefBlock.newInstance(is, sz); // parsing and de-serializing OID Definition part. sz = this.read2bytesInt(is); odb = OIDDefBlock.newInstance(is, sz); // parsing and de-serializing Interval Definition part. sz = this.read2bytesInt(is); idb = IntervalDefBlock.newInstance(is, sz); // parsing and de-serializing Data Block Group Table part. sz = this.read2bytesInt(is); dbgt = DataBlockGroupTable.newInstance(is, sz); } /** * @param host * @return */ public boolean containsHost(String host) { return hdb.containsHost(host); } /** * @param event * @return */ public boolean containsEvent(String event) { return odb.containsEvent(event); } } gfarm-2.4.1/snmptool/gmonitor3/gmonitor/logdata/OIDDefElement.java0000644000000000000000000000202711507222726023571 0ustar rootrootpackage gmonitor.logdata; /* * Created on 2003/05/14 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments */ /** * @author hkondo * * To change the template for this generated type comment go to * Window>Preferences>Java>Code Generation>Code and Comments */ public class OIDDefElement { private String OID; private String nickname; public String toString(int idx) { StringBuffer b = new StringBuffer(); b.append("OIDDefElement:"); b.append(idx); b.append(':'); b.append(OID); b.append(':'); b.append(nickname); return b.toString(); } /** * @return */ public String getNameAndNick() { //return nickname; return nickname + "#" + OID; } public String getNickname() { return nickname; } /** * @return */ public String getOID() { return OID; } /** * @param string */ public void setNickname(String string) { nickname = string; } /** * @param string */ public void setOID(String string) { OID = string; } } gfarm-2.4.1/snmptool/gmonitor3/gmonitor/logdata/DataElement.java0000644000000000000000000000427011507222726023412 0ustar rootroot/* * Created on 2003/07/07 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments */ package gmonitor.logdata; /** * @author hkondo * * To change the template for this generated type comment go to * Window>Preferences>Java>Code Generation>Code and Comments */ public class DataElement { public static final int VALID_FLAG = 0; public static final int SUCCESS_FLAG = 1; // public static final int RESERVED2_FLAG = 2; // public static final int RESERVED3_FLAG = 3; // public static final int RESERVED4_FLAG = 4; // public static final int RESERVED5_FLAG = 5; // public static final int RESERVED6_FLAG = 6; // public static final int RESERVED7_FLAG = 7; /** * @param b * @param val */ public DataElement(byte b, long val) { value = val; flagByte = b; // for(int i = 0; i < 8; i++){ // flags[i] = (((int)b & (0x01 << i)) != 0) ? true : false; // } flags[0] = (((int)b & 0x01) != 0) ? true : false; flags[1] = (((int)b & 0x02) != 0) ? true : false; // flags[2] = (((int)b & 0x04) != 0) ? true : false; // flags[3] = (((int)b & 0x08) != 0) ? true : false; // flags[4] = (((int)b & 0x10) != 0) ? true : false; // flags[5] = (((int)b & 0x20) != 0) ? true : false; // flags[6] = (((int)b & 0x40) != 0) ? true : false; // flags[7] = (((int)b & 0x80) != 0) ? true : false; } byte flagByte; //boolean[] flags = new boolean[8]; boolean[] flags = new boolean[2]; long value = 0; public byte getFlagByte() { return flagByte; } /** * @return */ public boolean[] getFlags() { return flags; } /** * @param idx * @return */ public boolean getFlag(int idx){ return flags[idx]; } /** * @return */ public long getValue() { return value; } /** * @param bs */ public void setFlags(boolean[] bs) { flags = bs; } /** * @param i */ public void setValue(long i) { value = i; } public String asDump(int hid, int oid) { StringBuffer b = new StringBuffer(); b.append("MeasurementData:" + hid + "-" + oid + ":"); for(int i = 7; i >= 0; i--){ if(flags[i] == true){ b.append('1'); }else{ b.append('0'); } } b.append(":" + value); return b.toString(); } } gfarm-2.4.1/snmptool/gmonitor3/gmonitor/logdata/DataBlock.java0000644000000000000000000000616111507222726023054 0ustar rootroot/* * Created on 2003/07/07 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments */ package gmonitor.logdata; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; /** * @author hkondo * * To change the template for this generated type comment go to * Window>Preferences>Java>Code Generation>Code and Comments */ public class DataBlock { /** * ‹ó‚̃f[ƒ^ƒuƒƒbƒN‚𶬂·‚é */ public DataBlock() { valid = false; } boolean valid = true; int timeInUNIXSeconds; int timeInUNIXuSeconds; long time; ArrayList data = new ArrayList(); /** * ƒoƒCƒiƒŠ”z—ñ‚©‚çƒf[ƒ^ƒuƒƒbƒN‚𶬂·‚é */ public DataBlock(byte[] bytes, int i, int num) { timeInUNIXSeconds = ( ((bytes[i++]&0xFF)<<24) | ((bytes[i++]&0xFF)<<16) | ((bytes[i++]&0xFF)<<8) | (bytes[i++]&0xFF) ); timeInUNIXuSeconds = ( ((bytes[i++]&0xFF)<<24) | ((bytes[i++]&0xFF)<<16) | ((bytes[i++]&0xFF)<<8) | (bytes[i++]&0xFF) ); // byte[] b4 = new byte[4]; // int i = idx; // b4[0] = bytes[i + 0]; // b4[1] = bytes[i + 1]; // b4[2] = bytes[i + 2]; // b4[3] = bytes[i + 3]; // timeInUNIXSeconds = UTY.byte2int4(b4); i += 4; // // b4[0] = bytes[i + 0]; // b4[1] = bytes[i + 1]; // b4[2] = bytes[i + 2]; // b4[3] = bytes[i + 3]; // timeInUNIXuSeconds = UTY.byte2int4(b4);i += 4; time = (long) (timeInUNIXSeconds * 1000L + timeInUNIXuSeconds / 1000L); long val; byte b; for(int j = 0; j < num; j++){ b = bytes[i++]; val = ( ((bytes[i++]&0xFFL)<<24) | ((bytes[i++]&0xFFL)<<16) | ((bytes[i++]&0xFFL)<<8) | (bytes[i++]&0xFFL) ); // byte b = bytes[i]; i++; // byte[] b8 = new byte[8]; // b8[0] = b8[1] = b8[2] = b8[3] = 0; // padding MSB. // b8[4] = bytes[i + 0]; // b8[5] = bytes[i + 1]; // b8[6] = bytes[i + 2]; // b8[7] = bytes[i + 3]; // long val= UTY.byte2long(b8); i += 4; DataElement e = new DataElement(b, val); data.add(e); } //valid = true; } /** * @return */ public ArrayList getData() { return data; } /** * @return */ public int getTimeInUNIXSeconds() { return timeInUNIXSeconds; } /** * @return */ public int getTimeInUNIXuSeconds() { return timeInUNIXuSeconds; } /** * @return */ public boolean isValid() { return valid; } /** * */ public String asDump(int i, IntervalDefBlock idb) { StringBuffer b = new StringBuffer(); SimpleDateFormat df = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss"); long t = (long) (timeInUNIXSeconds * 1000L); String dt = df.format(new Date(t)); b.append("# DataBlock " + i + "\n"); if(valid == true){ b.append("TimeStampInSeconds::" + timeInUNIXSeconds + ":\""); b.append(dt + "\"\n"); b.append("TimeStampInuSeconds::" + timeInUNIXuSeconds + "\n"); for(int j = 0; j < data.size(); j++){ IntervalDefElement ie = idb.getElement(j); int hid = ie.getHostIndex(); int oid = ie.getOidIndex(); DataElement e = (DataElement) data.get(j); b.append(e.asDump(hid, oid)); b.append("\n"); } } return b.toString(); } /** * @return */ public long getTime() { return time; } } gfarm-2.4.1/snmptool/gmonitor3/gmonitor/logdata/HttpSeekableFile.java0000644000000000000000000000341311507222726024400 0ustar rootroot/* * Created on 2003/06/20 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments */ package gmonitor.logdata; import java.io.IOException; import java.io.InputStream; import java.net.HttpURLConnection; import java.net.MalformedURLException; import java.net.URL; /** * @author hkondo * * To change the template for this generated type comment go to * Window>Preferences>Java>Code Generation>Code and Comments */ public class HttpSeekableFile implements SeekableFile { URL url; long pos; /** * @param u */ public HttpSeekableFile(URL u) { try { url = new URL(u.toString()); pos = 0; } catch (MalformedURLException e) { // Cannot be reached. e.printStackTrace(); } } /* (non-Javadoc) * @see scratch.SeekableFile#close() */ public void close() throws IOException { // Nothing to do. } /* (non-Javadoc) * @see scratch.SeekableFile#length() */ public long size() throws IOException { HttpURLConnection c = (HttpURLConnection) url.openConnection(); c.setRequestMethod("HEAD"); c.connect(); long len = c.getContentLength(); c.disconnect(); return len; } /* (non-Javadoc) * @see scratch.SeekableFile#read(byte[], int, int) */ public int read(byte[] buf, int idx, int amount) throws IOException { HttpURLConnection c = (HttpURLConnection) url.openConnection(); String begin = Long.toString(pos); String end = Long.toString(pos + (long)(amount - idx) + 1); c.setRequestProperty("Range", "bytes=" + begin + "-" + end); c.connect(); InputStream is = c.getInputStream(); int len = is.read(buf, idx, amount); return len; } /* (non-Javadoc) * @see scratch.SeekableFile#seek(long) */ public void seek(long pos) throws IOException { this.pos = pos; } } gfarm-2.4.1/snmptool/gmonitor3/gmonitor/logdata/HostDefElement.java0000644000000000000000000000277311507222726024103 0ustar rootrootpackage gmonitor.logdata; /* * Created on 2003/05/14 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments */ /** * @author hkondo * * To change the template for this generated type comment go to * Window>Preferences>Java>Code Generation>Code and Comments */ public class HostDefElement { private String ipAddr; private String hostname; private String nickname; private String communityString; public String toString(int idx) { StringBuffer b = new StringBuffer(); b.append("HostDefElement:"); b.append(idx); b.append(':'); b.append(ipAddr); b.append(':'); b.append(hostname); b.append(':'); b.append(nickname); b.append(':'); b.append(communityString); return b.toString(); } /** * @return */ public String getCommunityString() { return communityString; } /** * @return */ public String getNameAndNick() { //return hostname; return nickname + "#" + hostname; } public String getHostname() { return hostname; } public String getIpAddr() { return ipAddr; } /** * @return */ public String getNickname() { return nickname; } /** * @param string */ public void setCommunityString(String string) { communityString = string; } /** * @param string */ public void setHostname(String string) { hostname = string; } public void setIpAddr(String addr) { ipAddr = addr; } /** * @param string */ public void setNickname(String string) { nickname = string; } } gfarm-2.4.1/snmptool/gmonitor3/gmonitor/logdata/DataBlockGroupTable.java0000644000000000000000000000376211507222726025045 0ustar rootroot/* * Created on 2003/05/14 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments */ package gmonitor.logdata; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; /** * @author hkondo * * To change the template for this generated type comment go to * Window>Preferences>Java>Code Generation>Code and Comments */ public class DataBlockGroupTable extends BinaryBlock { protected ArrayList table = new ArrayList(); // a list of row(it is a data block group). public static DataBlockGroupTable newInstance(InputStream is, int sz) throws IOException{ DataBlockGroupTable dbgt = new DataBlockGroupTable(); dbgt.deserialize(is, sz); return dbgt; } public ArrayList getDataBlockGroupElements() { return table; } /* (non-Javadoc) * @see gmonitor.logdata.BinaryBlock#parse_binary_block(java.io.InputStream) * [ {€–Ú”n(2bytes)} {ƒzƒXƒg’è‹`ƒCƒ“ƒfƒNƒX(2bytes)}{OID’è‹`ƒCƒ“ƒfƒNƒX(2bytes)} * n ] * ‚ÌŒJ‚è•Ô‚µ */ protected void parse_binary_block(InputStream is) throws IOException { int read_size = 0; while(read_size < size){ int cnt = read2bytesInt(is); read_size += 2; DataBlockGroupElement[] row = new DataBlockGroupElement[cnt]; table.add(row); for(int i = 0; i < cnt; i++){ DataBlockGroupElement e = new DataBlockGroupElement(); int hidx = read2bytesInt(is); e.setHostIndex(hidx); read_size += 2; int oidx = read2bytesInt(is); e.setOidIndex(oidx); read_size += 2; row[i] = e; } } } public String toString() { StringBuffer sb = new StringBuffer("# DataBlockGroupTable"); synchronized(table){ int cnt = table.size(); for(int i = 0; i < cnt; i++){ DataBlockGroupElement[] e = (DataBlockGroupElement[]) table.get(i); sb.append("\nDataBlockGroupElement:"); sb.append(e.length); for(int j = 0; j < e.length; j++){ sb.append(':'); sb.append(e[j].toString()); } } } return sb.toString(); } } gfarm-2.4.1/snmptool/gmonitor3/gmonitor/logdata/HostDefBlock.java0000644000000000000000000000540711507222726023541 0ustar rootrootpackage gmonitor.logdata; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; /* * Created on 2003/05/14 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments */ /** * @author hkondo * * To change the template for this generated type comment go to * Window>Preferences>Java>Code Generation>Code and Comments */ public class HostDefBlock extends BinaryBlock { protected ArrayList definition = new ArrayList(); public static HostDefBlock newInstance(InputStream is, int sz) throws IOException { HostDefBlock bb = new HostDefBlock(); bb.deserialize(is, sz); return bb; } public int getCount(){ return definition.size(); } /* (non-Javadoc) * @see BinaryBlock#parse_binary_block(java.io.InputStream) * {IPƒAƒhƒŒƒX(•¶Žš—ñ)}{NULL}{FQDN}{NULL}{—ªÌ}{NULL}{ƒRƒ~ƒ…ƒjƒeƒBƒXƒgƒŠƒ“ƒO}{NULL} */ protected void parse_binary_block(InputStream is) throws IOException { byte[] buf = new byte[STRLEN]; int read_size = 0; while(read_size < size){ HostDefElement e = new HostDefElement(); // Read string represented IP Address. String ipaddr; int cnt = readBytesWithNull(is, buf); e.setIpAddr(UTY.byte2String(buf, 0, cnt)); read_size += (cnt + 1); // '+1' means NULL. // Read Hostname. cnt = readBytesWithNull(is, buf); e.setHostname(UTY.byte2String(buf, 0, cnt)); read_size += (cnt + 1); // '+1' means NULL. // Read Nickname of host. cnt = readBytesWithNull(is, buf); e.setNickname(UTY.byte2String(buf, 0, cnt)); read_size += (cnt + 1); // '+1' means NULL. // Read community string of host. cnt = readBytesWithNull(is, buf); e.setCommunityString(UTY.byte2String(buf, 0, cnt)); read_size += (cnt + 1); // '+1' means NULL. // add definition element. definition.add(e); } } public String toString() { StringBuffer sb = new StringBuffer("# HostDefBlock"); synchronized(definition){ int cnt = definition.size(); for(int i = 0; i < cnt; i++){ HostDefElement e = (HostDefElement) definition.get(i); sb.append('\n'); sb.append(e.toString(i)); } } return sb.toString(); } public int getHostIndex(String host) { int idx = -1; synchronized(definition){ for(int i = 0; i < definition.size(); i++){ HostDefElement e = (HostDefElement) definition.get(i); String h = e.getNameAndNick(); if(h.equals(host) == true){ idx = i; break; } } } return idx; } public HostDefElement getHostDefElement(int idx) { HostDefElement e = null; synchronized(definition){ e = (HostDefElement) definition.get(idx); } return e; } public boolean containsHost(String host) { int idx = getHostIndex(host); if(idx < 0){ return false; }else{ return true; } } } gfarm-2.4.1/snmptool/gmonitor3/gmonitor/logdata/IntervalDefElement.java0000644000000000000000000000337311507222726024747 0ustar rootrootpackage gmonitor.logdata; /* * Created on 2003/05/14 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments */ /** * @author hkondo * * To change the template for this generated type comment go to * Window>Preferences>Java>Code Generation>Code and Comments */ public class IntervalDefElement { private int hostIndex; private int oidIndex; private long time; private long time_unix_seconds; private long time_unix_useconds; public String toString(int idx) { StringBuffer b = new StringBuffer(); b.append("IntervalDefElement:"); b.append(idx); b.append(':'); b.append(hostIndex); b.append('-'); b.append(oidIndex); b.append(':'); b.append(time_unix_seconds); b.append('.'); b.append(format(time_unix_useconds)); return b.toString(); } private String format(long val){ String ret = "000000" + String.valueOf(val); return ret.substring(ret.length() - 6); } /** * @return */ public int getHostIndex() { return hostIndex; } /** * @return */ public int getOidIndex() { return oidIndex; } /** * @return */ public long getTime() { return time; } /** * @param i */ public void setHostIndex(int i) { hostIndex = i; } /** * @param i */ public void setOidIndex(int i) { oidIndex = i; } /** * @param l */ public void setTime(long l) { time = l; } /** * @return */ public long getTime_unix_seconds() { return time_unix_seconds; } /** * @return */ public long getTime_unix_useconds() { return time_unix_useconds; } /** * @param l */ public void setTime_unix_seconds(long l) { time_unix_seconds = l; } /** * @param l */ public void setTime_unix_useconds(long l) { time_unix_useconds = l; } } gfarm-2.4.1/snmptool/gmonitor3/gmonitor/logdata/SeekableFileFactory.java0000644000000000000000000000350011507222726025065 0ustar rootroot/* * Created on 2003/06/20 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments */ package gmonitor.logdata; import java.io.File; import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; /** * @author hkondo * * To change the template for this generated type comment go to * Window>Preferences>Java>Code Generation>Code and Comments */ public class SeekableFileFactory { /** * URL u ‚ÅŽ¦‚³‚ê‚éƒtƒ@ƒCƒ‹‚ð—p‚¢‚Ä SeekableFile ‚𶬂·‚éB * u ‚̃vƒƒgƒRƒ‹‚ª file: ‚Å‚ ‚ê‚Î LocalSeekableFile ‚ªAhttp: ‚Å‚ ‚ê‚Î HttpSeekableFile@‚ª * ¶¬‚³‚ê‚éB‚»‚êˆÈŠO‚̃vƒƒgƒRƒ‹‚Å‚Í MalformedURLException ‚ª”­¶‚·‚é * @param u SeekableFile‚ðŽ¦‚· URL * @return u ‚ÅŽ¦‚³‚ꂽƒtƒ@ƒCƒ‹‚©‚綬‚³‚ꂽ SeekableFile * @throws IOException * @throws MalformedURLException u ‚̃vƒƒgƒRƒ‹‚ªfile:‚à‚µ‚­‚Íhttp:ˆÈŠO‚Å‚ ‚Á‚½ê‡B */ public static SeekableFile create(URL u) throws IOException { SeekableFile file = null; String p = u.getProtocol(); if(p.equalsIgnoreCase("file")){ // file: ‚Ȃ̂ŠLocalSeekableFile ‚𶬠File f = new File(u.getPath()); file = new LocalSeekableFile(f); }else if(p.equalsIgnoreCase("http")){ // http: ‚Ȃ̂ŠHttpSeekableFile ‚𶬠file = new HttpSeekableFile(u); }else{ // –¢’m‚̃vƒƒgƒRƒ‹ throw new MalformedURLException("Unsupported Protocol" + p); } return file; } public static SeekableFile create(File f) throws IOException { // File ‚Å‚ ‚ç‚킳‚ê‚éƒtƒ@ƒCƒ‹‚ðŽ¦‚· SeekableFile ‚𶬂·‚é return new LocalSeekableFile(f); } public static SeekableFile create(String url) throws IOException { SeekableFile file = null; if(url.startsWith("http:")){ URL u = new URL(url); file = create(u); }else{ File f = new File(url); file = create(f); } return file; } } gfarm-2.4.1/snmptool/gmonitor3/gmonitor/logdata/IntervalDefBlock.java0000644000000000000000000000361411507222726024406 0ustar rootrootpackage gmonitor.logdata; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; /* * Created on 2003/05/14 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments */ /** * @author hkondo * * To change the template for this generated type comment go to * Window>Preferences>Java>Code Generation>Code and Comments */ public class IntervalDefBlock extends BinaryBlock { protected ArrayList definition = new ArrayList(); public static IntervalDefBlock newInstance(InputStream is, int sz) throws IOException { IntervalDefBlock bb = new IntervalDefBlock(); bb.deserialize(is, sz); return bb; } public int getCount(){ return definition.size(); } public IntervalDefElement getElement(int idx){ return (IntervalDefElement)definition.get(idx); } /* (non-Javadoc) * @see BinaryBlock#parse_binary_block(java.io.InputStream) * {ƒzƒXƒgƒCƒ“ƒfƒbƒNƒX”Ô†}{OID ƒCƒ“ƒfƒbƒNƒX”Ô†}{ŽžŠÔ(4+4bytes)} */ protected void parse_binary_block(InputStream is) throws IOException { int read_size = 0; while(read_size < size){ IntervalDefElement e = new IntervalDefElement(); e.setHostIndex(read2bytesInt(is)); read_size += 2; e.setOidIndex(read2bytesInt(is)); read_size += 2; int unix_seconds = read4bytesInt(is); e.setTime_unix_seconds((long)unix_seconds); int unix_useconds= read4bytesInt(is); e.setTime_unix_useconds((long)unix_useconds); e.setTime(unix_seconds * 1000 + unix_useconds / 1000); read_size += 8; definition.add(e); } } public String toString() { StringBuffer sb = new StringBuffer("# IntervalDefBlock"); synchronized(definition){ int cnt = definition.size(); for(int i = 0; i < cnt; i++){ IntervalDefElement e = (IntervalDefElement) definition.get(i); sb.append('\n'); sb.append(e.toString(i)); } } return sb.toString(); } } gfarm-2.4.1/snmptool/gmonitor3/gmonitor/logdata/FirstMetaBlock.java0000644000000000000000000000443611507222726024104 0ustar rootrootpackage gmonitor.logdata; import java.io.IOException; import java.io.InputStream; /* * Created on 2003/05/14 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments */ /** * @author hkondo * * To change the template for this generated type comment go to * Window>Preferences>Java>Code Generation>Code and Comments */ public class FirstMetaBlock extends BinaryBlock{ int version; int szGroup; long beginDate; long beginDate_unix_seconds; long beginDate_unix_useconds; long groupInterval; long groupInterval_unix_seconds; long groupInterval_unix_useconds; public int getDataBlockGroupSize() { return szGroup; } public String asDump() { StringBuffer b = new StringBuffer(); b.append("# First Meta Block\n"); b.append("VersionOfFormat::"); b.append(version); b.append('\n'); b.append("SizeOfDataBlockGroup::"); b.append(szGroup); b.append('\n'); b.append("StartedDateTimeInUNIXSeconds::"); b.append(beginDate_unix_seconds); b.append('\n'); b.append("StartedDateTimeInUNIXuSeconds::"); b.append(beginDate_unix_useconds); b.append('\n'); b.append("DataBlockGroupIntervalInUNIXSeconds::"); b.append(groupInterval_unix_seconds); b.append('\n'); b.append("DataBlockGroupIntervalInUNIXuSeconds::"); b.append(groupInterval_unix_useconds); return b.toString(); } protected void parse_binary_block(InputStream is) throws IOException { version = read2bytesInt(is); szGroup = read4bytesInt(is); beginDate_unix_seconds = read4bytesInt(is); beginDate_unix_useconds= read4bytesInt(is); beginDate = beginDate_unix_seconds * 1000; beginDate+= beginDate_unix_useconds / 1000; groupInterval_unix_seconds = read4bytesInt(is); groupInterval_unix_useconds= read4bytesInt(is); groupInterval = groupInterval_unix_seconds * 1000; groupInterval+= groupInterval_unix_useconds / 1000; valid = true; } public static FirstMetaBlock newInstance(InputStream is, int sz) throws IOException { FirstMetaBlock bb = new FirstMetaBlock(); bb.deserialize(is, sz); return bb; } public int getVersion() { return version; } public int getSizeOfGroup() { return szGroup; } public long getBeginDate() { return beginDate; } public long getGroupInterval() { return groupInterval; } } gfarm-2.4.1/snmptool/gmonitor3/gmonitor/logdata/SeekableFile.java0000644000000000000000000000144611507222726023544 0ustar rootroot/* * Created on 2003/06/20 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments */ package gmonitor.logdata; import java.io.IOException; /** * @author hkondo * * To change the template for this generated type comment go to * Window>Preferences>Java>Code Generation>Code and Comments */ public interface SeekableFile { public void close() throws IOException; /** * @return * @throws java.io.IOException */ public long size() throws IOException; /** * @param buf “Ç‚Ýo‚µƒoƒbƒtƒ@ * @param idx ƒoƒbƒtƒ@’†‚ÌŠJŽnˆÊ’u * @param amount “Ç‚Ýo‚µ—Ê * @return * @throws java.io.IOException */ public int read(byte[] buf, int idx, int amount) throws IOException; public void seek(long pos) throws IOException; } gfarm-2.4.1/snmptool/gmonitor3/gmonitor/logdata/OIDDefBlock.java0000644000000000000000000000526611507222726023242 0ustar rootrootpackage gmonitor.logdata; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; /* * Created on 2003/05/14 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments */ /** * @author hkondo * * To change the template for this generated type comment go to * Window>Preferences>Java>Code Generation>Code and Comments */ public class OIDDefBlock extends BinaryBlock { protected ArrayList definition = new ArrayList(); public static OIDDefBlock newInstance(InputStream is, int sz) throws IOException { OIDDefBlock bb = new OIDDefBlock(); bb.deserialize(is, sz); return bb; } public int getCount(){ return definition.size(); } /* (non-Javadoc) * @see BinaryBlock#parse_binary_block(java.io.InputStream) * {OID(ASN.1‚ł͂Ȃ­•¶Žš—ñ)}{NULL}{—ªÌ}{NULL} */ protected void parse_binary_block(InputStream is) throws IOException { byte[] buf = new byte[STRLEN]; int read_size = 0; while(read_size < size){ OIDDefElement e = new OIDDefElement(); int cnt = readBytesWithNull(is, buf); e.setOID(UTY.byte2String(buf, 0, cnt)); read_size += (cnt + 1); // '+1' means NULL. cnt = readBytesWithNull(is, buf); e.setNickname(UTY.byte2String(buf, 0, cnt)); read_size += (cnt + 1); // '+1' means NULL. definition.add(e); } } public String toString() { StringBuffer sb = new StringBuffer("# OIDDefBlock"); synchronized(definition){ int cnt = definition.size(); for(int i = 0; i < cnt; i++){ OIDDefElement e = (OIDDefElement) definition.get(i); sb.append('\n'); sb.append(e.toString(i)); } } return sb.toString(); } public int getOIDIndex(String nick) { int idx = -1; synchronized(definition){ for(int i = 0; i < definition.size(); i++){ OIDDefElement e = (OIDDefElement) definition.get(i); String n = e.getNameAndNick(); if(n.equals(nick) == true){ idx = i; break; } } } return idx; } public int getOIDIndexNext(String nick, int next) { int idx = -1; if(nick == null){ return idx; } synchronized(definition){ for(int i = 0; i < definition.size(); i++){ OIDDefElement e = (OIDDefElement) definition.get(i); String n = e.getNameAndNick(); if(n.equals(nick) == true){ if(next <= 1){ idx = i; break; } else { next--; } } } } return idx; } public OIDDefElement getOIDDefElement(int idx) { OIDDefElement e = null; synchronized(definition){ e = (OIDDefElement) definition.get(idx); } return e; } public boolean containsEvent(String event) { int idx = getOIDIndex(event); if(idx < 0){ return false; }else{ return true; } } } gfarm-2.4.1/snmptool/gmonitor3/gmonitor/logdata/CachedSeekableFile.java0000644000000000000000000000730711507222726024636 0ustar rootroot/* * Created on 2003/06/20 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments */ package gmonitor.logdata; import java.io.IOException; import java.util.ArrayList; /** * @author hkondo * * To change the template for this generated type comment go to * Window>Preferences>Java>Code Generation>Code and Comments */ public class CachedSeekableFile implements SeekableFile { SeekableFile file; int CACHE_CAPACITY = 100; ArrayList cache = new ArrayList(); class CacheBlock { public static final int BLKSZ = 8192; int blkpos = 0; int size = 0; byte[] data = new byte[BLKSZ]; public CacheBlock(int bpos, byte[] buf, int sz) { if (sz > BLKSZ) { throw new ArrayStoreException("Too large data to store into cache block."); } blkpos = bpos; size = sz; System.arraycopy(data, 0, buf, 0, size); } public int getBlockPos() { return blkpos; } public int getBlock(byte[] buf, int idx) { if (buf.length < size) { throw new ArrayIndexOutOfBoundsException("Too small Buffer to store cached data."); } // System.arraycopy(buf, idx, data, 0, size); System.arraycopy(data, 0, buf, idx, size); return size; } } public CachedSeekableFile(SeekableFile f) { file = f; cache.ensureCapacity(CACHE_CAPACITY); } /* (non-Javadoc) * @see gmonitor.logdata.SeekableFile#close() */ public void close() throws IOException { file.close(); for (int i = 0; i < cache.size(); i++) { CacheBlock b = (CacheBlock) cache.get(i); b.data = null; } cache.clear(); } /* (non-Javadoc) * @see gmonitor.logdata.SeekableFile#length() */ public long size() throws IOException { return file.size(); } /* (non-Javadoc) * @see gmonitor.logdata.SeekableFile#read(byte[], int, int) */ public int read(byte[] buf, int idx, int amount) throws IOException { byte[] internal_buf = new byte[CacheBlock.BLKSZ]; int transferred_amount = 0; synchronized (cache) { int blk = (idx / CacheBlock.BLKSZ); // ŠJŽnƒuƒƒbƒN”Ô†‚ðƒZƒbƒg‚µ‚Ä‚¨‚­ // ƒLƒƒƒbƒVƒ…‚̋ɂæ‚Á‚Ä‚ÍA‚܂Ƃ߂Ăǂ©‚Á‚Ɠǂݞ‚ñ‚Å‚©‚çƒLƒƒƒbƒVƒ…‚ÉU‚èŒü‚¯‚½‚Ù‚¤‚ªŒø—¦‚æ‚¢‚©‚à‚µ‚ê‚È‚¢B do { int i = findCachedBlock(blk); if (i < 0) { // ƒtƒ@ƒCƒ‹‚©‚ç“Ç‚Ýo‚µ‚ăLƒƒƒbƒVƒ…‚ƃoƒbƒtƒ@‚É[“U‚·‚é int to_read = amount - transferred_amount; if (to_read > CacheBlock.BLKSZ) { to_read = CacheBlock.BLKSZ; } int realsz = file.read(internal_buf, 0, to_read); CacheBlock cb = new CacheBlock(blk, internal_buf, realsz); cb.getBlock(buf, transferred_amount); // ƒLƒƒƒbƒVƒ…‚ª‚ ‚Ó‚ê‚»‚¤‚ɂȂÁ‚½‚ç‚Ó‚é‚¢‚à‚Ì‚ð휂·‚é cache.add(cb); if (cache.size() > CACHE_CAPACITY) { // ƒŠƒXƒg‚Ìæ“ª‚Ì‚à‚̂قnj¢‚Ì‚ÅAˆê”Ôæ“ª‚Ì‚à‚Ì‚ðíœ CacheBlock c = (CacheBlock) cache.remove(0); c.data = null; // –¾Ž¦“I‚ÉŽQÆ‚ðØ‚Á‚Ä‚¨‚­ } transferred_amount += realsz; } else { // ƒLƒƒƒbƒVƒ…‚©‚çƒoƒbƒtƒ@‚É[“U‚·‚é CacheBlock cb = (CacheBlock) cache.remove(i); transferred_amount += cb.getBlock(buf, transferred_amount); cache.add(cb); } blk++; } while (transferred_amount < amount); if (transferred_amount != amount) { // ASSERT FAILED. throw new AssertionError( "Caching system is broken. Request is " + amount + " but Response is " + transferred_amount); } } return transferred_amount; } private int findCachedBlock(int blkpos) { for (int i = 0; i < cache.size(); i++) { CacheBlock cb = (CacheBlock) cache.get(i); if (cb.getBlockPos() == blkpos) { return i; } } return -1; } /* (non-Javadoc) * @see gmonitor.logdata.SeekableFile#seek(long) */ public void seek(long pos) throws IOException { file.seek(pos); } } gfarm-2.4.1/snmptool/gmonitor3/gmonitor/logdata/BinaryBlock.java0000644000000000000000000000613511507222726023430 0ustar rootrootpackage gmonitor.logdata; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; /* * Created on 2003/05/14 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments */ /** * @author hkondo * * To change the template for this generated type comment go to * Window>Preferences>Java>Code Generation>Code and Comments */ public abstract class BinaryBlock { protected static int STRLEN = 1024 * 64; boolean valid = false; int size = 0; byte[] rawbytes; protected byte[] readBytesWithNull(InputStream is) throws IOException { byte[] buf = new byte[STRLEN]; int cnt = readBytesWithNull(is, buf); byte[] ret = new byte[cnt]; // System.arraycopy(ret, 0, buf, 0, cnt); System.arraycopy(buf, 0, ret, 0, cnt); return ret; } protected int readBytesWithNull(InputStream is, byte[] buf) throws IOException { int pos = 0; if(buf == null || buf.length == 0){ throw new NullPointerException("No space is allocated in buffer."); } int max = buf.length; int b = 0; do{ b = is.read(); if(b < 0){ // End of Stream. pos++; break; } buf[pos] = (byte)b; pos++; }while(pos < max && b != 0); return pos - 1; // pos->count conversion and NULL termination. } private int readInt(InputStream is, int sz) throws IOException { byte[] b = new byte[sz]; int ct = is.read(b); if(ct != sz){ throw new IOException("Invalid binary format, readInt."); } return UTY.byte2int(b); } protected int read2bytesInt(InputStream is) throws IOException { return readInt(is, 2); } protected int read4bytesInt(InputStream is) throws IOException { return readInt(is, 4); } protected long read8bytesLong(InputStream is) throws IOException { int sz = 8; byte[] b = new byte[sz]; int ct = is.read(b); if(ct != sz){ throw new IOException("Invalid binary format, read8bytes as long."); } return UTY.byte2long(b); } protected abstract void parse_binary_block(InputStream is) throws IOException; protected void deserialize(InputStream is, int sz, boolean remainRawBytes) throws IOException { size = sz; rawbytes = new byte[sz]; byte[] r = rawbytes; if(remainRawBytes == false){ rawbytes = null; r = new byte[sz]; } is.read(r); ByteArrayInputStream bis = new ByteArrayInputStream(r); parse_binary_block(bis); valid = true; } protected void deserialize(InputStream is, int sz) throws IOException { deserialize(is, sz, /* TO DEBUG */ true); // ƒƒ‚ƒŠ‚ðß–ñ‚·‚邽‚ß‚É‚Í false ‚É‚·‚邱‚Æ } // protected void deserialize(InputStream is, int sz) throws IOException // { // size = sz; // rawbytes = new byte[sz]; // is.read(rawbytes); // ByteArrayInputStream bis = new ByteArrayInputStream(rawbytes); // parse_binary_block(bis); // valid = true; // } public int getSize() { return size; } public boolean isValid() { return valid; } public byte[] getRawBytes() { if(rawbytes == null){ return null; } byte[] buf = new byte[size]; // System.arraycopy(buf, 0, rawbytes, 0, size); System.arraycopy(rawbytes, 0, buf, 0, size); return buf; } } gfarm-2.4.1/snmptool/gmonitor3/gmonitor/logdata/DataBlockGroup.java0000644000000000000000000000275111507222726024072 0ustar rootroot/* * Created on 2003/07/09 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments */ package gmonitor.logdata; import java.util.ArrayList; import java.util.Date; /** * @author hkondo * * To change the template for this generated type comment go to * Window>Preferences>Java>Code Generation>Code and Comments */ public class DataBlockGroup extends ArrayList { // ‚±‚±‚Å–ß‚³‚ê‚é ArrayList ‚ÍA•K‚¸ java.util.Date ‚Æ DataElement ‚ª‘g‚ɂȂÁ‚Ä‚¢‚éB public ArrayList pickData(DataBlockGroupTable tbl, int hidx, int oidx) { // hidx ‚Æ oidx ‚Ƀ}ƒbƒ`‚·‚éƒf[ƒ^‚ðŒŸõ‚µ‚ÄŽæ‚èo‚·B ArrayList ret = new ArrayList(); ArrayList rows = tbl.getDataBlockGroupElements(); synchronized(this){ for(int i = 0; i < rows.size(); i++){ DataBlockGroupElement[] row = (DataBlockGroupElement[]) rows.get(i); for(int j = 0; j < row.length; j++){ if(row[j].isPairOfHIDandOID(hidx, oidx) == true){ // ‚±‚Ì row ‚ɃyƒA‚ð”­Œ©‚µ‚½ DataBlock db = (DataBlock) this.get(i); long t = db.getTime(); Date dt = new Date(t); ArrayList delist = db.getData(); DataElement de = (DataElement) delist.get(j); ret.add(dt); ret.add(de); // row@‚ɂ͕K‚¸‚ЂƂ‚̃f[ƒ^‚µ‚©‚È‚¢B“ñ‚ˆÈã‘¶Ý‚µ‚Ä‚àAŽž‚ª“¯ˆê‚Å‚ ‚é // ˆÈãA“¯‚¶Œv‘ª’l‚łȂ¯‚ê‚΂¨‚©‚µ‚¢B‚»‚à‚»‚àA“¯‚¶Žž‚É‘¶Ý‚·‚éˆÙ‚È‚éŒv // ‘ª’l‚𳂵‚­ƒOƒ‰ƒt‚É•`‰æ‚·‚邱‚Ƃ͂ł«‚È‚¢B break; } } } } return ret; } } gfarm-2.4.1/snmptool/gmonitor3/gmonitor/logdata/LocalSeekableFile.java0000644000000000000000000000304711507222726024516 0ustar rootroot/* * Created on 2003/06/20 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments */ package gmonitor.logdata; import java.io.File; import java.io.IOException; import java.io.RandomAccessFile; /** * @author hkondo * * To change the template for this generated type comment go to * Window>Preferences>Java>Code Generation>Code and Comments */ public class LocalSeekableFile implements SeekableFile { private RandomAccessFile file; private File originalFile; public LocalSeekableFile(File f) throws IOException{ originalFile = f; file = new RandomAccessFile(f, "r"); } /** * @throws java.io.IOException */ public void close() throws IOException { file.close(); } /* (non-Javadoc) * @see java.lang.Object#equals(java.lang.Object) */ public boolean equals(Object arg0) { return file.equals(arg0); } /** * @return * @throws java.io.IOException */ public long size() throws IOException { //System.out.println("DataFile.size(): " + originalFile.length()); return originalFile.length(); } /** * @param buf * @param idx * @param amount * @return * @throws java.io.IOException */ public int read(byte[] buf, int idx, int amount) throws IOException { return file.read(buf, idx, amount); } /** * @param pos V‚½‚È“ü—͈ʒu * @throws java.io.IOException */ public void seek(long pos) throws IOException { file.seek(pos); } /* (non-Javadoc) * @see java.lang.Object#toString() */ public String toString() { return file.toString(); } } gfarm-2.4.1/snmptool/gmonitor3/gmonitor/logdata/DataFile.java0000644000000000000000000001764611507222726022713 0ustar rootrootpackage gmonitor.logdata; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; import java.util.HashMap; /* * Created on 2003/05/14 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments */ /** * @author hkondo * * To change the template for this generated type comment go to * Window>Preferences>Java>Code Generation>Code and Comments */ public class DataFile implements Comparable { private String url; private SeekableFile file; private FirstMetaBlock fmb; private SecondMetaBlock smb; private long latestDateTime = -1; private long size; private int dbgroup_length; // ƒtƒ@ƒCƒ‹’†‚Ɋ܂܂ê‚éƒf[ƒ^ƒuƒƒbƒNƒOƒ‹[ƒv‚̌” long datablock_pos; private static final int CAPACITY = 100; private static HashMap instanceMap = new HashMap(); private static ArrayList instanceGeneration = new ArrayList(); public static DataFile getInstance(String url) throws IOException { DataFile f = null; synchronized(instanceMap){ Object o = instanceMap.get(url); if(o == null){ // first accessing to url f = new DataFile(url); instanceMap.put(url, f); instanceGeneration.add(url); if(instanceGeneration.size() > CAPACITY){ // “¯Žž‚ɃI[ƒvƒ“‚µ‚Ä‚¨‚­ƒtƒ@ƒCƒ‹”‚𒴉߂µ‚½‚̂ŃNƒ[ƒY‚·‚é String u = (String) instanceGeneration.remove(0); DataFile df = (DataFile) instanceMap.remove(u); df.close(); } }else{ f = (DataFile) o; int idx = instanceGeneration.indexOf(url); // ƒAƒNƒZƒX‚³‚ꂽ‚̂Ţ‘ã‚ðƒŠƒtƒŒƒbƒVƒ… instanceGeneration.remove(idx); instanceGeneration.add(url); DataFile df = (DataFile) instanceMap.remove(url); df.close(); f = new DataFile(url); instanceMap.put(url, f); } } return f; } /** * */ public void close() throws IOException { file.close(); } public void reload() throws IOException { //System.out.println("Reloaded file attr: " + getUrl()); initialize(); } protected void initialize() throws IOException { file.seek(0); byte[] sz = new byte[2]; file.read(sz, 0, 2); int size = UTY.byte2int(sz); byte[] fmbBytes = new byte[size]; file.read(fmbBytes, 0, size); InputStream is = new ByteArrayInputStream(fmbBytes, 0, size); fmb = (FirstMetaBlock)FirstMetaBlock.newInstance(is, size); is.close(); byte[]dsz = new byte[4]; file.read(dsz, 0, 4); size = UTY.byte2int(dsz); byte[] smbBytes = new byte[size]; file.read(smbBytes, 0, size); is = new ByteArrayInputStream(smbBytes, 0, size); smb = (SecondMetaBlock)SecondMetaBlock.newInstance(is, size); is.close(); this.size = file.size(); // ƒtƒ@ƒCƒ‹ƒTƒCƒY‚©‚çAŠÜ‚Ü‚ê‚é‚Å‚ ‚낤ƒf[ƒ^ƒuƒƒbƒNƒOƒ‹[ƒv‚̌”‚ðŽZo‚µAdbgroup_length‚ÉŠo‚¦‚éB DataBlockGroupTable t = smb.getDataBlockGroupTable(); ArrayList l = t.getDataBlockGroupElements(); datablock_pos = fmb.getSize() + smb.getSize() + 2 + 4; // 2 + 4 means size fields. dbgroup_length = (int) ((this.size - datablock_pos) / fmb.getDataBlockGroupSize()); latestDateTime = -1L; file.seek(datablock_pos); } protected DataFile(String url) throws IOException{ this.url = url; SeekableFile f = SeekableFileFactory.create(url); // file = new CachedSeekableFile(f); // TODO: CachedSeekableFile file = f; initialize(); } /** * ƒtƒ@ƒCƒ‹‚Ɋ܂܂ê‚Ä‚¢‚銮‘S‚ȃf[ƒ^ƒuƒƒbƒNƒOƒ‹[ƒv‚̌”‚ð•Ô‚· * @return */ public long getLength() { return dbgroup_length; } /** * @return */ public FirstMetaBlock getFirstMetaBlock() { return fmb; } /** * @return */ public SecondMetaBlock getSecondMetaBlock() { return smb; } public DataBlockGroup getDataBlockGroup(long idx) throws IOException { int i = 0; DataBlockGroup dbg = new DataBlockGroup(); int szGroup = fmb.getDataBlockGroupSize(); byte[] buf = new byte[szGroup]; // 1.“Ç‚Ýo‚·‚ׂ«ˆÊ’u‚܂Šseek ‚·‚é long pos = datablock_pos + (idx * szGroup); file.seek(pos); // 2.read ‚·‚é int ret = file.read(buf, 0, szGroup); if(ret < 0){ // ƒtƒ@ƒCƒ‹‚ÌI’[‚ð‰z‚¦‚½B throw new IOException("File pointer exceeded."); } // 3.parse ‚·‚é DataBlockGroupTable dbgt = smb.getDataBlockGroupTable(); ArrayList rows = dbgt.getDataBlockGroupElements(); for(int r = 0; r < rows.size(); r++){ DataBlockGroupElement[] row = (DataBlockGroupElement[]) rows.get(r); if(row.length > 0){ int dbsz = (4 + 4) + 5 * row.length; DataBlock db = new DataBlock(buf, i, row.length); dbg.add(db); i += dbsz; }else{ DataBlock db = new DataBlock(); dbg.add(db); } } return dbg; } /** * ‚±‚̃f[ƒ^ƒtƒ@ƒCƒ‹‚É‚¨‚¯‚é‚à‚Á‚Æ‚àŒÃ‚¢Œv‘ª’l‚ÌŽž‚ðŽæ“¾‚·‚é * @return Žž */ public long getBeginDateTime() { return fmb.getBeginDate(); } /** * ‚±‚̃f[ƒ^ƒtƒ@ƒCƒ‹’†‚Ì‚à‚Á‚Æ‚àV‚µ‚¢Œv‘ª’l‚ÌŽž‚ðŽæ“¾‚·‚é * @return Žž */ public long getLatestDateTime() throws IOException { if(latestDateTime > 0){ // Already computed. return latestDateTime; } long latest = fmb.getBeginDate(); // 1.get the latest datablock group. ArrayList dbg = getDataBlockGroup(dbgroup_length - 1); // 2.scan datablock group to determine the latest time point. for(int i = 0; i < dbg.size(); i++){ DataBlock db = (DataBlock) dbg.get(i); if(db.isValid() == true){ long t = db.getTime(); if(t > latest){ latest = t; } }else{ // db is invalid, skip it. } } // 3.cache latest time and return. latestDateTime = latest; return latest; } /** * ‚±‚̃f[ƒ^ƒtƒ@ƒCƒ‹’†‚ÉAŽw’肳‚ꂽƒzƒXƒg‚ªŠÜ‚Ü‚ê‚Ä‚¢‚é‚©‚Ç‚¤‚©‚ðƒeƒXƒg‚·‚é * @param host ŒŸ¸‚·‚éƒzƒXƒg–¼ * @return ŠÜ‚Ü‚ê‚Ä‚¢‚ê‚Î true. */ public boolean containsHost(String host) { return smb.containsHost(host); } /** * ‚±‚̃f[ƒ^ƒtƒ@ƒCƒ‹’†‚ÉAŽw’肳‚ꂽƒCƒxƒ“ƒg‚ªŠÜ‚Ü‚ê‚Ä‚¢‚é‚©‚Ç‚¤‚©‚ðƒeƒXƒg‚·‚é * @param event ŒŸ¸‚·‚éƒCƒxƒ“ƒg–¼ * @return ŠÜ‚Ü‚ê‚Ä‚¢‚ê‚Î true. */ public boolean containsEvent(String event) { return smb.containsEvent(event); } /** * ‚±‚̃f[ƒ^ƒtƒ@ƒCƒ‹’†‚ÉAŽw’肳‚ê‚½Žž‚ªŠÜ‚Ü‚ê‚Ä‚¢‚é‚©‚Ç‚¤‚©‚ðƒeƒXƒg‚·‚é * ‚½‚¾‚µAu‚Ü‚³‚É‚¿‚傤‚Ç‚»‚ÌŽžv‚ªŠÜ‚Ü‚ê‚é‚©‚Ç‚¤‚©‚Í–â‘è‚É‚µ‚È‚¢B * @param t ŒŸ¸‚·‚鎞 * @return ŠÜ‚Ü‚ê‚Ä‚¢‚ê‚Î true. */ public boolean containsDateTime(long t) throws IOException { boolean ret = false; long b = getBeginDateTime(); long e = getLatestDateTime(); if(b <= t && t <=e){ ret = true; } return ret; } /** * ‚Æ‚ ‚鎞‚ª‚ǂ̃f[ƒ^ƒuƒƒbƒNƒOƒ‹[ƒv‚Ɋ܂܂ê‚Ä‚¢‚é‚©‚ðŒvŽZ‚·‚é * @param t ƒeƒXƒg‚µ‚½‚¢Žž * @return ƒf[ƒ^ƒuƒƒbƒNƒOƒ‹[ƒv‚̃Cƒ“ƒfƒNƒX */ public long getDataBlockGroupIndex(long t) throws IOException { long idx = -1; if(containsDateTime(t) == false){ // ‚±‚̃tƒ@ƒCƒ‹‚͈̔͊O‚ÌŽž‚ªŽw’肳‚ê‚Ä‚¢‚é‚̂ŃGƒ‰[ throw new IOException("TimePointOutOfRangeInFile " + getUrl() + " " + t); } long intv = fmb.getGroupInterval(); long begin = getBeginDateTime(); idx = (long) (t - begin) / (long) intv; return idx; } /* (non-Javadoc) * @see java.lang.Comparable#compareTo(java.lang.Object) */ public int compareTo(Object o) { if((o instanceof DataFile) == false){ // ƒNƒ‰ƒX‚ªˆá‚¤‚̂ŔäŠr‚Å‚«‚È‚¢B throw new ClassCastException("Object is not compatible."); } DataFile f = (DataFile) o; long t1 = getBeginDateTime(); long t2 = f.getBeginDateTime(); return (int) (t1 - t2); } /** * @return */ public String getUrl() { return url; } public DataBlock readDataBlock(long idx) throws IOException { // ’Ê‚µ”Ô†‚Å idx ‚̃f[ƒ^ƒuƒƒbƒN‚ðŽæ“¾‚·‚éBidx ‚Í 0@‚©‚çŽn‚Ü‚éB DataBlockGroupTable tbl = smb.getDataBlockGroupTable(); long blockCount = tbl.getDataBlockGroupElements().size(); long dbg_idx = idx / blockCount; DataBlockGroup dbg = null; try { dbg = getDataBlockGroup(dbg_idx); } catch (IOException e) { // ŠY“–‚·‚éƒf[ƒ^ƒuƒƒbƒNƒOƒ‹[ƒv‚Í‘¶Ý‚µ‚È‚¢B return null; } int db_idx = (int) (idx % blockCount); if(db_idx >= dbg.size()){ // ŠY“–‚·‚éƒf[ƒ^ƒuƒƒbƒN‚Í‘¶Ý‚µ‚È‚¢B return null; } DataBlock db = (DataBlock) dbg.get(db_idx); return db; } } gfarm-2.4.1/snmptool/gmonitor3/gmonitor/app/0000755000000000000000000000000011507222730017521 5ustar rootrootgfarm-2.4.1/snmptool/gmonitor3/gmonitor/app/SimpleGrapherApp.java0000644000000000000000000014521511507222726023604 0ustar rootroot/* * Created on 2003/07/14 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments */ package gmonitor.app; import gmonitor.gui.DataTimeSpace; import gmonitor.gui.GraphMonitor; import gmonitor.gui.GraphMonitorModel; import gmonitor.gui.RawData; import gmonitor.gui.RawDataElement; import java.awt.BorderLayout; import java.awt.Container; import java.awt.Dimension; import java.awt.DisplayMode; import java.awt.GraphicsEnvironment; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.io.File; import java.io.FileFilter; import java.io.IOException; import java.text.DateFormat; import java.text.DecimalFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; import javax.swing.BorderFactory; import javax.swing.DefaultComboBoxModel; import javax.swing.JButton; import javax.swing.JCheckBox; import javax.swing.JComboBox; import javax.swing.JDialog; import javax.swing.JFileChooser; import javax.swing.JFrame; import javax.swing.JList; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JRadioButtonMenuItem; import javax.swing.JScrollPane; import javax.swing.Timer; import javax.swing.text.Document; /** * @author hkondo * * To change the template for this generated type comment go to * Window>Preferences>Java>Code Generation>Code and Comments */ public class SimpleGrapherApp extends SimpleGrapherBaseUI { String currentDirectoryPath = null; String setTargetHostName = null; String setTargetEventName = null; String setTargetUnitName = null; int initialDelay = 0; String[] selectedHostsForTotal = null; DataTimeSpace dtSpace = null; ArrayList rawDataSeries = new ArrayList(); GraphMonitorModel model = new GraphMonitorModel(); private int autoUpdateInterval = 10; // second Timer timer = new Timer(autoUpdateInterval * 1000, new TimerAutoUpdateAction()); private boolean timerInitFlag; private int resampleResolution = 100; // second File selectedDir = null; // for use of Auto updating. JFrame appFrame = new JFrame(); SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss"); String propDataPathPrefix = null; ArrayList propDataFileList = new ArrayList(); // String[] ArrayList propHostList = new ArrayList(); // String[] String propEvent = null; boolean propTotalMode = false; boolean propDiffMode = false; // direct. boolean propAutoUpdate = false; boolean propLineStyle = true; boolean propBarStyle = true; boolean propPlotStyle = true; double propMultiplier = 1.0; boolean propControllerVisibility = true; boolean propStylePanelVisibility = true; boolean propUnitPanelVisibility = true; boolean propMenuBarVisibility = true; boolean propInformationPanelVisibility = true; private double savedInfoWidth = 0; private double savedInfoHeight = 0; private Dimension savedDimension = null; private Dimension savedDimension2 = null; private long magnificationY = 1; // Y scale private boolean disableComboEvent = false; // do not refresh private boolean setComboTargetsFlag = false; // do not refresh in setComboTargets() /* private static final String[] UNIT_PREFIX_TABLE = new String[]{ "", //10^0 "K",// 10^3 "M",// 10^6 "G",// 10^9 "T",// 10^12 "P",// 10^15 "E",// 10^18 "Z",// 10^21 "Y",// 10^24 }; */ private static final String[] UNIT_PREFIX_TABLE = new String[]{ "", "x 10^3", "x 10^6", "x 10^9", "x 10^12", "x 10^15", "x 10^18", "x 10^21", "x 10^24" }; private void initializeFromProperty(String pref) { ArrayList propDataFileList = extractCSV(System.getProperty(pref + "DataFileList")); ArrayList propHostList = extractCSV(System.getProperty(pref + "HostList")); propTotalMode = getBooleanWithDefault(pref + "TotalMode", propTotalMode); propDiffMode = getBooleanWithDefault(pref + "DiffMode", propDiffMode); propAutoUpdate= getBooleanWithDefault(pref + "AutoUpdate",propAutoUpdate); propLineStyle = getBooleanWithDefault(pref + "LineStyle", propLineStyle); propBarStyle = getBooleanWithDefault(pref + "BarStyle", propBarStyle); propPlotStyle = getBooleanWithDefault(pref + "PlotStyle", propPlotStyle); propMultiplier =getDoubleWithDefault(pref + "Multiplier",propMultiplier); propControllerVisibility = getBooleanWithDefault(pref + "ControllerVisibility", propControllerVisibility); propStylePanelVisibility = getBooleanWithDefault(pref + "StylePanelVisibility", propStylePanelVisibility); propMenuBarVisibility = getBooleanWithDefault(pref + "MenuBarVisibility", propMenuBarVisibility); } private void initializeEventHandlers() { MenuItemFileOpenAction a = new MenuItemFileOpenAction(); menuItemFileOpen.addActionListener(a); buttonFileOpen.addActionListener(a); menuItemFileAutoUpdate.addActionListener(new FileAutoUpdateAction()); menuItemFileExit.addActionListener(new MenuItemFileExitAction()); buttonUpdateNow.addActionListener(new RepaintAction()); comboEvent.addActionListener(new ComboEventSelectionAction()); comboHostname.addActionListener(new ComboHostnameSelectionAction()); checkGraphStyleBar.addActionListener(new CheckBoxBarAction()); checkGraphStyleLine.addActionListener(new CheckBoxLineAction()); checkGraphStylePlot.addActionListener(new CheckBoxPlotAction()); checkDifferentialMode.addActionListener(new CheckBoxDifferentialModeAction()); check8times.addActionListener(new CheckBox8timesAction()); check1000times.addActionListener(new CheckBox1000timesAction()); check100div.addActionListener(new CheckBox100divAction()); checkTotal.addActionListener(new CheckBoxTotalAction()); checkAutoUpdate.addActionListener(new CheckBoxAutoUpdateAction()); menuItemGraphStyleBar.addActionListener(new MenuItemGraphStyleBarAction()); menuItemGraphStyleLine.addActionListener(new MenuItemGraphStyleLineAction()); menuItemGraphStylePlot.addActionListener(new MenuItemGraphStylePlotAction()); menuItemDifferentialMode.addActionListener(new MenuItemDifferentialModeAction()); menuItem8times.addActionListener(new MenuItem8timesAction()); menuItem1000times.addActionListener(new MenuItem1000timesAction()); menuItem100div.addActionListener(new MenuItem100divAction()); menuItemTotal.addActionListener(new MenuItemTotalAction()); menuItemAutoUpdate.addActionListener(new MenuItemAutoUpdateAction()); menuItemCorrectByUptime.addActionListener(new CorrectByUptimeAction()); RadioAction ra = new RadioAction(); radioMenuNone.addActionListener(ra); radioMenubps.addActionListener(ra); radioMenuKB.addActionListener(ra); radioMenuLoad.addActionListener(ra); comboUnit.addActionListener(new ComboUnitSelectionAction()); menuItemAutoUpdateInterval.addActionListener(new AutoUpdateIntervalAction()); menuItemAutoUpdateInterval.setText(menuStrAutoUpdateInterval + " ("+String.valueOf(autoUpdateInterval)+")"); menuItemResolution.addActionListener(new ResampleResoAction()); menuItemResolution.setText(menuStrResolution + " ("+String.valueOf(resampleResolution)+")"); menuItemRepaint.addActionListener(new RepaintAction()); RepaintNow rn = new RepaintNow(); menuItemRaw.addActionListener(rn); ResampleAction resampleAct = new ResampleAction(); menuItemBefore.addActionListener(resampleAct); menuItemInterpolate.addActionListener(resampleAct); // visible menuItemVisInfo.addActionListener(new VisibleInfoAction()); menuItemVisInfo.setSelected(true); menuItemVisGraphStyle.addActionListener(new VisibleStyleAction()); menuItemVisGraphStyle.setSelected(true); menuItemVisUnit.addActionListener(new VisibleUnitAction()); menuItemVisUnit.setSelected(true); menuItemVisController.addActionListener(new VisibleControllerAction()); menuItemVisController.setSelected(true); graphPane.addMouseListener(new GraphMouseAction()); } private void initializeGUIComponents() { appFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); textBeginTime.setText(dateFormat.format(new Date())); textRange.setText("3600"); checkAutoUpdate.setSelected(propAutoUpdate); checkTotal.setSelected(propTotalMode); checkGraphStyleBar.setSelected(propBarStyle); menuItemGraphStyleBar.setSelected(propBarStyle); checkGraphStylePlot.setSelected(propPlotStyle); menuItemGraphStylePlot.setSelected(propPlotStyle); checkGraphStyleLine.setSelected(propLineStyle); menuItemGraphStyleLine.setSelected(propLineStyle); } private String selectedUptimeEventForCorrection; private JComboBox comboUptimeSelection = null; private void actionCorrect(boolean b){ selectedUptimeEventForCorrection = null; if(b){ if(dtSpace == null){ menuItemCorrectByUptime.setSelected(false); return; } JDialog dialog = new JDialog(appFrame, "select an event of uptime", true); JPanel panel = new JPanel(); panel.setLayout(new BorderLayout()); comboUptimeSelection = new JComboBox(); comboUptimeSelection.setRenderer(new HostOidCellRenderer()); //defineNewComboBox(comboUptimeSelection, dtSpace.getEvents()); DefaultComboBoxModel emodel = (DefaultComboBoxModel) comboEvent.getModel(); DefaultComboBoxModel cmodel = (DefaultComboBoxModel) comboUptimeSelection.getModel(); int count = emodel.getSize(); for(int i=0; i < count; i++){ cmodel.addElement(emodel.getElementAt(i)); } //comboUptimeSelection.setModel(cmodel); for(int i=0; i < comboUptimeSelection.getItemCount(); i++){ Object sel = comboUptimeSelection.getItemAt(i); if(((String)sel).startsWith("uptime")){ comboUptimeSelection.setSelectedItem(sel); break; } } JButton ok = new JButton("OK"); ok.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { selectedUptimeEventForCorrection = (String) comboUptimeSelection.getSelectedItem(); ((JButton) e.getSource()).getTopLevelAncestor().setVisible(false); paintGraphAccordingToCurrentGUIStatus(); //System.out.println("CorrectByUptime: " + selectedUptimeEventForCorrection); } }); JButton cancel = new JButton("Cancel"); cancel.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { ((JButton) e.getSource()).getTopLevelAncestor().setVisible(false); } }); panel.add(comboUptimeSelection, BorderLayout.NORTH); panel.add(ok, BorderLayout.CENTER); panel.add(cancel, BorderLayout.EAST); panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); dialog.setContentPane(panel); dialog.pack(); dialog.setLocationRelativeTo(appFrame); dialog.setVisible(true); if(selectedUptimeEventForCorrection == null){ menuItemCorrectByUptime.setSelected(false); } } else { paintGraphAccordingToCurrentGUIStatus(); } } class CorrectByUptimeAction implements ActionListener { public void actionPerformed(ActionEvent ac) { actionCorrect(menuItemCorrectByUptime.isSelected()); } } class GraphMouseAction implements MouseListener { private boolean rightFlag; int click; public void mouseClicked(MouseEvent e) { } public void mouseEntered(MouseEvent e) { } public void mouseExited(MouseEvent e) { } public void mousePressed(MouseEvent e) { click = e.getClickCount(); if (click >= 2){ //System.out.println("click = " + click); } rightFlag = false; // Linux event(e); } public void mouseReleased(MouseEvent e) { // Windows event(e); if(rightFlag == false && click >= 2){ //System.out.println("x2"); magnificationY *= 2; paintGraphAccordingToCurrentGUIStatus(); } } private void event(MouseEvent e){ if (e.isPopupTrigger() && rightFlag == false) { if (click == 1){ //System.out.println("/2"); magnificationY /= 2; if(magnificationY <= 0){ magnificationY = 1; } } else if (click == 2){ //System.out.println("Reset"); magnificationY = 1; // reset } paintGraphAccordingToCurrentGUIStatus(); rightFlag = true; } } } class ResampleAction implements ActionListener { public void actionPerformed(ActionEvent arg0) { dtSpace.initResampingMode(); paintGraphAccordingToCurrentGUIStatus(); } } class VisibleInfoAction implements ActionListener { public void actionPerformed(ActionEvent arg0) { panelInformation.setVisible(menuItemVisInfo.isSelected()); //paintGraphAccordingToCurrentGUIStatus(); } } class VisibleStyleAction implements ActionListener { public void actionPerformed(ActionEvent arg0) { panelGraphStyle.setVisible(menuItemVisGraphStyle.isSelected()); //paintGraphAccordingToCurrentGUIStatus(); } } class VisibleUnitAction implements ActionListener { public void actionPerformed(ActionEvent arg0) { panelUnit.setVisible(menuItemVisUnit.isSelected()); //paintGraphAccordingToCurrentGUIStatus(); } } class VisibleControllerAction implements ActionListener { public void actionPerformed(ActionEvent arg0) { panelController.setVisible(menuItemVisController.isSelected()); //paintGraphAccordingToCurrentGUIStatus(); } } class RadioAction implements ActionListener { public void actionPerformed(ActionEvent arg0) { //System.out.println("RadioAction"); if(((JRadioButtonMenuItem) arg0.getSource()).equals(radioMenubps)){ menuItem8times.setSelected(true); check8times.setSelected(true); menuItemDifferentialMode.setSelected(true); checkDifferentialMode.setSelected(true); } else { menuItem8times.setSelected(false); check8times.setSelected(false); menuItemDifferentialMode.setSelected(false); checkDifferentialMode.setSelected(false); } comboUnit.setSelectedItem((JRadioButtonMenuItem) arg0.getSource()); //paintGraphAccordingToCurrentGUIStatus(); } } class AutoUpdateIntervalAction implements ActionListener { public void actionPerformed(ActionEvent arg0) { if(checkAutoUpdate.isSelected()){ timer.stop(); } String interval = JOptionPane.showInputDialog( appFrame, "AutoUpdate Interval (second)", String.valueOf(autoUpdateInterval)); try { if(interval != null){ //System.out.println("AutoUpdateInterval " + interval); int tmp = Integer.parseInt(interval); if(tmp <= 0){ return; } autoUpdateInterval = tmp; menuItemAutoUpdateInterval.setText(menuStrAutoUpdateInterval + " ("+interval+")"); timer.setDelay(autoUpdateInterval * 1000); } } catch(Exception e){ } if(checkAutoUpdate.isSelected()){ timer.start(); } } } class ResampleResoAction implements ActionListener { public void actionPerformed(ActionEvent arg0) { String interval = JOptionPane.showInputDialog( appFrame, "Resampling Resolution (second)", String.valueOf(resampleResolution)); try { if(interval != null){ //System.out.println("ResampleResolution " + interval); int tmp = Integer.parseInt(interval); if(tmp <= 0){ return; } resampleResolution = tmp; menuItemResolution.setText(menuStrResolution + " ("+interval+")"); paintGraphAccordingToCurrentGUIStatus(); } } catch(Exception e){ } } } class ComboUnitSelectionAction implements ActionListener { public void actionPerformed(ActionEvent arg0) { ((JRadioButtonMenuItem)comboUnit.getSelectedItem()).setSelected(true); ((JRadioButtonMenuItem)comboUnit.getSelectedItem()).doClick(); if(setComboTargetsFlag == true){ return; } paintGraphAccordingToCurrentGUIStatus(); } } class CheckBoxBarAction implements ActionListener { public void actionPerformed(ActionEvent arg0) { menuItemGraphStyleBar.setSelected(checkGraphStyleBar.isSelected()); paintGraphAccordingToCurrentGUIStatus(); } } class CheckBoxLineAction implements ActionListener { public void actionPerformed(ActionEvent arg0) { menuItemGraphStyleLine.setSelected(checkGraphStyleLine.isSelected()); paintGraphAccordingToCurrentGUIStatus(); } } class CheckBoxPlotAction implements ActionListener { public void actionPerformed(ActionEvent arg0) { menuItemGraphStylePlot.setSelected(checkGraphStylePlot.isSelected()); paintGraphAccordingToCurrentGUIStatus(); } } class CheckBoxDifferentialModeAction implements ActionListener { public void actionPerformed(ActionEvent arg0) { menuItemDifferentialMode.setSelected(checkDifferentialMode.isSelected()); paintGraphAccordingToCurrentGUIStatus(); } } class CheckBox8timesAction implements ActionListener { public void actionPerformed(ActionEvent arg0) { menuItem8times.setSelected(check8times.isSelected()); paintGraphAccordingToCurrentGUIStatus(); } } class CheckBox1000timesAction implements ActionListener { public void actionPerformed(ActionEvent arg0) { menuItem1000times.setSelected(check1000times.isSelected()); paintGraphAccordingToCurrentGUIStatus(); } } class CheckBox100divAction implements ActionListener { public void actionPerformed(ActionEvent arg0) { menuItem100div.setSelected(check100div.isSelected()); paintGraphAccordingToCurrentGUIStatus(); } } private JDialog jd; private JList list; private boolean totalOkFlag; private void actionTotal(boolean b){ totalOkFlag = false; boolean timerFlag; if(timer.isRunning()){ timer.stop(); timerFlag = true; } else { timerFlag = false; } if(b == true){ jd = new JDialog(appFrame, "select hosts", true); JPanel jp = new JPanel(); jp.setLayout(new BorderLayout()); ArrayList hostList = new ArrayList(); DefaultComboBoxModel cmbmodel = (DefaultComboBoxModel) comboHostname.getModel(); int count = cmbmodel.getSize(); if(count <= 1){ checkTotal.setSelected(false); menuItemTotal.setSelected(false); comboHostname.setEnabled(true); return; } for(int i = 0; i < count; i++){ String host = (String) cmbmodel.getElementAt(i); hostList.add(host); //hostList.add("****************************"); } String[] tmp = new String[hostList.size()]; String[] listData = (String[]) hostList.toArray(tmp); list = new JList(listData); JButton ok = new JButton("OK"); list.setCellRenderer(new HostOidCellRenderer()); ok.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { Object[] h = list.getSelectedValues(); if(h == null || h.length <= 1){ return; } selectedHostsForTotal = new String[h.length]; System.out.println("--- Total ---"); for(int i=0; i 0){ // cmodel.setSelectedItem(items[0]); // } box.setModel(cmodel); } private long getBeginDate() throws ParseException { Date d = dateFormat.parse(textBeginTime.getText()); return d.getTime(); } private long getTimeRange() throws ParseException { return Long.parseLong(textRange.getText()) * 1000; } private String createTitle(String host, String event) { return host + " " + event; } private String createAxisLabelX(String event) { return "Date and Time"; } private String createAxisLabelY(String event) { String ret = event; String e = event.toLowerCase(); if(e.startsWith("available") == true){ ret = "Available Disk space"; }else if(e.startsWith("used") == true){ ret = "Used Disk space"; }else if(e.startsWith("eth") == true){ if(e.indexOf("out") > 0){ ret = "TX Bandwidth"; }else if(e.indexOf("in") > 0){ ret = "RX Bandwidth"; }else{ ret = "Network bandwidth"; } }else if(e.startsWith("loadavg") == true){ ret = "Load average (x100)"; } return ret; } private String createUnit(String event) { String ret = "."; String e = event.toLowerCase(); if(e.startsWith("available") == true){ ret = "bytes"; }else if(e.startsWith("used") == true){ ret = "bytes"; }else if(e.startsWith("eth") == true){ ret = "bps"; }else if(e.startsWith("loadavg") == true){ ret = ""; } return ret; } protected int prefixIndex(long v) { long factor = 0; int prefix_index = 0; for(int i = 1; i < UNIT_PREFIX_TABLE.length; i++){ factor = (long) Math.pow(10, i * 3); prefix_index = i - 1; if( (v / factor) <= 1 ){ // i - 1 hit. break; } } //System.out.println("prefix_index " + prefix_index + " / " + v); return prefix_index; } private boolean initFlag = true; private boolean checkHostFlag; private boolean checkEventFlag; private boolean lockRefresh = false; private void paintGraphAccordingToCurrentGUIStatus() { if(lockRefresh == true){ //System.out.println("Cancel: Refresh"); return; } //System.out.println("Refresh"); checkHostFlag = true; checkEventFlag = true; lockRefresh = true; paintGraphAccordingToCurrentGUIStatus2(); lockRefresh = false; //System.out.println("Refresh done"); } private void paintGraphAccordingToCurrentGUIStatus2() { if(dtSpace == null){ // No data-time space, Nothing to do. return; } String unit = ""; String unitName = ((JRadioButtonMenuItem)comboUnit.getSelectedItem()).getText(); if(unitName.equals(SimpleGrapherBaseUI.unitKB)){ unit += " KB"; } else if(unitName.equals(SimpleGrapherBaseUI.unitNone)){ unit += ""; } else if(unitName.equals(SimpleGrapherBaseUI.unitbps)){ unit += " bps"; } else if(unitName.equals(SimpleGrapherBaseUI.unitLoad)){ unit += " %"; } boolean diffmode = checkDifferentialMode.isSelected(); boolean totalmode= checkTotal.isSelected(); boolean automode = checkAutoUpdate.isSelected(); GraphMonitor gm = SimpleGrapherApp.this.getGraphPane(); String event= (String) comboEvent.getSelectedItem(); ArrayList hostList = new ArrayList(); if(totalmode == true){ for(int i = 0; i < selectedHostsForTotal.length; i++){ hostList.add(selectedHostsForTotal[i]); } // DefaultComboBoxModel cmbmodel = (DefaultComboBoxModel) comboHostname.getModel(); // int count = cmbmodel.getSize(); // for(int i = 0; i < count; i++){ // String host = (String) cmbmodel.getElementAt(i); // hostList.add(host); // } }else{ String host = (String) comboHostname.getSelectedItem(); hostList.add(host); } long begin = 0; long term = 0; rawDataSeries.clear(); try{ begin = getBeginDate(); //System.out.println("getBeginDate() " + begin); term = getTimeRange(); model.setBegin(begin); model.setTerm(term); }catch(ParseException e1) { JOptionPane.showMessageDialog(appFrame, "Invalid date time format, correct Begin Time or Time Range"); return; } for(int h = 0; h < hostList.size(); h++){ String host = (String) hostList.get(h); try { // extract data from data-time space. ArrayList dt = dtSpace.getMeasurementData(host, event, begin, term); ArrayList rde; if(diffmode && menuItemCorrectByUptime.isSelected() && selectedUptimeEventForCorrection != null){ ArrayList uptimeList = dtSpace.getMeasurementData(host, selectedUptimeEventForCorrection, begin, term); if(menuItemBefore.isSelected()){ dt = dtSpace.resampleBeforeDateDataPairListToRawDataElements(dt, resampleResolution); uptimeList = dtSpace.resampleBeforeDateDataPairListToRawDataElements(uptimeList, resampleResolution); } else if(menuItemInterpolate.isSelected()){ dt = dtSpace.resampleEstimateDateDataPairListToRawDataElements(dt, resampleResolution); uptimeList = dtSpace.resampleEstimateDateDataPairListToRawDataElements(uptimeList, resampleResolution); } rde = dtSpace.convertDateDataPairListToRawDataElementsByUptime(dt, uptimeList); } else { if(menuItemBefore.isSelected()){ dt = dtSpace.resampleBeforeDateDataPairListToRawDataElements(dt, resampleResolution); } else if(menuItemInterpolate.isSelected()){ dt = dtSpace.resampleEstimateDateDataPairListToRawDataElements(dt, resampleResolution); } rde = dtSpace.convertDateDataPairListToRawDataElements(dt, diffmode); } RawData rd = new RawData(); rd.setValid(true); RawDataElement[] rda = new RawDataElement[rde.size()]; rda = (RawDataElement[]) rde.toArray(rda); int magnification = 1; int rate = 1; if(check8times.isSelected() == true){ magnification *= 8; } if(check1000times.isSelected() == true){ magnification *= 1000; } if(check100div.isSelected() == true){ rate *= 100; } if(magnification > 1 || rate > 1){ for(int i=0; i 0){ //labelAxisY += " (" + prefix + createUnit(event) + ")"; } */ if(unit == null || unit.equals("")){ labelAxisY = prefix; } else { labelAxisY = prefix + " (" + unit + ")"; } gm.setStyleFill(checkGraphStyleBar.isSelected()); gm.setStyleJoin(checkGraphStyleLine.isSelected()); gm.setStylePlot(checkGraphStylePlot.isSelected()); String host; if(totalmode == true){ host = "Total of "; }else{ host = (String) comboHostname.getSelectedItem(); host = getName1(host); } event = getName1(event); gm.setTitle(createTitle(host, event)); gm.setModel(model); gm.setAxisLabelX(labelAxisX); // set label of x-axis gm.setAxisLabelY(labelAxisY); // set label of y-axis Document doc = txtInfo.getDocument(); String info = ""; info += "Latest (" + dateString(model.getLatestValueTime()) + "): "+ decimalf.format(model.getLatestValue()) + unit + lineSep; info += "Max (" + dateString(model.getMaxValueTime()) + "): " + decimalf.format(model.getMaxValue()) + unit + lineSep; info += "Min (" + dateString(model.getMinValueTime()) + "): " + decimalf.format(model.getMinValue()) + unit + lineSep; //info += "min (" + dateString(model.getMinValueTime()) + "): " + df.format(Long.MAX_VALUE) + unit + ls; info += "Average: " + decimalf.format((long) Math.rint(model.getAvgValue())) + unit; if(totalmode == true){ info += lineSep + "Total: " + event + " ("; int i = 0; while(true){ info += getName1(selectedHostsForTotal[i]); if( i < selectedHostsForTotal.length - 1){ info += ", "; } else { info += ")"; break; } i++; } } txtInfo.setText(info); txtInfo.repaint(); if(initFlag){ initFlag = false; } //gm.repaint(); appFrame.repaint(); } String lineSep = System.getProperty("line.separator"); DecimalFormat decimalf = new DecimalFormat("###,###,##0"); public static String dateString(long t){ DateFormat df = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss"); return df.format(new Date(t)); } private int cookPrefixIndex(int prefixIndex, String event) { int ret = prefixIndex; String e = event.toLowerCase(); if(e.startsWith("available") == true){ //ret++; }else if(e.startsWith("used") == true){ //ret++; }else if(e.startsWith("eth") == true){ // Nothing to do. }else if(e.startsWith("loadavg") == true){ //ret = 0; } return ret; } private ArrayList totalofRawDataSeries(ArrayList rawDataSeries) { RawData[] rda = new RawData[rawDataSeries.size()]; rda = (RawData[]) rawDataSeries.toArray(rda); RawDataElement[] rde = total(rda); ArrayList newList = new ArrayList(); RawData newData = new RawData(); newData.setMax(rda[0].getMax()); newData.setBarColor(rda[0].getBarColor()); newData.setLevelColor(rda[0].getLevelColor()); newData.setLineColor(rda[0].getLineColor()); newData.setPlotColor(rda[0].getPlotColor()); newData.setDiffMode(rda[0].isDiffmode()); newData.setValid(true); newData.setData(rde); newList.add(newData); return newList; } /* * "File" - "Open..." Event handler of Menu item. * @author hkondo */ class MenuItemFileOpenAction implements ActionListener { public void actionPerformed(ActionEvent arg0) { actionAutoUpdate(false, false); menuItemAutoUpdate.setSelected(false); checkAutoUpdate.setSelected(false); // stop Swing timer. timer.stop(); if(currentDirectoryPath != null){ String path; try { File f = new File(currentDirectoryPath); if(f.exists()){ path = f.getCanonicalPath(); } else { path = ""; } } catch (IOException e) { path = currentDirectoryPath; } //System.out.println(path); dialogFileOpen.setCurrentDirectory(new File(path)); } int ret = dialogFileOpen.showOpenDialog(appFrame); if(ret == JFileChooser.APPROVE_OPTION){ // rebuild data-time space because files are specified. File[] files = dialogFileOpen.getSelectedFiles(); selectedDir = files[0].getParentFile(); //currentDirectoryPath = selectedDir.getParent(); currentDirectoryPath = selectedDir.getAbsolutePath(); String[] filenames = new String[files.length]; for(int i = 0; i < files.length; i++){ filenames[i] = files[i].getPath(); } try { dtSpace = new DataTimeSpace(filenames); long begin = dtSpace.getBeginDateTime() - 500; long latest = dtSpace.getLatestDateTime(); String dt = dateFormat.format(new Date(begin)); textBeginTime.setText(dt); long r =(latest-begin)/1000; if(r <= 0){ r = 1; } textRange.setText(""+r); //System.out.println("dtSpace.getBeginDateTime(): " + begin + " -> " + latest); defineNewComboBox(comboHostname, dtSpace.getHostnames()); defineNewComboBox(comboEvent, dtSpace.getEvents()); paintGraphAccordingToCurrentGUIStatus(); } catch (Exception e) { // Cannot create datat-time space. //e.printStackTrace(); String msg = "File open error."; JOptionPane.showMessageDialog(appFrame, msg); } } } } public void setOptions2(String args[]) { if(args.length >= 1){ currentDirectoryPath = args[0]; } else { currentDirectoryPath = null; } panelInformation.setVisible(false); menuItemVisInfo.setSelected(false); panelController.setVisible(false); menuItemVisController.setSelected(false); } public void printHelp(){ String ls = System.getProperty("line.separator"); String str = "usage: java -jar gmonitor3.jar [ -d TargetAutoUpdateDirectory ]" + ls; str += " [ -h TargetHostname ] [ -e TargetEventNickName ] " + ls; str += " [ -u UnitName(bps/KB/Load) ] [ --help ]" + ls; str += " [ --no-line ] [ --no-bar ] [ --no-plot ]" + ls; str += " [ --no-information ] [ --no-style ] [ --no-unit ] [ --no-controller ]"; System.err.println(str); } public void setOptions(String args[]) { int len = args.length; currentDirectoryPath = null; setTargetHostName = null; setTargetEventName = null; setTargetUnitName = null; //initialDelay = 0; // default 3 seconds for(int i = 0; i < len; i++){ String now = args[i]; if(now.startsWith("-")){ String opt = now.substring(1); if(opt.startsWith("d")){ if(++i < len){ currentDirectoryPath = args[i]; } else { System.err.println(""); printHelp(); System.exit(1); } } else if(opt.startsWith("h")){ if(++i < len){ setTargetHostName = args[i]; } else { System.err.println(""); printHelp(); System.exit(1); } } else if(opt.startsWith("e")){ if(++i < len){ setTargetEventName = args[i]; } else { System.err.println(""); printHelp(); System.exit(1); } } else if(opt.startsWith("u")){ if(++i < len){ setTargetUnitName = args[i]; } else { System.err.println(""); printHelp(); System.exit(1); } } else if(opt.startsWith("-")){ String longopt = opt.substring(1); if(longopt.equals("no-line")){ menuItemGraphStyleLine.setSelected(false); checkGraphStyleLine.setSelected(false); } else if(longopt.equals("no-bar")){ menuItemGraphStyleBar.setSelected(false); checkGraphStyleBar.setSelected(false); } else if(longopt.equals("no-plot")){ menuItemGraphStylePlot.setSelected(false); checkGraphStylePlot.setSelected(false); } else if(longopt.equals("no-information")){ panelInformation.setVisible(false); menuItemVisInfo.setSelected(false); } else if(longopt.equals("no-style")){ panelGraphStyle.setVisible(false); menuItemVisGraphStyle.setSelected(false); } else if(longopt.equals("no-unit")){ panelUnit.setVisible(false); menuItemVisUnit.setSelected(false); } else if(longopt.equals("no-controller")){ panelController.setVisible(false); menuItemVisController.setSelected(false); } else if(longopt.equals("help")){ printHelp(); System.exit(1); } else { System.err.println("invalid option -- " + longopt); printHelp(); System.exit(1); } } else { System.err.println("invalid option -- " + opt); printHelp(); System.exit(1); } } } if(currentDirectoryPath != null){ checkAutoUpdate.setSelected(true); menuItemAutoUpdate.setSelected(true); timer.setInitialDelay(1000); actionAutoUpdate(true, false); } timer.setInitialDelay(0); } public void setComboTargets(){ setComboTargetsFlag = true; if(setTargetHostName != null){ for(int i=0; i= 0){ comboHostname.setSelectedItem(chn); break; } } //System.out.println(setTargetHostName); } if(setTargetEventName != null){ for(int i=0; i= 0){ comboEvent.setSelectedItem(ce); break; } } //System.out.println(setTargetEventName); } if(setTargetUnitName != null){ if(setTargetUnitName.equals("bps")){ comboUnit.setSelectedItem(radioMenubps); } else if(setTargetUnitName.equals("KB")){ comboUnit.setSelectedItem(radioMenuKB); } else if(setTargetUnitName.equals("Load")){ comboUnit.setSelectedItem(radioMenuLoad); } //setTargetUnitName = null; } setComboTargetsFlag = false; } public SimpleGrapherApp(String args[]) { initializeFromProperty("GMonitor."); initializeEventHandlers(); initializeGUIComponents(); JFrame f = appFrame; if(propMenuBarVisibility == true){ f.setJMenuBar(getMenubar()); } Container c = f.getContentPane(); JPanel allPanel = new JPanel(); GridBagConstraints gbc = new GridBagConstraints(); allPanel.setLayout(new GridBagLayout()); gbc.gridwidth = 2; gbc.gridy = 0; gbc.weightx = 1.0; gbc.weighty = 1.0; gbc.fill = GridBagConstraints.BOTH; allPanel.add(getGraphPane(), gbc); gbc.gridy++; gbc.weightx = 0.0; gbc.weighty = 0.0; gbc.fill = GridBagConstraints.HORIZONTAL; if(propInformationPanelVisibility == true){ allPanel.add(getPanelInformation(), gbc); } gbc.gridy++; gbc.gridwidth = 1; if(propStylePanelVisibility == true){ allPanel.add(getPanelGraphStyle(), gbc); } if(propUnitPanelVisibility == true){ allPanel.add(getPanelUnit(), gbc); } gbc.gridy++; gbc.gridwidth = 2; if(propControllerVisibility == true){ allPanel.add(getPanelController(), gbc); } c.add(allPanel); // Swing paint debugging with diabling double-bufferring. //RepaintManager rm = RepaintManager.currentManager(getGraphPane()); //rm.setDoubleBufferingEnabled(false); } public static void main(String[] args) { SimpleGrapherApp app = new SimpleGrapherApp(args); app.setTitle("GMonitor"); app.pack(); app.setOptions(args); try { Dimension d = app.appFrame.getSize(); DisplayMode dm = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDisplayMode(); app.appFrame.setLocation(dm.getWidth()/2 - d.width/2, dm.getHeight()/2 - d.height/2); } catch(Exception e){ } app.show(); } /** * set frame size. * @param arg0 * @param arg1 */ public void setSize(int arg0, int arg1) { appFrame.setSize(arg0, arg1); } /** * set title of frame. * @param arg0 */ public void setTitle(String arg0) { appFrame.setTitle(arg0); } /** * control visibility of application frame. * @param arg0 */ public void setVisible(boolean arg0) { appFrame.setVisible(arg0); } /** * control visibility of application frame. */ public void show() { appFrame.show(); } public void pack(){ appFrame.pack(); } private RawDataElement[] total(RawData[] rda) { RawData newData = new RawData(); ArrayList newList = new ArrayList(); long time = 0; int series = rda.length; RawDataElement[] totalBuffer = new RawDataElement[series]; int[] scanIndex = new int[series]; long endTime[] = new long[series]; fillEndTime(endTime, rda); while(true){ // scan next element. time = scanNext(time, rda, scanIndex, totalBuffer); // add up values latched in total buffer and create new element. long v = addup(totalBuffer); RawDataElement ne = new RawDataElement(); ne.setTime(time); ne.setValue(v); ne.setValid(true); newList.add(ne); // termination ? if(isFinishedTime(time, endTime) == true){ break; } } RawDataElement[] rde = new RawDataElement[newList.size()]; rde = (RawDataElement[]) newList.toArray(rde); return rde; } private long scanNext(long time, RawData[] rda, int[] si, RawDataElement[] tb) { int series = rda.length; // with all series... long t = Long.MAX_VALUE; for(int s = 0; s < series; s++){ RawDataElement[] rde = rda[s].getData(); // finding the index of element that is exceeded time... int idx = findFirstExceededTime(time, rde); // ... and adopt the oldest element. if(idx < 0){ // not matched in this series. }else{ // temporary keeping. si[s] = idx; long tt = rde[idx].getTime(); if(t > tt){ t = tt; } } } // matched elements are latched in tb. If plural elements are matched, process them all. for(int s = 0; s < series; s++){ RawDataElement[] rde = rda[s].getData(); if(rde[si[s]].getTime() == t){ // should be latched in tb. tb[s] = rde[si[s]]; } } return t; } /** * @param time * @param rde * @return */ private int findFirstExceededTime(long time, RawDataElement[] rde) { for(int i = 0; i < rde.length; i++){ if(rde[i].isValid() == true){ if(rde[i].getTime() > time){ return i; } } } return -1; } private boolean isFinishedTime(long t, long[] endTime) { for(int i = 0; i < endTime.length; i++){ if(t < endTime[i]){ return false; } } // t >= endTime[all of]; return true; } private void fillEndTime(long[] endTime, RawData[] rda) { for(int i = 0; i < rda.length; i++){ RawDataElement[] rde = rda[i].getData(); endTime[i] = rde[rde.length - 1].getTime(); } return; } private long addup(RawDataElement[] rde) { long s = 0; for(int i = 0; i < rde.length; i++){ if(rde[i] != null){ s += rde[i].getValue(); } } return s; } } gfarm-2.4.1/snmptool/gmonitor3/gmonitor/app/SimpleGrapherBaseUI.java0000644000000000000000000004473711507222726024203 0ustar rootroot/* * Created on 2003/07/10 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments */ package gmonitor.app; import gmonitor.gui.GraphMonitor; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Component; import java.awt.Container; import java.awt.Dimension; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.Insets; import java.io.File; import java.util.ArrayList; import java.util.Vector; import javax.swing.BoxLayout; import javax.swing.ButtonGroup; import javax.swing.DefaultComboBoxModel; import javax.swing.JButton; import javax.swing.JCheckBox; import javax.swing.JCheckBoxMenuItem; import javax.swing.JComboBox; import javax.swing.JFileChooser; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JList; import javax.swing.JMenu; import javax.swing.JMenuBar; import javax.swing.JMenuItem; import javax.swing.JPanel; import javax.swing.JRadioButtonMenuItem; import javax.swing.JScrollPane; import javax.swing.JTextField; import javax.swing.JTextPane; import javax.swing.ListCellRenderer; import javax.swing.border.TitledBorder; import javax.swing.filechooser.FileFilter; /** * @author hkondo * * To change the template for this generated type comment go to * Window>Preferences>Java>Code Generation>Code and Comments */ public class SimpleGrapherBaseUI { JFileChooser dialogFileOpen = new JFileChooser(); JFileChooser dialogDirOpen = new JFileChooser(); JMenu menuFile = new JMenu("File"); JMenu menuGraphStyle = new JMenu("Style"); JMenu menuUnit = new JMenu("Unit"); JMenu menuMode = new JMenu("Mode"); JMenu menuConf = new JMenu("Config"); // menuFile JMenuItem menuItemFileOpen = new JMenuItem("Open Files..."); JMenuItem menuItemFileAutoUpdate = new JMenuItem("AutoUpdate..."); JMenuItem menuItemFileExit = new JMenuItem("Exit"); // menuConf JMenu subMenuResample = new JMenu("Resampling"); ButtonGroup resampleGroup = new ButtonGroup(); JRadioButtonMenuItem menuItemRaw = new JRadioButtonMenuItem("Raw (normal)"); String menuStrResampleBefore = "Last Value"; JRadioButtonMenuItem menuItemBefore = new JRadioButtonMenuItem(menuStrResampleBefore); String menuStrResampleInterpolate = "Interpolate"; JRadioButtonMenuItem menuItemInterpolate = new JRadioButtonMenuItem(menuStrResampleInterpolate); String menuStrResolution = "Resolution..."; JMenuItem menuItemResolution = new JMenuItem(menuStrResolution); String menuStrAutoUpdateInterval = "AutoUpdate Interval..."; JMenuItem menuItemAutoUpdateInterval = new JMenuItem(menuStrAutoUpdateInterval); JCheckBoxMenuItem menuItemCorrectByUptime = new JCheckBoxMenuItem("Diff mode correction by uptime"); JCheckBoxMenuItem menuItemVisInfo = new JCheckBoxMenuItem("Information"); JCheckBoxMenuItem menuItemVisGraphStyle = new JCheckBoxMenuItem("Graph Style"); JCheckBoxMenuItem menuItemVisUnit = new JCheckBoxMenuItem("Unit"); JCheckBoxMenuItem menuItemVisController = new JCheckBoxMenuItem("Controller"); // menuGraphStyle JCheckBoxMenuItem menuItemGraphStyleLine = new JCheckBoxMenuItem("Line"); JCheckBoxMenuItem menuItemGraphStyleBar = new JCheckBoxMenuItem("Bar"); JCheckBoxMenuItem menuItemGraphStylePlot = new JCheckBoxMenuItem("Plot"); // menuMode JCheckBoxMenuItem menuItemDifferentialMode = new JCheckBoxMenuItem("Diff"); JCheckBoxMenuItem menuItemTotal = new JCheckBoxMenuItem("Total..."); JCheckBoxMenuItem menuItemAutoUpdate = new JCheckBoxMenuItem("AutoUpdate..."); JMenuItem menuItemRepaint = new JMenuItem("Refresh"); // panelUnit JCheckBox checkTotal = new JCheckBox("Total..."); JCheckBox checkAutoUpdate = new JCheckBox("AutoUpdate..."); JCheckBox checkGraphStyleLine = new JCheckBox("Line"); JCheckBox checkGraphStyleBar = new JCheckBox("Bar"); JCheckBox checkGraphStylePlot = new JCheckBox("Plot"); JCheckBox checkDifferentialMode = new JCheckBox("Diff"); JCheckBox check8times = new JCheckBox("x8"); JCheckBox check1000times = new JCheckBox("x1000"); JCheckBox check100div = new JCheckBox("/100"); // menuUnit public static String unitNone = "none"; public static String unitbps = "bps"; public static String unitKB = "KB"; public static String unitLoad = "Load Average"; ButtonGroup radioGroup = new ButtonGroup(); JRadioButtonMenuItem radioMenuNone = new JRadioButtonMenuItem(unitNone); JRadioButtonMenuItem radioMenubps = new JRadioButtonMenuItem(unitbps); JRadioButtonMenuItem radioMenuKB = new JRadioButtonMenuItem(unitKB); JRadioButtonMenuItem radioMenuLoad = new JRadioButtonMenuItem(unitLoad); JCheckBoxMenuItem menuItem8times = new JCheckBoxMenuItem("x8"); JCheckBoxMenuItem menuItem1000times = new JCheckBoxMenuItem("x1000"); JCheckBoxMenuItem menuItem100div = new JCheckBoxMenuItem("/100"); // panelController JComboBox comboUnit = new JComboBox(); JComboBox comboHostname = new JComboBox(); JComboBox comboEvent = new JComboBox(); JLabel labelBeginDate = new JLabel("Begin Time"); JLabel labelRange = new JLabel("Time Range"); JLabel labelSecond = new JLabel("Sec."); JTextField textBeginTime = new JTextField(10); JTextField textRange = new JTextField(10); JButton buttonUpdateNow = new JButton("Refresh"); JButton buttonFileOpen = new JButton("Open Files..."); // export to be controlled component. JMenuBar menubar = new JMenuBar(); GraphMonitor graphPane = new GraphMonitor(); JPanel panelGraphStyle = new JPanel(); JPanel panelUnit = new JPanel(); JPanel panelController = new JPanel(); JPanel panelGraphMode = new JPanel(); JPanel panelAll = new JPanel(); JPanel panelInformation = new JPanel(); //JTextArea txtInfo = new JTextArea(5, 20); //JEditorPane txtInfo = new JEditorPane(); JTextPane txtInfo = new JTextPane(); JScrollPane txtInfoScroll; class GloggerDataFileFilter extends FileFilter { /* (non-Javadoc) * @see javax.swing.filechooser.FileFilter#accept(java.io.File) */ public boolean accept(File f) { if(f.isDirectory())return true; return f.getName().endsWith(".glg"); } /* (non-Javadoc) * @see javax.swing.filechooser.FileFilter#getDescription() */ public String getDescription() { return "GLogger3 measurement datafile (.glg)"; } } class UnitCellRenderer extends JLabel implements ListCellRenderer { public UnitCellRenderer() { setOpaque(true); } public Component getListCellRendererComponent( JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { setText(((JRadioButtonMenuItem)value).getText()); setBackground(isSelected ? Color.blue : Color.white); setForeground(isSelected ? Color.white : Color.black); return this; } } class HostOidCellRenderer extends JLabel implements ListCellRenderer { public HostOidCellRenderer() { setOpaque(true); } public Component getListCellRendererComponent( JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { String v = (String) value; String name1, name2; try { name1 = getName1(v); } catch(Exception e){ name1 = v; } try { name2 = getName2(v); } catch(Exception e){ name2 = name1; } //setText(isSelected ? name2 : name1); setText(name1); list.setToolTipText(name2); setBackground(isSelected ? Color.blue : Color.white); setForeground(isSelected ? Color.white : Color.black); return this; } } protected String getName1(String v){ return v.substring(0, v.indexOf('#')); } protected String getName2(String v){ return v.substring(v.indexOf('#') + 1); } public void setToolTips(){ String ls = System.getProperty("line.separator"); // menubar menuItemFileOpen.setToolTipText("Choose data files of GLogger3"); menuItemFileAutoUpdate.setToolTipText("Latest graph is displayed automatically"); menuGraphStyle.setToolTipText("Graph Style"); menuItem8times.setToolTipText("Byte -> bit"); menuItemDifferentialMode.setToolTipText("The rate of increase (Per second)"); menuItemTotal.setToolTipText("Choose Host Names for Total"); menuItemAutoUpdate.setToolTipText(menuItemFileAutoUpdate.getToolTipText()); menuItemRaw.setToolTipText("Do not resample"); menuItemInterpolate.setToolTipText("v=v0+(v1-v0)/(t1-t0)*(t-t0), t0ÆP)ÁCÕÇ4f<Ô|ñÎÇ{Ìz˜ó°èa‰aÔö¤©`XŽ»}­¤Õyij,jË~–Šo9Ïz"ofÙ'†Rû‡²=aeB²Ï’Ø/ kátC±¥OC™'Vju(ò3÷Å) ãs~É#~e#q)”šCä«»“4À8–øxëa%À*ÖªNq™+©ºÑþÞ…µZXGÝÃF€MlQÚW[ªdCð])‘·RnŒ0 “ÃFRNINÎEbŸí-–Æ R2Bgnîe4³®°m}‘'d:lÄÿ¡±V 9ÒYLê´©a¨o†Ú#ì·´²\RMÂ+O_|#lGy’RbxÜè`…¾~Œl–hWÜe¸5B{—éV£Ø½øÛ·`Û;7ù9¤h"˜z`æ˜òÎ…_(ð¦0Àè#¸àätzÃPK¤·Ü•„PKpy/9gmonitor/app/SimpleGrapherApp$CorrectByUptimeAction.class…’ÛJ#A†ÿŽš1ãxŠëÙ¨«Ù%FؼT "JD!˜ ïÚ±Ö´fL·§Ç<,{áøPbuŒ7â¡¡èê⫪¿»úéùÿ#€?øíÂÁ`YäsÂÃqÙu0æ`ÒÁ”@Ö4”.. ÌTOÂ8R&N}™$~M…I“¶R™4(]O’\í:2 2*à´UÅìšÀ\雼…º@g%>&~Gû”þÓŽ¹i©z*/¤//O½…lZŸS=x(xÈÁu0ía³~z˜Ã¼‡"~ ,Ù¼X‰Ó”³q}ÒkqáOâÞvQZiJ­I ´´5etâï2/PøPnUiCœ)ÐQ²÷-|©J`4¤è|ÛPøN‡‚mpåëKÅ]w* Î6â«Ý6¿ÒVð) à*]£&µïËr9$ƒ€´../ñœç¿ØáB³üit³åíóóÞ»2lzùÜÇÞŸmÄ-?@”ï¹iQD@ *”­²¨(ˆbECÅHÀ(ám]nÚŲ»Ù]Pÿ‡/š˜à“Ï&"þ”qîíRIhÒ¹3w朙;3í¯ß?~˜ÀCÉ yW0*µ1) :‰ñ4Ÿ„E)®Ê°kR›Â”bRÃu 3n0d§RÕ¬ ÛdHÛ5Ç~Mú2CKTuÂü$ÃÐJeÇsÈ LË÷Íugǯ‰ÇåWE°èûsD³þΪ"rl‚Í;»À0\87þ‚!Uò¶ßñvCQ’ÉÅÃ`aeÛÚ³LëMdŠ=áFæSé_’ª‚5â—ÜH2¾µa¾u"i5œ«Ci¶)sMÔ„¥ì´bäèÃMŽ^\Ðp‹c·9ºÑÃÑ…óÃÈj¸Ã1‡yŽ»èçXÀ=ŽûÒ\ÄŽæ&N}_^©ªðE;r<—¡óß+¾ìº"(Õ,*6¤õîšåVÌg¯¶…1\ú_+Vœ0dHdCúNì5 ""ÕÚ’·+mBÐx³§Ï [¶MÌÏLÓ Œœ5Ëòxù/dj’ íN¸êù»þsZ±J\èæqÚÙc†œ½/åãˆ)ähç;ÁpI$äÜÔòÓIvÉɒÓèÛ‡~²Hë¥èºqføª¢¨ÕÈÆ1mòg$ïŽ\ƒ'»†Nvåš®±8é€QüŽäRÆ7¤ÒŸ‘4ÈHÅC´.7AÓêeV~B¤?"{èLtC«#³!Õ:ôABnoL`#¥^RÒÖXkP<‘©}Œ6)xLÑ–yÿ 9©ëu´o|A·Ê¶Þ¼‹s)*û¨âiÙM:;èïe øPKzM&u°PKpy/2gmonitor/app/SimpleGrapherApp$ResampleAction.class…R]KA=cåæ¶ZÙ·i–ù`­ôZRQdô>­“Žèî²;ý¬À>è¡ЊîlEe—{æÞsgîœ;¯oÏ/6Q4a`28Ò LaÚÄ fMBsæ ,È2ÄUK†Å C¾Öìz®T^`sß·ë²ëwÄaÀý–ª¾¿Í¨ßºª%”t¨lGw—¡Pú§ní‚axÏk†qî(é¹§"¸ò‚®hÐ¥¥Z›÷¸Ío”-zÂUv5¢hL¥,ä,$`X²Ç² \E’acàåÅ3rú8•!õ3`¹®ö:< EÈ0uÓánÓ>¹l G1ä~m°&C%¨’a¨¤_˜ØƒÑPuŸ;$Bö[¯æµ´÷¹âç²+¢,‰œù;Ë0©Eÿx‚t›Ç‘¨&w†Å­JË4k £di­ù1è#³¤}ŠÐ,íuÄ,?‚•×ﻋX4"L|r–ÈkNºÜG¬¡ kô„‘/nFŸ@>N_jxPKiä…ÉzxPKpy/5gmonitor/app/SimpleGrapherApp$VisibleInfoAction.class…’]OA†ß)ÈÒu±P¬|Xu[Ë=ÆBjj$iÒ î†r ƒ»³›ðg‘&^øüQÄ3ízADØdöÌLž3ç=¿o~þ°u“¨–áái³˜s¿yÏðÜÇ ,xXôðÊÃ’À„(SßXê'©V6Í#™eQW%YL»¹Ì”ogÙ–@¹û]ÛYÕg·÷ŠÙ«á~žÀx+=$Šì[•ê=ÊÒ<¡CvN䩌ä™è”´¶‡ÈŽÛ³k€),ðñØÃJ€U¼PÇo¼Cè¡ ‰5è^õž2ê ¦¶>JGfî¸ ÚZSÞŠ¥1d¦‡Úb©£/'Ô·µ;åv”±Äžc¡Ë·v¯~8“šb9Oä(ôì°ç‘9SîÓž¸æ•„ô·¶¥„Õ:ÞõéØPÿëÇôüsÁmÿ øÊt)æt\Xð¾@õßà̲E‘¸…á~£‡ež¨Ið(𪺶° ྯ)<ás…wó|v7~óDsí ¥‹!Å©c¦`V f®y‰Ò%ÆFfü®1ñ¯¹GØz<À/?PK;ºK+°áPKpy/6gmonitor/app/SimpleGrapherApp$VisibleStyleAction.class…’mOÔ@Çÿ{ åJ=8ðé<Àz‡±¼‡˜àÅÌI.¹¼[Ž‘[h·MwyúX&ˆ‰/ü~(ãl)‰FÄ&ÛÙþ¦óß™ùñóÛw¯ðÒÇ$jUx˜­bu÷š÷±€G>㉇§ž{h LØ‘2­ fï0Iµ²iÉ,‹ú*Ébz—ËlDùv–m TûڎȪ!‡m)f_ ,‡ÿ‰kÆ»é ÌÈ¡U©Þ¥üSš'tÀIÃÞ‘<•‘<³’¶Ñv¼u{ 0Å>¦<,XÆ‹-¬xX °†ÐC;@ëwŠh ”Qû1õíEL×j·9ƒ­)ïÆÒ2 u±Ô‡ÑÇý#ZÆ­‚{ÊXâH±Ðݸq§.E&5Å…§È/0WTâ<2gг½ßuß¹èõ„ôÉŽ¥„ÕþŽ7ÿÄ»#¿IÏ?”ôf)ôŸ€€¯LŸb¾“k«Þã’ü-9C¶,w2Ük°Èƒ5 ž^5×¶ÜSá5û|žáÝ<ŸÇï|…è¬AåsAqañ°d–J¦Þ¹Dåc×fü ÷®0qƒ7ÜOØz<ÇÏ€_PKRzþ5°èPKpy/5gmonitor/app/SimpleGrapherApp$VisibleUnitAction.class…’]OÛ0†_FhëèøÚGW`Ý–DvÏ4‰UÓÄÔiH½àΔ3j–8QìûYH|H\ìð£Çmv11Kö±çä¼~í뛫_Ö±æcÕ2<<.csn˜÷±€EOðÔÃ3/<Ô&ì@™Æ[zç Iµ²iÉ,‹º*Ébú”Ël@ùf–m”»?µU}N{§˜}/°þ'¯Ùo§û$P‘}«R½Mù·4OhŸ‹†Cy$#yl#:"m£Í!òÑÍ95À4–ø˜ò°`/4ðÊÃëozhhaU ºWD£§ŒÚ‹i‡‘Q™;ö‚-­)oÇÒ2†Úb©¢¯{‡Ô·µ;åv”±Ä™c¡;oí^5ìd&5Å®²ÀìГÈ+®óyÛ}a³+ é[––9ë‚íõ¿HO¾ÜF!€¯L—b>‡³ž•î Tÿ.Μ![¸Ãwî6{Xâ§4 Vνêîƒc×JܧñמÍóÚíø­KˆÖê9J§CŠÍÄLÁ,Ì\ë ¥3ŒÂø\`â7^s?áèñË}ÜPK||ùô­ÚPKpy/;gmonitor/app/SimpleGrapherApp$VisibleControllerAction.class…’]OA†ß)ÈÒu-üª,°-ÆõÆ+ 6Æ`j$iÒ î†r¤»³›áße‚˜xáðGÏ,KÐ(¸Éì™çÌyçœóãç·ïžã™IÔªð0SÅ,êî7çc÷}<ÀC<<ñИ°#eZ/š½ý$Õʦy$³,ê«$‹ém.³å›Y¶.PíÒvDV Ùí•bvC`)ü_{ 0ÞM÷H`Z­Jõ6åÓ<¡=ö䱌ä‰è˜´6 䛳k€),ðqÛÃb€%< ⇕«=´t°&ðòF­2j7¦nªmžÆ1oaæ¯= ¶´¦¼KcÈÜ-tÆRïGvhhÿ”ÞSÆ{ Œ…îí•qR2©)¾Š/0[ää42'Š£½ÛvçœþzBúhËRÂ’Ç›âÝ _§§ïKz½z- à+Ó§˜ßäJªwjK`Î-óÅ5 wÚ,p‹M‚{ƒGÍÕ‰m÷UxLᯧy6Çk·ãw¾BtÖ¾ ò¹ 8±¸W2‹%Sr†± 3~Ž[瘸Äî¶wôcàPK÷f9´òPKpy//gmonitor/app/SimpleGrapherApp$RadioAction.class…TÛRÓP]‡VbÃ)(Z‹ˆš¶Joh‘[AÄ)£##¼¥á@ƒÍÅäðÑðüŸÁ:ãƒã³å¸O/S I²Ï>kïµ×ÊIÿùñÀVtôc$>\Öq) WHcT¥¯©hLÇuŒ«è†Ž›è–ºê–Ñ‘ENÃm ¦†» ݲìD㤋ۮï9ÒM+Ì5Ç *b9´‚²çƒ ÏXûàɲŽMeÓagÆŒSê2ë ñ‚¿)ú,[:¾÷Z„[~èŠM"5Š;Ö®eZ{һ“æ|²¤b*åHâÇ.h˜ä¸ £ªbߌöoÛ|ùÆÚtü…ª”¾·*¼êŠ®†‡ð˜c O8ž"¯ašãf8f1§ažcyŽæ8±¤á9Ç2^0dNÔ2^'kLÈÐsdÅW_ ˆ'㉠¦—e@éÉSÚ» Êõ4ˆÑcÁ¶´’ô(‰J± Oš`^‰„G@ÆŽikÉÙŽ#ãxúÒüüÿa©}¬yÁ3Ôê†Ü¨PQy{¦ô¬¥™<–|£=ïMák¶Çµ`ßöÆZuE= h¥§Ø^ ¼0ð5ËKÏÎ,A“˜z¤«Ó´¨êö¤CÅš%q¯“.³Û˜‹ o½¬1¶v™ò¤ß°•ôz‰ØC„õ#SxZ»Qæ$¯LREƒAúÄŽBöUçÃ$¿´ žLl,ŸØ«ñDŒ4àXª-yð¼vÑ—‘&‹UYˆ{ÄÒ ÄJDŠn¦)º¹éÖ¡'£¯(ZÏ@ÿúèÉáMÚŸ%i‚öZcÎ>›½ð;úÛVÔ|LÙ¤Zæ°€Ÿp ‹ø±½êZ®è i¢ 5à?PKéU3ßPKpy/6gmonitor/app/SimpleGrapherApp$ResampleResoAction.classT[SÓPþTÒ†(PhQ¡R¡h[*©¨xQîËE@ßb{ aÚ$“¤€¯þŸ}f¡£3>úàrÜÓâ”K;“ìží·g¿óížüúýí€A¼—F4€nЋ>?b2Ù~wpWF I ˆXJîI”Ñ,Rz¡ /íÇ}?†„û@ÆC<Øa %<‘0"a”¡ÉÛ2ÜXš¡'³Y´LóU·muÅ(Ú>ëèöwÆm{„!°òÑô¶¸gd)mÔ ìCoü’¼ÄƒoÒÊq†=떹ļåyŽŠÆ3ÛúŽ®ê»žÊw¸é©ãÈ´ð)UAž+¸ŽÆ¼ÀK†[ËÜÕ©ˆanFɵ %‘»@åcC?0n 1qÂ0„©÷_qÎøcÿp]=r·¤/¡YÿŒÀoPKÍÎâQPKpy/5gmonitor/app/SimpleGrapherApp$CheckBoxBarAction.class…R]OA=S*Ë.#E´à„ªK·ñUc1˜MšøÀÛ¸\èà~egäãg‘üþ(ã¶ÄÄTÜdöνsÎÜsrçç¯ï?m·±ÊoÏ×xÍ»Ùq¼ ÷UxÍ Æù,ïꜻJÐú ÑÚþ‚ÊçJ`ŽyCL8Â,·.P¹ÀÄ0T/qã“.ùâîâ8ÅOü>ðPKŽƒd¼PKpy/6gmonitor/app/SimpleGrapherApp$CheckBoxPlotAction.class…R]OA=S*Ë.#EâĪK¶ñUc‚1˜IšðÀÛ¸\éà~egäãg‘üþ(ã¶ÄÄTÜdöνsÎÜsrçç¯ï?l" àcÞÇnûX@ÝýÜÁÝ÷p?àtÉCÃʇ‡“¶¯M³-°Ü=HóLÛ¼ŒTQD= ½-Uѧr«(^ø½ÓÌöÉê˜i/5c_ ¬†ÿá­í T;ù> ÔTlužíPù)/SÚç¦a÷P©HÛˆŽ(³ÑÖòÆí™*1ƒU‰iH$šx,ñO=„khyX—x† ɾkík•4;}Š?¿ÎOv’ÜÛÌ+Êí,£²“(cÈÌ$&*;ˆ>|<¤Ø 4ƪîjc‰™¡³Ý¸V@=¥ì˶¥tPìÙÓ„œ 7 wÿIdŽ57}w¥ñýγ˜]íoÞâxãÆÚô(aOn¬zoä퟽¦ Ù?œj¸ç¬*ŽÉ˜æóv+üö|pל›Ç›p_…× jœÏò®Î¹«­¯­õ TÎ([ÌbÂf©uŽÊ9&†¡z‰—˜tÉ7xW¬ewÇ)~â€ßPKÔ0÷1»PKpy/Bgmonitor/app/SimpleGrapherApp$CheckBoxDifferentialModeAction.class…R]OA=S*Ë.#Å>T ˆU—¢nã«Ä«1˜LšøÀÛ¸ÜÒÁýÊÎø³Lþ”ñN[b¢6™½sçܽóó×÷ž àã†)Üô1‡y÷Z°ˆ[nãNÀé’‡º‡Uw&m_›FK`¥sæ™¶y©¢ˆº:-z]ª¢OåVQ<ð»Ÿ2Û'«c¦mjÆ>X /á­¿¨¶ó}¨©Øê<{Ke//SÚgѰs¨ŽT¤ŽmDG”ÙhkyåöL•˜ÁšÄ4¤‡{ Ü—x€‡B‰u4=lH<ÂcÉ}×6/tÒh÷)þð"?y©{=*Y@«d‡ %–/Èí,£²(cÈ̬'*;ˆvßRlêc»éhc‰™¡ûõ } ,¦”}ܶ”þmÄMÉ)œDæX³ì›sÇ;#Oi.vµ™ 㙎1ö@ ЦK ÷å&ÅÎ÷FýýW]`Úýé†{®Ý@Å1ÓxÚja•葉ñºîæÊñ*ÜSá5ƒç³¼›çÜU‚æWˆæÆT>Pט7Ä„#ÌRó•SL Cõ WÎ0é’oðÎY+î[§øú/¿PK˼EÊ¿.PKpy/8gmonitor/app/SimpleGrapherApp$CheckBox8timesAction.class…RÛNA=½¬ 3´»ˆ\¼°rq•aAgÓ‰Æ7Æ`Ö`²‰¼5CÉ6î\2Ýrù,âƒàG«÷_Vœ¤§ºªÏés*Õ¿~ÿø à9¢>îú˜Âœy,¸ßb€{¸àœ.y¨yXñ°*0i»ÚÔ›Ëí£$KµÍŠHåyÔÑIÞ£w…Ê»TìäùK¿sžÚ.Y3í•fìkµð?¼OåVvHU[¥©øœ ²hØ>V'*R§6¢Jm´Ó‡¼u{¦JT°&1 éá±DO$žbÝC(±†‡M‰-<“ÜwU`ûF'õV—â/o²³V'dBsãËr7M©hõ”1dfú6{*=ŠöŽ)¶µ±ÎÛÚXb¦ÀDèZ¯ÝèI ’Púu×R2wsp÷žEæT³Øû‘»CÏa:vµ~q<žqócm:ÔãÜØåþ°—j²¤!û—S÷]kŠc2¦¾Ýlb…ß›®ñšuóâxî+ñª Êù ï8w• qÑØüŽÒ·>Jàó˜pˆYj\ t‰A(_âÖ%&]r oÄZvwqœâgýøPK†€;»¸PKpy/;gmonitor/app/SimpleGrapherApp$CheckBox1000timesAction.class…R]OA=S*Ë.c‹P?¨ T]Šº«‰OlŒÁ”hÒÄÞ†åJ»Ù– ¢ñÁà2Þi‹úPp’™;÷Î9sÏ;?}ÿà!¢>®ø˜ÁUóXpK#À5\p7v=4=,{¸-0mûÚ´b¥î^šgÚæe¤Š"êé´ЫR}*7Šâ©€ßû”Ù>Y0í™fìs•ð?¼µwÕN¾Ku•Xgo©|Ÿ—)írÒ°»¯T¤mD”ÙhcyéöL•¨aEbÒêD w$î➇Pb më÷ñ@rÝu'ç*iuú”|x‘=ŠãØê”Ì(—@ã̹™eTvÊ2sC±•íEovö)±͉ú»ÚXb¦ÀTè y®2K)e7-¥¸†¸«"s¨9ßëS[c$7¤–¸Ø?”Æd Cç'ÚôhÀ•¸n°ÖíqEg¦˜5dÿrªá¶+0PIBÆ´Ç1–ùïùàÏË®wl/ ÏêìÏñn} Ú_!Úë_PùË–o­Ùô*+±Õê~ ‹µúÛî_$š*¥ûÓ²vo­Ú«ñUDèŸÐJ/h]íò£¡ûeÈ£Ž®:É¿BV'ù2¢%>ƒ%úP·WF1\ŵ æ-:'±º#¡@Ù“Ñdé+êÐð j{ã!‚‰p²ôÝòÙ>ÂÉðÀ7Ôgé1Y‡ÐÞØÇß?ë5QA]šìÍ+ÒPŽpi儇!Ùѽ¥ìãPK·ë:Õ—üPKpy/%gmonitor/app/SimpleGrapherApp$4.class…RÛjÛ@œµÝÈVä¦IšôB}iâ$² ‘[J 4Œ[J[C ü¶Q¶öYÚ%—Ï ¤­éC? rV8ôŵ+ÍYΙ™ÕßÛßì³QÄJ Vm<Æšu<1è©y=³ðÜBÅB•aA¤j´jÝþ(ޤŽSŸ'‰$GI(>¥<ˆ´$ïJGW‘-;ÔûžaÃ3×ÿÙN ȱpr?÷°Ñ×ÊjÜPKœq9®¡ PKpy/7gmonitor/app/SimpleGrapherApp$CheckBoxTotalAction.class…R]OA=ÓV–Ý.Š€_µXª.ÙöYc‚1˜Mj|àm\®tp¿²3þ,Dãƒ?Àe¼³-ñ¥Â&³÷ÞÉ9sι¿ÿüü`].–\Ì⦋e¬Øßª‡[¸íáîz\ÞsÐp°æàÀŒ)Ýî 4‡I–*“¡Ìóp¨’<¦W…ÌGTìäùSwø%5#2*bÚ3ÅØç­à ÞÆ{Z?; •¥o©ø˜ °h08’Ç2”'&¤cJM¸SB^Úœ©>æÑòQ‡ï`ÝG}<Âc tlúØÂŸûz—:i÷G}z‘¾ËŒŒÇ:KSwýÝ4¥¢K­I ,–&c™†o>QdS}”6ÄLj`o\êHÀ‹¬z)-°ZÞÅi¨O ½¾0Æ7?—Púy×P2A6§#÷&(f,O° ÒCй{ûìqÒÉϨk2ÿ8µ`ß6V—QDZ·{½.ÏÎúUCÀ¬ñHº` ¼nØ'å8ûUxÍcëEÎV¸¶;^ç;Dgó*_K”Àuæ1ÛŒ¨rluÎP9Cuok[ç¸vŽ[Ùôœ nÓžÈq–çÿ>ðPKah\¸Ã/PKpy/8gmonitor/app/SimpleGrapherApp$FileAutoUpdateAction.class…RÛn1=N–nw»´¥ôÆ%$- lÓ–¾!…PQ*"xè›»—½i×½ðYHå"ø> 1ÞÁCh-Y>¶Ï™9ÏÏ_ßx„‡.\w0‰y Xt±„eƒn¸¸‰e—Ñ-·m4m´&ôP•þ¦@³wd©ÒYÊ<û*ÉczYÈ|HE'Ï·œþÇTI«ˆeOsŸ ¬—èÖÞ XÝl@32Ò*KßPñ>+pÒ w(e(OtHÇ”ê°SQžÌRÓXñ0ÏÆª‡»ðmÜóp<X³Ñö°Ž ­ Mø/TL#½ÍRÓ(‡Àüøco'M©èƲ,©˜­Æ2=_ïR¤cM÷T©‰•õÀ¼ºq¡'.G4¤èÃßüKU5NÃòDq¶W]sÿ,;åÚ/Œ½˜*I÷)fW¦œV°gÏ%”íhJþÝ{÷œº}þªÿ8—Œ"*KÿñÖ&÷‹ÙÇï±´¸¸<çÌ?òzfÔxNc†÷³ŒyoNÜöWˆöúgÔ>U,k¬q6P¯8­öjg¨[_`à†ZÖ7Ø”wL<^'¹åÀoPKËÛP¼¿"PKpy/<gmonitor/app/SimpleGrapherApp$CheckBoxAutoUpdateAction.class…SÛnÓ@=›„ºvL[ ½p )­7-làRˆ*JRy[œ¡q‰/òn/|R)ˆ>€BÌ&­ÊCÚÚZÏŒ}ÎΙñŸ¿¿~xŒ¦×]Lㆋ,ÚÇ’‡eÜôp ·=ï8¨9XqpO`Ê b4ê$Kc“Rå¹ìÆI>¤7…ÊT´òü¹€Ûýšš™8bÚ‹˜±/VÃKxë*í¬O³*2q–¾§âsV$Ôç¤agWí+©Œ¤}Jl ¯­ÏT3XõQ…ï`ÍG€û>ࡃÐÇ:6|lâ‘ÏuKg* Úо¼Ê[{&û÷•¡q2åó?ù[iJE{¨´&-07’;TéŽ|÷i—"#P›XA'Ö†˜)PíÔ.ÔÆgY gù–FGs(õAÌÙÞžJäFÌ'”îmJþ‡×'÷O L[˜ðbÝ¥!×b;Âj{'5»—@U“9ãTž-±ª¢ˆ´ž³½ {•xÍ`–ã9ö9¶o¼ÆˆÆÆw”¾Pט7ÆH”ùÖG(¡¼=¶•Íc\9Æ”¬[ù ç”\·[²æ¿â.ðPK*$ ûÎEPKpy/%gmonitor/app/SimpleGrapherApp$5.classRÝJAþމN²®mÜÆ¿¶¢µ±Ý$ê"")Z Á^D[ðnÜ › ›ÝewZðm|o¼PÁ‹>@J<*-^8p~çœïüÌü½¹þ`ëJ˜)C`ÖÂæs¶PÂk oðV`Q`I`™0az:«m ¬fô@¥»¿L|˜t¥Q»¾ÑqD°¿E‘J÷B™e*#l·ƒAi§žL¯£I¨¾¦2éqr’Ôþ‹Ò"”;'‘é)£}.ûI3ÂgÂŽû,´úBq/î*†’¾¯C˜vÛ}ù[z:ö¾èPµêG6*xoàšU|°ñ.§na P·Ñ@“°ôt Û*CðPF÷ý¸¯|®è<¬ÇdT*°FØzÆH„‚›Oe?Ääétv§ðíAÊìËÛU·Þ¾ï¨cR­G]Þù%u³ŸÚôø…ÝsrØÅ'Æ2£¯ Ìääëdùùcª`zèfÙÎ=Vã Ôh^`ì|Ex…ê(fu³Ð¼D¡x ‡eÑ¿ÄãųÂÙ(eŠ¹Ã¡“x›u1ôãPK£Ÿ¤õœâPKpy/9gmonitor/app/SimpleGrapherApp$TimerAutoUpdateAction.classVéWÔVÿ=&ˆÅjÛApì‚ • .h[fCt&I“€ØÅÚÖÖîûj7ë?Ó£#§žúµçô/é9ýÚÞ› ãЂ4çä½{ï»û’—ßÿúå€ÜÐÐŽÝUhà {‘à¥§Š–}*ÓP'5ôbúÐ_‰pPÅ!&ªÒP§˜=ÉÐa†Žh8Ša OãX9‚'òÓGTŒjX‡ãNà$SN1ç[<ÍèVñ £Ï2ú£g}žƒ—q©J¤UÈJL¨ÈhhŤ SÅyY Òôš;6%39Û2}ÛŽ1sNVt gRº½ŽÓ#P5rÑò'¥o¦HlŸI¼ l‰-#×rB@é³ÓR ÆHù¦m KwÂvs2MFcÉsÆ´7.øq9--?Þ°`˜Dut!§#ŽN–ŽŽàêðà“ô-7>hYÒíËž'=Ö7¥bZÇ̨¸¨ãE¼$°®wÊ·;i׉¨eG;2ÙLtÂÌJ/ëx—V~f +ñ]ÓÊèx—Ö}ÈL™ñ~Ã7FÍœqŒ”dc¯éxo踂7u¼…«*ÞÖñ.«xWÇ{x_ÇøP :Ð>å›YVH~¤âcŸàSŸáªŽÏqIÇœ€/ñ•ޝñŽkøVÇwŒ~Ï蜫9=×Ñ-°&PjÚñÁ£fRÒáÄR WÔv¤•®k»”Çû±™ÊKw€Êcø%BkLkÚÈšé(=Fœ²cÞ@ WäÕñrÝ. «qï'=,º@ýô’ä?'STû‹öMÒô|IåˆÄ¸ñ6>Ð F*%=¯y{wgçÿéåÓ Dºš–9Èx2K^Ët¿I®U'ç Ã¥ ÁÚ³Œ’ÅÓL–^ªŠF4K `ÐØ[`‡^_º=-gþm½´³/Rú¨z{ŠR\_䦆÷©í¥‘ë)髲€ê0–å* — K૚‘þ°áO ÔÅZþË"Ð;³„dÚ&J`Créy# «ÉD’2äùd{¾e0ßÚ…©êãÓýö iÔ)!ó|Þ²HñJÔïdõÉåÆe sKô…x\Tr(É› /5\"{ ¤±Õ X;Uã„}l¤ÎºÔGˆÒÝÞNWG½µ|ùо=¸—ËèíB7á;j œ)ZëˆÖm·Q6pmÆNì yÄ)¨¨¢}Gë-”Í!¢\‡2˰2å$·P~c¤CÍ£òpÛo¨gr„ÏFU­–ÇŠÙ¶{¿B?Ù¥Ô+m÷n ®öz¥+•#Wqóï?Yä.ªÇÚï æ6V…ŠWå±z·µy¬™C]êÍÝ!ií]¬kP*ä4æ±>QÒj¬ÌcCèðÆkèc(š(§¨Ë)ª›X›P8Ä–ÑJ£’Ƕbô³ˆà¬(åx$Ø ö&ú‡á«ý Zk©áOUm/ÎÿPKªÿÈÉ÷ª PKpy/?gmonitor/app/SimpleGrapherApp$MenuItemGraphStyleBarAction.class…R]OA=S*Ë.#EP¡‚Xu)ê6¾Œ 4Æ`j0iâoãr¥ƒû•‘Ÿe‚h|ðø£Œw¶cRë&³wîÝsöž3w~þúþÀD|\÷1…>æ±à^‹nâV€ÛX 8]öÐô°êá®À¤hÓê¬ôÒ<Ó6/#UQ_§EB¯JU ¨Ü*ŠM¿šÙY3í¹fì µð?¼õwõn¾O [go©ü—)ísÓ°w¨ŽT¤ŽmDG”Ùh«‚¼t{¦JÌ`MbÒÃ=‰îK<ÀC¡Ä:Ú6$á±dß gc•´ÞPöiÇRZ•úö4¡mUû ,ý*w²ŒÊn¢Œ!#0[‰NTví¾?¤Ø 4Gúèic‰™¡;ˆæX…sñ€âIX¬Îè$2Çš¾î:Èv~™OG‰v³ɸ´¸y!÷Ÿ@›>%ìÌM‰µïq³‘iCö¶î9£Šc2¦õ´ÓÁ*ßE\ã5çfÉñ*ÜSã5ƒç³¼[àÜU‚öWˆöÆÔ>W(kÌb Ìrû µ3L CýWÎ1é’oð.Y+î_§øÊß~PKâ’¦™½"PKpy/@gmonitor/app/SimpleGrapherApp$MenuItemGraphStyleLineAction.class…R]OA=S*Ë.+EâG+–¢nã£lŒÁÔ`ÒÄÞÆåBö+;#?ËÑøàðGïl!ƤÖMfïÜ»çì=gîüüõý€§=¸˜w1…Û.P·¯Ewp×Ã=Ü÷8m8h:XvðP`Ò ”nu–z‡I–*“¡Ìó°¯’<¦7…ÌTlçù–€Û?OÍ€ŒŠ˜öB1ö¥ÀJðÞÆj7Û'šŒŒÊÒ÷TdEBûÜ4èÉÊSÒ ¥&Ü.!¯íž©>f°âc¾ƒU-<ò±†u ´lúxŒ'>û® <«¤õŽÒO;†’²Ô7ç1õTJÆñŸý4¥¢K­I Ì–²c™†»(2Í‘NzJb¦ÀD`¢9V£À|4 èøo ‹å1…úTqÇ·]‹y•ñPêÉHÙvž#)×.·®ÿ à)ݧ˜½ÙI±ú=…‘iMæ¶ìY«žŒ"Òºõ¬ÓÁ2ßG\ã5gçÉñ&ìSá5ƒç³¼«sn+^û+D{ó *ŸK”À-æ 1Á¦Ñ¾@åÃP½ÄKLÚäœkÖ’ýÇ)¾ö€ßPKÙEE}½&PKpy/@gmonitor/app/SimpleGrapherApp$MenuItemGraphStylePlotAction.class…R]OA=S*Ë.+EâG+—¢nã£lŒÁÔHÒÄÞÆåBö+;Ã×Ï2A4>øüQÆ;[ˆ1©u“Ù;÷î9{Ï™;?}ÿàB.æ\LaÞÅêöµèáîz¸‡û§ MË LšÒ­ŽÀRï ÉRe²"”yöU’Çô¶ù€Š­<ßpûç©QÓ^*ƾX þÃ[ÿ(Píf{$P“‘QYºCÅ~V$´ÇMƒÞ¡<‘¡<5!Pj­òÆî™êc+>¦á;XõÑÂ#kxì 𱎶ƒ OðÔgß5c•´ÞSz¼m()K}sÓNœ™aCÆøÏþvšRÑ¥Ö¤fKÙ±LŸ)2Í‘NzJb¦ÀD`¢9V£À\4 èèo ‹å1…úTqÇw]‹yñPêÉHÙvž#)×.7¯ÿ à)ݧ˜½ÙI±ú]…‘iMæ¶ìZ«žŒ"Òºõ¼ÓÁ2ßG\ãuÛΓãMاÂk5ÎgyWçÜV¼öWˆöÆT>—([Ìb‚+L£}Ê&†¡z‰—˜´É78׬%û/ŽS|í¿PKjã5¾&PKpy/Bgmonitor/app/SimpleGrapherApp$MenuItemDifferentialModeAction.class…R]O1=]V†* ** ˆ‹‹:_!&¸ƒY¢É&>ðV‡»lq¾2­€?ËÑøàðGow!&f&íímÎé=§·¿ÿüüà¢>nû˜À³˜sË|€Ü p÷N=Ô=¬xx 0nûÚ4Z˃4Ï´ÍËHEÔÕi‘ЛR}*·‹bSÀï~ÉlŸ¬Ž™¶¥ûB`5¼†·þA ÚÎ÷I ¦b«óì=•½¼LiŸ‹†Cu¤"ul#:¢ÌFÛÈk·gªÄV%&!=<”h`Mâ{%ÖÑô°!ñO%û® l]©¤±KÙçKé+ÝëQÉ´JvYذ¤ÀÒu¹“eT¶e éôDeÑ»‡[úH7m,1S`,tÏQ¿R§ÀlܧøÓÿ*æu™cÍ5ß¶êe~­YH/‘îú:’táuó\ô¥@›.%ìÏuŒì±Â‘ICö¶î9»Šc2¦ñ¼Õ ÿK|Æó–ë+Ç›p£Âs 5Χy7ǹ; šß!šßPù:@ Ì0oˆ Ï1‹ÍSTN16 Õ3Ü8øK~À»`-»»8Nð÷_þPKQб¿.PK py/8gmonitor/app/SimpleGrapherApp$MenuItem8timesAction.class…RkOA=S*Ë.c‹ÈÄ KA·á“ Æc05˜4ñ߯åBºìŒ<~– ñƒ?Àe¼ÓBŒIÅMfïÜ»çì=gîüüõý€ˆø¸ïc S>¦1ã^³àa€Gxp:ç¡æaÁÃSQÛÕ¦Þ˜o$YªmVD*Ï£ŽNò½+TÞ¥b+Ï7üÎYj»duÌ´Wš±¯ÃÿðV? ”[Ù TUlu–~¤b?+Úã¦aûP«H؈Ž)µÑVòÖí™*QÁ¢Ä8¤‡%‰:žI,cÅC(±Š†‡5‰u<—ì»*°q«’úJ¿l[J^Z4˜^–ÛiJE«§Œ!#0Ñ—ÙSéA´óùb+Pª¼­%f Œ„ÎzíVMãq—â£AoÙþqœFæDs§÷-÷íMvʇ_Iþ’éæ5zãfóZà?6ê±7 V»+0=”Â* Ù?Ør¸ë¬*ŽÉ˜úF³‰¾o>¸ÆkÒÍ‹ã]¸§Ä«‚*ç¼›áÜU‚Æ%DcíJ_û({Ì`ÂkÌ\ã¥sŒ Bùw.0ê’+x7¬y÷/Žc|­Ÿ¿PK|áãüºPK py/;gmonitor/app/SimpleGrapherApp$MenuItem1000timesAction.class…R]OA=S*Ë.c‹€Tª,EÝÕÄ'Œ 6Æ`j$iÂoãr¡Ý쌀?ËÑøàðGï´ ‰)¸Éì;sÎÜsæÎÏ_ßx‚(€>&pÓÇ4fÜo6À-ÜpwNç<4<,x¸/0n{Ú4cùÎ^šgÚæe¤Š"êê´èÓ›R=*׋bMÀï~Êl¬N˜öB3ö¥ÀbøÞÊ–@µï@]%VçÙ&•»y™Ò ;ûêPEêÈFtH™Ö×nÎT‰%&!=,I4ñ@â!–=„+hyX•x„Ç’}מ_ª¤ù޲–Ò§q[’Ö˜½pGnd•í¾2†ŒÀÔ@l_e{Ñûû”XÆHým,1S`,tиT™@-éQrð§Pì‘yCLx†™k r‚±a¨žâÊ)Æ]ò Þ9kÞÅq‚Ÿø=à7PK _;¼PK py/8gmonitor/app/SimpleGrapherApp$MenuItem100divAction.class…R]OA=S*Ë.c‹Ê‡Tª.EÝ•WŒ 6Æ`j0iâoãöB»Ù þ,Dãƒ?Àe¼ÓBŒIÅMfïÜ»çì=gîüüõý€'ˆø¸ácó>°è^KnâV€Û¸pºì¡áaÕÃ=iÛצ ¬tÓ<Ó6/#UQW§Å€^•ªèS¹SÛ~÷Sfûdu´gš±ÏÖÂÿð6Þ TÛyê*±:ÏÞRy—)õ¸iØ9RC©cÑ2íŒ /Ýž©5¬IÌBzX—hâ¾Ä<ôJl åaSâKö]غTIó ew-¥O㸧‡ãFó“Ër7˨l”1dæF2*;ŒöÞQb•w´±ÄL©ÐYo\ªI`6éSòaÜ[`it'‘9ÖÜéuÛ}{‘Ÿðá×Ò¿dºyM„^¸Ù>øO€@ M—ìÅM‚Õî ,L¤°JCö¶î;kJ2¦¹ÇXåûæƒk¼®»yq¼ ÷TxÕPç|Žw‹œ»JÐú ÑÚü‚ÊçJàóƘð³Ü:EåSãP=Õ3L»ä¼ ÖŠûǾÖwßPK¬SÒ¹PK py/7gmonitor/app/SimpleGrapherApp$MenuItemTotalAction.class…SÛNA=½¬ 3;ܼ­ ,0,êìúŠ1Á1˜5š¬ñ·v(؆¹eºü,DãƒàG«g!ø°Â$=ÕU}ÎÔ©®šß~þð-.f]Œá¶‹9ÌÛׂ‡;¸ëáî{ì>pPw°äà‘À¨é+Ýh ,v’,U&+B™çaO%yL¯ ™÷©ØÎó-·÷%5}2*bÚsÅØËÁ ¼ÕN¶G“22*KßS±Ÿ íqÒ {(e(OLHÇ”šp»„¼²{¦ú˜À²|+>Xõ±†u 4lúxŒ'>× ´¯UÒxKéçCɇÌÈxG`vhÔßIS*:±Ôš´ÀT)2–éAøîÓ!EF >TwWiCÌ láõk xQŸ¢£2µÀBy§¡>QœèMǽÌNùæÇ“EÚ^ E^–²u!ï¿N¬tb®Ävµî Ì ¥Ô4™+l5ص…Õd‘Öv»Å³³rÓ0K<’.85¯ÛR¶ã°O…×&ÙŸâÝ<û6â5¿C47¿¡òµD L3o€yvYkž¡r†‘©žãÖ9F­søç’¿h¿ÊvŒÿ‡À_PKNûjÁÁ3PK py/<gmonitor/app/SimpleGrapherApp$MenuItemAutoUpdateAction.class…SÛnÓ@=›„ºvL[zçZŠiÝp‰—"¤!T” ¤ò¶8Cã6¾È»½ðYH¥ ø> 1ëPå´µ´žÝsvÎÌìþþóó€Çh8°1gcó6°h~K–qÓÁ-Üvؽc¡faÕÂ= Ý”×XiïÅié4d–(Îô&—YŸòf–m Ø/‰î“ŽB¦½ˆûR`Í¿‚·ùQ ÒJ{$0-C¥É{Ê?§yL=ê·÷å‘ ä±èˆ4 Èk3gª‹)¬¹¨Âµpß…‡.Ö±aÁw±‰º…-ñÈå¼ç—*ñv)9ÜÑ7uú!ëIMÃ`Ëo¹;IByk •"%0SÈÈd/x÷iŸB-P›A;Rš˜)PöM j—jãÚ„} Fñ–ŠÒœê8âho[fÿUz˜ÿ“kú7~žÙö?¡œHuhÀ9™Î°ê®ÀÂXŠ@U‘a+~פX•aHJyOž6ø>yW]Œ.“°Ê÷ÔÇæ1kúÌö:ÌWâ1…iögx¶È¾Yqêß!ê[ßPúZ n0oˆy†rÙ¨Ÿ¢tŠòÐTÎpí Æ-T~À:?`ÅËv’_Æ]à/PKMTøÌIPK py/=gmonitor/app/SimpleGrapherApp$ComboEventSelectionAction.classSKo1þœ†.Ù.4 }P ôA€M x›=€*•¡¢ õÀÍݘd«ìCk«-…¡R ˆâÌBŒÝ‰ª ¬4öØóÍã›ñþüõí;€Gh»˜Â\.æ],àz…–E7pÓÁ-s¨›ëÛfYr°ìàŽƒäĪ0,…ý$Kc\ä9ïÆI>”/ ‘d±•çO*Ý©HGäö4&ì&êÿ¿æC¹“õ$ôˆtœ¥odñ>+Ù£¤~¸'öšË}™j¾e!ÏN®ª¸ëá ®:¸çá>|M´¬yx€‡ Uë>iŸwu§}ZÁ=¹Ž†±å5:Y²›Ùt]9”6ùi ‹clÞvšÊ¢3JIõW¯w÷ÊP¿X+-É“aÂ7©­ŽÁQ$•jlÁÿôúyDªfX°í=äê€ZÃ_ZBϲCæÜ…šQ_ŽØÊÞ¶– Ã¬ß ÏÓ£5%õ[QÜæz%šp- íX–´»›Ýð¯øä_ $>ŸýQÆ;[J Ød>ï¹÷ž{ÏlýþþÀ*&’¸‘@MÜÄP‚¦¬‰[60¢·õuNïîè)oâ.îé»ûz*(x`à!C·ÚpÂ|™aØn´<×Q^` ß·ªNËoÊWð7d°èûs ‰êgWmHåÔÈmÞ!ìC®p_q!^ñê’!)jÊñÜw2øè-Y§¤{Sl Kl+KnIWY‹ä¥Þ“+GcýH°8Êç˜À¤GS˜f¸¹7…Û°ª*pÜÇ s<ÑÈYLrÌaÞÀSŽ<ãxŽEŽ%df;²ÎW¼Öº÷Ú •+Z²*›2¢Õ&Ç0ÔÙÌ—]W•¦CþÃñíú&A²gVm;¡’äÉ+è¶e;rd0E­&Ã0?S.ÿïzkg¸µÇ ·©uÖJTÖ’·CbgÎ4† ©ÚËú²’-†t¡hŸ®ô‡R­Š€à:Ý›(]Ê>-{ŽªŸÖe˜ÃH£®ª¾¨‘çÐIqOŽõB(±êP뵕b žo¥wK¢€¤E¦PüБĔ&a_ÔËsÚvFh­ã±Nå2Fè£M‚”~Ø´^…þuÑH#CçÚ ÐYߘ¥o`¥Ñ}tíF(Ò ×0kˆE˜•Òº‹E|WïõØCü—~¢{FÛ~ù r'ÖD{1ÐsÞFôçÕ™ií£‹ðPK†»zKyPK py/1gmonitor/app/SimpleGrapherApp$RepaintAction.class…SÙRA=–1à eA£† L@ÁDÃ"‹AРúÔLšd0³ÔL³}Š_à³U)ü?Êòö$lÊ2U=}—s÷Û¿ÿüü`ou´¡'ŽzuÜ@_7qKýúuÜFR'êŽbï*öžbSŠБƠ¢îëx€!õ3•6£aXÃ# £ ²d‡É C_®èx®-½Àä¾oæmÇ/‹¹€û%d}œ!žßueIHÛ"³ ›°“ ý© ì>0ÔO{ÁÐÂ-i{îŠÖ½À šÊmð-nòmiŠ-áJ3AfM¦:1fà*Ú5<6ðcžx†qx®aÒÀ ¼4Å”i%žQ쬲z…9 ó°hà5r– ¼Qšeõ[AÃà¹É'ß ŸÛ®¬&ÅÐüo,¸®¦Ë< EÈÐÕRænÑ\^Û–dè=µ¼œJA– u)ÕŸc†ù]R9 ±"u¹÷Üì(ËsÖ¼y/”.w¨ÁQ7wÌpÛ&W‹ÓJ;åíÐì´‚ÌûÜ"LÏÑ¼Š›¶9Ã%_µi Ø}¶–ê- yêmO |ÊK]–|4qËa˜ÍÐbå.Ú3’>ŵê•Õ-­$%‘”MK(dd¼Ê“¤Íîæµ3»)½÷~K¡öüd¸’°>S¸¥t¼6³3”æE™Æ«6˜ø‘¡AR“hœWN8W Èaâ?!=‰Pz4Á†Pò€ Ñk-Édè&轓3:mj÷éî€úbt:ÑEü5¢:ˆW=ý,=ø±oІˆë5L€º³¾ºôbê졾z5TиíH~éP¯É+ä=’5U`|Aw•i®àò!ÕòµŠÙGëAü‡*+ºTËðPK›SŠ”ÉPK py/.gmonitor/app/SimpleGrapherApp$RepaintNow.class…Q]KA=ãG«ë–fe_H>l­ôZ"T$ô>­“Žèì°3(ý¬ (zèô£¢»KAa—{ïpÎ=sÏ||¾½8Ķ‹<ÊEäPq±Œªƒ5ë v(M£Å°ÓL"%m\ë ''z,Îc®‡"nk}ÌPì=(;V†D;‘„=eØóÿáíß2ä:Q_0”yhe¤®E|ÅÑ'Q¿;âSð™ ÄT(´SÈYRÕƒ‹  6=l¡ÄàÏÕkÜÍ¥²—ÑŒÁýÝxJ‰¸3æÆÃPI…Ç\ ‚«»‘-CýÏ·t¥±‚˜ Y?Y¦>WŸDy cG­vÉò<È.Šj²å"’“¡pQ¢Þ£ªF}zÓ|k<#󘢱ôY¥œ` Í'd^‘ýA¬¥“ÈdúÙUà PK`—“;õPK py/:gmonitor/app/SimpleGrapherApp$MenuItemFileExitAction.class…QMKÃ@}Ûck´jý¬Šô+Þ¡H•BE¡à=¶c»%Ù„d­ögyŃ?À%N¢‚­ ÃÌì¼7óf÷íýåÀ6òÈ¢CÅìgL\CfÀ™ñ£,I KPÇËݼؼ8LsYU‡v€ùØËÇC*îÉÆ½îÃý*Pñ°ŠGd¹Ý†S²\ÁüÆXÂ2 ײ#z2i5ɸÜbëÉniW'“U rZ™n·t(‰­7ˆ÷& K¯"W¶[Af­Õ)äéQ×°ÌiwYvBv’ÑÒÆ}ú=¢t#ò€4ÝHµÇ²™a؈GÖcƒŠÃáq'𤊧žÆg𬊣Ïáy/¼Èì/á˜á)6¬H½—¬çeWðªÀk8®PÎ1s˜¡¡ysoT&Ù®À ¼®â “xSà-¼-p §ÞÁ»ïá}3ø@àCÖ1ÝS×ÍX¤Õµ 3&ðãg$$ÖcDêtWßi$dkRz~|,ð >ø Ÿ |ÁËY|©`š§­Ç5â,âq~¥âœ@RýPñµÀyc ­×ôtuI[à\àeHà[øß ü€~ÂÏùø Ŧá$xZF’@‘qÎXIi.¶mÙËTü&p ¿+X}Åj—4I³§Á• VÐLò~9ÉÛÉ¢Á4¥]×G:ãrÚܱOF]óÒvH£á¸’$d”r‹Í»¢_ rõhT:NÉŠ•Ë©ÙK®Öµíí¬4?x]ÝãZ»’T¾(ìPoÄ9HIl«í–Ñý5Vïp€UÇ“2/Žt[eœ¢ã;YêÙÊ‹2ßXCEé ‘Â´!—R2sœ$wŸMR3.C’qǵ(;ÑÛ¦äÖ6yeÙ‡Zt·›âoœØdl¼ôr,%{©&ŽWvªdLºµºIIŽêq_]AiY:…Ó: =nņ;ƒ.ÐøÀ™PÛmYŽŬÉh6åµvB vào0 <_³©èõ¶ž ,L0ÆXvÊé¶²;užsT1£ªÖJ$-ÓQ ~¤Ãåd Û,Û;Þª‚©ÄÖ¢³sŒ ±álŒ²PcøjÈ}ra"94Tw8V¼Ç•~FUO'CáÒ½éË¢vºÞèQ0·qòÁTå‡Q#c†É㇠^%·Q0Dh$œãŽR4nÑzšâºËŠ=Ë®ìuƒ›T7B­â߯ŽÌžœ‰š§+J‚4 ª´=3•õxÞúþÌ_ÅD­7d¼³*”—S(3Ô.|¤/kÛAHSµ†4‰¼4]Ÿ_†ò§.™™CQNNÍv-C®G­D‡µÕr\ÓkÀ‰×œ©þ5”øa>‡/^Yšmkx´5^m´Mbn’öуe–w ùÆßf¦P°aî eN€M¡Ð-ÏX™B¸E|ðiE)ÌêƒV>tÅ•™kC…¡ò¡Ó(,Î$ 0Dü³[‡”3ÿýÍüƒ˜ÓVœÙ¹}˜çËÏKášÌ—¡‘óµA€ ±¨-êGI ×U±^_œ“ a5’(MTha-çØIdišÏ°xKÚú±4?/…ò°–²"$2êóòS+°r¿j¿:À`ÍV†ò+*³‚Ôg àÆ³TÊU؉=˜Ž?•#ÊQ¬õJù˜öuôœ}øPK7¿÷ùÔ PK py/#gmonitor/app/SimpleGrapherApp.class= xTEÒÝýúå½yy@®ÆpŒ€r.!á$ ‡‡Ì L2qfÂá}®÷Þâ/TÔLÐñ\W×ûÜu×uÝÃu]u]×uUþªî÷Þ™üãGWWuUÕÕÕÕýzv_þññ§!Õ÷\ô ö©É_1÷&CôsL¾@ôKLþŽÉ?0ù'&ÿÂä+L¾F¾cò ¢ÿÁä[ý× ì;Lþ§³ïþ`°Ù~`Tˆ®P]aÀ©(ˆs]QÉÑ ¡®+.„†®ä"4ueÂÁº2a åëJ"…ºR„Э+CӔᙤx9ÄPŠ•˜iwdn”¦Œ6ÈtÉàÕ”C R-‘1š2Ö GIdœ¦f£Až—‚ã5åpƒÔÊâM™`…P¬”Êâ2M)7ÈY\¡) Ò(‘JM™dc$2YS¦d…D¦jÊ4ƒ¬–ÈšRe5™®)3 ²N"GjJµANÈLM™elù(ÙòlM™cVY|´¦Ì5È&‰ÌÓ”ƒ´K¤VSæ¤S" 4e¡A¢Y¤)uÙ"‘Åš²Ä Û%R¯) 9E"š²Ô §+MYf3%ñƒN‘ÝXŽI&+0Y©)« räZ­)Çäb‰4ëʃ¼¡¬Õ•ãp‚Ö!ñxMYo’ãL|š²Á ×IJ‹¦ø rƒD˜lĤUSÚ r«TF)›4e³AîŒ!Mi7H·D:4%l{%Ò©)'d7 F”(Rb}IéÂÜL¶jÊ6ƒ< 6L/Q¶ÊI²›'ëÊ)8墭S5å4]9Ý O(ghÊ™yš}§)gäY4ý§•³5å0$žk}ÊyhKçcr¦\h—•‹0¹“K|)&—iÊåºrjèJįҔºr5ð5šr­AÞW<º²SS®7Ș½ÛºQWnÒ•› ååVÄoÃ^íÂävLîÀäNìô]}AéÆän]¹GSî5ÈgØÝç•û §ÜÉnLÐXɃù§ò&{4åaƒ|ÓÿˆA¾Aø¨A¾Uz°®8VÝ‹É^]yÌPWˆ<¡)O”(×`ò&OëÊušò r<‹ÉÏ1yyŸÇâteŸ¡¼¨ü5zYví%D_Æ©ø%LŠòŠ¡¼ª¼¦ñ§|ª+¯ëʨ°7uå-]y[WÞÑ•wuå=]yɿҕ_ëʺò]ù­®|¨+¿Ó•tå÷ºò16ý‡œ£ÇÉÊ åÊŸôgL>Áä/èn>Å^üUS>CsÙņ)Ê?ו/ù“¿ëÊ?þSWþ…6ò ~Uü“oP©ÿAÚ·˜üi`]Ï)ÿÃä{MùAW~Džý'œ¢E…­}…(ÃDÁ„c¢j<Ç ËÐ:—qMãºÆ]mâ&¹H45>úÌc2“<Ì×y˜åGa2¯ÎEòLÆ"e&‡a2ÆÈ7x Ÿ óR¬¡ ¹Êu^%‘RiÐwù$D'ë| R¦b2MçG ¬ÂdºÎg <¦‡Wë|¦ÎgA­Ê:¬ú(” «—¥ñ9:?Íä0>×àó”í¯ÁFkqˆó1Y€ÉBLaR‡ÉbL–`RI&XñR\L¸pø2£óå:oÒù ¯Ôù*û‘¯6ø±¼Ö`²“ãt¾̃¯óõØö °÷qŸÎ7è¼Eç~t¾Qç­:oÓ9º¾I盆tÞ®ó‡aUñNŸ¨óˆÁ†áQP˜ƻ º|°lÑøV;û¥·a²““09“S09“Ó09“309SãgéülP¿rÎÏÁ~ž‹ÉÏ09“óQ©`r¡Æ/2èGØúÅý[ûˆ_‚É¥˜\†Éå˜\rWbr&;0¹Úà×ðk5~";u~=Âq¸nÇÜ ØÀ¿‰ßŒÉ-¿•ßfð]üv¿ƒß‰¹»0×|w£Ä=˜»“qè´ïÄÒd}÷ar?&»a5àiâ`¢!íAõôýò§ø!$íBp)Àñ°ÎÑù£:ïÑy\ç½:ß«óÇtþ¸Æ” mttÕÅí ‚¡ÀÒÎ@ÇÜ–X0ÜA‰Y×шԄ|Ñh šÁ7[0fó˾`G¬1¼•’Abލ ·o/ Gc¾ö@S v±GÏßèˆõ)n78·+^Ùé÷ÅvQ¡]´"ó…lj‘M3ÒÈ£lrmpãÆ@úô…Â~§ù6ȯ³­)¶=X ÇP\ìp¤‹ûÏóEìR÷ èJ¤ï‡×´Z6Ï oë[T„3’EI¶Dº’lj†’RÈJ²K2”d“ûSRͪ‡˜ª|›˜¢†áÂ0VvûÚEÁò@Ô×Þ ;üÉñ×uÄ‘-Éç.÷ùƒã°UÁhpC(PîˆE¡PÀi2ß*ÁF¶,š˜¥LƺŽNµƒíNÙ„<1» ᮨCrׄ#˼í+;Q—ކ[º"¨ÀÚ –†#Û—ùbmÐvý&ß_eÈ×ÑZÙ‹;ZgBÛÑ@l…/Òˆášj„5ŒM,$IL2âx$Í B¦©6òm§„ÖAŸ¢B½?V]ŽcãY›­uÍkêôµ@U#ê[ÛÃP[8RÙÚ¬¬õÅ|h¸¢E|[‘ÖˆÑy¸em]±`¨rn$âÛ^ŒÆ€Om‹æ¼éÕYº´©°øúÌ0È£#Ð]Qÿ¶ÊèVèh¥XBØ QZÕ,ùZaÀk šHŠõ„º,±µSs); Wâ‚zt_g炈PaQZC‹8 ìh¯ÝCÝùX`[¬²)ˆmÕ:¥8ÎH¸•ƒÓ¼,ØÜæb±ITÌ’pZ$êBTL0 ób¦P;+.D‰F4¹ ,~\rÂŽ-~Xm*Šq™Z¸oè Å‚¡ ª—Ö CbrÕˆ5 cÛ­"é}PjÑ0,B ìSâ€+„~¤ÒG!—ª f§àà¨oKÀ«ƒ~\(C¢@°µ-f³ÔÂìwDå“SâÛ«t¨3mI‡2$Û}­ÁÁÑv3 }1¬%0ê>ÃÞ¬Àâ`} \.²¨´°ü•u+Ö/[>AݱëWÌW?lÛ6.¹ê…<ƒå , ¼(wü(/ÝØDsà&¡ãl“ß^TNq-¬ì0®R“¾&[+.7†f³t³ì¯+nÙ¼B®!=è,”A-è‘Ñö$>Xà²ç‚‹rËa1Áh!4­@'Ôá´Û}¡°µ§¬‚ZIu–ÀPËO ,ˆ„Û—ÁŒ"Â(Júº «`H5°‡%åDgù:ü`‹à`”dK)_¸²ôÕî6(ä:µ”–¬A\I¶œ^žÄRWŽZ²F0æûav[íY ¤¢¤ŸùÉâ;±ìd^ 5ØQ+ª†.ƒmó·µ:±Ù¨äÀÙX’À‘Û ëŠ` WåŒ,ºÉÒP6¿'+š»-­÷m„Ž¥d|6MŒ,¬ C’pYC';… «ëð¶¡^O€må0 7>·¥%ñC]+Â5rŸƒ©iŠùb]0àñÅ7År°²Oh%‹³vuHK8¼yYjw†–Ôe&t°H,ƒðÆåéûTyIÖjB?Ûì±¥rò¦`cýL<¸nå¢@Vˆ‘Aÿ“îD(É™…&<Ùš¥M`Îh‰uuX™Ž»´¬ËŠE@ Ú†8‡x3nŒÒ¤§CŸÒ¶VkÀ3'd§ÏÀâØôh‹¯£V/%3K÷SËÚºWƒã_ŒDchêÀ&Nɘþju„až£ @#Ñ6[*¤O€púÝìz¦`=c¬gURb*JŒHbMªÈ´©#²8UÓ¦ÎHA®“©â¨9âàÄëR%¦D‡ëREª°‘$’Òüôƒk~MRbJLû‰“k¹»Ž#±ŽªŸX‡$k,9(;ά¤¿ªs“|0J^#Ö«-#ÌÞÁ„ñް{·–BSÓª˜Šp°iieÂnêÚàÚÇSšJmXX>«%$<¸ÉNdǘì2v¹É–aîL.a—šìbv‘ÉNFt+Ûf²íì$“E]ÎjMÖ€I˜ušìB仉o².¶Åd16ö˜ÌÍëÂã·Éî>þ‚ˆÔc„ÉŸâOkü“?Ë®3ùÏùsÐÇ”C…sˆ0Ù:èž¿ öQÂddzcÀ’’‘ÉÖ#Åå&Lvtû4a2Ÿ`pŽ&Û êHž'LÖÂü&ßÇ_ÄÛ…,' “P¤(Û‘Âd±,¿ÏÉÁdmX0í€3=.ûeªïy“ÿ‚¿¤ñ—MþKþŠÉ_寙üuþ%S\e¶Û“¿’?¡3É5“¿É_£¤ìÀ²i÷l&‹mÍþÀ"ýÞµ™üm¯>ñ~nòLþ—’ÊjȼçÑø{&%'œdòÚÈä¿ú rÉ;(“ÿåfœ\öË-“€u `ÙîÍLþ”<âà$3îâLþÛŸÐlêýžÉ?DÉÉ'™r_hòß¡`ÕÁ ö]ñßSräÁ­‚,סÿØäÀ:°Íݸšüÿ¯RmæOXÃ6sà[c“ÿë`ò²]H›ü”Àfú¹ä6ù_~B³é6ó)J`3Y.âMþWÀfú»Ü7ùg(=u _”õ&uÂ>3ylò¿ñÏMþ&_bòwLþnp cïçbÚäÿD—?€t×Ô&ÿnïÌ[bò¯ø×”Ð &ÿ7;×äß`­¸¹¾7â&ÿ›còoQ¸ä v’ÆðV“ÿ—‡àƒkÌnè;ÔÜÿ0ùgn€= ÏݹÉ€8‡ÿˆ² ³ïe¼É÷|›É‹}S%±¤úùR`ªTe”L<°pæõ¿¦*¦ÊUÕd+Ù*SÍQ5SÕU—ÉV³cᘛ¼_ÀË!S5Ô\M5Muê‚3ýTˆ-M¶-¢¤0KDN‰GÞ1z}ÞnðÞðFo—XÚ¨ƒ))H1œÌKÑyáˆ?©÷mwÅLuˆšgö‰‰ÓÌóE+ëÆaŒ°4è¯ „BËP¯¸¡ÏBžå›jZhªEª›oj›µ>ˆí–ÅwSª3ÕáªÇTQ‹Mu¢#U%y™‘1%9– ÔQêhSõªÅ™ê›×‹¡ß`K—`x.%£<«“)!Po¯£87œÔÆp$Öfª‡ªcP.€‹&t¾/ÓÔ±¦:N=ÌTÇ«‡›j‰:Ád{ ŠWKÕ2“=ˆÁ#[jªåj…©NdçCdoÍr~«±Æ’q)eª• ÍM2Õɨ›)êTˆ–ûœ2QõÓLõµpÀQLc%ÃÒZhjÁƒV†í”™jžbjàd£NWg€w¯i ‡£o¬-àõÛ_½¼[¡º€wbk¨Õ»"â¨×h ¬>pO¿¦iªÕàÙlô”fê7S‰JšÅŸ¶µuK«US=JmªsÔ£Mu®:ÏdMl…©Ö {ycØ K<²ÏŒz£–àÆ`À?Ñ‹Ç,¾@‡"ÑØDM…ÌWǘêu¡©.âO›jºØT—°+5µÞTÔFpÝ^Já2†åè÷®¸ÛrAÏ‚!Ÿ¸®+škç½µÁèfhX|Wãà0ü” Y ­@ à§E¬Ïe*tÌÇzçA[åG†·…æò4Z~c ¶5Ùìݤi¡°ÏïÛÒŠß çõm D|­o Œ óÁh7lám¨²¡3j²([ ©ËMµI]a²3ðœz&§cr3ÚëJuUÆÒ],vZ¹ºìÞTWÃŽ¤«Â)Yñ.™gªÍˆ¯ÁÉä^lI]+·@XÇát®S7Ù|¶Àdu t¼mè v¥Év`²„¾OP}¦ºAõQ2<ùµa™/ 8s‘_]ì³A¿·]/z¯üºTÖ%⯸–Så G$wð¦Ú¢z4Õoªu£©¶ª°”ƒ˜lR7›jHm‡‰ÌvŸhªì"JŠp×HɨßEšjÆ©vâOT#¶e —bÙQ\å1ÜNº0Ù¢n…íd~$ŽT{;Â8fšë6“ÝÎî0ÕíèNŠOÆŠOQO5Ù ìF“ÝÆv™êiH;]ϵì:S=™ÏÄä,޼-À½ÅTφrv5»ÆdÀšTÏÁä\L~¦ž§©`¨R¢×ƒÊ£1ˆjÔ‹pÒna·ÂìO¨öšì,v¶©^Œ1Ø­&;ç^mðmCÞK|)»)0/@¹ )—#Å5WZ,Ô¡^¡õ*u˜µèZ5¬­Ÿ e“=Ì1Õk±Kש;MõzõS½s7aîfÌÝ‚¹[1wæv¡Aß®Âܩބ_Ì&F!òŠø zJætEذ·ÞŠM¾ˆ×nzêDÄÖz+À•ˆ¯ÉÒy0à]GÉ ¯üÎ6oò‰Ö½ëð¦>¶ln”EÊ$E»¼ösX’•KæU¢—˜ k¨h „:±­Ê¤@EG¸cq¶ºë pˆB‰út‰`òûn’7Šq]킎$±' ó®3Õ»ÔnM½ÛTïÁýàhð#l.&óЈ(hú^BûMÖê>U œGJ»ÀZ¬NÖ,;,IØY˜›ôþÛ}3Õûqò4«s¦ºÑAi½gÖ&>ô-¯ Fvùö„-™\¨Wð~÷±u[_j8e}A„fý`f(ž/˜ 1[>–­Åä8D[ѽ1ÙÄ@›1 ±v“u°vk»Ïòm—’ܱcÇ–Ëàè] ­ÑL4ºv.Ì pRR÷˜êÃ*,¤GÕp•N,º0ôÏóµBØEðdµ¯=SJíP5Ž1E/&{¡‡êc˜<ŽhB}ÂTŸÄä)LžVŸÐÔg00z–’‘ÔF‚wÁ¬Û]7ÙÝì. <®©Ï™êóê ¦ºO}QSaª/©/kê/Mõu˜¦¾jª¯aÓ¯£G~so²Ý&{‡|?æg “=ÊzLö{ÒTßgËö²ÇLõmõ“ÅY¯©¾«V€QnóNžtüT;SegŽÛ™ÉSœÜNn†›2ÙÉAdæ(^‡Ú¡BòäçÏÎ’WÎø‰0¶Cí¢’ìShÛ£€€ J~ð7À„"¾–XMÄúo¾Ï§W7~L‡C_Çê`¬Í:,àGؾuˆïE Pî‚€k@þÚ µÐõöŒ«â>ï1ìÈffæaÉ.€ÕëóûåúÃn:põŽ)I>F‡µÊtñað<%ÛÎxì!c+|J‘ÚÍÔ— iýÇÛeˆ*e¥’C<×4ZRž´ jI½á_!^}¤]Ëõ}“b]ýõÑ]›lF5õÂñfR— ßëÔÌ4| ty+f?Gqnºìby{…ƒBÌzÓ1D ©Šq·g»p„CNö‘¥ÌòÈ2¤ÌEæ`³ÈñoïçÒ_"¥Ý‚-µg^ñ¥0ÙcÔžz!sØÞçž æÐ&f\£‰w{¸ãˆÃØñ1õ…õ Ó‚&ÃAqŸKÖ(73ÛŽ€Ïr`(2Ž=¦IZƒ¯"r9èÃôYî¢òË0Ô˜¼ò:4ý}ª1õöKHè°+Y‘ÞÈ’ôÏíi_hÒ­öS ¥_-àc1ë¬87Ög%,ݰ N<ðû#gÚû:‹Å~š&B²¹,ë5¢1_$ÅM³Ÿ÷ykäC&ÛÄ¥/T Ù䎎južãÍÌÞOêàå…äŸ8ÞÀz•/Îæ·wƶË"Toü¥ëlƒ(³¤gÊ)¶ùG•€Uì¹â5¬åŽ˜\\ÃÒz/ï¡$«M',‰.ÀÂn ¬gJØãÆŒ.ïêèÁÌß|° [ÂæwàE¿Ÿù¼bâµXXÄ@””¤½5³9³Ð2Ÿ¥¥(\¼>K»¤UÅ\Ãö‹{e8_ÊàãŒWÏQÈ<ÔñðþʤFåµõb-'°-(î.óÀÂj|°¦Z|!ùÞ]¼¨Íx 3_’þ[NT[x+ö̾þîGí°H†´& å¡e;RM¾ïÆ•%û~)ßéI[ÈÇ6Q<¦ÛÍâScrCR;ñ~*éóú‹v…´…#œd¯£¹DM2Ÿue.ï}ëÃ[‘¶©ñ]¤Ü8³?ŒLi¤A¨DéÄ@Q-©Qqª>åBOü«ËÁ29»|!˜r)2¬Ð0+‚A”‘Œ&wItH “ÛúÆmtj "rFÄÖ#_¢®²z$¨L¹ÿß-@¬€Þ8à‹vE„¿ÄRJŽ:¨w·‹÷wR©´q ãœVùú?AŽáô{¿¨ó°8³ª~[˜l·0? aœ¬ 6&µ„;¶Àl@Ödp87{·~Ò‹Ù’ƒm¶_-¬é¯jœûUxã"wÕU":TÌ¢)È)ðè*é¡K—¯‰M0‹ð–€½3æEûp¸ìû5üÍKÉ„¬?¢I}.—ýÇ.v(‘üEšW„;­ä ßñm“=ÈxÁìéÏv,‡/ŸGËUn>M]íÖ¯HÁ`Üb(]ßlTž\PÅxM8v (I}Zž†7㮵-&#áŒÃ#úC\ß}vxm¸¥K†/™!’¼€²ŠgÊõ+oœ…¦,·™N”> Ô—Â’›B±Êƒ™åEbs·´ZlæàyDœx‰ð’ZÄ>B¥\”¥\<ç´Z3ˆuÁé³&Âé(°}©ÜÈB·¡%$Y K29DÌc„=dqá¤âèNñ(j£Ñt÷?˜Õ”Òü2b»°‘¼Nüt\—z=šñ“(ñmã ÎÔs‹ˆDœŸ‚Áî» uË"àÃSda2hR<u`(×µ!jÝ6ñ€¼ÏM¤¢\‚"Ohíui?xkÿà€W/†Øà0‹Êð ‹[l½;´æÅFuׇOÄ+­åÐôy¶#Kq´ Ú_êTÌC¯µ­âWMÛœÐøF±D Eà’9!C3ûlOIÍžª2Ó&J­9<©3Wз³””fº²3Fœú¬)7»Ð©`Kt~Ç–`$Ü!W|q« ´CYK½©µfáÀ†[ój" f l â^_œMVδ/¸ûÉɬ F;Á¢¤Ûž>4§d¦½ú3èÒwZ¿]+諘yËp7±Ò–ÓferSŽVx#|Ɖrwó– øã-[%9”~Á†B¦‚ßÕñ¿§8ׂó,XÃjœÏ¸-°Ž-p «G€/˜ÞÈ– |;FÀ彉­p%[%àjv¬€ÍV;k¬úÖZð8‹¾NÔCðM²€ë-x‚}Ü`Áæ0`á-ØjÁ6 ­þmü ¿ubívX0Ì:<Ñâx~ xLô“ákm·²mng' x²%wŠOµài<Ý‚gXý:Ó÷Yìl³¡äv.¡ìg„ÐíD%`{i‚4÷’²8)*pC'C÷’aq2¼!­È“ZÔXšVvˆ,+}”ÇɈRœ^<Ò)%ŠG¥vн¢Ø›^|¨S‰nHDýqtc‚´"Ú&Ñ`‚lBt³DC ÒŽh‡Dà ҉è‰$HјD»d ¢[%º-A¶#z’DONS=U¢§%È鈞h‚œ‰Ù³€~6Lì9ϵàÏ,xžÏO ùB©Ô‹äbD/‘r‘e½Íà2H oî%—#z…´Š8¹ˆW%ȽZŠ^•½&E47›èµÉyŸš ×avg#Я[<'An@ÂÕ(7y¸ì÷Ívæ–¹Ëo“z¸Ȼޞ w ùNI¾Ý"ß• ÝH¾[’ï²È÷$ȽH¾O’ï±È÷'Èn$?'Úmðä"0x ðtà|('Nö|þ=’ ÂÈ{â$'½@Ø[ð˜Ì¬—Žáq4*éa0»@.xÌnYl»A®s¤e©‹¥ï@êF™ÝewìBv‘å×Â:t\ZJ{H~ñNZ ¬‰‰‰v¢ H‚<ÑŒ½.x’÷’§`­< ~¦±"Až…ÌÏãä9XýÏCö…’Œy ²ñbœüfœ¼ô yYÌHž•WqB~Y•£Tinͳ‹¸=@rkqòJœ¼zŽF»÷&ʤÌk»ÀÅ@^¯Ö=ú3ä‚7ãä­dÒ=zœ¼ÝM\BðÕy§¹àÝ^ò^µæÑä}ì˯ÀIú¯‘5$ÈHÿ ÐEÕ¿“+B˜gÈÿö’ßÇÉÇå`a€¥ðÇrTGœü©FñgÈç¿H luu êb+úbGÑ»IÉx[©ÒCp`ŸÄÉ_ä ÷)?ª›¨ÊQÅüV:³ÔQù_Qå=DÏ¢ôù rz­qôª ½ºsøídZŽ"ç›"M¢züùGí#=ªP:è”ÂQ_¬ZüÎЗO]:ðüýòjzöÏfÞKþÕC\IE» jWrÚ¿òò5"ÿNÓ»á1ä¤ÿõž ßâ(]½ä¿–ú]–úlêVg!Lk0kM…Æo%ƒq 0àÏ»aGîG#€oTýwÝbP2mê.a—ZS·PîVt*ÎŽEw”²ò?ú¾à‡8ù2û÷‘Ù Jp@û{)­æ @Êv¡ÒfQH9CLØ~ôXß#0Çi¢b4T›=òz˜;$Ä©ÞC]¥®85zÈþn‚ûäÉÖ@Ö[CóÙSšÒ8 v½Ð@vàx‘†ÒܽÔ쟑<¬Äé Çd « Y±t(¸¸äÚËîO÷€×Mæ’Zª ¥^Æ.·<⢠RÉøy¹¹—nTª¸›—?µ‹äW”»ùt,ñ˲Š8u&å v%¤(ï% þ#b£x[Ó¼8ͯ/‹Ó‚Ý‚ù*HÀëÒ ±Ã‘+¶<1Îù^ÙK ‹hQ°¯ÈÕì««‡AC @OJ”SHa?*²"¡‡¬Þ]Ë®³Dò  ì/¤ÃìÒNé)PQ(é,k€îo¬(¤g¾†eÒCºÉ±@)v(#€²(#%¥²£âtôÍXæ…²R jÆÁSHÇ(ú8)ÖwXC¹Ý“ëžgõdY!Ÿ¥/‡C-Ui}Aʸd_€RÒ§%n·Äñ‰¤ÕR-´£œáš§T©ÔÃtL÷áE´Ô“ÓvÞ^Z~Ù•¥œ‰ª =耵Äéf‘_,ò!‘oùv1îÜBÚQ]ÔM†¥,ü¢ROQœ†j5òa—:ãôD¬Gv¼' ) 0N£@ŒÅiWµû<ÔîÞPá·¶ˆ“ mÝK· ÒvI:I’OŽÓS¬1áTkµœæÔrzöZÎ8˜ZÎtj9+{-gL-礉œ»—þ첤˜àÚ½2Uʪ­ž)FÏrâ·R5,Uøåa°~ÃN}Ã„×æ~ÐÓûr¾ÍÒMF¤–8Ö07Ìa`£·à$A½@ÎÖ….Ú 3¬º‹d yñÂh1=’΢ èöûÅûDþØÀÚaÇA„†Ï𽤹^ÚK/k(Çë¨^zyœ^aÇ·±]–ÄRØ“1ª«)ž]цÁN<»y¢Å: Ñ‘:Q+ŒPFÚþíì«òK¡39Ï*þuYCY¹p®W6”–÷Ò«#‘íáL»aï¶{w·=Zvô ‚9+{ê(9@8t܃ɽ˜Ü§Ì9b›P6rŠ´€ûñ°Î =”¹§¥> ÎïÎQ(°¢ÂF …Ñ/¡Qáï†çA¾—>ÔM?@=Yè=ÝôÉ,÷ ÀÃÙîí¦g؆d¸¯›®Í"°ݨGØÈîêON!}Tøn %6ZÐbܺéP,íqJ7X¥ D)ùKãNiÐ*m¥`i¯]šnJÝä ,Ýë”>f•Þ.KoÆÒÇÒ„Uz—,=KŸpJÓŒ²›lÀÒ'Eé`gè¤Ôá˜ãSèár¬ º‘ñ}¸Ô>\ éî~%OÏ·­çrï>ÙºSû¡8}º”[À'н§mk¼ÇY+Ÿ[kå÷BÀé”Þ³ÌRf;±E%æÀí¼ÞP¾Œ(‡™àÄtƒ¼,(·î(xÎW è^G~Ž#?'Sþ^G~N¦ü}ûÈ1àp$”‡1çùðï\ÁW%‹žI+ú™(*–EÏZ*—E°‰¼áaü^g΂U‘M‚HéçÙ"Êýs³±4Qj¹Hˆ|Jô9p’Ï÷@,“gô/à ‚‰1h‚âe}±—þ¢‡|Ršçï!¹¥âb!A_±—{ÈC¥É]¡ŽàPúËdý¯$³¯bÑkØ“bLFaâÅ©ƒÉ8LÆ—Á?5pü ñä똹7J÷Ð71y «z“wJ¡Ïƒd”ˆºÁáaLI8J\$Ž}¥ÒwöÐS¡«ïBWßë¥ï÷ÀV^HÕK ãûþý·C¼A­Ä ©ló·qú!ø½ß5Z×n¸¡|ƒþ=^\&èÇýCœ<çQÕúG MýÉ£é¡é'àzè_<OhhôzÔæGéŸø ‚o°à,ø@þ/0ãoॕàÿ´/?Ô…w]Ï_ˆ½î>ë+¦J±2‡ço‚§¯£>_--ÉÅîsö¯ ü0FV&è8ó_ÖC ú÷8ýGYœþ³ äÿU&¢†¯öÒ¯ãôßqúM#R`_ü*”~«†ü€üW ß§ÿë&/¾Ç[ ©'KE„AñW=V³CaáâÒÅ;¥‡ŠGÄé¶‘?`³#në¦o‚ê~´Y´/WÓYŠãt¿Íòã$Š x[ / ±9öôÇAí[ƒ‡Ù#ǰØáæl –7º¦ó²§ðJO}š;ç Ná9OäV»J=®²^ÆJ‡ò28dk½L™Î1æg|º‘ MͽL­6=æPg9 8¼yL@´ ‰±z\½Lç·îª›(ÖÉÒ¨ðÖÁÒðvö(ë±zz Lç`€V@·Š˜kº&®ðÒ÷è ¼`¹ÕFéhÑË̪\wîy=Xr—z w.p šnÕ†š;n&N×Ä­ÁÓN5“œj<ÊMD‰¡ÚŽëIžGu»lb“{}¨¶ÛêcœõZ}œ!¯Uñ@Ëݼγc+ðâ £-ÙA£¡ù7¿_Üþ–ÙAá^ö˜UË«–‘N-E£A¶rÇDU¤Øß¸-ö8KXb“AŃP/G—£áe#!Ìã}cëËp‡Úÿ±m O°'qÙêa®¹¢Ý2¨â2è2œà¼á<î›+Zÿ³W]gO±§­KÈB+ZÔJËÖô|1ì‹íYös‹-ß²HÜûòÒ™žcÏ÷a²/¯¦Ø>‹©ÀZ 9¥Å½dp:׋ì×p+Þ7K›áh;:¸\ìî4Þ—úãmïËû2û¥ÓEæŒ#ƒé§ÂB«B­ttߺ^e¯eщyÓëì>ú-ýf°½™µ®Üt¦·ú©+ƒímöN–ºŒt¦wÙ{Y˜\éú>ûU&=é×샬”ÁööÛ¬×ÒûõavóÈI7ß±R*“3T<²t¶ßgÕOoñã~:–Áö‡¬u)éLdêÓ¯²ò^ÂÒûõç~šÌ¨í“¬MÒt¦¿8{E£Ø,áØ—çz’¼Ñ¬Àñ ©™²!MÍj!ËkjÎ)dùMÍZ!+hjÖ YaSsŠÍ ˆC›¡ì}ÈÉrRJ&Ñ/Øp T<àu‹pÀZ€# pÀSޏ à€‡Œ°àX€íñÿÖfÀö°àáÐö>€%€ŸpÀéK®Xp Àr€«V\p"ÀcV¢FN¸àd€ NxÀ©wœðb€G<`À{NØ pÀ; ðV€Õo8àn€³žð(€ûØ0gâ}"ÿ>°à×üF‚ÿPK¢ž9/ÜlPK py/<gmonitor/app/SimpleGrapherBaseUI$GloggerDataFileFilter.class…RËnÓ@=Ó¤µãº-MÚòÓ¦`'R„Ä&ˆˆ*El"@b7r{*¿43<ú)üC° H,ø> q'xQPÆßyœsï¹Góó×÷Ž0ôÐÁN.v=ìáªý]sqÝà ÜtqËÁ÷ÖL&uÿ!Ãþ4-ªRšJż®ã™,ê\L¯3¡žq-^žŒ:³³ÒdÂÈ„˜O$ÁŸ2†Ë©Ñ+†öq5ÄãI"jðNOù{Ë*~.s1ŠÞ0l¦ÂŒ…N”¬¬J†0úƒÊy™Æ3£d™Ž|l`߇‡u>ú8ôq=*q”橃>BD ýÉ´JS¡…àú…(M0熿¥‚AhÑ‘ƒÃãeô'ù"Õ˜ÈV-M#ÃîÎý“²ê8çZ MîÚ>ÆúÉmñ$«*-T|™Ó ­MþeSÖ¥K%Òv¶€K¹ô‚t{åoo\QÎõki2þëå˺E@§C‰¡km¦èÃŽÍ lÒ~‹V{X¡ðßÀïXù²@‘.l7˜» ¦7¼@ëVÛç´hwW/°vÞ€»è5à-ŠÌ–é:Ÿ›ËÀæ§èâ6åÂoPK±S<¤ÁáPK py/7gmonitor/app/SimpleGrapherBaseUI$UnitCellRenderer.class…R]oA=Cíâb‘¶~µ*VªË¶ºE­AûI Ó¤Xx`[—ÝuwúSü¾j1ñÁøì2Þ¡Å@ûÀ&{ïÜsÏœÙ{fÿüýù Àoºê„LmºAb‰AבÔJ“h™·ÞwB¿ïµͳ\%œhºÄ9aïú¡³s³lEŽþÚ4èÓèͪ˥| ê‰EŠKT­P£¼`ý³6¾#fŇ˜û6¢Òĸ|J|I´$墵ùDI ‘´–㟡Cû‚ä1æ‡ÐÇÈüI qÁúz*u—bв;XþPKÒF¸‹‘PK py/:gmonitor/app/SimpleGrapherBaseUI$HostOidCellRenderer.class…T]SÓ@=[JÓ„¨Z@­˜$ àG‹€íøÓ±3‚>ðdÚî´Á4‰É"8ãñðªŒÖŸýQŽw©Èç ™É½wÏž»÷îÙl~ÿùñÀ JRVÑ̨‚+®âš‚¬ô×%8¦áÆUL`Rš›3d”“‘©`JÁŒ‹!!šN4>Ë0Vn´|Ï~hÙA`­9­ÀåOC;hò°hGüÕjA]ûà‰&N2¢/1Lç§æ^3ÄK~3Œ6¸(;‘(q×}ɽ:yXò[ïqO0,åMû½½cEێװžKja²\›€Ju“×Dauc#×AímaýÏ/èHcVÇuÌá6Cê0uM„´¤‚;:æ±À0x8õx§ÆáøžŽ»XÐq÷<Б—ž]ÄCKÒ,cEÇ#±Â0ÞÖÇŸù‘¨8õ£Û¥Òg¢úªç‘®E•á22ÿˆ‰¦‘3ý ñ|ÂüŠX&ÑFw^Ù…šW3‰¼r€)ùd£ÀÌ(m$§2É6T3ÿuÚ.{èiC?@zö‘Þ6úÌÏT'Am‘¦»m—Ü"«‘ï§¿Á4ðPK»€3>i9PK py/&gmonitor/app/SimpleGrapherBaseUI.class… X\ÅyfXxǃ%„óå^X#FL¢!!A D<Øl²ìâWŒ1Þ÷­µIŒ¶±mêw±RÚÖ«Õjk­µ±¶Öž¶µwµ‡öÿgæí.›MÃ÷ñ_óÏ?ÿüóÏÿþÙW>}êBÈ2v·FÃ4‚ÀF0¬ÒÙä}:¦Ò 5ÒD/Bæb•^‚øR•îÒÈ!¼L¥»5b ær•îA|…J÷"¾ç^…ÔÕ*½F#BíZ•^‡øz•Þ€øF•Þ„øf•Þ¢‘{…Ò­*½M# æv•Þ¡‘«s§JïB|7®{•F"B|‚{|Á}*ý¼FncûTºñÜ!$÷käczP¡h¤†DɃ¾ Ð/ªônï!俤Ò/«ô+HVéW?¬ÒG?ªÐÇTú8nñ!•Qé(ª4†x\¡Ojä,aúk }J¥Pý:ŠžVé3ˆŸUésˆ¿ày•~ñ·|[¡/¨ôEÜ$wå%/#xÁwTú]įªô5ÄßSéëˆßPé÷ÿ@¥oªô‡*}K¡? q#o#ø1‚wTú•Eò]•þñ{~†àçÞGð  ø%‚_!ø5‚ß ø-‚ß)ôC<¾Õß+ô*ý£F® ~¤Ò?!þ³Jÿ‚ø¯ ýËßú<Œ‡úOÜ%&¬ÐO0à\þ¥‘û„ðßþƒà¿>EðFF1CjÀ0…ehäsÁy²LY8I¦"ÈV˜¦‘‡Qûa–GÃt8–«°<â)ò6$Ì @aÓ4òš½š"˜Þ²"…ÍÐȳ8ë>V¬°™yžÍgØls6W#/°y覡°ùy™-@ÉB•-Â9‹¶D#¯Ñ‡Yª0FÞ`%È”*Ì«‘7™Kaey bÁÊ5ò6Æâm¶ A‚JU–#8 ÂÆV u²Âª! 8ï|€.~ÀV"8Uc5¬©Ó¬B°ZckØé*;®>«UXF>‚)ÀÔ#h–å¨l­ÊU¶NeëÖDIÁúPÄÞè÷Õ[@»ôYa+L‰Þ Záú€‰XJò7ýödÂuP¿n0m³Ñ°àßFyžÏoŠ6YAJf6o7GÌÑŠÈN°¿bÔ„B+|%¹B»ÁÊê Fplò¼€ y¨°.l tØc¨Æg {’l ùi}(ؾ#Ùd[ƒ —ŠŽ5 `~z²rí°Ú4ä3m+ÅÊÚQ\nJd¸§¶[sp}É Kr]84Hè'9WˆS:ì°³`Õ òn>¹"`ÂT N p¢£53evSÎk(àÛ+p´'I§&¦„ö?±sÇýNKÅDĸ3 ׊鋜ÁúP8lõÚuc›†lÿ ¬=orDê¬Þu¡Ñ¤pLqævù#MÁ¾ ”$çH²¦H•dMH; 0{ã矘ÞìZIufú m¬0Ãhð÷õÁ• Úé"9s¡ÎAp¡$ŸÛ­!Ó‹Z/Æ@Î)J WK6UÀ%©;r§HùvRUÅ^ ¹ôØäpùJ<0(yœ«ª¬¬”‚GàóÀ•†È·†piÉž!PÉBêÌ:9Ú2}°Ï0f¿¼B¹œÁSSõ8ÏççÄY4’P–âwÀqqª#Hò2/IÆÍî ö„Dž¤†GD˜s¹Ï ‰ùªq~툅G•0{¬@Õï6ð#˜6ÙN3ƒëµÃÅÅhr¦Ãê Á÷\Ûµ¹…N~fL¶Ð £~+à+Ù¨*LéáUC}kJKá䉢ª`š‰ª¨` zxR[!;p¥~ÌŒ6ObVsÿ`‚ Wôû+xδfá(’/aJІ ›+Šh‹IÉ÷1/aFv.¨ ÀÈç$Þüð )êbÚ¢.\Nêtôâ"©EzƒK]µß²[áx«(Yâ9¶Ê–¤+¼®z᨜º6bÙ¡P Ó)›á)é‚Ä_å‡-¯½'ð3<%Ç }èµÅ÷>=UÑ §ÛQKŽb#œ¬¸jò)éŽPœˆkj.·5ÍúºDNÌ·þ_VLõ†ÐpOÀÚì·¬>s8`£ùc­7”4@î‚~DÎ2ƒ'œ°¥d DÎ9löÚõà\Éñ ¾[ŠÚpØköGl<éU½~" Û ³3Y³ÎZX+‚x¡b.‹@!›°…µéì,Ú­Ó,ªÀ¦E;cÀ3>¸N#Ôg¬kæíÑI:kg:UQsi3\ʈmð[dø#†Ï ˜c–Ï0¡^ãÁôšÀ˜N¥päÑvpÞ…²N³ñÜ5Ùx‚ jhµè8ݱNs(¸iœ¨%†òͳá âIJ`‰fŽ¸Ë Ã6¦Ð|žñ~V§nå&WðQ§Óh¾N ÑÃé ï §Eå*ÓQ¥ˆßõÿÛ”R2›$câhôŠŽ–1zÆŒaÞÖêt\3:Á,³ñbj‰Z­Ó9(qa‹¦Ó¹Hg@ý×é<.ÆvL§§q%¨[üúò`+2kRËñR§LÞ¥t %lt%$Â(öB:-G‰«¢ ée¨rÕuZ;_AótZ‰ÔÉHU!UÔr¤NAêTÜL úU˜¶aÒéixãÜÇvA°}Þå<>§Ó3@‚´Á;Ö¢ÄmDÒÓÓ7B˜ÝPô Òt;ðáI÷UÕiÝ Àq¿X©ó£N[h«N7"hCp‚v´55Nã¡ÓsðWÇ×2‡†*:üâ±+Zá:(Û›š¥}VãÞ6ëìlÖ­³-l«ÎÎa]:;—§³óÑl~â£Ö9 ãà6¦ÎzØÖ”Ë$¿£Îáàµ謗ùtf1Hª…[OüÕY?ЙŸA¾UpW©¿èl;Û¡³D'ƒ2jæN»¢.•fs,4lë,Äà0%>Ø„Áp\ ³0‹èÌÆÝ§…CÅavÑÍò(¹‘È®`„Îc#:ÛÉF±àYxåÑ1x}&ìáUtúí€åîéìBvQÊYC$¥×`öb4t %+Nš´¿¿L;».ì÷Õ™ýÂ2|ÄS vD å"ãR¶Kg—!Øàr{Ø:Û‹àJ6ª³«Ø.Ȇy•šùaø>êìjvήe×)ìzÝ€‰x#=Wg7±.…ݬ³[Ø­pUí0”_v»]^Æ”fKgw`¢ÝÉîÝ Ôeð·Ã'œŽ/7£vÄ ›øœÉO4p{¶CjO‰ž*Ÿâ6º2×åi*ç³#Ã=98ÝÓÔ”¶Q/ô¤—'/0áe7ßáж!9òý<^o´”¾;ÎëOQœæIÿdO@}±§ùDçÂÍæÂúÉ?¹-õLº®Ø‚öж "¡Æg΀™-póýV@|›ÖMh¡|èÃÔ˜&mÇij+ÃôN¥ç8?œ¥yµÈit˜Øá4Î)‘'zöíó&[®ÅÓƒ6^>VÑ1|D §¸·ÿ…K5á«/ij‹ϤwŠc? ¾1àØÚ€5ÈßëiÝêŸø‹Š<º‘¸¦ó'»é|¹ cŽºƒÉê“ê/×õ¤ pºàâ»ÌÆ‹‚tË‚µ˜A¸?Â.@O0œÓb†ûñI7-iލªñ0¯õùmÌ ¨«IJà-ôÅ.®—é&ñ.´ÀÃipx°ƒIò”x¡åSJÒKxôTTÚc¢&«±Y=ÉpІb#ܽÒôH'„¤‚›§]Éì‡ê:*ñÿáÃïÛé÷ÙðµSvZøú€Qìé%:ù,VŸ}ŸO#Ó?d¢ŒªÓu@Ñæ”ñ‘ï” Üx$žÔÎK?ewÉß³¸²êòGüüô\Cfïqé/~ªôìaù@R©ÏrpîjÄr¸´• vo]0l"MýÐ{[õPšŽ£ W;+`û1nY½f¸Ö实Ì'ï“ !à/ÿ>Ÿ(3‰3$vIœ)1¼¿9V%ΖX“ãðŽàž´ۀ㩒wK¾@òÓ$_(íL—|‘ä¡{çx¦Ä³$ž-ñ‰çJ§ ˜³`ýö(é²³Û½iœtEIQ©{s”œÍE°­³¹pv©»;J¶8Â-\8³Ô½5JÎá+€ð¾Æ¹¥îó¢ä|Gx>nÖìv÷Œ“Þ(ñ fg,ÁèœéL=gú3À¿`¶sf‡`œL3!Á qfª`.àL`š9S(‚æ¾Í&ÂÕì(¤gš9S)˜íœL€3#‚ rf§`†8S!˜QÎx3Æ™ sg.NÿÔÇÉ¥<¦»$wçvKîrÎí‘ÜœÛ+v4Êw”'˜1Î\)˜‹8s0WÃJ×Dɵ rI‚,òºn÷õãä†(¹Q07qæfÁÜ™[¹­;_'·GIU2³˜;x4ïŒÂMàÌÎTs¬rw”Üä½@~.J ïòóQ²/AîOäý ò`‚|ÈüB”,„›ýEȳUäP7\°‡bäKȺbäË€Wþ â Á׊k{x³¤³:F¾*E­R”ÿ;’èÁ$:„ôy|x¤‹Ê®yt3»bCìEpƒP;ìл“è=Iô^I_"ô“äî¹'Aîdƒp¿A”7>}ìüñ r\|¢Å#ѧIg«· ¸Q”<¾V£X¾QTP!µ5NJº«¹pÉÙ r¦ Û„Wnâ8=[ÒE¸7”‰uqè\9´^ˆãô¶$ÚçÐbЬ¤á¾$º?‰öKú‘'Ï8tNÝD7&Ñë%ýÀyNâ¹ù~¡&ÈóÝj†:N¾#ßB äç·!«_Àš¹pœ¼%/õÒy¹{*-Ëo'¯ÄÈwЊÝß‘WØ7A^ãÅó{1òúygïË'ßÇï>¯XmüÇÈ6Kz$‰Þ)éýÜPý$CûÑP eÂÐ~<~gü{‘ž ob–üW\â9R‚x‚¼;þ8€&ÈÛÀÿ¸µ<3JÞ)gQò“òŒ(9ŠÔ»åS¢ä§¨ˆF G_-Ï‚ûá™\é ¤qÞ»Rû~®íBChƒ[“C%qCÉ*¹4 GŽJé\šj¡*­…jÇÂQnFJoNkaEZ +Q*ãq;(cQòÂVÞñ‚gïz1:^4ˆà=P3D6Ü<•åéð3œŠr÷«^\Á{8ûo÷ä¨kšàÆòµ(ù¹Ô€ë'\³ƒ2g^•ôþµÌ„Úr:óé6Ù#NŇ `,÷8½¡I{Ò t†{Óp†}i‡p†­´Ãûœá¾´ÃûÅp6í§r¸šVà“'Èûp¿hž þeK™¶#¿‚ þuk90cä7›Ë ýD¿+ƒÉ‡N üt{šÕ §—ÞArx¬– ¸À =r«Øõ"Éôyö‰'à26„káïUPá4Ü¡À?¨à…TàŸTðÃDÜ¥Âup§G‰çc*p¸“ï¦áî¥á>b2ü¢î' öÜ0*©¦á8 øÞpÎþGàÒðNRaޥ»á=*¼ÞGÃÃ*<ï§óNÐÆ£*œ¤“𣠕6NA…XÞ¡ÀÍ+ðA|‚†Ó4|HàIVÃ’yJ(ð´Ϩðr22¥ÕÇTHó´zŽV§Õ'TÔù“ÒÏTø|Ú¡ ãs,9G†}†pþ…ÿ•†#Á§á³4€oÑüm¾£ÀwøögsV‰¶ýFó 9z œÍn(ÍCÛ³¥òÁ ¥rÞœ%žeuc•%¹Ù,[ö'Ob•ñn*dPÇn¶æÊYÄfÐÌÛ‘¯T®qû×fóÙòzzâÛúœ™Ÿ,³ù™5ƒW1à(µµæ#-1Ø€ýˆlcä(äiµn-Íéòõ&9™Á`¢t“xTe÷Ù²ë /»€” ^ÒoÛàö™Ùº¢PÍf2fÙE/™[P¨^«i[«Ëš lk¦Ebº?h¥ç ÷ 3[¤­©Â•æ-ôa,gÍÚÞnŒÝ y¤1ûÕÍø_t±šl<´ 3‡’dÃ…bp‘jvPž]i•ÌÙ9ŒÖ„ÌNLUL°hQ~ÍYõ5wñx³F]œÖþBѺO7q]Ó ¾Ø=a¬„ޱñ_èŒÞ‹ Ë,(Ê/´É`]ƒ qþ—æÙÔ)or£B´w&›Ô¡µÓ9yÙ9¼®çð=ø>‡Àˆ¦©Ï¡sX¥ÙÂèøÎjAáP†7q(Õö«‰!?¯šrØ &‡}4LC†ƒEÃ~fh¸²r4ü~Ìá'ðS?ƒŸ+ð ¿„9~Åá×ð~Ëá?Hýÿ„ß)ð{ÿÿÍáà9üþO³Î1PSX gæÅJ¹Ô½œù˜UoPÍ8Ê8 Ò ²ƒ.ÉRÆ"0:™uSuK¡ˆ9€‡ðßèÄÄh&ߺ՘5J%t㜵²0íšHŒA¬¡»”aÐ]Ýž9]œPœµÁgí¬ƒ³­–Ñ*Ê4ÎtÖÉá/á [Ι`]òäÒ22àÐÍYŒõp¸þ†Ã!x‡?…×sxüƒUéx¾PŽ£=Ó7X™a$â³µ¤“’—qÖËú8‹ÓÐÏ.QØg+ØJÎV±K±Æ_Ó¸€n̦o’™è˜°Fa ÎÙÂ’ êÏvÆw°XÆ@Äç Ù|f+1‹üBØô„MΙÓÖ¢ðîÜw£5~ô–²¯³‹ >¯¼ôx¹Õ£ŽïSwÇåóKX£ Ÿ« =tÉ'-,¬™ Ë1™ÁŠD¡%\kìWyK¶X*׉4]Ì„’}/Àb·Kª@ü…TbÐæ¼ø›­ýΗþFúÔ³ 6=dÀòƒ¨› (Ã;jT³~…¦„›:l^ FðØ«lÈgvdéàhb°QÃâ13ʈóóaðjeçøæšúñF.¨ãXÓè^/Bh¯BVuhhô"&Äí½0Q«0› Xú§†Ï[*©@Õ?sö#Ï®R.ÈZ½É¢ÖÏuBƒoØLaª”Íl¾D^_â=÷¦ ÷Z]6Ù¢é.]k<½‰mÄÙµóct6ä0_E½ò5ëä1 zÔFSJîŠp¯²³MvÒ¸,U—$°%gÎÛ8!8{Ù }¹šÃ5u&°"áwÔ‰ªIbóàfü9‘Ø(ñCÒÆCe»Æl¬uÊãùŒukÓÆmQ  Ã¥#µ¸NN™û¨QM4J¸œ•ÃGÏüÒ£jmJg¢iC^´ÌLU o`¢Y¯ìÞƒU÷POX¢Îiçþ­ã›Í|B—‘éjbÇ‘HèLj×áo#ÿ°©‘¿0±Åó>gÆFCΖœ[¨ÝóŒœ#ÔtàO­å·›ÎÕѳˆœ—|Qü†½~»©Î-8 =ìY襩-÷B”Vž xžïöd|ŸÿžPÎHŠøçE$?þ•ªhëÁ#ÑVÛh«ªh1Z9”7SC 4G-Õ%ð[α¡B§ï4p\¶ž‚pmÙ6¤ž‚v:†¢9…†DA;CžS°|È{ „Í….äñ¬‹%Ÿ<JÆV?±#è1¼8ö>á«@_ÚZ·ëþ;îÆ£u? >HßëÐÂ[¸ ô§‚ž”ª©Zð8 ˆ€¦Và#$B08Ê…¯ÀŠÝ‡U6îk$·ÒP2­J…<)®q-Drª†\—­¢µ #Œrm",å8É‘QÁÁ݇[ÜLäã0ôèyþ;·àHQÙ‚~ô:1ï™xš¦ $? ÃÛi‰ay .Û>üÌ<v ?3r&y%ˆÃJ À*9ÓÏø[b¶Ù˜m5̶‹Æl¡ÎÁ|Rô¿+kœOxÖ÷89s.¥U9†Wxñ„Qïý “ÑtÆç†O8 Ø: [‘òã¼ÖÝáIy5’FÌ•IÍë b´‡+ð"B¡À#¢¿4‚¾qQÿ þÜIôWb¢+8¿”^Oʧùª€>Ð/üñ ¼˜…ßðÎCð°…÷Ä’PµPóêà>4¦:;Ãí ü1®g†ßã:‹¼¿«ÞC¾á:Âï†bØ Å€ð»ÁñWƒ£Ô‡ôÈw‚£ìuïçûî¥KÉûW=M®#B®%\pò¹Œ”jŸÝ+ý‰ M„ÜØ…ÜØqéZnÇn–ž“µ”Ñ.ò°»6½­»6“è(lÆØµ:±“ Ç Sp;®·nŒl«?D¨˜±!Ã?BÏÆ/€öëÕøý5¼É¹Á˰hÑÿø+QØòØú¨S%ñ—¹ÍÐr-^ù•8_§$JûÜ ¡$=ÕTöºyœ´ioPzdzªºªûfÓ\’´¾ÙL‡OÂVÝgéaz…íÃñK©^œÓízXoG¢Uo×}fº}þܯõötX#Ÿ'Õ®yÂcžT‡Öq›Î︇ÔôôeÍtä4¤öè‘7¢XÖ¢d>34fèZ»›[I­½S ßÞªÎéN=¢wbT¡Ú<ôKò(,C6¿+£QNµ£OqAÿ­OôH›{´¾Õš®-'›ãZ\ÚÜ—ê%›û¤Í½Çà Õè}y«èC›Óqš®1.—h½N¦bW.oZoe"¾µ4ëqYiüäž0º'<nw0>ÁD=+ÔóûŸ·âo%;!;œêé£;Ùø¶†ÛövÞ¾¨öÂÒÚ ÿPKI¼ä)ÛPK py/$gmonitor/gui/GraphMonitorModel.classTÛseÿm³›MÒmBi³m Ð/¤ Z•Ø–‹)…Zli­ Þ¶ér©É¶\¼<1ÃŒ>ñ ˆ>ðÒuÆ´3>t|Ðgü|óÅ?ÂzÎî·K‘•1žÛï;×ï|ûÛß?m8„ÏÂBY¼Åäm&ï09ÏäBïâ=&ï3ù€m*[âÇš©Àû)¾Ð‘À"ÊL–TX ôâb‚V˜\bb3¹ÌÎW˜T™Ô˜Ô™4˜,«øHES‚Ú4¯.™Ž)!=sÙ\5 +Ž]-”šMóúŒÝrÆéDk¥6ÛX²$Hç%(‹VÅ®“|Z‚ìXÍšm¹i]´¯2ËNƒ"Æjæµ³ºBš/ÎÛ5‹» BôΪéX-G€©mšð4W+”&IuËB±ë¶sLB$7¼@%p+U,gÂ+”ìTê2œ3¯NR§sVÓ¶ZúrÃÿÑqÜnÍù=“;u­’û¼Ûl¬D–s§9¥vÑ®/Í=å.ÌTj *ªÑ,TVì‚H{²jÕ¬º3ÎÕx.Á0:Ëfµ\Zµšfåÿ˜æƒ!p%Üdë±&r¡=º…'èxЧœ;Ï6µå7š¢–Ï>r±©Ö¿-<–  ÖÎ!µM—Ì– éÔ6ÍÓd™Ù¾;5<ŒR ¶®gRà xQÃÓxFÃ0ökx–É><¥!‡ý*Z5¬`\Ã*Ky>p±«®áº†øXBoØØ5|‚O5Ç+&qRC‰¥ œÐèqS˜“&“LžÃóö>mªi._šõ <ñ*]—{3U³^)œY¼l• ™'\¼·Õ¢oÕn‘d/‰Õt'ÓrÓt±-û†7¨i¢t˜^znZ¬þ¶äã^¨I÷[Í ?y é›–¥  |&NøðÙPx¯¿ wùð¹Px—υž§5ôVÿPKF¸Þj¶à PK py/gmonitor/gui/RawData.class…SkOÓ`~ºnë6:`ã":åâµ+¼+‚ °ŠÎ ‰ñSqe)é6C+ø£4Qccâ€?J=§ôLm“syŸžç<ïyßþüõý€Y¬åPÀ\÷1ŸÅ 8zÀÑ"GK=äèGËlVRTˆßôpVec°y¬`UÁ Ù·nÇ_é¸= ƒæ®µoU¬¿®Ìì:m;‚3ÛÖ^æ\{ßvÅzÃÙÙiu¶iK‚ܲÞST“Ú·\§!!Ù°|KÂøk³Ùê´¿³Wi¾s*ÖA•õ[vÛ§fé‡ÐE¢ÐÊ›T¶r*MÛ¯†“Zù9Ç«vÕ éIS}%QJ¢ÇÛ<”¥x‚xJû7/«é㯉ºR'µ-^L{wR«qž¡zk£)jQQ|ÈÖÜåÃiËPÞ@–&Š'=ßj¾ˆ“åfÖ!Q+Šˆ9Èûïk7E¬0“‘¶›'¯Jö•Æ$ŒrÜ×>6èKr#-©DƪBž4b_»éJE¦,‹Œ¶¤M¹Q¶ä#¶°ÆÌ4f®Ø˜|¤ÉH¹bk憭™iÍpÄÁ˜ö¡#Ì™6gnØœ¹bsVF­IâÊsŽö¤—i1Só|‹oLÎt´µÿÈ7m§s}©\Q£§8¼fF¹=33yQsQí#3ÏÉ‘W—zŠ¢©xtgÚÈÚ2< ÈÐ×ÊpëáZÝ%³»áþ€€ÝCØ„ÝKØMpáfØ)Ã.¸E†[a· n§µ½î€è=F–áN¸ ÓÀp­iKõô¥õ†¢JT¶ j[Zj“ÉêÅ‹ã==ñ\Ž= Ãð Ìîcûdv?{@`8Ù³?Ân=$³‡^æn¸G†Çà/2ØGöK×àºÞ¤-³Odö)ûŒä}.çð ¢Ñ‘†}Òá2|L4&Éì ö¥ ïÑ)/Á#ûJfÿcPÃá÷¦çÄ'c¢ÌŽÉǹdŽçÜ2çA ÃCðGž…çN9>9/øüSæ$Î'3™Y “1UŽ?˜*h¨5þd¸Þk?Éx—îý6ÝÛÏx™p2É+!yOÃ32ó1Yæüð%¥K‡ú$ÃËðŠÌ¸ Ì• 2"PF œ€‚ïÇ…ñº\a•„©„#0ž› ³ +E—àªdx^“áUxMà&ÊÜ$Ò£>`0áëêªÌM&­§8„›Ê`Ò7Ôan£û`P†=0ˆeù )ë!=ËÆÚÜ|ÈÚ¦¥‰^£Á˺ÃÈUTÀª3»•ŽqsߙƎƒ¸¨Õj¤V‹ºTêñpÏ^˜¡Ö£´ødZ²zB[t ’5-2jÏ(k#•e§uó®‹-e=f›f4 =2ÜLÔÆâ&¨õÔÓð*HR¹•Ô=™—0»É‘onà¬óÓ©>³DP¹)ªTi¬©§K3¨³'•³úÊa-Zdw¾SO¥©’7Lo0KžÅ+®EÓäÈm–/‘zùæT¯n¬ 1–%’©u9SšÛ*$ÙÓÉ•<­Ëæ.Y´ÀÜŠ]£%ÏDÑÍèai«*jI¨ýªÃ/d|ÿ°³[…C{d: ½ØÜ\§Ñžº¨Ï&¢í¯óøœ¾ï ¯u陞a®k –ú D<>ŸMôæÒ†Ÿ¸#¦Jžl&o,áW:+¿p!Qܹ¾4•ûˆÓõœ»Ó¢GnÎiÄ|ƶ’‚-›`´m=ºíö£¾B¢Æk-djqãE;f9 Ìê}éD§N aþ|Ç->£Q·ƒ|â×wXæöå™>«÷¤‡\šÕצ6.Lt9ÒÛ—ÈætóÆŽ½r“ÙÎӻș)ä–ëÙ,•ˆYe¤MϦôœi3§ŒþB4:é‘D³53"9gú¿‰™qC˜rnDtøŒo=Y;zsc‚™‚­ˆZÛF³X&.Ìà£îmåjC«Çd•QßëŒÿ²e-Ã?D»+EŸÈYùÅ›ΉB>ctŠä²«´qXƒÉp5\ ~*pÔÉàx5^oØÊãÖx“5bkŒØÉ#6³Æ8`Xbq5Þf­ßnñíµÆ;¬»[cÄ&Ôïµößgû¬ñ~kĆÇqÔÊãCÆ8ïƒ9Â?áìLàÈDEùà¸ðÑ[À=„qð€ ù@Ž–CÉ¢H(5–C,3`yt/(타 D+ÛCê Œ€ñÑh&ì2þaËàÏðK‘µàÆ_€&$WµÄ\®šÝ0?“ PÝ “÷ƒ7„)»hÒ¾ä>Ô÷üL5F$Jà°ûúAŠó3ö©üÝ»ÐÓà˜‡RçÁBc$³Dù¤¡Y(FôFC„×<ÕKNÑ¡¦†ÕL ?šfp³Äú¿:g—åØ Ó$ŒjÇ2t®¦ôéèœXè8WUšíÍ¥€#ñc“ž ›1@ÊqÜa‡ƒ) '-p‰æ¦p{p¹cDqºTóÆp8ï…ò¸T£J¨G[¯^€åqYõ`h»Óªl øøŠ ùcª„ÞâG mfä™q¬ˆKªd®¬ÄaUÜW£ú q²*“¸ GÍOB'U%Í_^bïÀh’¿(À ªTíX­JªÏ‡šœdäªêÐ$—æÃéÉ$u?øù;á”vWh žReF}‰R‚û¶A§*+¾º¸_õï!ä‹ûkT¿¡N@ :Á˜‚©JªAT ^SýŠDéÂXIvà-E|»æÍ>¦øTCý¥+«;l1uüÁKåzÞRº;QÑfÓ¶Ãù3Ñh¬Î‰{Ɉ55EGåÞAøQ\Ú µ(m3•zŽ-ªãǪ…q8×@\8Ï@t>îC9?)ÀOMìgø¹‰]P€_˜Ø/ ð«ªY¿^µYDoÍ“ãý&f´˜rlŸ*[ñý0¶±€ŸÇ‘®ÿ2¼b]ÿ}ŒÈ _µî÷`²Ý¢ª0b½¤ñ·ùK¡Rñ^ eaÞ»õ ì°wCÀ»õrp³ª ˆØ0\T/!æ50™ZE¿*`p­ÇEY~. Kz}°ßÕ‡ÂAÊ”[Ra¾ç<­<¢¬º%Erq®ì…‹QŸK¨¢îR°™¹Œx/GëÊjÍtE?xÕ0î ÕC†8ú–iwÂÅXU<*Öì+ï«¨ÂØÉàUxͺÿL+gNáfS¨Ï©ÂkƪêÌCĪÙxÀf×þoL°“ÀëC¼3,ÞÉÜlל*J$cYQ›×-Vÿ7,ÖR©§qãuC;-ò›Žä2›ü_xË,Úä·árÌ>û]GrM~ÏQ¸Çþ>|0Dæ†È-ò‡ŽÂ·ÙÂ?r¼˜l ÿ>q o·ÉŸ:’wØäÏÏÚgîH.µÉ_À—ä [øWŽÜ56÷ÿàÀ˜4Ãï™VÂýŽô2›ÎçDmº‹ñNi,fÓÝÎô:›îq–ï±é‡è.ü%ú$üÞlÓ½Îò·ÙtÉù~²M÷1Ù‰¾Ý¦—8ÓwØt¿óùA›p¦—Úô +u’_aÓCÎü56½Œ•;<ÿdË;˜ÂÂù04±#ñ“cBYóh/•_³ñJÚ"+X¥ƒHÞò(¦:’]6yœ#™³Éã£X²õàì’­[•cœ–Ûì_»ÜdÙ¤¡¢z²‘Ž wHí®`²µÖµ¶»ƒjk»'(µ¶ bk»ènmzøÖ[aÃÿs_Ú< þPK[è]‰Oo(PK py/"gmonitor/gui/ViewDataElement.classmO»NÃ@œó3v $!<^qÑ© r‘Γs‘GØ„Ÿ¢A!Qð|bר¢ñ3·;³s{ß?Ÿ_Îpäžû †¡‡æ*NÕD@Œ¬©TÉ´ b$ /³œZçj¡Š *ýÓHÀ¸Ì&RÀIdqSyI ·­òè/ˆjŽ"Ç8ù¿ÕðGÒ¢Ve6ü1w¬¼t{ð°æÁF˃×C®À0™g´Cö&O*Œ”|¾Š‹ø:•s¹ ÐÎ,^Åa/’ðö~& œÐÿ,ú¹³è¦q\Éí’m~Špªcê â~ðèïÐtã|6ЩÜ]bv›Áô—Jî¢× kµ¼Ù8mÔr[•Ü£U4b+ÐõãÛØiÒµZßmž¯–Ç/PKåª&, PK py/gmonitor/gui/ViewData.class…SÙRA=“}]·IPâ¾ #`” ð4š15ÔXL€ŸòA-SVùàøQ–÷Nº "]Eîvîéœ{»çÏß_¿Ì`/…,–’èE‘™Ä2V8zŦÄé*Gkl,N_s´ÎfƒÓMŽÞ°)³yÇ»8¶4DmÏ­jÐv5D>{¦†$»¥†×8ÔÐcíÛÇvÁ>i‚Ê,u}r=ºØ‰®È~íS‰(E=çØ¡¶Tàe_ÕnÚ&ö¬ÚA£î6‡…Ú‘[¨¸ÎI‘Ósœz“þ#ÅÊvÕ=òIZIClÎ¥þy a#W¡ƒ–UGC¼æ4‹Á‘“FîÂCc®¿H§3hZÈ˧3dÜùY‰²ŒÆÍ«§ÓÅ]ßjÏ×E€ufDbl[dÆæé"‰Qio:îKÑSÆšyTnoËŽ»\ÐýÝ}Æÿ²%K(÷;”'|¡—¤ûÒ™#´ûÚ™#Äw‰©äÝÐ*Kí“ÎV#F)WÑ1…«:úЯcýqPeƒ:.±âò{Ž†ÙŒpºÃÑ(›1Nw9gs“:.cBÀr_ôNƒxv½VØø°ï|¤!2k¡'¹R6ÍuÒ\6‹tQ;¦eml“ØEkËÄ$}YúÔÒ±dŠB¬:ð$8ðC"ùˆÈGE>&òq‘“âÀ“|òƒÐx#d¯Q¶FuüBþ'´|¸…›pþ;"-D9ŽQo!Áq’âT iŽuŠ»ZÈä£-tÿ4\Ç qp/y>8šÿž¯¾ CǾ8‡¼NHö´’”ì[JvZ²o+ÙºdÏ(ÙÉ.(Ùaɾ£dG%û®’’ì{¸/à,]Gˆ|,?ÝBÜê<<‡ÒÍHü«ø ‰?Qó“ªæ§%þLÍ×%>«æg$>§æ‡%þ\ÍJ|^ÍI|/ëí–ë}‰E]bd—ÐÚ‰H\°Ã!*Û4\1¤Åkkm’Ö‘ÖÒ¦WpKï‹^4¡!Mê6ÖX†˜6iÓ6iÓû¾ïûHï6}ow……%ü}š™7ïŸwÏ›õ“ÿ{ô €¥ø¯¼IE o–ñ•ˆ·2ñ6Þ~»ŠN¼ƒ‡wòð.ïfÞ{uwÞ˨÷•áýLzð^}‡C*>„»eÜ£¢‡U|÷2ôˆŠûúÜÏä ý(¯Fxïc*>Žü“1ã(“Çxõ é9÷©OªØ€Q^=¬â8NÈxDE£2ÆäT4°—qRÆ)ËØŠ0;³ £,óQ6x‚ÉÓ<|Š5žáá,3Îñðçe\PÑŠQŸæù3¼ù¸‚'˜ø,ŸcqOÊø¼‚/¨Xˊð0kÿ"Œ¬zŠ­¡ùi_àÊ$TÅvé{ô¦¤žhÚheéÄþDÒŠ ¤ÌtÂ23MIs ®[zÓFÃØ­÷&5  §?Õ+ ¶·&‘ÉZ†¥·%;݌Ì2òêRûÌt¼Z‘Ô-#kÝDã¦DŠìÖ“IÙÄ´¬ˆ÷dÌ¡ÁI#=`í$^T@9 êåÓ;ͬ¥}Õ†UíÑMÝÄj7ÓYKO[[ôäá¡j‹ (KØ{}F‡>(`¶!+‘lZ§gwÒ&Q•Ǭ5ÒFF·fZ€¿º*“Ñ÷ÅY‹Àe†uñšêŠcº¤ØqòOwÃ(¶›q:¨®ÞÛg ²*rBêKšYÚôÔ-Ù"À›1’¦N¶« ’’Гv4¼70ÕJ†•RIÇ|dXÌ ¢8΢K“#`a] óŠ2XE'§$KÀ¢RG‹SÊZÙ_›^Ë ä£ë§‰Ê$ŠŽVÒÑ6c ‘ž¬–›R#©´tJÚ:3kMmTyØê=Fšp•yzR’Hv2Pdr47ö:| ¤¯ÏL êc“9E[Wï.£ÏZ±„ ÓK26ó-«¦0•¸gåC_TBîùCB'”ú’vÎ5ô!®áËxF@pÚÚÒ`bPÃWðU ú5| _×p+¾¡á›ø¹?Õ(ÞFÃn$5|wiØ„Í2¾£!Í;ßÅ÷4|?ñC ?ÂÌ·$̦¶}–a_‰hzpÈ"a†žbí?‘ñS ?ÃÏ5lÁV¿ñK¦¥át³-¶kø5~#ã·~‡ßkø›¸ƒ·ÿÈ«—ã¶1i²7c£Œ?iø3þBA»L Ñ ÏíºxÃ(Á šA3‘¶ŒLA #nÄ—rL)2K¶_®6W'Õ%eîôH eoÇ^ ÏâoþÎä+ñ* wò°É;xx5^C6MÍGÛP¿‘!\›ØÖ®!««ÿfBÑ´í†àŸöc˜º¡MýKÿ1¬á?Èä3d‹lOêÙl»žµ ¢tʵ&‘­I›V]ÔV‚:üRºgE1ËK;à%uäÈ£’/Ðkß~6¨ Ñ•°¸Ô…)Þ"8“€ëJÀ¯T€OsA·Ù=1j7×”¹Ç`X´¤9ÁW¿«_À‚ç}ù™"ÒéÔ~E¾ßt¼n{[4Êšª‹ŽoæWJé¥Ûsm‚’DXFºg¶”ªï©ý»,mÜ>ùü\ïúÊõ>yWD¯¤ÇÏ.qR@Íå:¼€È•+-~Š[í&§XêJ½.%$cÑ•à¸UNUå^czqçä›tÑû.óÓg¿¸þ¢óÎ~±úºX£÷kUZ…Å"üò+ûF˜ò¹¥¾…\–Yú¬IÄí:Þæ˜é¼a^}pÐH£¡¤žÒ]†ÌãhZ®b™ÎŽó*»"uÏ=zµôIº^†2ÌàMßZ3øù°gêýöL=ßž©—Ûó­îL ü·Ã¦ç¢‡hºÍë…Ê­U~Ähž °“x ¢'Í2Í ±ãº;ÎÓÎaFgãˆNÀӇȬp}ÒÖãðWæ9¥2~?úiéÉÁwjD$\PÌ¡ì<)(å `u#Q1ç`y3A¼~‚ø D±Â‚#ÅZ.ŒtoÃ… ÷lý(Y®à0ŽÕGð€=»è'’× ô£Øõ.@”À¾‡AÅ)Ìðp:u=ËEKdOåT È¯¸¨ÓPgY¬ïfy VbLÕ{¤S¨±µþ$fß8ÿ´ÒÉ»žùÎ‰‡?"†ƒâü“ŒaÇìòi%"18(yd”\!¯ÍðŠaª@Np sm9aÇ×yÆ0ŸÖssX‘ƒrWEfÎÉ!äì×ôH=rÏðjyŸÁµ†¸z8u` ÃÕX4†Å,‘™¶§Å¡Ï$7‚õTMüBˆòwMþpýê(K: c$§Dl܆ ,¢ŠDqØã…ÃÇl¤€,,—?™$2tÔeaO öÜ<›¾ \Ÿ‚•4Ÿ÷´N Ü=ŽzŠŸãq³ä—ÜH׆üÒpBo‘Ùñ€l»í&À路Ùç÷Ýò 4tW5ŽcéÙ| Õ Ê.ó4k~-XF—ä>l–ùµšÎá…‘ò`ù™Ãh¨TZììi®˜À2J墯qmdfP ÎÌaùÖþŠžÖT3{/ŠT£‚û5a乑 8ZÃ}cXíÆPq\{q>Šô­äÆ!I§š{±Øwð° ]|ÌůärX(Ƈshîô4‹~±Ñvdi#_]òc™sU[Ä{QÍ‹ëZ¼oˆÄдr¿H>QîCÇŠ¬¤Ï7×J?Ù2ƒfÇŽîùõG]3ïœÉCèƒÏõ¤Áõ¤ÆÓJ¥µ¢E¤ñ2G ¼Z(à¥I[-²äµx+ã÷>ǨbÛ¡n<„0çv­ý—T­ÌaÉm£©ª‚Ü”Ãj7ñ²5-’­]d# ¥Új‹==îrÝZN{Üt¯© žC\Fk»«Ö#z¶žÚ`Kjk`qRm@2䦯ÔU^—¯ò7à®?=$¿Œýq«²“Òwep¸E ÄT‹W N ÞQF G|Â(íßv€«:¨ä°þ$a4¨ø}9¼”³MU=Jæa!“/…~)8@Õä˜Uk'‹Ò6Å­ã„ tÒªë¼Î¥ÇÿPKs6À' ¸PK py/#gmonitor/logdata/SeekableFile.class]¿ Â0Ä/Ú­ÿ ÎîíbÞAPH—‚‹SÚ†’i‹ˆæàøPbª Òo9îwÜwÏ×ý`ŸbJ1#pSmjIÐÂ=·¹¦òÜ(SÖs§V·oYSI‘Ðà°æ<äm*åÑJµÝe~2¥jLÅ´É3Ѷ³±H´Ü*mŸø…¸¦E™³8)dÚ,>HÆãßð€€ ‡öÇNñÞmÕ%ÃÁë1&ÿxPKðv°²ùPK py/%gmonitor/logdata/FirstMetaBlock.class…TmSW~.¨¬SDóRÑÄÄj`µ¥IÓ—`L[4Úµ“’hL_èf[Ùev›ø½ý ýýÚΤ3Ì43ýý%ýœ³» ¡ÌpνÏsî¹Ï½çÜýç¿¿þðªQÌbe3¸Á§Q„±¢à3öŸ+È1¾Ê“56w¬+Ø`ð žk 6yò¥‚-öÛ î±ßaò~”FØ|5 ïþ—É<›‡lE°Ëü ›½ D¥í–) 4š9G¶Õ¨ ŒeÕ0×tW³)p¾3/4LãiÁ‘%Ë,;N3VåTšéJûP?˜êšŸJ“ìC§¹m˜†{G œJï ­ZeÒu®*]ÚXÏX¥=ÝyãHzAt–ÝYkÔè(“©ôÖú¡ž9ÐÍj&ïÚ†Y]HÔuÛ‘…¢aêö³B‘s\Lù¡†•ÑÌzÃ¥h©×–yÓèݧ%Yw鮜öΘò'Ít\Ý,Ñž·ú/ÔÒ[ÕšEÚ-;s`Uˤ6³nØŽ»-ݤ$JçØm—á,Mø;• 1rÇÅ ÃQ9ânœ¼±±Ã®R­NŸ6רT¤-017ëm>Ë»ÏzÛGcx‚¯Æ;•uË®én6Ã\eö6ßRZ_V÷g³—ò®n»²Ì5©™îió~ñ8Ñæ9Çw—û†6NÄ^üÀ|÷&íCö$NsðÂ à“©U–QÀõ¾‡C‘Í;Œ¥Ø”P&}ÿS­$*Ó=a9¯r~MtZa§Ó4Üõº4i“¥To?ö¶¨_4jdJÈ®d7°Škù=Vj×òâ3W:to~Zzó8t˜.Û c‰'ô(ÊÒ‘¶A?Ä·ßô(v©·fè3(ô§>ó>Ws§šx~!ðן |:ðªçG!¸÷ɾK³qò‚ü°úâO/LÐG7ÓC¿@è÷€~×ú7úŒ†Èÿú áý—ÚZL ·0²·˜ˆxŽV)-Œî-Æ£-D >Ó†C]p¬ µpö~« Ç»àñ6œè‚'Úð¤·pî¹'x7ðÉdÁ¿ â >RU 8ß„â .4ò?71ÖÅU–4‰‹FSêþ 2¤…æ5vX¢3šä A’$YN° ©51íßñMO—À‡TŽðq nš®3L>þ 3t—¶—Ôd ——žŸZ#ðIß )í Ý\À,–;t¨COýзûÒIŸÆkPK„ž÷›™PK py/"gmonitor/logdata/BinaryBlock.class}TßSUþnö.»„…B ¶¡ l­?Â&Å+P´©¨A -P°â&YâÖ°Ël–V|öðµãŒ3}ñEgZµÐ± }ÓÿÿõÜÍB)$Â̹{ö~÷;ç~çËþõÏïFPŽ¢íHàŠ“"¼¥ð~WQPpMÅQ(˜ŠâC|$ÂÇ Š*¦£ÐÄËO0#à×UÌŠdNÜPp3Š>Ì‹%0Ë-K m ‹ó3S³ ¬È ß5kv…žWxÝþÆbP=ó^iÇ·ê ‘µá'lÇö'¤ôç×Ü ¡z<ˬlÙö¿œÝ®Õé™;æ]3g»¹¢³µí/øÚ,Ñ©¯ËÖ–o»ñö7®†¨%E0¿%_Q :j4è3ÀžkQûzé9´Kä—ƒ|Æuª­ÏN3ĶL¯n­—lÇôvÖK5·üUk<©ÓQ±ê–g“¨BÊ÷,® hËÛÑžRµü…€‚DšØõ¥Æ (§QuÐþ¼y¯ÐO«åZ0* /㢆4 "©á¼¯"­`YçXaJ×L§š³»áÚŽoyG3bÐg]½¾e–-Ý®ëf.núVE·½´½±ay#¢Èª‚5 Ÿ!/Âm†Þ£ Í£,:Ëô†Šú†ëmš~Vç<¢às 븭aƒñ?ðÆÔt³®×hrÔÃ05è¸À<¬-D¹êyæÎ1UE³% oàM £x‹ÐÕM—¤r½\Í­VLßÌ‚j…Æ„»ŸË3Wºc•ý^-ìÔ}k“¡ÝeÊîÖuNóØ™ñb“WÁxãÇÁÔ¡íT÷ô61WÜœ~ªéÆï£ïTë·i¢ªfÔok·ƒSÓáºÄ/Ðç Ÿ¾=+ þÈ'Á:æ$'Å.úf(¾BÙyDÄ7gŒ=0CzŒˆÒ£à'o½F4 Ó?0ð ø¾zÝÈdw!O¦öÕ1ž•\J=A[‚? νœeÔŠ`H‡ 7!¡Ö)i2ûÔìÁ}t>…²S÷Ðþ,{çR^Îì"š—ãò÷hÿVb?âl6—¿[¤çTœ?€—ïÿûwŠW~:Q("<ÊR!ѪžÜWg3ûèÈó8Oþ Êi+±Î=t=~‚3'982t¶ÁÑKZ##ï¡û4t¸Ti A.„æÂÎ.v«Wš7×6ûùEÎ…Ééé819>$žµ4’4=ƒ¸£×ø ½cŠKa…>Ê$ZU#“$г'± o#šª‡Va*™:z0¼ƒËM¶#‡Ûïb,ÜÎ’DBO]ôÿ'döPÐì«3"—2’ÈÈl™†×TŒ™9Ðm±s¿‚7:ÄPKC€Ö¥•PK py/&gmonitor/logdata/SecondMetaBlock.classUëRÓPþ-bP®Þ-‚Z.ZÅ;ET(BDÅ;¦Í¡FKÒi^þú:þЩŽÎø>”ãn´´ÚN¿Ó³ûíÙKvO~ÿùñ Ài¼Qу±&´ã*Ã8Ã5†ë n¨hÀX#&xlDŠåS¼¹É0­bºŠ[ ·f +˜S‰:Æp‡až©w™z©÷™ºÀ²E–=PðP òÊL Í®:¶å9…DÎÉš†g$f×KÉ•‰œ“y“$žÃ¼#Õ¼y=UN³˜ÖWMÓmOÖ\7j¦³žÀ‰jrŠÀgMœµü¢‘ÎIâ7ŒYD''ñŠ<:é˜R`_Vzå± ôÆvMg/Y•E. 3Úš[;ÙT¦!p<Ì0$Ûýd’—@<ì€m*`¸©µÕ¼@Ù¼6ÖD೉¯`ÙYÒï±å[Ýv=ÃÎÐÁ£ñÇr(žüšG4i¬&õw 2ãØæœ œÒQêÔ»ŒÌ{–c» –ÚòFÁ•ËiË6 ï—ӥ܆{ৣўaÙ.^ 3^ïÀæMÚÔº´= 'pRÃÕC¯†cèÓÐãT¾J󉵕Y RôÅJÑÇ8ü˜¿ªá“׊¼¬rtTÃ)œv½\,Èb•€r‰¯õ[r™ëËâoÐy¾íÔëÂÿÌ*¦ùÇ A¬ˆ>#Èç>`ú | ‰S€U8Öæ„m9[±#ÇáÕ)“H»xÍd±£áœ¢+,z¸‹*‹êÊBf2•vð(+8Ñ#(¶ÊÔêbì±ÊXlš;q;ÁºÒ¿(a'™Äâ’Ï9&îAÙRÈÞÏ[”Çw,òm1;Å‘¥¾2éÜ(Þc›;ÞÆNùúPKµ~)u"žPK py/ gmonitor/logdata/DataBlock.classVmSU~.y¹Ë²Ô²”Pª¼Ôº¤Ð¨ÕP’¶JJ+‹T(”Ö·…,qivƒÉ¡Îh;ƒÃqúÅGgtFGf?ûKüâ¹›%ˆÕ1ÎÙó~Îsî½ðÇ_¿þà >—¡a²/!ÃqKF .L r[;!x¿ÀŸBzË—pÀ1-£º™áx[F“Y ³2¢˜ã˜—¡â!¼+á=a_dQÂ]Á—$,K¸'aEÂ}‘åŒ÷ñŒñ‘  !j¬r¬qäB[FÁ"Îî3t¹–mêÎÝ9ýÞ‚¹VtreÒë Ñ#}¥a %Ùgè3g¸ƒšÝ0¶ŒDŵ ‰ÉRÉØÉZe7;n9–{“! ,‘÷­b޹ö £ëBÁó¦;åe8§üCŽnòY<Ýe¤þÔcÆ£¹U^ªOG~4_Ø(OUìM†kšžÍÛEêªXJŠyÑBw\³DhL™ë™BqíaÚï¥`8ùÄ‚[²œ|ºÞì¢79åœQð*®*Aœál‹Î¼ŒW\ƨ‚1A® ÁЪ¶ÿvÁ´MÇ)MëÈ3ôœl SY_7K }žÁ5·ÝÄ‚eoLJ`Þ)–lÃ¥Fvè—˜MärÓÓ)ÛN•Ë"ë' gŽzBk)ØÀCex@tá>  [‡6,+(‚Pës/¸†½©;>Æ©C[jˆÈL{hr¨4<|Š Ž’‚2\ŽŠ‚-L(øLmì(¸G4QKL¼n"G8̯n˜k4dHË̈Ã0r´_UËžtI‹Óû;ôΠæ‡×}È.jÙãÈ´^~ØØÜ4ª7Ú*ï)U}[w^ÓŸa•Üb]Ck-ëËÖ#:qƒÿzfd:ŸþIbÐDÝgùžTbø?¸Ñ!¡ìÓŲ«;9s›¡ƒÄy+çK’äÇfõ—AgYÓ[€Æ =½~â¤{佄t_<>æsº5§ËDT׎èk$]¢'ï‹×ÀâÁ=´Å÷X©>CñÉ?y±"æõz ‹€£x°eÌåþÝ6vµ _Dz·›„Èöã&Ij–ï!ü?ãx<þ3Â_uC²èƒ‹Û؃Hr•_xŠÕºw2\çdïø2Ò»Ó,Evž4‹Ò1ñÉxp+j¸'XÙ”DEB1©Šç–w9ûöàëCt’÷í". ×}ó5L´0‡¿÷Í©–f~hNãz sÛ¡ùnú›é sÐ)þî#BûèšÛGt%z¶†îT°Óx(F3©+=¡zª8—âc¾{´·ŠØù*ú¢DbUô]•‚ßໆÓÒŠdÂïù#¿C{Œ“}á´!:Pä' ’’êáZÅàSdFU‚w(Õk¯b8) v1Ù!ìÂðâïèL)c1E•ÕŽ*.y¼lË»-ä—1Êzˆúx³[[7ù‡ú? PKÁPº1rPK py/#gmonitor/logdata/HostDefBlock.class…T]Se~¶Ù|-+ò•–ðQÚR5„@´ U(TBQb“`–*,Ù%]H61»©ÅkýÞ:£Ã 7\PGƒ#Ž8åÎñÚŸc=gwa’ÔÌäœ÷¼ç¼çyÎ{λýûÛ†aHèÈ£.a$/nûñ¾Dz„ż=ÆÛã,îø1!¡ÉñMJ¸‹Ùœb‘`1Íâšñã£>–ÐY¶“¼ú„Ý÷y•b‘f3#aŸrÂ~Ì TmS7tK/B©-婯Xz>>U.+;)Ý´ÆøîpȤOdà‘qº¨jš í«¤aZŠ‘%ëvÄ9¬ãI£T±¬²¦Æ“©\¡H§‹åx¾˜SK‰ÏMëž¶™È³Û”]šy–ÕJÌÀôcA@ §YÓÅŠaÙxIm%¥ljkº¡”wÖ6ø˜€ÎúxÌ/`ÉÒœ€ŽÈ€–WŒ\ÜÙ%H™ ˜EÒPµgTw¤6ˆ[Ý0";“× SºyEIn#d‹†¥è†Éž+2n _@{[—q ×ô¾òòd,⡌GˆÊXÂc^=Ð÷?ìd,cÅUŸás_`MÆ: …Å‹,T—/2NT67µ²€æþkçYÜà36eäðDÆt^mñjXÆ6†ýÈË(@•ÇÛzj&ìÞ&œÖ¶Ÿ5vîl4hÜTÍÔʺ’׿¦q 77žOÓñ-,Χf2n%¹ÕÄŽ¥™Kºõ$SÉçtÕϱšàÞwÔp|¸¸L,6(Ç­Óñꌬ&’ɺ#45+YšRÕrƒîÑ&Ó™/C)hŽ•Ñ³ÛŽÕfò+(*DbçÏ£¨ê…tsÖ¢a"/+{ÏrýtJ©¤t¼;2]ËØéíxÍñ³zbõjhœ¦™¸d¨)Cåš´\ %FÚ—%oâ:}úèûHã©§U€Öô4HÞ$«Z-ÑCÑ#\Z>„çˆÏÁ¿ ÞÀ›ôÉ;ôpä¼äKÇ¢ÝUøcvä[ô)S„þˆºÙ;Hsö@ôgˆUöíXƒˆ¹Y ËOú»Ÿü=öLöR¨´‹oÐD(ò˜ŒUñÚ¨/,Æ2„’Á¼­¹ôÈ]Š~piÂÆÎ¼°1]»>öVÑ3æ û({¯ø#‚!qbAýï!Ý?tö÷ìSâ f0KÉg‘²5C¿ƒ[.ô]Šð’îÒ.4«n*í$)™x;°“]A…w᪭9Ù»xÏMÖEaÍ6LKÈ ËÒLŠø”ƒTÐVtC7õ²ÁÁ›^U7ÔhÍÔKÑÑJEÝJëUs˜ƒó“Ä98‚}O8ðc傯Ách_¦Œª©y ›õr4e¬×Ì)³¢©ké¾tq­L»Ë•h©\,¨¦Lk+‰R9ÿŒ’KÉͼ¶Îª"rp5s¬\3LË.Å¡}]­Tµ¥œn¨•­¥ÛÆ¡«¹Ãs™eéF‘Cg°¯!+©F1Ú˜%KYDÊ(h›têàe ó½ñ?UVÛ$ž›M”)&mmHéTÉ’¶¦1öÞàÕG·EDr-_6LU7ªÉ kWS–y=¸Ã¡£ÉíȸW8ø_ö’e<”Œie<ÆÖ£×tûåp2f0+bNÆ<d|†EŸ³f Ëô&.R&j++Z…ÔÛsι‡mQ‘“‘GAFë­°^DFOeèX–ÑfIX÷žh\{ÇÙ¥Ož• ÝgA«j]-é_Q%*WU"+ݪ%qNM?J'³8º¼6Z.$¶L­:£›O³µR‰ƒ¯yŽ…»íÎKŒ§çˆ"G9îž–^Wp!‘J5-?gÕª–+n›(=$Èêùg†ºF°µP¸ Ì­jy“*ƒV©ôØê9+{¬ÔõuÍ íÝÁ±Ë,K¾´ýŒ4Ò ðê4׉%KÌ£FáÓwqQJDÚ5µTÅúèWHwÂJ˜znêSSû*üpPh € ¢eÀ?,m/^£ÿÜ©ÒÁ”‡HäÌDBÝuˆ‘}Kù:=×Þq€Î4Û;—ya3ÇC¼—ì Ä&¼4åýž˜n•ê¸9V6w«Ž®™mžÛ=ù'r¼ )æŒ+ΣpÊ>µ %—,ý#² Ç>D›a.Š[F,ïì ËÓØÁÀygE¨Ãs*NÊÞÍ ·—Ù…Ûrÿ»ßrûñÈ¿G‰ÝHb‚’O mEfÅ[¶õ×–ȵÄÃBìY1ž¯pF0d6Y3Qm‚6?ÿañ]ÈÛ-'Û‘ü¡ð„≹(*®£ci¥ã,¹ÍbÑŠŒåmܵYî“B ØËeì×ÀBwÃ4Ó8Oã"ûö-øHî£ÂöÙÉÞÁ»v2)X¹^£Äÿ Çß(@üPKØ®ˆôl PK py/'gmonitor/logdata/IntervalDefBlock.classT[sÛTþŽ-_¢¨›JB\Ú ¶cÇPJ€º Ôi .Ž´4$\\Å:qUÉ#É!á9ü ú’ÚêÌ43ÀÐ7~¿_AÙ•Ôt¨“)žñž½|{;»:þóðW³h¨È`6…’ŠfÀ›)¼¥Ò9Ëä«ßfr>…wØ<§B mï2÷“÷Y¼À\™ÉE&—Øi>…ÒøP…ŽËL*lY`î “Å>PM¹aÙ–o9¶€^»cl¥®oµK—]ר©Yž_H^dȼ@<›») ,8¦´å÷UÛó »IR9:[N©jwºþuß•Æf¹š«µ6òvÜRÛi™†oÝ—î–Ѿ"7*m§ùeP·›²ÃUx)|,nIÁéÚ~³JR,¶å¦dU6ûœ°’t דuË6ÜÆ:§?ºVî-í;$YvK`,› amÃn•BmYÃiœ=â¢4œÂ+SÏíWÃUT5\ÃY Ÿ &0ý?zaü’†:–5|ŠÏ4|Îä:‹7ð…†›LV˜|‰U“ÏV^énlH—.dúL=§±¦á+|­¡€o˜û–¹¢@¦¯²Jp“•ð"G¯qùp€´¦ô¤kmëZŒ‰ãƒ7É q.mOõiÙËëwd“G(hü'ÈÇ<·¾ãK¯ÊpÜ ªyÒ¿êx~Õ6å6¥È™I»l™‘2wþi¸1²Þ°6e£k[Û O6ÛôØ÷ûêÿ±vÍ©HO ¦É ô—Ÿ[{FíÇMŽ´Éq2»Ð¿jáÀÊ}÷(ö¸0˜¢W"C¯uÅ{J\’xZf¢S$e'ÊïCä[ÝGü”ûàß^Å4½)OqF A äR!?ÙCªp/@¾F…"½Nÿ7p6Š>F'GOçÒCúçK_2rbœ¢ÇèÔAñ~‡FTÇL”Û')Içíø¥ ïâÖTªB«ó3=œèá…ÝXì ÿ"ñÌÍ)E]ù±‡áPJõI#¤Žÿ}[Omß"Íèn,(±ØÃØÊÞãŸî÷õDŸETñÝBŠÎµè«#'÷ñR]W—þˆšœÏ)ºrê.ò¬Ð•°© ‰™!µ‡ñ•™‰ë&zxyeW{ÿ*<Ú#{²ðh"ùÕ9yº¦'¢NYêôÁ׃jð/PK“ÈÑPt@PK py/*gmonitor/logdata/DataBlockGroupTable.classT[sÓFþ6ÖÅQDÉ‘¨‰r«o`HiÚÚÄ€CƒÓ´„ˆaäxñ(u$#mZÒ¾æ?ô=/¼ÂL£Ìá20}é?ècÿHá¬m˜¦v4£sv¿óËêí_ÿ>{à$nGFGÖ@2ýPqBÇIƒtFŠœDNÉÕi“’ó•CÚ œ‘âkSq|c`/¾•æï¤Èë(ÄqV‚ÓR¥8'éçå꼎 ªpª Î`U–ŸÜªp¹ Aà¬UÜP´³®çŠ"C,™ºÅ Ìø5bxü—² Ç[¢]1Ùvvý\Ùk®Špg¥PNUê+>yûA®á×kŽprI”þÒO—µyCæ¦$Æì£%Þ®ï…:J v‹ÌÙ_ážF“©]Jn:AÈïW]Ï ÖîW¥/ÃXïÚäYâ§ëÕö½Úp¼z®LÀA†‘ÙLL ÁpôSÎgbMÌ⒉˸Âpü#^³š(㪉k¨˜˜C…aÿÿ+,­>xÀêÝ‘C=óÀ÷2)ð#CêîÇúÑÉLßrÔèiÉ›¸Ž)nHqÓD i†‰®¸¥VJíŒ|èÀü‡FÓ ÕxÈ×i¸¿Ò ٻͺ°Eae†=„Ö&«k‚‡eOìÞ^¢ÆœZ¾Mò?¯.ó%QHÝa0C.®ø¡({5þˆR$[™wkp‡og($‹~Ÿ†TrÊ©î ôß8Í&÷¨€l¯ ]P»•ä7¾3^—ufW+¾ ûaœ®:OZ©´¦&yˆvˆÑ Lo¥·Ñ·¸…Ø&”§O?ù¦[ã=3&™ÛP‰¤ÍeÓãôì“ó½ E:Jï1ïD"-£«é? ´‰ ¾D²ò!ì'ÍcÓĈoà^:¡¿¸Þ×—x#¯H?[‰0p;6¥ZjbãíßÛ0(½™×ZÔ)ÝÖ,=Âriqâ>#ÀV,ÕÖÖUöøíŸO»ê¤1íÔù;'ýÛ6ö.na¨"3/ν–*Âp16¥XJb×$`4ò ûòjfØŠ°ÿvÆV_D¥"5K£õ™Á|„1i±´É¶¤­kTÈ?ë ÉÍì›Çt@=ûÆÖ_RÝŸ?¡o2„|*ÃGØÒô¼PK#: eRPK py/%gmonitor/logdata/HostDefElement.classuRmoÒP~.0(ë`¾ ›:§ÐÕá»É4&M\¢øÁD¢ß*-•I[B;ÿ•&ÊMüþ(ã9¥×~xÎ=÷9÷9Ϲ½þþü `U”°“Ãu)ì(¸Á±ÎÐ`ÐóXÅ.ƒÁp“a‰¦‚[9ÜÎáŽ@¶?<°¬‘€öòÈül6¦ç4ß„£¾ç<P>úAè™®MK¯ßý4Y–º¾ë{ýðˤT÷)}"®7Þ dZ¾ÅGB?)¨Ö²šc‡­EµJ]Z»Jµm2pàYmò"P SƒyÊãa˜iOýj¤Iµ¾Üƒ½‚S¢Áœh0-¢Š E‰§Ç½žMµ%–xf÷žl×öÂý"îâÃ}†E”±V„ưÎPa8‡š€ØØr\Ÿ¼ú£æÀw,34›§åʳƯ?Ù]ÚʚáíY†l²¥­‰SºÖšì×̱­ÿ²¸B/ªDO1CŠ¢UŠgŠâz+Q,@ðž¥l¢ ¸¢Ÿ@|‚¦?Ó=:–¦øþRïN~eh™1V:FmŒlÇ(ï‘ëúw(Ñî,Ï/äêB^ˆò1Š_ãžP[²De }qJëd‰éÍØR,®G'¸ñœì%©l>¡7¥´’Ð[RZMèËtíZ#S)ŠY}÷ É=^•óù„ß–óJÂ_“óê„Ç?PK…¯Ñæþ~PK py/$gmonitor/logdata/OIDDefElement.classuRÛNÂ@= Ú(ŠU¼!(^K­òŽÆDAʼnJƒBk°ú]š(&šø~”q¶A©mr¦3çÌÙÙÝ~~½}ØÆVq¤Ed¢!-a‘Ç%YËÈXá°ÊÓ5 ë"6D¨ á³ãƒrrm<ù¦a[ùs·Ý°­ÉnTol£e2» »áî‘\Í]0ŒU%×銒êq.ÈcÌ2Ý2YìÛµ2¹1L©º×õ—£Ì›+v7XNªÃ­|áΓ˘€Â0ýWsp_¯›mš…4%³~Ø4[¦ídä qØä ËøŒ‡)Ì0°†ŒÕrhãN;ßt¬šáù_ ‰þbgW×f•J‚q{kÚ5=hÜ¡Rw::‚TаÅYdéfãô#„è¥]x_ /Š`üT')› È(Žj¯`OàÝ’>}DmaŠ…w„._>Õ•‘F+zª¡¢' ˆ]{†äUûyÄË;ˆ>úžÓ˜ñ=5òäKf|O_­Ä|§¾ÙŸ¾þ¨ÔУçi©GÏ#åÓŠw€ m¾ ÒÛéB0/uy|PK\œâ3¥NPK py/)gmonitor/logdata/IntervalDefElement.class}SmSQ~. /ëµÁJ,3³PÌÞÕ¬|)!•ššœ¾ä¬îq`×aÇU36“ÐÔL? Õtî² ;í‡sîyžózÏÝß~ü0‹· ’˜ážæÃ¸/õ)Jñ(‚KñDЉ-ÊÓ’Bâ©4—Ãx¦à9^H±"ŪtX a=„— ‘ôòº&NXž!lT4Ç X•š ´À“Ç݆^9Ù5ž¡k&C¼‹5:`p©¢W¬ezú¥X54J¶ŒwV½¢—’éüôæ¡z¬æªª^εáE ,õšjI‡‚§/ k£Û+å§n ,v‘õÞî™Xêš›çBTšz4ÏŘnL€ p’ôL›<wN˜Þ;ÇU\céo¥Q*‰:Ãp^·DýX­®‰ÒzUÔ„n-p¼Â†y) #¸ÄqYŠF%öšcLžn`’ã:6é2çì/„-Žm‰1ÅñW0Ê0Y®´&£ž«eMµÔ\a†h·ÍâÞ¡Ø'(¨ ]cȦûwÔ¿¶ö\´¼”×ÖÿaWÿËz<ˆ›H{¾–h/F›¦ñ¢X¢)ªB/[ôøÍÆžiÓ˜ Ÿ"IÿÜý3tÃtòÉK¶5Ý™­S޳õ˜\'Éq²b¤™ŒÏ´À¾B~Œ–1áЇÀOúÓOø>¶àßÊÆM ìdSMw²Ñ…&B;ÙÌ7„ÛöŒkGzx¥‰A²gÛ6¼…!;SNíº>ùœº9ª =éÔ_$ßñ¢€í*‹µ&â§NÓ71Õ7õõÙ¡oyÒ—¾t‡öuèá/=ŒCljö‘fRg»7vÇ›¸|3Þoßh03~†a—Ÿõ,¯¸åsž4wé9ï슛ý®7ÏÛ<þPK&”E ·PK py/4gmonitor/logdata/CachedSeekableFile$CacheBlock.classS[OAþ†miY¶ •ª ê*·[h¯ ÆÄ67’`RB‚{&†á˜(ÃÍ¡’Ç‚ NÕî3dë«ošï˜ÇPhÈ(Q[ЙƒžkX„¡aÉsòª†,.ix 9’†2¤†eT4Üaï'›UZ%“'Œl.}ܶ-[ ç@5ãÚf­2¶¾¼,Iq–£‘œp6W®%L'±d[«²6œ¸)?]—ŽË[L¬0¡Ft%–Ö]R:uj¬ô´U¬qJ5 ×ú:Þ8ý?jèÂD³ øõÈ:ȪûˆÎÓ™X@WwÑ•‹Æ¢ƒ:åÜ=Ç~cю͵ÊäÞÜGKþŽS©9-¦q±zPW³Á-$Y©‡[ÚˆŒEMPK py/,gmonitor/logdata/DataBlockGroupElement.class}SÛnÓ@=›ø’˶IÛ8\h ¥8!i ”>PÄCDWª¼™zܦv”8U?€É/y RÀð5À®ãPŠ£ÚÒÌΜ=sƳ뿾~°†)P,êXJ!†Å$ÒXNánÊpEš[2·*W·S0QÒQÖq‡ á96sm~B@Aò­×óÃX{与ÿ˜ n–^(;žÍÁ÷^ø]ÇmäÌÒÞulÕÚ–Ûª³[´Åýݳ2‚- §E²ñWŠöÎmQL&Ò½÷,ô8?|n9ÝFs—Õ-×n°:Á†É¢š{­#O´êukm¯e[¾U{ë¼¹Ýöö·¤üœÓ‹”RMÆJ¯)²˜#Èÿ_t»ßlò.E³:*U¬QÔ°.Í]ŠÌR, §ãÅ}l¬Fš¨ ´ð´ëõ;OÚüˆ»>AöLªñæ€ïŸOM†«[í>o4 1isÖ¬N‡»6AÅŒÂQÆøƒ¯`î\€/š%AFž#«gôŒŸˆÞóSÔY‰aY\8*.gL¼bZÁ*øˆº°ó"’ž¯–OA>B>DN6„×MÂ+ß{uŠxù”/PGвÕt&ÆáÉ!Û@>R\І!|i*œ˜À—q%„çƒæ­\ø eÒÛÕéxb‚P ñ‡ˆC“ÿ§²©T+†2BjS5ÔØjlX- 1ñ4C¾SÈûß?Ã:×p=¬³$TâÂçBÎLqLQ•a|Ü5þPK]ÔOæ+ PK py/"gmonitor/logdata/DataElement.class}R[OQþÎîÙîRŠ–rñ² xA· ¥ ŠÊMi ¦õ¡Z"<˜U–R¶¤Ý’ðâ“þã‹o¼h¢‰”D?ÀßàogÚ¥A³Ù™9óÍ÷™ÉùñëËwØ #ŠáœF’Í›Q×ÃÐ0l`Œý 67 Œ¸Åám6wØLè˜Ô1%ÎÏ.f3Ïægï ˆ¬@[ºäU|ÇóóN±êªt"¹'éô\.W¯ãœ0ÖŠN!µã»ÄK h|¬(+ËtØf2 ¡©uoÝŸ¡¤•Zˆçdº´JXkÁõ盪'#È‘Ž´â¬¤NdãË’|C8¤oTšÍZYæ8ÔH«~gÈ©dª›[ÝV6_Üp¶dÑñ Éœ_^÷ “ôb:‚s8‰žÎà,ÿ]—ª®­¹eèשTËî¦ëùÇw&"˜Á]6÷hèý”™EŠ3i6žÂf‰Q*'‹¥Â*‘’Ìœ+ÖEHòè®GÏ7Ü~}¾zë[[®·*0dïûø('Lë„A›¨á—Në„…0?ý_õ…¢¸Ho1J¯D£…¶#F¨ƒN :éÜõǹ›,-šß¯¾îiûd ªéŲ}tÊBÒLÛû¶öMîA±[ö ÚýlÌ=Hû3Õ”/ß@—»êcNHS;J|Bã-÷S{ Ùvò‚Û¤Zù>€/áò °ò1€¯` €;h…¼Î°9vÈ¿ŠkM¾Ò䫨B<€c?dÒ8‡ÝÙlâ*Ô:ÞGCâCHøkZ‰F~ç+´§û=LAL¯Á0kh‰…)èá •‚"d—¢ú¸ì’o1ÀmwÉ1ùm‰èh mK»'¢#½’»?›‚Lç!j8¨$È7V‚ßPK$DIô—’PK py/'gmonitor/logdata/HttpSeekableFile.classmTëSQÿ]YØu[ÑP*L-¬‡F/­0+5M ²ðQö^áŠ(îÒrmªïþ-}©Í69Óô¹?ªé\0P‘™{νçüÎû,þþüà"L=ˆ«¸¤£—%¹ÒŠÓ¸*É5Ã:TŒHñu74ÜÔ¡#!ɨ$·$Óqw4ÜU1®Ã‡¸† É'5Ü“ü²MI2­ã>fT$U̪xÀàÚrŠ ÞÔºùÎŒ[\Ä3©Q—ì2›eðÜ*Xq›áxø (²Ä LÚ9ÎàÎí2qWX õ©÷Y^Û*«H¨\øXS’;ÅáfŽA ?ŸH&#I©å|ƒXx6²d !ci<”Š9}8cà,‚ }uHÚ,®ÚÎ&϶ØÀ#„ r¨:G|`8ÂÇÑ-òRI«´E]¢UÞd8ù¿!r Åèþé4ÄÒgÝ-}Ñ ù£¥&ê&y?Î=O¯a(pFwÀ¢»hYŽUàÚòîhëwx>AKV }%§È±Jp† ‘s颭ú¦óµe€ŽB‚0¢{ !âJ5Î7¸+hý =ó«À xmt¼ÛãDÛÏ~irB»½çÄ&Y+ñlÃIB¡»ç:nyéíÉm›º)ßž€â;¾ ßò:}]ødâ÷7‘ NVp* PxI 5 Æzz+èÑüÚç¦4†èo´–†:&{扞¡®ÿPK ÞH”uPK py/(gmonitor/logdata/LocalSeekableFile.classuSkkÔ@=³¯ì¦ÓÚÇ®]kÚVM²Úø~°"¨XØR(X(T?M³1¦¦M¢ˆ¿©‚‚MAÁàïdÓ¥Ý`BfæÞ{î™{ÏLþüýùÀé˜À•ÆqUõ: e˜Ê¶Ôª£Â×uÜÀš2m5ÜT¾[nk¸£á.Cå¸ s›ûâ“°}i¿a_%é/>;îûÄ—a¬áCÕ dLþ²¡@5÷ÃGÄ ­œ!¡goíí»NÒ5_Kì 7Ȉ\ÑgÐŒ×Ïz=³§¢®ûŽ&cC‘Õ¹D~è14 óßÀÛåhbŽc3 íÿµÍÀ"¼Ï1‰)Ž *å"æ5<àxˆEŽ%\⸌eެ2,{’T‘H¯/aoJGÛT™Ø Üçähs …¼³)3'ö¶†2¬Œ(]ìR)ÁOcHåÀ ½ä-=N·€áJôR{t›JJš5ò7Ñ"ûÒ)Ïm’Åh®[?PK¡±$' ÛÊ* ÛIQ?ÌÀ¤‡t¥!])EãkŽ$ÇÎ’¯BóXF7¿B?,Àéèrx‹~ŒòÉîK)ÆŠ¥Ò祎´Å¿eXüPKW&Õ•PK py/*gmonitor/logdata/SeekableFileFactory.class…SkSÓ@=K[Ò†ðhyø@‘§¶ˆŠDAÐ Ž :åÛÒnK1$5]ý)ü¿ê—Ö±3úÝåx7¨´Jf²799÷ܳwo~þúöÀlýÓчëQÜБDJøzŸÐ©aRGSQXnêhÃ- ·5LëèÀXwT¼«–{:ÚaFq_‰Ìhx DL—1«–9 ó2´ÎÜ‚\`%S¯ÂË^Všñ—ô`%í}þž[®Öö+{.eçÇLà=“8Ï¡S2Þg¸ ㆋ2>dÐd\b(0tzš¡Äp™Á`¸Âp•Ád˜a(3X ×dT%°¡ÑÜ™ùÑS"ÃW´ëZÆÔʥ̘]5Ê¥#ÚrV¹fke{\3뺄ÀQ£lØÇ%´Æã|9«HÚu—æl}¿c$¡;>5˜Ï'¼Ü)C³½bäTFMBPš7ó“YâtCg”í~W—§4: !ÛrÜ e O­ ”ó žŒ;Úºm˜™jU›6jö À•x“öÌ¥+zÁ>²·V㑇Ê3äµÿ5¤w™¬ÑM:Ë8µ:„ý8 !¼JG10–Ë‹}:„±?£Ù—3ƒF)_¶õ’^å{õ®ã†„M« Ö§§9ds|¹BÉø8„Op#„[¸-¡Ý#íŽãu¾ †0;2> á.îɸÂgøœûúBB´ÉN/Ô«†=·UÄ!‚ö >@&@Ûc´L&£›#­Kð=°WéÏG¶‡ ô²®¿«dÀý]L¶¸ßÿíðṤÏe÷ÎÝIú]>N|ÀåcÄË.ßMž”èôó$Õ@Š‹­‡‚Á4宩²êë Râ„ed¶)«¬€Ue] èçʈÊM°[QGèÂGhÂ6Ñ… uá{5 Ú࣠§ÿ¯º¦ÎsZÃfAç±UÔ“kT-¢z¢J£¿¨' eeÕ‰qÿ}Oí‹l_ÄŽoQýN‘þpLœÄSô¦Ü½RÆE1þ”ƒ‰ôºt§Ó ÖÉx'¾#Í+ÎNšMâ.§sÔ &$«²hPPõ«A³Û1y^^À)ŠÄ!+„„‹t¼‰ ’òý¾F¹ r½Ç¨‡EÕïöð.–ðˆzÈéïÔCNÿ¤rú·è!ŸîîLDhÔø ôðñw¦ÿPKÀcßwM PK py/ gmonitor/tools/DumpLogFile.classT[WQþ Žãý†—, P¤¬,A­P) ÅòÚË †ÌÕkï=÷ÖêÅg[‰®lùúýjDÔÔUÌZ{ÏþÎÞßÙ7æÇ¯oñRB;®W¡ n.<\xèçzÀŸD>~7$Tᦈ! Õ¸ÅÅm w0,á.îIA  AŒrsLÂ8îslLÄ -x("$ß“"¦ªóáéP¬`f &[.!sÇY“¡˜Q¶¯´´ª+•¡1º¦¼QüiEOùçÌœ¦§‚ öQM×Ìq«Û³È LIrmu¯œuæçÖ\A'¯Œ¢é2® GÆe¸dtpÑ ÝžJ©”š\å]è¦}"Â2á1ƒ\bÕ ˜Òâ †¶“XD§´éBUÉðã'2ž"*bZÆ ×1³x&â9×s"æe,`QÆ^ˆˆËXæ„MG„‘ØÔÛ„š55ƒrYAC{*cP½FÎoF:ïŸ,d²Q#u”Í5½Ü­þ¸øØêšš0OA‡ý`ò¦’3óKšùš¡Å}NÇ–/À©“ e¼\w ¨ì$ƒÍ½òPÍ•d©§IÅTü óqéꦩi:%ÕuÆ#¬åòæ´j*¡´‘X§yèêFD§DõÍuäøÒF<ÑѦtŸq™S†žXè h÷î‚y…X¸°r!xm;°oƒÿx̵rLVz€± c¬c®þƒÏèìw 5ŠE8>¾ÉK&¾·°­ß?h{+©| R‘ô»}TŽ_aß…4³ê¸or@°}wlNÁi+¢fÉiÛCí°Ý)´Ø÷P/<«Ÿ&&‹ð 5_ÐÐ_DcM„XËÈ@Í„lÁ1ã+¢u»Ô‹ ôù}úú*5·SrÒµûh‹SÝ—¢Dæ<,PK† «oþWPK py/gmonitor/tools/GlogDump.classT]sÓF=kÉ–,–/'‚ÚMI(‡D-´.M-ÁIpêÚP |Vq£D–<’ ¥ÏéL@g:÷µÿ ?„ö®mB•¡ÒÌYíÝ{¯Îž{wÿ|ùü€QxÞC!†œ0¢bTŒ†Š4|ˆÓÎà# (¦ñ ÎjøcÆqNÄø:ƒó>Óð9.˜TpQ¬•4ôbJ¸N+˜Ñð.)(kôƒY_(¨0ì NÏMÎ7ÃF3d`7[–…m‹<,u'êŠíX®Y·2•Uói8¦[3Bßvkã ©s¶k‡ç¤üÐ5ù¢·L®‡ò·þë,Ö%¿é’WÝ´]Žãä8‚~ŽGÑOTjŽW«Yþè’ðxLjሂ9ŽË˜Wp…ãK|ű€«_ãš‚ë7°¨à&Ç-ÜVp‡ã.î)ø†ÃÄGË ,ŽÔ8îÃfÈÕêqö|ƒ~µl†¦Q"˜t¼êÇ*ÖD"‡£Ž{ =­]ØžQžŸú¶j5BÛ#Z.wÓ„žçÆ e+5ë ±¯“yás`[„ù¥U«î0µu‚‡¦×íð>ƒžQŽj”e=MÕ¢YaÙ¥,n•fF\†Ê®áTă?mûA8gu„`8–‰ÙéD‘Š\°ªž»üZèñ¸Ð7¼Æw*ñ(­:µ‡'zN¯¼Rý ‘i –Y§€þ·ð¡n4Q†^¢Ó­=1‰”†˜9î.âSÛ¼m; iR¢b¹5QC: ³mU»5ã{͆fv—Rl{uy6CÛ1.ø¾ù¨b¤‹ØßY­ìeBÊ.—_ßh»ÉD‚VG„–ÿÀtJÖJ‡ã`\aÞt£è³ùòÿð‹U8ÙÒ’a£­°Y]»ê›U‹NwŽ®?@¦—Î|ëk 3íŒtÜ[#Wá š@‚¾€\á)XA~‚„I€\È$Ÿ µñˆ˜“˜2$z‰]c¤‰¾á82Üw:£DP#µ ­@SZ\O°Íþ~•6ߥ²EÔ4.ü†Ô3¤/DÐ*{æÈ’ÁÞ_Á‡#ì°,RÇr*Âþ¶E&Ë"ø¡(KŤTLé)]ÞÀÔˆžú>ÂÁ1E*ªºš%J™ e]ÐózÇÒ”'›Ö“”Kp(Âáõ$[W‰è_ë)Âç›PŸìVK­ñ]þ@C]Ur¤I‚Æ}¿#·Hʼ[!ª}ímâ_PKknSÜ‘¦PK py/gmonitor/tools/ScanLogDir.classuT[WUþ† ™Ét !”‚:½¨!)Œâ…šô"`(( õÒir’Î%ΜT¨¯þí k¹–uéÐeÖbùì£ïþuŸP @š¬ì3gŸ½¿ýíïìÉ_ÿþ±`ßkÇ”‚w4ô`*ËxWÅ{’x_x¦\Wñ¹ò¸¡â¦†[¸-?fFÁ¬‚9 ˜¦ b^¬ "ì# ‹( ³$ÌÇ*J –5ŒâŽ€\Q±*Â>Qð©Š5w5"ð™F…ÖÅÓ†ŠÏVYŦ‚{zk¶ÃB C¥-ë‘e6¹í˜3A`í”ìç%ÄoØžÍoINß;q,¯n®ñÀöêùñu òœ_ebAÓ#›n»\Ëöt\Ã[»àêÈ +AšÐñ¾Ôñ¾–p±ÈÙ67×l·á°‚ÅÙ‚¸'”ú˜ËËfµj,.æ\7†¢À}–ލP«_aaH¼ŒvS†°œ‚ª†û:j¨ëx[BòtÔÝi×l³VcŽ-|CD:¸:Ëê¶—“Ðܬ`/6u<Âw$´1ïUsbûPÛ7‹+óÛÖà¶Oâ f2£ÃcÐ^ÂHÝõé üÀä¾ï„æZÅòJ~½`ž$ÜFëõ̤L =å=Ä~‡»9–Ý‚+Ù±©To„¸ü#â»èÏü™\”z¤Ýÿþy ´Ñi¾Ÿ#þ  Z÷[P˩Ĵү8—Ò#ô¨ˆÐÿ?‰§±çÿDò´0@¥SSÈDŠ0<ñ /åäJyyºW,#ÓÊqpê"f[-÷îÀ^9Jìzõ(H9”Ô"¼¶‹¾œ,H^"’í¾6ŸR7üŒ_`P/ ¼Ý¡Xœ¾¤X —ˤڕÒ3\ÉFxÖi¹£ðThX6X„7Séâ}ŠáPK¿™¯ÌPK py/%gmonitor/tools/SumRawDataSeries.class…TAsÛD}­$KÞ†´ jëÚi)Èv·ìb—ÒÐ&%nš0„)¹ bÕ¨ãØŒ%CáÂ%'ÎL‡éô’K™¡{†@àÀ‰  —žá74|++f’ Ã÷­>}ïíÛ·»úýÙ;f°lâò: &Ædž6Áe.š°1#CI†ó&4äe¸ ÃEÙõŠüðª½&CYGEýjwøH¶Kòûë²½*CM†Ë:ÞÐq…A»ì·ýŠ“»ÍÀ¯uƒvB·ÅPqV›ëêètKÍž_z×ýüººµÜþõ¹–·îµÃC"XsÛKÞ½¡æÔ`Y]8œ&Wg°îøíÆ¼ß Â¹{kž×ðïùë$ñÌA¬#ðøÌÓú‚OöP¡ê¹’wüVk®—O9«i”®¨n£Ñû”aê;þÑ+p§&÷ëb8~×ýÌ-õB¿UšívÝ/ý€ü9y¥ÀKxY ‹)97qU`V†·pMàEœ¸Ž9yÜ`8}¸>·± pgê¸)°ˆ[K¸ÉáÂN§”Vzë1xÅëú^À0‰o¹ífiùã»Þ)×/Ⱥ4*A…Ûn«G…<£Ýsÿ «IûyàéE‡ŽvI;‘ üßþ}jjzáÐÕ¬ó¿§Q6…ÒŒt¨t? ™~#z'9‰f¬StWN@>:˜ÜLŠiz;J™QVó°ÇQÙLüùºSG(½±PnmƒSV—Œ /ì”5KûZU·´ŸÌj‚b²jäm£0€žOñ‚°õž—Ù¨˜ÛÐmV…-R¼$%³Q´EGÞ'ˆm 0Îìþ¶¥ØÇs’Ý,ÚÔ4ñ+ŽVMÛü!Ò8&ÎH£Šq©±H‚&q¬¢+eÃ2,í!®-ãb“U3Ÿ±Í¬rÒJÞ‡¶…¬Í©%¹l›V’:R‘ÒSbó>(Vô ƒmíþ2¢9?¢±M‰›‘ˆ”¾ù-&lÕ2öŠ+ì”þ}¬‘d¬ñýÀTÊÓJ™[¼¸óg‹'šçùS™Íï YüÑ'š'cbº 1K.fIX&3„-‘lUÂþä{0º`1ì$ìœr%=M Ìt:Z /¤mnóþ‘œý …ðOÇpº•1<ÏzÚ˜æ-Åñl!Òü‚;MûWv¸fü PKú°BrùPK !py/ íAMETA-INF/PK py/l˜èb€“¤'META-INF/MANIFEST.MFPK py/ íAégmonitor/PK py/ íAgmonitor/app/PK py/ íA;gmonitor/gui/PK py/íAfgmonitor/logdata/PK py/íA•gmonitor/tools/PKpy/jˆî£Ø%¤Âgmonitor/app/SimpleGrapherApp$1.classPKpy/¤·Ü•„%¤+gmonitor/app/SimpleGrapherApp$2.classPKpy/“¼ø•Á9¤gmonitor/app/SimpleGrapherApp$CorrectByUptimeAction.classPKpy/zM&u°4¤gmonitor/app/SimpleGrapherApp$GraphMouseAction.classPKpy/iä…Ézx2¤æ gmonitor/app/SimpleGrapherApp$ResampleAction.classPKpy/;ºK+°á5¤À gmonitor/app/SimpleGrapherApp$VisibleInfoAction.classPKpy/Rzþ5°è6¤Ógmonitor/app/SimpleGrapherApp$VisibleStyleAction.classPKpy/||ùô­Ú5¤çgmonitor/app/SimpleGrapherApp$VisibleUnitAction.classPKpy/÷f9´ò;¤÷gmonitor/app/SimpleGrapherApp$VisibleControllerAction.classPKpy/1Ú%MjÌ/¤gmonitor/app/SimpleGrapherApp$RadioAction.classPKpy/éU3ß<¤Ûgmonitor/app/SimpleGrapherApp$AutoUpdateIntervalAction.classPKpy/73Ð%í´6¤Ägmonitor/app/SimpleGrapherApp$ResampleResoAction.classPKpy/ÍÎâQ<¤gmonitor/app/SimpleGrapherApp$ComboUnitSelectionAction.classPKpy/ÛÊ(ºº5¤a!gmonitor/app/SimpleGrapherApp$CheckBoxBarAction.classPKpy/Žƒd¼6¤~#gmonitor/app/SimpleGrapherApp$CheckBoxLineAction.classPKpy/Ô0÷1»6¤ž%gmonitor/app/SimpleGrapherApp$CheckBoxPlotAction.classPKpy/˼EÊ¿.B¤½'gmonitor/app/SimpleGrapherApp$CheckBoxDifferentialModeAction.classPKpy/†€;»¸8¤ì)gmonitor/app/SimpleGrapherApp$CheckBox8timesAction.classPKpy/ó&7T½;¤ ,gmonitor/app/SimpleGrapherApp$CheckBox1000timesAction.classPKpy/¾ Ë^·8¤0.gmonitor/app/SimpleGrapherApp$CheckBox100divAction.classPKpy/·ë:Õ—ü%¤M0gmonitor/app/SimpleGrapherApp$3.classPKpy/œq9®¡ %¤73gmonitor/app/SimpleGrapherApp$4.classPKpy/ah\¸Ã/7¤+5gmonitor/app/SimpleGrapherApp$CheckBoxTotalAction.classPKpy/ËÛP¼¿"8¤S7gmonitor/app/SimpleGrapherApp$FileAutoUpdateAction.classPKpy/*$ ûÎE<¤x9gmonitor/app/SimpleGrapherApp$CheckBoxAutoUpdateAction.classPKpy/£Ÿ¤õœâ%¤°;gmonitor/app/SimpleGrapherApp$5.classPKpy/ªÿÈÉ÷ª 9¤Ÿ=gmonitor/app/SimpleGrapherApp$TimerAutoUpdateAction.classPKpy/â’¦™½"?¤ýBgmonitor/app/SimpleGrapherApp$MenuItemGraphStyleBarAction.classPKpy/ÙEE}½&@¤'Egmonitor/app/SimpleGrapherApp$MenuItemGraphStyleLineAction.classPKpy/jã5¾&@¤RGgmonitor/app/SimpleGrapherApp$MenuItemGraphStylePlotAction.classPKpy/Qб¿.B¤~Igmonitor/app/SimpleGrapherApp$MenuItemDifferentialModeAction.classPK py/|áãüº8¤­Kgmonitor/app/SimpleGrapherApp$MenuItem8timesAction.classPK py/ _;¼;¤ÍMgmonitor/app/SimpleGrapherApp$MenuItem1000timesAction.classPK py/¬SÒ¹8¤òOgmonitor/app/SimpleGrapherApp$MenuItem100divAction.classPK py/NûjÁÁ37¤Rgmonitor/app/SimpleGrapherApp$MenuItemTotalAction.classPK py/MTøÌI<¤7Tgmonitor/app/SimpleGrapherApp$MenuItemAutoUpdateAction.classPK py/BåNáZ=¤mVgmonitor/app/SimpleGrapherApp$ComboEventSelectionAction.classPK py/†»zKy@¤¹Xgmonitor/app/SimpleGrapherApp$ComboHostnameSelectionAction.classPK py/›SŠ”É1¤r[gmonitor/app/SimpleGrapherApp$RepaintAction.classPK py/`—“;õ.¤e^gmonitor/app/SimpleGrapherApp$RepaintNow.classPK py/ýR–÷I!:¤ü_gmonitor/app/SimpleGrapherApp$MenuItemFileExitAction.classPK py/7¿÷ùÔ :¤­agmonitor/app/SimpleGrapherApp$MenuItemFileOpenAction.classPK py/¢ž9/Ül#¤hgmonitor/app/SimpleGrapherApp.classPK py/±S<¤Áá<¤˜—gmonitor/app/SimpleGrapherBaseUI$GloggerDataFileFilter.classPK py/ÒF¸‹‘7¤Ã™gmonitor/app/SimpleGrapherBaseUI$UnitCellRenderer.classPK py/»€3>i9:¤8œgmonitor/app/SimpleGrapherBaseUI$HostOidCellRenderer.classPK py/«õ–|Ì+&¤ Ÿgmonitor/app/SimpleGrapherBaseUI.classPK py/I¼ä)Û ¤Ù³gmonitor/gui/DataTimeSpace.classPK py/F¸Þj¶à $¤PÂgmonitor/gui/GraphMonitorModel.classPK py/¤¿A¾s€¤XÇgmonitor/gui/RawData.classPK py/¹~Îq5!¤Êgmonitor/gui/RawDataElement.classPK py/[è]‰Oo(¤—Ëgmonitor/gui/GraphMonitor.classPK py/åª&, "¤3ßgmonitor/gui/ViewDataElement.classPK py/;X ¼Ý¤¯àgmonitor/gui/ViewData.classPK py/s6À' ¸¤´ãgmonitor/logdata/DataFile.classPK py/ðv°²ù#¤(ígmonitor/logdata/SeekableFile.classPK py/„ž÷›™%¤+îgmonitor/logdata/FirstMetaBlock.classPK py/C€Ö¥•"¤ògmonitor/logdata/BinaryBlock.classPK py/5ÈØi¶&¤~ögmonitor/logdata/SecondMetaBlock.classPK py/µ~)u"ž%¤;úgmonitor/logdata/DataBlockGroup.classPK py/ÁPº1r ¤°ügmonitor/logdata/DataBlock.classPK py/Ÿdå2ß#¤/gmonitor/logdata/HostDefBlock.classPK py/Ø®ˆôl "¤²gmonitor/logdata/OIDDefBlock.classPK py/“ÈÑPt@'¤n gmonitor/logdata/IntervalDefBlock.classPK py/#: eR*¤7gmonitor/logdata/DataBlockGroupTable.classPK py/…¯Ñæþ~%¤ágmonitor/logdata/HostDefElement.classPK py/\œâ3¥N$¤2gmonitor/logdata/OIDDefElement.classPK py/&”E ·)¤)gmonitor/logdata/IntervalDefElement.classPK py/WSt ^ó4¤ gmonitor/logdata/CachedSeekableFile$CacheBlock.classPK py/ö¾Ê:>M)¤àgmonitor/logdata/CachedSeekableFile.classPK py/]ÔOæ+ ,¤u gmonitor/logdata/DataBlockGroupElement.classPK py/$DIô—’"¤ú"gmonitor/logdata/DataElement.classPK py/ ÞH”u'¤á%gmonitor/logdata/HttpSeekableFile.classPK py/W&Õ•(¤S)gmonitor/logdata/LocalSeekableFile.classPK py/ÇæúÄ*¤¬+gmonitor/logdata/SeekableFileFactory.classPK py/ÀcßwM ¤….gmonitor/logdata/UTY.classPK py/† «oþW ¤D4gmonitor/tools/DumpLogFile.classPK py/knSÜ‘¦¤7gmonitor/tools/GlogDump.classPK py/¿™¯Ì¤l;gmonitor/tools/ScanLogDir.classPK py/ú°Brù%¤…?gmonitor/tools/SumRawDataSeries.classPKWWJCgfarm-2.4.1/snmptool/gmonitor3/UTYTest.java0000644000000000000000000000645111507222726017302 0ustar rootroot/* * Created on 2003/05/14 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments */ import java.io.UnsupportedEncodingException; import gmonitor.logdata.UTY; import junit.framework.TestCase; /** * @author hkondo * * To change the template for this generated type comment go to * Window>Preferences>Java>Code Generation>Code and Comments */ public class UTYTest extends TestCase { /** * Constructor for UTYTest. * @param arg0 */ public UTYTest(String arg0) { super(arg0); } public static void main(String[] args) { junit.swingui.TestRunner.run(UTYTest.class); } /* * @see TestCase#setUp() */ protected void setUp() throws Exception { super.setUp(); } /* * @see TestCase#tearDown() */ protected void tearDown() throws Exception { super.tearDown(); } public void testByte2String() { String t = "abcdefghijklmnopqrstuvwxyz01234567890!@#$%^&*()-=\\`_+|~[]{};':\",.<>/?"; byte[] b = { (byte)0x61, (byte)0x62, (byte)0x63, (byte)0x64, (byte)0x65, (byte)0x66, (byte)0x67, (byte)0x68, (byte)0x69, (byte)0x6a, (byte)0x6b, (byte)0x6c, (byte)0x6d, (byte)0x6e, (byte)0x6f, (byte)0x70, (byte)0x71, (byte)0x72, (byte)0x73, (byte)0x74, (byte)0x75, (byte)0x76, (byte)0x77, (byte)0x78, (byte)0x79, (byte)0x7a, (byte)0x30, (byte)0x31, (byte)0x32, (byte)0x33, (byte)0x34, (byte)0x35, (byte)0x36, (byte)0x37, (byte)0x38, (byte)0x39, (byte)0x30, (byte)0x21, (byte)0x40, (byte)0x23, (byte)0x24, (byte)0x25, (byte)0x5e, (byte)0x26, (byte)0x2a, (byte)0x28, (byte)0x29, (byte)0x2d, (byte)0x3d, (byte)0x5c, (byte)0x60, (byte)0x5f, (byte)0x2b, (byte)0x7c, (byte)0x7e, (byte)0x5b, (byte)0x5d, (byte)0x7b, (byte)0x7d, (byte)0x3b, (byte)0x27, (byte)0x3a, (byte)0x22, (byte)0x2c, (byte)0x2e, (byte)0x3c, (byte)0x3e, (byte)0x2f, (byte)0x3f, }; String r = null; try { r = UTY.byte2String(b, 0, b.length); } catch (UnsupportedEncodingException e1) { fail("Encoding ASCII not supported."); } assertEquals(t, r); } protected void _testByte2long_0_1(int k){ // 0L long t = 0; byte[] b = new byte[k]; for(int i = 0; i < k; i++){ b[i] = (byte)0; } long a = UTY.byte2long(b); assertEquals(a, t); } protected void _testByte2long_INTMAXp1_1(){ // Integer.MAX_VALUE + 1L (== Integer.MIN_VALUE, int cannot represent) long t = (long)((long)Integer.MAX_VALUE + 1L); byte[] b = { (byte)0x80, (byte)0x00, (byte)0x00, (byte)0x00 }; long a = UTY.byte2long(b); assertEquals(a, t * -1L); // bit pattern represents negative value. } protected void _testByte2long_INTMAXp1_2(){ // Integer.MAX_VALUE + 1L (== Integer.MIN_VALUE, int cannot represent) long t = (long)((long)Integer.MAX_VALUE + 1L); byte[] b = { (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x80, (byte)0x00, (byte)0x00, (byte)0x00 }; long a = UTY.byte2long(b); assertEquals(a, t); } public void testByte2long() { // 0L for(int i = 1; i < 8; i++){ _testByte2long_0_1(i); } // Integer.MAX_VALUE + 1L _testByte2long_INTMAXp1_1(); _testByte2long_INTMAXp1_2(); } /* * int byte2int ‚̃eƒXƒg(byte[]) */ public void testByte2int() { } } gfarm-2.4.1/snmptool/gmonitor3/build.xml0000644000000000000000000000110511507222726016726 0ustar rootroot gfarm-2.4.1/snmptool/gmonitor3/install-sh0000755000000000000000000001270111507222726017115 0ustar rootroot#!/bin/sh # # install - install a program, script, or datafile # This comes from X11R5 (mit/util/scripts/install.sh). # # Copyright 1991 by the Massachusetts Institute of Technology # # Permission to use, copy, modify, distribute, and sell this software and its # documentation for any purpose is hereby granted without fee, provided that # the above copyright notice appear in all copies and that both that # copyright notice and this permission notice appear in supporting # documentation, and that the name of M.I.T. not be used in advertising or # publicity pertaining to distribution of the software without specific, # written prior permission. M.I.T. makes no representations about the # suitability of this software for any purpose. It is provided "as is" # without express or implied warranty. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" transformbasename="" transform_arg="" instcmd="$mvprog" chmodcmd="$chmodprog 0755" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" dir_arg="" while [ x"$1" != x ]; do case $1 in -c) instcmd="$cpprog" shift continue;; -d) dir_arg=true shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd="$stripprog" shift continue;; -t=*) transformarg=`echo $1 | sed 's/-t=//'` shift continue;; -b=*) transformbasename=`echo $1 | sed 's/-b=//'` shift continue;; *) if [ x"$src" = x ] then src=$1 else # this colon is to work around a 386BSD /bin/sh bug : dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "install: no input file specified" exit 1 else : fi if [ x"$dir_arg" != x ]; then dst=$src src="" if [ -d $dst ]; then instcmd=: chmodcmd="" else instcmd=$mkdirprog fi else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if [ -f "$src" ] || [ -d "$src" ] then : else echo "install: $src does not exist" exit 1 fi if [ x"$dst" = x ] then echo "install: no destination specified" exit 1 else : fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d $dst ] then dst="$dst"/`basename $src` else : fi fi ## this sed command emulates the dirname command dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # this part is taken from Noah Friedman's mkinstalldirs script # Skip lots of stat calls in the usual case. if [ ! -d "$dstdir" ]; then defaultIFS=' ' IFS="${IFS-${defaultIFS}}" oIFS="${IFS}" # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` IFS="${oIFS}" pathcomp='' while [ $# -ne 0 ] ; do pathcomp="${pathcomp}${1}" shift if [ ! -d "${pathcomp}" ] ; then $mkdirprog "${pathcomp}" else : fi pathcomp="${pathcomp}/" done fi if [ x"$dir_arg" != x ] then $doit $instcmd $dst && if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else : ; fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else : ; fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else : ; fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else : ; fi else # If we're going to rename the final executable, determine the name now. if [ x"$transformarg" = x ] then dstfile=`basename $dst` else dstfile=`basename $dst $transformbasename | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename if [ x"$dstfile" = x ] then dstfile=`basename $dst` else : fi # Make a temp file name in the proper directory. dsttmp=$dstdir/#inst.$$# # Move or copy the file name to the temp name $doit $instcmd $src $dsttmp && trap "rm -f ${dsttmp}" 0 && # and set any options; do chmod last to preserve setuid bits # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $instcmd $src $dsttmp" command. if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else :;fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else :;fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else :;fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else :;fi && # Now rename the file to the real destination. $doit $rmcmd -f $dstdir/$dstfile && $doit $mvcmd $dsttmp $dstdir/$dstfile fi && exit 0 gfarm-2.4.1/snmptool/gmonitor3/.project0000644000000000000000000000056011507222726016560 0ustar rootroot gmonitor3 org.eclipse.jdt.core.javabuilder org.eclipse.jdt.core.javanature gfarm-2.4.1/snmptool/gmonitor3/config.mk.in0000644000000000000000000000065511507222726017321 0ustar rootrootprefix = @prefix@ exec_prefix = @exec_prefix@ default_bindir = @bindir@ default_mandir = @mandir@ default_docdir = $(prefix)/share/doc/gmonitor default_htmldir = $(default_docdir)/html bindir = $(default_bindir) mandir = $(default_mandir) docdir = $(default_docdir) htmldir = $(default_htmldir) INSTALL = $(top_objdir)/install-sh -c # "@INSTALL@" doesn't work INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ gfarm-2.4.1/snmptool/gmonitor3/configure0000755000000000000000000017700011507222726017024 0ustar rootroot#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.53. # # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 # Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi # NLS nuisances. # Support unset when possible. if (FOO=FOO; unset FOO) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi (set +x; test -n "`(LANG=C; export LANG) 2>&1`") && { $as_unset LANG || test "${LANG+set}" != set; } || { LANG=C; export LANG; } (set +x; test -n "`(LC_ALL=C; export LC_ALL) 2>&1`") && { $as_unset LC_ALL || test "${LC_ALL+set}" != set; } || { LC_ALL=C; export LC_ALL; } (set +x; test -n "`(LC_TIME=C; export LC_TIME) 2>&1`") && { $as_unset LC_TIME || test "${LC_TIME+set}" != set; } || { LC_TIME=C; export LC_TIME; } (set +x; test -n "`(LC_CTYPE=C; export LC_CTYPE) 2>&1`") && { $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set; } || { LC_CTYPE=C; export LC_CTYPE; } (set +x; test -n "`(LANGUAGE=C; export LANGUAGE) 2>&1`") && { $as_unset LANGUAGE || test "${LANGUAGE+set}" != set; } || { LANGUAGE=C; export LANGUAGE; } (set +x; test -n "`(LC_COLLATE=C; export LC_COLLATE) 2>&1`") && { $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set; } || { LC_COLLATE=C; export LC_COLLATE; } (set +x; test -n "`(LC_NUMERIC=C; export LC_NUMERIC) 2>&1`") && { $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set; } || { LC_NUMERIC=C; export LC_NUMERIC; } (set +x; test -n "`(LC_MESSAGES=C; export LC_MESSAGES) 2>&1`") && { $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set; } || { LC_MESSAGES=C; export LC_MESSAGES; } # Name of the executable. as_me=`(basename "$0") 2>/dev/null || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conftest.sh echo "exit 0" >>conftest.sh chmod +x conftest.sh if (PATH=".;."; conftest.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conftest.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" # Sed expression to map a string onto a valid variable name. as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=$PATH_SEPARATOR; export CDPATH; } # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` exec 6>&1 # # Initializations. # ac_default_prefix=/usr/local cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. # This variable seems obsolete. It should probably be removed, and # only ac_max_sed_lines should be used. : ${ac_max_here_lines=38} # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= ac_unique_file="gmonitor.mani" ac_unique_file="gmonitor.mani" # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' ac_prev= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" ac_prev= continue fi ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_option in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "enable_$ac_feature='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/-/_/g'` eval "with_$ac_package=no" ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` eval "$ac_envvar='$ac_optarg'" export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute paths. for ac_var in exec_prefix prefix do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* | NONE | '' ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # Be sure to have absolute paths. for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ localstatedir libdir includedir oldincludedir infodir mandir do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. ac_confdir=`(dirname "$0") 2>/dev/null || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 { (exit 1); exit 1; }; } else { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi fi srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` ac_env_build_alias_set=${build_alias+set} ac_env_build_alias_value=$build_alias ac_cv_env_build_alias_set=${build_alias+set} ac_cv_env_build_alias_value=$build_alias ac_env_host_alias_set=${host_alias+set} ac_env_host_alias_value=$host_alias ac_cv_env_host_alias_set=${host_alias+set} ac_cv_env_host_alias_value=$host_alias ac_env_target_alias_set=${target_alias+set} ac_env_target_alias_value=$target_alias ac_cv_env_target_alias_set=${target_alias+set} ac_cv_env_target_alias_value=$target_alias # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] _ACEOF cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --datadir=DIR read-only architecture-independent data [PREFIX/share] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --infodir=DIR info documentation [PREFIX/info] --mandir=DIR man documentation [PREFIX/man] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF _ACEOF fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d $ac_dir || continue ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be # absolute. ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd` ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` cd $ac_dir # Check for guested configure; otherwise get Cygnus style configure. if test -f $ac_srcdir/configure.gnu; then echo $SHELL $ac_srcdir/configure.gnu --help=recursive elif test -f $ac_srcdir/configure; then echo $SHELL $ac_srcdir/configure --help=recursive elif test -f $ac_srcdir/configure.ac || test -f $ac_srcdir/configure.in; then echo $ac_configure --help else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi cd $ac_popdir done fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit 0 fi exec 5>config.log cat >&5 <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.53. Invocation command line was $ $0 $@ _ACEOF { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` hostinfo = `(hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Also quote any args containing shell meta-characters. ac_configure_args= ac_sep= for ac_arg do case $ac_arg in -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n ) continue ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) continue ;; *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" ac_sep=" " ;; esac # Get rid of the leading space. done # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Be sure not to use single quotes in there, as some shells, # such as our DU 5.0 friend, will then `close' the trap. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, { (set) 2>&1 | case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in *ac_space=\ *) sed -n \ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" ;; *) sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } echo if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo sed "/^$/d" confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core core.* *.core && rm -rf conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo >confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . $cache_file;; *) . ./$cache_file;; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in `(set) 2>&1 | sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val="\$ac_cv_env_${ac_var}_value" eval ac_new_val="\$ac_env_${ac_var}_value" case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu top_objdir=`pwd` ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f $ac_dir/install.sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f $ac_dir/shtool; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} { (exit 1); exit 1; }; } fi ac_config_guess="$SHELL $ac_aux_dir/config.guess" ac_config_sub="$SHELL $ac_aux_dir/config.sub" ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL=$ac_install_sh fi fi echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' ac_config_files="$ac_config_files Makefile config.mk docbook/doc.mk gmonitor3" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overriden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. { (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } | sed ' t clear : clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ : end' >>confcache if cmp -s $cache_file confcache; then :; else if test -w $cache_file; then test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" cat confcache >$cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/; s/:*\${srcdir}:*/:/; s/:*@srcdir@:*/:/; s/^\([^=]*=[ ]*\):*/\1/; s/:*$//; s/^[^=]*=[ ]*$//; }' fi # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then we branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. cat >confdef2opt.sed <<\_ACEOF t clear : clear s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g t quote s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g t quote d : quote s,[ `~#$^&*(){}\\|;'"<>?],\\&,g s,\[,\\&,g s,\],\\&,g s,\$,$$,g p _ACEOF # We use echo to avoid assuming a particular line-breaking character. # The extra dot is to prevent the shell from consuming trailing # line-breaks from the sub-command output. A line-break within # single-quotes doesn't work because, if this script is created in a # platform that uses two characters for line-breaks (e.g., DOS), tr # would break. ac_LF_and_DOT=`echo; echo .` DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'` rm -f confdef2opt.sed : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi # NLS nuisances. # Support unset when possible. if (FOO=FOO; unset FOO) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi (set +x; test -n "`(LANG=C; export LANG) 2>&1`") && { $as_unset LANG || test "${LANG+set}" != set; } || { LANG=C; export LANG; } (set +x; test -n "`(LC_ALL=C; export LC_ALL) 2>&1`") && { $as_unset LC_ALL || test "${LC_ALL+set}" != set; } || { LC_ALL=C; export LC_ALL; } (set +x; test -n "`(LC_TIME=C; export LC_TIME) 2>&1`") && { $as_unset LC_TIME || test "${LC_TIME+set}" != set; } || { LC_TIME=C; export LC_TIME; } (set +x; test -n "`(LC_CTYPE=C; export LC_CTYPE) 2>&1`") && { $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set; } || { LC_CTYPE=C; export LC_CTYPE; } (set +x; test -n "`(LANGUAGE=C; export LANGUAGE) 2>&1`") && { $as_unset LANGUAGE || test "${LANGUAGE+set}" != set; } || { LANGUAGE=C; export LANGUAGE; } (set +x; test -n "`(LC_COLLATE=C; export LC_COLLATE) 2>&1`") && { $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set; } || { LC_COLLATE=C; export LC_COLLATE; } (set +x; test -n "`(LC_NUMERIC=C; export LC_NUMERIC) 2>&1`") && { $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set; } || { LC_NUMERIC=C; export LC_NUMERIC; } (set +x; test -n "`(LC_MESSAGES=C; export LC_MESSAGES) 2>&1`") && { $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set; } || { LC_MESSAGES=C; export LC_MESSAGES; } # Name of the executable. as_me=`(basename "$0") 2>/dev/null || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conftest.sh echo "exit 0" >>conftest.sh chmod +x conftest.sh if (PATH=".;."; conftest.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conftest.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" # Sed expression to map a string onto a valid variable name. as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=$PATH_SEPARATOR; export CDPATH; } exec 6>&1 # Open the log real soon, to keep \$[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. Logging --version etc. is OK. exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX } >&5 cat >&5 <<_CSEOF This file was extended by $as_me, which was generated by GNU Autoconf 2.53. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ _CSEOF echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 echo >&5 _ACEOF # Files that config.status was made for. if test -n "$ac_config_files"; then echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS fi if test -n "$ac_config_headers"; then echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS fi if test -n "$ac_config_links"; then echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS fi if test -n "$ac_config_commands"; then echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS fi cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number, then exit -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE Configuration files: $config_files Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.53, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." srcdir=$srcdir INSTALL="$INSTALL" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "x$1" : 'x\([^=]*\)='` ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` shift set dummy "$ac_option" "$ac_optarg" ${1+"$@"} shift ;; -*);; *) # This is not an option, so the user has probably given explicit # arguments. ac_need_defaults=false;; esac case $1 in # Handling of the options. _ACEOF cat >>$CONFIG_STATUS <<_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion" exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;; _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF --version | --vers* | -V ) echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header { { echo "$as_me:$LINENO: error: ambiguous option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --file | --fil | --fi | --f ) shift CONFIG_FILES="$CONFIG_FILES $1" ac_need_defaults=false;; --header | --heade | --head | --hea ) shift CONFIG_HEADERS="$CONFIG_HEADERS $1" ac_need_defaults=false;; # This is an error. -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ;; esac shift done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_config_target in $ac_config_targets do case "$ac_config_target" in # Handling of arguments. "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; "config.mk" ) CONFIG_FILES="$CONFIG_FILES config.mk" ;; "docbook/doc.mk" ) CONFIG_FILES="$CONFIG_FILES docbook/doc.mk" ;; "gmonitor3" ) CONFIG_FILES="$CONFIG_FILES gmonitor3" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files fi # Create a temporary directory, and hook for its removal unless debugging. $debug || { trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. : ${TMPDIR=/tmp} { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=$TMPDIR/cs$$-$RANDOM (umask 077 && mkdir $tmp) } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 { (exit 1); exit 1; } } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "\$CONFIG_FILES"; then # Protect against being on the right side of a sed subst in config.status. sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF s,@SHELL@,$SHELL,;t t s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t s,@exec_prefix@,$exec_prefix,;t t s,@prefix@,$prefix,;t t s,@program_transform_name@,$program_transform_name,;t t s,@bindir@,$bindir,;t t s,@sbindir@,$sbindir,;t t s,@libexecdir@,$libexecdir,;t t s,@datadir@,$datadir,;t t s,@sysconfdir@,$sysconfdir,;t t s,@sharedstatedir@,$sharedstatedir,;t t s,@localstatedir@,$localstatedir,;t t s,@libdir@,$libdir,;t t s,@includedir@,$includedir,;t t s,@oldincludedir@,$oldincludedir,;t t s,@infodir@,$infodir,;t t s,@mandir@,$mandir,;t t s,@build_alias@,$build_alias,;t t s,@host_alias@,$host_alias,;t t s,@target_alias@,$target_alias,;t t s,@DEFS@,$DEFS,;t t s,@ECHO_C@,$ECHO_C,;t t s,@ECHO_N@,$ECHO_N,;t t s,@ECHO_T@,$ECHO_T,;t t s,@LIBS@,$LIBS,;t t s,@top_objdir@,$top_objdir,;t t s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t s,@INSTALL_DATA@,$INSTALL_DATA,;t t CEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_lines=48 ac_sed_frag=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_lines # Line after last line for current file. ac_more_lines=: ac_sed_cmds= while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag else sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag fi if test ! -s $tmp/subs.frag; then ac_more_lines=false else # The purpose of the label and of the branching condition is to # speed up the sed processing (if there are no `@' at all, there # is no need to browse any of the substitutions). # These are the two extra sed commands mentioned above. (echo ':t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" else ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" fi ac_sed_frag=`expr $ac_sed_frag + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_lines` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi fi # test -n "$CONFIG_FILES" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { case "$ac_dir" in [\\/]* | ?:[\\/]* ) as_incr_dir=;; *) as_incr_dir=.;; esac as_dummy="$ac_dir" for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do case $as_mkdir_dir in # Skip DOS drivespec ?:) as_incr_dir=$as_mkdir_dir ;; *) as_incr_dir=$as_incr_dir/$as_mkdir_dir test -d "$as_incr_dir" || mkdir "$as_incr_dir" || { { echo "$as_me:$LINENO: error: cannot create \"$ac_dir\"" >&5 echo "$as_me: error: cannot create \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; } ;; esac done; } ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be # absolute. ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd` ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_builddir$INSTALL ;; esac if test x"$ac_file" != x-; then { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" fi # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ if test x"$ac_file" = x-; then configure_input= else configure_input="$ac_file. " fi configure_input=$configure_input"Generated from `echo $ac_file_in | sed 's,.*/,,'` by configure." # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo $f;; *) # Relative if test -f "$f"; then # Build tree echo $f elif test -f "$srcdir/$f"; then # Source tree echo $srcdir/$f else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s,@configure_input@,$configure_input,;t t s,@srcdir@,$ac_srcdir,;t t s,@abs_srcdir@,$ac_abs_srcdir,;t t s,@top_srcdir@,$ac_top_srcdir,;t t s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t s,@builddir@,$ac_builddir,;t t s,@abs_builddir@,$ac_abs_builddir,;t t s,@top_builddir@,$ac_top_builddir,;t t s,@abs_top_builddir@,$ac_abs_top_builddir,;t t s,@INSTALL@,$ac_INSTALL,;t t " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out rm -f $tmp/stdin if test x"$ac_file" != x-; then mv $tmp/out $ac_file else cat $tmp/out rm -f $tmp/out fi done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: exec 5>/dev/null $SHELL $CONFIG_STATUS || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi gfarm-2.4.1/snmptool/glogger3/0000755000000000000000000000000011507222730014673 5ustar rootrootgfarm-2.4.1/snmptool/glogger3/glogd.in0000755000000000000000000000130711507222726016330 0ustar rootroot#!/bin/sh # # glogd Start/Stop glogger daemon # # chkconfig: 2345 90 90 # description: glogger daemon. # prefix=@prefix@ exec_prefix=@exec_prefix@ progname=glogd conffile=@confdir@/${progname}.conf vardir=/tmp sudo="sudo -u nobody" program=@bindir@/glogger glogdfunc=@bindir@/glogd-func pidfile=${vardir}/${progname}.pid OPTIONS="-config ${conffile} -daemon ${pidfile}" # ------------------------------------------------------------------ # RETVAL=0 . ${glogdfunc} case "$1" in start) start ;; stop) stop ;; restart) restart ;; status) status ;; checkconf) checkconf ;; *) echo $"Usage: $0 {start|stop|restart|status|checkconf}" RETVAL=1 esac exit $RETVAL gfarm-2.4.1/snmptool/glogger3/INSTALL.ja0000644000000000000000000002567011507222726016334 0ustar rootrootGLogger 3.0 ======================================================================== * GLogger ¤Î³µÍ× SNMP GET ¥ê¥¯¥¨¥¹¥È¤ò»È¤Ã¤Æ¡¢¥Í¥Ã¥È¥ï¡¼¥¯¾å¤Ë¤¢¤ëÊ£¿ô¤Î¥Û¥¹¥È¤«¤é¾ðÊó ¤ò½¸¤á¡¢¥Ç¡¼¥¿¤ò¥Õ¥¡¥¤¥ë¤Ø½ÐÎϤ·¤Þ¤¹¡£ÀßÄê¥Õ¥¡¥¤¥ë¤Ç»ØÄꤷ¤¿¥¤¥ó¥¿¡¼¥Ð ¥ë¤´¤È¤Ë¡¢ÀßÄê¥Õ¥¡¥¤¥ë¤Ç»ØÄꤷ¤¿³Æ¥Û¥¹¥È¤ËÂФ·¤Æ GET ¥ê¥¯¥¨¥¹¥È¤·¡¢È¿ ±þ¤ÎÁᤫ¤Ã¤¿¥Û¥¹¥È¤«¤é½ç¤Ë¼õ¿®¤·¡¢ÀßÄê¥Õ¥¡¥¤¥ë¤Îµ­½Ò¤Ë¤·¤¿¤¬¤Ã¤Æ½ÐÎϽè Íý¤ò¤·¤Þ¤¹¡£´Ñ¬ÂоݤΥۥ¹¥È¡¢¥¹¥¤¥Ã¥Á¤Ê¤É¤Ï¡¢¤½¤ì¤¾¤ì SNMP ¥¨¡¼¥¸¥§¥ó ¥È¤¬Æ°ºî¤·¡¢GLogger ¤òưºî¤µ¤»¤ë¥Û¥¹¥È¤«¤é¡¢´Ñ¬¤¹¤ë MIB ¥Ä¥ê¡¼¤Î OID ¤ò»²¾È¤Ç¤­¤ë¤è¤¦¤Ë¤·¤Æ¤ª¤¯É¬Íפ¬¤¢¤ê¤Þ¤¹¡£ µ­Ï¿¤·¤¿¥Ç¡¼¥¿¤Ï¡¢GMonitor(Java ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó)¡¢¤Þ¤¿¤Ï glogdump ¥³ ¥Þ¥ó¥É(GLogger ¥Ñ¥Ã¥±¡¼¥¸¤ËƱº­)¤Ç¡¢¸½ºß°·¤¦¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ ÀßÄê¥Õ¥¡¥¤¥ë¤Ë¤ª¤¤¤Æ¡¢¥Û¥¹¥È¤Î»ØÄê¤Ë¤Ï¡¢Ï¢ÈÖ¿ô»ú¤Îάµ­¤¬¤Ç¤­¤Þ¤¹¡£ ¥Þ¥¤¥¯¥íÉÃñ°Ì¤Îưºî¥¤¥ó¥¿¡¼¥Ð¥ë¤ò»ØÄê¤Ç¤­¤Þ¤¹¤¬¡¢¸½¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï¡¢ºÇ ¾®Æ°ºîñ°Ì¤ò 0.1 ÉäËÀ©¸Â¤·¤Æ¤¤¤Þ¤¹¡£ ¸½¥Ð¡¼¥¸¥ç¥ó¤Ç°·¤¨¤ë SNMP ¤Î¥Ð¡¼¥¸¥ç¥ó¤Ï SNMPv1 ¸ÇÄê¤Ç¤¹¡£ GLogger ¤ò¥Ó¥ë¥É¤¹¤ë¤Ë¤Ï¡¢ net-snmp ¤Þ¤¿¤Ï ucd-snmp (http://net-snmp.sourceforge.net/) ¤Î¥é¥¤¥Ö¥é¥ê¡¢¥Ø¥Ã¥À¤¬É¬ÍפǤ¹¡£ ¸½ºß¡¢net-snmp 5.0.8 ¤Þ¤¿¤Ï ucd-snmp 4.2.6 ¤Î¥é¥¤¥Ö¥é¥ê¤ò»È¤¤¡¢ Linux ¤È FreeBSD ´Ä¶­¤Çưºî³Îǧ¤·¤Æ¤¤¤Þ¤¹¡£ °Ê²¼¤Ç¤Ï¡¢net-snmp ¤Î¥é¥¤¥Ö¥é¥ê¤ä¥¨¡¼¥¸¥§¥ó¥È¤ò»È¤Ã¤¿¾ì¹ç¤ÎÎã¤ÇÀâÌÀ¤·¤Þ¤¹¡£ ======================================================================== * net-snmp ¤Î¥¤¥ó¥¹¥È¡¼¥ë ´û¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤·¤Æ¤¢¤ë¾ì¹ç¤Ï¡¢¡ÖSNMP ¥¨¡¼¥¸¥§¥ó¥È¤ÎÀßÄê¡×¤Ë¿Ê¤ó¤Ç¤¯ ¤À¤µ¤¤¡£ °Ê²¼¤Ï¡¢SNMP ¥Þ¥Í¡¼¥¸¥ã(¥¯¥é¥¤¥¢¥ó¥È¦)¤È¤·¤Æ¤Î¤ß»È¤¦¾ì¹ç¤Ë¡¢¥Û¡¼¥à¥Ç¥£ ¥ì¥¯¥È¥ê¤Ø¥¤¥ó¥¹¥È¡¼¥ë¤¹¤ëÎã¤Ç¤¹¡£ $ configure --prefix=/home/foo/netsnmp ¼ÁÌ䤷¤Æ¤¯¤ëÀßÄê¤Ï¥¨¡¼¥¸¥§¥ó¥ÈÍѤʤΤǡ¢¤ï¤«¤é¤Ê¤¤¾ì¹ç¤Ï¥Ç¥Õ¥©¥ë¥È¤Î¤Þ¤Þ ¤Ç¤âÌäÂꤢ¤ê¤Þ¤»¤ó¡£ $ make # make install °Ê²¼¤Ï¡¢SNMP ¥¨¡¼¥¸¥§¥ó¥È(¥µ¡¼¥Ð¦)¤ò¥¤¥ó¥¹¥È¡¼¥ë¤¹¤ëÎã¤Ç¤¹¡£ $ configure ¼ÁÌ䤷¤Æ¤¯¤ëÀßÄê¤Ï´Ä¶­¤Ë¤¢¤ï¤»¤Æ»ØÄꤷ¤Þ¤¹¡£ $ make # make install ¤É¤Á¤é¤Î¾ì¹ç¤Ç¤â¡¢¥¤¥ó¥¹¥È¡¼¥ë¸å¤Ï¡¢snmpget ¤ä snmpwalk ¤Ê¤É¤Î¥³¥Þ¥ó¥É ¼Â¹Ô¤È¡¢GLogger ¤Î¥Ó¥ë¥É¤¬¤Ç¤­¤Þ¤¹¡£ Red Hat Linux ¤Ê¤É¤Ç¤Ï¡¢rpm ¥Ñ¥Ã¥±¡¼¥¸¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¤Æ¤âÎɤ¤¤Ç¤¹¡£ GLogger ¤ò¥Ó¥ë¥É¤¹¤ë¾ì¹ç¤Ï¡¢devel ¥Ñ¥Ã¥±¡¼¥¸¤âɬÍפǤ¹¡£ ======================================================================== * SNMP ¥¨¡¼¥¸¥§¥ó¥È¤ÎÀßÄê net-snmp ¤Î snmpd ¤ò SNMP ¥¨¡¼¥¸¥§¥ó¥È¤È¤·¤ÆÍѤ¤¤ë¾ì¹ç¤Ï¡¢snmpd.conf ¤ÎÀßÄê¤ò´Ä¶­¤Ë¤¢¤ï¤»¤ÆÊÔ½¸¤·¤Þ¤¹¡£net-snmp ¤Î¥Þ¥Ë¥å¥¢¥ë¤ò¤è¤¯»²¾È¤·¡¢ ÀßÄê¤ò¤ª¤³¤Ê¤Ã¤Æ¤¯¤À¤µ¤¤¡£°Ê²¼¤Ï¡¢ºÇÄã¸ÂɬÍפʳƹàÌܤγµÍפǤ¹¡£ com2sec ¥³¥ß¥å¥Ë¥Æ¥£¥¹¥È¥ê¥ó¥°¤ò»ØÄꤷ¡¢¤½¤ì¤ËÂФ·¤Æ¥»¥­¥å¥ê¥Æ¥£¤Î̾Á°¤ò¤Ä¤± ¤Þ¤¹¡£¥¢¥¯¥»¥¹¤òµö²Ä¤¹¤ë¥Í¥Ã¥È¥ï¡¼¥¯¤ÎÈÏ°Ï¤â»ØÄꤷ¤Þ¤¹¡£GLogger ¤Ç¤Ï¡¢ ¥³¥ß¥å¥Ë¥Æ¥£¥¹¥È¥ê¥ó¥°¤Ë public ¤ò»È¤¤¤Þ¤¹¤¬¡¢Êѹ¹¤â¤Ç¤­¤Þ¤¹¡£¥¢¥¯¥» ¥¹¤òµö²Ä¤¹¤ë¥Í¥Ã¥È¥ï¡¼¥¯¤Ï GLogger ¤«¤é¥¢¥¯¥»¥¹¤Ç¤­¤ë¤è¤¦¤Ë»ØÄꤷ¤Þ¤¹¡£ ¤Ê¤ë¤Ù¤¯ GLogger °Ê³°¤«¤é¥¢¥¯¥»¥¹¤Ç¤­¤Ê¤¤¤è¤¦¤Ë¤¹¤ë¤³¤È¤ò¤ª´«¤á¤·¤Þ¤¹¡£ group ¥°¥ë¡¼¥×̾¤òÉÕ¤±¤Æ¡¢¥»¥­¥å¥ê¥Æ¥£Ì¾¤ò½ê°¤µ¤»¤Æ¡¢¤³¤Î¥°¥ë¡¼¥×¤ËÂФ·¤Æ ¥»¥­¥å¥ê¥Æ¥£¥â¥Ç¥ë(SNMP ¤Î¥Ð¡¼¥¸¥ç¥ó)¤ò»ØÄꤷ¤Þ¤¹¡£GLogger ¤Î¤¿¤á¤Ë v1 ¤¬¸«¤¨¤ë¤è¤¦¤Ë¤·¤Þ¤¹¡£¸½ GLogger ¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï SNMP ¤Î¥Ð¡¼¥¸¥ç¥ó¤ò »ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£ view MIB ¥Ä¥ê¡¼¤ÎÃæ¤Ç¡¢¸ø³«¤¹¤ë subtree ¤ò»ØÄꤷ¡¢¤½¤ì¤ËÂФ·¤ÆÌ¾Á°¤ò¤Ä¤±¤Þ¤¹¡£ subtree ¤¬ .1 ¤Ê¤é¤Ð MIB ¤¹¤Ù¤Æ¤ò¸ø³«¤·¤Þ¤¹¡£ access view ¤Ç·è¤á¤¿Ì¾Á°¤ò read ¤Ç¤­¤ë¤è¤¦¤Ë»ØÄꤷ¤Þ¤¹¡£ °Ê²¼¤Ï¡¢glogger ¸þ¤±¤ËÀßÄꤷ¤¿Îã¤Ç¤¹¡£ com2sec gloggerUser localhost public com2sec gloggerUser 192.168.1.0/24 public group gloggerGroup v1 gloggerUser group gloggerGroup v2c gloggerUser view gloggerView included .1 80 access gloggerGroup "" any noauth exact gloggerView none none disk /raid °Ê¾å¤ÎÀßÄê¤Ç¡¢localhost ¤È 192.168.1.0/24 ¤«¤é¡¢¥³¥ß¥å¥Ë¥Æ¥£¥¹¥È¥ê¥ó¥° public ¤Ç¡¢SNMPv1 ¤È SNMPv2c ¤Ë¤è¤ë¥¢¥¯¥»¥¹¤òµö²Ä¤·¡¢/raid ¥Ç¥£¥ì¥¯¥È ¥ê¤¬¤¢¤ë¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¤Î¾ðÊ󤬸«¤¨¤ë¤è¤¦¤Ë¤·¤Þ¤¹¡£ glogger ¤Ç´Ñ¬¤¹¤ëÂоݤγƥۥ¹¥È¤ËÀßÄꤷ¡¢¤½¤ì¤¾¤ì¤Î¥Û¥¹¥È¤Ç snmpd ¤ò µ¯Æ°¤·¤Þ¤¹¡£ # /etc/init.d/snmpd start SNMP ¥¨¡¼¥¸¥§¥ó¥Èµ¡Ç½¤Î¤¢¤ë¥¹¥¤¥Ã¥Á¤Ê¤É¤Ï¡¢¤½¤ì¤¾¤ìÀßÄêÊýË¡¤Ï°Û¤Ê¤ê¤Þ ¤¹¤¬¡¢Æ±Íͤ˥¢¥¯¥»¥¹¤Ç¤­¤ë¤è¤¦¤ËÀßÄꤷ¤Þ¤¹¡£³Æ¥¹¥¤¥Ã¥Á¤Î¥Þ¥Ë¥å¥¢¥ë¤ò»² ¾È¤·¤ÆÀßÄꤷ¤Æ¤¯¤À¤µ¤¤¡£ ======================================================================== * snmpwalk ¤Ç³Îǧ GLogger ¤òư¤«¤¹¥Û¥¹¥È¤Ç¡¢snmpwalk ¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤·¡¢ÂоݤΠSNMP ¥Þ¥Í¡¼¥¸¥ã ¤«¤é±þÅú¤¬¤¢¤ë¤«¤É¤¦¤«¤È¡¢¼èÆÀ¤¹¤ë¹àÌܤΠOID ¤òÄ´¤Ù¤Þ¤¹¡£ °Ê²¼¤Ï¡¢localhost ¤ËÂФ·¤Æ¡¢SNMPv1 ¤ò»ÈÍѤ·¡¢¥³¥ß¥å¥Ë¥Æ¥£¥¹¥È¥ê¥ó¥° public ¤Ç¥¢¥¯¥»¥¹¤·¡¢Á´¤Æ¤Î¹àÌܤò¸«¤ë¾ì¹ç¤Î snmpwalk ¤ÎÎã¤Ç¤¹¡£ $ snmpwalk -v 1 -c public localhost .1 °Ê²¼¤Ï¡¢interfaces ¤Î subtree ¤À¤±¤ò¸«¤ëÎã¤Ç¤¹¡£ $ snmpwalk -v 1 -c public localhost interfaces ±þÅú¤¬Ìµ¤¤¾ì¹ç¤Ï¡¢°Ê²¼¤ÎÍýͳ¤¬¹Í¤¨¤é¤ì¤Þ¤¹¡£ - SNMP ¥¨¡¼¥¸¥§¥ó¥È¤ÎÀßÄ꤬´Ö°ã¤Ã¤Æ¤¤¤ë¡£ - UDP ¤Î¥Ý¡¼¥È 161 ÈÖ(¥¨¡¼¥¸¥§¥ó¥È¦)¤¬Ä̤äƤ¤¤Ê¤¤¡£ ======================================================================== * GLogger ¤Ç¼èÆÀ¤¹¤ë OID ¤òõ¤¹ net-snmp ¤Ê¤é¤Ð¡¢°Ê²¼¤Î¥³¥Þ¥ó¥É¤Ç½ÐÎϤµ¤ì¤ë OID ¤ÎÃæ¤«¤éõ¤·¤Þ¤¹¡£ $ snmpwalk -Ou -c public localhost .1 ¸½ GLogger ¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï¡¢32 bit ¥«¥¦¥ó¥¿ÃÍ(Counter32:)¤Î±þÅú¡¢ ¤Þ¤¿¤ÏÀ°¿ô(INTEGER:)¤Î±þÅú¡¢¤Þ¤¿¤Ï¥í¡¼¥É¥¢¥Ù¥ì¡¼¥¸(laEntry.laLoad)¡¢ ¤Þ¤¿¤Ï uptime(system.sysUpTime)¤¬»ØÄê¤Ç¤­¤Þ¤¹¡£ ¥Í¥Ã¥È¥ï¡¼¥¯¤Î RX, TX ¤ò¼èÆÀ¤¹¤ëÊýË¡¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¹¡£ interfaces.ifTable.ifEntry.ifDescr.1 = STRING: lo interfaces.ifTable.ifEntry.ifDescr.2 = STRING: eth0 interfaces.ifTable.ifEntry.ifDescr.3 = STRING: eth1 °Ê¾å¤Î¤è¤¦¤Ê¹àÌܤò snmpwalk ¥³¥Þ¥ó¥É¤Çõ¤·¤Æ¡¢¥Í¥Ã¥È¥ï¡¼¥¯¥¤¥ó¥¿¡¼¥Õ¥§¡¼ ¥¹¤òȽÃǤ·¡¢ÈÖ¹æ¤ò³Ð¤¨¤Æ¤ª¤­¤Þ¤¹¡£ ¤³¤ÎÎã¤Î¾ì¹ç¤Ç¡¢eth0 ¤Ë¤Ä¤¤¤Æµ­Ï¿¤¹¤ë¤³¤È¤Ë¤·¤Þ¤¹¡£ eth0 ¤Î RX interfaces.ifTable.ifEntry.ifInOctets.2 = Counter32: 3306626932 eth0 ¤Î TX interfaces.ifTable.ifEntry.ifOutOctets.2 = Counter32: 2454169824 °Ê¾å¤Î¹àÌܤòõ¤·¤Æ¡¢OID ¤ò³Ð¤¨¤Æ¤ª¤­¤Þ¤¹¡£ ¤³¤Î OID ¤ò GLogger ¤ÎÀßÄê¥Õ¥¡¥¤¥ë¤Ëµ­½Ò¤¹¤ë¤³¤È¤Ë¤Ê¤ê¤Þ¤¹¡£ °Ê²¼¤Ï¡¢1ʬʿ¶Ñ¤Î¥í¡¼¥É¥¢¥Ù¥ì¡¼¥¸¤Ë´Ø¤¹¤ë OID ¤ÎÎã¤Ç¤¹¡£ enterprises.ucdavis.laTable.laEntry.laLoad.1 °Ê²¼¤Ï¡¢¥Ç¥£¥¹¥¯»ÈÍÑÎ̤˴ؤ¹¤ë OID ¤ÎÎã¤Ç¤¹¡£ enterprises.ucdavis.dskTable.dskEntry.dskUsed.1 °Ê²¼¤Ï¡¢¥Ç¥£¥¹¥¯¶õ¤­ÍÆÎ̤˴ؤ¹¤ë OID ¤ÎÎã¤Ç¤¹¡£ enterprises.ucdavis.dskTable.dskEntry.dskAvail.1 ¤Þ¤¿¡¢system.sysUpTime.0 ¤ò GLogger ¤Ç»ØÄꤹ¤ë¤È¡¢GMonitor ¤Ç»þ´Ö´Ö³Ö¤Î ÊäÀµ¤ò¤¹¤ë¤³¤È¤â¤Ç¤­¤Þ¤¹¡£ snmpget ¤ä GLogger ¤Ë¤Ï¡¢OID ¤òÁ´¤Æ»ØÄꤷ¤Ê¤¯¤Æ¤âÎɤ¯¡¢ÅÓÃæ¤«¤éºÇ¸å¤Þ¤Ç ¤ò»ØÄꤷ¤Æ¤âÌäÂꤢ¤ê¤Þ¤»¤ó¡£ Î㤨¤Ð¡¢ interfaces.ifTable.ifEntry.ifInOctets.2 ¤Ï¡¢ ifInOctets.2 ¤ÈƱÅù¤Ç¤¹¡£ (¤Ä¤Þ¤ê snmpgwalk ¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤¹¤ë¾ì¹ç¤Ë¡¢-Ou ¥ª¥×¥·¥ç¥ó¤ÏɬÍפ¢¤ê¤Þ¤»¤ó) (ά¤µ¤Ê¤¤ OID ¤¬ÃΤꤿ¤¤¾ì¹ç¤Ï -Ou ¤òÉÕ¤±¤ë¤È´Êñ¤Ç¤¹) snmpget ¥³¥Þ¥ó¥É¤Ë OID ¤ò»ØÄꤷ¡¢Ã±ÆÈ¤Ç¥¢¥¯¥»¥¹¤Ç¤­¤ë¤«³Îǧ¤Ç¤­¤Þ¤¹¡£ $ snmpget -v 1 -c public localhost ifInOctets.2 IF-MIB::ifInOctets.2 = Counter32: 3310999000 °Ê¾å¤Î³Îǧ¤ò¡¢´Ñ¬Âоݤ¹¤Ù¤Æ¤Î SNMP ¥¨¡¼¥¸¥§¥ó¥È¤ËÂФ·¤Æ¤ª¤³¤Ê¤Ã¤Æ¤¯¤À¤µ¤¤¡£ ======================================================================== * GLogger ¤Î¥¤¥ó¥¹¥È¡¼¥ë °Ê²¼¤Î¼ê½ç¤Ç¥¤¥ó¥¹¥È¡¼¥ë¤Ç¤­¤Þ¤¹¡£ $ ./configure [¥ª¥×¥·¥ç¥ó] $ make $ make install glogger, glogdump ¥³¥Þ¥ó¥É¤È¡¢µ¯Æ°¥¹¥¯¥ê¥×¥È¤Î glogd, glogd-func ¤¬ $(prefix)/bin ¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Þ¤¹¡£$(prefix)/man ¤Ë¥Þ¥Ë¥å¥¢¥ë¤¬¥¤¥ó ¥¹¥È¡¼¥ë¤µ¤ì¤Þ¤¹¡£ configure ¤Ë¤Ï°Ê²¼¤Î¥ª¥×¥·¥ç¥ó¤ò»ØÄê¤Ç¤­¤Þ¤¹¡£ ¡¦--prefix=¥Ç¥£¥ì¥¯¥È¥ê ¥¤¥ó¥¹¥È¡¼¥ëÀè¤Î¥Ç¥£¥ì¥¯¥È¥ê¤ò»ØÄꤷ¤Þ¤¹¡£¤³¤Î¥ª¥×¥·¥ç¥ó¤ò¾Êά¤·¤¿¾ì ¹ç¤Ï /usr/local ¥Ç¥£¥ì¥¯¥È¥ê¤Î²¼¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤·¤Þ¤¹¡£ ¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¾Êά²Äǽ¤Ç¤¹¡£ ¡¦--with-confdir=¥Ç¥£¥ì¥¯¥È¥ê glogger ¤ÎÀßÄê¥Õ¥¡¥¤¥ë¤òÃÖ¤¯¥Ç¥£¥ì¥¯¥È¥ê¤ò»ØÄꤷ¤Þ¤¹¡£¤³¤Î¥ª¥×¥·¥ç¥ó ¤ò¾Êά¤·¤¿¾ì¹ç¤Ï /etc/glogger ¥Ç¥£¥ì¥¯¥È¥ê¤Î²¼¤ËÀßÄê¥Õ¥¡¥¤¥ë¤òÃÖ¤­¤Þ ¤¹¡£ ¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¾Êά²Äǽ¤Ç¤¹¡£ ¡¦--enable-printtime ưºî¥¿¥¤¥ß¥ó¥°¤Î»þ¹ï¤òɽ¼¨¤¹¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡£ ¡¦--enable-hook_snmp_free_pdu snmp_free_pdu() ¤ò¼Â¹Ô¤µ¤ì¤Ê¤¤¤è¤¦¤Ë¤·¡¢snmp¥é¥¤¥Ö¥é¥ê¤¬¥ê¥¯¥¨¥¹¥ÈÍÑ¤Ë ³ÎÊݤ·¤¿¥á¥â¥ê¤òºÆÍøÍѤ¹¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡£ ¥ê¥¯¥¨¥¹¥È¤Ë¤«¤«¤ë»þ´Ö¤¬¾¯¤·Ã»¤¯¤Ê¤ê¤Þ¤¹¡£ ¡¦--with-dlopen=libnetsnmp.so(¤Þ¤¿¤Ïlibsnmp.so)¤Þ¤Ç¤Î¥Ñ¥¹ --enable-hook_snmp_free_pdu ¤ò»ØÄꤷ¤¿¤È¤­¤Ï¡¢snmp_free_pdu() ¤ò»È¤ï¤º¤Ë ¼«Á°¤Ç¥á¥â¥ê¤ò²òÊü¤·¤Æ¤¤¤Þ¤¹¡£¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»ØÄꤹ¤ë¤È¡¢¥ª¥ê¥¸¥Ê¥ë¤Î snmp_free_pdu() ¤ò¸Æ¤ó¤Ç¥á¥â¥ê¤ò²òÊü¤¹¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡£ ¤·¤«¤· libsnmp.so ¤¬ 2ÅÙÆÉ¤ß¹þ¤Þ¤ì¤ë¤³¤È¤Ë¤Ê¤Ã¤Æ¤·¤Þ¤¤¤Þ¤¹¡£ ´Ä¶­ÊÑ¿ô CPPFLAGS ¤È LDFLAGS ¤ò»ØÄꤷ¤Æ¡¢net-snmp ¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¤¿¥Ç¥£ ¥ì¥¯¥È¥ê¤ò»ØÄꤹ¤ë¤³¤È¤â¤Ç¤­¤Þ¤¹¡£ (glogger ¤Ï°ìÈ̥桼¥¶¸¢¸Â¤À¤±¤Ç¤â¡¢¥¤¥ó¥¹¥È¡¼¥ë¡¢¼Â¹Ô¤¬¤Ç¤­¤Þ¤¹) configure ¼Â¹ÔÎã $ env CPPFLAGS='-I/home/foo/netsnmp/include' \ LDFLAGS='-L/home/foo/netsnmp/lib -Wl,-rpath,/home/foo/netsnmp/lib' \ ./configure --prefix=/home/foo --enable-printtime \ --enable-hook_snmp_free_pdu \ --with-dlopen=/home/foo/netsnmp/lib/libsnmp.so ======================================================================== * ÀßÄê¥Õ¥¡¥¤¥ëºîÀ® sample.conf ¤È glogger.conf ¤Î¥Þ¥Ë¥å¥¢¥ë(man glogger.conf)¤ò»²¹Í¤ËÀßÄê ¥Õ¥¡¥¤¥ë¤òµ­½Ò¤·¤Þ¤¹¡£¾å½Ò¤Î snmpwalk ¥³¥Þ¥ó¥É¤ò»È¤Ã¤ÆÃµ¤·¤¿ OID ¤ò»Ø Äꤷ¤Þ¤¹¡£OID ¤Î¥Ë¥Ã¥¯¥Í¡¼¥à¤Ë¤Ï¡¢¶èÊ̤·¤ä¤¹¤¤Ì¾Á°¤ò¤Ä¤±¤ë¤³¤È¤ò¤ª´«¤á ¤·¤Þ¤¹¡£ ÀßÄê¥Õ¥¡¥¤¥ë¤Îµ­½Ò¤¬Àµ¤·¤¤¤«¤É¤¦¤«¤ò¡¢°Ê²¼¤Î¥³¥Þ¥ó¥É¤Ç³Îǧ¤·¤Þ¤¹¡£ $ glogger -checkconf -config [ÀßÄê¥Õ¥¡¥¤¥ë] ½ÐÎÏÀè¥Ç¥£¥ì¥¯¥È¥ê¤Ï¤¢¤é¤«¤¸¤áºîÀ®¤·¤Æ¤ª¤¤¤Æ¤¯¤À¤µ¤¤¡£¸½¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï¡¢ ¥Ç¥£¥ì¥¯¥È¥ê¤ò¼«Æ°¤ÇºîÀ®¤·¤Þ¤»¤ó¡£ ======================================================================== * ¼êư¤Çưºî³Îǧ ÊÔ½¸¤·¤¿ÀßÄê¥Õ¥¡¥¤¥ë¤ò»ØÄꤷ¤Æµ¯Æ°¤·¤Þ¤¹¡£ $ glogger -config [ÀßÄê¥Õ¥¡¥¤¥ë] Ctrl+c ¤ÇÄä»ß¤·¤Þ¤¹¡£ SNMP ¤Î±þÅú¤¬Ê֤äƤ³¤Ê¤¤¾ì¹ç¤Ï¡¢snmpget ¤Ê¤É¤Ç³Îǧ¤·¡¢SNMP ¥¨¡¼¥¸¥§¥ó ¥È¤ÎÀßÄê¤ò¸«Ä¾¤·¤Æ¤¯¤À¤µ¤¤¡£¥Õ¥¡¥¤¥ë¤Î½ÐÎϤ˼ºÇÔ¤¹¤ë¾ì¹ç¤Ï¡¢¥Ç¥£¥ì¥¯¥È ¥ê¤òºîÀ®¤·¤Æ¤¢¤ë¤«¡¢¤Þ¤¿¤Ï¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó¤ò¸«Ä¾¤·¤Æ¤¯¤À¤µ¤¤¡£ ¤³¤ÎÀßÄê¤Ç¥¨¥é¡¼¤¬¤Ê¤±¤ì¤Ð¡¢¥Ç¡¼¥â¥óµ¯Æ°¤µ¤»¤ë¤³¤È¤â¤Ç¤­¤Þ¤¹¡£ ======================================================================== * ¥Ç¡¼¥â¥óµ¯Æ°ÊýË¡ glogd ¥Õ¥¡¥¤¥ë¤ò»²¹Í¤Ëµ¯Æ°¥¹¥¯¥ê¥×¥È¤òºîÀ®¤·¤Þ¤¹¡£ Î㤨¤Ð Red Hat Linux ¤Ê¤é¤Ð /etc/init.d °Ê²¼¤ØÇÛÃÖ¤·¤Þ¤¹¡£ progname=glogd ¤È¤·¤¿¾ì¹ç¤Ï¡¢ÀßÄê¥Õ¥¡¥¤¥ë¤Ï¡¢glogger ¤ÎÀßÄê¥Õ¥¡¥¤¥ë¤òÃÖ¤¯¥Ç¥£¥ì¥¯¥È¥ê¤Ë¡¢ ¡Öglogd.conf¡×¤òºîÀ®¤·¤Þ¤¹¡£ sudo="sudo -u nobody" ¤Î¹àÌܤˤϡ¢¤É¤Î¥æ¡¼¥¶¸¢¸Â¤Ç GLogger ¤ò¼Â¹Ô¤¹¤ë¤«¤òµ­½Ò¤·¤Æ¤¯¤À¤µ¤¤¡£ ¤³¤Î¾ì¹ç¤Ï¡¢nobody ¥æ¡¼¥¶¸¢¸Â¤Ç¥Õ¥¡¥¤¥ë¤ò½ÐÎϤ·¤Þ¤¹¡£ ½ÐÎÏÀè¥Ç¥£¥ì¥¯¥È¥ê¤Î¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó¤Ëµ¤¤ò¤Ä¤±¤Æ¤¯¤À¤µ¤¤¡£ °ìÈ̥桼¥¶¸¢¸Â¤Ç¡¢¤³¤Î¥¹¥¯¥ê¥×¥È¤ò¼êư¤Ç¼Â¹Ô¤¹¤ë¾ì¹ç¤Ï¡¢¤³¤Î¹àÌܤò¥³¥á¥ó¥È ¥¢¥¦¥È¤·¤Æ»È¤Ã¤Æ¤¯¤À¤µ¤¤¡£ ¥Þ¥·¥óµ¯Æ°»þ¤Ë glogd ¥¹¥¯¥ê¥×¥È¤ò»È¤Ã¤Æ glogger ¤òµ¯Æ°¤¹¤ë¤è¤¦¤Ë¤¹¤ëÎã # /sbin/chkconfig --add glogd µ¯Æ°¤¹¤ë¾ì¹ç # /etc/init.d/glogd start Ää»ß¤¹¤ë¾ì¹ç # /etc/init.d/glogd stop ºÆµ¯Æ°¤¹¤ë¾ì¹ç # /etc/init.d/glogd restart ======================================================================== * GMonitor µ¯Æ°ÊýË¡ JRE 1.4 °Ê¹ß¤¬É¬ÍפǤ¹¡£ gmonitor3.jar ¤òÍѰդ·¤Þ¤¹¡£°Ê²¼¤Î¥³¥Þ¥ó¥É¤Çµ¯Æ°¤Ç¤­¤Þ¤¹¡£ $ jar -jar gmonitor3.jar Windows ¤Î¾ì¹ç¤Ï¡¢gmonitor3.jar ¤ò¥À¥Ö¥ë¥¯¥ê¥Ã¥¯¤·¤Þ¤¹¡£ GMonitor µ¯Æ°¸å¡¢AutoUpdate ¤Ë¥Á¥§¥Ã¥¯¤òÆþ¤ì¤Æ¡¢glogger ¤«¤é¤Î½ÐÎÏÀè¥Ç¥£ ¥ì¥¯¥È¥ê¤ò»ØÄꤹ¤ë¤«¡¢Open Files ¤Ç¥Õ¥¡¥¤¥ë¤ò»ØÄꤹ¤ë¤È¡¢¥°¥é¥Õ¤¬É½¼¨ ¤µ¤ì¤Þ¤¹¡£ ======================================================================== * glogdump ¥³¥Þ¥ó¥É¤Ë¤Ä¤¤¤Æ glogdump ¤Ï glogger ¤¬½ÐÎϤ·¤¿¥í¥°¥Õ¥¡¥¤¥ë¤ò¡¢¥Æ¥­¥¹¥È·Á¼°¤ÇÆÉ¤á¤ë¤è¤¦ ¤ËÊÑ´¹¤·¤Þ¤¹¡£glogger ¤ÇÀßÄꤷ¤¿ÆâÍÆ¤È¡¢³Æ»þ¹ï¤Ë¼èÆÀ¤·¤¿Ãͤ¬¤ï¤«¤ê¤Þ¤¹¡£ »ÈÍÑÎã¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¹¡£ $ glogdump [glogger output file] | more gfarm-2.4.1/snmptool/glogger3/INSTALL.en0000644000000000000000000000225111507222726016332 0ustar rootroot*** Installation Glogger requires the net-snmp 5.0.8 or ucd-snmp 4.2.6 development package. It is tested on Linux and FreeBSD. $ ./configure [options] ex. $ env CPPFLAGS='-I/home/foo/snmp/include' \ LDFLAGS='-L/home/foo/snmp/lib -Wl,-rpath,/home/foo/snmp/lib' \ ./configure --prefix=/home/foo --enable-printtime \ --enable-hook_snmp_free_pdu \ --with-dlopen=/home/foo/snmp/lib/libsnmp.so $ make $ make install 'glogger', 'glogdump', 'glogd' and 'glogd-func' will be installed in $(prefix)/bin. *** Configuration file Create a configuration file for the glogger. There is a sample file 'sample.conf'. With the -checkconf option, 'glogger' checks the syntax of the configuration file. $ glogger -checkconf -config [your config file] *** Running the glogger $ glogger -config [config file] *** Running the glogger as a daemon Install a start-up script 'glogd' to a startup directory. # cp glogd /etc/init.d # /etc/init.d/glogd start # /etc/init.d/glogd stop *** Glogdump 'glogdump' converts log files from a binary format to a human-friendly ascii format. $ glogdump [glogger output file] | more gfarm-2.4.1/snmptool/glogger3/glogd-func0000644000000000000000000000332311507222726016651 0ustar rootroot#!/bin/sh # # functions # This file contains functions to be used by glogd startup script. # check_process() { if [ ! -f ${pidfile} ]; then return 1 fi pid=`cat ${pidfile}` if [ -z ${pid} ]; then RETVAL=1 else ps -p ${pid} > /dev/null RETVAL=$? fi if [ $RETVAL -eq 1 ]; then rm -f ${pidfile} return 1 fi return $RETVAL } exec_glogger(){ echo -n "Starting ${progname}: " ${sudo} ${program} ${OPTIONS} RETVAL=$? if [ $RETVAL -ne 0 ]; then echo "Failed to start ${progname}. (=$RETVAL)" return $RETVAL fi sleep 1 pid=`cat ${pidfile}` echo "PID: ${pid}" } start() { check_process RETVAL=$? if [ $RETVAL -eq 0 ]; then echo ${progname} is running... return 0; fi exec_glogger RETVAL=$? return $RETVAL } stop() { echo -n $"Stopping ${progname}: " check_process RETVAL=$? if [ $RETVAL -eq 1 ]; then echo No ${progname} is running... return 1; fi kill -SIGINT `cat ${pidfile}` RETVAL=$? if [ $RETVAL -eq 0 ]; then echo PID: `cat ${pidfile}` rm -f ${pidfile} return $RETVAL fi # No such process rm -f ${pidfile} return $RETVAL } restart() { echo -n $"Restarting ${progname}: " check_process RETVAL=$? if [ $RETVAL -eq 1 ]; then start return 0; fi oldpid=`cat ${pidfile}` kill -SIGHUP `cat ${pidfile}` sleep 1 newpid=`cat ${pidfile}` echo "PID ${oldpid} -> ${newpid}" return 0 } status() { check_process RETVAL=$? if [ $RETVAL -eq 1 ]; then echo No ${progname} is running... return 1; fi echo $progname is running. PID: `cat ${pidfile}` return 0 } checkconf() { ${program} -checkconf -config ${conffile} } gfarm-2.4.1/snmptool/glogger3/snmpasync.c0000644000000000000000000002556311507222726017072 0ustar rootroot#include "glogger.h" #include #include /* rint */ #include #include #ifdef USE_DLOPEN #include void (*original_snmp_free_pdu)(struct snmp_pdu*); #endif int glogger_active_hosts; /* number of request */ /* ------------------------------------------------------------------ */ static void my_sleep(struct timeval *sleeptime){ fd_set rfds; //int i; if(sleeptime == NULL){ return; } FD_ZERO(&rfds); #if 0 do { printf("*** sleep...\n"); i = select(1, &rfds, NULL, NULL, sleeptime); //printf("sleep: select = %d\n", i); } while(i < 0) ; #endif select(1, &rfds, NULL, NULL, sleeptime); } void glogger_sleep(struct timeval *timeout){ struct timeval now; gettimeofday(&now, NULL); my_sleep(glogger_checktime(&now, timeout)); } void glogger_update_timeout(struct timeval *timeout, struct timeval *interval){ timeout->tv_usec += interval->tv_usec; timeout->tv_sec += interval->tv_sec; if(timeout->tv_usec >= 1000000L){ timeout->tv_usec -= 1000000L; timeout->tv_sec += 1; } } struct timeval * glogger_checktime(struct timeval *now, struct timeval *timeout){ static struct timeval returntime; if(now->tv_sec > timeout->tv_sec){ return NULL; /* TIMEOUT */ } else if(now->tv_sec == timeout->tv_sec){ if(now->tv_usec >= timeout->tv_usec){ return NULL; /* TIMEOUT */ } } /* timeout > now */ returntime.tv_sec = timeout->tv_sec - now->tv_sec; returntime.tv_usec = timeout->tv_usec - now->tv_usec; if(returntime.tv_usec < 0){ returntime.tv_usec += 1000000L; returntime.tv_sec -= 1; } return &returntime; } #ifdef HOOK_snmp_free_pdu /* hook from snmp library*/ void snmp_free_pdu(struct snmp_pdu *pdu){ //printf("*** hooked snmp_free_pdu \n"); if (!pdu) return; //printf("command = %d\n", pdu->command); if(pdu->command != SNMP_MSG_GET){ /* not request */ #ifdef USE_DLOPEN original_snmp_free_pdu(pdu); //printf("*** call original snmp_free_pdu ok \n"); #else #ifndef USE_UCDSNMP /* for net-snmp */ { struct snmp_secmod_def *sptr; if ((sptr = find_sec_mod(pdu->securityModel)) != NULL && sptr->pdu_free != NULL) { (*sptr->pdu_free) (pdu); } } #endif /* ifndef USE_UCDSNMP */ snmp_free_varbind(pdu->variables); SNMP_FREE(pdu->enterprise); SNMP_FREE(pdu->community); SNMP_FREE(pdu->contextEngineID); SNMP_FREE(pdu->securityEngineID); SNMP_FREE(pdu->contextName); SNMP_FREE(pdu->securityName); #ifndef USE_UCDSNMP /* for net-snmp */ SNMP_FREE(pdu->transport_data); #endif /* ifndef USE_UCDSNMP */ free((char *)pdu); #endif /* USE_DLOPEN */ } /* else: do nothing */ } void glogger_renew_id_requests(struct snmp_pdu *pdu){ pdu->reqid = snmp_get_next_reqid(); pdu->msgid = snmp_get_next_msgid(); } #endif /* HOOK_snmp_free_pdu */ void set_value_to_dbgmap(unsigned long *val, char *setstr, unsigned short mibtype){ char *p, *str; double f; //printf("setstr: %s\n", setstr); //printf("mibtype: %d\n", mibtype); switch (mibtype) { case TYPEMODE_load: /* for load average -> *100 */ /* ex. STRING: 1.58 */ str = setstr; do { f = strtod(str, &p); //printf(" --> %s\n", p); str++; } while(*p != '\0'); //printf(" float: %f\n", f); *val = (unsigned long) rint(f*100); break; case TYPEMODE_interface: /* get tail value */ /* ex. Counter32: 1609014642 */ str = setstr; do { *val = strtoul(str, &p, 10); //printf(" %lu --> %s\n", *val, p); str++; } while(*p != '\0'); break; case TYPEMODE_uptime: /* uptime */ /* ex. Timeticks: (346391518) 40 days, 2:11:55.18 */ /* ^^^^^^^^^ */ str = setstr; do { *val = strtoul(str, &p, 10); //printf(" %lu --> %s\n", *val, p); str++; } while(*p != ')' && *p != '\0'); break; default: *val = 0; } //printf(" --> value: %lu\n", *val); } /* snmp async get -------------------------------------------------------- */ #define BUFSIZE SPRINT_MAX_LEN //#define BUFSIZE 128 static char sprintbuf[BUFSIZE]; static int glogger_response_callback(int operation, struct snmp_session *sp, int reqid, struct snmp_pdu *pdu, void *magic){ struct req_list *reqlist = (struct req_list*) magic; struct variable_list *vp; struct req_oids *oids; //int buflen, i; vp = pdu->variables; oids = reqlist->reqoids; //printf("id=%d: %s\n", reqid, reqlist->node->nodenick); if(operation == GLOGGER_OP_RECEIVED_MESSAGE){ if (pdu->errstat == SNMP_ERR_NOERROR) { while(vp && oids){ //printf("%s\n", oids->oidval->oidnick); //print_variable(vp->name, vp->name_length, vp); #if 0 /* test : snprint_value */ buflen = 0; do { buflen++; i = snprint_value(sprintbuf, buflen, vp->name, vp->name_length, vp); } while(i < 0); printf("len = %d, buflen = %d\n", i, buflen); if(vp->type == ASN_OCTET_STR){ printf("vp->type == ASN_OCTET_STR\n"); } #else snprint_value(sprintbuf, BUFSIZE, vp->name, vp->name_length, vp); #endif //printf("%s: %s\n", oids->oidval->oidnick, sprintbuf); /* valid */ oids->dbgmap->flag |= FLAG_VALID; /* OK */ oids->dbgmap->flag |= FLAG_OK; set_value_to_dbgmap(&oids->dbgmap->mibval, sprintbuf, oids->oidval->mibtype); //print_objid(oids->oidval->oid, oids->oidval->oidlen); /* by same turns */ vp = vp->next_variable; oids = oids->next; } } else { printf("pdu->errstat = %ld (%s)\n", pdu->errstat, snmp_errstring(pdu->errstat)); /* do nothing */ } } else { /* STAT_TIMEOUT */ while(oids){ /* valid (only) */ oids->dbgmap->flag |= FLAG_VALID; oids = oids->next; } printf("*** timeout: %s\n", reqlist->node->nodenick); } glogger_active_hosts--; return 1; } void glogger_init_targets(struct nodelist *nodelist){ struct snmp_session sess; #ifdef USE_DLOPEN /* when using dlopen() */ void *handle; char *error; handle = dlopen(USE_DLOPEN, RTLD_LAZY); printf("dll = %s\n", USE_DLOPEN); if (!handle) { fputs (dlerror(), stderr); exit(1); } original_snmp_free_pdu = dlsym(handle, "snmp_free_pdu"); if ((error = dlerror()) != NULL) { fprintf (stderr, "%s\n", error); exit(1); } #endif snmp_sess_init(&sess); //sess.version = SNMP_VERSION_2c; sess.version = SNMP_VERSION_1; sess.callback = glogger_response_callback; //sess.timeout = 100000L; sess.timeout = 0L; sess.retries = 0; glogger_active_hosts = 0; while(nodelist){ sess.peername = nodelist->nodename; sess.community = nodelist->community; sess.community_len = strlen(sess.community); if (!(nodelist->session = snmp_open(&sess))) { snmp_perror("snmp_open"); return; } nodelist = nodelist->next; } } #ifdef PRINTTIME void printtime(struct timeval *time, char *name){ struct tm *tm; char buf[128]; if(time == NULL){ fprintf(stdout, "%s\n", name); } else { rdtscll(rdtsc_now); //printf("clock %d\n", rdtsc_now-rdtsc_start); tm = localtime(&time->tv_sec); // fprintf(stdout, "%.2d:%.2d:%.2d.%.6ld : %s\n", // tm->tm_hour, tm->tm_min, tm->tm_sec, time->tv_usec, // name); fprintf(stdout, "%.2d:%.2d:%.2d.%.6ld : %lu", tm->tm_hour, tm->tm_min, tm->tm_sec, time->tv_usec, rdtsc_now-rdtsc_start); fprintf(stdout, " : %s\n", name); } } #endif /* PRINTTIEM */ /* return value: 0: timeout 1: receiving ok 2: no request */ int count=1; int glogger_snmpget(struct req_list *reqlist, struct timeval *timeout){ struct snmp_pdu *reqpdu; struct timeval now; struct timeval *ct; /* for checktime */ struct req_oids *reqo; #ifdef PRINTTIME int getfirst = 0; /* flag */ #endif printf("=== %d ===\n", count++); gettimeofday(&now, NULL); #if 0 //#ifdef PRINTTIME printtime(&now, "START"); #endif if(reqlist == NULL){ printf("NOREQUEST\n"); return 2; } /* check first */ ct = glogger_checktime(&now, timeout); if(ct == NULL){ fprintf(stdout, "TIMEOUT1\n"); return 0; } /* ----- request ----- */ #ifdef PRINTTIME gettimeofday(&now, NULL); printtime(&now, "REQUEST"); #endif glogger_active_hosts = 0; /* initialize */ while(reqlist){ //reqset->host->nowreq = reqset; /* set current request */ /* prepare request */ #ifdef HOOK_snmp_free_pdu if(reqlist->reqpdu == NULL){ reqpdu = snmp_pdu_create(SNMP_MSG_GET); reqo = reqlist->reqoids; while(reqo != NULL){ snmp_add_null_var(reqpdu, reqo->oidval->oid, reqo->oidval->oidlen); reqo = reqo->next; } reqlist->reqpdu = reqpdu; } else { glogger_renew_id_requests(reqlist->reqpdu); } reqpdu = reqlist->reqpdu; #else reqpdu = snmp_pdu_create(SNMP_MSG_GET); reqo = reqlist->reqoids; while(reqo != NULL){ snmp_add_null_var(reqpdu, reqo->oidval->oid, reqo->oidval->oidlen); reqo = reqo->next; } #endif //printf("%s\n", reqlist->node->nodenick); reqlist->node->session->callback_magic = reqlist; if(snmp_send(reqlist->node->session, reqpdu)){ glogger_active_hosts++; //printf("*** snmp_send: OK\n"); } else { snmp_perror("snmp_send"); snmp_free_pdu(reqpdu); } reqlist = reqlist->next; } #ifdef PRINTTIME gettimeofday(&now, NULL); printtime(&now, "WAIT"); #endif /* ----- recieve and save ----- */ /* loop while any active hosts */ while(glogger_active_hosts) { int fds = 0, block = 0; fd_set fdset; struct timeval selecttimeout; gettimeofday(&now, NULL); ct = glogger_checktime(&now, timeout); if(ct == NULL){ snmp_timeout(); //printf("*** timeout: active_hosts = %d\n", active_hosts); fprintf(stdout, "TIMEOUT2\n"); return 0; } FD_ZERO(&fdset); printf("*** remaining hosts: %d\n", glogger_active_hosts); snmp_select_info(&fds, &fdset, &selecttimeout, &block); selecttimeout.tv_sec = ct->tv_sec; selecttimeout.tv_usec = ct->tv_usec; fds = select(fds, &fdset, NULL, NULL, block ? NULL : &selecttimeout); //printf("*** select end %d\n", fds); if(fds > 0) { #ifdef PRINTTIME if(getfirst == 0){ gettimeofday(&now, NULL); printtime(&now, "RECEIVE"); getfirst = 1; } #endif snmp_read(&fdset); #if 0 //#ifdef PRINTTIME gettimeofday(&now, NULL); printtime(&now, "snmp_read"); #endif } else if(fds == 0){ //printf("no response\n"); } else { /* when catching signal or timeout */ #if 0 switch(errno) { case EBADF: printf("EBADF\n"); break; case EINTR: printf("EINTR\n"); break; case EINVAL: printf("EINVAL\n"); break; case ENOMEM: printf("ENOMEM\n"); break; } #endif #ifdef PRINTTIME gettimeofday(&now, NULL); printtime(&now, "CANCEL"); #endif snmp_timeout(); return -1; } } return 1; } gfarm-2.4.1/snmptool/glogger3/glogdump.c0000644000000000000000000001562511507222726016673 0ustar rootroot#include "glogger.h" #include //#include #include #include struct dbgmap { int n; /* the number */ char *map; struct dbgmap *next; }; /* ------------------------------------------------------------------------ */ void print_blockname(char *str){ printf("# %s\n", str); } int read16(uint16_t *n, FILE *fp){ int r; r = fread(n, 1, 2, fp); if(r == 0){ exit(1); } *n = ntohs(*n); return r; } int read32(uint32_t *n, FILE *fp){ int r; r = fread(n, 1, 4, fp); if(r == 0){ exit(1); } *n = ntohl(*n); return r; } char *readvariable(unsigned long n, FILE *fp){ char *c; c = (char*) calloc(1, n); if(c == NULL){ printf("Error: calloc()\n"); exit(1); } if(fread(c, 1, n, fp) == 0){ exit(1); } return c; } char *mytime(const time_t *n){ struct tm *tm; static char str[32]; tm = localtime(n); snprintf(str, 32, "%.4d/%.2d/%.2d %.2d:%.2d:%.2d", tm->tm_year+1900, tm->tm_mon+1, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec); return str; //return ctime((long*)n); } int print_bit(FILE *fp){ char c; int i; int r; printf(":"); r = fread(&c, 1, 1, fp); if(r == 0){ exit(1); } for(i=0; i<8; i++){ if(c & (0x80 >> i)){ printf("1"); } else { printf("0"); } } return r; } /* ------------------------------------------------------------------------ */ void metadata1check(FILE *fp){ uint16_t n16; read16(&n16, fp); if(n16 != 22){ printf("*** metadata1check: size = %u\n", n16); exit(1); } } void VersionOfFormat(FILE *fp){ uint16_t n16; read16(&n16, fp); printf("VersionOfFormat::%u\n", n16); } void DataBlockGroupSize(FILE *fp){ uint32_t n32; read32(&n32, fp); printf("DataBlockGroupSize::%u\n", n32); } void StartDateTimeInUNIX(FILE *fp){ uint32_t n32; read32(&n32, fp); printf("StartDateTimeInUNIXSeconds::%u:\"%s\"\n", n32, mytime((time_t *)&n32)); //printf("StartDateTimeInUNIXSeconds::%u\n", n32); read32(&n32, fp); printf("StartDateTimeInUNIXuSeconds::%u\n", n32); } void DataBlockGroupIntervalInUNIX(FILE *fp){ uint32_t n32; read32(&n32, fp); printf("DataBlockGroupIntervalInUNIXSeconds::%u\n", n32); read32(&n32, fp); printf("DataBlockGroupIntervalInUNIXuSeconds::%u\n", n32); } void metadata2check(FILE *fp){ uint32_t n32; read32(&n32, fp); printf("SecondMetaBlockSize::%u\n", n32); } void HostDefElement(FILE *fp){ uint16_t n16; char *s; int i, count; read16(&n16, fp); s = readvariable(n16, fp); i = count = 0; while(i < n16){ /* IP */ printf("HostDefElement:%d:%s", count, s); while(*s != '\0') {s++; i++;} s++; i++; /* FQDN */ printf(":%s", s); while(*s != '\0') {s++; i++;} s++; i++; /* nick */ printf(":%s", s); while(*s != '\0') {s++; i++;} s++; i++; /* community */ printf(":%s\n", s); while(*s != '\0') {s++; i++;} s++; i++; count++; } } void OIDDefElement(FILE *fp){ uint16_t n16; char *s; int i, count; read16(&n16, fp); s = readvariable(n16, fp); i = count = 0; while(i < n16){ /* OID */ printf("OIDDefElement:%d:%s", count, s); while(*s != '\0') {s++; i++;} s++; i++; /* nick */ printf(":%s\n", s); while(*s != '\0') {s++; i++;} s++; i++; count++; } } void IntervalDefElement(FILE *fp){ uint16_t n16; unsigned short m; unsigned long n; char *s; int i, count; read16(&n16, fp); s = readvariable(n16, fp); i = count = 0; while(i < n16){ printf("IntervalDefElement:%d", count); /* host index */ m = ntohs(*(uint16_t*)s); printf(":%d-", m); s = s + 2; /* oid index */ m = ntohs(*(uint16_t*)s); printf("%d", m); s = s + 2; /* second */ n = ntohl(*(uint32_t*)s); printf(":%lu", n); s = s + 4; /* microsecond */ n = ntohl(*(uint32_t*)s); printf(".%.6lu\n", n); s = s + 4; i = i + 12; count++; } } struct dbgmap * add_dgbmaplist(struct dbgmap *dm, int count, char *s){ struct dbgmap *now, *top; top = dm; now = (struct dbgmap*)calloc(1, sizeof(struct dbgmap)); if(now == NULL){ exit(2); } now->n = count; now->map = s; now->next = NULL; if(dm == NULL){ return now; } /* add to tail */ while(dm->next){ dm = dm->next; } dm->next = now; return top; } struct dbgmap * DataBlockGroupElement(FILE *fp){ uint16_t n16; unsigned short m; //unsigned long n; char *s; int i, j, count; struct dbgmap *dbgmap = NULL; read16(&n16, fp); s = readvariable(n16, fp); i = count = 0; while(i < n16){ printf("DataBlockGroupElement"); /* the number */ m = ntohs(*(uint16_t*)s); printf(":%u", m); s = s + 2; count = m; i = i + 2; dbgmap = add_dgbmaplist(dbgmap, count, s); /* */ j = 0; while(j < count){ /* host index */ //m = ntohs(*(uint16_t*)s); m = *(uint16_t*)s = ntohs(*(uint16_t*)s); printf(":%u", m); s = s + 2; /* oid index */ //m = ntohs(*(uint16_t*)s); m = *(uint16_t*)s = ntohs(*(uint16_t*)s); printf("-%u", m); s = s + 2; i = i + 4; j++; } printf("\n"); } return dbgmap; } int datablock_count = 0; int DataBlock(FILE *fp, struct dbgmap *dm){ uint32_t n32; int i; unsigned short hostid, oidid; char *s; s = dm->map; if(dm->n == 0){ printf("# DataBlock %d\n", datablock_count++); return 2; } read32(&n32, fp); /* EOF -> EXIT */ printf("# DataBlock %d\n", datablock_count++); printf("TimeStampInSeconds::%u:\"%s\"\n", n32, mytime((time_t *)&n32)); read32(&n32, fp); printf("TimeStampInuSeconds::%u\n", n32); //printf("%d\n", dm->n); i = 0; while(i < dm->n){ hostid = *(uint16_t*)s; s = s + 2; oidid = *(uint16_t*)s; s = s + 2; printf("MeasurementData:%u-%u", hostid, oidid); print_bit(fp); read32(&n32, fp); printf(":%u\n", n32); i++; } return 1; } /* main */ int main(int argc, char **argv){ FILE *fp; struct dbgmap *dbgmap, *dbgmaptop; //uint32_t n32; //uint16_t n16; if(argc != 2){ printf("%s [file(.glg)]\n", argv[0]); exit(1); } fp = fopen(argv[1], "r"); if(fp == NULL){ printf("Error: cannot open %s\n", argv[1]); } /* metadata1 */ print_blockname("First Meta Block"); metadata1check(fp); VersionOfFormat(fp); DataBlockGroupSize(fp); StartDateTimeInUNIX(fp); DataBlockGroupIntervalInUNIX(fp); /* metadata2 */ print_blockname("Second Meta Block"); metadata2check(fp); print_blockname("HostDefBlock"); HostDefElement(fp); print_blockname("OIDDefBlock"); OIDDefElement(fp); print_blockname("IntervalDefBlock"); IntervalDefElement(fp); print_blockname("DataBlockGroupTable"); dbgmap = DataBlockGroupElement(fp); dbgmaptop = dbgmap; #if 1 /* data block */ while(DataBlock(fp, dbgmap) > 0){ dbgmap = dbgmap->next; if(dbgmap == NULL){ dbgmap = dbgmaptop; //exit(0); } } #endif return 0; } gfarm-2.4.1/snmptool/glogger3/Makefile.in0000644000000000000000000000517611507222726016756 0ustar rootroot# Makefile for GLogger top_objdir = @top_objdir@ top_srcdir = @top_srcdir@ srcdir = @srcdir@ include config.mk ### use hook snmp_free_pdu() (fast, un-recommending) #MYFREEPDU = "-DHOOK_snmp_free_pdu" MYFREEPDU = @hook_snmp_free_pdu@ ### call original snmp_free_pdu() in hooked snmp_free_pdu() #DLOPEN = "-DUSE_DLOPEN=\"/usr/lib/libsnmp.so\"" #DLOPEN = "-DUSE_DLOPEN=\"libsnmp.so\"" DLOPEN = @snmpdlopen@ ### print action timing ($ glogger | avg.pl) #PRINTTIME = "-DPRINTTIME" PRINTTIME = @printtime@ USEUCD = @useucd@ # ======================================================================== GLOGGER = glogger DUMPLOG = glogdump LIBGLOG = libglogger LIBSRCS = read_glogger_conf.c snmpasync.c expand_node_name.c prepare_files.c \ write_to_files.c set_options.c BINS = $(GLOGGER) $(DUMPLOG) glogd glogd-func SRCS = $(GLOGGER).c $(DUMPLOG).c $(LIBSRCS) HEADS = $(GLOGGER).h expand_node_name.h OBJS = $(SRCS:.c=.o) LIBOBJS = $(LIBSRCS:.c=.o) FILES = INSTALL.en INSTALL.ja Makefile.in config.mk.in \ install-sh $(HEADS) $(SRCS) sample.conf glogd.in avg1.pl avg2.pl \ configure configure.in setsnmp_configure glogd-func DOCS = docbook/Makefile \ docbook/en/{Makefile,docdir.mk} \ docbook/ja/{Makefile.in,docdir.mk,*.{5,8}{,.docbook,.html}} VER = 3-`date +%Y%m%d` # for debug #DEBUG = -g -ggdb -pg # ld (*.o) LD = gcc LDFLAGS = @LDFLAGS@ LDLIBS = @LIBS@ # C (*.c) CC = @CC@ CFLAGS2 = $(USEUCD) $(MYFREEPDU) $(DLOPEN) $(PRINTTIME) CFLAGS = @CFLAGS@ $(CFLAGS2) CPPFLAGS= -I$(srcdir) @CPPFLAGS@ # commands SHELL = /bin/sh RM = rm -f AR = ar ### rules ### .SUFFIXES: .SUFFIXES: .o .c all: $(GLOGGER) $(DUMPLOG) $(GLOGGER): $(GLOGGER).o $(LIBGLOG).a $(LD) $(LDFLAGS) $(GLOGGER).o $(LIBGLOG).a -o $@ $(LDLIBS) $(DUMPLOG): $(DUMPLOG).o $(LIBGLOG).a $(LD) $(LDFLAGS) $(DUMPLOG).o $(LIBGLOG).a -o $@ $(LDLIBS) $(LIBGLOG).a: $(LIBOBJS) $(TESTLIB) $(AR) ruc $@ $(LIBOBJS) $(OBJS): $(HEADS) Makefile .c.o: $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@ install: $(BINS) @for i in / $(BINS); do \ case $$i in /) continue;; esac; \ ( set -x; $(INSTALL_PROGRAM) $${i} $(bindir)/$${i} ); \ done $(INSTALL_DATA) sample.conf $(sysconfdir)/sample.conf (cd docbook; $(MAKE) install) clean: (cd docbook; $(MAKE) clean) $(RM) $(BINS) $(OBJS) *.a \ core gmon.out *~ *.log distclean: clean $(RM) config.log config.status config.cache \ Makefile config.mk glogd docbook/ja/Makefile doc: (cd docbook; $(MAKE)) tar: @echo $(GLOGGER)$(VER) > .package @$(RM) -r `cat .package` @mkdir `cat .package` cp --parents $(FILES) $(DOCS) `cat .package` tar cvf - `cat .package` | gzip -9 > `cat .package`.tar.gz @$(RM) -r `cat .package` .package gfarm-2.4.1/snmptool/glogger3/configure.in0000644000000000000000000000251511507222726017214 0ustar rootroot# Process this file with autoconf to produce a configure script. AC_INIT(glogger.c) AC_CONFIG_SRCDIR(glogger.c) top_objdir=`pwd` AC_SUBST(top_objdir) AC_PROG_CC AC_PROG_INSTALL # Checks for libraries. AC_CHECK_LIB(m, main,, [exit 1 ]) AC_CHECK_LIB(crypto, main,, [exit 1 ]) # Checks for header files. AC_CHECK_HEADER([net-snmp/net-snmp-config.h], [useucd= AC_CHECK_LIB(netsnmp, main) ], [ AC_CHECK_HEADER([ucd-snmp/ucd-snmp-config.h], [useucd=-DUSE_UCDHEADER AC_CHECK_LIB(snmp, main) ], [echo "Please install the net-snmp or ucd-snmp package." exit 1 ]) ]) AC_SUBST(useucd) AC_ARG_WITH(confdir, [ --with-confdir=DIR glogger configuration file directory (sysconfdir/glogger)], [confdir=${withval} ], [confdir=${sysconfdir}/glogger ]) AC_SUBST(confdir) AC_ARG_ENABLE(printtime, [ --enable-printtime use -DPRINTTIME], [printtime=-DPRINTTIME ], [printtime= ]) AC_SUBST(printtime) AC_ARG_ENABLE(hook_snmp_free_pdu, [ --enable-hook_snmp_free_pdu], [hook_snmp_free_pdu=-DHOOK_snmp_free_pdu ], [hook_snmp_free_pdu= ]) AC_SUBST(hook_snmp_free_pdu) AC_ARG_WITH(dlopen, [ --with-dlopen= when using --enable-hook_snmp_free_pdu], [snmpdlopen="-DUSE_DLOPEN=\\\"${withval}\\\"" AC_CHECK_LIB(dl, dlopen) ], [snmpdlopen= ]) AC_SUBST(snmpdlopen) AC_CONFIG_FILES(Makefile config.mk glogd docbook/ja/Makefile) AC_OUTPUT gfarm-2.4.1/snmptool/glogger3/write_to_files.c0000644000000000000000000001307611507222726020071 0ustar rootroot#include "glogger.h" #include #include /* write mib values to files ---------------------------------------------- */ /* see also: create_dbg_map() */ void fwrite_filebuf(struct filelist *file){ int len; printf("fwrite_filebuf: fwrite()\n"); len = fwrite(file->buf, 1, file->buf_count, file->fp); printf("fwrite len: %d\n", len); /* reset buf */ file->buf_point = file->buf; file->buf_count = 0; return; } /* compatible with fwrite() */ size_t my_fwrite(const void *ptr, size_t size, size_t nmemb, struct filelist *file){ size_t n; unsigned long bufsize; n = size*nmemb; bufsize = ntohl(file->dbg_size)*file->buf_num; //printf("n: %d, buf_count: %lu, bufsize: %lu\n", n, file->buf_count, bufsize); file->buf_count += n; if(file->buf_count > bufsize){ printf("buffer is full\n"); file->buf_count -= n; fwrite_filebuf(file); exit(4); } memcpy(file->buf_point, ptr, n); if(file->buf_count == bufsize){ /* full */ fwrite_filebuf(file); if(bufmode == BUFMODE_BURST){ printf("buffer is full: exit burst mode\n"); exit(1); }; } else { file->buf_point += n; } return n; } void glogger_fsync(int fd){ if(fsync_count < fsync_timing){ fsync_count++; } else { printf("fsync()\n"); fsync(fd); fsync_count = 1; } } void glogger_fflush_files(struct filelist *files){ #ifdef PRINTTIME struct timeval now; gettimeofday(&now, NULL); printtime(&now, "FLUSH"); #endif while(files){ if(bufmode == BUFMODE_MMAP){ printf("msync: %s\n", files->path); msync(files->buf, files->buf_count, 0); } else if(bufmode != BUFMODE_NONE){ fwrite_filebuf(files); printf("fflush()\n"); fflush(files->fp); if(global_fsyncmode >= 0){ glogger_fsync(fileno(files->fp)); } } else { /* BUFMODE_NONE */ printf("fflush()\n"); fflush(files->fp); if(global_fsyncmode >= 0){ glogger_fsync(fileno(files->fp)); } } files = files->next; } } static void change_file(struct filelist *file){ printf("change file: %s\n", file->nowpath); glogger_close_file(file); glogger_open_file(file); glogger_write_metadata(file); } /* if(bufmode == BUFMODE_NONE && reqloop == reqloop_top) */ int glogger_check_and_change_file(struct filelist *files, struct timeval *changetime){ struct timeval nowtime; gettimeofday(&nowtime, NULL); //printf("%u, %u\n", global_fileinterval.tv_sec, changetime->tv_sec); glogger_renew_time(); if(global_outputsizemax != 0){ /* file size */ while(files){ if(files->buf_count >= files->buf_max){ glogger_compare_and_change_filename(files); change_file(files); } files = files->next; } } else { /* path rule */ while(files){ if(glogger_compare_and_change_filename(files) > 0 ){ change_file(files); } files = files->next; } } return 1; } /* --------------------------------------------------------------------- */ size_t glogger_fwrite(const void *ptr, size_t size, size_t nmemb, struct filelist *file){ int l, r, w; //printf("glogger_fwrite\n"); l = size*nmemb; r = 0; while(l > r){ w = fwrite(ptr, 1, l, file->fp); ptr += w; r += w; } file->buf_count += l; //printf("fwrite: count=%lu, max=%lu\n", file->buf_count, file->buf_max); return l; } size_t glogger_mmap(const void *ptr, size_t size, size_t nmemb, struct filelist *file){ int len = size*nmemb; struct timeval now; //printf("glogger_mmap\n"); memcpy(file->buf_point, ptr, len); file->buf_point += len; file->buf_count += len; if(file->buf_count >= file->buf_max){ printf("count(%lu) >= max(%lu)\n", file->buf_count, file->buf_max); printf("msync: %s\n", file->path); msync(file->buf, file->buf_count, 0); #ifdef PRINTTIME gettimeofday(&now, NULL); printtime(&now, "END"); #endif exit(1); } return len; } size_t glogger_write_mybuf(const void *ptr, size_t size, size_t nmemb, struct filelist *file){ //printf("glogger_write_mybuf\n"); return my_fwrite(ptr, size, nmemb, file); } /* write values to target files (write error flag)*/ void glogger_write(struct timeval *time, struct target_files *targets){ struct dbg_map *dmap; uint32_t wtime_sec; uint32_t wtime_usec; uint32_t wvalue; #ifdef PRINTTIME struct timeval now; gettimeofday(&now, NULL); printtime(&now, "WRITE"); #endif //printf("write: time: %lu %lu\n", time->tv_sec, time->tv_usec); wtime_sec = htonl(time->tv_sec); wtime_usec = htonl(time->tv_usec); while(targets){ printf("*** write: %s\n", targets->file->nowpath); dmap = targets->file->dbgmap_pointer; write_func((void*)&wtime_sec, 4, 1, targets->file); write_func((void*)&wtime_usec, 4, 1, targets->file); while(dmap && dmap->im){ if(dmap->flag & FLAG_VALID){ #ifdef PRINTVALUE if(! (dmap->flag & FLAG_OK)){ printf("timeout! "); } printf(" -> %s %s %lu\n", dmap->im->myoid->mynode->nodenick, dmap->im->myoid->oidnick, dmap->mibval); #endif /* success: send, receive, write */ } write_func((void*)&dmap->flag, 1, 1, targets->file); wvalue = htonl(dmap->mibval); write_func((void*)&wvalue, 4, 1, targets->file); /* reset for next */ dmap->flag = 0; dmap->mibval = 0; dmap = dmap->next; } while(dmap && !dmap->im){ /* skip separater */ dmap = dmap->next; } if(dmap == NULL){ targets->file->dbgmap_pointer = targets->file->dbgmap; } else { targets->file->dbgmap_pointer = dmap; } targets = targets->next; } } gfarm-2.4.1/snmptool/glogger3/glogger.c0000644000000000000000000001310511507222726016472 0ustar rootroot#include "glogger.h" #include /* local */ struct timeval timeout; int restart = 0; int interrupt = 0; /* global */ struct options opt; int bufmode; size_t (*write_func)(const void *ptr, size_t size, size_t nmemb, struct filelist *file); static void restart_handler(int sig){ restart = 1; printf("*** Hangup!\n"); } static void interrupt_handler(int sig){ interrupt = 1; printf("*** Interrupt!\n"); } static void test_handler(int sig){ printf("*** signal!!!: %d\n", sig); } #if 0 size_t debug_write(const void *ptr, size_t size, size_t nmemb, struct filelist *file){ int n = size*nmemb; char i = 0; while(ibuf_point, &i, 1); file->buf_point++; } else { fwrite(&i, 1, 1, file->fp); } i++; } file->buf_count += n; return n; } #endif int main(int argc, char **argv){ struct req_loop *reqloop, *reqloop_top; struct nodelist *topnodes; struct timeval maininterval, time, changetime; struct filelist *topfiles; #ifdef PRINTTIME struct timeval now; #endif int retv; int pid; #define USEsigaction #ifdef USEsigaction int i; struct sigaction int_sa, int_old, hup_sa, hup_old; #endif #ifdef PRINTTIME rdtscll(rdtsc_start); #endif /* read and set options */ glogger_read_args(argc, argv); #if 1 if(bufmode == BUFMODE_NONE){ /* every fwrite() */ write_func = glogger_fwrite; } else if(bufmode == BUFMODE_MMAP){ /* mmap() */ write_func = glogger_mmap; } else if(bufmode == BUFMODE_DBG || bufmode == BUFMODE_BURST){ /* burstmode or normal buffering(every dbg) */ write_func = glogger_write_mybuf; } else { printf("Error: bufmode\n"); exit(1); } #endif //write_func = debug_write; /* read_glogger_conf */ glogger_init_read_conf(); glogger_read_conf(opt.conffile); topnodes = glogger_get_top(); //printf("global_fsyncmode = %d\n", global_fsyncmode); if(bufmode == BUFMODE_BURST){ /* over write file name for burst mode */ /* target file is only one */ glogger_set_path_to_nodes(topnodes, opt.burst_path); } else if(bufmode == BUFMODE_MMAP){ /* priority: option > config > default */ if(opt.mmap_maxsize != DEFAULTMMAPOUTPUT || global_outputsizemax == DEFAULTOUTPUT){ global_outputsizemax = opt.mmap_maxsize; } glogger_set_path_to_nodes(topnodes, opt.mmap_path); } /* check configuration file -> exit */ if(opt.checkconf == 1){ glogger_print_conf(topnodes); return 1; /* exit */ } /* -daemon */ if(opt.pidfile != NULL){ daemon_mode(); } topfiles = glogger_set_filelist(topnodes); glogger_open_files(topfiles); glogger_write_metadata_all(topfiles); fsync_count = 0; fsync_timing = 0; glogger_fflush_files(topfiles); //glogger_close_files(topfiles); //glogger_free_filelist(topfiles); reqloop = glogger_prepare_requests_from_files(topfiles, &maininterval); reqloop_top = reqloop; /* prepare fsync timing */ fsync_count = 0; fsync_timing = 0; if(global_fsyncmode == -1){ } else if(maininterval.tv_sec > 0){ fsync_timing = global_fsyncmode / maininterval.tv_sec; } else { fsync_timing = global_fsyncmode * (1000000L / maininterval.tv_usec); } printf("global_fsyncmode = %d, fsync_timing = %d\n", global_fsyncmode, fsync_timing); #ifdef USEsigaction #if 0 hup_sa.sa_handler = test_handler; hup_sa.sa_flags = 0; for(i=0; i<=31; i++){ sigaction(i, &hup_sa, NULL); } #endif hup_sa.sa_handler = restart_handler; int_sa.sa_handler = interrupt_handler; hup_sa.sa_flags = int_sa.sa_flags = 0; //hup_sa.sa_flags = int_sa.sa_flags = SA_ONESHOT; sigaction(SIGHUP, &hup_sa, &hup_old); sigaction(SIGINT, &int_sa, &int_old); #else signal(SIGHUP, restart_handler); signal(SIGINT, interrupt_handler); #endif /* snmpasync.c */ glogger_init_targets(topnodes); gettimeofday(&timeout, NULL); #if 1 while(restart != 1 && interrupt != 1){ /* save current time for output data */ time = timeout; #ifdef PRINTTIME rdtscll(rdtsc_start); printtime(&time, "START"); #endif /* set a target time of next timeout */ glogger_update_timeout(&timeout, &maininterval); /* request & recieve & saving in timeout */ retv = glogger_snmpget(reqloop->reqlist, &timeout); if(retv == 1){ /* ok */ /* write values to target files */ glogger_write(&time, reqloop->targets); glogger_fflush_files(topfiles); #ifdef PRINTTIME gettimeofday(&now, NULL); printtime(&now, "END"); #endif /* sleep */ glogger_sleep(&timeout); } else if(retv == 2){ /* no request */ //glogger_fflush_files(topfiles); glogger_sleep(&timeout); } else if(retv == -1){ /* interrupt */ glogger_write(&time, reqloop->targets); } else { /* timeout */ glogger_write(&time, reqloop->targets); glogger_fflush_files(topfiles); } reqloop = reqloop->next; if(bufmode == BUFMODE_NONE && reqloop == reqloop_top){ /* check files and chnge file names*/ glogger_check_and_change_file(topfiles, &changetime); } } /* end of while() */ #endif /* restart or exit */ /* padding */ while(reqloop != reqloop_top){ glogger_write(&time, reqloop->targets); reqloop = reqloop->next; } /* write end block */ // glogger_write_endblock(topfiles); glogger_fflush_files(topfiles); if(restart == 1){ pid = fork(); if(pid < 0){ exit(3); } if(pid > 0){ } else { execv(argv[0], argv); perror("execv"); exit(5); } } printf("*** exit\n"); return 0; } gfarm-2.4.1/snmptool/glogger3/set_options.c0000644000000000000000000000726311507222726017422 0ustar rootroot#include "glogger.h" #include #include #include #define OPT_CONFIG "-config" #define OPT_BUFMODE "-bufmode" #define OPT_BURSTMODE "-burst" #define OPT_MMAPMODE "-mmap" #define OPT_MAXSIZE "-maxsize" #define OPT_CHECKCONF "-checkconf" #define OPT_DAEMON "-daemon" //static char *defaultconf = "./test.conf"; static char *defaultconf = "/etc/glogger/glogger.conf"; static char *default_burstout = "./burstout.glg"; static char *default_mmapout = "./mmap.glg"; void daemon_mode(){ FILE *fp; pid_t pid; int fd; daemon(1, 0); fp = fopen(opt.pidfile, "w"); if(fp == NULL){ remove(opt.pidfile); exit(1); } fprintf(fp, "%d", getpid()); fclose(fp); } int glogger_read_args(int argc, char **argv){ /* default */ global_outputsizemax = DEFAULTOUTPUT; bufmode = BUFMODE_NONE; opt.conffile = defaultconf; opt.pidfile = NULL; opt.checkconf = 0; opt.burst_path = default_burstout; opt.mmap_path = default_mmapout; opt.mmap_maxsize = DEFAULTMMAPOUTPUT; opt.pidfile = NULL; argv++; /* skip argv[0] */ while(*argv){ /* input config file */ if(strncmp(*argv, OPT_CONFIG, strlen(OPT_CONFIG)) == 0){ argv++; if(*argv == NULL){ printf("Error: %s [config file | - (stdin)]\n", OPT_CONFIG); exit(3); } if(opt.pidfile != NULL && (strncmp(*argv, "-", strlen(*argv)) == 0) ){ printf("Error: cannot use \"-\" when using \"%s\"\n", OPT_DAEMON); } if((*argv)[0] == '-' && (*argv)[1] != '\0'){ printf("Error: %s %s\n", OPT_CONFIG, *argv); exit(3); } opt.conffile = *argv; } /* for perfomance test */ else if(strncmp(*argv, OPT_BUFMODE, strlen(OPT_BUFMODE)) == 0){ argv++; if(*argv == NULL || *argv[0] == '-'){ printf("Error: %s [0:normal, 1:every dbg, 2:burst, 3:mmap]\n", OPT_BUFMODE); exit(3); } bufmode = atoi(*argv); } /* burst mode / plan: using mloc()... !!!!!! */ else if(strncmp(*argv, OPT_BURSTMODE, strlen(OPT_BURSTMODE)) == 0){ argv++; if(*argv == NULL || *argv[0] == '-'){ printf("Error: %s [output file]\n", OPT_BURSTMODE); exit(3); } bufmode = BUFMODE_BURST; opt.burst_path = *argv; } /* mmap() mode (target file is only one) */ else if(strncmp(*argv, OPT_MMAPMODE, strlen(OPT_MMAPMODE)) == 0){ argv++; if(*argv == NULL || *argv[0] == '-'){ printf("Error: %s [output file]\n", OPT_MMAPMODE); exit(3); } bufmode = BUFMODE_MMAP; opt.mmap_path = *argv; } /* max output size */ else if(strncmp(*argv, OPT_MAXSIZE, strlen(OPT_MAXSIZE)) == 0){ argv++; if(*argv == NULL || *argv[0] == '-'){ printf("Error: %s [max file size(KB)]\n", OPT_MAXSIZE); exit(3); } global_outputsizemax = opt.mmap_maxsize = atoi(*argv); } /* check cofiguration file */ else if(strncmp(*argv, OPT_CHECKCONF, strlen(OPT_CHECKCONF)) == 0){ opt.checkconf = 1; } #if 0 /* snmpasyncget */ else if(strncmp(*argv, "-asyncget", strlen(*argv)) == 0){ } #endif /* daemon mode */ else if(strncmp(*argv, OPT_DAEMON, strlen(OPT_DAEMON)) == 0){ argv++; if(*argv == NULL){ printf("Error: %s [PID file]\n", OPT_DAEMON); exit(3); } if(strncmp(opt.conffile, "-", strlen(opt.conffile)) == 0){ printf("Error: cannot use \"%s\" when using \"%s -\"\n", OPT_DAEMON, OPT_CONFIG); exit(3); } opt.pidfile = *argv; } else { printf("unknown option: %s\n", *argv); printf("options: %s %s %s %s %s\n", OPT_CONFIG, //OPT_BUFMODE, //OPT_BURSTMODE, OPT_MMAPMODE, OPT_MAXSIZE, OPT_CHECKCONF, OPT_DAEMON ); exit(3); } argv++; } return 1; } gfarm-2.4.1/snmptool/glogger3/expand_node_name.c0000644000000000000000000001564011507222726020336 0ustar rootroot#include #include #include //#include #include "expand_node_name.h" //#define DEBUG_RANGE #if 0 int check_fig(int i, int base){ char f[MAXFIGURE+2]; int fig; if(base == 16){ snprintf(f, MAXFIGURE+2, "%x", i); } else { snprintf(f, MAXFIGURE+2, "%d", i); } f[MAXFIGURE+1] = '\0'; fig = strlen(f); #ifdef DEBUG_RANGE printf("figure = %d (%s)\n", fig, f); #endif if(fig > MAXFIGURE){ return 0; } return fig; } #endif /* [?-?] */ char * expand_range(char *expression, struct range *r){ char *p; char *e = expression; int i; //int checkfig; r->min = 0; r->max = 0; r->figure = 0; r->base = 10; if(*e == '['){ e++; } if(*e == '0' && (*(e+1) == 'x' || *(e+1) == 'X')){ r->base = 16; } /* min */ r->min = strtoul(e, &p, r->base); #ifdef DEBUG_RANGE printf("min = %d, p = %s\n", r->min, p); #endif if(*p != '-'){ r->figure = 0; printf("Error: not use '-' after min\n"); return NULL; } /* set figure from min figure */ i = 0; while(*e){ if(*e == '-'){ e++; break; } i++; e++; } if(r->base == 16){ i -= 2; } r->figure = i; if(*e == '0' && (*(e+1) == 'x' || *(e+1) == 'X')){ if(r->base != 16){ r->figure = 0; printf("Error: min: decimal, max: hexa\n"); return NULL; } } else { if(r->base == 16){ r->figure = 0; printf("Error: min: hexa, max: decimal\n"); return NULL; } } //checkfig = check_fig(r->min, r->base); /* max */ r->max = strtoul(e, &p, r->base); #ifdef DEBUG_RANGE printf("max = %d, p = %s\n", r->max, p); #endif /* check */ if(*p != ']'){ r->figure = 0; printf("Error: not closed ']'\n"); return NULL; } if(r->min < 0 || r->max < 0){ r->figure = 0; printf("Error: can't use minus sign\n"); return NULL; } if(r->min >= r->max){ r->figure = 0; printf("Error: min > max\n"); return NULL; } #if 0 r->figure = check_fig(r->max, r->base); if(r->figure == 0){ printf("Error: over MAXFIGURE(=%d)\n", MAXFIGURE); } #endif return p; #if 0 if(checkfig != r->figure){ r->figure = 0; return; } #endif } char * replace_nick_val(char *nickdef, char **rep, int deep){ char *c, *p; char *ret; if(nickdef == NULL){ return NULL; } if(strlen(nickdef) <= 0){ return NULL; } if(deep > MAXREPLACE){ printf("Error: can't replace nick name"); exit(2); } ret = (char*) calloc(MAXNICKNAME, sizeof(char)); if(ret == NULL){ printf("Error: calloc()\n"); exit(2); } c = nickdef; p = ret; while(*c){ if(*c == '$'){ c++; if(*c - 48 > deep){ printf("Error: cannot replace nickname\n"); exit(2); } if(*c > 48 && *c < 48 + MAXREPLACE){ //printf("c = %d\n", *c - 48); strcat(p, rep[*c-49]); p = p + strlen(rep[*c-49]); } else { printf("Error: node nickname: $1...$%d\n", MAXREPLACE); exit(2); } } else { *p = *c; p++; } c++; } return ret; } EXNODES * add_list(EXNODES *to, EXNODES *from){ EXNODES *top; if(to == NULL){ return from; } #if 0 else { top = to; while(to->next != NULL){ to = to->next; } to->next = from; return top; } #else else { top = from; while(from->next != NULL){ from = from->next; } from->next = to; return top; } #endif } void print_list(EXNODES *list){ while(list){ printf("name=%s, nick=%s.\n", list->name, list->nick); list = list->next; } } void exfree(char *c){ if(c != NULL){ free(c); } } void free_list(EXNODES *list){ char *tmp; while(list){ exfree(list->name); exfree(list->nick); tmp = (char*) list; list = list->next; exfree(tmp); } } #define MAXFORM 32 EXNODES * expand_node_name(char *nodedef, char *nickdef, char **rep, int deep){ char *c, *p; char *tmpname, *tmp; char newname[MAXNODENAME]; struct range r; int i; char format[MAXFORM]; EXNODES *newlist, *list; if(deep > MAXREPLACE){ printf("Error: over MAXREPLACE(%d)\n", MAXREPLACE); exit(2); } if(strlen(nodedef) == 0){ printf("Error: node definition length = 0\n"); exit(2); } tmpname = (char*) calloc(strlen(nodedef)+1, sizeof(char)); if(tmpname == NULL){ printf("Error: calloc()\n"); exit(2); } list = NULL; c = nodedef; tmp = tmpname; while(*c){ /* ex. [00-99] */ if(*c == '['){ p = expand_range(c, &r); if(p == NULL){ //return NULL; exit(2); } p++; for(i=r.min; i<=r.max; i++){ if(r.base == 16){ snprintf(format, MAXFORM, "%%.%dx", r.figure); } else { snprintf(format, MAXFORM, "%%.%dd", r.figure); } snprintf(rep[deep], MAXFIGURE+1, format, i); //printf("*** %s%s%s\n", tmpname, rep[deep], p); snprintf(newname, MAXNODENAME, "%s%s%s", tmpname, rep[deep], p); /* recursive call */ newlist = expand_node_name(newname, nickdef, rep, deep+1); list = add_list(list, newlist); } free(tmpname); return list; } else { *tmp = *c; tmp++; } c++; } /* no more [?-?] */ { EXNODES * ret; char *newnick; ret = (EXNODES*) calloc(1, sizeof(EXNODES)); if(ret == NULL){ printf("Error: calloc()\n"); exit(2); } ret->name = tmpname; newnick = replace_nick_val(nickdef, rep, deep); if(newnick == NULL){ ret->nick = ret->name; } else { ret->nick = newnick; } ret->next = NULL; //printf("name=%s, nick=%s.\n", ret->name, ret->nick); return ret; } } #ifdef testmain /* main for test */ int main(int argc, char **argv){ //char *nodedef = "gfm[01-80]-[0x00-0xFF].apgrid.org"; char *nodedef = "172.19.2.[1-255]"; //char *nickdef = "gfm$2-$1"; char *nickdef = NULL; int i; #if 0 { struct range r; char format[32]; /* test: expand_range() */ expand_range(argv[1], &r); if(r.figure == 0){ printf("Syntax Error\n"); } else if(r.base == 16){ snprintf(format, 32, "min=%%.%dx, max=%%.%dx\n", r.figure, r.figure); printf(format, r.min, r.max); } else { snprintf(format, 32, "min=%%.%dd, max=%%.%dd\n", r.figure, r.figure); printf(format, r.min, r.max); } for(i=r.min; i<=r.max; i++){ if(r.base == 16){ snprintf(format, 32, "%%.%dx ", r.figure); } else { snprintf(format, 32, "%%.%dd ", r.figure); } printf(format, i); } printf("\n"); } #endif #if 1 { /* test: expand_nodes_name() */ char *rep[MAXREPLACE]; EXNODES *top; if(argc >= 2){ nodedef = argv[1]; } if(argc >= 3){ nickdef = argv[2]; } for(i=0; i glogdump

glogdump

Name

glogdump -- GLogger ¤¬½ÐÎϤ·¤¿¥Õ¥¡¥¤¥ë¤ò²ÄÆÉ¤Ë¤¹¤ë

Synopsis

glogdump [¥Õ¥¡¥¤¥ë]

DESCRIPTION

GLogger ¤¬½ÐÎϤ·¤¿¥Õ¥¡¥¤¥ë¤òÆÉ¤á¤ë¤è¤¦¤Ë¤·¤ÆÉ¸½à½ÐÎϤؽÐÎϤ·¤Þ¤¹¡£

OPTIONS

¤Ê¤·

SEE ALSO

glogger(8), glogger_logdata(5)

gfarm-2.4.1/snmptool/glogger3/docbook/ja/docdir.mk0000644000000000000000000000001511507222726020503 0ustar rootrootdocdir = ja/ gfarm-2.4.1/snmptool/glogger3/docbook/ja/glogger.conf.5.docbook0000644000000000000000000002151311507222726022773 0ustar rootroot 18 Sep 2003 glogger.conf 5 Gfarm glogger.conf GLogger ÀßÄê¥Õ¥¡¥¤¥ë DESCRIPTION glogger.conf ¥Õ¥¡¥¤¥ë¤Ï¡¢glogger ¥×¥í¥°¥é¥à¤ÎÀßÄê¥Õ¥¡¥¤¥ë¤Ç¤¹¡£ ¤Ê¤ª¡¢ÀßÄêÆâÍÆ¤òÊѹ¹¤·¤¿¾ì¹ç¤Ï¡¢glogger ¤òºÆµ¯Æ°¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£ glogger ¤Ï¡¢ÀßÄê¥Õ¥¡¥¤¥ë¤È¤·¤Æ¡¢/etc/glogger/glogger.conf ¤òÆÉ¤ß¹þ¤ß¤Þ¤¹¡£ -config ¥ª¥×¥·¥ç¥ó¤ÇÀßÄê¥Õ¥¡¥¤¥ë¤ò»ØÄꤹ¤ë¤È¡¢¤½¤ì¤¬Í¥À褵¤ì¤Þ¤¹¡£ glogger ¤ÎÀßÄê¥Õ¥¡¥¤¥ë¤Ï¡¢°Ê²¼¤Î¹½Â¤¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£ * ÀßÄê¥Õ¥¡¥¤¥ë¤Ïñ°ì¥Õ¥¡¥¤¥ë¤È¤¹¤ë¡£ * ³ÆÀßÄê¹àÌܤϡ¢ÀßÄê̾¤È¤½¤ÎÃͤòȾ³Ñ¥¹¥Ú¡¼¥¹°ì¤Ä°Ê¾å¤Ç¶èÀڤꡢ¤½¤ì¤¾¤ì³Æ¹Ô¤Ëµ­½Ò¤¹¤ë¡£ * ¶èÀÚ¤ê°Ê³°¤ÎȾ³Ñ¥¹¥Ú¡¼¥¹¡¢¥¿¥Ö¤Ï̵»ë¤¹¤ë¡£ * ³Æ¹Ô¤Î '#' °Ê¹ß¤Ï¥³¥á¥ó¥È¤È¤¹¤ë¡£ * ³Æ¹Ô¤Ï 1024 ʸ»ú¤Þ¤Ç¤È¤¹¤ë¡£ * ¥Ö¥í¥Ã¥¯¤Ï '¥Ö¥í¥Ã¥¯Ì¾ {' ¹Ô¤Ç¤Ï¤¸¤Þ¤ê¡¢'}' ¹Ô¤Ç½ªÎ»¤¹¤ë¡£ * ¥Ö¥í¥Ã¥¯Æâ¤Ë¤Ï¡¢¤½¤Î¥Ö¥í¥Ã¥¯¤Ëµ­½Ò¤¬µö²Ä¤µ¤ì¤Æ¤¤¤ë¡¢ÀßÄê¹àÌܤȥ֥í¥Ã¥¯¤òµ­½Ò¤Ç¤­¤ë¡£ * ¥Õ¥¡¥¤¥ë¤ÎÀèÆ¬¤«¤é¥Ö¥í¥Ã¥¯¤Ë¤Ê¤Ã¤Æ¤¤¤Ê¤¤Éôʬ¤ò global default ¥Ö¥í¥Ã¥¯¤È¸Æ¤Ö¡£ * global default ¥Ö¥í¥Ã¥¯°Ê¹ß¤Ë¡¢requests ¥Ö¥í¥Ã¥¯¤òÊ£¿ôµ­½Ò¤Ç¤­¤ë¡£ * nodes ¥Ö¥í¥Ã¥¯¤Ï requests ¥Ö¥í¥Ã¥¯Æâ¤Ë°ì¤Äµ­½Ò¤Ç¤­¤ë¡£ * mib ¥Ö¥í¥Ã¥¯¤Ï nodes ¥Ö¥í¥Ã¥¯¤Î¸å¤Ëµ­½Ò¤·¡¢requests ¥Ö¥í¥Ã¥¯Æâ¤ËÊ£¿ôµ­½Ò¤Ç¤­¤ë¡£ * oids ¥Ö¥í¥Ã¥¯¤Ï mib ¥Ö¥í¥Ã¥¯Æâ¤Ë°ì¤Äµ­½Ò¤Ç¤­¤ë¡£ * ¥Ö¥í¥Ã¥¯Æâ¤Ë¥Ö¥í¥Ã¥¯¤¬¤¢¤ë¾ì¹ç¤Ï¡¢ ¥Ö¥í¥Ã¥¯¤òÄêµÁ¤¹¤ëÁ°¤Ë¹Ô¤Ã¤¿ÀßÄê¹àÌܤò¡¢ °Ê¹ß¥Í¥¹¥È¤·¤¿¥Ö¥í¥Ã¥¯Æâ¤ÎÀßÄê¹àÌܤȤ·¤Æ°ú¤­·Ñ¤®¡¢ ¤½¤Î¥Ö¥í¥Ã¥¯Æâ¤ËƱ¤¸ ÀßÄê̾¤¬¤¢¤ë¾ì¹ç¤Ï¡¢ ¤½¤Î¥Ö¥í¥Ã¥¯Æâ¤Ç¤Ï¡¢¤½¤ÎÀßÄê¹àÌܤ¬Í¥À褵¤ì¤ë¡£ * ̤ÄêµÁ¤ÎÀßÄê̾¡¢ÀßÄêÃÍ¡¢µ­½Òɽ¸½¤Çµ­½Ò¤·¤¿¾ì¹ç¡¢¥¨¥é¡¼¤È¤Ê¤ë¡£ * 1Å٤⵭½Ò¤µ¤ì¤Ê¤«¤Ã¤¿ÀßÄê¹àÌܤˤϡ¢¥Ç¥Õ¥©¥ë¥ÈÃͤ¬Å¬ÍѤµ¤ì¤ë¡£ ¤·¤«¤·¡¢¥Ç¥Õ¥©¥ë¥ÈÃͤ¬Â¸ºß¤·¤Ê¤¤ÀßÄê¹àÌܤ⤢¤ë¡£ glogger ¤ÎÀßÄê¥Õ¥¡¥¤¥ë¤Ï¡¢°Ê²¼¤Î¤è¤¦¤Ê¹½Â¤¤Çµ­½Ò¤·¤Þ¤¹¡£ interval [interval-spec] maxfilesize [maxfilesize-spec] defaultdir [defaultdir-spec] overwrite [overwrite-spec] fsync_interval [fsync_interval-spec] label [label-spec] path [path-spec] community [community-spec] requests { interval [interval-spec] path [path-spec] community [community-spec] nodes { [node-spec] .... } mib { interval [interval-spec] path [path-spec] oids { [oid-spec] .... } } mib... } requests... ....¤Ï¡¢¤½¤Î¾å¤Ëµ­½Ò¤·¤¿ [?-spec] ¤¬¤¤¤¯¤Ä³¤¤¤Æ¤âÎɤ¤¤Ç¤¹¡£ mib... ¤ä requests... ¤Ï¡¢¤½¤ì¤¾¤ì¤Î¥Ö¥í¥Ã¥¯¤¬¤¤¤¯¤Ä³¤¤¤Æ¤âÎɤ¤¤Ç¤¹¡£ [?-spec] ¤Ë¤Ï¡¢¤½¤ì¤¾¤ì°Ê²¼¤Î¿ô»ú¤äʸ»úÎó¤ò»ØÄê¤Ç¤­¤Þ¤¹¡£ [interval-spec] ¤Ë¤Ï¾®¿ôÃͤò»ØÄꤷ¤Þ¤¹¡£ÂоݤάÄê´Ö³Ö¤È¤Ê¤ê¤Þ¤¹¡£ ¤¿¤À¤·¡¢¸½¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï 0.1 ÉÃ̤Ëþ¤ÏÀڼΤƤé¤ì¤Þ¤¹¡£ (ex. interval 0.1, ¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ï 10.0) [maxfilesize-spec] ¤Ë¤Ï½ÐÎÏ¥Õ¥¡¥¤¥ë¤ÎºÇÂ祵¥¤¥º¤ò KBñ°Ì ¤ÎÀ°¿ôÃͤǻØÄꤷ¤Þ¤¹¡£»ØÄꤷ¤¿¥µ¥¤¥º¤òͤ¨¤Æ¤«¤é¡¢ÆâÉôưºî¥¿¥¤¥ß¥ó¥°¤Î¥­ ¥ê¤ÎÎɤ¤¤È¤³¤í¤Ç¥Õ¥¡¥¤¥ë¤òÀÚ¤êÂØ¤¨¤Þ¤¹¡£¤³¤Î¾ì¹ç¡¢path ÀßÄê¤Ç¤Î¥Õ¥¡¥¤¥ë ̾À¸À®¥ë¡¼¥ë¤Ç¥Õ¥¡¥¤¥ë¤ÏÀÚ¤êÂØ¤ï¤ê¤Þ¤»¤ó¡£-mmap ¥â¡¼¥Éưºî»þ¤Ï¡¢¤³¤³¤Ç»Ø Äꤷ¤¿¥Õ¥¡¥¤¥ë¥µ¥¤¥º¤òͤ¨¤¿¤È¤³¤í¤Ç½ªÎ»¤·¤Þ¤¹¡£0(¥Ç¥Õ¥©¥ë¥ÈÃÍ) ¤ò»ØÄꤷ¡¢ ¤µ¤é¤Ë¥Õ¥¡¥¤¥ë̾À¸À®¥ë¡¼¥ë¤Ç¤â»þ¹ï¤òÆþ¤ì¤Ê¤¤¾ì¹ç¤Ï¡¢Ää»ß¤µ¤ì¤ë¤Þ¤Ç ¥Õ¥¡¥¤¥ë¤Ø½ÐÎϤ·¤Ä¤Å¤±¤Þ¤¹¡£ (ex. Ìó 1MB¤Î¾ì¹ç ¢ª maxfilesize 1024, ¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ï 0) [defaultdir-spec] ¤Ë¤Ï´ð½à¤È¤Ê¤ë½ÐÎÏÀè¥Ç¥£¥ì¥¯¥È¥ê¤Î ÀäÂХѥ¹¤ò»ØÄꤷ¤Þ¤¹¡£ path ¹à¤Ç %G ¤òµ­½Ò¤·¤¿¤È¤­¤ËÃÖ´¹¤µ¤ì¤ëÃͤȤʤê¤Þ¤¹¡£ global default Éôʬ¤Î¤ß¤Ç»ØÄê¤Ç¤­¤Þ¤¹¡£ (ex. defaultdir /home/glogger, ¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ï /var/log/glogger) [label-spec] ¤Ë¤ÏǤ°Õ¤Îʸ»úÎó¤ò»ØÄꤷ¤Þ¤¹¡£ ·×¬¥Æ¥¹¥È̾¤ä¡¢¥¯¥é¥¹¥¿Ì¾¤Ê¤É¤òÉÕ¤±¤Æ»È¤¦¤³¤È¤òÁÛÄꤷ¤Æ¤¤¤Þ¤¹¡£ path ¹à¤Ç %L ¤òµ­½Ò¤·¤¿¾ì¹ç¤ËÃÖ´¹¤µ¤ì¤ëʸ»úÎó¤È¤Ê¤ê¤Þ¤¹¡£ (ex. label test01, ¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ï glogger) [overwrite-spec] ¤Ë¤Ï½ÐÎÏ¥Õ¥¡¥¤¥ë¤Î¾å½ñ¤­µö²Äʸ»úÎó on ¤Þ¤¿¤Ï enable ¤ò»ØÄꤷ¤Þ¤¹¡£ on ¤Þ¤¿¤Ï enable ¤òµ­½Ò¤¹¤ë¤È¡¢GLogger ¤Îµ¯Æ°»þ¡¢¤Þ¤¿¤Ï¡¢¥Õ¥¡¥¤¥ëÀÚ¤êÂØ¤¨»þ¤Ë¡¢ ¤¹¤Ç¤ËƱ¤¸Ì¾Á°¤Î¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Æ¤¤¤ë¾ì¹ç¤Ë¾å½ñ¤­¤·¤Þ¤¹ (°ÊÁ°¤Î¥Ç¡¼¥¿¤Ïºï½ü¤µ¤ì¤Þ¤¹)¡£ (ex. overwrite enable, ¥Ç¥Õ¥©¥ë¥È¤Ï¾å½ñ¤­¤·¤Ê¤¤) [fsync_interval-spec] ¤Ë¤Ï fsync() ¤¹¤ë´Ö³Ö¤ÎÉÿô¡¢¤Þ¤¿¤Ï on ¤Þ¤¿¤Ï enable ¤ò »ØÄꤷ¤Þ¤¹¡£ GLogger ¤Ï½ÐÎÏ»þ¤ËËè²ó fflush() ¤·¤Þ¤¹¤¬¡¢»ØÄꤷ¤¿´Ö³Ö(ÉÃ)¤òͤ¨¤¿¥¿¥¤¥ß¥ó¥°¤Ç fsync() ¤â¤¹¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡£ on ¤Þ¤¿¤Ï enable ¤ò»ØÄꤷ¤¿¾ì¹ç¤Ï¡¢ÆâÉôưºî¥¤¥ó¥¿¡¼¥Ð¥ë(ÀßÄê¥Õ¥¡¥¤¥ë¤Îµ­½Ò¤Ë¤è¤Ã¤Æ°Û¤Ê¤ë) ¤´¤È¤Ë¡¢Ëè²ó fsync() ¤·¤Þ¤¹¡£ ¤Þ¤¿¡¢ÆâÉôưºî¥¤¥ó¥¿¡¼¥Ð¥ë¤¬¡¢¤³¤³¤Ç»ØÄꤷ¤¿Éÿô¤è¤ê¤âÂ礭¤¤´Ö³Ö¤Î¾ì¹ç¡¢Ëè²ó fsync() ¤·¤Þ¤¹¡£ ¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï°ìÀÚ fsync() ¤·¤Þ¤»¤ó¡£ (ex. fsync_interval 5, ¥Ç¥Õ¥©¥ë¥È¤Ï fsync() ¤·¤Ê¤¤) [path-spec] ¤Ë¤Ï½ÐÎÏ¥Õ¥¡¥¤¥ë¤ÎÀäÂХѥ¹¥Õ¥¡¥¤¥ë̾¤ò»ØÄꤹ¤ëʸ»úÎó¤ò»ØÄê ¤·¤Þ¤¹¡£°Ê²¼¤ÎÃÖ´¹¥ë¡¼¥ë¤¬Å¬ÍѤǤ­¤Þ¤¹¡£¤Þ¤¿¡¢ÆâÉôưºî¤Î¥­¥ê¤ÎÎɤ¤¥¿¥¤ ¥ß¥ó¥°¤Ç¡¢¤³¤Î¥ë¡¼¥ë¤È¸½ºß¤Î»þ¹ï¤«¤é¥Õ¥¡¥¤¥ë̾¤òÀ¸À®¤·¡¢¤½¤ì¤Þ¤Ç½ÐÎϤ·¤Æ ¤¤¤¿¥Õ¥¡¥¤¥ë̾¤ÈÈæ³Ó¤·¤Þ¤¹¡£»þ¹ï¤òÃÖ´¹¤¹¤ë¥ë¡¼¥ë¤ò»ÈÍѤ·¤¿¾ì¹ç¡¢ »þ¹ï¤«¤éÀ¸À®¤µ¤ì¤¿¥Õ¥¡¥¤¥ë̾¤ËÊѹ¹¤¬¤¢¤Ã¤¿¾ì¹ç¤Ï¡¢¤½¤Î¿·¤·¤¤¥Õ¥¡¥¤¥ë¤Ë ÀÚ¤êÂØ¤¨¡¢¤½¤³¤Ø½ÐÎϤ·¤Þ¤¹¡£ÀßÄê¥Õ¥¡¥¤¥ë¤Î maxfilesize ¤ä¡¢ µ¯Æ°»þ¥ª¥×¥·¥ç¥ó°ú¿ô¤Ç¡¢¥Õ¥¡¥¤¥ë¥µ¥¤¥ºÀ©¸Â¤ò¹Ô¤Ã¤¿¾ì¹ç¤Ï¡¢»þ¹ï¤ò»È¤Ã¤¿ ¥Õ¥¡¥¤¥ë̾ÃÖ´¹¥ë¡¼¥ë¤ò»È¤ï¤º¡¢¥Õ¥¡¥¤¥ë¥µ¥¤¥ºÀ©¸Â¤Ç¥Õ¥¡¥¤¥ë¤òÀÚ¤êÂØ¤¨¤Þ¤¹¡£ ¤Þ¤¿¡¢¥Ç¥£¥ì¥¯¥È¥ê¤Ï¼«Æ°Åª¤ËºîÀ®¤·¤Þ¤»¤ó¡£ %G defaultdir ¤Î¥Ç¥£¥ì¥¯¥È¥êÀäÂХѥ¹ %L ¥é¥Ù¥ë(¥¯¥é¥¹¥¿Ì¾¡¢¼Â¸³Ì¾¤Ê¤É) %n nodes ¤Ç»ØÄꤵ¤ì¤¿ FQDN %N nodes ¤Ç»ØÄꤵ¤ì¤¿¥Ë¥Ã¥¯¥Í¡¼¥à %o mibs ¤Ç»ØÄꤵ¤ì¤¿ OID̾ %O mibs ¤Ç»ØÄꤵ¤ì¤¿ OID¥Ë¥Ã¥¯¥Í¡¼¥à »þ¹ï¤Ë´Ø¤¹¤ëÃÖ´¹¤Ë¤Ï¡¢GLogger ¤òµ¯Æ°¤·¤¿»þ¡¢¤Þ¤¿¤Ï¥Õ¥¡¥¤¥ë¤¬ÀÚ¤êÂØ¤ï¤ë»þ¤Î »þ¹ï¤ÎÃͤ¬ÍøÍѤµ¤ì¤Þ¤¹¡£ %t ǯ·îÆü»þʬÉåߥêÉà (ex. 20031231235959000) %c ¥Þ¥¤¥¯¥íÉà (000000..999999) %s ¥ß¥êÉà (000..999) %S Éà (00..59) %M ʬ (00..59) %h »þ (00..23) %d ·îÆâÄÌ»»Æü¿ô (01..31) %j ǯÆâÄÌ»»Æü¿ô (001..366) %m ·î (01..12) %y ǯ (1970...) (ex. path %G/%H/%O/%y%m%h.glg, ¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ï %G/%L_%y%m%d%h%M.glg) [community-spec] ¤Ë¤Ï¥³¥ß¥å¥Ë¥Æ¥£¥¹¥È¥ê¥ó¥°¤ò»ØÄꤷ¤Þ¤¹¡£ (ex. community private, ¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ï public) [node-spec] ¤Ë¤Ï¡Ö¥Û¥¹¥È̾ ¥Ë¥Ã¥¯¥Í¡¼¥à¡×¤ÎÁȤò³Æ¹Ô¤Ëµ­½Ò¤·¤Þ¤¹¡£ ¥Ë¥Ã¥¯¥Í¡¼¥à¤¬Ìµ¤±¤ì¤Ð¡¢%H ¤Ï %h ¤ÈƱÅù¤È¤Ê¤ê¤Þ¤¹¡£ nodes ¥Ö¥í¥Ã¥¯Æâ¤Ë¡¢Ê£¿ô¹Ôµ­½Ò¤Ç¤­¤Þ¤¹¡£ºÇÂç¿ô¤Ï̤ÄêµÁ¤Ç¤¹¡£ ¥Û¥¹¥È̾¤Ë¤Ï¡¢Ã±½ã¥Û¥¹¥È̾¡¢IP ¥¢¥É¥ì¥¹¡¢[?-?] ¤Ë¤è¤ëÏ¢ÈÖ¿ô»ú»ØÄ꤬ ÍøÍѤǤ­¤Þ¤¹¡£ Ï¢ÈÖ¿ô»ú»ØÄê [?-?] ¤Î ? ¤Ë¤Ï 0 °Ê¾å¤ÎÀ°¿ô(10¿Ê or 16¿Ê)(16¿Ê¤Î¾ì¹ç¤Ï 0x ¤Ç»Ï¤Þ¤ëʸ»úÎó)¤ò»ØÄꤷ¤Þ¤¹¡£º¸¤Ë»ÏÅÀ¡¢±¦¤Ë½ªÅÀ¤Î¿ô¤ò»ØÄꤷ¤Þ¤¹¡£»Ï ÅÀ¤è¤ê½ªÅÀ¤Î¤Û¤¦¤¬Â礭¤¤¿ô¤Ç¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£5·å¤Þ¤Ç»ØÄê¤Ç¤­¤Þ¤¹¡£ »ÏÅÀ¤Ç 0 ¤òÉղ䷤Ʒå¹ç¤ï¤»¤ò¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£½ªÅÀ¤ÎÃͤ˶áÉÕ¤¯¤Ë¤· ¤¿¤¬¤Ã¤Æ¡¢»ÏÅÀ¤Ç»ØÄꤷ¤¿·å¿ô¤è¤ê¤âÂ礭¤¯¤Ê¤ë¾ì¹ç¤Ï¡¢»ÏÅÀ¤Î·å¤òͤ¨¤ÆÅ¸ ³«¤·¤Þ¤¹¡£¤Þ¤¿¡¢½ªÅÀ¤ËÀèÆ¬¤«¤é¤¤¤¯¤Ä¤« 0 ¤òÉղ䷤Ƥ⡢»ÏÅÀ¤è¤ê¿¤¯»Ø Äꤷ¤¿¤ê¡¢¾¯¤Ê¤¯»ØÄꤷ¤Æ¤â¡¢»ÏÅÀ¤Ç¤¢¤ï¤»¤¿·å¤Ë¤Ê¤ê¤Þ¤¹¡£ Î㤨¤Ð¡¢ [1-9] ¤Ï 1 ¤«¤é 9 ¤Î 9¸Ä¤ËŸ³«¤µ¤ì¤Þ¤¹¡£ [0x1-0x10] ¤Ï 1 ¤«¤é f ¤È 10 ¤Î 16¸Ä¤ËŸ³«¤µ¤ì¤Þ¤¹¡£ [000-20] ¤Ï 000 ¤«¤é 020 ¤Î 21¸Ä¤ËŸ³«¤µ¤ì¤Þ¤¹¡£ ¥Ë¥Ã¥¯¥Í¡¼¥à¤Ë $1, $2... ¤È¤·¤Æ»ØÄꤹ¤ë¤È¡¢[?-?]Éô¤ò»ØÄꤷ¤¿½çÈÖ¤ËÃÖ´¹ ¤µ¤ì¤Þ¤¹¡£ Î㤨¤Ð¡¢abc[01-02]-[03-04].cdef.com abc$1-$2 ¤È»ØÄꤹ¤ë¤È¡¢¥Ë¥Ã¥¯¥Í¡¼¥à¤Ï abc01-03, abc01-04, abc02-03, abc02-04 ¤Î 4¸Ä¤ËŸ³«¤µ¤ì¤Þ¤¹¡£ Ÿ³«¤µ¤ì¤ë½çÈÖ¤Ï̤ÄêµÁ¤Ç¤¹¡£ Ãí°Õ Âбþ¤¹¤ë $1, $2...¤ò»ØÄꤷ¤Ê¤¯¤Æ¤â¥¨¥é¡¼¤È¤Ê¤ê¤Þ¤»¤ó¡£ ¤·¤«¤· [?-?]Éô¤Î¸Ä¿ô¤è¤ê¿¤¯ $Éô¤ò»ØÄꤹ¤ë¤È¥¨¥é¡¼¤È¤Ê¤ê¤Þ¤¹¡£ ex. gfm[01-80].apgrid.org gfm$1 gfmgw[01-10].apgrid.org gfmgw$1 localhost 172.19.2.[0-255] private$1 a[0x00-0xff]-[000-100].b.com abc$2-$1 ¥Ç¥Õ¥©¥ë¥ÈÃͤÏ̵¤·¡£ [oids-spec] ¤Ë¤Ï¡ÖOID̾ ¥Ë¥Ã¥¯¥Í¡¼¥à¡×¤ÎÁȤò³Æ¹Ô¤Ëµ­½Ò¤·¤Þ¤¹¡£ ¥Ë¥Ã¥¯¥Í¡¼¥à¤Ï¾Êά¤Ç¤­¤Þ¤»¤ó¡£ oids ¥Ö¥í¥Ã¥¯Æâ¤Ë¡¢Ê£¿ô¹Ôµ­½Ò¤Ç¤­¤Þ¤¹¡£ »ØÄê¤Ç¤­¤ë OID ¤Î¿ô¤Ï¡¢°ì¤Ä¤Î·×¬ÂоݥΡ¼¥É¤ËÂФ·¤Æ¡¢1Å٤ΠSNMP Í×µá ¤ËÆþ¤ë¸Ä¿ô¤Þ¤Ç»ØÄê¤Ç¤­¤Þ¤¹¡£ ex. # ºÇ¶á 1ʬ¤Î¥í¡¼¥É¥¢¥Ù¥ì¡¼¥¸ enterprises.ucdavis.laTable.laEntry.laLoad.1 loadavg # 2ÈÖÌܤΥͥåȥ¥¯¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î TX interfaces.ifTable.ifEntry.ifOutOctets.2 eth0-out # 2ÈÖÌܤΥͥåȥ¥¯¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î RX interfaces.ifTable.ifEntry.ifInOctets.2 eth0-in # 1ÈÖÌܤΥѡ¼¥Æ¥£¥·¥ç¥ó(snmpd.conf¤ÇÀßÄꤷ¤¿½ç)¤Î»ÈÍÑÎÌ enterprises.ucdavis.dskTable.dskEntry.dskUsed.1 used # 1ÈÖÌܤΥѡ¼¥Æ¥£¥·¥ç¥ó(snmpd.conf¤ÇÀßÄꤷ¤¿½ç)¤Î¶õ¤­ÍÆÎÌ enterprises.ucdavis.dskTable.dskEntry.dskAvail.1 available ¥Ç¥Õ¥©¥ë¥ÈÃͤÏ̵¤·¡£ SEE ALSO glogger8 gfarm-2.4.1/snmptool/glogger3/docbook/ja/Makefile.in0000644000000000000000000000200011507222726020747 0ustar rootrootSRC = glogger.8 glogdump.8 glogger.conf.5 glogger_logdata.5 RM = rm -f top_objdir = @top_objdir@ top_srcdir = @top_srcdir@ srcdir = @srcdir@ include ../../config.mk include ./docdir.mk all: html man html: for i in / $(SRC); do \ case $$i in /) continue;; esac; \ $(MAKE) srcsubst=$${i}.docbook \ htmlsubst=$${i}.html $${i}.html; \ done man: for i in / $(SRC); do \ case $$i in /) continue;; esac; \ $(MAKE) srcsubst=$${i}.docbook \ mansubst=$${i} $${i}; \ done $(htmlsubst): $(srcsubst) jw -b html -u $(srcsubst) $(mansubst): $(srcsubst) jw -b man $(srcsubst) install: @for i in / $(SRC); do \ case $$i in /) continue;; esac; \ suffix=`expr $$i : '.*\.\([^.]*\)$$'`; \ ( set -x; $(INSTALL_DATA) $${i} $(mandir)/$(docdir)man$$suffix/$$i ); \ done @for i in / $(SRC); do \ case $$i in /) continue;; esac; \ ( set -x; $(INSTALL_DATA) $${i}.html $(htmldir)/$(docdir)$${i}.html ); \ done clean: $(RM) *.refs *.links *~ veryclean: $(RM) *.refs *.links *~ *.html $(SRC) gfarm-2.4.1/snmptool/glogger3/docbook/ja/glogger.conf.5.html0000644000000000000000000002517711507222726022331 0ustar rootroot glogger.conf

glogger.conf

Name

glogger.conf -- GLogger ÀßÄê¥Õ¥¡¥¤¥ë

DESCRIPTION

glogger.conf ¥Õ¥¡¥¤¥ë¤Ï¡¢glogger ¥×¥í¥°¥é¥à¤ÎÀßÄê¥Õ¥¡¥¤¥ë¤Ç¤¹¡£ ¤Ê¤ª¡¢ÀßÄêÆâÍÆ¤òÊѹ¹¤·¤¿¾ì¹ç¤Ï¡¢glogger ¤òºÆµ¯Æ°¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£

glogger ¤Ï¡¢ÀßÄê¥Õ¥¡¥¤¥ë¤È¤·¤Æ¡¢/etc/glogger/glogger.conf ¤òÆÉ¤ß¹þ¤ß¤Þ¤¹¡£ -config ¥ª¥×¥·¥ç¥ó¤ÇÀßÄê¥Õ¥¡¥¤¥ë¤ò»ØÄꤹ¤ë¤È¡¢¤½¤ì¤¬Í¥À褵¤ì¤Þ¤¹¡£

glogger ¤ÎÀßÄê¥Õ¥¡¥¤¥ë¤Ï¡¢°Ê²¼¤Î¹½Â¤¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£

* ÀßÄê¥Õ¥¡¥¤¥ë¤Ïñ°ì¥Õ¥¡¥¤¥ë¤È¤¹¤ë¡£

* ³ÆÀßÄê¹àÌܤϡ¢ÀßÄê̾¤È¤½¤ÎÃͤòȾ³Ñ¥¹¥Ú¡¼¥¹°ì¤Ä°Ê¾å¤Ç¶èÀڤꡢ¤½¤ì¤¾¤ì³Æ¹Ô¤Ëµ­½Ò¤¹¤ë¡£

* ¶èÀÚ¤ê°Ê³°¤ÎȾ³Ñ¥¹¥Ú¡¼¥¹¡¢¥¿¥Ö¤Ï̵»ë¤¹¤ë¡£

* ³Æ¹Ô¤Î '#' °Ê¹ß¤Ï¥³¥á¥ó¥È¤È¤¹¤ë¡£

* ³Æ¹Ô¤Ï 1024 ʸ»ú¤Þ¤Ç¤È¤¹¤ë¡£

* ¥Ö¥í¥Ã¥¯¤Ï '¥Ö¥í¥Ã¥¯Ì¾ {' ¹Ô¤Ç¤Ï¤¸¤Þ¤ê¡¢'}' ¹Ô¤Ç½ªÎ»¤¹¤ë¡£

* ¥Ö¥í¥Ã¥¯Æâ¤Ë¤Ï¡¢¤½¤Î¥Ö¥í¥Ã¥¯¤Ëµ­½Ò¤¬µö²Ä¤µ¤ì¤Æ¤¤¤ë¡¢ÀßÄê¹àÌܤȥ֥í¥Ã¥¯¤òµ­½Ò¤Ç¤­¤ë¡£

* ¥Õ¥¡¥¤¥ë¤ÎÀèÆ¬¤«¤é¥Ö¥í¥Ã¥¯¤Ë¤Ê¤Ã¤Æ¤¤¤Ê¤¤Éôʬ¤ò global default ¥Ö¥í¥Ã¥¯¤È¸Æ¤Ö¡£

* global default ¥Ö¥í¥Ã¥¯°Ê¹ß¤Ë¡¢requests ¥Ö¥í¥Ã¥¯¤òÊ£¿ôµ­½Ò¤Ç¤­¤ë¡£

* nodes ¥Ö¥í¥Ã¥¯¤Ï requests ¥Ö¥í¥Ã¥¯Æâ¤Ë°ì¤Äµ­½Ò¤Ç¤­¤ë¡£

* mib ¥Ö¥í¥Ã¥¯¤Ï nodes ¥Ö¥í¥Ã¥¯¤Î¸å¤Ëµ­½Ò¤·¡¢requests ¥Ö¥í¥Ã¥¯Æâ¤ËÊ£¿ôµ­½Ò¤Ç¤­¤ë¡£

* oids ¥Ö¥í¥Ã¥¯¤Ï mib ¥Ö¥í¥Ã¥¯Æâ¤Ë°ì¤Äµ­½Ò¤Ç¤­¤ë¡£

* ¥Ö¥í¥Ã¥¯Æâ¤Ë¥Ö¥í¥Ã¥¯¤¬¤¢¤ë¾ì¹ç¤Ï¡¢ ¥Ö¥í¥Ã¥¯¤òÄêµÁ¤¹¤ëÁ°¤Ë¹Ô¤Ã¤¿ÀßÄê¹àÌܤò¡¢ °Ê¹ß¥Í¥¹¥È¤·¤¿¥Ö¥í¥Ã¥¯Æâ¤ÎÀßÄê¹àÌܤȤ·¤Æ°ú¤­·Ñ¤®¡¢ ¤½¤Î¥Ö¥í¥Ã¥¯Æâ¤ËƱ¤¸ ÀßÄê̾¤¬¤¢¤ë¾ì¹ç¤Ï¡¢ ¤½¤Î¥Ö¥í¥Ã¥¯Æâ¤Ç¤Ï¡¢¤½¤ÎÀßÄê¹àÌܤ¬Í¥À褵¤ì¤ë¡£

* ̤ÄêµÁ¤ÎÀßÄê̾¡¢ÀßÄêÃÍ¡¢µ­½Òɽ¸½¤Çµ­½Ò¤·¤¿¾ì¹ç¡¢¥¨¥é¡¼¤È¤Ê¤ë¡£

* 1Å٤⵭½Ò¤µ¤ì¤Ê¤«¤Ã¤¿ÀßÄê¹àÌܤˤϡ¢¥Ç¥Õ¥©¥ë¥ÈÃͤ¬Å¬ÍѤµ¤ì¤ë¡£ ¤·¤«¤·¡¢¥Ç¥Õ¥©¥ë¥ÈÃͤ¬Â¸ºß¤·¤Ê¤¤ÀßÄê¹àÌܤ⤢¤ë¡£

glogger ¤ÎÀßÄê¥Õ¥¡¥¤¥ë¤Ï¡¢°Ê²¼¤Î¤è¤¦¤Ê¹½Â¤¤Çµ­½Ò¤·¤Þ¤¹¡£

 interval [interval-spec]
 maxfilesize [maxfilesize-spec]
 defaultdir [defaultdir-spec]
 overwrite [overwrite-spec]
 fsync_interval [fsync_interval-spec]
 label [label-spec]
 path [path-spec]
 community [community-spec]
 requests {
   interval [interval-spec]
   path [path-spec]
   community [community-spec]
   nodes {
     [node-spec]
     ....
   }
   mib {
     interval [interval-spec]
     path [path-spec]
     oids {
       [oid-spec]
       ....
     }
   }
   mib...
 }
 requests...

....¤Ï¡¢¤½¤Î¾å¤Ëµ­½Ò¤·¤¿ [?-spec] ¤¬¤¤¤¯¤Ä³¤¤¤Æ¤âÎɤ¤¤Ç¤¹¡£ mib... ¤ä requests... ¤Ï¡¢¤½¤ì¤¾¤ì¤Î¥Ö¥í¥Ã¥¯¤¬¤¤¤¯¤Ä³¤¤¤Æ¤âÎɤ¤¤Ç¤¹¡£ [?-spec] ¤Ë¤Ï¡¢¤½¤ì¤¾¤ì°Ê²¼¤Î¿ô»ú¤äʸ»úÎó¤ò»ØÄê¤Ç¤­¤Þ¤¹¡£

[interval-spec] ¤Ë¤Ï¾®¿ôÃͤò»ØÄꤷ¤Þ¤¹¡£ÂоݤάÄê´Ö³Ö¤È¤Ê¤ê¤Þ¤¹¡£ ¤¿¤À¤·¡¢¸½¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï 0.1 ÉÃ̤Ëþ¤ÏÀڼΤƤé¤ì¤Þ¤¹¡£ (ex. interval 0.1, ¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ï 10.0)

[maxfilesize-spec] ¤Ë¤Ï½ÐÎÏ¥Õ¥¡¥¤¥ë¤ÎºÇÂ祵¥¤¥º¤ò KBñ°Ì ¤ÎÀ°¿ôÃͤǻØÄꤷ¤Þ¤¹¡£»ØÄꤷ¤¿¥µ¥¤¥º¤òͤ¨¤Æ¤«¤é¡¢ÆâÉôưºî¥¿¥¤¥ß¥ó¥°¤Î¥­ ¥ê¤ÎÎɤ¤¤È¤³¤í¤Ç¥Õ¥¡¥¤¥ë¤òÀÚ¤êÂØ¤¨¤Þ¤¹¡£¤³¤Î¾ì¹ç¡¢path ÀßÄê¤Ç¤Î¥Õ¥¡¥¤¥ë ̾À¸À®¥ë¡¼¥ë¤Ç¥Õ¥¡¥¤¥ë¤ÏÀÚ¤êÂØ¤ï¤ê¤Þ¤»¤ó¡£-mmap ¥â¡¼¥Éưºî»þ¤Ï¡¢¤³¤³¤Ç»Ø Äꤷ¤¿¥Õ¥¡¥¤¥ë¥µ¥¤¥º¤òͤ¨¤¿¤È¤³¤í¤Ç½ªÎ»¤·¤Þ¤¹¡£0(¥Ç¥Õ¥©¥ë¥ÈÃÍ) ¤ò»ØÄꤷ¡¢ ¤µ¤é¤Ë¥Õ¥¡¥¤¥ë̾À¸À®¥ë¡¼¥ë¤Ç¤â»þ¹ï¤òÆþ¤ì¤Ê¤¤¾ì¹ç¤Ï¡¢Ää»ß¤µ¤ì¤ë¤Þ¤Ç ¥Õ¥¡¥¤¥ë¤Ø½ÐÎϤ·¤Ä¤Å¤±¤Þ¤¹¡£ (ex. Ìó 1MB¤Î¾ì¹ç ¢ª maxfilesize 1024, ¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ï 0)

[defaultdir-spec] ¤Ë¤Ï´ð½à¤È¤Ê¤ë½ÐÎÏÀè¥Ç¥£¥ì¥¯¥È¥ê¤Î ÀäÂХѥ¹¤ò»ØÄꤷ¤Þ¤¹¡£ path ¹à¤Ç %G ¤òµ­½Ò¤·¤¿¤È¤­¤ËÃÖ´¹¤µ¤ì¤ëÃͤȤʤê¤Þ¤¹¡£ global default Éôʬ¤Î¤ß¤Ç»ØÄê¤Ç¤­¤Þ¤¹¡£ (ex. defaultdir /home/glogger, ¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ï /var/log/glogger)

[label-spec] ¤Ë¤ÏǤ°Õ¤Îʸ»úÎó¤ò»ØÄꤷ¤Þ¤¹¡£ ·×¬¥Æ¥¹¥È̾¤ä¡¢¥¯¥é¥¹¥¿Ì¾¤Ê¤É¤òÉÕ¤±¤Æ»È¤¦¤³¤È¤òÁÛÄꤷ¤Æ¤¤¤Þ¤¹¡£ path ¹à¤Ç %L ¤òµ­½Ò¤·¤¿¾ì¹ç¤ËÃÖ´¹¤µ¤ì¤ëʸ»úÎó¤È¤Ê¤ê¤Þ¤¹¡£ (ex. label test01, ¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ï glogger)

[overwrite-spec] ¤Ë¤Ï½ÐÎÏ¥Õ¥¡¥¤¥ë¤Î¾å½ñ¤­µö²Äʸ»úÎó on ¤Þ¤¿¤Ï enable ¤ò»ØÄꤷ¤Þ¤¹¡£ on ¤Þ¤¿¤Ï enable ¤òµ­½Ò¤¹¤ë¤È¡¢GLogger ¤Îµ¯Æ°»þ¡¢¤Þ¤¿¤Ï¡¢¥Õ¥¡¥¤¥ëÀÚ¤êÂØ¤¨»þ¤Ë¡¢ ¤¹¤Ç¤ËƱ¤¸Ì¾Á°¤Î¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Æ¤¤¤ë¾ì¹ç¤Ë¾å½ñ¤­¤·¤Þ¤¹ (°ÊÁ°¤Î¥Ç¡¼¥¿¤Ïºï½ü¤µ¤ì¤Þ¤¹)¡£ (ex. overwrite enable, ¥Ç¥Õ¥©¥ë¥È¤Ï¾å½ñ¤­¤·¤Ê¤¤)

[fsync_interval-spec] ¤Ë¤Ï fsync() ¤¹¤ë´Ö³Ö¤ÎÉÿô¡¢¤Þ¤¿¤Ï on ¤Þ¤¿¤Ï enable ¤ò »ØÄꤷ¤Þ¤¹¡£ GLogger ¤Ï½ÐÎÏ»þ¤ËËè²ó fflush() ¤·¤Þ¤¹¤¬¡¢»ØÄꤷ¤¿´Ö³Ö(ÉÃ)¤òͤ¨¤¿¥¿¥¤¥ß¥ó¥°¤Ç fsync() ¤â¤¹¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡£ on ¤Þ¤¿¤Ï enable ¤ò»ØÄꤷ¤¿¾ì¹ç¤Ï¡¢ÆâÉôưºî¥¤¥ó¥¿¡¼¥Ð¥ë(ÀßÄê¥Õ¥¡¥¤¥ë¤Îµ­½Ò¤Ë¤è¤Ã¤Æ°Û¤Ê¤ë) ¤´¤È¤Ë¡¢Ëè²ó fsync() ¤·¤Þ¤¹¡£ ¤Þ¤¿¡¢ÆâÉôưºî¥¤¥ó¥¿¡¼¥Ð¥ë¤¬¡¢¤³¤³¤Ç»ØÄꤷ¤¿Éÿô¤è¤ê¤âÂ礭¤¤´Ö³Ö¤Î¾ì¹ç¡¢Ëè²ó fsync() ¤·¤Þ¤¹¡£ ¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï°ìÀÚ fsync() ¤·¤Þ¤»¤ó¡£ (ex. fsync_interval 5, ¥Ç¥Õ¥©¥ë¥È¤Ï fsync() ¤·¤Ê¤¤)

[path-spec] ¤Ë¤Ï½ÐÎÏ¥Õ¥¡¥¤¥ë¤ÎÀäÂХѥ¹¥Õ¥¡¥¤¥ë̾¤ò»ØÄꤹ¤ëʸ»úÎó¤ò»ØÄê ¤·¤Þ¤¹¡£°Ê²¼¤ÎÃÖ´¹¥ë¡¼¥ë¤¬Å¬ÍѤǤ­¤Þ¤¹¡£¤Þ¤¿¡¢ÆâÉôưºî¤Î¥­¥ê¤ÎÎɤ¤¥¿¥¤ ¥ß¥ó¥°¤Ç¡¢¤³¤Î¥ë¡¼¥ë¤È¸½ºß¤Î»þ¹ï¤«¤é¥Õ¥¡¥¤¥ë̾¤òÀ¸À®¤·¡¢¤½¤ì¤Þ¤Ç½ÐÎϤ·¤Æ ¤¤¤¿¥Õ¥¡¥¤¥ë̾¤ÈÈæ³Ó¤·¤Þ¤¹¡£»þ¹ï¤òÃÖ´¹¤¹¤ë¥ë¡¼¥ë¤ò»ÈÍѤ·¤¿¾ì¹ç¡¢ »þ¹ï¤«¤éÀ¸À®¤µ¤ì¤¿¥Õ¥¡¥¤¥ë̾¤ËÊѹ¹¤¬¤¢¤Ã¤¿¾ì¹ç¤Ï¡¢¤½¤Î¿·¤·¤¤¥Õ¥¡¥¤¥ë¤Ë ÀÚ¤êÂØ¤¨¡¢¤½¤³¤Ø½ÐÎϤ·¤Þ¤¹¡£ÀßÄê¥Õ¥¡¥¤¥ë¤Î maxfilesize ¤ä¡¢ µ¯Æ°»þ¥ª¥×¥·¥ç¥ó°ú¿ô¤Ç¡¢¥Õ¥¡¥¤¥ë¥µ¥¤¥ºÀ©¸Â¤ò¹Ô¤Ã¤¿¾ì¹ç¤Ï¡¢»þ¹ï¤ò»È¤Ã¤¿ ¥Õ¥¡¥¤¥ë̾ÃÖ´¹¥ë¡¼¥ë¤ò»È¤ï¤º¡¢¥Õ¥¡¥¤¥ë¥µ¥¤¥ºÀ©¸Â¤Ç¥Õ¥¡¥¤¥ë¤òÀÚ¤êÂØ¤¨¤Þ¤¹¡£ ¤Þ¤¿¡¢¥Ç¥£¥ì¥¯¥È¥ê¤Ï¼«Æ°Åª¤ËºîÀ®¤·¤Þ¤»¤ó¡£

%G  defaultdir ¤Î¥Ç¥£¥ì¥¯¥È¥êÀäÂХѥ¹
%L  ¥é¥Ù¥ë(¥¯¥é¥¹¥¿Ì¾¡¢¼Â¸³Ì¾¤Ê¤É)
%n  nodes ¤Ç»ØÄꤵ¤ì¤¿ FQDN
%N  nodes ¤Ç»ØÄꤵ¤ì¤¿¥Ë¥Ã¥¯¥Í¡¼¥à
%o  mibs ¤Ç»ØÄꤵ¤ì¤¿ OID̾
%O  mibs ¤Ç»ØÄꤵ¤ì¤¿ OID¥Ë¥Ã¥¯¥Í¡¼¥à

»þ¹ï¤Ë´Ø¤¹¤ëÃÖ´¹¤Ë¤Ï¡¢GLogger ¤òµ¯Æ°¤·¤¿»þ¡¢¤Þ¤¿¤Ï¥Õ¥¡¥¤¥ë¤¬ÀÚ¤êÂØ¤ï¤ë»þ¤Î »þ¹ï¤ÎÃͤ¬ÍøÍѤµ¤ì¤Þ¤¹¡£

%t  Ç¯·îÆü»þʬÉåߥêÉÃ
    (ex. 20031231235959000)
%c  ¥Þ¥¤¥¯¥íÉà  (000000..999999)
%s  ¥ß¥êÉà      (000..999)
%S  Éà          (00..59)
%M  Ê¬           (00..59)
%h  »þ           (00..23)
%d  ·îÆâÄÌ»»Æü¿ô (01..31)
%j  Ç¯ÆâÄÌ»»Æü¿ô (001..366)
%m  ·î           (01..12)
%y  Ç¯           (1970...)

(ex. path %G/%H/%O/%y%m%h.glg, ¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ï %G/%L_%y%m%d%h%M.glg)

[community-spec] ¤Ë¤Ï¥³¥ß¥å¥Ë¥Æ¥£¥¹¥È¥ê¥ó¥°¤ò»ØÄꤷ¤Þ¤¹¡£ (ex. community private, ¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ï public)

[node-spec] ¤Ë¤Ï¡Ö¥Û¥¹¥È̾ ¥Ë¥Ã¥¯¥Í¡¼¥à¡×¤ÎÁȤò³Æ¹Ô¤Ëµ­½Ò¤·¤Þ¤¹¡£ ¥Ë¥Ã¥¯¥Í¡¼¥à¤¬Ìµ¤±¤ì¤Ð¡¢%H ¤Ï %h ¤ÈƱÅù¤È¤Ê¤ê¤Þ¤¹¡£ nodes ¥Ö¥í¥Ã¥¯Æâ¤Ë¡¢Ê£¿ô¹Ôµ­½Ò¤Ç¤­¤Þ¤¹¡£ºÇÂç¿ô¤Ï̤ÄêµÁ¤Ç¤¹¡£ ¥Û¥¹¥È̾¤Ë¤Ï¡¢Ã±½ã¥Û¥¹¥È̾¡¢IP ¥¢¥É¥ì¥¹¡¢[?-?] ¤Ë¤è¤ëÏ¢ÈÖ¿ô»ú»ØÄ꤬ ÍøÍѤǤ­¤Þ¤¹¡£ Ï¢ÈÖ¿ô»ú»ØÄê [?-?] ¤Î ? ¤Ë¤Ï 0 °Ê¾å¤ÎÀ°¿ô(10¿Ê or 16¿Ê)(16¿Ê¤Î¾ì¹ç¤Ï 0x ¤Ç»Ï¤Þ¤ëʸ»úÎó)¤ò»ØÄꤷ¤Þ¤¹¡£º¸¤Ë»ÏÅÀ¡¢±¦¤Ë½ªÅÀ¤Î¿ô¤ò»ØÄꤷ¤Þ¤¹¡£»Ï ÅÀ¤è¤ê½ªÅÀ¤Î¤Û¤¦¤¬Â礭¤¤¿ô¤Ç¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£5·å¤Þ¤Ç»ØÄê¤Ç¤­¤Þ¤¹¡£ »ÏÅÀ¤Ç 0 ¤òÉղ䷤Ʒå¹ç¤ï¤»¤ò¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£½ªÅÀ¤ÎÃͤ˶áÉÕ¤¯¤Ë¤· ¤¿¤¬¤Ã¤Æ¡¢»ÏÅÀ¤Ç»ØÄꤷ¤¿·å¿ô¤è¤ê¤âÂ礭¤¯¤Ê¤ë¾ì¹ç¤Ï¡¢»ÏÅÀ¤Î·å¤òͤ¨¤ÆÅ¸ ³«¤·¤Þ¤¹¡£¤Þ¤¿¡¢½ªÅÀ¤ËÀèÆ¬¤«¤é¤¤¤¯¤Ä¤« 0 ¤òÉղ䷤Ƥ⡢»ÏÅÀ¤è¤ê¿¤¯»Ø Äꤷ¤¿¤ê¡¢¾¯¤Ê¤¯»ØÄꤷ¤Æ¤â¡¢»ÏÅÀ¤Ç¤¢¤ï¤»¤¿·å¤Ë¤Ê¤ê¤Þ¤¹¡£

Î㤨¤Ð¡¢
[1-9] ¤Ï 1 ¤«¤é  9 ¤Î 9¸Ä¤ËŸ³«¤µ¤ì¤Þ¤¹¡£
[0x1-0x10] ¤Ï 1 ¤«¤é f ¤È 10 ¤Î 16¸Ä¤ËŸ³«¤µ¤ì¤Þ¤¹¡£
[000-20] ¤Ï 000 ¤«¤é 020 ¤Î 21¸Ä¤ËŸ³«¤µ¤ì¤Þ¤¹¡£

¥Ë¥Ã¥¯¥Í¡¼¥à¤Ë $1, $2... ¤È¤·¤Æ»ØÄꤹ¤ë¤È¡¢[?-?]Éô¤ò»ØÄꤷ¤¿½çÈÖ¤ËÃÖ´¹ ¤µ¤ì¤Þ¤¹¡£ Î㤨¤Ð¡¢abc[01-02]-[03-04].cdef.com abc$1-$2 ¤È»ØÄꤹ¤ë¤È¡¢¥Ë¥Ã¥¯¥Í¡¼¥à¤Ï abc01-03, abc01-04, abc02-03, abc02-04 ¤Î 4¸Ä¤ËŸ³«¤µ¤ì¤Þ¤¹¡£ Ÿ³«¤µ¤ì¤ë½çÈÖ¤Ï̤ÄêµÁ¤Ç¤¹¡£

WarningÃí°Õ
 

Âбþ¤¹¤ë $1, $2...¤ò»ØÄꤷ¤Ê¤¯¤Æ¤â¥¨¥é¡¼¤È¤Ê¤ê¤Þ¤»¤ó¡£ ¤·¤«¤· [?-?]Éô¤Î¸Ä¿ô¤è¤ê¿¤¯ $Éô¤ò»ØÄꤹ¤ë¤È¥¨¥é¡¼¤È¤Ê¤ê¤Þ¤¹¡£

ex.
  gfm[01-80].apgrid.org  gfm$1
  gfmgw[01-10].apgrid.org  gfmgw$1
  localhost
  172.19.2.[0-255]  private$1
  a[0x00-0xff]-[000-100].b.com  abc$2-$1
¥Ç¥Õ¥©¥ë¥ÈÃͤÏ̵¤·¡£

[oids-spec] ¤Ë¤Ï¡ÖOID̾ ¥Ë¥Ã¥¯¥Í¡¼¥à¡×¤ÎÁȤò³Æ¹Ô¤Ëµ­½Ò¤·¤Þ¤¹¡£ ¥Ë¥Ã¥¯¥Í¡¼¥à¤Ï¾Êά¤Ç¤­¤Þ¤»¤ó¡£ oids ¥Ö¥í¥Ã¥¯Æâ¤Ë¡¢Ê£¿ô¹Ôµ­½Ò¤Ç¤­¤Þ¤¹¡£ »ØÄê¤Ç¤­¤ë OID ¤Î¿ô¤Ï¡¢°ì¤Ä¤Î·×¬ÂоݥΡ¼¥É¤ËÂФ·¤Æ¡¢1Å٤ΠSNMP Í×µá ¤ËÆþ¤ë¸Ä¿ô¤Þ¤Ç»ØÄê¤Ç¤­¤Þ¤¹¡£

ex.
  # ºÇ¶á 1ʬ¤Î¥í¡¼¥É¥¢¥Ù¥ì¡¼¥¸
  enterprises.ucdavis.laTable.laEntry.laLoad.1     loadavg
  # 2ÈÖÌܤΥͥåȥ¥¯¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î TX
  interfaces.ifTable.ifEntry.ifOutOctets.2  eth0-out
  # 2ÈÖÌܤΥͥåȥ¥¯¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î RX
  interfaces.ifTable.ifEntry.ifInOctets.2 eth0-in
  # 1ÈÖÌܤΥѡ¼¥Æ¥£¥·¥ç¥ó(snmpd.conf¤ÇÀßÄꤷ¤¿½ç)¤Î»ÈÍÑÎÌ
  enterprises.ucdavis.dskTable.dskEntry.dskUsed.1 used
  # 1ÈÖÌܤΥѡ¼¥Æ¥£¥·¥ç¥ó(snmpd.conf¤ÇÀßÄꤷ¤¿½ç)¤Î¶õ¤­ÍÆÎÌ
  enterprises.ucdavis.dskTable.dskEntry.dskAvail.1 available
  ¥Ç¥Õ¥©¥ë¥ÈÃͤÏ̵¤·¡£

SEE ALSO

glogger(8)

gfarm-2.4.1/snmptool/glogger3/docbook/ja/glogger.8.docbook0000644000000000000000000001072311507222726022053 0ustar rootroot 18 Sep 2003 glogger 8 snmptool glogger SNMP ¤Î GET ¥ê¥¯¥¨¥¹¥È¤Ç³Æ¥Û¥¹¥È¤Î¾ðÊó¤ò½¸¤á¤ë glogger ¥ª¥×¥·¥ç¥ó DESCRIPTION ¥×¥í¥°¥é¥à glogger ¤Ï¡¢SNMP GET¥ê¥¯¥¨¥¹¥È¤ò»È¤Ã¤Æ¡¢¥Í¥Ã¥È¥ï¡¼¥¯¾å ¤Ë¤¢¤ë³Æ¥Û¥¹¥È¤«¤é¾ðÊó¤ò½¸¤á¡¢´Ñ¬¥Ç¡¼¥¿¤È¤·¤Æ¥Õ¥¡¥¤¥ë¤Ø½ÐÎϤ·¤Þ¤¹¡£ ÀßÄê¥Õ¥¡¥¤¥ë¤Ç»ØÄꤷ¤¿´Ñ¬¥¤¥ó¥¿¡¼¥Ð¥ë¤´¤È¤Ë¡¢³Æ¥Û¥¹¥È¤ËÂФ·¤Æ GET¥ê¥¯¥¨¥¹¥È¤·¡¢È¿±þ¤ÎÁᤫ¤Ã¤¿¥Û¥¹¥È¤«¤é½çÈ֤˼õ¿®¡¢½ÐÎϽèÍý¤ò¤·¤Þ¤¹¡£ °ì¤Ä¤Î¥Û¥¹¥È¤ËÂФ·¤Æ¡¢Ê£¿ô¤ÎOID¤ò°ì¤Ä¤Î¥Ñ¥±¥Ã¥È¤Ç¥ê¥¯¥¨¥¹¥È¤·¡¢°ì¤Ä¤Î ¥Ñ¥±¥Ã¥È¤Ç MIB¤«¤é¤ÎÃͤò¼õ¿®¤·¤Þ¤¹¡£ ´Ñ¬ÂоݤΥۥ¹¥È¡¢¥¹¥¤¥Ã¥Á¤Ê¤É¤Ï¡¢¤½¤ì¤¾¤ì SNMP¥¨¡¼¥¸¥§¥ó¥È¤¬Æ°ºî¤·¡¢ ´Ñ¬¤¹¤ë MIB¥Ä¥ê¡¼¤Î OID¤ò GLogger ¤òưºî¤µ¤»¤ë¥Û¥¹¥È¤«¤é»²¾È¤Ç¤­¤ë¤è¤¦¤Ë ¤·¤Æ¤ª¤¯É¬Íפ¬¤¢¤ê¤Þ¤¹¡£ SNMP¤Î¥Ð¡¼¥¸¥ç¥ó¤Ï SNMPv1 ¸ÇÄê¤Ç¤¹¡£ OPTIONS GLogger ¤ÎÀßÄê¥Õ¥¡¥¤¥ë¤ò»ØÄꤷ¤Þ¤¹¡£ ÀßÄê¥Õ¥¡¥¤¥ë¤¬¸«¤Ä¤«¤é¤Ê¤¤¾ì¹ç¤Ï¥¨¥é¡¼½ªÎ»¤Ç¤¹¡£ÀßÄê¥Õ¥¡¥¤¥ë ¤Î»ØÄ꤬¾Êά¤µ¤ì¤¿¾ì¹ç¤Ï /etc/glogger/glogger.conf ¤òÆÉ¤ß¹þ¤ß¤Þ¤¹¡£ ¥Õ¥¡¥¤¥ë̾¤ÎÂå¤ï¤ê¤Ë¥Ï¥¤¥Õ¥ó "-" ¤ò»ØÄꤹ¤ë¤È¡¢É¸½àÆþÎϤ«¤éÀßÄê ¥Õ¥¡¥¤¥ë¤È¤·¤ÆÆÉ¤ß¹þ¤ß¤Þ¤¹¡£ GLogger ¤ò¥Ç¡¼¥â¥ó²½¤·¤Þ¤¹¡£PID¤òÊݸ¤¹¤ë¥Õ¥¡¥¤¥ë¤ò»ØÄꤷ¤Þ¤¹¡£ ¤³¤Î¥ª¥×¥·¥ç¥ó¤¬»ØÄꤵ¤ì¤Ê¤¤¾ì¹ç¤Ï¡¢¸Æ¤Ó½Ð¤µ¤ì¤¿¥·¥§¥ë¤«¤é¤Ï fork() ¤»¤º¡¢É¸½à½ÐÎÏ¤ËÆ°ºî¥í¥°¤¬É½¼¨¤µ¤ì¤Þ¤¹¡£ glogger ¥³¥Þ¥ó¥É¼«ÂÎ¤ÇÆ±»þµ¯Æ°³Îǧ¤Ï¹Ô¤Ê¤¤¤Þ¤»¤ó¡£ mmap()´Ø¿ô¤ò»È¤¤¡¢-maxsize ¥ª¥×¥·¥ç¥ó¤Ç»ØÄꤷ¤¿¥Õ¥¡¥¤¥ë¥µ¥¤¥º¤Î ¥Õ¥¡¥¤¥ë¤ò³ÎÊݤ·¤Æ¤«¤é¡¢¤½¤Î¥Õ¥¡¥¤¥ë¤Ø½ÐÎϤ·¤Þ¤¹¡£ ÀßÄê¥Õ¥¡¥¤¥ë¤Î path ¹à(¸å½Ò)¤ÎÀßÄê¤Ï̵»ë¤µ¤ì¡¢½ÐÎÏÀè¤Ï output filename ¤Î 1²Õ½ê¤Ø¤Þ¤È¤á¤Æ½ÐÎϤµ¤ì¤ë¤Î¤ÇÃí°Õ¤¬É¬ÍפǤ¹¡£ -maxsize ¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Æ¤¤¤Ê¤¤¤È¤­¤Ï¡¢Ìó 5KB ¤Î¥Õ¥¡¥¤¥ë¤ò³ÎÊݤ·¡¢ ¤½¤ì¤Ë½ÐÎϤ·¤Æ½ªÎ»¤·¤Þ¤¹¡£ output file size ¤ÎÂ礭¤µ¤Ë½ÐÎÏ¥Õ¥¡¥¤¥ë¥µ¥¤¥º¤òÀ©¸Â¤·¤Þ¤¹¡£ ÀßÄê¥Õ¥¡¥¤¥ë¤Î maxfilesize ¤è¤ê¤âÍ¥À褵¤ì¤Þ¤¹¡£ ¤³¤Î¥µ¥¤¥º¤òͤ¨¤ë¤È¡¢¿·¤·¤¯¥Õ¥¡¥¤¥ë¤òºîÀ®¤·¡¢¤½¤Î¥Õ¥¡¥¤¥ë¤Ø½ÐÎÏÀè¤ò ÀÚ¤êÂØ¤¨¤Æ¡¢½ÐÎϤò³¤±¤Þ¤¹¡£ ÀßÄê¥Õ¥¡¥¤¥ë¤Î path ÀßÄê¤Î¥ë¡¼¥ë¤Ç»þ¹ï¤òÍѤ¤¤Æ¤â¡¢¤½¤Î»þ¹ï¤´¤È¤Î ¥¿¥¤¥ß¥ó¥°¤Ç¤Ï¤Ê¤¯¡¢output file size ¤òͤ¨¤¿¤È¤­¤Î¤ß¡¢½ÐÎÏÀè¤Î¥Õ¥¡¥¤¥ë ¤òÀÚ¤êÂØ¤¨¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡£ -mmap ¥â¡¼¥É¤Î»þ¤Ï¡¢¤³¤³¤Ç»ØÄꤷ¤¿¥µ¥¤¥º¤Î¥Õ¥¡¥¤¥ë¤¬ºîÀ®¤µ¤ì¤Þ¤¹¡£ ÀßÄê¥Õ¥¡¥¤¥ë¤ÎÆâÍÆ¤ò¥Æ¥­¥¹¥È¤Çɸ½à½ÐÎϤؽÐÎϤ·¤Þ¤¹¡£ ÀßÄê¥Õ¥¡¥¤¥ë¤Îµ­½Ò¤¬´Ö°ã¤Ã¤Æ¤¤¤ì¤Ð¡¢¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤ò½ÐÎϤ·¡¢½ªÎ» ¤·¤Þ¤¹¡£ÀßÄê¥Õ¥¡¥¤¥ë¤ò»ØÄꤹ¤ë¾ì¹ç¤Ï¡¢-config ¥ª¥×¥·¥ç¥ó¤Ç»ØÄꤷ¤Þ¤¹¡£ SIGNAL glogger¥×¥í¥»¥¹¤Ï¥·¥°¥Ê¥ë¼õÎλþ¡¢°Ê²¼¤Î¤è¤¦¤Ëưºî¤·¤Þ¤¹¡£ ¤Þ¤À±þÅú¤¬Ê֤äƤ­¤Æ¤¤¤Ê¤¤·×¬Âоݥۥ¹¥È¤Ë´Ø¤·¤Æ¤Ï¡¢¤³¤Î¥·¥°¥Ê ¥ë¤ò¼õ¤±¤¿»þÅÀ¤ÇÃæÃǤ·(¥¿¥¤¥à¥¢¥¦¥È°·¤¤¤Ë¤·)¡¢·×¬¥Ç¡¼¥¿¤ò¥Õ¥¡ ¥¤¥ë¤Ø½ÐÎϤ·¤Æ¤«¤é¡¢ºÆµ¯Æ°¤·¤Þ¤¹¡£ ¤Þ¤À±þÅú¤¬Ê֤äƤ­¤Æ¤¤¤Ê¤¤·×¬Âоݥۥ¹¥È¤Ë´Ø¤·¤Æ¤Ï¡¢¤³¤Î¥·¥°¥Ê ¥ë¤ò¼õ¤±¤¿»þÅÀ¤ÇÃæÃǤ·(¥¿¥¤¥à¥¢¥¦¥È°·¤¤¤Ë¤·)¡¢·×¬¥Ç¡¼¥¿¤ò¥Õ¥¡ ¥¤¥ë¤Ø½ÐÎϤ·¤Æ½ªÎ»¤·¤Þ¤¹¡£ SEE ALSO glogdump8 , glogger.conf5 , glogger_logdata5 gfarm-2.4.1/snmptool/glogger3/docbook/ja/glogdump.8.docbook0000644000000000000000000000210511507222726022236 0ustar rootroot 18 Sep 2003 glogdump 8 snmptool glogdump GLogger ¤¬½ÐÎϤ·¤¿¥Õ¥¡¥¤¥ë¤ò²ÄÆÉ¤Ë¤¹¤ë glogdump ¥Õ¥¡¥¤¥ë DESCRIPTION GLogger ¤¬½ÐÎϤ·¤¿¥Õ¥¡¥¤¥ë¤òÆÉ¤á¤ë¤è¤¦¤Ë¤·¤ÆÉ¸½à½ÐÎϤؽÐÎϤ·¤Þ¤¹¡£ OPTIONS ¤Ê¤· SEE ALSO glogger8 , glogger_logdata5 gfarm-2.4.1/snmptool/glogger3/docbook/ja/glogdump.80000644000000000000000000000117511507222726020625 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GLOGDUMP" "8" "30 September 2003" "snmptool" "" .SH NAME glogdump \- GLogger ¤¬½ÐÎϤ·¤¿¥Õ¥¡¥¤¥ë¤ò²ÄÆÉ¤Ë¤¹¤ë .SH SYNOPSIS \fBglogdump\fR [ \fB\fI¥Õ¥¡¥¤¥ë\fB\fR ] .SH "DESCRIPTION" .PP GLogger ¤¬½ÐÎϤ·¤¿¥Õ¥¡¥¤¥ë¤òÆÉ¤á¤ë¤è¤¦¤Ë¤·¤ÆÉ¸½à½ÐÎϤؽÐÎϤ·¤Þ¤¹¡£ .SH "OPTIONS" .PP ¤Ê¤· .SH "SEE ALSO" .PP \fBglogger\fR(8), \fBglogger_logdata\fR(5) gfarm-2.4.1/snmptool/glogger3/docbook/ja/glogger_logdata.5.docbook0000644000000000000000000001404111507222726023540 0ustar rootroot 18 Sep 2003 glogger_logdata 5 Gfarm glogger_logdata GLogger ½ÐÎϥǡ¼¥¿·Á¼° DESCRIPTION GLogger ¤¬½ÐÎϤ¹¤ë¥Õ¥¡¥¤¥ë¤Î¥Ç¡¼¥¿¹½Â¤¤Ç¤¹¡£ ¥Õ¥¡¥¤¥ë¤Î¥Ç¡¼¥¿¹½Â¤ GLogger¤Î´Ñ¬¥í¥°¥Ç¡¼¥¿¥Õ¥¡¥¤¥ë¤Ï¡¢¥á¥¿¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¤È ¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¥°¥ë¡¼¥×¤ÎϢ³¤Ç¹½À®¤µ¤ì¤Þ¤¹¡£ ¥á¥¿¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¤Ï¡¢¥Õ¥¡¥¤¥ë¤ÎÀèÆ¬¤Ë 1¤Ä¸ºß¤·¤Þ¤¹¡£ ¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¥°¥ë¡¼¥×¤Ï¡¢Ê£¿ô¤Î¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¤Ç¹½À®¤µ¤ì¤Þ¤¹¡£ ¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¤Ï¡¢»þ¹ï¤È¤½¤Î»þ¹ï¤Î´Ñ¬¥Ç¡¼¥¿ÃͤÎÎó¤Ç¤¹¡£ ¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¤Î½Ð¸½½ç½ø¤È¡¢´Ñ¬»ö¾Ý¤Î¼ïÎà¤È¤Î´Ø·¸¤Ï¡¢ ¥á¥¿¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯Æâ¤ÇÂбþ¤òÄêµÁ¤·¤Þ¤¹¡£ ¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¥°¥ë¡¼¥×¤Î¥µ¥¤¥º¤Ï¡¢¸ÇÄêŤǤ¢¤ê¡¢ ¥á¥¿¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¤ÇÄêµÁ¤·¤Þ¤¹¡£ ¤¿¤È¤¨¤Ð 1»þ´Öñ°Ì¤Ç¥Õ¥¡¥¤¥ë¤òÀÚ¤êÂØ¤¨¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¤È¤¤¤Ã¤¿ À©Ìó¤Ï¤Ê¤¯¡¢ºÇÂ祵¥¤¥º¤Ï¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë°Í¸¤·¤Þ¤¹¡£ (GLogger ¤Ç¤Ï¡¢»ØÄê¥Õ¥¡¥¤¥ë¥µ¥¤¥º¤Ç¿·¤·¤¤¥Õ¥¡¥¤¥ë¤Ø½ÐÎϤ¹¤ë¤è¤¦¤Ë ÀÚ¤êÂØ¤¨¤ë¤³¤È¤¬²Äǽ¤Ç¤¹) ¤³¤Î¥Ç¡¼¥¿¹½Â¤¤Î¥í¥°¥Õ¥¡¥¤¥ë¤ËÄɵ­¤Ï¤Ç¤­¤Þ¤»¤ó¡£ ¥á¥¿¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯ ¸ÇÄêĹÉôʬ¤È²ÄÊÑĹÉôʬ¤Ëʬ¤±¤Æ¤¤¤Þ¤¹¡£ 1: ¥á¥¿¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯ 1 [24bytes] 2: ¥á¥¿¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯ 2 [ ²ÄÊÑĹ] ¥á¥¿¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯ 1 1: ¥á¥¿¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯ 1 ¤Î¥µ¥¤¥º(°Ê²¼²¿bytes³¤¯¤«) [ 2bytes] 2: ¥Ð¡¼¥¸¥ç¥óÈÖ¹æ [ 2bytes] 3: ¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¥°¥ë¡¼¥×¤Î¥µ¥¤¥º [ 4bytes] 4: ¤³¤Î¥Õ¥¡¥¤¥ë¤Î·×¬³«»ÏÆü»þ(UNIX time ÉÃ) [ 4bytes] 5: ¤³¤Î¥Õ¥¡¥¤¥ë¤Î·×¬³«»ÏÆü»þ(UNIX time ¥Þ¥¤¥¯¥íÉÃ) [ 4bytes] 6: ¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¥°¥ë¡¼¥×¤Ò¤È¤Ä¤Î»þ´Ö´Ö³Ö(ÉÃ) [ 4bytes] 7: ¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¥°¥ë¡¼¥×¤Ò¤È¤Ä¤Î»þ´Ö´Ö³Ö(¥Þ¥¤¥¯¥íÉÃ) [ 4bytes] 8: ͽÌóÎÎ°è ¥á¥¿¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯ 2 1: ¥á¥¿¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯ 2 ¤Î¥µ¥¤¥º(°Ê²¼²¿bytes³¤¯¤«) [ 4bytes] 2: ´Ñ¬Âоݥۥ¹¥ÈÄêµÁÉôʬ ·×¬Âоݥۥ¹¥È¤Î IP ¥¢¥É¥ì¥¹¥ê¥¹¥È¤È ¥Û¥¹¥È̾ (FQDN)¤Èά¾Î¤Î¥ê¥¹¥È¤È¥³¥ß¥å¥Ë¥Æ¥£¥¹¥È¥ê¥ó¥° ¢ªÊ¤ӽç¤Ë¥¤¥ó¥Ç¥Ã¥¯¥¹ÈÖ¹æ(1,2,...) [ ²ÄÊÑĹ] 3: OID ÄêµÁÉôʬ OID ¤È OID ̾¤È OID ά¾Î¤È ¢ªÊ¤ӽç¤Ë OID ¥¤¥ó¥Ç¥Ã¥¯¥¹ÈÖ¹æ(1,2,...) [ ²ÄÊÑĹ] 4: ¬Äꥤ¥ó¥¿¡¼¥Ð¥ëɽ ¾å¤ÇÄêµÁ¤·¤¿¥Û¥¹¥È¥¤¥ó¥Ç¥Ã¥¯¥¹ÈÖ¹æ¤È OID ¥¤¥ó¥Ç¥Ã¥¯¥¹ÈÖ¹æ¤ÎÁȹ礻¤´¤È¤Î ¬Äꥤ¥ó¥¿¡¼¥Ð¥ë(ÉÃ+¥Þ¥¤¥¯¥íÉÃ) [ ²ÄÊÑĹ] 5: ¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¥°¥ë¡¼¥×Âбþɽ [ ²ÄÊÑĹ] 6: ͽÌóÎΰè [ ²ÄÊÑĹ] [²ÄÊÑĹ]¤Ï¡¢¥µ¥¤¥º¤ò2bytes¤Çɽ¤·¤ÆÀèÆ¬¤ËÉղä·¡¢°Ê¹ßǤ°Õ¥Ç¡¼¥¿¤¬Â³¤­¤Þ¤¹¡£ ¤³¤Î2bytes¼«¿È¤Î¥µ¥¤¥º¤Ï´Þ¤Þ¤ì¤Þ¤»¤ó¡£ ¥Û¥¹¥ÈÄêµÁÉôʬ: {IP¥¢¥É¥ì¥¹(ʸ»úÎó)}{NULL}{FQDN}{NULL}{ά¾Î}{NULL}{community string}{NULL} ¤Î·«¤êÊÖ¤·¤Ç¤¹¡£IP¥¢¥É¥ì¥¹Éôʬ¤Ï 192.168.0.1 ¤Î¤è¤¦¤Êɽµ­¤Ç¤¹¡£ OIDÄêµÁÉôʬ: {OID̾(ÀßÄê¥Õ¥¡¥¤¥ë¤Ç»ØÄꤷ¤¿Ê¸»úÎó)}{NULL}{ά¾Î}{NULL} ¤Î·«¤êÊÖ¤·¤Ç¤¹¡£ ¬Äꥤ¥ó¥¿¡¼¥Ð¥ëɽ: {¥Û¥¹¥È¥¤¥ó¥Ç¥Ã¥¯¥¹ÈÖ¹æ}{OID¥¤¥ó¥Ç¥Ã¥¯¥¹ÈÖ¹æ}{»þ´Ö(8bytes)} ¤Î·«¤êÊÖ¤·¤Ç¤¹¡£ »þ´Ö¤ÏÉä¬ 4bytes, ¥Þ¥¤¥¯¥íÉä¬ 4bytes¤Î½ç¤Ç¹ç·× 8bytes ¤Ç¤¹¡£ ¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¥°¥ë¡¼¥×Âбþɽ: {¸Ä¿ô(n¸Ä) 2bytes}{(¥Û¥¹¥È¥¤¥ó¥Ç¥Ã¥¯¥¹ÈÖ¹æ + OID¥¤¥ó¥Ç¥Ã¥¯¥¹ÈÖ¹æ) * n} ¤Î·«¤êÊÖ¤·¤Ç¤¹¡£ 1¤Ä¤Î¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¥°¥ë¡¼¥×Æâ¤Î¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¤Î½Ð¸½½ç½ø¤ò ÄêµÁ¤·¤¿É½¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£ ¸Ä¿ô¤Ï¡¢Âбþ¤¹¤ë¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯Æâ¤Î¥Ç¡¼¥¿¤Î¸Ä¿ô(¥Û¥¹¥È¥¤¥ó¥Ç¥Ã¥¯¥¹ÈÖ¹æ¤È OID¥¤¥ó¥Ç¥Ã¥¯¥¹ÈÖ¹æ¤ÎÁȤ¢¤ï¤»¤Î¸Ä¿ô)¤ò¼¨¤·¤Þ¤¹¡£ ¸Ä¿ô¤¬ 0¤Î¾ì¹ç¡¢¤½¤Î¥¿¥¤¥ß¥ó¥°¤Ç¤Ï¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¤¬½Ð¸½¤·¤Ê¤¤ (»þ¹ï¥Ç¡¼¥¿¤¹¤é½Ð¸½¤·¤Ê¤¤)¤³¤È¤ò¼¨¤·¡¢Âбþ¤¹¤ë¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¤Ï¸ºß¤·¤Þ¤»¤ó¡£ ¥¤¥ó¥Ç¥Ã¥¯¥¹ÈÖ¹æ¤Ï¡¢2bytes = 0¡Á65535 ¤Ç¤¹¡£ ¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¥°¥ë¡¼¥× ¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¥°¥ë¡¼¥×Âбþɽ¤Î½çÈ֤ˡ¢¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¤¬Â³¤­¤Þ¤¹¡£ ¤¹¤Ù¤Æ¤Î¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¤Î¼ïÎà¤Î½Ð¸½¥Ñ¥¿¡¼¥ó 1¼þ´ü¤ò¼¨¤·¤Þ¤¹¡£ (¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¤Ë¤Ï¡¢Æ±»þ¹ï¤Î·×¬¥Ç¡¼¥¿¤¬¤Þ¤È¤á¤é¤ì¤Æ¤¤¤Þ¤¹¡£) ¤³¤ÎÏÀÍýŪ¤Ë¤Þ¤È¤á¤¿ 1¼þ´ü¤ò¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¥°¥ë¡¼¥×¤È¤·¤Æ¤¤¤Þ¤¹¡£ ¤è¤Ã¤Æ¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¥°¥ë¡¼¥×¤È¼¡¤Î¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¥°¥ë¡¼¥×¤Î´Ö¤Ë¤Ï¡¢ ¶èÀÚ¤ê¤Î¤¿¤á¤Î¥Ç¡¼¥¿¤Ï¸ºß¤·¤Þ¤»¤ó¡£ 1: ¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯ 2: °Ê²¼¡¢¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¤Î·«¤êÊÖ¤· ¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯ Ʊ»þ¹ï¤Î³ÆÂ¬ÄêÃͤ¬°ì¤Ä¤Ë¤Þ¤È¤Þ¤Ã¤¿¥Ç¡¼¥¿¤ÎÁȤˤʤäƤ¤¤Þ¤¹¡£ ·×¬¥Ç¡¼¥¿¤Î̵¤¤»þ¹ï¤Ë¤Ï¡¢¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¤Ï½Ð¸½¤·¤Þ¤»¤ó (»þ¹ï¥Ç¡¼¥¿¤â½Ð¸½¤·¤Þ¤»¤ó)¡£ ¤Ò¤È¤Ä¤Î¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¤Ï²ÄÊÑŤǤ¹¤¬¡¢¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¥°¥ë¡¼¥×Âбþɽ¤«¤é¡¢ ¥µ¥¤¥º¤¬·èÄê¤Ç¤­¤Þ¤¹¡£ ¤Ò¤È¤Ä¤Î¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¥µ¥¤¥º = »þ¹ï¥Ç¡¼¥¿ 8bytes + ·×¬¥Ç¡¼¥¿¤Î¸Ä¿ô(n¸Ä) * 5bytes ¤È¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£ ·×¬¥Ç¡¼¥¿¤¬Ìµ¤¤»þ¹ï¤Î¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¤Ï¸ºß¤·¤Þ¤»¤ó¡£ 1: ¤³¤Î¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¤Î·×¬»þ¹ï(UNIX time ÉÃ) [ 4bytes] 2: ¤³¤Î¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¤Î·×¬»þ¹ï(UNIX time ¥Þ¥¤¥¯¥íÉÃ) [ 4bytes] 3: 1ÈÖÌܤη׬¥Ç¡¼¥¿¥Õ¥é¥° [ 1bytes] 4: 1ÈÖÌܤη׬¥Ç¡¼¥¿ [ 4bytes] 5: °Ê²¼Æ±°ì»þ¹ï¤Î·×¬¥Ç¡¼¥¿¥Õ¥é¥°¡¢¥Ç¡¼¥¿¤Î·«¤êÊÖ¤· n: ͽÌóÎÎ°è ¢¨ Îã: 256 ¥Î¡¼¥É¤Î¾ì¹ç¡¢¹ç·× 1288 ¥Ð¥¤¥È ¥Ç¡¼¥¿¥Õ¥é¥°¤Î³Æ¥Ó¥Ã¥È¤Î°ÕÌ£(²¼°Ì¥Ó¥Ã¥È¤«¤é½ç¤Ë) ¥Ç¡¼¥¿Í­¸ú 1 ̵¸ú 0 (¥¿¥¤¥à¥¢¥¦¥È¤Î¾ì¹ç¤âÍ­¸ú) ¬ÄêÀ®¸ù 1 ¼ºÇÔ 0 (¥¿¥¤¥à¥¢¥¦¥È¤Ï¼ºÇÔ) SEE ALSO glogger8 gfarm-2.4.1/snmptool/glogger3/docbook/ja/glogger.8.html0000644000000000000000000001040511507222726021374 0ustar rootroot glogger

glogger

Name

glogger -- SNMP ¤Î GET ¥ê¥¯¥¨¥¹¥È¤Ç³Æ¥Û¥¹¥È¤Î¾ðÊó¤ò½¸¤á¤ë

Synopsis

glogger [¥ª¥×¥·¥ç¥ó]

DESCRIPTION

¥×¥í¥°¥é¥à glogger ¤Ï¡¢SNMP GET¥ê¥¯¥¨¥¹¥È¤ò»È¤Ã¤Æ¡¢¥Í¥Ã¥È¥ï¡¼¥¯¾å ¤Ë¤¢¤ë³Æ¥Û¥¹¥È¤«¤é¾ðÊó¤ò½¸¤á¡¢´Ñ¬¥Ç¡¼¥¿¤È¤·¤Æ¥Õ¥¡¥¤¥ë¤Ø½ÐÎϤ·¤Þ¤¹¡£ ÀßÄê¥Õ¥¡¥¤¥ë¤Ç»ØÄꤷ¤¿´Ñ¬¥¤¥ó¥¿¡¼¥Ð¥ë¤´¤È¤Ë¡¢³Æ¥Û¥¹¥È¤ËÂФ·¤Æ GET¥ê¥¯¥¨¥¹¥È¤·¡¢È¿±þ¤ÎÁᤫ¤Ã¤¿¥Û¥¹¥È¤«¤é½çÈ֤˼õ¿®¡¢½ÐÎϽèÍý¤ò¤·¤Þ¤¹¡£ °ì¤Ä¤Î¥Û¥¹¥È¤ËÂФ·¤Æ¡¢Ê£¿ô¤ÎOID¤ò°ì¤Ä¤Î¥Ñ¥±¥Ã¥È¤Ç¥ê¥¯¥¨¥¹¥È¤·¡¢°ì¤Ä¤Î ¥Ñ¥±¥Ã¥È¤Ç MIB¤«¤é¤ÎÃͤò¼õ¿®¤·¤Þ¤¹¡£ ´Ñ¬ÂоݤΥۥ¹¥È¡¢¥¹¥¤¥Ã¥Á¤Ê¤É¤Ï¡¢¤½¤ì¤¾¤ì SNMP¥¨¡¼¥¸¥§¥ó¥È¤¬Æ°ºî¤·¡¢ ´Ñ¬¤¹¤ë MIB¥Ä¥ê¡¼¤Î OID¤ò GLogger ¤òưºî¤µ¤»¤ë¥Û¥¹¥È¤«¤é»²¾È¤Ç¤­¤ë¤è¤¦¤Ë ¤·¤Æ¤ª¤¯É¬Íפ¬¤¢¤ê¤Þ¤¹¡£ SNMP¤Î¥Ð¡¼¥¸¥ç¥ó¤Ï SNMPv1 ¸ÇÄê¤Ç¤¹¡£

OPTIONS

-config [input configuration file name]

GLogger ¤ÎÀßÄê¥Õ¥¡¥¤¥ë¤ò»ØÄꤷ¤Þ¤¹¡£ ÀßÄê¥Õ¥¡¥¤¥ë¤¬¸«¤Ä¤«¤é¤Ê¤¤¾ì¹ç¤Ï¥¨¥é¡¼½ªÎ»¤Ç¤¹¡£ÀßÄê¥Õ¥¡¥¤¥ë ¤Î»ØÄ꤬¾Êά¤µ¤ì¤¿¾ì¹ç¤Ï /etc/glogger/glogger.conf ¤òÆÉ¤ß¹þ¤ß¤Þ¤¹¡£ ¥Õ¥¡¥¤¥ë̾¤ÎÂå¤ï¤ê¤Ë¥Ï¥¤¥Õ¥ó "-" ¤ò»ØÄꤹ¤ë¤È¡¢É¸½àÆþÎϤ«¤éÀßÄê ¥Õ¥¡¥¤¥ë¤È¤·¤ÆÆÉ¤ß¹þ¤ß¤Þ¤¹¡£

-daemon [output PID file name]

GLogger ¤ò¥Ç¡¼¥â¥ó²½¤·¤Þ¤¹¡£PID¤òÊݸ¤¹¤ë¥Õ¥¡¥¤¥ë¤ò»ØÄꤷ¤Þ¤¹¡£ ¤³¤Î¥ª¥×¥·¥ç¥ó¤¬»ØÄꤵ¤ì¤Ê¤¤¾ì¹ç¤Ï¡¢¸Æ¤Ó½Ð¤µ¤ì¤¿¥·¥§¥ë¤«¤é¤Ï fork() ¤»¤º¡¢É¸½à½ÐÎÏ¤ËÆ°ºî¥í¥°¤¬É½¼¨¤µ¤ì¤Þ¤¹¡£ glogger ¥³¥Þ¥ó¥É¼«ÂÎ¤ÇÆ±»þµ¯Æ°³Îǧ¤Ï¹Ô¤Ê¤¤¤Þ¤»¤ó¡£

-mmap [output filename]

mmap()´Ø¿ô¤ò»È¤¤¡¢-maxsize ¥ª¥×¥·¥ç¥ó¤Ç»ØÄꤷ¤¿¥Õ¥¡¥¤¥ë¥µ¥¤¥º¤Î ¥Õ¥¡¥¤¥ë¤ò³ÎÊݤ·¤Æ¤«¤é¡¢¤½¤Î¥Õ¥¡¥¤¥ë¤Ø½ÐÎϤ·¤Þ¤¹¡£ ÀßÄê¥Õ¥¡¥¤¥ë¤Î path ¹à(¸å½Ò)¤ÎÀßÄê¤Ï̵»ë¤µ¤ì¡¢½ÐÎÏÀè¤Ï output filename ¤Î 1²Õ½ê¤Ø¤Þ¤È¤á¤Æ½ÐÎϤµ¤ì¤ë¤Î¤ÇÃí°Õ¤¬É¬ÍפǤ¹¡£ -maxsize ¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Æ¤¤¤Ê¤¤¤È¤­¤Ï¡¢Ìó 5KB ¤Î¥Õ¥¡¥¤¥ë¤ò³ÎÊݤ·¡¢ ¤½¤ì¤Ë½ÐÎϤ·¤Æ½ªÎ»¤·¤Þ¤¹¡£

-maxsize [output file size]

output file size ¤ÎÂ礭¤µ¤Ë½ÐÎÏ¥Õ¥¡¥¤¥ë¥µ¥¤¥º¤òÀ©¸Â¤·¤Þ¤¹¡£ ÀßÄê¥Õ¥¡¥¤¥ë¤Î maxfilesize ¤è¤ê¤âÍ¥À褵¤ì¤Þ¤¹¡£ ¤³¤Î¥µ¥¤¥º¤òͤ¨¤ë¤È¡¢¿·¤·¤¯¥Õ¥¡¥¤¥ë¤òºîÀ®¤·¡¢¤½¤Î¥Õ¥¡¥¤¥ë¤Ø½ÐÎÏÀè¤ò ÀÚ¤êÂØ¤¨¤Æ¡¢½ÐÎϤò³¤±¤Þ¤¹¡£ ÀßÄê¥Õ¥¡¥¤¥ë¤Î path ÀßÄê¤Î¥ë¡¼¥ë¤Ç»þ¹ï¤òÍѤ¤¤Æ¤â¡¢¤½¤Î»þ¹ï¤´¤È¤Î ¥¿¥¤¥ß¥ó¥°¤Ç¤Ï¤Ê¤¯¡¢output file size ¤òͤ¨¤¿¤È¤­¤Î¤ß¡¢½ÐÎÏÀè¤Î¥Õ¥¡¥¤¥ë ¤òÀÚ¤êÂØ¤¨¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡£ -mmap ¥â¡¼¥É¤Î»þ¤Ï¡¢¤³¤³¤Ç»ØÄꤷ¤¿¥µ¥¤¥º¤Î¥Õ¥¡¥¤¥ë¤¬ºîÀ®¤µ¤ì¤Þ¤¹¡£

-checkconf

ÀßÄê¥Õ¥¡¥¤¥ë¤ÎÆâÍÆ¤ò¥Æ¥­¥¹¥È¤Çɸ½à½ÐÎϤؽÐÎϤ·¤Þ¤¹¡£ ÀßÄê¥Õ¥¡¥¤¥ë¤Îµ­½Ò¤¬´Ö°ã¤Ã¤Æ¤¤¤ì¤Ð¡¢¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤ò½ÐÎϤ·¡¢½ªÎ» ¤·¤Þ¤¹¡£ÀßÄê¥Õ¥¡¥¤¥ë¤ò»ØÄꤹ¤ë¾ì¹ç¤Ï¡¢-config ¥ª¥×¥·¥ç¥ó¤Ç»ØÄꤷ¤Þ¤¹¡£

SIGNAL

glogger¥×¥í¥»¥¹¤Ï¥·¥°¥Ê¥ë¼õÎλþ¡¢°Ê²¼¤Î¤è¤¦¤Ëưºî¤·¤Þ¤¹¡£

SIGHUP

¤Þ¤À±þÅú¤¬Ê֤äƤ­¤Æ¤¤¤Ê¤¤·×¬Âоݥۥ¹¥È¤Ë´Ø¤·¤Æ¤Ï¡¢¤³¤Î¥·¥°¥Ê ¥ë¤ò¼õ¤±¤¿»þÅÀ¤ÇÃæÃǤ·(¥¿¥¤¥à¥¢¥¦¥È°·¤¤¤Ë¤·)¡¢·×¬¥Ç¡¼¥¿¤ò¥Õ¥¡ ¥¤¥ë¤Ø½ÐÎϤ·¤Æ¤«¤é¡¢ºÆµ¯Æ°¤·¤Þ¤¹¡£

SIGINT

¤Þ¤À±þÅú¤¬Ê֤äƤ­¤Æ¤¤¤Ê¤¤·×¬Âоݥۥ¹¥È¤Ë´Ø¤·¤Æ¤Ï¡¢¤³¤Î¥·¥°¥Ê ¥ë¤ò¼õ¤±¤¿»þÅÀ¤ÇÃæÃǤ·(¥¿¥¤¥à¥¢¥¦¥È°·¤¤¤Ë¤·)¡¢·×¬¥Ç¡¼¥¿¤ò¥Õ¥¡ ¥¤¥ë¤Ø½ÐÎϤ·¤Æ½ªÎ»¤·¤Þ¤¹¡£

SEE ALSO

glogdump(8), glogger.conf(5), glogger_logdata(5)

gfarm-2.4.1/snmptool/glogger3/docbook/ja/glogger_logdata.50000644000000000000000000001167711507222726022135 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GLOGGER_LOGDATA" "5" "30 September 2003" "Gfarm" "" .SH NAME glogger_logdata \- GLogger ½ÐÎϥǡ¼¥¿·Á¼° .SH "DESCRIPTION" .PP GLogger ¤¬½ÐÎϤ¹¤ë¥Õ¥¡¥¤¥ë¤Î¥Ç¡¼¥¿¹½Â¤¤Ç¤¹¡£ .TP \fB¥Õ¥¡¥¤¥ë¤Î¥Ç¡¼¥¿¹½Â¤\fR GLogger¤Î´Ñ¬¥í¥°¥Ç¡¼¥¿¥Õ¥¡¥¤¥ë¤Ï¡¢¥á¥¿¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¤È ¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¥°¥ë¡¼¥×¤ÎϢ³¤Ç¹½À®¤µ¤ì¤Þ¤¹¡£ ¥á¥¿¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¤Ï¡¢¥Õ¥¡¥¤¥ë¤ÎÀèÆ¬¤Ë 1¤Ä¸ºß¤·¤Þ¤¹¡£ ¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¥°¥ë¡¼¥×¤Ï¡¢Ê£¿ô¤Î¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¤Ç¹½À®¤µ¤ì¤Þ¤¹¡£ ¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¤Ï¡¢»þ¹ï¤È¤½¤Î»þ¹ï¤Î´Ñ¬¥Ç¡¼¥¿ÃͤÎÎó¤Ç¤¹¡£ ¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¤Î½Ð¸½½ç½ø¤È¡¢´Ñ¬»ö¾Ý¤Î¼ïÎà¤È¤Î´Ø·¸¤Ï¡¢ ¥á¥¿¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯Æâ¤ÇÂбþ¤òÄêµÁ¤·¤Þ¤¹¡£ ¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¥°¥ë¡¼¥×¤Î¥µ¥¤¥º¤Ï¡¢¸ÇÄêŤǤ¢¤ê¡¢ ¥á¥¿¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¤ÇÄêµÁ¤·¤Þ¤¹¡£ ¤¿¤È¤¨¤Ð 1»þ´Öñ°Ì¤Ç¥Õ¥¡¥¤¥ë¤òÀÚ¤êÂØ¤¨¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¤È¤¤¤Ã¤¿ À©Ìó¤Ï¤Ê¤¯¡¢ºÇÂ祵¥¤¥º¤Ï¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë°Í¸¤·¤Þ¤¹¡£ (GLogger ¤Ç¤Ï¡¢»ØÄê¥Õ¥¡¥¤¥ë¥µ¥¤¥º¤Ç¿·¤·¤¤¥Õ¥¡¥¤¥ë¤Ø½ÐÎϤ¹¤ë¤è¤¦¤Ë ÀÚ¤êÂØ¤¨¤ë¤³¤È¤¬²Äǽ¤Ç¤¹) ¤³¤Î¥Ç¡¼¥¿¹½Â¤¤Î¥í¥°¥Õ¥¡¥¤¥ë¤ËÄɵ­¤Ï¤Ç¤­¤Þ¤»¤ó¡£ .TP \fB¥á¥¿¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯\fR ¸ÇÄêĹÉôʬ¤È²ÄÊÑĹÉôʬ¤Ëʬ¤±¤Æ¤¤¤Þ¤¹¡£ .nf 1: ¥á¥¿¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯ 1 [24bytes] 2: ¥á¥¿¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯ 2 [ ²ÄÊÑĹ] .fi .TP \fB¥á¥¿¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯ 1\fR .nf 1: ¥á¥¿¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯ 1 ¤Î¥µ¥¤¥º(°Ê²¼²¿bytes³¤¯¤«) [ 2bytes] 2: ¥Ð¡¼¥¸¥ç¥óÈÖ¹æ [ 2bytes] 3: ¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¥°¥ë¡¼¥×¤Î¥µ¥¤¥º [ 4bytes] 4: ¤³¤Î¥Õ¥¡¥¤¥ë¤Î·×¬³«»ÏÆü»þ(UNIX time ÉÃ) [ 4bytes] 5: ¤³¤Î¥Õ¥¡¥¤¥ë¤Î·×¬³«»ÏÆü»þ(UNIX time ¥Þ¥¤¥¯¥íÉÃ) [ 4bytes] 6: ¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¥°¥ë¡¼¥×¤Ò¤È¤Ä¤Î»þ´Ö´Ö³Ö(ÉÃ) [ 4bytes] 7: ¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¥°¥ë¡¼¥×¤Ò¤È¤Ä¤Î»þ´Ö´Ö³Ö(¥Þ¥¤¥¯¥íÉÃ) [ 4bytes] 8: ͽÌóÎΰè .fi .TP \fB¥á¥¿¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯ 2\fR .nf 1: ¥á¥¿¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯ 2 ¤Î¥µ¥¤¥º(°Ê²¼²¿bytes³¤¯¤«) [ 4bytes] 2: ´Ñ¬Âоݥۥ¹¥ÈÄêµÁÉôʬ ·×¬Âоݥۥ¹¥È¤Î IP ¥¢¥É¥ì¥¹¥ê¥¹¥È¤È ¥Û¥¹¥È̾ (FQDN)¤Èά¾Î¤Î¥ê¥¹¥È¤È¥³¥ß¥å¥Ë¥Æ¥£¥¹¥È¥ê¥ó¥° ¢ªÊ¤ӽç¤Ë¥¤¥ó¥Ç¥Ã¥¯¥¹ÈÖ¹æ(1,2,...) [ ²ÄÊÑĹ] 3: OID ÄêµÁÉôʬ OID ¤È OID ̾¤È OID ά¾Î¤È ¢ªÊ¤ӽç¤Ë OID ¥¤¥ó¥Ç¥Ã¥¯¥¹ÈÖ¹æ(1,2,...) [ ²ÄÊÑĹ] 4: ¬Äꥤ¥ó¥¿¡¼¥Ð¥ëɽ ¾å¤ÇÄêµÁ¤·¤¿¥Û¥¹¥È¥¤¥ó¥Ç¥Ã¥¯¥¹ÈÖ¹æ¤È OID ¥¤¥ó¥Ç¥Ã¥¯¥¹ÈÖ¹æ¤ÎÁȹ礻¤´¤È¤Î ¬Äꥤ¥ó¥¿¡¼¥Ð¥ë(ÉÃ+¥Þ¥¤¥¯¥íÉÃ) [ ²ÄÊÑĹ] 5: ¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¥°¥ë¡¼¥×Âбþɽ [ ²ÄÊÑĹ] 6: ͽÌóÎΰè [ ²ÄÊÑĹ] .fi [²ÄÊÑĹ]¤Ï¡¢¥µ¥¤¥º¤ò2bytes¤Çɽ¤·¤ÆÀèÆ¬¤ËÉղä·¡¢°Ê¹ßǤ°Õ¥Ç¡¼¥¿¤¬Â³¤­¤Þ¤¹¡£ ¤³¤Î2bytes¼«¿È¤Î¥µ¥¤¥º¤Ï´Þ¤Þ¤ì¤Þ¤»¤ó¡£ \fB¥Û¥¹¥ÈÄêµÁÉôʬ:\fR {IP¥¢¥É¥ì¥¹(ʸ»úÎó)}{NULL}{FQDN}{NULL}{ά¾Î}{NULL}{community string}{NULL} ¤Î·«¤êÊÖ¤·¤Ç¤¹¡£IP¥¢¥É¥ì¥¹Éôʬ¤Ï 192.168.0.1 ¤Î¤è¤¦¤Êɽµ­¤Ç¤¹¡£ \fBOIDÄêµÁÉôʬ:\fR {OID̾(ÀßÄê¥Õ¥¡¥¤¥ë¤Ç»ØÄꤷ¤¿Ê¸»úÎó)}{NULL}{ά¾Î}{NULL} ¤Î·«¤êÊÖ¤·¤Ç¤¹¡£ \fB¬Äꥤ¥ó¥¿¡¼¥Ð¥ëɽ:\fR {¥Û¥¹¥È¥¤¥ó¥Ç¥Ã¥¯¥¹ÈÖ¹æ}{OID¥¤¥ó¥Ç¥Ã¥¯¥¹ÈÖ¹æ}{»þ´Ö(8bytes)} ¤Î·«¤êÊÖ¤·¤Ç¤¹¡£ »þ´Ö¤ÏÉä¬ 4bytes, ¥Þ¥¤¥¯¥íÉä¬ 4bytes¤Î½ç¤Ç¹ç·× 8bytes ¤Ç¤¹¡£ \fB¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¥°¥ë¡¼¥×Âбþɽ:\fR {¸Ä¿ô(n¸Ä) 2bytes}{(¥Û¥¹¥È¥¤¥ó¥Ç¥Ã¥¯¥¹ÈÖ¹æ + OID¥¤¥ó¥Ç¥Ã¥¯¥¹ÈÖ¹æ) * n} ¤Î·«¤êÊÖ¤·¤Ç¤¹¡£ 1¤Ä¤Î¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¥°¥ë¡¼¥×Æâ¤Î¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¤Î½Ð¸½½ç½ø¤ò ÄêµÁ¤·¤¿É½¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£ ¸Ä¿ô¤Ï¡¢Âбþ¤¹¤ë¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯Æâ¤Î¥Ç¡¼¥¿¤Î¸Ä¿ô(¥Û¥¹¥È¥¤¥ó¥Ç¥Ã¥¯¥¹ÈÖ¹æ¤È OID¥¤¥ó¥Ç¥Ã¥¯¥¹ÈÖ¹æ¤ÎÁȤ¢¤ï¤»¤Î¸Ä¿ô)¤ò¼¨¤·¤Þ¤¹¡£ ¸Ä¿ô¤¬ 0¤Î¾ì¹ç¡¢¤½¤Î¥¿¥¤¥ß¥ó¥°¤Ç¤Ï¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¤¬½Ð¸½¤·¤Ê¤¤ (»þ¹ï¥Ç¡¼¥¿¤¹¤é½Ð¸½¤·¤Ê¤¤)¤³¤È¤ò¼¨¤·¡¢Âбþ¤¹¤ë¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¤Ï¸ºß¤·¤Þ¤»¤ó¡£ ¥¤¥ó¥Ç¥Ã¥¯¥¹ÈÖ¹æ¤Ï¡¢2bytes = 0¡Á65535 ¤Ç¤¹¡£ .TP \fB¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¥°¥ë¡¼¥×\fR ¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¥°¥ë¡¼¥×Âбþɽ¤Î½çÈ֤ˡ¢¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¤¬Â³¤­¤Þ¤¹¡£ ¤¹¤Ù¤Æ¤Î¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¤Î¼ïÎà¤Î½Ð¸½¥Ñ¥¿¡¼¥ó 1¼þ´ü¤ò¼¨¤·¤Þ¤¹¡£ (¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¤Ë¤Ï¡¢Æ±»þ¹ï¤Î·×¬¥Ç¡¼¥¿¤¬¤Þ¤È¤á¤é¤ì¤Æ¤¤¤Þ¤¹¡£) ¤³¤ÎÏÀÍýŪ¤Ë¤Þ¤È¤á¤¿ 1¼þ´ü¤ò¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¥°¥ë¡¼¥×¤È¤·¤Æ¤¤¤Þ¤¹¡£ ¤è¤Ã¤Æ¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¥°¥ë¡¼¥×¤È¼¡¤Î¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¥°¥ë¡¼¥×¤Î´Ö¤Ë¤Ï¡¢ ¶èÀÚ¤ê¤Î¤¿¤á¤Î¥Ç¡¼¥¿¤Ï¸ºß¤·¤Þ¤»¤ó¡£ .nf 1: ¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯ 2: °Ê²¼¡¢¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¤Î·«¤êÊÖ¤· .fi .TP \fB¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯\fR Ʊ»þ¹ï¤Î³ÆÂ¬ÄêÃͤ¬°ì¤Ä¤Ë¤Þ¤È¤Þ¤Ã¤¿¥Ç¡¼¥¿¤ÎÁȤˤʤäƤ¤¤Þ¤¹¡£ ·×¬¥Ç¡¼¥¿¤Î̵¤¤»þ¹ï¤Ë¤Ï¡¢¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¤Ï½Ð¸½¤·¤Þ¤»¤ó (»þ¹ï¥Ç¡¼¥¿¤â½Ð¸½¤·¤Þ¤»¤ó)¡£ ¤Ò¤È¤Ä¤Î¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¤Ï²ÄÊÑŤǤ¹¤¬¡¢¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¥°¥ë¡¼¥×Âбþɽ¤«¤é¡¢ ¥µ¥¤¥º¤¬·èÄê¤Ç¤­¤Þ¤¹¡£ ¤Ò¤È¤Ä¤Î¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¥µ¥¤¥º = »þ¹ï¥Ç¡¼¥¿ 8bytes + ·×¬¥Ç¡¼¥¿¤Î¸Ä¿ô(n¸Ä) * 5bytes ¤È¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£ ·×¬¥Ç¡¼¥¿¤¬Ìµ¤¤»þ¹ï¤Î¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¤Ï¸ºß¤·¤Þ¤»¤ó¡£ .nf 1: ¤³¤Î¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¤Î·×¬»þ¹ï(UNIX time ÉÃ) [ 4bytes] 2: ¤³¤Î¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¤Î·×¬»þ¹ï(UNIX time ¥Þ¥¤¥¯¥íÉÃ) [ 4bytes] 3: 1ÈÖÌܤη׬¥Ç¡¼¥¿¥Õ¥é¥° [ 1bytes] 4: 1ÈÖÌܤη׬¥Ç¡¼¥¿ [ 4bytes] 5: °Ê²¼Æ±°ì»þ¹ï¤Î·×¬¥Ç¡¼¥¿¥Õ¥é¥°¡¢¥Ç¡¼¥¿¤Î·«¤êÊÖ¤· n: ͽÌóÎΰè .fi ¢¨ Îã: 256 ¥Î¡¼¥É¤Î¾ì¹ç¡¢¹ç·× 1288 ¥Ð¥¤¥È .nf ¥Ç¡¼¥¿¥Õ¥é¥°¤Î³Æ¥Ó¥Ã¥È¤Î°ÕÌ£(²¼°Ì¥Ó¥Ã¥È¤«¤é½ç¤Ë) ¥Ç¡¼¥¿Í­¸ú 1 ̵¸ú 0 (¥¿¥¤¥à¥¢¥¦¥È¤Î¾ì¹ç¤âÍ­¸ú) ¬ÄêÀ®¸ù 1 ¼ºÇÔ 0 (¥¿¥¤¥à¥¢¥¦¥È¤Ï¼ºÇÔ) .fi .SH "SEE ALSO" .PP \fBglogger\fR(8) gfarm-2.4.1/snmptool/glogger3/docbook/ja/glogger_logdata.5.html0000644000000000000000000001736511507222726023100 0ustar rootroot glogger_logdata

glogger_logdata

Name

glogger_logdata -- GLogger ½ÐÎϥǡ¼¥¿·Á¼°

DESCRIPTION

GLogger ¤¬½ÐÎϤ¹¤ë¥Õ¥¡¥¤¥ë¤Î¥Ç¡¼¥¿¹½Â¤¤Ç¤¹¡£

¥Õ¥¡¥¤¥ë¤Î¥Ç¡¼¥¿¹½Â¤

GLogger¤Î´Ñ¬¥í¥°¥Ç¡¼¥¿¥Õ¥¡¥¤¥ë¤Ï¡¢¥á¥¿¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¤È ¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¥°¥ë¡¼¥×¤ÎϢ³¤Ç¹½À®¤µ¤ì¤Þ¤¹¡£

¥á¥¿¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¤Ï¡¢¥Õ¥¡¥¤¥ë¤ÎÀèÆ¬¤Ë 1¤Ä¸ºß¤·¤Þ¤¹¡£

¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¥°¥ë¡¼¥×¤Ï¡¢Ê£¿ô¤Î¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¤Ç¹½À®¤µ¤ì¤Þ¤¹¡£

¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¤Ï¡¢»þ¹ï¤È¤½¤Î»þ¹ï¤Î´Ñ¬¥Ç¡¼¥¿ÃͤÎÎó¤Ç¤¹¡£

¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¤Î½Ð¸½½ç½ø¤È¡¢´Ñ¬»ö¾Ý¤Î¼ïÎà¤È¤Î´Ø·¸¤Ï¡¢ ¥á¥¿¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯Æâ¤ÇÂбþ¤òÄêµÁ¤·¤Þ¤¹¡£

¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¥°¥ë¡¼¥×¤Î¥µ¥¤¥º¤Ï¡¢¸ÇÄêŤǤ¢¤ê¡¢ ¥á¥¿¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¤ÇÄêµÁ¤·¤Þ¤¹¡£

¤¿¤È¤¨¤Ð 1»þ´Öñ°Ì¤Ç¥Õ¥¡¥¤¥ë¤òÀÚ¤êÂØ¤¨¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¤È¤¤¤Ã¤¿ À©Ìó¤Ï¤Ê¤¯¡¢ºÇÂ祵¥¤¥º¤Ï¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë°Í¸¤·¤Þ¤¹¡£ (GLogger ¤Ç¤Ï¡¢»ØÄê¥Õ¥¡¥¤¥ë¥µ¥¤¥º¤Ç¿·¤·¤¤¥Õ¥¡¥¤¥ë¤Ø½ÐÎϤ¹¤ë¤è¤¦¤Ë ÀÚ¤êÂØ¤¨¤ë¤³¤È¤¬²Äǽ¤Ç¤¹)

¤³¤Î¥Ç¡¼¥¿¹½Â¤¤Î¥í¥°¥Õ¥¡¥¤¥ë¤ËÄɵ­¤Ï¤Ç¤­¤Þ¤»¤ó¡£

¥á¥¿¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯

¸ÇÄêĹÉôʬ¤È²ÄÊÑĹÉôʬ¤Ëʬ¤±¤Æ¤¤¤Þ¤¹¡£

1: ¥á¥¿¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯ 1        [24bytes]
2: ¥á¥¿¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯ 2        [ ²ÄÊÑĹ]

¥á¥¿¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯ 1

1: ¥á¥¿¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯ 1 ¤Î¥µ¥¤¥º(°Ê²¼²¿bytes³¤¯¤«)   [ 2bytes]
2: ¥Ð¡¼¥¸¥ç¥óÈֹ栠                                   [ 2bytes]
3: ¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¥°¥ë¡¼¥×¤Î¥µ¥¤¥º                     [ 4bytes]
4: ¤³¤Î¥Õ¥¡¥¤¥ë¤Î·×¬³«»ÏÆü»þ(UNIX time ÉÃ)           [ 4bytes]
5: ¤³¤Î¥Õ¥¡¥¤¥ë¤Î·×¬³«»ÏÆü»þ(UNIX time ¥Þ¥¤¥¯¥íÉÃ)   [ 4bytes]
6: ¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¥°¥ë¡¼¥×¤Ò¤È¤Ä¤Î»þ´Ö´Ö³Ö(ÉÃ)         [ 4bytes]
7: ¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¥°¥ë¡¼¥×¤Ò¤È¤Ä¤Î»þ´Ö´Ö³Ö(¥Þ¥¤¥¯¥íÉÃ) [ 4bytes]
8: Í½ÌóÎΰè

¥á¥¿¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯ 2

1: ¥á¥¿¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯ 2 ¤Î¥µ¥¤¥º(°Ê²¼²¿bytes³¤¯¤«)   [ 4bytes]
2: ´Ñ¬Âоݥۥ¹¥ÈÄêµÁÉôʬ
   ·×¬Âоݥۥ¹¥È¤Î IP ¥¢¥É¥ì¥¹¥ê¥¹¥È¤È
   ¥Û¥¹¥È̾ (FQDN)¤Èά¾Î¤Î¥ê¥¹¥È¤È¥³¥ß¥å¥Ë¥Æ¥£¥¹¥È¥ê¥ó¥°
   ¢ªÊ¤ӽç¤Ë¥¤¥ó¥Ç¥Ã¥¯¥¹ÈÖ¹æ(1,2,...)                [ ²ÄÊÑĹ]
3: OID ÄêµÁÉôʬ
   OID ¤È OID Ì¾¤È OID Î¬¾Î¤È
   ¢ªÊ¤ӽç¤Ë OID ¥¤¥ó¥Ç¥Ã¥¯¥¹ÈÖ¹æ(1,2,...)           [ ²ÄÊÑĹ]
4: Â¬Äꥤ¥ó¥¿¡¼¥Ð¥ëɽ
   ¾å¤ÇÄêµÁ¤·¤¿¥Û¥¹¥È¥¤¥ó¥Ç¥Ã¥¯¥¹ÈÖ¹æ¤È
   OID ¥¤¥ó¥Ç¥Ã¥¯¥¹ÈÖ¹æ¤ÎÁȹ礻¤´¤È¤Î
   Â¬Äꥤ¥ó¥¿¡¼¥Ð¥ë(ÉÃ+¥Þ¥¤¥¯¥íÉÃ)                    [ ²ÄÊÑĹ]
5: ¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¥°¥ë¡¼¥×Âбþɽ                       [ ²ÄÊÑĹ]
6: Í½ÌóÎΰ蠠                                         [ ²ÄÊÑĹ] 

[²ÄÊÑĹ]¤Ï¡¢¥µ¥¤¥º¤ò2bytes¤Çɽ¤·¤ÆÀèÆ¬¤ËÉղä·¡¢°Ê¹ßǤ°Õ¥Ç¡¼¥¿¤¬Â³¤­¤Þ¤¹¡£ ¤³¤Î2bytes¼«¿È¤Î¥µ¥¤¥º¤Ï´Þ¤Þ¤ì¤Þ¤»¤ó¡£

¥Û¥¹¥ÈÄêµÁÉôʬ: {IP¥¢¥É¥ì¥¹(ʸ»úÎó)}{NULL}{FQDN}{NULL}{ά¾Î}{NULL}{community string}{NULL} ¤Î·«¤êÊÖ¤·¤Ç¤¹¡£IP¥¢¥É¥ì¥¹Éôʬ¤Ï 192.168.0.1 ¤Î¤è¤¦¤Êɽµ­¤Ç¤¹¡£

OIDÄêµÁÉôʬ: {OID̾(ÀßÄê¥Õ¥¡¥¤¥ë¤Ç»ØÄꤷ¤¿Ê¸»úÎó)}{NULL}{ά¾Î}{NULL} ¤Î·«¤êÊÖ¤·¤Ç¤¹¡£

¬Äꥤ¥ó¥¿¡¼¥Ð¥ëɽ: {¥Û¥¹¥È¥¤¥ó¥Ç¥Ã¥¯¥¹ÈÖ¹æ}{OID¥¤¥ó¥Ç¥Ã¥¯¥¹ÈÖ¹æ}{»þ´Ö(8bytes)} ¤Î·«¤êÊÖ¤·¤Ç¤¹¡£ »þ´Ö¤ÏÉä¬ 4bytes, ¥Þ¥¤¥¯¥íÉä¬ 4bytes¤Î½ç¤Ç¹ç·× 8bytes ¤Ç¤¹¡£

¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¥°¥ë¡¼¥×Âбþɽ: {¸Ä¿ô(n¸Ä) 2bytes}{(¥Û¥¹¥È¥¤¥ó¥Ç¥Ã¥¯¥¹ÈÖ¹æ + OID¥¤¥ó¥Ç¥Ã¥¯¥¹ÈÖ¹æ) * n} ¤Î·«¤êÊÖ¤·¤Ç¤¹¡£ 1¤Ä¤Î¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¥°¥ë¡¼¥×Æâ¤Î¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¤Î½Ð¸½½ç½ø¤ò ÄêµÁ¤·¤¿É½¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£ ¸Ä¿ô¤Ï¡¢Âбþ¤¹¤ë¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯Æâ¤Î¥Ç¡¼¥¿¤Î¸Ä¿ô(¥Û¥¹¥È¥¤¥ó¥Ç¥Ã¥¯¥¹ÈÖ¹æ¤È OID¥¤¥ó¥Ç¥Ã¥¯¥¹ÈÖ¹æ¤ÎÁȤ¢¤ï¤»¤Î¸Ä¿ô)¤ò¼¨¤·¤Þ¤¹¡£ ¸Ä¿ô¤¬ 0¤Î¾ì¹ç¡¢¤½¤Î¥¿¥¤¥ß¥ó¥°¤Ç¤Ï¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¤¬½Ð¸½¤·¤Ê¤¤ (»þ¹ï¥Ç¡¼¥¿¤¹¤é½Ð¸½¤·¤Ê¤¤)¤³¤È¤ò¼¨¤·¡¢Âбþ¤¹¤ë¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¤Ï¸ºß¤·¤Þ¤»¤ó¡£

¥¤¥ó¥Ç¥Ã¥¯¥¹ÈÖ¹æ¤Ï¡¢2bytes = 0¡Á65535 ¤Ç¤¹¡£

¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¥°¥ë¡¼¥×

¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¥°¥ë¡¼¥×Âбþɽ¤Î½çÈ֤ˡ¢¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¤¬Â³¤­¤Þ¤¹¡£ ¤¹¤Ù¤Æ¤Î¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¤Î¼ïÎà¤Î½Ð¸½¥Ñ¥¿¡¼¥ó 1¼þ´ü¤ò¼¨¤·¤Þ¤¹¡£ (¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¤Ë¤Ï¡¢Æ±»þ¹ï¤Î·×¬¥Ç¡¼¥¿¤¬¤Þ¤È¤á¤é¤ì¤Æ¤¤¤Þ¤¹¡£) ¤³¤ÎÏÀÍýŪ¤Ë¤Þ¤È¤á¤¿ 1¼þ´ü¤ò¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¥°¥ë¡¼¥×¤È¤·¤Æ¤¤¤Þ¤¹¡£ ¤è¤Ã¤Æ¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¥°¥ë¡¼¥×¤È¼¡¤Î¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¥°¥ë¡¼¥×¤Î´Ö¤Ë¤Ï¡¢ ¶èÀÚ¤ê¤Î¤¿¤á¤Î¥Ç¡¼¥¿¤Ï¸ºß¤·¤Þ¤»¤ó¡£

1: ¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯
2: °Ê²¼¡¢¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¤Î·«¤êÊÖ¤·

¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯

Ʊ»þ¹ï¤Î³ÆÂ¬ÄêÃͤ¬°ì¤Ä¤Ë¤Þ¤È¤Þ¤Ã¤¿¥Ç¡¼¥¿¤ÎÁȤˤʤäƤ¤¤Þ¤¹¡£ ·×¬¥Ç¡¼¥¿¤Î̵¤¤»þ¹ï¤Ë¤Ï¡¢¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¤Ï½Ð¸½¤·¤Þ¤»¤ó (»þ¹ï¥Ç¡¼¥¿¤â½Ð¸½¤·¤Þ¤»¤ó)¡£

¤Ò¤È¤Ä¤Î¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¤Ï²ÄÊÑŤǤ¹¤¬¡¢¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¥°¥ë¡¼¥×Âбþɽ¤«¤é¡¢ ¥µ¥¤¥º¤¬·èÄê¤Ç¤­¤Þ¤¹¡£ ¤Ò¤È¤Ä¤Î¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¥µ¥¤¥º = »þ¹ï¥Ç¡¼¥¿ 8bytes + ·×¬¥Ç¡¼¥¿¤Î¸Ä¿ô(n¸Ä) * 5bytes ¤È¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£ ·×¬¥Ç¡¼¥¿¤¬Ìµ¤¤»þ¹ï¤Î¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¤Ï¸ºß¤·¤Þ¤»¤ó¡£

1: ¤³¤Î¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¤Î·×¬»þ¹ï(UNIX time ÉÃ)         [ 4bytes]
2: ¤³¤Î¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¤Î·×¬»þ¹ï(UNIX time ¥Þ¥¤¥¯¥íÉÃ) [ 4bytes]
3: 1ÈÖÌܤη׬¥Ç¡¼¥¿¥Õ¥é¥°                            [ 1bytes]
4: 1ÈÖÌܤη׬¥Ç¡¼¥¿                                  [ 4bytes]
5: °Ê²¼Æ±°ì»þ¹ï¤Î·×¬¥Ç¡¼¥¿¥Õ¥é¥°¡¢¥Ç¡¼¥¿¤Î·«¤êÊÖ¤·
n: Í½ÌóÎΰè

¢¨ Îã: 256 ¥Î¡¼¥É¤Î¾ì¹ç¡¢¹ç·× 1288 ¥Ð¥¤¥È

¥Ç¡¼¥¿¥Õ¥é¥°¤Î³Æ¥Ó¥Ã¥È¤Î°ÕÌ£(²¼°Ì¥Ó¥Ã¥È¤«¤é½ç¤Ë)
¥Ç¡¼¥¿Í­¸ú 1 Ìµ¸ú 0 (¥¿¥¤¥à¥¢¥¦¥È¤Î¾ì¹ç¤âÍ­¸ú)
¬ÄêÀ®¸ù   1 ¼ºÇÔ 0 (¥¿¥¤¥à¥¢¥¦¥È¤Ï¼ºÇÔ)

SEE ALSO

glogger(8)

gfarm-2.4.1/snmptool/glogger3/docbook/ja/glogger.80000644000000000000000000000623611507222726020440 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GLOGGER" "8" "30 September 2003" "snmptool" "" .SH NAME glogger \- SNMP ¤Î GET ¥ê¥¯¥¨¥¹¥È¤Ç³Æ¥Û¥¹¥È¤Î¾ðÊó¤ò½¸¤á¤ë .SH SYNOPSIS \fBglogger\fR [ \fB\fI¥ª¥×¥·¥ç¥ó\fB\fR ] .SH "DESCRIPTION" .PP ¥×¥í¥°¥é¥à glogger ¤Ï¡¢SNMP GET¥ê¥¯¥¨¥¹¥È¤ò»È¤Ã¤Æ¡¢¥Í¥Ã¥È¥ï¡¼¥¯¾å ¤Ë¤¢¤ë³Æ¥Û¥¹¥È¤«¤é¾ðÊó¤ò½¸¤á¡¢´Ñ¬¥Ç¡¼¥¿¤È¤·¤Æ¥Õ¥¡¥¤¥ë¤Ø½ÐÎϤ·¤Þ¤¹¡£ ÀßÄê¥Õ¥¡¥¤¥ë¤Ç»ØÄꤷ¤¿´Ñ¬¥¤¥ó¥¿¡¼¥Ð¥ë¤´¤È¤Ë¡¢³Æ¥Û¥¹¥È¤ËÂФ·¤Æ GET¥ê¥¯¥¨¥¹¥È¤·¡¢È¿±þ¤ÎÁᤫ¤Ã¤¿¥Û¥¹¥È¤«¤é½çÈ֤˼õ¿®¡¢½ÐÎϽèÍý¤ò¤·¤Þ¤¹¡£ °ì¤Ä¤Î¥Û¥¹¥È¤ËÂФ·¤Æ¡¢Ê£¿ô¤ÎOID¤ò°ì¤Ä¤Î¥Ñ¥±¥Ã¥È¤Ç¥ê¥¯¥¨¥¹¥È¤·¡¢°ì¤Ä¤Î ¥Ñ¥±¥Ã¥È¤Ç MIB¤«¤é¤ÎÃͤò¼õ¿®¤·¤Þ¤¹¡£ ´Ñ¬ÂоݤΥۥ¹¥È¡¢¥¹¥¤¥Ã¥Á¤Ê¤É¤Ï¡¢¤½¤ì¤¾¤ì SNMP¥¨¡¼¥¸¥§¥ó¥È¤¬Æ°ºî¤·¡¢ ´Ñ¬¤¹¤ë MIB¥Ä¥ê¡¼¤Î OID¤ò GLogger ¤òưºî¤µ¤»¤ë¥Û¥¹¥È¤«¤é»²¾È¤Ç¤­¤ë¤è¤¦¤Ë ¤·¤Æ¤ª¤¯É¬Íפ¬¤¢¤ê¤Þ¤¹¡£ SNMP¤Î¥Ð¡¼¥¸¥ç¥ó¤Ï SNMPv1 ¸ÇÄê¤Ç¤¹¡£ .SH "OPTIONS" .TP \fB-config [input configuration file name]\fR GLogger ¤ÎÀßÄê¥Õ¥¡¥¤¥ë¤ò»ØÄꤷ¤Þ¤¹¡£ ÀßÄê¥Õ¥¡¥¤¥ë¤¬¸«¤Ä¤«¤é¤Ê¤¤¾ì¹ç¤Ï¥¨¥é¡¼½ªÎ»¤Ç¤¹¡£ÀßÄê¥Õ¥¡¥¤¥ë ¤Î»ØÄ꤬¾Êά¤µ¤ì¤¿¾ì¹ç¤Ï /etc/glogger/glogger.conf ¤òÆÉ¤ß¹þ¤ß¤Þ¤¹¡£ ¥Õ¥¡¥¤¥ë̾¤ÎÂå¤ï¤ê¤Ë¥Ï¥¤¥Õ¥ó "-" ¤ò»ØÄꤹ¤ë¤È¡¢É¸½àÆþÎϤ«¤éÀßÄê ¥Õ¥¡¥¤¥ë¤È¤·¤ÆÆÉ¤ß¹þ¤ß¤Þ¤¹¡£ .TP \fB -daemon [output PID file name]\fR GLogger ¤ò¥Ç¡¼¥â¥ó²½¤·¤Þ¤¹¡£PID¤òÊݸ¤¹¤ë¥Õ¥¡¥¤¥ë¤ò»ØÄꤷ¤Þ¤¹¡£ ¤³¤Î¥ª¥×¥·¥ç¥ó¤¬»ØÄꤵ¤ì¤Ê¤¤¾ì¹ç¤Ï¡¢¸Æ¤Ó½Ð¤µ¤ì¤¿¥·¥§¥ë¤«¤é¤Ï fork() ¤»¤º¡¢É¸½à½ÐÎÏ¤ËÆ°ºî¥í¥°¤¬É½¼¨¤µ¤ì¤Þ¤¹¡£ glogger ¥³¥Þ¥ó¥É¼«ÂÎ¤ÇÆ±»þµ¯Æ°³Îǧ¤Ï¹Ô¤Ê¤¤¤Þ¤»¤ó¡£ .TP \fB -mmap [output filename]\fR mmap()´Ø¿ô¤ò»È¤¤¡¢-maxsize ¥ª¥×¥·¥ç¥ó¤Ç»ØÄꤷ¤¿¥Õ¥¡¥¤¥ë¥µ¥¤¥º¤Î ¥Õ¥¡¥¤¥ë¤ò³ÎÊݤ·¤Æ¤«¤é¡¢¤½¤Î¥Õ¥¡¥¤¥ë¤Ø½ÐÎϤ·¤Þ¤¹¡£ ÀßÄê¥Õ¥¡¥¤¥ë¤Î path ¹à(¸å½Ò)¤ÎÀßÄê¤Ï̵»ë¤µ¤ì¡¢½ÐÎÏÀè¤Ï output filename ¤Î 1²Õ½ê¤Ø¤Þ¤È¤á¤Æ½ÐÎϤµ¤ì¤ë¤Î¤ÇÃí°Õ¤¬É¬ÍפǤ¹¡£ -maxsize ¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Æ¤¤¤Ê¤¤¤È¤­¤Ï¡¢Ìó 5KB ¤Î¥Õ¥¡¥¤¥ë¤ò³ÎÊݤ·¡¢ ¤½¤ì¤Ë½ÐÎϤ·¤Æ½ªÎ»¤·¤Þ¤¹¡£ .TP \fB-maxsize [output file size]\fR output file size ¤ÎÂ礭¤µ¤Ë½ÐÎÏ¥Õ¥¡¥¤¥ë¥µ¥¤¥º¤òÀ©¸Â¤·¤Þ¤¹¡£ ÀßÄê¥Õ¥¡¥¤¥ë¤Î maxfilesize ¤è¤ê¤âÍ¥À褵¤ì¤Þ¤¹¡£ ¤³¤Î¥µ¥¤¥º¤òͤ¨¤ë¤È¡¢¿·¤·¤¯¥Õ¥¡¥¤¥ë¤òºîÀ®¤·¡¢¤½¤Î¥Õ¥¡¥¤¥ë¤Ø½ÐÎÏÀè¤ò ÀÚ¤êÂØ¤¨¤Æ¡¢½ÐÎϤò³¤±¤Þ¤¹¡£ ÀßÄê¥Õ¥¡¥¤¥ë¤Î path ÀßÄê¤Î¥ë¡¼¥ë¤Ç»þ¹ï¤òÍѤ¤¤Æ¤â¡¢¤½¤Î»þ¹ï¤´¤È¤Î ¥¿¥¤¥ß¥ó¥°¤Ç¤Ï¤Ê¤¯¡¢output file size ¤òͤ¨¤¿¤È¤­¤Î¤ß¡¢½ÐÎÏÀè¤Î¥Õ¥¡¥¤¥ë ¤òÀÚ¤êÂØ¤¨¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡£ -mmap ¥â¡¼¥É¤Î»þ¤Ï¡¢¤³¤³¤Ç»ØÄꤷ¤¿¥µ¥¤¥º¤Î¥Õ¥¡¥¤¥ë¤¬ºîÀ®¤µ¤ì¤Þ¤¹¡£ .TP \fB-checkconf\fR ÀßÄê¥Õ¥¡¥¤¥ë¤ÎÆâÍÆ¤ò¥Æ¥­¥¹¥È¤Çɸ½à½ÐÎϤؽÐÎϤ·¤Þ¤¹¡£ ÀßÄê¥Õ¥¡¥¤¥ë¤Îµ­½Ò¤¬´Ö°ã¤Ã¤Æ¤¤¤ì¤Ð¡¢¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤ò½ÐÎϤ·¡¢½ªÎ» ¤·¤Þ¤¹¡£ÀßÄê¥Õ¥¡¥¤¥ë¤ò»ØÄꤹ¤ë¾ì¹ç¤Ï¡¢-config ¥ª¥×¥·¥ç¥ó¤Ç»ØÄꤷ¤Þ¤¹¡£ .SH "SIGNAL" .PP glogger¥×¥í¥»¥¹¤Ï¥·¥°¥Ê¥ë¼õÎλþ¡¢°Ê²¼¤Î¤è¤¦¤Ëưºî¤·¤Þ¤¹¡£ .TP \fBSIGHUP\fR ¤Þ¤À±þÅú¤¬Ê֤äƤ­¤Æ¤¤¤Ê¤¤·×¬Âоݥۥ¹¥È¤Ë´Ø¤·¤Æ¤Ï¡¢¤³¤Î¥·¥°¥Ê ¥ë¤ò¼õ¤±¤¿»þÅÀ¤ÇÃæÃǤ·(¥¿¥¤¥à¥¢¥¦¥È°·¤¤¤Ë¤·)¡¢·×¬¥Ç¡¼¥¿¤ò¥Õ¥¡ ¥¤¥ë¤Ø½ÐÎϤ·¤Æ¤«¤é¡¢ºÆµ¯Æ°¤·¤Þ¤¹¡£ .TP \fBSIGINT\fR ¤Þ¤À±þÅú¤¬Ê֤äƤ­¤Æ¤¤¤Ê¤¤·×¬Âоݥۥ¹¥È¤Ë´Ø¤·¤Æ¤Ï¡¢¤³¤Î¥·¥°¥Ê ¥ë¤ò¼õ¤±¤¿»þÅÀ¤ÇÃæÃǤ·(¥¿¥¤¥à¥¢¥¦¥È°·¤¤¤Ë¤·)¡¢·×¬¥Ç¡¼¥¿¤ò¥Õ¥¡ ¥¤¥ë¤Ø½ÐÎϤ·¤Æ½ªÎ»¤·¤Þ¤¹¡£ .SH "SEE ALSO" .PP \fBglogdump\fR(8), \fBglogger.conf\fR(5), \fBglogger_logdata\fR(5) gfarm-2.4.1/snmptool/glogger3/docbook/ja/glogger.conf.50000644000000000000000000002022411507222726021352 0ustar rootroot.\" This manpage has been automatically generated by docbook2man .\" from a DocBook document. This tool can be found at: .\" .\" Please send any bug reports, improvements, comments, patches, .\" etc. to Steve Cheng . .TH "GLOGGER.CONF" "5" "30 September 2003" "Gfarm" "" .SH NAME glogger.conf \- GLogger ÀßÄê¥Õ¥¡¥¤¥ë .SH "DESCRIPTION" .PP glogger.conf ¥Õ¥¡¥¤¥ë¤Ï¡¢glogger ¥×¥í¥°¥é¥à¤ÎÀßÄê¥Õ¥¡¥¤¥ë¤Ç¤¹¡£ ¤Ê¤ª¡¢ÀßÄêÆâÍÆ¤òÊѹ¹¤·¤¿¾ì¹ç¤Ï¡¢glogger ¤òºÆµ¯Æ°¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£ .PP glogger ¤Ï¡¢ÀßÄê¥Õ¥¡¥¤¥ë¤È¤·¤Æ¡¢/etc/glogger/glogger.conf ¤òÆÉ¤ß¹þ¤ß¤Þ¤¹¡£ -config ¥ª¥×¥·¥ç¥ó¤ÇÀßÄê¥Õ¥¡¥¤¥ë¤ò»ØÄꤹ¤ë¤È¡¢¤½¤ì¤¬Í¥À褵¤ì¤Þ¤¹¡£ .PP glogger ¤ÎÀßÄê¥Õ¥¡¥¤¥ë¤Ï¡¢°Ê²¼¤Î¹½Â¤¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£ .PP * ÀßÄê¥Õ¥¡¥¤¥ë¤Ïñ°ì¥Õ¥¡¥¤¥ë¤È¤¹¤ë¡£ .PP * ³ÆÀßÄê¹àÌܤϡ¢ÀßÄê̾¤È¤½¤ÎÃͤòȾ³Ñ¥¹¥Ú¡¼¥¹°ì¤Ä°Ê¾å¤Ç¶èÀڤꡢ¤½¤ì¤¾¤ì³Æ¹Ô¤Ëµ­½Ò¤¹¤ë¡£ .PP * ¶èÀÚ¤ê°Ê³°¤ÎȾ³Ñ¥¹¥Ú¡¼¥¹¡¢¥¿¥Ö¤Ï̵»ë¤¹¤ë¡£ .PP * ³Æ¹Ô¤Î '#' °Ê¹ß¤Ï¥³¥á¥ó¥È¤È¤¹¤ë¡£ .PP * ³Æ¹Ô¤Ï 1024 ʸ»ú¤Þ¤Ç¤È¤¹¤ë¡£ .PP * ¥Ö¥í¥Ã¥¯¤Ï '¥Ö¥í¥Ã¥¯Ì¾ {' ¹Ô¤Ç¤Ï¤¸¤Þ¤ê¡¢'}' ¹Ô¤Ç½ªÎ»¤¹¤ë¡£ .PP * ¥Ö¥í¥Ã¥¯Æâ¤Ë¤Ï¡¢¤½¤Î¥Ö¥í¥Ã¥¯¤Ëµ­½Ò¤¬µö²Ä¤µ¤ì¤Æ¤¤¤ë¡¢ÀßÄê¹àÌܤȥ֥í¥Ã¥¯¤òµ­½Ò¤Ç¤­¤ë¡£ .PP * ¥Õ¥¡¥¤¥ë¤ÎÀèÆ¬¤«¤é¥Ö¥í¥Ã¥¯¤Ë¤Ê¤Ã¤Æ¤¤¤Ê¤¤Éôʬ¤ò global default ¥Ö¥í¥Ã¥¯¤È¸Æ¤Ö¡£ .PP * global default ¥Ö¥í¥Ã¥¯°Ê¹ß¤Ë¡¢requests ¥Ö¥í¥Ã¥¯¤òÊ£¿ôµ­½Ò¤Ç¤­¤ë¡£ .PP * nodes ¥Ö¥í¥Ã¥¯¤Ï requests ¥Ö¥í¥Ã¥¯Æâ¤Ë°ì¤Äµ­½Ò¤Ç¤­¤ë¡£ .PP * mib ¥Ö¥í¥Ã¥¯¤Ï nodes ¥Ö¥í¥Ã¥¯¤Î¸å¤Ëµ­½Ò¤·¡¢requests ¥Ö¥í¥Ã¥¯Æâ¤ËÊ£¿ôµ­½Ò¤Ç¤­¤ë¡£ .PP * oids ¥Ö¥í¥Ã¥¯¤Ï mib ¥Ö¥í¥Ã¥¯Æâ¤Ë°ì¤Äµ­½Ò¤Ç¤­¤ë¡£ .PP * ¥Ö¥í¥Ã¥¯Æâ¤Ë¥Ö¥í¥Ã¥¯¤¬¤¢¤ë¾ì¹ç¤Ï¡¢ ¥Ö¥í¥Ã¥¯¤òÄêµÁ¤¹¤ëÁ°¤Ë¹Ô¤Ã¤¿ÀßÄê¹àÌܤò¡¢ °Ê¹ß¥Í¥¹¥È¤·¤¿¥Ö¥í¥Ã¥¯Æâ¤ÎÀßÄê¹àÌܤȤ·¤Æ°ú¤­·Ñ¤®¡¢ ¤½¤Î¥Ö¥í¥Ã¥¯Æâ¤ËƱ¤¸ ÀßÄê̾¤¬¤¢¤ë¾ì¹ç¤Ï¡¢ ¤½¤Î¥Ö¥í¥Ã¥¯Æâ¤Ç¤Ï¡¢¤½¤ÎÀßÄê¹àÌܤ¬Í¥À褵¤ì¤ë¡£ .PP * ̤ÄêµÁ¤ÎÀßÄê̾¡¢ÀßÄêÃÍ¡¢µ­½Òɽ¸½¤Çµ­½Ò¤·¤¿¾ì¹ç¡¢¥¨¥é¡¼¤È¤Ê¤ë¡£ .PP * 1Å٤⵭½Ò¤µ¤ì¤Ê¤«¤Ã¤¿ÀßÄê¹àÌܤˤϡ¢¥Ç¥Õ¥©¥ë¥ÈÃͤ¬Å¬ÍѤµ¤ì¤ë¡£ ¤·¤«¤·¡¢¥Ç¥Õ¥©¥ë¥ÈÃͤ¬Â¸ºß¤·¤Ê¤¤ÀßÄê¹àÌܤ⤢¤ë¡£ .PP glogger ¤ÎÀßÄê¥Õ¥¡¥¤¥ë¤Ï¡¢°Ê²¼¤Î¤è¤¦¤Ê¹½Â¤¤Çµ­½Ò¤·¤Þ¤¹¡£ .nf interval [interval-spec] maxfilesize [maxfilesize-spec] defaultdir [defaultdir-spec] overwrite [overwrite-spec] fsync_interval [fsync_interval-spec] label [label-spec] path [path-spec] community [community-spec] requests { interval [interval-spec] path [path-spec] community [community-spec] nodes { [node-spec] .... } mib { interval [interval-spec] path [path-spec] oids { [oid-spec] .... } } mib... } requests... .fi .PP \&....¤Ï¡¢¤½¤Î¾å¤Ëµ­½Ò¤·¤¿ [?-spec] ¤¬¤¤¤¯¤Ä³¤¤¤Æ¤âÎɤ¤¤Ç¤¹¡£ mib... ¤ä requests... ¤Ï¡¢¤½¤ì¤¾¤ì¤Î¥Ö¥í¥Ã¥¯¤¬¤¤¤¯¤Ä³¤¤¤Æ¤âÎɤ¤¤Ç¤¹¡£ [?-spec] ¤Ë¤Ï¡¢¤½¤ì¤¾¤ì°Ê²¼¤Î¿ô»ú¤äʸ»úÎó¤ò»ØÄê¤Ç¤­¤Þ¤¹¡£ .PP [interval-spec] ¤Ë¤Ï¾®¿ôÃͤò»ØÄꤷ¤Þ¤¹¡£ÂоݤάÄê´Ö³Ö¤È¤Ê¤ê¤Þ¤¹¡£ ¤¿¤À¤·¡¢¸½¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï 0.1 ÉÃ̤Ëþ¤ÏÀڼΤƤé¤ì¤Þ¤¹¡£ (ex. interval 0.1, ¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ï 10.0) .PP [maxfilesize-spec] ¤Ë¤Ï½ÐÎÏ¥Õ¥¡¥¤¥ë¤ÎºÇÂ祵¥¤¥º¤ò KBñ°Ì ¤ÎÀ°¿ôÃͤǻØÄꤷ¤Þ¤¹¡£»ØÄꤷ¤¿¥µ¥¤¥º¤òͤ¨¤Æ¤«¤é¡¢ÆâÉôưºî¥¿¥¤¥ß¥ó¥°¤Î¥­ ¥ê¤ÎÎɤ¤¤È¤³¤í¤Ç¥Õ¥¡¥¤¥ë¤òÀÚ¤êÂØ¤¨¤Þ¤¹¡£¤³¤Î¾ì¹ç¡¢path ÀßÄê¤Ç¤Î¥Õ¥¡¥¤¥ë ̾À¸À®¥ë¡¼¥ë¤Ç¥Õ¥¡¥¤¥ë¤ÏÀÚ¤êÂØ¤ï¤ê¤Þ¤»¤ó¡£-mmap ¥â¡¼¥Éưºî»þ¤Ï¡¢¤³¤³¤Ç»Ø Äꤷ¤¿¥Õ¥¡¥¤¥ë¥µ¥¤¥º¤òͤ¨¤¿¤È¤³¤í¤Ç½ªÎ»¤·¤Þ¤¹¡£0(¥Ç¥Õ¥©¥ë¥ÈÃÍ) ¤ò»ØÄꤷ¡¢ ¤µ¤é¤Ë¥Õ¥¡¥¤¥ë̾À¸À®¥ë¡¼¥ë¤Ç¤â»þ¹ï¤òÆþ¤ì¤Ê¤¤¾ì¹ç¤Ï¡¢Ää»ß¤µ¤ì¤ë¤Þ¤Ç ¥Õ¥¡¥¤¥ë¤Ø½ÐÎϤ·¤Ä¤Å¤±¤Þ¤¹¡£ (ex. Ìó 1MB¤Î¾ì¹ç ¢ª maxfilesize 1024, ¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ï 0) .PP [defaultdir-spec] ¤Ë¤Ï´ð½à¤È¤Ê¤ë½ÐÎÏÀè¥Ç¥£¥ì¥¯¥È¥ê¤Î ÀäÂХѥ¹¤ò»ØÄꤷ¤Þ¤¹¡£ path ¹à¤Ç %G ¤òµ­½Ò¤·¤¿¤È¤­¤ËÃÖ´¹¤µ¤ì¤ëÃͤȤʤê¤Þ¤¹¡£ global default Éôʬ¤Î¤ß¤Ç»ØÄê¤Ç¤­¤Þ¤¹¡£ (ex. defaultdir /home/glogger, ¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ï /var/log/glogger) .PP [label-spec] ¤Ë¤ÏǤ°Õ¤Îʸ»úÎó¤ò»ØÄꤷ¤Þ¤¹¡£ ·×¬¥Æ¥¹¥È̾¤ä¡¢¥¯¥é¥¹¥¿Ì¾¤Ê¤É¤òÉÕ¤±¤Æ»È¤¦¤³¤È¤òÁÛÄꤷ¤Æ¤¤¤Þ¤¹¡£ path ¹à¤Ç %L ¤òµ­½Ò¤·¤¿¾ì¹ç¤ËÃÖ´¹¤µ¤ì¤ëʸ»úÎó¤È¤Ê¤ê¤Þ¤¹¡£ (ex. label test01, ¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ï glogger) .PP [overwrite-spec] ¤Ë¤Ï½ÐÎÏ¥Õ¥¡¥¤¥ë¤Î¾å½ñ¤­µö²Äʸ»úÎó on ¤Þ¤¿¤Ï enable ¤ò»ØÄꤷ¤Þ¤¹¡£ on ¤Þ¤¿¤Ï enable ¤òµ­½Ò¤¹¤ë¤È¡¢GLogger ¤Îµ¯Æ°»þ¡¢¤Þ¤¿¤Ï¡¢¥Õ¥¡¥¤¥ëÀÚ¤êÂØ¤¨»þ¤Ë¡¢ ¤¹¤Ç¤ËƱ¤¸Ì¾Á°¤Î¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Æ¤¤¤ë¾ì¹ç¤Ë¾å½ñ¤­¤·¤Þ¤¹ (°ÊÁ°¤Î¥Ç¡¼¥¿¤Ïºï½ü¤µ¤ì¤Þ¤¹)¡£ (ex. overwrite enable, ¥Ç¥Õ¥©¥ë¥È¤Ï¾å½ñ¤­¤·¤Ê¤¤) .PP [fsync_interval-spec] ¤Ë¤Ï fsync() ¤¹¤ë´Ö³Ö¤ÎÉÿô¡¢¤Þ¤¿¤Ï on ¤Þ¤¿¤Ï enable ¤ò »ØÄꤷ¤Þ¤¹¡£ GLogger ¤Ï½ÐÎÏ»þ¤ËËè²ó fflush() ¤·¤Þ¤¹¤¬¡¢»ØÄꤷ¤¿´Ö³Ö(ÉÃ)¤òͤ¨¤¿¥¿¥¤¥ß¥ó¥°¤Ç fsync() ¤â¤¹¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡£ on ¤Þ¤¿¤Ï enable ¤ò»ØÄꤷ¤¿¾ì¹ç¤Ï¡¢ÆâÉôưºî¥¤¥ó¥¿¡¼¥Ð¥ë(ÀßÄê¥Õ¥¡¥¤¥ë¤Îµ­½Ò¤Ë¤è¤Ã¤Æ°Û¤Ê¤ë) ¤´¤È¤Ë¡¢Ëè²ó fsync() ¤·¤Þ¤¹¡£ ¤Þ¤¿¡¢ÆâÉôưºî¥¤¥ó¥¿¡¼¥Ð¥ë¤¬¡¢¤³¤³¤Ç»ØÄꤷ¤¿Éÿô¤è¤ê¤âÂ礭¤¤´Ö³Ö¤Î¾ì¹ç¡¢Ëè²ó fsync() ¤·¤Þ¤¹¡£ ¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï°ìÀÚ fsync() ¤·¤Þ¤»¤ó¡£ (ex. fsync_interval 5, ¥Ç¥Õ¥©¥ë¥È¤Ï fsync() ¤·¤Ê¤¤) .PP [path-spec] ¤Ë¤Ï½ÐÎÏ¥Õ¥¡¥¤¥ë¤ÎÀäÂХѥ¹¥Õ¥¡¥¤¥ë̾¤ò»ØÄꤹ¤ëʸ»úÎó¤ò»ØÄê ¤·¤Þ¤¹¡£°Ê²¼¤ÎÃÖ´¹¥ë¡¼¥ë¤¬Å¬ÍѤǤ­¤Þ¤¹¡£¤Þ¤¿¡¢ÆâÉôưºî¤Î¥­¥ê¤ÎÎɤ¤¥¿¥¤ ¥ß¥ó¥°¤Ç¡¢¤³¤Î¥ë¡¼¥ë¤È¸½ºß¤Î»þ¹ï¤«¤é¥Õ¥¡¥¤¥ë̾¤òÀ¸À®¤·¡¢¤½¤ì¤Þ¤Ç½ÐÎϤ·¤Æ ¤¤¤¿¥Õ¥¡¥¤¥ë̾¤ÈÈæ³Ó¤·¤Þ¤¹¡£»þ¹ï¤òÃÖ´¹¤¹¤ë¥ë¡¼¥ë¤ò»ÈÍѤ·¤¿¾ì¹ç¡¢ »þ¹ï¤«¤éÀ¸À®¤µ¤ì¤¿¥Õ¥¡¥¤¥ë̾¤ËÊѹ¹¤¬¤¢¤Ã¤¿¾ì¹ç¤Ï¡¢¤½¤Î¿·¤·¤¤¥Õ¥¡¥¤¥ë¤Ë ÀÚ¤êÂØ¤¨¡¢¤½¤³¤Ø½ÐÎϤ·¤Þ¤¹¡£ÀßÄê¥Õ¥¡¥¤¥ë¤Î maxfilesize ¤ä¡¢ µ¯Æ°»þ¥ª¥×¥·¥ç¥ó°ú¿ô¤Ç¡¢¥Õ¥¡¥¤¥ë¥µ¥¤¥ºÀ©¸Â¤ò¹Ô¤Ã¤¿¾ì¹ç¤Ï¡¢»þ¹ï¤ò»È¤Ã¤¿ ¥Õ¥¡¥¤¥ë̾ÃÖ´¹¥ë¡¼¥ë¤ò»È¤ï¤º¡¢¥Õ¥¡¥¤¥ë¥µ¥¤¥ºÀ©¸Â¤Ç¥Õ¥¡¥¤¥ë¤òÀÚ¤êÂØ¤¨¤Þ¤¹¡£ ¤Þ¤¿¡¢¥Ç¥£¥ì¥¯¥È¥ê¤Ï¼«Æ°Åª¤ËºîÀ®¤·¤Þ¤»¤ó¡£ .nf %G defaultdir ¤Î¥Ç¥£¥ì¥¯¥È¥êÀäÂХѥ¹ %L ¥é¥Ù¥ë(¥¯¥é¥¹¥¿Ì¾¡¢¼Â¸³Ì¾¤Ê¤É) %n nodes ¤Ç»ØÄꤵ¤ì¤¿ FQDN %N nodes ¤Ç»ØÄꤵ¤ì¤¿¥Ë¥Ã¥¯¥Í¡¼¥à %o mibs ¤Ç»ØÄꤵ¤ì¤¿ OID̾ %O mibs ¤Ç»ØÄꤵ¤ì¤¿ OID¥Ë¥Ã¥¯¥Í¡¼¥à .fi »þ¹ï¤Ë´Ø¤¹¤ëÃÖ´¹¤Ë¤Ï¡¢GLogger ¤òµ¯Æ°¤·¤¿»þ¡¢¤Þ¤¿¤Ï¥Õ¥¡¥¤¥ë¤¬ÀÚ¤êÂØ¤ï¤ë»þ¤Î »þ¹ï¤ÎÃͤ¬ÍøÍѤµ¤ì¤Þ¤¹¡£ .nf %t ǯ·îÆü»þʬÉåߥêÉà (ex. 20031231235959000) %c ¥Þ¥¤¥¯¥íÉà (000000..999999) %s ¥ß¥êÉà (000..999) %S Éà (00..59) %M ʬ (00..59) %h »þ (00..23) %d ·îÆâÄÌ»»Æü¿ô (01..31) %j ǯÆâÄÌ»»Æü¿ô (001..366) %m ·î (01..12) %y ǯ (1970...) .fi (ex. path %G/%H/%O/%y%m%h.glg, ¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ï %G/%L_%y%m%d%h%M.glg) .PP [community-spec] ¤Ë¤Ï¥³¥ß¥å¥Ë¥Æ¥£¥¹¥È¥ê¥ó¥°¤ò»ØÄꤷ¤Þ¤¹¡£ (ex. community private, ¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ï public) .PP [node-spec] ¤Ë¤Ï¡Ö¥Û¥¹¥È̾ ¥Ë¥Ã¥¯¥Í¡¼¥à¡×¤ÎÁȤò³Æ¹Ô¤Ëµ­½Ò¤·¤Þ¤¹¡£ ¥Ë¥Ã¥¯¥Í¡¼¥à¤¬Ìµ¤±¤ì¤Ð¡¢%H ¤Ï %h ¤ÈƱÅù¤È¤Ê¤ê¤Þ¤¹¡£ nodes ¥Ö¥í¥Ã¥¯Æâ¤Ë¡¢Ê£¿ô¹Ôµ­½Ò¤Ç¤­¤Þ¤¹¡£ºÇÂç¿ô¤Ï̤ÄêµÁ¤Ç¤¹¡£ ¥Û¥¹¥È̾¤Ë¤Ï¡¢Ã±½ã¥Û¥¹¥È̾¡¢IP ¥¢¥É¥ì¥¹¡¢[?-?] ¤Ë¤è¤ëÏ¢ÈÖ¿ô»ú»ØÄ꤬ ÍøÍѤǤ­¤Þ¤¹¡£ Ï¢ÈÖ¿ô»ú»ØÄê [?-?] ¤Î ? ¤Ë¤Ï 0 °Ê¾å¤ÎÀ°¿ô(10¿Ê or 16¿Ê)(16¿Ê¤Î¾ì¹ç¤Ï 0x ¤Ç»Ï¤Þ¤ëʸ»úÎó)¤ò»ØÄꤷ¤Þ¤¹¡£º¸¤Ë»ÏÅÀ¡¢±¦¤Ë½ªÅÀ¤Î¿ô¤ò»ØÄꤷ¤Þ¤¹¡£»Ï ÅÀ¤è¤ê½ªÅÀ¤Î¤Û¤¦¤¬Â礭¤¤¿ô¤Ç¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£5·å¤Þ¤Ç»ØÄê¤Ç¤­¤Þ¤¹¡£ »ÏÅÀ¤Ç 0 ¤òÉղ䷤Ʒå¹ç¤ï¤»¤ò¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£½ªÅÀ¤ÎÃͤ˶áÉÕ¤¯¤Ë¤· ¤¿¤¬¤Ã¤Æ¡¢»ÏÅÀ¤Ç»ØÄꤷ¤¿·å¿ô¤è¤ê¤âÂ礭¤¯¤Ê¤ë¾ì¹ç¤Ï¡¢»ÏÅÀ¤Î·å¤òͤ¨¤ÆÅ¸ ³«¤·¤Þ¤¹¡£¤Þ¤¿¡¢½ªÅÀ¤ËÀèÆ¬¤«¤é¤¤¤¯¤Ä¤« 0 ¤òÉղ䷤Ƥ⡢»ÏÅÀ¤è¤ê¿¤¯»Ø Äꤷ¤¿¤ê¡¢¾¯¤Ê¤¯»ØÄꤷ¤Æ¤â¡¢»ÏÅÀ¤Ç¤¢¤ï¤»¤¿·å¤Ë¤Ê¤ê¤Þ¤¹¡£ .nf Î㤨¤Ð¡¢ [1-9] ¤Ï 1 ¤«¤é 9 ¤Î 9¸Ä¤ËŸ³«¤µ¤ì¤Þ¤¹¡£ [0x1-0x10] ¤Ï 1 ¤«¤é f ¤È 10 ¤Î 16¸Ä¤ËŸ³«¤µ¤ì¤Þ¤¹¡£ [000-20] ¤Ï 000 ¤«¤é 020 ¤Î 21¸Ä¤ËŸ³«¤µ¤ì¤Þ¤¹¡£ .fi ¥Ë¥Ã¥¯¥Í¡¼¥à¤Ë $1, $2... ¤È¤·¤Æ»ØÄꤹ¤ë¤È¡¢[?-?]Éô¤ò»ØÄꤷ¤¿½çÈÖ¤ËÃÖ´¹ ¤µ¤ì¤Þ¤¹¡£ Î㤨¤Ð¡¢abc[01-02]-[03-04].cdef.com abc$1-$2 ¤È»ØÄꤹ¤ë¤È¡¢¥Ë¥Ã¥¯¥Í¡¼¥à¤Ï abc01-03, abc01-04, abc02-03, abc02-04 ¤Î 4¸Ä¤ËŸ³«¤µ¤ì¤Þ¤¹¡£ Ÿ³«¤µ¤ì¤ë½çÈÖ¤Ï̤ÄêµÁ¤Ç¤¹¡£ .sp .RS .B "Ãí°Õ:" Âбþ¤¹¤ë $1, $2...¤ò»ØÄꤷ¤Ê¤¯¤Æ¤â¥¨¥é¡¼¤È¤Ê¤ê¤Þ¤»¤ó¡£ ¤·¤«¤· [?-?]Éô¤Î¸Ä¿ô¤è¤ê¿¤¯ $Éô¤ò»ØÄꤹ¤ë¤È¥¨¥é¡¼¤È¤Ê¤ê¤Þ¤¹¡£ .RE .nf ex. gfm[01-80].apgrid.org gfm$1 gfmgw[01-10].apgrid.org gfmgw$1 localhost 172.19.2.[0-255] private$1 a[0x00-0xff]-[000-100].b.com abc$2-$1 ¥Ç¥Õ¥©¥ë¥ÈÃͤÏ̵¤·¡£ .fi .PP [oids-spec] ¤Ë¤Ï¡ÖOID̾ ¥Ë¥Ã¥¯¥Í¡¼¥à¡×¤ÎÁȤò³Æ¹Ô¤Ëµ­½Ò¤·¤Þ¤¹¡£ ¥Ë¥Ã¥¯¥Í¡¼¥à¤Ï¾Êά¤Ç¤­¤Þ¤»¤ó¡£ oids ¥Ö¥í¥Ã¥¯Æâ¤Ë¡¢Ê£¿ô¹Ôµ­½Ò¤Ç¤­¤Þ¤¹¡£ »ØÄê¤Ç¤­¤ë OID ¤Î¿ô¤Ï¡¢°ì¤Ä¤Î·×¬ÂоݥΡ¼¥É¤ËÂФ·¤Æ¡¢1Å٤ΠSNMP Í×µá ¤ËÆþ¤ë¸Ä¿ô¤Þ¤Ç»ØÄê¤Ç¤­¤Þ¤¹¡£ .nf ex. # ºÇ¶á 1ʬ¤Î¥í¡¼¥É¥¢¥Ù¥ì¡¼¥¸ enterprises.ucdavis.laTable.laEntry.laLoad.1 loadavg # 2ÈÖÌܤΥͥåȥ¥¯¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î TX interfaces.ifTable.ifEntry.ifOutOctets.2 eth0-out # 2ÈÖÌܤΥͥåȥ¥¯¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î RX interfaces.ifTable.ifEntry.ifInOctets.2 eth0-in # 1ÈÖÌܤΥѡ¼¥Æ¥£¥·¥ç¥ó(snmpd.conf¤ÇÀßÄꤷ¤¿½ç)¤Î»ÈÍÑÎÌ enterprises.ucdavis.dskTable.dskEntry.dskUsed.1 used # 1ÈÖÌܤΥѡ¼¥Æ¥£¥·¥ç¥ó(snmpd.conf¤ÇÀßÄꤷ¤¿½ç)¤Î¶õ¤­ÍÆÎÌ enterprises.ucdavis.dskTable.dskEntry.dskAvail.1 available ¥Ç¥Õ¥©¥ë¥ÈÃͤÏ̵¤·¡£ .fi .SH "SEE ALSO" .PP \fBglogger\fR(8) gfarm-2.4.1/snmptool/glogger3/expand_node_name.h0000644000000000000000000000064611507222726020343 0ustar rootroot#define MAXNODENAME 256 #define MAXNICKNAME 64 #define MAXNODES 1024 #define MAXFIGURE 5 #define MAXREPLACE 5 struct range { int min; int max; int figure; int base; /* decimal (10 or 16) */ }; struct expanded_nodelist { char *name; char *nick; struct expanded_nodelist *next; }; typedef struct expanded_nodelist EXNODES; EXNODES * expand_node_name(char *nodedef, char *nickdef, char **rep, int deep); gfarm-2.4.1/snmptool/glogger3/sample.conf0000644000000000000000000000260311507222726017031 0ustar rootrootinterval 300 maxfilesize 1000 ### kilo bytes overwrite enable ### default: "disable" defaultdir /var/log/glogger label test ### %L #fsync_interval 2 ### second or "on" or "enable", default: "disable" ### filename rule # %G output directry of defaultdir string # %L label string # %n FQDN in nodes # %N nickname in nodes # %o OID name in mibs # %O OID nickname in mibs # # %t yearmonthdayhourminutemilisec (ex. 20031231235959000) # %c microsecond (000000..999999) # %s milisecond (000..999) # %S second (00..59) # %M minute (00..59) # %h hour (00..23) # %d day of month (01..31) # %j day of year (001..366) # %m month (01..12) # %y year (1970...) ### path %G/%L_%y%m%d%h%M.glg community public requests { nodes { #192.168.0.[0-255] private-$1 #abc[0x00-0x0f]-[000-010].example.com abc$2-$1 } mib { # interval 30 # path %G/net/%L_%y%m%d.glg oids { enterprises.ucdavis.laTable.laEntry.laLoad.1 loadavg interfaces.ifTable.ifEntry.ifOutOctets.2 eth0-out interfaces.ifTable.ifEntry.ifInOctets.2 eth0-in # internet.mgmt.mib-2.system.sysUpTime.0 uptime } } mib { # interval 600 # path %G/disk/%L_%y%m%d.glg oids { enterprises.ucdavis.dskTable.dskEntry.dskUsed.1 used enterprises.ucdavis.dskTable.dskEntry.dskAvail.1 available } } } gfarm-2.4.1/snmptool/glogger3/prepare_files.c0000644000000000000000000010020411507222726017661 0ustar rootroot#include "glogger.h" #include #include #include #include #include #include //#include #include #include /* calculate greatest common denominator ---------------------------------- */ static struct timeval gcdval; static struct timeval lcmval; static struct timeval maxval; static struct timeval cachegcd[MAXINTERVALCACHE]; static struct timeval cachelcm[MAXINTERVALCACHE]; static void reset_gcd_lcm(){ gcdval.tv_sec = 0; gcdval.tv_usec = 0; lcmval.tv_sec = 0; lcmval.tv_usec = 0; maxval.tv_sec = 0; maxval.tv_usec = 0; memset((void*)cachegcd, 0, sizeof(cachegcd)); memset((void*)cachelcm, 0, sizeof(cachelcm)); } #if 0 static int gcd(int m, int n){ if( (m == 0) || (n == 0) ){ return 0; } while(m != n && (m>0) && (n>0) ){ if(m > n){ m = m - n; } else{ n = n - m; } } return m; } #endif static int iszerotime(struct timeval *t){ if(t->tv_sec == 0 && t->tv_usec == 0){ return 1; } else { return 0; } } /* m > n : 1 m = n : 0 m < n : -1 */ int comparetime(struct timeval *m, struct timeval *n){ //printf("*** cmp m n %ld %ld\n", m->tv_usec, n->tv_usec); if(m->tv_sec > n->tv_sec){ return 1; } else if(m->tv_sec < n->tv_sec){ return -1; } else { /* equal */ if(m->tv_usec > n->tv_usec){ return 1; } if(m->tv_usec < n->tv_usec){ return -1; } else { /* equal */ return 0; } } } /* for m > n */ static struct timeval subtracttime(struct timeval *m, struct timeval *n){ struct timeval ret; //printf("*** sub m n %ld %ld\n", m->tv_usec, n->tv_usec); ret.tv_usec = m->tv_usec - n->tv_usec; ret.tv_sec = m->tv_sec - n->tv_sec; if(ret.tv_usec < 0){ ret.tv_sec -= 1; ret.tv_usec += 1000000L; } return ret; } /* calculate greatest common divisor */ /* after using reset_gcd_lcm() */ static void calc_gcd(struct timeval *val){ int cmp, i; struct timeval m, n; struct timeval *tmp; if(iszerotime(val)){ printf("Error: bad interval (sec=0, usec=0)\n"); exit(2); } else if(iszerotime(&gcdval)){ gcdval = *val; maxval = *val; return; } else { /* compare interval cache */ tmp = cachegcd; i = 0; while(1){ if(i >= MAXINTERVALCACHE){ cachegcd[0] = *val; /* over write */ break; } else if(iszerotime(tmp)){ *tmp = *val; /* add */ break; } else if(comparetime(tmp, val) == 0){ return; /* have calculated */ } tmp++; i++; } /* compare maximum value */ if(comparetime(val, &maxval) > 0){ maxval = *val; } /* calculate gcd */ //printf("*** start cal gcd ---------------\n"); m = *val; n = gcdval; while( !iszerotime(&m) && !iszerotime(&n)){ cmp = comparetime(&m, &n); if(cmp == 0){ break; } else if(cmp > 0){ /* m > n */ m = subtracttime(&m, &n); } else { /* m < n */ n = subtracttime(&n, &m); } } gcdval = m; //printf("*** gcd %ld %ld\n", gcdval.tv_sec, gcdval.tv_usec); } } static struct timeval addtime(struct timeval *m, struct timeval *n){ struct timeval ret; ret.tv_sec = m->tv_sec + n->tv_sec; ret.tv_usec = m->tv_usec + n->tv_usec; if(ret.tv_usec >= 1000000L){ ret.tv_usec -= 1000000L; ret.tv_sec += 1; } return ret; } static struct timeval multiplytime(struct timeval *m, int n){ struct timeval ret; int i; if(n <= 0){ return *m; } ret.tv_sec = 0; ret.tv_usec = 0; i = 0; while(i < n){ ret.tv_sec += m->tv_sec; ret.tv_usec += m->tv_usec; if(ret.tv_usec >= 1000000L){ ret.tv_usec -= 1000000L; ret.tv_sec += 1; } i++; } return ret; } /* for m > n */ static int dividetime(struct timeval *m, struct timeval *n, struct timeval *surplus){ int ret; struct timeval tmp; ret = 0; tmp = *m; if(iszerotime(n)){ printf("Error: divide by zero\n"); exit(2); } while(comparetime(&tmp, n) >= 0){ tmp = subtracttime(&tmp, n); ret++; //printf("divide: %d %ld %ld\n", ret, tmp.tv_sec, tmp.tv_usec); } if(surplus != NULL){ surplus->tv_sec = tmp.tv_sec; surplus->tv_usec = tmp.tv_usec; //printf("divide: %ld %ld\n", surplus->tv_sec, surplus->tv_usec); } return ret; } /* calculate least common multiple */ /* after using reset_gcd_lcm() */ static void calc_lcm(struct timeval *val){ struct timeval m, n, *tmp; int div, i; if(iszerotime(val)){ printf("Error: bad interval (sec=0, usec=0)\n"); exit(2); } else if(iszerotime(&lcmval)){ lcmval = *val; return; } /* compare cache */ /* compare interval cache */ tmp = cachelcm; i = 0; while(1){ if(i >= MAXINTERVALCACHE){ cachelcm[0] = *val; /* over write */ break; } else if(iszerotime(tmp)){ *tmp = *val; /* add */ break; } else if(comparetime(tmp, val) == 0){ //printf("*** lcm cached\n"); return; /* have calculated */ } tmp++; i++; } m = *val; n = lcmval; gcdval = n; /* reset */ memset((void*)cachegcd, 0, sizeof(cachegcd)); calc_gcd(&m); if(comparetime(&m, &n) >= 0){ div = dividetime(&m, &gcdval, NULL); lcmval = multiplytime(&n, div); } else { div = dividetime(&n, &gcdval, NULL); lcmval = multiplytime(&m, div); } //printf("*** lcm %ld %ld\n", lcmval.tv_sec, lcmval.tv_usec); } /* create filelist ------------------------------------------------------- */ void glogger_free_filelist(struct filelist *files){ struct filelist *tmp; while(files != NULL){ //printf("free_filelist: %s\n", files->path); tmp = files; files = files->next; free(tmp); } } /* add hostdefine and count or seek hostid */ static struct hostdefine * add_hostdef(struct hostdefine *hostdef, struct nodelist *nodes, unsigned short *hostid){ struct hostdefine *now, *tmp; struct hostent *he; char *ip; *hostid = 0; now = hostdef; while(now){ if(now->fqdn == NULL || nodes->nodename == NULL){ exit(2); } if(strcmp(now->fqdn, nodes->nodename) == 0){ return hostdef; } now = now->next; *hostid += 1; } /* now == NULL */ *hostid = 0; now = (struct hostdefine*) calloc(1, sizeof(struct hostdefine)); if(now == NULL){ printf("Error: calloc()\n"); exit(2); } he = gethostbyname(nodes->nodename); if(he == NULL){ printf("Error: gethostbyname(): %s\n", nodes->nodename); exit(2); } ip = (char*) calloc(1, strlen(inet_ntoa(*(struct in_addr*)he->h_addr))+1); if(ip == NULL){ printf("Error: calloc()\n"); exit(2); } strcpy(ip, inet_ntoa(*(struct in_addr*)he->h_addr)); now->ip = ip; //printf("IP = %s\n", now->ip); now->fqdn = nodes->nodename; now->nick = nodes->nodenick; now->community = nodes->community; now->next = NULL; if(hostdef == NULL){ return now; } else { tmp = hostdef; *hostid += 1; while(tmp->next){ *hostid += 1; tmp = tmp->next; } //printf("hostid = %d\n", *hostid); tmp->next = now; return hostdef; } } /* add oiddefine and count or seek oidid */ static struct oiddefine * add_oiddef(struct oiddefine *oiddef, struct oidlist *oids, unsigned short *oidid){ struct oiddefine *now, *tmp; *oidid = 0; now = oiddef; while(now){ if(now->oidname == NULL || oids->oidname == NULL){ exit(2); } if(strcmp(now->oidname, oids->oidname) == 0){ /* do nothing */ return oiddef; } now = now->next; *oidid += 1; } /* now == NULL */ *oidid = 0; now = (struct oiddefine*) calloc(1, sizeof(struct oiddefine)); if(now == NULL){ printf("Error: calloc()\n"); exit(2); } #if 0 print_objid(oids->oid, oids->oidlen); print_description(oids->oid, oids->oidlen, 80); #endif now->oidname = oids->oidname; now->nick = oids->oidnick; now->next = NULL; if(oiddef == NULL){ return now; } else { tmp = oiddef; *oidid += 1; while(tmp->next){ *oidid += 1; tmp = tmp->next; } //printf("oidid = %d\n", *oidid); tmp->next = now; return oiddef; } } /* add hostid and oidid and interval to intervalmap */ static struct intervalmap * add_intervalmap(struct intervalmap *map, struct oidlist *oids, unsigned short hostid, unsigned short oidid){ struct intervalmap *now, *tmp; //printf("add_intervalmap: id: %d.%d\n", hostid, oidid); now = (struct intervalmap*) calloc(1, sizeof(struct intervalmap)); if(now == NULL){ printf("Error: calloc()\n"); exit(2); } now->hostindex = htons(hostid); now->oidindex = htons(oidid); now->interval_sec = htonl(oids->interval.tv_sec); now->interval_usec = htonl(oids->interval.tv_usec); now->myoid = oids; //printf("add_im: %d %d %ld %ld\n", hostid, oidid, oids->interval.tv_sec, oids->interval.tv_usec); now->next = NULL; if(map == NULL){ return now; } else { tmp = map; while(tmp->next){ /* add to tail */ tmp = tmp->next; } tmp->next = now; return map; } } /* use calc_lcm() and lcmval */ static void calc_dbg_interval_severalfiles(struct filelist *files){ struct intervalmap *tmp; struct timeval interval; while(files){ tmp = files->interval_map; reset_gcd_lcm(); while(tmp){ interval.tv_sec = ntohl(tmp->interval_sec); interval.tv_usec = ntohl(tmp->interval_usec); calc_lcm(&interval); tmp = tmp->next; } files->interval_lcm = lcmval; files->dbg_interval_sec = htonl(lcmval.tv_sec); files->dbg_interval_usec = htonl(lcmval.tv_usec); //printf("lcm: %s: %ld %ld\n", files->path, lcmval.tv_sec, lcmval.tv_usec); files = files->next; } } static void add_filelist_property(struct filelist *files, struct oidlist *oids){ struct filelist *now; struct nodelist *nodes; unsigned short hostid, oidid; //int size; now = files; nodes = oids->mynode; //printf("add_filelist_property: %s: %s\n", nodes->nodename, oids->oidnick); now->hostdef = add_hostdef(now->hostdef, nodes, &hostid); now->oiddef = add_oiddef(now->oiddef, oids, &oidid); now->interval_map = add_intervalmap(now->interval_map, oids, hostid, oidid); } /* seek or create a target output file */ static struct filelist * add_filelist(struct filelist *files, struct oidlist *oids){ struct filelist *now; //struct stat st; //struct timeval *starttime; //int fd; now = files; while(now){ if(now->path == NULL || oids->path == NULL){ printf("Error: add_filelist\n"); exit(2); //return NULL; } if(strcmp(now->path, oids->path) == 0){ add_filelist_property(now, oids); oids->myfile = now; //printf("-- %s\n", now->path); return files; } now = now->next; } /* if(now == NULL) -> create a new target output file */ now = (struct filelist*) calloc(1, sizeof(struct filelist)); if(now == NULL){ printf("Error: calloc()\n"); exit(2); } now->path = oids->path; /* set and initialize */ now->version = htons(OUTDATA_VERSION); #if 0 starttime = glogger_get_nowtime(); now->start_sec = htonl(starttime->tv_sec); now->start_usec = htonl(starttime->tv_usec); #endif now->nowpath = NULL; now->hostdef = NULL; now->oiddef = NULL; now->interval_map = NULL; add_filelist_property(now, oids); oids->myfile = now; now->next = files; /* add to tail */ return now; } static void calc_metadatalength_severalfiles(struct filelist *files){ struct hostdefine *htmp; struct oiddefine *otmp; struct intervalmap *itmp; struct dbg_map *dtmp; unsigned long size; unsigned short hsize, osize, imsize, dmsize; while(files){ /* calculate length of metadata1 */ /* bytes of this version */ /* version : 2 */ /* dbg_size : 4 */ /* start_sec : 4 */ /* start_usec : 4 */ /* dbg_interval_sec : 4 */ /* dbg_interval_usec : 4 */ files->metadata1size = htons(22); /* calculate length of metadata2 */ size = 0; /* host definition */ hsize = 0; htmp = files->hostdef; while(htmp){ hsize += strlen(htmp->ip) + 1 + strlen(htmp->fqdn) + 1 + strlen(htmp->nick) + 1 + strlen(htmp->community) + 1; htmp = htmp->next; } size += hsize + 2; files->hostdefsize = htons(hsize); /* oid definition */ osize = 0; otmp = files->oiddef; while(otmp){ osize += strlen(otmp->oidname) + 1 + strlen(otmp->nick) + 1; otmp = otmp->next; } size += osize + 2; files->oiddefsize = htons(osize); /* interval map definition */ imsize = 0; itmp = files->interval_map; while(itmp){ /* bytes -> hostindex:2, oidindex:2, inteval:8 */ imsize += 12; itmp = itmp->next; } size += imsize + 2; files->imsize = htons(imsize); /* data block group definition map */ dmsize = 0; dtmp = files->dbgmap; while(dtmp){ if(dtmp->im == NULL){ /* separater */ dmsize += 2; /* for a number of value in this data block */ } else { /* host index, oid index */ dmsize += 4; } dtmp = dtmp->next; } size += dmsize + 2; files->dbgmapsize = htons(dmsize); //printf("dmsize: %u\n", dmsize); //printf("meta2: %s: %ld\n", files->path, size); files->metadata2size = htonl(size); files = files->next; } } static struct dbg_map * add_dbg_map(struct dbg_map *dm, struct intervalmap *im){ struct dbg_map *now, *top; now = (struct dbg_map*)calloc(1, sizeof(struct dbg_map)); if(now == NULL){ printf("Error: calloc()\n"); exit(2); } now->im = im; now->next = NULL; #if 0 // for DEBUG if(im != NULL){ printf("add_dbg_map: %s %s\n", im->myoid->mynode->nodename, im->myoid->oidnick); } else { printf("add_dbg_map: NULL (separater)\n"); } #endif if(dm == NULL){ return now; } else { top = dm; while(dm->next){ dm = dm->next; } dm->next = now; return top; } } static void create_dbg_map(struct filelist *files){ struct intervalmap *im; struct dbg_map *dm; struct timeval tv, dbgtime, surplus, check; unsigned long value, bufnum; int i, n, div, found; while(files){ //printf("calc_dbg: %s \n", files->path); /* calculate gcd of several intervals */ reset_gcd_lcm(); im = files->interval_map; while(im){ tv.tv_sec = ntohl(im->interval_sec); tv.tv_usec = ntohl(im->interval_usec); calc_gcd(&tv); im = im->next; } files->interval_gcd = gcdval; /* calculate (lcm / gcd) */ dbgtime.tv_sec = ntohl(files->dbg_interval_sec); dbgtime.tv_usec = ntohl(files->dbg_interval_usec); n = dividetime(&dbgtime, &gcdval, &surplus); if(!iszerotime(&surplus)){ printf("calc_dbg_length: Error:\n"); exit(3); } /* seek matched intervals */ dm = NULL; value = 0; i = 0; check.tv_sec = 0; check.tv_usec = 0; /* n == lcm / gcd == a number of all patterns */ while(i < n){ found = 0; im = files->interval_map; //printf("---\n"); while(im){ tv.tv_sec = ntohl(im->interval_sec); tv.tv_usec = ntohl(im->interval_usec); div = dividetime(&check, &tv, &surplus); if(iszerotime(&surplus)){ /* matched */ value += 5; /* flag:1, data:4 */ found = 1; //printf("tv : sec=%ld, usec=%ld\n",tv.tv_sec, tv.tv_usec); //printf("check: sec=%ld, usec=%ld\n",check.tv_sec, check.tv_usec); //printf("gcd : sec=%ld, usec=%ld\n",gcdval.tv_sec, gcdval.tv_usec); dm = add_dbg_map(dm, im); } im = im->next; } if(found == 1){ value += 8; /* for this data block time */ } i++; dm = add_dbg_map(dm, NULL); /* add separater */ check = addtime(&check, &gcdval); /* next interval */ } files->dbgmap = dm; files->dbgmap_pointer = dm; files->dbg_size = htonl(value); /* data block group size */ //printf("dbg_size: %s %ld\n", files->path, value); /* for buffering mode */ if(bufmode == BUFMODE_NONE){ files->buf = NULL; files->buf_point = NULL; files->buf_count = 0; files->buf_max = global_outputsizemax * 1024; } else if(bufmode == BUFMODE_MMAP){ files->buf_num = global_outputsizemax * 1024 / value; //files->buf_count = 0; } else { if(bufmode == BUFMODE_BURST){ bufnum = global_outputsizemax * 1024 / value; //bufnum = burstbuffersize * 1024 / value; files->buf_num = bufnum; } else if(bufmode == BUFMODE_DBG){ files->buf_num = 1; } else { printf("unknown buffering mode (%d)\n", bufmode); exit(5); } files->buf = (char*) calloc(1, value*bufnum); if(files->buf == NULL){ printf("Error: can't allocate enough memory (%lu*%lu = %lu)\n", value, bufnum, value*bufnum); exit(2); } #if 0 // touch memset(files->buf, 0, value*bufnum); #endif files->buf_point = files->buf; files->buf_count = 0; } files = files->next; } } int glogger_write_metadata(struct filelist *files){ void *tmp, *pnum, *pnow; unsigned short m1len; unsigned long m2len; int len; struct hostdefine *hdef; struct oiddefine *odef; struct intervalmap *im; struct dbg_map *dm; unsigned short dmcount; //int i, j; int dbgnum; /* part of metadata1 */ m1len = ntohs(files->metadata1size) + sizeof(files->metadata1size); tmp = (void*) calloc(1, m1len); if(tmp == NULL){ exit(2); } files->metadata1 = tmp; memcpy(tmp, (void*)&files->metadata1size, sizeof(uint16_t)); tmp += sizeof(uint16_t); memcpy(tmp, (void*)&files->version, sizeof(uint16_t)); tmp += sizeof(uint16_t); memcpy(tmp, (void*)&files->dbg_size, sizeof(uint32_t)); tmp += sizeof(uint32_t); memcpy(tmp, (void*)&files->start_sec, sizeof(uint32_t)); tmp += sizeof(uint32_t); memcpy(tmp, (void*)&files->start_usec, sizeof(uint32_t)); tmp += sizeof(uint32_t); memcpy(tmp, (void*)&files->dbg_interval_sec, sizeof(uint32_t)); tmp += sizeof(uint32_t); memcpy(tmp, (void*)&files->dbg_interval_usec, sizeof(uint32_t)); tmp += sizeof(uint32_t); write_func(files->metadata1, 1, m1len, files); /* part of metadata2 */ m2len = ntohl(files->metadata2size) + sizeof(files->metadata2size); tmp = (void*) calloc(1, m2len); if(tmp == NULL){ exit(2); } files->metadata2 = tmp; memcpy(tmp, (void*)&files->metadata2size, sizeof(uint32_t)); tmp += sizeof(uint32_t); /* hostdefine */ memcpy(tmp, (void*)&files->hostdefsize, sizeof(uint16_t)); tmp += sizeof(uint16_t); hdef = files->hostdef; while(hdef){ len = strlen(hdef->ip)+1; memcpy(tmp, hdef->ip, len); tmp += len; len = strlen(hdef->fqdn)+1; memcpy(tmp, hdef->fqdn, len); tmp += len; len = strlen(hdef->nick)+1; memcpy(tmp, hdef->nick, len); tmp += len; len = strlen(hdef->community)+1; memcpy(tmp, hdef->community, len); tmp += len; hdef = hdef->next; } /* oiddefine */ memcpy(tmp, (void*)&files->oiddefsize, sizeof(uint16_t)); tmp += sizeof(uint16_t); odef = files->oiddef; while(odef){ len = strlen(odef->oidname)+1; memcpy(tmp, odef->oidname, len); tmp += len; len = strlen(odef->nick)+1; memcpy(tmp, odef->nick, len); tmp += len; odef = odef->next; } /* intervalmap */ memcpy(tmp, (void*)&files->imsize, sizeof(uint16_t)); tmp += sizeof(uint16_t); im = files->interval_map; while(im){ memcpy(tmp, (void*)&im->hostindex, sizeof(uint16_t)); tmp += sizeof(uint16_t); memcpy(tmp, (void*)&im->oidindex, sizeof(uint16_t)); tmp += sizeof(uint16_t); memcpy(tmp, (void*)&im->interval_sec, sizeof(uint32_t)); tmp += sizeof(uint32_t); memcpy(tmp, (void*)&im->interval_usec, sizeof(uint32_t)); tmp += sizeof(uint32_t); //printf("write im: %ld\n", ntohl(im->interval_sec)); im = im->next; } /* dbgmap */ memcpy(tmp, (void*)&files->dbgmapsize, sizeof(uint16_t)); tmp += 2; dm = files->dbgmap; dmcount = 0; pnum = tmp; /* pointer for a number of value in a data block */ pnow = tmp+2; dbgnum = 0; while(dm){ if(dm->im == NULL){ //printf("dmcount: %u\n", dmcount); *(uint16_t*)pnum = htons(dmcount); //printf("pnum: %u\n", ntohs(*(uint16_t*)pnum)); pnum += 2 + dmcount*4; pnow = pnum + 2; dmcount = 0; dbgnum++; } else { memcpy(pnow, (void*)&dm->im->hostindex, 2); pnow += 2; memcpy(pnow, (void*)&dm->im->oidindex, 2); pnow += 2; dmcount++; } dm = dm->next; } #if 0 // print dbg map pnum = tmp; pnow = tmp+2; j=0; while(j < dbgnum){ dmcount = ntohs(*(uint16_t*)pnum); printf("----dmcount---- %u\n", dmcount); i=0; while(i < dmcount){ printf("%u ", ntohs(*(uint16_t*)pnow)); pnow += 2; printf("%u\n", ntohs(*(uint16_t*)pnow)); pnow += 2; i++; } pnum += 2 + dmcount*4; pnow = pnum + 2; j++; } #endif tmp = pnum; write_func(files->metadata2, 1, m2len, files); return 1; } int glogger_write_metadata_all(struct filelist *files){ while(files){ glogger_write_metadata(files); files = files->next; } glogger_fflush_files(files); return 1; } struct filelist * glogger_set_filelist(struct nodelist *nodes){ struct nodelist *tmp; struct oidlist *oids; struct filelist *fl; fl = NULL; tmp = nodes; while(tmp){ oids = tmp->oidval; while(oids){ fl = add_filelist(fl, oids); oids = oids->next; } tmp = tmp->next; } /* calculate interval of a data block group from several files */ calc_dbg_interval_severalfiles(fl); /* calculate length of a data block group from several files and create a data block group pattarn map */ create_dbg_map(fl); /* calculate length of metadata1 and metadata2 from several files */ calc_metadatalength_severalfiles(fl); return fl; } #define TMPLEN 64 static void convert_time(char *_dst, char *rule){ char *f = rule; char *dst = _dst; char tmp[TMPLEN]; int i; while(*f != '\0'){ if(MAXPATH <= strlen(dst)){ printf("Error: path name length >= %d(MAXPATH)\n", MAXPATH); exit(2); } if(*f == '%'){ f++; switch(*f){ case 't': snprintf(tmp, TMPLEN, "%.4d%.2d%.2d%.2d%.2d%.2d%.3d", now_tm.tm_year+1900, now_tm.tm_mon+1, now_tm.tm_mday, now_tm.tm_hour, now_tm.tm_min, now_tm.tm_sec, (int)(nowtime.tv_usec / 1000)); strncat(dst, tmp, MAXPATH - strlen(dst)); break; case 'c': snprintf(tmp, TMPLEN, "%.6ld", nowtime.tv_usec); strncat(dst, tmp, MAXPATH - strlen(dst)); break; case 's': /* milisecond */ snprintf(tmp, TMPLEN, "%.3d", (int)(nowtime.tv_usec / 1000)); strncat(dst, tmp, MAXPATH - strlen(dst)); break; case 'S': snprintf(tmp, TMPLEN, "%.2d", now_tm.tm_sec); strncat(dst, tmp, MAXPATH - strlen(dst)); break; case 'M': snprintf(tmp, TMPLEN, "%.2d", now_tm.tm_min); strncat(dst, tmp, MAXPATH - strlen(dst)); break; case 'h': snprintf(tmp, TMPLEN, "%.2d", now_tm.tm_hour); strncat(dst, tmp, MAXPATH - strlen(dst)); break; case 'd': snprintf(tmp, TMPLEN, "%.2d", now_tm.tm_mday); strncat(dst, tmp, MAXPATH - strlen(dst)); break; case 'j': snprintf(tmp, TMPLEN, "%.3d", now_tm.tm_yday); strncat(dst, tmp, MAXPATH - strlen(dst)); break; case 'm': snprintf(tmp, TMPLEN, "%.2d", now_tm.tm_mon+1); strncat(dst, tmp, MAXPATH - strlen(dst)); break; case 'y': snprintf(tmp, TMPLEN, "%.4d", now_tm.tm_year+1900); strncat(dst, tmp, MAXPATH - strlen(dst)); break; } } else { i = strlen(dst); dst[i] = *f; dst[i+1] = '\0'; } f++; } } int glogger_compare_and_change_filename(struct filelist *file){ char path[MAXPATH]; path[0] = '\0'; convert_time(path, file->path); //printf("glogger_compare_and_change_filename\n"); if(file->nowpath != NULL && strcmp(path, file->nowpath) == 0){ //printf("%s\n", path); /* do nothing */ return 0; } else { free(file->nowpath); file->nowpath = calloc(1, strlen(path)+1); if(file->nowpath == NULL){ printf("Error: calloc()\n"); exit(2); } strcpy(file->nowpath, path); return 1; } } int glogger_open_file(struct filelist *now){ struct stat st; unsigned long size; char c; now->start_sec = htonl(nowtime.tv_sec); now->start_usec = htonl(nowtime.tv_usec); if(strcasecmp(global_overwrite, "on") != 0 && strcasecmp(global_overwrite, "enable") != 0){ /* over write is forbidden */ /* check existing */ stat(now->nowpath, &st); if(S_ISREG(st.st_mode)){ printf("Error: same file exist: %s\n", now->nowpath); exit(4); } } if(bufmode == BUFMODE_MMAP){ now->fd = open(now->nowpath, O_RDWR|O_TRUNC|O_CREAT, 0666); if(now->fd == -1){ //printf("Error: cannot open: %s\n", now->path); printf("Error: cannot open: %s\n", now->nowpath); exit(2); } size = 2 + ntohs(now->metadata1size) + 4 + ntohl(now->metadata2size) + now->buf_num * ntohl(now->dbg_size); now->buf_max = size; printf("mmap size: %lu = 2+%u+2+%u+%lu*%u\n", size, ntohs(now->metadata1size), ntohl(now->metadata2size), now->buf_num, ntohl(now->dbg_size)); //size = 1; if(lseek(now->fd, size-1, SEEK_SET) < 0){ printf("lseek\n"); exit(2); } #if 0 if(read(now->fd, &c, 1) == -1){ c = '\0'; printf("read\n"); exit(2); } #endif if(write(now->fd, &c, 1) == -1){ printf("write\n"); exit(2); } now->buf = (char*)mmap(0, size, PROT_READ|PROT_WRITE, MAP_SHARED, now->fd, 0); if((int)now->buf == -1){ //printf("Error: cannot open: %s\n", now->path); printf("Error: cannot open: %s\n", now->nowpath); printf("Error: fail mmap(): size=%lu\n", size); exit(2); } // for test //memset(now->buf, 0, size); now->buf_point = now->buf; now->buf_count = 0; now->fp = NULL; } else { /* not mmap */ //now->fp = fopen(now->path, "wb"); now->fp = fopen(now->nowpath, "wb"); if(now->fp == NULL){ printf("Error: cannot open: %s\n", now->nowpath); exit(2); } now->buf_count = 0; } return 1; } int glogger_open_files(struct filelist *files){ struct filelist *now; now = files; while(now){ glogger_compare_and_change_filename(now); glogger_open_file(now); now = now->next; } return 1; } /* free and close */ int glogger_close_file(struct filelist *file){ if(bufmode == BUFMODE_MMAP){ munmap(file->buf, file->buf_max); close(file->fd); } else { fclose(file->fp); } return 1; } int glogger_close_files(struct filelist *files){ while(files){ glogger_close_file(files); files = files->next; } return 1; } /* -------------------------------------------------------------------- */ int calc_interval_from_files(struct timeval *setinterval, struct filelist *files){ struct filelist *tmp; int ret; reset_gcd_lcm(); tmp = files; while(files){ //printf(" interval_gcd -> %ld %ld\n", files->interval_gcd.tv_sec, files->interval_gcd.tv_usec); calc_gcd(&files->interval_gcd); files = files->next; } *setinterval = gcdval; //printf("*** gcd %ld %ld\n", gcdval.tv_sec, gcdval.tv_usec); //printf("*** max %ld %ld\n", maxval.tv_sec, maxval.tv_usec); reset_gcd_lcm(); files = tmp; while(files){ //printf(" interval_lcm -> %ld %ld\n", files->interval_lcm.tv_sec, files->interval_lcm.tv_usec); calc_lcm(&files->interval_lcm); files = files->next; } //printf("*** lcm %ld %ld\n", lcmval.tv_sec, lcmval.tv_usec); ret = dividetime(&lcmval, setinterval, NULL); //printf("*** count %d\n", ret); return ret; } static struct req_oids * add_dbgmap_to_reqoids(struct req_oids *reqoids, struct dbg_map *dbgmap){ struct req_oids *now, *top; //struct oidlist *addoid; if(dbgmap == NULL){ printf("Error: @add_reqlist()\n"); exit(1); } now = (struct req_oids*) calloc(1, sizeof(struct req_oids)); if(now == NULL){ printf("Error: calloc()\n"); exit(2); } now->oidval = dbgmap->im->myoid; now->dbgmap = dbgmap; //printf("pickup: %s %s\n", now->oidval->mynode->nodenick, now->oidval->oidnick); if(reqoids == NULL){ return now; } top = reqoids; while(reqoids->next){ reqoids = reqoids->next; } reqoids->next = now; return top; } static struct req_list * add_dbgmap_to_reqlist(struct req_list *reqlist, struct dbg_map *dbgmap){ struct nodelist *addnode; struct req_list *top, *reqset; //struct req_oids *reqoid; if(dbgmap == NULL){ printf("Error: @add_dbgmap_to_reqlist()\n"); exit(1); } addnode = dbgmap->im->myoid->mynode; top = reqlist; while(reqlist){ /* compare node list pointer */ if(reqlist->node == addnode){ reqlist->reqoids = add_dbgmap_to_reqoids(reqlist->reqoids, dbgmap); return top; } reqlist = reqlist->next; } /* reqlist == NULL (same node was not found) */ reqset = (struct req_list*) calloc(1, sizeof(struct req_list)); if(reqset == NULL){ printf("Error: calloc()\n"); exit(2); } reqset->node = addnode; #ifdef HOOK_snmp_free_pdu reqset->reqpdu = NULL; #endif reqset->reqoids = add_dbgmap_to_reqoids(NULL, dbgmap); reqset->next = top; return reqset; } static struct req_list * pickup_files(struct filelist *files, struct timeval *timing, int reqnum){ struct req_list *top; struct dbg_map *dmap; struct timeval check; int i; top = NULL; while(files){ //printf("pickupfiles: %s\n", files->path); dmap = files->dbgmap; if(dmap == NULL){ printf("Error: A data block group map is NULL.\n"); exit(1); } /* using a law of "maininterval == dbg_interval*n [n=1,2,...]" */ check.tv_sec = 0; check.tv_usec = 0; i = 0; while(i < reqnum){ /* timing match with dbg map */ if(dmap == NULL){ dmap = files->dbgmap; /* reloop */ } if(dmap->im == NULL){ /* separater <-> every request pattern */ check = addtime(&check, &files->interval_gcd); i++; } else if(comparetime(&check, timing) == 0){ /* check == timing */ while(dmap && dmap->im){ top = add_dbgmap_to_reqlist(top, dmap); dmap = dmap->next; } continue; } dmap = dmap->next; } files = files->next; } return top; } static struct target_files * add_target_files(struct target_files *targets, struct filelist *file){ struct target_files *top; if(file == NULL){ printf("Error: @add_target_files()\n"); exit(1); } top = targets; while(targets){ /* compare file list pointer */ if(targets->file == file){ /* do nothing */ return top; } targets = targets->next; } /* targets == NULL (same node was not found) */ targets = (struct target_files*) calloc(1, sizeof(struct target_files)); if(targets == NULL){ printf("Error: calloc()\n"); exit(2); } targets->file = file; targets->next = top; return targets; } static struct target_files * seek_target_files(struct req_list *reqlist){ struct target_files *top; struct req_oids *roids; if(reqlist == NULL){ /* no request at this timing */ return NULL; } top = NULL; while(reqlist){ roids = reqlist->reqoids; while(roids){ top = add_target_files(top, roids->oidval->myfile); roids = roids->next; } reqlist = reqlist->next; } return top; } struct req_loop * glogger_prepare_requests_from_files(struct filelist *files, struct timeval *setinterval){ int reqnum; int i; struct req_loop *reqs, *req; struct timeval timing; /* calculate a greatest common denominator of several intervals & a number of in main loop */ /* maininterval * reqnum = time of all request pattarn */ reqnum = calc_interval_from_files(setinterval, files); reqs = (struct req_loop*) calloc(1, sizeof(struct req_loop) * reqnum); i = 0; while(i < reqnum-1){ reqs[i].next = &reqs[i+1]; i++; } reqs[reqnum-1].next = &reqs[0]; /* loop */ timing.tv_sec = 0; timing.tv_usec = 0; i = 0; while(i < reqnum){ req = &reqs[i]; //printf("prepare_requests: %d ==================\n", i+1); req->reqlist = pickup_files(files, &timing, reqnum); req->targets = seek_target_files(req->reqlist); timing = addtime(&timing, setinterval); i++; } return reqs; } gfarm-2.4.1/snmptool/glogger3/avg1.pl0000755000000000000000000000723711507222726016107 0ustar rootroot#! /usr/bin/perl # for glogger3 (#define PRINTTIME) # for microsecond $MAX = 2000000; # 2 second # global # saving time 0:hour, 1:minute, 2:second, 3:microsec @start; @late; $clockstart; # for REQUEST $request; $rcount = 1; $rmin = $MAX; $ravg; $rmax = 0; $rdis; # dispersion "bunsan" # for WAIT $sleepwait; $scount = 1; $smin = $MAX; $savg; $smax = 0; $sdis; # for RECIEVE $receive; $gcount = 1; $gmin = $MAX; $gavg; $gmax = 0; $gdis; # for WRITE $write; $wcount = 1; $wmin = $MAX; $wavg; $wmax = 0; $wdis; # for FLUSH $flush; $fcount = 1; $fmin = $MAX; $favg; $fmax = 0; $fdis; $v = 1; $count = 1; while(){ $now = $_; if($now =~ /START/){ # START if($v = 1) {print $now}; $request = ""; $sleepwait = ""; $receive = ""; $write = ""; $timeout = 0; } elsif($now =~ /REQUEST/){ # start if($v = 1) {print $now}; &settime(*now, *start); } elsif($now =~ /WAIT/){ # REQUEST <-> WAIT if($v = 1) {print $now}; $request = $now; } elsif($now =~ /RECEIVE/){ # WAIT <-> RECEIVE if($v = 1) {print $now}; $sleepwait = $now; } elsif($now =~ /CANCEL/){ # cancel print $now; $timeout = 1; } elsif($now =~ /TIMEOUT/){ # timeout print "TIMEOUT\n"; $timeout = 1; } elsif($now =~ /WRITE/){ # RECEIVE <-> WRITE if($v = 1) {print $now}; $receive = $now; } elsif($now =~ /FLUSH/){ # WRITE <-> FLUSH if($v = 1) {print $now}; $write = $now; } elsif($now =~ /END/ && $timeout == 0){ # FLUSH <-> END if($v = 1) {print $now}; $flush = $now; print "REQUEST:"; &main(*count, *rmin, *ravg, *rmax, *rdis, $request); print "WAIT :"; &main(*count, *smin, *savg, *smax, *sdis, $sleepwait); print "RECEIVE:"; &main(*count, *gmin, *gavg, *gmax, *gdis, $receive); print "WRITE :"; &main(*count, *wmin, *wavg, *wmax, *wdis, $write); print "FLUSH :"; &main(*count, *fmin, *favg, *fmax, *fdis, $flush); #&flush('STDOUT') $count++; } else { #print "else\n"; } } ######################################################### sub settime { local(*now, *t) = @_; @line = split(/ /, $now); @timestr = split(/\./, $line[0]); @hms = split(/:/, $timestr[0]); # hour min sec # hour $t[0] = int($hms[0]); # minute $t[1] = int($hms[1]); # second $t[2] = int($hms[2]); # micro second $t[3] = int($timestr[1]); } ######################################################### sub main { local(*count, *min, *avg, *max, *dis, $now) = @_; &settime(*now, *late); $hour = $late[0] - $start[0]; $minu = $late[1] - $start[1]; $sec = $late[2] - $start[2]; $ms = $late[3] - $start[3]; if($ms < 0){ $ms = $ms + 1000000; $sec = $sec - 1; } if($sec < 0){ $sec = $sec + 60; $minu = $minu - 1; } if($minu < 0){ $minu = $minu + 60; $hour = $hour - 1; } #print "$hour $minu $sec $ms "; # $tmp < 60second $tmp = $ms + $sec*1000000; #print "******\n"; &main2(*count, *min, *avg, *max, *dis, $tmp); } sub main2 { local(*count, *min, *average, *max, *dispersion, $tmp) = @_; if($tmp > $max){ $max = $tmp; } if($tmp < $min){ $min = $tmp; } #$average = ($average*($count-1)+$tmp)/$count; $average = (($count-1)/$count)*$average + $tmp/$count; $avg = int($average); $dispersion = ($dispersion*($count-1)+($tmp-$average)*($tmp-$average))/$count; $dis = int($dispersion); $dev = sqrt($dis); $percent = int(100*$dev/$avg); #print "\#$count now=$tmp min=$min avg=$avg max=$max dev=$dev $percent%\n"; printf("\#%d now=%4d min=%4d avg=%4d max=%4d dev=%3d %2d%%\n", $count, $tmp, $min, $avg, $max, $dev, $percent); #$count++; } gfarm-2.4.1/snmptool/glogger3/install-sh0000755000000000000000000001270111507222726016705 0ustar rootroot#!/bin/sh # # install - install a program, script, or datafile # This comes from X11R5 (mit/util/scripts/install.sh). # # Copyright 1991 by the Massachusetts Institute of Technology # # Permission to use, copy, modify, distribute, and sell this software and its # documentation for any purpose is hereby granted without fee, provided that # the above copyright notice appear in all copies and that both that # copyright notice and this permission notice appear in supporting # documentation, and that the name of M.I.T. not be used in advertising or # publicity pertaining to distribution of the software without specific, # written prior permission. M.I.T. makes no representations about the # suitability of this software for any purpose. It is provided "as is" # without express or implied warranty. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" transformbasename="" transform_arg="" instcmd="$mvprog" chmodcmd="$chmodprog 0755" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" dir_arg="" while [ x"$1" != x ]; do case $1 in -c) instcmd="$cpprog" shift continue;; -d) dir_arg=true shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd="$stripprog" shift continue;; -t=*) transformarg=`echo $1 | sed 's/-t=//'` shift continue;; -b=*) transformbasename=`echo $1 | sed 's/-b=//'` shift continue;; *) if [ x"$src" = x ] then src=$1 else # this colon is to work around a 386BSD /bin/sh bug : dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "install: no input file specified" exit 1 else : fi if [ x"$dir_arg" != x ]; then dst=$src src="" if [ -d $dst ]; then instcmd=: chmodcmd="" else instcmd=$mkdirprog fi else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if [ -f "$src" ] || [ -d "$src" ] then : else echo "install: $src does not exist" exit 1 fi if [ x"$dst" = x ] then echo "install: no destination specified" exit 1 else : fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d $dst ] then dst="$dst"/`basename $src` else : fi fi ## this sed command emulates the dirname command dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # this part is taken from Noah Friedman's mkinstalldirs script # Skip lots of stat calls in the usual case. if [ ! -d "$dstdir" ]; then defaultIFS=' ' IFS="${IFS-${defaultIFS}}" oIFS="${IFS}" # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` IFS="${oIFS}" pathcomp='' while [ $# -ne 0 ] ; do pathcomp="${pathcomp}${1}" shift if [ ! -d "${pathcomp}" ] ; then $mkdirprog "${pathcomp}" else : fi pathcomp="${pathcomp}/" done fi if [ x"$dir_arg" != x ] then $doit $instcmd $dst && if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else : ; fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else : ; fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else : ; fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else : ; fi else # If we're going to rename the final executable, determine the name now. if [ x"$transformarg" = x ] then dstfile=`basename $dst` else dstfile=`basename $dst $transformbasename | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename if [ x"$dstfile" = x ] then dstfile=`basename $dst` else : fi # Make a temp file name in the proper directory. dsttmp=$dstdir/#inst.$$# # Move or copy the file name to the temp name $doit $instcmd $src $dsttmp && trap "rm -f ${dsttmp}" 0 && # and set any options; do chmod last to preserve setuid bits # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $instcmd $src $dsttmp" command. if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else :;fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else :;fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else :;fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else :;fi && # Now rename the file to the real destination. $doit $rmcmd -f $dstdir/$dstfile && $doit $mvcmd $dsttmp $dstdir/$dstfile fi && exit 0 gfarm-2.4.1/snmptool/glogger3/setsnmp_configure0000755000000000000000000000043611507222726020363 0ustar rootroot#!/bin/sh if [ $# -eq 0 ]; then echo "usage: `basename $0` [instaled snmp path] [configure options]" exit fi INSTALLPATH=$1 shift OPTIONS="$@" env CPPFLAGS="-I${INSTALLPATH}/include" \ LDFLAGS="-L${INSTALLPATH}/lib -Wl,-rpath,${INSTALLPATH}/lib" \ ./configure ${OPTIONS} gfarm-2.4.1/snmptool/glogger3/avg2.pl0000755000000000000000000000604611507222726016105 0ustar rootroot#! /usr/bin/perl # for glogger3 (#define PRINTTIME) # for rdtsc count $MAX = 90000000; # clock $enablediv = 1; # 1:on # global $start; $late; # for REQUEST $request; $rcount = 1; $rmin = $MAX; $ravg; $rmax = 0; $rdis; # dispersion "bunsan" # for WAIT $sleepwait; $scount = 1; $smin = $MAX; $savg; $smax = 0; $sdis; # for RECIEVE $receive; $gcount = 1; $gmin = $MAX; $gavg; $gmax = 0; $gdis; # for WRITE $write; $wcount = 1; $wmin = $MAX; $wavg; $wmax = 0; $wdis; # for FLUSH $flush; $fcount = 1; $fmin = $MAX; $favg; $fmax = 0; $fdis; $v = 1; $count = 1; while(){ $now = $_; if($now =~ /START/){ # START if($v = 1) {print $now}; $request = ""; $sleepwait = ""; $receive = ""; $write = ""; $timeout = 0; } elsif($now =~ /REQUEST/){ # start if($v = 1) {print $now}; &setclock(*now, *start); } elsif($now =~ /WAIT/){ # REQUEST <-> WAIT if($v = 1) {print $now}; $request = $now; } elsif($now =~ /RECEIVE/){ # WAIT <-> RECEIVE if($v = 1) {print $now}; $sleepwait = $now; } elsif($now =~ /CANCEL/){ # cancel print $now; $timeout = 1; } elsif($now =~ /TIMEOUT/){ # timeout print "TIMEOUT\n"; $timeout = 1; } elsif($now =~ /WRITE/){ # RECEIVE <-> WRITE if($v = 1) {print $now}; $receive = $now; } elsif($now =~ /FLUSH/){ # WRITE <-> FLUSH if($v = 1) {print $now}; $write = $now; } elsif($now =~ /END/ && $timeout == 0){ # FLUSH <-> END if($v = 1) {print $now}; $flush = $now; print "REQUEST:"; &main(*count, *rmin, *ravg, *rmax, *rdis, $request); print "WAIT :"; &main(*count, *smin, *savg, *smax, *sdis, $sleepwait); print "RECEIVE:"; &main(*count, *gmin, *gavg, *gmax, *gdis, $receive); print "WRITE :"; &main(*count, *wmin, *wavg, *wmax, *wdis, $write); print "FLUSH :"; &main(*count, *fmin, *favg, *fmax, *fdis, $flush); #&flush('STDOUT') $count++; } else { #print "else\n"; } } ######################################################### sub setclock { local(*now, *clock) = @_; @line = split(/ /, $now); # @line2 = split(/ /, $line[2]); $clock = $line[2]; } ######################################################### sub main { local(*count, *min, *avg, *max, *dis, $now) = @_; &setclock(*now, *late); $tmp = $late - $start; &main2(*count, *min, *avg, *max, *dis, $tmp); } sub main2 { local(*count, *min, *average, *max, *dispersion, $tmp) = @_; if($tmp > $max){ $max = $tmp; } if($tmp < $min){ $min = $tmp; } #$average = ($average*($count-1)+$tmp)/$count; $average = (($count-1)/$count)*$average + $tmp/$count; $avg = int($average); $dispersion = ($dispersion*($count-1)+($tmp-$average)*($tmp-$average))/$count; $dis = int($dispersion); if($enablediv == 1){ $dev = sqrt($dis); $percent = int(100*$dev/$avg); printf("\#%d now=%4d min=%4d avg=%4d max=%4d dev=%3d %2d%%\n", $count, $tmp, $min, $avg, $max, $dev, $percent); } else { printf("\#%d now=%4d min=%4d avg=%4d max=%4d\n", $count, $tmp, $min, $avg, $max); } } gfarm-2.4.1/snmptool/glogger3/read_glogger_conf.c0000644000000000000000000005231611507222726020501 0ustar rootroot#include #include #include #include #include #include #include #include "glogger.h" #include "expand_node_name.h" //extern char *global_defaultdir; //#define DEBUG_READCONF /* separate line */ struct separate { char *a; /* key */ char *b; /* value */ }; /* --------------------------------------------------------------------- */ struct nodelist *topnodes, *nownodes; struct timeval global_interval; char global_defaultdir[MAXDEFAULTDIRLEN]; int global_outputsizemax; /* KiloBytes: *1024 */ //struct timeval global_fileinterval; /* sec */ char global_overwrite[MAXOVERWRITELEN]; /* ON, OFF, enable, disable */ char global_label[MAXLABELLEN]; char global_path[MAXPATH]; char global_community[MAXCOMMLEN]; char global_fsync[MAXFSYNCLEN]; /* (number), on, off, enable, disable */ int global_fsyncmode; struct timeval requests_interval; char requests_path[MAXPATH]; char requests_community[MAXCOMMLEN]; struct timeval mib_interval; char mib_path[MAXPATH]; char *community_for_set; struct tm now_tm; struct timeval nowtime; int linenum = 0; int mode_global = 1; int mode_requests = 0; int mode_nodes = 0; int mode_mib = 0; int mode_oids = 0; int ok_nodes = 0; int ok_mib = 0; /* --------------------------------------------------------------------- */ #define GLOBAL_KEY_NUMBER 10 char *global_keys[GLOBAL_KEY_NUMBER] = { KEYSEC, KEYMICROSEC, KEYINTERVAL, KEYOUTMAX, KEYOVERWRITE, KEYDEFAULTDIR, KEYLABEL, KEYPATH, KEYCOMMUNITY, KEYFSYNC }; #define REQUESTS_KEY_NUMBER 5 char *requests_keys[REQUESTS_KEY_NUMBER] = { KEYSEC, KEYMICROSEC, KEYINTERVAL, KEYPATH, KEYCOMMUNITY }; #define MIB_KEY_NUMBER 4 char *mib_keys[MIB_KEY_NUMBER] = { KEYSEC, KEYMICROSEC, KEYINTERVAL, KEYPATH, }; /* --------------------------------------------------------------------- */ #if 0 static void myfree(char **c){ if(*c != NULL){ free(*c); } *c = NULL; } #endif /* default setting */ void init_global_conf(void){ global_interval.tv_sec = DEFAULTSEC; global_interval.tv_usec = DEFAULTUSEC; strcpy(global_path, DEFAULTPATH); strcpy(global_community, DEFAULTCOMM); strcpy(global_defaultdir, DEFAULTDIR); //global_outputsizemax = DEFAULTOUTPUT; strcpy(global_overwrite, DEFAULTOVERWRITE); strcpy(global_label, DEFAULTLABEL); //strcpy(global_fsync, DEFAULTFSYNC); global_fsyncmode = DEFAULTFSYNCMODE; } /* override */ void init_requests_conf(void){ requests_interval = global_interval; strncpy(requests_path, global_path, MAXPATH); strncpy(requests_community, global_community, MAXCOMMLEN); } void init_mib_conf(void){ mib_interval = requests_interval; strncpy(mib_path, requests_path, MAXPATH); } /* all initialize */ void init_read_conf_all(void){ linenum = 0; mode_global = 1; mode_requests = 0; mode_nodes = 0; mode_mib = 0; mode_oids = 0; ok_nodes = 0; ok_mib = 0; init_global_conf(); init_requests_conf(); init_mib_conf(); topnodes = NULL; nownodes = NULL; } /* --------------------------------------------------------------------- */ void debugstring(char *l){ int i = 0; printf("*** "); while(i < 10){ printf("%c ", l[i]); i++; } printf("***\n"); } /* use after cut_comment(), cut_front_spaces() */ /* AAA BBB -> a = AAA, b = BBB */ int separate_line(char *line, struct separate *s){ char *l; //debugstring(line); s->a = NULL; s->b = NULL; /* a */ l = line; s->a = l; while(*l != ' ' && *l != '=' && *l != '\0' && *l != '\r' && *l != '\n'){ l++; } if(*l == '\0' || *l == '\r' || *l == '\n'){ /* ex. only "}" */ *l = '\0'; return 1; /* one word */ } *l = '\0'; l++; //debugstring(l); while(*l == ' ' || *l == '='){ /* skip spaces */ l++; } if(*l == '\0' || *l == '\r' || *l == '\n'){ /* no value */ *l = '\0'; return 1; /* one word */ } /* b */ s->b = l; /* cut */ while(*l != ' ' && *l != '=' && *l != '\0' && *l != '\r' && *l != '\n'){ l++; } if(*l == '\0'){ return 2; /* two words */ } *l = '\0'; l++; /* check */ while(*l == ' '){ l++; } if(*l == '\0'){ return 2; /* two words */ } s->a = NULL; s->b = NULL; return 0; /* etc.... */ } /* compare permitted keys */ int check_keys(char *keynow, char **keys, int keysnum){ int i = 0; while(i < keysnum){ if(strcmp(keynow, keys[i]) == 0){ return 1; } i++; } return 0; } int check_close_mode(char *l){ if(*l == '}'){ return 1; } else { return 0; } } /* ---------------------------------------------------------------------- */ #define TMPLEN 64 char * convert_path(struct nodelist *nodes, struct oidlist *oids, char *rule){ //const char *format, char *dst, int maxpath){ char *f; char *dst; int i; char tmp[TMPLEN]; dst = (char*) calloc(MAXPATH, sizeof(char)); if(dst == NULL){ exit(2); } f = rule; while(*f != '\0'){ if(MAXPATH <= strlen(dst)){ printf("Error: path name length >= %d(MAXPATH)\n", MAXPATH); exit(2); //break; } if(*f == '%'){ f++; switch(*f){ case 'G': strncat(dst, global_defaultdir, MAXPATH - strlen(dst)); break; case 'L': strncat(dst, global_label, MAXPATH - strlen(dst)); break; case 'n': strncat(dst, nodes->nodename, MAXPATH - strlen(dst)); break; case 'N': strncat(dst, nodes->nodenick, MAXPATH - strlen(dst)); break; case 'o': strncat(dst, oids->oidname, MAXPATH - strlen(dst)); break; case 'O': strncat(dst, oids->oidnick, MAXPATH - strlen(dst)); break; case 't': case 'c': case 's': case 'S': case 'M': case 'h': case 'd': case 'j': case 'm': case 'y': snprintf(tmp, TMPLEN, "%%%c", *f); strncat(dst, tmp, MAXPATH - strlen(dst)); break; #if 0 case '%': i = strlen(dst); dst[i] = '%'; dst[i+1] = '\0'; #endif } /* else */ /* do nothing */ } else { i = strlen(dst); dst[i] = *f; dst[i+1] = '\0'; } f++; } return dst; } /* ---------------------------------------------------------------------- */ int set_global_value(char *key, char *val){ double f; if(strcmp(key, KEYPATH) == 0){ if(strlen(val) >= MAXPATH){ printf("Error: path length >= %d\n", MAXPATH); exit(2); } strncpy(global_path, val, MAXPATH); } else { if(strcmp(key, KEYSEC) == 0){ global_interval.tv_sec = atol(val); } else if(strcmp(key, KEYMICROSEC) == 0){ global_interval.tv_usec = atol(val); } else if(strcmp(key, KEYINTERVAL) == 0){ f = atof(val); global_interval.tv_sec = floor(f); global_interval.tv_usec = rint((f - global_interval.tv_sec)*1000000L); } else if(strcmp(key, KEYDEFAULTDIR) == 0){ strncpy(global_defaultdir, val, MAXDEFAULTDIRLEN); } else if(strcmp(key, KEYOUTMAX) == 0){ global_outputsizemax = atoi(val); } else if(strcmp(key, KEYOVERWRITE) == 0){ strncpy(global_overwrite, val, MAXOVERWRITELEN); } else if(strcmp(key, KEYFSYNC) == 0){ int fsyncinterval; char *errorp; strncpy(global_fsync, val, MAXFSYNCLEN); fsyncinterval = strtol(global_fsync, &errorp, 10); if(*errorp == '\0'){ global_fsyncmode = fsyncinterval; } else if(strcasecmp(global_fsync, "on") == 0 || strcasecmp(global_fsync, "enable") == 0){ global_fsyncmode = 0; /* every */ } else { global_fsyncmode = -1; /* disable */ } } #if 0 else if(strcmp(key, KEYFILEINTERVAL) == 0){ global_fileinterval.tv_sec = atoi(val); } else if(strcmp(key, KEYCHANGEFILE) == 0){ global_changefile = val[0]; } #endif else if(strcmp(key, KEYLABEL) == 0){ strncpy(global_label, val, MAXLABELLEN); } else if(strcmp(key, KEYCOMMUNITY) == 0){ strncpy(global_community, val, MAXCOMMLEN); } } return 1; } int set_requests_value(char *key, char *val){ double f; if(strcmp(key, KEYPATH) == 0){ if(strlen(val) >= MAXPATH){ printf("Error: path length >= %d\n", MAXPATH); exit(2); } strncpy(requests_path, val, MAXPATH); } else { if(strcmp(key, KEYSEC) == 0){ requests_interval.tv_sec = atol(val); } else if(strcmp(key, KEYMICROSEC) == 0){ requests_interval.tv_usec = atol(val); } else if(strcmp(key, KEYINTERVAL) == 0){ f = atof(val); requests_interval.tv_sec = floor(f); requests_interval.tv_usec = rint((f - requests_interval.tv_sec)*1000000L); } else if(strcmp(key, KEYCOMMUNITY) == 0){ strncpy(requests_community, val, MAXCOMMLEN); } } return 1; } int set_mib_value(char *key, char *val){ double f; if(strcmp(key, KEYPATH) == 0){ if(strlen(val) >= MAXPATH){ printf("Error: path length >= %d\n", MAXPATH); exit(2); } strncpy(mib_path, val, MAXPATH); //printf("mib_path: %s\n", mib_path); } else { if(strcmp(key, KEYSEC) == 0){ mib_interval.tv_sec = atol(val); } else if(strcmp(key, KEYMICROSEC) == 0){ mib_interval.tv_usec = atol(val); } else if(strcmp(key, KEYINTERVAL) == 0){ f = atof(val); mib_interval.tv_sec = floor(f); mib_interval.tv_usec = rint((f - mib_interval.tv_sec)*1000000L); } } return 1; } /* ---------------------------------------------------------------------- */ struct nodelist * add_nodelist_to_nodelist(struct nodelist *to, struct nodelist *from){ struct nodelist *top; if(to == NULL){ return from; } top = to; while(to->next != NULL){ to = to->next; } to->next = from; return top; } struct nodelist * add_nodelist(struct nodelist *nodes, char *name, char *nick){ struct nodelist *now; now = (struct nodelist *) calloc(1, sizeof(struct nodelist)); if(now == NULL){ printf("Error: calloc()\n"); exit(2); } now->nodename = name; now->nodenick = nick; now->community = community_for_set; now->oidval = NULL; if(nodes == NULL){ now->next = NULL; return now; } else { now->next = nodes; return now; } } void print_oidlist(struct oidlist *oids){ while(oids != NULL){ printf(" %.2d.%.6ld: %s [%s]\n", (int)oids->interval.tv_sec, (long)oids->interval.tv_usec, oids->oidnick, oids->path); oids = oids->next; } } void print_nodelist(struct nodelist *nodes){ printf("--- interval: oid nickname [target file name] ---\n"); while(nodes != NULL){ printf("### %s (%s) <%s> ###\n", nodes->nodename, nodes->nodenick, nodes->community); print_oidlist(nodes->oidval); nodes = nodes->next; } } #if 0 void free_nodelist(struct nodelist *nodes){ struct nodelist *tmp; while(nodes != NULL){ myfree(&nodes->nodename); myfree(&nodes->nodenick); tmp = nodes; nodes = nodes->next; free(tmp); } } #endif unsigned short glogger_mibtype(char *oidname){ if(strstr(oidname, TYPE_laLoad) != NULL){ return TYPEMODE_load; } else if(strstr(oidname, TYPE_ifOutOctets) != NULL){ return TYPEMODE_interface; } else if(strstr(oidname, TYPE_ifInOctets) != NULL){ return TYPEMODE_interface; } else if(strstr(oidname, TYPE_dskUsed) != NULL){ return TYPEMODE_disk; } else if(strstr(oidname, TYPE_dskAvail) != NULL){ return TYPEMODE_disk; } else if(strstr(oidname, TYPE_sysUpTime) != NULL){ return TYPEMODE_uptime; } else { printf("warning: unsupported mib type (oid: %s)\n", oidname); return TYPEMODE_default; } } struct oidlist * add_oidlist(struct oidlist *oids, struct nodelist *nownode, char *name, char *nick, oid *oid, int oidlen, char *rule){ struct oidlist *now; now = (struct oidlist *) calloc(1, sizeof(struct oidlist)); if(now == NULL){ printf("Error: calloc()\n"); exit(2); } now->mynode = nownode; now->oidname = name; now->oidnick = nick; now->oid = oid; now->oidlen = oidlen; now->pathrule = rule; now->path = convert_path(nownode, now, rule); now->myfile = NULL; if(mib_interval.tv_sec > MAXINTERVAL){ printf("max interval: %d\n", MAXINTERVAL); exit(1); } mib_interval.tv_usec = mib_interval.tv_usec-mib_interval.tv_usec%MININTERVAL; //printf("interval: %d %d\n", (int)mib_interval.tv_sec, (int)mib_interval.tv_usec); now->interval = mib_interval; now->mibtype = glogger_mibtype(name); if(oids == NULL){ now->next = NULL; return now; } else { now->next = oids; return now; } } struct nodelist * add_oid_to_nodelist(struct nodelist *now, char *oidname, char *oidnick, char *rule){ struct nodelist *top; oid *_oid; int oidlen; _oid = (oid*) calloc(MAX_OID_LEN, sizeof(oid)); if(_oid == NULL){ printf("Error: calloc()\n"); exit(2); } //oidlen = sizeof(oidd)/sizeof(oidd[0]); oidlen = MAX_OID_LEN; //printf("oidname: ###%s###%d %d\n", oidname, oidlen, strlen(oidname)); if(!snmp_parse_oid(oidname, _oid, &oidlen)){ snmp_perror("snmp_parse_oid"); exit(1); //return NULL; } top = now; while(now != NULL){ now->oidval = add_oidlist(now->oidval, now, oidname, oidnick, _oid, oidlen, rule); now = now->next; } return top; } /* ---------------------------------------------------------------------- */ void set_community_name(void){ community_for_set = (char*) calloc(strlen(requests_community)+1, sizeof(char)); if(community_for_set == NULL){ printf("Error: calloc()\n"); exit(2); } strcpy(community_for_set, requests_community); } void set_label_name(char *label){ } /* ---------------------------------------------------------------------- */ /* use after cut_comment(), cut_front_spaces() */ /* 1 */ int set_global(char *line){ struct separate s; if(separate_line(line, &s) == 2){ if(strcmp(s.a, "requests") == 0 && strcmp(s.b, "{") == 0 ){ mode_global = 0; mode_requests = 1; init_requests_conf(); ok_nodes = 0; return 2; } else { if(check_keys(s.a, global_keys, GLOBAL_KEY_NUMBER)){ set_global_value(s.a, s.b); #ifdef DEBUGCONF printf("global: %s = %s\n", s.a, s.b); #endif return 1; } else { printf("Unknown Key @ global(line=%d): %s = %s\n", linenum, s.a, s.b); exit(2); } } } else { printf("Syntax Error @ global(line=%d): %s\n", linenum, line); exit(2); } } /* 2 */ int set_requests(char *line){ struct separate s; if(check_close_mode(line)){ mode_requests = 0; mode_global = 1; return 0; } else if(separate_line(line, &s) == 2){ if(strcmp(s.a, "nodes") == 0 && strcmp(s.b, "{") == 0 ){ set_community_name(); mode_nodes = 1; return 2; } else if(strcmp(s.a, "mib") == 0 && strcmp(s.b, "{") == 0 && ok_nodes == 1){ mode_mib = 1; init_mib_conf(); return 2; } else { if(check_keys(s.a, requests_keys, REQUESTS_KEY_NUMBER)){ set_requests_value(s.a, s.b); #ifdef DEBUGCONF printf("requests: %s = %s\n", s.a, s.b); #endif return 1; } else { printf("Unknown Key @ requests(line=%d): %s = %s\n",linenum, s.a, s.b); exit(2); } } } else { printf("Syntax Error @ requests(line=%d): %s\n", linenum, line); exit(2); } } /* 3 */ int expand_nodes(char *line){ struct separate s; int w; if(check_close_mode(line)){ mode_nodes = 0; ok_nodes = 1; //print_nodelist(nownodes); return 0; } w = separate_line(line, &s); if(w == 1 || w == 2){ EXNODES *exnodes; char *rep[MAXREPLACE]; int i; //printf("nodes: name = %s, nick = %s\n", s.a, s.b); #if 1 for(i=0; iname, exnodes->nick); exnodes = exnodes->next; } #else /* test: not expand */ { char *name, *nick; name = (char*) calloc(strlen(s.a)+1, sizeof(char)); nick = (char*) calloc(strlen(s.b)+1, sizeof(char)); if(name == NULL || nick == NULL){ printf("Error: calloc()\n"); exit(2); } strcpy(name, s.a); if(w == 1){ free(nick); nick = name; } else { strcpy(nick, s.b); } nodes = add_nodelist(nodes, name, nick); } #endif return 1; } else { printf("Syntax Error @ nodes(line=%d): %s\n", linenum, line); exit(2); } } /* 4 */ int set_mib(char *line){ struct separate s; if(check_close_mode(line)){ mode_mib = 0; return 0; } else if(separate_line(line, &s) == 2){ if(strcmp(s.a, "oids") == 0 && strcmp(s.b, "{") == 0 ){ mode_oids = 1; return 2; } else { if(check_keys(s.a, mib_keys, MIB_KEY_NUMBER)){ set_mib_value(s.a, s.b); #ifdef DEBUGCONF printf("mib: %s = %s\n", s.a, s.b); #endif return 1; } else { printf("Unknown Key @ mib(line=%d): %s = %s\n", linenum, s.a, s.b); exit(2); } } } else { printf("Syntax Error @ mib(line=%d): %s\n", linenum, line); exit(2); } } /* 5 */ int set_oids(char *line){ struct separate s; int w; if(check_close_mode(line)){ mode_oids = 0; //print_nodelist(nownodes); return 2; } w = separate_line(line, &s); if(w == 2){ char *name; char *nick; char *rule; #ifdef DEBUGCONF printf("oids: oid = %s, nick = %s\n", s.a, s.b); #endif name = (char*) calloc(strlen(s.a)+1, sizeof(char)); nick = (char*) calloc(strlen(s.b)+1, sizeof(char)); rule = (char*) calloc(strlen(mib_path)+1, sizeof(char)); if(name == NULL || nick == NULL || rule == NULL){ printf("Error: calloc()\n"); exit(2); } strcpy(name, s.a); strcpy(nick, s.b); strcpy(rule, mib_path); nownodes = add_oid_to_nodelist(nownodes, name, nick, rule); if(nownodes == NULL){ return 0; // exit(2); } return 1; } #if 1 else if(w == 1){ printf("Syntax Error @ oids(line=%d): please set oid nickname\n", linenum); exit(2); } #endif else { printf("Syntax Error @ oids(line=%d): %s\n", linenum, line); exit(2); } } /* ---------------------------------------------------------------------- */ char * cut_front_spaces(char *p){ while(*p == ' ' || *p == '\t'){ p++; } if(*p == '\0' || *p == '\r' || *p == '\n'){ return NULL; } else { return p; } } int cut_comment(char *p){ while(*p){ if(*p == '#' || *p == '\r' || *p == '\n'){ *p = '\0'; return 1; } p++; } return 0; } /* line < MAXLINE ? */ int check_line(char *line){ int l; for(l = 0; l < MAXLINE; l++){ if(line[l] == '\0' || line[l] == '\r' || line[l] == '\n'){ return 1; } } return 0; } /* public APIs ----------------------------------------------------------- */ struct nodelist * glogger_get_top(void){ return topnodes; } struct timeval * glogger_get_nowtime(void){ return &nowtime; } void glogger_print_conf(struct nodelist *nodes){ print_nodelist(nodes); } void glogger_renew_time(void){ gettimeofday(&nowtime, NULL); localtime_r(&nowtime.tv_sec, &now_tm); } /* over write */ void glogger_set_path_to_nodes(struct nodelist *nodes, char *path){ struct oidlist *oids; //printf("glogger_set_path_to_nodes: %s\n", path); while(nodes){ oids = nodes->oidval; while(oids){ oids->path = path; oids->pathrule = path; oids = oids->next; } nodes = nodes->next; } } void glogger_init_read_conf(void){ init_snmp("glogger3"); /* clear list */ init_read_conf_all(); /* save starting time */ gettimeofday(&nowtime, NULL); localtime_r(&nowtime.tv_sec, &now_tm); } /* main */ int glogger_read_conf(char *configfilename){ FILE *fp; char line[MAXLINE], *linep; if(configfilename == NULL){ printf("Error: filename = NULL\n"); exit(1); } else if(strcmp("-", configfilename) == 0){ fp = stdin; } else { fp = fopen(configfilename, "r"); if(fp == NULL){ fprintf(stderr, "Access Error: %s\n", configfilename); exit(2); } } while(fgets(line, MAXLINE, fp)){ linenum++; /* line < MAXLINE ? */ if(check_line(line)){ /* OK */ //fprintf(stdout, "%s", line); } else { fprintf(stderr, "Error: over MAXLINE(%d) @ line=%d\n", MAXLINE, linenum); return 1; } /* delete comments */ if(cut_comment(line)){ } //fprintf(stdout, "%s\n", line); /* delete front spaces */ linep = cut_front_spaces(line); if(linep){ } else { /* null line */ continue; } /* 1.global */ if(mode_global == 1){ topnodes = add_nodelist_to_nodelist(topnodes, nownodes); nownodes = NULL; set_global(linep); } /* 2.requests */ else if(mode_requests == 1){ /* 3.requests override */ if(mode_nodes == 0 && mode_mib == 0) { set_requests(linep); } /* 4.nodes */ else if(mode_nodes == 1 && ok_nodes == 0){ expand_nodes(linep); } /* 5.mib */ else if(mode_mib == 1 && ok_nodes == 1){ /* 6.mib override */ if(mode_oids == 0){ set_mib(linep); } /* 7.oid */ else { set_oids(linep); } } else { printf("Syntax Error @ requests(line=%d): %s\n", linenum, linep); exit(2); } } else { /* not pass */ fprintf(stdout, "%s\n", linep); } } topnodes = add_nodelist_to_nodelist(topnodes, nownodes); fclose(fp); return 0; } gfarm-2.4.1/snmptool/glogger3/config.mk.in0000644000000000000000000000125711507222726017110 0ustar rootrootprefix = @prefix@ exec_prefix = @exec_prefix@ default_sbindir = @sbindir@ default_bindir = @bindir@ default_libdir = @libdir@ default_includedir = @libdir@ default_mandir = @mandir@ default_docdir = $(prefix)/share/doc/glogger default_htmldir = $(default_docdir)/html default_sysconfdir = @confdir@ sbindir = $(default_sbindir) bindir = $(default_bindir) libdir = $(default_libdir) includedir = $(default_includedir) exec_includedir = $(default_exec_includedir) mandir = $(default_mandir) docdir = $(default_docdir) htmldir = $(default_htmldir) sysconfdir = $(default_sysconfdir) INSTALL = $(top_objdir)/install-sh -c INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ gfarm-2.4.1/snmptool/glogger3/configure0000755000000000000000000034115511507222726016620 0ustar rootroot#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.53. # # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 # Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi # NLS nuisances. # Support unset when possible. if (FOO=FOO; unset FOO) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi (set +x; test -n "`(LANG=C; export LANG) 2>&1`") && { $as_unset LANG || test "${LANG+set}" != set; } || { LANG=C; export LANG; } (set +x; test -n "`(LC_ALL=C; export LC_ALL) 2>&1`") && { $as_unset LC_ALL || test "${LC_ALL+set}" != set; } || { LC_ALL=C; export LC_ALL; } (set +x; test -n "`(LC_TIME=C; export LC_TIME) 2>&1`") && { $as_unset LC_TIME || test "${LC_TIME+set}" != set; } || { LC_TIME=C; export LC_TIME; } (set +x; test -n "`(LC_CTYPE=C; export LC_CTYPE) 2>&1`") && { $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set; } || { LC_CTYPE=C; export LC_CTYPE; } (set +x; test -n "`(LANGUAGE=C; export LANGUAGE) 2>&1`") && { $as_unset LANGUAGE || test "${LANGUAGE+set}" != set; } || { LANGUAGE=C; export LANGUAGE; } (set +x; test -n "`(LC_COLLATE=C; export LC_COLLATE) 2>&1`") && { $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set; } || { LC_COLLATE=C; export LC_COLLATE; } (set +x; test -n "`(LC_NUMERIC=C; export LC_NUMERIC) 2>&1`") && { $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set; } || { LC_NUMERIC=C; export LC_NUMERIC; } (set +x; test -n "`(LC_MESSAGES=C; export LC_MESSAGES) 2>&1`") && { $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set; } || { LC_MESSAGES=C; export LC_MESSAGES; } # Name of the executable. as_me=`(basename "$0") 2>/dev/null || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conftest.sh echo "exit 0" >>conftest.sh chmod +x conftest.sh if (PATH=".;."; conftest.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conftest.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" # Sed expression to map a string onto a valid variable name. as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=$PATH_SEPARATOR; export CDPATH; } # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` exec 6>&1 # # Initializations. # ac_default_prefix=/usr/local cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. # This variable seems obsolete. It should probably be removed, and # only ac_max_sed_lines should be used. : ${ac_max_here_lines=38} # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= ac_unique_file="glogger.c" ac_unique_file="glogger.c" # Factoring default headers for most tests. ac_includes_default="\ #include #if HAVE_SYS_TYPES_H # include #endif #if HAVE_SYS_STAT_H # include #endif #if STDC_HEADERS # include # include #else # if HAVE_STDLIB_H # include # endif #endif #if HAVE_STRING_H # if !STDC_HEADERS && HAVE_MEMORY_H # include # endif # include #endif #if HAVE_STRINGS_H # include #endif #if HAVE_INTTYPES_H # include #else # if HAVE_STDINT_H # include # endif #endif #if HAVE_UNISTD_H # include #endif" # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' ac_prev= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" ac_prev= continue fi ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_option in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "enable_$ac_feature='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/-/_/g'` eval "with_$ac_package=no" ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` eval "$ac_envvar='$ac_optarg'" export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute paths. for ac_var in exec_prefix prefix do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* | NONE | '' ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # Be sure to have absolute paths. for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ localstatedir libdir includedir oldincludedir infodir mandir do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. ac_confdir=`(dirname "$0") 2>/dev/null || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 { (exit 1); exit 1; }; } else { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi fi srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` ac_env_build_alias_set=${build_alias+set} ac_env_build_alias_value=$build_alias ac_cv_env_build_alias_set=${build_alias+set} ac_cv_env_build_alias_value=$build_alias ac_env_host_alias_set=${host_alias+set} ac_env_host_alias_value=$host_alias ac_cv_env_host_alias_set=${host_alias+set} ac_cv_env_host_alias_value=$host_alias ac_env_target_alias_set=${target_alias+set} ac_env_target_alias_value=$target_alias ac_cv_env_target_alias_set=${target_alias+set} ac_cv_env_target_alias_value=$target_alias ac_env_CC_set=${CC+set} ac_env_CC_value=$CC ac_cv_env_CC_set=${CC+set} ac_cv_env_CC_value=$CC ac_env_CFLAGS_set=${CFLAGS+set} ac_env_CFLAGS_value=$CFLAGS ac_cv_env_CFLAGS_set=${CFLAGS+set} ac_cv_env_CFLAGS_value=$CFLAGS ac_env_LDFLAGS_set=${LDFLAGS+set} ac_env_LDFLAGS_value=$LDFLAGS ac_cv_env_LDFLAGS_set=${LDFLAGS+set} ac_cv_env_LDFLAGS_value=$LDFLAGS ac_env_CPPFLAGS_set=${CPPFLAGS+set} ac_env_CPPFLAGS_value=$CPPFLAGS ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} ac_cv_env_CPPFLAGS_value=$CPPFLAGS ac_env_CPP_set=${CPP+set} ac_env_CPP_value=$CPP ac_cv_env_CPP_set=${CPP+set} ac_cv_env_CPP_value=$CPP # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] _ACEOF cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --datadir=DIR read-only architecture-independent data [PREFIX/share] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --infodir=DIR info documentation [PREFIX/info] --mandir=DIR man documentation [PREFIX/man] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-printtime use -DPRINTTIME --enable-hook_snmp_free_pdu Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-confdir=DIR glogger configuration file directory (sysconfdir/glogger) --with-dlopen= when using --enable-hook_snmp_free_pdu Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _ACEOF fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d $ac_dir || continue ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be # absolute. ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd` ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` cd $ac_dir # Check for guested configure; otherwise get Cygnus style configure. if test -f $ac_srcdir/configure.gnu; then echo $SHELL $ac_srcdir/configure.gnu --help=recursive elif test -f $ac_srcdir/configure; then echo $SHELL $ac_srcdir/configure --help=recursive elif test -f $ac_srcdir/configure.ac || test -f $ac_srcdir/configure.in; then echo $ac_configure --help else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi cd $ac_popdir done fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit 0 fi exec 5>config.log cat >&5 <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.53. Invocation command line was $ $0 $@ _ACEOF { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` hostinfo = `(hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Also quote any args containing shell meta-characters. ac_configure_args= ac_sep= for ac_arg do case $ac_arg in -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n ) continue ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) continue ;; *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" ac_sep=" " ;; esac # Get rid of the leading space. done # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Be sure not to use single quotes in there, as some shells, # such as our DU 5.0 friend, will then `close' the trap. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, { (set) 2>&1 | case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in *ac_space=\ *) sed -n \ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" ;; *) sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } echo if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo sed "/^$/d" confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core core.* *.core && rm -rf conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo >confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . $cache_file;; *) . ./$cache_file;; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in `(set) 2>&1 | sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val="\$ac_cv_env_${ac_var}_value" eval ac_new_val="\$ac_env_${ac_var}_value" case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu top_objdir=`pwd` ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift set dummy "$as_dir/$ac_word" ${1+"$@"} shift ac_cv_prog_CC="$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CC" && break done CC=$ac_ct_CC fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH" >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH" >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO:" \ "checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.exe" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. echo "$as_me:$LINENO: checking for C compiler default output" >&5 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 (eval $ac_link_default) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Find the output, starting from the most likely. This scheme is # not robust to junk in `.', hence go to wildcards (a.*) only as a last # resort. # Be careful to initialize this variable, since it used to be cached. # Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. ac_cv_exeext= for ac_file in `ls a_out.exe a.exe conftest.exe 2>/dev/null; ls a.out conftest 2>/dev/null; ls a.* conftest.* 2>/dev/null`; do case $ac_file in *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb | *.xSYM ) ;; a.out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` # FIXME: I believe we export ac_cv_exeext for Libtool --akim. export ac_cv_exeext break;; * ) break;; esac done else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables" >&5 echo "$as_me: error: C compiler cannot create executables" >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6 # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'." >&2;} { (exit 1); exit 1; }; } fi fi fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 rm -f a.out a.exe conftest$ac_cv_exeext ac_clean_files=$ac_clean_files_save # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6 echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do case $ac_file in *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` export ac_cv_exeext break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link" >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link" >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6 rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile" >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile" >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6 OBJEXT=$ac_cv_objext ac_objext=$OBJEXT echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS CFLAGS="-g" echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_prog_cc_g=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi # Some people use a C++ compiler to compile C. Since we use `exit', # in C++ we need to declare it. In case someone uses the same compiler # for both compiling C and C++ we need to have the C++ compiler decide # the declaration of exit, since it's the most demanding environment. cat >conftest.$ac_ext <<_ACEOF #ifndef __cplusplus choke me #endif _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then for ac_declaration in \ ''\ '#include ' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include $ac_declaration #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 continue fi rm -f conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" $ac_declaration #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f $ac_dir/install.sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f $ac_dir/shtool; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} { (exit 1); exit 1; }; } fi ac_config_guess="$SHELL $ac_aux_dir/config.guess" ac_config_sub="$SHELL $ac_aux_dir/config.sub" ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL=$ac_install_sh fi fi echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' # Checks for libraries. echo "$as_me:$LINENO: checking for main in -lm" >&5 echo $ECHO_N "checking for main in -lm... $ECHO_C" >&6 if test "${ac_cv_lib_m_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_m_main=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_lib_m_main=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_m_main" >&5 echo "${ECHO_T}$ac_cv_lib_m_main" >&6 if test $ac_cv_lib_m_main = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBM 1 _ACEOF LIBS="-lm $LIBS" else exit 1 fi echo "$as_me:$LINENO: checking for main in -lcrypto" >&5 echo $ECHO_N "checking for main in -lcrypto... $ECHO_C" >&6 if test "${ac_cv_lib_crypto_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypto $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_crypto_main=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_lib_crypto_main=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_crypto_main" >&5 echo "${ECHO_T}$ac_cv_lib_crypto_main" >&6 if test $ac_cv_lib_crypto_main = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBCRYPTO 1 _ACEOF LIBS="-lcrypto $LIBS" else exit 1 fi # Checks for header files. ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$CPP" >&6 ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check" >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include #include #include #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f conftest.err conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done if test "${ac_cv_header_net_snmp_net_snmp_config_h+set}" = set; then echo "$as_me:$LINENO: checking for net-snmp/net-snmp-config.h" >&5 echo $ECHO_N "checking for net-snmp/net-snmp-config.h... $ECHO_C" >&6 if test "${ac_cv_header_net_snmp_net_snmp_config_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_net_snmp_net_snmp_config_h" >&5 echo "${ECHO_T}$ac_cv_header_net_snmp_net_snmp_config_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking net-snmp/net-snmp-config.h usability" >&5 echo $ECHO_N "checking net-snmp/net-snmp-config.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking net-snmp/net-snmp-config.h presence" >&5 echo $ECHO_N "checking net-snmp/net-snmp-config.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc in yes:no ) { echo "$as_me:$LINENO: WARNING: net-snmp/net-snmp-config.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: net-snmp/net-snmp-config.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: net-snmp/net-snmp-config.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: net-snmp/net-snmp-config.h: proceeding with the preprocessor's result" >&2;};; no:yes ) { echo "$as_me:$LINENO: WARNING: net-snmp/net-snmp-config.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: net-snmp/net-snmp-config.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: net-snmp/net-snmp-config.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: net-snmp/net-snmp-config.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: net-snmp/net-snmp-config.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: net-snmp/net-snmp-config.h: proceeding with the preprocessor's result" >&2;};; esac echo "$as_me:$LINENO: checking for net-snmp/net-snmp-config.h" >&5 echo $ECHO_N "checking for net-snmp/net-snmp-config.h... $ECHO_C" >&6 if test "${ac_cv_header_net_snmp_net_snmp_config_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_net_snmp_net_snmp_config_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_net_snmp_net_snmp_config_h" >&5 echo "${ECHO_T}$ac_cv_header_net_snmp_net_snmp_config_h" >&6 fi if test $ac_cv_header_net_snmp_net_snmp_config_h = yes; then useucd= echo "$as_me:$LINENO: checking for main in -lnetsnmp" >&5 echo $ECHO_N "checking for main in -lnetsnmp... $ECHO_C" >&6 if test "${ac_cv_lib_netsnmp_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnetsnmp $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_netsnmp_main=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_lib_netsnmp_main=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_netsnmp_main" >&5 echo "${ECHO_T}$ac_cv_lib_netsnmp_main" >&6 if test $ac_cv_lib_netsnmp_main = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBNETSNMP 1 _ACEOF LIBS="-lnetsnmp $LIBS" fi else if test "${ac_cv_header_ucd_snmp_ucd_snmp_config_h+set}" = set; then echo "$as_me:$LINENO: checking for ucd-snmp/ucd-snmp-config.h" >&5 echo $ECHO_N "checking for ucd-snmp/ucd-snmp-config.h... $ECHO_C" >&6 if test "${ac_cv_header_ucd_snmp_ucd_snmp_config_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_ucd_snmp_ucd_snmp_config_h" >&5 echo "${ECHO_T}$ac_cv_header_ucd_snmp_ucd_snmp_config_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking ucd-snmp/ucd-snmp-config.h usability" >&5 echo $ECHO_N "checking ucd-snmp/ucd-snmp-config.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking ucd-snmp/ucd-snmp-config.h presence" >&5 echo $ECHO_N "checking ucd-snmp/ucd-snmp-config.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc in yes:no ) { echo "$as_me:$LINENO: WARNING: ucd-snmp/ucd-snmp-config.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: ucd-snmp/ucd-snmp-config.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: ucd-snmp/ucd-snmp-config.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: ucd-snmp/ucd-snmp-config.h: proceeding with the preprocessor's result" >&2;};; no:yes ) { echo "$as_me:$LINENO: WARNING: ucd-snmp/ucd-snmp-config.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: ucd-snmp/ucd-snmp-config.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: ucd-snmp/ucd-snmp-config.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: ucd-snmp/ucd-snmp-config.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: ucd-snmp/ucd-snmp-config.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: ucd-snmp/ucd-snmp-config.h: proceeding with the preprocessor's result" >&2;};; esac echo "$as_me:$LINENO: checking for ucd-snmp/ucd-snmp-config.h" >&5 echo $ECHO_N "checking for ucd-snmp/ucd-snmp-config.h... $ECHO_C" >&6 if test "${ac_cv_header_ucd_snmp_ucd_snmp_config_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_ucd_snmp_ucd_snmp_config_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_ucd_snmp_ucd_snmp_config_h" >&5 echo "${ECHO_T}$ac_cv_header_ucd_snmp_ucd_snmp_config_h" >&6 fi if test $ac_cv_header_ucd_snmp_ucd_snmp_config_h = yes; then useucd=-DUSE_UCDHEADER echo "$as_me:$LINENO: checking for main in -lsnmp" >&5 echo $ECHO_N "checking for main in -lsnmp... $ECHO_C" >&6 if test "${ac_cv_lib_snmp_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsnmp $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_snmp_main=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_lib_snmp_main=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_snmp_main" >&5 echo "${ECHO_T}$ac_cv_lib_snmp_main" >&6 if test $ac_cv_lib_snmp_main = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBSNMP 1 _ACEOF LIBS="-lsnmp $LIBS" fi else echo "Please install the net-snmp or ucd-snmp package." exit 1 fi fi # Check whether --with-confdir or --without-confdir was given. if test "${with_confdir+set}" = set; then withval="$with_confdir" confdir=${withval} else confdir=${sysconfdir}/glogger fi; # Check whether --enable-printtime or --disable-printtime was given. if test "${enable_printtime+set}" = set; then enableval="$enable_printtime" printtime=-DPRINTTIME else printtime= fi; # Check whether --enable-hook_snmp_free_pdu or --disable-hook_snmp_free_pdu was given. if test "${enable_hook_snmp_free_pdu+set}" = set; then enableval="$enable_hook_snmp_free_pdu" hook_snmp_free_pdu=-DHOOK_snmp_free_pdu else hook_snmp_free_pdu= fi; # Check whether --with-dlopen or --without-dlopen was given. if test "${with_dlopen+set}" = set; then withval="$with_dlopen" snmpdlopen="-DUSE_DLOPEN=\\\"${withval}\\\"" echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 if test $ac_cv_lib_dl_dlopen = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBDL 1 _ACEOF LIBS="-ldl $LIBS" fi else snmpdlopen= fi; ac_config_files="$ac_config_files Makefile config.mk glogd docbook/ja/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overriden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. { (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } | sed ' t clear : clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ : end' >>confcache if cmp -s $cache_file confcache; then :; else if test -w $cache_file; then test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" cat confcache >$cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/; s/:*\${srcdir}:*/:/; s/:*@srcdir@:*/:/; s/^\([^=]*=[ ]*\):*/\1/; s/:*$//; s/^[^=]*=[ ]*$//; }' fi # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then we branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. cat >confdef2opt.sed <<\_ACEOF t clear : clear s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g t quote s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g t quote d : quote s,[ `~#$^&*(){}\\|;'"<>?],\\&,g s,\[,\\&,g s,\],\\&,g s,\$,$$,g p _ACEOF # We use echo to avoid assuming a particular line-breaking character. # The extra dot is to prevent the shell from consuming trailing # line-breaks from the sub-command output. A line-break within # single-quotes doesn't work because, if this script is created in a # platform that uses two characters for line-breaks (e.g., DOS), tr # would break. ac_LF_and_DOT=`echo; echo .` DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'` rm -f confdef2opt.sed : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi # NLS nuisances. # Support unset when possible. if (FOO=FOO; unset FOO) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi (set +x; test -n "`(LANG=C; export LANG) 2>&1`") && { $as_unset LANG || test "${LANG+set}" != set; } || { LANG=C; export LANG; } (set +x; test -n "`(LC_ALL=C; export LC_ALL) 2>&1`") && { $as_unset LC_ALL || test "${LC_ALL+set}" != set; } || { LC_ALL=C; export LC_ALL; } (set +x; test -n "`(LC_TIME=C; export LC_TIME) 2>&1`") && { $as_unset LC_TIME || test "${LC_TIME+set}" != set; } || { LC_TIME=C; export LC_TIME; } (set +x; test -n "`(LC_CTYPE=C; export LC_CTYPE) 2>&1`") && { $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set; } || { LC_CTYPE=C; export LC_CTYPE; } (set +x; test -n "`(LANGUAGE=C; export LANGUAGE) 2>&1`") && { $as_unset LANGUAGE || test "${LANGUAGE+set}" != set; } || { LANGUAGE=C; export LANGUAGE; } (set +x; test -n "`(LC_COLLATE=C; export LC_COLLATE) 2>&1`") && { $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set; } || { LC_COLLATE=C; export LC_COLLATE; } (set +x; test -n "`(LC_NUMERIC=C; export LC_NUMERIC) 2>&1`") && { $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set; } || { LC_NUMERIC=C; export LC_NUMERIC; } (set +x; test -n "`(LC_MESSAGES=C; export LC_MESSAGES) 2>&1`") && { $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set; } || { LC_MESSAGES=C; export LC_MESSAGES; } # Name of the executable. as_me=`(basename "$0") 2>/dev/null || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conftest.sh echo "exit 0" >>conftest.sh chmod +x conftest.sh if (PATH=".;."; conftest.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conftest.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" # Sed expression to map a string onto a valid variable name. as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=$PATH_SEPARATOR; export CDPATH; } exec 6>&1 # Open the log real soon, to keep \$[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. Logging --version etc. is OK. exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX } >&5 cat >&5 <<_CSEOF This file was extended by $as_me, which was generated by GNU Autoconf 2.53. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ _CSEOF echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 echo >&5 _ACEOF # Files that config.status was made for. if test -n "$ac_config_files"; then echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS fi if test -n "$ac_config_headers"; then echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS fi if test -n "$ac_config_links"; then echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS fi if test -n "$ac_config_commands"; then echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS fi cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number, then exit -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE Configuration files: $config_files Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.53, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." srcdir=$srcdir INSTALL="$INSTALL" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "x$1" : 'x\([^=]*\)='` ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` shift set dummy "$ac_option" "$ac_optarg" ${1+"$@"} shift ;; -*);; *) # This is not an option, so the user has probably given explicit # arguments. ac_need_defaults=false;; esac case $1 in # Handling of the options. _ACEOF cat >>$CONFIG_STATUS <<_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion" exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;; _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF --version | --vers* | -V ) echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header { { echo "$as_me:$LINENO: error: ambiguous option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --file | --fil | --fi | --f ) shift CONFIG_FILES="$CONFIG_FILES $1" ac_need_defaults=false;; --header | --heade | --head | --hea ) shift CONFIG_HEADERS="$CONFIG_HEADERS $1" ac_need_defaults=false;; # This is an error. -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ;; esac shift done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_config_target in $ac_config_targets do case "$ac_config_target" in # Handling of arguments. "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; "config.mk" ) CONFIG_FILES="$CONFIG_FILES config.mk" ;; "glogd" ) CONFIG_FILES="$CONFIG_FILES glogd" ;; "docbook/ja/Makefile" ) CONFIG_FILES="$CONFIG_FILES docbook/ja/Makefile" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files fi # Create a temporary directory, and hook for its removal unless debugging. $debug || { trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. : ${TMPDIR=/tmp} { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=$TMPDIR/cs$$-$RANDOM (umask 077 && mkdir $tmp) } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 { (exit 1); exit 1; } } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "\$CONFIG_FILES"; then # Protect against being on the right side of a sed subst in config.status. sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF s,@SHELL@,$SHELL,;t t s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t s,@exec_prefix@,$exec_prefix,;t t s,@prefix@,$prefix,;t t s,@program_transform_name@,$program_transform_name,;t t s,@bindir@,$bindir,;t t s,@sbindir@,$sbindir,;t t s,@libexecdir@,$libexecdir,;t t s,@datadir@,$datadir,;t t s,@sysconfdir@,$sysconfdir,;t t s,@sharedstatedir@,$sharedstatedir,;t t s,@localstatedir@,$localstatedir,;t t s,@libdir@,$libdir,;t t s,@includedir@,$includedir,;t t s,@oldincludedir@,$oldincludedir,;t t s,@infodir@,$infodir,;t t s,@mandir@,$mandir,;t t s,@build_alias@,$build_alias,;t t s,@host_alias@,$host_alias,;t t s,@target_alias@,$target_alias,;t t s,@DEFS@,$DEFS,;t t s,@ECHO_C@,$ECHO_C,;t t s,@ECHO_N@,$ECHO_N,;t t s,@ECHO_T@,$ECHO_T,;t t s,@LIBS@,$LIBS,;t t s,@top_objdir@,$top_objdir,;t t s,@CC@,$CC,;t t s,@CFLAGS@,$CFLAGS,;t t s,@LDFLAGS@,$LDFLAGS,;t t s,@CPPFLAGS@,$CPPFLAGS,;t t s,@ac_ct_CC@,$ac_ct_CC,;t t s,@EXEEXT@,$EXEEXT,;t t s,@OBJEXT@,$OBJEXT,;t t s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t s,@INSTALL_DATA@,$INSTALL_DATA,;t t s,@CPP@,$CPP,;t t s,@useucd@,$useucd,;t t s,@confdir@,$confdir,;t t s,@printtime@,$printtime,;t t s,@hook_snmp_free_pdu@,$hook_snmp_free_pdu,;t t s,@snmpdlopen@,$snmpdlopen,;t t CEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_lines=48 ac_sed_frag=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_lines # Line after last line for current file. ac_more_lines=: ac_sed_cmds= while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag else sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag fi if test ! -s $tmp/subs.frag; then ac_more_lines=false else # The purpose of the label and of the branching condition is to # speed up the sed processing (if there are no `@' at all, there # is no need to browse any of the substitutions). # These are the two extra sed commands mentioned above. (echo ':t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" else ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" fi ac_sed_frag=`expr $ac_sed_frag + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_lines` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi fi # test -n "$CONFIG_FILES" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { case "$ac_dir" in [\\/]* | ?:[\\/]* ) as_incr_dir=;; *) as_incr_dir=.;; esac as_dummy="$ac_dir" for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do case $as_mkdir_dir in # Skip DOS drivespec ?:) as_incr_dir=$as_mkdir_dir ;; *) as_incr_dir=$as_incr_dir/$as_mkdir_dir test -d "$as_incr_dir" || mkdir "$as_incr_dir" || { { echo "$as_me:$LINENO: error: cannot create \"$ac_dir\"" >&5 echo "$as_me: error: cannot create \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; } ;; esac done; } ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be # absolute. ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd` ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_builddir$INSTALL ;; esac if test x"$ac_file" != x-; then { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" fi # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ if test x"$ac_file" = x-; then configure_input= else configure_input="$ac_file. " fi configure_input=$configure_input"Generated from `echo $ac_file_in | sed 's,.*/,,'` by configure." # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo $f;; *) # Relative if test -f "$f"; then # Build tree echo $f elif test -f "$srcdir/$f"; then # Source tree echo $srcdir/$f else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s,@configure_input@,$configure_input,;t t s,@srcdir@,$ac_srcdir,;t t s,@abs_srcdir@,$ac_abs_srcdir,;t t s,@top_srcdir@,$ac_top_srcdir,;t t s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t s,@builddir@,$ac_builddir,;t t s,@abs_builddir@,$ac_abs_builddir,;t t s,@top_builddir@,$ac_top_builddir,;t t s,@abs_top_builddir@,$ac_abs_top_builddir,;t t s,@INSTALL@,$ac_INSTALL,;t t " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out rm -f $tmp/stdin if test x"$ac_file" != x-; then mv $tmp/out $ac_file else cat $tmp/out rm -f $tmp/out fi done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: exec 5>/dev/null $SHELL $CONFIG_STATUS || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi gfarm-2.4.1/snmptool/glogger3/glogger.h0000644000000000000000000002446111507222726016506 0ustar rootroot#include #include #include #include #include #include #include #include #ifdef USE_UCDHEADER #include #include #else #include #include #endif /* ucd-snmp */ #ifdef RECEIVED_MESSAGE #define GLOGGER_OP_RECEIVED_MESSAGE RECEIVED_MESSAGE #define USE_UCDSNMP //#warning "using snmp library: ucd-snmp" /* net-snmp */ #elif defined(NETSNMP_CALLBACK_OP_RECEIVED_MESSAGE) #define GLOGGER_OP_RECEIVED_MESSAGE NETSNMP_CALLBACK_OP_RECEIVED_MESSAGE //#warning "using snmp library: net-snmp" #else #error "unsupported snmp library: cannot determine callback operations" #endif int fsync_count; int fsync_timing; //#define DEBUGCONF /* read_glogger_conf.c */ //#define PRINTVALUE /* write_to_files.c */ /* default setting ---------------------------------------------------- */ #define MAXLINE 1024 #define MAXPATH 512 /* path length */ #define MAXCOMMLEN 16 /* community name length */ #define MAXLABELLEN 16 /* label length */ #define MAXDEFAULTDIRLEN 64 /* default_dir length */ #define MAXOVERWRITELEN 8 /* overwrite mode */ #define MAXINTERVALCACHE 16 /* for cachegcd, cachelcm */ #define MAXFSYNCLEN 8 /* fsync mode */ #define MAXINTERVAL 3600 /* sec */ #define MININTERVAL 100000 /* microsec */ #define DEFAULTSEC 10 #define DEFAULTUSEC 0 #define DEFAULTOUTPUT 0 /* KB */ #define DEFAULTMMAPOUTPUT 5 /* KB */ #define DEFAULTOVERWRITE "OFF" /* ON, OFF, enable, disable */ #define DEFAULTPATH "%G/%L_%y%m%d%h%M.glg" #define DEFAULTCOMM "public" #define DEFAULTDIR "/var/log/glogger" #define DEFAULTLABEL "glogger" #define DEFAULTFSYNC "OFF" /* ON, OFF, enable, disable */ #define DEFAULTFSYNCMODE -1 /* -1:off, 0:every, 1:1second, 2:... */ #define OUTDATA_VERSION 1 /* value flag 0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80 */ #define FLAG_VALID 0x01 #define FLAG_OK 0x02 /* key words in config file */ #define KEYSEC "interval_sec" #define KEYMICROSEC "interval_usec" #define KEYINTERVAL "interval" /* x.xxx (milisecond) */ #define KEYDEFAULTDIR "defaultdir" #define KEYOUTMAX "maxfilesize" #define KEYOVERWRITE "overwrite" #define KEYLABEL "label" #define KEYPATH "path" #define KEYCOMMUNITY "community" #define KEYFSYNC "fsync_interval" /* mib types */ #define TYPE_laLoad "laLoad" #define TYPE_ifOutOctets "ifOutOctets" #define TYPE_ifInOctets "ifInOctets" #define TYPE_dskUsed "dskUsed" #define TYPE_dskAvail "dskAvail" #define TYPE_sysUpTime "sysUpTime" #define TYPEMODE_load 1 #define TYPEMODE_interface 2 #define TYPEMODE_disk 2 #define TYPEMODE_uptime 3 #define TYPEMODE_default 2 /* at present time */ extern struct tm now_tm; extern struct timeval nowtime; /* output mode definition */ extern int global_outputsizemax; /* KiloBytes: *1024 */ //extern struct timeval global_fileinterval; extern char global_overwrite[MAXOVERWRITELEN]; extern char global_changefile; extern int burstbuffersize; //extern char global_fsync[MAXFSYNCLEN]; extern int global_fsyncmode; /* -1:off, 0:every, 1:1second, 2:... */ #define BUFMODE_NONE 0 /* fwrite() every timing */ #define BUFMODE_DBG 1 /* every data block group */ #define BUFMODE_BURST 2 /* write to only real memory */ #define BUFMODE_MMAP 3 /* use mmap() */ extern int bufmode; #ifdef PRINTTIME #define rdtscll(val) \ __asm__ __volatile__("rdtsc" : "=A" (val)) unsigned long long rdtsc_start; unsigned long long rdtsc_now; #endif /* --------------------------------------------------------------------- */ #if 0 // use? extern struct nodelist *topnodes; extern struct timeval global_interval; extern char *global_defaultdir; extern char *global_label; extern char global_path[MAXPATH]; extern char *global_community; extern struct timeval requests_interval; extern char requests_path[MAXPATH]; extern char *requests_community; extern struct timeval mib_interval; extern char *mib_path; #endif /* --------------------------------------------------------------------- */ struct hostdefine { char *ip; char *fqdn; char *nick; char *community; struct hostdefine *next; }; struct oiddefine { //char *oidasn1; char *oidname; char *nick; struct oiddefine *next; }; struct intervalmap { uint16_t hostindex; uint16_t oidindex; uint32_t interval_sec; uint32_t interval_usec; struct oidlist *myoid; struct intervalmap *next; }; /* dbg: data block group */ struct dbg_map { /* data block group pattern map */ struct intervalmap *im; /* NULL is separater */ unsigned char flag; unsigned long mibval; /* 32bit for saving a recieved mib value */ struct dbg_map *next; /* end: NULL */ }; struct filelist { char *path; /* only time rule: ...%t... */ char *nowpath; /* current output file name */ FILE *fp; int fd; /* file descriptor */ //unsigned long filesize; /* config -> buf_max */ //struct timeval changefile; char *buf; /* length of dbg_size * buf_num */ char *buf_point; unsigned long buf_count; /* a number of copied data to buf */ unsigned long buf_num; /* a number of dbg */ unsigned long buf_max; /* dbg_size * buf_num */ struct timeval interval_gcd; struct timeval interval_lcm; /* metadata1 */ void *metadata1; uint16_t metadata1size; uint16_t version; uint32_t dbg_size; uint32_t start_sec; uint32_t start_usec; uint32_t dbg_interval_sec; /* = lcm of intervals in this file */ uint32_t dbg_interval_usec; /* metadata2 */ char *metadata2; uint32_t metadata2size; uint16_t hostdefsize; struct hostdefine *hostdef; uint16_t oiddefsize; struct oiddefine *oiddef; uint16_t imsize; struct intervalmap *interval_map; uint16_t dbgmapsize; struct dbg_map *dbgmap; struct dbg_map *dbgmap_pointer; /* next writing timing */ struct filelist *next; /* end: NULL */ }; struct nodelist; struct oidlist { struct nodelist *mynode; /* belong to */ struct filelist *myfile; /* belong to */ char *oidname; char *oidnick; oid *oid; /* length: MAX_OID_LEN */ int oidlen; char *pathrule; char *path; /* %t is not converted */ struct timeval interval; /* convert type of MIB data value */ /* set this value in glogger_mibtype() */ /* use in glogger_response_callback() -> set_value_to_dbgmap() */ /* 0: unknown */ /* 1: for load average ( OCTETSTRING -> atoi()*100 ) */ /* 2: 32bit unsigned number, INTERGER or COUNTER */ /* ... */ unsigned short mibtype; /* != SNMP MIB data type */ struct oidlist *next; /* end: NULL */ }; struct nodelist { char *nodename; char *nodenick; char *community; struct snmp_session *session; struct oidlist *oidval; struct nodelist *next; /* end: NULL */ }; struct req_oids { struct oidlist *oidval; struct dbg_map *dbgmap; /* target of file at now request */ struct req_oids *next; /* end: NULL */ }; /* requests of same timing */ struct req_list { struct nodelist *node; #ifdef HOOK_snmp_free_pdu /* If I can hook snmp_free_pdu(), I can use saved pdu. */ struct snmp_pdu *reqpdu; #endif /* else */ struct req_oids *reqoids; /* request oids of now node at now timing */ struct req_list *next; /* end: NULL */ }; struct target_files { struct filelist *file; struct target_files *next; }; struct req_loop { //int index; /* 1,2,3,...,n, 0 : 0 is end of loop */ struct req_list *reqlist; /* NULL is no request of the timing */ struct target_files *targets; struct req_loop *next; /* end: top -> loop */ }; #if 1 struct options { char *conffile; /* -config: configuration file*/ char *defaultdir; /* -directory : output directory -> %G */ char *pidfile; /* PID number to this file */ char asyncmode; /* 1: ON, 0: OFF */ char checkconf; /* 1: ON, 0: OFF */ char *burst_path; char *mmap_path; int mmap_maxsize; /* KB */ }; #endif extern struct options opt; /* read_glogger_conf */ struct nodelist * glogger_get_top(void); struct timeval * glogger_get_nowtime(void); void glogger_print_conf(struct nodelist *nodes); void glogger_renew_time(void); void glogger_init_read_conf(void); int glogger_read_conf(char *configfilename); void glogger_set_path_to_nodes(struct nodelist *nodes, char *path); /* prepare_files.c */ struct filelist * glogger_set_filelist(struct nodelist *nodes); void glogger_free_filelist(struct filelist *files); //int glogger_calc_interval(struct timeval *setinterval, struct nodelist *nodes); int glogger_compare_and_change_filename(struct filelist *file); int glogger_open_file(struct filelist *file); int glogger_open_files(struct filelist *files); int glogger_write_metadata(struct filelist *file); int glogger_write_metadata_all(struct filelist *files); int glogger_close_file(struct filelist *file); int glogger_close_files(struct filelist *files); struct req_loop * glogger_prepare_requests(struct nodelist *nodes, struct timeval *setinterval); struct req_loop * glogger_prepare_requests_from_files(struct filelist *files, struct timeval *setinterval); int comparetime(struct timeval *m, struct timeval *n); /* snmpasync.c */ void printtime(struct timeval *time, char *name); void glogger_init_targets(struct nodelist *nodes); int glogger_snmpget(struct req_list *reqlist, struct timeval *timeout); void glogger_update_timeout(struct timeval *timeout, struct timeval *interval); void glogger_sleep(struct timeval *sleeptime); struct timeval * glogger_checktime(struct timeval *now, struct timeval *timeout); /* write_to_files.c */ /* function pointer for write */ extern size_t (*write_func)(const void *ptr, size_t size, size_t nmemb, struct filelist *file); size_t glogger_fwrite(const void *ptr, size_t size, size_t nmemb, struct filelist *file); size_t glogger_mmap(const void *ptr, size_t size, size_t nmemb, struct filelist *file); size_t glogger_write_mybuf(const void *ptr, size_t size, size_t nmemb, struct filelist *file); void glogger_write(struct timeval *time, struct target_files *targets); void glogger_fflush_files(struct filelist *files); int glogger_check_and_change_file(struct filelist *files, struct timeval *changetime); void glogger_next_changetime(struct timeval *changetime); /* set_options.c */ void daemon_mode(); int glogger_read_args(int argc, char **argv); /* common */ //void glogger_snmp_free_pdu(struct snmp_pdu *pdu); gfarm-2.4.1/lib/0000755000000000000000000000000011507222730012055 5ustar rootrootgfarm-2.4.1/lib/gfs_hook/0000755000000000000000000000000011507222730013654 5ustar rootrootgfarm-2.4.1/lib/gfs_hook/hooks_subr.h0000644000000000000000000000537311507222722016214 0ustar rootroot#include /* file_offset_t */ /* convert symbol to string literal */ #define STRING(symbol) #symbol #define S(symbol) STRING(symbol) #ifdef DEBUG #include extern int gfarm_node, gfarm_nnode; #define _gfs_hook_debug(x) x #define _gfs_hook_debug_v(x) #else #define _gfs_hook_debug(x) #define _gfs_hook_debug_v(x) #endif struct gfs_file; struct gfs_dir; struct gfs_dirent; char *gfs_hook_initialize(void); void gfs_hook_terminate(void); int gfs_hook_open_flags_gfarmize(int); int gfs_hook_num_gfs_files(void); void gfs_hook_reserve_fd(void); void gfs_hook_release_fd(void); int gfs_hook_insert_gfs_file(struct gfs_file *); int gfs_hook_insert_gfs_dir(struct gfs_dir *, char *); unsigned char gfs_hook_gfs_file_type(int); char *gfs_hook_clear_gfs_file(int); void gfs_hook_unset_calc_digest_all(void); char *gfs_hook_flush_all(void); char *gfs_hook_close_all(void); void *gfs_hook_is_open(int); void gfs_hook_set_suspended_gfs_dirent(int, struct gfs_dirent *,file_offset_t); struct gfs_dirent *gfs_hook_get_suspended_gfs_dirent(int, file_offset_t *); struct gfs_stat *gfs_hook_get_gfs_stat(int); char *gfs_hook_get_gfs_url(int); int gfs_hook_set_cwd_is_gfarm(int); int gfs_hook_get_cwd_is_gfarm(void); int gfs_hook_is_url(const char *, char **); char *gfs_hook_get_prefix(char *, size_t); int __syscall_close(int); enum gfs_hook_file_view { local_view, index_view, global_view, section_view }; enum gfs_hook_file_view gfs_hook_get_current_view(void); int gfs_hook_get_current_index(void); int gfs_hook_get_current_nfrags(void); char *gfs_hook_get_current_section(void); struct dirent; struct dirent64; struct stat; struct stat64; int gfs_hook_syscall_open(const char *, int, mode_t); int gfs_hook_syscall_getdents(int, struct dirent *, size_t); int gfs_hook_syscall_getdents64(int, struct dirent64 *, size_t); ssize_t gfs_hook_syscall_pread(int, void *, size_t, off_t); ssize_t gfs_hook_syscall_pwrite(int, const void *, size_t, off_t); int gfs_hook_syscall_xstat(int, const char *, struct stat *); int gfs_hook_syscall_lxstat(int, const char *, struct stat *); int gfs_hook_syscall_fxstat(int, int, struct stat *); int gfs_hook_syscall_xstat64(int, const char *, struct stat64 *); int gfs_hook_syscall_lxstat64(int, const char *, struct stat64 *); int gfs_hook_syscall_fxstat64(int, int, struct stat64 *); char *gfs_hook_syscall_getcwd(char *, size_t); struct _gfs_file_descriptor; struct _gfs_file_descriptor *gfs_hook_dup_descriptor(int); void gfs_hook_set_descriptor(int, struct _gfs_file_descriptor *); #ifdef _LARGEFILE64_SOURCE off64_t gfs_hook_syscall_lseek64(int, off64_t, int); #endif #define GFS_DEV ((dev_t)-1) #define GFS_BLKSIZE 8192 #define GFS_NLINK_DIR 32000 /* dummy value of st_nlink for directories */ #define STAT_BLKSIZ 512 /* for st_blocks */ gfarm-2.4.1/lib/gfs_hook/hooks.c0000644000000000000000000016421611507222722015156 0ustar rootroot/* * Hooking system calls to utilize Gfarm file system. * * $Id: hooks.c 4303 2010-01-06 01:45:08Z ookuma $ */ #ifdef __osf__ /* argument types of mknod() and utimes() are different without this */ #define _XOPEN_SOURCE_EXTENDED #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #if !defined(WCOREDUMP) && defined(_AIX) #define WCOREDUMP(status) ((status) & 0x80) #endif #include #include "gfutil.h" #include "gfs_misc.h" #include "hooks_subr.h" #include #ifdef SYS_fdsync /* Solaris */ #include /* FSYNC, FDSYNC */ #endif #if defined(sun) && (defined(__svr4__) || defined(__SVR4)) #define OS_SOLARIS 1 #endif #ifdef __osf__ #define HOOK_GETDIRENTRIES #endif #ifdef __FreeBSD__ #define USE_BSD_LSEEK_ARGUMENT #define HOOK_GETDIRENTRIES #endif /* __FreeBSD__ */ #if defined(__APPLE__) && defined(__MACH__) /* MacOS X */ #define HOOK_GETDIRENTRIES #endif #ifdef __DragonFly__ #define USE_BSD_LSEEK_ARGUMENT #define HOOK_GETDIRENTRIES #endif /* __DragonFly__ */ #ifdef __NetBSD__ #define USE_BSD_LSEEK_ARGUMENT #define GETDENTS_CHAR_P /* has getdirentries(), but doesn't have to hook it, since it's deprecated */ #define SYS_stat SYS___stat13 #define SYS_fstat SYS___fstat13 #define SYS_lstat SYS___lstat13 #endif /* __NetBSD__ */ #ifdef __OpenBSD__ #define USE_BSD_LSEEK_ARGUMENT #define GETDENTS_CHAR_P #endif /* __OpenBSD__ */ #ifdef SYS_utime #include #endif /* * XXX - quite naive implementation * * It is necessary to re-implement more cleverly. */ /* * read */ ssize_t __read(int filedes, void *buf, size_t nbyte) { GFS_File gf; char *e; int n, errno_save = errno; _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking __read(%d, , %lu)", filedes, (unsigned long)nbyte)); if ((gf = gfs_hook_is_open(filedes)) == NULL) return syscall(SYS_read, filedes, buf, nbyte); if (gfs_hook_gfs_file_type(filedes) == GFS_DT_DIR) { _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: Hooking __read(%d, , %lu)", filedes, (unsigned long)nbyte)); e = GFARM_ERR_IS_A_DIRECTORY; goto error; } _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: Hooking __read(%d(%d), , %lu)", filedes, gfs_pio_fileno(gf), (unsigned long)nbyte)); e = gfs_pio_read(gf, buf, nbyte, &n); if (e == NULL) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "GFS: Hooking __read --> %d", n)); errno = errno_save; return (n); } error: _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: __read: %s", e)); errno = gfarm_error_to_errno(e); return (-1); } ssize_t _read(int filedes, void *buf, size_t nbyte) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking _read")); return (__read(filedes, buf, nbyte)); } ssize_t read(int filedes, void *buf, size_t nbyte) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking read")); return (__read(filedes, buf, nbyte)); } ssize_t _libc_read(int filedes, void *buf, size_t nbyte) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking _libc_read")); return (__read(filedes, buf, nbyte)); } /* * write */ /* fprintf and fputs should not be put into the following function. */ ssize_t __write(int filedes, const void *buf, size_t nbyte) { GFS_File gf; char *e; int n, errno_save = errno; /* * DO NOT put the following line here. This causes infinite loop! * * _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking __write(%d, , %lu)", * filedes, (unsigned long)nbyte)); */ if ((gf = gfs_hook_is_open(filedes)) == NULL) return (syscall(SYS_write, filedes, buf, nbyte)); if (gfs_hook_gfs_file_type(filedes) == GFS_DT_DIR) { /* * DO NOT put the following line here, which results * in infinite loop. * * _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, * "GFS: Hooking __write(%d, , %d)", * filedes, nbyte)); */ e = GFARM_ERR_IS_A_DIRECTORY; goto error; } _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: Hooking __write(%d(%d), , %lu)", filedes, gfs_pio_fileno(gf), (unsigned long)nbyte)); e = gfs_pio_write(gf, buf, nbyte, &n); if (e == NULL) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "GFS: Hooking __write --> %d", n)); errno = errno_save; return (n); } error: /* * DO NOT put the following line here. * * _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: __write: %s", e)); */ errno = gfarm_error_to_errno(e); return (-1); } ssize_t _write(int filedes, const void *buf, size_t nbyte) { return (__write(filedes, buf, nbyte)); } ssize_t write(int filedes, const void *buf, size_t nbyte) { return (__write(filedes, buf, nbyte)); } ssize_t _libc_write(int filedes, const void *buf, size_t nbyte) { return (__write(filedes, buf, nbyte)); } /* * close */ int __syscall_close(int filedes) { return (syscall(SYS_close, filedes)); } int __close(int filedes) { GFS_File gf; char *e, errno_save = errno; _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking __close(%d)", filedes)); if ((gf = gfs_hook_is_open(filedes)) == NULL) return (__syscall_close(filedes)); switch (gfs_hook_gfs_file_type(filedes)) { case GFS_DT_REG: _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: Hooking __close(%d(%d))", filedes, gfs_pio_fileno(gf))); break; case GFS_DT_DIR: _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: Hooking __close(%d)", filedes)); break; default: _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: Hooking __close: couldn't get gf or dir")); errno = EBADF; /* XXX - something broken */ return (-1); } e = gfs_hook_clear_gfs_file(filedes); if (e == NULL) { errno = errno_save; return (0); } _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: __close: %s", e)); errno = gfarm_error_to_errno(e); return (-1); } int _close(int filedes) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking _close")); return (__close(filedes)); } int close(int filedes) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking close")); return (__close(filedes)); } int _libc_close(int filedes) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking close")); return (__close(filedes)); } int _private_close(int filedes) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking close")); return (__close(filedes)); } /* * unlink */ int __unlink(const char *path) { const char *e; char *url; int errno_save = errno; _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking __unlink(%s)", path)); if (!gfs_hook_is_url(path, &url)) return syscall(SYS_unlink, path); _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: Hooking __unlink(%s)", path)); if (gfs_hook_get_current_view() == section_view) { e = gfs_unlink_section(url, gfs_hook_get_current_section()); } else { struct gfs_stat gs; e = gfs_stat(url, &gs); if (e == GFARM_ERR_NO_FRAGMENT_INFORMATION) { e = gfs_unlink(url); goto free_url; } else if (e != NULL) { _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: Hooking __unlink: gfs_stat: %s", e)); goto free_url; } if (GFARM_S_IS_PROGRAM(gs.st_mode)) { char *arch; e = gfarm_host_get_self_architecture(&arch); if (e != NULL) { e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else { e = gfs_unlink_section(url, arch); } } else { e = gfs_unlink(url); } gfs_stat_free(&gs); } free_url: free(url); if (e == NULL) { errno = errno_save; return (0); } _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: __unlink: %s", e)); errno = gfarm_error_to_errno(e); return (-1); } int _unlink(const char *path) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking _unlink")); return (__unlink(path)); } int unlink(const char *path) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking unlink")); return (__unlink(path)); } /* * access */ int __access(const char *path, int type) { char *e, *url; int errno_save = errno; _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking __access(%s, %d)", path, type)); if (!gfs_hook_is_url(path, &url)) return syscall(SYS_access, path, type); _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: Hooking __access(%s, %d)", path, type)); e = gfs_access(url, type); free(url); if (e == NULL) { errno = errno_save; return (0); } _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: __access: %s", e)); errno = gfarm_error_to_errno(e); return (-1); } int _access(const char *path, int type) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking _access")); return (__access(path, type)); } int access(const char *path, int type) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking access")); return (__access(path, type)); } /* * mmap * * XXX - just print out the information. */ #if 0 /* XXX - Linux causes a segfault while loading a shared library. Should we call old_map() instead of syscall(SYS_mmap)??? */ void * __mmap(void *addr, size_t len, int prot, int flags, int fildes, off_t off) { GFS_File gf; int gfs_fd; _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking __mmap(%p, %lu, %d, %d, %d, %ld)", addr, (unsigned long)len, prot, flags, fildes, (long)off)); if ((gf = gfs_hook_is_open(fildes)) == NULL) return (void *)syscall( SYS_mmap, addr, len, prot, flags, fildes, off); _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: Hooking __mmap(%p, %lu, %d, %d, %d, %ld)", addr, (unsigned long)len, prot, flags, fildes, (long)off)); gfs_fd = gfs_pio_fileno(gf); return (void *)syscall(SYS_mmap, addr, len, prot, flags, gfs_fd, off); } void * _mmap(void *addr, size_t len, int prot, int flags, int fildes, off_t off) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking _mmap")); return (__mmap(addr, len, prot, flags, fildes, off)); } void * mmap(void *addr, size_t len, int prot, int flags, int fildes, off_t off) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking mmap")); return (__mmap(addr, len, prot, flags, fildes, off)); } #endif /* * dup2 and dup */ #ifdef SYS_dup2 int __dup2(int oldfd, int newfd) { struct _gfs_file_descriptor *d; GFS_File gf1, gf2; int errno_save = errno; _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking __dup2(%d, %d)", oldfd, newfd)); gf1 = gfs_hook_is_open(oldfd); gf2 = gfs_hook_is_open(newfd); if (gf1 == NULL && gf2 == NULL) return syscall(SYS_dup2, oldfd, newfd); _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: Hooking __dup2(%d, %d)", oldfd, newfd)); if (gf1 != NULL) { /* flush the buffer */ (void)gfs_pio_flush(gf1); if (gf2 == NULL) /* this file may be accessed by the child process */ gfs_pio_unset_calc_digest(gf1); } d = gfs_hook_dup_descriptor(oldfd); gfs_hook_set_descriptor(newfd, d); /* * dup2() should be called after gfs_hook_set_descriptor() * because newfd may be a descriptor reserved for a hooking point * of a Gfarm file. */ if (syscall(SYS_dup2, oldfd, newfd) == -1) return (-1); errno = errno_save; return (newfd); } int _dup2(int oldfd, int newfd) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking _dup2")); return (__dup2(oldfd, newfd)); } int dup2(int oldfd, int newfd) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking dup2")); return (__dup2(oldfd, newfd)); } #endif /* SYS_dup2 */ int __dup(int oldfd) { struct _gfs_file_descriptor *d; int newfd, errno_save = errno; GFS_File gf; _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking __dup(%d)", oldfd)); if ((gf = gfs_hook_is_open(oldfd)) == NULL) return syscall(SYS_dup, oldfd); _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: Hooking __dup(%d)", oldfd)); /* flush the buffer */ (void)gfs_pio_flush(gf); /* this file may be accessed by the child process */ gfs_pio_unset_calc_digest(gf); newfd = syscall(SYS_dup, oldfd); if (newfd == -1) return (-1); d = gfs_hook_dup_descriptor(oldfd); gfs_hook_set_descriptor(newfd, d); errno = errno_save; return (newfd); } int _dup(int oldfd) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking _dup")); return (__dup(oldfd)); } int dup(int oldfd) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking dup")); return (__dup(oldfd)); } /* * execve */ int __execve(const char *filename, char *const argv [], char *const envp[]) { char *url, *e; int status, r; pid_t pid; _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "Hooking __execve(%s)", filename)); if (!gfs_hook_is_url(filename, &url)) { if (gfs_hook_num_gfs_files() > 0) { _gfs_hook_debug( gflog_info(GFARM_MSG_UNFIXED, "GFS: __execve(%s) - fork : %d", filename, gfs_hook_num_gfs_files())); /* flush all of buffer */ gfs_hook_flush_all(); /* all files may be accessed by the child process */ gfs_hook_unset_calc_digest_all(); pid = fork(); } else pid = 0; switch (pid) { case -1: _gfs_hook_debug(perror("GFS: fork")); status = 255; break; case 0: r = syscall(SYS_execve, filename, argv, envp); if (gfs_hook_num_gfs_files() == 0) return (r); _gfs_hook_debug(perror(filename)); exit(255); default: while ((r = waitpid(pid, &status, 0)) == -1 && errno == EINTR); if (r == -1) { _gfs_hook_debug(perror("GFS: waitpid")); status = 255; } else if (WIFEXITED(status)) { switch (WEXITSTATUS(status)) { case 255: /* child process fails in execve */ _gfs_hook_debug( gflog_info(GFARM_MSG_UNFIXED, "%s(%d): %s", "GFS: waitpid", pid, "status 255")); /* XXX - need to obtain from child */ errno = ENOENT; return (-1); default: status = WEXITSTATUS(status); break; } } else if (WIFSIGNALED(status)) { _gfs_hook_debug( gflog_info(GFARM_MSG_UNFIXED, "%s(%d): signal %d received%s.", "GFS: waitpid", pid, WTERMSIG(status), WCOREDUMP(status) ? " (core dumped)" : "")); /* propagate the signal */ raise(WTERMSIG(status)); status = 255; } break; } e = gfs_hook_close_all(); if (e != NULL) _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "close_all: %s", e)); exit(status); } _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: Hooking __execve(%s)", url)); e = gfs_execve(url, argv, envp); free(url); _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: __execve: %s", e)); errno = gfarm_error_to_errno(e); return (-1); } int _execve(const char *filename, char *const argv [], char *const envp[]) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking _execve")); return (__execve(filename, argv, envp)); } int execve(const char *filename, char *const argv [], char *const envp[]) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking execve")); return (__execve(filename, argv, envp)); } int _private_execve(const char *filename, char *const argv [], char *const envp[]) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking execve")); return (__execve(filename, argv, envp)); } /* * utimes */ int __utimes(const char *path, const struct timeval *tvp) { char *e, *url; int errno_save = errno; _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking __utimes(%s, %p)", path, tvp)); if (!gfs_hook_is_url(path, &url)) { #ifdef SYS_utimes return syscall(SYS_utimes, path, tvp); #else /* e.g. linux */ if (tvp == NULL) { return syscall(SYS_utime, path, NULL); } else { struct utimbuf ut; ut.actime = tvp[0].tv_sec; ut.modtime = tvp[1].tv_sec; return syscall(SYS_utime, path, &ut); } #endif } _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: Hooking __utimes(%s)", url)); if (tvp == NULL) e = gfs_utimes(url, NULL); else { struct gfarm_timespec gt[2]; gt[0].tv_sec = tvp[0].tv_sec; gt[0].tv_nsec= tvp[0].tv_usec * 1000; gt[1].tv_sec = tvp[1].tv_sec; gt[1].tv_nsec= tvp[1].tv_usec * 1000; e = gfs_utimes(url, gt); } free(url); if (e == NULL) { errno = errno_save; return (0); } _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: __utimes: %s", e)); errno = gfarm_error_to_errno(e); return (-1); } int _utimes(const char *path, const struct timeval *tvp) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking _utimes")); return (__utimes(path, tvp)); } int utimes(const char *path, const struct timeval *tvp) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking utimes")); return (__utimes(path, tvp)); } /* * lutimes */ #ifdef SYS_lutimes int __lutimes(const char *path, const struct timeval *tvp) { char *e, *url; int errno_save = errno; _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking __lutimes(%s, %p)", path, tvp)); if (!gfs_hook_is_url(path, &url)) { return syscall(SYS_utimes, path, tvp); } _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: Hooking __lutimes(%s)", url)); if (tvp == NULL) e = gfs_utimes(url, NULL); else { struct gfarm_timespec gt[2]; gt[0].tv_sec = tvp[0].tv_sec; gt[0].tv_nsec= tvp[0].tv_usec * 1000; gt[1].tv_sec = tvp[1].tv_sec; gt[1].tv_nsec= tvp[1].tv_usec * 1000; e = gfs_utimes(url, gt); } free(url); if (e == NULL) { errno = errno_save; return (0); } _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: __lutimes: %s", e)); errno = gfarm_error_to_errno(e); return (-1); } int _lutimes(const char *path, const struct timeval *tvp) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking _lutimes")); return (__lutimes(path, tvp)); } int lutimes(const char *path, const struct timeval *tvp) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking lutimes")); return (__lutimes(path, tvp)); } #endif /* SYS_lutimes */ /* * utime */ #ifdef SYS_utime int __utime(const char *path, const struct utimbuf *buf) { char *e, *url; int errno_save = errno; _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking __utime(%s, %p)", path, buf)); if (!gfs_hook_is_url(path, &url)) return syscall(SYS_utime, path, buf); _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: Hooking __utime(%s)", url)); if (buf == NULL) e = gfs_utimes(url, NULL); else { struct gfarm_timespec gt[2]; gt[0].tv_sec = buf->actime; gt[0].tv_nsec= 0; gt[1].tv_sec = buf->modtime; gt[1].tv_nsec= 0; e = gfs_utimes(url, gt); } free(url); if (e == NULL) { errno = errno_save; return (0); } _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: __utime: %s", e)); errno = gfarm_error_to_errno(e); return (-1); } int _utime(const char *path, const struct utimbuf *buf) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking _utime")); return (__utime(path, buf)); } int utime(const char *path, const struct utimbuf *buf) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking utime")); return (__utime(path, buf)); } #endif /* SYS_utime */ /* * mkdir */ int __mkdir(const char *path, mode_t mode) { const char *e; char *url; int errno_save = errno; _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking __mkdir(%s, 0%o)", path, mode)); if (!gfs_hook_is_url(path, &url)) return syscall(SYS_mkdir, path, mode); _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: Hooking __mkdir(%s, 0%o)", path, mode)); e = gfs_mkdir(url, mode); free(url); if (e == NULL) { errno = errno_save; return (0); } _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: __mkdir: %s", e)); errno = gfarm_error_to_errno(e); return (-1); } int _mkdir(const char *path, mode_t mode) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking _mkdir")); return (__mkdir(path, mode)); } int mkdir(const char *path, mode_t mode) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking mkdir")); return (__mkdir(path, mode)); } /* * rmdir */ int __rmdir(const char *path) { const char *e; char *url; int errno_save = errno; _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking __rmdir(%s)", path)); if (!gfs_hook_is_url(path, &url)) return syscall(SYS_rmdir, path); _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: Hooking __rmdir(%s)", path)); e = gfs_rmdir(url); free(url); if (e == NULL) { errno = errno_save; return (0); } _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: __rmdir: %s", e)); errno = gfarm_error_to_errno(e); return (-1); } int _rmdir(const char *path) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking _rmdir")); return (__rmdir(path)); } int rmdir(const char *path) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking rmdir")); return (__rmdir(path)); } /* * chdir */ int __chdir(const char *path) { const char *e; char *url; int r, errno_save = errno; _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking __chdir(%s)", path)); if (!gfs_hook_is_url(path, &url)) { if ((r = syscall(SYS_chdir, path)) == 0) gfs_hook_set_cwd_is_gfarm(0); return (r); } _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: Hooking __chdir(%s)", path)); e = gfs_chdir(url); free(url); if (e == NULL) { gfs_hook_set_cwd_is_gfarm(1); errno = errno_save; return (0); } _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: __chdir: %s", e)); errno = gfarm_error_to_errno(e); return (-1); } int _chdir(const char *path) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking _chdir")); return (__chdir(path)); } int chdir(const char *path) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking chdir")); return (__chdir(path)); } /* * fchdir */ int __fchdir(int filedes) { const char *e; int r, errno_save = errno; _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking __fchdir(%d)", filedes)); if (gfs_hook_is_open(filedes) == NULL) { if ((r = syscall(SYS_fchdir, filedes)) == 0) gfs_hook_set_cwd_is_gfarm(0); return (r); } if (gfs_hook_gfs_file_type(filedes) != GFS_DT_DIR) { e = GFARM_ERR_NOT_A_DIRECTORY; goto error; } _gfs_hook_debug( gflog_info(GFARM_MSG_UNFIXED, "GFS: Hooking __fchdir(%d)", filedes)); e = gfs_chdir(gfs_hook_get_gfs_url(filedes)); if (e == NULL) { gfs_hook_set_cwd_is_gfarm(1); errno = errno_save; return (0); } error: _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: __fchdir: %s", e)); errno = gfarm_error_to_errno(e); return (-1); } int _fchdir(int filedes) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking _fchdir")); return (__fchdir(filedes)); } int fchdir(int filedes) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking fchdir")); return (__fchdir(filedes)); } /* * getcwd */ char * __getcwd(char *buf, size_t size) { const char *e; char *p; int alloced = 0; int prefix_size; int errno_save = errno; _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking __getcwd(%p, %lu)", buf, (unsigned long)size)); if (!gfs_hook_get_cwd_is_gfarm()) return (gfs_hook_syscall_getcwd(buf, size)); _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: Hooking __getcwd(%p, %lu)" ,buf, (unsigned long)size)); if (buf == NULL) { size = 2048; GFARM_MALLOC_ARRAY(buf, size); if (buf == NULL) { e = GFARM_ERR_NO_MEMORY; goto error; } alloced = 1; } e = gfs_hook_get_prefix(buf, size); if (e != NULL) goto error; prefix_size = strlen(buf); e = gfs_getcwd(buf + prefix_size, size - prefix_size); if (e == NULL) { /* root in Gfarm FS is a special case. '/gfarm/' -> '/gfarm' */ if (buf[0] == '/' && buf[prefix_size] == '/' && buf[prefix_size + 1] == '\0') buf[prefix_size] = '\0'; if (alloced) { GFARM_REALLOC_ARRAY(p, buf, strlen(buf) + 1); if (p != NULL) return (p); } errno = errno_save; return (buf); } error: if (alloced) free(buf); _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: __getcwd: %s", e)); errno = gfarm_error_to_errno(e); return (NULL); } char * _getcwd(char *buf, size_t size) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking _getcwd")); return (__getcwd(buf, size)); } char * getcwd(char *buf, size_t size) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking getcwd")); return (__getcwd(buf, size)); } /* * chmod */ int __chmod(const char *path, mode_t mode) { const char *e; char *url; int errno_save = errno; _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking __chmod(%s, 0%o)", path, mode)); if (!gfs_hook_is_url(path, &url)) return syscall(SYS_chmod, path, mode); _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: Hooking __chmod(%s, 0%o)", path, mode)); e = gfs_chmod(url, mode); free(url); if (e == NULL) { errno = errno_save; return (0); } _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: __chmod: %s", e)); errno = gfarm_error_to_errno(e); return (-1); } int _chmod(const char *path, mode_t mode) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking _chmod")); return (__chmod(path, mode)); } int chmod(const char *path, mode_t mode) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking chmod")); return (__chmod(path, mode)); } /* * lchmod */ #ifdef SYS_lchmod int __lchmod(const char *path, mode_t mode) { const char *e; char *url; int errno_save = errno; _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking __lchmod(%s, 0%o)", path, mode)); if (!gfs_hook_is_url(path, &url)) return syscall(SYS_lchmod, path, mode); _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: Hooking __lchmod(%s, 0%o)", path, mode)); e = gfs_chmod(url, mode); free(url); if (e == NULL) { errno = errno_save; return (0); } _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: __lchmod: %s", e)); errno = gfarm_error_to_errno(e); return (-1); } int _lchmod(const char *path, mode_t mode) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking _lchmod")); return (__lchmod(path, mode)); } int lchmod(const char *path, mode_t mode) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking lchmod")); return (__lchmod(path, mode)); } #endif /* SYS_lchmod */ /* * fchmod */ int __fchmod(int filedes, mode_t mode) { GFS_File gf; char *e, *url; int errno_save = errno; _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking __fchmod(%d, 0%o)", filedes, mode)); if ((gf = gfs_hook_is_open(filedes)) == NULL) return syscall(SYS_fchmod, filedes, mode); _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: Hooking __fchmod(%d, 0%o)", filedes, mode)); switch (gfs_hook_gfs_file_type(filedes)) { case GFS_DT_REG: e = gfs_fchmod(gf, mode); break; case GFS_DT_DIR: url = gfarm_url_prefix_add(gfs_dirname((GFS_Dir)gf)); if (url == NULL) { e = GFARM_ERR_NO_MEMORY; break; } e = gfs_chmod(url, mode); free(url); break; default: _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: Hooking __fchmod: couldn't get gf or dir")); errno = EBADF; /* XXX - something broken */ return (-1); } if (e == NULL) { errno = errno_save; return (0); } _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: __fchmod: %s", e)); errno = gfarm_error_to_errno(e); return (-1); } int _fchmod(int filedes, mode_t mode) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking _fchmod")); return (__fchmod(filedes, mode)); } int fchmod(int filedes, mode_t mode) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking fchmod")); return (__fchmod(filedes, mode)); } /* * chown - not well tested */ int __syscall_chown(const char *path, uid_t owner, gid_t group) { #ifdef SYS_chown32 return (syscall(SYS_chown32, path, owner, group)); #else return (syscall(SYS_chown, path, owner, group)); #endif } int __chown(const char *path, uid_t owner, gid_t group) { const char *e; char *url; struct gfs_stat s; int errno_save = errno; _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking __chown(%s, %d, %d)", path, owner, group)); if (!gfs_hook_is_url(path, &url)) return (__syscall_chown(path, owner, group)); _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: Hooking __chown(%s, %d, %d)", path, owner, group)); e = gfs_stat(url, &s); free(url); if (e == NULL) { if (strcmp(s.st_user, gfarm_get_global_username()) != 0) e = GFARM_ERR_OPERATION_NOT_PERMITTED; /* EPERM */ /* XXX - do nothing */ gfs_stat_free(&s); } if (e == NULL) { errno = errno_save; return (0); } _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: __chown: %s", e)); errno = gfarm_error_to_errno(e); return (-1); } int _chown(const char *path, uid_t owner, gid_t group) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking _chown")); return (__chown(path, owner, group)); } int chown(const char *path, uid_t owner, gid_t group) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking chown")); return (__chown(path, owner, group)); } int __syscall_lchown(const char *path, uid_t owner, gid_t group) { #ifdef SYS_lchown32 return (syscall(SYS_lchown32, path, owner, group)); #else return (syscall(SYS_lchown, path, owner, group)); #endif } int __lchown(const char *path, uid_t owner, gid_t group) { const char *e; char *url; struct gfs_stat s; int errno_save = errno; _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking __lchown(%s, %d, %d)", path, owner, group)); if (!gfs_hook_is_url(path, &url)) return (__syscall_lchown(path, owner, group)); _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: Hooking __lchown(%s, %d, %d)", path, owner, group)); /* XXX - gfs_lstat is not supported */ e = gfs_stat(url, &s); free(url); if (e == NULL) { if (strcmp(s.st_user, gfarm_get_global_username()) != 0) e = GFARM_ERR_OPERATION_NOT_PERMITTED; /* EPERM */ /* XXX - do nothing */ gfs_stat_free(&s); } if (e == NULL) { errno = errno_save; return (0); } _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: __lchown: %s", e)); errno = gfarm_error_to_errno(e); return (-1); } int _lchown(const char *path, uid_t owner, gid_t group) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking _lchown")); return (__lchown(path, owner, group)); } int lchown(const char *path, uid_t owner, gid_t group) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking lchown")); return (__lchown(path, owner, group)); } int __syscall_fchown(int fd, uid_t owner, gid_t group) { #ifdef SYS_fchown32 return (syscall(SYS_fchown32, fd, owner, group)); #else return (syscall(SYS_fchown, fd, owner, group)); #endif } int __fchown(int fd, uid_t owner, gid_t group) { GFS_File gf; const char *e; int errno_save = errno; struct gfs_stat s; _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking __fchown(%d, %d, %d)", fd, owner, group)); if ((gf = gfs_hook_is_open(fd)) == NULL) return (__syscall_fchown(fd, owner, group)); _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: Hooking __fchown(%d, %d, %d)", fd, owner, group)); e = gfs_fstat(gf, &s); if (e == NULL) { if (strcmp(s.st_user, gfarm_get_global_username()) != 0) e = GFARM_ERR_OPERATION_NOT_PERMITTED; /* EPERM */ /* XXX - do nothing */ gfs_stat_free(&s); } if (e == NULL) { errno = errno_save; return (0); } _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: __fchown: %s", e)); errno = gfarm_error_to_errno(e); return (-1); } int _fchown(int fd, uid_t owner, gid_t group) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking _fchown")); return (__fchown(fd, owner, group)); } int fchown(int fd, uid_t owner, gid_t group) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking fchown")); return (__fchown(fd, owner, group)); } /* * acl */ #ifdef SYS_acl #ifdef OS_SOLARIS /* make `mv' command work with gfs_hook on Solaris */ #include int __acl(const char *path, int cmd, int nentries, aclent_t *aclbuf) { const char *e; char *url; struct gfs_stat s; gfarm_mode_t mode; int n, errno_save = errno; _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking __acl(%s, 0x%x)", path, cmd)); if (!gfs_hook_is_url(path, &url)) return (syscall(SYS_acl, path, cmd, nentries, aclbuf)); _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: Hooking __acl(%s, 0x%x)", path, cmd)); e = gfs_stat(url, &s); free(url); if (e != NULL) { _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: __acl: %s", e)); errno = gfarm_error_to_errno(e); return (-1); } mode = s.st_mode; gfs_stat_free(&s); switch (cmd) { case SETACL: errno = ENOSYS; return (-1); case GETACL: if (nentries < 4) { errno = nentries < 3 ? EINVAL : ENOSPC; return (-1); } aclbuf[0].a_type = USER_OBJ; aclbuf[0].a_id = getuid(); /* XXX */ aclbuf[0].a_perm = (mode >> 6) & 07; aclbuf[1].a_type = GROUP_OBJ; aclbuf[1].a_id = getgid(); /* XXX */ aclbuf[1].a_perm = (mode >> 3) & 07; aclbuf[2].a_type = CLASS_OBJ; aclbuf[2].a_id = 0; /* ??? */ aclbuf[2].a_perm = (mode >> 3) & 07; /* ??? */ aclbuf[3].a_type = OTHER_OBJ; aclbuf[3].a_id = 0; aclbuf[3].a_perm = mode & 07; errno = errno_save; return (4); case GETACLCNT: errno = errno_save; return (4); /* USER_OBJ, GROUP_OBJ, CLASS_OBJ, OTHER_OBJ */ default: errno = EINVAL; return (-1); } } int _acl(const char *path, int cmd, int nentries, aclent_t *aclbuf) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking _acl")); return (__acl(path, cmd, nentries, aclbuf)); } int acl(const char *path, int cmd, int nentries, aclent_t *aclbuf) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking acl")); return (__acl(path, cmd, nentries, aclbuf)); } #endif /* OS_SOLARIS */ #endif /* acl */ /* * rename */ int __rename(const char *oldpath, const char *newpath) { const char *e; char *oldurl, *newurl; int old_is_url, new_is_url; int errno_save = errno; _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking __rename(%s, %s)", oldpath, newpath)); old_is_url = gfs_hook_is_url(oldpath, &oldurl); new_is_url = gfs_hook_is_url(newpath, &newurl); if (!old_is_url || !new_is_url) { if (old_is_url) free(oldurl); if (new_is_url) free(newurl); if (old_is_url != new_is_url) { errno = EXDEV; return (-1); } errno = errno_save; return (syscall(SYS_rename, oldpath, newpath)); } _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: Hooking __rename(%s, %s)", oldpath, newpath)); e = gfs_rename(oldurl, newurl); free(oldurl); free(newurl); if (e == NULL) { errno = errno_save; return (0); } _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: __rename: %s", e)); errno = gfarm_error_to_errno(e); return (-1); } int _rename(const char *oldpath, const char *newpath) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking _rename")); return (__rename(oldpath, newpath)); } int rename(const char *oldpath, const char *newpath) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking rename")); return (__rename(oldpath, newpath)); } /* * symlink */ int __symlink(const char *oldpath, const char *newpath) { const char *e; char *url; _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking __symlink(%s, %s)", oldpath, newpath)); if (!gfs_hook_is_url(newpath, &url)) return (syscall(SYS_symlink, oldpath, newpath)); _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: Hooking __symlink(%s, %s)", oldpath, newpath)); /* * Gfarm file system does not support the creation of * symbolic link yet. */ e = GFARM_ERR_OPERATION_NOT_PERMITTED; /* EPERM */ free(url); _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: __symlink: %s", e)); errno = gfarm_error_to_errno(e); return (-1); } int _symlink(const char *oldpath, const char *newpath) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking _symlink")); return (__symlink(oldpath, newpath)); } int symlink(const char *oldpath, const char *newpath) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking symlink")); return (__symlink(oldpath, newpath)); } /* * link */ int __link(const char *oldpath, const char *newpath) { const char *e; char *url; _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking __link(%s, %s)", oldpath, newpath)); if (!gfs_hook_is_url(newpath, &url)) return (syscall(SYS_link, oldpath, newpath)); _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: Hooking __link(%s, %s)", oldpath, newpath)); /* * Gfarm file system does not support the creation of * hard link yet. */ e = GFARM_ERR_OPERATION_NOT_PERMITTED; /* EPERM */ free(url); _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: __link: %s", e)); errno = gfarm_error_to_errno(e); return (-1); } int _link(const char *oldpath, const char *newpath) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking _link")); return (__link(oldpath, newpath)); } int link(const char *oldpath, const char *newpath) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking link")); return (__link(oldpath, newpath)); } #ifdef __linux__ /* xattr related system calls */ /* * getxattr */ int getxattr(const char *path, const char *name, void *value, size_t size) { char *e, *gfarm_file; char *url; _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking getxattr(%s, %s, %p, %lu)", path, name, value, (unsigned long)size)); if (!gfs_hook_is_url(path, &url)) #ifdef SYS_getxattr return syscall(SYS_getxattr, path, name, value, size); #else { errno = ENODATA; return (-1); } #endif _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: Hooking getxattr(%s, %s, %p, %lu)", path, name, value, (unsigned long)size)); e = gfarm_url_make_path(url, &gfarm_file); free(url); if (e == NULL) { e = GFARM_ERR_OPERATION_NOT_SUPPORTED; free(gfarm_file); } _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: getxattr: %s", e)); errno = gfarm_error_to_errno(e); return (-1); } /* * lgetxattr */ int lgetxattr(const char *path, const char *name, void *value, size_t size) { char *e, *gfarm_file; char *url; _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking lgetxattr(%s, %s, %p, %lu)", path, name, value, (unsigned long)size)); if (!gfs_hook_is_url(path, &url)) #ifdef SYS_lgetxattr return syscall(SYS_lgetxattr, path, name, value, size); #else { errno = ENODATA; return (-1); } #endif _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: Hooking lgetxattr(%s, %s, %p, %lu)", path, name, value, (unsigned long)size)); e = gfarm_url_make_path(url, &gfarm_file); free(url); if (e == NULL) { e = GFARM_ERR_OPERATION_NOT_SUPPORTED; free(gfarm_file); } _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: lgetxattr: %s", e)); errno = gfarm_error_to_errno(e); return (-1); } /* * fgetxattr */ int fgetxattr(int filedes, const char *name, void *value, size_t size) { char *e; _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking fgetxattr(%d, %s, %p, %lu)", filedes, name, value, (unsigned long)size)); if (!gfs_hook_is_open(filedes)) #ifdef SYS_fgetxattr return syscall(SYS_fgetxattr, filedes, name, value, size); #else { errno = ENODATA; return (-1); } #endif _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: Hooking fgetxattr(%d, %s, %p, %lu)", filedes, name, value, (unsigned long)size)); e = GFARM_ERR_OPERATION_NOT_SUPPORTED; _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: fgetxattr: %s", e)); errno = gfarm_error_to_errno(e); return (-1); } /* * setxattr */ int setxattr(const char *path, const char *name, void *value, size_t size, int flags) { char *e, *gfarm_file; char *url; _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking setxattr(%s, %s, %p, %lu, %d)", path, name, value, (unsigned long)size, flags)); if (!gfs_hook_is_url(path, &url)) #ifdef SYS_setxattr return syscall(SYS_setxattr, path, name, value, size, flags); #else { errno = ENOTSUP; return (-1); } #endif _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: Hooking setxattr(%s, %s, %p, %lu, %d)", path, name, value, (unsigned long)size, flags)); e = gfarm_url_make_path(url, &gfarm_file); free(url); if (e == NULL) { e = GFARM_ERR_OPERATION_NOT_SUPPORTED; free(gfarm_file); } _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: setxattr: %s", e)); errno = gfarm_error_to_errno(e); return (-1); } /* * lsetxattr */ int lsetxattr(const char *path, const char *name, void *value, size_t size, int flags) { char *e, *gfarm_file; char *url; _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking lsetxattr(%s, %s, %p, %lu, %d)", path, name, value, (unsigned long)size, flags)); if (!gfs_hook_is_url(path, &url)) #ifdef SYS_lsetxattr return syscall(SYS_lsetxattr, path, name, value, size, flags); #else { errno = ENOTSUP; return (-1); } #endif _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: Hooking lsetxattr(%s, %s, %p, %lu, %d)", path, name, value, (unsigned long)size, flags)); e = gfarm_url_make_path(url, &gfarm_file); free(url); if (e == NULL) { e = GFARM_ERR_OPERATION_NOT_SUPPORTED; free(gfarm_file); } _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: lsetxattr: %s", e)); errno = gfarm_error_to_errno(e); return (-1); } /* * fsetxattr */ int fsetxattr(int filedes, const char *name, void *value, size_t size, int flags) { char *e; _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking fsetxattr(%d, %s, %p, %lu, %d)", filedes, name, value, (unsigned long)size, flags)); if (!gfs_hook_is_open(filedes)) #ifdef SYS_fsetxattr return syscall(SYS_fsetxattr, filedes, name, value, size, flags); #else { errno = ENOTSUP; return (-1); } #endif _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: Hooking fsetxattr(%d, %s, %p, %lu, %d)", filedes, name, value, (unsigned long)size, flags)); e = GFARM_ERR_OPERATION_NOT_SUPPORTED; _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: fsetxattr: %s", e)); errno = gfarm_error_to_errno(e); return (-1); } #endif /* __linux__ - xattr related system calls */ /* * mknod */ #ifndef _MKNOD_VER int __mknod(const char *path, mode_t mode, dev_t dev) { const char *e; char *url; struct gfs_stat gs; GFS_File gf; int errno_save = errno; _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking __mknod")); if (!gfs_hook_is_url(path, &url)) return (syscall(SYS_mknod, path, mode, dev)); _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: Hooking __mknod(%s, %o)", path, mode)); if (gfs_hook_get_current_view() == section_view) e = gfs_stat_section(url, gfs_hook_get_current_section(), &gs); else e = gfs_stat(url, &gs); if (e == NULL) { gfs_stat_free(&gs); errno = EEXIST; return (-1); } else if (e == GFARM_ERR_NO_SUCH_OBJECT) { /* fall through */ } else { errno = gfarm_error_to_errno(e); return (-1); } switch(mode & S_IFMT) { case S_IFCHR: case S_IFBLK: case S_IFIFO: case S_IFSOCK: errno = EPERM; return (-1); #if defined(OS_SOLARIS) || defined(__linux__) case 0: #endif case S_IFREG: if ((e = gfs_pio_create(url, GFARM_FILE_WRONLY|GFARM_FILE_EXCLUSIVE, mode, &gf)) != NULL) { errno = gfarm_error_to_errno(e); return (-1); } if ((e = gfs_pio_close(gf)) != NULL) { errno = gfarm_error_to_errno(e); return (-1); } errno = errno_save; return (0); } errno = EINVAL; return (-1); } int _mknod(const char *path, mode_t mode, dev_t dev) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking _mknod")); return (__mknod(path, mode, dev)); } int mknod(const char *path, mode_t mode, dev_t dev) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking mknod")); return (__mknod(path, mode, dev)); } #else /* defined _MKNOD_VER */ #ifdef __linux__ int __mknod(const char *path, mode_t mode, dev_t dev) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking __mknod")); return (__xmknod(_MKNOD_VER, path, mode, &dev)); } int _mknod(const char *path, mode_t mode, dev_t dev) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking _mknod")); return (__xmknod(_MKNOD_VER, path, mode, &dev)); } #endif /* __linux__ */ int #ifdef OS_SOLARIS __xmknod(const int ver, const char *path, mode_t mode, dev_t dev) #else __xmknod(int ver, const char *path, mode_t mode, dev_t *dev) #endif { const char *e; char *url; int errno_save = errno; struct gfs_stat gs; GFS_File gf; _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking __xmknod")); if (!gfs_hook_is_url(path, &url)) #ifdef SYS_xmknod return (syscall(SYS_xmknod, ver, path, mode, dev)); #else /* !defined(SYS_xmknod) */ return (syscall(SYS_mknod, path, mode, *dev)); #endif /* SYS_xmknod */ _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: Hooking __xmknod(%s, %o)", path, mode)); if (gfs_hook_get_current_view() == section_view) e = gfs_stat_section(url, gfs_hook_get_current_section(), &gs); else e = gfs_stat(url, &gs); if (e == NULL) { gfs_stat_free(&gs); errno = EEXIST; return (-1); } else if (e == GFARM_ERR_NO_SUCH_OBJECT) { /* fall through */ } else { errno = gfarm_error_to_errno(e); return (-1); } switch(mode & S_IFMT) { case S_IFCHR: case S_IFBLK: case S_IFIFO: case S_IFSOCK: errno = EPERM; return (-1); #if defined(OS_SOLARIS) || defined(__linux__) case 0: #endif case S_IFREG: if ((e = gfs_pio_create(url, GFARM_FILE_WRONLY|GFARM_FILE_EXCLUSIVE, mode, &gf)) != NULL) { errno = gfarm_error_to_errno(e); return (-1); } if ((e = gfs_pio_close(gf)) != NULL) { errno = gfarm_error_to_errno(e); return (-1); } errno = errno_save; return (0); } errno = EINVAL; return (-1); } int #ifdef OS_SOLARIS _xmknod(const int ver, const char *path, mode_t mode, dev_t dev) #else _xmknod(int ver, const char *path, mode_t mode, dev_t *dev) #endif { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking _xmknod")); return (__xmknod(ver, path, mode, dev)); } #endif /* _MKNOD_VER */ /* XXX - Eventualy we always need fcntl() hook, but not for now... */ #if defined(F_FREESP) || defined(F_FREESP64) int __fcntl(int filedes, int cmd, ...) { va_list ap; GFS_File gf; char *e; unsigned long val; int errno_save = errno; va_start(ap, cmd); val = va_arg(ap, unsigned long); va_end(ap); _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking __fcntl(%d, %d, %x)", filedes, cmd, val)); #ifdef F_FREESP if (cmd == F_FREESP) _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "flock.l_start:%ld", (long)(((struct flock *)val)->l_start))); #endif #ifdef F_FREESP64 if (cmd == F_FREESP64) _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "flock64.l_start:%ld", (long)(((struct flock64 *)val)->l_start))); #endif if (cmd == F_GETFD || cmd == F_SETFD || (gf = gfs_hook_is_open(filedes)) == NULL) return (syscall(SYS_fcntl, filedes, cmd, val)); _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: Hooking __fcntl(%d(%d), %d, %x)", filedes, gfs_pio_fileno(gf), cmd, val)); switch (cmd) { #ifdef F_FREESP case F_FREESP: if (gfs_hook_gfs_file_type(filedes) == GFS_DT_DIR) { e = GFARM_ERR_IS_A_DIRECTORY; break; } e = gfs_pio_truncate(gf, ((struct flock *)val)->l_start); break; #endif #ifdef F_FREESP64 case F_FREESP64: if (gfs_hook_gfs_file_type(filedes) == GFS_DT_DIR) { e = GFARM_ERR_IS_A_DIRECTORY; break; } e = gfs_pio_truncate(gf, ((struct flock64 *)val)->l_start); break; #endif default: e = GFARM_ERR_FUNCTION_NOT_IMPLEMENTED; break; } if (e == NULL) { errno = errno_save; return (0); } _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: __fcntl: %s", e)); errno = gfarm_error_to_errno(e); return (-1); } int _fcntl(int filedes, int cmd, ...) { va_list ap; unsigned long val; va_start(ap, cmd); val = va_arg(ap, unsigned long); va_end(ap); _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking fcntl(%d, %d, %x)", filedes, cmd, val)); return (__fcntl(filedes, cmd, val)); } int fcntl(int filedes, int cmd, ...) { va_list ap; unsigned long val; va_start(ap, cmd); val = va_arg(ap, unsigned long); va_end(ap); _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking fcntl(%d, %d, %x)", filedes, cmd, val)); return (__fcntl(filedes, cmd, val)); } #endif /* defined(F_FREESP) || defined(F_FREESP64) */ int __fsync(int filedes) { GFS_File gf; char *e; int errno_save = errno; _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking __fsync(%d)", filedes)); if ((gf = gfs_hook_is_open(filedes)) == NULL) #ifdef SYS_fdsync /* Solaris */ return (syscall(SYS_fdsync, filedes, FSYNC)); #else return (syscall(SYS_fsync, filedes)); #endif _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: Hooking __fsync(%d(%d))", filedes, gfs_pio_fileno(gf))); e = gfs_pio_sync(gf); if (e == NULL) { errno = errno_save; return (0); } _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: __fsync: %s", e)); errno = gfarm_error_to_errno(e); return (-1); } int _fsync(int filedes) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking _fsync(%d)", filedes)); return (__fsync(filedes)); } int fsync(int filedes) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking fsync(%d)", filedes)); return (__fsync(filedes)); } #if defined(SYS_fdatasync) || defined(SYS_fdsync) int __fdatasync(int filedes) { GFS_File gf; char *e; int errno_save = errno; _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking __fdatasync(%d)", filedes)); if ((gf = gfs_hook_is_open(filedes)) == NULL) #ifdef SYS_fdsync /* Solaris */ return (syscall(SYS_fdsync, filedes, FDSYNC)); #else return (syscall(SYS_fdatasync, filedes)); #endif _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: Hooking __fdatasync(%d(%d))", filedes, gfs_pio_fileno(gf))); e = gfs_pio_datasync(gf); if (e == NULL) { errno = errno_save; return (0); } _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: __fdatasync: %s", e)); errno = gfarm_error_to_errno(e); return (-1); } int _fdatasync(int filedes) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking _fdatasync(%d)", filedes)); return (__fdatasync(filedes)); } int fdatasync(int filedes) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking fdatasync(%d)", filedes)); return (__fdatasync(filedes)); } #endif /* SYS_fdatasync */ #if defined(HAVE_FDOPENDIR) && defined(OS_SOLARIS) /* * opendir - this entry is needed to hook opendir on Solaris 9 */ DIR * opendir(const char *dirname) { DIR *dirp; int d; d = open(dirname, O_RDONLY | O_NDELAY | O_LARGEFILE, 0); if (d < 0) return (NULL); dirp = fdopendir(d); if (dirp == NULL) (void)close(d); return (dirp); } #endif /* sun */ /* * definitions for "hooks_common.c" */ int gfs_hook_syscall_open(const char *path, int oflag, mode_t mode) { return (syscall(SYS_open, path, oflag, mode)); } int gfs_hook_syscall_creat(const char *path, mode_t mode) { return (gfs_hook_syscall_open(path, O_CREAT|O_TRUNC|O_WRONLY, mode)); } off_t gfs_hook_syscall_lseek(int filedes, off_t offset, int whence) { #ifdef USE_BSD_LSEEK_ARGUMENT return (__syscall((quad_t)SYS_lseek, filedes, 0, offset, whence)); #else return (syscall(SYS_lseek, filedes, offset, whence)); #endif } #ifdef SYS_pread ssize_t gfs_hook_syscall_pread(int filedes, void *buf, size_t nbyte, off_t offset) { #if defined(__NetBSD__) int64_t q; q = syscall((int64_t)SYS_pread, filedes, buf, nbyte, 0, offset); # ifndef WORDS_BIGENDIAN return ((int)q); # else if (sizeof(int64_t) == sizeof(register_t)) return ((int)q); else return ((int)((uint64_t)q >> 32)); # endif #elif defined(__FreeBSD__) || defined(__DragonFly__) || defined(__OpenBSD__) return (syscall((int64_t)SYS_pread, filedes, buf, nbyte, 0, offset)); #else return (syscall(SYS_pread, filedes, buf, nbyte, offset)); #endif } #define SYSCALL_PREAD(filedes, buf, nbyte, offset) \ gfs_hook_syscall_pread(filedes, buf, nbyte, offset) #define FUNC___PREAD __pread #define FUNC__PREAD _pread #define FUNC_PREAD pread #endif #ifdef SYS_pwrite ssize_t gfs_hook_syscall_pwrite(int filedes, const void *buf, size_t nbyte, off_t offset) { #if defined(__NetBSD__) int64_t q; q = syscall((int64_t)SYS_pwrite, filedes, buf, nbyte, 0, offset); # ifndef WORDS_BIGENDIAN return ((int)q); # else if (sizeof(int64_t) == sizeof(register_t)) return ((int)q); else return ((int)((uint64_t)q >> 32)); # endif #elif defined(__FreeBSD__) || defined(__DragonFly__) || defined(__OpenBSD__) return (syscall((int64_t)SYS_pwrite, filedes, buf, nbyte, 0, offset)); #else return (syscall(SYS_pwrite, filedes, buf, nbyte, offset)); #endif } #define SYSCALL_PWRITE(filedes, buf, nbyte, offset) \ gfs_hook_syscall_pwrite(filedes, buf, nbyte, offset) #define FUNC___PWRITE __pwrite #define FUNC__PWRITE _pwrite #define FUNC_PWRITE pwrite #endif #ifdef HOOK_GETDIRENTRIES int gfs_hook_syscall_getdirentries(int filedes, char *buf, int nbyte, long *offp) { return (syscall(SYS_getdirentries, filedes, buf, nbyte, offp)); } #elif !defined(__linux__) /* linux version is defined in sysdep/linux/ */ int gfs_hook_syscall_getdents(int filedes, struct dirent *buf, size_t nbyte) { return (syscall(SYS_getdents, filedes, buf, nbyte)); } #endif /* !defined(__linux__) */ #ifdef SYS_truncate int gfs_hook_syscall_truncate(const char *path, off_t length) { #if defined(__NetBSD__) int64_t q; q = syscall((int64_t)SYS_truncate, path, 0, length); # ifndef WORDS_BIGENDIAN return (q); # else if (sizeof(int64_t) == sizeof(register_t)) return (q); else return (((uint64_t)q >> 32)); # endif #elif defined(__FreeBSD__) || defined(__DragonFly__) || defined(__OpenBSD__) return (syscall((int64_t)SYS_truncate, path, 0, length)); #else return (syscall(SYS_truncate, path, length)); #endif } #define SYSCALL_TRUNCATE(path, length) \ gfs_hook_syscall_truncate(path, length) #define FUNC___TRUNCATE __truncate #define FUNC__TRUNCATE _truncate #define FUNC_TRUNCATE truncate #endif #ifdef SYS_ftruncate int gfs_hook_syscall_ftruncate(int filedes, off_t length) { #if defined(__NetBSD__) int64_t q; q = syscall((int64_t)SYS_ftruncate, filedes, 0, length); # ifndef WORDS_BIGENDIAN return (q); # else if (sizeof(int64_t) == sizeof(register_t)) return (q); else return (((uint64_t)q >> 32)); # endif #elif defined(__FreeBSD__) || defined(__DragonFly__) || defined(__OpenBSD__) return (syscall((int64_t)SYS_ftruncate, filedes, 0, length)); #else return (syscall(SYS_ftruncate, filedes, length)); #endif } #define SYSCALL_FTRUNCATE(filedes, length) \ gfs_hook_syscall_ftruncate(filedes, length) #define FUNC___FTRUNCATE __ftruncate #define FUNC__FTRUNCATE _ftruncate #define FUNC_FTRUNCATE ftruncate #endif int gfs_hook_syscall_stat(const char *path, struct stat *buf) { #ifndef _STAT_VER return (syscall(SYS_stat, path, buf)); #else /* SVR4 or Linux */ return (gfs_hook_syscall_xstat(_STAT_VER, path, buf)); #endif } int gfs_hook_syscall_lstat(const char *path, struct stat *buf) { #ifndef _STAT_VER return (syscall(SYS_lstat, path, buf)); #else /* SVR4 or Linux */ return (gfs_hook_syscall_lxstat(_STAT_VER, path, buf)); #endif } int gfs_hook_syscall_fstat(int filedes, struct stat *buf) { #ifndef _STAT_VER return (syscall(SYS_fstat, filedes, buf)); #else /* SVR4 or Linux */ return (gfs_hook_syscall_fxstat(_STAT_VER, filedes, buf)); #endif } #if defined(_STAT_VER) && defined(SYS_xstat) /* * for SVR4. * * but not for Linux. (see sysdep/linux/xstat.c for Linux version) */ int gfs_hook_syscall_xstat(int ver, const char *path, struct stat *buf) { return (syscall(SYS_xstat, ver, path, buf)); } int gfs_hook_syscall_lxstat(int ver, const char *path, struct stat *buf) { return (syscall(SYS_lxstat, ver, path, buf)); } int gfs_hook_syscall_fxstat(int ver, int filedes, struct stat *buf) { return (syscall(SYS_fxstat, ver, filedes, buf)); } #endif /* defined(_STAT_VER) && defined(SYS_xstat) */ #define OFF_T off_t #define SYSCALL_OPEN(path, oflag, mode) \ gfs_hook_syscall_open(path, oflag, mode) #define SYSCALL_CREAT(path, mode) \ gfs_hook_syscall_creat(path, mode) #define SYSCALL_LSEEK(filedes, offset, whence) \ gfs_hook_syscall_lseek(filedes, offset, whence) #define FUNC___OPEN __open #define FUNC__OPEN _open #define FUNC_OPEN open #define FUNC___CREAT __creat #define FUNC__CREAT _creat #define FUNC_CREAT creat #define FUNC__LIBC_CREAT _libc_creat #define FUNC___LSEEK __lseek #define FUNC__LSEEK _lseek #define FUNC_LSEEK lseek #ifdef HOOK_GETDIRENTRIES #define SYSCALL_GETDENTS(filedes, buf, nbyte, offp) \ gfs_hook_syscall_getdirentries(filedes, buf, nbyte, offp) #define FUNC___GETDENTS __getdirentries #define FUNC__GETDENTS _getdirentries #define FUNC_GETDENTS getdirentries #else #define SYSCALL_GETDENTS(filedes, buf, nbyte) \ gfs_hook_syscall_getdents(filedes, buf, nbyte) #define FUNC___GETDENTS __getdents #define FUNC__GETDENTS _getdents #define FUNC_GETDENTS getdents #endif #define STRUCT_DIRENT struct dirent #define ALIGNMENT 8 #define ALIGN(p) (((unsigned long)(p) + ALIGNMENT - 1) & ~(ALIGNMENT - 1)) #include "hooks_common.c" #undef ALIGNMENT #if defined(HOOK_GETDIRENTRIES) && defined(HAVE_GETDENTS) int __getdent(int filedes, char *buf, unsigned int nbyte) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking __getdent: %d", filedes)); return (FUNC___GETDENTS(filedes, (STRUCT_DIRENT *)buf, nbyte, NULL)); } int _getdent(int filedes, char *buf, unsigned int nbyte) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking _getdent: %d", filedes)); return (FUNC___GETDENTS(filedes, (STRUCT_DIRENT *)buf, nbyte, NULL)); } int getdent(int filedes, char *buf, unsigned int nbyte) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking getdent: %d", filedes)); return (FUNC___GETDENTS(filedes, (STRUCT_DIRENT *)buf, nbyte, NULL)); } #endif /* defined(HOOK_GETDIRENTRIES) && defined(HAVE_GETDENTS) */ /* stat */ #define STRUCT_STAT struct stat #define SYSCALL_STAT(path, buf) \ gfs_hook_syscall_stat(path, buf) #define FUNC___STAT __stat #define FUNC__STAT _stat #define FUNC_STAT stat #define GFS_STAT gfs_stat #define GFS_STAT_SECTION gfs_stat_section #define GFS_STAT_INDEX gfs_stat_index #ifdef _STAT_VER /* SVR4 or Linux */ #define SYSCALL_XSTAT(ver, path, buf) \ gfs_hook_syscall_xstat(ver, path, buf) #define FUNC___XSTAT __xstat #define FUNC__XSTAT _xstat #endif #include "hooks_stat.c" #undef SYSCALL_STAT #undef FUNC___STAT #undef FUNC__STAT #undef FUNC_STAT #undef GFS_STAT #ifdef _STAT_VER /* SVR4 or Linux */ #undef SYSCALL_XSTAT #undef FUNC___XSTAT #undef FUNC__XSTAT #endif /* lstat */ #define SYSCALL_STAT(path, buf) \ gfs_hook_syscall_lstat(path, buf) #define FUNC___STAT __lstat #define FUNC__STAT _lstat #define FUNC_STAT lstat #define GFS_STAT gfs_stat /* XXX - gfs_lstat is not implemented yet. */ #ifdef _STAT_VER /* SVR4 or Linux */ #define SYSCALL_XSTAT(ver, path, buf) \ gfs_hook_syscall_lxstat(ver, path, buf) #define FUNC___XSTAT __lxstat #define FUNC__XSTAT _lxstat #endif #include "hooks_stat.c" /* fstat */ #define SYSCALL_FSTAT(path, buf) \ gfs_hook_syscall_fstat(path, buf) #define FUNC___FSTAT __fstat #define FUNC__FSTAT _fstat #define FUNC_FSTAT fstat #define GFS_FSTAT gfs_fstat #ifdef _STAT_VER /* SVR4 or Linux */ #define SYSCALL_FXSTAT(ver, fd, buf) \ gfs_hook_syscall_fxstat(ver, fd, buf) #define FUNC___FXSTAT __fxstat #define FUNC__FXSTAT _fxstat #endif #include "hooks_fstat.c" gfarm-2.4.1/lib/gfs_hook/hooks_common.c0000644000000000000000000005001311507222722016513 0ustar rootroot/* * $Id: hooks_common.c 4303 2010-01-06 01:45:08Z ookuma $ */ /* * open */ int FUNC___OPEN(const char *path, int oflag, ...) { GFS_File gf; const char *e; char *url; va_list ap; mode_t mode; int filedes; struct gfs_stat gs; int is_directory, errno_save = errno; int nf = -1, np; va_start(ap, oflag); /* * We need `int' instead of `mode_t' in va_arg() below, because * sizeof(mode_t) < sizeof(int) on some platforms (e.g. FreeBSD), * and gcc-3.4/gcc-4's builtin va_arg() warns the integer promotion. * XXX this doesn't work, if sizeof(mode_t) > sizeof(int), * but currently there isn't any such platform as far as we know. */ mode = va_arg(ap, int); va_end(ap); _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking " S(FUNC___OPEN) "(%s, 0%o)", path, oflag)); if (!gfs_hook_is_url(path, &url)) return (SYSCALL_OPEN(path, oflag, mode)); if (gfs_hook_get_current_view() == section_view) e = gfs_stat_section(url, gfs_hook_get_current_section(), &gs); else e = gfs_stat(url, &gs); if (e == NULL) { is_directory = GFARM_S_ISDIR(gs.st_mode); gfs_stat_free(&gs); } else { /* XXX - metadata may be incomplete. anyway, continue. */ /* XXX - metadata of a directory should not be imcomplete */ is_directory = 0; if (e != GFARM_ERR_NO_SUCH_OBJECT) _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: Hooking " S(FUNC___OPEN) ": gfs_stat: %s", e)); } if (is_directory) { GFS_Dir dir; _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: Hooking " S(FUNC___OPEN) "(%s, 0%o): dir", url, oflag)); if ((oflag & (O_CREAT|O_TRUNC)) != 0 || (oflag & O_ACCMODE) != O_RDONLY) { free(url); errno = EISDIR; return (-1); } e = gfs_opendir(url, &dir); if (e == NULL) { filedes = gfs_hook_insert_gfs_dir(dir, url); if (filedes == -1) { errno_save = errno; gfs_closedir(dir); } _gfs_hook_debug( gflog_info(GFARM_MSG_UNFIXED, "GFS: Hooking " S(FUNC___OPEN) " --> %d", filedes); ); free(url); errno = errno_save; return (filedes); } free(url); errno = gfarm_error_to_errno(e); return (-1); } if ((oflag & O_CREAT) != 0) { _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: Hooking " S(FUNC___OPEN) "(%s, 0%o, 0%o)", url, oflag, mode)); oflag = gfs_hook_open_flags_gfarmize(oflag); e = gfs_pio_create(url, oflag, mode, &gf); } else { _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: Hooking " S(FUNC___OPEN) "(%s, 0%o)", url, oflag)); oflag = gfs_hook_open_flags_gfarmize(oflag); e = gfs_pio_open(url, oflag, &gf); } free(url); if (e != NULL) { _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: Hooking " S(FUNC___OPEN) ": %s", e)); errno = gfarm_error_to_errno(e); return (-1); } /* set file view */ switch (gfs_hook_get_current_view()) { case section_view: _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: set_view_section(%s, %s)", path, gfs_hook_get_current_section())); e = gfs_pio_set_view_section( gf, gfs_hook_get_current_section(), NULL, 0); break; case index_view: _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: set_view_index(%s, %d, %d)", path, gfs_hook_get_current_nfrags(), gfs_hook_get_current_index())); e = gfs_pio_set_view_index(gf, gfs_hook_get_current_nfrags(), gfs_hook_get_current_index(), NULL, 0); break; case local_view: /* * If the number of fragments is not the same as the * number of parallel processes, or the file is not * fragmented, do not change to the local file view. */ if ((e = gfs_pio_get_nfragment(gf, &nf)) == GFARM_ERR_OPERATION_NOT_PERMITTED) { /* program file */ char *arch; e = gfarm_host_get_self_architecture(&arch); if (e != NULL) { e = GFARM_ERR_OPERATION_NOT_PERMITTED; } else { e = gfs_pio_set_view_section(gf, arch, NULL, 0); if (e == GFARM_ERR_NO_SUCH_OBJECT) e = gfs_pio_set_view_section(gf, "noarch", NULL, 0); } } else if (e == GFARM_ERR_FRAGMENT_INDEX_NOT_AVAILABLE || (e == NULL && gfs_pio_get_node_size(&np) == NULL && nf == np)) { _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: set_view_local(%s) @ %d/%d", path, gfarm_node, gfarm_nnode)); e = gfs_pio_set_view_local(gf, 0); } else { _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: set_view_global(%s) @ %d/%d", path, gfarm_node, gfarm_nnode)); e = gfs_pio_set_view_global(gf, 0); } break; default: _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: set_view_global(%s)", path)); e = gfs_pio_set_view_global(gf, 0); } if (e != NULL) { _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: set_view: %s", e)); gfs_pio_close(gf); errno = gfarm_error_to_errno(e); return (-1); } filedes = gfs_hook_insert_gfs_file(gf); _gfs_hook_debug( if (filedes != -1) { gflog_info(GFARM_MSG_UNFIXED, "GFS: Hooking " S(FUNC___OPEN) " --> %d(%d)", filedes, gfs_pio_fileno(gf)); } ); errno = errno_save; return (filedes); } int FUNC__OPEN(const char *path, int oflag, ...) { va_list ap; mode_t mode; va_start(ap, oflag); mode = va_arg(ap, int); /* See comment of va_arg() in FUNC___OPEN(); */ va_end(ap); _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking " S(FUNC__OPEN))); return (FUNC___OPEN(path, oflag, mode)); } int FUNC_OPEN(const char *path, int oflag, ...) { va_list ap; mode_t mode; va_start(ap, oflag); mode = va_arg(ap, int); /* See comment of va_arg() in FUNC___OPEN(); */ va_end(ap); _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking " S(FUNC_OPEN))); return (FUNC___OPEN(path, oflag, mode)); } /* * creat */ int FUNC___CREAT(const char *path, mode_t mode) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking " S(FUNC___CREAT))); return (FUNC___OPEN(path, O_CREAT|O_TRUNC|O_WRONLY, mode)); } int FUNC__CREAT(const char *path, mode_t mode) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking " S(FUNC__CREAT))); return (FUNC___CREAT(path, mode)); } int FUNC_CREAT(const char *path, mode_t mode) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking " S(FUNC_CREAT))); return (FUNC___CREAT(path, mode)); } int FUNC__LIBC_CREAT(const char *path, mode_t mode) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking " S(FUNC__LIBC_CREAT))); return (FUNC___CREAT(path, mode)); } /* * lseek */ OFF_T FUNC___LSEEK(int filedes, OFF_T offset, int whence) { GFS_File gf; GFS_Dir dir; struct gfs_dirent *entry; const char *e; file_offset_t o; int errno_save = errno; _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking " S(FUNC___LSEEK) "(%d, %" PR_FILE_OFFSET ", %d)", filedes, (file_offset_t)offset, whence)); if ((gf = gfs_hook_is_open(filedes)) == NULL) return (SYSCALL_LSEEK(filedes, offset, whence)); if (gfs_hook_gfs_file_type(filedes) == GFS_DT_DIR) { _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: Hooking " S(FUNC___LSEEK) "(%d, %" PR_FILE_OFFSET ", %d)", filedes, (file_offset_t)offset, whence)); dir = (GFS_Dir)gf; switch (whence) { case SEEK_SET: o = offset; break; case SEEK_END: while ((e = gfs_readdir(dir, &entry)) == NULL && entry != NULL) ; /*FALLTHROUGH*/ case SEEK_CUR: e = gfs_telldir(dir, &o); if (e != NULL) { goto error; } o += offset; break; } e = gfs_seekdir(dir, o); if (e == NULL) { e = gfs_telldir(dir, &o); if (e == NULL) return ((OFF_T)o); } goto error; } _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: Hooking " S(FUNC___LSEEK) "(%d(%d), %" PR_FILE_OFFSET ", %d)", filedes, gfs_pio_fileno(gf), (file_offset_t)offset, whence)); e = gfs_pio_seek(gf, offset, whence, &o); if (e == NULL) { errno = errno_save; return ((OFF_T)o); } error: _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: " S(FUNC___LSEEK) ": %s", e)); errno = gfarm_error_to_errno(e); return (-1); } OFF_T FUNC__LSEEK(int filedes, OFF_T offset, int whence) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking " S(FUNC__LSEEK) ": %d", filedes)); return (FUNC___LSEEK(filedes, offset, whence)); } OFF_T FUNC_LSEEK(int filedes, OFF_T offset, int whence) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking " S(FUNC_LSEEK) ": %d", filedes)); return (FUNC___LSEEK(filedes, offset, whence)); } /* * pread */ #ifdef FUNC___PREAD ssize_t FUNC___PREAD(int filedes, void *buf, size_t nbyte, OFF_T offset) { GFS_File gf; const char *e; file_offset_t o; int n, errno_save = errno; _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking " S(FUNC___PREAD) "(%d, ,%lu, %" PR_FILE_OFFSET ")", filedes, (unsigned long)nbyte, (file_offset_t)offset)); if ((gf = gfs_hook_is_open(filedes)) == NULL) return (SYSCALL_PREAD(filedes, buf, nbyte, offset)); if (gfs_hook_gfs_file_type(filedes) == GFS_DT_DIR) { e = GFARM_ERR_IS_A_DIRECTORY; goto error; } _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: Hooking " S(FUNC___PREAD) "(%d(%d), ,%lu, %" PR_FILE_OFFSET ")", filedes, gfs_pio_fileno(gf), (unsigned long)nbyte, (file_offset_t)offset)); e = gfs_pio_seek(gf, 0, SEEK_CUR, &o); if (e != NULL) goto error; e = gfs_pio_seek(gf, offset, SEEK_SET, NULL); if (e != NULL) goto error; e = gfs_pio_read(gf, buf, nbyte, &n); if (e != NULL) goto error; e = gfs_pio_seek(gf, o, SEEK_SET, NULL); if (e != NULL) goto error; _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "GFS: Hooking " S(FUNC___PREAD) " --> %d", n)); errno = errno_save; return (n); error: _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: " S(FUNC___PREAD) ": %s", e)); errno = gfarm_error_to_errno(e); return (-1); } ssize_t FUNC__PREAD(int filedes, void *buf, size_t nbyte, OFF_T offset) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking " S(FUNC__PREAD) ": %d", filedes)); return (FUNC___PREAD(filedes, buf, nbyte, offset)); } ssize_t FUNC_PREAD(int filedes, void *buf, size_t nbyte, OFF_T offset) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking " S(FUNC_PREAD) ": %d", filedes)); return (FUNC___PREAD(filedes, buf, nbyte, offset)); } #endif /* * pwrite */ #ifdef FUNC___PWRITE ssize_t FUNC___PWRITE(int filedes, const void *buf, size_t nbyte, OFF_T offset) { GFS_File gf; const char *e; file_offset_t o; int n, errno_save = errno; _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking " S(FUNC___PWRITE) "(%d, ,%lu, %" PR_FILE_OFFSET ")", filedes, (unsigned long)nbyte, (file_offset_t)offset)); if ((gf = gfs_hook_is_open(filedes)) == NULL) return (SYSCALL_PWRITE(filedes, buf, nbyte, offset)); if (gfs_hook_gfs_file_type(filedes) == GFS_DT_DIR) { e = GFARM_ERR_IS_A_DIRECTORY; goto error; } _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: Hooking " S(FUNC___PWRITE) "(%d(%d), ,%lu, %" PR_FILE_OFFSET ")", filedes, gfs_pio_fileno(gf), (unsigned long)nbyte, (file_offset_t)offset)); e = gfs_pio_seek(gf, 0, SEEK_CUR, &o); if (e != NULL) goto error; e = gfs_pio_seek(gf, offset, SEEK_SET, NULL); if (e != NULL) goto error; e = gfs_pio_write(gf, buf, nbyte, &n); if (e != NULL) goto error; e = gfs_pio_seek(gf, o, SEEK_SET, NULL); if (e != NULL) goto error; _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "GFS: Hooking " S(FUNC___PWRITE) " --> %d", n)); errno = errno_save; return (n); error: _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: " S(FUNC___PWRITE) ": %s", e)); errno = gfarm_error_to_errno(e); return (-1); } ssize_t FUNC__PWRITE(int filedes, const void *buf, size_t nbyte, OFF_T offset) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking " S(FUNC__PWRITE) ": %d", filedes)); return (FUNC___PWRITE(filedes, buf, nbyte, offset)); } ssize_t FUNC_PWRITE(int filedes, const void *buf, size_t nbyte, OFF_T offset) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking " S(FUNC_PWRITE) ": %d", filedes)); return (FUNC___PWRITE(filedes, buf, nbyte, offset)); } #endif /* * getdents */ #if defined(__linux__) && defined(__i386__) # define internal_function __attribute__ ((regparm (3), stdcall)) #else # define internal_function /* empty */ #endif int internal_function #ifdef HOOK_GETDIRENTRIES FUNC___GETDENTS(int filedes, STRUCT_DIRENT *buf, int nbyte, long *offp) #else FUNC___GETDENTS(int filedes, STRUCT_DIRENT *buf, size_t nbyte) #endif { GFS_Dir dir; const char *e; unsigned short reclen; struct gfs_dirent *entry; STRUCT_DIRENT *bp; file_offset_t offset; #ifdef HOOK_GETDIRENTRIES int at_first = 1; #endif int errno_save = errno; _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking " S(FUNC___GETDENTS) "(%d, %p, %lu)", filedes, buf, (unsigned long)nbyte)); if ((dir = gfs_hook_is_open(filedes)) == NULL) #ifdef HOOK_GETDIRENTRIES return (SYSCALL_GETDENTS(filedes, (char *)buf, nbyte, offp)); #else return (SYSCALL_GETDENTS(filedes, buf, nbyte)); #endif _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: Hooking " S(FUNC___GETDENTS) "(%d, %p, %lu)", filedes, buf, (unsigned long)nbyte)); if (gfs_hook_gfs_file_type(filedes) != GFS_DT_DIR) { e = GFARM_ERR_NOT_A_DIRECTORY; goto error; } bp = buf; if ((entry = gfs_hook_get_suspended_gfs_dirent(filedes, &offset)) != NULL) { reclen = ALIGN( offsetof(STRUCT_DIRENT, d_name) + entry->d_namlen + 1); if ((char *)bp + reclen > (char *)buf + nbyte) { e = GFARM_ERR_INVALID_ARGUMENT; goto finish; } gfs_hook_set_suspended_gfs_dirent(filedes, NULL, 0); memset(bp, 0, offsetof(STRUCT_DIRENT, d_name)); /* XXX */ bp->d_ino = entry->d_fileno; /* XXX - as readdir()'s retrun value to user level nfsd */ #ifdef HOOK_GETDIRENTRIES at_first = 0; if (offp != NULL) *offp = offset; #endif #ifdef HAVE_D_OFF bp->d_off = offset; #endif #ifdef HAVE_D_NAMLEN bp->d_namlen = entry->d_namlen; #endif #ifdef HAVE_D_TYPE bp->d_type = entry->d_type == GFS_DT_DIR ? DT_DIR : entry->d_type == GFS_DT_REG ? DT_REG : DT_UNKNOWN; #endif bp->d_reclen = reclen; memcpy(bp->d_name, entry->d_name, entry->d_namlen); memset(bp->d_name + entry->d_namlen, 0, reclen - (offsetof(STRUCT_DIRENT, d_name) + entry->d_namlen)); bp = (STRUCT_DIRENT *) ((char *)bp + reclen); } for (gfs_telldir(dir, &offset); (e = gfs_readdir(dir, &entry)) == NULL && entry != NULL; gfs_telldir(dir, &offset)) { reclen = ALIGN( offsetof(STRUCT_DIRENT, d_name) + entry->d_namlen + 1); if ((char *)bp + reclen > (char *)buf + nbyte) { gfs_hook_set_suspended_gfs_dirent(filedes, entry, offset); goto finish; } memset(bp, 0, offsetof(STRUCT_DIRENT, d_name)); /* XXX */ bp->d_ino = entry->d_fileno; /* XXX - as readdir()'s retrun value to user level nfsd */ #ifdef HOOK_GETDIRENTRIES if (at_first) { at_first = 0; if (offp != NULL) *offp = offset; } #endif #ifdef HAVE_D_OFF bp->d_off = offset; #endif #ifdef HAVE_D_NAMLEN bp->d_namlen = entry->d_namlen; #endif #ifdef HAVE_D_TYPE bp->d_type = entry->d_type == GFS_DT_DIR ? DT_DIR : entry->d_type == GFS_DT_REG ? DT_REG : DT_UNKNOWN; #endif bp->d_reclen = reclen; memcpy(bp->d_name, entry->d_name, entry->d_namlen); memset(bp->d_name + entry->d_namlen, 0, reclen - (offsetof(STRUCT_DIRENT, d_name) + entry->d_namlen)); bp = (STRUCT_DIRENT *) ((char *)bp + reclen); } finish: if (e == NULL) { _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: Hooking " S(FUNC___GETDENTS) " --> %d", filedes)); errno = errno_save; return ((char *)bp - (char *)buf); } error: _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: " S(FUNC___GETDENTS) ": %s", e)); errno = gfarm_error_to_errno(e); return (-1); } #ifdef HOOK_GETDIRENTRIES int FUNC__GETDENTS(int filedes, STRUCT_DIRENT *buf, int nbyte, long *offp) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking " S(FUNC__GETDENTS) ": %d", filedes)); return (FUNC___GETDENTS(filedes, buf, nbyte, offp)); } int FUNC_GETDENTS(int filedes, char *buf, int nbyte, long *offp) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking " S(FUNC_GETDENTS) ": %d", filedes)); return (FUNC___GETDENTS(filedes, (STRUCT_DIRENT *)buf, nbyte, offp)); } #else /* !defined(HOOK_GETDIRENTRIES) */ int internal_function FUNC__GETDENTS(int filedes, STRUCT_DIRENT *buf, size_t nbyte) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking " S(FUNC__GETDENTS) ": %d", filedes)); return (FUNC___GETDENTS(filedes, buf, nbyte)); } int internal_function #ifdef GETDENTS_CHAR_P FUNC_GETDENTS(int filedes, char *buf, size_t nbyte) #else FUNC_GETDENTS(int filedes, STRUCT_DIRENT *buf, size_t nbyte) #endif { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking " S(FUNC_GETDENTS) ": %d", filedes)); return (FUNC___GETDENTS(filedes, (STRUCT_DIRENT *)buf, nbyte)); } #endif /* !defined(HOOK_GETDIRENTRIES) */ /* * truncate */ #ifdef FUNC___TRUNCATE int FUNC___TRUNCATE(const char *path, OFF_T length) { GFS_File gf; const char *e; char *url; int errno_save = errno; struct gfs_stat gs; _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking " S(FUNC___TRUNCATE) "(%s, %" PR_FILE_OFFSET ")", path, (file_offset_t)length)); if (!gfs_hook_is_url(path, &url)) return (SYSCALL_TRUNCATE(path, length)); e = gfs_stat(url, &gs); if (e != NULL) { _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: Hooking " S(FUNC___TRUNCATE) ": gfs_stat: %s", e)); free(url); errno = gfarm_error_to_errno(e); return (-1); } if (GFARM_S_ISDIR(gs.st_mode)) { e = GFARM_ERR_IS_A_DIRECTORY; _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: Hooking " S(FUNC___FTRUNCATE) "(%s, %" PR_FILE_OFFSET"): %s", path, (file_offset_t)length ,e)); free(url); gfs_stat_free(&gs); errno = gfarm_error_to_errno(e); return (-1); } gfs_stat_free(&gs); _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: Hooking " S(FUNC___TRUNCATE) "(%s, %" PR_FILE_OFFSET ")", path, (file_offset_t)length)); e = gfs_pio_open(url, GFARM_FILE_RDWR, &gf); if (e != NULL) { _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: Hooking " S(FUNC___TRUNCATE) ": gfs_pio_open: %s", e)); free(url); errno = gfarm_error_to_errno(e); return (-1); } free(url); e = gfs_pio_truncate(gf, length); if (e != NULL) { _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: Hooking " S(FUNC___TRUNCATE) ": gfs_pio_truncate: %s", e)); errno = gfarm_error_to_errno(e); return (-1); } gfs_pio_close(gf); errno = errno_save; return (0); } int FUNC__TRUNCATE(const char *path, OFF_T length) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking " S(FUNC__TRUNCATE))); return (FUNC___TRUNCATE(path, length)); } int FUNC_TRUNCATE(const char *path, OFF_T length) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking " S(FUNC_TRUNCATE))); return (FUNC___TRUNCATE(path, length)); } #endif /* * ftruncate */ #ifdef FUNC___FTRUNCATE int FUNC___FTRUNCATE(int filedes, OFF_T length) { GFS_File gf; const char *e; int errno_save = errno; _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking " S(FUNC___FTRUNCATE) "(%d, %" PR_FILE_OFFSET")", filedes, (file_offset_t)length)); if ((gf = gfs_hook_is_open(filedes)) == NULL) return (SYSCALL_FTRUNCATE(filedes, length)); if (gfs_hook_gfs_file_type(filedes) == GFS_DT_DIR) { _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: Hooking " S(FUNC___FTRUNCATE) "(%d, %" PR_FILE_OFFSET")", filedes, (file_offset_t)length)); e = GFARM_ERR_IS_A_DIRECTORY; goto error; } _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: Hooking " S(FUNC___FTRUNCATE) "(%d(%d), %" PR_FILE_OFFSET ")", filedes, gfs_pio_fileno(gf), (file_offset_t)length)); e = gfs_pio_truncate(gf, length); if (e == NULL) { errno = errno_save; return (0); } error: _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS:" S(FUNC___FTRUNCATE) ": %s", e)); errno = gfarm_error_to_errno(e); return (-1); } int FUNC__FTRUNCATE(int filedes, OFF_T length) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking " S(FUNC__FTRUNCATE))); return (FUNC___FTRUNCATE(filedes, length)); } int FUNC_FTRUNCATE(int filedes, OFF_T length) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking " S(FUNC_FTRUNCATE))); return (FUNC___FTRUNCATE(filedes, length)); } #endif gfarm-2.4.1/lib/gfs_hook/hooks_subr.c0000644000000000000000000006364411507222722016214 0ustar rootroot/* * $Id: hooks_subr.c 4303 2010-01-06 01:45:08Z ookuma $ */ #include #include #include #include #include #include #include #include /* PATH_MAX */ #include #include "gfutil.h" #include "config.h" #include "gfs_misc.h" #include #include "hooks_subr.h" #define MAX_GFS_FILE_BUF 2048 struct _gfs_file_descriptor { int refcount; unsigned char d_type; /* file types in */ union { GFS_File f; struct { GFS_Dir dir; struct gfs_dirent *suspended; file_offset_t suspended_offset; struct gfs_stat gst; char *abs_url; /* for __fchdir() hook */ } *d; } u; }; static struct _gfs_file_descriptor *_gfs_file_buf[MAX_GFS_FILE_BUF]; /* * static function definitions */ static void gfs_hook_disable_hook(void); static void gfs_hook_enable_hook(void); static int gfs_hook_check_hook_disabled(void); static int gfs_hook_init(void); static void gfs_hook_set_current_view_local(void); static void gfs_hook_set_current_view_index(int, int); static void gfs_hook_set_current_view_global(void); static void gfs_hook_set_current_view_section(char *, int); static void gfs_hook_set_current_view_default(void); /* * */ static void gfs_hook_not_initialized(void) { static int printed = 0; if (!printed) { printed = 1; gflog_info(GFARM_MSG_UNFIXED, "fatal error: gfarm_initialize() isn't called"); } } /* * open flag management */ int gfs_hook_open_flags_gfarmize(int open_flags) { int gfs_flags; switch (open_flags & O_ACCMODE) { case O_RDONLY: gfs_flags = GFARM_FILE_RDONLY; break; case O_WRONLY: gfs_flags = GFARM_FILE_WRONLY; break; case O_RDWR: gfs_flags = GFARM_FILE_RDWR; break; default: return (-1); } #if 0 /* this is unnecessary */ if ((open_flags & O_CREAT) != 0) gfs_flags |= GFARM_FILE_CREATE; #endif if ((open_flags & O_TRUNC) != 0) gfs_flags |= GFARM_FILE_TRUNC; if ((open_flags & O_APPEND) != 0) gfs_flags |= GFARM_FILE_APPEND; if ((open_flags & O_EXCL) != 0) gfs_flags |= GFARM_FILE_EXCLUSIVE; /* open(2) and creat(2) should be unbuffered */ gfs_flags |= GFARM_FILE_UNBUFFERED; return (gfs_flags); } /* * gfs_file_buf management * * XXX - need to manage list of opened file descriptors exactly to * efficiently execute *_all() functions. */ static int _gfs_hook_num_gfs_files; static int _gfs_hook_gfs_files_max_plus_one; static void gfs_hook_num_gfs_files_check(void) { /* * The number of file descriptors is not necessary to be * reset even when the process is forked. Opened files by * the parent process can be accessed by the descendants. */ } int gfs_hook_num_gfs_files(void) { gfs_hook_num_gfs_files_check(); return (_gfs_hook_num_gfs_files); } static void gfs_hook_num_gfs_files_inc(int fd) { gfs_hook_num_gfs_files_check(); if (fd >= _gfs_hook_gfs_files_max_plus_one) _gfs_hook_gfs_files_max_plus_one = fd + 1; ++_gfs_hook_num_gfs_files; } static void gfs_hook_num_gfs_files_dec(void) { gfs_hook_num_gfs_files_check(); if (_gfs_hook_num_gfs_files > 0) --_gfs_hook_num_gfs_files; } /* * Reserve several file descriptors for applications. At least, * 'configure' uses 5 and 6. Maybe, tcsh and zsh also. */ #define GFS_HOOK_MIN_FD 10 static int _gfs_hook_reserved_fd[GFS_HOOK_MIN_FD + 1]; void gfs_hook_reserve_fd() { int i, fd; i = 0; fd = open("/dev/null", O_WRONLY); while (fd >= 0 && fd < GFS_HOOK_MIN_FD) { _gfs_hook_reserved_fd[i++] = fd; fd = dup(fd); } _gfs_hook_reserved_fd[i] = -1; if (fd >= 0) close(fd); } void gfs_hook_release_fd() { int i; for (i = 0; _gfs_hook_reserved_fd[i] >= 0; ++i) close(_gfs_hook_reserved_fd[i]); } /* re-assign a file descriptor greater than MIN_FD */ static int gfs_hook_adjust_fd(int fd) { int fd2; if (fd >= 0 && fd < GFS_HOOK_MIN_FD) { fd2 = fcntl(fd, F_DUPFD, GFS_HOOK_MIN_FD); close(fd); fd = fd2; } return (fd); } int gfs_hook_insert_gfs_file(GFS_File gf) { int fd, save_errno; struct stat st; _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: insert_gfs_file: %p", gf)); /* * A new file descriptor is needed to identify a hooked file * descriptor. */ fd = gfs_pio_fileno(gf); if (fstat(fd, &st) == -1) { save_errno = errno; goto error_close_gf; } if (S_ISREG(st.st_mode)) fd = fcntl(fd, F_DUPFD, GFS_HOOK_MIN_FD); else /* don't return a socket, to make select(2) work with this fd */ fd = gfs_hook_adjust_fd(open("/dev/null", O_RDWR)); if (fd == -1) { save_errno = errno; goto error_close_gf; } if (fd >= MAX_GFS_FILE_BUF) { save_errno = EMFILE; goto error_close_fd; } if (_gfs_file_buf[fd] != NULL) { save_errno = EBADF; /* XXX - something broken */ goto error_close_fd; } GFARM_MALLOC(_gfs_file_buf[fd]); if (_gfs_file_buf[fd] == NULL) { save_errno = ENOMEM; goto error_close_fd; } _gfs_file_buf[fd]->refcount = 1; _gfs_file_buf[fd]->d_type = GFS_DT_REG; _gfs_file_buf[fd]->u.f = gf; gfs_hook_num_gfs_files_inc(fd); return (fd); error_close_fd: __syscall_close(fd); error_close_gf: gfs_pio_close(gf); _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: insert_gfs_file: %s", gfarm_errno_to_error(save_errno))); errno = save_errno; return (-1); } int gfs_hook_insert_gfs_dir(GFS_Dir dir, char *url) { int fd, save_errno; char *e, *abs_url; _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: insert_gfs_dir: %p", dir)); /* * A new file descriptor is needed to identify a hooked file * descriptor. */ fd = gfs_hook_adjust_fd(open("/dev/null", O_RDONLY)); if (fd == -1) { save_errno = errno; goto error_closedir; } if (fd >= MAX_GFS_FILE_BUF) { save_errno = EMFILE; goto error_close_fd; } if (_gfs_file_buf[fd] != NULL) { save_errno = EBADF; /* XXX - something broken */ goto error_close_fd; } e = gfs_realpath(url, &abs_url); if (e != NULL) { save_errno = gfarm_error_to_errno(e); goto error_close_fd; } GFARM_MALLOC(_gfs_file_buf[fd]); if (_gfs_file_buf[fd] == NULL) { save_errno = ENOMEM; goto error_free_path; } GFARM_MALLOC(_gfs_file_buf[fd]->u.d); if (_gfs_file_buf[fd]->u.d == NULL) { save_errno = ENOMEM; goto error_free_file_buf; } e = gfs_stat(url, &_gfs_file_buf[fd]->u.d->gst); if (e != NULL) { save_errno = gfarm_error_to_errno(e); goto error_free_file_buf_u_d; } _gfs_file_buf[fd]->refcount = 1; _gfs_file_buf[fd]->d_type = GFS_DT_DIR; _gfs_file_buf[fd]->u.d->dir = dir; _gfs_file_buf[fd]->u.d->suspended = NULL; _gfs_file_buf[fd]->u.d->suspended_offset = 0; _gfs_file_buf[fd]->u.d->abs_url = abs_url; return (fd); error_free_file_buf_u_d: free(_gfs_file_buf[fd]->u.d); error_free_file_buf: free(_gfs_file_buf[fd]); _gfs_file_buf[fd] = NULL; error_free_path: free(abs_url); error_close_fd: __syscall_close(fd); error_closedir: gfs_closedir(dir); _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: insert_gfs_dir: %s", gfarm_errno_to_error(save_errno))); errno = save_errno; return (-1); } unsigned char gfs_hook_gfs_file_type(int fd) { return (_gfs_file_buf[fd]->d_type); } char * gfs_hook_clear_gfs_file(int fd) { GFS_File gf; char *e = NULL; _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: clear_gfs_file: %d", fd)); gf = gfs_hook_is_open(fd); if (gf == NULL) { _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: ERROR: not a Gfarm file: %d", fd)); return ("not a Gfarm file"); } if (--_gfs_file_buf[fd]->refcount > 0) { /* fd is duplicated, skip closing the file. */ _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: clear_gfs_file: skipped")); } else { if (gfs_hook_gfs_file_type(fd) == GFS_DT_REG) { e = gfs_pio_close(gf); gfs_hook_num_gfs_files_dec(); } else if (gfs_hook_gfs_file_type(fd) == GFS_DT_DIR) { _gfs_file_buf[fd]->u.d->dir = NULL; _gfs_file_buf[fd]->u.d->suspended = NULL; _gfs_file_buf[fd]->u.d->suspended_offset = 0; gfs_stat_free(&_gfs_file_buf[fd]->u.d->gst); free(_gfs_file_buf[fd]->u.d->abs_url); free(_gfs_file_buf[fd]->u.d); e = gfs_closedir((GFS_Dir)gf); } free(_gfs_file_buf[fd]); } __syscall_close(fd); _gfs_file_buf[fd] = NULL; if (e != NULL) _gfs_hook_debug( gflog_info(GFARM_MSG_UNFIXED, "GFS: clear_gfs_file: %s", e)); return (e); } /* * XXX - need to manage list of opened file descriptors exactly to * efficiently execute *_all() functions. */ void gfs_hook_unset_calc_digest_all(void) { int fd; GFS_File gf; for (fd = 0; fd < _gfs_hook_gfs_files_max_plus_one; ++fd) if (((gf = gfs_hook_is_open(fd)) != NULL) && (gfs_hook_gfs_file_type(fd) == GFS_DT_REG)) gfs_pio_unset_calc_digest(gf); return; } char * gfs_hook_flush_all(void) { int fd; char *e, *e_save = NULL; GFS_File gf; for (fd = 0; fd < _gfs_hook_gfs_files_max_plus_one; ++fd) { if ((gf = gfs_hook_is_open(fd)) != NULL) { e = gfs_pio_flush(gf); if (e_save == NULL) e_save = e; } } if (e_save != NULL) _gfs_hook_debug( gflog_info(GFARM_MSG_UNFIXED, "GFS: hook_flush_all: %s", e_save)); return (e_save); } char * gfs_hook_close_all(void) { int fd; char *e, *e_save = NULL; /* * flush stdio buffer. this is needed especially by flex * that creates the output file via stdout. */ fflush(stdout); fflush(stderr); for (fd = 0; fd < _gfs_hook_gfs_files_max_plus_one; ++fd) { if (gfs_hook_is_open(fd)) { e = gfs_hook_clear_gfs_file(fd); if (e_save == NULL) e_save = e; } } if (e_save != NULL) _gfs_hook_debug( gflog_info(GFARM_MSG_UNFIXED, "GFS: hook_close_all: %s", e_save)); return (e_save); } void gfs_hook_terminate(void) { char *e; gfs_hook_close_all(); gfs_hook_disable_hook(); e = gfarm_terminate(); if (e != NULL) _gfs_hook_debug( gflog_info(GFARM_MSG_UNFIXED, "GFS: gfarm_terminate: %s", e)); } struct _gfs_file_descriptor *gfs_hook_dup_descriptor(int fd) { if (gfs_hook_is_open(fd) == NULL) return (NULL); ++_gfs_file_buf[fd]->refcount; return (_gfs_file_buf[fd]); } void gfs_hook_set_descriptor(int fd, struct _gfs_file_descriptor *d) { if (gfs_hook_is_open(fd) != NULL) gfs_hook_clear_gfs_file(fd); _gfs_file_buf[fd] = d; } #if 0 int gfs_hook_dup_filedes(int oldfd, int newfd) { _gfs_hook_debug( gflog_info(GFARM_MSG_UNFIXED, "GFS: dpu_filedes: %d, %d", oldfd, newfd)); #if 0 if (_gfs_file_buf[oldfd] == _gfs_file_buf[newfd]) return (newfd); #endif _gfs_file_buf[newfd] = _gfs_file_buf[oldfd]; } return (newfd); } #endif /* printf and puts should not be put into the following function. */ void * gfs_hook_is_open(int fd) { if (fd < 0 || fd >= MAX_GFS_FILE_BUF) return (NULL); if (_gfs_file_buf[fd] == NULL) return (NULL); switch (gfs_hook_gfs_file_type(fd)) { case GFS_DT_REG: return (_gfs_file_buf[fd]->u.f); case GFS_DT_DIR: return (_gfs_file_buf[fd]->u.d->dir); default: return (NULL); } } void gfs_hook_set_suspended_gfs_dirent(int fd, struct gfs_dirent *entry, file_offset_t offset) { _gfs_file_buf[fd]->u.d->suspended = entry; _gfs_file_buf[fd]->u.d->suspended_offset = offset; } struct gfs_dirent * gfs_hook_get_suspended_gfs_dirent(int fd, file_offset_t *offsetp) { struct gfs_dirent *ent = _gfs_file_buf[fd]->u.d->suspended; if (ent == NULL) return (NULL); *offsetp = _gfs_file_buf[fd]->u.d->suspended_offset; return (ent); } struct gfs_stat * gfs_hook_get_gfs_stat(int fd) { return (&_gfs_file_buf[fd]->u.d->gst); } char * gfs_hook_get_gfs_url(int fd) { return (_gfs_file_buf[fd]->u.d->abs_url); } /* * Check the current working directory is included in Gfarm file system. */ static int _gfs_hook_cwd_is_gfarm = -1; int gfs_hook_set_cwd_is_gfarm(int c) { return (_gfs_hook_cwd_is_gfarm = c); } static void gfs_hook_check_cwd_is_gfarm(void) { char *cwd; /* * Honor 'PWD', which is set by bash or tcsh with Gfarm * syscall hook library, if it points to a path in Gfarm file * system. */ cwd = getenv("PWD"); if (cwd != NULL) { char *url; if (gfs_hook_is_url(cwd, &url)) { gfs_chdir(url); /* here, cwd is changed. */ gfs_hook_set_cwd_is_gfarm(1); free(url); return; } } gfs_hook_set_cwd_is_gfarm(0); } int gfs_hook_get_cwd_is_gfarm(void) { if (_gfs_hook_cwd_is_gfarm == -1) gfs_hook_check_cwd_is_gfarm(); else { /* * hook functions can be called even after * gfarm_terminate() is called. If initialization * succeeds, go ahead. Otherwise, set 0. */ if (!gfs_hook_init()) gfs_hook_set_cwd_is_gfarm(0); } return (_gfs_hook_cwd_is_gfarm); } /* * Check whether pathname is gfarm url or not. * * Gfarm URL: gfarm:[:section:]pathname * * It is necessary to free the memory space for *url. */ static char gfs_mntdir[] = "/gfarm"; static char *received_prefix = NULL; static int gfs_hook_is_null_or_slash(const char c) { return (c == '\0' || c == '/'); } static int gfs_hook_is_null_or_slash_or_colon(const char c) { return (gfs_hook_is_null_or_slash(c) || c == ':'); } static int gfs_hook_is_mount_point0(const char *path) { return (*path == '/' && memcmp(path, gfs_mntdir, sizeof(gfs_mntdir) - 1) == 0 && gfs_hook_is_null_or_slash_or_colon( path[sizeof(gfs_mntdir) - 1])); } static int gfs_hook_is_mount_point(const char *path, int *sizeof_prefix) { const char *p = path; int ret; while (*p == '/') ++p; if (p > path) --p; ret = gfs_hook_is_mount_point0(p); if (ret && sizeof_prefix) *sizeof_prefix = sizeof(gfs_mntdir) + p - path; return (ret); } static int gfs_hook_strmatchlen(const char *s1, const char *s2, size_t n) { int c = 0; while (s1[c] && s2[c] && s1[c] == s2[c] && c < n) ++c; return (c); } /* strncmp(s1 + '/' + s2, t1, n) */ static int gfs_hook_strncmp2(const char *s1, const char *s2, const char *t1, size_t n) { int m; m = gfs_hook_strmatchlen(s1, t1, n); if (m == n) return (0); if (s1[m]) return (s1[m] - t1[m]); t1 += m; n -= m; if (m > 0 && s1[m - 1] != '/') { const char *slash = "/"; m = gfs_hook_strmatchlen(slash, t1, n); if (m == n) return (0); if (slash[m]) return (slash[m] - t1[m]); t1 += m; n -= m; } m = gfs_hook_strmatchlen(s2, t1, n); if (m == n) return (0); return (s2[m] - t1[m]); } static const char * gfs_hook_is_mount_point_relative(const char *path) { char cwd[PATH_MAX + 1], *r; int mntdirlen, cwdlen; gfs_hook_disable_hook(); r = getcwd(cwd, sizeof(cwd)); gfs_hook_enable_hook(); if (r == NULL) return (NULL); /* XXX - neither '..' nor '.' is properly handled. */ mntdirlen = sizeof(gfs_mntdir) - 1; cwdlen = strlen(cwd); if (*path != '/' && gfs_hook_strncmp2(cwd, path, gfs_mntdir, mntdirlen) == 0 && gfs_hook_is_null_or_slash_or_colon(path[mntdirlen - cwdlen])) return (&path[mntdirlen - cwdlen]); else return (NULL); } static int set_received_prefix(const char *path) { char *end, *p; int len; if (received_prefix != NULL) { free(received_prefix); received_prefix = NULL; } if (gfs_hook_is_mount_point(path, NULL)) { received_prefix = strdup(gfs_mntdir); if (received_prefix == NULL) return (0); /* XXX - should return ENOMEM */ return (1); } /* path is either 'gfarm:' or 'gfarm@'. */ if ((end = strchr(path, ':')) == NULL) end = strchr(path, '@'); if (end == NULL) return (0); /* XXX */ len = end - path + 1; GFARM_MALLOC_ARRAY(p, len + 1); if (p == NULL) return (0); /* XXX - should return ENOMEM */ received_prefix = p; strncpy(received_prefix, path, len); received_prefix[len] = '\0'; return (1); } /* * bypassing mechanism for hooking library */ static int gfs_hook_is_disabled = 0; static void gfs_hook_disable_hook(void) { gfs_hook_is_disabled = 1; } static void gfs_hook_enable_hook(void) { gfs_hook_is_disabled = 0; } static int gfs_hook_check_hook_disabled(void) { return (gfs_hook_is_disabled); } static int gfs_hook_init(void) { static int gfs_hook_initialized = 0; if (gfs_hook_initialized && gfarm_initialized()) return (1); gfs_hook_disable_hook(); if (gfs_hook_initialize() != NULL) { gfs_hook_not_initialized(); return (0); /* don't perform gfarm operation */ } gfs_hook_enable_hook(); gfs_hook_initialized = 1; return (1); } /* * Gfarm path starts with '', 'gfarm:' or 'gfarm@'. * * When the Gfarm path starts with '', the path is * considered to be an absolute path instead of a relative path. * * '/~username' such as '/gfarm/~tatebe' can be used to * specify a home directory in Gfarm file system. * * '/gfarm' is a special point to force to uncache directory cache. */ int gfs_hook_is_url(const char *path, char **urlp) { static char prefix[] = "gfarm:"; int sizeof_gfarm_prefix = sizeof(prefix); int sizeof_prefix = sizeof_gfarm_prefix; const char *path_save; int errno_save = errno; int is_mount_point = 0, remove_slash = 0, add_slash = 0; int add_dot_slash = 0; /* * ROOT patch: * 'gfarm@' is also considered as a Gfarm URL */ static char gfarm_url_prefix_for_root[] = "gfarm@"; char *sec = NULL; if (gfs_hook_check_hook_disabled()) return (0); /* 'Bad address' check to prevent segmentation fault */ gfs_hook_disable_hook(); if ((access(path, F_OK) == -1 && errno == EFAULT) || *path == '\0') { gfs_hook_enable_hook(); errno = errno_save; return (0); } gfs_hook_enable_hook(); path_save = path; if (gfs_hook_is_mount_point(path, &sizeof_prefix)) is_mount_point = 1; if (is_mount_point || gfarm_is_url(path) || /* ROOT patch */ memcmp(path, gfarm_url_prefix_for_root, sizeof(gfarm_url_prefix_for_root) - 1) == 0) { if (!gfs_hook_init()) { errno = errno_save; return (0); /* don't perform gfarm operation */ } /* * extension for accessing individual sections * gfarm::section:pathname */ path += sizeof_prefix - 1; if (path[0] == ':') { const char *p = path + 1; int secsize = strcspn(p, "/:"); int urlsize; if (p[secsize] != ':') { errno = errno_save; return (0); /* gfarm::foo/:bar or gfarm::foo */ } /* * '/gfarm/~' and '/gfarm/.' will be translated * to 'gfarm:~' and 'gfarm:.', respectively. */ if (is_mount_point && p[secsize + 1] == '/' && (p[secsize + 2] == '~' || (p[secsize + 2] == '.' && gfs_hook_is_null_or_slash(p[secsize + 3])))) remove_slash = 1; /* '/gfarm' will be translated to 'gfarm:/'. */ if (is_mount_point && p[secsize + 1] == '\0') { add_slash = 1; /*gfs_uncachedir();*/ } urlsize = sizeof_gfarm_prefix - 1 + add_slash + strlen(p + secsize + remove_slash + 1); GFARM_MALLOC_ARRAY(*urlp, urlsize + 1); GFARM_MALLOC_ARRAY(sec, secsize + 1); if (*urlp == NULL || sec == NULL) { if (*urlp != NULL) free(*urlp); if (sec != NULL) free(sec); errno = errno_save; return (0); /* XXX - should return ENOMEM */ } memcpy(*urlp, prefix, sizeof_gfarm_prefix - 1); if (add_slash) strcpy(*urlp + sizeof_gfarm_prefix - 1, "/"); strcpy(*urlp + sizeof_gfarm_prefix - 1 + add_slash, p + secsize + remove_slash + 1); memcpy(sec, p, secsize); sec[secsize] = '\0'; /* It is not necessary to free memory space of 'sec'. */ gfs_hook_set_current_view_section(sec, 1); } else { /* * '/gfarm/~' and '/gfarm/.' will be translated * to 'gfarm:~' and 'gfarm:.', respectively. */ if (is_mount_point && path[0] == '/' && (path[1] == '~' || (path[1] == '.' && gfs_hook_is_null_or_slash(path[2])))) remove_slash = 1; /* '/gfarm' will be translated to 'gfarm:/'. */ if (is_mount_point && path[0] == '\0') { add_slash = 1; /*gfs_uncachedir();*/ } GFARM_MALLOC_ARRAY(*urlp, sizeof_gfarm_prefix - 1 + add_slash + strlen(path + remove_slash) + 1); if (*urlp == NULL) { errno = errno_save; return (0) ; /* XXX - should return ENOMEM */ } /* * the reason why we don't just call strcpy(*url, path) * is because the path may be "gfarm@path/name". * (ROOT patch) */ memcpy(*urlp, prefix, sizeof_gfarm_prefix - 1); if (add_slash) strcpy(*urlp + sizeof_gfarm_prefix - 1, "/"); strcpy(*urlp + sizeof_gfarm_prefix - 1 + add_slash, path + remove_slash); gfs_hook_set_current_view_default(); } if (!set_received_prefix(path_save)) { errno = errno_save; return (0); } return (1); } /* The current directory is in the Gfarm file system */ if (*path_save != '/' && gfs_hook_get_cwd_is_gfarm()) { /* * gfarm_initialize() should be called in * gfs_hook_get_cwd_is_gfarm() if it returns 1. */ /* just '~filename' should be 'gfarm:./~filename' */ if (*path_save == '~') add_dot_slash = 2; GFARM_MALLOC_ARRAY(*urlp, sizeof_gfarm_prefix + add_dot_slash + strlen(path_save)); if (*urlp == NULL) { errno = errno_save; return (0) ; /* XXX - should return ENOMEM */ } memcpy(*urlp, prefix, sizeof_gfarm_prefix - 1); if (add_dot_slash) strcpy(*urlp + sizeof_gfarm_prefix - 1, "./"); strcpy(*urlp + sizeof_gfarm_prefix - 1 + add_dot_slash, path_save); /* It is not necessary to change the current view. */ return (1); } /* The current directory is *not* in the Gfarm file system */ if (*path_save != '/' && (path = gfs_hook_is_mount_point_relative(path_save))) { if (!gfs_hook_init()) { errno = errno_save; return (0); /* don't perform gfarm operation */ } /* * '/gfarm/~' and '/gfarm/.' will be translated * to 'gfarm:~' and 'gfarm:.', respectively. */ if (path[0] == '/' && (path[1] == '~' || (path[1] == '.' && gfs_hook_is_null_or_slash(path[2])))) remove_slash = 1; /* '/gfarm' will be translated to 'gfarm:/'. */ if (path[0] == '\0') { add_slash = 1; /*gfs_uncachedir();*/ } GFARM_MALLOC_ARRAY(*urlp, sizeof_gfarm_prefix - 1 + add_slash + strlen(path + remove_slash) + 1); if (*urlp == NULL) { errno = errno_save; return (0) ; /* XXX - should return ENOMEM */ } memcpy(*urlp, prefix, sizeof_gfarm_prefix - 1); if (add_slash) strcpy(*urlp + sizeof_gfarm_prefix - 1, "/"); strcpy(*urlp + sizeof_gfarm_prefix - 1 + add_slash, path + remove_slash); /* It is not necessary to change the current view. */ return (1); } errno = errno_save; return (0); } char * gfs_hook_get_prefix(char *buf, size_t size) { if (received_prefix == NULL) return GFARM_ERR_GFARM_URL_PREFIX_IS_MISSING; if (size <= strlen(received_prefix)) return GFARM_ERR_NUMERICAL_RESULT_OUT_OF_RANGE; strcpy(buf, received_prefix); return (NULL); } /* * default and current file view manipulation */ static enum gfs_hook_file_view _gfs_hook_default_view = local_view; static int _gfs_hook_default_index = 0; static int _gfs_hook_default_nfrags = GFARM_FILE_DONTCARE; static char *_gfs_hook_default_section = NULL; static enum gfs_hook_file_view _gfs_hook_current_view = local_view; static int _gfs_hook_current_index = 0; static int _gfs_hook_current_nfrags = GFARM_FILE_DONTCARE; static char *_gfs_hook_current_section = NULL; void gfs_hook_set_default_view_local(void) { _gfs_hook_default_view = local_view; } void gfs_hook_set_default_view_index(int index, int nfrags) { _gfs_hook_default_view = index_view; _gfs_hook_default_index = index; _gfs_hook_default_nfrags = nfrags; } void gfs_hook_set_default_view_global(void) { _gfs_hook_default_view = global_view; } void gfs_hook_set_default_view_section(char *section) { _gfs_hook_default_view = section_view; if (_gfs_hook_default_section != NULL) free(_gfs_hook_current_section); _gfs_hook_default_section = strdup(section); } static void gfs_hook_set_current_view_local(void) { _gfs_hook_current_view = local_view; } static void gfs_hook_set_current_view_index(int index, int nfrags) { _gfs_hook_current_view = index_view; _gfs_hook_current_index = index; _gfs_hook_current_nfrags = nfrags; } static void gfs_hook_set_current_view_global(void) { _gfs_hook_current_view = global_view; } static void gfs_hook_set_current_view_section(char *section, int needfree) { static int space_need_to_be_freeed; _gfs_hook_current_view = section_view; if (_gfs_hook_current_section != NULL && space_need_to_be_freeed) free(_gfs_hook_current_section); space_need_to_be_freeed = needfree; _gfs_hook_current_section = section; } static void gfs_hook_set_current_view_default(void) { switch (_gfs_hook_default_view) { case local_view: gfs_hook_set_current_view_local(); break; case index_view: gfs_hook_set_current_view_index( _gfs_hook_default_index, _gfs_hook_default_nfrags); break; case global_view: gfs_hook_set_current_view_global(); break; case section_view: gfs_hook_set_current_view_section(_gfs_hook_default_section, 0); break; } } enum gfs_hook_file_view gfs_hook_get_current_view(void) { return (_gfs_hook_current_view); } int gfs_hook_get_current_index(void) { return (_gfs_hook_current_index); } int gfs_hook_get_current_nfrags(void) { return (_gfs_hook_current_nfrags); } char * gfs_hook_get_current_section(void) { return (_gfs_hook_current_section); } /* * gfs_hook_set_view */ char * gfs_hook_set_view_local(int filedes, int flag) { GFS_File gf; char *e; if ((gf = gfs_hook_is_open(filedes)) == NULL) return "not a Gfarm file"; if ((e = gfs_pio_set_view_local(gf, flag)) != NULL) { _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: set_view_local: %s", e)); return e; } return NULL; } char * gfs_hook_set_view_index(int filedes, int nfrags, int index, char *host, int flags) { GFS_File gf; char *e; if ((gf = gfs_hook_is_open(filedes)) == NULL) return "not a Gfarm file"; if ((e = gfs_pio_set_view_index(gf, nfrags, index, host, flags)) != NULL) { _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: set_view_index: %s", e)); return e; } return NULL; } char * gfs_hook_set_view_global(int filedes, int flags) { GFS_File gf; char *e; if ((gf = gfs_hook_is_open(filedes)) == NULL) return "not a Gfarm file"; if ((e = gfs_pio_set_view_global(gf, flags)) != NULL) { _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: set_view_global: %s", e)); return e; } return NULL; } char * gfs_hook_set_view_section(int filedes, char *section, char *host, int flags) { GFS_File gf; char *e; if ((gf = gfs_hook_is_open(filedes)) == NULL) return "not a Gfarm file"; if ((e = gfs_pio_set_view_section(gf, section, host, flags)) != NULL) { _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: set_view_section: %s", e)); return (e); } return (NULL); } gfarm-2.4.1/lib/gfs_hook/hooks_64.c0000644000000000000000000002105311507222722015456 0ustar rootroot#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "gfutil.h" #include "hooks_subr.h" #include #if defined(sun) && (defined(__svr4__) || defined(__SVR4)) #define OS_SOLARIS 1 #endif /* * The following hooks are not implemented: * * _LFS64_ASYNCHRONOUS_IO APIs * aio_cancel64() * aio_error64() * aio_fsync64() * aio_read64() * aio_return64() * aio_suspend64() * aio_write64() * lio_listio64() * * _LFS64_LARGEFILE APIs * ftruncate64() * lockf64() * mmap64() * readdir64() * truncate64() * */ /* * definitions for "hooks_common.c" */ int gfs_hook_syscall_open64(const char *path, int oflag, mode_t mode) { #ifdef SYS_open64 return (syscall(SYS_open64, path, oflag, mode)); #else return (gfs_hook_syscall_open(path, oflag | O_LARGEFILE, mode)); #endif } int gfs_hook_syscall_creat64(const char *path, mode_t mode) { #ifdef SYS_creat64 return (syscall(SYS_creat64, path, mode)); #else return (gfs_hook_syscall_open64(path, O_CREAT|O_TRUNC|O_WRONLY, mode)); #endif } #ifndef __linux__ int gfs_hook_syscall_getdents64(int filedes, struct dirent64 *buf, size_t nbyte) { # ifdef SYS_getdents64 return (syscall(SYS_getdents64, filedes, buf, nbyte)); # else return (gfs_hook_syscall_getdents(filedes, buf, nbyte)); # endif } #endif #ifdef SYS_truncate64 int gfs_hook_syscall_truncate64(const char *path, off64_t length) { return (syscall(SYS_truncate64, path, length)); } #define SYSCALL_TRUNCATE(path, length) \ gfs_hook_syscall_truncate64(path, length) #define FUNC___TRUNCATE __truncate64 #define FUNC__TRUNCATE _truncate64 #define FUNC_TRUNCATE truncate64 #endif #ifdef SYS_ftruncate64 int gfs_hook_syscall_ftruncate64(int filedes, off64_t length) { return (syscall(SYS_ftruncate64, filedes, length)); } #define SYSCALL_FTRUNCATE(filedes, length) \ gfs_hook_syscall_ftruncate64(filedes, length) #define FUNC___FTRUNCATE __ftruncate64 #define FUNC__FTRUNCATE _ftruncate64 #define FUNC_FTRUNCATE ftruncate64 #endif /* see lseek64.c for gfs_hook_syscall_lseek64() implementation */ #if defined(SYS_pread) || defined(SYS_pread64) int gfs_hook_syscall_pread64(int filedes, void *buf, size_t nbyte, off64_t offset) { # ifdef SYS_pread64 return (syscall(SYS_pread64, filedes, buf, nbyte, offset)); # else return (syscall(SYS_pread, filedes, buf, nbyte, offset)); # endif } #define SYSCALL_PREAD(filedes, buf, nbyte, offset) \ gfs_hook_syscall_pread64(filedes, buf, nbyte, offset) #define FUNC___PREAD __pread64 #define FUNC__PREAD _pread64 #define FUNC_PREAD pread64 #endif #if defined(SYS_pwrite) || defined(SYS_pwrite64) int gfs_hook_syscall_pwrite64(int filedes, const void *buf, size_t nbyte, off64_t offset) { # ifdef SYS_pwrite64 return (syscall(SYS_pwrite64, filedes, buf, nbyte, offset)); # else return (syscall(SYS_pwrite, filedes, buf, nbyte, offset)); # endif #define SYSCALL_PWRITE(filedes, buf, nbyte, offset) \ gfs_hook_syscall_pwrite64(filedes, buf, nbyte, offset) #define FUNC___PWRITE __pwrite64 #define FUNC__PWRITE _pwrite64 #define FUNC_PWRITE pwrite64 } #endif #if defined(OS_SOLARIS) /* * do not need xstat64 on Solaris 2. * * on sparc, _STAT_VER is not defined. * on i386, _STAT_VER is defined, but only used for 32bit interface. */ #elif defined(_STAT_VER) /* Linux or SVR4 except Solaris */ # define NEED_XSTAT64 #endif int gfs_hook_syscall_stat64(const char *path, struct stat64 *buf) { #ifndef NEED_XSTAT64 return (syscall(SYS_stat64, path, buf)); #else /* Linux or SVR4, but not Solaris 2 */ return (gfs_hook_syscall_xstat64(_STAT_VER, path, buf)); #endif } int gfs_hook_syscall_lstat64(const char *path, struct stat64 *buf) { #ifndef NEED_XSTAT64 return (syscall(SYS_lstat64, path, buf)); #else /* Linux or SVR4, but not Solaris 2 */ return (gfs_hook_syscall_lxstat64(_STAT_VER, path, buf)); #endif } int gfs_hook_syscall_fstat64(int filedes, struct stat64 *buf) { #ifndef NEED_XSTAT64 return (syscall(SYS_fstat64, filedes, buf)); #else /* Linux or SVR4, but not Solaris 2 */ return (gfs_hook_syscall_fxstat64(_STAT_VER, filedes, buf)); #endif } /* * for SVR4 except Solaris 2 * * (see gfs_hook/sysdep/linux/xstat64.c about Linux) */ #if defined(NEED_XSTAT64) && defined(SYS_xstat) int gfs_hook_syscall_xstat64(int ver, const char *path, struct stat64 *buf) { #if defined(__sgi) && _MIPS_SIM == _ABIN32 /* ABI N32 */ return (gfs_hook_syscall_xstat(SYS_xstat, _STAT_VER, path, buf)); #else return (gfs_hook_syscall_xstat(SYS_xstat, _STAT64_VER, path, buf)); #endif } int gfs_hook_syscall_lxstat64(int ver, const char *path, struct stat64 *buf) { #if defined(__sgi) && _MIPS_SIM == _ABIN32 /* ABI N32 */ return (gfs_hook_syscall_lxstat(SYS_lxstat, _STAT_VER, path, buf)); #else return (gfs_hook_syscall_lxstat(SYS_lxstat, _STAT64_VER, path, buf)); #endif } int gfs_hook_syscall_fxstat64(int ver, int filedes, struct stat64 *buf) { #if defined(__sgi) && _MIPS_SIM == _ABIN32 /* ABI N32 */ return (gfs_hook_syscall_fxstat(SYS_fxstat, _STAT_VER, filedes, buf)); #else return (gfs_hook_syscall_fxstat(SYS_fxstat, _STAT64_VER, filedes, buf)); #endif } #endif /* defined(NEED_XSTAT64) && defined(SYS_xstat) */ #define OFF_T off64_t #define SYSCALL_OPEN(path, oflag, mode) \ gfs_hook_syscall_open64(path, oflag, mode) #define SYSCALL_CREAT(path, mode) \ gfs_hook_syscall_creat64(path, mode) #define SYSCALL_LSEEK(filedes, offset, whence) \ gfs_hook_syscall_lseek64(filedes, offset, whence) #define FUNC___OPEN __open64 #define FUNC__OPEN _open64 #define FUNC_OPEN open64 #define FUNC___CREAT __creat64 #define FUNC__CREAT _creat64 #define FUNC_CREAT creat64 #define FUNC__LIBC_CREAT _libc_creat64 #define FUNC___LSEEK __lseek64 #define FUNC__LSEEK _lseek64 #define FUNC_LSEEK lseek64 #define SYSCALL_GETDENTS(filedes, buf, nbyte) \ gfs_hook_syscall_getdents64(filedes, buf, nbyte) #define FUNC___GETDENTS __getdents64 #define FUNC__GETDENTS _getdents64 #define FUNC_GETDENTS getdents64 #define STRUCT_DIRENT struct dirent64 #define ALIGNMENT 8 #define ALIGN(p) (((unsigned long)(p) + ALIGNMENT - 1) & ~(ALIGNMENT - 1)) #include "hooks_common.c" /* stat */ #define STRUCT_STAT struct stat64 #define SYSCALL_STAT(path, buf) \ gfs_hook_syscall_stat64(path, buf) #define FUNC___STAT __stat64 #define FUNC__STAT _stat64 #define FUNC_STAT stat64 #define GFS_STAT gfs_stat #define GFS_STAT_SECTION gfs_stat_section #define GFS_STAT_INDEX gfs_stat_index #ifdef NEED_XSTAT64 /* SVR4 or Linux, but not Solaris 2 */ #define SYSCALL_XSTAT(ver, path, buf) \ gfs_hook_syscall_xstat64(ver, path, buf) #define FUNC___XSTAT __xstat64 #define FUNC__XSTAT _xstat64 #endif #include "hooks_stat.c" #undef SYSCALL_STAT #undef FUNC___STAT #undef FUNC__STAT #undef FUNC_STAT #undef GFS_STAT #ifdef NEED_XSTAT64 /* SVR4 or Linux, but not Solaris 2 */ #undef SYSCALL_XSTAT #undef FUNC___XSTAT #undef FUNC__XSTAT #endif /* lstat */ #define SYSCALL_STAT(path, buf) \ gfs_hook_syscall_lstat64(path, buf) #define FUNC___STAT __lstat64 #define FUNC__STAT _lstat64 #define FUNC_STAT lstat64 #define GFS_STAT gfs_stat /* XXX - gfs_lstat in not implemented yet */ #ifdef NEED_XSTAT64 /* SVR4 or Linux, but not Solaris 2 */ #define SYSCALL_XSTAT(ver, path, buf) \ gfs_hook_syscall_lxstat64(ver, path, buf) #define FUNC___XSTAT __lxstat64 #define FUNC__XSTAT _lxstat64 #endif #include "hooks_stat.c" /* fstat */ #define SYSCALL_FSTAT(path, buf) \ gfs_hook_syscall_fstat64(path, buf) #define FUNC___FSTAT __fstat64 #define FUNC__FSTAT _fstat64 #define FUNC_FSTAT fstat64 #define GFS_FSTAT gfs_fstat #ifdef NEED_XSTAT64 /* SVR4 or Linux, but not Solaris 2 */ #define SYSCALL_FXSTAT(ver, fd, buf) \ gfs_hook_syscall_fxstat64(ver, fd, buf) #define FUNC___FXSTAT __fxstat64 #define FUNC__FXSTAT _fxstat64 #endif #include "hooks_fstat.c" #if defined(SYS_llseek) || defined(SYS__llseek) /* * llseek */ OFF_T __llseek(int filedes, OFF_T offset, int whence) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking " "__llseek" ": %d", filedes)); return (FUNC___LSEEK(filedes, offset, whence)); } OFF_T _llseek(int filedes, OFF_T offset, int whence) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking " "_llseek" ": %d", filedes)); return (FUNC___LSEEK(filedes, offset, whence)); } OFF_T llseek(int filedes, OFF_T offset, int whence) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking " "llseek" ": %d", filedes)); return (FUNC___LSEEK(filedes, offset, whence)); } #endif /* defined(SYS_llseek) || defined(SYS__llseek) */ gfarm-2.4.1/lib/gfs_hook/hook_test.c0000644000000000000000000001415011507222722016021 0ustar rootroot/* * Test program for syscall hooking feature. * * $Id: hook_test.c 2373 2006-01-12 00:54:22Z soda $ */ #include #include #include #include #include #include #include #include #include #include #include /* * Display struct stat. * * Known bug: Device is not correctly displayed. */ #ifndef HAVE_GTIME #define gtime(x) asctime(gmtime(x)) #endif #ifndef S_IAMB #define S_IAMB 07777 #endif void display_stat(char *fn, struct stat *st) { printf(" File: \"%s\"\n", fn); printf(" Size: %-12ld Filetype: ", (long)st->st_size); switch (st->st_mode & S_IFMT) { case S_IFSOCK: puts("socket"); break; case S_IFLNK: puts("symbolic link"); break; case S_IFREG: puts("regular file"); break; case S_IFBLK: puts("block device"); break; case S_IFDIR: puts("directory"); break; case S_IFCHR: puts("character device"); break; case S_IFIFO: puts("fifo"); break; default: printf("unknown\n"); } #if 0 printf(" Mode: (%04o) Uid: (%5d/%8s) Gid: (%5d/%8s)\n", st->st_mode & S_IAMB, st->st_uid, getpwuid(st->st_uid)->pw_name, st->st_gid, getgrgid(st->st_gid)->gr_name); printf("Device: %d,%d Inode: %ld Links: %d\n", st->st_dev, st->st_rdev, st->st_ino, st->st_nlink); #endif printf("Access: %s", gtime(&st->st_atime)); printf("Modify: %s", gtime(&st->st_mtime)); printf("Change: %s", gtime(&st->st_ctime)); } /* * test functions */ int test_stat(char *filename) { struct stat s; int r; printf("***** stat(%s)\n", filename); if ((r = stat(filename, &s))) perror(filename); else display_stat(filename, &s); return r; } int test_lstat(char *filename) { struct stat s; int r; printf("***** lstat(%s)\n", filename); if ((r = lstat(filename, &s))) perror(filename); else display_stat(filename, &s); return r; } void test_fstat(int filedes) { struct stat s; printf("***** fstat(%d)\n", filedes); if (fstat(filedes, &s)) perror("fstat"); else display_stat("test_fstat", &s); } int test_access(char *filename) { int r; printf("***** access(%s, %d)\n", filename, R_OK); if ((r = access(filename, R_OK))) perror(filename); return r; } int test_open_create(char *filename) { int fd; printf("***** open(%s, O_WRONLY|O_CREAT|O_TRUNC, 0664)\n", filename); if ((fd = open(filename, O_WRONLY|O_CREAT|O_TRUNC, 0664)) == -1) perror(filename), exit(1); return fd; } int test_open_rdonly(char *filename) { int fd; printf("***** open(%s, O_RDONLY)\n", filename); if ((fd = open(filename, O_RDONLY)) == -1) perror(filename), exit(1); return fd; } void test_write_string(int fd, char *teststring) { printf("***** write(%d, %d)\n", fd, strlen(teststring) + 1); if (write(fd, teststring, strlen(teststring) + 1) == -1) perror("write"), exit(1); } void test_read_string(int fd) { # define BUFSIZE 100 char buf[BUFSIZE]; int n; printf("***** read(%d, %d)\n", fd, sizeof(buf)); while ((n = read(fd, buf, sizeof(buf))) > 0) { int i; for (i = 0; i < n; ++i) if (buf[i]) printf("%c", buf[i]); } } void test_lseek_set(int fd, off_t offset) { printf("***** lseek(%d, %d, SEEK_SET)\n", fd, (int)offset); if (lseek(fd, offset, SEEK_SET) == -1) perror("lseek"), exit(1); } void test_close(int fd) { printf("***** close(%d)\n", fd); if (close(fd)) perror("close"), exit(1); } void test_unlink(char *filename) { printf("***** unlink(%s)\n", filename); if (unlink(filename)) perror(filename), exit(1); } /* * stdio */ FILE *test_fopen(char *filename, char *mode) { FILE *f; printf("***** fopen(%s, \"%s\")\n", filename, mode); if ((f = fopen(filename, mode)) == NULL) perror(filename), exit(1); return f; } void test_fgetc(FILE *f) { int c; printf("***** fgetc(%d)\n", fileno(f)); while ((c = fgetc(f)) != EOF) printf("%c", c); } void test_fseek_set(FILE *f, long offset) { printf("***** fseek(%d, %ld, SEEK_SET)\n", fileno(f), offset); if (fseek(f, offset, SEEK_SET)) perror("fseek"), exit(1); } void test_ftell(FILE *f) { long pos; printf("***** ftell(%d)\n", fileno(f)); pos = ftell(f); if (pos == -1) perror("ftell"), exit(1); printf("pos = %ld\n", pos); } void test_rewind(FILE *f) { printf("***** rewind(%d)\n", fileno(f)); rewind(f); } void test_fseeko_set(FILE *f, off_t offset) { printf("***** fseeko(%d, %ld, SEEK_SET)\n", fileno(f), (long)offset); if (fseeko(f, offset, SEEK_SET)) perror("fseeko"), exit(1); } void test_ftello(FILE *f) { off_t pos; printf("***** ftello(%d)\n", fileno(f)); pos = ftello(f); if (pos == -1) perror("ftello"), exit(1); printf("pos = %ld\n", (long)pos); } void test_fclose(FILE *f) { printf("***** fclose(%d)\n", fileno(f)); if (fclose(f)) perror("fclose"), exit(1); } /* * */ int main(int argc, char *argv[]) { char *filename = "gfarm:gfs_hook_test", *e; static char teststring[] = "Gfarm hook test!\n"; int fd; FILE *f; setvbuf(stdout, NULL, _IONBF, 0); /* to sync with truss/strace output */ if (argc > 1) filename = argv[1]; /* create a file */ if (test_stat(filename) == 0) test_unlink(filename); fd = test_open_create(filename); test_write_string(fd, teststring); test_lseek_set(fd, 0); test_fstat(fd); test_close(fd); test_access(filename); test_stat(filename); test_lstat(filename); /* read the file */ fd = test_open_rdonly(filename); test_read_string(fd); test_lseek_set(fd, 0); test_read_string(fd); test_fstat(fd); test_close(fd); test_stat(filename); test_lstat(filename); #if 0 /* unlink the file */ test_unlink(filename); f = test_fopen(filename, "w"); fprintf(f, "%s", teststring); test_fclose(f); f = test_fopen(filename, "r"); test_fgetc(f); test_fseek_set(f, 0); test_ftell(f); test_rewind(f); test_fseeko_set(f, 0); test_ftello(f); test_fclose(f); test_unlink(filename); #endif exit(0); } gfarm-2.4.1/lib/gfs_hook/hooks_fstat.c0000644000000000000000000001157611507222722016357 0ustar rootroot/* * fstat * * $Id: hooks_fstat.c 4303 2010-01-06 01:45:08Z ookuma $ */ extern int gfarm_node; #ifndef FUNC__FXSTAT int FUNC___FSTAT(int filedes, STRUCT_STAT *buf) { GFS_File gf; char *e; int errno_save = errno; _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking " S(FUNC___FSTAT) "(%d)", filedes)); if ((gf = gfs_hook_is_open(filedes)) == NULL) return (SYSCALL_FSTAT(filedes, buf)); _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: Hooking " S(FUNC___FSTAT) "(%d)", filedes)); if (gfs_hook_gfs_file_type(filedes) == GFS_DT_REG) { struct gfs_stat status; e = gfs_fstat(gf, &status); if (e != NULL) goto error; memchr(buf, 0, sizeof(*buf)); buf->st_dev = GFS_DEV; buf->st_ino = status.st_ino; buf->st_mode = status.st_mode; buf->st_nlink = 1; buf->st_uid = getuid(); buf->st_gid = getgid(); buf->st_size = status.st_size; buf->st_blksize = GFS_BLKSIZE; buf->st_blocks = (status.st_size + STAT_BLKSIZ-1)/ STAT_BLKSIZ; buf->st_atime = status.st_atimespec.tv_sec; buf->st_mtime = status.st_mtimespec.tv_sec; buf->st_ctime = status.st_ctimespec.tv_sec; gfs_stat_free(&status); } else { struct gfs_stat *gsp; gsp = gfs_hook_get_gfs_stat(filedes); memchr(buf, 0, sizeof(*buf)); buf->st_dev = GFS_DEV; buf->st_ino = gsp->st_ino; buf->st_mode = gsp->st_mode; buf->st_nlink = GFS_NLINK_DIR; buf->st_uid = getuid(); buf->st_gid = getgid(); buf->st_size = gsp->st_size; buf->st_blksize = GFS_BLKSIZE; buf->st_blocks = (gsp->st_size + STAT_BLKSIZ-1) / STAT_BLKSIZ; buf->st_atime = gsp->st_atimespec.tv_sec; buf->st_mtime = gsp->st_mtimespec.tv_sec; buf->st_ctime = gsp->st_ctimespec.tv_sec; } errno = errno_save; return (0); error: _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: " S(FUNC___FSTAT) ": %s", e)); errno = gfarm_error_to_errno(e); return (-1); } int FUNC__FSTAT(int filedes, STRUCT_STAT *buf) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking " S(FUNC__FSTAT) ": %d", filedes)); return (FUNC___FSTAT(filedes, buf)); } int FUNC_FSTAT(int filedes, STRUCT_STAT *buf) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking " S(FUNC_FSTAT) ": %d", filedes)); return (FUNC___FSTAT(filedes, buf)); } #else /* defined(FUNC__FXSTAT) -- SVR4 or Linux */ /* * SVR4 and Linux do inline stat() and call _xstat/__xstat() with * an additional version argument. */ #ifdef __linux__ /* * unlike SVR4, stat() on linux seems to be compatible with xstat(STAT_VER,...) */ int FUNC___FSTAT(int filedes, STRUCT_STAT *buf) { _gfs_hook_debug_v( gflog_info(GFARM_MSG_UNFIXED, "Hooking " S(FUNC___FSTAT) ": %d", filedes)); return (FUNC___FXSTAT(_STAT_VER, filedes, buf)); } int FUNC_FSTAT(int filedes, STRUCT_STAT *buf) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking " S(FUNC_FSTAT) ": %d", filedes)); return (FUNC___FXSTAT(_STAT_VER, filedes, buf)); } #else /* * we don't provide stat(), because it is only used for SVR3 compat code. */ #endif int FUNC___FXSTAT(int ver, int filedes, STRUCT_STAT *buf) { GFS_File gf; char *e; int errno_save = errno; _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking " S(FUNC___FXSTAT) "(%d)", filedes)); if ((gf = gfs_hook_is_open(filedes)) == NULL) return (SYSCALL_FXSTAT(ver, filedes, buf)); _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: Hooking " S(FUNC___FXSTAT) "(%d)", filedes)); if (gfs_hook_gfs_file_type(filedes) == GFS_DT_REG) { struct gfs_stat status; e = gfs_fstat(gf, &status); if (e != NULL) goto error; buf->st_dev = GFS_DEV; buf->st_ino = status.st_ino; buf->st_mode = status.st_mode; buf->st_nlink = 1; buf->st_uid = getuid(); buf->st_gid = getgid(); buf->st_size = status.st_size; buf->st_blksize = GFS_BLKSIZE; buf->st_blocks = (status.st_size + STAT_BLKSIZ-1)/ STAT_BLKSIZ; buf->st_atime = status.st_atimespec.tv_sec; buf->st_mtime = status.st_mtimespec.tv_sec; buf->st_ctime = status.st_ctimespec.tv_sec; gfs_stat_free(&status); } else { struct gfs_stat *gsp; gsp = gfs_hook_get_gfs_stat(filedes); buf->st_dev = GFS_DEV; buf->st_ino = gsp->st_ino; buf->st_mode = gsp->st_mode; buf->st_nlink = GFS_NLINK_DIR; buf->st_uid = getuid(); buf->st_gid = getgid(); buf->st_size = gsp->st_size; buf->st_blksize = GFS_BLKSIZE; buf->st_blocks = (gsp->st_size + STAT_BLKSIZ-1) / STAT_BLKSIZ; buf->st_atime = gsp->st_atimespec.tv_sec; buf->st_mtime = gsp->st_mtimespec.tv_sec; buf->st_ctime = gsp->st_ctimespec.tv_sec; } errno = errno_save; return (0); error: _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: " S(FUNC___FXSTAT) ": %s", e)); errno = gfarm_error_to_errno(e); return (-1); } int FUNC__FXSTAT(int ver, int filedes, STRUCT_STAT *buf) { _gfs_hook_debug_v( gflog_info(GFARM_MSG_UNFIXED, "Hooking " S(FUNC__FXSTAT) ": %d", filedes)); return (FUNC___FXSTAT(ver, filedes, buf)); } #endif /* SVR4 or Linux */ gfarm-2.4.1/lib/gfs_hook/hook_test_mpi.c0000644000000000000000000001361311507222722016671 0ustar rootroot/* * Test program for syscall hooking feature. * * $Id: hook_test_mpi.c 242 2003-02-01 03:18:15Z tatebe $ */ #include #include #include #include #include #include #include #include #include #include #include #include /* * Display struct stat. * * Known bug: Device is not correctly displayed. */ #ifndef HAVE_GTIME #define gtime(x) asctime(gmtime(x)) #endif #ifndef S_IAMB #define S_IAMB 07777 #endif void display_stat(char *fn, struct stat *st) { printf(" File: \"%s\"\n", fn); printf(" Size: %-12ld Filetype: ", (long)st->st_size); switch (st->st_mode & S_IFMT) { case S_IFSOCK: puts("socket"); break; case S_IFLNK: puts("symbolic link"); break; case S_IFREG: puts("regular file"); break; case S_IFBLK: puts("block device"); break; case S_IFDIR: puts("directory"); break; case S_IFCHR: puts("character device"); break; case S_IFIFO: puts("fifo"); break; default: printf("unknown\n"); } printf(" Mode: (%04o) Uid: (%5d/%8s) Gid: (%5d/%8s)\n", st->st_mode & S_IAMB, st->st_uid, getpwuid(st->st_uid)->pw_name, st->st_gid, getgrgid(st->st_gid)->gr_name); #if 0 printf("Device: %d,%d Inode: %ld Links: %d\n", st->st_dev, st->st_rdev, st->st_ino, st->st_nlink); #endif printf("Access: %s", gtime(&st->st_atime)); printf("Modify: %s", gtime(&st->st_mtime)); printf("Change: %s", gtime(&st->st_ctime)); } /* * test functions */ void test_stat(char *filename) { struct stat s; printf("***** stat(%s)\n", filename); if (stat(filename, &s)) perror(filename); else display_stat(filename, &s); } void test_lstat(char *filename) { struct stat s; printf("***** lstat(%s)\n", filename); if (lstat(filename, &s)) perror(filename); else display_stat(filename, &s); } void test_fstat(int filedes) { struct stat s; printf("***** fstat(%d)\n", filedes); if (fstat(filedes, &s)) perror("fstast"); else display_stat("test_fstat", &s); } int test_open_create(char *filename) { int fd; printf("***** open(%s, O_WRONLY|O_CREAT|O_TRUNC, 0664)\n", filename); if ((fd = open(filename, O_WRONLY|O_CREAT|O_TRUNC, 0664)) == -1) perror(filename), exit(1); return fd; } int test_open_rdonly(char *filename) { int fd; printf("***** open(%s, O_RDONLY)\n", filename); if ((fd = open(filename, O_RDONLY)) == -1) perror(filename), exit(1); return fd; } void test_write_string(int fd, char *teststring) { printf("***** write(%d, %d)\n", fd, strlen(teststring) + 1); if (write(fd, teststring, strlen(teststring) + 1) == -1) perror("write"), exit(1); } void test_read_string(int fd) { # define BUFSIZE 100 char buf[BUFSIZE]; int n; printf("***** read(%d, %d)\n", fd, sizeof(buf)); while ((n = read(fd, buf, sizeof(buf))) > 0) { int i; for (i = 0; i < n; ++i) if (buf[i]) printf("%c", buf[i]); } } void test_lseek_set(int fd, off_t offset) { printf("***** lseek(%d, %d, SEEK_SET)\n", fd, (int)offset); if (lseek(fd, offset, SEEK_SET)) perror("lseek"), exit(1); } void test_close(int fd) { printf("***** close(%d)\n", fd); if (close(fd)) perror("close"), exit(1); } void test_unlink(char *filename) { printf("***** unlink(%s)\n", filename); if (unlink(filename)) perror(filename), exit(1); } /* * stdio */ FILE *test_fopen(char *filename, char *mode) { FILE *f; printf("***** fopen(%s, \"%s\")\n", filename, mode); if ((f = fopen(filename, mode)) == NULL) perror(filename), exit(1); return f; } void test_fgetc(FILE *f) { int c; printf("***** fgetc(%d)\n", fileno(f)); while ((c = fgetc(f)) != EOF) printf("%c", c); } void test_fseek_set(FILE *f, long offset) { printf("***** fseek(%d, %ld, SEEK_SET)\n", fileno(f), offset); if (fseek(f, offset, SEEK_SET)) perror("fseek"), exit(1); } void test_ftell(FILE *f) { long pos; printf("***** ftell(%d)\n", fileno(f)); pos = ftell(f); if (pos == -1) perror("ftell"), exit(1); printf("pos = %ld\n", pos); } void test_rewind(FILE *f) { printf("***** rewind(%d)\n", fileno(f)); rewind(f); } void test_fseeko_set(FILE *f, off_t offset) { printf("***** fseeko(%d, %ld, SEEK_SET)\n", fileno(f), (long)offset); if (fseeko(f, offset, SEEK_SET)) perror("fseeko"), exit(1); } void test_ftello(FILE *f) { off_t pos; printf("***** ftello(%d)\n", fileno(f)); pos = ftello(f); if (pos == -1) perror("ftello"), exit(1); printf("pos = %ld\n", (long)pos); } void test_fclose(FILE *f) { printf("***** fclose(%d)\n", fileno(f)); if (fclose(f)) perror("fclose"), exit(1); } /* * */ int main(int argc, char *argv[]) { char *filename = "gfarm:gfs_hook_test"; static char teststring[] = "Gfarm hook test!\n"; int fd; FILE *f; /* * If gfarm_initialize() is not necessary. */ MPI_Init(&argc, &argv); if (argc > 1) filename = argv[1]; /* create a file */ test_stat(filename); test_lstat(filename); fd = test_open_create(filename); test_write_string(fd, teststring); test_lseek_set(fd, 0); test_fstat(fd); test_close(fd); test_stat(filename); test_lstat(filename); /* read the file */ fd = test_open_rdonly(filename); test_read_string(fd); test_lseek_set(fd, 0); test_read_string(fd); test_fstat(fd); test_close(fd); test_stat(filename); test_lstat(filename); /* unlink the file */ test_unlink(filename); f = test_fopen(filename, "w"); fprintf(f, "%s", teststring); test_fclose(f); f = test_fopen(filename, "r"); test_fgetc(f); test_fseek_set(f, 0); test_ftell(f); test_rewind(f); test_fseeko_set(f, 0); test_ftello(f); test_fclose(f); test_unlink(filename); MPI_Finalize(); exit(0); } gfarm-2.4.1/lib/gfs_hook/lseek64.c0000644000000000000000000000227511507222722015304 0ustar rootroot/* * $Id: lseek64.c 3617 2007-03-12 08:32:55Z n-soda $ * * The reason that this source file is separated from hooks_64.c is that * llseek/lseek64 needs special syscall() prototype to return 64bit value. */ #if defined(sun) && (defined(__svr4__) || defined(__SVR4)) #define OS_SOLARIS 1 #endif #ifndef OS_SOLARIS /* Solaris version is defined in sysdep/solaris/llseek.S */ #define syscall syscall_original /* avoid "int syscall()" function prototype */ #include #include #include #undef syscall #include "hooks_subr.h" #include off64_t syscall(); /* * XXX - not really tested. */ off64_t gfs_hook_syscall_lseek64(int filedes, off64_t offset, int whence) { #if defined(SYS_lseek64) return (syscall(SYS_lseek64, filedes, offset, whence)); #elif defined(SYS__llseek) /* linux */ int rv; off64_t result; rv = syscall(SYS__llseek, filedes, (int)(offset >> 32), (int)offset, &result, whence); return (rv ? rv : result); #elif defined(__linux__) && SIZEOF_LONG == 8 && defined(__NR_lseek) return (syscall(__NR_lseek, filedes, offset, whence)); #else #error do not know how to implement lseek64 #endif } #endif /* !OS_SOLARIS */ gfarm-2.4.1/lib/gfs_hook/hooks_stat.c0000644000000000000000000001545711507222722016213 0ustar rootroot/* * stat * * $Id: hooks_stat.c 4303 2010-01-06 01:45:08Z ookuma $ */ extern int gfarm_node; #ifndef FUNC__XSTAT int FUNC___STAT(const char *path, STRUCT_STAT *buf) { const char *e; char *url; struct gfs_stat gs; int nf = -1, np, errno_save = errno; _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking " S(FUNC___STAT) "(%s)", path)); if (!gfs_hook_is_url(path, &url)) return (SYSCALL_STAT(path, buf)); _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: Hooking " S(FUNC___STAT) "(%s)", path)); switch (gfs_hook_get_current_view()) { case section_view: _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: " S(GFS_STAT_SECTION) "(%s, %s)", url, gfs_hook_get_current_section())); e = GFS_STAT_SECTION(url, gfs_hook_get_current_section(), &gs); break; case index_view: _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: " S(GFS_STAT_INDEX) "(%s, %d)", url, gfs_hook_get_current_index())); e = GFS_STAT_INDEX(url, gfs_hook_get_current_index(), &gs); break; case local_view: /* * If the number of fragments is not the same as the * number of parallel processes, or the file is not * fragmented, do not change to the local file view. */ if (gfarm_url_fragment_number(url, &nf) == NULL) { if (gfs_pio_get_node_size(&np) == NULL && nf == np) { _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: " S(GFS_STAT_INDEX) "(%s, %d)", url, gfarm_node)); e = GFS_STAT_INDEX(url, gfarm_node, &gs); } else { _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: " S(GFS_STAT) "(%s)", url)); e = GFS_STAT(url, &gs); } } else { _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: " S(GFS_STAT) "(%s)", url)); e = GFS_STAT(url, &gs); } break; default: _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: " S(GFS_STAT) "(%s)", url)); e = GFS_STAT(url, &gs); } free(url); if (e == NULL) { struct passwd *p; memset(buf, 0, sizeof(*buf)); buf->st_dev = GFS_DEV; buf->st_ino = gs.st_ino; buf->st_mode = gs.st_mode; buf->st_nlink = S_ISDIR(buf->st_mode) ? GFS_NLINK_DIR : 1; /* XXX FIXME: need to convert gfarm global user to UNIX uid */ p = getpwnam(gfarm_get_local_username()); if (p != NULL) { buf->st_uid = p->pw_uid; buf->st_gid = p->pw_gid; } else { buf->st_uid = getuid(); /* XXX */ buf->st_gid = getgid(); /* XXX */ } buf->st_size = gs.st_size; buf->st_blksize = GFS_BLKSIZE; buf->st_blocks = (gs.st_size + STAT_BLKSIZ - 1) / STAT_BLKSIZ; buf->st_atime = gs.st_atimespec.tv_sec; buf->st_mtime = gs.st_mtimespec.tv_sec; buf->st_ctime = gs.st_ctimespec.tv_sec; gfs_stat_free(&gs); errno = errno_save; return (0); } _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: " S(FUNC___STAT) ": %s", e)); errno = gfarm_error_to_errno(e); return (-1); } int FUNC__STAT(const char *path, STRUCT_STAT *buf) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking " S(FUNC__STAT) ": %s", path)); return (FUNC___STAT(path, buf)); } int FUNC_STAT(const char *path, STRUCT_STAT *buf) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking " S(FUNC_STAT) ": %s", path)); return (FUNC___STAT(path, buf)); } #else /* defined(FUNC__XSTAT) -- SVR4 or Linux */ /* * SVR4 and Linux do inline stat() and call _xstat/__xstat() with * an additional version argument. */ #ifdef __linux__ /* * unlike SVR4, stat() on linux seems to be compatible with xstat(STAT_VER,...) */ int FUNC___STAT(const char *path, STRUCT_STAT *buf) { _gfs_hook_debug_v( gflog_info(GFARM_MSG_UNFIXED, "Hooking " S(FUNC___STAT) ": %s", path)); return (FUNC___XSTAT(_STAT_VER, path, buf)); } int FUNC_STAT(const char *path, STRUCT_STAT *buf) { _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking " S(FUNC_STAT) ": %s", path)); return (FUNC___XSTAT(_STAT_VER, path, buf)); } #else /* * we don't provide stat(), because it is only used for SVR3 compat code. */ #endif int FUNC___XSTAT(int ver, const char *path, STRUCT_STAT *buf) { const char *e; char *url; struct gfs_stat gs; int nf = -1, np, errno_save = errno; _gfs_hook_debug_v(gflog_info(GFARM_MSG_UNFIXED, "Hooking " S(FUNC___XSTAT) "(%s)", path)); if (!gfs_hook_is_url(path, &url)) return (SYSCALL_XSTAT(ver, path, buf)); _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: Hooking " S(FUNC___XSTAT) "(%s)", path)); switch (gfs_hook_get_current_view()) { case section_view: _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: " S(GFS_STAT_SECTION) "(%s, %s)", url, gfs_hook_get_current_section())); e = GFS_STAT_SECTION(url, gfs_hook_get_current_section(), &gs); break; case index_view: _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: " S(GFS_STAT_INDEX) "(%s, %d)", url, gfs_hook_get_current_index())); e = GFS_STAT_INDEX(url, gfs_hook_get_current_index(), &gs); break; case local_view: /* * If the number of fragments is not the same as the * number of parallel processes, or the file is not * fragmented, do not change to the local file view. */ if (gfarm_url_fragment_number(url, &nf) == NULL) { if (gfs_pio_get_node_size(&np) == NULL && nf == np) { _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: " S(GFS_STAT_INDEX) "(%s, %d)", url, gfarm_node)); e = GFS_STAT_INDEX(url, gfarm_node, &gs); } else { _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: " S(GFS_STAT) "(%s)", url)); e = GFS_STAT(url, &gs); } } else { _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: " S(GFS_STAT) "(%s)", url)); e = GFS_STAT(url, &gs); } break; default: _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: " S(GFS_STAT) "(%s)", url)); e = GFS_STAT(url, &gs); } free(url); if (e == NULL) { struct passwd *p; memset(buf, 0, sizeof(*buf)); buf->st_dev = GFS_DEV; buf->st_ino = gs.st_ino; buf->st_mode = gs.st_mode; buf->st_nlink = S_ISDIR(buf->st_mode) ? GFS_NLINK_DIR : 1; /* XXX FIXME: need to convert gfarm global user to UNIX uid */ p = getpwnam(gfarm_get_local_username()); if (p != NULL) { buf->st_uid = p->pw_uid; buf->st_gid = p->pw_gid; } else { buf->st_uid = getuid(); /* XXX */ buf->st_gid = getgid(); /* XXX */ } buf->st_size = gs.st_size; buf->st_blksize = GFS_BLKSIZE; buf->st_blocks = (gs.st_size + STAT_BLKSIZ - 1) / STAT_BLKSIZ; buf->st_atime = gs.st_atimespec.tv_sec; buf->st_mtime = gs.st_mtimespec.tv_sec; buf->st_ctime = gs.st_ctimespec.tv_sec; gfs_stat_free(&gs); errno = errno_save; return (0); } _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: " S(FUNC___XSTAT) ": %s", e)); errno = gfarm_error_to_errno(e); return (-1); } int FUNC__XSTAT(int ver, const char *path, STRUCT_STAT *buf) { _gfs_hook_debug_v( gflog_info(GFARM_MSG_UNFIXED, "Hooking " S(FUNC__XSTAT) ": %s", path)); return (FUNC___XSTAT(ver, path, buf)); } #endif /* SVR4 or Linux */ gfarm-2.4.1/lib/gfs_hook/getcwd.c0000644000000000000000000001602111507222722015276 0ustar rootroot/* from NetBSD: getcwd.c,v 1.32 2003/08/07 16:42:49 agc Exp */ /* * Copyright (c) 1989, 1991, 1993, 1995 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Jan-Simon Pendry. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. 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. */ #include #include #include #include #include #include #include #include #include #include #include "hooks_subr.h" #ifdef SYS_getcwd char * gfs_hook_syscall_getcwd(char *buf, size_t size) { int errno_save; size_t sz; int allocated = 0, realloc_needed = 0; char *tmp; errno_save = errno; if (buf == NULL) { if (size > 0) GFARM_MALLOC_ARRAY(buf, size); else { GFARM_MALLOC_ARRAY(buf, PATH_MAX); size = PATH_MAX; realloc_needed = 1; } if (buf == NULL) return (NULL); allocated = 1; } errno = 0; sz = syscall(SYS_getcwd, buf, size); if (errno == 0) { if (realloc_needed) { GFARM_REALLOC_ARRAY(tmp, buf, sz); if (tmp != NULL) buf = tmp; } errno = errno_save; return (buf); } if (allocated) free(buf); return (NULL); } #else /* do not have SYS_getcwd */ #define ISDOT(dp) \ (dp->d_name[0] == '.' && (dp->d_name[1] == '\0' || \ (dp->d_name[1] == '.' && dp->d_name[2] == '\0'))) #if defined(__SVR4) || defined(__svr4__) #define d_fileno d_ino #endif char * gfs_hook_syscall_getcwd(char *pt, size_t size) { struct dirent *dp; DIR *dir; dev_t dev; ino_t ino; int first; char *bpt, *bup; struct stat s; dev_t root_dev; ino_t root_ino; size_t ptsize, upsize; int save_errno; char *ept, *eup, *up; size_t dlen; /* * If no buffer specified by the user, allocate one as necessary. * If a buffer is specified, the size has to be non-zero. The path * is built from the end of the buffer backwards. */ if (pt) { ptsize = 0; if (!size) { errno = EINVAL; return (NULL); } ept = pt + size; } else { ptsize = 1024 - 4; GFARM_MALLOC_ARRAY(pt, ptsize); if (pt == NULL) return (NULL); ept = pt + ptsize; } bpt = ept - 1; *bpt = '\0'; /* * Allocate bytes (1024 - malloc space) for the string of "../"'s. * Should always be enough (it's 340 levels). If it's not, allocate * as necessary. Special case the first stat, it's ".", not "..". */ upsize = 1024 - 4; GFARM_MALLOC_ARRAY(up, upsize); if (up == NULL) goto err; eup = up + MAXPATHLEN; bup = up; up[0] = '.'; up[1] = '\0'; /* Save root values, so know when to stop. */ if (stat("/", &s)) goto err; root_dev = s.st_dev; root_ino = s.st_ino; errno = 0; /* XXX readdir has no error return. */ for (first = 1;; first = 0) { /* Stat the current level. */ if (lstat(up, &s)) goto err; /* Save current node values. */ ino = s.st_ino; dev = s.st_dev; /* Check for reaching root. */ if (root_dev == dev && root_ino == ino) { *--bpt = '/'; /* * It's unclear that it's a requirement to copy the * path to the beginning of the buffer, but it's always * been that way and stuff would probably break. */ memmove(pt, bpt, (size_t)(ept - bpt)); free(up); return (pt); } /* * Build pointer to the parent directory, allocating memory * as necessary. Max length is 3 for "../", the largest * possible component name, plus a trailing NULL. */ if (bup + 3 + MAXNAMLEN + 1 >= eup) { if (GFARM_REALLOC_ARRAY(up, up, upsize *= 2) == NULL) goto err; bup = up; eup = up + upsize; } *bup++ = '.'; *bup++ = '.'; *bup = '\0'; /* Open and stat parent directory. */ if (!(dir = opendir(up)) || stat(up, &s)) goto err; /* Add trailing slash for next directory. */ *bup++ = '/'; /* * If it's a mount point, have to stat each element because * the inode number in the directory is for the entry in the * parent directory, not the inode number of the mounted file. */ save_errno = 0; if (s.st_dev == dev) { for (;;) { if (!(dp = readdir(dir))) goto notfound; if (dp->d_fileno == ino) { #if defined(__SVR4) || defined(__svr4__) || defined(__linux__) dlen = strlen(dp->d_name); #else dlen = dp->d_namlen; #endif break; } } } else for (;;) { if (!(dp = readdir(dir))) goto notfound; if (ISDOT(dp)) continue; #if defined(__SVR4) || defined(__svr4__) || defined(__linux__) dlen = strlen(dp->d_name); #else dlen = dp->d_namlen; #endif memmove(bup, dp->d_name, dlen + 1); /* Save the first error for later. */ if (lstat(up, &s)) { if (!save_errno) save_errno = errno; errno = 0; continue; } if (s.st_dev == dev && s.st_ino == ino) break; } /* * Check for length of the current name, preceding slash, * leading slash. */ if (bpt - pt <= dlen + (first ? 1 : 2)) { size_t len, off; if (!ptsize) { errno = ERANGE; goto err; } off = bpt - pt; len = ept - bpt; if (GFARM_REALLOC_ARRAY(pt, pt, ptsize *= 2) == NULL) goto err; bpt = pt + off; ept = pt + ptsize; memmove(ept - len, bpt, len); bpt = ept - len; } if (!first) *--bpt = '/'; bpt -= dlen; memmove(bpt, dp->d_name, dlen); (void)closedir(dir); /* Truncate any file name. */ *bup = '\0'; } notfound: /* * If readdir set errno, use it, not any saved error; otherwise, * didn't find the current directory in its parent directory, set * errno to ENOENT. */ if (!errno) errno = save_errno ? save_errno : ENOENT; /* FALLTHROUGH */ err: save_errno = errno; if (ptsize) free(pt); free(up); errno = save_errno; return (NULL); } #endif /* do not have SYS_getcwd */ gfarm-2.4.1/lib/gfs_hook/Makefile0000644000000000000000000001261311507222722015320 0ustar rootroot# $Id: Makefile 3617 2007-03-12 08:32:55Z n-soda $ top_builddir = ../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk # shared object version LT_CURRENT=0 LT_REVISION=0 LT_AGE=0 LTLINK_SHARELIB= $(LTLINK) $(LTFLAGS_SHARELIB_IN) $(libdir) DEBUG_CFLAGS= SUFFIX= DEBUG_MAKEFLAGS= \ DEBUG_CFLAGS=-DDEBUG \ SUFFIX=_debug SUBDIRS= sysdep/$(gfs_hook_sysdep_subdir) SYSDEP_OBJS= sysdep/$(gfs_hook_sysdep_subdir)/libsysdep.la # do not use $(COMMON_CFLAGS) here, to avoid symbol renaming by largefile API. CFLAGS = $(OPTFLAGS) $(DEBUG_CFLAGS) -I$(srcdir) \ -I$(GFUTIL_SRCDIR) -I$(GFARMLIB_SRCDIR) $(openssl_includes) \ -I$(top_builddir)/include -I$(top_srcdir)/include # The reason, why we don't use $(GFARMLIB) and add an inter-library # dependency only on libgfarm here, is because the other dependencies # will be automatically added by libtool. And because using $(GFARMLIB) # automatically adds $(globus_gssapi_libs), and that may add statically # linked globus libraries to the libgfs_hook.a. LDLIBS = $(top_builddir)/lib/libgfarm/libgfarm.la # to not use default $(LIBRARY) target in lib.mk LIBRARY = LIBRARY_RESULT = libgfs_hook$(SUFFIX).la gfs_hook$(SUFFIX).o \ libgfs_hook_no_init$(SUFFIX).la gfs_hook_no_init$(SUFFIX).o \ $(mpi_targets) MPI_TARGETS = libgfs_hook_mpi$(SUFFIX).la gfs_hook_mpi$(SUFFIX).o # need to hook _LFS64_LARGEFILE API? LARGEFILE64_SRCS= hooks_64.c lseek64.c LARGEFILE64_OBJS= hooks_64$(SUFFIX).lo lseek64.lo # build MPI related objects? MPI_SRCS = hooks_init_mpi.c MPI_OBJS = hooks_init_mpi$(SUFFIX).lo SRCS = getcwd.c hooks_subr.c \ hooks.c \ $(largefile64_srcs) \ hooks_common.c hooks_stat.c hooks_fstat.c \ hooks_init.c $(mpi_srcs) OBJS = getcwd.lo hooks_subr$(SUFFIX).lo \ hooks$(SUFFIX).lo \ $(largefile64_objs) \ $(SYSDEP_OBJS) EXTRA_CLEAN_TARGETS= \ lib_tmp_gfs_hook$(SUFFIX).la \ lib_tmp_gfs_hook_no_init$(SUFFIX).la \ lib_tmp_gfs_hook_mpi$(SUFFIX).la \ hooks_init$(SUFFIX).lo $(mpi_objs) ### ### settings for test programs ### TEST_LDLIBS = $(GFARMLIB) ### ### main rule ### .SUFFIXES: .a .la .ln .o _debug.lo .lo .s .S .c .cc .f .y .l .c_debug.lo: $(LTCOMPILE) -c $(srcdir)/$*.c -o $*_debug.lo all: subdir-all gfs-hooks debug-gfs-hooks ### ### rules to make $(LIBRARY_RESULT) ### gfs-hooks: $(LIBRARY_RESULT) lib_tmp_gfs_hook$(SUFFIX).la: $(OBJS) hooks_init$(SUFFIX).lo $(LTLINK) $(OBJS) hooks_init$(SUFFIX).lo gfs_hook$(SUFFIX).o: lib_tmp_gfs_hook$(SUFFIX).la $(LTLINK) lib_tmp_gfs_hook$(SUFFIX).la libgfs_hook$(SUFFIX).la: lib_tmp_gfs_hook$(SUFFIX).la $(LTLINK_SHARELIB) lib_tmp_gfs_hook$(SUFFIX).la $(LDLIBS) lib_tmp_gfs_hook_no_init$(SUFFIX).la: $(OBJS) $(LTLINK) $(OBJS) gfs_hook_no_init$(SUFFIX).o: lib_tmp_gfs_hook_no_init$(SUFFIX).la $(LTLINK) lib_tmp_gfs_hook_no_init$(SUFFIX).la libgfs_hook_no_init$(SUFFIX).la: lib_tmp_gfs_hook_no_init$(SUFFIX).la $(LTLINK_SHARELIB) lib_tmp_gfs_hook_no_init$(SUFFIX).la $(LDLIBS) lib_tmp_gfs_hook_mpi$(SUFFIX).la: $(OBJS) hooks_init_mpi$(SUFFIX).lo $(LTLINK) $(OBJS) hooks_init_mpi$(SUFFIX).lo gfs_hook_mpi$(SUFFIX).o: lib_tmp_gfs_hook_mpi$(SUFFIX).la $(LTLINK) lib_tmp_gfs_hook_mpi$(SUFFIX).la libgfs_hook_mpi$(SUFFIX).la: lib_tmp_gfs_hook_mpi$(SUFFIX).la $(LTLINK_SHARELIB) lib_tmp_gfs_hook_mpi$(SUFFIX).la $(LDLIBS) ### ### objects needed by $(LIBRARY_TARGET) ### getcwd.lo: getcwd.c $(INC_SRCDIR)/gfarm_misc.h hooks_subr.h hooks_subr$(SUFFIX).lo: hooks_subr.c $(LTCOMPILE) $(largefile_cflags) -o $@ -c $(srcdir)/hooks_subr.c lseek64.lo: lseek64.c $(LTCOMPILE) -D_LARGEFILE64_SOURCE `getconf LFS64_CFLAGS` -o $@ -c $(srcdir)/lseek64.c hooks_64$(SUFFIX).lo: hooks_64.c hooks_common.c hooks_stat.c hooks_fstat.c $(LTCOMPILE) -D_LARGEFILE64_SOURCE `getconf LFS64_CFLAGS` -o $@ -c $(srcdir)/hooks_64.c hooks$(SUFFIX).lo: hooks.c hooks_common.c hooks_stat.c hooks_fstat.c hooks_init_mpi$(SUFFIX).lo: hooks_init_mpi.c $(LIBTOOL) --mode=compile $(MPICC) $(CFLAGS) -o $@ -c $(srcdir)/hooks_init_mpi.c install: all # XXX this installation directory is WRONG. @$(MKDIR_P) $(DESTDIR)$(libdir) $(INSTALL_DATA) $(srcdir)/hooks_init_mpi.c \ $(DESTDIR)$(libdir)/hooks_init_mpi.c ### ### *_debug.{o,a,so*}: libraries compiled with -DDEBUG ### install: debug-lib-install clean: debug-lib-clean veryclean: debug-lib-veryclean debug-gfs-hooks debug-lib-install debug-lib-clean debug-lib-veryclean: @target=`expr $@ : 'debug-\(.*\)'`; \ echo '[' making $@ ']'; \ echo \ $(MAKE) -f $(srcdir)/Makefile $(DEBUG_MAKEFLAGS) $${target}; \ $(MAKE) -f $(srcdir)/Makefile $(DEBUG_MAKEFLAGS) $${target} ### ### test programs, these won't be installed. ### veryclean: test-veryclean test: hook_test mpitest: hook_test_mpi hook_test: subdir-all debug-gfs-hooks hook_test.o $(LTLINK) hook_test.o gfs_hook_debug.o $(TEST_LDLIBS) hook_test_mpi: subdir-all debug-gfs-hooks hook_test_mpi.o $(LIBTOOL) --mode=link $(MPICC) $(CFLAGS) -o $@ hook_test_mpi.o gfs_hook_mpi_debug.o $(TEST_LDLIBS) hook_test_mpi.o: hook_test_mpi.c $(MPICC) -c $(CFLAGS) -o $@ $(srcdir)/hook_test_mpi.c test-veryclean: $(LTCLEAN) hook_test hook_test.o hook_test_mpi hook_test_mpi.o ### ### dependencies, etc. ### include $(top_srcdir)/makes/subdir.mk include $(top_srcdir)/makes/lib.mk $(OBJS) hooks_64$(SUFFIX).lo: $(DEPGFARMINC) hooks_subr.h hooks_subr$(SUFFIX).lo: \ $(GFUTIL_SRCDIR)/hash.h \ $(GFARMLIB_SRCDIR)/config.h \ $(GFARMLIB_SRCDIR)/gfs_pio.h # libtool sometimes fails to remove .libs, and leaves ".libs/lib*.so.*T" post-distclean-hook: -rm -rf .libs gfarm-2.4.1/lib/gfs_hook/sysdep/0000755000000000000000000000000011507222730015163 5ustar rootrootgfarm-2.4.1/lib/gfs_hook/sysdep/solaris/0000755000000000000000000000000011507222730016637 5ustar rootrootgfarm-2.4.1/lib/gfs_hook/sysdep/solaris/llseek.S0000644000000000000000000000364211507222722020250 0ustar rootroot/* * CDDL HEADER START * * The contents of this file are subject to the terms of the * Common Development and Distribution License, Version 1.0 only * (the "License"). You may not use this file except in compliance * with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. * See the License for the specific language governing permissions * and limitations under the License. * * When distributing Covered Code, include this CDDL HEADER in each * file and include the License file at usr/src/OPENSOLARIS.LICENSE. * If applicable, add the following below this CDDL HEADER, with the * fields enclosed by brackets "[]" replaced with your own identifying * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END */ /* Copyright (c) 1988 AT&T */ /* All Rights Reserved */ /* * Copyright 2004 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ #pragma ident "@(#)llseek.s 1.7 05/06/08 SMI" .file "llseek.s" /* * C library -- llseek * offset_t llseek(int fildes, offset_t offset, int whence); */ #include #if 0 ANSI_PRAGMA_WEAK(llseek,function) #endif #define __cerror _cerror #define __cerror64 _cerror64 #if __STDC__ # define CONCAT(x,y) x ## y #else # define CONCAT(x,y) x/**/y #endif #if 0 #include "SYS.h" #elif defined(sparc) #include "sparc/SYS.h" #elif defined(sparcv9) #include "sparcv9/SYS.h" #elif defined(i386) #include "i386/SYS.h" #elif defined(amd64) || defined(x86_64) #include "amd64/SYS.h" #endif #if CLONGSIZE == 8 /* from sys/asm_linkage.h */ /* * For _LP64, llseek() is the same as lseek(). */ SYSCALL2_RVAL1(gfs_hook_syscall_lseek64,lseek) #else # if 0 SYSCALL64(llseek) # else ENTRY(gfs_hook_syscall_lseek64) SYSTRAP_64RVAL(llseek) SYSCERROR64 # endif #endif RET SET_SIZE(gfs_hook_syscall_lseek64) gfarm-2.4.1/lib/gfs_hook/sysdep/solaris/sparc/0000755000000000000000000000000011507222730017747 5ustar rootrootgfarm-2.4.1/lib/gfs_hook/sysdep/solaris/sparc/SYS.h0000644000000000000000000001516111507222722020603 0ustar rootroot/* * CDDL HEADER START * * The contents of this file are subject to the terms of the * Common Development and Distribution License, Version 1.0 only * (the "License"). You may not use this file except in compliance * with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. * See the License for the specific language governing permissions * and limitations under the License. * * When distributing Covered Code, include this CDDL HEADER in each * file and include the License file at usr/src/OPENSOLARIS.LICENSE. * If applicable, add the following below this CDDL HEADER, with the * fields enclosed by brackets "[]" replaced with your own identifying * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END */ /* * Copyright 2004 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ #ifndef _LIBC_SPARC_INC_SYS_H #define _LIBC_SPARC_INC_SYS_H #pragma ident "@(#)SYS.h 1.35 05/06/08 SMI" /* * This file defines common code sequences for system calls. Note that * it is assumed that __cerror is within the short branch distance from * all the traps (so that a simple bcs can follow the trap, rather than * a position independent code sequence.) Ditto for __cerror64. */ #include #include #include #if 0 #include "synonyms.h" #endif /* * While it's tempting to imagine we could use 'rd %pc' here, * in fact it's a rather slow operation that consumes many * cycles, so we use the usual side-effect of 'call' instead. */ #define PIC_SETUP(r) \ mov %o7, %g1; \ 9: call 8f; \ sethi %hi(_GLOBAL_OFFSET_TABLE_ - (9b - .)), %r; \ 8: or %r, %lo(_GLOBAL_OFFSET_TABLE_ - (9b - .)), %r; \ add %r, %o7, %r; \ mov %g1, %o7 /* * Trap number for system calls */ #define SYSCALL_TRAPNUM 8 #define FASTSCALL_TRAPNUM 9 /* * Define the external symbols __cerror and __cerror64 for all files. */ .global __cerror .global __cerror64 /* * __SYSTRAP provides the basic trap sequence. It assumes that an entry * of the form SYS_name exists (probably from sys/syscall.h). */ #define __SYSTRAP(name) \ /* CSTYLED */ \ mov CONCAT(SYS_,name), %g1; \ ta SYSCALL_TRAPNUM #define SYSTRAP_RVAL1(name) __SYSTRAP(name) #define SYSTRAP_RVAL2(name) __SYSTRAP(name) #define SYSTRAP_2RVALS(name) __SYSTRAP(name) #define SYSTRAP_64RVAL(name) __SYSTRAP(name) /* * SYSFASTTRAP provides the fast system call trap sequence. It assumes * that an entry of the form ST_name exists (probably from sys/trap.h). */ #define SYSFASTTRAP(name) \ /* CSTYLED */ \ ta ST_/**/name /* * SYSCERROR provides the sequence to branch to __cerror if an error is * indicated by the carry-bit being set upon return from a trap. */ #define SYSCERROR \ bcs __cerror; \ nop /* * SYSCERROR64 provides the sequence to branch to __cerror64 if an error is * indicated by the carry-bit being set upon return from a trap. */ #define SYSCERROR64 \ bcs __cerror64; \ nop /* * SYSLWPERR provides the sequence to return 0 on a successful trap * and the error code if unsuccessful. * Error is indicated by the carry-bit being set upon return from a trap. */ #define SYSLWPERR \ /* CSTYLED */ \ bcc,a,pt %icc, 1f; \ clr %o0; \ cmp %o0, ERESTART; \ move %icc, EINTR, %o0; \ 1: #define SAVE_OFFSET 68 /* * SYSREENTRY provides the entry sequence for restartable system calls. */ #define SYSREENTRY(name) \ ENTRY(name); \ stn %o0, [%sp + SAVE_OFFSET]; \ /* CSTYLED */ \ .restart_/**/name: /* * SYSRESTART provides the error handling sequence for restartable * system calls. */ #define SYSRESTART(name) \ /* CSTYLED */ \ bcc,pt %icc, 1f; \ cmp %o0, ERESTART; \ /* CSTYLED */ \ be,a,pn %icc, name; \ ldn [%sp + SAVE_OFFSET], %o0; \ /* CSTYLED */ \ ba,a __cerror; \ 1: /* * SYSINTR_RESTART provides the error handling sequence for restartable * system calls in case of EINTR or ERESTART. */ #define SYSINTR_RESTART(name) \ /* CSTYLED */ \ bcc,a,pt %icc, 1f; \ clr %o0; \ cmp %o0, ERESTART; \ /* CSTYLED */ \ be,a,pn %icc, name; \ ldn [%sp + SAVE_OFFSET], %o0; \ cmp %o0, EINTR; \ /* CSTYLED */ \ be,a,pn %icc, name; \ ldn [%sp + SAVE_OFFSET], %o0; \ 1: /* * SYSCALL provides the standard (i.e.: most common) system call sequence. */ #define SYSCALL(name) \ ENTRY(name); \ SYSTRAP_2RVALS(name); \ SYSCERROR #define SYSCALL_RVAL1(name) \ ENTRY(name); \ SYSTRAP_RVAL1(name); \ SYSCERROR /* * SYSCALL64 provides the standard (i.e.: most common) system call sequence * for system calls that return 64-bit values. */ #define SYSCALL64(name) \ ENTRY(name); \ SYSTRAP_64RVAL(name); \ SYSCERROR64 /* * SYSCALL_RESTART provides the most common restartable system call sequence. */ #define SYSCALL_RESTART(name) \ SYSREENTRY(name); \ SYSTRAP_2RVALS(name); \ /* CSTYLED */ \ SYSRESTART(.restart_/**/name) #define SYSCALL_RESTART_RVAL1(name) \ SYSREENTRY(name); \ SYSTRAP_RVAL1(name); \ /* CSTYLED */ \ SYSRESTART(.restart_/**/name) /* * SYSCALL2 provides a common system call sequence when the entry name * is different than the trap name. */ #define SYSCALL2(entryname, trapname) \ ENTRY(entryname); \ SYSTRAP_2RVALS(trapname); \ SYSCERROR #define SYSCALL2_RVAL1(entryname, trapname) \ ENTRY(entryname); \ SYSTRAP_RVAL1(trapname); \ SYSCERROR /* * SYSCALL2_RESTART provides a common restartable system call sequence when the * entry name is different than the trap name. */ #define SYSCALL2_RESTART(entryname, trapname) \ SYSREENTRY(entryname); \ SYSTRAP_2RVALS(trapname); \ /* CSTYLED */ \ SYSRESTART(.restart_/**/entryname) #define SYSCALL2_RESTART_RVAL1(entryname, trapname) \ SYSREENTRY(entryname); \ SYSTRAP_RVAL1(trapname); \ /* CSTYLED */ \ SYSRESTART(.restart_/**/entryname) /* * SYSCALL_NOERROR provides the most common system call sequence for those * system calls which don't check the error return (carry bit). */ #define SYSCALL_NOERROR(name) \ ENTRY(name); \ SYSTRAP_2RVALS(name) #define SYSCALL_NOERROR_RVAL1(name) \ ENTRY(name); \ SYSTRAP_RVAL1(name) /* * Standard syscall return sequence, return code equal to rval1. */ #define RET \ retl; \ nop /* * Syscall return sequence, return code equal to rval2. */ #define RET2 \ retl; \ mov %o1, %o0 /* * Syscall return sequence with return code forced to zero. */ #define RETC \ retl; \ clr %o0 #endif /* _LIBC_SPARC_INC_SYS_H */ gfarm-2.4.1/lib/gfs_hook/sysdep/solaris/i386/0000755000000000000000000000000011507222730017330 5ustar rootrootgfarm-2.4.1/lib/gfs_hook/sysdep/solaris/i386/SYS.h0000644000000000000000000001533011507222722020162 0ustar rootroot/* * CDDL HEADER START * * The contents of this file are subject to the terms of the * Common Development and Distribution License, Version 1.0 only * (the "License"). You may not use this file except in compliance * with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. * See the License for the specific language governing permissions * and limitations under the License. * * When distributing Covered Code, include this CDDL HEADER in each * file and include the License file at usr/src/OPENSOLARIS.LICENSE. * If applicable, add the following below this CDDL HEADER, with the * fields enclosed by brackets "[]" replaced with your own identifying * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END */ /* * Copyright 2005 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ #ifndef _LIBC_I386_INC_SYS_H #define _LIBC_I386_INC_SYS_H #pragma ident "@(#)SYS.h 1.8 05/06/08 SMI" /* * This file defines common code sequences for system calls. */ #include #include #include #include #if 0 #include "synonyms.h" #endif #define _prologue_ \ pushl %ebx; \ call 9f; \ 9: \ popl %ebx; \ addl $_GLOBAL_OFFSET_TABLE_ + [. - 9b], %ebx #define _epilogue_ \ popl %ebx #define _fref_(name) name@PLT #define _daref_(name) name@GOT(%ebx) #define _sref_(name) name@GOTOFF(%ebx) #define _esp_(offset) offset+4(%esp) /* add 4 for the saved %ebx */ /* * Define the external symbols __cerror and __cerror64 for all files. */ .globl __cerror .globl __cerror64 /* * __SYSCALLINT provides the basic trap sequence. It assumes that an entry * of the form SYS_name exists (probably from sys/syscall.h). */ #define __SYSCALLINT(name) \ /* CSTYLED */ \ movl $CONCAT(SYS_,name), %eax; \ int $T_SYSCALLINT /* * __SYSENTER provides a faster variant that is only able to * return rval1. Note that %ecx and %edx are ALWAYS smashed. */ #define __SYSENTER(name) \ call 8f; \ 8: popl %edx; \ /* CSTYLED */ \ movl $SYS_/**/name, %eax; \ movl %esp, %ecx; \ add $[9f - 8b], %edx; \ sysenter; \ 9: /* * __SYSCALL provides a faster variant on processors and kernels * that support it. Note that %ecx is ALWAYS smashed. */ #define __SYSCALL(name) \ /* CSTYLED */ \ movl $SYS_/**/name, %eax; \ .byte 0xf, 0x5 /* syscall */ #if defined(_SYSC_INSN) #define SYSTRAP_RVAL1(name) __SYSCALL(name) #define SYSTRAP_RVAL2(name) __SYSCALL(name) #define SYSTRAP_2RVALS(name) __SYSCALL(name) #define SYSTRAP_64RVAL(name) __SYSCALL(name) #else /* _SYSC_INSN */ #if defined(_SEP_INSN) #define SYSTRAP_RVAL1(name) __SYSENTER(name) #else /* _SEP_INSN */ #define SYSTRAP_RVAL1(name) __SYSCALLINT(name) #endif /* _SEP_INSN */ #define SYSTRAP_RVAL2(name) __SYSCALLINT(name) #define SYSTRAP_2RVALS(name) __SYSCALLINT(name) #define SYSTRAP_64RVAL(name) __SYSCALLINT(name) #endif /* _SYSC_INSN */ /* * SYSFASTTRAP provides the fast system call trap sequence. It assumes * that an entry of the form T_name exists (probably from sys/trap.h). */ #define SYSFASTTRAP(name) \ /* CSTYLED */ \ movl $T_/**/name, %eax; \ int $T_FASTTRAP /* * SYSCERROR provides the sequence to branch to __cerror if an error is * indicated by the carry-bit being set upon return from a trap. */ #define SYSCERROR \ jb __cerror /* * SYSCERROR64 provides the sequence to branch to __cerror64 if an error is * indicated by the carry-bit being set upon return from a trap. */ #define SYSCERROR64 \ jb __cerror64 /* * SYSLWPERR provides the sequence to return 0 on a successful trap * and the error code if unsuccessful. * Error is indicated by the carry-bit being set upon return from a trap. */ #define SYSLWPERR \ jae 1f; \ cmpl $ERESTART, %eax; \ jne 2f; \ movl $EINTR, %eax; \ jmp 2f; \ 1: \ xorl %eax, %eax; \ 2: /* * SYSREENTRY provides the entry sequence for restartable system calls. */ #define SYSREENTRY(name) \ /* CSTYLED */ \ .restart_/**/name: \ ENTRY(name) /* * SYSRESTART provides the error handling sequence for restartable * system calls. */ #define SYSRESTART(name) \ jae 1f; \ cmpl $ERESTART, %eax; \ je name; \ jmp __cerror; \ 1: /* * SYSINTR_RESTART provides the error handling sequence for restartable * system calls in case of EINTR or ERESTART. */ #define SYSINTR_RESTART(name) \ jae 1f; \ cmpl $ERESTART, %eax; \ je name; \ cmpl $EINTR, %eax; \ je name; \ jmp 2f; \ 1: \ xorl %eax, %eax; \ 2: /* * SYSCALL provides the standard (i.e.: most common) system call sequence. */ #define SYSCALL(name) \ ENTRY(name); \ SYSTRAP_2RVALS(name); \ SYSCERROR #define SYSCALL_RVAL1(name) \ ENTRY(name); \ SYSTRAP_RVAL1(name); \ SYSCERROR /* * SYSCALL64 provides the standard (i.e.: most common) system call sequence * for system calls that return 64-bit values. */ #define SYSCALL64(name) \ ENTRY(name); \ SYSTRAP_64RVAL(name); \ SYSCERROR64 /* * SYSCALL_RESTART provides the most common restartable system call sequence. */ #define SYSCALL_RESTART(name) \ SYSREENTRY(name); \ SYSTRAP_2RVALS(name); \ /* CSTYLED */ \ SYSRESTART(.restart_/**/name) #define SYSCALL_RESTART_RVAL1(name) \ SYSREENTRY(name); \ SYSTRAP_RVAL1(name); \ /* CSTYLED */ \ SYSRESTART(.restart_/**/name) /* * SYSCALL2 provides a common system call sequence when the entry name * is different than the trap name. */ #define SYSCALL2(entryname, trapname) \ ENTRY(entryname); \ SYSTRAP_2RVALS(trapname); \ SYSCERROR #define SYSCALL2_RVAL1(entryname, trapname) \ ENTRY(entryname); \ SYSTRAP_RVAL1(trapname); \ SYSCERROR /* * SYSCALL2_RESTART provides a common restartable system call sequence when the * entry name is different than the trap name. */ #define SYSCALL2_RESTART(entryname, trapname) \ SYSREENTRY(entryname); \ SYSTRAP_2RVALS(trapname); \ /* CSTYLED */ \ SYSRESTART(.restart_/**/entryname) #define SYSCALL2_RESTART_RVAL1(entryname, trapname) \ SYSREENTRY(entryname); \ SYSTRAP_RVAL1(trapname); \ /* CSTYLED */ \ SYSRESTART(.restart_/**/entryname) /* * SYSCALL_NOERROR provides the most common system call sequence for those * system calls which don't check the error return (carry bit). */ #define SYSCALL_NOERROR(name) \ ENTRY(name); \ SYSTRAP_2RVALS(name) #define SYSCALL_NOERROR_RVAL1(name) \ ENTRY(name); \ SYSTRAP_RVAL1(name) /* * Standard syscall return sequence, return code equal to rval1. */ #define RET \ ret /* * Syscall return sequence, return code equal to rval2. */ #define RET2 \ movl %edx, %eax; \ ret /* * Syscall return sequence with return code forced to zero. */ #define RETC \ xorl %eax, %eax; \ ret #endif /* _LIBC_I386_INC_SYS_H */ gfarm-2.4.1/lib/gfs_hook/sysdep/solaris/Makefile0000644000000000000000000000050711507222722020302 0ustar rootroot# $Id: Makefile 2828 2006-06-08 13:19:59Z soda $ top_builddir = ../../../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk CFLAGS = -I$(srcdir) -D_ASM LIBRARY = libsysdep.la LIBRARY_RESULT = # do not install SRCS = llseek.s OBJS = llseek.lo all: $(LIBRARY) include $(top_srcdir)/makes/lib.mk gfarm-2.4.1/lib/gfs_hook/sysdep/solaris/amd64/0000755000000000000000000000000011507222730017552 5ustar rootrootgfarm-2.4.1/lib/gfs_hook/sysdep/solaris/amd64/SYS.h0000644000000000000000000001312711507222722020406 0ustar rootroot/* * CDDL HEADER START * * The contents of this file are subject to the terms of the * Common Development and Distribution License, Version 1.0 only * (the "License"). You may not use this file except in compliance * with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. * See the License for the specific language governing permissions * and limitations under the License. * * When distributing Covered Code, include this CDDL HEADER in each * file and include the License file at usr/src/OPENSOLARIS.LICENSE. * If applicable, add the following below this CDDL HEADER, with the * fields enclosed by brackets "[]" replaced with your own identifying * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END */ /* * Copyright 2004 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ #ifndef _LIBC_AMD64_INC_SYS_H #define _LIBC_AMD64_INC_SYS_H #pragma ident "@(#)SYS.h 1.2 05/06/08 SMI" /* * This file defines common code sequences for system calls. */ #include #include #include #if 0 #include "synonyms.h" #endif #undef syscall /* override synonyms.h */ /* * XX64 -- the SOS9 assembler doesn't recognize the 'syscall' instruction yet. * We compensate by defining the byte sequence here. */ #define syscall .byte 0xf, 0x5 #define _fref_(name) name@PLT #define _daref_(name) name@GOTPCREL(%rip) #define _sref_(name) name(%rip) /* * Define the external symbol __cerror for all files. */ .globl __cerror /* * __SYSCALL provides the basic trap sequence. It assumes that * an entry of the form SYS_name exists (from sys/syscall.h). * Note that %rcx is smashed by the syscall instruction, * so we move it to %r10 in order to pass it to the kernel. */ #define __SYSCALL(name) \ movq %rcx, %r10; \ /* CSTYLED */ \ movl $CONCAT(SYS_,name), %eax; \ syscall #define SYSTRAP_RVAL1(name) __SYSCALL(name) #define SYSTRAP_RVAL2(name) __SYSCALL(name) #define SYSTRAP_2RVALS(name) __SYSCALL(name) #define SYSTRAP_64RVAL(name) __SYSCALL(name) /* * SYSFASTTRAP provides the fast system call trap sequence. It assumes * that an entry of the form T_name exists (probably from sys/trap.h). */ #define SYSFASTTRAP(name) \ /* CSTYLED */ \ movl $T_/**/name, %eax; \ int $T_FASTTRAP /* * SYSCERROR provides the sequence to branch to __cerror if an error is * indicated by the carry-bit being set upon return from a trap. */ #define SYSCERROR \ jb __cerror /* * SYSLWPERR provides the sequence to return 0 on a successful trap * and the error code if unsuccessful. * Error is indicated by the carry-bit being set upon return from a trap. */ #define SYSLWPERR \ jae 1f; \ cmpl $ERESTART, %eax; \ jne 2f; \ movl $EINTR, %eax; \ jmp 2f; \ 1: \ xorq %rax, %rax; \ 2: /* * SYSREENTRY provides the entry sequence for restartable system calls. */ #define SYSREENTRY(name) \ ENTRY(name); \ 1: /* * SYSRESTART provides the error handling sequence for restartable * system calls. * XX64 -- Are all of the argument registers restored to their * original values on an ERESTART return (including %rcx)? */ #define SYSRESTART(name) \ jae 1f; \ cmpl $ERESTART, %eax; \ je 1b; \ jmp __cerror; \ 1: /* * SYSINTR_RESTART provides the error handling sequence for restartable * system calls in case of EINTR or ERESTART. */ #define SYSINTR_RESTART(name) \ jae 1f; \ cmpl $ERESTART, %eax; \ je 1b; \ cmpl $EINTR, %eax; \ je 1b; \ jmp 2f; \ 1: \ xorq %rax, %rax; \ 2: /* * SYSCALL provides the standard (i.e.: most common) system call sequence. */ #define SYSCALL(name) \ ENTRY(name); \ SYSTRAP_2RVALS(name); \ SYSCERROR #define SYSCALL_RVAL1(name) \ ENTRY(name); \ SYSTRAP_RVAL1(name); \ SYSCERROR /* * SYSCALL64 provides the standard (i.e.: most common) system call sequence * for system calls that return 64-bit values. */ #define SYSCALL64(name) \ SYSCALL(name) \ /* * SYSCALL_RESTART provides the most common restartable system call sequence. */ #define SYSCALL_RESTART(name) \ SYSREENTRY(name); \ SYSTRAP_2RVALS(name); \ SYSRESTART() #define SYSCALL_RESTART_RVAL1(name) \ SYSREENTRY(name); \ SYSTRAP_RVAL1(name); \ SYSRESTART() /* * SYSCALL2 provides a common system call sequence when the entry name * is different than the trap name. */ #define SYSCALL2(entryname, trapname) \ ENTRY(entryname); \ SYSTRAP_2RVALS(trapname); \ SYSCERROR #define SYSCALL2_RVAL1(entryname, trapname) \ ENTRY(entryname); \ SYSTRAP_RVAL1(trapname); \ SYSCERROR /* * SYSCALL2_RESTART provides a common restartable system call sequence when the * entry name is different than the trap name. */ #define SYSCALL2_RESTART(entryname, trapname) \ SYSREENTRY(entryname); \ SYSTRAP_2RVALS(trapname); \ SYSRESTART() #define SYSCALL2_RESTART_RVAL1(entryname, trapname) \ SYSREENTRY(entryname); \ SYSTRAP_RVAL1(trapname); \ SYSRESTART() /* * SYSCALL_NOERROR provides the most common system call sequence for those * system calls which don't check the error reture (carry bit). */ #define SYSCALL_NOERROR(name) \ ENTRY(name); \ SYSTRAP_2RVALS(name) #define SYSCALL_NOERROR_RVAL1(name) \ ENTRY(name); \ SYSTRAP_RVAL1(name) /* * Standard syscall return sequence, return code equal to rval1. */ #define RET \ ret /* * Syscall return sequence, return code equal to rval2. */ #define RET2 \ movq %rdx, %rax; \ ret /* * Syscall return sequence with return code forced to zero. */ #define RETC \ xorq %rax, %rax; \ ret #endif /* _LIBC_AMD64_INC_SYS_H */ gfarm-2.4.1/lib/gfs_hook/sysdep/solaris/sparcv9/0000755000000000000000000000000011507222730020226 5ustar rootrootgfarm-2.4.1/lib/gfs_hook/sysdep/solaris/sparcv9/SYS.h0000644000000000000000000001423711507222722021065 0ustar rootroot/* * CDDL HEADER START * * The contents of this file are subject to the terms of the * Common Development and Distribution License, Version 1.0 only * (the "License"). You may not use this file except in compliance * with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. * See the License for the specific language governing permissions * and limitations under the License. * * When distributing Covered Code, include this CDDL HEADER in each * file and include the License file at usr/src/OPENSOLARIS.LICENSE. * If applicable, add the following below this CDDL HEADER, with the * fields enclosed by brackets "[]" replaced with your own identifying * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END */ /* * Copyright 2004 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ #ifndef _LIBC_SPARCV9_INC_SYS_H #define _LIBC_SPARCV9_INC_SYS_H #pragma ident "@(#)SYS.h 1.14 05/06/08 SMI" /* * This file defines common code sequences for system calls. Note that * it is assumed that __cerror is within the short branch distance from * all the traps (so that a simple bcs can follow the trap, rather than * a position independent code sequence.) */ #include #include #include #if 0 #include "synonyms.h" #endif /* * While it's tempting to imagine we could use 'rd %pc' here, * in fact it's a rather slow operation that consumes many * cycles, so we use the usual side-effect of 'call' instead. */ #define PIC_SETUP(r) \ mov %o7, %g1; \ 9: call 8f; \ sethi %hi(_GLOBAL_OFFSET_TABLE_ - (9b - .)), %r; \ 8: or %r, %lo(_GLOBAL_OFFSET_TABLE_ - (9b - .)), %r; \ add %r, %o7, %r; \ mov %g1, %o7 /* * Trap number for system calls */ #define SYSCALL_TRAPNUM 64 /* * Define the external symbol __cerror for all files. */ .global __cerror /* * __SYSTRAP provides the basic trap sequence. It assumes that an entry * of the form SYS_name exists (probably from sys/syscall.h). */ #define __SYSTRAP(name) \ /* CSTYLED */ \ mov CONCAT(SYS_,name), %g1; \ ta SYSCALL_TRAPNUM #define SYSTRAP_RVAL1(name) __SYSTRAP(name) #define SYSTRAP_RVAL2(name) __SYSTRAP(name) #define SYSTRAP_2RVALS(name) __SYSTRAP(name) #define SYSTRAP_64RVAL(name) __SYSTRAP(name) /* * SYSFASTTRAP provides the fast system call trap sequence. It assumes * that an entry of the form ST_name exists (probably from sys/trap.h). */ #define SYSFASTTRAP(name) \ /* CSTYLED */ \ ta ST_/**/name /* * SYSCERROR provides the sequence to branch to __cerror if an error is * indicated by the carry-bit being set upon return from a trap. */ #define SYSCERROR \ /* CSTYLED */ \ bcs __cerror; \ nop /* * SYSLWPERR provides the sequence to return 0 on a successful trap * and the error code if unsuccessful. * Error is indicated by the carry-bit being set upon return from a trap. */ #define SYSLWPERR \ /* CSTYLED */ \ bcc,a,pt %icc, 1f; \ clr %o0; \ cmp %o0, ERESTART; \ move %icc, EINTR, %o0; \ 1: #define SAVE_OFFSET (STACK_BIAS + 8 * 16) /* * SYSREENTRY provides the entry sequence for restartable system calls. */ #define SYSREENTRY(name) \ ENTRY(name); \ stn %o0, [%sp + SAVE_OFFSET]; \ /* CSTYLED */ \ .restart_/**/name: /* * SYSRESTART provides the error handling sequence for restartable * system calls. */ #define SYSRESTART(name) \ /* CSTYLED */ \ bcc,pt %icc, 1f; \ cmp %o0, ERESTART; \ /* CSTYLED */ \ be,a,pn %icc, name; \ ldn [%sp + SAVE_OFFSET], %o0; \ /* CSTYLED */ \ ba,a __cerror; \ 1: /* * SYSINTR_RESTART provides the error handling sequence for restartable * system calls in case of EINTR or ERESTART. */ #define SYSINTR_RESTART(name) \ /* CSTYLED */ \ bcc,a,pt %icc, 1f; \ clr %o0; \ cmp %o0, ERESTART; \ /* CSTYLED */ \ be,a,pn %icc, name; \ ldn [%sp + SAVE_OFFSET], %o0; \ cmp %o0, EINTR; \ /* CSTYLED */ \ be,a,pn %icc, name; \ ldn [%sp + SAVE_OFFSET], %o0; \ 1: /* * SYSCALL provides the standard (i.e.: most common) system call sequence. */ #define SYSCALL(name) \ ENTRY(name); \ SYSTRAP_2RVALS(name); \ SYSCERROR #define SYSCALL_RVAL1(name) \ ENTRY(name); \ SYSTRAP_RVAL1(name); \ SYSCERROR /* * SYSCALL_RESTART provides the most common restartable system call sequence. */ #define SYSCALL_RESTART(name) \ SYSREENTRY(name); \ SYSTRAP_2RVALS(name); \ /* CSTYLED */ \ SYSRESTART(.restart_/**/name) #define SYSCALL_RESTART_RVAL1(name) \ SYSREENTRY(name); \ SYSTRAP_RVAL1(name); \ /* CSTYLED */ \ SYSRESTART(.restart_/**/name) /* * SYSCALL2 provides a common system call sequence when the entry name * is different than the trap name. */ #define SYSCALL2(entryname, trapname) \ ENTRY(entryname); \ SYSTRAP_2RVALS(trapname); \ SYSCERROR #define SYSCALL2_RVAL1(entryname, trapname) \ ENTRY(entryname); \ SYSTRAP_RVAL1(trapname); \ SYSCERROR /* * SYSCALL2_RESTART provides a common restartable system call sequence when the * entry name is different than the trap name. */ #define SYSCALL2_RESTART(entryname, trapname) \ SYSREENTRY(entryname); \ SYSTRAP_2RVALS(trapname); \ /* CSTYLED */ \ SYSRESTART(.restart_/**/entryname) #define SYSCALL2_RESTART_RVAL1(entryname, trapname) \ SYSREENTRY(entryname); \ SYSTRAP_RVAL1(trapname); \ /* CSTYLED */ \ SYSRESTART(.restart_/**/entryname) /* * SYSCALL_NOERROR provides the most common system call sequence for those * system calls which don't check the error return (carry bit). */ #define SYSCALL_NOERROR(name) \ ENTRY(name); \ SYSTRAP_2RVALS(name) #define SYSCALL_NOERROR_RVAL1(name) \ ENTRY(name); \ SYSTRAP_RVAL1(name) /* * Standard syscall return sequence, return code equal to rval1. */ #define RET \ retl; \ nop /* * Syscall return sequence, return code equal to rval2. */ #define RET2 \ retl; \ mov %o1, %o0 /* * Syscall return sequence with return code forced to zero. */ #define RETC \ retl; \ clr %o0 #endif /* _LIBC_SPARCV9_INC_SYS_H */ gfarm-2.4.1/lib/gfs_hook/sysdep/solaris/OPENSOLARIS.LICENSE0000644000000000000000000004477711507222722021465 0ustar rootrootUnless otherwise noted, all files in this distribution are released under the Common Development and Distribution License (CDDL), Version 1.0 only. Exceptions are noted within the associated source files. -------------------------------------------------------------------- COMMON DEVELOPMENT AND DISTRIBUTION LICENSE Version 1.0 1. Definitions. 1.1. "Contributor" means each individual or entity that creates or contributes to the creation of Modifications. 1.2. "Contributor Version" means the combination of the Original Software, prior Modifications used by a Contributor (if any), and the Modifications made by that particular Contributor. 1.3. "Covered Software" means (a) the Original Software, or (b) Modifications, or (c) the combination of files containing Original Software with files containing Modifications, in each case including portions thereof. 1.4. "Executable" means the Covered Software in any form other than Source Code. 1.5. "Initial Developer" means the individual or entity that first makes Original Software available under this License. 1.6. "Larger Work" means a work which combines Covered Software or portions thereof with code not governed by the terms of this License. 1.7. "License" means this document. 1.8. "Licensable" means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently acquired, any and all of the rights conveyed herein. 1.9. "Modifications" means the Source Code and Executable form of any of the following: A. Any file that results from an addition to, deletion from or modification of the contents of a file containing Original Software or previous Modifications; B. Any new file that contains any part of the Original Software or previous Modifications; or C. Any new file that is contributed or otherwise made available under the terms of this License. 1.10. "Original Software" means the Source Code and Executable form of computer software code that is originally released under this License. 1.11. "Patent Claims" means any patent claim(s), now owned or hereafter acquired, including without limitation, method, process, and apparatus claims, in any patent Licensable by grantor. 1.12. "Source Code" means (a) the common form of computer software code in which modifications are made and (b) associated documentation included in or with such code. 1.13. "You" (or "Your") means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, "You" includes any entity which controls, is controlled by, or is under common control with You. For purposes of this definition, "control" means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity. 2. License Grants. 2.1. The Initial Developer Grant. Conditioned upon Your compliance with Section 3.1 below and subject to third party intellectual property claims, the Initial Developer hereby grants You a world-wide, royalty-free, non-exclusive license: (a) under intellectual property rights (other than patent or trademark) Licensable by Initial Developer, to use, reproduce, modify, display, perform, sublicense and distribute the Original Software (or portions thereof), with or without Modifications, and/or as part of a Larger Work; and (b) under Patent Claims infringed by the making, using or selling of Original Software, to make, have made, use, practice, sell, and offer for sale, and/or otherwise dispose of the Original Software (or portions thereof). (c) The licenses granted in Sections 2.1(a) and (b) are effective on the date Initial Developer first distributes or otherwise makes the Original Software available to a third party under the terms of this License. (d) Notwithstanding Section 2.1(b) above, no patent license is granted: (1) for code that You delete from the Original Software, or (2) for infringements caused by: (i) the modification of the Original Software, or (ii) the combination of the Original Software with other software or devices. 2.2. Contributor Grant. Conditioned upon Your compliance with Section 3.1 below and subject to third party intellectual property claims, each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license: (a) under intellectual property rights (other than patent or trademark) Licensable by Contributor to use, reproduce, modify, display, perform, sublicense and distribute the Modifications created by such Contributor (or portions thereof), either on an unmodified basis, with other Modifications, as Covered Software and/or as part of a Larger Work; and (b) under Patent Claims infringed by the making, using, or selling of Modifications made by that Contributor either alone and/or in combination with its Contributor Version (or portions of such combination), to make, use, sell, offer for sale, have made, and/or otherwise dispose of: (1) Modifications made by that Contributor (or portions thereof); and (2) the combination of Modifications made by that Contributor with its Contributor Version (or portions of such combination). (c) The licenses granted in Sections 2.2(a) and 2.2(b) are effective on the date Contributor first distributes or otherwise makes the Modifications available to a third party. (d) Notwithstanding Section 2.2(b) above, no patent license is granted: (1) for any code that Contributor has deleted from the Contributor Version; (2) for infringements caused by: (i) third party modifications of Contributor Version, or (ii) the combination of Modifications made by that Contributor with other software (except as part of the Contributor Version) or other devices; or (3) under Patent Claims infringed by Covered Software in the absence of Modifications made by that Contributor. 3. Distribution Obligations. 3.1. Availability of Source Code. Any Covered Software that You distribute or otherwise make available in Executable form must also be made available in Source Code form and that Source Code form must be distributed only under the terms of this License. You must include a copy of this License with every copy of the Source Code form of the Covered Software You distribute or otherwise make available. You must inform recipients of any such Covered Software in Executable form as to how they can obtain such Covered Software in Source Code form in a reasonable manner on or through a medium customarily used for software exchange. 3.2. Modifications. The Modifications that You create or to which You contribute are governed by the terms of this License. You represent that You believe Your Modifications are Your original creation(s) and/or You have sufficient rights to grant the rights conveyed by this License. 3.3. Required Notices. You must include a notice in each of Your Modifications that identifies You as the Contributor of the Modification. You may not remove or alter any copyright, patent or trademark notices contained within the Covered Software, or any notices of licensing or any descriptive text giving attribution to any Contributor or the Initial Developer. 3.4. Application of Additional Terms. You may not offer or impose any terms on any Covered Software in Source Code form that alters or restricts the applicable version of this License or the recipients' rights hereunder. You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Software. However, you may do so only on Your own behalf, and not on behalf of the Initial Developer or any Contributor. You must make it absolutely clear that any such warranty, support, indemnity or liability obligation is offered by You alone, and You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of warranty, support, indemnity or liability terms You offer. 3.5. Distribution of Executable Versions. You may distribute the Executable form of the Covered Software under the terms of this License or under the terms of a license of Your choice, which may contain terms different from this License, provided that You are in compliance with the terms of this License and that the license for the Executable form does not attempt to limit or alter the recipient's rights in the Source Code form from the rights set forth in this License. If You distribute the Covered Software in Executable form under a different license, You must make it absolutely clear that any terms which differ from this License are offered by You alone, not by the Initial Developer or Contributor. You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of any such terms You offer. 3.6. Larger Works. You may create a Larger Work by combining Covered Software with other code not governed by the terms of this License and distribute the Larger Work as a single product. In such a case, You must make sure the requirements of this License are fulfilled for the Covered Software. 4. Versions of the License. 4.1. New Versions. Sun Microsystems, Inc. is the initial license steward and may publish revised and/or new versions of this License from time to time. Each version will be given a distinguishing version number. Except as provided in Section 4.3, no one other than the license steward has the right to modify this License. 4.2. Effect of New Versions. You may always continue to use, distribute or otherwise make the Covered Software available under the terms of the version of the License under which You originally received the Covered Software. If the Initial Developer includes a notice in the Original Software prohibiting it from being distributed or otherwise made available under any subsequent version of the License, You must distribute and make the Covered Software available under the terms of the version of the License under which You originally received the Covered Software. Otherwise, You may also choose to use, distribute or otherwise make the Covered Software available under the terms of any subsequent version of the License published by the license steward. 4.3. Modified Versions. When You are an Initial Developer and You want to create a new license for Your Original Software, You may create and use a modified version of this License if You: (a) rename the license and remove any references to the name of the license steward (except to note that the license differs from this License); and (b) otherwise make it clear that the license contains terms which differ from this License. 5. DISCLAIMER OF WARRANTY. COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED SOFTWARE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED SOFTWARE IS WITH YOU. SHOULD ANY COVERED SOFTWARE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER. 6. TERMINATION. 6.1. This License and the rights granted hereunder will terminate automatically if You fail to comply with terms herein and fail to cure such breach within 30 days of becoming aware of the breach. Provisions which, by their nature, must remain in effect beyond the termination of this License shall survive. 6.2. If You assert a patent infringement claim (excluding declaratory judgment actions) against Initial Developer or a Contributor (the Initial Developer or Contributor against whom You assert such claim is referred to as "Participant") alleging that the Participant Software (meaning the Contributor Version where the Participant is a Contributor or the Original Software where the Participant is the Initial Developer) directly or indirectly infringes any patent, then any and all rights granted directly or indirectly to You by such Participant, the Initial Developer (if the Initial Developer is not the Participant) and all Contributors under Sections 2.1 and/or 2.2 of this License shall, upon 60 days notice from Participant terminate prospectively and automatically at the expiration of such 60 day notice period, unless if within such 60 day period You withdraw Your claim with respect to the Participant Software against such Participant either unilaterally or pursuant to a written agreement with Participant. 6.3. In the event of termination under Sections 6.1 or 6.2 above, all end user licenses that have been validly granted by You or any distributor hereunder prior to termination (excluding licenses granted to You by any distributor) shall survive termination. 7. LIMITATION OF LIABILITY. UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOST PROFITS, LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU. 8. U.S. GOVERNMENT END USERS. The Covered Software is a "commercial item," as that term is defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer software" (as that term is defined at 48 C.F.R. 252.227-7014(a)(1)) and "commercial computer software documentation" as such terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users acquire Covered Software with only those rights set forth herein. This U.S. Government Rights clause is in lieu of, and supersedes, any other FAR, DFAR, or other clause or provision that addresses Government rights in computer software under this License. 9. MISCELLANEOUS. This License represents the complete agreement concerning subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. This License shall be governed by the law of the jurisdiction specified in a notice contained within the Original Software (except to the extent applicable law, if any, provides otherwise), excluding such jurisdiction's conflict-of-law provisions. Any litigation relating to this License shall be subject to the jurisdiction of the courts located in the jurisdiction and venue specified in a notice contained within the Original Software, with the losing party responsible for costs, including, without limitation, court costs and reasonable attorneys' fees and expenses. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not apply to this License. You agree that You alone are responsible for compliance with the United States export administration regulations (and the export control laws and regulation of any other countries) when You use, distribute or otherwise make available any Covered Software. 10. RESPONSIBILITY FOR CLAIMS. As between Initial Developer and the Contributors, each party is responsible for claims and damages arising, directly or indirectly, out of its utilization of rights under this License and You agree to work with Initial Developer and Contributors to distribute such responsibility on an equitable basis. Nothing herein is intended or shall be deemed to constitute any admission of liability. -------------------------------------------------------------------- NOTICE PURSUANT TO SECTION 9 OF THE COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) For Covered Software in this distribution, this License shall be governed by the laws of the State of California (excluding conflict-of-law provisions). Any litigation relating to this License shall be subject to the jurisdiction of the Federal Courts of the Northern District of California and the state courts of the State of California, with venue lying in Santa Clara County, California. gfarm-2.4.1/lib/gfs_hook/sysdep/default/0000755000000000000000000000000011507222730016607 5ustar rootrootgfarm-2.4.1/lib/gfs_hook/sysdep/default/dummy.c0000644000000000000000000000000011507222722020075 0ustar rootrootgfarm-2.4.1/lib/gfs_hook/sysdep/default/Makefile0000644000000000000000000000036611507222722020255 0ustar rootroottop_builddir = ../../../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk LIBRARY = libsysdep.la LIBRARY_RESULT = # do not install SRCS = dummy.c OBJS = dummy.lo all: $(LIBRARY) include $(top_srcdir)/makes/lib.mk gfarm-2.4.1/lib/gfs_hook/sysdep/linux/0000755000000000000000000000000011507222730016322 5ustar rootrootgfarm-2.4.1/lib/gfs_hook/sysdep/linux/xstat64.c0000644000000000000000000000422511507222722020007 0ustar rootroot/* xstat64 using old-style Unix stat system call. Copyright (C) 1991,95,96,97,98,99,2000,2001 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #ifndef __USE_LARGEFILE64 #define __USE_LARGEFILE64 #endif #include #include #include "kernel_stat.h" #include #include "hooks_subr.h" #if defined(__i386__) #define NEEDS_XSTAT64_CONV #endif #ifdef NEEDS_XSTAT64_CONV #include "xstatconv.c" #endif /* Get information about the file NAME in BUF. */ int gfs_hook_syscall_xstat64 (int vers, const char *name, struct stat64 *buf) { #ifdef NEEDS_XSTAT64_CONV int result; # if defined SYS_stat64 static int no_stat64 = 0; if (! no_stat64) { int saved_errno = errno; result = syscall (SYS_stat64, name, buf); if (result != -1 || errno != ENOSYS) { # if defined _HAVE_STAT64___ST_INO && __ASSUME_ST_INO_64_BIT == 0 if (result != -1 && buf->__st_ino != (__ino_t) buf->st_ino) buf->st_ino = buf->__st_ino; # endif return result; } errno = saved_errno; no_stat64 = 1; } # endif { struct kernel_stat kbuf; result = syscall (SYS_stat, name, &kbuf); if (result == 0) result = xstat64_conv (vers, &kbuf, buf); } return result; #else /* NEEDS_XSTAT64_CONV */ return syscall (SYS_stat, name, buf); #endif } gfarm-2.4.1/lib/gfs_hook/sysdep/linux/fxstat.c0000644000000000000000000000333411507222722020003 0ustar rootroot/* xstat using old-style Unix stat system call. Copyright (C) 1991,95,96,97,98,2000 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include "kernel_stat.h" #include #include "hooks_subr.h" #if defined(__i386__) #define NEEDS_XSTAT_CONV #endif #ifdef NEEDS_XSTAT_CONV #include "xstatconv.c" #endif /* Get information about the file FD in BUF. */ int gfs_hook_syscall_fxstat (int vers, int fd, struct stat *buf) { #ifdef NEEDS_XSTAT_CONV struct kernel_stat kbuf; int result; if (vers == _STAT_VER_KERNEL) return syscall (SYS_fstat, fd, (struct kernel_stat *) buf); result = syscall (SYS_fstat, fd, &kbuf); if (result == 0) result = xstat_conv (vers, &kbuf, buf); return result; #else /* NEEDS_XSTAT_CONV */ return syscall (SYS_fstat, fd, buf); #endif } gfarm-2.4.1/lib/gfs_hook/sysdep/linux/sysdep.h0000644000000000000000000000231111507222722020000 0ustar rootroot/* Copyright (C) 1993, 1995-2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #define __alloca(size) __builtin_alloca (size) #define __set_errno(val) (errno = (val)) /* * Because we are not providing system call hooks, but just providing * gfs_hook_syscall_*() functions here, we don't have to use special * calling convention here. */ #define internal_function /* empty */ /* We don't use INLINE_SYSCALL, so it's not defined here. */ gfarm-2.4.1/lib/gfs_hook/sysdep/linux/lxstat64.c0000644000000000000000000000423211507222722020161 0ustar rootroot/* xstat64 using old-style Unix stat system call. Copyright (C) 1991,95,96,97,98,99,2000,2001 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #ifndef __USE_LARGEFILE64 #define __USE_LARGEFILE64 #endif #include #include #include "kernel_stat.h" #include #include "hooks_subr.h" #if defined(__i386__) #define NEEDS_XSTAT64_CONV #endif #ifdef NEEDS_XSTAT64_CONV #include "xstatconv.c" #endif /* Get information about the file NAME in BUF. */ int gfs_hook_syscall_lxstat64 (int vers, const char *name, struct stat64 *buf) { #ifdef NEEDS_XSTAT64_CONV int result; # if defined SYS_stat64 static int no_stat64 = 0; if (! no_stat64) { int saved_errno = errno; result = syscall (SYS_lstat64, name, buf); if (result != -1 || errno != ENOSYS) { # if defined _HAVE_LSTAT64___ST_INO && __ASSUME_ST_INO_64_BIT == 0 if (result != -1 && buf->__st_ino != (__ino_t) buf->st_ino) buf->st_ino = buf->__st_ino; # endif return result; } errno = saved_errno; no_stat64 = 1; } # endif { struct kernel_stat kbuf; result = syscall (SYS_lstat, name, &kbuf); if (result == 0) result = xstat64_conv (vers, &kbuf, buf); } return result; #else /* NEEDS_XSTAT64_CONV */ return syscall (SYS_lstat, name, buf); #endif } gfarm-2.4.1/lib/gfs_hook/sysdep/linux/fxstat64.c0000644000000000000000000000420711507222722020155 0ustar rootroot/* xstat64 using old-style Unix stat system call. Copyright (C) 1991,95,96,97,98,99,2000,2001 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #ifndef __USE_LARGEFILE64 #define __USE_LARGEFILE64 #endif #include #include #include "kernel_stat.h" #include #include "hooks_subr.h" #if defined(__i386__) #define NEEDS_XSTAT64_CONV #endif #ifdef NEEDS_XSTAT64_CONV #include "xstatconv.c" #endif /* Get information about the file FD in BUF. */ int gfs_hook_syscall_fxstat64 (int vers, int fd, struct stat64 *buf) { #ifdef NEEDS_XSTAT64_CONV int result; # if defined SYS_stat64 static int no_stat64 = 0; if (! no_stat64) { int saved_errno = errno; result = syscall (SYS_fstat64, fd, buf); if (result != -1 || errno != ENOSYS) { # if defined _HAVE_STAT64___ST_INO && __ASSUME_ST_INO_64_BIT == 0 if (result != -1 && buf->__st_ino != (__ino_t) buf->st_ino) buf->st_ino = buf->__st_ino; # endif return result; } errno = saved_errno; no_stat64 = 1; } # endif { struct kernel_stat kbuf; result = syscall (SYS_fstat, fd, &kbuf); if (result == 0) result = xstat64_conv (vers, &kbuf, buf); } return result; #else /* NEEDS_XSTAT64_CONV */ return syscall (SYS_fstat, fd, buf); #endif } gfarm-2.4.1/lib/gfs_hook/sysdep/linux/bp-checks.h0000644000000000000000000001152011507222722020332 0ustar rootroot/* Bounded-pointer checking macros for C. Copyright (C) 2000 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Greg McGary The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #ifndef _bp_checks_h_ #define _bp_checks_h_ 1 #if __BOUNDED_POINTERS__ # define BOUNDS_VIOLATED (__builtin_trap (), 0) /* Verify that pointer's value >= low. Return pointer value. */ # define CHECK_BOUNDS_LOW(ARG) \ (((__ptrvalue (ARG) < __ptrlow (ARG)) && BOUNDS_VIOLATED), \ __ptrvalue (ARG)) /* Verify that pointer's value < high. Return pointer value. */ # define CHECK_BOUNDS_HIGH(ARG) \ (((__ptrvalue (ARG) > __ptrhigh (ARG)) && BOUNDS_VIOLATED), \ __ptrvalue (ARG)) # define _CHECK_N(ARG, N, COND) \ (((COND) \ && (__ptrvalue (ARG) < __ptrlow (ARG) \ || __ptrvalue (ARG) + (N) > __ptrhigh (ARG)) \ && BOUNDS_VIOLATED), \ __ptrvalue (ARG)) extern void *__unbounded __ubp_memchr (const void *__unbounded, int, unsigned); # define _CHECK_STRING(ARG, COND) \ (((COND) \ && (__ptrvalue (ARG) < __ptrlow (ARG) \ || !__ubp_memchr (__ptrvalue (ARG), '\0', \ (__ptrhigh (ARG) - __ptrvalue (ARG)))) \ && BOUNDS_VIOLATED), \ __ptrvalue (ARG)) /* Check bounds of a pointer seated to an array of N objects. */ # define CHECK_N(ARG, N) _CHECK_N ((ARG), (N), 1) /* Same as CHECK_N, but tolerate ARG == NULL. */ # define CHECK_N_NULL_OK(ARG, N) _CHECK_N ((ARG), (N), __ptrvalue (ARG)) /* Check bounds of a pointer seated to a single object. */ # define CHECK_1(ARG) CHECK_N ((ARG), 1) /* Same as CHECK_1, but tolerate ARG == NULL. */ # define CHECK_1_NULL_OK(ARG) CHECK_N_NULL_OK ((ARG), 1) /* Check for NUL-terminator within string's bounds. */ # define CHECK_STRING(ARG) _CHECK_STRING ((ARG), 1) /* Same as CHECK_STRING, but tolerate ARG == NULL. */ # define CHECK_STRING_NULL_OK(ARG) _CHECK_STRING ((ARG), __ptrvalue (ARG)) /* Check bounds of signal syscall args with type sigset_t. */ # define CHECK_SIGSET(SET) CHECK_N ((SET), _NSIG / (8 * sizeof *(SET))) /* Same as CHECK_SIGSET, but tolerate SET == NULL. */ # define CHECK_SIGSET_NULL_OK(SET) CHECK_N_NULL_OK ((SET), _NSIG / (8 * sizeof *(SET))) # if defined (_IOC_SIZESHIFT) && defined (_IOC_SIZEBITS) /* Extract the size of the ioctl data and check its bounds. */ # define CHECK_IOCTL(ARG, CMD) \ CHECK_N ((const char *) (ARG), \ (((CMD) >> _IOC_SIZESHIFT) & ((1 << _IOC_SIZEBITS) - 1))) # else /* We don't know the size of the ioctl data, so the best we can do is check that the first byte is within bounds. */ # define CHECK_IOCTL(ARG, CMD) CHECK_1 ((const char *) ARG) # endif /* Check bounds of `struct flock *' for the locking fcntl commands. */ # define CHECK_FCNTL(ARG, CMD) \ (((CMD) == F_GETLK || (CMD) == F_SETLK || (CMD) == F_SETLKW) \ ? CHECK_1 ((struct flock *) ARG) : (unsigned long) (ARG)) /* Check bounds of an array of mincore residency-status flags that cover a region of NBYTES. Such a vector occupies one byte per page of memory. */ # define CHECK_N_PAGES(ARG, NBYTES) \ ({ int _page_size_ = sysconf (_SC_PAGE_SIZE); \ CHECK_N ((const char *) (ARG), \ ((NBYTES) + _page_size_ - 1) / _page_size_); }) /* Return a bounded pointer with value PTR that satisfies CHECK_N (PTR, N). */ # define BOUNDED_N(PTR, N) \ ({ __typeof (PTR) __bounded _p_; \ __ptrvalue _p_ = __ptrlow _p_ = __ptrvalue (PTR); \ __ptrhigh _p_ = __ptrvalue _p_ + (N); \ _p_; }) #else /* !__BOUNDED_POINTERS__ */ /* Do nothing if not compiling with -fbounded-pointers. */ # define BOUNDS_VIOLATED # define CHECK_BOUNDS_LOW(ARG) (ARG) # define CHECK_BOUNDS_HIGH(ARG) (ARG) # define CHECK_1(ARG) (ARG) # define CHECK_1_NULL_OK(ARG) (ARG) # define CHECK_N(ARG, N) (ARG) # define CHECK_N_NULL_OK(ARG, N) (ARG) # define CHECK_STRING(ARG) (ARG) # define CHECK_SIGSET(SET) (SET) # define CHECK_SIGSET_NULL_OK(SET) (SET) # define CHECK_IOCTL(ARG, CMD) (ARG) # define CHECK_FCNTL(ARG, CMD) (ARG) # define CHECK_N_PAGES(ARG, NBYTES) (ARG) # define BOUNDED_N(PTR, N) (PTR) #endif /* !__BOUNDED_POINTERS__ */ #define BOUNDED_1(PTR) BOUNDED_N (PTR, 1) #endif /* _bp_checks_h_ */ gfarm-2.4.1/lib/gfs_hook/sysdep/linux/xstatconv.c0000644000000000000000000001531311507222722020523 0ustar rootroot/* Convert between the kernel's `struct stat' format, and libc's. Copyright (C) 1991, 1995, 1996, 1997, 2000 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #ifndef __set_errno #define __set_errno(X) (errno = (X)) #endif #ifdef NEEDS_XSTAT_CONV static inline int xstat_conv (int vers, struct kernel_stat *kbuf, void *ubuf) { switch (vers) { case _STAT_VER_KERNEL: /* Nothing to do. The struct is in the form the kernel expects. We should have short-circuted before we got here, but for completeness... */ *(struct kernel_stat *) ubuf = *kbuf; break; case _STAT_VER_LINUX: { struct stat *buf = ubuf; /* Convert to current kernel version of `struct stat'. */ buf->st_dev = kbuf->st_dev; #ifdef _HAVE_STAT___PAD1 buf->__pad1 = 0; #endif buf->st_ino = kbuf->st_ino; buf->st_mode = kbuf->st_mode; buf->st_nlink = kbuf->st_nlink; buf->st_uid = kbuf->st_uid; buf->st_gid = kbuf->st_gid; buf->st_rdev = kbuf->st_rdev; #ifdef _HAVE_STAT___PAD2 buf->__pad2 = 0; #endif buf->st_size = kbuf->st_size; buf->st_blksize = kbuf->st_blksize; buf->st_blocks = kbuf->st_blocks; #ifdef st_atime buf->st_atim.tv_sec = kbuf->kernel_st_atime; buf->st_atim.tv_nsec = kbuf->__unused1; #else buf->st_atime = kbuf->kernel_st_atime; #ifdef _HAVE_STAT___UNUSED1 buf->__unused1 = 0; #endif #endif /* st_atime */ #ifdef st_mtime buf->st_mtim.tv_sec = kbuf->kernel_st_mtime; buf->st_mtim.tv_nsec = kbuf->__unused2; #else buf->st_mtime = kbuf->kernel_st_mtime; #ifdef _HAVE_STAT___UNUSED2 buf->__unused2 = 0; #endif #endif /* st_mtime */ #ifdef st_ctime buf->st_ctim.tv_sec = kbuf->kernel_st_ctime; buf->st_ctim.tv_nsec = kbuf->__unused3;; #else buf->st_ctime = kbuf->kernel_st_ctime; #ifdef _HAVE_STAT___UNUSED3 buf->__unused3 = 0; #endif #endif /* st_ctime */ #ifdef _HAVE_STAT___UNUSED4 buf->__unused4 = 0; #endif #ifdef _HAVE_STAT___UNUSED5 buf->__unused5 = 0; #endif } break; default: __set_errno (EINVAL); return -1; } return 0; } #endif #ifdef NEEDS_XSTAT64_CONV static inline int xstat64_conv (int vers, struct kernel_stat *kbuf, void *ubuf) { #ifdef XSTAT_IS_XSTAT64 return xstat_conv (vers, kbuf, ubuf); #else switch (vers) { case _STAT_VER_LINUX: { struct stat64 *buf = ubuf; /* Convert to current kernel version of `struct stat64'. */ buf->st_dev = kbuf->st_dev; #ifdef _HAVE_STAT64___PAD1 buf->__pad1 = 0; #endif buf->st_ino = kbuf->st_ino; #ifdef _HAVE_STAT64___ST_INO buf->__st_ino = kbuf->st_ino; #endif buf->st_mode = kbuf->st_mode; buf->st_nlink = kbuf->st_nlink; buf->st_uid = kbuf->st_uid; buf->st_gid = kbuf->st_gid; buf->st_rdev = kbuf->st_rdev; #ifdef _HAVE_STAT64___PAD2 buf->__pad2 = 0; #endif buf->st_size = kbuf->st_size; buf->st_blksize = kbuf->st_blksize; buf->st_blocks = kbuf->st_blocks; #ifdef st_atime buf->st_atim.tv_sec = kbuf->kernel_st_atime; buf->st_atim.tv_nsec = kbuf->__unused1; #else buf->st_atime = kbuf->kernel_st_atime; #ifdef _HAVE_STAT64___UNUSED1 buf->__unused1 = 0; #endif #endif /* st_atime */ #ifdef st_mtime buf->st_mtim.tv_sec = kbuf->kernel_st_mtime; buf->st_mtim.tv_nsec = kbuf->__unused2; #else buf->st_mtime = kbuf->kernel_st_mtime; #ifdef _HAVE_STAT64___UNUSED2 buf->__unused2 = 0; #endif #endif /* st_mtime */ #ifdef st_ctime buf->st_ctim.tv_sec = kbuf->kernel_st_ctime; buf->st_ctim.tv_nsec = kbuf->__unused3; #else buf->st_ctime = kbuf->kernel_st_ctime; #ifdef _HAVE_STAT64___UNUSED3 buf->__unused3 = 0; #endif #endif /* st_ctime */ #ifdef _HAVE_STAT64___UNUSED4 buf->__unused4 = 0; #endif #ifdef _HAVE_STAT64___UNUSED5 buf->__unused5 = 0; #endif } break; /* If struct stat64 is different from struct stat then _STAT_VER_KERNEL does not make sense. */ case _STAT_VER_KERNEL: default: __set_errno (EINVAL); return -1; } return 0; #endif } #endif #ifdef NEEDS_XSTAT32_CONV static inline int xstat32_conv (int vers, struct stat64 *kbuf, struct stat *buf) { switch (vers) { case _STAT_VER_LINUX: { /* Convert current kernel version of `struct stat64' to `struct stat'. */ buf->st_dev = kbuf->st_dev; #ifdef _HAVE_STAT___PAD1 buf->__pad1 = 0; #endif #ifdef _HAVE_STAT64___ST_INO # if __ASSUME_ST_INO_64_BIT == 0 if (kbuf->st_ino == 0) buf->st_ino = kbuf->__st_ino; else # endif { buf->st_ino = kbuf->st_ino; if (sizeof (buf->st_ino) != sizeof (kbuf->st_ino) && buf->st_ino != kbuf->st_ino) { __set_errno (EOVERFLOW); return -1; } } #else buf->st_ino = kbuf->st_ino; if (sizeof (buf->st_ino) != sizeof (kbuf->st_ino) && buf->st_ino != kbuf->st_ino) { __set_errno (EOVERFLOW); return -1; } #endif buf->st_mode = kbuf->st_mode; buf->st_nlink = kbuf->st_nlink; buf->st_uid = kbuf->st_uid; buf->st_gid = kbuf->st_gid; buf->st_rdev = kbuf->st_rdev; #ifdef _HAVE_STAT___PAD2 buf->__pad2 = 0; #endif buf->st_size = kbuf->st_size; /* Check for overflow. */ if (sizeof (buf->st_size) != sizeof (kbuf->st_size) && buf->st_size != kbuf->st_size) { __set_errno (EOVERFLOW); return -1; } buf->st_blksize = kbuf->st_blksize; buf->st_blocks = kbuf->st_blocks; /* Check for overflow. */ if (sizeof (buf->st_blocks) != sizeof (kbuf->st_blocks) && buf->st_blocks != kbuf->st_blocks) { __set_errno (EOVERFLOW); return -1; } buf->st_atime = kbuf->st_atime; #ifdef _HAVE_STAT___UNUSED1 buf->__unused1 = 0; #endif buf->st_mtime = kbuf->st_mtime; #ifdef _HAVE_STAT___UNUSED2 buf->__unused2 = 0; #endif buf->st_ctime = kbuf->st_ctime; #ifdef _HAVE_STAT___UNUSED3 buf->__unused3 = 0; #endif #ifdef _HAVE_STAT___UNUSED4 buf->__unused4 = 0; #endif #ifdef _HAVE_STAT___UNUSED5 buf->__unused5 = 0; #endif } break; /* If struct stat64 is different from struct stat then _STAT_VER_KERNEL does not make sense. */ case _STAT_VER_KERNEL: default: __set_errno (EINVAL); return -1; } return 0; } #endif gfarm-2.4.1/lib/gfs_hook/sysdep/linux/kernel_stat.h0000644000000000000000000000261511507222722021013 0ustar rootroot/* older glibc doesn't have _STAT_VER_KERNEL in /usr/include/bits/stat.h */ #ifndef _STAT_VER_KERNEL #define _STAT_VER_KERNEL 1 #endif /* Definition of `struct stat' used in the kernel.. */ struct kernel_stat { unsigned short int st_dev; unsigned short int __pad1; #define _HAVE___PAD1 unsigned long int st_ino; unsigned short int st_mode; unsigned short int st_nlink; unsigned short int st_uid; unsigned short int st_gid; unsigned short int st_rdev; unsigned short int __pad2; #define _HAVE___PAD2 unsigned long int st_size; unsigned long int st_blksize; unsigned long int st_blocks; unsigned long int kernel_st_atime; unsigned long int __unused1; #define _HAVE___UNUSED1 unsigned long int kernel_st_mtime; unsigned long int __unused2; #define _HAVE___UNUSED2 unsigned long int kernel_st_ctime; unsigned long int __unused3; #define _HAVE___UNUSED3 unsigned long int __unused4; #define _HAVE___UNUSED4 unsigned long int __unused5; #define _HAVE___UNUSED5 }; #define _HAVE_STAT___UNUSED1 #define _HAVE_STAT___UNUSED2 #define _HAVE_STAT___UNUSED3 #define _HAVE_STAT___UNUSED4 #define _HAVE_STAT___UNUSED5 #define _HAVE_STAT___PAD1 #define _HAVE_STAT___PAD2 #define _HAVE_STAT64___UNUSED1 #define _HAVE_STAT64___UNUSED2 #define _HAVE_STAT64___UNUSED3 #define _HAVE_STAT64___PAD1 #define _HAVE_STAT64___PAD2 #define _HAVE_STAT64___ST_INO gfarm-2.4.1/lib/gfs_hook/sysdep/linux/lxstat.c0000644000000000000000000000335611507222722020015 0ustar rootroot/* xstat using old-style Unix stat system call. Copyright (C) 1991,95,96,97,98,2000 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include "kernel_stat.h" #include #include "hooks_subr.h" #if defined(__i386__) #define NEEDS_XSTAT_CONV #endif #ifdef NEEDS_XSTAT_CONV #include "xstatconv.c" #endif /* Get information about the file NAME in BUF. */ int gfs_hook_syscall_lxstat (int vers, const char *name, struct stat *buf) { #ifdef NEEDS_XSTAT_CONV struct kernel_stat kbuf; int result; if (vers == _STAT_VER_KERNEL) return syscall (SYS_lstat, name, (struct kernel_stat *) buf); result = syscall (SYS_lstat, name, &kbuf); if (result == 0) result = xstat_conv (vers, &kbuf, buf); return result; #else /* NEEDS_XSTAT_CONV */ return syscall (SYS_lstat, name, buf); #endif } gfarm-2.4.1/lib/gfs_hook/sysdep/linux/xstat.c0000644000000000000000000000335211507222722017635 0ustar rootroot/* xstat using old-style Unix stat system call. Copyright (C) 1991,95,96,97,98,2000 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include #include #include #include #include #include #include "kernel_stat.h" #include #include "hooks_subr.h" #if defined(__i386__) #define NEEDS_XSTAT_CONV #endif #ifdef NEEDS_XSTAT_CONV #include "xstatconv.c" #endif /* Get information about the file NAME in BUF. */ int gfs_hook_syscall_xstat (int vers, const char *name, struct stat *buf) { #ifdef NEEDS_XSTAT_CONV struct kernel_stat kbuf; int result; if (vers == _STAT_VER_KERNEL) return syscall (SYS_stat, name, (struct kernel_stat *) buf); result = syscall (SYS_stat, name, &kbuf); if (result == 0) result = xstat_conv (vers, &kbuf, buf); return result; #else /* NEEDS_XSTAT_CONV */ return syscall (SYS_stat, name, buf); #endif } gfarm-2.4.1/lib/gfs_hook/sysdep/linux/getdents64.c0000644000000000000000000000177411507222722020467 0ustar rootroot/* Copyright (C) 1993, 1995-2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #define SYSCALL_GETDENTS(filedes, buf, nbyte) \ gfs_hook_syscall_getdents64(filedes, buf, nbyte) #define DIRENT_TYPE struct dirent64 #include "getdents.c" gfarm-2.4.1/lib/gfs_hook/sysdep/linux/Makefile0000644000000000000000000000265211507222722017770 0ustar rootroot# $Id: Makefile 2373 2006-01-12 00:54:22Z soda $ top_builddir = ../../../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk # do not use $(COMMON_CFLAGS) here, to avoid symbol renaming by largefile API. CFLAGS = -I$(srcdir) -I$(top_srcdir)/lib/gfs_hook -Doff64_t=__off64_t \ -I$(top_builddir)/include -I$(top_srcdir)/include $(OPTFLAGS) LIBRARY = libsysdep.la LIBRARY_RESULT = # do not install LARGEFILE64_SRCS = getdents64.c xstat64.c lxstat64.c fxstat64.c LARGEFILE64_OBJS = getdents64.lo xstat64.lo lxstat64.lo fxstat64.lo SRCS = getdents.c xstat.c lxstat.c fxstat.c xstatconv.c \ ${largefile64_srcs} OBJS = getdents.lo xstat.lo lxstat.lo fxstat.lo \ ${largefile64_objs} all: $(LIBRARY) include $(top_srcdir)/makes/lib.mk getdents.lo: getdents.c $(LTCOMPILE) -D_LARGEFILE64_SOURCE `getconf LFS64_CFLAGS` -c $(srcdir)/getdents.c getdents64.lo: getdents64.c getdents.c $(LTCOMPILE) -D_LARGEFILE64_SOURCE `getconf LFS64_CFLAGS` -c $(srcdir)/getdents64.c xstat.lo: xstat.c xstatconv.c lxstat.lo: lxstat.c xstatconv.c fxstat.lo: fxstat.c xstatconv.c xstat64.lo: xstat64.c xstatconv.c $(LTCOMPILE) -D_LARGEFILE64_SOURCE `getconf LFS64_CFLAGS` -c $(srcdir)/xstat64.c lxstat64.lo: lxstat64.c xstatconv.c $(LTCOMPILE) -D_LARGEFILE64_SOURCE `getconf LFS64_CFLAGS` -c $(srcdir)/lxstat64.c fxstat64.lo: fxstat64.c xstatconv.c $(LTCOMPILE) -D_LARGEFILE64_SOURCE `getconf LFS64_CFLAGS` -c $(srcdir)/fxstat64.c gfarm-2.4.1/lib/gfs_hook/sysdep/linux/COPYING.LIB0000644000000000000000000006365011507222722017775 0ustar rootroot GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. ^L Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. ^L GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. ^L Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. ^L 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. ^L 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. ^L 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. ^L 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS ^L How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! gfarm-2.4.1/lib/gfs_hook/sysdep/linux/kernel-features.h0000644000000000000000000002003311507222722021566 0ustar rootroot/* Set flags signalling availability of kernel features based on given kernel version number. Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ /* This file must not contain any C code. At least it must be protected to allow using the file also in assembler files. */ #ifndef __LINUX_KERNEL_VERSION /* We assume the worst; all kernels should be supported. */ # define __LINUX_KERNEL_VERSION 0 #endif /* We assume for __LINUX_KERNEL_VERSION the same encoding used in linux/version.h. I.e., the major, minor, and subminor all get a byte with the major number being in the highest byte. This means we can do numeric comparisons. In the following we will define certain symbols depending on whether the describes kernel feature is available in the kernel version given by __LINUX_KERNEL_VERSION. We are not always exactly recording the correct versions in which the features were introduced. If somebody cares these values can afterwards be corrected. Most of the numbers here are set corresponding to 2.2.0. */ /* `getcwd' system call. */ #if __LINUX_KERNEL_VERSION >= 131584 # define __ASSUME_GETCWD_SYSCALL 1 #endif /* Real-time signal became usable in 2.1.70. */ #if __LINUX_KERNEL_VERSION >= 131398 # define __ASSUME_REALTIME_SIGNALS 1 #endif /* When were the `pread'/`pwrite' syscalls introduced? */ #if __LINUX_KERNEL_VERSION >= 131584 # define __ASSUME_PREAD_SYSCALL 1 # define __ASSUME_PWRITE_SYSCALL 1 #endif /* When was `poll' introduced? */ #if __LINUX_KERNEL_VERSION >= 131584 # define __ASSUME_POLL_SYSCALL 1 #endif /* The `lchown' syscall was introduced in 2.1.80. */ #if __LINUX_KERNEL_VERSION >= 131408 # define __ASSUME_LCHOWN_SYSCALL 1 #endif /* When did the `setresuid' sysall became available? */ #if __LINUX_KERNEL_VERSION >= 131584 && !defined __sparc__ # define __ASSUME_SETRESUID_SYSCALL 1 #endif /* The SIOCGIFNAME ioctl is available starting with 2.1.50. */ #if __LINUX_KERNEL_VERSION >= 131408 # define __ASSUME_SIOCGIFNAME 1 #endif /* On x86 another `getrlimit' syscall was added in 2.3.25. */ #if __LINUX_KERNEL_VERSION >= 131865 && defined __i386__ # define __ASSUME_NEW_GETRLIMIT_SYSCALL 1 #endif /* On x86 the truncate64/ftruncate64 syscalls were introduced in 2.3.31. */ #if __LINUX_KERNEL_VERSION >= 131871 && defined __i386__ # define __ASSUME_TRUNCATE64_SYSCALL 1 #endif /* On x86 the mmap2 syscall was introduced in 2.3.31. */ #if __LINUX_KERNEL_VERSION >= 131871 && defined __i386__ # define __ASSUME_MMAP2_SYSCALL 1 #endif /* On x86 the stat64/lstat64/fstat64 syscalls were introduced in 2.3.34. */ #if __LINUX_KERNEL_VERSION >= 131874 && defined __i386__ # define __ASSUME_STAT64_SYSCALL 1 #endif /* On sparc and ARM the truncate64/ftruncate64/mmap2/stat64/lstat64/fstat64 syscalls were introduced in 2.3.35. */ #if __LINUX_KERNEL_VERSION >= 131875 && (defined __sparc__ || defined __arm__) # define __ASSUME_TRUNCATE64_SYSCALL 1 # define __ASSUME_MMAP2_SYSCALL 1 # define __ASSUME_STAT64_SYSCALL 1 #endif /* I know for sure that getrlimit are in 2.3.35 on powerpc. */ #if __LINUX_KERNEL_VERSION >= 131875 && defined __powerpc__ # define __ASSUME_NEW_GETRLIMIT_SYSCALL 1 #endif /* I know for sure that these are in 2.3.35 on powerpc. But PowerPC64 does not support separate 64-bit syscalls, already 64-bit */ #if __LINUX_KERNEL_VERSION >= 131875 && defined __powerpc__ \ && !defined __powerpc64__ # define __ASSUME_TRUNCATE64_SYSCALL 1 # define __ASSUME_STAT64_SYSCALL 1 #endif /* Linux 2.3.39 introduced 32bit UID/GIDs. Some platforms had 32 bit type all along. */ #if __LINUX_KERNEL_VERSION >= 131879 || defined __powerpc__ || defined __mips__ # define __ASSUME_32BITUIDS 1 #endif /* Linux 2.3.39 sparc added setresuid. */ #if __LINUX_KERNEL_VERSION >= 131879 && defined __sparc__ # define __ASSUME_SETRESUID_SYSCALL 1 #endif /* Linux 2.3.39 introduced IPC64. Except for powerpc. */ #if __LINUX_KERNEL_VERSION >= 131879 && !defined __powerpc__ # define __ASSUME_IPC64 1 #endif /* mips platforms had IPC64 all along. */ #if defined __mips__ # define __ASSUME_IPC64 1 #endif /* Linux 2.4.0 on PPC introduced a correct IPC64. But PowerPC64 does not support a separate 64-bit sys call, already 64-bit */ #if __LINUX_KERNEL_VERSION >= 132096 && defined __powerpc__ \ && !defined __powerpc64__ # define __ASSUME_IPC64 1 #endif /* We can use the LDTs for threading with Linux 2.3.99 and newer. */ #if __LINUX_KERNEL_VERSION >= 131939 # define __ASSUME_LDT_WORKS 1 #endif /* The changed st_ino field appeared in 2.4.0-test6. But we cannot distinguish this version from other 2.4.0 releases. Therefore play save and assume it available is for 2.4.1 and up. */ #if __LINUX_KERNEL_VERSION >= 132097 # define __ASSUME_ST_INO_64_BIT 1 #endif /* To support locking of large files a new fcntl() syscall was introduced in 2.4.0-test7. We test for 2.4.1 for the earliest version we know the syscall is available. */ #if __LINUX_KERNEL_VERSION >= 132097 && (defined __i386__ || defined __sparc__) # define __ASSUME_FCNTL64 1 #endif /* Arm got fcntl64 in 2.4.4, PowerPC and SH have it also in 2.4.4 (I don't know when it got introduced). But PowerPC64 does not support separate FCNTL64 call, FCNTL is already 64-bit */ #if __LINUX_KERNEL_VERSION >= 132100 \ && (defined __arm__ || defined __powerpc__ || defined __sh__) \ && !defined __powerpc64__ # define __ASSUME_FCNTL64 1 #endif /* The getdents64 syscall was introduced in 2.4.0-test7. We test for 2.4.1 for the earliest version we know the syscall is available. */ #if __LINUX_KERNEL_VERSION >= 132097 # define __ASSUME_GETDENTS64_SYSCALL 1 #endif /* When did O_DIRECTORY became available? Early in 2.3 but when? Be safe, use 2.3.99. */ #if __LINUX_KERNEL_VERSION >= 131939 # define __ASSUME_O_DIRECTORY 1 #endif /* Starting with one of the 2.4.0 pre-releases the Linux kernel passes up the page size information. */ #if __LINUX_KERNEL_VERSION >= 132097 # define __ASSUME_AT_PAGESIZE 1 #endif /* Starting with at least 2.4.0 the kernel passes the uid/gid unconditionally up to the child. */ #if __LINUX_KERNEL_VERSION >= 132097 # define __ASSUME_AT_XID 1 #endif /* Starting with 2.4.5 kernels PPC passes the AUXV in the standard way. */ #if __LINUX_KERNEL_VERSION >= (132096+5) && defined __powerpc__ # define __ASSUME_STD_AUXV 1 #endif /* Starting with 2.4.5 kernels the mmap2 syscall made it into the official kernel. But PowerPC64 does not support a separate MMAP2 call. */ #if __LINUX_KERNEL_VERSION >= (132096+5) && defined __powerpc__ \ && !defined __powerpc64__ # define __ASSUME_MMAP2_SYSCALL 1 #endif /* On x86, the set_thread_area syscall was introduced in 2.5.29, but its semantics was changed in 2.5.30, and again after 2.5.31. */ #if __LINUX_KERNEL_VERSION >= 132384 && defined __i386__ # define __ASSUME_SET_THREAD_AREA_SYSCALL 1 #endif /* There are an infinite number of PA-RISC kernel versions numbered 2.4.0. But they've not really been released as such. We require and expect the final version here. */ #ifdef __hppa__ # define __ASSUME_32BITUIDS 1 # define __ASSUME_TRUNCATE64_SYSCALL 1 # define __ASSUME_MMAP2_SYSCALL 1 # define __ASSUME_STAT64_SYSCALL 1 # define __ASSUME_IPC64 1 # define __ASSUME_ST_INO_64_BIT 1 # define __ASSUME_FCNTL64 1 # define __ASSUME_GETDENTS64_SYSCALL 1 #endif gfarm-2.4.1/lib/gfs_hook/sysdep/linux/getdents.c0000644000000000000000000001672011507222722020312 0ustar rootroot/* Copyright (C) 1993, 1995-2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #include #include #include #include #include #include #include #include #include #include #include "sysdep.h" #include #include #include #include "kernel-features.h" #ifdef __NR_getdents64 #ifndef __ASSUME_GETDENTS64_SYSCALL #ifndef SYSCALL_GETDENTS /* The variable is shared between all *getdents* calls. */ int __have_no_getdents64; #else extern int __have_no_getdents64; #endif #endif #endif #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) extern int __syscall_getdents (int fd, char *__unbounded buf, unsigned int nbytes); extern int __syscall_getdents64 (int fd, char *__unbounded buf, unsigned int nbytes); /* For Linux we need a special version of this file since the definition of `struct dirent' is not the same for the kernel and the libc. There is one additional field which might be introduced in the kernel structure in the future. Here is the kernel definition of `struct dirent' as of 2.1.20: */ struct kernel_dirent { long int d_ino; __kernel_off_t d_off; unsigned short int d_reclen; char d_name[256]; }; struct kernel_dirent64 { uint64_t d_ino; int64_t d_off; unsigned short int d_reclen; unsigned char d_type; char d_name[256]; }; #ifndef SYSCALL_GETDENTS # define SYSCALL_GETDENTS gfs_hook_syscall_getdents #endif #ifndef DIRENT_TYPE # define DIRENT_TYPE struct dirent #endif #ifndef DIRENT_SET_DP_INO # define DIRENT_SET_DP_INO(dp, value) (dp)->d_ino = (value) #endif /* The problem here is that we cannot simply read the next NBYTES bytes. We need to take the additional field into account. We use some heuristic. Assuming the directory contains names with 14 characters on average we can compute an estimated number of entries which fit in the buffer. Taking this number allows us to specify a reasonable number of bytes to read. If we should be wrong, we can reset the file descriptor. In practice the kernel is limiting the amount of data returned much more then the reduced buffer size. */ ssize_t internal_function SYSCALL_GETDENTS (int fd, char *buf, size_t nbytes) { DIRENT_TYPE *dp; off64_t last_offset = -1; ssize_t retval; #ifdef __NR_getdents64 # ifndef __ASSUME_GETDENTS64_SYSCALL if (!__have_no_getdents64) # endif { # ifndef __ASSUME_GETDENTS64_SYSCALL int saved_errno = errno; # endif char *kbuf = buf; size_t kbytes = nbytes; if (offsetof (DIRENT_TYPE, d_name) < offsetof (struct kernel_dirent64, d_name) && nbytes <= sizeof (DIRENT_TYPE)) { kbytes = nbytes + offsetof (struct kernel_dirent64, d_name) - offsetof (DIRENT_TYPE, d_name); kbuf = __alloca(kbytes); } retval = syscall (__NR_getdents64, fd, kbuf, kbytes); # ifndef __ASSUME_GETDENTS64_SYSCALL if (retval != -1 && errno != -EINVAL) # endif { struct kernel_dirent64 *kdp; const size_t size_diff = (offsetof (struct kernel_dirent64, d_name) - offsetof (DIRENT_TYPE, d_name)); /* Return the error if encountered. */ if (retval == -1) return -1; /* If the structure returned by the kernel is identical to what we need, don't do any conversions. */ if (offsetof (DIRENT_TYPE, d_name) == offsetof (struct kernel_dirent64, d_name) && sizeof (dp->d_ino) == sizeof (kdp->d_ino) && sizeof (dp->d_off) == sizeof (kdp->d_off)) return retval; dp = (DIRENT_TYPE *)buf; kdp = (struct kernel_dirent64 *) kbuf; while ((char *) kdp < kbuf + retval) { const size_t alignment = __alignof__ (DIRENT_TYPE); /* Since kdp->d_reclen is already aligned for the kernel structure this may compute a value that is bigger than necessary. */ size_t old_reclen = kdp->d_reclen; size_t new_reclen = ((old_reclen - size_diff + alignment - 1) & ~(alignment - 1)); uint64_t d_ino = kdp->d_ino; int64_t d_off = kdp->d_off; unsigned char d_type = kdp->d_type; DIRENT_SET_DP_INO (dp, d_ino); dp->d_off = d_off; if ((sizeof (dp->d_ino) != sizeof (kdp->d_ino) && dp->d_ino != d_ino) || (sizeof (dp->d_off) != sizeof (kdp->d_off) && dp->d_off != d_off)) { /* Overflow. If there was at least one entry before this one, return them without error, otherwise signal overflow. */ if (last_offset != -1) { lseek64 (fd, last_offset, SEEK_SET); return (char *) dp - buf; } __set_errno (EOVERFLOW); return -1; } last_offset = d_off; dp->d_reclen = new_reclen; dp->d_type = d_type; memmove (dp->d_name, kdp->d_name, old_reclen - offsetof (struct kernel_dirent64, d_name)); dp = (DIRENT_TYPE *) ((char *) dp + new_reclen); kdp = (struct kernel_dirent64 *) ((char *) kdp + old_reclen); } return (char *) dp - buf; } # ifndef __ASSUME_GETDENTS64_SYSCALL __set_errno (saved_errno); __have_no_getdents64 = 1; # endif } #endif { size_t red_nbytes; struct kernel_dirent *skdp, *kdp; const size_t size_diff = (offsetof (DIRENT_TYPE, d_name) - offsetof (struct kernel_dirent, d_name)); red_nbytes = MIN (nbytes - ((nbytes / (offsetof (DIRENT_TYPE, d_name) + 14)) * size_diff), nbytes - size_diff); dp = (DIRENT_TYPE *) buf; skdp = kdp = __alloca (red_nbytes); retval = syscall (__NR_getdents, fd, kdp, red_nbytes); if (retval == -1) return -1; while ((char *) kdp < (char *) skdp + retval) { const size_t alignment = __alignof__ (DIRENT_TYPE); /* Since kdp->d_reclen is already aligned for the kernel structure this may compute a value that is bigger than necessary. */ size_t new_reclen = ((kdp->d_reclen + size_diff + alignment - 1) & ~(alignment - 1)); if ((char *) dp + new_reclen > buf + nbytes) { /* Our heuristic failed. We read too many entries. Reset the stream. */ assert (last_offset != -1); lseek64 (fd, last_offset, SEEK_SET); if ((char *) dp == buf) { /* The buffer the user passed in is too small to hold even one entry. */ __set_errno (EINVAL); return -1; } break; } last_offset = kdp->d_off; DIRENT_SET_DP_INO(dp, kdp->d_ino); dp->d_off = kdp->d_off; dp->d_reclen = new_reclen; dp->d_type = DT_UNKNOWN; memcpy (dp->d_name, kdp->d_name, kdp->d_reclen - offsetof (struct kernel_dirent, d_name)); dp = (DIRENT_TYPE *) ((char *) dp + new_reclen); kdp = (struct kernel_dirent *) (((char *) kdp) + kdp->d_reclen); } } return (char *) dp - buf; } gfarm-2.4.1/lib/gfs_hook/hooks_init_mpi.c0000644000000000000000000000101011507222722017024 0ustar rootroot/* * $Id: hooks_init_mpi.c 2373 2006-01-12 00:54:22Z soda $ */ #include #include #include #include extern int gf_hook_default_global; char * gfs_hook_initialize(void) { int rank, size; char *e; MPI_Comm_size(MPI_COMM_WORLD, &size); MPI_Comm_rank(MPI_COMM_WORLD, &rank); e = gfarm_initialize(NULL, NULL); if (e != NULL) return (e); if (gf_hook_default_global) gfs_hook_set_default_view_global(); gfs_pio_set_local(rank, size); return (NULL); } gfarm-2.4.1/lib/gfs_hook/hooks_init.c0000644000000000000000000000175211507222722016174 0ustar rootroot/* * $Id: hooks_init.c 4303 2010-01-06 01:45:08Z ookuma $ */ #include #include #include #include #include #include #include "gfutil.h" #include "hooks_subr.h" extern int gf_hook_default_global; char * gfs_hook_initialize(void) { char *e; _gfs_hook_debug(gflog_info(GFARM_MSG_UNFIXED, "GFS: gfs_hook_initialize")); /* * allocate file descriptor greater than MIN_FD defined in * hooks_subr.c for connection to metadata server. */ gfs_hook_reserve_fd(); e = gfarm_initialize(NULL, NULL); gfs_hook_release_fd(); if (e != NULL) { _gfs_hook_debug( gflog_info(GFARM_MSG_UNFIXED, "GFS: gfs_hook_initialize: %s", e)); return (e); } if (gf_hook_default_global) gfs_hook_set_default_view_global(); if (gfs_pio_set_local_check() != NULL) gfs_pio_set_local(0, 1); /* exexute close_all() and gfarm_terminate() at program termination */ atexit(gfs_hook_terminate); return (NULL); } gfarm-2.4.1/lib/Makefile0000644000000000000000000000032211507222724013515 0ustar rootroottop_builddir = .. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk GFSHOOK_TARGETS = gfs_hook SUBDIRS = \ libgfarm #XXX # $(gfshook_targets) include $(top_srcdir)/makes/subdir.mk gfarm-2.4.1/lib/libgfarm/0000755000000000000000000000000011507222730013640 5ustar rootrootgfarm-2.4.1/lib/libgfarm/gfsl/0000755000000000000000000000000011507222730014573 5ustar rootrootgfarm-2.4.1/lib/libgfarm/gfsl/gfarm_secure_session.h0000644000000000000000000001726311507222723021164 0ustar rootroot#ifndef _GFARM_SECURE_SESSION_H_ #define _GFARM_SECURE_SESSION_H_ #include "gfsl_config.h" #include "gfarm_gsi.h" #include "gfarm_auth.h" /* * Session information struct */ typedef struct gfarmSecSession { /* * Generic TCP transport information. */ int fd; /* File descriptor for the session. */ int needClose; /* Need to close above fd or not when terminate this session. */ int rPort; /* Port # of the peer. */ char *peerName; /* FQDN of the peer. Heap alloc'd. */ /* * Credential information. */ gss_cred_id_t cred; /* The credential used for the session. */ gss_name_t credName; /* Name of the credential. Need to release. */ gss_ctx_id_t sCtx; /* A secure context for the session. */ /* * Role specific information. */ int iOa; /* An initiator or an acceptor. */ #define GFARM_SS_INITIATOR 1 #define GFARM_SS_ACCEPTOR 2 union { /* * Initiator side session infomation. */ struct initiatorSessionInfo { OM_uint32 reqFlag; /* Security context initiation flag. */ gss_name_t acceptorName; /* Need to release */ } initiator; /* * Acceptor side session information. */ struct acceptorSessionInfo { gfarmAuthEntry *mappedUser; /* Authenticated user information. */ gss_name_t initiatorName; /* Need to release */ gss_cred_id_t deleCred; /* A credential delegated from the initiator. */ } acceptor; } iOaInfo; /* * Session configuration information. */ gss_qop_t qOp; /* Quality Of Protection * for GSSAPI layer. */ unsigned int maxTransSize; /* Maximum transmission size of the session in bytes. */ unsigned int config; /* Or'd value of belows. */ #define GFARM_SS_USE_ENCRYPTION 0x1 #define GFARM_SS_USE_COMPRESSION 0x2 #define GFARM_SS_USE_SYSTEMCONF 0x80000000 /* * Poll status. */ int pollEvent; /* Or'd value of belows. */ #define GFARM_SS_POLL_NONE 0x0 #define GFARM_SS_POLL_READABLE 0x1 #define GFARM_SS_POLL_WRITABLE 0x2 #define GFARM_SS_POLL_ERROR 0x4 /* * Session status. */ OM_uint32 gssLastStat; /* The last status of GSSAPI invocation. */ } gfarmSecSession; #define isBitSet(A, B) (((A) & (B)) == (B)) /* * GSSAPI and other transmission configuration information struct. */ typedef struct { unsigned int optMask; /* Mask of which options are specified. Or'd belows: */ #define GFARM_SS_OPT_QOP_MASK 0x1 #define GFARM_SS_OPT_MAXT_MASK 0x2 #define GFARM_SS_OPT_CONF_MASK 0x4 #define GFARM_SS_OPT_ALL_MASK 0x7 gss_qop_t qOpReq; /* Requested QOP. */ int qOpForce; /* If 1 use the requested QOP forcible otherwise negothiate with peer and falldown to acceptable level. */ unsigned int maxTransSizeReq; /* Requested maximum transmission size. */ int maxTransSizeForce; /* Force use above or not. */ unsigned int configReq; /* Any other configuration. */ int configForce; /* Force use above or not. */ } gfarmSecSessionOption; #define GFARM_SS_DEFAULT_OPTION \ { \ GFARM_SS_OPT_ALL_MASK, \ GFARM_GSS_DEFAULT_QOP, \ 0, \ GFARM_GSS_DEFAULT_MAX_MESSAGE_REQUEST_SIZE, \ 0, \ GFARM_SS_USE_ENCRYPTION, \ 0 \ } /* Authorization ACK/NACK */ #define GFARM_SS_AUTH_ACK 1 #define GFARM_SS_AUTH_NACK 0 /* Prototypes */ extern char ** gfarmSecSessionCrackStatus(gfarmSecSession *ssPtr); extern void gfarmSecSessionFreeCrackedStatus(char **strPtr); extern void gfarmSecSessionPrintStatus(gfarmSecSession *ssPtr); extern int gfarmSecSessionInitializeAcceptor(char *configFile, char *usermapFile, OM_uint32 *majStatPtr, OM_uint32 *minStatPtr); extern int gfarmSecSessionInitializeInitiator(char *configFile, char *usermapFile, OM_uint32 *majStatPtr, OM_uint32 *minStatPtr); extern int gfarmSecSessionInitializeBoth(char *iConfigFile, char *aConfigFile, char *usermapFile, OM_uint32 *majstatPtr, OM_uint32 *minstatPtr); extern void gfarmSecSessionFinalizeAcceptor(void); extern void gfarmSecSessionFinalizeInitiator(void); extern void gfarmSecSessionFinalizeBoth(void); extern int gfarmSecSessionGetInitiatorInitialCredential(gss_cred_id_t *credPtr); extern gfarmSecSession * gfarmSecSessionAccept(int fd, gss_cred_id_t cred, gfarmSecSessionOption *ssOptPtr, OM_uint32 *majStatPtr, OM_uint32 *minStatPtr); extern gfarmSecSession * gfarmSecSessionInitiate(int fd, const gss_name_t acceptorName, gss_cred_id_t cred, OM_uint32 reqFlag, gfarmSecSessionOption *ssOptPtr, OM_uint32 *majStatPtr, OM_uint32 *minStatPtr); extern gfarmSecSession * gfarmSecSessionInitiateByAddr(unsigned long rAddr, int port, const gss_name_t acceptorName, gss_cred_id_t cred, OM_uint32 reqFlag, gfarmSecSessionOption *ssOptPtr, OM_uint32 *majStatPtr, OM_uint32 *minStatPtr); extern gfarmSecSession * gfarmSecSessionInitiateByName(char *hostname, int port, const gss_name_t acceptorName, gss_cred_id_t cred, OM_uint32 reqFlag, gfarmSecSessionOption *ssOptPtr, OM_uint32 *majStatPtr, OM_uint32 *minStatPtr); extern void gfarmSecSessionTerminate(gfarmSecSession *ssPtr); extern gss_cred_id_t gfarmSecSessionGetDelegatedCredential(gfarmSecSession *ssPtr); extern int gfarmSecSessionGetInitiatorName( gfarmSecSession *ssPtr, gss_name_t *namePtr); extern gfarmAuthEntry * gfarmSecSessionGetInitiatorInfo(gfarmSecSession *ssPtr); extern int gfarmSecSessionDedicate(gfarmSecSession *ssPtr); extern int gfarmSecSessionSendInt32(gfarmSecSession *ssPtr, gfarm_int32_t *buf, int n); extern int gfarmSecSessionReceiveInt32(gfarmSecSession *ssPtr, gfarm_int32_t **bufPtr, int *lenPtr); extern int gfarmSecSessionSendInt16(gfarmSecSession *ssPtr, gfarm_int16_t *buf, int n); extern int gfarmSecSessionReceiveInt16(gfarmSecSession *ssPtr, gfarm_int16_t **bufPtr, int *lenPtr); extern int gfarmSecSessionSendInt8(gfarmSecSession *ssPtr, gfarm_int8_t *buf, int n); extern int gfarmSecSessionReceiveInt8(gfarmSecSession *ssPtr, gfarm_int8_t **bufPtr, int *lenPtr); extern int gfarmSecSessionPoll(gfarmSecSession *ssList[], int n, struct timeval *toPtr); /* * gfarmSecSessionPoll() convinience macro(s). */ #define gfarmSecSessionCheckPollReadable(s) (isBitSet(s->pollEvent, GFARM_SS_POLL_READABLE)) #define gfarmSecSessionCheckPollWritable(s) (isBitSet(s->pollEvent, GFARM_SS_POLL_WRITABLE)) #define gfarmSecSessionCheckPollError(s) (isBitSet(s->pollEvent, GFARM_SS_POLL_WRITABLE)) #define gfarmSecSessionSetPollEvent(s, e) { s->pollEvent = (e); } #define gfarmSecSessionClearPollEvent(s) gfarmSecSessionSetPollEvent(s, GFARM_SS_POLL_NONE) #define gfarmSecSessionAddPollEvent(s, m) { s->pollEvent |= (m); } #define gfarmSecSessionDeletePollEvent(s, d) { s->pollEvent &= ~(d); } /* * multiplexed version */ struct gfarm_eventqueue; struct gfarmSecSessionInitiateState; extern struct gfarmSecSessionInitiateState *gfarmSecSessionInitiateRequest( struct gfarm_eventqueue *q, int fd, const gss_name_t acceptorName, gss_cred_id_t cred, OM_uint32 reqFlag, gfarmSecSessionOption *ssOptPtr, void (*continuation)(void *), void *closure, OM_uint32 *majStatPtr, OM_uint32 *minStatPtr); extern gfarmSecSession *gfarmSecSessionInitiateResult(struct gfarmSecSessionInitiateState *state, OM_uint32 *majStatPtr, OM_uint32 *minStatPtr); #endif /* _GFARM_SECURE_SESSION_H_ */ gfarm-2.4.1/lib/libgfarm/gfsl/session.c0000644000000000000000000017657311507222723016447 0ustar rootroot#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "gfevent.h" #include "gfutil.h" #include "thrsubr.h" #include "tcputil.h" #include "gfarm_secure_session.h" #include "misc.h" /* #define SS_DEBUG */ /* * Initial credential and its name. */ static gss_cred_id_t initiatorInitialCred = GSS_C_NO_CREDENTIAL; static gss_cred_id_t acceptorInitialCred = GSS_C_NO_CREDENTIAL; static int initiatorInitialized = 0; static int acceptorInitialized = 0; static pthread_mutex_t initiator_mutex = PTHREAD_MUTEX_INITIALIZER; static pthread_mutex_t acceptor_mutex = PTHREAD_MUTEX_INITIALIZER; static const char initiatorDiag[] = "initiator"; static const char acceptorDiag[] = "acceptor"; /* * Communication option read from configuration file. */ static gfarmSecSessionOption acceptorSsOpt = GFARM_SS_DEFAULT_OPTION; static gfarmSecSessionOption initiatorSsOpt = GFARM_SS_DEFAULT_OPTION; static int canonicSecSessionOpt(int which, gfarmSecSessionOption *reqPtr, gfarmSecSessionOption *canPtr); static gfarmSecSession * allocSecSession(int which); static void destroySecSession(gfarmSecSession *ssPtr); static int secSessionReadConfigFile(char *configFile, gfarmSecSessionOption *ssOptPtr); static int negotiateConfigParam(int fd, gss_ctx_id_t sCtx, int which, gfarmSecSessionOption *canPtr, gss_qop_t *qOpPtr, unsigned int *maxTransPtr, unsigned int *configPtr, OM_uint32 *majStatPtr, OM_uint32 *minStatPtr); static gfarmSecSession * secSessionInitiate(int fd, const gss_name_t acceptorName, gss_cred_id_t cred, OM_uint32 reqFlag, gfarmSecSessionOption *ssOptPtr, OM_uint32 *majStatPtr, OM_uint32 *minStatPtr, int needClose); static void negotiateConfigParamInitiatorReceive(int events, int fd, void *closure, const struct timeval *t); static void negotiateConfigParamInitiatorSend(int events, int fd, void *closure, const struct timeval *t); static struct negotiateConfigParamInitiatorState * negotiateConfigParamInitiatorRequest(struct gfarm_eventqueue *q, int fd, gss_ctx_id_t sCtx, gfarmSecSessionOption *canPtr, void (*continuation)(void *), void *closure, OM_uint32 *majStatPtr, OM_uint32 *minStatPtr); static int negotiateConfigParamInitiatorResult(struct negotiateConfigParamInitiatorState *state, gss_qop_t *qOpPtr, unsigned int *maxTransPtr, unsigned int *configPtr, OM_uint32 *majStatPtr, OM_uint32 *minStatPtr); static void secSessionInitiateCleanup(void *closure); static void secSessionInitiateReceiveAuthorizationAck(int events, int fd, void *closure, const struct timeval *t); static void secSessionInitiateWaitAuthorizationAck(void *closure); static struct gfarmSecSessionInitiateState * secSessionInitiateRequest(struct gfarm_eventqueue *q, int fd, const gss_name_t acceptorName, gss_cred_id_t cred, OM_uint32 reqFlag, gfarmSecSessionOption *ssOptPtr, void (*continuation)(void *), void *closure, OM_uint32 *majStatPtr, OM_uint32 *minStatPtr, int needClose); static gfarmSecSession *secSessionInitiateResult(struct gfarmSecSessionInitiateState *state, OM_uint32 *majStatPtr, OM_uint32 *minStatPtr); #ifdef SS_DEBUG static void dumpConfParam(gss_qop_t qOp, unsigned int max, unsigned int conf); static void dumpSsOpt(gfarmSecSessionOption *ssOptPtr); static void dumpConfParam(qOp, max, conf) gss_qop_t qOp; unsigned int max; unsigned int conf; { fprintf(stderr, "\tQOP:\t%d\n", (int)qOp); fprintf(stderr, "\tMAX:\t%d\n", max); fprintf(stderr, "\tOPT:\t(%d)", conf); if (conf & GFARM_SS_USE_ENCRYPTION) { fprintf(stderr, " encrypt"); } if (conf & GFARM_SS_USE_COMPRESSION) { fprintf(stderr, " compress"); } fprintf(stderr, "\n"); } static void dumpSsOpt(ssOptPtr) gfarmSecSessionOption *ssOptPtr; { fprintf(stderr, "\n\tQOP:\t"); if (ssOptPtr->optMask & GFARM_SS_OPT_QOP_MASK) { fprintf(stderr, "%d%s\n", (int)ssOptPtr->qOpReq, (ssOptPtr->qOpForce == 1) ? " (force)" : ""); } else { fprintf(stderr, "none\n"); } fprintf(stderr, "\tMAX:\t"); if (ssOptPtr->optMask & GFARM_SS_OPT_MAXT_MASK) { fprintf(stderr, "%d%s\n", (int)ssOptPtr->maxTransSizeReq, (ssOptPtr->maxTransSizeForce == 1) ? " (force)" : ""); } else { fprintf(stderr, "none\n"); } fprintf(stderr, "\tOPT:\t"); if (ssOptPtr->optMask & GFARM_SS_OPT_CONF_MASK) { fprintf(stderr, "(%d)", ssOptPtr->configReq); if (ssOptPtr->configReq & GFARM_SS_USE_ENCRYPTION) { fprintf(stderr, " encrypt"); } if (ssOptPtr->configReq & GFARM_SS_USE_COMPRESSION) { fprintf(stderr, " compress"); } if (ssOptPtr->configForce == 1) { fprintf(stderr, " (force)"); } fprintf(stderr, "\n\n"); } else { fprintf(stderr, "none\n\n"); } } #endif /* SS_DEBUG */ static int secSessionReadConfigFile(configFile, ssOptPtr) char *configFile; gfarmSecSessionOption *ssOptPtr; { FILE *fd = NULL; char lineBuf[65536]; char *token[64]; int nToken; gfarmSecSessionOption ssTmp = GFARM_SS_DEFAULT_OPTION; int i; if (configFile == NULL || configFile[0] == '\0') { gflog_auth_error(GFARM_MSG_1000659, "gfarm:secSessionReadConfigFile(): " "GFSL configuration file isn't specified"); return -1; } if ((fd = fopen(configFile, "r")) == NULL) { /* * use default option. */ gflog_debug(GFARM_MSG_1000815, "fopen(%s) failed", configFile); goto Done; } while (fgets(lineBuf, 65536, fd) != NULL) { nToken = gfarmGetToken(lineBuf, token, 64); if (nToken <= 0) { continue; } if (token[0][0] == '#') { continue; } if (strcasecmp(token[0], "qop:") == 0) { for (i = 1; i < nToken; i++) { if (strcasecmp(token[i], "force") == 0) { ssTmp.qOpForce = 1; } else if (strcasecmp(token[i], "default") == 0 || strcasecmp(token[i], "gfarm") == 0) { ssTmp.qOpReq = GFARM_GSS_DEFAULT_QOP; #if defined(USE_GLOBUS) && defined(GSS_C_QOP_GLOBUS_GSSAPI_SSLEAY_BIG) } else if (strcasecmp(token[i], "globus") == 0) { ssTmp.qOpReq = GSS_C_QOP_GLOBUS_GSSAPI_SSLEAY_BIG; #endif /* USE_GLOBUS */ } else if (strcasecmp(token[i], "gssapi") == 0) { ssTmp.qOpReq = GSS_C_QOP_DEFAULT; } } } else if (strcasecmp(token[0], "maxtrans:") == 0) { for (i = 1; i < nToken; i++) { if (strcasecmp(token[i], "force") == 0) { ssTmp.maxTransSizeForce = 1; } else if (strcasecmp(token[i], "default") == 0) { ssTmp.maxTransSizeReq = GFARM_GSS_DEFAULT_MAX_MESSAGE_REQUEST_SIZE; } else { int val; if (gfarmGetInt(token[i], &val) == 1) { if (val < 0) { val = GFARM_GSS_DEFAULT_MAX_MESSAGE_REQUEST_SIZE; } ssTmp.maxTransSizeReq = (unsigned int)val; } } } } else if (strcasecmp(token[0], "options:") == 0) { unsigned int opt = GFARM_SS_USE_ENCRYPTION; for (i = 1; i < nToken; i++) { if (strcasecmp(token[i], "force") == 0) { ssTmp.configForce = 1; } else if (strcasecmp(token[i], "encrypt") == 0) { opt |= GFARM_SS_USE_ENCRYPTION; } else if (strcasecmp(token[i], "compress") == 0) { opt |= GFARM_SS_USE_COMPRESSION; } else if (strcasecmp(token[i], "default") == 0) { opt = GFARM_SS_USE_ENCRYPTION; } } ssTmp.configReq = opt; } } (void)fclose(fd); Done: if (ssOptPtr != NULL) { memcpy((void *)ssOptPtr, (void *)&ssTmp, sizeof(gfarmSecSessionOption)); ssOptPtr->optMask = GFARM_SS_OPT_ALL_MASK; } return 1; } static int canonicSecSessionOpt(which, reqPtr, canPtr) int which; gfarmSecSessionOption *reqPtr; gfarmSecSessionOption *canPtr; { gfarmSecSessionOption *dPtr = (which == GFARM_SS_INITIATOR) ? &initiatorSsOpt : &acceptorSsOpt; if (canPtr == NULL) { gflog_auth_error(GFARM_MSG_1000660, "gfarmSecSession:canonicSecSessionOpt(): " "invalid argument"); return -1; } if (reqPtr == NULL) { (void)memcpy((void *)canPtr, (void *)dPtr, sizeof(gfarmSecSessionOption)); return 1; } #define isMasked(op, msk) ((op)->optMask & msk) == msk #define isUseReq(req, mbr) (req)->mbr == 1 || ((req)->mbr == 0 && dPtr->mbr == 0) #define cpIt(dst, src, mbr) (dst)->mbr = (src)->mbr #define useReq(mbr) cpIt(canPtr, reqPtr, mbr) #define useDef(mbr) cpIt(canPtr, dPtr, mbr) canPtr->optMask |= GFARM_SS_OPT_QOP_MASK; if (isMasked(reqPtr, GFARM_SS_OPT_QOP_MASK)) { if (isUseReq(reqPtr, qOpForce)) { useReq(qOpReq); useReq(qOpForce); } else { goto useQOPDef; } } else { useQOPDef: useDef(qOpReq); useDef(qOpForce); } canPtr->optMask |= GFARM_SS_OPT_MAXT_MASK; if (isMasked(reqPtr, GFARM_SS_OPT_MAXT_MASK)) { if (isUseReq(reqPtr, maxTransSizeForce)) { useReq(maxTransSizeReq); useReq(maxTransSizeForce); } else { goto useMaxTDef; } } else { useMaxTDef: useDef(maxTransSizeReq); useDef(maxTransSizeForce); } canPtr->optMask |= GFARM_SS_OPT_CONF_MASK; if (isMasked(reqPtr, GFARM_SS_OPT_CONF_MASK)) { if (isUseReq(reqPtr, configForce)) { useReq(configReq); useReq(configForce); } else { goto useConfigDef; } } else { useConfigDef: useDef(configReq); useDef(configForce); } return 1; #undef isMasked #undef isUseReq #undef cpIt #undef useReq #undef useDef } static int negotiateConfigParam(fd, sCtx, which, canPtr, qOpPtr, maxTransPtr, configPtr, majStatPtr, minStatPtr) int fd; gss_ctx_id_t sCtx; int which; gfarmSecSessionOption *canPtr; gss_qop_t *qOpPtr; unsigned int *maxTransPtr; unsigned int *configPtr; OM_uint32 *majStatPtr; OM_uint32 *minStatPtr; { int ret = -1; OM_uint32 majStat = GSS_S_FAILURE; OM_uint32 minStat = GFSL_DEFAULT_MINOR_ERROR; gss_qop_t retQOP = GFARM_GSS_DEFAULT_QOP; unsigned int retMaxT = GFARM_GSS_DEFAULT_MAX_MESSAGE_REQUEST_SIZE; unsigned int retConf = GFARM_SS_USE_ENCRYPTION; #define NEGO_PARAM_QOP 0 #define NEGO_PARAM_QOP_FORCE 1 #define NEGO_PARAM_MAX_TRANS_SIZE 2 #define NEGO_PARAM_MAX_TRANS_SIZE_FORCE 3 #define NEGO_PARAM_OTHER_CONFIG 4 #define NEGO_PARAM_OTHER_CONFIG_FORCE 5 #define NUM_NEGO_PARAM 6 if (sCtx == GSS_C_NO_CONTEXT) { gflog_auth_error(GFARM_MSG_1000661, "gfarmSecSession:negotiateConfigParam(): " "no context"); goto Done; } switch (which) { gfarm_int32_t param[NUM_NEGO_PARAM]; case GFARM_SS_ACCEPTOR: { int iQOP, iQOPF; unsigned int iMax; int iMaxF; int iConf, iConfF; if (gfarmReadInt32(fd, param, NUM_NEGO_PARAM) != NUM_NEGO_PARAM) { gflog_auth_error(GFARM_MSG_1000662, "gfarmSecSession:negotiateConfigParam(): " "negotiation failure with the initiator"); goto Done; } iQOP = param[NEGO_PARAM_QOP]; iQOPF = param[NEGO_PARAM_QOP_FORCE]; iMax = param[NEGO_PARAM_MAX_TRANS_SIZE]; iMaxF = param[NEGO_PARAM_MAX_TRANS_SIZE_FORCE]; iConf = param[NEGO_PARAM_OTHER_CONFIG]; iConfF = param[NEGO_PARAM_OTHER_CONFIG_FORCE]; /* * Give precedence to the acceptor on QOP. */ if (canPtr->qOpForce == 0 && iQOPF == 1) { /* * Use the initiator's. */ retQOP = (gss_qop_t)iQOP; } else { /* * Use the acceptor's. */ retQOP = canPtr->qOpReq; } param[NEGO_PARAM_QOP] = retQOP; /* * maximum transmission size */ if (canPtr->maxTransSizeForce == 1) { /* * Use the acceptor's. */ retMaxT = iMax; } else if (iMaxF == 1) { /* * Use the initiator's. */ retMaxT = canPtr->maxTransSizeReq; } else { /* * Both force flags are off. * Use larger one. */ retMaxT = (canPtr->maxTransSizeReq >= iMax) ? canPtr->maxTransSizeReq : iMax; } param[NEGO_PARAM_MAX_TRANS_SIZE] = retMaxT; /* * other configuration flags */ /* compression, systemconf - Give precedence to the acceptor. */ if (canPtr->configForce == 0 && iConfF == 1) { /* * Use the initiator's. */ retConf = canPtr->configReq; } else { /* * Use the acceptor's. */ retConf = iConf; } /* encryption - Take logical or value ignoring both force flags. */ retConf &= ~GFARM_SS_USE_ENCRYPTION; retConf |= (canPtr->configReq | iConf) & GFARM_SS_USE_ENCRYPTION; param[NEGO_PARAM_OTHER_CONFIG] = retConf; if (gfarmWriteInt32(fd, param, NUM_NEGO_PARAM) != NUM_NEGO_PARAM) { gflog_auth_error(GFARM_MSG_1000663, "gfarmSecSession:negotiateConfigParam(): " "initiator disappered"); goto Done; } /* End of acceptor side negotiation. */ break; } case GFARM_SS_INITIATOR: { param[NEGO_PARAM_QOP] = canPtr->qOpReq; param[NEGO_PARAM_QOP_FORCE] = canPtr->qOpForce; param[NEGO_PARAM_MAX_TRANS_SIZE] = canPtr->maxTransSizeReq; param[NEGO_PARAM_MAX_TRANS_SIZE_FORCE] = canPtr->maxTransSizeForce; param[NEGO_PARAM_OTHER_CONFIG] = canPtr->configReq; param[NEGO_PARAM_OTHER_CONFIG_FORCE] = canPtr->configForce; if (gfarmWriteInt32(fd, param, NUM_NEGO_PARAM) != NUM_NEGO_PARAM) { gflog_auth_error(GFARM_MSG_1000664, "gfarmSecSession:negotiateConfigParam(): " "acceptor disappered"); goto Done; } if (gfarmReadInt32(fd, param, NUM_NEGO_PARAM) != NUM_NEGO_PARAM) { gflog_auth_error(GFARM_MSG_1000665, "gfarmSecSession:negotiateConfigParam(): " "negotiation failure with the acceptor"); goto Done; } retQOP = param[NEGO_PARAM_QOP]; retMaxT = param[NEGO_PARAM_MAX_TRANS_SIZE]; retConf = param[NEGO_PARAM_OTHER_CONFIG]; /* End of initiator side negotiation. */ break; } } { unsigned int maxMsgSize; int doEncrypt = GFARM_GSS_ENCRYPTION_ENABLED & (isBitSet(retConf, GFARM_SS_USE_ENCRYPTION) ? 1 : 0); if (gfarmGssConfigureMessageSize(sCtx, doEncrypt, retQOP, retMaxT, &maxMsgSize, &majStat, &minStat) >= 0) { if (qOpPtr != NULL) { *qOpPtr = retQOP; } if (maxTransPtr != NULL) { *maxTransPtr = maxMsgSize; } if (configPtr != NULL) { *configPtr = retConf; } ret = 1; } } Done: if (majStatPtr != NULL) { *majStatPtr = majStat; } if (minStatPtr != NULL) { *minStatPtr = minStat; } return ret; } static gfarmSecSession * allocSecSession(which) int which; { gfarmSecSession *ret; GFARM_MALLOC(ret); if (ret == NULL) { gflog_debug(GFARM_MSG_1000816, "allocation of gfarmSecSession failed"); return NULL; } (void)memset((void *)ret, 0, sizeof(gfarmSecSession)); switch (which) { case GFARM_SS_INITIATOR: { ret->iOaInfo.initiator.acceptorName = GSS_C_NO_NAME; break; } case GFARM_SS_ACCEPTOR: { ret->iOaInfo.acceptor.initiatorName = GSS_C_NO_NAME; ret->iOaInfo.acceptor.deleCred = GSS_C_NO_CREDENTIAL; break; } default: { (void)free(ret); ret = NULL; gflog_debug(GFARM_MSG_1000817, "Invalid session type (%d)", which); return NULL; } } ret->iOa = which; ret->cred = GSS_C_NO_CREDENTIAL; ret->sCtx = GSS_C_NO_CONTEXT; ret->gssLastStat = GSS_S_COMPLETE; return ret; } static void destroySecSession(ssPtr) gfarmSecSession *ssPtr; { if (ssPtr != NULL) { OM_uint32 minStat; if (ssPtr->peerName != NULL) { (void)free(ssPtr->peerName); } switch (ssPtr->iOa) { case GFARM_SS_INITIATOR: { if (ssPtr->iOaInfo.initiator.acceptorName != GSS_C_NO_NAME) { gfarmGssDeleteName(&ssPtr->iOaInfo.initiator.acceptorName, NULL, NULL); } break; } case GFARM_SS_ACCEPTOR: { if (ssPtr->iOaInfo.acceptor.initiatorName != GSS_C_NO_NAME) { gfarmGssDeleteName(&ssPtr->iOaInfo.acceptor.initiatorName, NULL, NULL); } if (ssPtr->iOaInfo.acceptor.deleCred != GSS_C_NO_CREDENTIAL) { (void)gss_release_cred(&minStat, &(ssPtr->iOaInfo.acceptor.deleCred)); } if (ssPtr->iOaInfo.acceptor.mappedUser != NULL) { /* * ssPtr->iOaInfo.acceptor.mappedUser may be NULL, * if gfarmSecSessionAccept() aborts during initialization. */ ssPtr->iOaInfo.acceptor.mappedUser->sesRefCount--; if (ssPtr->iOaInfo.acceptor.mappedUser->sesRefCount < 0) { ssPtr->iOaInfo.acceptor.mappedUser->sesRefCount = 0; } if (ssPtr->iOaInfo.acceptor.mappedUser->sesRefCount == 0 && ssPtr->iOaInfo.acceptor.mappedUser->orphaned == 1) { gfarmAuthDestroyUserEntry(ssPtr->iOaInfo.acceptor.mappedUser); } } break; } default: { break; } } if (ssPtr->sCtx != GSS_C_NO_CONTEXT) { (void)gss_delete_sec_context(&minStat, &(ssPtr->sCtx), GSS_C_NO_BUFFER); } if (ssPtr->needClose == 1) { (void)close(ssPtr->fd); } (void)free(ssPtr); } } char ** gfarmSecSessionCrackStatus(ssPtr) gfarmSecSession *ssPtr; { return gfarmGssCrackMajorStatus(ssPtr->gssLastStat); } void gfarmSecSessionFreeCrackedStatus(strPtr) char **strPtr; { gfarmGssFreeCrackedStatus(strPtr); } void gfarmSecSessionPrintStatus(ssPtr) gfarmSecSession *ssPtr; { gfarmGssPrintMajorStatus(ssPtr->gssLastStat); } int gfarmSecSessionInitializeAcceptor(configFile, usermapFile, majStatPtr, minStatPtr) char *configFile; char *usermapFile; OM_uint32 *majStatPtr; OM_uint32 *minStatPtr; { int ret = 1; OM_uint32 majStat = GSS_S_COMPLETE; OM_uint32 minStat = GSS_S_COMPLETE; static const char diag[] = "gfarmSecSessionInitializeAcceptor()"; gfarm_mutex_lock(&acceptor_mutex, diag, acceptorDiag); if (acceptorInitialized == 0) { char confFile[PATH_MAX]; /* * Get a credential. */ if (acceptorInitialCred == GSS_C_NO_CREDENTIAL) { if (gfarmGssAcquireCredential(&acceptorInitialCred, GSS_C_NO_NAME, GSS_C_ACCEPT, &majStat, &minStat, NULL) < 0) { /* * This initial credential is just a default credential, * which may be used by gfarmSecSessionAccept() when * GSS_C_NO_CREDENTIAL is specified. */ } } /* * Read config file. */ if (configFile == NULL || configFile[0] == '\0') { char *confDir = gfarmGetEtcDir(); if (confDir == NULL) { gflog_auth_error(GFARM_MSG_1000666, "gfarmSecSessionInitializeAcceptor(): " "cannot access configuration directory"); goto SkipReadConfFile; } #ifdef HAVE_SNPRINTF snprintf(confFile, sizeof confFile, "%s/%s", confDir, GFARM_DEFAULT_ACCEPTOR_CONFIG_FILE); #else sprintf(confFile, "%s/%s", confDir, GFARM_DEFAULT_ACCEPTOR_CONFIG_FILE); #endif (void)free(confDir); configFile = confFile; } if (secSessionReadConfigFile(configFile, &acceptorSsOpt) < 0) { majStat = GSS_S_FAILURE; minStat = GFSL_DEFAULT_MINOR_ERROR; ret = -1; gflog_debug(GFARM_MSG_1000818, "failed to read config file (%s)", configFile); goto Done; } SkipReadConfFile: /* * Authorization init. */ if (gfarmAuthInitialize(usermapFile) < 0) { majStat = GSS_S_FAILURE; minStat = GFSL_DEFAULT_MINOR_ERROR; ret = -1; gflog_debug(GFARM_MSG_1000819, "gfarmAuthInitialize(%s) failed", usermapFile); goto Done; } Done: if (ret == -1) { if (acceptorInitialCred != GSS_C_NO_CREDENTIAL) { OM_uint32 minStat; (void)gss_release_cred(&minStat, &acceptorInitialCred); acceptorInitialCred = GSS_C_NO_CREDENTIAL; } } else { acceptorInitialized = 1; } } gfarm_mutex_unlock(&acceptor_mutex, diag, acceptorDiag); if (majStatPtr != NULL) { *majStatPtr = majStat; } if (minStatPtr != NULL) { *minStatPtr = minStat; } return ret; } int gfarmSecSessionGetInitiatorInitialCredential(credPtr) gss_cred_id_t *credPtr; { int initiator_Initialized; static const char diag[] = "gfarmSecSessionGetInitiatorInitialCredential()"; gfarm_mutex_lock(&initiator_mutex, diag, initiatorDiag); *credPtr = initiatorInitialCred; initiator_Initialized = initiatorInitialized ? 1 : -1; gfarm_mutex_unlock(&initiator_mutex, diag, initiatorDiag); return initiator_Initialized; } int gfarmSecSessionInitializeInitiator(configFile, usermapFile, majStatPtr, minStatPtr) char *configFile; char *usermapFile; OM_uint32 *majStatPtr; OM_uint32 *minStatPtr; { int ret = 1; OM_uint32 majStat = GSS_S_COMPLETE; OM_uint32 minStat = GSS_S_COMPLETE; static const char diag[] = "gfarmSecSessionInitializeInitiator()"; gfarm_mutex_lock(&initiator_mutex, diag, initiatorDiag); if (initiatorInitialized == 0) { char confFile[PATH_MAX]; /* * Get a credential. */ if (initiatorInitialCred == GSS_C_NO_CREDENTIAL) { if (gfarmGssAcquireCredential(&initiatorInitialCred, GSS_C_NO_NAME, GSS_C_INITIATE, &majStat, &minStat, NULL) < 0) { /* * This initial credential is just a default credential, * which may be used by gfarmSecSessionInitiate() when * GSS_C_NO_CREDENTIAL is specified. */ } } /* * Read config file. */ if (configFile == NULL || configFile[0] == '\0') { char *confDir = gfarmGetEtcDir(); if (confDir == NULL) { gflog_auth_error(GFARM_MSG_1000667, "gfarmSecSessionInitializeInitiator(): " "cannot access configuration directory"); goto SkipReadConfFile; } #ifdef HAVE_SNPRINTF snprintf(confFile, sizeof confFile, "%s/%s", confDir, GFARM_DEFAULT_INITIATOR_CONFIG_FILE); #else sprintf(confFile, "%s/%s", confDir, GFARM_DEFAULT_INITIATOR_CONFIG_FILE); #endif (void)free(confDir); configFile = confFile; } if (secSessionReadConfigFile(configFile, &initiatorSsOpt) < 0) { majStat = GSS_S_FAILURE; minStat = GFSL_DEFAULT_MINOR_ERROR; ret = -1; gflog_debug(GFARM_MSG_1000820, "failed to read config file (%s)", configFile); goto Done; } SkipReadConfFile: #if GFARM_FAKE_GSS_C_NT_USER_NAME_FOR_GLOBUS /* * If GFARM_FAKE_GSS_C_NT_USER_NAME_FOR_GLOBUS is true, * this information is need to initiate a conneciton to * an acceptor which name is GSS_C_NT_USER_NAME. */ /* * Authorization init. * It isn't fatal for an initiator, if this fails. */ (void)gfarmAuthInitialize(usermapFile); #endif /* GFARM_FAKE_GSS_C_NT_USER_NAME_FOR_GLOBUS */ Done: if (ret == -1) { if (initiatorInitialCred != GSS_C_NO_CREDENTIAL) { OM_uint32 minStat; (void)gss_release_cred(&minStat, &initiatorInitialCred); initiatorInitialCred = GSS_C_NO_CREDENTIAL; } } else { initiatorInitialized = 1; } } gfarm_mutex_unlock(&initiator_mutex, diag, initiatorDiag); if (majStatPtr != NULL) { *majStatPtr = majStat; } if (minStatPtr != NULL) { *minStatPtr = minStat; } return ret; } int gfarmSecSessionInitializeBoth(iConfigFile, aConfigFile, usermapFile, majStatPtr, minStatPtr) char *iConfigFile; char *aConfigFile; char *usermapFile; OM_uint32 *majStatPtr; OM_uint32 *minStatPtr; { int ret = 1; OM_uint32 majStat = GSS_S_COMPLETE; OM_uint32 minStat = GSS_S_COMPLETE; static const char diag[] = "gfarmSecSessionInitializeBoth()"; /* * If the process's effective user is root (getuid()==0): * acceptor: host credential (GSS_C_BOTH) * initiator: host credential (GSS_C_BOTH) * * Otherwise (uid!=0): * acceptor: user credential (GSS_C_BOTH) * initiator: user credential (GSS_C_BOTH) * * XXXXX FIXME: * This implementation depends on gssapi_ssleay of Globus. With * other GSSAPI implementation, a major change could be needed. */ gfarm_mutex_lock(&initiator_mutex, diag, initiatorDiag); gfarm_mutex_lock(&acceptor_mutex, diag, acceptorDiag); if (initiatorInitialized == 0 && acceptorInitialized == 0) { char confFile[PATH_MAX]; char *confDir = NULL; if (acceptorInitialCred == GSS_C_NO_CREDENTIAL) { if (gfarmGssAcquireCredential(&acceptorInitialCred, GSS_C_NO_NAME, GSS_C_BOTH, &majStat, &minStat, NULL) < 0) { /* * This initial credential is just a default credential, * which may be used by gfarmSecSessionAccept() when * GSS_C_NO_CREDENTIAL is specified. */ } initiatorInitialCred = acceptorInitialCred; } /* * Read config file. */ if ((aConfigFile == NULL || aConfigFile[0] == '\0') || (iConfigFile == NULL || iConfigFile[0] == '\0')) { confDir = gfarmGetEtcDir(); if (confDir == NULL) { gflog_auth_error(GFARM_MSG_1000668, "gfarmSecSessionInitializeBoth(): " "cannot access configuration directory"); goto SkipReadConfFile; } } /* * Acceptor's configuration */ if (aConfigFile == NULL || aConfigFile[0] == '\0') { #ifdef HAVE_SNPRINTF snprintf(confFile, sizeof confFile, "%s/%s", confDir, GFARM_DEFAULT_ACCEPTOR_CONFIG_FILE); #else sprintf(confFile, "%s/%s", confDir, GFARM_DEFAULT_ACCEPTOR_CONFIG_FILE); #endif aConfigFile = confFile; } if (secSessionReadConfigFile(aConfigFile, &acceptorSsOpt) < 0) { majStat = GSS_S_FAILURE; minStat = GFSL_DEFAULT_MINOR_ERROR; ret = -1; gflog_debug(GFARM_MSG_1000821, "failed to read acceptor's config file (%s)", aConfigFile); goto Done; } /* * Initiator's configuration */ if (iConfigFile == NULL || iConfigFile[0] == '\0') { #ifdef HAVE_SNPRINTF snprintf(confFile, sizeof confFile, "%s/%s", confDir, GFARM_DEFAULT_INITIATOR_CONFIG_FILE); #else sprintf(confFile, "%s/%s", confDir, GFARM_DEFAULT_INITIATOR_CONFIG_FILE); #endif iConfigFile = confFile; } if (secSessionReadConfigFile(iConfigFile, &initiatorSsOpt) < 0) { majStat = GSS_S_FAILURE; minStat = GFSL_DEFAULT_MINOR_ERROR; ret = -1; gflog_debug(GFARM_MSG_1000822, "failed to read initiator's config file (%s)", iConfigFile); goto Done; } SkipReadConfFile: /* * Authorization init. */ if (gfarmAuthInitialize(usermapFile) < 0) { majStat = GSS_S_FAILURE; minStat = GFSL_DEFAULT_MINOR_ERROR; ret = -1; gflog_debug(GFARM_MSG_1000823, "gfarmAuthInitialize(%s) failed", usermapFile); goto Done; } Done: if (confDir != NULL) { (void)free(confDir); } if (ret == -1) { if (acceptorInitialCred != GSS_C_NO_CREDENTIAL) { gfarmGssDeleteCredential(&acceptorInitialCred, NULL, NULL); acceptorInitialCred = GSS_C_NO_CREDENTIAL; } initiatorInitialCred = GSS_C_NO_CREDENTIAL; } else { initiatorInitialized = 1; acceptorInitialized = 1; } } gfarm_mutex_unlock(&acceptor_mutex, diag, acceptorDiag); gfarm_mutex_unlock(&initiator_mutex, diag, initiatorDiag); if (majStatPtr != NULL) { *majStatPtr = majStat; } if (minStatPtr != NULL) { *minStatPtr = minStat; } return ret; } void gfarmSecSessionFinalizeInitiator() { static const char diag[] = "gfarmSecSessionFinalizeInitiator()"; gfarm_mutex_lock(&initiator_mutex, diag, initiatorDiag); if (initiatorInitialized == 1) { if (initiatorInitialCred != GSS_C_NO_CREDENTIAL) { gfarmGssDeleteCredential(&initiatorInitialCred, NULL, NULL); initiatorInitialCred = GSS_C_NO_CREDENTIAL; } initiatorInitialized = 0; } gfarm_mutex_unlock(&initiator_mutex, diag, initiatorDiag); } void gfarmSecSessionFinalizeAcceptor() { static const char diag[] = "gfarmSecSessionFinalizeAcceptor()"; gfarm_mutex_lock(&acceptor_mutex, diag, acceptorDiag); if (acceptorInitialized == 1) { if (acceptorInitialCred != GSS_C_NO_CREDENTIAL) { gfarmGssDeleteCredential(&acceptorInitialCred, NULL, NULL); acceptorInitialCred = GSS_C_NO_CREDENTIAL; } gfarmAuthFinalize(); acceptorInitialized = 0; } gfarm_mutex_unlock(&acceptor_mutex, diag, acceptorDiag); } void gfarmSecSessionFinalizeBoth() { static const char diag[] = "gfarmSecSessionFinalizeBoth()"; gfarm_mutex_lock(&initiator_mutex, diag, initiatorDiag); gfarm_mutex_lock(&acceptor_mutex, diag, acceptorDiag); if (initiatorInitialized == 1 && acceptorInitialized == 1) { if (acceptorInitialCred != GSS_C_NO_CREDENTIAL) { gfarmGssDeleteCredential(&acceptorInitialCred, NULL, NULL); acceptorInitialCred = GSS_C_NO_CREDENTIAL; } initiatorInitialCred = GSS_C_NO_CREDENTIAL; gfarmAuthFinalize(); acceptorInitialized = 0; initiatorInitialized = 0; } gfarm_mutex_unlock(&acceptor_mutex, diag, acceptorDiag); gfarm_mutex_unlock(&initiator_mutex, diag, initiatorDiag); } gfarmSecSession * gfarmSecSessionAccept(fd, cred, ssOptPtr, majStatPtr, minStatPtr) int fd; gss_cred_id_t cred; gfarmSecSessionOption *ssOptPtr; OM_uint32 *majStatPtr; OM_uint32 *minStatPtr; { gfarmSecSession *ret = NULL; gfarmSecSessionOption canOpt = GFARM_SS_DEFAULT_OPTION; gfarmAuthEntry *entry = NULL; int rPort = 0; char *peerName = NULL; OM_uint32 majStat = GSS_S_FAILURE; OM_uint32 minStat = GFSL_DEFAULT_MINOR_ERROR; gss_ctx_id_t sCtx = GSS_C_NO_CONTEXT; gss_name_t initiatorName = GSS_C_NO_NAME; gss_OID initiatorNameType; char *initiatorDistName = NULL; gss_cred_id_t deleCred = GSS_C_NO_CREDENTIAL; gfarm_int32_t acknack = GFARM_SS_AUTH_NACK; gss_qop_t qOp; unsigned int maxTransSize; unsigned int config; static const char diag[] = "gfarmSecSessionAccept()"; gfarm_mutex_lock(&acceptor_mutex, diag, acceptorDiag); if (acceptorInitialized == 0) { gfarm_mutex_unlock(&acceptor_mutex, diag, acceptorDiag); gflog_auth_error(GFARM_MSG_1000669, "gfarmSecSessionAccept(): not initialized"); goto Fail; } ret = allocSecSession(GFARM_SS_ACCEPTOR); if (ret == NULL) { gfarm_mutex_unlock(&acceptor_mutex, diag, acceptorDiag); gflog_auth_error(GFARM_MSG_1000670, "gfarmSecSessionAccept(): no memory"); goto Fail; } if (canonicSecSessionOpt(GFARM_SS_ACCEPTOR, ssOptPtr, &canOpt) < 0) { gfarm_mutex_unlock(&acceptor_mutex, diag, acceptorDiag); gflog_debug(GFARM_MSG_1000824, "canonicSecSessionOpt() failed"); goto Fail; } /* * Get a peer information. */ if (gfarmGetPeernameOfSocket(fd, &rPort, &peerName)) { gfarm_mutex_unlock(&acceptor_mutex, diag, acceptorDiag); gflog_debug(GFARM_MSG_1000825, "gfarmGetPeernameOfSocket() failed"); goto Fail; } /* * Check the credential. */ if (cred == GSS_C_NO_CREDENTIAL) { cred = acceptorInitialCred; } gfarm_mutex_unlock(&acceptor_mutex, diag, acceptorDiag); /* * Phase 1: Accept a security context. */ if (gfarmGssAcceptSecurityContext(fd, cred, &sCtx, &majStat, &minStat, &initiatorName, &deleCred) < 0) { gflog_debug(GFARM_MSG_1000826, "gfarmGssAcceptSecurityContext failed(%u)(%u)", majStat, minStat); goto Fail; } if (initiatorName == GSS_C_NO_NAME || (initiatorDistName = gfarmGssNewDisplayName(initiatorName, &majStat, &minStat, &initiatorNameType)) == NULL || initiatorDistName[0] == '\0' || initiatorNameType == GSS_C_NT_ANONYMOUS) { gflog_auth_error(GFARM_MSG_1000671, "gfarmSecSessionAccept(): no DN from initiator"); majStat = GSS_S_UNAUTHORIZED; goto Fail; } /* * Phase 2: Authorization and send ACK/NACK */ entry = gfarmAuthGetUserEntry(initiatorDistName); if (entry == NULL) { gflog_auth_error(GFARM_MSG_1000672, "%s: not registered in mapfile", initiatorDistName); majStat = GSS_S_UNAUTHORIZED; /* Send NACK. */ acknack = GFARM_SS_AUTH_NACK; (void)gfarmWriteInt32(fd, &acknack, 1); goto Fail; } else { int type = gfarmAuthGetAuthEntryType(entry); if (type == GFARM_AUTH_USER) { /* Send ACK. */ acknack = GFARM_SS_AUTH_ACK; (void)gfarmWriteInt32(fd, &acknack, 1); } else if (type == GFARM_AUTH_HOST) { /* check peer name is actually allowed */ if (strcmp(peerName, entry->authData.hostAuth.FQDN) == 0) { /* Send ACK. */ acknack = GFARM_SS_AUTH_ACK; (void)gfarmWriteInt32(fd, &acknack, 1); } else { gflog_auth_error(GFARM_MSG_1000673, "%s: hostname doesn't match: " "peer %s, expected %s", initiatorDistName, peerName, entry->authData.hostAuth.FQDN); majStat = GSS_S_UNAUTHORIZED; /* Send NACK. */ acknack = GFARM_SS_AUTH_NACK; (void)gfarmWriteInt32(fd, &acknack, 1); goto Fail; } } } /* * Phase 3: Negotiate configuration parameters * with the initiator. */ if (negotiateConfigParam(fd, sCtx, GFARM_SS_ACCEPTOR, &canOpt, &qOp, &maxTransSize, &config, &majStat, &minStat) < 0) { gflog_debug(GFARM_MSG_1000827, "negotiateConfigParam() failed (%u)(%u)", majStat, minStat); goto Fail; } #if 0 fprintf(stderr, "Acceptor config:\n"); dumpConfParam(qOp, maxTransSize, config); #endif /* * Success: Fill all members of session struct out. */ ret->fd = fd; ret->rPort = rPort; ret->peerName = peerName; ret->cred = cred; ret->sCtx = sCtx; ret->iOa = GFARM_SS_ACCEPTOR; ret->iOaInfo.acceptor.mappedUser = entry; ret->iOaInfo.acceptor.mappedUser->sesRefCount++; ret->iOaInfo.acceptor.initiatorName = initiatorName; ret->iOaInfo.acceptor.deleCred = deleCred; ret->qOp = qOp; ret->maxTransSize = maxTransSize; ret->config = config; ret->gssLastStat = majStat; goto Done; Fail: if (ret != NULL) { destroySecSession(ret); ret = NULL; } if (peerName != NULL) { free(peerName); } if (sCtx != GSS_C_NO_CONTEXT) { gfarmGssDeleteSecurityContext(&sCtx); } if (initiatorName != GSS_C_NO_NAME) { gfarmGssDeleteName(&initiatorName, NULL, NULL); } if (deleCred != GSS_C_NO_CREDENTIAL) { gfarmGssDeleteCredential(&deleCred, NULL, NULL); } Done: if (initiatorDistName != NULL) { (void)free(initiatorDistName); } if (majStatPtr != NULL) { *majStatPtr = majStat; } if (minStatPtr != NULL) { *minStatPtr = minStat; } return ret; } static gfarmSecSession * secSessionInitiate(fd, acceptorName, cred, reqFlag, ssOptPtr, majStatPtr, minStatPtr, needClose) int fd; const gss_name_t acceptorName; gss_cred_id_t cred; OM_uint32 reqFlag; gfarmSecSessionOption *ssOptPtr; OM_uint32 *majStatPtr; OM_uint32 *minStatPtr; int needClose; { gfarmSecSession *ret = NULL; gfarmSecSessionOption canOpt = GFARM_SS_DEFAULT_OPTION; int rPort = 0; char *peerName = NULL; OM_uint32 majStat = GSS_S_FAILURE; OM_uint32 minStat = GFSL_DEFAULT_MINOR_ERROR; gss_ctx_id_t sCtx = GSS_C_NO_CONTEXT; gss_name_t acceptorNameResult = GSS_C_NO_NAME; char *acceptorDistName = NULL; gss_OID acceptorNameType = GSS_C_NO_OID; gfarm_int32_t acknack = GFARM_SS_AUTH_NACK; gss_qop_t qOp; unsigned int maxTransSize; unsigned int config; static const char diag[] = "gfsl/secSessionInitiate()"; gfarm_mutex_lock(&initiator_mutex, diag, initiatorDiag); if (initiatorInitialized == 0) { gfarm_mutex_unlock(&initiator_mutex, diag, initiatorDiag); gflog_auth_error(GFARM_MSG_1000674, "gfarm:secSessionInitiate(): not initialized"); goto Fail; } ret = allocSecSession(GFARM_SS_INITIATOR); if (ret == NULL) { gfarm_mutex_unlock(&initiator_mutex, diag, initiatorDiag); gflog_auth_error(GFARM_MSG_1000675, "gfarm:secSessionInitiate(): no memory"); goto Fail; } if (canonicSecSessionOpt(GFARM_SS_INITIATOR, ssOptPtr, &canOpt) < 0) { gfarm_mutex_unlock(&initiator_mutex, diag, initiatorDiag); gflog_debug(GFARM_MSG_1000828, "canonicSecSessionOpt() failed"); goto Fail; } /* * Get a peer information. */ if (gfarmGetPeernameOfSocket(fd, &rPort, &peerName)) { gfarm_mutex_unlock(&initiator_mutex, diag, initiatorDiag); gflog_debug(GFARM_MSG_1000829, "gfarmGetPeernameOfSocket() failed"); goto Fail; } /* * Check the credential. */ if (cred == GSS_C_NO_CREDENTIAL) { cred = initiatorInitialCred; } gfarm_mutex_unlock(&initiator_mutex, diag, initiatorDiag); /* * Phase 1: Initiate a security context. */ if (gfarmGssInitiateSecurityContext(fd, acceptorName, cred, reqFlag, &sCtx, &majStat, &minStat, &acceptorNameResult) < 0) { gflog_debug(GFARM_MSG_1000830, "gfarmGssInitiateSecurityContext() failed (%u)(%u)", majStat, minStat); goto Fail; } if (acceptorNameResult == GSS_C_NO_NAME || (acceptorDistName = gfarmGssNewDisplayName(acceptorNameResult, &majStat, &minStat, &acceptorNameType)) == NULL || acceptorDistName[0] == '\0' || acceptorNameType == GSS_C_NT_ANONYMOUS) { gflog_auth_error(GFARM_MSG_1000676, "gfarm:secSessionInitiate(): no DN from acceptor"); majStat = GSS_S_UNAUTHORIZED; goto Fail; } /* * Phase 2: Receive authorization acknowledgement. */ if (gfarmReadInt32(fd, &acknack, 1) != 1) { gflog_auth_error(GFARM_MSG_1000677, "%s: acceptor does not answer authentication result", acceptorDistName); majStat = GSS_S_UNAUTHORIZED; goto Fail; } if (acknack == GFARM_SS_AUTH_NACK) { gflog_auth_error(GFARM_MSG_1000678, "%s: session refused by acceptor", acceptorDistName); majStat = GSS_S_UNAUTHORIZED; goto Fail; } /* * Phase 3: Negotiate configuration parameters * with the acceptor. */ if (negotiateConfigParam(fd, sCtx, GFARM_SS_INITIATOR, &canOpt, &qOp, &maxTransSize, &config, &majStat, &minStat) < 0) { gflog_debug(GFARM_MSG_1000831, "negotiateConfigParam() failed (%u)(%u)", majStat, minStat); goto Fail; } #if 0 fprintf(stderr, "Initiator config:\n"); dumpConfParam(qOp, maxTransSize, config); #endif /* * Success: Fill all members of session struct out. */ ret->fd = fd; ret->needClose = needClose; ret->rPort = rPort; ret->peerName = peerName; ret->cred = cred; ret->sCtx = sCtx; ret->iOa = GFARM_SS_INITIATOR; ret->iOaInfo.initiator.reqFlag = reqFlag; ret->iOaInfo.initiator.acceptorName = acceptorNameResult; ret->qOp = qOp; ret->maxTransSize = maxTransSize; ret->config = config; ret->gssLastStat = majStat; goto Done; Fail: if (ret != NULL) { destroySecSession(ret); ret = NULL; } if (peerName != NULL) { free(peerName); } if (sCtx != GSS_C_NO_CONTEXT) { gfarmGssDeleteSecurityContext(&sCtx); } if (acceptorNameResult != GSS_C_NO_NAME) { gfarmGssDeleteName(&acceptorNameResult, NULL, NULL); } Done: if (acceptorDistName != NULL) { (void)free(acceptorDistName); } if (majStatPtr != NULL) { *majStatPtr = majStat; } if (minStatPtr != NULL) { *minStatPtr = minStat; } return ret; } gfarmSecSession * gfarmSecSessionInitiate(fd, acceptorName, cred, reqFlag, ssOptPtr, majStatPtr, minStatPtr) int fd; const gss_name_t acceptorName; gss_cred_id_t cred; OM_uint32 reqFlag; gfarmSecSessionOption *ssOptPtr; OM_uint32 *majStatPtr; OM_uint32 *minStatPtr; { return secSessionInitiate(fd, acceptorName, cred, reqFlag, ssOptPtr, majStatPtr, minStatPtr, 0); } gfarmSecSession * gfarmSecSessionInitiateByName(hostname, port, acceptorName, cred, reqFlag, ssOptPtr, majStatPtr, minStatPtr) char *hostname; int port; const gss_name_t acceptorName; gss_cred_id_t cred; OM_uint32 reqFlag; gfarmSecSessionOption *ssOptPtr; OM_uint32 *majStatPtr; OM_uint32 *minStatPtr; { int fd = gfarmTCPConnectPortByHost(hostname, port); if (fd < 0) { if (majStatPtr != NULL) { *majStatPtr = GSS_S_FAILURE; } if (minStatPtr != NULL) { *minStatPtr = GFSL_DEFAULT_MINOR_ERROR; } gflog_debug(GFARM_MSG_1000832, "gfarmTCPConnectPortByHost(%s:%d) failed", hostname, port); return NULL; } return secSessionInitiate(fd, acceptorName, cred, reqFlag, ssOptPtr, majStatPtr, minStatPtr, 1); } void gfarmSecSessionTerminate(ssPtr) gfarmSecSession *ssPtr; { destroySecSession(ssPtr); } gss_cred_id_t gfarmSecSessionGetDelegatedCredential(ssPtr) gfarmSecSession *ssPtr; { if (ssPtr->iOa == GFARM_SS_INITIATOR) { return GSS_C_NO_CREDENTIAL; } return ssPtr->iOaInfo.acceptor.deleCred; } int gfarmSecSessionGetInitiatorName(ssPtr, namePtr) gfarmSecSession *ssPtr; gss_name_t *namePtr; { if (ssPtr->iOa == GFARM_SS_INITIATOR) { return -1; } *namePtr = ssPtr->iOaInfo.acceptor.initiatorName; return 1; } gfarmAuthEntry * gfarmSecSessionGetInitiatorInfo(ssPtr) gfarmSecSession *ssPtr; { if (ssPtr->iOa == GFARM_SS_INITIATOR) { return NULL; } return ssPtr->iOaInfo.acceptor.mappedUser; } int gfarmSecSessionDedicate(ssPtr) gfarmSecSession *ssPtr; { int ret = -1; gfarmAuthEntry *aePtr = gfarmSecSessionGetInitiatorInfo(ssPtr); if (aePtr != NULL) { gid_t gid = getgid(); uid_t uid = getuid(); #if ! GFARM_FAKE_GSS_C_NT_USER_NAME_FOR_GLOBUS /* * If GFARM_FAKE_GSS_C_NT_USER_NAME_FOR_GLOBUS is true, * this information is need to initiate a conneciton to * an acceptor which name is GSS_C_NT_USER_NAME. */ gfarmAuthMakeThisAlone(aePtr); #endif /* ! GFARM_FAKE_GSS_C_NT_USER_NAME_FOR_GLOBUS */ if (uid == 0 && aePtr->authType == GFARM_AUTH_USER) { if (aePtr->authData.userAuth.gid != gid) { if ((ret = setgid(aePtr->authData.userAuth.gid)) < 0) { ssPtr->gssLastStat = GSS_S_FAILURE; gflog_debug(GFARM_MSG_1000833, "setgid() failed"); goto Done; } } if (aePtr->authData.userAuth.uid != uid) { if ((ret = setuid(aePtr->authData.userAuth.uid)) < 0) { ssPtr->gssLastStat = GSS_S_FAILURE; gflog_debug(GFARM_MSG_1000834, "setuid() failed"); goto Done; } } } ret = 1; } else { ssPtr->gssLastStat = GSS_S_FAILURE; gflog_debug(GFARM_MSG_1000835, "gfarmAuthEntry is NULL"); } Done: return ret; } int gfarmSecSessionSendInt8(ssPtr, buf, n) gfarmSecSession *ssPtr; gfarm_int8_t *buf; int n; { int doEncrypt = GFARM_GSS_ENCRYPTION_ENABLED & (isBitSet(ssPtr->config, GFARM_SS_USE_ENCRYPTION) ? 1 : 0); return gfarmGssSend(ssPtr->fd, ssPtr->sCtx, doEncrypt, ssPtr->qOp, buf, n, ssPtr->maxTransSize, &(ssPtr->gssLastStat)); } int gfarmSecSessionReceiveInt8(ssPtr, bufPtr, lenPtr) gfarmSecSession *ssPtr; gfarm_int8_t **bufPtr; int *lenPtr; { return gfarmGssReceive(ssPtr->fd, ssPtr->sCtx, bufPtr, lenPtr, &(ssPtr->gssLastStat)); } int gfarmSecSessionSendInt32(ssPtr, buf, n) gfarmSecSession *ssPtr; gfarm_int32_t *buf; int n; { gfarm_int32_t *lBuf; int i; int ret = -1; GFARM_MALLOC_ARRAY(lBuf, n); if (lBuf == NULL) { ssPtr->gssLastStat = GSS_S_FAILURE; gflog_debug(GFARM_MSG_1000836, "allocation of buffer failed"); return ret; } for (i = 0; i < n; i++) { lBuf[i] = htonl(buf[i]); } ret = gfarmSecSessionSendInt8(ssPtr, (gfarm_int8_t *)lBuf, n * GFARM_OCTETS_PER_32BIT); (void)free(lBuf); if (ret > 0) { ret /= GFARM_OCTETS_PER_32BIT; } return ret; } int gfarmSecSessionReceiveInt32(ssPtr, bufPtr, lenPtr) gfarmSecSession *ssPtr; gfarm_int32_t **bufPtr; int *lenPtr; { gfarm_int8_t *lBuf = NULL; gfarm_int8_t *lbPtr = NULL; gfarm_int32_t *retBuf = NULL; gfarm_int32_t tmp; int len = 0; int i; int n; int ret = gfarmSecSessionReceiveInt8(ssPtr, &lBuf, &len); if (ret <= 0) { goto Done; } n = len % GFARM_OCTETS_PER_32BIT; if (n != 0) { goto Done; } n = len / GFARM_OCTETS_PER_32BIT; GFARM_MALLOC_ARRAY(retBuf, n); if (retBuf == NULL) { gflog_debug(GFARM_MSG_1000837, "allocation of 'retBuf' failed"); goto Done; } lbPtr = lBuf; for (i = 0; i < n; i++) { memcpy((void *)&tmp, (void *)lbPtr, GFARM_OCTETS_PER_32BIT); retBuf[i] = ntohl(tmp); lbPtr += GFARM_OCTETS_PER_32BIT; } ret = n; if (lenPtr != NULL) { *lenPtr = n; } if (bufPtr != NULL) { *bufPtr = retBuf; } Done: if (lBuf != NULL) { (void)free(lBuf); } return ret; } int gfarmSecSessionSendInt16(ssPtr, buf, n) gfarmSecSession *ssPtr; gfarm_int16_t *buf; int n; { gfarm_int16_t *lBuf; int i; int ret = -1; GFARM_MALLOC_ARRAY(lBuf, n); if (lBuf == NULL) { ssPtr->gssLastStat = GSS_S_FAILURE; gflog_debug(GFARM_MSG_1000838, "allocation of buffer failed"); return ret; } for (i = 0; i < n; i++) { lBuf[i] = htons(buf[i]); } ret = gfarmSecSessionSendInt8(ssPtr, (gfarm_int8_t *)lBuf, n * GFARM_OCTETS_PER_16BIT); (void)free(lBuf); if (ret > 0) { ret /= GFARM_OCTETS_PER_16BIT; } return ret; } int gfarmSecSessionReceiveInt16(ssPtr, bufPtr, lenPtr) gfarmSecSession *ssPtr; gfarm_int16_t **bufPtr; int *lenPtr; { char *lBuf = NULL; char *lbPtr = NULL; gfarm_int16_t *retBuf = NULL; gfarm_int16_t tmp; int len = 0; int i; int n; int ret = gfarmSecSessionReceiveInt8(ssPtr, &lBuf, &len); if (ret <= 0) { goto Done; } n = len % GFARM_OCTETS_PER_16BIT; if (n != 0) { goto Done; } n = len / GFARM_OCTETS_PER_16BIT; GFARM_MALLOC_ARRAY(retBuf, n); if (retBuf == NULL) { gflog_debug(GFARM_MSG_1000839, "allocation of 'retBuf' failed"); goto Done; } lbPtr = lBuf; for (i = 0; i < n; i++) { memcpy((void *)&tmp, (void *)lbPtr, GFARM_OCTETS_PER_16BIT); retBuf[i] = ntohs(tmp); lbPtr += GFARM_OCTETS_PER_16BIT; } ret = n; if (lenPtr != NULL) { *lenPtr = n; } if (bufPtr != NULL) { *bufPtr = retBuf; } Done: if (lBuf != NULL) { (void)free(lBuf); } return ret; } int gfarmSecSessionPoll(ssList, n, toPtr) gfarmSecSession *ssList[]; int n; struct timeval *toPtr; { int nFds = -INT_MAX; int i; fd_set rFds; fd_set wFds; fd_set eFds; gfarmSecSession *ssPtr; int fdChk = 0; int ret; FD_ZERO(&rFds); FD_ZERO(&wFds); FD_ZERO(&eFds); for (i = 0; i < n; i++) { fdChk = 0; ssPtr = ssList[i]; if (gfarmSecSessionCheckPollReadable(ssPtr)) { FD_SET(ssPtr->fd, &rFds); fdChk++; } if (gfarmSecSessionCheckPollWritable(ssPtr)) { FD_SET(ssPtr->fd, &wFds); fdChk++; } if (gfarmSecSessionCheckPollError(ssPtr)) { FD_SET(ssPtr->fd, &eFds); fdChk++; } if (fdChk > 0) { if (nFds < ssPtr->fd) { nFds = ssPtr->fd; } } } if (nFds < 0) { return 0; } nFds++; doSel: ret = select(nFds, &rFds, &wFds, &eFds, toPtr); if (ret == 0) { for (i = 0; i < n; i++) { gfarmSecSessionClearPollEvent(ssList[i]); } } else if (ret < 0) { if (errno == EINTR) { goto doSel; } } else { for (i = 0; i < n; i++) { ssPtr = ssList[i]; gfarmSecSessionClearPollEvent(ssPtr); if (FD_ISSET(ssPtr->fd, &rFds)) { ssPtr->pollEvent |= GFARM_SS_POLL_READABLE; } if (FD_ISSET(ssPtr->fd, &wFds)) { ssPtr->pollEvent |= GFARM_SS_POLL_WRITABLE; } if (FD_ISSET(ssPtr->fd, &eFds)) { ssPtr->pollEvent |= GFARM_SS_POLL_ERROR; } } } return ret; } /* * multiplexed version of negotiateConfigParam(,, GFARM_SS_INITIATOR, ...) */ struct negotiateConfigParamInitiatorState { struct gfarm_eventqueue *q; struct gfarm_event *writable, *readable; int fd; gss_ctx_id_t sCtx; gfarmSecSessionOption *canPtr; void (*continuation)(void *); void *closure; gss_qop_t retQOP; unsigned int retMaxT; unsigned int retConf; /* results */ OM_uint32 majStat; OM_uint32 minStat; }; static void negotiateConfigParamInitiatorReceive(events, fd, closure, t) int events; int fd; void *closure; const struct timeval *t; { struct negotiateConfigParamInitiatorState *state = closure; gfarm_int32_t param[NUM_NEGO_PARAM]; if ((events & GFARM_EVENT_TIMEOUT) != 0) { assert(events == GFARM_EVENT_TIMEOUT); gflog_auth_error(GFARM_MSG_1000679, "gfarmSecSession: " "negotiateConfigParamInitiatorReceive(): timed out"); state->majStat = GSS_S_UNAVAILABLE; /* timeout */ } else { assert(events == GFARM_EVENT_READ); if (gfarmReadInt32(fd, param, NUM_NEGO_PARAM) != NUM_NEGO_PARAM) { gflog_auth_error(GFARM_MSG_1000680, "gfarmSecSession: " "negotiateConfigParamInitiatorReceive(): " "negotiation failure with the acceptor"); state->majStat = GSS_S_FAILURE; } else { state->retQOP = param[NEGO_PARAM_QOP]; state->retMaxT = param[NEGO_PARAM_MAX_TRANS_SIZE]; state->retConf = param[NEGO_PARAM_OTHER_CONFIG]; /* End of initiator side negotiation. */ } } /* finished */ if (state->continuation != NULL) (*state->continuation)(state->closure); } static void negotiateConfigParamInitiatorSend(events, fd, closure, t) int events; int fd; void *closure; const struct timeval *t; { struct negotiateConfigParamInitiatorState *state = closure; gfarmSecSessionOption *canPtr = state->canPtr; gfarm_int32_t param[NUM_NEGO_PARAM]; struct timeval timeout; int rv; param[NEGO_PARAM_QOP] = canPtr->qOpReq; param[NEGO_PARAM_QOP_FORCE] = canPtr->qOpForce; param[NEGO_PARAM_MAX_TRANS_SIZE] = canPtr->maxTransSizeReq; param[NEGO_PARAM_MAX_TRANS_SIZE_FORCE] = canPtr->maxTransSizeForce; param[NEGO_PARAM_OTHER_CONFIG] = canPtr->configReq; param[NEGO_PARAM_OTHER_CONFIG_FORCE] = canPtr->configForce; if (gfarmWriteInt32(fd, param, NUM_NEGO_PARAM) != NUM_NEGO_PARAM) { gflog_auth_error(GFARM_MSG_1000681, "gfarmSecSession:negotiateConfigParamInitiatorSend(): " "acceptor disappered"); } else { timeout.tv_sec = GFARM_GSS_AUTH_TIMEOUT; timeout.tv_usec = 0; rv = gfarm_eventqueue_add_event(state->q, state->readable, &timeout); if (rv == 0) { /* go to negotiateConfigParamInitiatorReceive() */ return; } gflog_auth_error(GFARM_MSG_1000682, "gfarmSecSession:negotiateConfigParamInitiatorSend(): %s", strerror(rv)); /* XXX convert rv to state->{majStat,minStat} */ state->majStat = GSS_S_FAILURE; } /* failure */ if (state->continuation != NULL) (*state->continuation)(state->closure); } static struct negotiateConfigParamInitiatorState * negotiateConfigParamInitiatorRequest(q, fd, sCtx, canPtr, continuation, closure, majStatPtr, minStatPtr) struct gfarm_eventqueue *q; int fd; gss_ctx_id_t sCtx; gfarmSecSessionOption *canPtr; void (*continuation)(void *); void *closure; OM_uint32 *majStatPtr; OM_uint32 *minStatPtr; { struct negotiateConfigParamInitiatorState *state = NULL; OM_uint32 majStat = GSS_S_FAILURE; OM_uint32 minStat = GFSL_DEFAULT_MINOR_ERROR; int rv; if (sCtx == GSS_C_NO_CONTEXT) { gflog_auth_error(GFARM_MSG_1000683, "gfarmSecSession: " "negotiateConfigParamInitiatorRequest(): " "no context"); } else if (GFARM_MALLOC(state) == NULL) { gflog_auth_error(GFARM_MSG_1000684, "gfarmSecSession: " "negotiateConfigParamInitiatorRequest(): " "no memory"); } else { state->writable = gfarm_fd_event_alloc( GFARM_EVENT_WRITE, fd, negotiateConfigParamInitiatorSend, state); if (state->writable == NULL) { gflog_auth_error(GFARM_MSG_1000685, "gfarmSecSession: " "negotiateConfigParamInitiatorRequest: " "no memory"); } else { /* * We cannot use two independent events (i.e. a fd_event with * GFARM_EVENT_READ flag and a timer_event) here, because * it's possible that both event handlers are called at once. */ state->readable = gfarm_fd_event_alloc( GFARM_EVENT_READ|GFARM_EVENT_TIMEOUT, fd, negotiateConfigParamInitiatorReceive, state); if (state->readable == NULL) { gflog_auth_error(GFARM_MSG_1000686, "gfarmSecSession: " "negotiateConfigParamInitiatorRequest: " "no memory"); } else { /* go to negotiateConfigParamInitiatorSend() */ rv = gfarm_eventqueue_add_event(q, state->writable, NULL); if (rv != 0) { gflog_auth_error(GFARM_MSG_1000687, "gfarmSecSession: " "negotiateConfigParamInitiatorRequest: %s", strerror(rv)); } else { state->q = q; state->fd = fd; state->sCtx = sCtx; state->canPtr = canPtr; state->continuation = continuation; state->closure = closure; state->retQOP = GFARM_GSS_DEFAULT_QOP; state->retMaxT = GFARM_GSS_DEFAULT_MAX_MESSAGE_REQUEST_SIZE; state->retConf = GFARM_SS_USE_ENCRYPTION; state->majStat = GSS_S_COMPLETE; state->minStat = GFSL_DEFAULT_MINOR_ERROR; majStat = GSS_S_COMPLETE; goto Done; } /* XXX convert rv to {majStat,minStat} */ gfarm_event_free(state->readable); } gfarm_event_free(state->writable); } free(state); state = NULL; } Done: if (majStatPtr != NULL) { *majStatPtr = majStat; } if (minStatPtr != NULL) { *minStatPtr = minStat; } return (state); } static int negotiateConfigParamInitiatorResult(state, qOpPtr, maxTransPtr, configPtr, majStatPtr, minStatPtr) struct negotiateConfigParamInitiatorState *state; gss_qop_t *qOpPtr; unsigned int *maxTransPtr; unsigned int *configPtr; OM_uint32 *majStatPtr; OM_uint32 *minStatPtr; { int ret = -1; OM_uint32 majStat = state->majStat; OM_uint32 minStat = state->minStat; if (majStat == GSS_S_COMPLETE) { unsigned int maxMsgSize; int doEncrypt = GFARM_GSS_ENCRYPTION_ENABLED & (isBitSet(state->retConf, GFARM_SS_USE_ENCRYPTION) ? 1 : 0); if (gfarmGssConfigureMessageSize(state->sCtx, doEncrypt, state->retQOP, state->retMaxT, &maxMsgSize, &majStat, &minStat) >= 0) { if (qOpPtr != NULL) { *qOpPtr = state->retQOP; } if (maxTransPtr != NULL) { *maxTransPtr = maxMsgSize; } if (configPtr != NULL) { *configPtr = state->retConf; } ret = 1; } } gfarm_event_free(state->readable); gfarm_event_free(state->writable); free(state); if (majStatPtr != NULL) { *majStatPtr = majStat; } if (minStatPtr != NULL) { *minStatPtr = minStat; } return ret; } /* * multiplexed version of secSessionInitiate() */ struct gfarmSecSessionInitiateState { /* request */ struct gfarm_eventqueue *q; int fd; gss_cred_id_t cred; void (*continuation)(void *); void *closure; int needClose; /* local variables */ gfarmSecSessionOption canOpt; int rPort; char *peerName; struct gfarm_event *readable; struct gfarmGssInitiateSecurityContextState *secCtxState; struct negotiateConfigParamInitiatorState *negoCfgState; gss_ctx_id_t sCtx; OM_uint32 reqFlag; gss_name_t acceptorNameResult; char *acceptorDistName; gss_OID acceptorNameType; gss_qop_t qOp; unsigned int maxTransSize; unsigned int config; /* results */ OM_uint32 majStat; OM_uint32 minStat; gfarmSecSession *session; }; static void secSessionInitiateCleanup(closure) void *closure; { struct gfarmSecSessionInitiateState *state = closure; if (negotiateConfigParamInitiatorResult(state->negoCfgState, &state->qOp, &state->maxTransSize, &state->config, &state->majStat, &state->minStat) >= 0) { state->majStat = GSS_S_COMPLETE; state->minStat = GFSL_DEFAULT_MINOR_ERROR; } if (state->continuation != NULL) (*state->continuation)(state->closure); } static void secSessionInitiateReceiveAuthorizationAck(events, fd, closure, t) int events; int fd; void *closure; const struct timeval *t; { struct gfarmSecSessionInitiateState *state = closure; gfarm_int32_t acknack; if ((events & GFARM_EVENT_TIMEOUT) != 0) { assert(events == GFARM_EVENT_TIMEOUT); gflog_auth_error(GFARM_MSG_1000688, "%s: gfarm:" "secSessionInitiateReceiveAuthorizationAck(): timed out", state->acceptorDistName); state->majStat = GSS_S_UNAVAILABLE; /* timeout */ } else { assert(events == GFARM_EVENT_READ); /* * Phase 2: Receive authorization acknowledgement. */ if (gfarmReadInt32(fd, &acknack, 1) != 1) { gflog_auth_error(GFARM_MSG_1000689, "%s: acceptor does not answer authentication result", state->acceptorDistName); state->majStat = GSS_S_UNAUTHORIZED; } else if (acknack == GFARM_SS_AUTH_NACK) { state->majStat = GSS_S_UNAUTHORIZED; gflog_auth_error(GFARM_MSG_1000690, "%s: session refused by acceptor", state->acceptorDistName); } else { /* * Phase 3: Negotiate configuration parameters * with the acceptor. */ state->negoCfgState = negotiateConfigParamInitiatorRequest( state->q, fd, state->sCtx, &state->canOpt, secSessionInitiateCleanup, state, &state->majStat, &state->minStat); if (state->negoCfgState != NULL) { /* * call negotiateConfigParamInitiator*(), * then go to secSessionInitiateCleanup() */ return; } } } /* failure */ if (state->continuation != NULL) (*state->continuation)(state->closure); } static void secSessionInitiateWaitAuthorizationAck(closure) void *closure; { struct gfarmSecSessionInitiateState *state = closure; struct timeval timeout; int rv; if (gfarmGssInitiateSecurityContextResult( state->secCtxState, &state->sCtx, &state->majStat, &state->minStat, &state->acceptorNameResult) >= 0) { if (state->acceptorNameResult == GSS_C_NO_NAME || (state->acceptorDistName = gfarmGssNewDisplayName(state->acceptorNameResult, &state->majStat, &state->minStat, &state->acceptorNameType)) == NULL || state->acceptorDistName[0] == '\0' || state->acceptorNameType == GSS_C_NT_ANONYMOUS) { gflog_auth_error(GFARM_MSG_1000691, "gfarm:secSessionInitiateWaitAuthorizationAck(): " "no DN from acceptor"); state->majStat = GSS_S_UNAUTHORIZED; /* failure */ } else { timeout.tv_sec = GFARM_GSS_AUTH_TIMEOUT; timeout.tv_usec = 0; rv = gfarm_eventqueue_add_event(state->q, state->readable, &timeout); if (rv == 0) { /* go to secSessionInitiateReceiveAuthorizationAck() */ return; } gflog_auth_error(GFARM_MSG_1000692, "gfarm:secSessionInitiateWaitAuthorizationAck(): %s", strerror(rv)); /* XXX convert rv to state->{majStat,minStat} */ state->majStat = GSS_S_FAILURE; } } /* failure */ if (state->continuation != NULL) (*state->continuation)(state->closure); } static struct gfarmSecSessionInitiateState * secSessionInitiateRequest(q, fd, acceptorName, cred, reqFlag, ssOptPtr, continuation, closure, majStatPtr, minStatPtr, needClose) struct gfarm_eventqueue *q; int fd; const gss_name_t acceptorName; gss_cred_id_t cred; OM_uint32 reqFlag; gfarmSecSessionOption *ssOptPtr; void (*continuation)(void *); void *closure; OM_uint32 *majStatPtr; OM_uint32 *minStatPtr; int needClose; { struct gfarmSecSessionInitiateState *state = NULL; gfarmSecSession *ret = NULL; gfarmSecSessionOption canOpt = GFARM_SS_DEFAULT_OPTION; OM_uint32 majStat = GSS_S_FAILURE; OM_uint32 minStat = GFSL_DEFAULT_MINOR_ERROR; if (initiatorInitialized == 0) { gflog_auth_error(GFARM_MSG_1000693, "gfarm:secSessionInitiateRequest(): " "not initialized"); } else if (GFARM_MALLOC(state) == NULL) { gflog_auth_error(GFARM_MSG_1000694, "gfarm:secSessionInitiateRequest(): no memory"); } else if ((ret = allocSecSession(GFARM_SS_INITIATOR)) == NULL) { gflog_auth_error(GFARM_MSG_1000695, "gfarm:secSessionInitiateRequest(): no memory"); } else if (canonicSecSessionOpt(GFARM_SS_INITIATOR, ssOptPtr, &canOpt)< 0){ /* failure */; gflog_debug(GFARM_MSG_1000840, "canonicSecSessionOpt() failed"); } else { state->q = q; state->fd = fd; state->cred = cred; state->continuation = continuation; state->closure = closure; state->needClose = needClose; state->canOpt = canOpt; state->rPort = 0; state->peerName = NULL; state->sCtx = GSS_C_NO_CONTEXT; state->reqFlag = reqFlag; state->acceptorNameResult = GSS_C_NO_NAME; state->acceptorDistName = NULL; state->majStat = GSS_S_COMPLETE; state->minStat = GFSL_DEFAULT_MINOR_ERROR; state->session = ret; /* * Get a peer information. */ (void)gfarmGetPeernameOfSocket(fd, &state->rPort, &state->peerName); /* * Check the credential. */ if (cred == GSS_C_NO_CREDENTIAL) { state->cred = initiatorInitialCred; } state->readable = gfarm_fd_event_alloc( GFARM_EVENT_READ|GFARM_EVENT_TIMEOUT, fd, secSessionInitiateReceiveAuthorizationAck, state); if (state->readable != NULL) { /* * Phase 1: Initiate a security context. */ state->secCtxState = gfarmGssInitiateSecurityContextRequest(q, fd, acceptorName, state->cred, reqFlag, secSessionInitiateWaitAuthorizationAck, state, &majStat, &minStat); if (state->secCtxState != NULL) { if (majStatPtr != NULL) { *majStatPtr = GSS_S_COMPLETE; } if (minStatPtr != NULL) { *minStatPtr = GFSL_DEFAULT_MINOR_ERROR; } return (state); /* success */ } gflog_auth_error(GFARM_MSG_1000696, "gfarm:secSessionInitiateRequest(): no memory"); majStat = GSS_S_FAILURE; minStat = GFSL_DEFAULT_MINOR_ERROR; gfarm_event_free(state->readable); } else { gflog_debug(GFARM_MSG_1000841, "gfarm_fd_event_alloc() failed"); } /* failure */ if (state->peerName != NULL) { free(state->peerName); } } if (ret != NULL) { destroySecSession(ret); } if (state != NULL) { free(state); } if (majStatPtr != NULL) { *majStatPtr = majStat; } if (minStatPtr != NULL) { *minStatPtr = minStat; } return (NULL); /* failure */ } static gfarmSecSession * secSessionInitiateResult(state, majStatPtr, minStatPtr) struct gfarmSecSessionInitiateState *state; OM_uint32 *majStatPtr; OM_uint32 *minStatPtr; { gfarmSecSession *ret = state->session; if (GSS_ERROR(state->majStat)) { if (ret != NULL) { destroySecSession(ret); ret = NULL; } if (state->peerName != NULL) { free(state->peerName); } if (state->sCtx != GSS_C_NO_CONTEXT) { gfarmGssDeleteSecurityContext(&state->sCtx); } if (state->acceptorNameResult != GSS_C_NO_NAME) { gfarmGssDeleteName(&state->acceptorNameResult, NULL, NULL); } } else { #if 0 fprintf(stderr, "Initiator config:\n"); dumpConfParam(state->qOp, state->maxTransSize, state->config); #endif /* * Success: Fill all members of session struct out. */ ret->fd = state->fd; ret->needClose = state->needClose; ret->rPort = state->rPort; ret->peerName = state->peerName; ret->cred = state->cred; ret->sCtx = state->sCtx; ret->iOa = GFARM_SS_INITIATOR; ret->iOaInfo.initiator.reqFlag = state->reqFlag; ret->iOaInfo.initiator.acceptorName = state->acceptorNameResult; ret->qOp = state->qOp; ret->maxTransSize = state->maxTransSize; ret->config = state->config; ret->gssLastStat = state->majStat; } if (state->acceptorDistName != NULL) { (void)free(state->acceptorDistName); } gfarm_event_free(state->readable); if (majStatPtr != NULL) { *majStatPtr = state->majStat; } if (minStatPtr != NULL) { *minStatPtr = state->minStat; } free(state); return (ret); } /* * multiplexed version of gfarmSecSessionInitiate() */ struct gfarmSecSessionInitiateState * gfarmSecSessionInitiateRequest(q, fd, acceptorName, cred, reqFlag, ssOptPtr, continuation, closure, majStatPtr, minStatPtr) struct gfarm_eventqueue *q; int fd; const gss_name_t acceptorName; gss_cred_id_t cred; OM_uint32 reqFlag; gfarmSecSessionOption *ssOptPtr; void (*continuation)(void *); void *closure; OM_uint32 *majStatPtr; OM_uint32 *minStatPtr; { return secSessionInitiateRequest(q, fd, acceptorName, cred, reqFlag, ssOptPtr, continuation, closure, majStatPtr, minStatPtr, 0); } gfarmSecSession * gfarmSecSessionInitiateResult(state, majStatPtr, minStatPtr) struct gfarmSecSessionInitiateState *state; OM_uint32 *majStatPtr, *minStatPtr; { return secSessionInitiateResult(state, majStatPtr, minStatPtr); } gfarm-2.4.1/lib/libgfarm/gfsl/gfarm_auth.h0000644000000000000000000000263411507222723017070 0ustar rootroot#ifndef _GFARM_AUTH_H_ #define _GFARM_AUTH_H_ /* * Authentication information struct */ typedef struct { int sesRefCount; /* Reference count (from sessions). */ int orphaned; /* 1 if this entry no longer exists in the * database and should be free'd when the * sesRefCount == 0. */ int authType; /* One of belows. */ #define GFARM_AUTH_HOST 0 #define GFARM_AUTH_USER 1 #define GFARM_AUTH_UNKNOWN -1 char *distName; /* Distinguish name for a user. Heap alloc'd. */ union { struct userAuthData { char *localName; /* Local user account name. Heap alloc'd. */ uid_t uid; gid_t gid; char *homeDir; /* Home directory. Heap alloc'd. */ char *loginShell; /* Login shell. Heap alloc'd. */ } userAuth; struct hostAuthData { char *FQDN; /* FQDN for the host. Heap alloc'd. */ } hostAuth; } authData; } gfarmAuthEntry; /* Prototypes. */ extern int gfarmAuthInitialize(char *usermapFile); extern void gfarmAuthFinalize(void); extern gfarmAuthEntry * gfarmAuthGetUserEntry(char *distUserName); extern void gfarmAuthDestroyUserEntry(gfarmAuthEntry *aePtr); extern void gfarmAuthMakeThisAlone(gfarmAuthEntry *laePtr); extern int gfarmAuthGetAuthEntryType(gfarmAuthEntry *aePtr); #if GFARM_FAKE_GSS_C_NT_USER_NAME_FOR_GLOBUS gfarmAuthEntry *gfarmAuthGetLocalUserEntry(char *localUserName); #endif /* GFARM_FAKE_GSS_C_NT_USER_NAME_FOR_GLOBUS */ #endif /* _GFARM_AUTH_H_ */ gfarm-2.4.1/lib/libgfarm/gfsl/Makefile.gt10000644000000000000000000000465611507222723016742 0ustar rootroot# # Makefile for the gss tutorial programs # # # Requires that the GLOBUS_DEVELOPMENT_PATH variables is set. This # environment variable must point to the Globus development directory # containing the flavor or libraries, etc. that you wish to use when # building this example. This environment variable should be set in # the shell prior to envoking make. The utility program # $GLOBUS_PATH/globus-development-path can be used to assist you in # determining the correct setting. For usage information type # $GLOBUS_PATH/globus-development-path -help # # For example: # # SH: # # Non-threaded: # # GLOBUS_DEVELOPMENT_PATH = `$GLOBUS_PATH/globus-development-path -nothreads` # export GLOBUS_DEVELOPMENT_PATH # # Threaded: # # GLOBUS_DEVELOPMENT_PATH = `$GLOBUS_PATH/globus-development-path -threads` # export GLOBUS_DEVELOPMENT_PATH # # CSH: # # Non-threaded: # # setenv GLOBUS_DEVELOPMENT_PATH \ # `$GLOBUS_PATH/globus-development-path -nothreads` # # Threaded: # # setenv GLOBUS_DEVELOPMENT_PATH \ # `$GLOBUS_PATH/globus-development-path -threads` # # # Read the makefile header containing build specific definitions # include $(GLOBUS_DEVELOPMENT_PATH)/etc/makefile_header # # NOTE: our application uses the COMMON and the GSSAPI modules! # #PURE = /usr/local/rational/releases/purify.sol.2001a.04.00/purify TARGETLIB = libgfsl.a CC=gcc MYCFLAGS = -Wall -g \ -I$(includedir) $(CFLAGS) \ $(GLOBUS_COMMON_CFLAGS) \ $(GLOBUS_GSSAPI_CFLAGS) MYLDFLAGS = -g \ -L$(libdir) $(LDFLAGS) \ $(GLOBUS_COMMON_LDFLAGS) \ $(GLOBUS_GSSAPI_LDFLAGS) MYLIBS = -L. -lgfsl \ $(GLOBUS_COMMON_LIBS) \ $(GLOBUS_GSSAPI_LIBS) \ $(LIBS) EXECS = server client server2 client2 LIBOBJS = gsi.o tcputil.o gfarm_hash.o auth.o session.o misc.o SCOBJS = scsub.o .c.o: $(CC) $(MYCFLAGS) -c $< all: $(TARGETLIB) $(EXECS) $(TARGETLIB): $(LIBOBJS) rm -f $@ ar clq $@ $(LIBOBJS) ranlib $@ server: server.o $(SCOBJS) $(TARGETLIB) rm -f $@ $(PURE) $(CC) $(MYCFLAGS) $(MYLDFLAGS) -o server server.o $(SCOBJS) $(MYLIBS) client: client.o $(SCOBJS) $(TARGETLIB) rm -f $@ $(PURE) $(CC) $(MYCFLAGS) $(MYLDFLAGS) -o client client.o $(SCOBJS) $(MYLIBS) server2: server2.o $(COBJS) $(TARGETLIB) rm -f $@ $(PURE) $(CC) $(MYCFLAGS) $(MYLDFLAGS) -o server2 server2.o $(MYLIBS) client2: client2.o $(COBJS) $(TARGETLIB) rm -f $@ $(PURE) $(CC) $(MYCFLAGS) $(MYLDFLAGS) -o client2 client2.o $(MYLIBS) clean: $(RM) -f $(EXECS) $(TARGETLIB) *.o *~ core *.core gfarm-2.4.1/lib/libgfarm/gfsl/Why0000644000000000000000000000203511507222723015267 0ustar rootrootExcuse: ¤É¤¦¤·¤Æ Globus ¤Î GSS_ASSIST layer and/or Globus I/O ¤¬¤¢¤ë¤Î ¤Ë¡¢GFSL ¤òºî¤Ã¤¿¤«¡£ 0. Gfarm ¤È¤·¤Æ¡¢Globus ¤Ë°Í¸¤»¤º¡¢GSSAPI ¤Ë°Í¸¤·¤¿¤«¤Ã¤¿¡£ ¥Ù¥ó¥ÀÄ󶡤ΠGSSAPI ¥é¥¤¥Ö¥é¥ê(on kerberos)Åù¤Î»ÈÍѤâ²Äǽ¤Ë¤Ê ¤ë¡£ 1. Globus I/O API ¤Î¥â¥Ç¥ë¤¬ event handler registration ·¿¤ÎÈ󯱴ü I/O ¥â¥Ç¥ë¤Ê¤Î¤Ç¡¢select(2)/poll(2) ¤Ë¤è¤ë multiple object I/O event multiplexing wait ·¿¤ÎƱ´ü I/O ¥â¥Ç¥ë¤Ë´·¤ì¤¿¥×¥í¥°¥é¥Þ¤«¤é¤ÏÂçÊÑ»È ¤¤¤Å¤é¤¤¡£¤³¤Î¤è¤¦¤Ê¥×¥í¥°¥é¥Þ¤Ë secure ¤ÊÄÌ¿®Ï©¤òÄ󶡤¹¤ë¤À¤±¤Î¤¿ ¤á¤Ë¡¢Globus I/O ¤Î»ÈÍѤò¶¯¤¤¤ë¤Î¤Ïº¤Æñ¤Ç¤¢¤ë¡£ °ìÊý¡¢GSSAPI ¤òľÀÜ¥×¥í¥°¥é¥Þ¤Ë»ÈÍѤµ¤»¤ë¤Î¤â¡¢GSSAPI ¤¬¹â¿å½à¤Ê°ì È̲½¤ò¹Í¤¨¤¿ API ¤Ç¤¢¤ë¤¿¤á¤Ë»È¤¤¾¡¼ê¤¬Èó¾ï¤Ë°­¤¯¡¢ÆÀºö¤È¤Ï¸À¤¨¤Ê¤¤¡£ Globus ¤Î GSS_ASSIST layer ¤Ï¡¢Globus I/O and/or Nexus ¤È¤ÎÍøÍѤòÁ° Äó¤Ë¡¢GSSAPI ¤ÎľÀÜ»ÈÍѤÎÉÔÊØÀ­¤ò´ËϤ¹¤ëÌÜŪ¤Ç³«È¯¤µ¤ì¤Æ¤¤¤ë¤Î¤Ç¡¢ secure ¤ÊÄÌ¿ÊÏ©¤¬»È¤¤¤¿¤¤¤¿¤á¤Ë security context ¤òÀ¸À®¤¹¤ëÌÜŪ¤Ë¤Ï »È¤¤¤Å¤é¤¤¡£ ¤½¤³¤Ç¡¢GSS_ASSIST ¤ÈƱ layer ¤Ë¤¢¤ê¤Ê¤¬¤é¡¢Globus I/O, Nexus ¤È¤Î ¶¦Æ±ÍøÍѤòÁ°Äó¤È¤·¤Ê¤¤¡¢GFSL ¤Î³«È¯¤Ë»ê¤Ã¤¿¡£ gfarm-2.4.1/lib/libgfarm/gfsl/client2.c0000644000000000000000000000611211507222723016301 0ustar rootroot#include #include #include #include #include #include #include #include #include #include #include "gfutil.h" #include "tcputil.h" #include "gfsl_config.h" #include "gfarm_gsi.h" #include "gfarm_secure_session.h" #include "misc.h" #include "scarg.h" static char *hostname = NULL; static int ParseArgs(argc, argv) int argc; char *argv[]; { int c; while ((c = getopt(argc, argv, "h:" COMMON_OPTIONS)) != -1) { switch (c) { case 'h': hostname = optarg; break; default: if (HandleCommonOptions(c, optarg) != 0) { fprintf(stderr, "HandleCommonOptions(%s) failed.\n", optarg); return -1; } break; } } if (optind < argc) { fprintf(stderr, "unknown extra argument %s\n", argv[optind]); return -1; } if (hostname == NULL) { fprintf(stderr, "hostname is not specified.\n"); return -1; } if (port == 0) { fprintf(stderr, "port # is not specified.\n"); return -1; } return 0; } int main(argc, argv) int argc; char *argv[]; { OM_uint32 majStat; OM_uint32 minStat; gfarmSecSession *ss0 = NULL; gfarmSecSession *ss1 = NULL; char buf[4096]; int z = 0; int ret = 1; int len; gflog_auth_set_verbose(1); if (gfarmSecSessionInitializeInitiator(NULL, NULL, &majStat, &minStat) <= 0) { fprintf(stderr, "can't initialize as initiator because of:\n"); gfarmGssPrintMajorStatus(majStat); gfarmGssPrintMinorStatus(minStat); goto Done; } if (ParseArgs(argc, argv) != 0) { fprintf(stderr, "parsing of argument failed.\n"); goto Done; } if (!acceptorSpecified) { if (gfarmGssImportNameOfHost(&acceptorName, hostname, &majStat, &minStat) < 0) { fprintf(stderr, "gfarmGssImportNameOfHost() failed.\n"); gfarmGssPrintMajorStatus(majStat); gfarmGssPrintMinorStatus(minStat); goto Done; } } ss0 = gfarmSecSessionInitiateByName(hostname, port, acceptorName, GSS_C_NO_CREDENTIAL, GFARM_GSS_DEFAULT_SECURITY_SETUP_FLAG, NULL, &majStat, &minStat); if (ss0 == NULL) { fprintf(stderr, "Can't initiate session 0 because of:\n"); gfarmGssPrintMajorStatus(majStat); gfarmGssPrintMinorStatus(minStat); goto Done; } ss1 = gfarmSecSessionInitiateByName(hostname, port, acceptorName, GSS_C_NO_CREDENTIAL, GFARM_GSS_DEFAULT_SECURITY_SETUP_FLAG, NULL, &majStat, &minStat); if (ss1 == NULL) { fprintf(stderr, "Can't initiate session 1 because of:\n"); gfarmGssPrintMajorStatus(majStat); gfarmGssPrintMinorStatus(minStat); goto Done; } while (fgets(buf, 4096, stdin) != NULL) { len = strlen(buf); if (buf[len - 1] == '\n') { len--; } if (z % 2 == 0) { (void)gfarmSecSessionSendInt8(ss0, buf, len); } else { (void)gfarmSecSessionSendInt8(ss1, buf, len); } z++; } ret = 0; Done: if (ss0 != NULL) { gfarmSecSessionTerminate(ss0); } if (ss1 != NULL) { gfarmSecSessionTerminate(ss1); } gfarmSecSessionFinalizeInitiator(); return ret; } gfarm-2.4.1/lib/libgfarm/gfsl/misc.c0000644000000000000000000000532111507222723015675 0ustar rootroot#include #include #include #include #include #include #include #include #include #include #include #include "gfsl_config.h" #include "gfarm_auth.h" int gfarmGetInt(char *str, int *val) { char *ePtr = NULL; int ret = -1; int t = 1; char *buf = NULL; int tmp; int base = 10; int len; int neg = 1; switch ((int)str[0]) { case '-': { neg = -1; str++; break; } case '+': { str++; break; } } if (strncmp(str, "0x", 2) == 0) { base = 16; str += 2; } buf = strdup(str); if (buf == NULL) { gflog_debug(GFARM_MSG_1000842, "strdup() failed"); return -1; } len = strlen(buf); if (len == 0) { gflog_debug(GFARM_MSG_1000843, "Buffer length is zero"); return -1; } if (base == 10) { int lC = len - 1; switch ((int)(buf[lC])) { case 'k': case 'K': { t = 1024; buf[lC] = '\0'; len--; break; } case 'm': case 'M': { t = 1024 * 1024; buf[lC] = '\0'; len--; break; } } } tmp = (int)strtol(buf, &ePtr, base); if (ePtr == (buf + len)) { ret = 1; *val = tmp * t * neg; } (void)free(buf); return ret; } int gfarmGetToken(buf, tokens, max) char *buf; char *tokens[]; int max; { int n = 0; int nonSpace = 0; int quote; while (*buf != '\0' && n < max) { while (isspace((int)*buf) && *buf != '\0') { buf++; } if (*buf == '\0') { break; } tokens[n] = buf; nonSpace = 0; spaceScan: while (!isspace((int)*buf) && *buf != '\0') { if (*buf == '\'' || *buf == '"') { char *tmp; quote = *buf; tmp = buf; searchEndQuote: tmp++; if ((tmp = strchr(tmp, quote)) != NULL) { if (*(tmp - 1) == '\\') { goto searchEndQuote; } else { buf = ++tmp; nonSpace++; goto spaceScan; } } } nonSpace++; buf++; } if (*buf == '\0') { if (nonSpace > 0) { n++; } break; } *buf = '\0'; n++; if (*(buf + 1) == '\0') { break; } else { buf++; } } return n; } char * gfarmGetEtcDir() { char buf[PATH_MAX]; char *dir = getenv(GFARM_INSTALL_DIR_ENV), *path; struct stat st; if (dir != NULL) { #ifdef HAVE_SNPRINTF snprintf(buf, sizeof buf, "%s/%s", dir, GFARM_DEFAULT_INSTALL_ETC_DIR); #else sprintf(buf, "%s/%s", dir, GFARM_DEFAULT_INSTALL_ETC_DIR); #endif path = buf; } else { path = GFARM_INSTALL_ETC_DIR; } if (stat(path, &st) == 0 && S_ISDIR(st.st_mode)) { return strdup(path); } else { gflog_debug(GFARM_MSG_1000844, "stat() failed or given path is not directory (%s)", path); } return NULL; } gfarm-2.4.1/lib/libgfarm/gfsl/gfarm-initiator.conf0000644000000000000000000000011211507222723020532 0ustar rootrootqop: force default maxtrans: 1024m force options: force encrypt compress gfarm-2.4.1/lib/libgfarm/gfsl/gfarm-usermap0000644000000000000000000000144011507222723017265 0ustar rootroot"/C=US/O=Globus/O=Electrotechnical Laboratory/CN=Yoshio Tanaka" yoshio "/C=US/O=Globus/O=Real World Computing Partnership/OU=Tsukuba Research Center/CN=Yoshio Tanaka" yoshio "/O=Grid/O=Globus/OU=trc.rwcp.or.jp/CN=Mitsuhisa Sato" msato "/O=Grid/O=Globus/OU=is.titech.ac.jp/CN=Toyotaro Suzumura" suzumura "/O=Grid/O=Globus/OU=etl.go.jp/CN=Hidemoto Nakada" nakada "/O=Grid/O=Globus/OU=etl.go.jp/CN=Masahiro KAWATO" m-kawato "/O=Grid/O=Globus/OU=hpcc.gr.jp/CN=Motonori Hirano" m-hirano "/O=Grid/O=Globus/CN=host/hpc.a02.aist.go.jp" @host@ hpc.a02.aist.go.jp "/O=Grid/O=Globus/CN=host/eldorado.a02.aist.go.jp" @host@ eldorado.a02.aist.go.jp "/O=Grid/O=Globus/OU=hpcc.gr.jp/CN=Tatebe Osamu" tatebe "/O=Grid/O=Globus/OU=apgrid.org/CN=Osamu Tatebe" tatebe "/O=Grid/O=Globus/OU=hpcc.jp/CN=Noriyuki Soda" soda gfarm-2.4.1/lib/libgfarm/gfsl/scarg.c0000644000000000000000000001011211507222723016033 0ustar rootroot#include #include #include #include #include #include #include "gfarm_gsi.h" #include "misc.h" #include "scarg.h" int port = 0; int acceptorSpecified = 0; gss_name_t acceptorName = GSS_C_NO_NAME; int HandleCommonOptions(option, arg) int option; char *arg; { int tmp; OM_uint32 majStat; OM_uint32 minStat; switch (option) { case 'p': if (gfarmGetInt(arg, &tmp) < 0) { fprintf(stderr, "illegal port number.\n"); return -1; } if (tmp <= 0) { fprintf(stderr, "port number must be > 0.\n"); return -1; } else if (tmp > 65535) { fprintf(stderr, "port number must be < 65536.\n"); return -1; } port = tmp; break; case 'H': if (gfarmGssImportName(&acceptorName, arg, strlen(arg), GSS_C_NT_HOSTBASED_SERVICE, &majStat, &minStat) < 0) { fprintf(stderr, "gfarmGssImportName(GSS_C_NT_HOSTBASED_SERVICE)" " failed.\n"); gfarmGssPrintMajorStatus(majStat); gfarmGssPrintMinorStatus(minStat); return -1; } acceptorSpecified = 1; break; case 'M': /* mechanism specific name */ if (gfarmGssImportName(&acceptorName, arg, strlen(arg), GSS_C_NO_OID, &majStat, &minStat) < 0) { fprintf(stderr, "gfarmGssImportName(GSS_C_NO_OID) failed.\n"); gfarmGssPrintMajorStatus(majStat); gfarmGssPrintMinorStatus(minStat); return -1; } acceptorSpecified = 1; break; case 'N': acceptorName = GSS_C_NO_NAME; acceptorSpecified = 1; break; case 'n': if (gfarmGssImportName(&acceptorName, arg, strlen(arg), GSS_C_NT_USER_NAME, &majStat, &minStat) < 0) { fprintf(stderr, "gfarmGssImportName(GSS_C_NT_USER_NAME)" " failed.\n"); gfarmGssPrintMajorStatus(majStat); gfarmGssPrintMinorStatus(minStat); return -1; } acceptorSpecified = 1; break; case 'U': if (gfarmGssImportName(&acceptorName, arg, strlen(arg), GSS_C_NT_STRING_UID_NAME, &majStat, &minStat) < 0) { fprintf(stderr, "gfarmGssImportName(GSS_C_NT_STRING_UID_NAME)" " failed.\n"); gfarmGssPrintMajorStatus(majStat); gfarmGssPrintMinorStatus(minStat); return -1; } acceptorSpecified = 1; break; case 'X': /* This isn't guaranteed to work */ if (gfarmGssImportName(&acceptorName, arg, strlen(arg), GSS_C_NT_EXPORT_NAME, &majStat, &minStat) < 0) { fprintf(stderr, "gfarmGssImportName(GSS_C_NT_EXPORT_NAME)" " failed.\n"); gfarmGssPrintMajorStatus(majStat); gfarmGssPrintMinorStatus(minStat); return -1; } acceptorSpecified = 1; break; case 'u': arg = getenv("USER"); if (arg == NULL) arg = getenv("LOGNAME"); if (arg == NULL) { fprintf(stderr, "neither $USER nor $LOGNAME isn't set"); return -1; } if (gfarmGssImportName(&acceptorName, arg, strlen(arg), GSS_C_NT_USER_NAME, &majStat, &minStat) < 0) { fprintf(stderr, "gfarmGssImportName(GSS_C_NT_USER_NAME)" " failed.\n"); gfarmGssPrintMajorStatus(majStat); gfarmGssPrintMinorStatus(minStat); return -1; } acceptorSpecified = 1; break; default: fprintf(stderr, "error happens at an option\n"); return -1; } return 0; } char * newStringOfName(inputName) const gss_name_t inputName; { OM_uint32 majStat, minStat; char *s = gfarmGssNewDisplayName(inputName, &majStat, &minStat, NULL); if (s != NULL) { return s; } fprintf(stderr, "cannot convert gss_name_t to display string:\n"); gfarmGssPrintMajorStatus(majStat); gfarmGssPrintMinorStatus(minStat); return strdup("(invalid gss_name_t)"); } char * newStringOfCredential(cred) gss_cred_id_t cred; { OM_uint32 majStat, minStat; gss_name_t name; char *s; if (gfarmGssNewCredentialName(&name, cred, &majStat, &minStat) > 0) { s = newStringOfName(name); gfarmGssDeleteName(&name, NULL, NULL); return s; } fprintf(stderr, "cannot convert credential to gss_name_t:\n"); gfarmGssPrintMajorStatus(majStat); gfarmGssPrintMinorStatus(minStat); return strdup("(invalid credential)"); } gfarm-2.4.1/lib/libgfarm/gfsl/tcputil.h0000644000000000000000000000144611507222723016437 0ustar rootroot#include /* for gfarm_int16_t and gfarm_int32_t */ #define GFARM_OCTETS_PER_32BIT 4 /* 32/8 */ #define GFARM_OCTETS_PER_16BIT 2 /* 16/8 */ extern int gfarmTCPConnectPortByHost(char *, int port); extern int gfarmTCPBindPort(int port); extern int gfarmGetNameOfSocket(int sock, int *portPtr); int gfarmGetPeernameOfSocket(int sock, int *portPtr, char **hostPtr); extern int gfarmWaitReadable(int fd); extern int gfarmReadInt8(int fd, gfarm_int8_t *buf, int len); extern int gfarmReadInt16(int fd, gfarm_int16_t *buf, int len); extern int gfarmReadInt32(int fd, gfarm_int32_t *buf, int len); extern int gfarmWriteInt8(int fd, gfarm_int8_t *buf, int len); extern int gfarmWriteInt16(int fd, gfarm_int16_t *buf, int len); extern int gfarmWriteInt32(int fd, gfarm_int32_t *buf, int len); gfarm-2.4.1/lib/libgfarm/gfsl/scsub.c0000644000000000000000000001401411507222723016060 0ustar rootroot#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "tcputil.h" #include "gfarm_secure_session.h" #include "gfarm_auth.h" #include "scarg.h" gfarm_int32_t testBufSize = 4096; void doServer(int fd, char *host, int port, gss_cred_id_t myCred, gss_name_t acceptorName); void doClient(char *host, int port, gss_name_t acceptorName, gss_cred_id_t deleCred, gfarm_int32_t deleCheck); void doServer(fd, hostname, port, myCred, acceptorName) int fd; char *hostname; int port; gss_cred_id_t myCred; gss_name_t acceptorName; { OM_uint32 majStat, minStat; char *rBuf = NULL; int tBufSz = -1; int n = -1; int rSz = -1; int dCheck = 0; gfarm_int32_t *tmpBuf; gfarmAuthEntry *aePtr = NULL; char *name; gfarmSecSession *initialSession = gfarmSecSessionAccept(fd, myCred, NULL, &majStat, &minStat); int x; if (initialSession == NULL) { fprintf(stderr, "Can't create acceptor session because of:\n"); gfarmGssPrintMajorStatus(majStat); gfarmGssPrintMinorStatus(minStat); goto Done; } name = newStringOfCredential(initialSession->cred); fprintf(stderr, "Accept => Acceptor: '%s'\n", name); free(name); aePtr = gfarmSecSessionGetInitiatorInfo(initialSession); fprintf(stderr, "Accept => Initiator: '%s' -> '%s'\n", aePtr->distName, (aePtr->authType == GFARM_AUTH_USER) ? aePtr->authData.userAuth.localName : aePtr->authData.hostAuth.FQDN); if (gfarmSecSessionDedicate(initialSession) < 0) { fprintf(stderr, "Can't dedicate to '%s'.\n", (aePtr->authType == GFARM_AUTH_USER) ? aePtr->authData.userAuth.localName : aePtr->authData.hostAuth.FQDN); goto Done; } /* * Now, we can communicate securely. */ x = gfarmSecSessionReceiveInt32(initialSession, &tmpBuf, &n); if (x != 1) { fprintf(stderr, "can't receive test buffer size because of:\n"); gfarmSecSessionPrintStatus(initialSession); goto Done; } tBufSz = *tmpBuf; (void)free(tmpBuf); fprintf(stderr, "Receive buffer size: %d\n", tBufSz); if (gfarmSecSessionReceiveInt8(initialSession, &rBuf, &rSz) <= 0) { fprintf(stderr, "test buffer receive failed because of:\n"); gfarmSecSessionPrintStatus(initialSession); goto Done; } if (tBufSz != rSz) { fprintf(stderr, "test buffer size differ.\n" "\tOriginal: %10d\n" "\tReplyed: %10d\n", tBufSz, rSz); goto Done; } if (gfarmSecSessionSendInt8(initialSession, rBuf, rSz) != rSz) { fprintf(stderr, "test buffer send failed because of:\n"); gfarmSecSessionPrintStatus(initialSession); goto Done; } (void)free(rBuf); if (gfarmSecSessionReceiveInt32(initialSession, &tmpBuf, &n) != 1) { fprintf(stderr, "can't receive delegation check flag because of:\n"); gfarmSecSessionPrintStatus(initialSession); goto Done; } dCheck = *tmpBuf; if (dCheck == 1) { gss_cred_id_t deleCred = gfarmSecSessionGetDelegatedCredential(initialSession); if (deleCred != GSS_C_NO_CREDENTIAL) { fprintf(stderr, "\nDelegation check.\n"); doClient(hostname, port, acceptorName, deleCred, 0); } } Done: gfarmSecSessionTerminate(initialSession); if (dCheck == 1) { gfarmSecSessionFinalizeBoth(); } return; } static void randomizeIt(char *buf, int len); static void randomizeIt(buf, len) char *buf; int len; { int i; srand(time(NULL)); for (i = 0; i < len; i++) { buf[i] = rand() % 256; } } void doClient(hostname, port, acceptorName, deleCred, deleCheck) char *hostname; int port; gss_name_t acceptorName; gss_cred_id_t deleCred; gfarm_int32_t deleCheck; { char *sBuf = NULL; char *rBuf = NULL; char *name; int rSz = -1; OM_uint32 majStat; OM_uint32 minStat; gfarmSecSession *ss = gfarmSecSessionInitiateByName(hostname, port, acceptorName, deleCred, GFARM_GSS_DEFAULT_SECURITY_SETUP_FLAG, NULL, &majStat, &minStat); if (ss == NULL) { fprintf(stderr, "Can't create initiator session because of:\n"); gfarmGssPrintMajorStatus(majStat); gfarmGssPrintMinorStatus(minStat); return; } name = newStringOfCredential(ss->cred); fprintf(stderr, "Initiate => Initiator: '%s'\n", name); free(name); name = newStringOfName(ss->iOaInfo.initiator.acceptorName); fprintf(stderr, "Initiate => Acceptor: '%s'\n", name); free(name); /* * Now, we can communicate securely. */ GFARM_MALLOC_ARRAY(sBuf, testBufSize); if (sBuf == NULL) { fprintf(stderr, "can't allocate test buffer.\n"); goto Done; } randomizeIt(sBuf, testBufSize); if (gfarmSecSessionSendInt32(ss, &testBufSize, 1) != 1) { fprintf(stderr, "can't send test buffer size because of:\n"); gfarmSecSessionPrintStatus(ss); goto Done; } fprintf(stderr, "Send buffer size: %ld\n", (long)testBufSize); if (gfarmSecSessionSendInt8(ss, sBuf, testBufSize) != testBufSize) { fprintf(stderr, "test buffer send failed because of:\n"); gfarmSecSessionPrintStatus(ss); goto Done; } if (gfarmSecSessionReceiveInt8(ss, &rBuf, &rSz) <= 0) { fprintf(stderr, "test buffer receive failed because of:\n"); gfarmSecSessionPrintStatus(ss); goto Done; } if (testBufSize != rSz) { fprintf(stderr, "test buffer size differ.\n" "\tOriginal: %10ld\n" "\tReplyed: %10d\n", (long)testBufSize, rSz); goto Done; } if (memcmp((void *)sBuf, (void *)rBuf, testBufSize) != 0) { fprintf(stderr, "test buffer check failed.\n"); goto Done; } else { fprintf(stderr, "test buffer check OK.\n"); } if (gfarmSecSessionSendInt32(ss, &deleCheck, 1) != 1) { fprintf(stderr, "can't send delegation check flag.\n"); goto Done; } Done: if (sBuf != NULL) { (void)free(sBuf); } if (rBuf != NULL) { (void)free(rBuf); } gfarmSecSessionTerminate(ss); return; } gfarm-2.4.1/lib/libgfarm/gfsl/Makefile0000644000000000000000000000467011507222723016244 0ustar rootroot# $Id: Makefile 4313 2010-01-15 02:11:59Z ookuma $ top_builddir = ../../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk ### ### variables ### CFLAGS = $(COMMON_CFLAGS) -I$(GFUTIL_SRCDIR) -I$(GFSL_SRCDIR) \ $(globus_includes) \ -DGFARM_INSTALL_ETC_DIR='"$(sysconfdir)"' \ -DGLOBUS_FAKE_GSS_C_NT_USER=0 # see gsi.c ### for library LIBRARY = libgfsl.la LIBRARY_RESULT = # do not install SRCS = gsi.c tcputil.c auth.c session.c misc.c OBJS = gsi.lo tcputil.lo auth.lo session.lo misc.lo ### for programs PURE = /usr/local/rational/releases/purify.sol.2001a.04.00/purify # LINK = $(PURE) $(CC) $(CFLAGS) # PROG_DEPLIBS = ../gfutil/.libs/libgfutil.a .libs/libgfsl.a LINK = $(LTLINK) PROGRAMS = server client server2 client2 SCOBJS = scarg.o scsub.o SCOBJS2 = scarg.o PROG_DEPLIBS = $(LIBRARY) ../gfutil/libgfutil.la PROG_LDLIBS = $(COMMON_LDFLAGS) $(PROG_DEPLIBS) \ $(globus_gssapi_libs) $(openssl_libs) $(LIBS) ### ### rules ### all: $(LIBRARY) program: $(PROGRAMS) ### for library $(OBJS): $(DEPGFSLINC) $(DEPGFARMINC) include $(top_srcdir)/makes/lib.mk include $(top_srcdir)/makes/gflog.mk # dependencies auth.lo: $(GFUTIL_SRCDIR)/hash.h $(GFUTIL_SRCDIR)/gfutil.h auth.lo: gfsl_config.h misc.h gsi.lo: $(GFUTIL_SRCDIR)/gfevent.h $(GFUTIL_SRCDIR)/gfutil.h gsi.lo: gfsl_config.h tcputil.h misc.lo: gfsl_config.h $(top_builddir)/makes/config.mk # $(GFARM_INSTALL_ETC_DIR) -> $(sysconfdir) session.lo: $(GFUTIL_SRCDIR)/gfevent.h $(GFUTIL_SRCDIR)/gfutil.h session.lo: tcputil.h misc.h tcputil.lo: $(GFUTIL_SRCDIR)/gfnetdb.h $(GFUTIL_SRCDIR)/gfutil.h tcputil.h server.o server2.o client.o client2.o: $(GFUTIL_SRCDIR)/gfutil.h \ $(INC_SRCDIR)/gfarm_misc.h tcputil.h \ gfsl_config.h gfarm_gsi.h gfarm_secure_session.h misc.h scarg.h server.o server2.o: gfarm_auth.h scarg.o: $(INC_SRCDIR)/gfarm_misc.h gfarm_gsi.h misc.h scarg.h scsub.o: gfarm_secure_session.h gfarm_auth.h scarg.h \ $(INC_SRCDIR)/gfarm_misc.h tcputil.h ### for programs server: server.o $(SCOBJS) $(PROG_DEPLIBS) rm -f $@ $(LINK) -o $@ server.o $(SCOBJS) $(PROG_LDLIBS) client: client.o $(SCOBJS) $(PROG_DEPLIBS) rm -f $@ $(LINK) -o $@ client.o $(SCOBJS) $(PROG_LDLIBS) server2: server2.o $(SCOBJS2) $(PROG_DEPLIBS) rm -f $@ $(LINK) -o $@ server2.o $(SCOBJS2) $(PROG_LDLIBS) client2: client2.o $(SCOBJS2) $(PROG_DEPLIBS) rm -f $@ $(LINK) -o $@ client2.o $(SCOBJS2) $(PROG_LDLIBS) clean: $(RM) -f *.o veryclean: $(LTCLEAN) $(PROGRAMS) *~ core *.core gfarm-2.4.1/lib/libgfarm/gfsl/server2.c0000644000000000000000000001146411507222723016337 0ustar rootroot#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "gfutil.h" #include "tcputil.h" #include "gfsl_config.h" #include "gfarm_gsi.h" #include "gfarm_auth.h" #include "gfarm_secure_session.h" #include "misc.h" #include "scarg.h" static int ParseArgs(argc, argv) int argc; char *argv[]; { int c; while ((c = getopt(argc, argv, COMMON_OPTIONS)) != -1) { if (HandleCommonOptions(c, optarg) != 0) { fprintf(stderr, "HandleCommonOptions(%s) failed.\n", optarg); return -1; } } if (optind < argc) { fprintf(stderr, "unknown extra argument %s\n", argv[optind]); return -1; } return 0; } int main(argc, argv) int argc; char *argv[]; { int ret = 1; int bindFd = -1; struct sockaddr_in remote; socklen_t remLen = sizeof(struct sockaddr_in); int fd0 = -1; int fd1 = -1; OM_uint32 majStat, minStat; gss_cred_id_t myCred; gfarmSecSession *ss0 = NULL; gfarmSecSession *ss1 = NULL; int sel; char *buf; int n; int i; gfarmSecSession *ssList[2]; gflog_auth_set_verbose(1); if (gfarmSecSessionInitializeAcceptor(NULL, NULL, &majStat, &minStat) <= 0) { fprintf(stderr, "can't initialize as acceptor because of:\n"); gfarmGssPrintMajorStatus(majStat); gfarmGssPrintMinorStatus(minStat); goto Done; } if (ParseArgs(argc, argv) != 0) { fprintf(stderr, "parsing of argument failed.\n"); goto Done; } if (!acceptorSpecified) { myCred = GSS_C_NO_CREDENTIAL; } else { gss_name_t credName; char *credString; if (gfarmGssAcquireCredential(&myCred, acceptorName, GSS_C_ACCEPT, &majStat, &minStat, &credName) <= 0) { fprintf(stderr, "can't acquire credential because of:\n"); gfarmGssPrintMajorStatus(majStat); gfarmGssPrintMinorStatus(minStat); return 1; } credString = newStringOfName(credName); fprintf(stderr, "Acceptor Credential: '%s'\n", credString); free(credString); gfarmGssDeleteName(&credName, NULL, NULL); } /* * Create a channel. */ bindFd = gfarmTCPBindPort(port); if (bindFd < 0) { fprintf(stderr, "Failed to bind port (%d)", port); goto Done; } (void)gfarmGetNameOfSocket(bindFd, &port); fprintf(stderr, "Accepting port: %d\n", port); fd0 = accept(bindFd, (struct sockaddr *)&remote, &remLen); if (fd0 < 0) { perror("accept"); goto Done; } ss0 = gfarmSecSessionAccept(fd0, myCred, NULL, &majStat, &minStat); if (ss0 == NULL) { fprintf(stderr, "Can't create acceptor session because of:\n"); gfarmGssPrintMajorStatus(majStat); gfarmGssPrintMinorStatus(minStat); goto Done; } fd1 = accept(bindFd, (struct sockaddr *)&remote, &remLen); if (fd1 < 0) { perror("accept"); goto Done; } ss1 = gfarmSecSessionAccept(fd1, myCred, NULL, &majStat, &minStat); if (ss1 == NULL) { fprintf(stderr, "Can't create acceptor session because of:\n"); gfarmGssPrintMajorStatus(majStat); gfarmGssPrintMinorStatus(minStat); goto Done; } if (gfarmSecSessionGetInitiatorInfo(ss0) != gfarmSecSessionGetInitiatorInfo(ss1)) { fprintf(stderr, "1st initiator and 2nd initiator differ.\n"); goto Done; } gfarmSecSessionDedicate(ss0); ssList[0] = ss0; ssList[1] = ss1; while (1) { gfarmSecSessionSetPollEvent(ss0, GFARM_SS_POLL_READABLE); gfarmSecSessionSetPollEvent(ss1, GFARM_SS_POLL_READABLE); sel = gfarmSecSessionPoll(ssList, 2, NULL); if (sel == 0) { continue; } else if (sel > 0) { if (gfarmSecSessionCheckPollReadable(ss0)) { i = gfarmSecSessionReceiveInt8(ss0, &buf, &n); if (i == 0) { break; } else if (i < 0) { fprintf(stderr, "1st session receive failed because of:\n"); gfarmSecSessionPrintStatus(ss0); break; } else { fprintf(stderr, "0: got %5d '", n); write(2, buf, n); fprintf(stderr, "'\n"); (void)free(buf); } } if (gfarmSecSessionCheckPollReadable(ss1)) { i = gfarmSecSessionReceiveInt8(ss1, &buf, &n); if (i == 0) { break; } else if (i < 0) { fprintf(stderr, "2nd session receive failed because of:\n"); gfarmSecSessionPrintStatus(ss0); break; } else { fprintf(stderr, "1: got %5d '", n); write(2, buf, n); fprintf(stderr, "'\n"); (void)free(buf); } } } else { break; } } ret = 0; Done: (void)close(bindFd); if (ss0 != NULL) { (void)close(fd0); gfarmSecSessionTerminate(ss0); } if (ss1 != NULL) { (void)close(fd1); gfarmSecSessionTerminate(ss1); } gfarmSecSessionFinalizeAcceptor(); return ret; } gfarm-2.4.1/lib/libgfarm/gfsl/client.c0000644000000000000000000000450311507222723016221 0ustar rootroot#include #include #include #include #include #include #include #include #include "gfutil.h" #include "tcputil.h" #include "gfsl_config.h" #include "gfarm_gsi.h" #include "gfarm_secure_session.h" #include "misc.h" #include "scarg.h" extern void doClient(char *host, int port, gss_name_t acceptorName, gss_cred_id_t deleCred, gfarm_int32_t deleCheck); static char *hostname = NULL; extern int testBufSize; static int ParseArgs(argc, argv) int argc; char *argv[]; { int c, tmp; while ((c = getopt(argc, argv, "s:h:" COMMON_OPTIONS)) != -1) { switch (c) { case 's': if (gfarmGetInt(optarg, &tmp) < 0) { fprintf(stderr, "illegal buffer size.\n"); return -1; } if (tmp <= 0) { fprintf(stderr, "buffer size must be > 0.\n"); return -1; } testBufSize = tmp; break; case 'h': hostname = optarg; break; default: if (HandleCommonOptions(c, optarg) != 0) { fprintf(stderr, "HandleCommonOptions(%s) failed.\n", optarg); return -1; } break; } } if (optind < argc) { fprintf(stderr, "unknown extra argument %s\n", argv[optind]); return -1; } if (hostname == NULL) { fprintf(stderr, "hostname is not specified.\n"); return -1; } if (port == 0) { fprintf(stderr, "port # is not specified.\n"); return -1; } return 0; } int main(argc, argv) int argc; char *argv[]; { OM_uint32 majStat; OM_uint32 minStat; gflog_auth_set_verbose(1); if (gfarmSecSessionInitializeInitiator(NULL, NULL, &majStat, &minStat) <= 0) { fprintf(stderr, "can't initialize as initiator because of:\n"); gfarmGssPrintMajorStatus(majStat); gfarmGssPrintMinorStatus(minStat); gfarmSecSessionFinalizeInitiator(); return 1; } if (ParseArgs(argc, argv) != 0) { fprintf(stderr, "parsing of argument failed.\n"); return 1; } if (!acceptorSpecified) { if (gfarmGssImportNameOfHost(&acceptorName, hostname, &majStat, &minStat) < 0) { fprintf(stderr, "gfarmGssImportNameOfHost() failed.\n"); gfarmGssPrintMajorStatus(majStat); gfarmGssPrintMinorStatus(minStat); return 1; } } doClient(hostname, port, acceptorName, GSS_C_NO_CREDENTIAL, 1); gfarmSecSessionFinalizeInitiator(); return 0; } gfarm-2.4.1/lib/libgfarm/gfsl/gfarm_gsi.h0000644000000000000000000000771211507222723016713 0ustar rootroot#ifndef _GFARM_GSI_H_ #define _GFARM_GSI_H_ /* only available on GFARM_GSS_EXPORT_CRED_ENABLED case */ typedef struct gfarmExportedCredential gfarmExportedCredential; /* * Prototype */ extern char ** gfarmGssCrackMajorStatus(OM_uint32 majStat); extern char ** gfarmGssCrackMinorStatus(OM_uint32 minStat); extern void gfarmGssFreeCrackedStatus(char **strPtr); extern void gfarmGssPrintMajorStatus(OM_uint32 majStat); extern void gfarmGssPrintMinorStatus(OM_uint32 minStat); extern int gfarmGssSendToken(int fd, gss_buffer_t gsBuf); extern int gfarmGssReceiveToken(int fd, gss_buffer_t gsBuf); extern int gfarmGssImportName(gss_name_t *namePtr, void *nameValue, size_t nameLength, gss_OID nameType, OM_uint32 *majStatPtr, OM_uint32 *minStatPtr); extern int gfarmGssImportNameOfHostBasedService(gss_name_t *namePtr, char *service, char *hostname, OM_uint32 *majStatPtr, OM_uint32 *minStatPtr); extern int gfarmGssImportNameOfHost(gss_name_t *namePtr, char *hostname, OM_uint32 *majStatPtr, OM_uint32 *minStatPtr); extern int gfarmGssDeleteName(gss_name_t *namePtr, OM_uint32 *majStatPtr, OM_uint32 *minStatPtr); extern int gfarmGssNewCredentialName(gss_name_t *outputNamePtr, gss_cred_id_t cred, OM_uint32 *majStatPtr, OM_uint32 *minStatPtr); extern char * gfarmGssNewDisplayName(const gss_name_t inputName, OM_uint32 *majStatPtr, OM_uint32 *minStatPtr, gss_OID *outputNameTypePtr); extern int gfarmGssAcquireCredential(gss_cred_id_t *credPtr, const gss_name_t desiredName, gss_cred_usage_t credUsage, OM_uint32 *majStatPtr, OM_uint32 *minStatPtr, gss_name_t *credNamePtr); extern int gfarmGssDeleteCredential(gss_cred_id_t *credPtr, OM_uint32 *majStatPtr, OM_uint32 *minStatPtr); extern int gfarmGssAcceptSecurityContext(int fd, gss_cred_id_t cred, gss_ctx_id_t *scPtr, OM_uint32 *majStatPtr, OM_uint32 *minStatPtr, gss_name_t *remoteNamePtr, gss_cred_id_t *remoteCredPtr); extern int gfarmGssInitiateSecurityContext(int fd, const gss_name_t acceptorName, gss_cred_id_t cred, OM_uint32 reqFlag, gss_ctx_id_t *scPtr, OM_uint32 *majStatPtr, OM_uint32 *minSstatPtr, gss_name_t *remoteNamePtr); extern void gfarmGssDeleteSecurityContext(gss_ctx_id_t *scPtr); extern int gfarmGssConfigureMessageSize(gss_ctx_id_t sCtx, int doEncrypt, gss_qop_t qopReq, unsigned int reqOutSz, unsigned int *maxInSzPtr, OM_uint32 *majStatPtr, OM_uint32 *minStatPtr); extern int gfarmGssSend(int fd, gss_ctx_id_t sCtx, int doEncrypt, gss_qop_t qopReq, gfarm_int8_t *buf, int n, int chunkSz, OM_uint32 *statPtr); extern int gfarmGssReceive(int fd, gss_ctx_id_t sCtx, gfarm_int8_t **bufPtr, int *lenPtr, OM_uint32 *statPtr); /* multiplexed version */ struct gfarm_eventqueue; struct gfarmGssInitiateSecurityContextState; extern struct gfarmGssInitiateSecurityContextState * gfarmGssInitiateSecurityContextRequest( struct gfarm_eventqueue *q, int fd, const gss_name_t acceptorName, gss_cred_id_t cred, OM_uint32 reqFlag, void (*continuation)(void *), void *closure, OM_uint32 *majStatPtr, OM_uint32 *minStatPtr); extern int gfarmGssInitiateSecurityContextResult( struct gfarmGssInitiateSecurityContextState *state, gss_ctx_id_t *scPtr, OM_uint32 *majStatPtr, OM_uint32 *minStatPtr, gss_name_t *remoteNamePtr); /* only available on GFARM_GSS_EXPORT_CRED_ENABLED case */ extern gfarmExportedCredential * gfarmGssExportCredential(gss_cred_id_t cred, OM_uint32 *statPtr); extern char * gfarmGssEnvForExportedCredential( gfarmExportedCredential *exportedCred); extern void gfarmGssDeleteExportedCredential( gfarmExportedCredential *exportedCred, int sigHandler); #endif /* _GFARM_GSI_H_ */ gfarm-2.4.1/lib/libgfarm/gfsl/misc.h0000644000000000000000000000021711507222723015701 0ustar rootrootextern char * gfarmGetEtcDir(void); extern int gfarmGetToken(char *buf, char *tokens[], int max); extern int gfarmGetInt(char *str, int *val); gfarm-2.4.1/lib/libgfarm/gfsl/server.c0000644000000000000000000000747111507222723016260 0ustar rootroot#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "gfnetdb.h" #include "gfutil.h" #include "tcputil.h" #include "gfsl_config.h" #include "gfarm_gsi.h" #include "gfarm_auth.h" #include "gfarm_secure_session.h" #include "misc.h" #include "scarg.h" static char *hostname = NULL; static int ParseArgs(argc, argv) int argc; char *argv[]; { int c; while ((c = getopt(argc, argv, "h:" COMMON_OPTIONS)) != -1) { switch (c) { case 'h': hostname = optarg; break; default: if (HandleCommonOptions(c, optarg) != 0) { fprintf(stderr, "HandleCommonOptions(%s) failed.\n", optarg); return -1; } break; } } if (optind < argc) { fprintf(stderr, "unknown extra argument %s\n", argv[optind]); return -1; } return 0; } void doServer(int fd, char *host, int port, gss_cred_id_t myCred, gss_name_t acceptorName); int main(argc, argv) int argc; char *argv[]; { int bindFd = -1; struct sockaddr_in remote; socklen_t remLen = sizeof(struct sockaddr_in); int fd = -1; OM_uint32 majStat, minStat; char myHostname[4096]; gss_cred_id_t myCred; if (hostname == NULL) { if (gethostname(myHostname, 4096) < 0) { perror("gethostname"); return 1; } hostname = myHostname; } gflog_auth_set_verbose(1); if (gfarmSecSessionInitializeBoth(NULL, NULL, NULL, &majStat, &minStat) <= 0) { fprintf(stderr, "can't initialize as both role because of:\n"); gfarmGssPrintMajorStatus(majStat); gfarmGssPrintMinorStatus(minStat); gfarmSecSessionFinalizeBoth(); return 1; } if (ParseArgs(argc, argv) != 0) { fprintf(stderr, "parsing of argument failed.\n"); return 1; } if (!acceptorSpecified) { if (gfarmGssImportNameOfHost(&acceptorName, hostname, &majStat, &minStat) < 0) { fprintf(stderr, "gfarmGssImportNameOfHost() failed.\n"); gfarmGssPrintMajorStatus(majStat); gfarmGssPrintMinorStatus(minStat); return 1; } myCred = GSS_C_NO_CREDENTIAL; } else { gss_name_t credName; char *credString; if (gfarmGssAcquireCredential(&myCred, acceptorName, GSS_C_BOTH, &majStat, &minStat, &credName) <= 0) { fprintf(stderr, "can't acquire credential because of:\n"); gfarmGssPrintMajorStatus(majStat); gfarmGssPrintMinorStatus(minStat); return 1; } credString = newStringOfName(credName); fprintf(stderr, "Acceptor Credential: '%s'\n", credString); free(credString); gfarmGssDeleteName(&credName, NULL, NULL); } /* * Create a channel. */ bindFd = gfarmTCPBindPort(port); if (bindFd < 0) { gfarmSecSessionFinalizeBoth(); fprintf(stderr, "Failed to bind port (%d)", port); return 1; } (void)gfarmGetNameOfSocket(bindFd, &port); fprintf(stderr, "Accepting port: %d\n", port); /* * Accept-fork loop. */ while (1) { pid_t pid; char hbuf[NI_MAXHOST]; fd = accept(bindFd, (struct sockaddr *)&remote, &remLen); if (fd < 0) { perror("accept"); (void)close(bindFd); return 1; } if (gfarm_getnameinfo((struct sockaddr *)&remote, remLen, hbuf, sizeof(hbuf), NULL, 0, 0) == 0) fprintf(stderr, "Connected from %s\n", hbuf); pid = fork(); if (pid < 0) { (void)close(fd); (void)close(bindFd); perror("fork"); return 1; } else if (pid == 0) { (void)close(bindFd); doServer(fd, hostname, port, myCred, acceptorName); (void)close(fd); exit(0); } else { (void)close(fd); } } #if 0 /* never reach here */ gfarmSecSessionFinalizeBoth(); return 0; #endif } gfarm-2.4.1/lib/libgfarm/gfsl/README0000644000000000000000000000212211507222723015452 0ustar rootroot´äºê·¯¡¢Á¾ÅÄ·¯¡¢·úÉô¤µ¤ó¡¢¤½¤Î¾»È¤¦²ÄǽÀ­¤¬¤¢¤ë¿Í¡¹¤Î¤¿¤á¤Î¥á¥â 1. ´ðËÜŪ¤Ë¡¢gfarmSecSession*() ¤Î API ¤Î¤ß¤ò»È¤Ã¤Æ½ñ¤±¤ÐÎɤ¤¤Ç¤¹¡£ 2. scsub.c, server.c, client.c, server2.c, client2.c ¤Î¡¢¥Æ¥¹¥È¥×¥í¥° ¥é¥à¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£ 3. REFERENCE ¤âÎɤ¯»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£¹½Â¤ÂÎÅù¤Ï¡¢Ä¾ÀÜ *.h ¤ò»²¾È¤·¤Æ¤¯ ¤À¤µ¤¤¡£ 4. ³Æ¼ïÀßÄê¥Õ¥¡¥¤¥ëÅù¤Ï¡¢¤³¤Î directory ¤Ë¤¢¤ê¤Þ¤¹¡£¤¤¤º¤ìÀâÌÀ¤ò½ñ¤­¤Þ ¤¹¡£º£¤Ï¤½¤Î¤Þ¤Þ»È¤Ã¤Æ¤¯¤À¤µ¤¤ ^^; [¥³¥ó¥Ñ¥¤¥ë¤ÎÊýË¡] 1. ´Ä¶­ÊÑ¿ô GLOBUS_LOCATION ¤ÎÀßÄê % setenv GLOBUS_LOCATION /usr/local/globus/gt2 2. make % make [¥Æ¥¹¥È¥×¥í¥°¥é¥à¤Î¼Â¹ÔÊýË¡] 1. ´Ä¶­ÊÑ¿ô GFARM_HOME ¤ÎÀßÄê % setenv GFARM_HOME . 2. $GFARM_HOME/etc ¥Ç¥£¥ì¥¯¥È¥ê¤ÎºîÀ® % ln -s . etc 3. $GFARM_HOME/etc/gfarm-usermap ¤Î³Îǧ¡¥¼«Ê¬¤Î¥¨¥ó¥È¥ê¤¬Â¸ºß¤¹¤ë¤«¡© 4. host certificate ¤ª¤è¤Ó CA signing policy ¤Î³Îǧ¡¥ °Ê²¼¤Î¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤¹¤ë¤«¡© /etc/grid-security/hostcert.pem /etc/grid-security/hostkey.pem /etc/grid-security/certificates/42864e48.signing_policy 5. root ¤Ç server ¤Îµ¯Æ°¡¥ # GFARM_HOME=. ./server -p 10000 6. client ¤Îµ¯Æ°¡¥ % ./client -h localhost -p 10000 gfarm-2.4.1/lib/libgfarm/gfsl/tcputil.c0000644000000000000000000001511311507222723016426 0ustar rootroot#include #include #include #include #include #include #include #include #include #include #include #ifdef USE_GLOBUS_LIBC_HOOK #include "globus_libc.h" #endif /* USE_GLOBUS_LIBC_HOOK */ #include #include #include #include "gfnetdb.h" #include "gfutil.h" #include "tcputil.h" #define MAX_BACKLOG 10 #define GFARM_OCTETS_PER_32BIT 4 /* 32/8 */ #define GFARM_OCTETS_PER_16BIT 2 /* 16/8 */ int gfarmTCPConnectPortByHost(host, port) char *host; int port; { struct addrinfo hints, *res, *res0; int sock, error, rv; char sbuf[NI_MAXSERV]; snprintf(sbuf, sizeof(sbuf), "%u", port); memset(&hints, 0, sizeof(hints)); hints.ai_family = AF_INET; hints.ai_socktype = SOCK_STREAM; error = gfarm_getaddrinfo(host, sbuf, &hints, &res0); if (error != 0) { gflog_warning(GFARM_MSG_1000629, "getaddrinfo: %s: %s", host, gai_strerror(error)); return (-1); } sock = -1; for (res = res0; res != NULL; res = res->ai_next) { sock = socket(res->ai_family, res->ai_socktype, res->ai_protocol); if (sock < 0) { gflog_error(GFARM_MSG_1000630, "socket(%d, %d, %d): %s\n", (int)res->ai_family, (int)res->ai_socktype, (int)res->ai_protocol, strerror(errno)); continue; } while ((rv = connect(sock, res->ai_addr, res->ai_addrlen)) < 0 && errno == EINTR) ; if (rv < 0) { gflog_error(GFARM_MSG_1000631, "connect: %s\n", strerror(errno)); close(sock); sock = -1; continue; } /* connected */ fcntl(sock, F_SETFD, 1); /* automatically close() on exec(2) */ /* XXX - set socket options */ break; } gfarm_freeaddrinfo(res0); return (sock); } int gfarmTCPBindPort(port) int port; { struct addrinfo hints, *res; int sock, e; int one = 1; char sbuf[NI_MAXSERV]; snprintf(sbuf, sizeof(sbuf), "%u", port); memset(&hints, 0, sizeof(hints)); hints.ai_family = AF_INET; hints.ai_socktype = SOCK_STREAM; hints.ai_flags = AI_PASSIVE; e = gfarm_getaddrinfo(NULL, sbuf, &hints, &res); if (e) { gflog_error(GFARM_MSG_1000632, "getaddrinfo(port = %u): %s\n", port, gai_strerror(e)); return -1; } if (res == NULL) { gflog_debug(GFARM_MSG_1000803, "gfarm_getaddinfo() failed for port (%d)", port); return -1; } sock = socket(res->ai_family, res->ai_socktype, res->ai_protocol); if (sock < 0) { gflog_error(GFARM_MSG_1000633, "socket: %s", strerror(errno)); } else if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (void *)&one, sizeof(int)) != 0) { gflog_error(GFARM_MSG_1000634, "setsockopt: %s", strerror(errno)); close(sock); sock = -1; } else if (bind(sock, res->ai_addr, res->ai_addrlen) < 0) { gflog_error(GFARM_MSG_1000635, "bind: %s", strerror(errno)); close(sock); sock = -1; } else if (listen(sock, MAX_BACKLOG) != 0) { gflog_error(GFARM_MSG_1000636, "listen: %s", strerror(errno)); close(sock); sock = -1; } gfarm_freeaddrinfo(res); return sock; } int gfarmGetPeernameOfSocket(sock, portPtr, hostPtr) int sock; int *portPtr; char **hostPtr; { struct sockaddr_in sin; socklen_t slen = sizeof(sin); char hbuf[NI_MAXHOST]; if (getpeername(sock, (struct sockaddr *)&sin, &slen) != 0) { gflog_error(GFARM_MSG_1000637, "getpeername: %s", strerror(errno)); return (-1); } if (hostPtr != NULL) { if (gfarm_getnameinfo((struct sockaddr *)&sin, slen, hbuf, sizeof(hbuf), NULL, 0, 0) != 0) { gflog_debug(GFARM_MSG_1000804, "gfarm_getnameinfo() failed"); return (-1); } *hostPtr = strdup(hbuf); } if (portPtr != NULL) *portPtr = (int)ntohs(sin.sin_port); return (0); } int gfarmGetNameOfSocket(sock, portPtr) int sock; int *portPtr; { struct sockaddr_in sin; socklen_t slen = sizeof(sin); if (getsockname(sock, (struct sockaddr *)&sin, &slen) != 0) { gflog_error(GFARM_MSG_1000638, "getsockname: %s", strerror(errno)); return (-1); } if (portPtr != NULL) *portPtr = (int)ntohs(sin.sin_port); return (0); } int gfarmWaitReadable(fd) int fd; { fd_set rFd; int sel; FD_ZERO(&rFd); FD_SET(fd, &rFd); SelectAgain: errno = 0; sel = select(fd + 1, &rFd, NULL, NULL, NULL); if (sel < 0) { if (errno == EINTR) { goto SelectAgain; } else { gflog_error(GFARM_MSG_1000639, "select: %s", strerror(errno)); return sel; } } return sel; } int gfarmReadInt8(fd, buf, len) int fd; gfarm_int8_t *buf; int len; { int sum = 0; int cur = 0; int sel; do { sel = gfarmWaitReadable(fd); if (sel <= 0) { return sum; } cur = read(fd, buf + sum, len - sum); if (cur < 0) { gflog_error(GFARM_MSG_1000640, "read: %s", strerror(errno)); return sum; } else if (cur == 0) { break; } sum += cur; } while (sum < len); return sum; } int gfarmReadInt16(fd, buf, len) int fd; gfarm_int16_t *buf; int len; { int i; int n; gfarm_int16_t s; for (i = 0; i < len; i++) { n = gfarmReadInt8(fd, (gfarm_int8_t *)&s, GFARM_OCTETS_PER_16BIT); if (n != GFARM_OCTETS_PER_16BIT) { return i; } buf[i] = ntohs(s); } return i; } int gfarmReadInt32(fd, buf, len) int fd; gfarm_int32_t *buf; int len; { int i; int n; gfarm_int32_t l; for (i = 0; i < len; i++) { n = gfarmReadInt8(fd, (gfarm_int8_t *)&l, GFARM_OCTETS_PER_32BIT); if (n != GFARM_OCTETS_PER_32BIT) { return i; } buf[i] = ntohl(l); } return i; } int gfarmWriteInt8(fd, buf, len) int fd; gfarm_int8_t *buf; int len; { int sum = 0; int cur = 0; do { cur = gfarm_send_no_sigpipe(fd, buf + sum, len - sum); if (cur < 0) { gflog_error(GFARM_MSG_1000641, "write: %s", strerror(errno)); return sum; } sum += cur; } while (sum < len); return sum; } int gfarmWriteInt16(fd, buf, len) int fd; gfarm_int16_t *buf; int len; { int i; int n; gfarm_int16_t s; for (i = 0; i < len; i++) { s = htons(buf[i]); n = gfarmWriteInt8(fd, (gfarm_int8_t *)&s, GFARM_OCTETS_PER_16BIT); if (n != GFARM_OCTETS_PER_16BIT) { return i; } } return i; } int gfarmWriteInt32(fd, buf, len) int fd; gfarm_int32_t *buf; int len; { int i; int n; gfarm_int32_t l; for (i = 0; i < len; i++) { l = htonl(buf[i]); n = gfarmWriteInt8(fd, (gfarm_int8_t *)&l, GFARM_OCTETS_PER_32BIT); if (n != GFARM_OCTETS_PER_32BIT) { return i; } } return i; } gfarm-2.4.1/lib/libgfarm/gfsl/auth.c0000644000000000000000000004301511507222723015705 0ustar rootroot#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "hash.h" #include "gfutil.h" #include "thrsubr.h" #include "gfsl_config.h" #include "gfarm_auth.h" #include "misc.h" #define AUTH_TABLE_SIZE 139 static struct gfarm_hash_table *authTable = NULL; #if GFARM_FAKE_GSS_C_NT_USER_NAME_FOR_GLOBUS static struct gfarm_hash_table *userToDNTable = NULL; #endif static pthread_mutex_t authTable_mutex = PTHREAD_MUTEX_INITIALIZER; static const char authTableDiag[] = "authTable"; static void gfarmAuthDestroyUserEntry_unlocked(gfarmAuthEntry *); #if 0 static void dumpAuthEntry(aePtr) gfarmAuthEntry *aePtr; { if (aePtr->authType != GFARM_AUTH_USER && aePtr->authType != GFARM_AUTH_HOST) { fprintf(stderr, "Invalid auth entry.\n"); return; } fprintf(stderr, "Type:\t%s\n", (aePtr->authType == GFARM_AUTH_USER) ? "user" : "host"); fprintf(stderr, "DN:\t%s\n", aePtr->distName); if (aePtr->authType == GFARM_AUTH_USER) { fprintf(stderr, "Local:\t%s\n", aePtr->authData.userAuth.localName); fprintf(stderr, "uid:\t%d\n", aePtr->authData.userAuth.uid); fprintf(stderr, "gid:\t%d\n", aePtr->authData.userAuth.gid); fprintf(stderr, "home:\t%s\n", aePtr->authData.userAuth.homeDir); fprintf(stderr, "shell:\t%s\n", aePtr->authData.userAuth.loginShell); } else { fprintf(stderr, "FQDN:\t%s\n", aePtr->authData.hostAuth.FQDN); } fprintf(stderr, "\n"); } #endif static pthread_mutex_t authFile_mutex = PTHREAD_MUTEX_INITIALIZER; static char *authFile = NULL; static const char authFileDiag[] = "authFile"; static int setAuthFile(char *usermap) { char *err = NULL; static const char diag[] = "gfsl/setAuthFile()"; gfarm_mutex_lock(&authFile_mutex, diag, authFileDiag); if (authFile != NULL) free(authFile); authFile = strdup(usermap); if (authFile == NULL) err = "no memory"; gfarm_mutex_unlock(&authFile_mutex, diag, authFileDiag); if (err != NULL) { gflog_auth_warning(GFARM_MSG_1000642, "%s: %s", diag, err); return (-1); } return (0); } static void unsetAuthFile(void) { static const char diag[] = "gfsl/unsetAuthFile()"; gfarm_mutex_lock(&authFile_mutex, diag, authFileDiag); if (authFile != NULL) free(authFile); authFile = NULL; gfarm_mutex_unlock(&authFile_mutex, diag, authFileDiag); } /* returned string should be free'ed if it is not NULL */ static char * getAuthFile(void) { char *file; static const char diag[] = "gfsl/getAuthFile()"; gfarm_mutex_lock(&authFile_mutex, diag, authFileDiag); if (authFile != NULL) file = strdup(authFile); else file = NULL; gfarm_mutex_unlock(&authFile_mutex, diag, authFileDiag); return (file); } static struct stat authFileStat; static pthread_mutex_t authFileStat_mutex = PTHREAD_MUTEX_INITIALIZER; static const char authFileStatDiag[] = "authFileStat"; static int getAuthFileStat(struct stat *sb) { char *file = getAuthFile(); static const char diag[] = "gfsl/getAuthFileStat()"; if (file == NULL) { gflog_auth_warning(GFARM_MSG_1000643, "%s: AuthFile not set or no memory", diag); return (-1); } if (stat(file, sb) < 0) { gflog_auth_warning(GFARM_MSG_1000644, "%s: not found: %s", diag, file); free(file); return (-1); } free(file); return (0); } static int setAuthFileStat(void) { struct stat sb; static const char diag[] = "gfsl/setAuthFileStat()"; if (getAuthFileStat(&sb) < 0) { gflog_debug(GFARM_MSG_1000805, "getAuthFileStat() failed"); return (-1); } gfarm_mutex_lock(&authFileStat_mutex, diag, authFileStatDiag); authFileStat = sb; gfarm_mutex_unlock(&authFileStat_mutex, diag, authFileStatDiag); return (0); } static int checkAuthFileStat(void) { struct stat sb; int update; static const char diag[] = "gfsl/checkAuthFileStat()"; if (getAuthFileStat(&sb) < 0) { gflog_debug(GFARM_MSG_1000806, "getAuthFileStat() failed"); return (-1); } gfarm_mutex_lock(&authFileStat_mutex, diag, authFileStatDiag); update = (authFileStat.st_mtime < sb.st_mtime); authFileStat = sb; gfarm_mutex_unlock(&authFileStat_mutex, diag, authFileStatDiag); return (update); } int gfarmAuthInitialize(usermapFile) char *usermapFile; { int ret = 1; static const char diag[] = "gfarmAuthInitialize()"; if (setAuthFile(usermapFile) == -1) { gflog_debug(GFARM_MSG_1000807, "setAuthFile() failed"); return (-1); } if (setAuthFileStat() == -1) { gflog_debug(GFARM_MSG_1000808, "setAuthFileStat() failed"); return (-1); } gfarm_mutex_lock(&authTable_mutex, diag, authTableDiag); if (authTable == NULL) { char mapFile[PATH_MAX]; FILE *mFd = NULL; char lineBuf[65536]; gfarmAuthEntry *aePtr; struct gfarm_hash_entry *ePtr; /* * Read global users -> local users mapping file * and create a translation table. */ if (usermapFile == NULL || usermapFile[0] == '\0') { char *confDir = gfarmGetEtcDir(); if (confDir == NULL) { gflog_auth_error(GFARM_MSG_1000645, "%s: no memory", diag); ret = -1; goto done; } #ifdef HAVE_SNPRINTF snprintf(mapFile, sizeof mapFile, "%s/%s", confDir, GFARM_DEFAULT_USERMAP_FILE); #else sprintf(mapFile, "%s/%s", confDir, GFARM_DEFAULT_USERMAP_FILE); #endif usermapFile = mapFile; (void)free(confDir); } if ((mFd = fopen(usermapFile, "r")) == NULL) { gflog_auth_error(GFARM_MSG_1000646, "%s: cannot open: %s", usermapFile, strerror(errno)); ret = -1; goto done; } authTable = gfarm_hash_table_alloc(AUTH_TABLE_SIZE, gfarm_hash_default, gfarm_hash_key_equal_default); if (authTable == NULL) { /* no memory */ gflog_auth_error(GFARM_MSG_1000647, "%s: no memory", diag); ret = -1; goto done; } #if GFARM_FAKE_GSS_C_NT_USER_NAME_FOR_GLOBUS userToDNTable = gfarm_hash_table_alloc(AUTH_TABLE_SIZE, gfarm_hash_default, gfarm_hash_key_equal_default); if (userToDNTable == NULL) { /* no memory */ gflog_auth_error(GFARM_MSG_1000648, "%s: no memory", diag); gfarm_hash_table_free(authTable); ret = -1; goto done; } #endif /* GFARM_FAKE_GSS_C_NT_USER_NAME_FOR_GLOBUS */ while (fgets(lineBuf, sizeof lineBuf, mFd) != NULL) { char *token[64]; int nToken = gfarmGetToken(lineBuf, token, sizeof token); char *distName = NULL; char *mode = NULL; char *localName = NULL; struct passwd *pPtr; int isNew; if (nToken <= 1) { continue; } if (*token[0] == '#') { continue; } distName = token[0]; if (nToken == 2) { mode = "@user@"; localName = token[1]; } else if (nToken >= 3) { mode = token[1]; localName = token[2]; } else if (nToken == 0) { continue; } else { gflog_warning(GFARM_MSG_1000649, "%s: WARNING: missing local username for DN." " Ignored.", distName); continue; } /* * Unquote distinguished name */ if (distName[0] == '\'' || distName[0] == '"') { int quote = distName[0]; int dLen = strlen(distName); dLen--; if (distName[dLen] == quote) { distName[dLen] = '\0'; distName++; } } if (strcmp(mode, "@user@") == 0) { pPtr = getpwnam(localName); if (pPtr == NULL) { gflog_auth_warning(GFARM_MSG_1000650, "%s: WARNING: Account doesn't exist." " Ignored.", localName); continue; } if (pPtr->pw_uid == 0) { gflog_warning(GFARM_MSG_1000651, "%s: WARNING: This user is a super user." " Ignored.", localName); continue; } GFARM_MALLOC(aePtr); if (aePtr == NULL) { gflog_auth_error(GFARM_MSG_1000652, "%s: no memory", diag); ret = -1; goto initDone; } (void)memset(aePtr, 0, sizeof(gfarmAuthEntry)); aePtr->sesRefCount = 0; aePtr->orphaned = 0; aePtr->authType = GFARM_AUTH_USER; aePtr->distName = strdup(distName); aePtr->authData.userAuth.localName = strdup(localName); aePtr->authData.userAuth.uid = pPtr->pw_uid; aePtr->authData.userAuth.gid = pPtr->pw_gid; aePtr->authData.userAuth.homeDir = strdup(pPtr->pw_dir); aePtr->authData.userAuth.loginShell = strdup(pPtr->pw_shell); #if GFARM_FAKE_GSS_C_NT_USER_NAME_FOR_GLOBUS ePtr = gfarm_hash_enter(userToDNTable, localName, strlen(localName) + 1, sizeof(aePtr), &isNew); if (ePtr == NULL) { /* no memory */ gflog_warning(GFARM_MSG_1000653, "%s: WARNING: no memory for DN. Ignored.", localName); } else if (!isNew) { gflog_auth_warning(GFARM_MSG_1000654, "%s: WARNING: multiple X.509 Distinguish name " "for a UNIX user account. Ignored.", localName); } else { *(gfarmAuthEntry **)gfarm_hash_entry_data(ePtr) = aePtr; } #endif /* GFARM_FAKE_GSS_C_NT_USER_NAME_FOR_GLOBUS */ } else if (strcmp(mode, "@host@") == 0) { GFARM_MALLOC(aePtr); if (aePtr == NULL) { gflog_auth_error(GFARM_MSG_1000655, "%s: no memory", diag); ret = -1; goto initDone; } (void)memset(aePtr, 0, sizeof(gfarmAuthEntry)); aePtr->sesRefCount = 0; aePtr->orphaned = 0; aePtr->authType = GFARM_AUTH_HOST; aePtr->distName = strdup(distName); aePtr->authData.hostAuth.FQDN = strdup(localName); } else { gflog_warning(GFARM_MSG_1000656, "%s: WARNING: Unknown keyword at second field." " Ignored.", localName); continue; } ePtr = gfarm_hash_enter(authTable, aePtr->distName, strlen(aePtr->distName) + 1, sizeof(aePtr), &isNew); if (ePtr == NULL) { /* no memory */ gflog_warning(GFARM_MSG_1000657, "%s: WARNING: no memory for DN. Ignored.", distName); #if GFARM_FAKE_GSS_C_NT_USER_NAME_FOR_GLOBUS if (aePtr->authType == GFARM_AUTH_USER) gfarm_hash_purge(userToDNTable, localName, strlen(localName) + 1); #endif /* GFARM_FAKE_GSS_C_NT_USER_NAME_FOR_GLOBUS */ aePtr->orphaned = 1; gfarmAuthDestroyUserEntry_unlocked(aePtr); goto initDone; } if (!isNew) { gflog_warning(GFARM_MSG_1000658, "%s: WARNING: duplicate DN. Ignored.", distName); #if GFARM_FAKE_GSS_C_NT_USER_NAME_FOR_GLOBUS if (aePtr->authType == GFARM_AUTH_USER) gfarm_hash_purge(userToDNTable, localName, strlen(localName) + 1); #endif /* GFARM_FAKE_GSS_C_NT_USER_NAME_FOR_GLOBUS */ aePtr->orphaned = 1; gfarmAuthDestroyUserEntry_unlocked(aePtr); continue; } *(gfarmAuthEntry **)gfarm_hash_entry_data(ePtr) = aePtr; #if 0 dumpAuthEntry(aePtr); #endif } initDone: fclose(mFd); if (ret == -1) { /* * Destroy mapping table. */ struct gfarm_hash_iterator it; for (gfarm_hash_iterator_begin(authTable, &it); !gfarm_hash_iterator_is_end(&it); gfarm_hash_iterator_next(&it)) { aePtr = *(gfarmAuthEntry **)gfarm_hash_entry_data( gfarm_hash_iterator_access(&it)); aePtr->orphaned = 1; gfarmAuthDestroyUserEntry_unlocked(aePtr); } gfarm_hash_table_free(authTable); authTable = NULL; #if GFARM_FAKE_GSS_C_NT_USER_NAME_FOR_GLOBUS gfarm_hash_table_free(userToDNTable); userToDNTable = NULL; #endif /* GFARM_FAKE_GSS_C_NT_USER_NAME_FOR_GLOBUS */ } } done: gfarm_mutex_unlock(&authTable_mutex, diag, authTableDiag); return ret; } void gfarmAuthFinalize() { static const char diag[] = "gfarmAuthFinalize()"; unsetAuthFile(); gfarm_mutex_lock(&authTable_mutex, diag, authTableDiag); if (authTable != NULL) { gfarmAuthEntry *aePtr; struct gfarm_hash_iterator it; for (gfarm_hash_iterator_begin(authTable, &it); !gfarm_hash_iterator_is_end(&it); gfarm_hash_iterator_next(&it)) { aePtr = *(gfarmAuthEntry **)gfarm_hash_entry_data( gfarm_hash_iterator_access(&it)); if (aePtr->sesRefCount <= 0) { /* * If any sessions reffer this entry, don't free it. */ aePtr->orphaned = 1; gfarmAuthDestroyUserEntry_unlocked(aePtr); } else { aePtr->orphaned = 1; } } gfarm_hash_table_free(authTable); authTable = NULL; #if GFARM_FAKE_GSS_C_NT_USER_NAME_FOR_GLOBUS gfarm_hash_table_free(userToDNTable); userToDNTable = NULL; #endif /* GFARM_FAKE_GSS_C_NT_USER_NAME_FOR_GLOBUS */ } gfarm_mutex_unlock(&authTable_mutex, diag, authTableDiag); } gfarmAuthEntry * gfarmAuthGetUserEntry(distUserName) char *distUserName; { gfarmAuthEntry *ret = NULL; static const char diag[] = "gfarmAuthGetUserEntry"; /* update a usermap if needed */ if (checkAuthFileStat() > 0) { char *usermap = getAuthFile(); if (usermap) { gfarmAuthFinalize(); (void)gfarmAuthInitialize(usermap); free(usermap); } } gfarm_mutex_lock(&authTable_mutex, diag, authTableDiag); if (authTable != NULL) { struct gfarm_hash_entry *ePtr = gfarm_hash_lookup(authTable, distUserName, strlen(distUserName) + 1); if (ePtr != NULL) { ret = *(gfarmAuthEntry **)gfarm_hash_entry_data(ePtr); #if 0 dumpAuthEntry(ret); #endif } else { gflog_debug(GFARM_MSG_1000809, "lookup from authTable (%s) failed", distUserName); } } else { gflog_debug(GFARM_MSG_1000810, "authTable is NULL"); } gfarm_mutex_unlock(&authTable_mutex, diag, authTableDiag); return ret; } #if GFARM_FAKE_GSS_C_NT_USER_NAME_FOR_GLOBUS gfarmAuthEntry * gfarmAuthGetLocalUserEntry(localUserName) char *localUserName; { gfarmAuthEntry *ret = NULL; static const char diag[] = "gfarmAuthGetLocalUserEntry()"; /* update a usermap if needed */ if (checkAuthFileStat() > 0) { char *usermap = getAuthFile(); if (usermap) { gfarmAuthFinalize(); (void)gfarmAuthInitialize(usermap); free(usermap); } } gfarm_mutex_lock(&authTable_mutex, diag, authTableDiag); if (userToDNTable != NULL) { struct gfarm_hash_entry *ePtr = gfarm_hash_lookup(userToDNTable, localUserName, strlen(localUserName) + 1); if (ePtr != NULL) { ret = *(gfarmAuthEntry **)gfarm_hash_entry_data(ePtr); #if 0 dumpAuthEntry(ret); #endif } else { gflog_debug(GFARM_MSG_1000811, "look up from userToDNTable (%s) failed", localUserName); } } else { gflog_debug(GFARM_MSG_1000812, "userToDNTable is NULL"); } gfarm_mutex_unlock(&authTable_mutex, diag, authTableDiag); return ret; } #endif /* GFARM_FAKE_GSS_C_NT_USER_NAME_FOR_GLOBUS */ int gfarmAuthGetAuthEntryType(aePtr) gfarmAuthEntry *aePtr; { int authType; static const char diag[] = "gfarmAuthGetAuthEntryType()"; if (aePtr == NULL) { gflog_debug(GFARM_MSG_1000813, "invalid argument: auth entry is NULL"); return GFARM_AUTH_UNKNOWN; } else { gfarm_mutex_lock(&authTable_mutex, diag, authTableDiag); authType = aePtr->authType; gfarm_mutex_unlock(&authTable_mutex, diag, authTableDiag); if (authType == GFARM_AUTH_USER || authType == GFARM_AUTH_HOST) { return authType; } else { gflog_debug(GFARM_MSG_1000814, "Unknown auth type (%d)", authType); return GFARM_AUTH_UNKNOWN; } } } /* this function assumes that authTable_mutex is locked */ static void gfarmAuthDestroyUserEntry_unlocked(aePtr) gfarmAuthEntry *aePtr; { if (aePtr->sesRefCount == 0 && aePtr->orphaned == 1) { if (aePtr->distName != NULL) { (void)free(aePtr->distName); } switch (aePtr->authType) { case GFARM_AUTH_USER: { if (aePtr->authData.userAuth.localName != NULL) { (void)free(aePtr->authData.userAuth.localName); } if (aePtr->authData.userAuth.homeDir != NULL) { (void)free(aePtr->authData.userAuth.homeDir); } if (aePtr->authData.userAuth.loginShell != NULL) { (void)free(aePtr->authData.userAuth.loginShell); } break; } case GFARM_AUTH_HOST: { if (aePtr->authData.hostAuth.FQDN != NULL) { (void)free(aePtr->authData.hostAuth.FQDN); } break; } } (void)free(aePtr); } } void gfarmAuthDestroyUserEntry(aePtr) gfarmAuthEntry *aePtr; { static const char diag[] = "gfarmAuthDestroyUserEntry"; gfarm_mutex_lock(&authTable_mutex, diag, authTableDiag); gfarmAuthDestroyUserEntry_unlocked(aePtr); gfarm_mutex_unlock(&authTable_mutex, diag, authTableDiag); } static void cleanString(char *str); static void cleanString(str) char *str; { if (str == NULL || str[0] == '\0') { return; } else { int len = strlen(str); (void)memset(str, 0, len); } } void gfarmAuthMakeThisAlone(laePtr) gfarmAuthEntry *laePtr; { static const char diag[] = "gfarmAuthMakeThisAlone()"; gfarm_mutex_lock(&authTable_mutex, diag, authTableDiag); if (laePtr->orphaned == 1) { gfarm_mutex_unlock(&authTable_mutex, diag, authTableDiag); return; } else { gfarmAuthEntry *aePtr; struct gfarm_hash_iterator it; for (gfarm_hash_iterator_begin(authTable, &it); !gfarm_hash_iterator_is_end(&it); gfarm_hash_iterator_next(&it)) { aePtr = *(gfarmAuthEntry **)gfarm_hash_entry_data( gfarm_hash_iterator_access(&it)); if (laePtr == aePtr) { laePtr->orphaned = 1; } else { aePtr->sesRefCount = 0; aePtr->orphaned = 1; cleanString(aePtr->distName); switch (aePtr->authType) { case GFARM_AUTH_USER: { cleanString(aePtr->authData.userAuth.localName); cleanString(aePtr->authData.userAuth.homeDir); cleanString(aePtr->authData.userAuth.loginShell); break; } case GFARM_AUTH_HOST: { cleanString(aePtr->authData.hostAuth.FQDN); break; } } gfarmAuthDestroyUserEntry_unlocked(aePtr); } } gfarm_hash_table_free(authTable); authTable = NULL; #if GFARM_FAKE_GSS_C_NT_USER_NAME_FOR_GLOBUS gfarm_hash_table_free(userToDNTable); userToDNTable = NULL; #endif /* GFARM_FAKE_GSS_C_NT_USER_NAME_FOR_GLOBUS */ } gfarm_mutex_unlock(&authTable_mutex, diag, authTableDiag); } gfarm-2.4.1/lib/libgfarm/gfsl/REFERENCE0000644000000000000000000004761711507222723016035 0ustar rootroot̿̾µ¬Â§ ¡ÁGet¡Á() ²òÊü¤·¤Æ¤Ï¤¤¤±¤Ê¤¤¹½Â¤¤ò¼èÆÀ¤¹¤ë´Ø¿ô¡£ ¤¿¤À¤· gfarmGetPeernameOfSocket() ¤È gfarmGetEtcDir() ¤Ï Îã³°¤Ç¡¢free() ¤·¤Æ¤ä¤ëɬÍפ¬¤¢¤ë¡£ ¡ÁNew¡Á() ²òÊü¤¹¤ëɬÍפ¬¤¢¤ë¹½Â¤¤ò¼èÆÀ¤¹¤ë´Ø¿ô¡£ ¤¿¤À¤·¡¢Ê̤Î̾¾Î¤ò»È¤¦¹½Â¤ÂΤ⿤¤¡£ Îã: ¡ÁCrack*Status(), ¡Á{Import,Duplicate}Name¡Á(), ¡Á{Acquire,Export}Credential¡Á(), ¡ÁAccept{,SecurityContext}(), ¡ÁInitiate{,SecurityContext}(), ¡ÁgfarmGss{Send,Receive}Token() (new ¤Ï¡¢C++ ¤Î new ¥­¡¼¥ï¡¼¥É¤ËͳÍ褹¤ë) ¡ÁDelete¡Á() ¼èÆÀ¤·¤¿¹½Â¤¤ò²òÊü¤¹¤ë´Ø¿ô¡£ Îã³°: gfarmGssFreeCrackedStatus(), gfarmSecSessionTerminate() (delete ¤Ï¡¢C++ ¤Î delete ¥­¡¼¥ï¡¼¥É¤ËͳÍ褹¤ë) GSSAPI wrapper char ** gfarmGssCrackMajorStatus(OM_uint32 majStat); GSSAPI ¤Î major status ¤ò²ÄÆÉʸ»úÎó¤ÎÇÛÎó¤ËÊÑ´¹¤¹¤ë¡£ ÊÖ¤êÃÍ¤Ï gfarmGssFreeCrackedStatus() ¤Ç²òÊü¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ char ** gfarmGssCrackMinorStatus(OM_uint32 minStat); GSSAPI ¤Î minorstatus ¤ò²ÄÆÉʸ»úÎó¤ÎÇÛÎó¤ËÊÑ´¹¤¹¤ë¡£ ÊÖ¤êÃÍ¤Ï gfarmGssFreeCrackedStatus() ¤Ç²òÊü¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ void gfarmGssFreeCrackedStatus(char **strPtr); gfarmGssCrackStatus() ¤ÎÊÖ¤êÃͤò²òÊü¤¹¤ë¡£ void gfarmGssPrintMajorStatus(OM_uint32 majStat); GSSAPI ¤Î major status ¤ò²ÄÆÉʸ»úÎó¤È¤·¤Æ¥í¥°¤Ë½ÐÎϤ¹¤ë¡£ void gfarmGssPrintMinorStatus(OM_uint32 minStat); GSSAPI ¤Î minor status ¤ò²ÄÆÉʸ»úÎó¤È¤·¤Æ¥í¥°¤Ë½ÐÎϤ¹¤ë¡£ int gfarmGssSendToken(int fd, gss_buffer_t gsBuf); fd ¤Ë gsBuf ¤ò½ÐÎϤ¹¤ë¡£ int gfarmGssReceiveToken(int fd, gss_buffer_t gsBuf); fd ¤«¤é gsBuf ¤ËÆþÎϤ¹¤ë¡£ int gfarmGssImportName(gss_name_t *namePtr, void *nameValue, size_t nameLength, gss_OID nameType, OM_uint32 *majStatPtr, OM_uint32 *minStatPtr); nameValue, nameLength, nameType ¤Ç»ØÄꤷ¤¿Ì¾Á°¤ò¡¢ gss_name_t ¤ËÊÑ´¹¤·¡¢*namePtr ¤ËÊÖ¤¹¡£ *namePtr ¤Ï¡¢gfarmGssDeleteName() ¤òÍѤ¤¤Æ²òÊü¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ À®¸ù¤·¤¿¾ì¹ç 1 ¤¬Ê֤ꡢ¤½¤Î¾¤Î¾ì¹ç¤Ë¤Ï -1 °Ê²¼¤¬Ê֤롣 ¼ºÇÔ¤·¤¿¾ì¹ç¡¢*majStatPtr, *minStatPtr ¤Ë¤Ï¡¢¤½¤ì¤¾¤ì GSSAPI ¸Æ¤Ó½Ð¤·¤Î major status, minor status ¤¬Ê֤롣 ¤³¤Î¥Õ¥¡¥¤¥ëËö¤Î Ãí1. ¤â»²¾È int gfarmGssImportNameOfHostBasedService(gss_name_t *namePtr, char *service, char *hostname, OM_uint32 *majStatPtr, OM_uint32 *minStatPtr); gfarmGssImportName() ¤ËÂФ·¤Æ GSS_C_NT_HOSTBASED_SERVICE ¤ò »ØÄꤷ¤¿¾ì¹ç¤ÈÅù²Á¤Ê´Ø¿ô¡£ *namePtr ¤Ï¡¢gfarmGssDeleteName() ¤òÍѤ¤¤Æ²òÊü¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ À®¸ù¤·¤¿¾ì¹ç 1 ¤¬Ê֤ꡢ¤½¤Î¾¤Î¾ì¹ç¤Ë¤Ï -1 °Ê²¼¤¬Ê֤롣 ¼ºÇÔ¤·¤¿¾ì¹ç¡¢*majStatPtr, *minStatPtr ¤Ë¤Ï¡¢¤½¤ì¤¾¤ì GSSAPI ¸Æ¤Ó½Ð¤·¤Î major status, minor status ¤¬Ê֤롣 int gfarmGssImportNameOfHost(gss_name_t *namePtr, char *hostname, OM_uint32 *majStatPtr, OM_uint32 *minStatPtr); gfarmGssImportNameOfHostBasedService() ¤Î service ¤ËÂФ·¤Æ "host" ¤ò »ØÄꤷ¤¿¾ì¹ç¤ÈÅù²Á¤Ê´Ø¿ô¡£ *namePtr ¤Ï¡¢gfarmGssDeleteName() ¤òÍѤ¤¤Æ²òÊü¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ À®¸ù¤·¤¿¾ì¹ç 1 ¤¬Ê֤ꡢ¤½¤Î¾¤Î¾ì¹ç¤Ë¤Ï -1 °Ê²¼¤¬Ê֤롣 ¼ºÇÔ¤·¤¿¾ì¹ç¡¢*majStatPtr, *minStatPtr ¤Ë¤Ï¡¢¤½¤ì¤¾¤ì GSSAPI ¸Æ¤Ó½Ð¤·¤Î major status, minor status ¤¬Ê֤롣 int gfarmGssDeleteName(gss_name_t *namePtr, OM_uint32 *majStatPtr, OM_uint32 *minStatPtr); namePtr ¤ËÅϤµ¤ì¤¿ gss_name_t ¤ò²òÊü¤¹¤ë¡£ À®¸ù¤·¤¿¾ì¹ç 1 ¤¬Ê֤ꡢ¤½¤Î¾¤Î¾ì¹ç¤Ë¤Ï -1 °Ê²¼¤¬Ê֤롣 int gfarmGssNewCredentialName(gss_name_t *outputNamePtr, gss_cred_id_t cred, OM_uint32 *majStatPtr, OM_uint32 *minStatPtr); cred ¤ÇÍ¿¤¨¤é¤ì¤¿ credential ¤Î̾Á°¤ò *outputNamePtr ¤ËÊÖ¤¹¡£ *outputNamePtr ¤Ï¡¢gfarmGssDeleteName() ¤òÍѤ¤¤Æ²òÊü¤·¤Ê¤±¤ì¤Ð ¤Ê¤é¤Ê¤¤¡£ À®¸ù¤·¤¿¾ì¹ç 1 ¤¬Ê֤ꡢ¤½¤Î¾¤Î¾ì¹ç¤Ë¤Ï -1 ¤¬Ê֤롣 char * gfarmGssNewDisplayName(const gss_name_t inputName, OM_uint32 *majStatPtr, OM_uint32 *minStatPtr, gss_OID *outputNameTypePtr); inputName ¤ò¡¢É½¼¨²Äǽ¤Êʸ»úÎó¤ËÊÑ´¹¤·¤ÆÊÖ¤¹¡£ ÊÖ¤êÃÍ¤Ï free() ¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ outputNameTypePtr ¤¬ NULL ¤Ç¤Ê¤¤¾ì¹ç¡¢*outputNameTypePtr ¤Ë ÊÑ´¹·ë²Ì¤Îʸ»úÎó¤Î nameType ¤òÊÖ¤¹¡£ Globus GSSAPI ¤òÍøÍѤ·¤Æ¤¤¤ë¾ì¹ç¡¢¤³¤Î´Ø¿ô¤ÎÌá¤êÃͤ¬ NULL °Ê³°¤Ç¡¢ ¤«¤Ä *outputNameTypePtr ¤¬ GSS_C_NT_ANONYMOUS °Ê³°¤Ç¤¢¤ë¤Ê¤é¡¢ Ìá¤êÃÍ¤Ï X.509 ¤Î DN ¤À¤È¹Í¤¨¤ÆÎɤ¤¡£¸½ºß¤Î GFSL ¤Ç¤Ï¡¢ GSS_C_NT_ANONYMOUS ¤òÌÀ¼¨Åª¤Ë¶Ø»ß¤·¤Æ¤¤¤ë¤Î¤Ç¡¢¾ï¤Ë X.509 DN ¤¬Ê֤롣 int gfarmGssAcquireCredential(gss_cred_id_t *credPtr, const gss_name_t desiredName, gss_cred_usage_t credUsage, OM_uint32 *majStatPtr, OM_uint32 *minStatPtr, gss_name_t *credNamePtr); desiredName ¤È credUsage (GSS_C_INITIATE, GSS_C_ACCEPT, GSS_C_BOTH) ¤Ë½¾¤¤¡¢credential ¤òÀ¸À®¤·¡¢*credPtr ¤ËÊÖ¤¹¡£ *credPtr ¤Ï¡¢gfarmGssDeleteCredential() ¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ acceptor ¦¤Ç¥Û¥¹¥È¾ÚÌÀ½ñ¤ò»È¤¦¾ì¹ç¡¢¤ª¤è¤Ó initiator ¦¤Ç¥æ¡¼¥¶ ¾ÚÌÀ½ñ¤ò»È¤¦¾ì¹ç¤Ë¤Ï¡¢desiredName ¤Ë GSS_C_NO_NAME ¤ò»ØÄꤷ¤Æ¤è¤¤¡£ acceptor ¦¤Ç¥µ¡¼¥Ó¥¹¾ÚÌÀ½ñ¤ò»È¤¦¾ì¹ç¤Ë¤Ï¡¢credUsage ¤Ë GSS_C_ACCEPT ¤ò»ØÄꤹ¤ë¡£ credNamePtr ¤¬ NULL °Ê³°¤Î¾ì¹ç¡¢*credNamePtr ¤Ë¤Ï¡¢*credPtr ¤Î ̾Á°¤¬Ê֤롣 *credNamePtr ¤Ï¡¢gfarmGssDeleteName() ¤òÍѤ¤¤Æ²òÊü¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ credential ¤ÎÀ¸À®¤ËÀ®¸ù¤·¤¿¾ì¹ç 1 ¤¬Ê֤ꡢ¤½¤Î¾¤Î¾ì¹ç¤Ë¤Ï -1 °Ê²¼¤¬ Ê֤롣 ¥¨¥é¡¼¤Î¾ì¹ç¡¢*majStatPtr, *minStatPtr ¤Ë¤Ï¡¢¤½¤ì¤¾¤ì GSSAPI ¸Æ¤Ó½Ð¤·¤Î major status, minor status ¤¬Ê֤롣 int gfarmGssDeleteCredential(gss_cred_id_t cred, OM_uint32 *majStatPtr, OM_uint32 *minStatPtr) cred ¤Ç»ØÄꤷ¤¿ credential ¤ò²òÊü¤¹¤ë¡£ À®¸ù¤·¤¿¾ì¹ç 1 ¤¬Ê֤ꡢ¤½¤Î¾¤Î¾ì¹ç¤Ë¤Ï -1 °Ê²¼¤¬Ê֤롣 *majStatPtr, *minStatPtr ¤Ë¤Ï¡¢¤½¤ì¤¾¤ì GSSAPI ¸Æ¤Ó½Ð¤·¤Î major status, minor status ¤¬Ê֤롣 int gfarmGssAcceptSecurityContext(int fd, gss_cred_id_t cred, gss_ctx_id_t *scPtr, OM_uint32 *majStatPtr, OM_uint32 *minStatPtr, gss_name_t *remoteNamePtr, gss_cred_id_t *remoteCredPtr); cred ¤È fd ¤ò»ÈÍѤ·¤Æ¡¢acceptor ¦ secure context ¤òÀ¸À®¤·¡¢ *scPtr ¤ÇÊÖ¤¹¡£ remoteNamePtr ¤¬ NULL °Ê³°¤Î¾ì¹ç¡¢*remoteNamePtr ¤Ë¤Ï initiator ¦¤Î ̾Á°¤¬Ê֤롣 *remoteNamePtr ¤Ï gfarmGssDeleteName() ¤òÍѤ¤¤Æ²òÊü¤·¤Ê¤±¤ì¤Ð ¤Ê¤é¤Ê¤¤¡£ *remoteCredPtr ¤Ë¤Ï initiator ¦¤«¤é delegate ¤µ¤ì¤¿ credential ¤¬Ê֤롣 *remoteCredPtr ¤Ï¡¢gfarmGssDeleteCredential() ¤òÍѤ¤¤Æ²òÊü¤·¤Ê¤±¤ì¤Ð ¤Ê¤é¤Ê¤¤¡£ secure context ¤ÎÀ¸À®¤ËÀ®¸ù¤·¤¿¾ì¹ç¤Ë¤Ï 1 ¤¬Ê֤ꡢ¤½¤Î¾¤Î¾ì¹ç¤Ë¤Ï -1 °Ê²¼¤¬Ê֤롣*majStatPtr, *minStatPtr ¤Ë¤Ï¡¢¤½¤ì¤¾¤ì GSSAPI¸Æ¤Ó½Ð¤·¤Î major status, minor status ¤¬Ê֤롣 int gfarmGssInitiateSecurityContext(int fd, const gss_name_t acceptorName, gss_cred_id_t cred, OM_uint32 reqFlag, gss_ctx_id_t *scPtr, OM_uint32 *majStatPtr, OM_uint32 *minStatPtr, gss_name_t *remoteNamePtr); cred ¤È fd ¤ò»ÈÍѤ·¤Æ¡¢initiator ¦ secure context ¤òÀ¸À®¤·¡¢ *scPtr ¤ÇÊÖ¤¹¡£reqFlag ¤Ë¤Ï initiate ¤Î¥ª¥×¥·¥ç¥ó¤òÍ¿¤¨¤ë(ÄÌ ¾ï¡¢GFARMR_GSS_DEFAULT_SECURITY_SETUP_FLAG ¤ò»ÈÍѤ¹¤ë¤³¤È)¡£ acceptorName¤Ë¤Ï¡¢ÀܳÂоݤΠacceptor ¤ËɬÍפʸ¢¸Â¤ò»ØÄꤹ¤ë¡£ acceptor ¤òǧ¾Ú¤¹¤ëɬÍפ¬¤Ê¤¤¾ì¹ç¡¢acceptorName ¤Ë GSS_C_NO_NAME ¤ò »ØÄꤷ¤Æ¤è¤¤¤¬¡¢credential ¤ò delegate ¤¹¤ë¾ì¹ç¡¢¥»¥­¥å¥ê¥Æ¥£¾å¤Î Íýͳ¤«¤é¡¢¤³¤ì¤Ïµö¤µ¤ì¤Ê¤¤¡£ remoteNamePtr ¤¬ NULL °Ê³°¤Î¾ì¹ç¡¢*remoteNamePtr ¤Ë¤Ï¡¢acceptor ¦¤Î ̾Á°¤¬Ê֤롣 *remoteNamePtr ¤Ï gfarmGssDeleteName() ¤òÍѤ¤¤Æ²òÊü¤·¤Ê¤±¤ì¤Ð ¤Ê¤é¤Ê¤¤¡£ secure context ¤ÎÀ¸À®¤ËÀ®¸ù¤·¤¿¾ì¹ç¤Ë¤Ï 1 ¤¬Ê֤ꡢ ¤½¤Î¾¤Î¾ì¹ç¤Ë¤Ï -1 °Ê²¼¤¬Ê֤롣 *majStatPtr, *minStatPtr ¤Ë¤Ï¡¢¤½¤ì¤¾¤ì GSSAPI ¸Æ¤Ó½Ð¤·¤Î major status, minor status ¤¬Ê֤롣 void gfarmGssDeleteSecurityContext(gss_ctx_id_t *scPtr); *scPtr ¤Ç¼¨¤µ¤ì¤ë secure context ¤òÇË´þ¤¹¤ë¡£ int gfarmGssConfigureMessageSize(gss_ctx_id_t sCtx, int doEncrypt, gss_qop_t qopReq, unsigned int reqOutSz, unsigned int *maxInSzPtr, OM_uint32 *majStatPtr, OM_uint32 *minStatPtr); doEncrypt(1:°Å¹æ²½¤¹¤ë, 0:¤·¤Ê¤¤), qopReq(Ä̾ï GFARM_GSS_DEFAULT_QOP ¤ò»ÈÍÑ), reqOutSz ¤è¤ê¡¢sCtx ¤ò»ÈÍѤ¹¤ë ºÝ¤Î GSSAPI Æþ½ÐÎÏ/wrap/unwrap ´Ø¿ô·²ÍѤκÇÂç¥á¥Ã¥»¡¼¥¸Ä¹¤ò·è Äꤷ¡¢*maxInSzPtr ¤ÇÊÖ¤¹¡£Àµ¤·¤¯½èÍý¤µ¤ì¤¿¾ì¹ç¤Ë¤Ï 1 ¤¬Ê֤ꡢ ¤½¤Î¾¤Î¾ì¹ç¤Ë¤Ï -1 °Ê²¼¤¬Ê֤롣*majStatPtr, *minStatPtr ¤Ë¤Ï¡¢ ¤½¤ì¤¾¤ì GSSAPI ¸Æ¤Ó½Ð¤·¤Î major status, minor status ¤¬Ê֤롣 int gfarmGssSend(int fd, gss_ctx_id_t sCtx, int doEncrypt, gss_qop_t qopReq, gfarm_int8_t *buf, int n, int chunkSz, OM_uint32 *statPtr); sCtx, doEncrypt, qopReq ¤Ë¤è¤ê¡¢buf (Ťµ n ¥Ð¥¤¥È)¤ò°Å¹æ²½¤· fd ¤Ë½ÐÎϤ¹¤ë¡£sCtx, doEncrypt, qopReq ¤Ï gfarmGssConfigureMessageSize() ¤ò¸Æ¤Ó½Ð¤·¤¿»þ¤ÈƱ¤¸Ãͤò»ÈÍѤ· ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£chunkSz ¤Ï gfarmGssConfigureMessageSize() ¤Ç ·èÄꤷ¤¿ºÇÂç¥á¥Ã¥»¡¼¥¸Ä¹¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£Àµ¤·¤¯½èÍý¤µ¤ì¤¿¾ì ¹ç¤Ë¤Ï n ¤¬Ê֤ꡢ¤½¤Î¾¤Î¾ì¹ç¤Ë¤Ï 0 °Ê²¼¤¬Ê֤롣*statPtr ¤Ë¤Ï GSSAPI ¸Æ¤Ó½Ð¤·¤Î status ¤¬Ê֤롣 int gfarmGssReceive(int fd, gss_ctx_id_t sCtx, gfarm_int8_t **bufPtr, int *lenPtr, OM_uint32 *statPtr); fd ¤«¤é¼õ¤±¼è¤Ã¤¿°Å¹æÊ¸¤ò sCtx ¤Çʿʸ²½¤·¡¢**bufPtr ¤ÇÊÖ¤¹¡£Ê¿ ʸ¤ÎŤµ¤Ï *lenPtr ¤ÇÊ֤롣*bufPtr ¤Ï free() ¤µ¤ì¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê ¤¤¡£Àµ¤·¤¯½èÍý¤µ¤ì¤¿¾ì¹ç¤Ë¤Ï *lenPtr ¤ÈƱ¤¸Ãͤ¬Ê֤ꡢ¤½¤Î¾¤Î ¾ì¹ç¤Ë¤Ï 0 °Ê²¼¤¬Ê֤롣*statPtr ¤Ë¤Ï GSSAPI ¸Æ¤Ó½Ð¤·¤Î status ¤¬Ê֤롣 ǧ²Ä·Ï int gfarmAuthInitialize(char *usermapFile); usermapFile ¤Ç»ØÄꤷ¤¿ DN -> UNIX uid ¤Ø¤ÎÊÑ´¹¥Æ¡¼¥Ö¥ë¤òÍѤ¤¡¢ ǧ²Ä¥Ç¡¼¥¿¥Ù¡¼¥¹¤ò½é´ü²½¤¹¤ë¡£NULL ¤â¤·¤¯¤Ï "" ¤¬Í¿¤¨¤é¤ì¤¿¾ì ¹ç¡¢${GFARM_HOME}/etc/gfarm-usermap ¤¬»ÈÍѤµ¤ì¤ë¡£Àµ¤·¤¯½é´ü²½ ¤µ¤ì¤¿¾ì¹ç¤Ë¤Ï 1 ¤¬Ê֤ꡢ¤½¤Î¾¤Î¾ì¹ç¤Ë¤Ï -1 °Ê²¼¤¬Ê֤롣 void gfarmAuthFinalize(void); gfarmAuthInitialize() ¤Ç½é´ü²½¤µ¤ì¤¿Ç§²Ä¥Ç¡¼¥¿¥Ù¡¼¥¹Á´ÂΤòÇË´þ¤¹¤ë¡£ gfarmAuthEntry * gfarmAuthGetUserEntry(char *distUserName); distUserName ¤Ç»ØÄꤵ¤ì¤¿ DN ¤ò»ý¤Ä¥¨¥ó¥È¥ê¤òǧ²Ä¥Ç¡¼¥¿¥Ù¡¼¥¹ ¤«¤é¸¡º÷¤¹¤ë¡£Åö³º¥¨¥ó¥È¥ê¤¬¸«¤Ä¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï¤½¤Î¥¨¥ó¥È¥ê¤òÊÖ ¤·¡¢¤½¤ì°Ê³°¤Î¾ì¹ç¤Ë¤Ï NULL ¤òÊÖ¤¹¡£ void gfarmAuthDestroyUserEntry(gfarmAuthEntry *aePtr); aePtr ¤Ç¼¨¤µ¤ì¤ë¥¨¥ó¥È¥ê¤òÇË´þ¤¹¤ë¡£ void gfarmAuthMakeThisAlone(gfarmAuthEntry *laePtr); ǧ²Ä¥Ç¡¼¥¿¥Ù¡¼¥¹Á´ÂΤòÇË´þ¤·¡¢laePtr ¤Ç¼¨¤µ¤ì¤ë¥¨¥ó¥È¥ê¤Î¼ÂÂÎ ¤Î¤ß¤ò»Ä¤¹¡£setuid(0) ¤Ê¥×¥í¥»¥¹¤¬ setuid(0°Ê³°)¤·¤¿»þ¤Ë¡¢Í¾·× ¤Ê¤â¤Î¤ò¸«¤¨¤Ê¤¯¤¹¤ë¤è¤¦¤Ë¤¹¤ë¤¿¤á¡£ XXX GFARM_FAKE_GSS_C_NT_USER_NAME_FOR_GLOBUS ¤¬À®¤êΩ¤Ã¤Æ ¤¤¤ë¾ì¹ç¤Ï¡¢Ç§²Ä¥Ç¡¼¥¿¥Ù¡¼¥¹¤ÎÇË´þ¤Ï¹Ô¤ï¤ì¤Ê¤¤¡£ ¤³¤ì¤Ï¡¢initiator ¦¤È¤·¤ÆÆ°ºî¤¹¤ë¾ì¹ç¤â¡¢ ǧ²Ä¥Ç¡¼¥¿¥Ù¡¼¥¹¤¬É¬Íפʤ¿¤á¡£ Session #define GFARM_SS_USE_ENCRYPTION 0x1 #define GFARM_SS_USE_COMPRESSION 0x2 #define GFARM_SS_USE_SYSTEMCONF 0x80000000 #define GFARM_SS_OPT_QOP_MASK 0x1 #define GFARM_SS_OPT_MAXT_MASK 0x2 #define GFARM_SS_OPT_CONF_MASK 0x4 #define GFARM_SS_OPT_ALL_MASK 0x7 char ** gfarmSecSessionCrackStatus(gfarmSecSession *ssPtr); ssPtr ¤Ç¼¨¤µ¤ì¤ë session ¤Ç¤Î GSSAPI ¸Æ¤Ó½Ð¤·¤Î status ¤ò²ÄÆÉ ʸ»úÎó¤ÎÇÛÎó¤ËÊÑ´¹¤¹¤ë¡£ÊÖ¤êÃÍ¤Ï gfarmSecSessionFreeCrackedStatus() ¤Ç²òÊü¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ void gfarmSecSessionFreeCrackedStatus(char **strPtr); gfarmSecSessioCrackStatus() ¤ÎÊÖ¤êÃͤò²òÊü¤¹¤ë¡£ void gfarmSecSessionPrintStatus(gfarmSecSession *ssPtr); ssPtr ¤Ç¼¨¤µ¤ì¤ë session ¤Ç¤Î GSSAPI ¸Æ¤Ó½Ð¤·¤Î status ¤ò²ÄÆÉ ʸ»úÎó¤È¤·¤Æ¥í¥°¤Ë½ÐÎϤ¹¤ë¡£ int gfarmSecSessionInitializeAcceptor(char *configFile, char *usermapFile, OM_uint32 *majStatPtr, OM_uint32 *minStatPtr); ÄÌ¿®¥Ñ¥é¥á¥¿ÀßÄê¥Õ¥¡¥¤¥ë configFile, ÊÑ´¹¥Æ¡¼¥Ö¥ë usermapFile ¤òÍѤ¤¡¢acceptor ¦¤Î session À¸À®´Ä¶­¤ò½é´ü²½¤¹¤ë¡£Àµ¤·¤¯½é´ü ²½¤µ¤ì¤¿¾ì¹ç¤Ë¤Ï 1 ¤¬Ê֤ꡢ¤½¤Î¾¤Î¾ì¹ç¤Ë¤Ï -1 °Ê²¼¤¬Ê֤롣 *majStatPtr, *minStatPtr ¤Ë¤Ï¡¢¤½¤ì¤¾¤ì GSSAPI ¸Æ¤Ó½Ð¤·¤Î major status, minor status ¤¬Ê֤롣 ¥Õ¥¡¥¤¥ë̾¤È¤·¤Æ NULL ¤â¤·¤¯¤Ï "" ¤ò»ÈÍѤ·¤¿¾ì¹ç¡¢¤½¤ì¤¾¤ì¡¢ ${GFARM_HOME}/etc/gfarm-acceptor.conf ${GFARM_HOME}/etc/gfarm-usermap ¤¬»ÈÍѤµ¤ì¤ë¡£ int gfarmSecSessionInitializeInitiator(char *configFile, char *usermapFile, OM_uint32 *majStatPtr, OM_uint32 *minStatPtr); ÄÌ¿®¥Ñ¥é¥á¥¿ÀßÄê¥Õ¥¡¥¤¥ë configFile, ÊÑ´¹¥Æ¡¼¥Ö¥ë usermapFile ¤òÍѤ¤¡¢initiator ¦¤Î session À¸À®´Ä¶­¤ò½é´ü²½¤¹¤ë¡£Àµ¤·¤¯½é´ü ²½¤µ¤ì¤¿¾ì¹ç¤Ë¤Ï 1 ¤¬Ê֤ꡢ¤½¤Î¾¤Î¾ì¹ç¤Ë¤Ï -1 °Ê²¼¤¬Ê֤롣 *majStatPtr, *minStatPtr ¤Ë¤Ï¡¢¤½¤ì¤¾¤ì GSSAPI ¸Æ¤Ó½Ð¤·¤Î major status, minor status ¤¬Ê֤롣 ¥Õ¥¡¥¤¥ë̾¤È¤·¤Æ NULL ¤â¤·¤¯¤Ï "" ¤ò»ÈÍѤ·¤¿¾ì¹ç¡¢ ${GFARM_HOME}/etc/gfarm-initiator.conf ${GFARM_HOME}/etc/gfarm-usermap ¤¬»ÈÍѤµ¤ì¤ë¡£ int gfarmSecSessionInitializeBoth(char *iConfigFile, char *aConfigFile, char *usermapFile, OM_uint32 *majstatPtr, OM_uint32 *minstatPtr); initiator ¦ÄÌ¿®¥Ñ¥é¥á¥¿ÀßÄê¥Õ¥¡¥¤¥ë iConfigFile, acceptor ¦ ÄÌ¿®¥Ñ¥é¥á¥¿ÀßÄê¥Õ¥¡¥¤¥ë aConfigFile, ÊÑ´¹¥Æ¡¼¥Ö¥ë usermapFile ¤òÍѤ¤¡¢initiator/acceptor ÁÐÊý¤Îưºî¤ò¹Ô¤ï¤»¤ë¾ì¹ç¤Î session À¸À®´Ä¶­¤ò½é´ü²½¤¹¤ë¡£Àµ¤·¤¯½é´ü²½¤µ¤ì¤¿¾ì¹ç¤Ë¤Ï 1 ¤¬Ê֤ꡢ¤½ ¤Î¾¤Î¾ì¹ç¤Ë¤Ï -1 °Ê²¼¤¬Ê֤롣*majStatPtr, *minStatPtr ¤Ë¤Ï¡¢ ¤½¤ì¤¾¤ì GSSAPI ¸Æ¤Ó½Ð¤·¤Î major status, minor status ¤¬Ê֤롣 ¥Õ¥¡¥¤¥ë̾¤È¤·¤Æ NULL ¤â¤·¤¯¤Ï "" ¤ò»ÈÍѤ·¤¿¾ì¹ç¡¢¤½¤ì¤¾¤ì¡¢ ${GFARM_HOME}/etc/gfarm-initiator.conf ${GFARM_HOME}/etc/gfarm-acceptor.conf ${GFARM_HOME}/etc/gfarm-usermap ¤¬»ÈÍѤµ¤ì¤ë¡£ void gfarmSecSessionFinalizeAcceptor(void); void gfarmSecSessionFinalizeInitiator(void); void gfarmSecSessionFinalizeBoth(void); acceptor, initiator, both ¤Î¡¢¤½¤ì¤¾¤ì¤ÎÌò³äÍѤȤ·¤Æ½é´ü²½¤µ¤ì ¤¿ session À¸À®´Ä¶­¤òÇË´þ¤¹¤ë¡£ gfarmSecSession * gfarmSecSessionAccept(int fd, gss_cred_id_t cred, gfarmSecSessionOption *ssOptPtr, OM_uint32 *majStatPtr, OM_uint32 *minStatPtr); fd, cred ¤ò»ÈÍѤ·¤Æ¡¢session ¤ò accept ¤¹¤ë¡£*ssOptPtr ¤ÏÄ̾ï NULL ¤ò»ÈÍѤ¹¤ë¡£session ¤Î accept ¤ËÀ®¸ù¤¹¤ë¤È session ¤òÊÖ¤¹¡£ ¤½¤ì°Ê³°¤Î¾ì¹ç¤Ë¤Ï NULL ¤òÊÖ¤¹¡£*majStatPtr, *minStatPtr ¤Ë¤Ï¡¢ ¤½¤ì¤¾¤ì GSSAPI ¸Æ¤Ó½Ð¤·¤Î major status, minor status ¤¬Ê֤롣 cred ¤Ë GSS_C_NO_CREDENTIAL ¤ò»ÈÍѤ·¤¿¾ì¹ç¡¢ a. getuid() == 0 ¤Î¾ì¹ç host certificate ¤«¤éÀ¸À®¤µ¤ì¤¿ credential b. getuid() != 0 ¤Î¾ì¹ç user certificate ¤«¤éÀ¸À®¤µ¤ì¤¿ credential ¤ò»ÈÍѤ¹¤ë¡£cred != GSS_C_NO_CREDENTIAL ¤Î¾ì¹ç¡¢ÆÃ¤Ë¡¢cred ¤¬ user certificate ¤«¤éÀ¸À®¤µ¤ì¤¿ credential ¤Ç¤¢¤ë¾ì¹ç¡¢user to user ¤Çǧ¾Ú¤ò¹Ô¤¦¤³¤È¤Ë¤Ê¤ê¡¢security level ¤¬Äã²¼¤¹¤ë¤³¤È¤ËÃí °Õ¡£¤È¤¤¤¦¤ï¤±¤Ç¡¢GSS_C_NO_CREDENTIAL ¤ò¾ï¤Ë»ÈÍѤ·¤Æ¤â¤è¤¤¡£ gfarmSecSession * gfarmSecSessionInitiate(int fd, const gss_name_t acceptorName, gss_cred_id_t cred, OM_uint32 reqFlag, gfarmSecSessionOption *ssOptPtr, OM_uint32 *majStatPtr, OM_uint32 *minStatPtr); fd, cred ¤òÍøÍѤ·¤Æ¡¢session ¤ò initiate ¤¹¤ë¡£*ssOptPtr ¤ÏÄÌ ¾ï NULL ¤ò»ÈÍѤ¹¤ë¡£*majStatPtr, *minStatPtr ¤Ë¤Ï¡¢¤½¤ì¤¾¤ì GSSAPI ¸Æ¤Ó½Ð¤·¤Î major status, minor status ¤¬Ê֤롣 cred ¤Ë GSS_C_NO_CREDENTIAL ¤ò»ÈÍѤ·¤¿¾ì¹ç¡¢user certificate ¤«¤éÀ¸À®¤µ¤ì¤¿ credential ¤¬»ÈÍѤµ¤ì¤ë¡£ gfarmSecSessionInitializeBoth() ¤Ç½é´ü²½¤µ¤ì¤¿ session À¸À®´Ä ¶­¤Ç¤Î¤ß¡¢initiator ¤«¤é delegation ¤µ¤ì¤¿ credential ¤ò cred ¤Ë»ØÄꤷ¤Æ session ¤ò initiate ¤¹¤ë¤³¤È¡£ gfarmSecSession * gfarmSecSessionInitiateByName( char *hostname, int port, char *acceptorNameString, gss_OID acceptorNameType, gss_cred_id_t cred, OM_uint32 reqFlag, gfarmSecSessionOption *ssOptPtr, OM_uint32 *majStatPtr, OM_uint32 *minStatPtr); ¥Û¥¹¥È̾ hostname, port ÈÖ¹æ port ¤òÍøÍѤ·¤Æ¡¢hostname:port ¤Ë connect(2) ¤·¤¿¸å¡¢connect(2) ¤ÇÀ¸À®¤µ¤ì¤¿ fd ¤È cred ¤ò»ÈÍѤ· ¤Æ¡¢session ¤ò initiate ¤¹¤ë¡£°Ê²¼ gfarmSecSessionInitiate() ¤ÈƱÍÍ¡£ void gfarmSecSessionTerminate(gfarmSecSession *ssPtr); initiate/accept ¤·¤¿ session ssPtr ¤ò½ªÎ»¤¹¤ë¡£ gfarmSecSessionAccept(), gfarmSecSessionInitiate() ¤ÇÀ¸À®¤µ¤ì ¤¿ session ¤Ç¤Ï¡¢ÄÌ¿®¤Ë»ÈÍѤ·¤¿ fd ¤Ï close(2) ¤µ¤ì¤Ê¤¤¤Î¤Ç¡¢ close(2) ¤òÌÀ¼¨Åª¤Ë¸Æ¤Ö¤³¤È¡£ gss_cred_id_t gfarmSecSessionGetDelegatedCredential(gfarmSecSession *ssPtr); accept ¤·¤¿ session ssPtr ¤«¤é¡¢initiator ¤«¤é delegateion ¤µ ¤ì¤¿ credential ¤ò¼èÆÀ¤¹¤ë¡£initiator ¤¬ delegation ¤òµö²Ä¤·¤Æ ¤¤¤Ê¤¤¾ì¹ç¡¢GSS_C_NO_CONTEXT ¤¬Ê֤롣initiate ¤·¤¿ session ¤ò »ÈÍѤ¹¤ë¤È¡¢GSS_C_NO_CONTEXT ¤¬Ê֤롣 int gfarmSecSessionGetInitiatorName(gfarmSecSession *ssPtr, gss_name_t *namePtr); accept ¤·¤¿ session ssPtr ¤«¤é¡¢initiator ¤Î̾Á°¤ò¼èÆÀ¤·¡¢ *namePtr ¤ËÊÖ¤¹¡£ À®¸ù¤·¤¿¾ì¹ç 1 ¤¬Ê֤ꡢ¤½¤Î¾¤Î¾ì¹ç¡¢¤¿¤È¤¨¤Ð initiate ¤·¤¿ session ¤ò»ÈÍѤ¹¤ë¤È -1 °Ê²¼¤òÊÖ¤¹¡£ gfarmAuthEntry * gfarmSecSessionGetInitiatorInfo(gfarmSecSession *ssPtr); accept ¤·¤¿ session ssPtr ¤«¤é¡¢Âбþ¤¹¤ëǧ²Ä¥Ç¡¼¥¿¥Ù¡¼¥¹¥¨¥ó¥È¥ê ¤òÆÀ¤ë¡£initiate ¤·¤¿ session ¤ò»ÈÍѤ¹¤ë¤È¡¢NULL ¤¬Ê֤롣 int gfarmSecSessionDedicate(gfarmSecSession *ssPtr); accept ¤·¤¿ session ssPtr ¤ËÂбþ¤¹¤ë¥í¡¼¥«¥ë¥Þ¥·¥ó¤Î¥æ¡¼¥¶¤Î¤¿¤á¤Î ÀìÍÑ¥×¥í¥»¥¹¤Ë¤Ê¤ë¤¿¤á¤Î¤ª¤Þ¤¸¤Ê¤¤¡£ a. gfarmAuthMakeThisAlone() ¤ò¸Æ¤Ó¡¢Í¾·×¤Ê¾ðÊó¤ò²òÊü¤¹¤ë¡£ b. getuid() == 0 ¤Ç¤¢¤ë¾ì¹ç¡¢setgid(), setuid() ¤¹¤ë¡£ ¤Î½èÍý¤¬¹Ô¤ï¤ì¤ë¡£À®¸ù¤·¤¿¾ì¹ç 1 ¤¬Ê֤ꡢ¤½¤ì°Ê³°¤Î¾ì¹ç -1 °Ê ²¼¤¬Ê֤롣 int gfarmSecSessionSendInt8(gfarmSecSession *ssPtr, gfarm_int8_t *buf, int n); int gfarmSecSessionSendInt16(gfarmSecSession *ssPtr, gfarm_int16_t *buf, int n); int gfarmSecSessionSendInt32(gfarmSecSession *ssPtr, gfarm_int32_t *buf, int n); session ssPtr ¤òÍøÍѤ·¤Æ¡¢buf ¤Ç¼¨¤µ¤ì¤ë n ¸Ä¤Î byte, short, long ¤òÁ÷¿®¤¹¤ë¡£À®¸ù¤¹¤ë¤È n ¤¬Ê֤ꡢ¤½¤ì°Ê³°¤Ï 0 °Ê²¼¤¬Ê֤롣 int gfarmSecSessionReceiveInt8(gfarmSecSession *ssPtr, gfarm_int8_t **bufPtr, int *lenPtr); int gfarmSecSessionReceiveInt16(gfarmSecSession *ssPtr, gfarm_int16_t **bufPtr, int *lenPtr); int gfarmSecSessionReceiveInt32(gfarmSecSession *ssPtr, gfarm_int32_t **bufPtr, int *lenPtr); session ssPtr ¤òÍøÍѤ·¤Æ¡¢byte, net short, net long ¤ò¼õ¿®¤¹¤ë¡£¼õ¿®¤· ¤¿¸Ä¿ô¤Ï *lenPtr ¤ÇÊÖ¤¹¡£*bufPtr ¤Ï free() ¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£ À®¸ù¤¹¤ë¤È *lenPtr ¤ÈƱ¤¸Ãͤ¬Ê֤ꡢ¤½¤ì°Ê³°¤Î¾ì¹ç¤Ï 0 °Ê²¼¤¬Ê֤롣 int gfarmSecSessionPoll(gfarmSecSession *ssList[], int n, struct timeval *toPtr); ssList ¤Ç¼¨¤µ¤ì¤¿ÇÛÎóÆâ¤Î n ¸Ä¤Î session ¤ÎÆþ½ÐÎϲÄÈݤò poll ¤¹¤ë¡£toPtr ¤Ë¤Ï select(2) ¤Î timeout ÃÍ¤ÈÆ±ÍͤÎÃͤò»ØÄꤹ¤ë¡£ ÊÖ¤êÃͤâ select(2) ¤ÈƱ°ì¡£°Ê²¼¤Î¥Þ¥¯¥í¤ò»ÈÍѤ·¤Æ¡¢poll ¤¹¤Ù¤­ event ¤Î»ØÄê/ȽÄê¤ò¹Ô¤¦¡£ #define GFARM_SS_POLL_NONE 0x0 #define GFARM_SS_POLL_READABLE 0x1 #define GFARM_SS_POLL_WRITABLE 0x2 #define GFARM_SS_POLL_ERROR 0x4 #define gfarmSecSessionCheckPollReadable(s) (isBitSet(s->pollEvent, GFARM_SS_POLL_READABLE)) #define gfarmSecSessionCheckPollWritable(s) (isBitSet(s->pollEvent, GFARM_SS_POLL_WRITABLE)) #define gfarmSecSessionCheckPollError(s) (isBitSet(s->pollEvent, GFARM_SS_POLL_WRITABLE)) #define gfarmSecSessionSetPollEvent(s, e) { s->pollEvent = (e); } #define gfarmSecSessionClearPollEvent(s) gfarmSecSessionSetPollEvent(s, GFARM_SS_POLL_NONE) #define gfarmSecSessionAddPollEvent(s, m) { s->pollEvent |= (m); } #define gfarmSecSessionDeletePollEvent(s, d) { s->pollEvent &= ~(d); } °Ê²¼¤Î´Ø¿ô¤Ï¡¢GFARM_GSS_EXPORT_CRED_ENABLED ¤Î¾ì¹ç¤Î¤ßÍ­¸ú gfarmExportedCredential * gfarmGssExportCredential(gss_cred_id_t cred, OM_uint32 *statPtr); »ØÄꤵ¤ì¤¿ credential (== Ä̾ï¤Ï delegated credential) ¤ò¡¢ »Ò¥×¥í¥»¥¹¤«¤é¤âÍøÍѤǤ­¤ë·Á¤Ç¸ø³«¤¹¤ë¡£ gfarmGssEnvForExportedCredential() ¤â»²¾È¡£ char * gfarmGssEnvForExportedCredential(gfarmExportedCredential *exportedCred); gfarmGssExportCredential() ¤Ç¸ø³«¤·¤¿ credential ¤òÍøÍѤ¹¤ë »Ò¥×¥í¥»¥¹¤ò¸Æ¤Ó½Ð¤¹ºÝ¤Ë¡¢ÀßÄꤷ¤Ê¤±¤ì¤Ð¤¤¤±¤Ê¤¤´Ä¶­ÊÑ¿ô¡£ ("ENV_NAME=value" ·Á¼°¤Îʸ»úÎó) void gfarmGssDeleteExportedCredential(gfarmExportedCredential *exportedCred); »Ò¥×¥í¥»¥¹¤Ø¸ø³«¤·¤¿ credential ¤òºï½ü¤¹¤ë¡£ ------------------------------------------------------------------------ Ãí1. gfarmGssImportName() ¤ÇÍøÍѤǤ­¤ë¡¢((nameValue, nameLength), nameType) ¤Î Áȹ礻¤Ë´Ø¤·¤Æ¤Ï¡¢RFC2743/RFC2744 ¤ò»²¾È¡£ ¶ñÂÎŪ¤ÊÁȹ礻¤Ï°Ê²¼¤ÎÄ̤ꡣ nameType nameValue GSS_C_NO_OID GSS¥á¥«¥Ë¥º¥à°Í¸¤ÎÃÍ (¤¿¤À¤· != NULL) Globus ¤Î¾ì¹ç¡¢X.509 Distinguish Name¡£ GSS_C_NT_HOSTBASED_SERVICE "¥µ¡¼¥Ó¥¹Ì¾@¥Û¥¹¥È̾" (¥Û¥¹¥È̾¤ÏFQDN) ¥µ¡¼¥Ó¥¹Ì¾¤Î³ä¤êÅö¤Æ¤Ï¡¢²¼µ­ URL »²¾È http://www.iana.org/assignments/gssapi-service-names ¥µ¡¼¥Ó¥¹Ì¾ "host" ¤Ï¡¢RFC2743 ¤ÇÄêµÁ¤µ¤ì¡¢Globus GSI ¤Ç¤Ï ¥Û¥¹¥È¾ÚÌÀ½ñ¤ò»²¾È¤¹¤ë¡£ GSS_C_NT_EXPORT_NAME mechanism name ·Á¼° ²¼µ­¤Ï Globus ¤¬¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤¤¿¤á¡¢GFSL ¤¬ÆÈ¼«¤Ë¼ÂÁõ¤·¤Æ¤¤¤ë¡£ GSS_C_NT_USER_NAME "¥í¡¼¥«¥ë¥æ¡¼¥¶Ì¾" (Globus ¤Ï GSS_C_NT_USER_NAME ¤ò¼õ¤±ÉÕ¤±¤ë¤¬¡¢ÆâÉôŪ¤Ë¤Ï GSS_C_NT_USER_NAME ¤Î½èÍý¤ò¹Ô¤Ã¤Æ¤ª¤é¤º¡¢GCC_C_NO_OID ¤ÈƱ¤¸°·¤¤¤Ë¤Ê¤ë¡£ ¤¹¤Ê¤ï¤Á¡¢X.509 Distinguish Name ¤òÍ׵᤹¤ë¡£ ¤³¤Î¤¿¤á¡¢GFSL ¤Î¥ì¥Ù¥ë¤ÇºÆ¼ÂÁõ¤·¤Æ¤¤¤ë¡£) ²¼µ­¤Ï Globus ¤¬¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤¡£ GSS_C_NT_STRING_UID_NAME "¥í¡¼¥«¥ë¥æ¡¼¥¶ID¤Î¿ôÃͤòɽ¤¹Ê¸»úÎó" GSS_C_NT_MACHINE_UID_NAME uid_t ¤Ø¤Î¥Ý¥¤¥ó¥¿ (¥Û¥¹¥È¥Ð¥¤¥È¥ª¡¼¥À) (Globus ¤Ï¤³¤ÎÃͤò¼õ¤±ÉÕ¤±¤ë¤¬¡¢ÆâÉôŪ¤Ë¤ÏÆÃ¤Ë½èÍý¤ò¹Ô¤Ã¤Æ¤ª¤é¤º¡¢ GCC_C_NO_OID ¤ÈƱ¤¸°·¤¤¤Ë¤Ê¤ë¡£) ------------------------------------------------------------------------ gfarm-2.4.1/lib/libgfarm/gfsl/gsi.c0000644000000000000000000010767211507222723015540 0ustar rootroot#include #include #include #include #include #include #include #include #include #include #include #include #include "gssapi.h" #include "gfevent.h" #include "gfutil.h" #include "thrsubr.h" #include "tcputil.h" #include "gfsl_config.h" #include "gfarm_gsi.h" #if GFARM_FAKE_GSS_C_NT_USER_NAME_FOR_GLOBUS #include "gfarm_auth.h" #endif static pthread_mutex_t gss_mutex = PTHREAD_MUTEX_INITIALIZER; static const char gssDiag[] = "gss_mutex"; static char **gssCrackStatus(OM_uint32 statValue, int statType); static int gssInitiateSecurityContextSwitch(struct gfarmGssInitiateSecurityContextState *state); static int gssInitiateSecurityContextNext(struct gfarmGssInitiateSecurityContextState *state); static void gfarmGssInitiateSecurityContextSendToken(int events, int fd, void *closure, const struct timeval *t); static void gfarmGssInitiateSecurityContextReceiveToken(int events, int fd, void *closure, const struct timeval *t); static char ** gssCrackStatus(statValue, statType) OM_uint32 statValue; int statType; { OM_uint32 msgCtx; OM_uint32 minStat; gss_buffer_desc stStr; char **ret; int i = 0; char *dP = NULL; GFARM_MALLOC_ARRAY(ret, 1); ret[0] = NULL; while (1) { msgCtx = 0; (void)gss_display_status(&minStat, statValue, statType, GSS_C_NO_OID, &msgCtx, &stStr); GFARM_REALLOC_ARRAY(ret, ret, i + 2); GFARM_MALLOC_ARRAY(ret[i], (int)stStr.length + 1); dP = ret[i]; dP[(int)stStr.length] = '\0'; i++; (void)memcpy((void *)dP, (void *)stStr.value, (int)stStr.length); (void)gss_release_buffer(&minStat, (gss_buffer_t)&stStr); if (msgCtx == 0) { break; } } ret[i] = NULL; return ret; } void gfarmGssFreeCrackedStatus(strPtr) char **strPtr; { char **cpS = strPtr; while (*cpS != NULL) { (void)free(*cpS++); } (void)free(strPtr); } char ** gfarmGssCrackMajorStatus(majStat) OM_uint32 majStat; { return gssCrackStatus(majStat, GSS_C_GSS_CODE); } char ** gfarmGssCrackMinorStatus(minStat) OM_uint32 minStat; { return gssCrackStatus(minStat, GSS_C_MECH_CODE); } void gfarmGssPrintMajorStatus(majStat) OM_uint32 majStat; { char **list = gfarmGssCrackMajorStatus(majStat); char **lP = list; if (*lP != NULL) { while (*lP != NULL) { gflog_error(GFARM_MSG_1000607, "\t : %s", *lP++); } } else { gflog_error(GFARM_MSG_1000608, "GSS Major Status Error: UNKNOWN"); } gfarmGssFreeCrackedStatus(list); } void gfarmGssPrintMinorStatus(minStat) OM_uint32 minStat; { char **list = gfarmGssCrackMinorStatus(minStat); char **lP = list; if (*lP != NULL) { while (*lP != NULL) gflog_error(GFARM_MSG_1000609, "\t : %s", *lP++); } else { gflog_error(GFARM_MSG_1000610, "GSS Minor Status Error: UNKNOWN\n"); } gfarmGssFreeCrackedStatus(list); } int gfarmGssImportName(namePtr, nameValue, nameLength, nameType, majStatPtr, minStatPtr) gss_name_t *namePtr; void *nameValue; size_t nameLength; gss_OID nameType; OM_uint32 *majStatPtr; OM_uint32 *minStatPtr; { OM_uint32 majStat = 0; OM_uint32 minStat = 0; int ret = -1; gss_buffer_desc buf; #if GFARM_FAKE_GSS_C_NT_USER_NAME_FOR_GLOBUS if (nameType == GSS_C_NT_USER_NAME) { char *user; gfarmAuthEntry *aePtr; GFARM_MALLOC_ARRAY(user, nameLength + 1); if (user == NULL) { gflog_auth_error(GFARM_MSG_1000611, "gfarmGssImportName(): no memory"); majStat = GSS_S_FAILURE; minStat = GFSL_DEFAULT_MINOR_ERROR; goto Done; } memcpy(user, nameValue, nameLength); user[nameLength] = '\0'; aePtr = gfarmAuthGetLocalUserEntry(user); if (aePtr == NULL) { gflog_auth_error(GFARM_MSG_1000612, "%s: ERROR: cannot convert " "this user name to X.509 Distinguish name", user); free(user); majStat = GSS_S_FAILURE; minStat = GFSL_DEFAULT_MINOR_ERROR; goto Done; } free(user); assert(aePtr->authType == GFARM_AUTH_USER); nameValue = aePtr->distName; nameLength = strlen(aePtr->distName); nameType = GSS_C_NO_OID; /* mechanism specific */ } #endif /* GFARM_FAKE_GSS_C_NT_USER_NAME_FOR_GLOBUS */ buf.length = nameLength; buf.value = nameValue; majStat = gss_import_name(&minStat, &buf, nameType, namePtr); if (majStat == GSS_S_COMPLETE) { ret = 1; /* OK */ } #if GFARM_FAKE_GSS_C_NT_USER_NAME_FOR_GLOBUS Done: #endif /* GFARM_FAKE_GSS_C_NT_USER_NAME_FOR_GLOBUS */ if (majStatPtr != NULL) { *majStatPtr = majStat; } if (minStatPtr != NULL) { *minStatPtr = minStat; } return ret; } int gfarmGssImportNameOfHostBasedService(namePtr, service, hostname, majStatPtr, minStatPtr) gss_name_t *namePtr; char *service; char *hostname; OM_uint32 *majStatPtr; OM_uint32 *minStatPtr; { OM_uint32 majStat; OM_uint32 minStat; int ret = -1; size_t nameLength = strlen(service) + 1 + strlen(hostname); char *nameString; GFARM_MALLOC_ARRAY(nameString, nameLength + 1); if (nameString == NULL) { gflog_auth_error(GFARM_MSG_1000613, "gfarmGssImportNameOfHostBasedService(): " "no memory"); majStat = GSS_S_FAILURE; minStat = GFSL_DEFAULT_MINOR_ERROR; } else { sprintf(nameString, "%s@%s", service, hostname); if (gfarmGssImportName(namePtr, nameString, nameLength, GSS_C_NT_HOSTBASED_SERVICE, &majStat, &minStat) > 0) { ret = 1; } free(nameString); } if (majStatPtr != NULL) { *majStatPtr = majStat; } if (minStatPtr != NULL) { *minStatPtr = minStat; } return ret; } int gfarmGssImportNameOfHost(namePtr, hostname, majStatPtr, minStatPtr) gss_name_t *namePtr; char *hostname; OM_uint32 *majStatPtr; OM_uint32 *minStatPtr; { return gfarmGssImportNameOfHostBasedService(namePtr, "host", hostname, majStatPtr, minStatPtr); } int gfarmGssDeleteName(namePtr, majStatPtr, minStatPtr) gss_name_t *namePtr; OM_uint32 *majStatPtr; OM_uint32 *minStatPtr; { OM_uint32 majStat; OM_uint32 minStat; majStat = gss_release_name(&minStat, namePtr); if (majStatPtr != NULL) { *majStatPtr = majStat; } if (minStatPtr != NULL) { *minStatPtr = minStat; } return majStat == GSS_S_COMPLETE ? 1 : -1; } #if 0 /* gss_duplicate_name() is not implemented at least in globus-2 yet. */ int gfarmGssDuplicateName(outputNamePtr, inputName, majStatPtr, minStatPtr) gss_name_t *outputNamePtr; const gss_name_t inputName; OM_uint32 *majStatPtr; OM_uint32 *minStatPtr; { OM_uint32 majStat; OM_uint32 minStat; majStat = gss_duplicate_name(&minStat, inputName, outputNamePtr); if (majStatPtr != NULL) { *majStatPtr = majStat; } if (minStatPtr != NULL) { *minStatPtr = minStat; } return majStat == GSS_S_COMPLETE ? 1 : -1; } #endif int gfarmGssNewCredentialName(outputNamePtr, cred, majStatPtr, minStatPtr) gss_name_t *outputNamePtr; gss_cred_id_t cred; OM_uint32 *majStatPtr; OM_uint32 *minStatPtr; { OM_uint32 majStat; OM_uint32 minStat; majStat = gss_inquire_cred(&minStat, cred, outputNamePtr, NULL, /* lifetime */ NULL, /* usage */ NULL /* supported mech */); if (majStatPtr != NULL) { *majStatPtr = majStat; } if (minStatPtr != NULL) { *minStatPtr = minStat; } return majStat == GSS_S_COMPLETE ? 1 : -1; } char * gfarmGssNewDisplayName(inputName, majStatPtr, minStatPtr, outputNameTypePtr) const gss_name_t inputName; OM_uint32 *majStatPtr; OM_uint32 *minStatPtr; gss_OID *outputNameTypePtr; { OM_uint32 majStat; OM_uint32 minStat, minStat2; char *ret = NULL; gss_buffer_desc buf; gss_OID outputNameType; if (inputName == GSS_C_NO_NAME) { gflog_auth_error(GFARM_MSG_1000614, "gfarmGssNewDisplayName(): GSS_C_NO_NAME is passed"); majStat = GSS_S_FAILURE; minStat = GFSL_DEFAULT_MINOR_ERROR; } else if ((majStat = gss_display_name(&minStat, inputName, &buf, &outputNameType)) == GSS_S_COMPLETE) { GFARM_MALLOC_ARRAY(ret, buf.length + 1); if (ret == NULL) { gflog_auth_error(GFARM_MSG_1000615, "gfarmGssNewDisplayName(): no memory"); majStat = GSS_S_FAILURE; minStat = GFSL_DEFAULT_MINOR_ERROR; } else { ret[buf.length] = '\0'; memcpy(ret, buf.value, buf.length); (void)gss_release_buffer(&minStat2, &buf); if (outputNameTypePtr != NULL) { *outputNameTypePtr = outputNameType; } } } if (majStatPtr != NULL) { *majStatPtr = majStat; } if (minStatPtr != NULL) { *minStatPtr = minStat; } return ret; } int gfarmGssAcquireCredential(credPtr, desiredName, credUsage, majStatPtr, minStatPtr, credNamePtr) gss_cred_id_t *credPtr; const gss_name_t desiredName; gss_cred_usage_t credUsage; OM_uint32 *majStatPtr; OM_uint32 *minStatPtr; gss_name_t *credNamePtr; { OM_uint32 majStat = 0; OM_uint32 minStat = 0; int ret = -1; gss_cred_id_t cred; *credPtr = GSS_C_NO_CREDENTIAL; majStat = gss_acquire_cred(&minStat, desiredName, GSS_C_INDEFINITE, GSS_C_NO_OID_SET, credUsage, &cred, NULL, NULL); #if GFARM_FAKE_GSS_C_NT_USER_NAME_FOR_GLOBUS if (majStat != GSS_S_COMPLETE) { OM_uint32 majStat2, majStat3; OM_uint32 minStat2, minStat3; /* * to workaround a problem that any proxy credential cannot be * acquired by using "/C=.../O=.../CN=John Smith" as its name. * Globus requires "/C=.../O=.../CN=John Smith/CN=proxy". */ majStat2 = gss_acquire_cred(&minStat2, GSS_C_NO_NAME, GSS_C_INDEFINITE, GSS_C_NO_OID_SET, credUsage, &cred, NULL, NULL); if (majStat2 == GSS_S_COMPLETE) { gss_name_t credName; if (gfarmGssNewCredentialName(&credName, cred, NULL, NULL) > 0) { int equal; majStat3 = gss_compare_name(&minStat3, desiredName, credName, &equal); if (majStat3 == GSS_S_COMPLETE && equal) { majStat = majStat2; minStat = minStat2; } gfarmGssDeleteName(&credName, NULL, NULL); } if (majStat != GSS_S_COMPLETE) { gfarmGssDeleteCredential(&cred, NULL, NULL); } } } #endif /* GFARM_FAKE_GSS_C_NT_USER_NAME_FOR_GLOBUS */ /* * Check validness. */ if (majStat == GSS_S_COMPLETE) { if (credNamePtr == NULL) { ret = 1; } else if (gfarmGssNewCredentialName(credNamePtr, cred, &majStat, &minStat) > 0) { /* Only valid when the name is got. */ ret = 1; } if (ret > 0 && credPtr != NULL) { *credPtr = cred; } else { gfarmGssDeleteCredential(&cred, NULL, NULL); } } if (majStatPtr != NULL) { *majStatPtr = majStat; } if (minStatPtr != NULL) { *minStatPtr = minStat; } if (ret == -1) { gflog_debug(GFARM_MSG_1000790, "failed to acquire credential (%u)(%u)", majStat, minStat); } return ret; } int gfarmGssDeleteCredential(credPtr, majStatPtr, minStatPtr) gss_cred_id_t *credPtr; OM_uint32 *majStatPtr; OM_uint32 *minStatPtr; { OM_uint32 majStat = 0; OM_uint32 minStat = 0; int ret = -1; majStat = gss_release_cred(&minStat, credPtr); if (majStat == GSS_S_COMPLETE) { ret = 1; /* valid */ } if (majStatPtr != NULL) { *majStatPtr = majStat; } if (minStatPtr != NULL) { *minStatPtr = minStat; } if (ret == -1) { gflog_debug(GFARM_MSG_1000791, "failed to delete credential (%u)(%u)", majStat, minStat); } return ret; } int gfarmGssSendToken(fd, gsBuf) int fd; gss_buffer_t gsBuf; { gfarm_int32_t iLen = (gfarm_int32_t)(gsBuf->length); if (gfarmWriteInt32(fd, &iLen, 1) != 1) { gflog_debug(GFARM_MSG_1000792, "gfarmWriteInt32() failed"); return -1; } if (gfarmWriteInt8(fd, (gfarm_int8_t *)(gsBuf->value), iLen) != iLen) { gflog_debug(GFARM_MSG_1000793, "gfarmWriteInt8() failed"); return -1; } return iLen; } int gfarmGssReceiveToken(fd, gsBuf) int fd; gss_buffer_t gsBuf; { gfarm_int32_t iLen; gfarm_int8_t *buf = NULL; char *p; if (gsBuf->value != NULL) { OM_uint32 minStat; (void)gss_release_buffer(&minStat, gsBuf); } gsBuf->length = 0; gsBuf->value = NULL; if (gfarmReadInt32(fd, &iLen, 1) != 1) { gflog_debug(GFARM_MSG_1000794, "gfarmReadInt32() failed"); return -1; } /* * XXXXX FIXME: * GSSAPI has no API for allocating a gss_buffer_t. It is not * recommended to allocate it with malloc(). */ GFARM_MALLOC_ARRAY(p, iLen); if (p == NULL) { gflog_debug(GFARM_MSG_1000795, "allocation of buffer failed"); return -1; } buf = (gfarm_int8_t *)p; if (gfarmReadInt8(fd, buf, iLen) != iLen) { (void)free(buf); gflog_debug(GFARM_MSG_1000796, "gfarmReadInt8() failed"); return -1; } gsBuf->length = (size_t)iLen; gsBuf->value = (void *)buf; return iLen; } int gfarmGssAcceptSecurityContext(fd, cred, scPtr, majStatPtr, minStatPtr, remoteNamePtr, remoteCredPtr) int fd; gss_cred_id_t cred; gss_ctx_id_t *scPtr; OM_uint32 *majStatPtr; OM_uint32 *minStatPtr; gss_name_t *remoteNamePtr; gss_cred_id_t *remoteCredPtr; { OM_uint32 majStat; OM_uint32 minStat, minStat2; OM_uint32 retFlag = GFARM_GSS_DEFAULT_SECURITY_ACCEPT_FLAG; gss_name_t initiatorName = GSS_C_NO_NAME; gss_cred_id_t remCred = GSS_C_NO_CREDENTIAL; gss_buffer_desc inputToken = GSS_C_EMPTY_BUFFER; gss_buffer_t itPtr = &inputToken; gss_buffer_desc outputToken = GSS_C_EMPTY_BUFFER; gss_buffer_t otPtr = &outputToken; gss_OID mechType = GSS_C_NO_OID; OM_uint32 timeRet; int tknStat; static const char diag[] = "gfarmGssAcceptSecurityContext()"; *scPtr = GSS_C_NO_CONTEXT; do { tknStat = gfarmGssReceiveToken(fd, itPtr); if (tknStat <= 0) { gflog_auth_error(GFARM_MSG_1000616, "gfarmGssAcceptSecurityContext(): " "failed to receive response"); majStat = GSS_S_DEFECTIVE_TOKEN|GSS_S_CALL_INACCESSIBLE_READ; minStat = GFSL_DEFAULT_MINOR_ERROR; break; } gfarm_mutex_lock(&gss_mutex, diag, gssDiag); majStat = gss_accept_sec_context(&minStat, scPtr, cred, itPtr, GSS_C_NO_CHANNEL_BINDINGS, &initiatorName, &mechType, otPtr, &retFlag, &timeRet, &remCred); gfarm_mutex_unlock(&gss_mutex, diag, gssDiag); if (itPtr->length > 0) { (void)gss_release_buffer(&minStat2, itPtr); } if (otPtr->length > 0) { tknStat = gfarmGssSendToken(fd, otPtr); (void)gss_release_buffer(&minStat2, otPtr); if (tknStat <= 0) { gflog_auth_error(GFARM_MSG_1000617, "gfarmGssAcceptSecurityContext(): " "failed to send response"); majStat = GSS_S_DEFECTIVE_TOKEN|GSS_S_CALL_INACCESSIBLE_WRITE; minStat = GFSL_DEFAULT_MINOR_ERROR; } } if (GSS_ERROR(majStat)) { break; } } while (majStat & GSS_S_CONTINUE_NEEDED); if (itPtr->length > 0) { (void)gss_release_buffer(&minStat2, itPtr); } if (otPtr->length > 0) { (void)gss_release_buffer(&minStat2, otPtr); } if (majStatPtr != NULL) { *majStatPtr = majStat; } if (minStatPtr != NULL) { *minStatPtr = minStat; } if (majStat == GSS_S_COMPLETE && remoteNamePtr != NULL) { *remoteNamePtr = initiatorName; } else if (initiatorName != GSS_C_NO_NAME) { (void)gss_release_name(&minStat2, &initiatorName); } if (majStat == GSS_S_COMPLETE && remoteCredPtr != NULL) { *remoteCredPtr = remCred; } else if (remCred != GSS_C_NO_CREDENTIAL) { (void)gss_release_cred(&minStat2, &remCred); } if (majStat != GSS_S_COMPLETE && *scPtr != GSS_C_NO_CONTEXT) { (void)gss_delete_sec_context(&minStat2, scPtr, GSS_C_NO_BUFFER); } return majStat == GSS_S_COMPLETE ? 1 : -1; } int gfarmGssInitiateSecurityContext(fd, acceptorName, cred, reqFlag, scPtr, majStatPtr, minStatPtr, remoteNamePtr) int fd; const gss_name_t acceptorName; gss_cred_id_t cred; OM_uint32 reqFlag; gss_ctx_id_t *scPtr; OM_uint32 *majStatPtr; OM_uint32 *minStatPtr; gss_name_t *remoteNamePtr; { OM_uint32 majStat; OM_uint32 minStat, minStat2; OM_uint32 retFlag = 0; gss_buffer_desc inputToken = GSS_C_EMPTY_BUFFER; gss_buffer_t itPtr = &inputToken; gss_buffer_desc outputToken = GSS_C_EMPTY_BUFFER; gss_buffer_t otPtr = &outputToken; gss_OID *actualMechType = NULL; OM_uint32 timeRet; int tknStat; static const char diag[] = "gfarmGssInitiateSecurityContext()"; *scPtr = GSS_C_NO_CONTEXT; /* * Implementation specification: * In gfarm, an initiator must reveal own identity to an acceptor. */ if ((reqFlag & GSS_C_ANON_FLAG) == GSS_C_ANON_FLAG) { /* It is a bit safer to deny the request than to silently ignore it */ gflog_auth_error(GFARM_MSG_1000618, "gfarmGssInitiateSecurityContext(): " "GSS_C_ANON_FLAG is not allowed"); majStat = GSS_S_UNAVAILABLE; minStat = GFSL_DEFAULT_MINOR_ERROR; goto Done; } while (1) { gfarm_mutex_lock(&gss_mutex, diag, gssDiag); majStat = gss_init_sec_context(&minStat, cred, scPtr, acceptorName, GSS_C_NO_OID, reqFlag, 0, GSS_C_NO_CHANNEL_BINDINGS, itPtr, actualMechType, otPtr, &retFlag, &timeRet); gfarm_mutex_unlock(&gss_mutex, diag, gssDiag); if (itPtr->length > 0) { (void)gss_release_buffer(&minStat2, itPtr); } if (otPtr->length > 0) { tknStat = gfarmGssSendToken(fd, otPtr); (void)gss_release_buffer(&minStat2, otPtr); if (tknStat <= 0) { gflog_auth_error(GFARM_MSG_1000619, "gfarmGssInitiateSecurityContext(): " "failed to send response"); majStat = GSS_S_DEFECTIVE_TOKEN|GSS_S_CALL_INACCESSIBLE_WRITE; minStat = GFSL_DEFAULT_MINOR_ERROR; } } if (GSS_ERROR(majStat)) { break; } if (majStat & GSS_S_CONTINUE_NEEDED) { tknStat = gfarmGssReceiveToken(fd, itPtr); if (tknStat <= 0) { gflog_auth_error(GFARM_MSG_1000620, "gfarmGssInitiateSecurityContext(): " "failed to receive response"); majStat = GSS_S_DEFECTIVE_TOKEN|GSS_S_CALL_INACCESSIBLE_READ; minStat = GFSL_DEFAULT_MINOR_ERROR; break; } } else { break; } } if (itPtr->length > 0) { (void)gss_release_buffer(&minStat2, itPtr); } if (otPtr->length > 0) { (void)gss_release_buffer(&minStat2, otPtr); } if (majStat == GSS_S_COMPLETE && remoteNamePtr != NULL) { majStat = gss_inquire_context(&minStat, *scPtr, NULL, remoteNamePtr, NULL, NULL, NULL, NULL, NULL); } Done: if (majStatPtr != NULL) { *majStatPtr = majStat; } if (minStatPtr != NULL) { *minStatPtr = minStat; } if (majStat != GSS_S_COMPLETE && *scPtr != GSS_C_NO_CONTEXT) { (void)gss_delete_sec_context(&minStat2, scPtr, GSS_C_NO_BUFFER); } return majStat == GSS_S_COMPLETE ? 1 : -1; } void gfarmGssDeleteSecurityContext(scPtr) gss_ctx_id_t *scPtr; { OM_uint32 minStat; if (scPtr == NULL || *scPtr == GSS_C_NO_CONTEXT) { return; } (void)gss_delete_sec_context(&minStat, scPtr, GSS_C_NO_BUFFER); } int gfarmGssConfigureMessageSize(sCtx, doEncrypt, qopReq, reqOutSz, maxInSzPtr, majStatPtr, minStatPtr) gss_ctx_id_t sCtx; int doEncrypt; gss_qop_t qopReq; unsigned int reqOutSz; unsigned int *maxInSzPtr; OM_uint32 *majStatPtr; OM_uint32 *minStatPtr; { int ret = -1; OM_uint32 majStat; OM_uint32 minStat; OM_uint32 oReqSz = (OM_uint32)reqOutSz; OM_uint32 oMaxSz = oReqSz; majStat = gss_wrap_size_limit(&minStat, sCtx, doEncrypt, qopReq, oReqSz, &oMaxSz); if (majStatPtr != NULL) { *majStatPtr = majStat; } if (minStatPtr != NULL) { *minStatPtr = minStat; } if (majStat == GSS_S_COMPLETE) { ret = 1; if (maxInSzPtr != NULL) { *maxInSzPtr = (int)oMaxSz; } } else { gflog_debug(GFARM_MSG_1000797, "failed to configure message size (%u)(%u)", majStat, minStat); } return ret; } int gfarmGssSend(fd, sCtx, doEncrypt, qopReq, buf, n, chunkSz, statPtr) int fd; gss_ctx_id_t sCtx; int doEncrypt; gss_qop_t qopReq; gfarm_int8_t *buf; int n; int chunkSz; OM_uint32 *statPtr; { int ret = -1; OM_uint32 majStat; OM_uint32 minStat; gss_buffer_desc inputToken = GSS_C_EMPTY_BUFFER; gss_buffer_t itPtr = &inputToken; gss_buffer_desc outputToken = GSS_C_EMPTY_BUFFER; gss_buffer_t otPtr = &outputToken; int sum = 0; int rem = n; int len; gfarm_int32_t n_buf = n; /* * Send a length of a PLAIN TEXT. * XXXXX FIX ME: * Generally it is wrong idea sending a plain text length * in plain text communication. Should be encrypted. */ if (buf == NULL || n <= 0) { ret = 0; majStat = GSS_S_COMPLETE; goto Done; } if (gfarmWriteInt32(fd, &n_buf, 1) != 1) { majStat = GSS_S_CALL_INACCESSIBLE_WRITE; goto Done; } do { inputToken.value = (void *)((char *)(buf + sum)); len = (rem > chunkSz ? chunkSz : rem); inputToken.length = (size_t)len; majStat = gss_wrap(&minStat, sCtx, doEncrypt, qopReq, (const gss_buffer_t)itPtr, NULL, otPtr); if (majStat == GSS_S_COMPLETE) { if (otPtr->length > 0) { if (gfarmGssSendToken(fd, otPtr) <= 0) { majStat = GSS_S_DEFECTIVE_TOKEN|GSS_S_CALL_INACCESSIBLE_WRITE; goto Done; } (void)gss_release_buffer(&minStat, otPtr); otPtr->length = 0; otPtr->value = NULL; rem -= len; sum += len; } else { majStat = GSS_S_DEFECTIVE_TOKEN; goto Done; } } else { break; } } while (rem > 0); if (rem <= 0) { ret = n; } Done: if (otPtr->length > 0) { (void)gss_release_buffer(&minStat, otPtr); } if (statPtr != NULL) { *statPtr = majStat; } if (ret == -1) { gflog_debug(GFARM_MSG_1000798, "error occurred during gfarmGssSend (%u)(%u)", majStat, minStat); } return ret; } int gfarmGssReceive(fd, sCtx, bufPtr, lenPtr, statPtr) int fd; gss_ctx_id_t sCtx; gfarm_int8_t **bufPtr; int *lenPtr; OM_uint32 *statPtr; { int ret = -1; OM_uint32 majStat; OM_uint32 minStat; gss_buffer_desc inputToken = GSS_C_EMPTY_BUFFER; gss_buffer_t itPtr = &inputToken; gss_buffer_desc outputToken = GSS_C_EMPTY_BUFFER; gss_buffer_t otPtr = &outputToken; gfarm_int32_t n; int sum = 0; int rem; int len; gfarm_int8_t *buf = NULL; int i; /* * Receive a length of a PLAIN TEXT. * XXXXX FIX ME: * Generally it is wrong idea receiving a plain text * length in plain text communication. Should be * encrypted. */ i = gfarmReadInt32(fd, &n, 1); if (i == 0) { ret = 0; n = 0; majStat = GSS_S_COMPLETE; goto Done; } else if (i != 1) { majStat = GSS_S_CALL_INACCESSIBLE_READ; goto Done; } GFARM_MALLOC_ARRAY(buf, n); if (buf == NULL) { majStat = GSS_S_FAILURE; goto Done; } rem = n; do { if (gfarmGssReceiveToken(fd, itPtr) <= 0) { majStat = GSS_S_DEFECTIVE_TOKEN|GSS_S_CALL_INACCESSIBLE_READ; goto Done; } majStat = gss_unwrap(&minStat, sCtx, (const gss_buffer_t)itPtr, otPtr, NULL, NULL); (void)gss_release_buffer(&minStat, itPtr); itPtr->length = 0; itPtr->value = NULL; if (majStat == GSS_S_COMPLETE) { if (otPtr->length > 0) { (void)memcpy((void *)(buf + sum), (void *)otPtr->value, otPtr->length); len = (int)(otPtr->length); rem -= len; sum += len; (void)gss_release_buffer(&minStat, otPtr); otPtr->length = 0; otPtr->value = NULL; } else { majStat = GSS_S_DEFECTIVE_TOKEN; goto Done; } } else { break; } } while (rem > 0); if (rem <= 0) { ret = n; } Done: if (otPtr->length > 0) { (void)gss_release_buffer(&minStat, otPtr); } if (itPtr->length > 0) { (void)gss_release_buffer(&minStat, itPtr); } if (statPtr != NULL) { *statPtr = majStat; } if (ret == -1) { *bufPtr = NULL; *lenPtr = -1; } else { *bufPtr = buf; *lenPtr = n; } if (ret == -1) { gflog_debug(GFARM_MSG_1000799, "error occurred during gfarmGssReceive (%u)(%u)", majStat, minStat); } return ret; } #if GFARM_GSS_EXPORT_CRED_ENABLED struct gfarmExportedCredential { char *env; char *filename; }; gfarmExportedCredential * gfarmGssExportCredential(cred, statPtr) gss_cred_id_t cred; OM_uint32 *statPtr; { gfarmExportedCredential *exportedCred = NULL; OM_uint32 majStat = 0; OM_uint32 minStat = 0; gss_buffer_desc buf = GSS_C_EMPTY_BUFFER; char *exported, *filename, *env; static char exported_name[] = "X509_USER_DELEG_PROXY="; static char env_name[] = "X509_USER_PROXY="; static char file_prefix[] = "FILE:"; majStat = gss_export_cred(&minStat, cred, GSS_C_NO_OID, 1, &buf); if (GSS_ERROR(majStat)) goto Done; exported = (char *)buf.value; for (filename = exported; *filename != '\0'; filename++) if (!isalnum(*(unsigned char *)filename) && *filename != '_') break; if (*filename != '=') { /* not an environment variable */ majStat = GSS_S_UNAVAILABLE; goto Done; } filename++; if (memcmp(exported, exported_name, sizeof(exported_name) - 1) == 0) { GFARM_MALLOC_ARRAY(env, sizeof(env_name) + strlen(filename)); if (env == NULL) { majStat = GSS_S_FAILURE; goto Done; } memcpy(env, env_name, sizeof(env_name) - 1); strcpy(env + sizeof(env_name) - 1, filename); filename = env + sizeof(env_name) - 1; } else { env = strdup(exported); if (env == NULL) { majStat = GSS_S_FAILURE; goto Done; } filename = env + (filename - exported); } if (memcmp(filename, file_prefix, sizeof(file_prefix) - 1) == 0) filename += sizeof(file_prefix) - 1; GFARM_MALLOC(exportedCred); if (exportedCred == NULL) { free(env); majStat = GSS_S_FAILURE; goto Done; } exportedCred->env = env; exportedCred->filename = access(filename, R_OK) == 0 ? filename : NULL; Done: gss_release_buffer(&minStat, &buf); if (statPtr != NULL) *statPtr = majStat; if (GSS_ERROR(majStat)) { gflog_debug(GFARM_MSG_1000800, "failed to export credential (%u)(%u)", majStat, minStat); } return exportedCred; } char * gfarmGssEnvForExportedCredential(exportedCred) gfarmExportedCredential *exportedCred; { return exportedCred->env; } void gfarmGssDeleteExportedCredential(exportedCred, sigHandler) gfarmExportedCredential *exportedCred; int sigHandler; { if (exportedCred->filename != NULL) unlink(exportedCred->filename); if (sigHandler) /* It's not safe to do the following operation */ return; free(exportedCred->env); free(exportedCred); } #endif /* GFARM_GSS_EXPORT_CRED_ENABLED */ /* * multiplexed version of gfarmGssInitiateSecurityContext() */ struct gfarmGssInitiateSecurityContextState { struct gfarm_eventqueue *q; struct gfarm_event *readable, *writable; int fd; gss_cred_id_t cred; OM_uint32 reqFlag; void (*continuation)(void *); void *closure; int completed; OM_uint32 majStat; OM_uint32 minStat; gss_ctx_id_t sc; gss_name_t acceptorName; OM_uint32 retFlag; gss_buffer_desc inputToken; gss_buffer_t itPtr; gss_buffer_desc outputToken; gss_buffer_t otPtr; gss_OID *actualMechType; OM_uint32 timeRet; }; /* this function returns 1, if an event is added */ static int gssInitiateSecurityContextSwitch(state) struct gfarmGssInitiateSecurityContextState *state; { int rv; struct timeval timeout; if (GSS_ERROR(state->majStat)) { return 0; } if (state->majStat & GSS_S_CONTINUE_NEEDED) { timeout.tv_sec = GFARM_GSS_AUTH_TIMEOUT; timeout.tv_usec = 0; rv = gfarm_eventqueue_add_event(state->q, state->readable, &timeout); if (rv == 0) { /* go to gfarmGssInitiateSecurityContextReceiveToken() */ return 1; } gflog_auth_error(GFARM_MSG_1000621, "gfarm:gssInitiateSecurityContextSwitch(): %s", strerror(rv)); state->majStat = GSS_S_FAILURE; state->minStat = GFSL_DEFAULT_MINOR_ERROR; } else { state->completed = 1; } return 0; } /* this function returns 1, if an event is added */ static int gssInitiateSecurityContextNext(state) struct gfarmGssInitiateSecurityContextState *state; { OM_uint32 minStat2; int rv; static const char diag[] = "gssInitiateSecurityContextNext()"; gfarm_mutex_lock(&gss_mutex, diag, gssDiag); state->majStat = gss_init_sec_context(&state->minStat, state->cred, &state->sc, state->acceptorName, GSS_C_NO_OID, state->reqFlag, 0, GSS_C_NO_CHANNEL_BINDINGS, state->itPtr, state->actualMechType, state->otPtr, &state->retFlag, &state->timeRet); gfarm_mutex_unlock(&gss_mutex, diag, gssDiag); if (state->itPtr->length > 0) { (void)gss_release_buffer(&minStat2, state->itPtr); } if (state->otPtr->length > 0) { rv = gfarm_eventqueue_add_event(state->q, state->writable, NULL); if (rv == 0) { /* go to gfarmGssInitiateSecurityContextSendToken() */ return 1; } gflog_auth_error(GFARM_MSG_1000622, "gfarm:gssInitiateSecurityContextNext(): %s", strerror(rv)); state->majStat = GSS_S_FAILURE; state->minStat = GFSL_DEFAULT_MINOR_ERROR; } return gssInitiateSecurityContextSwitch(state); } static void gfarmGssInitiateSecurityContextSendToken(events, fd, closure, t) int events; int fd; void *closure; const struct timeval *t; { struct gfarmGssInitiateSecurityContextState *state = closure; int tknStat; OM_uint32 minStat2; tknStat = gfarmGssSendToken(fd, state->otPtr); (void)gss_release_buffer(&minStat2, state->otPtr); if (tknStat <= 0) { gflog_auth_error(GFARM_MSG_1000623, "gfarmGssInitiateSecurityContextSendToken(): " "failed to send response"); state->majStat = GSS_S_DEFECTIVE_TOKEN|GSS_S_CALL_INACCESSIBLE_WRITE; state->minStat = GFSL_DEFAULT_MINOR_ERROR; } if (gssInitiateSecurityContextSwitch(state)) { return; } if (state->continuation != NULL) { (*state->continuation)(state->closure); } } static void gfarmGssInitiateSecurityContextReceiveToken(events, fd, closure, t) int events; int fd; void *closure; const struct timeval *t; { struct gfarmGssInitiateSecurityContextState *state = closure; int tknStat; if ((events & GFARM_EVENT_TIMEOUT) != 0) { assert(events == GFARM_EVENT_TIMEOUT); state->majStat = GSS_S_UNAVAILABLE; /* failure: timeout */ } else { assert(events == GFARM_EVENT_READ); tknStat = gfarmGssReceiveToken(fd, state->itPtr); if (tknStat <= 0) { gflog_auth_error(GFARM_MSG_1000624, "gfarmGssInitiateSecurityContextReceiveToken(): " "failed to receive response"); state->majStat= GSS_S_DEFECTIVE_TOKEN|GSS_S_CALL_INACCESSIBLE_READ; state->minStat= GFSL_DEFAULT_MINOR_ERROR; } else if (gssInitiateSecurityContextNext(state)) { return; } } assert(GSS_ERROR(state->majStat) || state->completed); if (state->continuation != NULL) (*state->continuation)(state->closure); } struct gfarmGssInitiateSecurityContextState * gfarmGssInitiateSecurityContextRequest(q, fd, acceptorName, cred, reqFlag, continuation, closure, majStatPtr, minStatPtr) struct gfarm_eventqueue *q; int fd; const gss_name_t acceptorName; gss_cred_id_t cred; OM_uint32 reqFlag; void (*continuation)(void *); void *closure; OM_uint32 *majStatPtr; OM_uint32 *minStatPtr; { OM_uint32 majStat; OM_uint32 minStat; struct gfarmGssInitiateSecurityContextState *state; /* * Implementation specification: * In gfarm, an initiator must reveal own identity to an acceptor. */ if ((reqFlag & GSS_C_ANON_FLAG) == GSS_C_ANON_FLAG) { /* It is a bit safer to deny the request than to silently ignore it */ gflog_auth_error(GFARM_MSG_1000625, "gfarmGssInitiateSecurityContextRequest(): " "GSS_C_ANON_FLAG is not allowed"); majStat = GSS_S_UNAVAILABLE; minStat = GFSL_DEFAULT_MINOR_ERROR; goto ReturnStat; } GFARM_MALLOC(state); if (state == NULL) { gflog_auth_error(GFARM_MSG_1000626, "gfarmGssInitiateSecurityContextRequest(): " "no memory"); majStat = GSS_S_FAILURE; minStat = GFSL_DEFAULT_MINOR_ERROR; goto ReturnStat; } state->completed = 0; state->majStat = GSS_S_COMPLETE; state->minStat = GFSL_DEFAULT_MINOR_ERROR; state->writable = gfarm_fd_event_alloc(GFARM_EVENT_WRITE, fd, gfarmGssInitiateSecurityContextSendToken, state); if (state->writable == NULL) { gflog_auth_error(GFARM_MSG_1000627, "gfarmGssInitiateSecurityContextRequest(): " "no memory"); state->majStat = GSS_S_FAILURE; goto FreeState; } /* * We cannot use two independent events (i.e. a fd_event with * GFARM_EVENT_READ flag and a timer_event) here, because * it's possible that both event handlers are called at once. */ state->readable = gfarm_fd_event_alloc(GFARM_EVENT_READ|GFARM_EVENT_TIMEOUT, fd, gfarmGssInitiateSecurityContextReceiveToken, state); if (state->readable == NULL) { gflog_auth_error(GFARM_MSG_1000628, "gfarmGssInitiateSecurityContextRequest(): " "no memory"); state->majStat = GSS_S_FAILURE; goto FreeWritable; } state->q = q; state->fd = fd; state->acceptorName = acceptorName; state->cred = cred; state->reqFlag = reqFlag; state->continuation = continuation; state->closure = closure; state->retFlag = 0; /* GSS_C_EMPTY_BUFFER */ state->inputToken.length = 0; state->inputToken.value = NULL; state->itPtr = &state->inputToken; /* GSS_C_EMPTY_BUFFER */ state->outputToken.length = 0; state->outputToken.value = NULL; state->otPtr = &state->outputToken; state->actualMechType = NULL; state->sc = GSS_C_NO_CONTEXT; gssInitiateSecurityContextNext(state); assert(!state->completed); if (!GSS_ERROR(state->majStat)) { if (majStatPtr != NULL) { *majStatPtr = GSS_S_COMPLETE; } if (minStatPtr != NULL) { *minStatPtr = GFSL_DEFAULT_MINOR_ERROR; } return (state); } gfarm_event_free(state->readable); FreeWritable: gfarm_event_free(state->writable); FreeState: majStat = state->majStat; minStat = state->minStat; free(state); ReturnStat: if (majStatPtr != NULL) { *majStatPtr = majStat; } if (minStatPtr != NULL) { *minStatPtr = minStat; } if (GSS_ERROR(majStat)) { gflog_debug(GFARM_MSG_1000801, "failed to request initiate security context (%u)(%u)", majStat, minStat); } return (NULL); } int gfarmGssInitiateSecurityContextResult(state, scPtr, majStatPtr, minStatPtr, remoteNamePtr) struct gfarmGssInitiateSecurityContextState *state; gss_ctx_id_t *scPtr; OM_uint32 *majStatPtr; OM_uint32 *minStatPtr; gss_name_t *remoteNamePtr; { int ret; OM_uint32 minStat2; assert(GSS_ERROR(state->majStat) || state->completed); if (state->itPtr->length > 0) { (void)gss_release_buffer(&minStat2, state->itPtr); } if (state->otPtr->length > 0) { (void)gss_release_buffer(&minStat2, state->otPtr); } if (state->majStat == GSS_S_COMPLETE && remoteNamePtr != NULL) { state->majStat = gss_inquire_context(&state->minStat, state->sc, NULL, remoteNamePtr, NULL, NULL, NULL, NULL, NULL); } gfarm_event_free(state->readable); gfarm_event_free(state->writable); if (majStatPtr != NULL) { *majStatPtr = state->majStat; } if (minStatPtr != NULL) { *minStatPtr = state->minStat; } if (state->majStat == GSS_S_COMPLETE) { *scPtr = state->sc; } else if (state->sc != GSS_C_NO_CONTEXT) { (void)gss_delete_sec_context(&minStat2, &state->sc, GSS_C_NO_BUFFER); } ret = state->majStat == GSS_S_COMPLETE ? 1 : -1; free(state); if (ret == -1) { gflog_debug(GFARM_MSG_1000802, "failed to get result of initiate security context"); } return ret; } gfarm-2.4.1/lib/libgfarm/gfsl/scarg.h0000644000000000000000000000042711507222723016050 0ustar rootroot#define COMMON_OPTIONS "p:H:M:Nn:U:u" extern int port; extern int acceptorSpecified; extern gss_name_t acceptorName; extern int HandleCommonOptions(int, char *); extern char *newStringOfName(const gss_name_t inputName); extern char *newStringOfCredential(gss_cred_id_t cred); gfarm-2.4.1/lib/libgfarm/gfsl/gfsl_config.h0000644000000000000000000000620711507222723017233 0ustar rootroot#ifndef _GFARM_GFSL_CONFIG_H_ #define _GFARM_GFSL_CONFIG_H_ #define USE_GLOBUS #if defined(USE_GLOBUS) && GLOBUS_FAKE_GSS_C_NT_USER /* currently Globus doesn't actually support GSS_C_NT_USER_NAME */ #define GFARM_FAKE_GSS_C_NT_USER_NAME_FOR_GLOBUS 1 #else #define GFARM_FAKE_GSS_C_NT_USER_NAME_FOR_GLOBUS 0 #endif /* defined(USE_GLOBUS) && GLOBUS_FAKE_GSS_C_NT_USER */ #ifdef USE_GLOBUS /* draft-engert-ggf-gss-extensions @ IETF & draft-ggf-gss-extensions @ GGF */ # define GFARM_GSS_EXPORT_CRED_ENABLED 1 #else # define GFARM_GSS_EXPORT_CRED_ENABLED 0 #endif /* USE_GLOBUS */ #if 0 /* defined(USE_GLOBUS) */ /* Now, Globus GSSAPI supports encryption */ /* * Exportable version of Globus GSSAPI did not support confidentiality * security service. */ # define GFARM_GSS_ENCRYPTION_ENABLED 0 #else # define GFARM_GSS_ENCRYPTION_ENABLED 1 #endif /* USE_GLOBUS */ #if GFARM_GSS_ENCRYPTION_ENABLED # define GFARM_GSS_C_CONF_FLAG GSS_C_CONF_FLAG #else # define GFARM_GSS_C_CONF_FLAG 0 # ifdef USE_GLOBUS # ifndef GSS_C_QOP_GLOBUS_GSSAPI_SSLEAY_BIG # define GSS_C_QOP_GLOBUS_GSSAPI_SSLEAY_BIG 1 # endif /* GSS_C_QOP_GLOBUS_GSSAPI_SSLEAY_BIG */ # define GFARM_GSS_DEFAULT_QOP GSS_C_QOP_GLOBUS_GSSAPI_SSLEAY_BIG # endif /* USE_GLOBUS */ #endif /* GFARM_GSS_ENCRYPTION_ENABLED */ #ifndef GFARM_GSS_DEFAULT_QOP #define GFARM_GSS_DEFAULT_QOP GSS_C_QOP_DEFAULT #endif #ifdef USE_GLOBUS /* GSS_C_GLOBUS_LIMITED_PROXY_MANY_FLAG is deprecated since GT 4.0 */ #ifndef GSS_C_GLOBUS_LIMITED_PROXY_MANY_FLAG #define GSS_C_GLOBUS_LIMITED_PROXY_MANY_FLAG 0 #endif /* allow to delegate a limited proxy */ #define GFARM_GSS_C_GLOBUS_INIT_FLAG GSS_C_GLOBUS_LIMITED_DELEG_PROXY_FLAG /* accept level N limited proxy certificate */ #define GFARM_GSS_C_GLOBUS_ACCEPT_FLAG GSS_C_GLOBUS_LIMITED_PROXY_MANY_FLAG #else #define GFARM_GSS_C_GLOBUS_INIT_FLAG 0 #define GFARM_GSS_C_GLOBUS_ACCEPT_FLAG 0 #endif /* USE_GLOBUS */ #define GFARM_GSS_DEFAULT_SECURITY_SETUP_FLAG \ (OM_uint32)(GSS_C_DELEG_FLAG | /* delegation */ \ GSS_C_MUTUAL_FLAG | /* mutual authentication */ \ GSS_C_REPLAY_FLAG | /* reply message detection */ \ GSS_C_SEQUENCE_FLAG | /* out of sequence detection */ \ GFARM_GSS_C_CONF_FLAG | /* confidentiality service */ \ GSS_C_INTEG_FLAG | /* integrity check service */ \ GFARM_GSS_C_GLOBUS_INIT_FLAG /* globus optional flag */ \ ) #define GFARM_GSS_DEFAULT_SECURITY_ACCEPT_FLAG \ (OM_uint32)(GFARM_GSS_C_GLOBUS_ACCEPT_FLAG) /* globus optional flag */ #define GFARM_GSS_DEFAULT_MAX_MESSAGE_REQUEST_SIZE 8 * 1024 * 1024 #define GFARM_DEFAULT_INITIATOR_CONFIG_FILE "gfarm-initiator.conf" #define GFARM_DEFAULT_ACCEPTOR_CONFIG_FILE "gfarm-acceptor.conf" #define GFARM_DEFAULT_INSTALL_ETC_DIR "etc" #ifndef GFARM_INSTALL_ETC_DIR #define GFARM_INSTALL_ETC_DIR "/etc" #endif /* GFARM_INSTALL_ETC_DIR */ #ifndef GFARM_INSTALL_DIR_ENV #define GFARM_INSTALL_DIR_ENV "GFARM_HOME" #endif /* GFARM_INSTALL_DIR_ENV */ #define GFARM_DEFAULT_USERMAP_FILE "gfarm-usermap" /* XXX - This depends on globus implementation - GLOBUS_SUCCESS (== 0) */ #define GFSL_DEFAULT_MINOR_ERROR 0 #define GFARM_GSS_AUTH_TIMEOUT 60 /* seconds */ #endif /* _GFARM_GFSL_CONFIG_H_ */ gfarm-2.4.1/lib/libgfarm/Makefile0000644000000000000000000000125411507222724015305 0ustar rootroot# $Id: Makefile 4583 2010-03-26 17:34:15Z tatebe $ top_builddir = ../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk # shared object version LTLDFLAGS = $(LTFLAGS_SHARELIB_IN) $(libdir) LT_CURRENT=1 LT_REVISION=0 LT_AGE=0 LIBRARY = libgfarm.la CFLAGS = $(COMMON_CFLAGS) LDLIBS = $(globus_gssapi_libs) $(openssl_libs) $(LIBS) GLOBUS_TARGETS = gfsl SUBDIRS = gfutil $(globus_targets) gfarm GLOBUS_OBJS = gfsl/libgfsl.la OBJS = gfutil/libgfutil.la $(globus_objs) gfarm/libgfarmcore.la all: subdir-all $(LIBRARY) $(OBJS): subdir-all include $(top_srcdir)/makes/subdir.mk include $(top_srcdir)/makes/lib.mk clean: $(RM) -f hook_test hook_test_mpi gfarm-2.4.1/lib/libgfarm/gfutil/0000755000000000000000000000000011507222730015132 5ustar rootrootgfarm-2.4.1/lib/libgfarm/gfutil/timer.c0000644000000000000000000000210211507222722016412 0ustar rootroot/* * $Id: timer.c 567 2003-06-17 01:11:43Z tatebe $ * * TIMER routine * * gfarm_timerval_t t1, t2; * * gfarm_timerval_calibrate(); * * gfarm_gattimerval(&t1); * ... * gfarm_gattimerval(&t2); * * printf("%g sec\n", gfarm_timerval_sub(&t2, &t1)); */ #include #include "timer.h" #ifdef i386 #include double gfarm_timerval_calibration; unsigned long long gfarm_get_cycles(void) { unsigned long long rv; __asm __volatile("rdtsc" : "=A" (rv)); return (rv); } void gfarm_timerval_calibrate(void) { gfarm_timerval_t t1, t2; struct timeval s1, s2; /* warming up */ gfarm_gettimerval(&t1); gettimeofday(&s1, NULL); gfarm_gettimerval(&t1); gettimeofday(&s1, NULL); sleep(1); gfarm_gettimerval(&t2); gettimeofday(&s2, NULL); gfarm_timerval_calibration = ((s2.tv_sec - s1.tv_sec) + (s2.tv_usec - s1.tv_usec) * .000001) / (t2 - t1); /* fprintf(stderr, "[%03d] timer/sec=%g %s\n", node_index, 1.0 / timerval_calibration, gfarm_host_get_self_name()); */ } #else /* gettimeofday */ void gfarm_timerval_calibrate(void) {} #endif gfarm-2.4.1/lib/libgfarm/gfutil/id_table.h0000644000000000000000000000123611507222722017051 0ustar rootrootstruct gfarm_id_table; struct gfarm_id_table_entry_ops { size_t entry_size; }; struct gfarm_id_table *gfarm_id_table_alloc(struct gfarm_id_table_entry_ops *); void gfarm_id_table_free(struct gfarm_id_table *, void (*)(void *, gfarm_int32_t, void *), void *); void gfarm_id_table_set_base(struct gfarm_id_table *, gfarm_int32_t); void gfarm_id_table_set_limit(struct gfarm_id_table *, gfarm_int32_t); void gfarm_id_table_set_initial_size(struct gfarm_id_table *, gfarm_int32_t); void *gfarm_id_alloc(struct gfarm_id_table *, gfarm_int32_t *); void *gfarm_id_lookup(struct gfarm_id_table *, gfarm_int32_t); int gfarm_id_free(struct gfarm_id_table *, gfarm_int32_t); gfarm-2.4.1/lib/libgfarm/gfutil/send_no_sigpipe.c0000644000000000000000000000202011507222722020436 0ustar rootroot#include #include #include #include #include static int sigpipe_is_ignored = 0; void gfarm_sigpipe_ignore(void) { signal(SIGPIPE, SIG_IGN); sigpipe_is_ignored = 1; } ssize_t gfarm_send_no_sigpipe(int fd, const void *data, size_t length) { #ifdef MSG_NOSIGNAL return (send(fd, data, length, MSG_NOSIGNAL)); #else /* !defined(MSG_NOSIGNAL) */ if (sigpipe_is_ignored) { return (write(fd, data, length)); } else { /* * This code assumes that SIGPIPE is posted synchronously * in write(2) operation, instead of asynchronously. */ ssize_t rv; int old_is_set; struct sigaction sigpipe_ignore, sigpipe_old; memset(&sigpipe_ignore, 0, sizeof(sigpipe_ignore)); sigpipe_ignore.sa_handler = SIG_IGN; if (sigaction(SIGPIPE, &sigpipe_ignore, &sigpipe_old) == -1) old_is_set = 0; else old_is_set = 1; rv = write(fd, data, length); if (old_is_set) sigaction(SIGPIPE, &sigpipe_old, NULL); return (rv); } #endif /* !defined(MSG_NOSIGNAL) */ } gfarm-2.4.1/lib/libgfarm/gfutil/hash.c0000644000000000000000000001652111507222722016227 0ustar rootroot#include #include #include #include #include #include #include #include "gfutil.h" #include "hash.h" #define ALIGNMENT 16 #define ALIGN(p) (((unsigned long)(p) + ALIGNMENT - 1) & ~(ALIGNMENT - 1)) /* string hash function by Peter Weinberger */ int gfarm_hash_default(const void *key, int keylen) { int i; unsigned int hash = 0, g; for (i = 0; i < keylen; i++) { hash = (hash << 4) + ((unsigned char *)key)[i]; /* this assumes size of `int' is 32 bit */ if ((g = hash & 0xf0000000) != 0) { hash ^= g >> 24; hash ^= g; } } return (hash); } int gfarm_hash_casefold(const void *key, int keylen) { int i; unsigned int hash = 0, g; for (i = 0; i < keylen; i++) { hash = (hash << 4) + tolower(((unsigned char *)key)[i]); /* this assumes size of `int' is 32 bit */ if ((g = hash & 0xf0000000) != 0) { hash ^= g >> 24; hash ^= g; } } return (hash); } int gfarm_hash_key_equal_default(const void *key1, int key1len, const void *key2, int key2len) { return (key1len == key2len && memcmp(key1, key2, key1len) == 0); } int gfarm_hash_key_equal_casefold(const void *key1, int key1len, const void *key2, int key2len) { int i; if (key1len != key2len) return (0); for (i = 0; i < key1len; i++) { if (tolower(((unsigned char *)key1)[i]) != tolower(((unsigned char *)key2)[i])) return (0); } return (1); } struct gfarm_hash_entry { struct gfarm_hash_entry *next; int key_length; int data_length; double key_stub; }; #define HASH_KEY(entry) \ (((char *)(entry)) + \ ALIGN(offsetof(struct gfarm_hash_entry, key_stub))) #define HASH_DATA(entry) \ (HASH_KEY(entry) + ALIGN((entry)->key_length)) struct gfarm_hash_table { int table_size; int (*hash)(const void *, int); int (*equal)(const void *, int, const void *, int); struct gfarm_hash_entry *buckets[1]; }; struct gfarm_hash_table * gfarm_hash_table_alloc(int size, int (*hash)(const void *, int), int (*equal)(const void *, int, const void *, int)) { struct gfarm_hash_table *hashtab; size_t alloc_size; int overflow = 0; alloc_size = gfarm_size_add(&overflow, sizeof(struct gfarm_hash_table), gfarm_size_mul(&overflow, sizeof(struct gfarm_hash_entry *), size - 1)); if (overflow) { gflog_debug(GFARM_MSG_1000783, "Overflow when allocating hash table, size=(%d)", size); return (NULL); } hashtab = malloc(alloc_size); /* size is already checked */ if (hashtab == NULL) { gflog_debug(GFARM_MSG_1000784, "allocation of 'gfarm_hash_table' (%zd) failed", alloc_size); return (NULL); } hashtab->table_size = size; hashtab->hash = hash; hashtab->equal = equal; memset(hashtab->buckets, 0, sizeof(struct gfarm_hash_entry *) * size); return (hashtab); } void gfarm_hash_table_free(struct gfarm_hash_table *hashtab) { int i; struct gfarm_hash_entry *p, *np; for (i = 0; i < hashtab->table_size; i++) { for (p = hashtab->buckets[i]; p != NULL; p = np) { np = p->next; free(p); } } free(hashtab); } static struct gfarm_hash_entry ** gfarm_hash_lookup_internal_search(struct gfarm_hash_table *hashtab, struct gfarm_hash_entry **pp, const void *key, int keylen) { struct gfarm_hash_entry *p; int (*equal)(const void *, int, const void *, int) = hashtab->equal; for (p = *pp; p != NULL; pp = &p->next, p = *pp) { if ((*equal)(HASH_KEY(p), p->key_length, key, keylen)) break; } return (pp); } #define HASH_BUCKET(hashtab, key, keylen) \ ((*hashtab->hash)(key, keylen) % hashtab->table_size) #define GFARM_HASH_LOOKUP_INTERNAL(hashtab, key, keylen) \ gfarm_hash_lookup_internal_search(hashtab, \ &hashtab->buckets[HASH_BUCKET(hashtab, key, keylen)], \ key, keylen) struct gfarm_hash_entry * gfarm_hash_lookup(struct gfarm_hash_table *hashtab, const void *key, int keylen) { struct gfarm_hash_entry **pp = GFARM_HASH_LOOKUP_INTERNAL(hashtab, key, keylen); return (*pp); } struct gfarm_hash_entry * gfarm_hash_enter(struct gfarm_hash_table *hashtab, const void *key, int keylen, int datalen, int *createdp) { struct gfarm_hash_entry *p, **pp = GFARM_HASH_LOOKUP_INTERNAL(hashtab, key, keylen); size_t hash_entry_size; int overflow = 0; if (createdp != NULL) *createdp = 0; if (*pp != NULL) return (*pp); /* * create if not found */ hash_entry_size = gfarm_size_add(&overflow, gfarm_size_add(&overflow, ALIGN(offsetof(struct gfarm_hash_entry, key_stub)), ALIGN(keylen)), datalen); if (overflow) { gflog_debug(GFARM_MSG_1000785, "Overflow when entering hash entry"); return (NULL); } p = malloc(hash_entry_size); /* size is already checked */ if (p == NULL) { gflog_debug(GFARM_MSG_1000786, "allocation of 'gfarm_hash_entry' failed (%zd)", hash_entry_size); return (NULL); } *pp = p; p->next = NULL; p->key_length = keylen; p->data_length = datalen; memcpy(HASH_KEY(p), key, keylen); if (createdp != NULL) *createdp = 1; return (p); } int gfarm_hash_purge(struct gfarm_hash_table *hashtab, const void *key, int keylen) { struct gfarm_hash_entry *p, **pp = GFARM_HASH_LOOKUP_INTERNAL(hashtab, key, keylen); p = *pp; if (p == NULL) return (0); /* key is not found */ *pp = p->next; free(p); return (1); /* purged */ } void * gfarm_hash_entry_key(struct gfarm_hash_entry *entry) { return (HASH_KEY(entry)); } int gfarm_hash_entry_key_length(struct gfarm_hash_entry *entry) { return (entry->key_length); } void * gfarm_hash_entry_data(struct gfarm_hash_entry *entry) { return (HASH_DATA(entry)); } int gfarm_hash_entry_data_length(struct gfarm_hash_entry *entry) { return (entry->data_length); } /* * hash iterator */ int gfarm_hash_iterator_valid_entry(struct gfarm_hash_iterator *iterator) { struct gfarm_hash_table *hashtab = iterator->table; if (iterator->bucket_index >= hashtab->table_size) return (0); while (*iterator->pp == NULL) { if (++iterator->bucket_index >= hashtab->table_size) return (0); iterator->pp = &hashtab->buckets[iterator->bucket_index]; } return (1); } void gfarm_hash_iterator_begin(struct gfarm_hash_table *hashtab, struct gfarm_hash_iterator *iterator) { iterator->table = hashtab; iterator->bucket_index = 0; iterator->pp = &hashtab->buckets[0 /* == iterator->bucket_index */]; } void gfarm_hash_iterator_next(struct gfarm_hash_iterator *iterator) { if (*iterator->pp == NULL) iterator->bucket_index++; else iterator->pp = &(*iterator->pp)->next; } int gfarm_hash_iterator_is_end(struct gfarm_hash_iterator *iterator) { return (!gfarm_hash_iterator_valid_entry(iterator)); } struct gfarm_hash_entry * gfarm_hash_iterator_access(struct gfarm_hash_iterator *iterator) { if (gfarm_hash_iterator_valid_entry(iterator)) return (*iterator->pp); else return (NULL); } int gfarm_hash_iterator_lookup(struct gfarm_hash_table *hashtab, const void *key, int keylen, struct gfarm_hash_iterator *iterator) { iterator->table = hashtab; iterator->bucket_index = HASH_BUCKET(hashtab, key, keylen); iterator->pp = gfarm_hash_lookup_internal_search(hashtab, &hashtab->buckets[HASH_BUCKET(hashtab, key, keylen)], key, keylen); return (*iterator->pp != NULL); } int gfarm_hash_iterator_purge(struct gfarm_hash_iterator *iterator) { struct gfarm_hash_entry *p; if (!gfarm_hash_iterator_valid_entry(iterator)) return (0); /* not purged */ p = *iterator->pp; *iterator->pp = p->next; free(p); return (1); /* purged */ } gfarm-2.4.1/lib/libgfarm/gfutil/tree.h0000644000000000000000000005472111507222722016254 0ustar rootroot/* $NetBSD: tree.h,v 1.8 2004/03/28 19:38:30 provos Exp $ */ /* $OpenBSD: tree.h,v 1.7 2002/10/17 21:51:54 art Exp $ */ /* * Copyright 2002 Niels Provos * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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. */ #ifndef _SYS_TREE_H_ #define _SYS_TREE_H_ /* * This file defines data structures for different types of trees: * splay trees and red-black trees. * * A splay tree is a self-organizing data structure. Every operation * on the tree causes a splay to happen. The splay moves the requested * node to the root of the tree and partly rebalances it. * * This has the benefit that request locality causes faster lookups as * the requested nodes move to the top of the tree. On the other hand, * every lookup causes memory writes. * * The Balance Theorem bounds the total access time for m operations * and n inserts on an initially empty tree as O((m + n)lg n). The * amortized cost for a sequence of m accesses to a splay tree is O(lg n); * * A red-black tree is a binary search tree with the node color as an * extra attribute. It fulfills a set of conditions: * - every search path from the root to a leaf consists of the * same number of black nodes, * - each red node (except for the root) has a black parent, * - each leaf node is black. * * Every operation on a red-black tree is bounded as O(lg n). * The maximum height of a red-black tree is 2lg (n+1). */ #define SPLAY_HEAD(name, type) \ struct name { \ struct type *sph_root; /* root of the tree */ \ } #define SPLAY_INITIALIZER(root) \ { NULL } #define SPLAY_INIT(root) do { \ (root)->sph_root = NULL; \ } while (/*CONSTCOND*/ 0) #define SPLAY_ENTRY(type) \ struct { \ struct type *spe_left; /* left element */ \ struct type *spe_right; /* right element */ \ } #define SPLAY_LEFT(elm, field) (elm)->field.spe_left #define SPLAY_RIGHT(elm, field) (elm)->field.spe_right #define SPLAY_ROOT(head) (head)->sph_root #define SPLAY_EMPTY(head) (SPLAY_ROOT(head) == NULL) /* SPLAY_ROTATE_{LEFT,RIGHT} expect that tmp hold SPLAY_{RIGHT,LEFT} */ #define SPLAY_ROTATE_RIGHT(head, tmp, field) do { \ SPLAY_LEFT((head)->sph_root, field) = SPLAY_RIGHT(tmp, field); \ SPLAY_RIGHT(tmp, field) = (head)->sph_root; \ (head)->sph_root = tmp; \ } while (/*CONSTCOND*/ 0) #define SPLAY_ROTATE_LEFT(head, tmp, field) do { \ SPLAY_RIGHT((head)->sph_root, field) = SPLAY_LEFT(tmp, field); \ SPLAY_LEFT(tmp, field) = (head)->sph_root; \ (head)->sph_root = tmp; \ } while (/*CONSTCOND*/ 0) #define SPLAY_LINKLEFT(head, tmp, field) do { \ SPLAY_LEFT(tmp, field) = (head)->sph_root; \ tmp = (head)->sph_root; \ (head)->sph_root = SPLAY_LEFT((head)->sph_root, field); \ } while (/*CONSTCOND*/ 0) #define SPLAY_LINKRIGHT(head, tmp, field) do { \ SPLAY_RIGHT(tmp, field) = (head)->sph_root; \ tmp = (head)->sph_root; \ (head)->sph_root = SPLAY_RIGHT((head)->sph_root, field); \ } while (/*CONSTCOND*/ 0) #define SPLAY_ASSEMBLE(head, node, left, right, field) do { \ SPLAY_RIGHT(left, field) = SPLAY_LEFT((head)->sph_root, field); \ SPLAY_LEFT(right, field) = SPLAY_RIGHT((head)->sph_root, field);\ SPLAY_LEFT((head)->sph_root, field) = SPLAY_RIGHT(node, field); \ SPLAY_RIGHT((head)->sph_root, field) = SPLAY_LEFT(node, field); \ } while (/*CONSTCOND*/ 0) /* Generates prototypes and inline functions */ #define SPLAY_PROTOTYPE(name, type, field, cmp) \ void name##_SPLAY(struct name *, struct type *); \ void name##_SPLAY_MINMAX(struct name *, int); \ struct type *name##_SPLAY_INSERT(struct name *, struct type *); \ struct type *name##_SPLAY_REMOVE(struct name *, struct type *); \ \ /* Finds the node with the same key as elm */ \ static __inline struct type * \ name##_SPLAY_FIND(struct name *head, struct type *elm) \ { \ if (SPLAY_EMPTY(head)) \ return(NULL); \ name##_SPLAY(head, elm); \ if ((cmp)(elm, (head)->sph_root) == 0) \ return (head->sph_root); \ return (NULL); \ } \ \ static __inline struct type * \ name##_SPLAY_NEXT(struct name *head, struct type *elm) \ { \ name##_SPLAY(head, elm); \ if (SPLAY_RIGHT(elm, field) != NULL) { \ elm = SPLAY_RIGHT(elm, field); \ while (SPLAY_LEFT(elm, field) != NULL) { \ elm = SPLAY_LEFT(elm, field); \ } \ } else \ elm = NULL; \ return (elm); \ } \ \ static __inline struct type * \ name##_SPLAY_MIN_MAX(struct name *head, int val) \ { \ name##_SPLAY_MINMAX(head, val); \ return (SPLAY_ROOT(head)); \ } /* Main splay operation. * Moves node close to the key of elm to top */ #define SPLAY_GENERATE(name, type, field, cmp) \ struct type * \ name##_SPLAY_INSERT(struct name *head, struct type *elm) \ { \ if (SPLAY_EMPTY(head)) { \ SPLAY_LEFT(elm, field) = SPLAY_RIGHT(elm, field) = NULL; \ } else { \ int __comp; \ name##_SPLAY(head, elm); \ __comp = (cmp)(elm, (head)->sph_root); \ if(__comp < 0) { \ SPLAY_LEFT(elm, field) = SPLAY_LEFT((head)->sph_root, field);\ SPLAY_RIGHT(elm, field) = (head)->sph_root; \ SPLAY_LEFT((head)->sph_root, field) = NULL; \ } else if (__comp > 0) { \ SPLAY_RIGHT(elm, field) = SPLAY_RIGHT((head)->sph_root, field);\ SPLAY_LEFT(elm, field) = (head)->sph_root; \ SPLAY_RIGHT((head)->sph_root, field) = NULL; \ } else \ return ((head)->sph_root); \ } \ (head)->sph_root = (elm); \ return (NULL); \ } \ \ struct type * \ name##_SPLAY_REMOVE(struct name *head, struct type *elm) \ { \ struct type *__tmp; \ if (SPLAY_EMPTY(head)) \ return (NULL); \ name##_SPLAY(head, elm); \ if ((cmp)(elm, (head)->sph_root) == 0) { \ if (SPLAY_LEFT((head)->sph_root, field) == NULL) { \ (head)->sph_root = SPLAY_RIGHT((head)->sph_root, field);\ } else { \ __tmp = SPLAY_RIGHT((head)->sph_root, field); \ (head)->sph_root = SPLAY_LEFT((head)->sph_root, field);\ name##_SPLAY(head, elm); \ SPLAY_RIGHT((head)->sph_root, field) = __tmp; \ } \ return (elm); \ } \ return (NULL); \ } \ \ void \ name##_SPLAY(struct name *head, struct type *elm) \ { \ struct type __node, *__left, *__right, *__tmp; \ int __comp; \ \ SPLAY_LEFT(&__node, field) = SPLAY_RIGHT(&__node, field) = NULL;\ __left = __right = &__node; \ \ while ((__comp = (cmp)(elm, (head)->sph_root)) != 0) { \ if (__comp < 0) { \ __tmp = SPLAY_LEFT((head)->sph_root, field); \ if (__tmp == NULL) \ break; \ if ((cmp)(elm, __tmp) < 0){ \ SPLAY_ROTATE_RIGHT(head, __tmp, field); \ if (SPLAY_LEFT((head)->sph_root, field) == NULL)\ break; \ } \ SPLAY_LINKLEFT(head, __right, field); \ } else if (__comp > 0) { \ __tmp = SPLAY_RIGHT((head)->sph_root, field); \ if (__tmp == NULL) \ break; \ if ((cmp)(elm, __tmp) > 0){ \ SPLAY_ROTATE_LEFT(head, __tmp, field); \ if (SPLAY_RIGHT((head)->sph_root, field) == NULL)\ break; \ } \ SPLAY_LINKRIGHT(head, __left, field); \ } \ } \ SPLAY_ASSEMBLE(head, &__node, __left, __right, field); \ } \ \ /* Splay with either the minimum or the maximum element \ * Used to find minimum or maximum element in tree. \ */ \ void name##_SPLAY_MINMAX(struct name *head, int __comp) \ { \ struct type __node, *__left, *__right, *__tmp; \ \ SPLAY_LEFT(&__node, field) = SPLAY_RIGHT(&__node, field) = NULL;\ __left = __right = &__node; \ \ while (1) { \ if (__comp < 0) { \ __tmp = SPLAY_LEFT((head)->sph_root, field); \ if (__tmp == NULL) \ break; \ if (__comp < 0){ \ SPLAY_ROTATE_RIGHT(head, __tmp, field); \ if (SPLAY_LEFT((head)->sph_root, field) == NULL)\ break; \ } \ SPLAY_LINKLEFT(head, __right, field); \ } else if (__comp > 0) { \ __tmp = SPLAY_RIGHT((head)->sph_root, field); \ if (__tmp == NULL) \ break; \ if (__comp > 0) { \ SPLAY_ROTATE_LEFT(head, __tmp, field); \ if (SPLAY_RIGHT((head)->sph_root, field) == NULL)\ break; \ } \ SPLAY_LINKRIGHT(head, __left, field); \ } \ } \ SPLAY_ASSEMBLE(head, &__node, __left, __right, field); \ } #define SPLAY_NEGINF -1 #define SPLAY_INF 1 #define SPLAY_INSERT(name, x, y) name##_SPLAY_INSERT(x, y) #define SPLAY_REMOVE(name, x, y) name##_SPLAY_REMOVE(x, y) #define SPLAY_FIND(name, x, y) name##_SPLAY_FIND(x, y) #define SPLAY_NEXT(name, x, y) name##_SPLAY_NEXT(x, y) #define SPLAY_MIN(name, x) (SPLAY_EMPTY(x) ? NULL \ : name##_SPLAY_MIN_MAX(x, SPLAY_NEGINF)) #define SPLAY_MAX(name, x) (SPLAY_EMPTY(x) ? NULL \ : name##_SPLAY_MIN_MAX(x, SPLAY_INF)) #define SPLAY_FOREACH(x, name, head) \ for ((x) = SPLAY_MIN(name, head); \ (x) != NULL; \ (x) = SPLAY_NEXT(name, head, x)) /* Macros that define a red-black tree */ #define RB_HEAD(name, type) \ struct name { \ struct type *rbh_root; /* root of the tree */ \ } #define RB_INITIALIZER(root) \ { NULL } #define RB_INIT(root) do { \ (root)->rbh_root = NULL; \ } while (/*CONSTCOND*/ 0) #define RB_BLACK 0 #define RB_RED 1 #define RB_ENTRY(type) \ struct { \ struct type *rbe_left; /* left element */ \ struct type *rbe_right; /* right element */ \ struct type *rbe_parent; /* parent element */ \ int rbe_color; /* node color */ \ } #define RB_LEFT(elm, field) (elm)->field.rbe_left #define RB_RIGHT(elm, field) (elm)->field.rbe_right #define RB_PARENT(elm, field) (elm)->field.rbe_parent #define RB_COLOR(elm, field) (elm)->field.rbe_color #define RB_ROOT(head) (head)->rbh_root #define RB_EMPTY(head) (RB_ROOT(head) == NULL) #define RB_SET(elm, parent, field) do { \ RB_PARENT(elm, field) = parent; \ RB_LEFT(elm, field) = RB_RIGHT(elm, field) = NULL; \ RB_COLOR(elm, field) = RB_RED; \ } while (/*CONSTCOND*/ 0) #define RB_SET_BLACKRED(black, red, field) do { \ RB_COLOR(black, field) = RB_BLACK; \ RB_COLOR(red, field) = RB_RED; \ } while (/*CONSTCOND*/ 0) #ifndef RB_AUGMENT #define RB_AUGMENT(x) #endif #define RB_ROTATE_LEFT(head, elm, tmp, field) do { \ (tmp) = RB_RIGHT(elm, field); \ if ((RB_RIGHT(elm, field) = RB_LEFT(tmp, field)) != NULL) { \ RB_PARENT(RB_LEFT(tmp, field), field) = (elm); \ } \ RB_AUGMENT(elm); \ if ((RB_PARENT(tmp, field) = RB_PARENT(elm, field)) != NULL) { \ if ((elm) == RB_LEFT(RB_PARENT(elm, field), field)) \ RB_LEFT(RB_PARENT(elm, field), field) = (tmp); \ else \ RB_RIGHT(RB_PARENT(elm, field), field) = (tmp); \ } else \ (head)->rbh_root = (tmp); \ RB_LEFT(tmp, field) = (elm); \ RB_PARENT(elm, field) = (tmp); \ RB_AUGMENT(tmp); \ if ((RB_PARENT(tmp, field))) \ RB_AUGMENT(RB_PARENT(tmp, field)); \ } while (/*CONSTCOND*/ 0) #define RB_ROTATE_RIGHT(head, elm, tmp, field) do { \ (tmp) = RB_LEFT(elm, field); \ if ((RB_LEFT(elm, field) = RB_RIGHT(tmp, field)) != NULL) { \ RB_PARENT(RB_RIGHT(tmp, field), field) = (elm); \ } \ RB_AUGMENT(elm); \ if ((RB_PARENT(tmp, field) = RB_PARENT(elm, field)) != NULL) { \ if ((elm) == RB_LEFT(RB_PARENT(elm, field), field)) \ RB_LEFT(RB_PARENT(elm, field), field) = (tmp); \ else \ RB_RIGHT(RB_PARENT(elm, field), field) = (tmp); \ } else \ (head)->rbh_root = (tmp); \ RB_RIGHT(tmp, field) = (elm); \ RB_PARENT(elm, field) = (tmp); \ RB_AUGMENT(tmp); \ if ((RB_PARENT(tmp, field))) \ RB_AUGMENT(RB_PARENT(tmp, field)); \ } while (/*CONSTCOND*/ 0) /* Generates prototypes and inline functions */ #define RB_PROTOTYPE(name, type, field, cmp) \ void name##_RB_INSERT_COLOR(struct name *, struct type *); \ void name##_RB_REMOVE_COLOR(struct name *, struct type *, struct type *);\ struct type *name##_RB_REMOVE(struct name *, struct type *); \ struct type *name##_RB_INSERT(struct name *, struct type *); \ struct type *name##_RB_FIND(struct name *, struct type *); \ struct type *name##_RB_NEXT(struct type *); \ struct type *name##_RB_MINMAX(struct name *, int); \ \ /* Main rb operation. * Moves node close to the key of elm to top */ #define RB_GENERATE(name, type, field, cmp) \ void \ name##_RB_INSERT_COLOR(struct name *head, struct type *elm) \ { \ struct type *parent, *gparent, *tmp; \ while ((parent = RB_PARENT(elm, field)) != NULL && \ RB_COLOR(parent, field) == RB_RED) { \ gparent = RB_PARENT(parent, field); \ if (parent == RB_LEFT(gparent, field)) { \ tmp = RB_RIGHT(gparent, field); \ if (tmp && RB_COLOR(tmp, field) == RB_RED) { \ RB_COLOR(tmp, field) = RB_BLACK; \ RB_SET_BLACKRED(parent, gparent, field);\ elm = gparent; \ continue; \ } \ if (RB_RIGHT(parent, field) == elm) { \ RB_ROTATE_LEFT(head, parent, tmp, field);\ tmp = parent; \ parent = elm; \ elm = tmp; \ } \ RB_SET_BLACKRED(parent, gparent, field); \ RB_ROTATE_RIGHT(head, gparent, tmp, field); \ } else { \ tmp = RB_LEFT(gparent, field); \ if (tmp && RB_COLOR(tmp, field) == RB_RED) { \ RB_COLOR(tmp, field) = RB_BLACK; \ RB_SET_BLACKRED(parent, gparent, field);\ elm = gparent; \ continue; \ } \ if (RB_LEFT(parent, field) == elm) { \ RB_ROTATE_RIGHT(head, parent, tmp, field);\ tmp = parent; \ parent = elm; \ elm = tmp; \ } \ RB_SET_BLACKRED(parent, gparent, field); \ RB_ROTATE_LEFT(head, gparent, tmp, field); \ } \ } \ RB_COLOR(head->rbh_root, field) = RB_BLACK; \ } \ \ void \ name##_RB_REMOVE_COLOR(struct name *head, struct type *parent, struct type *elm) \ { \ struct type *tmp; \ while ((elm == NULL || RB_COLOR(elm, field) == RB_BLACK) && \ elm != RB_ROOT(head)) { \ if (RB_LEFT(parent, field) == elm) { \ tmp = RB_RIGHT(parent, field); \ if (RB_COLOR(tmp, field) == RB_RED) { \ RB_SET_BLACKRED(tmp, parent, field); \ RB_ROTATE_LEFT(head, parent, tmp, field);\ tmp = RB_RIGHT(parent, field); \ } \ if ((RB_LEFT(tmp, field) == NULL || \ RB_COLOR(RB_LEFT(tmp, field), field) == RB_BLACK) &&\ (RB_RIGHT(tmp, field) == NULL || \ RB_COLOR(RB_RIGHT(tmp, field), field) == RB_BLACK)) {\ RB_COLOR(tmp, field) = RB_RED; \ elm = parent; \ parent = RB_PARENT(elm, field); \ } else { \ if (RB_RIGHT(tmp, field) == NULL || \ RB_COLOR(RB_RIGHT(tmp, field), field) == RB_BLACK) {\ struct type *oleft; \ if ((oleft = RB_LEFT(tmp, field)) \ != NULL) \ RB_COLOR(oleft, field) = RB_BLACK;\ RB_COLOR(tmp, field) = RB_RED; \ RB_ROTATE_RIGHT(head, tmp, oleft, field);\ tmp = RB_RIGHT(parent, field); \ } \ RB_COLOR(tmp, field) = RB_COLOR(parent, field);\ RB_COLOR(parent, field) = RB_BLACK; \ if (RB_RIGHT(tmp, field)) \ RB_COLOR(RB_RIGHT(tmp, field), field) = RB_BLACK;\ RB_ROTATE_LEFT(head, parent, tmp, field);\ elm = RB_ROOT(head); \ break; \ } \ } else { \ tmp = RB_LEFT(parent, field); \ if (RB_COLOR(tmp, field) == RB_RED) { \ RB_SET_BLACKRED(tmp, parent, field); \ RB_ROTATE_RIGHT(head, parent, tmp, field);\ tmp = RB_LEFT(parent, field); \ } \ if ((RB_LEFT(tmp, field) == NULL || \ RB_COLOR(RB_LEFT(tmp, field), field) == RB_BLACK) &&\ (RB_RIGHT(tmp, field) == NULL || \ RB_COLOR(RB_RIGHT(tmp, field), field) == RB_BLACK)) {\ RB_COLOR(tmp, field) = RB_RED; \ elm = parent; \ parent = RB_PARENT(elm, field); \ } else { \ if (RB_LEFT(tmp, field) == NULL || \ RB_COLOR(RB_LEFT(tmp, field), field) == RB_BLACK) {\ struct type *oright; \ if ((oright = RB_RIGHT(tmp, field)) \ != NULL) \ RB_COLOR(oright, field) = RB_BLACK;\ RB_COLOR(tmp, field) = RB_RED; \ RB_ROTATE_LEFT(head, tmp, oright, field);\ tmp = RB_LEFT(parent, field); \ } \ RB_COLOR(tmp, field) = RB_COLOR(parent, field);\ RB_COLOR(parent, field) = RB_BLACK; \ if (RB_LEFT(tmp, field)) \ RB_COLOR(RB_LEFT(tmp, field), field) = RB_BLACK;\ RB_ROTATE_RIGHT(head, parent, tmp, field);\ elm = RB_ROOT(head); \ break; \ } \ } \ } \ if (elm) \ RB_COLOR(elm, field) = RB_BLACK; \ } \ \ struct type * \ name##_RB_REMOVE(struct name *head, struct type *elm) \ { \ struct type *child, *parent, *old = elm; \ int color; \ if (RB_LEFT(elm, field) == NULL) \ child = RB_RIGHT(elm, field); \ else if (RB_RIGHT(elm, field) == NULL) \ child = RB_LEFT(elm, field); \ else { \ struct type *left; \ elm = RB_RIGHT(elm, field); \ while ((left = RB_LEFT(elm, field)) != NULL) \ elm = left; \ child = RB_RIGHT(elm, field); \ parent = RB_PARENT(elm, field); \ color = RB_COLOR(elm, field); \ if (child) \ RB_PARENT(child, field) = parent; \ if (parent) { \ if (RB_LEFT(parent, field) == elm) \ RB_LEFT(parent, field) = child; \ else \ RB_RIGHT(parent, field) = child; \ RB_AUGMENT(parent); \ } else \ RB_ROOT(head) = child; \ if (RB_PARENT(elm, field) == old) \ parent = elm; \ (elm)->field = (old)->field; \ if (RB_PARENT(old, field)) { \ if (RB_LEFT(RB_PARENT(old, field), field) == old)\ RB_LEFT(RB_PARENT(old, field), field) = elm;\ else \ RB_RIGHT(RB_PARENT(old, field), field) = elm;\ RB_AUGMENT(RB_PARENT(old, field)); \ } else \ RB_ROOT(head) = elm; \ RB_PARENT(RB_LEFT(old, field), field) = elm; \ if (RB_RIGHT(old, field)) \ RB_PARENT(RB_RIGHT(old, field), field) = elm; \ if (parent) { \ left = parent; \ do { \ RB_AUGMENT(left); \ } while ((left = RB_PARENT(left, field)) != NULL); \ } \ goto color; \ } \ parent = RB_PARENT(elm, field); \ color = RB_COLOR(elm, field); \ if (child) \ RB_PARENT(child, field) = parent; \ if (parent) { \ if (RB_LEFT(parent, field) == elm) \ RB_LEFT(parent, field) = child; \ else \ RB_RIGHT(parent, field) = child; \ RB_AUGMENT(parent); \ } else \ RB_ROOT(head) = child; \ color: \ if (color == RB_BLACK) \ name##_RB_REMOVE_COLOR(head, parent, child); \ return (old); \ } \ \ /* Inserts a node into the RB tree */ \ struct type * \ name##_RB_INSERT(struct name *head, struct type *elm) \ { \ struct type *tmp; \ struct type *parent = NULL; \ int comp = 0; \ tmp = RB_ROOT(head); \ while (tmp) { \ parent = tmp; \ comp = (cmp)(elm, parent); \ if (comp < 0) \ tmp = RB_LEFT(tmp, field); \ else if (comp > 0) \ tmp = RB_RIGHT(tmp, field); \ else \ return (tmp); \ } \ RB_SET(elm, parent, field); \ if (parent != NULL) { \ if (comp < 0) \ RB_LEFT(parent, field) = elm; \ else \ RB_RIGHT(parent, field) = elm; \ RB_AUGMENT(parent); \ } else \ RB_ROOT(head) = elm; \ name##_RB_INSERT_COLOR(head, elm); \ return (NULL); \ } \ \ /* Finds the node with the same key as elm */ \ struct type * \ name##_RB_FIND(struct name *head, struct type *elm) \ { \ struct type *tmp = RB_ROOT(head); \ int comp; \ while (tmp) { \ comp = cmp(elm, tmp); \ if (comp < 0) \ tmp = RB_LEFT(tmp, field); \ else if (comp > 0) \ tmp = RB_RIGHT(tmp, field); \ else \ return (tmp); \ } \ return (NULL); \ } \ \ /* ARGSUSED */ \ struct type * \ name##_RB_NEXT(struct type *elm) \ { \ if (RB_RIGHT(elm, field)) { \ elm = RB_RIGHT(elm, field); \ while (RB_LEFT(elm, field)) \ elm = RB_LEFT(elm, field); \ } else { \ if (RB_PARENT(elm, field) && \ (elm == RB_LEFT(RB_PARENT(elm, field), field))) \ elm = RB_PARENT(elm, field); \ else { \ while (RB_PARENT(elm, field) && \ (elm == RB_RIGHT(RB_PARENT(elm, field), field)))\ elm = RB_PARENT(elm, field); \ elm = RB_PARENT(elm, field); \ } \ } \ return (elm); \ } \ \ struct type * \ name##_RB_MINMAX(struct name *head, int val) \ { \ struct type *tmp = RB_ROOT(head); \ struct type *parent = NULL; \ while (tmp) { \ parent = tmp; \ if (val < 0) \ tmp = RB_LEFT(tmp, field); \ else \ tmp = RB_RIGHT(tmp, field); \ } \ return (parent); \ } #define RB_NEGINF -1 #define RB_INF 1 #define RB_INSERT(name, x, y) name##_RB_INSERT(x, y) #define RB_REMOVE(name, x, y) name##_RB_REMOVE(x, y) #define RB_FIND(name, x, y) name##_RB_FIND(x, y) #define RB_NEXT(name, x, y) name##_RB_NEXT(y) #define RB_MIN(name, x) name##_RB_MINMAX(x, RB_NEGINF) #define RB_MAX(name, x) name##_RB_MINMAX(x, RB_INF) #define RB_FOREACH(x, name, head) \ for ((x) = RB_MIN(name, head); \ (x) != NULL; \ (x) = name##_RB_NEXT(x)) #endif /* _SYS_TREE_H_ */ gfarm-2.4.1/lib/libgfarm/gfutil/random.c0000644000000000000000000000135711507222722016565 0ustar rootroot#include #include #include #include #include #include "thrsubr.h" static void gfarm_random_initialize(void) { struct timeval t; gettimeofday(&t, NULL); #ifdef HAVE_RANDOM srandom(t.tv_sec + t.tv_usec + getpid()); #else srand(t.tv_sec + t.tv_usec + getpid()); #endif } long gfarm_random(void) { long rv; static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; static pthread_once_t rand_initialized = PTHREAD_ONCE_INIT; static const char diag[] = "gfarm_random"; pthread_once(&rand_initialized, gfarm_random_initialize); gfarm_mutex_lock(&mutex, diag, ""); #ifdef HAVE_RANDOM rv = random(); #else rv = rand(); #endif gfarm_mutex_unlock(&mutex, diag, ""); return (rv); } gfarm-2.4.1/lib/libgfarm/gfutil/thrsubr.c0000644000000000000000000000437711507222722017003 0ustar rootroot#include #include #include #include #include "gfutil.h" #include "thrsubr.h" void gfarm_mutex_init(pthread_mutex_t *mutex, const char *where, const char *what) { int err = pthread_mutex_init(mutex, NULL); if (err != 0) gflog_fatal(GFARM_MSG_1000212, "%s: %s mutex init: %s", where, what, strerror(err)); } void gfarm_mutex_lock(pthread_mutex_t *mutex, const char *where, const char *what) { int err = pthread_mutex_lock(mutex); if (err != 0) gflog_fatal(GFARM_MSG_1000213, "%s: %s mutex lock: %s", where, what, strerror(err)); } void gfarm_mutex_unlock(pthread_mutex_t *mutex, const char *where, const char *what) { int err = pthread_mutex_unlock(mutex); if (err != 0) gflog_fatal(GFARM_MSG_1000214, "%s: %s mutex unlock: %s", where, what, strerror(err)); } void gfarm_mutex_destroy(pthread_mutex_t *mutex, const char *where, const char *what) { int err = pthread_mutex_destroy(mutex); if (err != 0) gflog_fatal(GFARM_MSG_1001488, "%s: %s mutex destroy: %s", where, what, strerror(err)); } void gfarm_cond_init(pthread_cond_t *cond, const char *where, const char *what) { int err = pthread_cond_init(cond, NULL); if (err != 0) gflog_fatal(GFARM_MSG_1000215, "%s: %s cond init: %s", where, what, strerror(err)); } void gfarm_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex, const char *where, const char *what) { int err = pthread_cond_wait(cond, mutex); if (err != 0) gflog_fatal(GFARM_MSG_1000216, "%s: %s cond wait: %s", where, what, strerror(err)); } void gfarm_cond_signal(pthread_cond_t *cond, const char *where, const char *what) { int err = pthread_cond_signal(cond); if (err != 0) gflog_fatal(GFARM_MSG_1000217, "%s: %s cond signal: %s", where, what, strerror(err)); } void gfarm_cond_broadcast(pthread_cond_t *cond, const char *where, const char *what) { int err = pthread_cond_broadcast(cond); if (err != 0) gflog_fatal(GFARM_MSG_1002210, "%s: %s cond broadcast: %s", where, what, strerror(err)); } void gfarm_cond_destroy(pthread_cond_t *cond, const char *where, const char *what) { int err = pthread_cond_destroy(cond); if (err != 0) gflog_fatal(GFARM_MSG_1001489, "%s: %s cond destroy: %s", where, what, strerror(err)); } gfarm-2.4.1/lib/libgfarm/gfutil/gfevent.c0000644000000000000000000004307111507222722016742 0ustar rootroot#include /* XXX implement, poll, /dev/poll, kqueue and epoll version */ #include #include #include #include #include /* CHAR_BIT */ #include #include #include #include #include #include #include #include "gfutil.h" #include "gfevent.h" #define MIN_FDS_SIZE FD_SETSIZE #ifdef __FDS_BITS /* for glibc, esp. Debian/kFreeBSD */ #define GF_FDS_BITS(set) __FDS_BITS(set) #else #define GF_FDS_BITS(set) (set)->fds_bits #endif /* event */ struct gfarm_event { /* doubly linked circular list with a header */ struct gfarm_event *next, *prev; int filter; void *closure; struct timeval timeout; int timeout_specified; enum { GFARM_FD_EVENT, GFARM_TIMER_EVENT } type; union { struct gfarm_fd_event { void (*callback)(int, int, void *, const struct timeval *); int fd; } fd; struct gfarm_timer_event { void (*callback)(void *, const struct timeval *); } timeout; } u; }; struct gfarm_event * gfarm_fd_event_alloc(int filter, int fd, void (*callback)(int, int, void *, const struct timeval *), void *closure) { struct gfarm_event *ev; GFARM_MALLOC(ev); if (ev == NULL) return (NULL); ev->next = ev->prev = NULL; /* to be sure */ ev->type = GFARM_FD_EVENT; ev->filter = filter; ev->closure = closure; ev->u.fd.callback = callback; ev->u.fd.fd = fd; return (ev); } void gfarm_fd_event_set_callback(struct gfarm_event * ev, void (*callback)(int, int, void *, const struct timeval *), void *closure) { ev->closure = closure; ev->u.fd.callback = callback; } struct gfarm_event * gfarm_timer_event_alloc( void (*callback)(void *, const struct timeval *), void *closure) { struct gfarm_event *ev; GFARM_MALLOC(ev); if (ev == NULL) { gflog_debug(GFARM_MSG_1000767, "allocation of gfarm_event failed"); return (NULL); } ev->next = ev->prev = NULL; /* to be sure */ ev->type = GFARM_TIMER_EVENT; ev->filter = GFARM_EVENT_TIMEOUT; ev->closure = closure; ev->u.timeout.callback = callback; return (ev); } void gfarm_timer_event_set_callback(struct gfarm_event *ev, void (*callback)(void *, const struct timeval *), void *closure) { ev->closure = closure; ev->u.timeout.callback = callback; } void gfarm_event_free(struct gfarm_event *ev) { free(ev); } /* event queue */ struct gfarm_eventqueue { /* doubly linked circular list with a header */ struct gfarm_event header; int fd_set_size, fd_set_bytes; fd_set *read_fd_set, *write_fd_set, *exception_fd_set; }; struct gfarm_eventqueue * gfarm_eventqueue_alloc(void) { struct gfarm_eventqueue *q; GFARM_MALLOC(q); if (q == NULL) { gflog_debug(GFARM_MSG_1000768, "allocation of gfarm_eventqueue failed"); return (NULL); } /* make the queue empty */ q->header.next = q->header.prev = &q->header; q->fd_set_size = q->fd_set_bytes = 0; q->read_fd_set = q->write_fd_set = q->exception_fd_set = NULL; return (q); } void gfarm_eventqueue_free(struct gfarm_eventqueue *q) { if (q->read_fd_set != NULL) free(q->read_fd_set); if (q->write_fd_set != NULL) free(q->write_fd_set); if (q->exception_fd_set != NULL) free(q->exception_fd_set); #if 0 /* this may not be true, if gfarm_eventqueue_loop() fails */ /* assert that the queue is empty */ assert(q->header.next == &q->header && q->header.prev == &q->header); #endif free(q); } /* * XXX This is not so portable, * but fixed-size fd_set cannot be used. */ static int gfarm_eventqueue_realloc_fd_set(size_t old_bytes, size_t new_bytes, fd_set **fd_setpp) { fd_set *fsp; if (*fd_setpp != NULL) { fsp = realloc(*fd_setpp, new_bytes); if (fsp == NULL) { gflog_debug(GFARM_MSG_1000769, "re-allocation of fd_set failed"); return (0); /* failure */ } *fd_setpp = fsp; /* * We need to clear fd_set here, because * gfarm_eventqueue_add_event() may be called * from a callback in a loop of gfarm_eventqueue_turn(). */ /* assumes always new_bytes > old_bytes */ memset((char *)fsp + old_bytes, 0, new_bytes - old_bytes); } return (1); /* success */ } static int gfarm_eventqueue_alloc_fd_set(struct gfarm_eventqueue *q, int fd, fd_set **fd_setpp) { fd_set *fsp; if (fd >= q->fd_set_size) { size_t fds_size, fds_array_length, fds_bytes, fd_set_size; int overflow = 0; fds_size = q->fd_set_size > 0 ? q->fd_set_size : MIN_FDS_SIZE; for (; fd >= fds_size; fds_size += fds_size) ; /* * This calculates: * howmany(fds_size, sizeof(fsp->fds_bits[0]) * CHAR_BIT); * where howmany(x, y) == (((x) + ((y) - 1)) / (y)) */ fds_array_length = gfarm_size_add(&overflow, fds_size, (sizeof(GF_FDS_BITS(fsp)[0]) * CHAR_BIT) - 1) / (sizeof(GF_FDS_BITS(fsp)[0]) * CHAR_BIT); fds_bytes = gfarm_size_mul(&overflow, fds_array_length, sizeof(GF_FDS_BITS(fsp)[0])); fd_set_size = gfarm_size_mul(&overflow, fds_bytes, CHAR_BIT); if (overflow) { gflog_debug(GFARM_MSG_1000770, "overflow in multiplication of (%zd) and (%u)", fds_bytes, CHAR_BIT); return (0); /* failure */ } if (!gfarm_eventqueue_realloc_fd_set(q->fd_set_bytes,fds_bytes, &q->read_fd_set)) { gflog_debug(GFARM_MSG_1000771, "re-allocation of 'q->read_fd_set' failed"); return (0); /* failure */ } if (!gfarm_eventqueue_realloc_fd_set(q->fd_set_bytes,fds_bytes, &q->write_fd_set)) { /* XXX wastes q->read_fd_set_value */ gflog_debug(GFARM_MSG_1000772, "re-allocation of 'q->write_fd_set' failed"); return (0); /* failure */ } if (!gfarm_eventqueue_realloc_fd_set(q->fd_set_bytes,fds_bytes, &q->exception_fd_set)) { /*XXX wastes q->{r,w}*_fd_set_value*/ gflog_debug(GFARM_MSG_1000773, "re-allocation of 'q->exception_fd_set' " "failed"); return (0); /* failure */ } q->fd_set_bytes = fds_bytes; q->fd_set_size = fd_set_size; } if (*fd_setpp == NULL) { /* * XXX This is not so portable, * but fixed-size fd_set cannot be used. */ *fd_setpp = malloc(q->fd_set_bytes); if (*fd_setpp == NULL) { gflog_debug(GFARM_MSG_1000774, "allocation of fd_set failed"); return (0); /* failure */ } /* * We need to clear fd_set here, because * gfarm_eventqueue_add_event() may be called * from a callback in a loop of gfarm_eventqueue_turn(). */ memset(*fd_setpp, 0, q->fd_set_bytes); } return (1); /* success */ } int gfarm_eventqueue_add_event(struct gfarm_eventqueue *q, struct gfarm_event *ev, const struct timeval *timeout) { if (ev->next != NULL || ev->prev != NULL) /* shouldn't happen */ return (EINVAL); if (timeout == NULL) { ev->timeout_specified = 0; } else if ((ev->filter & GFARM_EVENT_TIMEOUT) != 0) { ev->timeout_specified = 1; gettimeofday(&ev->timeout, NULL); gfarm_timeval_add(&ev->timeout, timeout); } else { /* * if the event is not allocated with GFARM_EVENT_TIMEOUT, * it's not allowed to specify a timeout. */ gflog_debug(GFARM_MSG_1000775, "Event is not allocated with GFARM_EVENT_TIMEOUT"); return (EINVAL); } switch (ev->type) { case GFARM_FD_EVENT: if ((ev->filter & GFARM_EVENT_READ) != 0) { if (!gfarm_eventqueue_alloc_fd_set(q, ev->u.fd.fd, &q->read_fd_set)) { gflog_debug(GFARM_MSG_1000776, "allocation of 'q->read_fd_set' " "failed"); return (ENOMEM); } } if ((ev->filter & GFARM_EVENT_WRITE) != 0) { if (!gfarm_eventqueue_alloc_fd_set(q, ev->u.fd.fd, &q->write_fd_set)) { gflog_debug(GFARM_MSG_1000777, "allocation of 'q->write_fd_set' " "failed"); return (ENOMEM); } } if ((ev->filter & GFARM_EVENT_EXCEPTION) != 0) { if (!gfarm_eventqueue_alloc_fd_set(q, ev->u.fd.fd, &q->exception_fd_set)) { gflog_debug(GFARM_MSG_1000778, "allocation of 'q->exception_fd_set' " "failed"); return (ENOMEM); } } break; case GFARM_TIMER_EVENT: if (timeout == NULL) { gflog_debug(GFARM_MSG_1000779, "Event type is GFARM_TIMER_EVENT but " "timeout is NULL"); return (EINVAL); /* not allowed */ } break; } /* enqueue - insert at the tail of the circular list */ ev->next = &q->header; ev->prev = q->header.prev; q->header.prev->next = ev; q->header.prev = ev; return (0); } int gfarm_eventqueue_delete_event(struct gfarm_eventqueue *q, struct gfarm_event *ev) { if (ev->next == NULL || ev->prev == NULL) { /* shouldn't happen */ gflog_debug(GFARM_MSG_1000780, "Event queue link broken"); return (EINVAL); } /* dequeue */ ev->next->prev = ev->prev; ev->prev->next = ev->next; ev->next = ev->prev = NULL; /* to be sure */ return (0); } /* * run one turn of select(2) loop. * this function may return before the timeout. * * RETURN VALUE: * 0: All events are processed, and no event is remaining in the queue. * EAGAIN: There are still pending events. * EDEADLK: no watching file descriptor is requested, and any timer event * isn't specified, either. This means infinite sleep. * otherwise: select(2) failed, return value shows the `errno' of * the select(2). */ int gfarm_eventqueue_turn(struct gfarm_eventqueue *q, const struct timeval *timeo) { int nfound, max_fd = -1; struct gfarm_event *ev, *n; fd_set *read_fd_set, *write_fd_set, *exception_fd_set; struct timeval start_time, end_time, timeout_value, *timeout = NULL; int events; /* queue is empty? */ if (q->header.next == &q->header) return (0); /* finished */ /* * prepare arguments for select(2) */ if (timeo != NULL) { timeout_value = *timeo; timeout = &timeout_value; } /* * XXX This is not so portable, * but usual implementation of FD_ZERO cannot be used. */ if (q->read_fd_set != NULL) memset(q->read_fd_set, 0, q->fd_set_bytes); if (q->write_fd_set != NULL) memset(q->write_fd_set, 0, q->fd_set_bytes); if (q->exception_fd_set != NULL) memset(q->exception_fd_set, 0, q->fd_set_bytes); read_fd_set = write_fd_set = exception_fd_set = NULL; for (ev = q->header.next; ev != &q->header; ev = ev->next) { if (ev->timeout_specified) { if (timeout == NULL) { timeout = &timeout_value; timeout_value = ev->timeout; } else if (gfarm_timeval_cmp(&ev->timeout,timeout) <0){ timeout_value = ev->timeout; } } switch (ev->type) { case GFARM_FD_EVENT: if ((ev->filter & GFARM_EVENT_READ) != 0) { read_fd_set = q->read_fd_set; FD_SET(ev->u.fd.fd, read_fd_set); } if ((ev->filter & GFARM_EVENT_WRITE) != 0) { write_fd_set = q->write_fd_set; FD_SET(ev->u.fd.fd, write_fd_set); } if ((ev->filter & GFARM_EVENT_EXCEPTION) != 0) { exception_fd_set = q->exception_fd_set; FD_SET(ev->u.fd.fd, exception_fd_set); } if (ev->u.fd.fd > max_fd) max_fd = ev->u.fd.fd; break; case GFARM_TIMER_EVENT: break; } } /* * do select(2) */ if (max_fd < 0 && timeout == NULL) return (EDEADLK); /* infinite sleep without any watching fd */ gettimeofday(&start_time, NULL); if (timeout != NULL) { gfarm_timeval_sub(&timeout_value, &start_time); if (timeout_value.tv_sec < 0) timeout_value.tv_sec = timeout_value.tv_usec = 0; } nfound = select(max_fd + 1, read_fd_set, write_fd_set, exception_fd_set, timeout); if (nfound == -1) { int save_errno = errno; gflog_debug(GFARM_MSG_1000781, "select() failed: %s", strerror(save_errno)); return (save_errno); } gettimeofday(&end_time, NULL); /* * call event callback routines */ for (ev = q->header.next; ev != &q->header; ev = n) { /* * We shouldn't use "ev = ev->next" in the 3rd clause * of above "for(;;)" statement, because ev may be * deleted in this loop. */ n = ev->next; switch (ev->type) { case GFARM_FD_EVENT: events = 0; if ((ev->filter & GFARM_EVENT_READ) != 0 && FD_ISSET(ev->u.fd.fd, q->read_fd_set)) events |= GFARM_EVENT_READ; if ((ev->filter & GFARM_EVENT_WRITE) != 0 && FD_ISSET(ev->u.fd.fd, q->write_fd_set)) events |= GFARM_EVENT_WRITE; if ((ev->filter & GFARM_EVENT_EXCEPTION) != 0 && FD_ISSET(ev->u.fd.fd, q->exception_fd_set)) events |= GFARM_EVENT_EXCEPTION; if (events != 0) { gfarm_eventqueue_delete_event(q, ev); /* here is a good breakpoint on a debugger */ (*ev->u.fd.callback)(events, ev->u.fd.fd, ev->closure, &end_time); } else if (ev->timeout_specified && gfarm_timeval_cmp(&end_time, &ev->timeout) >= 0) { gfarm_eventqueue_delete_event(q, ev); (*ev->u.fd.callback)( GFARM_EVENT_TIMEOUT, ev->u.fd.fd, ev->closure, &end_time); } break; case GFARM_TIMER_EVENT: if (gfarm_timeval_cmp(&end_time, &ev->timeout) >= 0){ gfarm_eventqueue_delete_event(q, ev); (*ev->u.timeout.callback)( ev->closure, &end_time); } break; } } /* queue is empty? */ if (q->header.next == &q->header) return (0); /* finished */ return (EAGAIN); } /* * run whole select(2) loop. * * RETURN VALUE: * 0: All events are processed, and no event is remaining in the queue. * EDEADLK: no watching file descriptor is requested, and any timer event * isn't specified, either. This means infinite sleep. * ETIMEDOUT: timeout happened. * otherwise: select(2) failed, return value shows the `errno' of * the select(2). */ int gfarm_eventqueue_loop(struct gfarm_eventqueue *q, const struct timeval *timeo) { struct timeval limit, now, timeout_value, *timeout = NULL; int rv; if (timeo != NULL) { gettimeofday(&limit, NULL); gfarm_timeval_add(&limit, timeo); now = limit; timeout = &timeout_value; } for (;;) { if (timeout != NULL) { *timeout = limit; gfarm_timeval_sub(timeout, &now); } rv = gfarm_eventqueue_turn(q, timeout); if (rv == 0) return (0); /* completed */ if (rv != EAGAIN && rv != EINTR) { gflog_debug(GFARM_MSG_1000782, "gfarm_eventqueue_turn() failed: %d", rv); return (rv); /* probably program logic is wrong */ } if (timeout != NULL) { gettimeofday(&now, NULL); if (gfarm_timeval_cmp(&now, &limit) >= 0) return (ETIMEDOUT); /* timeout */ } } } #if 0 /* sample usage */ #include struct proto1_state { struct gfarm_eventqueue *q; int sock; struct gfarm_event *writable, *readable; void (*continuation)(void *); void *closure; /* results */ int error; unsigned char result; }; void proto1_receiving(int events, int fd, void *closure, const struct timeval *t) { struct proto1_state *state = closure; int rv; rv = read(state->sock, &state->result, sizeof(state->result)); if (rv == -1) { if (errno != EINTR && errno != EAGAIN) state->error = errno; else if ((rv = gfarm_eventqueue_add_event(state->q, state->readable, NULL)) != 0) { state->error = rv; } } if (state->continuation != NULL) (*state->continuation)(state->closure); } void proto1_sending(int events, int fd, void *closure, const struct timeval *t) { struct proto1_state *state = closure; unsigned char request_code = 1; int rv; rv = write(state->sock, &request_code, sizeof(request_code)); if (rv == -1) { if (errno != EINTR && errno != EAGAIN) { state->error = errno; } else if ((rv = gfarm_eventqueue_add_event(state->q, state->writable, NULL)) != 0) { state->error = rv; } else { return; /* go to proto1_sending() */ } } else { if ((rv = gfarm_eventqueue_add_event(state->q, state->readable, NULL)) == 0) { return; /* go to proto1_receiving() */ } state->error = rv; } if (state->continuation != NULL) (*state->continuation)(state->closure); } int proto1_request_multiplexed(struct gfarm_eventqueue *q, int peer_socket, void (*continuation)(void *), void *closure, struct proto1_state **statepp) { struct proto1_state *state; int rv = ENOMEM; GFARM_MALLOC(state); if (state == NULL) return (ENOMEM); state->writable = gfarm_fd_event_alloc(GFARM_EVENT_WRITE, peer_socket, proto1_sending, state); if (state->writable != NULL) { state->readable = gfarm_fd_event_alloc( GFARM_EVENT_READ, peer_socket, proto1_receiving, state); if (state->readable != NULL) { state->q = q; state->sock = peer_socket; state->continuation = continuation; state->closure = closure; state->error = 0; rv = gfarm_eventqueue_add_event(q, state->writable, NULL); if (rv == 0) { *statepp = state; return (0); /* go to proto1_sending() */ } gfarm_event_free(state->readable); } gfarm_event_free(state->writable); } free(state); return (rv); } int proto1_result_multiplexed(struct proto1_state *state, unsigned char *resultp) { int error = state->error; if (error == 0) *resultp = state->result; gfarm_event_free(state->readable); gfarm_event_free(state->writable); free(state); return (error); } struct p1_finalize_closure { char *name; struct proto1_state *state; }; void p1_finalize(void *closure) { struct p1_finalize_closure *p1 = closure; unsigned char result; int error = proto1_result_multiplexed(p1->state, &result); if (error != 0) fprintf(stderr, "%s: error = %s\n", p1->name, strerror(error)); else printf("%s: result=%c\n", p1->name, result); } void run2(int host1_socket, int host2_socket) { int error; struct gfarm_eventqueue *q; struct p1_finalize_closure fc1, fc2; /* initialize */ if ((q = gfarm_eventqueue_alloc()) == NULL) { fprintf(stderr, "out of memory\n"); return; } fc1.name = "host1"; fc1.state = NULL; error = proto1_request_multiplexed(q, host1_socket, p1_finalize, &fc1, &fc1.state); if (error != 0) fprintf(stderr, "host1: %s\n", strerror(error)); fc2.name = "host2"; fc2.state = NULL; error = proto1_request_multiplexed(q, host2_socket, p1_finalize, &fc2, &fc2.state); if (error != 0) fprintf(stderr, "host2: %s\n", strerror(error)); /* run */ error = gfarm_eventqueue_loop(q, NULL); if (error != 0) fprintf(stderr, "host2: %s\n", strerror(error)); /* terminate */ gfarm_eventqueue_free(q); } #endif /* sample usage */ gfarm-2.4.1/lib/libgfarm/gfutil/lru_cache.h0000644000000000000000000000320111507222722017225 0ustar rootroot/* * acquired > 0 && linked from gfarm_lru_cache: * the entry is occupied. * acquired > 0 && not linked from gfarm_lru_cache: * the entry is occupied, but shouldn't be used in future. (e.g. zombie) * acquired == 0 && linked from gfarm_lru_cache: * the entry is free, but it's still cached. * gfarm_lru_cache:free_cached_entries counts only this type of entries. * acquired == 0 && not linked from gfarm_lru_cache: * the entry is free, and it's not cached. */ struct gfarm_lru_entry { struct gfarm_lru_entry *next, *prev; /* doubly linked circular list */ int acquired; /* reference counter */ }; #define GFARM_LRU_CACHE_ENTRY_INITIALIZER(list_head_ptr) \ { \ (list_head_ptr), \ (list_head_ptr), \ 0 \ } struct gfarm_lru_cache { /* the head entry of doubly linked circular list */ struct gfarm_lru_entry list_head; int free_cached_entries; }; #define GFARM_LRU_CACHE_INITIALIZER(var) \ { \ GFARM_LRU_CACHE_ENTRY_INITIALIZER(&(var).list_head), \ 0 \ } void gfarm_lru_cache_link_entry(struct gfarm_lru_cache *, struct gfarm_lru_entry *); void gfarm_lru_cache_access_entry(struct gfarm_lru_cache *, struct gfarm_lru_entry *); void gfarm_lru_cache_add_entry(struct gfarm_lru_cache *, struct gfarm_lru_entry *); void gfarm_lru_cache_purge_entry(struct gfarm_lru_entry *); void gfarm_lru_init_uncached_entry(struct gfarm_lru_entry *); void gfarm_lru_cache_addref_entry(struct gfarm_lru_cache *, struct gfarm_lru_entry *); int gfarm_lru_cache_delref_entry(struct gfarm_lru_cache *, struct gfarm_lru_entry *); void gfarm_lru_cache_gc(struct gfarm_lru_cache *, int, void (*)(struct gfarm_lru_entry *, void *), void *, const char *); gfarm-2.4.1/lib/libgfarm/gfutil/daemon.c0000644000000000000000000000127511507222722016547 0ustar rootroot#include #include #include #include #include #include "gfutil.h" #include #ifndef HAVE_DAEMON int gfarm_daemon(int not_chdir, int not_close) { int save_errno; switch (fork()) { case -1: save_errno = errno; gflog_debug(GFARM_MSG_1000766, "fork() failed: %s", strerror(save_errno)); errno = save_errno; return (-1); case 0: break; default: exit(0); } setsid(); if (!not_chdir) chdir("/"); if (!not_close) { int fd = open("/dev/null", O_RDWR, 0); if (fd != -1) { dup2(fd, 0); dup2(fd, 1); dup2(fd, 2); if (fd > 2) close(fd); } } return (0); } #endif /* !HAVE_DAEMON */ gfarm-2.4.1/lib/libgfarm/gfutil/gfutil.h0000644000000000000000000000151011507222722016573 0ustar rootroot/* alloc */ size_t gfarm_size_add(int *, size_t, size_t); size_t gfarm_size_mul(int *, size_t, size_t); /* daemon */ #ifndef HAVE_DAEMON int gfarm_daemon(int, int); #else #define gfarm_daemon daemon #endif /* limit */ void gfarm_unlimit_nofiles(int *); /* send_no_sigpipe */ void gfarm_sigpipe_ignore(void); ssize_t gfarm_send_no_sigpipe(int, const void *, size_t); /* timeval */ #define GFARM_MILLISEC_BY_MICROSEC 1000 #define GFARM_SECOND_BY_MICROSEC 1000000 struct timeval; int gfarm_timeval_cmp(const struct timeval *, const struct timeval *); void gfarm_timeval_add(struct timeval *, const struct timeval *); void gfarm_timeval_sub(struct timeval *, const struct timeval *); void gfarm_timeval_add_microsec(struct timeval *, long); int gfarm_timeval_is_expired(const struct timeval *); /* random */ long gfarm_random(void); gfarm-2.4.1/lib/libgfarm/gfutil/lru_cache.c0000644000000000000000000000633011507222722017226 0ustar rootroot#include #include #include #include #include "gfutil.h" #include "lru_cache.h" /* link the entry to the head of the LRU cache list */ void gfarm_lru_cache_link_entry(struct gfarm_lru_cache *cache, struct gfarm_lru_entry *entry) { entry->next = cache->list_head.next; entry->prev = &cache->list_head; cache->list_head.next->prev = entry; cache->list_head.next = entry; } /* unlink the entry from the LRU cache list */ static void gfarm_lru_cache_unlink_entry(struct gfarm_lru_entry *entry) { entry->next->prev = entry->prev; entry->prev->next = entry->next; } /* move the entry to the head of the LRU cache list */ void gfarm_lru_cache_access_entry(struct gfarm_lru_cache *cache, struct gfarm_lru_entry *entry) { gfarm_lru_cache_unlink_entry(entry); gfarm_lru_cache_link_entry(cache, entry); } /* initialize the entry as the acquired state, and add it to the LRU cache */ void gfarm_lru_cache_add_entry(struct gfarm_lru_cache *cache, struct gfarm_lru_entry *entry) { entry->acquired = 1; gfarm_lru_cache_link_entry(cache, entry); } /* purge the entry from the LRU cache */ void gfarm_lru_cache_purge_entry(struct gfarm_lru_entry *entry) { gfarm_lru_cache_unlink_entry(entry); entry->prev = entry->next = NULL; /* mark the entry purged */ /* note that this entry may be still acquired */ } void gfarm_lru_init_uncached_entry(struct gfarm_lru_entry *entry) { entry->acquired = 1; entry->prev = entry->next = NULL; /* mark the entry purged */ } /* acquire the entry */ void gfarm_lru_cache_addref_entry(struct gfarm_lru_cache *cache, struct gfarm_lru_entry *entry) { if (entry->acquired == 0) { /* must be a cached entry */ assert(entry->prev != NULL && entry->next != NULL); --cache->free_cached_entries; /* now, this isn't free */ } ++entry->acquired; gfarm_lru_cache_access_entry(cache, entry); } /* free the entry */ int gfarm_lru_cache_delref_entry(struct gfarm_lru_cache *cache, struct gfarm_lru_entry *entry) { if (--entry->acquired <= 0) { if (entry->acquired < 0) { gflog_error(GFARM_MSG_1000003, "gfarm_lru_cache_delref_entry: %d\n", entry->acquired); abort(); } if (entry->prev != NULL) /* i.e. if cached entry */ ++cache->free_cached_entries; /* now, this is free */ return (1); /* not occupied by anyone */ } return (0); /* still occupied by someone else */ } void gfarm_lru_cache_gc(struct gfarm_lru_cache *cache, int free_target, void (*dispose_entry)(struct gfarm_lru_entry *, void *), void *closure, const char *entry_name) { struct gfarm_lru_entry *entry, *prev; /* search least recently used connection */ for (entry = cache->list_head.prev; cache->free_cached_entries > free_target; entry = prev) { prev = entry->prev; if (entry == &cache->list_head) { gflog_error(GFARM_MSG_1000004, "free %s/target = %d/%d", entry_name, cache->free_cached_entries, free_target); gflog_error(GFARM_MSG_1000005, "But no free %s is found.", entry_name); gflog_error(GFARM_MSG_1000006, "This shouldn't happen"); abort(); } if (entry->acquired <= 0) { gfarm_lru_cache_purge_entry(entry); --cache->free_cached_entries; /* abandon this free entry */ (*dispose_entry)(entry, closure); } } } gfarm-2.4.1/lib/libgfarm/gfutil/Makefile0000644000000000000000000000213411507222722016573 0ustar rootroot# $Id: Makefile 4895 2010-11-12 13:58:05Z tatebe $ top_builddir = ../../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk LIBRARY = libgfutil.la LIBRARY_RESULT = # do not install SRCS = alloc.c \ daemon.c \ gfevent.c \ gfnetdb.c \ hash.c \ hash_strptr.c \ id_table.c \ limit.c \ logutil.c \ lru_cache.c \ random.c \ send_no_sigpipe.c \ thrsubr.c \ timer.c \ timeval.c OBJS = alloc.lo \ daemon.lo \ gfevent.lo \ gfnetdb.lo \ hash.lo \ hash_strptr.lo \ id_table.lo \ limit.lo \ logutil.lo \ lru_cache.lo \ random.lo \ send_no_sigpipe.lo \ thrsubr.lo \ timer.lo \ timeval.lo CFLAGS = $(pthread_includes) $(COMMON_CFLAGS) -I$(GFUTIL_SRCDIR) all: $(LIBRARY) include $(top_srcdir)/makes/lib.mk include $(top_srcdir)/makes/gflog.mk ### $(OBJS): $(DEPGFARMINC) daemon.lo: gfutil.h gfevent.lo: $(INC_SRCDIR)/gfarm_misc.h gfutil.h gfevent.h gfnetdb.lo: gfnetdb.h id_table.lo: id_table.h hash.lo: gfutil.h hash.h hash_strptr.lo: hash.h limit.lo: gfutil.h logutil.lo: gfutil.h lru_cache.lo: lru_cache.h random.lo: thrsubr.h timer.lo: timer.h timeval.lo: gfutil.h gfarm-2.4.1/lib/libgfarm/gfutil/alloc.c0000644000000000000000000000337511507222722016401 0ustar rootroot#include #include #include #include #include size_t gfarm_size_add(int *overflowp, size_t a, size_t b) { size_t sum = a + b; if (sum < a) { *overflowp = 1; gflog_debug(GFARM_MSG_1000761, "Overlow when adding size_t (%llu) + (%llu)", (unsigned long long)a, (unsigned long long)b); } return (sum); } size_t gfarm_size_mul(int *overflowp, size_t a, size_t b) { size_t product = a * b; if (b != 0 && product / b != a) { gflog_debug(GFARM_MSG_1000762, "Overlow when multiplying size_t (%llu) * (%llu)", (unsigned long long)a, (unsigned long long)b); *overflowp = 1; } return (product); } void * gfarm_calloc_array(size_t number, size_t size) { int overflow = 0; gfarm_size_mul(&overflow, number, size); if (overflow) { gflog_debug(GFARM_MSG_1000763, "Overlow when calloc array of (%llu) * (%llu)", (unsigned long long)number, (unsigned long long)size); errno = ENOMEM; return NULL; } return (calloc(number, size)); } void * gfarm_malloc_array(size_t number, size_t size) { int overflow = 0; size_t total_size = gfarm_size_mul(&overflow, number, size); if (overflow) { gflog_debug(GFARM_MSG_1000764, "Overlow when malloc array of (%llu) * (%llu)", (unsigned long long)number, (unsigned long long)size); errno = ENOMEM; return NULL; } return (malloc(total_size)); } void * gfarm_realloc_array(void *src, size_t number, size_t size) { int overflow = 0; size_t total_size = gfarm_size_mul(&overflow, number, size); if (overflow) { gflog_debug(GFARM_MSG_1000765, "Overlow when realloc array of (%llu) * (%llu)", (unsigned long long)number, (unsigned long long)size); errno = ENOMEM; return NULL; } return (realloc(src, total_size)); } gfarm-2.4.1/lib/libgfarm/gfutil/timer.h0000644000000000000000000000211111507222722016417 0ustar rootroot/* * $Id: timer.h 3617 2007-03-12 08:32:55Z n-soda $ * * TIMER routine */ #ifdef i386 typedef unsigned long long gfarm_timerval_t; extern double gfarm_timerval_calibration; unsigned long long gfarm_get_cycles(void); #define gfarm_gettimerval(tp) (*(tp) = gfarm_get_cycles()) #define gfarm_timerval_second(tp) (*(tp) * gfarm_timerval_calibration) #define gfarm_timerval_sub(t1p, t2p) \ ((*(t1p) - *(t2p)) * gfarm_timerval_calibration) #ifdef __GNUC__ /* workaround gcc warning: may be used uninitialized */ #define GFARM_TIMEVAL_FIX_INITIALIZE_WARNING(t) ((t) = 0) #else #define GFARM_TIMEVAL_FIX_INITIALIZE_WARNING(t) #endif #else /* gettimeofday */ typedef struct timeval gfarm_timerval_t; #define gfarm_gettimerval(t1) gettimeofday(t1, NULL) #define gfarm_timerval_second(t1) \ ((double)(t1)->tv_sec + (double)(t1)->tv_usec * .000001) #define gfarm_timerval_sub(t1, t2) \ (((double)(t1)->tv_sec - (double)(t2)->tv_sec) \ + ((double)(t1)->tv_usec - (double)(t2)->tv_usec) * .000001) #define GFARM_TIMEVAL_FIX_INITIALIZE_WARNING(t) #endif void gfarm_timerval_calibrate(void); gfarm-2.4.1/lib/libgfarm/gfutil/hash_strptr.c0000644000000000000000000000277511507222722017653 0ustar rootroot#include #include #include "hash.h" /* * hash functions for pointer to (char *), */ int gfarm_hash_strptr(const void *key, int keylen) { const char *const *strptr = key; const char *str = *strptr; return (gfarm_hash_default(str, strlen(str))); } int gfarm_hash_key_equal_strptr( const void *key1, int key1len, const void *key2, int key2len) { const char *const *strptr1 = key1, *const *strptr2 = key2; const char *str1 = *strptr1, *str2 = *strptr2; int len1, len2; /* compare first character of the strings, short-cut in most cases. */ if (*str1 != *str2) return (0); len1 = strlen(str1); len2 = strlen(str2); if (len1 != len2) return (0); return (gfarm_hash_key_equal_default(str1, len1, str2, len2)); } /* * hash functions for pointer to case-folded (char *), */ int gfarm_hash_casefold_strptr(const void *key, int keylen) { const char *const *strptr = key; const char *str = *strptr; return (gfarm_hash_casefold(str, strlen(str))); } int gfarm_hash_key_equal_casefold_strptr( const void *key1, int key1len, const void *key2, int key2len) { const char *const *strptr1 = key1, *const *strptr2 = key2; const char *str1 = *strptr1, *str2 = *strptr2; int len1, len2; /* compare first character of the strings, short-cut in most cases. */ if (tolower(*(unsigned char *)str1) != tolower(*(unsigned char *)str2)) return (0); len1 = strlen(str1); len2 = strlen(str2); if (len1 != len2) return (0); return (gfarm_hash_key_equal_casefold(str1, len1, str2, len2)); } gfarm-2.4.1/lib/libgfarm/gfutil/thrsubr.h0000644000000000000000000000121711507222722016776 0ustar rootrootvoid gfarm_mutex_init(pthread_mutex_t *, const char *, const char *); void gfarm_mutex_lock(pthread_mutex_t *, const char *, const char *); void gfarm_mutex_unlock(pthread_mutex_t *, const char *, const char *); void gfarm_mutex_destroy(pthread_mutex_t *, const char *, const char *); void gfarm_cond_init(pthread_cond_t *, const char *, const char *); void gfarm_cond_wait(pthread_cond_t *, pthread_mutex_t *, const char *, const char *); void gfarm_cond_signal(pthread_cond_t *, const char *, const char *); void gfarm_cond_broadcast(pthread_cond_t *, const char *, const char *); void gfarm_cond_destroy(pthread_cond_t *, const char *, const char *); gfarm-2.4.1/lib/libgfarm/gfutil/timeval.c0000644000000000000000000000245311507222722016744 0ustar rootroot#include #include #include "gfutil.h" int gfarm_timeval_cmp(const struct timeval *t1, const struct timeval *t2) { if (t1->tv_sec > t2->tv_sec) return (1); if (t1->tv_sec < t2->tv_sec) return (-1); if (t1->tv_usec > t2->tv_usec) return (1); if (t1->tv_usec < t2->tv_usec) return (-1); return (0); } static void gfarm_timeval_normalize(struct timeval *t) { long n; if (t->tv_usec >= GFARM_SECOND_BY_MICROSEC) { n = t->tv_usec / GFARM_SECOND_BY_MICROSEC; t->tv_usec -= n * GFARM_SECOND_BY_MICROSEC; t->tv_sec += n; } else if (t->tv_usec < 0) { n = -t->tv_usec / GFARM_SECOND_BY_MICROSEC + 1; t->tv_usec += n * GFARM_SECOND_BY_MICROSEC; t->tv_sec -= n; } } void gfarm_timeval_add(struct timeval *t1, const struct timeval *t2) { t1->tv_sec += t2->tv_sec; t1->tv_usec += t2->tv_usec; gfarm_timeval_normalize(t1); } void gfarm_timeval_sub(struct timeval *t1, const struct timeval *t2) { t1->tv_sec -= t2->tv_sec; t1->tv_usec -= t2->tv_usec; gfarm_timeval_normalize(t1); } void gfarm_timeval_add_microsec(struct timeval *t, long microsec) { t->tv_usec += microsec; gfarm_timeval_normalize(t); } int gfarm_timeval_is_expired(const struct timeval *expiration) { struct timeval now; gettimeofday(&now, NULL); return (gfarm_timeval_cmp(&now, expiration) > 0); } gfarm-2.4.1/lib/libgfarm/gfutil/gfnetdb.c0000644000000000000000000000260311507222722016711 0ustar rootroot#include #include #include #include "thrsubr.h" #include "gfnetdb.h" #ifndef HAVE_MTSAFE_NETDB static pthread_mutex_t netdb_mutex = PTHREAD_MUTEX_INITIALIZER; #endif static const char mutex_name[] = "netdb_mutex"; int gfarm_getaddrinfo(const char *hostname, const char *servname, const struct addrinfo *hints, struct addrinfo **res) { int rv; static const char diag[] = "gfarm_getaddrinfo"; #ifndef HAVE_MTSAFE_NETDB gfarm_mutex_lock(&netdb_mutex, diag, mutex_name); #endif rv = getaddrinfo(hostname, servname, hints, res); #ifndef HAVE_MTSAFE_NETDB gfarm_mutex_unlock(&netdb_mutex, diag, mutex_name); #endif return (rv); } void gfarm_freeaddrinfo(struct addrinfo *ai) { static const char diag[] = "gfarm_freeaddrinfo"; #ifndef HAVE_MTSAFE_NETDB gfarm_mutex_lock(&netdb_mutex, diag, mutex_name); #endif freeaddrinfo(ai); #ifndef HAVE_MTSAFE_NETDB gfarm_mutex_unlock(&netdb_mutex, diag, mutex_name); #endif } int gfarm_getnameinfo(const struct sockaddr *sa, socklen_t salen, char *host, size_t hostlen, char *serv, size_t servlen, int flags) { int rv; static const char diag[] = "gfarm_getnameinfo"; #ifndef HAVE_MTSAFE_NETDB gfarm_mutex_lock(&netdb_mutex, diag, mutex_name); #endif rv = getnameinfo(sa, salen, host, hostlen, serv, servlen, flags); #ifndef HAVE_MTSAFE_NETDB gfarm_mutex_unlock(&netdb_mutex, diag, mutex_name); #endif return (rv); } gfarm-2.4.1/lib/libgfarm/gfutil/hash.h0000644000000000000000000000401011507222722016222 0ustar rootroot/* for general memory data (including string) */ int gfarm_hash_default(const void *, int); int gfarm_hash_key_equal_default(const void *, int, const void *, int); /* for string key (casefold) */ int gfarm_hash_casefold(const void *, int); int gfarm_hash_key_equal_casefold(const void *, int, const void *, int); /* for pointer to null-terminated string. NOTE: not (char *), but (char **) */ int gfarm_hash_strptr(const void *, int); int gfarm_hash_key_equal_strptr(const void *, int, const void *, int); /* for pointer to null-terminated string. (casefold) NOTE: (char **) */ int gfarm_hash_casefold_strptr(const void *, int); int gfarm_hash_key_equal_casefold_strptr(const void *, int, const void *, int); struct gfarm_hash_table; struct gfarm_hash_entry; struct gfarm_hash_table *gfarm_hash_table_alloc(int, int (*)(const void *, int), int (*)(const void *, int, const void *, int)); void gfarm_hash_table_free(struct gfarm_hash_table *); struct gfarm_hash_entry *gfarm_hash_lookup(struct gfarm_hash_table *, const void *, int); struct gfarm_hash_entry *gfarm_hash_enter(struct gfarm_hash_table *, const void *, int, int, int *); int gfarm_hash_purge(struct gfarm_hash_table *, const void *, int); void *gfarm_hash_entry_key(struct gfarm_hash_entry *); int gfarm_hash_entry_key_length(struct gfarm_hash_entry *); void *gfarm_hash_entry_data(struct gfarm_hash_entry *); int gfarm_hash_entry_data_length(struct gfarm_hash_entry *); /* * hash iterator */ struct gfarm_hash_iterator { struct gfarm_hash_table *table; int bucket_index; struct gfarm_hash_entry **pp; }; void gfarm_hash_iterator_begin(struct gfarm_hash_table *, struct gfarm_hash_iterator *); void gfarm_hash_iterator_next(struct gfarm_hash_iterator *); int gfarm_hash_iterator_is_end(struct gfarm_hash_iterator *); struct gfarm_hash_entry *gfarm_hash_iterator_access( struct gfarm_hash_iterator *); int gfarm_hash_iterator_lookup(struct gfarm_hash_table *, const void *, int, struct gfarm_hash_iterator *); int gfarm_hash_iterator_purge(struct gfarm_hash_iterator *); gfarm-2.4.1/lib/libgfarm/gfutil/logutil.c0000644000000000000000000001460311507222722016762 0ustar rootroot#include #include #include #include #include #include #include #include #include #include #define GFLOG_USE_STDARG #include #define GFARM_CATALOG_SET_NO 1 static const char *log_identifier = "libgfarm"; static char *log_auxiliary_info = NULL; static int log_use_syslog = 0; static int log_level = GFARM_DEFAULT_PRIORITY_LEVEL_TO_LOG; static nl_catd catd = (nl_catd)-1; static const char *catalog_file = "gfarm.cat"; static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; static int log_message_verbose; int gflog_set_message_verbose(int new) { int old = log_message_verbose; log_message_verbose = new; return (old); } int gflog_syslog_enabled(void) { return (log_use_syslog); } static void gflog_catopen(const char *file) { if (file == NULL) catd = catopen(catalog_file, 0); else catd = catopen(file, 0); } static void gflog_catclose(void) { catclose(catd); } void gflog_initialize(void) { gflog_catopen(NULL); } void gflog_terminate(void) { gflog_catclose(); } #define GFLOG_SNPRINTF(buf, bp, endp, ...) \ { \ int s = snprintf(bp, (endp) - (bp), __VA_ARGS__); \ if (s < 0 || s >= (endp) - (bp)) \ return (buf); \ (bp) += s; \ } static char * gflog_vmessage_message(int msg_no, const char *file, int line_no, const char *func, const char *format, va_list ap) { static char buf[2048]; char *catmsg, *bp = buf, *endp = buf + sizeof buf - 1; /* the last one is used as a terminator */ *endp = '\0'; if (!log_use_syslog) GFLOG_SNPRINTF(buf, bp, endp, "%s: ", log_identifier); GFLOG_SNPRINTF(buf, bp, endp, "[%06d] ", msg_no); if (log_message_verbose > 0) { GFLOG_SNPRINTF(buf, bp, endp, "(%s:%d", file, line_no); if (log_message_verbose > 1) GFLOG_SNPRINTF(buf, bp, endp, " %s()", func); GFLOG_SNPRINTF(buf, bp, endp, ") "); } if (log_auxiliary_info != NULL) GFLOG_SNPRINTF(buf, bp, endp, "(%s) ", log_auxiliary_info); catmsg = catgets(catd, GFARM_CATALOG_SET_NO, msg_no, NULL); vsnprintf(bp, endp - bp, catmsg != NULL ? catmsg : format, ap); return (buf); } static void gflog_sub(int priority, const char *str1, const char *str2) { if (log_use_syslog) syslog(priority, "%s%s", str1, str2); else fprintf(stderr, "%s%s\n", str1, str2); } void gflog_vmessage(int msg_no, int priority, const char *file, int line_no, const char *func, const char *format, va_list ap) { int rv; char *msg; if (priority > log_level) /* not worth reporting */ return; /* gflog_vmessage_message returns statically allocated space */ rv = pthread_mutex_lock(&mutex); if (rv != 0) gflog_sub(LOG_ERR, "gflog_vmessage: pthread_mutex_lock: ", strerror(rv)); msg = gflog_vmessage_message(msg_no, file, line_no, func, format, ap); gflog_sub(priority, "", msg); rv = pthread_mutex_unlock(&mutex); if (rv != 0) gflog_sub(LOG_ERR, "gflog_vmessage: pthread_mutex_unlock: %s", strerror(rv)); } void gflog_message(int msg_no, int priority, const char *file, int line_no, const char *func, const char *format, ...) { va_list ap; va_start(ap, format); gflog_vmessage(msg_no, priority, file, line_no, func, format, ap); va_end(ap); } void gflog_fatal_message(int msg_no, int priority, const char *file, int line_no, const char *func, const char *format, ...) { va_list ap; va_start(ap, format); gflog_vmessage(msg_no, priority, file, line_no, func, format, ap); va_end(ap); exit(2); } void gflog_vmessage_errno(int msg_no, int priority, const char *file, int line_no, const char *func, const char *format, va_list ap) { int save_errno = errno; char buffer[2048]; vsnprintf(buffer, sizeof buffer, format, ap); gflog_message(msg_no, priority, file, line_no, func, "%s, %s", buffer, strerror(save_errno)); } void gflog_message_errno(int msg_no, int priority, const char *file, int line_no, const char *func, const char *format, ...) { va_list ap; va_start(ap, format); gflog_vmessage_errno(msg_no, priority, file, line_no, func, format, ap); va_end(ap); } void gflog_fatal_message_errno(int msg_no, int priority, const char *file, int line_no, const char *func, const char *format, ...) { va_list ap; va_start(ap, format); gflog_vmessage_errno(msg_no, priority, file, line_no, func, format, ap); va_end(ap); exit(2); } void gflog_set_priority_level(int priority) { log_level = priority; } void gflog_set_identifier(const char *identifier) { log_identifier = identifier; } void gflog_set_auxiliary_info(char *aux_info) { log_auxiliary_info = aux_info; } char * gflog_get_auxiliary_info(void) { return (log_auxiliary_info); } void gflog_syslog_open(int syslog_option, int syslog_facility) { openlog(log_identifier, syslog_option, syslog_facility); log_use_syslog = 1; } int gflog_syslog_name_to_facility(const char *name) { int i; struct { const char *name; int facility; } syslog_facilities[] = { { "kern", LOG_KERN }, { "user", LOG_USER }, { "mail", LOG_MAIL }, { "daemon", LOG_DAEMON }, { "auth", LOG_AUTH }, { "syslog", LOG_SYSLOG }, { "lpr", LOG_LPR }, { "news", LOG_NEWS }, { "uucp", LOG_UUCP }, { "cron", LOG_CRON }, #ifdef LOG_AUTHPRIV { "authpriv", LOG_AUTHPRIV }, #endif #ifdef LOG_FTP { "ftp", LOG_FTP }, #endif { "local0", LOG_LOCAL0 }, { "local1", LOG_LOCAL1 }, { "local2", LOG_LOCAL2 }, { "local3", LOG_LOCAL3 }, { "local4", LOG_LOCAL4 }, { "local5", LOG_LOCAL5 }, { "local6", LOG_LOCAL6 }, { "local7", LOG_LOCAL7 }, }; for (i = 0; i < GFARM_ARRAY_LENGTH(syslog_facilities); i++) { if (strcmp(syslog_facilities[i].name, name) == 0) return (syslog_facilities[i].facility); } return (-1); /* not found */ } int gflog_syslog_name_to_priority(const char *name) { int i; struct { char *name; int priority; } syslog_priorities[] = { { "emerg", LOG_EMERG }, { "alert", LOG_ALERT }, { "crit", LOG_CRIT }, { "err", LOG_ERR }, { "warning", LOG_WARNING }, { "notice", LOG_NOTICE }, { "info", LOG_INFO }, { "debug", LOG_DEBUG }, }; for (i = 0; i < GFARM_ARRAY_LENGTH(syslog_priorities); i++) { if (strcmp(syslog_priorities[i].name, name) == 0) return (syslog_priorities[i].priority); } return (-1); /* not found */ } /* * authentication log */ static int authentication_verbose; int gflog_auth_set_verbose(int verbose) { int old = authentication_verbose; authentication_verbose = verbose; return (old); } int gflog_auth_get_verbose(void) { return (authentication_verbose); } gfarm-2.4.1/lib/libgfarm/gfutil/limit.c0000644000000000000000000000166411507222722016424 0ustar rootroot#include #include #ifdef HAVE_SETRLIMIT #include #include #endif #include #include "gfutil.h" /* * - Unlimit file descriptors. * - Returns numbers of file descriptors to *file_table_size_p, * if it is available, otherwise do not touch that. */ void gfarm_unlimit_nofiles(int *file_table_size_p) { #ifdef HAVE_SETRLIMIT struct rlimit limit; if (getrlimit(RLIMIT_NOFILE, &limit) == -1) { gflog_warning_errno(GFARM_MSG_1000001, "getrlimit"); return; } if (limit.rlim_cur != limit.rlim_max) { /* do not use rlim_t here, because rlim_t is not portable */ struct rlimit save_current = limit; limit.rlim_cur = limit.rlim_max; if (setrlimit(RLIMIT_NOFILE, &limit) == -1) { limit = save_current; gflog_warning_errno(GFARM_MSG_1000002, "setrlimit"); } } if (limit.rlim_cur != RLIM_INFINITY) *file_table_size_p = limit.rlim_cur; #endif } gfarm-2.4.1/lib/libgfarm/gfutil/gfnetdb.h0000644000000000000000000000045511507222722016721 0ustar rootrootstruct sockaddr; struct addrinfo; int gfarm_getaddrinfo(const char *, const char *, const struct addrinfo *, struct addrinfo **); void gfarm_freeaddrinfo(struct addrinfo *); int gfarm_getnameinfo(const struct sockaddr *, socklen_t, char *, size_t, char *, size_t, int); gfarm-2.4.1/lib/libgfarm/gfutil/gfevent.h0000644000000000000000000000344311507222722016746 0ustar rootroot/* * This interface is a mimic of the libevent library by Niels Provos. * * XXX - make this library a wrapper to libevent, if the system has it. */ struct timeval; /* event */ struct gfarm_event; #define GFARM_EVENT_TIMEOUT 1 #define GFARM_EVENT_READ 2 #define GFARM_EVENT_WRITE 4 #define GFARM_EVENT_EXCEPTION 8 struct gfarm_event *gfarm_fd_event_alloc(int, int, void (*)(int, int, void *, const struct timeval *), void *); void gfarm_fd_event_set_callback(struct gfarm_event *, void (*)(int, int, void *, const struct timeval *), void *); /* * NOTE: * timer_event shouldn't be used for timeout handling of * read/write/exception processing, because it's possible that both a * timer_event handler and a read/write/exception handler are called * at once. In other words, if timer_event is used for such timeout * handling, timer_event handler may be called even if timeout doesn't * actually happen. * If fd_event is used with GFARM_EVENT_TIMEOUT, it's guaranteed that * the TIMEOUT event and READ/WRITE/EXCEPTION event never happen at once. */ struct gfarm_event *gfarm_timer_event_alloc( void (*)(void *, const struct timeval *), void *); void gfarm_timer_event_set_callback(struct gfarm_event *, void (*)(void *, const struct timeval *), void *); void gfarm_event_free(struct gfarm_event *); /* event queue */ struct gfarm_eventqueue; struct gfarm_eventqueue *gfarm_eventqueue_alloc(void); void gfarm_eventqueue_free(struct gfarm_eventqueue *); int gfarm_eventqueue_add_event(struct gfarm_eventqueue *, struct gfarm_event *, const struct timeval *); int gfarm_eventqueue_delete_event(struct gfarm_eventqueue *, struct gfarm_event *); int gfarm_eventqueue_turn(struct gfarm_eventqueue *, const struct timeval *); int gfarm_eventqueue_loop(struct gfarm_eventqueue *, const struct timeval *); gfarm-2.4.1/lib/libgfarm/gfutil/id_table.c0000644000000000000000000004062511507222722017051 0ustar rootroot#include #include #include #include #include #include #include #include "id_table.h" #define ALIGNMENT 16 #define ALIGN_CEIL_BY(p, alignment) \ (((unsigned long)(p) + (alignment) - 1) & ~((alignment) - 1)) #define ALIGN_CEIL(p) ALIGN_CEIL_BY(p, ALIGNMENT) #define INITIAL_DELTA 10 #define DELTA_SHIFT 1 #define DEFAULT_ID_BASE 1 /* smaller than INT_MAX - (INT_MAX >> DELTA_SHIFT) */ #define DEFAULT_ID_LIMIT 1000000000 struct gfarm_id_free_data { struct gfarm_id_free_data *next; }; struct gfarm_id_data_chunk { struct gfarm_id_data_chunk *next; }; struct gfarm_id_index { void *data; gfarm_int32_t id; }; struct gfarm_id_table { struct gfarm_id_table_entry_ops *entry_ops; size_t entry_size; int id_base, id_next, id_limit; int idx_delta; int hole_start, hole_end, idxsize; int head_free, tail_free; struct gfarm_id_index *index; struct gfarm_id_free_data *free_data; struct gfarm_id_data_chunk *chunks; }; struct gfarm_id_table * gfarm_id_table_alloc(struct gfarm_id_table_entry_ops *entry_ops) { struct gfarm_id_table *idtab; GFARM_MALLOC(idtab); if (idtab == NULL) { gflog_debug(GFARM_MSG_1000787, "allocation of 'gfarm_id_table' failed"); return (NULL); } idtab->entry_ops = entry_ops; /* this assumes sizeof(struct gfarm_id_free_data) is power of 2 */ if ((sizeof(struct gfarm_id_free_data) & (sizeof(struct gfarm_id_free_data) - 1)) != 0) abort(); if (entry_ops->entry_size == 0) idtab->entry_size = sizeof(struct gfarm_id_free_data); else idtab->entry_size = ALIGN_CEIL_BY(entry_ops->entry_size, sizeof(struct gfarm_id_free_data)); idtab->id_next = 1; idtab->id_base = DEFAULT_ID_BASE; idtab->id_limit = DEFAULT_ID_LIMIT; idtab->idx_delta = INITIAL_DELTA; idtab->idxsize = idtab->hole_start = idtab->hole_end = idtab->head_free = idtab->tail_free = 0; idtab->index = NULL; idtab->free_data = NULL; idtab->chunks = NULL; return (idtab); } void gfarm_id_table_free(struct gfarm_id_table *idtab, void (*id_free)(void *, gfarm_int32_t, void *), void *closure) { struct gfarm_id_index *index = idtab->index; int i; struct gfarm_id_data_chunk *p, *q; if (index != NULL) { if (id_free != NULL) { for (i = 0; i < idtab->hole_start; i++) { if (index[i].data != NULL) (*id_free)(closure, index[i].id, index[i].data); } for (i = idtab->hole_end; i < idtab->idxsize; i++) { if (index[i].data != NULL) (*id_free)(closure, index[i].id, index[i].data); } } free(index); } for (p = idtab->chunks; p != NULL; p = q) { q = p->next; free(p); } free(idtab); } void gfarm_id_table_set_base(struct gfarm_id_table *idtab, gfarm_int32_t base) { idtab->id_base = base; } void gfarm_id_table_set_limit(struct gfarm_id_table *idtab, gfarm_int32_t limit) { idtab->id_limit = limit; } void gfarm_id_table_set_initial_size(struct gfarm_id_table *idtab, gfarm_int32_t sz) { idtab->idx_delta = sz; } #if 0 int gfarm_id_get_space_from_head(struct gfarm_id_table *idtab) { struct gfarm_id_index *index = idtab->index; size_t i = idtab->hole_start; size_t avail, avail_len, space_len; if (idtab->head_free <= 0) return (0); /* no space */ while (i > 0) { --i; if (index[i].data != NULL) continue; /* space found */ avail = i + 1; avail_len = idtab->hole_start - avail; while (i > 0) { --i; if (index[i].data != NULL) { ++i; break; } } memmove(&index[i], &index[avail], avail_len * sizeof(index[0])); space_len = avail - i; idtab->hole_start -= space_len; idtab->head_free -= space_len; return (1); /* got space */ } /* assert(0); */ idtab->head_free = 0; return (0); } #endif #if 0 int gfarm_id_get_space_from_tail(struct gfarm_id_table *idtab) { struct gfarm_id_index *index = idtab->index; size_t i = idtab->hole_end; size_t space, avail_len, space_len; if (idtab->tail_free <= 0) return (0); /* no space */ for (; i < idtab->idxsize; i++) { if (index[i].data != NULL) continue; /* space found */ space = i; avail_len = space - idtab->hole_end; for (++i; i < idtab->idxsize; i++) { if (index[i].data != NULL) break; } memmove(&index[i - avail_len], &index[idtab->hole_end], avail_len * sizeof(index[0])); space_len = i - space; #if 0 assert(idtab->hole_end + space_len == i - avail_len); #endif idtab->hole_end += space_len; idtab->tail_free -= space_len; return (1); /* got space */ } /* assert(0); */ idtab->tail_free = 0; return (0); } #endif int gfarm_id_compaction_from_head_force(struct gfarm_id_table *idtab) { struct gfarm_id_index *index = idtab->index; size_t i, space, avail, avail_len; for (i = 0; i < idtab->hole_start; i++) { if (index[i].data == NULL) break; } if (i >= idtab->hole_start) { idtab->head_free = 0; return (0); } space = i++; while (i < idtab->hole_start) { for (; i < idtab->hole_start; i++) { if (index[i].data != NULL) break; } avail = i; for (; i < idtab->hole_start; i++) { if (index[i].data == NULL) break; } avail_len = i - avail; memmove(&index[space], &index[avail], avail_len * sizeof(index[0])); space += avail_len; } idtab->hole_start = space; idtab->head_free = 0; return (1); } int gfarm_id_compaction_from_tail_force(struct gfarm_id_table *idtab) { struct gfarm_id_index *index = idtab->index; size_t i, space, room, avail_len; /* * note that idtab->hole_end may be 0, * and condition like (i >= idtab->hole_end) always true in that case, * because i (which is size_t) is unsigned. */ for (i = idtab->idxsize; i > idtab->hole_end; ) { --i; if (index[i].data == NULL) break; } if (i < idtab->hole_end || index[i].data != NULL) { idtab->tail_free = 0; return (0); } space = i; while (i > idtab->hole_end) { while (i > idtab->hole_end) { --i; if (index[i].data != NULL) { ++i; break; } } room = i; while (i > idtab->hole_end) { --i; if (index[i].data == NULL) { ++i; break; } } avail_len = room - i; space -= avail_len; memmove(&index[space + 1], &index[i], avail_len * sizeof(index[0])); } idtab->hole_end = space + 1; idtab->tail_free = 0; return (1); } int gfarm_id_compaction_from_head(struct gfarm_id_table *idtab) { if (idtab->head_free <= 0) return (0); /* no room for compaction */ return (gfarm_id_compaction_from_head_force(idtab)); } int gfarm_id_compaction_from_tail(struct gfarm_id_table *idtab) { if (idtab->tail_free <= 0) return (0); /* no room for compaction */ return (gfarm_id_compaction_from_tail_force(idtab)); } void gfarm_id_shrink_head(struct gfarm_id_table *idtab) { while (idtab->hole_start > 0) { if (idtab->index[idtab->hole_start - 1].data != NULL) break; --idtab->hole_start; --idtab->head_free; } } void gfarm_id_shrink_tail(struct gfarm_id_table *idtab) { while (idtab->hole_end < idtab->idxsize) { if (idtab->index[idtab->hole_end].data != NULL) break; ++idtab->hole_end; --idtab->tail_free; } } struct gfarm_id_index * gfarm_id_bsearch(struct gfarm_id_table *idtab, int head, int tail, gfarm_int32_t id) { struct gfarm_id_index *index = idtab->index; int mid; while (head < tail) { mid = (head + tail) >> 1; if (index[mid].id == id) return (&index[mid]); if (index[mid].id > id) tail = mid; else head = mid + 1; } return (NULL); /* not found */ } int gfarm_id_bsearch_next(struct gfarm_id_table *idtab, int head, int tail, gfarm_int32_t id) { struct gfarm_id_index *index = idtab->index; int mid, tail_save = tail; while (head < tail) { mid = (head + tail) >> 1; if (index[mid].id == id) return (mid); if (index[mid].id > id) tail = mid; else head = mid + 1; } /* assert(head == tail); */ if (head >= tail_save || index[head].id > id) return (head); return (head + 1); } void gfarm_id_rewind(struct gfarm_id_table *idtab) { int i; gfarm_int32_t id = idtab->id_base; if (idtab->hole_start > 0 && idtab->index[idtab->hole_start - 1].id >= id) { i = gfarm_id_bsearch_next(idtab, 0, idtab->hole_start, id); /* assert(i < idtab->hole_start); */ for (; i < idtab->hole_start; i++) { if (idtab->index[i].data == NULL) break; } if (i < idtab->hole_start) { idtab->id_next = idtab->index[i].id; i = idtab->hole_start - 1 - i; memmove(&idtab->index[idtab->hole_end - i], &idtab->index[idtab->hole_start - i], i * sizeof(struct gfarm_id_index)); idtab->hole_start -= i + 1; idtab->hole_end -= i; /* recalculate idtab->head_free and idtab->tail_free */ gfarm_id_compaction_from_head_force(idtab); gfarm_id_compaction_from_tail_force(idtab); return; } id = idtab->index[idtab->hole_start - 1].id + 1; } if (idtab->hole_end < idtab->idxsize && idtab->index[idtab->hole_end].id <= id) { i = gfarm_id_bsearch_next(idtab, idtab->hole_end, idtab->idxsize, id); /* assert(i >= idtab->hole_end); */ for (; i < idtab->idxsize; i++) { if (idtab->index[i].data == NULL) break; } if (i < idtab->idxsize) { idtab->id_next = idtab->index[i].id; i = i - idtab->hole_end; memmove(&idtab->index[idtab->hole_start], &idtab->index[idtab->hole_end], i * sizeof(struct gfarm_id_index)); idtab->hole_start += i; idtab->hole_end += i + 1; /* recalculate idtab->head_free and idtab->tail_free */ gfarm_id_compaction_from_head_force(idtab); gfarm_id_compaction_from_tail_force(idtab); return; } /* mark that index table is full */ id = idtab->id_limit; } idtab->id_next = id; /* no need to move idtab->hole_{start,end} */ } void gfarm_id_adjust_next(struct gfarm_id_table *idtab) { gfarm_int32_t id = idtab->id_next; int i; if (id >= idtab->id_limit) { gfarm_id_rewind(idtab); return; } if (idtab->hole_end >= idtab->idxsize || id < idtab->index[idtab->hole_end].id) return; /* idtab->id_next is ok, no need to adjust */ i = idtab->hole_end; #if 0 assert(idtab->index[i].id == id && idtab->index[i].data != NULL); #endif ++id; ++i; while (i < idtab->idxsize) { if (idtab->index[i].id > id || idtab->index[i].data == NULL) break; ++id; ++i; } if (id >= idtab->id_limit) { gfarm_id_rewind(idtab); return; } idtab->id_next = id; i -= idtab->hole_end; memmove(&idtab->index[idtab->hole_start], &idtab->index[idtab->hole_end], i * sizeof(struct gfarm_id_index)); idtab->hole_start += i; idtab->hole_end += i; gfarm_id_shrink_head(idtab); gfarm_id_shrink_tail(idtab); } void * gfarm_id_alloc(struct gfarm_id_table *idtab, gfarm_int32_t *idp) { struct gfarm_id_index *entry; if (idtab->id_next >= idtab->id_limit) { /* previous gfarm_id_rewind(idtab) failed, try again */ gfarm_id_rewind(idtab); if (idtab->id_next >= idtab->id_limit) { gflog_debug(GFARM_MSG_1002407, "gfarm_id_alloc: no more id space %d/%d", idtab->id_next, idtab->id_limit); return (NULL); /* no more id space */ } } if (idtab->hole_start >= idtab->hole_end && !gfarm_id_compaction_from_head(idtab) && !gfarm_id_compaction_from_tail(idtab)) { /* no space left for the new entry */ struct gfarm_id_index *newidx; struct gfarm_id_data_chunk *data; char *p; int i; /* assert(idtab->hole_start == idtab->hole_end); */ data = malloc(ALIGN_CEIL(sizeof(struct gfarm_id_data_chunk)) + idtab->idx_delta * idtab->entry_size); if (data == NULL) { gflog_debug(GFARM_MSG_1002408, "gfarm_id_alloc: no memory for %d * %d", idtab->idx_delta, (int)idtab->entry_size); return (NULL); } newidx = realloc(idtab->index, (idtab->idxsize + idtab->idx_delta) * sizeof(struct gfarm_id_index)); if (newidx == NULL) { free(data); gflog_debug(GFARM_MSG_1002409, "gfarm_id_alloc: no memory for (%d + %d) * %d", idtab->idxsize, idtab->idx_delta, (int)sizeof(struct gfarm_id_index)); return (NULL); /* no more memory */ } /* link to idtab->chunk */ data->next = idtab->chunks; idtab->chunks = data; /* link to idtab->free_data */ p = (char *)data + ALIGN_CEIL(sizeof(struct gfarm_id_data_chunk)); for (i = 1; i < idtab->idx_delta; i++) { ((struct gfarm_id_free_data *)p)->next = (struct gfarm_id_free_data *)(p + idtab->entry_size); p += idtab->entry_size; } ((struct gfarm_id_free_data *)p)->next = idtab->free_data; idtab->free_data = (struct gfarm_id_free_data *)((char *)data + ALIGN_CEIL(sizeof(struct gfarm_id_data_chunk))); /* reconstruct idtab->index */ memmove(&newidx[idtab->hole_end + idtab->idx_delta], &newidx[idtab->hole_end], (idtab->idxsize - idtab->hole_end) * sizeof(struct gfarm_id_index)); idtab->index = newidx; idtab->hole_end += idtab->idx_delta; /* make idtab->idx_delta big enough */ idtab->idxsize += idtab->idx_delta; if ((idtab->idxsize >> DELTA_SHIFT) > idtab->idx_delta) { idtab->idx_delta = idtab->idxsize >> DELTA_SHIFT; } } entry = idtab->index + idtab->hole_start++; entry->id = idtab->id_next++; entry->data = idtab->free_data; idtab->free_data = idtab->free_data->next; gfarm_id_adjust_next(idtab); *idp = entry->id; return (entry->data); } void * gfarm_id_lookup(struct gfarm_id_table *idtab, gfarm_int32_t id) { struct gfarm_id_index *entry; entry = gfarm_id_bsearch(idtab, 0, idtab->hole_start, id); if (entry != NULL) return (entry->data); entry = gfarm_id_bsearch(idtab, idtab->hole_end, idtab->idxsize, id); if (entry != NULL) return (entry->data); return (NULL); } int gfarm_id_free(struct gfarm_id_table *idtab, gfarm_int32_t id) { struct gfarm_id_index *entry; struct gfarm_id_free_data *data; entry = gfarm_id_bsearch(idtab, 0, idtab->hole_start, id); if (entry != NULL) { data = entry->data; if (data == NULL) return (0); /* the data already freed */ entry->data = NULL; ++idtab->head_free; data->next = idtab->free_data; idtab->free_data = data; if (entry < &idtab->index[idtab->hole_start - 1]) return (1); /* end of head, shrink head from the end edge */ --idtab->hole_start; --idtab->head_free; gfarm_id_shrink_head(idtab); return (1); } entry = gfarm_id_bsearch(idtab, idtab->hole_end, idtab->idxsize, id); if (entry != NULL) { data = entry->data; if (data == NULL) return (0); /* the data already freed */ entry->data = NULL; ++idtab->tail_free; data->next = idtab->free_data; idtab->free_data = data; if (entry > &idtab->index[idtab->hole_end]) return (1); /* beginning of tail, shrink tail from the beginning edge */ ++idtab->hole_end; --idtab->tail_free; gfarm_id_shrink_tail(idtab); return (1); } return (0); /* the data not found */ } #ifdef TEST #include main() { int len; char buffer[1024], command[sizeof(buffer)]; struct gfarm_id_table *id_table = NULL; struct gfarm_id_table_entry_ops ops = { 256 }; gfarm_int32_t n; void *p; while (fgets(buffer, sizeof(buffer), stdin) != NULL) { len = strlen(buffer); if (len > 0 && buffer[len - 1] == '\n') buffer[len - 1] = '\0'; if (sscanf(buffer, "%s", command) != 1) continue; if (strcmp(command, "table_alloc") == 0) { if (id_table != NULL) { fprintf(stderr, "table already alloced\n"); } else { id_table = gfarm_id_table_alloc(&ops); if (id_table == NULL) fprintf(stderr, "table alloc failed\n"); } } else if (strcmp(command, "table_free") == 0) { gfarm_id_table_free(id_table); } else if (strcmp(command, "base") == 0) { if (sscanf(buffer, "%*s %d", &n) != 1) { fprintf(stderr, "Usage: base \n"); } else { gfarm_id_table_set_base(id_table, n); } } else if (strcmp(command, "limit") == 0) { if (sscanf(buffer, "%*s %d", &n) != 1) { fprintf(stderr, "Usage: limit \n"); } else { gfarm_id_table_set_limit(id_table, n); } } else if (strcmp(command, "alloc") == 0) { if ((p = gfarm_id_alloc(id_table, &n)) == NULL) fprintf(stderr, "alloc failed\n"); else printf("alloced id=%d, p=%p\n", n, p); } else if (strcmp(command, "lookup") == 0) { if (sscanf(buffer, "%*s %d", &n) != 1) { fprintf(stderr, "Usage: lookup \n"); } else if ((p = gfarm_id_lookup(id_table, n)) == NULL){ fprintf(stderr, "lookup %d failed\n", n); } else { printf("found id=%d, p=%p\n", n, p); } } else if (strcmp(command, "free") == 0) { if (sscanf(buffer, "%*s %d", &n) != 1) { fprintf(stderr, "Usage: free \n"); } else if (!gfarm_id_free(id_table, n)){ fprintf(stderr, "free %d failed\n", n); } else { printf("freed id=%d\n", n); } } else { fprintf(stderr, "Unknown command %s\n", command); } } } #endif gfarm-2.4.1/lib/libgfarm/gfarm/0000755000000000000000000000000011507222730014734 5ustar rootrootgfarm-2.4.1/lib/libgfarm/gfarm/gfs_symlink.c0000644000000000000000000000234711507222724017436 0ustar rootroot#include #include #define GFARM_INTERNAL_USE #include #include "gfutil.h" #include "gfm_client.h" #include "config.h" #include "lookup.h" struct gfm_symlink_closure { /* input */ const char *src; }; static gfarm_error_t gfm_symlink_request(struct gfm_connection *gfm_server, void *closure, const char *base) { struct gfm_symlink_closure *c = closure; gfarm_error_t e; if ((e = gfm_client_symlink_request(gfm_server, c->src, base)) != GFARM_ERR_NO_ERROR) { gflog_warning(GFARM_MSG_1000155, "symlink(%s, %s) request: %s", c->src, base, gfarm_error_string(e)); } return (e); } static gfarm_error_t gfm_symlink_result(struct gfm_connection *gfm_server, void *closure) { gfarm_error_t e; if ((e = gfm_client_symlink_result(gfm_server)) != GFARM_ERR_NO_ERROR) { #if 0 /* DEBUG */ gflog_debug(GFARM_MSG_1000156, "symlink result: %s", gfarm_error_string(e)); #endif } return (e); } gfarm_error_t gfs_symlink(const char *src, const char *path) { struct gfm_symlink_closure closure; closure.src = src; return (gfm_name_op(path, GFARM_ERR_OPERATION_NOT_PERMITTED, gfm_symlink_request, gfm_symlink_result, gfm_name_success_op_connection_free, &closure)); } gfarm-2.4.1/lib/libgfarm/gfarm/config.h0000644000000000000000000000665311507222723016366 0ustar rootrootextern char *gfarm_config_file; /* gfsd dependent */ /* GFS dependent */ extern char *gfarm_spool_server_listen_address; extern char *gfarm_spool_root; enum gfarm_backend_db_type { GFARM_BACKEND_DB_TYPE_UNKNOWN, GFARM_BACKEND_DB_TYPE_LDAP, GFARM_BACKEND_DB_TYPE_POSTGRESQL, GFARM_BACKEND_DB_TYPE_LOCALFS }; extern enum gfarm_backend_db_type gfarm_backend_db_type; /* GFM dependent */ extern int gfarm_gfmd_connection_cache; /* XXX FIXME these should disappear to support multiple metadata server */ extern char *gfarm_metadb_server_name; extern int gfarm_metadb_server_port; extern char *gfarm_metadb_admin_user; extern char *gfarm_metadb_admin_user_gsi_dn; extern int gfarm_metadb_stack_size; extern int gfarm_metadb_thread_pool_size; extern int gfarm_metadb_job_queue_length; extern int gfarm_metadb_heartbeat_interval; extern int gfarm_metadb_dbq_size; #define GFARM_METADB_STACK_SIZE_DEFAULT 0 /* use OS default */ #define GFARM_METADB_THREAD_POOL_SIZE_DEFAULT 16 /* quadcore, quadsocket */ #if 0 #define GFARM_METADB_JOB_QUEUE_LENGTH_DEFAULT 160 /* THREAD_POOL * 10 */ #else /* XXX FIXME: until bcworkq is implemented */ #define GFARM_METADB_JOB_QUEUE_LENGTH_DEFAULT 16000 #endif #define GFARM_METADB_HEARTBEAT_INTERVAL_DEFAULT 180 /* 3 min */ #define GFARM_METADB_DBQ_SIZE_DEFAULT 65536 /* LDAP dependent */ extern char *gfarm_ldap_server_name; extern char *gfarm_ldap_server_port; extern char *gfarm_ldap_base_dn; extern char *gfarm_ldap_bind_dn; extern char *gfarm_ldap_bind_password; extern char *gfarm_ldap_tls; extern char *gfarm_ldap_tls_cipher_suite; extern char *gfarm_ldap_tls_certificate_key_file; extern char *gfarm_ldap_tls_certificate_file; /* PostgreSQL dependent */ extern char *gfarm_postgresql_server_name; extern char *gfarm_postgresql_server_port; extern char *gfarm_postgresql_dbname; extern char *gfarm_postgresql_user; extern char *gfarm_postgresql_password; extern char *gfarm_postgresql_conninfo; /* LocalFS dependent */ extern char *gfarm_localfs_datadir; /* miscellaneous configurations */ extern int gfarm_log_level; /* syslog priority level to log */ extern int gfarm_no_file_system_node_timeout; extern int gfarm_gfmd_reconnection_timeout; extern int gfarm_attr_cache_limit; extern int gfarm_attr_cache_timeout; extern int gfarm_schedule_cache_timeout; extern float gfarm_schedule_idle_load; extern float gfarm_schedule_busy_load; extern float gfarm_schedule_virtual_load; extern int gfarm_simultaneous_replication_receivers; extern int gfarm_gfsd_connection_cache; extern int gfarm_record_atime; extern int gf_on_demand_replication; extern int gf_hook_default_global; int gfarm_schedule_write_local_priority(void); char *gfarm_schedule_write_target_domain(void); gfarm_off_t gfarm_get_minimum_free_disk_space(void); /* redirection */ extern struct gfs_file *gf_stdout, *gf_stderr; /* miscellaneous */ extern int gfarm_schedule_cache_timeout; extern gfarm_int64_t gfarm_minimum_free_disk_space; void gfarm_config_clear(void); #ifdef GFARM_USE_STDIO gfarm_error_t gfarm_config_read_file(FILE *, int *); #endif gfarm_error_t gfarm_init_config_stringlists(void); gfarm_error_t gfarm_free_config_stringlists(void); void gfarm_config_set_default_ports(void); void gfarm_config_set_default_misc(void); int gfarm_xattr_caching_patterns_number(void); char **gfarm_xattr_caching_patterns(void); /* for client */ struct gfs_connection; struct gfm_connection; gfarm_error_t gfarm_client_process_set(struct gfs_connection *, struct gfm_connection *); gfarm-2.4.1/lib/libgfarm/gfarm/gfs_xattr.c0000644000000000000000000004217211507222723017111 0ustar rootroot/* * Copyright (c) 2009 National Institute of Informatics in Japan. * All rights reserved. */ #include /* config.h needs FILE */ #include #include #include #define GFARM_INTERNAL_USE #include #include "gfutil.h" #include "timer.h" #include "gfm_client.h" #include "lookup.h" #include "gfs_io.h" #include "gfs_misc.h" #include "config.h" #include "gfs_profile.h" #include "xattr_info.h" static double gfs_xattr_time = 0.0; struct gfm_setxattr0_closure { int xmlMode; const char *name; const void *value; size_t size; int flags; }; static gfarm_error_t gfm_setxattr0_request(struct gfm_connection *gfm_server, void *closure) { struct gfm_setxattr0_closure *c = closure; gfarm_error_t e = gfm_client_setxattr_request(gfm_server, c->xmlMode, c->name, c->value, c->size, c->flags); if (e != GFARM_ERR_NO_ERROR) gflog_warning(GFARM_MSG_1000160, "setxattr request: %s", gfarm_error_string(e)); return (e); } static gfarm_error_t gfm_setxattr0_result(struct gfm_connection *gfm_server, void *closure) { gfarm_error_t e = gfm_client_setxattr_result(gfm_server); #if 1 /* DEBUG */ if (e != GFARM_ERR_NO_ERROR) gflog_debug(GFARM_MSG_1000161, "setxattr result: %s", gfarm_error_string(e)); #endif return (e); } static gfarm_error_t gfs_setxattr0(int xmlMode, const char *path, const char *name, const void *value, size_t size, int flags) { gfarm_timerval_t t1, t2; struct gfm_setxattr0_closure closure; gfarm_error_t e; GFARM_TIMEVAL_FIX_INITIALIZE_WARNING(t1); gfs_profile(gfarm_gettimerval(&t1)); closure.xmlMode = xmlMode; closure.name = name; closure.value = value; closure.size = size; closure.flags = flags; e = gfm_inode_op(path, GFARM_FILE_LOOKUP, gfm_setxattr0_request, gfm_setxattr0_result, gfm_inode_success_op_connection_free, NULL, &closure); gfs_profile(gfarm_gettimerval(&t2)); gfs_profile(gfs_xattr_time += gfarm_timerval_sub(&t2, &t1)); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001398, "gfm_inode_op(%s) failed: %s", path, gfarm_error_string(e)); } return (e); } gfarm_error_t gfs_setxattr(const char *path, const char *name, const void *value, size_t size, int flags) { return gfs_setxattr0(0, path, name, value, size, flags); } gfarm_error_t gfs_setxmlattr(const char *path, const char *name, const void *value, size_t size, int flags) { return gfs_setxattr0(1, path, name, value, size, flags); } gfarm_error_t gfs_fsetxattr(GFS_File gf, const char *name, const void *value, size_t size, int flags) { gfarm_timerval_t t1, t2; struct gfm_setxattr0_closure closure; gfarm_error_t e; GFARM_TIMEVAL_FIX_INITIALIZE_WARNING(t1); gfs_profile(gfarm_gettimerval(&t1)); closure.xmlMode = 0; closure.name = name; closure.value = value; closure.size = size; closure.flags = flags; e = gfm_client_compound_fd_op(gfs_pio_metadb(gf), gfs_pio_fileno(gf), gfm_setxattr0_request, gfm_setxattr0_result, NULL, &closure); gfs_profile(gfarm_gettimerval(&t2)); gfs_profile(gfs_xattr_time += gfarm_timerval_sub(&t2, &t1)); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001399, "gfm_client_compound_fd_op() failed: %s", gfarm_error_string(e)); } return (e); } struct gfm_getxattr_proccall_closure { int xmlMode; const char *name; void **valuep; size_t *sizep; }; static gfarm_error_t gfm_getxattr_proccall_request(struct gfm_connection *gfm_server, void *closure) { struct gfm_getxattr_proccall_closure *c = closure; gfarm_error_t e = gfm_client_getxattr_request(gfm_server, c->xmlMode, c->name); if (e != GFARM_ERR_NO_ERROR) gflog_warning(GFARM_MSG_1000162, "getxattr request: %s", gfarm_error_string(e)); return (e); } static gfarm_error_t gfm_getxattr_proccall_result(struct gfm_connection *gfm_server, void *closure) { struct gfm_getxattr_proccall_closure *c = closure; gfarm_error_t e = gfm_client_getxattr_result(gfm_server, c->xmlMode, c->valuep, c->sizep); #if 1 /* DEBUG */ if (e != GFARM_ERR_NO_ERROR) gflog_debug(GFARM_MSG_1000163, "getxattr result: %s", gfarm_error_string(e)); #endif return (e); } static gfarm_error_t gfs_getxattr_proccall(int xmlMode, const char *path, const char *name, void **valuep, size_t *sizep) { gfarm_timerval_t t1, t2; struct gfm_getxattr_proccall_closure closure; gfarm_error_t e; GFARM_TIMEVAL_FIX_INITIALIZE_WARNING(t1); gfs_profile(gfarm_gettimerval(&t1)); closure.xmlMode = xmlMode; closure.name = name; closure.valuep = valuep; closure.sizep = sizep; e = gfm_inode_op(path, GFARM_FILE_LOOKUP, gfm_getxattr_proccall_request, gfm_getxattr_proccall_result, gfm_inode_success_op_connection_free, NULL, &closure); gfs_profile(gfarm_gettimerval(&t2)); gfs_profile(gfs_xattr_time += gfarm_timerval_sub(&t2, &t1)); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001400, "gfm_inode_op(%s) failed: %s", path, gfarm_error_string(e)); } return (e); } static gfarm_error_t gfs_fgetxattr_proccall(int xmlMode, GFS_File gf, const char *name, void **valuep, size_t *sizep) { gfarm_timerval_t t1, t2; struct gfm_getxattr_proccall_closure closure; gfarm_error_t e; GFARM_TIMEVAL_FIX_INITIALIZE_WARNING(t1); gfs_profile(gfarm_gettimerval(&t1)); closure.xmlMode = xmlMode; closure.name = name; closure.valuep = valuep; closure.sizep = sizep; e = gfm_client_compound_fd_op(gfs_pio_metadb(gf), gfs_pio_fileno(gf), gfm_getxattr_proccall_request, gfm_getxattr_proccall_result, NULL, &closure); gfs_profile(gfarm_gettimerval(&t2)); gfs_profile(gfs_xattr_time += gfarm_timerval_sub(&t2, &t1)); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001401, "gfm_client_compound_fd_op() failed: %s", gfarm_error_string(e)); } return (e); } static gfarm_error_t gfs_getxattr0(int xmlMode, const char *path, GFS_File gf, const char *name, void *value, size_t *size) { gfarm_error_t e; void *v; size_t s; if (path != NULL) e = gfs_getxattr_proccall(xmlMode, path, name, &v, &s); else e = gfs_fgetxattr_proccall(xmlMode, gf, name, &v, &s); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001402, "getxattr/fgetxattr_proccall() failed: %s", gfarm_error_string(e)); return e; } if (*size >= s) memcpy(value, v, s); else if (*size != 0) { gflog_debug(GFARM_MSG_1001403, "Result out of range (%llu) < (%llu): %s", (unsigned long long)*size, (unsigned long long)s, gfarm_error_string(GFARM_ERR_RESULT_OUT_OF_RANGE)); e = GFARM_ERR_RESULT_OUT_OF_RANGE; } *size = s; free(v); return e; } gfarm_error_t gfs_getxattr(const char *path, const char *name, void *value, size_t *size) { return gfs_getxattr0(0, path, NULL, name, value, size); } gfarm_error_t gfs_getxmlattr(const char *path, const char *name, void *value, size_t *size) { return gfs_getxattr0(1, path, NULL, name, value, size); } gfarm_error_t gfs_fgetxattr(GFS_File gf, const char *name, void *value, size_t *size) { return gfs_getxattr0(0, NULL, gf, name, value, size); } struct gfm_listxattr_proccall_closure { int xmlMode; char **listp; size_t *sizep; }; static gfarm_error_t gfm_listxattr_proccall_request(struct gfm_connection *gfm_server, void *closure) { struct gfm_listxattr_proccall_closure *c = closure; gfarm_error_t e = gfm_client_listxattr_request(gfm_server, c->xmlMode); if (e != GFARM_ERR_NO_ERROR) gflog_warning(GFARM_MSG_1000164, "listxattr request: %s", gfarm_error_string(e)); return (e); } static gfarm_error_t gfm_listxattr_proccall_result(struct gfm_connection *gfm_server, void *closure) { struct gfm_listxattr_proccall_closure *c = closure; gfarm_error_t e = gfm_client_listxattr_result(gfm_server, c->listp, c->sizep); #if 1 /* DEBUG */ if (e != GFARM_ERR_NO_ERROR) gflog_debug(GFARM_MSG_1000165, "listxattr result: %s", gfarm_error_string(e)); #endif return (e); } static gfarm_error_t gfs_listxattr_proccall(int xmlMode, const char *path, char **listp, size_t *sizep) { gfarm_timerval_t t1, t2; struct gfm_listxattr_proccall_closure closure; gfarm_error_t e; GFARM_TIMEVAL_FIX_INITIALIZE_WARNING(t1); gfs_profile(gfarm_gettimerval(&t1)); closure.xmlMode = xmlMode; closure.listp = listp; closure.sizep = sizep; e = gfm_inode_op(path, GFARM_FILE_LOOKUP, gfm_listxattr_proccall_request, gfm_listxattr_proccall_result, gfm_inode_success_op_connection_free, NULL, &closure); gfs_profile(gfarm_gettimerval(&t2)); gfs_profile(gfs_xattr_time += gfarm_timerval_sub(&t2, &t1)); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001404, "gfm_inode_op(%s) failed: %s", path, gfarm_error_string(e)); } return (e); } static gfarm_error_t gfs_listxattr0(int xmlMode, const char *path, char *list, size_t *size) { gfarm_error_t e; char *l; size_t s; e = gfs_listxattr_proccall(xmlMode, path, &l, &s); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001405, "gfs_listxattr_proccall(%s) failed: %s", path, gfarm_error_string(e)); return e; } if (*size >= s) memcpy(list, l, s); else if (*size != 0) { gflog_debug(GFARM_MSG_1001406, "Result out of range (%llu) < (%llu): %s", (unsigned long long)*size, (unsigned long long)s, gfarm_error_string(GFARM_ERR_RESULT_OUT_OF_RANGE)); e = GFARM_ERR_RESULT_OUT_OF_RANGE; } *size = s; free(l); return e; } gfarm_error_t gfs_listxattr(const char *path, char *list, size_t *size) { return gfs_listxattr0(0, path, list, size); } gfarm_error_t gfs_listxmlattr(const char *path, char *list, size_t *size) { return gfs_listxattr0(1, path, list, size); } struct gfm_removexattr0_closure { int xmlMode; const char *name; }; static gfarm_error_t gfm_removexattr0_request(struct gfm_connection *gfm_server, void *closure) { struct gfm_removexattr0_closure *c = closure; gfarm_error_t e = gfm_client_removexattr_request(gfm_server, c->xmlMode, c->name); if (e != GFARM_ERR_NO_ERROR) gflog_warning(GFARM_MSG_1000166, "removexattr request: %s", gfarm_error_string(e)); return (e); } static gfarm_error_t gfm_removexattr0_result(struct gfm_connection *gfm_server, void *closure) { gfarm_error_t e = gfm_client_removexattr_result(gfm_server); #if 1 /* DEBUG */ if (e != GFARM_ERR_NO_ERROR) gflog_debug(GFARM_MSG_1000167, "removexattr result: %s", gfarm_error_string(e)); #endif return (e); } static gfarm_error_t gfs_removexattr0(int xmlMode, const char *path, const char *name) { gfarm_timerval_t t1, t2; struct gfm_removexattr0_closure closure; gfarm_error_t e; GFARM_TIMEVAL_FIX_INITIALIZE_WARNING(t1); gfs_profile(gfarm_gettimerval(&t1)); closure.xmlMode = xmlMode; closure.name = name; e = gfm_inode_op(path, GFARM_FILE_LOOKUP, gfm_removexattr0_request, gfm_removexattr0_result, gfm_inode_success_op_connection_free, NULL, &closure); gfs_profile(gfarm_gettimerval(&t2)); gfs_profile(gfs_xattr_time += gfarm_timerval_sub(&t2, &t1)); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001407, "gfm_inode_op(%s) failed: %s", path, gfarm_error_string(e)); } return (e); } gfarm_error_t gfs_removexattr(const char *path, const char *name) { return gfs_removexattr0(0, path, name); } gfarm_error_t gfs_removexmlattr(const char *path, const char *name) { return gfs_removexattr0(1, path, name); } gfarm_error_t gfs_fremovexattr(GFS_File gf, const char *name) { gfarm_timerval_t t1, t2; struct gfm_removexattr0_closure closure; gfarm_error_t e; GFARM_TIMEVAL_FIX_INITIALIZE_WARNING(t1); gfs_profile(gfarm_gettimerval(&t1)); closure.xmlMode = 0; closure.name = name; e = gfm_client_compound_fd_op(gfs_pio_metadb(gf), gfs_pio_fileno(gf), gfm_removexattr0_request, gfm_removexattr0_result, NULL, &closure); gfs_profile(gfarm_gettimerval(&t2)); gfs_profile(gfs_xattr_time += gfarm_timerval_sub(&t2, &t1)); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001408, "gfm_client_compound_fd_op() failed: %s", gfarm_error_string(e)); } return (e); } #ifndef GFARM_DEFAULT_FINDXMLATTR_NENRTY #define GFARM_DEFAULT_FINDXMLATTR_NENRTY 100 #endif struct gfs_xmlattr_ctx * gfs_xmlattr_ctx_alloc(int nentry) { struct gfs_xmlattr_ctx *ctxp; size_t ctxsize; int overflow; char *p = NULL; overflow = 0; ctxsize = gfarm_size_add(&overflow, sizeof(*ctxp), gfarm_size_mul(&overflow, nentry, sizeof(*ctxp->entries))); if (!overflow) p = calloc(1, ctxsize); if (p != NULL) { ctxp = (struct gfs_xmlattr_ctx *)p; ctxp->nalloc = nentry; ctxp->entries = (struct gfs_foundxattr_entry *)(ctxp + 1); return ctxp; } else return NULL; } static void gfs_xmlattr_ctx_free_entries(struct gfs_xmlattr_ctx *ctxp, int freepath) { int i; for (i = 0; i < ctxp->nvalid; i++) { if (freepath) { free(ctxp->entries[i].path); free(ctxp->entries[i].attrname); } ctxp->entries[i].path = NULL; ctxp->entries[i].attrname = NULL; } ctxp->index = 0; ctxp->nvalid = 0; } void gfs_xmlattr_ctx_free(struct gfs_xmlattr_ctx *ctxp, int freepath) { if (ctxp != NULL) { gfs_xmlattr_ctx_free_entries(ctxp, freepath); free(ctxp->path); free(ctxp->expr); free(ctxp->cookie_path); free(ctxp->cookie_attrname); free(ctxp->workpath); free(ctxp); } } gfarm_error_t gfs_findxmlattr(const char *path, const char *expr, int depth, struct gfs_xmlattr_ctx **ctxpp) { gfarm_error_t e; gfarm_timerval_t t1, t2; struct gfs_xmlattr_ctx *ctxp; GFARM_TIMEVAL_FIX_INITIALIZE_WARNING(t1); gfs_profile(gfarm_gettimerval(&t1)); if ((ctxp = gfs_xmlattr_ctx_alloc(GFARM_DEFAULT_FINDXMLATTR_NENRTY)) == NULL) { e = GFARM_ERR_NO_MEMORY; gflog_debug(GFARM_MSG_1001409, "allococation of 'gfs_xmlattr_ctx' failed: %s", gfarm_error_string(GFARM_ERR_NO_MEMORY)); } else if ((e = gfm_open_fd(path, GFARM_FILE_RDONLY, &ctxp->gfm_server, &ctxp->fd, &ctxp->type)) != GFARM_ERR_NO_ERROR) { gfs_xmlattr_ctx_free(ctxp, 1); gflog_debug(GFARM_MSG_1001410, "gfm_open_fd(%s) failed: %s", path, gfarm_error_string(e)); } else { ctxp->path = strdup(path); ctxp->expr = strdup(expr); ctxp->depth = depth; *ctxpp = ctxp; } gfs_profile(gfarm_gettimerval(&t2)); gfs_profile(gfs_xattr_time += gfarm_timerval_sub(&t2, &t1)); return (e); } static gfarm_error_t gfm_findxmlattr_request(struct gfm_connection *gfm_server, void *closure) { struct gfs_xmlattr_ctx *ctxp = closure; gfarm_error_t e = gfm_client_findxmlattr_request(gfm_server, ctxp); if (e != GFARM_ERR_NO_ERROR) gflog_warning(GFARM_MSG_1000168, "find_xml_attr request: %s", gfarm_error_string(e)); return (e); } static gfarm_error_t gfm_findxmlattr_result(struct gfm_connection *gfm_server, void *closure) { struct gfs_xmlattr_ctx *ctxp = closure; gfarm_error_t e = gfm_client_findxmlattr_result(gfm_server, ctxp); #if 1 /* DEBUG */ if (e != GFARM_ERR_NO_ERROR) gflog_debug(GFARM_MSG_1000169, "find_xml_attr result: %s", gfarm_error_string(e)); #endif return (e); } static gfarm_error_t gfs_findxmlattr_get(struct gfs_xmlattr_ctx *ctxp) { return (gfm_client_compound_fd_op(ctxp->gfm_server, ctxp->fd, gfm_findxmlattr_request, gfm_findxmlattr_result, NULL, ctxp)); } gfarm_error_t gfs_getxmlent(struct gfs_xmlattr_ctx *ctxp, char **fpathp, char **namep) { gfarm_error_t e = GFARM_ERR_NO_ERROR; gfarm_timerval_t t1, t2; char *fpath, *p; int pathlen, overflow; size_t allocsz; *fpathp = NULL; *namep = NULL; GFARM_TIMEVAL_FIX_INITIALIZE_WARNING(t1); gfs_profile(gfarm_gettimerval(&t1)); if ((ctxp->eof == 0) && (ctxp->index >= ctxp->nvalid)) { gfs_xmlattr_ctx_free_entries(ctxp, 1); e = gfs_findxmlattr_get(ctxp); } if (e == GFARM_ERR_NO_ERROR) { if (ctxp->index < ctxp->nvalid) { fpath = ctxp->entries[ctxp->index].path; pathlen = strlen(ctxp->path); overflow = 0; allocsz = gfarm_size_add(&overflow, gfarm_size_add(&overflow, pathlen, strlen(fpath)), 2); if (!overflow) p = realloc(ctxp->workpath, allocsz); if (!overflow && (p != NULL)) { ctxp->workpath = p; if (ctxp->path[pathlen-1] == '/') sprintf(ctxp->workpath, "%s%s", ctxp->path, fpath); else sprintf(ctxp->workpath, "%s/%s", ctxp->path, fpath); pathlen = strlen(ctxp->workpath); if ((pathlen > 1) && (ctxp->workpath[pathlen-1] == '/')) ctxp->workpath[pathlen-1] = '\0'; *fpathp = ctxp->workpath; *namep = ctxp->entries[ctxp->index].attrname; ctxp->index++; } else e = GFARM_ERR_NO_MEMORY; } } gfs_profile(gfarm_gettimerval(&t2)); gfs_profile(gfs_xattr_time += gfarm_timerval_sub(&t2, &t1)); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001411, "error occurred during process: %s", gfarm_error_string(e)); } return e; } gfarm_error_t gfs_closexmlattr(struct gfs_xmlattr_ctx *ctxp) { gfarm_error_t e; gfarm_timerval_t t1, t2; GFARM_TIMEVAL_FIX_INITIALIZE_WARNING(t1); gfs_profile(gfarm_gettimerval(&t1)); if (ctxp != NULL) { e = gfm_close_fd(ctxp->gfm_server, ctxp->fd); gfm_client_connection_free(ctxp->gfm_server); gfs_xmlattr_ctx_free(ctxp, 1); } else { e = GFARM_ERR_NO_ERROR; } gfs_profile(gfarm_gettimerval(&t2)); gfs_profile(gfs_xattr_time += gfarm_timerval_sub(&t2, &t1)); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001412, "gfm_close_fd() failed: %s", gfarm_error_string(e)); } return (e); } void gfs_xattr_display_timers(void) { gflog_info(GFARM_MSG_1000170, "gfs_xattr : %g sec", gfs_xattr_time); } gfarm-2.4.1/lib/libgfarm/gfarm/gfs_util.c0000644000000000000000000000034311507222724016717 0ustar rootroot#include #include int gfs_mode_to_type(gfarm_mode_t mode) { return (GFARM_S_ISDIR(mode) ? GFS_DT_DIR : GFARM_S_ISREG(mode) ? GFS_DT_REG : GFARM_S_ISLNK(mode) ? GFS_DT_LNK : GFS_DT_UNKNOWN); } gfarm-2.4.1/lib/libgfarm/gfarm/metadb_common.h0000644000000000000000000000101611507222723017711 0ustar rootrootstruct gfarm_base_generic_info_ops { size_t info_size; void (*free)(void *info); void (*clear)(void *info); int (*validate)(void *info); }; extern const struct gfarm_base_generic_info_ops gfarm_base_host_info_ops, gfarm_base_user_info_ops, gfarm_base_group_info_ops, gfarm_base_gfs_stat_ops, gfarm_base_xattr_info_ops, gfarm_base_quota_info_ops; void gfarm_base_generic_info_free_all(int, void *, const struct gfarm_base_generic_info_ops *); void gfarm_host_info_free_except_hostname(struct gfarm_host_info *); gfarm-2.4.1/lib/libgfarm/gfarm/gfm_schedule.h0000644000000000000000000000022111507222723017527 0ustar rootrootstruct gfarm_host_sched_info; gfarm_error_t gfm_schedule_file(struct gfm_connection *, gfarm_int32_t, int *, struct gfarm_host_sched_info **); gfarm-2.4.1/lib/libgfarm/gfarm/sockopt.c0000644000000000000000000001074211507222723016570 0ustar rootroot/* * $Id: sockopt.c 4457 2010-02-23 01:53:23Z ookuma $ */ #include #include #include #include #include /* TCP_NODELAY */ #include /* getprotobyname() */ #include #include #include #include #include #include #include "gfutil.h" #include "liberror.h" #include "hostspec.h" #include "param.h" #include "sockopt.h" struct gfarm_sockopt_info { char *proto; int level, option; }; struct gfarm_sockopt_info gfarm_sockopt_info_debug = { NULL, SOL_SOCKET, SO_DEBUG }; struct gfarm_sockopt_info gfarm_sockopt_info_keepalive = { NULL, SOL_SOCKET, SO_KEEPALIVE }; struct gfarm_sockopt_info gfarm_sockopt_info_sndbuf = { NULL, SOL_SOCKET, SO_SNDBUF }; struct gfarm_sockopt_info gfarm_sockopt_info_rcvbuf = { NULL, SOL_SOCKET, SO_RCVBUF }; struct gfarm_sockopt_info gfarm_sockopt_info_tcp_nodelay = { "tcp", 0, TCP_NODELAY }; struct gfarm_param_type gfarm_sockopt_type_table[] = { { "debug", 1, &gfarm_sockopt_info_debug }, { "keepalive", 1, &gfarm_sockopt_info_keepalive }, { "sndbuf", 0, &gfarm_sockopt_info_sndbuf }, { "rcvbuf", 0, &gfarm_sockopt_info_rcvbuf }, { "tcp_nodelay", 1, &gfarm_sockopt_info_tcp_nodelay }, }; #define NSOCKOPTS GFARM_ARRAY_LENGTH(gfarm_sockopt_type_table) struct gfarm_param_config *gfarm_sockopt_config_list = NULL; struct gfarm_param_config **gfarm_sockopt_config_last = &gfarm_sockopt_config_list; struct gfarm_param_config *gfarm_sockopt_listener_config_list = NULL; struct gfarm_param_config **gfarm_sockopt_listener_config_last = &gfarm_sockopt_listener_config_list; static void sockopt_initialize(void) { int i; struct gfarm_param_type *type; struct gfarm_sockopt_info *info; struct protoent *proto; for (i = 0; i < NSOCKOPTS; i++) { type = &gfarm_sockopt_type_table[i]; info = type->extension; if (info->proto != NULL) { proto = getprotobyname(info->proto); if (proto == NULL) gflog_fatal(GFARM_MSG_1000008, "getprotobyname(%s) failed", info->proto); info->level = proto->p_proto; } } } gfarm_error_t gfarm_sockopt_initialize(void) { static pthread_once_t initialized = PTHREAD_ONCE_INIT; pthread_once(&initialized, sockopt_initialize); return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfarm_sockopt_config_add_internal(struct gfarm_param_config ***lastp, char *config, struct gfarm_hostspec *hsp) { gfarm_error_t e; int param_type_index; long value; e = gfarm_sockopt_initialize(); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1000899, "Initialization of socket option failed: %s", gfarm_error_string(e)); return (e); } e = gfarm_param_config_parse_long(NSOCKOPTS, gfarm_sockopt_type_table, config, ¶m_type_index, &value); if (e == GFARM_ERR_NO_SUCH_OBJECT) { gflog_debug(GFARM_MSG_1000900, "Unknown socket option (%s)", config); return (GFARM_ERRMSG_UNKNOWN_SOCKET_OPTION); } if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1000901, "gfarm_param_config_parse_long(%s) failed: %s", config, gfarm_error_string(e)); return (e); } return (gfarm_param_config_add_long(lastp, param_type_index, value, hsp)); } gfarm_error_t gfarm_sockopt_config_add(char *option, struct gfarm_hostspec *hsp) { return (gfarm_sockopt_config_add_internal( &gfarm_sockopt_config_last, option, hsp)); } gfarm_error_t gfarm_sockopt_listener_config_add(char *option) { return (gfarm_sockopt_config_add_internal( &gfarm_sockopt_listener_config_last, option, NULL)); } static gfarm_error_t gfarm_sockopt_set(void *closure, int param_type_index, long value) { int fd = *(int *)closure, v = value; struct gfarm_param_type *type = &gfarm_sockopt_type_table[param_type_index]; struct gfarm_sockopt_info *info = type->extension; if (setsockopt(fd, info->level, info->option, &v, sizeof(v)) == -1) { int save_errno = errno; gflog_debug(GFARM_MSG_1000902, "setsocketopt(%d) to (%ld) failed: %s", param_type_index, value, strerror(save_errno)); return (gfarm_errno_to_error(save_errno)); } return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfarm_sockopt_apply_by_name_addr(int fd, const char *name, struct sockaddr *addr) { return (gfarm_param_apply_long_by_name_addr(gfarm_sockopt_config_list, name, addr, gfarm_sockopt_set, &fd)); } gfarm_error_t gfarm_sockopt_apply_listener(int fd) { return (gfarm_param_apply_long(gfarm_sockopt_listener_config_list, gfarm_sockopt_set, &fd)); } gfarm-2.4.1/lib/libgfarm/gfarm/humanize_number.c0000644000000000000000000000123611507222723020274 0ustar rootroot#include #include size_t gfarm_humanize_number(char *buf, size_t len, unsigned long long number, int flags) { unsigned int divisor = (flags & GFARM_HUMANIZE_BINARY) ? 1024 : 1000; double n = number; unsigned long long i = number; int scale = 0; static unsigned char units[] = { '\0', 'K', 'M', 'G', 'T', 'P', 'E' }; while (n >= 999.5 && scale < GFARM_ARRAY_LENGTH(units)) { n /= divisor; i /= divisor; scale++; } if (scale == 0) return (snprintf(buf, len, "%llu", number)); if (n < 99.5 && n != i) return (snprintf(buf, len, "%.1f%c", n, units[scale])); else return (snprintf(buf, len, "%.0f%c", n, units[scale])); } gfarm-2.4.1/lib/libgfarm/gfarm/gfs_statsw.c0000644000000000000000000000245411507222723017273 0ustar rootroot#include #include #include "gfs_dircache.h" struct gfs_statsw { gfarm_error_t (*opendir)(const char *, GFS_Dir *); gfarm_error_t (*stat)(const char *, struct gfs_stat *); gfarm_error_t (*getxattr)(const char *path, const char *name, void *value, size_t *size); }; /* * for gfs_statsw_uncached */ static struct gfs_statsw gfs_statsw_uncached = { gfs_opendir, gfs_stat, gfs_getxattr, }; /* * for gfs_statsw_cached */ static struct gfs_statsw gfs_statsw_cached = { gfs_opendir_caching_internal, gfs_stat_cached_internal, gfs_getxattr_cached_internal, }; /* * for gfs_statsw */ static struct gfs_statsw *gfs_statsw = &gfs_statsw_cached; gfarm_error_t gfs_opendir_caching(const char *path, GFS_Dir *dirp) { return ((*gfs_statsw->opendir)(path, dirp)); } gfarm_error_t gfs_stat_cached(const char *path, struct gfs_stat *st) { return ((*gfs_statsw->stat)(path, st)); } gfarm_error_t gfs_lstat_cached(const char *path, struct gfs_stat *st) { return ((*gfs_statsw->stat)(path, st)); /* XXX FIXME */ } gfarm_error_t gfs_getxattr_cached(const char *path, const char *name, void *value, size_t *sizep) { return ((*gfs_statsw->getxattr)(path, name, value, sizep)); } void gfs_stat_cache_enable(int enable) { gfs_statsw = enable ? &gfs_statsw_cached : &gfs_statsw_uncached; } gfarm-2.4.1/lib/libgfarm/gfarm/auth_common_gsi.c0000644000000000000000000002006111507222723020254 0ustar rootroot#include #include #include #include #include #include #include #include #include #include "gfutil.h" #include "thrsubr.h" #include "gfarm_secure_session.h" #include "gfarm_auth.h" #include "liberror.h" #include "gfpath.h" #include "auth.h" #include "auth_gsi.h" static pthread_mutex_t gsi_initialize_mutex = PTHREAD_MUTEX_INITIALIZER; static int gsi_initialized; static int gsi_server_initialized; static const char gsi_initialize_diag[] = "gsi_initialize_mutex"; gfarm_error_t gfarm_gsi_client_initialize(void) { OM_uint32 e_major; OM_uint32 e_minor; int rv; static const char diag[] = "gfarm_gsi_client_initialize"; gfarm_mutex_lock(&gsi_initialize_mutex, diag, gsi_initialize_diag); if (gsi_initialized) { gfarm_mutex_unlock(&gsi_initialize_mutex, diag, gsi_initialize_diag); return (GFARM_ERR_NO_ERROR); } rv = gfarmSecSessionInitializeInitiator(NULL, GRID_MAPFILE, &e_major, &e_minor); if (rv <= 0) { if (gflog_auth_get_verbose()) { gflog_error(GFARM_MSG_1000706, "can't initialize as initiator because of:"); gfarmGssPrintMajorStatus(e_major); gfarmGssPrintMinorStatus(e_minor); } gfarmSecSessionFinalizeInitiator(); gfarm_mutex_unlock(&gsi_initialize_mutex, diag, gsi_initialize_diag); return (GFARM_ERRMSG_GSI_CREDENTIAL_INITIALIZATION_FAILED); } gsi_initialized = 1; gsi_server_initialized = 0; gfarm_mutex_unlock(&gsi_initialize_mutex, diag, gsi_initialize_diag); return (GFARM_ERR_NO_ERROR); } char * gfarm_gsi_client_cred_name(void) { gss_cred_id_t cred = gfarm_gsi_get_delegated_cred(); gss_name_t name; OM_uint32 e_major, e_minor; static pthread_mutex_t client_cred_initialize_mutex = PTHREAD_MUTEX_INITIALIZER; static int initialized = 0; static char *dn; static const char diag[] = "gfarm_gsi_client_cred_name"; static const char mutex_name[] = "client_cred_initialize_mutex"; gfarm_mutex_lock(&client_cred_initialize_mutex, diag, mutex_name); if (initialized) { gfarm_mutex_unlock(&client_cred_initialize_mutex, diag, mutex_name); return (dn); } if (cred == GSS_C_NO_CREDENTIAL && gfarmSecSessionGetInitiatorInitialCredential(&cred) < 0) { dn = NULL; gflog_auth_error(GFARM_MSG_1000707, "gfarm_gsi_client_cred_name(): " "not initialized as an initiator"); } else if (gfarmGssNewCredentialName(&name, cred, &e_major, &e_minor) < 0) { dn = NULL; if (gflog_auth_get_verbose()) { gflog_error(GFARM_MSG_1000708, "cannot convert initiator credential " "to name"); gfarmGssPrintMajorStatus(e_major); gfarmGssPrintMinorStatus(e_minor); } } else { dn = gfarmGssNewDisplayName(name, &e_major, &e_minor, NULL); if (dn == NULL && gflog_auth_get_verbose()) { gflog_error(GFARM_MSG_1000709, "cannot convert initiator credential " "to string"); gfarmGssPrintMajorStatus(e_major); gfarmGssPrintMinorStatus(e_minor); } gfarmGssDeleteName(&name, NULL, NULL); } initialized = 1; gfarm_mutex_unlock(&client_cred_initialize_mutex, diag, mutex_name); return (dn); } gfarm_error_t gfarm_gsi_server_initialize(void) { OM_uint32 e_major; OM_uint32 e_minor; int rv; static const char diag[] = "gfarm_gsi_server_initialize"; gfarm_mutex_lock(&gsi_initialize_mutex, diag, gsi_initialize_diag); if (gsi_initialized) { if (gsi_server_initialized) { gfarm_mutex_unlock(&gsi_initialize_mutex, diag, gsi_initialize_diag); return (GFARM_ERR_NO_ERROR); } gfarmSecSessionFinalizeInitiator(); gsi_initialized = 0; } rv = gfarmSecSessionInitializeBoth(NULL, NULL, GRID_MAPFILE, &e_major, &e_minor); if (rv <= 0) { if (gflog_auth_get_verbose()) { gflog_error(GFARM_MSG_1000710, "can't initialize GSI as both because of:"); gfarmGssPrintMajorStatus(e_major); gfarmGssPrintMinorStatus(e_minor); } gfarmSecSessionFinalizeBoth(); gfarm_mutex_unlock(&gsi_initialize_mutex, diag, gsi_initialize_diag); return (GFARM_ERRMSG_GSI_INITIALIZATION_FAILED); } gsi_initialized = 1; gsi_server_initialized = 1; gfarm_mutex_unlock(&gsi_initialize_mutex, diag, gsi_initialize_diag); return (GFARM_ERR_NO_ERROR); } /* * Delegated credential */ static gss_cred_id_t delegated_cred = GSS_C_NO_CREDENTIAL; void gfarm_gsi_set_delegated_cred(gss_cred_id_t cred) { delegated_cred = cred; } gss_cred_id_t gfarm_gsi_get_delegated_cred() { return (delegated_cred); } /* * converter from credential configuration to [GSSNameType, GSSName]. * * The results of * (type, service, name) -> gss_name_t [NameType, Name] -> gss_cred_id_t * are: * (DEFAULT, NULL, NULL) is not allowed. caller must check this at first. * (NO_NAME, NULL, NULL) -> GSS_C_NO_NAME * (MECHANISM_SPECIFIC, NULL, name) -> [GSS_C_NO_OID, name] * (HOST, service, host) ->[GSS_C_NT_HOSTBASED_SERVICE, service + "@" + host] * if (service == NULL) service = "host" * (USER, NULL, username) -> [GSS_C_NT_USER_NAME, username] * if (username == NULL) username = self_local_username * (SELF, NULL, NULL) -> the name of initial initiator credential * * when a server acquires a credential of itself: * (DEFAULT, NULL, NULL) -> N/A -> GSS_C_NO_CREDENTIAL * when a client authenticates a server: * (DEFAULT, NULL, NULL) is equivalent to (HOST, NULL, NULL) * (HOST, service, NULL) is equivalent to (HOST, service, peer_host) */ gfarm_error_t gfarm_gsi_cred_config_convert_to_name( enum gfarm_auth_cred_type type, char *service, char *name, char *hostname, gss_name_t *namep) { int rv; OM_uint32 e_major; OM_uint32 e_minor; gss_cred_id_t cred; switch (type) { case GFARM_AUTH_CRED_TYPE_DEFAULT: /* special. equivalent to GSS_C_NO_CREDENTIAL */ if (name != NULL) return (GFARM_ERRMSG_CRED_TYPE_DEFAULT_INVALID_CRED_NAME); if (service != NULL) return (GFARM_ERRMSG_CRED_TYPE_DEFAULT_INVALID_CRED_SERVICE); return (GFARM_ERRMSG_CRED_TYPE_DEFAULT_INTERNAL_ERROR); case GFARM_AUTH_CRED_TYPE_NO_NAME: if (name != NULL) return (GFARM_ERRMSG_CRED_TYPE_NO_NAME_INVALID_CRED_NAME); if (service != NULL) return (GFARM_ERRMSG_CRED_TYPE_NO_NAME_INVALID_CRED_SERVICE); *namep = GSS_C_NO_NAME; return (GFARM_ERR_NO_ERROR); case GFARM_AUTH_CRED_TYPE_MECHANISM_SPECIFIC: if (name == NULL) return (GFARM_ERRMSG_CRED_TYPE_MECHANISM_SPECIFIC_INVALID_CRED_NAME); if (service != NULL) return (GFARM_ERRMSG_CRED_TYPE_MECHANISM_SPECIFIC_INVALID_CRED_SERVICE); rv = gfarmGssImportName(namep, name, strlen(name), GSS_C_NO_OID, &e_major, &e_minor); break; case GFARM_AUTH_CRED_TYPE_HOST: if (name == NULL) name = hostname; if (service == NULL) { rv = gfarmGssImportNameOfHost(namep, name, &e_major, &e_minor); } else { rv = gfarmGssImportNameOfHostBasedService(namep, service, name, &e_major, &e_minor); } break; case GFARM_AUTH_CRED_TYPE_USER: if (service != NULL) return (GFARM_ERRMSG_CRED_TYPE_USER_CRED_INVALID_CRED_SERVICE); /* * XXX FIXME: `name' must be converted from global_username * to local_username, but there is no such function for now. */ if (name == NULL) name = gfarm_get_local_username(); rv = gfarmGssImportName(namep, name, strlen(name), GSS_C_NT_USER_NAME, &e_major, &e_minor); break; case GFARM_AUTH_CRED_TYPE_SELF: /* special. there is no corresponding name_type in GSSAPI */ if (name != NULL) return (GFARM_ERRMSG_CRED_TYPE_SELF_CRED_INVALID_CRED_NAME); if (service != NULL) return (GFARM_ERRMSG_CRED_TYPE_SELF_CRED_INVALID_CRED_SERVICE); if (gfarmSecSessionGetInitiatorInitialCredential(&cred) < 0 || cred == GSS_C_NO_CREDENTIAL) return (GFARM_ERRMSG_CRED_TYPE_SELF_NOT_INITIALIZED_AS_AN_INITIATOR); rv = gfarmGssNewCredentialName(namep, cred, &e_major,&e_minor); break; default: return (GFARM_ERRMSG_INVALID_CRED_TYPE); } if (rv < 0) { if (gflog_auth_get_verbose()) { gflog_error(GFARM_MSG_1000711, "gfarmGssImportName(): " "invalid credential configuration:"); gfarmGssPrintMajorStatus(e_major); gfarmGssPrintMinorStatus(e_minor); } return (GFARM_ERRMSG_INVALID_CREDENTIAL_CONFIGURATION); } return (GFARM_ERR_NO_ERROR); } gfarm-2.4.1/lib/libgfarm/gfarm/glob.c0000644000000000000000000001615211507222724016033 0ustar rootroot#include #include #include #include #include #include "gfutil.h" #include "liberror.h" #include "patmatch.h" #define GFS_GLOB_INITIAL 200 #define GFS_GLOB_DELTA 200 gfarm_error_t gfs_glob_init(gfs_glob_t *listp) { unsigned char *v; GFARM_MALLOC_ARRAY(v, GFS_GLOB_INITIAL); if (v == NULL) { gflog_debug(GFARM_MSG_1001414, "allocation of array failed: %s", gfarm_error_string(GFARM_ERR_NO_MEMORY)); return (GFARM_ERR_NO_MEMORY); } listp->size = GFS_GLOB_INITIAL; listp->length = 0; listp->array = v; return (GFARM_ERR_NO_ERROR); } void gfs_glob_free(gfs_glob_t *listp) { free(listp->array); /* the following is not needed, but to make erroneous program abort */ listp->size = 0; listp->length = 0; listp->array = NULL; } gfarm_error_t gfs_glob_add(gfs_glob_t *listp, int dtype) { int length = gfs_glob_length(listp); if (length >= listp->size) { int n = listp->size + GFS_GLOB_DELTA; unsigned char *t; GFARM_REALLOC_ARRAY(t, listp->array, n); if (t == NULL) { gflog_debug(GFARM_MSG_1001415, "re-allocation of array failed: %s", gfarm_error_string(GFARM_ERR_NO_MEMORY)); return (GFARM_ERR_NO_MEMORY); } listp->size = n; listp->array = t; } listp->array[length] = dtype; listp->length++; return (GFARM_ERR_NO_ERROR); } /* * gfs_glob */ static void glob_pattern_to_name(char *name, const char *pattern, int length) { int i, j; for (i = j = 0; j < length; i++, j++) { if (pattern[j] == '\\') { if (pattern[j + 1] != '\0' && pattern[j + 1] != '/') j++; } name[i] = pattern[j]; } name[i] = '\0'; } #define GLOB_PATH_BUFFER_SIZE (PATH_MAX * 2) static gfarm_error_t gfs_glob_sub(char *path_buffer, char *path_tail, const char *pattern, gfarm_stringlist *paths, gfs_glob_t *types) { gfarm_error_t e, e_save = GFARM_ERR_NO_ERROR; char *s; int i, nomagic, dirpos = -1; GFS_Dir dir; struct gfs_dirent *entry; struct gfs_stat st; for (i = 0; pattern[i] != '\0'; i++) { if (pattern[i] == '\\') { if (pattern[i + 1] != '\0' && pattern[i + 1] != '/') i++; } else if (pattern[i] == '/') { dirpos = i; } else if (pattern[i] == '?' || pattern[i] == '*') { break; } else if (pattern[i] == '[') { if (gfarm_pattern_charset_parse(pattern, i + 1, NULL)) break; } } if (pattern[i] == '\0') { /* no magic */ if (path_tail - path_buffer + strlen(pattern) > GLOB_PATH_BUFFER_SIZE) { gflog_debug(GFARM_MSG_1001416, "File name is too long: %s", gfarm_error_string( GFARM_ERR_FILE_NAME_TOO_LONG)); return (GFARM_ERR_FILE_NAME_TOO_LONG); } glob_pattern_to_name(path_tail, pattern, strlen(pattern)); e = gfs_stat(path_buffer, &st); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001417, "gfs_stat(%s) failed: %s", path_buffer, gfarm_error_string(e)); return (e); } s = strdup(path_buffer); if (s == NULL) { gfs_stat_free(&st); gflog_debug(GFARM_MSG_1001418, "allocation of path string failed: %s", gfarm_error_string(GFARM_ERR_NO_MEMORY)); return (GFARM_ERR_NO_MEMORY); } gfarm_stringlist_add(paths, s); if (GFARM_S_ISDIR(st.st_mode)) gfs_glob_add(types, GFS_DT_DIR); else gfs_glob_add(types, GFS_DT_REG); gfs_stat_free(&st); return (GFARM_ERR_NO_ERROR); } nomagic = i; if (dirpos >= 0) { int dirlen = dirpos == 0 ? 1 : dirpos; if (path_tail - path_buffer + dirlen > GLOB_PATH_BUFFER_SIZE) { gflog_debug(GFARM_MSG_1001419, "File name is too long: %s", gfarm_error_string( GFARM_ERR_FILE_NAME_TOO_LONG)); return (GFARM_ERR_FILE_NAME_TOO_LONG); } glob_pattern_to_name(path_tail, pattern, dirlen); path_tail += strlen(path_tail); } dirpos++; for (i = nomagic; pattern[i] != '\0'; i++) { if (pattern[i] == '\\') { if (pattern[i + 1] != '\0' && pattern[i + 1] != '/') i++; } else if (pattern[i] == '/') { break; } else if (pattern[i] == '?' || pattern[i] == '*') { } else if (pattern[i] == '[') { gfarm_pattern_charset_parse(pattern, i + 1, &i); } } e = gfs_opendir(path_buffer, &dir); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001420, "gfs_opendir(%s) failed: %s", path_buffer, gfarm_error_string(e)); return (e); } if (path_tail > path_buffer && path_tail[-1] != '/') { if (path_tail - path_buffer + 1 > GLOB_PATH_BUFFER_SIZE) { gflog_debug(GFARM_MSG_1001421, "File name is too long: %s", gfarm_error_string( GFARM_ERR_FILE_NAME_TOO_LONG)); return (GFARM_ERR_FILE_NAME_TOO_LONG); } *path_tail++ = '/'; } while ((e = gfs_readdir(dir, &entry)) == GFARM_ERR_NO_ERROR && entry != NULL) { if (entry->d_name[0] == '.' && pattern[dirpos] != '.') continue; /* initial '.' must be literally matched */ if (!gfarm_pattern_submatch(&pattern[dirpos], i - dirpos, entry->d_name, GFARM_PATTERN_PATHNAME)) continue; if (path_tail - path_buffer + strlen(entry->d_name) > GLOB_PATH_BUFFER_SIZE) { if (e_save == GFARM_ERR_NO_ERROR) e_save = GFARM_ERR_FILE_NAME_TOO_LONG; continue; } strcpy(path_tail, entry->d_name); if (pattern[i] == '\0') { s = strdup(path_buffer); if (s == NULL) { gflog_debug(GFARM_MSG_1001422, "allocation of path string failed:" " %s", gfarm_error_string(GFARM_ERR_NO_MEMORY)); return (GFARM_ERR_NO_MEMORY); } gfarm_stringlist_add(paths, s); gfs_glob_add(types, entry->d_type); continue; } e = gfs_glob_sub(path_buffer, path_tail + strlen(path_tail), pattern + i, paths, types); if (e_save == GFARM_ERR_NO_ERROR) e_save = e; } gfs_closedir(dir); if (e_save != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001423, "error occurred during process(%s): %s", path_buffer, gfarm_error_string(e_save)); } return (e_save); } gfarm_error_t gfs_glob(const char *pattern, gfarm_stringlist *paths, gfs_glob_t *types) { gfarm_error_t e = GFARM_ERR_NO_ERROR; char *p = NULL; int n = gfarm_stringlist_length(paths); char path_buffer[GLOB_PATH_BUFFER_SIZE + 1]; #if 0 /* XXX FIXME - "~" handling isn't implemented on v2, yet */ size_t size; int overflow = 0; const char *s; int len; if (*pattern == '~') { if (pattern[1] == '\0' || pattern[1] == '/') { s = gfarm_get_global_username(); if (s == NULL) return ( GFARM_ERRMSG_GFS_GLOB_NOT_PROPERLY_INITIALIZED ); len = strlen(s); pattern++; } else { s = pattern + 1; len = strcspn(s, "/"); pattern += 1 + len; } size = gfarm_size_add(&overflow, 1 + len, strlen(pattern) + 1); if (!overflow) GFARM_MALLOC_ARRAY(p, size); if (overflow || p == NULL) { e = GFARM_ERR_FILE_NAME_TOO_LONG; } else { p[0] = '/'; memcpy(p + 1, s, len); strcpy(p + 1 + len, pattern); pattern = p; } } else #endif { strcpy(path_buffer, "."); } if (e == GFARM_ERR_NO_ERROR) { e = gfs_glob_sub(path_buffer, path_buffer, pattern, paths, types); } if (gfarm_stringlist_length(paths) <= n) { gfarm_stringlist_add(paths, strdup(pattern)); gfs_glob_add(types, GFS_DT_UNKNOWN); } if (p != NULL) free(p); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001424, "error occurred during process: %s", gfarm_error_string(e)); } return (e); } gfarm-2.4.1/lib/libgfarm/gfarm/gfm_client.c0000644000000000000000000025013311507222723017215 0ustar rootroot#include #include #include /* for config.h */ #include #include #include #include #include #include #include #include #include #include #include /* TCP_NODELAY */ #include #include #include #include #include #include #include #include #include #include #include "gfutil.h" #include "hash.h" #include "gfnetdb.h" #include "lru_cache.h" #include "gfp_xdr.h" #include "io_fd.h" #include "sockopt.h" #include "sockutil.h" #include "host.h" #include "auth.h" #include "config.h" #include "conn_cache.h" #include "gfm_proto.h" #include "gfj_client.h" #include "xattr_info.h" #include "gfm_client.h" #include "quota_info.h" struct gfm_connection { struct gfp_cached_connection *cache_entry; struct gfp_xdr *conn; enum gfarm_auth_method auth_method; /* parallel process signatures */ gfarm_pid_t pid; char pid_key[GFM_PROTO_PROCESS_KEY_LEN_SHAREDSECRET]; }; #define SERVER_HASHTAB_SIZE 31 /* prime number */ static gfarm_error_t gfm_client_connection_dispose(void *); static struct gfp_conn_cache gfm_server_cache = GFP_CONN_CACHE_INITIALIZER(gfm_server_cache, gfm_client_connection_dispose, "gfm_connection", SERVER_HASHTAB_SIZE, &gfarm_gfmd_connection_cache); int gfm_client_is_connection_error(gfarm_error_t e) { return (IS_CONNECTION_ERROR(e)); } struct gfp_xdr * gfm_client_connection_conn(struct gfm_connection *gfm_server) { return (gfm_server->conn); } int gfm_client_connection_fd(struct gfm_connection *gfm_server) { return (gfp_xdr_fd(gfm_server->conn)); } enum gfarm_auth_method gfm_client_connection_auth_method(struct gfm_connection *gfm_server) { return (gfm_server->auth_method); } int gfm_client_is_connection_valid(struct gfm_connection *gfm_server) { return (gfp_is_cached_connection(gfm_server->cache_entry)); } const char * gfm_client_hostname(struct gfm_connection *gfm_server) { assert(gfm_client_is_connection_valid(gfm_server)); return (gfp_cached_connection_hostname(gfm_server->cache_entry)); } const char * gfm_client_username(struct gfm_connection *gfm_server) { assert(gfm_client_is_connection_valid(gfm_server)); return (gfp_cached_connection_username(gfm_server->cache_entry)); } int gfm_client_port(struct gfm_connection *gfm_server) { assert(gfm_client_is_connection_valid(gfm_server)); return (gfp_cached_connection_port(gfm_server->cache_entry)); } gfarm_error_t gfm_client_process_get(struct gfm_connection *gfm_server, gfarm_int32_t *keytypep, const char **sharedkeyp, size_t *sharedkey_sizep, gfarm_pid_t *pidp) { if (gfm_server->pid == 0) { gflog_debug(GFARM_MSG_1001092, "server pid is invalid: %s", gfarm_error_string(GFARM_ERR_NO_SUCH_OBJECT)); return (GFARM_ERR_NO_SUCH_OBJECT); } *keytypep = GFM_PROTO_PROCESS_KEY_TYPE_SHAREDSECRET; *sharedkeyp = gfm_server->pid_key; *sharedkey_sizep = GFM_PROTO_PROCESS_KEY_LEN_SHAREDSECRET; *pidp = gfm_server->pid; return (GFARM_ERR_NO_ERROR); } /* this interface is exported for a use from a private extension */ void gfm_client_purge_from_cache(struct gfm_connection *gfm_server) { gfp_cached_connection_purge_from_cache(&gfm_server_cache, gfm_server->cache_entry); } #define gfm_client_connection_used(gfm_server) \ gfp_cached_connection_used(&gfm_server_cache, \ (gfm_server)->cache_entry) int gfm_cached_connection_had_connection_error(struct gfm_connection *gfm_server) { /* i.e. gfm_client_purge_from_cache() was called due to an error */ return (!gfp_is_cached_connection(gfm_server->cache_entry)); } void gfm_client_connection_gc(void) { gfp_cached_connection_gc_all(&gfm_server_cache); } static gfarm_error_t gfm_client_connection0(const char *hostname, int port, struct gfp_cached_connection *cache_entry, struct gfm_connection **gfm_serverp, const char *source_ip) { gfarm_error_t e; struct gfm_connection *gfm_server; int sock, save_errno; struct addrinfo hints, *res; char sbuf[NI_MAXSERV]; snprintf(sbuf, sizeof(sbuf), "%u", port); memset(&hints, 0, sizeof(hints)); hints.ai_family = AF_INET; hints.ai_socktype = SOCK_STREAM; hints.ai_flags = AI_CANONNAME; if (gfarm_getaddrinfo(hostname, sbuf, &hints, &res) != 0) { gflog_debug(GFARM_MSG_1001093, "getaddrinfo(%s) failed: %s", hostname, gfarm_error_string(GFARM_ERR_UNKNOWN_HOST)); return (GFARM_ERR_UNKNOWN_HOST); } sock = socket(res->ai_family, res->ai_socktype, res->ai_protocol); if (sock == -1 && (errno == ENFILE || errno == EMFILE)) { gfm_client_connection_gc(); /* XXX FIXME: GC all descriptors */ sock = socket(res->ai_family, res->ai_socktype, res->ai_protocol); } if (sock == -1) { save_errno = errno; gflog_debug(GFARM_MSG_1001094, "creation of socket failed: %s", strerror(save_errno)); return (gfarm_errno_to_error(save_errno)); } fcntl(sock, F_SETFD, 1); /* automatically close() on exec(2) */ /* XXX - how to report setsockopt(2) failure ? */ gfarm_sockopt_apply_by_name_addr(sock, res->ai_canonname, res->ai_addr); if (source_ip != NULL) { e = gfarm_bind_source_ip(sock, source_ip); if (e != GFARM_ERR_NO_ERROR) { close(sock); gfarm_freeaddrinfo(res); gflog_debug(GFARM_MSG_1001095, "bind(%s) failed: %s", source_ip, gfarm_error_string(e)); return (e); } } if (connect(sock, res->ai_addr, res->ai_addrlen) < 0) { save_errno = errno; close(sock); gfarm_freeaddrinfo(res); gflog_debug(GFARM_MSG_1001096, "connect failed: %s", strerror(save_errno)); return (gfarm_errno_to_error(save_errno)); } GFARM_MALLOC(gfm_server); if (gfm_server == NULL) { close(sock); gfarm_freeaddrinfo(res); gflog_debug(GFARM_MSG_1001097, "allocation of 'gfm_server' failed: %s", gfarm_error_string(GFARM_ERR_NO_MEMORY)); return (GFARM_ERR_NO_MEMORY); } e = gfp_xdr_new_socket(sock, &gfm_server->conn); if (e != GFARM_ERR_NO_ERROR) { free(gfm_server); close(sock); gfarm_freeaddrinfo(res); gflog_debug(GFARM_MSG_1001098, "creation of new socket failed: %s", gfarm_error_string(e)); return (e); } /* XXX We should explicitly pass the original global username too. */ e = gfarm_auth_request(gfm_server->conn, GFM_SERVICE_TAG, res->ai_canonname, res->ai_addr, gfarm_get_auth_id_type(), &gfm_server->auth_method); gfarm_freeaddrinfo(res); if (e != GFARM_ERR_NO_ERROR) { gfp_xdr_free(gfm_server->conn); free(gfm_server); gflog_debug(GFARM_MSG_1001099, "auth request failed: %s", gfarm_error_string(e)); } else { gfm_server->cache_entry = cache_entry; gfp_cached_connection_set_data(cache_entry, gfm_server); gfm_server->pid = 0; *gfm_serverp = gfm_server; } return (e); } /* * gfm_client_connection_acquire - create or lookup a cached connection */ gfarm_error_t gfm_client_connection_acquire(const char *hostname, int port, struct gfm_connection **gfm_serverp) { gfarm_error_t e; struct gfp_cached_connection *cache_entry; int created; unsigned int sleep_interval = 1; /* 1 sec */ unsigned int sleep_max_interval = 512; /* about 8.5 min */ struct timeval expiration_time; e = gfp_cached_connection_acquire(&gfm_server_cache, hostname, port, &cache_entry, &created); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001100, "acquirement of cached connection failed: %s", gfarm_error_string(e)); return (e); } if (!created) { *gfm_serverp = gfp_cached_connection_get_data(cache_entry); return (GFARM_ERR_NO_ERROR); } e = gfm_client_connection0(hostname, port, cache_entry, gfm_serverp, NULL); gettimeofday(&expiration_time, NULL); expiration_time.tv_sec += gfarm_gfmd_reconnection_timeout; while (IS_CONNECTION_ERROR(e) && !gfarm_timeval_is_expired(&expiration_time)) { gflog_warning(GFARM_MSG_1000058, "connecting to gfmd at %s:%d failed, " "sleep %d sec: %s", hostname, port, sleep_interval, gfarm_error_string(e)); sleep(sleep_interval); e = gfm_client_connection0(hostname, port, cache_entry, gfm_serverp, NULL); if (sleep_interval < sleep_max_interval) sleep_interval *= 2; } if (e != GFARM_ERR_NO_ERROR) { gflog_error(GFARM_MSG_1000059, "cannot connect to gfmd at %s:%d, give up: %s", hostname, port, gfarm_error_string(e)); gfp_cached_connection_purge_from_cache(&gfm_server_cache, cache_entry); gfp_uncached_connection_dispose(cache_entry); } return (e); } gfarm_error_t gfm_client_connection_and_process_acquire(const char *hostname, int port, struct gfm_connection **gfm_serverp) { struct gfm_connection *gfm_server; gfarm_error_t e = gfm_client_connection_acquire(hostname, port, &gfm_server); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001101, "acquirement of client connection failed: %s", gfarm_error_string(e)); return (e); } /* * XXX FIXME * should use COMPOUND request to reduce number of roundtrip */ if (gfm_server->pid == 0) { gfarm_auth_random(gfm_server->pid_key, GFM_PROTO_PROCESS_KEY_LEN_SHAREDSECRET); e = gfm_client_process_alloc(gfm_server, GFM_PROTO_PROCESS_KEY_TYPE_SHAREDSECRET, gfm_server->pid_key, GFM_PROTO_PROCESS_KEY_LEN_SHAREDSECRET, &gfm_server->pid); if (e != GFARM_ERR_NO_ERROR) { gflog_error(GFARM_MSG_1000060, "failed to allocate gfarm PID: %s", gfarm_error_string(e)); gfm_client_connection_free(gfm_server); } } if (e == GFARM_ERR_NO_ERROR) *gfm_serverp = gfm_server; return (e); } /* * gfm_client_connect - create an uncached connection */ gfarm_error_t gfm_client_connect(const char *hostname, int port, struct gfm_connection **gfm_serverp, const char *source_ip) { gfarm_error_t e; struct gfp_cached_connection *cache_entry; e = gfp_uncached_connection_new(&cache_entry); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001102, "creation of uncached connection failed: %s", gfarm_error_string(e)); return (e); } e = gfm_client_connection0(hostname, port, cache_entry, gfm_serverp, source_ip); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001103, "gfm_client_connection0(%s)(%d) failed: %s", hostname, port, gfarm_error_string(e)); gfp_uncached_connection_dispose(cache_entry); } return (e); } static gfarm_error_t gfm_client_connection_dispose(void *connection_data) { struct gfm_connection *gfm_server = connection_data; gfarm_error_t e = gfp_xdr_free(gfm_server->conn); gfp_uncached_connection_dispose(gfm_server->cache_entry); free(gfm_server); return (e); } /* * gfm_client_connection_free() can be used for both * an uncached connection which was created by gfm_client_connect(), and * a cached connection which was created by gfm_client_connection_acquire(). * The connection will be immediately closed in the former uncached case. * */ void gfm_client_connection_free(struct gfm_connection *gfm_server) { gfp_cached_or_uncached_connection_free(&gfm_server_cache, gfm_server->cache_entry); } void gfm_client_terminate(void) { gfp_cached_connection_terminate(&gfm_server_cache); } gfarm_error_t gfm_client_rpc_request(struct gfm_connection *gfm_server, int command, const char *format, ...) { va_list ap; gfarm_error_t e; va_start(ap, format); e = gfp_xdr_vrpc_request(gfm_server->conn, command, &format, &ap); va_end(ap); if (IS_CONNECTION_ERROR(e)) gfm_client_purge_from_cache(gfm_server); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001104, "gfp_xdr_vrpc_request(%d) failed: %s", command, gfarm_error_string(e)); } return (e); } gfarm_error_t gfm_client_rpc_result(struct gfm_connection *gfm_server, int just, const char *format, ...) { va_list ap; gfarm_error_t e; int errcode; gfm_client_connection_used(gfm_server); e = gfp_xdr_flush(gfm_server->conn); if (IS_CONNECTION_ERROR(e)) gfm_client_purge_from_cache(gfm_server); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001105, "gfp_xdr_flush() failed: %s", gfarm_error_string(e)); return (e); } va_start(ap, format); e = gfp_xdr_vrpc_result(gfm_server->conn, just, &errcode, &format, &ap); va_end(ap); if (IS_CONNECTION_ERROR(e)) gfm_client_purge_from_cache(gfm_server); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001106, "gfp_xdr_vrpc_result() failed: %s", gfarm_error_string(e)); return (e); } if (errcode != 0) { /* * We just use gfarm_error_t as the errcode, * Note that GFARM_ERR_NO_ERROR == 0. */ gflog_debug(GFARM_MSG_1001107, "gfp_xdr_vrpc_result() failed: errcode=%d", errcode); return (errcode); } return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfm_client_rpc(struct gfm_connection *gfm_server, int just, int command, const char *format, ...) { va_list ap; gfarm_error_t e; int errcode; gfm_client_connection_used(gfm_server); va_start(ap, format); e = gfp_xdr_vrpc(gfm_server->conn, just, command, &errcode, &format, &ap); va_end(ap); if (IS_CONNECTION_ERROR(e)) gfm_client_purge_from_cache(gfm_server); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001108, "gfp_xdr_vrpc(%d) failed: %s", command, gfarm_error_string(e)); return (e); } if (errcode != 0) { /* * We just use gfarm_error_t as the errcode, * Note that GFARM_ERR_NO_ERROR == 0. */ gflog_debug(GFARM_MSG_1001109, "gfp_xdr_vrpc() failed: errcode=%d", errcode); return (errcode); } return (GFARM_ERR_NO_ERROR); } /* * host/user/group metadata */ /* this interface is exported for a use from a private extension */ gfarm_error_t gfm_client_get_nhosts(struct gfm_connection *gfm_server, int nhosts, struct gfarm_host_info *hosts) { gfarm_error_t e; int i, eof; gfarm_int32_t naliases; for (i = 0; i < nhosts; i++) { e = gfp_xdr_recv(gfm_server->conn, 0, &eof, "ssiiii", &hosts[i].hostname, &hosts[i].architecture, &hosts[i].ncpu, &hosts[i].port, &hosts[i].flags, &naliases); if (IS_CONNECTION_ERROR(e)) gfm_client_purge_from_cache(gfm_server); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001110, "gfp_xdr_recv() failed: %s", gfarm_error_string(e)); return (e); /* XXX */ } if (eof) { gflog_debug(GFARM_MSG_1001111, "Unexpected EOF when receiving response: %s", gfarm_error_string(GFARM_ERR_PROTOCOL)); return (GFARM_ERR_PROTOCOL); /* XXX */ } /* XXX FIXME */ hosts[i].nhostaliases = 0; hosts[i].hostaliases = NULL; } return (GFARM_ERR_NO_ERROR); } static gfarm_error_t gfm_client_host_info_send_common(struct gfm_connection *gfm_server, int op, const struct gfarm_host_info *host) { return (gfm_client_rpc(gfm_server, 0, op, "ssiii/", host->hostname, host->architecture, host->ncpu, host->port, host->flags)); } static gfarm_error_t gfm_client_host_info_get_n(struct gfm_connection *gfm_server, int nhosts, int *nhostsp, struct gfarm_host_info **hostsp, const char *diag) { gfarm_error_t e; struct gfarm_host_info *hosts; GFARM_MALLOC_ARRAY(hosts, nhosts); if (hosts == NULL) { /* XXX this breaks gfm protocol */ gflog_debug(GFARM_MSG_1002208, "host_info allocation for %d hosts: no memory", nhosts); return (GFARM_ERR_NO_MEMORY); } if ((e = gfm_client_get_nhosts(gfm_server, nhosts, hosts)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001114, "gfm_client_get_nhosts() failed: %s", gfarm_error_string(e)); return (e); } *nhostsp = nhosts; *hostsp = hosts; return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfm_client_host_info_get_all(struct gfm_connection *gfm_server, int *nhostsp, struct gfarm_host_info **hostsp) { gfarm_error_t e; gfarm_int32_t nhosts; static const char diag[] = "gfm_client_host_info_get_all"; if ((e = gfm_client_rpc(gfm_server, 0, GFM_PROTO_HOST_INFO_GET_ALL, "/i", &nhosts)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001112, "gfm_client_rpc() failed: %s", gfarm_error_string(e)); return (e); } return (gfm_client_host_info_get_n(gfm_server, nhosts, nhostsp, hostsp, diag)); } gfarm_error_t gfm_client_host_info_get_by_architecture(struct gfm_connection *gfm_server, const char *architecture, int *nhostsp, struct gfarm_host_info **hostsp) { gfarm_error_t e; int nhosts; static const char diag[] = "gfm_client_host_info_get_by_architecture"; if ((e = gfm_client_rpc(gfm_server, 0, GFM_PROTO_HOST_INFO_GET_BY_ARCHITECTURE, "s/i", architecture, &nhosts)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001115, "gfm_client_rpc() failed: %s", gfarm_error_string(e)); return (e); } return (gfm_client_host_info_get_n(gfm_server, nhosts, nhostsp, hostsp, diag)); } static gfarm_error_t gfm_client_host_info_get_by_names_common(struct gfm_connection *gfm_server, int op, int nhosts, const char **names, gfarm_error_t *errors, struct gfarm_host_info *hosts) { gfarm_error_t e; int i; if ((e = gfm_client_rpc_request(gfm_server, op, "i", nhosts)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001116, "gfm_client_rpc_request() failed: %s", gfarm_error_string(e)); return (e); } for (i = 0; i < nhosts; i++) { e = gfp_xdr_send(gfm_server->conn, "s", names[i]); if (IS_CONNECTION_ERROR(e)) gfm_client_purge_from_cache(gfm_server); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001117, "sending hostname (%s) failed: %s", names[i], gfarm_error_string(e)); return (e); } } if ((e = gfm_client_rpc_result(gfm_server, 0, "")) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001118, "get_client_rpc_result() failed: %s", gfarm_error_string(e)); return (e); } for (i = 0; i < nhosts; i++) { e = gfm_client_rpc_result(gfm_server, 0, ""); errors[i] = e != GFARM_ERR_NO_ERROR ? e : gfm_client_get_nhosts(gfm_server, 1, &hosts[i]); } return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfm_client_host_info_get_by_names(struct gfm_connection *gfm_server, int nhosts, const char **names, gfarm_error_t *errors, struct gfarm_host_info *hosts) { return (gfm_client_host_info_get_by_names_common( gfm_server, GFM_PROTO_HOST_INFO_GET_BY_NAMES, nhosts, names, errors, hosts)); } gfarm_error_t gfm_client_host_info_get_by_namealiases(struct gfm_connection *gfm_server, int nhosts, const char **names, gfarm_error_t *errors, struct gfarm_host_info *hosts) { return (gfm_client_host_info_get_by_names_common( gfm_server, GFM_PROTO_HOST_INFO_GET_BY_NAMEALIASES, nhosts, names, errors, hosts)); } gfarm_error_t gfm_client_host_info_set(struct gfm_connection *gfm_server, const struct gfarm_host_info *host) { return (gfm_client_host_info_send_common(gfm_server, GFM_PROTO_HOST_INFO_SET, host)); } gfarm_error_t gfm_client_host_info_modify(struct gfm_connection *gfm_server, const struct gfarm_host_info *host) { return (gfm_client_host_info_send_common(gfm_server, GFM_PROTO_HOST_INFO_MODIFY, host)); } gfarm_error_t gfm_client_host_info_remove(struct gfm_connection *gfm_server, const char *hostname) { return (gfm_client_rpc(gfm_server, 0, GFM_PROTO_HOST_INFO_REMOVE, "s/", hostname)); } static gfarm_error_t get_nusers(struct gfm_connection *gfm_server, int nusers, struct gfarm_user_info *users) { gfarm_error_t e; int i, eof; for (i = 0; i < nusers; i++) { e = gfp_xdr_recv(gfm_server->conn, 0, &eof, "ssss", &users[i].username, &users[i].realname, &users[i].homedir, &users[i].gsi_dn); if (IS_CONNECTION_ERROR(e)) gfm_client_purge_from_cache(gfm_server); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001119, "receiving users failed: %s", gfarm_error_string(e)); return (e); /* XXX */ } if (eof) { gflog_debug(GFARM_MSG_1001120, "Unexpected EOF when receiving users: %s", gfarm_error_string(e)); return (GFARM_ERR_PROTOCOL); /* XXX */ } } return (GFARM_ERR_NO_ERROR); } static gfarm_error_t gfm_client_user_info_send_common(struct gfm_connection *gfm_server, int op, const struct gfarm_user_info *user) { return (gfm_client_rpc(gfm_server, 0, op, "ssss/", user->username, user->realname, user->homedir, user->gsi_dn)); } gfarm_error_t gfm_client_user_info_get_all(struct gfm_connection *gfm_server, int *nusersp, struct gfarm_user_info **usersp) { gfarm_error_t e; int nusers; struct gfarm_user_info *users; if ((e = gfm_client_rpc(gfm_server, 0, GFM_PROTO_USER_INFO_GET_ALL, "/i", &nusers)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001121, "gfm_client_rpc() failed: %s", gfarm_error_string(e)); return (e); } GFARM_MALLOC_ARRAY(users, nusers); if (users == NULL) { /* XXX this breaks gfm protocol */ gflog_debug(GFARM_MSG_1001122, "allocation of array 'users' failed: %s", gfarm_error_string(GFARM_ERR_NO_MEMORY)); return (GFARM_ERR_NO_MEMORY); } if ((e = get_nusers(gfm_server, nusers, users)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001123, "get_nusers() failed: %s", gfarm_error_string(e)); return (e); } *nusersp = nusers; *usersp = users; return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfm_client_user_info_get_by_names(struct gfm_connection *gfm_server, int nusers, const char **names, gfarm_error_t *errors, struct gfarm_user_info *users) { gfarm_error_t e; int i; if ((e = gfm_client_rpc_request(gfm_server, GFM_PROTO_USER_INFO_GET_BY_NAMES, "i", nusers)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001124, "gfm_client_rpc_request() failed: %s", gfarm_error_string(e)); return (e); } for (i = 0; i < nusers; i++) { e = gfp_xdr_send(gfm_server->conn, "s", names[i]); if (IS_CONNECTION_ERROR(e)) gfm_client_purge_from_cache(gfm_server); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001125, "sending username (%s) failed: %s", names[i], gfarm_error_string(e)); return (e); } } if ((e = gfm_client_rpc_result(gfm_server, 0, "")) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001126, "gfm_client_rpc_result() failed: %s", gfarm_error_string(e)); return (e); } for (i = 0; i < nusers; i++) { e = gfm_client_rpc_result(gfm_server, 0, ""); errors[i] = e != GFARM_ERR_NO_ERROR ? e : get_nusers(gfm_server, 1, &users[i]); } return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfm_client_user_info_get_by_gsi_dn(struct gfm_connection *gfm_server, const char *gsi_dn, struct gfarm_user_info *user) { return (gfm_client_rpc(gfm_server, 0, GFM_PROTO_USER_INFO_GET_BY_GSI_DN, "s/ssss", gsi_dn, &user->username, &user->realname, &user->homedir, &user->gsi_dn)); } gfarm_error_t gfm_client_user_info_set(struct gfm_connection *gfm_server, const struct gfarm_user_info *user) { return (gfm_client_user_info_send_common(gfm_server, GFM_PROTO_USER_INFO_SET, user)); } gfarm_error_t gfm_client_user_info_modify(struct gfm_connection *gfm_server, const struct gfarm_user_info *user) { return (gfm_client_user_info_send_common(gfm_server, GFM_PROTO_USER_INFO_MODIFY, user)); } gfarm_error_t gfm_client_user_info_remove(struct gfm_connection *gfm_server, const char *username) { return (gfm_client_rpc(gfm_server, 0, GFM_PROTO_USER_INFO_REMOVE, "s/", username)); } static gfarm_error_t get_ngroups(struct gfm_connection *gfm_server, int ngroups, struct gfarm_group_info *groups) { gfarm_error_t e; int i, j, eof; for (i = 0; i < ngroups; i++) { e = gfp_xdr_recv(gfm_server->conn, 0, &eof, "si", &groups[i].groupname, &groups[i].nusers); if (IS_CONNECTION_ERROR(e)) gfm_client_purge_from_cache(gfm_server); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001127, "receiving groups response failed: %s", gfarm_error_string(e)); return (e); /* XXX */ } if (eof) { gflog_debug(GFARM_MSG_1001128, "Unexpected EOF when receiving groups: %s", gfarm_error_string(GFARM_ERR_PROTOCOL)); return (GFARM_ERR_PROTOCOL); /* XXX */ } GFARM_MALLOC_ARRAY(groups[i].usernames, groups[i].nusers); /* XXX this breaks gfm protocol */ if (groups[i].usernames == NULL) { gflog_debug(GFARM_MSG_1001129, "allocation of array 'groups' failed: %s", gfarm_error_string(GFARM_ERR_NO_MEMORY)); return (GFARM_ERR_NO_MEMORY); /* XXX */ } for (j = 0; j < groups[i].nusers; j++) { e = gfp_xdr_recv(gfm_server->conn, 0, &eof, "s", &groups[i].usernames[j]); if (IS_CONNECTION_ERROR(e)) gfm_client_purge_from_cache(gfm_server); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001130, "receiving group response failed: %s", gfarm_error_string(e)); return (e); /* XXX */ } if (eof) { gflog_debug(GFARM_MSG_1001131, "Unexpected EOF when " "receiving group: %s", gfarm_error_string( GFARM_ERR_PROTOCOL)); return (GFARM_ERR_PROTOCOL); /* XXX */ } } } return (GFARM_ERR_NO_ERROR); } static gfarm_error_t gfm_client_group_info_send_common(struct gfm_connection *gfm_server, int op, const struct gfarm_group_info *group) { gfarm_error_t e; int i; if ((e = gfm_client_rpc_request(gfm_server, op, "si", group->groupname, group->nusers)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001132, "gfm_client_rpc_request() failed: %s", gfarm_error_string(e)); return (e); } for (i = 0; i < group->nusers; i++) { e = gfp_xdr_send(gfm_server->conn, "s", group->usernames[i]); if (IS_CONNECTION_ERROR(e)) gfm_client_purge_from_cache(gfm_server); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001133, "sending username (%s) failed: %s", group->usernames[i], gfarm_error_string(e)); return (e); } } return (gfm_client_rpc_result(gfm_server, 0, "")); } gfarm_error_t gfm_client_group_info_get_all(struct gfm_connection *gfm_server, int *ngroupsp, struct gfarm_group_info **groupsp) { gfarm_error_t e; int ngroups; struct gfarm_group_info *groups; if ((e = gfm_client_rpc(gfm_server, 0, GFM_PROTO_GROUP_INFO_GET_ALL, "/i", &ngroups)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001134, "gfm_client_rpc() failed: %s", gfarm_error_string(e)); return (e); } GFARM_MALLOC_ARRAY(groups, ngroups); if (groups == NULL) { /* XXX this breaks gfm protocol */ gflog_debug(GFARM_MSG_1001135, "allocation of array 'groups' failed: %s", gfarm_error_string(GFARM_ERR_NO_MEMORY)); return (GFARM_ERR_NO_MEMORY); } if ((e = get_ngroups(gfm_server, ngroups, groups)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001136, "get_ngroups() failed: %s", gfarm_error_string(e)); return (e); } *ngroupsp = ngroups; *groupsp = groups; return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfm_client_group_info_get_by_names(struct gfm_connection *gfm_server, int ngroups, const char **group_names, gfarm_error_t *errors, struct gfarm_group_info *groups) { gfarm_error_t e; int i; if ((e = gfm_client_rpc_request(gfm_server, GFM_PROTO_GROUP_INFO_GET_BY_NAMES, "i", ngroups)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001137, "gfm_client_rpc_request() failed: %s", gfarm_error_string(e)); return (e); } for (i = 0; i < ngroups; i++) { e = gfp_xdr_send(gfm_server->conn, "s", group_names[i]); if (IS_CONNECTION_ERROR(e)) gfm_client_purge_from_cache(gfm_server); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001138, "sending groupname (%s) failed: %s", group_names[i], gfarm_error_string(e)); return (e); } } if ((e = gfm_client_rpc_result(gfm_server, 0, "")) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001139, "gfm_client_rpc_result() failed: %s", gfarm_error_string(e)); return (e); } for (i = 0; i < ngroups; i++) { e = gfm_client_rpc_result(gfm_server, 0, ""); errors[i] = e != GFARM_ERR_NO_ERROR ? e : get_ngroups(gfm_server, 1, &groups[i]); } return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfm_client_group_info_set(struct gfm_connection *gfm_server, const struct gfarm_group_info *group) { return (gfm_client_group_info_send_common(gfm_server, GFM_PROTO_GROUP_INFO_SET, group)); } gfarm_error_t gfm_client_group_info_modify(struct gfm_connection *gfm_server, const struct gfarm_group_info *group) { return (gfm_client_group_info_send_common(gfm_server, GFM_PROTO_GROUP_INFO_MODIFY, group)); } gfarm_error_t gfm_client_group_info_remove(struct gfm_connection *gfm_server, const char *groupname) { return (gfm_client_rpc(gfm_server, 0, GFM_PROTO_GROUP_INFO_REMOVE, "s/", groupname)); } gfarm_error_t gfm_client_group_info_users_op_common(struct gfm_connection *gfm_server, int op, const char *groupname, int nusers, const char **usernames, gfarm_error_t *errors) { gfarm_error_t e; int i; if ((e = gfm_client_rpc_request(gfm_server, op, "si", groupname, nusers)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001140, "gfm_client_rpc_request() failed: %s", gfarm_error_string(e)); return (e); } for (i = 0; i < nusers; i++) { e = gfp_xdr_send(gfm_server->conn, "s", usernames[i]); if (IS_CONNECTION_ERROR(e)) gfm_client_purge_from_cache(gfm_server); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001141, "sending username (%s) failed: %s", usernames[i], gfarm_error_string(e)); return (e); } } if ((e = gfm_client_rpc_result(gfm_server, 0, "")) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001142, "gfm_client_rpc_result() failed: %s", gfarm_error_string(e)); return (e); } for (i = 0; i < nusers; i++) { errors[i] = gfm_client_rpc_result(gfm_server, 0, ""); } return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfm_client_group_info_add_users(struct gfm_connection *gfm_server, const char *groupname, int nusers, const char **usernames, gfarm_error_t *errors) { return (gfm_client_group_info_users_op_common(gfm_server, GFM_PROTO_GROUP_INFO_ADD_USERS, groupname, nusers, usernames, errors)); } gfarm_error_t gfm_client_group_info_remove_users(struct gfm_connection *gfm_server, const char *groupname, int nusers, const char **usernames, gfarm_error_t *errors) { return (gfm_client_group_info_users_op_common(gfm_server, GFM_PROTO_GROUP_INFO_REMOVE_USERS, groupname, nusers, usernames, errors)); } gfarm_error_t gfm_client_group_names_get_by_users(struct gfm_connection *gfm_server, int nusers, const char **usernames, gfarm_error_t *errors, struct gfarm_group_names *assignments) { gfarm_error_t e; int i, j; if ((e = gfm_client_rpc_request(gfm_server, GFM_PROTO_GROUP_NAMES_GET_BY_USERS, "i", nusers)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001143, "gfm_client_rpc_request() failed: %s", gfarm_error_string(e)); return (e); } for (i = 0; i < nusers; i++) { e = gfp_xdr_send(gfm_server->conn, "s", usernames[i]); if (IS_CONNECTION_ERROR(e)) gfm_client_purge_from_cache(gfm_server); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001144, "sending username (%s) failed: %s", usernames[i], gfarm_error_string(e)); return (e); } } if ((e = gfm_client_rpc_result(gfm_server, 0, "")) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001145, "gfm_client_rpc_result() failed: %s", gfarm_error_string(e)); return (e); } for (i = 0; i < nusers; i++) { errors[i] = e = gfm_client_rpc_result(gfm_server, 0, "i", &assignments->ngroups); if (e == GFARM_ERR_NO_ERROR) { GFARM_MALLOC_ARRAY(assignments->groupnames, assignments->ngroups); if (assignments->groupnames == NULL) { errors[i] = GFARM_ERR_NO_MEMORY; } else { for (j = 0; j < assignments->ngroups; j++) { int eof; errors[i] = gfp_xdr_recv( gfm_server->conn, 0, &eof, "s", &assignments->groupnames[j]); if (IS_CONNECTION_ERROR(errors[i])) gfm_client_purge_from_cache( gfm_server); if (errors[i] != GFARM_ERR_NO_ERROR) break; if (eof) errors[i] = GFARM_ERR_PROTOCOL; if (errors[i] != GFARM_ERR_NO_ERROR) break; } } } } return (GFARM_ERR_NO_ERROR); } /* * gfs from client */ gfarm_error_t gfm_client_compound_begin_request(struct gfm_connection *gfm_server) { return (gfm_client_rpc_request(gfm_server, GFM_PROTO_COMPOUND_BEGIN, "")); } gfarm_error_t gfm_client_compound_begin_result(struct gfm_connection *gfm_server) { return (gfm_client_rpc_result(gfm_server, 0, "")); } gfarm_error_t gfm_client_compound_end_request(struct gfm_connection *gfm_server) { return (gfm_client_rpc_request(gfm_server, GFM_PROTO_COMPOUND_END, "")); } gfarm_error_t gfm_client_compound_end_result(struct gfm_connection *gfm_server) { return (gfm_client_rpc_result(gfm_server, 0, "")); } gfarm_error_t gfm_client_compound_on_error_request(struct gfm_connection *gfm_server, gfarm_error_t error) { return (gfm_client_rpc_request(gfm_server, GFM_PROTO_COMPOUND_ON_ERROR, "i", error)); } gfarm_error_t gfm_client_compound_on_error_result(struct gfm_connection *gfm_server) { return (gfm_client_rpc_result(gfm_server, 0, "")); } gfarm_error_t gfm_client_get_fd_request(struct gfm_connection *gfm_server) { return (gfm_client_rpc_request(gfm_server, GFM_PROTO_GET_FD, "")); } gfarm_error_t gfm_client_get_fd_result(struct gfm_connection *gfm_server, gfarm_int32_t *fdp) { return (gfm_client_rpc_result(gfm_server, 0, "i", fdp)); } gfarm_error_t gfm_client_put_fd_request(struct gfm_connection *gfm_server, gfarm_int32_t fd) { return (gfm_client_rpc_request(gfm_server, GFM_PROTO_PUT_FD, "i", fd)); } gfarm_error_t gfm_client_put_fd_result(struct gfm_connection *gfm_server) { return (gfm_client_rpc_result(gfm_server, 0, "")); } gfarm_error_t gfm_client_save_fd_request(struct gfm_connection *gfm_server) { return (gfm_client_rpc_request(gfm_server, GFM_PROTO_SAVE_FD, "")); } gfarm_error_t gfm_client_save_fd_result(struct gfm_connection *gfm_server) { return (gfm_client_rpc_result(gfm_server, 0, "")); } gfarm_error_t gfm_client_restore_fd_request(struct gfm_connection *gfm_server) { return (gfm_client_rpc_request(gfm_server, GFM_PROTO_RESTORE_FD, "")); } gfarm_error_t gfm_client_restore_fd_result(struct gfm_connection *gfm_server) { return (gfm_client_rpc_result(gfm_server, 0, "")); } gfarm_error_t gfm_client_create_request(struct gfm_connection *gfm_server, const char *name, gfarm_uint32_t flags, gfarm_uint32_t mode) { return (gfm_client_rpc_request(gfm_server, GFM_PROTO_CREATE, "sii", name, flags, mode)); } gfarm_error_t gfm_client_create_result(struct gfm_connection *gfm_server, gfarm_ino_t *inump, gfarm_uint64_t *genp, gfarm_mode_t *modep) { return (gfm_client_rpc_result(gfm_server, 0, "lli", inump, genp, modep)); } gfarm_error_t gfm_client_open_request(struct gfm_connection *gfm_server, const char *name, size_t namelen, gfarm_uint32_t flags) { return (gfm_client_rpc_request(gfm_server, GFM_PROTO_OPEN, "Si", name, namelen, flags)); } gfarm_error_t gfm_client_open_result(struct gfm_connection *gfm_server, gfarm_ino_t *inump, gfarm_uint64_t *genp, gfarm_mode_t *modep) { return (gfm_client_rpc_result(gfm_server, 0, "lli", inump, genp, modep)); } gfarm_error_t gfm_client_open_root_request(struct gfm_connection *gfm_server, gfarm_uint32_t flags) { return (gfm_client_rpc_request(gfm_server, GFM_PROTO_OPEN_ROOT, "i", flags)); } gfarm_error_t gfm_client_open_root_result(struct gfm_connection *gfm_server) { return (gfm_client_rpc_result(gfm_server, 0, "")); } gfarm_error_t gfm_client_open_parernt_request(struct gfm_connection *gfm_server, gfarm_uint32_t flags) { return (gfm_client_rpc_request(gfm_server, GFM_PROTO_OPEN_PARENT, "i", flags)); } gfarm_error_t gfm_client_open_parent_result(struct gfm_connection *gfm_server) { return (gfm_client_rpc_result(gfm_server, 0, "")); } gfarm_error_t gfm_client_close_request(struct gfm_connection *gfm_server) { return (gfm_client_rpc_request(gfm_server, GFM_PROTO_CLOSE, "")); } gfarm_error_t gfm_client_close_result(struct gfm_connection *gfm_server) { return (gfm_client_rpc_result(gfm_server, 0, "")); } gfarm_error_t gfm_client_verify_type_request(struct gfm_connection *gfm_server, gfarm_int32_t type) { return (gfm_client_rpc_request(gfm_server, GFM_PROTO_VERIFY_TYPE, "i", type)); } gfarm_error_t gfm_client_verify_type_result(struct gfm_connection *gfm_server) { return (gfm_client_rpc_result(gfm_server, 0, "")); } gfarm_error_t gfm_client_verify_type_not_request(struct gfm_connection *gfm_server, gfarm_int32_t type) { return (gfm_client_rpc_request(gfm_server, GFM_PROTO_VERIFY_TYPE_NOT, "i", type)); } gfarm_error_t gfm_client_verify_type_not_result(struct gfm_connection *gfm_server) { return (gfm_client_rpc_result(gfm_server, 0, "")); } gfarm_error_t gfm_client_bequeath_fd_request(struct gfm_connection *gfm_server) { return (gfm_client_rpc_request(gfm_server, GFM_PROTO_BEQUEATH_FD, "")); } gfarm_error_t gfm_client_bequeath_fd_result(struct gfm_connection *gfm_server) { return (gfm_client_rpc_result(gfm_server, 0, "")); } gfarm_error_t gfm_client_inherit_fd_request(struct gfm_connection *gfm_server, gfarm_int32_t fd) { return (gfm_client_rpc_request(gfm_server, GFM_PROTO_INHERIT_FD, "i", fd)); } gfarm_error_t gfm_client_inherit_fd_result(struct gfm_connection *gfm_server) { return (gfm_client_rpc_result(gfm_server, 0, "")); } gfarm_error_t gfm_client_fstat_request(struct gfm_connection *gfm_server) { return (gfm_client_rpc_request(gfm_server, GFM_PROTO_FSTAT, "")); } gfarm_error_t gfm_client_fstat_result(struct gfm_connection *gfm_server, struct gfs_stat *st) { return (gfm_client_rpc_result(gfm_server, 0, "llilsslllilili", &st->st_ino, &st->st_gen, &st->st_mode, &st->st_nlink, &st->st_user, &st->st_group, &st->st_size, &st->st_ncopy, &st->st_atimespec.tv_sec, &st->st_atimespec.tv_nsec, &st->st_mtimespec.tv_sec, &st->st_mtimespec.tv_nsec, &st->st_ctimespec.tv_sec, &st->st_ctimespec.tv_nsec)); } gfarm_error_t gfm_client_fgetattrplus_request(struct gfm_connection *gfm_server, char **patterns, int npatterns, int flags) { gfarm_error_t e; int i; if ((e = gfm_client_rpc_request(gfm_server, GFM_PROTO_FGETATTRPLUS, "ii", flags, npatterns)) != GFARM_ERR_NO_ERROR) return (e); for (i = 0; i < npatterns; i++) { e = gfp_xdr_send(gfm_server->conn, "s", patterns[i]); if (IS_CONNECTION_ERROR(e)) gfm_client_purge_from_cache(gfm_server); if (e != GFARM_ERR_NO_ERROR) return (e); } return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfm_client_fgetattrplus_result(struct gfm_connection *gfm_server, struct gfs_stat *st, int *nattrsp, char ***attrnamesp, void ***attrvaluesp, size_t **attrsizesp) { gfarm_error_t e; int eof, j, nattrs; char **attrs; void **values; size_t *sizes; e = gfm_client_rpc_result(gfm_server, 0, "llilsslllililii", &st->st_ino, &st->st_gen, &st->st_mode, &st->st_nlink, &st->st_user, &st->st_group, &st->st_size, &st->st_ncopy, &st->st_atimespec.tv_sec, &st->st_atimespec.tv_nsec, &st->st_mtimespec.tv_sec, &st->st_mtimespec.tv_nsec, &st->st_ctimespec.tv_sec, &st->st_ctimespec.tv_nsec, &nattrs); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1002454, "gfm_client_fgetattrplus; gfm_client_rpc_result(): %s", gfarm_error_string(e)); return (e); } GFARM_CALLOC_ARRAY(attrs, nattrs); GFARM_CALLOC_ARRAY(values, nattrs); GFARM_CALLOC_ARRAY(sizes, nattrs); if (attrs == NULL || values == NULL || sizes == NULL) { /* XXX debug output */ nattrs = 0; free(attrs); free(values); free(sizes); attrs = NULL; values = NULL; sizes = NULL; } for (j = 0; j < nattrs; j++) { e = gfp_xdr_recv(gfm_server->conn, 0, &eof, "sB", &attrs[j], &sizes[j], &values[j]); if (IS_CONNECTION_ERROR(e)) gfm_client_purge_from_cache(gfm_server); if (e != GFARM_ERR_NO_ERROR || eof) { if (e == GFARM_ERR_NO_ERROR) e = GFARM_ERR_PROTOCOL; /* XXX memory leak */ gflog_debug(GFARM_MSG_1002455, "gfm_client_fgetattrplus: %s", gfarm_error_string(e)); nattrs = j; break; } } *nattrsp = nattrs; *attrnamesp = attrs; *attrvaluesp = values; *attrsizesp = sizes; return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfm_client_futimes_request(struct gfm_connection *gfm_server, gfarm_int64_t atime_sec, gfarm_int32_t atime_nsec, gfarm_int64_t mtime_sec, gfarm_int32_t mtime_nsec) { return (gfm_client_rpc_request(gfm_server, GFM_PROTO_FUTIMES, "lili", atime_sec, atime_nsec, mtime_sec, mtime_nsec)); } gfarm_error_t gfm_client_futimes_result(struct gfm_connection *gfm_server) { return (gfm_client_rpc_result(gfm_server, 0, "")); } gfarm_error_t gfm_client_fchmod_request(struct gfm_connection *gfm_server, gfarm_mode_t mode) { return (gfm_client_rpc_request(gfm_server, GFM_PROTO_FCHMOD, "i", mode)); } gfarm_error_t gfm_client_fchmod_result(struct gfm_connection *gfm_server) { return (gfm_client_rpc_result(gfm_server, 0, "")); } gfarm_error_t gfm_client_fchown_request(struct gfm_connection *gfm_server, const char *user, const char *group) { return (gfm_client_rpc_request(gfm_server, GFM_PROTO_FCHOWN, "ss", user == NULL ? "" : user, group == NULL ? "" : group)); } gfarm_error_t gfm_client_fchown_result(struct gfm_connection *gfm_server) { return (gfm_client_rpc_result(gfm_server, 0, "")); } gfarm_error_t gfm_client_cksum_get_request(struct gfm_connection *gfm_server) { return (gfm_client_rpc_request(gfm_server, GFM_PROTO_CKSUM_GET, "")); } gfarm_error_t gfm_client_cksum_get_result(struct gfm_connection *gfm_server, char **cksum_typep, size_t bufsize, size_t *cksum_lenp, char *cksum, gfarm_int32_t *flagsp) { return (gfm_client_rpc_result(gfm_server, 0, "sbi", cksum_typep, bufsize, cksum_lenp, cksum, flagsp)); } gfarm_error_t gfm_client_cksum_set_request(struct gfm_connection *gfm_server, char *cksum_type, size_t cksum_len, const char *cksum, gfarm_int32_t flags, gfarm_int64_t mtime_sec, gfarm_int32_t mtime_nsec) { return (gfm_client_rpc_request(gfm_server, GFM_PROTO_CKSUM_SET, "sbili", cksum_type, cksum_len, cksum, flags, mtime_sec, mtime_nsec)); } gfarm_error_t gfm_client_cksum_set_result(struct gfm_connection *gfm_server) { return (gfm_client_rpc_result(gfm_server, 0, "")); } void gfarm_host_sched_info_free(int nhosts, struct gfarm_host_sched_info *infos) { int i; for (i = 0; i < nhosts; i++) free(infos[i].host); free(infos); } /* this interface is exported for a use from a private extension */ gfarm_error_t gfm_client_get_schedule_result(struct gfm_connection *gfm_server, int *nhostsp, struct gfarm_host_sched_info **infosp) { gfarm_error_t e; gfarm_int32_t i, nhosts, loadavg; struct gfarm_host_sched_info *infos; int eof; if ((e = gfm_client_rpc_result(gfm_server, 0, "i", &nhosts)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001146, "gfm_client_rpc_result() failed: %s", gfarm_error_string(e)); return (e); } GFARM_MALLOC_ARRAY(infos, nhosts); if (infos == NULL) { /* XXX this breaks gfm protocol */ gflog_debug(GFARM_MSG_1001147, "allocation of array 'gfarm_host_sched_info' failed: %s", gfarm_error_string(GFARM_ERR_NO_MEMORY)); return (GFARM_ERR_NO_MEMORY); } for (i = 0; i < nhosts; i++) { e = gfp_xdr_recv(gfm_server->conn, 0, &eof, "siiillllii", &infos[i].host, &infos[i].port, &infos[i].ncpu, &loadavg, &infos[i].cache_time, &infos[i].disk_used, &infos[i].disk_avail, &infos[i].rtt_cache_time, &infos[i].rtt_usec, &infos[i].flags); if (IS_CONNECTION_ERROR(e)) gfm_client_purge_from_cache(gfm_server); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001148, "receiving host schedule response failed: %s", gfarm_error_string(e)); return (e); /* XXX */ } if (eof) { gflog_debug(GFARM_MSG_1001149, "Unexpected EOF when receiving " "host schedule: %s", gfarm_error_string(GFARM_ERR_PROTOCOL)); return (GFARM_ERR_PROTOCOL); /* XXX */ } infos[i].loadavg = (float)loadavg / GFM_PROTO_LOADAVG_FSCALE; } *nhostsp = nhosts; *infosp = infos; return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfm_client_schedule_file_request(struct gfm_connection *gfm_server, const char *domain) { return (gfm_client_rpc_request(gfm_server, GFM_PROTO_SCHEDULE_FILE, "s", domain)); } gfarm_error_t gfm_client_schedule_file_result(struct gfm_connection *gfm_server, int *nhostsp, struct gfarm_host_sched_info **infosp) { return (gfm_client_get_schedule_result(gfm_server, nhostsp, infosp)); } gfarm_error_t gfm_client_schedule_file_with_program_request( struct gfm_connection *gfm_server, const char *domain) { return (gfm_client_rpc_request(gfm_server, GFM_PROTO_SCHEDULE_FILE_WITH_PROGRAM, "s", domain)); } gfarm_error_t gfm_client_schedule_file_with_program_result(struct gfm_connection *gfm_server, int *nhostsp, struct gfarm_host_sched_info **infosp) { return (gfm_client_get_schedule_result(gfm_server, nhostsp, infosp)); } gfarm_error_t gfm_client_schedule_host_domain(struct gfm_connection *gfm_server, const char *domain, int *nhostsp, struct gfarm_host_sched_info **infosp) { gfarm_error_t e; e = gfm_client_rpc_request(gfm_server, GFM_PROTO_SCHEDULE_HOST_DOMAIN, "s", domain); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001150, "gfm_client_rpc() request failed: %s", gfarm_error_string(e)); return (e); } return (gfm_client_get_schedule_result(gfm_server, nhostsp, infosp)); } gfarm_error_t gfm_client_statfs(struct gfm_connection *gfm_server, gfarm_off_t *used, gfarm_off_t *avail, gfarm_off_t *files) { return (gfm_client_rpc(gfm_server, 0, GFM_PROTO_STATFS, "/lll", used, avail, files)); } gfarm_error_t gfm_client_remove_request(struct gfm_connection *gfm_server, const char *name) { return (gfm_client_rpc_request(gfm_server, GFM_PROTO_REMOVE, "s", name)); } gfarm_error_t gfm_client_remove_result(struct gfm_connection *gfm_server) { return (gfm_client_rpc_result(gfm_server, 0, "")); } gfarm_error_t gfm_client_rename_request(struct gfm_connection *gfm_server, const char *src_name, const char *target_name) { return (gfm_client_rpc_request(gfm_server, GFM_PROTO_RENAME, "ss", src_name, target_name)); } gfarm_error_t gfm_client_rename_result(struct gfm_connection *gfm_server) { return (gfm_client_rpc_result(gfm_server, 0, "")); } gfarm_error_t gfm_client_flink_request(struct gfm_connection *gfm_server, const char *target_name) { return (gfm_client_rpc_request(gfm_server, GFM_PROTO_FLINK, "s", target_name)); } gfarm_error_t gfm_client_flink_result(struct gfm_connection *gfm_server) { return (gfm_client_rpc_result(gfm_server, 0, "")); } gfarm_error_t gfm_client_mkdir_request(struct gfm_connection *gfm_server, const char *target_name, gfarm_mode_t mode) { return (gfm_client_rpc_request(gfm_server, GFM_PROTO_MKDIR, "si", target_name, mode)); } gfarm_error_t gfm_client_mkdir_result(struct gfm_connection *gfm_server) { return (gfm_client_rpc_result(gfm_server, 0, "")); } gfarm_error_t gfm_client_symlink_request(struct gfm_connection *gfm_server, const char *target_path, const char *link_name) { return (gfm_client_rpc_request(gfm_server, GFM_PROTO_SYMLINK, "ss", target_path, link_name)); } gfarm_error_t gfm_client_symlink_result(struct gfm_connection *gfm_server) { return (gfm_client_rpc_result(gfm_server, 0, "")); } gfarm_error_t gfm_client_readlink_request(struct gfm_connection *gfm_server) { return (gfm_client_rpc_request(gfm_server, GFM_PROTO_READLINK, "")); } gfarm_error_t gfm_client_readlink_result(struct gfm_connection *gfm_server, char **linkp) { return (gfm_client_rpc_result(gfm_server, 0, "s", linkp)); } gfarm_error_t gfm_client_getdirpath_request(struct gfm_connection *gfm_server) { return (gfm_client_rpc_request(gfm_server, GFM_PROTO_GETDIRPATH, "")); } gfarm_error_t gfm_client_getdirpath_result(struct gfm_connection *gfm_server, char **pathp) { return (gfm_client_rpc_result(gfm_server, 0, "s", pathp)); } gfarm_error_t gfm_client_getdirents_request(struct gfm_connection *gfm_server, gfarm_int32_t n_entries) { return (gfm_client_rpc_request(gfm_server, GFM_PROTO_GETDIRENTS, "i", n_entries)); } gfarm_error_t gfm_client_getdirents_result(struct gfm_connection *gfm_server, int *n_entriesp, struct gfs_dirent *dirents) { gfarm_error_t e; int eof, i; gfarm_int32_t n, type; size_t sz; e = gfm_client_rpc_result(gfm_server, 0, "i", &n); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001151, "gfm_client_rpc_result() failed: %s", gfarm_error_string(e)); return (e); } for (i = 0; i < n; i++) { e = gfp_xdr_recv(gfm_server->conn, 0, &eof, "bil", sizeof(dirents[i].d_name) - 1, &sz, dirents[i].d_name, &type, &dirents[i].d_fileno); if (IS_CONNECTION_ERROR(e)) gfm_client_purge_from_cache(gfm_server); if (e != GFARM_ERR_NO_ERROR || eof) { if (e == GFARM_ERR_NO_ERROR) e = GFARM_ERR_PROTOCOL; /* XXX memory leak */ gflog_debug(GFARM_MSG_1001152, "receiving getdireents response failed: %s", gfarm_error_string(e)); return (e); } if (sz >= sizeof(dirents[i].d_name) - 1) sz = sizeof(dirents[i].d_name) - 1; dirents[i].d_name[sz] = '\0'; dirents[i].d_namlen = sz; dirents[i].d_type = type; /* XXX */ dirents[i].d_reclen = sizeof(dirents[i]) - sizeof(dirents[i].d_name) + sz; } *n_entriesp = n; return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfm_client_getdirentsplus_request(struct gfm_connection *gfm_server, gfarm_int32_t n_entries) { return (gfm_client_rpc_request(gfm_server, GFM_PROTO_GETDIRENTSPLUS, "i", n_entries)); } gfarm_error_t gfm_client_getdirentsplus_result(struct gfm_connection *gfm_server, int *n_entriesp, struct gfs_dirent *dirents, struct gfs_stat *stv) { gfarm_error_t e; int eof, i; gfarm_int32_t n; size_t sz; e = gfm_client_rpc_result(gfm_server, 0, "i", &n); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001153, "gfm_client_rpc_result() failed: %s", gfarm_error_string(e)); return (e); } for (i = 0; i < n; i++) { struct gfs_stat *st = &stv[i]; e = gfp_xdr_recv(gfm_server->conn, 0, &eof, "bllilsslllilili", sizeof(dirents[i].d_name) - 1, &sz, dirents[i].d_name, &st->st_ino, &st->st_gen, &st->st_mode, &st->st_nlink, &st->st_user, &st->st_group, &st->st_size, &st->st_ncopy, &st->st_atimespec.tv_sec, &st->st_atimespec.tv_nsec, &st->st_mtimespec.tv_sec, &st->st_mtimespec.tv_nsec, &st->st_ctimespec.tv_sec, &st->st_ctimespec.tv_nsec); /* XXX st_user or st_group may be NULL */ if (IS_CONNECTION_ERROR(e)) gfm_client_purge_from_cache(gfm_server); if (e != GFARM_ERR_NO_ERROR || eof) { if (e == GFARM_ERR_NO_ERROR) e = GFARM_ERR_PROTOCOL; /* XXX memory leak */ gflog_debug(GFARM_MSG_1001154, "receiving getdirentsplus response failed: %s", gfarm_error_string(e)); return (e); } if (sz >= sizeof(dirents[i].d_name) - 1) sz = sizeof(dirents[i].d_name) - 1; dirents[i].d_name[sz] = '\0'; dirents[i].d_namlen = sz; dirents[i].d_type = gfs_mode_to_type(st->st_mode); /* XXX */ dirents[i].d_reclen = sizeof(dirents[i]) - sizeof(dirents[i].d_name) + sz; dirents[i].d_fileno = st->st_ino; } *n_entriesp = n; return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfm_client_getdirentsplusxattr_request(struct gfm_connection *gfm_server, gfarm_int32_t n_entries, char **patterns, int npatterns) { gfarm_error_t e; int i; if ((e = gfm_client_rpc_request(gfm_server, GFM_PROTO_GETDIRENTSPLUSXATTR, "ii", n_entries, npatterns)) != GFARM_ERR_NO_ERROR) return (e); for (i = 0; i < npatterns; i++) { e = gfp_xdr_send(gfm_server->conn, "s", patterns[i]); if (IS_CONNECTION_ERROR(e)) gfm_client_purge_from_cache(gfm_server); if (e != GFARM_ERR_NO_ERROR) return (e); } return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfm_client_getdirentsplusxattr_result(struct gfm_connection *gfm_server, int *n_entriesp, struct gfs_dirent *dirents, struct gfs_stat *stv, int *nattrsv, char ***attrsv, void ***valuesv, size_t **sizesv) { gfarm_error_t e; int eof, i, j, nattrs; gfarm_int32_t n; char **attrs; void **values; size_t sz, *sizes; e = gfm_client_rpc_result(gfm_server, 0, "i", &n); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001153, "gfm_client_rpc_result() failed: %s", gfarm_error_string(e)); return (e); } for (i = 0; i < n; i++) { struct gfs_stat *st = &stv[i]; e = gfp_xdr_recv(gfm_server->conn, 0, &eof, "bllilsslllililii", sizeof(dirents[i].d_name) - 1, &sz, dirents[i].d_name, &st->st_ino, &st->st_gen, &st->st_mode, &st->st_nlink, &st->st_user, &st->st_group, &st->st_size, &st->st_ncopy, &st->st_atimespec.tv_sec, &st->st_atimespec.tv_nsec, &st->st_mtimespec.tv_sec, &st->st_mtimespec.tv_nsec, &st->st_ctimespec.tv_sec, &st->st_ctimespec.tv_nsec, &nattrsv[i]); /* XXX st_user or st_group may be NULL */ if (IS_CONNECTION_ERROR(e)) gfm_client_purge_from_cache(gfm_server); if (e != GFARM_ERR_NO_ERROR || eof) { if (e == GFARM_ERR_NO_ERROR) e = GFARM_ERR_PROTOCOL; /* XXX memory leak */ gflog_debug(GFARM_MSG_1002456, "getdirentsplusxattr response: %s", gfarm_error_string(e)); return (e); } if (sz >= sizeof(dirents[i].d_name) - 1) sz = sizeof(dirents[i].d_name) - 1; dirents[i].d_name[sz] = '\0'; dirents[i].d_namlen = sz; dirents[i].d_type = gfs_mode_to_type(st->st_mode); /* XXX */ dirents[i].d_reclen = sizeof(dirents[i]) - sizeof(dirents[i].d_name) + sz; dirents[i].d_fileno = st->st_ino; nattrs = nattrsv[i]; GFARM_CALLOC_ARRAY(attrs, nattrs); GFARM_CALLOC_ARRAY(values, nattrs); GFARM_CALLOC_ARRAY(sizes, nattrs); if (attrs == NULL || values == NULL || sizes == NULL) { /* XXX debug output */ nattrs = 0; free(attrs); free(values); free(sizes); attrs = NULL; values = NULL; sizes = NULL; } for (j = 0; j < nattrs; j++) { e = gfp_xdr_recv(gfm_server->conn, 0, &eof, "sB", &attrs[j], &sizes[j], &values[j]); if (IS_CONNECTION_ERROR(e)) gfm_client_purge_from_cache(gfm_server); if (e != GFARM_ERR_NO_ERROR || eof) { if (e == GFARM_ERR_NO_ERROR) e = GFARM_ERR_PROTOCOL; /* XXX memory leak */ gflog_debug(GFARM_MSG_1002457, "getdirentsplusxattr xattr: %s", gfarm_error_string(e)); nattrs = j; break; } } nattrsv[i] = nattrs; attrsv[i] = attrs; sizesv[i] = sizes; valuesv[i] = values; } *n_entriesp = n; return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfm_client_seek_request(struct gfm_connection *gfm_server, gfarm_off_t offset, gfarm_int32_t whence) { return (gfm_client_rpc_request(gfm_server, GFM_PROTO_SEEK, "li", offset, whence)); } gfarm_error_t gfm_client_seek_result(struct gfm_connection *gfm_server, gfarm_off_t *offsetp) { return (gfm_client_rpc_result(gfm_server, 0, "l", offsetp)); } /* * quota */ static gfarm_error_t gfm_client_quota_get_common(struct gfm_connection *gfm_server, int proto, const char *name, struct gfarm_quota_get_info *qi) { return (gfm_client_rpc( gfm_server, 0, proto, "s/slllllllllllllllll", name, &qi->name, &qi->grace_period, &qi->space, &qi->space_grace, &qi->space_soft, &qi->space_hard, &qi->num, &qi->num_grace, &qi->num_soft, &qi->num_hard, &qi->phy_space, &qi->phy_space_grace, &qi->phy_space_soft, &qi->phy_space_hard, &qi->phy_num, &qi->phy_num_grace, &qi->phy_num_soft, &qi->phy_num_hard)); } static gfarm_error_t gfm_client_quota_set_common(struct gfm_connection *gfm_server, int proto, struct gfarm_quota_set_info *qi) { return (gfm_client_rpc( gfm_server, 0, proto, "slllllllll/", qi->name, qi->grace_period, qi->space_soft, qi->space_hard, qi->num_soft, qi->num_hard, qi->phy_space_soft, qi->phy_space_hard, qi->phy_num_soft, qi->phy_num_hard)); } gfarm_error_t gfm_client_quota_user_get(struct gfm_connection *gfm_server, const char *name, struct gfarm_quota_get_info *qi) { return (gfm_client_quota_get_common( gfm_server, GFM_PROTO_QUOTA_USER_GET, name, qi)); } gfarm_error_t gfm_client_quota_user_set(struct gfm_connection *gfm_server, struct gfarm_quota_set_info *qi) { return (gfm_client_quota_set_common( gfm_server, GFM_PROTO_QUOTA_USER_SET, qi)); } gfarm_error_t gfm_client_quota_group_get(struct gfm_connection *gfm_server, const char *name, struct gfarm_quota_get_info *qi) { return (gfm_client_quota_get_common( gfm_server, GFM_PROTO_QUOTA_GROUP_GET, name, qi)); } gfarm_error_t gfm_client_quota_group_set(struct gfm_connection *gfm_server, struct gfarm_quota_set_info *qi) { return (gfm_client_quota_set_common( gfm_server, GFM_PROTO_QUOTA_GROUP_SET, qi)); } gfarm_error_t gfm_client_quota_check(struct gfm_connection *gfm_server) { return (gfm_client_rpc(gfm_server, 0, GFM_PROTO_QUOTA_CHECK, "/")); } /* * extended attributes */ gfarm_error_t gfm_client_setxattr_request(struct gfm_connection *gfm_server, int xmlMode, const char *name, const void *value, size_t size, int flags) { int command = xmlMode ? GFM_PROTO_XMLATTR_SET : GFM_PROTO_XATTR_SET; return (gfm_client_rpc_request(gfm_server, command, "sbi", name, size, value, flags)); } gfarm_error_t gfm_client_setxattr_result(struct gfm_connection *gfm_server) { return (gfm_client_rpc_result(gfm_server, 0, "")); } gfarm_error_t gfm_client_getxattr_request(struct gfm_connection *gfm_server, int xmlMode, const char *name) { int command = xmlMode ? GFM_PROTO_XMLATTR_GET : GFM_PROTO_XATTR_GET; return (gfm_client_rpc_request(gfm_server, command, "s", name)); } gfarm_error_t gfm_client_getxattr_result(struct gfm_connection *gfm_server, int xmlMode, void **valuep, size_t *size) { gfarm_error_t e; e = gfm_client_rpc_result(gfm_server, 0, "B", size, valuep); if ((e == GFARM_ERR_NO_ERROR) && xmlMode) { // value is text with '\0', drop it (*size)--; } return e; } gfarm_error_t gfm_client_listxattr_request(struct gfm_connection *gfm_server, int xmlMode) { int command = xmlMode ? GFM_PROTO_XMLATTR_LIST : GFM_PROTO_XATTR_LIST; return (gfm_client_rpc_request(gfm_server, command, "")); } gfarm_error_t gfm_client_listxattr_result(struct gfm_connection *gfm_server, char **listp, size_t *size) { return (gfm_client_rpc_result(gfm_server, 0, "B", size, listp)); } gfarm_error_t gfm_client_removexattr_request(struct gfm_connection *gfm_server, int xmlMode, const char *name) { int command = xmlMode ? GFM_PROTO_XMLATTR_REMOVE : GFM_PROTO_XATTR_REMOVE; return (gfm_client_rpc_request(gfm_server, command, "s", name)); } gfarm_error_t gfm_client_removexattr_result(struct gfm_connection *gfm_server) { return (gfm_client_rpc_result(gfm_server, 0, "")); } gfarm_error_t gfm_client_findxmlattr_request(struct gfm_connection *gfm_server, struct gfs_xmlattr_ctx *ctxp) { char *path, *attrname; if (ctxp->cookie_path != NULL) { path = ctxp->cookie_path; attrname = ctxp->cookie_attrname; } else { path = attrname = ""; } return (gfm_client_rpc_request(gfm_server, GFM_PROTO_XMLATTR_FIND, "siiss", ctxp->expr, ctxp->depth, ctxp->nalloc, path, attrname)); } gfarm_error_t gfm_client_findxmlattr_result(struct gfm_connection *gfm_server, struct gfs_xmlattr_ctx *ctxp) { gfarm_error_t e; int i, eof; e = gfm_client_rpc_result(gfm_server, 0, "ii", &ctxp->eof, &ctxp->nvalid); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001155, "gfm_client_rpc_result() failed: %s", gfarm_error_string(e)); return (e); } if (ctxp->nvalid > ctxp->nalloc) { gflog_debug(GFARM_MSG_1001156, "ctx.nvalid > ctx.nalloc: %s", gfarm_error_string(GFARM_ERR_UNKNOWN)); return GFARM_ERR_UNKNOWN; } for (i = 0; i < ctxp->nvalid; i++) { e = gfp_xdr_recv(gfm_server->conn, 0, &eof, "ss", &ctxp->entries[i].path, &ctxp->entries[i].attrname); if (IS_CONNECTION_ERROR(e)) gfm_client_purge_from_cache(gfm_server); if (e != GFARM_ERR_NO_ERROR || eof) { if (e == GFARM_ERR_NO_ERROR) e = GFARM_ERR_PROTOCOL; gflog_debug(GFARM_MSG_1001157, "receiving ctx.entries response failed: %s", gfarm_error_string(e)); return (e); } } if ((ctxp->eof == 0) && (ctxp->nvalid > 0)) { free(ctxp->cookie_path); free(ctxp->cookie_attrname); ctxp->cookie_path = strdup(ctxp->entries[ctxp->nvalid-1].path); ctxp->cookie_attrname = strdup(ctxp->entries[ctxp->nvalid-1].attrname); if ((ctxp->cookie_path == NULL) || (ctxp->cookie_attrname == NULL)) { gflog_debug(GFARM_MSG_1001158, "allocation of 'ctx.cookie_path' or " "'cookie_attrname' failed: %s", gfarm_error_string(GFARM_ERR_NO_MEMORY)); return GFARM_ERR_NO_MEMORY; } } return (GFARM_ERR_NO_ERROR); } /* * gfs from gfsd */ gfarm_error_t gfm_client_reopen_request(struct gfm_connection *gfm_server) { return (gfm_client_rpc_request(gfm_server, GFM_PROTO_REOPEN, "")); } gfarm_error_t gfm_client_reopen_result(struct gfm_connection *gfm_server, gfarm_ino_t *ino_p, gfarm_uint64_t *gen_p, gfarm_int32_t *modep, gfarm_int32_t *flagsp, gfarm_int32_t *to_create_p) { return (gfm_client_rpc_result(gfm_server, 0, "lliii", ino_p, gen_p, modep, flagsp, to_create_p)); } gfarm_error_t gfm_client_close_read_request(struct gfm_connection *gfm_server, gfarm_int64_t atime_sec, gfarm_int32_t atime_nsec) { return (gfm_client_rpc_request(gfm_server, GFM_PROTO_CLOSE_READ, "li", atime_sec, atime_nsec)); } gfarm_error_t gfm_client_close_read_result(struct gfm_connection *gfm_server) { return (gfm_client_rpc_result(gfm_server, 0, "")); } #ifdef COMPAT_GFARM_2_3 gfarm_error_t gfm_client_close_write_request(struct gfm_connection *gfm_server, gfarm_off_t size, gfarm_int64_t atime_sec, gfarm_int32_t atime_nsec, gfarm_int64_t mtime_sec, gfarm_int32_t mtime_nsec) { return (gfm_client_rpc_request(gfm_server, GFM_PROTO_CLOSE_WRITE, "llili", size, atime_sec, atime_nsec, mtime_sec, mtime_nsec)); } gfarm_error_t gfm_client_close_write_result(struct gfm_connection *gfm_server) { return (gfm_client_rpc_result(gfm_server, 0, "")); } #endif gfarm_error_t gfm_client_close_write_v2_4_request(struct gfm_connection *gfm_server, gfarm_off_t size, gfarm_int64_t atime_sec, gfarm_int32_t atime_nsec, gfarm_int64_t mtime_sec, gfarm_int32_t mtime_nsec) { return (gfm_client_rpc_request(gfm_server, GFM_PROTO_CLOSE_WRITE_V2_4, "llili", size, atime_sec, atime_nsec, mtime_sec, mtime_nsec)); } gfarm_error_t gfm_client_close_write_v2_4_result(struct gfm_connection *gfm_server, gfarm_int32_t *flagsp, gfarm_int64_t *old_igenp, gfarm_int64_t *new_igenp) { return (gfm_client_rpc_result(gfm_server, 0, "ill", flagsp, old_igenp, new_igenp)); } gfarm_error_t gfm_client_generation_updated_request(struct gfm_connection *gfm_server, gfarm_int32_t errcode) { return (gfm_client_rpc_request(gfm_server, GFM_PROTO_GENERATION_UPDATED, "i", errcode)); } gfarm_error_t gfm_client_generation_updated_result(struct gfm_connection *gfm_server) { return (gfm_client_rpc_result(gfm_server, 0, "")); } gfarm_error_t gfm_client_lock_request(struct gfm_connection *gfm_server, gfarm_off_t start, gfarm_off_t len, gfarm_int32_t type, gfarm_int32_t whence) { return (gfm_client_rpc_request(gfm_server, GFM_PROTO_LOCK, "llii", start, len, type, whence)); } gfarm_error_t gfm_client_lock_result(struct gfm_connection *gfm_server) { return (gfm_client_rpc_result(gfm_server, 0, "")); } gfarm_error_t gfm_client_trylock_request(struct gfm_connection *gfm_server, gfarm_off_t start, gfarm_off_t len, gfarm_int32_t type, gfarm_int32_t whence) { return (gfm_client_rpc_request(gfm_server, GFM_PROTO_TRYLOCK, "llii", start, len, type, whence)); } gfarm_error_t gfm_client_trylock_result(struct gfm_connection *gfm_server) { return (gfm_client_rpc_result(gfm_server, 0, "")); } gfarm_error_t gfm_client_unlock_request(struct gfm_connection *gfm_server, gfarm_off_t start, gfarm_off_t len, gfarm_int32_t type, gfarm_int32_t whence) { return (gfm_client_rpc_request(gfm_server, GFM_PROTO_UNLOCK, "llii", start, len, type, whence)); } gfarm_error_t gfm_client_unlock_result(struct gfm_connection *gfm_server) { return (gfm_client_rpc_result(gfm_server, 0, "")); } gfarm_error_t gfm_client_lock_info_request(struct gfm_connection *gfm_server, gfarm_off_t start, gfarm_off_t len, gfarm_int32_t type, gfarm_int32_t whence) { return (gfm_client_rpc_request(gfm_server, GFM_PROTO_LOCK_INFO, "llii", start, len, type, whence)); } gfarm_error_t gfm_client_lock_info_result(struct gfm_connection *gfm_server, gfarm_off_t *startp, gfarm_off_t *lenp, gfarm_int32_t *typep, char **hostp, gfarm_pid_t *pidp) { return (gfm_client_rpc_result(gfm_server, 0, "llisl", startp, lenp, typep, hostp, pidp)); } #if 1 /* should be 0, since gfmd has to be newer than gfsd */ gfarm_error_t gfm_client_switch_back_channel(struct gfm_connection *gfm_server) { return (gfm_client_rpc(gfm_server, 0, GFM_PROTO_SWITCH_BACK_CHANNEL, "/")); } #endif static struct protoent *gfm_tcp_proto = NULL; static void gfm_tcp_proto_initialize(void) { gfm_tcp_proto = getprotobyname("tcp"); } gfarm_error_t gfm_client_switch_async_back_channel(struct gfm_connection *gfm_server, gfarm_int32_t version, gfarm_int64_t gfsd_cookie, gfarm_int32_t *gfmd_knows_me_p) { gfarm_error_t e = gfm_client_rpc(gfm_server, 0, GFM_PROTO_SWITCH_ASYNC_BACK_CHANNEL, "il/i", version, gfsd_cookie, gfmd_knows_me_p); int v = 1; static pthread_once_t gfm_tcp_proto_initialized = PTHREAD_ONCE_INIT; if (e != GFARM_ERR_NO_ERROR) return (e); pthread_once(&gfm_tcp_proto_initialized, gfm_tcp_proto_initialize); if (gfm_tcp_proto == NULL) { gflog_error(GFARM_MSG_1002414, "getprotobyname(\"tcp\") failed, slower back channel"); } else if (setsockopt(gfp_xdr_fd(gfm_server->conn), gfm_tcp_proto->p_proto, TCP_NODELAY, &v, sizeof(v)) == -1) { gflog_error_errno(GFARM_MSG_1002415, "setting TCP_NODELAY failed, slower back channel"); } return (GFARM_ERR_NO_ERROR); } /* * gfs_pio from client */ gfarm_error_t gfm_client_glob(struct gfm_connection *gfm_server) { /* XXX - NOT IMPLEMENTED */ gflog_debug(GFARM_MSG_1001159, "Not implemented: %s", gfarm_error_string(GFARM_ERR_FUNCTION_NOT_IMPLEMENTED)); return (GFARM_ERR_FUNCTION_NOT_IMPLEMENTED); } gfarm_error_t gfm_client_schedule(struct gfm_connection *gfm_server) { /* XXX - NOT IMPLEMENTED */ gflog_debug(GFARM_MSG_1001160, "Not implemented: %s", gfarm_error_string(GFARM_ERR_FUNCTION_NOT_IMPLEMENTED)); return (GFARM_ERR_FUNCTION_NOT_IMPLEMENTED); } gfarm_error_t gfm_client_pio_open(struct gfm_connection *gfm_server) { /* XXX - NOT IMPLEMENTED */ gflog_debug(GFARM_MSG_1001161, "Not implemented: %s", gfarm_error_string(GFARM_ERR_FUNCTION_NOT_IMPLEMENTED)); return (GFARM_ERR_FUNCTION_NOT_IMPLEMENTED); } gfarm_error_t gfm_client_pio_set_paths(struct gfm_connection *gfm_server) { /* XXX - NOT IMPLEMENTED */ gflog_debug(GFARM_MSG_1001162, "Not implemented: %s", gfarm_error_string(GFARM_ERR_FUNCTION_NOT_IMPLEMENTED)); return (GFARM_ERR_FUNCTION_NOT_IMPLEMENTED); } gfarm_error_t gfm_client_pio_close(struct gfm_connection *gfm_server) { /* XXX - NOT IMPLEMENTED */ gflog_debug(GFARM_MSG_1001163, "Not implemented: %s", gfarm_error_string(GFARM_ERR_FUNCTION_NOT_IMPLEMENTED)); return (GFARM_ERR_FUNCTION_NOT_IMPLEMENTED); } gfarm_error_t gfm_client_pio_visit(struct gfm_connection *gfm_server) { /* XXX - NOT IMPLEMENTED */ gflog_debug(GFARM_MSG_1001164, "Not implemented: %s", gfarm_error_string(GFARM_ERR_FUNCTION_NOT_IMPLEMENTED)); return (GFARM_ERR_FUNCTION_NOT_IMPLEMENTED); } /* * misc operations from gfsd */ gfarm_error_t gfm_client_hostname_set(struct gfm_connection *gfm_server, char *hostname) { return (gfm_client_rpc(gfm_server, 0, GFM_PROTO_HOSTNAME_SET, "s/", hostname)); } /* * replica management from client */ gfarm_error_t gfm_client_replica_list_by_name_request(struct gfm_connection *gfm_server) { return (gfm_client_rpc_request(gfm_server, GFM_PROTO_REPLICA_LIST_BY_NAME, "")); } gfarm_error_t gfm_client_replica_list_by_name_result(struct gfm_connection *gfm_server, gfarm_int32_t *n_replicasp, char ***replica_hosts) { gfarm_error_t e; int eof, i; gfarm_int32_t n; char **hosts; e = gfm_client_rpc_result(gfm_server, 0, "i", &n); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001165, "gfm_client_rpc_result() failed: %s", gfarm_error_string(e)); return (e); } GFARM_MALLOC_ARRAY(hosts, n); if (hosts == NULL) { gflog_debug(GFARM_MSG_1001166, "allocation of array 'hosts' failed: %s", gfarm_error_string(GFARM_ERR_NO_MEMORY)); return (GFARM_ERR_NO_MEMORY); /* XXX not graceful */ } for (i = 0; i < n; i++) { e = gfp_xdr_recv(gfm_server->conn, 0, &eof, "s", &hosts[i]); if (IS_CONNECTION_ERROR(e)) gfm_client_purge_from_cache(gfm_server); if (e != GFARM_ERR_NO_ERROR || eof) { if (e == GFARM_ERR_NO_ERROR) e = GFARM_ERR_PROTOCOL; gflog_debug(GFARM_MSG_1001167, "receiving host response failed: %s", gfarm_error_string(e)); break; } } if (i < n) { for (; i >= 0; --i) free(hosts[i]); free(hosts); return (e); } *n_replicasp = n; *replica_hosts = hosts; return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfm_client_replica_list_by_host_request(struct gfm_connection *gfm_server, const char *host, gfarm_int32_t port) { return (gfm_client_rpc_request(gfm_server, GFM_PROTO_REPLICA_LIST_BY_HOST, "si", host, port)); } gfarm_error_t gfm_client_replica_list_by_host_result(struct gfm_connection *gfm_server, gfarm_int32_t *n_replicasp, gfarm_ino_t **inodesp) { gfarm_error_t e; int eof, i; gfarm_int32_t n; gfarm_ino_t *inodes; e = gfm_client_rpc_result(gfm_server, 0, "i", &n); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001168, "gfm_client_rpc_result() failed: %s", gfarm_error_string(e)); return (e); } GFARM_MALLOC_ARRAY(inodes, n); if (inodes == NULL) { gflog_debug(GFARM_MSG_1001169, "allocation of array 'inodes' failed: %s", gfarm_error_string(GFARM_ERR_NO_MEMORY)); return (GFARM_ERR_NO_MEMORY); /* XXX not graceful */ } for (i = 0; i < n; i++) { e = gfp_xdr_recv(gfm_server->conn, 0, &eof, "l", &inodes[i]); if (IS_CONNECTION_ERROR(e)) gfm_client_purge_from_cache(gfm_server); if (e != GFARM_ERR_NO_ERROR || eof) { if (e == GFARM_ERR_NO_ERROR) e = GFARM_ERR_PROTOCOL; free(inodes); gflog_debug(GFARM_MSG_1001170, "receiving inode response failed: %s", gfarm_error_string(e)); return (e); } } *n_replicasp = n; *inodesp = inodes; return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfm_client_replica_remove_by_host_request(struct gfm_connection *gfm_server, const char *host, gfarm_int32_t port) { return (gfm_client_rpc_request(gfm_server, GFM_PROTO_REPLICA_REMOVE_BY_HOST, "si", host, port)); } gfarm_error_t gfm_client_replica_remove_by_host_result(struct gfm_connection *gfm_server) { return (gfm_client_rpc_result(gfm_server, 0, "")); } gfarm_error_t gfm_client_replica_remove_by_file_request(struct gfm_connection *gfm_server, const char *host) { return (gfm_client_rpc_request(gfm_server, GFM_PROTO_REPLICA_REMOVE_BY_FILE, "s", host)); } gfarm_error_t gfm_client_replica_remove_by_file_result(struct gfm_connection *gfm_server) { return (gfm_client_rpc_result(gfm_server, 0, "")); } gfarm_error_t gfm_client_replica_info_get_request(struct gfm_connection *gfm_server, gfarm_int32_t flags) { return (gfm_client_rpc_request(gfm_server, GFM_PROTO_REPLICA_INFO_GET, "i", flags)); } gfarm_error_t gfm_client_replica_info_get_result(struct gfm_connection *gfm_server, gfarm_int32_t *np, char ***hostsp, gfarm_uint64_t **gensp, gfarm_int32_t **flagsp) { gfarm_error_t e; int eof, i; gfarm_int32_t n; char **hosts; gfarm_uint64_t *gens; gfarm_int32_t *flags; e = gfm_client_rpc_result(gfm_server, 0, "i", &n); if (e != GFARM_ERR_NO_ERROR) return (e); GFARM_MALLOC_ARRAY(hosts, n); if (hosts == NULL) return (GFARM_ERR_NO_MEMORY); /* XXX not graceful */ GFARM_MALLOC_ARRAY(gens, n); if (gens == NULL) { free(hosts); return (GFARM_ERR_NO_MEMORY); /* XXX not graceful */ } GFARM_MALLOC_ARRAY(flags, n); if (flags == NULL) { free(gens); free(hosts); return (GFARM_ERR_NO_MEMORY); /* XXX not graceful */ } for (i = 0; i < n; i++) { e = gfp_xdr_recv(gfm_server->conn, 0, &eof, "sli", &hosts[i], &gens[i], &flags[i]); if (IS_CONNECTION_ERROR(e)) gfm_client_purge_from_cache(gfm_server); if (e != GFARM_ERR_NO_ERROR || eof) { if (e == GFARM_ERR_NO_ERROR) e = GFARM_ERR_PROTOCOL; break; } } if (i < n) { for (; i >= 0; --i) free(hosts[i]); free(flags); free(gens); free(hosts); return (e); } *np = n; *hostsp = hosts; *gensp = gens; *flagsp = flags; return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfm_client_replicate_file_from_to_request(struct gfm_connection *gfm_server, const char *srchost, const char *dsthost, gfarm_int32_t flags) { return (gfm_client_rpc_request(gfm_server, GFM_PROTO_REPLICATE_FILE_FROM_TO, "ssi", srchost, dsthost, flags)); } gfarm_error_t gfm_client_replicate_file_from_to_result(struct gfm_connection *gfm_server) { return (gfm_client_rpc_result(gfm_server, 0, "")); } gfarm_error_t gfm_client_replicate_file_to_request(struct gfm_connection *gfm_server, const char *dsthost, gfarm_int32_t flags) { return (gfm_client_rpc_request(gfm_server, GFM_PROTO_REPLICATE_FILE_TO, "si", dsthost, flags)); } gfarm_error_t gfm_client_replicate_file_to_result(struct gfm_connection *gfm_server) { return (gfm_client_rpc_result(gfm_server, 0, "")); } /* * replica management from gfsd */ gfarm_error_t gfm_client_replica_adding_request(struct gfm_connection *gfm_server, char *src_host) { return (gfm_client_rpc_request(gfm_server, GFM_PROTO_REPLICA_ADDING, "s", src_host)); } gfarm_error_t gfm_client_replica_adding_result(struct gfm_connection *gfm_server, gfarm_ino_t *ino_p, gfarm_uint64_t *gen_p, gfarm_int64_t *mtime_secp, gfarm_int32_t *mtime_nsecp) { return (gfm_client_rpc_result(gfm_server, 0, "llli", ino_p, gen_p, mtime_secp, mtime_nsecp)); } gfarm_error_t gfm_client_replica_added_request(struct gfm_connection *gfm_server, gfarm_int32_t flags, gfarm_int64_t mtime_sec, gfarm_int32_t mtime_nsec) { return (gfm_client_rpc_request(gfm_server, GFM_PROTO_REPLICA_ADDED, "ili", flags, mtime_sec, mtime_nsec)); } gfarm_error_t gfm_client_replica_added2_request(struct gfm_connection *gfm_server, gfarm_int32_t flags, gfarm_int64_t mtime_sec, gfarm_int32_t mtime_nsec, gfarm_off_t size) { return (gfm_client_rpc_request(gfm_server, GFM_PROTO_REPLICA_ADDED2, "ilil", flags, mtime_sec, mtime_nsec, size)); } gfarm_error_t gfm_client_replica_added_result(struct gfm_connection *gfm_server) { return (gfm_client_rpc_result(gfm_server, 0, "")); } gfarm_error_t gfm_client_replica_lost_request(struct gfm_connection *gfm_server, gfarm_ino_t inum, gfarm_uint64_t gen) { return (gfm_client_rpc_request(gfm_server, GFM_PROTO_REPLICA_LOST, "ll", inum, gen)); } gfarm_error_t gfm_client_replica_lost_result(struct gfm_connection *gfm_server) { return (gfm_client_rpc_result(gfm_server, 0, "")); } gfarm_error_t gfm_client_replica_add_request(struct gfm_connection *gfm_server, gfarm_ino_t inum, gfarm_uint64_t gen, gfarm_off_t size) { return (gfm_client_rpc_request(gfm_server, GFM_PROTO_REPLICA_ADD, "lll", inum, gen, size)); } gfarm_error_t gfm_client_replica_add_result(struct gfm_connection *gfm_server) { return (gfm_client_rpc_result(gfm_server, 0, "")); } /* * process management */ gfarm_error_t gfm_client_process_alloc(struct gfm_connection *gfm_server, gfarm_int32_t keytype, const char *sharedkey, size_t sharedkey_size, gfarm_pid_t *pidp) { return (gfm_client_rpc(gfm_server, 0, GFM_PROTO_PROCESS_ALLOC, "ib/l", keytype, sharedkey_size, sharedkey, pidp)); } gfarm_error_t gfm_client_process_alloc_child(struct gfm_connection *gfm_server, gfarm_int32_t parent_keytype, const char *parent_sharedkey, size_t parent_sharedkey_size, gfarm_pid_t parent_pid, gfarm_int32_t keytype, const char *sharedkey, size_t sharedkey_size, gfarm_pid_t *pidp) { return (gfm_client_rpc(gfm_server, 0, GFM_PROTO_PROCESS_ALLOC_CHILD, "iblib/l", parent_keytype, parent_sharedkey_size, parent_sharedkey, parent_pid, keytype, sharedkey_size, sharedkey, pidp)); } gfarm_error_t gfm_client_process_free(struct gfm_connection *gfm_server) { return (gfm_client_rpc(gfm_server, 0, GFM_PROTO_PROCESS_FREE, "")); } gfarm_error_t gfm_client_process_set(struct gfm_connection *gfm_server, gfarm_int32_t keytype, const char *sharedkey, size_t sharedkey_size, gfarm_pid_t pid) { gfarm_error_t e; if (keytype != GFM_PROTO_PROCESS_KEY_TYPE_SHAREDSECRET || sharedkey_size != GFM_PROTO_PROCESS_KEY_LEN_SHAREDSECRET) { gflog_error(GFARM_MSG_1000061, "gfm_client_process_set: type=%d, size=%d: " "programming error", (int)keytype, (int)sharedkey_size); return (GFARM_ERR_INVALID_ARGUMENT); } e = gfm_client_rpc(gfm_server, 0, GFM_PROTO_PROCESS_SET, "ibl/", keytype, sharedkey_size, sharedkey, pid); if (e == GFARM_ERR_NO_ERROR) { memcpy(gfm_server->pid_key, sharedkey, sharedkey_size); gfm_server->pid = pid; } else { gflog_debug(GFARM_MSG_1001171, "gfm_client_rpc() failed: %s", gfarm_error_string(e)); } return (e); } /* * compound request - convenience function */ gfarm_error_t gfm_client_compound_fd_op(struct gfm_connection *gfm_server, gfarm_int32_t fd, gfarm_error_t (*request_op)(struct gfm_connection *, void *), gfarm_error_t (*result_op)(struct gfm_connection *, void *), void (*cleanup_op)(struct gfm_connection *, void *), void *closure) { gfarm_error_t e; if ((e = gfm_client_compound_begin_request(gfm_server)) != GFARM_ERR_NO_ERROR) gflog_warning(GFARM_MSG_1000062, "compound_begin request: %s", gfarm_error_string(e)); else if ((e = gfm_client_put_fd_request(gfm_server, fd)) != GFARM_ERR_NO_ERROR) gflog_warning(GFARM_MSG_1000063, "put_fd request: %s", gfarm_error_string(e)); else if ((e = (*request_op)(gfm_server, closure)) != GFARM_ERR_NO_ERROR) ; else if ((e = gfm_client_compound_end_request(gfm_server)) != GFARM_ERR_NO_ERROR) gflog_warning(GFARM_MSG_1000064, "compound_end request: %s", gfarm_error_string(e)); else if ((e = gfm_client_compound_begin_result(gfm_server)) != GFARM_ERR_NO_ERROR) gflog_warning(GFARM_MSG_1000065, "compound_begin result: %s", gfarm_error_string(e)); else if ((e = gfm_client_put_fd_result(gfm_server)) != GFARM_ERR_NO_ERROR) gflog_warning(GFARM_MSG_1000066, "put_fd result: %s", gfarm_error_string(e)); else if ((e = (*result_op)(gfm_server, closure)) != GFARM_ERR_NO_ERROR) ; else if ((e = gfm_client_compound_end_result(gfm_server)) != GFARM_ERR_NO_ERROR) { gflog_warning(GFARM_MSG_1000067, "compound_end result: %s", gfarm_error_string(e)); if (cleanup_op != NULL) (*cleanup_op)(gfm_server, closure); } return (e); } #if 0 /* not used in gfarm v2 */ /* * job management */ gfarm_error_t gfj_client_lock_register(struct gfm_connection *gfm_server) { return (gfm_client_rpc(gfm_server, 0, GFJ_PROTO_LOCK_REGISTER, "/")); } gfarm_error_t gfj_client_unlock_register(struct gfm_connection *gfm_server) { return (gfm_client_rpc(gfm_server, 0, GFJ_PROTO_UNLOCK_REGISTER, "/")); } gfarm_error_t gfj_client_register(struct gfm_connection *gfm_server, struct gfarm_job_info *job, int flags, int *job_idp) { gfarm_error_t e; int i; gfarm_int32_t job_id; e = gfm_client_rpc_request(gfm_server, GFJ_PROTO_REGISTER, "iisssi", (gfarm_int32_t)flags, (gfarm_int32_t)job->total_nodes, job->job_type, job->originate_host, job->gfarm_url_for_scheduling, (gfarm_int32_t)job->argc); if (e != GFARM_ERR_NO_ERROR) return (e); for (i = 0; i < job->argc; i++) e = gfp_xdr_send(gfm_server->conn, "s", job->argv[i]); for (i = 0; i < job->total_nodes; i++) e = gfp_xdr_send(gfm_server->conn, "s", job->nodes[i].hostname); e = gfm_client_rpc_result(gfm_server, 0, "i", &job_id); if (e == GFARM_ERR_NO_ERROR) *job_idp = job_id; return (e); } gfarm_error_t gfj_client_unregister(struct gfm_connection *gfm_server, int job_id) { return (gfm_client_rpc(gfm_server, 0, GFJ_PROTO_UNREGISTER, "i/", job_id)); } gfarm_error_t gfj_client_list(struct gfm_connection *gfm_server, char *user, int *np, int **jobsp) { gfarm_error_t e; int i, n, eof, *jobs; gfarm_int32_t job_id; e = gfm_client_rpc(gfm_server, 0, GFJ_PROTO_LIST, "s/i", user, &n); if (e != GFARM_ERR_NO_ERROR) return (e); GFARM_MALLOC_ARRAY(jobs, n); if (jobs == NULL) return (GFARM_ERR_NO_MEMORY); for (i = 0; i < n; i++) { e = gfp_xdr_recv(gfm_server->conn, 0, &eof, "i", &job_id); if (e != GFARM_ERR_NO_ERROR) { free(jobs); return (e); } if (eof) { free(jobs); return (GFARM_ERR_PROTOCOL); } jobs[i] = job_id; } *np = n; *jobsp = jobs; return (GFARM_ERR_NO_ERROR); } static gfarm_error_t gfj_client_info_entry(struct gfp_xdr *conn, struct gfarm_job_info *info) { gfarm_error_t e; int eof, i; gfarm_int32_t total_nodes, argc, node_pid, node_state; e = gfp_xdr_recv(conn, 0, &eof, "issssi", &total_nodes, &info->user, &info->job_type, &info->originate_host, &info->gfarm_url_for_scheduling, &argc); if (e != GFARM_ERR_NO_ERROR) return (e); if (eof) return (GFARM_ERR_PROTOCOL); GFARM_MALLOC_ARRAY(info->argv, argc + 1); GFARM_MALLOC_ARRAY(info->nodes, total_nodes); if (info->argv == NULL || info->nodes == NULL) { free(info->job_type); free(info->originate_host); free(info->gfarm_url_for_scheduling); if (info->argv != NULL) free(info->argv); if (info->nodes != NULL) free(info->nodes); return (GFARM_ERR_NO_MEMORY); } for (i = 0; i < argc; i++) { e = gfp_xdr_recv(conn, 0, &eof, "s", &info->argv[i]); if (e != GFARM_ERR_NO_ERROR || eof) { if (e == GFARM_ERR_NO_ERROR) e = GFARM_ERR_PROTOCOL; while (--i >= 0) free(info->argv[i]); free(info->job_type); free(info->originate_host); free(info->gfarm_url_for_scheduling); free(info->argv); free(info->nodes); return (e); } } info->argv[argc] = NULL; for (i = 0; i < total_nodes; i++) { e = gfp_xdr_recv(conn, 0, &eof, "sii", &info->nodes[i].hostname, &node_pid, &node_state); if (e != GFARM_ERR_NO_ERROR || eof) { if (e == GFARM_ERR_NO_ERROR) e = GFARM_ERR_PROTOCOL; while (--i >= 0) free(info->nodes[i].hostname); for (i = 0; i < argc; i++) free(info->argv[i]); free(info->job_type); free(info->originate_host); free(info->gfarm_url_for_scheduling); free(info->argv); free(info->nodes); return (e); } info->nodes[i].pid = node_pid; info->nodes[i].state = node_state; } info->total_nodes = total_nodes; info->argc = argc; return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfj_client_info(struct gfm_connection *gfm_server, int n, int *jobs, struct gfarm_job_info *infos) { gfarm_error_t e; int i; e = gfm_client_rpc_request(gfm_server, GFJ_PROTO_INFO, "i", n); if (e != GFARM_ERR_NO_ERROR) return (e); for (i = 0; i < n; i++) { e = gfp_xdr_send(gfm_server->conn, "i", (gfarm_int32_t)jobs[i]); if (e != GFARM_ERR_NO_ERROR) return (e); } gfarm_job_info_clear(infos, n); for (i = 0; i < n; i++) { e = gfm_client_rpc_result(gfm_server, 0, ""); if (e == GFARM_ERR_NO_SUCH_OBJECT) continue; if (e == GFARM_ERR_NO_ERROR) e = gfj_client_info_entry(gfm_server->conn, &infos[i]); if (e != GFARM_ERR_NO_ERROR) { gfarm_job_info_free_contents(infos, i - 1); return (e); } } return (GFARM_ERR_NO_ERROR); } void gfarm_job_info_clear(struct gfarm_job_info *infos, int n) { memset(infos, 0, sizeof(struct gfarm_job_info) * n); } void gfarm_job_info_free_contents(struct gfarm_job_info *infos, int n) { int i, j; struct gfarm_job_info *info; for (i = 0; i < n; i++) { info = &infos[i]; if (info->user == NULL) /* this entry is not valid */ continue; free(info->user); free(info->job_type); free(info->originate_host); free(info->gfarm_url_for_scheduling); for (j = 0; j < info->argc; j++) free(info->argv[j]); free(info->argv); for (j = 0; j < info->total_nodes; j++) free(info->nodes[j].hostname); free(info->nodes); } } /* * job management - convenience function */ gfarm_error_t gfarm_user_job_register(struct gfm_connection *gfm_server, int nusers, char **users, char *job_type, char *sched_file, int argc, char **argv, int *job_idp) { gfarm_error_t e; int i, p; struct gfarm_job_info job_info; gfarm_job_info_clear(&job_info, 1); job_info.total_nodes = nusers; job_info.user = gfarm_get_global_username(); job_info.job_type = job_type; e = gfm_host_get_canonical_self_name(gfm_server, &job_info.originate_host, &p); if (e == GFARM_ERR_UNKNOWN_HOST) { /* * gfarm client doesn't have to be a compute user, * so, we should allow non canonical name here. */ job_info.originate_host = gfarm_host_get_self_name(); } else if (e != GFARM_ERR_NO_ERROR) return (e); job_info.gfarm_url_for_scheduling = sched_file; job_info.argc = argc; job_info.argv = argv; GFARM_MALLOC_ARRAY(job_info.nodes, nusers); if (job_info.nodes == NULL) return (GFARM_ERR_NO_MEMORY); for (i = 0; i < nusers; i++) { e = gfm_host_get_canonical_name(gfm_server, users[i], &job_info.nodes[i].hostname, &p); if (e != GFARM_ERR_NO_ERROR) { while (--i >= 0) free(job_info.nodes[i].hostname); free(job_info.nodes); return (e); } } e = gfj_client_register(gfm_server, &job_info, 0, job_idp); for (i = 0; i < nusers; i++) free(job_info.nodes[i].hostname); free(job_info.nodes); return (e); } #endif gfarm-2.4.1/lib/libgfarm/gfarm/gfs_io.h0000644000000000000000000000045511507222724016362 0ustar rootroot/* XXX should have metadata server as an argument */ gfarm_error_t gfm_create_fd(const char *, int, gfarm_mode_t, struct gfm_connection **, int *, int *); gfarm_error_t gfm_open_fd(const char *, int, struct gfm_connection **, int *, int *); gfarm_error_t gfm_close_fd(struct gfm_connection *, int); gfarm-2.4.1/lib/libgfarm/gfarm/gfs_dir.c0000644000000000000000000001751611507222724016532 0ustar rootroot/* * $Id: gfs_dir.c 4457 2010-02-23 01:53:23Z ookuma $ */ #include #include #include #include #include #include #include #include #if !defined(__GNUC__) && \ (!defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901L) # define inline #endif #define GFARM_INTERNAL_USE #include #include "timer.h" #include "gfutil.h" #include "gfs_profile.h" #include "gfm_client.h" #include "config.h" #include "lookup.h" #include "gfs_io.h" #include "gfs_dir.h" #if 0 /* not yet in gfarm v2 */ static char *gfarm_current_working_directory; gfarm_error_t gfs_chdir_canonical(const char *canonic_dir) { static int cwd_len = 0; static char env_name[] = "GFS_PWD="; static char *env = NULL; static int env_len = 0; int len, old_len; char *e, *tmp, *old_env; struct gfarm_path_info pi; e = gfarm_path_info_get(canonic_dir, &pi); if (e == NULL) { e = gfarm_path_info_access(&pi, X_OK); gfarm_path_info_free(&pi); } if (e != NULL) return (e); len = 1 + strlen(canonic_dir) + 1; if (cwd_len < len) { GFARM_REALLOC_ARRAY(tmp, gfarm_current_working_directory, len); if (tmp == NULL) return (GFARM_ERR_NO_MEMORY); gfarm_current_working_directory = tmp; cwd_len = len; } sprintf(gfarm_current_working_directory, "/%s", canonic_dir); len += sizeof(env_name) - 1 + GFARM_URL_PREFIX_LENGTH; tmp = getenv("GFS_PWD"); if (tmp == NULL || tmp != env + sizeof(env_name) - 1) { /* * changed by an application instead of this function, and * probably it's already free()ed. In this case, realloc() * does not work well at least using bash. allocate it again. */ env = NULL; env_len = 0; } old_env = env; old_len = env_len; if (env_len < len) { /* * We cannot use realloc(env, ...) here, because `env' may be * still pointed by environ[somewhere] (at least with glibc), * and realloc() may break the memory. So, allocate different * memory. */ GFARM_MALLOC_ARRAY(tmp, len); if (tmp == NULL) return (GFARM_ERR_NO_MEMORY); env = tmp; env_len = len; } sprintf(env, "%s%s%s", env_name, GFARM_URL_PREFIX, gfarm_current_working_directory); if (putenv(env) != 0) { if (env != old_env && env != NULL) free(env); env = old_env; env_len = old_len; return (gfarm_errno_to_error(errno)); } if (old_env != env && old_env != NULL) free(old_env); return (NULL); } gfarm_error_t gfs_chdir(const char *dir) { gfarm_error_t e; char *canonic_path; struct gfs_stat st; if ((e = gfs_stat(dir, &st)) != NULL) return (e); if (!GFARM_S_ISDIR(st.st_mode)) { gfs_stat_free(&st); return (GFARM_ERR_NOT_A_DIRECTORY); } gfs_stat_free(&st); e = gfarm_canonical_path(gfarm_url_prefix_skip(dir), &canonic_path); if (e != NULL) return (e); e = gfs_chdir_canonical(canonic_path); free (canonic_path); return (e); } gfarm_error_t gfs_getcwd(char *cwd, int cwdsize) { const char *path; char *default_cwd = NULL, *e, *p; int len; if (gfarm_current_working_directory != NULL) path = gfarm_current_working_directory; else if ((path = getenv("GFS_PWD")) != NULL) path = gfarm_url_prefix_skip(path); else { /* default case, use user's home directory */ gfarm_error_t e; e = gfarm_path_expand_home("~", &default_cwd); if (e != NULL) return (e); path = default_cwd; } /* check the existence */ e = gfarm_canonical_path(path, &p); if (e != NULL) goto finish; free(p); len = strlen(path); if (len < cwdsize) { strcpy(cwd, path); e = NULL; } else { e = GFARM_ERR_NUMERICAL_RESULT_OUT_OF_RANGE; } finish: if (default_cwd != NULL) free(default_cwd); return (e); } #endif /* * gfs_opendir()/readdir()/closedir() */ #define DIRENTS_BUFCOUNT 256 struct gfs_dir_internal { struct gfs_dir super; struct gfm_connection *gfm_server; int fd; struct gfs_dirent buffer[DIRENTS_BUFCOUNT]; int n, index; }; static gfarm_error_t gfm_getdirents_request(struct gfm_connection *gfm_server, void *closure) { struct gfs_dir_internal *dir = closure; gfarm_error_t e = gfm_client_getdirents_request(dir->gfm_server, DIRENTS_BUFCOUNT); if (e != GFARM_ERR_NO_ERROR) gflog_warning(GFARM_MSG_1000088, "getdirents request: %s", gfarm_error_string(e)); return (e); } static gfarm_error_t gfm_getdirents_result(struct gfm_connection *gfm_server, void *closure) { struct gfs_dir_internal *dir = closure; gfarm_error_t e = gfm_client_getdirents_result(gfm_server, &dir->n, dir->buffer); if (e != GFARM_ERR_NO_ERROR) gflog_warning(GFARM_MSG_1000089, "getdirents result: %s", gfarm_error_string(e)); return (e); } static gfarm_error_t gfs_readdir_internal(GFS_Dir super, struct gfs_dirent **entry) { struct gfs_dir_internal *dir = (struct gfs_dir_internal *)super; gfarm_error_t e; if (dir->index >= dir->n) { e = gfm_client_compound_fd_op(dir->gfm_server, dir->fd, gfm_getdirents_request, gfm_getdirents_result, NULL, dir); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001270, "gfm_client_compound_fd_op() failed: %s", gfarm_error_string(e)); return (e); } if (dir->n == 0) { *entry = NULL; return (GFARM_ERR_NO_ERROR); } dir->index = 0; } *entry = &dir->buffer[dir->index++]; return (GFARM_ERR_NO_ERROR); } static gfarm_error_t gfs_closedir_internal(GFS_Dir super) { struct gfs_dir_internal *dir = (struct gfs_dir_internal *)super; gfarm_error_t e = gfm_close_fd(dir->gfm_server, dir->fd); gfm_client_connection_free(dir->gfm_server); free(dir); return (e); } gfarm_error_t gfs_seekdir_unimpl(GFS_Dir dir, gfarm_off_t off) { gflog_debug(GFARM_MSG_1001271, "Not implemented: %s", gfarm_error_string(GFARM_ERR_FUNCTION_NOT_IMPLEMENTED)); return (GFARM_ERR_FUNCTION_NOT_IMPLEMENTED); /* XXX FIXME */ } gfarm_error_t gfs_telldir_unimpl(GFS_Dir dir, gfarm_off_t *offp) { gflog_debug(GFARM_MSG_1001272, "Not implemented: %s", gfarm_error_string(GFARM_ERR_FUNCTION_NOT_IMPLEMENTED)); return (GFARM_ERR_FUNCTION_NOT_IMPLEMENTED); /* XXX FIXME */ } static gfarm_error_t gfs_dir_alloc(struct gfm_connection *gfm_server, gfarm_int32_t fd, GFS_Dir *dirp) { struct gfs_dir_internal *dir; static struct gfs_dir_ops ops = { gfs_closedir_internal, gfs_readdir_internal, gfs_seekdir_unimpl, gfs_telldir_unimpl }; GFARM_MALLOC(dir); if (dir == NULL) { gflog_debug(GFARM_MSG_1001273, "allocation of dir failed: %s", gfarm_error_string(GFARM_ERR_NO_MEMORY)); return (GFARM_ERR_NO_MEMORY); } dir->super.ops = &ops; dir->gfm_server = gfm_server; dir->fd = fd; dir->n = 0; dir->index = 0; *dirp = &dir->super; return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfs_opendir(const char *path, GFS_Dir *dirp) { gfarm_error_t e; struct gfm_connection *gfm_server; int fd, type; if ((e = gfm_open_fd(path, GFARM_FILE_RDONLY, &gfm_server, &fd, &type)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001274, "gfm_open_fd(%s) failed: %s", path, gfarm_error_string(e)); return (e); } if (type != GFS_DT_DIR) e = GFARM_ERR_NOT_A_DIRECTORY; else if ((e = gfs_dir_alloc(gfm_server, fd, dirp)) == GFARM_ERR_NO_ERROR) return (GFARM_ERR_NO_ERROR); if (e == GFARM_ERR_NOT_A_DIRECTORY) gflog_debug(GFARM_MSG_1001275, "Not a directory (%s): %s", path, gfarm_error_string(e)); else if (e != GFARM_ERR_NO_ERROR) gflog_debug(GFARM_MSG_1001276, "allocation of dir for path (%s) failed: %s", path, gfarm_error_string(e)); (void)gfm_close_fd(gfm_server, fd); /* ignore result */ gfm_client_connection_free(gfm_server); return (e); } gfarm_error_t gfs_closedir(GFS_Dir dir) { return ((*dir->ops->closedir)(dir)); } gfarm_error_t gfs_readdir(GFS_Dir dir, struct gfs_dirent **entry) { return ((*dir->ops->readdir)(dir, entry)); } gfarm_error_t gfs_seekdir(GFS_Dir dir, gfarm_off_t off) { return ((*dir->ops->seekdir)(dir, off)); } gfarm_error_t gfs_telldir(GFS_Dir dir, gfarm_off_t *offp) { return ((*dir->ops->telldir)(dir, offp)); } gfarm-2.4.1/lib/libgfarm/gfarm/metadb_common.c0000644000000000000000000001717411507222723017720 0ustar rootroot#include #include #include #include #include #include #include #include #include #include "metadb_common.h" #include "xattr_info.h" #include "quota_info.h" /**********************************************************************/ void gfarm_base_generic_info_free_all( int n, void *vinfos, const struct gfarm_base_generic_info_ops *ops) { int i; char *infos = vinfos; for (i = 0; i < n; i++) { ops->free(infos); infos += ops->info_size; } free(vinfos); } /**********************************************************************/ static void gfarm_base_host_info_clear(void *info); static int gfarm_base_host_info_validate(void *info); const struct gfarm_base_generic_info_ops gfarm_base_host_info_ops = { sizeof(struct gfarm_host_info), (void (*)(void *))gfarm_host_info_free, gfarm_base_host_info_clear, gfarm_base_host_info_validate, }; /* * see the comment in server/gfmd/host.c:host_enter() * to see why this interface is necessary only for gfmd. */ void gfarm_host_info_free_except_hostname( struct gfarm_host_info *info) { int i; if (info->hostaliases != NULL) { for (i = 0; i < info->nhostaliases; i++) free(info->hostaliases[i]); free(info->hostaliases); } if (info->architecture != NULL) free(info->architecture); } void gfarm_host_info_free( struct gfarm_host_info *info) { if (info->hostname != NULL) free(info->hostname); gfarm_host_info_free_except_hostname(info); } static void gfarm_base_host_info_clear(void *vinfo) { struct gfarm_host_info *info = vinfo; memset(info, 0, sizeof(*info)); #if 0 info->ncpu = GFARM_HOST_INFO_NCPU_NOT_SET; #else info->ncpu = 1; /* assume 1 CPU by default */ #endif } static int gfarm_base_host_info_validate(void *vinfo) { struct gfarm_host_info *info = vinfo; /* info->hostaliases may be NULL */ return ( info->hostname != NULL && info->architecture != NULL && info->ncpu != GFARM_HOST_INFO_NCPU_NOT_SET ); } void gfarm_host_info_free_all( int n, struct gfarm_host_info *infos) { gfarm_base_generic_info_free_all(n, infos, &gfarm_base_host_info_ops); } /**********************************************************************/ static void gfarm_base_user_info_clear(void *info); static int gfarm_base_user_info_validate(void *info); const struct gfarm_base_generic_info_ops gfarm_base_user_info_ops = { sizeof(struct gfarm_user_info), (void (*)(void *))gfarm_user_info_free, gfarm_base_user_info_clear, gfarm_base_user_info_validate, }; void gfarm_user_info_free(struct gfarm_user_info *info) { if (info->username != NULL) free(info->username); if (info->realname != NULL) free(info->realname); if (info->homedir != NULL) free(info->homedir); if (info->gsi_dn != NULL) free(info->gsi_dn); } static void gfarm_base_user_info_clear(void *vinfo) { struct gfarm_user_info *info = vinfo; memset(info, 0, sizeof(*info)); } static int gfarm_base_user_info_validate(void *vinfo) { struct gfarm_user_info *info = vinfo; return ( info->username != NULL && info->realname != NULL && info->homedir != NULL && info->gsi_dn != NULL ); } void gfarm_user_info_free_all( int n, struct gfarm_user_info *infos) { gfarm_base_generic_info_free_all(n, infos, &gfarm_base_user_info_ops); } /**********************************************************************/ static void gfarm_base_group_info_clear(void *info); static int gfarm_base_group_info_validate(void *info); const struct gfarm_base_generic_info_ops gfarm_base_group_info_ops = { sizeof(struct gfarm_group_info), (void (*)(void *))gfarm_group_info_free, gfarm_base_group_info_clear, gfarm_base_group_info_validate, }; void gfarm_group_info_free(struct gfarm_group_info *info) { int i; if (info->groupname != NULL) free(info->groupname); if (info->usernames != NULL) { for (i = 0; i < info->nusers; i++) free(info->usernames[i]); free(info->usernames); } } static void gfarm_base_group_info_clear(void *vinfo) { struct gfarm_group_info *info = vinfo; memset(info, 0, sizeof(*info)); } static int gfarm_base_group_info_validate(void *vinfo) { struct gfarm_group_info *info = vinfo; return ( info->groupname != NULL ); } void gfarm_group_info_free_all( int n, struct gfarm_group_info *infos) { gfarm_base_generic_info_free_all(n, infos, &gfarm_base_group_info_ops); } /**********************************************************************/ void gfarm_group_names_free(struct gfarm_group_names *info) { int i; for (i = 0; i < info->ngroups; i++) free(info->groupnames[i]); } /**********************************************************************/ static void gfarm_base_gfs_stat_clear(void *info); static int gfarm_base_gfs_stat_validate(void *info); const struct gfarm_base_generic_info_ops gfarm_base_gfs_stat_ops = { sizeof(struct gfs_stat), (void (*)(void *))gfs_stat_free, gfarm_base_gfs_stat_clear, gfarm_base_gfs_stat_validate, }; void gfs_stat_free(struct gfs_stat *s) { if (s->st_user != NULL) free(s->st_user); if (s->st_group != NULL) free(s->st_group); } static void gfarm_base_gfs_stat_clear(void *vinfo) { struct gfs_stat *info = vinfo; memset(info, 0, sizeof(*info)); } static int gfarm_base_gfs_stat_validate(void *vinfo) { struct gfs_stat *info = vinfo; /* XXX - should check all fields are filled */ return ( info->st_user != NULL && info->st_group != NULL ); } /* extra utility function to do deep copy */ gfarm_error_t gfs_stat_copy(struct gfs_stat *d, const struct gfs_stat *s) { char *user, *group; GFARM_MALLOC_ARRAY(user, strlen(s->st_user) + 1); GFARM_MALLOC_ARRAY(group, strlen(s->st_group) + 1); if (user == NULL || group == NULL) { if (user != NULL) free(user); if (group != NULL) free(group); gflog_debug(GFARM_MSG_1001022, "allocation of user or group failed: %s", gfarm_error_string(GFARM_ERR_NO_MEMORY)); return (GFARM_ERR_NO_MEMORY); } *d = *s; strcpy(user, s->st_user); strcpy(group, s->st_group); d->st_user = user; d->st_group = group; return (GFARM_ERR_NO_ERROR); } /**********************************************************************/ static void xattr_info_free(void *vinfo) { struct xattr_info *info = vinfo; free(info->attrname); free(info->attrvalue); } void gfarm_base_xattr_info_free_array(int n, void *vinfo) { int i; struct xattr_info *info = vinfo; for (i = 0; i < n; i++) { xattr_info_free(&info[i]); } free(info); } static void xattr_info_clear(void *vinfo) { struct xattr_info *info = vinfo; info->inum = 0; info->attrname = NULL; info->namelen = 0; info->attrvalue = NULL; info->attrsize = 0; } static int xattr_info_validate(void *vinfo) { return 1; } const struct gfarm_base_generic_info_ops gfarm_base_xattr_info_ops = { sizeof(struct xattr_info), xattr_info_free, xattr_info_clear, xattr_info_validate }; /**********************************************************************/ static void gfarm_base_quota_info_clear(void *info); static int gfarm_base_quota_info_validate(void *info); const struct gfarm_base_generic_info_ops gfarm_base_quota_info_ops = { sizeof(struct gfarm_quota_info), (void (*)(void *))gfarm_quota_info_free, gfarm_base_quota_info_clear, gfarm_base_quota_info_validate, }; static void gfarm_base_quota_info_clear(void *vinfo) { struct gfarm_quota_info *info = vinfo; memset(info, 0, sizeof(*info)); } static int gfarm_base_quota_info_validate(void *vinfo) { struct gfarm_quota_info *info = vinfo; return (info->name != NULL); } void gfarm_quota_info_free_all( int n, struct gfarm_quota_info *infos) { gfarm_base_generic_info_free_all(n, infos, &gfarm_base_quota_info_ops); } gfarm-2.4.1/lib/libgfarm/gfarm/gfarm_foreach.c0000644000000000000000000000403311507222723017665 0ustar rootroot/* * $Id$ */ #include #include #include #include #include "gfarm_foreach.h" gfarm_error_t gfarm_foreach_directory_hierarchy( gfarm_error_t (*op_file)(char *, struct gfs_stat *, void *), gfarm_error_t (*op_dir1)(char *, struct gfs_stat *, void *), gfarm_error_t (*op_dir2)(char *, struct gfs_stat *, void *), char *file, void *arg) { char *path, *slash; gfarm_error_t e, e_save = GFARM_ERR_NO_ERROR; int file_len; struct gfs_stat st; GFS_Dir dir; struct gfs_dirent *dent; e = gfs_stat(file, &st); if (e != GFARM_ERR_NO_ERROR) return (e); /* add '/' if necessary */ if (*gfarm_path_dir_skip(file)) slash = "/"; else slash = ""; file_len = strlen(file) + strlen(slash); if (GFARM_S_ISDIR(st.st_mode)) { if (op_dir1 != NULL) { e = op_dir1(file, &st, arg); if (e != GFARM_ERR_NO_ERROR) goto free_st; } e = gfs_opendir(file, &dir); if (e != GFARM_ERR_NO_ERROR) goto free_st; while ((e = gfs_readdir(dir, &dent)) == GFARM_ERR_NO_ERROR && dent != NULL) { char *d = dent->d_name; if (d[0] == '.' && (d[1] == '\0' || (d[1] == '.' && d[2] == '\0'))) continue; GFARM_MALLOC_ARRAY(path, file_len + strlen(d) + 1); if (path == NULL) { if (e_save == GFARM_ERR_NO_ERROR) e_save = GFARM_ERR_NO_MEMORY; continue; } sprintf(path, "%s%s%s", file, slash, d); e = gfarm_foreach_directory_hierarchy( op_file, op_dir1, op_dir2, path, arg); free(path); if (e_save == GFARM_ERR_NO_ERROR) e_save = e; } e = gfs_closedir(dir); if (e_save == GFARM_ERR_NO_ERROR) e_save = e; if (op_dir2 != NULL) e = op_dir2(file, &st, arg); } else if (GFARM_S_ISREG(st.st_mode) && op_file != NULL) e = op_file(file, &st, arg); free_st: gfs_stat_free(&st); if (e_save != GFARM_ERR_NO_ERROR || e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001413, "Error in foreach directory hierarchy: %s", gfarm_error_string( e_save == GFARM_ERR_NO_ERROR ? e : e_save)); } return (e_save == GFARM_ERR_NO_ERROR ? e : e_save); } gfarm-2.4.1/lib/libgfarm/gfarm/gfs_replicate.c0000644000000000000000000001575611507222723017727 0ustar rootroot/* * $Id$ */ #include #include #include #define GFARM_INTERNAL_USE #include #include "config.h" #include "host.h" #include "gfm_client.h" #include "gfs_client.h" #include "lookup.h" #include "schedule.h" #include "gfs_misc.h" /*#define V2_4 1*/ struct gfm_replicate_file_from_to_closure { const char *srchost; const char *dsthost; int flags; }; static gfarm_error_t gfm_replicate_file_from_to_request(struct gfm_connection *gfm_server, void *closure) { struct gfm_replicate_file_from_to_closure *c = closure; gfarm_error_t e = gfm_client_replicate_file_from_to_request( gfm_server, c->srchost, c->dsthost, c->flags); if (e != GFARM_ERR_NO_ERROR) gflog_warning(GFARM_MSG_1001386, "replicate_file_from_to request: %s", gfarm_error_string(e)); return (e); } static gfarm_error_t gfm_replicate_file_from_to_result(struct gfm_connection *gfm_server, void *closure) { gfarm_error_t e = gfm_client_replicate_file_from_to_result(gfm_server); #if 0 /* DEBUG */ if (e != GFARM_ERR_NO_ERROR) gflog_debug(GFARM_MSG_1001387, "replicate_file_from_to result; %s", gfarm_error_string(e)); #endif return (e); } gfarm_error_t gfs_replicate_file_from_to_request( const char *file, const char *srchost, const char *dsthost, int flags) { gfarm_error_t e; struct gfm_replicate_file_from_to_closure closure; if ((flags & GFS_REPLICATE_FILE_WAIT) != 0) return (GFARM_ERR_FUNCTION_NOT_IMPLEMENTED); closure.srchost = srchost; closure.dsthost = dsthost; closure.flags = (flags & ~GFS_REPLICATE_FILE_MIGRATE); e = gfm_inode_op(file, GFARM_FILE_LOOKUP, gfm_replicate_file_from_to_request, gfm_replicate_file_from_to_result, gfm_inode_success_op_connection_free, NULL, &closure); /* * XXX GFS_REPLICATE_FILE_MIGRATE is not implemented by gfmd for now. * So, we do it by client side. */ if (e == GFARM_ERR_NO_ERROR && (flags & GFS_REPLICATE_FILE_MIGRATE) != 0) e = gfs_replica_remove_by_file(file, srchost); return (e); } gfarm_error_t gfs_replicate_file_to_request( const char *file, const char *dsthost, int flags) { char *srchost; int srcport; gfarm_error_t e, e2; GFS_File gf; e = gfs_pio_open(file, GFARM_FILE_RDONLY, &gf); if (e != GFARM_ERR_NO_ERROR) return (e); e = gfarm_schedule_file(gf, &srchost, &srcport); e2 = gfs_pio_close(gf); if (e == GFARM_ERR_NO_ERROR) { e = gfs_replicate_file_from_to_request(file, srchost, dsthost, flags); free(srchost); } return (e != GFARM_ERR_NO_ERROR ? e : e2); } gfarm_error_t gfs_replicate_file_from_to( const char *file, const char *srchost, const char *dsthost, int flags) { return (gfs_replicate_file_from_to_request(file, srchost, dsthost, flags /* | GFS_REPLICATE_FILE_WAIT */)); } gfarm_error_t gfs_replicate_file_to(const char *file, const char *dsthost, int flags) { return (gfs_replicate_file_to_request(file, dsthost, flags /* | GFS_REPLICATE_FILE_WAIT */)); } /* XXX FIXME */ static gfarm_error_t gfs_replicate_from_to_internal(GFS_File gf, char *srchost, int srcport, char *dsthost, int dstport) { gfarm_error_t e; struct gfm_connection *gfm_server = gfs_pio_metadb(gf); struct gfs_connection *gfs_server; int retry = 0; for (;;) { if ((e = gfs_client_connection_acquire_by_host(gfm_server, dsthost, dstport, &gfs_server, NULL)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001388, "acquirement of client connection failed: %s", gfarm_error_string(e)); return (e); } if (gfs_client_pid(gfs_server) == 0) e = gfarm_client_process_set(gfs_server, gfm_server); if (e == GFARM_ERR_NO_ERROR) { e = gfs_client_replica_add_from(gfs_server, srchost, srcport, gfs_pio_fileno(gf)); if (gfs_client_is_connection_error(e) && ++retry<=1) { gfs_client_connection_free(gfs_server); continue; } } break; } gfs_client_connection_free(gfs_server); return (e); } static gfarm_error_t gfs_replicate_to_internal(char *file, char *dsthost, int dstport, int migrate) { char *srchost; int srcport; gfarm_error_t e, e2; GFS_File gf; e = gfs_pio_open(file, GFARM_FILE_RDONLY, &gf); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001389, "gfs_pio_open(%s) failed: %s", file, gfarm_error_string(e)); return (e); } e = gfarm_schedule_file(gf, &srchost, &srcport); if (e == GFARM_ERR_NO_ERROR) { #ifndef V2_4 e = gfs_replicate_from_to_internal(gf, srchost, srcport, dsthost, dstport); #else e = gfs_replicate_file_from_to(file, srchost, dsthost, GFS_REPLICATE_FILE_FORCE /* | GFS_REPLICATE_FILE_WAIT */ /* XXX NOTYET */); #endif if (e == GFARM_ERR_NO_ERROR && migrate) e = gfs_replica_remove_by_file(file, srchost); free(srchost); } e2 = gfs_pio_close(gf); if (e != GFARM_ERR_NO_ERROR || e2 != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001390, "error occurred in gfs_replicate_to_internal(): %s", gfarm_error_string(e != GFARM_ERR_NO_ERROR ? e : e2)); } return (e != GFARM_ERR_NO_ERROR ? e : e2); } gfarm_error_t gfs_replicate_to_local(GFS_File gf, char *srchost, int srcport) { gfarm_error_t e; struct gfm_connection *gfm_server = gfs_pio_metadb(gf); char *self; int port; e = gfm_host_get_canonical_self_name(gfm_server, &self, &port); if (e == GFARM_ERR_NO_ERROR) { e = gfs_replicate_from_to_internal(gf, srchost, srcport, self, port); } if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001391, "error occurred in gfs_replicate_to_local(): %s", gfarm_error_string(e)); } return (e); } gfarm_error_t gfs_replicate_to(char *file, char *dsthost, int dstport) { return (gfs_replicate_to_internal(file, dsthost, dstport, 0)); } gfarm_error_t gfs_migrate_to(char *file, char *dsthost, int dstport) { return (gfs_replicate_to_internal(file, dsthost, dstport, 1)); } gfarm_error_t gfs_replicate_from_to(char *file, char *srchost, int srcport, char *dsthost, int dstport) { #ifndef V2_4 gfarm_error_t e, e2; GFS_File gf; if (srchost == NULL) return (gfs_replicate_to(file, dsthost, dstport)); e = gfs_pio_open(file, GFARM_FILE_RDONLY, &gf); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001392, "gfs_pio_open(%s) failed: %s", file, gfarm_error_string(e)); return (e); } e = gfs_replicate_from_to_internal(gf, srchost, srcport, dsthost, dstport); e2 = gfs_pio_close(gf); if (e != GFARM_ERR_NO_ERROR || e2 != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001393, "replication failed (%s) from (%s:%d) to (%s:%d): %s", file, srchost, srcport, dsthost, dstport, gfarm_error_string(e != GFARM_ERR_NO_ERROR ? e : e2)); } return (e != GFARM_ERR_NO_ERROR ? e : e2); #else return (gfs_replicate_file_from_to(file, srchost, dsthost, GFS_REPLICATE_FILE_FORCE /* | GFS_REPLICATE_FILE_WAIT */ /* XXX NOTYET */)); #endif } gfarm_error_t gfs_migrate_from_to(char *file, char *srchost, int srcport, char *dsthost, int dstport) { gfarm_error_t e; e = gfs_replicate_from_to(file, srchost, srcport, dsthost, dstport); return (e != GFARM_ERR_NO_ERROR ? e : gfs_replica_remove_by_file(file, srchost)); } gfarm-2.4.1/lib/libgfarm/gfarm/hostspec.c0000644000000000000000000002372111507222723016737 0ustar rootroot/* * $Id: hostspec.c 4930 2010-11-23 15:37:47Z tatebe $ */ #include #include #include #include #include #include #include #include #include #include #include #include /* gfarm_host_is_in_domain() */ #include "gfnetdb.h" #include "liberror.h" #include "hostspec.h" #define IS_DNS_LABEL_CHAR(c) (isalnum(c) || (c) == '-') #define AF_INET4_BIT 32 struct gfarm_hostspec { enum { GFHS_ANY, GFHS_NAME, GFHS_AF_INET4 } type; union gfhs_union { char name[1]; struct gfhs_in4_addr { struct in_addr addr, mask; } in4_addr; } u; }; gfarm_error_t gfarm_hostspec_any_new(struct gfarm_hostspec **hostspecpp) { /* allocation size never overflows */ struct gfarm_hostspec *hsp = malloc(sizeof(struct gfarm_hostspec) - sizeof(union gfhs_union)); if (hsp == NULL) { gflog_debug(GFARM_MSG_1000854, "allocation of 'gfarm_hostspec' failed: %s", gfarm_error_string(GFARM_ERR_NO_MEMORY)); return (GFARM_ERR_NO_MEMORY); } hsp->type = GFHS_ANY; *hostspecpp = hsp; return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfarm_hostspec_name_new(char *name, struct gfarm_hostspec **hostspecpp) { /* never overflows, because huge name will never be passed here */ struct gfarm_hostspec *hsp = malloc(sizeof(struct gfarm_hostspec) - sizeof(union gfhs_union) + strlen(name) + 1); if (hsp == NULL) { gflog_debug(GFARM_MSG_1000855, "allocation of 'gfarm_hostspec' failed: %s", gfarm_error_string(GFARM_ERR_NO_MEMORY)); return (GFARM_ERR_NO_MEMORY); } hsp->type = GFHS_NAME; strcpy(hsp->u.name, name); *hostspecpp = hsp; return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfarm_hostspec_af_inet4_new(gfarm_uint32_t addr, gfarm_uint32_t mask, struct gfarm_hostspec **hostspecpp) { /* allocation size never overvlows */ struct gfarm_hostspec *hsp = malloc(sizeof(struct gfarm_hostspec) - sizeof(union gfhs_union) + sizeof(struct gfhs_in4_addr)); if (hsp == NULL) { gflog_debug(GFARM_MSG_1000856, "allocation of 'gfarm_hostspec' failed: %s", gfarm_error_string(GFARM_ERR_NO_MEMORY)); return (GFARM_ERR_NO_MEMORY); } hsp->type = GFHS_AF_INET4; hsp->u.in4_addr.addr.s_addr = addr; hsp->u.in4_addr.mask.s_addr = mask; *hostspecpp = hsp; return (GFARM_ERR_NO_ERROR); } void gfarm_hostspec_free(struct gfarm_hostspec *hostspecp) { free(hostspecp); } /* * We don't use inet_addr(3)/inet_aton(3)/inet_pton(3), * because these library functions permit not only a.b.c.d, * but also a.b.c, a.b and a as inet address. * * NOTE: this function stores address of first invalid charactor to *endptr, * even if this function reports error as its return value. */ gfarm_error_t gfarm_string_to_in4addr(char *s, char **endptr, struct in_addr *addrp) { gfarm_error_t e; char *ep; gfarm_int32_t addr; unsigned long byte; int i; byte = strtoul(s, &ep, 10); if (ep == s) { e = *s == '\0' ? GFARM_ERRMSG_IP_ADDRESS_EXPECTED : GFARM_ERRMSG_INVALID_CHAR_IN_IP; goto bad; } if (byte >= 256) { ep = s; e = GFARM_ERRMSG_TOO_BIG_BYTE_IN_IP; goto bad; } addr = byte; for (i = 0; i < 3; i++) { if (*ep != '.') { e = GFARM_ERRMSG_IP_ADDRESS_TOO_SHORT; goto bad; } s = ep + 1; byte = strtoul(s, &ep, 10); if (ep == s) { e = GFARM_ERRMSG_INVALID_CHAR_IN_IP; goto bad; } if (byte >= 256) { ep = s; e = GFARM_ERRMSG_TOO_BIG_BYTE_IN_IP; goto bad; } addr = (addr << 8) | byte; } addrp->s_addr = htonl(addr); if (endptr != NULL) *endptr = ep; return (GFARM_ERR_NO_ERROR); bad: if (endptr != NULL) *endptr = ep; gflog_debug(GFARM_MSG_1000857, "conversion from string to in4addr failed: %s", gfarm_error_string(e)); return (e); } static int gfarm_is_string_upper_case(char *s) { unsigned char *t = (unsigned char *)s; for (; *t != '\0'; t++) { if (!isupper(*t)) return (0); } return (1); } gfarm_error_t gfarm_hostspec_parse(char *name, struct gfarm_hostspec **hostspecpp) { char *end1p, *end2p; struct in_addr addr, mask; unsigned long masklen; if (strcmp(name, "*") == 0 || strcmp(name, "ALL") == 0) { return (gfarm_hostspec_any_new(hostspecpp)); } if (gfarm_string_to_in4addr(name, &end1p, &addr) == GFARM_ERR_NO_ERROR) { if (*end1p == '\0') { return (gfarm_hostspec_af_inet4_new( addr.s_addr, INADDR_BROADCAST, hostspecpp)); } if (*end1p == '/') { if (isdigit(((unsigned char *)end1p)[1]) && (masklen = strtoul(end1p + 1, &end2p, 10), *end2p == '\0')) { if (masklen > AF_INET4_BIT) { gflog_debug(GFARM_MSG_1000858, "Netmask is too big"); return (GFARM_ERRMSG_TOO_BIG_NETMASK); } if (masklen == 0) { mask.s_addr = INADDR_ANY; } else { masklen = AF_INET4_BIT - masklen; mask.s_addr = htonl( ~((1 << (gfarm_int32_t)masklen) - 1)); } return (gfarm_hostspec_af_inet4_new( addr.s_addr, mask.s_addr, hostspecpp)); } else if (gfarm_string_to_in4addr(end1p + 1, &end2p, &mask) == GFARM_ERR_NO_ERROR && *end2p == '\0') { return (gfarm_hostspec_af_inet4_new( addr.s_addr, mask.s_addr, hostspecpp)); } } if (!IS_DNS_LABEL_CHAR(*(unsigned char *)end1p) && *end1p != '.') { gflog_debug(GFARM_MSG_1000859, "Invalid char in IP"); return (GFARM_ERRMSG_INVALID_CHAR_IN_IP); } } if (*name == '\0') { gflog_debug(GFARM_MSG_1000860, "Host name or IP expected"); return (GFARM_ERRMSG_HOSTNAME_OR_IP_EXPECTED); } if (!IS_DNS_LABEL_CHAR(*(unsigned char *)end1p) && *end1p != '.') { gflog_debug(GFARM_MSG_1000861, "Invalid char in host name"); return (GFARM_ERRMSG_INVALID_CHAR_IN_HOSTNAME); } /* * We don't allow all capital domain name. * Such names are reserved for keywords like "*", "LISTENER". */ if (gfarm_is_string_upper_case(name)) { gflog_debug(GFARM_MSG_1000862, "capital name is not permitted(%s)", name); return (GFARM_ERRMSG_UNKNOWN_KEYWORD); } return (gfarm_hostspec_name_new(name, hostspecpp)); } int gfarm_host_is_in_domain(const char *hostname, const char *domainname) { int hlen = strlen(hostname), dlen = strlen(domainname); if (hlen < dlen) return (0); if (hlen == dlen) return (strcasecmp(hostname, domainname) == 0); if (dlen == 0) return (1); /* null string matches with all hosts */ if (hlen == dlen + 1) return (0); return (hostname[hlen - (dlen + 1)] == '.' && strcasecmp(&hostname[hlen - dlen], domainname) == 0); } int gfarm_hostspec_match(struct gfarm_hostspec *hostspecp, const char *name, struct sockaddr *addr) { switch (hostspecp->type) { case GFHS_ANY: return (1); case GFHS_NAME: if (name == NULL) return (0); if (hostspecp->u.name[0] == '.') { return (gfarm_host_is_in_domain(name, &hostspecp->u.name[1])); } else { return (strcasecmp(name, hostspecp->u.name) == 0); } case GFHS_AF_INET4: if (addr == NULL) return (0); /* XXX */ if (addr->sa_family == AF_UNIX) return (1); if (addr->sa_family != AF_INET) return (0); return ((((struct sockaddr_in *)addr)->sin_addr.s_addr & hostspecp->u.in4_addr.mask.s_addr) == hostspecp->u.in4_addr.addr.s_addr); } /* assert(0); */ return (0); } void gfarm_hostspec_to_string(struct gfarm_hostspec *hostspec, char *string, size_t size) { unsigned char *a, *m; if (size <= 0) return; switch (hostspec->type) { case GFHS_ANY: string[0] = '\0'; return; case GFHS_NAME: strncpy(string, hostspec->u.name, size); return; case GFHS_AF_INET4: a = (unsigned char *)&hostspec->u.in4_addr.addr.s_addr; m = (unsigned char *)&hostspec->u.in4_addr.mask.s_addr; snprintf(string, size, "%d.%d.%d.%d/%d.%d.%d.%d", a[0], a[1], a[2], a[3], m[0], m[1], m[2], m[3]); return; } /* assert(0); */ return; } gfarm_error_t gfarm_sockaddr_to_name(struct sockaddr *addr, char **namep) { struct addrinfo hints, *res, *res0; struct sockaddr_in *sin1, *sin2; char *s, name[NI_MAXHOST]; if (gfarm_getnameinfo(addr, sizeof(*addr), name, sizeof(name), NULL, 0, NI_NAMEREQD) != 0) { gflog_debug(GFARM_MSG_1000863, "Cannot get name info from IP address: %s", gfarm_error_string( GFARM_ERR_CANNOT_RESOLVE_AN_IP_ADDRESS_INTO_A_HOSTNAME)); return(GFARM_ERR_CANNOT_RESOLVE_AN_IP_ADDRESS_INTO_A_HOSTNAME); } memset(&hints, 0, sizeof(hints)); hints.ai_family = addr->sa_family; if (gfarm_getaddrinfo(name, NULL, &hints, &res0) != 0) { gflog_debug(GFARM_MSG_1000864, "gfarm_getaddrinfo() failed: %s", gfarm_error_string( GFARM_ERRMSG_REVERSE_LOOKUP_NAME_IS_NOT_RESOLVABLE)); return (GFARM_ERRMSG_REVERSE_LOOKUP_NAME_IS_NOT_RESOLVABLE); } for (res = res0; res; res = res->ai_next) { if (res->ai_family != addr->sa_family) continue; switch (res->ai_family) { case AF_INET: sin1 = (struct sockaddr_in *)res->ai_addr; sin2 = (struct sockaddr_in *)addr; if (sin1->sin_addr.s_addr == sin2->sin_addr.s_addr) { s = strdup(name); gfarm_freeaddrinfo(res0); if (s == NULL) { gflog_debug(GFARM_MSG_1000865, "allocation of string failed:" " %s", gfarm_error_string( GFARM_ERR_NO_MEMORY)); return (GFARM_ERR_NO_MEMORY); } *namep = s; return (GFARM_ERR_NO_ERROR); /* success */ } break; } } gfarm_freeaddrinfo(res0); return (GFARM_ERRMSG_REVERSE_LOOKUP_NAME_DOES_NOT_MATCH); } void gfarm_sockaddr_to_string(struct sockaddr *addr, char *string, size_t size) { unsigned char *a; #ifndef HAVE_SNPRINTF char s[GFARM_SOCKADDR_STRLEN]; if (size <= 0) return; #endif switch (addr->sa_family) { case AF_INET: a = (unsigned char *) &((struct sockaddr_in *)addr)->sin_addr.s_addr; #ifdef HAVE_SNPRINTF snprintf(string, size, "%d.%d.%d.%d", a[0], a[1], a[2], a[3]); #else sprintf(s, "%d.%d.%d.%d", a[0], a[1], a[2], a[3]); strncpy(string, s, size); string[size - 1] = '\0'; #endif break; default: #ifdef HAVE_SNPRINTF snprintf(string, size, "unknown address family %d", addr->sa_family); #else sprintf(s, "unknown address family %d", addr->sa_family); strncpy(string, s, size); string[size - 1] = '\0'; #endif break; } } gfarm-2.4.1/lib/libgfarm/gfarm/conn_hash.h0000644000000000000000000000207211507222723017050 0ustar rootrootgfarm_error_t gfp_conn_hash_table_init(struct gfarm_hash_table **, int); gfarm_error_t gfp_conn_hash_enter(struct gfarm_hash_table **, int, size_t, const char *, int, const char *, struct gfarm_hash_entry **, int *); gfarm_error_t gfp_conn_hash_lookup(struct gfarm_hash_table **, int, const char *, int, const char *, struct gfarm_hash_entry **); void gfp_conn_hash_purge(struct gfarm_hash_table *, struct gfarm_hash_entry *); void gfp_conn_hash_iterator_purge(struct gfarm_hash_iterator *); char *gfp_conn_hash_hostname(struct gfarm_hash_entry *); char *gfp_conn_hash_username(struct gfarm_hash_entry *); int gfp_conn_hash_port(struct gfarm_hash_entry *); gfarm_error_t gfp_conn_hash_enter(struct gfarm_hash_table **, int, size_t, const char *, int, const char *, struct gfarm_hash_entry **, int *); gfarm_error_t gfp_conn_hash_lookup(struct gfarm_hash_table **, int, const char *, int, const char *, struct gfarm_hash_entry **); void gfp_conn_hash_purge(struct gfarm_hash_table *, struct gfarm_hash_entry *); void gfp_conn_hash_iterator_purge(struct gfarm_hash_iterator *); gfarm-2.4.1/lib/libgfarm/gfarm/url.c0000644000000000000000000003475611507222723015723 0ustar rootroot/* * $Id: url.c 4924 2010-11-18 20:05:19Z n-soda $ */ #include #include #include #include #include #include #include #include #include #include #if 0 #include #include "config.h" #include "gfs_misc.h" /* * XXX FIXME * note that unlike access(2), gfarm_stat_access() doesn't/can't check * access permission of ancestor directories. */ char * gfs_stat_access(struct gfs_stat *gst, int mode) { gfarm_mode_t mask = 0; if (strcmp(gst->st_user, gfarm_get_global_username()) == 0) { if (mode & X_OK) mask |= 0100; if (mode & W_OK) mask |= 0200; if (mode & R_OK) mask |= 0400; #if 0 /* XXX - check against st_group */ } else if (gfarm_is_group_member(gst->st_group)) { if (mode & X_OK) mask |= 0010; if (mode & W_OK) mask |= 0020; if (mode & R_OK) mask |= 0040; #endif } else { if (mode & X_OK) mask |= 0001; if (mode & W_OK) mask |= 0002; if (mode & R_OK) mask |= 0004; } return (((gst->st_mode & mask) == mask) ? NULL : GFARM_ERR_PERMISSION_DENIED); } /* * XXX FIXME * note that unlike access(2), gfarm_path_info_access() doesn't/can't check * access permission of ancestor directories. */ char * gfarm_path_info_access(struct gfarm_path_info *pi, int mode) { return (gfs_stat_access(&pi->status, mode)); } /* * GFarm-URL: * gfarm:path/name * gfarm:~/path/name * = ${gfarm_spool_root}/${USER}/path/name * gfarm:/path/name * = ${gfarm_spool_root}/path/name */ /* * Remove "gfarm:" prefix and expand "~" and current directory. * Return malloc(3)ed string, thus caller should free(3) the memory. * * Do not add ${gfarm_spool_root}, because it is only available on * gfarm pool hosts. * * i.e. * input: gfarm:path/name * output: ${USER}/path/name * * input: gfarm:~/path/name * output: ${USER}/path/name * * input: gfarm:/path/name * output: path/name * * input: gfarm:~user/path/name * output: user/path/name */ /* * Expand '~'. Currently, '~/...' or '~username/...' is transformed * to '/username/...'. */ char * gfarm_path_expand_home(const char *gfarm_file, char **pathp) { char *s, *user; *pathp = NULL; /* cause SEGV, if return value is ignored */ if (gfarm_file[0] == '~' && (gfarm_file[1] == '\0' || gfarm_file[1] == '/')) { user = gfarm_get_global_username(); if (user == NULL) return ("gfarm_path_expand_home(): programming error, " "gfarm library isn't properly initialized"); GFARM_MALLOC_ARRAY(s, strlen(user) + strlen(&gfarm_file[1]) + 2); if (s == NULL) return (GFARM_ERR_NO_MEMORY); sprintf(s, "/%s%s", user, &gfarm_file[1]); } else { s = strdup(gfarm_file); if (s == NULL) return (GFARM_ERR_NO_MEMORY); if (gfarm_file[0] == '~') /* ~username/... */ *s = '/'; /* XXX - it is necessary to check the user name. */ } *pathp = s; return (NULL); } char * gfarm_canonical_path(const char *gfarm_file, char **canonic_pathp) { char *s, *e; *canonic_pathp = NULL; /* cause SEGV, if return value is ignored */ e = gfarm_path_expand_home(gfarm_file, &s); if (e != NULL) return (e); e = gfs_realpath_canonical(s, canonic_pathp); free(s); return(e); } char * gfarm_canonical_path_for_creation(const char *gfarm_file, char **canonic_pathp) { const char *basename, *p0; char *e, *p1, *dir, *dir_canonic, *lastc, cwd[PATH_MAX + 1]; *canonic_pathp = NULL; /* cause SEGV, if return value is ignored */ /* '' or 'gfarm:' case */ if (gfarm_file[0] == '\0') { e = gfs_getcwd(cwd, sizeof(cwd)); if (e != NULL) return (e); p0 = cwd; } else p0 = gfarm_file; /* Expand '~'. */ e = gfarm_path_expand_home(p0, &p1); if (e != NULL) return (e); /* Eliminate unnecessary '/'s following the basename. */ lastc = &p1[strlen(p1) - 1]; if (*lastc == '/') { while (p1 < lastc && *lastc == '/') --lastc; if (p1 == lastc) { /* * In this case, given gfarm_file is '/' or contains * only several '/'s. This means to attempt to create * the root directory. Because the root directory * should exist, the attempt will fail with the error * of 'already exist'. However, this case such that * the canonical name is "" causes many problems. * That is why the error of 'already exist' is * returned here. */ free(p1); return (GFARM_ERR_ALREADY_EXISTS); } else { *(lastc + 1) = '\0'; } } basename = gfarm_path_dir_skip(p1); /* '.' or '..' - we do not have that entry. */ if (basename[0] == '.' && (basename[1] == '\0' || (basename[1] == '.' && basename[2] == '\0'))) { e = gfarm_canonical_path(p1, canonic_pathp); goto free_p1; } if (basename == p1) /* "filename" */ dir = "."; else if (basename == p1 + 1) /* "/filename" */ dir = "/"; else { /* /.../.../filename */ p1[basename - 1 - p1] = '\0'; dir = p1; } /* Check the existence of the parent directory. */ e = gfarm_canonical_path(dir, &dir_canonic); if (e != NULL) goto free_p1; /* * check whether parent directory is writable or not. * XXX this isn't enough yet, due to missing X-bits check. */ if (dir_canonic[0] != '\0') { /* XXX "/" is always OK for now */ struct gfarm_path_info pi; int is_dir; e = gfarm_path_info_get(dir_canonic, &pi); if (e != NULL) goto free_dir_canonic; is_dir = GFARM_S_ISDIR(pi.status.st_mode); e = gfarm_path_info_access(&pi, W_OK); gfarm_path_info_free(&pi); if (!is_dir) e = GFARM_ERR_NOT_A_DIRECTORY; if (e != NULL) goto free_dir_canonic; } GFARM_MALLOC_ARRAY(*canonic_pathp, strlen(dir_canonic) + 1 + strlen(basename) + 1); if (*canonic_pathp == NULL) { e = GFARM_ERR_NO_MEMORY; goto free_dir_canonic; } /* * When the 'dir_canonic' is a null string, *canonic_pathp * will start with '/' incorrectly. */ if (dir_canonic[0] == '\0') strcpy(*canonic_pathp, basename); else sprintf(*canonic_pathp, "%s/%s", dir_canonic, basename); e = NULL; free_dir_canonic: free(dir_canonic); free_p1: free(p1); return (e); } char * gfarm_url_make_path(const char *gfarm_url, char **canonic_pathp) { *canonic_pathp = NULL; /* cause SEGV, if return value is ignored */ if (gfarm_url == NULL) return (GFARM_ERR_INVALID_ARGUMENT); gfarm_url = gfarm_url_prefix_skip(gfarm_url); return (gfarm_canonical_path(gfarm_url, canonic_pathp)); } char * gfarm_url_make_path_for_creation(const char *gfarm_url, char **canonic_pathp) { *canonic_pathp = NULL; /* cause SEGV, if return value is ignored */ if (gfarm_url == NULL) return (GFARM_ERR_INVALID_ARGUMENT); gfarm_url = gfarm_url_prefix_skip(gfarm_url); return (gfarm_canonical_path_for_creation(gfarm_url, canonic_pathp)); } /* * Translate a canonical path to a Gfarm URL. */ char * gfarm_path_canonical_to_url(const char *canonic_path, char **gfarm_url) { char *url; *gfarm_url = NULL; GFARM_MALLOC_ARRAY(url, GFARM_URL_PREFIX_LENGTH + strlen(canonic_path) + 2); if (url == NULL) return (GFARM_ERR_NO_MEMORY); memcpy(url, GFARM_URL_PREFIX, GFARM_URL_PREFIX_LENGTH); url[GFARM_URL_PREFIX_LENGTH] = '/'; strcpy(url + GFARM_URL_PREFIX_LENGTH + 1, canonic_path); *gfarm_url = url; return (NULL); } /* * gfs_realpath */ char * gfs_realpath(const char *path, char **abspathp) { char *e, *canonic_path; if (path == NULL) return (GFARM_ERR_INVALID_ARGUMENT); path = gfarm_url_prefix_skip(path); e = gfarm_canonical_path(path, &canonic_path); if (e != NULL) return (e); e = gfarm_path_canonical_to_url(canonic_path, abspathp); free(canonic_path); return (e); } /* * Append section suffix to pathname. * Return malloc(3)ed string, thus caller should free(3) the memory. * i.e. * input1: pathname * input2: section * output: pathname:section */ char * gfarm_path_section(const char *pathname, const char *section, char **section_pathp) { char *s; *section_pathp = NULL; /* cause SEGV, if return value is ignored */ GFARM_MALLOC_ARRAY(s, strlen(pathname) + 1 + strlen(section) + 1); if (s == NULL) return (GFARM_ERR_NO_MEMORY); sprintf(s, "%s:%s", pathname, section); *section_pathp = s; return (NULL); } /* * Add spool_root prefix and section suffix to canonic path. * Return malloc(3)ed string, thus caller should free(3) the memory. * * i.e. * input1: /spool_root * input2: path/name * input3: section * output: /spool_root/path/name:section */ char * gfarm_full_path_file_section( char *spool_root, char *canonic_path, char *section, char **abs_pathp) { char *s; *abs_pathp = NULL; /* cause SEGV, if return value is ignored */ GFARM_MALLOC_ARRAY(s, strlen(spool_root) + 1 + strlen(canonic_path) + 1 + strlen(section) + 1); if (s == NULL) return (GFARM_ERR_NO_MEMORY); sprintf(s, "%s/%s:%s", spool_root, canonic_path, section); *abs_pathp = s; return (NULL); } /* * Add ${gfarm_spool_root} prefix to canonic path. * Return malloc(3)ed string, thus caller should free(3) the memory. * * Should be called on gfarm pool hosts, because ${gfarm_spool_root} is * only available on pool. * * i.e. * input: path/name * output: ${gfarm_spool_root}/path/name */ char * gfarm_path_localize(char *canonic_path, char **abs_pathp) { char *s, *spool_root = gfarm_spool_root_for_compatibility; *abs_pathp = NULL; /* cause SEGV, if return value is ignored */ if (spool_root == NULL) return ("gfarm_path_localize(): programming error, " "gfarm library isn't properly initialized"); GFARM_MALLOC_ARRAY(s, strlen(spool_root) + 1 + strlen(canonic_path) + 1); if (s == NULL) return (GFARM_ERR_NO_MEMORY); sprintf(s, "%s/%s", spool_root, canonic_path); *abs_pathp = s; return (NULL); } /* * Add ${gfarm_spool_root} prefix and section suffix to canonic path. * Return malloc(3)ed string, thus caller should free(3) the memory. * * Should be called on gfarm pool hosts, because ${gfarm_spool_root} is * only available on pool. * * i.e. * input1: path/name * input2: section * output: ${gfarm_spool_root}/path/name:section */ char * gfarm_path_localize_file_section(char *canonic_path, char *section, char **abs_pathp) { char *spool_root = gfarm_spool_root_for_compatibility; if (spool_root == NULL) return ("gfarm_path_localize_file_section(): " "programming error, " "gfarm library isn't properly initialized"); return (gfarm_full_path_file_section(spool_root, canonic_path, section, abs_pathp)); } char * gfarm_path_localize_file_fragment(char *canonic_path, int index, char **abs_pathp) { char buffer[GFARM_INT32STRLEN]; sprintf(buffer, "%d", index); return (gfarm_path_localize_file_section(canonic_path, buffer, abs_pathp)); } /* * Strip suffix from pathname. * * It is necessary to free a returned string. */ char * gfarm_url_remove_suffix(char *gfarm_url, char *suffix, char **out_urlp) { char *r; int ulen = strlen(gfarm_url); int slen = strlen(suffix); if (ulen > slen) { if (memcmp(gfarm_url + ulen - slen, suffix, slen) == 0) ulen -= slen; } GFARM_MALLOC_ARRAY(r, ulen + 1); if (r == NULL) return (GFARM_ERR_NO_MEMORY); memcpy(r, gfarm_url, ulen); r[ulen] = '\0'; *out_urlp = r; return (NULL); } /* * convenience functions */ const char * gfarm_url_prefix_skip(const char *gfarm_url) { if (gfarm_is_url(gfarm_url)) gfarm_url += GFARM_URL_PREFIX_LENGTH; return (gfarm_url); } char * gfarm_url_prefix_add(const char *s) { char *p; GFARM_MALLOC_ARRAY(p, GFARM_URL_PREFIX_LENGTH + strlen(s) + 1); if (p == NULL) return (NULL); memcpy(p, GFARM_URL_PREFIX, GFARM_URL_PREFIX_LENGTH); strcpy(p + GFARM_URL_PREFIX_LENGTH, s); return (p); } #endif const char GFARM_URL_PREFIX[] = "gfarm:"; int gfarm_is_url(const char *gfarm_url) { return (memcmp(gfarm_url, GFARM_URL_PREFIX, GFARM_URL_PREFIX_LENGTH) == 0); } /* * Skip directory in the pathname. * We want traditional basename(3) here, rather than weird XPG one. */ const char * gfarm_path_dir_skip(const char *path) { const char *base; for (base = path; *path != '\0'; path++) { if (*path == '/') base = path + 1; } return (base); } /* similar to dirname(3) in libc, but returns the result by malloc'ed memory */ char * gfarm_url_dir(const char *pathname) { char *parent, *top, *dir, *p; int had_scheme = 0; static const char dot[] = "."; if (pathname[0] == '\0') return (strdup(dot)); parent = strdup(pathname); if (parent == NULL) { gflog_debug(GFARM_MSG_1001463, "allocation of dir failed: %s", gfarm_error_string(GFARM_ERR_NO_MEMORY)); return (NULL); } top = dir = parent; if (gfarm_is_url(dir)) { had_scheme = 1; dir += GFARM_URL_PREFIX_LENGTH; top = dir; if (dir[0] == '/') { if (dir[1] != '/') { top = dir; } else { dir += 2; /* skip "//" */ /* skip hostname:port */ while (dir[0] != '\0' && dir[0] != '/') dir++; top = dir - 1; if (dir[0] == '/') { for (p = dir + 1; *p == '/'; p++) ; if (*p == '\0') { dir[0] = '\0'; return (parent); } } } } if (dir[0] == '\0') return (parent); } /* remove trailing '/' */ p = dir + strlen(dir) - 1; while (p > dir && *p == '/') --p; p[1] = '\0'; p = (char *)gfarm_path_dir_skip(dir); /* UNCONST */ if (p == dir) { /* i.e. no slash */ if (had_scheme) { dir[0] = '\0'; return (parent); } else { free(parent); return (strdup(dot)); } } --p; /* remove trailing '/' */ while (p > top && *p == '/') --p; p[1] = '\0'; return (parent); } /* similar to dirname(3) in libc, but returns the result by malloc'ed memory */ char * gfarm_path_dir(const char *pathname) { char *dir, *p; static const char dot[] = "."; if (pathname[0] == '\0') return (strdup(dot)); dir = strdup(pathname); if (dir == NULL) { gflog_debug(GFARM_MSG_1001463, "allocation of dir failed: %s", gfarm_error_string(GFARM_ERR_NO_MEMORY)); return (NULL); } /* remove trailing '/' */ p = dir + strlen(dir) - 1; while (p > dir && *p == '/') --p; p[1] = '\0'; p = (char *)gfarm_path_dir_skip(dir); /* UNCONST */ if (p == dir) { /* i.e. no slash */ free(dir); return (strdup(dot)); } --p; /* remove trailing '/' */ while (p > dir && *p == '/') --p; p[1] = '\0'; return (dir); } #if 0 char * gfarm_url_make_localized_path(char *gfarm_url, char **abs_pathp) { char *e, *canonic_path; e = gfarm_url_make_path(gfarm_url, &canonic_path); if (e != NULL) return (e); e = gfarm_path_localize(canonic_path, abs_pathp); free(canonic_path); return (e); } char * gfarm_url_make_localized_file_fragment_path(char *gfarm_url, int index, char **abs_pathp) { char *e, *canonic_path; e = gfarm_url_make_path(gfarm_url, &canonic_path); if (e != NULL) return (e); e = gfarm_path_localize_file_fragment(canonic_path, index, abs_pathp); free(canonic_path); return (e); } #endif gfarm-2.4.1/lib/libgfarm/gfarm/gfs_pio_section.c0000644000000000000000000006315711507222723020270 0ustar rootroot/* * pio operations for file fragments or programs * * $Id: gfs_pio_section.c 5018 2010-12-30 08:35:34Z tatebe $ */ #include #include #include #include #include #include #include #include #include #include #include #include "timer.h" #include "gfutil.h" #include "liberror.h" #include "gfs_profile.h" #include "host.h" #include "config.h" #include "gfm_client.h" #include "gfm_schedule.h" #include "gfs_client.h" #include "gfs_proto.h" #include "gfs_io.h" #include "gfs_pio.h" #include "schedule.h" static gfarm_error_t gfs_pio_view_section_close(GFS_File gf) { struct gfs_file_section_context *vc = gf->view_context; gfarm_error_t e = GFARM_ERR_NO_ERROR, e_save = GFARM_ERR_NO_ERROR; #if 0 /* not yet in gfarm v2 */ int md_calculated = 0; file_offset_t filesize; size_t md_len; unsigned char md_value[EVP_MAX_MD_SIZE]; char md_value_string[EVP_MAX_MD_SIZE * 2 + 1]; struct gfarm_file_section_info fi, fi1; unsigned int len; int i; #ifdef __GNUC__ /* workaround gcc warning: might be used uninitialized */ filesize = 0; md_len = 0; #endif /* calculate checksum */ /* * EVP_DigestFinal should be called always to clean up * allocated memory by EVP_DigestInit. */ EVP_DigestFinal(&vc->md_ctx, md_value, &len); if (gfs_pio_check_calc_digest(gf)) { if (((gf->mode & GFS_FILE_MODE_WRITE) != 0 && (gf->open_flags & GFARM_FILE_TRUNC) == 0) || ((gf->mode & GFS_FILE_MODE_WRITE) == 0 && (gf->error != GFARM_ERRMSG_GFS_PIO_IS_EOF) && (gf->mode & GFS_FILE_MODE_UPDATE_METADATA) != 0)) { /* we have to read rest of the file in this case */ #if 0 static char message[] = "gfarm: writing without" " truncation isn't supported yet\n"; write(2, message, sizeof(message) - 1); abort(); /* XXX - not supported for now */ #endif #if 0 /* re-read whole file to calculate digest value */ e = (*vc->ops->storage_calculate_digest)(gf, GFS_DEFAULT_DIGEST_NAME, sizeof(md_value), &md_len, md_value, &filesize); if (gfs_client_is_connection_error(e) && gfs_pio_view_section_try_to_switch_replica(gf) == NULL) { e = (*vc->ops->storage_calculate_digest)(gf, GFS_DEFAULT_DIGEST_NAME, sizeof(md_value), &md_len, md_value, &filesize); } if (e != GFARM_ERR_NO_ERROR) { md_calculated = 0; if (e_save == GFARM_ERR_NO_ERROR) e_save = e; } md_calculated = 1; #endif } else if ((gf->mode & GFS_FILE_MODE_WRITE) == 0 && (gf->error != GFARM_ERRMSG_GFS_PIO_IS_EOF)) { /* * sequential and read-only case, but * either error occurred or gf doesn't reach EOF, * we don't confirm checksum in this case. */ md_calculated = 0; } else { md_len = len; filesize = gf->offset + gf->length; md_calculated = 1; } } else { if ((gf->mode & GFS_FILE_MODE_UPDATE_METADATA) == 0) { /* * random-access and read-only case, * we don't confirm checksum for this case, * because of its high overhead. */ md_calculated = 0; } else { #if 0 /* * re-read whole file to calculate digest value * for writing. * note that this effectively breaks file offset. */ e = (*vc->ops->storage_calculate_digest)(gf, GFS_DEFAULT_DIGEST_NAME, sizeof(md_value), &md_len, md_value, &filesize); if (gfs_client_is_connection_error(e) && gfs_pio_view_section_try_to_switch_replica(gf) == GFARM_ERR_NO_ERROR) { e = (*vc->ops->storage_calculate_digest)(gf, GFS_DEFAULT_DIGEST_NAME, sizeof(md_value), &md_len, md_value, &filesize); } if (e != GFARM_ERR_NO_ERROR) { md_calculated = 0; if (e_save == GFARM_ERR_NO_ERROR) e_save = e; } md_calculated = 1; #endif } } if (md_calculated == 1) { for (i = 0; i < md_len; i++) sprintf(&md_value_string[i + i], "%02x", md_value[i]); } if (gf->mode & GFS_FILE_MODE_UPDATE_METADATA) { if (md_calculated == 1) { fi1.filesize = filesize; fi1.checksum_type = GFS_DEFAULT_DIGEST_NAME; fi1.checksum = md_value_string; e = gfarm_file_section_info_replace( gf->pi.pathname, vc->section, &fi1); } else e = gfs_pio_view_section_set_checksum_unknown(gf); } else if (md_calculated == 1 && (e = gfarm_file_section_info_get( gf->pi.pathname, vc->section, &fi)) == GFARM_ERR_NO_ERROR) { if (gfs_file_section_info_check_busy(&fi)) /* skip check*/; else if (gfs_file_section_info_check_checksum_unknown(&fi)) { fi1.filesize = filesize; fi1.checksum_type = GFS_DEFAULT_DIGEST_NAME; fi1.checksum = md_value_string; e = gfarm_file_section_info_replace( gf->pi.pathname, vc->section, &fi1); } else { if (filesize != fi.filesize) e = "filesize mismatch"; else if (strcasecmp(fi.checksum_type, GFS_DEFAULT_DIGEST_NAME) != 0 || strcasecmp(fi.checksum, md_value_string) != 0) e = "checksum mismatch"; } gfarm_file_section_info_free(&fi); } if (e_save == GFARM_ERR_NO_ERROR) e_save = e; #endif /* not yet in gfarm v2 */ e = (*vc->ops->storage_close)(gf); if (e_save == GFARM_ERR_NO_ERROR) e_save = e; free(vc); gf->view_context = NULL; gfs_pio_set_view_default(gf); if (e_save != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001346, "storage_close() failed: %s", gfarm_error_string(e_save)); } return (e_save); } static gfarm_error_t gfs_pio_view_section_pwrite(GFS_File gf, const char *buffer, size_t size, gfarm_off_t offset, size_t *lengthp) { struct gfs_file_section_context *vc = gf->view_context; gfarm_error_t e = (*vc->ops->storage_pwrite)(gf, buffer, size, offset, lengthp); if (e == GFARM_ERR_NO_ERROR && *lengthp > 0 && (gf->mode & GFS_FILE_MODE_CALC_DIGEST) != 0) EVP_DigestUpdate(&vc->md_ctx, buffer, *lengthp); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001347, "storage_pwrite() failed: %s", gfarm_error_string(e)); } return (e); } static gfarm_error_t gfs_pio_view_section_pread(GFS_File gf, char *buffer, size_t size, gfarm_off_t offset, size_t *lengthp) { struct gfs_file_section_context *vc = gf->view_context; gfarm_error_t e = (*vc->ops->storage_pread)(gf, buffer, size, offset, lengthp); if (e == GFARM_ERR_NO_ERROR && *lengthp > 0 && (gf->mode & GFS_FILE_MODE_CALC_DIGEST) != 0) EVP_DigestUpdate(&vc->md_ctx, buffer, *lengthp); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001348, "storage_pread failed: %s", gfarm_error_string(e)); } return (e); } static gfarm_error_t gfs_pio_view_section_ftruncate(GFS_File gf, gfarm_off_t length) { struct gfs_file_section_context *vc = gf->view_context; return ((*vc->ops->storage_ftruncate)(gf, length)); } static gfarm_error_t gfs_pio_view_section_fsync(GFS_File gf, int operation) { struct gfs_file_section_context *vc = gf->view_context; return ((*vc->ops->storage_fsync)(gf, operation)); } static gfarm_error_t gfs_pio_view_section_fstat(GFS_File gf, struct gfs_stat *st) { struct gfs_file_section_context *vc = gf->view_context; return ((*vc->ops->storage_fstat)(gf, st)); } static int gfs_pio_view_section_fd(GFS_File gf) { struct gfs_file_section_context *vc = gf->view_context; return ((*vc->ops->storage_fd)(gf)); } struct gfs_pio_ops gfs_pio_view_section_ops = { gfs_pio_view_section_close, gfs_pio_view_section_fd, gfs_pio_view_section_pread, gfs_pio_view_section_pwrite, gfs_pio_view_section_ftruncate, gfs_pio_view_section_fsync, gfs_pio_view_section_fstat, }; #if 0 /* not yet in gfarm v2 */ static gfarm_error_t replicate_section_to_local(GFS_File gf, char *section, char *src_canonical_hostname, char *src_if_hostname) { gfarm_error_t e; int if_hostname_alloced = 0; struct gfarm_file_section_info sinfo; if (src_if_hostname == NULL) { struct sockaddr peer_addr; e = gfarm_host_address_get(src_canonical_hostname, gfarm_spool_server_port, &peer_addr, &src_if_hostname); if (e != GFARM_ERR_NO_ERROR) return (e); if_hostname_alloced = 1; } /* gf->pi.status.st_size does not have the file size... */ e = gfarm_file_section_info_get(gf->pi.pathname, section, &sinfo); if (e != GFARM_ERR_NO_ERROR) goto finish; e = gfarm_file_section_replicate_from_to_local_with_locking( &sinfo, gf->pi.status.st_mode, src_canonical_hostname, src_if_hostname, NULL); gfarm_file_section_info_free(&sinfo); finish: if (if_hostname_alloced) free(src_if_hostname); return (e); } #endif /* not yet in gfarm v2 */ static gfarm_error_t connect_and_open(GFS_File gf, const char *hostname, int port) { gfarm_error_t e; struct gfs_connection *gfs_server; int retry = 0; gfarm_timerval_t t1, t2, t3, t4; GFARM_TIMEVAL_FIX_INITIALIZE_WARNING(t1); GFARM_TIMEVAL_FIX_INITIALIZE_WARNING(t2); GFARM_TIMEVAL_FIX_INITIALIZE_WARNING(t3); gfs_profile(gfarm_gettimerval(&t1)); e = gfs_client_connection_acquire_by_host(gf->gfm_server, hostname, port, &gfs_server, NULL); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001350, "acquirement of client connection failed: %s", gfarm_error_string(e)); return (e); } for (;;) { gfs_profile(gfarm_gettimerval(&t2)); e = GFARM_ERR_NO_ERROR; if (gfs_client_pid(gfs_server) == 0) e = gfarm_client_process_set(gfs_server, gf->gfm_server); gfs_profile(gfarm_gettimerval(&t3)); if (e == GFARM_ERR_NO_ERROR) { if (gfs_client_connection_is_local(gfs_server)) e = gfs_pio_open_local_section(gf, gfs_server); else e = gfs_pio_open_remote_section(gf,gfs_server); } if (e != GFARM_ERR_NO_ERROR) { gfs_client_connection_free(gfs_server); if (gfs_client_is_connection_error(e) && ++retry<=1 && gfs_client_connection_acquire_by_host( gf->gfm_server, hostname, port, &gfs_server, NULL) == GFARM_ERR_NO_ERROR) continue; } break; } gfs_profile(gfarm_gettimerval(&t4)); gfs_profile( gflog_info(GFARM_MSG_1000108, "(connect_and_open) connection_acquire %f, " "process_set %f, open %f", gfarm_timerval_sub(&t2, &t1), gfarm_timerval_sub(&t3, &t2), gfarm_timerval_sub(&t4, &t3))); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001351, "error occurred in connect_and_open(): %s", gfarm_error_string(e)); } return (e); } static gfarm_error_t choose_trivial_one(struct gfarm_host_sched_info *info, char **hostp, gfarm_int32_t *portp) { char *host; /* no choice */ host = strdup(info->host); if (host == NULL) { gflog_debug(GFARM_MSG_1001352, "allocation of 'host' failed: %s", gfarm_error_string(GFARM_ERR_NO_MEMORY)); return(GFARM_ERR_NO_MEMORY); } *hostp = host; *portp = info->port; return (GFARM_ERR_NO_ERROR); } /* *hostp needs to free'ed if succeed */ gfarm_error_t gfarm_schedule_file(GFS_File gf, char **hostp, gfarm_int32_t *portp) { gfarm_error_t e; int nhosts; struct gfarm_host_sched_info *infos; char *host = NULL; gfarm_int32_t port; gfarm_timerval_t t1, t2, t3; int i; /* * XXX FIXME: Or, call replicate_section_to_local(), if that's prefered */ GFARM_TIMEVAL_FIX_INITIALIZE_WARNING(t1); GFARM_TIMEVAL_FIX_INITIALIZE_WARNING(t2); GFARM_TIMEVAL_FIX_INITIALIZE_WARNING(t3); gfs_profile(gfarm_gettimerval(&t1)); e = gfm_schedule_file(gf->gfm_server, gf->fd, &nhosts, &infos); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001353, "gfm_schedule_file() failed: %s", gfarm_error_string(e)); return (e); } gfs_profile(gfarm_gettimerval(&t2)); gfs_profile(gflog_info(GFARM_MSG_1000109, "schedule_file -> %d hosts", nhosts)); gfs_profile( for (i = 0; i < nhosts; ++i) gflog_info(GFARM_MSG_1000110, "<%s>", infos[i].host)); if (nhosts == 1) e = choose_trivial_one(&infos[0], &host, &port); else e = gfarm_schedule_select_host(gf->gfm_server, nhosts, infos, (gf->mode & GFS_FILE_MODE_WRITE) != 0, &host, &port); /* in case of no file system node, clear status of connection cache */ if (e == GFARM_ERRMSG_NO_FILESYSTEM_NODE) gfarm_schedule_host_cache_reset(gf->gfm_server, nhosts, infos); gfarm_host_sched_info_free(nhosts, infos); if (e != GFARM_ERR_NO_ERROR) gflog_warning(GFARM_MSG_1001354, "schedule_select_host: %s", gfarm_error_string(e)); /* on-demand replication */ if (e == GFARM_ERR_NO_ERROR && !gfm_host_is_local(gf->gfm_server, host) && gf_on_demand_replication) { e = gfs_replicate_to_local(gf, host, port); if (e == GFARM_ERR_NO_ERROR) { free(host); e = gfm_host_get_canonical_self_name( gf->gfm_server, &host, &port); host = strdup(host); if (host == NULL) e = GFARM_ERR_NO_MEMORY; } else if (e == GFARM_ERR_ALREADY_EXISTS || e == GFARM_ERR_UNKNOWN_HOST) { /* * local host is too busy to select or unknown * host */ e = GFARM_ERR_NO_ERROR; } } if (e != GFARM_ERR_NO_ERROR) { if (host != NULL) free(host); gflog_debug(GFARM_MSG_1001355, "error occurred in gfarm_schedule_file(): %s", gfarm_error_string(e)); return (e); } gfs_profile(gflog_info(GFARM_MSG_1000111, "host -> %s", host)); gfs_profile(gfarm_gettimerval(&t3)); gfs_profile( gflog_info(GFARM_MSG_1000112, "(gfarm_schedule_file) schedule %f, select %f", gfarm_timerval_sub(&t2, &t1), gfarm_timerval_sub(&t3, &t2))); *hostp = host; *portp = port; return (e); } static gfarm_error_t connect_and_open_with_reconnection(GFS_File gf, char *host, gfarm_int32_t port) { gfarm_error_t e; e = connect_and_open(gf, host, port); if (gfs_client_is_connection_error(e)) e = connect_and_open(gf, host, port); return (e); } static double gfs_pio_set_view_section_time; gfarm_error_t gfs_pio_internal_set_view_section(GFS_File gf, char *host) { struct gfs_file_section_context *vc; gfarm_error_t e; gfarm_timerval_t t1, t2; int host_assigned = 0; gfarm_int32_t port; int sleep_interval = 1, sleep_max_interval = 512; struct timeval expiration_time; GFARM_TIMEVAL_FIX_INITIALIZE_WARNING(t1); gfs_profile(gfarm_gettimerval(&t1)); e = gfs_pio_set_view_default(gf); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001356, "gfs_pio_set_view_default() failed: %s", gfarm_error_string(e)); goto finish; } if (host != NULL) { /* this is slow, but not usually used */ struct gfarm_host_info hinfo; e = gfm_host_info_get_by_name_alias(gf->gfm_server, host, &hinfo); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001357, "gfm_host_info_get_by_name_alias() failed: %s", gfarm_error_string(e)); goto finish; } port = hinfo.port; gfarm_host_info_free(&hinfo); } GFARM_MALLOC(vc); if (vc == NULL) { e = GFARM_ERR_NO_MEMORY; gflog_debug(GFARM_MSG_1001358, "allocation of file section context failed: %s", gfarm_error_string(e)); goto finish; } gf->view_context = vc; gettimeofday(&expiration_time, NULL); expiration_time.tv_sec += gfarm_no_file_system_node_timeout; for (;;) { if (host == NULL) { e = gfarm_schedule_file(gf, &host, &port); /* reschedule another host */ if (e == GFARM_ERRMSG_NO_FILESYSTEM_NODE && !gfarm_timeval_is_expired(&expiration_time)) { gflog_warning(GFARM_MSG_1001359, "sleep %d sec: %s", sleep_interval, gfarm_error_string(e)); sleep(sleep_interval); if (sleep_interval < sleep_max_interval) sleep_interval *= 2; continue; } if (e == GFARM_ERR_NO_ERROR) host_assigned = 1; } if (e == GFARM_ERR_NO_ERROR) e = connect_and_open_with_reconnection(gf, host, port); if (host_assigned) { free(host); host = NULL; /* * reschedule another host unless host is * explicitly specified */ if ((e == GFARM_ERRMSG_NO_FILESYSTEM_NODE || e == GFARM_ERR_FILE_MIGRATED || gfs_client_is_connection_error(e)) && !gfarm_timeval_is_expired(&expiration_time)) { if (e == GFARM_ERR_FILE_MIGRATED) { /* don't have to sleep in this case */ gflog_debug(GFARM_MSG_1002472, "file migrated"); continue; } gflog_warning(GFARM_MSG_1001360, "sleep %d sec: %s", sleep_interval, gfarm_error_string(e)); sleep(sleep_interval); if (sleep_interval < sleep_max_interval) sleep_interval *= 2; continue; } } break; } if (e == GFARM_ERR_NO_ERROR) { gf->ops = &gfs_pio_view_section_ops; gf->p = gf->length = 0; gf->io_offset = gf->offset = 0; #if 1 /* not yet in gfarm v2 */ goto finish; #else /* not yet in gfarm v2 */ gf->mode |= GFS_FILE_MODE_CALC_DIGEST; EVP_DigestInit(&vc->md_ctx, GFS_DEFAULT_DIGEST_MODE); if (gf->open_flags & GFARM_FILE_APPEND) { e = gfs_pio_seek(gf, 0,SEEK_END, NULL); if (e == GFARM_ERR_NO_ERROR) goto finish; (*vc->ops->storage_close)(gf); } #endif /* not yet in gfarm v2 */ } else { gflog_debug(GFARM_MSG_1001361, "error occurred in gfs_pio_internal_set_view_" "section(): %s", gfarm_error_string(e)); } free(vc); gf->view_context = NULL; gfs_pio_set_view_default(gf); finish: gf->error = e; gfs_profile(gfarm_gettimerval(&t2)); gfs_profile(gfs_pio_set_view_section_time += gfarm_timerval_sub(&t2, &t1)); return (e); } #if 0 /* not yet in gfarm v2 */ gfarm_error_t gfs_pio_set_view_section(GFS_File gf, const char *section, char *if_hostname, int flags) { struct gfs_file_section_context *vc; gfarm_error_t e; int is_local_host; gfarm_timerval_t t1, t2; gfs_profile(gfarm_gettimerval(&t1)); e = gfs_pio_set_view_default(gf); if (e != GFARM_ERR_NO_ERROR) goto profile_finish; GFARM_MALLOC(vc); if (vc == NULL) { e = gf->error = GFARM_ERR_NO_MEMORY; goto profile_finish; } vc->section = strdup(section); if (vc->section == NULL) { free(vc); e = gf->error = GFARM_ERR_NO_MEMORY; goto profile_finish; } /* determine vc->canonical_hostname, GFS_FILE_MODE_UPDATE_METADATA */ retry: if (if_hostname != NULL) { e = gfarm_host_get_canonical_name(if_hostname, &vc->canonical_hostname); if (e == GFARM_ERR_UNKNOWN_HOST || e == GFARM_ERR_INVALID_ARGUMENT /* XXX - gfarm_agent */) { /* FT - invalid hostname, delete section copy info */ (void)gfarm_file_section_copy_info_remove( gf->pi.pathname, vc->section, if_hostname); e = GFARM_ERR_INCONSISTENT_RECOVERABLE; if ((flags & GFARM_FILE_NOT_RETRY) == 0 && (gf->open_flags & GFARM_FILE_NOT_RETRY) == 0) { if_hostname = NULL; goto retry; } goto finish; } else if (e != GFARM_ERR_NO_ERROR) goto finish; if ((gf->mode & GFS_FILE_MODE_FILE_WAS_CREATED) || (((gf->open_flags & GFARM_FILE_CREATE) || (gf->mode & GFS_FILE_MODE_WRITE)) && !gfarm_file_section_info_does_exist( gf->pi.pathname, vc->section))) { gf->mode |= GFS_FILE_MODE_UPDATE_METADATA; flags |= GFARM_FILE_CREATE; } else if ((gf->open_flags & GFARM_FILE_TRUNC) == 0 && !gfarm_file_section_copy_info_does_exist( gf->pi.pathname, vc->section, vc->canonical_hostname)) { e = GFARM_ERR_NO_SUCH_OBJECT; goto free_host; } else if ((gf->mode & GFS_FILE_MODE_WRITE) != 0) gf->mode |= GFS_FILE_MODE_UPDATE_METADATA; } else if ((gf->mode & GFS_FILE_MODE_FILE_WAS_CREATED) || (((gf->open_flags & GFARM_FILE_CREATE) || (gf->mode & GFS_FILE_MODE_WRITE)) && !gfarm_file_section_info_does_exist( gf->pi.pathname, vc->section)) || (gf->open_flags & GFARM_FILE_TRUNC)) { /* * If GFARM_FILE_TRUNC, * we don't have to schedule a host which has a replica. */ if (gfarm_schedule_write_local_priority() && gfarm_is_active_fsnode_to_write(0) && gfarm_host_get_canonical_self_name(&if_hostname) == NULL) { vc->canonical_hostname = strdup(if_hostname); if (vc->canonical_hostname == NULL) { e = GFARM_ERR_NO_MEMORY; goto finish; } } else { /* * local host is not a file system node, or * 'gfsd' on a local host is not running. */ e = gfarm_schedule_search_idle_by_all(1, &if_hostname); if (e != GFARM_ERR_NO_ERROR) goto finish; vc->canonical_hostname = if_hostname; } gf->mode |= GFS_FILE_MODE_UPDATE_METADATA; flags |= GFARM_FILE_CREATE; } else { e = gfarm_file_section_host_schedule_with_priority_to_local( gf->pi.pathname, vc->section, &if_hostname); if (e != GFARM_ERR_NO_ERROR) goto finish; vc->canonical_hostname = if_hostname; /* must be already canonical */ if ((gf->mode & GFS_FILE_MODE_WRITE) != 0) gf->mode |= GFS_FILE_MODE_UPDATE_METADATA; } is_local_host = gfarm_canonical_hostname_is_local(gf->gfm_server, vc->canonical_hostname); gf->ops = &gfs_pio_view_section_ops; gf->view_context = vc; gf->view_flags = flags; gf->p = gf->length = 0; gf->io_offset = gf->offset = 0; gf->mode |= GFS_FILE_MODE_CALC_DIGEST; EVP_DigestInit(&vc->md_ctx, GFS_DEFAULT_DIGEST_MODE); if (!is_local_host && gfarm_is_active_file_system_node && (gf->mode & GFS_FILE_MODE_WRITE) == 0 && ((((gf->open_flags & GFARM_FILE_REPLICATE) != 0 || gf_on_demand_replication ) && (flags & GFARM_FILE_NOT_REPLICATE) == 0) || (flags & GFARM_FILE_REPLICATE) != 0)) { e = replicate_section_to_local(gf, vc->section, vc->canonical_hostname, if_hostname); /* FT - inconsistent metadata has been fixed. try again. */ if (e == GFARM_ERR_INCONSISTENT_RECOVERABLE && (flags & GFARM_FILE_NOT_RETRY) == 0 && (gf->open_flags & GFARM_FILE_NOT_RETRY) == 0) { if_hostname = NULL; free(vc->canonical_hostname); goto retry; } if (e != GFARM_ERR_NO_ERROR) goto free_host; free(vc->canonical_hostname); e = gfarm_host_get_canonical_self_name( &vc->canonical_hostname); if (e != GFARM_ERR_NO_ERROR) goto finish; vc->canonical_hostname = strdup(vc->canonical_hostname); if (vc->canonical_hostname == NULL) { e = GFARM_ERR_NO_MEMORY; goto finish; } is_local_host = 1; } if (is_local_host) e = gfs_pio_open_local_section(gf, flags); else e = gfs_pio_open_remote_section(gf, if_hostname, flags); /* FT - inconsistent metadata has been fixed. try again. */ if (e == GFARM_ERR_INCONSISTENT_RECOVERABLE && (flags & GFARM_FILE_NOT_RETRY) == 0 && (gf->open_flags & GFARM_FILE_NOT_RETRY) == 0) { if_hostname = NULL; free(vc->canonical_hostname); goto retry; } if (e != GFARM_ERR_NO_ERROR) goto free_host; /* update metadata */ if ((gf->mode & GFS_FILE_MODE_FILE_CREATED) != 0) { e = gfs_set_path_info(gf); if (e != GFARM_ERR_NO_ERROR) goto storage_close; } if ((gf->mode & GFS_FILE_MODE_WRITE) || (gf->open_flags & GFARM_FILE_TRUNC)) { /* * if write mode or read-but-truncate mode, * delete every other file copies */ (void)gfs_pio_view_section_set_busy(gf); if ((gf->mode & GFS_FILE_MODE_FILE_WAS_CREATED) == 0) (void)gfs_unlink_every_other_replicas( gf->pi.pathname, vc->section, vc->canonical_hostname); } /* create section copy info */ if (flags & GFARM_FILE_CREATE) { struct gfarm_file_section_copy_info fci; fci.hostname = vc->canonical_hostname; (void)gfarm_file_section_copy_info_set( gf->pi.pathname, vc->section, fci.hostname, &fci); } /* XXX - need to figure out ignorable error or not */ if (gf->open_flags & GFARM_FILE_APPEND) e = gfs_pio_seek(gf, 0, SEEK_END, NULL); storage_close: if (e != GFARM_ERR_NO_ERROR) (void)(*vc->ops->storage_close)(gf); free_digest: if (e != NULL) EVP_DigestFinal(&vc->md_ctx, md_value, &md_len); free_host: if (e != GFARM_ERR_NO_ERROR) free(vc->canonical_hostname); finish: if (e != GFARM_ERR_NO_ERROR) { free(vc->section); free(vc); gf->view_context = NULL; gfs_pio_set_view_default(gf); } gf->error = e; profile_finish: gfs_profile(gfarm_gettimerval(&t2)); gfs_profile(gfs_pio_set_view_section_time += gfarm_timerval_sub(&t2, &t1)); return (e); } gfarm_error_t gfs_pio_set_view_index(GFS_File gf, int nfragments, int fragment_index, char *host, int flags) { char section_string[GFARM_INT32STRLEN + 1]; if (GFS_FILE_IS_PROGRAM(gf)) { gf->error = GFARM_ERR_OPERATION_NOT_PERMITTED; return (gf->error); } if (nfragments == GFARM_FILE_DONTCARE) { if ((gf->mode & GFS_FILE_MODE_NSEGMENTS_FIXED) == 0 && !GFARM_S_IS_PROGRAM(gf->pi.status.st_mode)) { /* DONTCARE isn't permitted in this case */ gf->error = GFARM_ERR_INVALID_ARGUMENT; return (gf->error); } } else { if ((gf->mode & GFS_FILE_MODE_NSEGMENTS_FIXED) == 0) { if ((gf->mode & GFS_FILE_MODE_FILE_WAS_CREATED) == 0 && gf->pi.status.st_nsections > nfragments) { /* GFARM_FILE_TRUNC case */ int i; for (i = nfragments; i < gf->pi.status.st_nsections; i++) { sprintf(section_string, "%d", i); gfs_unlink_section_internal( gf->pi.pathname, section_string); } } gf->pi.status.st_nsections = nfragments; gf->mode |= GFS_FILE_MODE_NSEGMENTS_FIXED; } else if (nfragments != gf->pi.status.st_nsections) { gf->error = GFARM_ERR_FRAGMENT_NUMBER_DOES_NOT_MATCH; return (gf->error); } if (fragment_index < 0 || fragment_index >= nfragments) { gf->error = GFARM_ERR_INVALID_ARGUMENT; return (gf->error); } } sprintf(section_string, "%d", fragment_index); return (gfs_pio_set_view_section(gf, section_string, host, flags)); } char * gfarm_redirect_file(int fd, char *file, GFS_File *gfp) { int nfd; char *e; GFS_File gf; struct gfs_file_section_context *vc; if (file == NULL) return (NULL); e = gfs_pio_create(file, GFARM_FILE_WRONLY|GFARM_FILE_TRUNC, 0644, &gf); if (e != NULL) return (e); e = gfs_pio_set_view_local(gf, 0); if (e != NULL) return (e); nfd = gfs_pio_fileno(gf); if (nfd == -1) return (gfarm_errno_to_error(errno)); /* * XXX This assumes the file fragment is created in the local spool. */ if (dup2(nfd, fd) == -1) e = gfarm_errno_to_error(errno); /* XXX - apparently violating the layer */ assert(gf->ops == &gfs_pio_view_section_ops); vc = gf->view_context; vc->fd = fd; gfs_pio_unset_calc_digest(gf); close(nfd); *gfp = gf; return (NULL); } void gfs_pio_section_display_timers(void) { gflog_info(GFARM_MSG_1000113, "gfs_pio_set_view_section : %f sec", gfs_pio_set_view_section_time); } #endif /* not yet in gfarm v2 */ gfarm-2.4.1/lib/libgfarm/gfarm/iobuffer.h0000644000000000000000000001101711507222724016711 0ustar rootroot/* * FIFO style input/output buffer * * enqueue functions: * gfarm_iobuffer_read() * gfarm_iobuffer_put() * * dequeue functions: * gfarm_iobuffer_write() * gfarm_iobuffer_get() * gfarm_iobuffer_purge() * gfarm_iobuffer_flush_write() * * enqueue side can notify EOF by either * the read_func() hook function returns 0 * or * calling gfarm_iobuffer_set_read_eof() function * * dequeue side can notice EOF by either * gfarm_iobuffer_is_writable(b) && * gfarm_iobuffer_empty(b) * i.e. * gfarm_iobuffer_is_writable(b) && * gfarm_iobuffer_avail_length(b) == 0 * i.e. * gfarm_iobuffer_is_eof(b) && * !gfarm_iobuffer_is_write_eof(b) * or * the write_close() hook function is called at dequeue operation. * note that the write_close() hook will be called at the dequeue * function call just after the above conditions become true. * * Once a dequeue function is called after the above conditions * (i.e. once a write_close() hook is called), the above conditions becomes * untrue, and the following conditions become true: * gfarm_iobuffer_is_write_eof(b) * and * !gfarm_iobuffer_is_writable(b) * * of course, the following conditions are all true at that time: * gfarm_iobuffer_empty(b) * and * gfarm_iobuffer_avail_length(b) == 0 * and * gfarm_iobuffer_is_read_eof(b) * and * gfarm_iobuffer_is_eof(b) * * Note that users of this module should check gfarm_iobuffer_get_error(b) * as well as the above eof conditions. */ struct gfarm_iobuffer; struct gfarm_iobuffer *gfarm_iobuffer_alloc(int); void gfarm_iobuffer_free(struct gfarm_iobuffer *); int gfarm_iobuffer_get_size(struct gfarm_iobuffer *); void gfarm_iobuffer_set_error(struct gfarm_iobuffer *, int); int gfarm_iobuffer_get_error(struct gfarm_iobuffer *); int gfarm_iobuffer_empty(struct gfarm_iobuffer *); int gfarm_iobuffer_full(struct gfarm_iobuffer *); int gfarm_iobuffer_avail_length(struct gfarm_iobuffer *); void gfarm_iobuffer_set_read_eof(struct gfarm_iobuffer *); void gfarm_iobuffer_clear_read_eof(struct gfarm_iobuffer *); int gfarm_iobuffer_is_read_eof(struct gfarm_iobuffer *); void gfarm_iobuffer_clear_write_eof(struct gfarm_iobuffer *); int gfarm_iobuffer_is_write_eof(struct gfarm_iobuffer *); int gfarm_iobuffer_is_readable(struct gfarm_iobuffer *); int gfarm_iobuffer_is_writable(struct gfarm_iobuffer *); int gfarm_iobuffer_is_eof(struct gfarm_iobuffer *); /* enqueue */ void gfarm_iobuffer_set_read(struct gfarm_iobuffer *, int (*)(struct gfarm_iobuffer *, void *, int, void *, int), void *, int); void *gfarm_iobuffer_get_read_cookie(struct gfarm_iobuffer *); int gfarm_iobuffer_get_read_fd(struct gfarm_iobuffer *); void gfarm_iobuffer_read(struct gfarm_iobuffer *, int *); int gfarm_iobuffer_put(struct gfarm_iobuffer *, const void *, int); /* dequeue */ void gfarm_iobuffer_set_write_close(struct gfarm_iobuffer *, void (*)(struct gfarm_iobuffer *, void *, int)); void gfarm_iobuffer_set_write(struct gfarm_iobuffer *, int (*)(struct gfarm_iobuffer *, void *, int, void *, int), void *, int); void *gfarm_iobuffer_get_write_cookie(struct gfarm_iobuffer *); int gfarm_iobuffer_get_write_fd(struct gfarm_iobuffer *); void gfarm_iobuffer_write(struct gfarm_iobuffer *, int *); int gfarm_iobuffer_purge(struct gfarm_iobuffer *, int *); int gfarm_iobuffer_get(struct gfarm_iobuffer *, void *, int); void gfarm_iobuffer_flush_write(struct gfarm_iobuffer *); /* enqueue by memory copy, dequeue by write */ int gfarm_iobuffer_put_write(struct gfarm_iobuffer *, const void *, int); /* enqueue by read, dequeue by purge */ int gfarm_iobuffer_purge_read_x(struct gfarm_iobuffer *, int, int); /* enqueue by read, dequeue by memory copy */ int gfarm_iobuffer_get_read_x(struct gfarm_iobuffer *, void *, int, int); int gfarm_iobuffer_get_read_just(struct gfarm_iobuffer *, void *, int); int gfarm_iobuffer_get_read(struct gfarm_iobuffer *, void *, int); int gfarm_iobuffer_get_read_partial_x(struct gfarm_iobuffer *, void *,int,int); int gfarm_iobuffer_get_read_partial_just(struct gfarm_iobuffer *, void *, int); int gfarm_iobuffer_get_read_partial(struct gfarm_iobuffer *, void *, int); /* * gfarm_iobuffer_get_read{,_partial}_just() functions doesn't perform * read ahead for given stream, so the caller can perform read operation * for the stream without calling iobuffer layer or with another iobuffer * at subsequent the call. * gfarm_iobuffer_{purge_read,get_read{,_partial}}_x() functions take * the `just' flag at its last argument. */ /* default operation for gfarm_iobuffer_set_write_close() */ void gfarm_iobuffer_write_close_nop(struct gfarm_iobuffer *, void *, int); gfarm-2.4.1/lib/libgfarm/gfarm/gfs_proto.c0000644000000000000000000000214211507222723017103 0ustar rootroot#include #include #include #include #include #include #include #include "gfs_proto.h" char GFS_SERVICE_TAG[] = "gfarm-data"; /* * Not really public interface, * but common routine called from both client and server. */ int gfs_digest_calculate_local(int fd, char *buffer, size_t buffer_size, const EVP_MD *md_type, EVP_MD_CTX *md_ctx, size_t *md_lenp, unsigned char *md_value, gfarm_off_t *filesizep) { int size, save_errno; gfarm_off_t off = 0; unsigned int len; if (lseek(fd, (off_t)0, 0) == -1) { save_errno = errno; gflog_debug(GFARM_MSG_1001020, "lseek() failed: %s", strerror(save_errno)); return (save_errno); } EVP_DigestInit(md_ctx, md_type); while ((size = read(fd, buffer, buffer_size)) > 0) { EVP_DigestUpdate(md_ctx, buffer, size); off += size; } EVP_DigestFinal(md_ctx, md_value, &len); *md_lenp = len; *filesizep = off; if (size == -1) { save_errno = errno; gflog_debug(GFARM_MSG_1001021, "read() failed: %s", strerror(save_errno)); return (save_errno); } return (0); } gfarm-2.4.1/lib/libgfarm/gfarm/io_gfsl.c0000644000000000000000000001511711507222723016531 0ustar rootroot/* * iobuffer operation: GSI communication: GFSL / Globus GSS API / OpenSSL */ #include #include #include #include #include #include #include #include #include #include #include #include #include "gfutil.h" #include "gfarm_secure_session.h" #include "liberror.h" #include "iobuffer.h" #include "gfp_xdr.h" #include "io_fd.h" #include "io_gfsl.h" /* * for "gsi" method */ struct io_gfsl { gfarmSecSession *session; gss_cred_id_t cred_to_be_freed; /* cred which will be freed at close */ gfarmExportedCredential *exported_credential; /* for read */ char *buffer; int p, residual; }; /* * only blocking i/o is available. */ int gfarm_iobuffer_read_secsession_op(struct gfarm_iobuffer *b, void *cookie, int fd, void *data, int length) { struct io_gfsl *io = cookie; int rv; if (io->buffer == NULL) { int flag = fcntl(fd, F_GETFL, NULL); /* temporary drop O_NONBLOCK flag to prevent EAGAIN */ if (flag & O_NONBLOCK) fcntl(fd, F_SETFL, flag & ~O_NONBLOCK); rv = gfarmSecSessionReceiveInt8(io->session, &io->buffer, &io->residual); if (flag & O_NONBLOCK) fcntl(fd, F_SETFL, flag); if (rv <= 0) { /* XXX - interpret io->session->gssLastStat */ /* XXX - set GFARM_ERR_BROKEN_PIPE to reconnect */ gfarm_iobuffer_set_error(b, GFARM_ERR_BROKEN_PIPE); return (rv); } io->p = 0; } if (io->residual <= length) { rv = io->residual; memcpy(data, &io->buffer[io->p], rv); free(io->buffer); io->buffer = NULL; io->p = io->residual = 0; } else { rv = length; memcpy(data, &io->buffer[io->p], rv); io->p += rv; io->residual -= rv; } return (rv); } int gfarm_iobuffer_write_secsession_op(struct gfarm_iobuffer *b, void *cookie, int fd, void *data, int length) { struct io_gfsl *io = cookie; int rv, flag = fcntl(fd, F_GETFL, NULL); /* temporary drop O_NONBLOCK flag to prevent EAGAIN */ if (flag & O_NONBLOCK) fcntl(fd, F_SETFL, flag & ~O_NONBLOCK); rv = gfarmSecSessionSendInt8(io->session, data, length); if (flag & O_NONBLOCK) fcntl(fd, F_SETFL, flag); if (rv <= 0) { /* XXX - interpret io->session->gssLastStat */ /* XXX - set GFARM_ERR_BROKEN_PIPE to reconnect */ gfarm_iobuffer_set_error(b, GFARM_ERR_BROKEN_PIPE); } return (rv); } static void free_secsession(struct io_gfsl *io) { OM_uint32 e_major, e_minor; gfarmSecSessionTerminate(io->session); if (io->cred_to_be_freed != GSS_C_NO_CREDENTIAL && gfarmGssDeleteCredential(&io->cred_to_be_freed, &e_major, &e_minor) < 0 && gflog_auth_get_verbose()) { gflog_error(GFARM_MSG_1000725, "Can't free my credential because of:"); gfarmGssPrintMajorStatus(e_major); gfarmGssPrintMinorStatus(e_minor); } if (io->buffer != NULL) free(io->buffer); free(io); } /* * gfp_xdr operation */ gfarm_error_t gfp_iobuffer_close_secsession_op(void *cookie, int fd) { int rv; gfarm_error_t e = GFARM_ERR_NO_ERROR; free_secsession(cookie); rv = close(fd); if (rv == -1) e = gfarm_errno_to_error(errno); return (e); } gfarm_error_t gfp_iobuffer_export_credential_secsession_op(void *cookie) { struct io_gfsl *io = cookie; OM_uint32 e_major; gss_cred_id_t cred; cred = gfarmSecSessionGetDelegatedCredential(io->session); if (cred == GSS_C_NO_CREDENTIAL) return (GFARM_ERRMSG_GSI_DELEGATED_CREDENTIAL_NOT_EXIST); io->exported_credential = gfarmGssExportCredential(cred, &e_major); if (io->exported_credential == NULL) return (GFARM_ERRMSG_GSI_DELEGATED_CREDENTIAL_CANNOT_EXPORT); return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfp_iobuffer_delete_credential_secsession_op(void *cookie, int sighandler) { struct io_gfsl *io = cookie; if (io->exported_credential == NULL) return (GFARM_ERR_NO_ERROR); gfarmGssDeleteExportedCredential(io->exported_credential, sighandler); io->exported_credential = NULL; return (GFARM_ERR_NO_ERROR); } char * gfp_iobuffer_env_for_credential_secsession_op(void *cookie) { struct io_gfsl *io = cookie; if (io->exported_credential == NULL) return (NULL); return (gfarmGssEnvForExportedCredential(io->exported_credential)); } struct gfp_iobuffer_ops gfp_xdr_secsession_iobuffer_ops = { gfp_iobuffer_close_secsession_op, gfp_iobuffer_export_credential_secsession_op, gfp_iobuffer_delete_credential_secsession_op, gfp_iobuffer_env_for_credential_secsession_op, gfarm_iobuffer_read_secsession_op, gfarm_iobuffer_write_secsession_op, gfarm_iobuffer_read_secsession_op, gfarm_iobuffer_write_secsession_op }; gfarm_error_t gfp_xdr_set_secsession(struct gfp_xdr *conn, gfarmSecSession *secsession, gss_cred_id_t cred_to_be_freed) { struct io_gfsl *io; GFARM_MALLOC(io); if (io == NULL) { gflog_debug(GFARM_MSG_1001480, "allocation of 'io_gfsl' failed: %s", gfarm_error_string(GFARM_ERR_NO_MEMORY)); return (GFARM_ERR_NO_MEMORY); } io->session = secsession; io->cred_to_be_freed = cred_to_be_freed; io->exported_credential = NULL; io->buffer = NULL; io->p = io->residual = 0; gfp_xdr_set(conn, &gfp_xdr_secsession_iobuffer_ops, io, secsession->fd); return (GFARM_ERR_NO_ERROR); } /* free resources which were allocated by gfp_xdr_set_secsession() */ void gfp_xdr_reset_secsession(struct gfp_xdr *conn) { struct io_gfsl *io = gfp_xdr_cookie(conn); if (io != NULL) free_secsession(io); gfp_xdr_set(conn, &gfp_xdr_secsession_iobuffer_ops, NULL, -1); } /* * an option for gfarm_iobuffer_set_write_close() */ #if 0 /* currently not used */ void gfarm_iobuffer_write_close_secsession_op(struct gfarm_iobuffer *b, void *cookie, int fd) { struct io_gfsl *io = cookie; gfarm_error_t e = gfp_iobuffer_close_secsession_op(io, fd); if (e != GFARM_ERR_NO_ERROR && gfarm_iobuffer_get_error(b) == 0) gfarm_iobuffer_set_error(b, e); } #endif /* currently not used */ /* * for "gsi_auth" method */ static struct gfp_iobuffer_ops gfp_xdr_insecure_gsi_session_iobuffer_ops = { gfp_iobuffer_close_secsession_op, gfp_iobuffer_export_credential_secsession_op, gfp_iobuffer_delete_credential_secsession_op, gfp_iobuffer_env_for_credential_secsession_op, /* NOTE: the following assumes that these functions don't use cookie */ gfarm_iobuffer_nonblocking_read_fd_op, gfarm_iobuffer_nonblocking_write_socket_op, gfarm_iobuffer_blocking_read_fd_op, gfarm_iobuffer_blocking_write_socket_op }; /* * downgrade * from a "gsi" connection which is created by gfp_xdr_set_secsession() * to a "gsi_auth" connection. */ void gfp_xdr_downgrade_to_insecure_session(struct gfp_xdr *conn) { gfp_xdr_set(conn, &gfp_xdr_insecure_gsi_session_iobuffer_ops, gfp_xdr_cookie(conn), gfp_xdr_fd(conn)); } gfarm-2.4.1/lib/libgfarm/gfarm/gfs_proto.h0000644000000000000000000000403011507222723017106 0ustar rootroot#ifndef GFSD_DEFAULT_PORT #define GFSD_DEFAULT_PORT 600 #endif #ifndef XAUTH_COMMAND #define XAUTH_COMMAND "xauth" #endif /* * 1: protocol until gfarm 2.3 * 2: protocol since gfarm 2.4 */ #define GFS_PROTOCOL_VERSION_V2_3 1 #define GFS_PROTOCOL_VERSION_V2_4 2 #define GFS_PROTOCOL_VERSION GFS_PROTOCOL_VERSION_V2_4 enum gfs_proto_command { /* from client */ GFS_PROTO_PROCESS_SET, GFS_PROTO_OPEN_LOCAL, GFS_PROTO_OPEN, GFS_PROTO_CLOSE, GFS_PROTO_PREAD, GFS_PROTO_PWRITE, GFS_PROTO_FTRUNCATE, GFS_PROTO_FSYNC, GFS_PROTO_FSTAT, GFS_PROTO_CKSUM_SET, GFS_PROTO_LOCK, GFS_PROTO_TRYLOCK, GFS_PROTO_UNLOCK, GFS_PROTO_LOCK_INFO, GFS_PROTO_REPLICA_ADD, /* for COMPAT_GFARM_2_3 */ GFS_PROTO_REPLICA_ADD_FROM, /* for COMPAT_GFARM_2_3 */ GFS_PROTO_REPLICA_RECV, GFS_PROTO_STATFS, GFS_PROTO_COMMAND, /* from gfmd */ GFS_PROTO_FHSTAT, GFS_PROTO_FHREMOVE, GFS_PROTO_STATUS, GFS_PROTO_REPLICATION_REQUEST, GFS_PROTO_REPLICATION_CANCEL, }; /* * For better remote read performance, subtract 8 byte (errno and the * size of data of gfs_client_pread) to fill up the iobuffer. */ #define GFS_PROTO_MAX_IOSIZE (1048576 - 8) /* * sub protocols of GFS_PROTO_COMMAND */ enum gfs_proto_command_client { GFS_PROTO_COMMAND_EXIT_STATUS, GFS_PROTO_COMMAND_SEND_SIGNAL, GFS_PROTO_COMMAND_FD_INPUT, }; enum gfs_proto_command_server { GFS_PROTO_COMMAND_EXITED, GFS_PROTO_COMMAND_STOPPED, /* currently not used */ GFS_PROTO_COMMAND_FD_OUTPUT, }; /* * sub protocol of GFS_PROTO_FSYNC */ enum gfs_proto_fsync_operation { GFS_PROTO_FSYNC_WITHOUT_METADATA, GFS_PROTO_FSYNC_WITH_METADATA }; #define GFARM_DEFAULT_COMMAND_IOBUF_SIZE 0x4000 #define GFSD_MAX_PASSING_FD 5 /* used for both gfsd local privilege and global username of sharedsecret */ #define GFSD_USERNAME "_gfarmfs" #define GFSD_LOCAL_SOCKET_DIR "/tmp/.gfarm-gfsd%s-%d" #define GFSD_LOCAL_SOCKET_NAME GFSD_LOCAL_SOCKET_DIR "/sock" #define GFSD_MAX_PASSING_FD 5 #define FDESC_STDIN 0 #define FDESC_STDOUT 1 #define FDESC_STDERR 2 #define NFDESC 3 extern char GFS_SERVICE_TAG[]; gfarm-2.4.1/lib/libgfarm/gfarm/gfs_rmdir.c0000644000000000000000000000117211507222723017057 0ustar rootroot#include #include gfarm_error_t gfs_rmdir(const char *path) { gfarm_error_t e; struct gfs_stat st; int is_dir; e = gfs_stat(path, &st); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001394, "gfs_stat(%s) failed: %s", path, gfarm_error_string(e)); return (e); } is_dir = GFARM_S_ISDIR(st.st_mode); gfs_stat_free(&st); if (!is_dir) { gflog_debug(GFARM_MSG_1001395, "Not a directory(%s): %s", path, gfarm_error_string(GFARM_ERR_NOT_A_DIRECTORY)); return (GFARM_ERR_NOT_A_DIRECTORY); } /* XXX FIXME there is race condition here */ return (gfs_remove(path)); } gfarm-2.4.1/lib/libgfarm/gfarm/gfs_pio.c0000644000000000000000000007722411507222723016544 0ustar rootroot/* * $Id: gfs_pio.c 4902 2010-11-12 16:15:23Z tatebe $ */ #include /* mode_t */ #include /* umask() */ #include #include #include #include #include #include /* [FRWX]_OK */ #include #include #define GFARM_INTERNAL_USE #include #include "timer.h" #include "gfutil.h" #include "liberror.h" #include "gfs_profile.h" #include "gfm_client.h" #include "gfs_proto.h" /* GFS_PROTO_FSYNC_* */ #include "gfs_io.h" #include "gfs_pio.h" #include "config.h" /* XXX FIXME this shouldn't be needed here */ /* * GFARM_ERRMSG_GFS_PIO_IS_EOF is used as mark of EOF, * and shouldn't be returned to caller functions. */ int gfs_pio_eof(GFS_File gf) { return (gf->error == GFARM_ERRMSG_GFS_PIO_IS_EOF); } #define GFS_PIO_ERROR(gf) \ ((gf)->error != GFARM_ERRMSG_GFS_PIO_IS_EOF ? \ (gf)->error : GFARM_ERR_NO_ERROR) gfarm_error_t gfs_pio_error(GFS_File gf) { return (GFS_PIO_ERROR(gf)); } void gfs_pio_clearerr(GFS_File gf) { gf->error = GFARM_ERR_NO_ERROR; } static gfarm_error_t gfs_pio_is_view_set(GFS_File gf) { return (gf->view_context != NULL); } gfarm_error_t gfs_pio_set_view_default(GFS_File gf) { gfarm_error_t e, e_save = GFARM_ERR_NO_ERROR; if (gfs_pio_is_view_set(gf)) { if ((gf->mode & GFS_FILE_MODE_WRITE) != 0) e_save = gfs_pio_flush(gf); e = (*gf->ops->view_close)(gf); if (e_save == GFARM_ERR_NO_ERROR) e_save = e; } gf->ops = NULL; gf->view_context = NULL; #if 0 /* not yet in gfarm v2 */ gf->view_flags = 0; #endif /* not yet in gfarm v2 */ gf->error = e_save; if (e_save != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001292, "gfs_pio_isview_set() is false or " "view_close() failed: %s", gfarm_error_string(e_save)); } return (e_save); } static gfarm_error_t gfs_pio_check_view_default(GFS_File gf) { gfarm_error_t e; e = GFS_PIO_ERROR(gf); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001293, "GFS_PIO_ERROR: %s", gfarm_error_string(e)); return (e); } if (!gfs_pio_is_view_set(gf)) /* view isn't set yet */ #if 0 /* not yet in gfarm v2 */ return (gfs_pio_set_view_global(gf, 0)); #else /* not yet in gfarm v2 */ return (gfs_pio_internal_set_view_section(gf, NULL)); #endif /* not yet in gfarm v2 */ return (GFARM_ERR_NO_ERROR); } struct gfm_connection * gfs_pio_metadb(GFS_File gf) { return (gf->gfm_server); } /* gfs_pio_fileno returns a network-wide file descriptor in Gfarm v2 */ int gfs_pio_fileno(GFS_File gf) { return (gf == NULL ? -1 : gf->fd); } static gfarm_error_t gfs_file_alloc(struct gfm_connection *gfm_server, gfarm_int32_t fd, int flags, GFS_File *gfp) { GFS_File gf; char *buffer; GFARM_MALLOC(gf); GFARM_MALLOC_ARRAY(buffer, GFS_FILE_BUFSIZE); if (buffer == NULL || gf == NULL) { if (buffer != NULL) free(buffer); if (gf != NULL) free(gf); gflog_debug(GFARM_MSG_1001294, "allocation of GFS_File or it's buffer failed: %s", gfarm_error_string(GFARM_ERR_NO_MEMORY)); return (GFARM_ERR_NO_MEMORY); } memset(gf, 0, sizeof(*gf)); gf->gfm_server = gfm_server; gf->fd = fd; gf->mode = 0; switch (flags & GFARM_FILE_ACCMODE) { case GFARM_FILE_RDONLY: gf->mode |= GFS_FILE_MODE_READ; break; case GFARM_FILE_WRONLY: gf->mode |= GFS_FILE_MODE_WRITE; break; case GFARM_FILE_RDWR: gf->mode |= GFS_FILE_MODE_READ|GFS_FILE_MODE_WRITE; break; } gf->open_flags = flags; gf->error = GFARM_ERR_NO_ERROR; gf->io_offset = 0; gf->buffer = buffer; gf->p = 0; gf->length = 0; gf->offset = 0; gf->view_context = NULL; gfs_pio_set_view_default(gf); *gfp = gf; return (GFARM_ERR_NO_ERROR); } static void gfs_file_free(GFS_File gf) { free(gf->buffer); /* do not touch gf->pi here */ free(gf); } static double gfs_pio_create_time; static double gfs_pio_open_time; static double gfs_pio_close_time; static double gfs_pio_seek_time; static double gfs_pio_truncate_time; static double gfs_pio_read_time; static double gfs_pio_write_time; static double gfs_pio_sync_time; static double gfs_pio_datasync_time; static double gfs_pio_getline_time; static double gfs_pio_getc_time; static double gfs_pio_putc_time; gfarm_error_t gfs_pio_create(const char *url, int flags, gfarm_mode_t mode, GFS_File *gfp) { gfarm_error_t e; struct gfm_connection *gfm_server; int fd, type; gfarm_timerval_t t1, t2; GFARM_TIMEVAL_FIX_INITIALIZE_WARNING(t1); gfs_profile(gfarm_gettimerval(&t1)); if ((e = gfm_create_fd(url, flags, mode, &gfm_server, &fd, &type)) == GFARM_ERR_NO_ERROR) { if (type != GFS_DT_REG) { e = type == GFS_DT_DIR ? GFARM_ERR_IS_A_DIRECTORY : type == GFS_DT_LNK ? GFARM_ERR_IS_A_SYMBOLIC_LINK : GFARM_ERR_OPERATION_NOT_PERMITTED; } else e = gfs_file_alloc(gfm_server, fd, flags, gfp); if (e != GFARM_ERR_NO_ERROR) { (void)gfm_close_fd(gfm_server, fd); /* ignore result */ gfm_client_connection_free(gfm_server); gflog_debug(GFARM_MSG_1001295, "creation of pio for URL (%s) failed: %s", url, gfarm_error_string(e)); } } else { gflog_debug(GFARM_MSG_1001296, "creation of file descriptor for URL (%s): %s", url, gfarm_error_string(e)); } gfs_profile(gfarm_gettimerval(&t2)); gfs_profile(gfs_pio_create_time += gfarm_timerval_sub(&t2, &t1)); return (e); } gfarm_error_t gfs_pio_open(const char *url, int flags, GFS_File *gfp) { gfarm_error_t e; struct gfm_connection *gfm_server; int fd, type; gfarm_timerval_t t1, t2; GFARM_TIMEVAL_FIX_INITIALIZE_WARNING(t1); gfs_profile(gfarm_gettimerval(&t1)); if ((e = gfm_open_fd(url, flags, &gfm_server, &fd, &type)) == GFARM_ERR_NO_ERROR) { if (type != GFS_DT_REG) { e = type == GFS_DT_DIR ? GFARM_ERR_IS_A_DIRECTORY : type == GFS_DT_LNK ? GFARM_ERR_IS_A_SYMBOLIC_LINK : GFARM_ERR_OPERATION_NOT_PERMITTED; } else e = gfs_file_alloc(gfm_server, fd, flags, gfp); if (e != GFARM_ERR_NO_ERROR) { (void)gfm_close_fd(gfm_server, fd); /* ignore result */ gfm_client_connection_free(gfm_server); gflog_debug(GFARM_MSG_1001297, "open operation on pio for URL (%s) failed: %s", url, gfarm_error_string(e)); } } else { gflog_debug(GFARM_MSG_1001298, "open operation on file descriptor for URL (%s) " "failed: %s", url, gfarm_error_string(e)); } gfs_profile(gfarm_gettimerval(&t2)); gfs_profile(gfs_pio_open_time += gfarm_timerval_sub(&t2, &t1)); return (e); } #if 0 /* not yet in gfarm v2 */ gfarm_error_t gfs_pio_get_nfragment(GFS_File gf, int *nfragmentsp) { if (GFS_FILE_IS_PROGRAM(gf)) return (GFARM_ERR_OPERATION_NOT_PERMITTED); if ((gf->mode & GFS_FILE_MODE_NSEGMENTS_FIXED) == 0) return (GFARM_ERR_FRAGMENT_INDEX_NOT_AVAILABLE); *nfragmentsp = gf->pi.status.st_nsections; return (GFARM_ERR_NO_ERROR); } #endif /* not yet in gfarm v2 */ gfarm_error_t gfs_pio_close(GFS_File gf) { gfarm_error_t e, e_save; gfarm_timerval_t t1, t2; GFARM_TIMEVAL_FIX_INITIALIZE_WARNING(t1); gfs_profile(gfarm_gettimerval(&t1)); /* * no need to check and set the default file view here * because neither gfs_pio_flush nor view_close is not * needed unless the file view is specified by some * operation. */ e_save = GFARM_ERR_NO_ERROR; if (gfs_pio_is_view_set(gf)) { if ((gf->mode & GFS_FILE_MODE_WRITE) != 0) e_save = gfs_pio_flush(gf); e = (*gf->ops->view_close)(gf); if (e_save == GFARM_ERR_NO_ERROR) e_save = e; } e = gfm_close_fd(gf->gfm_server, gfs_pio_fileno(gf)); if (e_save == GFARM_ERR_NO_ERROR) e_save = e; gfm_client_connection_free(gf->gfm_server); gfs_file_free(gf); gfs_profile(gfarm_gettimerval(&t2)); gfs_profile(gfs_pio_close_time += gfarm_timerval_sub(&t2, &t1)); if (e_save != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001299, "close operation on pio failed: %s", gfarm_error_string(e_save)); } return (e_save); } static gfarm_error_t gfs_pio_purge(GFS_File gf) { gf->offset += gf->p; gf->p = gf->length = 0; return (GFARM_ERR_NO_ERROR); } #define CHECK_WRITABLE(gf) { \ if (((gf)->mode & GFS_FILE_MODE_WRITE) == 0) \ return (gfarm_errno_to_error(EBADF)); \ else if ((gf)->error == GFARM_ERRMSG_GFS_PIO_IS_EOF) \ (gf)->error = GFARM_ERR_NO_ERROR; \ } /* * we check this against gf->open_flags rather than gf->mode, * because we may set GFARM_FILE_MODE_READ even if write-only case. */ #define CHECK_READABLE(gf) { \ if (((gf)->open_flags & GFARM_FILE_ACCMODE) == GFARM_FILE_WRONLY) \ return (gfarm_errno_to_error(EBADF)); \ } #define CHECK_READABLE_EOF(gf) { \ if (((gf)->open_flags & GFARM_FILE_ACCMODE) == GFARM_FILE_WRONLY) \ return (EOF); \ } static gfarm_error_t gfs_pio_fillbuf(GFS_File gf, size_t size) { gfarm_error_t e; size_t len; CHECK_READABLE(gf); if (gf->error != GFARM_ERR_NO_ERROR) { /* error or EOF? */ if (GFS_PIO_ERROR(gf) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001300, "CHECK_READABLE failed: %s", gfarm_error_string(GFS_PIO_ERROR(gf))); } return (GFS_PIO_ERROR(gf)); } if (gf->p < gf->length) return (GFARM_ERR_NO_ERROR); if ((gf->mode & GFS_FILE_MODE_BUFFER_DIRTY) != 0) { e = gfs_pio_flush(gf); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001301, "gfs_pio_flush() failed: %s", gfarm_error_string(e)); return (e); } } else gfs_pio_purge(gf); if (gf->io_offset != gf->offset) { gf->mode &= ~GFS_FILE_MODE_CALC_DIGEST; gf->io_offset = gf->offset; } e = (*gf->ops->view_pread)(gf, gf->buffer, size, gf->io_offset, &len); if (e != GFARM_ERR_NO_ERROR) { gf->error = e; gflog_debug(GFARM_MSG_1001302, "view_pread() failed: %s", gfarm_error_string(e)); return (e); } gf->length = len; gf->io_offset += len; if (len == 0) gf->error = GFARM_ERRMSG_GFS_PIO_IS_EOF; return (GFARM_ERR_NO_ERROR); } /* unlike other functions, this returns `*writtenp' even if an error happens */ static gfarm_error_t do_write(GFS_File gf, const char *buffer, size_t length, size_t *writtenp) { gfarm_error_t e = GFARM_ERR_NO_ERROR; size_t written, len; if (length == 0) { *writtenp = 0; return (GFARM_ERR_NO_ERROR); } if (gf->io_offset != gf->offset) { gf->mode &= ~GFS_FILE_MODE_CALC_DIGEST; gf->io_offset = gf->offset; } for (written = 0; written < length; written += len) { e = (*gf->ops->view_pwrite)( gf, buffer + written, length - written, gf->io_offset, &len); if (e != GFARM_ERR_NO_ERROR) { gf->error = e; gflog_debug(GFARM_MSG_1001303, "view_pwrite() failed: %s", gfarm_error_string(e)); break; } gf->io_offset += len; } *writtenp = written; return (e); } gfarm_error_t gfs_pio_flush(GFS_File gf) { gfarm_error_t e = gfs_pio_check_view_default(gf); size_t written; if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001304, "gfs_pio_check_view_default() failed: %s", gfarm_error_string(e)); return (e); } CHECK_WRITABLE(gf); if ((gf->mode & GFS_FILE_MODE_BUFFER_DIRTY) != 0) { e = do_write(gf, gf->buffer, gf->length, &written); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001305, "do_write() failed: %s", gfarm_error_string(e)); return (e); } gf->mode &= ~GFS_FILE_MODE_BUFFER_DIRTY; } if (gf->p >= gf->length) gfs_pio_purge(gf); return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfs_pio_seek(GFS_File gf, gfarm_off_t offset, int whence, gfarm_off_t *resultp) { gfarm_error_t e; gfarm_off_t where; gfarm_timerval_t t1, t2; GFARM_TIMEVAL_FIX_INITIALIZE_WARNING(t1); gfs_profile(gfarm_gettimerval(&t1)); e = gfs_pio_check_view_default(gf); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001306, "gfs_pio_check_view_default() failed: %s", gfarm_error_string(e)); goto finish; } if (gf->error == GFARM_ERRMSG_GFS_PIO_IS_EOF) gf->error = GFARM_ERR_NO_ERROR; switch (whence) { case GFARM_SEEK_SET: where = offset; break; case GFARM_SEEK_CUR: where = offset + gf->offset + gf->p; break; case GFARM_SEEK_END: /* XXX FIXME: ask the file size to gfsd. */ e = gf->error = GFARM_ERR_FUNCTION_NOT_IMPLEMENTED; gflog_debug(GFARM_MSG_1001307, "GFARM_SEEK_END option is not supported: %s", gfarm_error_string(e)); goto finish; default: e = gf->error = GFARM_ERR_INVALID_ARGUMENT; gflog_debug(GFARM_MSG_1001308, "invalid argument whence(%d): %s", whence, gfarm_error_string(e)); goto finish; } if (where < 0) { e = gf->error = GFARM_ERR_INVALID_ARGUMENT; gflog_debug(GFARM_MSG_1001309, "invalid argument: %s", gfarm_error_string(e)); goto finish; } /* * This is the case that the file offset will be repositioned * within the current io buffer. */ if (gf->offset <= where && where <= gf->offset + gf->length) { /* * We don't have to clear GFS_FILE_MODE_CALC_DIGEST bit here, * because this is no problem to calculate checksum for * write-only or read-only case. * This is also ok on switching from writing to reading. * This is not ok on switching from reading to writing, * but gfs_pio_flush() clears the bit at that case. */ gf->p = where - gf->offset; if (resultp != NULL) *resultp = where; e = GFARM_ERR_NO_ERROR; goto finish; } gf->mode &= ~GFS_FILE_MODE_CALC_DIGEST; if (gf->mode & GFS_FILE_MODE_BUFFER_DIRTY) { e = gfs_pio_flush(gf); if (e != GFARM_ERR_NO_ERROR) { gf->error = e; gflog_debug(GFARM_MSG_1001310, "gfs_pio_flush() failed: %s", gfarm_error_string(e)); goto finish; } } e = gf->error = GFARM_ERR_NO_ERROR; /* purge EOF/error state */ gfs_pio_purge(gf); gf->offset = gf->io_offset = where; if (resultp != NULL) *resultp = where; finish: gfs_profile(gfarm_gettimerval(&t2)); gfs_profile(gfs_pio_seek_time += gfarm_timerval_sub(&t2, &t1)); return (e); } gfarm_error_t gfs_pio_truncate(GFS_File gf, gfarm_off_t length) { gfarm_error_t e; gfarm_timerval_t t1, t2; GFARM_TIMEVAL_FIX_INITIALIZE_WARNING(t1); gfs_profile(gfarm_gettimerval(&t1)); e = gfs_pio_check_view_default(gf); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001311, "gfs_pio_check_view_default() failed %s", gfarm_error_string(e)); goto finish; } CHECK_WRITABLE(gf); gf->mode &= ~GFS_FILE_MODE_CALC_DIGEST; if (gf->mode & GFS_FILE_MODE_BUFFER_DIRTY) { e = gfs_pio_flush(gf); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001312, "gfs_pio_flush(): %s", gfarm_error_string(e)); goto finish; } } gf->error = GFARM_ERR_NO_ERROR; /* purge EOF/error state */ gfs_pio_purge(gf); e = (*gf->ops->view_ftruncate)(gf, length); if (e != GFARM_ERR_NO_ERROR) gf->error = e; finish: gfs_profile(gfarm_gettimerval(&t2)); gfs_profile(gfs_pio_truncate_time += gfarm_timerval_sub(&t2, &t1)); return (e); } gfarm_error_t gfs_pio_read(GFS_File gf, void *buffer, int size, int *np) { gfarm_error_t e; char *p = buffer; int n = 0; int length; gfarm_timerval_t t1, t2; GFARM_TIMEVAL_FIX_INITIALIZE_WARNING(t1); gfs_profile(gfarm_gettimerval(&t1)); e = gfs_pio_check_view_default(gf); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001313, "Check view default for pio failed: %s", gfarm_error_string(e)); return (e); } CHECK_READABLE(gf); while (size > 0) { if ((e = gfs_pio_fillbuf(gf, ((gf->open_flags & GFARM_FILE_UNBUFFERED) && size < GFS_FILE_BUFSIZE) ? size : GFS_FILE_BUFSIZE)) != GFARM_ERR_NO_ERROR) break; if (gf->error != GFARM_ERR_NO_ERROR) /* EOF or error */ break; length = gf->length - gf->p; if (length > size) length = size; memcpy(p, gf->buffer + gf->p, length); p += length; n += length; size -= length; gf->p += length; } if (e != GFARM_ERR_NO_ERROR && n == 0) { gflog_debug(GFARM_MSG_1001314, "gfs_pio_fillbuf() failed: %s", gfarm_error_string(e)); goto finish; } if (gf->open_flags & GFARM_FILE_UNBUFFERED) gfs_pio_purge(gf); *np = n; e = GFARM_ERR_NO_ERROR; finish: gfs_profile(gfarm_gettimerval(&t2)); gfs_profile(gfs_pio_read_time += gfarm_timerval_sub(&t2, &t1)); return (e); } gfarm_error_t gfs_pio_write(GFS_File gf, const void *buffer, int size, int *np) { gfarm_error_t e; size_t written; gfarm_timerval_t t1, t2; GFARM_TIMEVAL_FIX_INITIALIZE_WARNING(t1); gfs_profile(gfarm_gettimerval(&t1)); e = gfs_pio_check_view_default(gf); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001315, "gfs_pio_check_view_default() failed: %s", gfarm_error_string(e)); return (e); } CHECK_WRITABLE(gf); if (size + gf->p > GFS_FILE_BUFSIZE) { /* * gf->buffer[gf->p .. GFS_FILE_BUFSIZE-1] will be overridden * by buffer. */ gf->length = gf->p; e = gfs_pio_flush(gf); /* this does purge too */ if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001316, "gfs_pio_flush() failed: %s", gfarm_error_string(e)); goto finish; } } if (size >= GFS_FILE_BUFSIZE) { /* shortcut to avoid unnecessary memory copy */ assert(gf->p == 0); /* gfs_pio_flush() was called above */ gf->length = 0; gf->mode &= ~GFS_FILE_MODE_BUFFER_DIRTY; e = do_write(gf, buffer, size, &written); if (e != GFARM_ERR_NO_ERROR && written == 0) { gflog_debug(GFARM_MSG_1001317, "do_write() failed: %s", gfarm_error_string(e)); goto finish; } gf->offset += written; *np = written; /* XXX - size_t vs int */ e = GFARM_ERR_NO_ERROR; goto finish; } gf->mode |= GFS_FILE_MODE_BUFFER_DIRTY; memcpy(gf->buffer + gf->p, buffer, size); gf->p += size; if (gf->p > gf->length) gf->length = gf->p; *np = size; e = GFARM_ERR_NO_ERROR; if (gf->open_flags & GFARM_FILE_UNBUFFERED || gf->p >= GFS_FILE_BUFSIZE) { e = gfs_pio_flush(gf); if (gf->open_flags & GFARM_FILE_UNBUFFERED) gfs_pio_purge(gf); } finish: gfs_profile(gfarm_gettimerval(&t2)); gfs_profile(gfs_pio_write_time += gfarm_timerval_sub(&t2, &t1)); return (e); } static gfarm_error_t sync_internal(GFS_File gf, int operation, double *time) { gfarm_error_t e; gfarm_timerval_t t1, t2; GFARM_TIMEVAL_FIX_INITIALIZE_WARNING(t1); gfs_profile(gfarm_gettimerval(&t1)); e = gfs_pio_flush(gf); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001318, "gfs_pio_flush() failed: %s", gfarm_error_string(e)); goto finish; } e = (*gf->ops->view_fsync)(gf, operation); if (e != GFARM_ERR_NO_ERROR) { gf->error = e; gflog_debug(GFARM_MSG_1001319, "view_fsync() failed: %s", gfarm_error_string(e)); } finish: gfs_profile(gfarm_gettimerval(&t2)); gfs_profile(*time += gfarm_timerval_sub(&t2, &t1)); return (e); } gfarm_error_t gfs_pio_sync(GFS_File gf) { return (sync_internal(gf, GFS_PROTO_FSYNC_WITH_METADATA, &gfs_pio_sync_time)); } gfarm_error_t gfs_pio_datasync(GFS_File gf) { return (sync_internal(gf, GFS_PROTO_FSYNC_WITHOUT_METADATA, &gfs_pio_datasync_time)); } int gfs_pio_getc(GFS_File gf) { gfarm_error_t e; int c; gfarm_timerval_t t1, t2; GFARM_TIMEVAL_FIX_INITIALIZE_WARNING(t1); gfs_profile(gfarm_gettimerval(&t1)); e = gfs_pio_check_view_default(gf); if (e != GFARM_ERR_NO_ERROR) { gf->error = e; gflog_debug(GFARM_MSG_1001320, "gfs_pio_check_view_default() failed: %s", gfarm_error_string(e)); return (EOF); } CHECK_READABLE_EOF(gf); if (gf->p >= gf->length) { if (gfs_pio_fillbuf(gf, gf->open_flags & GFARM_FILE_UNBUFFERED ? 1 : GFS_FILE_BUFSIZE) != GFARM_ERR_NO_ERROR) { c = EOF; /* can get reason via gfs_pio_error() */ gflog_debug(GFARM_MSG_1001321, "gfs_pio_fillbuf() failed: %s", gfarm_error_string(GFS_PIO_ERROR(gf))); goto finish; } if (gf->error != GFARM_ERR_NO_ERROR) { c = EOF; gflog_debug(GFARM_MSG_1001322, "gfs_pio_fillbuf() failed: %s", gfarm_error_string(gf->error)); goto finish; } } c = ((unsigned char *)gf->buffer)[gf->p++]; if (gf->open_flags & GFARM_FILE_UNBUFFERED) gfs_pio_purge(gf); finish: gfs_profile(gfarm_gettimerval(&t2)); gfs_profile(gfs_pio_getc_time += gfarm_timerval_sub(&t2, &t1)); return (c); } int gfs_pio_ungetc(GFS_File gf, int c) { gfarm_error_t e = gfs_pio_check_view_default(gf); if (e != GFARM_ERR_NO_ERROR) { gf->error = e; gflog_debug(GFARM_MSG_1001323, "gfs_pio_check_view_default() failed: %s", gfarm_error_string(e)); return (EOF); } CHECK_READABLE_EOF(gf); if (c != EOF) { if (gf->p == 0) { /* cannot unget - XXX should permit this? */ gf->error = GFARM_ERR_NO_SPACE; gflog_debug(GFARM_MSG_1001324, "gfs_pio_ungetc(): %s", gfarm_error_string(GFARM_ERR_NO_SPACE)); return (EOF); } /* We do not mark this buffer dirty here. */ gf->buffer[--gf->p] = c; } return (c); } gfarm_error_t gfs_pio_putc(GFS_File gf, int c) { gfarm_error_t e; gfarm_timerval_t t1, t2; GFARM_TIMEVAL_FIX_INITIALIZE_WARNING(t1); gfs_profile(gfarm_gettimerval(&t1)); e = gfs_pio_check_view_default(gf); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001325, "gfs_pio_check_view_default() failed: %s", gfarm_error_string(e)); return (e); } CHECK_WRITABLE(gf); if (gf->p >= GFS_FILE_BUFSIZE) { gfarm_error_t e = gfs_pio_flush(gf); /* this does purge too */ if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001326, "gfs_pio_flush() failed: %s", gfarm_error_string(e)); goto finish; } } gf->mode |= GFS_FILE_MODE_BUFFER_DIRTY; gf->buffer[gf->p++] = c; if (gf->p > gf->length) gf->length = gf->p; if (gf->open_flags & GFARM_FILE_UNBUFFERED || gf->p >= GFS_FILE_BUFSIZE) { e = gfs_pio_flush(gf); if (gf->open_flags & GFARM_FILE_UNBUFFERED) gfs_pio_purge(gf); } finish: gfs_profile(gfarm_gettimerval(&t2)); gfs_profile(gfs_pio_putc_time += gfarm_timerval_sub(&t2, &t1)); return (e); } /* mostly compatible with fgets(3) */ gfarm_error_t gfs_pio_puts(GFS_File gf, const char *s) { gfarm_error_t e = gfs_pio_check_view_default(gf); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001327, "gfs_pio_check_view_default() failed: %s", gfarm_error_string(e)); return (e); } CHECK_WRITABLE(gf); while (*s != '\0') { gfarm_error_t e = gfs_pio_putc(gf, *(unsigned char *)s); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001328, "gfs_pio_putc() failed: %s", gfarm_error_string(e)); return (e); } s++; } return (GFARM_ERR_NO_ERROR); } /* mostly compatible with fgets(3), but EOF check is done by *s == '\0' */ gfarm_error_t gfs_pio_gets(GFS_File gf, char *s, size_t size) { gfarm_error_t e = gfs_pio_check_view_default(gf); char *p = s; int c; gfarm_timerval_t t1, t2; if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001329, "gfs_pio_check_view_default() failed: %s", gfarm_error_string(e)); return (e); } GFARM_TIMEVAL_FIX_INITIALIZE_WARNING(t1); gfs_profile(gfarm_gettimerval(&t1)); #ifdef __GNUC__ /* workaround gcc warning: unused variable */ c = EOF; #endif CHECK_READABLE(gf); if (size <= 1) { gf->error = GFARM_ERR_INVALID_ARGUMENT; gflog_debug(GFARM_MSG_1001330, "invalid argument, size (%d) <= 1: %s", (int)size, gfarm_error_string(gf->error)); return (gf->error); } --size; /* for '\0' */ for (; size > 0 && (c = gfs_pio_getc(gf)) != EOF; --size) { *p++ = c; if (c == '\n') break; } *p++ = '\0'; gfs_profile(gfarm_gettimerval(&t2)); /* XXX should introduce gfs_pio_gets_time??? */ gfs_profile(gfs_pio_getline_time += gfarm_timerval_sub(&t2, &t1)); return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfs_pio_getline(GFS_File gf, char *s, size_t size, int *eofp) { gfarm_error_t e = gfs_pio_check_view_default(gf); char *p = s; int c; gfarm_timerval_t t1, t2; if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001331, "gfs_pio_check_view_default() failed: %s", gfarm_error_string(e)); return (e); } GFARM_TIMEVAL_FIX_INITIALIZE_WARNING(t1); gfs_profile(gfarm_gettimerval(&t1)); #ifdef __GNUC__ /* workaround gcc warning: unused variable */ c = EOF; #endif CHECK_READABLE(gf); if (size <= 1) { gf->error = GFARM_ERR_INVALID_ARGUMENT; gflog_debug(GFARM_MSG_1001332, "invalid argument, size(%d) <= 1: %s", (int)size, gfarm_error_string(gf->error)); return (gf->error); } --size; /* for '\0' */ for (; size > 0 && (c = gfs_pio_getc(gf)) != EOF; --size) { if (c == '\n') break; *p++ = c; } *p++ = '\0'; if (p == s + 1 && c == EOF) { *eofp = 1; return (GFS_PIO_ERROR(gf)); } *eofp = 0; gfs_profile(gfarm_gettimerval(&t2)); gfs_profile(gfs_pio_getline_time += gfarm_timerval_sub(&t2, &t1)); return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfs_pio_putline(GFS_File gf, const char *s) { gfarm_error_t e = gfs_pio_check_view_default(gf); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001333, "gfs_pio_check_view_default() failed: %s", gfarm_error_string(e)); return (e); } CHECK_WRITABLE(gf); e = gfs_pio_puts(gf, s); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001334, "gfs_pio_puts() failed: %s", gfarm_error_string(e)); return (e); } return (gfs_pio_putc(gf, '\n')); } #define ALLOC_SIZE_INIT 220 /* * mostly compatible with getline(3) in glibc, * but there are the following differences: * 1. on EOF, *lenp == 0 * 2. on error, *lenp isn't touched. */ gfarm_error_t gfs_pio_readline(GFS_File gf, char **bufp, size_t *sizep, size_t *lenp) { gfarm_error_t e = gfs_pio_check_view_default(gf); char *buf = *bufp, *p = NULL; size_t size = *sizep, len = 0; int c; size_t alloc_size; int overflow = 0; gfarm_timerval_t t1, t2; if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001335, "gfs_pio_check_view_default() failed: %s", gfarm_error_string(e)); return (e); } GFARM_TIMEVAL_FIX_INITIALIZE_WARNING(t1); gfs_profile(gfarm_gettimerval(&t1)); #ifdef __GNUC__ /* workaround gcc warning: unused variable */ c = EOF; #endif CHECK_READABLE(gf); if (buf == NULL || size <= 1) { if (size <= 1) size = ALLOC_SIZE_INIT; GFARM_REALLOC_ARRAY(buf, buf, size); if (buf == NULL) { gflog_debug(GFARM_MSG_1001336, "allocation of buf for pio_getc failed: %s", gfarm_error_string(GFARM_ERR_NO_MEMORY)); return (GFARM_ERR_NO_MEMORY); } } for (;;) { c = gfs_pio_getc(gf); if (c == EOF) break; if (size <= len) { alloc_size = gfarm_size_add(&overflow, size, size); if (!overflow) GFARM_REALLOC_ARRAY(p, buf, alloc_size); if (overflow || p == NULL) { *bufp = buf; *sizep = size; gflog_debug(GFARM_MSG_1001337, "allocation of buf for pio_getc " "failed or size overflow: %s", gfarm_error_string( GFARM_ERR_NO_MEMORY)); return (GFARM_ERR_NO_MEMORY); } buf = p; size += size; } buf[len++] = c; if (c == '\n') break; } if (size <= len) { alloc_size = gfarm_size_add(&overflow, size, size); if (!overflow) GFARM_REALLOC_ARRAY(p, buf, alloc_size); if (overflow || p == NULL) { *bufp = buf; *sizep = size; gflog_debug(GFARM_MSG_1001338, "allocation of buf for pio_getc failed " "or size overflow: %s", gfarm_error_string( GFARM_ERR_NO_MEMORY)); return (GFARM_ERR_NO_MEMORY); } buf = p; size += size; } buf[len] = '\0'; gfs_profile(gfarm_gettimerval(&t2)); /* XXX should introduce gfs_pio_readline_time??? */ gfs_profile(gfs_pio_getline_time += gfarm_timerval_sub(&t2, &t1)); *bufp = buf; *sizep = size; *lenp = len; return (GFARM_ERR_NO_ERROR); } /* * mostly compatible with getdelim(3) in glibc, * but there are the following differences: * 1. on EOF, *lenp == 0 * 2. on error, *lenp isn't touched. */ gfarm_error_t gfs_pio_readdelim(GFS_File gf, char **bufp, size_t *sizep, size_t *lenp, const char *delim, size_t delimlen) { gfarm_error_t e = gfs_pio_check_view_default(gf); char *buf = *bufp, *p = NULL; size_t size = *sizep, len = 0, alloc_size; int c, delimtail, overflow; static const char empty_line[] = "\n\n"; gfarm_timerval_t t1, t2; if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001339, "gfs_pio_check_view_default() failed: %s", gfarm_error_string(e)); return (e); } GFARM_TIMEVAL_FIX_INITIALIZE_WARNING(t1); gfs_profile(gfarm_gettimerval(&t1)); #ifdef __GNUC__ /* workaround gcc warning: unused variable */ c = EOF; #endif CHECK_READABLE(gf); if (delim == NULL) { /* special case 1 */ delimtail = 0; /* workaround gcc warning */ } else { if (delimlen == 0) { /* special case 2 */ delim = empty_line; delimlen = 2; } delimtail = delim[delimlen - 1]; } if (buf == NULL || size <= 1) { if (size <= 1) size = ALLOC_SIZE_INIT; GFARM_REALLOC_ARRAY(buf, buf, size); if (buf == NULL) { gflog_debug(GFARM_MSG_1001340, "allocation of buf for pio_getc failed: %s", gfarm_error_string(GFARM_ERR_NO_MEMORY)); return (GFARM_ERR_NO_MEMORY); } } for (;;) { c = gfs_pio_getc(gf); if (c == EOF) break; if (size <= len) { alloc_size = gfarm_size_add(&overflow, size, size); if (!overflow) GFARM_REALLOC_ARRAY(p, buf, alloc_size); if (overflow || p == NULL) { *bufp = buf; *sizep = size; gflog_debug(GFARM_MSG_1001341, "allocation of buf for pio_getc failed" " or size overflow: %s", gfarm_error_string( GFARM_ERR_NO_MEMORY)); return (GFARM_ERR_NO_MEMORY); } buf = p; size += size; } buf[len++] = c; if (delim == NULL) /* special case 1: no delimiter */ continue; if (len >= delimlen && c == delimtail && memcmp(&buf[len - delimlen], delim, delimlen) == 0) { if (delim == empty_line) { /* special case 2 */ for (;;) { c = gfs_pio_getc(gf); if (c == EOF) break; if (c != '\n') { gfs_pio_ungetc(gf, c); break; } if (size <= len) { alloc_size = gfarm_size_add( &overflow, size, size); if (!overflow) GFARM_REALLOC_ARRAY(p, buf, alloc_size); if (overflow || p == NULL) { *bufp = buf; *sizep = size; gflog_debug( GFARM_MSG_1001342, "allocation of buf " "for pio_getc failed" "or size overflow: " "%s", gfarm_error_string( GFARM_ERR_NO_MEMORY )); return ( GFARM_ERR_NO_MEMORY); } buf = p; size += size; } buf[len++] = c; } } break; } } if (size <= len) { alloc_size = gfarm_size_add(&overflow, size, size); if (!overflow) GFARM_REALLOC_ARRAY(p, buf, alloc_size); if (overflow || p == NULL) { *bufp = buf; *sizep = size; gflog_debug(GFARM_MSG_1001343, "allocation of buf for pio_getc failed " "or size overflow: %s", gfarm_error_string( GFARM_ERR_NO_MEMORY)); return (GFARM_ERR_NO_MEMORY); } buf = p; size += size; } buf[len] = '\0'; gfs_profile(gfarm_gettimerval(&t2)); /* XXX should introduce gfs_pio_readdelim_time??? */ gfs_profile(gfs_pio_getline_time += gfarm_timerval_sub(&t2, &t1)); *bufp = buf; *sizep = size; *lenp = len; return (GFARM_ERR_NO_ERROR); } /* * fstat */ gfarm_error_t gfs_pio_stat(GFS_File gf, struct gfs_stat *st) { gfarm_error_t e; e = gfs_fstat(gf, st); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001344, "gfs_fstat() failed: %s", gfarm_error_string(e)); return (e); } if (gfs_pio_is_view_set(gf)) { if ((gf->mode & GFS_FILE_MODE_WRITE) != 0) gfs_pio_flush(gf); e = (*gf->ops->view_fstat)(gf, st); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001345, "view_fstat() failed: %s", gfarm_error_string(e)); gf->error = e; } } return (e); } void gfs_pio_display_timers(void) { gflog_info(GFARM_MSG_1000095, "gfs_pio_create : %g sec", gfs_pio_create_time); gflog_info(GFARM_MSG_1000096, "gfs_pio_open : %g sec", gfs_pio_open_time); gflog_info(GFARM_MSG_1000097, "gfs_pio_close : %g sec", gfs_pio_close_time); gflog_info(GFARM_MSG_1000098, "gfs_pio_seek : %g sec", gfs_pio_seek_time); gflog_info(GFARM_MSG_1000099, "gfs_pio_truncate : %g sec", gfs_pio_truncate_time); gflog_info(GFARM_MSG_1000100, "gfs_pio_read : %g sec", gfs_pio_read_time); gflog_info(GFARM_MSG_1000101, "gfs_pio_write : %g sec", gfs_pio_write_time); gflog_info(GFARM_MSG_1000102, "gfs_pio_sync : %g sec", gfs_pio_sync_time); gflog_info(GFARM_MSG_1000103, "gfs_pio_getline : %g sec (this calls getc)", gfs_pio_getline_time); gflog_info(GFARM_MSG_1000104, "gfs_pio_getc : %g sec", gfs_pio_getc_time); gflog_info(GFARM_MSG_1000105, "gfs_pio_putc : %g sec", gfs_pio_putc_time); } gfarm-2.4.1/lib/libgfarm/gfarm/io_gfsl.h0000644000000000000000000000055011507222723016531 0ustar rootrootstruct gfp_xdr; struct gfarmSecSession; struct gfarm_iobuffer; gfarm_error_t gfp_xdr_set_secsession(struct gfp_xdr *, struct gfarmSecSession *, gss_cred_id_t); void gfp_xdr_reset_secsession(struct gfp_xdr *); void gfarm_iobuffer_write_close_secsession_op(struct gfarm_iobuffer *, void *, int); void gfp_xdr_downgrade_to_insecure_session(struct gfp_xdr *); gfarm-2.4.1/lib/libgfarm/gfarm/gfs_client.h0000644000000000000000000001344011507222724017227 0ustar rootroot/* * $Id: gfs_client.h 4977 2010-12-24 13:17:10Z n-soda $ */ struct sockaddr; struct timeval; struct gfarm_eventqueue; struct gfs_connection; struct gfs_stat; enum gfarm_auth_method; struct gfs_client_connect_state; void gfs_client_terminate(void); void gfs_client_add_hook_for_connection_error( gfarm_error_t (*)(struct gfs_connection *)); int gfs_client_is_connection_error(gfarm_error_t); int gfs_client_connection_fd(struct gfs_connection *); enum gfarm_auth_method gfs_client_connection_auth_method( struct gfs_connection *); const char *gfs_client_hostname(struct gfs_connection *); const char *gfs_client_username(struct gfs_connection *); int gfs_client_port(struct gfs_connection *); gfarm_pid_t gfs_client_pid(struct gfs_connection *); void gfs_client_purge_from_cache(struct gfs_connection *); gfarm_error_t gfs_client_connection_acquire(const char *, struct sockaddr *, struct gfs_connection **); struct gfm_connection; /* XXX */ gfarm_error_t gfs_client_connection_acquire_by_host( struct gfm_connection *, /* XXX */ const char *, int, struct gfs_connection **, const char *); void gfs_client_connection_free(struct gfs_connection *); gfarm_error_t gfs_client_connect(const char *, struct sockaddr *, struct gfs_connection **); void gfs_client_connection_gc(void); int gfs_client_connection_is_local(struct gfs_connection *); gfarm_error_t gfs_client_connection_enter_cache(struct gfs_connection *); gfarm_error_t gfs_client_connect_request_multiplexed( struct gfarm_eventqueue *, const char *, struct sockaddr *, void (*)(void *), void *, struct gfs_client_connect_state **); gfarm_error_t gfs_client_connect_result_multiplexed( struct gfs_client_connect_state *, struct gfs_connection **); /* from client */ gfarm_error_t gfs_client_process_set(struct gfs_connection *, gfarm_int32_t, const char *, size_t, gfarm_pid_t); gfarm_error_t gfs_client_open(struct gfs_connection *, gfarm_int32_t); gfarm_error_t gfs_client_open_local(struct gfs_connection *, gfarm_int32_t, int *); gfarm_error_t gfs_client_close(struct gfs_connection *, gfarm_int32_t); gfarm_error_t gfs_client_pread(struct gfs_connection *, gfarm_int32_t, void *, size_t, gfarm_off_t, size_t *); gfarm_error_t gfs_client_pwrite(struct gfs_connection *, gfarm_int32_t, const void *, size_t, gfarm_off_t, size_t *); gfarm_error_t gfs_client_ftruncate(struct gfs_connection *, gfarm_int32_t, gfarm_off_t); gfarm_error_t gfs_client_fsync(struct gfs_connection *, gfarm_int32_t, gfarm_int32_t); gfarm_error_t gfs_client_fstat(struct gfs_connection *, gfarm_int32_t, gfarm_off_t *, gfarm_int64_t *, gfarm_int32_t *, gfarm_int64_t *, gfarm_int32_t *); gfarm_error_t gfs_client_cksum_set(struct gfs_connection *, gfarm_int32_t, const char *, size_t, const char *); gfarm_error_t gfs_client_lock(struct gfs_connection *, gfarm_int32_t, gfarm_off_t, gfarm_off_t, gfarm_int32_t, gfarm_int32_t); gfarm_error_t gfs_client_trylock(struct gfs_connection *, gfarm_int32_t, gfarm_off_t, gfarm_off_t, gfarm_int32_t, gfarm_int32_t); gfarm_error_t gfs_client_unlock(struct gfs_connection *, gfarm_int32_t, gfarm_off_t, gfarm_off_t, gfarm_int32_t, gfarm_int32_t); gfarm_error_t gfs_client_lock_info(struct gfs_connection *, gfarm_int32_t, gfarm_off_t, gfarm_off_t, gfarm_int32_t, gfarm_int32_t, gfarm_off_t *, gfarm_off_t *, gfarm_int32_t *, char**, gfarm_pid_t **); gfarm_error_t gfs_client_replica_add_from(struct gfs_connection *, char *, gfarm_int32_t, gfarm_int32_t); gfarm_error_t gfs_client_replica_recv(struct gfs_connection *, gfarm_ino_t, gfarm_uint64_t, gfarm_int32_t); gfarm_error_t gfs_client_statfs(struct gfs_connection *, char *, gfarm_int32_t *, gfarm_off_t *, gfarm_off_t *, gfarm_off_t *, gfarm_off_t *, gfarm_off_t *, gfarm_off_t *); struct gfs_client_statfs_state; gfarm_error_t gfs_client_statfs_request_multiplexed(struct gfarm_eventqueue *, struct gfs_connection *, char *, void (*)(void *), void *, struct gfs_client_statfs_state **); gfarm_error_t gfs_client_statfs_result_multiplexed( struct gfs_client_statfs_state *, gfarm_int32_t *, gfarm_off_t *, gfarm_off_t *, gfarm_off_t *, gfarm_off_t *, gfarm_off_t *, gfarm_off_t *); #define GFS_CLIENT_COMMAND_FLAG_STDIN_EOF 0x01 #define GFS_CLIENT_COMMAND_FLAG_SHELL_COMMAND 0x02 #define GFS_CLIENT_COMMAND_FLAG_XENVCOPY 0x10 #define GFS_CLIENT_COMMAND_FLAG_XAUTHCOPY 0x20 /* copies env, too */ #define GFS_CLIENT_COMMAND_FLAG_X11MASK 0x30 #define GFS_CLIENT_COMMAND_EXITFLAG_COREDUMP 1 gfarm_error_t gfs_client_command_request(struct gfs_connection *, char *, char **, char **, int, int *); int gfs_client_command_is_running(struct gfs_connection *); gfarm_error_t gfs_client_command_io(struct gfs_connection *, struct timeval *); gfarm_error_t gfs_client_command_send_signal(struct gfs_connection *, int); gfarm_error_t gfs_client_command_result(struct gfs_connection *, int *, int *, int *); gfarm_error_t gfs_client_command(struct gfs_connection *, char *, char **, char **, int, int *, int *, int *); /* from gfmd */ gfarm_error_t gfs_client_fhstat(struct gfs_connection *, gfarm_ino_t, struct gfs_stat *); gfarm_error_t gfs_client_fhremove(struct gfs_connection *, gfarm_ino_t); /* * gfsd service on UDP port. */ extern int gfs_client_datagram_timeouts[]; /* milli seconds */ extern int gfs_client_datagram_ntimeouts; struct gfs_client_load { double loadavg_1min, loadavg_5min, loadavg_15min; }; gfarm_error_t gfs_client_get_load_request(int, struct sockaddr *, int); gfarm_error_t gfs_client_get_load_result(int, struct sockaddr *, socklen_t *, struct gfs_client_load *); struct gfs_client_get_load_state; gfarm_error_t gfs_client_get_load_request_multiplexed( struct gfarm_eventqueue *, struct sockaddr *, void (*)(void *), void *, struct gfs_client_get_load_state **); gfarm_error_t gfs_client_get_load_result_multiplexed( struct gfs_client_get_load_state *, struct gfs_client_load *); gfarm-2.4.1/lib/libgfarm/gfarm/gfj_client.h0000644000000000000000000000225011507222723017212 0ustar rootroot/* * $Id: gfj_client.h 1800 2005-05-10 11:48:54Z soda $ */ struct gfarm_job_info { int total_nodes; char *user; char *job_type; char *originate_host; char *gfarm_url_for_scheduling; int argc; char **argv; /* per node information */ struct gfarm_job_node_info { char *hostname; int pid; enum gfarm_job_node_state { GFJ_NODE_NONE } state; } *nodes; }; void gfarm_job_info_clear(struct gfarm_job_info *, int); void gfarm_job_info_free_contents(struct gfarm_job_info *, int); struct gfm_connection; gfarm_error_t gfj_initialize(void); gfarm_error_t gfj_client_lock_register(struct gfm_connection *); gfarm_error_t gfj_client_unlock_register(struct gfm_connection *); gfarm_error_t gfj_client_register(struct gfm_connection *, struct gfarm_job_info *, int, int *job_idp); gfarm_error_t gfj_client_unregister(struct gfm_connection *, int); gfarm_error_t gfj_client_list(struct gfm_connection *, char *, int *, int **); gfarm_error_t gfj_client_info(struct gfm_connection *, int, int *, struct gfarm_job_info *); /* convenience function */ gfarm_error_t gfarm_user_job_register(struct gfm_connection *, int, char **, char *, char *, int, char **, int *); gfarm-2.4.1/lib/libgfarm/gfarm/sockopt.h0000644000000000000000000000053511507222723016574 0ustar rootroot/* * $Id: sockopt.h 1241 2004-08-09 08:03:20Z soda $ */ struct gfarm_hostspec; gfarm_error_t gfarm_sockopt_config_add(char *, struct gfarm_hostspec *); gfarm_error_t gfarm_sockopt_apply_by_name_addr(int, const char *, struct sockaddr *); gfarm_error_t gfarm_sockopt_listener_config_add(char *); gfarm_error_t gfarm_sockopt_apply_listener(int); gfarm-2.4.1/lib/libgfarm/gfarm/timespec.h0000644000000000000000000000054211507222723016721 0ustar rootroot/* * $Id$ */ struct gfarm_timespec; int gfarm_timespec_cmp( const struct gfarm_timespec *, const struct gfarm_timespec *); void gfarm_timespec_add(struct gfarm_timespec *, const struct gfarm_timespec *); void gfarm_timespec_sub(struct gfarm_timespec *, const struct gfarm_timespec *); void gfarm_timespec_add_nanosec(struct gfarm_timespec *, long); gfarm-2.4.1/lib/libgfarm/gfarm/auth_common.c0000644000000000000000000001715111507222724017421 0ustar rootroot#include #include #include #include #include #include /* ntoh[ls]()/hton[ls]() on glibc */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "gfutil.h" #include "thrsubr.h" #include "liberror.h" #include "auth.h" #define GFARM_AUTH_EXPIRE_DEFAULT (24 * 60 * 60) /* 1 day */ #define PATH_URANDOM "/dev/urandom" static int skip_space(FILE *fp) { int c; while ((c = getc(fp)) != EOF) { if (c != ' ' && c != '\t') { ungetc(c, fp); return (0); } } return (EOF); } static int read_hex(FILE *fp, void *buffer, size_t length) { char *p = buffer; size_t i; int c1, c2; int x1, x2; for (i = 0; i < length; i++) { c1 = getc(fp); if (!isxdigit(c1)) { if (c1 != EOF) ungetc(c1, fp); return (EOF); } c2 = getc(fp); if (!isxdigit(c2)) { if (c2 != EOF) ungetc(c2, fp); return (EOF); } x1 = isdigit(c1) ? c1 - '0' : tolower(c1) - 'a' + 10; x2 = isdigit(c2) ? c2 - '0' : tolower(c2) - 'a' + 10; p[i] = x1 * 16 + x2; } c1 = getc(fp); if (c1 != EOF) ungetc(c1, fp); return (isxdigit(c1) ? EOF : 0); } static void write_hex(FILE *fp, void *buffer, size_t length) { unsigned char *p = buffer; size_t i; for (i = 0; i < length; i++) fprintf(fp, "%02x", p[i]); } void gfarm_auth_random(void *buffer, size_t length) { unsigned char *p = buffer; size_t i = 0; int fd, rv; /* * do not use fopen(3) here, * because it wastes entropy and kernel cpu resource by reading BUFSIZ * rather than reading just the length. */ if ((fd = open(PATH_URANDOM, O_RDONLY)) != -1) { for (; i < length; i += rv) { rv = read(fd, p + i, length - i); if (rv == -1) break; } close(fd); if (i >= length) return; } /* XXX - this makes things too weak */ for (; i < length; i++) { #ifdef HAVE_RANDOM p[i] = gfarm_random(); #else p[i] = gfarm_random() / (RAND_MAX + 1.0) * 256; #endif } } /* * We switch the user's privilege to read ~/.gfarm_shared_key. * * NOTE: reading this file with root privilege may not work, * if home directory is NFS mounted and root access for * the home directory partition is not permitted. * * Do not leave the user privilege switched here, even in the switch_to case, * because it is necessary to switch back to the original user privilege when * gfarm_auth_sharedsecret fails. */ gfarm_error_t gfarm_auth_shared_key_get(unsigned int *expirep, char *shared_key, char *home, struct passwd *pwd, int create, int period) { gfarm_error_t e; FILE *fp; static char keyfile_basename[] = "/" GFARM_AUTH_SHARED_KEY_BASENAME; char *keyfilename; unsigned int expire; uid_t o_uid; gid_t o_gid; int is_root = 0; static pthread_mutex_t privilege_mutex = PTHREAD_MUTEX_INITIALIZER; static const char privilege_diag[] = "privilege_mutex"; static const char diag[] = "gfarm_auth_shared_key_get"; #ifdef __GNUC__ /* workaround gcc warning: might be used uninitialized */ o_uid = o_gid = 0; #endif GFARM_MALLOC_ARRAY(keyfilename, strlen(home) + sizeof(keyfile_basename)); if (keyfilename == NULL) { gflog_debug(GFARM_MSG_1001023, "allocation of 'keyfilename' failed: %s", gfarm_error_string(GFARM_ERR_NO_MEMORY)); return (GFARM_ERR_NO_MEMORY); } strcpy(keyfilename, home); strcat(keyfilename, keyfile_basename); if (pwd != NULL) { gfarm_mutex_lock(&privilege_mutex, diag, privilege_diag); o_gid = getegid(); o_uid = geteuid(); if (seteuid(0) == 0) /* recover root privilege */ is_root = 1; if (initgroups(pwd->pw_name, pwd->pw_gid) == -1 && is_root) gflog_error_errno(GFARM_MSG_1002339, "inigroups(%s, %d)", pwd->pw_name, (int)pwd->pw_gid); if (setegid(pwd->pw_gid) == -1 && is_root) gflog_error_errno(GFARM_MSG_1002340, "setegid(%d)", (int)pwd->pw_gid); if (seteuid(pwd->pw_uid) == -1 && is_root) gflog_error_errno(GFARM_MSG_1002341, "seteuid(%d)", (int)pwd->pw_uid); } if ((fp = fopen(keyfilename, "r+")) != NULL) { if (skip_space(fp) || read_hex(fp, &expire, sizeof(expire))) { fclose(fp); free(keyfilename); e = GFARM_ERRMSG_SHAREDSECRET_INVALID_EXPIRE_FIELD; goto finish; } expire = ntohl(expire); if (skip_space(fp) || read_hex(fp, shared_key, GFARM_AUTH_SHARED_KEY_LEN)) { fclose(fp); free(keyfilename); e = GFARM_ERRMSG_SHAREDSECRET_INVALID_KEY_FIELD; goto finish; } } if (fp == NULL) { if (create == GFARM_AUTH_SHARED_KEY_GET) { free(keyfilename); e = GFARM_ERRMSG_SHAREDSECRET_KEY_FILE_NOT_EXIST; goto finish; } fp = fopen(keyfilename, "w+"); if (fp == NULL) { e = gfarm_errno_to_error(errno); free(keyfilename); goto finish; } if (chmod(keyfilename, 0600) == -1) { e = gfarm_errno_to_error(errno); fclose(fp); free(keyfilename); goto finish; } expire = 0; /* force to regenerate key */ } if (create == GFARM_AUTH_SHARED_KEY_CREATE_FORCE || time(NULL) >= expire) { if (create == GFARM_AUTH_SHARED_KEY_GET) { fclose(fp); free(keyfilename); e = GFARM_ERR_EXPIRED; goto finish; } if (fseek(fp, 0L, SEEK_SET) == -1) { e = gfarm_errno_to_error(errno); fclose(fp); free(keyfilename); goto finish; } gfarm_auth_random(shared_key, GFARM_AUTH_SHARED_KEY_LEN); if (period <= 0) period = GFARM_AUTH_EXPIRE_DEFAULT; expire = time(NULL) + period; expire = htonl(expire); write_hex(fp, &expire, sizeof(expire)); expire = ntohl(expire); fputc(' ', fp); write_hex(fp, shared_key, GFARM_AUTH_SHARED_KEY_LEN); fputc('\n', fp); } if (fclose(fp) != 0) { e = gfarm_errno_to_error(errno); } else { e = GFARM_ERR_NO_ERROR; *expirep = expire; } free(keyfilename); finish: if (pwd != NULL) { if (seteuid(0) == -1 && is_root) /* recover root privilege */ gflog_error_errno(GFARM_MSG_1002342, "seteuid(0)"); /* abandon group privileges */ if (setgroups(1, &o_gid) == -1 && is_root) gflog_error_errno(GFARM_MSG_1002343, "setgroups(%d)", (int)o_gid); if (setegid(o_gid) == -1 && is_root) gflog_error_errno(GFARM_MSG_1002344, "setegid(%d)", (int)o_gid); /* suppress root privilege, if possible */ if (seteuid(o_uid) == -1 && is_root) gflog_error_errno(GFARM_MSG_1002345, "seteuid(%d)", (int)o_uid); gfarm_mutex_unlock(&privilege_mutex, diag, privilege_diag); } if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001024, "getting shared key failed: %s", gfarm_error_string(e)); } return (e); } void gfarm_auth_sharedsecret_response_data(char *shared_key, char *challenge, char *response) { EVP_MD_CTX mdctx; unsigned int md_len; static pthread_mutex_t openssl_mutex = PTHREAD_MUTEX_INITIALIZER; static const char openssl_diag[] = "openssl_mutex"; static const char diag[] = "gfarm_auth_sharedsecret_response_data"; /* * according to "valgrind --tool=helgrind", * these OpenSSL functions are not multithread safe, * at least about openssl-0.9.8e-12.el5_4.1.x86_64 on CentOS 5.4 */ gfarm_mutex_lock(&openssl_mutex, diag, openssl_diag); EVP_DigestInit(&mdctx, EVP_md5()); EVP_DigestUpdate(&mdctx, challenge, GFARM_AUTH_CHALLENGE_LEN); EVP_DigestUpdate(&mdctx, shared_key, GFARM_AUTH_SHARED_KEY_LEN); EVP_DigestFinal(&mdctx, (unsigned char *)response, &md_len); gfarm_mutex_unlock(&openssl_mutex, diag, openssl_diag); if (md_len != GFARM_AUTH_RESPONSE_LEN) { fprintf(stderr, "gfarm_auth_sharedsecret_response_data:" "md5 digest length should be %d, but %d\n", GFARM_AUTH_RESPONSE_LEN, md_len); abort(); } } gfarm-2.4.1/lib/libgfarm/gfarm/auth_server_uid.c0000644000000000000000000000617711507222723020305 0ustar rootroot#include #include #include #include #include "gfutil.h" #include "auth.h" #include "gfm_client.h" static gfarm_error_t gfarm_auth_uid_to_global_username_panic(void *, const char *, char **); gfarm_error_t (*gfarm_auth_uid_to_global_username_table[])(void *, const char *, char **) = { /* * This table entry should be ordered by enum gfarm_auth_method. */ gfarm_auth_uid_to_global_username_panic, /*GFARM_AUTH_METHOD_NONE*/ gfarm_auth_uid_to_global_username_sharedsecret,/*GFARM_AUTH_METHOD_SHAREDSECRET */ gfarm_auth_uid_to_global_username_panic, /*GFARM_AUTH_METHOD_GSI_OLD*/ #ifdef HAVE_GSI gfarm_auth_uid_to_global_username_gsi, /*GFARM_AUTH_METHOD_GSI*/ gfarm_auth_uid_to_global_username_gsi, /*GFARM_AUTH_METHOD_GSI_AUTH*/ #else gfarm_auth_uid_to_global_username_panic, /*GFARM_AUTH_METHOD_GSI*/ gfarm_auth_uid_to_global_username_panic, /*GFARM_AUTH_METHOD_GSI_AUTH*/ #endif }; gfarm_error_t gfarm_auth_uid_to_global_username_panic(void *closure, const char *auth_user_id, char **global_usernamep) { gflog_fatal(GFARM_MSG_1000055, "gfarm_auth_uid_to_global_username_panic: " "authorization assertion failed"); return (GFARM_ERR_PROTOCOL); } gfarm_error_t gfarm_auth_uid_to_global_username_sharedsecret(void *closure, const char *auth_user_id, char **global_usernamep) { struct gfm_connection *gfm_server = closure; gfarm_error_t e, e2; char *global_username; struct gfarm_user_info ui; /* * In sharedsecret, auth_user_id is a Gfarm global username, * and we have to verity it, at least. */ e = gfm_client_user_info_get_by_names(gfm_server, 1, &auth_user_id, &e2, &ui); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001078, "getting user info by names failed (%s): %s", auth_user_id, gfarm_error_string(e)); return (e); } if (e2 != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001079, "getting user info by names failed (%s): %s", auth_user_id, gfarm_error_string(e2)); return (e2); } gfarm_user_info_free(&ui); if (global_usernamep == NULL) return (GFARM_ERR_NO_ERROR); global_username = strdup(auth_user_id); if (global_username == NULL) { gflog_debug(GFARM_MSG_1001080, "allocation of string 'global_username' failed: %s", gfarm_error_string(GFARM_ERR_NO_MEMORY)); return (GFARM_ERR_NO_MEMORY); } *global_usernamep = global_username; return (GFARM_ERR_NO_ERROR); } /* only called in case of gfarm_auth_id_type == GFARM_AUTH_ID_TYPE_USER */ gfarm_error_t gfarm_auth_uid_to_global_username(void *closure, enum gfarm_auth_method auth_method, const char *auth_user_id, char **global_usernamep) { if (auth_method < GFARM_AUTH_METHOD_NONE || auth_method >= GFARM_ARRAY_LENGTH(gfarm_auth_uid_to_global_username_table)) { gflog_error(GFARM_MSG_1000056, "gfarm_auth_uid_to_global_username: method=%d/%d", auth_method, (int)GFARM_ARRAY_LENGTH( gfarm_auth_uid_to_global_username_table)); return (gfarm_auth_uid_to_global_username_panic(closure, auth_user_id, global_usernamep)); } return (gfarm_auth_uid_to_global_username_table[auth_method]( closure, auth_user_id, global_usernamep)); } gfarm-2.4.1/lib/libgfarm/gfarm/gfs_misc.h0000644000000000000000000000016711507222723016705 0ustar rootrootstruct gfm_connection; /* gfs_pio.c */ struct gfm_connection *gfs_pio_metadb(GFS_File); int gfs_pio_fileno(GFS_File); gfarm-2.4.1/lib/libgfarm/gfarm/hostspec.h0000644000000000000000000000150311507222723016736 0ustar rootroot/* * $Id: hostspec.h 4930 2010-11-23 15:37:47Z tatebe $ */ struct gfarm_hostspec; struct sockaddr; gfarm_error_t gfarm_hostspec_af_inet4_new(gfarm_uint32_t, gfarm_uint32_t, struct gfarm_hostspec **); void gfarm_hostspec_free(struct gfarm_hostspec *); gfarm_error_t gfarm_hostspec_parse(char *, struct gfarm_hostspec **); void gfarm_hostspec_free(struct gfarm_hostspec *); int gfarm_hostspec_match(struct gfarm_hostspec *, const char *, struct sockaddr *); /* 41 "IPv6 address" + 1 '/' + 41 + 1 '\0' */ #define GFARM_HOSTSPEC_STRLEN 84 void gfarm_hostspec_to_string(struct gfarm_hostspec *, char *, size_t); gfarm_error_t gfarm_sockaddr_to_name(struct sockaddr *, char **); /* "[ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff]" */ #define GFARM_SOCKADDR_STRLEN 42 void gfarm_sockaddr_to_string(struct sockaddr *, char *, size_t); gfarm-2.4.1/lib/libgfarm/gfarm/gfs_pio_remote.c0000644000000000000000000001017311507222723020105 0ustar rootroot/* * pio operations for remote fragment * * $Id: gfs_pio_remote.c 4457 2010-02-23 01:53:23Z ookuma $ */ #include #include #include #include #include /* struct sockaddr */ #include #include #include "host.h" #include "config.h" #include "gfs_proto.h" /* GFS_PROTO_FSYNC_* */ #include "gfs_client.h" #include "gfs_io.h" #include "gfs_pio.h" static gfarm_error_t gfs_pio_remote_storage_close(GFS_File gf) { gfarm_error_t e; struct gfs_file_section_context *vc = gf->view_context; struct gfs_connection *gfs_server = vc->storage_context; /* * Do not close remote file from a child process because its * open file count is not incremented. * XXX - This behavior is not the same as expected, but better * than closing the remote file. */ if (vc->pid != getpid()) return (GFARM_ERR_NO_ERROR); e = gfs_client_close(gfs_server, gf->fd); gfs_client_connection_free(gfs_server); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001373, "gfs_client_close() failed: %s", gfarm_error_string(e)); } return (e); } static gfarm_error_t gfs_pio_remote_storage_pwrite(GFS_File gf, const char *buffer, size_t size, gfarm_off_t offset, size_t *lengthp) { struct gfs_file_section_context *vc = gf->view_context; struct gfs_connection *gfs_server = vc->storage_context; /* * buffer beyond GFS_PROTO_MAX_IOSIZE are just ignored by gfsd, * we don't perform such GFS_PROTO_WRITE request, because it's * inefficient. * Note that upper gfs_pio layer should care this partial write. */ if (size > GFS_PROTO_MAX_IOSIZE) size = GFS_PROTO_MAX_IOSIZE; return (gfs_client_pwrite(gfs_server, gf->fd, buffer, size, offset, lengthp)); } static gfarm_error_t gfs_pio_remote_storage_pread(GFS_File gf, char *buffer, size_t size, gfarm_off_t offset, size_t *lengthp) { struct gfs_file_section_context *vc = gf->view_context; struct gfs_connection *gfs_server = vc->storage_context; /* * Unlike gfs_pio_remote_storage_write(), we don't care * buffer size here, because automatic i/o size truncation * performed by gfsd isn't inefficient for read case. * Note that upper gfs_pio layer should care the partial read. */ return (gfs_client_pread(gfs_server, gf->fd, buffer, size, offset, lengthp)); } static gfarm_error_t gfs_pio_remote_storage_ftruncate(GFS_File gf, gfarm_off_t length) { struct gfs_file_section_context *vc = gf->view_context; struct gfs_connection *gfs_server = vc->storage_context; return (gfs_client_ftruncate(gfs_server, gf->fd, length)); } static gfarm_error_t gfs_pio_remote_storage_fsync(GFS_File gf, int operation) { struct gfs_file_section_context *vc = gf->view_context; struct gfs_connection *gfs_server = vc->storage_context; return (gfs_client_fsync(gfs_server, gf->fd, operation)); } static gfarm_error_t gfs_pio_remote_storage_fstat(GFS_File gf, struct gfs_stat *st) { struct gfs_file_section_context *vc = gf->view_context; struct gfs_connection *gfs_server = vc->storage_context; return (gfs_client_fstat(gfs_server, gf->fd, &st->st_size, &st->st_atimespec.tv_sec, &st->st_atimespec.tv_nsec, &st->st_mtimespec.tv_sec, &st->st_mtimespec.tv_nsec)); } static int gfs_pio_remote_storage_fd(GFS_File gf) { /* * Unlike Gfarm version 1, we tell the caller that * gfs_client_connection_fd() isn't actually usable. */ return (-1); } struct gfs_storage_ops gfs_pio_remote_storage_ops = { gfs_pio_remote_storage_close, gfs_pio_remote_storage_fd, gfs_pio_remote_storage_pread, gfs_pio_remote_storage_pwrite, gfs_pio_remote_storage_ftruncate, gfs_pio_remote_storage_fsync, gfs_pio_remote_storage_fstat, }; gfarm_error_t gfs_pio_open_remote_section(GFS_File gf, struct gfs_connection *gfs_server) { gfarm_error_t e; struct gfs_file_section_context *vc = gf->view_context; e = gfs_client_open(gfs_server, gf->fd); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001374, "gfs_client_open() failed: %s", gfarm_error_string(e)); return (e); } vc->ops = &gfs_pio_remote_storage_ops; vc->storage_context = gfs_server; vc->fd = -1; /* not used */ vc->pid = getpid(); return (GFARM_ERR_NO_ERROR); } gfarm-2.4.1/lib/libgfarm/gfarm/gfarm_foreach.h0000644000000000000000000000037011507222723017672 0ustar rootroot/* * $Id$ */ gfarm_error_t gfarm_foreach_directory_hierarchy( gfarm_error_t (*)(char *, struct gfs_stat *, void *), gfarm_error_t (*)(char *, struct gfs_stat *, void *), gfarm_error_t (*)(char *, struct gfs_stat *, void *), char *, void *); gfarm-2.4.1/lib/libgfarm/gfarm/gfs_statfsnode.c0000644000000000000000000000307711507222724020123 0ustar rootroot/* * $Id$ */ #include #include #include #include #include "config.h" #include "gfm_client.h" #include "gfs_client.h" /* * XXX FIXME * a pathname argument is necessary to determine the gfm_server * (from multiple metadata servers). */ gfarm_error_t gfs_statfsnode(char *host, int port, gfarm_int32_t *bsize, gfarm_off_t *blocks, gfarm_off_t *bfree, gfarm_off_t *bavail, gfarm_off_t *files, gfarm_off_t *ffree, gfarm_off_t *favail) { gfarm_error_t e; struct gfm_connection *gfm_server; struct gfs_connection *gfs_server; int retry = 0; for (;;) { if ((e = gfm_client_connection_and_process_acquire( gfarm_metadb_server_name, gfarm_metadb_server_port, &gfm_server)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001380, "acquirement of client connection and process " "failed: %s", gfarm_error_string(e)); return (e); } if ((e = gfs_client_connection_acquire_by_host(gfm_server, host, port, &gfs_server, NULL))!= GFARM_ERR_NO_ERROR) goto free_gfm_connection; if (gfs_client_pid(gfs_server) == 0) e = gfarm_client_process_set(gfs_server, gfm_server); if (e == GFARM_ERR_NO_ERROR) { /* "/" is actually not used */ e = gfs_client_statfs(gfs_server, "/", bsize, blocks, bfree, bavail, files, ffree, favail); if (gfs_client_is_connection_error(e) && ++retry<=1) { gfs_client_connection_free(gfs_server); continue; } } break; } gfs_client_connection_free(gfs_server); free_gfm_connection: gfm_client_connection_free(gfm_server); return (e); } gfarm-2.4.1/lib/libgfarm/gfarm/auth_server_gsi.c0000644000000000000000000002133211507222723020274 0ustar rootroot#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "gfarm_secure_session.h" #include "gfarm_auth.h" #include "liberror.h" #include "gfutil.h" #include "gfp_xdr.h" #include "io_fd.h" #include "io_gfsl.h" #include "auth.h" #include "auth_gsi.h" #include "gfs_proto.h" /* for GFSD_USERNAME, XXX layering violation */ /* * server side authentication */ static gfarm_error_t gfarm_authorize_gsi_common(struct gfp_xdr *conn, int switch_to, char *service_tag, char *hostname, enum gfarm_auth_method auth_method, gfarm_error_t (*auth_uid_to_global_user)(void *, enum gfarm_auth_method, const char *, char **), void *closure, enum gfarm_auth_id_type *peer_typep, char **global_usernamep) { int fd = gfp_xdr_fd(conn); gfarm_error_t e, e2; char *global_username = NULL, *aux = NULL; OM_uint32 e_major, e_minor; gfarmSecSession *session; gfarmAuthEntry *userinfo; gfarm_int32_t error = GFARM_AUTH_ERROR_NO_ERROR; /* gfarm_auth_error */ enum gfarm_auth_cred_type cred_type = gfarm_auth_server_cred_type_get(service_tag); char *cred_service = gfarm_auth_server_cred_service_get(service_tag); char *cred_name = gfarm_auth_server_cred_name_get(service_tag); gss_cred_id_t cred; enum gfarm_auth_id_type peer_type; e = gfp_xdr_flush(conn); if (e != GFARM_ERR_NO_ERROR) { gflog_error(GFARM_MSG_1000712, "authorize_gsi: %s: protocol drain: %s", hostname, gfarm_error_string(e)); return (e); } e = gfarm_gsi_server_initialize(); if (e != GFARM_ERR_NO_ERROR) { gflog_error(GFARM_MSG_1000713, "authorize_gsi: %s: GSI initialize: %s", hostname, gfarm_error_string(e)); return (e); } if (cred_type == GFARM_AUTH_CRED_TYPE_DEFAULT && cred_service == NULL && cred_name == NULL) { cred = GSS_C_NO_CREDENTIAL; } else { gss_name_t desired_name = GSS_C_NO_NAME; int rv; /* * It is desired to try gfarm_host_get_canonical_self_name() * before calling gfarm_host_get_self_name(), but it is not * possible for now, because currently there is no LDAP * connection in server side. * XXX FIXME * This can be done in gfarm_gsi_cred_config_convert_to_name() * with gfarm v2. */ e = gfarm_gsi_cred_config_convert_to_name( cred_type, cred_service, cred_name, gfarm_host_get_self_name(), &desired_name); if (e != GFARM_ERR_NO_ERROR) { gflog_auth_error(GFARM_MSG_1000714, "%s: " "Server credential configuration for %s:%s: %s", hostname, service_tag, hostname, gfarm_error_string(e)); return (e); } rv = gfarmGssAcquireCredential(&cred, desired_name, GSS_C_BOTH, &e_major, &e_minor, NULL); if (desired_name != GSS_C_NO_NAME) gfarmGssDeleteName(&desired_name, NULL, NULL); if (rv < 0) { if (gflog_auth_get_verbose()) { gflog_error(GFARM_MSG_1000715, "%s: Can't get server credential for %s", hostname, service_tag); gfarmGssPrintMajorStatus(e_major); gfarmGssPrintMinorStatus(e_minor); gflog_error(GFARM_MSG_1000716, "GSI authentication error: %s", hostname); } return (GFARM_ERR_AUTHENTICATION); } } session = gfarmSecSessionAccept(fd, cred, NULL, &e_major, &e_minor); if (cred != GSS_C_NO_CREDENTIAL) { OM_uint32 e_major2, e_minor2; if (gfarmGssDeleteCredential(&cred, &e_major2, &e_minor2) < 0 && gflog_auth_get_verbose()) { gflog_warning(GFARM_MSG_1000717, "Can't release credential because of:"); gfarmGssPrintMajorStatus(e_major2); gfarmGssPrintMinorStatus(e_minor2); } } if (session == NULL) { if (gflog_auth_get_verbose()) { gflog_error(GFARM_MSG_1000718, "%s: Can't accept session because of:", hostname); gfarmGssPrintMajorStatus(e_major); gfarmGssPrintMinorStatus(e_minor); gflog_error(GFARM_MSG_1000719, "GSI authentication error: %s", hostname); } return (GFARM_ERR_AUTHENTICATION); } userinfo = gfarmSecSessionGetInitiatorInfo(session); switch (gfarmAuthGetAuthEntryType(userinfo)) { case GFARM_AUTH_HOST: peer_type = GFARM_AUTH_ID_TYPE_SPOOL_HOST; if ((global_username = strdup(GFSD_USERNAME)) != NULL) e = GFARM_ERR_NO_ERROR; else e = GFARM_ERR_NO_MEMORY; break; case GFARM_AUTH_USER: peer_type = GFARM_AUTH_ID_TYPE_USER; e = (*auth_uid_to_global_user)(closure, auth_method, userinfo->distName, &global_username); break; default: gflog_error(GFARM_MSG_1000720, "authorize_gsi: \"%s\" @ %s: auth entry type=%d", userinfo->distName, hostname, gfarmAuthGetAuthEntryType(userinfo)); e = GFARM_ERR_AUTHENTICATION; break; } if (e == GFARM_ERR_NO_ERROR) { /* assert(error == GFARM_AUTH_ERROR_NO_ERROR); */ /* succeed, do logging */ gflog_notice(GFARM_MSG_1000721, "(%s@%s) authenticated: auth=%s local_user=%s DN=\"%s\"", global_username, hostname, gfarm_auth_method_name(auth_method), gfarmAuthGetAuthEntryType(userinfo) == GFARM_AUTH_USER ? userinfo->authData.userAuth.localName : "@host@", userinfo->distName); if (switch_to) { GFARM_MALLOC_ARRAY(aux, strlen(global_username) + 1 + strlen(hostname) + 1); if (aux == NULL) { e = GFARM_ERR_NO_MEMORY; error = GFARM_AUTH_ERROR_RESOURCE_UNAVAILABLE; gflog_error(GFARM_MSG_1000722, "(%s@%s) authorize_gsi: %s", global_username, hostname, gfarm_error_string(e)); } } } gfp_xdr_set_secsession(conn, session, GSS_C_NO_CREDENTIAL); e2 = gfp_xdr_send(conn, "i", error); if (e2 != GFARM_ERR_NO_ERROR) { gflog_error(GFARM_MSG_1000723, "(%s@%s) authorize_gsi: send reply: %s", global_username, hostname, gfarm_error_string(e2)); } else if ((e2 = gfp_xdr_flush(conn)) != GFARM_ERR_NO_ERROR) { gflog_error(GFARM_MSG_1000724, "(%s@%s) authorize_gsi: completion: %s", global_username, hostname, gfarm_error_string(e2)); } if (e != GFARM_ERR_NO_ERROR || e2 != GFARM_ERR_NO_ERROR) { if (global_username != NULL) free(global_username); if (aux != NULL) free(aux); gfp_xdr_reset_secsession(conn); gfp_xdr_set_socket(conn, fd); gflog_debug(GFARM_MSG_1001477, "Authorization failed: %s", gfarm_error_string(e != GFARM_ERR_NO_ERROR ? e : e2)); return (e != GFARM_ERR_NO_ERROR ? e : e2); } if (switch_to && gfarmAuthGetAuthEntryType(userinfo) == GFARM_AUTH_USER) { sprintf(aux, "%s@%s", global_username, hostname); gflog_set_auxiliary_info(aux); /* * because the name returned by getlogin() is * an attribute of a session on 4.4BSD derived OSs, * we should create new session before calling * setlogin(). */ setsid(); #ifdef HAVE_SETLOGIN setlogin(userinfo->authData.userAuth.localName); #endif initgroups(userinfo->authData.userAuth.localName, userinfo->authData.userAuth.gid); gfarmSecSessionDedicate(session); gfarm_set_global_username(global_username); gfarm_set_local_username( userinfo->authData.userAuth.localName); gfarm_set_local_homedir( userinfo->authData.userAuth.homeDir); /* set the delegated credential. */ gfarm_gsi_set_delegated_cred( gfarmSecSessionGetDelegatedCredential(session)); } /* determine *peer_typep == GFARM_AUTH_ID_TYPE_SPOOL_HOST */ if (peer_typep != NULL) { if (gfarmAuthGetAuthEntryType(userinfo) == GFARM_AUTH_HOST) *peer_typep = GFARM_AUTH_ID_TYPE_SPOOL_HOST; else *peer_typep = GFARM_AUTH_ID_TYPE_USER; } if (global_usernamep != NULL) *global_usernamep = global_username; else free(global_username); return (GFARM_ERR_NO_ERROR); } /* * "gsi" method */ gfarm_error_t gfarm_authorize_gsi(struct gfp_xdr *conn, int switch_to, char *service_tag, char *hostname, gfarm_error_t (*auth_uid_to_global_user)(void *, enum gfarm_auth_method, const char *, char **), void *closure, enum gfarm_auth_id_type *peer_typep, char **global_usernamep) { return (gfarm_authorize_gsi_common(conn, switch_to, service_tag, hostname, GFARM_AUTH_METHOD_GSI, auth_uid_to_global_user, closure, peer_typep, global_usernamep)); } /* * "gsi_auth" method */ gfarm_error_t gfarm_authorize_gsi_auth(struct gfp_xdr *conn, int switch_to, char *service_tag, char *hostname, gfarm_error_t (*auth_uid_to_global_user)(void *, enum gfarm_auth_method, const char *, char **), void *closure, enum gfarm_auth_id_type *peer_typep, char **global_usernamep) { gfarm_error_t e = gfarm_authorize_gsi_common(conn, switch_to, service_tag, hostname, GFARM_AUTH_METHOD_GSI_AUTH, auth_uid_to_global_user, closure, peer_typep, global_usernamep); if (e == GFARM_ERR_NO_ERROR) gfp_xdr_downgrade_to_insecure_session(conn); return (e); } gfarm-2.4.1/lib/libgfarm/gfarm/auth_client_gsi.c0000644000000000000000000003532311507222723020251 0ustar rootroot#include #include #include #include #include #include #include #include #include #include #include #include #include "gfutil.h" #include "gfevent.h" #include "gfarm_secure_session.h" #include "gfarm_auth.h" #include "liberror.h" #include "gfp_xdr.h" #include "io_fd.h" #include "io_gfsl.h" #include "auth.h" #include "auth_gsi.h" #include "gfs_proto.h" /* for GFS_SERVICE_TAG, XXX layering violation */ /* * client side authentication */ gfarm_error_t gfarm_auth_request_gsi(struct gfp_xdr *conn, const char *service_tag, const char *hostname, enum gfarm_auth_id_type self_type) { int fd = gfp_xdr_fd(conn); gfarm_error_t e; enum gfarm_auth_cred_type serv_type = gfarm_auth_server_cred_type_get(service_tag); char *serv_service = gfarm_auth_server_cred_service_get(service_tag); char *serv_name = gfarm_auth_server_cred_name_get(service_tag); enum gfarm_auth_cred_type spool_servicetype; char *spool_servicename = NULL; gss_name_t acceptor_name = GSS_C_NO_NAME; gss_name_t initiator_name = GSS_C_NO_NAME; gss_cred_id_t cred; OM_uint32 e_major; OM_uint32 e_minor; gfarmSecSession *session; gfarm_int32_t error; /* enum gfarm_auth_error */ int eof, cred_acquired = 0; e = gfarm_gsi_client_initialize(); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001465, "initialization of client failed: %s", gfarm_error_string(e)); return (e); } e = gfarm_gsi_cred_config_convert_to_name( serv_type != GFARM_AUTH_CRED_TYPE_DEFAULT ? serv_type : GFARM_AUTH_CRED_TYPE_HOST, serv_service, serv_name, (char *)hostname, &acceptor_name); if (e != GFARM_ERR_NO_ERROR) { gflog_auth_error(GFARM_MSG_1000697, "Server credential configuration for %s:%s: %s", service_tag, hostname, gfarm_error_string(e)); return (e); } cred = gfarm_gsi_get_delegated_cred(); if (cred == GSS_C_NO_CREDENTIAL) { /* if not delegated */ switch (self_type) { case GFARM_AUTH_ID_TYPE_SPOOL_HOST: /* * If spool_server_cred_service is specified, * a service certificate is used. */ spool_servicetype = gfarm_auth_server_cred_type_get( GFS_SERVICE_TAG); spool_servicename = gfarm_auth_server_cred_service_get( GFS_SERVICE_TAG); e = gfarm_gsi_cred_config_convert_to_name( spool_servicetype != GFARM_AUTH_CRED_TYPE_DEFAULT ? spool_servicetype : GFARM_AUTH_CRED_TYPE_HOST, spool_servicename, NULL, (char *)hostname, &initiator_name); if (e != GFARM_ERR_NO_ERROR) { gflog_auth_error(GFARM_MSG_1000698, "Service credential configuration for %s: %s", spool_servicename, gfarm_error_string(e)); return (e); } break; case GFARM_AUTH_ID_TYPE_USER: /* from client */ break; default: break; } /* * always re-acquire my credential, otherwise we cannot deal * with credential expiration. */ if (gfarmGssAcquireCredential(&cred, initiator_name, GSS_C_INITIATE, &e_major, &e_minor, NULL) < 0) { if (gflog_auth_get_verbose()) { gflog_error(GFARM_MSG_1000699, "Can't acquire my credentail " "because of:"); gfarmGssPrintMajorStatus(e_major); gfarmGssPrintMinorStatus(e_minor); } if (acceptor_name != GSS_C_NO_NAME) gfarmGssDeleteName(&acceptor_name, NULL, NULL); if (initiator_name != GSS_C_NO_NAME) gfarmGssDeleteName(&initiator_name, NULL, NULL); #if 0 return (GFARM_ERR_AUTHENTICATION); #else /* * We don't return GFARM_ERR_AUTHENTICATION or * GFARM_ERR_EXPIRED here for now, * to prevent the caller -- gfarm_auth_request() * -- from trying next auth_method, because current * server side implmenetation doesn't allow us to * continue gracefully in this case. * So, just kill this connection. */ gflog_debug(GFARM_MSG_1001466, "acquirement of client credential failed"); return (GFARM_ERRMSG_CANNOT_ACQUIRE_CLIENT_CRED); #endif } if (initiator_name != GSS_C_NO_NAME) gfarmGssDeleteName(&initiator_name, NULL, NULL); cred_acquired = 1; } /* XXX NOTYET deal with self_type == GFARM_AUTH_ID_TYPE_SPOOL_HOST */ session = gfarmSecSessionInitiate(fd, acceptor_name, cred, GFARM_GSS_DEFAULT_SECURITY_SETUP_FLAG, NULL, &e_major, &e_minor); if (acceptor_name != GSS_C_NO_NAME) gfarmGssDeleteName(&acceptor_name, NULL, NULL); if (session == NULL) { if (gflog_auth_get_verbose()) { gflog_error(GFARM_MSG_1000700, "Can't initiate session because of:"); gfarmGssPrintMajorStatus(e_major); gfarmGssPrintMinorStatus(e_minor); } if (cred_acquired && gfarmGssDeleteCredential(&cred, &e_major, &e_minor) < 0 && gflog_auth_get_verbose()) { gflog_error(GFARM_MSG_1000701, "Can't free my credential because of:"); gfarmGssPrintMajorStatus(e_major); gfarmGssPrintMinorStatus(e_minor); } #if 0 /* XXX e_major/e_minor should be used */ return (GFARM_ERR_AUTHENTICATION); #else /* * We don't return GFARM_ERR_AUTHENTICATION for now, * to prevent the caller -- gfarm_auth_request() * -- from trying next auth_method, because currently * GFSL protocol doesn't guarantee to gracefully continue * further communication on error cases. */ gflog_debug(GFARM_MSG_1001467, "initiation of session failed: %s", gfarm_error_string(GFARM_ERR_OPERATION_NOT_PERMITTED)); return (GFARM_ERR_OPERATION_NOT_PERMITTED); #endif } gfp_xdr_set_secsession(conn, session, cred_acquired ? cred : GSS_C_NO_CREDENTIAL); e = gfp_xdr_recv(conn, 1, &eof, "i", &error); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001468, "receiving response failed: %s", gfarm_error_string(e)); } else if (eof) { gflog_debug(GFARM_MSG_1001469, "Unexpected EOF when receiving response"); e = GFARM_ERR_PROTOCOL; } else if (error != GFARM_AUTH_ERROR_NO_ERROR) { gflog_debug(GFARM_MSG_1001470, "Authentication failed: %d", error); e = GFARM_ERR_AUTHENTICATION; } else { return (GFARM_ERR_NO_ERROR); } gfp_xdr_reset_secsession(conn); gfp_xdr_set_socket(conn, fd); return (e); } /* * multiplexed version of gfarm_auth_request_gsi() for parallel authentication */ struct gfarm_auth_request_gsi_state { struct gfarm_eventqueue *q; struct gfarm_event *readable; struct gfp_xdr *conn; void (*continuation)(void *); void *closure; gss_name_t acceptor_name; gss_cred_id_t cred; int cred_acquired; struct gfarmSecSessionInitiateState *gfsl_state; gfarmSecSession *session; /* results */ gfarm_error_t error; }; static void gfarm_auth_request_gsi_receive_result(int events, int fd, void *closure, const struct timeval *t) { struct gfarm_auth_request_gsi_state *state = closure; int eof; gfarm_int32_t error; /* enum gfarm_auth_error */ if ((events & GFARM_EVENT_TIMEOUT) != 0) { assert(events == GFARM_EVENT_TIMEOUT); state->error = GFARM_ERR_OPERATION_TIMED_OUT; gflog_debug(GFARM_MSG_1001471, "receiving gsi auth result failed: %s", gfarm_error_string(state->error)); if (state->continuation != NULL) (*state->continuation)(state->closure); return; } assert(events == GFARM_EVENT_READ); state->error = gfp_xdr_recv(state->conn, 1, &eof, "i", &error); if (state->error == GFARM_ERR_NO_ERROR && eof) state->error = GFARM_ERR_PROTOCOL; if (state->error == GFARM_ERR_NO_ERROR && error != GFARM_AUTH_ERROR_NO_ERROR) state->error = GFARM_ERR_AUTHENTICATION; if (state->error != GFARM_ERR_NO_ERROR) { gfp_xdr_reset_secsession(state->conn); gfp_xdr_set_socket(state->conn, fd); } if (state->continuation != NULL) (*state->continuation)(state->closure); } static void gfarm_auth_request_gsi_wait_result(void *closure) { struct gfarm_auth_request_gsi_state *state = closure; OM_uint32 e_major, e_minor; int rv; struct timeval timeout; state->session = gfarmSecSessionInitiateResult(state->gfsl_state, &e_major, &e_minor); if (state->session == NULL) { if (gflog_auth_get_verbose()) { gflog_error(GFARM_MSG_1000702, "Can't initiate session because of:"); gfarmGssPrintMajorStatus(e_major); gfarmGssPrintMinorStatus(e_minor); } #if 0 /* XXX e_major/e_minor should be used */ state->error = GFARM_ERR_AUTHENTICATION; #else /* * We don't return GFARM_ERR_AUTHENTICATION for now, * to prevent the caller -- gfarm_auth_request_next_method() * -- from trying next auth_method, because currently * GFSL protocol doesn't guarantee to gracefully continue * further communication on error cases. */ state->error = GFARM_ERR_OPERATION_NOT_PERMITTED; #endif } else { timeout.tv_sec = GFARM_AUTH_TIMEOUT; timeout.tv_usec = 0; rv = gfarm_eventqueue_add_event(state->q, state->readable, &timeout); if (rv == 0) { gfp_xdr_set_secsession(state->conn, state->session, state->cred_acquired ? state->cred : GSS_C_NO_CREDENTIAL); /* go to gfarm_auth_request_gsi_receive_result() */ return; } state->error = gfarm_errno_to_error(rv); } if (state->continuation != NULL) (*state->continuation)(state->closure); } gfarm_error_t gfarm_auth_request_gsi_multiplexed(struct gfarm_eventqueue *q, struct gfp_xdr *conn, const char *service_tag, const char *hostname, enum gfarm_auth_id_type self_type, void (*continuation)(void *), void *closure, void **statepp) { gfarm_error_t e; struct gfarm_auth_request_gsi_state *state; enum gfarm_auth_cred_type serv_type = gfarm_auth_server_cred_type_get(service_tag); char *serv_service = gfarm_auth_server_cred_service_get(service_tag); char *serv_name = gfarm_auth_server_cred_name_get(service_tag); OM_uint32 e_major, e_minor; e = gfarm_gsi_client_initialize(); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001472, "initialization of gsi client failed: %s", gfarm_error_string(e)); return (e); } GFARM_MALLOC(state); if (state == NULL) { gflog_debug(GFARM_MSG_1001473, "allocation of 'state' failed: %s", gfarm_error_string(GFARM_ERR_NO_MEMORY)); return (GFARM_ERR_NO_MEMORY); } /* * We cannot use two independent events (i.e. a fd_event with * GFARM_EVENT_READ flag and a timer_event) here, because * it's possible that both event handlers are called at once. */ state->readable = gfarm_fd_event_alloc( GFARM_EVENT_READ|GFARM_EVENT_TIMEOUT, gfp_xdr_fd(conn), gfarm_auth_request_gsi_receive_result, state); if (state->readable == NULL) { gflog_debug(GFARM_MSG_1001474, "allocation of 'readable' failed: %s", gfarm_error_string(GFARM_ERR_NO_MEMORY)); e = GFARM_ERR_NO_MEMORY; goto error_free_state; } e = gfarm_gsi_cred_config_convert_to_name( serv_type != GFARM_AUTH_CRED_TYPE_DEFAULT ? serv_type : GFARM_AUTH_CRED_TYPE_HOST, serv_service, serv_name, (char *)hostname, &state->acceptor_name); if (e != GFARM_ERR_NO_ERROR) { gflog_auth_error(GFARM_MSG_1000703, "Server credential configuration for %s:%s: %s", service_tag, hostname, gfarm_error_string(e)); goto error_free_readable; } state->cred_acquired = 0; state->cred = gfarm_gsi_get_delegated_cred(); if (state->cred == GSS_C_NO_CREDENTIAL) { /* if not delegated */ /* * always re-acquire my credential, otherwise we cannot deal * with credential expiration. */ if (gfarmGssAcquireCredential(&state->cred, GSS_C_NO_NAME, GSS_C_INITIATE, &e_major, &e_minor, NULL) < 0) { if (gflog_auth_get_verbose()) { gflog_error(GFARM_MSG_1000704, "Can't acquire my credentail " "because of:"); gfarmGssPrintMajorStatus(e_major); gfarmGssPrintMinorStatus(e_minor); } #if 0 e = GFARM_ERR_AUTHENTICATION; #else /* * We don't return GFARM_ERR_AUTHENTICATION or * GFARM_ERR_EXPIRED here for now, to prevent * the caller -- gfarm_auth_request_next_method() * -- from trying next auth_method, because current * server side implmenetation doesn't allow us to * continue gracefully in this case. * So, just kill this connection. */ gflog_debug(GFARM_MSG_1001475, "acquirement of client credential failed"); e = GFARM_ERRMSG_CANNOT_ACQUIRE_CLIENT_CRED; #endif goto error_free_acceptor_name; } state->cred_acquired = 1; } /* XXX NOTYET deal with self_type == GFARM_AUTH_ID_TYPE_SPOOL_HOST */ state->gfsl_state = gfarmSecSessionInitiateRequest(q, gfp_xdr_fd(conn), state->acceptor_name, state->cred, GFARM_GSS_DEFAULT_SECURITY_SETUP_FLAG, NULL, gfarm_auth_request_gsi_wait_result, state, &e_major, &e_minor); if (state->gfsl_state == NULL) { /* XXX e_major/e_minor should be used */ gflog_debug(GFARM_MSG_1001476, "initiation of gsi connection failed"); e = GFARM_ERRMSG_CANNOT_INITIATE_GSI_CONNECTION; goto error_free_cred; } state->q = q; state->conn = conn; state->continuation = continuation; state->closure = closure; state->error = GFARM_ERR_NO_ERROR; *statepp = state; return (GFARM_ERR_NO_ERROR); error_free_cred: if (state->cred_acquired && gfarmGssDeleteCredential(&state->cred, &e_major, &e_minor) < 0 && gflog_auth_get_verbose()) { gflog_error(GFARM_MSG_1000705, "Can't free my credential because of:"); gfarmGssPrintMajorStatus(e_major); gfarmGssPrintMinorStatus(e_minor); } error_free_acceptor_name: if (state->acceptor_name != GSS_C_NO_NAME) gfarmGssDeleteName(&state->acceptor_name, NULL, NULL); error_free_readable: gfarm_event_free(state->readable); error_free_state: free(state); return (e); } gfarm_error_t gfarm_auth_result_gsi_multiplexed(void *sp) { struct gfarm_auth_request_gsi_state *state = sp; gfarm_error_t e = state->error; if (state->acceptor_name != GSS_C_NO_NAME) gfarmGssDeleteName(&state->acceptor_name, NULL, NULL); gfarm_event_free(state->readable); free(state); return (e); } /* * "gsi_auth" method */ gfarm_error_t gfarm_auth_request_gsi_auth(struct gfp_xdr *conn, const char *service_tag, const char *hostname, enum gfarm_auth_id_type self_type) { gfarm_error_t e = gfarm_auth_request_gsi(conn, service_tag, hostname, self_type); if (e == GFARM_ERR_NO_ERROR) gfp_xdr_downgrade_to_insecure_session(conn); return (e); } gfarm_error_t gfarm_auth_request_gsi_auth_multiplexed(struct gfarm_eventqueue *q, struct gfp_xdr *conn, const char *service_tag, const char *hostname, enum gfarm_auth_id_type self_type, void (*continuation)(void *), void *closure, void **statepp) { return (gfarm_auth_request_gsi_multiplexed(q, conn, service_tag, hostname, self_type, continuation, closure, statepp)); } gfarm_error_t gfarm_auth_result_gsi_auth_multiplexed(void *sp) { struct gfarm_auth_request_gsi_state *state = sp; /* sp will be free'ed in gfarm_auth_result_gsi_multiplexed(). * state->conn should be saved before calling it. */ struct gfp_xdr *conn = state->conn; gfarm_error_t e = gfarm_auth_result_gsi_multiplexed(sp); if (e == GFARM_ERR_NO_ERROR) gfp_xdr_downgrade_to_insecure_session(conn); return (e); } gfarm-2.4.1/lib/libgfarm/gfarm/io_fd.h0000644000000000000000000000176111507222723016174 0ustar rootroot/* iobuffer operation: file descriptor read/write */ /* nonblocking i/o */ void gfarm_iobuffer_set_nonblocking_read_fd(struct gfarm_iobuffer *, int); void gfarm_iobuffer_set_nonblocking_write_fd(struct gfarm_iobuffer *, int); /* an option for gfarm_iobuffer_set_write_close() */ #if 0 /* currently not used */ void gfarm_iobuffer_write_close_fd_op(struct gfarm_iobuffer *, void *, int); #endif /* gfp_xdr operation */ struct gfp_xdr; gfarm_error_t gfp_xdr_new_socket(int, struct gfp_xdr **); gfarm_error_t gfp_xdr_set_socket(struct gfp_xdr *, int); /* the followings are refered from "gsi_auth" method implementation */ int gfarm_iobuffer_nonblocking_read_fd_op(struct gfarm_iobuffer *, void *, int, void *, int); int gfarm_iobuffer_nonblocking_write_socket_op(struct gfarm_iobuffer *, void *, int, void *, int); int gfarm_iobuffer_blocking_read_fd_op(struct gfarm_iobuffer *, void *, int, void *, int); int gfarm_iobuffer_blocking_write_socket_op(struct gfarm_iobuffer *, void *, int, void *, int); gfarm-2.4.1/lib/libgfarm/gfarm/auth_server_uid_gsi.c0000644000000000000000000000211711507222723021135 0ustar rootroot#include #include #include #include #include "gfutil.h" #include "auth.h" #include "gfm_client.h" gfarm_error_t gfarm_auth_uid_to_global_username_gsi(void *closure, const char *auth_user_id, char **global_usernamep) { struct gfm_connection *gfm_server = closure; gfarm_error_t e; char *global_username; struct gfarm_user_info ui; /* In GSI, auth_user_id is a DN */ e = gfm_client_user_info_get_by_gsi_dn(gfm_server, auth_user_id, &ui); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001478, "getting user info by gsi dn (%s) failed: %s", auth_user_id, gfarm_error_string(e)); return (e); } if (global_usernamep == NULL) { gfarm_user_info_free(&ui); return (GFARM_ERR_NO_ERROR); } global_username = strdup(ui.username); gfarm_user_info_free(&ui); if (global_username == NULL) { gflog_debug(GFARM_MSG_1001479, "allocation of 'global_username' failed: %s", gfarm_error_string(GFARM_ERR_NO_MEMORY)); return (GFARM_ERR_NO_MEMORY); } *global_usernamep = global_username; return (GFARM_ERR_NO_ERROR); } gfarm-2.4.1/lib/libgfarm/gfarm/liberror.c0000644000000000000000000005441111507222723016727 0ustar rootroot/* * $Id: liberror.c 4527 2010-03-12 10:14:44Z n-soda $ */ #include #include #include #include #include #include #include #include #include #include "gfutil.h" #include "liberror.h" #include "gfpath.h" static const char *errcode_string[GFARM_ERR_NUMBER] = { "success", /* classic errno (1..10) */ "operation not permitted", "no such file or directory", "no such process", "interrupted system call", "input/output error", "device not configured", "argument list too long", "exec format error", "bad file descriptor", "no child process", /* non classic, posix (eagain == ewouldblock) */ "resource temporarily unavailable", /* classic errno (12..34) */ "no memory", "permission denied", /* prohibited by access control */ "bad address", "block device required", /* non posix, non x/open */ "device busy", "already exists", "cross device link", "operation not supported by device", "not a directory", "is a directory", "invalid argument", "too many open files in system", "too many open files", "inappropriate ioctl for device", "text file busy", /* non posix */ "file too large", "no space", "illegal seek", "read only file system", "too many links", "broken pipe", "numerical argument out of domain", "result out of range", /* ISO-C standard amendment, wide/multibyte-character handling */ "illegal byte sequence", /* POSIX */ "resource deadlock avoided", "file name too long", "directory not empty", "no locks available", "function not implemented", /* X/Open */ "operation now in progress", "operation already in progress", /* X/Open - ipc/network software -- argument errors */ "socket operation on non socket", "destination address required", "message too long", "protocol wrong type for socket", "protocol not available", "protocol not supported", "operation not supported", "address family not supported by protocol family", "address already in use", "cannot assign requested address", /* X/Open - ipc/network software -- operational errors */ "network is down", "network is unreachable", "connection aborted", "connection reset by peer", "no buffer space available", "socket is already connected", "socket is not connected", "operation timed out", "connection refused", "no route to host", /* X/Open */ "too many levels of symbolic link", "disk quota exceeded", "stale file handle", /* X/Open - system-v ipc */ "identifier removed", "no message of desired type", "value too large to be stored in data type", /* ipc/network errors */ "authentication error", "expired", "protocol error", "unknown host", "cannot resolve an IP address into a hostname", /* gfarm specific errors */ "no such object", "can't open", "unexpected EOF", "gfarm URL prefix is missing", "too many jobs", "file migrated", "not a symbolic link", "is a symbolic link", "unknown error", "invalid file replica", "no such user", "cannot remove the last replica", "no such group", "username is missing in a Gfarm URL", "hostname is missing in a Gfarm URL", "port number is missing in a Gfarm URL", "port number is invalid in a Gfarm URL", "file busy", }; static const char *errmsg_string[GFARM_ERRMSG_END - GFARM_ERRMSG_BEGIN] = { "inconsistent metadata fixed, try again", "libgfarm internal error: too many error domain", "unknown keyword", "unknown authentication method", /* refered only from gfarm/hostspec.c */ "hostname or IP address expected", "invalid character in hostname", "invalid character in IP address", "too big byte value in IP address", "IP address expected", "IP address less than 4 bytes", "too big netmask", "invalid name record", "reverse-lookup-name isn't resolvable", "reverse-lookup-name doesn't match, possibly forged", /* refered only from gfarm/param.c */ "value isn't specified", "value is empty", "value isn't allowed for boolean", "invalid character in value", "unknown parameter", /* refered only from gfarm/sockopt.c */ "getprotobyname(3) failed", "unknown socket option", /* refered only from gfarm/config.c */ "missing argument", "too many arguments", "integer expected", "floating point number expected", "invalid character", "\"enable\" or \"disable\" is expected", "invalid syslog priority level", "local user name redefined", "global user name redefined", "local group name redefined", "global group name redefined", "missing second field (local user)", "inconsistent configuration, LDAP is specified as metadata backend before", "inconsistent configuration, PostgreSQL is specified as metadata backend before", "inconsistent configuration, localfs is specified as metadata backend before", "unterminated single quote", "unterminated double quote", "incomplete escape: \\", "missing 1st(auth-command) argument", "missing 2nd(auth-method) argument", "missing 3rd(host-spec) argument", "unknown auth subcommand", "missing 1st(netparam-option) argument", "missing 1st(sockopt-option) argument", "missing
argument", "missing argument", "missing argument", "missing 1st(architecture) argument", "missing 2nd(host-spec) argument", "cannot open gfarm2.conf", /* refered only from gfarm/gfp_xdr.c */ "gfp_xdr_send: invalid format character", "gfp_xdr_recv: invalid format character", "gfp_xdr_vrpc: missing result in format string", "gfp_xdr_vrpc: invalid format character", /* refered only from gfarm/auth_common.c */ "gfarm sharedsecret key - invalid expire field", "gfarm sharedsecret key - invalid key field", "gfarm sharedsecret key - key file not exist", /* refered only from gfarm/auth_client.c */ "gfarm auth method isn't available for the host", "usable auth-method isn't configured", "gfarm_auth_request_sharedsecret: implementaton error", "gfarm_auth_request: implementation error", "gfarm_auth_request_sharedsecret_multiplexed: implementaton error", "gfarm_auth_request_multiplexed: implementation error", /* refered only from gfarm/auth_server.c */ "gfarm_auth_sharedsecret_md5_response: key mismatch, continue", /* refered only from gfarm/auth_client_gsi.c */ "GSI credential initialization failed", "GSI initialization failed", "cannot initiate GSI connection", "cannot acquire client-side GSI credential", /* refered only from gfarm/auth_config.c */ "unknown cred_type", /* refered only from gfarm/io_gfsl.c */ "GSI delegated credential doesn't exist", "cannot export GSI delegated credential", /* refered only from gfarm/gfs_client.c */ "gfsd aborted", "illegal gfsd descriptor", "unknown gfsd reply", "GFS_PROTO_PREAD: protocol error", "GFS_PROTO_WRITE: protocol error", /* refered from gfarm/gfs_pio.c and related modules */ "internal error: end of file with gfs_pio", /* refered only from gfarm/glob.c */ "gfs_glob(): gfarm library isn't properly initialized", /* refered only from gfarm/schedule.c */ "no filesystem node", /* refered only from gfarm/auth_common_gsi.c */ "cred_type is not set, but cred_name is set", "cred_type is not set, but cred_service is set", "internal error: missing GSS_C_NO_CREDENTIAL check", "cred_type is \"no-name\", but cred_name is set", "cred_type is \"no-name\", but cred_service is set", "cred_type is \"mechanism-specific\", but cred_name is not set", "cred_type is \"mechanism-specific\", but cred_service is set", "cred_type is \"user\", but cred_service is set", "cred_type is \"self\", but cred_name is set", "cred_type is \"self\", but cred_service is set", "cred_type is \"self\", but not initialized as an initiator", "internal error - invalid cred_type", "invalid credential configuration", /* refered only from gfarm/import_help.c */ "hostname expected", "empty file", }; /* * NOTE: The order of the following table is important. * * For cases that multiple GFARM_ERRs are mapped into same UNIX errno. * first map entry will be used to map UNIX errno to GFARM_ERR, * The implementation of gfarm_errno_to_error_initialize() and * gfarm_errno_to_error() ensures this. * * It is ok that different gfarm_error_t's are mapped into same errno * (because gfarm_error_t is more detailed than errno), * but it isn't ok that different errno's are mapped into same gfarm_error_t * (because that means errno is more detailed than gfarm_error_t). */ static struct gfarm_errno_error_map { int unix_errno; gfarm_error_t gfarm_error; } gfarm_errno_error_map_table[] = { { 0, GFARM_ERR_NO_ERROR }, /* classic errno (1..10) */ { EPERM, GFARM_ERR_OPERATION_NOT_PERMITTED }, { ENOENT, GFARM_ERR_NO_SUCH_FILE_OR_DIRECTORY }, { ESRCH, GFARM_ERR_NO_SUCH_PROCESS }, { EINTR, GFARM_ERR_INTERRUPTED_SYSTEM_CALL }, { EIO, GFARM_ERR_INPUT_OUTPUT }, { ENXIO, GFARM_ERR_DEVICE_NOT_CONFIGURED }, { E2BIG, GFARM_ERR_ARGUMENT_LIST_TOO_LONG }, { ENOEXEC, GFARM_ERR_EXEC_FORMAT }, { EBADF, GFARM_ERR_BAD_FILE_DESCRIPTOR }, { ECHILD, GFARM_ERR_NO_CHILD_PROCESS }, /* non classic, POSIX (EAGAIN == EWOULDBLOCK) */ { EAGAIN, GFARM_ERR_RESOURCE_TEMPORARILY_UNAVAILABLE }, /* classic errno (12..34) */ { ENOMEM, GFARM_ERR_NO_MEMORY }, { EACCES, GFARM_ERR_PERMISSION_DENIED }, { EFAULT, GFARM_ERR_BAD_ADDRESS }, { ENOTBLK, GFARM_ERR_BLOCK_DEVICE_REQUIRED }, { EBUSY, GFARM_ERR_DEVICE_BUSY }, { EEXIST, GFARM_ERR_ALREADY_EXISTS }, { EXDEV, GFARM_ERR_CROSS_DEVICE_LINK }, { ENODEV, GFARM_ERR_OPERATION_NOT_SUPPORTED_BY_DEVICE }, { ENOTDIR, GFARM_ERR_NOT_A_DIRECTORY }, { EISDIR, GFARM_ERR_IS_A_DIRECTORY }, { EINVAL, GFARM_ERR_INVALID_ARGUMENT }, { ENFILE, GFARM_ERR_TOO_MANY_OPEN_FILES_IN_SYSTEM }, { EMFILE, GFARM_ERR_TOO_MANY_OPEN_FILES }, { ENOTTY, GFARM_ERR_INAPPROPRIATE_IOCTL_FOR_DEVICE }, { ETXTBSY, GFARM_ERR_TEXT_FILE_BUSY }, { EFBIG, GFARM_ERR_FILE_TOO_LARGE }, { ENOSPC, GFARM_ERR_NO_SPACE }, { ESPIPE, GFARM_ERR_ILLEGAL_SEEK }, { EROFS, GFARM_ERR_READ_ONLY_FILE_SYSTEM }, { EMLINK, GFARM_ERR_TOO_MANY_LINKS }, { EPIPE, GFARM_ERR_BROKEN_PIPE }, { EDOM, GFARM_ERR_NUMERICAL_ARGUMENT_OUT_OF_DOMAIN }, { ERANGE, GFARM_ERR_RESULT_OUT_OF_RANGE }, /* ISO/IEC 9899 amendment1:1995, wide/multibyte-character handling */ { EILSEQ, GFARM_ERR_ILLEGAL_BYTE_SEQUENCE }, /* POSIX */ { EDEADLK, GFARM_ERR_RESOURCE_DEADLOCK_AVOIDED }, { ENAMETOOLONG, GFARM_ERR_FILE_NAME_TOO_LONG }, { ENOTEMPTY, GFARM_ERR_DIRECTORY_NOT_EMPTY }, { ENOLCK, GFARM_ERR_NO_LOCKS_AVAILABLE }, { ENOSYS, GFARM_ERR_FUNCTION_NOT_IMPLEMENTED }, /* X/Open */ { EINPROGRESS, GFARM_ERR_OPERATION_NOW_IN_PROGRESS }, { EALREADY, GFARM_ERR_OPERATION_ALREADY_IN_PROGRESS }, /* X/Open - ipc/network software -- argument errors */ { ENOTSOCK, GFARM_ERR_SOCKET_OPERATION_ON_NON_SOCKET }, { EDESTADDRREQ, GFARM_ERR_DESTINATION_ADDRESS_REQUIRED }, { EMSGSIZE, GFARM_ERR_MESSAGE_TOO_LONG }, { EPROTOTYPE, GFARM_ERR_PROTOCOL_WRONG_TYPE_FOR_SOCKET }, { ENOPROTOOPT, GFARM_ERR_PROTOCOL_NOT_AVAILABLE }, { EPROTONOSUPPORT, GFARM_ERR_PROTOCOL_NOT_SUPPORTED }, { EOPNOTSUPP, GFARM_ERR_OPERATION_NOT_SUPPORTED }, { EAFNOSUPPORT, GFARM_ERR_ADDRESS_FAMILY_NOT_SUPPORTED_BY_PROTOCOL_FAMILY }, { EADDRINUSE, GFARM_ERR_ADDRESS_ALREADY_IN_USE }, { EADDRNOTAVAIL,GFARM_ERR_CANNOT_ASSIGN_REQUESTED_ADDRESS }, /* X/Open - ipc/network software -- operational errors */ { ENETDOWN, GFARM_ERR_NETWORK_IS_DOWN }, { ENETUNREACH, GFARM_ERR_NETWORK_IS_UNREACHABLE }, { ECONNABORTED, GFARM_ERR_CONNECTION_ABORTED }, { ECONNRESET, GFARM_ERR_CONNECTION_RESET_BY_PEER }, { ENOBUFS, GFARM_ERR_NO_BUFFER_SPACE_AVAILABLE }, { EISCONN, GFARM_ERR_SOCKET_IS_ALREADY_CONNECTED }, { ENOTCONN, GFARM_ERR_SOCKET_IS_NOT_CONNECTED }, { ETIMEDOUT, GFARM_ERR_OPERATION_TIMED_OUT }, { ECONNREFUSED, GFARM_ERR_CONNECTION_REFUSED }, { EHOSTUNREACH, GFARM_ERR_NO_ROUTE_TO_HOST }, /* X/Open */ { ELOOP, GFARM_ERR_TOO_MANY_LEVELS_OF_SYMBOLIC_LINK }, { EDQUOT, GFARM_ERR_DISK_QUOTA_EXCEEDED }, { ESTALE, GFARM_ERR_STALE_FILE_HANDLE }, /* X/Open - System-V IPC */ { EIDRM, GFARM_ERR_IDENTIFIER_REMOVED }, { ENOMSG, GFARM_ERR_NO_MESSAGE_OF_DESIRED_TYPE }, { EOVERFLOW, GFARM_ERR_VALUE_TOO_LARGE_TO_BE_STORED_IN_DATA_TYPE }, /* ipc/network errors */ #ifdef EAUTH { EAUTH, GFARM_ERR_AUTHENTICATION }, /* BSD */ #else { EPERM, GFARM_ERR_AUTHENTICATION }, /* "<-" only */ #endif #ifdef ETIME { ETIME, GFARM_ERR_EXPIRED }, /* Linux */ #endif #ifdef EPROTO { EPROTO, GFARM_ERR_PROTOCOL }, /* SVR4, Linux */ #else { EPROTONOSUPPORT, GFARM_ERR_PROTOCOL }, /* "<-" only */ #endif /* gfarm specific errors */ /* GFARM_ERR_UNKNOWN_HOST */ /* GFARM_ERR_CANNOT_RESOLVE_AN_IP_ADDRESS_INTO_A_HOSTNAME */ /* GFARM_ERR_NO_SUCH_OBJECT */ /* GFARM_ERR_CANT_OPEN */ #ifdef EPROTO { EPROTO, GFARM_ERR_UNEXPECTED_EOF }, #else { ECONNABORTED, GFARM_ERR_UNEXPECTED_EOF }, #endif /* GFARM_ERR_GFARM_URL_PREFIX_IS_MISSING */ { EAGAIN, GFARM_ERR_TOO_MANY_JOBS }, /* GFARM_ERR_FILE_MIGRATED */ { EOPNOTSUPP, GFARM_ERR_NOT_A_SYMBOLIC_LINK }, { EOPNOTSUPP, GFARM_ERR_IS_A_SYMBOLIC_LINK }, /* GFARM_ERR_UNKNOWN */ /* GFARM_ERR_INVALID_FILE_REPLICA */ /* GFARM_ERR_NO_SUCH_USER */ { EPERM, GFARM_ERR_CANNOT_REMOVE_LAST_REPLICA }, /* GFARM_ERR_NO_SUCH_GROUP */ /* GFARM_ERR_GFARM_URL_USER_IS_MISSING */ /* GFARM_ERR_GFARM_URL_HOST_IS_MISSING */ /* GFARM_ERR_GFARM_URL_PORT_IS_MISSING */ /* GFARM_ERR_GFARM_URL_PORT_IS_INVALID */ { EBUSY, GFARM_ERR_FILE_BUSY }, }; struct gfarm_error_domain { gfarm_error_t offset; int domerror_min, domerror_number; gfarm_error_t *map_to_gfarm; const char *(*domerror_to_message)(void *, int); void *domerror_to_message_cookie; /* only used by gfarm_error_range_alloc() case */ struct gfarm_error_domain *next; }; #define MAX_ERROR_DOMAINS 10 static int gfarm_error_domain_number = 0; static struct gfarm_error_domain gfarm_error_domains[MAX_ERROR_DOMAINS]; static struct gfarm_error_domain *gfarm_error_ranges = NULL; /* * allocate an error_domain * for a domain-specific error range [domerror_min, domerror_max] * * the corresponding gfarm error range will be: * [domain->offset, domain->offset + domain->domerror_number - 1] */ gfarm_error_t gfarm_error_domain_alloc(int domerror_min, int domerror_max, const char *(*de_to_m)(void *, int), void *cookie, struct gfarm_error_domain **domainp) { int next_error; struct gfarm_error_domain *last, *new; if (gfarm_error_domain_number >= MAX_ERROR_DOMAINS) { gflog_debug(GFARM_MSG_1000845, "gfarm_error_domain_alloc: too many error domains"); return (GFARM_ERRMSG_TOO_MANY_ERROR_DOMAIN); } if (gfarm_error_domain_number == 0) { next_error = GFARM_ERR_FOREIGN_BEGIN; } else { last = &gfarm_error_domains[gfarm_error_domain_number - 1]; next_error = last->offset + last->domerror_number; } if (next_error + domerror_max - domerror_min >= GFARM_ERR_PRIVATE_BEGIN) { gflog_debug(GFARM_MSG_1000846, "gfarm_error_domain_alloc: too large domain [%d, %d]", domerror_min, domerror_max); return (GFARM_ERR_NUMERICAL_ARGUMENT_OUT_OF_DOMAIN); } new = &gfarm_error_domains[gfarm_error_domain_number]; new->offset = next_error; new->domerror_min = domerror_min; new->domerror_number = domerror_max - domerror_min + 1; new->map_to_gfarm = NULL; /* may be allocated on demand */ new->domerror_to_message = de_to_m; new->domerror_to_message_cookie = cookie; new->next = NULL; *domainp = new; gfarm_error_domain_number++; return (GFARM_ERR_NO_ERROR); } /* * allocate an error range [domerror_min, domerror_max] * within the gfarm error number space * * the corresponding gfarm error range will be: * [domain->offset, domain->offset + domain->domerror_number - 1] * == * [domerror_min, domerror_max] */ gfarm_error_t gfarm_error_range_alloc(int domerror_min, int domerror_max, const char *(*de_to_m)(void *, int), void *cookie, struct gfarm_error_domain **domainp) { struct gfarm_error_domain *dom, *new; /* sanity checks */ if (domerror_min < GFARM_ERR_PRIVATE_BEGIN || domerror_max < domerror_min) { gflog_debug(GFARM_MSG_1000847, "gfarm_error_range_alloc: invalid range [%d, %d]", domerror_min, domerror_max); return (GFARM_ERR_NUMERICAL_ARGUMENT_OUT_OF_DOMAIN); } for (dom = gfarm_error_ranges; dom != NULL; dom = dom->next) { if (domerror_max >= dom->offset && domerror_min < dom->offset + dom->domerror_number - 1) { gflog_debug(GFARM_MSG_1000848, "gfarm_error_range_alloc: [%d, %d] is " "overlapping with an existing range [%d, %d]", domerror_min, domerror_max, dom->offset, dom->offset + dom->domerror_number - 1); return (GFARM_ERR_NUMERICAL_ARGUMENT_OUT_OF_DOMAIN); } } GFARM_MALLOC(new); if (new == NULL) { gflog_debug(GFARM_MSG_1000849, "gfarm_error_range_alloc: no memory"); return (GFARM_ERR_NO_MEMORY); } new->offset = domerror_min; new->domerror_min = domerror_min; new->domerror_number = domerror_max - domerror_min + 1; new->map_to_gfarm = NULL; new->domerror_to_message = de_to_m; new->domerror_to_message_cookie = cookie; new->next = gfarm_error_ranges; gfarm_error_ranges = new; *domainp = new; return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfarm_error_domain_add_map(struct gfarm_error_domain *domain, int domerror, gfarm_error_t error) { int i; if (domerror < domain->domerror_min || domerror >= domain->domerror_min + domain->domerror_number) { gflog_debug(GFARM_MSG_1000850, "gfarm_error_domain_add_map: " "error code %d is out of [%d, %d]", domerror, domain->domerror_min, domain->domerror_min + domain->domerror_number - 1); return (GFARM_ERR_NUMERICAL_ARGUMENT_OUT_OF_DOMAIN); } if (domain->map_to_gfarm == NULL) { GFARM_MALLOC_ARRAY(domain->map_to_gfarm, domain->domerror_number); if (domain->map_to_gfarm == NULL) { gflog_debug(GFARM_MSG_1000851, "gfarm_error_domain_add_map: no memory for %d", domain->domerror_number); return (GFARM_ERR_NO_MEMORY); } for (i = 0; i < domain->domerror_number; i++) domain->map_to_gfarm[i] = GFARM_ERR_UNKNOWN; } domain->map_to_gfarm[domerror - domain->domerror_min] = error; return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfarm_error_domain_map(struct gfarm_error_domain *domain, int domerror) { if (domerror < domain->domerror_min || domerror >= domain->domerror_min + domain->domerror_number) return (GFARM_ERR_UNKNOWN); domerror -= domain->domerror_min; if (domain->map_to_gfarm != NULL && domain->map_to_gfarm[domerror] != GFARM_ERR_UNKNOWN) return (domain->map_to_gfarm[domerror]); return (domain->offset + domerror); } static struct gfarm_error_domain * gfarm_error_domain_search(gfarm_error_t error) { int i; struct gfarm_error_domain *domain; for (i = 0; i < gfarm_error_domain_number; i++) { domain = &gfarm_error_domains[i]; if (error < domain->offset) return (NULL); if (error < domain->offset + domain->domerror_number) return (domain); } for (domain = gfarm_error_ranges; domain != NULL; domain = domain->next) { if (domain->offset <= error && error < domain->offset + domain->domerror_number) return (domain); } return (NULL); } const char * gfarm_error_string(gfarm_error_t error) { struct gfarm_error_domain *domain; if (error < 0) return (errcode_string[GFARM_ERR_UNKNOWN]); if (error < GFARM_ERR_NUMBER) { if (error >= GFARM_ARRAY_LENGTH(errcode_string)) { gflog_warning(GFARM_MSG_1000852, "gfarm_error_string: missing errcode_string: %d", error); return (errcode_string[GFARM_ERR_UNKNOWN]); } return (errcode_string[error]); } if (error < GFARM_ERRMSG_BEGIN) return (errcode_string[GFARM_ERR_UNKNOWN]); if (error < GFARM_ERRMSG_END) return (errmsg_string[error - GFARM_ERRMSG_BEGIN]); if ((domain = gfarm_error_domain_search(error)) != NULL) { error -= domain->offset; #if 0 /* to make this return original error message instead of mapped one */ /* this shouldn't happen, usually */ if (domain->map_to_gfarm != NULL && domain->map_to_gfarm[error] != GFARM_ERR_UNKNOWN) return (errcode_string[domain->map_to_gfarm[error]]); #endif return ((*domain->domerror_to_message)( domain->domerror_to_message_cookie, domain->domerror_min + error)); } return (errcode_string[GFARM_ERR_UNKNOWN]); } #if defined(HAVE_SYS_NERR) # define ERRNO_NUMBER sys_nerr #elif defined(ELAST) # define ERRNO_NUMBER (ELAST + 1) #else # define ERRNO_NUMBER 256 /* XXX */ #endif static struct gfarm_error_domain *gfarm_errno_domain = NULL; const char * gfarm_errno_to_string(void *cookie, int eno) { return (strerror(eno)); } static void gfarm_errno_to_error_initialize(void) { gfarm_error_t e; int i; struct gfarm_errno_error_map *map; /* Solaris calls this function more than once with non-pthread apps */ if (gfarm_errno_domain != NULL) return; e = gfarm_error_domain_alloc(0, ERRNO_NUMBER, gfarm_errno_to_string, NULL, &gfarm_errno_domain); if (e != GFARM_ERR_NO_ERROR) /* really fatal problem */ gflog_fatal(GFARM_MSG_1000007, "libgfarm: cannot allocate error domain for errno"); for (i = 0; i < GFARM_ARRAY_LENGTH(gfarm_errno_error_map_table); i++) { map = &gfarm_errno_error_map_table[i]; if (gfarm_error_domain_map(gfarm_errno_domain, map->unix_errno) < GFARM_ERR_NUMBER) continue; /* a mapping is already registered */ if ((e = gfarm_error_domain_add_map(gfarm_errno_domain, map->unix_errno, map->gfarm_error)) != GFARM_ERR_NO_ERROR){ gflog_fatal(GFARM_MSG_1000853, "libgfarm: initializing error map " "(%d -> %d): %s (%d)", map->unix_errno, map->gfarm_error, e == GFARM_ERR_NO_MEMORY ? "no memory" : "unexpected error", e); } } } gfarm_error_t gfarm_errno_to_error(int eno) { static pthread_once_t gfarm_errno_to_error_initialized = PTHREAD_ONCE_INIT; pthread_once(&gfarm_errno_to_error_initialized, gfarm_errno_to_error_initialize); return (gfarm_error_domain_map(gfarm_errno_domain, eno)); } static int gfarm_error_to_errno_map[GFARM_ERR_NUMBER]; static void gfarm_error_to_errno_initialize(void) { int i; struct gfarm_errno_error_map *map; for (i = 0; i < GFARM_ARRAY_LENGTH(gfarm_errno_error_map_table); i++) { map = &gfarm_errno_error_map_table[i]; gfarm_error_to_errno_map[map->gfarm_error] = map->unix_errno; } for (i = 1; i < GFARM_ARRAY_LENGTH(gfarm_error_to_errno_map); i++) { if (gfarm_error_to_errno_map[i] == 0) gfarm_error_to_errno_map[i] = EINVAL; } } int gfarm_error_to_errno(gfarm_error_t error) { static pthread_once_t gfarm_error_to_errno_initialized = PTHREAD_ONCE_INIT; pthread_once(&gfarm_error_to_errno_initialized, gfarm_error_to_errno_initialize); if (error < GFARM_ERR_NUMBER) return (gfarm_error_to_errno_map[error]); return (EINVAL); } gfarm-2.4.1/lib/libgfarm/gfarm/gfs_statfs.c0000644000000000000000000000173011507222723017246 0ustar rootroot/* * $Id$ */ #include #include #include #include #include #include "gfm_client.h" #include "config.h" /* XXX FIXME: implement gfs_statvfs() which takes a path as an argument */ gfarm_error_t gfs_statfs(gfarm_off_t *used, gfarm_off_t *avail, gfarm_off_t *files) { gfarm_error_t e; struct gfm_connection *gfm_server; int retry = 0; for (;;) { if ((e = gfm_client_connection_and_process_acquire( gfarm_metadb_server_name, gfarm_metadb_server_port, &gfm_server)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001379, "acquirement of client connection and process " "failed: %s", gfarm_error_string(e)); return (e); } e = gfm_client_statfs(gfm_server, used, avail, files); if (gfm_client_is_connection_error(e) && ++retry <= 1){ gfm_client_connection_free(gfm_server); continue; } break; } gfm_client_connection_free(gfm_server); return (e); } gfarm-2.4.1/lib/libgfarm/gfarm/gfs_attrplus.h0000644000000000000000000000017311507222724017626 0ustar rootrootgfarm_error_t gfs_getattrplus(const char *, char **, int, int, struct gfs_stat *, int *, char ***, void ***, size_t **); gfarm-2.4.1/lib/libgfarm/gfarm/auth.h0000644000000000000000000001465211507222723016060 0ustar rootrootenum gfarm_auth_error { GFARM_AUTH_ERROR_NO_ERROR, GFARM_AUTH_ERROR_DENIED, GFARM_AUTH_ERROR_NOT_SUPPORTED, GFARM_AUTH_ERROR_INVALID_CREDENTIAL, GFARM_AUTH_ERROR_EXPIRED, GFARM_AUTH_ERROR_RESOURCE_UNAVAILABLE, }; enum gfarm_auth_id_type { GFARM_AUTH_ID_TYPE_USER, GFARM_AUTH_ID_TYPE_SPOOL_HOST, }; enum gfarm_auth_method { GFARM_AUTH_METHOD_NONE, /* never used */ GFARM_AUTH_METHOD_SHAREDSECRET, GFARM_AUTH_METHOD_GSI_OLD, /* not supported since 2003/07/09 */ GFARM_AUTH_METHOD_GSI, GFARM_AUTH_METHOD_GSI_AUTH, GFARM_AUTH_METHOD_NUMBER }; enum gfarm_auth_cred_type { GFARM_AUTH_CRED_TYPE_DEFAULT, GFARM_AUTH_CRED_TYPE_NO_NAME, GFARM_AUTH_CRED_TYPE_MECHANISM_SPECIFIC, GFARM_AUTH_CRED_TYPE_HOST, GFARM_AUTH_CRED_TYPE_USER, GFARM_AUTH_CRED_TYPE_SELF }; #define GFARM_AUTH_METHOD_ALL GFARM_AUTH_METHOD_NONE #define GFARM_AUTH_TIMEOUT 60 /* seconds */ /* * GFARM_AUTH_METHOD_SHAREDSECRET dependent constants. * note that this is too weak authentication for the Internet. */ void gfarm_auth_random(void *, size_t); void gfarm_auth_sharedsecret_response_data(char *, char *, char *); struct passwd; gfarm_error_t gfarm_auth_shared_key_get(unsigned int *, char *, char *, struct passwd *, int, int); #define GFARM_AUTH_SHARED_KEY_GET 0 #define GFARM_AUTH_SHARED_KEY_CREATE 1 #define GFARM_AUTH_SHARED_KEY_CREATE_FORCE 2 /* request */ enum gfarm_auth_sharedsecret_request { GFARM_AUTH_SHAREDSECRET_GIVEUP, GFARM_AUTH_SHAREDSECRET_MD5 }; /* key */ #define GFARM_AUTH_RETRY_MAX 2 #define GFARM_AUTH_SHARED_KEY_LEN 32 #define GFARM_AUTH_CHALLENGE_LEN 32 #define GFARM_AUTH_RESPONSE_LEN 16 /* length of MD5 */ #define GFARM_AUTH_SHARED_KEY_BASENAME ".gfarm_shared_key" #define GFARM_AUTH_SHARED_KEY_PRINTNAME "~/" GFARM_AUTH_SHARED_KEY_BASENAME /* GSI */ gfarm_error_t gfarm_gsi_server_initialize(void); gfarm_error_t gfarm_gsi_client_initialize(void); #define GFARM_IS_AUTH_GSI(auth) \ (((auth) == GFARM_AUTH_METHOD_GSI) || \ ((auth) == GFARM_AUTH_METHOD_GSI_AUTH)) /* auth_client */ struct gfp_xdr; struct sockaddr; struct gfarm_eventqueue; struct gfarm_auth_request_state; gfarm_error_t gfarm_authorize_log_connected(struct gfp_xdr *, char *, char *); gfarm_error_t gfarm_auth_request(struct gfp_xdr *, const char *, const char *, struct sockaddr *, enum gfarm_auth_id_type, enum gfarm_auth_method *); gfarm_error_t gfarm_auth_request_multiplexed(struct gfarm_eventqueue *, struct gfp_xdr *, const char *, const char *, struct sockaddr *, enum gfarm_auth_id_type, void (*)(void *), void *, struct gfarm_auth_request_state **); gfarm_error_t gfarm_auth_result_multiplexed(struct gfarm_auth_request_state *, enum gfarm_auth_method *); gfarm_error_t gfarm_authorize(struct gfp_xdr *, int, char *, char *, struct sockaddr *, gfarm_error_t (*)(void *, enum gfarm_auth_method, const char *, char **), void *, enum gfarm_auth_id_type *, char **, enum gfarm_auth_method *); /* default implementation of 6th argument of gfarm_authorize() */ gfarm_error_t gfarm_auth_uid_to_global_username(void *, enum gfarm_auth_method, const char *, char **); /* client side configuration */ gfarm_error_t gfarm_set_auth_id_type(enum gfarm_auth_id_type); enum gfarm_auth_id_type gfarm_get_auth_id_type(void); /* auth_config */ struct gfarm_hostspec; char gfarm_auth_method_mnemonic(enum gfarm_auth_method); char *gfarm_auth_method_name(enum gfarm_auth_method); gfarm_error_t gfarm_auth_method_parse(char *, enum gfarm_auth_method *); gfarm_error_t gfarm_auth_enable( enum gfarm_auth_method, struct gfarm_hostspec *); gfarm_error_t gfarm_auth_disable( enum gfarm_auth_method, struct gfarm_hostspec *); /* this i/f have to be changed, if we support more than 31 auth methods */ gfarm_int32_t gfarm_auth_method_get_enabled_by_name_addr( const char *, struct sockaddr *); gfarm_int32_t gfarm_auth_method_get_available(void); gfarm_error_t gfarm_auth_cred_type_parse(char *, enum gfarm_auth_cred_type *); enum gfarm_auth_cred_type gfarm_auth_server_cred_type_get(const char *); char *gfarm_auth_server_cred_service_get(const char *); char *gfarm_auth_server_cred_name_get(const char *); gfarm_error_t gfarm_auth_server_cred_type_set_by_string(char *, char *); gfarm_error_t gfarm_auth_server_cred_type_set(char *, enum gfarm_auth_cred_type); gfarm_error_t gfarm_auth_server_cred_service_set(char *, char *); gfarm_error_t gfarm_auth_server_cred_name_set(char *, char *); /* auth_client_sharedsecret */ gfarm_error_t gfarm_auth_request_sharedsecret(struct gfp_xdr *, const char *, const char *, enum gfarm_auth_id_type); gfarm_error_t gfarm_auth_request_sharedsecret_multiplexed( struct gfarm_eventqueue *, struct gfp_xdr *, const char *, const char *, enum gfarm_auth_id_type, void (*)(void *), void *, void **); gfarm_error_t gfarm_auth_result_sharedsecret_multiplexed(void *); /* auth_client_gsi */ gfarm_error_t gfarm_auth_request_gsi(struct gfp_xdr *, const char *, const char *, enum gfarm_auth_id_type); gfarm_error_t gfarm_auth_request_gsi_multiplexed(struct gfarm_eventqueue *, struct gfp_xdr *, const char *, const char *, enum gfarm_auth_id_type, void (*)(void *), void *, void **); gfarm_error_t gfarm_auth_result_gsi_multiplexed(void *); char *gfarm_gsi_client_cred_name(void); /* auth_client_gsi_auth */ gfarm_error_t gfarm_auth_request_gsi_auth(struct gfp_xdr *, const char *, const char *, enum gfarm_auth_id_type); gfarm_error_t gfarm_auth_request_gsi_auth_multiplexed( struct gfarm_eventqueue *, struct gfp_xdr *, const char *, const char *, enum gfarm_auth_id_type, void (*)(void *), void *, void **); gfarm_error_t gfarm_auth_result_gsi_auth_multiplexed(void *); /* auth_server_sharedsecret */ gfarm_error_t gfarm_authorize_sharedsecret(struct gfp_xdr *, int, char *, char *, gfarm_error_t (*)(void *, enum gfarm_auth_method, const char *, char **), void *, enum gfarm_auth_id_type *, char **); /* auth_server_gsi */ gfarm_error_t gfarm_authorize_gsi(struct gfp_xdr *, int, char *, char *, gfarm_error_t (*)(void *, enum gfarm_auth_method, const char *, char **), void *, enum gfarm_auth_id_type *, char **); /* auth_server_gsi_auth */ gfarm_error_t gfarm_authorize_gsi_auth(struct gfp_xdr *, int, char *, char *, gfarm_error_t (*)(void *, enum gfarm_auth_method, const char *, char **), void *, enum gfarm_auth_id_type *, char **); /* auth_server_uid / sharedsecret */ gfarm_error_t gfarm_auth_uid_to_global_username_sharedsecret(void *, const char *, char **); /* auth_server_uid_gsi */ gfarm_error_t gfarm_auth_uid_to_global_username_gsi(void *, const char *, char **); gfarm-2.4.1/lib/libgfarm/gfarm/gfs_chown.c0000644000000000000000000000250611507222723017062 0ustar rootroot#include /* config.h needs FILE */ #include #include #define GFARM_INTERNAL_USE #include #include "gfutil.h" #include "timer.h" #include "gfs_profile.h" #include "gfm_client.h" #include "config.h" #include "lookup.h" struct gfm_chown_closure { const char *username, *groupname; }; static gfarm_error_t gfm_chown_request(struct gfm_connection *gfm_server, void *closure) { struct gfm_chown_closure *c = closure; gfarm_error_t e = gfm_client_fchown_request(gfm_server, c->username, c->groupname); if (e != GFARM_ERR_NO_ERROR) gflog_warning(GFARM_MSG_1000116, "fchown_fd request; %s", gfarm_error_string(e)); return (e); } static gfarm_error_t gfm_chown_result(struct gfm_connection *gfm_server, void *closure) { gfarm_error_t e = gfm_client_fchown_result(gfm_server); #if 0 /* DEBUG */ if (e != GFARM_ERR_NO_ERROR) gflog_debug(GFARM_MSG_1000117, "fchown result; %s", gfarm_error_string(e)); #endif return (e); } gfarm_error_t gfs_chown(const char *path, const char *username, const char *groupname) { struct gfm_chown_closure closure; closure.username = username; closure.groupname = groupname; return (gfm_inode_op(path, GFARM_FILE_LOOKUP, gfm_chown_request, gfm_chown_result, gfm_inode_success_op_connection_free, NULL, &closure)); } gfarm-2.4.1/lib/libgfarm/gfarm/gfm_client.h0000644000000000000000000004512411507222723017224 0ustar rootrootstruct gfm_connection; struct gfs_dirent; struct gfarm_host_info; struct gfarm_user_info; struct gfarm_group_info; struct gfarm_group_names; struct gfarm_quota_get_info; struct gfarm_quota_set_info; struct gfarm_host_sched_info { char *host; gfarm_uint32_t port; gfarm_uint32_t ncpu; /* XXX should have whole gfarm_host_info? */ /* if GFM_PROTO_SCHED_FLAG_LOADAVG_AVAIL */ float loadavg; gfarm_uint64_t cache_time; gfarm_uint64_t disk_used; gfarm_uint64_t disk_avail; /* if GFM_PROTO_SCHED_FLAG_RTT_AVAIL */ gfarm_uint64_t rtt_cache_time; gfarm_uint32_t rtt_usec; gfarm_uint32_t flags; /* GFM_PROTO_SCHED_FLAG_* */ }; void gfarm_host_sched_info_free(int, struct gfarm_host_sched_info *); int gfm_client_is_connection_error(gfarm_error_t); struct gfp_xdr *gfm_client_connection_conn(struct gfm_connection *); int gfm_client_connection_fd(struct gfm_connection *); enum gfarm_auth_method gfm_client_connection_auth_method( struct gfm_connection *); int gfm_client_is_connection_valid(struct gfm_connection *); const char *gfm_client_hostname(struct gfm_connection *); const char *gfm_client_username(struct gfm_connection *); int gfm_client_port(struct gfm_connection *); gfarm_error_t gfm_client_process_get(struct gfm_connection *, gfarm_int32_t *, const char **, size_t *, gfarm_pid_t *); int gfm_cached_connection_had_connection_error(struct gfm_connection *); gfarm_error_t gfm_client_connection_acquire(const char *, int, struct gfm_connection **); gfarm_error_t gfm_client_connection_and_process_acquire(const char *, int, struct gfm_connection **); gfarm_error_t gfm_client_connect(const char *, int, struct gfm_connection **, const char *); void gfm_client_connection_free(struct gfm_connection *); void gfm_client_terminate(void); /* host/user/group metadata */ gfarm_error_t gfm_client_host_info_get_all(struct gfm_connection *, int *, struct gfarm_host_info **); gfarm_error_t gfm_client_host_info_get_by_architecture( struct gfm_connection *, const char *, int *, struct gfarm_host_info **); gfarm_error_t gfm_client_host_info_get_by_names(struct gfm_connection *, int, const char **, gfarm_error_t *, struct gfarm_host_info *); gfarm_error_t gfm_client_host_info_get_by_namealiases(struct gfm_connection *, int, const char **, gfarm_error_t *, struct gfarm_host_info *); gfarm_error_t gfm_client_host_info_set(struct gfm_connection *, const struct gfarm_host_info *); gfarm_error_t gfm_client_host_info_modify(struct gfm_connection *, const struct gfarm_host_info *); gfarm_error_t gfm_client_host_info_remove(struct gfm_connection *, const char *); gfarm_error_t gfm_client_user_info_get_all(struct gfm_connection *, int *, struct gfarm_user_info **); gfarm_error_t gfm_client_user_info_get_by_names(struct gfm_connection *, int, const char **, gfarm_error_t *, struct gfarm_user_info *); gfarm_error_t gfm_client_user_info_get_by_gsi_dn(struct gfm_connection *, const char *, struct gfarm_user_info *); gfarm_error_t gfm_client_user_info_set(struct gfm_connection *, const struct gfarm_user_info *); gfarm_error_t gfm_client_user_info_modify(struct gfm_connection *, const struct gfarm_user_info *); gfarm_error_t gfm_client_user_info_remove(struct gfm_connection *, const char *); gfarm_error_t gfm_client_group_info_get_all(struct gfm_connection *, int *, struct gfarm_group_info **); gfarm_error_t gfm_client_group_info_get_by_names(struct gfm_connection *, int, const char **, gfarm_error_t *, struct gfarm_group_info *); gfarm_error_t gfm_client_group_info_set(struct gfm_connection *, const struct gfarm_group_info *); gfarm_error_t gfm_client_group_info_modify(struct gfm_connection *, const struct gfarm_group_info *); gfarm_error_t gfm_client_group_info_remove(struct gfm_connection *, const char *); gfarm_error_t gfm_client_group_info_add_users(struct gfm_connection *, const char *, int, const char **, gfarm_error_t *); gfarm_error_t gfm_client_group_info_remove_users( struct gfm_connection *, const char *, int, const char **, gfarm_error_t *); gfarm_error_t gfm_client_group_names_get_by_users(struct gfm_connection *, int, const char **, gfarm_error_t *, struct gfarm_group_names *); /* gfs from client */ gfarm_error_t gfm_client_compound_begin_request(struct gfm_connection *); gfarm_error_t gfm_client_compound_begin_result(struct gfm_connection *); gfarm_error_t gfm_client_compound_end_request(struct gfm_connection *); gfarm_error_t gfm_client_compound_end_result(struct gfm_connection *); gfarm_error_t gfm_client_compound_until_eof_request(struct gfm_connection *); gfarm_error_t gfm_client_compound_until_eof_result(struct gfm_connection *); gfarm_error_t gfm_client_compound_on_eof_request(struct gfm_connection *); gfarm_error_t gfm_client_compound_on_eof_result(struct gfm_connection *); gfarm_error_t gfm_client_compound_on_error_request(struct gfm_connection *, gfarm_error_t); gfarm_error_t gfm_client_compound_on_error_result(struct gfm_connection *); gfarm_error_t gfm_client_get_fd_request(struct gfm_connection *); gfarm_error_t gfm_client_get_fd_result(struct gfm_connection *, gfarm_int32_t *); gfarm_error_t gfm_client_put_fd_request(struct gfm_connection *, gfarm_int32_t); gfarm_error_t gfm_client_put_fd_result(struct gfm_connection *); gfarm_error_t gfm_client_save_fd_request(struct gfm_connection *); gfarm_error_t gfm_client_save_fd_result(struct gfm_connection *); gfarm_error_t gfm_client_restore_fd_request(struct gfm_connection *); gfarm_error_t gfm_client_restore_fd_result(struct gfm_connection *); gfarm_error_t gfm_client_create_request(struct gfm_connection *, const char *, gfarm_uint32_t, gfarm_uint32_t); gfarm_error_t gfm_client_create_result(struct gfm_connection *, gfarm_ino_t *, gfarm_uint64_t *, gfarm_mode_t *); gfarm_error_t gfm_client_open_request(struct gfm_connection *, const char *, size_t, gfarm_uint32_t); gfarm_error_t gfm_client_open_result(struct gfm_connection *, gfarm_ino_t *, gfarm_uint64_t *, gfarm_mode_t *); gfarm_error_t gfm_client_open_root_request(struct gfm_connection *, gfarm_uint32_t); gfarm_error_t gfm_client_open_root_result(struct gfm_connection *); gfarm_error_t gfm_client_open_parent_request(struct gfm_connection *, gfarm_uint32_t); gfarm_error_t gfm_client_open_parent_result(struct gfm_connection *); gfarm_error_t gfm_client_close_request(struct gfm_connection *); gfarm_error_t gfm_client_close_result(struct gfm_connection *); gfarm_error_t gfm_client_close_read_request(struct gfm_connection *, gfarm_int64_t, gfarm_int32_t); gfarm_error_t gfm_client_close_read_result(struct gfm_connection *); gfarm_error_t gfm_client_close_write_request(struct gfm_connection *, gfarm_off_t, gfarm_int64_t, gfarm_int32_t, gfarm_int64_t, gfarm_int32_t); gfarm_error_t gfm_client_close_write_result(struct gfm_connection *); gfarm_error_t gfm_client_close_write_v2_4_request(struct gfm_connection *, gfarm_off_t, gfarm_int64_t, gfarm_int32_t, gfarm_int64_t, gfarm_int32_t); gfarm_error_t gfm_client_close_write_v2_4_result(struct gfm_connection *, gfarm_int32_t *, gfarm_int64_t *, gfarm_int64_t *); gfarm_error_t gfm_client_generation_updated_request(struct gfm_connection *, gfarm_int32_t); gfarm_error_t gfm_client_generation_updated_result(struct gfm_connection *); gfarm_error_t gfm_client_verify_type_request(struct gfm_connection *, gfarm_int32_t); gfarm_error_t gfm_client_verify_type_result(struct gfm_connection *); gfarm_error_t gfm_client_verify_type_not_request(struct gfm_connection *, gfarm_int32_t); gfarm_error_t gfm_client_verify_type_not_result(struct gfm_connection *); gfarm_error_t gfm_client_bequeath_fd_request(struct gfm_connection *); gfarm_error_t gfm_client_bequeath_fd_result(struct gfm_connection *); gfarm_error_t gfm_client_inherit_fd_request(struct gfm_connection *, gfarm_int32_t); gfarm_error_t gfm_client_inherit_fd_result(struct gfm_connection *); gfarm_error_t gfm_client_fstat_request(struct gfm_connection *); gfarm_error_t gfm_client_fstat_result(struct gfm_connection *, struct gfs_stat *); gfarm_error_t gfm_client_fgetattrplus_request(struct gfm_connection *, char **, int, int); gfarm_error_t gfm_client_fgetattrplus_result(struct gfm_connection *, struct gfs_stat *, int *, char ***, void ***, size_t **); gfarm_error_t gfm_client_futimes_request(struct gfm_connection *, gfarm_int64_t, gfarm_int32_t, gfarm_int64_t, gfarm_int32_t); gfarm_error_t gfm_client_futimes_result(struct gfm_connection *); gfarm_error_t gfm_client_fchmod_request(struct gfm_connection *, gfarm_mode_t); gfarm_error_t gfm_client_fchmod_result(struct gfm_connection *); gfarm_error_t gfm_client_fchown_request(struct gfm_connection *, const char *, const char *); gfarm_error_t gfm_client_fchown_result(struct gfm_connection *); gfarm_error_t gfm_client_cksum_get_request(struct gfm_connection *); gfarm_error_t gfm_client_cksum_get_result(struct gfm_connection *, char **, size_t, size_t *, char *, gfarm_int32_t *); gfarm_error_t gfm_client_cksum_set_request(struct gfm_connection *, char *, size_t, const char *, gfarm_int32_t, gfarm_int64_t, gfarm_int32_t); gfarm_error_t gfm_client_cksum_set_result(struct gfm_connection *); gfarm_error_t gfm_client_schedule_file_request(struct gfm_connection *, const char *); gfarm_error_t gfm_client_schedule_file_result( struct gfm_connection *, int *, struct gfarm_host_sched_info **); gfarm_error_t gfm_client_schedule_file_with_program_request( struct gfm_connection *, const char *); gfarm_error_t gfm_client_schedule_file_with_program_result( struct gfm_connection *, int *, struct gfarm_host_sched_info **); gfarm_error_t gfm_client_schedule_host_domain(struct gfm_connection *, const char *, int *, struct gfarm_host_sched_info **); gfarm_error_t gfm_client_remove_request(struct gfm_connection *, const char *); gfarm_error_t gfm_client_remove_result(struct gfm_connection *); gfarm_error_t gfm_client_rename_request(struct gfm_connection *, const char *, const char *); gfarm_error_t gfm_client_rename_result(struct gfm_connection *); gfarm_error_t gfm_client_flink_request(struct gfm_connection *, const char *); gfarm_error_t gfm_client_flink_result(struct gfm_connection *); gfarm_error_t gfm_client_mkdir_request(struct gfm_connection *, const char *, gfarm_mode_t); gfarm_error_t gfm_client_mkdir_result(struct gfm_connection *); gfarm_error_t gfm_client_symlink_request(struct gfm_connection *, const char *, const char *); gfarm_error_t gfm_client_symlink_result(struct gfm_connection *); gfarm_error_t gfm_client_readlink_request(struct gfm_connection *); gfarm_error_t gfm_client_readlink_result(struct gfm_connection *, char **); gfarm_error_t gfm_client_getdirpath_request(struct gfm_connection *); gfarm_error_t gfm_client_getdirpath_result(struct gfm_connection *, char **); gfarm_error_t gfm_client_getdirents_request(struct gfm_connection *, gfarm_int32_t); gfarm_error_t gfm_client_getdirents_result(struct gfm_connection *, int *, struct gfs_dirent *); gfarm_error_t gfm_client_getdirentsplus_request(struct gfm_connection *, gfarm_int32_t); gfarm_error_t gfm_client_getdirentsplus_result(struct gfm_connection *, int *, struct gfs_dirent *, struct gfs_stat *); gfarm_error_t gfm_client_getdirentsplusxattr_request(struct gfm_connection *, gfarm_int32_t, char **, int); gfarm_error_t gfm_client_getdirentsplusxattr_result(struct gfm_connection *, int *, struct gfs_dirent *, struct gfs_stat *, int *, char ***, void ***, size_t **); gfarm_error_t gfm_client_seek_request(struct gfm_connection *, gfarm_off_t, gfarm_int32_t); gfarm_error_t gfm_client_seek_result(struct gfm_connection *, gfarm_off_t *); gfarm_error_t gfm_client_statfs(struct gfm_connection *, gfarm_off_t *, gfarm_off_t *, gfarm_off_t *); gfarm_error_t gfm_client_setxattr_request(struct gfm_connection *, int, const char *, const void *, size_t, int); gfarm_error_t gfm_client_setxmlattr_request(struct gfm_connection *, const char *, const void *, size_t, int); gfarm_error_t gfm_client_setxattr_result(struct gfm_connection *); gfarm_error_t gfm_client_setxmlattr_result(struct gfm_connection *); gfarm_error_t gfm_client_getxattr_request(struct gfm_connection *, int, const char *); gfarm_error_t gfm_client_getxmlattr_request(struct gfm_connection *, const char *); gfarm_error_t gfm_client_getxattr_result(struct gfm_connection *, int, void **, size_t *); gfarm_error_t gfm_client_getxmlattr_result(struct gfm_connection *, void **, size_t *); gfarm_error_t gfm_client_listxattr_request(struct gfm_connection *, int); gfarm_error_t gfm_client_listxmlattr_request(struct gfm_connection *); gfarm_error_t gfm_client_listxattr_result(struct gfm_connection *, char **, size_t *); gfarm_error_t gfm_client_listxmlattr_result(struct gfm_connection *, char **, size_t *); gfarm_error_t gfm_client_removexattr_request(struct gfm_connection *, int, const char *); gfarm_error_t gfm_client_removexmlattr_request(struct gfm_connection *, const char *); gfarm_error_t gfm_client_removexattr_result(struct gfm_connection *); gfarm_error_t gfm_client_removexmlattr_result(struct gfm_connection *); gfarm_error_t gfm_client_findxmlattr_request(struct gfm_connection *, struct gfs_xmlattr_ctx *ctxp); gfarm_error_t gfm_client_findxmlattr_result(struct gfm_connection *, struct gfs_xmlattr_ctx *ctxp); gfarm_error_t gfm_client_quota_user_get(struct gfm_connection *, const char *, struct gfarm_quota_get_info *); gfarm_error_t gfm_client_quota_user_set(struct gfm_connection *, struct gfarm_quota_set_info *); gfarm_error_t gfm_client_quota_group_get(struct gfm_connection *, const char *, struct gfarm_quota_get_info *); gfarm_error_t gfm_client_quota_group_set(struct gfm_connection *, struct gfarm_quota_set_info *); gfarm_error_t gfm_client_quota_check(struct gfm_connection *); /* gfs from gfsd */ gfarm_error_t gfm_client_reopen_request(struct gfm_connection *); gfarm_error_t gfm_client_reopen_result(struct gfm_connection *, gfarm_ino_t *, gfarm_uint64_t *, gfarm_int32_t *, gfarm_int32_t *, gfarm_int32_t *); gfarm_error_t gfm_client_lock_request(struct gfm_connection *, gfarm_off_t, gfarm_off_t, gfarm_int32_t, gfarm_int32_t); gfarm_error_t gfm_client_lock_result(struct gfm_connection *); gfarm_error_t gfm_client_trylock_request(struct gfm_connection *, gfarm_off_t, gfarm_off_t, gfarm_int32_t, gfarm_int32_t); gfarm_error_t gfm_client_trylock_result(struct gfm_connection *); gfarm_error_t gfm_client_unlock_request(struct gfm_connection *, gfarm_off_t, gfarm_off_t, gfarm_int32_t, gfarm_int32_t); gfarm_error_t gfm_client_unlock_result(struct gfm_connection *); gfarm_error_t gfm_client_lock_info_request(struct gfm_connection *, gfarm_off_t, gfarm_off_t, gfarm_int32_t, gfarm_int32_t); gfarm_error_t gfm_client_lock_info_result(struct gfm_connection *, gfarm_off_t *, gfarm_off_t *, gfarm_int32_t *, char **, gfarm_pid_t *); #if 1 /* should be 0, since gfmd has to be newer than gfsd */ gfarm_error_t gfm_client_switch_back_channel(struct gfm_connection *); #endif gfarm_error_t gfm_client_switch_async_back_channel(struct gfm_connection *, gfarm_int32_t, gfarm_int64_t, gfarm_int32_t *); /* gfs_pio from client */ /*XXX*/ /* misc operations from gfsd */ gfarm_error_t gfm_client_hostname_set(struct gfm_connection *, char *); /* replica management from client */ gfarm_error_t gfm_client_replica_list_by_name_request(struct gfm_connection *); gfarm_error_t gfm_client_replica_list_by_name_result(struct gfm_connection *, gfarm_int32_t *, char ***); gfarm_error_t gfm_client_replica_list_by_host_request(struct gfm_connection *, const char *, gfarm_int32_t); gfarm_error_t gfm_client_replica_list_by_host_result(struct gfm_connection *, gfarm_int32_t *, gfarm_ino_t **); gfarm_error_t gfm_client_replica_remove_by_host_request( struct gfm_connection *, const char *, gfarm_int32_t); gfarm_error_t gfm_client_replica_remove_by_host_result( struct gfm_connection *); gfarm_error_t gfm_client_replica_remove_by_file_request( struct gfm_connection *, const char *); gfarm_error_t gfm_client_replica_remove_by_file_result( struct gfm_connection *); gfarm_error_t gfm_client_replica_info_get_request(struct gfm_connection *, gfarm_int32_t); gfarm_error_t gfm_client_replica_info_get_result(struct gfm_connection *, gfarm_int32_t *, char ***, gfarm_uint64_t **, gfarm_int32_t **); gfarm_error_t gfm_client_replicate_file_from_to_request( struct gfm_connection *, const char *, const char *, gfarm_int32_t); gfarm_error_t gfm_client_replicate_file_from_to_result( struct gfm_connection *); gfarm_error_t gfm_client_replicate_file_from_request( struct gfm_connection *, const char *, const char *, gfarm_int32_t); gfarm_error_t gfm_client_replicate_file_from_result( struct gfm_connection *); /* replica management from gfsd */ gfarm_error_t gfm_client_replica_adding_request(struct gfm_connection *, char *); gfarm_error_t gfm_client_replica_adding_result(struct gfm_connection *, gfarm_ino_t *, gfarm_uint64_t *, gfarm_int64_t *, gfarm_int32_t *); gfarm_error_t gfm_client_replica_added_request(struct gfm_connection *, gfarm_int32_t, gfarm_int64_t, gfarm_int32_t); gfarm_error_t gfm_client_replica_added2_request(struct gfm_connection *, gfarm_int32_t, gfarm_int64_t, gfarm_int32_t, gfarm_off_t); gfarm_error_t gfm_client_replica_added_result(struct gfm_connection *); gfarm_error_t gfm_client_replica_lost_request(struct gfm_connection *, gfarm_ino_t, gfarm_uint64_t); gfarm_error_t gfm_client_replica_lost_result(struct gfm_connection *); gfarm_error_t gfm_client_replica_add_request(struct gfm_connection *, gfarm_ino_t, gfarm_uint64_t, gfarm_off_t); gfarm_error_t gfm_client_replica_add_result(struct gfm_connection *); /* process management */ gfarm_error_t gfm_client_process_alloc(struct gfm_connection *, gfarm_int32_t, const char *, size_t, gfarm_pid_t *); gfarm_error_t gfm_client_process_alloc_child(struct gfm_connection *, gfarm_int32_t, const char *, size_t, gfarm_pid_t, gfarm_int32_t, const char *, size_t, gfarm_pid_t *); gfarm_error_t gfm_client_process_free(struct gfm_connection *); gfarm_error_t gfm_client_process_set(struct gfm_connection *, gfarm_int32_t, const char *, size_t, gfarm_pid_t); /* compound request - convenience function */ gfarm_error_t gfm_client_compound_fd_op(struct gfm_connection *, gfarm_int32_t, gfarm_error_t (*)(struct gfm_connection *, void *), gfarm_error_t (*)(struct gfm_connection *, void *), void (*)(struct gfm_connection *, void *), void *); /* exported for a use from a private extension */ gfarm_error_t gfm_client_rpc_request(struct gfm_connection *, int, const char *, ...); gfarm_error_t gfm_client_rpc_result(struct gfm_connection *, int, const char *, ...); gfarm_error_t gfm_client_rpc(struct gfm_connection *, int, int, const char *, ...); gfarm_error_t gfm_client_get_schedule_result(struct gfm_connection *, int *, struct gfarm_host_sched_info **); void gfm_client_purge_from_cache(struct gfm_connection *); gfarm_error_t gfm_client_get_nhosts(struct gfm_connection *, int, struct gfarm_host_info *); gfarm-2.4.1/lib/libgfarm/gfarm/gfm_schedule.c0000644000000000000000000000620511507222723017532 0ustar rootroot#include #include #include "gfm_client.h" #include "gfm_schedule.h" #include "lookup.h" struct gfm_schedule_file_closure { /* input parameter */ const char *domain; /* output parameters */ int nhosts; struct gfarm_host_sched_info *infos; }; static gfarm_error_t gfm_schedule_file_request(struct gfm_connection *gfm_server, void *closure) { struct gfm_schedule_file_closure *c = closure; gfarm_error_t e = gfm_client_schedule_file_request(gfm_server, c->domain); if (e != GFARM_ERR_NO_ERROR) gflog_warning(GFARM_MSG_1000106, "schedule_file request: %s", gfarm_error_string(e)); return (e); } static gfarm_error_t gfm_schedule_file_result(struct gfm_connection *gfm_server, void *closure) { struct gfm_schedule_file_closure *c = closure; gfarm_error_t e = gfm_client_schedule_file_result(gfm_server, &c->nhosts, &c->infos); #if 1 /* DEBUG */ if (e != GFARM_ERR_NO_ERROR) gflog_debug(GFARM_MSG_1000107, "schedule_file result: %s", gfarm_error_string(e)); #endif return (e); } static void gfm_schedule_file_cleanup(struct gfm_connection *gfm_server, void *closure) { struct gfm_schedule_file_closure *c = closure; gfarm_host_sched_info_free(c->nhosts, c->infos); } gfarm_error_t gfm_schedule_file(struct gfm_connection *gfm_server, gfarm_int32_t fd, int *nhostsp, struct gfarm_host_sched_info **infosp) { gfarm_error_t e; struct gfm_schedule_file_closure closure; closure.domain = ""; e = gfm_client_compound_fd_op(gfm_server, fd, gfm_schedule_file_request, gfm_schedule_file_result, gfm_schedule_file_cleanup, &closure); if (e == GFARM_ERR_NO_ERROR) { *nhostsp = closure.nhosts; *infosp = closure.infos; } else { gflog_debug(GFARM_MSG_1001349, "gfm_client_compound_fd_op() failed: %s", gfarm_error_string(e)); } return (e); } gfarm_error_t gfarm_schedule_hosts_domain_by_file(const char *path, int openflags, const char *domain, int *nhostsp, struct gfarm_host_sched_info **infosp) { gfarm_error_t e; struct gfm_connection *gfm_server; struct gfm_schedule_file_closure closure; if ((e = gfm_client_connection_and_process_acquire_by_path( path, &gfm_server)) != GFARM_ERR_NO_ERROR) return (e); closure.domain = domain; e = gfm_inode_op(path, openflags, gfm_schedule_file_request, gfm_schedule_file_result, gfm_inode_success_op_connection_free, gfm_schedule_file_cleanup, &closure); if (e == GFARM_ERR_NO_ERROR) { *nhostsp = closure.nhosts; *infosp = closure.infos; } else { gflog_debug(GFARM_MSG_1002416, "gfarm_schedule_hosts_domain_by_file(%s, 0x%x, %s): %s", path, openflags, domain, gfarm_error_string(e)); } gfm_client_connection_free(gfm_server); return (e); } gfarm_error_t gfarm_schedule_hosts_domain_all(const char *path, const char *domain, int *nhostsp, struct gfarm_host_sched_info **infosp) { gfarm_error_t e; struct gfm_connection *gfm_server; if ((e = gfm_client_connection_and_process_acquire_by_path( path, &gfm_server)) != GFARM_ERR_NO_ERROR) return (e); e = gfm_client_schedule_host_domain(gfm_server, domain, nhostsp, infosp); gfm_client_connection_free(gfm_server); return (e); } gfarm-2.4.1/lib/libgfarm/gfarm/gfs_pio.h0000644000000000000000000000645311507222723016545 0ustar rootroot/* * $Id: gfs_pio.h 4685 2010-05-20 17:10:19Z n-soda $ * * This defines internal structure of gfs_pio module. * * Only gfs_pio_{global,section}.c, gfs_pio_{local,remote}.c and gfs_pio.c * are allowed to include this header file. * Every other modules shouldn't include this. */ struct stat; #define GFS_FILE_IS_PROGRAM(gf) (GFARM_S_IS_PROGRAM(gf->pi.status.st_mode)) struct gfs_pio_ops { gfarm_error_t (*view_close)(GFS_File); int (*view_fd)(GFS_File); gfarm_error_t (*view_pread)(GFS_File, char *, size_t, gfarm_off_t, size_t *); gfarm_error_t (*view_pwrite)(GFS_File, const char *, size_t, gfarm_off_t, size_t *); gfarm_error_t (*view_ftruncate)(GFS_File, gfarm_off_t); gfarm_error_t (*view_fsync)(GFS_File, int); gfarm_error_t (*view_fstat)(GFS_File, struct gfs_stat *); }; struct gfm_connection; struct gfs_file { struct gfs_pio_ops *ops; void *view_context; struct gfm_connection *gfm_server; int fd; int mode; #define GFS_FILE_MODE_READ 0x00000001 #define GFS_FILE_MODE_WRITE 0x00000002 #define GFS_FILE_MODE_NSEGMENTS_FIXED 0x01000000 #define GFS_FILE_MODE_CALC_DIGEST 0x02000000 /* keep updating md_ctx */ #define GFS_FILE_MODE_BUFFER_DIRTY 0x40000000 /* remember parameter of open/set_view */ int open_flags; #if 0 /* not yet in gfarm v2 */ int view_flags; #endif /* not yet in gfarm v2 */ gfarm_error_t error; /* GFARM_ERRMSG_GFS_PIO_IS_EOF, if end of file */ gfarm_off_t io_offset; /* * GFS_FILE_BUFSIZE should be equal to or less than * GFS_PROTO_MAX_IOSIZE defined in gfs_proto.h. */ #define GFS_FILE_BUFSIZE (1048576 - 8) char *buffer; int p; int length; gfarm_off_t offset; }; gfarm_error_t gfs_pio_set_view_default(GFS_File); #if 0 /* not yet in gfarm v2 */ gfarm_error_t gfs_pio_set_view_global(GFS_File, int); #endif /* not yet in gfarm v2 */ struct gfs_connection; gfarm_error_t gfs_pio_open_local_section(GFS_File, struct gfs_connection *); gfarm_error_t gfs_pio_open_remote_section(GFS_File, struct gfs_connection *); gfarm_error_t gfs_pio_internal_set_view_section(GFS_File, char *); struct gfs_connection; struct gfs_storage_ops { gfarm_error_t (*storage_close)(GFS_File); int (*storage_fd)(GFS_File); gfarm_error_t (*storage_pread)(GFS_File, char *, size_t, gfarm_off_t, size_t *); gfarm_error_t (*storage_pwrite)(GFS_File, const char *, size_t, gfarm_off_t, size_t *); gfarm_error_t (*storage_ftruncate)(GFS_File, gfarm_off_t); gfarm_error_t (*storage_fsync)(GFS_File, int); gfarm_error_t (*storage_fstat)(GFS_File, struct gfs_stat *); }; #define GFS_DEFAULT_DIGEST_NAME "md5" #define GFS_DEFAULT_DIGEST_MODE EVP_md5() struct gfs_file_section_context { struct gfs_storage_ops *ops; void *storage_context; #if 0 /* not yet in gfarm v2 */ char *section; char *canonical_hostname; #endif /* not yet in gfarm v2 */ int fd; /* this isn't used for remote case, but only local case */ pid_t pid; /* for checksum, maintained only if GFS_FILE_MODE_CALC_DIGEST */ EVP_MD_CTX md_ctx; }; /* * offset * v * buffer |*******************************---------| * ^ ^ ^ * 0 p length * * the following conditions are valid usually, but not always: * * on write: * io_offset == offset * on sequential write: * io_offset == offset && p == length * on read: * io_offset == offset + length */ gfarm-2.4.1/lib/libgfarm/gfarm/conn_cache.c0000644000000000000000000002030711507222723017164 0ustar rootroot#include #include #include #include #include "gfutil.h" #include "hash.h" #include "lru_cache.h" #include "conn_hash.h" #include "conn_cache.h" struct gfp_cached_connection { /* * must be the first member of struct gfp_cached_connection. * Because gfp_cached_connection_gc_entry() does DOWNCAST * from "lru_entry" to "struct gfp_cached_connection". */ struct gfarm_lru_entry lru_entry; struct gfarm_hash_entry *hash_entry; void *connection_data; }; /* * return TRUE, if created by gfs_client_connection_acquire() && still cached. * return FALSE, if created by gfs_client_connect() || purged from cache. */ #define GFP_IS_CACHED_CONNECTION(connection) ((connection)->hash_entry != NULL) int gfp_is_cached_connection(struct gfp_cached_connection *connection) { return (GFP_IS_CACHED_CONNECTION(connection)); } void * gfp_cached_connection_get_data(struct gfp_cached_connection *connection) { return (connection->connection_data); } void gfp_cached_connection_set_data(struct gfp_cached_connection *connection, void *p) { connection->connection_data = p; } const char * gfp_cached_connection_hostname(struct gfp_cached_connection *connection) { assert(GFP_IS_CACHED_CONNECTION(connection)); return (gfp_conn_hash_hostname(connection->hash_entry)); } const char * gfp_cached_connection_username(struct gfp_cached_connection *connection) { assert(GFP_IS_CACHED_CONNECTION(connection)); return (gfp_conn_hash_username(connection->hash_entry)); } int gfp_cached_connection_port(struct gfp_cached_connection *connection) { assert(GFP_IS_CACHED_CONNECTION(connection)); return (gfp_conn_hash_port(connection->hash_entry)); } gfarm_error_t gfp_uncached_connection_new(struct gfp_cached_connection **connectionp) { struct gfp_cached_connection *connection; GFARM_MALLOC(connection); if (connection == NULL) { gflog_debug(GFARM_MSG_1001087, "allocation of 'connection' failed: %s", gfarm_error_string(GFARM_ERR_NO_MEMORY)); return (GFARM_ERR_NO_MEMORY); } connection->hash_entry = NULL; /* this is an uncached connection */ gfarm_lru_init_uncached_entry(&connection->lru_entry); connection->connection_data = NULL; *connectionp = connection; return (GFARM_ERR_NO_ERROR); } /* this must be called from (*cache->dispose_connection)() */ void gfp_uncached_connection_dispose(struct gfp_cached_connection *connection) { free(connection); } /* convert from cached connection to uncached */ void gfp_cached_connection_purge_from_cache(struct gfp_conn_cache *cache, struct gfp_cached_connection *connection) { if (!GFP_IS_CACHED_CONNECTION(connection)) return; gfarm_lru_cache_purge_entry(&connection->lru_entry); gfp_conn_hash_purge(cache->hashtab, connection->hash_entry); connection->hash_entry = NULL; /* this is an uncached connection now */ } /* convert from uncached connection to cached */ gfarm_error_t gfp_uncached_connection_enter_cache(struct gfp_conn_cache *cache, struct gfp_cached_connection *connection, const char *hostname, int port) { gfarm_error_t e; struct gfarm_hash_entry *entry; int created; if (GFP_IS_CACHED_CONNECTION(connection)) { gflog_error(GFARM_MSG_1000057, "gfp_uncached_connection_enter_cache(%s): " "programming error", cache->type_name); abort(); } e = gfp_conn_hash_enter(&cache->hashtab, cache->table_size, sizeof(connection), hostname, port, gfarm_get_global_username(), &entry, &created); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001088, "insertion to connection hash (%s)(%d) failed: %s", hostname, port, gfarm_error_string(e)); return (e); } if (!created) { gflog_debug(GFARM_MSG_1001089, "insertion to connection hash (%s)(%d) failed: %s", hostname, port, gfarm_error_string(GFARM_ERR_ALREADY_EXISTS)); return (GFARM_ERR_ALREADY_EXISTS); } gfarm_lru_cache_link_entry(&cache->lru_list, &connection->lru_entry); *(struct gfp_cached_connection **)gfarm_hash_entry_data(entry) = connection; connection->hash_entry = entry; return (GFARM_ERR_NO_ERROR); } /* update the LRU list to mark this gfp_cached_connection recently used */ void gfp_cached_connection_used(struct gfp_conn_cache *cache, struct gfp_cached_connection *connection) { if (!GFP_IS_CACHED_CONNECTION(connection)) return; gfarm_lru_cache_access_entry(&cache->lru_list, &connection->lru_entry); } static void gfp_cached_connection_gc_entry(struct gfarm_lru_entry *entry, void *closure) { struct gfp_conn_cache *cache = closure; struct gfp_cached_connection *connection = (struct gfp_cached_connection *)entry; /* DOWNCAST */ gfp_conn_hash_purge(cache->hashtab, connection->hash_entry); /* * `cache' itself will be disposed by gfp_uncached_connection_dispose() * which must be called from (*cache->dispose_connection)() */ (*cache->dispose_connection)(connection->connection_data); } static void gfp_cached_connection_gc_internal(struct gfp_conn_cache *cache, int free_target) { gfarm_lru_cache_gc(&cache->lru_list, free_target, gfp_cached_connection_gc_entry, cache, cache->type_name); } void gfp_cached_connection_gc_all(struct gfp_conn_cache *cache) { gfp_cached_connection_gc_internal(cache, 0); } gfarm_error_t gfp_cached_connection_acquire(struct gfp_conn_cache *cache, const char *canonical_hostname, int port, struct gfp_cached_connection **connectionp, int *createdp) { gfarm_error_t e; struct gfarm_hash_entry *entry; struct gfp_cached_connection *connection; e = gfp_conn_hash_enter(&cache->hashtab, cache->table_size, sizeof(connection), canonical_hostname, port, gfarm_get_global_username(), &entry, createdp); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001090, "insertion to connection hash (%s)(%d) failed: %s", canonical_hostname, port, gfarm_error_string(e)); return (e); } if (!*createdp) { connection = *(struct gfp_cached_connection **) gfarm_hash_entry_data(entry); gfarm_lru_cache_addref_entry(&cache->lru_list, &connection->lru_entry); } else { GFARM_MALLOC(connection); if (connection == NULL) { gfp_conn_hash_purge(cache->hashtab, entry); gflog_debug(GFARM_MSG_1001091, "allocation of 'connection' failed: %s", gfarm_error_string(GFARM_ERR_NO_MEMORY)); return (GFARM_ERR_NO_MEMORY); } gfarm_lru_cache_add_entry(&cache->lru_list, &connection->lru_entry); *(struct gfp_cached_connection **)gfarm_hash_entry_data(entry) = connection; connection->hash_entry = entry; connection->connection_data = NULL; } *connectionp = connection; return (GFARM_ERR_NO_ERROR); } void gfp_cached_or_uncached_connection_free(struct gfp_conn_cache *cache, struct gfp_cached_connection *connection) { if (!gfarm_lru_cache_delref_entry(&cache->lru_list, &connection->lru_entry)) return; /* shouln't be disposed */ if (!GFP_IS_CACHED_CONNECTION(connection)) /* already purged */ (*cache->dispose_connection)(connection->connection_data); else gfp_cached_connection_gc_internal(cache, *cache->num_cachep); } /* * this function frees all cached connections, including in-use ones. * * potential problems: * - connections which are currently in-use are freed too. * - connections which are uncached are NOT freed. * i.e. the followings are all NOT freed: * - connections which have never cached, * - connections which had been once cached but currently uncached * (since their network connections were dead) */ void gfp_cached_connection_terminate(struct gfp_conn_cache *cache) { struct gfarm_hash_iterator it; struct gfarm_hash_entry *entry; struct gfp_cached_connection *connection; if (cache->hashtab == NULL) return; /* * clear all free connections. * to makes cache->lru_list.free_cached_entries 0. */ gfp_cached_connection_gc_all(cache); /* clear all in-use connections too. XXX really necessary? */ for (gfarm_hash_iterator_begin(cache->hashtab, &it); !gfarm_hash_iterator_is_end(&it); ) { entry = gfarm_hash_iterator_access(&it); connection = *(struct gfp_cached_connection **) gfarm_hash_entry_data(entry); gfarm_lru_cache_purge_entry(&connection->lru_entry); gfp_conn_hash_iterator_purge(&it); (*cache->dispose_connection)(connection->connection_data); } /* free hash table */ gfarm_hash_table_free(cache->hashtab); cache->hashtab = NULL; } gfarm-2.4.1/lib/libgfarm/gfarm/gfs_attrplus.c0000644000000000000000000000400411507222724017616 0ustar rootroot#include #include #include #define GFARM_INTERNAL_USE #include #include "gfutil.h" #include "gfm_client.h" #include "config.h" #include "lookup.h" #include "gfs_attrplus.h" struct gfm_getattrplus_closure { char **patterns; int npatterns, flags; struct gfs_stat *st; int *nattrsp; char ***attrnamesp; void ***attrvaluesp; size_t **attrsizesp; }; static gfarm_error_t gfm_getattrplus_request(struct gfm_connection *gfm_server, void *closure) { struct gfm_getattrplus_closure *c = closure; gfarm_error_t e = gfm_client_fgetattrplus_request(gfm_server, c->patterns, c->npatterns, c->flags); if (e != GFARM_ERR_NO_ERROR) gflog_warning(GFARM_MSG_1002469, "fgetattrplus request: %s", gfarm_error_string(e)); return (e); } static gfarm_error_t gfm_getattrplus_result(struct gfm_connection *gfm_server, void *closure) { struct gfm_getattrplus_closure *c = closure; gfarm_error_t e = gfm_client_fgetattrplus_result(gfm_server, c->st, c->nattrsp, c->attrnamesp, c->attrvaluesp, c->attrsizesp); #if 0 /* DEBUG */ if (e != GFARM_ERR_NO_ERROR) gflog_debug(GFARM_MSG_1002470, "fgetattrplus result; %s", gfarm_error_string(e)); #endif return (e); } gfarm_error_t gfs_getattrplus( const char *path, char **patterns, int npatterns, int flags, struct gfs_stat *st, int *nattrsp, char ***attrnamesp, void ***attrvaluesp, size_t **attrsizesp) { struct gfm_getattrplus_closure closure; gfarm_error_t e; closure.patterns = patterns; closure.npatterns = npatterns; closure.flags = flags; closure.st = st; closure.nattrsp = nattrsp; closure.attrnamesp = attrnamesp; closure.attrvaluesp = attrvaluesp; closure.attrsizesp = attrsizesp; e = gfm_inode_op(path, GFARM_FILE_LOOKUP, gfm_getattrplus_request, gfm_getattrplus_result, gfm_inode_success_op_connection_free, NULL, &closure); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1002471, "gfm_inode_op(%s) failed: %s", path, gfarm_error_string(e)); } return (e); } gfarm-2.4.1/lib/libgfarm/gfarm/patmatch.h0000644000000000000000000000040011507222723016702 0ustar rootroot#define GFARM_PATTERN_NOESCAPE 0x01 #define GFARM_PATTERN_PATHNAME 0x02 int gfarm_pattern_charset_parse(const char *, int, int *); int gfarm_pattern_submatch(const char *, int, const char *, int); int gfarm_pattern_match(const char *, const char *, int); gfarm-2.4.1/lib/libgfarm/gfarm/gfp_xdr_server.c0000644000000000000000000002416511507222723020131 0ustar rootroot#include #include #include #include #include #include #include "id_table.h" #include "thrsubr.h" #include "liberror.h" #include "gfp_xdr.h" /* * asynchronous RPC related functions */ #define XID_TYPE_BIT 0xc0000000 #define XID_TYPE_REQUEST 0x00000000 #define XID_TYPE_RESULT 0x80000000 static const char async_peer_diag[] = "gfp_xdr_async_peer"; struct gfp_xdr_async_peer { struct gfarm_id_table *idtab; pthread_mutex_t mutex; }; struct gfp_xdr_async_callback { gfarm_int32_t (*result_callback)(void *, void *, size_t); void (*disconnect_callback)(void *, void *); void *closure; }; static struct gfarm_id_table_entry_ops gfp_xdr_async_xid_table_ops = { sizeof(struct gfp_xdr_async_callback) }; /* * asynchronous protocol client side functions * * currently, all clients of asynchronous protocl are servers too. */ gfarm_error_t gfp_xdr_async_peer_new(gfp_xdr_async_peer_t *async_serverp) { struct gfp_xdr_async_peer *async_server; static const char diag[] = "gfp_xdr_async_peer_new"; GFARM_MALLOC(async_server); if (async_server == NULL) return (GFARM_ERR_NO_MEMORY); gfarm_mutex_init(&async_server->mutex, diag, async_peer_diag); async_server->idtab = gfarm_id_table_alloc(&gfp_xdr_async_xid_table_ops); if (async_server->idtab == NULL) { gfarm_mutex_destroy(&async_server->mutex, diag, async_peer_diag); free(async_server); return (GFARM_ERR_NO_MEMORY); } *async_serverp = async_server; return (GFARM_ERR_NO_ERROR); } static void gfp_xdr_async_xid_free(void *peer, gfp_xdr_xid_t xid, void *xdata) { struct gfp_xdr_async_callback *cb = xdata; (*cb->disconnect_callback)(peer, cb->closure); } void gfp_xdr_async_peer_free(gfp_xdr_async_peer_t async_server, void *peer) { static const char diag[] = "gfp_xdr_async_peer_free"; gfarm_id_table_free(async_server->idtab, gfp_xdr_async_xid_free, peer); gfarm_mutex_destroy(&async_server->mutex, diag, async_peer_diag); free(async_server); } gfarm_error_t gfp_xdr_callback_async_result(gfp_xdr_async_peer_t async_server, void *peer, gfp_xdr_xid_t xid, size_t size, gfarm_int32_t *resultp) { struct gfp_xdr_async_callback *cb; gfarm_int32_t (*result_callback)(void *, void *, size_t); void *closure; static const char diag[] = "gfp_xdr_callback_async_result"; gfarm_mutex_lock(&async_server->mutex, diag, async_peer_diag); cb = gfarm_id_lookup(async_server->idtab, xid); if (cb == NULL) { gfarm_mutex_unlock(&async_server->mutex, diag, async_peer_diag); return (GFARM_ERR_NO_SUCH_OBJECT); } result_callback = cb->result_callback; closure = cb->closure; gfarm_id_free(async_server->idtab, xid); gfarm_mutex_unlock(&async_server->mutex, diag, async_peer_diag); *resultp = (*result_callback)(peer, closure, size); return (GFARM_ERR_NO_ERROR); } static void gfp_xdr_send_async_request_error(gfp_xdr_async_peer_t async_server, gfarm_int32_t xid, const char *diag) { gfarm_mutex_lock(&async_server->mutex, diag, async_peer_diag); gfarm_id_free(async_server->idtab, xid); gfarm_mutex_unlock(&async_server->mutex, diag, async_peer_diag); } static gfarm_error_t gfp_xdr_send_async_request_header(struct gfp_xdr *server, gfp_xdr_async_peer_t async_server, size_t size, gfarm_int32_t (*result_callback)(void *, void *, size_t), void (*disconnect_callback)(void *, void *), void *closure, gfarm_int32_t *xidp) { gfarm_error_t e; gfarm_int32_t xid, xid_and_type; struct gfp_xdr_async_callback *cb; static const char diag[] = "gfp_xdr_send_async_request_header"; gfarm_mutex_lock(&async_server->mutex, diag, async_peer_diag); cb = gfarm_id_alloc(async_server->idtab, &xid); if (cb == NULL) { gfarm_mutex_unlock(&async_server->mutex, diag, async_peer_diag); return (GFARM_ERR_NO_MEMORY); } cb->result_callback = result_callback; cb->disconnect_callback = disconnect_callback; cb->closure = closure; gfarm_mutex_unlock(&async_server->mutex, diag, async_peer_diag); xid_and_type = (xid | XID_TYPE_REQUEST); #define ASYNC_REQUEST_HEADER_SIZE (4+4) /* size of "ii" */ e = gfp_xdr_send(server, "ii", xid_and_type, (gfarm_int32_t)size); if (e != GFARM_ERR_NO_ERROR) { gfp_xdr_send_async_request_error(async_server, xid, diag); return (e); } *xidp = xid; return (GFARM_ERR_NO_ERROR); } /* this does gfp_xdr_flush() too, for freeing xid in an error case */ static gfarm_error_t gfp_xdr_vsend_async_request_internal(struct gfp_xdr *server, gfp_xdr_async_peer_t async_server, gfarm_int32_t (*result_callback)(void *, void *, size_t), void (*disconnect_callback)(void *, void *), void *closure, int nonblock, gfarm_int32_t command, const char *format, va_list *app) { gfarm_error_t e; size_t size = 0; va_list ap; const char *fmt; gfarm_int32_t xid; e = gfp_xdr_send_size_add(&size, "i", command); if (e != GFARM_ERR_NO_ERROR) return (e); va_copy(ap, *app); fmt = format; e = gfp_xdr_vsend_size_add(&size, &fmt, &ap); va_end(ap); if (e != GFARM_ERR_NO_ERROR) return (e); if (nonblock && (e = gfp_xdr_sendbuffer_check_size(server, size + ASYNC_REQUEST_HEADER_SIZE)) != GFARM_ERR_NO_ERROR) return (e); e = gfp_xdr_send_async_request_header(server, async_server, size, result_callback, disconnect_callback, closure, &xid); if (e != GFARM_ERR_NO_ERROR) return (e); e = gfp_xdr_vrpc_request(server, command, &format, app); if (e != GFARM_ERR_NO_ERROR) { gfp_xdr_send_async_request_error(async_server, xid, "gfp_xdr_vrpc_request"); return (e); } if (*format != '\0') gflog_fatal(GFARM_MSG_1001016, "gfp_xdr_vsend_async_request: " "invalid format character: %c(%x)", *format, *format); e = gfp_xdr_flush(server); if (e != GFARM_ERR_NO_ERROR) { gfp_xdr_send_async_request_error(async_server, xid, "gfp_xdr_flush"); return (e); } return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfp_xdr_vsend_async_nonblocking_request(struct gfp_xdr *server, gfp_xdr_async_peer_t async_server, gfarm_int32_t (*result_callback)(void *, void *, size_t), void (*disconnect_callback)(void *, void *), void *closure, gfarm_int32_t command, const char *format, va_list *app) { return (gfp_xdr_vsend_async_request_internal(server, async_server, result_callback, disconnect_callback, closure, 1, command, format, app)); } gfarm_error_t gfp_xdr_vsend_async_request(struct gfp_xdr *server, gfp_xdr_async_peer_t async_server, gfarm_int32_t (*result_callback)(void *, void *, size_t), void (*disconnect_callback)(void *, void *), void *closure, gfarm_int32_t command, const char *format, va_list *app) { return (gfp_xdr_vsend_async_request_internal(server, async_server, result_callback, disconnect_callback, closure, 0, command, format, app)); } /* * used by both client and server side */ gfarm_error_t gfp_xdr_recv_async_header(struct gfp_xdr *conn, int just, enum gfp_xdr_msg_type *typep, gfp_xdr_xid_t *xidp, size_t *sizep) { gfarm_error_t e; gfarm_uint32_t xid; gfarm_uint32_t size; int eof; e = gfp_xdr_recv(conn, just, &eof, "ii", &xid, &size); if (e != GFARM_ERR_NO_ERROR) return (e); if (eof) return (GFARM_ERR_UNEXPECTED_EOF); *typep = (xid & XID_TYPE_BIT) == XID_TYPE_REQUEST ? GFP_XDR_TYPE_REQUEST : GFP_XDR_TYPE_RESULT; *xidp = (xid & ~XID_TYPE_BIT); *sizep = size; return (GFARM_ERR_NO_ERROR); } /* * server side functions */ static gfarm_error_t gfp_xdr_send_async_result_header(struct gfp_xdr *server, gfarm_int32_t xid, size_t size) { xid = (xid | XID_TYPE_RESULT); return (gfp_xdr_send(server, "ii", xid, (gfarm_int32_t)size)); } /* * used by both synchronous and asynchronous protocol. * if sizep == NULL, it's a synchronous protocol, otherwise asynchronous. * Note that this function assumes that async_header is already received. */ gfarm_error_t gfp_xdr_recv_request_command(struct gfp_xdr *client, int just, size_t *sizep, gfarm_int32_t *commandp) { gfarm_error_t e; int eof; e = gfp_xdr_recv_sized(client, just, sizep, &eof, "i", commandp); if (e != GFARM_ERR_NO_ERROR) return (e); if (eof) return (GFARM_ERR_UNEXPECTED_EOF); return (GFARM_ERR_NO_ERROR); } /* * used by both synchronous and asynchronous protocol. * if sizep == NULL, it's a synchronous protocol, otherwise asynchronous. */ gfarm_error_t gfp_xdr_vrecv_request_parameters(struct gfp_xdr *client, int just, size_t *sizep, const char *format, va_list *app) { gfarm_error_t e; int eof; e = gfp_xdr_vrecv_sized(client, just, sizep, &eof, &format, app); if (e != GFARM_ERR_NO_ERROR) return (e); if (eof) return (GFARM_ERR_UNEXPECTED_EOF); if (*format != '\0') { gflog_debug(GFARM_MSG_1001017, "gfp_xdr_vrecv_request_parameters: " "invalid format character: %c(%x)", *format, *format); return (GFARM_ERRMSG_GFP_XDR_VRPC_INVALID_FORMAT_CHARACTER); } if (sizep != NULL && *sizep != 0) { gflog_debug(GFARM_MSG_1001018, "gfp_xdr_vrecv_request_parameters: residual %d bytes", (int)*sizep); return (GFARM_ERR_PROTOCOL); } return (GFARM_ERR_NO_ERROR); } /* the caller should call gfp_xdr_flush() after this function */ gfarm_error_t gfp_xdr_vsend_result(struct gfp_xdr *client, gfarm_int32_t ecode, const char *format, va_list *app) { gfarm_error_t e; e = gfp_xdr_send(client, "i", ecode); if (e != GFARM_ERR_NO_ERROR) return (e); if (ecode == GFARM_ERR_NO_ERROR) { e = gfp_xdr_vsend(client, &format, app); if (e != GFARM_ERR_NO_ERROR) return (e); if (*format != '\0') { gflog_debug(GFARM_MSG_1001019, "gfp_xdr_vsend_result: " "invalid format character: %c(%x)", *format, *format); e = GFARM_ERRMSG_GFP_XDR_VRPC_INVALID_FORMAT_CHARACTER; } } return (e); } /* used by asynchronous protocol */ gfarm_error_t gfp_xdr_vsend_async_result(struct gfp_xdr *client, gfp_xdr_xid_t xid, gfarm_int32_t ecode, const char *format, va_list *app) { gfarm_error_t e; size_t size = 0; e = gfp_xdr_send_size_add(&size, "i", ecode); if (e != GFARM_ERR_NO_ERROR) return (e); if (ecode == GFARM_ERR_NO_ERROR) { va_list ap; const char *fmt; va_copy(ap, *app); fmt = format; e = gfp_xdr_vsend_size_add(&size, &fmt, &ap); va_end(ap); if (e != GFARM_ERR_NO_ERROR) return (e); } e = gfp_xdr_send_async_result_header(client, xid, size); if (e != GFARM_ERR_NO_ERROR) return (e); return (gfp_xdr_vsend_result(client, ecode, format, app)); } gfarm-2.4.1/lib/libgfarm/gfarm/gfs_stat.c0000644000000000000000000000470411507222723016721 0ustar rootroot#include #include #include #define GFARM_INTERNAL_USE #include #include "gfutil.h" #include "timer.h" #include "gfs_profile.h" #include "gfm_client.h" #include "config.h" #include "lookup.h" #include "gfs_misc.h" static double gfs_stat_time; struct gfm_stat_closure { struct gfs_stat *st; }; static gfarm_error_t gfm_stat_request(struct gfm_connection *gfm_server, void *closure) { gfarm_error_t e = gfm_client_fstat_request(gfm_server); if (e != GFARM_ERR_NO_ERROR) gflog_warning(GFARM_MSG_1000130, "fstat request: %s", gfarm_error_string(e)); return (e); } static gfarm_error_t gfm_stat_result(struct gfm_connection *gfm_server, void *closure) { struct gfm_stat_closure *c = closure; gfarm_error_t e = gfm_client_fstat_result(gfm_server, c->st); #if 0 /* DEBUG */ if (e != GFARM_ERR_NO_ERROR) gflog_debug(GFARM_MSG_1000131, "fstat result; %s", gfarm_error_string(e)); #endif return (e); } gfarm_error_t gfs_stat(const char *path, struct gfs_stat *s) { gfarm_timerval_t t1, t2; struct gfm_stat_closure closure; gfarm_error_t e; GFARM_TIMEVAL_FIX_INITIALIZE_WARNING(t1); gfs_profile(gfarm_gettimerval(&t1)); closure.st = s; e = gfm_inode_op(path, GFARM_FILE_LOOKUP, gfm_stat_request, gfm_stat_result, gfm_inode_success_op_connection_free, NULL, &closure); gfs_profile(gfarm_gettimerval(&t2)); gfs_profile(gfs_stat_time += gfarm_timerval_sub(&t2, &t1)); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001377, "gfm_inode_op(%s) failed: %s", path, gfarm_error_string(e)); } return (e); } gfarm_error_t gfs_lstat(const char *path, struct gfs_stat *s) { return (gfs_stat(path, s)); /* XXX FIXME */ } gfarm_error_t gfs_fstat(GFS_File gf, struct gfs_stat *s) { gfarm_timerval_t t1, t2; struct gfm_stat_closure closure; gfarm_error_t e; GFARM_TIMEVAL_FIX_INITIALIZE_WARNING(t1); gfs_profile(gfarm_gettimerval(&t1)); closure.st = s; e = gfm_client_compound_fd_op(gfs_pio_metadb(gf), gfs_pio_fileno(gf), gfm_stat_request, gfm_stat_result, NULL, &closure); gfs_profile(gfarm_gettimerval(&t2)); gfs_profile(gfs_stat_time += gfarm_timerval_sub(&t2, &t1)); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001378, "gfm_client_compound_fd_op() failed: %s", gfarm_error_string(e)); } return (e); } void gfs_stat_display_timers(void) { gflog_info(GFARM_MSG_1000132, "gfs_stat : %g sec", gfs_stat_time); } gfarm-2.4.1/lib/libgfarm/gfarm/gfs_dircache.h0000644000000000000000000000035111507222723017507 0ustar rootrootgfarm_error_t gfs_stat_cached_internal(const char *, struct gfs_stat *); gfarm_error_t gfs_opendir_caching_internal(const char *, GFS_Dir *); gfarm_error_t gfs_getxattr_cached_internal(const char *, const char *, void *, size_t *); gfarm-2.4.1/lib/libgfarm/gfarm/gfs_unlink.c0000644000000000000000000000222211507222723017237 0ustar rootroot/* * $Id: gfs_unlink.c 4457 2010-02-23 01:53:23Z ookuma $ */ #include #include #include #include #include "gfutil.h" #include "timer.h" #include "gfs_profile.h" static double gfs_unlink_time; gfarm_error_t gfs_unlink(const char *path) { gfarm_error_t e; struct gfs_stat st; int is_dir; gfarm_timerval_t t1, t2; GFARM_TIMEVAL_FIX_INITIALIZE_WARNING(t1); gfs_profile(gfarm_gettimerval(&t1)); e = gfs_stat(path, &st); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001396, "gfs_stat(%s) failed: %s", path, gfarm_error_string(e)); return (e); } is_dir = GFARM_S_ISDIR(st.st_mode); gfs_stat_free(&st); if (is_dir) { gflog_debug(GFARM_MSG_1001397, "Not a directory(%s): %s", path, gfarm_error_string(GFARM_ERR_IS_A_DIRECTORY)); return (GFARM_ERR_IS_A_DIRECTORY); } /* XXX FIXME there is race condition here */ gfs_profile(gfarm_gettimerval(&t2)); gfs_profile(gfs_unlink_time += gfarm_timerval_sub(&t2, &t1)); return (gfs_remove(path)); } void gfs_unlink_display_timers(void) { gflog_info(GFARM_MSG_1000157, "gfs_unlink : %g sec", gfs_unlink_time); } gfarm-2.4.1/lib/libgfarm/gfarm/host.h0000644000000000000000000000252711507222723016072 0ustar rootrootstruct gfm_connection; struct gfarm_host_info; struct gfarm_hostspec; gfarm_error_t gfm_host_info_get_by_name_alias( struct gfm_connection *, const char *, struct gfarm_host_info *); gfarm_error_t gfm_host_get_canonical_name(struct gfm_connection *, const char *, char **, int *); gfarm_error_t gfm_host_get_canonical_self_name(struct gfm_connection *, char **, int *); #if 0 /* XXX for now */ gfarm_error_t gfarm_set_client_architecture(char *, struct gfarm_hostspec *); gfarm_error_t gfarm_host_get_self_architecture(struct gfm_connection *, char **); #endif /* for now */ #if 0 /* XXX for now */ int gfm_canonical_hostname_is_local(struct gfm_connection *, const char *); #endif int gfm_host_is_local(struct gfm_connection *, const char *); struct in_addr; gfarm_error_t gfarm_get_ip_addresses(int *, struct in_addr **); struct sockaddr; #if 0 /* XXX for now */ gfarm_error_t gfarm_host_address_use(struct gfarm_hostspec *); #endif /* for now */ gfarm_error_t gfm_host_info_address_get(struct gfm_connection *, const char *, int, struct gfarm_host_info *, struct sockaddr *, char **); gfarm_error_t gfm_host_address_get(struct gfm_connection *, const char *, int, struct sockaddr *, char **); gfarm_error_t gfarm_known_network_list_add(struct gfarm_hostspec *); gfarm_error_t gfarm_addr_network_get(struct sockaddr *, struct gfarm_hostspec **); gfarm-2.4.1/lib/libgfarm/gfarm/host.c0000644000000000000000000005221111507222723016060 0ustar rootroot/* * $Id: host.c 5018 2010-12-30 08:35:34Z tatebe $ */ #include #include #include #include #include #include #include #include #define _SOCKADDR_LEN /* for __osf__ */ #include #include #define BSD_COMP /* for __svr4__ */ #include #include #include #include /* for SUN_LEN */ #include #include #include #include #include "gfnetdb.h" #include "hostspec.h" #include "gfm_client.h" #include "host.h" static gfarm_error_t host_info_get_by_name_alias(struct gfm_connection *gfm_server, const char *hostname, struct gfarm_host_info *info) { gfarm_error_t e, e2; e = gfm_client_host_info_get_by_namealiases(gfm_server, 1, &hostname, &e2, info); if (e != GFARM_ERR_NO_ERROR || e2 != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1000866, "gfm_client_host_info_get_by_namealiases(%s) failed: " "%s", hostname, gfarm_error_string(e != GFARM_ERR_NO_ERROR ? e : e2)); } return (e != GFARM_ERR_NO_ERROR ? e : e2); } gfarm_error_t gfm_host_info_get_by_name_alias(struct gfm_connection *gfm_server, const char *if_hostname, struct gfarm_host_info *info) { gfarm_error_t e; struct hostent *hp; int i; char *n; e = host_info_get_by_name_alias(gfm_server, if_hostname, info); if (e == GFARM_ERR_NO_ERROR) return (GFARM_ERR_NO_ERROR); /* XXX should not use gethostbyname(3), but ...*/ /* * This interface is never called from gfmd, * so MPSAFE-ness is not an issue for now. * Unlike gethostbyname(), getaddrinfo() doesn't return multiple * host aliases, so we cannot use getaddrino() here to see alias names. * * FIXME: This design must be revised, when we support IPv6. */ hp = gethostbyname(if_hostname); if (hp == NULL || hp->h_addrtype != AF_INET) { gflog_debug(GFARM_MSG_1000867, "Unknown host (%s): %s", if_hostname, gfarm_error_string(GFARM_ERR_UNKNOWN_HOST)); return (GFARM_ERR_UNKNOWN_HOST); } for (i = 0, n = hp->h_name; n != NULL; n = hp->h_aliases[i++]){ if (host_info_get_by_name_alias(gfm_server, n, info) == GFARM_ERR_NO_ERROR) return (GFARM_ERR_NO_ERROR); } return (e); } /* * The value returned to `*canonical_hostnamep' should be freed. */ gfarm_error_t gfm_host_get_canonical_name(struct gfm_connection *gfm_server, const char *hostname, char **canonical_hostnamep, int *portp) { gfarm_error_t e; struct gfarm_host_info info; int port; char *n; e = gfm_host_info_get_by_name_alias(gfm_server, hostname, &info); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1000868, "gfm_host_info_get_by_name_alias(%s) failed: %s", hostname, gfarm_error_string(e)); return (e); } n = strdup(info.hostname); port = info.port; gfarm_host_info_free(&info); if (n == NULL) { gflog_debug(GFARM_MSG_1000869, "allocation of hostname failed: %s", gfarm_error_string(GFARM_ERR_NO_MEMORY)); return (GFARM_ERR_NO_MEMORY); } *canonical_hostnamep = n; *portp = port; return (GFARM_ERR_NO_ERROR); } char * gfarm_host_get_self_name(void) { static int initialized; static char hostname[MAXHOSTNAMELEN + 1]; if (!initialized) { hostname[0] = hostname[MAXHOSTNAMELEN] = 0; /* gethostname(2) almost shouldn't fail */ gethostname(hostname, MAXHOSTNAMELEN); if (hostname[0] == '\0') strcpy(hostname, "hostname-not-set"); initialized = 1; } return (hostname); } /* * shouldn't free the return value of this function. * * NOTE: gfarm_error_initialize() and gfarm_metadb_initialize() * should be called before this function. */ gfarm_error_t gfm_host_get_canonical_self_name(struct gfm_connection *gfm_server, char **canonical_hostnamep, int *portp) { gfarm_error_t e; static char *canonical_self_name = NULL; static int port; static gfarm_error_t error_save = GFARM_ERR_NO_ERROR; if (canonical_self_name == NULL) { if (error_save != GFARM_ERR_NO_ERROR) return (error_save); e = gfm_host_get_canonical_name(gfm_server, gfarm_host_get_self_name(), &canonical_self_name, &port); if (e != GFARM_ERR_NO_ERROR) { error_save = e; gflog_debug(GFARM_MSG_1000870, "gfm_host_get_canonical_name() failed: %s", gfarm_error_string(e)); return (e); } } *canonical_hostnamep = canonical_self_name; *portp = port; return (GFARM_ERR_NO_ERROR); } #if 0 /* not yet in gfarm v2 */ static int host_address_is_match(struct gfarm_hostspec *hostspec, const char *name, struct hostent *hp) { struct sockaddr_in peer_addr_in; struct sockaddr *peer_addr = (struct sockaddr *)&peer_addr_in; int i, j; const char *n; if (hp == NULL || hp->h_addrtype != AF_INET) return (gfarm_hostspec_match(hostspec, name, NULL)); memset(&peer_addr_in, 0, sizeof(peer_addr_in)); peer_addr_in.sin_port = 0; peer_addr_in.sin_family = hp->h_addrtype; for (i = 0; hp->h_addr_list[i] != NULL; i++) { memcpy(&peer_addr_in.sin_addr, hp->h_addr_list[i], sizeof(peer_addr_in.sin_addr)); if (gfarm_hostspec_match(hostspec, name, peer_addr)) return (1); if (gfarm_hostspec_match(hostspec, hp->h_name, peer_addr)) return (1); for (j = 0; (n = hp->h_aliases[j]) != NULL; j++) { if (gfarm_hostspec_match(hostspec, n, peer_addr)) return (1); } } return (0); } struct gfarm_client_architecture_config { struct gfarm_client_architecture_config *next; char *architecture; struct gfarm_hostspec *hostspec; }; struct gfarm_client_architecture_config *gfarm_client_architecture_config_list = NULL; struct gfarm_client_architecture_config **gfarm_client_architecture_config_last = &gfarm_client_architecture_config_list; gfarm_error_t gfarm_set_client_architecture(char *architecture, struct gfarm_hostspec *hsp) { struct gfarm_client_architecture_config *cacp; GFARM_MALLOC(cacp); if (cacp == NULL) return (GFARM_ERR_NO_MEMORY); cacp->architecture = strdup(architecture); if (cacp->architecture == NULL) { free(cacp); return (GFARM_ERR_NO_MEMORY); } cacp->hostspec = hsp; cacp->next = NULL; *gfarm_client_architecture_config_last = cacp; gfarm_client_architecture_config_last = &cacp->next; return (GFARM_ERR_NO_ERROR); } static gfarm_error_t gfarm_get_client_architecture(const char *client_name, char **architecturep) { struct hostent *hp; struct gfarm_client_architecture_config *cacp = gfarm_client_architecture_config_list; if (cacp == NULL) return (GFARM_ERR_NO_SUCH_OBJECT); hp = gethostbyname(client_name); for (; cacp != NULL; cacp = cacp->next) { if (host_address_is_match(cacp->hostspec, client_name, hp)) { *architecturep = cacp->architecture; return (GFARM_ERR_NO_ERROR); } } return (GFARM_ERR_NO_SUCH_OBJECT); } /* * shouldn't free the return value of this function. * * NOTE: gfarm_error_initialize() and gfarm_metadb_initialize() * should be called before this function. */ gfarm_error_t gfarm_host_get_self_architecture(char **architecture) { gfarm_error_t e; char *canonical_self_name; static char *self_architecture = NULL; static gfarm_error_t error_save = GFARM_ERR_NO_ERROR; if (self_architecture == NULL) { if (error_save != GFARM_ERR_NO_ERROR) return (error_save); if ((self_architecture = getenv("GFARM_ARCHITECTURE"))!= NULL){ /* do nothing */ } else if ((e = gfarm_host_get_canonical_self_name( &canonical_self_name)) == GFARM_ERR_NO_ERROR) { /* filesystem node case */ self_architecture = gfarm_host_info_get_architecture_by_host( canonical_self_name); if (self_architecture == NULL) { error_save = GFARM_ERR_NO_SUCH_OBJECT; return (error_save); } } else if ((e = gfarm_get_client_architecture( gfarm_host_get_self_name(), &self_architecture)) == GFARM_ERR_NO_ERROR) { /* client case */ /* do nothing */ } else { error_save = e; return (e); } } *architecture = self_architecture; return (GFARM_ERR_NO_ERROR); } #endif /* not yet in gfarm v2 */ static int gfm_canonical_hostname_is_local(struct gfm_connection *gfm_server, const char *canonical_hostname) { gfarm_error_t e; char *self_name; int port; e = gfm_host_get_canonical_self_name(gfm_server, &self_name, &port); if (e != GFARM_ERR_NO_ERROR) self_name = gfarm_host_get_self_name(); return (strcasecmp(canonical_hostname, self_name) == 0); } int gfm_host_is_local(struct gfm_connection *gfm_server, const char *hostname) { gfarm_error_t e; char *canonical_hostname; int is_local, port; e = gfm_host_get_canonical_name(gfm_server, hostname, &canonical_hostname, &port); is_local = gfm_canonical_hostname_is_local(gfm_server, canonical_hostname); if (e == GFARM_ERR_NO_ERROR) free(canonical_hostname); return (is_local); } #ifdef SUN_LEN # ifndef linux # define NEW_SOCKADDR /* 4.3BSD-Reno or later */ # endif #endif #define ADDRESSES_DELTA 16 #define IFCBUFFER_SIZE 8192 gfarm_error_t gfarm_get_ip_addresses(int *countp, struct in_addr **ip_addressesp) { gfarm_error_t e = GFARM_ERR_NO_MEMORY; int fd; int size, count; #ifdef NEW_SOCKADDR int i; #endif int save_errno; struct in_addr *addresses, *p; struct ifreq *ifr; /* pointer to interface address */ struct ifconf ifc; /* buffer for interface addresses */ char ifcbuffer[IFCBUFFER_SIZE]; struct ifreq ifreq; /* buffer for interface flag */ fd = socket(PF_INET, SOCK_DGRAM, 0); if (fd < 0) { save_errno = errno; gflog_debug(GFARM_MSG_1000871, "creation of socket failed: %s", strerror(save_errno)); return (gfarm_errno_to_error(save_errno)); } ifc.ifc_len = sizeof(ifcbuffer); ifc.ifc_buf = ifcbuffer; if (ioctl(fd, SIOCGIFCONF, &ifc) < 0) { save_errno = errno; close(fd); gflog_debug(GFARM_MSG_1000872, "ioctl() on socket failed: %s", strerror(save_errno)); return (gfarm_errno_to_error(save_errno)); } count = 0; size = 2; /* ethernet address + loopback interface address */ GFARM_MALLOC_ARRAY(addresses, size); if (addresses == NULL) { gflog_debug(GFARM_MSG_1000873, "allocation of 'addresses' failed: %s", gfarm_error_string(GFARM_ERR_NO_MEMORY)); goto err; } #ifdef NEW_SOCKADDR ifreq.ifr_name[0] = '\0'; for (i = 0; i < ifc.ifc_len; ) #else for (ifr = ifc.ifc_req; (char *)ifr < ifc.ifc_buf+ifc.ifc_len; ifr++) #endif { #ifdef NEW_SOCKADDR ifr = (struct ifreq *)((char *)ifc.ifc_req + i); i += sizeof(ifr->ifr_name) + ((ifr->ifr_addr.sa_len > sizeof(struct sockaddr) ? ifr->ifr_addr.sa_len : sizeof(struct sockaddr))); #endif if (ifr->ifr_addr.sa_family != AF_INET) continue; #ifdef NEW_SOCKADDR if (strncmp(ifreq.ifr_name, ifr->ifr_name, sizeof(ifr->ifr_name)) != 0) #endif { /* if this is first entry of the interface, get flag */ ifreq = *ifr; if (ioctl(fd, SIOCGIFFLAGS, &ifreq) < 0) { save_errno = errno; gflog_debug(GFARM_MSG_1000874, "ioctl() on socket failed: %s", strerror(save_errno)); goto err; } } if ((ifreq.ifr_flags & IFF_UP) == 0) continue; if (count + 1 > size) { size += ADDRESSES_DELTA; GFARM_REALLOC_ARRAY(p, addresses, size); if (p == NULL) { gflog_debug(GFARM_MSG_1000875, "re-allocation of 'addresses' failed:" " %s", gfarm_error_string( GFARM_ERR_NO_MEMORY)); goto err; } addresses = p; } addresses[count++] = ((struct sockaddr_in *)&ifr->ifr_addr)->sin_addr; } if (count == 0) { free(addresses); addresses = NULL; } else if (size != count) { GFARM_REALLOC_ARRAY(p, addresses, count); if (p == NULL) { gflog_debug(GFARM_MSG_1000876, "re-allocation of 'addresses' failed: %s", gfarm_error_string(GFARM_ERR_NO_MEMORY)); goto err; } addresses = p; } *ip_addressesp = addresses; *countp = count; close(fd); return (GFARM_ERR_NO_ERROR); err: if (addresses != NULL) free(addresses); close(fd); return (e); } #if 0 /* "address_use" directive is disabled for now */ struct gfarm_host_address_use_config { struct gfarm_host_address_use_config *next; struct gfarm_hostspec *hostspec; }; struct gfarm_host_address_use_config *gfarm_host_address_use_config_list = NULL; struct gfarm_host_address_use_config **gfarm_host_address_use_config_last = &gfarm_host_address_use_config_list; gfarm_error_t gfarm_host_address_use(struct gfarm_hostspec *hsp) { struct gfarm_host_address_use_config *haucp; GFARM_MALLOC(haucp); if (haucp == NULL) { gflog_debug(GFARM_MSG_1000877, "allocation of host address use config failed: %s", gfarm_error_string(GFARM_ERR_NO_MEMORY)); return (GFARM_ERR_NO_MEMORY); } haucp->hostspec = hsp; haucp->next = NULL; *gfarm_host_address_use_config_last = haucp; gfarm_host_address_use_config_last = &haucp->next; return (GFARM_ERR_NO_ERROR); } #endif /* "address_use" directive is disabled for now */ static int always_match(struct gfarm_hostspec *hostspecp, const char *name, struct sockaddr *addr) { return (1); } /* XXX should try to connect all IP addresses. i.e. this interface is wrong. */ static gfarm_error_t host_address_get(const char *name, int port, int (*match)(struct gfarm_hostspec *, const char *, struct sockaddr *), struct gfarm_hostspec *hostspec, struct sockaddr *peer_addr, char **if_hostnamep) { struct addrinfo hints, *res, *res0; int error; char *n, sbuf[NI_MAXSERV]; snprintf(sbuf, sizeof(sbuf), "%u", port); memset(&hints, 0, sizeof(hints)); hints.ai_family = AF_INET; hints.ai_socktype = SOCK_STREAM; /* XXX maybe used for SOCK_DGRAM */ error = gfarm_getaddrinfo(name, sbuf, &hints, &res0); if (error != 0) { gflog_debug(GFARM_MSG_1000878, "Unknown host (%s): %s", name, gfarm_error_string(GFARM_ERR_UNKNOWN_HOST)); return (GFARM_ERR_UNKNOWN_HOST); } for (res = res0; res != NULL; res = res->ai_next) { if ((*match)(hostspec, name, res->ai_addr)) { /* to be sure */ if (res0->ai_addr->sa_family != AF_INET || res0->ai_addrlen > sizeof(*peer_addr)) { gfarm_freeaddrinfo(res0); gflog_debug(GFARM_MSG_1000879, "Address family not supported by " "protocol family (%s): %s", name, gfarm_error_string( GFARM_ERR_ADDRESS_FAMILY_NOT_SUPPORTED_BY_PROTOCOL_FAMILY)); return (GFARM_ERR_ADDRESS_FAMILY_NOT_SUPPORTED_BY_PROTOCOL_FAMILY); } if (if_hostnamep != NULL) { /* XXX - or strdup(res0->ai_canonname)? */ n = strdup(name); if (n == NULL) { gfarm_freeaddrinfo(res0); gflog_debug(GFARM_MSG_1000880, "allocation of hostname failed" ": %s", gfarm_error_string( GFARM_ERR_NO_MEMORY)); return (GFARM_ERR_NO_MEMORY); } *if_hostnamep = n; } memset(peer_addr, 0, sizeof(*peer_addr)); memcpy(peer_addr, res0->ai_addr, sizeof(*peer_addr)); gfarm_freeaddrinfo(res0); return (GFARM_ERR_NO_ERROR); } } gfarm_freeaddrinfo(res0); gflog_debug(GFARM_MSG_1000881, "failed to get host address (%s): %s", name, gfarm_error_string(GFARM_ERR_NO_SUCH_OBJECT)); return (GFARM_ERR_NO_SUCH_OBJECT); } static gfarm_error_t host_address_get_matched(const char *name, int port, struct gfarm_hostspec *hostspec, struct sockaddr *peer_addr, char **if_hostnamep) { return (host_address_get(name, port, hostspec == NULL ? always_match: gfarm_hostspec_match, hostspec, peer_addr, if_hostnamep)); } static gfarm_error_t host_info_address_get_matched(struct gfarm_host_info *info, int port, struct gfarm_hostspec *hostspec, struct sockaddr *peer_addr, char **if_hostnamep) { gfarm_error_t e; int i; e = host_address_get_matched(info->hostname, port, hostspec, peer_addr, if_hostnamep); if (e == GFARM_ERR_NO_ERROR) return (GFARM_ERR_NO_ERROR); for (i = 0; i < info->nhostaliases; i++) { e = host_address_get_matched(info->hostaliases[i], port, hostspec, peer_addr, if_hostnamep); if (e == GFARM_ERR_NO_ERROR) return (GFARM_ERR_NO_ERROR); } if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1000882, "failed to get matched host address: %s", gfarm_error_string(e)); } return (e); } struct host_info_rec { struct gfarm_host_info *info; int tried, got; }; static gfarm_error_t address_get_matched(struct gfm_connection *gfm_server, const char *name, struct host_info_rec *hir, int port, struct gfarm_hostspec *hostspec, struct sockaddr *peer_addr, char **if_hostnamep) { gfarm_error_t e; e = host_address_get_matched(name, port, hostspec, peer_addr, if_hostnamep); if (e == GFARM_ERR_NO_ERROR) return (GFARM_ERR_NO_ERROR); if (!hir->tried) { hir->tried = 1; if (gfm_host_info_get_by_name_alias(gfm_server, name, hir->info) == GFARM_ERR_NO_ERROR) hir->got = 1; } if (hir->got) { e = host_info_address_get_matched(hir->info, port, hostspec, peer_addr, if_hostnamep); } if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1000883, "failed to get matched address: %s", gfarm_error_string(e)); } return (e); } static gfarm_error_t address_get(struct gfm_connection *gfm_server, const char *name, struct host_info_rec *hir, int port, struct sockaddr *peer_addr, char **if_hostnamep) { #if 0 /* "address_use" directive is disabled for now */ if (gfarm_host_address_use_config_list != NULL) { struct gfarm_host_address_use_config *config; for (config = gfarm_host_address_use_config_list; config != NULL; config = config->next) { if (address_get_matched(gfm_server, name, hir, port, config->hostspec, peer_addr, if_hostnamep) == GFARM_ERR_NO_ERROR) return (GFARM_ERR_NO_ERROR); } } #endif /* "address_use" directive is disabled for now */ return (address_get_matched(gfm_server, name, hir, port, NULL, peer_addr, if_hostnamep)); } gfarm_error_t gfm_host_info_address_get(struct gfm_connection *gfm_server, const char *host, int port, struct gfarm_host_info *info, struct sockaddr *peer_addr, char **if_hostnamep) { struct host_info_rec hir; hir.info = info; hir.tried = hir.got = 1; return (address_get(gfm_server, host, &hir, port, peer_addr, if_hostnamep)); } gfarm_error_t gfm_host_address_get(struct gfm_connection *gfm_server, const char *host, int port, struct sockaddr *peer_addr, char **if_hostnamep) { gfarm_error_t e; struct gfarm_host_info info; struct host_info_rec hir; hir.info = &info; hir.tried = hir.got = 0; e = address_get(gfm_server, host, &hir, port, peer_addr, if_hostnamep); if (hir.got) gfarm_host_info_free(&info); return (e); } /* * `*widendep' is only set, when this function returns True. * `*widendep' means: * -1: the addr is adjacent to the lower bound of the min address. * 0: the addr is between min and max. * 1: the addr is adjacent to the upper bound of the max address. * * XXX mostly works, but by somewhat haphazard way, if wild_guess is set. */ int gfarm_addr_is_same_net(struct sockaddr *addr, struct sockaddr *min, struct sockaddr *max, int wild_guess, int *widenedp) { gfarm_uint32_t addr_in, min_in, max_in; gfarm_uint32_t addr_net, min_net, max_net; assert(addr->sa_family == AF_INET && min->sa_family == AF_INET && max->sa_family == AF_INET); addr_in = ntohl(((struct sockaddr_in *)addr)->sin_addr.s_addr); min_in = ntohl(((struct sockaddr_in *)min)->sin_addr.s_addr); max_in = ntohl(((struct sockaddr_in *)max)->sin_addr.s_addr); if (min_in <= addr_in && addr_in <= max_in) { *widenedp = 0; return (1); } if (!wild_guess) /* `*widenedp' is always false, if !wild_guess */ return (0); /* do wild guess */ /* XXX - get IPv4 C class part */ addr_net = (addr_in >> 8) & 0xffffff; min_net = (min_in >> 8) & 0xffffff; max_net = (max_in >> 8) & 0xffffff; /* adjacent or same IPv4 C class? */ if (addr_net == min_net - 1 || (addr_net == min_net && addr_in < min_in)) { *widenedp = -1; return (1); } if (addr_net == max_net + 1 || (addr_net == max_net && addr_in > max_in)) { *widenedp = 1; return (1); } return (0); } struct known_network { struct known_network *next; struct gfarm_hostspec *network; }; struct known_network *known_network_list = NULL; struct known_network **known_network_list_last = &known_network_list; void gfarm_known_network_dump(void) { char network[GFARM_HOSTSPEC_STRLEN]; struct known_network *n; for (n = known_network_list; n != NULL; n = n->next) { gfarm_hostspec_to_string(n->network, network, sizeof network); gflog_info(GFARM_MSG_1002445, "%s", network); } } gfarm_error_t gfarm_known_network_list_add(struct gfarm_hostspec *network) { struct known_network *known_network = malloc(sizeof(*known_network)); if (known_network == NULL) return (GFARM_ERR_NO_MEMORY); known_network->network = network; known_network->next = NULL; *known_network_list_last = known_network; known_network_list_last = &known_network->next; return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfarm_addr_network_get(struct sockaddr *addr, struct gfarm_hostspec **networkp) { gfarm_uint32_t addr_in; struct known_network *n; struct gfarm_hostspec *network; gfarm_uint32_t mask; gfarm_error_t e; /* search in the known network list */ for (n = known_network_list; n != NULL; n = n->next) { if (gfarm_hostspec_match(n->network, NULL, addr)) { if (networkp != NULL) *networkp = n->network; return (GFARM_ERR_NO_ERROR); } } /* XXX - assume IPv4 class C network */ assert(addr->sa_family == AF_INET); addr_in = ntohl(((struct sockaddr_in *)addr)->sin_addr.s_addr); mask = 0xffffff00; e = gfarm_hostspec_af_inet4_new(htonl(addr_in & mask), htonl(mask), &network); if (e == GFARM_ERR_NO_ERROR) { e = gfarm_known_network_list_add(network); if (e == GFARM_ERR_NO_ERROR) if (networkp != NULL) *networkp = network; } return (e); } gfarm-2.4.1/lib/libgfarm/gfarm/gfs_profile.c0000644000000000000000000000026511507222723017404 0ustar rootroot/* * $Id$ */ #include "timer.h" int gf_profile; void gfs_profile_set(void) { gf_profile = 1; gfarm_timerval_calibrate(); } void gfs_profile_unset(void) { gf_profile = 0; } gfarm-2.4.1/lib/libgfarm/gfarm/config_server.c0000644000000000000000000000331511507222723017737 0ustar rootroot/* * $Id: config_server.c 5006 2010-12-29 23:36:30Z n-soda $ */ #include #include #include #include #include "gfutil.h" #include "liberror.h" #include "auth.h" #include "gfpath.h" #define GFARM_USE_STDIO #include "config.h" static void gfarm_config_set_default_spool_on_server(void) { if (gfarm_spool_root == NULL) { /* XXX - this case is not recommended. */ gfarm_spool_root = GFARM_SPOOL_ROOT; } } /* the following function is for server. */ gfarm_error_t gfarm_server_config_read(void) { gfarm_error_t e; int lineno; FILE *config; gfarm_init_config_stringlists(); if ((config = fopen(gfarm_config_file, "r")) == NULL) { gflog_debug(GFARM_MSG_1000976, "open operation on server config file (%s) failed", gfarm_config_file); return (GFARM_ERRMSG_CANNOT_OPEN_CONFIG); } e = gfarm_config_read_file(config, &lineno); if (e != GFARM_ERR_NO_ERROR) { gflog_error(GFARM_MSG_1000014, "%s: %d: %s", gfarm_config_file, lineno, gfarm_error_string(e)); return (e); } gfarm_config_set_default_ports(); gfarm_config_set_default_misc(); return (GFARM_ERR_NO_ERROR); } /* the following function is for server. */ gfarm_error_t gfarm_server_initialize(void) { gfarm_error_t e; gflog_initialize(); e = gfarm_server_config_read(); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1000977, "gfarm_server_config_read() failed: %s", gfarm_error_string(e)); return (e); } gfarm_config_set_default_spool_on_server(); return (GFARM_ERR_NO_ERROR); } /* the following function is for server. */ gfarm_error_t gfarm_server_terminate(void) { /* nothing to do (and also may never be called) */ gflog_terminate(); return (GFARM_ERR_NO_ERROR); } gfarm-2.4.1/lib/libgfarm/gfarm/conn_cache.h0000644000000000000000000000356511507222723017200 0ustar rootroot/* * The following #include is necessary to use this module: * #include "lru_cache.h" */ struct gfarm_hash_table; struct gfp_cached_connection; struct gfp_xdr; struct gfp_conn_cache { struct gfarm_lru_cache lru_list; struct gfarm_hash_table *hashtab; gfarm_error_t (*dispose_connection)(void *); const char *type_name; int table_size; int *num_cachep; }; /* The `dispose' function below must call gfp_uncached_connection_dispose() */ #define GFP_CONN_CACHE_INITIALIZER(var, dispose, \ type_name, table_size, num_cachep) \ { \ GFARM_LRU_CACHE_INITIALIZER(var.lru_list), \ NULL, \ dispose, \ type_name, table_size, num_cachep \ } int gfp_is_cached_connection(struct gfp_cached_connection *); void *gfp_cached_connection_get_data(struct gfp_cached_connection *); void gfp_cached_connection_set_data(struct gfp_cached_connection *, void *); const char *gfp_cached_connection_hostname(struct gfp_cached_connection *); const char *gfp_cached_connection_username(struct gfp_cached_connection *); int gfp_cached_connection_port(struct gfp_cached_connection *); gfarm_error_t gfp_uncached_connection_new(struct gfp_cached_connection **); void gfp_uncached_connection_dispose(struct gfp_cached_connection *); void gfp_cached_connection_purge_from_cache(struct gfp_conn_cache *, struct gfp_cached_connection *); gfarm_error_t gfp_uncached_connection_enter_cache(struct gfp_conn_cache *, struct gfp_cached_connection *, const char *, int); void gfp_cached_connection_used(struct gfp_conn_cache *, struct gfp_cached_connection *); void gfp_cached_connection_gc_all(struct gfp_conn_cache *); gfarm_error_t gfp_cached_connection_acquire(struct gfp_conn_cache *, const char *, int, struct gfp_cached_connection **, int *); void gfp_cached_or_uncached_connection_free(struct gfp_conn_cache *, struct gfp_cached_connection *); void gfp_cached_connection_terminate(struct gfp_conn_cache *); gfarm-2.4.1/lib/libgfarm/gfarm/io_fd.c0000644000000000000000000001102711507222723016163 0ustar rootroot/* * iobuffer operation: file descriptor read/write */ #include #include #ifdef HAVE_POLL #include #else #include #endif #include #include #include #include #include #include #include "gfutil.h" /* gfarm_send_no_sigpipe() */ #include "iobuffer.h" #include "gfp_xdr.h" #include "io_fd.h" /* * nonblocking i/o */ int gfarm_iobuffer_nonblocking_read_fd_op(struct gfarm_iobuffer *b, void *cookie, int fd, void *data, int length) { ssize_t rv = read(fd, data, length); if (rv == -1) gfarm_iobuffer_set_error(b, gfarm_errno_to_error(errno)); return (rv); } static int gfarm_iobuffer_nonblocking_write_fd_op(struct gfarm_iobuffer *b, void *cookie, int fd, void *data, int length) { ssize_t rv = write(fd, data, length); if (rv == -1) gfarm_iobuffer_set_error(b, gfarm_errno_to_error(errno)); return (rv); } /* * We have to distinguish the write operation for sockets from * the operation for file descriptors, because gfarm_send_no_sigpipe() * may only work with sockets, since it may use send(2) internally. */ int gfarm_iobuffer_nonblocking_write_socket_op(struct gfarm_iobuffer *b, void *cookie, int fd, void *data, int length) { ssize_t rv = gfarm_send_no_sigpipe(fd, data, length); if (rv == -1) gfarm_iobuffer_set_error(b, gfarm_errno_to_error(errno)); return (rv); } void gfarm_iobuffer_set_nonblocking_read_fd(struct gfarm_iobuffer *b, int fd) { gfarm_iobuffer_set_read(b, gfarm_iobuffer_nonblocking_read_fd_op, NULL, fd); } void gfarm_iobuffer_set_nonblocking_write_fd(struct gfarm_iobuffer *b, int fd) { gfarm_iobuffer_set_write(b, gfarm_iobuffer_nonblocking_write_fd_op, NULL, fd); } /* * blocking i/o */ int gfarm_iobuffer_blocking_read_fd_op(struct gfarm_iobuffer *b, void *cookie, int fd, void *data, int length) { ssize_t rv; for (;;) { rv = read(fd, data, length); if (rv == -1) { if (errno == EINTR) continue; if (errno == EAGAIN) { #ifdef HAVE_POLL struct pollfd fds[1]; fds[0].fd = fd; fds[0].events = POLLIN; poll(fds, 1, -1); #else fd_set readable; FD_ZERO(&readable); FD_SET(fd, &readable); select(fd + 1, &readable, NULL, NULL, NULL); #endif continue; } gfarm_iobuffer_set_error(b, gfarm_errno_to_error(errno)); } return (rv); } } int gfarm_iobuffer_blocking_write_socket_op(struct gfarm_iobuffer *b, void *cookie, int fd, void *data, int length) { ssize_t rv; for (;;) { rv = gfarm_send_no_sigpipe(fd, data, length); if (rv == -1) { if (errno == EINTR) continue; if (errno == EAGAIN) { #ifdef HAVE_POLL struct pollfd fds[1]; fds[0].fd = fd; fds[0].events = POLLOUT; fds[0].revents = 0; poll(fds, 1, -1); #else fd_set writable; FD_ZERO(&writable); FD_SET(fd, &writable); select(fd + 1, NULL, &writable, NULL, NULL); #endif continue; } gfarm_iobuffer_set_error(b, gfarm_errno_to_error(errno)); } return (rv); } } /* * an option for gfarm_iobuffer_set_write_close() */ #if 0 /* currently not used */ void gfarm_iobuffer_write_close_fd_op(struct gfarm_iobuffer *b, void *cookie, int fd) { int rv = close(fd); if (rv == -1 && gfarm_iobuffer_get_error(b) == GFARM_ERR_NO_ERROR) gfarm_iobuffer_set_error(b, gfarm_errno_to_error(errno)); } #endif /* currently not used */ /* * gfp_xdr operation */ gfarm_error_t gfp_iobuffer_close_fd_op(void *cookie, int fd) { return (close(fd) == -1 ? gfarm_errno_to_error(errno) : GFARM_ERR_NO_ERROR); } gfarm_error_t gfp_iobuffer_export_credential_fd_op(void *cookie) { /* it's already exported, or no way to export it. */ return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfp_iobuffer_delete_credential_fd_op(void *cookie, int sighandler) { return (GFARM_ERR_NO_ERROR); } char * gfp_iobuffer_env_for_credential_fd_op(void *cookie) { return (NULL); } struct gfp_iobuffer_ops gfp_xdr_socket_iobuffer_ops = { gfp_iobuffer_close_fd_op, gfp_iobuffer_export_credential_fd_op, gfp_iobuffer_delete_credential_fd_op, gfp_iobuffer_env_for_credential_fd_op, gfarm_iobuffer_nonblocking_read_fd_op, gfarm_iobuffer_nonblocking_write_socket_op, gfarm_iobuffer_blocking_read_fd_op, gfarm_iobuffer_blocking_write_socket_op }; gfarm_error_t gfp_xdr_new_socket(int fd, struct gfp_xdr **connp) { return (gfp_xdr_new(&gfp_xdr_socket_iobuffer_ops, NULL, fd, connp)); } gfarm_error_t gfp_xdr_set_socket(struct gfp_xdr *conn, int fd) { gfp_xdr_set(conn, &gfp_xdr_socket_iobuffer_ops, NULL, fd); return (GFARM_ERR_NO_ERROR); } gfarm-2.4.1/lib/libgfarm/gfarm/quota_info.h0000644000000000000000000000350711507222723017260 0ustar rootroot/* * $Id: quota_info.h 4312 2010-01-14 23:26:49Z takuya-i $ */ #define GFARM_QUOTA_INVALID -1 #define GFARM_QUOTA_NOT_UPDATE -2 /* for db */ struct gfarm_quota_info { char *name; gfarm_time_t grace_period; gfarm_off_t space; gfarm_time_t space_exceed; gfarm_off_t space_soft; gfarm_off_t space_hard; gfarm_uint64_t num; gfarm_time_t num_exceed; gfarm_uint64_t num_soft; gfarm_uint64_t num_hard; gfarm_off_t phy_space; gfarm_time_t phy_space_exceed; gfarm_off_t phy_space_soft; gfarm_off_t phy_space_hard; gfarm_uint64_t phy_num; gfarm_time_t phy_num_exceed; gfarm_uint64_t phy_num_soft; gfarm_uint64_t phy_num_hard; }; /* for getting quota */ struct gfarm_quota_get_info { char *name; gfarm_time_t grace_period; gfarm_off_t space; gfarm_time_t space_grace; gfarm_off_t space_soft; gfarm_off_t space_hard; gfarm_uint64_t num; gfarm_time_t num_grace; gfarm_uint64_t num_soft; gfarm_uint64_t num_hard; gfarm_off_t phy_space; gfarm_time_t phy_space_grace; gfarm_off_t phy_space_soft; gfarm_off_t phy_space_hard; gfarm_uint64_t phy_num; gfarm_time_t phy_num_grace; gfarm_uint64_t phy_num_soft; gfarm_uint64_t phy_num_hard; }; /* for setting quota */ struct gfarm_quota_set_info { char *name; gfarm_time_t grace_period; gfarm_off_t space_soft; gfarm_off_t space_hard; gfarm_uint64_t num_soft; gfarm_uint64_t num_hard; gfarm_off_t phy_space_soft; gfarm_off_t phy_space_hard; gfarm_uint64_t phy_num_soft; gfarm_uint64_t phy_num_hard; }; void gfarm_quota_info_free(struct gfarm_quota_info *); void gfarm_quota_get_info_free(struct gfarm_quota_get_info *); void gfarm_quota_set_info_free(struct gfarm_quota_set_info *); #define quota_limit_is_valid(val) \ ((val >= 0 && val <= GFARM_INT64_MAX) ? 1 : 0) gfarm-2.4.1/lib/libgfarm/gfarm/Makefile0000644000000000000000000002033411507222723016400 0ustar rootroot# $Id: Makefile 5015 2010-12-30 04:23:02Z n-soda $ top_builddir = ../../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk PRIVATE_RULE = $(PRIVATE_LIB_LIBGFARM_GFARM_RULE) PRIVATE_SRCS = $(PRIVATE_LIB_LIBGFARM_GFARM_SRCS) PRIVATE_FILES = $(PRIVATE_LIB_LIBGFARM_GFARM_FILES) PRIVATE_OBJS = $(PRIVATE_LIB_LIBGFARM_GFARM_OBJS) PUBLIC_RULE = /dev/null PUBLIC_SRCS = PUBLIC_OBJS = LIBRARY = libgfarmcore.la LIBRARY_RESULT = # do not install GLOBUS_SRCS = auth_client_gsi.c auth_common_gsi.c \ auth_server_gsi.c auth_server_uid_gsi.c io_gfsl.c GLOBUS_OBJS = auth_client_gsi.lo auth_common_gsi.lo \ auth_server_gsi.lo auth_server_uid_gsi.lo io_gfsl.lo GLOBUS_CFLAGS = -I$(GFSL_SRCDIR) $(globus_includes) SRCS = \ liberror.c \ hostspec.c \ host.c \ param.c \ sockopt.c \ auth_config.c \ stringlist.c \ config.c \ config_server.c \ config_client.c \ import_help.c \ iobuffer.c \ gfp_xdr.c \ gfp_xdr_server.c \ gfs_proto.c \ io_fd.c \ metadb_common.c \ auth_common.c \ auth_client.c \ auth_server.c \ auth_server_uid.c \ conn_hash.c \ conn_cache.c \ gfm_client.c \ gfs_client.c \ gfm_schedule.c \ lookup.c \ gfs_io.c \ gfs_dir.c \ gfs_dirplus.c \ gfs_dirplusxattr.c \ gfs_dircache.c \ gfs_attrplus.c \ gfs_pio.c \ gfs_pio_section.c \ gfs_pio_local.c gfs_pio_remote.c \ gfs_profile.c \ gfs_chmod.c \ gfs_chown.c \ gfs_link.c \ gfs_stat.c \ gfs_statfs.c \ gfs_statfsnode.c \ gfs_statsw.c \ gfs_mkdir.c \ gfs_quota.c \ gfs_readlink.c \ gfs_remove.c \ gfs_rename.c \ gfs_replica.c \ gfs_replica_info.c \ gfs_replicate.c \ gfs_rmdir.c \ gfs_symlink.c \ gfs_unlink.c \ gfs_util.c \ gfs_utimes.c \ gfs_xattr.c \ gfarm_foreach.c \ glob.c \ humanize_number.c \ patmatch.c \ schedule.c \ sockutil.c \ timespec.c \ url.c \ $(globus_srcs) \ $(optional_srcs) # gfs_pio_global.c \ # gfs_pio_misc.c \ # gfs_exec.c \ # $(ldap_srcs) $(postgresql_srcs) $(globus_srcs) OBJS = \ liberror.lo \ hostspec.lo \ host.lo \ param.lo \ sockopt.lo \ auth_config.lo \ stringlist.lo \ config.lo \ config_server.lo \ config_client.lo \ import_help.lo \ iobuffer.lo \ gfp_xdr.lo \ gfp_xdr_server.lo \ gfs_proto.lo \ io_fd.lo \ metadb_common.lo \ auth_common.lo \ auth_client.lo \ auth_server.lo \ auth_server_uid.lo \ conn_hash.lo \ conn_cache.lo \ gfm_client.lo \ gfs_client.lo \ gfm_schedule.lo \ lookup.lo \ gfs_io.lo \ gfs_dir.lo \ gfs_dirplus.lo \ gfs_dirplusxattr.lo \ gfs_dircache.lo \ gfs_attrplus.lo \ gfs_pio.lo \ gfs_pio_section.lo \ gfs_pio_local.lo gfs_pio_remote.lo \ gfs_profile.lo \ gfs_chmod.lo \ gfs_chown.lo \ gfs_link.lo \ gfs_stat.lo \ gfs_statfs.lo \ gfs_statfsnode.lo \ gfs_statsw.lo \ gfs_mkdir.lo \ gfs_quota.lo \ gfs_readlink.lo \ gfs_remove.lo \ gfs_rename.lo \ gfs_replica.lo \ gfs_replica_info.lo \ gfs_replicate.lo \ gfs_rmdir.lo \ gfs_symlink.lo \ gfs_unlink.lo \ gfs_util.lo \ gfs_utimes.lo \ gfs_xattr.lo \ gfarm_foreach.lo \ glob.lo \ humanize_number.lo \ patmatch.lo \ schedule.lo \ sockutil.lo \ timespec.lo \ url.lo \ $(globus_objs) \ $(optional_objs) # gfs_pio_global.lo \ # gfs_pio_misc.lo \ # gfs_exec.lo \ # $(ldap_srcs) $(postgresql_srcs) $(globus_srcs) CFLAGS = $(pthread_includes) \ $(COMMON_CFLAGS) -I$(GFUTIL_SRCDIR) -I$(GFARMLIB_SRCDIR) -I$(srcdir) \ $(globus_cflags) $(metadb_client_includes) $(openssl_includes) \ $(optional_cflags) \ -DGFARM_CONFIG='"$(sysconfdir)/gfarm2.conf"' all: $(LIBRARY) include $(top_srcdir)/makes/lib.mk include $(top_srcdir)/makes/gflog.mk $(OBJS): $(DEPGFARMINC) $(GLOBUS_OBJS): $(DEPGFSLINC) auth_client.lo: $(GFUTIL_SRCDIR)/gfutil.h $(GFUTIL_SRCDIR)/gfevent.h auth.h auth_client_gsi.lo: $(GFUTIL_SRCDIR)/gfutil.h $(GFUTIL_SRCDIR)/gfevent.h $(GFSL_SRCDIR)/gfarm_secure_session.h $(GFSL_SRCDIR)/gfarm_auth.h io_fd.h io_gfsl.h auth.h auth_gsi.h auth_common.lo: $(GFUTIL_SRCDIR)/gfutil.h $(GFUTIL_SRCDIR)/thrsubr.h liberror.h auth.h auth_common_gsi.lo: $(GFUTIL_SRCDIR)/gfutil.h $ $(GFSL_SRCDIR)/gfarm_secure_session.h $(GFSL_SRCDIR)/gfarm_auth.h gfpath.h auth.h auth_gsi.h auth_config.lo: hostspec.h auth.h auth_server.lo: $(GFUTIL_SRCDIR)/gfutil.h liberror.h hostspec.h auth.h gfp_xdr.h gfs_proto.h auth_server_gsi.lo: $(GFSL_SRCDIR)/gfarm_secure_session.h $(GFSL_SRCDIR)/gfarm_auth.h $(GFUTIL_SRCDIR)/gfutil.h io_fd.h io_gfsl.h auth.h auth_gsi.h auth_server_uid.lo: $(GFUTIL_SRCDIR)/gfutil.h auth.h gfm_client.h auth_server_uid_gsi.lo: $(GFUTIL_SRCDIR)/gfutil.h auth.h gfm_client.h config.lo: $(GFUTIL_SRCDIR)/gfutil.h liberror.h patmatch.h hostspec.h param.h sockopt.h host.h auth.h gfpath.h config.h gfm_proto.h gfs_proto.h $(top_builddir)/makes/config.mk # $(GFARM_CONFIG) -> $(sysconfdir) conn_hash.lo: $(GFUTIL_SRCDIR)/hash.h conn_hash.h error.lo: $(GFUTIL_SRCDIR)/hash.h conn_cache.lo: $(GFUTIL_SRCDIR)/hash.h $(GFUTIL_SRCDIR)/lru_cache.h conn_hash.h conn_cache.h gfm_client.lo: $(GFUTIL_SRCDIR)/gfutil.h $(GFUTIL_SRCDIR)/hash.h $(GFUTIL_SRCDIR)/gfnetdb.h $(GFUTIL_SRCDIR)/lru_cache.h gfp_xdr.h io_fd.h sockopt.h sockutil.h host.h auth.h config.h conn_cache.h gfm_proto.h gfj_client.h xattr_info.h gfm_client.h gfm_schedule.lo: gfm_client.h gfm_schedule.h gfp_xdr.lo: $(GFUTIL_SRCDIR)/gfutil.h liberror.h iobuffer.h gfp_xdr.h gfp_xdr_server.lo: $(GFUTIL_SRCDIR)/id_table.h gfp_xdr.h gfs_client.lo: $(GFUTIL_SRCDIR)/gfutil.h $(GFUTIL_SRCDIR)/gfevent.h $(GFUTIL_SRCDIR)/hash.h $(GFUTIL_SRCDIR)/lru_cache.h liberror.h sockutil.h iobuffer.h gfp_xdr.h io_fd.h host.h param.h sockopt.h auth.h config.h conn_cache.h gfs_proto.h gfs_client.h gfs_dir.lo: $(GFUTIL_SRCDIR)/timer.h $(GFUTIL_SRCDIR)/gfutil.h gfs_profile.h gfm_client.h config.h lookup.h gfs_io.h gfs_dir.h gfs_dirplus.lo: $(GFUTIL_SRCDIR)/gfutil.h config.h gfm_client.h gfs_io.h gfs_dirplusxattr.lo: $(GFUTIL_SRCDIR)/gfutil.h config.h gfm_client.h gfs_io.h gfs_dirplusxattr.h gfs_dircache.lo: $(GFUTIL_SRCDIR)/gfutil.h $(GFUTIL_SRCDIR)/hash.h config.h gfs_dir.h gfs_dircache.h gfs_attrplus.h gfs_attrplus.lo: $(GFUTIL_SRCDIR)/gfutil.h gfm_client.h config.h lookup.h gfs_attrplus.h gfs_exec.lo: gfs_pio.h gfs_io.lo: gfs_io.h gfs_link.lo: $(GFUTIL_SRCDIR)/gfutil.h gfm_client.h config.h lookup.h gfs_pio.lo: $(GFUTIL_SRCDIR)/timer.h $(GFUTIL_SRCDIR)/gfutil.h liberror.h gfs_proto.h gfm_client.h gfs_proto.h gfs_io.h gfs_pio.h config.h gfs_pio_global.lo: gfs_proto.h gfs_pio.h gfs_pio_local.lo: gfs_proto.h gfs_pio.h gfs_pio_misc.lo: gfs_proto.h gfs_misc.h gfs_pio_remote.lo: host.h config.h gfs_proto.h gfs_client.h gfs_pio.h gfs_pio_section.lo: gfs_pio.h host.h config.h schedule.h gfs_client.h gfs_proto.h $(GFUTIL_SRCDIR)/timer.h gfs_proto.lo: gfs_proto.h gfs_quota.lo: config.h quota_info.h gfs_readlink.lo: $(GFUTIL_SRCDIR)/gfutil.h gfm_client.h config.h lookup.h gfs_replica.lo: $(GFUTIL_SRCDIR)/gfutil.h gfm_client.h host.h config.h lookup.h gfs_replica_info.lo: gfm_proto.h gfm_client.h lookup.h gfs_replicate.lo: config.h host.h gfm_client.h gfs_client.h schedule.h gfs_misc.h gfs_stat.lo: $(GFUTIL_SRCDIR)/gfutil.h $(GFUTIL_SRCDIR)/timer.h gfs_profile.h gfm_client.h config.h lookup.h gfs_misc.h gfs_statsw.lo: gfs_dircache.h gfs_symlink.lo: $(GFUTIL_SRCDIR)/gfutil.h gfm_client.h config.h lookup.h gfs_unlink.lo: $(GFUTIL_SRCDIR)/gfutil.h $(GFUTIL_SRCDIR)/timer.h gfs_profile.h gfs_utimes.lo: $(GFUTIL_SRCDIR)/gfutil.h config.h gfm_client.h lookup.h gfs_xattr.lo: $(GFUTIL_SRCDIR)/gfutil.h $(GFUTIL_SRCDIR)/timer.h gfm_client.h lookup.h gfs_io.h gfs_misc.h config.h gfs_profile.h xattr_info.h gfarm_foreach.lo: gfarm_foreach.h glob.lo: $(GFUTIL_SRCDIR)/gfutil.h liberror.h patmatch.h humanize_number.lo: host.lo: hostspec.h gfm_client.h host.h hostspec.lo: hostspec.h import_help.lo: liberror.h io_fd.lo: iobuffer.h io_fd.h io_gfsl.lo: $(GFSL_SRCDIR)/gfarm_secure_session.h iobuffer.h io_fd.h io_gfsl.h iobuffer.lo: iobuffer.h lookup.lo: $(GFUTIL_SRCDIR)/gfutil.h config.h gfm_client.h lookup.h metadb_common.lo: metadb_common.h xattr_info.h quota_info.h patmatch.lo: patmatch.h param.lo: hostspec.h param.h schedule.lo: $(GFUTIL_SRCDIR)/gfutil.h $(GFUTIL_SRCDIR)/gfevent.h $(GFUTIL_SRCDIR)/hash.h $(GFUTIL_SRCDIR)/timer.h liberror.h conn_hash.h host.h config.h gfm_proto.h gfm_client.h gfs_client.h schedule.h lookup.h gfs_profile.h sockutil.lo: $(GFUTIL_SRCDIR)/gfnetdb.h sockutil.h sockopt.lo: hostspec.h param.h sockopt.h stringlist.lo: timespec.lo: timespec.h url.lo: config.h gfs_pio.h include $(optional_rule) gfarm-2.4.1/lib/libgfarm/gfarm/lookup.c0000644000000000000000000003306711507222724016425 0ustar rootroot#include #include #include #include #include #include #include #define GFARM_INTERNAL_USE /* GFARM_FILE_LOOKUP, gfs_mode_to_type(), etc. */ #include #include #include #include #include "gfutil.h" #include "config.h" #include "gfm_client.h" #include "lookup.h" gfarm_error_t gfarm_url_parse_metadb(const char **pathp, struct gfm_connection **gfm_serverp) { gfarm_error_t e; struct gfm_connection *gfm_server; char *ep, *gfm_server_name = NULL /* , *gfm_server_user */ ; unsigned long gfm_server_port; const char *p, *path = *pathp; if (!gfarm_is_url(path)) { if (gfm_serverp == NULL) e = GFARM_ERR_NO_ERROR; else e = gfm_client_connection_and_process_acquire( gfarm_metadb_server_name, gfarm_metadb_server_port, &gfm_server); } else { path += GFARM_URL_PREFIX_LENGTH; if (path[0] != '/' || path[1] != '/') { gflog_debug(GFARM_MSG_1001254, "Host missing in url (%s): %s", *pathp, gfarm_error_string( GFARM_ERR_GFARM_URL_HOST_IS_MISSING)); return (GFARM_ERR_GFARM_URL_HOST_IS_MISSING); } path += 2; /* skip "//" */ for (p = path; *p != '\0' && (isalnum(*(unsigned char *)p) || *p == '-' || *p == '.'); p++) ; if (p == path) { gflog_debug(GFARM_MSG_1001255, "Host missing in url (%s): %s", *pathp, gfarm_error_string( GFARM_ERR_GFARM_URL_HOST_IS_MISSING)); return (GFARM_ERR_GFARM_URL_HOST_IS_MISSING); } if (*p != ':') { gflog_debug(GFARM_MSG_1001256, "Port missing in url (%s): %s", *pathp, gfarm_error_string( GFARM_ERR_GFARM_URL_PORT_IS_MISSING)); return (GFARM_ERR_GFARM_URL_PORT_IS_MISSING); } if (gfm_serverp != NULL) { GFARM_MALLOC_ARRAY(gfm_server_name, p - path + 1); if (gfm_server_name == NULL) { gflog_debug(GFARM_MSG_1002312, "allocating gfm server name for '%s': " "no memory", *pathp); return (GFARM_ERR_NO_MEMORY); } memcpy(gfm_server_name, path, p - path); gfm_server_name[p - path] = '\0'; } p++; /* skip ":" */ errno = 0; gfm_server_port = strtoul(p, &ep, 10); if (*p == '\0' || (*ep != '\0' && *ep != '/')) { if (gfm_serverp != NULL) free(gfm_server_name); gflog_debug(GFARM_MSG_1001257, "Port missing in url (%s): %s", *pathp, gfarm_error_string( GFARM_ERR_GFARM_URL_PORT_IS_MISSING)); return (GFARM_ERR_GFARM_URL_PORT_IS_MISSING); } path = ep; if (errno == ERANGE || gfm_server_port == ULONG_MAX || gfm_server_port <= 0 || gfm_server_port >= 65536) { if (gfm_serverp != NULL) free(gfm_server_name); gflog_debug(GFARM_MSG_1001258, "Port invalid in url (%s): %s", *pathp, gfarm_error_string( GFARM_ERR_GFARM_URL_PORT_IS_INVALID)); return (GFARM_ERR_GFARM_URL_PORT_IS_INVALID); } if (gfm_serverp == NULL) { e = GFARM_ERR_NO_ERROR; } else { e = gfm_client_connection_and_process_acquire( gfm_server_name, gfm_server_port, &gfm_server); free(gfm_server_name); } } if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001259, "error occurred during process: %s", gfarm_error_string(e)); return (e); } if (gfm_serverp != NULL) *gfm_serverp = gfm_server; *pathp = path; return (GFARM_ERR_NO_ERROR); } const char GFARM_PATH_ROOT[] = "/"; gfarm_error_t gfm_client_connection_and_process_acquire_by_path(const char *path, struct gfm_connection **gfm_serverp) { return (gfarm_url_parse_metadb(&path, gfm_serverp)); } gfarm_error_t gfm_lookup_dir_request(struct gfm_connection *gfm_server, const char *path, const char **basep) { gfarm_error_t e; int beginning = 1; int len; if (*path == '/') path++; #if 0 /* XXX FIX ME: current directory is always "/" on v2 for now */ else return (GFARM_ERR_FUNCTION_NOT_IMPLEMENTED); #endif for (;;) { len = strcspn(path, "/"); if (path[len] != '/') { assert(path[len] == '\0'); if (beginning) { if (len == 0) { path = "/"; e = GFARM_ERR_NO_ERROR; break; } e = gfm_client_open_root_request(gfm_server, GFARM_FILE_LOOKUP); if (e != GFARM_ERR_NO_ERROR) break; } e = GFARM_ERR_NO_ERROR; break; } if (len == 0) { path++; continue; } if (len == 1 && *path == '.') { path += 2; continue; } if (beginning) { e = gfm_client_open_root_request(gfm_server, GFARM_FILE_LOOKUP); if (e != GFARM_ERR_NO_ERROR) break; beginning = 0; } e = gfm_client_open_request(gfm_server, path, len, GFARM_FILE_LOOKUP); if (e != GFARM_ERR_NO_ERROR) break; path += len + 1; } if (e == GFARM_ERR_NO_ERROR) *basep = path; else { gflog_debug(GFARM_MSG_1001260, "error occurred during process: %s", gfarm_error_string(e)); } return (e); } gfarm_error_t gfm_lookup_dir_result(struct gfm_connection *gfm_server, const char *path, const char **basep) { gfarm_error_t e; int beginning = 1; int len; gfarm_ino_t inum; gfarm_uint64_t gen; gfarm_mode_t mode; if (*path == '/') path++; #if 0 /* XXX FIX ME: current directory is always "/" on v2 for now */ else return (GFARM_ERR_FUNCTION_NOT_IMPLEMENTED); #endif for (;;) { len = strcspn(path, "/"); if (path[len] != '/') { assert(path[len] == '\0'); if (beginning) { if (len == 0) { path = "/"; e = GFARM_ERR_NO_ERROR; break; } e = gfm_client_open_root_result(gfm_server); if (e != GFARM_ERR_NO_ERROR) break; } e = GFARM_ERR_NO_ERROR; break; } if (len == 0) { path++; continue; } if (len == 1 && *path == '.') { path += 2; continue; } if (beginning) { e = gfm_client_open_root_result(gfm_server); if (e != GFARM_ERR_NO_ERROR) break; beginning = 0; } e = gfm_client_open_result(gfm_server, &inum, &gen, &mode); if (e != GFARM_ERR_NO_ERROR) break; path += len + 1; } if (e == GFARM_ERR_NO_ERROR) *basep = path; else { gflog_debug(GFARM_MSG_1001261, "error occurred during process: %s", gfarm_error_string(e)); } return (e); } /* Note that this does COMPOUND_BEGIN request too. */ gfarm_error_t gfm_tmp_lookup_parent_request(struct gfm_connection *gfm_server, const char *path, const char **basep) { gfarm_error_t e; const char *base; if ((e = gfm_client_compound_begin_request(gfm_server)) != GFARM_ERR_NO_ERROR) { gflog_warning(GFARM_MSG_1000069, "compound_begin(%s) request: %s", path, gfarm_error_string(e)); } else if ((e = gfm_lookup_dir_request(gfm_server, path, &base)) != GFARM_ERR_NO_ERROR) { gflog_warning(GFARM_MSG_1000070, "lookup_dir(%s) request: %s", path, gfarm_error_string(e)); } else { *basep = base; } return (e); } gfarm_error_t gfm_tmp_lookup_parent_result(struct gfm_connection *gfm_server, const char *path, const char **basep) { gfarm_error_t e; const char *base; if ((e = gfm_client_compound_begin_result(gfm_server)) != GFARM_ERR_NO_ERROR) { gflog_warning(GFARM_MSG_1000071, "compound_begin(%s) result: %s", path, gfarm_error_string(e)); } else if ((e = gfm_lookup_dir_result(gfm_server, path, &base)) != GFARM_ERR_NO_ERROR) { ; } else { *basep = base; } return (e); } /* Note that this does COMPOUND_BEGIN request too. */ gfarm_error_t gfm_tmp_open_request(struct gfm_connection *gfm_server, const char *path, int flags) { gfarm_error_t e; const char *base; if ((e = gfm_tmp_lookup_parent_request(gfm_server, path, &base)) != GFARM_ERR_NO_ERROR) { ; } else if (base[0] == '/' && base[1] == '\0') { /* "/" is special */ e = gfm_client_open_root_request(gfm_server, flags); } else { e = gfm_client_open_request(gfm_server, base, strlen(base), flags); } if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001262, "gfm_client_open_request(%s) failed: %s", path, gfarm_error_string(e)); } return (e); } gfarm_error_t gfm_tmp_open_result(struct gfm_connection *gfm_server, const char *path, int *typep) { gfarm_error_t e; const char *base; if ((e = gfm_tmp_lookup_parent_result(gfm_server, path, &base)) != GFARM_ERR_NO_ERROR) { ; } else if (base[0] == '/' && base[1] == '\0') { /* "/" is special */ if ((e = gfm_client_open_root_result(gfm_server)) == GFARM_ERR_NO_ERROR && typep != NULL) *typep = GFS_DT_DIR; } else { gfarm_ino_t inum; gfarm_uint64_t gen; gfarm_mode_t mode; if ((e = gfm_client_open_result(gfm_server, &inum, &gen, &mode)) == GFARM_ERR_NO_ERROR && typep != NULL) *typep = gfs_mode_to_type(mode); } if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001263, "error occurred during process: %s", gfarm_error_string(e)); } return (e); } gfarm_error_t gfm_name_success_op_connection_free(struct gfm_connection *gfm_server, void *closure) { gfm_client_connection_free(gfm_server); return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfm_name_op(const char *url, gfarm_error_t root_error_code, gfarm_error_t (*request_op)( struct gfm_connection *, void *, const char *), gfarm_error_t (*result_op)(struct gfm_connection *, void *), gfarm_error_t (*success_op)(struct gfm_connection *, void *), void *closure) { gfarm_error_t e, e_save; int retry = 0; struct gfm_connection *gfm_server; const char *path, *base; for (;;) { e_save = GFARM_ERR_NO_ERROR; path = url; if ((e = gfarm_url_parse_metadb(&path, &gfm_server)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001264, "gfarm_url_parse_metadb(%s) failed: %s", url, gfarm_error_string(e)); return (e); } if ((e = gfm_tmp_lookup_parent_request(gfm_server, path, &base)) != GFARM_ERR_NO_ERROR) { gflog_warning(GFARM_MSG_1000072, "tmp_lookup_parent(%s) request: %s", path, gfarm_error_string(e)); } else if (base[0] == '/' && base[1] == '\0') { /* "/" is special */ e_save = root_error_code; } else { e = (*request_op)(gfm_server, closure, base); } if (e != GFARM_ERR_NO_ERROR) break; if ((e = gfm_client_compound_end_request(gfm_server)) != GFARM_ERR_NO_ERROR) { gflog_warning(GFARM_MSG_1000073, "compound_end request: %s", gfarm_error_string(e)); } else if ((e = gfm_tmp_lookup_parent_result(gfm_server, path, &base)) != GFARM_ERR_NO_ERROR) { if (gfm_client_is_connection_error(e) && ++retry <= 1){ gfm_client_connection_free(gfm_server); continue; } #if 0 /* DEBUG */ gflog_debug(GFARM_MSG_1000074, "tmp_lookup_parent(%s) result: %s", path, gfarm_error_string(e)); #endif } else if (base[0] == '/' && base[1] == '\0') { /* "/" is special */ e_save = root_error_code; } else { e = (*result_op)(gfm_server, closure); } if (e != GFARM_ERR_NO_ERROR) break; if ((e = gfm_client_compound_end_result(gfm_server)) != GFARM_ERR_NO_ERROR) { gflog_warning(GFARM_MSG_1000075, "compound_end result: %s", gfarm_error_string(e)); break; } if (e_save != GFARM_ERR_NO_ERROR) break; return ((*success_op)(gfm_server, closure)); } gfm_client_connection_free(gfm_server); /* NOTE: the opened descriptor is automatically closed by gfmd */ if (e != GFARM_ERR_NO_ERROR || e_save != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001265, "error occurred during process: %s", gfarm_error_string( e_save != GFARM_ERR_NO_ERROR ? e_save : e)); } return (e_save != GFARM_ERR_NO_ERROR ? e_save : e); } gfarm_error_t gfm_inode_success_op_connection_free(struct gfm_connection *gfm_server, void *closure, int type) { gfm_client_connection_free(gfm_server); return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfm_inode_op(const char *url, int flags, gfarm_error_t (*request_op)(struct gfm_connection *, void *), gfarm_error_t (*result_op)(struct gfm_connection *, void *), gfarm_error_t (*success_op)(struct gfm_connection *, void *, int), void (*cleanup_op)(struct gfm_connection *, void *), void *closure) { gfarm_error_t e; struct gfm_connection *gfm_server; int retry = 0; const char *path; int type; for (;;) { path = url; if ((e = gfarm_url_parse_metadb(&path, &gfm_server)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001266, "gfarm_url_parse_metadb(%s) failed: %s", url, gfarm_error_string(e)); return (e); } if ((e = gfm_tmp_open_request(gfm_server, path, flags)) != GFARM_ERR_NO_ERROR) { gflog_warning(GFARM_MSG_1000076, "tmp_open(%s) request: %s", path, gfarm_error_string(e)); } else if ((e = (*request_op)(gfm_server, closure)) != GFARM_ERR_NO_ERROR) { ; } else if ((e = gfm_client_compound_end_request(gfm_server)) != GFARM_ERR_NO_ERROR) { gflog_warning(GFARM_MSG_1000077, "compound_end request: %s", gfarm_error_string(e)); } else if ((e = gfm_tmp_open_result(gfm_server, path, &type)) != GFARM_ERR_NO_ERROR) { if (gfm_client_is_connection_error(e) && ++retry <= 1){ gfm_client_connection_free(gfm_server); continue; } #if 0 /* DEBUG */ gflog_debug(GFARM_MSG_1000078, "tmp_open(%s) result: %s", path, gfarm_error_string(e)); #endif } else if ((e = (*result_op)(gfm_server, closure)) != GFARM_ERR_NO_ERROR) { ; } else if ((e = gfm_client_compound_end_result(gfm_server)) != GFARM_ERR_NO_ERROR) { gflog_warning(GFARM_MSG_1000079, "compound_end result: %s", gfarm_error_string(e)); if (cleanup_op != NULL) (*cleanup_op)(gfm_server, closure); } else { return ((*success_op)(gfm_server, closure, type)); } break; } gfm_client_connection_free(gfm_server); /* NOTE: the opened descriptor is automatically closed by gfmd */ if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001267, "error occurred during process: %s", gfarm_error_string(e)); } return (e); } gfarm-2.4.1/lib/libgfarm/gfarm/gfp_xdr.h0000644000000000000000000001146011507222723016542 0ustar rootrootstruct gfarm_iobuffer; struct gfp_iobuffer_ops { gfarm_error_t (*close)(void *, int); gfarm_error_t (*export_credential)(void *); gfarm_error_t (*delete_credential)(void *, int); char *(*env_for_credential)(void *); int (*nonblocking_read)(struct gfarm_iobuffer *, void *, int, void *, int); int (*nonblocking_write)(struct gfarm_iobuffer *, void *, int, void *, int); int (*blocking_read)(struct gfarm_iobuffer *, void *, int, void *, int); int (*blocking_write)(struct gfarm_iobuffer *, void *, int, void *, int); }; struct gfp_xdr; #define IS_CONNECTION_ERROR(e) \ ((e) == GFARM_ERR_BROKEN_PIPE || (e) == GFARM_ERR_UNEXPECTED_EOF || \ (e) == GFARM_ERR_PROTOCOL || \ (e) == GFARM_ERR_NETWORK_IS_DOWN || \ (e) == GFARM_ERR_NETWORK_IS_UNREACHABLE || \ (e) == GFARM_ERR_CONNECTION_ABORTED || \ (e) == GFARM_ERR_CONNECTION_RESET_BY_PEER || \ (e) == GFARM_ERR_NO_BUFFER_SPACE_AVAILABLE || \ (e) == GFARM_ERR_SOCKET_IS_NOT_CONNECTED || \ (e) == GFARM_ERR_OPERATION_TIMED_OUT || \ (e) == GFARM_ERR_CONNECTION_REFUSED || \ (e) == GFARM_ERR_NO_ROUTE_TO_HOST) gfarm_error_t gfp_xdr_new(struct gfp_iobuffer_ops *, void *, int, struct gfp_xdr **); gfarm_error_t gfp_xdr_free(struct gfp_xdr *); void *gfp_xdr_cookie(struct gfp_xdr *); int gfp_xdr_fd(struct gfp_xdr *); gfarm_error_t gfp_xdr_sendbuffer_check_size(struct gfp_xdr *, int); void gfp_xdr_set(struct gfp_xdr *, struct gfp_iobuffer_ops *, void *, int); gfarm_error_t gfp_xdr_export_credential(struct gfp_xdr *); gfarm_error_t gfp_xdr_delete_credential(struct gfp_xdr *, int); char *gfp_xdr_env_for_credential(struct gfp_xdr *); void gfarm_iobuffer_set_nonblocking_read_xxx(struct gfarm_iobuffer *, struct gfp_xdr *); void gfarm_iobuffer_set_nonblocking_write_xxx(struct gfarm_iobuffer *, struct gfp_xdr *); int gfp_xdr_recv_is_ready(struct gfp_xdr *); gfarm_error_t gfp_xdr_flush(struct gfp_xdr *); gfarm_error_t gfp_xdr_purge(struct gfp_xdr *, int, int); gfarm_error_t gfp_xdr_vsend_size_add(size_t *, const char **, va_list *); gfarm_error_t gfp_xdr_vsend(struct gfp_xdr *, const char **, va_list *); gfarm_error_t gfp_xdr_vrecv_sized(struct gfp_xdr *, int, size_t *, int *, const char **, va_list *); gfarm_error_t gfp_xdr_vrecv(struct gfp_xdr *, int, int *, const char **, va_list *); gfarm_error_t gfp_xdr_send_size_add(size_t *, const char *, ...); gfarm_error_t gfp_xdr_send(struct gfp_xdr *, const char *, ...); gfarm_error_t gfp_xdr_recv_sized(struct gfp_xdr *, int, size_t *, int *, const char *, ...); gfarm_error_t gfp_xdr_recv(struct gfp_xdr *, int, int *, const char *, ...); gfarm_error_t gfp_xdr_vrpc_request(struct gfp_xdr *, gfarm_int32_t, const char **, va_list *); gfarm_error_t gfp_xdr_vrpc_result_sized(struct gfp_xdr *, int, size_t *, gfarm_int32_t *, const char **, va_list *); gfarm_error_t gfp_xdr_vrpc_result(struct gfp_xdr *, int, gfarm_int32_t *, const char **, va_list *); gfarm_error_t gfp_xdr_vrpc(struct gfp_xdr *, int, gfarm_int32_t, gfarm_int32_t *, const char **, va_list *); int gfp_xdr_recv_partial(struct gfp_xdr *, int, void *, int); gfarm_error_t gfp_xdr_recv_get_error(struct gfp_xdr *); gfarm_error_t gfp_xdr_read_direct(struct gfp_xdr *, void *, int, int *); gfarm_error_t gfp_xdr_write_direct(struct gfp_xdr *, void *, int, int *); /* asynchronous RPC related functions */ struct gfp_xdr_async_peer; typedef struct gfp_xdr_async_peer *gfp_xdr_async_peer_t; enum gfp_xdr_msg_type { GFP_XDR_TYPE_REQUEST, GFP_XDR_TYPE_RESULT }; typedef gfarm_int32_t gfp_xdr_xid_t; /* transaction ID */ gfarm_error_t gfp_xdr_async_peer_new(gfp_xdr_async_peer_t *); void gfp_xdr_async_peer_free(gfp_xdr_async_peer_t, void *); gfarm_error_t gfp_xdr_callback_async_result(gfp_xdr_async_peer_t, void *, gfp_xdr_xid_t, size_t, gfarm_int32_t *); gfarm_error_t gfp_xdr_vsend_async_request(struct gfp_xdr *, gfp_xdr_async_peer_t, gfarm_int32_t (*)(void *, void *, size_t), void (*)(void *, void *), void *, gfarm_int32_t, const char *, va_list *); gfarm_error_t gfp_xdr_recv_async_header(struct gfp_xdr *, int, enum gfp_xdr_msg_type *, gfp_xdr_xid_t *, size_t *); gfarm_error_t gfp_xdr_recv_request_command(struct gfp_xdr *, int, size_t *, gfarm_int32_t *); gfarm_error_t gfp_xdr_vrecv_request_parameters(struct gfp_xdr *, int, size_t *, const char *, va_list *); gfarm_error_t gfp_xdr_vsend_result(struct gfp_xdr *, gfarm_int32_t, const char *, va_list *); gfarm_error_t gfp_xdr_vsend_async_result(struct gfp_xdr *, gfp_xdr_xid_t, gfarm_int32_t, const char *, va_list *); /* * rpc format string mnemonic: * * c gfarm_[u]int8_t * h gfarm_[u]int16_t * i gfarm_[u]int32_t * l gfarm_[u]int64_t * s char * (on network: gfarm_int32_t, gfarm_int8_t[]) * b fixed size buffer * request: size_t, char * * result: size_t, size_t *, char * * (on network: gfarm_int32_t, gfarm_int8_t[]) * * (all integers are transfered as big endian on network) */ gfarm-2.4.1/lib/libgfarm/gfarm/gfs_pio_misc.c0000644000000000000000000001446311507222723017553 0ustar rootroot/* * $Id: gfs_pio_misc.c 4436 2010-02-18 09:52:26Z n-soda $ */ #include /* for gfs_utime() */ #include #include #include #include #include #include #include "gfs_proto.h" /* for gfs_digest_calculate_local() */ #include "gfs_misc.h" char * gfs_access(const char *gfarm_url, int mode) { char *e, *gfarm_file; struct gfarm_path_info pi; e = gfarm_url_make_path(gfarm_url, &gfarm_file); if (e != NULL) { gflog_debug(GFARM_MSG_UNFIXED, "creation of path from URL (%s) failed: %s", gfarm_url, gfarm_error_string(e)); return (e); } e = gfarm_path_info_get(gfarm_file, &pi); if (e != NULL) { gflog_debug(GFARM_MSG_UNFIXED, "gfarm_path_info_get(%s) failed: %s", gfarm_file, gfarm_error_string(e)); goto free_gfarm_file; } e = gfarm_path_info_access(&pi, mode); gfarm_path_info_free(&pi); free_gfarm_file: free(gfarm_file); return (e); } char * gfs_utimes(const char *gfarm_url, const struct gfarm_timespec *tsp) { char *e, *gfarm_file, *user; struct gfarm_path_info pi; struct timeval now; e = gfarm_url_make_path(gfarm_url, &gfarm_file); if (e != NULL) { gflog_debug(GFARM_MSG_UNFIXED, "creation of path from URL (%s) failed: %s", gfarm_url, gfarm_error_string(e)); return (e); } e = gfarm_path_info_get(gfarm_file, &pi); free(gfarm_file); if (e != NULL) { gflog_debug(GFARM_MSG_UNFIXED, "gfarm_path_info_get(%s) failed: %s", gfarm_file, gfarm_error_string(e)); return (e); } user = gfarm_get_global_username(); if (user == NULL) { gflog_debug(GFARM_MSG_UNFIXED, "gfs_utimes(): programming error, " "gfarm library isn't properly initialized"); return ("gfs_utimes(): programming error, " "gfarm library isn't properly initialized"); } if (strcmp(pi.status.st_user, user) != 0) goto finish_free_path_info; gettimeofday(&now, NULL); if (tsp == NULL) { pi.status.st_atimespec.tv_sec = pi.status.st_mtimespec.tv_sec = now.tv_sec; pi.status.st_atimespec.tv_nsec = pi.status.st_mtimespec.tv_nsec = now.tv_usec * 1000; } else { pi.status.st_atimespec = tsp[0]; pi.status.st_mtimespec = tsp[1]; } pi.status.st_ctimespec.tv_sec = now.tv_sec; pi.status.st_ctimespec.tv_nsec = now.tv_usec * 1000; e = gfarm_path_info_replace(pi.pathname, &pi); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_UNFIXED, "replacement of path info (%s) failed: %s", pi.pathname, gfarm_error_string(e)); } finish_free_path_info: gfarm_path_info_free(&pi); return (e); } /* * */ static char * digest_calculate(char *filename, char **digest_type, char *digest_string, size_t *md_len_p, file_offset_t *filesizep) { int fd, i, rv; EVP_MD_CTX md_ctx; unsigned char md_value[EVP_MAX_MD_SIZE]; char buffer[GFS_LOCAL_FILE_BUFSIZE]; if ((fd = open(filename, O_RDONLY)) == -1) { int save_errno = errno; gflog_debug(GFARM_MSG_UNFIXED, "open() on file(%s) failed: %s", filename, strerror(save_errno)); return (gfarm_errno_to_error(save_errno)); } EVP_DigestInit(&md_ctx, GFS_DEFAULT_DIGEST_MODE); rv = gfs_digest_calculate_local(fd, buffer, sizeof buffer, GFS_DEFAULT_DIGEST_MODE, &md_ctx, md_len_p, md_value, filesizep); close(fd); if (rv != 0) { gflog_debug(GFARM_MSG_UNFIXED, "calculation of local digest failed: %s", gfarm_error_string(gfarm_errno_to_error(rv))); return (gfarm_errno_to_error(rv)); } for (i = 0; i < *md_len_p; i++) sprintf(&digest_string[i + i], "%02x", md_value[i]); *digest_type = GFS_DEFAULT_DIGEST_NAME; return (NULL); } /* * Register a gfarm fragment to a Meta DB. This function is intended * to be used with legacy applications to register a new file. */ char * gfs_pio_set_fragment_info_local(char *filename, char *gfarm_file, char *section) { char *digest_type; char digest_value_string[EVP_MAX_MD_SIZE * 2 + 1]; size_t digest_len; file_offset_t filesize; char *e = NULL; struct gfarm_file_section_info fi; struct gfarm_file_section_copy_info fci; #ifdef __GNUC__ /* workaround gcc warning: 'digest_type' may be used uninitialized */ digest_type = NULL; #endif /* Calculate checksum. */ e = digest_calculate(filename, &digest_type, digest_value_string, &digest_len, &filesize); if (e != NULL) { gflog_debug(GFARM_MSG_UNFIXED, "calculation of digest for file(%s) failed: %s", filename, gfarm_error_string(e)); return (e); } /* Update the filesystem metadata. */ e = gfarm_file_section_info_get(gfarm_file, section, &fi); if (e == GFARM_ERR_NO_SUCH_OBJECT) { fi.filesize = filesize; fi.checksum_type = digest_type; fi.checksum = digest_value_string; e = gfarm_file_section_info_set(gfarm_file, section, &fi); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_UNFIXED, "gfarm_file_section_info_set(%s) failed: %s", gfarm_file, gfarm_error_string(e)); } } else if (e == NULL) { if (gfs_file_section_info_check_checksum_unknown(&fi) || gfs_file_section_info_check_busy(&fi)) { struct gfarm_file_section_info fi1; fi1.filesize = filesize; fi1.checksum_type = GFS_DEFAULT_DIGEST_NAME; fi1.checksum = digest_value_string; e = gfarm_file_section_info_replace( gfarm_file, section, &fi1); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_UNFIXED, "replacement of file section info " "(%s) failed: %s", gfarm_file, gfarm_error_string(e)); } } else { if (fi.filesize != filesize) e = "file size mismatch"; if (strcasecmp(fi.checksum_type, digest_type) != 0) e = "checksum type mismatch"; if (strcasecmp(fi.checksum, digest_value_string) != 0) e = "check sum mismatch"; if (e != NULL) gflog_debug(GFARM_MSG_UNFIXED, "%s", e); } gfarm_file_section_info_free(&fi); } else { gflog_debug(GFARM_MSG_UNFIXED, "Cannot get file section info (%s): %s", gfarm_file, gfarm_error_string(e)); } if (e != NULL) return (e); e = gfarm_host_get_canonical_self_name(&fci.hostname); if (e == NULL) { e = gfarm_file_section_copy_info_set( gfarm_file, section, fci.hostname, &fci); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_UNFIXED, "gfarm_host_get_canonical_self_name(%s) " "failed: %s", gfarm_file, gfarm_error_string(e)); } } else { gflog_debug(GFARM_MSG_UNFIXED, "gfarm_host_get_canonical_self_name() failed: %s", gfarm_file, gfarm_error_string(e)); } return (e); } gfarm-2.4.1/lib/libgfarm/gfarm/auth_server.c0000644000000000000000000004267511507222723017447 0ustar rootroot#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "gfutil.h" #include "liberror.h" #include "hostspec.h" #include "auth.h" #include "gfp_xdr.h" #include "gfs_proto.h" /* for GFSD_USERNAME, XXX layering violation */ static gfarm_error_t gfarm_authorize_panic(struct gfp_xdr *, int, char *, char *, gfarm_error_t (*)(void *, enum gfarm_auth_method, const char *, char **), void *, enum gfarm_auth_id_type *, char **); gfarm_error_t (*gfarm_authorization_table[])(struct gfp_xdr *, int, char *, char *, gfarm_error_t (*)(void *, enum gfarm_auth_method, const char *, char **), void *, enum gfarm_auth_id_type *, char **) = { /* * This table entry should be ordered by enum gfarm_auth_method. */ gfarm_authorize_panic, /* GFARM_AUTH_METHOD_NONE */ gfarm_authorize_sharedsecret, /* GFARM_AUTH_METHOD_SHAREDSECRET */ gfarm_authorize_panic, /* GFARM_AUTH_METHOD_GSI_OLD */ #ifdef HAVE_GSI gfarm_authorize_gsi, /* GFARM_AUTH_METHOD_GSI */ gfarm_authorize_gsi_auth, /* GFARM_AUTH_METHOD_GSI_AUTH */ #else gfarm_authorize_panic, /* GFARM_AUTH_METHOD_GSI */ gfarm_authorize_panic, /* GFARM_AUTH_METHOD_GSI_AUTH */ #endif }; static gfarm_error_t gfarm_authorize_panic(struct gfp_xdr *conn, int switch_to, char *service_tag, char *hostname, gfarm_error_t (*auth_uid_to_global_user)(void *, enum gfarm_auth_method, const char *, char **), void *closure, enum gfarm_auth_id_type *peer_typep, char **global_usernamep) { gflog_fatal(GFARM_MSG_1000021, "gfarm_authorize: authorization assertion failed"); return (GFARM_ERR_PROTOCOL); } static gfarm_error_t gfarm_auth_sharedsecret_giveup_response( struct gfp_xdr *conn, int try, gfarm_int32_t error) { gfarm_error_t e; e = gfp_xdr_flush(conn); if (e != GFARM_ERR_NO_ERROR) { gflog_error(GFARM_MSG_1000022, "auth_sharedsecret: cut: %s", gfarm_error_string(e)); } else if (try <= 1) { e = GFARM_ERR_AUTHENTICATION; gflog_error(GFARM_MSG_1000023, "auth_sharedsecret: scaned: %s", gfarm_error_string(e)); } else { switch (error) { case GFARM_AUTH_ERROR_EXPIRED: e = GFARM_ERR_EXPIRED; break; case GFARM_AUTH_ERROR_NOT_SUPPORTED: e = GFARM_ERR_PROTOCOL_NOT_SUPPORTED; break; default: e = GFARM_ERR_AUTHENTICATION; break; } gflog_error(GFARM_MSG_1000024, "auth_sharedsecret: gives up: %s", gfarm_error_string(e)); } return (e); } static gfarm_error_t gfarm_auth_sharedsecret_md5_response( struct gfp_xdr *conn, struct passwd *pwd, gfarm_int32_t *errorp) { int eof; size_t len; gfarm_uint32_t expire, expire_expected; char challenge[GFARM_AUTH_CHALLENGE_LEN]; char response[GFARM_AUTH_RESPONSE_LEN]; char shared_key_expected[GFARM_AUTH_SHARED_KEY_LEN]; char response_expected[GFARM_AUTH_RESPONSE_LEN]; gfarm_int32_t error; /* gfarm_auth_error */ gfarm_error_t e; gfarm_auth_random(challenge, sizeof(challenge)); e = gfp_xdr_send(conn, "b", sizeof(challenge), challenge); if (e == GFARM_ERR_NO_ERROR) e = gfp_xdr_flush(conn); if (e != GFARM_ERR_NO_ERROR) { gflog_error(GFARM_MSG_1000025, "auth_sharedsecret: challenge: %s", gfarm_error_string(e)); return (e); } e = gfp_xdr_recv(conn, 0, &eof, "ib", &expire, sizeof(response), &len, response); if (e != GFARM_ERR_NO_ERROR) { gflog_error(GFARM_MSG_1000026, "auth_sharedsecret: response: %s", gfarm_error_string(e)); return (e); } if (eof) { gflog_error(GFARM_MSG_1000027, "auth_sharedsecret: " "unexpected EOF in response"); return (GFARM_ERR_PROTOCOL); } /* * Note that gfarm_auth_shared_key_get() should be called * after the above gfp_xdr_recv(), otherwise * client (re)generated shared key may not be accessible. */ if (pwd == NULL) { error = GFARM_AUTH_ERROR_INVALID_CREDENTIAL; gflog_debug(GFARM_MSG_1001074, "Password is null"); /* already logged at gfarm_authorize_sharedsecret() */ } else if ((e = gfarm_auth_shared_key_get(&expire_expected, shared_key_expected, pwd->pw_dir, pwd, GFARM_AUTH_SHARED_KEY_GET, 0)) != GFARM_ERR_NO_ERROR && e != GFARM_ERR_EXPIRED) { error = GFARM_AUTH_ERROR_INVALID_CREDENTIAL; gflog_error(GFARM_MSG_1000028, "auth_sharedsecret: .gfarm_shared_key: %s", gfarm_error_string(e)); } else if (time(0) >= expire) { /* may reach here if (e == GFARM_ERR_EXPIRED) */ error = GFARM_AUTH_ERROR_EXPIRED; gflog_warning(GFARM_MSG_1000029, "auth_sharedsecret: key expired"); } else { /* may also reach here if (e == GFARM_ERR_EXPIRED) */ gfarm_auth_sharedsecret_response_data( shared_key_expected, challenge, response_expected); if (expire != expire_expected) { error = GFARM_AUTH_ERROR_INVALID_CREDENTIAL; gflog_error(GFARM_MSG_1000030, "auth_sharedsecret: " "expire time mismatch"); } else if (memcmp(response, response_expected, sizeof(response)) != 0) { error = GFARM_AUTH_ERROR_INVALID_CREDENTIAL; gflog_error(GFARM_MSG_1000031, "auth_sharedsecret: " "key mismatch"); } else { /* success */ error = GFARM_AUTH_ERROR_NO_ERROR; } } *errorp = error; e = gfp_xdr_send(conn, "i", error); if (e != GFARM_ERR_NO_ERROR) { gflog_error(GFARM_MSG_1000032, "auth_sharedsecret: send result: %s", gfarm_error_string(e)); return (e); } if (error == GFARM_AUTH_ERROR_NO_ERROR) { e = gfp_xdr_flush(conn); if (e != GFARM_ERR_NO_ERROR) { gflog_error(GFARM_MSG_1000033, "auth_sharedsecret: completion: %s", gfarm_error_string(e)); return (e); } return (GFARM_ERR_NO_ERROR); /* success */ } return (GFARM_ERRMSG_AUTH_SHAREDSECRET_MD5_CONTINUE); } static gfarm_error_t gfarm_auth_sharedsecret_response(struct gfp_xdr *conn, struct passwd *pwd) { gfarm_error_t e; gfarm_uint32_t request; gfarm_int32_t error = GFARM_AUTH_ERROR_EXPIRED; /* gfarm_auth_error */ int eof, try = 0; /* NOTE: `pwd' may be NULL, if invalid username is requested. */ for (;;) { ++try; e = gfp_xdr_recv(conn, 0, &eof, "i", &request); if (e != GFARM_ERR_NO_ERROR) { gflog_error(GFARM_MSG_1000034, "auth_sharedsecret_response: %s", gfarm_error_string(e)); return (e); } if (eof) { gflog_error(GFARM_MSG_1000035, "auth_sharedsecret_response: " "unexpected EOF"); return (GFARM_ERR_PROTOCOL); } switch (request) { case GFARM_AUTH_SHAREDSECRET_MD5: case GFARM_AUTH_SHAREDSECRET_GIVEUP: e = gfp_xdr_send(conn, "i", GFARM_AUTH_ERROR_NO_ERROR); break; default: error = GFARM_AUTH_ERROR_NOT_SUPPORTED; e = gfp_xdr_send(conn, "i", error); break; } if (e != GFARM_ERR_NO_ERROR) { gflog_error(GFARM_MSG_1000036, "auth_sharedsecret: key query: %s", gfarm_error_string(e)); return (e); } switch (request) { case GFARM_AUTH_SHAREDSECRET_GIVEUP: return (gfarm_auth_sharedsecret_giveup_response( conn, try, error)); case GFARM_AUTH_SHAREDSECRET_MD5: e = gfarm_auth_sharedsecret_md5_response( conn, pwd, &error); if (e != GFARM_ERRMSG_AUTH_SHAREDSECRET_MD5_CONTINUE) return (e); default: e = gfp_xdr_flush(conn); if (e != GFARM_ERR_NO_ERROR) { gflog_error(GFARM_MSG_1000037, "auth_sharedsecret: request " "response: %s", gfarm_error_string(e)); return (e); } break; } } } static pthread_once_t getpwnam_r_bufsz_initialized = PTHREAD_ONCE_INIT; static int getpwnam_r_bufsz = 0; #define BUFSIZE_MAX 2048 static void getpwnam_r_bufsz_initialize(void) { /* Solaris calls this function more than once with non-pthread apps */ if (getpwnam_r_bufsz != 0) return; getpwnam_r_bufsz = sysconf(_SC_GETPW_R_SIZE_MAX); if (getpwnam_r_bufsz == -1) getpwnam_r_bufsz = BUFSIZE_MAX; } gfarm_error_t gfarm_authorize_sharedsecret(struct gfp_xdr *conn, int switch_to, char *service_tag, char *hostname, gfarm_error_t (*auth_uid_to_global_user)(void *, enum gfarm_auth_method, const char *, char **), void *closure, enum gfarm_auth_id_type *peer_typep, char **global_usernamep) { gfarm_error_t e; char *global_username, *local_username, *aux, *buf = NULL; int eof; enum gfarm_auth_id_type peer_type; struct passwd pwbuf, *pwd; int is_root = 0; e = gfp_xdr_recv(conn, 0, &eof, "s", &global_username); if (e != GFARM_ERR_NO_ERROR) { gflog_error(GFARM_MSG_1000038, "authorize_sharedsecret: reading username"); return (e); } if (eof) { gflog_error(GFARM_MSG_1000039, "authorize_sharedsecret: unexpected EOF"); return (GFARM_ERR_PROTOCOL); } if (strcmp(global_username, GFSD_USERNAME) == 0) { peer_type = GFARM_AUTH_ID_TYPE_SPOOL_HOST; } else { /* * actually, a protocol-level uid is a gfarm global username * in sharedsecret case. * so, the purpose of (*auth_uid_to_global_user)() is * to verify whether the user does exist or not in this case. */ peer_type = GFARM_AUTH_ID_TYPE_USER; e = (*auth_uid_to_global_user)(closure, GFARM_AUTH_METHOD_SHAREDSECRET, global_username, NULL); if (e != GFARM_ERR_NO_ERROR) gflog_error(GFARM_MSG_1000040, "(%s@%s) authorize_sharedsecret: " "the global username isn't registered in gfmd: %s", global_username, hostname, gfarm_error_string(e)); } if (e == GFARM_ERR_NO_ERROR) { e = gfarm_global_to_local_username(global_username, &local_username); if (e != GFARM_ERR_NO_ERROR) gflog_error(GFARM_MSG_1000041, "(%s@%s) authorize_sharedsecret: " "cannot map global username into local username: " "%s", global_username, hostname, gfarm_error_string(e)); } if (e != GFARM_ERR_NO_ERROR) { local_username = NULL; pwd = NULL; } else { pthread_once(&getpwnam_r_bufsz_initialized, getpwnam_r_bufsz_initialize); buf = malloc(getpwnam_r_bufsz); if (buf == NULL) { e = GFARM_ERR_NO_MEMORY; gflog_error(GFARM_MSG_1000042, "(%s@%s) %s: authorize_sharedsecret: %s", global_username, hostname, local_username, gfarm_error_string(e)); free(local_username); free(global_username); return (e); } if (getpwnam_r(local_username, &pwbuf, buf, getpwnam_r_bufsz, &pwd) != 0) gflog_error(GFARM_MSG_1000043, "(%s@%s) %s: authorize_sharedsecret: " "local account doesn't exist", global_username, hostname, local_username); } e = gfarm_auth_sharedsecret_response(conn, pwd); /* pwd may be NULL */ /* if (pwd == NULL), must be (e != GFARM_ERR_NO_ERROR) here */ if (e != GFARM_ERR_NO_ERROR) { if (local_username != NULL) free(local_username); free(global_username); if (buf != NULL) free(buf); return (e); } assert(local_username != NULL); /* succeed, do logging */ gflog_notice(GFARM_MSG_1000044, "(%s@%s) authenticated: auth=sharedsecret local_user=%s", global_username, hostname, local_username); if (switch_to) { GFARM_MALLOC_ARRAY(aux, strlen(global_username) + 1 + strlen(hostname) + 1); if (aux == NULL) { gflog_error(GFARM_MSG_1000045, "(%s@%s) authorize_sharedsecret: %s", global_username, hostname, gfarm_error_string(GFARM_ERR_NO_MEMORY)); free(local_username); free(global_username); if (buf != NULL) free(buf); return (GFARM_ERR_NO_MEMORY); } sprintf(aux, "%s@%s", global_username, hostname); gflog_set_auxiliary_info(aux); /* * because the name returned by getlogin() is * an attribute of a session on 4.4BSD derived OSs, * we should create new session before calling * setlogin(). */ if (seteuid(0) == 0) /* make sure to have root privilege */ is_root = 1; if (setsid() == -1) gflog_debug_errno(GFARM_MSG_1002346, "setsid()"); #ifdef HAVE_SETLOGIN if (setlogin(pwd->pw_name) == -1 && is_root) gflog_warning_errno(GFARM_MSG_1002347, "setlogin(%s)", pwd->pw_name); #endif if (initgroups(pwd->pw_name, pwd->pw_gid) == -1 && is_root) gflog_error_errno(GFARM_MSG_1002348, "initgroups(%s, %d)", pwd->pw_name, (int)pwd->pw_gid); if (setgid(pwd->pw_gid) == -1 && is_root) gflog_error_errno(GFARM_MSG_1002349, "setgid(%d)", (int)pwd->pw_gid); if (setuid(pwd->pw_uid) == -1 && is_root) gflog_error_errno(GFARM_MSG_1002350, "setuid(%d)", (int)pwd->pw_uid); gfarm_set_global_username(global_username); gfarm_set_local_username(local_username); gfarm_set_local_homedir(pwd->pw_dir); } free(local_username); if (peer_typep != NULL) *peer_typep = peer_type; if (global_usernamep != NULL) *global_usernamep = global_username; else free(global_username); if (buf != NULL) free(buf); return (GFARM_ERR_NO_ERROR); } /* * the `switch_to' flag has the following side effects: * - gfarm_authorize() isn't thread safe. * - the privilege of this program will switch to the authenticated user. * - gflog_set_auxiliary_info("user@hostname") will be called. * thus, the caller of gfarm_authorize() must call the following later: * char *aux = gflog_get_auxiliary_info(); * gflog_get_auxiliary_info(NULL); * free(aux); * - gfarm_get_local_username(), gfarm_get_local_homedir() and * gfarm_get_global_username() become available. * * note that the user's account is not always necessary on this host, * if the `switch_to' flag isn't set. but also note that some * authentication methods (e.g. "sharedsecret") require the user's * local account anyway even if the `switch_to' isn't set. */ gfarm_error_t gfarm_authorize(struct gfp_xdr *conn, int switch_to, char *service_tag, char *hostname, struct sockaddr *addr, gfarm_error_t (*auth_uid_to_global_user)(void *, enum gfarm_auth_method, const char *, char **), void *closure, enum gfarm_auth_id_type *peer_typep, char **global_usernamep, enum gfarm_auth_method *auth_methodp) { gfarm_error_t e; gfarm_int32_t methods; /* bitset of enum gfarm_auth_method */ gfarm_int32_t method; /* enum gfarm_auth_method */ gfarm_int32_t error; /* enum gfarm_auth_error */ int i, eof, try = 0; size_t nmethods; unsigned char methods_buffer[CHAR_BIT * sizeof(gfarm_int32_t)]; assert(GFARM_ARRAY_LENGTH(gfarm_authorization_table) == GFARM_AUTH_METHOD_NUMBER); methods = gfarm_auth_method_get_enabled_by_name_addr(hostname, addr); if (methods == 0) { gflog_error(GFARM_MSG_1000046, "%s: refusing access", hostname); } else { methods &= gfarm_auth_method_get_available(); if (methods == 0) gflog_error(GFARM_MSG_1000047, "%s: auth-method not configured", hostname); } nmethods = 0; for (i = GFARM_AUTH_METHOD_NONE + 1; i < GFARM_AUTH_METHOD_NUMBER && i < CHAR_BIT * sizeof(gfarm_int32_t); i++) { if ((methods & (1 << i)) != 0) methods_buffer[nmethods++] = i; } e = gfp_xdr_send(conn, "b", nmethods, methods_buffer); if (e == GFARM_ERR_NO_ERROR) e = gfp_xdr_flush(conn); if (e != GFARM_ERR_NO_ERROR) { gflog_error(GFARM_MSG_1000048, "%s: %s", hostname, gfarm_error_string(e)); return (e); } for (;;) { ++try; e = gfp_xdr_recv(conn, 0, &eof, "i", &method); if (e != GFARM_ERR_NO_ERROR) { gflog_error(GFARM_MSG_1000049, "%s: %s", hostname, gfarm_error_string(e)); return (e); } if (eof) { if (try <= 1) gflog_warning(GFARM_MSG_1000050, "%s: port scan", hostname); else gflog_warning(GFARM_MSG_1000051, "%s: client disappeared", hostname); return (GFARM_ERR_PROTOCOL); } if (method == GFARM_AUTH_METHOD_NONE) error = GFARM_AUTH_ERROR_NO_ERROR; else if (method >= GFARM_AUTH_METHOD_NUMBER) error = GFARM_AUTH_ERROR_NOT_SUPPORTED; else if (method <= GFARM_AUTH_METHOD_NONE || ((1 << method) & methods) == 0) error = GFARM_AUTH_ERROR_DENIED; else if (gfarm_authorization_table[method] == gfarm_authorize_panic) error = GFARM_AUTH_ERROR_NOT_SUPPORTED; else error = GFARM_AUTH_ERROR_NO_ERROR; e = gfp_xdr_send(conn, "i", error); if (e == GFARM_ERR_NO_ERROR) e = gfp_xdr_flush(conn); if (e != GFARM_ERR_NO_ERROR) { gflog_error(GFARM_MSG_1000052, "%s: %s", hostname, gfarm_error_string(e)); return (e); } if (error != GFARM_AUTH_ERROR_NO_ERROR) { gflog_error(GFARM_MSG_1000053, "%s: incorrect auth-method request", hostname); return (GFARM_ERR_PROTOCOL); } if (method == GFARM_AUTH_METHOD_NONE) { /* client gave up */ if (methods == 0) { gflog_debug(GFARM_MSG_1001075, "Method permission denied: %s", gfarm_error_string( GFARM_ERR_PERMISSION_DENIED)); e = GFARM_ERR_PERMISSION_DENIED; } else if (try <= 1) { /* * there is no usable auth-method * between client and server. */ gflog_notice(GFARM_MSG_1000054, "%s: authentication method " "doesn't match", hostname); e = GFARM_ERR_PROTOCOL_NOT_SUPPORTED; } else { gflog_debug(GFARM_MSG_1001076, "Authentication failed: %s", gfarm_error_string( GFARM_ERR_AUTHENTICATION)); e = GFARM_ERR_AUTHENTICATION; } return (e); } e = (*gfarm_authorization_table[method])(conn, switch_to, service_tag, hostname, auth_uid_to_global_user, closure, peer_typep, global_usernamep); if (e != GFARM_ERR_PROTOCOL_NOT_SUPPORTED && e != GFARM_ERR_EXPIRED && e != GFARM_ERR_AUTHENTICATION) { /* protocol error, or success */ if (e == GFARM_ERR_NO_ERROR) { if (auth_methodp != NULL) *auth_methodp = method; } else { gflog_debug(GFARM_MSG_1001077, "Authentication failed host=(%s): %s", hostname, gfarm_error_string(e)); } return (e); } } } gfarm-2.4.1/lib/libgfarm/gfarm/sockutil.c0000644000000000000000000000421611507222724016743 0ustar rootroot#include #include #include #include #include #include #include #include #include #include #include "gfnetdb.h" #include "sockutil.h" gfarm_error_t gfarm_connect_wait(int s, int timeout_seconds) { fd_set wset; struct timeval timeout; int rv, error, save_errno; socklen_t error_size; for (;;) { FD_ZERO(&wset); FD_SET(s, &wset); timeout.tv_sec = timeout_seconds; timeout.tv_usec = 0; /* XXX shouldn't use select(2), since wset may overflow. */ rv = select(s + 1, NULL, &wset, NULL, &timeout); if (rv == 0) return (gfarm_errno_to_error(ETIMEDOUT)); if (rv < 0) { if (errno == EINTR) continue; save_errno = errno; gflog_debug(GFARM_MSG_1001458, "select() failed: %s", strerror(save_errno)); return (gfarm_errno_to_error(save_errno)); } break; } error_size = sizeof(error); rv = getsockopt(s, SOL_SOCKET, SO_ERROR, &error, &error_size); if (rv == -1) { save_errno = errno; gflog_debug(GFARM_MSG_1001459, "getsocket() failed: %s", strerror(save_errno)); return (gfarm_errno_to_error(save_errno)); } if (error != 0) { gflog_debug(GFARM_MSG_1001460, "error occurred at socket: %s", gfarm_error_string(gfarm_errno_to_error(error))); return (gfarm_errno_to_error(error)); } return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfarm_bind_source_ip(int sock, const char *source_ip) { struct addrinfo shints, *sres; int rv, save_errno; memset(&shints, 0, sizeof(shints)); shints.ai_family = AF_INET; shints.ai_socktype = SOCK_STREAM; shints.ai_flags = AI_PASSIVE; if (gfarm_getaddrinfo(source_ip, NULL, &shints, &sres) != 0) { gflog_debug(GFARM_MSG_1001461, "gfarm_getaddrinfo(%s) failed: %s", source_ip, gfarm_error_string(GFARM_ERR_UNKNOWN_HOST)); return (GFARM_ERR_UNKNOWN_HOST); } rv = bind(sock, sres->ai_addr, sres->ai_addrlen); save_errno = errno; gfarm_freeaddrinfo(sres); if (rv == -1) { gflog_debug(GFARM_MSG_1001462, "bind() failed: %s", strerror(save_errno)); return (gfarm_errno_to_error(save_errno)); } return (GFARM_ERR_NO_ERROR); } gfarm-2.4.1/lib/libgfarm/gfarm/patmatch.c0000644000000000000000000000656011507222723016712 0ustar rootroot#include #include #include "patmatch.h" int gfarm_pattern_charset_parse(const char *pattern, int index, int *ip) { int i = index; if (pattern[i] == '!') i++; if (pattern[i] != '\0') { if (pattern[i + 1] == '-' && pattern[i + 2] != '\0') i += 3; else i++; } while (pattern[i] != ']') { if (pattern[i] == '\0') { /* end of charset isn't found */ if (ip != NULL) *ip = index; return (0); } if (pattern[i + 1] == '-' && pattern[i + 2] != '\0') i += 3; else i++; } if (ip != NULL) *ip = i; return (1); } static int gfarm_pattern_charset_match(const char *pattern, int pattern_length, int ch) { int i = 0, negate = 0; unsigned char c = ch, *p = (unsigned char *)pattern; if (p[i] == '!') { negate = 1; i++; } while (i < pattern_length) { if (p[i + 1] == '-' && p[i + 2] != '\0') { if (p[i] <= c && c <= p[i + 2]) return (!negate); i += 3; } else { if (c == p[i]) return (!negate); i++; } } return (negate); } static int gfarm_name_submatch(const char *pattern, const char *name, int namelen, int flags) { int w; for (; --namelen >= 0; name++, pattern++){ if (*pattern == '?') continue; if (*pattern == '[' && gfarm_pattern_charset_parse(pattern, 1, &w)) { if (gfarm_pattern_charset_match(pattern + 1, w - 1, *(unsigned char *)name)) { pattern += w; continue; } return (0); } if ((flags & GFARM_PATTERN_NOESCAPE)== 0 && *pattern == '\\') { if (pattern[1] != '\0' && ((flags & GFARM_PATTERN_PATHNAME) == 0 || pattern[1] != '/')) { if (*name == pattern[1]) { pattern++; continue; } } } if (*name != *pattern) return (0); } return (1); } static int gfarm_pattern_prefix_length_to_asterisk( const char *pattern, int pattern_length, int flags, const char **asterisk) { int i, length = 0; for (i = 0; i < pattern_length; length++, i++) { if ((flags & GFARM_PATTERN_NOESCAPE) == 0 && pattern[i] == '\\') { if (i + 1 < pattern_length && ((flags & GFARM_PATTERN_PATHNAME) == 0 || pattern[i + 1] != '/')) i++; } else if (pattern[i] == '*') { *asterisk = &pattern[i]; return (length); } else if (pattern[i] == '[') { gfarm_pattern_charset_parse(pattern, i + 1, &i); } } *asterisk = &pattern[i]; return (length); } int gfarm_pattern_submatch(const char *pattern, int pattern_length, const char *name, int flags) { const char *asterisk; int residual = strlen(name); int sublen = gfarm_pattern_prefix_length_to_asterisk( pattern, pattern_length, flags, &asterisk); if (residual < sublen || !gfarm_name_submatch(pattern, name, sublen, flags)) return (0); if (*asterisk == '\0') return (residual == sublen); for (;;) { name += sublen; residual -= sublen; pattern_length -= asterisk + 1 - pattern; pattern = asterisk + 1; sublen = gfarm_pattern_prefix_length_to_asterisk(pattern, pattern_length, flags, &asterisk); if (*asterisk == '\0') break; for (;; name++, --residual){ if (residual < sublen) return (0); if (gfarm_name_submatch(pattern, name, sublen, flags)) break; } } return (residual >= sublen && gfarm_name_submatch(pattern, name + residual - sublen, sublen, flags)); } int gfarm_pattern_match(const char *pattern, const char *name, int flags) { return (gfarm_pattern_submatch(pattern, strlen(pattern), name, flags)); } gfarm-2.4.1/lib/libgfarm/gfarm/auth_gsi.h0000644000000000000000000000033511507222723016713 0ustar rootrootgfarm_error_t gfarm_gsi_cred_config_convert_to_name( enum gfarm_auth_cred_type, char *, char *, char *, gss_name_t *); void gfarm_gsi_set_delegated_cred(gss_cred_id_t); gss_cred_id_t gfarm_gsi_get_delegated_cred(void); gfarm-2.4.1/lib/libgfarm/gfarm/conn_hash.c0000644000000000000000000001161411507222723017045 0ustar rootroot#include #include #include #include #include #include #include "hash.h" #include "conn_hash.h" struct gfp_conn_hash_id { char *hostname; int port; char *username; }; static int gfp_conn_hash_index(const void *key, int keylen) { const struct gfp_conn_hash_id *id = key; return (gfarm_hash_casefold(id->hostname, strlen(id->hostname)) + id->port * 3 + gfarm_hash_default(id->username, strlen(id->username)) * 5); } static int gfp_conn_hash_equal(const void *key1, int key1len, const void *key2, int key2len) { const struct gfp_conn_hash_id *id1 = key1, *id2 = key2; return (strcasecmp(id1->hostname, id2->hostname) == 0 && id1->port == id2->port && strcmp(id1->username, id2->username) == 0); } char * gfp_conn_hash_hostname(struct gfarm_hash_entry *entry) { struct gfp_conn_hash_id *id = gfarm_hash_entry_key(entry); return (id->hostname); } char * gfp_conn_hash_username(struct gfarm_hash_entry *entry) { struct gfp_conn_hash_id *id = gfarm_hash_entry_key(entry); return (id->username); } int gfp_conn_hash_port(struct gfarm_hash_entry *entry) { struct gfp_conn_hash_id *id = gfarm_hash_entry_key(entry); return (id->port); } gfarm_error_t gfp_conn_hash_table_init( struct gfarm_hash_table **hashtabp, int hashtabsize) { struct gfarm_hash_table *hashtab; hashtab = gfarm_hash_table_alloc(hashtabsize, gfp_conn_hash_index, gfp_conn_hash_equal); if (hashtab == NULL) { gflog_debug(GFARM_MSG_1001081, "allocation of hashtable(%d) failed: %s", hashtabsize, gfarm_error_string(GFARM_ERR_NO_MEMORY)); return (GFARM_ERR_NO_MEMORY); } *hashtabp = hashtab; return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfp_conn_hash_enter(struct gfarm_hash_table **hashtabp, int hashtabsize, size_t entrysize, const char *hostname, int port, const char *username, struct gfarm_hash_entry **entry_ret, int *created_ret) { gfarm_error_t e; struct gfp_conn_hash_id id, *idp; struct gfarm_hash_entry *entry; int created; if (*hashtabp == NULL && (e = gfp_conn_hash_table_init(hashtabp, hashtabsize)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001082, "initialization of connection hashtable (%d) failed: %s", hashtabsize, gfarm_error_string(e)); return (e); } id.hostname = (char *)hostname; /* UNCONST */ id.port = port; id.username = (char *)username; /* UNCONST */ entry = gfarm_hash_enter(*hashtabp, &id, sizeof(id), entrysize, &created); if (entry == NULL) { gflog_debug(GFARM_MSG_1001083, "insertion to hashtable (%zd) failed: %s", entrysize, gfarm_error_string(GFARM_ERR_NO_MEMORY)); return (GFARM_ERR_NO_MEMORY); } if (created) { idp = gfarm_hash_entry_key(entry); idp->hostname = strdup(hostname); idp->username = strdup(username); if (idp->hostname == NULL || idp->username == NULL) { if (idp->hostname != NULL) free(idp->hostname); if (idp->username != NULL) free(idp->username); idp->hostname = (char *)hostname; /* UNCONST */ idp->username = (char *)username; /* UNCONST */ gfarm_hash_purge(*hashtabp, &id, sizeof(id)); gflog_debug(GFARM_MSG_1001084, "allocation of hostname or username failed: %s", gfarm_error_string(GFARM_ERR_NO_MEMORY)); return (GFARM_ERR_NO_MEMORY); } } *entry_ret = entry; *created_ret = created; return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfp_conn_hash_lookup(struct gfarm_hash_table **hashtabp, int hashtabsize, const char *hostname, int port, const char *username, struct gfarm_hash_entry **entry_ret) { gfarm_error_t e; struct gfp_conn_hash_id id; struct gfarm_hash_entry *entry; if (*hashtabp == NULL && (e = gfp_conn_hash_table_init(hashtabp, hashtabsize)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001085, "initialization of connection hashtable (%d) failed: %s", hashtabsize, gfarm_error_string(e)); return (e); } id.hostname = (char *)hostname; /* UNCONST */ id.port = port; id.username = (char *)username; /* UNCONST */ entry = gfarm_hash_lookup(*hashtabp, &id, sizeof(id)); if (entry == NULL) { gflog_debug(GFARM_MSG_1001086, "lookup in hashtable (%s)(%d)(%s) failed", hostname, port, username); return (GFARM_ERR_NO_SUCH_OBJECT); } *entry_ret = entry; return (GFARM_ERR_NO_ERROR); } void gfp_conn_hash_purge(struct gfarm_hash_table *hashtab, struct gfarm_hash_entry *entry) { void *key = gfarm_hash_entry_key(entry); int keylen = gfarm_hash_entry_key_length(entry); struct gfp_conn_hash_id *idp = key; struct gfp_conn_hash_id id = *idp; gfarm_hash_purge(hashtab, key, keylen); free(id.hostname); free(id.username); } void gfp_conn_hash_iterator_purge(struct gfarm_hash_iterator *iterator) { void *key = gfarm_hash_entry_key(gfarm_hash_iterator_access(iterator)); struct gfp_conn_hash_id *idp = key; struct gfp_conn_hash_id id = *idp; gfarm_hash_iterator_purge(iterator); free(id.hostname); free(id.username); } gfarm-2.4.1/lib/libgfarm/gfarm/schedule.c0000644000000000000000000020023411507222724016700 0ustar rootroot/* * Copyright (c) 2003-2006 National Institute of Advanced * Industrial Science and Technology (AIST). All rights reserved. * * Copyright (c) 2006 National Institute of Informatics in Japan, * All rights reserved. * * This file or a portion of this file is licensed under the terms of * the NAREGI Public License, found at * http://www.naregi.org/download/index.html. * If you redistribute this file, with or without modifications, you * must include this notice in the file. */ #include #include /* sprintf */ #include #include #include #include #include #include #include #include #include #include "gfutil.h" /* timeval */ #include "gfevent.h" #include "hash.h" #include "timer.h" #include "liberror.h" #include "conn_hash.h" #include "host.h" /* gfarm_host_info_address_get() */ #include "hostspec.h" #include "config.h" #include "gfm_proto.h" #include "gfm_client.h" #include "gfs_client.h" #include "schedule.h" #include "lookup.h" #include "gfs_profile.h" /* * The outline of current scheduling algorithm is as follows: * * boolean is_satisfied(): * if (desired_number of hosts, which load average is lower or equal * to IDLE_LOAD_AVERAGE, are found) { * return True; * } else if (enough_number of hosts, which load average is lower or equal * to SEMI_IDLE_LOAD_AVERAGE, are found) { * return True; * } * return False; * * void select_hosts(): * if (it's read-mode) * select hosts by load average order. * if (it's write-mode) * if there are enough hosts which have enough free space * select only the hosts which have enough free space * else if there are not enough idle hosts * select hosts by load average order * else * select hosts by disk free space order. * * void finish(): * - add VIRTUAL_LOAD_FOR_SCHEDULED_HOST to loadavg cache of * each scheduled hosts. * - return the hosts. * * void search_idle_in_networks(networks): * search hosts in the network from cache * if (is_satisfied()) * return; * search hosts in the network. i.e. actually call try_host() * if (is_satisfied()) * return; * clear `scheduled` member in the cache, and search the cache again. * * * 1. grouping hosts by its network. * * 2. at first, search hosts on the local network * (i.e. the same network with this client host). * search_idle_in_networks(the local network) * * 3. if there is at least one network which RTT isn't known yet, * examine the RTT. * search each network one by one in this phase, * e.g. assume there are 3 RTT-unknown networks, say, netA, netB, NetC, * and if each network has several hosts, say host1@netA, host2@netA, * and so on... * The examination is done in the following order: * host1@netA -> host1@netB -> host1@netC * -> host2@netA -> host2@netB -> host2@netC * -> host3@netA -> host3@netB -> host3@netC -> .... * Also, concurrently try 3 hosts at most per network, * because the purpose of this phase is to see RTT of each network. * * 4. search networks by RTT order. * for each: current network ... a network which RTT <= current*RTT_THRESH * search_idle_in_networks(the networks) * proceed current network pointer to next RTT level * * 5. reaching this phase means that not enough_number of hosts are found. * in this case, * - select hosts by load average order * and * - finish(). * * some notes: * - load average isn't only condition to see whether the host can be used * or not. * If it's write-mode, we check whether disk free space is enough or not, * by comparing the space against gfarm_get_minimum_free_disk_space(). * - invalidation of loadavg cache is a bit complicated. * if the load average is cached in this scheduling process, the cache * won't be invalidated. * Otherwise, if LOADAVG_EXPIRATION seconds aren't passed yet, only * `scheduled' member is invalidated. * -> this is a hack. see search_idle_forget_scheduled() * Otherwise `loadavg' member is invalidated, too. */ #define CONCURRENCY 10 #define PER_NET_CONCURRENCY 3 /* used when examining RTT */ #define ENOUGH_RATE 4 #define ADDR_EXPIRATION gfarm_schedule_cache_timeout /* seconds */ #define LOADAVG_EXPIRATION gfarm_schedule_cache_timeout /* seconds */ #define STATFS_EXPIRATION gfarm_schedule_cache_timeout /* seconds */ #define RTT_THRESH 4 /* range to treat as similar distance */ #if 0 /* not yet in gfarm v2 */ /* * data structure which represents architectures which can run a program */ #define ARCH_SET_HASHTAB_SIZE 31 /* prime number */ #define IS_IN_ARCH_SET(arch, arch_set) \ (gfarm_hash_lookup(arch_set, arch, strlen(arch) + 1) != NULL) #define free_arch_set(arch_set) gfarm_hash_table_free(arch_set) /* Create a set of architectures that the program is registered for */ static gfarm_error_t program_arch_set(char *program, struct gfarm_hash_table **arch_setp) { gfarm_error_t e; char *gfarm_file; struct gfarm_path_info pi; struct gfarm_file_section_info *sections; struct gfarm_hash_table *arch_set; int i, nsections, created; e = gfarm_url_make_path(program, &gfarm_file); if (e != GFARM_ERR_NO_ERROR) return (e); e = gfarm_path_info_get(gfarm_file, &pi); if (e != GFARM_ERR_NO_ERROR) { if (e == GFARM_ERR_NO_SUCH_OBJECT) e = "such program isn't registered"; free(gfarm_file); return (e); } if (!GFARM_S_IS_PROGRAM(pi.status.st_mode)) { gfarm_path_info_free(&pi); free(gfarm_file); return ("specified command is not an executable"); } e = gfarm_file_section_info_get_all_by_file(gfarm_file, &nsections, §ions); gfarm_path_info_free(&pi); free(gfarm_file); if (e != GFARM_ERR_NO_ERROR) return ("no binary is registered as the specified command"); arch_set = gfarm_hash_table_alloc(ARCH_SET_HASHTAB_SIZE, gfarm_hash_default, gfarm_hash_key_equal_default); if (arch_set == NULL) { gfarm_file_section_info_free_all(nsections, sections); return (GFARM_ERR_NO_MEMORY); } /* register architectures of the program to `arch_set' */ for (i = 0; i < nsections; i++) { if (gfarm_hash_enter(arch_set, sections[i].section, strlen(sections[i].section) + 1, sizeof(int), &created) == NULL) { free_arch_set(arch_set); gfarm_file_section_info_free_all(nsections, sections); return (GFARM_ERR_NO_MEMORY); } } gfarm_file_section_info_free_all(nsections, sections); *arch_setp = arch_set; return (GFARM_ERR_NO_ERROR); } #endif /* not yet in gfarm v2 */ /* * data structure which represents information about a host */ #define HOSTS_HASHTAB_SIZE 3079 /* prime number */ struct search_idle_network; struct search_idle_host_state { #if 0 /* not yet in gfarm v2 */ char *architecture; #endif int port, ncpu; struct timeval addr_cache_time; /* always available */ struct sockaddr addr; /* if HOST_STATE_FLAG_ADDR_AVAIL */ struct search_idle_network *net; struct timeval rtt_cache_time; /* if HOST_STATE_FLAG_RTT_TRIED */ int rtt_usec; /* if HOST_STATE_FLAG_RTT_AVAIL */ struct timeval loadavg_cache_time; float loadavg; /* if HOST_STATE_FLAG_RTT_AVAIL or HOST_STATE_FLAG_STATFS_AVAIL */ /*if HOST_STATE_FLAG_STATFS_AVAIL*/ struct timeval statfs_cache_time; #if 0 gfarm_off_t blocks, bfree, bavail; gfarm_off_t files, ffree, favail; gfarm_int32_t bsize; #else gfarm_off_t diskused, diskavail; #endif int scheduled; int flags; #define HOST_STATE_FLAG_ADDR_AVAIL 0x001 #define HOST_STATE_FLAG_RTT_TRIED 0x002 #define HOST_STATE_FLAG_RTT_AVAIL 0x004 /*#define HOST_STATE_FLAG_AUTH_TRIED 0x008*/ /* not actually used */ #define HOST_STATE_FLAG_AUTH_SUCCEED 0x010 #define HOST_STATE_FLAG_STATFS_AVAIL 0x020 /* The followings are working area during scheduling */ #define HOST_STATE_FLAG_JUST_CACHED 0x040 #define HOST_STATE_FLAG_SCHEDULING 0x080 #define HOST_STATE_FLAG_AVAILABLE 0x100 #define HOST_STATE_FLAG_CACHE_WAS_USED 0x200 /* * The followings are working area during scheduling */ /* linked in search_idle_candidate_list */ struct search_idle_host_state *next; /* linked in search_idle_network::candidate_list */ struct search_idle_host_state *next_in_the_net; /* work area */ char *return_value; /* hostname */ }; /* * The following hash is shared among all metadata servers, * but it should be OK, because the key is a (host, port, username) tuple, * unless there is inconsistency in a metadata server. */ static struct gfarm_hash_table *search_idle_hosts_state = NULL; /* * The followings are working area during scheduling */ static int search_idle_candidate_host_number; static struct search_idle_host_state *search_idle_candidate_list; static struct search_idle_host_state **search_idle_candidate_last; static const char *search_idle_domain_filter; #if 0 /* not yet in gfarm v2 */ static struct gfarm_hash_table *search_idle_arch_filter; #endif struct search_idle_network { struct search_idle_network *next; struct gfarm_hostspec *network; int rtt_usec; /* if NET_FLAG_RTT_AVAIL */ int flags; #define NET_FLAG_NETMASK_KNOWN 0x01 #define NET_FLAG_RTT_AVAIL 0x02 /* The followings are working area during scheduling */ #define NET_FLAG_SCHEDULING 0x04 /* * The followings are working area during scheduling */ struct search_idle_host_state *candidate_list; struct search_idle_host_state **candidate_last; struct search_idle_host_state *cursor; int ongoing; }; /* * The followings are is shared among all metadata servers, * but it must be OK, since these are a global things. */ static struct search_idle_network *search_idle_network_list = NULL; static struct search_idle_network *search_idle_local_net = NULL; /* The followings are working area during scheduling */ static struct timeval search_idle_now; static int is_expired(struct timeval *cached_timep, int expiration) { struct timeval expired; expired = *cached_timep; expired.tv_sec += expiration; return (gfarm_timeval_cmp(&search_idle_now, &expired) >= 0); } static gfarm_error_t search_idle_network_list_init(struct gfm_connection *gfm_server) { gfarm_error_t e; char *self_name; struct search_idle_network *net; struct sockaddr peer_addr; int port; assert(search_idle_network_list == NULL); e = gfm_host_get_canonical_self_name(gfm_server, &self_name, &port); if (e != GFARM_ERR_NO_ERROR) self_name = gfarm_host_get_self_name(); /* * XXX FIXME * This is a suspicious part. * Maybe the peer_addr is not same among different metadata servers. * * Probably it's better to create the `net' variable by using * the results of gfarm_get_ip_addresses(). */ /* XXX FIXME this port number (0) is dummy */ e = gfm_host_address_get(gfm_server, self_name, 0, &peer_addr, NULL); if (e != GFARM_ERR_NO_ERROR) { gflog_error(GFARM_MSG_1000171, "gfarm search_idle_network_list_init: " "self address_get(%s): %s", self_name, gfarm_error_string(e)); return (e); } GFARM_MALLOC(net); if (net == NULL) { gflog_debug(GFARM_MSG_1001425, "search_idle_network_list_init: no memory"); return (GFARM_ERR_NO_MEMORY); } net->rtt_usec = 0; /* i.e. local network */ /* XXX - gfarm_addr_network_get() may assume IPv4 class C network */ gfarm_addr_network_get(&peer_addr, &net->network); net->flags = NET_FLAG_NETMASK_KNOWN | NET_FLAG_RTT_AVAIL; net->candidate_list = NULL; net->candidate_last = &net->candidate_list; net->next = NULL; search_idle_network_list = net; search_idle_local_net = net; return (GFARM_ERR_NO_ERROR); } static gfarm_error_t search_idle_network_list_add(struct sockaddr *addr, struct search_idle_network **netp) { struct search_idle_network *net; gfarm_error_t e; /* XXX - if there are lots of networks, this is too slow */ for (net = search_idle_network_list; net != NULL; net = net->next) { if (!gfarm_hostspec_match(net->network, NULL, addr)) continue; *netp = net; return (GFARM_ERR_NO_ERROR); } /* first host in the network */ GFARM_MALLOC(net); if (net == NULL) { gflog_debug(GFARM_MSG_1001426, "search_idle_network_list_add: no memory"); return (GFARM_ERR_NO_MEMORY); } e = gfarm_addr_network_get(addr, &net->network); if (e != GFARM_ERR_NO_ERROR) { free(net); gflog_debug(GFARM_MSG_1002473, "search_idle_network_list_add: no memory"); return (GFARM_ERR_NO_MEMORY); } /* XXX - may assume IPv4 class C network */ net->flags = NET_FLAG_NETMASK_KNOWN; net->candidate_list = NULL; net->candidate_last = &net->candidate_list; net->ongoing = 0; net->next = search_idle_network_list; search_idle_network_list = net; *netp = net; return (GFARM_ERR_NO_ERROR); } static gfarm_error_t gfarm_schedule_host_cache_clear_auth( struct gfs_connection *); static gfarm_error_t search_idle_host_state_initialize(struct gfm_connection *gfm_server) { gfarm_error_t e; e = gfp_conn_hash_table_init(&search_idle_hosts_state, HOSTS_HASHTAB_SIZE); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001427, "search_idle_host_state_initialize: hash_table_init: %s", gfarm_error_string(e)); return (e); } search_idle_network_list_init(gfm_server); /* ignore any error here */ /* when a connection error happens, make the host unavailable. */ gfs_client_add_hook_for_connection_error( gfarm_schedule_host_cache_clear_auth); return (GFARM_ERR_NO_ERROR); } static gfarm_error_t search_idle_host_state_add_host_sched_info(struct gfm_connection *gfm_server, struct gfarm_host_sched_info *info, struct search_idle_host_state **hp) { gfarm_error_t e; char *hostname = info->host; int created; struct gfarm_hash_entry *entry; struct search_idle_host_state *h; if (search_idle_hosts_state == NULL) { e = search_idle_host_state_initialize(gfm_server); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001428, "search_idle_host_state_add_host_sched_info: " "search_idle_host_state_initialize: %s", gfarm_error_string(e)); return (e); } } e = gfp_conn_hash_enter(&search_idle_hosts_state, HOSTS_HASHTAB_SIZE, sizeof(*h), hostname, info->port, gfm_client_username(gfm_server), &entry, &created); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001429, "search_idle_host_state_add_host_sched_info: " "gfp_conn_hash_enter: %s", gfarm_error_string(e)); return (e); } h = gfarm_hash_entry_data(entry); if (created || (h->flags & HOST_STATE_FLAG_ADDR_AVAIL) == 0 || is_expired(&h->addr_cache_time, ADDR_EXPIRATION)) { if (created) { h->port = info->port; h->ncpu = info->ncpu; #if 0 /* not yet in gfarm v2 */ h->architecture = strdup(info->architecture); if (h->architecture == NULL) { gfp_conn_hash_purge(search_idle_hosts_state, entry); return (GFARM_ERR_NO_MEMORY); } #endif h->net = NULL; h->scheduled = 0; h->flags = 0; } else if ((h->flags & HOST_STATE_FLAG_ADDR_AVAIL) == 0) { if (!is_expired(&h->addr_cache_time, ADDR_EXPIRATION)) { gflog_debug(GFARM_MSG_1001430, "search_idle_host_state_" "add_host_sched_info: %s: unknown host", hostname); return (GFARM_ERR_UNKNOWN_HOST); } } else { /* cope with address change */ assert(is_expired(&h->addr_cache_time, ADDR_EXPIRATION) ); h->flags &= ~HOST_STATE_FLAG_ADDR_AVAIL; h->net = NULL; } e = gfm_host_address_get(gfm_server, hostname, h->port, &h->addr, NULL); gettimeofday(&h->addr_cache_time, NULL); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001431, "search_idle_host_state_add_host_sched_info: " "gfm_host_address_get(%s): %s", hostname, gfarm_error_string(e)); return (e); } h->flags |= HOST_STATE_FLAG_ADDR_AVAIL; e = search_idle_network_list_add(&h->addr, &h->net); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001432, "search_idle_host_state_add_host_sched_info: " "search_idle_network_list_add: %s", gfarm_error_string(e)); h->net = NULL; return (e); } } else if (h->net == NULL) { /* search_idle_network_list_add() failed at the last time */ e = search_idle_network_list_add(&h->addr, &h->net); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001433, "search_idle_host_state_add_host_sched_info: " "retrying search_idle_network_list_add: %s", gfarm_error_string(e)); return (e); } } *hp = h; return (GFARM_ERR_NO_ERROR); } /* forget that this user was authenticated by the specified host */ static gfarm_error_t gfarm_schedule_host_cache_clear_auth(struct gfs_connection *gfs_server) { gfarm_error_t e; struct gfarm_hash_entry *entry; struct search_idle_host_state *h; if (search_idle_hosts_state == NULL) return (GFARM_ERR_NO_ERROR); e = gfp_conn_hash_lookup(&search_idle_hosts_state, HOSTS_HASHTAB_SIZE, gfs_client_hostname(gfs_server), gfs_client_port(gfs_server), gfs_client_username(gfs_server), &entry); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001434, "gfarm_schedule_host_cache_clear_auth: " "connection is not cached: %s", gfarm_error_string(e)); return (e); } h = gfarm_hash_entry_data(entry); h->flags &= ~HOST_STATE_FLAG_AUTH_SUCCEED; return (GFARM_ERR_NO_ERROR); } void gfarm_schedule_host_cache_reset(struct gfm_connection *gfm_server, int nhosts, struct gfarm_host_sched_info *infos) { gfarm_error_t e; struct gfarm_hash_entry *entry; struct search_idle_host_state *h; int i, host_flags; host_flags = HOST_STATE_FLAG_JUST_CACHED| HOST_STATE_FLAG_RTT_TRIED| HOST_STATE_FLAG_SCHEDULING| HOST_STATE_FLAG_AVAILABLE| HOST_STATE_FLAG_CACHE_WAS_USED; if (search_idle_hosts_state == NULL) return; for (i = 0; i < nhosts; ++i) { e = gfp_conn_hash_lookup(&search_idle_hosts_state, HOSTS_HASHTAB_SIZE, infos[i].host, infos[i].port, gfm_client_username(gfm_server), &entry); if (e != GFARM_ERR_NO_ERROR) continue; h = gfarm_hash_entry_data(entry); h->flags &= ~host_flags; } return; } static gfarm_error_t search_idle_candidate_list_reset(struct gfm_connection *gfm_server, int host_flags) { struct gfarm_hash_iterator it; struct gfarm_hash_entry *entry; struct search_idle_host_state *h; struct search_idle_network *net; if (search_idle_hosts_state == NULL) { gfarm_error_t e = search_idle_host_state_initialize(gfm_server); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001435, "search_idle_candidate_list_reset: " "search_idle_host_state_initialize: %s", gfarm_error_string(e)); return (e); } } search_idle_candidate_host_number = 0; search_idle_candidate_list = NULL; search_idle_candidate_last = &search_idle_candidate_list; host_flags |= HOST_STATE_FLAG_SCHEDULING| HOST_STATE_FLAG_AVAILABLE| HOST_STATE_FLAG_CACHE_WAS_USED; for (gfarm_hash_iterator_begin(search_idle_hosts_state, &it); !gfarm_hash_iterator_is_end(&it); gfarm_hash_iterator_next(&it)) { entry = gfarm_hash_iterator_access(&it); h = gfarm_hash_entry_data(entry); h->flags &= ~host_flags; } for (net = search_idle_network_list; net != NULL; net = net->next) { net->flags &= ~NET_FLAG_SCHEDULING; net->ongoing = 0; net->candidate_list = NULL; net->candidate_last = &net->candidate_list; } return (GFARM_ERR_NO_ERROR); } static gfarm_error_t search_idle_candidate_list_init(struct gfm_connection *gfm_server) { #if 0 /* not yet in gfarm v2 */ search_idle_arch_filter = NULL; #endif search_idle_domain_filter = NULL; gettimeofday(&search_idle_now, NULL); return (search_idle_candidate_list_reset(gfm_server, HOST_STATE_FLAG_JUST_CACHED)); } #if 0 /* not yet in gfarm v2 */ /* * similar to search_idle_candidate_list_init(), * but this does not clear HOST_STATE_FLAG_JUST_CACHED. * also, does not reset `search_idle_arch_filter', `search_idle_domain_filter' * and `search_idle_now'. */ static gfarm_error_t search_idle_candidate_list_clear(void) { return (search_idle_candidate_list_reset(0)); } #endif #define search_idle_set_domain_filter(domain) \ (search_idle_domain_filter = (domain)) #if 0 /* not yet in gfarm v2 */ static gfarm_error_t search_idle_set_program_filter(char *program) { return (program_arch_set(program, &search_idle_arch_filter)); } static void search_idle_free_program_filter(void) { free_arch_set(search_idle_arch_filter); } #endif /* not yet in gfarm v2 */ static float entropy(void) { float max = 0.01; return (max * (gfarm_random() / (RAND_MAX + 1.0))); } static gfarm_error_t search_idle_candidate_list_add(struct gfm_connection *gfm_server, struct gfarm_host_sched_info *info) { gfarm_error_t e; char *hostname = info->host; struct search_idle_host_state *h; if ((info->flags & GFM_PROTO_SCHED_FLAG_HOST_AVAIL) == 0) return (GFARM_ERR_NO_ERROR); if (search_idle_domain_filter != NULL && !gfarm_host_is_in_domain(hostname, search_idle_domain_filter)) return (GFARM_ERR_NO_ERROR); /* ignore this host */ #if 0 /* not yet in gfarm v2 */ if (host_info != NULL && search_idle_arch_filter != NULL && !IS_IN_ARCH_SET(host_info->architecture, search_idle_arch_filter)){ /* ignore this host, hostname == NULL case */ return (GFARM_ERR_NO_ERROR); } #endif e = search_idle_host_state_add_host_sched_info(gfm_server, info, &h); if (e != GFARM_ERR_NO_ERROR) { if (e == GFARM_ERR_UNKNOWN_HOST) /* just ignore this host */ return (GFARM_ERR_NO_ERROR); gflog_debug(GFARM_MSG_1001436, "search_idle_candidate_list_add: " "search_idle_host_state_add_host_sched_info: %s", gfarm_error_string(e)); return (e); } if ((h->flags & HOST_STATE_FLAG_SCHEDULING) != 0) { /* same host is specified twice or more */ return (GFARM_ERR_NO_ERROR); } #if 0 /* not yet in gfarm v2 */ if (host_info == NULL && search_idle_arch_filter != NULL && (h->architecture == NULL /* allow non-spool_host for now */ || !IS_IN_ARCH_SET(h->architecture, search_idle_arch_filter))) { /* ignore this host, hostname != NULL case */ return (GFARM_ERR_NO_ERROR); } #endif if (info->flags & GFM_PROTO_SCHED_FLAG_LOADAVG_AVAIL) { if ((h->flags & HOST_STATE_FLAG_RTT_AVAIL) == 0 || h->loadavg_cache_time.tv_sec < info->cache_time) { h->loadavg_cache_time.tv_sec = info->cache_time; h->loadavg_cache_time.tv_usec = 0; /* add entropy to randomize the scheduling result */ h->loadavg = info->loadavg + entropy(); } h->statfs_cache_time.tv_sec = info->cache_time; h->statfs_cache_time.tv_usec = 0; /* convert KiByte to Byte */ h->diskused = info->disk_used * 1024; h->diskavail = info->disk_avail * 1024; h->flags |= HOST_STATE_FLAG_STATFS_AVAIL; } h->flags |= HOST_STATE_FLAG_SCHEDULING; h->net->flags |= NET_FLAG_SCHEDULING; /* link to search_idle_candidate_list */ h->next = NULL; search_idle_candidate_host_number++; *search_idle_candidate_last = h; search_idle_candidate_last = &h->next; /* link to h->net->candidate_list */ h->next_in_the_net = NULL; *h->net->candidate_last = h; h->net->candidate_last = &h->next_in_the_net; /* * return hostname parameter, instead of cached hostname, as results. * this is needed for gfarm_schedule_hosts() * and gfarm_schedule_hosts_acyclic() which return * input hostnames instead of newly allocated strings. */ h->return_value = hostname; return (GFARM_ERR_NO_ERROR); } /* whether need to see authentication or not? */ enum gfarm_schedule_search_mode { GFARM_SCHEDULE_SEARCH_BY_LOADAVG, GFARM_SCHEDULE_SEARCH_BY_LOADAVG_AND_AUTH, GFARM_SCHEDULE_SEARCH_BY_LOADAVG_AND_AUTH_AND_DISKAVAIL }; static enum gfarm_schedule_search_mode default_search_method = GFARM_SCHEDULE_SEARCH_BY_LOADAVG_AND_AUTH; void gfarm_schedule_search_mode_use_loadavg(void) { default_search_method = GFARM_SCHEDULE_SEARCH_BY_LOADAVG; } #define IDLE_LOAD_AVERAGE gfarm_schedule_idle_load /* 0.1F */ #define SEMI_IDLE_LOAD_AVERAGE gfarm_schedule_busy_load /* 0.5F */ #define VIRTUAL_LOAD_FOR_SCHEDULED_HOST gfarm_schedule_virtual_load /* 0.3F */ struct search_idle_state { struct gfarm_eventqueue *q; int desired_number; int enough_number; enum gfarm_schedule_search_mode mode; int write_mode; int available_hosts_number; int usable_hosts_number; int idle_hosts_number; int semi_idle_hosts_number; int concurrency; }; static gfarm_error_t search_idle_init_state(struct search_idle_state *s, int desired_hosts, enum gfarm_schedule_search_mode mode, int write_mode) { s->desired_number = desired_hosts; s->enough_number = desired_hosts * ENOUGH_RATE; s->mode = mode; s->write_mode = write_mode; if (write_mode) s->mode = GFARM_SCHEDULE_SEARCH_BY_LOADAVG_AND_AUTH_AND_DISKAVAIL; /* * If we don't check enough_number or desired_number here, * the behavior of search_idle() becomes undeterministic. * i.e. If there is a candidate, search_idle() returns NULL, * otherwise GFARM_ERRMSG_NO_FILESYSTEM_NODE. */ if (s->enough_number == 0 || s->desired_number == 0 || search_idle_candidate_list == NULL) { gflog_debug(GFARM_MSG_1001437, "search_idle_init_state: no answer is requested"); return (GFARM_ERRMSG_NO_FILESYSTEM_NODE); } s->q = gfarm_eventqueue_alloc(); if (s->q == NULL) { gflog_debug(GFARM_MSG_1001438, "search_idle_init_state: no memory"); return (GFARM_ERR_NO_MEMORY); } s->available_hosts_number = s->usable_hosts_number = s->idle_hosts_number = s->semi_idle_hosts_number = 0; s->concurrency = 0; return (GFARM_ERR_NO_ERROR); } static void search_idle_count(struct search_idle_state *s, struct search_idle_host_state *h, int *usable_numberp, int *idle_numberp, int *semi_idle_numberp) { float loadavg = h->loadavg; int ncpu = h->ncpu; int ok = 1; if (s->write_mode && (h->flags & HOST_STATE_FLAG_STATFS_AVAIL) != 0 && h->diskavail < gfarm_minimum_free_disk_space) ok = 0; /* not enough free space */ if (ok) (*usable_numberp)++; if (ncpu <= 0) /* sanity */ ncpu = 1; loadavg += h->scheduled * VIRTUAL_LOAD_FOR_SCHEDULED_HOST; if (ok && loadavg / ncpu <= IDLE_LOAD_AVERAGE) (*idle_numberp)++; /* * We don't use (loadavg / h->host_info->ncpu) to count * semi_idle_hosts here for now, because it is possible * that there is a process which is consuming 100% of * memory or 100% of I/O bandwidth on the host. */ if (ok && loadavg <= SEMI_IDLE_LOAD_AVERAGE) (*semi_idle_numberp)++; } static void search_idle_record_host(struct search_idle_state *s, struct search_idle_host_state *h) { search_idle_count(s, h, &s->usable_hosts_number, &s->idle_hosts_number, &s->semi_idle_hosts_number); h->flags |= HOST_STATE_FLAG_AVAILABLE; s->available_hosts_number++; } /* hack */ static void search_idle_forget_scheduled(struct search_idle_state *s, struct search_idle_host_state *h) { int junk = 0; int idle1, semi_idle1; int idle2, semi_idle2; if (h->scheduled == 0) return; /* short cut: nothing will be changed in this case */ idle1 = semi_idle1 = 0; search_idle_count(s, h, &junk, &idle1, &semi_idle1); h->scheduled = 0; /* forget it */ idle2 = semi_idle2 = 0; search_idle_count(s, h, &junk, &idle2, &semi_idle2); if (idle1 == 0 && idle2 != 0) s->idle_hosts_number++; if (semi_idle1 == 0 && semi_idle2 != 0) s->semi_idle_hosts_number++; } static int search_idle_is_satisfied(struct search_idle_state *s) { return (s->idle_hosts_number >= s->desired_number || s->semi_idle_hosts_number >= s->enough_number || s->available_hosts_number >= search_idle_candidate_host_number); } struct search_idle_callback_closure { struct search_idle_state *state; struct search_idle_host_state *h; int do_record; void *protocol_state; struct gfs_connection *gfs_server; }; static void search_idle_record(struct search_idle_callback_closure *c) { if (c->do_record) search_idle_record_host(c->state, c->h); } static void search_idle_statfs_callback(void *closure) { struct search_idle_callback_closure *c = closure; struct search_idle_host_state *h = c->h; gfarm_error_t e; gfarm_int32_t bsize; gfarm_off_t blocks, bfree, bavail; gfarm_off_t files, ffree, favail; e = gfs_client_statfs_result_multiplexed(c->protocol_state, &bsize, &blocks, &bfree, &bavail, &files, &ffree, &favail); if (e == GFARM_ERR_NO_ERROR) { h->flags |= HOST_STATE_FLAG_STATFS_AVAIL; h->statfs_cache_time = h->rtt_cache_time; h->diskused = blocks * bsize; h->diskavail = bavail * bsize; search_idle_record(c); /* completed */ } if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001439, "search_idle_statfs_callback: " "gfs_client_statfs_result_multiplexed: %s", gfarm_error_string(e)); } gfs_client_connection_free(c->gfs_server); c->state->concurrency--; h->net->ongoing--; free(c); } static void search_idle_connect_callback(void *closure) { gfarm_error_t e; struct search_idle_callback_closure *c = closure; #if 0 /* We always see disk free space */ struct search_idle_state *s = c->state; #endif struct gfs_client_statfs_state *ss; e = gfs_client_connect_result_multiplexed(c->protocol_state, &c->gfs_server); if (e == GFARM_ERR_NO_ERROR) { /* The following may fail, if it's already in the cache */ gfs_client_connection_enter_cache(c->gfs_server); c->h->flags |= HOST_STATE_FLAG_AUTH_SUCCEED; #if 0 /* We always see disk free space */ if (s->mode == GFARM_SCHEDULE_SEARCH_BY_LOADAVG_AND_AUTH) { /* completed */ search_idle_record(c); gfs_client_connection_free(c->gfs_server); } else { assert(s->mode == GFARM_SCHEDULE_SEARCH_BY_LOADAVG_AND_AUTH_AND_DISKAVAIL ); #endif e = gfs_client_statfs_request_multiplexed(c->state->q, c->gfs_server, ".", search_idle_statfs_callback, c, &ss); if (e == GFARM_ERR_NO_ERROR) { c->protocol_state = ss; return; /* request continues */ } /* failed to request */ gfs_client_connection_free(c->gfs_server); gflog_debug(GFARM_MSG_1001440, "search_idle_connect_callback: " "gfs_client_statfs_request_multiplexed: %s", gfarm_error_string(e)); #if 0 /* We always see disk free space */ } #endif } else { gflog_debug(GFARM_MSG_1001441, "search_idle_connect_callback: " "gfs_client_connect_result_multiplexed: %s", gfarm_error_string(e)); } c->state->concurrency--; c->h->net->ongoing--; free(c); } static void search_idle_load_callback(void *closure) { gfarm_error_t e; struct search_idle_callback_closure *c = closure; struct search_idle_state *s = c->state; struct gfs_client_load load; struct gfs_client_connect_state *cs; struct timeval rtt; e = gfs_client_get_load_result_multiplexed(c->protocol_state, &load); if (e == GFARM_ERR_NO_ERROR) { c->h->flags |= HOST_STATE_FLAG_RTT_AVAIL; /* add entropy to randomize the scheduling result */ c->h->loadavg = load.loadavg_1min + entropy(); c->h->loadavg_cache_time = c->h->rtt_cache_time; c->h->scheduled = 0; /* because now we know real loadavg */ /* update RTT */ gettimeofday(&rtt, NULL); gfarm_timeval_sub(&rtt, &c->h->rtt_cache_time); c->h->rtt_usec = rtt.tv_sec * GFARM_SECOND_BY_MICROSEC + rtt.tv_usec; if ((c->h->net->flags & NET_FLAG_RTT_AVAIL) == 0 || c->h->net->rtt_usec > c->h->rtt_usec) { c->h->net->flags |= NET_FLAG_RTT_AVAIL; c->h->net->rtt_usec = c->h->rtt_usec; } if (s->mode == GFARM_SCHEDULE_SEARCH_BY_LOADAVG) { /* completed */ search_idle_record(c); } else { #if 0 /* not actully used */ c->h->flags |= HOST_STATE_FLAG_AUTH_TRIED; #endif e = gfs_client_connect_request_multiplexed( c->state->q, c->h->return_value, &c->h->addr, search_idle_connect_callback, c, &cs); if (e == GFARM_ERR_NO_ERROR) { c->protocol_state = cs; return; /* request continues */ } /* failed to connect */ gflog_debug(GFARM_MSG_1001442, "search_idle_load_callback: " "gfs_client_connect_request_multiplexed: %s", gfarm_error_string(e)); } } else { gflog_debug(GFARM_MSG_1001443, "search_idle_load_callback: " "gfs_client_get_load_result_multiplexed: %s", gfarm_error_string(e)); } c->state->concurrency--; c->h->net->ongoing--; free(c); } static int net_rtt_compare(const void *a, const void *b) { struct search_idle_network *const *aa = a; struct search_idle_network *const *bb = b; const struct search_idle_network *p = *aa; const struct search_idle_network *q = *bb; int l1 = p->rtt_usec; int l2 = q->rtt_usec; if (l1 < l2) return (-1); else if (l1 > l2) return (1); else return (0); } static int davail_compare(const void *a, const void *b) { struct search_idle_host_state *const *aa = a; struct search_idle_host_state *const *bb = b; const struct search_idle_host_state *p = *aa; const struct search_idle_host_state *q = *bb; const float df1 = p->diskavail; const float df2 = q->diskavail; if (df1 > df2) return (-1); else if (df1 < df2) return (1); else return (0); } static int loadavg_compare(const void *a, const void *b) { struct search_idle_host_state *const *aa = a; struct search_idle_host_state *const *bb = b; const struct search_idle_host_state *p = *aa; const struct search_idle_host_state *q = *bb; const float l1 = (p->loadavg + p->scheduled*VIRTUAL_LOAD_FOR_SCHEDULED_HOST) / p->ncpu; const float l2 = (q->loadavg + q->scheduled*VIRTUAL_LOAD_FOR_SCHEDULED_HOST) / q->ncpu; if (l1 < l2) return (-1); else if (l1 > l2) return (1); else return (0); } static int search_idle_cache_should_be_used(struct search_idle_host_state *h) { /* * the expiration of HOST_STATE_FLAG_ADDR_AVAIL is already coped * by search_idle_candidate_list_add() */ if ((h->flags & HOST_STATE_FLAG_ADDR_AVAIL) == 0) return (1); /* IP address isn't resolvable, even */ return ((h->flags & HOST_STATE_FLAG_RTT_TRIED) != 0 && !is_expired(&h->loadavg_cache_time, LOADAVG_EXPIRATION)); } static int search_idle_cache_is_available(struct search_idle_state *s, struct search_idle_host_state *h) { /* * the expiration of HOST_STATE_FLAG_ADDR_AVAIL is already coped * by search_idle_candidate_list_add() */ if ((h->flags & HOST_STATE_FLAG_ADDR_AVAIL) == 0) return (0); if ((h->flags & HOST_STATE_FLAG_RTT_TRIED) == 0 || is_expired(&h->loadavg_cache_time, LOADAVG_EXPIRATION)) return (0); switch (s->mode) { case GFARM_SCHEDULE_SEARCH_BY_LOADAVG: return ((h->flags & HOST_STATE_FLAG_RTT_AVAIL) != 0); case GFARM_SCHEDULE_SEARCH_BY_LOADAVG_AND_AUTH: return ((h->flags & HOST_STATE_FLAG_AUTH_SUCCEED) != 0); case GFARM_SCHEDULE_SEARCH_BY_LOADAVG_AND_AUTH_AND_DISKAVAIL: return ((h->flags & (HOST_STATE_FLAG_AUTH_SUCCEED|HOST_STATE_FLAG_STATFS_AVAIL)) == (HOST_STATE_FLAG_AUTH_SUCCEED|HOST_STATE_FLAG_STATFS_AVAIL) && !is_expired(&h->statfs_cache_time, STATFS_EXPIRATION)); default: assert(0); return (0); } } static gfarm_error_t search_idle_try_host(struct search_idle_state *s, struct search_idle_host_state *h, int do_record) { gfarm_error_t e; int rv; struct search_idle_callback_closure *c; struct gfs_client_get_load_state *gls; /* already tried? */ if ((h->flags & HOST_STATE_FLAG_JUST_CACHED) != 0) return (GFARM_ERR_NO_ERROR); /* if we know the availability of this host, don't try */ if (search_idle_cache_should_be_used(h)) return (GFARM_ERR_NO_ERROR); /* We limit concurrency here */ rv = 0; while (s->concurrency >= CONCURRENCY) { rv = gfarm_eventqueue_turn(s->q, NULL); /* XXX - how to report this error? */ if (rv != 0 && rv != EAGAIN && rv != EINTR) { gflog_debug(GFARM_MSG_1001444, "search_idle_try_host: gfarm_eventqueue_turn: %s", strerror(rv)); return (gfarm_errno_to_error(rv)); } } GFARM_MALLOC(c); if (c == NULL) { gflog_debug(GFARM_MSG_1001445, "search_idle_try_host: no memory"); return (GFARM_ERR_NO_MEMORY); } c->state = s; c->h = h; c->do_record = do_record; h->flags |= HOST_STATE_FLAG_JUST_CACHED| HOST_STATE_FLAG_RTT_TRIED; gettimeofday(&h->rtt_cache_time, NULL); e = gfs_client_get_load_request_multiplexed(s->q, &h->addr, search_idle_load_callback, c, &gls); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001446, "search_idle_try_host: " "gfs_client_get_load_request_multiplexed: %s", gfarm_error_string(e)); free(c); return (GFARM_ERR_NO_ERROR); /* We won't report the error */ } c->protocol_state = gls; s->concurrency++; h->net->ongoing++; return (GFARM_ERR_NO_ERROR); } static void search_idle_in_networks(struct search_idle_state *s, int nnets, struct search_idle_network **nets) { int i; struct search_idle_host_state *h; gfarm_error_t e; int rv; /* see cached hosts with using `scheduled` field */ for (i = 0; i < nnets; i++) { for (h = nets[i]->candidate_list; h != NULL; h = h->next_in_the_net) { if (search_idle_cache_is_available(s, h)) { search_idle_record_host(s, h); h->flags |= HOST_STATE_FLAG_CACHE_WAS_USED; } } } if (search_idle_is_satisfied(s)) return; /* try hosts which aren't cached */ for (i = 0; i < nnets; i++) { for (h = nets[i]->candidate_list; h != NULL; h = h->next_in_the_net) { /* XXX report this error? */ e = search_idle_try_host(s, h, 1); if (search_idle_is_satisfied(s)) goto end_of_trial; } } end_of_trial: rv = gfarm_eventqueue_loop(s->q, NULL); /* XXX - report rv? */ if (search_idle_is_satisfied(s)) return; /* see cached hosts without using `scheduled` field */ for (i = 0; i < nnets; i++) { for (h = nets[i]->candidate_list; h != NULL; h = h->next_in_the_net) { if ((h->flags & HOST_STATE_FLAG_CACHE_WAS_USED) != 0) search_idle_forget_scheduled(s, h); } } } /* * 3. if there is at least one network which RTT isn't known yet, * examine the RTT. */ static void search_idle_examine_rtt_of_all_networks(struct search_idle_state *s) { gfarm_error_t e; int rv; struct search_idle_network *net; struct search_idle_host_state *h; int rtt_unknown, todo, all_tried; /* initialize cursor */ for (net = search_idle_network_list; net != NULL; net = net->next) net->cursor = net->candidate_list; for (;;) { do { todo = 0; rtt_unknown = 0; all_tried = 1; for (net = search_idle_network_list; net != NULL; net = net->next) { if ((net->flags & (NET_FLAG_SCHEDULING|NET_FLAG_RTT_AVAIL))!= NET_FLAG_SCHEDULING) continue; /* RTT is already known */ rtt_unknown = 1; if (net->cursor == NULL) continue; /* all hosts were tried */ all_tried = 0; if (net->ongoing >= PER_NET_CONCURRENCY) continue; h = net->cursor; /* XXX report this error? */ e = search_idle_try_host(s, h, 0); net->cursor = h->next_in_the_net; if (net->ongoing < PER_NET_CONCURRENCY && net->cursor != NULL) todo = 1; } } while (todo); if (!rtt_unknown || all_tried) break; rv = gfarm_eventqueue_turn(s->q, NULL); /* XXX - report rv? */ } rv = gfarm_eventqueue_loop(s->q, NULL); /* XXX - report rv? */ } /* * 4. search networks by RTT order. */ static gfarm_error_t search_idle_by_rtt_order(struct search_idle_state *s) { struct search_idle_network *net, **netarray; int nnets, rtt_threshold, i, j; nnets = 0; for (net = search_idle_network_list; net != NULL; net = net->next) { if (net == search_idle_local_net) /* already searched */ continue; if ((net->flags & (NET_FLAG_RTT_AVAIL | NET_FLAG_SCHEDULING)) == (NET_FLAG_RTT_AVAIL | NET_FLAG_SCHEDULING)) nnets++; } if (nnets <= 0) return (GFARM_ERR_NO_ERROR); GFARM_MALLOC_ARRAY(netarray, nnets); if (netarray == NULL) { gflog_debug(GFARM_MSG_1001447, "search_idle_by_rtt_order: no memory"); return (GFARM_ERR_NO_MEMORY); } i = 0; for (net = search_idle_network_list; net != NULL; net = net->next) { if (net == search_idle_local_net) /* already searched */ continue; if ((net->flags & (NET_FLAG_RTT_AVAIL | NET_FLAG_SCHEDULING)) == (NET_FLAG_RTT_AVAIL | NET_FLAG_SCHEDULING)) netarray[i++] = net; } /* sort hosts in order of RTT */ qsort(netarray, nnets, sizeof(*netarray), net_rtt_compare); for (i = 0; i < nnets; i = j) { /* search network which RTT is current*RTT_THRESH */ rtt_threshold = netarray[i]->rtt_usec * RTT_THRESH; for (j = i + 1; j < nnets && netarray[j]->rtt_usec < rtt_threshold; j++) ; /* search netarray[i ... (j-1)] */ search_idle_in_networks(s, j - i, &netarray[i]); if (search_idle_is_satisfied(s)) break; } free(netarray); return (GFARM_ERR_NO_ERROR); } /* `*nohostsp' is INPUT/OUTPUT parameter, and `*ohosts' is OUTPUT parameter */ static gfarm_error_t search_idle(int *nohostsp, char **ohosts, int *oports, int write_mode) { gfarm_error_t e; struct search_idle_state s; struct search_idle_host_state *h, **results; int i, n; gfarm_timerval_t t1, t2, t3, t4; GFARM_TIMEVAL_FIX_INITIALIZE_WARNING(t1); GFARM_TIMEVAL_FIX_INITIALIZE_WARNING(t2); GFARM_TIMEVAL_FIX_INITIALIZE_WARNING(t3); gfs_profile(gfarm_gettimerval(&t1)); e = search_idle_init_state(&s, *nohostsp, default_search_method, write_mode); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001448, "search_idle: search_idle_init_state: %s", gfarm_error_string(e)); return (e); } gfs_profile(gfarm_gettimerval(&t2)); /* * 2. at first, search hosts on the local network * (i.e. the same network with this client host). */ if (search_idle_local_net != NULL) search_idle_in_networks(&s, 1, &search_idle_local_net); gfs_profile(gfarm_gettimerval(&t3)); if (!search_idle_is_satisfied(&s)) { search_idle_examine_rtt_of_all_networks(&s); e = search_idle_by_rtt_order(&s); } gfs_profile(gfarm_gettimerval(&t4)); gfs_profile( gflog_info(GFARM_MSG_1000172, "(search_idle) init %f, local %f, all %f", gfarm_timerval_sub(&t2, &t1), gfarm_timerval_sub(&t3, &t2), gfarm_timerval_sub(&t4, &t3))); gfarm_eventqueue_free(s.q); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001449, "search_idle: search_idle_by_rtt_order: %s", gfarm_error_string(e)); return (e); } if (s.usable_hosts_number == 0) { gflog_debug(GFARM_MSG_1001450, "search_idle: no filesystem node"); return (GFARM_ERRMSG_NO_FILESYSTEM_NODE); } assert(s.available_hosts_number >= s.usable_hosts_number); GFARM_MALLOC_ARRAY(results, s.available_hosts_number); if (results == NULL) { gflog_debug(GFARM_MSG_1001451, "search_idle: no memory"); return (GFARM_ERR_NO_MEMORY); } i = 0; for (h = search_idle_candidate_list; h != NULL; h = h->next) if ((h->flags & HOST_STATE_FLAG_AVAILABLE) != 0) results[i++] = h; assert(i == s.available_hosts_number); if (write_mode) { /* sort in order of free disk space */ qsort(results, s.available_hosts_number, sizeof(*results), davail_compare); if (s.usable_hosts_number < s.desired_number) { n = s.usable_hosts_number; } else { assert(s.idle_hosts_number <= s.usable_hosts_number && s.semi_idle_hosts_number <= s.usable_hosts_number); /* sort in order of load average */ qsort(results, s.usable_hosts_number, sizeof(*results), loadavg_compare); if (s.idle_hosts_number < s.desired_number && s.semi_idle_hosts_number < s.enough_number) { n = s.desired_number; } else { if (s.idle_hosts_number >= s.desired_number) n = s.idle_hosts_number; else n = s.semi_idle_hosts_number; /* sort in order of free disk space */ qsort(results, n, sizeof(*results), davail_compare); } } } else { /* sort in order of load average */ qsort(results, s.available_hosts_number, sizeof(*results), loadavg_compare); n = s.available_hosts_number; } for (i = 0; i < n && i < s.desired_number; i++) { ohosts[i] = results[i]->return_value; oports[i] = results[i]->port; results[i]->scheduled++; } *nohostsp = i; free(results); return (GFARM_ERR_NO_ERROR); } static void hosts_expand_cyclic(int nsrchosts, char **srchosts, int *srcports, int ndsthosts, char **dsthosts, int *dstports) { int i, j; for (i = 0, j = 0; i < ndsthosts; i++, j++) { if (j >= nsrchosts) j = 0; dsthosts[i] = srchosts[j]; dstports[i] = dstports[j]; } } static gfarm_error_t search_idle_cyclic(int nohosts, char **ohosts, int *oports, int write_mode) { gfarm_error_t e; int nfound = nohosts; e = search_idle(&nfound, ohosts, oports, write_mode); if (e != GFARM_ERR_NO_ERROR) return (e); if (nfound == 0) return (GFARM_ERRMSG_NO_FILESYSTEM_NODE); if (nohosts > nfound) hosts_expand_cyclic(nfound, ohosts, oports, nohosts - nfound, &ohosts[nfound], &oports[nfound]); return (GFARM_ERR_NO_ERROR); } /* * If acyclic, *nohostsp is an input/output parameter, * otherwise *nohostsp is an input parameter. */ static gfarm_error_t select_hosts(struct gfm_connection *gfm_server, int acyclic, int write_mode, int ninfos, struct gfarm_host_sched_info *infos, int *nohostsp, char **ohosts, int *oports) { gfarm_error_t e; int i; gfarm_timerval_t t1, t2, t3, t4; GFARM_TIMEVAL_FIX_INITIALIZE_WARNING(t1); GFARM_TIMEVAL_FIX_INITIALIZE_WARNING(t2); GFARM_TIMEVAL_FIX_INITIALIZE_WARNING(t3); GFARM_TIMEVAL_FIX_INITIALIZE_WARNING(t4); /* * if !gfm_client_is_connection_valid(gfm_server) * gfm_client_username() shouldn't be called, */ if (!gfm_client_is_connection_valid(gfm_server)) { gflog_debug(GFARM_MSG_1001452, "select_hosts: connection cache was purged"); return (GFARM_ERR_STALE_FILE_HANDLE); } gfs_profile(gfarm_gettimerval(&t1)); e = search_idle_candidate_list_init(gfm_server); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001453, "gfarm_schedule_select_host: " "search_idle_candidate_list_init: %s", gfarm_error_string(e)); return (e); } gfs_profile(gfarm_gettimerval(&t2)); for (i = 0; i < ninfos; i++) { e = search_idle_candidate_list_add(gfm_server, &infos[i]); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001454, "gfarm_schedule_select_host: " "search_idle_candidate_list_add: %s", gfarm_error_string(e)); return (e); } } gfs_profile(gfarm_gettimerval(&t3)); if (acyclic) e = search_idle(nohostsp, ohosts, oports, write_mode); else e = search_idle_cyclic(*nohostsp, ohosts, oports, write_mode); if (e != GFARM_ERR_NO_ERROR) gflog_debug(GFARM_MSG_1001455, "gfarm_schedule_select_host: search result: %s", gfarm_error_string(e)); gfs_profile(gfarm_gettimerval(&t4)); gfs_profile( gflog_info(GFARM_MSG_1002417, "(select_hosts) init %f, add %f, schedule %f", gfarm_timerval_sub(&t2, &t1), gfarm_timerval_sub(&t3, &t2), gfarm_timerval_sub(&t4, &t3))); return (e); } gfarm_error_t gfarm_schedule_select_host(struct gfm_connection *gfm_server, int nhosts, struct gfarm_host_sched_info *infos, int write_mode, char **hostp, int *portp) { gfarm_error_t e; char *host; int port, n = 1; e = select_hosts(gfm_server, 1, write_mode, nhosts, infos, &n, &host, &port); if (e != GFARM_ERR_NO_ERROR) return (e); if (n == 0) { /* although this shouldn't happen */ gflog_debug(GFARM_MSG_1001456, "gfarm_schedule_select_host: no filesystem node"); return (GFARM_ERRMSG_NO_FILESYSTEM_NODE); } host = strdup(host); if (host == NULL) { gflog_debug(GFARM_MSG_1001457, "gfarm_schedule_select_host: no memory"); return (GFARM_ERR_NO_MEMORY); } *hostp = host; *portp = port; return (GFARM_ERR_NO_ERROR); } static gfarm_error_t select_hosts_by_path(const char *path, int acyclic, int write_mode, int ninfos, struct gfarm_host_sched_info *infos, int *nohostsp, char **ohosts, int *oports) { gfarm_error_t e; struct gfm_connection *gfm_server; if ((e = gfm_client_connection_and_process_acquire_by_path(path, &gfm_server)) != GFARM_ERR_NO_ERROR) return (e); e = select_hosts(gfm_server, acyclic, write_mode, ninfos, infos, nohostsp, ohosts, oports); gfm_client_connection_free(gfm_server); return (e); } /* * Select 'nohosts' hosts among 'nihosts' ihinfos in the order of * load average, and return to 'ohosts' and 'oports'. * When enough number of hosts are not available, the available hosts * will be listed in the cyclic manner. * NOTE: * each entry of ohosts[] is not strdup'ed but points ihinfos[], thus, * - DO NOT call free() against each entry of ohosts[]. * - DO NOT access ohosts[] after gfarm_host_sched_info_free(ihinfos). */ gfarm_error_t gfarm_schedule_hosts(const char *path, int nihosts, struct gfarm_host_sched_info *ihinfos, int nohosts, char **ohosts, int *oports) { return (select_hosts_by_path(path, 0, 0, nihosts, ihinfos, &nohosts, ohosts, oports)); } gfarm_error_t gfarm_schedule_hosts_to_write(const char *path, int nihosts, struct gfarm_host_sched_info *ihinfos, int nohosts, char **ohosts, int *oports) { return (select_hosts_by_path(path, 0, 1, nihosts, ihinfos, &nohosts, ohosts, oports)); } /* * Similar to 'gfarm_schedule_hosts()' except for the fact that * the available hosts will be listed only once even if enough number of * hosts are not available. */ gfarm_error_t gfarm_schedule_hosts_acyclic(const char *path, int nihosts, struct gfarm_host_sched_info *ihinfos, int *nohostsp, char **ohosts, int *oports) { return (select_hosts_by_path(path, 1, 0, nihosts, ihinfos, nohostsp, ohosts, oports)); } gfarm_error_t gfarm_schedule_hosts_acyclic_to_write(const char *path, int nihosts, struct gfarm_host_sched_info *ihinfos, int *nohostsp, char **ohosts, int *oports) { return (select_hosts_by_path(path, 1, 1, nihosts, ihinfos, nohostsp, ohosts, oports)); } /* this function shouldn't belong to this file, but... */ int gfm_host_is_in_local_net(struct gfm_connection *gfm_server, const char *host) { gfarm_error_t e; struct sockaddr addr; /* XXX it's desirable to use struct sockaddr in the scheduling cache */ /* XXX FIXME this port number (0) is dummy */ e = gfm_host_address_get(gfm_server, host, 0, &addr, NULL); if (e != GFARM_ERR_NO_ERROR) return (0); if (search_idle_local_net == NULL && search_idle_network_list_init(gfm_server) != GFARM_ERR_NO_ERROR) return (0); return (gfarm_hostspec_match(search_idle_local_net->network, NULL, &addr)); } /* * the following dump functions are for debuging purpose. */ void gfarm_schedule_network_cache_dump(void) { struct search_idle_network *n; char addr[GFARM_HOSTSPEC_STRLEN]; for (n = search_idle_network_list; n != NULL; n = n->next) { /* * the reason why we don't use inet_ntoa() here is * because inet_ntoa() uses static work area, so it cannot be * called for two instances (ip_min and ip_max) at once. */ gfarm_hostspec_to_string(n->network, addr, sizeof addr); if (n->flags & NET_FLAG_RTT_AVAIL) gflog_info(GFARM_MSG_1000174, "%s: RTT %d usec", addr, n->rtt_usec); else gflog_info(GFARM_MSG_1000175, "%s: RTT unavailable", addr); } } void gfarm_schedule_host_cache_dump(void) { struct gfarm_hash_iterator it; struct gfarm_hash_entry *entry; struct search_idle_host_state *h; char hostbuf[80]; char rttbuf[80]; char loadbuf[80]; char diskbuf[80]; char diskusedbuf[GFARM_INT64STRLEN]; char disktotalbuf[GFARM_INT64STRLEN]; struct timeval period; if (search_idle_hosts_state == NULL) { gflog_info(GFARM_MSG_1000176, ""); return; } gettimeofday(&period, NULL); period.tv_sec -= gfarm_schedule_cache_timeout; for (gfarm_hash_iterator_begin(search_idle_hosts_state, &it); !gfarm_hash_iterator_is_end(&it); gfarm_hash_iterator_next(&it)) { entry = gfarm_hash_iterator_access(&it); h = gfarm_hash_entry_data(entry); if (h->flags & HOST_STATE_FLAG_ADDR_AVAIL) { unsigned char *ip = (unsigned char *) &((struct sockaddr_in *)&h->addr)->sin_addr.s_addr; snprintf(hostbuf, sizeof hostbuf, "%s(%d.%d.%d.%d):%d %s", gfp_conn_hash_hostname(entry), ip[0], ip[1], ip[2], ip[3], h->port, gfp_conn_hash_username(entry)); } else { snprintf(hostbuf, sizeof hostbuf, "%s:%d %s", gfp_conn_hash_hostname(entry), h->port, gfp_conn_hash_username(entry)); } if ((h->flags & HOST_STATE_FLAG_RTT_TRIED) == 0) { snprintf(rttbuf, sizeof rttbuf, "RTT:no-try"); } else if ((h->flags & HOST_STATE_FLAG_RTT_AVAIL) == 0) { snprintf(rttbuf, sizeof rttbuf, "RTT(%d.%d%s):unavail", (int)h->rtt_cache_time.tv_sec, (int)h->rtt_cache_time.tv_usec, gfarm_timeval_cmp(&h->rtt_cache_time, &period) < 0 ? "*" : ""); } else { snprintf(rttbuf, sizeof rttbuf, "RTT(%d.%d%s):%du", (int)h->rtt_cache_time.tv_sec, (int)h->rtt_cache_time.tv_usec, gfarm_timeval_cmp(&h->rtt_cache_time, &period) < 0 ? "*" : "", h->rtt_usec); } if ((h->flags & (HOST_STATE_FLAG_RTT_AVAIL| HOST_STATE_FLAG_STATFS_AVAIL)) == 0) { snprintf(loadbuf, sizeof loadbuf, "load:unavail"); } else { snprintf(loadbuf, sizeof loadbuf, "load(%d.%d%s):%.2f", (int)h->loadavg_cache_time.tv_sec, (int)h->loadavg_cache_time.tv_usec, gfarm_timeval_cmp(&h->loadavg_cache_time, &period) < 0 ? "*" : "", h->loadavg); } if ((h->flags & HOST_STATE_FLAG_STATFS_AVAIL) == 0) { snprintf(diskbuf, sizeof diskbuf, "disk:unavail"); } else { gfarm_humanize_number(diskusedbuf, sizeof diskusedbuf, h->diskused, GFARM_HUMANIZE_BINARY); gfarm_humanize_number(disktotalbuf, sizeof disktotalbuf, h->diskused + h->diskavail, GFARM_HUMANIZE_BINARY); snprintf(diskbuf, sizeof diskbuf, "disk(%d.%d%s):%sB/%sB", (int)h->statfs_cache_time.tv_sec, (int)h->statfs_cache_time.tv_usec, gfarm_timeval_cmp(&h->statfs_cache_time, &period) < 0 ? "*" : "", diskusedbuf, disktotalbuf); } gflog_info(GFARM_MSG_1000177, "%s %s %s %s", hostbuf, rttbuf, loadbuf, diskbuf); } } void gfarm_schedule_cache_dump(void) { gflog_info(GFARM_MSG_1000178, "== network =="); gfarm_schedule_network_cache_dump(); gflog_info(GFARM_MSG_1000179, "== host =="); gfarm_schedule_host_cache_dump(); } #if 0 /* not yet in gfarm v2 */ /* * If acyclic, *nohostsp is an input/output parameter, * otherwise *nohostsp is an input parameter. */ static char * schedule_search_idle_common(int acyclic, int write_mode, int *nohostsp, char **ohosts) { char *e; int i, nihosts; struct gfarm_host_info *ihosts; e = gfarm_host_info_get_all(&nihosts, &ihosts); if (e != NULL) return (e); for (i = 0; i < nihosts; i++) { e = search_idle_candidate_list_add_host_info(&ihosts[i]); if (e != NULL) goto free_ihosts; } e = acyclic ? search_idle(nohostsp, ohosts, write_mode) : search_idle_cyclic(*nohostsp, ohosts, write_mode); if (e != NULL) goto free_ihosts; e = gfarm_fixedstrings_dup(*nohostsp, ohosts, ohosts); free_ihosts: gfarm_host_info_free_all(nihosts, ihosts); return (e); } static char * schedule_search_idle(int acyclic, int write_mode, char *program, const char *domainname, int *nohostsp, char **ohosts) { char *e = search_idle_candidate_list_init(); int program_filter_alloced = 0; if (e != NULL) return (e); if (program != NULL && gfarm_is_url(program)) { e = search_idle_set_program_filter(program); if (e != NULL) return (e); program_filter_alloced = 1; } if (domainname != NULL) search_idle_set_domain_filter(domainname); e = schedule_search_idle_common(acyclic, write_mode, nohostsp, ohosts); if (program_filter_alloced) search_idle_free_program_filter(); return (e); } char * gfarm_schedule_search_idle_by_all(int nohosts, char **ohosts) { return (schedule_search_idle(0, 0, NULL, NULL, &nohosts, ohosts)); } char * gfarm_schedule_search_idle_by_all_to_write(int nohosts, char **ohosts) { return (schedule_search_idle(0, 1, NULL, NULL, &nohosts, ohosts)); } /* * lists host names that contains domainname. */ char * gfarm_schedule_search_idle_by_domainname(const char *domainname, int nohosts, char **ohosts) { return (schedule_search_idle(0, 0, NULL, domainname, &nohosts, ohosts)); } char * gfarm_schedule_search_idle_by_domainname_to_write(const char *domainname, int nohosts, char **ohosts) { return (schedule_search_idle(0, 1, NULL, domainname, &nohosts, ohosts)); } char * gfarm_schedule_search_idle_acyclic_by_domainname(const char *domainname, int *nohostsp, char **ohosts) { return (schedule_search_idle(1, 0, NULL, domainname, nohostsp, ohosts)); } char * gfarm_schedule_search_idle_acyclic_by_domainname_to_write( const char *domainname, int *nohostsp, char **ohosts) { return (schedule_search_idle(1, 1, NULL, domainname, nohostsp, ohosts)); } char * gfarm_schedule_search_idle_by_program(char *program, int nohosts, char **ohosts) { return (schedule_search_idle(0, 0, program, NULL, &nohosts, ohosts)); } char * gfarm_schedule_search_idle_by_program_to_write(char *program, int nohosts, char **ohosts) { return (schedule_search_idle(0, 1, program, NULL, &nohosts, ohosts)); } static char * file_section_host_schedule_common(char *gfarm_file, char *section, int priority_to_local, int write_mode, char **hostp) { char *e, *self_name = NULL; int i, ncopies; struct gfarm_file_section_copy_info *copies; e = gfarm_file_section_copy_info_get_all_by_section( gfarm_file, section, &ncopies, &copies); if (e != NULL) return (e); if (ncopies == 0) return (GFARM_ERR_NO_REPLICA); /* * We don't honor gfarm_schedule_write_local_priority() * for the priority_to_local case. * because "write_local_priority" only applies to the case * where the file is newly created. */ if (priority_to_local && (write_mode ? gfarm_is_active_fsnode_to_write(0) : gfarm_is_active_fsnode()) && (e = gfarm_host_get_canonical_self_name(&self_name)) == NULL) { for (i = 0; i < ncopies; i++) { if (strcasecmp(self_name, copies[i].hostname) == 0) { *hostp = self_name; goto found_host; } } } for (i = 0; i < ncopies; i++) { e = search_idle_candidate_list_add_host(copies[i].hostname); if (e != NULL) goto free_copies; } e = search_idle_cyclic(1, hostp, write_mode); if (e != NULL) goto free_copies; found_host: e = gfarm_fixedstrings_dup(1, hostp, hostp); free_copies: gfarm_file_section_copy_info_free_all(ncopies, copies); return (e); } static char * file_section_host_schedule(char *gfarm_file, char *section, char *program, int priority_to_local, int write_mode, char **hostp) { char *e; int program_filter_alloced = 0; assert(!priority_to_local || program == NULL); /* otherwise not supported */ e = search_idle_candidate_list_init(); if (e != NULL) return (e); if (program != NULL && gfarm_is_url(program)) { e = search_idle_set_program_filter(program); if (e != NULL) return (e); program_filter_alloced = 1; } e = file_section_host_schedule_common(gfarm_file, section, priority_to_local, write_mode, hostp); if (program_filter_alloced) search_idle_free_program_filter(); return (e); } char * gfarm_file_section_host_schedule(char *gfarm_file, char *section, char **hostp) { return (file_section_host_schedule(gfarm_file, section, NULL, 0, 0, hostp)); } char * gfarm_file_section_host_schedule_to_write( char *gfarm_file, char *section, char **hostp) { return (file_section_host_schedule(gfarm_file, section, NULL, 0, 1, hostp)); } char * gfarm_file_section_host_schedule_by_program(char *gfarm_file, char *section, char *program, char **hostp) { return (file_section_host_schedule(gfarm_file, section, program, 0, 0, hostp)); } char * gfarm_file_section_host_schedule_by_program_to_write( char *gfarm_file, char *section, char *program, char **hostp) { return (file_section_host_schedule(gfarm_file, section, program, 0, 1, hostp)); } char * gfarm_file_section_host_schedule_with_priority_to_local( char *gfarm_file, char *section, char **hostp) { return (file_section_host_schedule(gfarm_file, section, NULL, 1, 0, hostp)); } char * gfarm_file_section_host_schedule_with_priority_to_local_to_write( char *gfarm_file, char *section, char **hostp) { return (file_section_host_schedule(gfarm_file, section, NULL, 1, 1, hostp)); } static char * url_hosts_schedule_common(const char *gfarm_url, int not_require_file_affinity, int write_mode, char *option, int *nhostsp, char ***hostsp) { char *e, *gfarm_file, **hosts, **residual; int i, nfrags, shortage; char section[GFARM_INT32STRLEN + 1]; e = gfarm_url_fragment_number(gfarm_url, &nfrags); if (e != NULL) return (e); e = gfarm_url_make_path(gfarm_url, &gfarm_file); if (e != NULL) return (e); GFARM_MALLOC_ARRAY(hosts, nfrags); if (hosts == NULL) { e = GFARM_ERR_NO_MEMORY; goto free_gfarm_file; } shortage = 0; for (i = 0; i < nfrags; i++) { sprintf(section, "%d", i); if ((e = search_idle_candidate_list_clear()) != NULL || (e = file_section_host_schedule_common( gfarm_file, section, 0, write_mode, &hosts[i])) != NULL) { if (not_require_file_affinity && e == GFARM_ERR_NO_HOST) { hosts[i] = NULL; shortage++; continue; } gfarm_strings_free_deeply(i, hosts); goto free_gfarm_file; } } if (shortage > 0) { assert(not_require_file_affinity); GFARM_MALLOC_ARRAY(residual, shortage); if (residual == NULL) { gfarm_strings_free_deeply(nfrags, hosts); e = GFARM_ERR_NO_MEMORY; goto free_gfarm_file; } e = search_idle_candidate_list_clear(); if (e == NULL) e = schedule_search_idle_common( 0, write_mode, &shortage, residual); if (e == NULL) e = gfarm_fixedstrings_dup(shortage,residual,residual); if (e != NULL) { free(residual); gfarm_strings_free_deeply(nfrags, hosts); goto free_gfarm_file; } for (i = 0; i < nfrags; i++) { if (hosts[i] == NULL) { hosts[i] = residual[--shortage]; if (shortage == 0) break; } } free(residual); } *nhostsp = nfrags; *hostsp = hosts; free_gfarm_file: free(gfarm_file); return (e); } char * gfarm_url_hosts_schedule(const char *gfarm_url, char *option, int *nhostsp, char ***hostsp) { char *e; e = search_idle_candidate_list_init(); if (e != NULL) return (e); return (url_hosts_schedule_common(gfarm_url, 0, 0, option, nhostsp, hostsp)); } char * gfarm_url_hosts_schedule_by_program( char *gfarm_url, char *program, char *option, int *nhostsp, char ***hostsp) { char *e; if (!gfarm_is_url(program)) return (gfarm_url_hosts_schedule(gfarm_url, option, nhostsp, hostsp)); e = search_idle_candidate_list_init(); if (e != NULL) return (e); e = search_idle_set_program_filter(program); if (e != NULL) return (e); e = url_hosts_schedule_common(gfarm_url, 1, 0, option, nhostsp, hostsp); search_idle_free_program_filter(); return (e); } static char * statfsnode(char *canonical_hostname, int use_cache, gfarm_int32_t *bsizep, file_offset_t *blocksp, file_offset_t *bfreep, file_offset_t *bavailp, file_offset_t *filesp, file_offset_t *ffreep, file_offset_t *favailp) { char *e, *e2; struct search_idle_host_state *h; e = search_idle_host_state_add_host(canonical_hostname, &h); if (e != NULL) return (e); if (!use_cache || (h->flags & HOST_STATE_FLAG_STATFS_AVAIL) == 0 || is_expired(&h->statfs_cache_time, STATFS_EXPIRATION)) { if ((h->flags & HOST_STATE_FLAG_ADDR_AVAIL) == 0) return (GFARM_ERR_UNKNOWN_HOST); e = gfs_client_statfs_with_reconnect_addr( canonical_hostname, &h->addr, ".", NULL, &e2, &h->bsize, &h->blocks, &h->bfree, &h->bavail, &h->files, &h->ffree, &h->favail); if (e != NULL || e2 != NULL) return (e != NULL ? e : e2); h->statfs_cache_time = search_idle_now; h->flags |= HOST_STATE_FLAG_AUTH_SUCCEED|HOST_STATE_FLAG_STATFS_AVAIL; } *bsizep = h->bsize; *blocksp = h->blocks; *bfreep = h->bfree; *bavailp = h->bavail; *filesp = h->files; *ffreep = h->ffree; *favailp = h->favail; return (NULL); } char * gfs_statfsnode(char *canonical_hostname, int *bsizep, file_offset_t *blocksp, file_offset_t *bfreep, file_offset_t *bavailp, file_offset_t *filesp, file_offset_t *ffreep, file_offset_t *favailp) { char *e; int bsize; e = statfsnode(canonical_hostname, 0, &bsize, blocksp, bfreep, bavailp, filesp, ffreep, favailp); if (e != NULL) return (e); *bsizep = bsize; return (NULL); } char * gfs_statfsnode_cached(char *canonical_hostname, int *bsizep, file_offset_t *blocksp, file_offset_t *bfreep, file_offset_t *bavailp, file_offset_t *filesp, file_offset_t *ffreep, file_offset_t *favailp) { char *e; struct search_idle_host_state *h; e = search_idle_host_state_add_host(canonical_hostname, &h); if (e != NULL) return (e); if ((h->flags & HOST_STATE_FLAG_ADDR_AVAIL) == 0) return (GFARM_ERR_UNKNOWN_HOST); if ((h->flags & HOST_STATE_FLAG_STATFS_AVAIL) == 0) return (GFARM_ERR_NO_SUCH_OBJECT); /* not cached */ *bsizep = h->bsize; *blocksp = h->blocks; *bfreep = h->bfree; *bavailp = h->bavail; *filesp = h->files; *ffreep = h->ffree; *favailp = h->favail; return (NULL); } int gfarm_is_active_fsnode(void) { return (gfarm_is_active_file_system_node); } int gfarm_is_active_fsnode_to_write(file_offset_t size) { char *e, *self_name; gfarm_int32_t bsize; file_offset_t blocks, bfree, bavail; file_offset_t files, ffree, favail; if (!gfarm_is_active_file_system_node) return (0); e = gfarm_host_get_canonical_self_name(&self_name); if (e != NULL) return (0); e = statfsnode(self_name, 1, &bsize, &blocks, &bfree, &bavail, &files, &ffree, &favail); if (size <= 0) size = gfarm_get_minimum_free_disk_space(); return (e == NULL && bavail * bsize >= size); } #endif gfarm-2.4.1/lib/libgfarm/gfarm/gfs_dirplusxattr.h0000644000000000000000000000047211507222724020517 0ustar rootroottypedef struct gfs_dirplusxattr *GFS_DirPlusXAttr; gfarm_error_t gfs_opendirplusxattr(const char *, GFS_DirPlusXAttr *); gfarm_error_t gfs_readdirplusxattr(GFS_DirPlusXAttr, struct gfs_dirent **, struct gfs_stat **, int *, char ***, void ***, size_t **); gfarm_error_t gfs_closedirplusxattr(GFS_DirPlusXAttr); gfarm-2.4.1/lib/libgfarm/gfarm/gfs_quota.c0000644000000000000000000000101311507222723017065 0ustar rootroot/* * $Id: gfs_quota.c 4312 2010-01-14 23:26:49Z takuya-i $ */ #include #include #define GFARM_INTERNAL_USE #include #include "config.h" #include "quota_info.h" void gfarm_quota_info_free(struct gfarm_quota_info *qi) { if (qi->name != NULL) free(qi->name); } void gfarm_quota_get_info_free(struct gfarm_quota_get_info *qi) { if (qi->name != NULL) free(qi->name); } void gfarm_quota_set_info_free(struct gfarm_quota_set_info *qi) { if (qi->name != NULL) free(qi->name); } gfarm-2.4.1/lib/libgfarm/gfarm/gfs_readlink.c0000644000000000000000000000225211507222723017533 0ustar rootroot#include #include #include #define GFARM_INTERNAL_USE #include #include "gfutil.h" #include "gfm_client.h" #include "config.h" #include "lookup.h" struct gfm_readlink_closure { char **srcp; }; static gfarm_error_t gfm_readlink_request(struct gfm_connection *gfm_server, void *closure) { gfarm_error_t e = gfm_client_readlink_request(gfm_server); if (e != GFARM_ERR_NO_ERROR) gflog_warning(GFARM_MSG_1000135, "readlink request; %s", gfarm_error_string(e)); return (e); } static gfarm_error_t gfm_readlink_result(struct gfm_connection *gfm_server, void *closure) { struct gfm_readlink_closure *c = closure; gfarm_error_t e = gfm_client_readlink_result(gfm_server, c->srcp); #if 0 /* DEBUG */ if (e != GFARM_ERR_NO_ERROR) gflog_debug(GFARM_MSG_1000136, "readlink result; %s", gfarm_error_string(e)); #endif return (e); } gfarm_error_t gfs_readlink(const char *path, char **srcp) { struct gfm_readlink_closure closure; closure.srcp = srcp; return (gfm_inode_op(path, GFARM_FILE_LOOKUP, gfm_readlink_request, gfm_readlink_result, gfm_inode_success_op_connection_free, NULL, &closure)); } gfarm-2.4.1/lib/libgfarm/gfarm/liberror.h0000644000000000000000000001434011507222723016731 0ustar rootroot/* * Non-standard errors. Gfarm library internal use only. * Compatibility shouldn't be assumed, * so, these errors shouldn't be used via network protocol. * */ enum gfarm_errmsg { GFARM_ERRMSG_BEGIN = 4096, /* must be > GFARM_ERR_NUMBER */ GFARM_ERRMSG_INCONSISTENT_RECOVERABLE = GFARM_ERRMSG_BEGIN, GFARM_ERRMSG_TOO_MANY_ERROR_DOMAIN, GFARM_ERRMSG_UNKNOWN_KEYWORD, GFARM_ERRMSG_UNKNOWN_AUTH_METHOD, /* refered only from gfarm/hostspec.c */ GFARM_ERRMSG_HOSTNAME_OR_IP_EXPECTED, GFARM_ERRMSG_INVALID_CHAR_IN_HOSTNAME, GFARM_ERRMSG_INVALID_CHAR_IN_IP, GFARM_ERRMSG_TOO_BIG_BYTE_IN_IP, GFARM_ERRMSG_IP_ADDRESS_EXPECTED, GFARM_ERRMSG_IP_ADDRESS_TOO_SHORT, GFARM_ERRMSG_TOO_BIG_NETMASK, GFARM_ERRMSG_INVALID_NAME_RECORD, GFARM_ERRMSG_REVERSE_LOOKUP_NAME_IS_NOT_RESOLVABLE, GFARM_ERRMSG_REVERSE_LOOKUP_NAME_DOES_NOT_MATCH, /* refered only from gfarm/param.c */ GFARM_ERRMSG_VALUE_IS_NOT_SPECIFIED, GFARM_ERRMSG_VALUE_IS_EMPTY, GFARM_ERRMSG_VALUE_IS_NOT_ALLOWED_FOR_BOOLEAN, GFARM_ERRMSG_INVALID_CHAR_IN_VALUE, GFARM_ERRMSG_UNKNOWN_PARAMETER, /* refered only from gfarm/sockopt.c */ GFARM_ERRMSG_GETPROTOBYNAME_FAILED, GFARM_ERRMSG_UNKNOWN_SOCKET_OPTION, /* refered only from gfarm/config.c */ GFARM_ERRMSG_MISSING_ARGUMENT, GFARM_ERRMSG_TOO_MANY_ARGUMENTS, GFARM_ERRMSG_INTEGER_EXPECTED, GFARM_ERRMSG_FLOATING_POINT_NUMBER_EXPECTED, GFARM_ERRMSG_INVALID_CHARACTER, GFARM_ERRMSG_ENABLED_OR_DISABLED_EXPECTED, GFARM_ERRMSG_INVALID_SYSLOG_PRIORITY_LEVEL, GFARM_ERRMSG_LOCAL_USER_REDEFIEND, GFARM_ERRMSG_GLOBAL_USER_REDEFIEND, GFARM_ERRMSG_LOCAL_GROUP_REDEFIEND, GFARM_ERRMSG_GLOBAL_GROUP_REDEFIEND, GFARM_ERRMSG_MISSING_LOCAL_USER, GFARM_ERRMSG_BACKEND_ALREADY_LDAP, GFARM_ERRMSG_BACKEND_ALREADY_POSTGRESQL, GFARM_ERRMSG_BACKEND_ALREADY_LOCALFS, GFARM_ERRMSG_UNTERMINATED_SINGLE_QUOTE, GFARM_ERRMSG_UNTERMINATED_DOUBLE_QUOTE, GFARM_ERRMSG_INCOMPLETE_ESCAPE, GFARM_ERRMSG_MISSING_1ST_AUTH_COMMAND_ARGUMENT, GFARM_ERRMSG_MISSING_2ND_AUTH_METHOD_ARGUMENT, GFARM_ERRMSG_MISSING_3RD_HOST_SPEC_ARGUMENT, GFARM_ERRMSG_UNKNOWN_AUTH_SUBCOMMAND, GFARM_ERRMSG_MISSING_NETPARAM_OPTION_ARGUMENT, GFARM_ERRMSG_MISSING_SOCKOPT_OPTION_ARGUMENT, GFARM_ERRMSG_MISSING_ADDRESS_ARGUMENT, GFARM_ERRMSG_MISSING_USER_MAP_FILE_ARGUMENT, GFARM_ERRMSG_MISSING_GROUP_MAP_FILE_ARGUMENT, GFARM_ERRMSG_MISSING_1ST_ARCHITECTURE_ARGUMENT, GFARM_ERRMSG_MISSING_2ND_HOST_SPEC_ARGUMENT, GFARM_ERRMSG_CANNOT_OPEN_CONFIG, /* refered only from gfarm/gfp_xdr.c */ GFARM_ERRMSG_GFP_XDR_SEND_INVALID_FORMAT_CHARACTER, GFARM_ERRMSG_GFP_XDR_RECV_INVALID_FORMAT_CHARACTER, GFARM_ERRMSG_GFP_XDR_VRPC_MISSING_RESULT_IN_FORMAT_STRING, GFARM_ERRMSG_GFP_XDR_VRPC_INVALID_FORMAT_CHARACTER, /* refered only from gfarm/auth_common.c */ GFARM_ERRMSG_SHAREDSECRET_INVALID_EXPIRE_FIELD, GFARM_ERRMSG_SHAREDSECRET_INVALID_KEY_FIELD, GFARM_ERRMSG_SHAREDSECRET_KEY_FILE_NOT_EXIST, /* refered only from gfarm/auth_client.c */ GFARM_ERRMSG_AUTH_METHOD_NOT_AVAILABLE_FOR_THE_HOST, GFARM_ERRMSG_USABLE_AUTH_METHOD_IS_NOT_CONFIGURED, GFARM_ERRMSG_AUTH_REQUEST_SHAREDSECRET_IMPLEMENTATION_ERROR, GFARM_ERRMSG_AUTH_REQUEST_IMPLEMENTATION_ERROR, GFARM_ERRMSG_AUTH_REQUEST_SHAREDSECRET_MULTIPLEXED_IMPLEMENTATION_ERROR, GFARM_ERRMSG_AUTH_REQUEST_MULTIPLEXED_MPLEMENTATION_ERROR, /* refered only from gfarm/auth_server.c */ GFARM_ERRMSG_AUTH_SHAREDSECRET_MD5_CONTINUE, /* refered only from gfarm/auth_client_gsi.c */ GFARM_ERRMSG_GSI_CREDENTIAL_INITIALIZATION_FAILED, GFARM_ERRMSG_GSI_INITIALIZATION_FAILED, GFARM_ERRMSG_CANNOT_INITIATE_GSI_CONNECTION, GFARM_ERRMSG_CANNOT_ACQUIRE_CLIENT_CRED, /* refered only from gfarm/auth_config.c */ GFARM_ERRMSG_UNKNOWN_CREDENTIAL_TYPE, /* refered only from gfarm/io_gfsl.c */ GFARM_ERRMSG_GSI_DELEGATED_CREDENTIAL_NOT_EXIST, GFARM_ERRMSG_GSI_DELEGATED_CREDENTIAL_CANNOT_EXPORT, /* refered only from gfarm/gfs_client.c */ GFARM_ERRMSG_GFSD_ABORTED, GFARM_ERRMSG_GFSD_DESCRIPTOR_ILLEGAL, GFARM_ERRMSG_GFSD_REPLY_UNKNOWN, GFARM_ERRMSG_GFS_PROTO_PREAD_PROTOCOL, GFARM_ERRMSG_GFS_PROTO_PWRITE_PROTOCOL, /* refered from gfarm/gfs_pio.c and related modules */ GFARM_ERRMSG_GFS_PIO_IS_EOF, /* refered only from gfarm/glob.c */ GFARM_ERRMSG_GFS_GLOB_NOT_PROPERLY_INITIALIZED, /* refered only from gfarm/schedule.c */ GFARM_ERRMSG_NO_FILESYSTEM_NODE, /* refered only from gfarm/auth_common_gsi.c */ GFARM_ERRMSG_CRED_TYPE_DEFAULT_INVALID_CRED_NAME, GFARM_ERRMSG_CRED_TYPE_DEFAULT_INVALID_CRED_SERVICE, GFARM_ERRMSG_CRED_TYPE_DEFAULT_INTERNAL_ERROR, GFARM_ERRMSG_CRED_TYPE_NO_NAME_INVALID_CRED_NAME, GFARM_ERRMSG_CRED_TYPE_NO_NAME_INVALID_CRED_SERVICE, GFARM_ERRMSG_CRED_TYPE_MECHANISM_SPECIFIC_INVALID_CRED_NAME, GFARM_ERRMSG_CRED_TYPE_MECHANISM_SPECIFIC_INVALID_CRED_SERVICE, GFARM_ERRMSG_CRED_TYPE_USER_CRED_INVALID_CRED_SERVICE, GFARM_ERRMSG_CRED_TYPE_SELF_CRED_INVALID_CRED_NAME, GFARM_ERRMSG_CRED_TYPE_SELF_CRED_INVALID_CRED_SERVICE, GFARM_ERRMSG_CRED_TYPE_SELF_NOT_INITIALIZED_AS_AN_INITIATOR, GFARM_ERRMSG_INVALID_CRED_TYPE, GFARM_ERRMSG_INVALID_CREDENTIAL_CONFIGURATION, /* refered only from gfarm/import_help.c */ GFARM_ERRMSG_HOSTNAME_EXPECTED, GFARM_ERRMSG_EMPTY_FILE, GFARM_ERRMSG_END }; /* * Dynamically assigned error code for foreign systems (e.g. UNIX, LDAP, ...). * Compatibility shouldn't be assumed, * so, these errors shouldn't be used via network protocol. * All values will become > GFARM_ERR_FOREIGN_BEGIN * This range can be allocated by gfarm_error_domain_alloc(). */ #define GFARM_ERR_FOREIGN_BEGIN 65536 /* * Statically assigned error code range for private implementations. * Since the range is statically assigned, it can be used via network protocol. * The range must be >= GFARM_ERR_PRIVATE_BEGIN * This range can be allocated by gfarm_error_range_alloc(). */ #define GFARM_ERR_PRIVATE_BEGIN 0x70000000 struct gfarm_error_domain; gfarm_error_t gfarm_error_domain_alloc(int, int, const char *(*)(void *, int), void *, struct gfarm_error_domain **); gfarm_error_t gfarm_error_range_alloc(int, int, const char *(*)(void *, int), void *, struct gfarm_error_domain **); gfarm_error_t gfarm_error_domain_add_map(struct gfarm_error_domain *, int, gfarm_error_t); gfarm_error_t gfarm_error_domain_add_message(struct gfarm_error_domain *, int, const char *); gfarm_error_t gfarm_error_domain_map(struct gfarm_error_domain *, int); gfarm-2.4.1/lib/libgfarm/gfarm/gfs_dirplus.c0000644000000000000000000000712211507222723017425 0ustar rootroot#include #include #include #include "gfutil.h" #include "config.h" #include "gfm_client.h" #include "gfs_io.h" /* * gfs_opendirplus()/readdirplus()/closedirplus() */ #define DIRENTSPLUS_BUFCOUNT 256 struct gfs_dirplus { struct gfm_connection *gfm_server; int fd; struct gfs_dirent buffer[DIRENTSPLUS_BUFCOUNT]; struct gfs_stat stbuf[DIRENTSPLUS_BUFCOUNT]; int n, index; }; static gfarm_error_t gfs_dirplus_alloc(struct gfm_connection *gfm_server, gfarm_int32_t fd, GFS_DirPlus *dirp) { GFS_DirPlus dir; GFARM_MALLOC(dir); if (dir == NULL) { gflog_debug(GFARM_MSG_1001277, "allocation of dir failed: %s", gfarm_error_string(GFARM_ERR_NO_MEMORY)); return (GFARM_ERR_NO_MEMORY); } dir->gfm_server = gfm_server; dir->fd = fd; dir->n = dir->index = 0; *dirp = dir; return (GFARM_ERR_NO_ERROR); } static void gfs_dirplus_clear(GFS_DirPlus dir) { int i, n = dir->n; for (i = 0; i < n; i++) gfs_stat_free(&dir->stbuf[i]); dir->n = dir->index = 0; } gfarm_error_t gfs_opendirplus(const char *path, GFS_DirPlus *dirp) { gfarm_error_t e; struct gfm_connection *gfm_server; int fd, type; if ((e = gfm_open_fd(path, GFARM_FILE_RDONLY, &gfm_server, &fd, &type)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001278, "gfm_open_fd(%s) failed: %s", path, gfarm_error_string(e)); return (e); } if (type != GFS_DT_DIR) e = GFARM_ERR_NOT_A_DIRECTORY; else if ((e = gfs_dirplus_alloc(gfm_server, fd, dirp)) == GFARM_ERR_NO_ERROR) return (GFARM_ERR_NO_ERROR); if (e == GFARM_ERR_NOT_A_DIRECTORY) gflog_debug(GFARM_MSG_1001279, "Not a directory (%s): %s", path, gfarm_error_string(e)); else if (e != GFARM_ERR_NO_ERROR) gflog_debug(GFARM_MSG_1001280, "allocation of dirplus for path (%s) failed: %s", path, gfarm_error_string(e)); (void)gfm_close_fd(gfm_server, fd); /* ignore result */ gfm_client_connection_free(gfm_server); return (e); } static gfarm_error_t gfm_getdirentsplus_request(struct gfm_connection *gfm_server, void *closure) { gfarm_error_t e = gfm_client_getdirentsplus_request( gfm_server, DIRENTSPLUS_BUFCOUNT); if (e != GFARM_ERR_NO_ERROR) gflog_warning(GFARM_MSG_1000090, "getdirentsplus request: %s", gfarm_error_string(e)); return (e); } static gfarm_error_t gfm_getdirentsplus_result(struct gfm_connection *gfm_server, void *closure) { GFS_DirPlus dir = closure; gfarm_error_t e = gfm_client_getdirentsplus_result(gfm_server, &dir->n, dir->buffer, dir->stbuf); if (e != GFARM_ERR_NO_ERROR) gflog_warning(GFARM_MSG_1000091, "getdirentsplus result: %s", gfarm_error_string(e)); return (e); } /* * both (*entryp) and (*status) shouldn't be freed. */ gfarm_error_t gfs_readdirplus(GFS_DirPlus dir, struct gfs_dirent **entry, struct gfs_stat **status) { gfarm_error_t e; if (dir->index >= dir->n) { gfs_dirplus_clear(dir); e = gfm_client_compound_fd_op(dir->gfm_server, dir->fd, gfm_getdirentsplus_request, gfm_getdirentsplus_result, NULL, dir); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001281, "gfs_client_compound_fd_op() failed: %s", gfarm_error_string(e)); return (e); } if (dir->n == 0) { *entry = NULL; *status = NULL; return (GFARM_ERR_NO_ERROR); } dir->index = 0; } *entry = &dir->buffer[dir->index]; *status = &dir->stbuf[dir->index]; dir->index++; return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfs_closedirplus(GFS_DirPlus dir) { gfarm_error_t e = gfm_close_fd(dir->gfm_server, dir->fd); gfm_client_connection_free(dir->gfm_server); gfs_dirplus_clear(dir); free(dir); return (e); } gfarm-2.4.1/lib/libgfarm/gfarm/gfs_replica.c0000644000000000000000000000601711507222724017365 0ustar rootroot/* * $Id$ */ #include /* config.h needs FILE */ #include #include #define GFARM_INTERNAL_USE #include #include "gfutil.h" #include "gfm_client.h" #include "config.h" #include "lookup.h" struct gfm_replica_list_by_name_closure { gfarm_int32_t n; char **hosts; }; static gfarm_error_t gfm_replica_list_by_name_request(struct gfm_connection *gfm_server, void *closure) { gfarm_error_t e = gfm_client_replica_list_by_name_request(gfm_server); if (e != GFARM_ERR_NO_ERROR) gflog_warning(GFARM_MSG_1000151, "replica_list_by_name request: %s", gfarm_error_string(e)); return (e); } static gfarm_error_t gfm_replica_list_by_name_result(struct gfm_connection *gfm_server, void *closure) { struct gfm_replica_list_by_name_closure *c = closure; gfarm_error_t e = gfm_client_replica_list_by_name_result( gfm_server, &c->n, &c->hosts); #if 1 /* DEBUG */ if (e != GFARM_ERR_NO_ERROR) gflog_debug(GFARM_MSG_1000152, "replica_list_by_name result: %s", gfarm_error_string(e)); #endif return (e); } static void gfm_replica_list_by_name_cleanup(struct gfm_connection *gfm_server, void *closure) { struct gfm_replica_list_by_name_closure *c = closure; int i; for (i = 0; i < c->n; i++) free(c->hosts[i]); free(c->hosts); } gfarm_error_t gfs_replica_list_by_name(const char *path, int *np, char ***hostsp) { gfarm_error_t e; struct gfm_replica_list_by_name_closure closure; e = gfm_inode_op(path, GFARM_FILE_LOOKUP, gfm_replica_list_by_name_request, gfm_replica_list_by_name_result, gfm_inode_success_op_connection_free, gfm_replica_list_by_name_cleanup, &closure); if (e == GFARM_ERR_NO_ERROR) { *np = closure.n; *hostsp = closure.hosts; } else { gflog_debug(GFARM_MSG_1001383, "gfm_inode_op(%s) failed: %s", path, gfarm_error_string(e)); } return (e); } struct gfm_replica_remove_by_file_closure { const char *host; }; static gfarm_error_t gfm_replica_remove_by_file_request(struct gfm_connection *gfm_server, void *closure) { struct gfm_replica_remove_by_file_closure *c = closure; gfarm_error_t e = gfm_client_replica_remove_by_file_request(gfm_server, c->host); if (e != GFARM_ERR_NO_ERROR) gflog_warning(GFARM_MSG_1000153, "replica_remove_by_file request: %s", gfarm_error_string(e)); return (e); } static gfarm_error_t gfm_replica_remove_by_file_result(struct gfm_connection *gfm_server, void *closure) { gfarm_error_t e = gfm_client_replica_remove_by_file_result(gfm_server); #if 1 /* DEBUG */ if (e != GFARM_ERR_NO_ERROR) gflog_debug(GFARM_MSG_1000154, "replica_remove_by_file result: %s", gfarm_error_string(e)); #endif return (e); } gfarm_error_t gfs_replica_remove_by_file(const char *path, const char *host) { struct gfm_replica_remove_by_file_closure closure; closure.host = host; return (gfm_inode_op(path, GFARM_FILE_LOOKUP, gfm_replica_remove_by_file_request, gfm_replica_remove_by_file_result, gfm_inode_success_op_connection_free, NULL, &closure)); } gfarm-2.4.1/lib/libgfarm/gfarm/gfs_pio_global.c0000644000000000000000000003446711507222723020066 0ustar rootroot/* * pio operations for global view * * $Id: gfs_pio_global.c 4418 2010-02-17 07:04:35Z ookuma $ */ #include #include #include #include #include #include "gfs_proto.h" /* GFARM_FILE_CREATE */ #include "gfs_io.h" #include "gfs_pio.h" struct gfs_file_global_context { GFS_File fragment_gf; int fragment_index; char *url; gfarm_off_t *offsets; }; static gfarm_error_t gfs_pio_view_global_close(GFS_File gf) { struct gfs_file_global_context *gc = gf->view_context; gfarm_error_t e; e = gfs_pio_close_internal(gc->fragment_gf); free(gc->url); free(gc->offsets); free(gc); gf->view_context = NULL; gfs_pio_set_view_default(gf); return (e); } /* * Instead of just calling gfs_pio_set_view_index(), * we use another GFS_File to move to another fragment. * This is because we don't want to leave this context inconsistent, * if failure happens at the gfs_pio_set_view_index(). */ static gfarm_error_t gfs_pio_view_global_move_to(GFS_File gf, int fragment_index) { struct gfs_file_global_context *gc = gf->view_context; gfarm_error_t e; GFS_File new_fragment; if ((gf->open_flags & GFARM_FILE_CREATE) != 0) e = gfs_pio_create(gc->url, gf->open_flags, gf->pi.status.st_mode & GFARM_S_ALLPERM, &new_fragment); else e = gfs_pio_open(gc->url, gf->open_flags, &new_fragment); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_UNFIXED, "gfs_pio_create() or gfs_pio_open() for URL(%s) " "failed: %s", gc->url, gfarm_error_string(e)); return (e); } e = gfs_pio_set_view_index(new_fragment, gf->pi.status.st_nsections, fragment_index, NULL, gf->view_flags); if (e != GFARM_ERR_NO_ERROR) { gfs_pio_close_internal(new_fragment); gflog_debug(GFARM_MSG_UNFIXED, "gfs_pio_set_view_index() failed: %s", gfarm_error_string(e)); return (e); } if (gc->fragment_gf != NULL) { gfs_pio_close_internal(gc->fragment_gf); /* XXX need a way to report error on here */ } gc->fragment_gf = new_fragment; gc->fragment_index = fragment_index; return (GFARM_ERR_NO_ERROR); } static gfarm_error_t gfs_pio_view_global_adjust(GFS_File gf, const char *buffer, size_t *sizep) { struct gfs_file_global_context *gc = gf->view_context; size_t size = *sizep; gfarm_error_t e = GFARM_ERR_NO_ERROR; while (gc->fragment_index < gf->pi.status.st_nsections - 1 && gf->io_offset >= gc->offsets[gc->fragment_index + 1]) { e = gfs_pio_view_global_move_to(gf, gc->fragment_index + 1); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_UNFIXED, "gfs_pio_view_global_move_to() failed: %s", gfarm_error_string(e)); return (e); } } if (gc->fragment_index < gf->pi.status.st_nsections - 1 && gf->io_offset + size > gc->offsets[gc->fragment_index + 1]) size = gc->offsets[gc->fragment_index + 1] - gf->io_offset; *sizep = size; return (e); } static gfarm_error_t gfs_pio_view_global_write(GFS_File gf, const char *buffer, size_t size, size_t *lengthp) { struct gfs_file_global_context *gc = gf->view_context; gfarm_error_t e = gfs_pio_view_global_adjust(gf, buffer, &size); int length; /* XXX - should be size_t */ if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_UNFIXED, "gfs_pio_view_global_adjust() failed: %s", gfarm_error_string(e)); return (e); } e = gfs_pio_write(gc->fragment_gf, buffer, size, &length); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_UNFIXED, "gfs_pio_write() failed: %s", gfarm_error_string(e)); return (e); } /* XXX - should notify this change to all of the parallel process. */ if (gc->fragment_index == gf->pi.status.st_nsections - 1 && gf->io_offset + length > gc->offsets[gf->pi.status.st_nsections]) gc->offsets[gf->pi.status.st_nsections] = gf->io_offset + length; *lengthp = length; return (GFARM_ERR_NO_ERROR); } static gfarm_error_t gfs_pio_view_global_read(GFS_File gf, char *buffer, size_t size, size_t *lengthp) { struct gfs_file_global_context *gc = gf->view_context; gfarm_error_t e = gfs_pio_view_global_adjust(gf, buffer, &size); int length; /* XXX - should be size_t */ if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_UNFIXED, "gfs_pio_view_global_adjust() failed: %s", gfarm_error_string(e)); return (e); } e = gfs_pio_read(gc->fragment_gf, buffer, size, &length); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_UNFIXED, "gfs_pio_read() failed: %s", gfarm_error_string(e)); return (e); } *lengthp = length; return (GFARM_ERR_NO_ERROR); } static int gfs_pio_view_global_bsearch(gfarm_off_t key, gfarm_off_t *v, size_t n) { size_t m, l = 0, r = n - 1; while (l < r) { m = (l + r) / 2; if (key < v[m]) r = m - 1; else if (key < v[m + 1]) return (m); else l = m + 1; } return (l); } static gfarm_error_t gfs_pio_view_global_seek(GFS_File gf, gfarm_off_t offset, int whence, gfarm_off_t *resultp) { struct gfs_file_global_context *gc = gf->view_context; gfarm_error_t e; int fragment; switch (whence) { case SEEK_SET: break; case SEEK_CUR: offset += gf->io_offset + gf->p; break; case SEEK_END: offset += gc->offsets[gf->pi.status.st_nsections]; break; } if (gc->offsets[gc->fragment_index] <= offset && offset <= gc->offsets[gc->fragment_index + 1]) { /* same file fragment */ if (offset == gf->io_offset) return (GFARM_ERR_NO_ERROR); } else { if (offset < 0) { gflog_debug(GFARM_MSG_UNFIXED, "Invalid offset (%d): %s", offset, gfarm_error_string( GFARM_ERR_INVALID_ARGUMENT)); return (GFARM_ERR_INVALID_ARGUMENT); } if (offset >= gc->offsets[gf->pi.status.st_nsections - 1]) fragment = gf->pi.status.st_nsections - 1; else fragment = gfs_pio_view_global_bsearch( offset, gc->offsets, gf->pi.status.st_nsections-1); e = gfs_pio_view_global_move_to(gf, fragment); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_UNFIXED, "gfs_pio_view_global_move_to() failed: %s", gfarm_error_string(e)); return (e); } } offset -= gc->offsets[gc->fragment_index]; e = gfs_pio_seek(gc->fragment_gf, offset, SEEK_SET, &offset); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_UNFIXED, "gfs_pio_seek() failed: %s", gfarm_error_string(e)); return (e); } if (resultp != NULL) *resultp = gc->offsets[gc->fragment_index] + offset; return (GFARM_ERR_NO_ERROR); } static gfarm_error_t gfs_pio_view_global_ftruncate(GFS_File gf, gfarm_off_t length) { struct gfs_file_global_context *gc = gf->view_context; gfarm_error_t e; int i, fragment, nsections; gfarm_off_t section_length; struct gfarm_file_section_info *sections; char section_string[GFARM_INT32STRLEN + 1]; if (length < 0) { gflog_debug(GFARM_MSG_UNFIXED, "Invalid length (%d): %s", length, gfarm_error_string(e)); return (GFARM_ERR_INVALID_ARGUMENT); } if (length >= gc->offsets[gf->pi.status.st_nsections - 1]) fragment = gf->pi.status.st_nsections - 1; else fragment = gfs_pio_view_global_bsearch( length, gc->offsets, gf->pi.status.st_nsections - 1); section_length = length - gc->offsets[fragment]; e = gfs_pio_view_global_move_to(gf, fragment); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_UNFIXED, "gfs_pio_view_global_move_to() failed: %s", gfarm_error_string(e)); return (e); } e = gfs_pio_truncate(gc->fragment_gf, section_length); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_UNFIXED, "gfs_pio_truncate() failed: %s", gfarm_error_string(e)); return (e); } /* * Before updating path_info, try to update most recent information, * because the file mode may be updated by e.g. gfs_chmod(). */ if (gfarm_path_info_get(gf->pi.pathname, &pi) == NULL) { gfarm_path_info_free(&gf->pi); gf->pi = pi; } #if 0 /* We don't store file size in gfarm_path_info, this is just ignored */ gf->pi.status.st_size = length; #endif gf->pi.status.st_nsections = fragment + 1; e = gfarm_path_info_replace(gf->pi.pathname, &gf->pi); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_UNFIXED, "gfarm_path_info_replace() failed: %s", gfarm_error_string(e)); return (e); } e = gfarm_file_section_info_get_sorted_all_serial_by_file( gf->pi.pathname, &nsections, §ions); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_UNFIXED, "gfarm_file_section_info_get_sorted_all_serial_" "by_file() failed: %s", gfarm_error_string(e)); return (e); } sections[fragment].filesize = section_length; sprintf(section_string, "%d", fragment); e = gfarm_file_section_info_replace(gf->pi.pathname, section_string, §ions[fragment]); for (i = fragment + 1; i < nsections; i++) (void)gfs_unlink_section_internal(gf->pi.pathname, sections[i].section); gfarm_file_section_info_free_all(nsections, sections); return (e); } static gfarm_error_t gfs_pio_view_global_fsync(GFS_File gf, int operation) { struct gfs_file_global_context *gc = gf->view_context; gfarm_error_t e = GFARM_ERR_NO_ERROR; int i; for (i = 0; i < gf->pi.status.st_nsections; i++) { e = gfs_pio_view_global_move_to(gf, i); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_UNFIXED, "gfs_pio_view_global_move_to() failed: %s", gfarm_error_string(e)); return (e); } switch (operation) { case GFS_PROTO_FSYNC_WITHOUT_METADATA: e = gfs_pio_datasync(gc->fragment_gf); break; case GFS_PROTO_FSYNC_WITH_METADATA: e = gfs_pio_sync(gc->fragment_gf); break; default: e = GFARM_ERR_INVALID_ARGUMENT; break; } if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_UNFIXED, "operation failed: %s", gfarm_error_string(e)); return (e); } } return (e); } static int gfs_pio_view_global_fd(GFS_File gf) { struct gfs_file_global_context *gc = gf->view_context; return (gfs_pio_fileno(gc->fragment_gf)); } static gfarm_error_t gfs_pio_view_global_stat(GFS_File gf, struct gfs_stat *status) { struct gfs_file_global_context *gc = gf->view_context; return (gfs_stat(gc->url, status)); } static gfarm_error_t gfs_pio_view_global_chmod(GFS_File gf, gfarm_mode_t mode) { return (gfs_chmod_internal(&gf->pi, mode, NULL)); } struct gfs_pio_ops gfs_pio_view_global_ops = { gfs_pio_view_global_close, gfs_pio_view_global_fd, gfs_pio_view_global_pread, gfs_pio_view_global_pwrite, gfs_pio_view_global_ftruncate, gfs_pio_view_global_fsync, }; gfarm_error_t gfs_pio_set_view_global(GFS_File gf, int flags) { struct gfs_file_global_context *gc; gfarm_error_t e; char *arch; int i, n; struct gfarm_file_section_info *infos; static char gfarm_url_prefix[] = "gfarm:/"; e = gfs_pio_set_view_default(gf); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_UNFIXED, "gfs_pio_set_view_default() failed: %s", gfarm_error_string(e)); return (e); } if (GFS_FILE_IS_PROGRAM(gf)) { e = gfarm_host_get_self_architecture(&arch); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_UNFIXED, "gfarm_host_get_self_architecture() failed: %s", gfarm_error_string(e)); return (gf->error = e); } e = gfs_pio_set_view_section(gf, arch, NULL, flags); if (e == GFARM_ERR_NO_SUCH_OBJECT) e = gfs_pio_set_view_section( gf, "noarch", NULL, flags); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_UNFIXED, "gfs_pio_set_view_section() failed: %s", gfarm_error_string(e)); } return (e); } if ((gf->mode & GFS_FILE_MODE_FILE_WAS_CREATED) != 0) return (gfs_pio_set_view_index(gf, 1, 0, NULL, flags)); if (gf->open_flags & GFARM_FILE_TRUNC) { int nsections; struct gfarm_file_section_info *sections; /* XXX this may not be OK, if a parallel process does this */ /* remove all sections except section "0" */ e = gfarm_file_section_info_get_all_by_file(gf->pi.pathname, &nsections, §ions); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_UNFIXED, "gfarm_file_section_info_get_all_by_file() " "failed: %s", gfarm_error_string(e)); return (e); } for (i = 0; i < nsections; i++) { if (strcmp(sections[i].section, "0") == 0) continue; (void)gfs_unlink_section_internal(gf->pi.pathname, sections[i].section); } gfarm_file_section_info_free_all(nsections, sections); gf->pi.status.st_nsections = 1; return (gfs_pio_set_view_index(gf, 1, 0, NULL, flags)); } /* XXX - GFARM_FILE_APPEND is not supported */ if (gf->open_flags & GFARM_FILE_APPEND) { gf->error = GFARM_ERR_OPERATION_NOT_SUPPORTED; gflog_debug(GFARM_MSG_UNFIXED, "GFARM_FILE_APPEND is not supported: %s", gfarm_error_string(gf->error)); return (gf->error); } GFARM_MALLOC(gc); if (gc == NULL) { gf->error = GFARM_ERR_NO_MEMORY; gflog_debug(GFARM_MSG_UNFIXED, "allocation of global context failed: %s", gfarm_error_string(gf->error)); return (gf->error); } e = gfarm_file_section_info_get_sorted_all_serial_by_file( gf->pi.pathname, &n, &infos); if (e != GFARM_ERR_NO_ERROR) { free(gc); gf->error = e; gflog_debug(GFARM_MSG_UNFIXED, "gfarm_file_section_info_get_sorted_all_serial_" "by_file() failed: %s", gfarm_error_string(e)); return (e); } if (n != gf->pi.status.st_nsections) { gfarm_file_section_info_free_all(n, infos); free(gc); gf->error = "metainfo inconsitency, fragment number mismatch"; gflog_debug(GFARM_MSG_UNFIXED, gf->error); return (gf->error); } GFARM_MALLOC_ARRAY(gc->offsets, n + 1); GFARM_MALLOC_ARRAY(gc->url, sizeof(gfarm_url_prefix) + strlen(gf->pi.pathname)); if (gc->offsets == NULL || gc->url == NULL) { if (gc->offsets != NULL) free(gc->offsets); if (gc->url != NULL) free(gc->url); gfarm_file_section_info_free_all(n, infos); free(gc); gf->error = GFARM_ERR_NO_MEMORY; gflog_debug(GFARM_MSG_UNFIXED, "allocation of 'gc->offsets' or 'gc->url' failed: %s", gfarm_error_string(gf->error)); return (gf->error); } gc->offsets[0] = 0; for (i = 0; i < n; i++) gc->offsets[i + 1] = gc->offsets[i] + infos[i].filesize; gfarm_file_section_info_free_all(n, infos); sprintf(gc->url, "%s%s", gfarm_url_prefix, gf->pi.pathname); gf->view_context = gc; gf->view_flags = flags; gc->fragment_gf = NULL; e = gfs_pio_view_global_move_to(gf, 0); if (e != GFARM_ERR_NO_ERROR) { free(gc->url); free(gc->offsets); free(gc); gf->view_context = NULL; gfs_pio_set_view_default(gf); gf->error = e; gflog_debug(GFARM_MSG_UNFIXED, "gfs_pio_view_global_move_to() failed: %s", gfarm_error_string(e)); return (e); } gf->ops = &gfs_pio_view_global_ops; gf->p = gf->length = 0; gf->io_offset = gf->offset = 0; gf->error = GFARM_ERR_NO_ERROR; return (GFARM_ERR_NO_ERROR); } gfarm-2.4.1/lib/libgfarm/gfarm/schedule.h0000644000000000000000000000214611507222723016706 0ustar rootroot/* * Copyright (c) 2003-2006 National Institute of Advanced * Industrial Science and Technology (AIST). All rights reserved. * * Copyright (c) 2006 National Institute of Informatics in Japan, * All rights reserved. * * This file or a portion of this file is licensed under the terms of * the NAREGI Public License, found at * http://www.naregi.org/download/index.html. * If you redistribute this file, with or without modifications, you * must include this notice in the file. */ struct gfm_connection; struct gfarm_host_sched_info; struct gfs_file; /* GFS_File */ gfarm_error_t gfarm_schedule_select_host(struct gfm_connection *, int, struct gfarm_host_sched_info *, int, char **, int *); void gfarm_schedule_host_cache_reset(struct gfm_connection *, int, struct gfarm_host_sched_info *); /* XXX - defined in gfs_pio_section.c */ gfarm_error_t gfarm_schedule_file(struct gfs_file *, char **, gfarm_int32_t *); int gfm_host_is_in_local_net(struct gfm_connection *, const char *); #if 0 /* not yet in gfarm v2 */ int gfarm_is_active_fsnode(void); int gfarm_is_active_fsnode_to_write(file_offset_t); #endif gfarm-2.4.1/lib/libgfarm/gfarm/gfs_remove.c0000644000000000000000000000201211507222723017231 0ustar rootroot#include #include #define GFARM_INTERNAL_USE #include #include "gfutil.h" #include "gfm_client.h" #include "config.h" #include "lookup.h" static gfarm_error_t gfm_remove_request(struct gfm_connection *gfm_server, void *closure, const char *base) { gfarm_error_t e; if ((e = gfm_client_remove_request(gfm_server, base)) != GFARM_ERR_NO_ERROR) { gflog_warning(GFARM_MSG_1000137, "remove request: %s", gfarm_error_string(e)); } return (e); } static gfarm_error_t gfm_remove_result(struct gfm_connection *gfm_server, void *closure) { gfarm_error_t e; if ((e = gfm_client_remove_result(gfm_server)) != GFARM_ERR_NO_ERROR) { #if 0 /* DEBUG */ gflog_debug(GFARM_MSG_1000138, "remove result: %s", gfarm_error_string(e)); #endif } return (e); } gfarm_error_t gfs_remove(const char *path) { return (gfm_name_op(path, GFARM_ERR_IS_A_DIRECTORY /*XXX posix ok?*/, gfm_remove_request, gfm_remove_result, gfm_name_success_op_connection_free, NULL)); } gfarm-2.4.1/lib/libgfarm/gfarm/gfs_link.c0000644000000000000000000000774011507222723016706 0ustar rootroot#include #include #define GFARM_INTERNAL_USE #include #include "gfutil.h" #include "gfm_client.h" #include "config.h" #include "lookup.h" gfarm_error_t gfs_link(const char *src, const char *dst) { gfarm_error_t e, e_save; int retry = 0; struct gfm_connection *sgfmd, *dgfmd; const char *spath, *dpath, *dbase; for (;;) { e_save = GFARM_ERR_NO_ERROR; spath = src; dpath = dst; if ((e = gfarm_url_parse_metadb(&spath, &sgfmd)) != GFARM_ERR_NO_ERROR) { gflog_warning(GFARM_MSG_1000118, "url_parse_metadb(%s): %s", src, gfarm_error_string(e)); return (e); } else if ((e = gfarm_url_parse_metadb(&dpath, &dgfmd)) != GFARM_ERR_NO_ERROR) { gflog_warning(GFARM_MSG_1000119, "url_parse_metadb(%s): %s", dst, gfarm_error_string(e)); gfm_client_connection_free(sgfmd); return (e); } else if (sgfmd != dgfmd) { gfm_client_connection_free(dgfmd); gfm_client_connection_free(sgfmd); gflog_debug(GFARM_MSG_1001375, "Detected crossed device link (%s)(%s): %s", src, dst, gfarm_error_string( GFARM_ERR_CROSS_DEVICE_LINK)); return (GFARM_ERR_CROSS_DEVICE_LINK); } if ((e = gfm_tmp_open_request(sgfmd, spath, GFARM_FILE_LOOKUP)) != GFARM_ERR_NO_ERROR) { gflog_warning(GFARM_MSG_1000120, "tmp_open(%s) request: %s", src, gfarm_error_string(e)); } else if ((e = gfm_client_save_fd_request(sgfmd)) != GFARM_ERR_NO_ERROR) { gflog_warning(GFARM_MSG_1000121, "save_fd request: %s", gfarm_error_string(e)); } else if ((e = gfm_lookup_dir_request(dgfmd, dpath, &dbase)) != GFARM_ERR_NO_ERROR) { gflog_warning(GFARM_MSG_1000122, "lookup_dir(%s) request: %s", dst, gfarm_error_string(e)); } else if (dbase[0] == '/' && dbase[1] == '\0') { /* "/" is special */ e_save = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if ((e = gfm_client_flink_request(dgfmd, dbase)) != GFARM_ERR_NO_ERROR) { gflog_warning(GFARM_MSG_1000123, "flink request: %s", gfarm_error_string(e)); } if (e != GFARM_ERR_NO_ERROR) break; if ((e = gfm_client_compound_end_request(sgfmd)) != GFARM_ERR_NO_ERROR) { gflog_warning(GFARM_MSG_1000124, "compound_end request: %s", gfarm_error_string(e)); } else if ((e = gfm_tmp_open_result(sgfmd, spath, NULL)) != GFARM_ERR_NO_ERROR) { if (gfm_client_is_connection_error(e) && ++retry <= 1){ gfm_client_connection_free(dgfmd); gfm_client_connection_free(sgfmd); continue; } #if 0 /* DEBUG */ gflog_debug(GFARM_MSG_1000125, "tmp_open(%s) result: %s", src, gfarm_error_string(e)); #endif } else if ((e = gfm_client_save_fd_result(sgfmd)) != GFARM_ERR_NO_ERROR) { gflog_warning(GFARM_MSG_1000126, "save_fd result: %s", gfarm_error_string(e)); } else if ((e = gfm_lookup_dir_result(dgfmd, dpath, &dbase)) != GFARM_ERR_NO_ERROR) { #if 0 /* DEBUG */ gflog_debug(GFARM_MSG_1000127, "lookup_dir(%s) result: %s", dst, gfarm_error_string(e)); #endif } else if (dbase[0] == '/' && dbase[1] == '\0') { /* "/" is special */ e_save = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if ((e = gfm_client_flink_result(dgfmd)) != GFARM_ERR_NO_ERROR) { #if 0 /* DEBUG */ gflog_debug(GFARM_MSG_1000128, "flink result: %s", gfarm_error_string(e)); #endif } if (e != GFARM_ERR_NO_ERROR) break; if ((e = gfm_client_compound_end_result(sgfmd)) != GFARM_ERR_NO_ERROR) { gflog_warning(GFARM_MSG_1000129, "compound_end result: %s", gfarm_error_string(e)); } break; } gfm_client_connection_free(dgfmd); gfm_client_connection_free(sgfmd); /* NOTE: the opened descriptor is automatically closed by gfmd */ if (e_save != GFARM_ERR_NO_ERROR || e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001376, "Creation of link (%s)(%s) failed: %s", src, dst, gfarm_error_string( e_save != GFARM_ERR_NO_ERROR ? e_save : e)); } return (e_save != GFARM_ERR_NO_ERROR ? e_save : e); } gfarm-2.4.1/lib/libgfarm/gfarm/gfs_dirplusxattr.c0000644000000000000000000001123211507222724020506 0ustar rootroot#include #include #include #include "gfutil.h" #include "config.h" #include "gfm_client.h" #include "gfs_io.h" #include "gfs_dirplusxattr.h" /* * gfs_opendirplusxattr()/readdirplusxattr()/closedirplusxattr() */ #define DIRENTSPLUSXATTR_BUFCOUNT 256 struct gfs_dirplusxattr { struct gfm_connection *gfm_server; int fd; struct gfs_dirent buffer[DIRENTSPLUSXATTR_BUFCOUNT]; struct gfs_stat stbuf[DIRENTSPLUSXATTR_BUFCOUNT]; int nattrbuf[DIRENTSPLUSXATTR_BUFCOUNT]; char **attrnamebuf[DIRENTSPLUSXATTR_BUFCOUNT]; void **attrvaluebuf[DIRENTSPLUSXATTR_BUFCOUNT]; size_t *attrsizebuf[DIRENTSPLUSXATTR_BUFCOUNT]; int n, index; }; static gfarm_error_t gfs_dirplusxattr_alloc(struct gfm_connection *gfm_server, gfarm_int32_t fd, GFS_DirPlusXAttr *dirp) { GFS_DirPlusXAttr dir; GFARM_MALLOC(dir); if (dir == NULL) { gflog_debug(GFARM_MSG_1002458, "allocation of dir failed: %s", gfarm_error_string(GFARM_ERR_NO_MEMORY)); return (GFARM_ERR_NO_MEMORY); } dir->gfm_server = gfm_server; dir->fd = fd; dir->n = dir->index = 0; *dirp = dir; return (GFARM_ERR_NO_ERROR); } static void gfs_dirplusxattr_clear(GFS_DirPlusXAttr dir) { int i, j, n = dir->n, nattrs; char **attrs; void **values; size_t *sizes; for (i = 0; i < n; i++) { gfs_stat_free(&dir->stbuf[i]); nattrs = dir->nattrbuf[i]; attrs = dir->attrnamebuf[i]; values = dir->attrvaluebuf[i]; sizes = dir->attrsizebuf[i]; for (j = 0; j < nattrs; j++) { free(attrs[j]); free(values[j]); } free(attrs); free(values); free(sizes); } dir->n = dir->index = 0; } gfarm_error_t gfs_opendirplusxattr(const char *path, GFS_DirPlusXAttr *dirp) { gfarm_error_t e; struct gfm_connection *gfm_server; int fd, type; if ((e = gfm_open_fd(path, GFARM_FILE_RDONLY, &gfm_server, &fd, &type)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1002459, "gfm_open_fd(%s) failed: %s", path, gfarm_error_string(e)); return (e); } if (type != GFS_DT_DIR) e = GFARM_ERR_NOT_A_DIRECTORY; else if ((e = gfs_dirplusxattr_alloc(gfm_server, fd, dirp)) == GFARM_ERR_NO_ERROR) return (GFARM_ERR_NO_ERROR); if (e == GFARM_ERR_NOT_A_DIRECTORY) gflog_debug(GFARM_MSG_1002460, "Not a directory (%s): %s", path, gfarm_error_string(e)); else if (e != GFARM_ERR_NO_ERROR) gflog_debug(GFARM_MSG_1002461, "allocation of dirplusxattr for path (%s) failed: %s", path, gfarm_error_string(e)); (void)gfm_close_fd(gfm_server, fd); /* ignore result */ gfm_client_connection_free(gfm_server); return (e); } static gfarm_error_t gfm_getdirentsplusxattr_request(struct gfm_connection *gfm_server, void *closure) { gfarm_error_t e = gfm_client_getdirentsplusxattr_request( gfm_server, DIRENTSPLUSXATTR_BUFCOUNT, gfarm_xattr_caching_patterns(), gfarm_xattr_caching_patterns_number()); if (e != GFARM_ERR_NO_ERROR) gflog_warning(GFARM_MSG_1002462, "getdirentsplusxattr request: %s", gfarm_error_string(e)); return (e); } static gfarm_error_t gfm_getdirentsplusxattr_result(struct gfm_connection *gfm_server, void *closure) { GFS_DirPlusXAttr dir = closure; gfarm_error_t e = gfm_client_getdirentsplusxattr_result(gfm_server, &dir->n, dir->buffer, dir->stbuf, dir->nattrbuf, dir->attrnamebuf, dir->attrvaluebuf, dir->attrsizebuf); if (e != GFARM_ERR_NO_ERROR) gflog_warning(GFARM_MSG_1002463, "getdirentsplusxattr result: %s", gfarm_error_string(e)); return (e); } /* * both (*entryp) and (*status) shouldn't be freed. */ gfarm_error_t gfs_readdirplusxattr(GFS_DirPlusXAttr dir, struct gfs_dirent **entry, struct gfs_stat **status, int *nattrsp, char ***attrnamesp, void ***attrvaluesp, size_t **attrsizesp) { gfarm_error_t e; if (dir->index >= dir->n) { gfs_dirplusxattr_clear(dir); e = gfm_client_compound_fd_op(dir->gfm_server, dir->fd, gfm_getdirentsplusxattr_request, gfm_getdirentsplusxattr_result, NULL, dir); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1002464, "gfs_client_compound_fd_op() failed: %s", gfarm_error_string(e)); return (e); } if (dir->n == 0) { *entry = NULL; *status = NULL; return (GFARM_ERR_NO_ERROR); } dir->index = 0; } *entry = &dir->buffer[dir->index]; *status = &dir->stbuf[dir->index]; *nattrsp = dir->nattrbuf[dir->index]; *attrnamesp = dir->attrnamebuf[dir->index]; *attrvaluesp = dir->attrvaluebuf[dir->index]; *attrsizesp = dir->attrsizebuf[dir->index]; dir->index++; return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfs_closedirplusxattr(GFS_DirPlusXAttr dir) { gfarm_error_t e = gfm_close_fd(dir->gfm_server, dir->fd); gfm_client_connection_free(dir->gfm_server); gfs_dirplusxattr_clear(dir); free(dir); return (e); } gfarm-2.4.1/lib/libgfarm/gfarm/import_help.c0000644000000000000000000001365511507222724017437 0ustar rootroot#include #include #include #include #include /* file_offset_floor() may be floor() */ #include #include #include "liberror.h" #if 0 /* not yet in gfarm v2 */ #define TABLE_SIZE_INITIAL 128 #define TABLE_SIZE_DELTA 128 /* * configuration file format: * fragment_size fragment_hostnmae * : */ char * gfarm_import_fragment_config_read(char *config, int *np, char ***hosttabp, file_offset_t **sizetabp, int *error_linep) { char *e, **host_table, line[1024]; int i, table_size = TABLE_SIZE_INITIAL; file_offset_t *size_table; file_offset_t *stab; gfarm_stringlist host_list; FILE *fp; *error_linep = -1; GFARM_MALLOC_ARRAY(size_table, table_size); if (size_table == NULL) return (GFARM_ERR_NO_MEMORY); e = gfarm_stringlist_init(&host_list); if (e != NULL) { free(size_table); return (e); } if (strcmp(config, "-") == 0) { fp = stdin; } else if ((fp = fopen(config, "r")) == NULL) { gfarm_stringlist_free(&host_list); free(size_table); return (GFARM_ERR_NO_SUCH_OBJECT); } for (i = 0; fgets(line, sizeof(line), fp) != NULL; i++) { int l = strlen(line); char *s, *t, *host; file_offset_t size; if (l > 0 && line[l - 1] == '\n') line[--l] = '\0'; size = string_to_file_offset(line, &s); if (s == line) { e = "fragment size expected"; *error_linep = i + 1; goto error; } while (isspace(*(unsigned char *)s)) s++; if (*s == '\0') { e = "fragment hostname expected"; *error_linep = i + 1; goto error; } for (t = s; *t != '\0' && !isspace(*(unsigned char *)t); t++) ; *t = '\0'; host = strdup(s); if (host == NULL) { e = GFARM_ERR_NO_MEMORY; *error_linep = i + 1; goto error; } e = gfarm_stringlist_add(&host_list, host); if (e != NULL) { *error_linep = i + 1; goto error; } if (i >= table_size) { table_size += TABLE_SIZE_DELTA; GFARM_REALLOC_ARRAY(stab, size_table, table_size); if (stab == NULL) { e = GFARM_ERR_NO_MEMORY; *error_linep = i + 1; goto error; } size_table = stab; } size_table[i] = size; } if (i == 0) { e = "empty file"; goto error; } host_table = gfarm_strings_alloc_from_stringlist(&host_list); if (host_table == NULL) { e = GFARM_ERR_NO_MEMORY; goto error; } if (i < table_size) { GFARM_REALLOC_ARRAY(stab, size_table, i); if (stab == NULL) { e = GFARM_ERR_NO_MEMORY; goto error; } memcpy(stab, size_table, sizeof(size_table[0]) * i); size_table = stab; } /* * do not call gfarm_stringlist_free_deeply() here, * because the strings are passed to *host_table. */ gfarm_stringlist_free(&host_list); /* no limit on last fragment */ size_table[i - 1] = FILE_OFFSET_T_MAX; *np = i; *hosttabp = host_table; *sizetabp = size_table; if (strcmp(config, "-") != 0) fclose(fp); return (NULL); error: if (strcmp(config, "-") != 0) fclose(fp); gfarm_stringlist_free_deeply(&host_list); free(size_table); return (e); } file_offset_t * gfarm_import_fragment_size_alloc(file_offset_t total_size, int n) { file_offset_t *sizetab; file_offset_t fragment_size; int i; GFARM_MALLOC_ARRAY(sizetab, n); if (sizetab == NULL) return (NULL); fragment_size = file_offset_floor((total_size + n - 1) / n); --n; for (i = 0; i < n; i++) sizetab[i] = fragment_size; /* no limit on last fragment */ sizetab[n] = FILE_OFFSET_T_MAX; return (sizetab); } #endif /* not yet in gfarm v2 */ /* * NOTE: * returned (*linetabp) should be freed by gfarm_strings_free_deeply(). * * configuration file format: * hostname1 * hostname2 * : */ gfarm_error_t gfarm_hostlist_read(char *filename, int *np, char ***host_table_p, int *error_linep) { gfarm_stringlist host_list; FILE *fp; int i; char line[1024]; gfarm_error_t e; *error_linep = -1; e = gfarm_stringlist_init(&host_list); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1000987, "gfarm_stringlist_init() failed: %s", gfarm_error_string(e)); return (e); } if (strcmp(filename, "-") == 0) { fp = stdin; } else if ((fp = fopen(filename, "r")) == NULL) { gfarm_stringlist_free(&host_list); gflog_debug(GFARM_MSG_1000988, "Failed to open file (%s): %s", filename, gfarm_error_string(GFARM_ERR_NO_SUCH_OBJECT)); return (GFARM_ERR_NO_SUCH_OBJECT); } for (i = 0; fgets(line, sizeof(line), fp) != NULL; i++) { int l = strlen(line); char *s, *t, *host; if (l > 0 && line[l - 1] == '\n') line[--l] = '\0'; for (s = line; isspace(*(unsigned char *)s); s++) ; if (*s == '\0') { e = GFARM_ERRMSG_HOSTNAME_EXPECTED; *error_linep = i + 1; gflog_debug(GFARM_MSG_1000989, "Host name expected on file (%s) line (%d)", filename, *error_linep); goto error; } for (t = s; *t != '\0' && !isspace(*(unsigned char *)t); t++) ; *t = '\0'; host = strdup(s); if (host == NULL) { e = GFARM_ERR_NO_MEMORY; *error_linep = i + 1; gflog_debug(GFARM_MSG_1000990, "allocation of string 'host' failed: %s", gfarm_error_string(e)); goto error; } e = gfarm_stringlist_add(&host_list, host); if (e != GFARM_ERR_NO_ERROR) { free(host); *error_linep = i + 1; gflog_debug(GFARM_MSG_1000991, "gfarm_stringlist_add() failed: %s", gfarm_error_string(e)); goto error; } } if (i == 0) { e = GFARM_ERRMSG_EMPTY_FILE; gflog_debug(GFARM_MSG_1000992, "File is empty (%s)", filename); goto error; } *np = gfarm_stringlist_length(&host_list); *host_table_p = gfarm_strings_alloc_from_stringlist(&host_list); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1000993, "gfarm_strings_alloc_from_stringlist() failed: %s", gfarm_error_string(e)); goto error; } /* * do not call gfarm_stringlist_free_deeply() here, * because the strings are passed to *host_table. */ gfarm_stringlist_free(&host_list); if (strcmp(filename, "-") != 0) fclose(fp); return (GFARM_ERR_NO_ERROR); error: if (strcmp(filename, "-") != 0) fclose(fp); gfarm_stringlist_free_deeply(&host_list); return (e); } gfarm-2.4.1/lib/libgfarm/gfarm/lookup.h0000644000000000000000000000263411507222724016426 0ustar rootrootstruct gfm_connection; gfarm_error_t gfarm_url_parse_metadb(const char **, struct gfm_connection **); gfarm_error_t gfm_client_connection_and_process_acquire_by_path(const char *, struct gfm_connection **); gfarm_error_t gfm_lookup_dir_request(struct gfm_connection *, const char *, const char **); gfarm_error_t gfm_lookup_dir_result(struct gfm_connection *, const char *, const char **); gfarm_error_t gfm_tmp_lookup_parent_request(struct gfm_connection *, const char *, const char **); gfarm_error_t gfm_tmp_lookup_parent_result(struct gfm_connection *, const char *, const char **); gfarm_error_t gfm_tmp_open_request(struct gfm_connection *, const char *, int); gfarm_error_t gfm_tmp_open_result(struct gfm_connection *, const char *, int*); gfarm_error_t gfm_name_success_op_connection_free(struct gfm_connection *, void *); gfarm_error_t gfm_name_op(const char *, gfarm_error_t, gfarm_error_t (*)(struct gfm_connection *, void *, const char *), gfarm_error_t (*)(struct gfm_connection *, void *), gfarm_error_t (*)(struct gfm_connection *, void *), void *); gfarm_error_t gfm_inode_success_op_connection_free(struct gfm_connection *, void *, int); gfarm_error_t gfm_inode_op(const char *, int, gfarm_error_t (*)(struct gfm_connection *, void *), gfarm_error_t (*)(struct gfm_connection *, void *), gfarm_error_t (*)(struct gfm_connection *, void *, int), void (*)(struct gfm_connection *, void *), void *); gfarm-2.4.1/lib/libgfarm/gfarm/sockutil.h0000644000000000000000000000014311507222723016742 0ustar rootrootgfarm_error_t gfarm_connect_wait(int, int); gfarm_error_t gfarm_bind_source_ip(int, const char *); gfarm-2.4.1/lib/libgfarm/gfarm/auth_config.c0000644000000000000000000002320011507222724017366 0ustar rootroot#include #include #include #include #include #include #include #include #include "liberror.h" #include "hostspec.h" #include "auth.h" /* * gfarm_auth_method */ struct gfarm_auth_method_name_value { char mnemonic; char *name; enum gfarm_auth_method method; } gfarm_auth_method_name_value_table[] = { { 's', "sharedsecret", GFARM_AUTH_METHOD_SHAREDSECRET }, { 'G', "gsi", GFARM_AUTH_METHOD_GSI }, { 'g', "gsi_auth", GFARM_AUTH_METHOD_GSI_AUTH }, }; enum gfarm_auth_config_command { GFARM_AUTH_ENABLE, GFARM_AUTH_DISABLE }; struct gfarm_auth_config { struct gfarm_auth_config *next; enum gfarm_auth_config_command command; enum gfarm_auth_method method; struct gfarm_hostspec *hostspec; }; struct gfarm_auth_config *gfarm_auth_config_list = NULL; struct gfarm_auth_config **gfarm_auth_config_last = &gfarm_auth_config_list; char gfarm_auth_method_mnemonic(enum gfarm_auth_method method) { int i; for (i = 0; i < GFARM_ARRAY_LENGTH(gfarm_auth_method_name_value_table); i++) { struct gfarm_auth_method_name_value *entry = &gfarm_auth_method_name_value_table[i]; if (entry->method == method) return (entry->mnemonic); } return ('-'); } char * gfarm_auth_method_name(enum gfarm_auth_method method) { int i; for (i = 0; i < GFARM_ARRAY_LENGTH(gfarm_auth_method_name_value_table); i++) { struct gfarm_auth_method_name_value *entry = &gfarm_auth_method_name_value_table[i]; if (entry->method == method) return (entry->name); } return (NULL); } gfarm_error_t gfarm_auth_method_parse(char *name, enum gfarm_auth_method *methodp) { int i; for (i = 0; i < GFARM_ARRAY_LENGTH(gfarm_auth_method_name_value_table); i++) { if (strcmp(name, gfarm_auth_method_name_value_table[i].name) == 0) { *methodp = gfarm_auth_method_name_value_table[i].method; return (GFARM_ERR_NO_ERROR); } } return (GFARM_ERR_NO_SUCH_OBJECT); } gfarm_error_t gfarm_auth_config_add( enum gfarm_auth_config_command command, enum gfarm_auth_method method, struct gfarm_hostspec *hsp) { struct gfarm_auth_config *acp; GFARM_MALLOC(acp); if (acp == NULL) { gflog_debug(GFARM_MSG_1000903, "allocation of 'gfarm_auth_config' failed"); return (GFARM_ERR_NO_MEMORY); } acp->next = NULL; acp->command = command; acp->method = method; acp->hostspec = hsp; *gfarm_auth_config_last = acp; gfarm_auth_config_last = &acp->next; return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfarm_auth_enable(enum gfarm_auth_method method, struct gfarm_hostspec *hsp) { return (gfarm_auth_config_add(GFARM_AUTH_ENABLE, method, hsp)); } gfarm_error_t gfarm_auth_disable(enum gfarm_auth_method method, struct gfarm_hostspec *hsp) { return (gfarm_auth_config_add(GFARM_AUTH_DISABLE, method, hsp)); } /* this i/f have to be changed, if we support more than 31 auth methods */ gfarm_int32_t gfarm_auth_method_get_enabled_by_name_addr( const char *name, struct sockaddr *addr) { struct gfarm_auth_config *acp = gfarm_auth_config_list; gfarm_int32_t enabled = 0, disabled = 0, methods; assert(GFARM_AUTH_METHOD_NUMBER <= sizeof(gfarm_int32_t) * CHAR_BIT); for (; acp != NULL; acp = acp->next) { if (gfarm_hostspec_match(acp->hostspec, name, addr)) { if (acp->method == GFARM_AUTH_METHOD_ALL) { methods = ((1 << GFARM_AUTH_METHOD_NUMBER) - 1) & ~(1 << GFARM_AUTH_METHOD_NONE) & ~(enabled | disabled); } else { methods = 1 << acp->method; if (((enabled | disabled) & methods) != 0) continue; /* already determined */ } switch (acp->command) { case GFARM_AUTH_ENABLE: enabled |= methods; break; case GFARM_AUTH_DISABLE: disabled |= methods; break; } } } return (enabled); } gfarm_int32_t gfarm_auth_method_get_available(void) { int i; gfarm_int32_t methods; assert(GFARM_AUTH_METHOD_NUMBER <= sizeof(gfarm_int32_t) * CHAR_BIT); methods = 0; for (i = GFARM_AUTH_METHOD_NONE + 1; i < GFARM_AUTH_METHOD_NUMBER; i++) { switch (i) { case GFARM_AUTH_METHOD_GSI_OLD: /* obsolete */ break; #ifndef HAVE_GSI case GFARM_AUTH_METHOD_GSI: break; case GFARM_AUTH_METHOD_GSI_AUTH: break; #endif default: methods |= 1 << i; break; } } return (methods); } /* * gfarm_auth_server_cred */ struct gfarm_auth_cred_type_name_value { char *name; enum gfarm_auth_cred_type type; } gfarm_auth_cred_type_name_value_table[] = { { "", GFARM_AUTH_CRED_TYPE_DEFAULT }, { "no-name", GFARM_AUTH_CRED_TYPE_NO_NAME }, { "mechanism-specific", GFARM_AUTH_CRED_TYPE_MECHANISM_SPECIFIC }, { "host", GFARM_AUTH_CRED_TYPE_HOST }, { "user", GFARM_AUTH_CRED_TYPE_USER }, { "self", GFARM_AUTH_CRED_TYPE_SELF }, }; gfarm_error_t gfarm_auth_cred_type_parse(char *type_name, enum gfarm_auth_cred_type *typep) { int i; for (i = 0; i < GFARM_ARRAY_LENGTH(gfarm_auth_cred_type_name_value_table); i++) { struct gfarm_auth_cred_type_name_value *entry = &gfarm_auth_cred_type_name_value_table[i]; if (strcmp(type_name, entry->name) == 0) { *typep = entry->type; return (GFARM_ERR_NO_ERROR); } } gflog_debug(GFARM_MSG_1000904, "Unknown credential type (%s)", type_name); return (GFARM_ERRMSG_UNKNOWN_CREDENTIAL_TYPE); } struct gfarm_auth_cred_config { struct gfarm_auth_cred_config *next; const char *service_tag; enum gfarm_auth_cred_type type; char *service; char *name; }; struct gfarm_auth_cred_config *gfarm_auth_server_cred_config_list = NULL; static struct gfarm_auth_cred_config ** gfarm_auth_server_cred_config_lookup(const char *service_tag) { struct gfarm_auth_cred_config *conf, **p; for (p = &gfarm_auth_server_cred_config_list; (conf = *p) != NULL; p = &conf->next) { if (strcmp(service_tag, conf->service_tag) == 0) break; } return (p); } /* service_tag must be statically allocated */ static gfarm_error_t gfarm_auth_server_cred_config_enter(char *service_tag, struct gfarm_auth_cred_config **confp) { struct gfarm_auth_cred_config *conf, **p = gfarm_auth_server_cred_config_lookup(service_tag); if (*p != NULL) { *confp = *p; return (GFARM_ERR_NO_ERROR); } GFARM_MALLOC(conf); if (conf == NULL) { gflog_debug(GFARM_MSG_1000905, "allocation of credential config failed"); return (GFARM_ERR_NO_MEMORY); } conf->next = NULL; conf->service_tag = service_tag; conf->type = GFARM_AUTH_CRED_TYPE_DEFAULT; conf->service = NULL; conf->name = NULL; *confp = *p = conf; return (GFARM_ERR_NO_ERROR); } enum gfarm_auth_cred_type gfarm_auth_server_cred_type_get(const char *service_tag) { struct gfarm_auth_cred_config *conf = *gfarm_auth_server_cred_config_lookup(service_tag); if (conf == NULL) return (GFARM_AUTH_CRED_TYPE_DEFAULT); return (conf->type); } char * gfarm_auth_server_cred_service_get(const char *service_tag) { struct gfarm_auth_cred_config *conf = *gfarm_auth_server_cred_config_lookup(service_tag); if (conf == NULL) return (NULL); return (conf->service); } char * gfarm_auth_server_cred_name_get(const char *service_tag) { struct gfarm_auth_cred_config *conf = *gfarm_auth_server_cred_config_lookup(service_tag); if (conf == NULL) return (NULL); return (conf->name); } /* service_tag must be statically allocated */ gfarm_error_t gfarm_auth_server_cred_type_set_by_string(char *service_tag, char *string) { gfarm_error_t e; enum gfarm_auth_cred_type type; e = gfarm_auth_cred_type_parse(string, &type); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1000906, "gfarm_auth_cred_type_parse(%s) failed: %s", string, gfarm_error_string(e)); return (e); } return (gfarm_auth_server_cred_type_set(service_tag, type)); } /* service_tag must be statically allocated */ gfarm_error_t gfarm_auth_server_cred_type_set(char *service_tag, enum gfarm_auth_cred_type type) { struct gfarm_auth_cred_config *conf; gfarm_error_t e = gfarm_auth_server_cred_config_enter(service_tag, &conf); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1000907, "gfarm_auth_server_cred_config_enter(%s) failed: %s", service_tag, gfarm_error_string(e)); return (e); } /* first line has precedence */ if (conf->type != GFARM_AUTH_CRED_TYPE_DEFAULT) return (GFARM_ERR_NO_ERROR); conf->type = type; return (GFARM_ERR_NO_ERROR); } /* service_tag must be statically allocated */ gfarm_error_t gfarm_auth_server_cred_service_set(char *service_tag, char *service) { struct gfarm_auth_cred_config *conf; gfarm_error_t e = gfarm_auth_server_cred_config_enter(service_tag, &conf); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1000908, "gfarm_auth_server_cred_config_enter(%s) failed: %s", service_tag, gfarm_error_string(e)); return (e); } if (conf->service != NULL) /* first line has precedence */ return (GFARM_ERR_NO_ERROR); if ((conf->service = strdup(service)) == NULL) { gflog_debug(GFARM_MSG_1000909, "allocation of string 'service' failed"); return (GFARM_ERR_NO_MEMORY); } return (GFARM_ERR_NO_ERROR); } /* service_tag must be statically allocated */ gfarm_error_t gfarm_auth_server_cred_name_set(char *service_tag, char *name) { struct gfarm_auth_cred_config *conf; gfarm_error_t e = gfarm_auth_server_cred_config_enter(service_tag, &conf); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1000910, "gfarm_auth_server_cred_config_enter(%s): %s", service_tag, gfarm_error_string(e)); return (e); } if (conf->name != NULL) /* first line has precedence */ return (GFARM_ERR_NO_ERROR); if ((conf->name = strdup(name)) == NULL) { gflog_debug(GFARM_MSG_1000911, "allocation of string 'name' failed: %s", gfarm_error_string(GFARM_ERR_NO_MEMORY)); return (GFARM_ERR_NO_MEMORY); } return (GFARM_ERR_NO_ERROR); } gfarm-2.4.1/lib/libgfarm/gfarm/gfs_utimes.c0000644000000000000000000000304711507222723017253 0ustar rootroot#include /* config.h needs FILE */ #include #include #define GFARM_INTERNAL_USE #include #include "gfutil.h" #include "config.h" #include "gfm_client.h" #include "lookup.h" struct gfm_utimes_closure { struct gfarm_timespec atime, mtime; }; static gfarm_error_t gfm_utimes_request(struct gfm_connection *gfm_server, void *closure) { struct gfm_utimes_closure *c = closure; gfarm_error_t e = gfm_client_futimes_request(gfm_server, c->atime.tv_sec, c->atime.tv_nsec, c->mtime.tv_sec, c->mtime.tv_nsec); if (e != GFARM_ERR_NO_ERROR) gflog_warning(GFARM_MSG_1000158, "futimes request: %s", gfarm_error_string(e)); return (e); } static gfarm_error_t gfm_utimes_result(struct gfm_connection *gfm_server, void *closure) { gfarm_error_t e = gfm_client_futimes_result(gfm_server); #if 1 /* DEBUG */ if (e != GFARM_ERR_NO_ERROR) gflog_debug(GFARM_MSG_1000159, "futimes result: %s", gfarm_error_string(e)); #endif return (e); } gfarm_error_t gfs_utimes(const char *path, const struct gfarm_timespec *tsp) { struct gfm_utimes_closure closure; if (tsp == NULL) { struct timeval now; gettimeofday(&now, NULL); closure.atime.tv_sec = closure.mtime.tv_sec = now.tv_sec; closure.atime.tv_nsec = closure.mtime.tv_nsec = now.tv_usec * 1000; } else { closure.atime = tsp[0]; closure.mtime = tsp[1]; } return (gfm_inode_op(path, GFARM_FILE_LOOKUP, gfm_utimes_request, gfm_utimes_result, gfm_inode_success_op_connection_free, NULL, &closure)); } gfarm-2.4.1/lib/libgfarm/gfarm/gfs_profile.h0000644000000000000000000000057711507222723017417 0ustar rootrootextern int gf_profile; #define gfs_profile(x) if (gf_profile) { x; } void gfs_profile_set(void); void gfs_profile_unset(void); /* profile related subroutines: called from gfs_pio_display() */ void gfs_pio_display_timers(void); void gfs_pio_section_display_timers(void); void gfs_stat_display_timers(void); void gfs_unlink_display_timers(void); void gfs_xattr_display_timers(void); gfarm-2.4.1/lib/libgfarm/gfarm/stringlist.c0000644000000000000000000001065611507222723017314 0ustar rootroot#include #include #include #include #include #include #include #include #define GFARM_STRINGLIST_INITIAL 50 #define GFARM_STRINGLIST_DELTA 50 /* gfarm_stringlist: variable size string array */ gfarm_error_t gfarm_stringlist_init(gfarm_stringlist *listp) { char **v; GFARM_MALLOC_ARRAY(v, GFARM_STRINGLIST_INITIAL); if (v == NULL) { gflog_debug(GFARM_MSG_1000912, "allocation of init string list failed: %s", gfarm_error_string(GFARM_ERR_NO_MEMORY)); return (GFARM_ERR_NO_MEMORY); } listp->size = GFARM_STRINGLIST_INITIAL; listp->length = 0; listp->array = v; v[0] = NULL; return (GFARM_ERR_NO_ERROR); } void gfarm_stringlist_free(gfarm_stringlist *listp) { free(listp->array); /* the following is not needed, but to make erroneous program abort */ listp->size = 0; listp->length = 0; listp->array = NULL; } void gfarm_stringlist_free_deeply(gfarm_stringlist *listp) { int i, length = gfarm_stringlist_length(listp); for (i = 0; i < length; i++) { if (listp->array[i] != NULL) free(listp->array[i]); } gfarm_stringlist_free(listp); } gfarm_error_t gfarm_stringlist_add_strings(gfarm_stringlist *listp, int al, char **av) { int ll = gfarm_stringlist_length(listp); if (ll + al > listp->size) { int n = listp->size; char **t; do { n += GFARM_STRINGLIST_DELTA; } while (ll + al > n); GFARM_REALLOC_ARRAY(t, listp->array, n); if (t == NULL) { gflog_debug(GFARM_MSG_1000913, "re-allocation of 'listp->array' failed: %s", gfarm_error_string(GFARM_ERR_NO_MEMORY)); return (GFARM_ERR_NO_MEMORY); } listp->size = n; listp->array = t; } memcpy(&listp->array[ll], av, sizeof(char *) * al); listp->length += al; return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfarm_stringlist_add_list(gfarm_stringlist *listp, gfarm_stringlist *addp) { return (gfarm_stringlist_add_strings(listp, gfarm_stringlist_length(addp), addp->array)); } gfarm_error_t gfarm_stringlist_add(gfarm_stringlist *listp, char *s) { int length = gfarm_stringlist_length(listp); if (length >= listp->size) { int n = listp->size + GFARM_STRINGLIST_DELTA; char **t; GFARM_REALLOC_ARRAY(t, listp->array, n); if (t == NULL) { gflog_debug(GFARM_MSG_1000914, "re-allocation of 'listp->array' failed: %s", gfarm_error_string(GFARM_ERR_NO_MEMORY)); return (GFARM_ERR_NO_MEMORY); } listp->size = n; listp->array = t; } listp->array[length] = s; listp->length++; return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfarm_stringlist_cat(gfarm_stringlist *listp, char **v) { return (gfarm_stringlist_add_strings(listp, gfarm_strarray_length(v), v)); } /* gfarm_fixedstrings: fixed length array of dynamically allocated strings */ gfarm_error_t gfarm_fixedstrings_dup(int n, char **dst, char **src) { int i; for (i = 0; i < n; i++) { dst[i] = strdup(src[i]); if (dst[i] == NULL) { while (--i >= 0) { free(dst[i]); dst[i] = NULL; } gflog_debug(GFARM_MSG_1000915, "allocation of string 'dst' failed: %s", gfarm_error_string(GFARM_ERR_NO_MEMORY)); return (GFARM_ERR_NO_MEMORY); } } return (GFARM_ERR_NO_ERROR); } /* gfarm_strings: dynamically allocated string array and array contents */ char ** gfarm_strings_alloc_from_stringlist(gfarm_stringlist *listp) { int n = gfarm_stringlist_length(listp); char **t; GFARM_MALLOC_ARRAY(t, n); if (t == NULL) { gflog_debug(GFARM_MSG_1000916, "allocation of string failed: %s", gfarm_error_string(GFARM_ERR_NO_MEMORY)); return (NULL); } memcpy(t, listp->array, sizeof(char *) * n); return (t); } void gfarm_strings_free_deeply(int n, char **strings) { int i; for (i = 0; i < n; i++) { if (strings[i] != NULL) free(strings[i]); } free(strings); } /* gfarm_array: NULL terminated gfarm_strings */ int gfarm_strarray_length(char **array) { int i; for (i = 0; array[i] != NULL; i++) ; return (i); } char ** gfarm_strarray_dup(char **array) { int n = gfarm_strarray_length(array); char **v; GFARM_MALLOC_ARRAY(v, n + 1); if (v == NULL) { gflog_debug(GFARM_MSG_1000917, "allocation of string failed: %s", gfarm_error_string(GFARM_ERR_NO_MEMORY)); return (v); } if (gfarm_fixedstrings_dup(n, v, array) != GFARM_ERR_NO_ERROR) return (NULL); v[n] = NULL; return (v); } void gfarm_strarray_free(char **array) { int i; for (i = 0; array[i] != NULL; i++) free(array[i]); free(array); } gfarm-2.4.1/lib/libgfarm/gfarm/gfs_rename.c0000644000000000000000000001070011507222723017206 0ustar rootroot#include #include #define GFARM_INTERNAL_USE #include #include "gfutil.h" #include "gfm_client.h" #include "config.h" #include "lookup.h" gfarm_error_t gfs_rename(const char *src, const char *dst) { gfarm_error_t e, e_save; int retry = 0; struct gfm_connection *sgfmd, *dgfmd; const char *spath, *dpath, *sbase, *dbase; for (;;) { e_save = GFARM_ERR_NO_ERROR; spath = src; dpath = dst; if ((e = gfarm_url_parse_metadb(&spath, &sgfmd)) != GFARM_ERR_NO_ERROR) { gflog_warning(GFARM_MSG_1000139, "url_parse_metadb(%s): %s", src, gfarm_error_string(e)); return (e); } else if ((e = gfarm_url_parse_metadb(&dpath, &dgfmd)) != GFARM_ERR_NO_ERROR) { gflog_warning(GFARM_MSG_1000140, "url_parse_metadb(%s): %s", dst, gfarm_error_string(e)); gfm_client_connection_free(sgfmd); return (e); } else if (sgfmd != dgfmd) { gfm_client_connection_free(dgfmd); gfm_client_connection_free(sgfmd); gflog_debug(GFARM_MSG_1001381, "Detected crossed device link (%s)(%s): %s", src, dst, gfarm_error_string( GFARM_ERR_CROSS_DEVICE_LINK)); return (GFARM_ERR_CROSS_DEVICE_LINK); } if ((e = gfm_tmp_lookup_parent_request(sgfmd, spath, &sbase)) != GFARM_ERR_NO_ERROR) { gflog_warning(GFARM_MSG_1000141, "tmp_lookup_parent(%s) request: %s", src, gfarm_error_string(e)); } else if (sbase[0] == '/' && sbase[1] == '\0') { /* "/" is special */ e_save = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if ((e = gfm_client_save_fd_request(sgfmd)) != GFARM_ERR_NO_ERROR) { gflog_warning(GFARM_MSG_1000142, "save_fd request: %s", gfarm_error_string(e)); } if (e != GFARM_ERR_NO_ERROR) break; if ((e = gfm_lookup_dir_request(dgfmd, dpath, &dbase)) != GFARM_ERR_NO_ERROR) { gflog_warning(GFARM_MSG_1000143, "lookup_dir(%s) request: %s", dst, gfarm_error_string(e)); } else if (dbase[0] == '/' && dbase[1] == '\0') { /* "/" is special */ e_save = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if (e_save == GFARM_ERR_NO_ERROR && (e = gfm_client_rename_request(sgfmd, sbase, dbase)) != GFARM_ERR_NO_ERROR) { gflog_warning(GFARM_MSG_1000144, "rename request: %s", gfarm_error_string(e)); } if (e != GFARM_ERR_NO_ERROR) break; if ((e = gfm_client_compound_end_request(sgfmd)) != GFARM_ERR_NO_ERROR) { gflog_warning(GFARM_MSG_1000145, "compound_end request: %s", gfarm_error_string(e)); } else if ((e = gfm_tmp_lookup_parent_result(sgfmd, spath, &sbase)) != GFARM_ERR_NO_ERROR) { if (gfm_client_is_connection_error(e) && ++retry <= 1){ gfm_client_connection_free(dgfmd); gfm_client_connection_free(sgfmd); continue; } #if 0 /* DEBUG */ gflog_debug(GFARM_MSG_1000146, "tmp_lookup_parent(%s) result: %s", src, gfarm_error_string(e)); #endif } else if (sbase[0] == '/' && sbase[1] == '\0') { /* "/" is special */ e_save = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if ((e = gfm_client_save_fd_result(sgfmd)) != GFARM_ERR_NO_ERROR) { gflog_warning(GFARM_MSG_1000147, "save_fd result: %s", gfarm_error_string(e)); } if (e != GFARM_ERR_NO_ERROR) break; if ((e = gfm_lookup_dir_result(dgfmd, dpath, &dbase)) != GFARM_ERR_NO_ERROR) { #if 0 /* DEBUG */ gflog_debug(GFARM_MSG_1000148, "lookup_dir(%s) result: %s", dst, gfarm_error_string(e)); #endif } else if (dbase[0] == '/' && dbase[1] == '\0') { /* "/" is special */ e_save = GFARM_ERR_OPERATION_NOT_PERMITTED; } else if (e_save == GFARM_ERR_NO_ERROR && (e = gfm_client_rename_result(sgfmd)) != GFARM_ERR_NO_ERROR) { #if 0 /* DEBUG */ gflog_debug(GFARM_MSG_1000149, "rename(%s, %s) result: %s", src, dst, gfarm_error_string(e)); #endif } if (e != GFARM_ERR_NO_ERROR) break; if ((e = gfm_client_compound_end_result(sgfmd)) != GFARM_ERR_NO_ERROR) { gflog_warning(GFARM_MSG_1000150, "compound_end result: %s", gfarm_error_string(e)); } break; } gfm_client_connection_free(dgfmd); gfm_client_connection_free(sgfmd); /* NOTE: the opened descriptor is automatically closed by gfmd */ if (e_save != GFARM_ERR_NO_ERROR || e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001382, "error occurred during gfs_rename(%s)(%s): %s", src, dst, gfarm_error_string( e_save != GFARM_ERR_NO_ERROR ? e_save : e)); } return (e_save != GFARM_ERR_NO_ERROR ? e_save : e); } gfarm-2.4.1/lib/libgfarm/gfarm/auth_client.c0000644000000000000000000007632611507222723017417 0ustar rootroot#include /* fd_set */ #include #include #include #include #include #include #include #include #include #include #include "liberror.h" #include "gfutil.h" #include "gfevent.h" #include "gfp_xdr.h" #include "auth.h" /* * currently 31 is enough, * but it is possible that future server replies more methods. */ #define GFARM_AUTH_METHODS_BUFFER_SIZE 256 struct gfarm_auth_client_method { enum gfarm_auth_method method; gfarm_error_t (*request)(struct gfp_xdr *, const char *, const char *, enum gfarm_auth_id_type); gfarm_error_t (*request_multiplexed)(struct gfarm_eventqueue *, struct gfp_xdr *, const char *, const char *, enum gfarm_auth_id_type, void (*)(void *), void *, void **); gfarm_error_t (*result_multiplexed)(void *); } gfarm_auth_trial_table[] = { /* * This table entry should be prefered order */ { GFARM_AUTH_METHOD_SHAREDSECRET, gfarm_auth_request_sharedsecret, gfarm_auth_request_sharedsecret_multiplexed, gfarm_auth_result_sharedsecret_multiplexed }, #ifdef HAVE_GSI { GFARM_AUTH_METHOD_GSI_AUTH, gfarm_auth_request_gsi_auth, gfarm_auth_request_gsi_auth_multiplexed, gfarm_auth_result_gsi_auth_multiplexed }, { GFARM_AUTH_METHOD_GSI, gfarm_auth_request_gsi, gfarm_auth_request_gsi_multiplexed, gfarm_auth_result_gsi_multiplexed }, #endif { GFARM_AUTH_METHOD_NONE, NULL, NULL, NULL } /* sentinel */ }; gfarm_error_t gfarm_auth_request_sharedsecret(struct gfp_xdr *conn, const char *service_tag, const char *hostname, enum gfarm_auth_id_type self_type) { /* * too weak authentication. * assumes shared home directory. */ gfarm_error_t e, e_save = GFARM_ERR_NO_ERROR; char *user, *home; unsigned int expire; char shared_key[GFARM_AUTH_SHARED_KEY_LEN]; char challenge[GFARM_AUTH_CHALLENGE_LEN]; char response[GFARM_AUTH_RESPONSE_LEN]; size_t len; gfarm_int32_t error, error_ignore; /* enum gfarm_auth_error */ int eof, key_create = GFARM_AUTH_SHARED_KEY_CREATE; int try = 0; /* XXX NOTYET deal with self_type == GFARM_AUTH_ID_TYPE_SPOOL_HOST */ user = gfarm_get_global_username(); home = gfarm_get_local_homedir(); if (user == NULL || home == NULL) return (GFARM_ERRMSG_AUTH_REQUEST_SHAREDSECRET_IMPLEMENTATION_ERROR); e = gfp_xdr_send(conn, "s", user); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001025, "sending user (%s) failed" "when requesting sharedsecret: %s", user, gfarm_error_string(e)); return (e); } do { e = gfarm_auth_shared_key_get(&expire, shared_key, home, NULL, key_create, 0); key_create = GFARM_AUTH_SHARED_KEY_CREATE_FORCE; if (e != GFARM_ERR_NO_ERROR) { e_save = e; gflog_auth_error(GFARM_MSG_1000019, "while accessing %s: %s", GFARM_AUTH_SHARED_KEY_PRINTNAME, gfarm_error_string(e)); break; } e = gfp_xdr_send(conn, "i", GFARM_AUTH_SHAREDSECRET_MD5); if (e == GFARM_ERR_NO_ERROR) e = gfp_xdr_flush(conn); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001026, "sending auth shared secret md5 failed: %s", gfarm_error_string(e)); return (e); } e = gfp_xdr_recv(conn, 0, &eof, "i", &error); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001027, "receiving auth shared secret md5 " "response failed: %s", gfarm_error_string(e)); return (e); } if (eof) { gflog_debug(GFARM_MSG_1001028, "Unexpected EOF when receiving " "auth shared secret md5 response: %s", gfarm_error_string(GFARM_ERR_PROTOCOL)); return (GFARM_ERR_PROTOCOL); } if (error != GFARM_AUTH_ERROR_NO_ERROR) break; e = gfp_xdr_recv(conn, 0, &eof, "b", sizeof(challenge), &len, challenge); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001029, "receiving challenge response failed: %s", gfarm_error_string(e)); return (e); } if (eof) { gflog_debug(GFARM_MSG_1001030, "Unexpected EOF when receiving " "challenge response: %s", gfarm_error_string(GFARM_ERR_PROTOCOL)); return (GFARM_ERR_PROTOCOL); } gfarm_auth_sharedsecret_response_data(shared_key, challenge, response); e = gfp_xdr_send(conn, "ib", expire, sizeof(response), response); if (e == GFARM_ERR_NO_ERROR) e = gfp_xdr_flush(conn); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001031, "sending expire %u failed: %s", expire, gfarm_error_string(e)); return (e); } e = gfp_xdr_recv(conn, 1, &eof, "i", &error); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001032, "receiving expire response failed: %s", gfarm_error_string(e)); return (e); } if (eof) { gflog_debug(GFARM_MSG_1001033, "Unexpected EOF when receiving expire response: %s", gfarm_error_string(GFARM_ERR_PROTOCOL)); return (GFARM_ERR_PROTOCOL); } if (error == GFARM_AUTH_ERROR_NO_ERROR) return (GFARM_ERR_NO_ERROR); /* success */ } while (++try < GFARM_AUTH_RETRY_MAX && error == GFARM_AUTH_ERROR_EXPIRED); e = gfp_xdr_send(conn, "i", GFARM_AUTH_SHAREDSECRET_GIVEUP); if (e == GFARM_ERR_NO_ERROR) e = gfp_xdr_flush(conn); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001034, "sending giveup failed: %s", gfarm_error_string(e)); return (e); } e = gfp_xdr_recv(conn, 0, &eof, "i", &error_ignore); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001035, "receiving giveup response failed: %s", gfarm_error_string(e)); return (e); } if (eof) { gflog_debug(GFARM_MSG_1001036, "Unexpected EOF when receiving giveup response: %s", gfarm_error_string(GFARM_ERR_PROTOCOL)); return (GFARM_ERR_PROTOCOL); } if (e_save != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001037, "access to %s failed: %s", GFARM_AUTH_SHARED_KEY_PRINTNAME, gfarm_error_string(e_save)); return (e_save); } switch (error) { case GFARM_AUTH_ERROR_NOT_SUPPORTED: gflog_debug(GFARM_MSG_1001038, "Protocol not supported"); return (GFARM_ERR_PROTOCOL_NOT_SUPPORTED); case GFARM_AUTH_ERROR_EXPIRED: gflog_debug(GFARM_MSG_1001039, "Authentication token expired"); return (GFARM_ERR_EXPIRED); default: gflog_debug(GFARM_MSG_1001040, "Authentication failed"); return (GFARM_ERR_AUTHENTICATION); } } gfarm_error_t gfarm_auth_request(struct gfp_xdr *conn, const char *service_tag, const char *name, struct sockaddr *addr, enum gfarm_auth_id_type self_type, enum gfarm_auth_method *auth_methodp) { gfarm_error_t e, e_save = GFARM_ERR_NO_ERROR; int i, eof; gfarm_int32_t methods, server_methods; /* bitset */ gfarm_int32_t method; /* enum gfarm_auth_method */ gfarm_int32_t error; /* enum gfarm_auth_error */ size_t nmethods; unsigned char methods_buffer[GFARM_AUTH_METHODS_BUFFER_SIZE]; assert(GFARM_AUTH_METHOD_NUMBER <= sizeof(gfarm_int32_t) * CHAR_BIT); methods = gfarm_auth_method_get_enabled_by_name_addr(name, addr); if (methods == 0) { gflog_debug(GFARM_MSG_1001041, "Auth method not available for host %s", name); return (GFARM_ERRMSG_AUTH_METHOD_NOT_AVAILABLE_FOR_THE_HOST); } methods &= gfarm_auth_method_get_available(); if (methods == 0) { gflog_debug(GFARM_MSG_1001042, "No usable auth method configured"); return (GFARM_ERRMSG_USABLE_AUTH_METHOD_IS_NOT_CONFIGURED); } e = gfp_xdr_recv(conn, 0, &eof, "b", sizeof(methods_buffer), &nmethods, methods_buffer); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001043, "receiving methods response failed: %s", gfarm_error_string(e)); return (e); } if (eof) { gflog_debug(GFARM_MSG_1001044, "Unexpected EOF when receiving methods response: %s", gfarm_error_string(GFARM_ERR_PROTOCOL)); return (GFARM_ERR_PROTOCOL); } server_methods = 0; for (i = 0; i < nmethods; i++) { if (methods_buffer[i] <= GFARM_AUTH_METHOD_NONE || methods_buffer[i] >= GFARM_AUTH_METHOD_NUMBER) continue; server_methods |= 1 << methods_buffer[i]; } for (i = 0;; i++) { method = gfarm_auth_trial_table[i].method; if (method != GFARM_AUTH_METHOD_NONE && (methods & server_methods & (1 << method)) == 0) continue; e = gfp_xdr_send(conn, "i", method); if (e == GFARM_ERR_NO_ERROR) e = gfp_xdr_flush(conn); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001045, "sending method (%d) failed: %s", method, gfarm_error_string(e)); return (e); } e = gfp_xdr_recv(conn, 1, &eof, "i", &error); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001046, "receiving method (%d) response failed: %s", method, gfarm_error_string(e)); return (e); } if (eof || error != GFARM_AUTH_ERROR_NO_ERROR) { gflog_debug(GFARM_MSG_1001047, "Unexpected EOF when receiving " "method (%d) response (error = %u): %s", method, error, gfarm_error_string(GFARM_ERR_PROTOCOL)); return (GFARM_ERR_PROTOCOL); /* shouldn't happen */ } if (method == GFARM_AUTH_METHOD_NONE) { /* give up */ if (server_methods == 0) { gflog_debug(GFARM_MSG_1001048, "Method permission denied"); return (GFARM_ERR_PERMISSION_DENIED); } if ((methods & server_methods) == 0) { gflog_debug(GFARM_MSG_1001049, "Method protocol not supported"); return (GFARM_ERR_PROTOCOL_NOT_SUPPORTED); } if (e_save != GFARM_ERR_NO_ERROR) gflog_debug(GFARM_MSG_1001050, "Method error: %s", gfarm_error_string(e_save)); else gflog_debug(GFARM_MSG_1001051, "Auth request implementation error"); return (e_save != GFARM_ERR_NO_ERROR ? e_save : GFARM_ERRMSG_AUTH_REQUEST_IMPLEMENTATION_ERROR); } e = (*gfarm_auth_trial_table[i].request)(conn, service_tag, name, self_type); if (e == GFARM_ERR_NO_ERROR) { if (auth_methodp != NULL) *auth_methodp = method; return (GFARM_ERR_NO_ERROR); /* success */ } if (e != GFARM_ERR_PROTOCOL_NOT_SUPPORTED && e != GFARM_ERR_EXPIRED && e != GFARM_ERR_PERMISSION_DENIED && e != GFARM_ERR_AUTHENTICATION) { gflog_debug(GFARM_MSG_1001052, "Method protocol error: %s", gfarm_error_string(e)); /* protocol error */ return (e); } e_save = e; } } /* * multiplexed version of gfarm_auth_request_sharedsecret() * for parallel authentication */ struct gfarm_auth_request_sharedsecret_state { struct gfarm_eventqueue *q; struct gfarm_event *readable, *writable; struct gfp_xdr *conn; void (*continuation)(void *); void *closure; char *home; /* for loop */ int try; unsigned int expire; char shared_key[GFARM_AUTH_SHARED_KEY_LEN]; /* results */ gfarm_error_t error, error_save; gfarm_int32_t proto_error; /* enum gfarm_auth_error */ }; static void gfarm_auth_request_sharedsecret_receive_fin(int events, int fd, void *closure, const struct timeval *t) { struct gfarm_auth_request_sharedsecret_state *state = closure; int eof; gfarm_int32_t error_ignore; /* enum gfarm_auth_error */ if ((events & GFARM_EVENT_TIMEOUT) != 0) { assert(events == GFARM_EVENT_TIMEOUT); state->error = GFARM_ERR_OPERATION_TIMED_OUT; gflog_debug(GFARM_MSG_1001053, "receiving fin failed: %s", gfarm_error_string(state->error)); if (state->continuation != NULL) (*state->continuation)(state->closure); return; } assert(events == GFARM_EVENT_READ); state->error = gfp_xdr_recv(state->conn, 0, &eof, "i", &error_ignore); if (state->error == GFARM_ERR_NO_ERROR && eof) { state->error = GFARM_ERR_PROTOCOL; gflog_debug(GFARM_MSG_1001054, "Unexpected EOF when receiving fin %s", gfarm_error_string(GFARM_ERR_PROTOCOL)); } if (state->error != GFARM_ERR_NO_ERROR) ; else if (state->error_save != GFARM_ERR_NO_ERROR) { state->error = state->error_save; } else { switch (state->proto_error) { case GFARM_AUTH_ERROR_NOT_SUPPORTED: state->error = GFARM_ERR_PROTOCOL_NOT_SUPPORTED; gflog_debug(GFARM_MSG_1001055, "Protocol not supported"); break; case GFARM_AUTH_ERROR_EXPIRED: state->error = GFARM_ERR_EXPIRED; gflog_debug(GFARM_MSG_1001056, "Authentication token expired"); break; default: state->error = GFARM_ERR_AUTHENTICATION; gflog_debug(GFARM_MSG_1001057, "Authentication failed"); break; } } if (state->continuation != NULL) (*state->continuation)(state->closure); } static void gfarm_auth_request_sharedsecret_send_giveup(int events, int fd, void *closure, const struct timeval *t) { struct gfarm_auth_request_sharedsecret_state *state = closure; int rv; struct timeval timeout; state->error = gfp_xdr_send(state->conn, "i", GFARM_AUTH_SHAREDSECRET_GIVEUP); if (state->error == GFARM_ERR_NO_ERROR && (state->error = gfp_xdr_flush(state->conn)) == GFARM_ERR_NO_ERROR){ gfarm_fd_event_set_callback(state->readable, gfarm_auth_request_sharedsecret_receive_fin, state); timeout.tv_sec = GFARM_AUTH_TIMEOUT; timeout.tv_usec = 0; if ((rv = gfarm_eventqueue_add_event(state->q, state->readable, &timeout)) == 0) { /* go to * gfarm_auth_request_sharedsecret_receive_fin() */ return; } state->error = gfarm_errno_to_error(rv); } if (state->continuation != NULL) (*state->continuation)(state->closure); } static void gfarm_auth_request_sharedsecret_send_keytype(int events, int fd, void *closure, const struct timeval *t); static void gfarm_auth_request_sharedsecret_receive_result(int events, int fd, void *closure, const struct timeval *t) { struct gfarm_auth_request_sharedsecret_state *state = closure; int rv, eof; if ((events & GFARM_EVENT_TIMEOUT) != 0) { assert(events == GFARM_EVENT_TIMEOUT); state->error = GFARM_ERR_OPERATION_TIMED_OUT; gflog_debug(GFARM_MSG_1001058, "receiving result failed: %s", gfarm_error_string(state->error)); if (state->continuation != NULL) (*state->continuation)(state->closure); return; } assert(events == GFARM_EVENT_READ); state->error = gfp_xdr_recv(state->conn, 1, &eof, "i", &state->proto_error); if (state->error == GFARM_ERR_NO_ERROR && eof) state->error = GFARM_ERR_PROTOCOL; if (state->error == GFARM_ERR_NO_ERROR) { if (state->proto_error != GFARM_AUTH_ERROR_NO_ERROR) { gfarm_fd_event_set_callback(state->writable, (++state->try < GFARM_AUTH_RETRY_MAX && state->proto_error == GFARM_AUTH_ERROR_EXPIRED) ? gfarm_auth_request_sharedsecret_send_keytype : gfarm_auth_request_sharedsecret_send_giveup, state); rv = gfarm_eventqueue_add_event(state->q, state->writable, NULL); if (rv == 0) return; state->error = gfarm_errno_to_error(rv); } } if (state->continuation != NULL) (*state->continuation)(state->closure); } static void gfarm_auth_request_sharedsecret_receive_challenge(int events, int fd, void *closure, const struct timeval *t) { struct gfarm_auth_request_sharedsecret_state *state = closure; int rv, eof; char challenge[GFARM_AUTH_CHALLENGE_LEN]; char response[GFARM_AUTH_RESPONSE_LEN]; size_t len; struct timeval timeout; if ((events & GFARM_EVENT_TIMEOUT) != 0) { assert(events == GFARM_EVENT_TIMEOUT); state->error = GFARM_ERR_OPERATION_TIMED_OUT; gflog_debug(GFARM_MSG_1001059, "receiving challenge failed: %s", gfarm_error_string(state->error)); if (state->continuation != NULL) (*state->continuation)(state->closure); return; } assert(events == GFARM_EVENT_READ); state->error = gfp_xdr_recv(state->conn, 0, &eof, "b", sizeof(challenge), &len, challenge); if (state->error == GFARM_ERR_NO_ERROR && eof) state->error = GFARM_ERR_PROTOCOL; if (state->error == GFARM_ERR_NO_ERROR) { /* XXX It's better to check writable event here */ gfarm_auth_sharedsecret_response_data( state->shared_key, challenge, response); state->error = gfp_xdr_send(state->conn, "ib", state->expire, sizeof(response), response); if (state->error == GFARM_ERR_NO_ERROR && (state->error = gfp_xdr_flush(state->conn)) == GFARM_ERR_NO_ERROR) { gfarm_fd_event_set_callback(state->readable, gfarm_auth_request_sharedsecret_receive_result, state); timeout.tv_sec = GFARM_AUTH_TIMEOUT; timeout.tv_usec = 0; rv = gfarm_eventqueue_add_event(state->q, state->readable, &timeout); if (rv == 0) { /* go to gfarm_..._receive_result() */ return; } state->error = gfarm_errno_to_error(rv); } } if (state->continuation != NULL) (*state->continuation)(state->closure); } static void gfarm_auth_request_sharedsecret_receive_keytype(int events, int fd, void *closure, const struct timeval *t) { struct gfarm_auth_request_sharedsecret_state *state = closure; int rv, eof; struct timeval timeout; if ((events & GFARM_EVENT_TIMEOUT) != 0) { assert(events == GFARM_EVENT_TIMEOUT); state->error = GFARM_ERR_OPERATION_TIMED_OUT; gflog_debug(GFARM_MSG_1001060, "receiving keytype failed: %s", gfarm_error_string(state->error)); if (state->continuation != NULL) (*state->continuation)(state->closure); return; } assert(events == GFARM_EVENT_READ); /* We need just==1 here, because we may wait an event next. */ state->error = gfp_xdr_recv(state->conn, 1, &eof, "i", &state->proto_error); if (state->error == GFARM_ERR_NO_ERROR && eof) state->error = GFARM_ERR_PROTOCOL; if (state->error == GFARM_ERR_NO_ERROR) { if (state->proto_error != GFARM_AUTH_ERROR_NO_ERROR) { gfarm_fd_event_set_callback(state->writable, gfarm_auth_request_sharedsecret_send_giveup, state); rv = gfarm_eventqueue_add_event(state->q, state->writable, NULL); } else { gfarm_fd_event_set_callback(state->readable, gfarm_auth_request_sharedsecret_receive_challenge, state); timeout.tv_sec = GFARM_AUTH_TIMEOUT; timeout.tv_usec = 0; rv = gfarm_eventqueue_add_event(state->q, state->readable, &timeout); } if (rv == 0) { /* * go to * gfarm_auth_request_sharedsecret_send_giveup() * or *gfarm_auth_request_sharedsecret_receive_challenge() */ return; } state->error = gfarm_errno_to_error(rv); } if (state->continuation != NULL) (*state->continuation)(state->closure); } static void gfarm_auth_request_sharedsecret_send_keytype(int events, int fd, void *closure, const struct timeval *t) { struct gfarm_auth_request_sharedsecret_state *state = closure; int rv; struct timeval timeout; state->error_save = gfarm_auth_shared_key_get( &state->expire, state->shared_key, state->home, NULL, state->try == 0 ? GFARM_AUTH_SHARED_KEY_CREATE : GFARM_AUTH_SHARED_KEY_CREATE_FORCE, 0); if (state->error_save != GFARM_ERR_NO_ERROR) { gflog_auth_error(GFARM_MSG_1000020, "while accessing %s: %s", GFARM_AUTH_SHARED_KEY_PRINTNAME, gfarm_error_string(state->error_save)); gfarm_auth_request_sharedsecret_send_giveup(events, fd, closure, t); return; } state->error = gfp_xdr_send(state->conn, "i", GFARM_AUTH_SHAREDSECRET_MD5); if (state->error == GFARM_ERR_NO_ERROR && (state->error = gfp_xdr_flush(state->conn)) == GFARM_ERR_NO_ERROR){ timeout.tv_sec = GFARM_AUTH_TIMEOUT; timeout.tv_usec = 0; if ((rv = gfarm_eventqueue_add_event(state->q, state->readable, &timeout)) == 0) { /* go to gfarm_auth_request_sharedsecret * _receive_keytype() */ return; } state->error = gfarm_errno_to_error(rv); } if (state->continuation != NULL) (*state->continuation)(state->closure); } gfarm_error_t gfarm_auth_request_sharedsecret_multiplexed(struct gfarm_eventqueue *q, struct gfp_xdr *conn, const char *service_tag, const char *hostname, enum gfarm_auth_id_type self_type, void (*continuation)(void *), void *closure, void **statepp) { gfarm_error_t e; char *user, *home; struct gfarm_auth_request_sharedsecret_state *state; int rv, sock = gfp_xdr_fd(conn); /* XXX NOTYET deal with self_type == GFARM_AUTH_ID_TYPE_SPOOL_HOST */ user = gfarm_get_global_username(); home = gfarm_get_local_homedir(); if (user == NULL || home == NULL) /* not properly initialized */ return (GFARM_ERRMSG_AUTH_REQUEST_SHAREDSECRET_MULTIPLEXED_IMPLEMENTATION_ERROR); /* XXX It's better to check writable event here */ e = gfp_xdr_send(conn, "s", user); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001061, "sending user %s failed: %s", user, gfarm_error_string(e)); return (e); } GFARM_MALLOC(state); if (state == NULL) { gflog_debug(GFARM_MSG_1001062, "allocation of 'state' failed: %s", gfarm_error_string(GFARM_ERR_NO_MEMORY)); return (GFARM_ERR_NO_MEMORY); } state->writable = gfarm_fd_event_alloc( GFARM_EVENT_WRITE, sock, gfarm_auth_request_sharedsecret_send_keytype, state); if (state->writable == NULL) { e = GFARM_ERR_NO_MEMORY; gflog_debug(GFARM_MSG_1001063, "allocation of 'writable' failed: %s", gfarm_error_string(e)); goto error_free_state; } /* * We cannt use two independent events (i.e. a fd_event with * GFARM_EVENT_READ flag and a timer_event) here, because * it's possible that both event handlers are called at once. */ state->readable = gfarm_fd_event_alloc( GFARM_EVENT_READ|GFARM_EVENT_TIMEOUT, sock, gfarm_auth_request_sharedsecret_receive_keytype, state); if (state->readable == NULL) { e = GFARM_ERR_NO_MEMORY; gflog_debug(GFARM_MSG_1001064, "allocation of 'readable' failed: %s", gfarm_error_string(e)); goto error_free_writable; } /* go to gfarm_auth_request_sharedsecret_send_user() */ rv = gfarm_eventqueue_add_event(q, state->writable, NULL); if (rv != 0) { e = gfarm_errno_to_error(rv); gflog_debug(GFARM_MSG_1001065, "addition of event failed: %s", gfarm_error_string(e)); goto error_free_readable; } state->q = q; state->conn = conn; state->continuation = continuation; state->closure = closure; state->home = home; state->try = 0; state->error = state->error_save = GFARM_ERR_NO_ERROR; *statepp = state; return (GFARM_ERR_NO_ERROR); error_free_readable: gfarm_event_free(state->readable); error_free_writable: gfarm_event_free(state->writable); error_free_state: free(state); return (e); } gfarm_error_t gfarm_auth_result_sharedsecret_multiplexed(void *sp) { struct gfarm_auth_request_sharedsecret_state *state = sp; gfarm_error_t e = state->error; gfarm_event_free(state->readable); gfarm_event_free(state->writable); free(state); return (e); } /* * multiplexed version of gfs_auth_request() for parallel authentication */ struct gfarm_auth_request_state { struct gfarm_eventqueue *q; struct gfarm_event *readable, *writable; struct gfp_xdr *conn; const char *service_tag; const char *name; struct sockaddr *addr; enum gfarm_auth_id_type self_type; void (*continuation)(void *); void *closure; gfarm_int32_t methods, server_methods; /* bitset */ /* loop state */ int auth_method_index; void *method_state; gfarm_error_t last_error; /* results */ gfarm_error_t error; }; static void gfarm_auth_request_next_method(struct gfarm_auth_request_state *state) { int rv; if (state->last_error == GFARM_ERR_NO_ERROR || (state->last_error != GFARM_ERR_PROTOCOL_NOT_SUPPORTED && state->last_error != GFARM_ERR_EXPIRED && state->last_error != GFARM_ERR_PERMISSION_DENIED && state->last_error != GFARM_ERR_AUTHENTICATION)) { state->error = state->last_error; } else { if ((rv = gfarm_eventqueue_add_event(state->q, state->writable, NULL)) == 0) { ++state->auth_method_index; /* go to gfarm_auth_request_loop_ask_method() */ return; } state->error = gfarm_errno_to_error(rv); } if (state->continuation != NULL) (*state->continuation)(state->closure); } static void gfarm_auth_request_dispatch_result(void *closure) { struct gfarm_auth_request_state *state = closure; state->last_error = (*gfarm_auth_trial_table[state->auth_method_index]. result_multiplexed)(state->method_state); gfarm_auth_request_next_method(state); } static void gfarm_auth_request_dispatch_method(int events, int fd, void *closure, const struct timeval *t) { struct gfarm_auth_request_state *state = closure; int eof; gfarm_int32_t error; if ((events & GFARM_EVENT_TIMEOUT) != 0) { assert(events == GFARM_EVENT_TIMEOUT); state->error = GFARM_ERR_OPERATION_TIMED_OUT; gflog_debug(GFARM_MSG_1001066, "dispatch method failed: %s", gfarm_error_string(state->error)); if (state->continuation != NULL) (*state->continuation)(state->closure); return; } assert(events == GFARM_EVENT_READ); state->error = gfp_xdr_recv(state->conn, 1, &eof, "i", &error); if (state->error == GFARM_ERR_NO_ERROR && eof) state->error = GFARM_ERR_PROTOCOL; if (state->error == GFARM_ERR_NO_ERROR && error != GFARM_AUTH_ERROR_NO_ERROR) state->error = GFARM_ERR_PROTOCOL; if (state->error == GFARM_ERR_NO_ERROR) { if (gfarm_auth_trial_table[state->auth_method_index].method != GFARM_AUTH_METHOD_NONE) { state->last_error = (*gfarm_auth_trial_table[state->auth_method_index]. request_multiplexed)(state->q, state->conn, state->service_tag, state->name, state->self_type, gfarm_auth_request_dispatch_result, state, &state->method_state); if (state->last_error == GFARM_ERR_NO_ERROR) { /* * call gfarm_auth_request_$method, then * go to gfarm_auth_request_dispatch_result() */ return; } gfarm_auth_request_next_method(state); return; } /* give up */ if (state->server_methods == 0) { state->error = GFARM_ERR_PERMISSION_DENIED; } else if ((state->methods & state->server_methods) == 0) { state->error = GFARM_ERR_PROTOCOL_NOT_SUPPORTED; } else { state->error = state->last_error != GFARM_ERR_NO_ERROR ? state->last_error : GFARM_ERRMSG_AUTH_REQUEST_MULTIPLEXED_MPLEMENTATION_ERROR; } } if (state->continuation != NULL) (*state->continuation)(state->closure); } static void gfarm_auth_request_loop_ask_method(int events, int fd, void *closure, const struct timeval *t) { struct gfarm_auth_request_state *state = closure; gfarm_int32_t method; /* enum gfarm_auth_method */ int rv; struct timeval timeout; method = gfarm_auth_trial_table[state->auth_method_index].method; while (method != GFARM_AUTH_METHOD_NONE && (state->methods & state->server_methods & (1 << method)) == 0) { method = gfarm_auth_trial_table[++state->auth_method_index].method; } state->error = gfp_xdr_send(state->conn, "i", method); if (state->error == GFARM_ERR_NO_ERROR && (state->error = gfp_xdr_flush(state->conn)) == GFARM_ERR_NO_ERROR){ gfarm_fd_event_set_callback(state->readable, gfarm_auth_request_dispatch_method, state); timeout.tv_sec = GFARM_AUTH_TIMEOUT; timeout.tv_usec = 0; if ((rv = gfarm_eventqueue_add_event(state->q, state->readable, &timeout)) == 0) { /* go to gfarm_auth_request_dispatch_method() */ return; } state->error = gfarm_errno_to_error(rv); } if (state->continuation != NULL) (*state->continuation)(state->closure); } static void gfarm_auth_request_receive_server_methods(int events, int fd, void *closure, const struct timeval *t) { struct gfarm_auth_request_state *state = closure; int rv, i, eof; size_t nmethods; unsigned char methods_buffer[GFARM_AUTH_METHODS_BUFFER_SIZE]; if ((events & GFARM_EVENT_TIMEOUT) != 0) { assert(events == GFARM_EVENT_TIMEOUT); state->error = GFARM_ERR_OPERATION_TIMED_OUT; gflog_debug(GFARM_MSG_1001067, "receiving server methods failed: %s", gfarm_error_string(state->error)); if (state->continuation != NULL) (*state->continuation)(state->closure); return; } assert(events == GFARM_EVENT_READ); state->error = gfp_xdr_recv(state->conn, 0, &eof, "b", sizeof(methods_buffer), &nmethods, methods_buffer); if (state->error == GFARM_ERR_NO_ERROR && eof) state->error = GFARM_ERR_PROTOCOL; if (state->error == GFARM_ERR_NO_ERROR) { state->server_methods = 0; for (i = 0; i < nmethods; i++) { if (methods_buffer[i] <= GFARM_AUTH_METHOD_NONE || methods_buffer[i] >= GFARM_AUTH_METHOD_NUMBER) continue; state->server_methods |= 1 << methods_buffer[i]; } if ((rv = gfarm_eventqueue_add_event(state->q, state->writable, NULL)) == 0) { state->last_error = GFARM_ERR_NO_ERROR; state->auth_method_index = 0; /* go to gfarm_auth_request_loop_ask_method() */ return; } state->error = gfarm_errno_to_error(rv); } if (state->continuation != NULL) (*state->continuation)(state->closure); } gfarm_error_t gfarm_auth_request_multiplexed(struct gfarm_eventqueue *q, struct gfp_xdr *conn, const char *service_tag, const char *name, struct sockaddr *addr, enum gfarm_auth_id_type self_type, void (*continuation)(void *), void *closure, struct gfarm_auth_request_state **statepp) { gfarm_error_t e; int rv, sock = gfp_xdr_fd(conn); struct gfarm_auth_request_state *state; gfarm_int32_t methods; /* bitset */ struct timeval timeout; assert(GFARM_AUTH_METHOD_NUMBER <= sizeof(gfarm_int32_t) * CHAR_BIT); methods = gfarm_auth_method_get_enabled_by_name_addr(name, addr); if (methods == 0) { gflog_debug(GFARM_MSG_1001068, "Auth method not available for host %s", name); return (GFARM_ERRMSG_AUTH_METHOD_NOT_AVAILABLE_FOR_THE_HOST); } methods &= gfarm_auth_method_get_available(); if (methods == 0) { gflog_debug(GFARM_MSG_1001069, "No usable auth method configured"); return (GFARM_ERRMSG_USABLE_AUTH_METHOD_IS_NOT_CONFIGURED); } GFARM_MALLOC(state); if (state == NULL) { gflog_debug(GFARM_MSG_1001070, "allocation of 'state' failed: %s", gfarm_error_string(GFARM_ERR_NO_MEMORY)); return (GFARM_ERR_NO_MEMORY); } state->writable = gfarm_fd_event_alloc( GFARM_EVENT_WRITE, sock, gfarm_auth_request_loop_ask_method, state); if (state->writable == NULL) { e = GFARM_ERR_NO_MEMORY; gflog_debug(GFARM_MSG_1001071, "allocation of 'writable' failed: %s", gfarm_error_string(e)); goto error_free_state; } /* * We cannot use two independent events (i.e. a fd_event with * GFARM_EVENT_READ flag and a timer_event) here, because * it's possible that both event handlers are called at once. */ state->readable = gfarm_fd_event_alloc( GFARM_EVENT_READ|GFARM_EVENT_TIMEOUT, sock, gfarm_auth_request_receive_server_methods, state); if (state->readable == NULL) { e = GFARM_ERR_NO_MEMORY; gflog_debug(GFARM_MSG_1001072, "allocation of 'readable' failed: %s", gfarm_error_string(e)); goto error_free_writable; } /* go to gfarm_auth_request_receive_server_methods() */ timeout.tv_sec = GFARM_AUTH_TIMEOUT; timeout.tv_usec = 0; rv = gfarm_eventqueue_add_event(q, state->readable, &timeout); if (rv != 0) { e = gfarm_errno_to_error(rv); gflog_debug(GFARM_MSG_1001073, "addition of event failed: %s", gfarm_error_string(e)); goto error_free_readable; } state->q = q; state->conn = conn; state->service_tag = service_tag; state->name = name; state->addr = addr; state->self_type = self_type; state->methods = methods; state->continuation = continuation; state->closure = closure; state->error = GFARM_ERR_NO_ERROR; *statepp = state; return (GFARM_ERR_NO_ERROR); error_free_readable: gfarm_event_free(state->readable); error_free_writable: gfarm_event_free(state->writable); error_free_state: free(state); return (e); } gfarm_error_t gfarm_auth_result_multiplexed(struct gfarm_auth_request_state *state, enum gfarm_auth_method *auth_methodp) { gfarm_error_t e = state->error; if (e == GFARM_ERR_NO_ERROR) { if (auth_methodp != NULL) *auth_methodp = gfarm_auth_trial_table[ state->auth_method_index].method; } gfarm_event_free(state->readable); gfarm_event_free(state->writable); free(state); return (e); } static enum gfarm_auth_id_type gfarm_auth_type = GFARM_AUTH_ID_TYPE_USER; gfarm_error_t gfarm_set_auth_id_type(enum gfarm_auth_id_type type) { gfarm_auth_type = type; return (GFARM_ERR_NO_ERROR); } enum gfarm_auth_id_type gfarm_get_auth_id_type(void) { return (gfarm_auth_type); } gfarm-2.4.1/lib/libgfarm/gfarm/config.c0000644000000000000000000013656711507222723016371 0ustar rootroot/* * $Id: config.c 5018 2010-12-30 08:35:34Z tatebe $ */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include /* ntohs */ #include #include #include #include #include "gfutil.h" #include "liberror.h" #include "patmatch.h" #include "hostspec.h" #include "param.h" #include "sockopt.h" #include "host.h" /* XXX address_use is disabled for now */ #include "auth.h" #include "gfpath.h" #include "config.h" #include "gfm_proto.h" /* GFMD_DEFAULT_PORT */ #include "gfs_proto.h" /* GFSD_DEFAULT_PORT */ #include "gfs_profile.h" char *gfarm_config_file = GFARM_CONFIG; void gfarm_config_set_filename(char *filename) { gfarm_config_file = filename; } /* XXX move actual function definition here */ static gfarm_error_t gfarm_strtoken(char **, char **); /* * xattr cache handling */ static gfarm_stringlist xattr_cache_list; /* * NOTE: * client host should call gfs_stat_cache_clear() after * calling this gfarm_xattr_caching_pattern_add() function, * otherwise unexpected GFARM_ERR_NO_SUCH_OBJECT may happen. * * The reason we don't call gfs_stat_cache_clear() automatically is * because it's not appropriate for gfmd. */ gfarm_error_t gfarm_xattr_caching_pattern_add(const char *attr_pattern) { gfarm_error_t e; char *pat = strdup(attr_pattern); if (pat == NULL) { gflog_debug(GFARM_MSG_1002446, "failed to allocate an attr_pattern \"%s\": no memory", attr_pattern); return (GFARM_ERR_NO_MEMORY); } e = gfarm_stringlist_add(&xattr_cache_list, pat); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1002447, "failed to allocate record an attr_pattern \"%s\": " "no memory", attr_pattern); free(pat); } return (e); } int gfarm_xattr_caching(const char *attrname) { int i, n = gfarm_stringlist_length(&xattr_cache_list); const char *pattern; for (i = 0; i < n; i++) { pattern = gfarm_stringlist_elem(&xattr_cache_list, i); if (gfarm_pattern_match(pattern, attrname, 0)) return (1); } return (0); } int gfarm_xattr_caching_patterns_number(void) { return (gfarm_stringlist_length(&xattr_cache_list)); } char ** gfarm_xattr_caching_patterns(void) { return (GFARM_STRINGLIST_STRARRAY(xattr_cache_list)); } /* * GFarm username handling */ static gfarm_stringlist local_user_map_file_list; static gfarm_stringlist local_group_map_file_list; /* the return value of the following function should be free(3)ed */ static gfarm_error_t map_user(gfarm_stringlist *map_file_list, char *from, char **to_p, char *(*mapping)(char *, char *, char *), gfarm_error_t error_redefined) { gfarm_error_t e = GFARM_ERR_NO_ERROR; FILE *map = NULL; char *mapfile = NULL; int i, list_len, mapfile_mapped_index; char buffer[1024], *g_user, *l_user, *mapped, *tmp; int lineno = 0; *to_p = NULL; list_len = gfarm_stringlist_length(map_file_list); mapfile_mapped_index = list_len; for (i = 0; i < list_len; i++) { mapfile = gfarm_stringlist_elem(map_file_list, i); if ((map = fopen(mapfile, "r")) == NULL) { gflog_error(GFARM_MSG_1000009, "%s: cannot open: %s", mapfile, strerror(errno)); return (GFARM_ERR_CANT_OPEN); } lineno = 0; while (fgets(buffer, sizeof buffer, map) != NULL) { char *bp = buffer; lineno++; e = gfarm_strtoken(&bp, &g_user); if (e != GFARM_ERR_NO_ERROR) goto finish; if (g_user == NULL) /* blank or comment line */ continue; e = gfarm_strtoken(&bp, &l_user); if (e != GFARM_ERR_NO_ERROR) goto finish; if (l_user == NULL) { e = GFARM_ERRMSG_MISSING_LOCAL_USER; goto finish; } mapped = (*mapping)(from, g_user, l_user); if (mapped != NULL) { if (*to_p != NULL && strcmp(mapped, *to_p) != 0 && i == mapfile_mapped_index) { e = error_redefined; goto finish; } if (*to_p == NULL) { *to_p = strdup(mapped); if (*to_p == NULL) { e = GFARM_ERR_NO_MEMORY; goto finish; } } mapfile_mapped_index = i; } e = gfarm_strtoken(&bp, &tmp); if (e != GFARM_ERR_NO_ERROR) goto finish; if (tmp != NULL) { e = GFARM_ERRMSG_TOO_MANY_ARGUMENTS; goto finish; } } fclose(map); map = NULL; } if (*to_p == NULL) { /* not found */ *to_p = strdup(from); if (*to_p == NULL) e = GFARM_ERR_NO_MEMORY; } finish: if (map != NULL) fclose(map); if (e != GFARM_ERR_NO_ERROR) { if (*to_p != NULL) free(*to_p); gflog_error(GFARM_MSG_1000010, "%s line %d: %s", mapfile, lineno, gfarm_error_string(e)); } return (e); } static char * map_global_to_local(char *from, char *global_user, char *local_user) { if (strcmp(from, global_user) == 0) return (local_user); return (NULL); } /* * XXX FIXME This function should not be used by gfarm clients, * because this doesn't cope with multiple metadata server. * Thus, this function only should be called from gfmd and gfsd, * and should move to config_server.c. */ /* the return value of the following function should be free(3)ed */ gfarm_error_t gfarm_global_to_local_username(char *global_user, char **local_user_p) { return (map_user(&local_user_map_file_list, global_user, local_user_p, map_global_to_local, GFARM_ERRMSG_GLOBAL_USER_REDEFIEND)); } static char * map_local_to_global(char *from, char *global_user, char *local_user) { if (strcmp(from, local_user) == 0) return (global_user); return (NULL); } /* * XXX FIXME This function should not be used by gfarm clients, * because this doesn't cope with multiple metadata server. * Thus, this function only should be called from gfmd and gfsd, * and should move to config_server.c. */ /* the return value of the following function should be free(3)ed */ gfarm_error_t gfarm_local_to_global_username(char *local_user, char **global_user_p) { return (map_user(&local_user_map_file_list, local_user, global_user_p, map_local_to_global, GFARM_ERRMSG_LOCAL_USER_REDEFIEND)); } /* * XXX FIXME This function should not be used by gfarm clients, * because this doesn't cope with multiple metadata server. * Thus, this function only should be called from gfmd and gfsd, * and should move to config_server.c. */ /* the return value of the following function should be free(3)ed */ gfarm_error_t gfarm_global_to_local_groupname(char *global_user, char **local_user_p) { return (map_user(&local_group_map_file_list, global_user, local_user_p, map_global_to_local, GFARM_ERRMSG_GLOBAL_GROUP_REDEFIEND)); } /* * XXX FIXME This function should not be used by gfarm clients, * because this doesn't cope with multiple metadata server. * Thus, this function only should be called from gfmd and gfsd, * and should move to config_server.c. */ /* the return value of the following function should be free(3)ed */ gfarm_error_t gfarm_local_to_global_groupname(char *local_user, char **global_user_p) { return (map_user(&local_group_map_file_list, local_user, global_user_p, map_local_to_global, GFARM_ERRMSG_LOCAL_GROUP_REDEFIEND)); } static gfarm_error_t set_string(char **var, char *value) { if (*var != NULL) free(*var); *var = strdup(value); if (*var == NULL) { gflog_debug(GFARM_MSG_1000918, "allocation of memory failed: %s", gfarm_error_string(GFARM_ERR_NO_MEMORY)); return (GFARM_ERR_NO_MEMORY); } return (GFARM_ERR_NO_ERROR); } /* * client side variables */ static char *gfarm_global_username = NULL; static char *gfarm_local_username = NULL; static char *gfarm_local_homedir = NULL; gfarm_error_t gfarm_set_global_username(char *global_username) { return (set_string(&gfarm_global_username, global_username)); } char * gfarm_get_global_username(void) { return (gfarm_global_username); } gfarm_error_t gfarm_set_local_username(char *local_username) { return (set_string(&gfarm_local_username, local_username)); } char * gfarm_get_local_username(void) { return (gfarm_local_username); } gfarm_error_t gfarm_set_local_homedir(char *local_homedir) { return (set_string(&gfarm_local_homedir, local_homedir)); } char * gfarm_get_local_homedir(void) { return (gfarm_local_homedir); } /* * We should not trust gfarm_get_*() values as a result of this function * (because it may be forged). */ gfarm_error_t gfarm_set_local_user_for_this_local_account(void) { gfarm_error_t error; struct passwd pwbuf, *pwd; char *buf; static int bufsize = 0; # define BUFSIZE_MAX 2048 if (bufsize == 0) { bufsize = sysconf(_SC_GETPW_R_SIZE_MAX); if (bufsize == -1) bufsize = BUFSIZE_MAX; } buf = malloc(bufsize); if (buf == NULL) { error = GFARM_ERR_NO_MEMORY; gflog_error(GFARM_MSG_1000011, "gfarm_set_local_user: %s", gfarm_error_string(error)); return (error); } if (getpwuid_r(geteuid(), &pwbuf, buf, bufsize, &pwd) != 0) { gflog_error(GFARM_MSG_1000012, "local account doesn't exist"); error = GFARM_ERR_NO_SUCH_OBJECT; goto error; } error = gfarm_set_local_username(pwd->pw_name); if (error == GFARM_ERR_NO_ERROR) error = gfarm_set_local_homedir(pwd->pw_dir); error: free(buf); return (error); } /* * GFarm Configurations. * * Initial string values should be NULL, otherwise the value incorrectly * free(3)ed in the gfarm_config_clear() function below. * If you would like to provide default value other than NULL, set the * value at gfarm_config_set_default*(). */ /* GFS dependent */ char *gfarm_spool_server_listen_address = NULL; char *gfarm_spool_root = NULL; /* GFM dependent */ char *gfarm_metadb_server_name = NULL; static char *gfarm_metadb_server_portname = NULL; int gfarm_metadb_server_port = GFMD_DEFAULT_PORT; enum gfarm_backend_db_type gfarm_backend_db_type = GFARM_BACKEND_DB_TYPE_UNKNOWN; char *gfarm_metadb_admin_user = NULL; char *gfarm_metadb_admin_user_gsi_dn = NULL; /* LDAP dependent */ char *gfarm_ldap_server_name = NULL; char *gfarm_ldap_server_port = NULL; char *gfarm_ldap_base_dn = NULL; char *gfarm_ldap_bind_dn = NULL; char *gfarm_ldap_bind_password = NULL; char *gfarm_ldap_tls = NULL; char *gfarm_ldap_tls_cipher_suite = NULL; char *gfarm_ldap_tls_certificate_key_file = NULL; char *gfarm_ldap_tls_certificate_file = NULL; /* PostgreSQL dependent */ char *gfarm_postgresql_server_name = NULL; char *gfarm_postgresql_server_port = NULL; char *gfarm_postgresql_dbname = NULL; char *gfarm_postgresql_user = NULL; char *gfarm_postgresql_password = NULL; char *gfarm_postgresql_conninfo = NULL; /* LocalFS dependent */ char *gfarm_localfs_datadir = NULL; /* miscellaneous */ #define GFARM_LOG_MESSAGE_VERBOSE_DEFAULT 0 #define GFARM_NO_FILE_SYSTEM_NODE_TIMEOUT_DEFAULT 30 /* 30 seconds */ #define GFARM_GFMD_RECONNECTION_TIMEOUT_DEFAULT 30 /* 30 seconds */ #define GFARM_ATTR_CACHE_LIMIT_DEFAULT 40000 /* 40,000 entries */ #define GFARM_ATTR_CACHE_TIMEOUT_DEFAULT 1000 /* 1,000 milli second */ #define GFARM_SCHEDULE_CACHE_TIMEOUT_DEFAULT 600 /* 10 minutes */ #define GFARM_SCHEDULE_IDLE_LOAD_DEFAULT 0.1F #define GFARM_SCHEDULE_BUSY_LOAD_DEFAULT 0.5F #define GFARM_SCHEDULE_VIRTUAL_LOAD_DEFAULT 0.3F #define GFARM_SCHEDULE_WRITE_LOCAL_PRIORITY_DEFAULT 1 /* enable */ #define GFARM_MINIMUM_FREE_DISK_SPACE_DEFAULT (128 * 1024 * 1024) /* 128MB */ #define GFARM_SIMULTANEOUS_REPLICATION_RECEIVERS_DEFAULT 20 #define GFARM_GFSD_CONNECTION_CACHE_DEFAULT 16 /* 16 free connections */ #define GFARM_GFMD_CONNECTION_CACHE_DEFAULT 8 /* 8 free connections */ #define GFARM_RECORD_ATIME_DEFAULT 1 /* enable */ #define MISC_DEFAULT -1 int gfarm_log_level = MISC_DEFAULT; int gfarm_log_message_verbose = MISC_DEFAULT; int gfarm_no_file_system_node_timeout = MISC_DEFAULT; int gfarm_gfmd_reconnection_timeout = MISC_DEFAULT; int gfarm_attr_cache_limit = MISC_DEFAULT; int gfarm_attr_cache_timeout = MISC_DEFAULT; int gfarm_schedule_cache_timeout = MISC_DEFAULT; float gfarm_schedule_idle_load = MISC_DEFAULT; float gfarm_schedule_busy_load = MISC_DEFAULT; float gfarm_schedule_virtual_load = MISC_DEFAULT; static char *schedule_write_target_domain = NULL; static int schedule_write_local_priority = MISC_DEFAULT; gfarm_int64_t gfarm_minimum_free_disk_space = MISC_DEFAULT; int gfarm_simultaneous_replication_receivers = MISC_DEFAULT; int gfarm_gfsd_connection_cache = MISC_DEFAULT; int gfarm_gfmd_connection_cache = MISC_DEFAULT; int gfarm_metadb_stack_size = MISC_DEFAULT; int gfarm_metadb_thread_pool_size = MISC_DEFAULT; int gfarm_metadb_job_queue_length = MISC_DEFAULT; int gfarm_metadb_heartbeat_interval = MISC_DEFAULT; int gfarm_metadb_dbq_size = MISC_DEFAULT; int gfarm_record_atime = MISC_DEFAULT; void gfarm_config_clear(void) { static char **vars[] = { &gfarm_spool_server_listen_address, &gfarm_spool_root, &gfarm_metadb_server_name, &gfarm_metadb_server_portname, &gfarm_metadb_admin_user, &gfarm_metadb_admin_user_gsi_dn, &gfarm_ldap_server_name, &gfarm_ldap_server_port, &gfarm_ldap_base_dn, &gfarm_ldap_bind_dn, &gfarm_ldap_bind_password, &gfarm_ldap_tls, &gfarm_ldap_tls_cipher_suite, &gfarm_ldap_tls_certificate_key_file, &gfarm_ldap_tls_certificate_file, &gfarm_postgresql_server_name, &gfarm_postgresql_server_port, &gfarm_postgresql_dbname, &gfarm_postgresql_user, &gfarm_postgresql_password, &gfarm_postgresql_conninfo, &gfarm_localfs_datadir, &schedule_write_target_domain, }; int i; for (i = 0; i < GFARM_ARRAY_LENGTH(vars); i++) { if (*vars[i] != NULL) { free(*vars[i]); *vars[i] = NULL; } } #if 0 /* XXX */ config_read = gfarm_config_not_read; #endif } static gfarm_error_t set_backend_db_type(enum gfarm_backend_db_type set) { if (gfarm_backend_db_type == set) return (GFARM_ERR_NO_ERROR); switch (gfarm_backend_db_type) { case GFARM_BACKEND_DB_TYPE_UNKNOWN: gfarm_backend_db_type = set; return (GFARM_ERR_NO_ERROR); case GFARM_BACKEND_DB_TYPE_LDAP: return (GFARM_ERRMSG_BACKEND_ALREADY_LDAP); case GFARM_BACKEND_DB_TYPE_POSTGRESQL: return (GFARM_ERRMSG_BACKEND_ALREADY_POSTGRESQL); case GFARM_BACKEND_DB_TYPE_LOCALFS: return (GFARM_ERRMSG_BACKEND_ALREADY_LOCALFS); default: assert(0); return (GFARM_ERR_UNKNOWN); /* workaround compiler warning */ } } static gfarm_error_t set_backend_db_type_ldap(void) { return (set_backend_db_type(GFARM_BACKEND_DB_TYPE_LDAP)); } static gfarm_error_t set_backend_db_type_postgresql(void) { return (set_backend_db_type(GFARM_BACKEND_DB_TYPE_POSTGRESQL)); } static gfarm_error_t set_backend_db_type_localfs(void) { return (set_backend_db_type(GFARM_BACKEND_DB_TYPE_LOCALFS)); } int gfarm_schedule_write_local_priority(void) { return (schedule_write_local_priority); } char * gfarm_schedule_write_target_domain(void) { return (schedule_write_target_domain); } gfarm_off_t gfarm_get_minimum_free_disk_space(void) { return (gfarm_minimum_free_disk_space); } void gfarm_set_record_atime(int boolean) { gfarm_record_atime = boolean; } /* * get (almost) shell style token. * e.g. * string... * 'string...' (do not interpret escape character `\') * "string..." (interpret escape character `\') * # comment * difference from shell token: * don't allow newline in "..." and '...". * * return value: * string * OR * NULL - if error or end-of-line. * output parameter: * *cursorp: * next character to read * *errorp: * NULL (if success or end-of-line) * OR * error message */ gfarm_error_t gfarm_strtoken(char **cursorp, char **tokenp) { unsigned char *top, *p, *s = *(unsigned char **)cursorp; while (*s != '\n' && isspace(*s)) s++; if (*s == '\0' || *s == '\n' || *s == '#') { /* end of line */ *cursorp = (char *)s; *tokenp = NULL; return (GFARM_ERR_NO_ERROR); } top = s; p = s; for (;;) { switch (*s) { case '\'': s++; for (;;) { if (*s == '\'') break; if (*s == '\0' || *s == '\n') { gflog_debug(GFARM_MSG_1000919, "Unterminated single quote " "found in string"); return (GFARM_ERRMSG_UNTERMINATED_SINGLE_QUOTE); } *p++ = *s++; } s++; break; case '"': s++; for (;;) { if (*s == '"') break; if (*s == '\0' || *s == '\n') { gflog_debug(GFARM_MSG_1000920, "Unterminated double quote " "found in string"); return (GFARM_ERRMSG_UNTERMINATED_DOUBLE_QUOTE); } if (*s == '\\') { if (s[1] == '\0' || s[1] == '\n') { gflog_debug(GFARM_MSG_1000921, "Unterminated double " "quote found in string" ); return (GFARM_ERRMSG_UNTERMINATED_DOUBLE_QUOTE); } /* * only interpret `\"' and `\\' * in double quotation. */ if (s[1] == '"' || s[1] == '\\') s++; } *p++ = *s++; } s++; break; case '\\': s++; if (*s == '\0' || *s == '\n') { gflog_debug(GFARM_MSG_1000922, "Incomplete escape found in string"); return (GFARM_ERRMSG_INCOMPLETE_ESCAPE); } *p++ = *s++; break; case '\n': case '#': case '\0': *p = '\0'; *cursorp = (char *)s; *tokenp = (char *)top; return (GFARM_ERR_NO_ERROR); default: if (isspace(*s)) { *p = '\0'; *cursorp = (char *)(s + 1); *tokenp = (char *)top; return (GFARM_ERR_NO_ERROR); } *p++ = *s++; break; } } } static gfarm_error_t parse_auth_arguments(char *p, char **op) { gfarm_error_t e; char *tmp, *command, *auth, *host; enum gfarm_auth_method auth_method; struct gfarm_hostspec *hostspecp; /* assert(strcmp(*op, "auth") == 0); */ e = gfarm_strtoken(&p, &command); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1000923, "parsing of auth command argument (%s) failed: %s", p, gfarm_error_string(e)); return (e); } if (command == NULL) { gflog_debug(GFARM_MSG_1000924, "Missing first auth command argument"); return (GFARM_ERRMSG_MISSING_1ST_AUTH_COMMAND_ARGUMENT); } e = gfarm_strtoken(&p, &auth); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1000925, "parsing of auth method argument (%s) failed: %s", p, gfarm_error_string(e)); return (e); } if (auth == NULL) { gflog_debug(GFARM_MSG_1000926, "Missing second auth method argument"); return (GFARM_ERRMSG_MISSING_2ND_AUTH_METHOD_ARGUMENT); } if (strcmp(auth, "*") == 0 || strcmp(auth, "ALL") == 0) { auth_method = GFARM_AUTH_METHOD_ALL; } else { e = gfarm_auth_method_parse(auth, &auth_method); if (e != GFARM_ERR_NO_ERROR) { *op = "2nd(auth-method) argument"; if (e == GFARM_ERR_NO_SUCH_OBJECT) e = GFARM_ERRMSG_UNKNOWN_AUTH_METHOD; gflog_debug(GFARM_MSG_1000927, "parsing of auth method (%s) failed: %s", auth, gfarm_error_string(e)); return (e); } } e = gfarm_strtoken(&p, &host); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1000928, "parsing of auth host argument (%s) failed: %s", p, gfarm_error_string(e)); return (e); } if (host == NULL) { gflog_debug(GFARM_MSG_1000929, "Missing third auth host spec argument"); return (GFARM_ERRMSG_MISSING_3RD_HOST_SPEC_ARGUMENT); } e = gfarm_strtoken(&p, &tmp); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1000930, "parsing of auth arguments (%s) failed: %s", p, gfarm_error_string(e)); return (e); } if (tmp != NULL) { gflog_debug(GFARM_MSG_1000931, "Too many auth arguments passed"); return (GFARM_ERRMSG_TOO_MANY_ARGUMENTS); } e = gfarm_hostspec_parse(host, &hostspecp); if (e != GFARM_ERR_NO_ERROR) { /* * we don't return `host' to *op here, * because it may be too long. */ *op = "3rd(host-spec) argument"; gflog_debug(GFARM_MSG_1000932, "parsing of auth host spec (%s) failed: %s", host, gfarm_error_string(e)); return (e); } if (strcmp(command, "enable") == 0) { e = gfarm_auth_enable(auth_method, hostspecp); } else if (strcmp(command, "disable") == 0) { e = gfarm_auth_disable(auth_method, hostspecp); } else { /* * we don't return `command' to *op here, * because it may be too long. */ *op = "1st(auth-command) argument"; gfarm_hostspec_free(hostspecp); gflog_debug(GFARM_MSG_1000933, "Unknown auth subcommand (%s)", command); return (GFARM_ERRMSG_UNKNOWN_AUTH_SUBCOMMAND); } if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1000934, "Failed to enable/disable auth (%s)(%s)(%s): (%s)", command, auth, host, gfarm_error_string(e)); gfarm_hostspec_free(hostspecp); } return (e); } static gfarm_error_t parse_netparam_arguments(char *p, char **op) { gfarm_error_t e; char *tmp, *option, *host; struct gfarm_hostspec *hostspecp; /* assert(strcmp(*op, "netparam") == 0); */ e = gfarm_strtoken(&p, &option); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1000935, "parsing of netparam option argument (%s) failed: %s", p, gfarm_error_string(e)); return (e); } if (option == NULL) { gflog_debug(GFARM_MSG_1000936, "Missing first netparam option argument"); return (GFARM_ERRMSG_MISSING_NETPARAM_OPTION_ARGUMENT); } e = gfarm_strtoken(&p, &host); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1000937, "parsing of netparam host argument (%s) failed: %s", p, gfarm_error_string(e)); return (e); } if (host == NULL) { /* if 2nd argument is omitted, it is treated as "*". */ host = "*"; } else if ((e = gfarm_strtoken(&p, &tmp)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1000938, "parsing of netparam arguments (%s) failed: %s", p, gfarm_error_string(e)); return (e); } else if (tmp != NULL) { gflog_debug(GFARM_MSG_1000939, "Too many netparam arguments passed"); return (GFARM_ERRMSG_TOO_MANY_ARGUMENTS); } e = gfarm_hostspec_parse(host, &hostspecp); if (e != GFARM_ERR_NO_ERROR) { /* * we don't return `host' to *op here, * because it may be too long. */ *op = "2nd(host-spec) argument"; gflog_debug(GFARM_MSG_1000940, "parsing of netparam host spec (%s) failed: %s", host, gfarm_error_string(e)); return (e); } e = gfarm_netparam_config_add_long(option, hostspecp); if (e != GFARM_ERR_NO_ERROR) { /* * we don't return `option' to *op here, * because it may be too long. */ *op = "1st(sockopt-option) argument"; gfarm_hostspec_free(hostspecp); gflog_debug(GFARM_MSG_1000941, "add netparam config (%s)(%s) failed: %s", host, option, gfarm_error_string(e)); return (e); } return (GFARM_ERR_NO_ERROR); } static gfarm_error_t parse_sockopt_arguments(char *p, char **op) { gfarm_error_t e; char *tmp, *option, *host; struct gfarm_hostspec *hostspecp; int is_listener; /* assert(strcmp(*op, "sockopt") == 0); */ e = gfarm_strtoken(&p, &option); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1000942, "parsing of sockopt option argument (%s) failed: %s", p, gfarm_error_string(e)); return (e); } if (option == NULL) { gflog_debug(GFARM_MSG_1000943, "Missing sockopt option argument"); return (GFARM_ERRMSG_MISSING_SOCKOPT_OPTION_ARGUMENT); } e = gfarm_strtoken(&p, &host); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1000944, "parsing of sockopt host argument (%s) failed: %s", p, gfarm_error_string(e)); return (e); } if (host == NULL) { /* * if 2nd argument is omitted, it is treated as: * "LISTENER" + "*". */ is_listener = 1; } else { is_listener = strcmp(host, "LISTENER") == 0; if ((e = gfarm_strtoken(&p, &tmp)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1000945, "parsing of sockopt arguments (%s) failed: %s", p, gfarm_error_string(e)); return (e); } if (tmp != NULL) { gflog_debug(GFARM_MSG_1000946, "Too many sockopt arguments passed"); return (GFARM_ERRMSG_TOO_MANY_ARGUMENTS); } } if (is_listener) { e = gfarm_sockopt_listener_config_add(option); if (e != GFARM_ERR_NO_ERROR) { /* * we don't return `option' to *op here, * because it may be too long. */ *op = "1st(sockopt-option) argument"; gflog_debug(GFARM_MSG_1000947, "add sockopt listener config failed" "(%s)(%s): %s", host, option, gfarm_error_string(e)); return (e); } } if (host == NULL || !is_listener) { e = gfarm_hostspec_parse(host != NULL ? host : "*", &hostspecp); if (e != GFARM_ERR_NO_ERROR) { /* * we don't return `host' to *op here, * because it may be too long. */ *op = "2nd(host-spec) argument"; gflog_debug(GFARM_MSG_1000948, "parsing of sockopt host (%s) failed: %s", host, gfarm_error_string(e)); return (e); } e = gfarm_sockopt_config_add(option, hostspecp); if (e != GFARM_ERR_NO_ERROR) { /* * we don't return `option' to *op here, * because it may be too long. */ *op = "1st(sockopt-option) argument"; gfarm_hostspec_free(hostspecp); gflog_debug(GFARM_MSG_1000949, "add sockopt config (%s)(%s) failed: %s", host, option, gfarm_error_string(e)); return (e); } } return (GFARM_ERR_NO_ERROR); } #if 0 /* XXX address_use is disabled for now */ static gfarm_error_t parse_address_use_arguments(char *p, char **op) { gfarm_error_t e; char *tmp, *address; struct gfarm_hostspec *hostspecp; /* assert(strcmp(*op, "address_use") == 0); */ e = gfarm_strtoken(&p, &address); if (e != GFARM_ERR_NO_ERROR) return (e); if (address == NULL) return (GFARM_ERRMSG_MISSING_ADDRESS_ARGUMENT); e = gfarm_strtoken(&p, &tmp); if (e != GFARM_ERR_NO_ERROR) return (e); if (tmp != NULL) return (GFARM_ERRMSG_TOO_MANY_ARGUMENTS); e = gfarm_hostspec_parse(address, &hostspecp); if (e != GFARM_ERR_NO_ERROR) { /* * we don't return `host' to *op here, * because it may be too long. */ *op = "1st(address) argument"; return (e); } e = gfarm_host_address_use(hostspecp); if (e != GFARM_ERR_NO_ERROR) { /* * we don't return `option' to *op here, * because it may be too long. */ *op = "1st(address) argument"; gfarm_hostspec_free(hostspecp); return (e); } return (GFARM_ERR_NO_ERROR); } #endif static gfarm_error_t parse_known_network_arguments(char *p, char **op) { gfarm_error_t e; char *tmp, *address; struct gfarm_hostspec *hostspecp; /* assert(strcmp(*op, "known_network") == 0); */ e = gfarm_strtoken(&p, &address); if (e != GFARM_ERR_NO_ERROR) return (e); if (address == NULL) return (GFARM_ERRMSG_MISSING_ADDRESS_ARGUMENT); e = gfarm_strtoken(&p, &tmp); if (e != GFARM_ERR_NO_ERROR) return (e); if (tmp != NULL) return (GFARM_ERRMSG_TOO_MANY_ARGUMENTS); e = gfarm_hostspec_parse(address, &hostspecp); if (e != GFARM_ERR_NO_ERROR) { /* * we don't return `host' to *op here, * because it may be too long. */ *op = "1st(address) argument"; return (e); } e = gfarm_known_network_list_add(hostspecp); if (e != GFARM_ERR_NO_ERROR) { /* * we don't return `option' to *op here, * because it may be too long. */ *op = "1st(address) argument"; gfarm_hostspec_free(hostspecp); return (e); } return (GFARM_ERR_NO_ERROR); } static gfarm_error_t parse_stringlist(char *p, char **op, gfarm_stringlist *list, const char *listname) { gfarm_error_t e; char *tmp, *arg; e = gfarm_strtoken(&p, &arg); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1002448, "parsing argument %s of %s failed: %s", p, listname, gfarm_error_string(e)); return (e); } if (arg == NULL) { gflog_debug(GFARM_MSG_1002449, "missing argument for %s", listname); return (GFARM_ERRMSG_MISSING_USER_MAP_FILE_ARGUMENT); } e = gfarm_strtoken(&p, &tmp); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1002450, "parsing argument %s of %s failed: %s", p, listname, gfarm_error_string(e)); return (e); } if (tmp != NULL) { gflog_debug(GFARM_MSG_1002451, "Too many arguments for %s", listname); return (GFARM_ERRMSG_TOO_MANY_ARGUMENTS); } arg = strdup(arg); if (arg == NULL) { gflog_debug(GFARM_MSG_1002452, "failed to allocate an argument of %s: no memory", listname); return (GFARM_ERR_NO_MEMORY); } e = gfarm_stringlist_add(list, arg); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1002453, "failed to allocate a %s entry for \"%s\": no memory", listname, arg); free(arg); } return (e); } #if 0 /* XXX NOTYET */ static gfarm_error_t parse_client_architecture(char *p, char **op) { gfarm_error_t e; char *architecture, *host, *junk; struct gfarm_hostspec *hostspecp; e = gfarm_strtoken(&p, &architecture); if (e != GFARM_ERR_NO_ERROR) return (e); if (architecture == NULL) return (GFARM_ERRMSG_MISSING_1ST_ARCHITECTURE_ARGUMENT); e = gfarm_strtoken(&p, &host); if (e != GFARM_ERR_NO_ERROR) return (e); if (host == NULL) return (GFARM_ERRMSG_MISSING_2ND_HOST_SPEC_ARGUMENT); e = gfarm_strtoken(&p, &junk); if (e != GFARM_ERR_NO_ERROR) return (e); if (junk != NULL) return (GFARM_ERRMSG_TOO_MANY_ARGUMENTS); e = gfarm_hostspec_parse(host, &hostspecp); if (e != GFARM_ERR_NO_ERROR) { /* * we don't return `host' to *op here, * because it may be too long. */ *op = "2nd(host-spec) argument"; return (e); } e = gfarm_set_client_architecture(architecture, hostspecp); if (e != GFARM_ERR_NO_ERROR) gfarm_hostspec_free(hostspecp); return (e); } #endif /* XXX NOTYET */ static gfarm_error_t get_one_argument(char *p, char **rv) { gfarm_error_t e; char *tmp, *s; e = gfarm_strtoken(&p, &s); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1000955, "parsing of one argument (%s) failed: %s", p, gfarm_error_string(e)); return (e); } if (s == NULL) { gflog_debug(GFARM_MSG_1000956, "Missing argument"); return (GFARM_ERRMSG_MISSING_ARGUMENT); } e = gfarm_strtoken(&p, &tmp); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1000957, "parsing of arguments (%s) failed: %s", p, gfarm_error_string(e)); return (e); } if (tmp != NULL) { gflog_debug(GFARM_MSG_1000958, "Too many arguments passed"); return (GFARM_ERRMSG_TOO_MANY_ARGUMENTS); } *rv = s; return (GFARM_ERR_NO_ERROR); } static gfarm_error_t parse_set_var(char *p, char **rv) { gfarm_error_t e; char *s; e = get_one_argument(p, &s); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1000959, "get_one_argument failed " "when parsing var (%s): %s", p, gfarm_error_string(e)); return (e); } if (*rv != NULL) /* first line has precedence */ return (GFARM_ERR_NO_ERROR); s = strdup(s); if (s == NULL) { gflog_debug(GFARM_MSG_1000960, "allocation of argument failed when parsing set var: %s", gfarm_error_string(GFARM_ERR_NO_MEMORY)); return (GFARM_ERR_NO_MEMORY); } *rv = s; return (GFARM_ERR_NO_ERROR); } static gfarm_error_t parse_set_misc_int(char *p, int *vp) { gfarm_error_t e; char *ep, *s; int v; e = get_one_argument(p, &s); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1000961, "get_one_argument failed " "when parsing misc integer (%s): %s", p, gfarm_error_string(e)); return (e); } if (*vp != MISC_DEFAULT) /* first line has precedence */ return (GFARM_ERR_NO_ERROR); errno = 0; v = strtol(s, &ep, 10); if (errno != 0) { int save_errno = errno; gflog_debug(GFARM_MSG_1000962, "conversion to integer failed " "when parsing misc integer (%s): %s", p, strerror(save_errno)); return (gfarm_errno_to_error(save_errno)); } if (ep == s) { gflog_debug(GFARM_MSG_1000963, "Integer expected when parsing misc integer but (%s)", s); return (GFARM_ERRMSG_INTEGER_EXPECTED); } if (*ep != '\0') { gflog_debug(GFARM_MSG_1000964, "Invalid character found " "when parsing misc integer (%s)", s); return (GFARM_ERRMSG_INVALID_CHARACTER); } *vp = v; return (GFARM_ERR_NO_ERROR); } static gfarm_error_t parse_set_misc_float(char *p, float *vp) { gfarm_error_t e; char *ep, *s; double v; e = get_one_argument(p, &s); if (e != GFARM_ERR_NO_ERROR) return (e); if (*vp != MISC_DEFAULT) /* first line has precedence */ return (GFARM_ERR_NO_ERROR); errno = 0; v = strtod(s, &ep); /* strtof is not ANSI C standard */ if (errno != 0) return (gfarm_errno_to_error(errno)); if (ep == s) return (GFARM_ERRMSG_FLOATING_POINT_NUMBER_EXPECTED); if (*ep != '\0') return (GFARM_ERRMSG_INVALID_CHARACTER); *vp = (float)v; return (GFARM_ERR_NO_ERROR); } static gfarm_error_t parse_set_misc_offset(char *p, gfarm_off_t *vp) { gfarm_error_t e; char *ep, *s; gfarm_off_t v; e = get_one_argument(p, &s); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1000965, "get_one_argument failed " "when parsing misc offset (%s): %s", p, gfarm_error_string(e)); return (e); } if (*vp != MISC_DEFAULT) /* first line has precedence */ return (GFARM_ERR_NO_ERROR); errno = 0; v = gfarm_strtoi64(s, &ep); if (errno != 0) { int save_errno = errno; gflog_debug(GFARM_MSG_1000966, "conversion to int64 failed " "when parsing misc offset (%s): %s", p, strerror(save_errno)); return (gfarm_errno_to_error(save_errno)); } if (ep == s) { gflog_debug(GFARM_MSG_1000967, "Integer expected when parsing misc offset but (%s)", s); return (GFARM_ERRMSG_INTEGER_EXPECTED); } if (*ep != '\0') { switch (*ep) { case 'k': case 'K': ep++; v *= 1024; break; case 'm': case 'M': ep++; v *= 1024 * 1024; break; case 'g': case 'G': ep++; v *= 1024 * 1024 * 1024; break; case 't': case 'T': ep++; v *=1024*1024; v *=1024*1024; break; } if (*ep != '\0') { gflog_debug(GFARM_MSG_1000968, "Invalid character found " "when parsing misc offset (%s)", s); return (GFARM_ERRMSG_INVALID_CHARACTER); } } *vp = v; return (GFARM_ERR_NO_ERROR); } static gfarm_error_t parse_set_misc_enabled(char *p, int *vp) { gfarm_error_t e; char *s; int v; e = get_one_argument(p, &s); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1000969, "get_one_argument failed " "when parsing misc enabled (%s): %s", p, gfarm_error_string(e)); return (e); } if (*vp != MISC_DEFAULT) /* first line has precedence */ return (GFARM_ERR_NO_ERROR); if (strcmp(s, "enable") == 0) v = 1; else if (strcmp(s, "disable") == 0) v = 0; else { gflog_debug(GFARM_MSG_1000970, "'enable' or 'disable' expected " "when parsing misc enabled but (%s)", s); return (GFARM_ERRMSG_ENABLED_OR_DISABLED_EXPECTED); } *vp = v; return (GFARM_ERR_NO_ERROR); } static gfarm_error_t parse_cred_config(char *p, char *service, gfarm_error_t (*set)(char *, char *)) { gfarm_error_t e; char *s; e = get_one_argument(p, &s); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1000971, "get_one_argument failed " "when parsing cred config (%s): %s", p, gfarm_error_string(e)); return (e); } return ((*set)(service, s)); } static gfarm_error_t parse_log_level(char *p, int *vp) { gfarm_error_t e; char *s; int v; e = get_one_argument(p, &s); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1000972, "get_one_argument failed " "when parsing log level (%s): %s", p, gfarm_error_string(e)); return (e); } if (*vp != MISC_DEFAULT) /* first line has precedence */ return (GFARM_ERR_NO_ERROR); v = gflog_syslog_name_to_priority(s); if (v == -1) { gflog_debug(GFARM_MSG_1000973, "Invalid syslog priority level (%s)", s); return (GFARM_ERRMSG_INVALID_SYSLOG_PRIORITY_LEVEL); } *vp = v; return (GFARM_ERR_NO_ERROR); } static gfarm_error_t parse_one_line(char *s, char *p, char **op) { gfarm_error_t e; char *o; if (strcmp(s, o = "spool") == 0) { e = parse_set_var(p, &gfarm_spool_root); } else if (strcmp(s, o = "spool_server_listen_address") == 0) { e = parse_set_var(p, &gfarm_spool_server_listen_address); } else if (strcmp(s, o = "spool_server_cred_type") == 0) { e = parse_cred_config(p, GFS_SERVICE_TAG, gfarm_auth_server_cred_type_set_by_string); } else if (strcmp(s, o = "spool_server_cred_service") == 0) { e = parse_cred_config(p, GFS_SERVICE_TAG, gfarm_auth_server_cred_service_set); } else if (strcmp(s, o = "spool_server_cred_name") == 0) { e = parse_cred_config(p, GFS_SERVICE_TAG, gfarm_auth_server_cred_name_set); } else if (strcmp(s, o = "metadb_server_host") == 0) { e = parse_set_var(p, &gfarm_metadb_server_name); } else if (strcmp(s, o = "metadb_server_port") == 0) { e = parse_set_var(p, &gfarm_metadb_server_portname); } else if (strcmp(s, o = "admin_user") == 0) { e = parse_set_var(p, &gfarm_metadb_admin_user); } else if (strcmp(s, o = "admin_user_gsi_dn") == 0) { e = parse_set_var(p, &gfarm_metadb_admin_user_gsi_dn); } else if (strcmp(s, o = "metadb_server_cred_type") == 0) { e = parse_cred_config(p, GFM_SERVICE_TAG, gfarm_auth_server_cred_type_set_by_string); } else if (strcmp(s, o = "metadb_server_cred_service") == 0) { e = parse_cred_config(p, GFM_SERVICE_TAG, gfarm_auth_server_cred_service_set); } else if (strcmp(s, o = "metadb_server_cred_name") == 0) { e = parse_cred_config(p, GFM_SERVICE_TAG, gfarm_auth_server_cred_name_set); } else if (strcmp(s, o = "ldap_server_host") == 0) { e = parse_set_var(p, &gfarm_ldap_server_name); if (e == GFARM_ERR_NO_ERROR) e = set_backend_db_type_ldap(); } else if (strcmp(s, o = "ldap_server_port") == 0) { e = parse_set_var(p, &gfarm_ldap_server_port); if (e == GFARM_ERR_NO_ERROR) e = set_backend_db_type_ldap(); } else if (strcmp(s, o = "ldap_base_dn") == 0) { e = parse_set_var(p, &gfarm_ldap_base_dn); if (e == GFARM_ERR_NO_ERROR) e = set_backend_db_type_ldap(); } else if (strcmp(s, o = "ldap_bind_dn") == 0) { e = parse_set_var(p, &gfarm_ldap_bind_dn); if (e == GFARM_ERR_NO_ERROR) e = set_backend_db_type_ldap(); } else if (strcmp(s, o = "ldap_bind_password") == 0) { e = parse_set_var(p, &gfarm_ldap_bind_password); if (e == GFARM_ERR_NO_ERROR) e = set_backend_db_type_ldap(); } else if (strcmp(s, o = "ldap_tls") == 0) { e = parse_set_var(p, &gfarm_ldap_tls); if (e == GFARM_ERR_NO_ERROR) e = set_backend_db_type_ldap(); } else if (strcmp(s, o = "ldap_tls_cipher_suite") == 0) { e = parse_set_var(p, &gfarm_ldap_tls_cipher_suite); if (e == GFARM_ERR_NO_ERROR) e = set_backend_db_type_ldap(); } else if (strcmp(s, o = "ldap_tls_certificate_key_file") == 0) { e = parse_set_var(p, &gfarm_ldap_tls_certificate_key_file); if (e == GFARM_ERR_NO_ERROR) e = set_backend_db_type_ldap(); } else if (strcmp(s, o = "ldap_tls_certificate_file") == 0) { e = parse_set_var(p, &gfarm_ldap_tls_certificate_file); if (e == GFARM_ERR_NO_ERROR) e = set_backend_db_type_ldap(); } else if (strcmp(s, o = "postgresql_server_host") == 0) { e = parse_set_var(p, &gfarm_postgresql_server_name); if (e == GFARM_ERR_NO_ERROR) e = set_backend_db_type_postgresql(); } else if (strcmp(s, o = "postgresql_server_port") == 0) { e = parse_set_var(p, &gfarm_postgresql_server_port); if (e == GFARM_ERR_NO_ERROR) e = set_backend_db_type_postgresql(); } else if (strcmp(s, o = "postgresql_dbname") == 0) { e = parse_set_var(p, &gfarm_postgresql_dbname); if (e == GFARM_ERR_NO_ERROR) e = set_backend_db_type_postgresql(); } else if (strcmp(s, o = "postgresql_user") == 0) { e = parse_set_var(p, &gfarm_postgresql_user); if (e == GFARM_ERR_NO_ERROR) e = set_backend_db_type_postgresql(); } else if (strcmp(s, o = "postgresql_password") == 0) { e = parse_set_var(p, &gfarm_postgresql_password); if (e == GFARM_ERR_NO_ERROR) e = set_backend_db_type_postgresql(); } else if (strcmp(s, o = "postgresql_conninfo") == 0) { e = parse_set_var(p, &gfarm_postgresql_conninfo); if (e == GFARM_ERR_NO_ERROR) e = set_backend_db_type_postgresql(); } else if (strcmp(s, o = "localfs_datadir") == 0) { e = parse_set_var(p, &gfarm_localfs_datadir); if (e == GFARM_ERR_NO_ERROR) e = set_backend_db_type_localfs(); } else if (strcmp(s, o = "auth") == 0) { e = parse_auth_arguments(p, &o); } else if (strcmp(s, o = "netparam") == 0) { e = parse_netparam_arguments(p, &o); } else if (strcmp(s, o = "sockopt") == 0) { e = parse_sockopt_arguments(p, &o); #if 0 /* XXX address_use is disabled for now */ } else if (strcmp(s, o = "address_use") == 0) { e = parse_address_use_arguments(p, &o); #endif } else if (strcmp(s, o = "known_network") == 0) { e = parse_known_network_arguments(p, &o); } else if (strcmp(s, o = "xattr_cache") == 0) { e = parse_stringlist(p, &o, &xattr_cache_list, "xattr cache"); } else if (strcmp(s, o = "local_user_map") == 0) { e = parse_stringlist(p, &o, &local_user_map_file_list, "local user map"); } else if (strcmp(s, o = "local_group_map") == 0) { e = parse_stringlist(p, &o, &local_group_map_file_list, "local group map"); #if 0 /* XXX NOTYET */ } else if (strcmp(s, o = "client_architecture") == 0) { e = parse_client_architecture(p, &o); #endif } else if (strcmp(s, o = "log_level") == 0) { e = parse_log_level(p, &gfarm_log_level); } else if (strcmp(s, o = "log_message_verbose_level") == 0) { e = parse_set_misc_int(p, &gfarm_log_message_verbose); gflog_set_message_verbose(gfarm_log_message_verbose); } else if (strcmp(s, o = "no_file_system_node_timeout") == 0) { e = parse_set_misc_int(p, &gfarm_no_file_system_node_timeout); } else if (strcmp(s, o = "gfmd_reconnection_timeout") == 0) { e = parse_set_misc_int(p, &gfarm_gfmd_reconnection_timeout); } else if (strcmp(s, o = "attr_cache_limit") == 0) { e = parse_set_misc_int(p, &gfarm_attr_cache_limit); } else if (strcmp(s, o = "attr_cache_timeout") == 0) { e = parse_set_misc_int(p, &gfarm_attr_cache_timeout); } else if (strcmp(s, o = "schedule_cache_timeout") == 0) { e = parse_set_misc_int(p, &gfarm_schedule_cache_timeout); } else if (strcmp(s, o = "schedule_idle_load_thresh") == 0) { e = parse_set_misc_float(p, &gfarm_schedule_idle_load); } else if (strcmp(s, o = "schedule_busy_load_thresh") == 0) { e = parse_set_misc_float(p, &gfarm_schedule_busy_load); } else if (strcmp(s, o = "schedule_virtual_load") == 0) { e = parse_set_misc_float(p, &gfarm_schedule_virtual_load); } else if (strcmp(s, o = "write_local_priority") == 0) { e = parse_set_misc_enabled(p, &schedule_write_local_priority); } else if (strcmp(s, o = "write_target_domain") == 0) { e = parse_set_var(p, &schedule_write_target_domain); } else if (strcmp(s, o = "minimum_free_disk_space") == 0) { e = parse_set_misc_offset(p, &gfarm_minimum_free_disk_space); } else if (strcmp(s, o = "simultaneous_replication_receivers") == 0) { e = parse_set_misc_int(p, &gfarm_simultaneous_replication_receivers); } else if (strcmp(s, o = "gfsd_connection_cache") == 0) { e = parse_set_misc_int(p, &gfarm_gfsd_connection_cache); } else if (strcmp(s, o = "gfmd_connection_cache") == 0) { e = parse_set_misc_int(p, &gfarm_gfmd_connection_cache); } else if (strcmp(s, o = "metadb_server_stack_size") == 0) { e = parse_set_misc_int(p, &gfarm_metadb_stack_size); } else if (strcmp(s, o = "metadb_server_thread_pool_size") == 0) { e = parse_set_misc_int(p, &gfarm_metadb_thread_pool_size); } else if (strcmp(s, o = "metadb_server_job_queue_length") == 0) { e = parse_set_misc_int(p, &gfarm_metadb_job_queue_length); } else if (strcmp(s, o = "metadb_server_heartbeat_interval") == 0) { e = parse_set_misc_int(p, &gfarm_metadb_heartbeat_interval); } else if (strcmp(s, o = "metadb_server_dbq_size") == 0) { e = parse_set_misc_int(p, &gfarm_metadb_dbq_size); } else if (strcmp(s, o = "record_atime") == 0) { e = parse_set_misc_enabled(p, &gfarm_record_atime); } else { o = s; gflog_debug(GFARM_MSG_1000974, "Unknown keyword encountered " "when parsing one line (%s)", s); e = GFARM_ERRMSG_UNKNOWN_KEYWORD; } *op = o; return (e); } gfarm_error_t gfarm_init_config_stringlists(void) { gfarm_stringlist_init(&xattr_cache_list); gfarm_stringlist_init(&local_user_map_file_list); gfarm_stringlist_init(&local_group_map_file_list); return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfarm_free_config_stringlists(void) { gfarm_stringlist_free_deeply(&xattr_cache_list); gfarm_stringlist_free_deeply(&local_user_map_file_list); gfarm_stringlist_free_deeply(&local_group_map_file_list); return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfarm_config_read_file(FILE *config, int *lineno_p) { gfarm_error_t e; int lineno = 0; char *s, *p, *o, buffer[1024]; while (fgets(buffer, sizeof buffer, config) != NULL) { lineno++; p = buffer; e = gfarm_strtoken(&p, &s); if (e == GFARM_ERR_NO_ERROR) { if (s == NULL) /* blank or comment line */ continue; e = parse_one_line(s, p, &o); } if (e != GFARM_ERR_NO_ERROR) { fclose(config); *lineno_p = lineno; gflog_debug(GFARM_MSG_1000975, "parsing token failed" "when reading config file (%s): %s", p, gfarm_error_string(e)); return (e); } } fclose(config); return (GFARM_ERR_NO_ERROR); } /* * set default value of configurations. */ void gfarm_config_set_default_ports(void) { if (gfarm_metadb_server_name == NULL) gflog_fatal(GFARM_MSG_1000013, "metadb_serverhost isn't specified in " GFARM_CONFIG " file"); if (gfarm_metadb_server_portname != NULL) { int p = strtol(gfarm_metadb_server_portname, NULL, 0); struct servent *sp = getservbyname(gfarm_metadb_server_portname, "tcp"); if (sp != NULL) gfarm_metadb_server_port = ntohs(sp->s_port); else if (p != 0) gfarm_metadb_server_port = p; } } void gfarm_config_set_default_misc(void) { if (gfarm_log_level == MISC_DEFAULT) gfarm_log_level = GFARM_DEFAULT_PRIORITY_LEVEL_TO_LOG; gflog_set_priority_level(gfarm_log_level); if (gfarm_log_message_verbose == MISC_DEFAULT) gfarm_log_message_verbose = GFARM_LOG_MESSAGE_VERBOSE_DEFAULT; gflog_set_message_verbose(gfarm_log_message_verbose); if (gfarm_no_file_system_node_timeout == MISC_DEFAULT) gfarm_no_file_system_node_timeout = GFARM_NO_FILE_SYSTEM_NODE_TIMEOUT_DEFAULT; if (gfarm_gfmd_reconnection_timeout == MISC_DEFAULT) gfarm_gfmd_reconnection_timeout = GFARM_GFMD_RECONNECTION_TIMEOUT_DEFAULT; if (gfarm_attr_cache_limit == MISC_DEFAULT) gfarm_attr_cache_limit = GFARM_ATTR_CACHE_LIMIT_DEFAULT; if (gfarm_attr_cache_timeout == MISC_DEFAULT) gfarm_attr_cache_timeout = GFARM_ATTR_CACHE_TIMEOUT_DEFAULT; if (gfarm_schedule_cache_timeout == MISC_DEFAULT) gfarm_schedule_cache_timeout = GFARM_SCHEDULE_CACHE_TIMEOUT_DEFAULT; if (gfarm_schedule_idle_load == MISC_DEFAULT) gfarm_schedule_idle_load = GFARM_SCHEDULE_IDLE_LOAD_DEFAULT; if (gfarm_schedule_busy_load == MISC_DEFAULT) gfarm_schedule_busy_load = GFARM_SCHEDULE_BUSY_LOAD_DEFAULT; if (gfarm_schedule_virtual_load == MISC_DEFAULT) gfarm_schedule_virtual_load = GFARM_SCHEDULE_VIRTUAL_LOAD_DEFAULT; if (schedule_write_local_priority == MISC_DEFAULT) schedule_write_local_priority = GFARM_SCHEDULE_WRITE_LOCAL_PRIORITY_DEFAULT; if (gfarm_minimum_free_disk_space == MISC_DEFAULT) gfarm_minimum_free_disk_space = GFARM_MINIMUM_FREE_DISK_SPACE_DEFAULT; if (gfarm_simultaneous_replication_receivers == MISC_DEFAULT) gfarm_simultaneous_replication_receivers = GFARM_SIMULTANEOUS_REPLICATION_RECEIVERS_DEFAULT; if (gfarm_gfsd_connection_cache == MISC_DEFAULT) gfarm_gfsd_connection_cache = GFARM_GFSD_CONNECTION_CACHE_DEFAULT; if (gfarm_gfmd_connection_cache == MISC_DEFAULT) gfarm_gfmd_connection_cache = GFARM_GFMD_CONNECTION_CACHE_DEFAULT; if (gfarm_metadb_stack_size == MISC_DEFAULT) gfarm_metadb_stack_size = GFARM_METADB_STACK_SIZE_DEFAULT; if (gfarm_metadb_thread_pool_size == MISC_DEFAULT) gfarm_metadb_thread_pool_size = GFARM_METADB_THREAD_POOL_SIZE_DEFAULT; if (gfarm_metadb_job_queue_length == MISC_DEFAULT) gfarm_metadb_job_queue_length = GFARM_METADB_JOB_QUEUE_LENGTH_DEFAULT; if (gfarm_metadb_heartbeat_interval == MISC_DEFAULT) gfarm_metadb_heartbeat_interval = GFARM_METADB_HEARTBEAT_INTERVAL_DEFAULT; if (gfarm_metadb_dbq_size == MISC_DEFAULT) gfarm_metadb_dbq_size = GFARM_METADB_DBQ_SIZE_DEFAULT; if (gfarm_record_atime == MISC_DEFAULT) gfarm_record_atime = GFARM_RECORD_ATIME_DEFAULT; } void gfs_display_timers(void) { gfs_pio_display_timers(); #if 0 gfs_pio_section_display_timers(); #endif gfs_stat_display_timers(); gfs_unlink_display_timers(); } #ifdef STRTOKEN_TEST main() { char buffer[1024]; char *cursor, *token, *error; while (fgets(buffer, sizeof buffer, stdin) != NULL) { cursor = buffer; while ((token = strtoken(&cursor, &error)) != NULL) printf("token: <%s>\n", token); if (error == NULL) printf("newline\n"); else printf("error: %s\n", error); } } #endif gfarm-2.4.1/lib/libgfarm/gfarm/gfs_chmod.c0000644000000000000000000000233311507222724017035 0ustar rootroot#include /* config.h needs FILE */ #include #include #define GFARM_INTERNAL_USE #include #include "gfutil.h" #include "timer.h" #include "gfs_profile.h" #include "gfm_client.h" #include "config.h" #include "lookup.h" struct gfm_chmod_closure { gfarm_mode_t mode; }; static gfarm_error_t gfm_chmod_request(struct gfm_connection *gfm_server, void *closure) { struct gfm_chmod_closure *c = closure; gfarm_error_t e = gfm_client_fchmod_request(gfm_server, c->mode); if (e != GFARM_ERR_NO_ERROR) gflog_warning(GFARM_MSG_1000114, "fchmod request; %s", gfarm_error_string(e)); return (e); } static gfarm_error_t gfm_chmod_result(struct gfm_connection *gfm_server, void *closure) { gfarm_error_t e = gfm_client_fchmod_result(gfm_server); #if 0 /* DEBUG */ if (e != GFARM_ERR_NO_ERROR) gflog_debug(GFARM_MSG_1000115, "fchmod result; %s", gfarm_error_string(e)); #endif return (e); } gfarm_error_t gfs_chmod(const char *path, gfarm_mode_t mode) { struct gfm_chmod_closure closure; closure.mode = mode; return (gfm_inode_op(path, GFARM_FILE_LOOKUP, gfm_chmod_request, gfm_chmod_result, gfm_inode_success_op_connection_free, NULL, &closure)); } gfarm-2.4.1/lib/libgfarm/gfarm/param.c0000644000000000000000000002171611507222723016211 0ustar rootroot/* * $Id: param.c 4457 2010-02-23 01:53:23Z ookuma $ */ #include #include #include #include #include #include #include #include #include #include "liberror.h" #include "hostspec.h" #include "param.h" struct gfarm_param_config { struct gfarm_param_config *next; int param_type_index; long value; struct gfarm_hostspec *hostspec; }; gfarm_error_t gfarm_param_config_parse_long(int ntypes, struct gfarm_param_type *type_table, char *config, int *type_indexp, long *valuep) { int i; size_t configlen, namelen; struct gfarm_param_type *type; long value; char *ep; configlen = strlen(config); namelen = strcspn(config, "="); for (i = 0; i < ntypes; i++) { type = &type_table[i]; if (strlen(type->name) != namelen || memcmp(config, type->name, namelen) != 0) continue; if (configlen == namelen) { /* no value specified */ if (!type->boolean) { gflog_debug(GFARM_MSG_1000884, "Value is not specified (%s)", config); return (GFARM_ERRMSG_VALUE_IS_NOT_SPECIFIED); } value = 1; } else { if (type->boolean) { gflog_debug(GFARM_MSG_1000885, "Value is not allowed for boolean (%s)", config); return (GFARM_ERRMSG_VALUE_IS_NOT_ALLOWED_FOR_BOOLEAN); } if (config[namelen + 1] == '\0') { gflog_debug(GFARM_MSG_1000886, "Value is empty (%s)", config); return (GFARM_ERRMSG_VALUE_IS_EMPTY); } errno = 0; value = strtol(&config[namelen + 1], &ep, 0); if (errno != 0) { int save_errno = errno; gflog_debug(GFARM_MSG_1000887, "strtol(%s) failed: %s", config, strerror(save_errno)); return (gfarm_errno_to_error(save_errno)); } if (*ep != '\0') { gflog_debug(GFARM_MSG_1000888, "Invalid char in value(%s).", config); return (GFARM_ERRMSG_INVALID_CHAR_IN_VALUE); } } *type_indexp = i; *valuep = value; return (GFARM_ERR_NO_ERROR); } gflog_debug(GFARM_MSG_1000889, "failed to find object(%s): %s", config, gfarm_error_string(GFARM_ERR_NO_SUCH_OBJECT)); return (GFARM_ERR_NO_SUCH_OBJECT); } gfarm_error_t gfarm_param_config_add_long( struct gfarm_param_config ***config_list_lastp, int param_type_index, long value, struct gfarm_hostspec *hsp) { struct gfarm_param_config *pcp; GFARM_MALLOC(pcp); if (pcp == NULL) { gflog_debug(GFARM_MSG_1000890, "allocation of 'gfarm_param_config' failed: %s", gfarm_error_string(GFARM_ERR_NO_MEMORY)); return (GFARM_ERR_NO_MEMORY); } pcp->next = NULL; pcp->param_type_index = param_type_index; pcp->value = value; pcp->hostspec = hsp; *(*config_list_lastp) = pcp; *config_list_lastp = &pcp->next; return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfarm_param_apply_long_by_name_addr(struct gfarm_param_config *list, const char *name, struct sockaddr *addr, gfarm_error_t (*f)(void *, int, long), void *closure) { gfarm_error_t e_save = GFARM_ERR_NO_ERROR, e; long done = 0; for (; list != NULL; list = list->next) { if (gfarm_hostspec_match(list->hostspec, name, addr)) { assert(list->param_type_index < sizeof(long)*CHAR_BIT); if ((done & (1 << list->param_type_index)) != 0) continue; /* use first match only */ done |= (1 << list->param_type_index); e = (*f)(closure, list->param_type_index, list->value); if (e != GFARM_ERR_NO_ERROR && e_save == GFARM_ERR_NO_ERROR) e_save = e; } } if (e_save != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1000891, "Error occurred during process(%s): %s", name, gfarm_error_string(e_save)); } return (e_save); } gfarm_error_t gfarm_param_apply_long(struct gfarm_param_config *list, gfarm_error_t (*f)(void *, int, long), void *closure) { gfarm_error_t e_save = GFARM_ERR_NO_ERROR, e; long done = 0; for (; list != NULL; list = list->next) { assert(list->param_type_index < sizeof(long)*CHAR_BIT); if ((done & (1 << list->param_type_index)) != 0) continue; /* use first match only */ done |= (1 << list->param_type_index); e = (*f)(closure, list->param_type_index, list->value); if (e != GFARM_ERR_NO_ERROR && e_save == GFARM_ERR_NO_ERROR) e_save = e; } if (e_save != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1000892, "Error occurred during process(): %s", gfarm_error_string(e_save)); } return (e_save); } gfarm_error_t gfarm_param_get_long_by_name_addr(struct gfarm_param_config *list, int param_type_index, char *name, struct sockaddr *addr, long *valuep) { for (; list != NULL; list = list->next) { if (list->param_type_index == param_type_index && gfarm_hostspec_match(list->hostspec, name, addr)) { *valuep = list->value; return (GFARM_ERR_NO_ERROR); } } gflog_debug(GFARM_MSG_1000893, "failed to find long param (%d) by name addr (%s): %s", param_type_index, name, gfarm_error_string(GFARM_ERR_NO_SUCH_OBJECT)); return (GFARM_ERR_NO_SUCH_OBJECT); } gfarm_error_t gfarm_param_get_long(struct gfarm_param_config *list, int param_type_index, long *valuep) { for (; list != NULL; list = list->next) { if (list->param_type_index == param_type_index) { *valuep = list->value; return (GFARM_ERR_NO_ERROR); } } gflog_debug(GFARM_MSG_1000894, "failed to find long param (%d): %s", param_type_index, gfarm_error_string(GFARM_ERR_NO_SUCH_OBJECT)); return (GFARM_ERR_NO_SUCH_OBJECT); } /* * netparam */ struct gfarm_netparam_info { long minimum, maximum, default_value; struct gfarm_param_config *list; struct gfarm_param_config **last; }; struct gfarm_netparam_info gfarm_netparam_parallel_streams = { /* minimum */ 1, /* maximum */ 1000, /* default */ 1, NULL, &gfarm_netparam_parallel_streams.list, }; struct gfarm_netparam_info gfarm_netparam_stripe_unit_size = { /* minimum */ 0, /* maximum */ INT_MAX, /* default */ 0, NULL, &gfarm_netparam_stripe_unit_size.list, }; struct gfarm_netparam_info gfarm_netparam_rate_limit = { /* minimum */ 0, /* maximum */ INT_MAX, /* default */ 0, NULL, &gfarm_netparam_rate_limit.list, }; struct gfarm_netparam_info gfarm_netparam_file_read_size = { /* minimum */ 0, /* maximum */ INT_MAX, /* default */ 4096, NULL, &gfarm_netparam_file_read_size.list, }; struct gfarm_netparam_info gfarm_netparam_file_sync_rate = { /* minimum */ 0, /* maximum */ INT_MAX, /* default */ 0, NULL, &gfarm_netparam_file_sync_rate.list, }; struct gfarm_netparam_info gfarm_netparam_file_sync_stripe = { /* minimum */ 0, /* maximum */ INT_MAX, /* default */ 0, NULL, &gfarm_netparam_file_sync_stripe.list, }; struct gfarm_netparam_info gfarm_netparam_send_stripe_sync = { /* minimum */ 0, /* maximum */ 1, /* default */ 0, NULL, &gfarm_netparam_send_stripe_sync.list, }; struct gfarm_netparam_info gfarm_netparam_recv_stripe_sync = { /* minimum */ 0, /* maximum */ 1, /* default */ 0, NULL, &gfarm_netparam_recv_stripe_sync.list, }; struct gfarm_param_type gfarm_netparam_type_table[] = { { "parallel_streams", 0, &gfarm_netparam_parallel_streams }, { "stripe_unit_size", 0, &gfarm_netparam_stripe_unit_size }, { "rate_limit", 0, &gfarm_netparam_rate_limit }, { "file_read_size", 0, &gfarm_netparam_file_read_size }, { /* "file_" */ "sync_rate", 0, &gfarm_netparam_file_sync_rate }, { "file_sync_stripe", 0, &gfarm_netparam_file_sync_stripe }, { "send_stripe_sync", 0, &gfarm_netparam_send_stripe_sync }, { "recv_stripe_sync", 0, &gfarm_netparam_recv_stripe_sync }, }; #define NNETPARAMS GFARM_ARRAY_LENGTH(gfarm_netparam_type_table) gfarm_error_t gfarm_netparam_config_add_long(char *config, struct gfarm_hostspec *hsp) { gfarm_error_t e; int param_type_index; long value; struct gfarm_netparam_info *info; e = gfarm_param_config_parse_long( NNETPARAMS, gfarm_netparam_type_table, config, ¶m_type_index, &value); if (e == GFARM_ERR_NO_SUCH_OBJECT) { gflog_debug(GFARM_MSG_1000895, "Unknown parameter(%s).", config); return (GFARM_ERRMSG_UNKNOWN_PARAMETER); } if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1000896, "gfarm_param_config_parse_long(%s) failed: %s", config, gfarm_error_string(e)); return (e); } info = gfarm_netparam_type_table[param_type_index].extension; if (value < info->minimum || value > info->maximum) { gflog_debug(GFARM_MSG_1000897, "Argument out of domain (%ld): %s", value, gfarm_error_string( GFARM_ERR_NUMERICAL_ARGUMENT_OUT_OF_DOMAIN)); return (GFARM_ERR_NUMERICAL_ARGUMENT_OUT_OF_DOMAIN); } return (gfarm_param_config_add_long(&info->last, 0, value, hsp)); } gfarm_error_t gfarm_netparam_config_get_long(struct gfarm_netparam_info *info, char *name, struct sockaddr *addr, long *valuep) { gfarm_error_t e; long value; e = gfarm_param_get_long_by_name_addr(info->list, 0, name, addr, &value); if (e == GFARM_ERR_NO_SUCH_OBJECT) { *valuep = info->default_value; } else if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1000898, "gfarm_param_get_long_by_name_addr(%s) failed: %s", name, gfarm_error_string(e)); return (e); } else { *valuep = value; } return (GFARM_ERR_NO_ERROR); } gfarm-2.4.1/lib/libgfarm/gfarm/gfp_xdr.c0000644000000000000000000005336611507222723016550 0ustar rootroot#include #include #include #include #include #include #include #include #include /* ntoh[ls]()/hton[ls]() on glibc */ #include #include #include #include #include "gfutil.h" /* gflog_fatal() */ #include "liberror.h" #include "iobuffer.h" #include "gfp_xdr.h" #if INT64T_IS_FLOAT #include #define POWER2_32 4294967296.0 /* 2^32 */ #endif #define GFP_XDR_BUFSIZE 16384 struct gfp_xdr { struct gfarm_iobuffer *recvbuffer; struct gfarm_iobuffer *sendbuffer; struct gfp_iobuffer_ops *iob_ops; void *cookie; int fd; }; /* * switch to new iobuffer operation, * and (possibly) switch to new cookie/fd */ void gfp_xdr_set(struct gfp_xdr *conn, struct gfp_iobuffer_ops *ops, void *cookie, int fd) { conn->iob_ops = ops; conn->cookie = cookie; conn->fd = fd; gfarm_iobuffer_set_read(conn->recvbuffer, ops->blocking_read, cookie, fd); gfarm_iobuffer_set_write(conn->sendbuffer, ops->blocking_write, cookie, fd); } gfarm_error_t gfp_xdr_new(struct gfp_iobuffer_ops *ops, void *cookie, int fd, struct gfp_xdr **connp) { struct gfp_xdr *conn; GFARM_MALLOC(conn); if (conn == NULL) { gflog_debug(GFARM_MSG_1000996, "allocation of 'conn' failed: %s", gfarm_error_string(GFARM_ERR_NO_MEMORY)); return (GFARM_ERR_NO_MEMORY); } conn->recvbuffer = gfarm_iobuffer_alloc(GFP_XDR_BUFSIZE); if (conn->recvbuffer == NULL) { free(conn); gflog_debug(GFARM_MSG_1000997, "allocation of 'conn recvbuffer' failed: %s", gfarm_error_string(GFARM_ERR_NO_MEMORY)); return (GFARM_ERR_NO_MEMORY); } conn->sendbuffer = gfarm_iobuffer_alloc(GFP_XDR_BUFSIZE); if (conn->sendbuffer == NULL) { gfarm_iobuffer_free(conn->recvbuffer); free(conn); gflog_debug(GFARM_MSG_1000998, "allocation of 'conn sendbuffer' failed: %s", gfarm_error_string(GFARM_ERR_NO_MEMORY)); return (GFARM_ERR_NO_MEMORY); } gfp_xdr_set(conn, ops, cookie, fd); *connp = conn; return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfp_xdr_free(struct gfp_xdr *conn) { gfarm_error_t e, e_save; e_save = gfp_xdr_flush(conn); gfarm_iobuffer_free(conn->sendbuffer); gfarm_iobuffer_free(conn->recvbuffer); e = (*conn->iob_ops->close)(conn->cookie, conn->fd); if (e_save == GFARM_ERR_NO_ERROR) e_save = e; free(conn); return (e); } void * gfp_xdr_cookie(struct gfp_xdr *conn) { return (conn->cookie); } int gfp_xdr_fd(struct gfp_xdr *conn) { return (conn->fd); } gfarm_error_t gfp_xdr_sendbuffer_check_size(struct gfp_xdr *conn, int size) { if (size > gfarm_iobuffer_get_size(conn->sendbuffer)) return (GFARM_ERR_NO_BUFFER_SPACE_AVAILABLE); else if (size > gfarm_iobuffer_avail_length(conn->sendbuffer)) return (GFARM_ERR_RESOURCE_TEMPORARILY_UNAVAILABLE); else return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfp_xdr_export_credential(struct gfp_xdr *conn) { return ((*conn->iob_ops->export_credential)(conn->cookie)); } gfarm_error_t gfp_xdr_delete_credential(struct gfp_xdr *conn, int sighandler) { return ((*conn->iob_ops->delete_credential)(conn->cookie, sighandler)); } char * gfp_xdr_env_for_credential(struct gfp_xdr *conn) { return ((*conn->iob_ops->env_for_credential)(conn->cookie)); } void gfarm_iobuffer_set_nonblocking_read_xxx(struct gfarm_iobuffer *b, struct gfp_xdr *conn) { gfarm_iobuffer_set_read(b, conn->iob_ops->nonblocking_read, conn->cookie, conn->fd); } void gfarm_iobuffer_set_nonblocking_write_xxx(struct gfarm_iobuffer *b, struct gfp_xdr *conn) { gfarm_iobuffer_set_write(b, conn->iob_ops->nonblocking_write, conn->cookie, conn->fd); } int gfp_xdr_recv_is_ready(struct gfp_xdr *conn) { return (!gfarm_iobuffer_empty(conn->recvbuffer) || gfarm_iobuffer_is_eof(conn->recvbuffer)); } gfarm_error_t gfp_xdr_flush(struct gfp_xdr *conn) { gfarm_iobuffer_flush_write(conn->sendbuffer); return (gfarm_iobuffer_get_error(conn->sendbuffer)); } gfarm_error_t gfp_xdr_purge_sized(struct gfp_xdr *conn, int just, int len, size_t *sizep) { int rv; if (*sizep < len) { gflog_debug(GFARM_MSG_1000999, "gfp_xdr_purge_sized: " "%d bytes expected, but only %d bytes remains", len, (int)*sizep); return (GFARM_ERR_PROTOCOL); } rv = gfarm_iobuffer_purge_read_x(conn->recvbuffer, len, just); *sizep -= rv; if (rv != len) return (GFARM_ERR_UNEXPECTED_EOF); return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfp_xdr_purge(struct gfp_xdr *conn, int just, int len) { if (gfarm_iobuffer_purge_read_x(conn->recvbuffer, len, just) != len) { gflog_debug(GFARM_MSG_1001000, "gfarm_iobuffer_purge_read_x() failed: %s", gfarm_error_string(GFARM_ERR_UNEXPECTED_EOF)); return (GFARM_ERR_UNEXPECTED_EOF); } return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfp_xdr_vsend_size_add(size_t *sizep, const char **formatp, va_list *app) { const char *format = *formatp; size_t size = *sizep; gfarm_uint8_t c; gfarm_int16_t h; gfarm_int32_t i, n; gfarm_int64_t o; gfarm_uint32_t lv[2]; #if INT64T_IS_FLOAT int minus; #endif double d; #ifndef WORDS_BIGENDIAN struct { char c[8]; } nd; #else # define nd d #endif const char *s; for (; *format; format++) { switch (*format) { case 'c': c = va_arg(*app, int); size += sizeof(c); continue; case 'h': h = va_arg(*app, int); size += sizeof(h); continue; case 'i': i = va_arg(*app, gfarm_int32_t); size += sizeof(i); continue; case 'l': /* * note that because actual type of gfarm_int64_t * may be diffenent (int64_t or double), we use lv here */ o = va_arg(*app, gfarm_int64_t); size += sizeof(lv); continue; case 's': s = va_arg(*app, const char *); n = strlen(s); size += sizeof(i); size += n; continue; case 'S': s = va_arg(*app, const char *); n = va_arg(*app, size_t); size += sizeof(i); size += n; continue; case 'b': /* * note that because actual type of size_t may be * diffenent ([u]int32_t or [u]int64_t), we must not * pass this as is via network. */ n = va_arg(*app, size_t); s = va_arg(*app, const char *); size += sizeof(i); size += n; continue; case 'f': d = va_arg(*app, double); size += sizeof(nd); continue; default: break; } break; } *sizep = size; *formatp = format; return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfp_xdr_vsend(struct gfp_xdr *conn, const char **formatp, va_list *app) { const char *format = *formatp; gfarm_uint8_t c; gfarm_int16_t h; gfarm_int32_t i, n; gfarm_int64_t o; gfarm_uint32_t lv[2]; #if INT64T_IS_FLOAT int minus; #endif double d; #ifndef WORDS_BIGENDIAN struct { char c[8]; } nd; #else # define nd d #endif const char *s; for (; *format; format++) { switch (*format) { case 'c': c = va_arg(*app, int); gfarm_iobuffer_put_write(conn->sendbuffer, &c, sizeof(c)); continue; case 'h': h = va_arg(*app, int); h = htons(h); gfarm_iobuffer_put_write(conn->sendbuffer, &h, sizeof(h)); continue; case 'i': i = va_arg(*app, gfarm_int32_t); i = htonl(i); gfarm_iobuffer_put_write(conn->sendbuffer, &i, sizeof(i)); continue; case 'l': /* * note that because actual type of gfarm_int64_t * may be diffenent (int64_t or double), we must * not pass this as is via network. */ o = va_arg(*app, gfarm_int64_t); #if INT64T_IS_FLOAT minus = o < 0; if (minus) o = -o; lv[0] = o / POWER2_32; lv[1] = o - lv[0] * POWER2_32; if (minus) { lv[0] = ~lv[0]; lv[1] = ~lv[1]; if (++lv[1] == 0) ++lv[0]; } #else lv[0] = o >> 32; lv[1] = o; #endif lv[0] = htonl(lv[0]); lv[1] = htonl(lv[1]); gfarm_iobuffer_put_write(conn->sendbuffer, lv, sizeof(lv)); continue; case 's': s = va_arg(*app, const char *); n = strlen(s); i = htonl(n); gfarm_iobuffer_put_write(conn->sendbuffer, &i, sizeof(i)); gfarm_iobuffer_put_write(conn->sendbuffer, s, n); continue; case 'S': s = va_arg(*app, const char *); n = va_arg(*app, size_t); i = htonl(n); gfarm_iobuffer_put_write(conn->sendbuffer, &i, sizeof(i)); gfarm_iobuffer_put_write(conn->sendbuffer, s, n); continue; case 'b': /* * note that because actual type of size_t may be * diffenent ([u]int32_t or [u]int64_t), we must not * pass this as is via network. */ n = va_arg(*app, size_t); i = htonl(n); s = va_arg(*app, const char *); gfarm_iobuffer_put_write(conn->sendbuffer, &i, sizeof(i)); gfarm_iobuffer_put_write(conn->sendbuffer, s, n); continue; case 'f': d = va_arg(*app, double); #ifndef WORDS_BIGENDIAN swab(&d, &nd, sizeof(nd)); #endif gfarm_iobuffer_put_write(conn->sendbuffer, &nd, sizeof(nd)); continue; default: break; } break; } *formatp = format; return (gfarm_iobuffer_get_error(conn->sendbuffer)); } static gfarm_error_t recv_sized(struct gfp_xdr *conn, int just, void *p, size_t sz, size_t *sizep) { int rv; if (*sizep < sz) { gflog_debug(GFARM_MSG_1001001, "recv_size: " "%d bytes expected, but only %d bytes remains", (int)sz, (int)*sizep); return (GFARM_ERR_PROTOCOL); /* too short message */ } rv = gfarm_iobuffer_get_read_x(conn->recvbuffer, p, sz, just); *sizep -= rv; if (rv != sz) { gflog_debug(GFARM_MSG_1001002, "recv_size: " "%d bytes expected, but only %d bytes read", (int)sz, rv); if (rv == 0) /* maybe usual EOF */ return (GFARM_ERR_UNEXPECTED_EOF); return (GFARM_ERR_PROTOCOL); /* really unexpected EOF */ } return (GFARM_ERR_NO_ERROR); /* rv may be 0, if sz == 0 */ } gfarm_error_t gfp_xdr_vrecv_sized(struct gfp_xdr *conn, int just, size_t *sizep, int *eofp, const char **formatp, va_list *app) { gfarm_error_t e = GFARM_ERR_NO_ERROR, e_save = GFARM_ERR_NO_ERROR; const char *format = *formatp; gfarm_int8_t *cp; gfarm_int16_t *hp; gfarm_int32_t *ip, i; gfarm_int64_t *op; gfarm_uint32_t lv[2]; #if INT64T_IS_FLOAT int minus; #endif double *dp; #ifndef WORDS_BIGENDIAN struct { char c[8]; } nd; #endif char **sp, *s; size_t *szp, sz; size_t size; int overflow = 0; if (sizep != NULL) size = *sizep; else size = SIZE_MAX; /* do not call gfp_xdr_flush() here for a compound procedure */ *eofp = 1; for (; *format; format++) { switch (*format) { case 'c': cp = va_arg(*app, gfarm_int8_t *); if ((e = recv_sized(conn, just, cp, sizeof(*cp), &size)) != GFARM_ERR_NO_ERROR) { if (e == GFARM_ERR_UNEXPECTED_EOF) return (GFARM_ERR_NO_ERROR); /* EOF */ break; } continue; case 'h': hp = va_arg(*app, gfarm_int16_t *); if ((e = recv_sized(conn, just, hp, sizeof(*hp), &size)) != GFARM_ERR_NO_ERROR) { if (e == GFARM_ERR_UNEXPECTED_EOF) return (GFARM_ERR_NO_ERROR); /* EOF */ break; } *hp = ntohs(*hp); continue; case 'i': ip = va_arg(*app, gfarm_int32_t *); if ((e = recv_sized(conn, just, ip, sizeof(*ip), &size)) != GFARM_ERR_NO_ERROR) { if (e == GFARM_ERR_UNEXPECTED_EOF) return (GFARM_ERR_NO_ERROR); /* EOF */ break; } *ip = ntohl(*ip); continue; case 'l': op = va_arg(*app, gfarm_int64_t *); /* * note that because actual type of gfarm_int64_t * may be diffenent (int64_t or double), we must * not pass this as is via network. */ if ((e = recv_sized(conn, just, lv, sizeof(lv), &size)) != GFARM_ERR_NO_ERROR) { if (e == GFARM_ERR_UNEXPECTED_EOF) return (GFARM_ERR_NO_ERROR); /* EOF */ break; } lv[0] = ntohl(lv[0]); lv[1] = ntohl(lv[1]); #if INT64T_IS_FLOAT minus = lv[0] & 0x80000000; if (minus) { lv[0] = ~lv[0]; lv[1] = ~lv[1]; if (++lv[1] == 0) ++lv[0]; } *op = lv[0] * POWER2_32 + lv[1]; if (minus) *op = -*op; #else *op = ((gfarm_int64_t)lv[0] << 32) | lv[1]; #endif continue; case 's': sp = va_arg(*app, char **); if ((e = recv_sized(conn, just, &i, sizeof(i), &size)) != GFARM_ERR_NO_ERROR) { if (e == GFARM_ERR_UNEXPECTED_EOF) return (GFARM_ERR_NO_ERROR); /* EOF */ break; } i = ntohl(i); sz = gfarm_size_add(&overflow, i, 1); if (overflow) { e = GFARM_ERR_PROTOCOL; break; } GFARM_MALLOC_ARRAY(*sp, sz); if (*sp == NULL) { if ((e = gfp_xdr_purge_sized(conn, just, sz, &size)) != GFARM_ERR_NO_ERROR) break; e_save = GFARM_ERR_NO_MEMORY; continue; } if ((e = recv_sized(conn, just, *sp, i, &size)) != GFARM_ERR_NO_ERROR) break; (*sp)[i] = '\0'; continue; case 'b': sz = va_arg(*app, size_t); szp = va_arg(*app, size_t *); s = va_arg(*app, char *); /* * note that because actual type of size_t may be * diffenent ([u]int32_t or [u]int64_t), we must not * pass this as is via network. */ if ((e = recv_sized(conn, just, &i, sizeof(i), &size)) != GFARM_ERR_NO_ERROR) { if (e == GFARM_ERR_UNEXPECTED_EOF) return (GFARM_ERR_NO_ERROR); /* EOF */ break; } i = ntohl(i); *szp = i; if (i <= sz) { if ((e = recv_sized(conn, just, s, i, &size)) != GFARM_ERR_NO_ERROR) break; } else { if (size < i) { e = GFARM_ERR_PROTOCOL; break; } if ((e = recv_sized(conn, just, s, sz, &size)) != GFARM_ERR_NO_ERROR) break; /* abandon (i - sz) bytes */ if ((e = gfp_xdr_purge_sized(conn, just, i - sz, &size)) != GFARM_ERR_NO_ERROR) break; } continue; case 'B': szp = va_arg(*app, size_t *); sp = va_arg(*app, char **); /* * note that because actual type of size_t may be * diffenent ([u]int32_t or [u]int64_t), we must not * pass this as is via network. */ if ((e = recv_sized(conn, just, &i, sizeof(i), &size)) != GFARM_ERR_NO_ERROR) { if (e == GFARM_ERR_UNEXPECTED_EOF) return (GFARM_ERR_NO_ERROR); /* EOF */ break; } i = ntohl(i); *szp = i; /* XXX is this +1 really necessary? */ sz = gfarm_size_add(&overflow, i, 1); if (overflow) { e = GFARM_ERR_PROTOCOL; break; } GFARM_MALLOC_ARRAY(*sp, sz); if (*sp == NULL) { if ((e = gfp_xdr_purge_sized(conn, just, sz, &size)) != GFARM_ERR_NO_ERROR) break; e_save = GFARM_ERR_NO_MEMORY; continue; } if ((e = recv_sized(conn, just, *sp, i, &size)) != GFARM_ERR_NO_ERROR) break; continue; case 'f': dp = va_arg(*app, double *); assert(sizeof(*dp) == 8); if ((e = recv_sized(conn, just, dp, sizeof(*dp), &size)) != GFARM_ERR_NO_ERROR) { if (e == GFARM_ERR_UNEXPECTED_EOF) return (GFARM_ERR_NO_ERROR); /* EOF */ break; } #ifndef WORDS_BIGENDIAN swab(dp, &nd, sizeof(nd)); *dp = *(double *)&nd; #endif continue; default: break; } break; } if (sizep != NULL) *sizep = size; *formatp = format; *eofp = 0; /* XXX FIXME free memory allocated by this funciton at an error */ /* connection error has most precedence to avoid protocol confusion */ if (e != GFARM_ERR_NO_ERROR) return (e); /* iobuffer error may be a connection error */ if ((e = gfarm_iobuffer_get_error(conn->recvbuffer)) != GFARM_ERR_NO_ERROR) return (e); return (e_save); /* NO_MEMORY or SUCCESS */ } gfarm_error_t gfp_xdr_vrecv(struct gfp_xdr *conn, int just, int *eofp, const char **formatp, va_list *app) { return (gfp_xdr_vrecv_sized(conn, just, NULL, eofp, formatp, app)); } gfarm_error_t gfp_xdr_send_size_add(size_t *sizep, const char *format, ...) { va_list ap; gfarm_error_t e; va_start(ap, format); e = gfp_xdr_vsend_size_add(sizep, &format, &ap); va_end(ap); if (e != GFARM_ERR_NO_ERROR) return (e); if (*format != '\0') { gflog_debug(GFARM_MSG_1001003, "gfp_xdr_send_size_add: " "invalid format character: %c(%x)", *format, *format); return (GFARM_ERRMSG_GFP_XDR_SEND_INVALID_FORMAT_CHARACTER); } return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfp_xdr_send(struct gfp_xdr *conn, const char *format, ...) { va_list ap; gfarm_error_t e; va_start(ap, format); e = gfp_xdr_vsend(conn, &format, &ap); va_end(ap); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001004, "gfp_xdr_vsend() failed: %s", gfarm_error_string(e)); return (e); } if (*format != '\0') { gflog_debug(GFARM_MSG_1001005, "gfp_xdr_send_size: " "invalid format character: %c(%x)", *format, *format); return (GFARM_ERRMSG_GFP_XDR_SEND_INVALID_FORMAT_CHARACTER); } return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfp_xdr_recv_sized(struct gfp_xdr *conn, int just, size_t *sizep, int *eofp, const char *format, ...) { va_list ap; gfarm_error_t e; va_start(ap, format); e = gfp_xdr_vrecv_sized(conn, just, sizep, eofp, &format, &ap); va_end(ap); if (e != GFARM_ERR_NO_ERROR) return (e); if (*eofp) return (GFARM_ERR_NO_ERROR); if (*format != '\0') { gflog_debug(GFARM_MSG_1001006, "gfp_xdr_recv_sized: " "invalid format character: %c(%x)", *format, *format); return (GFARM_ERRMSG_GFP_XDR_RECV_INVALID_FORMAT_CHARACTER); } return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfp_xdr_recv(struct gfp_xdr *conn, int just, int *eofp, const char *format, ...) { va_list ap; gfarm_error_t e; va_start(ap, format); e = gfp_xdr_vrecv(conn, just, eofp, &format, &ap); va_end(ap); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001007, "gfp_xdr_vrecv() failed: %s", gfarm_error_string(e)); return (e); } if (*eofp) return (GFARM_ERR_NO_ERROR); if (*format != '\0') { gflog_debug(GFARM_MSG_1001008, "gfp_xdr_recv: " "invalid format character: %c(%x)", *format, *format); return (GFARM_ERRMSG_GFP_XDR_RECV_INVALID_FORMAT_CHARACTER); } return (GFARM_ERR_NO_ERROR); } /* * do RPC request */ gfarm_error_t gfp_xdr_vrpc_request(struct gfp_xdr *conn, gfarm_int32_t command, const char **formatp, va_list *app) { gfarm_error_t e; /* * send request */ e = gfp_xdr_send(conn, "i", command); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001009, "sending command (%d) failed: %s", command, gfarm_error_string(e)); return (e); } return (gfp_xdr_vsend(conn, formatp, app)); } /* * used by client side of both synchronous and asynchronous protocol. * if sizep == NULL, it's a synchronous protocol, otherwise asynchronous. * Note that this function assumes that async_header is already received. * * Callers of this function should check the followings: * return value == GFARM_ERR_NOERROR * *errorp == GFARM_ERR_NOERROR * And if there is no remaining output parameter: * *sizep == 0 */ gfarm_error_t gfp_xdr_vrpc_result_sized(struct gfp_xdr *conn, int just, size_t *sizep, gfarm_int32_t *errorp, const char **formatp, va_list *app) { gfarm_error_t e; int eof; /* * receive response */ e = gfp_xdr_recv_sized(conn, just, sizep, &eof, "i", errorp); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001010, "receiving response (%d) failed: %s", just, gfarm_error_string(e)); return (e); } if (eof) { /* rpc status missing */ gflog_debug(GFARM_MSG_1001011, "Unexpected EOF when receiving response: %s", gfarm_error_string(GFARM_ERR_UNEXPECTED_EOF)); return (GFARM_ERR_UNEXPECTED_EOF); } if (*errorp != GFARM_ERR_NO_ERROR) return (GFARM_ERR_NO_ERROR); e = gfp_xdr_vrecv_sized(conn, just, sizep, &eof, formatp, app); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001012, "gfp_xdr_vrecv_sized() failed: %s", gfarm_error_string(e)); return (e); } if (eof) { /* rpc return value missing */ gflog_debug(GFARM_MSG_1001013, "Unexpected EOF when doing xdr vrecv: %s", gfarm_error_string(GFARM_ERR_UNEXPECTED_EOF)); return (GFARM_ERR_UNEXPECTED_EOF); } if (**formatp != '\0') { gflog_debug(GFARM_MSG_1001014, "gfp_xdr_vrpc_result_sized: " "invalid format character: %c(%x)", **formatp, **formatp); return (GFARM_ERRMSG_GFP_XDR_VRPC_INVALID_FORMAT_CHARACTER); } return (GFARM_ERR_NO_ERROR); } /* * get RPC result */ gfarm_error_t gfp_xdr_vrpc_result(struct gfp_xdr *conn, int just, gfarm_int32_t *errorp, const char **formatp, va_list *app) { return (gfp_xdr_vrpc_result_sized(conn, just, NULL, errorp, formatp, app)); } /* * do RPC with "request-args/result-args" format string. */ gfarm_error_t gfp_xdr_vrpc(struct gfp_xdr *conn, int just, gfarm_int32_t command, gfarm_int32_t *errorp, const char **formatp, va_list *app) { gfarm_error_t e; /* * send request */ e = gfp_xdr_vrpc_request(conn, command, formatp, app); if (e == GFARM_ERR_NO_ERROR) e = gfp_xdr_flush(conn); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001015, "gfp_xdr_vrpc_request() failed: %s", gfarm_error_string(e)); return (e); } if (**formatp != '/') { #if 1 gflog_fatal(GFARM_MSG_1000018, "%s", gfarm_error_string(GFARM_ERRMSG_GFP_XDR_VRPC_MISSING_RESULT_IN_FORMAT_STRING)); abort(); #endif return (GFARM_ERRMSG_GFP_XDR_VRPC_MISSING_RESULT_IN_FORMAT_STRING); } (*formatp)++; return (gfp_xdr_vrpc_result(conn, just, errorp, formatp, app)); } /* * low level interface, this does not wait to receive desired length. */ int gfp_xdr_recv_partial(struct gfp_xdr *conn, int just, void *data, int length) { return (gfarm_iobuffer_get_read_partial_x( conn->recvbuffer, data, length, just)); } gfarm_error_t gfp_xdr_recv_get_error(struct gfp_xdr *conn) { return (gfarm_iobuffer_get_error(conn->recvbuffer)); } /* * lowest level interface, * this does not wait to receive desired length, and * this does not honor iobuffer. */ gfarm_error_t gfp_xdr_read_direct(struct gfp_xdr *conn, void *data, int length, int *resultp) { int rv = (*conn->iob_ops->blocking_read)(conn->recvbuffer, conn->cookie, conn->fd, data, length); if (rv == -1) { *resultp = 0; return (gfarm_iobuffer_get_error(conn->recvbuffer)); } *resultp = rv; return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfp_xdr_write_direct(struct gfp_xdr *conn, void *data, int length, int *resultp) { int rv = (*conn->iob_ops->blocking_write)(conn->sendbuffer, conn->cookie, conn->fd, data, length); if (rv == -1) { *resultp = 0; return (gfarm_iobuffer_get_error(conn->sendbuffer)); } *resultp = rv; return (GFARM_ERR_NO_ERROR); } gfarm-2.4.1/lib/libgfarm/gfarm/gfs_client.c0000644000000000000000000022217311507222724017227 0ustar rootroot#define _POSIX_PII_SOCKET /* to use struct msghdr on Tru64 */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include /* sprintf() */ #include #include #include #include #include #include #include #include #include #include #include #include #if defined(SCM_RIGHTS) && \ (!defined(sun) || (!defined(__svr4__) && !defined(__SVR4))) #define HAVE_MSG_CONTROL 1 #endif #include "gfutil.h" #include "gfevent.h" #include "hash.h" #include "lru_cache.h" #include "liberror.h" #include "sockutil.h" #include "iobuffer.h" #include "gfp_xdr.h" #include "io_fd.h" #include "host.h" #include "param.h" #include "sockopt.h" #include "auth.h" #include "config.h" #include "conn_cache.h" #include "gfs_proto.h" #include "gfs_client.h" #define GFS_CLIENT_CONNECT_TIMEOUT 30 /* seconds */ #define GFS_CLIENT_COMMAND_TIMEOUT 20 /* seconds */ #define XAUTH_NEXTRACT_MAXLEN 512 struct gfs_connection { struct gfp_cached_connection *cache_entry; struct gfp_xdr *conn; char *hostname; int port; enum gfarm_auth_method auth_method; int is_local; gfarm_pid_t pid; /* parallel process ID */ int opened; /* reference counter */ void *context; /* work area for RPC (esp. GFS_PROTO_COMMAND) */ }; #define SERVER_HASHTAB_SIZE 3079 /* prime number */ static gfarm_error_t gfs_client_connection_dispose(void *); static struct gfp_conn_cache gfs_server_cache = GFP_CONN_CACHE_INITIALIZER(gfs_server_cache, gfs_client_connection_dispose, "gfs_connection", SERVER_HASHTAB_SIZE, &gfarm_gfsd_connection_cache); static gfarm_error_t (*gfs_client_hook_for_connection_error)(struct gfs_connection *) = NULL; /* * Currently this supports only one hook function. * And the function is always gfarm_schedule_host_cache_clear_auth() (or NULL). */ void gfs_client_add_hook_for_connection_error( gfarm_error_t (*hook)(struct gfs_connection *)) { gfs_client_hook_for_connection_error = hook; } static void gfs_client_execute_hook_for_connection_error(struct gfs_connection *gfs_server) { if (gfs_client_hook_for_connection_error != NULL) (*gfs_client_hook_for_connection_error)(gfs_server); } int gfs_client_is_connection_error(gfarm_error_t e) { return (IS_CONNECTION_ERROR(e)); } int gfs_client_connection_fd(struct gfs_connection *gfs_server) { return (gfp_xdr_fd(gfs_server->conn)); } enum gfarm_auth_method gfs_client_connection_auth_method(struct gfs_connection *gfs_server) { return (gfs_server->auth_method); } const char * gfs_client_hostname(struct gfs_connection *gfs_server) { return (gfs_server->hostname); } const char * gfs_client_username(struct gfs_connection *gfs_server) { return (gfarm_get_global_username()); /* XXX FIXME */ } int gfs_client_port(struct gfs_connection *gfs_server) { return (gfs_server->port); } int gfs_client_connection_is_local(struct gfs_connection *gfs_server) { return (gfs_server->is_local); } gfarm_pid_t gfs_client_pid(struct gfs_connection *gfs_server) { return (gfs_server->pid); } #define gfs_client_connection_is_cached(gfs_server) \ gfp_is_cached_connection((gfs_server)->cache_entry) #define gfs_client_connection_used(gfs_server) \ gfp_cached_connection_used(&gfs_server_cache, \ (gfs_server)->cache_entry) void gfs_client_purge_from_cache(struct gfs_connection *gfs_server) { gfp_cached_connection_purge_from_cache(&gfs_server_cache, gfs_server->cache_entry); } void gfs_client_connection_gc(void) { gfp_cached_connection_gc_all(&gfs_server_cache); } static int sockaddr_is_local(struct sockaddr *peer_addr) { static int self_ip_asked = 0; static int self_ip_count = 0; static struct in_addr *self_ip_list; struct sockaddr_in *peer_in; int i; if (!self_ip_asked) { self_ip_asked = 1; if (gfarm_get_ip_addresses(&self_ip_count, &self_ip_list) != GFARM_ERR_NO_ERROR) { /* self_ip_count remains 0 */ return (0); } } if (peer_addr->sa_family != AF_INET) return (0); peer_in = (struct sockaddr_in *)peer_addr; /* XXX if there are lots of IP address on this host, this is slow */ for (i = 0; i < self_ip_count; i++) { if (peer_in->sin_addr.s_addr == self_ip_list[i].s_addr) return (1); } return (0); } static gfarm_error_t gfs_client_connect_unix(struct sockaddr *peer_addr, int *sockp) { int rv, sock, save_errno; struct sockaddr_un peer_un; struct sockaddr_in *peer_in; socklen_t socklen; assert(peer_addr->sa_family == AF_INET); peer_in = (struct sockaddr_in *)peer_addr; sock = socket(PF_UNIX, SOCK_STREAM, 0); if (sock == -1 && (errno == ENFILE || errno == EMFILE)) { gfs_client_connection_gc(); /* XXX FIXME: GC all descriptors */ sock = socket(PF_UNIX, SOCK_STREAM, 0); } if (sock == -1) { save_errno = errno; gflog_debug(GFARM_MSG_1001172, "creation of UNIX socket failed: %s", strerror(save_errno)); return (gfarm_errno_to_error(save_errno)); } memset(&peer_un, 0, sizeof(peer_un)); /* XXX inet_ntoa() is not MT-safe on some platforms */ socklen = snprintf(peer_un.sun_path, sizeof(peer_un.sun_path), GFSD_LOCAL_SOCKET_NAME, inet_ntoa(peer_in->sin_addr), ntohs(peer_in->sin_port)); peer_un.sun_family = AF_UNIX; #ifdef SUN_LEN /* derived from 4.4BSD */ socklen = SUN_LEN(&peer_un); #else socklen += sizeof(peer_un) - sizeof(peer_un.sun_path); #endif rv = connect(sock, (struct sockaddr *)&peer_un, socklen); if (rv == -1) { save_errno = errno; close(sock); if (save_errno != ENOENT) { gflog_debug(GFARM_MSG_1001173, "connect() with UNIX socket failed: %s", strerror(save_errno)); return (gfarm_errno_to_error(save_errno)); } /* older gfsd doesn't support UNIX connection, try INET */ sock = -1; } *sockp = sock; return (GFARM_ERR_NO_ERROR); } static gfarm_error_t gfs_client_connect_inet(const char *canonical_hostname, struct sockaddr *peer_addr, int *connection_in_progress_p, int *sockp, const char *source_ip) { int rv, sock, save_errno; gfarm_error_t e; sock = socket(PF_INET, SOCK_STREAM, 0); if (sock == -1 && (errno == ENFILE || errno == EMFILE)) { gfs_client_connection_gc(); /* XXX FIXME: GC all descriptors */ sock = socket(PF_INET, SOCK_STREAM, 0); } if (sock == -1) { save_errno = errno; gflog_debug(GFARM_MSG_1001174, "Creation of inet socket failed: %s", strerror(save_errno)); return (gfarm_errno_to_error(save_errno)); } /* XXX - how to report setsockopt(2) failure ? */ gfarm_sockopt_apply_by_name_addr(sock, canonical_hostname, peer_addr); /* * this fcntl should never fail, or even if this fails, that's OK * because its only effect is that TCP timeout becomes longer. */ fcntl(sock, F_SETFL, O_NONBLOCK); if (source_ip != NULL) { e = gfarm_bind_source_ip(sock, source_ip); if (e != GFARM_ERR_NO_ERROR) { close(sock); gflog_debug(GFARM_MSG_1001175, "bind() with inet socket (%s) failed: %s", source_ip, gfarm_error_string(e)); return (e); } } rv = connect(sock, peer_addr, sizeof(*peer_addr)); if (rv < 0) { if (errno != EINPROGRESS) { save_errno = errno; close(sock); gflog_debug(GFARM_MSG_1001176, "connect() with inet socket failed: %s", strerror(save_errno)); return (gfarm_errno_to_error(save_errno)); } *connection_in_progress_p = 1; } else { *connection_in_progress_p = 0; } fcntl(sock, F_SETFL, 0); /* clear O_NONBLOCK, this should never fail */ *sockp = sock; return (GFARM_ERR_NO_ERROR); } static gfarm_error_t gfs_client_connection_alloc(const char *canonical_hostname, struct sockaddr *peer_addr, struct gfp_cached_connection *cache_entry, int *connection_in_progress_p, struct gfs_connection **gfs_serverp, const char *source_ip) { gfarm_error_t e; struct gfs_connection *gfs_server; int connection_in_progress, sock = -1, is_local = 0; #ifdef __GNUC__ /* workaround gcc warning: may be used uninitialized */ connection_in_progress = 0; #endif if (sockaddr_is_local(peer_addr)) { e = gfs_client_connect_unix(peer_addr, &sock); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001177, "connect with unix socket failed: %s", gfarm_error_string(e)); return (e); } connection_in_progress = 0; is_local = 1; } if (sock == -1) { e = gfs_client_connect_inet(canonical_hostname, peer_addr, &connection_in_progress, &sock, source_ip); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001178, "connect with inet socket failed: %s", gfarm_error_string(e)); return (e); } } fcntl(sock, F_SETFD, 1); /* automatically close() on exec(2) */ GFARM_MALLOC(gfs_server); if (gfs_server == NULL) { close(sock); gflog_debug(GFARM_MSG_1001179, "allocation of 'gfs_server' failed: %s", gfarm_error_string(GFARM_ERR_NO_MEMORY)); return (GFARM_ERR_NO_MEMORY); } e = gfp_xdr_new_socket(sock, &gfs_server->conn); if (e != GFARM_ERR_NO_ERROR) { free(gfs_server); close(sock); gflog_debug(GFARM_MSG_1001180, "gfp_xdr_new_socket() failed: %s", gfarm_error_string(e)); return (e); } gfs_server->hostname = strdup(canonical_hostname); if (gfs_server->hostname == NULL) { e = gfp_xdr_free(gfs_server->conn); free(gfs_server); gflog_debug(GFARM_MSG_1001181, "allocation of 'gfs_server->hostname' failed: %s", gfarm_error_string(GFARM_ERR_NO_MEMORY)); return (GFARM_ERR_NO_MEMORY); } gfs_server->port = ntohs(((struct sockaddr_in *)peer_addr)->sin_port); gfs_server->is_local = is_local; gfs_server->pid = 0; gfs_server->context = NULL; gfs_server->opened = 0; gfs_server->cache_entry = cache_entry; gfp_cached_connection_set_data(cache_entry, gfs_server); *connection_in_progress_p = connection_in_progress; *gfs_serverp = gfs_server; return (GFARM_ERR_NO_ERROR); } static gfarm_error_t gfs_client_connection_alloc_and_auth(const char *canonical_hostname, struct sockaddr *peer_addr, struct gfp_cached_connection *cache_entry, struct gfs_connection **gfs_serverp, const char *source_ip) { gfarm_error_t e; int connection_in_progress; struct gfs_connection *gfs_server; e = gfs_client_connection_alloc(canonical_hostname, peer_addr, cache_entry, &connection_in_progress, &gfs_server, source_ip); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001182, "gfs_client_connection_alloc() failed: %s", gfarm_error_string(e)); return (e); } if (connection_in_progress) e = gfarm_connect_wait(gfp_xdr_fd(gfs_server->conn), GFS_CLIENT_CONNECT_TIMEOUT); if (e == GFARM_ERR_NO_ERROR) e = gfarm_auth_request(gfs_server->conn, GFS_SERVICE_TAG, gfs_server->hostname, peer_addr, gfarm_get_auth_id_type(), &gfs_server->auth_method); if (e == GFARM_ERR_NO_ERROR) *gfs_serverp = gfs_server; else { free(gfs_server->hostname); gfp_xdr_free(gfs_server->conn); free(gfs_server); gflog_debug(GFARM_MSG_1001183, "connection or authentication failed: %s", gfarm_error_string(e)); } return (e); } static gfarm_error_t gfs_client_connection_dispose(void *connection_data) { struct gfs_connection *gfs_server = connection_data; gfarm_error_t e = gfp_xdr_free(gfs_server->conn); gfp_uncached_connection_dispose(gfs_server->cache_entry); free(gfs_server->hostname); /* XXX - gfs_server->context should be NULL here */ free(gfs_server); return (e); } /* * gfs_client_connection_free() can be used for both * an uncached connection which was created by gfs_client_connect(), and * a cached connection which was created by gfs_client_connection_acquire(). * The connection will be immediately closed in the former uncached case. * */ void gfs_client_connection_free(struct gfs_connection *gfs_server) { gfp_cached_or_uncached_connection_free(&gfs_server_cache, gfs_server->cache_entry); } void gfs_client_terminate(void) { gfp_cached_connection_terminate(&gfs_server_cache); } /* * gfs_client_connection_acquire - create or lookup a cached connection */ gfarm_error_t gfs_client_connection_acquire(const char *canonical_hostname, struct sockaddr *peer_addr, struct gfs_connection **gfs_serverp) { gfarm_error_t e; struct gfp_cached_connection *cache_entry; int created; e = gfp_cached_connection_acquire(&gfs_server_cache, canonical_hostname, ntohs(((struct sockaddr_in *)peer_addr)->sin_port), &cache_entry, &created); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001184, "acquirement of cached connection (%s) failed: %s", canonical_hostname, gfarm_error_string(e)); return (e); } if (!created) { *gfs_serverp = gfp_cached_connection_get_data(cache_entry); return (GFARM_ERR_NO_ERROR); } e = gfs_client_connection_alloc_and_auth(canonical_hostname, peer_addr, cache_entry, gfs_serverp, NULL); if (e != GFARM_ERR_NO_ERROR) { gfp_cached_connection_purge_from_cache(&gfs_server_cache, cache_entry); gfp_uncached_connection_dispose(cache_entry); gflog_debug(GFARM_MSG_1001185, "allocation or authentication failed: %s", gfarm_error_string(e)); } return (e); } gfarm_error_t gfs_client_connection_acquire_by_host(struct gfm_connection *gfm_server, const char *canonical_hostname, int port, struct gfs_connection **gfs_serverp, const char *source_ip) { gfarm_error_t e; struct gfp_cached_connection *cache_entry; int created; struct sockaddr peer_addr; /* * lookup gfs_server_cache first, * to eliminate hostname -> IP-address conversion in a cached case. */ e = gfp_cached_connection_acquire(&gfs_server_cache, canonical_hostname, port, &cache_entry, &created); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001186, "acquirement of cached connection (%s) failed: %s", canonical_hostname, gfarm_error_string(e)); return (e); } if (!created) { *gfs_serverp = gfp_cached_connection_get_data(cache_entry); return (GFARM_ERR_NO_ERROR); } e = gfm_host_address_get(gfm_server, canonical_hostname, port, &peer_addr, NULL); if (e == GFARM_ERR_NO_ERROR) e = gfs_client_connection_alloc_and_auth(canonical_hostname, &peer_addr, cache_entry, gfs_serverp, source_ip); if (e != GFARM_ERR_NO_ERROR) { gfp_cached_connection_purge_from_cache(&gfs_server_cache, cache_entry); gfp_uncached_connection_dispose(cache_entry); gflog_debug(GFARM_MSG_1001187, "client authentication failed: %s", gfarm_error_string(e)); } return (e); } /* * gfs_client_connect - create an uncached connection * * XXX FIXME * `hostname' to `addr' conversion really should be done in this function, * rather than a caller of this function. */ gfarm_error_t gfs_client_connect(const char *canonical_hostname, struct sockaddr *peer_addr, struct gfs_connection **gfs_serverp) { gfarm_error_t e; struct gfp_cached_connection *cache_entry; e = gfp_uncached_connection_new(&cache_entry); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001188, "making new uncached connection failed: %s", gfarm_error_string(e)); return (e); } e = gfs_client_connection_alloc_and_auth(canonical_hostname, peer_addr, cache_entry, gfs_serverp, NULL); if (e != GFARM_ERR_NO_ERROR) { gfp_uncached_connection_dispose(cache_entry); gflog_debug(GFARM_MSG_1001189, "client authentication failed: %s", gfarm_error_string(e)); } return (e); } /* convert from uncached connection to cached */ gfarm_error_t gfs_client_connection_enter_cache(struct gfs_connection *gfs_server) { if (gfs_client_connection_is_cached(gfs_server)) { gflog_error(GFARM_MSG_1000068, "gfs_client_connection_enter_cache: " "programming error"); abort(); } return (gfp_uncached_connection_enter_cache(&gfs_server_cache, gfs_server->cache_entry, gfs_server->hostname, gfs_server->port)); } /* * multiplexed version of gfs_client_connect() for parallel authentication * for parallel authentication */ struct gfs_client_connect_state { struct gfarm_eventqueue *q; struct gfarm_event *writable; struct sockaddr peer_addr; void (*continuation)(void *); void *closure; struct gfs_connection *gfs_server; struct gfarm_auth_request_state *auth_state; /* results */ gfarm_error_t error; }; static void gfs_client_connect_end_auth(void *closure) { struct gfs_client_connect_state *state = closure; state->error = gfarm_auth_result_multiplexed( state->auth_state, &state->gfs_server->auth_method); if (state->continuation != NULL) (*state->continuation)(state->closure); } static void gfs_client_connect_start_auth(int events, int fd, void *closure, const struct timeval *t) { struct gfs_client_connect_state *state = closure; int error; socklen_t error_size = sizeof(error); int rv = getsockopt(fd, SOL_SOCKET, SO_ERROR, &error, &error_size); if (rv == -1) { /* Solaris, see UNP by rstevens */ state->error = gfarm_errno_to_error(errno); } else if (error != 0) { state->error = gfarm_errno_to_error(error); } else { /* successfully connected */ state->error = gfarm_auth_request_multiplexed(state->q, state->gfs_server->conn, GFS_SERVICE_TAG, state->gfs_server->hostname, &state->peer_addr, gfarm_get_auth_id_type(), gfs_client_connect_end_auth, state, &state->auth_state); if (state->error == GFARM_ERR_NO_ERROR) { /* * call auth_request, * then go to gfs_client_connect_end_auth() */ return; } } gflog_debug(GFARM_MSG_1001190, "starting client connection auth failed: %s", gfarm_error_string(state->error)); if (state->continuation != NULL) (*state->continuation)(state->closure); } gfarm_error_t gfs_client_connect_request_multiplexed(struct gfarm_eventqueue *q, const char *canonical_hostname, struct sockaddr *peer_addr, void (*continuation)(void *), void *closure, struct gfs_client_connect_state **statepp) { gfarm_error_t e; int rv; struct gfp_cached_connection *cache_entry; struct gfs_connection *gfs_server; struct gfs_client_connect_state *state; int connection_in_progress; /* clone of gfs_client_connect() */ GFARM_MALLOC(state); if (state == NULL) { gflog_debug(GFARM_MSG_1001191, "allocation of client connect state failed: %s", gfarm_error_string(GFARM_ERR_NO_MEMORY)); return (GFARM_ERR_NO_MEMORY); } e = gfp_uncached_connection_new(&cache_entry); if (e != GFARM_ERR_NO_ERROR) { free(state); gflog_debug(GFARM_MSG_1001192, "making new uncached connection failed: %s", gfarm_error_string(e)); return (e); } e = gfs_client_connection_alloc(canonical_hostname, peer_addr, cache_entry, &connection_in_progress, &gfs_server, NULL); if (e != GFARM_ERR_NO_ERROR) { gfp_uncached_connection_dispose(cache_entry); free(state); gflog_debug(GFARM_MSG_1001193, "allocation of client connection failed: %s", gfarm_error_string(e)); return (e); } state->q = q; state->peer_addr = *peer_addr; state->continuation = continuation; state->closure = closure; state->gfs_server = gfs_server; state->auth_state = NULL; state->error = GFARM_ERR_NO_ERROR; if (connection_in_progress) { state->writable = gfarm_fd_event_alloc(GFARM_EVENT_WRITE, gfp_xdr_fd(gfs_server->conn), gfs_client_connect_start_auth, state); if (state->writable == NULL) { e = GFARM_ERR_NO_MEMORY; } else if ((rv = gfarm_eventqueue_add_event(q, state->writable, NULL)) == 0) { *statepp = state; /* go to gfs_client_connect_start_auth() */ return (GFARM_ERR_NO_ERROR); } else { e = gfarm_errno_to_error(rv); gfarm_event_free(state->writable); } } else { state->writable = NULL; e = gfarm_auth_request_multiplexed(q, gfs_server->conn, GFS_SERVICE_TAG, gfs_server->hostname, &state->peer_addr, gfarm_get_auth_id_type(), gfs_client_connect_end_auth, state, &state->auth_state); if (e == GFARM_ERR_NO_ERROR) { *statepp = state; /* * call gfarm_auth_request, * then go to gfs_client_connect_end_auth() */ return (GFARM_ERR_NO_ERROR); } } free(state); gfs_client_connection_dispose(gfs_server); gflog_debug(GFARM_MSG_1001194, "request for multiplexed client connect failed: %s", gfarm_error_string(e)); return (e); } gfarm_error_t gfs_client_connect_result_multiplexed( struct gfs_client_connect_state *state, struct gfs_connection **gfs_serverp) { gfarm_error_t e = state->error; struct gfs_connection *gfs_server = state->gfs_server; if (state->writable != NULL) gfarm_event_free(state->writable); free(state); if (e != GFARM_ERR_NO_ERROR) { gfs_client_connection_dispose(gfs_server); gflog_debug(GFARM_MSG_1001195, "error in result of multiplexed client connect: %s", gfarm_error_string(e)); return (e); } *gfs_serverp = gfs_server; return (GFARM_ERR_NO_ERROR); } /* * gfs_client RPC */ int gfarm_fd_receive_message(int fd, void *buf, size_t size, int fdc, int *fdv) { char *buffer = buf; int i, rv; struct iovec iov[1]; struct msghdr msg; #ifdef HAVE_MSG_CONTROL /* 4.3BSD Reno or later */ struct { struct cmsghdr hdr; char data[CMSG_SPACE(sizeof(*fdv) * GFSD_MAX_PASSING_FD) - sizeof(struct cmsghdr)]; } cmsg; if (fdc > GFSD_MAX_PASSING_FD) { #if 0 fprintf(stderr, "gfarm_fd_receive_message(%s): " "fd count %d > %d\n", fdc, GFSD_MAX_PASSING_FD); #endif return (EINVAL); } #endif while (size > 0) { iov[0].iov_base = buffer; iov[0].iov_len = size; msg.msg_iov = iov; msg.msg_iovlen = 1; msg.msg_name = NULL; msg.msg_namelen = 0; #ifndef HAVE_MSG_CONTROL if (fdc > 0) { msg.msg_accrights = (caddr_t)fdv; msg.msg_accrightslen = sizeof(*fdv) * fdc; for (i = 0; i < fdc; i++) fdv[i] = -1; } else { msg.msg_accrights = NULL; msg.msg_accrightslen = 0; } #else /* 4.3BSD Reno or later */ if (fdc > 0) { msg.msg_control = (caddr_t)&cmsg.hdr; msg.msg_controllen = CMSG_SPACE(sizeof(*fdv) * fdc); memset(msg.msg_control, 0, msg.msg_controllen); for (i = 0; i < fdc; i++) ((int *)CMSG_DATA(&cmsg.hdr))[i] = -1; } else { msg.msg_control = NULL; msg.msg_controllen = 0; } #endif rv = recvmsg(fd, &msg, 0); if (rv == -1) { if (errno == EINTR) continue; return (errno); /* failure */ } else if (rv == 0) { return (-1); /* EOF */ } #ifdef HAVE_MSG_CONTROL /* 4.3BSD Reno or later */ if (fdc > 0) { if (msg.msg_controllen != CMSG_SPACE(sizeof(*fdv) * fdc) || cmsg.hdr.cmsg_len != CMSG_LEN(sizeof(*fdv) * fdc) || cmsg.hdr.cmsg_level != SOL_SOCKET || cmsg.hdr.cmsg_type != SCM_RIGHTS) { #if 0 fprintf(stderr, "gfarm_fd_receive_message():" " descriptor not passed" " msg_controllen: %d (%d)," " cmsg_len: %d (%d)," " cmsg_level: %d," " cmsg_type: %d\n", msg.msg_controllen, CMSG_SPACE(sizeof(*fdv) * fdc), cmsg.hdr.cmsg_len, CMSG_LEN(sizeof(*fdv) * fdc), cmsg.hdr.cmsg_level, cmsg.hdr.cmsg_type); #endif } for (i = 0; i < fdc; i++) fdv[i] = ((int *)CMSG_DATA(&cmsg.hdr))[i]; } #endif fdc = 0; fdv = NULL; buffer += rv; size -= rv; } return (0); /* success */ } gfarm_error_t gfs_client_rpc_request(struct gfs_connection *gfs_server, int command, const char *format, ...) { va_list ap; gfarm_error_t e; va_start(ap, format); e = gfp_xdr_vrpc_request(gfs_server->conn, command, &format, &ap); va_end(ap); if (IS_CONNECTION_ERROR(e)) { gfs_client_execute_hook_for_connection_error(gfs_server); gfs_client_purge_from_cache(gfs_server); } if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001196, "gfp_xdr_vrpc_request() failed: %s", gfarm_error_string(e)); } return (e); } gfarm_error_t gfs_client_rpc_result(struct gfs_connection *gfs_server, int just, const char *format, ...) { va_list ap; gfarm_error_t e; int errcode; gfs_client_connection_used(gfs_server); e = gfp_xdr_flush(gfs_server->conn); if (IS_CONNECTION_ERROR(e)) { gfs_client_execute_hook_for_connection_error(gfs_server); gfs_client_purge_from_cache(gfs_server); } if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001197, "gfp_xdr_flush() failed : %s", gfarm_error_string(e)); return (e); } va_start(ap, format); e = gfp_xdr_vrpc_result(gfs_server->conn, just, &errcode, &format, &ap); va_end(ap); if (IS_CONNECTION_ERROR(e)) { gfs_client_execute_hook_for_connection_error(gfs_server); gfs_client_purge_from_cache(gfs_server); } if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001198, "gfp_xdr_vrpc_result() failed: %s", gfarm_error_string(e)); return (e); } if (errcode != 0) { /* * We just use gfarm_error_t as the errcode, * Note that GFARM_ERR_NO_ERROR == 0. */ gflog_debug(GFARM_MSG_1001199, "gfp_xdr_vrpc_result() failed errcode=%d", errcode); return (errcode); } return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfs_client_rpc(struct gfs_connection *gfs_server, int just, int command, const char *format, ...) { va_list ap; gfarm_error_t e; int errcode; gfs_client_connection_used(gfs_server); va_start(ap, format); e = gfp_xdr_vrpc(gfs_server->conn, just, command, &errcode, &format, &ap); va_end(ap); if (IS_CONNECTION_ERROR(e)) { gfs_client_execute_hook_for_connection_error(gfs_server); gfs_client_purge_from_cache(gfs_server); } if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001200, "gfp_xdr_vrpc() failed: %s", gfarm_error_string(e)); return (e); } if (errcode != 0) { /* * We just use gfarm_error_t as the errcode, * Note that GFARM_ERR_NO_ERROR == 0. */ gflog_debug(GFARM_MSG_1001201, "gfp_xdr_vrpc() errcode=%d", errcode); return (errcode); } return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfs_client_process_set(struct gfs_connection *gfs_server, gfarm_int32_t type, const char *key, size_t size, gfarm_pid_t pid) { gfarm_error_t e; e = gfs_client_rpc(gfs_server, 0, GFS_PROTO_PROCESS_SET, "ibl/", type, size, key, pid); if (e == GFARM_ERR_NO_ERROR) gfs_server->pid = pid; else gflog_debug(GFARM_MSG_1001202, "gfs_client_rpc() failed: %s", gfarm_error_string(e)); return (e); } gfarm_error_t gfs_client_open(struct gfs_connection *gfs_server, gfarm_int32_t fd) { gfarm_error_t e; e = gfs_client_rpc(gfs_server, 0, GFS_PROTO_OPEN, "i/", fd); if (e == GFARM_ERR_NO_ERROR) ++gfs_server->opened; else gflog_debug(GFARM_MSG_1001203, "gfs_client_rpc() failed: %s", gfarm_error_string(e)); return (e); } gfarm_error_t gfs_client_open_local(struct gfs_connection *gfs_server, gfarm_int32_t fd, int *fd_ret) { gfarm_error_t e; int rv, local_fd; gfarm_int8_t dummy; /* needs at least 1 byte */ if (!gfs_server->is_local) { gflog_debug(GFARM_MSG_1001204, "gfs server is local: %s", gfarm_error_string(GFARM_ERR_OPERATION_NOT_SUPPORTED)); return (GFARM_ERR_OPERATION_NOT_SUPPORTED); } /* we have to set `just' flag here */ e = gfs_client_rpc(gfs_server, 1, GFS_PROTO_OPEN_LOCAL, "i/", fd); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001205, "gfs_client_rpc() failed: %s", gfarm_error_string(e)); return (e); } /* layering violation, but... */ rv = gfarm_fd_receive_message(gfp_xdr_fd(gfs_server->conn), &dummy, sizeof(dummy), 1, &local_fd); if (rv == -1) { /* EOF */ gflog_debug(GFARM_MSG_1001206, "Unexpected EOF when receiving message: %s", gfarm_error_string(GFARM_ERR_UNEXPECTED_EOF)); return (GFARM_ERR_UNEXPECTED_EOF); } if (rv != 0) { gflog_debug(GFARM_MSG_1001207, "receiving message failed: %s", gfarm_error_string(gfarm_errno_to_error(rv))); return (gfarm_errno_to_error(rv)); } /* both `dummy' and `local_fd` are passed by using host byte order. */ *fd_ret = local_fd; ++gfs_server->opened; return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfs_client_close(struct gfs_connection *gfs_server, gfarm_int32_t fd) { gfarm_error_t e; e = gfs_client_rpc(gfs_server, 0, GFS_PROTO_CLOSE, "i/", fd); if (e == GFARM_ERR_NO_ERROR) --gfs_server->opened; else gflog_debug(GFARM_MSG_1001208, "gfs_client_rpc() failed: %s", gfarm_error_string(e)); return (e); } gfarm_error_t gfs_client_pread(struct gfs_connection *gfs_server, gfarm_int32_t fd, void *buffer, size_t size, gfarm_off_t off, size_t *np) { gfarm_error_t e; if ((e = gfs_client_rpc(gfs_server, 0, GFS_PROTO_PREAD, "iil/b", fd, (int)size, off, size, np, buffer)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001209, "gfs_client_rpc() failed: %s", gfarm_error_string(e)); return (e); } if (*np > size) { gflog_debug(GFARM_MSG_1001210, "Protocol error in client pread (%llu)>(%llu)", (unsigned long long)*np, (unsigned long long)size); return (GFARM_ERRMSG_GFS_PROTO_PREAD_PROTOCOL); } return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfs_client_pwrite(struct gfs_connection *gfs_server, gfarm_int32_t fd, const void *buffer, size_t size, gfarm_off_t off, size_t *np) { gfarm_error_t e; gfarm_int32_t n; /* size_t may be 64bit */ if ((e = gfs_client_rpc(gfs_server, 0, GFS_PROTO_PWRITE, "ibl/i", fd, size, buffer, off, &n)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001211, "gfs_client_rpc() failed: %s", gfarm_error_string(e)); return (e); } *np = n; if (n > size) { gflog_debug(GFARM_MSG_1001212, "Protocol error in client pwrite (%llu)>(%llu)", (unsigned long long)*np, (unsigned long long)size); return (GFARM_ERRMSG_GFS_PROTO_PWRITE_PROTOCOL); } return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfs_client_ftruncate(struct gfs_connection *gfs_server, gfarm_int32_t fd, gfarm_off_t size) { return (gfs_client_rpc(gfs_server, 0, GFS_PROTO_FTRUNCATE, "il/", fd, size)); } gfarm_error_t gfs_client_fsync(struct gfs_connection *gfs_server, gfarm_int32_t fd, gfarm_int32_t op) { return (gfs_client_rpc(gfs_server, 0, GFS_PROTO_FSYNC, "ii/", fd, op)); } gfarm_error_t gfs_client_fstat(struct gfs_connection *gfs_server, gfarm_int32_t fd, gfarm_off_t *size, gfarm_int64_t *atime_sec, gfarm_int32_t *atime_nsec, gfarm_int64_t *mtime_sec, gfarm_int32_t *mtime_nsec) { return (gfs_client_rpc(gfs_server, 0, GFS_PROTO_FSTAT, "i/llili", fd, size, atime_sec, atime_nsec, mtime_sec, mtime_nsec)); } gfarm_error_t gfs_client_cksum_set(struct gfs_connection *gfs_server, gfarm_int32_t fd, const char *cksum_type, size_t length, const char *cksum) { return (gfs_client_rpc(gfs_server, 0, GFS_PROTO_CKSUM_SET, "isb/", fd, cksum_type, length, cksum)); } gfarm_error_t gfs_client_lock(struct gfs_connection *gfs_server, gfarm_int32_t fd, gfarm_off_t start, gfarm_off_t len, gfarm_int32_t type, gfarm_int32_t whence) { return (gfs_client_rpc(gfs_server, 0, GFS_PROTO_LOCK, "illii/", fd, start, len, type, whence)); } gfarm_error_t gfs_client_trylock(struct gfs_connection *gfs_server, gfarm_int32_t fd, gfarm_off_t start, gfarm_off_t len, gfarm_int32_t type, gfarm_int32_t whence) { return (gfs_client_rpc(gfs_server, 0, GFS_PROTO_TRYLOCK, "illii/", fd, start, len, type, whence)); } gfarm_error_t gfs_client_unlock(struct gfs_connection *gfs_server, gfarm_int32_t fd, gfarm_off_t start, gfarm_off_t len, gfarm_int32_t type, gfarm_int32_t whence) { return (gfs_client_rpc(gfs_server, 0, GFS_PROTO_UNLOCK, "illii/", fd, start, len, type, whence)); } gfarm_error_t gfs_client_lock_info(struct gfs_connection *gfs_server, gfarm_int32_t fd, gfarm_off_t start, gfarm_off_t len, gfarm_int32_t type, gfarm_int32_t whence, gfarm_off_t *start_ret, gfarm_off_t *len_ret, gfarm_int32_t *type_ret, char **host_ret, gfarm_pid_t **pid_ret) { return (gfs_client_rpc(gfs_server, 0, GFS_PROTO_LOCK_INFO, "illii/llisl", fd, start, len, type, whence, start_ret, len_ret, type_ret, host_ret, pid_ret)); } gfarm_error_t gfs_client_replica_add_from(struct gfs_connection *gfs_server, char *host, gfarm_int32_t port, gfarm_int32_t fd) { return (gfs_client_rpc(gfs_server, 0, GFS_PROTO_REPLICA_ADD_FROM, "sii/", host, port, fd)); } gfarm_error_t gfs_client_statfs(struct gfs_connection *gfs_server, char *path, gfarm_int32_t *bsizep, gfarm_off_t *blocksp, gfarm_off_t *bfreep, gfarm_off_t *bavailp, gfarm_off_t *filesp, gfarm_off_t *ffreep, gfarm_off_t *favailp) { return (gfs_client_rpc(gfs_server, 0, GFS_PROTO_STATFS, "s/illllll", path, bsizep, blocksp, bfreep, bavailp, filesp, ffreep, favailp)); } /* * multiplexed version of gfs_client_statfs() */ struct gfs_client_statfs_state { struct gfarm_eventqueue *q; struct gfarm_event *writable, *readable; void (*continuation)(void *); void *closure; struct gfs_connection *gfs_server; char *path; /* results */ gfarm_error_t error; gfarm_int32_t bsize; gfarm_off_t blocks, bfree, bavail; gfarm_off_t files, ffree, favail; }; static void gfs_client_statfs_send_request(int events, int fd, void *closure, const struct timeval *t) { struct gfs_client_statfs_state *state = closure; int rv; struct timeval timeout; state->error = gfs_client_rpc_request(state->gfs_server, GFS_PROTO_STATFS, "s", state->path); if (state->error == GFARM_ERR_NO_ERROR) { state->error = gfp_xdr_flush(state->gfs_server->conn); if (IS_CONNECTION_ERROR(state->error)) { gfs_client_execute_hook_for_connection_error( state->gfs_server); gfs_client_purge_from_cache(state->gfs_server); } if (state->error == GFARM_ERR_NO_ERROR) { timeout.tv_sec = GFS_CLIENT_COMMAND_TIMEOUT; timeout.tv_usec = 0; if ((rv = gfarm_eventqueue_add_event(state->q, state->readable, &timeout)) == 0) { /* go to gfs_client_statfs_recv_result() */ return; } state->error = gfarm_errno_to_error(rv); } } gflog_debug(GFARM_MSG_1001213, "request for client statfs failed: %s", gfarm_error_string(state->error)); if (state->continuation != NULL) (*state->continuation)(state->closure); } static void gfs_client_statfs_recv_result(int events, int fd, void *closure, const struct timeval *t) { struct gfs_client_statfs_state *state = closure; if ((events & GFARM_EVENT_TIMEOUT) != 0) { assert(events == GFARM_EVENT_TIMEOUT); state->error = GFARM_ERR_OPERATION_TIMED_OUT; } else { assert(events == GFARM_EVENT_READ); state->error = gfs_client_rpc_result(state->gfs_server, 0, "illllll", &state->bsize, &state->blocks, &state->bfree, &state->bavail, &state->files, &state->ffree, &state->favail); } if (state->continuation != NULL) (*state->continuation)(state->closure); } gfarm_error_t gfs_client_statfs_request_multiplexed(struct gfarm_eventqueue *q, struct gfs_connection *gfs_server, char *path, void (*continuation)(void *), void *closure, struct gfs_client_statfs_state **statepp) { gfarm_error_t e; int rv; struct gfs_client_statfs_state *state; GFARM_MALLOC(state); if (state == NULL) { e = GFARM_ERR_NO_MEMORY; gflog_debug(GFARM_MSG_1001214, "allocation of client statfs state failed: %s", gfarm_error_string(GFARM_ERR_NO_MEMORY)); goto error_return; } state->q = q; state->continuation = continuation; state->closure = closure; state->gfs_server = gfs_server; state->path = path; state->error = GFARM_ERR_NO_ERROR; state->writable = gfarm_fd_event_alloc(GFARM_EVENT_WRITE, gfs_client_connection_fd(gfs_server), gfs_client_statfs_send_request, state); if (state->writable == NULL) { e = GFARM_ERR_NO_MEMORY; gflog_debug(GFARM_MSG_1001215, "allocation of state->writable failed: %s", gfarm_error_string(GFARM_ERR_NO_MEMORY)); goto error_free_state; } /* * We cannot use two independent events (i.e. a fd_event with * GFARM_EVENT_READ flag and a timer_event) here, because * it's possible that both event handlers are called at once. */ state->readable = gfarm_fd_event_alloc( GFARM_EVENT_READ|GFARM_EVENT_TIMEOUT, gfs_client_connection_fd(gfs_server), gfs_client_statfs_recv_result, state); if (state->readable == NULL) { e = GFARM_ERR_NO_MEMORY; gflog_debug(GFARM_MSG_1001216, "allocation of state->readable failed: %s", gfarm_error_string(GFARM_ERR_NO_MEMORY)); goto error_free_writable; } /* go to gfs_client_statfs_send_request() */ rv = gfarm_eventqueue_add_event(q, state->writable, NULL); if (rv != 0) { e = gfarm_errno_to_error(rv); gflog_debug(GFARM_MSG_1001217, "adding event to event queue failed: %s", gfarm_error_string(e)); goto error_free_readable; } *statepp = state; return (GFARM_ERR_NO_ERROR); error_free_readable: gfarm_event_free(state->readable); error_free_writable: gfarm_event_free(state->writable); error_free_state: free(state); error_return: return (e); } gfarm_error_t gfs_client_statfs_result_multiplexed(struct gfs_client_statfs_state *state, gfarm_int32_t *bsizep, gfarm_off_t *blocksp, gfarm_off_t *bfreep, gfarm_off_t *bavailp, gfarm_off_t *filesp, gfarm_off_t *ffreep, gfarm_off_t *favailp) { gfarm_error_t e = state->error; gfarm_event_free(state->writable); gfarm_event_free(state->readable); if (e == GFARM_ERR_NO_ERROR) { *bsizep = state->bsize; *blocksp = state->blocks; *bfreep = state->bfree; *bavailp = state->bavail; *filesp = state->files; *ffreep = state->ffree; *favailp = state->favail; } free(state); return (e); } /* * GFS_PROTO_REPLICA_RECV is only used by gfsd, * but defined here for better maintainability. */ gfarm_error_t gfs_client_replica_recv(struct gfs_connection *gfs_server, gfarm_ino_t ino, gfarm_uint64_t gen, gfarm_int32_t local_fd) { gfarm_error_t e, e_write = GFARM_ERR_NO_ERROR, e_rpc; int i, rv, eof; char buffer[GFS_PROTO_MAX_IOSIZE]; e = gfs_client_rpc_request(gfs_server, GFS_PROTO_REPLICA_RECV, "ll", ino, gen); if (e == GFARM_ERR_NO_ERROR) e = gfp_xdr_flush(gfs_server->conn); if (IS_CONNECTION_ERROR(e)) { gfs_client_execute_hook_for_connection_error(gfs_server); gfs_client_purge_from_cache(gfs_server); } if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001218, "gfs_request_client_rpc() failed: %s", gfarm_error_string(e)); return (e); } for (;;) { gfarm_int32_t size; int skip = 0; /* XXX - FIXME layering violation */ e = gfp_xdr_recv(gfs_server->conn, 0, &eof, "i", &size); if (IS_CONNECTION_ERROR(e)) { gfs_client_execute_hook_for_connection_error( gfs_server); gfs_client_purge_from_cache(gfs_server); } if (e != GFARM_ERR_NO_ERROR) break; if (eof) { e = GFARM_ERR_PROTOCOL; break; } if (size <= 0) break; do { /* XXX - FIXME layering violation */ int partial = gfp_xdr_recv_partial(gfs_server->conn, 0, buffer, size); e = gfp_xdr_recv_get_error(gfs_server->conn); if (IS_CONNECTION_ERROR(e)) { gfs_client_execute_hook_for_connection_error( gfs_server); gfs_client_purge_from_cache(gfs_server); } if (e != GFARM_ERR_NO_ERROR) break; if (partial <= 0) { e = GFARM_ERR_PROTOCOL; break; } size -= partial; #ifdef __GNUC__ /* shut up stupid warning by gcc */ rv = 0; #endif i = 0; if (skip) /* write(2) returns error */ i = partial; for (; i < partial; i += rv) { rv = write(local_fd, buffer + i, partial - i); if (rv <= 0) break; } if (i < partial) { /* * write(2) never returns 0, * so the following rv == 0 case is * just warm fuzzy. */ e_write = gfarm_errno_to_error( rv == 0 ? ENOSPC : errno); /* * we should receive rest of data, * even if write(2) fails. */ skip = 1; } } while (size > 0); if (e != GFARM_ERR_NO_ERROR) break; } e_rpc = gfs_client_rpc_result(gfs_server, 0, ""); if (e == GFARM_ERR_NO_ERROR) e = e_write; if (e == GFARM_ERR_NO_ERROR) e = e_rpc; if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001219, "receiving client replica failed: %s", gfarm_error_string(e)); } return (e); } /* ********************************************************************** * Implementation of gfs_client_command() ********************************************************************** */ struct gfs_client_command_context { struct gfarm_iobuffer *iobuffer[NFDESC]; enum { GFS_COMMAND_SERVER_STATE_NEUTRAL, GFS_COMMAND_SERVER_STATE_OUTPUT, GFS_COMMAND_SERVER_STATE_EXITED, GFS_COMMAND_SERVER_STATE_ABORTED } server_state; int server_output_fd; int server_output_residual; enum { GFS_COMMAND_CLIENT_STATE_NEUTRAL, GFS_COMMAND_CLIENT_STATE_OUTPUT } client_state; int client_output_residual; int pid; int pending_signal; }; void gfs_client_command_set_stdin(struct gfs_connection *gfs_server, int (*rf)(struct gfarm_iobuffer *, void *, int, void *, int), void *cookie, int fd) { struct gfs_client_command_context *cc = gfs_server->context; gfarm_iobuffer_set_read(cc->iobuffer[FDESC_STDIN], rf, cookie, fd); } void gfs_client_command_set_stdout(struct gfs_connection *gfs_server, int (*wf)(struct gfarm_iobuffer *, void *, int, void *, int), void (*wcf)(struct gfarm_iobuffer *, void *, int), void *cookie, int fd) { struct gfs_client_command_context *cc = gfs_server->context; gfarm_iobuffer_set_write(cc->iobuffer[FDESC_STDOUT], wf, cookie, fd); gfarm_iobuffer_set_write_close(cc->iobuffer[FDESC_STDOUT], wcf); } void gfs_client_command_set_stderr(struct gfs_connection *gfs_server, int (*wf)(struct gfarm_iobuffer *, void *, int, void *, int), void (*wcf)(struct gfarm_iobuffer *, void *, int), void *cookie, int fd) { struct gfs_client_command_context *cc = gfs_server->context; gfarm_iobuffer_set_write(cc->iobuffer[FDESC_STDERR], wf, cookie, fd); gfarm_iobuffer_set_write_close(cc->iobuffer[FDESC_STDERR], wcf); } gfarm_error_t gfs_client_command_request(struct gfs_connection *gfs_server, char *path, char **argv, char **envp, int flags, int *pidp) { struct gfs_client_command_context *cc; int na = argv == NULL ? 0 : gfarm_strarray_length(argv); int ne = envp == NULL ? 0 : gfarm_strarray_length(envp); int conn_fd = gfp_xdr_fd(gfs_server->conn); int i, xenv_copy, xauth_copy; gfarm_int32_t pid; socklen_t siz; gfarm_error_t e; static char *xdisplay_name_cache = NULL; static char *xdisplay_env_cache = NULL; static int xauth_cached = 0; static char *xauth_cache = NULL; char *dpy; if ((dpy = getenv("DISPLAY")) != NULL && xdisplay_name_cache == NULL && (flags & GFS_CLIENT_COMMAND_FLAG_X11MASK) != 0) { /* * get $DISPLAY to `xdisplay_name_cache', * and set "DISPLAY=$DISPLAY" to `xdisplay_env_cache'. */ static char xdisplay_env_format[] = "DISPLAY=%s"; static char local_prefix[] = "unix:"; char *prefix; if (*dpy == ':') { prefix = gfarm_host_get_self_name(); } else if (memcmp(dpy, local_prefix, sizeof(local_prefix) - 1) == 0) { prefix = gfarm_host_get_self_name(); dpy += sizeof(local_prefix) - 1 - 1; } else { prefix = ""; } GFARM_MALLOC_ARRAY(xdisplay_name_cache, strlen(prefix) + strlen(dpy) + 1); if (xdisplay_name_cache == NULL) { gflog_debug(GFARM_MSG_1001220, "allocation of array 'xdisplay_name_cache' " "failed: %s", gfarm_error_string(GFARM_ERR_NO_MEMORY)); return (GFARM_ERR_NO_MEMORY); } sprintf(xdisplay_name_cache, "%s%s", prefix, dpy); GFARM_MALLOC_ARRAY(xdisplay_env_cache, sizeof(xdisplay_env_format) + strlen(xdisplay_name_cache)); if (xdisplay_env_cache == NULL) { free(xdisplay_name_cache); xdisplay_name_cache = NULL; gflog_debug(GFARM_MSG_1001221, "allocation of array 'xdisplay_env_cache' " "failed : %s", gfarm_error_string(GFARM_ERR_NO_MEMORY)); return (GFARM_ERR_NO_MEMORY); } sprintf(xdisplay_env_cache, xdisplay_env_format, xdisplay_name_cache); } if ((flags & GFS_CLIENT_COMMAND_FLAG_X11MASK) == GFS_CLIENT_COMMAND_FLAG_XAUTHCOPY && xdisplay_name_cache != NULL && !xauth_cached) { /* * get xauth data to `xauth_cache' */ static char xauth_command_format[] = "%s nextract - %s 2>/dev/null"; char *xauth_command; FILE *fp; char *s, line[XAUTH_NEXTRACT_MAXLEN]; GFARM_MALLOC_ARRAY(xauth_command, sizeof(xauth_command_format) + strlen(XAUTH_COMMAND) + strlen(xdisplay_name_cache)); if (xauth_command == NULL) { gflog_debug(GFARM_MSG_1001222, "allocation of array 'xauth_command' " "failed : %s", gfarm_error_string(GFARM_ERR_NO_MEMORY)); return (GFARM_ERR_NO_MEMORY); } sprintf(xauth_command, xauth_command_format, XAUTH_COMMAND, xdisplay_name_cache); if ((fp = popen(xauth_command, "r")) == NULL) { free(xauth_command); gflog_debug(GFARM_MSG_1001223, "popen() for auth command pipe failed: %s", gfarm_error_string(GFARM_ERR_NO_MEMORY)); return (GFARM_ERR_NO_MEMORY); } s = fgets(line, sizeof line, fp); pclose(fp); free(xauth_command); if (s != NULL) { xauth_cache = strdup(line); if (xauth_cache == NULL) { free(xdisplay_name_cache); gflog_debug(GFARM_MSG_1001224, "allocation of 'xauth_cache' " "failed : %s", gfarm_error_string( GFARM_ERR_NO_MEMORY)); return (GFARM_ERR_NO_MEMORY); } } xauth_cached = 1; } xenv_copy = (flags & GFS_CLIENT_COMMAND_FLAG_X11MASK) != 0 && xdisplay_env_cache != NULL; xauth_copy = (flags & GFS_CLIENT_COMMAND_FLAG_X11MASK) == GFS_CLIENT_COMMAND_FLAG_XAUTHCOPY && xauth_cache != NULL; /* * don't pass * GFS_CLIENT_COMMAND_FLAG_STDIN_EOF and * GFS_CLIENT_COMMAND_FLAG_XENV_COPY flag via network */ e = gfs_client_rpc_request(gfs_server, GFS_PROTO_COMMAND, "siii", path, na, ne + (xenv_copy ? 1 : 0), ((flags & GFS_CLIENT_COMMAND_FLAG_SHELL_COMMAND) ? GFS_CLIENT_COMMAND_FLAG_SHELL_COMMAND : 0) | (xauth_copy ? GFS_CLIENT_COMMAND_FLAG_XAUTHCOPY : 0)); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001225, "gfs_request_client_rpc() failed: %s", gfarm_error_string(e)); return (e); } /* * argv */ for (i = 0; i < na; i++) { e = gfp_xdr_send(gfs_server->conn, "s", argv[i]); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001226, "sending argv[%d] (%s) failed: %s", i, argv[i], gfarm_error_string(e)); return (e); } } /* * envp */ for (i = 0; i < ne; i++) { e = gfp_xdr_send(gfs_server->conn, "s", envp[i]); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001227, "sending envp[%d] (%s) failed: %s", i, envp[i], gfarm_error_string(e)); return (e); } } if (xenv_copy) { e = gfp_xdr_send(gfs_server->conn, "s", xdisplay_env_cache); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001228, "sending xdisplay_env_cache failed: %s", gfarm_error_string(e)); return (e); } } if (xauth_copy) { /* * xauth */ e = gfp_xdr_send(gfs_server->conn, "s", xauth_cache); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001229, "sending xauth_cache failed: %s", gfarm_error_string(e)); return (e); } } /* we have to set `just' flag here */ e = gfs_client_rpc_result(gfs_server, 1, "i", &pid); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001230, "gfs_client_rpc_result() failed: %s", gfarm_error_string(e)); return (e); } gfs_server->context = GFARM_MALLOC(cc); if (gfs_server->context == NULL) { gflog_debug(GFARM_MSG_1001231, "allocation of 'gfs_server->context' failed: %s", gfarm_error_string(GFARM_ERR_NO_MEMORY)); return (GFARM_ERR_NO_MEMORY); } /* * Now, we set the connection file descriptor non-blocking mode. */ if (fcntl(conn_fd, F_SETFL, O_NONBLOCK) == -1) { int save_errno = errno; free(gfs_server->context); gfs_server->context = NULL; gflog_debug(GFARM_MSG_1001232, "setting conn_fd to non-blocking mode failed: %s", strerror(save_errno)); return (gfarm_errno_to_error(save_errno)); } /* * initialize gfs_server->context by default values */ siz = sizeof(i); if (getsockopt(conn_fd, SOL_SOCKET, SO_SNDBUF, &i, &siz)) i = GFARM_DEFAULT_COMMAND_IOBUF_SIZE; cc->iobuffer[FDESC_STDIN] = gfarm_iobuffer_alloc(i); siz = sizeof(i); if (getsockopt(conn_fd, SOL_SOCKET, SO_RCVBUF, &i, &siz)) i = GFARM_DEFAULT_COMMAND_IOBUF_SIZE; cc->iobuffer[FDESC_STDOUT] = gfarm_iobuffer_alloc(i); cc->iobuffer[FDESC_STDERR] = gfarm_iobuffer_alloc(i); gfarm_iobuffer_set_nonblocking_read_fd( cc->iobuffer[FDESC_STDIN], FDESC_STDIN); gfarm_iobuffer_set_nonblocking_write_xxx( cc->iobuffer[FDESC_STDIN], gfs_server->conn); gfarm_iobuffer_set_nonblocking_read_xxx( cc->iobuffer[FDESC_STDOUT], gfs_server->conn); gfarm_iobuffer_set_nonblocking_write_fd( cc->iobuffer[FDESC_STDOUT], FDESC_STDOUT); gfarm_iobuffer_set_nonblocking_read_xxx( cc->iobuffer[FDESC_STDERR], gfs_server->conn); gfarm_iobuffer_set_nonblocking_write_fd( cc->iobuffer[FDESC_STDERR], FDESC_STDERR); if ((flags & GFS_CLIENT_COMMAND_FLAG_STDIN_EOF) != 0) gfarm_iobuffer_set_read_eof(cc->iobuffer[FDESC_STDIN]); cc->server_state = GFS_COMMAND_SERVER_STATE_NEUTRAL; cc->client_state = GFS_COMMAND_CLIENT_STATE_NEUTRAL; cc->pending_signal = 0; *pidp = cc->pid = pid; return (e); } int gfs_client_command_is_running(struct gfs_connection *gfs_server) { struct gfs_client_command_context *cc = gfs_server->context; return (cc->server_state != GFS_COMMAND_SERVER_STATE_EXITED && cc->server_state != GFS_COMMAND_SERVER_STATE_ABORTED); } gfarm_error_t gfs_client_command_fd_set(struct gfs_connection *gfs_server, fd_set *readable, fd_set *writable, int *max_fdp) { struct gfs_client_command_context *cc = gfs_server->context; int conn_fd = gfp_xdr_fd(gfs_server->conn); int i, fd; /* * The following test condition should just match with * the i/o condition in gfs_client_command_io_fd_set(), * otherwise unneeded busy wait happens. */ if (cc->server_state == GFS_COMMAND_SERVER_STATE_NEUTRAL || (cc->server_state == GFS_COMMAND_SERVER_STATE_OUTPUT && gfarm_iobuffer_is_readable(cc->iobuffer[cc->server_output_fd]))) { FD_SET(conn_fd, readable); if (*max_fdp < conn_fd) *max_fdp = conn_fd; } if ((cc->client_state == GFS_COMMAND_CLIENT_STATE_NEUTRAL && (cc->pending_signal || gfarm_iobuffer_is_writable(cc->iobuffer[FDESC_STDIN]))) || cc->client_state == GFS_COMMAND_CLIENT_STATE_OUTPUT) { FD_SET(conn_fd, writable); if (*max_fdp < conn_fd) *max_fdp = conn_fd; } if (gfarm_iobuffer_is_readable(cc->iobuffer[FDESC_STDIN])) { fd = gfarm_iobuffer_get_read_fd(cc->iobuffer[FDESC_STDIN]); if (fd < 0) { gfarm_iobuffer_read(cc->iobuffer[FDESC_STDIN], NULL); /* XXX - if the callback sets an error? */ } else { FD_SET(fd, readable); if (*max_fdp < fd) *max_fdp = fd; } } for (i = FDESC_STDOUT; i <= FDESC_STDERR; i++) { if (gfarm_iobuffer_is_writable(cc->iobuffer[i])) { fd = gfarm_iobuffer_get_write_fd(cc->iobuffer[i]); if (fd < 0) { gfarm_iobuffer_write(cc->iobuffer[i], NULL); /* XXX - if the callback sets an error? */ } else { FD_SET(fd, writable); if (*max_fdp < fd) *max_fdp = fd; } } } return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfs_client_command_io_fd_set(struct gfs_connection *gfs_server, fd_set *readable, fd_set *writable) { gfarm_error_t e; struct gfs_client_command_context *cc = gfs_server->context; int i, fd, conn_fd = gfp_xdr_fd(gfs_server->conn); fd = gfarm_iobuffer_get_read_fd(cc->iobuffer[FDESC_STDIN]); if (fd >= 0 && FD_ISSET(fd, readable)) { gfarm_iobuffer_read(cc->iobuffer[FDESC_STDIN], NULL); e = gfarm_iobuffer_get_error(cc->iobuffer[FDESC_STDIN]); if (e != GFARM_ERR_NO_ERROR) { /* treat this as eof */ gfarm_iobuffer_set_read_eof(cc->iobuffer[FDESC_STDIN]); /* XXX - how to report this error? */ gfarm_iobuffer_set_error(cc->iobuffer[FDESC_STDIN], GFARM_ERR_NO_ERROR); } } for (i = FDESC_STDOUT; i <= FDESC_STDERR; i++) { fd = gfarm_iobuffer_get_write_fd(cc->iobuffer[i]); if (fd < 0 || !FD_ISSET(fd, writable)) continue; gfarm_iobuffer_write(cc->iobuffer[i], NULL); e = gfarm_iobuffer_get_error(cc->iobuffer[i]); if (e == GFARM_ERR_NO_ERROR) continue; /* XXX - just purge the content */ gfarm_iobuffer_purge(cc->iobuffer[i], NULL); /* XXX - how to report this error? */ gfarm_iobuffer_set_error(cc->iobuffer[i], GFARM_ERR_NO_ERROR); } if (FD_ISSET(conn_fd, readable)) { if (cc->server_state == GFS_COMMAND_SERVER_STATE_NEUTRAL) { gfarm_int32_t cmd, fd, len; int eof; gfarm_error_t e; e = gfp_xdr_recv(gfs_server->conn, 1, &eof, "i", &cmd); if (e != GFARM_ERR_NO_ERROR || eof) { if (e == GFARM_ERR_NO_ERROR) e = GFARM_ERRMSG_GFSD_ABORTED; cc->server_state = GFS_COMMAND_SERVER_STATE_ABORTED; gflog_debug(GFARM_MSG_1001233, "gfp_xdr_recv() failed: %s", gfarm_error_string(e)); return (e); } switch (cmd) { case GFS_PROTO_COMMAND_EXITED: cc->server_state = GFS_COMMAND_SERVER_STATE_EXITED; break; case GFS_PROTO_COMMAND_FD_OUTPUT: e = gfp_xdr_recv(gfs_server->conn, 1, &eof, "ii", &fd, &len); if (e != GFARM_ERR_NO_ERROR || eof) { if (e == GFARM_ERR_NO_ERROR) e = GFARM_ERRMSG_GFSD_ABORTED; cc->server_state = GFS_COMMAND_SERVER_STATE_ABORTED; gflog_debug(GFARM_MSG_1001234, "gfp_xdr_recv() failed: " "%s", gfarm_error_string(e)); return (e); } if (fd != FDESC_STDOUT && fd != FDESC_STDERR) { /* XXX - something wrong */ cc->server_state = GFS_COMMAND_SERVER_STATE_ABORTED; gflog_debug(GFARM_MSG_1001235, "Illegal file descriptor"); return (GFARM_ERRMSG_GFSD_DESCRIPTOR_ILLEGAL); } if (len <= 0) { /* notify closed */ gfarm_iobuffer_set_read_eof( cc->iobuffer[fd]); } else { cc->server_state = GFS_COMMAND_SERVER_STATE_OUTPUT; cc->server_output_fd = fd; cc->server_output_residual = len; } break; default: /* XXX - something wrong */ cc->server_state = GFS_COMMAND_SERVER_STATE_ABORTED; gflog_debug(GFARM_MSG_1001236, "Unknown reply %d", cmd); return (GFARM_ERRMSG_GFSD_REPLY_UNKNOWN); } } else if (cc->server_state==GFS_COMMAND_SERVER_STATE_OUTPUT) { gfarm_iobuffer_read(cc->iobuffer[cc->server_output_fd], &cc->server_output_residual); if (cc->server_output_residual == 0) cc->server_state = GFS_COMMAND_SERVER_STATE_NEUTRAL; e = gfarm_iobuffer_get_error( cc->iobuffer[cc->server_output_fd]); if (e != GFARM_ERR_NO_ERROR) { /* treat this as eof */ gfarm_iobuffer_set_read_eof( cc->iobuffer[cc->server_output_fd]); gfarm_iobuffer_set_error( cc->iobuffer[cc->server_output_fd], GFARM_ERR_NO_ERROR); cc->server_state = GFS_COMMAND_SERVER_STATE_ABORTED; gflog_debug(GFARM_MSG_1001237, "read operation on iobuffer failed: %s", gfarm_error_string(e)); return (e); } if (gfarm_iobuffer_is_read_eof( cc->iobuffer[cc->server_output_fd])) { cc->server_state = GFS_COMMAND_SERVER_STATE_ABORTED; gflog_debug(GFARM_MSG_1001238, "read operation on iobuffer aborted"); return (GFARM_ERRMSG_GFSD_ABORTED); } } } if (FD_ISSET(conn_fd, writable) && gfs_client_command_is_running(gfs_server)) { if (cc->client_state == GFS_COMMAND_CLIENT_STATE_NEUTRAL) { if (cc->pending_signal) { e = gfp_xdr_send(gfs_server->conn, "ii", GFS_PROTO_COMMAND_SEND_SIGNAL, cc->pending_signal); if (e != GFARM_ERR_NO_ERROR || (e = gfp_xdr_flush(gfs_server->conn)) != GFARM_ERR_NO_ERROR) { cc->server_state = GFS_COMMAND_SERVER_STATE_ABORTED; gflog_debug(GFARM_MSG_1001239, "sending signal failed: %s", gfarm_error_string(e)); return (e); } } else if (gfarm_iobuffer_is_writable( cc->iobuffer[FDESC_STDIN])) { /* * cc->client_output_residual may be 0, * if stdin reaches EOF. */ cc->client_output_residual = gfarm_iobuffer_avail_length( cc->iobuffer[FDESC_STDIN]); e = gfp_xdr_send(gfs_server->conn, "iii", GFS_PROTO_COMMAND_FD_INPUT, FDESC_STDIN, cc->client_output_residual); if (e != GFARM_ERR_NO_ERROR || (e = gfp_xdr_flush(gfs_server->conn)) != GFARM_ERR_NO_ERROR) { cc->server_state = GFS_COMMAND_SERVER_STATE_ABORTED; gflog_debug(GFARM_MSG_1001240, "sending fd falied: %s", gfarm_error_string(e)); return (e); } cc->client_state = GFS_COMMAND_CLIENT_STATE_OUTPUT; } } else if (cc->client_state==GFS_COMMAND_CLIENT_STATE_OUTPUT) { gfarm_iobuffer_write(cc->iobuffer[FDESC_STDIN], &cc->client_output_residual); if (cc->client_output_residual == 0) cc->client_state = GFS_COMMAND_CLIENT_STATE_NEUTRAL; e = gfarm_iobuffer_get_error( cc->iobuffer[FDESC_STDIN]); if (e != GFARM_ERR_NO_ERROR) { cc->server_state = GFS_COMMAND_SERVER_STATE_ABORTED; gfarm_iobuffer_set_error( cc->iobuffer[FDESC_STDIN], GFARM_ERR_NO_ERROR); gflog_debug(GFARM_MSG_1001241, "write operation on iobuffer " "failed: %s", gfarm_error_string(e)); return (e); } } } return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfs_client_command_io(struct gfs_connection *gfs_server, struct timeval *timeout) { int nfound, max_fd; fd_set readable, writable; gfarm_error_t e = GFARM_ERR_NO_ERROR; if (!gfs_client_command_is_running(gfs_server)) return (GFARM_ERR_NO_ERROR); max_fd = -1; FD_ZERO(&readable); FD_ZERO(&writable); gfs_client_command_fd_set(gfs_server, &readable, &writable, &max_fd); if (max_fd >= 0) { nfound = select(max_fd + 1, &readable, &writable, NULL, timeout); if (nfound > 0) { e = gfs_client_command_io_fd_set(gfs_server, &readable, &writable); } else if (nfound == -1 && errno != EINTR) { e = gfarm_errno_to_error(errno); } } return (e); } int gfs_client_command_send_stdin(struct gfs_connection *gfs_server, void *data, int len) { struct gfs_client_command_context *cc = gfs_server->context; char *p = data; int residual = len, rv; while (residual > 0 && gfs_client_command_is_running(gfs_server)) { rv = gfarm_iobuffer_put(cc->iobuffer[FDESC_STDIN], p, residual); p += rv; residual -= rv; gfs_client_command_io(gfs_server, NULL); /* XXX - how to report this error? */ } return (len - residual); } void gfs_client_command_close_stdin(struct gfs_connection *gfs_server) { struct gfs_client_command_context *cc = gfs_server->context; gfarm_iobuffer_set_read_eof(cc->iobuffer[FDESC_STDIN]); } gfarm_error_t gfs_client_command_send_signal(struct gfs_connection *gfs_server, int sig) { gfarm_error_t e; struct gfs_client_command_context *cc = gfs_server->context; while (gfs_client_command_is_running(gfs_server) && cc->pending_signal != 0) { e = gfs_client_command_io(gfs_server, NULL); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001242, "gfs_client_command_io() failed: %s", gfarm_error_string(e)); return (e); } } if (!gfs_client_command_is_running(gfs_server)) return (gfarm_errno_to_error(ESRCH)); cc->pending_signal = sig; /* make a chance to send the signal immediately */ return (gfs_client_command_io(gfs_server, NULL)); } gfarm_error_t gfs_client_command_result(struct gfs_connection *gfs_server, int *term_signal, int *exit_status, int *exit_flag) { struct gfs_client_command_context *cc = gfs_server->context; gfarm_error_t e; while (gfs_client_command_is_running(gfs_server)) { gfs_client_command_io(gfs_server, NULL); /* XXX - how to report this error? */ } /* * flush stdout/stderr */ while (gfarm_iobuffer_is_writable(cc->iobuffer[FDESC_STDOUT]) || gfarm_iobuffer_is_writable(cc->iobuffer[FDESC_STDERR])) { int i, nfound, fd, max_fd = -1; fd_set writable; FD_ZERO(&writable); for (i = FDESC_STDOUT; i <= FDESC_STDERR; i++) { if (gfarm_iobuffer_is_writable(cc->iobuffer[i])) { fd = gfarm_iobuffer_get_write_fd( cc->iobuffer[i]); if (fd < 0) { gfarm_iobuffer_write(cc->iobuffer[i], NULL); /* * XXX - if the callback sets an error? */ } else { FD_SET(fd, &writable); if (max_fd < fd) max_fd = fd; } } } if (max_fd < 0) continue; nfound = select(max_fd + 1, NULL, &writable, NULL, NULL); if (nfound == -1 && errno != EINTR) break; if (nfound > 0) { for (i = FDESC_STDOUT; i <= FDESC_STDERR; i++) { fd = gfarm_iobuffer_get_write_fd( cc->iobuffer[i]); if (fd < 0 || !FD_ISSET(fd, &writable)) continue; gfarm_iobuffer_write(cc->iobuffer[i], NULL); e = gfarm_iobuffer_get_error(cc->iobuffer[i]); if (e == GFARM_ERR_NO_ERROR) continue; /* XXX - just purge the content */ gfarm_iobuffer_purge(cc->iobuffer[i], NULL); /* XXX - how to report this error? */ gfarm_iobuffer_set_error(cc->iobuffer[i], GFARM_ERR_NO_ERROR); } } } /* * context isn't needed anymore */ gfarm_iobuffer_free(cc->iobuffer[FDESC_STDIN]); gfarm_iobuffer_free(cc->iobuffer[FDESC_STDOUT]); gfarm_iobuffer_free(cc->iobuffer[FDESC_STDERR]); free(gfs_server->context); gfs_server->context = NULL; /* * Now, we recover the connection file descriptor blocking mode. */ if (fcntl(gfp_xdr_fd(gfs_server->conn), F_SETFL, 0) == -1) { int save_errno = errno; gflog_debug(GFARM_MSG_1001243, "setting conn fd to blocking mode failed: %s", strerror(save_errno)); return (gfarm_errno_to_error(save_errno)); } return (gfs_client_rpc(gfs_server, 0, GFS_PROTO_COMMAND_EXIT_STATUS, "/iii", term_signal, exit_status, exit_flag)); } gfarm_error_t gfs_client_command(struct gfs_connection *gfs_server, char *path, char **argv, char **envp, int flags, int *term_signal, int *exit_status, int *exit_flag) { gfarm_error_t e, e2; int pid; e = gfs_client_command_request(gfs_server, path, argv, envp, flags, &pid); if (e) { gflog_debug(GFARM_MSG_1001244, "gfs_client_command_request() failed: %s", gfarm_error_string(e)); return (e); } while (gfs_client_command_is_running(gfs_server)) e = gfs_client_command_io(gfs_server, NULL); e2 = gfs_client_command_result(gfs_server, term_signal, exit_status, exit_flag); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001245, "gfs_client_command_io() failed: %s", gfarm_error_string(e)); } else if (e2 != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001246, "gfs_client_command_result() failed: %s", gfarm_error_string(e2)); } return (e != GFARM_ERR_NO_ERROR ? e : e2); } /* ********************************************************************** * gfsd datagram service ********************************************************************** */ int gfs_client_datagram_timeouts[] = { /* milli seconds */ 8000, 12000 }; int gfs_client_datagram_ntimeouts = GFARM_ARRAY_LENGTH(gfs_client_datagram_timeouts); /* * `server_addr_size' should be socklen_t, but that requires * for all source files which include "gfs_client.h". */ gfarm_error_t gfs_client_get_load_request(int sock, struct sockaddr *server_addr, int server_addr_size) { int rv, command = 0; if (server_addr == NULL || server_addr_size == 0) { /* using connected UDP socket */ rv = write(sock, &command, sizeof(command)); } else { rv = sendto(sock, &command, sizeof(command), 0, server_addr, server_addr_size); } if (rv == -1) { int save_errno = errno; gflog_debug(GFARM_MSG_1001247, "write or send operation on socket failed: %s", strerror(save_errno)); return (gfarm_errno_to_error(save_errno)); } return (GFARM_ERR_NO_ERROR); } /* * `*server_addr_sizep' is an IN/OUT parameter. * * `*server_addr_sizep' should be socklen_t, but that requires * for all source files which include "gfs_client.h". */ gfarm_error_t gfs_client_get_load_result(int sock, struct sockaddr *server_addr, socklen_t *server_addr_sizep, struct gfs_client_load *result) { int rv; double loadavg[3]; #ifndef WORDS_BIGENDIAN struct { char c[8]; } nloadavg[3]; #else # define nloadavg loadavg #endif if (server_addr == NULL || server_addr_sizep == NULL) { /* caller doesn't need server_addr */ rv = read(sock, nloadavg, sizeof(nloadavg)); } else { rv = recvfrom(sock, nloadavg, sizeof(nloadavg), 0, server_addr, server_addr_sizep); } if (rv == -1) { int save_errno = errno; gflog_debug(GFARM_MSG_1001248, "read or receive operation from socket failed: %s", strerror(save_errno)); return (gfarm_errno_to_error(save_errno)); } #ifndef WORDS_BIGENDIAN swab(&nloadavg[0], &loadavg[0], sizeof(loadavg[0])); swab(&nloadavg[1], &loadavg[1], sizeof(loadavg[1])); swab(&nloadavg[2], &loadavg[2], sizeof(loadavg[2])); #endif result->loadavg_1min = loadavg[0]; result->loadavg_5min = loadavg[1]; result->loadavg_15min = loadavg[2]; return (GFARM_ERR_NO_ERROR); } /* * multiplexed version of gfs_client_get_load() */ struct gfs_client_get_load_state { struct gfarm_eventqueue *q; struct gfarm_event *writable, *readable; void (*continuation)(void *); void *closure; int sock; int try; /* results */ gfarm_error_t error; struct gfs_client_load load; }; static void gfs_client_get_load_send(int events, int fd, void *closure, const struct timeval *t) { struct gfs_client_get_load_state *state = closure; int rv; struct timeval timeout; state->error = gfs_client_get_load_request(state->sock, NULL, 0); if (state->error == GFARM_ERR_NO_ERROR) { timeout.tv_sec = timeout.tv_usec = 0; gfarm_timeval_add_microsec(&timeout, gfs_client_datagram_timeouts[state->try] * GFARM_MILLISEC_BY_MICROSEC); if ((rv = gfarm_eventqueue_add_event(state->q, state->readable, &timeout)) == 0) { /* go to gfs_client_get_load_receive() */ return; } state->error = gfarm_errno_to_error(rv); } close(state->sock); state->sock = -1; if (state->continuation != NULL) (*state->continuation)(state->closure); } static void gfs_client_get_load_receive(int events, int fd, void *closure, const struct timeval *t) { struct gfs_client_get_load_state *state = closure; int rv; if ((events & GFARM_EVENT_TIMEOUT) != 0) { assert(events == GFARM_EVENT_TIMEOUT); ++state->try; if (state->try >= gfs_client_datagram_ntimeouts) { state->error = GFARM_ERR_OPERATION_TIMED_OUT; } else if ((rv = gfarm_eventqueue_add_event(state->q, state->writable, NULL)) == 0) { /* go to gfs_client_get_load_send() */ return; } else { state->error = gfarm_errno_to_error(rv); } } else { assert(events == GFARM_EVENT_READ); state->error = gfs_client_get_load_result(state->sock, NULL, NULL, &state->load); } close(state->sock); state->sock = -1; if (state->continuation != NULL) (*state->continuation)(state->closure); } gfarm_error_t gfs_client_get_load_request_multiplexed(struct gfarm_eventqueue *q, struct sockaddr *peer_addr, void (*continuation)(void *), void *closure, struct gfs_client_get_load_state **statepp) { gfarm_error_t e; int rv, sock; struct gfs_client_get_load_state *state; /* use different socket for each peer, to identify error code */ sock = socket(PF_INET, SOCK_DGRAM, 0); if (sock == -1) { e = gfarm_errno_to_error(errno); goto error_return; } fcntl(sock, F_SETFD, 1); /* automatically close() on exec(2) */ /* connect UDP socket, to get error code */ if (connect(sock, peer_addr, sizeof(*peer_addr)) == -1) { e = gfarm_errno_to_error(errno); goto error_close_sock; } GFARM_MALLOC(state); if (state == NULL) { e = GFARM_ERR_NO_MEMORY; gflog_debug(GFARM_MSG_1001249, "allocation of client get load state failed: %s", gfarm_error_string(e)); goto error_close_sock; } state->writable = gfarm_fd_event_alloc( GFARM_EVENT_WRITE, sock, gfs_client_get_load_send, state); if (state->writable == NULL) { e = GFARM_ERR_NO_MEMORY; gflog_debug(GFARM_MSG_1001250, "allocation of client get load state->writable " "failed: %s", gfarm_error_string(e)); goto error_free_state; } /* * We cannot use two independent events (i.e. a fd_event with * GFARM_EVENT_READ flag and a timer_event) here, because * it's possible that both event handlers are called at once. */ state->readable = gfarm_fd_event_alloc( GFARM_EVENT_READ|GFARM_EVENT_TIMEOUT, sock, gfs_client_get_load_receive, state); if (state->readable == NULL) { e = GFARM_ERR_NO_MEMORY; gflog_debug(GFARM_MSG_1001251, "allocation of client get load state->readable " "failed: %s", gfarm_error_string(e)); goto error_free_writable; } /* go to gfs_client_get_load_send() */ rv = gfarm_eventqueue_add_event(q, state->writable, NULL); if (rv != 0) { e = gfarm_errno_to_error(rv); gflog_debug(GFARM_MSG_1001252, "adding event to event queue failed: %s", gfarm_error_string(e)); goto error_free_readable; } state->q = q; state->continuation = continuation; state->closure = closure; state->sock = sock; state->try = 0; state->error = GFARM_ERR_NO_ERROR; *statepp = state; return (GFARM_ERR_NO_ERROR); error_free_readable: gfarm_event_free(state->readable); error_free_writable: gfarm_event_free(state->writable); error_free_state: free(state); error_close_sock: close(sock); error_return: return (e); } gfarm_error_t gfs_client_get_load_result_multiplexed( struct gfs_client_get_load_state *state, struct gfs_client_load *loadp) { gfarm_error_t error = state->error; if (state->sock >= 0) { /* sanity */ close(state->sock); state->sock = -1; } if (error == GFARM_ERR_NO_ERROR) *loadp = state->load; gfarm_event_free(state->readable); gfarm_event_free(state->writable); free(state); return (error); } #if 0 /* * gfs_client_apply_all_hosts() */ static int apply_one_host(char *(*op)(struct gfs_connection *, void *), char *hostname, void *args, char *message, int tolerant) { char *e; int pid; struct sockaddr addr; struct gfs_connection *conn; pid = fork(); if (pid) { /* parent or error */ return pid; } /* child */ /* reflect "address_use" directive in the `hostname' */ e = gfarm_host_address_get(hostname, gfarm_spool_server_port, &addr, NULL); if (e != NULL) { if (message != NULL) fprintf(stderr, "%s: host %s: %s\n", message, hostname, e); _exit(2); } e = gfs_client_connect(hostname, &addr, &conn); if (e != NULL) { /* if tolerant, we allow failure to connect the host */ if (message != NULL && !tolerant) fprintf(stderr, "%s: connecting to %s: %s\n", message, hostname, e); _exit(tolerant ? 0 : 3); } e = (*op)(conn, args); if (e != NULL) { /* if tolerant, we allow "no such file or directory" */ if (message != NULL && (!tolerant || e != GFARM_ERR_NO_SUCH_OBJECT)) fprintf(stderr, "%s on %s: %s\n", message, hostname, e); _exit(tolerant && e == GFARM_ERR_NO_SUCH_OBJECT ? 0 : 4); } e = gfs_client_disconnect(conn); if (e != NULL) { if (message != NULL) fprintf(stderr, "%s: disconnecting to %s: %s\n", message, hostname, e); _exit(5); } _exit(0); } static char * wait_pid(int pids[], int num, int *nhosts_succeed) { char *e; int rv, s; e = NULL; while (--num >= 0) { while ((rv = waitpid(pids[num], &s, 0)) == -1 && errno == EINTR) ; if (rv == -1) { if (e == NULL) e = gfarm_errno_to_error(errno); } else if (WIFEXITED(s)) { if (WEXITSTATUS(s) == 0) (*nhosts_succeed)++; else e = "error happened on the operation"; } else { e = "operation aborted abnormally"; } } return (e); } #define CONCURRENCY 25 static int gfarm_fd_receive_message(int fd, void *buf, size_t size, int fdc, int *fdv) { char *buffer = buf; int i, rv; struct iovec iov[1]; struct msghdr msg; #ifdef HAVE_MSG_CONTROL /* 4.3BSD Reno or later */ struct { struct cmsghdr hdr; char data[CMSG_SPACE(sizeof(*fdv) * GFSD_MAX_PASSING_FD) - sizeof(struct cmsghdr)]; } cmsg; if (fdc > GFSD_MAX_PASSING_FD) { #if 0 fprintf(stderr, "gfarm_fd_receive_message(%s): " "fd count %d > %d\n", fdc, GFSD_MAX_PASSING_FD); #endif return (EINVAL); } #endif while (size > 0) { iov[0].iov_base = buffer; iov[0].iov_len = size; msg.msg_iov = iov; msg.msg_iovlen = 1; msg.msg_name = NULL; msg.msg_namelen = 0; #ifndef HAVE_MSG_CONTROL if (fdc > 0) { msg.msg_accrights = (caddr_t)fdv; msg.msg_accrightslen = sizeof(*fdv) * fdc; for (i = 0; i < fdc; i++) fdv[i] = -1; } else { msg.msg_accrights = NULL; msg.msg_accrightslen = 0; } #else /* 4.3BSD Reno or later */ if (fdc > 0) { msg.msg_control = (caddr_t)&cmsg.hdr; msg.msg_controllen = CMSG_SPACE(sizeof(*fdv) * fdc); memset(msg.msg_control, 0, msg.msg_controllen); for (i = 0; i < fdc; i++) ((int *)CMSG_DATA(&cmsg.hdr))[i] = -1; } else { msg.msg_control = NULL; msg.msg_controllen = 0; } #endif rv = recvmsg(fd, &msg, 0); if (rv == -1) { if (errno == EINTR) continue; return (errno); /* failure */ } else if (rv == 0) { return (-1); /* EOF */ } #ifdef HAVE_MSG_CONTROL /* 4.3BSD Reno or later */ if (fdc > 0) { if (msg.msg_controllen != CMSG_SPACE(sizeof(*fdv) * fdc) || cmsg.hdr.cmsg_len != CMSG_LEN(sizeof(*fdv) * fdc) || cmsg.hdr.cmsg_level != SOL_SOCKET || cmsg.hdr.cmsg_type != SCM_RIGHTS) { #if 0 fprintf(stderr, "gfarm_fd_receive_message():" " descriptor not passed" " msg_controllen: %d (%d)," " cmsg_len: %d (%d)," " cmsg_level: %d," " cmsg_type: %d\n", msg.msg_controllen, CMSG_SPACE(sizeof(*fdv) * fdc), cmsg.hdr.cmsg_len, CMSG_LEN(sizeof(*fdv) * fdc), cmsg.hdr.cmsg_level, cmsg.hdr.cmsg_type); #endif } for (i = 0; i < fdc; i++) fdv[i] = ((int *)CMSG_DATA(&cmsg.hdr))[i]; } #endif fdc = 0; fdv = NULL; buffer += rv; size -= rv; } return (0); /* success */ } gfarm_error_t gfs_client_apply_all_hosts( char *(*op)(struct gfs_connection *, void *), void *args, char *message, int tolerant, int *nhosts_succeed) { char *e; int i, j, nhosts, pids[CONCURRENCY]; struct gfarm_host_info *hosts; e = gfarm_host_info_get_all(&nhosts, &hosts); if (e != NULL) { gflog_debug(GFARM_MSG_1001253, "gfarm_host_info_get_all() failed: %s", gfarm_error_string(e)); return (e); } j = 0; *nhosts_succeed = 0; for (i = 0; i < nhosts; i++) { pids[j] = apply_one_host(op, hosts[i].hostname, args, message, tolerant); if (pids[j] < 0) /* fork error */ break; if (++j == CONCURRENCY) { e = wait_pid(pids, j, nhosts_succeed); j = 0; } } if (j > 0) e = wait_pid(pids, j, nhosts_succeed); gfarm_host_info_free_all(nhosts, hosts); return (e); } #endif gfarm-2.4.1/lib/libgfarm/gfarm/gfs_dircache.c0000644000000000000000000004252311507222723017511 0ustar rootroot#include #include #include #include #include #include #include "gfutil.h" #include "hash.h" #include "config.h" #include "gfs_dir.h" #include "gfs_dirplusxattr.h" #include "gfs_dircache.h" #include "gfs_attrplus.h" /* #define DIRCACHE_DEBUG */ /* * gfs_stat_cache */ #define STAT_HASH_SIZE 3079 /* prime number */ static struct gfarm_hash_table *stat_cache; struct stat_cache_data { struct stat_cache_data *next, *prev; /* doubly linked circular list */ struct gfarm_hash_entry *entry; struct timeval expiration; struct gfs_stat st; int nattrs; char **attrnames; void **attrvalues; size_t *attrsizes; }; /* doubly linked circular list head */ static struct stat_cache_data stat_cache_list_head = { &stat_cache_list_head, &stat_cache_list_head }; static int stat_cache_count; static struct timeval stat_cache_lifespan; static int stat_cache_lifespan_is_set; gfarm_error_t gfs_stat_cache_init(void) { if (!stat_cache_lifespan_is_set) { /* always reflect gfarm_attr_cache_timeout */ stat_cache_lifespan.tv_sec = gfarm_attr_cache_timeout / (GFARM_SECOND_BY_MICROSEC / GFARM_MILLISEC_BY_MICROSEC); stat_cache_lifespan.tv_usec = (gfarm_attr_cache_timeout - stat_cache_lifespan.tv_sec * (GFARM_SECOND_BY_MICROSEC / GFARM_MILLISEC_BY_MICROSEC)) * GFARM_MILLISEC_BY_MICROSEC; } if (stat_cache != NULL) /* already initialized */ return (GFARM_ERR_NO_ERROR); stat_cache = gfarm_hash_table_alloc( STAT_HASH_SIZE, gfarm_hash_default, gfarm_hash_key_equal_default); if (stat_cache == NULL) { gflog_debug(GFARM_MSG_1001282, "allocation of stat_cache failed: %s", gfarm_error_string(GFARM_ERR_NO_MEMORY)); return (GFARM_ERR_NO_MEMORY); } return (GFARM_ERR_NO_ERROR); } static void gfarm_anyptrs_free_deeply(int n, void **values) { int i; for (i = 0; i < n; i++) { free(values[i]); } free(values); } static void gfs_stat_cache_data_free(struct stat_cache_data *p) { gfs_stat_free(&p->st); gfarm_strings_free_deeply(p->nattrs, p->attrnames); gfarm_anyptrs_free_deeply(p->nattrs, p->attrvalues); free(p->attrsizes); } void gfs_stat_cache_clear(void) { struct stat_cache_data *p, *q; struct gfarm_hash_entry *entry; for (p = stat_cache_list_head.next; p != &stat_cache_list_head; p = q) { q = p->next; gfs_stat_cache_data_free(p); entry = p->entry; gfarm_hash_purge(stat_cache, gfarm_hash_entry_key(entry), gfarm_hash_entry_key_length(entry)); } stat_cache_list_head.next = stat_cache_list_head.prev = &stat_cache_list_head; stat_cache_count = 0; } static void gfs_stat_cache_expire_internal(const struct timeval *nowp) { struct stat_cache_data *p, *q; struct gfarm_hash_entry *entry; for (p = stat_cache_list_head.next; p != &stat_cache_list_head; p = q) { /* assumes monotonic time */ if (gfarm_timeval_cmp(&p->expiration, nowp) > 0) break; q = p->next; gfs_stat_cache_data_free(p); entry = p->entry; gfarm_hash_purge(stat_cache, gfarm_hash_entry_key(entry), gfarm_hash_entry_key_length(entry)); --stat_cache_count; } stat_cache_list_head.next = p; p->prev = &stat_cache_list_head; } void gfs_stat_cache_expire(void) { struct timeval now; gettimeofday(&now, NULL); gfs_stat_cache_expire_internal(&now); } void gfs_stat_cache_expiration_set(long lifespan_millsecond) { struct timeval old_lifespan = stat_cache_lifespan; struct stat_cache_data *p; stat_cache_lifespan_is_set = 1; stat_cache_lifespan.tv_sec = lifespan_millsecond / 1000; stat_cache_lifespan.tv_usec = (lifespan_millsecond - stat_cache_lifespan.tv_sec * 1000) * 1000; for (p = stat_cache_list_head.next; p != &stat_cache_list_head; p = p->next) { gfarm_timeval_sub(&p->expiration, &old_lifespan); gfarm_timeval_add(&p->expiration, &stat_cache_lifespan); } } static gfarm_error_t attrnames_copy(int nattrs, char ***attrnamesp, char **attrnames) { gfarm_error_t e; char **attrs; GFARM_MALLOC_ARRAY(attrs, nattrs); if (attrs == NULL) return (GFARM_ERR_NO_MEMORY); e = gfarm_fixedstrings_dup(nattrs, attrs, attrnames); if (e != GFARM_ERR_NO_ERROR) return (e); *attrnamesp = attrs; return (GFARM_ERR_NO_ERROR); } static gfarm_error_t attrvalues_copy(int nattrs, void ***attrvaluesp, size_t **attrsizesp, void **attrvalues, size_t *attrsizes) { void **values; size_t *sizes; int i; GFARM_MALLOC_ARRAY(values, nattrs); GFARM_MALLOC_ARRAY(sizes, nattrs); if (values == NULL || sizes == NULL) { free(values); free(sizes); return (GFARM_ERR_NO_MEMORY); } for (i = 0; i < nattrs; i++) { values[i] = malloc(attrsizes[i]); if (values[i] == NULL) { while (--i >= 0) { free(values[i]); } free(values); free(sizes); return (GFARM_ERR_NO_MEMORY); } memcpy(values[i], attrvalues[i], attrsizes[i]); sizes[i] = attrsizes[i]; } *attrvaluesp = values; *attrsizesp = sizes; return (GFARM_ERR_NO_ERROR); } static gfarm_error_t gfs_stat_cache_enter_internal(const char *path, const struct gfs_stat *st, int nattrs, char **attrnames, void **attrvalues, size_t *attrsizes, const struct timeval *nowp) { gfarm_error_t e, e2, e3; struct gfarm_hash_entry *entry; struct stat_cache_data *data; int created; if (stat_cache == NULL) { if ((e = gfs_stat_cache_init()) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001283, "initialization of stat_cache failed: %s", gfarm_error_string(e)); return (e); } } gfs_stat_cache_expire_internal(nowp); if (stat_cache_count >= gfarm_attr_cache_limit) { /* remove the head of the list (i.e. oldest entry) */ data = stat_cache_list_head.next; data->prev->next = data->next; data->next->prev = data->prev; gfs_stat_cache_data_free(data); entry = data->entry; gfarm_hash_purge(stat_cache, gfarm_hash_entry_key(entry), gfarm_hash_entry_key_length(entry)); --stat_cache_count; } entry = gfarm_hash_enter(stat_cache, path, strlen(path) + 1, sizeof(*data), &created); if (entry == NULL) { gflog_debug(GFARM_MSG_1001284, "allocation of hash entry for stat cache failed: %s", gfarm_error_string(GFARM_ERR_NO_MEMORY)); return (GFARM_ERR_NO_MEMORY); } data = gfarm_hash_entry_data(entry); if (created) { ++stat_cache_count; data->entry = entry; } else { /* remove from the list, to move this to the end of the list */ data->prev->next = data->next; data->next->prev = data->prev; gfs_stat_cache_data_free(data); } e = gfs_stat_copy(&data->st, st); if (nattrs == 0) { data->attrnames = NULL; data->attrvalues = NULL; data->attrsizes = NULL; e2 = e3 = GFARM_ERR_NO_ERROR; } else { e2 = attrnames_copy(nattrs, &data->attrnames, attrnames); e3 = attrvalues_copy(nattrs, &data->attrvalues, &data->attrsizes, attrvalues, attrsizes); } if (e != GFARM_ERR_NO_ERROR || e2 != GFARM_ERR_NO_ERROR || e3 != GFARM_ERR_NO_ERROR) { gfarm_hash_purge(stat_cache, gfarm_hash_entry_key(entry), gfarm_hash_entry_key_length(entry)); --stat_cache_count; gflog_debug(GFARM_MSG_1001285, "gfs_stat_copy() failed: %s", gfarm_error_string(e)); if (e == GFARM_ERR_NO_ERROR) gfs_stat_free(&data->st); if (e2 == GFARM_ERR_NO_ERROR) gfarm_strings_free_deeply( data->nattrs, data->attrnames); if (e3 == GFARM_ERR_NO_ERROR) { gfarm_anyptrs_free_deeply( data->nattrs, data->attrvalues); free(data->attrsizes); } return (e != GFARM_ERR_NO_ERROR ? e : e2 != GFARM_ERR_NO_ERROR ? e2 : e3); } data->nattrs = nattrs; data->expiration = *nowp; gfarm_timeval_add(&data->expiration, &stat_cache_lifespan); /* add to the end of the cache list, i.e. assumes monotonic time */ data->next = &stat_cache_list_head; data->prev = stat_cache_list_head.prev; stat_cache_list_head.prev->next = data; stat_cache_list_head.prev = data; return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfs_stat_cache_purge(const char *path) { struct gfarm_hash_iterator it; struct gfarm_hash_entry *entry; struct stat_cache_data *data; if (stat_cache == NULL) /* there is nothing to purge */ return (GFARM_ERR_NO_ERROR); gfs_stat_cache_expire(); if (!gfarm_hash_iterator_lookup( stat_cache, path, strlen(path)+1, &it)) { gflog_debug(GFARM_MSG_1001286, "lookup for path (%s) in stat cache failed: %s", path, gfarm_error_string( GFARM_ERR_NO_SUCH_FILE_OR_DIRECTORY)); return (GFARM_ERR_NO_SUCH_FILE_OR_DIRECTORY); } entry = gfarm_hash_iterator_access(&it); assert(entry != NULL); data = gfarm_hash_entry_data(entry); data->prev->next = data->next; data->next->prev = data->prev; gfs_stat_cache_data_free(data); gfarm_hash_iterator_purge(&it); --stat_cache_count; return (GFARM_ERR_NO_ERROR); } /* this returns uncached result, but enter the result to the cache */ static gfarm_error_t gfs_getattrplus_caching(const char *path, char **patterns, int npatterns, struct gfs_stat *st, int *nattrsp, char ***attrnamesp, void ***attrvaluesp, size_t **attrsizesp) { gfarm_error_t e; struct timeval now; e = gfs_getattrplus(path, patterns, npatterns, 0, st, nattrsp, attrnamesp, attrvaluesp, attrsizesp); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1002465, "gfs_getattrplusstat(%s): %s", path, gfarm_error_string(e)); return (e); } gettimeofday(&now, NULL); if ((e = gfs_stat_cache_enter_internal(path, st, *nattrsp, *attrnamesp, *attrvaluesp, *attrsizesp, &now)) != GFARM_ERR_NO_ERROR) { /* * It's ok to fail in entering the cache, * since it's merely cache. */ gflog_warning(GFARM_MSG_1002466, "gfs_getattrplus_caching: failed to cache %s: %s", path, gfarm_error_string(e)); } return (GFARM_ERR_NO_ERROR); } /* this returns uncached result, but enter the result to the cache */ gfarm_error_t gfs_stat_caching(const char *path, struct gfs_stat *st) { int nattrs; char **attrnames; void **attrvalues; size_t *attrsizes; gfarm_error_t e = gfs_getattrplus_caching(path, gfarm_xattr_caching_patterns(), gfarm_xattr_caching_patterns_number(), st, &nattrs, &attrnames, &attrvalues, &attrsizes); if (e != GFARM_ERR_NO_ERROR) return (e); gfarm_strings_free_deeply(nattrs, attrnames); gfarm_anyptrs_free_deeply(nattrs, attrvalues); free(attrsizes); return (e); } /* this returns uncached result, but enter the result to the cache */ gfarm_error_t gfs_lstat_caching(const char *path, struct gfs_stat *st) { return (gfs_stat_caching(path, st)); /* XXX FIXME */ } /* this returns uncached result, but enter the result to the cache */ gfarm_error_t gfs_getxattr_caching(const char *path, const char *name, void *value, size_t *sizep) { struct gfs_stat st; int npat, nattrs, i, found = 0; char **patterns, **pat; char **attrnames; void **attrvalues; size_t *attrsizes; gfarm_error_t e; npat = gfarm_xattr_caching_patterns_number(); GFARM_MALLOC_ARRAY(patterns, npat + 1); if (patterns == NULL) return (GFARM_ERR_NO_MEMORY); pat = gfarm_xattr_caching_patterns(); for (i = 0; i < npat; i++) patterns[i] = pat[i]; /* XXX FIXME: need to add escape characters for metacharacters */ patterns[npat] = (char *)name; /* UNCONST */ e = gfs_getattrplus_caching(path, patterns, npat + 1, &st, &nattrs, &attrnames, &attrvalues, &attrsizes); free(patterns); if (e != GFARM_ERR_NO_ERROR) return (e); for (i = 0; i < nattrs; i++) { if (strcmp(attrnames[i], name) == 0) { if (*sizep >= attrsizes[i]) { memcpy(value, attrvalues[i], attrsizes[i]); } else if (*sizep != 0) { gflog_debug(GFARM_MSG_1002467, "gfs_getxattr_caching(%s, %s, size:%d): " "too large result: %d bytes", path, name, (int)*sizep, (int)attrsizes[i]); e = GFARM_ERR_RESULT_OUT_OF_RANGE; } *sizep = attrsizes[i]; found = 1; break; } } if (!found) e = GFARM_ERR_NO_SUCH_OBJECT; gfs_stat_free(&st); gfarm_strings_free_deeply(nattrs, attrnames); gfarm_anyptrs_free_deeply(nattrs, attrvalues); free(attrsizes); return (e); } gfarm_error_t gfs_stat_cache_data_get(const char *path, struct stat_cache_data **datap) { struct gfarm_hash_entry *entry; struct timeval now; if (stat_cache == NULL) { gfarm_error_t e = gfs_stat_cache_init(); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001288, "initialization of stat cache failed: %s", gfarm_error_string(e)); return (e); } } gettimeofday(&now, NULL); gfs_stat_cache_expire_internal(&now); entry = gfarm_hash_lookup(stat_cache, path, strlen(path) + 1); if (entry != NULL) { #ifdef DIRCACHE_DEBUG gflog_debug(GFARM_MSG_1000092, "%ld.%06ld: gfs_stat_cached(%s): hit (%d)", (long)now.tv_sec,(long)now.tv_usec, path,stat_cache_count); #endif *datap = gfarm_hash_entry_data(entry); return (GFARM_ERR_NO_ERROR); } #ifdef DIRCACHE_DEBUG gflog_debug(GFARM_MSG_1000093, "%ld.%06ld: gfs_stat_cached(%s): miss (%d)", (long)now.tv_sec, (long)now.tv_usec, path, stat_cache_count); #endif *datap = NULL; return (GFARM_ERR_NO_ERROR); } /* this returns cached result */ gfarm_error_t gfs_stat_cached_internal(const char *path, struct gfs_stat *st) { struct stat_cache_data *data; gfarm_error_t e = gfs_stat_cache_data_get(path, &data); if (e != GFARM_ERR_NO_ERROR) return (e); if (data == NULL) /* not hit */ return (gfs_stat_caching(path, st)); return (gfs_stat_copy(st, &data->st)); /* hit */ } /* this returns cached result */ gfarm_error_t gfs_getxattr_cached_internal(const char *path, const char *name, void *value, size_t *sizep) { struct stat_cache_data *data; gfarm_error_t e = gfs_stat_cache_data_get(path, &data); int i, found = 0; if (e != GFARM_ERR_NO_ERROR) return (e); if (data == NULL) /* not hit */ return (gfs_getxattr_caching(path, name, value, sizep)); /* hit */ for (i = 0; i < data->nattrs; i++) { if (strcmp(data->attrnames[i], name) == 0) { if (*sizep >= data->attrsizes[i]) { memcpy(value, data->attrvalues[i], data->attrsizes[i]); } else if (*sizep != 0) { gflog_debug(GFARM_MSG_1002468, "gfs_getxattr_cached_internal" "(%s, %s, size:%d): " "too large result: %d bytes", path, name, (int)*sizep, (int)data->attrsizes[i]); e = GFARM_ERR_RESULT_OUT_OF_RANGE; } *sizep = data->attrsizes[i]; found = 1; break; } } if (!found) { if (gfarm_xattr_caching(name)) { /* negative cache */ e = GFARM_ERR_NO_SUCH_OBJECT; } else { /* this xattr is uncachable */ return (gfs_getxattr(path, name, value, sizep)); } } return (e); } /* * gfs_opendir_caching()/readdir_caching()/closedir_caching() */ #define DIRENTSPLUS_BUFCOUNT 256 struct gfs_dir_caching { struct gfs_dir super; GFS_DirPlusXAttr dp; char *path; }; static gfarm_error_t gfs_readdir_caching_internal(GFS_Dir super, struct gfs_dirent **entryp) { struct gfs_dir_caching *dir = (struct gfs_dir_caching *)super; struct gfs_dirent *ep; struct gfs_stat *stp; int nattrs; char **attrnames; void **attrvalues; size_t *attrsizes; char *path; gfarm_error_t e = gfs_readdirplusxattr(dir->dp, &ep, &stp, &nattrs, &attrnames, &attrvalues, &attrsizes); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001289, "gfs_readdirplusxattr() failed: %s", gfarm_error_string(e)); return (e); } if (ep != NULL) { /* i.e. not EOF */ GFARM_MALLOC_ARRAY(path, strlen(dir->path) + strlen(ep->d_name) + 1); if (path == NULL) { /* * It's ok to fail in entering the cache, * since it's merely cache. */ gflog_warning(GFARM_MSG_UNUSED, "dircache: failed to cache %s%s due to no memory", dir->path, ep->d_name); } else { struct timeval now; gettimeofday(&now, NULL); sprintf(path, "%s%s", dir->path, ep->d_name); #ifdef DIRCACHE_DEBUG gflog_debug(GFARM_MSG_1000094, "%ld.%06ld: gfs_readdir_caching()->" "\"%s\" (%d)", (long)now.tv_sec, (long)now.tv_usec, path, stat_cache_count); #endif /* * It's ok to fail in entering the cache, * since it's merely cache. */ if ((e = gfs_stat_cache_enter_internal(path, stp, nattrs, attrnames, attrvalues, attrsizes, &now)) != GFARM_ERR_NO_ERROR) { gflog_warning(GFARM_MSG_UNUSED, "dircache: failed to cache %s: %s", path, gfarm_error_string(e)); } free(path); } } *entryp = ep; return (GFARM_ERR_NO_ERROR); } static gfarm_error_t gfs_closedir_caching_internal(GFS_Dir super) { struct gfs_dir_caching *dir = (struct gfs_dir_caching *)super; gfarm_error_t e = gfs_closedirplusxattr(dir->dp); free(dir->path); free(dir); return (e); } gfarm_error_t gfs_opendir_caching_internal(const char *path, GFS_Dir *dirp) { gfarm_error_t e; GFS_DirPlusXAttr dp; struct gfs_dir_caching *dir; char *p; static struct gfs_dir_ops ops = { gfs_closedir_caching_internal, gfs_readdir_caching_internal, gfs_seekdir_unimpl, gfs_telldir_unimpl }; if ((e = gfs_opendirplusxattr(path, &dp)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001290, "gfs_opendirplusxattr(%s) failed: %s", path, gfarm_error_string(e)); return (e); } GFARM_MALLOC(dir); if (*gfarm_path_dir_skip(path) != '\0') { GFARM_MALLOC_ARRAY(p, strlen(path) + 1 + 1); if (p != NULL) sprintf(p, "%s/", path); } else { GFARM_MALLOC_ARRAY(p, strlen(path) + 1); if (p != NULL) strcpy(p, path); } if (dir == NULL || p == NULL) { gfs_closedirplusxattr(dp); if (dir != NULL) free(dir); if (p != NULL) free(p); gflog_debug(GFARM_MSG_1001291, "allocation of dir or path failed: %s", gfarm_error_string(GFARM_ERR_NO_MEMORY)); return (GFARM_ERR_NO_MEMORY); } dir->super.ops = &ops; dir->dp = dp; dir->path = p; *dirp = &dir->super; return (GFARM_ERR_NO_ERROR); } gfarm-2.4.1/lib/libgfarm/gfarm/timespec.c0000644000000000000000000000242411507222723016715 0ustar rootroot/* * $Id: timespec.c 3758 2007-06-13 15:05:44Z tatebe $ */ #include #include #define GFARM_SECOND_BY_NANOSEC 1000000000 int gfarm_timespec_cmp( const struct gfarm_timespec *t1, const struct gfarm_timespec *t2) { if (t1->tv_sec > t2->tv_sec) return (1); if (t1->tv_sec < t2->tv_sec) return (-1); if (t1->tv_nsec > t2->tv_nsec) return (1); if (t1->tv_nsec < t2->tv_nsec) return (-1); return (0); } static void gfarm_timespec_normalize(struct gfarm_timespec *t) { long n; if (t->tv_nsec >= GFARM_SECOND_BY_NANOSEC) { n = t->tv_nsec / GFARM_SECOND_BY_NANOSEC; t->tv_nsec -= n * GFARM_SECOND_BY_NANOSEC; t->tv_sec += n; } else if (t->tv_nsec < 0) { n = -t->tv_nsec / GFARM_SECOND_BY_NANOSEC + 1; t->tv_nsec += n * GFARM_SECOND_BY_NANOSEC; t->tv_sec -= n; } } void gfarm_timespec_add(struct gfarm_timespec *t1, const struct gfarm_timespec *t2) { t1->tv_sec += t2->tv_sec; t1->tv_nsec += t2->tv_nsec; gfarm_timespec_normalize(t1); } void gfarm_timespec_sub(struct gfarm_timespec *t1, const struct gfarm_timespec *t2) { t1->tv_sec -= t2->tv_sec; t1->tv_nsec -= t2->tv_nsec; gfarm_timespec_normalize(t1); } void gfarm_timespec_add_nanosec(struct gfarm_timespec *t, long nanosec) { t->tv_nsec += nanosec; gfarm_timespec_normalize(t); } gfarm-2.4.1/lib/libgfarm/gfarm/gfs_dir.h0000644000000000000000000000057511507222724016534 0ustar rootrootstruct gfs_dir_ops { gfarm_error_t (*closedir)(GFS_Dir); gfarm_error_t (*readdir)(GFS_Dir, struct gfs_dirent **); gfarm_error_t (*seekdir)(GFS_Dir, gfarm_off_t); gfarm_error_t (*telldir)(GFS_Dir, gfarm_off_t *); }; struct gfs_dir { struct gfs_dir_ops *ops; }; gfarm_error_t gfs_seekdir_unimpl(GFS_Dir, gfarm_off_t); gfarm_error_t gfs_telldir_unimpl(GFS_Dir, gfarm_off_t *); gfarm-2.4.1/lib/libgfarm/gfarm/gfs_io.c0000644000000000000000000001322211507222724016351 0ustar rootroot#include #include /* config.h needs FILE */ #include #define GFARM_INTERNAL_USE /* GFARM_FILE_LOOKUP */ #include #include "gfutil.h" #include "gfm_client.h" #include "config.h" #include "lookup.h" #include "gfs_io.h" static gfarm_error_t gfm_open_flag_check(int flag) { if (flag & ~GFARM_FILE_USER_MODE) return (GFARM_ERR_INVALID_ARGUMENT); if ((flag & GFARM_FILE_ACCMODE) == GFARM_FILE_LOOKUP) return (GFARM_ERR_INVALID_ARGUMENT); return (GFARM_ERR_NO_ERROR); } /* * gfm_create_fd() */ struct gfm_create_fd_closure { /* input */ int flags; gfarm_mode_t mode_to_create; /* work */ gfarm_mode_t mode_created; int fd; /* output */ struct gfm_connection **gfm_serverp; int *fdp; int *typep; }; static gfarm_error_t gfm_create_fd_request(struct gfm_connection *gfm_server, void *closure, const char *base) { struct gfm_create_fd_closure *c = closure; gfarm_error_t e; if ((e = gfm_client_create_request(gfm_server, base, c->flags, c->mode_to_create)) != GFARM_ERR_NO_ERROR) { gflog_warning(GFARM_MSG_1000080, "create(%s) request: %s", base, gfarm_error_string(e)); } else if ((e = gfm_client_get_fd_request(gfm_server)) != GFARM_ERR_NO_ERROR) { gflog_warning(GFARM_MSG_1000081, "get_fd(%s) request: %s", base, gfarm_error_string(e)); } return (e); } static gfarm_error_t gfm_create_fd_result(struct gfm_connection *gfm_server, void *closure) { struct gfm_create_fd_closure *c = closure; gfarm_error_t e; gfarm_ino_t inum; gfarm_uint64_t gen; if ((e = gfm_client_create_result(gfm_server, &inum, &gen, &c->mode_created)) != GFARM_ERR_NO_ERROR) { #if 0 /* DEBUG */ gflog_debug(GFARM_MSG_1000082, "create() result: %s", gfarm_error_string(e)); #endif } else if ((e = gfm_client_get_fd_result(gfm_server, &c->fd)) != GFARM_ERR_NO_ERROR) { gflog_warning(GFARM_MSG_1000083, "get_fd() result: %s", gfarm_error_string(e)); } return (e); } static gfarm_error_t gfm_create_fd_success(struct gfm_connection *gfm_server, void *closure) { struct gfm_create_fd_closure *c = closure; *c->gfm_serverp = gfm_server; *c->fdp = c->fd; if (c->typep != NULL) *c->typep = gfs_mode_to_type(c->mode_created);; return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfm_create_fd(const char *path, int flags, gfarm_mode_t mode, struct gfm_connection **gfm_serverp, int *fdp, int *typep) { gfarm_error_t e; struct gfm_create_fd_closure closure; #if 0 /* not yet in gfarm v2 */ /* GFARM_FILE_EXCLUSIVE is a NOP with gfm_open_fd(). */ flags &= ~GFARM_FILE_EXCLUSIVE; #endif /* not yet in gfarm v2 */ if ((e = gfm_open_flag_check(flags)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001268, "gfm_open_flag_check(%d) failed: %s", flags, gfarm_error_string(e)); return (e); } closure.flags = flags; closure.mode_to_create = mode; closure.gfm_serverp = gfm_serverp; closure.fdp = fdp; closure.typep = typep; return (gfm_name_op(path, GFARM_ERR_IS_A_DIRECTORY, gfm_create_fd_request, gfm_create_fd_result, gfm_create_fd_success, &closure)); } /* * gfm_open_fd() */ struct gfm_open_fd_closure { int fd; struct gfm_connection **gfm_serverp; int *fdp; int *typep; }; static gfarm_error_t gfm_open_fd_request(struct gfm_connection *gfm_server, void *closure) { gfarm_error_t e = gfm_client_get_fd_request(gfm_server); if (e != GFARM_ERR_NO_ERROR) gflog_warning(GFARM_MSG_1000084, "get_fd request; %s", gfarm_error_string(e)); return (e); } static gfarm_error_t gfm_open_fd_result(struct gfm_connection *gfm_server, void *closure) { struct gfm_open_fd_closure *c = closure; gfarm_error_t e = gfm_client_get_fd_result(gfm_server, &c->fd); #if 0 /* DEBUG */ if (e != GFARM_ERR_NO_ERROR) gflog_debug(GFARM_MSG_1000085, "get_fd result; %s", gfarm_error_string(e)); #endif return (e); } static gfarm_error_t gfm_open_fd_success(struct gfm_connection *gfm_server, void *closure, int type) { struct gfm_open_fd_closure *c = closure; *c->gfm_serverp = gfm_server; *c->fdp = c->fd; if (c->typep != NULL) *c->typep = type; return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfm_open_fd(const char *path, int flags, struct gfm_connection **gfm_serverp, int *fdp, int *typep) { gfarm_error_t e; struct gfm_open_fd_closure closure; #if 0 /* not yet in gfarm v2 */ /* GFARM_FILE_EXCLUSIVE is a NOP with gfm_open_fd(). */ flags &= ~GFARM_FILE_EXCLUSIVE; #endif /* not yet in gfarm v2 */ if ((e = gfm_open_flag_check(flags)) != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001269, "gfm_open_flag_check(%d) failed: %s", flags, gfarm_error_string(e)); return (e); } closure.gfm_serverp = gfm_serverp; closure.fdp = fdp; closure.typep = typep; return (gfm_inode_op(path, flags, gfm_open_fd_request, gfm_open_fd_result, gfm_open_fd_success, NULL, &closure)); } static gfarm_error_t gfm_close_request(struct gfm_connection *gfm_server, void *closure) { gfarm_error_t e = gfm_client_close_request(gfm_server); if (e != GFARM_ERR_NO_ERROR) gflog_warning(GFARM_MSG_1000086, "close request: %s", gfarm_error_string(e)); return (e); } static gfarm_error_t gfm_close_result(struct gfm_connection *gfm_server, void *closure) { gfarm_error_t e = gfm_client_close_result(gfm_server); #if 1 /* DEBUG */ if (e != GFARM_ERR_NO_ERROR) gflog_debug(GFARM_MSG_1000087, "close result: %s", gfarm_error_string(e)); #endif return (e); } /* * gfm_close_fd() * * NOTE: * gfm_server is not freed by this function. * callers of this function should free it. */ gfarm_error_t gfm_close_fd(struct gfm_connection *gfm_server, int fd) { return (gfm_client_compound_fd_op(gfm_server, fd, gfm_close_request, gfm_close_result, NULL, NULL)); } gfarm-2.4.1/lib/libgfarm/gfarm/param.h0000644000000000000000000000316411507222723016213 0ustar rootroot/* * $Id: param.h 1241 2004-08-09 08:03:20Z soda $ */ struct sockaddr; struct gfarm_hostspec; struct gfarm_param_config; struct gfarm_param_type { char *name; int boolean; void *extension; }; gfarm_error_t gfarm_param_config_parse_long(int, struct gfarm_param_type *, char *, int *, long *); gfarm_error_t gfarm_param_config_add_long(struct gfarm_param_config ***, int, long, struct gfarm_hostspec *); gfarm_error_t gfarm_param_apply_long_by_name_addr(struct gfarm_param_config *, const char *, struct sockaddr *, gfarm_error_t (*)(void *, int, long), void *); gfarm_error_t gfarm_param_apply_long(struct gfarm_param_config *, gfarm_error_t (*)(void *, int, long), void *); gfarm_error_t gfarm_param_get_long_by_name_addr(struct gfarm_param_config *, int, char *, struct sockaddr *, long *); gfarm_error_t gfarm_param_get_long(struct gfarm_param_config *, int, long *); /* * netparam */ struct gfarm_netparam_info; gfarm_error_t gfarm_netparam_config_add_long(char *, struct gfarm_hostspec *); gfarm_error_t gfarm_netparam_config_get_long(struct gfarm_netparam_info *, char *, struct sockaddr *, long *); extern struct gfarm_netparam_info gfarm_netparam_parallel_streams; extern struct gfarm_netparam_info gfarm_netparam_stripe_unit_size; extern struct gfarm_netparam_info gfarm_netparam_rate_limit; extern struct gfarm_netparam_info gfarm_netparam_file_read_size; extern struct gfarm_netparam_info gfarm_netparam_file_sync_rate; extern struct gfarm_netparam_info gfarm_netparam_file_sync_stripe; extern struct gfarm_netparam_info gfarm_netparam_send_stripe_sync; extern struct gfarm_netparam_info gfarm_netparam_recv_stripe_sync; gfarm-2.4.1/lib/libgfarm/gfarm/xattr_info.h0000644000000000000000000000136011507222724017265 0ustar rootroot/* * Copyright (c) 2009 National Institute of Informatics in Japan. * All rights reserved. */ struct gfs_foundxattr_entry { char *path; char *attrname; }; struct gfm_connection; struct gfs_xmlattr_ctx { // for request from API char *path; char *expr; int depth; // reply of open struct gfm_connection *gfm_server; int fd; int type; // for request to gfmd char *cookie_path; char *cookie_attrname; // for reply int nalloc, nvalid, index; struct gfs_foundxattr_entry *entries; int eof; char *workpath; }; struct gfs_xmlattr_ctx *gfs_xmlattr_ctx_alloc(int nentry); void gfs_xmlattr_ctx_free(struct gfs_xmlattr_ctx *, int); struct xattr_info { gfarm_ino_t inum; char *attrname; int namelen; void *attrvalue; int attrsize; }; gfarm-2.4.1/lib/libgfarm/gfarm/gfs_exec.c0000644000000000000000000000725511507222723016676 0ustar rootroot/* * $Id: gfs_exec.c 4418 2010-02-17 07:04:35Z ookuma $ */ #include #include #include #include #include #include #include #include "gfs_profile.h" #include "gfs_misc.h" char * gfarm_url_execfile_replicate_to_local(const char *url, char **local_pathp) { char *e, *arch = NULL, *gfarm_file, *localpath; struct gfs_stat gs; gfarm_mode_t gmode; struct gfarm_file_section_info sinfo; *local_pathp = NULL; e = gfs_stat(url, &gs); if (e != NULL) { gflog_debug(GFARM_MSG_UNFIXED, "gfs_stat(%s) failed: %s", url, gfarm_error_string(e)); return (e); } #if 0 /* this should be 1? but maybe too dangerous */ e = gfarm_fabricate_mode_for_replication(&gs, &gmode); if (e != NULL) { /**/ } else #else gmode = gs.st_mode; #endif if (GFARM_S_ISDIR(gs.st_mode)) { e = GFARM_ERR_IS_A_DIRECTORY; gflog_debug(GFARM_MSG_UNFIXED, "URL (%s) is a directory: %s", url, gfarm_error_string(e)); } else if (!GFARM_S_ISREG(gs.st_mode)) { e = "unknown format"; gflog_debug(GFARM_MSG_UNFIXED, "URL (%s) is not regular file", url); } else if (GFARM_S_IS_FRAGMENTED_FILE(gs.st_mode)) { arch = "0"; } else if (GFARM_S_IS_PROGRAM(gs.st_mode)) { if (gfarm_host_get_self_architecture(&arch) != NULL) { e = "not a file system node"; gflog_debug(GFARM_MSG_UNFIXED, e); } } else { e = "unknown format"; gflog_debug(GFARM_MSG_UNFIXED, e); } gfs_stat_free(&gs); if (e != NULL) return (e); /* determine the local pathname */ e = gfarm_url_make_path(url, &gfarm_file); if (e != NULL) { gflog_debug(GFARM_MSG_UNFIXED, "Conversion from URL (%s) to a local pathname " "failed: %s", url, gfarm_error_string(e)); return (e); } /* check the metadata */ e = gfarm_file_section_info_get(gfarm_file, arch, &sinfo); if (e == GFARM_ERR_NO_SUCH_OBJECT) e = gfarm_file_section_info_get(gfarm_file, "noarch", &sinfo); free(gfarm_file); if (e != NULL) { gflog_debug(GFARM_MSG_UNFIXED, "getting file section info (%s) failed: %s", gfarm_file, gfarm_error_string(e)); return (e); } e = gfarm_file_section_replicate_to_local_with_locking(&sinfo, gmode, &localpath); gfarm_file_section_info_free(&sinfo); if (e == NULL) *local_pathp = localpath; else gflog_debug(GFARM_MSG_UNFIXED, "replication of file section to local " "with locking failed (%s): %s", gfarm_file, gfarm_error_string(e)); return (e); } char * gfarm_url_program_get_local_path(const char *url, char **local_path) { char *e; *local_path = NULL; /* check the permission */ e = gfs_access(url, X_OK); if (e != NULL) { gflog_debug(GFARM_MSG_UNFIXED, "access to url for X_OK permission (%s) failed: %s", url, gfarm_error_string(e)); return (e); } return (gfarm_url_execfile_replicate_to_local(url, local_path)); } char * gfs_execve(const char *filename, char *const argv[], char *const envp[]) { char *localpath, *url, *e; const char *path; e = gfs_realpath(filename, &url); if (e != NULL) { gflog_debug(GFARM_MSG_UNFIXED, "failed to get realpath for file (%s): %s", filename, gfarm_error_string(e)); return (e); } e = gfarm_url_program_get_local_path(url, &localpath); free(url); if (e != NULL) { gflog_debug(GFARM_MSG_UNFIXED, "Conversion to local path from URL (%s) failed: %s", url, gfarm_error_string(e)); return (e); } path = localpath; #if 0 /* * gfarm_terminate() should not be called here * because we need to keep the LDAP connection. */ /* clean up the client environment */ gfs_profile_unset(); /* not to display profile statistics */ (void)gfarm_terminate(); #endif execve(path, argv, envp); return gfarm_errno_to_error(errno); } gfarm-2.4.1/lib/libgfarm/gfarm/gfm_proto.h0000644000000000000000000002373111507222723017111 0ustar rootroot#ifndef GFMD_DEFAULT_PORT #define GFMD_DEFAULT_PORT 601 #endif enum gfm_proto_command { /* host/user/group metadata */ GFM_PROTO_HOST_INFO_GET_ALL, GFM_PROTO_HOST_INFO_GET_BY_ARCHITECTURE, GFM_PROTO_HOST_INFO_GET_BY_NAMES, GFM_PROTO_HOST_INFO_GET_BY_NAMEALIASES, GFM_PROTO_HOST_INFO_SET, GFM_PROTO_HOST_INFO_MODIFY, GFM_PROTO_HOST_INFO_REMOVE, GFM_PROTO_HOST_INFO_RESERVE7, GFM_PROTO_HOST_INFO_RESERVE8, GFM_PROTO_HOST_INFO_RESERVE9, GFM_PROTO_HOST_INFO_RESERVE10, GFM_PROTO_HOST_INFO_RESERVE11, GFM_PROTO_HOST_INFO_RESERVE12, GFM_PROTO_HOST_INFO_RESERVE13, GFM_PROTO_HOST_INFO_RESERVE14, GFM_PROTO_HOST_INFO_RESERVE15, GFM_PROTO_USER_INFO_GET_ALL, GFM_PROTO_USER_INFO_GET_BY_NAMES, GFM_PROTO_USER_INFO_SET, GFM_PROTO_USER_INFO_MODIFY, GFM_PROTO_USER_INFO_REMOVE, GFM_PROTO_USER_INFO_GET_BY_GSI_DN, GFM_PROTO_USER_INFO_RESERVE6, GFM_PROTO_USER_INFO_RESERVE7, GFM_PROTO_USER_INFO_RESERVE8, GFM_PROTO_USER_INFO_RESERVE9, GFM_PROTO_USER_INFO_RESERVE10, GFM_PROTO_USER_INFO_RESERVE11, GFM_PROTO_USER_INFO_RESERVE12, GFM_PROTO_USER_INFO_RESERVE13, GFM_PROTO_USER_INFO_RESERVE14, GFM_PROTO_USER_INFO_RESERVE15, GFM_PROTO_GROUP_INFO_GET_ALL, GFM_PROTO_GROUP_INFO_GET_BY_NAMES, GFM_PROTO_GROUP_INFO_SET, GFM_PROTO_GROUP_INFO_MODIFY, GFM_PROTO_GROUP_INFO_REMOVE, GFM_PROTO_GROUP_INFO_ADD_USERS, GFM_PROTO_GROUP_INFO_REMOVE_USERS, GFM_PROTO_GROUP_NAMES_GET_BY_USERS, GFM_PROTO_GROUP_INFO_RESERVE8, GFM_PROTO_GROUP_INFO_RESERVE9, GFM_PROTO_GROUP_INFO_RESERVE10, GFM_PROTO_GROUP_INFO_RESERVE11, GFM_PROTO_GROUP_INFO_RESERVE12, GFM_PROTO_GROUP_INFO_RESERVE13, GFM_PROTO_GROUP_INFO_RESERVE14, GFM_PROTO_GROUP_INFO_RESERVE15, GFM_PROTO_QUOTA_USER_GET, GFM_PROTO_QUOTA_USER_SET, GFM_PROTO_QUOTA_GROUP_GET, GFM_PROTO_QUOTA_GROUP_SET, GFM_PROTO_QUOTA_CHECK, GFM_PROTO_METADATA_RESERVE5, GFM_PROTO_METADATA_RESERVE6, GFM_PROTO_METADATA_RESERVE7, GFM_PROTO_METADATA_RESERVE8, GFM_PROTO_METADATA_RESERVE9, GFM_PROTO_METADATA_RESERVE10, GFM_PROTO_METADATA_RESERVE11, GFM_PROTO_METADATA_RESERVE12, GFM_PROTO_METADATA_RESERVE13, GFM_PROTO_METADATA_RESERVE14, GFM_PROTO_METADATA_RESERVE15, /* gfs from client */ GFM_PROTO_COMPOUND_BEGIN, /* from gfsd, too */ GFM_PROTO_COMPOUND_END, /* from gfsd, too */ GFM_PROTO_COMPOUND_ON_ERROR, /* from gfsd, too */ GFM_PROTO_PUT_FD, /* from gfsd, too */ GFM_PROTO_GET_FD, /* from gfsd, too */ GFM_PROTO_SAVE_FD, /* from gfsd, too */ GFM_PROTO_RESTORE_FD, /* from gfsd, too */ GFM_PROTO_BEQUEATH_FD, GFM_PROTO_INHERIT_FD, GFM_PROTO_CONTROL_OP_RESERVE9, GFM_PROTO_CONTROL_OP_RESERVE10, GFM_PROTO_CONTROL_OP_RESERVE11, GFM_PROTO_CONTROL_OP_RESERVE12, GFM_PROTO_CONTROL_OP_RESERVE13, GFM_PROTO_CONTROL_OP_RESERVE14, GFM_PROTO_CONTROL_OP_RESERVE15, GFM_PROTO_OPEN_ROOT, /* from gfsd, too */ GFM_PROTO_OPEN_PARENT, /* from gfsd, too */ GFM_PROTO_OPEN, /* from gfsd, too */ GFM_PROTO_CREATE, /* from gfsd, too */ GFM_PROTO_CLOSE, /* from gfsd, too */ GFM_PROTO_VERIFY_TYPE, GFM_PROTO_VERIFY_TYPE_NOT, GFM_PROTO_FD_MNG_OP_RESERVE7, GFM_PROTO_FD_MNG_OP_RESERVE8, GFM_PROTO_FD_MNG_OP_RESERVE9, GFM_PROTO_FD_MNG_OP_RESERVE10, GFM_PROTO_FD_MNG_OP_RESERVE11, GFM_PROTO_FD_MNG_OP_RESERVE12, GFM_PROTO_FD_MNG_OP_RESERVE13, GFM_PROTO_FD_MNG_OP_RESERVE14, GFM_PROTO_FD_MNG_OP_RESERVE15, GFM_PROTO_FSTAT, /* from gfsd, too */ GFM_PROTO_FUTIMES, /* from gfsd, too */ GFM_PROTO_FCHMOD, /* from gfsd, too */ GFM_PROTO_FCHOWN, /* from gfsd, too */ GFM_PROTO_CKSUM_GET, GFM_PROTO_CKSUM_SET, GFM_PROTO_SCHEDULE_FILE, GFM_PROTO_SCHEDULE_FILE_WITH_PROGRAM, GFM_PROTO_FGETATTRPLUS, GFM_PROTO_FD_OP_RESERVE9, GFM_PROTO_FD_OP_RESERVE10, GFM_PROTO_FD_OP_RESERVE11, GFM_PROTO_FD_OP_RESERVE12, GFM_PROTO_FD_OP_RESERVE13, GFM_PROTO_FD_OP_RESERVE14, GFM_PROTO_FD_OP_RESERVE15, GFM_PROTO_REMOVE, GFM_PROTO_RENAME, GFM_PROTO_FLINK, GFM_PROTO_MKDIR, GFM_PROTO_SYMLINK, GFM_PROTO_READLINK, GFM_PROTO_GETDIRPATH, GFM_PROTO_GETDIRENTS, GFM_PROTO_SEEK, GFM_PROTO_GETDIRENTSPLUS, GFM_PROTO_GETDIRENTSPLUSXATTR, GFM_PROTO_DIR_OP_RESERVE11, GFM_PROTO_DIR_OP_RESERVE12, GFM_PROTO_DIR_OP_RESERVE13, GFM_PROTO_DIR_OP_RESERVE14, GFM_PROTO_DIR_OP_RESERVE15, /* gfs from gfsd */ GFM_PROTO_REOPEN, GFM_PROTO_CLOSE_READ, GFM_PROTO_CLOSE_WRITE, /* for COMPAT_GFARM_2_3 */ GFM_PROTO_LOCK, GFM_PROTO_TRYLOCK, GFM_PROTO_UNLOCK, GFM_PROTO_LOCK_INFO, GFM_PROTO_SWITCH_BACK_CHANNEL, /* for COMPAT_GFARM_2_3 */ GFM_PROTO_SWITCH_ASYNC_BACK_CHANNEL, GFM_PROTO_CLOSE_WRITE_V2_4, GFM_PROTO_GENERATION_UPDATED, GFM_PROTO_FILE_OP_RESERVE11, GFM_PROTO_FILE_OP_RESERVE12, GFM_PROTO_FILE_OP_RESERVE13, GFM_PROTO_FILE_OP_RESERVE14, GFM_PROTO_FILE_OP_RESERVE15, /* gfs_pio from client */ GFM_PROTO_GLOB, GFM_PROTO_SCHEDULE, GFM_PROTO_PIO_OPEN, GFM_PROTO_PIO_SET_PATHS, GFM_PROTO_PIO_CLOSE, GFM_PROTO_PIO_VISIT, GFM_PROTO_PIO_OP_RESERVE6, GFM_PROTO_PIO_OP_RESERVE7, GFM_PROTO_PIO_OP_RESERVE8, GFM_PROTO_PIO_OP_RESERVE9, GFM_PROTO_PIO_OP_RESERVE10, GFM_PROTO_PIO_OP_RESERVE11, GFM_PROTO_PIO_OP_RESERVE12, GFM_PROTO_PIO_OP_RESERVE13, GFM_PROTO_PIO_OP_RESERVE14, GFM_PROTO_PIO_OP_RESERVE15, GFM_PROTO_PIO_MISC_RESERVE0, GFM_PROTO_PIO_MISC_RESERVE1, GFM_PROTO_PIO_MISC_RESERVE2, GFM_PROTO_PIO_MISC_RESERVE3, GFM_PROTO_PIO_MISC_RESERVE4, GFM_PROTO_PIO_MISC_RESERVE5, GFM_PROTO_PIO_MISC_RESERVE6, GFM_PROTO_PIO_MISC_RESERVE7, GFM_PROTO_PIO_MISC_RESERVE8, GFM_PROTO_PIO_MISC_RESERVE9, GFM_PROTO_PIO_MISC_RESERVE10, GFM_PROTO_PIO_MISC_RESERVE11, GFM_PROTO_PIO_MISC_RESERVE12, GFM_PROTO_PIO_MISC_RESERVE13, GFM_PROTO_PIO_MISC_RESERVE14, GFM_PROTO_PIO_MISC_RESERVE15, GFM_PROTO_HOSTNAME_SET, GFM_PROTO_SCHEDULE_HOST_DOMAIN, GFM_PROTO_STATFS, GFM_PROTO_MISC_RESERVE3, GFM_PROTO_MISC_RESERVE4, GFM_PROTO_MISC_RESERVE5, GFM_PROTO_MISC_RESERVE6, GFM_PROTO_MISC_RESERVE7, GFM_PROTO_MISC_RESERVE8, GFM_PROTO_MISC_RESERVE9, GFM_PROTO_MISC_RESERVE10, GFM_PROTO_MISC_RESERVE11, GFM_PROTO_MISC_RESERVE12, GFM_PROTO_MISC_RESERVE13, GFM_PROTO_MISC_RESERVE14, GFM_PROTO_MISC_RESERVE15, /* replica management from client */ GFM_PROTO_REPLICA_LIST_BY_NAME, GFM_PROTO_REPLICA_LIST_BY_HOST, GFM_PROTO_REPLICA_REMOVE_BY_HOST, GFM_PROTO_REPLICA_REMOVE_BY_FILE, GFM_PROTO_REPLICA_INFO_GET, GFM_PROTO_REPLICATE_FILE_FROM_TO, GFM_PROTO_REPLICATE_FILE_TO, GFM_PROTO_REPLICA_OP_RESERVE7, GFM_PROTO_REPLICA_OP_RESERVE8, GFM_PROTO_REPLICA_OP_RESERVE9, GFM_PROTO_REPLICA_OP_RESERVE10, GFM_PROTO_REPLICA_OP_RESERVE11, GFM_PROTO_REPLICA_OP_RESERVE12, GFM_PROTO_REPLICA_OP_RESERVE13, GFM_PROTO_REPLICA_OP_RESERVE14, GFM_PROTO_REPLICA_OP_RESERVE15, /* replica management from gfsd */ GFM_PROTO_REPLICA_ADDING, /* for COMPAT_GFARM_2_3 */ GFM_PROTO_REPLICA_ADDED, /* for COMPAT_GFARM_2_3 */ GFM_PROTO_REPLICA_LOST, GFM_PROTO_REPLICA_ADD, /* not used? */ GFM_PROTO_REPLICA_ADDED2, /* for COMPAT_GFARM_2_3 */ GFM_PROTO_REPLICATION_RESULT, GFM_PROTO_REPLICA_MNG_RESERVE6, GFM_PROTO_REPLICA_MNG_RESERVE7, GFM_PROTO_REPLICA_MNG_RESERVE8, GFM_PROTO_REPLICA_MNG_RESERVE9, GFM_PROTO_REPLICA_MNG_RESERVE10, GFM_PROTO_REPLICA_MNG_RESERVE11, GFM_PROTO_REPLICA_MNG_RESERVE12, GFM_PROTO_REPLICA_MNG_RESERVE13, GFM_PROTO_REPLICA_MNG_RESERVE14, GFM_PROTO_REPLICA_MNG_RESERVE15, /* job management */ GFM_PROTO_PROCESS_ALLOC, GFM_PROTO_PROCESS_ALLOC_CHILD, GFM_PROTO_PROCESS_FREE, GFM_PROTO_PROCESS_SET, GFM_PROTO_PROCESS_RESERVE4, GFM_PROTO_PROCESS_RESERVE5, GFM_PROTO_PROCESS_RESERVE6, GFM_PROTO_PROCESS_RESERVE7, GFM_PROTO_PROCESS_RESERVE8, GFM_PROTO_PROCESS_RESERVE9, GFM_PROTO_PROCESS_RESERVE10, GFM_PROTO_PROCESS_RESERVE11, GFM_PROTO_PROCESS_RESERVE12, GFM_PROTO_PROCESS_RESERVE13, GFM_PROTO_PROCESS_RESERVE14, GFM_PROTO_PROCESS_RESERVE15, GFJ_PROTO_LOCK_REGISTER, GFJ_PROTO_UNLOCK_REGISTER, GFJ_PROTO_REGISTER, GFJ_PROTO_UNREGISTER, GFJ_PROTO_REGISTER_NODE, GFJ_PROTO_LIST, GFJ_PROTO_INFO, GFJ_PROTO_HOSTINFO, GFJ_PROTO_RESERVE8, GFJ_PROTO_RESERVE9, GFJ_PROTO_RESERVE10, GFJ_PROTO_RESERVE11, GFJ_PROTO_RESERVE12, GFJ_PROTO_RESERVE13, GFJ_PROTO_RESERVE14, GFJ_PROTO_RESERVE15, /* extended attribute management */ GFM_PROTO_XATTR_SET, GFM_PROTO_XMLATTR_SET, GFM_PROTO_XATTR_GET, GFM_PROTO_XMLATTR_GET, GFM_PROTO_XATTR_REMOVE, GFM_PROTO_XMLATTR_REMOVE, GFM_PROTO_XATTR_LIST, GFM_PROTO_XMLATTR_LIST, GFM_PROTO_XMLATTR_FIND, GFM_PROTO_XATTR_OP_RESERVE9, GFM_PROTO_XATTR_OP_RESERVE10, GFM_PROTO_XATTR_OP_RESERVE11, GFM_PROTO_XATTR_OP_RESERVE12, GFM_PROTO_XATTR_OP_RESERVE13, GFM_PROTO_XATTR_OP_RESERVE14, GFM_PROTO_XATTR_OP_RESERVE15, /* range of private protocol number */ GFM_PROTO_PRIVATE_BASE = 0xF0000000, GFM_PROTO_PRIVATE_END = 0xFFFFFFFF }; #define GFM_PROTO_PROCESS_KEY_TYPE_SHAREDSECRET 1 #define GFM_PROTO_PROCESS_KEY_LEN_SHAREDSECRET 32 /* GFM_PROTO_CKSUM_GET flags */ #define GFM_PROTO_CKSUM_GET_MAYBE_EXPIRED 0x00000001 #define GFM_PROTO_CKSUM_GET_EXPIRED 0x00000002 /* GFM_PROTO_CKSUM_SET flags */ #define GFM_PROTO_CKSUM_SET_FILE_MODIFIED 0x00000001 /* * data size limits: * * see also: * GFS_MAXNAMLEN in * MAX_XATTR_NAME_LEN in gfm/xattr.c * gftool/config-gfarm/gfarm.sql */ #define GFM_PROTO_CKSUM_TYPE_MAXLEN 32 #define GFM_PROTO_CKSUM_MAXLEN 256 #define GFM_PROTO_MAX_DIRENT 10240 #define GFARM_HOST_NAME_MAX 256 #define GFARM_HOST_ARCHITECTURE_NAME_MAX 128 #define GFARM_LOGIN_NAME_MAX 64 #define GFARM_USER_REALNAME_MAX 256 #define GFARM_USER_GSI_DN_MAX 1024 #define GFARM_PATH_MAX 1024 /* GFM_PROTO_SCHEDULE_FILE, GFM_PROTO_SCHEDULE_FILE_WITH_PROGRAM */ #define GFM_PROTO_SCHED_FLAG_HOST_AVAIL 1 /* always TRUE for now */ #define GFM_PROTO_SCHED_FLAG_LOADAVG_AVAIL 2 /* always TRUE for now */ #define GFM_PROTO_SCHED_FLAG_RTT_AVAIL 4 /* always FALSE for now */ #define GFM_PROTO_LOADAVG_FSCALE 2048 /* output of GFM_PROTO_CLOSE_WRITE_V2_4 */ #define GFM_PROTO_CLOSE_WRITE_GENERATION_UPDATE_NEEDED 1 /* output of GFM_PROTO_REPLICA_INFO_GET */ #define GFM_PROTO_REPLICA_FLAG_INCOMPLETE 1 #define GFM_PROTO_REPLICA_FLAG_DEAD_HOST 2 #define GFM_PROTO_REPLICA_FLAG_DEAD_COPY 4 #if 0 /* There isn't gfm_proto.c for now. */ extern char GFM_SERVICE_TAG[]; #else #define GFM_SERVICE_TAG "gfarm-metadata" #endif gfarm-2.4.1/lib/libgfarm/gfarm/gfs_mkdir.c0000644000000000000000000000227511507222723017055 0ustar rootroot#include #include #define GFARM_INTERNAL_USE #include #include "gfutil.h" #include "gfm_client.h" #include "config.h" #include "lookup.h" struct gfm_mkdir_closure { /* input */ gfarm_mode_t mode; }; static gfarm_error_t gfm_mkdir_request(struct gfm_connection *gfm_server, void *closure, const char *base) { struct gfm_mkdir_closure *c = closure; gfarm_error_t e; if ((e = gfm_client_mkdir_request(gfm_server, base, c->mode)) != GFARM_ERR_NO_ERROR) { gflog_warning(GFARM_MSG_1000133, "mkdir(%s) request: %s", base, gfarm_error_string(e)); } return (e); } static gfarm_error_t gfm_mkdir_result(struct gfm_connection *gfm_server, void *closure) { gfarm_error_t e; if ((e = gfm_client_mkdir_result(gfm_server)) != GFARM_ERR_NO_ERROR) { #if 0 /* DEBUG */ gflog_debug(GFARM_MSG_1000134, "mkdir() result: %s", gfarm_error_string(e)); #endif } return (e); } gfarm_error_t gfs_mkdir(const char *path, gfarm_mode_t mode) { struct gfm_mkdir_closure closure; closure.mode = mode; return (gfm_name_op(path, GFARM_ERR_ALREADY_EXISTS, gfm_mkdir_request, gfm_mkdir_result, gfm_name_success_op_connection_free, &closure)); } gfarm-2.4.1/lib/libgfarm/gfarm/config_client.c0000644000000000000000000003106711507222723017714 0ustar rootroot#include #include #include #include #include #include #include #include #include #include "timer.h" #include "gfutil.h" #include "liberror.h" #include "gfs_profile.h" #include "host.h" #include "auth.h" #include "gfpath.h" #define GFARM_USE_STDIO #include "config.h" #include "gfm_client.h" #include "gfs_proto.h" #include "gfs_client.h" static gfarm_error_t gfarm_set_global_user_for_sharedsecret(void) { gfarm_error_t e; char *local_user, *global_user; /* * Sharedsecret authentication requires to send a global user * name when connecting to gfmd, which is determined by the * local user account. */ local_user = gfarm_get_local_username(); e = gfarm_local_to_global_username(local_user, &global_user); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1000978, "local_to_global_username(%s) failed: %s", local_user, gfarm_error_string(e)); return (e); } e = gfarm_set_global_username(global_user); free(global_user); return (e); } /* * XXX FIXME * the global username should not be global, but per metadata server basis. */ static gfarm_error_t gfarm_set_global_user_by_gsi(struct gfm_connection *gfm_server) { gfarm_error_t e = GFARM_ERR_NO_ERROR; #ifdef HAVE_GSI struct gfarm_user_info user; char *gsi_dn; /* Global user name determined by the distinguished name. */ gsi_dn = gfarm_gsi_client_cred_name(); if (gsi_dn != NULL) { e = gfm_client_user_info_get_by_gsi_dn(gfm_server, gsi_dn, &user); if (e == GFARM_ERR_NO_ERROR) { e = gfarm_set_global_username(user.username); gfarm_user_info_free(&user); } else { gflog_debug(GFARM_MSG_1000979, "gfm_client_user_info_" "get_by_gsi_dn(%s) failed: %s", gsi_dn, gfarm_error_string(e)); } } #endif return (e); } /* * the following function is for client, * server/daemon process shouldn't call it. * Because this function may read incorrect setting from user specified * $USER or $HOME. */ gfarm_error_t gfarm_config_read(void) { gfarm_error_t e; char *home; FILE *config; int lineno, user_config_errno, rc_need_free;; static char gfarm_client_rc[] = GFARM_CLIENT_RC; char *rc; rc_need_free = 0; rc = getenv("GFARM_CONFIG_FILE"); if (rc == NULL) { /* * result of gfarm_get_local_homedir() should not be trusted. * (maybe forged) */ home = gfarm_get_local_homedir(); GFARM_MALLOC_ARRAY(rc, strlen(home) + 1 + sizeof(gfarm_client_rc)); if (rc == NULL) { gflog_debug(GFARM_MSG_1000980, "allocation of array for 'gfarm_client_rc' failed: %s", gfarm_error_string(GFARM_ERR_NO_MEMORY)); return (GFARM_ERR_NO_MEMORY); } sprintf(rc, "%s/%s", home, gfarm_client_rc); rc_need_free = 1; } gfarm_init_config_stringlists(); if ((config = fopen(rc, "r")) == NULL) { user_config_errno = errno; } else { user_config_errno = 0; e = gfarm_config_read_file(config, &lineno); if (e != GFARM_ERR_NO_ERROR) { gflog_error(GFARM_MSG_1000015, "%s: %d: %s", rc, lineno, gfarm_error_string(e)); if (rc_need_free) free(rc); return (e); } } if (rc_need_free) free(rc); if ((config = fopen(gfarm_config_file, "r")) == NULL) { if (user_config_errno != 0) { gflog_debug(GFARM_MSG_1000981, "open operation on config file (%s) failed", gfarm_config_file); return (GFARM_ERRMSG_CANNOT_OPEN_CONFIG); } } else { e = gfarm_config_read_file(config, &lineno); if (e != GFARM_ERR_NO_ERROR) { gflog_error(GFARM_MSG_1000016, "%s: %d: %s", gfarm_config_file, lineno, gfarm_error_string(e)); return (e); } } gfarm_config_set_default_ports(); gfarm_config_set_default_misc(); return (GFARM_ERR_NO_ERROR); } int gf_on_demand_replication; static void gfarm_parse_env_client(void) { char *env; if ((env = getenv("GFARM_FLAGS")) != NULL) { for (; *env; env++) { switch (*env) { case 'r': gf_on_demand_replication = 1; break; } } } } #if 0 /* not yet in gfarm v2 */ /* * redirect stdout */ static gfarm_error_t gfarm_redirect_file(int fd, char *file, GFS_File *gf) { gfarm_error_t e; int nfd; if (file == NULL) return (GFARM_ERR_NO_ERROR); e = gfs_pio_create(file, GFARM_FILE_WRONLY, 0644, gf); if (e != GFARM_ERR_NO_ERROR) return (e); e = gfs_pio_set_view_local(*gf, 0); if (e != GFARM_ERR_NO_ERROR) return (e); nfd = gfs_pio_fileno(*gf); if (nfd == -1) return (gfarm_errno_to_error(errno)); /* * This assumes the file fragment is created in the local * spool. */ if (dup2(nfd, fd) == -1) e = gfarm_errno_to_error(errno); /* XXX - apparently violate the layer */ ((struct gfs_file_section_context *)(*gf)->view_context)->fd = fd; (*gf)->mode &= ~GFS_FILE_MODE_CALC_DIGEST; close(nfd); return (e); } /* * eliminate arguments added by the gfrun command. */ static GFS_File gf_stdout, gf_stderr; gfarm_error_t gfarm_parse_argv(int *argcp, char ***argvp) { gfarm_error_t e; int total_nodes = -1, node_index = -1; int argc = *argcp; char **argv = *argvp; char *argv0 = *argv; int call_set_local = 0; char *stdout_file = NULL, *stderr_file = NULL; --argc; ++argv; while (argc > 0 && argv[0][0] == '-' && argv[0][1] == '-') { if (strcmp(&argv[0][2], "gfarm_index") == 0) { --argc; ++argv; if (argc > 0) node_index = strtol(*argv, NULL, 0); call_set_local |= 1; } else if (strcmp(&argv[0][2], "gfarm_nfrags") == 0) { --argc; ++argv; if (argc > 0) total_nodes = strtol(*argv, NULL, 0); call_set_local |= 2; } else if (strcmp(&argv[0][2], "gfarm_stdout") == 0) { --argc; ++argv; if (argc > 0) stdout_file = *argv; } else if (strcmp(&argv[0][2], "gfarm_stderr") == 0) { --argc; ++argv; if (argc > 0) stderr_file = *argv; } else if (strcmp(&argv[0][2], "gfarm_profile") == 0) gfs_profile_set(); else if (strcmp(&argv[0][2], "gfarm_replicate") == 0) gf_on_demand_replication = 1; else if (strcmp(&argv[0][2], "gfarm_cwd") == 0) { --argc; ++argv; if (argc > 0) { e = gfs_chdir(*argv); if (e != GFARM_ERR_NO_ERROR) return (e); } } else break; --argc; ++argv; } if (call_set_local == 3) { e = gfs_pio_set_local(node_index, total_nodes); if (e != GFARM_ERR_NO_ERROR) return (e); /* redirect stdout and stderr */ if (stdout_file != GFARM_ERR_NO_ERROR) { e = gfarm_redirect_file(1, stdout_file, &gf_stdout); if (e != GFARM_ERR_NO_ERROR) return (e); } if (stderr_file != GFARM_ERR_NO_ERROR) { e = gfarm_redirect_file(2, stderr_file, &gf_stderr); if (e != GFARM_ERR_NO_ERROR) return (e); } ++argc; --argv; *argcp = argc; *argv = argv0; *argvp = argv; } return (GFARM_ERR_NO_ERROR); } #endif /* not yet in gfarm v2 */ char *gfarm_debug_command; char gfarm_debug_pid[GFARM_INT64STRLEN + 1]; static int gfarm_call_debugger(void) { int pid; if ((pid = fork()) == 0) { execlp("xterm", "xterm", "-e", "gdb", gfarm_debug_command, gfarm_debug_pid, NULL); perror("xterm"); _exit(1); } return (pid); } int gfarm_attach_debugger(void) { int pid = gfarm_call_debugger(); /* not really correct way to wait until attached, but... */ sleep(5); return (pid); } void gfarm_sig_debug(int sig) { int rv, pid, status; static int already_called = 0; static char message[] = "signal 00 caught\n"; message[7] = sig / 10 + '0'; message[8] = sig % 10 + '0'; /* ignore return value, since there is no other way here */ rv = write(2, message, sizeof(message) - 1); if (already_called) abort(); already_called = 1; pid = gfarm_call_debugger(); if (pid == -1) { perror("fork"); /* XXX dangerous to call from signal handler */ abort(); } else { waitpid(pid, &status, 0); _exit(1); } } void gfarm_debug_initialize(char *command) { gfarm_debug_command = command; sprintf(gfarm_debug_pid, "%ld", (long)getpid()); signal(SIGQUIT, gfarm_sig_debug); signal(SIGILL, gfarm_sig_debug); signal(SIGTRAP, gfarm_sig_debug); signal(SIGABRT, gfarm_sig_debug); signal(SIGFPE, gfarm_sig_debug); signal(SIGBUS, gfarm_sig_debug); signal(SIGSEGV, gfarm_sig_debug); } /* * the following function is for client, * server/daemon process shouldn't call it. * Because this function may read incorrect setting from user specified * $USER or $HOME. */ gfarm_error_t gfarm_initialize(int *argcp, char ***argvp) { gfarm_error_t e; struct gfm_connection *gfm_server; enum gfarm_auth_method auth_method; #ifdef HAVE_GSI int saved_auth_verb; #endif gflog_initialize(); e = gfarm_set_local_user_for_this_local_account(); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1000982, "gfarm_set_local_user_for_this_local_account() failed: %s", gfarm_error_string(e)); return (e); } e = gfarm_config_read(); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1000983, "gfarm_config_read() failed: %s", gfarm_error_string(e)); return (e); } #ifdef HAVE_GSI /* Force to display verbose error messages. */ saved_auth_verb = gflog_auth_set_verbose(1); (void)gfarm_gsi_client_initialize(); #endif /* * In sharedsecret authentication, a global user name is * required to be set to access a metadata server. */ e = gfarm_set_global_user_for_sharedsecret(); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1000984, "gfarm_set_global_user_for_sharedsecret() failed: %s", gfarm_error_string(e)); return (e); } /* * XXX FIXME this shouldn't be necessary here * to support multiple metadata server */ e = gfm_client_connection_and_process_acquire( gfarm_metadb_server_name, gfarm_metadb_server_port, &gfm_server); #ifdef HAVE_GSI (void)gflog_auth_set_verbose(saved_auth_verb); #endif if (e != GFARM_ERR_NO_ERROR) { gflog_error(GFARM_MSG_1000017, "connecting to gfmd at %s:%d: %s\n", gfarm_metadb_server_name, gfarm_metadb_server_port, gfarm_error_string(e)); return (e); } /* metadb access is required to obtain a global user name by GSI */ auth_method = gfm_client_connection_auth_method(gfm_server); if (GFARM_IS_AUTH_GSI(auth_method)) { e = gfarm_set_global_user_by_gsi(gfm_server); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1000985, "gfarm_set_global_user_by_gsi() failed: %s", gfarm_error_string(e)); return (e); } } gfm_client_connection_free(gfm_server); gfarm_parse_env_client(); if (argvp != NULL) { #if 0 /* not yet in gfarm v2 */ if (getenv("DISPLAY") != NULL) gfarm_debug_initialize((*argvp)[0]); e = gfarm_parse_argv(argcp, argvp); if (e != GFARM_ERR_NO_ERROR) return (e); #endif /* not yet in gfarm v2 */ } #if 0 /* not yet in gfarm v2 */ gfarm_initialized = 1; #endif /* not yet in gfarm v2 */ return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfarm_client_process_set(struct gfs_connection *gfs_server, struct gfm_connection *gfm_server) { gfarm_int32_t key_type; const char *key; size_t key_size; gfarm_pid_t pid; gfarm_error_t e = gfm_client_process_get(gfm_server, &key_type, &key, &key_size, &pid); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1000986, "gfm_client_process_get() failed: %s", gfarm_error_string(e)); return (e); } return (gfs_client_process_set(gfs_server, key_type, key, key_size, pid)); } /* * the following function is for client, * server/daemon process shouldn't call it. * Because this function may read incorrect setting from user specified * $USER or $HOME. */ gfarm_error_t gfarm_terminate(void) { #if 0 /* not yet in gfarm v2 */ gfarm_error_t e; gfs_profile(gfs_display_timers()); if (gf_stdout != NULL) { fflush(stdout); e = gfs_pio_close(gf_stdout); gf_stdout = NULL; if (e != GFARM_ERR_NO_ERROR) return (e); } if (gf_stderr != NULL) { fflush(stderr); e = gfs_pio_close(gf_stderr); gf_stderr = NULL; if (e != GFARM_ERR_NO_ERROR) return (e); } #endif /* not yet in gfarm v2 */ gfarm_free_config_stringlists(); gfs_client_terminate(); gfm_client_terminate(); gflog_terminate(); return (GFARM_ERR_NO_ERROR); } #ifdef CONFIG_TEST main() { gfarm_error_t e; e = gfarm_set_local_user_for_this_local_account(); if (e) { fprintf(stderr, "gfarm_set_local_user_for_this_local_account(): %s\n", e); exit(1); } e = gfarm_config_read(); if (e) { fprintf(stderr, "gfarm_config_read(): %s\n", e); exit(1); } printf("gfarm_spool_root = <%s>\n", gfarm_spool_root); printf("gfarm_spool_server_port = <%d>\n", gfarm_spool_server_port); printf("gfarm_metadb_server_name = <%s>\n", gfarm_metadb_server_name); printf("gfarm_metadb_server_port = <%d>\n", gfarm_metadb_server_name); printf("gfarm_ldap_server_name = <%s>\n", gfarm_ldap_server_name); printf("gfarm_ldap_server_port = <%s>\n", gfarm_ldap_server_port); printf("gfarm_ldap_base_dn = <%s>\n", gfarm_ldap_base_dn); return (0); } #endif gfarm-2.4.1/lib/libgfarm/gfarm/gfs_replica_info.c0000644000000000000000000000605411507222723020400 0ustar rootroot#include #define GFARM_INTERNAL_USE #include #include "gfm_proto.h" #include "gfm_client.h" #include "lookup.h" struct gfm_replica_info_get_closure { int inflags; gfarm_int32_t n; char **hosts; gfarm_uint64_t *gens; gfarm_int32_t *outflags; }; static gfarm_error_t gfm_replica_info_get_request(struct gfm_connection *gfm_server, void *closure) { struct gfm_replica_info_get_closure *c = closure; gfarm_error_t e = gfm_client_replica_info_get_request( gfm_server, c->inflags); if (e != GFARM_ERR_NO_ERROR) gflog_warning(GFARM_MSG_1001384, "replica_info_get request: %s", gfarm_error_string(e)); return (e); } static gfarm_error_t gfm_replica_info_get_result(struct gfm_connection *gfm_server, void *closure) { struct gfm_replica_info_get_closure *c = closure; gfarm_error_t e = gfm_client_replica_info_get_result(gfm_server, &c->n, &c->hosts, &c->gens, &c->outflags); #if 0 /* DEBUG */ if (e != GFARM_ERR_NO_ERROR) gflog_debug(GFARM_MSG_1001385, "replica_info_get result; %s", gfarm_error_string(e)); #endif return (e); } struct gfs_replica_info { gfarm_int32_t n; char **hosts; gfarm_uint64_t *gens; gfarm_int32_t *flags; }; gfarm_error_t gfs_replica_info_by_name(const char *file, int flags, struct gfs_replica_info **replica_infop) { gfarm_error_t e; struct gfs_replica_info *replica_info; struct gfm_replica_info_get_closure closure; GFARM_MALLOC(replica_info); if (replica_info == NULL) return (GFARM_ERR_NO_MEMORY); closure.inflags = flags; e = gfm_inode_op(file, GFARM_FILE_LOOKUP, gfm_replica_info_get_request, gfm_replica_info_get_result, gfm_inode_success_op_connection_free, NULL, &closure); if (e != GFARM_ERR_NO_ERROR) return (e); replica_info->n = closure.n; replica_info->hosts = closure.hosts; replica_info->gens = closure.gens; replica_info->flags = closure.outflags; *replica_infop = replica_info; return (GFARM_ERR_NO_ERROR); } int gfs_replica_info_number(struct gfs_replica_info *ri) { return (ri->n); } const char * gfs_replica_info_nth_host(struct gfs_replica_info *ri, int n) { if (n < 0 || n >= ri->n) return (NULL); return (ri->hosts[n]); } gfarm_uint64_t gfs_replica_info_nth_gen(struct gfs_replica_info *ri, int n) { if (n < 0 || n >= ri->n) return (~(gfarm_uint64_t)0); return (ri->gens[n]); } int gfs_replica_info_nth_is_incomplete(struct gfs_replica_info *ri, int n) { if (n < 0 || n >= ri->n) return (1); return ((ri->flags[n] & GFM_PROTO_REPLICA_FLAG_INCOMPLETE) != 0); } int gfs_replica_info_nth_is_dead_host(struct gfs_replica_info *ri, int n) { if (n < 0 || n >= ri->n) return (1); return ((ri->flags[n] & GFM_PROTO_REPLICA_FLAG_DEAD_HOST) != 0); } int gfs_replica_info_nth_is_dead_copy(struct gfs_replica_info *ri, int n) { if (n < 0 || n >= ri->n) return (1); return ((ri->flags[n] & GFM_PROTO_REPLICA_FLAG_DEAD_COPY) != 0); } void gfs_replica_info_free(struct gfs_replica_info *ri) { int i; for (i = 0; i < ri->n; i++) free(ri->hosts[i]); free(ri->hosts); free(ri->gens); free(ri->flags); free(ri); } gfarm-2.4.1/lib/libgfarm/gfarm/gfs_pio_local.c0000644000000000000000000001646511507222723017716 0ustar rootroot/* * pio operations for local section * * $Id: gfs_pio_local.c 4457 2010-02-23 01:53:23Z ookuma $ */ #include #include #include #include #include /* gfs_client.h needs socklen_t */ #include #include #include #include #include #include #include "gfs_proto.h" /* GFS_PROTO_FSYNC_* */ #include "gfs_client.h" #include "gfs_io.h" #include "gfs_pio.h" #if 0 /* not yet in gfarm v2 */ int gfarm_node = -1; int gfarm_nnode = -1; gfarm_error_t gfs_pio_set_local(int node, int nnode) { if (node < 0 || node >= nnode || nnode < 0) return (GFARM_ERR_INVALID_ARGUMENT); gfarm_node = node; gfarm_nnode = nnode; return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfs_pio_set_local_check(void) { if (gfarm_node < 0 || gfarm_nnode <= 0) return ("gfs_pio_set_local() is not correctly called"); return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfs_pio_get_node_rank(int *node) { gfarm_error_t e = gfs_pio_set_local_check(); if (e != GFARM_ERR_NO_ERROR) return (e); *node = gfarm_node; return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfs_pio_get_node_size(int *nnode) { gfarm_error_t e = gfs_pio_set_local_check(); if (e != GFARM_ERR_NO_ERROR) return (e); *nnode = gfarm_nnode; return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfs_pio_set_view_local(GFS_File gf, int flags) { gfarm_error_t e; char *arch; if (GFS_FILE_IS_PROGRAM(gf)) { e = gfarm_host_get_self_architecture(&arch); if (e != GFARM_ERR_NO_ERROR) return (gf->error = e); return (gfs_pio_set_view_section(gf, arch, NULL, flags)); } e = gfs_pio_set_local_check(); if (e != GFARM_ERR_NO_ERROR) return (gf->error = e); return (gfs_pio_set_view_index(gf, gfarm_nnode, gfarm_node, NULL, flags)); } #endif /* not yet in gfarm v2 */ /***********************************************************************/ static gfarm_error_t gfs_pio_local_storage_close(GFS_File gf) { gfarm_error_t e, e2; struct gfs_file_section_context *vc = gf->view_context; struct gfs_connection *gfs_server = vc->storage_context; if (close(vc->fd) == -1) e = gfarm_errno_to_error(errno); else e = GFARM_ERR_NO_ERROR; /* * Do not close remote file from a child process because its * open file count is not incremented. * XXX - This behavior is not the same as expected, but better * than closing the remote file. */ if (vc->pid != getpid()) { if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001362, "close operation on view context " "file descriptor failed: %s", gfarm_error_string(e)); } return (e); } e2 = gfs_client_close(gfs_server, gf->fd); gfs_client_connection_free(gfs_server); if (e != GFARM_ERR_NO_ERROR || e2 != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001363, "Close operation on local storage failed: %s", gfarm_error_string( e != GFARM_ERR_NO_ERROR ? e : e2)); } return (e != GFARM_ERR_NO_ERROR ? e : e2); } static gfarm_error_t gfs_pio_local_storage_pwrite(GFS_File gf, const char *buffer, size_t size, gfarm_off_t offset, size_t *lengthp) { struct gfs_file_section_context *vc = gf->view_context; #if 0 /* XXX FIXME: pwrite(2) on NetBSD-3.0_BETA is broken */ int rv = pwrite(vc->fd, buffer, offset, size); #else int rv, save_errno; if (lseek(vc->fd, offset, SEEK_SET) == -1) { save_errno = errno; gflog_debug(GFARM_MSG_1001364, "lseek() on view context file descriptor failed: %s", strerror(save_errno)); return (gfarm_errno_to_error(save_errno)); } rv = write(vc->fd, buffer, size); #endif if (rv == -1) { save_errno = errno; gflog_debug(GFARM_MSG_1001365, "write() on view context file descriptor failed: %s", strerror(save_errno)); return (gfarm_errno_to_error(save_errno)); } *lengthp = rv; return (GFARM_ERR_NO_ERROR); } static gfarm_error_t gfs_pio_local_storage_pread(GFS_File gf, char *buffer, size_t size, gfarm_off_t offset, size_t *lengthp) { struct gfs_file_section_context *vc = gf->view_context; #if 0 /* XXX FIXME: pwrite(2) on NetBSD-3.0_BETA is broken */ int rv = pread(vc->fd, buffer, offset, size); #else int rv, save_errno; if (lseek(vc->fd, offset, SEEK_SET) == -1) { save_errno = errno; gflog_debug(GFARM_MSG_1001366, "lseek() on view context file descriptor failed: %s", strerror(save_errno)); return (gfarm_errno_to_error(save_errno)); } rv = read(vc->fd, buffer, size); #endif if (rv == -1) { save_errno = errno; gflog_debug(GFARM_MSG_1001367, "read() on view context file descriptor failed: %s", strerror(save_errno)); return (gfarm_errno_to_error(save_errno)); } *lengthp = rv; return (GFARM_ERR_NO_ERROR); } static gfarm_error_t gfs_pio_local_storage_ftruncate(GFS_File gf, gfarm_off_t length) { struct gfs_file_section_context *vc = gf->view_context; int rv; rv = ftruncate(vc->fd, length); if (rv == -1) { int save_errno = errno; gflog_debug(GFARM_MSG_1001368, "ftruncate() on view context file descriptor " "failed: %s", strerror(save_errno)); return (gfarm_errno_to_error(save_errno)); } return (GFARM_ERR_NO_ERROR); } static gfarm_error_t gfs_pio_local_storage_fsync(GFS_File gf, int operation) { struct gfs_file_section_context *vc = gf->view_context; int rv; switch (operation) { case GFS_PROTO_FSYNC_WITHOUT_METADATA: #ifdef HAVE_FDATASYNC rv = fdatasync(vc->fd); break; #else /*FALLTHROUGH*/ #endif case GFS_PROTO_FSYNC_WITH_METADATA: rv = fsync(vc->fd); break; default: gflog_debug(GFARM_MSG_1001369, "Invalid operation (%d): %s", operation, gfarm_error_string(GFARM_ERR_INVALID_ARGUMENT)); return (GFARM_ERR_INVALID_ARGUMENT); } if (rv == -1) { int save_errno = errno; gflog_debug(GFARM_MSG_1001370, "fsync() or fdatasync() on view context " "file descriptor failed: %s", strerror(save_errno)); return (gfarm_errno_to_error(save_errno)); } return (GFARM_ERR_NO_ERROR); } static gfarm_error_t gfs_pio_local_storage_fstat(GFS_File gf, struct gfs_stat *st) { struct gfs_file_section_context *vc = gf->view_context; struct stat sb; if (fstat(vc->fd, &sb) == 0) { st->st_size = sb.st_size; st->st_atimespec.tv_sec = sb.st_atime; st->st_atimespec.tv_nsec = 0; /* XXX */ st->st_mtimespec.tv_sec = sb.st_mtime; st->st_mtimespec.tv_nsec = 0; /* XXX */ } else { int save_errno = errno; gflog_debug(GFARM_MSG_1001371, "fstat() on view context file descriptor failed : %s", strerror(save_errno)); return (gfarm_errno_to_error(save_errno)); } return (GFARM_ERR_NO_ERROR); } static int gfs_pio_local_storage_fd(GFS_File gf) { struct gfs_file_section_context *vc = gf->view_context; return (vc->fd); } struct gfs_storage_ops gfs_pio_local_storage_ops = { gfs_pio_local_storage_close, gfs_pio_local_storage_fd, gfs_pio_local_storage_pread, gfs_pio_local_storage_pwrite, gfs_pio_local_storage_ftruncate, gfs_pio_local_storage_fsync, gfs_pio_local_storage_fstat, }; gfarm_error_t gfs_pio_open_local_section(GFS_File gf, struct gfs_connection *gfs_server) { struct gfs_file_section_context *vc = gf->view_context; gfarm_error_t e; e = gfs_client_open_local(gfs_server, gf->fd, &vc->fd); if (e != GFARM_ERR_NO_ERROR) { gflog_debug(GFARM_MSG_1001372, "gfs_client_open_local() failed: %s", gfarm_error_string(e)); return (e); } vc->ops = &gfs_pio_local_storage_ops; vc->storage_context = gfs_server; vc->pid = getpid(); return (GFARM_ERR_NO_ERROR); } gfarm-2.4.1/lib/libgfarm/gfarm/gfpath.h0000644000000000000000000000101611507222724016357 0ustar rootroot/* Globus & SSL/TLS related pathnames */ #ifndef GRID_CONF_DIR #define GRID_CONF_DIR "/etc/grid-security" #endif #ifndef GRID_CACERT_DIR #define GRID_CACERT_DIR GRID_CONF_DIR "/certificates" #endif #ifndef GRID_MAPFILE #define GRID_MAPFILE GRID_CONF_DIR "/grid-mapfile" #endif /* Gfarm related pathnames */ #ifndef GFARM_CONFIG #define GFARM_CONFIG "/etc/gfarm2.conf" #endif #ifndef GFARM_CLIENT_RC #define GFARM_CLIENT_RC ".gfarm2rc" #endif #ifndef GFARM_SPOOL_ROOT #define GFARM_SPOOL_ROOT "/var/spool/gfarm" #endif gfarm-2.4.1/lib/libgfarm/gfarm/iobuffer.c0000644000000000000000000002517211507222723016712 0ustar rootroot#include #include #include #include #include #include "iobuffer.h" /* XXX - This implementation is somewhat slow, but probably acceptable */ struct gfarm_iobuffer { char *buffer; int bufsize; int head, tail; int (*read_func)(struct gfarm_iobuffer *, void *, int, void *, int); void *read_cookie; int read_fd; /* for file descriptor i/o */ int (*write_func)(struct gfarm_iobuffer *, void *, int, void *, int); void *write_cookie; int write_fd; /* for file descriptor i/o */ void (*write_close_func)(struct gfarm_iobuffer *, void *, int); int read_eof; /* eof is detected on read side */ int write_eof; /* eof reached on write side */ int error; }; struct gfarm_iobuffer * gfarm_iobuffer_alloc(int bufsize) { struct gfarm_iobuffer *b; GFARM_MALLOC(b); if (b == NULL) { gflog_debug(GFARM_MSG_1000994, "allocation of struct gfarm_iobuffer failed: %s", gfarm_error_string(GFARM_ERR_NO_MEMORY)); return (NULL); } GFARM_MALLOC_ARRAY(b->buffer, bufsize); if (b->buffer == NULL) { free(b); gflog_debug(GFARM_MSG_1000995, "allocation of buffer with size(%d) failed: %s", bufsize, gfarm_error_string(GFARM_ERR_NO_MEMORY)); return (NULL); } b->bufsize = bufsize; b->head = b->tail = 0; b->read_func = NULL; b->read_cookie = NULL; b->read_fd = -1; b->write_func = NULL; b->write_cookie = NULL; b->write_fd = -1; b->write_close_func = gfarm_iobuffer_write_close_nop; b->read_eof = 0; b->write_eof = 0; b->error = 0; return (b); } void gfarm_iobuffer_free(struct gfarm_iobuffer *b) { free(b->buffer); free(b); } int gfarm_iobuffer_get_size(struct gfarm_iobuffer *b) { return (b->bufsize); } void gfarm_iobuffer_set_error(struct gfarm_iobuffer *b, int error) { b->error = error; } int gfarm_iobuffer_get_error(struct gfarm_iobuffer *b) { return (b->error); } void gfarm_iobuffer_set_read(struct gfarm_iobuffer *b, int (*rf)(struct gfarm_iobuffer *, void *, int, void *, int), void *cookie, int fd) { b->read_func = rf; b->read_cookie = cookie; b->read_fd = fd; } void * gfarm_iobuffer_get_read_cookie(struct gfarm_iobuffer *b) { return (b->read_cookie); } int gfarm_iobuffer_get_read_fd(struct gfarm_iobuffer *b) { return (b->read_fd); } void gfarm_iobuffer_set_write_close(struct gfarm_iobuffer *b, void (*wcf)(struct gfarm_iobuffer *, void *, int)) { b->write_close_func = wcf; } void gfarm_iobuffer_set_write(struct gfarm_iobuffer *b, int (*wf)(struct gfarm_iobuffer *, void *, int, void *, int), void *cookie, int fd) { b->write_func = wf; b->write_cookie = cookie; b->write_fd = fd; } void * gfarm_iobuffer_get_write_cookie(struct gfarm_iobuffer *b) { return (b->write_cookie); } int gfarm_iobuffer_get_write_fd(struct gfarm_iobuffer *b) { return (b->write_fd); } /* * gfarm_iobuffer_empty(b) is a synonym of: * gfarm_iobuffer_avail_length(b) == 0 */ #define IOBUFFER_IS_EMPTY(b) ((b)->head >= (b)->tail) int gfarm_iobuffer_empty(struct gfarm_iobuffer *b) { return (IOBUFFER_IS_EMPTY(b)); } #define IOBUFFER_IS_FULL(b) ((b)->head <= 0 && (b)->tail >= (b)->bufsize) int gfarm_iobuffer_full(struct gfarm_iobuffer *b) { return (IOBUFFER_IS_FULL(b)); } #define IOBUFFER_AVAIL_LENGTH(b) ((b)->tail - (b)->head) int gfarm_iobuffer_avail_length(struct gfarm_iobuffer *b) { return (IOBUFFER_AVAIL_LENGTH(b)); } void gfarm_iobuffer_set_read_eof(struct gfarm_iobuffer *b) { b->read_eof = 1; } void gfarm_iobuffer_clear_read_eof(struct gfarm_iobuffer *b) { b->read_eof = 0; } int gfarm_iobuffer_is_read_eof(struct gfarm_iobuffer *b) { return (b->read_eof); } void gfarm_iobuffer_clear_write_eof(struct gfarm_iobuffer *b) { b->write_eof = 0; } int gfarm_iobuffer_is_write_eof(struct gfarm_iobuffer *b) { return (b->write_eof); } int gfarm_iobuffer_is_readable(struct gfarm_iobuffer *b) { return (!IOBUFFER_IS_FULL(b) && !b->read_eof); } int gfarm_iobuffer_is_writable(struct gfarm_iobuffer *b) { return (!IOBUFFER_IS_EMPTY(b) || (b->read_eof && !b->write_eof)); } /* * gfarm_iobuffer_is_eof(b) is a synonym of: * gfarm_iobuffer_empty(b) && gfarm_iobuffer_is_read_eof(b) */ int gfarm_iobuffer_is_eof(struct gfarm_iobuffer *b) { /* * note that gfarm_iobuffer_is_writable(b) may be TRUE here, * if gfarm_iobuffer_is_write_eof(b) is not TRUE yet. */ return (IOBUFFER_IS_EMPTY(b) && b->read_eof); } void gfarm_iobuffer_read(struct gfarm_iobuffer *b, int *residualp) { int space, rv; if (IOBUFFER_IS_FULL(b)) return; space = b->head + (b->bufsize - b->tail); if (residualp == NULL) /* unlimited */ residualp = &space; if (*residualp <= 0) return; if (*residualp > b->bufsize - b->tail && b->head > 0) { memmove(b->buffer, b->buffer + b->head, IOBUFFER_AVAIL_LENGTH(b)); b->tail -= b->head; b->head = 0; } rv = (*b->read_func)(b, b->read_cookie, b->read_fd, b->buffer + b->tail, *residualp < space ? *residualp : space); if (rv == 0) { b->read_eof = 1; } else if (rv > 0) { b->tail += rv; *residualp -= rv; } return; } int gfarm_iobuffer_put(struct gfarm_iobuffer *b, const void *data, int len) { int space, iolen; if (len <= 0) return (0); if (IOBUFFER_IS_FULL(b)) return (0); space = b->head + (b->bufsize - b->tail); if (len > b->bufsize - b->tail && b->head > 0) { memmove(b->buffer, b->buffer + b->head, IOBUFFER_AVAIL_LENGTH(b)); b->tail -= b->head; b->head = 0; } iolen = len < space ? len : space; memcpy(b->buffer + b->tail, data, iolen); b->tail += iolen; return (iolen); } static void gfarm_iobuffer_write_close(struct gfarm_iobuffer *b) { (*b->write_close_func)(b, b->write_cookie, b->write_fd); b->write_eof = 1; } void gfarm_iobuffer_write(struct gfarm_iobuffer *b, int *residualp) { int avail, rv; if (IOBUFFER_IS_EMPTY(b)) { if (b->read_eof) gfarm_iobuffer_write_close(b); return; } avail = IOBUFFER_AVAIL_LENGTH(b); if (residualp == NULL) /* unlimited */ residualp = &avail; if (*residualp <= 0) return; rv = (*b->write_func)(b, b->write_cookie, b->write_fd, b->buffer + b->head, *residualp < avail ? *residualp : avail); if (rv > 0) { b->head += rv; *residualp -= rv; if (IOBUFFER_IS_EMPTY(b)) { b->head = b->tail = 0; /* * We don't do the following here: * if (b->read_eof) * gfarm_iobuffer_write_close(b); * To make sure to produce the following condition * at the EOF: * gfarm_iobuffer_is_writable(b) && * gfarm_iobuffer_empty(b) * i.e. * gfarm_iobuffer_is_eof(b) && * !gfarm_iobuffer_is_write_eof(b) */ } } return; } int gfarm_iobuffer_purge(struct gfarm_iobuffer *b, int *residualp) { int avail, purgelen; if (IOBUFFER_IS_EMPTY(b)) { if (b->read_eof) gfarm_iobuffer_write_close(b); return (0); } avail = IOBUFFER_AVAIL_LENGTH(b); if (residualp == NULL) /* unlimited */ residualp = &avail; if (*residualp <= 0) return (0); purgelen = *residualp < avail ? *residualp : avail; b->head += purgelen; *residualp -= purgelen; if (IOBUFFER_IS_EMPTY(b)) { b->head = b->tail = 0; /* * We don't do the following here: * if (b->read_eof) * gfarm_iobuffer_write_close(b); * To make sure to produce the following condition * at the EOF: * gfarm_iobuffer_is_writable(b) && * gfarm_iobuffer_empty(b) * i.e. * gfarm_iobuffer_is_eof(b) && * !gfarm_iobuffer_is_write_eof(b) */ } return (purgelen); } int gfarm_iobuffer_get(struct gfarm_iobuffer *b, void *data, int len) { int avail, iolen; if (IOBUFFER_IS_EMPTY(b)) { if (b->read_eof) gfarm_iobuffer_write_close(b); return (0); } if (len <= 0) return (0); avail = IOBUFFER_AVAIL_LENGTH(b); iolen = len < avail ? len : avail; memcpy(data, b->buffer + b->head, iolen); b->head += iolen; if (IOBUFFER_IS_EMPTY(b)) { b->head = b->tail = 0; /* * We don't do the following here: * if (b->read_eof) * gfarm_iobuffer_write_close(b); * To make sure to produce the following condition * at the EOF: * gfarm_iobuffer_is_writable(b) && * gfarm_iobuffer_empty(b) * i.e. * gfarm_iobuffer_is_eof(b) && * !gfarm_iobuffer_is_write_eof(b) */ } return (iolen); } void gfarm_iobuffer_flush_write(struct gfarm_iobuffer *b) { while (!IOBUFFER_IS_EMPTY(b) && b->error == 0) gfarm_iobuffer_write(b, NULL); } int gfarm_iobuffer_put_write(struct gfarm_iobuffer *b, const void *data, int len) { const char *p; int rv, residual; for (p = data, residual = len; residual > 0; residual -= rv, p += rv) { if (IOBUFFER_IS_FULL(b)) gfarm_iobuffer_write(b, NULL); rv = gfarm_iobuffer_put(b, p, residual); if (rv == 0) /* error */ break; } if (IOBUFFER_IS_FULL(b)) gfarm_iobuffer_write(b, NULL); return (len - residual); } int gfarm_iobuffer_purge_read_x(struct gfarm_iobuffer *b, int len, int just) { int rv, residual, tmp, *justp = just ? &tmp : NULL; for (residual = len; residual > 0; ) { if (IOBUFFER_IS_EMPTY(b)) { tmp = residual; gfarm_iobuffer_read(b, justp); } rv = gfarm_iobuffer_purge(b, &residual); if (rv == 0) /* EOF or error */ break; } return (len - residual); } int gfarm_iobuffer_get_read_x(struct gfarm_iobuffer *b, void *data, int len, int just) { char *p; int rv, residual, tmp, *justp = just ? &tmp : NULL; for (p = data, residual = len; residual > 0; residual -= rv, p += rv) { if (IOBUFFER_IS_EMPTY(b)) { tmp = residual; gfarm_iobuffer_read(b, justp); } rv = gfarm_iobuffer_get(b, p, residual); if (rv == 0) /* EOF or error */ break; } return (len - residual); } int gfarm_iobuffer_get_read_just(struct gfarm_iobuffer *b, void *data, int len) { return (gfarm_iobuffer_get_read_x(b, data, len, 1)); } int gfarm_iobuffer_get_read(struct gfarm_iobuffer *b, void *data, int len) { return (gfarm_iobuffer_get_read_x(b, data, len, 0)); } /* * gfarm_iobuffer_get_read*() wait until desired length of data is * received. * gfarm_iobuffer_get_read_partial*() don't wait like that, but return * the contents of current buffer or the result of (*b->read_func) * if current buffer is empty. */ int gfarm_iobuffer_get_read_partial_x(struct gfarm_iobuffer *b, void *data, int len, int just) { if (IOBUFFER_IS_EMPTY(b)) { int tmp = len; gfarm_iobuffer_read(b, just ? &tmp : NULL); } return (gfarm_iobuffer_get(b, data, len)); } int gfarm_iobuffer_get_read_partial_just(struct gfarm_iobuffer *b, void *data, int len) { return (gfarm_iobuffer_get_read_partial_x(b, data, len, 1)); } int gfarm_iobuffer_get_read_partial(struct gfarm_iobuffer *b, void *data, int len) { return (gfarm_iobuffer_get_read_partial_x(b, data, len, 0)); } /* * default operation for gfarm_iobuffer_set_write_close(): * do nothing at eof on writer side */ void gfarm_iobuffer_write_close_nop(struct gfarm_iobuffer *b, void *cookie, int fd) { /* nop */ } gfarm-2.4.1/regress/0000755000000000000000000000000011507222730012761 5ustar rootrootgfarm-2.4.1/regress/data/0000755000000000000000000000000011507222730013672 5ustar rootrootgfarm-2.4.1/regress/data/1byte0000644000000000000000000000000111507222725014634 0ustar rootrootAgfarm-2.4.1/regress/data/0byte0000644000000000000000000000000011507222725014632 0ustar rootrootgfarm-2.4.1/regress/bin/0000755000000000000000000000000011507222730013531 5ustar rootrootgfarm-2.4.1/regress/bin/am_I_gfarmroot0000755000000000000000000000011011507222725016400 0ustar rootroot#!/bin/sh gfgroup -l gfarmroot | egrep " `gfwhoami`"'( |$)' >/dev/null gfarm-2.4.1/regress/bin/am_I_gfarmadm0000755000000000000000000000010711507222725016164 0ustar rootroot#!/bin/sh gfgroup -l gfarmadm | egrep " `gfwhoami`"'( |$)' >/dev/null gfarm-2.4.1/regress/tst.sh0000755000000000000000000000036011507222725014135 0ustar rootroot#!/bin/sh log=log for tst do msg="`echo $tst | awk '{printf "%-50.50s ... ", $1}'`" sh $tst >>$log 2>&1 exit_code=$? case $exit_code in 0) echo "$msg PASS";; 1) echo "$msg FAIL";; *) echo "$msg exit code = $exit_code";; esac done gfarm-2.4.1/regress/regress.sh0000755000000000000000000000566511507222725015012 0ustar rootroot#!/bin/sh . ./regress.conf # constants account_bgfmt="--- %-60.60s %s\n" account_lgfmt="@:= %-60.60s %s\n" account_fmt="%-60.60s ... " account_fin="--- ------------------------------------------------------------ ----" log=log rm -f $log case $# in 0) schedule=$regress/schedule;; *) schedule=$*;; esac n_pass=0 n_fail=0 n_xpass=0 n_xfail=0 n_unresolved=0 n_untested=0 n_unsupported=0 n_trap=0 while read line; do set x $line shift case $# in 0) continue;; esac case $1 in '#'*) continue;; esac tst=$1 printf -- "$account_fmt" "$tst" printf -- "$account_bgfmt" "$tst" "BEGIN" >>$log date +'@@_ start at %s - %Y-%m-%d %H:%M:%S' >>$log if [ -x $regress/$tst ]; then sh $regress/$tst >>$log 2>&1 exit_code=$? case $exit_code in $exit_pass) echo "PASS" printf -- "$account_lgfmt" "$tst" "PASS" >>$log n_pass=`expr $n_pass + 1`;; $exit_fail) echo "FAIL" printf -- "$account_lgfmt" "$tst" "FAIL" >>$log n_fail=`expr $n_fail + 1`;; $exit_xpass) echo "XPASS" printf -- "$account_lgfmt" "$tst" "XPASS" >>$log n_xpass=`expr $n_xpass + 1`;; $exit_xfail) echo "XFAIL" printf -- "$account_lgfmt" "$tst" "XFAIL" >>$log n_xfail=`expr $n_xfail + 1`;; $exit_unresolved) echo "UNRESOLVED" printf -- "$account_lgfmt" "$tst" "UNRESOLVED" >>$log n_unresolved=`expr $n_unresolved + 1`;; $exit_untested) echo "UNTESTED" printf -- "$account_lgfmt" "$tst" "UNTESTED" >>$log n_untested=`expr $n_untested + 1`;; $exit_unsupported) echo "UNSUPPORTED" printf -- "$account_lgfmt" "$tst" "UNSUPPORTED" >>$log n_unsupported=`expr $n_unsupported + 1`;; $exit_trap) echo "KILLED" printf -- "$account_lgfmt" "$tst" "KILLED" >>$log n_trap=`expr $n_trap + 1` break;; *) echo "exit($exit_code)" printf -- "$account_lgfmt" "$tst" "exit($exit_code)" >>$log n_trap=`expr $n_trap + 1` break;; esac else echo "SKIPPED" printf -- "$account_lgfmt" "$tst" "SKIPPED" >>$log n_untested=`expr $n_untested + 1` fi date +'@@~ end at %s - %Y-%m-%d %H:%M:%S' >>$log echo $account_fin >>$log done < $schedule echo "" echo "Total test: `expr $n_pass + $n_fail`" echo " success : $n_pass" echo " failure : $n_fail" if [ $n_xpass -gt 0 ]; then echo " unexpected success : $n_xpass" fi if [ $n_xfail -gt 0 ]; then echo " expected failure : $n_xfail" fi if [ $n_unresolved -gt 0 ]; then echo " unresolved : $n_unresolved" fi if [ $n_untested -gt 0 ]; then echo " untested : $n_untested" fi if [ $n_unsupported -gt 0 ]; then echo " unsupported : $n_unsupported" fi case $n_trap in 0) :;; *) exit $exit_trap;; esac [ $n_fail -eq 0 -a $n_unresolved -eq 0 ] gfarm-2.4.1/regress/regress.conf0000644000000000000000000000232411507222725015307 0ustar rootroot# unset environtment variables defined by the make command, # because these may make some tests fail. unset MAKEFLAGS MFLAGS # exit code exit_pass=0 exit_fail=1 exit_trap=2 exit_xpass=2 # passed, but it's unexpected. fixed recently? exit_xfail=3 # failed, but it's expected. i.e. known bug. exit_unresolved=4 # cannot determine whether (X)?PASS or (X)?FAIL exit_untested=5 # not tested, this test haven't written yet. exit_unsupported=6 # not tested, this environment can't test this. exit_trap=7 # killed by Control-C or something exit_code=$exit_fail if [ -x /usr/bin/nawk ]; then awk=nawk else awk=awk fi # regress framework directories : ${regress:=.} data=$regress/data testbase=`dirname $0` localtop=/tmp localtmp=${localtop}/RT$$ if [ X"$regress" = X"." ]; then testbin=$testbase else testbin=`$awk 'BEGIN { regress="'"$regress"'" testbase="'"$testbase"'" if (substr(testbase, 1, length(regress)) == regress) print substr(testbase, length(regress) + 2) else print testbase # XXX? exit 0 }'` fi # work directory on gfarm filesystem gftop=/tmp gftmp=$gftop/`hostname`."`echo $0 | sed s:/:_:g`".$$ case ${GFARM_TEST_DEBUG+set} in set) shell="$shell -x";; esac # miscellaneous trap_sigs='1 2 15' gfarm-2.4.1/regress/Makefile0000644000000000000000000000155511507222725014433 0ustar rootroottop_builddir = .. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk LOG= log CHECK_ENV= LANG=C PATH=$(prefix)/bin:$$PATH # subdirectories which have to be built SUBDIRS= \ lib/libgfarm/gfarm/gfarm_error_range_alloc \ lib/libgfarm/gfarm/gfarm_error_to_errno \ lib/libgfarm/gfarm/gfs_pio_test \ lib/libgfarm/gfarm/gfs_replicate_file_from_to_request/file_busy \ lib/libgfarm/gfarm/gfs_replicate_file_from_to_request/in_progress \ lib/libgfarm/gfarm/gfs_xattr \ lib/libgfarm/gfarm/gfs_getxattr_cached check test: all @echo "" @$(CHECK_ENV) $(srcdir)/regress.sh @echo "" loop: all @./loop.sh all: config config: test -f Makefile || \ ( \ echo "regress=$(srcdir)"; \ echo ". $(srcdir)/regress.conf"; \ ) > regress.conf distclean: -$(RM) -f $(LOG) -test -f Makefile || $(RM) -f regress.conf include $(top_srcdir)/makes/subdir.mk gfarm-2.4.1/regress/loop.sh0000755000000000000000000000065611507222725014304 0ustar rootroot#!/bin/sh . ./regress.conf loop=1 fail=0 while :; do echo "############## loop = $loop (fail = $fail) #################" ./regress.sh exit_code=$? case $exit_code in $exit_pass) :;; $exit_fail) echo "FAILURE @ loop $loop" mv log log.$loop fail=`expr $fail + 1`;; $exit_trap) exit $exit_code;; *) echo "`basename $0`: unknown exit code $exit_code" >&2 exit $exit_code;; esac loop=`expr $loop + 1` done gfarm-2.4.1/regress/lib/0000755000000000000000000000000011507222730013527 5ustar rootrootgfarm-2.4.1/regress/lib/libgfarm/0000755000000000000000000000000011507222730015312 5ustar rootrootgfarm-2.4.1/regress/lib/libgfarm/gfarm/0000755000000000000000000000000011507222730016406 5ustar rootrootgfarm-2.4.1/regress/lib/libgfarm/gfarm/gfs_xattr/0000755000000000000000000000000011507222730020407 5ustar rootrootgfarm-2.4.1/regress/lib/libgfarm/gfarm/gfs_xattr/gfs_listxattr.2err.sh0000755000000000000000000000020611507222725024516 0ustar rootroot#!/bin/sh . ./regress.conf if $testbin/gfxattr -l /.not/.exist /.not/.exist then : else exit_code=$exit_pass fi exit $exit_code gfarm-2.4.1/regress/lib/libgfarm/gfarm/gfs_xattr/gfxattr.c0000644000000000000000000001500011507222725022232 0ustar rootroot/* * Copyright (c) 2009 National Institute of Informatics in Japan. * All rights reserved. */ /* * $Id$ */ #include #include #include #include #include #include #include #include #include #include #include #include "gfutil.h" #define DEFAULT_ALLOC_SIZE (64 * 1024) static gfarm_error_t set_xattr(int xmlMode, char *path, char *xattrname, char *filename, int flags) { const size_t count = 65536; ssize_t sz; size_t buf_sz, msg_sz = 0; char *buf = NULL, *tbuf; gfarm_error_t e; int fd, need_close = 0; int overflow; if (filename != NULL) { fd = open(filename, O_RDONLY); need_close = 1; } else fd = STDIN_FILENO; if (fd == -1) { if (filename != NULL) fprintf(stderr, "%s: %s\n", filename, strerror(errno)); return (gfarm_errno_to_error(errno)); } buf_sz = count; overflow = 0; buf_sz = gfarm_size_add(&overflow, buf_sz, 1); if (!overflow) buf = malloc(buf_sz); if (buf == NULL) return (GFARM_ERR_NO_MEMORY); while ((sz = read(fd, buf + msg_sz, count)) > 0) { msg_sz += sz; buf_sz = gfarm_size_add(&overflow, buf_sz, count); if (!overflow) tbuf = realloc(buf, buf_sz); if (overflow || (tbuf == NULL)) { e = GFARM_ERR_NO_MEMORY; goto free_buf; } buf = tbuf; } buf[msg_sz] = '\0'; if (need_close) close(fd); if (xmlMode) { e = gfs_setxmlattr(path, xattrname, buf, msg_sz + 1, flags); } else { e = gfs_setxattr(path, xattrname, buf, msg_sz, flags); } free_buf: free(buf); return (e); } static gfarm_error_t get_xattr_alloc(int xmlMode, char *path, char *xattrname, void **valuep, size_t *size) { gfarm_error_t e; void *value; value = malloc(*size); if (value == NULL) return GFARM_ERR_NO_ERROR; if (xmlMode) e = gfs_getxmlattr(path, xattrname, value, size); else e = gfs_getxattr(path, xattrname, value, size); if (e == GFARM_ERR_NO_ERROR) *valuep = value; else free(value); return e; } static gfarm_error_t get_xattr(int xmlMode, char *path, char *xattrname, char *filename) { gfarm_error_t e; FILE *f; int need_close = 0; void *value = NULL; size_t size, wsize; size = DEFAULT_ALLOC_SIZE; e = get_xattr_alloc(xmlMode, path, xattrname, &value, &size); if (e == GFARM_ERR_RESULT_OUT_OF_RANGE) { e = get_xattr_alloc(xmlMode, path, xattrname, &value, &size); } if (e != GFARM_ERR_NO_ERROR) return (e); if (filename != NULL) { f = fopen(filename, "w"); need_close = 1; } else f = stdout; if (f == NULL) { free(value); if (filename != NULL) fprintf(stderr, "%s: %s\n", filename, strerror(errno)); return (gfarm_errno_to_error(errno)); } wsize = fwrite(value, 1, size, f); if (wsize != size) { perror("fwrite"); } fflush(f); if (need_close) fclose(f); free(value); return (e); } static gfarm_error_t remove_xattr(int xmlMode, char *path, char *xattrname) { gfarm_error_t e; if (xmlMode) { e = gfs_removexmlattr(path, xattrname); } else { e = gfs_removexattr(path, xattrname); } return (e); } static gfarm_error_t list_xattr_alloc(int xmlMode, char *path, char **listp, size_t *size) { gfarm_error_t e; char *list; list = malloc(*size); if (list == NULL) return GFARM_ERR_NO_MEMORY; if (xmlMode) e = gfs_listxmlattr(path, list, size); else e = gfs_listxattr(path, list, size); if (e == GFARM_ERR_NO_ERROR) *listp = list; else free(list); return e; } static gfarm_error_t list_xattr(int xmlMode, char *path) { gfarm_error_t e; char *list = NULL, *base, *p, *last; size_t size; size = DEFAULT_ALLOC_SIZE; e = list_xattr_alloc(xmlMode, path, &list, &size); if (e == GFARM_ERR_RESULT_OUT_OF_RANGE) { e = list_xattr_alloc(xmlMode, path, &list, &size); } if (e != GFARM_ERR_NO_ERROR) return e; base = list; last = base + size; while ((base < last) && ((p = strchr(base, '\0')) != NULL)) { printf("%s\n", base); base = p + 1; } free(list); return (e); } void usage(char *prog_name) { fprintf(stderr, "Usage: %s [ -s | -g | -r | -l ]" #ifdef ENABLE_XMLATTR " [ -x ]" #endif " [ -c | -m ]" " [ -f xattrfile] [-n xattrname] path...\n", prog_name); fprintf(stderr, "\t-s\tset extended attribute\n"); fprintf(stderr, "\t-g\tget extended attribute\n"); fprintf(stderr, "\t-r\tremove extended attribute\n"); fprintf(stderr, "\t-l\tlist extended attribute\n"); #ifdef ENABLE_XMLATTR fprintf(stderr, "\t-x\thandle XML extended attribute\n"); #endif fprintf(stderr, "\t-c\tfail if xattrname already exists (use with -s)\n"); fprintf(stderr, "\t-m\tfail if xattrname does not exist (use with -s)\n"); exit(2); } /* * */ int main(int argc, char *argv[]) { char *prog_name = basename(argv[0]); char *filename = NULL, *c_path = NULL, *xattrname = NULL; enum { NONE, SET_MODE, GET_MODE, REMOVE_MODE, LIST_MODE } mode = NONE; int c, i, xmlMode = 0, flags = 0, ret = 0; gfarm_error_t e; const char *opts = "f:n:gsrlcmh?" #ifdef ENABLE_XMLATTR "x" #endif ; while ((c = getopt(argc, argv, opts)) != -1) { switch (c) { case 'f': filename = optarg; break; case 'n': xattrname = optarg; break; #ifdef ENABLE_XMLATTR case 'x': xmlMode = 1; break; #endif case 'g': mode = GET_MODE; break; case 's': mode = SET_MODE; break; case 'r': mode = REMOVE_MODE; break; case 'l': mode = LIST_MODE; break; case 'c': if (flags == 0) flags = GFS_XATTR_CREATE; else usage(prog_name); break; case 'm': if (flags == 0) flags = GFS_XATTR_REPLACE; else usage(prog_name); break; case 'h': case '?': default: usage(prog_name); } } argc -= optind; argv += optind; if (argc < 1 || mode == NONE) usage(prog_name); e = gfarm_initialize(&argc, &argv); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", prog_name, gfarm_error_string(e)); exit(1); } if (mode != LIST_MODE && xattrname == NULL) usage(prog_name); for (i = 0; i < argc; i++) { c_path = argv[i]; switch (mode) { case SET_MODE: e = set_xattr(xmlMode, c_path, xattrname, filename, flags); break; case GET_MODE: e = get_xattr(xmlMode, c_path, xattrname, filename); break; case REMOVE_MODE: e = remove_xattr(xmlMode, c_path, xattrname); break; case LIST_MODE: e = list_xattr(xmlMode, c_path); break; default: usage(prog_name); } if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", c_path, gfarm_error_string(e)); ret = 1; } } e = gfarm_terminate(); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", prog_name, gfarm_error_string(e)); exit(1); } exit(ret); } gfarm-2.4.1/regress/lib/libgfarm/gfarm/gfs_xattr/Makefile0000644000000000000000000000062611507222725022057 0ustar rootroottop_builddir = ../../../../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk PROGRAM = gfxattr SRCS = $(PROGRAM).c OBJS = $(PROGRAM).o CFLAGS = $(COMMON_CFLAGS) -I$(GFUTIL_SRCDIR) -I$(GFARMLIB_SRCDIR) $(openssl_includes) LDLIBS = $(COMMON_LDLIBS) $(GFARMLIB) $(LIBS) DEPLIBS = $(DEPGFARMLIB) all: $(PROGRAM) include $(top_srcdir)/makes/prog.mk ### $(OBJS): $(DEPGFARMINC) gfarm-2.4.1/regress/lib/libgfarm/gfarm/gfs_xattr/gfs_setxattr.2err.sh0000755000000000000000000000024011507222725024334 0ustar rootroot#!/bin/sh . ./regress.conf if $testbin/gfxattr -s -n gfarm.ncopy /.not/.exist /.not/.exist #include #include #include #include char *program_name = "size0"; void usage(void) { fprintf(stderr, "Usage: %s \n", program_name); exit(2); } int main(int argc, char **argv) { int c, do_caching = 0; char *path, *xattr; size_t sz0, sz1, sz2; gfarm_error_t e; if (argc > 0) program_name = basename(argv[0]); e = gfarm_initialize(&argc, &argv); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "gfarm_initialize: %s\n", gfarm_error_string(e)); return (1); } while ((c = getopt(argc, argv, "c")) != -1) { switch (c) { case 'c': do_caching = 1; break; default: fprintf(stderr, "%s: unknown option -%c\n", program_name, c); usage(); } } argc -= optind; argv += optind; if (argc != 2) usage(); path = argv[0]; xattr = argv[1]; if (do_caching) { if (!gfarm_xattr_caching(xattr)) gfarm_xattr_caching_pattern_add(xattr); } sz0 = 0; e = gfs_getxattr(path, xattr, NULL, &sz0); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "gfs_getxattr(\"%s\", \"%s\", , &0): %s\n", path, xattr, gfarm_error_string(e)); return (EXIT_FAILURE); } sz1 = 0; e = gfs_getxattr_caching(path, xattr, NULL, &sz1); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "gfs_getxattr_caching(\"%s\", \"%s\", , &0): %s\n", path, xattr, gfarm_error_string(e)); return (EXIT_FAILURE); } sz2 = 0; e = gfs_getxattr_cached(path, xattr, NULL, &sz2); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "gfs_getxattr_cached(\"%s\", \"%s\", , &0): %s\n", path, xattr, gfarm_error_string(e)); return (EXIT_FAILURE); } if (sz0 != sz1 || sz0 != sz2) { fprintf(stderr, "path %s, xattr %s: size mismatch %d vs %d vs %d vs %d\n", path, xattr, (int)sz0, (int)sz1, (int)sz2); return (EXIT_FAILURE); } printf("path %s, xattr %s: size %d\n", path, xattr, sz0); e = gfarm_terminate(); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "gfarm_terminate: %s\n", gfarm_error_string(e)); return (4); } return (0); } gfarm-2.4.1/regress/lib/libgfarm/gfarm/gfs_getxattr_cached/Makefile0000644000000000000000000000062411507222725024044 0ustar rootroottop_builddir = ../../../../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk PROGRAM = size0 SRCS = $(PROGRAM).c OBJS = $(PROGRAM).o CFLAGS = $(COMMON_CFLAGS) -I$(GFUTIL_SRCDIR) -I$(GFARMLIB_SRCDIR) $(openssl_includes) LDLIBS = $(COMMON_LDLIBS) $(GFARMLIB) $(LIBS) DEPLIBS = $(DEPGFARMLIB) all: $(PROGRAM) include $(top_srcdir)/makes/prog.mk ### $(OBJS): $(DEPGFARMINC) gfarm-2.4.1/regress/lib/libgfarm/gfarm/gfs_pio_create/0000755000000000000000000000000011507222730021357 5ustar rootrootgfarm-2.4.1/regress/lib/libgfarm/gfarm/gfs_pio_create/not_writable.sh0000755000000000000000000000075011507222725024415 0ustar rootroot#!/bin/sh . ./regress.conf gfs_pio_test=$testbin/../gfs_pio_test/gfs_pio_test if $regress/bin/am_I_gfarmroot; then exit $exit_unsupported fi trap 'gfrm -f $gftmp; rm -f $localtmp; exit $exit_trap' $trap_sigs if $gfs_pio_test -cwtm 0444 $gftmp then if $gfs_pio_test $* -ctm 0444 $gftmp 2>$localtmp; then : elif [ $? -eq 2 ] && echo "gfs_pio_create: permission denied" | cmp - $localtmp then exit_code=$exit_pass fi fi gfrm $gftmp rm -f $localtmp exit $exit_code gfarm-2.4.1/regress/lib/libgfarm/gfarm/gfs_pio_create/autoreplica.sh0000755000000000000000000000076611507222725024243 0ustar rootroot#!/bin/sh . ./regress.conf [ `gfsched -w | wc -l` -ge 2 ] || exit $exit_unsupported WAIT_TIME=1 gfs_pio_test=$testbin/../gfs_pio_test/gfs_pio_test tmpf=$gftmp/foo trap 'gfrm -f $tmpf; gfrmdir $gftmp; exit $exit_trap' $trap_sigs if gfmkdir $gftmp && echo 2 | gfxattr -s $gftmp gfarm.ncopy && echo 123456789 | $gfs_pio_test -c -w -W10 $tmpf && sleep $WAIT_TIME && [ `gfstat $tmpf | awk '/Ncopy/{print $NF}'` -eq 2 ] then exit_code=$exit_pass fi gfrm $tmpf gfrmdir $gftmp exit $exit_code gfarm-2.4.1/regress/lib/libgfarm/gfarm/gfs_pio_create/not_writable_rdonly.sh0000755000000000000000000000007411507222725026003 0ustar rootroot#!/bin/sh . ./regress.conf $testbase/not_writable.sh -r gfarm-2.4.1/regress/lib/libgfarm/gfarm/gfs_pio_create/autoreplica0.sh0000755000000000000000000000057011507222725024314 0ustar rootroot#!/bin/sh . ./regress.conf gfs_pio_test=$testbin/../gfs_pio_test/gfs_pio_test tmpf=$gftmp/foo trap 'gfrm -f $tmpf; gfrmdir $gftmp; exit $exit_trap' $trap_sigs # test against newly created 0 byte file if gfmkdir $gftmp && echo 2 | gfxattr -s $gftmp gfarm.ncopy && $gfs_pio_test -c -w -t $tmpf then exit_code=$exit_pass fi gfrm $tmpf gfrmdir $gftmp exit $exit_code gfarm-2.4.1/regress/lib/libgfarm/gfarm/gfs_pio_create/normal.sh0000755000000000000000000000034111507222725023210 0ustar rootroot#!/bin/sh . ./regress.conf gfs_pio_test=$testbin/../gfs_pio_test/gfs_pio_test trap 'gfrm -f $gftmp; exit $exit_trap' $trap_sigs if $gfs_pio_test -c -w -t $gftmp; then exit_code=$exit_pass fi gfrm $gftmp exit $exit_code gfarm-2.4.1/regress/lib/libgfarm/gfarm/gfarm_error_to_errno/0000755000000000000000000000000011507222730022622 5ustar rootrootgfarm-2.4.1/regress/lib/libgfarm/gfarm/gfarm_error_to_errno/Makefile0000644000000000000000000000056111507222725024270 0ustar rootroottop_builddir = ../../../../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk PROGRAM = all_errno SRCS = $(PROGRAM).c OBJS = $(PROGRAM).o CFLAGS = $(COMMON_CFLAGS) -I$(GFARMLIB_SRCDIR) LDLIBS = $(COMMON_LDLIBS) $(GFARMLIB) $(LIBS) DEPLIBS = $(DEPGFARMLIB) all: $(PROGRAM) include $(top_srcdir)/makes/prog.mk ### $(OBJS): $(DEPGFARMINC) gfarm-2.4.1/regress/lib/libgfarm/gfarm/gfarm_error_to_errno/all_mapped.sh0000755000000000000000000000025111507222725025261 0ustar rootroot#!/bin/sh . ./regress.conf trap '$exit_trap' $trap_sigs if $testbin/all_errno | awk '$1 != 0 && $2 == 0 { exit 1 }' then exit_code=$exit_pass fi exit $exit_code gfarm-2.4.1/regress/lib/libgfarm/gfarm/gfarm_error_to_errno/all_errno.c0000644000000000000000000000126011507222725024746 0ustar rootroot#include #include #include #include #include "liberror.h" void msg(gfarm_error_t e) { int eno = gfarm_error_to_errno(e); printf("%3d %10d %s\n", e, eno, strerror(eno)); } int main(int argc, char **argv) { gfarm_error_t e; e = gfarm_initialize(NULL, NULL); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "initialize: %s\n", gfarm_error_string(e)); return (2); } for (e = GFARM_ERR_NO_ERROR; e < GFARM_ERR_NUMBER; e++) msg(e); msg(GFARM_ERR_NUMBER); msg(GFARM_ERR_NUMBER + 1); msg(GFARM_ERRMSG_BEGIN - 1); for (e = GFARM_ERRMSG_BEGIN; e < GFARM_ERRMSG_END; e++) msg(e); msg(GFARM_ERRMSG_END + 1); return (0); } gfarm-2.4.1/regress/lib/libgfarm/gfarm/gfs_pio_test/0000755000000000000000000000000011507222730021073 5ustar rootrootgfarm-2.4.1/regress/lib/libgfarm/gfarm/gfs_pio_test/gfs_pio_test.c0000644000000000000000000001405011507222725023730 0ustar rootroot#include #include #include #include #include #include #define EXIT_USAGE 250 char *program_name = "gfs_pio"; #define OP_READ 'R' #define OP_WRITE 'W' #define OP_SEEK_SET 'S' #define OP_SEEK_CUR 'C' #define OP_SEEK_END 'E' #define OP_TRUNCATE 'T' #define OP_FLUSH 'F' #define OP_SYNC 'M' #define OP_DATASYNC 'D' struct op { unsigned char op; gfarm_off_t off; /* for O_READ, OP_WRITE, OP_SEEK_*, OP_TRUNCATE */ }; #define MAX_OPS 1024 struct op ops[MAX_OPS]; int nops = 0; void usage(void) { fprintf(stderr, "Usage: %s [-" #ifdef GFARM_FILE_APPEND "a" #endif "c" #ifdef GFARM_FILE_EXCLUSIVE "e" #endif "rtw] [-m mode] \n", program_name); exit(EXIT_USAGE); } int main(int argc, char **argv) { gfarm_error_t e; GFS_File gf; int do_create = 0, verbose = 0, c, i, rv, m; int flags = GFARM_FILE_RDWR; gfarm_mode_t mode = 0666; gfarm_off_t off, roff; char buffer[BUFSIZ], *s; if (argc > 0) program_name = basename(argv[0]); e = gfarm_initialize(&argc, &argv); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "gfarm_initialize: %s\n", gfarm_error_string(e)); return (1); } while ((c = getopt(argc, argv, "acC:DeE:Fm:MnrR:S:tT:vwW:")) != -1) { off = -1; switch (c) { case OP_READ: case OP_WRITE: case OP_SEEK_SET: case OP_SEEK_CUR: case OP_SEEK_END: case OP_TRUNCATE: off = strtol(optarg, NULL, 0); /*FALLTHROUGH*/ case OP_FLUSH: case OP_SYNC: case OP_DATASYNC: if (nops >= MAX_OPS) { fprintf(stderr, "%s: number of operations reaches " "its limit (%d)\n", program_name, MAX_OPS); usage(); } ops[nops].op = c; ops[nops].off = off; ++nops; break; #ifdef GFARM_FILE_APPEND case 'a': flags |= GFARM_FILE_APPEND; break; #endif case 'c': do_create = 1; break; #ifdef GFARM_FILE_EXCLUSIVE case 'e': flags |= GFARM_FILE_EXCLUSIVE; break; #endif case 'm': mode = strtol(optarg, NULL, 0); break; case 'r': flags = (flags & ~GFARM_FILE_ACCMODE)|GFARM_FILE_RDONLY; break; case 't': flags |= GFARM_FILE_TRUNC; break; case 'v': verbose = 1; break; case 'w': flags = (flags & ~GFARM_FILE_ACCMODE)|GFARM_FILE_WRONLY; break; default: fprintf(stderr, "%s: unknown option -%c\n", program_name, c); usage(); } } argc -= optind; argv += optind; if (argc != 1) { fprintf(stderr, "%s: %s \n", program_name, argc == 0 ? "missing" : "extra arguments after"); usage(); } if (do_create) { if (verbose) fprintf(stderr, "gfs_pio_create(\"%s\", 0x%x, 0%o)\n", argv[0], flags, (int)mode); e = gfs_pio_create(argv[0], flags, mode, &gf); } else { if (verbose) fprintf(stderr, "gfs_pio_open(\"%s\", 0x%x)\n", argv[0], flags); e = gfs_pio_open(argv[0], flags, &gf); } if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", do_create ? "gfs_pio_create" : "gfs_pio_open", gfarm_error_string(e)); return (2); } for (i = 0; i < nops; i++) { c = ops[i].op; off = ops[i].off; switch (c) { case OP_READ: if (off > sizeof buffer) off = sizeof buffer; e = gfs_pio_read(gf, buffer, (int)off, &rv); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "gfs_pio_read: %s\n", gfarm_error_string(e)); return (c); } if (verbose) fprintf(stderr, "gfs_pio_read(%d): %d\n", (int)off, rv); off = write(1, buffer, rv); if (rv == -1) { perror("write"); return (10); } if (verbose) fprintf(stderr, "write(%d): %d\n", rv, (int)off); break; case OP_WRITE: if (off > sizeof buffer) off = sizeof buffer; rv = read(0, buffer, (size_t)off); if (rv == -1) { perror("read"); return (11); } if (verbose) fprintf(stderr, "read(%d): %d\n", (int)off, rv); if (rv == 0) break; off = rv; e = gfs_pio_write(gf, buffer, (int)off, &rv); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "gfs_pio_write: %s\n", gfarm_error_string(e)); return (c); } if (verbose) fprintf(stderr, "gfs_pio_write(%d): %d\n", (int)off, rv); break; case OP_SEEK_SET: case OP_SEEK_CUR: case OP_SEEK_END: switch (c) { case OP_SEEK_SET: m = GFARM_SEEK_SET; s = "SET"; break; case OP_SEEK_CUR: m = GFARM_SEEK_CUR; s = "CUR"; break; case OP_SEEK_END: m = GFARM_SEEK_END; s = "END"; break; default: assert(0); } e = gfs_pio_seek(gf, off, m, &roff); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "gfs_pio_seek(GFARM_SEEK_%s): %s\n", s, gfarm_error_string(e)); return (c); } if (verbose) fprintf(stderr, "gfs_pio_seek(%lld, %s%s): %lld\n", (long long)off, "GFARM_SEEK_", s, (long long)roff); break; case OP_TRUNCATE: e = gfs_pio_truncate(gf, off); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "gfs_pio_truncate: %s\n", gfarm_error_string(e)); return (c); } if (verbose) fprintf(stderr, "gfs_pio_truncate(%lld)", (long long)off); break; case OP_FLUSH: e = gfs_pio_flush(gf); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "gfs_pio_flush: %s\n", gfarm_error_string(e)); return (c); } if (verbose) fprintf(stderr, "gfs_pio_flush()\n"); break; case OP_SYNC: e = gfs_pio_sync(gf); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "gfs_pio_sync: %s\n", gfarm_error_string(e)); return (c); } if (verbose) fprintf(stderr, "gfs_pio_sync()\n"); break; case OP_DATASYNC: e = gfs_pio_datasync(gf); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "gfs_pio_datasync: %s\n", gfarm_error_string(e)); return (c); } if (verbose) fprintf(stderr, "gfs_pio_datasync()\n"); break; default: assert(0); } } e = gfs_pio_close(gf); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "gfs_pio_close: %s\n", gfarm_error_string(e)); return (3); } e = gfarm_terminate(); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "gfarm_terminate: %s\n", gfarm_error_string(e)); return (4); } return (0); } gfarm-2.4.1/regress/lib/libgfarm/gfarm/gfs_pio_test/Makefile0000644000000000000000000000053711507222725022544 0ustar rootroottop_builddir = ../../../../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk PROGRAM = gfs_pio_test SRCS = $(PROGRAM).c OBJS = $(PROGRAM).o CFLAGS = $(COMMON_CFLAGS) LDLIBS = $(COMMON_LDLIBS) $(GFARMLIB) $(LIBS) DEPLIBS = $(DEPGFARMLIB) all: $(PROGRAM) include $(top_srcdir)/makes/prog.mk ### $(OBJS): $(DEPGFARMINC) gfarm-2.4.1/regress/lib/libgfarm/gfarm/gfarm_error_range_alloc/0000755000000000000000000000000011507222730023241 5ustar rootrootgfarm-2.4.1/regress/lib/libgfarm/gfarm/gfarm_error_range_alloc/errmsg.sh0000755000000000000000000000060411507222725025103 0ustar rootroot#!/bin/sh . ./regress.conf trap 'exit $exit_trap' $trap_sigs if [ x"`$testbin/errmsg 1879048191`" = x"unknown error" ] && [ x"`$testbin/errmsg 1879048192`" = x"hoge" ] && [ x"`$testbin/errmsg 1879048193`" = x"piyo" ] && [ x"`$testbin/errmsg 1879048194`" = x"chome" ] && [ x"`$testbin/errmsg 1879048195`" = x"unknown error" ]; then exit_code=$exit_pass fi exit $exit_code gfarm-2.4.1/regress/lib/libgfarm/gfarm/gfarm_error_range_alloc/errmsg.c0000644000000000000000000000337711507222725024722 0ustar rootroot#include #include #include #include "liberror.h" #define PRIVATE_ERR_BEGIN (GFARM_ERR_PRIVATE_BEGIN + 0) static const char *private_error_messages[] = { #define PRIVATE_ERR_HOGE (PRIVATE_ERR_BEGIN + 0) "hoge", #define PRIVATE_ERR_PIYO (PRIVATE_ERR_BEGIN + 1) "piyo", #define PRIVATE_ERR_CHOME (PRIVATE_ERR_BEGIN + 2) "chome" }; #define PRIVATE_ERR_END (PRIVATE_ERR_BEGIN + \ GFARM_ARRAY_LENGTH(private_error_messages) - 1) const char * private_error_string(void *cookie, int e) { if (e < PRIVATE_ERR_BEGIN || e > PRIVATE_ERR_END) return ("private_error_string: internal error"); else return (private_error_messages[e - PRIVATE_ERR_BEGIN]); } gfarm_error_t private_initialize(int *argcp, char ***argvp) { gfarm_error_t e; struct gfarm_error_domain *private_error_domain; e = gfarm_initialize(argcp, argvp); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "gfarm_initialize: %s\n", gfarm_error_string(e)); return (e); } e = gfarm_error_range_alloc(PRIVATE_ERR_BEGIN, PRIVATE_ERR_END, private_error_string, NULL, &private_error_domain); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "gfarm_error_range_alloc: %s\n", gfarm_error_string(e)); return (e); } return (GFARM_ERR_NO_ERROR); } int main(int argc, char **argv) { gfarm_error_t e; e = private_initialize(&argc, &argv); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "private_initialize: %s\n", gfarm_error_string(e)); return (1); } if (argc != 2) { fprintf(stderr, "Usage: errmsg \n"); return (2); } printf("%s\n", gfarm_error_string(atoi(argv[1]))); e = gfarm_terminate(); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "gfarm_terminate: %s\n", gfarm_error_string(e)); return (2); } return (0); } gfarm-2.4.1/regress/lib/libgfarm/gfarm/gfarm_error_range_alloc/Makefile0000644000000000000000000000061411507222725024706 0ustar rootroottop_builddir = ../../../../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk PROGRAM = errmsg SRCS = $(PROGRAM).c OBJS = $(PROGRAM).o CFLAGS = $(COMMON_CFLAGS) -I$(GFARMLIB_SRCDIR) LDLIBS = $(COMMON_LDLIBS) $(GFARMLIB) $(LIBS) DEPLIBS = $(DEPGFARMLIB) all: $(PROGRAM) include $(top_srcdir)/makes/prog.mk ### $(OBJS): $(DEPGFARMINC) $(GFARMLIB_SRCDIR)/liberror.h gfarm-2.4.1/regress/lib/libgfarm/gfarm/gfs_pio_open/0000755000000000000000000000000011507222730021055 5ustar rootrootgfarm-2.4.1/regress/lib/libgfarm/gfarm/gfs_pio_open/file_trunc.sh0000755000000000000000000000066011507222725023554 0ustar rootroot#!/bin/sh . ./regress.conf gfs_pio_test=$testbin/../gfs_pio_test/gfs_pio_test trap 'gfrm -f $gftmp; rm -f $localtmp; exit $exit_trap' $trap_sigs if gfreg $data/1byte $gftmp && $gfs_pio_test -t $* $gftmp >$localtmp && [ `LC_ALL=C wc -c <$localtmp` = 0 ] && gfls -l $gftmp | awk '{size=$5; print size; if (size == 0) exit(0); else exit(1) }' then exit_code=$exit_pass fi gfrm $gftmp rm -f $localtmp exit $exit_code gfarm-2.4.1/regress/lib/libgfarm/gfarm/gfs_pio_open/file_trunc_not_writable_rdonly.sh0000755000000000000000000000020711507222725027711 0ustar rootroot#!/bin/sh . ./regress.conf if $regress/bin/am_I_gfarmroot; then exit $exit_unsupported fi $testbase/file_trunc_not_writable.sh -r gfarm-2.4.1/regress/lib/libgfarm/gfarm/gfs_pio_open/file_trunc_read.sh0000755000000000000000000000007511507222725024547 0ustar rootroot#!/bin/sh . ./regress.conf $testbase/file_trunc.sh -R 1024 gfarm-2.4.1/regress/lib/libgfarm/gfarm/gfs_pio_open/file_trunc_not_writable.sh0000755000000000000000000000075311507222725026330 0ustar rootroot#!/bin/sh . ./regress.conf gfs_pio_test=$testbin/../gfs_pio_test/gfs_pio_test if $regress/bin/am_I_gfarmroot; then exit $exit_unsupported fi trap 'gfrm -f $gftmp; rm -f $localtmp; exit $exit_trap' $trap_sigs if gfreg $data/1byte $gftmp && gfchmod 0444 $gftmp then if $gfs_pio_test -t $* $gftmp 2>$localtmp; then : elif [ $? -eq 2 ] && echo "gfs_pio_open: permission denied" | cmp - $localtmp then exit_code=$exit_pass fi fi gfrm $gftmp rm -f $localtmp exit $exit_code gfarm-2.4.1/regress/lib/libgfarm/gfarm/gfs_replicate_file_from_to_request/0000755000000000000000000000000011507222730025511 5ustar rootrootgfarm-2.4.1/regress/lib/libgfarm/gfarm/gfs_replicate_file_from_to_request/file_busy/0000755000000000000000000000000011507222730027472 5ustar rootrootgfarm-2.4.1/regress/lib/libgfarm/gfarm/gfs_replicate_file_from_to_request/file_busy/file_busy.sh0000755000000000000000000000126211507222725032017 0ustar rootroot#!/bin/sh . ./regress.conf trap 'gfrm $gftmp; gfxattr -r $gftop gfarm.ncopy; rm -f $localtmp; exit $exit_trap' $trap_sigs GFARM_FILE_RDWR=2 # from gfsched -w >$localtmp if [ `sed 2q $localtmp | wc -l` -ne 2 ]; then rm -f $localtmp exit $exit_unsupported fi srchost=`sed -n 1p $localtmp` dsthost=`sed -n 2p $localtmp` # remove the effect of gfarm.ncopy in the root directory echo -n 1 | gfxattr -s $gftop gfarm.ncopy if gfreg -h $srchost $data/1byte $gftmp && $testbin/file_busy $gftmp $GFARM_FILE_RDWR $dsthost 0 2>&1 | fgrep 'file busy' >/dev/null then exit_code=$exit_pass fi gfrm $gftmp gfxattr -r $gftop gfarm.ncopy rm -f $localtmp exit $exit_code gfarm-2.4.1/regress/lib/libgfarm/gfarm/gfs_replicate_file_from_to_request/file_busy/Makefile0000644000000000000000000000053711507222725031143 0ustar rootroottop_builddir = ../../../../../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk PROGRAM = file_busy SRCS = $(PROGRAM).c OBJS = $(PROGRAM).o CFLAGS = $(COMMON_CFLAGS) LDLIBS = $(COMMON_LDLIBS) $(GFARMLIB) $(LIBS) DEPLIBS = $(DEPGFARMLIB) all: $(PROGRAM) include $(top_srcdir)/makes/prog.mk ### $(OBJS): $(DEPGFARMINC) gfarm-2.4.1/regress/lib/libgfarm/gfarm/gfs_replicate_file_from_to_request/file_busy/file_busy.c0000644000000000000000000000216611507222725031630 0ustar rootroot#include #include #include int main(int argc, char **argv) { gfarm_error_t e; GFS_File gf; e = gfarm_initialize(&argc, &argv); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "gfarm_initialize: %s\n", gfarm_error_string(e)); return (2); } if (argc != 5) { fprintf(stderr, "Usage: file_busy " " \n"); return (2); } e = gfs_pio_open(argv[1], strtol(argv[2], NULL, 0), &gf); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "gfs_pio_open: %s\n", gfarm_error_string(e)); return (2); } e = gfs_replicate_file_to_request(argv[1], argv[3], strtol(argv[4], NULL, 0)); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "gfs_pio_replicate_file_to_request: %s\n", gfarm_error_string(e)); return (1); } e = gfs_pio_close(gf); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "gfs_pio_close: %s\n", gfarm_error_string(e)); return (2); } e = gfarm_terminate(); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "gfarm_terminate: %s\n", gfarm_error_string(e)); return (2); } return (0); } gfarm-2.4.1/regress/lib/libgfarm/gfarm/gfs_replicate_file_from_to_request/in_progress/0000755000000000000000000000000011507222730030043 5ustar rootrootgfarm-2.4.1/regress/lib/libgfarm/gfarm/gfs_replicate_file_from_to_request/in_progress/in_progress.c0000644000000000000000000000504611507222725032552 0ustar rootroot#include #include #include #include #include "gfs_pio.h" #define TEST_FILE_SIZE 100000000 /* 100MB */ static void write_file(char *file, char *src_host) { gfarm_error_t e; GFS_File gf; int rv, i; static const char buf[10]; #if 0 gfs_unlink(file); #endif e = gfs_pio_create(file, GFARM_FILE_WRONLY, 0644, &gf); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "gfs_pio_open: %s\n", gfarm_error_string(e)); exit(1); } e = gfs_pio_internal_set_view_section(gf, src_host); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "set_view: %s\n", gfarm_error_string(e)); exit(1); } for (i = 0; i < TEST_FILE_SIZE / sizeof(buf); i++) { gfs_pio_write(gf, buf, sizeof buf, &rv); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "gfs_pio_write: %s\n", gfarm_error_string(e)); exit(1); } } e = gfs_pio_close(gf); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "gfs_pio_close: %s\n", gfarm_error_string(e)); exit(1); } } static void replicate_file(char *file, char *dst_host, char *diag) { gfarm_error_t e; int n; #if 0 { struct gfs_replica_info *info; e = gfs_replica_info_by_name(file, GFS_REPLICA_INFO_INCLUDING_INCOMPLETE_COPY, &info); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: gfs_replica_info_by_name(): %s\n", diag, gfarm_error_string(e)); return; } n = gfs_replica_info_number(info); gfs_replica_info_free(info); } #else { char **copy; e = gfs_replica_list_by_name(file, &n, ©); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: gfs_replica_list_by_name(): %s\n", diag, gfarm_error_string(e)); return; } gfarm_strings_free_deeply(n, copy); } #endif if (n >= 2) { printf("%s: enough replica\n", diag); return; } e = gfs_replicate_file_to_request(file, dst_host, 0); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: gfs_replicate_file_to_request(): %s\n", diag, gfarm_error_string(e)); return; } } int main(int argc, char **argv) { gfarm_error_t e; char *file, *src_host, *dst_host; e = gfarm_initialize(NULL, NULL); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "initialize: %s\n", gfarm_error_string(e)); return (2); } if (argc != 4) { fprintf(stderr, "Usage: in_progress \n"); return (2); } file = argv[1]; src_host = argv[2]; dst_host = argv[3]; write_file(file, src_host); replicate_file(file, dst_host, "1st time"); #if 0 write_file(file, src_host); #endif replicate_file(file, dst_host, "2nd time"); gfarm_terminate(); return (0); } gfarm-2.4.1/regress/lib/libgfarm/gfarm/gfs_replicate_file_from_to_request/in_progress/Makefile0000644000000000000000000000062311507222725031510 0ustar rootroottop_builddir = ../../../../../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk PROGRAM = in_progress SRCS = $(PROGRAM).c OBJS = $(PROGRAM).o CFLAGS = $(COMMON_CFLAGS) -I$(GFARMLIB_SRCDIR) LDLIBS = $(COMMON_LDLIBS) $(GFARMLIB) $(LIBS) DEPLIBS = $(DEPGFARMLIB) all: $(PROGRAM) include $(top_srcdir)/makes/prog.mk ### $(OBJS): $(DEPGFARMINC) $(GFARMLIB_SRCDIR)/gfs_pio.h gfarm-2.4.1/regress/lib/libgfarm/gfarm/gfs_replicate_file_from_to_request/in_progress/in_progress.sh0000755000000000000000000000103111507222725032733 0ustar rootroot#!/bin/sh . ./regress.conf trap 'gfrm $gftmp; rm -f $localtmp; exit $exit_trap' $trap_sigs gfsched -w >$localtmp if [ `sed 2q $localtmp | wc -l` -ne 2 ]; then rm -f $localtmp exit $exit_unsupported fi srchost=`sed -n 1p $localtmp` dsthost=`sed -n 2p $localtmp` # XXX there is a race condition that 1st replication finshes before this error if $testbin/in_progress $gftmp $srchost $dsthost 2>&1 | fgrep 'operation already in progress' >/dev/null then exit_code=$exit_pass fi gfrm $gftmp rm -f $localtmp exit $exit_code gfarm-2.4.1/regress/schedule0000644000000000000000000000374311507222725014513 0ustar rootrootlib/libgfarm/gfarm/gfarm_error_range_alloc/errmsg.sh lib/libgfarm/gfarm/gfarm_error_to_errno/all_mapped.sh lib/libgfarm/gfarm/gfs_pio_create/normal.sh lib/libgfarm/gfarm/gfs_pio_create/not_writable.sh lib/libgfarm/gfarm/gfs_pio_create/not_writable_rdonly.sh lib/libgfarm/gfarm/gfs_pio_create/autoreplica0.sh lib/libgfarm/gfarm/gfs_pio_create/autoreplica.sh lib/libgfarm/gfarm/gfs_pio_open/file_trunc.sh lib/libgfarm/gfarm/gfs_pio_open/file_trunc_read.sh lib/libgfarm/gfarm/gfs_pio_open/file_trunc_not_writable.sh lib/libgfarm/gfarm/gfs_pio_open/file_trunc_not_writable_rdonly.sh lib/libgfarm/gfarm/gfs_replicate_file_from_to_request/file_busy/file_busy.sh lib/libgfarm/gfarm/gfs_replicate_file_from_to_request/in_progress/in_progress.sh lib/libgfarm/gfarm/gfs_xattr/gfs_listxattr.2err.sh lib/libgfarm/gfarm/gfs_xattr/gfs_getxattr.2err.sh lib/libgfarm/gfarm/gfs_xattr/gfs_setxattr.2err.sh lib/libgfarm/gfarm/gfs_xattr/gfs_removexattr.2err.sh lib/libgfarm/gfarm/gfs_getxattr_cached/size0.sh # gftool/config-gfarm gftool/gfhost/gfhost-c.sh gftool/gfhost/gfhost-c.name.toolong.sh gftool/gfhost/gfhost-c.arch.toolong.sh gftool/gfhost/gfhost-c.port.toobig.sh gftool/gfhost/gfhost-m.sh gftool/gfhost/gfhost-m.arch.toolong.sh gftool/gfuser/gfuser-c.sh gftool/gfuser/gfuser-c.real.toolong.sh gftool/gfuser/gfuser-c.home.toolong.sh gftool/gfuser/gfuser-m.sh gftool/gfuser/gfuser-m.gsi_dn.toolong.sh gftool/gfln/gfln-s.sh gftool/gfln/gfln-s_toolong.sh gftool/gfls/root.sh gftool/gfls/notexist.sh gftool/gfmkdir/mkdir.sh gftool/gfmkdir/mkdir_toolong.sh gftool/gfpath/path_dir.sh gftool/gfpath/url_dir.sh gftool/gfrmdir/rmdir.sh gftool/gfreg/0byte.sh gftool/gfrm/0byte.sh gftool/gfreg/1byte.sh gftool/gfrm/1byte.sh gftool/gfstat/gfstat.sh gftool/gfexport/0byte.sh gftool/gfexport/1byte.sh gftool/gfmv/file.sh gftool/gfmv/dir.sh gftool/gfchmod/gfchmod_644_file.sh gftool/gfchmod/gfchmod_755_file.sh gftool/gfchmod/gfchmod_700_dir.sh gftool/gfchmod/gfchmod_755_dir.sh # gftool/gfchown # gftool/gfuser # gftool/gfhost # gftool/gfkey gfarm-2.4.1/regress/gftool/0000755000000000000000000000000011507222730014253 5ustar rootrootgfarm-2.4.1/regress/gftool/gfhost/0000755000000000000000000000000011507222730015545 5ustar rootrootgfarm-2.4.1/regress/gftool/gfhost/gfhost-m.arch.toolong.sh0000755000000000000000000000126711507222725022236 0ustar rootroot#!/bin/sh . ./regress.conf host=tmphostname-`hostname`-$$ port=9999 arch=tmparchname # 129 characters (GFARM_HOST_ARCHITECTURE_NAME_MAX in gfm_proto.h) arch2=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX if $regress/bin/am_I_gfarmadm; then : else exit $exit_unsupported fi trap 'gfhost -d $host 2>/dev/null; rm -f $localtmp; exit $exit_trap' $trap_sigs if gfhost -c -a $arch -p $port $host; then if gfhost -m -a $arch2 $host 2>$localtmp; then : elif grep ': invalid argument$' $localtmp >/dev/null; then exit_code=$exit_pass fi gfhost -d $host fi rm -f $localtmp exit $exit_code gfarm-2.4.1/regress/gftool/gfhost/gfhost-c.name.toolong.sh0000755000000000000000000000134311507222725022222 0ustar rootroot#!/bin/sh . ./regress.conf # 257 characters (GFARM_HOST_NAME_MAX in gfm_proto.h) host=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX port=9999 arch=tmparchname if $regress/bin/am_I_gfarmadm; then : else exit $exit_unsupported fi trap 'gfhost -d $host 2>/dev/null; rm -f $localtmp; exit $exit_trap' $trap_sigs if gfhost -c -a $arch -p $port $host 2>$localtmp; then gfhost -d $host else if grep ': invalid argument$' $localtmp >/dev/null; then exit_code=$exit_pass fi fi rm -f $localtmp exit $exit_code gfarm-2.4.1/regress/gftool/gfhost/gfhost-c.port.toobig.sh0000755000000000000000000000067011507222725022072 0ustar rootroot#!/bin/sh . ./regress.conf host=tmphostname port=65536 arch=tmparchname if $regress/bin/am_I_gfarmadm; then : else exit $exit_unsupported fi trap 'gfhost -d $host 2>/dev/null; rm -f $localtmp; exit $exit_trap' $trap_sigs if gfhost -c -a $arch -p $port $host 2>$localtmp; then gfhost -d $host else if grep ': invalid argument$' $localtmp >/dev/null; then exit_code=$exit_pass fi fi rm -f $localtmp exit $exit_code gfarm-2.4.1/regress/gftool/gfhost/gfhost-m.sh0000755000000000000000000000120611507222725017633 0ustar rootroot#!/bin/sh . ./regress.conf host=tmphostname-`hostname`-$$ port=9999 arch=tmparchname ncpu=16 port2=8888 arch2=newarchname ncpu2=32 if $regress/bin/am_I_gfarmadm; then : else exit $exit_unsupported fi trap 'gfhost -d $host 2>/dev/null; exit $exit_trap' $trap_sigs if gfhost -c -a $arch -p $port -n $ncpu $host; then if gfhost -m -a $arch2 -p $port2 -n $ncpu2 $host; then if gfhost -M $host | awk 'BEGIN { status = 1 } $1 == "'$arch2'" && $2 == '$ncpu2' && $3 == "'$host'" && $4 == '$port2' && $5 == 0 { status = 0 } END { exit status }' then exit_code=$exit_pass fi fi gfhost -d $host fi exit $exit_code gfarm-2.4.1/regress/gftool/gfhost/gfhost-c.sh0000755000000000000000000000105711507222725017625 0ustar rootroot#!/bin/sh . ./regress.conf host=tmphostname-`hostname`-$$ port=9999 arch=tmparchname ncpu=16 if $regress/bin/am_I_gfarmadm; then : else exit $exit_unsupported fi trap 'gfhost -d $host 2>/dev/null; exit $exit_trap' $trap_sigs if gfhost -c -a $arch -p $port -n $ncpu $host; then if gfhost -M $host | awk 'BEGIN { status = 1 } $1 == "'$arch'" && $2 == '$ncpu' && $3 == "'$host'" && $4 == '$port' && $5 == 0 { status = 0 } END { exit status }' then exit_code=$exit_pass fi gfhost -d $host fi exit $exit_code gfarm-2.4.1/regress/gftool/gfhost/gfhost-c.arch.toolong.sh0000755000000000000000000000117611507222725022223 0ustar rootroot#!/bin/sh . ./regress.conf host=tmphostname-`hostname`-$$ port=9999 # 129 characters (GFARM_HOST_ARCHITECTURE_NAME_MAX in gfm_proto.h) arch=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX if $regress/bin/am_I_gfarmadm; then : else exit $exit_unsupported fi trap 'gfhost -d $host 2>/dev/null; rm -f $localtmp; exit $exit_trap' $trap_sigs if gfhost -c -a $arch -p $port $host 2>$localtmp; then gfhost -d $host else if grep ': invalid argument$' $localtmp >/dev/null; then exit_code=$exit_pass fi fi rm -f $localtmp exit $exit_code gfarm-2.4.1/regress/gftool/gfrmdir/0000755000000000000000000000000011507222730015705 5ustar rootrootgfarm-2.4.1/regress/gftool/gfrmdir/rmdir.sh0000755000000000000000000000031011507222725017357 0ustar rootroot#!/bin/sh . ./regress.conf trap 'gfrmdir $gftmp; exit $exit_trap' $trap_sigs if gfmkdir $gftmp && gfrmdir $gftmp && [ x"`gfls -d $gftmp`" = x"" ]; then exit_code=$exit_pass fi exit $exit_code gfarm-2.4.1/regress/gftool/gfmkdir/0000755000000000000000000000000011507222730015676 5ustar rootrootgfarm-2.4.1/regress/gftool/gfmkdir/mkdir.sh0000755000000000000000000000031011507222725017341 0ustar rootroot#!/bin/sh . ./regress.conf trap 'gfrmdir $gftmp; exit $exit_trap' $trap_sigs if gfmkdir $gftmp && [ x"`gfls -d $gftmp`" = x"$gftmp" ]; then exit_code=$exit_pass fi gfrmdir $gftmp exit $exit_code gfarm-2.4.1/regress/gftool/gfmkdir/mkdir_toolong.sh0000755000000000000000000000067311507222725021116 0ustar rootroot#!/bin/sh . ./regress.conf # GFS_MAXNAMLEN in TEST_LEN=256 gftmp=$gftmp`basename "$gftmp" | awk '{ l='$TEST_LEN'-length($0) for (i = 0; i < l; i++) printf "a" printf "\n" exit }'` trap 'gfrmdir $gftmp; rm -f $localtmp; exit $exit_trap' $trap_sigs if gfmkdir $gftmp 2>$localtmp; then : elif grep ': file name too long$' $localtmp >/dev/null; then exit_code=$exit_pass fi gfrmdir $gftmp rm -f $localtmp exit $exit_code gfarm-2.4.1/regress/gftool/gfexport/0000755000000000000000000000000011507222730016111 5ustar rootrootgfarm-2.4.1/regress/gftool/gfexport/0byte.sh0000755000000000000000000000007711507222725017503 0ustar rootroot#!/bin/sh . ./regress.conf $testbase/gfexport.sh $data/0byte gfarm-2.4.1/regress/gftool/gfexport/1byte.sh0000755000000000000000000000007711507222725017504 0ustar rootroot#!/bin/sh . ./regress.conf $testbase/gfexport.sh $data/1byte gfarm-2.4.1/regress/gftool/gfexport/gfexport.sh0000755000000000000000000000061511507222725020314 0ustar rootroot#!/bin/sh . ./regress.conf case $# in 1) datafile=$1;; *) echo "Usage: $0 " >&2 exit $exit_fail;; esac trap 'rm -f $localtmp; gfrm $gftmp; exit $exit_trap' $trap_sigs datasize=`ls -l $datafile | awk '{print $5}'` if gfreg $datafile $gftmp && gfexport $gftmp >$localtmp && cmp -s $localtmp $datafile; then exit_code=$exit_pass fi rm -f $localtmp gfrm $gftmp exit $exit_code gfarm-2.4.1/regress/gftool/gfstat/0000755000000000000000000000000011507222730015543 5ustar rootrootgfarm-2.4.1/regress/gftool/gfstat/gfstat.sh0000755000000000000000000000034611507222725017401 0ustar rootroot#!/bin/sh . ./regress.conf trap 'gfrm $gftmp; exit $exit_trap' $trap_sigs if gfreg $data/1byte $gftmp && [ `gfstat $gftmp | awk '/Size:/ { print $2 }'` = "1" ]; then exit_code=$exit_pass fi gfrm $gftmp exit $exit_code gfarm-2.4.1/regress/gftool/gfreg/0000755000000000000000000000000011507222730015345 5ustar rootrootgfarm-2.4.1/regress/gftool/gfreg/0byte.sh0000755000000000000000000000007411507222725016734 0ustar rootroot#!/bin/sh . ./regress.conf $testbase/gfreg.sh $data/0byte gfarm-2.4.1/regress/gftool/gfreg/1byte.sh0000755000000000000000000000007411507222725016735 0ustar rootroot#!/bin/sh . ./regress.conf $testbase/gfreg.sh $data/1byte gfarm-2.4.1/regress/gftool/gfreg/gfreg.sh0000755000000000000000000000061611507222725017005 0ustar rootroot#!/bin/sh . ./regress.conf case $# in 1) datafile=$1;; *) echo "Usage: $0 " >&2 exit $exit_fail;; esac trap 'gfrm $gftmp; exit $exit_trap' $trap_sigs datasize=`ls -l $datafile | awk '{print $5}'` if gfreg $datafile $gftmp && [ x"`gfls $gftmp`" = x"$gftmp" ] && [ x"`gfls -l $gftmp | awk '{print $5}'`" = x"$datasize" ]; then exit_code=$exit_pass fi gfrm $gftmp exit $exit_code gfarm-2.4.1/regress/gftool/gfpath/0000755000000000000000000000000011507222730015524 5ustar rootrootgfarm-2.4.1/regress/gftool/gfpath/path_dir.sh0000755000000000000000000000067411507222725017670 0ustar rootroot#!/bin/sh . ./regress.conf while read input expected do path=`expr "$input" : 'x\(.*\)'` out=`gfpath -D "$path"` if [ x"$out" != x"$expected" ]; then echo >&2 "`basename $0`: url_dir '$path': '$expected' is expected, but '$out' is returned" exit $exit_fail fi done <<'EOF' x/ / x/a / x/a/ / x/a/b /a x// / x//a / x//a// / x//a//b //a x . xa . xa/ . xa/b a xa// . xa//b a EOF exit $exit_pass gfarm-2.4.1/regress/gftool/gfpath/url_dir.sh0000755000000000000000000000500211507222725017524 0ustar rootroot#!/bin/sh . ./regress.conf while read input expected do path=`expr "$input" : 'x\(.*\)'` out=`gfpath -d "$path"` if [ x"$out" != x"$expected" ]; then echo >&2 "`basename $0`: url_dir '$path': '$expected' is expected, but '$out' is returned" exit $exit_fail fi done <<'EOF' xgfarm://hoge:9999 gfarm://hoge:9999 xgfarm://hoge:9999/ gfarm://hoge:9999 xgfarm://hoge:9999/a gfarm://hoge:9999 xgfarm://hoge:9999/a/ gfarm://hoge:9999 xgfarm://hoge:9999/a/b gfarm://hoge:9999/a xgfarm://hoge:9999/a// gfarm://hoge:9999 xgfarm://hoge:9999/a//b gfarm://hoge:9999/a xgfarm://hoge:9999// gfarm://hoge:9999 xgfarm://hoge:9999//a gfarm://hoge:9999 xgfarm://hoge:9999//a/ gfarm://hoge:9999 xgfarm://hoge:9999//a/b gfarm://hoge:9999//a xgfarm://hoge:9999//a// gfarm://hoge:9999 xgfarm://hoge:9999//a//b gfarm://hoge:9999//a xgfarm://hoge gfarm://hoge xgfarm://hoge/ gfarm://hoge xgfarm://hoge/a gfarm://hoge xgfarm://hoge/a/ gfarm://hoge xgfarm://hoge/a/b gfarm://hoge/a xgfarm://hoge/a// gfarm://hoge xgfarm://hoge/a//b gfarm://hoge/a xgfarm://hoge// gfarm://hoge xgfarm://hoge//a gfarm://hoge xgfarm://hoge//a/ gfarm://hoge xgfarm://hoge//a/b gfarm://hoge//a xgfarm://hoge//a// gfarm://hoge xgfarm://hoge//a//b gfarm://hoge//a xgfarm://:9999 gfarm://:9999 xgfarm://:9999/ gfarm://:9999 xgfarm://:9999/a gfarm://:9999 xgfarm://:9999/a/ gfarm://:9999 xgfarm://:9999/a/b gfarm://:9999/a xgfarm://:9999/a// gfarm://:9999 xgfarm://:9999/a//b gfarm://:9999/a xgfarm://:9999// gfarm://:9999 xgfarm://:9999//a gfarm://:9999 xgfarm://:9999//a/ gfarm://:9999 xgfarm://:9999//a/b gfarm://:9999//a xgfarm://:9999//a// gfarm://:9999 xgfarm://:9999//a//b gfarm://:9999//a xgfarm:// gfarm:// xgfarm:/// gfarm:// xgfarm:///a gfarm:// xgfarm:///a/ gfarm:// xgfarm:///a/b gfarm:///a xgfarm:///a// gfarm:// xgfarm:///a//b gfarm:///a xgfarm://// gfarm:// xgfarm:/ gfarm:/ xgfarm:/a gfarm:/ xgfarm:/a/ gfarm:/ xgfarm:/a/b gfarm:/a xgfarm:/a// gfarm:/ xgfarm:/a//b gfarm:/a xgfarm: gfarm: xgfarm:hoge gfarm: xgfarm:hoge/ gfarm: xgfarm:hoge/a gfarm:hoge xgfarm:hoge/a/ gfarm:hoge xgfarm:hoge/a/b gfarm:hoge/a xgfarm:hoge/a// gfarm:hoge xgfarm:hoge/a//b gfarm:hoge/a xgfarm:hoge// gfarm: xgfarm:hoge//a gfarm:hoge xgfarm:hoge//a/ gfarm:hoge xgfarm:hoge//a/b gfarm:hoge//a xgfarm:hoge//a// gfarm:hoge xgfarm:hoge//a//b gfarm:hoge//a x/ / x/a / x/a/ / x/a/b /a x// / x//a / x//a// / x//a//b //a x . xa . xa/ . xa/b a xa// . xa//b a EOF exit $exit_pass gfarm-2.4.1/regress/gftool/gfuser/0000755000000000000000000000000011507222730015546 5ustar rootrootgfarm-2.4.1/regress/gftool/gfuser/gfuser-c.real.toolong.sh0000755000000000000000000000141711507222725022231 0ustar rootroot#!/bin/sh . ./regress.conf user=tmpusr-`hostname`-$$ # 257 characters (GFARM_USER_REALNAME_MAX in gfm_proto.h) real=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX home=/home/$user gsi_dn='' if $regress/bin/am_I_gfarmadm; then : else exit $exit_unsupported fi trap 'gfuser -d "$user" 2>/dev/null; rm -f $localtmp; exit $exit_trap' $trap_sigs if gfuser -c "$user" "$real" "$home" "$gsi_dn" 2>$localtmp; then gfuser -d "$user" else if grep ': invalid argument$' $localtmp >/dev/null; then exit_code=$exit_pass fi fi rm -f $localtmp exit $exit_code gfarm-2.4.1/regress/gftool/gfuser/gfuser-m.gsi_dn.toolong.sh0000755000000000000000000000330411507222725022560 0ustar rootroot#!/bin/sh . ./regress.conf user=tmpusr-`hostname`-$$ real=tmprealname home=/home/$user gsi_dn="/C=JP/O=University of Tsukuba/OU=HPCS/OU=hpcc.jp/CN=John Smith `hostname` $$" # more than 1024 characters (GFARM_USER_GSI_DN_MAX in gfm_proto.h) gsi_dn2="/C=JP/O=University of Tsukuba/OU=HPCS/OU=hpcc.jp/CN=John Smith `hostname` $$ hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh" if $regress/bin/am_I_gfarmadm; then : else exit $exit_unsupported fi trap 'gfuser -d "$user" 2>/dev/null; rm -f $localtmp; exit $exit_trap' $trap_sigs if gfuser -c "$user" "$real" "$home" "$gsi_dn"; then if gfuser -m "$user" "$real" "$home" "$gsi_dn2" 2>$localtmp; then : elif grep ': invalid argument$' $localtmp >/dev/null; then exit_code=$exit_pass fi gfuser -d "$user" fi rm -f $localtmp exit $exit_code gfarm-2.4.1/regress/gftool/gfuser/gfuser-m.sh0000755000000000000000000000136011507222725017636 0ustar rootroot#!/bin/sh . ./regress.conf user=tmpusr-`hostname`-$$ real=tmprealname home=/home/$user gsi_dn='' real2=tmprealname2 home2=/home/$user/ gsi_dn2="/C=JP/O=University of Tsukuba/OU=HPCS/OU=hpcc.jp/CN=John Smith `hostname` $$" if $regress/bin/am_I_gfarmadm; then : else exit $exit_unsupported fi trap 'gfuser -d "$user" 2>/dev/null; exit $exit_trap' $trap_sigs if gfuser -c "$user" "$real" "$home" "$gsi_dn"; then if gfuser -m "$user" "$real2" "$home2" "$gsi_dn2"; then if gfuser -l "$user" | awk -F: 'BEGIN { status = 1 } $1 == "'"$user"'" && $2 == "'"$real2"'" && $3 == "'"$home2"'" && $4 == "'"$gsi_dn2"'" { status = 0 } END { exit status }' then exit_code=$exit_pass fi fi gfuser -d "$user" fi exit $exit_code gfarm-2.4.1/regress/gftool/gfuser/gfuser-c.sh0000755000000000000000000000110111507222725017615 0ustar rootroot#!/bin/sh . ./regress.conf user=tmpusr-`hostname`-$$ real=tmprealname home=/home/$user gsi_dn='' if $regress/bin/am_I_gfarmadm; then : else exit $exit_unsupported fi trap 'gfuser -d "$user" 2>/dev/null; exit $exit_trap' $trap_sigs if gfuser -c "$user" "$real" "$home" "$gsi_dn"; then if gfuser -l "$user" | awk -F: 'BEGIN { status = 1 } $1 == "'"$user"'" && $2 == "'"$real"'" && $3 == "'"$home"'" && $4 == "'"$gsi_dn"'" { status = 0 } END { exit status }' then exit_code=$exit_pass fi gfuser -d "$user" fi exit $exit_code gfarm-2.4.1/regress/gftool/gfuser/gfuser-c.home.toolong.sh0000755000000000000000000000300711507222725022233 0ustar rootroot#!/bin/sh . ./regress.conf user=tmpusr-`hostname`-$$ real=tmprealname # 1025 characters (GFARM_PATH_MAX in gfm_proto.h) home=/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX gsi_dn='' if $regress/bin/am_I_gfarmadm; then : else exit $exit_unsupported fi trap 'gfuser -d "$user" 2>/dev/null; rm -f $localtmp; exit $exit_trap' $trap_sigs if gfuser -c "$user" "$real" "$home" "$gsi_dn" 2>$localtmp; then gfuser -d "$user" else if grep ': invalid argument$' $localtmp >/dev/null; then exit_code=$exit_pass fi fi rm -f $localtmp exit $exit_code gfarm-2.4.1/regress/gftool/gfxattr/0000755000000000000000000000000011507222730015732 5ustar rootrootgfarm-2.4.1/regress/gftool/gfxattr/gfxattr-set-normal.sh0000755000000000000000000000510011507222725022027 0ustar rootroot# normal xattr set test - 1 { echo Hello1 > $attrfile gfxattr -s -f $attrfile / $attrname if [ $? != 0 ]; then exit $exit_fail fi gfxattr -g -f $getfile / $attrname if [ $? != 0 ]; then exit $exit_fail fi cmp $attrfile $getfile if [ $? != 0 ]; then exit $exit_fail fi } # normal xattr set test - 2 { echo Hello2 > $attrfile2 gfxattr -s -c -f $attrfile2 / $attrname if [ $? == 0 ]; then # must fail if already exists exit $exit_fail fi gfxattr -g -f $getfile / $attrname if [ $? != 0 ]; then exit $exit_fail fi cmp $attrfile $getfile if [ $? != 0 ]; then exit $exit_fail fi } # normal xattr set test - 3 { echo Hello3 > $attrfile gfxattr -s -m -f $attrfile / $attrname if [ $? != 0 ]; then exit $exit_fail fi gfxattr -g -f $getfile / $attrname if [ $? != 0 ]; then exit $exit_fail fi cmp $attrfile $getfile if [ $? != 0 ]; then exit $exit_fail fi } # normal xattr set test - 4 { echo Hello3 > $attrfile gfxattr -s -m -f $attrfile / "$attrname"4 if [ $? == 0 ]; then # must fail if not exists exit $exit_fail fi } # normal xattr set test - 5 { echo Hello5 > $attrfile gfxattr -s -f $attrfile $subdir $attrname if [ $? != 0 ]; then exit $exit_fail fi gfxattr -g -f $getfile $subdir $attrname if [ $? != 0 ]; then exit $exit_fail fi cmp $attrfile $getfile if [ $? != 0 ]; then exit $exit_fail fi } # normal xattr set test - 6 { echo Hello6 > $attrfile gfxattr -s -f $attrfile $subsubdir $attrname if [ $? != 0 ]; then exit $exit_fail fi gfxattr -g -f $getfile $subsubdir $attrname if [ $? != 0 ]; then exit $exit_fail fi cmp $attrfile $getfile if [ $? != 0 ]; then exit $exit_fail fi } # normal xattr set test - 7 { echo Hello7 > $attrfile gfxattr -s -f $attrfile $fileX $attrname if [ $? != 0 ]; then exit $exit_fail fi gfxattr -g -f $getfile $fileX $attrname if [ $? != 0 ]; then exit $exit_fail fi cmp $attrfile $getfile if [ $? != 0 ]; then exit $exit_fail fi } # normal xattr set test - 8 { echo Hello8 > $attrfile gfxattr -s -f $attrfile $subdir/$fileX $attrname if [ $? != 0 ]; then exit $exit_fail fi gfxattr -g -f $getfile $subdir/$fileX $attrname if [ $? != 0 ]; then exit $exit_fail fi cmp $attrfile $getfile if [ $? != 0 ]; then exit $exit_fail fi } # normal xattr set test - 9 { echo Hello9 > $attrfile gfxattr -s -f $attrfile $subsubdir/$fileX $attrname if [ $? != 0 ]; then exit $exit_fail fi gfxattr -g -f $getfile $subsubdir/$fileX $attrname if [ $? != 0 ]; then exit $exit_fail fi cmp $attrfile $getfile if [ $? != 0 ]; then exit $exit_fail fi } gfarm-2.4.1/regress/gftool/gfxattr/gfxattr-findxmlattr.sh0000644000000000000000000001615311507222725022311 0ustar rootrootgfrm $subsubdir/$fileX gfrmdir $subsubdir gfrm $subdir/$fileX gfrmdir $subdir gfrmdir $subdir2 gfrm $fileX gfxattr -rx / $attrname gfxattr -rx / $attrname2 echo 'aaa' > $attrfile echo 'bbb' > $attrfile2 # xml xattr find test - 1.1 { gffindxmlattr /a / > $getfile if [ $? != 0 ]; then exit $exit_fail fi echo -n "" > $nameslist cmp $nameslist $getfile if [ $? != 0 ]; then exit $exit_fail fi } # xml xattr find test - 1.2 { gfxattr -sx -f $attrfile / $attrname if [ $? != 0 ]; then exit $exit_fail fi gffindxmlattr /a / > $getfile if [ $? != 0 ]; then exit $exit_fail fi echo "/ $attrname" > $nameslist cmp $nameslist $getfile if [ $? != 0 ]; then exit $exit_fail fi } # xml xattr find test - 1.3 { gfxattr -sx -f $attrfile / $attrname if [ $? != 0 ]; then exit $exit_fail fi gffindxmlattr /b / > $getfile if [ $? != 0 ]; then exit $exit_fail fi echo -n "" > $nameslist cmp $nameslist $getfile if [ $? != 0 ]; then exit $exit_fail fi } # xml xattr find test - 1.4 { gfxattr -sx -f $attrfile / $attrname2 if [ $? != 0 ]; then exit $exit_fail fi gffindxmlattr /a / > $getfile if [ $? != 0 ]; then exit $exit_fail fi echo "/ $attrname" > $nameslist echo "/ $attrname2" >> $nameslist cmp $nameslist $getfile if [ $? != 0 ]; then exit $exit_fail fi } # xml xattr find test - 1.5 { gfxattr -sx -f $attrfile2 / $attrname2 if [ $? != 0 ]; then exit $exit_fail fi gffindxmlattr /a / > $getfile if [ $? != 0 ]; then exit $exit_fail fi echo "/ $attrname" > $nameslist cmp $nameslist $getfile if [ $? != 0 ]; then exit $exit_fail fi } # xml xattr find test - 1.6 { touch $fusemnt/$fileX if [ $? != 0 ]; then exit $exit_fail fi gfxattr -sx -f $attrfile $fileX $attrname if [ $? != 0 ]; then exit $exit_fail fi gffindxmlattr /a / > $getfile if [ $? != 0 ]; then exit $exit_fail fi echo "/ $attrname" > $nameslist echo "/$fileX $attrname" >> $nameslist cmp $nameslist $getfile if [ $? != 0 ]; then exit $exit_fail fi } # xml xattr find test - 2.1 { gfmkdir $subdir if [ $? != 0 ]; then exit $exit_fail fi gffindxmlattr /a /$subdir > $getfile if [ $? != 0 ]; then exit $exit_fail fi echo -n "" > $nameslist cmp $nameslist $getfile if [ $? != 0 ]; then exit $exit_fail fi } # xml xattr find test - 2.2 { gfxattr -sx -f $attrfile $subdir $attrname if [ $? != 0 ]; then exit $exit_fail fi # # abs path gffindxmlattr /a /$subdir > $getfile if [ $? != 0 ]; then exit $exit_fail fi echo "/$subdir $attrname" > $nameslist cmp $nameslist $getfile if [ $? != 0 ]; then exit $exit_fail fi # # relative path gffindxmlattr /a $subdir > $getfile if [ $? != 0 ]; then exit $exit_fail fi echo "$subdir $attrname" > $nameslist cmp $nameslist $getfile if [ $? != 0 ]; then exit $exit_fail fi } # xml xattr find test - 2.3 { gffindxmlattr /a / | sort > $getfile if [ $? != 0 ]; then exit $exit_fail fi echo "/ $attrname" > $nameslist echo "/$subdir $attrname" >> $nameslist echo "/$fileX $attrname" >> $nameslist cmp $nameslist $getfile if [ $? != 0 ]; then exit $exit_fail fi } # xml xattr find test - 3.1 { gfmkdir $subsubdir if [ $? != 0 ]; then exit $exit_fail fi gffindxmlattr /a /$subsubdir > $getfile if [ $? != 0 ]; then exit $exit_fail fi echo -n "" > $nameslist cmp $nameslist $getfile if [ $? != 0 ]; then exit $exit_fail fi } # xml xattr find test - 3.2 { gfxattr -sx -f $attrfile /$subsubdir $attrname if [ $? != 0 ]; then exit $exit_fail fi gffindxmlattr /a /$subsubdir > $getfile if [ $? != 0 ]; then exit $exit_fail fi echo "/$subsubdir $attrname" > $nameslist cmp $nameslist $getfile if [ $? != 0 ]; then exit $exit_fail fi } # xml xattr find test - 3.3 { gffindxmlattr /a / | sort > $getfile if [ $? != 0 ]; then exit $exit_fail fi echo "/ $attrname" > $nameslist echo "/$subdir $attrname" >> $nameslist echo "/$subsubdir $attrname" >> $nameslist echo "/file1 $attrname" >> $nameslist cmp $nameslist $getfile if [ $? != 0 ]; then exit $exit_fail fi } # xml xattr find test - 3.4 { gffindxmlattr -d 0 /a / | sort > $getfile if [ $? != 0 ]; then exit $exit_fail fi echo "/ $attrname" > $nameslist cmp $nameslist $getfile if [ $? != 0 ]; then exit $exit_fail fi } # xml xattr find test - 3.5 { gffindxmlattr -d 1 /a / | sort > $getfile if [ $? != 0 ]; then exit $exit_fail fi echo "/ $attrname" > $nameslist echo "/$subdir $attrname" >> $nameslist echo "/file1 $attrname" >> $nameslist cmp $nameslist $getfile if [ $? != 0 ]; then exit $exit_fail fi } # xml xattr find test - 3.6 { gffindxmlattr -d 2 /a / | sort > $getfile if [ $? != 0 ]; then exit $exit_fail fi echo "/ $attrname" > $nameslist echo "/$subdir $attrname" >> $nameslist echo "/$subsubdir $attrname" >> $nameslist echo "/file1 $attrname" >> $nameslist cmp $nameslist $getfile if [ $? != 0 ]; then exit $exit_fail fi } # xml xattr find test - 4.1 { gfmkdir $subdir2 gfmkdir $subdir2/$subdir2 if [ $? != 0 ]; then exit $exit_fail fi gffindxmlattr /a / | sort > $getfile if [ $? != 0 ]; then exit $exit_fail fi cmp $nameslist $getfile if [ $? != 0 ]; then exit $exit_fail fi } # xml xattr find test - 5.1 { gfchmod 0655 $subdir if [ $? != 0 ]; then exit $exit_fail fi gffindxmlattr /a / | sort > $getfile if [ $? != 0 ]; then exit $exit_fail fi echo "/ $attrname" > $nameslist echo "/$subdir $attrname" >> $nameslist echo "/$fileX $attrname" >> $nameslist cmp $nameslist $getfile if [ $? != 0 ]; then exit $exit_fail fi } # xml xattr find test - 5.2 { gfchmod 0355 $subdir if [ $? != 0 ]; then exit $exit_fail fi gffindxmlattr /a / | sort > $getfile if [ $? != 0 ]; then exit $exit_fail fi echo "/ $attrname" > $nameslist echo "/$subsubdir $attrname" >> $nameslist echo "/$fileX $attrname" >> $nameslist cmp $nameslist $getfile if [ $? != 0 ]; then exit $exit_fail fi } # xml xattr find test - 5.3 { gfchmod 0555 $subdir if [ $? != 0 ]; then exit $exit_fail fi gffindxmlattr /a / | sort > $getfile if [ $? != 0 ]; then exit $exit_fail fi echo "/ $attrname" > $nameslist echo "/$subdir $attrname" >> $nameslist echo "/$subsubdir $attrname" >> $nameslist echo "/file1 $attrname" >> $nameslist cmp $nameslist $getfile if [ $? != 0 ]; then exit $exit_fail fi gfchmod 0755 $subdir if [ $? != 0 ]; then exit $exit_fail fi } # xml xattr find test - 6.1 { gffindxmlattr -F , /a / | sort > $getfile if [ $? != 0 ]; then exit $exit_fail fi echo "/,$attrname" > $nameslist echo "/$subdir,$attrname" >> $nameslist echo "/$subsubdir,$attrname" >> $nameslist echo "/file1,$attrname" >> $nameslist cmp $nameslist $getfile if [ $? != 0 ]; then exit $exit_fail fi } # xml xattr find test - 6.2 { echo '/a' > $attrfile gffindxmlattr -f $attrfile / | sort > $getfile if [ $? != 0 ]; then exit $exit_fail fi echo "/ $attrname" > $nameslist echo "/$subdir $attrname" >> $nameslist echo "/$subsubdir $attrname" >> $nameslist echo "/file1 $attrname" >> $nameslist cmp $nameslist $getfile if [ $? != 0 ]; then exit $exit_fail fi } # xml xattr find test - 6.3 { gffindxmlattr -d -1 /a / if [ $? == 0 ]; then # must fail exit $exit_fail fi } gfarm-2.4.1/regress/gftool/gfxattr/gfxattr-perm-normal.sh0000644000000000000000000000244511507222725022205 0ustar rootroottarget="$subdir" echo 'Hello1' > $attrfile gfxattr -s -f $attrfile $target $attrname if [ $? != 0 ]; then exit $exit_fail fi # # drop owner write permission # gfchmod 0555 $target if [ $? != 0 ]; then exit $exit_fail fi # normal xattr perm test - 1 { gfxattr -s -f $attrfile $target $attrname if [ $? == 0 ]; then # must fail exit $exit_fail fi } # normal xattr perm test - 2 { gfxattr -g $target $attrname if [ $? != 0 ]; then exit $exit_fail fi } # normal xattr perm test - 3 { gfxattr -l $target if [ $? != 0 ]; then exit $exit_fail fi } # normal xattr perm test - 4 { gfxattr -r $target $attrname if [ $? == 0 ]; then # must fail exit $exit_fail fi } # # drop owner read permission # gfchmod 0355 $target if [ $? != 0 ]; then exit $exit_fail fi # normal xattr perm test - 5 { gfxattr -s -f $attrfile $target $attrname if [ $? != 0 ]; then exit $exit_fail fi } # normal xattr perm test - 6 { gfxattr -g $target $attrname if [ $? == 0 ]; then # must fail exit $exit_fail fi } # normal xattr perm test - 7 { gfxattr -l $target if [ $? == 0 ]; then # msut fail exit $exit_fail fi } # normal xattr perm test - 8 { gfxattr -r $target $attrname if [ $? != 0 ]; then exit $exit_fail fi } gfchmod 0755 $target if [ $? != 0 ]; then exit $exit_fail fi gfarm-2.4.1/regress/gftool/gfxattr/gfxattr-remove-xml.sh0000644000000000000000000000206311507222725022043 0ustar rootroot# xml xattr remove test - 1 { gfxattr -rx / $attrname if [ $? != 0 ]; then exit $exit_fail fi } # xml xattr remove test - 2 { gfxattr -rx / $attrname2 if [ $? != 0 ]; then exit $exit_fail fi } # xml xattr remove test - 3 { gfxattr -rx / "$attrname"XXX if [ $? == 0 ]; then # must fail if not exists exit $exit_fail fi } # xml xattr remove test - 4 { gfxattr -rx $fileX $attrname if [ $? != 0 ]; then exit $exit_fail fi } # xml xattr remove test - 5 { gfxattr -rx $fileX $attrname2 if [ $? != 0 ]; then exit $exit_fail fi } # xml xattr remove test - 6 { gfxattr -rx $fileX "$attrname"XXX if [ $? == 0 ]; then # must fail if not exists exit $exit_fail fi } echo -n ""> $nameslist # xml xattr list test - 5 { gfxattr -lx / > $getnames if [ $? != 0 ]; then exit $exit_fail fi cmp $nameslist $getnames if [ $? != 0 ]; then exit $exit_fail fi } # xml xattr list test - 6 { gfxattr -lx $fileX > $getnames if [ $? != 0 ]; then exit $exit_fail fi cmp $nameslist $getnames if [ $? != 0 ]; then exit $exit_fail fi } gfarm-2.4.1/regress/gftool/gfxattr/gfxattr-main.sh0000644000000000000000000000323111507222725020672 0ustar rootroot. ./regress.conf . ./gftool/gfxattr/gfxattr-init.sh trap 'exit $exit_trap' $trap_sigs echo "*** start gfxattr test. some tests issue error messages. ***" mkdir -p $fusemnt if [ $? != 0 ]; then exit $exit_fail fi gfarm2fs $fusemnt if [ $? != 0 ]; then exit $exit_fail fi mkdir -p $xattrtmp gfmkdir $subdir gfmkdir $subdir2 gfmkdir $subsubdir touch $fusemnt/$fileX touch $fusemnt/$subdir/$fileX touch $fusemnt/$subsubdir/$fileX echo "** set/get normal test **" . ./gftool/gfxattr/gfxattr-set-normal.sh echo "** list normat test **" . ./gftool/gfxattr/gfxattr-list-normal.sh echo "** remove normat test **" . ./gftool/gfxattr/gfxattr-remove-normal.sh echo "** limit normat test **" . ./gftool/gfxattr/gfxattr-limit-normal.sh echo "** stat normal test **" . ./gftool/gfxattr/gfxattr-stat-normal.sh echo "** permission normal test **" . ./gftool/gfxattr/gfxattr-perm-normal.sh echo "** fuse test **" . ./gftool/gfxattr/gfxattr-fuse.sh if [ $xml_enabled == 1 ]; then echo "** set/get xml test **" . ./gftool/gfxattr/gfxattr-set-xml.sh echo "** list xml test **" . ./gftool/gfxattr/gfxattr-list-xml.sh echo "** remove xml test **" . ./gftool/gfxattr/gfxattr-remove-xml.sh echo "** stat xml test **" . ./gftool/gfxattr/gfxattr-stat-xml.sh echo "** permission xml test **" . ./gftool/gfxattr/gfxattr-perm-xml.sh echo "** enabled xml common test **" . ./gftool/gfxattr/gfxattr-xml-enabled-common.sh echo "** find xml attr test **" . ./gftool/gfxattr/gfxattr-findxmlattr.sh else echo "** disabled xml common test **" . ./gftool/gfxattr/gfxattr-xml-disabled-common.sh fi . ./gftool/gfxattr/gfxattr-fini.sh echo "*** gfxattr test passed! ***" exit $exit_pass gfarm-2.4.1/regress/gftool/gfxattr/gfxattr-perm-xml.sh0000644000000000000000000000242511507222725021513 0ustar rootroottarget="$subdir" echo 'Hello1' > $attrfile gfxattr -s -f $attrfile $target $attrname if [ $? != 0 ]; then exit $exit_fail fi # # drop owner write permission # gfchmod 0555 $target if [ $? != 0 ]; then exit $exit_fail fi # xml xattr perm test - 1 { gfxattr -sx -f $attrfile $target $attrname if [ $? == 0 ]; then # must fail exit $exit_fail fi } # xml xattr perm test - 2 { gfxattr -gx $target $attrname if [ $? != 0 ]; then exit $exit_fail fi } # xml xattr perm test - 3 { gfxattr -lx $target if [ $? != 0 ]; then exit $exit_fail fi } # xml xattr perm test - 4 { gfxattr -rx $target $attrname if [ $? == 0 ]; then # must fail exit $exit_fail fi } # # drop owner read permission # gfchmod 0355 $target if [ $? != 0 ]; then exit $exit_fail fi # xml xattr perm test - 5 { gfxattr -sx -f $attrfile $target $attrname if [ $? != 0 ]; then exit $exit_fail fi } # xml xattr perm test - 6 { gfxattr -gx $target $attrname if [ $? == 0 ]; then # must fail exit $exit_fail fi } # xml xattr perm test - 7 { gfxattr -lx $target if [ $? == 0 ]; then # msut fail exit $exit_fail fi } # xml xattr perm test - 8 { gfxattr -rx $target $attrname if [ $? != 0 ]; then exit $exit_fail fi } gfchmod 0755 $target if [ $? != 0 ]; then exit $exit_fail fi gfarm-2.4.1/regress/gftool/gfxattr/gfxattr-xml-disabled.sh0000755000000000000000000000007511507222725022321 0ustar rootroot#!/bin/sh xml_enabled=0 . ./gftool/gfxattr/gfxattr-main.sh gfarm-2.4.1/regress/gftool/gfxattr/xmltest/0000755000000000000000000000000011507222730017432 5ustar rootrootgfarm-2.4.1/regress/gftool/gfxattr/xmltest/testxml0000644000000000000000000000016011507222725021056 0ustar rootroot test gfarm-2.4.1/regress/gftool/gfxattr/xmltest/aclxml0000644000000000000000000000062311507222725020642 0ustar rootroot admin root gfdev gfdev root admin Admin root root admin gfarm-2.4.1/regress/gftool/gfxattr/xmltest/detailxml0000644000000000000000000000026711507222725021351 0ustar rootroot Test File 2008/10/12 2009/2/5 to test gffindxmlattr gfarm-2.4.1/regress/gftool/gfxattr/xmltest/logxml0000644000000000000000000000041311507222725020661 0ustar rootroot gfdev 2009 2 5 13 24 23 None gfarm-2.4.1/regress/gftool/gfxattr/gfxattr-xml-disabled-common.sh0000644000000000000000000000106711507222725023606 0ustar rootroot# xml xattr test - 1 { gfxattr -sx -f $attrfile / $attrname if [ $? == 0 ]; then # must be fail exit $exit_fail fi } # xml xattr test - 2 { gfxattr -gx / $attrname if [ $? == 0 ]; then # must be fail exit $exit_fail fi } # xml xattr test - 3 { gfxattr -lx / if [ $? == 0 ]; then # must be fail exit $exit_fail fi } # xml xattr test - 4 { gfxattr -rx / $attrname if [ $? == 0 ]; then # must be fail exit $exit_fail fi } # xml xattr test - 5 { gffindxmlattr -d 0 /a / if [ $? == 0 ]; then # must be fail exit $exit_fail fi } gfarm-2.4.1/regress/gftool/gfxattr/gfxattr-stat-normal.sh0000644000000000000000000000252411507222725022213 0ustar rootroot# normal xattr stat test - 1 { gfstat / > $statfile sleep 1 echo 'Hello1' > $attrfile gfxattr -s -f $attrfile / $attrname if [ $? != 0 ]; then exit $exit_fail fi gfstat / > $getstat cmp -s $statfile $getstat if [ $? == 0 ]; then # ctime must be changed exit $exit_fail fi ret=`diff $statfile $getstat | grep '<' | grep -v Change | wc -l` if [ $ret != 0 ]; then # ctime must be changed exit $exit_fail fi } # normal xattr stat test - 2 { gfstat / > $statfile sleep 1 echo 'Hello2' > $attrfile gfxattr -g -f $getfile / $attrname if [ $? != 0 ]; then exit $exit_fail fi gfstat / > $getstat cmp -s $statfile $getstat if [ $? != 0 ]; then # nothing must be changed exit $exit_fail fi } # normal xattr stat test - 3 { gfstat / > $statfile sleep 1 gfxattr -l / if [ $? != 0 ]; then exit $exit_fail fi gfstat / > $getstat cmp -s $statfile $getstat if [ $? != 0 ]; then # nothing must be changed exit $exit_fail fi } # normal xattr stat test - 4 { gfstat / > $statfile sleep 1 gfxattr -r / $attrname if [ $? != 0 ]; then exit $exit_fail fi gfstat / > $getstat cmp -s $statfile $getstat if [ $? == 0 ]; then # ctime must be changed exit $exit_fail fi ret=`diff $statfile $getstat | grep '<' | grep -v Change | wc -l` if [ $ret != 0 ]; then # ctime must be changed exit $exit_fail fi } gfarm-2.4.1/regress/gftool/gfxattr/gfxattr-fini.sh0000644000000000000000000000040711507222725020675 0ustar rootroot. ./gftool/gfxattr/gfxattr-init.sh gfxattr -r / $attrname gfxattr -r / $attrname2 gfxattr -rx / $attrname gfxattr -rx / $attrname2 rm -rf $xattrtmp gfchmod 0755 $subdir rm -rf $fusemnt/$subdir rm -rf $fusemnt/$subdir2 rm -f $fusemnt/$fileX sudo umount $fusemnt gfarm-2.4.1/regress/gftool/gfxattr/README.txt0000644000000000000000000000146711507222725017444 0ustar rootroot gfxattr, gffindxmlattr test scripts o Setup - gfarm, gfarm2fs, fuse are installed - "sudo modprobe fuse" executed - setup visudo to run "sudo umount" by test running user - gfmd, backend DB (PostgreSQL/OpenLDAP) are running - Gfarm FS is empty (any files, directories are not created) o At XML attr supported gfmd and PostgreSQL environment cd gfarm/regress sh ./gftool/gfxattr/gfxattr-xml-enabled.sh o At XML attr NOT supported gfmd and PostgreSQL/OpenLDAP environment cd gfarm/regress sh ./gftool/gfxattr/gfxattr-xml-disabled.sh If test succeeded, you will see *** gfxattr test passed! *** If failed, test exits at failed command. run ./gftool/gfxattr/gfxattr-fini.sh for finalize (remove some files etc). o gffindxmlattr-large-test.sh cd gfarm/regress/gfxattr sh ./gffindxmlattr-large-test.sh gfarm-2.4.1/regress/gftool/gfxattr/gfxattr-stat-xml.sh0000644000000000000000000000251411507222725021522 0ustar rootroot# xml xattr stat test - 1 { gfstat / > $statfile sleep 1 echo 'Hello1' > $attrfile gfxattr -sx -f $attrfile / $attrname if [ $? != 0 ]; then exit $exit_fail fi gfstat / > $getstat cmp -s $statfile $getstat if [ $? == 0 ]; then # ctime must be changed exit $exit_fail fi ret=`diff $statfile $getstat | grep '<' | grep -v Change | wc -l` if [ $ret != 0 ]; then # ctime must be changed exit $exit_fail fi } # xml xattr stat test - 2 { gfstat / > $statfile sleep 1 echo 'Hello2' > $attrfile gfxattr -gx -f $getfile / $attrname if [ $? != 0 ]; then exit $exit_fail fi gfstat / > $getstat cmp -s $statfile $getstat if [ $? != 0 ]; then # nothing must be changed exit $exit_fail fi } # xml xattr stat test - 3 { gfstat / > $statfile sleep 1 gfxattr -lx / if [ $? != 0 ]; then exit $exit_fail fi gfstat / > $getstat cmp -s $statfile $getstat if [ $? != 0 ]; then # nothing must be changed exit $exit_fail fi } # xml xattr stat test - 4 { gfstat / > $statfile sleep 1 gfxattr -rx / $attrname if [ $? != 0 ]; then exit $exit_fail fi gfstat / > $getstat cmp -s $statfile $getstat if [ $? == 0 ]; then # ctime must be changed exit $exit_fail fi ret=`diff $statfile $getstat | grep '<' | grep -v Change | wc -l` if [ $ret != 0 ]; then # ctime must be changed exit $exit_fail fi } gfarm-2.4.1/regress/gftool/gfxattr/gffindxmlattr-large-test.sh0000644000000000000000000001405111507222725023211 0ustar rootroot#!/bin/bash mountp="./fusetest" xmltest="./xmltest" gfmkdir A gfmkdir B gfmkdir C gfmkdir D gfmkdir A/A gfmkdir A/B gfmkdir A/C gfmkdir A/D gfmkdir B/A gfmkdir B/B gfmkdir B/C gfmkdir B/D gfmkdir C/A gfmkdir C/B gfmkdir C/C gfmkdir C/D gfmkdir D/A gfmkdir D/B gfmkdir D/C gfmkdir D/D mkdir -p $mountp gfarm2fs $mountp touch $mountp/a touch $mountp/b touch $mountp/c touch $mountp/d touch $mountp/A/a touch $mountp/A/b touch $mountp/A/c touch $mountp/A/d touch $mountp/B/a touch $mountp/B/b touch $mountp/B/c touch $mountp/B/d touch $mountp/C/a touch $mountp/C/b touch $mountp/C/c touch $mountp/C/d touch $mountp/D/a touch $mountp/D/b touch $mountp/D/c touch $mountp/D/d touch $mountp/A/A/a touch $mountp/A/A/b touch $mountp/A/A/c touch $mountp/A/A/d touch $mountp/A/B/a touch $mountp/A/B/b touch $mountp/A/B/c touch $mountp/A/B/d touch $mountp/A/C/a touch $mountp/A/C/b touch $mountp/A/C/c touch $mountp/A/C/d touch $mountp/A/D/a touch $mountp/A/D/b touch $mountp/A/D/c touch $mountp/A/D/d touch $mountp/B/A/a touch $mountp/B/A/b touch $mountp/B/A/c touch $mountp/B/A/d touch $mountp/B/B/a touch $mountp/B/B/b touch $mountp/B/B/c touch $mountp/B/B/d touch $mountp/B/C/a touch $mountp/B/C/b touch $mountp/B/C/c touch $mountp/B/C/d touch $mountp/B/D/a touch $mountp/B/D/b touch $mountp/B/D/c touch $mountp/B/D/d touch $mountp/C/A/a touch $mountp/C/A/b touch $mountp/C/A/c touch $mountp/C/A/d touch $mountp/C/B/a touch $mountp/C/B/b touch $mountp/C/B/c touch $mountp/C/B/d touch $mountp/C/C/a touch $mountp/C/C/b touch $mountp/C/C/c touch $mountp/C/C/d touch $mountp/C/D/a touch $mountp/C/D/b touch $mountp/C/D/c touch $mountp/C/D/d touch $mountp/D/A/a touch $mountp/D/A/b touch $mountp/D/A/c touch $mountp/D/A/d touch $mountp/D/B/a touch $mountp/D/B/b touch $mountp/D/B/c touch $mountp/D/B/d touch $mountp/D/C/a touch $mountp/D/C/b touch $mountp/D/C/c touch $mountp/D/C/d touch $mountp/D/D/a touch $mountp/D/D/b touch $mountp/D/D/c touch $mountp/D/D/d gfxattr -s -c -x -f $xmltest/aclxml a acl gfxattr -s -c -x -f $xmltest/detailxml b detail gfxattr -s -c -x -f $xmltest/logxml c log gfxattr -s -c -x -f $xmltest/testxml d test gfxattr -s -c -x -f $xmltest/aclxml A/a acl gfxattr -s -c -x -f $xmltest/detailxml A/b detail gfxattr -s -c -x -f $xmltest/logxml A/c log gfxattr -s -c -x -f $xmltest/testxml A/d test gfxattr -s -c -x -f $xmltest/aclxml B/a acl gfxattr -s -c -x -f $xmltest/detailxml B/b detail gfxattr -s -c -x -f $xmltest/logxml B/c log gfxattr -s -c -x -f $xmltest/testxml B/d test gfxattr -s -c -x -f $xmltest/aclxml C/a acl gfxattr -s -c -x -f $xmltest/detailxml C/b detail gfxattr -s -c -x -f $xmltest/logxml C/c log gfxattr -s -c -x -f $xmltest/testxml C/d test gfxattr -s -c -x -f $xmltest/aclxml D/a acl gfxattr -s -c -x -f $xmltest/detailxml D/b detail gfxattr -s -c -x -f $xmltest/logxml D/c log gfxattr -s -c -x -f $xmltest/testxml D/d test gfxattr -s -c -x -f $xmltest/aclxml A/A/a acl gfxattr -s -c -x -f $xmltest/detailxml A/A/b detail gfxattr -s -c -x -f $xmltest/logxml A/A/c log gfxattr -s -c -x -f $xmltest/testxml A/A/d test gfxattr -s -c -x -f $xmltest/aclxml A/B/a acl gfxattr -s -c -x -f $xmltest/detailxml A/B/b detail gfxattr -s -c -x -f $xmltest/logxml A/B/c log gfxattr -s -c -x -f $xmltest/testxml A/B/d test gfxattr -s -c -x -f $xmltest/aclxml A/C/a acl gfxattr -s -c -x -f $xmltest/detailxml A/C/b detail gfxattr -s -c -x -f $xmltest/logxml A/C/c log gfxattr -s -c -x -f $xmltest/testxml A/C/d test gfxattr -s -c -x -f $xmltest/aclxml A/D/a acl gfxattr -s -c -x -f $xmltest/detailxml A/D/b detail gfxattr -s -c -x -f $xmltest/logxml A/D/c log gfxattr -s -c -x -f $xmltest/testxml A/D/d test gfxattr -s -c -x -f $xmltest/aclxml B/A/a acl gfxattr -s -c -x -f $xmltest/detailxml B/A/b detail gfxattr -s -c -x -f $xmltest/logxml B/A/c log gfxattr -s -c -x -f $xmltest/testxml B/A/d test gfxattr -s -c -x -f $xmltest/aclxml B/B/a acl gfxattr -s -c -x -f $xmltest/detailxml B/B/b detail gfxattr -s -c -x -f $xmltest/logxml B/B/c log gfxattr -s -c -x -f $xmltest/testxml B/B/d test gfxattr -s -c -x -f $xmltest/aclxml B/C/a acl gfxattr -s -c -x -f $xmltest/detailxml B/C/b detail gfxattr -s -c -x -f $xmltest/logxml B/C/c log gfxattr -s -c -x -f $xmltest/testxml B/C/d test gfxattr -s -c -x -f $xmltest/aclxml B/D/a acl gfxattr -s -c -x -f $xmltest/detailxml B/D/b detail gfxattr -s -c -x -f $xmltest/logxml B/D/c log gfxattr -s -c -x -f $xmltest/testxml B/D/d test gfxattr -s -c -x -f $xmltest/aclxml C/A/a acl gfxattr -s -c -x -f $xmltest/detailxml C/A/b detail gfxattr -s -c -x -f $xmltest/logxml C/A/c log gfxattr -s -c -x -f $xmltest/testxml C/A/d test gfxattr -s -c -x -f $xmltest/aclxml C/B/a acl gfxattr -s -c -x -f $xmltest/detailxml C/B/b detail gfxattr -s -c -x -f $xmltest/logxml C/B/c log gfxattr -s -c -x -f $xmltest/testxml C/B/d test gfxattr -s -c -x -f $xmltest/aclxml C/C/a acl gfxattr -s -c -x -f $xmltest/detailxml C/C/b detail gfxattr -s -c -x -f $xmltest/logxml C/C/c log gfxattr -s -c -x -f $xmltest/testxml C/C/d test gfxattr -s -c -x -f $xmltest/aclxml C/D/a acl gfxattr -s -c -x -f $xmltest/detailxml C/D/b detail gfxattr -s -c -x -f $xmltest/logxml C/D/c log gfxattr -s -c -x -f $xmltest/testxml C/D/d test gfxattr -s -c -x -f $xmltest/aclxml D/A/a acl gfxattr -s -c -x -f $xmltest/detailxml D/A/b detail gfxattr -s -c -x -f $xmltest/logxml D/A/c log gfxattr -s -c -x -f $xmltest/testxml D/A/d test gfxattr -s -c -x -f $xmltest/aclxml D/B/a acl gfxattr -s -c -x -f $xmltest/detailxml D/B/b detail gfxattr -s -c -x -f $xmltest/logxml D/B/c log gfxattr -s -c -x -f $xmltest/testxml D/B/d test gfxattr -s -c -x -f $xmltest/aclxml D/C/a acl gfxattr -s -c -x -f $xmltest/detailxml D/C/b detail gfxattr -s -c -x -f $xmltest/logxml D/C/c log gfxattr -s -c -x -f $xmltest/testxml D/C/d test gfxattr -s -c -x -f $xmltest/aclxml D/D/a acl gfxattr -s -c -x -f $xmltest/detailxml D/D/b detail gfxattr -s -c -x -f $xmltest/logxml D/D/c log gfxattr -s -c -x -f $xmltest/testxml D/D/d test gffindxmlattr //name /A/B gffindxmlattr //name /A gffindxmlattr //name / gfarm-2.4.1/regress/gftool/gfxattr/gfxattr-remove-normal.sh0000644000000000000000000000210311507222725022526 0ustar rootroot# normal xattr remove test - 1 { gfxattr -r / $attrname if [ $? != 0 ]; then exit $exit_fail fi } # normal xattr remove test - 2 { gfxattr -r / $attrname2 if [ $? != 0 ]; then exit $exit_fail fi } # normal xattr remove test - 3 { gfxattr -r / "$attrname"XXX if [ $? == 0 ]; then # must fail if not exists exit $exit_fail fi } # normal xattr remove test - 4 { gfxattr -r $fileX $attrname if [ $? != 0 ]; then exit $exit_fail fi } # normal xattr remove test - 5 { gfxattr -r $fileX $attrname2 if [ $? != 0 ]; then exit $exit_fail fi } # normal xattr remove test - 6 { gfxattr -r $fileX "$attrname"XXX if [ $? == 0 ]; then # must fail if not exists exit $exit_fail fi } echo -n ""> $nameslist # normal xattr list test - 5 { gfxattr -l / > $getnames if [ $? != 0 ]; then exit $exit_fail fi cmp $nameslist $getnames if [ $? != 0 ]; then exit $exit_fail fi } # normal xattr list test - 6 { gfxattr -l $fileX > $getnames if [ $? != 0 ]; then exit $exit_fail fi cmp $nameslist $getnames if [ $? != 0 ]; then exit $exit_fail fi } gfarm-2.4.1/regress/gftool/gfxattr/gfxattr-xml-enabled-common.sh0000644000000000000000000000054411507222725023430 0ustar rootroot# xml xattr test - 1 { echo "aaa" > $attrfile gfxattr -sx -f $attrfile / $attrname if [ $? == 0 ]; then # must be fail because invalid XML data exit $exit_fail fi } # xml xattr test - 2 { echo -n "" > $attrfile gfxattr -sx -f $attrfile / $attrname if [ $? == 0 ]; then # must be fail because rejected by PostgreSQL exit $exit_fail fi } gfarm-2.4.1/regress/gftool/gfxattr/gfxattr-init.sh0000644000000000000000000000055411507222725020716 0ustar rootrootxattrtmp=$data/xattrtest attrfile=$xattrtmp/xattr attrfile2=$xattrtmp/xattr2 getfile=$xattrtmp/xattr.get nameslist=$xattrtmp/xattr.names getnames=$xattrtmp/xattr.names.get statfile=$xattrtmp/xattr.stat getstat=$xattrtmp/xattr.stat.get subdir="dir1" subdir2="dir2" subsubdir="$subdir/dir11" fusemnt="/tmp/xattrroot" fileX="file1" attrname="attr" attrname2="attr2" gfarm-2.4.1/regress/gftool/gfxattr/gfxattr-list-xml.sh0000644000000000000000000000161311507222725021521 0ustar rootroot# xml xattr list test - 1 { echo $attrname > $nameslist gfxattr -lx / > $getnames if [ $? != 0 ]; then exit $exit_fail fi cmp $nameslist $getnames if [ $? != 0 ]; then exit $exit_fail fi } # xml xattr list test - 2 { echo $attrname2 >> $nameslist gfxattr -sx -f $attrfile / $attrname2 gfxattr -lx / > $getnames if [ $? != 0 ]; then exit $exit_fail fi cmp $nameslist $getnames if [ $? != 0 ]; then exit $exit_fail fi } # xml xattr list test - 3 { echo $attrname > $nameslist gfxattr -lx $fileX > $getnames if [ $? != 0 ]; then exit $exit_fail fi cmp $nameslist $getnames if [ $? != 0 ]; then exit $exit_fail fi } # xml xattr list test - 4 { echo $attrname2 >> $nameslist gfxattr -sx -f $attrfile $fileX $attrname2 gfxattr -lx $fileX > $getnames if [ $? != 0 ]; then exit $exit_fail fi cmp $nameslist $getnames if [ $? != 0 ]; then exit $exit_fail fi } gfarm-2.4.1/regress/gftool/gfxattr/gfxattr-list-normal.sh0000644000000000000000000000162111507222725022210 0ustar rootroot# normal xattr list test - 1 { echo $attrname > $nameslist gfxattr -l / > $getnames if [ $? != 0 ]; then exit $exit_fail fi cmp $nameslist $getnames if [ $? != 0 ]; then exit $exit_fail fi } # normal xattr list test - 2 { echo $attrname2 >> $nameslist gfxattr -s -f $attrfile / $attrname2 gfxattr -l / > $getnames if [ $? != 0 ]; then exit $exit_fail fi cmp $nameslist $getnames if [ $? != 0 ]; then exit $exit_fail fi } # normal xattr list test - 3 { echo $attrname > $nameslist gfxattr -l $fileX > $getnames if [ $? != 0 ]; then exit $exit_fail fi cmp $nameslist $getnames if [ $? != 0 ]; then exit $exit_fail fi } # normal xattr list test - 4 { echo $attrname2 >> $nameslist gfxattr -s -f $attrfile $fileX $attrname2 gfxattr -l $fileX > $getnames if [ $? != 0 ]; then exit $exit_fail fi cmp $nameslist $getnames if [ $? != 0 ]; then exit $exit_fail fi } gfarm-2.4.1/regress/gftool/gfxattr/gfxattr-set-xml.sh0000755000000000000000000000516611507222725021353 0ustar rootroot# xml xattr set test - 1 { echo 'Xml1' > $attrfile gfxattr -sx -f $attrfile / $attrname if [ $? != 0 ]; then exit $exit_fail fi gfxattr -gx -f $getfile / $attrname if [ $? != 0 ]; then exit $exit_fail fi cmp $attrfile $getfile if [ $? != 0 ]; then exit $exit_fail fi } # xml xattr set test - 2 { echo 'Xml2' > $attrfile2 gfxattr -sx -c -f $attrfile2 / $attrname if [ $? == 0 ]; then # must fail if already exists exit $exit_fail fi gfxattr -gx -f $getfile / $attrname if [ $? != 0 ]; then exit $exit_fail fi cmp $attrfile $getfile if [ $? != 0 ]; then exit $exit_fail fi } # xml xattr set test - 3 { echo 'Xml3' > $attrfile gfxattr -sx -m -f $attrfile / $attrname if [ $? != 0 ]; then exit $exit_fail fi gfxattr -gx -f $getfile / $attrname if [ $? != 0 ]; then exit $exit_fail fi cmp $attrfile $getfile if [ $? != 0 ]; then exit $exit_fail fi } # xml xattr set test - 4 { echo 'Xml4' > $attrfile gfxattr -sx -m -f $attrfile / "$attrname"4 if [ $? == 0 ]; then # must fail if not exists exit $exit_fail fi } # xml xattr set test - 5 { echo 'Xml5' > $attrfile gfxattr -sx -f $attrfile $subdir $attrname if [ $? != 0 ]; then exit $exit_fail fi gfxattr -gx -f $getfile $subdir $attrname if [ $? != 0 ]; then exit $exit_fail fi cmp $attrfile $getfile if [ $? != 0 ]; then exit $exit_fail fi } # xml xattr set test - 6 { echo 'Xml6' > $attrfile gfxattr -sx -f $attrfile $subsubdir $attrname if [ $? != 0 ]; then exit $exit_fail fi gfxattr -gx -f $getfile $subsubdir $attrname if [ $? != 0 ]; then exit $exit_fail fi cmp $attrfile $getfile if [ $? != 0 ]; then exit $exit_fail fi } # xml xattr set test - 7 { echo 'Xml7' > $attrfile gfxattr -sx -f $attrfile $fileX $attrname if [ $? != 0 ]; then exit $exit_fail fi gfxattr -gx -f $getfile $fileX $attrname if [ $? != 0 ]; then exit $exit_fail fi cmp $attrfile $getfile if [ $? != 0 ]; then exit $exit_fail fi } # xml xattr set test - 8 { echo 'Xml8' > $attrfile gfxattr -sx -f $attrfile $subdir/$fileX $attrname if [ $? != 0 ]; then exit $exit_fail fi gfxattr -gx -f $getfile $subdir/$fileX $attrname if [ $? != 0 ]; then exit $exit_fail fi cmp $attrfile $getfile if [ $? != 0 ]; then exit $exit_fail fi } # xml xattr set test - 8 { echo 'Xml9' > $attrfile gfxattr -sx -f $attrfile $subsubdir/$fileX $attrname if [ $? != 0 ]; then exit $exit_fail fi gfxattr -gx -f $getfile $subsubdir/$fileX $attrname if [ $? != 0 ]; then exit $exit_fail fi cmp $attrfile $getfile if [ $? != 0 ]; then exit $exit_fail fi } gfarm-2.4.1/regress/gftool/gfxattr/gfxattr-xml-enabled.sh0000755000000000000000000000007511507222725022144 0ustar rootroot#!/bin/sh xml_enabled=1 . ./gftool/gfxattr/gfxattr-main.sh gfarm-2.4.1/regress/gftool/gfxattr/gfxattr-limit-normal.sh0000644000000000000000000000401111507222725022347 0ustar rootroot# normal xattr limit test - 1 { echo -n "" > $attrfile gfxattr -s -f $attrfile / $attrname if [ $? != 0 ]; then exit $exit_fail fi gfxattr -g -f $getfile / $attrname if [ $? != 0 ]; then exit $exit_fail fi cmp $attrfile $getfile if [ $? != 0 ]; then exit $exit_fail fi } # normal xattr limit test - 2 { attrfileBig="/etc/services" gfxattr -s -f $attrfileBig / $attrname if [ $? != 0 ]; then exit $exit_fail fi gfxattr -g -f $getfile / $attrname if [ $? != 0 ]; then exit $exit_fail fi cmp $attrfileBig $getfile if [ $? != 0 ]; then exit $exit_fail fi } # normal xattr limit test - 3 { attrfileBig="/usr/local/sbin/gfmd" gfxattr -s -f $attrfileBig / $attrname if [ $? != 0 ]; then exit $exit_fail fi gfxattr -g -f $getfile / $attrname if [ $? != 0 ]; then exit $exit_fail fi cmp $attrfileBig $getfile if [ $? != 0 ]; then exit $exit_fail fi } longname256="1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456" longname257="12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567" # normal xattr limit test - 4 { gfxattr -s -f $attrfile / $longname256 if [ $? != 0 ]; then # must succeed exit $exit_fail fi gfxattr -g / $longname256 if [ $? != 0 ]; then # must succeed exit $exit_fail fi gfxattr -r / $longname256 if [ $? != 0 ]; then # must succeed exit $exit_fail fi } # normal xattr limit test - 5 { gfxattr -s -f $attrfile / $longname257 if [ $? == 0 ]; then # must fail exit $exit_fail fi gfxattr -g / $longname257 if [ $? == 0 ]; then # must fail exit $exit_fail fi gfxattr -r / $longname257 if [ $? == 0 ]; then # must fail exit $exit_fail fi } gfarm-2.4.1/regress/gftool/gfxattr/gfxattr-fuse.sh0000644000000000000000000000231211507222725020707 0ustar rootroot# fuse test - 1 { echo HelloFuse1 > $attrfile cat $attrfile | attr -q -s $attrname $fusemnt if [ $? != 0 ]; then exit $exit_fail fi attr -q -g $attrname $fusemnt > $getfile if [ $? != 0 ]; then exit $exit_fail fi cmp $attrfile $getfile if [ $? != 0 ]; then exit $exit_fail fi } # fuse test - 2 { echo $attrname > $nameslist attr -q -l $fusemnt > $getnames if [ $? != 0 ]; then exit $exit_fail fi cmp $nameslist $getnames if [ $? != 0 ]; then exit $exit_fail fi } # fuse test - 3 { attr -q -r $attrname $fusemnt if [ $? != 0 ]; then exit $exit_fail fi } # fuse test - 4 { echo HelloFuse4 > $attrfile touch $fusemnt/$fileX cat $attrfile | attr -q -s $attrname $fusemnt/$fileX if [ $? != 0 ]; then exit $exit_fail fi attr -q -g $attrname $fusemnt/$fileX > $getfile if [ $? != 0 ]; then exit $exit_fail fi cmp $attrfile $getfile if [ $? != 0 ]; then exit $exit_fail fi } # fuse test - 5 { echo $attrname > $nameslist attr -q -l $fusemnt/$fileX > $getnames if [ $? != 0 ]; then exit $exit_fail fi cmp $nameslist $getnames if [ $? != 0 ]; then exit $exit_fail fi } # fuse test - 6 { attr -q -r $attrname $fusemnt/$fileX if [ $? != 0 ]; then exit $exit_fail fi } gfarm-2.4.1/regress/gftool/gfchmod/0000755000000000000000000000000011507222730015662 5ustar rootrootgfarm-2.4.1/regress/gftool/gfchmod/gfchmod_dir.sh0000755000000000000000000000036411507222725020475 0ustar rootroot#!/bin/sh . ./regress.conf trap 'gfrmdir $gftmp; exit $exit_trap' $trap_sigs if gfmkdir $gftmp && gfchmod $1 $gftmp && [ x"`gfls -ld $gftmp | awk '{ print $1 }'`" = x$2 ]; then exit_code=$exit_pass fi gfrmdir $gftmp exit $exit_code gfarm-2.4.1/regress/gftool/gfchmod/gfchmod_644_file.sh0000755000000000000000000000040211507222725021224 0ustar rootroot#!/bin/sh . ./regress.conf trap 'gfrm $gftmp; exit $exit_trap' $trap_sigs if gfreg $data/1byte $gftmp && gfchmod 644 $gftmp && [ x"`gfls -l $gftmp | awk '{ print $1 }'`" = x"-rw-r--r--" ]; then exit_code=$exit_pass fi gfrm $gftmp exit $exit_code gfarm-2.4.1/regress/gftool/gfchmod/gfchmod_755_dir.sh0000755000000000000000000000010511507222725021066 0ustar rootroot#!/bin/sh . ./regress.conf $testbase/gfchmod_dir.sh 755 drwxr-xr-x gfarm-2.4.1/regress/gftool/gfchmod/gfchmod_700_dir.sh0000755000000000000000000000010511507222725021054 0ustar rootroot#!/bin/sh . ./regress.conf $testbase/gfchmod_dir.sh 700 drwx------ gfarm-2.4.1/regress/gftool/gfchmod/gfchmod_755_file.sh0000755000000000000000000000040211507222725021227 0ustar rootroot#!/bin/sh . ./regress.conf trap 'gfrm $gftmp; exit $exit_trap' $trap_sigs if gfreg $data/1byte $gftmp && gfchmod 755 $gftmp && [ x"`gfls -l $gftmp | awk '{ print $1 }'`" = x"-rwxr-xr-x" ]; then exit_code=$exit_pass fi gfrm $gftmp exit $exit_code gfarm-2.4.1/regress/gftool/gfmv/0000755000000000000000000000000011507222730015212 5ustar rootrootgfarm-2.4.1/regress/gftool/gfmv/file.sh0000755000000000000000000000051011507222725016470 0ustar rootroot#!/bin/sh . ./regress.conf trap 'gfrm $gftmp/xxx $gftmp/1byte; gfrmdir $gftmp; exit $exit_trap' $trap_sigs if gfmkdir $gftmp && gfreg $data/1byte $gftmp/1byte && gfmv $gftmp/1byte $gftmp/xxx && gfexport $gftmp/xxx | cmp -s - $data/1byte; then exit_code=$exit_pass fi gfrm $gftmp/xxx gfrmdir $gftmp exit $exit_code gfarm-2.4.1/regress/gftool/gfmv/dir.sh0000755000000000000000000000054311507222725016335 0ustar rootroot#!/bin/sh . ./regress.conf trap 'gfrmdir $gftmp/yyy $gftmp/xxx $gftmp; exit $exit_trap' $trap_sigs if gfmkdir $gftmp && gfmkdir $gftmp/xxx && gfmv $gftmp/xxx $gftmp/yyy && [ x"`gfls -d $gftmp/xxx`" = x"" ] && [ x"`gfls -d $gftmp/yyy`" = x"$gftmp/yyy" ] && gfrmdir $gftmp/yyy then exit_code=$exit_pass fi gfrmdir $gftmp exit $exit_code gfarm-2.4.1/regress/gftool/gfrm/0000755000000000000000000000000011507222730015206 5ustar rootrootgfarm-2.4.1/regress/gftool/gfrm/0byte.sh0000755000000000000000000000007611507222725016577 0ustar rootroot#!/bin/sh . ./regress.conf sh $testbase/gfrm.sh $data/0byte gfarm-2.4.1/regress/gftool/gfrm/gfrm.sh0000755000000000000000000000043711507222725016510 0ustar rootroot#!/bin/sh . ./regress.conf case $# in 1) datafile=$1;; *) echo "Usage: $0 " >&2 exit $exit_fail;; esac trap 'gfrm $gftmp; exit $exit_trap' $trap_sigs if gfreg $datafile $gftmp && gfrm $gftmp && [ x"`gfls $gftmp`" = x"" ]; then exit_code=$exit_pass fi exit $exit_code gfarm-2.4.1/regress/gftool/gfrm/1byte.sh0000755000000000000000000000007611507222725016600 0ustar rootroot#!/bin/sh . ./regress.conf sh $testbase/gfrm.sh $data/1byte gfarm-2.4.1/regress/gftool/gfln/0000755000000000000000000000000011507222730015201 5ustar rootrootgfarm-2.4.1/regress/gftool/gfln/gfln-s.sh0000755000000000000000000000036211507222725016733 0ustar rootroot#!/bin/sh . ./regress.conf srcpath=aaaaa trap 'gfrm -f $gftmp; exit $exit_trap' $trap_sigs if gfln -s $srcpath $gftmp && gfls -l $gftmp | grep " -> $srcpath"'$' >/dev/null; then exit_code=$exit_pass fi gfrm -f $gftmp exit $exit_code gfarm-2.4.1/regress/gftool/gfln/gfln-s_toolong.sh0000755000000000000000000000252411507222725020476 0ustar rootroot#!/bin/sh . ./regress.conf # 1025 characters (GFARM_PATH_MAX in gfm_proto.h) srcpath=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa trap 'gfrm -f $gftmp; rm -f $localtmp; exit $exit_trap' $trap_sigs if gfln -s $srcpath $gftmp 2>$localtmp; then : elif grep ': file name too long$' $localtmp >/dev/null; then exit_code=$exit_pass fi gfrm -f $gftmp rm -f $localtmp exit $exit_code gfarm-2.4.1/regress/gftool/gfls/0000755000000000000000000000000011507222730015206 5ustar rootrootgfarm-2.4.1/regress/gftool/gfls/notexist.sh0000755000000000000000000000034611507222725017431 0ustar rootroot#!/bin/sh . ./regress.conf trap 'rm -f $localtmp; exit $exit_trap' $trap_sigs gfls /notexist 2>$localtmp if [ $? = 1 ] && cmp -s $localtmp $testbase/notexist.out; then exit_code=$exit_pass fi rm -f $localtmp exit $exit_code gfarm-2.4.1/regress/gftool/gfls/root.out0000644000000000000000000000000211507222725016716 0ustar rootroot/ gfarm-2.4.1/regress/gftool/gfls/root.sh0000755000000000000000000000032011507222725016527 0ustar rootroot#!/bin/sh . ./regress.conf trap 'rm -f $localtmp; exit $exit_trap' $trap_sigs if gfls -d / >$localtmp && cmp -s $localtmp $testbase/root.out; then exit_code=$exit_pass fi rm -f $localtmp exit $exit_code gfarm-2.4.1/regress/gftool/gfls/notexist.out0000644000000000000000000000004511507222725017617 0ustar rootroot/notexist: no such file or directory gfarm-2.4.1/regress/README0000644000000000000000000000067211507222725013652 0ustar rootrootTO RUN TEST 1. "/tmp" directory must exist and must be writable by the user who will run this test. e.g. the following should be done by a gfarm administrator: gfmkdir /tmp gfchmod 777 /tmp 2. run "make check" TO WRITE TEST - each test should be independent from other test. i.e. - each test shouldn't assume the order of the tests. - each test should clear the changes made by the test before exiting. TODO - test by root? - make gfarm-2.4.1/INSTALL.RPM.en0000644000000000000000000000343711507222727013413 0ustar rootroot Gfarm Filesystem Installation Manual About this document =================== This document describes the installation of a Gfarm filesystem using RPM binary packages. Overview ======== To introduce a Gfarm filesystem, RPM packages for a metadata server, filesystem nodes, and client nodes have to be installed. Note that it is possible to install all RPM packages on the same host. Installation of a Gfarm metadata server ======================================= Install RPM packages for the Gfarm metadata server. # rpm -Uvh gfarm-server-X.X.X-X.ARCH.rpm \ gfarm-libs-X.X.X-X.ARCH.rpm Note: The binary package names may be gfarm-gsi-* not gfarm-* if the Package does include GSI authentication. Installation of a Gfarm filesystem node (and client node) ========================================================= Install the RPM packages for a Gfarm filesystem node. # rpm -Uvh gfarm-fsnode-X.X.X-X.ARCH.rpm \ gfarm-libs-X.X.X-X.ARCH.rpm \ gfarm-client-X.X.X-X.ARCH.rpm \ gfarm-doc-X.X.X-X.ARCH.rpm Since each filesystem node is usually a client node, it is necessary to install a client package, too. A document package is optional. Moreover, if you want to use the GfarmFS-FUSE (gfarm2fs) to mount the Gfarm filesystem as a client node, the gfarm2fs package is necessary. # rpm -Uvh gfarm2fs-X.X.X-X.ARCH.rpm Installation of a Gfarm client node =================================== Install RPM packages for a Gfarm client node. # rpm -Uvh gfarm-client-X.X.X-X.ARCH.rpm \ gfarm-libs-X.X.X-X.ARCH.rpm \ gfarm-doc-X.X.X-X.ARCH.rpm A document package is optional. If you want to use the GfarmFS-FUSE to mount the Gfarm file system, install the gfarm2fs package as well. # rpm -Uvh gfarm2fs-X.X.X-X.ARCH.rpm $Id: INSTALL.RPM.en 3857 2007-11-05 06:13:22Z tatebe $ gfarm-2.4.1/gftool/0000755000000000000000000000000011507222730012601 5ustar rootrootgfarm-2.4.1/gftool/gfrep/0000755000000000000000000000000011507222730013704 5ustar rootrootgfarm-2.4.1/gftool/gfrep/gfarm_list.h0000644000000000000000000000124611507222717016214 0ustar rootroot/* * list * * $Id* */ typedef struct gfarm_list { void **array; int length, size; } gfarm_list; #define GFARM_LIST_STRARRAY(list) (list).array #define GFARM_LIST_ELEM(list, i) (list).array[i] #define gfarm_list_length(list) (list)->length #define gfarm_list_elem(list, i) GFARM_LIST_ELEM(*(list), i) gfarm_error_t gfarm_list_init(gfarm_list *); gfarm_error_t gfarm_list_add_list(gfarm_list *, gfarm_list *); gfarm_error_t gfarm_list_add(gfarm_list *, void *); void gfarm_list_free(gfarm_list *); void gfarm_list_free_deeply(gfarm_list *, void (*)(void *)); void *gfarm_array_alloc_from_list(gfarm_list *); void gfarm_array_free_deeply(int, void *, void (*)(void *)); gfarm-2.4.1/gftool/gfrep/gfarm_list.c0000644000000000000000000000544611507222717016215 0ustar rootroot/* * $Id$ */ #include #include #include #include #include "gfarm_list.h" #define GFARM_LIST_INITIAL 50 #define GFARM_LIST_DELTA 50 /* gfarm_list: variable size array */ gfarm_error_t gfarm_list_init(gfarm_list *listp) { void **v; GFARM_MALLOC_ARRAY(v, GFARM_LIST_INITIAL); if (v == NULL) return (GFARM_ERR_NO_MEMORY); listp->size = GFARM_LIST_INITIAL; listp->length = 0; listp->array = v; v[0] = NULL; return (GFARM_ERR_NO_ERROR); } void gfarm_list_free(gfarm_list *listp) { free(listp->array); /* the following is not needed, but to make erroneous program abort */ listp->size = 0; listp->length = 0; listp->array = NULL; } void gfarm_list_free_deeply(gfarm_list *listp, void (*freep)(void *)) { int i, length = gfarm_list_length(listp); for (i = 0; i < length; i++) { if (listp->array[i] != NULL) freep(listp->array[i]); } gfarm_list_free(listp); } gfarm_error_t gfarm_list_add_array(gfarm_list *listp, int al, void **av) { int ll = gfarm_list_length(listp); if (ll + al > listp->size) { int n = listp->size; void **t; do { n += GFARM_LIST_DELTA; } while (ll + al > n); GFARM_REALLOC_ARRAY(t, listp->array, n); if (t == NULL) return (GFARM_ERR_NO_MEMORY); listp->size = n; listp->array = t; } memcpy(&listp->array[ll], av, sizeof(void *) * al); listp->length += al; return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfarm_list_add_list(gfarm_list *listp, gfarm_list *addp) { return (gfarm_list_add_array(listp, gfarm_list_length(addp), addp->array)); } gfarm_error_t gfarm_list_add(gfarm_list *listp, void *s) { int length = gfarm_list_length(listp); if (length >= listp->size) { int n = listp->size + GFARM_LIST_DELTA; void **t; GFARM_REALLOC_ARRAY(t, listp->array, n); if (t == NULL) return (GFARM_ERR_NO_MEMORY); listp->size = n; listp->array = t; } listp->array[length] = s; listp->length++; return (GFARM_ERR_NO_ERROR); } /* gfarm_fixedarray: fixed length array of dynamically allocated entries */ gfarm_error_t gfarm_fixedarray_dup(int n, void **dst, void **src, void *(*dup)(void *)) { int i; for (i = 0; i < n; i++) { dst[i] = dup(src[i]); if (dst[i] == NULL) { while (--i >= 0) { free(dst[i]); dst[i] = NULL; } return (GFARM_ERR_NO_MEMORY); } } return (GFARM_ERR_NO_ERROR); } /* gfarm_array: dynamically allocated entry array and entry contents */ void * gfarm_array_alloc_from_list(gfarm_list *listp) { int n = gfarm_list_length(listp); void **t; GFARM_MALLOC_ARRAY(t, n); if (t == NULL) return (NULL); memcpy(t, listp->array, sizeof(void *) * n); return (t); } void gfarm_array_free_deeply(int n, void *array, void (*freep)(void *)) { int i; void **a = array; for (i = 0; i < n; i++) { if (a[i] != NULL) freep(a[i]); } free(array); } gfarm-2.4.1/gftool/gfrep/gfrep.c0000644000000000000000000005341211507222717015165 0ustar rootroot/* * $Id: gfrep.c 5007 2010-12-29 23:37:53Z tatebe $ */ #include #include #include #include #include #ifdef _OPENMP #include #include #include #include #define LIBGFARM_NOT_MT_SAFE #else static void omp_set_num_threads(int n){ return; } static int omp_get_num_threads(void){ return (1); } static int omp_get_thread_num(void){ return (0); } #endif #include #include "hash.h" #include "config.h" #include "gfm_client.h" #include "gfarm_foreach.h" #include "gfarm_list.h" #define HOSTHASH_SIZE 101 static char *program_name = "gfrep"; /* options */ static int opt_quiet; /* -q */ static int opt_noexec; /* -n */ static int opt_verbose; /* -v */ static int opt_nrep = 1; /* -N */ static int opt_remove; /* -x */ struct gfrep_arg { int ndst, nsrc; char **dst, **src; int *dst_port; }; struct file_info { char *pathname; gfarm_off_t filesize; int ncopy; char **copy; int surplus_ncopy; }; /* for create_filelist */ struct flist { /* domain name */ char *src_domain, *dst_domain; /* hash table from the input host file */ struct gfarm_hash_table *src_hosthash, *dst_hosthash; /* hash table to count the num of source nodes */ struct gfarm_hash_table *srchash; /* file_info list */ gfarm_list slist, dlist; }; static gfarm_error_t gfrep_replicate_to(struct file_info *fi, int di, struct gfrep_arg *a) { return (gfs_replicate_to(fi->pathname, a->dst[di], a->dst_port[di])); } static int remove_replicas(struct file_info *, int, int, char **); static gfarm_error_t gfrep_migrate_to(struct file_info *fi, int di, struct gfrep_arg *a) { gfarm_error_t e; e = gfs_replicate_to(fi->pathname, a->dst[di], a->dst_port[di]); if (e == GFARM_ERR_NO_ERROR) e = remove_replicas(fi, 1, a->nsrc, a->src); return (e); } static gfarm_error_t gfrep_remove_replica(struct file_info *fi, int di, struct gfrep_arg *a) { return (remove_replicas(fi, fi->surplus_ncopy, a->ndst, a->dst)); } struct action { char *msg; gfarm_error_t (*action)(struct file_info *, int, struct gfrep_arg *); }; struct action replicate_mode = { "replicate", gfrep_replicate_to }; struct action migrate_mode = { "migrate", gfrep_migrate_to }; struct action remove_mode = { "remove", gfrep_remove_replica }; struct action *act = &replicate_mode; static void file_info_free(struct file_info *info) { free(info->pathname); if (info->copy != NULL) gfarm_strings_free_deeply(info->ncopy, info->copy); free(info); } static struct file_info * file_info_alloc(void) { struct file_info *i; GFARM_MALLOC(i); if (i == NULL) return (NULL); i->pathname = NULL; i->copy = NULL; return (i); } static gfarm_error_t gfarm_list_add_file_info(char *pathname, gfarm_off_t filesize, int ncopy, char **copy, int surplus, gfarm_list *list) { struct file_info *info; gfarm_error_t e; int i; info = file_info_alloc(); if (info == NULL) return (GFARM_ERR_NO_MEMORY); info->pathname = strdup(pathname); if (info->pathname == NULL) { file_info_free(info); return (GFARM_ERR_NO_MEMORY); } GFARM_MALLOC_ARRAY(info->copy, ncopy); if (info->copy == NULL) { file_info_free(info); return (GFARM_ERR_NO_MEMORY); } for (i = 0; i < ncopy; ++i) { info->copy[i] = strdup(copy[i]); if (info->copy[i] == NULL) { gfarm_strings_free_deeply(i, info->copy); info->copy = NULL; file_info_free(info); return (GFARM_ERR_NO_ERROR); } } info->ncopy = ncopy; info->filesize = filesize; info->surplus_ncopy = surplus; e = gfarm_list_add(list, info); if (e != GFARM_ERR_NO_ERROR) file_info_free(info); return (e); } static gfarm_error_t create_filelist(char *file, struct gfs_stat *st, void *arg) { struct flist *a = arg; int i, j, ncopy, src_ncopy = 0, dst_ncopy = 0; char **copy; gfarm_error_t e; e = gfs_replica_list_by_name(file, &ncopy, ©); if (e != GFARM_ERR_NO_ERROR) return (e); for (i = 0; i < ncopy; ++i) { if ((a->src_hosthash == NULL || gfarm_hash_lookup( a->src_hosthash, copy[i], strlen(copy[i]) + 1)) && gfarm_host_is_in_domain(copy[i], a->src_domain)) { ++src_ncopy; } if ((a->dst_hosthash == NULL || gfarm_hash_lookup( a->dst_hosthash, copy[i], strlen(copy[i]) + 1)) && gfarm_host_is_in_domain(copy[i], a->dst_domain)) { ++dst_ncopy; } } /* * if there is no replica in a set of source nodes or there * are already specified number of replicas in a set of * destination nodes, do not add. */ if (src_ncopy == 0 || dst_ncopy == opt_nrep) { e = GFARM_ERR_NO_ERROR; goto free_copy; } /* add source nodes to srchash to count the number of source nodes */ for (i = 0; i < ncopy; ++i) { char *s = copy[i]; if ((a->src_hosthash == NULL || gfarm_hash_lookup( a->src_hosthash, s, strlen(s) + 1)) && gfarm_host_is_in_domain(s, a->src_domain)) gfarm_hash_enter(a->srchash, s, strlen(s)+1, 0, NULL); } /* add a file info to slist */ for (j = 0; j < opt_nrep - dst_ncopy; ++j) { e = gfarm_list_add_file_info(file, st->st_size, ncopy, copy, 0, &a->slist); if (e != GFARM_ERR_NO_ERROR) goto free_copy; } /* add a file info to dlist if too many file replicas exist */ if (dst_ncopy > opt_nrep) { e = gfarm_list_add_file_info(file, st->st_size, ncopy, copy, dst_ncopy - opt_nrep, &a->dlist); } free_copy: gfarm_strings_free_deeply(ncopy, copy); return (e); } static gfarm_error_t gfarm_hash_to_string_array(struct gfarm_hash_table *hash, int *array_lengthp, char ***arrayp) { struct gfarm_hash_iterator iter; struct gfarm_hash_entry *entry; gfarm_stringlist ls; char *ent, **array; gfarm_error_t e; e = gfarm_stringlist_init(&ls); if (e != GFARM_ERR_NO_ERROR) return (e); for (gfarm_hash_iterator_begin(hash, &iter); !gfarm_hash_iterator_is_end(&iter); gfarm_hash_iterator_next(&iter)) { entry = gfarm_hash_iterator_access(&iter); if (entry != NULL) { ent = strdup(gfarm_hash_entry_key(entry)); if (ent == NULL) e = GFARM_ERR_NO_MEMORY; else e = gfarm_stringlist_add(&ls, ent); } if (e != GFARM_ERR_NO_ERROR) goto stringlist_free; } array = gfarm_strings_alloc_from_stringlist(&ls); if (array == NULL) { e = GFARM_ERR_NO_MEMORY; goto stringlist_free; } *array_lengthp = gfarm_stringlist_length(&ls); *arrayp = array; stringlist_free: if (e == GFARM_ERR_NO_ERROR) gfarm_stringlist_free(&ls); else gfarm_stringlist_free_deeply(&ls); return (e); } static gfarm_error_t create_hash_table_from_string_list(int array_length, char **array, int hashsize, struct gfarm_hash_table **hashp) { struct gfarm_hash_table *hash; int i; hash = gfarm_hash_table_alloc(hashsize, gfarm_hash_casefold, gfarm_hash_key_equal_casefold); if (hash == NULL) return (GFARM_ERR_NO_MEMORY); for (i = 0; i < array_length; ++i) gfarm_hash_enter(hash, array[i], strlen(array[i])+1, 0, NULL); *hashp = hash; return (GFARM_ERR_NO_ERROR); } #include #define gfarm_timerval_sub(t1, t2) \ (((double)(t1)->tv_sec - (double)(t2)->tv_sec) \ + ((double)(t1)->tv_usec - (double)(t2)->tv_usec) * .000001) static void print_gfrep_arg(struct gfrep_arg *arg) { int i; printf("nsrc = %d\n", arg->nsrc); for (i = 0; i < arg->nsrc; ++i) printf("%s\n", arg->src[i]); printf("ndst = %d\n", arg->ndst); for (i = 0; i < arg->ndst; ++i) printf("%s:%d\n", arg->dst[i], arg->dst_port[i]); printf("num_replicas = %d\n", opt_nrep); } static void print_file_info(struct file_info *info) { int i; printf("file: %s, size: %" GFARM_PRId64 "\n", info->pathname, info->filesize); printf("ncopy = %d\n", info->ncopy); for (i = 0; i < info->ncopy; ++i) printf("%s\n", info->copy[i]); fflush(stdout); } static void print_file_list(struct gfarm_list *list) { int i; for (i= 0; i < gfarm_list_length(list); ++i) print_file_info(gfarm_stringlist_elem(list, i)); } static int filesizecmp_inv(const void *a, const void *b) { struct file_info * const *aa = a, * const *bb = b; gfarm_off_t aaa = (*aa)->filesize, bbb = (*bb)->filesize; if (aaa < bbb) return (1); if (aaa > bbb) return (-1); return (0); } static int is_enough_space(char *host, int port, gfarm_off_t size) { gfarm_int32_t bsize; gfarm_off_t blocks, bfree, bavail, files, ffree, favail; gfarm_error_t e; e = gfs_statfsnode(host, port, &bsize, &blocks, &bfree, &bavail, &files, &ffree, &favail); if (e != GFARM_ERR_NO_ERROR) fprintf(stderr, "%s: %s\n", host, gfarm_error_string(e)); if (size < gfarm_get_minimum_free_disk_space()) size = gfarm_get_minimum_free_disk_space(); return (e == GFARM_ERR_NO_ERROR && bavail * bsize >= size); } static int file_copy_does_exist(struct file_info *info, char *host) { int i; for (i = 0; i < info->ncopy; ++i) if (strcmp(info->copy[i], host) == 0) return (1); return (0); } static int remove_replicas(struct file_info *fi, int ncopy, int nhost, char **host) { int i, j, k; gfarm_error_t e, e_save = GFARM_ERR_NO_ERROR; i = 0; /* XXX - linear search */ for (j = 0; j < fi->ncopy && i < ncopy; ++j) for (k = 0; k < nhost && i < ncopy; ++k) { if (strcmp(fi->copy[j], host[k]) == 0) { if (opt_verbose) { printf("remove %s on %s\n", fi->pathname, host[k]); fflush(stdout); } e = gfs_replica_remove_by_file( fi->pathname, host[k]); if (e == GFARM_ERR_NO_ERROR) ++i; else { /* error is always overwritten */ e_save = e; fprintf(stderr, "%s: %s\n", fi->pathname, gfarm_error_string(e)); } } } return (i >= ncopy ? GFARM_ERR_NO_ERROR : e_save); } static gfarm_error_t action(struct action *act, int tnum, int nth, int pi, struct file_info *fi, struct gfrep_arg *arg) { int di, max_niter; int ndst = arg->ndst; char **dst = arg->dst; int *dst_port = arg->dst_port; gfarm_error_t e; di = (tnum + pi * nth) % ndst; /* * check whether the destination node already * has the file replica, or whether the * destination node has enough disk space. * * XXX - the destination may conflict * * fi->surplus_ncopy == 0 means to create file replicas. */ max_niter = ndst; while (1) { while (fi->surplus_ncopy == 0 && (file_copy_does_exist(fi, dst[di]) || ! is_enough_space( dst[di], dst_port[di], fi->filesize)) && max_niter > 0) { if (opt_verbose) printf("%02d: warning: the destination may " "conflict: %s -> %s\n", tnum, dst[di], dst[(di + 1) % ndst]); di = (di + 1) % ndst; --max_niter; } if (max_niter == 0) return (GFARM_ERR_NO_SPACE); if (fi->surplus_ncopy == 0 && opt_verbose) { printf("%02d(%03d): %s --> %s\n", tnum, pi, fi->pathname, dst[di]); fflush(stdout); } e = act->action(fi, di, arg); /* this may happen when this gfrep creates the replica */ if (e == GFARM_ERR_ALREADY_EXISTS || e == GFARM_ERR_OPERATION_ALREADY_IN_PROGRESS) { if (opt_verbose) { printf("%s: %s\n", fi->pathname, gfarm_error_string(e)); printf("%02d: warning: the destination may " "conflict: %s -> %s\n", tnum, dst[di], dst[(di + 1) % ndst]); } di = (di + 1) % ndst; --max_niter; continue; } break; } return (e); } static const char * pfor(struct action *act, int nfinfo, struct file_info **finfo, int nthreads, struct gfrep_arg *arg) { int i, pi, tnum, nth, nerr = 0; gfarm_error_t e; int ndst = arg->ndst, nsrc = arg->nsrc; const char *errmsg; if (ndst <= 0) return ("no destination node"); if (nsrc <= 0) return ("no source node"); if (ndst < opt_nrep) return ("not enough number of destination nodes"); if (nfinfo <= 0) return (NULL); /* no file */ /* sort 'sinfo' in descending order wrt file size */ qsort(finfo, nfinfo, sizeof(*finfo), filesizecmp_inv); if (nthreads <= 0) { nthreads = nfinfo; if (ndst < nthreads) nthreads = ndst; if (nsrc < nthreads) nthreads = nsrc; } if (opt_verbose) { print_gfrep_arg(arg); printf("files: %d\n", nfinfo); #ifdef _OPENMP printf("parallel %s in %d threads\n", act->msg, nthreads); #endif } omp_set_num_threads(nthreads); #pragma omp parallel reduction(+:nerr) private(pi,tnum,nth) { pi = 0; tnum = omp_get_thread_num(); nth = omp_get_num_threads(); #pragma omp for schedule(dynamic) for (i = 0; i < nfinfo; ++i) { struct timeval t1, t2; double t; struct file_info *fi = finfo[i]; #ifdef LIBGFARM_NOT_MT_SAFE pid_t pid; int s, rv; #endif if (opt_noexec || !opt_quiet) printf("%s\n", fi->pathname); if (opt_verbose) print_file_info(fi); if (tnum + pi * nth >= ndst) pi = 0; #ifdef LIBGFARM_NOT_MT_SAFE pid = fork(); if (pid == 0) { e = gfarm_terminate(); if (e == GFARM_ERR_NO_ERROR) e = gfarm_initialize(NULL, NULL); if (e != GFARM_ERR_NO_ERROR) { errmsg = gfarm_error_string(e); goto skip_replication; } #endif if (opt_verbose) gettimeofday(&t1, NULL); if (!opt_noexec) { e = action(act, tnum, nth, pi, fi, arg); errmsg = gfarm_error_string(e); } else { e = GFARM_ERR_NO_ERROR; errmsg = gfarm_error_string(e); } if (opt_verbose && e == GFARM_ERR_NO_ERROR) { gettimeofday(&t2, NULL); t = gfarm_timerval_sub(&t2, &t1); printf("%s: %f sec %f MB/sec\n", fi->pathname, t, fi->filesize / t / 1024 / 1024); } #ifdef LIBGFARM_NOT_MT_SAFE skip_replication: #endif if (e != GFARM_ERR_NO_ERROR) { #ifndef LIBGFARM_NOT_MT_SAFE ++nerr; #endif fprintf(stderr, "%s: %s\n", fi->pathname, errmsg); } #ifdef LIBGFARM_NOT_MT_SAFE fflush(stdout); sync(); _exit(e == GFARM_ERR_NO_ERROR ? 0 : 1); } while ((rv = waitpid(pid, &s, 0)) == -1 && errno == EINTR); if (rv == -1 || (WIFEXITED(s) && WEXITSTATUS(s) != 0)) ++nerr; #endif ++pi; } } return (nerr == 0 ? NULL : "error happens during operations"); } static int usage() { fprintf(stderr, "Usage: %s [-mnqvx] [-S ]" " [-D ]\n", program_name); fprintf(stderr, "\t[-h ] [-H ]" " [-N <#replica>]"); #ifdef _OPENMP fprintf(stderr, " [-j <#thread>]"); #endif fprintf(stderr, "\n\t...\n"); exit(EXIT_FAILURE); } static int error_check(gfarm_error_t e) { if (e == GFARM_ERR_NO_ERROR) return (0); fprintf(stderr, "%s: %s\n", program_name, gfarm_error_string(e)); exit(EXIT_FAILURE); } static void conflict_check(int *mode_ch_p, int ch) { if (*mode_ch_p) { fprintf(stderr, "%s: -%c option conflicts with -%c\n", program_name, ch, *mode_ch_p); usage(); } *mode_ch_p = ch; } static gfarm_error_t create_hosthash_from_file(char *hostfile, int hashsize, struct gfarm_hash_table **hashp) { int error_line = -1, nhosts; gfarm_error_t e; char **hosts; if (hostfile == NULL) { *hashp = NULL; return (GFARM_ERR_NO_ERROR); } e = gfarm_hostlist_read(hostfile, &nhosts, &hosts, &error_line); if (e != GFARM_ERR_NO_ERROR) { if (error_line != -1) fprintf(stderr, "%s: line %d: %s\n", hostfile, error_line, gfarm_error_string(e)); else fprintf(stderr, "%s: %s\n", hostfile, gfarm_error_string(e)); exit(EXIT_FAILURE); } e = create_hash_table_from_string_list(nhosts, hosts, HOSTHASH_SIZE, hashp); gfarm_strings_free_deeply(nhosts, hosts); return (e); } static int compare_available_capacity(const void *s1, const void *s2) { const struct gfarm_host_sched_info *h1 = s1; const struct gfarm_host_sched_info *h2 = s2; gfarm_uint64_t a1, a2; a1 = h1->disk_avail; a2 = h2->disk_avail; if (a1 < a2) return (-1); else if (a1 > a2) return (1); else return (0); } static int compare_available_capacity_r(const void *s1, const void *s2) { return (-compare_available_capacity(s1, s2)); } /* * XXX FIXME * - should use appropriate metadata server for the file, * - maybe(?) should use gfm_client_schedule_file instead. */ gfarm_error_t schedule_host_domain(const char *domain, int *nhostsp, struct gfarm_host_sched_info **hostsp) { gfarm_error_t e; struct gfm_connection *gfm_server; if ((e = gfm_client_connection_and_process_acquire( gfarm_metadb_server_name, gfarm_metadb_server_port, &gfm_server)) != GFARM_ERR_NO_ERROR) return (e); e = gfm_client_schedule_host_domain(gfm_server, domain, nhostsp, hostsp); gfm_client_connection_free(gfm_server); return (e); } static gfarm_error_t create_hostlist_by_domain_and_hash(char *domain, struct gfarm_hash_table *hosthash, int *nhostsp, char ***hostsp, int **portsp) { int ninfo, i, j, *ports, nhosts; struct gfarm_host_sched_info *infos; char **hosts; gfarm_error_t e; e = schedule_host_domain(domain, &ninfo, &infos); if (e != GFARM_ERR_NO_ERROR) return (e); /* sort 'infos' in descending order wrt available capacity */ qsort(infos, ninfo, sizeof(*infos), compare_available_capacity_r); /* eliminate file system nodes that do not have enough space */ for (i = 0; i < ninfo; ++i) if (infos[i].disk_avail < gfarm_get_minimum_free_disk_space()) break; nhosts = i; /* XXX - abandon CPU load and available capacity */ GFARM_MALLOC_ARRAY(hosts, nhosts); if (hosts == NULL) { gfarm_host_sched_info_free(ninfo, infos); return (GFARM_ERR_NO_MEMORY); } GFARM_MALLOC_ARRAY(ports, nhosts); if (ports == NULL) { free(hosts); gfarm_host_sched_info_free(ninfo, infos); return (GFARM_ERR_NO_MEMORY); } for (i = 0, j = 0; i < nhosts; ++i) { char *host = infos[i].host; if (hosthash == NULL || gfarm_hash_lookup(hosthash, host, strlen(host) + 1)) { hosts[j] = strdup(host); ports[j] = infos[i].port; if (hosts[j] == NULL) { gfarm_strings_free_deeply(j, hosts); return (GFARM_ERR_NO_MEMORY); } ++j; } } gfarm_host_sched_info_free(ninfo, infos); *hostsp = hosts; *portsp = ports; *nhostsp = j; return (e); } static const char * pfor_list(struct action *act, gfarm_list *list, int parallel, struct gfrep_arg *gfrep_arg) { struct file_info **finfo; int nfinfo; const char *errmsg; finfo = gfarm_array_alloc_from_list(list); nfinfo = gfarm_list_length(list); errmsg = pfor(act, nfinfo, finfo, parallel, gfrep_arg); gfarm_array_free_deeply(nfinfo, finfo, (void (*)(void *))file_info_free); return (errmsg); } int main(int argc, char *argv[]) { char *src_hostfile = NULL, *dst_hostfile = NULL; gfarm_stringlist paths; gfs_glob_t types; int mode_src_ch = 0, mode_dst_ch = 0, parallel = -1; int i, ch; gfarm_error_t e; const char *errmsg, *errmsg2 = NULL; struct gfrep_arg gfrep_arg; struct flist flist; if (argc >= 1) program_name = basename(argv[0]); memset(&gfrep_arg, 0, sizeof(gfrep_arg)); memset(&flist, 0, sizeof(flist)); flist.src_domain = ""; flist.dst_domain = ""; e = gfarm_initialize(&argc, &argv); error_check(e); #ifdef _OPENMP while ((ch = getopt(argc, argv, "h:j:mnqvxS:D:H:N:?")) != -1) { #else while ((ch = getopt(argc, argv, "h:mnqvxS:D:H:N:?")) != -1) { #endif switch (ch) { case 'h': src_hostfile = optarg; conflict_check(&mode_src_ch, ch); break; #ifdef _OPENMP case 'j': parallel = strtol(optarg, NULL, 0); break; #endif case 'm': act = &migrate_mode; break; case 'n': opt_noexec = 1; break; case 'q': opt_quiet = 1; break; case 'v': opt_verbose = 1; break; case 'x': opt_remove = 1; break; case 'S': flist.src_domain = optarg; conflict_check(&mode_src_ch, ch); break; case 'D': flist.dst_domain = optarg; conflict_check(&mode_dst_ch, ch); break; case 'H': dst_hostfile = optarg; conflict_check(&mode_dst_ch, ch); break; case 'N': opt_nrep = strtol(optarg, NULL, 0); break; case '?': default: usage(); } } argc -= optind; argv += optind; /* make writing-to-stderr atomic, for GfarmFS-FUSE log output */ setvbuf(stderr, NULL, _IOLBF, 0); if (!opt_quiet) { printf("constructing file list..."); fflush(stdout); } e = gfarm_stringlist_init(&paths); if (e == GFARM_ERR_NO_ERROR) { e = gfs_glob_init(&types); if (e == GFARM_ERR_NO_ERROR) { for (i = 0; i < argc; i++) gfs_glob(argv[i], &paths, &types); gfs_glob_free(&types); } } error_check(e); e = gfarm_list_init(&flist.slist); error_check(e); e = gfarm_list_init(&flist.dlist); error_check(e); flist.srchash = gfarm_hash_table_alloc(HOSTHASH_SIZE, gfarm_hash_casefold, gfarm_hash_key_equal_casefold); if (flist.srchash == NULL) error_check(GFARM_ERR_NO_MEMORY); e = create_hosthash_from_file(src_hostfile, HOSTHASH_SIZE, &flist.src_hosthash); error_check(e); e = create_hosthash_from_file(dst_hostfile, HOSTHASH_SIZE, &flist.dst_hosthash); error_check(e); for (i = 0; i < gfarm_stringlist_length(&paths); i++) { char *file = gfarm_stringlist_elem(&paths, i); e = gfarm_foreach_directory_hierarchy( create_filelist, NULL, NULL, file, &flist); if (e != GFARM_ERR_NO_ERROR) break; } gfarm_stringlist_free_deeply(&paths); error_check(e); if (!opt_quiet) printf(" done\n"); if (opt_verbose) { printf("files to be replicated\n"); print_file_list(&flist.slist); } if (opt_verbose && opt_remove) { printf("files having too many replicas\n"); print_file_list(&flist.dlist); } if (gfarm_list_length(&flist.slist) <= 0 && (!opt_remove || gfarm_list_length(&flist.dlist) <= 0)) exit(0); /* no file */ /* replicate files */ e = gfarm_hash_to_string_array( flist.srchash, &gfrep_arg.nsrc, &gfrep_arg.src); error_check(e); gfarm_hash_table_free(flist.srchash); if (!opt_quiet) { printf("investigating hosts..."); fflush(stdout); } e = create_hostlist_by_domain_and_hash( flist.dst_domain, flist.dst_hosthash, &gfrep_arg.ndst, &gfrep_arg.dst, &gfrep_arg.dst_port); error_check(e); if (!opt_quiet) printf(" done\n"); errmsg = pfor_list(act, &flist.slist, parallel, &gfrep_arg); gfarm_list_free(&flist.slist); /* remove file replicas */ if (opt_remove) errmsg2 = pfor_list( &remove_mode, &flist.dlist, parallel, &gfrep_arg); gfarm_list_free(&flist.dlist); if (errmsg == NULL) errmsg = errmsg2; if (errmsg != NULL) fprintf(stderr, "%s\n", errmsg), exit(EXIT_FAILURE); gfarm_strings_free_deeply(gfrep_arg.nsrc, gfrep_arg.src); gfarm_strings_free_deeply(gfrep_arg.ndst, gfrep_arg.dst); free(gfrep_arg.dst_port); e = gfarm_terminate(); error_check(e); return (0); } gfarm-2.4.1/gftool/gfrep/Makefile0000644000000000000000000000120011507222717015342 0ustar rootroot# $Id: Makefile 4260 2009-09-17 02:43:12Z tatebe $ top_builddir = ../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk SRCS = gfrep.c gfarm_list.c OBJS = gfrep.o gfarm_list.o PROGRAM = gfrep #CC = omcc #OMPFLAGS = -fopenmp CFLAGS = $(OMPFLAGS) $(COMMON_CFLAGS) -I$(GFUTIL_SRCDIR) -I$(GFARMLIB_SRCDIR) $(openssl_includes) LDLIBS = $(COMMON_LDFLAGS) $(GFARMLIB) $(LIBS) DEPLIBS = $(DEPGFARMLIB) all: $(PROGRAM) include $(top_srcdir)/makes/prog.mk ### $(OBJS): $(DEPGFARMINC) $(GFUTIL_SRCDIR)/hash.h $(GFARMLIB_SRCDIR)/config.h $(GFARMLIB_SRCDIR)/gfm_client.h $(GFARMLIB_SRCDIR)/gfarm_foreach.h gfarm_list.h gfarm-2.4.1/gftool/gfrep/gfrep_simple.c0000644000000000000000000000330511507222717016532 0ustar rootroot/* * $Id$ */ #include #include #include #include #include #include "metadb_server.h" char *program_name = "gfrep"; static int usage() { fprintf(stderr, "Usage: %s [-s srchost] -d dsthost file\n", program_name); exit(EXIT_FAILURE); } int main(int argc, char *argv[]) { char *src = NULL, *dst = NULL, *f, c; struct gfarm_host_info sinfo, dinfo; gfarm_error_t e; if (argc > 0) program_name = basename(argv[0]); e = gfarm_initialize(&argc, &argv); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", program_name, gfarm_error_string(e)); exit(EXIT_FAILURE); } while ((c = getopt(argc, argv, "d:s:h?")) != -1) { switch (c) { case 'd': dst = optarg; break; case 's': src = optarg; break; case 'h': case '?': default: usage(); } } argc -= optind; argv += optind; if (dst == NULL) usage(); if (src != NULL) { e = gfarm_host_info_get_by_name_alias(src, &sinfo); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", src, gfarm_error_string(e)); exit(EXIT_FAILURE); } } e = gfarm_host_info_get_by_name_alias(dst, &dinfo); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", dst, gfarm_error_string(e)); exit(EXIT_FAILURE); } f = *argv; e = gfs_replicate_from_to(f, src, sinfo.port, dst, dinfo.port); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", f, gfarm_error_string(e)); exit(EXIT_FAILURE); } if (src != NULL) gfarm_host_info_free(&sinfo); gfarm_host_info_free(&dinfo); e = gfarm_terminate(); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", program_name, gfarm_error_string(e)); exit(EXIT_FAILURE); } return (0); } gfarm-2.4.1/gftool/gfhost/0000755000000000000000000000000011507222730014073 5ustar rootrootgfarm-2.4.1/gftool/gfhost/gfhost.c0000644000000000000000000011145611507222717015546 0ustar rootroot/* * $Id: gfhost.c 4831 2010-07-17 13:37:18Z tatebe $ */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "gfevent.h" #include "liberror.h" #include "host.h" /* gfm_host_info_address_get() */ #include "auth.h" #include "gfm_client.h" #include "gfs_client.h" #include "lookup.h" #include "config.h" char *program_name = "gfhost"; struct gfm_connection *gfm_server = NULL; /**********************************************************************/ /* register application specific error number */ static const char *app_error_map[] = { #define APP_ERR_IMPLEMENTATION_INDEX 0 #define APP_ERR_IMPLEMENTATION app_error(0) "implementation error, invalid error number", #define APP_ERR_HOSTNAME_IS_ALREADY_REGISERED app_error(1) "the hostname is already registered", #define APP_ERR_HOSTALIAS_IS_ALREADY_REGISERED app_error(2) "the hostalias is already registered", }; const char * app_error_code_to_message(void *cookie, int code) { if (code < 0 || code >= GFARM_ARRAY_LENGTH(app_error_map)) return (app_error_map[APP_ERR_IMPLEMENTATION_INDEX]); else return (app_error_map[code]); } gfarm_error_t app_error(int code) { static struct gfarm_error_domain *app_error_domain = NULL; if (app_error_domain == NULL) { gfarm_error_t e = gfarm_error_domain_alloc( 0, GFARM_ARRAY_LENGTH(app_error_map) - 1, app_error_code_to_message, NULL, &app_error_domain); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: gfarm_error_domain_alloc: %s\n", program_name, gfarm_error_string(e)); exit(EXIT_FAILURE); } } return (gfarm_error_domain_map(app_error_domain, code)); } /**********************************************************************/ static gfarm_error_t update_host(const char *hostname, int port, int nhostaliases, char **hostaliases, char *architecture, int ncpu, int flags, gfarm_error_t (*update_op)(struct gfm_connection *, const struct gfarm_host_info *)) { struct gfarm_host_info hi; hi.hostname = (char *)hostname; /* UNCONST */ hi.port = port; hi.nhostaliases = nhostaliases; hi.hostaliases = hostaliases; hi.architecture = architecture; hi.ncpu = ncpu; hi.flags = flags; return ((*update_op)(gfm_server, &hi)); } static gfarm_error_t check_hostname(char *hostname) { gfarm_error_t e; char *n; int p; e = gfm_host_get_canonical_name(gfm_server, hostname, &n, &p); if (e == GFARM_ERR_NO_ERROR) { free(n); return (APP_ERR_HOSTNAME_IS_ALREADY_REGISERED); } /* XXX TODO: e == GFARM_ERR_AMBIGUOUS_RESULT? */ return (GFARM_ERR_NO_ERROR); } static gfarm_error_t check_hostaliases(int nhostaliases, char **hostaliases) { int i; for (i = 0; i < nhostaliases; i++) { if (check_hostname(hostaliases[i]) != GFARM_ERR_NO_ERROR) return (APP_ERR_HOSTALIAS_IS_ALREADY_REGISERED); } return (GFARM_ERR_NO_ERROR); } gfarm_error_t add_host(char *hostname, int port, char **hostaliases, char *architecture, int ncpu, int flags) { int nhostaliases = gfarm_strarray_length(hostaliases); gfarm_error_t e; e = check_hostname(hostname); if (e != GFARM_ERR_NO_ERROR) return (e); e = check_hostaliases(nhostaliases, hostaliases); if (e != GFARM_ERR_NO_ERROR) return (e); return (update_host(hostname, port, nhostaliases, hostaliases, architecture, ncpu, flags, gfm_client_host_info_set)); } gfarm_error_t gfarm_modify_host(const char *hostname, int port, char **hostaliases, char *architecture, int ncpu, int flags, int add_aliases) { gfarm_error_t e, e2; struct gfarm_host_info hi; int host_info_needs_free = 0; gfarm_stringlist aliases; if (port == 0 || *hostaliases == NULL || architecture == NULL || ncpu < 1 || flags == -1 || add_aliases) { e = gfm_client_host_info_get_by_names(gfm_server, 1, &hostname, &e2, &hi); if (e != GFARM_ERR_NO_ERROR) return (e); if (e2 != GFARM_ERR_NO_ERROR) return (e2); host_info_needs_free = 1; if (!add_aliases) { /* XXX - do check_hostaliases() here, too. */ hostaliases = hostaliases; } else { e = check_hostaliases( gfarm_strarray_length(hostaliases), hostaliases); if (e != GFARM_ERR_NO_ERROR) goto free_host_info; e = gfarm_stringlist_init(&aliases); if (e != GFARM_ERR_NO_ERROR) goto free_host_info; if (hi.hostaliases != NULL) { e = gfarm_stringlist_cat(&aliases, hi.hostaliases); if (e != GFARM_ERR_NO_ERROR) goto free_aliases; } if (hostaliases != NULL) { e = gfarm_stringlist_cat(&aliases, hostaliases); if (e != GFARM_ERR_NO_ERROR) goto free_aliases; } e = gfarm_stringlist_add(&aliases, NULL); if (e != GFARM_ERR_NO_ERROR) goto free_aliases; hostaliases = GFARM_STRINGLIST_STRARRAY(aliases); } if (port == 0) port = hi.port; if (architecture == NULL) architecture = hi.architecture; if (ncpu < 1) ncpu = hi.ncpu; if (flags == -1) flags = hi.flags; } e = update_host(hostname, port, gfarm_strarray_length(hostaliases), hostaliases, architecture, ncpu, flags, gfm_client_host_info_modify); #if 0 /* XXX FIXME not yet in v2 */ if (e == GFARM_ERR_NO_ERROR && !add_aliases && *hostaliases == NULL) e = gfarm_host_info_remove_hostaliases(hostname); #endif free_aliases: if (add_aliases) gfarm_stringlist_free(&aliases); free_host_info: if (host_info_needs_free) gfarm_host_info_free(&hi); return (e); } char * validate_architecture(char *architecture) { unsigned char c, *s = (unsigned char *)architecture; while ((c = *s++) != '\0') { if (!isalnum(c) && c != '-' && c != '_' && c != '.') return ((char *)s - 1); } return (NULL); } char * validate_hostname(char *hostname) { unsigned char c, *s = (unsigned char *)hostname; while ((c = *s++) != '\0') { if (!isalnum(c) && c != '-' && c != '.') return ((char *)s - 1); } return (NULL); } gfarm_error_t invalid_input(int lineno) { fprintf(stderr, "line %d: invalid input format\n", lineno); fprintf(stderr, "%s: input must be \"" " ..." "\" format\n", program_name); return (GFARM_ERR_INVALID_ARGUMENT); } static char space[] = " \t"; gfarm_error_t parse_string_long(char **linep, int lineno, const char *diag, long *retvalp) { char *line = *linep, *s; int len; long retval; line += strspn(line, space); /* skip space */ len = strcspn(line, space); if (len == 0) return (invalid_input(lineno)); else if (line[len] != '\0') { line[len] = '\0'; ++len; } errno = 0; retval = strtol(line, &s, 0); if (s == line) { return (invalid_input(lineno)); } else if (*s != '\0') { fprintf(stderr, "line %d: garbage \"%s\" in %s \"%s\"\n", lineno, s, diag, line); return (GFARM_ERR_INVALID_ARGUMENT); } else if (errno != 0 && (retval == LONG_MIN || retval == LONG_MAX)) { fprintf(stderr, "line %d: %s on \"%s\"\n", lineno, strerror(errno), line); return (GFARM_ERR_INVALID_ARGUMENT); } line += len; *linep = line; *retvalp = retval; return (GFARM_ERR_NO_ERROR); } #define LINE_BUFFER_SIZE 16384 #define MAX_HOSTALIASES 256 gfarm_error_t add_line(char *line, int lineno) { gfarm_error_t e; long port, ncpu, flags; int len, nhostaliases; char *s, *hostname, *architecture; char *hostaliases[MAX_HOSTALIASES + 1]; /* parse architecture */ line += strspn(line, space); /* skip space */ len = strcspn(line, space); if (len == 0 || line[len] == '\0') return (invalid_input(lineno)); line[len] = '\0'; architecture = line; line += len + 1; s = validate_architecture(architecture); if (s != NULL) { fprintf(stderr, "line %d: invalid character '%c' in architecture \"%s\"\n", lineno, *s, architecture); return (GFARM_ERR_INVALID_ARGUMENT); } e = parse_string_long(&line, lineno, "ncpu", &ncpu); if (e != GFARM_ERR_NO_ERROR) return (e); /* parse hostname */ line += strspn(line, space); /* skip space */ len = strcspn(line, space); if (len == 0) return (invalid_input(lineno)); hostname = line; if (line[len] == '\0') { line += len; } else { line[len] = '\0'; line += len + 1; } s = validate_hostname(hostname); if (s != NULL) { fprintf(stderr, "line %d: invalid character '%c' in hostname \"%s\"\n", lineno, *s, hostname); return (GFARM_ERR_INVALID_ARGUMENT); } e = parse_string_long(&line, lineno, "port", &port); if (e != GFARM_ERR_NO_ERROR) return (e); e = parse_string_long(&line, lineno, "flags", &flags); if (e != GFARM_ERR_NO_ERROR) return (e); /* parse hostaliases */ for (nhostaliases = 0;; nhostaliases++) { line += strspn(line, space); /* skip space */ if (*line == '\0') break; len = strcspn(line, space); /* assert(len > 0); */ if (nhostaliases >= MAX_HOSTALIASES) { fprintf(stderr, "line %d: " "number of hostaliases exceeds %d\n", lineno, nhostaliases); return (GFARM_ERR_INVALID_ARGUMENT); } hostaliases[nhostaliases] = line; if (line[len] == '\0') { line += len; } else { line[len] = '\0'; line += len + 1; } s = validate_hostname(hostaliases[nhostaliases]); if (s != NULL) { fprintf(stderr, "line %d: " "invalid character '%c' in hostalias \"%s\"\n", lineno, *s, hostaliases[nhostaliases]); return (GFARM_ERR_INVALID_ARGUMENT); } } hostaliases[nhostaliases] = NULL; e = add_host(hostname, port, hostaliases, architecture, ncpu, flags); if (e != GFARM_ERR_NO_ERROR) fprintf(stderr, "line %d: %s\n", lineno, gfarm_error_string(e)); return (e); } gfarm_error_t register_db(void) { gfarm_error_t e, e_save = GFARM_ERR_NO_ERROR; int len, lineno; char line[LINE_BUFFER_SIZE]; if (fgets(line, sizeof line, stdin) == NULL) return (GFARM_ERR_NO_ERROR); len = strlen(line); for (lineno = 1;; lineno++) { if (len > 0 && line[len - 1] == '\n') { line[len - 1] = '\0'; } else { fprintf(stderr, "line %d: too long line\n", lineno); if (e_save == GFARM_ERR_NO_ERROR) e_save = GFARM_ERR_INVALID_ARGUMENT; do { if (fgets(line, sizeof line, stdin) == NULL) return (e_save); len = strlen(line); } while (len == 0 || line[len - 1] != '\n'); continue; } e = add_line(line, lineno); if (e_save == GFARM_ERR_NO_ERROR) e_save = e; if (fgets(line, sizeof line, stdin) == NULL) break; len = strlen(line); } return (e_save); } /* * Handle the case where opt_use_metadb == 0. * In that case, the host_info is faked, and all members in the info structure * except info->hostname are not valid. (see list_gfsd_info()) */ gfarm_error_t resolv_addr_without_metadb( const char *hostname, int port, struct gfarm_host_info *info, struct sockaddr *addr, char **if_hostnamep) { /* sizeof(struct sockaddr_in) == sizeof(struct sockaddr) */ struct sockaddr_in *addr_in = (struct sockaddr_in *)addr; struct hostent *hp; hp = gethostbyname(hostname); if (hp == NULL || hp->h_addrtype != AF_INET) return (GFARM_ERR_UNKNOWN_HOST); memset(addr_in, 0, sizeof(*addr_in)); memcpy(&addr_in->sin_addr, hp->h_addr, sizeof(addr_in->sin_addr)); addr_in->sin_family = hp->h_addrtype; addr_in->sin_port = htons(port); if (if_hostnamep != NULL) { *if_hostnamep = strdup(hostname); if (*if_hostnamep == NULL) return (GFARM_ERR_NO_MEMORY); } return (GFARM_ERR_NO_ERROR); } /* * handle option "-i" (ignore "address_use" directive in gfarm.conf(5)) */ gfarm_error_t resolv_addr_without_address_use( const char *hostname, int port, struct gfarm_host_info *info, struct sockaddr *addr, char **if_hostnamep) { gfarm_error_t e = resolv_addr_without_metadb(hostname, port, NULL, addr, if_hostnamep); int i; if (e == GFARM_ERR_NO_ERROR) return (GFARM_ERR_NO_ERROR); for (i = 0; i < info->nhostaliases; i++) { e = resolv_addr_without_metadb( info->hostaliases[i], port, NULL, addr, if_hostnamep); if (e == GFARM_ERR_NO_ERROR) return (GFARM_ERR_NO_ERROR); } return (e); } gfarm_error_t (*opt_resolv_addr)(const char *, int, struct gfarm_host_info *, struct sockaddr *, char **) = #if 0 /* XXX FIXME not yet in v2 */ gfarm_host_info_address_get; #else resolv_addr_without_address_use; #endif /* * extend the result of gfarm_auth_method_mnemonic() */ #define MNEMONIC_AUTH_FAIL 'x' #define MNEMONIC_NOT_TRIED '-' char mnemonic(struct gfs_connection *gfs_server, struct gfs_client_load *load) { if (gfs_server != NULL) return (gfarm_auth_method_mnemonic( gfs_client_connection_auth_method(gfs_server))); if (load != NULL) return (MNEMONIC_AUTH_FAIL); /* c.f. LOADAVG_AVAIL() */ return (MNEMONIC_NOT_TRIED); } /* * sort output */ struct output { void *closure; char *canonical_hostname; struct sockaddr peer_addr; struct gfs_client_load load; char auth_mnemonic; gfarm_error_t error; }; #define OUTPUT_INITIAL_SPACE 130 int output_number = 0, output_space; struct output *output_buffer = NULL; void (*output_callback)(struct output *); int output_record; int output_sort_reverse = 0; #define LOADAVG_AVAIL(o) ((o)->auth_mnemonic != MNEMONIC_NOT_TRIED) int output_cmp_by_name(const void *a, const void *b) { const struct output *o1, *o2; if (output_sort_reverse) { o1 = b; o2 = a; } else { o1 = a; o2 = b; } return (strcmp(o1->canonical_hostname, o2->canonical_hostname)); } int output_cmp_by_loadavg(const void *a, const void *b) { const struct output *o1, *o2; if (output_sort_reverse) { o1 = b; o2 = a; } else { o1 = a; o2 = b; } if (!LOADAVG_AVAIL(o1) && !LOADAVG_AVAIL(o2)) return (0); else if (!LOADAVG_AVAIL(o2)) /* treat NULL as infinity */ return (-1); else if (!LOADAVG_AVAIL(o1)) return (1); else if (o1->load.loadavg_1min < o2->load.loadavg_1min) return (-1); else if (o1->load.loadavg_1min > o2->load.loadavg_1min) return (1); else return (0); } void output_sort(int (*cmp)(const void *, const void *)) { int i; qsort(output_buffer, output_number, sizeof(*output_buffer), cmp); for (i = 0; i < output_number; i++) (*output_callback)(&output_buffer[i]); } void output_add(struct output *o) { if (output_buffer == NULL || output_number >= output_space) { if (output_buffer == NULL) output_space = OUTPUT_INITIAL_SPACE; else output_space += output_space; GFARM_REALLOC_ARRAY(output_buffer, output_buffer, output_space); if (output_buffer == NULL) { fprintf(stderr, "no memory to record %d hosts\n", output_number); exit(EXIT_FAILURE); } } output_buffer[output_number++] = *o; } void output_process(void *closure, char *canonical_hostname, struct sockaddr *peer_addr, struct gfs_client_load *load, struct gfs_connection *gfs_server, gfarm_error_t error) { struct output o; o.closure = closure; o.canonical_hostname = canonical_hostname; if (peer_addr != NULL) o.peer_addr = *peer_addr; if (load != NULL) o.load = *load; o.auth_mnemonic = mnemonic(gfs_server, load); o.error = error; assert((load != NULL) == LOADAVG_AVAIL(&o)); if (output_record) output_add(&o); else /* i.e. don't sort */ (*output_callback)(&o); } /* * parallel access wrapper */ struct gfarm_paraccess { struct gfarm_eventqueue *q; int try_auth; struct gfarm_access { void *closure; char *canonical_hostname; int port; struct sockaddr peer_addr; struct gfs_client_load load; void *protocol_state; struct gfarm_paraccess *pa; struct gfarm_access *next; } *access_state; struct gfarm_access *free_list; int concurrency, nfree; }; gfarm_error_t gfarm_paraccess_alloc( int concurrency, int try_auth, struct gfarm_paraccess **pap) { struct gfarm_paraccess *pa; int i; GFARM_MALLOC(pa); if (pa == NULL) return (GFARM_ERR_NO_MEMORY); pa->q = gfarm_eventqueue_alloc(); if (pa->q == NULL) { free(pa); return (GFARM_ERR_NO_MEMORY); } GFARM_MALLOC_ARRAY(pa->access_state, concurrency); if (pa->access_state == NULL) { gfarm_eventqueue_free(pa->q); free(pa); return (GFARM_ERR_NO_MEMORY); } /* construct free slot list */ i = concurrency - 1; pa->access_state[i].next = NULL; while (--i >= 0) pa->access_state[i].next = &pa->access_state[i + 1]; pa->free_list = &pa->access_state[0]; pa->concurrency = pa->nfree = concurrency; pa->try_auth = try_auth; *pap = pa; return (GFARM_ERR_NO_ERROR); } static void gfarm_paraccess_callback(struct gfarm_paraccess *pa, struct gfarm_access *a, struct gfs_client_load *load, struct gfs_connection *gfs_server, gfarm_error_t e) { output_process(a->closure, a->canonical_hostname, &a->peer_addr, load, gfs_server, e); /* bring this back to the free slot list */ a->next = pa->free_list; pa->free_list = a; pa->nfree++; } static void gfarm_paraccess_load_finish(void *closure) { struct gfarm_access *a = closure; gfarm_error_t e; e = gfs_client_get_load_result_multiplexed(a->protocol_state, &a->load); gfarm_paraccess_callback(a->pa, a, e == GFARM_ERR_NO_ERROR ? &a->load : NULL, NULL, e); } static void gfarm_paraccess_connect_finish(void *closure) { struct gfarm_access *a = closure; gfarm_error_t e; struct gfs_connection *gfs_server; e = gfs_client_connect_result_multiplexed(a->protocol_state, &gfs_server); if (e != GFARM_ERR_NO_ERROR) { gfarm_paraccess_callback(a->pa, a, &a->load, NULL, e); return; } gfarm_paraccess_callback(a->pa, a, &a->load, gfs_server, e); gfs_client_connection_free(gfs_server); } static void gfarm_paraccess_connect_request(void *closure) { struct gfarm_access *a = closure; gfarm_error_t e; struct gfs_client_connect_state *cs; e = gfs_client_get_load_result_multiplexed(a->protocol_state, &a->load); if (e != GFARM_ERR_NO_ERROR) { gfarm_paraccess_callback(a->pa, a, NULL, NULL, e); return; } e = gfs_client_connect_request_multiplexed(a->pa->q, a->canonical_hostname, &a->peer_addr, gfarm_paraccess_connect_finish, a, &cs); if (e != GFARM_ERR_NO_ERROR) { gfarm_paraccess_callback(a->pa, a, &a->load, NULL, e); return; } a->protocol_state = cs; } gfarm_error_t gfarm_paraccess_request(struct gfarm_paraccess *pa, void *closure, char *canonical_hostname, int port, struct sockaddr *peer_addr) { int rv; gfarm_error_t e; struct gfarm_access *a; struct gfs_client_get_load_state *gls; /* * Wait until at least one slot becomes available. * We limit concurrency here. */ while (pa->free_list == NULL) { rv = gfarm_eventqueue_turn(pa->q, NULL); if (rv == EAGAIN || rv == EINTR) { continue; /* not really an error */ } else if (rv != 0) { return (gfarm_errno_to_error(rv)); } } /* acquire free slot */ a = pa->free_list; pa->free_list = a->next; --pa->nfree; a->closure = closure; a->canonical_hostname = canonical_hostname; a->port = port; a->peer_addr = *peer_addr; e = gfs_client_get_load_request_multiplexed(pa->q, &a->peer_addr, pa->try_auth ? gfarm_paraccess_connect_request : gfarm_paraccess_load_finish, a, &gls); if (e != GFARM_ERR_NO_ERROR) { gfarm_paraccess_callback(pa, a, NULL, NULL, e); return (e); } a->protocol_state = gls; a->pa = pa; return (GFARM_ERR_NO_ERROR); } gfarm_error_t gfarm_paraccess_free(struct gfarm_paraccess *pa) { int rv = gfarm_eventqueue_loop(pa->q, NULL); gfarm_error_t e; free(pa->access_state); gfarm_eventqueue_free(pa->q); free(pa); if (rv == 0) return (GFARM_ERR_NO_ERROR); e = gfarm_errno_to_error(rv); fprintf(stderr, "%s: %s\n", program_name, gfarm_error_string(e)); return (e); } /* * listing options. */ int opt_verbose = 0; int opt_udp_only = 0; #define round_loadavg(l) ((l) < 0.0 ? 0.0 : (l) > 9.99 ? 9.99 : (l)) void print_loadavg_authinfo(struct output *o) { if (LOADAVG_AVAIL(o)) printf("%4.2f/%4.2f/%4.2f ", round_loadavg(o->load.loadavg_1min), round_loadavg(o->load.loadavg_5min), round_loadavg(o->load.loadavg_15min)); else if (o->error == GFARM_ERR_CONNECTION_REFUSED) /* machine is up */ printf("-.--/-.--/-.-- "); else printf("x.xx/x.xx/x.xx "); if (!opt_udp_only) printf("%c ", o->auth_mnemonic); } void callback_gfsd_info(struct output *o) { char *if_hostname = o->closure; struct sockaddr_in *addr_in = (struct sockaddr_in *)&o->peer_addr; print_loadavg_authinfo(o); printf("%s(%s)\n", if_hostname, inet_ntoa(addr_in->sin_addr)); if (opt_verbose && o->error != GFARM_ERR_NO_ERROR) fprintf(stderr, "%s: %s\n", if_hostname, gfarm_error_string(o->error)); free(o->canonical_hostname); free(if_hostname); } /* * Note that this may be called when opt_use_metadb == 0. * In that case, the host_info is faked, and all members in the info structure * except info->hostname are not valid. (see list_gfsd_info()) */ gfarm_error_t request_gfsd_info(struct gfarm_host_info *info, struct gfarm_paraccess *pa) { gfarm_error_t e; struct sockaddr addr; char *canonical_hostname, *if_hostname; canonical_hostname = strdup(info->hostname); if (canonical_hostname == NULL) { e = GFARM_ERR_NO_MEMORY; } else { e = (*opt_resolv_addr)( canonical_hostname, info->port, info, &addr, &if_hostname); } if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", info->hostname, gfarm_error_string(e)); if (canonical_hostname != NULL) free(canonical_hostname); return (e); } return (gfarm_paraccess_request(pa, if_hostname, canonical_hostname, info->port, &addr)); } struct long_format_parameter { char *if_hostname; struct gfarm_host_info info; }; void callback_long_format(struct output *o) { struct long_format_parameter *param = o->closure; char *if_hostname = param->if_hostname; struct gfarm_host_info *info = ¶m->info; /* sizeof(struct sockaddr_in) == sizeof(struct sockaddr) */ struct sockaddr_in *addr_in = (struct sockaddr_in *)&o->peer_addr; int i, print_ifaddr = if_hostname != NULL; print_loadavg_authinfo(o); printf("%s %d %s %d %d", info->architecture, info->ncpu, o->canonical_hostname, info->port, info->flags); if (print_ifaddr && strcasecmp(o->canonical_hostname, if_hostname) == 0) { print_ifaddr = 0; printf("(%s)", inet_ntoa(addr_in->sin_addr)); } for (i = 0; i < info->nhostaliases; i++) { printf(" %s", info->hostaliases[i]); if (print_ifaddr && strcasecmp(info->hostaliases[i], if_hostname) == 0) { print_ifaddr = 0; printf("(%s)", inet_ntoa(addr_in->sin_addr)); } } if (print_ifaddr) { printf(" [%s(%s)]", if_hostname, inet_ntoa(addr_in->sin_addr)); } putchar('\n'); if (opt_verbose && o->error != GFARM_ERR_NO_ERROR) fprintf(stderr, "%s: %s\n", o->canonical_hostname, gfarm_error_string(o->error)); gfarm_host_info_free(info); if (if_hostname != NULL) free(if_hostname); free(param); } gfarm_error_t request_long_format(struct gfarm_host_info *host_info, struct gfarm_paraccess *pa) { gfarm_error_t e; struct sockaddr addr; struct long_format_parameter *param; struct gfarm_host_info *info; GFARM_MALLOC(param); if (param == NULL) { e = GFARM_ERR_NO_MEMORY; fprintf(stderr, "%s: %s\n", program_name, gfarm_error_string(e)); return (e); } info = ¶m->info; /* dup `*host_info' -> `*info' */ info->hostname = strdup(host_info->hostname); info->port = host_info->port; info->nhostaliases = host_info->nhostaliases; if (host_info->nhostaliases == 0) { info->hostaliases = NULL; } else { info->hostaliases = gfarm_strarray_dup(host_info->hostaliases); if (info->hostaliases == NULL) info->nhostaliases = 0; } info->architecture = strdup(host_info->architecture); info->ncpu = host_info->ncpu; info->flags = host_info->flags; if (info->hostname == NULL || info->architecture == NULL) { gfarm_host_info_free(info); free(param); e = GFARM_ERR_NO_MEMORY; fprintf(stderr, "%s: %s\n", program_name, gfarm_error_string(e)); return (e); } param->if_hostname = NULL; e = (*opt_resolv_addr)(info->hostname, info->port, info, &addr, ¶m->if_hostname); if (e != GFARM_ERR_NO_ERROR) { output_process(param, info->hostname, NULL, NULL, NULL, e); return (e); } return (gfarm_paraccess_request(pa, param, info->hostname, info->port, &addr)); } void callback_nodename(struct output *o) { if (o->error == GFARM_ERR_NO_ERROR) puts(o->canonical_hostname); else if (opt_verbose) fprintf(stderr, "%s: %s\n", o->canonical_hostname, gfarm_error_string(o->error)); free(o->canonical_hostname); } gfarm_error_t request_nodename(struct gfarm_host_info *host_info, struct gfarm_paraccess *pa) { gfarm_error_t e; char *canonical_hostname; struct sockaddr addr; /* dup `host_info->hostname' -> `hostname' */ canonical_hostname = strdup(host_info->hostname); if (canonical_hostname == NULL) { e = GFARM_ERR_NO_MEMORY; fprintf(stderr, "%s: %s\n", program_name, gfarm_error_string(e)); return (e); } e = (*opt_resolv_addr)( canonical_hostname, host_info->port, host_info, &addr, NULL); if (e != GFARM_ERR_NO_ERROR) { output_process(NULL, canonical_hostname, NULL, NULL, NULL, e); return (e); } return (gfarm_paraccess_request(pa, NULL, canonical_hostname, host_info->port, &addr)); } gfarm_error_t print_host_info(struct gfarm_host_info *info, struct gfarm_paraccess *pa) { int i; printf("%s %d %s %d %d", info->architecture, info->ncpu, info->hostname, info->port, info->flags); for (i = 0; i < info->nhostaliases; i++) printf(" %s", info->hostaliases[i]); putchar('\n'); return (GFARM_ERR_NO_ERROR); } gfarm_error_t list_all(const char *architecture, const char *domainname, gfarm_error_t (*request_op)(struct gfarm_host_info *, struct gfarm_paraccess *), struct gfarm_paraccess *pa) { gfarm_error_t e, e_save = GFARM_ERR_NO_ERROR; int i, nhosts; struct gfarm_host_info *hosts; if (architecture != NULL) e = gfm_client_host_info_get_by_architecture( gfm_server, architecture, &nhosts, &hosts); else e = gfm_client_host_info_get_all( gfm_server, &nhosts, &hosts); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", program_name, gfarm_error_string(e)); return (e); } for (i = 0; i < nhosts; i++) { if (domainname == NULL || gfarm_host_is_in_domain(hosts[i].hostname, domainname)) { e = (*request_op)(&hosts[i], pa); if (e_save == GFARM_ERR_NO_ERROR) e_save = e; } } gfarm_host_info_free_all(nhosts, hosts); return (e_save); } gfarm_error_t list(int nhosts, char **hosts, gfarm_error_t (*request_op)(struct gfarm_host_info *, struct gfarm_paraccess *), struct gfarm_paraccess *pa) { gfarm_error_t e, e_save = GFARM_ERR_NO_ERROR; int i; struct gfarm_host_info hi; for (i = 0; i < nhosts; i++) { e = gfm_host_info_get_by_name_alias(gfm_server, hosts[i], &hi); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", hosts[i], gfarm_error_string(e)); if (e_save == GFARM_ERR_NO_ERROR) e_save = e; } else { e = (*request_op)(&hi, pa); if (e_save == GFARM_ERR_NO_ERROR) e_save = e; gfarm_host_info_free(&hi); } } return (e_save); } /* * This function is a special case to avoid Meta DB access, * and only called if opt_use_metadb == 0. */ gfarm_error_t list_without_metadb(int nhosts, char **hosts, int port, gfarm_error_t (*request_op)(struct gfarm_host_info *, struct gfarm_paraccess *), struct gfarm_paraccess *pa) { gfarm_error_t e, e_save = GFARM_ERR_NO_ERROR; int i; struct gfarm_host_info host; for (i = 0; i < nhosts; i++) { host.hostname = hosts[i]; /* host_info is faked */ host.port = port; /* * Because request_op is always request_gfsd_info for now, * the following fields aren't actually used. */ host.nhostaliases = 0; host.hostaliases = NULL; host.architecture = NULL; host.ncpu = 0; host.flags = -1; e = (*request_op)(&host, pa); if (e_save == GFARM_ERR_NO_ERROR) e_save = e; } return (e_save); } gfarm_error_t paraccess_list(int opt_concurrency, int opt_udp_only, char *opt_architecture, char *opt_domainname, int opt_port, int opt_plain_order, int opt_sort_by_loadavg, int opt_use_metadb, int nhosts, char **hosts, gfarm_error_t (*request_op)(struct gfarm_host_info *, struct gfarm_paraccess *), void (*callback_op)(struct output *)) { gfarm_error_t e, e_save; struct gfarm_paraccess *pa; if (opt_plain_order) /* i.e. don't sort */ output_record = 0; else output_record = 1; output_callback = callback_op; e = gfarm_paraccess_alloc(opt_concurrency, !opt_udp_only, &pa); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", program_name, gfarm_error_string(e)); exit(1); } if (nhosts == 0) { e_save = list_all(opt_architecture, opt_domainname, request_op, pa); } else if (opt_use_metadb) { e_save = list(nhosts, hosts, request_op, pa); } else { e_save = list_without_metadb(nhosts, hosts, opt_port, request_op, pa); } e = gfarm_paraccess_free(pa); if (e_save == GFARM_ERR_NO_ERROR) e_save = e; if (!opt_plain_order) output_sort(opt_sort_by_loadavg ? output_cmp_by_loadavg : output_cmp_by_name); return (e_save); } void usage(void) { fprintf(stderr, "Usage:" "\t%s %s\n" "\t%s %s\n" "\t%s %s\n" "\t%s %s\n" "\t%s %s\n", program_name, "[-lMH] [-P ] [-a ] [-D ] [-j ] [-iruv]", program_name, "-c -a [-P ] [-n ] [-p ] [-f ] [...]", program_name, "-m [-a ] [-P ] [-n ] [-p ] [-f ] [-A] [...]", program_name, "-d [-P ] ...", program_name, "-R [-P ]"); exit(EXIT_FAILURE); } #define OP_NODENAME '\0' /* '\0' means default operation */ #define OP_LIST_GFSD_INFO 'H' #define OP_LIST_LONG 'l' #define OP_DUMP_METADB 'M' #define OP_REGISTER_DB 'R' /* or, restore db */ #define OP_CREATE_ENTRY 'c' #define OP_DELETE_ENTRY 'd' #define OP_MODIFY_ENTRY 'm' void inconsistent_option(int c1, int c2) { fprintf(stderr, "%s: inconsistent option -%c and -%c\n", program_name, c1, c2); usage(); } void invalid_option(int c) { fprintf(stderr, "%s: option -%c is only available with -%c or -%c\n", program_name, c, OP_CREATE_ENTRY, OP_MODIFY_ENTRY); usage(); } long parse_opt_long(char *option, int option_char, char *argument_name) { long value; char *s; errno = 0; value = strtol(option, &s, 0); if (s == option) { fprintf(stderr, "%s: missing %s after -%c\n", program_name, argument_name, option_char); usage(); } else if (*s != '\0') { fprintf(stderr, "%s: garbage in -%c %s\n", program_name, option_char, option); usage(); } else if (errno != 0 && (value == LONG_MIN || value == LONG_MAX)) { fprintf(stderr, "%s: %s with -%c %s\n", program_name, strerror(errno), option_char, option); usage(); } return (value); } #define DEFAULT_CONCURRENCY 10 /* reflect this value to gfhost.1.docbook */ int main(int argc, char **argv) { int argc_save = argc; char **argv_save = argv; gfarm_error_t e, e_save = GFARM_ERR_NO_ERROR; char opt_operation = '\0'; /* default operation */ int opt_concurrency = DEFAULT_CONCURRENCY; int opt_alter_aliases = 0; const char *opt_path = GFARM_PATH_ROOT; char *opt_architecture = NULL; char *opt_domainname = NULL; long opt_ncpu = 0; int opt_port = 0, opt_flags = -1; int opt_plain_order = 0; /* i.e. do not sort */ int opt_sort_by_loadavg = 0; int i, c, opt_use_metadb = 1; char *s; if (argc > 0) program_name = basename(argv[0]); while ((c = getopt(argc, argv, "AD:HLMP:RUa:cdf:ij:lmn:p:ruv?")) != -1) { switch (c) { case 'A': opt_alter_aliases = 1; break; case 'L': opt_sort_by_loadavg = 1; break; case 'P': opt_path = optarg; break; case 'M': case 'H': case 'R': case 'c': case 'd': case 'l': case 'm': if (opt_operation != '\0' && opt_operation != c) inconsistent_option(opt_operation, c); opt_operation = c; break; case 'a': opt_architecture = optarg; s = validate_architecture(opt_architecture); if (s != NULL) { fprintf(stderr, "%s: " "invalid character '%c' in \"-a %s\"\n", program_name, *s, opt_architecture); exit(1); } break; case 'D': opt_domainname = optarg; s = validate_hostname(opt_domainname); if (s != NULL) { fprintf(stderr, "%s: " "invalid character '%c' in \"-a %s\"\n", program_name, *s, opt_domainname); exit(1); } break; case 'i': opt_resolv_addr = resolv_addr_without_address_use; break; case 'j': opt_concurrency = parse_opt_long(optarg, c, ""); if (opt_concurrency <= 0) { fprintf(stderr, "%s: invalid value: -%c %d\n", program_name, c, opt_concurrency); usage(); } break; case 'f': opt_flags = parse_opt_long(optarg, c, ""); break; case 'n': opt_ncpu = parse_opt_long(optarg, c, ""); break; case 'p': opt_port = parse_opt_long(optarg, c, ""); break; case 'r': output_sort_reverse = 1; break; case 'U': opt_udp_only = 1; break; case 'u': opt_plain_order = 1; break; case 'v': opt_verbose = 1; break; case '?': usage(); } } argc -= optind; argv += optind; switch (opt_operation) { case OP_CREATE_ENTRY: if (opt_architecture == NULL) { fprintf(stderr, "%s: missing -a \n", program_name); usage(); } if (opt_ncpu == 0) opt_ncpu = 1; if (opt_flags == -1) opt_flags = 0; /* opt_alter_aliases is meaningless, but allowed */ break; case OP_REGISTER_DB: case OP_DELETE_ENTRY: if (opt_architecture != NULL) invalid_option('a'); if (opt_domainname != NULL) invalid_option('D'); /* fall through */ case OP_NODENAME: case OP_LIST_GFSD_INFO: case OP_LIST_LONG: case OP_DUMP_METADB: if (opt_ncpu != 0) invalid_option('n'); if (opt_alter_aliases) invalid_option('A'); break; case OP_MODIFY_ENTRY: if (opt_domainname != NULL) invalid_option('D'); break; default: ; } for (i = 0; i < argc; i++) { s = validate_hostname(argv[i]); if (s != NULL) { fprintf(stderr, "%s: " "invalid character '%c' in hostname \"%s\"\n", program_name, *s, argv[i]); exit(1); } } e = gfarm_initialize(&argc_save, &argv_save); if (opt_operation == OP_LIST_GFSD_INFO && argc > 0 && opt_resolv_addr == resolv_addr_without_address_use) { /* * An implicit feature to access gfsd directly * without having working gfmd. * e.g. gfhost -Hi * * XXX should describe this in the manual? * or use explicit and different option? */ opt_use_metadb = 0; opt_resolv_addr = resolv_addr_without_metadb; } else if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", program_name, gfarm_error_string(e)); exit(1); } if (opt_use_metadb && (e = gfm_client_connection_and_process_acquire_by_path(opt_path, &gfm_server)) != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: metadata server for \"%s\": %s\n", program_name, opt_path, gfarm_error_string(e)); exit(1); } switch (opt_operation) { case OP_CREATE_ENTRY: if (argc <= 0) usage(); if (opt_port == 0) { fprintf(stderr, "%s: option -p is " "mandatory with -c\n", program_name); usage(); } e_save = add_host(argv[0], opt_port, &argv[1], opt_architecture, opt_ncpu, opt_flags); if (e_save != GFARM_ERR_NO_ERROR) fprintf(stderr, "%s: %s: %s\n", program_name, argv[0], gfarm_error_string(e_save)); break; case OP_MODIFY_ENTRY: if (argc <= 0) usage(); e_save = gfarm_modify_host(argv[0], opt_port, &argv[1], opt_architecture, opt_ncpu, opt_flags, !opt_alter_aliases); if (e_save != GFARM_ERR_NO_ERROR) fprintf(stderr, "%s: %s: %s\n", program_name, argv[0], gfarm_error_string(e_save)); break; case OP_DELETE_ENTRY: if (argc <= 0) usage(); for (i = 0; i < argc; i++) { e = gfm_client_host_info_remove(gfm_server, argv[i]); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", argv[i], gfarm_error_string(e)); if (e_save == GFARM_ERR_NO_ERROR) e_save = e; } } break; case OP_REGISTER_DB: if (argc > 0) { fprintf(stderr, "%s: too many argument: %s\n", program_name, argv[0]); usage(); } e_save = register_db(); break; case OP_LIST_GFSD_INFO: e = paraccess_list(opt_concurrency, opt_udp_only, opt_architecture, opt_domainname, opt_port, opt_plain_order, opt_sort_by_loadavg, opt_use_metadb, argc, argv, request_gfsd_info, callback_gfsd_info); break; case OP_NODENAME: e = paraccess_list(opt_concurrency, opt_udp_only, opt_architecture, opt_domainname, opt_port, opt_plain_order, opt_sort_by_loadavg, opt_use_metadb, argc, argv, request_nodename, callback_nodename); break; case OP_LIST_LONG: e = paraccess_list(opt_concurrency, opt_udp_only, opt_architecture, opt_domainname, opt_port, opt_plain_order, opt_sort_by_loadavg, opt_use_metadb, argc, argv, request_long_format, callback_long_format); break; case OP_DUMP_METADB: if (argc == 0) { e_save = list_all(opt_architecture, opt_domainname, print_host_info, NULL); } else { e_save = list(argc, argv, print_host_info, NULL); } break; } if (opt_use_metadb) gfm_client_connection_free(gfm_server); e = gfarm_terminate(); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", program_name, gfarm_error_string(e)); exit(1); } exit(e_save == GFARM_ERR_NO_ERROR ? 0 : 1); } gfarm-2.4.1/gftool/gfhost/Makefile0000644000000000000000000000125211507222717015540 0ustar rootroot# $Id: Makefile 4323 2010-01-20 04:51:41Z n-soda $ top_builddir = ../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk PROGRAM = gfhost SRCS = $(PROGRAM).c OBJS = $(PROGRAM).o CFLAGS = $(COMMON_CFLAGS) -I$(GFUTIL_SRCDIR) -I$(GFARMLIB_SRCDIR) LDLIBS = $(COMMON_LDFLAGS) $(GFARMLIB) $(LIBS) DEPLIBS = $(DEPGFARMLIB) all: $(PROGRAM) include $(top_srcdir)/makes/prog.mk ### $(OBJS): $(DEPGFARMINC) \ $(GFUTIL_SRCDIR)/gfevent.h \ $(GFARMLIB_SRCDIR)/liberror.h \ $(GFARMLIB_SRCDIR)/host.h \ $(GFARMLIB_SRCDIR)/auth.h \ $(GFARMLIB_SRCDIR)/gfm_client.h \ $(GFARMLIB_SRCDIR)/gfs_client.h \ $(GFARMLIB_SRCDIR)/lookup.h \ $(GFARMLIB_SRCDIR)/config.h gfarm-2.4.1/gftool/gfdump/0000755000000000000000000000000011507222730014063 5ustar rootrootgfarm-2.4.1/gftool/gfdump/Makefile0000644000000000000000000000033111507222717015525 0ustar rootroot# $Id: Makefile 3995 2008-06-11 02:28:16Z tatebe $ top_builddir = ../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk SCRIPTS = gfdump.postgresql include $(top_srcdir)/makes/script.mk gfarm-2.4.1/gftool/gfdump/gfdump.c0000644000000000000000000002661611507222717015531 0ustar rootroot/* * $Id: gfdump.c 3478 2007-01-18 08:33:21Z n-soda $ */ #include #include #include #include #include #include #include "metadb_access.h" enum { PATH_INFO, SECTION_INFO, SECTION_COPY_INFO }; static int verbose = 0; static char * print_file_section_copy_info(struct gfarm_file_section_copy_info *info, FILE *f) { fprintf(f, "C:"); fprintf(f, " %s", info->pathname); fprintf(f, " %s", info->section); fprintf(f, " %s", info->hostname); fputc('\n', f); return (NULL); } static char * print_file_section_info(struct gfarm_file_section_info *info, FILE *f) { fprintf(f, "S:"); fprintf(f, " %s", info->pathname); fprintf(f, " %s", info->section); fprintf(f, " %" PR_FILE_OFFSET, info->filesize); fprintf(f, " %s %s", info->checksum_type, info->checksum); fputc('\n', f); return (NULL); } static char * print_path_info(struct gfarm_path_info *info, FILE *f) { struct gfs_stat *st = &info->status; fprintf(f, "P:"); fprintf(f, " %s", info->pathname); fprintf(f, " %d", st->st_mode); fprintf(f, " %s %s", st->st_user, st->st_group); fprintf(f, " %d %d", st->st_atimespec.tv_sec, st->st_atimespec.tv_nsec); fprintf(f, " %d %d", st->st_mtimespec.tv_sec, st->st_mtimespec.tv_nsec); fprintf(f, " %d %d", st->st_ctimespec.tv_sec, st->st_ctimespec.tv_nsec); fprintf(f, " %d", st->st_nsections); fputc('\n', f); return (NULL); } static void dump_int32(gfarm_int32_t i, FILE *f) { gfarm_int32_t ii; ii = htonl(i); fwrite(&ii, sizeof(gfarm_int32_t), 1, f); } static void dump_timespec(struct gfarm_timespec *t, FILE *f) { struct gfarm_timespec tt; tt.tv_sec = htonl(t->tv_sec); tt.tv_nsec = htonl(t->tv_nsec); fwrite(&tt, sizeof(struct gfarm_timespec), 1, f); } static void dump_string(char *string, FILE *f) { int len = strlen(string) + 1; /* includes '\0' */ dump_int32(len, f); fwrite(string, sizeof(char), len, f); } #if FILE_OFFSET_T_IS_FLOAT #include #define POWER2_32 4294967296.0 /* 2^32 */ #endif static void dump_offset_t(file_offset_t o, FILE *f) { gfarm_uint32_t ov[2]; #if FILE_OFFSET_T_IS_FLOAT int minus; #endif #if FILE_OFFSET_T_IS_FLOAT minus = o < 0; if (minus) o = -o; ov[0] = o / POWER2_32; ov[1] = o - ov[0] * POWER2_32; if (minus) { ov[0] = ~ov[0]; ov[1] = ~ov[1]; if (++ov[1] == 0) ++ov[0]; } #else ov[0] = o >> 32; ov[1] = o; #endif ov[0] = htonl(ov[0]); ov[1] = htonl(ov[1]); fwrite(ov, sizeof(ov), 1, f); } static char * dump_file_section_copy_info(struct gfarm_file_section_copy_info *info, FILE *f) { if (verbose) print_file_section_copy_info(info, stderr); fputc(SECTION_COPY_INFO, f); dump_string(info->pathname, f); dump_string(info->section, f); dump_string(info->hostname, f); return (NULL); } static char * dump_file_section_info(struct gfarm_file_section_info *info, FILE *f) { if (verbose) print_file_section_info(info, stderr); fputc(SECTION_INFO, f); dump_string(info->pathname, f); dump_string(info->section, f); dump_offset_t(info->filesize, f); dump_string(info->checksum_type, f); dump_string(info->checksum, f); return (NULL); } static char * dump_path_info(struct gfarm_path_info *info, FILE *f) { struct gfs_stat *st = &info->status; if (verbose) print_path_info(info, stderr); fputc(PATH_INFO, f); dump_string(info->pathname, f); dump_int32(st->st_mode, f); dump_string(st->st_user, f); dump_string(st->st_group, f); dump_timespec(&st->st_atimespec, f); dump_timespec(&st->st_mtimespec, f); dump_timespec(&st->st_ctimespec, f); dump_int32(st->st_nsections, f); return (NULL); } static char * restore_path_info(struct gfarm_path_info *info, FILE *f) { if (verbose) print_path_info(info, stdout); return (gfarm_metadb_path_info_set(info->pathname, info)); } static char * restore_file_section_info(struct gfarm_file_section_info *info, FILE *f) { if (verbose) print_file_section_info(info, stdout); return (gfarm_metadb_file_section_info_set( info->pathname, info->section, info)); } static char * restore_file_section_copy_info( struct gfarm_file_section_copy_info *info, FILE *f) { if (verbose) print_file_section_copy_info(info, stdout); return (gfarm_metadb_file_section_copy_info_set( info->pathname, info->section, info->hostname, info)); } struct gfdump_ops { char *(*path_info)(struct gfarm_path_info *, FILE *); char *(*file_section_info)(struct gfarm_file_section_info *, FILE *); char *(*file_section_copy_info)( struct gfarm_file_section_copy_info *, FILE *); }; struct gfdump_args { FILE *f; gfarm_stringlist *listp; struct gfdump_ops *ops; }; struct gfdump_ops print_ops = { print_path_info, print_file_section_info, print_file_section_copy_info }; struct gfdump_ops dump_ops = { dump_path_info, dump_file_section_info, dump_file_section_copy_info }; struct gfdump_ops restore_ops = { restore_path_info, restore_file_section_info, restore_file_section_copy_info }; void gfdump_callback(void *arg, struct gfarm_path_info *info) { struct gfdump_args *a = arg; a->ops->path_info(info, a->f); gfarm_stringlist_add(a->listp, strdup(info->pathname)); return; } static void dump_section_info_all(struct gfdump_args *a) { char *e, *pathname; int i, j, k, nsections, ncopies; struct gfarm_file_section_info *sections; struct gfarm_file_section_copy_info *copies; FILE *f = a->f; for (i = 0; i < gfarm_stringlist_length(a->listp); ++i) { pathname = gfarm_stringlist_elem(a->listp, i); e = gfarm_file_section_info_get_all_by_file( pathname, &nsections, §ions); if (e != NULL) continue; for (j = 0; j < nsections; ++j) { a->ops->file_section_info(§ions[j], f); e = gfarm_file_section_copy_info_get_all_by_section( pathname, sections[j].section, &ncopies, &copies); if (e != NULL) continue; for (k = 0; k < ncopies; ++k) a->ops->file_section_copy_info(&copies[k], f); gfarm_file_section_copy_info_free_all(ncopies, copies); } gfarm_file_section_info_free_all(nsections, sections); } } static char * dump_all(char *filename, struct gfdump_ops *ops) { struct gfdump_args a; gfarm_stringlist list; FILE *f; char *e; if (filename == NULL) f = stdout; else f = fopen(filename, "w"); if (f == NULL) { perror(filename); exit(1); } a.f = f; e = gfarm_stringlist_init(&list); a.listp = &list; a.ops = ops; /* dump path info */ e = gfarm_metadb_path_info_get_all_foreach(gfdump_callback, &a); if (e != NULL) goto fclose_f; /* dump section info and section copy info */ dump_section_info_all(&a); gfarm_stringlist_free_deeply(&list); fclose_f: if (f != stdin) fclose(f); return (e); } static char * read_int32(gfarm_int32_t *i, FILE *f) { if (fread(i, sizeof(gfarm_int32_t), 1, f) != 1) return (GFARM_ERR_INPUT_OUTPUT); *i = ntohl(*i); return (NULL); } static char * read_timespec(struct gfarm_timespec *t, FILE *f) { if (fread(t, sizeof(struct gfarm_timespec), 1, f) != 1) return (GFARM_ERR_INPUT_OUTPUT); t->tv_sec = ntohl(t->tv_sec); t->tv_nsec = ntohl(t->tv_nsec); return (NULL); } static char * read_string(char **string, FILE *f) { int len; char *e, *s; e = read_int32(&len, f); if (e != NULL) return (e); GFARM_MALLOC_ARRAY(s, len); if (s == NULL) return (GFARM_ERR_NO_MEMORY); e = fread(s, sizeof(char), len, f) == len ? NULL : GFARM_ERR_INPUT_OUTPUT; if (e == NULL) { if (*string != NULL) free(*string); *string = s; } return (e); } static char * read_offset_t(file_offset_t *op, FILE *f) { gfarm_uint32_t ov[2]; #if FILE_OFFSET_T_IS_FLOAT int minus; #endif char *e; e = fread(ov, sizeof(ov), 1, f) == 1 ? NULL : GFARM_ERR_INPUT_OUTPUT; if (e != NULL) return (e); ov[0] = ntohl(ov[0]); ov[1] = ntohl(ov[1]); #if FILE_OFFSET_T_IS_FLOAT minus = ov[0] & 0x80000000; if (minus) { ov[0] = ~ov[0]; ov[1] = ~ov[1]; if (++ov[1] == 0) ++ov[0]; } *op = ov[0] * POWER2_32 + ov[1]; if (minus) *op = -*op; #else *op = ((file_offset_t)ov[0] << 32) | ov[1]; #endif return (e); } static char * read_file_section_copy_info(struct gfdump_ops *ops, FILE *f) { static struct gfarm_file_section_copy_info info; char *e; e = read_string(&info.pathname, f); if (e != NULL) return (e); e = read_string(&info.section, f); if (e != NULL) return (e); e = read_string(&info.hostname, f); if (e != NULL) return (e); return (ops->file_section_copy_info(&info, stdout)); } static char * read_file_section_info(struct gfdump_ops *ops, FILE *f) { static struct gfarm_file_section_info section_info; char *e; e = read_string(§ion_info.pathname, f); if (e != NULL) return (e); e = read_string(§ion_info.section, f); if (e != NULL) return (e); e = read_offset_t(§ion_info.filesize, f); if (e != NULL) return (e); e = read_string(§ion_info.checksum_type, f); if (e != NULL) return (e); e = read_string(§ion_info.checksum, f); if (e != NULL) return (e); return (ops->file_section_info(§ion_info, stdout)); } static char * read_path_info(struct gfdump_ops *ops, FILE *f) { static struct gfarm_path_info path_info; struct gfs_stat *st = &path_info.status; gfarm_int32_t i32; char *e; e = read_string(&path_info.pathname, f); if (e != NULL) return (e); e = read_int32(&i32, f); if (e != NULL) return (e); st->st_mode = i32; e = read_string(&st->st_user, f); if (e != NULL) return (e); e = read_string(&st->st_group, f); if (e != NULL) return (e); e = read_timespec(&st->st_atimespec, f); if (e != NULL) return (e); e = read_timespec(&st->st_mtimespec, f); if (e != NULL) return (e); e = read_timespec(&st->st_ctimespec, f); if (e != NULL) return (e); e = read_int32(&st->st_nsections, f); if (e != NULL) return (e); return (ops->path_info(&path_info, stdout)); } static char * restore_all(const char *filename, struct gfdump_ops *ops) { FILE *f; int type; char *e = NULL; if (filename == NULL) f = stdin; else f = fopen(filename, "r"); if (f == NULL) { perror(filename); exit(1); } while ((type = fgetc(f)) != EOF) { switch (type) { case PATH_INFO: e = read_path_info(ops, f); break; case SECTION_INFO: e = read_file_section_info(ops, f); break; case SECTION_COPY_INFO: e = read_file_section_copy_info(ops, f); break; default: e = "unknown type"; break; } if (e != NULL) break; } if (f != stdin) fclose(f); return (e); } static void usage(void) { fprintf(stderr, "usage: gfdump -d [ -f filename ] [-v]\n"); fprintf(stderr, " gfdump -r [ -f filename ] [-v]\n"); fflush(stderr); exit(1); } int main(int argc, char *argv[]) { char *e, c, *filename = NULL; static enum { unknown, dump_mode, restore_mode } mode; struct gfdump_ops *ops = NULL; while ((c = getopt(argc, argv, "df:rtv")) != -1) { switch (c) { case 'd': mode = dump_mode; ops = &dump_ops; break; case 'f': filename = optarg; break; case 'r': mode = restore_mode; ops = &restore_ops; break; case 't': ops = &print_ops; break; case 'v': verbose = 1; break; default: usage(); } } if (mode == unknown || ops == NULL) usage(); e = gfarm_initialize(NULL, NULL); if (e != NULL) { fprintf(stderr, "%s: %s\n", argv[0], e); exit(1); } switch (mode) { case dump_mode: e = dump_all(filename, ops); break; case restore_mode: if (verbose) setvbuf(stdout, NULL, _IOLBF, 0); e = restore_all(filename, ops); break; default: usage(); } if (e != NULL) { fprintf(stderr, "%s: %s\n", argv[0], e); exit(1); } e = gfarm_terminate(); if (e != NULL) { fprintf(stderr, "%s: %s\n", argv[0], e); exit(1); } return (0); } gfarm-2.4.1/gftool/gfdump/gfdump.postgresql.in0000644000000000000000000001105011507222717020101 0ustar rootroot#!/bin/sh # # $Id$ ${DEBUG:="false"} && set -xu PROGNAME=`basename $0` # Gfarm installation directory prefix="@prefix@" sysconfdir="@sysconfdir@" config_dir="@datadir@/gfarm/config" PATH="${prefix}/bin:${prefix}/sbin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/ucb:/usr/pkg/bin:/usr/pkg/sbin:/usr/local/bin:/usr/local/sbin:$PATH" export PATH search_path="$PATH" awk=awk if [ -f /usr/bin/nawk ]; then awk=/usr/bin/nawk; fi status=1 admin_password=/tmp/ap$$ password=/tmp/up$$ rm -f $password $admin_password trap 'rm -f $password $admin_password; stty echo 2>/dev/null; exit $status' 0 1 2 15 getvalue() { $awk '$1 == "'"$1"'" { print $2 }' $GFMD_CONF } ABORT() { [ $# -gt 0 ] && echo >&2 "${PROGNAME}: $@" echo >&2 "$PROGNAME failure" exit 1 } usage() { echo >&2 "usage: $PROGNAME -d [options]" echo >&2 " $PROGNAME -r [options]" echo >&2 " options:" echo >&2 " [-t] - display configuration, do not execute anything" echo >&2 " [--prefix prefix] - directory specified in config-gfarm" echo >&2 " [-f filename] - file to dump or to restore" echo >&2 " [-l metadata_directory] - backend database data directory" exit 1 } # most $BACKEND_TYPE calls the followings # from display_backend_params_$BACKEND_TYPE, but some may not. display_backend_data_dir_param() { echo "metadata directory [-l]: $BACKEND_DATA_DIR" } display_backend_log_dir_param() { return 0 } display_params() { echo "prefix [--prefix]: $CONFIG_PREFIX" echo "metadata backend [-b]: $BACKEND_TYPE" display_backend_params_$BACKEND_TYPE display_backend_port_params_$BACKEND_TYPE display_backend_optional_params_$BACKEND_TYPE exit 0 } # default value DUMPF=db.out MODE=UNKNOWN # # parse arguments # while [ $# -gt 0 ] do case $1 in # set parameters --prefix) shift; [ $# -ge 1 ] || usage CONFIG_PREFIX=$1 ;; -P) shift; [ $# -ge 1 ] || usage BACKEND_PREFIX=$1 ;; -l) shift; [ $# -ge 1 ] || usage BACKEND_DATA_DIR=$1 ;; -f) shift; [ $# -ge 1 ] || usage DUMPF=$1 ;; # control options --help) usage ;; -t) DISPLAY_PARAMS=true ;; -d) MODE=DUMP ;; -r) MODE=RESTORE ;; -*) echo "unknown option: $1" usage ;; *) usage ;; esac shift done [ X"$MODE" = XUNKNOWN ] && usage : ${CONFIG_PREFIX:=} if [ X"$CONFIG_PREFIX" != X ]; then : ${GFARM_CONF_DIR:="$CONFIG_PREFIX/etc"} else : ${GFARM_CONF_DIR:="$sysconfdir"} fi : ${GFMD_CONF:="$GFARM_CONF_DIR/gfmd.conf"} # sanity check if [ ! -f ${GFMD_CONF} ]; then ABORT "${PROGNAME}: cannot find ${GFMD_CONF}, --prefix option required" fi # determine a backend database type if grep '^[ ]*postgresql_server_host[ ]' ${GFMD_CONF} >/dev/null then BACKEND_TYPE=postgresql elif grep '^[ ]*ldap_server_host[ ]' ${GFMD_CONF} >/dev/null then BACKEND_TYPE=ldap else echo >&2 "${PROGNAME}: cannot determine the backend type" exit 1 fi # load backend-dependent functions . $config_dir/config-gfarm.$BACKEND_TYPE . $config_dir/config-gfarm-update.$BACKEND_TYPE # # search default $BACKEND_PREFIX # set_default_backend_prefix_$BACKEND_TYPE . $config_dir/config-gfarm.sysdep # # default values # set_first_defaults_$BACKEND_TYPE sysdep_defaults : ${DISPLAY_PARAMS:=false} update_first_set_param_$BACKEND_TYPE set_last_defaults_$BACKEND_TYPE update_last_set_param_$BACKEND_TYPE # -t option; display parameters $DISPLAY_PARAMS && display_params case ${BACKEND_TYPE} in ### ### postgresql ### postgresql) BACKEND_HOST="`getvalue postgresql_server_host`" BACKEND_USER_PASSWD="`getvalue postgresql_password | tr -d '"'`" pg_dump=${PGSQL_BINDIR}/pg_dump dropdb=${PGSQL_BINDIR}/dropdb createdb=${PGSQL_BINDIR}/createdb case $MODE in DUMP) update_pgpass_postgresql ${BACKEND_HOST} ${BACKEND_PORT} "${DB_NAME}" "${BACKEND_USER}" "${BACKEND_USER_PASSWD}" || ABORT "aborted" $pg_dump -h $BACKEND_HOST -p $BACKEND_PORT -U $BACKEND_USER -f $DUMPF $DB_NAME || ABORT "pg_dump fails" ;; RESTORE) [ ! -f "$DUMPF" ] && ABORT "$DUMPF: database dump file not exist" update_pgpass_postgresql localhost ${BACKEND_PORT} "*" "${BACKEND_ADMIN_USER}" "${BACKEND_ADMIN_PASSWD}" || ABORT "aborted" service_ctl gfmd stop $dropdb -p $BACKEND_PORT -U $BACKEND_ADMIN_USER $DB_NAME $createdb -p $BACKEND_PORT -U $BACKEND_ADMIN_USER $DB_NAME $psql -p $BACKEND_PORT -U $BACKEND_ADMIN_USER -d $DB_NAME -f $DUMPF > /dev/null || ABORT "restore fails" service_ctl gfmd start ;; *) usage ;; esac ;; ### ### LDAP ### ldap) echo >&2 "${PROGNAME}: ldap backend is not supported yet" ;; *) echo >&2 "${PROGNAME}: internal error - backend \"${BACKEND_TYPE}\"" exit 1;; esac gfarm-2.4.1/gftool/gffindxmlattr/0000755000000000000000000000000011507222730015452 5ustar rootrootgfarm-2.4.1/gftool/gffindxmlattr/Makefile0000644000000000000000000000070511507222717017121 0ustar rootroot# $Id: Makefile 1265 2004-08-17 01:47:35Z soda $ top_builddir = ../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk PROGRAM = gffindxmlattr SRCS = $(PROGRAM).c OBJS = $(PROGRAM).o CFLAGS = $(COMMON_CFLAGS) -I$(GFUTIL_SRCDIR) -I$(GFARMLIB_SRCDIR) $(openssl_includes) LDLIBS = $(COMMON_LDLIBS) $(GFARMLIB) $(LIBS) DEPLIBS = $(DEPGFARMLIB) all: $(PROGRAM) include $(top_srcdir)/makes/prog.mk ### $(OBJS): $(DEPGFARMINC) gfarm-2.4.1/gftool/gffindxmlattr/gffindxmlattr.c0000644000000000000000000000635711507222717020507 0ustar rootroot/* * Copyright (c) 2009 National Institute of Informatics in Japan. * All rights reserved. */ /* * $Id$ */ #include #include #include #include #include #include #include #include #include #include #include #include #include "gfutil.h" static gfarm_error_t read_file(char *filename, char **bufp) { gfarm_error_t e; int fd; struct stat st; ssize_t sz, msg_sz = 0; char *buf = NULL; size_t allocsz; int overflow; fd = open(filename, O_RDONLY); if (fd == -1) return (gfarm_errno_to_error(errno)); if (fstat(fd, &st) != 0) e = gfarm_errno_to_error(errno); else { overflow = 0; allocsz = gfarm_size_add(&overflow, st.st_size, 1); if (!overflow) buf = malloc(allocsz); if (buf != NULL) { while ((sz = read(fd, buf + msg_sz, st.st_size - msg_sz)) > 0) { msg_sz += sz; } if (sz == 0) { buf[msg_sz] = '\0'; *bufp = buf; e = GFARM_ERR_NO_ERROR; } else e = gfarm_errno_to_error(errno); } else e = GFARM_ERR_NO_MEMORY; } close(fd); return e; } void usage(char *prog_name) { fprintf(stderr, "Usage: %s [ -d depth ] [ -F delim ] " "{expr | -f expr-file-path} path\n", prog_name); fprintf(stderr, "\t-d\tsearch directory depth (>= 0)\n"); fprintf(stderr, "\t-F\tdelimiter of path and attrname (default is TAB)\n"); fprintf(stderr, "\t-f\tXPath script filename\n"); exit(2); } /* * */ int main(int argc, char *argv[]) { char *prog_name = basename(argv[0]); int c, depth = INT_MAX; char *filename = NULL, *path = NULL, *expr = NULL, *delim = "\t"; struct gfs_xmlattr_ctx *ctxp = NULL; char *fpath, *attrname; gfarm_error_t e; int ret = 0; while ((c = getopt(argc, argv, "d:f:F:h?")) != -1) { switch (c) { case 'd': depth = atoi(optarg); if (depth < 0) usage(prog_name); break; case 'f': filename = optarg; break; case 'F': delim = optarg; break; case 'h': case '?': default: usage(prog_name); } } argc -= optind; argv += optind; if (filename == NULL) { if (argc < 2) usage(prog_name); expr = argv[0]; path = argv[1]; } else if (argc != 1) { usage(prog_name); } else { e = read_file(filename, &expr); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s: %s\n", prog_name, gfarm_error_string(e), filename); exit(1); } path = argv[0]; } e = gfarm_initialize(&argc, &argv); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", prog_name, gfarm_error_string(e)); exit(1); } e = gfs_findxmlattr(path, expr, depth, &ctxp); if (filename != NULL) free(expr); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s\n", gfarm_error_string(e)); exit(1); } while ((e = gfs_getxmlent(ctxp, &fpath, &attrname)) == GFARM_ERR_NO_ERROR) { if (fpath == NULL) break; printf("%s%s%s\n", fpath, delim, attrname); } if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s\n", gfarm_error_string(e)); ret = 1; } e = gfs_closexmlattr(ctxp); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s\n", gfarm_error_string(e)); ret = 1; } e = gfarm_terminate(); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", prog_name, gfarm_error_string(e)); exit(1); } return ret; } gfarm-2.4.1/gftool/gfrmdir/0000755000000000000000000000000011507222730014233 5ustar rootrootgfarm-2.4.1/gftool/gfrmdir/gfrmdir.c0000644000000000000000000000217411507222717016042 0ustar rootroot/* * $Id: gfrmdir.c 2640 2006-05-29 22:38:29Z soda $ */ #include #include #include #include #include char *program_name = "gfrmdir"; static void usage(void) { fprintf(stderr, "Usage: %s directory...\n", program_name); exit(1); } int main(int argc, char **argv) { gfarm_error_t e; int i, c, status = 0; extern int optind; if (argc > 0) program_name = basename(argv[0]); e = gfarm_initialize(&argc, &argv); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", program_name, gfarm_error_string(e)); exit(1); } while ((c = getopt(argc, argv, "h?")) != -1) { switch (c) { case 'h': case '?': default: usage(); } } argc -= optind; argv += optind; if (argc <= 0) usage(); for (i = 0; i < argc; i++) { e = gfs_rmdir(argv[i]); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s: %s\n", program_name, argv[i], gfarm_error_string(e)); status = 1; } } e = gfarm_terminate(); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", program_name, gfarm_error_string(e)); status = 1; } return (status); } gfarm-2.4.1/gftool/gfrmdir/Makefile0000644000000000000000000000071311507222717015701 0ustar rootroot# $Id: Makefile 3617 2007-03-12 08:32:55Z n-soda $ top_builddir = ../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk PROGRAM = gfrmdir SRCS = $(PROGRAM).c OBJS = $(PROGRAM).o CFLAGS = $(COMMON_CFLAGS) LDLIBS = $(COMMON_LDLIBS) $(GFARMLIB) $(LIBS) DEPLIBS = $(DEPGFARMLIB) all: $(PROGRAM) include $(top_srcdir)/makes/prog.mk ### $(OBJS): $(DEPGFARMINC) \ $(GFARMLIB_SRCDIR)/gfs_client.h \ $(GFARMLIB_SRCDIR)/gfs_misc.h gfarm-2.4.1/gftool/gfq/0000755000000000000000000000000011507222730013356 5ustar rootrootgfarm-2.4.1/gftool/gfq/gfq_commit.sh0000755000000000000000000000074511507222717016055 0ustar rootroot#! /bin/sh # # $Id$ error() { echo $* exit 1 } [ X$GFQ_DIR = X ] && GFQ_DIR=/tmp/.gfq-$USER [ -d $GFQ_DIR ] || error "$GFS_DIR: no such directory" gfqbase=`basename $GFQ_DIR` gfrm -rf gfarm:~/$gfqbase >& /dev/null gfreg -r $GFQ_DIR gfarm:~ || error "cannot copy $GFQ_DIR to gfarm:~" pushd $GFQ_DIR > /dev/null for h in * do gfrcmd $h gfchmod 0755 gfarm:~/$gfqbase/$h gfrcmd $h gfexec gfarm:~/$gfqbase/$h & done wait popd > /dev/null gfrm -rfq gfarm:~/$gfqbase rm -rf $GFQ_DIR gfarm-2.4.1/gftool/gfq/Makefile0000644000000000000000000000033311507222717015022 0ustar rootroot# $Id$ top_builddir = ../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk SCRIPTS = $(srcdir)/gfq.sh $(srcdir)/gfq_setup.sh $(srcdir)/gfq_commit.sh include $(top_srcdir)/makes/script.mk gfarm-2.4.1/gftool/gfq/gfq_setup.sh0000755000000000000000000000076311507222717015725 0ustar rootroot#! /bin/sh # # $Id$ usage () { echo usage: $0 file cmd ... exit 1 } error() { echo $* exit 1 } file=$1 [ X$file = X ] && usage gftest -f $1 || error "$1: no such file" [ X$GFQ_DIR = X ] && GFQ_DIR=/tmp/.gfq-$USER [ ! -d $GFQ_DIR ] && mkdir $GFQ_DIR [ ! -d $GFQ_DIR ] && error "$GFQ_DIR: cannot create a temporary directory" shift cmd=$* n=$(gfwhere $file | wc -l) n=`expr $n - 1` i=0 gfsched $file | while read host do echo gfexec -I $i -N $n $cmd >> $GFQ_DIR/$host i=`expr $i + 1` done gfarm-2.4.1/gftool/gfq/gfq.sh0000755000000000000000000000013511507222717014476 0ustar rootroot#! /bin/sh # # $Id$ GFQ_DIR=/tmp/.gfq-$$ rm -rf $GFQ_DIR . gfq_setup.sh $* . gfq_commit.sh gfarm-2.4.1/gftool/gfkey/0000755000000000000000000000000011507222730013706 5ustar rootrootgfarm-2.4.1/gftool/gfkey/Makefile0000644000000000000000000000064011507222717015353 0ustar rootroot# $Id: Makefile 2373 2006-01-12 00:54:22Z soda $ top_builddir = ../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk SRCS = gfkey.c OBJS = gfkey.o PROGRAM = gfkey CFLAGS = $(COMMON_CFLAGS) -I$(GFARMLIB_SRCDIR) $(openssl_includes) LDLIBS = $(COMMON_LDLIBS) $(GFARMLIB) $(LIBS) DEPLIBS = $(DEPGFARMLIB) all: $(PROGRAM) include $(top_srcdir)/makes/prog.mk ### $(OBJS): $(DEPGFARMINC) gfarm-2.4.1/gftool/gfkey/gfkey.c0000644000000000000000000000613711507222717015173 0ustar rootroot/* * $Id: gfkey.c 4559 2010-03-25 11:50:13Z tatebe $ */ #include #include #include #include #include #include #include "auth.h" char *program_name = "gfkey"; static void write_hex(FILE *fp, void *buffer, size_t length) { unsigned char *p = buffer; size_t i; for (i = 0; i < length; i++) fprintf(fp, "%02x", p[i]); } void usage(void) { fprintf(stderr, "Usage: %s [-c|-f] [-p ] " "[-L ]\n", program_name); fprintf(stderr, " %s [-l|-e] [-L ]\n", program_name); fprintf(stderr, "option:\n"); fprintf(stderr, "\t-c\t\tcreate a new key, if it doesn't exist or " "it is expired\n"); fprintf(stderr, "\t-f\t\tforce to create a new key\n"); fprintf(stderr, "\t-p \tspecify term of validity in second\n"); fprintf(stderr, "\t-l\t\tlist the existing key\n"); fprintf(stderr, "\t-e\t\treport the expiration time\n"); fprintf(stderr, "\t-L \tmessage priority " "level\n"); exit(1); } void exclusive(void) { fprintf(stderr, "%s: warning: -c option and -f are mutually exclusive\n", program_name); #if 0 /* XXX maybe we should exit here? although this is not fatal error. */ exit(1); #endif } int main(argc, argv) int argc; char **argv; { int ch, do_list = 0, do_expire_report = 0; gfarm_error_t e; char *home; unsigned int expire; char shared_key[GFARM_AUTH_SHARED_KEY_LEN]; int mode = GFARM_AUTH_SHARED_KEY_GET; int period = -1; int log_level = -1; if (argc >= 1) program_name = basename(argv[0]); while ((ch = getopt(argc, argv, "ceflp:L:?")) != -1) { switch (ch) { case 'c': if (mode == GFARM_AUTH_SHARED_KEY_CREATE_FORCE) exclusive(); mode = GFARM_AUTH_SHARED_KEY_CREATE; break; case 'e': do_expire_report = 1; break; case 'f': if (mode == GFARM_AUTH_SHARED_KEY_CREATE) exclusive(); mode = GFARM_AUTH_SHARED_KEY_CREATE_FORCE; break; case 'l': do_list = 1; break; case 'p': period = strtol(optarg, NULL, 0); break; case 'L': log_level = gflog_syslog_name_to_priority(optarg); if (log_level == -1) { fprintf(stderr, "-L %s: invalid priority level\n", optarg); exit(1); } break; case '?': default: usage(); } } argc -= optind; argv += optind; if (argc != 0 || (mode == GFARM_AUTH_SHARED_KEY_GET && !do_list && !do_expire_report)) usage(); if (log_level != -1) gflog_set_priority_level(log_level); e = gfarm_set_local_user_for_this_local_account(); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", program_name, gfarm_error_string(e)); exit(1); } home = gfarm_get_local_homedir(); e = gfarm_auth_shared_key_get(&expire, shared_key, home, NULL, mode, period); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s\n", gfarm_error_string(e)); exit(1); } if (do_list) { printf("%08x ", expire); write_hex(stdout, shared_key, GFARM_AUTH_SHARED_KEY_LEN); putc('\n', stdout); } if (do_expire_report) { time_t t = expire; printf("expiration time is %s", ctime(&t)); } return (0); } gfarm-2.4.1/gftool/config-gfarm/0000755000000000000000000000000011507222730015140 5ustar rootrootgfarm-2.4.1/gftool/config-gfarm/gfarm.conf-postgresql.in0000644000000000000000000000070211507222717021715 0ustar rootrootmetadb_server_host @config_gfarm_backend_hostname@ metadb_server_port @config_gfarm_gfmd_port@ postgresql_server_host @config_gfarm_backend_hostname@ postgresql_server_port @config_gfarm_backend_port@ postgresql_dbname @config_gfarm_database_name@ postgresql_user @config_gfarm_backend_user@ postgresql_password "@config_gfarm_backend_password@" admin_user @config_gfarm_metadata_admin_user@ auth enable @config_gfarm_auth_type@ * sockopt keepalive gfarm-2.4.1/gftool/config-gfarm/gfarm-xmlattr.sql0000644000000000000000000000027411507222717020456 0ustar rootrootCREATE TABLE XmlAttr ( inumber INT8 NOT NULL REFERENCES INode(inumber) ON DELETE CASCADE, attrname VARCHAR(256) NOT NULL, attrvalue XML NOT NULL, PRIMARY KEY(inumber, attrname) ); gfarm-2.4.1/gftool/config-gfarm/gfarm.schema0000644000000000000000000001414011507222717017423 0ustar rootroot# # OID Base is: # iso(1) org(3) dod(6) internet(1) private(4) enterprise(1) # sra(13122) experimental(2) user(1) # soda(2924) gfarm2(101) # i.e. gfarm2 schema OID base is 1.3.6.1.4.1.13122.2.1.2924.101 # # gfarm2 schema: # 1.3.6.1.4.1.13122.2.1.2924.101.1.x attribute syntax # 1.3.6.1.4.1.13122.2.1.2924.101.2.x attribute type # 1.3.6.1.4.1.13122.2.1.2924.101.3.x object class # Attribute Type Definitions # 1.3.6.1.4.1.13122.2.1.2924.101.2.x attributetype ( 1.3.6.1.4.1.13122.2.1.2924.101.2.1 NAME 'hostname' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.13122.2.1.2924.101.2.2 NAME 'port' EQUALITY caseExactIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.13122.2.1.2924.101.2.3 NAME 'hostaliases' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) attributetype ( 1.3.6.1.4.1.13122.2.1.2924.101.2.4 NAME 'architecture' EQUALITY caseExactIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.13122.2.1.2924.101.2.5 NAME 'ncpu' EQUALITY caseExactIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.13122.2.1.2924.101.2.6 NAME 'flags' EQUALITY caseExactIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.13122.2.1.2924.101.2.7 NAME 'username' EQUALITY caseExactMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.13122.2.1.2924.101.2.8 NAME 'homedir' EQUALITY caseExactMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.13122.2.1.2924.101.2.9 NAME 'realname' EQUALITY caseExactMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.13122.2.1.2924.101.2.10 NAME 'gsiDN' EQUALITY caseExactMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.13122.2.1.2924.101.2.11 NAME 'groupname' EQUALITY caseExactMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.13122.2.1.2924.101.2.12 NAME 'groupusers' EQUALITY caseExactMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 ) attributetype ( 1.3.6.1.4.1.13122.2.1.2924.101.2.13 NAME 'inumber' EQUALITY caseExactIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.13122.2.1.2924.101.2.14 NAME 'igen' EQUALITY caseExactIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.13122.2.1.2924.101.2.15 NAME 'nlink' EQUALITY caseExactIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.13122.2.1.2924.101.2.16 NAME 'size' EQUALITY caseExactIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.13122.2.1.2924.101.2.17 NAME 'mode' EQUALITY caseExactIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.13122.2.1.2924.101.2.18 NAME 'atimesec' EQUALITY caseExactIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.13122.2.1.2924.101.2.19 NAME 'atimensec' EQUALITY caseExactIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.13122.2.1.2924.101.2.20 NAME 'mtimesec' EQUALITY caseExactIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.13122.2.1.2924.101.2.21 NAME 'mtimensec' EQUALITY caseExactIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.13122.2.1.2924.101.2.22 NAME 'ctimesec' EQUALITY caseExactIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.13122.2.1.2924.101.2.23 NAME 'ctimensec' EQUALITY caseExactIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.13122.2.1.2924.101.2.24 NAME 'checksumType' EQUALITY caseExactIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.13122.2.1.2924.101.2.25 NAME 'checksum' EQUALITY caseExactIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.13122.2.1.2924.100.2.26 NAME 'entryName' EQUALITY caseExactMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.13122.2.1.2924.101.2.27 NAME 'entryINumber' EQUALITY caseExactIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.13122.2.1.2924.100.2.28 NAME 'sourcePath' EQUALITY caseExactMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.13122.2.1.2924.101.2.29 NAME 'attrname' EQUALITY caseExactMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE ) attributetype ( 1.3.6.1.4.1.13122.2.1.2924.101.2.30 NAME 'attrvalue' SYNTAX 1.3.6.1.4.1.1466.115.121.1.5 SINGLE-VALUE ) # Object Class Definitions # 1.3.6.1.4.1.13122.2.1.2924.101.3.x objectclass ( 1.3.6.1.4.1.13122.2.1.2924.101.3.1 NAME 'GFarmHost' SUP top STRUCTURAL MUST ( hostname $ port $ architecture $ ncpu $ flags ) MAY ( hostaliases ) ) objectclass ( 1.3.6.1.4.1.13122.2.1.2924.101.3.2 NAME 'GFarmUser' SUP top STRUCTURAL MUST ( username $ homedir ) MAY ( realname $ gsiDN ) ) objectclass ( 1.3.6.1.4.1.13122.2.1.2924.101.3.3 NAME 'GFarmGroup' SUP top STRUCTURAL MUST ( groupname ) MAY ( groupusers ) ) objectclass ( 1.3.6.1.4.1.13122.2.1.2924.101.3.4 NAME 'GFarmINode' SUP top STRUCTURAL MUST ( inumber $ igen $ nlink $ size $ mode $ username $ groupname $ atimesec $ atimensec $ mtimesec $ mtimensec $ ctimesec $ ctimensec ) MAY ( checksumType $ checksum ) ) objectclass ( 1.3.6.1.4.1.13122.2.1.2924.101.3.6 NAME 'GFarmFileCopy' SUP top STRUCTURAL MUST ( inumber $ hostname ) ) objectclass ( 1.3.6.1.4.1.13122.2.1.2924.101.3.7 NAME 'GFarmDeadFileCopy' SUP top STRUCTURAL MUST ( inumber $ igen $ hostname ) ) objectclass ( 1.3.6.1.4.1.13122.2.1.2924.101.3.5 NAME 'GFarmDirEntry' SUP top STRUCTURAL MUST ( inumber $ entryName $ entryINumber ) ) objectclass ( 1.3.6.1.4.1.13122.2.1.2924.101.3.8 NAME 'GFarmSymlink' SUP top AUXILIARY MUST ( sourcePath ) ) objectclass ( 1.3.6.1.4.1.13122.2.1.2924.101.3.9 NAME 'XAttr' SUP top STRUCTURAL MUST ( inumber $ attrname $ attrvalue ) ) gfarm-2.4.1/gftool/config-gfarm/initial.ldif.in0000644000000000000000000000030411507222717020040 0ustar rootrootdn: @config_gfarm_ldap_base_dn@ objectclass: dcObject objectclass: organization objectclass: top dc: @config_gfarm_ldap_leaf_dc@ o: Gfarm file system userPassword: @config_gfarm_backend_password@ gfarm-2.4.1/gftool/config-gfarm/bdb.DB_CONFIG.in0000644000000000000000000000021011507222717017526 0ustar rootrootset_cachesize 0 @config_gfarm_slapd_bdb_cachesize@ @config_gfarm_slapd_bdb_ncache@ set_flags DB_TXN_NOSYNC set_flags DB_LOG_AUTOREMOVE gfarm-2.4.1/gftool/config-gfarm/gfarm.conf.in0000644000000000000000000000023111507222717017511 0ustar rootrootmetadb_server_host @config_gfarm_backend_hostname@ metadb_server_port @config_gfarm_gfmd_port@ auth enable @config_gfarm_auth_type@ * sockopt keepalive gfarm-2.4.1/gftool/config-gfarm/config-gfarm-update.postgresql0000644000000000000000000000773211507222717023122 0ustar rootrootupdate_usage_postgresql() { echo >&2 " [-X]" return 0 # backend-specific option(s) exist(s) } update_pgpass_postgresql() { PGPASS=$HOME/.pgpass if [ -f ${PGPASS} ]; then if=${PGPASS} of=${PGPASS}.new else if=/dev/null of=${PGPASS} fi if [ ! -f ${of} ]; then touch ${of} || ABORT "${of}: cannot create" chmod 0600 ${of} || ABORT "${of}: cannot change mode" fi $awk -F: 'BEGIN { host="'$1'" port='$2' db="'$3'" user="'$4'" passwd="'$5'" done = 0 } { if ($1 != host || $2 != port || $3 != db || $4 != user) { print $0 } else { printf "%s:%s:%s:%s:%s\n", host, port, db, user, passwd done = 1 } } END { if (!done) printf "%s:%s:%s:%s:%s\n", host, port, db, user, passwd }' ${if} >${of} if [ X"$if" != X"/dev/null" ]; then if cmp -s ${if} ${of}; then rm -f ${PGPASS}.new else mv ${PGPASS} ${PGPASS}.bak mv ${PGPASS}.new ${PGPASS} fi fi } update_postprocess_postgresql() { update_pgpass_postgresql localhost ${BACKEND_PORT} "${DB_NAME}" "${BACKEND_ADMIN_USER}" "${BACKEND_ADMIN_PASSWD}" } update_first_set_param_postgresql() { : ${BACKEND_PORT=`getvalue postgresql_server_port`} : ${DB_NAME:=`getvalue postgresql_dbname`} : ${BACKEND_USER:=`getvalue postgresql_user`} : ${SUPPORT_XML_TYPE:=no} unset PGHOST # force UNIX domain socket access psql=${PGSQL_BINDIR}/psql } update_last_set_param_postgresql() { : ${BACKEND_ADMIN_PASSWD:=`cat ${BACKEND_DATA_DIR}/admin_password 2>/dev/null`} } update_sanity_postgresql() { rv=0 if [ X"$BACKEND_PORT" = X -o X"$DB_NAME" = X -o X"$BACKEND_USER" = X ] then echo "ERROR: postgresql backend is not configured" >&2 rv=1 fi if [ X"$BACKEND_ADMIN_PASSWD" = X ] then echo "ERROR: password for postgresql administrator cannot be read. Use --prefix option or -l option to specify a data directory of the backend database." >&2 rv=1 fi return $rv } update_postgresql() { if [ "`$psql -q -t -A -p ${BACKEND_PORT} -U ${BACKEND_ADMIN_USER} -d ${DB_NAME} -c '\dt Symlink' | wc -l`" -eq 0 ]; then echo "${PROGNAME}: adding Symlink table" ( sed -n '/CREATE TABLE Symlink/,/^)/p' $config_dir/gfarm.sql cat <<__EOF__ GRANT SELECT, INSERT, UPDATE, DELETE ON Symlink TO $BACKEND_USER; __EOF__ ) | $psql -q -p ${BACKEND_PORT} -U ${BACKEND_ADMIN_USER} -d ${DB_NAME} fi if [ "`$psql -q -t -A -p ${BACKEND_PORT} -U ${BACKEND_ADMIN_USER} -d ${DB_NAME} -c '\dt XAttr' | wc -l`" -eq 0 ]; then echo "${PROGNAME}: adding XAttr table" ( sed -n '/CREATE TABLE XAttr/,/^)/p' $config_dir/gfarm.sql cat <<__EOF__ GRANT SELECT, INSERT, UPDATE, DELETE ON XAttr TO $BACKEND_USER; __EOF__ ) | $psql -q -p ${BACKEND_PORT} -U ${BACKEND_ADMIN_USER} -d ${DB_NAME} fi if [ X"$SUPPORT_XML_TYPE" = Xyes -a \ "`$psql -q -t -A -p ${BACKEND_PORT} -U ${BACKEND_ADMIN_USER} -d ${DB_NAME} -c '\dt XmlAttr' | wc -l`" -eq 0 ]; then echo "${PROGNAME}: adding XmlAttr table" ( cat $config_dir/gfarm-xmlattr.sql cat <<__EOF__ GRANT SELECT, INSERT, UPDATE, DELETE ON XmlAttr TO $BACKEND_USER; __EOF__ ) | $psql -q -p ${BACKEND_PORT} -U ${BACKEND_ADMIN_USER} -d ${DB_NAME} fi if [ "`$psql -q -t -A -p ${BACKEND_PORT} -U ${BACKEND_ADMIN_USER} -d ${DB_NAME} -c '\dt QuotaUser' | wc -l`" -eq 0 ]; then echo "${PROGNAME}: adding QuotaUser table" ( sed -n '/CREATE TABLE QuotaUser/,/^)/p' $config_dir/gfarm.sql cat <<__EOF__ GRANT SELECT, INSERT, UPDATE, DELETE ON QuotaUser TO $BACKEND_USER; __EOF__ ) | $psql -q -p ${BACKEND_PORT} -U ${BACKEND_ADMIN_USER} -d ${DB_NAME} fi if [ "`$psql -q -t -A -p ${BACKEND_PORT} -U ${BACKEND_ADMIN_USER} -d ${DB_NAME} -c '\dt QuotaGroup' | wc -l`" -eq 0 ]; then echo "${PROGNAME}: adding QuotaGroup table" ( sed -n '/CREATE TABLE QuotaGroup/,/^)/p' $config_dir/gfarm.sql cat <<__EOF__ GRANT SELECT, INSERT, UPDATE, DELETE ON QuotaGroup TO $BACKEND_USER; __EOF__ ) | $psql -q -p ${BACKEND_PORT} -U ${BACKEND_ADMIN_USER} -d ${DB_NAME} fi } update_access_db_postgresql() { OPTIONS="$*" $psql -p $BACKEND_PORT $OPTIONS $DB_NAME $BACKEND_ADMIN_USER } gfarm-2.4.1/gftool/config-gfarm/config-gfarm-update.in0000644000000000000000000000764711507222717021332 0ustar rootroot#!/bin/sh # # $Id$ ${DEBUG:="false"} && set -xu PROGNAME=`basename $0` # LANG may cause trouble to access database unset LANG # Gfarm installation directory prefix="@prefix@" sysconfdir="@sysconfdir@" config_dir="@datadir@/gfarm/config" PATH="${prefix}/bin:${prefix}/sbin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/ucb:/usr/pkg/bin:/usr/pkg/sbin:/usr/local/bin:/usr/local/sbin:$PATH" export PATH search_path="$PATH" awk=awk if [ -f /usr/bin/nawk ]; then awk=/usr/bin/nawk; fi status=1 admin_password=/tmp/ap$$ password=/tmp/up$$ rm -f $password $admin_password trap 'rm -f $password $admin_password; stty echo 2>/dev/null; exit $status' 0 1 2 15 getvalue() { $awk '$1 == "'"$1"'" { print $2 }' $GFMD_CONF } ABORT() { [ $# -gt 0 ] && echo >&2 "${PROGNAME}: $@" echo >&2 "$PROGNAME failure" exit 1 } update_usage_() { return 1 } usage() { echo >&2 "usage: $PROGNAME [--help] [-t] [--update]" echo >&2 " [-N] - do not restart the server processes" echo >&2 " [--prefix prefix] - directory specified in config-gfarm" echo >&2 " [-P backend_prefix] - installation prefix of the backend program" echo >&2 " [-l metadata_directory] - backend database data directory" echo >&2 " [-f backend_file]" update_usage_$BACKEND_TYPE || echo >&2 " no option for backend=$BACKEND_TYPE" exit 1 } update_sanity_() { return 0 } update_sanity() { update_sanity_$BACKEND_TYPE } # most $BACKEND_TYPE calls the followings # from display_backend_params_$BACKEND_TYPE, but some may not. display_backend_data_dir_param() { echo "metadata directory [-l]: $BACKEND_DATA_DIR" } display_backend_log_dir_param() { return 0 } display_params() { echo "prefix [--prefix]: $CONFIG_PREFIX" echo "metadata backend [-b]: $BACKEND_TYPE" display_backend_params_$BACKEND_TYPE display_backend_port_params_$BACKEND_TYPE display_backend_optional_params_$BACKEND_TYPE update_sanity exit 0 } # # parse arguments # : ${BACKEND_OPTIONS:=} while [ $# -gt 0 ] ; do case $1 in # set parameters --prefix) shift; [ $# -ge 1 ] || usage CONFIG_PREFIX=$1 ;; -P) shift; [ $# -ge 1 ] || usage BACKEND_PREFIX=$1 ;; -l) shift; [ $# -ge 1 ] || usage BACKEND_DATA_DIR=$1 ;; -f) shift; [ $# -ge 1 ] || usage BACKEND_OPTIONS="$BACKEND_OPTIONS -f $1" ;; # control options --help) usage ;; -N) START_SERVICE=false ;; -t) DISPLAY_PARAMS=true ;; --update|--update-symlink) UPDATE=true ;; # XXX postgresql backend dependent option -X) SUPPORT_XML_TYPE=yes ;; *) usage ;; esac shift done : ${CONFIG_PREFIX:=} if [ X"$CONFIG_PREFIX" != X ]; then : ${GFARM_CONF_DIR:="$CONFIG_PREFIX/etc"} else : ${GFARM_CONF_DIR:="$sysconfdir"} fi : ${GFMD_CONF:="$GFARM_CONF_DIR/gfmd.conf"} # sanity check if [ ! -f ${GFMD_CONF} ]; then ABORT "${PROGNAME}: cannot find ${GFMD_CONF}, --prefix option required" fi # determine a backend database type if grep '^[ ]*postgresql_server_host[ ]' ${GFMD_CONF} >/dev/null then BACKEND_TYPE=postgresql elif grep '^[ ]*ldap_server_host[ ]' ${GFMD_CONF} >/dev/null then BACKEND_TYPE=ldap else echo >&2 "${PROGNAME}: cannot determine the backend type" exit 1 fi # load backend-dependent functions . $config_dir/config-gfarm.$BACKEND_TYPE . $config_dir/config-gfarm-update.$BACKEND_TYPE # # search default $BACKEND_PREFIX # set_default_backend_prefix_$BACKEND_TYPE . $config_dir/config-gfarm.sysdep # # default values # set_first_defaults_$BACKEND_TYPE sysdep_defaults : ${DISPLAY_PARAMS:=false} : ${START_SERVICE:=true} : ${UPDATE:=false} update_first_set_param_$BACKEND_TYPE set_last_defaults_$BACKEND_TYPE update_last_set_param_$BACKEND_TYPE update_sanity || ABORT "aborted" # -t option; display parameters $DISPLAY_PARAMS && display_params update_postprocess_$BACKEND_TYPE || ABORT "aborted" # if $UPDATE; then update_$BACKEND_TYPE else update_access_db_$BACKEND_TYPE $BACKEND_OPTIONS fi status=0 # trap action automatically returns this $status as exit code gfarm-2.4.1/gftool/config-gfarm/config-gfarm.in0000644000000000000000000003243711507222717020045 0ustar rootroot#!/bin/sh # # $Id: config-gfarm.in 4174 2009-06-07 13:09:12Z tatebe $ ${DEBUG:="false"} && set -xu PROGNAME=`basename $0` # Gfarm installation directory prefix="@prefix@" sysconfdir="@sysconfdir@" config_dir="@datadir@/gfarm/config" globus_location="@globus_location@" # # backend initialization # POSTGRESQL_TARGETS=postgresql LDAP_TARGETS=ldap # The order of $backend_candidates is important, it's used to choose default. backend_candidates="@postgresql_targets@ @ldap_targets@" backend_all="postgresql ldap" backend_default=`echo $backend_candidates | awk '{print $1}'` if [ -z "$backend_default" ]; then echo >&2 "$PROGNAME: no usable metadata backend is configured" exit 1 fi BACKEND_TYPE=$backend_default # # # PATH="${prefix}/bin:${prefix}/sbin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/ucb:/usr/pkg/bin:/usr/pkg/sbin:/usr/local/bin:/usr/local/sbin:$PATH" export PATH search_path="$PATH" awk=awk if [ -f /usr/bin/nawk ]; then awk=/usr/bin/nawk; fi status=1 sed_script=/tmp/cf$$ admin_password=/tmp/ap$$ password=/tmp/up$$ rm -f $sed_script $password $admin_password trap 'rm -f $sed_script $password $admin_password; stty echo 2>/dev/null; exit $status' 0 1 2 15 # # check whether shell function does work or not. # BOURNE_SHELL="${BOURNE_SHELL-/bin/sh}" if [ x"$1" = x--re-invoked ]; then # shell function works with this shell, remove --re-invoked option shift elif "$BOURNE_SHELL" -c 'shellfunc() { exit 0; }; shellfunc' 2>/dev/null; then # shell function works : else # Search other shell that supports shell functions for sh in ksh bash zsh sh ash bsh sh5; do set `IFS=:; P="/bin:/usr/5bin:/usr/bin:/usr/local/bin:/usr/pkg/bin:$PATH"; echo $P` for dir do shell="$dir/$sh" if ( [ -f "$shell" ] || [ -f "$shell.exe" ] ) && "$shell" -c 'shellfunc() { exit 0; }; shellfunc' 2>/dev/null then BOURNE_SHELL="$shell" exec "$shell" "$0" \ --re-invoked ${1+"$@"} fi done done echo "$PROGNAME: cannot find a shell which supports functions" >&2 exit 1 fi # load backend-dependent functions. should be done after shell detection above. for i in $backend_all do . $config_dir/config-gfarm.$i done gen_passwd() { chars="=.0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" if [ -r /dev/urandom ]; then # enough entropy, use 258bit(=log2(64)*43) key dd if=/dev/urandom bs=44 count=1 2>/dev/null | od -d | $awk ' BEGIN{ chars="'"$chars"'" k=length(chars) chars_per_word=2 l=43 # 43 characters, 256bits/log2(64) = 42.666 } { for (i = 2; i <= NF; i++) { r = $i for (j = 0; j < chars_per_word; j++) { if (l <= 0) exit printf "%c", substr(chars, r%k + 1, 1) r /= k --l } } } END { printf "\n" }' else # 32bit entropy due to the seed, use 66bit(=log2(64)*11) key $awk ' BEGIN { chars="'"$chars"'" k=length(chars) srand(); now = srand(); srand('$$' * 12 * 60 * 60 + now) for (i = 0; i < 11; i++) { printf "%c", substr(chars, int(rand()*k)+1, 1) } printf "\n" exit }' fi } usage() { echo >&2 "usage: $PROGNAME [--help] [--prefix prefix] [-t] [-f]" echo >&2 " [-S] [-N] [-W] [-w]" echo >&2 " [-h hostname] [-d domain_name] [-m gfmd_port]" echo >&2 " [-A metadata_admin_user] [-D metadata_admin_gsi_dn]" echo >&2 " [-a auth_type]" echo >&2 " [-b metadata_backend] [-P backend_prefix]" echo >&2 " [-V metadata_backend_version] [-p metadata_backend_port]" echo >&2 " [-U backend_admin_user] [-u backend_user]" echo >&2 " [-l metadata_directory] [-L metadata_logging_directory]" echo >&2 " $BACKEND_TYPE backend options: (must be specified after -b )" usage_$BACKEND_TYPE || echo >&2 " no option for backend=$BACKEND_TYPE" echo >&2 " available metadata_backend: $backend_candidates (default is $backend_default)" exit 1 } ABORT() { [ $# -gt 0 ] && echo >&2 "${PROGNAME}: $@" echo >&2 "$PROGNAME failure" exit 1 } # most $BACKEND_TYPE uses the following as "service_start_$BACKEND_TYPE" # but some may not. service_start_common() { if [ -f $RUN_DIR/$RC_BACKEND_BASENAME.pid ]; then ctl=restart else ctl=start fi service_add $RC_BACKEND_BASENAME && service_ctl $RC_BACKEND_BASENAME $ctl ${1+"$@"} || ABORT "failed to $ctl $RC_BACKEND_BASENAME" } sanity() { sanity_$BACKEND_TYPE } # most $BACKEND_TYPE calls the followings # from display_backend_params_$BACKEND_TYPE, but some may not. display_backend_data_dir_param() { echo "metadata directory [-l]: $BACKEND_DATA_DIR" } display_backend_log_dir_param() { echo "metadata log directory [-L]: $BACKEND_LOG_DIR" } display_params() { echo "prefix [--prefix]: $CONFIG_PREFIX" echo "metadata backend [-b]: $BACKEND_TYPE" echo "(available backend: $backend_candidates)" display_backend_params_$BACKEND_TYPE echo "metaserver hostname [-h]: $BACKEND_HOSTNAME" echo "matadata admin user [-A]: $METADATA_ADMIN_USER" echo "matadata admin dn [-D]: $METADATA_ADMIN_USER_GSI_DN" display_backend_port_params_$BACKEND_TYPE echo "gfmd port [-m]: $GFMD_PORT" echo "auth type [-a]: $AUTH_TYPE" display_backend_optional_params_$BACKEND_TYPE sanity exit 0 } # # parse arguments # while [ $# -gt 0 ] ; do case $1 in # set parameters --prefix) shift; [ $# -ge 1 ] || usage CONFIG_PREFIX=$1 ;; -b) shift; [ $# -ge 1 ] || usage ( echo $backend_candidates; echo $backend_all ) | $awk 'BEGIN { type="'"$1"'"; st=2 } NR==1 { for (i = 1; i <= NF; i++) if ($i == type) {st=0;exit} } NR==2 { for (i = 1; i <= NF; i++) if ($i == type) {st=1;exit} } END { exit st }' case $? in 0) BACKEND_TYPE=$1;; 1) echo >&2 "backend <$1> is not configured"; exit 1;; *) echo >&2 "unknown metadata backend <$1>"; exit 1;; esac ;; -d) shift; [ $# -ge 1 ] || usage DOMAIN_NAME=$1 ;; -U) shift; [ $# -ge 1 ] || usage BACKEND_ADMIN_USER=$1 ;; -u) shift; [ $# -ge 1 ] || usage BACKEND_USER=$1 ;; -P) shift; [ $# -ge 1 ] || usage BACKEND_PREFIX=$1 ;; -V) shift; [ $# -ge 1 ] || usage BACKEND_VERSION=$1 ;; -l) shift; [ $# -ge 1 ] || usage BACKEND_DATA_DIR=$1 ;; -L) shift; [ $# -ge 1 ] || usage BACKEND_LOG_DIR=$1 ;; -h) shift; [ $# -ge 1 ] || usage BACKEND_HOSTNAME=$1 ;; -A) shift; [ $# -ge 1 ] || usage METADATA_ADMIN_USER=$1 ;; -D) shift; [ $# -ge 1 ] || usage METADATA_ADMIN_USER_GSI_DN=$1 ;; -p) shift; [ $# -ge 1 ] || usage BACKEND_PORT=$1 ;; -m) shift; [ $# -ge 1 ] || usage GFMD_PORT=$1 ;; -a) shift; [ $# -ge 1 ] || usage case $1 in sharedsecret|gsi_auth|gsi) AUTH_TYPE=$1;; *) echo >&2 "$PROGNAME: the argument of -a option must be sharedsecret, gsi_auth or gsi." exit 1;; esac ;; # control options --help) usage ;; -S) PRIVATE_MODE=true ;; -N) START_SERVICE=false ;; -f) FORCE=true ;; -t) DISPLAY_PARAMS=true ;; -W) stty -echo; ( umask 077; printf "admin password: "; $awk 'NR==1{print $0;exit}' > $admin_password echo ) stty echo ;; -w) stty -echo; ( umask 077; printf "user password: "; $awk 'NR==1{print $0;exit}' > $password echo ) stty echo ;; -*) if parse_argument_$BACKEND_TYPE "$@"; then shift $argshift else echo "unknown option $1"; usage fi ;; *) usage ;; esac shift done # # search default $BACKEND_PREFIX # set_default_backend_prefix_$BACKEND_TYPE . $config_dir/config-gfarm.sysdep # # default values # : ${CONFIG_PREFIX:=} set_first_defaults_$BACKEND_TYPE # NOTE: $CONFIG_PREFIX and $RC_BACKEND_BASENAME need to be set # before calling sysdep_defaults # sysdep_defaults must set: $RC_DIR sysdep_defaults : ${PRIVATE_MODE:=false} : ${START_SERVICE:=true} : ${FORCE:=false} : ${DISPLAY_PARAMS:=false} : ${RUN_DIR:="$CONFIG_PREFIX/var/run"} if [ X"$CONFIG_PREFIX" != X ]; then : ${GFARM_CONF_DIR:="$CONFIG_PREFIX/etc"} else : ${GFARM_CONF_DIR:="$sysconfdir"} fi : ${GFARM_CONF:="$GFARM_CONF_DIR/gfarm2.conf"} : ${GFMD_CONF:="$GFARM_CONF_DIR/gfmd.conf"} : ${METADATA_ADMIN_USER:=`who am i | awk '{print $1}'`} : ${METADATA_ADMIN_USER_GSI_DN:=} : ${AUTH_TYPE:="sharedsecret"} if $PRIVATE_MODE; then : ${GFMD_PORT:="10601"} else : ${GFMD_PORT:="601"} fi : ${RC_GFMD_IN="$config_dir/gfmd.in"} : ${RC_BACKEND_IN="$config_dir/$RC_BACKEND_BASENAME.in"} : ${FQ_HOSTNAME:=`fq_hostname`} : ${BACKEND_HOSTNAME:="$FQ_HOSTNAME"} [ X$BACKEND_HOSTNAME = X ] && ABORT 'cannot determine metadata server hostname, please specify it by -h option' set_last_defaults_$BACKEND_TYPE # -t option; display parameters $DISPLAY_PARAMS && display_params sanity || ABORT "aborted" ######################################################################### # most $BACKEND_TYPE uses the following as part of "init_replace_$BACKEND_TYPE" # but some may not. init_replace_common() { cat <<_EOF_ s|@config_gfarm_backend_privilege@|$BACKEND_PRIVILEGE|g s|@config_gfarm_backend_admin_user@|$BACKEND_ADMIN_USER|g s|@config_gfarm_backend_user@|$BACKEND_USER|g s|@config_gfarm_backend_hostname@|$BACKEND_HOSTNAME|g s|@config_gfarm_backend_port@|$BACKEND_PORT|g s|@config_gfarm_backend_prefix@|$BACKEND_PREFIX|g s|@config_gfarm_backend_data_dir@|$BACKEND_DATA_DIR|g s|@config_gfarm_backend_log_dir@|$BACKEND_LOG_DIR|g _EOF_ } init_replace() { # create $sed_script for "replace" command ( umask 077 ( cat <<_EOF_ s|@config_gfarm_prefix@|$prefix|g s|@config_gfarm_gfarm_config@|$GFARM_CONF|g s|@config_gfarm_gfmd_config@|$GFMD_CONF|g s|@config_gfarm_globus_location@|${GLOBUS_LOCATION:-$globus_location}|g s|@config_gfarm_metadata_admin_user@|$METADATA_ADMIN_USER|g s|@config_gfarm_gfmd_port@|$GFMD_PORT|g s|@config_gfarm_gfmd_option@|-f $GFMD_CONF|g s|@config_gfarm_gfsd_option@|-f $GFARM_CONF|g s|@config_gfarm_run_dir@|$RUN_DIR|g s|@config_gfarm_auth_type@|$AUTH_TYPE|g _EOF_ $awk '{ printf "s|@config_gfarm_backend_admin_password@|%s|g\n", $0 }' $admin_password $awk '{ printf "s|@config_gfarm_backend_password@|%s|g\n", $0 }' $password init_replace_$BACKEND_TYPE ) > $sed_script ) } replace() { sed -f $sed_script ${1+"$@"} | config_sysdep } mkcnf() { # local out out=$1 shift if ${1+"$@"} >$out; then echo created $out else ABORT "cannot create $out" fi } mkscript() { mkcnf ${1+"$@"} chmod +x "$1" || ABORT "cannot chmod +x $1" } delete_file_or_directory() { # local p for p do [ -d "$p" ] && rmdir "$p" > /dev/null 2>&1 # [ -e "$p" ] isn't portable. not supported by Solaris /bin/sh if ls -1d "$p" >/dev/null 2>&1; then if $FORCE; then rm -rf "$p" echo removed "$p" else ABORT "$p already exist" fi fi done } create_directory() { # local d for d do [ -d "$d" ] && continue if mkdir -p "$d"; then echo created "$d" else ABORT "mkdir -p $d, failed" fi done } # most $BACKEND_TYPE uses the following as "init_replace_$BACKEND_TYPE" # but some may not. ######################################################################### delete_file_or_directory \ "$GFARM_CONF" \ "$GFMD_CONF" \ "$BACKEND_DATA_DIR" \ "$BACKEND_LOG_DIR" \ "$RC_DIR/$RC_BACKEND_BASENAME" # We won't create "$BACKEND_LOG_DIR", otherwise initdb of PostgreSQL fails. create_directory \ "$GFARM_CONF_DIR" \ "$BACKEND_DATA_DIR" \ "$RC_DIR" \ "$RUN_DIR" chmod 700 "$BACKEND_DATA_DIR" make_configuration_directory_$BACKEND_TYPE ( umask 077 [ -r $admin_password ] || gen_passwd > $admin_password [ -r $password ] || gen_passwd > $password ) init_replace if [ -n "$BACKEND_PRIVILEGE" ]; then chown "$BACKEND_PRIVILEGE" "$BACKEND_DATA_DIR" \ $admin_password $password case `uname` in SunOS|HP-UX|NetBSD|DragonFly) # "-" option makes Solaris and HP-UX display /etc/motd, # and it makes pkgsrc platforms (NetBSD/DragonFly) fail # because pkgsrc doesn't create the home directory by default. run_with_backend_privilege="su $BACKEND_PRIVILEGE -c /bin/sh";; *) # For SELinux we need to use 'runuser' not 'su' [ -x /sbin/runuser ] && SU=/sbin/runuser || SU=su run_with_backend_privilege="$SU - $BACKEND_PRIVILEGE -c /bin/sh" ;; esac else run_with_backend_privilege="/bin/sh" fi # this needs to be called before other "mkcnf" operations # to make some directories. mkcnf_gfmd_sysdep # create configuration files mkcnf "$GFARM_CONF" replace "$config_dir/gfarm.conf.in" # for GSI authentication (a service certificate is used) case $AUTH_TYPE in gsi_auth|gsi) echo "spool_server_cred_type host" >> $GFARM_CONF echo "spool_server_cred_service gfsd" >> $GFARM_CONF ;; *) ;; esac mkcnf "$GFMD_CONF" replace "$config_dir/gfarm.conf-$BACKEND_TYPE.in" chmod 600 "$GFMD_CONF" # for GSI authentication if [ X"$METADATA_ADMIN_USER_GSI_DN" != X ]; then echo "admin_user_gsi_dn \"$METADATA_ADMIN_USER_GSI_DN\"" >> $GFMD_CONF fi make_configuration_file_$BACKEND_TYPE # private user mode if $PRIVATE_MODE; then GFSD_CONF="$GFARM_CONF_DIR/gfsd.conf" USERMAP_FILE="$GFARM_CONF_DIR/usermap" echo _gfarmfs `whoami` > $USERMAP_FILE cp $GFARM_CONF $GFSD_CONF echo local_user_map $USERMAP_FILE >> $GFMD_CONF fi # create run scripts mkscript "$RC_DIR/$RC_BACKEND_BASENAME" replace "$RC_BACKEND_IN" mkscript "$RC_DIR/gfmd" replace "$RC_GFMD_IN" apply_configuration_$BACKEND_TYPE if $START_SERVICE; then service_start_$BACKEND_TYPE if [ -f $RUN_DIR/gfmd.pid ]; then ctl=restart; else ctl=start; fi service_add gfmd && service_ctl gfmd $ctl || ABORT "failed to $ctl gfmd" fi echo "$PROGNAME success" status=0 # trap action automatically returns this $status as exit code gfarm-2.4.1/gftool/config-gfarm/config-gfarm.ldap0000644000000000000000000001521211507222717020347 0ustar rootrootusage_ldap() { echo >&2 " [-c berkeley_DB_cachesize]" return 0 # backend-specific option(s) exist(s) } sanity_ldap() { rv=0 if [ ! -x "$OPENLDAP_SLAPADD" ]; then echo "WARNING: command not found: slapadd" >&2 rv=1 fi if [ ! -x "$OPENLDAP_LIBEXEC/slapd" ]; then echo "WARNING: command not found: slapd" >&2 rv=1 fi if [ ! -f "$OPENLDAP_ETC/schema/core.schema" ]; then echo "WARNING: file not found:" \ "$OPENLDAP_ETC/schema/core.schema" >&2 rv=1 fi return $rv } display_backend_params_ldap() { display_backend_data_dir_param display_backend_log_dir_param echo "domain name [-d]: $DOMAIN_NAME" echo "ldap root user [-U]: $BACKEND_ADMIN_USER" echo "ldap root password [-W]: `if [ -r $admin_password ]; then cat $admin_password; else echo '(auto generated)'; fi`" echo "ldap user [-u]: $BACKEND_USER" echo "ldap password [-w]: `if [ -r $password ]; then cat $password; else echo '(auto generated)'; fi`" echo "openldap prefix [-P]: $BACKEND_PREFIX" echo "openldap version [-V]: $BACKEND_VERSION" } display_backend_port_params_ldap() { echo "slapd port [-p]: $BACKEND_PORT" } display_backend_optional_params_ldap() { echo 'slapd DB cache size [-c]:' ` case $SLAPD_DB in bdb) echo $SLAPD_BDB_CACHESIZE bytes;; *) echo '(this option is only available for SLAPD_DB="bdb")';; esac` echo 'slapd DB type ($SLAPD_DB):' "$SLAPD_DB" } # $argshift is an output parameter, if this function returns success. parse_argument_ldap() { case "$1" in -c) [ $# -ge 2 ] || usage SLAPD_BDB_CACHESIZE=$2 argshift=1 true;; *) false;; esac } # # search default $BACKEND_PREFIX # set_default_backend_prefix_ldap() { if [ -z "${BACKEND_PREFIX-}" ]; then OIFS=$IFS IFS=":" set $search_path IFS=$OIFS for d do if [ -x "$d/slapadd" ]; then BACKEND_PREFIX=`dirname "$d"` : ${OPENLDAP_SLAPADD:="$d/slapadd"} break fi done fi if [ -z "${BACKEND_PREFIX-}" ]; then OIFS=$IFS IFS=":" set $search_path IFS=$OIFS for d do b=`dirname "$d"` if [ -x "$b/sbin/slapadd" ]; then BACKEND_PREFIX=$b : ${OPENLDAP_SLAPADD:="$b/sbin/slapadd"} break fi done fi } # # default values # # NOTE: This needs to set $RC_BACKEND_BASENAME, at least. set_first_defaults_ldap() { : ${RC_BACKEND_BASENAME=gfarm-slapd} if [ -f "$BACKEND_PREFIX/etc/openldap/schema/core.schema" ]; then : ${OPENLDAP_ETC:="$BACKEND_PREFIX/etc/openldap"} fi if [ -x "$BACKEND_PREFIX/sbin/slapadd" ]; then : ${OPENLDAP_SLAPADD:="$BACKEND_PREFIX/sbin/slapadd"} fi } # set_first_defaults_ldap or sysdep_defaults may already set $OPENLDAP_ETC. set_last_defaults_ldap() { # We currently don't use ${BACKEND_PRIVILEGE} with LDAP : ${BACKEND_PRIVILEGE:=""} # NOTE: need to set $FQ_HOSTNAME before invoking dns_domainname : ${DOMAIN_NAME:=`dns_domainname`} [ X"$DOMAIN_NAME" = X ] && ABORT 'cannot determine DNS domain name' # official LDAP port number is 389 : ${BACKEND_PORT:="10602"} : ${LDAP_BASE_DN="dc=`echo ${DOMAIN_NAME} | sed -e 's/\./,dc=/g'`"} : ${LDAP_LEAF_DC="`echo $LDAP_BASE_DN | sed -e 's/,.*//' -e 's/dc=//'`"} : ${BACKEND_ADMIN_USER:="cn=root,$LDAP_BASE_DN"} : ${BACKEND_USER:="$LDAP_BASE_DN"} : ${OPENLDAP_ETC:="/etc/openldap"} if [ -x "$BACKEND_PREFIX/sbin/slapd" ]; then : ${OPENLDAP_LIBEXEC:="$BACKEND_PREFIX/sbin"} else : ${OPENLDAP_LIBEXEC:="$BACKEND_PREFIX/libexec"} fi if [ -z "${BACKEND_VERSION-}" ]; then if [ -x "$BACKEND_PREFIX/bin/ldapsearch" ]; then BACKEND_VERSION=`"$BACKEND_PREFIX/bin/ldapsearch" -Vxn 2>&1 | sed -n 's/.*ldapsearch \([0-9][0-9]*\.[0-9][0-9]*\).*/\1/p'` if [ -z "$BACKEND_VERSION" ] then BACKEND_VERSION="2.0" # assumes older version elif expr "$BACKEND_VERSION" : '[0-9][0-9]*\.[0-9][0-9]*' \ >/dev/null; then : else BACKEND_VERSION="unknown" fi else BACKEND_VERSION="unknown" fi fi case $BACKEND_VERSION in [01].*|2.0) # 2.0.X or before : ${SLAPD_DB:="ldbm"} : ${SLAPD_CONF_IN:="$config_dir/slapd.conf-2.0.in"} ;; *) # 2.1.X or later : ${SLAPD_DB:="bdb"} : ${SLAPD_CONF_IN:="$config_dir/slapd.conf-2.1.in"} ;; esac : ${BACKEND_DATA_DIR:="$CONFIG_PREFIX/var/gfarm-ldap"} : ${BACKEND_LOG_DIR:="$BACKEND_DATA_DIR"} : ${LDAP_CONF_DIR:="$CONFIG_PREFIX/etc/gfarm-ldap"} : ${SLAPD_CONF:="$LDAP_CONF_DIR/slapd.conf"} : ${LDAP_SCHEMA:="$LDAP_CONF_DIR/gfarm.schema"} : ${INITIAL_LDIF:="$LDAP_CONF_DIR/initial.ldif"} # Debian uses dynamic loading for backend db module. # (e.g. /usr/lib/ldap/back_bdb.so) # We need "\" at the end-of-line, because this is used for # s/// statement for sed. if [ -f "$BACKEND_PREFIX/lib/openldap/back_$SLAPD_DB.so" ]; then : ${SLAPD_CONF_HOOK:='\ modulepath '"$BACKEND_PREFIX/openlib/ldap"'\ moduleload back_'"$SLAPD_DB"} elif [ -f "$BACKEND_PREFIX/lib/ldap/back_$SLAPD_DB.so" ]; then : ${SLAPD_CONF_HOOK:='\ modulepath '"$BACKEND_PREFIX/lib/ldap"'\ moduleload back_'"$SLAPD_DB"} fi : ${SLAPD_CONF_HOOK:=""} : ${SLAPD_BDB_CACHESIZE:="`memory_size|$awk '{printf "%.0f\n",$NF/2*1024*1024}'`"} : ${SLAPD_BDB_NCACHE:="2"} # 0/1: contiguous memory, >1: non-contiguous memory } # # do configuration # init_replace_ldap() { init_replace_common cat <<_EOF_ s|@config_gfarm_ldap_base_dn@|$LDAP_BASE_DN|g s|@config_gfarm_ldap_leaf_dc@|$LDAP_LEAF_DC|g s|@config_gfarm_ldap_conf_dir@|$LDAP_CONF_DIR|g s|@config_gfarm_ldap_schema@|$LDAP_SCHEMA|g s|@config_gfarm_slapd_config@|$SLAPD_CONF|g s|@config_gfarm_slapd_config_hook@|$SLAPD_CONF_HOOK|g s|@config_gfarm_slapd_database@|$SLAPD_DB|g s|@config_gfarm_slapd_bdb_cachesize@|$SLAPD_BDB_CACHESIZE|g s|@config_gfarm_slapd_bdb_ncache@|$SLAPD_BDB_NCACHE|g s|@config_gfarm_openldap_libexec@|$OPENLDAP_LIBEXEC|g s|@config_gfarm_openldap_etc@|$OPENLDAP_ETC|g _EOF_ } make_configuration_directory_ldap() { create_directory "$LDAP_CONF_DIR" } make_configuration_file_ldap() { mkcnf "$LDAP_SCHEMA" cat "$config_dir/gfarm.schema" ( umask 077 mkcnf "$INITIAL_LDIF" replace "$config_dir/initial.ldif.in" mkcnf "$SLAPD_CONF" replace "$SLAPD_CONF_IN" ) case $SLAPD_DB in bdb) mkcnf "$BACKEND_DATA_DIR/DB_CONFIG" \ replace "$config_dir/bdb.DB_CONFIG.in" if [ "$BACKEND_DATA_DIR" != "$BACKEND_LOG_DIR" ]; then echo "set_lg_dir $BACKEND_LOG_DIR" \ >> "$BACKEND_DATA_DIR/DB_CONFIG" mkdir "$BACKEND_LOG_DIR" chmod 700 "$BACKEND_LOG_DIR" [ -n "$BACKEND_PRIVILEGE" ] && chown "$BACKEND_PRIVILEGE" "$BACKEND_LOG_DIR" fi ;; esac # add initial data "${OPENLDAP_SLAPADD}" -f $SLAPD_CONF -l $INITIAL_LDIF && echo add initial metadata || ABORT "cannot add initial metadata" } apply_configuration_ldap() { : } service_start_ldap() { service_start_common ${1+"$@"} } service_stop_ldap() { service_ctl $RC_BACKEND_BASENAME stop ${1+"$@"} } gfarm-2.4.1/gftool/config-gfarm/config-gfarm-update.ldap0000644000000000000000000000144411507222717021631 0ustar rootrootupdate_usage_ldap() { return 1 # backend-specific option doesn't exist } update_postprocess_ldap() { : } update_first_set_param_ldap() { : } update_last_set_param_ldap() { : } update_sanity_ldap() { return 0 } update_ldap() { if ! cmp -s ${config_dir}/gfarm.schema ${LDAP_SCHEMA}; then echo "${PROGNAME}: copying new schema" if ${START_SERVICE}; then service_ctl gfmd stop service_ctl $RC_BACKEND_BASENAME stop fi cp ${config_dir}/gfarm.schema "${LDAP_SCHEMA}" # sync required at least in Linux sync; sync; sync if ${START_SERVICE}; then service_ctl $RC_BACKEND_BASENAME start service_ctl gfmd start else echo You need to restart $RC_BACKEND_BASENAME and gfmd fi fi } update_access_db_ldap() { echo >&2 "${PROGNAME}: ldap backend is not supported yet" } gfarm-2.4.1/gftool/config-gfarm/Makefile0000644000000000000000000000170111507222717016604 0ustar rootroot# $Id: Makefile 4393 2010-02-10 04:52:23Z n-soda $ top_builddir = ../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk SUBDIRS= sysdep/$(config_gfarm_sysdep_subdir) datadir=$(default_datadir)/gfarm/config PRIVATE_SRCS = $(PRIVATE_GFTOOL_CONFIG_GFARM_SRCS) SCRIPTS = config-gfarm config-gfarm-update config-gfsd \ $(srcdir)/gfarm.arch.guess \ $(optional_srcs) DATA = $(srcdir)/config-gfarm.postgresql \ $(srcdir)/config-gfarm.ldap \ $(srcdir)/config-gfarm-update.postgresql \ $(srcdir)/config-gfarm-update.ldap \ $(srcdir)/gfarm.conf-postgresql.in \ $(srcdir)/gfarm.conf-ldap.in \ $(srcdir)/gfarm.conf.in \ $(srcdir)/slapd.conf-2.0.in \ $(srcdir)/slapd.conf-2.1.in \ $(srcdir)/gfarm.sql \ $(srcdir)/gfarm-xmlattr.sql \ $(srcdir)/gfarm.schema \ $(srcdir)/initial.ldif.in \ $(srcdir)/bdb.DB_CONFIG.in include $(top_srcdir)/makes/script.mk include $(top_srcdir)/makes/data.mk include $(top_srcdir)/makes/subdir.mk gfarm-2.4.1/gftool/config-gfarm/config-gfarm.postgresql0000644000000000000000000003025411507222717021635 0ustar rootrootusage_postgresql() { echo >&2 " [-X]" return 0 # backend-specific option(s) exist(s) } sanity_postgresql() { rv=0 # case $SCHEMA_VERSION in # 1|2) :;; # *) echo "ERROR: schema version $SCHEMA_VERSION is not supported" >&2 # rv=1;; # esac case $BACKEND_VERSION in [1-6].*|7.[0-3]|unknown) # 7.3 or before echo "WARNING: PostgreSQL version 7.4 or later required: $BACKEND_VERSION" >&2 rv=1 ;; esac if [ ! -x "$BACKEND_PREFIX/bin/pg_config" ]; then echo "WARNING: command not found: pg_config" >&2 rv=1 fi if [ ! -x "$PGSQL_BINDIR/pg_ctl" ]; then echo "WARNING: command not found: pg_ctl" >&2 rv=1 fi if [ ! -x "$PGSQL_BINDIR/psql" ]; then echo "WARNING: command not found: psql" >&2 rv=1 fi return $rv } display_backend_params_postgresql() { display_backend_data_dir_param display_backend_log_dir_param # echo "postgresql schema version [-S]: $SCHEMA_VERSION" echo "postgresql admin user [-U]: $BACKEND_ADMIN_USER" echo "postgresql admin password [-W]: `if [ -r $admin_password ]; then cat $admin_password; else echo '(auto generated)'; fi`" echo "postgresql user [-u]: $BACKEND_USER" echo "postgresql password [-w]: `if [ -r $password ]; then cat $password; else echo '(auto generated)'; fi`" echo "postgresql prefix [-P]: $BACKEND_PREFIX" echo "postgresql version [-V]: $BACKEND_VERSION" echo "postgresql XML supported [-X]: $SUPPORT_XML_TYPE" } display_backend_port_params_postgresql() { echo "portmaster port [-p]: $BACKEND_PORT" } display_backend_optional_params_postgresql() { : } # $argshift is an output parameter, if this function returns success. parse_argument_postgresql() { case "$1" in # -S) [ $# -ge 2 ] || usage # SCHEMA_VERSION=$2 # argshift=1 # true;; -X) SUPPORT_XML_TYPE=yes argshift=0 true;; *) false;; esac } # # search default $BACKEND_PREFIX # set_default_backend_prefix_postgresql() { if [ -z "${BACKEND_PREFIX-}" ]; then OIFS=$IFS IFS=":" set $search_path IFS=$OIFS for d do if [ -x "$d/pg_config" ]; then BACKEND_PREFIX=`dirname "$d"` : ${PGSQL_BINDIR:=`$d/pg_config --bindir`} break fi done fi } # # default values # # NOTE: This needs to set $RC_BACKEND_BASENAME, at least. set_first_defaults_postgresql() { : ${RC_BACKEND_BASENAME=gfarm-pgsql} : ${PGSQL_BINDIR:="$BACKEND_PREFIX/bin"} : ${SUPPORT_XML_TYPE:="no"} } set_last_defaults_postgresql() { # : ${SCHEMA_VERSION:=2} : ${DB_NAME:="gfarm"} if [ -w / ]; then # is root? case `uname` in *BSD|DragonFly) : ${BACKEND_ADMIN_USER:="pgsql"};; *) : ${BACKEND_ADMIN_USER:="postgres"};; esac : ${BACKEND_PRIVILEGE:="$BACKEND_ADMIN_USER"} else : ${BACKEND_ADMIN_USER:="`whoami`"} : ${BACKEND_PRIVILEGE:=""} fi if [ -f /usr/bin/getent ]; then if getent passwd "$BACKEND_ADMIN_USER" >/dev/null; then : else ABORT "postgresql admin user '$$BACKEND_ADMIN_USER' doesn't exist" fi fi : ${BACKEND_USER:="gfarm"} # default PostgreSQL port number is 5432 : ${BACKEND_PORT:="10602"} : ${BACKEND_DATA_DIR:="$CONFIG_PREFIX/var/gfarm-pgsql"} BACKEND_LOG_DIR_DEFAULT="$BACKEND_DATA_DIR/pg_xlog" : ${BACKEND_LOG_DIR:="$BACKEND_LOG_DIR_DEFAULT"} if [ -z "${BACKEND_VERSION-}" ]; then if [ -x "$BACKEND_PREFIX/bin/pg_config" ]; then BACKEND_VERSION=`$BACKEND_PREFIX/bin/pg_config --version 2>&1 | sed -n 's/.*PostgreSQL.* \([0-9][0-9]*\.[0-9][0-9]*\).*/\1/p'` if [ -z "$BACKEND_VERSION" ] then BACKEND_VERSION="unknown" elif expr "$BACKEND_VERSION" : '[0-9][0-9]*\.[0-9][0-9]*' \ >/dev/null; then : else BACKEND_VERSION="unknown" fi else BACKEND_VERSION="unknown" fi fi case $BACKEND_VERSION in 7.*) # -w option makes "pg_ctl start" ask password on PostgreSQL-7.4 : ${PGSQL_OPTIONS:='-s -m fast -D $PGDATA -l $PGDATA/logfile'};; *) : ${PGSQL_OPTIONS:='-s -w -m fast -D $PGDATA -l $PGDATA/logfile'};; esac } # # do configuration # init_replace_postgresql() { init_replace_common cat <<_EOF_ s|@config_gfarm_database_name@|$DB_NAME|g s|@config_gfarm_pgsql_bindir@|$PGSQL_BINDIR|g s|@config_gfarm_pgsql_options@|$PGSQL_OPTIONS|g _EOF_ } make_configuration_directory_postgresql() { : } make_configuration_file_postgresql() { cat << _EOF_ | $run_with_backend_privilege || ABORT "initdb failed" $PGSQL_BINDIR/initdb -D "$BACKEND_DATA_DIR" --no-locale -E UTF-8 _EOF_ # record the password cp -p $admin_password $BACKEND_DATA_DIR/admin_password cp -p "$BACKEND_DATA_DIR"/postgresql.conf \ "$BACKEND_DATA_DIR"/postgresql.conf.org $awk ' /^[ ]*#*[ ]*listen_addresses[ ]*=/ { if (/^[ ]*listen_addresses/) { print "#" $0 } else { print $0 } if (!tcpip_socket_done && !listen_addresses_done) { print "listen_addresses = '"'*'"'" listen_addresses_done = 1 } next } /^[ ]*#*[ ]*tcpip_socket[ ]*=/ { if (/^[ ]*tcpip_socket/) { print "#" $0 } else { print $0 } if (!tcpip_socket_done && !listen_addresses_done) { print "tcpip_socket = true" tcpip_socket_done = 1 } next } /^[ ]*#*[ ]*port[ ]*=/ { if (/^[ ]*port/) { print "#" $0 } else { print $0 } if (!port_done) { print "port = '$BACKEND_PORT'" port_done = 1 } next } /^[ ]*#*[ ]*password_encryption[ ]*=/ { if (/^[ ]*password_encryption/) { print "#" $0 } else { print $0 } if (!password_encryption_done) { print "password_encryption = true" password_encryption_done = 1 } next } /^[ ]*#*[ ]*autovacuum[ ]*=/ { if (/^[ ]*autovacuum/) { print "#" $0 } else { print $0 } if (!autovacuum_done) { print "autovacuum = true" autovacuum_done = 1 } next } /^[ ]*#*[ ]*stats_row_level[ ]*=/ { if (/^[ ]*stats_row_level/) { print "#" $0 } else { print $0 } if (!stats_row_level_done) { print "stats_row_level = on" stats_row_level_done = 1 } next } {print} END { if (!listen_addresses_done && !tcpip_socket_done) print "listen_addresses = '"'*'"'" if (!port_done) print "port = '$BACKEND_PORT'" if (!password_encryption_done) print "password_encryption = true" # ignore autovacuum_done and stats_row_level_done for now. # PostgreSQL should be earlier than 8.0.X }' "$BACKEND_DATA_DIR"/postgresql.conf.org \ >"$BACKEND_DATA_DIR"/postgresql.conf cp -p "$BACKEND_DATA_DIR"/pg_hba.conf \ "$BACKEND_DATA_DIR"/pg_hba.conf.org ( # all comment out sed 's/^[0-9A-Za-z]/#&/' "$BACKEND_DATA_DIR"/pg_hba.conf.org echo "" echo "" echo "# TYPE DATABASE USER CIDR-ADDRESS METHOD" echo "" echo '# "local" is for Unix domain socket connections only' echo 'local all all md5' echo '# IPv4 local connections:' echo 'host all all 127.0.0.1/32 md5' echo '# IPv6 local connections:' echo '#host all all ::1/128 md5' echo "" echo "## The following should work, but actually doesn't with PostgreSQL-7.4" echo "#host $DB_NAME $BACKEND_USER 0.0.0.0/0 md5" echo "# TYPE DATABASE USER IP-ADDRESS IP-MASK METHOD" echo "host $DB_NAME $BACKEND_USER 0.0.0.0 0.0.0.0 md5" ) > "$BACKEND_DATA_DIR"/pg_hba.conf } apply_configuration_postgresql() { # backup configuration during temporary change cp -p "$BACKEND_DATA_DIR"/postgresql.conf \ "$BACKEND_DATA_DIR"/postgresql.conf.bak cp -p "$BACKEND_DATA_DIR"/pg_hba.conf \ "$BACKEND_DATA_DIR"/pg_hba.conf.bak # create temporary configuration files $awk ' /^[ ]*#*[ ]*listen_addresses[ ]*=/ { if (/^[ ]*listen_addresses/) { print "#" $0 } else { print $0 } if (!tcpip_socket_done && !listen_addresses_done) { # disable TCP access to be sure print "listen_addresses = '"''"'" listen_addresses_done = 1 } next } /^[ ]*#*[ ]*tcpip_socket[ ]*=/ { if (/^[ ]*tcpip_socket/) { print "#" $0 } else { print $0 } if (!tcpip_socket_done && !listen_addresses_done) { # disable TCP access to be sure print "tcpip_socket = false" tcpip_socket_done = 1 } next } /^[ ]*#*[ ]*unix_socket_directory[ ]*=/ { if (/^[ ]*unix_socket_directory/) { print "#" $0 } else { print $0 } if (!unix_socket_directory_done) { # prevent access except $BACKEND_ADMIN_USER print "unix_socket_directory = '"'$BACKEND_DATA_DIR'"'" unix_socket_directory_done = 1 } next } /^[ ]*#*[ ]*client_min_messages[ ]*=/ { if (/^[ ]*client_min_messages/) { print "#" $0 } else { print $0 } if (!client_min_messages_done) { # make "psql -f gfarm.sql" slient print "client_min_messages = '"'WARNING'"'" client_min_messages_done = 1 } next } {print} END { if (!tcpip_socket_done && !listen_addresses_done) print "listen_addresses = '"''"'" if (!unix_socket_directory_done) print "unix_socket_directory = '"'$BACKEND_DATA_DIR'"'" # ignore client_min_messages for now. # PostgreSQL should be earlier than 7.4 }' "$BACKEND_DATA_DIR"/postgresql.conf.bak \ >"$BACKEND_DATA_DIR"/postgresql.conf echo 'local all all trust' > "$BACKEND_DATA_DIR"/pg_hba.conf # We can't use rc.d script here, because "-w" option of pg_ctl doesn't # work, if unix_socket_directory is changed from default, at least on # PostgreSQL-8.0.3. # Also, we cannot use "restart" here, because it doesn't work either # at first invocation. cat << _EOF_ | $run_with_backend_privilege || ABORT "pg_ctl start failed" $PGSQL_BINDIR/pg_ctl -s -m fast \ -D $BACKEND_DATA_DIR -l $BACKEND_DATA_DIR/logfile start _EOF_ case "$BACKEND_VERSION" in [1-7].*|8.0) createuser_option=;; *) # Don't ask the following question on PostgreSQL 8.1 or later: # Shall the new role be allowed to create more new roles? (y/n) createuser_option=--no-createrole;; esac if [ "$SUPPORT_XML_TYPE" = "yes" ]; then XMLATTR_TABLENAME=", XmlAttr " else XMLATTR_TABLENAME="" fi cat << _EOF_ | $run_with_backend_privilege || ABORT "createdb failed" PGHOST="$BACKEND_DATA_DIR"; export PGHOST PGPORT="$BACKEND_PORT"; export PGPORT unset PGDATABASE PGUSER PGPASSWORD PGSERVICE unset PGREALM PGOPTIONS PGSSLMODE PGREQUIRESSL PGCONNECT_TIMEOUT unset LANG # wait for postmaster to start up iter=0 while ! $PGSQL_BINDIR/psql -l >/dev/null 2>&1 do iter=\`expr \$iter + 1\` if [ \$iter -gt 6 ]; then echo give up exit 1 fi echo wait 5 seconds for postmaster to start up sleep 5 done # -q option for createuser and createdb is obsolete in 8.4 $PGSQL_BINDIR/createuser $createuser_option -A -D $BACKEND_USER $PGSQL_BINDIR/createdb $DB_NAME # $PGSQL_BINDIR/psql -q \ # -f "$config_dir/gfarm.schema-$SCHEMA_VERSION.sql" $DB_NAME $PGSQL_BINDIR/psql -q \ -f "$config_dir/gfarm.sql" $DB_NAME if [ "$SUPPORT_XML_TYPE" = "yes" ]; then $PGSQL_BINDIR/psql -q \ -f "$config_dir/gfarm-xmlattr.sql" $DB_NAME fi $awk 'BEGIN { print "GRANT SELECT, INSERT, UPDATE, DELETE" print " ON Host, HostAliases, " print " GfarmUser, GfarmGroup, GfarmGroupAssignment, " print " INode, FileInfo, FileCopy, DeadFileCopy, DirEntry, " print " Symlink, QuotaUser, QuotaGroup, " print " XAttr $XMLATTR_TABLENAME" print " TO $BACKEND_USER;" # if ($SCHEMA_VERSION > 1) { # print "GRANT SELECT, UPDATE" # print " ON Host_hostid_seq, Path_pathid_seq" # print " TO $BACKEND_USER;" # } } FILENAME == "$admin_password" { print "ALTER USER $BACKEND_ADMIN_USER" printf " WITH ENCRYPTED PASSWORD '"'%s'"';\n", \$0 } FILENAME == "$password" { print "ALTER USER $BACKEND_USER" printf " WITH ENCRYPTED PASSWORD '"'%s'"';\n", \$0 }' $admin_password $password | $PGSQL_BINDIR/psql -q $DB_NAME _EOF_ service_ctl $RC_BACKEND_BASENAME stop # save configuration for administration mv "$BACKEND_DATA_DIR"/postgresql.conf \ "$BACKEND_DATA_DIR"/postgresql.conf.adm mv "$BACKEND_DATA_DIR"/pg_hba.conf \ "$BACKEND_DATA_DIR"/pg_hba.conf.adm # restore configuration mv "$BACKEND_DATA_DIR"/postgresql.conf.bak \ "$BACKEND_DATA_DIR"/postgresql.conf mv "$BACKEND_DATA_DIR"/pg_hba.conf.bak \ "$BACKEND_DATA_DIR"/pg_hba.conf if [ "$BACKEND_LOG_DIR" != "$BACKEND_LOG_DIR_DEFAULT" ]; then # if [ -n "$BACKEND_PRIVILEGE" ], `whoami` should be root, and # the following should preserve the owner of the directory. # otherwise $BACKEND_ADMIN_USER must be `whoami`. mv "$BACKEND_LOG_DIR_DEFAULT" "$BACKEND_LOG_DIR" ln -s "$BACKEND_LOG_DIR" "$BACKEND_LOG_DIR_DEFAULT" fi } service_start_postgresql() { service_start_common ${1+"$@"} } service_stop_postgresql() { service_ctl $RC_BACKEND_BASENAME stop ${1+"$@"} } gfarm-2.4.1/gftool/config-gfarm/gfarm.conf-ldap.in0000644000000000000000000000066011507222717020435 0ustar rootrootmetadb_server_host @config_gfarm_backend_hostname@ metadb_server_port @config_gfarm_gfmd_port@ ldap_server_host @config_gfarm_backend_hostname@ ldap_server_port @config_gfarm_backend_port@ ldap_base_dn "@config_gfarm_ldap_base_dn@" ldap_bind_dn "@config_gfarm_backend_user@" ldap_bind_password "@config_gfarm_backend_password@" admin_user @config_gfarm_metadata_admin_user@ auth enable @config_gfarm_auth_type@ * sockopt keepalive gfarm-2.4.1/gftool/config-gfarm/sysdep/0000755000000000000000000000000011507222730016447 5ustar rootrootgfarm-2.4.1/gftool/config-gfarm/sysdep/netbsd/0000755000000000000000000000000011507222730017726 5ustar rootrootgfarm-2.4.1/gftool/config-gfarm/sysdep/netbsd/config-gfarm.sysdep0000644000000000000000000000233311507222717023524 0ustar rootrootfq_hostname() { case `hostname` in *.*) hostname;; *) host "`hostname`" 2>/dev/null | awk 'NR==1 {print $1; exit}';; esac } # NOTE: need to set $FQ_HOSTNAME before invoking dns_domainname dns_domainname() { [ X"$FQ_HOSTNAME" = X ] && ABORT '$FQ_HOSTNAME is not set' echo "$FQ_HOSTNAME" | sed 's/^[^.]*\.//' } memory_size() { # bytes -> mega bytes sysctl -n hw.physmem | awk '{print int($NF/1024/1024)}' } number_of_cpus() { sysctl -n hw.ncpu } sysdep_defaults() { : ${RC_DIR:="$CONFIG_PREFIX/etc/rc.d"} } config_sysdep() { # no conversion cat ${1+"$@"} } mkcnf_gfmd_sysdep() { : # do nothing } mkcnf_gfsd_sysdep() { : # do nothing } service_add() { # local service service=$1 if [ -w / -a X"$CONFIG_PREFIX" = X ]; then create_directory "/etc/rc.conf.d" if echo "${service}=YES" | sed s/-/_/g >"/etc/rc.conf.d/$service" then echo created "/etc/rc.conf.d/$service" else ABORT "cannot add $service service" fi echo added "$service" service else echo add "$service" service: skipped fi } service_ctl() { # local service ctl mode service=$1 ctl=$2 if [ -w / -a X"$CONFIG_PREFIX" = X ]; then mode= else mode=force fi "$RC_DIR/$service" ${mode}$ctl || ABORT "cannot $ctl $service" } gfarm-2.4.1/gftool/config-gfarm/sysdep/netbsd/gfsd.in0000644000000000000000000000124411507222717021207 0ustar rootroot#!/bin/sh # # $NetBSD$ # # Gfarm filesystem node daemon # # PROVIDE: gfsd # REQUIRE: DAEMON if [ -f /etc/rc.subr ]; then . /etc/rc.subr fi CONF="@config_gfarm_gfarm_config@" OPTIONS="@config_gfarm_gfsd_option@" name="gfsd" FILE="@config_gfarm_gfsd_rc_name@" # usually "gfsd", or maybe "gfsd-IP_ADDRESS" rcvar=@config_gfarm_gfsd_rc_var@ command="@config_gfarm_prefix@/sbin/${name}" pidfile="@config_gfarm_run_dir@/${FILE}.pid" required_files="$CONF" # add more flags through ${${name}_flags} command_args="-P $pidfile $OPTIONS" if [ -f /etc/rc.subr ]; then load_rc_config ${FILE} run_rc_command "$1" else echo -n " ${FILE}" ${command} ${gfsd_flags} ${command_args} fi gfarm-2.4.1/gftool/config-gfarm/sysdep/netbsd/Makefile0000644000000000000000000000056111507222717021375 0ustar rootroot# $Id: Makefile 3856 2007-11-05 03:41:26Z tatebe $ top_builddir = ../../../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk datadir=$(default_datadir)/gfarm/config DATA = $(srcdir)/config-gfarm.sysdep \ $(srcdir)/gfarm-pgsql.in \ $(srcdir)/gfarm-slapd.in \ $(srcdir)/gfmd.in \ $(srcdir)/gfsd.in include $(top_srcdir)/makes/data.mk gfarm-2.4.1/gftool/config-gfarm/sysdep/netbsd/gfarm-slapd.in0000644000000000000000000000133511507222717022462 0ustar rootroot#!/bin/sh # # $NetBSD: slapd.sh,v 1.6 2004/07/24 03:32:24 jlam Exp $ # # OpenLDAP standalone LDAP daemon # # PROVIDE: gfarm-slapd # REQUIRE: DAEMON # KEYWORD: shutdown if [ -f /etc/rc.subr ]; then . /etc/rc.subr fi CONF="@config_gfarm_slapd_config@" PORT=@config_gfarm_backend_port@ FILE="gfarm-slapd" name="gfarm_slapd" rcvar=${name} command="@config_gfarm_openldap_libexec@/slapd" pidfile="@config_gfarm_run_dir@/${FILE}.pid" required_dirs="@config_gfarm_backend_data_dir@" required_files="$CONF" # add more flags through ${${name}_flags} command_args="-f $CONF -h ldap://:$PORT/" if [ -f /etc/rc.subr ]; then load_rc_config ${FILE} run_rc_command "$1" else echo -n " ${name}" ${command} ${slapd_flags} ${command_args} fi gfarm-2.4.1/gftool/config-gfarm/sysdep/netbsd/gfarm-pgsql.in0000644000000000000000000000273311507222717022510 0ustar rootroot#!/bin/sh # # $NetBSD: slapd.sh,v 1.6 2004/07/24 03:32:24 jlam Exp $ # # PostgreSQL database rc.d control script for gfarm # # PROVIDE: gfarm-pgsql # REQUIRE: DAEMON # KEYWORD: shutdown if [ -f /etc/rc.subr ]; then . /etc/rc.subr fi FILE="gfarm-pgsql" name="gfarm_pgsql" rcvar=${name} PGPORT="@config_gfarm_backend_port@" PGDATA="@config_gfarm_backend_data_dir@" command="@config_gfarm_pgsql_bindir@/pg_ctl" pidfile="$PGDATA/portmaster.pid" required_dirs="$PGDATA" # add more flags through ${${name}_flags} command_args="@config_gfarm_pgsql_options@" export PGPORT export PGDATA unset LANG PRIVILEGE="@config_gfarm_backend_privilege@" case $PRIVILEGE in '') RUN=/bin/sh;; *) # "su -" fails, because pkgsrc doesn't create the home directory. RUN="su $PRIVILEGE";; esac start_cmd="echo $command $command_args start | $RUN" restart_cmd="echo $command $command_args restart | $RUN" reload_cmd="echo $command $command_args reload | $RUN" stop_cmd="echo $command $command_args stop | $RUN" status_cmd="echo $command $command_args status | $RUN" if [ -f /etc/rc.subr -a -d /etc/rc.d -a -f /etc/rc.d/DAEMON ]; then load_rc_config ${FILE} run_rc_command "$1" else if [ -f /etc/rc.conf ]; then . /etc/rc.conf fi case $1 in forcestart|start) eval ${start_cmd};; forcerestart|restart) eval ${restart_cmd};; forcereload|reload) eval ${reload_cmd};; forcestop|stop) eval ${stop_cmd};; forcestatus|status) eval ${status_cmd};; *) echo "unknown command: $1" >&2 exit 1;; esac fi gfarm-2.4.1/gftool/config-gfarm/sysdep/netbsd/gfmd.in0000644000000000000000000000111411507222717021175 0ustar rootroot#!/bin/sh # # $NetBSD$ # # Gfarm filesystem metaserver # # PROVIDE: gfmd # REQUIRE: DAEMON if [ -f /etc/rc.subr ]; then . /etc/rc.subr fi CONF="@config_gfarm_gfmd_config@" OPTIONS="@config_gfarm_gfmd_option@" name="gfmd" FILE=${name} rcvar=${name} command="@config_gfarm_prefix@/sbin/${name}" pidfile="@config_gfarm_run_dir@/${FILE}.pid" required_files="$CONF" # add more flags through ${${name}_flags} command_args="-P $pidfile $OPTIONS" if [ -f /etc/rc.subr ]; then load_rc_config ${FILE} run_rc_command "$1" else echo -n " ${name}" ${command} ${gfmd_flags} ${command_args} fi gfarm-2.4.1/gftool/config-gfarm/sysdep/hpux/0000755000000000000000000000000011507222730017433 5ustar rootrootgfarm-2.4.1/gftool/config-gfarm/sysdep/hpux/config-gfarm.sysdep0000644000000000000000000000275211507222717023236 0ustar rootrootfq_hostname() { case `hostname` in *.*) hostname;; *) nslookup "`hostname`" 2>/dev/null | awk '/^Name:/ {print $2}';; esac } # NOTE: need to set $FQ_HOSTNAME before invoking dns_domainname dns_domainname() { [ X"$FQ_HOSTNAME" = X ] && ABORT '$FQ_HOSTNAME is not set' echo "$FQ_HOSTNAME" | sed 's/^[^.]*\.//' } memory_size() { # mega bytes getmemsize -mq # This is a command in gfarm. } number_of_cpus() { /etc/ioscan -k -C processor | grep processor | wc -l } sysdep_defaults() { : ${RC_DIR:="$CONFIG_PREFIX/sbin/init.d"} : ${RC_BASE_DIR:="/sbin"} } config_sysdep() { # no conversion cat ${1+"$@"} } mkcnf_gfmd_sysdep() { : # do nothing } mkcnf_gfsd_sysdep() { : # do nothing } service_add() { # local service levels start kill level d service=$1 if [ -w / -a X"$CONFIG_PREFIX" = X ]; then levels=`awk '/^# +chkconfig: +/{print $3}' $RC_DIR/$service | sed 's/./& /g'` start=`awk '/^# +chkconfig: +/{print $4}' $RC_DIR/$service` kill=`awk '/^# +chkconfig: +/{print $5}' $RC_DIR/$service` for level in $levels; do d="$RC_BASE_DIR/rc$level.d" [ -d $d ] || continue rm -f "$d/S${start}$service" "$d/K${kill}$service" ln -s "$RC_DIR/$service" "$d/S${start}$service" && ln -s "$RC_DIR/$service" "$d/K${kill}$service" || ABORT "cannot add $service to $d" done echo added "$service" service else echo add "$service" service: skipped fi } service_ctl() { # local service ctl service=$1 ctl=$2 "$RC_DIR/$service" $ctl || ABORT "cannot $ctl $service" } gfarm-2.4.1/gftool/config-gfarm/sysdep/hpux/getmemsize.c0000644000000000000000000000305311507222717021756 0ustar rootroot/* mem.c - To compile: cc +DAportable -o mem mem.c */ #include #include #include #include #include #include extern char *optarg; extern int optind, optopt; int main(int argc, char **argv) { struct pst_static pst; union pstun pu; int64_t memsize; int c, unit = 1, verbose = 1; char *unit_string = " bytes"; while ((c = getopt(argc, argv, "kmq")) != -1) { switch (c) { case 'k': unit = 1024; unit_string = " KB"; break; case 'm': unit = 1024 * 1024; unit_string = " MB"; break; case 'q': verbose = 0; break; /* i.e. quiet */ case '?': fprintf(stderr, "%s: unrecognized option: - %c\n", argv[0], optopt); return 1; } } pu.pst_static = &pst; if (pstat(PSTAT_STATIC, pu, sizeof(pst), (size_t)0, 0) == -1) { perror("pstat(PSTAT_GETSTATIC)"); exit(1); } memsize = pst.physical_memory; memsize *= pst.page_size; memsize /= unit; printf("%s%" PRId64 "%s\n", verbose ? "Physical RAM = " : "", memsize, verbose ? unit_string : ""); return 0; } /* * From: * comp.sys.hp.hpux FAQ * 8.32 How can I determine how much RAM my system has? * * Archive-name: hp/hpux-faq * Comp-sys-hpux-archive-name: hp/hpux-faq * Version: 11.23.0312.00 * Last-modified: 2003/12/30 * Maintainer: Ian P. Springer * URL: ftp://rtfm.mit.edu/pub/faqs/hp/hpux-faq * Revision-Frequency: monthly * Posting-Frequency: every 10 days * Disclaimer: Approval for *.answers is based on form, not content. * Copyright: (c)2001-2003 Ian P. Springer */ gfarm-2.4.1/gftool/config-gfarm/sysdep/hpux/Makefile0000644000000000000000000000111411507222717021075 0ustar rootroot# $Id: Makefile 3856 2007-11-05 03:41:26Z tatebe $ top_builddir = ../../../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk datadir=$(default_datadir)/gfarm/config DATA = $(srcdir)/config-gfarm.sysdep \ $(srcdir)/../default/gfarm-pgsql.in \ $(srcdir)/../default/gfarm-slapd.in \ $(srcdir)/../default/gfmd.in \ $(srcdir)/../default/gfsd.in PROGRAM = getmemsize SRCS = $(PROGRAM).c OBJS = $(PROGRAM).o CFLAGS = $(COMMON_CFLAGS) LDLIBS = $(COMMON_LDLIBS) $(LIBS) all: $(PROGRAM) include $(top_srcdir)/makes/prog.mk include $(top_srcdir)/makes/data.mk gfarm-2.4.1/gftool/config-gfarm/sysdep/solaris/0000755000000000000000000000000011507222730020123 5ustar rootrootgfarm-2.4.1/gftool/config-gfarm/sysdep/solaris/config-gfarm.sysdep0000644000000000000000000000304511507222717023722 0ustar rootrootfq_hostname() { case `hostname` in *.*) hostname;; *) nslookup "`hostname`" 2>/dev/null | awk '/^Name:/ {print $2}';; esac } # NOTE: need to set $FQ_HOSTNAME before invoking dns_domainname dns_domainname() { [ X"$FQ_HOSTNAME" = X ] && ABORT '$FQ_HOSTNAME is not set' echo "$FQ_HOSTNAME" | sed 's/^[^.]*\.//' } memory_size() { # mega bytes /usr/sbin/prtconf | awk '/^Memory size:/ { printf "%.0f\n", $3 }' } number_of_cpus() { LC_ALL=C /usr/sbin/psrinfo -v | awk '/Status of (virtual )?processor/ {n++} END {print n}' } sysdep_defaults() { : ${RC_DIR:="$CONFIG_PREFIX/etc/init.d"} : ${RC_BASE_DIR:="/etc"} } config_sysdep() { # no conversion cat ${1+"$@"} } mkcnf_gfmd_sysdep() { : # do nothing } mkcnf_gfsd_sysdep() { : # do nothing } service_add() { # local service levels start kill level d service=$1 if [ -w / -a X"$CONFIG_PREFIX" = X ]; then levels=`awk '/^# +chkconfig: +/{print $3}' $RC_DIR/$service | sed 's/./& /g'` start=`awk '/^# +chkconfig: +/{print $4}' $RC_DIR/$service` kill=`awk '/^# +chkconfig: +/{print $5}' $RC_DIR/$service` for level in $levels; do d="$RC_BASE_DIR/rc$level.d" [ -d $d ] || continue rm -f "$d/S${start}$service" "$d/K${kill}$service" ln -s "$RC_DIR/$service" "$d/S${start}$service" && ln -s "$RC_DIR/$service" "$d/K${kill}$service" || ABORT "cannot add $service to $d" done echo added "$service" service else echo add "$service" service: skipped fi } service_ctl() { # local service ctl service=$1 ctl=$2 "$RC_DIR/$service" $ctl || ABORT "cannot $ctl $service" } gfarm-2.4.1/gftool/config-gfarm/sysdep/solaris/Makefile0000644000000000000000000000063511507222717021574 0ustar rootroot# $Id: Makefile 3856 2007-11-05 03:41:26Z tatebe $ top_builddir = ../../../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk datadir=$(default_datadir)/gfarm/config DATA = $(srcdir)/config-gfarm.sysdep \ $(srcdir)/../default/gfarm-pgsql.in \ $(srcdir)/../default/gfarm-slapd.in \ $(srcdir)/../default/gfmd.in \ $(srcdir)/../default/gfsd.in include $(top_srcdir)/makes/data.mk gfarm-2.4.1/gftool/config-gfarm/sysdep/aix/0000755000000000000000000000000011507222730017230 5ustar rootrootgfarm-2.4.1/gftool/config-gfarm/sysdep/aix/config-gfarm.sysdep0000644000000000000000000000276711507222717023041 0ustar rootrootfq_hostname() { case `hostname` in *.*) hostname;; *) nslookup "`hostname`" 2>/dev/null | awk '/^Name:/ {print $2}';; esac } # NOTE: need to set $FQ_HOSTNAME before invoking dns_domainname dns_domainname() { [ X"$FQ_HOSTNAME" = X ] && ABORT '$FQ_HOSTNAME is not set' echo "$FQ_HOSTNAME" | sed 's/^[^.]*\.//' } memory_size() { # XXX assume 64MB echo 64 # XXX # lsattr -El sys0 -a realmem } number_of_cpus() { lsdev -C | grep Process | wc -l } sysdep_defaults() { # XXX not really confirmed : ${RC_DIR:="$CONFIG_PREFIX/sbin/init.d"} : ${RC_BASE_DIR:="/sbin"} } config_sysdep() { # no conversion cat ${1+"$@"} } mkcnf_gfmd_sysdep() { : # do nothing } mkcnf_gfsd_sysdep() { : # do nothing } service_add() { # local service levels start kill level d service=$1 if [ -w / -a X"$CONFIG_PREFIX" = X ]; then levels=`awk '/^# +chkconfig: +/{print $3}' $RC_DIR/$service | sed 's/./& /g'` start=`awk '/^# +chkconfig: +/{print $4}' $RC_DIR/$service` kill=`awk '/^# +chkconfig: +/{print $5}' $RC_DIR/$service` for level in $levels; do d="$RC_BASE_DIR/rc$level.d" [ -d $d ] || continue rm -f "$d/S${start}$service" "$d/K${kill}$service" ln -s "$RC_DIR/$service" "$d/S${start}$service" && ln -s "$RC_DIR/$service" "$d/K${kill}$service" || ABORT "cannot add $service to $d" done echo added "$service" service else echo add "$service" service: skipped fi } service_ctl() { # local service ctl service=$1 ctl=$2 "$RC_DIR/$service" $ctl || ABORT "cannot $ctl $service" } gfarm-2.4.1/gftool/config-gfarm/sysdep/aix/Makefile0000644000000000000000000000063511507222717020701 0ustar rootroot# $Id: Makefile 3856 2007-11-05 03:41:26Z tatebe $ top_builddir = ../../../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk datadir=$(default_datadir)/gfarm/config DATA = $(srcdir)/config-gfarm.sysdep \ $(srcdir)/../default/gfarm-pgsql.in \ $(srcdir)/../default/gfarm-slapd.in \ $(srcdir)/../default/gfmd.in \ $(srcdir)/../default/gfsd.in include $(top_srcdir)/makes/data.mk gfarm-2.4.1/gftool/config-gfarm/sysdep/freebsd/0000755000000000000000000000000011507222730020061 5ustar rootrootgfarm-2.4.1/gftool/config-gfarm/sysdep/freebsd/config-gfarm.sysdep0000644000000000000000000000246311507222717023663 0ustar rootrootfq_hostname() { case `hostname` in *.*) hostname;; *) host "`hostname`" 2>/dev/null | awk 'NR==1 {print $1; exit}';; esac } # NOTE: need to set $FQ_HOSTNAME before invoking dns_domainname dns_domainname() { [ X"$FQ_HOSTNAME" = X ] && ABORT '$FQ_HOSTNAME is not set' echo "$FQ_HOSTNAME" | sed 's/^[^.]*\.//' } memory_size() { # bytes -> mega bytes sysctl -n hw.physmem | awk '{print int($NF/1024/1024)}' } number_of_cpus() { sysctl -n hw.ncpu } sysdep_defaults() { if [ X"$CONFIG_PREFIX" = X ]; then : ${RC_DIR:="/usr/local/etc/rc.d"} fi : ${RC_DIR:="$CONFIG_PREFIX/etc/rc.d"} } config_sysdep() { # no conversion cat ${1+"$@"} } mkcnf_gfmd_sysdep() { : # do nothing } mkcnf_gfsd_sysdep() { : # do nothing } service_add() { # local service service=$1 if [ -w / -a X"$CONFIG_PREFIX" = X ]; then create_directory "/etc/rc.conf.d" if echo "${service}_enable=\"YES\"" | sed s/-/_/g >"/etc/rc.conf.d/$service" then echo created "/etc/rc.conf.d/$service" else ABORT "cannot add $service service" fi echo added "$service" service else echo add "$service" service: skipped fi } service_ctl() { # local service ctl mode service=$1 ctl=$2 if [ -w / -a X"$CONFIG_PREFIX" = X ]; then mode= else mode=force fi "$RC_DIR/$service" ${mode}$ctl || ABORT "cannot $ctl $service" } gfarm-2.4.1/gftool/config-gfarm/sysdep/freebsd/gfsd.in0000644000000000000000000000264311507222717021346 0ustar rootroot#!/bin/sh # # $FreeBSD$ # # PROVIDE: gfsd # REQUIRE: NETWORKING SERVERS # BEFORE: DAEMON # KEYWORD: FreeBSD shutdown # # Add the following lines to /etc/rc.conf to enable gfsd: # @config_gfarm_gfsd_rc_var@_enable (bool): Set to "NO" by default. # gfsd_flags (str): Set to "" by default. # Extra flags passed to start command # if [ -f /usr/local/etc/rc.subr ]; then . /usr/local/etc/rc.subr elif [ -f /etc/rc.subr ]; then . /etc/rc.subr else echo "$0: abort: rc.subr not found" exit 2 fi CONF="@config_gfarm_gfarm_config@" OPTIONS="@config_gfarm_gfsd_option@" name="gfsd" FILE="@config_gfarm_gfsd_rc_name@" # usually "gfsd", or maybe "gfsd-IP_ADDRESS" rcvar=`set_rcvar @config_gfarm_gfsd_rc_var@` command="@config_gfarm_prefix@/sbin/${name}" pidfile="@config_gfarm_run_dir@/${FILE}.pid" required_files="$CONF" # add more flags through ${${name}_flags} command_args="-P $pidfile $OPTIONS" globus_location="@config_gfarm_globus_location@" [ -z "$@config_gfarm_gfsd_rc_var@_enable" ] && @config_gfarm_gfsd_rc_var@_enable="NO" [ -z "$@config_gfarm_gfsd_rc_var@_flags" ] && @config_gfarm_gfsd_rc_var@_flags="" load_rc_config ${FILE} if [ -z "${GLOBUS_LOCATION-}" ] && [ -n "$globus_location" ] && [ -f "$globus_location/etc/globus-user-env.sh" ] then GLOBUS_LOCATION="$globus_location" export GLOBUS_LOCATION . "$GLOBUS_LOCATION/etc/globus-user-env.sh" fi run_rc_command "$1" gfarm-2.4.1/gftool/config-gfarm/sysdep/freebsd/Makefile0000644000000000000000000000056111507222717021530 0ustar rootroot# $Id: Makefile 3856 2007-11-05 03:41:26Z tatebe $ top_builddir = ../../../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk datadir=$(default_datadir)/gfarm/config DATA = $(srcdir)/config-gfarm.sysdep \ $(srcdir)/gfarm-pgsql.in \ $(srcdir)/gfarm-slapd.in \ $(srcdir)/gfmd.in \ $(srcdir)/gfsd.in include $(top_srcdir)/makes/data.mk gfarm-2.4.1/gftool/config-gfarm/sysdep/freebsd/gfarm-slapd.in0000644000000000000000000000225011507222717022612 0ustar rootroot#!/bin/sh # # $FreeBSD: ports/net/openldap22-server/files/slapd.sh,v 1.14 2004/08/15 18:18:46 eik Exp $ # # PROVIDE: gfarm-slapd # REQUIRE: NETWORKING SERVERS # BEFORE: securelevel # KEYWORD: FreeBSD shutdown # # Add the following lines to /etc/rc.conf to enable gfarm-slapd: # #gfarm_slapd_enable="YES" #gfarm_slapd_flags='' # # See slapd(8) for more flags # if [ -f /usr/local/etc/rc.subr ]; then . /usr/local/etc/rc.subr elif [ -f /etc/rc.subr ]; then . /etc/rc.subr else echo "$0: abort: rc.subr not found" exit 2 fi CONF="@config_gfarm_slapd_config@" PORT=@config_gfarm_backend_port@ FILE="gfarm-slapd" name="gfarm_slapd" rcvar=`set_rcvar` command="@config_gfarm_openldap_libexec@/slapd" pidfile="@config_gfarm_run_dir@/${FILE}.pid" required_dirs="@config_gfarm_backend_data_dir@" required_files="$CONF" # add more flags through ${${name}_flags} command_args="-f $CONF -h ldap://:$PORT/" # read settings, set defaults load_rc_config ${FILE} : ${gfarm_slapd_enable="NO"} if [ -n "${gfarm_slapd_args+set}" ]; then warn "gfarm_slapd_args is deprecated, use gfarm_slapd_flags" : ${gfarm_slapd_flags="$gfarm_slapd_args"} else : ${gfarm_slapd_flags=""} fi run_rc_command "$1" gfarm-2.4.1/gftool/config-gfarm/sysdep/freebsd/gfarm-pgsql.in0000644000000000000000000000304011507222717022633 0ustar rootroot#!/bin/sh # # $FreeBSD: ports/net/openldap22-server/files/slapd.sh,v 1.14 2004/08/15 18:18:46 eik Exp $ # # PROVIDE: gfarm-pgsql # REQUIRE: NETWORKING SERVERS # BEFORE: securelevel # KEYWORD: FreeBSD shutdown # # Add the following lines to /etc/rc.conf to enable gfarm-slapd: # #gfarm_pgsql_enable="YES" #gfarm_pgsql_flags='' # # See pgsql(8) for more flags # if [ -f /usr/local/etc/rc.subr ]; then . /usr/local/etc/rc.subr elif [ -f /etc/rc.subr ]; then . /etc/rc.subr else echo "$0: abort: rc.subr not found" exit 2 fi FILE="gfarm-pgsql" name="gfarm_pgsql" rcvar=`set_rcvar` PGPORT="@config_gfarm_backend_port@" PGDATA="@config_gfarm_backend_data_dir@" command="@config_gfarm_pgsql_bindir@/pg_ctl" pidfile="$PGDATA/portmaster.pid" required_dirs="$PGDATA" # add more flags through ${${name}_flags} command_args="@config_gfarm_pgsql_options@" export PGPORT export PGDATA unset LANG PRIVILEGE="@config_gfarm_backend_privilege@" case $PRIVILEGE in '') RUN=/bin/sh;; *) RUN="su - $PRIVILEGE";; esac start_cmd="echo $command $command_args start | $RUN" restart_cmd="echo $command $command_args restart | $RUN" reload_cmd="echo $command $command_args reload | $RUN" stop_cmd="echo $command $command_args stop | $RUN" status_cmd="echo $command $command_args status | $RUN" # read settings, set defaults load_rc_config ${FILE} : ${gfarm_pgsql_enable="NO"} if [ -n "${gfarm_pgsql_args+set}" ]; then warn "gfarm_pgsql_args is deprecated, use gfarm_pgsql_flags" : ${gfarm_pgsql_flags="$gfarm_pgsql_args"} else : ${gfarm_pgsql_flags=""} fi run_rc_command "$1" gfarm-2.4.1/gftool/config-gfarm/sysdep/freebsd/gfmd.in0000644000000000000000000000232611507222717021336 0ustar rootroot#!/bin/sh # # $FreeBSD$ # # PROVIDE: gfmd # REQUIRE: NETWORKING SERVERS # BEFORE: DAEMON # KEYWORD: FreeBSD shutdown # # Add the following lines to /etc/rc.conf to enable gfmd: # gfmd_enable (bool): Set to "NO" by default. # gfmd_flags (str): Set to "" by default. # Extra flags passed to start command # if [ -f /usr/local/etc/rc.subr ]; then . /usr/local/etc/rc.subr elif [ -f /etc/rc.subr ]; then . /etc/rc.subr else echo "$0: abort: rc.subr not found" exit 2 fi CONF="@config_gfarm_gfmd_config@" OPTIONS="@config_gfarm_gfmd_option@" name="gfmd" FILE=${name} rcvar=`set_rcvar` command="@config_gfarm_prefix@/sbin/${name}" pidfile="@config_gfarm_run_dir@/${FILE}.pid" required_files="$CONF" # add more flags through ${${name}_flags} command_args="-P $pidfile $OPTIONS" globus_location="@config_gfarm_globus_location@" [ -z "$gfmd_enable" ] && gfmd_enable="NO" [ -z "$gfmd_flags" ] && gfmd_flags="" load_rc_config ${FILE} if [ -z "${GLOBUS_LOCATION-}" ] && [ -n "$globus_location" ] && [ -f "$globus_location/etc/globus-user-env.sh" ] then GLOBUS_LOCATION="$globus_location" export GLOBUS_LOCATION . "$GLOBUS_LOCATION/etc/globus-user-env.sh" fi run_rc_command "$1" gfarm-2.4.1/gftool/config-gfarm/sysdep/osf1/0000755000000000000000000000000011507222730017317 5ustar rootrootgfarm-2.4.1/gftool/config-gfarm/sysdep/osf1/config-gfarm.sysdep0000644000000000000000000000274011507222717023117 0ustar rootrootfq_hostname() { case `hostname` in *.*) hostname;; *) nslookup "`hostname`" 2>/dev/null | awk '/^Name:/ {print $2}';; esac } # NOTE: need to set $FQ_HOSTNAME before invoking dns_domainname dns_domainname() { [ X"$FQ_HOSTNAME" = X ] && ABORT '$FQ_HOSTNAME is not set' echo "$FQ_HOSTNAME" | sed 's/^[^.]*\.//' } memory_size() { # mega bytes vmstat -P | awk '/^Total Physical Memory = / {printf "%.0f\n", $5 }' } number_of_cpus() { /usr/sbin/sizer -p } sysdep_defaults() { : ${RC_DIR:="$CONFIG_PREFIX/sbin/init.d"} : ${RC_BASE_DIR:="/sbin"} } config_sysdep() { # no conversion cat ${1+"$@"} } mkcnf_gfmd_sysdep() { : # do nothing } mkcnf_gfsd_sysdep() { : # do nothing } service_add() { # local service levels start kill level d service=$1 if [ -w / -a X"$CONFIG_PREFIX" = X ]; then levels=`awk '/^# +chkconfig: +/{print $3}' $RC_DIR/$service | sed 's/./& /g'` start=`awk '/^# +chkconfig: +/{print $4}' $RC_DIR/$service` kill=`awk '/^# +chkconfig: +/{print $5}' $RC_DIR/$service` for level in $levels; do d="$RC_BASE_DIR/rc$level.d" [ -d $d ] || continue rm -f "$d/S${start}$service" "$d/K${kill}$service" ln -s "$RC_DIR/$service" "$d/S${start}$service" && ln -s "$RC_DIR/$service" "$d/K${kill}$service" || ABORT "cannot add $service to $d" done echo added "$service" service else echo add "$service" service: skipped fi } service_ctl() { # local service ctl service=$1 ctl=$2 "$RC_DIR/$service" $ctl || ABORT "cannot $ctl $service" } gfarm-2.4.1/gftool/config-gfarm/sysdep/osf1/Makefile0000644000000000000000000000063511507222717020770 0ustar rootroot# $Id: Makefile 3856 2007-11-05 03:41:26Z tatebe $ top_builddir = ../../../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk datadir=$(default_datadir)/gfarm/config DATA = $(srcdir)/config-gfarm.sysdep \ $(srcdir)/../default/gfarm-pgsql.in \ $(srcdir)/../default/gfarm-slapd.in \ $(srcdir)/../default/gfmd.in \ $(srcdir)/../default/gfsd.in include $(top_srcdir)/makes/data.mk gfarm-2.4.1/gftool/config-gfarm/sysdep/default/0000755000000000000000000000000011507222730020073 5ustar rootrootgfarm-2.4.1/gftool/config-gfarm/sysdep/default/config-gfarm.sysdep0000644000000000000000000000272011507222717023671 0ustar rootrootfq_hostname() { case `hostname` in *.*) hostname;; *) nslookup "`hostname`" 2>/dev/null | awk '/^Name:/ {print $2}';; esac } # NOTE: need to set $FQ_HOSTNAME before invoking dns_domainname dns_domainname() { [ X"$FQ_HOSTNAME" = X ] && ABORT '$FQ_HOSTNAME is not set' echo "$FQ_HOSTNAME" | sed 's/^[^.]*\.//' } memory_size() { # XXX assume 64MB echo 64 } number_of_cpus() { # XXX assume UniProcessor echo 1 } sysdep_defaults() { # XXX we only assume this : ${RC_DIR:="$CONFIG_PREFIX/etc/init.d"} : ${RC_BASE_DIR:="/etc"} } config_sysdep() { # no conversion cat ${1+"$@"} } mkcnf_gfmd_sysdep() { : # do nothing } mkcnf_gfsd_sysdep() { : # do nothing } service_add() { # local service levels start kill level d service=$1 if [ -w / -a X"$CONFIG_PREFIX" = X ]; then levels=`awk '/^# +chkconfig: +/{print $3}' $RC_DIR/$service | sed 's/./& /g'` start=`awk '/^# +chkconfig: +/{print $4}' $RC_DIR/$service` kill=`awk '/^# +chkconfig: +/{print $5}' $RC_DIR/$service` for level in $levels; do d="$RC_BASE_DIR/rc$level.d" [ -d $d ] || continue rm -f "$d/S${start}$service" "$d/K${kill}$service" ln -s "$RC_DIR/$service" "$d/S${start}$service" && ln -s "$RC_DIR/$service" "$d/K${kill}$service" || ABORT "cannot add $service to $d" done echo added "$service" service else echo add "$service" service: skipped fi } service_ctl() { # local service ctl service=$1 ctl=$2 "$RC_DIR/$service" $ctl || ABORT "cannot $ctl $service" } gfarm-2.4.1/gftool/config-gfarm/sysdep/default/gfsd.in0000644000000000000000000000400711507222717021354 0ustar rootroot#!/bin/sh # # $Id: gfsd.in 3617 2007-03-12 08:32:55Z n-soda $ # ## For RedHat Linux style rc.d, and start_service() in config-gfarm.sysdep # chkconfig: 2345 95 05 # ## For RedHat Linux style rc.d # description: Gfarm filesystem node daemon # processname: gfsd # config: @config_gfarm_gfarm_config@ # pidfile: @config_gfarm_run_dir@/@config_gfarm_gfsd_rc_name@.pid # ## For SuSE/United-Linux style rc.d ### BEGIN INIT INFO # Provides: @config_gfarm_gfsd_rc_name@ # Required-Start: $network $syslog # Required-Stop: $network $syslog # Default-Start: 3 5 # Default-Stop: 0 1 2 6 # Description: Gfarm filesystem node daemon ### END INIT INFO PROG="gfsd" FILE="@config_gfarm_gfsd_rc_name@" # usually "gfsd", or maybe "gfsd-IP_ADDRESS" CONF="@config_gfarm_gfarm_config@" DAEMON="@config_gfarm_prefix@/sbin/$PROG" PIDFILE="@config_gfarm_run_dir@/${FILE}.pid" OPTIONS="@config_gfarm_gfsd_option@" globus_location="@config_gfarm_globus_location@" if [ -z "${GLOBUS_LOCATION-}" ] && [ -n "$globus_location" ] && [ -f "$globus_location/etc/globus-user-env.sh" ] then GLOBUS_LOCATION="$globus_location" export GLOBUS_LOCATION . "$GLOBUS_LOCATION/etc/globus-user-env.sh" fi case $1 in start) if [ ! -x "$DAEMON" ]; then echo -n "$DAEMON is not installed" exit 1 fi if [ ! -f "$CONF" ]; then echo -n "$CONF is not configured" exit 1 fi $DAEMON -P "$PIDFILE" $OPTIONS ;; stop) if [ -f "$PIDFILE" ] && kill -TERM `cat "$PIDFILE"`; then rm -f "$PIDFILE" elif [ -f "$PIDFILE" ]; then echo "$FILE (pid" `cat "$PIDFILE"`") is not running? (check $PIDFILE)" exit 1 else echo "$FILE is already stopped (no $PIDFILE)" exit 1 fi ;; restart) $0 stop $0 start ;; status) if [ -f "$PIDFILE" ] && kill -0 `cat "$PIDFILE"`; then echo "$FILE (pid" `cat "$PIDFILE"`") is running" elif [ -f "$PIDFILE" ]; then echo "$FILE (pid" `cat "$PIDFILE"`") is not running? (check $PIDFILE)" exit 1 else echo "$FILE is stopped (no $PIDFILE)" exit 1 fi ;; *) echo "Usage: $0 { start | stop | restart | status }" exit 1 ;; esac exit 0 gfarm-2.4.1/gftool/config-gfarm/sysdep/default/Makefile0000644000000000000000000000061211507222717021537 0ustar rootroot# $Id: Makefile 3856 2007-11-05 03:41:26Z tatebe $ top_builddir = ../../../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk datadir=$(default_datadir)/gfarm/config/linux/default DATA = $(srcdir)/../default/gfarm-pgsql.in \ $(srcdir)/../default/gfarm-slapd.in \ $(srcdir)/../default/gfmd.in \ $(srcdir)/../default/gfsd.in include $(top_srcdir)/makes/data.mk gfarm-2.4.1/gftool/config-gfarm/sysdep/default/gfarm-slapd.in0000644000000000000000000000322311507222717022625 0ustar rootroot#!/bin/sh # # $Id: gfarm-slapd.in 2604 2006-05-18 08:56:35Z soda $ # ## For RedHat Linux style rc.d, and start_service() in config-gfarm.sysdep # chkconfig: 2345 85 15 # ## For RedHat Linux style rc.d # description: LDAP slapd for Gfarm # processname: slapd # config: @config_gfarm_slapd_config@ # pidfile: @config_gfarm_run_dir@/gfarm-slapd.pid # ## For SuSE/United-Linux style rc.d ### BEGIN INIT INFO # Provides: gfarm-slapd # Required-Start: $network $syslog # Required-Stop: $network $syslog # Default-Start: 3 5 # Default-Stop: 0 1 2 6 # Description: LDAP slapd for Gfarm ### END INIT INFO PROG="slapd" FILE="gfarm-slapd" CONF="@config_gfarm_slapd_config@" PORT=@config_gfarm_backend_port@ DAEMON="@config_gfarm_openldap_libexec@/$PROG" PIDFILE="@config_gfarm_run_dir@/${FILE}.pid" case $1 in start) if [ ! -x "$DAEMON" ]; then echo -n "$DAEMON is not installed" exit 1 fi if [ ! -f "$CONF" ]; then echo -n "$CONF is not configured" exit 1 fi $DAEMON -f "$CONF" -h "ldap://:$PORT/" ;; stop) if [ -f "$PIDFILE" ] && kill -TERM `cat "$PIDFILE"`; then rm -f "$PIDFILE" elif [ -f "$PIDFILE" ]; then echo "$FILE (pid" `cat "$PIDFILE"`") is not running? (check $PIDFILE)" exit 1 else echo "$FILE is already stopped (no $PIDFILE)" exit 1 fi ;; restart) $0 stop $0 start ;; status) if [ -f "$PIDFILE" ] && kill -0 `cat "$PIDFILE"`; then echo "$FILE (pid" `cat "$PIDFILE"`") is running" elif [ -f "$PIDFILE" ]; then echo "$FILE (pid" `cat "$PIDFILE"`") is not running? (check $PIDFILE)" exit 1 else echo "$FILE is stopped (no $PIDFILE)" exit 1 fi ;; *) echo "Usage: $0 { start | stop | restart | status }" exit 1 ;; esac exit 0 gfarm-2.4.1/gftool/config-gfarm/sysdep/default/gfarm-pgsql.in0000644000000000000000000000245111507222717022652 0ustar rootroot#!/bin/sh # # $Id: gfarm-pgsql.in 3880 2007-12-04 15:44:05Z tatebe $ # ## For RedHat Linux style rc.d, and start_service() in config-gfarm.sysdep # chkconfig: 2345 85 15 # ## For RedHat Linux style rc.d # description: PostgreSQL daemon for Gfarm # processname: postmaster # pidfile: @config_gfarm_backend_data_dir@/postmaster.pid # ## For SuSE/United-Linux style rc.d ### BEGIN INIT INFO # Provides: gfarm-pgsql # Required-Start: $network $syslog # Required-Stop: $network $syslog # Default-Start: 3 5 # Default-Stop: 0 1 2 6 # Description: PostgreSQL daemon for Gfarm ### END INIT INFO FILE="gfarm-pgsql" PGPORT="@config_gfarm_backend_port@" PGDATA="@config_gfarm_backend_data_dir@" CTL="@config_gfarm_pgsql_bindir@/pg_ctl" OPTIONS="@config_gfarm_pgsql_options@" PRIVILEGE="@config_gfarm_backend_privilege@" case $PRIVILEGE in '') RUN=/bin/sh;; *) # We don't use "su -" here, # because it makes Solaris and HP-UX display /etc/motd. RUN="su $PRIVILEGE";; esac export PGPORT export PGDATA unset LANG case $1 in start) if [ ! -x "$CTL" ]; then echo -n "$CTL is not installed" exit 1 fi $RUN -c "$CTL $OPTIONS start" ;; stop) $RUN -c "$CTL $OPTIONS stop" ;; status|restart|reload) $RUN -c "$CTL $OPTIONS $1" ;; *) echo "Usage: $0 { start | stop | restart | status | reload }" exit 1 ;; esac exit 0 gfarm-2.4.1/gftool/config-gfarm/sysdep/default/gfmd.in0000644000000000000000000000361611507222717021353 0ustar rootroot#!/bin/sh # # $Id: gfmd.in 2612 2006-05-29 04:24:37Z soda $ # ## For RedHat Linux style rc.d, and start_service() in config-gfarm.sysdep # chkconfig: 2345 90 10 # ## For RedHat Linux style rc.d # description: Gfarm filesystem metaserver # processname: gfmd # config: @config_gfarm_gfmd_config@ # pidfile: @config_gfarm_run_dir@/gfmd.pid # ## For SuSE/United-Linux style rc.d ### BEGIN INIT INFO # Provides: gfmd # Required-Start: $network $syslog # Required-Stop: $network $syslog # Default-Start: 3 5 # Default-Stop: 0 1 2 6 # Description: Gfarm filesystem metaserver ### END INIT INFO PROG="gfmd" FILE=$PROG CONF="@config_gfarm_gfmd_config@" DAEMON="@config_gfarm_prefix@/sbin/$PROG" PIDFILE="@config_gfarm_run_dir@/${FILE}.pid" OPTIONS="@config_gfarm_gfmd_option@" globus_location="@config_gfarm_globus_location@" if [ -z "${GLOBUS_LOCATION-}" ] && [ -n "$globus_location" ] && [ -f "$globus_location/etc/globus-user-env.sh" ] then GLOBUS_LOCATION="$globus_location" export GLOBUS_LOCATION . "$GLOBUS_LOCATION/etc/globus-user-env.sh" fi case $1 in start) if [ ! -x "$DAEMON" ]; then echo -n "$DAEMON is not installed" exit 1 fi if [ ! -f "$CONF" ]; then echo -n "$CONF is not configured" exit 1 fi $DAEMON -P "$PIDFILE" $OPTIONS ;; stop) if [ -f "$PIDFILE" ] && kill -TERM `cat "$PIDFILE"`; then rm -f "$PIDFILE" elif [ -f "$PIDFILE" ]; then echo "$FILE (pid" `cat "$PIDFILE"`") is not running? (check $PIDFILE)" exit 1 else echo "$FILE is already stopped (no $PIDFILE)" exit 1 fi ;; restart) $0 stop $0 start ;; status) if [ -f "$PIDFILE" ] && kill -0 `cat "$PIDFILE"`; then echo "$FILE (pid" `cat "$PIDFILE"`") is running" elif [ -f "$PIDFILE" ]; then echo "$FILE (pid" `cat "$PIDFILE"`") is not running? (check $PIDFILE)" exit 1 else echo "$FILE is stopped (no $PIDFILE)" exit 1 fi ;; *) echo "Usage: $0 { start | stop | restart | status }" exit 1 ;; esac exit 0 gfarm-2.4.1/gftool/config-gfarm/sysdep/linux/0000755000000000000000000000000011507222730017606 5ustar rootrootgfarm-2.4.1/gftool/config-gfarm/sysdep/linux/config-gfarm.sysdep0000644000000000000000000001002311507222717023377 0ustar rootrootfq_hostname() { hostname -f } dns_domainname() { dnsdomainname } memory_size() { # kilo bytes -> mega bytes awk '$1 == "MemTotal:" {print int($2/1024)}' /proc/meminfo } number_of_cpus() { grep "^processor" /proc/cpuinfo | wc | awk '{ print $1 }' } set_linux_rc_type() { if [ -n "${LINUX_RC_TYPE-}" ]; then return fi # if [ -x /sbin/rc-update ] || [ -x /usr/sbin/rc-update ]; then # LINUX_RC_TYPE=gentoo; return if [ -x /sbin/update-rc.d -o -x /usr/sbin/update-rc.d ]; then LINUX_RC_TYPE=debian; return elif [ -x /sbin/chkconfig -o -x /usr/sbin/chkconfig ] && [ -x /sbin/service -o -x /usr/sbin/service ] && [ -f /etc/rc.d/init.d/functions ]; then LINUX_RC_TYPE=redhat elif [ -x /sbin/chkconfig -o -x /usr/sbin/chkconfig ] && [ -f /etc/rc.status ]; then LINUX_RC_TYPE=suse else LINUX_RC_TYPE=default fi } sysdep_defaults() { set_linux_rc_type # Actual pathname may be /etc/rc.d/init.d on RedHat and derived, # but there is always symbolic link from /etc/init.d to there. : ${RC_DIR:="$CONFIG_PREFIX/etc/init.d"} : ${SLAPD_BDB_NCACHE:="1"} # 0/1: contiguous memory case $LINUX_RC_TYPE in debian) if [ -f /etc/ldap/schema/core.schema ]; then : ${OPENLDAP_ETC:=/etc/ldap} fi ;; redhat) : ${RC_LOCK_DIR:="$CONFIG_PREFIX/var/lock/subsys"} ;; esac : ${RC_BACKEND_IN="$config_dir/linux/$LINUX_RC_TYPE/$RC_BACKEND_BASENAME.in"} : ${RC_GFMD_IN="$config_dir/linux/$LINUX_RC_TYPE/gfmd.in"} : ${RC_AGENT_IN="$config_dir/linux/$LINUX_RC_TYPE/gfarm_agent.in"} : ${RC_GFSD_IN="$config_dir/linux/$LINUX_RC_TYPE/gfsd.in"} if [ ! -f "$RC_BACKEND_IN" ]; then RC_BACKEND_IN="$config_dir/linux/default/$RC_BACKEND_BASENAME.in" fi if [ ! -f "$RC_GFMD_IN" ]; then RC_GFMD_IN="$config_dir/linux/default/gfmd.in" fi if [ ! -f "$RC_AGENT_IN" ]; then RC_AGENT_IN="$config_dir/linux/default/gfarm_agent.in" fi if [ ! -f "$RC_GFSD_IN" ]; then RC_GFSD_IN="$config_dir/linux/default/gfsd.in" fi } config_sysdep() { case $LINUX_RC_TYPE in redhat) sed -e "s|@config_gfarm_lock_dir@|$RC_LOCK_DIR|" ${1+"$@"} ;; *) # no conversion cat ${1+"$@"} ;; esac } mkcnf_gfarm_sysdep() { case $LINUX_RC_TYPE in redhat) create_directory "${RC_LOCK_DIR}" ;; esac } mkcnf_gfmd_sysdep() { mkcnf_gfarm_sysdep } mkcnf_gfsd_sysdep() { mkcnf_gfarm_sysdep } service_add_debian() { # local service service=$1 if [ -w / -a X"$CONFIG_PREFIX" = X ]; then update-rc.d $service defaults >/dev/null || ABORT "cannot add "$service" service" echo added "$service" service else echo add "$service" service: skipped fi } service_add_by_chkconfig() { # local service service=$1 if [ -w / -a X"$CONFIG_PREFIX" = X ]; then chkconfig "$service" --add || ABORT "cannot add $service service" echo added "$service" service else echo add "$service" service: skipped fi } service_add_default() { # local service service=$1 if [ -w / -a X"$CONFIG_PREFIX" = X ]; then echo how to add "$service" service is unknown: skipped else echo add "$service" service: skipped fi } service_ctl_debian() { # local service ctl service=$1 ctl=$2 shift 2 if [ -w / -a X"$CONFIG_PREFIX" = X \ -a -x "`which invoke-rc.d 2>/dev/null`" ]; then invoke-rc.d $service $ctl ${1+"$@"} else "$RC_DIR/$service" $ctl ${1+"$@"} fi || ABORT "cannot $ctl $service $@" } service_ctl_redhat() { # local service ctl service=$1 ctl=$2 shift 2 if [ -w / -a X"$CONFIG_PREFIX" = X ]; then service "$service" $ctl ${1+"$@"} else "$RC_DIR/$service" $ctl ${1+"$@"} fi || ABORT "cannot $ctl $service $@" } service_ctl_default() { # local service ctl service=$1 ctl=$2 shift 2 "$RC_DIR/$service" $ctl ${1+"$@"} || ABORT "cannot $ctl $service $@" } service_add() { case $LINUX_RC_TYPE in debian) service_add_debian $1;; redhat) service_add_by_chkconfig $1;; suse) service_add_by_chkconfig $1;; *) service_add_default $1;; esac } service_ctl() { case $LINUX_RC_TYPE in debian) service_ctl_debian ${1+"$@"};; redhat) service_ctl_redhat ${1+"$@"};; suse) service_ctl_default ${1+"$@"};; *) service_ctl_default ${1+"$@"};; esac } gfarm-2.4.1/gftool/config-gfarm/sysdep/linux/debian/0000755000000000000000000000000011507222730021030 5ustar rootrootgfarm-2.4.1/gftool/config-gfarm/sysdep/linux/debian/gfsd.in0000644000000000000000000000155411507222717022315 0ustar rootroot#! /bin/bash # # @config_gfarm_gfsd_rc_name@ Start the gfsd server. # PATH=/sbin:/bin:/usr/sbin:/usr/bin NAME=gfsd FILE="@config_gfarm_gfsd_rc_name@" # usually "gfsd", or maybe "gfsd-IP_ADDRESS" DAEMON="@config_gfarm_prefix@/sbin/$NAME" PIDFILE="@config_gfarm_run_dir@/$FILE.pid" CONF="@config_gfarm_gfarm_config@" OPTIONS="@config_gfarm_gfsd_option@" trap "" 1 export LANG=C export PATH test -f $DAEMON || exit 0 test -f $CONF || exit 0 case "$1" in start) echo -n "Starting gfarm server: $FILE" start-stop-daemon --quiet --start \ --pidfile $PIDFILE --exec $DAEMON -- -P $PIDFILE $OPTIONS echo "." ;; stop) echo -n "Stopping gfarm server: $FILE" start-stop-daemon --stop --quiet --pidfile $PIDFILE --exec $DAEMON echo "." ;; restart|force-reload) $0 stop $0 start ;; *) echo "Usage: $0 {start|stop|restart}" exit 1 ;; esac exit 0 gfarm-2.4.1/gftool/config-gfarm/sysdep/linux/debian/Makefile0000644000000000000000000000054011507222717022474 0ustar rootroot# $Id: Makefile 3856 2007-11-05 03:41:26Z tatebe $ top_builddir = ../../../../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk datadir=$(default_datadir)/gfarm/config/linux/debian DATA = $(srcdir)/gfarm-pgsql.in \ $(srcdir)/gfarm-slapd.in \ $(srcdir)/gfmd.in \ $(srcdir)/gfsd.in include $(top_srcdir)/makes/data.mk gfarm-2.4.1/gftool/config-gfarm/sysdep/linux/debian/gfarm-slapd.in0000644000000000000000000001132011507222717023557 0ustar rootroot#! /bin/sh # Kill me on all errors set -e FILE=gfarm-slapd DAEMON="@config_gfarm_openldap_libexec@/slapd" SLAPD_CONF="@config_gfarm_slapd_config@" SLAPD_SERVICES="ldap://:@config_gfarm_backend_port@/" SLAPD_OPTIONS="" # Stop processing if slapd is not there [ -x "$DAEMON" ] || exit 0 # Source the init script configuration if [ -f "/etc/default/$FILE" ]; then . /etc/default/$FILE fi # Load the default location of the slapd config file if [ -z "$SLAPD_CONF" ]; then SLAPD_CONF="/etc/ldap/slapd.conf" else SLAPD_OPTIONS="-f $SLAPD_CONF $SLAPD_OPTIONS" SLURPD_OPTIONS="-f $SLAPD_CONF $SLURPD_OPTIONS" fi # Stop processing if the config file is not there if [ ! -r "$SLAPD_CONF" ]; then cat <&2 No configuration file was found for slapd at $SLAPD_CONF. If you have moved the slapd configuration file please modify /etc/default/slapd to reflect this. If you chose to not configure slapd during installation then you need to do so prior to attempting to start slapd. An example slapd.conf is in /usr/share/slapd EOF exit 0 # Should this be 1? fi # Figure out some default settings # Check wether slurpd should get started if [ "$SLURPD_START" != "yes" ] && [ "$SLURPD_START" != "no" ]; then if grep -q '^replica' "$SLAPD_CONF" > /dev/null 2>&1 ; then SLURPD_START=yes else SLURPD_START=no fi fi # Find out the name of slapd's pid file if [ -z "$SLAPD_PIDFILE" ]; then SLAPD_PIDFILE=`sed -ne 's/^pidfile[[:space:]]\+\(.\+\)/\1/p' \ "$SLAPD_CONF"` fi # XXX: Breaks upgrading if there is no pidfile (invoke-rc.d stop will fail) # -- Torsten if [ -z "$SLAPD_PIDFILE" ]; then cat <&2 The pidfile for slapd is neither specified in "$SLAPD_CONF" nor in /etc/default/$FILE. Consequently, slapd will not be started. EOF exit 1 fi # Pass the user and group to run under to slapd if [ "$SLAPD_USER" ]; then SLAPD_OPTIONS="-u $SLAPD_USER $SLAPD_OPTIONS" fi if [ "$SLAPD_GROUP" ]; then SLAPD_OPTIONS="-g $SLAPD_GROUP $SLAPD_OPTIONS" fi # Tell the user that something went wrong and give some hints for # resolving the problem. report_failure() { if [ -n "$reason" ]; then echo " - failed: " echo "$reason" else echo " - failed." cat <&1`" else reason="`start-stop-daemon --start --quiet --oknodo \ --pidfile "$SLAPD_PIDFILE" \ --exec "$DAEMON" -- -h "$SLAPD_SERVICES" $SLAPD_OPTIONS 2>&1`" fi } # Start the slurpd daemon and capture the error message if any to # $reason. start_slurpd() { if [ "$SLURPD_START" != yes ]; then return 0 fi echo -n " slurpd" reason="`start-stop-daemon --start --quiet --oknodo \ --exec /usr/sbin/slurpd -- $SLURPD_OPTIONS 2>&1`" } # Stop the slapd daemon and capture the error message (if any) to # $reason. stop_slapd() { echo -n " slapd" reason="`start-stop-daemon --stop --quiet --oknodo --retry 10 \ --pidfile "$SLAPD_PIDFILE" \ --exec "$DAEMON" 2>&1`" } # Stop the slurpd daemon and capture the error message (if any) to # $reason. stop_slurpd() { if [ "$SLURPD_START" != yes ]; then return 0 fi echo -n " slurpd" reason="`start-stop-daemon --stop --quiet --oknodo --retry 10 \ --exec /usr/sbin/slurpd 2>&1`" } # Start the OpenLDAP daemons start() { echo -n "Starting OpenLDAP:" trap 'report_failure' 0 start_slapd start_slurpd trap "-" 0 echo . } # Stop the OpenLDAP daemons stop() { echo -n "Stopping OpenLDAP:" trap 'report_failure' 0 stop_slurpd stop_slapd trap "-" 0 echo . } case "$1" in start) start ;; stop) stop ;; restart|force-reload) stop start ;; *) echo "Usage: $0 {start|stop|restart|force-reload}" exit 1 ;; esac gfarm-2.4.1/gftool/config-gfarm/sysdep/linux/debian/gfarm-pgsql.in0000644000000000000000000000255011507222717023607 0ustar rootroot#! /bin/bash # # gfarm-pgsql Start the PostgreSQL daemon - postmaster. # PATH=/sbin:/bin:/usr/sbin:/usr/bin FILE="gfarm-pgsql" PGPORT="@config_gfarm_backend_port@" PGDATA="@config_gfarm_backend_data_dir@" CTL="@config_gfarm_pgsql_bindir@/pg_ctl" PIDFILE="$PGDATA/portmaster.pid" OPTIONS="@config_gfarm_pgsql_options@" PRIVILEGE="@config_gfarm_backend_privilege@" # For SELinux we need to use 'runuser' not 'su' [ -x /sbin/runuser ] && SU=/sbin/runuser || SU=su case $PRIVILEGE in '') RUN=/bin/sh;; *) RUN="$SU - $PRIVILEGE";; esac trap "" 1 export LANG=C export PATH export PGPORT export PGDATA test -f $CTL || exit 0 test -d $PGDATA || exit 0 call_pg_ctl() { $RUN -c "$CTL $OPTIONS $*" } checkstatus() { call_pg_ctl status RETVAL=$? [ $RETVAL -eq 1 ] && RETVAL=3 return $RETVAL } RETVAL=0 case "$1" in start) echo -n "Starting gfarm server: $FILE" checkstatus > /dev/null RETVAL=$? if [ $RETVAL -ne 0 ]; then call_pg_ctl start RETVAL=$? fi echo "." ;; stop) echo -n "Stopping gfarm server: $FILE" checkstatus > /dev/null RETVAL=$? if [ $RETVAL -eq 3 ]; then RETVAL=0 else call_pg_ctl stop RETVAL=$? fi echo "." ;; status) checkstatus RETVAL=$? ;; restart) call_pg_ctl restart RETVAL=$? ;; force-reload) call_pg_ctl reload RETVAL=$? ;; *) echo "Usage: /etc/init.d/$FILE {start|stop|restart}" exit 1 ;; esac exit $RETVAL gfarm-2.4.1/gftool/config-gfarm/sysdep/linux/debian/gfmd.in0000644000000000000000000000156411507222717022310 0ustar rootroot#! /bin/bash # # gfmd Start the gfmd server. # PATH=/sbin:/bin:/usr/sbin:/usr/bin NAME=gfmd FILE=$NAME DAEMON="@config_gfarm_prefix@/sbin/$NAME" PIDFILE="@config_gfarm_run_dir@/$FILE.pid" CONF="@config_gfarm_gfmd_config@" OPTIONS="@config_gfarm_gfmd_option@" trap "" 1 export LANG=C export PATH test -f $DAEMON || exit 0 test -f $CONF || exit 0 case "$1" in start) echo -n "Starting gfarm server: $FILE" # increase the maximum number of open file descriptors ulimit -n 16384 2> /dev/null start-stop-daemon --quiet --start \ --pidfile $PIDFILE --exec $DAEMON -- -P $PIDFILE $OPTIONS echo "." ;; stop) echo -n "Stopping gfarm server: $FILE" start-stop-daemon --stop --quiet --pidfile $PIDFILE --exec $DAEMON echo "." ;; restart|force-reload) $0 stop $0 start ;; *) echo "Usage: /etc/init.d/$FILE {start|stop|restart}" exit 1 ;; esac exit 0 gfarm-2.4.1/gftool/config-gfarm/sysdep/linux/suse/0000755000000000000000000000000011507222730020565 5ustar rootrootgfarm-2.4.1/gftool/config-gfarm/sysdep/linux/suse/gfsd.in0000644000000000000000000000466211507222717022055 0ustar rootroot#! /bin/sh # $Id: gfsd.in 3617 2007-03-12 08:32:55Z n-soda $ # # /etc/init.d/@config_gfarm_gfsd_rc_name@ # # and its symbolic link # # /usr/sbin/rc@config_gfarm_gfsd_rc_name@ # ### BEGIN INIT INFO # Provides: @config_gfarm_gfsd_rc_name@ # Required-Start: $network $syslog # Required-Stop: $network $syslog # Default-Start: 3 5 # Default-Stop: 0 1 2 6 # Description: Gfarm filesystem node daemon ### END INIT INFO . /etc/rc.status prog="gfsd" FILE="@config_gfarm_gfsd_rc_name@" # usually "gfsd", or maybe "gfsd-IP_ADDRESS" DAEMON="@config_gfarm_prefix@/sbin/$prog" PIDFILE="@config_gfarm_run_dir@/${FILE}.pid" OPTIONS="@config_gfarm_gfsd_option@" # pull in sysconfig settings [ -f "/etc/sysconfig/$FILE" ] && . "/etc/sysconfig/$FILE" # We won't just use "checkproc", "startproc" and "killproc" here, # because these functions don't allow multiple server processes for # same binary. rc_reset case $1 in start) echo -n "Starting $FILE" if [ ! -x "$DAEMON" ]; then rc_failed 5 # program is not installed elif "$DAEMON" -P "$PIDFILE" $OPTIONS; then : else rc_failed 1 # generic or unspecified error fi rc_status -v ;; stop) echo -n "Shutting down $FILE" if [ -f "$PIDFILE" ] && kill -TERM `cat "$PIDFILE"`; then rm -f "$PIDFILE" elif [ -f "$PIDFILE" ] && [ -d /proc/`sed 's/[^0-9]//g' "$PIDFILE"` ] then rc_failed 4 # user had insufficient privileges else if [ -f "$PIDFILE" ]; then echo -n "$FILE (pid" `cat "$PIDFILE"`") is dead, but $PIDFILE remains" fi rc_failed 7 # program is not running fi rc_status -v ;; try-restart) ## Do a restart only if the service was active before. $0 status >/dev/null && $0 restart rc_status # Remember status and be quiet ;; restart) $0 stop $0 start rc_status # Remember status and be quiet ;; force-reload) echo -n "Reload service $FILE" $0 stop && $0 start rc_status # Remember status and be quiet ;; reload) ## Like force-reload, but if daemon does not support ## signaling, do nothing (!) echo -n "Reload service $FILE" rc_failed 3 # unimplemented feature rc_status -v ;; status) echo -n "Checking for service $FILE: " if [ -f "$PIDFILE" ] && [ -d /proc/`sed 's/[^0-9]//g' "$PIDFILE"` ] then : elif [ -f "$PIDFILE" ]; then rc_failed 1 # service dead, but pid file exists else rc_failed 3 # service not running (unused) fi rc_status -v ;; *) echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload}" exit 1 ;; esac rc_exit gfarm-2.4.1/gftool/config-gfarm/sysdep/linux/suse/Makefile0000644000000000000000000000053611507222717022236 0ustar rootroot# $Id: Makefile 3856 2007-11-05 03:41:26Z tatebe $ top_builddir = ../../../../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk datadir=$(default_datadir)/gfarm/config/linux/suse DATA = $(srcdir)/gfarm-pgsql.in \ $(srcdir)/gfarm-slapd.in \ $(srcdir)/gfmd.in \ $(srcdir)/gfsd.in include $(top_srcdir)/makes/data.mk gfarm-2.4.1/gftool/config-gfarm/sysdep/linux/suse/gfarm-slapd.in0000644000000000000000000000466611507222717023333 0ustar rootroot#! /bin/sh # $Id: gfarm-slapd.in 2604 2006-05-18 08:56:35Z soda $ # # /etc/init.d/gfarm-slapd # # and its symbolic link # # /usr/sbin/rcgfarm-slapd # ### BEGIN INIT INFO # Provides: gfarm-slapd # Required-Start: $network $syslog # Required-Stop: $network $syslog # Default-Start: 3 5 # Default-Stop: 0 1 2 6 # Description: LDAP slapd for Gfarm ### END INIT INFO . /etc/rc.status prog="slapd" FILE="gfarm-slapd" CONF="@config_gfarm_slapd_config@" PORT=@config_gfarm_backend_port@ DAEMON="@config_gfarm_openldap_libexec@/$prog" PIDFILE="@config_gfarm_run_dir@/${FILE}.pid" # pull in sysconfig settings [ -f "/etc/sysconfig/$FILE" ] && . "/etc/sysconfig/$FILE" # We won't just use "checkproc", "startproc" and "killproc" here, # because these functions don't allow multiple server processes for # same binary. rc_reset case $1 in start) echo -n "Starting $FILE" # increase the maximum number of open file descriptors ulimit -n 16384 2> /dev/null if [ ! -x "$DAEMON" ]; then rc_failed 5 # program is not installed elif "$DAEMON" -f "$CONF" -h "ldap://:$PORT/"; then : else rc_failed 1 # generic or unspecified error fi rc_status -v ;; stop) echo -n "Shutting down $FILE" if [ -f "$PIDFILE" ] && kill -TERM `cat "$PIDFILE"`; then : elif [ -f "$PIDFILE" ] && [ -d /proc/`sed 's/[^0-9]//g' "$PIDFILE"` ] then rc_failed 4 # user had insufficient privileges else if [ -f "$PIDFILE" ]; then echo -n "$FILE (pid" `cat "$PIDFILE"`") is dead, but $PIDFILE remains" fi rc_failed 7 # program is not running fi rc_status -v ;; try-restart) ## Do a restart only if the service was active before. $0 status >/dev/null && $0 restart rc_status # Remember status and be quiet ;; restart) $0 stop $0 start rc_status # Remember status and be quiet ;; force-reload) echo -n "Reload service $FILE" $0 stop && $0 start rc_status # Remember status and be quiet ;; reload) ## Like force-reload, but if daemon does not support ## signaling, do nothing (!) echo -n "Reload service $FILE" rc_failed 3 # unimplemented feature rc_status -v ;; status) echo -n "Checking for service $FILE: " if [ -f "$PIDFILE" ] && [ -d /proc/`sed 's/[^0-9]//g' "$PIDFILE"` ] then : elif [ -f "$PIDFILE" ]; then rc_failed 1 # service dead, but pid file exists else rc_failed 3 # service not running (unused) fi rc_status -v ;; *) echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload}" exit 1 ;; esac rc_exit gfarm-2.4.1/gftool/config-gfarm/sysdep/linux/suse/gfarm-pgsql.in0000644000000000000000000000436611507222717023353 0ustar rootroot#! /bin/sh # $Id: gfarm-pgsql.in 3880 2007-12-04 15:44:05Z tatebe $ # # /etc/init.d/gfarm-pgsql # # and its symbolic link # # /usr/sbin/rcgfarm-pgsql # ### BEGIN INIT INFO # Provides: gfarm-pgsql # Required-Start: $network $syslog # Required-Stop: $network $syslog # Default-Start: 3 5 # Default-Stop: 0 1 2 6 # Description: PostgreSQL daemon for Gfarm ### END INIT INFO . /etc/rc.status FILE="gfarm-pgsql" PGPORT="@config_gfarm_backend_port@" PGDATA="@config_gfarm_backend_data_dir@" CTL="@config_gfarm_pgsql_bindir@/pg_ctl" PIDFILE="$PGDATA/portmaster.pid" OPTIONS="@config_gfarm_pgsql_options@" PRIVILEGE="@config_gfarm_backend_privilege@" # For SELinux we need to use 'runuser' not 'su' [ -x /sbin/runuser ] && SU=/sbin/runuser || SU=su case $PRIVILEGE in '') RUN=/bin/sh;; *) RUN="$SU - $PRIVILEGE";; esac # pull in sysconfig settings [ -f "/etc/sysconfig/$FILE" ] && . "/etc/sysconfig/$FILE" export PGPORT export PGDATA unset LANG # We won't just use "checkproc", "startproc" and "killproc" here, # because these functions don't allow multiple server processes for # same binary. rc_reset call_pg_ctl() { $RUN -c "$CTL $OPTIONS $*" } case $1 in start) echo -n "Starting $FILE" # increase the maximum number of open file descriptors ulimit -n 16384 2> /dev/null if [ ! -x "$CTL" ]; then rc_failed 5 # program is not installed elif call_pg_ctl start; then : else rc_failed 1 # generic or unspecified error fi rc_status -v ;; stop) echo -n "Shutting down $FILE" call_pg_ctl stop || rc_failed 1 rc_status -v ;; try-restart) ## Do a restart only if the service was active before. $0 status >/dev/null && $0 restart rc_status # Remember status and be quiet ;; restart) $0 stop $0 start rc_status # Remember status and be quiet ;; force-reload) echo -n "Reload service $FILE" $0 stop && $0 start rc_status # Remember status and be quiet ;; reload) ## Like force-reload, but if daemon does not support ## signaling, do nothing (!) echo -n "Reload service $FILE" rc_failed 3 # unimplemented feature rc_status -v ;; status) echo -n "Checking for service $FILE: " call_pg_ctl status || rc_failed 1 rc_status -v ;; *) echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload}" exit 1 ;; esac rc_exit gfarm-2.4.1/gftool/config-gfarm/sysdep/linux/suse/gfmd.in0000644000000000000000000000457511507222717022052 0ustar rootroot#! /bin/sh # $Id: gfmd.in 3980 2008-05-27 12:49:46Z tatebe $ # # /etc/init.d/gfmd # # and its symbolic link # # /usr/sbin/rcgfmd # ### BEGIN INIT INFO # Provides: gfmd # Required-Start: $network $syslog # Required-Stop: $network $syslog # Default-Start: 3 5 # Default-Stop: 0 1 2 6 # Description: Gfarm filesystem metaserver ### END INIT INFO . /etc/rc.status prog="gfmd" FILE=$prog DAEMON="@config_gfarm_prefix@/sbin/$prog" PIDFILE="@config_gfarm_run_dir@/${FILE}.pid" OPTIONS="@config_gfarm_gfmd_option@" # pull in sysconfig settings [ -f "/etc/sysconfig/$FILE" ] && . "/etc/sysconfig/$FILE" # We won't just use "checkproc", "startproc" and "killproc" here, # because these functions don't allow multiple server processes for # same binary. rc_reset case $1 in start) echo -n "Starting $FILE" # increase the maximum number of open file descriptors ulimit -n 16384 2> /dev/null if [ ! -x "$DAEMON" ]; then rc_failed 5 # program is not installed elif "$DAEMON" -P "$PIDFILE" $OPTIONS; then : else rc_failed 1 # generic or unspecified error fi rc_status -v ;; stop) echo -n "Shutting down $FILE" if [ -f "$PIDFILE" ] && kill -TERM `cat "$PIDFILE"`; then rm -f "$PIDFILE" elif [ -f "$PIDFILE" ] && [ -d /proc/`sed 's/[^0-9]//g' "$PIDFILE"` ] then rc_failed 4 # user had insufficient privileges else if [ -f "$PIDFILE" ]; then echo -n "$FILE (pid" `cat "$PIDFILE"`") is dead, but $PIDFILE remains" fi rc_failed 7 # program is not running fi rc_status -v ;; try-restart) ## Do a restart only if the service was active before. $0 status >/dev/null && $0 restart rc_status # Remember status and be quiet ;; restart) $0 stop $0 start rc_status # Remember status and be quiet ;; force-reload) echo -n "Reload service $FILE" $0 stop && $0 start rc_status # Remember status and be quiet ;; reload) ## Like force-reload, but if daemon does not support ## signaling, do nothing (!) echo -n "Reload service $FILE" rc_failed 3 # unimplemented feature rc_status -v ;; status) echo -n "Checking for service $FILE: " if [ -f "$PIDFILE" ] && [ -d /proc/`sed 's/[^0-9]//g' "$PIDFILE"` ] then : elif [ -f "$PIDFILE" ]; then rc_failed 1 # service dead, but pid file exists else rc_failed 3 # service not running (unused) fi rc_status -v ;; *) echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload}" exit 1 ;; esac rc_exit gfarm-2.4.1/gftool/config-gfarm/sysdep/linux/default/0000755000000000000000000000000011507222730021232 5ustar rootrootgfarm-2.4.1/gftool/config-gfarm/sysdep/linux/default/Makefile0000644000000000000000000000063111507222717022677 0ustar rootroot# $Id: Makefile 3856 2007-11-05 03:41:26Z tatebe $ top_builddir = ../../../../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk datadir=$(default_datadir)/gfarm/config/linux/default DATA = $(srcdir)/../../default/gfarm-pgsql.in \ $(srcdir)/../../default/gfarm-slapd.in \ $(srcdir)/../../default/gfmd.in \ $(srcdir)/../../default/gfsd.in include $(top_srcdir)/makes/data.mk gfarm-2.4.1/gftool/config-gfarm/sysdep/linux/Makefile0000644000000000000000000000052711507222717021257 0ustar rootroot# $Id: Makefile 2375 2006-01-12 02:06:20Z soda $ top_builddir = ../../../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk SUBDIRS=debian default redhat suse datadir=$(default_datadir)/gfarm/config DATA = $(srcdir)/config-gfarm.sysdep include $(top_srcdir)/makes/data.mk include $(top_srcdir)/makes/subdir.mk gfarm-2.4.1/gftool/config-gfarm/sysdep/linux/redhat/0000755000000000000000000000000011507222730021055 5ustar rootrootgfarm-2.4.1/gftool/config-gfarm/sysdep/linux/redhat/gfsd.in0000644000000000000000000000466011507222717022343 0ustar rootroot#!/bin/bash # # Init file for Gfarm filesystem node daemon # # chkconfig: 2345 95 05 # description: Gfarm filesystem node daemon # # processname: gfsd # config: @config_gfarm_gfarm_config@ # pidfile: @config_gfarm_run_dir@/@config_gfarm_gfsd_rc_name@.pid # # $Id: gfsd.in 4167 2009-05-24 01:52:22Z tatebe $ # source function library . /etc/rc.d/init.d/functions prog="gfsd" FILE="@config_gfarm_gfsd_rc_name@" # usually "gfsd", or maybe "gfsd-IP_ADDRESS" DAEMON="@config_gfarm_prefix@/sbin/$prog" PIDFILE="@config_gfarm_run_dir@/${FILE}.pid" LOCKFILE="@config_gfarm_lock_dir@/$FILE" OPTIONS="@config_gfarm_gfsd_option@" # pull in sysconfig settings [ -f "/etc/sysconfig/$FILE" ] && . "/etc/sysconfig/$FILE" call_daemon() { # initlog is deprecated and warning is displayed since Fedora Core 4. if egrep -q '^[^#]*[ ]initlog' /etc/init.d/functions; then initlog $INITLOG_ARGS -c "$*" else $* fi } # We won't just use "killproc" and "status" function here, # because these functions don't allow multiple server processes for # same binary. start() { echo -n "Starting $FILE:" checkstatus > /dev/null if [ $? -eq 0 ]; then success echo return 0 fi call_daemon $DAEMON -P $PIDFILE $OPTIONS && success || failure RETVAL=$? [ "$RETVAL" = 0 ] && touch "$LOCKFILE" echo return $RETVAL } stop() { echo -n "Stopping $FILE:" checkstatus > /dev/null if [ $? -eq 3 ]; then success echo return 0 fi if [ -f "$PIDFILE" ]; then kill -TERM `cat "$PIDFILE"` && success || failure RETVAL=$? if [ $RETVAL -eq 0 ] || [ ! -d /proc/`sed 's/[^0-9]//g' "$PIDFILE"` ]; then rm -f "$PIDFILE" "$LOCKFILE" fi else echo "$FILE is already stopped (no $PIDFILE)" failure RETVAL=1 fi echo return $RETVAL } checkstatus() { if [ -f "$PIDFILE" ] && [ -d /proc/`sed 's/[^0-9]//g' "$PIDFILE"` ] then echo "$FILE (pid" `cat "$PIDFILE"`") is running" return 0 elif [ -f "$PIDFILE" ]; then echo "$FILE (pid" `cat "$PIDFILE"`") is dead, but $PIDFILE remains" return 1 elif [ -f "$LOCKFILE" ]; then echo "$FILE is dead (no $PIDFILE), but $LOCKFILE remains" return 2 else echo "$FILE is stopped (no $PIDFILE)" return 3 fi } usage() { echo $"Usage: $0 {start|stop|restart|status}" exit 1 } RETVAL=0 SUB_COMMAND="$1" shift case "$SUB_COMMAND" in start) start RETVAL=$? ;; stop) stop RETVAL=$? ;; restart|reload) stop start RETVAL=$? ;; status) checkstatus RETVAL=$? ;; *) usage ;; esac exit $RETVAL gfarm-2.4.1/gftool/config-gfarm/sysdep/linux/redhat/Makefile0000644000000000000000000000054011507222717022521 0ustar rootroot# $Id: Makefile 3856 2007-11-05 03:41:26Z tatebe $ top_builddir = ../../../../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk datadir=$(default_datadir)/gfarm/config/linux/redhat DATA = $(srcdir)/gfarm-pgsql.in \ $(srcdir)/gfarm-slapd.in \ $(srcdir)/gfmd.in \ $(srcdir)/gfsd.in include $(top_srcdir)/makes/data.mk gfarm-2.4.1/gftool/config-gfarm/sysdep/linux/redhat/gfarm-slapd.in0000644000000000000000000000510711507222717023612 0ustar rootroot#! /bin/sh # # gfarm-slapd # # chkconfig: 2345 85 15 # description: LDAP slapd for Gfarm # processname: slapd # config: @config_gfarm_slapd_config@ # pidfile: @config_gfarm_run_dir@/gfarm-slapd.pid # Source function library. . /etc/rc.d/init.d/functions prog="slapd" FILE="gfarm-slapd" CONF="@config_gfarm_slapd_config@" PORT=@config_gfarm_backend_port@ DAEMON="@config_gfarm_openldap_libexec@/$prog" PIDFILE="@config_gfarm_run_dir@/${FILE}.pid" LOCKFILE="@config_gfarm_lock_dir@/$FILE" # Get config. . /etc/sysconfig/network # Check that networking is up. if [ ${NETWORKING} = "no" ] then exit 0 fi # pull in sysconfig settings [ -f "/etc/sysconfig/$FILE" ] && . "/etc/sysconfig/$FILE" [ -f "$DAEMON" ] || exit 0 [ -f "$CONF" ] || exit 0 call_daemon() { # initlog is deprecated and warning is displayed since Fedora Core 4. if egrep -q '^[^#]*[ ]initlog' /etc/init.d/functions; then initlog $INITLOG_ARGS -c "$*" else $* fi } # We won't just use "killproc" and "status" function here, # because these functions don't allow multiple server processes for # same binary. start() { echo -n "Starting $FILE: " checkstatus > /dev/null if [ $? -eq 0 ]; then success echo return 0 fi # increase the maximum number of open file descriptors ulimit -n 16384 2> /dev/null call_daemon $DAEMON -f $CONF -h ldap://:$PORT/ && success || failure RETVAL=$? [ $RETVAL -eq 0 ] && touch "$LOCKFILE" echo return $RETVAL } stop() { echo -n "Stopping $FILE: " checkstatus > /dev/null if [ $? -eq 3 ]; then success echo return 0 fi if [ -f "$PIDFILE" ]; then PID=`cat "$PIDFILE"` kill -TERM $PID && success || failure RETVAL=$? if [ $RETVAL -eq 0 ] || [ ! -d /proc/`sed 's/[^0-9]//g' "$PIDFILE"` ]; then rm -f "$PIDFILE" "$LOCKFILE" fi else echo "$FILE is already stopped (no $PIDFILE)" failure RETVAL=1 fi echo return $RETVAL } checkstatus() { if [ -f "$PIDFILE" ] && [ -d /proc/`sed 's/[^0-9]//g' "$PIDFILE"` ] then echo "$FILE (pid" `cat "$PIDFILE"`") is running" return 0 elif [ -f "$PIDFILE" ]; then echo "$FILE (pid" `cat "$PIDFILE"`") is dead, but $PIDFILE remains" return 1 elif [ -f "$LOCKFILE" ]; then echo "$FILE is dead (no $PIDFILE), but $LOCKFILE remains" return 2 else echo "$FILE is stopped (no $PIDFILE)" return 3 fi } usage() { echo "Usage: $FILE {start|stop|status|restart|reload}" exit 1 } RETVAL=0 SUB_COMMAND="$1" shift case "$SUB_COMMAND" in start) start RETVAL=$? ;; stop) stop RETVAL=$? ;; status) checkstatus RETVAL=$? ;; restart|reload) stop start RETVAL=$? ;; *) usage ;; esac exit $RETVAL gfarm-2.4.1/gftool/config-gfarm/sysdep/linux/redhat/gfarm-pgsql.in0000644000000000000000000000412011507222717023627 0ustar rootroot#!/bin/sh # postgresql This is the init script for starting up the PostgreSQL server # # chkconfig: 2345 85 15 # description: PostgreSQL daemon for Gfarm # processname: postmaster # pidfile: @config_gfarm_backend_data_dir@/postmaster.pid # Source function library. . /etc/rc.d/init.d/functions FILE="gfarm-pgsql" PGPORT="@config_gfarm_backend_port@" PGDATA="@config_gfarm_backend_data_dir@" CTL="@config_gfarm_pgsql_bindir@/pg_ctl" LOCKFILE="@config_gfarm_lock_dir@/$FILE" OPTIONS="@config_gfarm_pgsql_options@" PRIVILEGE="@config_gfarm_backend_privilege@" # For SELinux we need to use 'runuser' not 'su' [ -x /sbin/runuser ] && SU=/sbin/runuser || SU=su case $PRIVILEGE in '') RUN=/bin/sh;; *) RUN="$SU - $PRIVILEGE";; esac # Get config. . /etc/sysconfig/network export PGPORT export PGDATA unset LANG # Check that networking is up. if [ ${NETWORKING} = "no" ] then exit 0 fi # pull in sysconfig settings [ -f "/etc/sysconfig/$FILE" ] && . "/etc/sysconfig/$FILE" # We won't just use "killproc" and "status" function here, # because these functions don't allow multiple server processes for # same binary. call_pg_ctl() { $RUN -c "$CTL $OPTIONS $*" } start() { echo -n "Starting $FILE: " checkstatus > /dev/null if [ $? -eq 0 ]; then success echo return 0 fi # increase the maximum number of open file descriptors ulimit -n 16384 2> /dev/null call_pg_ctl start && success || failure RETVAL=$? [ $RETVAL -eq 0 ] && touch "$LOCKFILE" echo return $RETVAL } stop() { echo -n "Stopping $FILE: " checkstatus > /dev/null if [ $? -eq 3 ]; then success echo return 0 fi call_pg_ctl stop && success || failure RETVAL=$? [ $RETVAL -eq 0 ] && rm -f "$LOCKFILE" echo return $RETVAL } checkstatus() { call_pg_ctl status RETVAL=$? [ $RETVAL -eq 1 ] && RETVAL=3 return $RETVAL } usage() { echo "Usage: $FILE {start|stop|status|restart|reload}" exit 1 } RETVAL=0 SUB_COMMAND="$1" shift case "$SUB_COMMAND" in start) start RETVAL=$? ;; stop) stop RETVAL=$? ;; status) checkstatus RETVAL=$? ;; restart|reload) stop start RETVAL=$? ;; *) usage ;; esac exit $RETVAL gfarm-2.4.1/gftool/config-gfarm/sysdep/linux/redhat/gfmd.in0000644000000000000000000000464711507222717022342 0ustar rootroot#!/bin/bash # # Init file for Gfarm filesystem metaserver # # chkconfig: 2345 90 10 # description: Gfarm filesystem metaserver # # processname: gfmd # config: @config_gfarm_gfmd_config@ # pidfile: @config_gfarm_run_dir@/gfmd.pid # # $Id: gfmd.in 4167 2009-05-24 01:52:22Z tatebe $ # source function library . /etc/rc.d/init.d/functions prog="gfmd" FILE=$prog DAEMON="@config_gfarm_prefix@/sbin/$prog" PIDFILE="@config_gfarm_run_dir@/${FILE}.pid" LOCKFILE="@config_gfarm_lock_dir@/$FILE" OPTIONS="@config_gfarm_gfmd_option@" # pull in sysconfig settings [ -f "/etc/sysconfig/$FILE" ] && . "/etc/sysconfig/$FILE" call_daemon() { # initlog is deprecated and warning is displayed since Fedora Core 4. if egrep -q '^[^#]*[ ]initlog' /etc/init.d/functions; then initlog $INITLOG_ARGS -c "$*" else $* fi } # We won't just use "killproc" and "status" function here, # because these functions don't allow multiple server processes for # same binary. start() { echo -n "Starting $FILE:" checkstatus > /dev/null if [ $? -eq 0 ]; then success echo return 0 fi # increase the maximum number of open file descriptors ulimit -n 16384 2> /dev/null call_daemon $DAEMON -P $PIDFILE $OPTIONS && success || failure RETVAL=$? [ "$RETVAL" = 0 ] && touch "$LOCKFILE" echo return $RETVAL } stop() { echo -n "Stopping $FILE:" checkstatus > /dev/null if [ $? -eq 3 ]; then success echo return 0 fi if [ -f "$PIDFILE" ]; then kill -TERM `cat "$PIDFILE"` && success || failure RETVAL=$? if [ $RETVAL -eq 0 ] || [ ! -d /proc/`sed 's/[^0-9]//g' "$PIDFILE"` ]; then rm -f "$PIDFILE" "$LOCKFILE" fi else echo "$FILE is already stopped (no $PIDFILE)" failure RETVAL=1 fi echo return $RETVAL } checkstatus() { if [ -f "$PIDFILE" ] && [ -d /proc/`sed 's/[^0-9]//g' "$PIDFILE"` ] then echo "$FILE (pid" `cat "$PIDFILE"`") is running" return 0 elif [ -f "$PIDFILE" ]; then echo "$FILE (pid" `cat "$PIDFILE"`") is dead, but $PIDFILE remains" return 1 elif [ -f "$LOCKFILE" ]; then echo "$FILE is dead (no $PIDFILE), but $LOCKFILE remains" return 2 else echo "$FILE is stopped (no $PIDFILE)" return 3 fi } usage() { echo $"Usage: $0 {start|stop|restart|status}" exit 1 } RETVAL=0 SUB_COMMAND="$1" shift case "$SUB_COMMAND" in start) start RETVAL=$? ;; stop) stop RETVAL=$? ;; restart|reload) stop start RETVAL=$? ;; status) checkstatus RETVAL=$? ;; *) usage ;; esac exit $RETVAL gfarm-2.4.1/gftool/config-gfarm/gfarm.arch.guess0000755000000000000000000001221311507222717020227 0ustar rootroot#!/bin/sh # this script returns an ABI architecture name which will be used by gfhost. PATH=/bin:/usr/bin:/usr/ucb export PATH # `uname -r` may be something like follows: # "4.1.3-JL" (SunOS), # "2.4.20-18.8smp" (Linux) # "4.11-RELEASE" (FreeBSD) RELEASE=`uname -r | sed -e 's/-/_/g'` MACHINE=`uname -m` case $MACHINE in i[4-9]86) MACHINE=i386;; esac # "tr 'A-Z' 'a-z'" is not portable KERNEL=`uname -s| tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` case $KERNEL in aix) if [ -x /usr/bin/oslevel ]; then ARCH="$MACHINE-ibm-$KERNEL`/usr/bin/oslevel`" else ARCH="$MACHINE-ibm-$KERNEL`uname -v`.$RELEASE" fi;; hp-ux) case `getconf SC_CPU_VERSION 2>/dev/null` in 523) MACHINE=hppa1.0;; 528) MACHINE=hppa1.1;; 532) MACHINE=hppa2.0;; '') case $MACHINE in 9000/[678][0-9][0-9]) MACHINE=hppa;; *) MACHINE=m68k;; esac esac # `uname -r` == "B.11.23" (HP-UX) -> "11.23" ARCH="$MACHINE-hp-hpux`echo $RELEASE | sed -e 's/[^.]*.[0B]*//'`";; irix) ARCH="$MACHINE-sgi-$KERNEL$RELEASE";; linux) ARCH= i=`ls /etc/*-release 2>/dev/null | wc -l` if [ ! -h /etc/redhat-release -a -f /etc/redhat-release ] && ( [ $i -eq 1 ] || [ -f /etc/lsb-release -a $i -eq 2 ] ) then # /etc/redhat-release: # Red Hat Linux release 8.0 (Psyche) # Red Hat Linux release 9 (Shrike) # Red Hat Linux Advanced Server release 2.1AS (Pensacola) # Red Hat Enterprise Linux WS release 4 (Nahant) # Red Hat Enterprise Linux ES release 4 (Nahant Update 1) # CentOS release 4.4 (Final) if grep '^Red Hat' /etc/redhat-release >/dev/null; then ARCH=$MACHINE-redhat` sed 's/([^()]*) *$//' /etc/redhat-release | awk 'NR == 1 { if ($3 != "Linux") { printf "%c%c", substr($3,1,1), substr($4,1,1) } print $NF }'`-$KERNEL else ARCH=$MACHINE-` sed -e 's/release//' -e 's/(.*)//' \ -e 's/[ ][ ]*//g' \ -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/' \ /etc/redhat-release`-$KERNEL fi fi if [ X"$ARCH" = X ]; then # /etc/debian_version: 3.0 # /etc/knoppix_version: ??? for i in /etc/*_version; do if [ ! -h $i -a -f $i ]; then ARCH=$MACHINE-`echo $i | sed -e 's|^/etc/||' \ -e 's/_version$//' \ -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'``cat $i`-$KERNEL break fi done fi if [ X"$ARCH" = X ]; then # /etc/SuSE-release: # SuSE Linux 8.1 (i386) # SuSE SLES-8 (AMD64) # SUSE LINUX Enterprise Server 9 (i586) # /etc/arch-release: # Arch Linux 0.7 (Wombat) # /etc/bluepoint-release: ??? # /etc/conectiva-release: # Conectiva Linux 7.0 # Conectiva Linux 10 # /etc/fedora-release: # Fedora Core release 2 (Tettnang) # /etc/gentoo-release: # Gentoo Base System version 1.4.16 # /etc/lfs-release: # SVN-20040910 # /etc/lsb-release (version number of Linux Standard Base): # LSB_VERSION="1.2.0" # /etc/mandrake-release: # Mandrake Linux release 8.1 (Vitamin) for i586 # /etc/release # Mandriva Linux release 2006.0 (Cooker) for i586 # /etc/pld-release: # 1.99 PLD Linux (Ac) # /etc/slackware-release: # Slackware release 8.1 (Midas) # /etc/sun-release: # Sun Java Desktop System - 2003 # Sun Java Desktop System, Release 2 -build 10b (GA) # /etc/turbolinux-release: # Turbolinux Server 8.0 (Viper) # Turbolinux Workstation 8.0 (SilverStone) # Turbolinux Server 10.0 (Santoka) # /etc/vine-release: # Vine Linux 2.6r4 (La Fleur de Bouard) # Vine Linux 2.90 (Valandraud) # Vine Linux 3.0 (Valandraud) # Vine Linux 3.0 (VineSeed) (Valandraud) # /etc/yellowdog-release: ??? for i in /etc/*-release; do if [ ! -h $i -a -f $i \ -a $i != /etc/redhat-release \ -a $i != /etc/lsb-release ] then ARCH=$MACHINE-`echo $i | sed -e 's|^/etc/||' \ -e 's/-release$//' \ -e 's/linux$//' \ -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`` sed -e 's/(.*//' -e 's/-build .*//' \ -e 's/ [ a-zA-Z]*$//' \ -e 's/-//g' $i | awk 'NR==1 {print $NF}'`-$KERNEL break fi done fi if [ X"$ARCH" = X ]; then # We don't use kernel version, but use distro version for ABI ARCH=$MACHINE-unknown-linux`echo $RELEASE | sed 's/_.*//'` fi ;; osf1) # `uname -r` == "V5.1" ARCH="$MACHINE-dec-$KERNEL`echo $RELEASE | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`" ;; sunos) case `uname -r` in [1-4]*) case `/usr/bin/arch -k` in Series*|S4*) RELEASE=`uname -v`;; esac case $MACHINE in sun3*) ARCH=m68k-sun-sunos$RELEASE;; sun4*) ARCH=sparc-sun-sunos$RELEASE;; aushp) ARCH=sparc-auspex-sunos$RELEASE;; *) ARCH=$MACHINE-sun-sunos$RELEASE;; esac;; *) case $RELEASE in 5|5.*) # SunOS 5.6 == Solaris 2.6 OS=solaris`echo $RELEASE - 3 | bc`;; *) OS=sunos$RELEASE;; esac case $MACHINE in i86pc) ARCH=i386-unknown-$OS;; prep*) ARCH=powerpcle-unknown-$OS;; sun4H) ARCH=sparc-hal-$OS;; sun4*) ARCH=sparc-sun-$OS;; *) ARCH=$MACHINE-sun-$OS;; esac;; esac;; *bsd) # We assume suffixes like _BETA, _RC2 and -RELEASE have same ABI ARCH="$MACHINE-unknown-$KERNEL`echo $RELEASE | sed 's/_.*//'`";; *) ARCH="$MACHINE-unknown-$KERNEL$RELEASE";; esac # translate '/' to '_' just in case since gfarm v1 does not allow '/' in $ARCH echo $ARCH | tr '/' '_' gfarm-2.4.1/gftool/config-gfarm/gfarm.sql0000644000000000000000000000653111507222717016767 0ustar rootrootCREATE TABLE Host ( hostname VARCHAR(256) PRIMARY KEY, port INTEGER NOT NULL, architecture VARCHAR(128) NOT NULL, ncpu INTEGER NOT NULL, flags INTEGER NOT NULL ); CREATE TABLE HostAliases ( hostalias VARCHAR(256) PRIMARY KEY, hostname VARCHAR(256) REFERENCES Host(hostname) ON DELETE CASCADE ); CREATE INDEX HostAliasesByHostname ON HostAliases (hostname); CREATE TABLE GfarmUser ( username VARCHAR(64) PRIMARY KEY, homedir VARCHAR(1024) NOT NULL, realname VARCHAR(256) NOT NULL, gsiDN VARCHAR(1024) ); CREATE TABLE GfarmGroup ( groupname TEXT PRIMARY KEY ); CREATE TABLE GfarmGroupAssignment ( username VARCHAR(64) REFERENCES GfarmUser(username) ON DELETE CASCADE, groupname TEXT REFERENCES GfarmGroup(groupname) ON DELETE CASCADE, PRIMARY KEY(username, groupname) ); CREATE TABLE INode ( inumber INT8 PRIMARY KEY, igen INT8 NOT NULL, nlink INT8 NOT NULL, size INT8 NOT NULL, mode INTEGER NOT NULL, username VARCHAR(64) NOT NULL, groupname TEXT NOT NULL, atimesec INT8 NOT NULL, atimensec INTEGER NOT NULL, mtimesec INT8 NOT NULL, mtimensec INTEGER NOT NULL, ctimesec INT8 NOT NULL, ctimensec INTEGER NOT NULL ); CREATE TABLE FileInfo ( inumber INT8 PRIMARY KEY REFERENCES INode(inumber) ON DELETE CASCADE, checksumType VARCHAR(32) NOT NULL, checksum VARCHAR(256) NOT NULL ); CREATE TABLE FileCopy ( inumber INT8 NOT NULL, hostname VARCHAR(256) NOT NULL, PRIMARY KEY(inumber, hostname) ); CREATE INDEX fileCopyByINode ON FileCopy (inumber); CREATE TABLE DeadFileCopy ( inumber INT8 NOT NULL, igen INT8 NOT NULL, hostname VARCHAR(256) NOT NULL, PRIMARY KEY(inumber, igen, hostname) ); CREATE INDEX deadFileCopyByHostname ON DeadFileCopy (hostname); CREATE TABLE DirEntry ( dirINumber INT8 NOT NULL, entryName VARCHAR(1024) NOT NULL, entryINumber INT8 NOT NULL, PRIMARY KEY(dirINumber, entryName) ); CREATE INDEX dirEntryByINode ON DirEntry (dirINumber); CREATE TABLE Symlink ( inumber INT8 PRIMARY KEY, sourcePath VARCHAR(1024) NOT NULL ); CREATE TABLE XAttr ( inumber INT8 NOT NULL REFERENCES INode(inumber) ON DELETE CASCADE, attrname VARCHAR(256) NOT NULL, attrvalue BYTEA NOT NULL, PRIMARY KEY(inumber, attrname) ); CREATE TABLE QuotaUser ( username VARCHAR(64) PRIMARY KEY REFERENCES GfarmUser(username) ON DELETE CASCADE, gracePeriod INT8 NOT NULL, fileSpace INT8 NOT NULL, fileSpaceExceed INT8 NOT NULL, fileSpaceSoft INT8 NOT NULL, fileSpaceHard INT8 NOT NULL, fileNum INT8 NOT NULL, fileNumExceed INT8 NOT NULL, fileNumSoft INT8 NOT NULL, fileNumHard INT8 NOT NULL, phySpace INT8 NOT NULL, phySpaceExceed INT8 NOT NULL, phySpaceSoft INT8 NOT NULL, phySpaceHard INT8 NOT NULL, phyNum INT8 NOT NULL, phyNumExceed INT8 NOT NULL, phyNumSoft INT8 NOT NULL, phyNumHard INT8 NOT NULL ); CREATE TABLE QuotaGroup ( groupname TEXT PRIMARY KEY REFERENCES GfarmGroup(groupname) ON DELETE CASCADE, gracePeriod INT8 NOT NULL, fileSpace INT8 NOT NULL, fileSpaceExceed INT8 NOT NULL, fileSpaceSoft INT8 NOT NULL, fileSpaceHard INT8 NOT NULL, fileNum INT8 NOT NULL, fileNumExceed INT8 NOT NULL, fileNumSoft INT8 NOT NULL, fileNumHard INT8 NOT NULL, phySpace INT8 NOT NULL, phySpaceExceed INT8 NOT NULL, phySpaceSoft INT8 NOT NULL, phySpaceHard INT8 NOT NULL, phyNum INT8 NOT NULL, phyNumExceed INT8 NOT NULL, phyNumSoft INT8 NOT NULL, phyNumHard INT8 NOT NULL ); gfarm-2.4.1/gftool/config-gfarm/slapd.conf-2.1.in0000644000000000000000000000267511507222717020034 0ustar rootroot# # See slapd.conf(5) for details on configuration options. # This file should NOT be world readable. # include @config_gfarm_openldap_etc@/schema/core.schema include @config_gfarm_ldap_schema@ pidfile @config_gfarm_run_dir@/gfarm-slapd.pid argsfile @config_gfarm_run_dir@/gfarm-slapd.args # disable anonymous access disallow bind_anon require LDAPv3 authc # unlimit search result sizelimit unlimited # disable syslog loglevel 0 @config_gfarm_slapd_config_hook@ ####################################################################### # database definitions ####################################################################### database @config_gfarm_slapd_database@ suffix "@config_gfarm_ldap_base_dn@" rootdn "@config_gfarm_backend_admin_user@" rootpw @config_gfarm_backend_admin_password@ directory @config_gfarm_backend_data_dir@ access to dn="@config_gfarm_backend_user@" attrs=userPassword by * auth access to dn.children="@config_gfarm_ldap_base_dn@" by users write # to allow to "add"/"delete" entries (not only "modify") access to dn="@config_gfarm_ldap_base_dn@" attrs=children by users write # to make the gfarm_ldap_sanity() function happy access to dn="@config_gfarm_ldap_base_dn@" by users read # Indices to maintain index objectClass eq index hostname pres,eq index hostaliases pres,eq index username pres,eq index groupname pres,eq index groupusers pres,eq index inumber pres,eq index entryName pres,eq index attrname pres,eq gfarm-2.4.1/gftool/config-gfarm/slapd.conf-2.0.in0000644000000000000000000000240011507222717020015 0ustar rootroot# # See slapd.conf(5) for details on configuration options. # This file should NOT be world readable. # include @config_gfarm_openldap_etc@/schema/core.schema include @config_gfarm_ldap_schema@ pidfile @config_gfarm_run_dir@/gfarm-slapd.pid argsfile @config_gfarm_run_dir@/gfarm-slapd.args # disable anonymous access defaultaccess none disallow bind_anon require LDAPv3 authc # unlimit search result sizelimit 2000000000 # disable syslog loglevel 0 @config_gfarm_slapd_config_hook@ ####################################################################### # database definitions ####################################################################### database @config_gfarm_slapd_database@ suffix "@config_gfarm_ldap_base_dn@" rootdn "@config_gfarm_backend_admin_user@" rootpw @config_gfarm_backend_admin_password@ directory @config_gfarm_backend_data_dir@ access to dn="@config_gfarm_backend_user@" attrs=userPassword by * auth access to dn="(.*,)?@config_gfarm_ldap_base_dn@" by users write # Indices to maintain index objectClass eq index hostname pres,eq index hostaliases pres,eq index username pres,eq index groupname pres,eq index groupusers pres,eq index inumber pres,eq index entryName pres,eq index attrname pres,eq # dangerous, but faster dbnosync gfarm-2.4.1/gftool/config-gfarm/config-gfsd.in0000644000000000000000000002016311507222717017665 0ustar rootroot#!/bin/sh # # $Id: config-gfsd.in 4180 2009-06-16 13:02:41Z tatebe $ PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/pkg/bin:/usr/pkg/sbin:/usr/local/bin:/usr/local/sbin:$PATH export PATH ${DEBUG:="false"} && set -xu # Gfarm installation directory prefix="@prefix@" sysconfdir="@sysconfdir@" config_dir="@datadir@/gfarm/config" globus_location="@globus_location@" spool_owner=_gfarmfs PROGNAME=`basename $0` # # check whether shell function does work or not. # BOURNE_SHELL="${BOURNE_SHELL-/bin/sh}" if [ x"$1" = x--re-invoked ]; then # shell function works with this shell, remove --re-invoked option shift elif "$BOURNE_SHELL" -c 'shellfunc() { exit 0; }; shellfunc' 2>/dev/null; then # shell function works : else # Search other shell that supports shell functions for sh in ksh bash zsh sh ash bsh sh5; do set `IFS=:; P="/bin:/usr/5bin:/usr/bin:/usr/local/bin:/usr/pkg/bin:$PATH"; echo $P` for dir do shell="$dir/$sh" if ( [ -f "$shell" ] || [ -f "$shell.exe" ] ) && "$shell" -c 'shellfunc() { exit 0; }; shellfunc' 2>/dev/null then BOURNE_SHELL="$shell" exec "$shell" "$0" \ --re-invoked ${1+"$@"} fi done done echo "$PROGNAME: cannot find a shell which supports functions" >&2 exit 1 fi usage() { echo >&2 "usage: $PROGNAME [--help] [--prefix prefix] [-t] [-f]" echo >&2 " [-a arch] [-p port] [-h hostname] [-n ncpu] " echo >&2 " [-l listen_address] [-S] [-N] spool_directory" exit 1 } ABORT() { [ $# -gt 0 ] && echo >&2 "${PROGNAME}: $@" echo >&2 "$PROGNAME failure" exit 1 } sanity() { rv=0 if [ ! -x "$prefix/bin/gfhost" ]; then echo "ERROR: command not found: $prefix/bin/gfhost" >&2 rv=1 fi case $SPOOL_DIRECTORY in /*) :;; *) echo "ERROR: spool directory ($SPOOL_DIRECTORY) must be absolute path" rv=1;; esac return $rv } display_params() { echo "prefix [--prefix]: $CONFIG_PREFIX" echo "hostname [-h]: $GFSD_HOSTNAME" echo "listen address [-l]: `if [ x$LISTEN_ADDRESS != x ]; then echo $LISTEN_ADDRESS; else echo '(all local IP addresses)'; fi`" echo "architecture [-a]: $ARCH" echo "port [-p]: $GFSD_PORT" echo "ncpu [-n]: $NCPU" echo "spool directory : $SPOOL_DIRECTORY" echo "rc script name : $RC_DIR/$RC_NAME" sanity exit 0 } while [ $# -gt 0 ] ; do case $1 in # set parameters --prefix) shift; [ $# -ge 1 ] || usage CONFIG_PREFIX=$1 ;; -a) shift; [ $# -ge 1 ] || usage ARCH=$1 ;; -p) shift; [ $# -ge 1 ] || usage GFSD_PORT=$1 ;; -h) shift; [ $# -ge 1 ] || usage GFSD_HOSTNAME=$1 ;; -l) shift; [ $# -ge 1 ] || usage LISTEN_ADDRESS=$1 ;; -n) shift; [ $# -ge 1 ] || usage NCPU=$1 ;; # control options --help) usage ;; -S) PRIVATE_MODE=true ;; -N) START_SERVICE=false ;; -f) FORCE=true ;; -t) DISPLAY_PARAMS=true ;; -*) usage ;; *) break ;; esac shift done case $# in 0) :;; # see below 1) SPOOL_DIRECTORY=$1;; *) usage;; esac . $prefix/share/gfarm/config/config-gfarm.sysdep # # default values # : ${CONFIG_PREFIX:=} # NOTE: $CONFIG_PREFIX needs to be set before calling sysdep_defaults # sysdep_defaults must set: $RC_DIR sysdep_defaults : ${PRIVATE_MODE:=false} : ${START_SERVICE:=true} : ${FORCE:=false} : ${DISPLAY_PARAMS:=false} : ${RUN_DIR:="$CONFIG_PREFIX/var/run"} if [ X"$CONFIG_PREFIX" != X ]; then : ${GFARM_CONF_DIR:="$CONFIG_PREFIX/etc"} else : ${GFARM_CONF_DIR:="$sysconfdir"} fi if $PRIVATE_MODE; then : ${GFARM_CONF:="$GFARM_CONF_DIR/gfsd.conf"} else : ${GFARM_CONF:="$GFARM_CONF_DIR/gfarm2.conf"} fi : ${GFARM_CLIENT_CONF:="$GFARM_CONF_DIR/gfarm2.conf"} : ${FQ_HOSTNAME:=`fq_hostname`} : ${GFSD_HOSTNAME:="$FQ_HOSTNAME"} [ X"$GFSD_HOSTNAME" = X ] && ABORT 'cannot determine gfsd hostname, please specify it by -h option' if $PRIVATE_MODE; then : ${GFSD_PORT:="10600"} else : ${GFSD_PORT:="600"} fi : ${NCPU:=`number_of_cpus`} [ X"$NCPU" = X ] && ABORT 'cannot determine number of CPUs' : ${ARCH:=`$prefix/bin/gfarm.arch.guess`} [ X"$ARCH" = X ] && ABORT 'cannot determine the architecture of this machine' : ${RC_GFSD_IN="$config_dir/gfsd.in"} : ${LISTEN_ADDRESS:=""} if [ -n "$LISTEN_ADDRESS" ]; then : ${SPOOL_DIRECTORY:="$CONFIG_PREFIX/var/gfarm-spool-$LISTEN_ADDRESS"} : ${GFSD_EXTRA_OPTIONS:=" -l $LISTEN_ADDRESS"} : ${RC_NAME:="gfsd-$LISTEN_ADDRESS"} # $RC_VAR will be used as a shell variable name on *BSD ports & pkgsrc, # thus, we only allow [0-9a-z_] as its value. : ${RC_VAR:="`echo gfsd_$LISTEN_ADDRESS | sed 's/[^0-9a-z_]/_/g'`"} else : ${SPOOL_DIRECTORY:="$CONFIG_PREFIX/var/gfarm-spool"} : ${GFSD_EXTRA_OPTIONS:=""} : ${RC_NAME:="gfsd"} : ${RC_VAR:="$RC_NAME"} fi # -t option; display parameters $DISPLAY_PARAMS && display_params sanity || ABORT "aborted" ######################################################################### config() { sed \ -e "s|@config_gfarm_prefix@|$prefix|g" \ -e "s|@config_gfarm_globus_location@|${GLOBUS_LOCATION:-$globus_location}|g" \ -e "s|@config_gfarm_gfarm_config@|$GFARM_CONF|g" \ -e "s|@config_gfarm_gfsd_option@|-f $GFARM_CONF -h $GFSD_HOSTNAME -r $SPOOL_DIRECTORY$GFSD_EXTRA_OPTIONS|g" \ -e "s|@config_gfarm_gfsd_rc_name@|$RC_NAME|g" \ -e "s|@config_gfarm_gfsd_rc_var@|$RC_VAR|g" \ -e "s|@config_gfarm_run_dir@|$RUN_DIR|g" \ ${1+"$@"} | config_sysdep } mkcnf() { # local out out=$1 shift if ${1+"$@"} >$out; then echo created $out else ABORT "cannot create $out" fi } mkscript() { mkcnf ${1+"$@"} chmod +x "$1" || ABORT "cannot chmod +x $1" } delete_file_or_directory() { # local p for p do [ -d "$p" ] && rmdir "$p" > /dev/null 2>&1 # [ -e "$p" ] isn't portable. not supported by Solaris /bin/sh if ls -1d "$p" >/dev/null 2>&1; then if $FORCE; then rm -rf "$p" echo removed "$p" else ABORT "$p already exist" fi fi done } create_directory() { # local d for d do [ -d "$d" ] && continue if mkdir -p "$d"; then echo created "$d" else ABORT "mkdir -p $d, failed" fi done } ######################################################################### [ -f $GFARM_CONF ] || ABORT "$GFARM_CONF: no such file" create_directory $RC_DIR $RUN_DIR # spool directory # delete_file_or_directory $SPOOL_DIRECTORY # XXX keep this create_directory $SPOOL_DIRECTORY [ X"`ls -ld $SPOOL_DIRECTORY | awk '{print $1}'`" = X"drwx------" ] || chmod 0700 $SPOOL_DIRECTORY || ABORT "chmod 0700 $SPOOL_DIRECTORY, failed" if [ `id -u` -eq 0 ]; then chown $spool_owner $SPOOL_DIRECTORY || ABORT "chown $spool_owner $SPOOL_DIRECTORY, failed. User '$spool_owner' is needed" fi mkcnf_gfsd_sysdep # create run scripts mkscript $RC_DIR/$RC_NAME config "$RC_GFSD_IN" if $PRIVATE_MODE; then # only private mode # update configuration file USERMAP_FILE="$GFARM_CONF_DIR/usermap" [ -f $USERMAP_FILE ] || ABORT "$USERMAP_FILE: no such file" grep -v "^local_user_map" $GFARM_CONF > $GFARM_CONF.tmp && echo local_user_map $USERMAP_FILE >> $GFARM_CONF.tmp && mv $GFARM_CONF.tmp $GFARM_CONF && echo $GFARM_CONF: updated || ABORT "$GFARM_CONF: cannot append local_user_map statements" # gfhost if [ -z "${GLOBUS_LOCATION-}" ] && [ -n "$globus_location" ] && [ -f "$globus_location/etc/globus-user-env.sh" ] then GLOBUS_LOCATION="$globus_location" export GLOBUS_LOCATION . "$GLOBUS_LOCATION/etc/globus-user-env.sh" fi if [ X"$CONFIG_PREFIX" != X ]; then GFARM_CONFIG_FILE="$GFARM_CLIENT_CONF" export GFARM_CONFIG_FILE fi if $FORCE; then "$prefix/bin/gfhost" -d $GFSD_HOSTNAME > /dev/null 2>&1 fi "$prefix/bin/gfhost" -c -a $ARCH -p $GFSD_PORT -n $NCPU $GFSD_HOSTNAME && echo gfhost $GFSD_HOSTNAME: succeeded || echo >&2 "gfhost -c -a $ARCH -p $GFSD_PORT -n $NCPU $GFSD_HOSTNAME: failed" if $START_SERVICE; then if [ -f $RUN_DIR/$RC_NAME.pid ]; then ctl=restart; else ctl=start; fi service_add $RC_NAME && service_ctl $RC_NAME $ctl || ABORT "failed to $ctl $RC_NAME" fi echo "$PROGNAME success" else # non private mode echo "$PROGNAME success" echo echo Please ask admin_user to register your host by the following command: echo echo "$prefix/bin/gfhost" -c -a $ARCH -p $GFSD_PORT -n $NCPU $GFSD_HOSTNAME echo echo After that, start gfsd by the following command as a root: echo # XXX FIXME should use "forcestart" instead of "start" on NetBSD and FreeBSD. echo "$RC_DIR/$RC_NAME start" fi exit 0 gfarm-2.4.1/gftool/gfmkdir/0000755000000000000000000000000011507222730014224 5ustar rootrootgfarm-2.4.1/gftool/gfmkdir/gfmkdir.c0000644000000000000000000000346111507222717016024 0ustar rootroot/* * $Id: gfmkdir.c 4952 2010-12-14 16:09:31Z tatebe $ */ #include #include #include #include #include char *program_name = "gfmkdir"; static void usage(void) { fprintf(stderr, "Usage: %s [-p] directory...\n", program_name); exit(1); } static gfarm_error_t gfs_mkdir_p(char *path, gfarm_mode_t mode, int option_parent) { gfarm_error_t e; struct gfs_stat sb; if (option_parent) { char *parent = gfarm_url_dir(path); if (parent == NULL) return (GFARM_ERR_NO_MEMORY); e = gfs_stat(parent, &sb); if (e == GFARM_ERR_NO_ERROR) gfs_stat_free(&sb); else if (e == GFARM_ERR_NO_SUCH_FILE_OR_DIRECTORY) e = gfs_mkdir_p(parent, mode, option_parent); free(parent); if (e != GFARM_ERR_NO_ERROR) return (e); } e = gfs_mkdir(path, mode); if (option_parent && e == GFARM_ERR_ALREADY_EXISTS) e = GFARM_ERR_NO_ERROR; return (e); } int main(int argc, char **argv) { gfarm_error_t e; int i, c, status = 0; int option_parent = 0; if (argc > 0) program_name = basename(argv[0]); e = gfarm_initialize(&argc, &argv); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", program_name, gfarm_error_string(e)); exit(1); } while ((c = getopt(argc, argv, "hp?")) != -1) { switch (c) { case 'p': option_parent = 1; break; case 'h': case '?': default: usage(); } } argc -= optind; argv += optind; if (argc <= 0) usage(); for (i = 0; i < argc; i++) { e = gfs_mkdir_p(argv[i], 0755, option_parent); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s: %s\n", program_name, argv[i], gfarm_error_string(e)); status = 1; } } e = gfarm_terminate(); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", program_name, gfarm_error_string(e)); status = 1; } return (status); } gfarm-2.4.1/gftool/gfmkdir/Makefile0000644000000000000000000000060311507222717015670 0ustar rootroot# $Id: Makefile 2612 2006-05-29 04:24:37Z soda $ top_builddir = ../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk PROGRAM = gfmkdir SRCS = $(PROGRAM).c OBJS = $(PROGRAM).o CFLAGS = $(COMMON_CFLAGS) LDLIBS = $(COMMON_LDLIBS) $(GFARMLIB) $(LIBS) DEPLIBS = $(DEPGFARMLIB) all: $(PROGRAM) include $(top_srcdir)/makes/prog.mk ### $(OBJS): $(DEPGFARMINC) gfarm-2.4.1/gftool/gfstatus/0000755000000000000000000000000011507222730014441 5ustar rootrootgfarm-2.4.1/gftool/gfstatus/Makefile0000644000000000000000000000100711507222717016104 0ustar rootroot# $Id: Makefile 3160 2006-08-30 16:53:21Z tatebe $ top_builddir = ../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk SRCS = gfstatus.c OBJS = gfstatus.o PROGRAM = gfstatus CFLAGS = $(COMMON_CFLAGS) -I$(GFARMLIB_SRCDIR) LDLIBS = $(COMMON_LDFLAGS) $(GFARMLIB) $(LIBS) DEPLIBS = $(DEPGFARMLIB) all: $(PROGRAM) include $(top_srcdir)/makes/prog.mk ### $(OBJS): $(DEPGFARMINC) $(GFARMLIB_SRCDIR)/config.h $(GFARMLIB_SRCDIR)/auth.h \ $(GFARMLIB_SRCDIR)/host.h $(GFARMLIB_SRCDIR)/gfpath.h gfarm-2.4.1/gftool/gfstatus/gfstatus.c0000644000000000000000000000550711507222717016461 0ustar rootroot/* * $Id$ */ #include #include #include #include "config.h" #include "auth.h" #include "host.h" #include "gfpath.h" #include "gfm_client.h" void error_check(char *msg, gfarm_error_t e) { if (e == GFARM_ERR_NO_ERROR) return; fprintf(stderr, "%s: %s\n", msg, gfarm_error_string(e)); exit(EXIT_FAILURE); } void print_msg(char *msg, char *status) { if (msg != NULL && status != NULL) printf("%s: %s\n", msg, status); } void print_user_config_file(char *msg) { static char gfarm_client_rc[] = GFARM_CLIENT_RC; char *rc; /* copied from gfarm_config_read() in config_client.c */ printf("%s: ", msg); rc = getenv("GFARM_CONFIG_FILE"); if (rc == NULL) printf("%s/%s\n", gfarm_get_local_homedir(), gfarm_client_rc); else printf("%s\n", rc); } int main(int argc, char *argv[]) { int port; char *name; gfarm_error_t e; /* XXX FIXME: this doesn't support multiple metadata server. */ struct gfm_connection *gfarm_metadb_server; #ifdef HAVE_GSI char *cred; #endif #if 0 char *arch; extern int gfarm_is_active_file_system_node; #endif e = gfarm_initialize(&argc, &argv); error_check("gfarm_initialize", e); if ((e = gfm_client_connection_and_process_acquire( gfarm_metadb_server_name, gfarm_metadb_server_port, &gfarm_metadb_server)) != GFARM_ERR_NO_ERROR) { fprintf(stderr, "metadata server `%s', port %d: %s\n", gfarm_metadb_server_name, gfarm_metadb_server_port, gfarm_error_string(e)); exit (1); } print_user_config_file("user config file "); print_msg("system config file", gfarm_config_file); puts(""); print_msg("hostname ", gfarm_host_get_self_name()); e = gfm_host_get_canonical_self_name(gfarm_metadb_server, &name, &port); if (e == GFARM_ERR_NO_ERROR) printf("canonical hostname: %s:%d\n", name, port); else printf("canonical hostname: not available\n"); #if 0 e = gfarm_host_get_self_architecture(&arch); print_msg("architecture name ", e == GFARM_ERR_NO_ERROR ? arch : gfarm_error_string(e)); print_msg("active fs node ", gfarm_is_active_file_system_node ? "yes" : "no"); #endif puts(""); print_msg("global username", gfarm_get_global_username()); print_msg(" local username", gfarm_get_local_username()); print_msg(" local home dir", gfarm_get_local_homedir()); #ifdef HAVE_GSI cred = gfarm_gsi_client_cred_name(); print_msg("credential name", cred ? cred : "no credential"); #endif /* gfmd */ puts(""); print_msg("gfmd server name", gfarm_metadb_server_name); printf("gfmd server port: %d\n", gfarm_metadb_server_port); print_msg("gfmd admin user", gfarm_metadb_admin_user); print_msg("gfmd admin dn ", gfarm_metadb_admin_user_gsi_dn); /* XXX FIXME: this doesn't support multiple metadata server. */ gfm_client_connection_free(gfarm_metadb_server); e = gfarm_terminate(); error_check("gfarm_terminate", e); exit(0); } gfarm-2.4.1/gftool/gfexport/0000755000000000000000000000000011507222730014437 5ustar rootrootgfarm-2.4.1/gftool/gfexport/gfexport.c0000644000000000000000000000463411507222717016455 0ustar rootroot#include #include #include #include #include #include "gfs_profile.h" #include "host.h" #include "config.h" /* XXX FIXME: INTERNAL FUNCTION SHOULD NOT BE USED */ #include #include "gfs_pio.h" char *program_name = "gfexport"; /* from GFS_FILE_BUFSIZE in lib/libgfarm/gfarm/gfs_pio.h */ #define BUFFER_SIZE (1048576 - 8) static char buffer[BUFFER_SIZE]; gfarm_error_t gfprint(GFS_File gf, FILE *ofp) { gfarm_error_t e; int n; while ((e = gfs_pio_read(gf, buffer, sizeof buffer, &n)) == GFARM_ERR_NO_ERROR) { if (n == 0) /* EOF */ break; if (fwrite(buffer, 1, n, ofp) != n) { e = GFARM_ERR_INPUT_OUTPUT; break; } } return (e); } gfarm_error_t gfexport(char *gfarm_url, char *host, FILE *ofp) { gfarm_error_t e, e2; GFS_File gf; e = gfs_pio_open(gfarm_url, GFARM_FILE_RDONLY, &gf); if (e != GFARM_ERR_NO_ERROR) return (e); /* XXX FIXME: INTERNAL FUNCTION SHOULD NOT BE USED */ e = gfs_pio_internal_set_view_section(gf, host); if (e != GFARM_ERR_NO_ERROR) goto close; e = gfprint(gf, ofp); close: e2 = gfs_pio_close(gf); return (e != GFARM_ERR_NO_ERROR ? e : e2); } void usage() { fprintf(stderr, "Usage: %s [option] \n", program_name); fprintf(stderr, "option:\n"); fprintf(stderr, "\t-h \n"); fprintf(stderr, "\t%s\t%s\n", "-p", "turn on profiling"); exit(1); } int main(int argc, char *argv[]) { gfarm_error_t e; char *url, *hostname = NULL; int ch; if (argc > 0) program_name = basename(argv[0]); e = gfarm_initialize(&argc, &argv); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: gfarm_initialize(): %s\n", program_name, gfarm_error_string(e)); exit(1); } while ((ch = getopt(argc, argv, "h:p?")) != -1) { switch (ch) { case 'h': hostname = optarg; break; case 'p': gfs_profile_set(); break; case '?': default: usage(); } } argc -= optind; argv += optind; if (argc != 1) { fprintf(stderr, "%s: %s\n", program_name, "error: only one input file name expected"); usage(); } url = argv[0]; e = gfexport(url, hostname, stdout); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s: %s\n", program_name, url, gfarm_error_string(e)); exit(1); } e = gfarm_terminate(); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: gfarm_terminate(): %s\n", program_name, gfarm_error_string(e)); exit(1); } return (0); } gfarm-2.4.1/gftool/gfexport/Makefile0000644000000000000000000000104011507222717016077 0ustar rootroot# $Id: Makefile 4621 2010-04-05 01:55:59Z tatebe $ top_builddir = ../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk SRCS = gfexport.c OBJS = gfexport.o PROGRAM = gfexport CFLAGS = $(COMMON_CFLAGS) -I$(GFARMLIB_SRCDIR) $(openssl_includes) LDLIBS = $(COMMON_LDFLAGS) $(GFARMLIB) $(LIBS) DEPLIBS = $(DEPGFARMLIB) all: $(PROGRAM) include $(top_srcdir)/makes/prog.mk ### $(OBJS): $(DEPGFARMINC) $(GFARMLIB_SRCDIR)/gfs_profile.h $(GFARMLIB_SRCDIR)/host.h $(GFARMLIB_SRCDIR)/config.h $(GFARMLIB_SRCDIR)/gfs_pio.h gfarm-2.4.1/gftool/gfsck/0000755000000000000000000000000011507222730013676 5ustar rootrootgfarm-2.4.1/gftool/gfsck/Makefile0000644000000000000000000000062611507222717015347 0ustar rootroot# $Id: Makefile 2373 2006-01-12 00:54:22Z soda $ top_builddir = ../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk PROGRAM = gfsck SRCS = $(PROGRAM).c OBJS = $(PROGRAM).o CFLAGS = $(COMMON_CFLAGS) -I$(GFARMLIB_SRCDIR) LDLIBS = $(COMMON_LDLIBS) $(GFARMLIB) $(LIBS) DEPLIBS = $(DEPGFARMLIB) all: $(PROGRAM) include $(top_srcdir)/makes/prog.mk ### $(OBJS): $(DEPGFARMINC) gfarm-2.4.1/gftool/gfsck/gfsck.c0000644000000000000000000001660311507222717015152 0ustar rootroot/* * $Id: gfsck.c 3617 2007-03-12 08:32:55Z n-soda $ */ #include #include #include #include #include #include #include static int option_force; static int option_verbose; static char GFARM_MSG_DELETED[] = "deleted"; static char * path_info_remove(char *url, char *canonical_path, char *errmsg) { char *e, *c_path = NULL; FILE *out = stdout; if (canonical_path == NULL) { e = gfarm_url_make_path(url, &c_path); if (e != NULL) return (e); canonical_path = c_path; } e = gfarm_path_info_remove(canonical_path); if (e == NULL) e = GFARM_MSG_DELETED; else out = stderr; fprintf(out, "%s: %s: %s\n", url, errmsg, e); if (c_path != NULL) free(c_path); return (e == GFARM_MSG_DELETED ? NULL : e); } static char * section_info_remove(char *url, char *gfarm_file, char *section, char *errmsg) { char *e = gfarm_file_section_info_remove(gfarm_file, section); FILE *out = stdout; if (e == NULL) e = GFARM_MSG_DELETED; else out = stderr; fprintf(out, "%s (%s): %s: %s\n", url, section, errmsg, e); return (e == GFARM_MSG_DELETED ? NULL : e); } static char * section_copy_info_remove( char *url, char *pathname, char *section, char *host, char *errmsg) { char *e = gfarm_file_section_copy_info_remove(pathname, section, host); FILE *out = stdout; if (e == NULL) e = GFARM_MSG_DELETED; else out = stderr; fprintf(out, "%s (%s) on %s: %s: %s\n", url, section, host, errmsg, e); return (e == GFARM_MSG_DELETED ? NULL : e); } static char * gfsck_file(char *gfarm_url) { char *gfarm_file, *e, *e_save = NULL; int i, nsections, valid_nsections = 0; struct gfarm_file_section_info *sections; GFS_File gf; e = gfarm_url_make_path(gfarm_url, &gfarm_file); if (e != NULL) return (e); e = gfarm_file_section_info_get_all_by_file( gfarm_file, &nsections, §ions); if (e != NULL) { /* no section info, remove path info */ e = path_info_remove(gfarm_url, gfarm_file, e); free(gfarm_file); return (e); } e = gfs_pio_open(gfarm_url, GFARM_FILE_RDONLY, &gf); if (e != NULL) { free(gfarm_file); return (e); } for (i = 0; i < nsections; i++) { int j, ncopies, valid_ncopies = 0; struct gfarm_file_section_copy_info *copies; char *section = sections[i].section; e = gfarm_file_section_copy_info_get_all_by_section( gfarm_file, section, &ncopies, &copies); if (e == GFARM_ERR_NO_SUCH_OBJECT) { /* no section copy info, remove section info */ e = section_info_remove( gfarm_url, gfarm_file, section, e); if (e != NULL && e_save == NULL) e_save = e; continue; } else if (e != NULL) { fprintf(stderr, "%s (%s): %s\n", gfarm_url, section, e); if (e_save == NULL) e_save = e; continue; } for (j = 0; j < ncopies; ++j) { char *hostname = copies[j].hostname; if (option_verbose) printf("%s (%s) on %s\n", gfarm_url, section, hostname); e = gfs_pio_set_view_section(gf, section, hostname, GFARM_FILE_NOT_REPLICATE | GFARM_FILE_NOT_RETRY); if (e == GFARM_ERR_INCONSISTENT_RECOVERABLE) { /* invalid section copy info removed */ printf("%s (%s) on %s: " "invalid metadata deleted\n", gfarm_url, section, hostname); e = NULL; continue; } else if (option_force || e == GFARM_ERR_NO_ROUTE_TO_HOST || e == GFARM_ERR_NO_SUCH_OBJECT) { e = section_copy_info_remove(gfarm_url, gfarm_file, section, hostname, e); if (e != NULL && e_save == NULL) e_save = e; continue; } else if (e != NULL) { fprintf(stderr, "%s (%s) on %s: %s\n", gfarm_url, section, hostname, e); if (e_save == NULL) e_save = e; /* keep metadata */ } ++valid_ncopies; } gfarm_file_section_copy_info_free_all(ncopies, copies); if (valid_ncopies == 0) { /* no section copy info, remove section info */ e = section_info_remove(gfarm_url, gfarm_file, section, "no file replica"); if (e != NULL && e_save == NULL) e_save = e; } else ++valid_nsections; } if (valid_nsections == 0) { /* no section info, remove path info */ e = path_info_remove(gfarm_url, gfarm_file, GFARM_ERR_NO_FRAGMENT_INFORMATION); if (e != NULL && e_save == NULL) e_save = e; } else if (valid_nsections < nsections) { printf("%s: warning: number of file sections reduced\n", gfarm_url); } gfarm_file_section_info_free_all(nsections, sections); free(gfarm_file); e = gfs_pio_close(gf); if (e != NULL) return (e); return (e_save); } static char * gfsck_dir(char *gfarm_dir, char *file) { char *e, *gfarm_url; struct gfs_stat gsb; GFS_Dir gdir; struct gfs_dirent *gdent; GFARM_MALLOC_ARRAY(gfarm_url, strlen(gfarm_dir) + strlen(file) + 2); if (gfarm_url == NULL) return (GFARM_ERR_NO_MEMORY); if (gfarm_dir[0] == '\0') sprintf(gfarm_url, "%s", file); else if (strcmp(gfarm_dir, GFARM_URL_PREFIX) == 0) sprintf(gfarm_url, "%s%s", gfarm_dir, file); else sprintf(gfarm_url, "%s/%s", gfarm_dir, file); e = gfs_stat(gfarm_url, &gsb); if (e != NULL) { if (e == GFARM_ERR_NO_FRAGMENT_INFORMATION) { /* no fragment information, remove path info */ e = path_info_remove(gfarm_url, NULL, e); } free(gfarm_url); return (e); } if (GFARM_S_ISREG(gsb.st_mode)) { gfs_stat_free(&gsb); e = gfsck_file(gfarm_url); free(gfarm_url); return (e); } if (!GFARM_S_ISDIR(gsb.st_mode)) { gfs_stat_free(&gsb); free(gfarm_url); return ("unknown file type"); } gfs_stat_free(&gsb); e = gfs_opendir(gfarm_url, &gdir); if (e != NULL) { free(gfarm_url); return (e); } while ((e = gfs_readdir(gdir, &gdent)) == NULL && gdent != NULL) { if (gdent->d_name[0] == '.' && (gdent->d_name[1] == '\0' || (gdent->d_name[1] == '.' && gdent->d_name[2] == '\0'))) continue; /* "." or ".." */ e = gfsck_dir(gfarm_url, gdent->d_name); if (e != NULL) { fprintf(stderr, "%s%s%s: %s\n", gfarm_url, strcmp(gfarm_url, GFARM_URL_PREFIX) == 0 ? "" : "/", gdent->d_name, e); /* it is not necessary to save error */ } } (void)gfs_closedir(gdir); free(gfarm_url); return (NULL); } char *program_name = "gfsck"; static void usage() { fprintf(stderr, "Usage: %s [-fhv] path ...\n", program_name); exit(1); } int main(int argc, char *argv[]) { extern int optind; int c, i, error = 0; gfarm_stringlist paths; gfs_glob_t types; char *e; if (argc <= 1) usage(); program_name = basename(argv[0]); while ((c = getopt(argc, argv, "fhv?")) != EOF) { switch (c) { case 'f': option_force = 1; break; case 'v': option_verbose = 1; break; case 'h': case '?': default: usage(); } } argc -= optind; argv += optind; e = gfarm_initialize(&argc, &argv); if (e != NULL) { fprintf(stderr, "%s: %s\n", program_name, e); exit(1); } e = gfarm_stringlist_init(&paths); if (e != NULL) { fprintf(stderr, "%s: %s\n", program_name, e); exit(EXIT_FAILURE); } e = gfs_glob_init(&types); if (e != NULL) { fprintf(stderr, "%s: %s\n", program_name, e); exit(EXIT_FAILURE); } for (i = 0; i < argc; i++) gfs_glob(argv[i], &paths, &types); for (i = 0; i < gfarm_stringlist_length(&paths); i++) { char *url = gfarm_stringlist_elem(&paths, i); e = gfsck_dir("", url); if (e != NULL) { fprintf(stderr, "%s: %s\n", url, e); error = 1; } } gfs_glob_free(&types); gfarm_stringlist_free_deeply(&paths); e = gfarm_terminate(); if (e != NULL) { fprintf(stderr, "%s: %s\n", program_name, e); exit(1); } exit(error); } gfarm-2.4.1/gftool/gfsetdir/0000755000000000000000000000000011507222730014410 5ustar rootrootgfarm-2.4.1/gftool/gfsetdir/gfsetdir.c0000644000000000000000000000451511507222717016375 0ustar rootroot/* * $Id: gfsetdir.c 1104 2004-04-14 19:37:55Z soda $ */ #include #include #include #include #include #include #include #include #include char *program_name = "gfsetdir"; void usage() { fprintf(stderr, "Usage: %s [-s|-c] [directory]\n", program_name); fprintf(stderr, "\t-c\t output string for *csh\n"); fprintf(stderr, "\t-s\t otherwise\n"); exit(1); } int main(int argc, char **argv) { struct gfs_stat gstat; char *e, *nwdir, *gfarm_path; extern int optind; int ch; enum { UNDECIDED, B_SHELL_LIKE, C_SHELL_LIKE } shell_type = UNDECIDED; if (argc > 0) program_name = basename(argv[0]); e = gfarm_initialize(&argc, &argv); if (e != NULL) { fprintf(stderr, "%s: %s\n", program_name, e); exit(1); } while ((ch = getopt(argc, argv, "sc")) != -1) { switch (ch) { case 's': shell_type = B_SHELL_LIKE; break; case 'c': shell_type = C_SHELL_LIKE; break; default: usage(); } } argc -= optind; argv += optind; /* * Get absolute path from the argument directory name. * If no arugument is passed, generate gfarm:/"global username". */ nwdir = "gfarm:~"; /* home directory */ switch (argc) { case 0: break; case 1: nwdir = argv[0]; break; default: usage(); } /* check whether it is a directory or not. */ e = gfs_stat(nwdir, &gstat); if (e != NULL) { fprintf(stderr, "%s: %s\n", nwdir, e); exit(1); } if (!GFARM_S_ISDIR(gstat.st_mode)) { fprintf(stderr, "%s: not a directory\n", nwdir); gfs_stat_free(&gstat); exit(1); } gfs_stat_free(&gstat); /* expand the path name */ e = gfs_realpath(nwdir, &gfarm_path); if (e != NULL) { fprintf(stderr, "%s: %s\n", nwdir, e); exit(1); } if (shell_type == UNDECIDED) { char *shell = getenv("SHELL"); int shell_len = strlen(shell); if (shell_len < 3 || memcmp(shell + shell_len - 3, "csh", 3) != 0) shell_type = B_SHELL_LIKE; else shell_type = C_SHELL_LIKE; } if (shell_type == B_SHELL_LIKE) printf("GFS_PWD=%s; export GFS_PWD\n", gfarm_path); else printf("setenv GFS_PWD %s\n", gfarm_path); fflush(stdout); free(gfarm_path); e = gfarm_terminate(); if (e != NULL) { fprintf(stderr, "%s: %s\n", program_name, e); exit(1); } return (0); } gfarm-2.4.1/gftool/gfsetdir/Makefile0000644000000000000000000000062511507222717016060 0ustar rootroot# $Id: Makefile 2373 2006-01-12 00:54:22Z soda $ top_builddir = ../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk SRCS = gfsetdir.c OBJS = gfsetdir.o PROGRAM = gfsetdir CFLAGS = $(COMMON_CFLAGS) -I$(GFARMLIB_SRCDIR) LDLIBS = $(COMMON_LDLIBS) $(GFARMLIB) $(LIBS) DEPLIBS = $(DEPGFARMLIB) all: $(PROGRAM) include $(top_srcdir)/makes/prog.mk ### $(OBJS): $(DEPGFARMINC) gfarm-2.4.1/gftool/gfsched/0000755000000000000000000000000011507222730014204 5ustar rootrootgfarm-2.4.1/gftool/gfsched/gfsched.c0000644000000000000000000001244511507222717015766 0ustar rootroot/* * $Id: gfsched.c 4991 2010-12-28 06:41:46Z n-soda $ */ #include #include #include #include #include #include #include #include #include "gfm_client.h" #include "gfm_schedule.h" #include "schedule.h" /* * Create a hostfile. * * gfsched [-P ] [-D ] [-n ] [-LMlw] * gfsched -f [-D ] [-n ] [-LMclw] */ char *program_name = "gfsched"; void usage(void) { fprintf(stderr, "Usage:\t%s [-P ] [-D ] [-n ] [-LMlw]\n", program_name); fprintf(stderr, "\t%s -f [-D ] [-n ] [-LMclw]\n", program_name); fprintf(stderr, "options:\n"); fprintf(stderr, "\t-L\t\tdo not check authentication\n"); fprintf(stderr, "\t-M\t\tmetadata only. suppress client side scheduling\n"); fprintf(stderr, "\t-c\t\tcreate mode (currently leaves a file)\n"); fprintf(stderr, "\t-l\t\twrite mode\n"); fprintf(stderr, "\t-w\t\tlong format\n"); exit(2); } long parse_opt_long(char *option, int option_char, char *argument_name) { long value; char *s; errno = 0; value = strtol(option, &s, 0); if (s == option) { fprintf(stderr, "%s: missing %s after -%c\n", program_name, argument_name, option_char); usage(); } else if (*s != '\0') { fprintf(stderr, "%s: garbage in -%c %s\n", program_name, option_char, option); usage(); } else if (errno != 0 && (value == LONG_MIN || value == LONG_MAX)) { fprintf(stderr, "%s: %s with -%c %s\n", program_name, strerror(errno), option_char, option); usage(); } return (value); } int main(int argc, char **argv) { gfarm_error_t e; char *opt_domain = ""; char *opt_mount_point = NULL; char *opt_file = NULL; int opt_metadata_only = 0; int opt_long_format = 0; int opt_nhosts = 0; int opt_write_mode = 0; int opt_create_mode = 0; int c, i, available_nhosts, nhosts, *ports; struct gfarm_host_sched_info *available_hosts; char *path, **hosts; if (argc >= 1) program_name = basename(argv[0]); e = gfarm_initialize(&argc, &argv); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", program_name, gfarm_error_string(e)); exit(1); } while ((c = getopt(argc, argv, "D:LMP:cf:ln:w")) != -1) { switch (c) { case 'D': opt_domain = optarg; break; case 'L': gfarm_schedule_search_mode_use_loadavg(); break; case 'M': opt_metadata_only = 1; break; case 'P': opt_mount_point = optarg; break; case 'c': opt_create_mode = 1; break; case 'f': opt_file = optarg; break; case 'l': opt_long_format = 1; break; case 'n': opt_nhosts = parse_opt_long(optarg, c, ""); if (opt_nhosts <= 0) { fprintf(stderr, "%s: invalid value: -%c %d\n", program_name, c, opt_nhosts); usage(); } break; case 'w': opt_write_mode = 1; break; default: usage(); } } argc -= optind; argv += optind; if (argc != 0) usage(); if (opt_mount_point != NULL && opt_file != NULL) { fprintf(stderr, "%s: -P and -f option cannot be specified at once.\n", program_name); usage(); } if (opt_file != NULL) { path = opt_file; if (opt_create_mode) { GFS_File gf; e = gfs_pio_create(path, GFARM_FILE_WRONLY, 0666, &gf); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: creating \"%s\": %s\n", program_name, path, gfarm_error_string(e)); exit(1); } e = gfs_pio_close(gf); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: gfs_pio_close(\"%s\"): %s\n", program_name, path, gfarm_error_string(e)); /* exit(1); */ } /* NOTE: this may leave an empty file with ncopy==0 */ } e = gfarm_schedule_hosts_domain_by_file(path, opt_write_mode ? GFARM_FILE_RDWR : GFARM_FILE_RDONLY, opt_domain, &available_nhosts, &available_hosts); } else { path = opt_mount_point == NULL ? "/" : opt_mount_point; e = gfarm_schedule_hosts_domain_all(path, opt_domain, &available_nhosts, &available_hosts); } if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: metadata scheduling: %s\n", program_name, gfarm_error_string(e)); exit(1); } nhosts = opt_nhosts > 0 ? opt_nhosts : available_nhosts; GFARM_MALLOC_ARRAY(hosts, nhosts); GFARM_MALLOC_ARRAY(ports, nhosts); if (hosts == NULL || ports == NULL) { fprintf(stderr, "%s: cannot allocate memory for %d hosts.\n", program_name, nhosts); exit(1); } if (opt_metadata_only) { if (nhosts > available_nhosts) nhosts = available_nhosts; for (i = 0; i < nhosts; i++) { hosts[i] = available_hosts[i].host; ports[i] = available_hosts[i].port; } } else if (opt_write_mode) { e = gfarm_schedule_hosts_acyclic_to_write(path, available_nhosts, available_hosts, &nhosts, hosts, ports); } else { e = gfarm_schedule_hosts_acyclic(path, available_nhosts, available_hosts, &nhosts, hosts, ports); } if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: client side scheduling: %s\n", program_name, gfarm_error_string(e)); exit(1); } for (i = 0; i < nhosts; i++) { printf("%s", hosts[i]); if (opt_long_format) printf("\t%d", ports[i]); putchar('\n'); } e = gfarm_terminate(); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", program_name, gfarm_error_string(e)); exit(1); } exit(0); } gfarm-2.4.1/gftool/gfsched/Makefile0000644000000000000000000000077611507222717015663 0ustar rootroot# $Id: Makefile 4799 2010-06-28 03:45:31Z n-soda $ top_builddir = ../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk SRCS = gfsched.c OBJS = gfsched.o PROGRAM = gfsched CFLAGS = $(COMMON_CFLAGS) -I$(GFARMLIB_SRCDIR) LDLIBS = $(COMMON_LDFLAGS) $(GFARMLIB) $(LIBS) DEPLIBS = $(DEPGFARMLIB) all: $(PROGRAM) include $(top_srcdir)/makes/prog.mk ### $(OBJS): $(DEPGFARMINC) \ $(GFARMLIB_SRCDIR)/gfm_client.h \ $(GFARMLIB_SRCDIR)/gfm_schedule.h \ $(GFARMLIB_SRCDIR)/schedule.h gfarm-2.4.1/gftool/gfmpirun/0000755000000000000000000000000011507222730014430 5ustar rootrootgfarm-2.4.1/gftool/gfmpirun/gfmpirun.c0000644000000000000000000002211011507222717016424 0ustar rootroot/* * $Id: gfmpirun.c 3617 2007-03-12 08:32:55Z n-soda $ */ #include #include #include #include #include #include #include #include #include #include #include #include "host.h" #include "config.h" #include "gfj_client.h" char *program_name = "gfmpirun_p4"; void setsig(int signum, void (*handler)(int)) { struct sigaction act; act.sa_handler = handler; sigemptyset(&act.sa_mask); /* do not set SA_RESTART to make interrupt at waitpid(2) */ act.sa_flags = 0; if (sigaction(signum, &act, NULL) == -1) { fprintf(stderr, "%s: sigaction(%d): %s\n", program_name, signum, strerror(errno)); exit(1); } } void ignore_handler(int signum) { /* do nothing */ } void sig_ignore(int signum) { /* we don't use SIG_IGN to make it possible that child catch singals */ setsig(signum, ignore_handler); } void usage() { fprintf(stderr, "Usage: %s [-G |-N <# nodes>|-H ]\n", program_name); fprintf(stderr, "\t[] command...\n"); exit(1); } int main(argc, argv) int argc; char **argv; { gfarm_stringlist input_list, output_list, arg_list, option_list; int command_index; int status; int i, nhosts, job_id, nfrags, save_errno; char *e, **hosts; static char template[] = "/tmp/mpXXXXXX"; char filename[sizeof(template)]; FILE *fp; char total_nodes[GFARM_INT32STRLEN]; int nprocs = -1, sched_nopt = 0, spooled_command = 0; char *hostfile = NULL, *scheduling_file = NULL; char *command_name, **delivered_paths = NULL; if (argc >= 1) program_name = basename(argv[0]); e = gfarm_initialize(&argc, &argv); if (e != NULL) { fprintf(stderr, "%s: gfarm initialize: %s\n", program_name, e); exit(1); } e = gfj_initialize(); if (e != NULL) { fprintf(stderr, "%s: job manager: %s\n", program_name, e); exit(1); } gfarm_stringlist_init(&option_list); /* * parse and skip/record options */ for (i = 1; i < argc; i++) { if (argv[i][0] != '-') break; switch (argv[i][1]) { case 'G': if (argv[i][2] != '\0') { scheduling_file = &argv[i][2]; } else if (++i < argc) { scheduling_file = argv[i]; } else { fprintf(stderr, "%s: " "missing argument to %s\n", program_name, argv[i - 1]); usage(); } ++sched_nopt; goto skip_opt; case 'N': if (argv[i][2] != '\0') { nprocs = atoi(&argv[i][2]); } else if (++i < argc) { nprocs = atoi(argv[i]); } else { fprintf(stderr, "%s: " "missing argument to %s\n", program_name, argv[i - 1]); usage(); } ++sched_nopt; goto skip_opt; case 'H': if (argv[i][2] != '\0') { hostfile = &argv[i][2]; } else if (++i < argc) { hostfile = argv[i]; } else { fprintf(stderr, "%s: " "missing argument to %s\n", program_name, argv[i - 1]); usage(); } ++sched_nopt; goto skip_opt; } if (strcmp(argv[i], "-arch") == 0 || strcmp(argv[i], "-np") == 0 || strcmp(argv[i], "-stdin") == 0 || strcmp(argv[i], "-stdout") == 0 || strcmp(argv[i], "-stderr") == 0 || strcmp(argv[i], "-nexuspg") == 0 || strcmp(argv[i], "-nexusdb") == 0 || strcmp(argv[i], "-p4pg") == 0 || strcmp(argv[i], "-tcppg") == 0 || strcmp(argv[i], "-p4ssport") == 0 || strcmp(argv[i], "-mvback") == 0 || strcmp(argv[i], "-maxtime") == 0 || strcmp(argv[i], "-mem") == 0 || strcmp(argv[i], "-cpu") == 0) { /* an option which does have an argument */ if (++i >= argc) { fprintf(stderr, "%s: " "missing argument to %s\n", program_name, argv[i - 1]); usage(); } gfarm_stringlist_add(&option_list, argv[i - 1]); } gfarm_stringlist_add(&option_list, argv[i]); skip_opt: ; } if (sched_nopt > 1) usage(); command_index = i; if (command_index >= argc) /* no command name */ usage(); command_name = argv[command_index]; spooled_command = gfarm_is_url(command_name); gfarm_stringlist_init(&input_list); gfarm_stringlist_init(&output_list); for (i = command_index + 1; i < argc; i++) { if (gfarm_is_url(argv[i])) { e = gfarm_url_fragment_number(argv[i], &nfrags); if (e == NULL) { gfarm_stringlist_add(&input_list, argv[i]); } else { gfarm_stringlist_add(&output_list, argv[i]); } } } /* schedule nodes */ if (hostfile != NULL) { int error_line; e = gfarm_hostlist_read(hostfile, &nhosts, &hosts, &error_line); if (e != NULL) { if (error_line != -1) fprintf(stderr, "%s: %s: line %d: %s\n", program_name, hostfile, error_line, e); else fprintf(stderr, "%s: %s: %s\n", program_name, hostfile, e); exit(1); } scheduling_file = hostfile; } else if (nprocs > 0) { nhosts = nprocs; GFARM_MALLOC_ARRAY(hosts, nhosts); if (hosts == NULL) { fprintf(stderr, "%s: not enough memory for %d hosts", program_name, nhosts); exit(1); } if (spooled_command) e = gfarm_schedule_search_idle_by_program( command_name, nhosts, hosts); else e = gfarm_schedule_search_idle_by_all(nhosts, hosts); if (e != NULL) { fprintf(stderr, "%s: scheduling %d nodes: %s\n", program_name, nprocs, e); exit(1); } scheduling_file = ""; } else if (scheduling_file != NULL || gfarm_stringlist_length(&input_list) != 0) { /* file-affinity scheduling */ if (scheduling_file == NULL) scheduling_file = gfarm_stringlist_elem( &input_list, 0); if (spooled_command) e = gfarm_url_hosts_schedule_by_program( scheduling_file, command_name, NULL, &nhosts, &hosts); else e = gfarm_url_hosts_schedule(scheduling_file, NULL, &nhosts, &hosts); if (e != NULL) { fprintf(stderr, "%s: scheduling by %s: %s\n", program_name, scheduling_file, e); exit(1); } } else { fprintf(stderr, "%s: no way to schedule nodes\n", program_name); exit(1); } /* create a machine file */ fp = fdopen(mkstemp(strcpy(filename, template)), "w"); if (fp == NULL) { fprintf(stderr, "%s: cannot create tempfile \"%s\"\n", program_name, filename); exit(1); } for (i = 0; i < nhosts; i++) { char *if_hostname; struct sockaddr peer_addr; /* reflect "address_use" directive in the `if_hostname' */ e = gfarm_host_address_get(hosts[i], gfarm_spool_server_port, &peer_addr, &if_hostname); if (e != NULL) { fprintf(fp, "%s\n", hosts[i]); } else { fprintf(fp, "%s\n", if_hostname); free(if_hostname); } } fclose(fp); /* * register job manager */ e = gfarm_user_job_register(nhosts, hosts, program_name, scheduling_file, argc - command_index, &argv[command_index], &job_id); if (e != NULL) { fprintf(stderr, "%s: job register: %s\n", program_name, e); exit(1); } /* * deliver gfarm:program. */ if (gfarm_is_url(command_name)) { e = gfarm_url_program_deliver(command_name, nhosts, hosts, &delivered_paths); if (e != NULL) { fprintf(stderr, "%s: deliver %s: %s\n", program_name, command_name, e); exit(1); } } sprintf(total_nodes, "%d", nhosts); gfarm_stringlist_init(&arg_list); gfarm_stringlist_add(&arg_list, "mpirun"); #if 1 /* * without this option, the machine which is running gfmpirun_p4 * always becomes node 0. and total number of nodes becomes * ``1 + total_nodesprocesses'' because this host will be included * regardless whether machine file includes this host or not. * XXX - this option is only available on mpich/p4. */ gfarm_stringlist_add(&arg_list, "-nolocal"); #endif gfarm_stringlist_add(&arg_list, "-machinefile"); gfarm_stringlist_add(&arg_list, filename); gfarm_stringlist_add(&arg_list, "-np"); gfarm_stringlist_add(&arg_list, total_nodes); gfarm_stringlist_add_list(&arg_list, &option_list); if (delivered_paths == NULL) { gfarm_stringlist_add(&arg_list, command_name); } else { /* * XXX This assumes that all nodes are same architecture * XXX and all nodes have same gfarm_root! * XXX really broken. */ gfarm_stringlist_add(&arg_list, delivered_paths[0]); } gfarm_stringlist_cat(&arg_list, &argv[command_index + 1]); gfarm_stringlist_add(&arg_list, NULL); switch (fork()) { case 0: execvp("mpirun", GFARM_STRINGLIST_STRARRAY(arg_list)); perror("mpirun"); exit(1); case -1: perror("fork"); exit(1); } sig_ignore(SIGHUP); sig_ignore(SIGINT); sig_ignore(SIGQUIT); sig_ignore(SIGTERM); sig_ignore(SIGTSTP); while (waitpid(-1, &status, 0) != -1 || errno == EINTR) ; save_errno = errno; #if 0 /* XXX - temporary solution; it is not necessary for the output file to be the same number of fragments. */ for (i = 0; i < gfarm_stringlist_length(&output_list); i++) gfarm_url_fragment_cleanup( gfarm_stringlist_elem(&output_list, i), nhosts, hosts); #endif unlink(filename); if (delivered_paths != NULL) gfarm_strings_free_deeply(nhosts, delivered_paths); gfarm_strings_free_deeply(nhosts, hosts); gfarm_stringlist_free(&arg_list); gfarm_stringlist_free(&output_list); gfarm_stringlist_free(&input_list); gfarm_stringlist_free(&option_list); e = gfarm_terminate(); if (e != NULL) { fprintf(stderr, "%s: %s\n", program_name, e); exit(1); } return (save_errno != ECHILD ? 1 : WIFEXITED(status) ? WEXITSTATUS(status) : 1); } gfarm-2.4.1/gftool/gfmpirun/Makefile0000644000000000000000000000102011507222717016066 0ustar rootroot# $Id: Makefile 2373 2006-01-12 00:54:22Z soda $ top_builddir = ../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk SRCS = gfmpirun.c OBJS = gfmpirun.o PROGRAM = gfmpirun_p4 CFLAGS = $(COMMON_CFLAGS) -I$(GFARMLIB_SRCDIR) LDLIBS = $(COMMON_LDFLAGS) $(GFARMLIB) $(LIBS) DEPLIBS = $(DEPGFARMLIB) all: $(PROGRAM) include $(top_srcdir)/makes/prog.mk ### $(OBJS): $(DEPGFARMINC) $(OBJS): $(DEPGFARMINC) \ $(GFARMLIB_SRCDIR)/host.h \ $(GFARMLIB_SRCDIR)/config.h \ $(GFARMLIB_SRCDIR)/gfj_client.h gfarm-2.4.1/gftool/gfrcmd/0000755000000000000000000000000011507222730014043 5ustar rootrootgfarm-2.4.1/gftool/gfrcmd/gfrcmd.c0000644000000000000000000001524311507222717015463 0ustar rootroot#include #include #include #include #include #include #include #include #include #include #include #include #include #include "gfutil.h" #include "gfs_client.h" #include "auth.h" #include "config.h" char *program_name = "gfrcmd"; void usage() { fprintf(stderr, "Usage: %s [option] host command...\n", program_name); fprintf(stderr, "option:\n"); fprintf(stderr, "\t-n: disable standard input.\n"); fprintf(stderr, "\t-r: execute a remote command directly.\n"); fprintf(stderr, "\t-y: inherits the environment variable DISPLAY.\n"); fprintf(stderr, "\t-X: inherits the authentication info of the " "X Window System.\n"); #ifdef HAVE_GSI fprintf(stderr, "\t-N : " "use this name to authenticate peer.\n"); fprintf(stderr, "\t-v: display GSS minor status error.\n"); #endif exit(1); } char *opt_username; /* ignored for now */ int opt_no_stdin = 0; int opt_raw_command = 0; int opt_xdpy_env = 0; int opt_xauth_copy = 0; char *opt_hostname = NULL; int opt_auth_verbose = 0; void parse_option(int *argcp, char ***argvp) { int argc; char **argv, *s; argc = *argcp; argv = *argvp; for (; argc > 0 && argv[0][0] == '-'; argc--, argv++) { for (s = &argv[0][1]; *s; s++) { switch (*s) { case 'l': /* XXX: FIXME. `opt_username' isn't used yet */ if (s[1]) { opt_username = &s[1]; s += strlen(s) - 1; } else if (argc > 1) { opt_username = argv[1]; argc--, argv++; s = argv[0] + strlen(argv[0]) - 1; } else { usage(); } break; case 'n': opt_no_stdin = 1; break; case 'r': opt_raw_command = 1; break; case 'y': opt_xdpy_env = 1; break; case 'X': opt_xauth_copy = 1; break; case 'N': if (s[1]) { opt_hostname = &s[1]; s += strlen(s) - 1; } else if (argc > 1) { opt_hostname = argv[1]; argc--, argv++; s = argv[0] + strlen(argv[0]) - 1; } else { usage(); } break; case 'v': opt_auth_verbose = 1; break; case '?': default: usage(); } } } *argcp = argc; *argvp = argv; } char * concat(int argc, char **argv) { int i, len = 0; char *s; for (i = 0; i < argc; i++) len += strlen(argv[i]); len += argc + 1; GFARM_MALLOC_ARRAY(s, len); if (s == NULL) { fprintf(stderr, "%s: no memory\n", program_name); exit(1); } strcpy(s, argv[0]); for (i = 1; i < argc; i++) { strcat(s, " "); strcat(s, argv[i]); } return (s); } int passing_signals[] = { SIGINT, SIGQUIT, SIGTERM }; volatile int send_signal = 0; void record_signal(int sig) { send_signal = sig; } int main(argc, argv) int argc; char **argv; { char *e, *user, *if_hostname, *command; char *args[2]; char *envs[2]; char **argp, **envp = NULL; struct gfs_connection *gfs_server; int i, remote_pid, sig, status, coredump; struct hostent *hp; struct sockaddr_in peer_addr; if (argc <= 0) usage(); program_name = basename(argv[0]); argc--, argv++; parse_option(&argc, &argv); if (argc <= 0) usage(); if_hostname = argv[0]; argc--, argv++; parse_option(&argc, &argv); if (argc <= 0) usage(); e = getenv("GFARM_DEBUG_MODE"); if (e != NULL && strcmp(e, "gdb") == 0) { opt_xauth_copy = 1; envs[0] = "GFARM_DEBUG_MODE=gdb"; envs[1] = NULL; envp = envs; } if (opt_raw_command) { argp = argv; command = argv[0]; } else { args[0] = concat(argc, argv); args[1] = NULL; argp = args; command = args[0]; } /* * Because gflog_auth_set_verbose() is called here, the call of * gfarm_gsi_client_initialize() below may display verbose * error messages, which will be displayed later again in * gfarm_auth_request_gsi(). * But unless it's called here, some error messages (e.g. * errors in gfarmAuthInitialize()) won't be displayed at all. * Thus, we go the noisy way, because that's better than nothing. */ if (opt_auth_verbose) gflog_auth_set_verbose(1); /* * initialization * * XXX * The reason we don't call gfarm_initialize() here is that * we'd like to avoid overhead to access meta database. * but we may have to access meta database eventually * for GSI DN <-> gfarm global username mapping. */ gfarm_error_initialize(); e = gfarm_set_local_user_for_this_local_account(); if (e == NULL) e = gfarm_config_read(); #ifdef HAVE_GSI /* XXX this initialization must be removed eventually */ if (e == NULL) (void)gfarm_gsi_client_initialize(); #endif if (e == NULL) e = gfarm_set_global_user_for_this_local_account(); if (e != NULL) { fprintf(stderr, "%s: %s\n", program_name, e); exit(1); } hp = gethostbyname(if_hostname); if (hp == NULL || hp->h_addrtype != AF_INET) { e = GFARM_ERR_UNKNOWN_HOST; } else { memset(&peer_addr, 0, sizeof(peer_addr)); memcpy(&peer_addr.sin_addr, hp->h_addr, sizeof(peer_addr.sin_addr)); peer_addr.sin_family = hp->h_addrtype; peer_addr.sin_port = htons(gfarm_spool_server_port); e = gfs_client_connect( opt_hostname != NULL ? opt_hostname : if_hostname, (struct sockaddr *)&peer_addr, &gfs_server); } if (e != NULL) { fprintf(stderr, "%s: %s\n", if_hostname, e); exit(1); } user = gfarm_get_global_username(); /* XXX - kluge */ e = gfs_client_mkdir(gfs_server, user, 0755); e = gfs_client_chdir(gfs_server, user); /* for gfs_client_command_send_signal() */ for (i = 0; i < GFARM_ARRAY_LENGTH(passing_signals); i++) { struct sigaction sa; /* * DO NOT set SA_RESTART here, because we rely on the fact * that select(2) breaks with EINTR. * XXX - This is not so portable. Use siglongjmp() instead? */ sa.sa_handler = record_signal; sigemptyset(&sa.sa_mask); sa.sa_flags = 0; sigaction(passing_signals[i], &sa, NULL); } e = gfs_client_command_request(gfs_server, command, argp, envp, (opt_raw_command ? 0 : GFS_CLIENT_COMMAND_FLAG_SHELL_COMMAND) | (opt_no_stdin ? GFS_CLIENT_COMMAND_FLAG_STDIN_EOF : 0) | (opt_xdpy_env ? GFS_CLIENT_COMMAND_FLAG_XENVCOPY : 0) | (opt_xauth_copy ? GFS_CLIENT_COMMAND_FLAG_XAUTHCOPY : 0), &remote_pid); if (e == NULL) { char *e2; while (gfs_client_command_is_running(gfs_server)) { e = gfs_client_command_io(gfs_server, NULL); if (e == NULL && send_signal != 0) { e = gfs_client_command_send_signal( gfs_server, send_signal); send_signal = 0; } } e2 = gfs_client_command_result(gfs_server, &sig, &status, &coredump); if (e == NULL) e = e2; } if (e != NULL) { fprintf(stderr, "%s: %s\n", argv[0], e); exit(1); } if (sig) { fprintf(stderr, "%s: signal %d received%s.\n", if_hostname, sig, coredump ? " (core dumped)" : ""); exit(255); } exit(status); } gfarm-2.4.1/gftool/gfrcmd/Makefile0000644000000000000000000000103711507222717015511 0ustar rootroot# $Id: Makefile 2373 2006-01-12 00:54:22Z soda $ top_builddir = ../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk SRCS = gfrcmd.c OBJS = gfrcmd.o PROGRAM = gfrcmd CFLAGS = $(COMMON_CFLAGS) -I$(GFUTIL_SRCDIR) -I$(GFARMLIB_SRCDIR) LDLIBS = $(COMMON_LDFLAGS) $(GFARMLIB) $(LIBS) DEPLIBS = $(DEPGFARMLIB) all: $(PROGRAM) include $(top_srcdir)/makes/prog.mk ### $(OBJS): $(DEPGFARMINC) \ $(GFUTIL_SRCDIR)/gfutil.h \ $(GFARMLIB_SRCDIR)/gfs_client.h \ $(GFARMLIB_SRCDIR)/auth.h \ $(GFARMLIB_SRCDIR)/config.h gfarm-2.4.1/gftool/gfstat/0000755000000000000000000000000011507222730014071 5ustar rootrootgfarm-2.4.1/gftool/gfstat/Makefile0000644000000000000000000000065311507222717015542 0ustar rootroot# $Id: Makefile 2373 2006-01-12 00:54:22Z soda $ top_builddir = ../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk PROGRAM = gfstat SRCS = $(PROGRAM).c OBJS = $(PROGRAM).o CFLAGS = $(COMMON_CFLAGS) -I$(GFARMLIB_SRCDIR) $(openssl_includes) LDLIBS = $(COMMON_LDLIBS) $(GFARMLIB) $(LIBS) DEPLIBS = $(DEPGFARMLIB) all: $(PROGRAM) include $(top_srcdir)/makes/prog.mk ### $(OBJS): $(DEPGFARMINC) gfarm-2.4.1/gftool/gfstat/gfstat.c0000644000000000000000000000465411507222717015543 0ustar rootroot/* * $Id: gfstat.c 4300 2010-01-04 05:37:59Z tatebe $ */ #include #include #include #include #include #include /* * Display struct gfs_stat. */ void display_stat(char *fn, struct gfs_stat *st) { time_t clock; printf(" File: \"%s\"\n", fn); printf(" Size: %-12" GFARM_PRId64 " Filetype: ", st->st_size); switch (st->st_mode & GFARM_S_IFMT) { case GFARM_S_IFREG: puts("regular file"); break; case GFARM_S_IFDIR: puts("directory"); break; case GFARM_S_IFLNK: puts("symbolic link"); break; default: printf("unknown\n"); } printf(" Mode: (%04o) Uid: (%8s) Gid: (%8s)\n", st->st_mode & GFARM_S_ALLPERM, st->st_user, st->st_group); printf(" Inode: %-12" GFARM_PRId64 " Gen: %-12" GFARM_PRId64 " Links: %-12" GFARM_PRId64 "\n", st->st_ino, st->st_gen, st->st_nlink); printf(" Ncopy: %-12" GFARM_PRId64 "\n", st->st_ncopy); clock = st->st_atimespec.tv_sec; printf("Access: %s", ctime(&clock)); clock = st->st_mtimespec.tv_sec; printf("Modify: %s", ctime(&clock)); clock = st->st_ctimespec.tv_sec; printf("Change: %s", ctime(&clock)); } void display_ncopy(char *fn, struct gfs_stat *st) { printf("%" GFARM_PRId64 "\n", st->st_ncopy); } void usage(char *prog_name) { fprintf(stderr, "Usage: %s [option] file1 [file2 ...]\n", prog_name); fprintf(stderr, "option:\n"); fprintf(stderr, "\t-c\t\tdisplay number of file replicas\n"); exit(2); } /* * */ int main(int argc, char *argv[]) { char *prog_name = basename(argv[0]); gfarm_error_t e; extern int optind; int c, r = 0; void (*display)(char *, struct gfs_stat *) = display_stat; while ((c = getopt(argc, argv, "ch?")) != -1) { switch (c) { case 'c': display = display_ncopy; break; case 'h': case '?': default: usage(prog_name); } } argc -= optind; argv += optind; if (argc < 1) usage(prog_name); e = gfarm_initialize(&argc, &argv); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", prog_name, gfarm_error_string(e)); exit(1); } for (; *argv; ++argv) { struct gfs_stat st; e = gfs_stat(*argv, &st); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", *argv, gfarm_error_string(e)); r = 1; continue; } display(*argv, &st); gfs_stat_free(&st); } e = gfarm_terminate(); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", prog_name, gfarm_error_string(e)); exit(1); } exit(r); } gfarm-2.4.1/gftool/gfreg/0000755000000000000000000000000011507222730013673 5ustar rootrootgfarm-2.4.1/gftool/gfreg/Makefile0000644000000000000000000000107211507222717015340 0ustar rootroot# $Id: Makefile 4621 2010-04-05 01:55:59Z tatebe $ top_builddir = ../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk SRCS = gfreg_simple.c OBJS = gfreg_simple.o PROGRAM = gfreg CFLAGS = $(COMMON_CFLAGS) -I$(GFUTIL_SRCDIR) -I$(GFARMLIB_SRCDIR) \ $(openssl_includes) LDLIBS = $(COMMON_LDFLAGS) $(GFARMLIB) $(LIBS) DEPLIBS = $(DEPGFARMLIB) all: $(PROGRAM) include $(top_srcdir)/makes/gfptool.mk ### $(OBJS): $(DEPGFARMINC) $(GFUTIL_SRCDIR)/timer.h $(GFARMLIB_SRCDIR)/gfs_profile.h $(GFARMLIB_SRCDIR)/host.h $(GFARMLIB_SRCDIR)/config.h gfarm-2.4.1/gftool/gfreg/gfreg.c0000644000000000000000000007060211507222717015143 0ustar rootroot#include #include #include #include #include #include #include #include #include #include #include #include #include #include "host.h" #include "schedule.h" /* gfarm_strings_expand_cyclic() */ #include "config.h" /* * Register a local file to Gfarm filesystem * * gfreg * * $Id: gfreg.c 3617 2007-03-12 08:32:55Z n-soda $ */ /* Don't permit set[ug]id bit for now */ #define FILE_MODE_MASK 0777 /* * This value is only used as a last resort, * when the local file argument is "-" only, * and if `gfarm_url' is a directory or doesn't exist. */ #define DEFAULT_FILE_MODE 0644 char *program_name = "gfreg"; static const char STDIN_FILENAME[] = "-"; void usage() { fprintf(stderr, "Usage: %s [option] ... \n", program_name); fprintf(stderr, "Register local file(s) to Gfarm filesystem.\n\n"); fprintf(stderr, "option:\n"); fprintf(stderr, "\t-I fragment-index\tspecify a fragment index\n"); fprintf(stderr, "\t-N number\t\ttotal number of fragments\n"); fprintf(stderr, "\t-a architecture\t\tspecify an architecture\n"); fprintf(stderr, "\t-h hostname\t\tspecify a hostname\n"); fprintf(stderr, "\t-H hostfile\t\tspecify hostnames by a file\n"); fprintf(stderr, "\t-D domainname\t\tspecify a domainname\n"); fprintf(stderr, "\t-f \t\t\tforce to register\n"); fprintf(stderr, "\t-r files\t\tspecify some directories and files\n"); exit(EXIT_FAILURE); } static int opt_force = 0; static char *opt_section = NULL; static char *opt_hostname = NULL; static char *opt_hostfile = NULL; static char *opt_domainname = NULL; static int error_happened = 0; static int open_file(char *filename, int *fdp, int *fd_needs_close_p) { int fd; if (strcmp(filename, STDIN_FILENAME) == 0) { *fdp = STDIN_FILENO; *fd_needs_close_p = 0; return (1); } if ((fd = open(filename, O_RDONLY)) == -1) { fprintf(stderr, "%s: cannot open %s: %s\n", program_name, filename, strerror(errno)); error_happened = 1; return (0); } *fdp = fd; *fd_needs_close_p = 1; return (1); } static int get_mode(int fd, char *filename, gfarm_mode_t *mode_p) { struct stat s; if (fstat(fd, &s) == -1) { fprintf(stderr, "%s: cannot stat %s: %s\n", program_name, filename, strerror(errno)); error_happened = 1; return (0); } *mode_p = s.st_mode; return (1); } static int get_file_mode(int fd, char *filename, gfarm_mode_t *file_mode_p) { if (!get_mode(fd, filename, file_mode_p)) return (0); if (S_ISREG(*file_mode_p)) *file_mode_p &= FILE_MODE_MASK; else *file_mode_p = 0644; /* XXX, but better than *file_mode_p */ return (1); } static file_offset_t set_minimum_free_disk_space_from_fd(int fd) { struct stat s; file_offset_t old_size = gfarm_get_minimum_free_disk_space(); if (!fstat(fd, &s) && S_ISREG(s.st_mode)) gfarm_set_minimum_free_disk_space(s.st_size); return (old_size); } static int concat_dir_name(const char *gfarm_url, const char *base_name, char **target_url_p) { char *target_url; GFARM_MALLOC_ARRAY(target_url, strlen(gfarm_url) + 1 + strlen(base_name) + 1); if (target_url == NULL) { fprintf(stderr, "%s: %s\n", program_name, GFARM_ERR_NO_MEMORY); error_happened = 1; return (0); } if (*gfarm_path_dir_skip(gfarm_url_prefix_skip(gfarm_url)) != '\0') sprintf(target_url, "%s/%s", gfarm_url, base_name); else sprintf(target_url, "%s%s", gfarm_url, base_name); *target_url_p = target_url; return (1); } static int section_does_not_exists(char *gfarm_url, char *section) { struct gfs_stat s; if (gfs_stat_section(gfarm_url, section, &s) == NULL) { gfs_stat_free(&s); fprintf(stderr, "%s: %s:%s already exists\n", program_name, gfarm_url, section); return (0); } return (1); } #define GFS_FILE_BUFSIZE 65536 static void copy_file(int fd, GFS_File gf, char *gfarm_url, char *section) { char *e; ssize_t rv; int length; /* XXX - should be size_t */ char buffer[GFS_FILE_BUFSIZE]; for (;;) { rv = read(fd, buffer, sizeof(buffer)); if (rv <= 0) break; /* XXX - partial write case ? */ e = gfs_pio_write(gf, buffer, rv, &length); if (e != NULL) { fprintf(stderr, "%s: writing to %s:%s: %s\n", program_name, gfarm_url, section, e); error_happened = 1; break; } } } static int get_nsections(char *gfarm_url, int *nsectionsp) { char *e, *gfarm_file; struct gfarm_path_info pi; e = gfarm_url_make_path(gfarm_url, &gfarm_file); if (e != NULL) { fprintf(stderr, "%s: gfarm_url_make_path(%s): %s\n", program_name, gfarm_url, e); error_happened = 1; return (0); } e = gfarm_path_info_get(gfarm_file, &pi); free(gfarm_file); if (e != NULL) { if (e == GFARM_ERR_NO_SUCH_OBJECT) fprintf(stderr, "%s: missing -N \n", program_name); else fprintf(stderr, "%s: gfarm_get_path_info(%s): %s\n", program_name, gfarm_url, e); error_happened = 1; return (0); } *nsectionsp = pi.status.st_nsections; gfarm_path_info_free(&pi); return (1); } static void register_fragment(int is_dest_dir, char *gfarm_url, int index, int nfragments, char *hostname, char *filename, int use_file_mode, gfarm_mode_t file_mode) { char *e; int fd, fd_needs_close; char *target_url; GFS_File gf; char section[GFARM_INT32STRLEN + 1]; file_offset_t old_size; if (!open_file(filename, &fd, &fd_needs_close)) return; if (!use_file_mode && !get_file_mode(fd, filename, &file_mode)) goto finish; if (!is_dest_dir) target_url = gfarm_url; else if (!concat_dir_name(gfarm_url, gfarm_path_dir_skip(filename), &target_url)) goto finish; if (nfragments == GFARM_FILE_DONTCARE && !get_nsections(target_url, &nfragments)) goto finish_url; sprintf(section, "%d", index); if (opt_force || section_does_not_exists(target_url, section)) { e = gfs_pio_create(target_url, GFARM_FILE_WRONLY|GFARM_FILE_TRUNC, file_mode, &gf); if (e != NULL) { fprintf(stderr, "%s: gfs_pio_create: cannot open %s: %s\n", program_name, target_url, e); error_happened = 1; } else { /* specify the minimum free disk space */ old_size = set_minimum_free_disk_space_from_fd(fd); if ((e = gfs_pio_set_view_index(gf, nfragments, index, hostname, 0)) != NULL) { fprintf(stderr, "%s: gfs_pio_set_view_index: " "cannot open %s:%d: %s\n", program_name, target_url, index, e); error_happened = 1; } else { copy_file(fd, gf, target_url, section); } e = gfs_pio_close(gf); if (e != NULL) { fprintf(stderr, "%s: closing %s:%d: %s\n", program_name, target_url, index, e); } gfarm_set_minimum_free_disk_space(old_size); } } finish_url: if (target_url != gfarm_url) free(target_url); finish: if (fd_needs_close) close(fd); } static void register_file(char *gfarm_url, char *section, char *hostname, char *filename) { char *e; int fd, fd_needs_close; GFS_File gf; gfarm_mode_t file_mode; file_offset_t old_size; if (!open_file(filename, &fd, &fd_needs_close)) return; if (!get_file_mode(fd, filename, &file_mode)) goto finish; if ((file_mode & 0111) == 0) { register_fragment(0, gfarm_url, 0, 1, hostname, filename, 0, 0000); goto finish; } if (opt_force || section_does_not_exists(gfarm_url, section)) { e = gfs_pio_create(gfarm_url, GFARM_FILE_WRONLY|GFARM_FILE_TRUNC, file_mode, &gf); if (e != NULL) { fprintf(stderr, "%s: gfs_pio_create: cannot open %s: %s\n", program_name, gfarm_url, e); error_happened = 1; } else { /* specify the minimum free disk space */ old_size = set_minimum_free_disk_space_from_fd(fd); if (section == NULL) { fprintf(stderr, "%s: missing -a option\n", program_name); exit(EXIT_FAILURE); } if ((e = gfs_pio_set_view_section(gf, section, hostname, 0)) != NULL) { fprintf(stderr, "%s: cannot open %s:%s: %s\n", program_name, gfarm_url, section, e); error_happened = 1; } else { copy_file(fd, gf, gfarm_url, section); } e = gfs_pio_close(gf); if (e != NULL) { fprintf(stderr, "%s: closing %s:%s: %s\n", program_name, gfarm_url, section, e); } gfarm_set_minimum_free_disk_space(old_size); } } finish: if (fd_needs_close) close(fd); } static char * add_cwd_to_relative_path(char *cwd, const char *path) { char *p; GFARM_MALLOC_ARRAY(p, strlen(cwd) + strlen(path) + 2); if (p == NULL) { fprintf(stderr, "%s: %s\n", program_name, GFARM_ERR_NO_MEMORY); exit(EXIT_FAILURE); } sprintf(p, strcmp(cwd, "") ? "%s/%s" : "%s%s", cwd, path); return (p); } static int traverse_file_tree(char *cwd, char *path, gfarm_stringlist *dir_list, gfarm_stringlist *file_list) { char *e; struct stat s; DIR *dir; struct dirent *entry; char *dpath; dpath = add_cwd_to_relative_path(cwd, path); if (stat(path, &s) == -1) { fprintf(stderr, "%s: cannot stat %s: %s\n", program_name, dpath, strerror(errno)); error_happened = 1; return (0); } if (S_ISDIR(s.st_mode)) { e = gfarm_stringlist_add(dir_list, dpath); if (e != NULL) { fprintf(stderr, "%s: traverse_file_tree: %s:\n", program_name, e); exit(EXIT_FAILURE); } if (chdir(path) == -1) { fprintf(stderr, "%s: cannot change directory %s: %s\n", program_name, dpath, strerror(errno)); error_happened = 1; return (0); } if ((dir = opendir(".")) == NULL) { fprintf(stderr, "%s: cannot open directory %s: %s\n", program_name, dpath, strerror(errno)); error_happened = 1; return (0); } while ((entry = readdir(dir)) != NULL) { if (strcmp(entry->d_name, ".") == 0 || strcmp(entry->d_name, "..") == 0) { continue; } if (!traverse_file_tree(dpath, entry->d_name, dir_list, file_list)) { return (0); } } if (closedir(dir) == -1) { fprintf(stderr, "%s: cannot close directory %s: %s\n", program_name, dpath, strerror(errno)); error_happened = 1; return (0); } if (chdir("..") == -1) { fprintf(stderr, "%s: cannot change directory %s: %s\n", program_name, cwd, strerror(errno)); error_happened = 1; return (0); } } else { e = gfarm_stringlist_add(file_list, dpath); if (e != NULL) { fprintf(stderr, "%s: traverse_file_tree: %s:\n", program_name, e); exit(EXIT_FAILURE); } } return (1); } static int get_lists(char *dir_path, gfarm_stringlist *dir_list, gfarm_stringlist *file_list) { char cwdbf[PATH_MAX * 2]; struct dirent *entry; DIR *dir; if (getcwd(cwdbf, sizeof(cwdbf)) == NULL) { fprintf(stderr, "%s: cannot get current working directory: %s\n", program_name, strerror(errno)); error_happened = 1; return (0); } if (chdir(dir_path) == -1) { fprintf(stderr, "%s: cannot change directory %s: %s\n", program_name, dir_path, strerror(errno)); error_happened = 1; return (0); } if ((dir = opendir(".")) == NULL) { fprintf(stderr, "%s: cannot open directory %s: %s\n", program_name, dir_path, strerror(errno)); error_happened = 1; return (0); } while ((entry = readdir(dir)) != NULL) { if (strcmp(entry->d_name, "..") == 0) { continue; } if (strcmp(entry->d_name, ".") == 0) { gfarm_stringlist_add(dir_list, strdup("")); continue; } if (!traverse_file_tree("", entry->d_name, dir_list, file_list)) { closedir(dir); return (0); } } if (closedir(dir) == -1) { fprintf(stderr, "%s: cannot close directory %s: %s\n", program_name, dir_path, strerror(errno)); error_happened = 1; return (0); } if (chdir(cwdbf) == -1) { fprintf(stderr, "%s: cannot change directory %s: %s\n", program_name, cwdbf, strerror(errno)); error_happened = 1; return (0); } return (1); } static void get_section(char *hostname, char **section, int *section_alloced) { char *s, *e; char *canonical; *section_alloced = 0; if (hostname == NULL) { e = gfarm_host_get_self_architecture(&s); if (e == NULL) *section = s; goto finish; } e = gfarm_host_get_canonical_name(hostname, &canonical); if (e != NULL) { if (e == GFARM_ERR_NO_SUCH_OBJECT) e = "not a filesystem node"; goto finish; } s = gfarm_host_info_get_architecture_by_host(canonical); free(canonical); if (s == NULL) { e = GFARM_ERR_NO_MEMORY; goto finish; } *section = s; *section_alloced = 1; finish: if (e != NULL) { fprintf(stderr, "%s: host %s: %s\n", program_name, hostname, e); exit(EXIT_FAILURE); } } enum register_mode { UNDECIDED, PROGRAM, AUTO_INDEX, FRAGMENT, RECURSIVE }; void foreach_arg(int argc, char *argv[], void (*f)(char *, int, gfarm_mode_t, void *), void *f_a) { int i; for (i = 0; i < argc; i++) { int fd, fd_needs_close; gfarm_mode_t m; if (!open_file(argv[i], &fd, &fd_needs_close)) exit(EXIT_FAILURE); if (!get_mode(fd, argv[i], &m)) exit(EXIT_FAILURE); (*f)(argv[i], fd, m, f_a); if (fd_needs_close) { close(fd); } } } struct check_mode_args { char **ref_m_arg_p; gfarm_mode_t *ref_m_p; }; static void check_modes_are_mixed(char *c_arg, int fd, gfarm_mode_t m, void *f_args) { struct check_mode_args *a = f_args; if (!S_ISREG(m)) return; if (*a->ref_m_arg_p == NULL) { *a->ref_m_arg_p = c_arg; *a->ref_m_p = m & FILE_MODE_MASK; } if (((m & 0111) != 0) != ((*a->ref_m_p & 0111) != 0)) { fprintf(stderr, "%s: program and non-program are mixed in %s and %s\n", program_name, *a->ref_m_arg_p, c_arg); exit(EXIT_FAILURE); } } enum register_mode decide_reg_mode(char *file_mode_arg, gfarm_mode_t file_mode, int argc, char *argv[]) { char *ref_m_arg = file_mode_arg; gfarm_mode_t ref_m = file_mode; struct check_mode_args a; a.ref_m_arg_p = &ref_m_arg; a.ref_m_p = &ref_m; foreach_arg(argc, argv, check_modes_are_mixed, &a); if ((ref_m & 0111) != 0) return(PROGRAM); else return(AUTO_INDEX); } static void check_is_argument_only_one(int argc, char *file_type, char *fragment, char *section, char *of, char *gfarm_url) { if (argc > 1) { fprintf(stderr, "%s: only one %s can be specified to register" "%s%s%s the gfarm file `%s'\n", program_name, file_type, fragment, section, of, gfarm_url); exit(EXIT_FAILURE); } } static void check_arguments(int argc, char *argv[], char *hostfile, enum register_mode reg_mode, int is_dest_dir, char *file_mode_arg) { int i; int c = 0; /* count of "-" in the arguments */ if (hostfile != NULL && strcmp(hostfile, STDIN_FILENAME) == 0) c++; for (i = 0; i < argc; i++) { int fd, fd_needs_close; gfarm_mode_t m; if (!open_file(argv[i], &fd, &fd_needs_close)) exit(EXIT_FAILURE); if (!get_mode(fd, argv[i], &m)) exit(EXIT_FAILURE); if (fd_needs_close) close(fd); if (S_ISDIR(m)) { if (reg_mode == AUTO_INDEX || reg_mode == FRAGMENT) { fprintf(stderr, "%s: %s: is a directory\n", program_name, argv[i]); exit(EXIT_FAILURE); } else if (reg_mode == RECURSIVE && !is_dest_dir && file_mode_arg != NULL) { /* gfarm_url is a regular file */ fprintf(stderr, "%s: cannot register " "directory %s " "as regular file %s\n", program_name, argv[i], file_mode_arg == NULL ? "" : file_mode_arg); exit(EXIT_FAILURE); } } if ((strcmp(argv[i], STDIN_FILENAME)) == 0) { if (is_dest_dir) { fprintf(stderr, "%s: cannot create file `-'\n", program_name); exit(EXIT_FAILURE); } if (++c > 1) { fprintf(stderr, "%s: `-' (stdin) is specified " "multiple times\n", program_name); exit(EXIT_FAILURE); } } } } struct lists_arg { int is_dest_dir; char *gfarm_url; gfarm_stringlist *dir_list, *src_file_list, *target_file_list; }; static void add_dir_file_list(char *c_arg, int fd, gfarm_mode_t m, void *f_args) { struct lists_arg *a = f_args; char *e; gfarm_stringlist d, f; char *target_base_url, *target_url, *src_file; int i; if (a->is_dest_dir) { if (!concat_dir_name(a->gfarm_url, gfarm_path_dir_skip(c_arg), &target_base_url)) exit(EXIT_FAILURE); } else { target_base_url = strdup(a->gfarm_url); } if (S_ISDIR(m)) { e = gfarm_stringlist_init(&d); if (e != NULL) goto finish; e = gfarm_stringlist_init(&f); if (e != NULL) goto finish; if (!get_lists(c_arg, &d, &f)) exit(EXIT_FAILURE); for (i = 0; i < gfarm_stringlist_length(&d); i++) { if (!concat_dir_name(target_base_url, gfarm_stringlist_elem(&d, i), &target_url)) { exit(EXIT_FAILURE); } gfarm_stringlist_add(a->dir_list, target_url); } gfarm_stringlist_free_deeply(&d); for (i = 0; i < gfarm_stringlist_length(&f); i++) { if (!concat_dir_name(c_arg, gfarm_stringlist_elem(&f, i), &src_file)) { exit(EXIT_FAILURE); } gfarm_stringlist_add(a->src_file_list, src_file); if (!concat_dir_name(a->is_dest_dir ? target_base_url : a->gfarm_url, gfarm_stringlist_elem(&f, i), &target_url)) { exit(EXIT_FAILURE); } gfarm_stringlist_add(a->target_file_list, target_url); } gfarm_stringlist_free_deeply(&f); } else { e = gfarm_stringlist_add(a->src_file_list, c_arg); if (a->is_dest_dir) { if (!concat_dir_name(a->gfarm_url, gfarm_path_dir_skip(c_arg), &target_url)) { exit(EXIT_FAILURE); } } else { target_url = strdup(a->gfarm_url); } gfarm_stringlist_add(a->target_file_list, target_url); } free(target_base_url); finish: if (e != NULL) { fprintf(stderr, "%s: add_dir_file_list: %s:\n", program_name, e); exit(EXIT_FAILURE); } } static void add_file_list(char *c_arg, int fd, gfarm_mode_t m, void *f_args) { struct lists_arg *a = f_args; char *e; char *target_url; if (S_ISDIR(m)) { fprintf(stderr, "%s: omitting directory `%s'\n", program_name, c_arg); } else { e = gfarm_stringlist_add(a->src_file_list, c_arg); if (e != NULL) { fprintf(stderr, "%s: add_file_list: %s:\n", program_name, e); exit(EXIT_FAILURE); } if (a->is_dest_dir) { if (!concat_dir_name(a->gfarm_url, gfarm_path_dir_skip(c_arg), &target_url)) { exit(EXIT_FAILURE); } } else { target_url = a->gfarm_url; } gfarm_stringlist_add(a->target_file_list, target_url); } } static void get_hosts(int *np, char ***host_table_p) { char **hosts = NULL, *e, **h; int nhosts, error_line, nh; if (opt_hostname != NULL) { GFARM_MALLOC_ARRAY(h, 1); if (h == NULL) { fprintf(stderr, "%s: %s\n", program_name, GFARM_ERR_NO_MEMORY); exit(EXIT_FAILURE); } h[0] = strdup(opt_hostname); if (h[0] == NULL) { fprintf(stderr, "%s: %s\n", program_name, GFARM_ERR_NO_MEMORY); exit(EXIT_FAILURE); } nh = 1; } else if (opt_hostfile != NULL) { e = gfarm_hostlist_read(opt_hostfile, &nh, &h, &error_line); if (e != NULL) { if (error_line != -1) fprintf(stderr, "%s: %s line %d: %s\n", program_name, opt_hostfile, error_line, e); else fprintf(stderr, "%s: %s: %s\n", program_name, opt_hostfile, e); exit(EXIT_FAILURE); } } else { if (opt_domainname == NULL) opt_domainname = ""; e = gfarm_hosts_in_domain(&nh, &h, opt_domainname); if (e != NULL) { fprintf(stderr, "%s: %s\n", program_name, e); exit(EXIT_FAILURE); } } GFARM_MALLOC_ARRAY(hosts, nh); if (hosts == NULL) { fprintf(stderr, "%s: %s\n", program_name, GFARM_ERR_NO_MEMORY); exit(EXIT_FAILURE); } nhosts = nh; e = gfarm_schedule_search_idle_acyclic_hosts_to_write( nh, h, &nhosts, hosts); if (e != NULL) { fprintf(stderr, "%s: %s\n", program_name, e); exit(EXIT_FAILURE); } free(h); *np = nhosts; *host_table_p = hosts; } static void warning_option_N_ignored(int nfragments) { if (nfragments != GFARM_FILE_DONTCARE) { /* * XXX - call gfarm_url_replicate() to replicate * `nfragments' copies of gfarm_url:section? */ fprintf(stderr, "%s: warning: option -N is currently ignored\n", program_name); } } static void register_recursive_mode(int is_dest_dir, int argc, char *argv[], char *gfarm_url, int nfragments) { int section_alloced = 0; int nhosts; char **hosts; gfarm_stringlist dir_list, src_file_list, target_file_list; struct lists_arg a; char *e, *section; int i, j; if (!is_dest_dir) check_is_argument_only_one(argc, "file or directory", "", "", "", gfarm_url); /* * XXX - need to check all arguments are files if !is_dest_dir */ warning_option_N_ignored(nfragments); section = opt_section; if (section == NULL) { get_section(opt_hostname, §ion, §ion_alloced); } e = gfarm_stringlist_init(&dir_list); if (e != NULL) { fprintf(stderr, "%s: %s\n", program_name, e); exit(EXIT_FAILURE); } e = gfarm_stringlist_init(&src_file_list); if (e != NULL) { fprintf(stderr, "%s: %s\n", program_name, e); exit(EXIT_FAILURE); } e = gfarm_stringlist_init(&target_file_list); if (e != NULL) { fprintf(stderr, "%s: %s\n", program_name, e); exit(EXIT_FAILURE); } a.is_dest_dir = is_dest_dir; a.gfarm_url = gfarm_url; a.dir_list = &dir_list; a.src_file_list = &src_file_list; a.target_file_list = &target_file_list; foreach_arg(argc, argv, add_dir_file_list, &a); for (i = 0; i < gfarm_stringlist_length(&dir_list); i++) { char *d = gfarm_stringlist_elem(&dir_list, i); e = gfs_mkdir(d, 0755); if (e != NULL) { fprintf(stderr, "%s: gfs_mkdir: %s, %s\n", program_name, d, e); exit(EXIT_FAILURE); } } get_hosts(&nhosts, &hosts); j = 0; for (i = 0; i < gfarm_stringlist_length(&src_file_list); i++) { register_file( gfarm_stringlist_elem(&target_file_list, i), section, hosts[j++], gfarm_stringlist_elem(&src_file_list, i)); if (j >= nhosts) j = 0; } gfarm_strings_free_deeply(nhosts, hosts); if (section_alloced) free(section); gfarm_stringlist_free_deeply(&dir_list); gfarm_stringlist_free(&src_file_list); gfarm_stringlist_free_deeply(&target_file_list); } static void register_program_mode(int is_dest_dir, int argc, char *argv[], char *gfarm_url, int nfragments) { int section_alloced = 0; int nhosts; char **hosts; gfarm_stringlist src_file_list, target_file_list; struct lists_arg a; char *e, *section; int i, j; if (!is_dest_dir) check_is_argument_only_one(argc, "file", "", "", "", gfarm_url); warning_option_N_ignored(nfragments); section = opt_section; if (section == NULL) { get_section(opt_hostname, §ion, §ion_alloced); } e = gfarm_stringlist_init(&src_file_list); if (e != NULL) { fprintf(stderr, "%s: %s\n", program_name, e); exit(EXIT_FAILURE); } e = gfarm_stringlist_init(&target_file_list); if (e != NULL) { fprintf(stderr, "%s: %s\n", program_name, e); exit(EXIT_FAILURE); } a.is_dest_dir = is_dest_dir; a.gfarm_url = gfarm_url; a.src_file_list = &src_file_list; a.target_file_list = &target_file_list; foreach_arg(argc, argv, add_file_list, &a); get_hosts(&nhosts, &hosts); j = 0; for (i = 0; i < gfarm_stringlist_length(&src_file_list); i++) { register_file( gfarm_stringlist_elem(&target_file_list, i), section, hosts[j++], gfarm_stringlist_elem(&src_file_list, i)); if (j >= nhosts) j = 0; } gfarm_strings_free_deeply(nhosts, hosts); gfarm_stringlist_free(&src_file_list); gfarm_stringlist_free(&target_file_list); if (section_alloced) free(section); } static void register_fragment_mode(int is_dest_dir, int argc, char *argv[],char *gfarm_url, int nfragments, char *file_mode_arg, gfarm_mode_t file_mode) { int i, j, nhosts; char **hosts; if (!is_dest_dir) check_is_argument_only_one(argc, "file", " fragment ", opt_section, " of", gfarm_url); if (nfragments == GFARM_FILE_DONTCARE) gfs_pio_get_node_size(&nfragments); get_hosts(&nhosts, &hosts); j = 0; for (i = 0; i < argc; i++) { register_fragment(is_dest_dir, gfarm_url, strtol(opt_section, NULL, 0), nfragments, hosts[j++], argv[i], file_mode_arg == gfarm_url, file_mode); if (j >= nhosts) j = 0; } } static void register_auto_index_mode(int is_dest_dir, int argc, char *argv[], char *gfarm_url, int nfragments, char *file_mode_arg, gfarm_mode_t file_mode) { int i, j, nhosts; char **hosts; if (nfragments == GFARM_FILE_DONTCARE) nfragments = argc; if (nfragments != argc) { fprintf(stderr, "%s: local file number %d " "doesn't match with -N %d\n", program_name, argc, nfragments); exit(EXIT_FAILURE); } if (is_dest_dir && nfragments > 1) { fprintf(stderr, "%s: cannot determine the file name " "under the directory %s, " "because multiple local file names are specifed\n", program_name, gfarm_url); exit(EXIT_FAILURE); } if (file_mode_arg == NULL) { int fd, fd_needs_close; if (!open_file(argv[0], &fd, &fd_needs_close)) exit(EXIT_FAILURE); if (!get_file_mode(fd, argv[0], &file_mode)) exit(EXIT_FAILURE); if (fd_needs_close) close(fd); } get_hosts(&nhosts, &hosts); /* XXX - need to register in parallel? */ j = 0; for (i = 0; i < argc; i++) { register_fragment(is_dest_dir, gfarm_url, i, nfragments, hosts[j++], argv[i], /* use_file_mode */ 1, file_mode); if (j >= nhosts) j = 0; } gfarm_strings_free_deeply(nhosts, hosts); } int main(int argc, char *argv[]) { /* options */ int nfragments = GFARM_FILE_DONTCARE; /* -1, actually */ enum register_mode reg_mode = UNDECIDED; char *e, *gfarm_url, *file_mode_arg; gfarm_mode_t file_mode = DEFAULT_FILE_MODE; int c, is_dest_dir; struct gfs_stat gs; e = gfarm_initialize(&argc, &argv); if (e != NULL) { fprintf(stderr, "%s: %s\n", program_name, e); exit(EXIT_FAILURE); } /* Command options */ while ((c = getopt(argc, argv, "a:fh:iprs:D:I:H:N:?")) != -1) { switch (c) { case 'I': opt_section = optarg; reg_mode = FRAGMENT; break; case 'a': opt_section = optarg; break; case 'H': opt_hostfile = optarg; break; case 'N': nfragments = strtol(optarg, NULL, 0); break; case 'h': opt_hostname = optarg; break; case 'D': opt_domainname = optarg; break; case 'f': opt_force = 1; break; case 'p': reg_mode = PROGRAM; break; case 'i': reg_mode = AUTO_INDEX; break; case 'r': reg_mode = RECURSIVE; break; case 's': gfarm_set_minimum_free_disk_space( strtol(optarg, NULL, 0)); break; case '?': default: usage(); } } c = 0; if (opt_hostname != NULL) c++; if (opt_hostfile != NULL) c++; if (opt_domainname != NULL) c++; if (c > 1) { fprintf(stderr, "%s: more than one options are specified " "from -h, -H and -D\n", program_name); usage(); } argc -= optind; argv += optind; if (argc == 0) { fprintf(stderr, "%s: missing a local filename\n", program_name); usage(); } if (argc == 1) { fprintf(stderr, "%s: missing a Gfarm URL\n", program_name); usage(); } gfarm_url = argv[argc - 1]; --argc; e = gfs_stat(gfarm_url, &gs); if (e == GFARM_ERR_NO_SUCH_OBJECT) { is_dest_dir = 0; file_mode_arg = NULL; } else if (e != NULL) { fprintf(stderr, "%s: %s: %s\n", program_name, gfarm_url, e); exit(EXIT_FAILURE); } else { if (GFARM_S_ISREG(gs.st_mode)) { is_dest_dir = 0; file_mode_arg = gfarm_url; file_mode = gs.st_mode; } else if (GFARM_S_ISDIR(gs.st_mode)) { is_dest_dir = 1; file_mode_arg = NULL; } else { /* defensive programming. this shouldn't happen. */ fprintf(stderr, "%s: %s: unknown file type\n", program_name, gfarm_url); exit(EXIT_FAILURE); } gfs_stat_free(&gs); } /* * distinguish which mode is specified: * 1. program mode: * gfreg [-p] [-h ] [-a ] \ * ... * 2. auto index mode: * gfreg [-i] [-h ] [-H ] [-D ] \ * ... * 3. fragment mode: * gfreg -I [-h ] [-N ] \ * ... * 4. recursive mode: * gfreg -r [-h ] [-a ] \ * ... \ * */ if (reg_mode == UNDECIDED) reg_mode = decide_reg_mode(file_mode_arg, file_mode, argc, argv); check_arguments(argc, argv, opt_hostfile, reg_mode, is_dest_dir, file_mode_arg); /* exits if an error occurs */ if (reg_mode == RECURSIVE) { register_recursive_mode(is_dest_dir, argc, argv, gfarm_url, nfragments); } else if (reg_mode == PROGRAM) { register_program_mode(is_dest_dir, argc, argv, gfarm_url, nfragments); } else if (reg_mode == FRAGMENT) { register_fragment_mode(is_dest_dir, argc, argv, gfarm_url, nfragments, file_mode_arg, file_mode); } else if (reg_mode == AUTO_INDEX) { register_auto_index_mode(is_dest_dir, argc, argv, gfarm_url, nfragments, file_mode_arg, file_mode); } e = gfarm_terminate(); if (e != NULL) { fprintf(stderr, "%s: %s\n", program_name, e); exit(EXIT_FAILURE); } exit(error_happened); } gfarm-2.4.1/gftool/gfreg/gfreg_simple.c0000644000000000000000000000730511507222717016514 0ustar rootroot/* * $Id: gfreg_simple.c 4302 2010-01-05 07:03:42Z n-soda $ */ #include #include #include #include #include #include #include #include #include "gfutil.h" #include "timer.h" #include "gfs_profile.h" #include "host.h" #include "config.h" /* XXX FIXME: INTERNAL FUNCTION SHOULD NOT BE USED */ #include #include "gfs_pio.h" char *program_name = "gfreg"; gfarm_error_t gfimport(FILE *ifp, GFS_File ogf) { int c; while ((c = getc(ifp)) != EOF) gfs_pio_putc(ogf, c); return (gfs_pio_error(ogf)); } gfarm_error_t gfimport_to(FILE *ifp, char *gfarm_url, int mode, char *host) { gfarm_error_t e, e2; GFS_File gf; gfarm_timerval_t t1, t2, t3, t4, t5; GFARM_TIMEVAL_FIX_INITIALIZE_WARNING(t1); GFARM_TIMEVAL_FIX_INITIALIZE_WARNING(t2); GFARM_TIMEVAL_FIX_INITIALIZE_WARNING(t3); GFARM_TIMEVAL_FIX_INITIALIZE_WARNING(t4); GFARM_TIMEVAL_FIX_INITIALIZE_WARNING(t5); gfs_profile(gfarm_gettimerval(&t1)); e = gfs_pio_create( gfarm_url, GFARM_FILE_WRONLY|GFARM_FILE_TRUNC, mode, &gf); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", gfarm_url, gfarm_error_string(e)); return (e); } gfs_profile(gfarm_gettimerval(&t2)); /* XXX FIXME: INTERNAL FUNCTION SHOULD NOT BE USED */ e = gfs_pio_internal_set_view_section(gf, host); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", gfarm_url, gfarm_error_string(e)); goto close; } gfs_profile(gfarm_gettimerval(&t3)); e = gfimport(ifp, gf); if (e != GFARM_ERR_NO_ERROR) fprintf(stderr, "writing to %s: %s\n", gfarm_url, gfarm_error_string(e)); gfs_profile(gfarm_gettimerval(&t4)); close: e2 = gfs_pio_close(gf); if (e2 != GFARM_ERR_NO_ERROR) fprintf(stderr, "closing %s: %s\n", gfarm_url, gfarm_error_string(e2)); gfs_profile(gfarm_gettimerval(&t5)); gfs_profile(fprintf(stderr, "create %g, view %g, import %g, close %g\n", gfarm_timerval_sub(&t2, &t1), gfarm_timerval_sub(&t3, &t2), gfarm_timerval_sub(&t4, &t3), gfarm_timerval_sub(&t5, &t4))); return (e != GFARM_ERR_NO_ERROR ? e : e2); } gfarm_error_t gfimport_from_to(const char *ifile, char *gfarm_url, char *host) { gfarm_error_t e; FILE *ifp = fopen(ifile, "r"); struct stat st; int rv; if (ifp == NULL) { perror(ifile); return (GFARM_ERR_CANT_OPEN); } rv = stat(ifile, &st); if (rv == -1) { perror("stat"); return (gfarm_errno_to_error(errno)); } e = gfimport_to(ifp, gfarm_url, st.st_mode & 0777, host); fclose(ifp); return (e); } static void usage(void) { fprintf(stderr, "Usage: %s [option] \n", program_name); fprintf(stderr, "option:\n"); fprintf(stderr, "\t%s\n", "-h "); fprintf(stderr, "\t%s\t%s\n", "-p", "turn on profiling"); fprintf(stderr, "\t%s\t%s\n", "-v", "verbose output"); exit(1); } int main(int argc, char **argv) { gfarm_error_t e; int c, status = 0; char *host = NULL; extern int optind; if (argc > 0) program_name = basename(argv[0]); e = gfarm_initialize(&argc, &argv); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", program_name, gfarm_error_string(e)); exit(1); } while ((c = getopt(argc, argv, "h:pv?")) != -1) { switch (c) { case 'p': gfs_profile_set(); break; case 'h': host = optarg; break; case 'v': gflog_auth_set_verbose(1); break; case '?': default: usage(); } } argc -= optind; argv += optind; if (argc != 2) usage(); e = gfimport_from_to(argv[0], argv[1], host); if (e != GFARM_ERR_NO_ERROR) status = 1; e = gfarm_terminate(); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", program_name, gfarm_error_string(e)); status = 1; } return (status); } gfarm-2.4.1/gftool/gfdf/0000755000000000000000000000000011507222730013507 5ustar rootrootgfarm-2.4.1/gftool/gfdf/Makefile0000644000000000000000000000075711507222717015165 0ustar rootroot# $Id: Makefile 3925 2008-04-18 13:04:34Z tatebe $ top_builddir = ../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk PROGRAM = gfdf SRCS = gfdf_simple.c OBJS = gfdf_simple.o CFLAGS = $(COMMON_CFLAGS) -I$(GFARMLIB_SRCDIR) $(openssl_includes) LDLIBS = $(COMMON_LDLIBS) $(GFARMLIB) $(LIBS) DEPLIBS = $(DEPGFARMLIB) all: $(PROGRAM) include $(top_srcdir)/makes/prog.mk ### $(OBJS): $(DEPGFARMINC) \ $(GFARMLIB_SRCDIR)/config.h \ $(GFARMLIB_SRCDIR)/gfs_client.h gfarm-2.4.1/gftool/gfdf/gfdf_simple.c0000644000000000000000000001777011507222717016153 0ustar rootroot/* * $Id$ */ #include #include #include #include #include #include #include "gfm_client.h" #include "lookup.h" char *program_name = "gfdf"; enum sort_order { SO_NAME, SO_SIZE } option_sort_order = SO_NAME; static int option_reverse_sort = 0; static int option_formatting_flags = 0; struct formatter { char *summary_title_format; char *summary_data_format; char *nodes_title_format; char *nodes_data_format; char *nodes_separator; size_t (*number_to_string)(char *, size_t, unsigned long long); size_t (*blocks_to_string)(char *, size_t, unsigned long long); }; #define PRECISE_TITLE_FORMAT "%13s %13s %13s %4s" #define PRECISE_DATA_FORMAT "%13s %13s %13s %3.0f%%" #define READABLE_TITLE_FORMAT "%9s %6s %6s %4s" #define READABLE_DATA_FORMAT "%9s %6s %6s %3.0f%%" static size_t precise_number(char *buf, size_t len, unsigned long long number) { return (snprintf(buf, len, "%13llu", number)); } static size_t readable_number(char *buf, size_t len, unsigned long long number) { return (gfarm_humanize_number(buf, len, number, option_formatting_flags)); } static size_t readable_blocks(char *buf, size_t len, unsigned long long number) { return (gfarm_humanize_number(buf, len, number * 1024, option_formatting_flags)); } const struct formatter precise_formatter = { PRECISE_TITLE_FORMAT " %13s\n", PRECISE_DATA_FORMAT " %13s\n", PRECISE_TITLE_FORMAT " %s\n", PRECISE_DATA_FORMAT " %s\n", "----------------------------------------------", precise_number, precise_number }; const struct formatter readable_formatter = { READABLE_TITLE_FORMAT " %6s\n", READABLE_DATA_FORMAT " %6s\n", READABLE_TITLE_FORMAT " %s\n", READABLE_DATA_FORMAT " %s\n", "----------------------------", readable_number, readable_blocks }; const struct formatter *formatter = &precise_formatter; static void usage(void) { fprintf(stderr, "Usage: %s [-ahHnrS] [-P path] [-D domain]\n", program_name); exit(1); } gfarm_error_t display_statfs(const char *path, const char *dummy) { gfarm_error_t e; gfarm_off_t used, avail, files; char capbuf[GFARM_INT64STRLEN]; char usedbuf[GFARM_INT64STRLEN]; char availbuf[GFARM_INT64STRLEN]; char filesbuf[GFARM_INT64STRLEN]; /* XXX FIXME: should implement and use gfs_statvfs */ e = gfs_statfs(&used, &avail, &files); if (e != GFARM_ERR_NO_ERROR) return (e); (*formatter->blocks_to_string)(capbuf, sizeof capbuf, (unsigned long long)used + avail); (*formatter->blocks_to_string)(usedbuf, sizeof usedbuf, (unsigned long long)used); (*formatter->blocks_to_string)(availbuf, sizeof availbuf, (unsigned long long)avail); (*formatter->number_to_string)(filesbuf, sizeof filesbuf, (unsigned long long)files); printf(formatter->summary_title_format, "1K-blocks", "Used", "Avail", "Use%", "Files"); printf(formatter->summary_data_format, capbuf, usedbuf, availbuf, (double)used / (used + avail) * 100, filesbuf); return (GFARM_ERR_NO_ERROR); } static int compare_hostname(const void *s1, const void *s2) { const struct gfarm_host_sched_info *h1 = s1; const struct gfarm_host_sched_info *h2 = s2; return (strcoll(h1->host, h2->host)); } static int compare_hostname_r(const void *s1, const void *s2) { return (-compare_hostname(s1, s2)); } static int compare_available_capacity(const void *s1, const void *s2) { const struct gfarm_host_sched_info *h1 = s1; const struct gfarm_host_sched_info *h2 = s2; gfarm_uint64_t a1, a2; a1 = h1->disk_avail; a2 = h2->disk_avail; if (a1 < a2) return (-1); else if (a1 > a2) return (1); else return (0); } static int compare_available_capacity_r(const void *s1, const void *s2) { return (-compare_available_capacity(s1, s2)); } /* XXX FIXME: should traverse all mounted metadata servers */ gfarm_error_t schedule_host_domain(const char *path, const char *domain, int *nhostsp, struct gfarm_host_sched_info **hostsp) { gfarm_error_t e; struct gfm_connection *gfm_server; int (*compare)(const void *, const void *); if ((e = gfm_client_connection_and_process_acquire_by_path(path, &gfm_server)) != GFARM_ERR_NO_ERROR) return (e); e = gfm_client_schedule_host_domain(gfm_server, domain, nhostsp, hostsp); gfm_client_connection_free(gfm_server); if (e != GFARM_ERR_NO_ERROR) return (e); #ifdef __GNUC__ /* workaround gcc warning: unused variable */ compare = NULL; #endif switch (option_sort_order) { case SO_NAME: compare = !option_reverse_sort ? compare_hostname : compare_hostname_r; break; case SO_SIZE: compare = !option_reverse_sort ? compare_available_capacity : compare_available_capacity_r; break; } qsort(*hostsp, *nhostsp, sizeof(**hostsp), compare); return (e); } gfarm_error_t display_statfs_nodes(const char *path, const char *domain) { gfarm_error_t e; int nhosts, i; struct gfarm_host_sched_info *hosts; gfarm_uint64_t used, avail; gfarm_uint64_t total_used = 0, total_avail = 0; char capbuf[GFARM_INT64STRLEN]; char usedbuf[GFARM_INT64STRLEN]; char availbuf[GFARM_INT64STRLEN]; e = schedule_host_domain(path, domain, &nhosts, &hosts); if (e != GFARM_ERR_NO_ERROR) return (e); printf(formatter->nodes_title_format, "1K-blocks", "Used", "Avail", "Use%", "Host"); for (i = 0; i < nhosts; ++i) { used = hosts[i].disk_used; avail = hosts[i].disk_avail; (*formatter->blocks_to_string)(capbuf, sizeof capbuf, (unsigned long long)used + avail); (*formatter->blocks_to_string)(usedbuf, sizeof usedbuf, (unsigned long long)used); (*formatter->blocks_to_string)(availbuf, sizeof availbuf, (unsigned long long)avail); printf(formatter->nodes_data_format, capbuf, usedbuf, availbuf, (double)used / (used + avail) * 100, hosts[i].host); total_used += used; total_avail += avail; } if (nhosts > 0) { puts(formatter->nodes_separator); (*formatter->blocks_to_string)(capbuf, sizeof capbuf, (unsigned long long)total_used + total_avail); (*formatter->blocks_to_string)(usedbuf, sizeof usedbuf, (unsigned long long)total_used); (*formatter->blocks_to_string)(availbuf, sizeof availbuf, (unsigned long long)total_avail); printf(formatter->nodes_data_format, capbuf, usedbuf, availbuf, (double)total_used / (total_used + total_avail) * 100, ""); } else puts("No file system node"); gfarm_host_sched_info_free(nhosts, hosts); return (GFARM_ERR_NO_ERROR); } gfarm_error_t display_nodes(const char *path, const char *domain) { gfarm_error_t e; int nhosts, i; struct gfarm_host_sched_info *hosts; e = schedule_host_domain(path, domain, &nhosts, &hosts); if (e != GFARM_ERR_NO_ERROR) return (e); for (i = 0; i < nhosts; ++i) printf("%s\n", hosts[i].host); gfarm_host_sched_info_free(nhosts, hosts); return (e); } int main(int argc, char *argv[]) { gfarm_error_t e; const char *domain = "", *path = GFARM_PATH_ROOT; gfarm_error_t (*statfs)(const char *, const char *) = display_statfs_nodes; int c; if (argc > 0) program_name = basename(argv[0]); e = gfarm_initialize(&argc, &argv); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", program_name, gfarm_error_string(e)); exit(1); } while ((c = getopt(argc, argv, "ahHnrD:P:S?")) != -1) { switch (c) { case 'a': statfs = display_statfs; break; case 'h': formatter = &readable_formatter; option_formatting_flags = GFARM_HUMANIZE_BINARY; break; case 'H': formatter = &readable_formatter; option_formatting_flags = 0; break; case 'n': statfs = display_nodes; break; case 'r': option_reverse_sort = 1; break; case 'D': domain = optarg; break; case 'P': path = optarg; break; case 'S': option_sort_order = SO_SIZE; break; case '?': default: usage(); } } e = statfs(path, domain); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", program_name, gfarm_error_string(e)); exit(1); } e = gfarm_terminate(); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", program_name, gfarm_error_string(e)); exit(1); } exit (0); } gfarm-2.4.1/gftool/gfdf/gfdf.c0000644000000000000000000000675111507222717014577 0ustar rootroot#include #include #include #include char *program_name = "gfdf"; void inode_title(void) { printf("%12s%12s%12s%7s %s\n", "Inodes", "IUsed", "IAvail", "%IUsed", "Host"); } void size_title(void) { printf("%12s%12s%12s%9s %s\n", "1K-blocks", "Used", "Avail", "Capacity", "Host"); } char * inode_print(char *host) { char *e; gfarm_int32_t bsize; file_offset_t blocks, bfree, bavail, files, ffree, favail; e = gfs_statfsnode(host, &bsize, &blocks, &bfree, &bavail, &files, &ffree, &favail); if (e != NULL) { fprintf(stderr, "%s: %s\n", host, e); return (e); } printf("%12.0f%12.0f%12.0f %3.0f%% %s\n", (double)files, (double)files - ffree, (double)favail, (double)(files - ffree)/(files - (ffree - favail))*100.0, host); return (NULL); } char * size_print(char *host) { char *e; gfarm_int32_t bsize; file_offset_t blocks, bfree, bavail, files, ffree, favail; e = gfs_statfsnode(host, &bsize, &blocks, &bfree, &bavail, &files, &ffree, &favail); if (e != NULL) { fprintf(stderr, "%s: %s\n", host, e); return (e); } printf("%12.0f%12.0f%12.0f %3.0f%% %s\n", (double)(blocks * bsize) / 1024.0, (double)(blocks - bfree) * bsize / 1024., (double)bavail * bsize / 1024.0, (double)(blocks - bfree)/(blocks - (bfree - bavail))*100.0, host); return (NULL); } #define EXIT_INVALID_ARGUMENT 2 void usage(void) { fprintf(stderr, "Usage:\t%s -h \n", program_name); fprintf(stderr, "\t%s -H \n", program_name); exit(EXIT_INVALID_ARGUMENT); } int main(int argc, char **argv) { int status = EXIT_SUCCESS; void (*title)(void) = size_title; char *(*print)(char *) = size_print; char *e, **hosts = NULL; int c, i, lineno, ninfos, nhosts = 0; gfarm_stringlist hostlist; struct gfarm_host_info *infos; if ((e = gfarm_initialize(&argc, &argv)) != NULL) { fprintf(stderr, "%s: gfarm initialize: %s\n", program_name, e); exit(EXIT_FAILURE); } gfarm_stringlist_init(&hostlist); while ((c = getopt(argc, argv, "H:h:i?")) != -1) { switch (c) { case 'H': e = gfarm_hostlist_read(optarg, &nhosts, &hosts, &lineno); if (e != NULL) { if (lineno != -1) { fprintf(stderr, "%s: %s: line %d: %s\n", program_name, optarg, lineno, e); } else { fprintf(stderr, "%s: %s: %s\n", program_name, optarg, e); } exit(EXIT_INVALID_ARGUMENT); } break; case 'h': gfarm_stringlist_add(&hostlist, optarg); break; case 'i': title = inode_title; print = inode_print; break; case '?': /*FALLTHROUGH*/ default: usage(); } } if (optind < argc) usage(); (*title)(); if (nhosts == 0 && gfarm_stringlist_length(&hostlist) == 0) { /* list all filesystem node */ e = gfarm_host_info_get_all(&ninfos, &infos); if (e != NULL) { fprintf(stderr, "%s: %s\n", program_name, e); status = EXIT_FAILURE; } else { for (i = 0; i < ninfos; i++) { if ((*print)(infos[i].hostname) != NULL) status = EXIT_FAILURE; } } } else { for (i = 0; i < nhosts; i++) { if ((*print)(hosts[i]) != NULL) status = EXIT_FAILURE; } for (i = 0; i < gfarm_stringlist_length(&hostlist); i++) { if (print(gfarm_stringlist_elem(&hostlist, i)) != NULL) status = EXIT_FAILURE; } } gfarm_strings_free_deeply(nhosts, hosts); gfarm_stringlist_free(&hostlist); if ((e = gfarm_terminate()) != NULL) { fprintf(stderr, "%s: gfarm terminate: %s\n", program_name, e); exit(EXIT_FAILURE); } return (status); } gfarm-2.4.1/gftool/gfpath/0000755000000000000000000000000011507222730014052 5ustar rootrootgfarm-2.4.1/gftool/gfpath/Makefile0000644000000000000000000000052111507222717015515 0ustar rootroottop_builddir = ../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk PROGRAM = gfpath SRCS = $(PROGRAM).c OBJS = $(PROGRAM).o CFLAGS = $(COMMON_CFLAGS) LDLIBS = $(COMMON_LDFLAGS) $(GFARMLIB) $(LIBS) DEPLIBS = $(DEPGFARMLIB) all: $(PROGRAM) include $(top_srcdir)/makes/prog.mk ### $(OBJS): $(DEPGFARMINC) gfarm-2.4.1/gftool/gfpath/gfpath.c0000644000000000000000000000272511507222717015502 0ustar rootroot#include #include #include #include #include const char *program_name = "gfpath"; void usage() { fprintf(stderr, "Usage: %s -b pathname\n", program_name); fprintf(stderr, " %s -d pathname\n", program_name); exit(2); } int main(int argc, char **argv) { gfarm_error_t e; int ch, mode = 0; const char *s; char *path, *allocated = NULL; if (argc > 0) program_name = basename(argv[0]); e = gfarm_initialize(&argc, &argv); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", program_name, gfarm_error_string(e)); exit(1); } while ((ch = getopt(argc, argv, "bdDE")) != -1) { switch (ch) { case 'b': case 'd': case 'D': case 'E': mode = ch; break; default: usage(); } } argc -= optind; argv += optind; if (argc != 1) usage(); path = argv[0]; switch (mode) { case 'd': s = allocated = gfarm_url_dir(path); break; case 'B': s = gfarm_path_dir_skip(path); break; case 'D': s = allocated = gfarm_path_dir(path); break; default: usage(); /*NOTREACHED*/ #ifdef __GNUC__ /* workaround gcc warning: may be used uninitialized */ s = NULL; #endif } if (s == NULL) { fprintf(stderr, "%s: no memory for \"%s\"\n", program_name, path); exit(1); } printf("%s\n", s); free(allocated); e = gfarm_terminate(); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", program_name, gfarm_error_string(e)); exit(1); } return (0); } gfarm-2.4.1/gftool/addpath/0000755000000000000000000000000011507222730014206 5ustar rootrootgfarm-2.4.1/gftool/addpath/addpath.c0000644000000000000000000000661611507222717015775 0ustar rootroot/* * $Id: addpath.c 825 2003-10-20 07:09:29Z tatebe $ */ #include #include #include #include #include #include #include #include #include /* * */ static char * gfarm_path_info_set_from_file(char *pathname, int nfrags) { struct stat sb; struct passwd *pw; struct gfarm_path_info pi; char *e, *p, *username; if (stat(pathname, &sb)) return "no such file"; /* remove a section part. */ p = pathname; while (*p) { if (*p == ':') { *p = '\0'; break; } ++p; } pw = getpwuid(sb.st_uid); if (pw == NULL) return "no such user"; if (gfarm_path_info_get(pathname, &pi) == NULL) { gfarm_path_info_free(&pi); return (GFARM_ERR_ALREADY_EXISTS); } e = gfarm_local_to_global_username(pw->pw_name, &username); if (e != NULL) return (e); pi.pathname = pathname; pi.status.st_mode = GFARM_S_IFREG | (sb.st_mode & GFARM_S_ALLPERM); pi.status.st_user = username; pi.status.st_group = "*"; /* XXX for now */ pi.status.st_atimespec.tv_sec = sb.st_atime; pi.status.st_mtimespec.tv_sec = sb.st_mtime; pi.status.st_ctimespec.tv_sec = sb.st_ctime; pi.status.st_atimespec.tv_nsec = pi.status.st_mtimespec.tv_nsec = pi.status.st_ctimespec.tv_nsec = 0; pi.status.st_size = 0; pi.status.st_nsections = nfrags; e = gfarm_path_info_set(pi.pathname, &pi); free(username); return (e); } static char * gfarm_path_info_remove_all(char *pathname) { char *e, *e_save = NULL; #if 0 struct gfarm_path_info pi; /* * It is not necessary to check whether pathname is a * directory or not. This function would like to force to * remove the path information from file system metadata. */ if (gfarm_path_info_get(pathname, &pi) == NULL) { if (GFARM_S_ISDIR(pi.status.st_mode)) { gfarm_path_info_free(&pi); return (GFARM_ERR_IS_A_DIRECTORY); } gfarm_path_info_free(&pi); } #endif e = gfarm_file_section_copy_info_remove_all_by_file(pathname); if (e != NULL) e_save = e; e = gfarm_file_section_info_remove_all_by_file(pathname); if (e != NULL) e_save = e; e = gfarm_path_info_remove(pathname); if (e != NULL) e_save = e; return (e_save); } /* * */ static char *progname = "addpath"; void usage() { fprintf(stderr, "usage: %s pathname:sec nfrags\n", progname); fprintf(stderr, " %s -d pathname\n", progname); } int main(int argc, char *argv[]) { char *pathname; int nfrags; char *e; extern int optind; int c; enum { add, delete } mode = add; e = gfarm_initialize(&argc, &argv); if (e != NULL) { fprintf(stderr, "%s: %s\n", progname, e); } while ((c = getopt(argc, argv, "d")) != EOF) { switch (c) { case 'd': mode = delete; break; default: usage(); exit(1); } } argc -= optind; argv += optind; if (argc > 0) pathname = argv[0]; else { fprintf(stderr, "%s: too few arguments\n", progname); usage(); exit(1); } --argc; ++argv; switch (mode) { case add: if (argc == 1) nfrags = atoi(argv[0]); else { usage(); exit(1); } e = gfarm_path_info_set_from_file(pathname, nfrags); if (e != NULL) { fprintf(stderr, "%s: %s\n", pathname, e); exit(1); } break; case delete: e = gfarm_path_info_remove_all(pathname); if (e != NULL) { fprintf(stderr, "%s: %s\n", pathname, e); exit(1); } break; } e = gfarm_terminate(); if (e != NULL) { fprintf(stderr, "%s: %s\n", pathname, e); } exit(0); } gfarm-2.4.1/gftool/addpath/Makefile0000644000000000000000000000062311507222717015654 0ustar rootroot# $Id: Makefile 2373 2006-01-12 00:54:22Z soda $ top_builddir = ../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk SRCS = addpath.c OBJS = addpath.o PROGRAM = addpath CFLAGS = $(COMMON_CFLAGS) -I$(GFARMLIB_SRCDIR) LDLIBS = $(COMMON_LDFLAGS) $(GFARMLIB) $(LIBS) DEPLIBS = $(DEPGFARMLIB) all: $(PROGRAM) include $(top_srcdir)/makes/prog.mk ### $(OBJS): $(DEPGFARMINC) gfarm-2.4.1/gftool/gfgroup/0000755000000000000000000000000011507222730014252 5ustar rootrootgfarm-2.4.1/gftool/gfgroup/gfgroup.c0000644000000000000000000001037411507222717016101 0ustar rootroot/* * $Id$ */ #include #include #include #include #include #include #include "gfm_client.h" #include "lookup.h" #include "config.h" #define OP_GROUPNAME '\0' #define OP_LIST_LONG 'l' #define OP_CREATE_GROUP 'c' #define OP_DELETE_GROUP 'd' #define OP_MODIFY_GROUP 'm' #define OP_ADD_ENTRY 'a' #define OP_REMOVE_ENTRY 'r' char *program_name = "gfgroup"; struct gfm_connection *gfm_server; void usage(void) { fprintf(stderr, "Usage:\t%s [-P ] [-l] [groupname ...]\n", program_name); fprintf(stderr, "\t%s [-P ] -c groupname user1 user2 ...\n", program_name); fprintf(stderr, "\t%s [-P ] -m groupname user1 user2 ...\n", program_name); fprintf(stderr, "\t%s [-P ] -d groupname\n", program_name); exit(1); } gfarm_error_t create_group(int op, char *groupname, int nusers, char **users) { struct gfarm_group_info group; gfarm_error_t e; group.groupname = groupname; group.nusers = nusers; group.usernames = users; switch (op) { case OP_CREATE_GROUP: e = gfm_client_group_info_set(gfm_server, &group); break; case OP_MODIFY_GROUP: e = gfm_client_group_info_modify(gfm_server, &group); break; default: e = GFARM_ERR_INVALID_ARGUMENT; } return (e); } gfarm_error_t delete_group(char *groupname) { return (gfm_client_group_info_remove(gfm_server, groupname)); } static void display_group(int op, int n, char *names[], gfarm_error_t *errs, struct gfarm_group_info *groups) { int i, j; for (i = 0; i < n; ++i) { if (errs != NULL && errs[i] != GFARM_ERR_NO_ERROR) { assert(names != NULL); fprintf(stderr, "%s: %s\n", names[i], gfarm_error_string(errs[i])); continue; } printf("%s", groups[i].groupname); if (op == OP_LIST_LONG) { printf(":"); for (j = 0; j < groups[i].nusers; ++j) printf(" %s", groups[i].usernames[j]); } puts(""); gfarm_group_info_free(&groups[i]); } } gfarm_error_t list_all(int op) { struct gfarm_group_info *groups; gfarm_error_t e; int n; e = gfm_client_group_info_get_all(gfm_server, &n, &groups); if (e != GFARM_ERR_NO_ERROR) return (e); display_group(op, n, NULL, NULL, groups); free(groups); return (e); } gfarm_error_t list(int op, int n, char *names[]) { struct gfarm_group_info *groups; gfarm_error_t e, *errs; GFARM_MALLOC_ARRAY(groups, n); GFARM_MALLOC_ARRAY(errs, n); if (groups == NULL || errs == NULL) { e = GFARM_ERR_NO_MEMORY; goto free_groups; } e = gfm_client_group_info_get_by_names( gfm_server, n, (const char **)names, errs, groups); if (e != GFARM_ERR_NO_ERROR) goto free_groups; display_group(op, n, names, errs, groups); free_groups: if (groups != NULL) free(groups); if (errs != NULL) free(errs); return (e); } int main(int argc, char *argv[]) { gfarm_error_t e; char op = OP_GROUPNAME, *groupname; int c; const char *path = GFARM_PATH_ROOT; e = gfarm_initialize(&argc, &argv); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: gfarm_initialize: %s\n", program_name, gfarm_error_string(e)); exit(1); } while ((c = getopt(argc, argv, "P:cdlm?")) != -1) { switch (c) { case 'P': path = optarg; break; case OP_CREATE_GROUP: case OP_DELETE_GROUP: case OP_MODIFY_GROUP: case OP_LIST_LONG: op = c; break; case '?': default: usage(); } } argc -= optind; argv += optind; if ((e = gfm_client_connection_and_process_acquire_by_path(path, &gfm_server)) != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: metadata server for \"%s\": %s\n", program_name, path, gfarm_error_string(e)); exit(1); } switch (op) { case OP_GROUPNAME: case OP_LIST_LONG: if (argc == 0) e = list_all(op); else e = list(op, argc, argv); break; case OP_CREATE_GROUP: case OP_MODIFY_GROUP: if (argc < 1) usage(); groupname = *argv++; --argc; e = create_group(op, groupname, argc, argv); break; case OP_DELETE_GROUP: if (argc != 1) usage(); e = delete_group(*argv); break; } if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", program_name, gfarm_error_string(e)); exit(1); } gfm_client_connection_free(gfm_server); e = gfarm_terminate(); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: gfarm_terminate: %s\n", program_name, gfarm_error_string(e)); exit(1); } exit(0); } gfarm-2.4.1/gftool/gfgroup/Makefile0000644000000000000000000000074311507222717015723 0ustar rootroot# $Id$ top_builddir = ../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk PROGRAM = gfgroup SRCS = $(PROGRAM).c OBJS = $(PROGRAM).o CFLAGS = $(COMMON_CFLAGS) -I$(GFUTIL_SRCDIR) -I$(GFARMLIB_SRCDIR) LDLIBS = $(COMMON_LDFLAGS) $(GFARMLIB) $(LIBS) DEPLIBS = $(DEPGFARMLIB) all: $(PROGRAM) include $(top_srcdir)/makes/prog.mk ### $(OBJS): $(DEPGFARMINC) \ $(GFARMLIB_SRCDIR)/lookup.h \ $(GFARMLIB_SRCDIR)/gfm_client.h \ $(GFARMLIB_SRCDIR)/config.h gfarm-2.4.1/gftool/Makefile0000644000000000000000000000131211507222717014243 0ustar rootroottop_builddir = .. top_srcdir = $(top_builddir) srcdir = . GFVOMS_SYNC_TARGETS = gfvoms-sync include $(top_srcdir)/makes/var.mk PRIVATE_TARGETS = $(PRIVATE_GFTOOL_SUBDIRS) PUBLIC_TARGETS = SUBDIRS = \ gfchmod \ gfchown \ gfdf \ gfdump \ gfexport \ gffindxmlattr \ gfgroup \ gfhost \ gfkey \ gfln \ gfls \ gfmkdir \ gfmv \ gfpath \ gfquota \ gfreg \ gfrep \ gfrm \ gfrmdir \ gfsched \ gfstat \ gfstatus \ gfuser \ gfusage \ $(gfvoms_sync_targets) \ gfwhere \ gfwhoami \ gfxattr \ config-gfarm \ $(optional_targets) # gfexec \ # gfifo \ # gfpwd \ # gfrcmd \ # gfsck \ # gfsetdir \ # gfmpirun \ # gfps \ # gfq \ # gfrun \ # gftest \ # example \ include $(top_srcdir)/makes/subdir.mk gfarm-2.4.1/gftool/example/0000755000000000000000000000000011507222730014234 5ustar rootrootgfarm-2.4.1/gftool/example/Makefile.inc0000644000000000000000000000003311507222717016445 0ustar rootrootbindir = $(example_bindir) gfarm-2.4.1/gftool/example/gfimport_text/0000755000000000000000000000000011507222730017127 5ustar rootrootgfarm-2.4.1/gftool/example/gfimport_text/gfimport_text.c0000644000000000000000000001063711507222717022202 0ustar rootroot#include #include #include #include #include #include #include #include #include char *program_name = "gfimport_text"; char * import_text(FILE *ifp, char *output, int nfrags, char **hosttab, file_offset_t *sizetab) { int i, c; char *e; struct gfs_file *of; file_offset_t size; e = gfs_pio_create(output, GFARM_FILE_WRONLY|GFARM_FILE_TRUNC, 0666, &of); if (e != NULL) { fprintf(stderr, "%s: %s\n", output, e); return (e); } for (i = 0; i < nfrags; i++) { e = gfs_pio_set_view_index(of, nfrags, i, hosttab[i], GFARM_FILE_SEQUENTIAL); if (e != NULL) goto error_on_fragment; size = 0; for (;;) { if (size >= sizetab[i]) /* wrote enough */ break; for (;;) { c = getc(ifp); if (c == EOF) break; e = gfs_pio_putc(of, c); if (e != NULL) goto error_on_fragment; size++; if (c == '\n') break; } if (c == EOF) break; } } e = gfs_pio_close(of); if (e != NULL) { fprintf(stderr, "%s: %s\n", output, e); goto error_on_close; } return (NULL); error_on_fragment: fprintf(stderr, "%s, fragment %d: %s\n", output, i, e); gfs_pio_close(of); error_on_close: gfarm_url_fragment_cleanup(output, nfrags, hosttab); gfs_unlink(output); return (e); } void check_file_size(FILE *ifp, char *iname, off_t *size) { struct stat is; if (fstat(fileno(ifp), &is) == -1) { perror(iname); exit(1); } if (!S_ISREG(is.st_mode)) { fprintf(stderr, "%s: size unknown\n", iname); exit(1); } *size = is.st_size; } void usage() { fprintf(stderr, "Usage: %s [option] \n", program_name); fprintf(stderr, "option:\n"); fprintf(stderr, "\t-H \n"); fprintf(stderr, "\t-N \n"); fprintf(stderr, "\t-f \n"); fprintf(stderr, "\t-o \n"); exit(1); } static void conflict_check(int *mode_ch_p, int ch) { if (*mode_ch_p) { fprintf(stderr, "%s: -%c option conflicts with -%c\n", program_name, ch, *mode_ch_p); usage(); } *mode_ch_p = ch; } int main(int argc, char *argv[]) { int argc_save = argc; char **argv_save = argv; char *e, *config = NULL, *hostfile = NULL, *output = NULL, *iname; int ch, nhosts = -1, error_line, mode_ch = 0; FILE *ifp; char **hosttab; file_offset_t *sizetab; off_t filesize; if (argc >= 1) program_name = basename(argv[0]); while ((ch = getopt(argc, argv, "H:N:f:o:")) != -1) { switch (ch) { case 'H': hostfile = optarg; conflict_check(&mode_ch, ch); break; case 'N': nhosts = atoi(optarg); conflict_check(&mode_ch, ch); break; case 'f': config = optarg; conflict_check(&mode_ch, ch); break; case 'o': output = optarg; break; case '?': default: usage(); } } argc -= optind; argv += optind; if (output == NULL) { fprintf(stderr, "%s: -o expected\n", program_name); exit(1); } if (argc == 0) { iname = "stdin"; ifp = stdin; } else if (argc != 1) { fprintf(stderr, "%s: error: multiple input file name specified\n", program_name); exit(1); } else { iname = argv[0]; ifp = fopen(iname, "r"); if (ifp == NULL) { perror(iname); exit(1); } } e = gfarm_initialize(&argc_save, &argv_save); if (e != NULL) { fprintf(stderr, "%s: %s\n", program_name, e); exit(1); } if (config != NULL) { e = gfarm_import_fragment_config_read( config, &nhosts, &hosttab, &sizetab, &error_line); } else { check_file_size(ifp, iname, &filesize); if (hostfile != NULL) { e = gfarm_hostlist_read(hostfile, &nhosts, &hosttab, &error_line); } else if (nhosts != -1) { GFARM_MALLOC_ARRAY(hosttab, nhosts); if (hosttab == NULL) { fprintf(stderr, "%s: no memory\n", program_name); exit(1); } e = gfarm_schedule_search_idle_by_all(nhosts, hosttab); } else usage(); if (e == NULL) { sizetab = gfarm_import_fragment_size_alloc( filesize, nhosts); if (sizetab == NULL) { fprintf(stderr, "%s: not enough memory for %d hosts\n", program_name, nhosts); exit(1); } } } if (e != NULL) { if (config != NULL) fprintf(stderr, "%s: line %d: %s\n", config, error_line, e); else fprintf(stderr, "%s: %s\n", program_name, e); return (1); } import_text(ifp, output, nhosts, hosttab, sizetab); e = gfarm_terminate(); if (e != NULL) { fprintf(stderr, "%s: %s\n", program_name, e); exit(1); } return (0); } gfarm-2.4.1/gftool/example/gfimport_text/Makefile0000644000000000000000000000066411507222717020602 0ustar rootroot# $Id: Makefile 2373 2006-01-12 00:54:22Z soda $ top_builddir = ../../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk include $(srcdir)/../Makefile.inc SRCS = gfimport_text.c OBJS = gfimport_text.o PROGRAM = gfimport_text CFLAGS = $(COMMON_CFLAGS) LDLIBS = $(COMMON_LDLIBS) $(GFARMLIB) $(LIBS) DEPLIBS = $(DEPGFARMLIB) all: $(PROGRAM) include $(top_srcdir)/makes/prog.mk ### $(OBJS): $(DEPGFARMINC) gfarm-2.4.1/gftool/example/Makefile0000644000000000000000000000026611507222717015705 0ustar rootroottop_builddir = ../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk SUBDIRS = \ gfimport_fixed \ gfimport_text include $(top_srcdir)/makes/subdir.mk gfarm-2.4.1/gftool/example/gfimport_fixed/0000755000000000000000000000000011507222730017242 5ustar rootrootgfarm-2.4.1/gftool/example/gfimport_fixed/gfimport_fixed.c0000644000000000000000000001047411507222717022427 0ustar rootroot#include #include #include #include #include #include #include #include #include char *program_name = "gfimport_fixed"; char * import_fixed(FILE *ifp, char *output, int len, int nfrags, char **hosttab, file_offset_t *sizetab) { int i, n, rv; char *e; struct gfs_file *of; char *buffer; file_offset_t size; GFARM_MALLOC_ARRAY(buffer, len); if (buffer == NULL) { fprintf(stderr, "no memory\n"); return (GFARM_ERR_NO_MEMORY); } e = gfs_pio_create(output, GFARM_FILE_WRONLY|GFARM_FILE_TRUNC, 0666, &of); if (e != NULL) { fprintf(stderr, "%s: %s\n", output, e); free(buffer); return (e); } for (i = 0; i < nfrags; i++) { e = gfs_pio_set_view_index(of, nfrags, i, hosttab[i], GFARM_FILE_SEQUENTIAL); if (e != NULL) goto error_on_fragment; size = 0; for (;;) { if (size >= sizetab[i]) /* wrote enough */ break; n = fread(buffer, 1, len, ifp); if (n == 0) /* EOF */ break; e = gfs_pio_write(of, buffer, n, &rv); if (e != NULL) goto error_on_fragment; size += n; if (n < len) /* EOF */ break; } } e = gfs_pio_close(of); free(buffer); if (e != NULL) { fprintf(stderr, "%s: %s\n", output, e); goto error_on_close; } return (NULL); error_on_fragment: fprintf(stderr, "%s, fragment %d: %s\n", output, i, e); gfs_pio_close(of); free(buffer); error_on_close: gfarm_url_fragment_cleanup(output, nfrags, hosttab); gfs_unlink(output); return (e); } void usage() { fprintf(stderr, "Usage: %s [option] \n", program_name); fprintf(stderr, "option:\n"); fprintf(stderr, "\t-H \n"); fprintf(stderr, "\t-f \n"); fprintf(stderr, "\t-l \n"); fprintf(stderr, "\t-o \n"); exit(1); } int main(argc, argv) int argc; char **argv; { extern char *optarg; extern int optind; int argc_save = argc; char **argv_save = argv; char *e, *config = NULL, *hostfile = NULL, *output = NULL, *iname; int ch, nhosts, error_line, len = 1; FILE *ifp; char **hosttab; file_offset_t *sizetab; if (argc >= 1) program_name = basename(argv[0]); while ((ch = getopt(argc, argv, "H:f:l:o:")) != -1) { switch (ch) { case 'H': hostfile = optarg; break; case 'f': config = optarg; break; case 'l': len = strtol(optarg, NULL, 0); break; case 'o': output = optarg; break; case '?': default: usage(); } } argc -= optind; argv += optind; if (output == NULL) { fprintf(stderr, "%s: -o expected\n", program_name); exit(1); } if (argc == 0) { iname = "stdin"; ifp = stdin; } else if (argc != 1) { fprintf(stderr, "%s: error: multiple input file name specified\n", program_name); exit(1); } else { iname = argv[0]; ifp = fopen(iname, "r"); if (ifp == NULL) { perror(iname); exit(1); } } e = gfarm_initialize(&argc_save, &argv_save); if (e != NULL) { fprintf(stderr, "%s: %s\n", program_name, e); exit(1); } if (hostfile != NULL && config != NULL) { fprintf(stderr, "%s: ambiguous. both -H %s and -f %s specified\n", program_name, hostfile, config); exit(1); } else if (config != NULL) { e = gfarm_import_fragment_config_read( config, &nhosts, &hosttab, &sizetab, &error_line); } else if (hostfile != NULL) { struct stat is; if (fstat(fileno(ifp), &is) == -1) { perror(iname); exit(1); } if (!S_ISREG(is.st_mode)) { fprintf(stderr, "%s: size unknown\n", iname); exit(1); } e = gfarm_hostlist_read(hostfile, &nhosts, &hosttab, &error_line); if (e == NULL) { sizetab = gfarm_import_fragment_size_alloc( is.st_size, nhosts); if (sizetab == NULL) { fprintf(stderr, "%s: not enough memory for %d hosts\n", program_name, nhosts); exit(1); } } } else /* if (hostfile == NULL && config == NULL) */ { fprintf(stderr, "%s: either -H or -f expected\n", program_name); exit(1); } if (e != NULL) { if (error_line != -1) fprintf(stderr, "%s: line %d: %s\n", config, error_line, e); else fprintf(stderr, "%s: %s\n", program_name, e); return (1); } import_fixed(ifp, output, len, nhosts, hosttab, sizetab); e = gfarm_terminate(); if (e != NULL) { fprintf(stderr, "%s: %s\n", program_name, e); exit(1); } return (0); } gfarm-2.4.1/gftool/example/gfimport_fixed/Makefile0000644000000000000000000000067011507222717020712 0ustar rootroot# $Id: Makefile 2373 2006-01-12 00:54:22Z soda $ top_builddir = ../../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk include $(srcdir)/../Makefile.inc SRCS = gfimport_fixed.c OBJS = gfimport_fixed.o PROGRAM = gfimport_fixed CFLAGS = $(COMMON_CFLAGS) LDLIBS = $(COMMON_LDFLAGS) $(GFARMLIB) $(LIBS) DEPLIBS = $(DEPGFARMLIB) all: $(PROGRAM) include $(top_srcdir)/makes/prog.mk ### $(OBJS): $(DEPGFARMINC) gfarm-2.4.1/gftool/gfvoms-sync/0000755000000000000000000000000011507222730015054 5ustar rootrootgfarm-2.4.1/gftool/gfvoms-sync/gfvoms-update/0000755000000000000000000000000011507222730017635 5ustar rootrootgfarm-2.4.1/gftool/gfvoms-sync/gfvoms-update/gfvoms-update.c0000644000000000000000000005572411507222717022604 0ustar rootroot/* * gfvoms-update.c * * Copyright (c) 2009 National Institute of Informatics in Japan. * All rights reserved. */ #include #include #include #include #include #include #include #include "gfm_client.h" #include "lookup.h" #include "config.h" #define MAX_LINE_LEN 4096 #define USER_ALLOC_SIZE 20 #define VOID_FORM "void=" #define VO_FORM "vo=" #define GROUP_FORM "voms=" #define USER_FORM "user=" #define OP_VOMS_FILE 'm' #define OP_VOMSID 'V' #define OP_VO 'v' #define OP_NO_UPDATE 'n' #define OP_USAGE 'h' #define OP_DELETE 'd' #define OP_ADD 1 #define OP_DEL 2 #define OP_MOD 3 char *program_name = "gfvoms-update"; struct gfm_connection *gfm_server = NULL; struct gfarm_user_info *users = NULL; int ngroups = 0; struct gfarm_group_info *groups = NULL; int nusers = 0; char *vomsid = NULL; char *vo = NULL; char *vomsfile = NULL; #define SET_VOMS_MEMBER_FILE(arg, e) \ do {\ vomsfile = strdup((arg));\ if (vomsfile == NULL) {\ (e) = GFARM_ERR_NO_MEMORY;\ }\ } while(0) #define SET_VO(arg, e) \ do {\ GFARM_CALLOC_ARRAY(vo, (strlen(arg) + 2));\ if (vo == NULL) {\ (e) = GFARM_ERR_NO_MEMORY;\ }\ else {\ memset(vo, '\0', (strlen(arg) + 2));\ sprintf(vo, "/%s", (arg));\ }\ } while(0) #define SET_VOMSID(arg, e) \ do {\ vomsid = strdup((arg));\ if (vomsid == NULL) {\ (e) = GFARM_ERR_NO_MEMORY;\ }\ } while(0) /* doubly-circularly-linked list for group */ struct group_info_list { struct group_info_list *next; struct group_info_list *pre; char *group_name; struct gfarm_group_info *group_info; struct gfarm_user_info **user_infos; int nusers; }; static void usage(void) { fprintf(stderr, "Usage: %s [-n] [-h] [-d] -V vomsID -v vo -m member-list\n", program_name); fprintf(stderr, " -h : Show this usage.\n"); fprintf(stderr, " -d : Delete target vo groups from Gfarm.\n"); fprintf(stderr, " -V vomsID : ID which defined in Definition file\n"); fprintf(stderr, " -v vo : VO name which you want to sync\n"); fprintf(stderr, " -m member-list: MemberShip list generated by gfvoms-list\n"); fprintf(stderr, " -n : Debug option. No update occurs.\n"); } /* delete space, CR and LF from head and tail of the string.*/ static int trim(char *str, int len) { int i, j; for (i = 0; i < len; i++) { if ((!isspace(str[i]) && str[i] != '\n' && str[i] != '\r') || str[i] == '\0') { break; } } if (i > 0) { for (j = 0; j < len - i; j++) { str[j] = str[i+j]; } for (; j < len; j++) { str[j] = '\0'; } } i = len - i - 1; while (i >= 0 && isspace(str[i])) { str[i] = '\0'; i--; } while (strlen(str) > 0 && (str[strlen(str) - 1] == '\n' || str[strlen(str) - 1] == '\r')) { str[strlen(str) - 1] = '\0'; } return 0; } /* get groups from gfarm */ static gfarm_error_t list_groups(void) { struct gfarm_group_info *g = NULL; gfarm_error_t e = GFARM_ERR_NO_ERROR; int n; e = gfm_client_group_info_get_all(gfm_server, &n, &g); if (e == GFARM_ERR_NO_ERROR) { groups = g; ngroups = n; } return (e); } /* get users from gfarm */ static gfarm_error_t list_users(void) { struct gfarm_user_info *u = NULL; gfarm_error_t e = GFARM_ERR_NO_ERROR; int n; e = gfm_client_user_info_get_all(gfm_server, &n, &u); if (e == GFARM_ERR_NO_ERROR) { users = u; nusers = n; } return (e); } /* get user by name */ static struct gfarm_user_info * get_user_info_by_name(char* name) { int i; for (i = 0; i < nusers; i++) { if (strcmp(name, users[i].username) == 0) { return &(users[i]); } } return NULL; } /* get user by dn */ static struct gfarm_user_info * get_user_info_by_dn(char* dn) { int i; while (isspace(*dn) && *dn != '\n' && *dn != '\0') { dn++; } for (i = 0; i < nusers; i++) { if (strcmp(dn, users[i].gsi_dn) == 0) { return &(users[i]); } } return NULL; } /* free one group info */ static void free_group_info(struct group_info_list *info) { if (info == NULL) return; if (info->user_infos) free(info->user_infos); if (info->group_name) free(info->group_name); info->pre->next = info->next; info->next->pre = info->pre; free(info); } /* free all group info */ static void free_group_info_list(struct group_info_list *list) { while ((list != NULL) && (list->next != list)) { free_group_info(list->next); } if (list) free_group_info(list); } /* make dummy node for doubly-circularly-linked list */ static gfarm_error_t make_list_head(struct group_info_list **head) { gfarm_error_t e = GFARM_ERR_NO_ERROR; struct group_info_list *tmp = NULL; GFARM_MALLOC(tmp); if (tmp == NULL) { e = GFARM_ERR_NO_MEMORY; goto err; } tmp->next = tmp; tmp->pre = tmp; tmp->group_name = NULL; tmp->group_info = NULL; tmp->user_infos = NULL; tmp->nusers = 0; *head = tmp; return (e); err: if (tmp) free(tmp); return (e); } /* remove node from doubly-circularly-linked list */ static struct group_info_list * remove_list(struct group_info_list *target) { struct group_info_list *tmp = NULL; if (target == NULL) return target; tmp = target->pre; target->pre->next = target->next; target->next->pre = target->pre; target->next = target; target->pre = target; free_group_info(target); return tmp; } /* add node to doubly-circularly-linked list */ static struct group_info_list * add_list(struct group_info_list *target, struct group_info_list *add) { struct group_info_list *tmp = NULL; if (target == NULL || add == NULL) return add; tmp = add->pre; add->next->pre = add->pre; add->pre->next = add->next; target->next->pre = add; add->next = target->next; add->pre = target; target->next = add; return tmp; } /* make new node and add it to doubly-circularly-linked list */ static gfarm_error_t set_new_list(struct group_info_list *pre, struct group_info_list **add, int nuser) { gfarm_error_t e = GFARM_ERR_NO_ERROR; struct group_info_list *tmp = NULL; GFARM_MALLOC(tmp); if (tmp == NULL) { e = GFARM_ERR_NO_MEMORY; goto err; } tmp->next = pre->next; tmp->pre = pre; pre->next = tmp; tmp->next->pre = tmp; tmp->nusers = nuser; tmp->group_name = NULL; tmp->group_info = NULL; tmp->user_infos = NULL; GFARM_CALLOC_ARRAY(tmp->user_infos, nuser); if (tmp->user_infos == NULL) { e = GFARM_ERR_NO_MEMORY; goto err; } *add = tmp; return (e); err: if (tmp) { if (tmp->user_infos) free(tmp->user_infos); free(tmp); } return (e); } /* get gfarm membership list */ static gfarm_error_t make_gfarm_membership_list(struct group_info_list **gfarm_list) { gfarm_error_t e = GFARM_ERR_NO_ERROR; struct group_info_list *tmp1 = NULL, *tmp2 = NULL; int i, j; char *p = NULL, *p2 = NULL; e = make_list_head(&tmp1); if (e != GFARM_ERR_NO_ERROR) { goto err; } for (i = 0; i < ngroups; i++) { /* check VomsID */ if ((p = strstr(groups[i].groupname, vomsid)) == NULL) { continue; } if (p != groups[i].groupname || p[strlen(vomsid)] != ':') { continue; } /* check VO name */ p += (strlen(vomsid) + 1); if ((p2 = strstr(p, vo)) == NULL || p2 != p) { continue; } p += (strlen(vo)); if (*p != '\0' && *p != '/') { continue; } e = set_new_list(tmp1, &tmp2, groups[i].nusers); if (e != GFARM_ERR_NO_ERROR) { goto err; } tmp2->group_name = strdup(groups[i].groupname); if (tmp2->group_name == NULL) { e = GFARM_ERR_NO_MEMORY; goto err; } tmp2->group_info = &(groups[i]); for (j = 0; j < groups[i].nusers; j++) { tmp2->user_infos[j] = get_user_info_by_name( groups[i].usernames[j]); if (tmp2->user_infos[j] == NULL) { goto err; } } tmp1 = tmp2; tmp2 = NULL; } *gfarm_list = tmp1->next; return (e); err: if (e == GFARM_ERR_NO_ERROR) { e = -1; } free_group_info_list(tmp1); return (e); } /* make group name by vomsid, vo, voms group and voms role */ static char * make_groupname(char *group) { char *ret = NULL; int len = strlen(vomsid) + 1 + strlen(vo) + strlen(group) + 1; GFARM_CALLOC_ARRAY(ret, len); if (ret == NULL) { goto err; } memset(ret, '\0', len); sprintf(ret, "%s:%s%s", vomsid, vo, group); return ret; err: if (ret) free(ret); return NULL; } /* make voms membership list */ static gfarm_error_t make_voms_membership_list(FILE *vomsfp, struct group_info_list **voms_list) { gfarm_error_t e = GFARM_ERR_NO_ERROR; struct group_info_list *tmp1 = NULL, *tmp2 = NULL; char buf[MAX_LINE_LEN]; char *idx = NULL; int isHead = 2, flag = 0, allocated_size = 0, i; int line = 0; char *p = NULL; struct gfarm_user_info **user_tmp = NULL; e = make_list_head(&tmp1); if (e != GFARM_ERR_NO_ERROR) { goto err; } tmp2 = tmp1; memset(buf, '\0', MAX_LINE_LEN); while(fgets(buf, MAX_LINE_LEN, vomsfp)) { line++; idx = buf; if (idx[strlen(idx)-1] != '\n' && idx[strlen(idx)-1] != '\r') { fprintf(stderr, "Error:In voms membership file('%s'[line %d])\n", vomsfile, line); fprintf(stderr, "Line was too long. Limit length is %d.\n", MAX_LINE_LEN); goto err; } trim(idx, MAX_LINE_LEN); if (strlen(idx) == 0 || idx[0] == '#') continue; if (isHead > 0) { if ((p = strstr(idx, VOID_FORM)) != NULL && p == idx) { if (flag == 1) { fprintf(stderr, "Error:In voms membership file('%s'[line %d])\n", vomsfile, line); fprintf(stderr, "Duplicate header '%s'.\n", VOID_FORM); goto err; } p += strlen(VOID_FORM); if (strcmp(p, vomsid)) { fprintf(stderr, "Error:In voms membership file('%s'[line %d])\n", vomsfile, line); fprintf(stderr, "VOMSID Contradiction:vomsfile(%s) and command(%s)\n", p, vomsid); goto err; } flag = 1; } else if ((p = strstr(idx, VO_FORM)) != NULL && p == idx) { if (flag == 2) { fprintf(stderr, "Error:In voms membership file('%s'[line %d])\n", vomsfile, line); fprintf(stderr, "Duplicate header '%s'.\n", VO_FORM); goto err; } p += strlen(VO_FORM); if (strcmp(p, vo)) { fprintf(stderr, "Error:In voms membership file('%s'[line %d])\n", vomsfile, line); fprintf(stderr, "VO Contradiction:voms_file(%s) and command(%s)\n", p+1, vo+1); goto err; } flag = 2; } else { fprintf(stderr, "Error:In voms membership file('%s'[line %d])\n", vomsfile, line); fprintf(stderr, "Unknown header:%s\n", idx); goto err; } isHead--; } else { if ((p = strstr(idx, GROUP_FORM)) != NULL && p == idx) { tmp1 = tmp2; tmp2 = NULL; e = set_new_list(tmp1, &tmp2, USER_ALLOC_SIZE); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "Error:In voms membership file('%s'[line %d])\n", vomsfile, line); goto err; } tmp2->nusers = 0; allocated_size = USER_ALLOC_SIZE; p += strlen(GROUP_FORM); tmp2->group_name = make_groupname(p); if (tmp2->group_name == NULL) { fprintf(stderr, "Error:In voms membership file('%s'[line %d])\n", vomsfile, line); e = GFARM_ERR_NO_MEMORY; goto err; } } else if ((p = strstr(idx, USER_FORM)) != NULL && p == idx) { if (tmp2->nusers >= allocated_size) { allocated_size += USER_ALLOC_SIZE; GFARM_REALLOC_ARRAY(user_tmp, tmp2->user_infos, allocated_size); if (user_tmp == NULL) { fprintf(stderr, "Error:In voms membership file('%s'[line %d])\n", vomsfile, line); e = GFARM_ERR_NO_MEMORY; goto err; } tmp2->user_infos = user_tmp; user_tmp = NULL; } p += strlen(USER_FORM); tmp2->user_infos[tmp2->nusers] = get_user_info_by_dn(p); if (tmp2->user_infos[tmp2->nusers] == NULL) { continue; } for (i = 0; i < tmp2->nusers; i++) { if (tmp2->user_infos[i] == tmp2->user_infos[tmp2->nusers]) { fprintf(stderr, "Error:In voms membership file('%s'[line %d])\n", vomsfile, line); fprintf(stderr, "Error:Duplicated user(%s) in same group.\n", tmp2->user_infos[tmp2->nusers]->username); goto err; } } tmp2->nusers++; } else { fprintf(stderr, "Error:In voms membership file('%s'[line %d])\n", vomsfile, line); fprintf(stderr, "Unknown format line:'%s'\n", idx); goto err; } } } if (isHead != 0) { fprintf(stderr, "Error: No Header\n"); goto err; } *voms_list = tmp2->next; return (e); err: free_group_info_list(tmp1->next); if (e == GFARM_ERR_NO_ERROR) { e = -1; } return (e); } /* apply changes to gfarm */ static gfarm_error_t do_update(int op, struct group_info_list *list) { gfarm_error_t e = GFARM_ERR_NO_ERROR; struct group_info_list *tmp = NULL; struct gfarm_group_info ret; int i; if (list == NULL) { return(e); } ret.usernames = NULL; tmp = list->next; switch(op) { case OP_ADD: while(tmp != list) { if (tmp->nusers == 0) { tmp = tmp->next; continue; } ret.groupname = tmp->group_name; ret.nusers = tmp->nusers; GFARM_CALLOC_ARRAY(ret.usernames, ret.nusers); if (ret.usernames == NULL) { e = GFARM_ERR_NO_MEMORY; goto err; } for (i = 0; i < ret.nusers; i++) { ret.usernames[i] = tmp->user_infos[i]->username; } e = gfm_client_group_info_set(gfm_server, &ret); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "Error: Failed to add group.\n"); if (e == GFARM_ERR_ALREADY_EXISTS) { fprintf(stderr, "Group:'%s' cannot be added, ", ret.groupname); fprintf(stderr, "because it already exists.\n"); fprintf(stderr, "The group might be updated before your operation.\n"); fprintf(stderr, "You should try sync once more.\n"); } else if (e == GFARM_ERR_NO_SUCH_USER) { fprintf(stderr, "Unknown user was tried to add.\n"); fprintf(stderr, "The user might be deleted before your operation.\n"); fprintf(stderr, "You should try sync once more.\n"); } goto err; } free(ret.usernames); ret.usernames = NULL; tmp = tmp->next; } break; case OP_DEL: while(tmp != list) { e = gfm_client_group_info_remove(gfm_server, tmp->group_name); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "Error: Failed to delete group.\n"); if (e == GFARM_ERR_NO_SUCH_OBJECT || e == GFARM_ERR_NO_SUCH_GROUP) { fprintf(stderr, "Group:'%s' didn't exist.\n", tmp->group_name); fprintf(stderr, "The group might be deleted before your operation.\n"); fprintf(stderr, "You should try sync once more.\n"); } goto err; } tmp = tmp->next; } break; case OP_MOD: while(tmp != list) { if (tmp->nusers == 0) { tmp = tmp->next; continue; } ret.groupname = tmp->group_name; ret.nusers = tmp->nusers; GFARM_CALLOC_ARRAY(ret.usernames, ret.nusers); if (ret.usernames == NULL) { e = GFARM_ERR_NO_MEMORY; goto err; } for (i = 0; i < ret.nusers; i++) { ret.usernames[i] = tmp->user_infos[i]->username; } e = gfm_client_group_info_modify(gfm_server, &ret); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "Error: Failed to modify group.\n"); if (e == GFARM_ERR_NO_SUCH_OBJECT || e == GFARM_ERR_NO_SUCH_GROUP) { fprintf(stderr, "Group:'%s' didn't exist.\n", tmp->group_name); fprintf(stderr, "The group might be deleted before your operation.\n"); fprintf(stderr, "You should try sync once more.\n"); } else if (e == GFARM_ERR_NO_SUCH_USER) { fprintf(stderr, "Unknown user was tried to add.\n"); fprintf(stderr, "The user might be deleted before your operation.\n"); fprintf(stderr, "You should try sync once more.\n"); } goto err; } free(ret.usernames); ret.usernames = NULL; tmp = tmp->next; } break; default: fprintf(stderr, "Unknown Operation for update\n"); e = -1; goto err; } if (ret.usernames) free(ret.usernames); return (e); err: if (ret.usernames) free(ret.usernames); return (e); } /* Use for debug: print out the list */ static void print_group_list(struct group_info_list *list) { int i; struct group_info_list *tmp = NULL; if (list == NULL) { return; } tmp = list->next; while(tmp != list) { if (tmp->nusers == 0) { tmp = tmp->next; continue; } fprintf(stdout, "\tgroup=%s\n", tmp->group_name); for (i = 0; i < tmp->nusers; i++) { fprintf(stdout, "\t\tuser=%s | gsi_dn=%s\n", tmp->user_infos[i]->username, tmp->user_infos[i]->gsi_dn); } tmp = tmp->next; } } /* Check whether members are same or not */ static int isSameMembers(struct group_info_list *g, struct group_info_list *v) { struct gfarm_user_info **g_members = g->user_infos; int g_nusers = g->nusers; struct gfarm_user_info **v_members = v->user_infos; int v_nusers = v->nusers; int i, j, is_same = 1, found = 0; if (g_nusers != v_nusers) { is_same = 0; } else { for (i = 0; i < g_nusers; i++) { found = 0; for (j = 0; j < v_nusers; j++) { if (g_members[i] == v_members[j]) { found = 1; break; } } if (found == 0) { is_same = 0; goto end; } } } end: return is_same; } /* Check the deference between voms and gfarm */ static gfarm_error_t comp_gfarm_voms(struct group_info_list *voms_list, struct group_info_list *gfarm_list, struct group_info_list **mod) { gfarm_error_t e = GFARM_ERR_NO_ERROR; struct group_info_list *ret_mod = NULL; struct group_info_list *v_tmp = NULL; struct group_info_list *g_tmp = NULL; e = make_list_head(&ret_mod); if (e != GFARM_ERR_NO_ERROR) { goto err; } v_tmp = voms_list->next; while (v_tmp != voms_list) { g_tmp = gfarm_list->next; while (g_tmp != gfarm_list) { /* group exist */ if (strcmp(g_tmp->group_name, v_tmp->group_name) == 0) { if (isSameMembers(g_tmp, v_tmp)) { v_tmp = remove_list(v_tmp); g_tmp = remove_list(g_tmp); } else { v_tmp = add_list(ret_mod, v_tmp); g_tmp = remove_list(g_tmp); } break; } else { g_tmp = g_tmp->next; } } v_tmp = v_tmp->next; } *mod = ret_mod; return (e); err: if (ret_mod) free_group_info_list(ret_mod); if (e == GFARM_ERR_NO_ERROR) { e = -1; } return (e); } /* check and apply the changes */ static gfarm_error_t execute_update(struct group_info_list *gfarm_list, char noupd, char del) { gfarm_error_t e = GFARM_ERR_NO_ERROR; struct group_info_list *voms_list = NULL; struct group_info_list *mod_group = NULL; FILE *vomsfp = NULL; if (del == 0) { vomsfp = fopen(vomsfile, "r"); if (vomsfp == NULL) { fprintf(stderr, "Failed to open voms membership file.\n"); e = GFARM_ERR_NO_SUCH_FILE_OR_DIRECTORY; goto err; } e = make_voms_membership_list(vomsfp, &voms_list); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "Failed to read voms membership list.\n"); goto err; } e = comp_gfarm_voms(voms_list, gfarm_list, &mod_group); if (e != GFARM_ERR_NO_ERROR) { goto err; } } if (noupd) { fprintf(stdout, "New Groups\n"); print_group_list(voms_list); fprintf(stdout, "Delete Groups\n"); print_group_list(gfarm_list); fprintf(stdout, "Modify Groups\n"); print_group_list(mod_group); } else { e = do_update(OP_ADD, voms_list); if (e != GFARM_ERR_NO_ERROR) { goto err; } e = do_update(OP_DEL, gfarm_list); if (e != GFARM_ERR_NO_ERROR) { goto err; } e = do_update(OP_MOD, mod_group); if (e != GFARM_ERR_NO_ERROR) { goto err; } } if (voms_list) free_group_info_list(voms_list); if (mod_group) free_group_info_list(mod_group); if (vomsfp) fclose(vomsfp); return (e); err: if (voms_list) free_group_info_list(voms_list); if (mod_group) free_group_info_list(mod_group); if (vomsfp) fclose(vomsfp); if (e == GFARM_ERR_NO_ERROR) { e = -1; } return (e); } static int checkVomsIDChars(void) { int i; for (i = 0; i < strlen(vomsid); i++) { if (!isalnum(vomsid[i]) && vomsid[i] != '-' && vomsid[i] != '_') { return 0; } } return 1; } static gfarm_error_t init(char del) { gfarm_error_t e = GFARM_ERR_NO_ERROR; if ((!del) && vomsfile == NULL) { fprintf(stderr, "NO VOMS membership file path is specified!\n"); goto err; } if (vo == NULL) { fprintf(stderr, "NO vo is specified!\n"); goto err; } if (vomsid == NULL) { fprintf(stderr, "NO vomsid is specified!\n"); goto err; } if (!checkVomsIDChars()) { fprintf(stderr, "The chars which can use for vomsID are [a-zA-Z0-9_-].\n"); goto err; } e = list_groups(); if (e != GFARM_ERR_NO_ERROR) { if (e != -1) { fprintf(stderr, "%s\n", gfarm_error_string(e)); } goto err; } e = list_users(); if (e != GFARM_ERR_NO_ERROR) { if (e != -1) { fprintf(stderr, "%s\n", gfarm_error_string(e)); } goto err; } return (e); err: if (e == GFARM_ERR_NO_ERROR) { e = -1; } return (e); } static void term(void) { if (vomsid) free(vomsid); if (vo) free(vo); if (vomsfile) free(vomsfile); gfarm_group_info_free_all(ngroups, groups); gfarm_user_info_free_all(nusers, users); } int main(int argc, char *argv[]) { gfarm_error_t e = GFARM_ERR_NO_ERROR; struct group_info_list *gfarm_list = NULL; char noupd = 0, del = 0, c; const char *opt_path = GFARM_PATH_ROOT; e = gfarm_initialize(&argc, &argv); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "gfarm_initialize: %s\n",gfarm_error_string(e)); goto err; } while ((c = getopt(argc, argv, ":V:v:m:hnd")) != -1) { switch (c) { case OP_VOMS_FILE: SET_VOMS_MEMBER_FILE(optarg, e); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s\n", gfarm_error_string(GFARM_ERR_NO_MEMORY)); goto err; } break; case OP_VOMSID: SET_VOMSID(optarg, e); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s\n", gfarm_error_string(GFARM_ERR_NO_MEMORY)); goto err; } break; case OP_VO: SET_VO(optarg, e); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s\n", gfarm_error_string(GFARM_ERR_NO_MEMORY)); goto err; } break; case OP_NO_UPDATE: noupd = 1; break; case OP_DELETE: del = 1; break; case OP_USAGE: usage(); goto end; case ':': case '?': default: fprintf(stderr, "Unknown option\n"); usage(); goto err; } } if ((e = gfm_client_connection_and_process_acquire_by_path(opt_path, &gfm_server)) != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: metadata server for \"%s\": %s\n", program_name, opt_path, gfarm_error_string(e)); goto err; } fprintf(stdout, "Start updating...\n"); e = init(del); if (e != GFARM_ERR_NO_ERROR) { if (e != -1) { fprintf(stderr, "Error:%s\n", gfarm_error_string(e)); } goto err; } e = make_gfarm_membership_list(&gfarm_list); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "Failed to read gfarm membership.\n"); if (e != -1) { fprintf(stderr, "Error:%s\n", gfarm_error_string(e)); } goto err; } e = execute_update(gfarm_list, noupd, del); if (e != GFARM_ERR_NO_ERROR) { if (e != -1) { fprintf(stderr, "Error:%s\n", gfarm_error_string(e)); } goto err; } gfm_client_connection_free(gfm_server); e = gfarm_terminate(); if (e != GFARM_ERR_NO_ERROR) { if (e != -1) { fprintf(stderr, "Error:%s\n", gfarm_error_string(e)); } goto err; } fprintf(stdout, "Finished\n"); end: if (gfarm_list) free_group_info_list(gfarm_list); term(); exit(0); err: if (gfarm_list) free_group_info_list(gfarm_list); term(); exit(1); } gfarm-2.4.1/gftool/gfvoms-sync/gfvoms-update/Makefile0000644000000000000000000000064611507222717021310 0ustar rootroottop_builddir = ../../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk PROGRAM = gfvoms-update SRCS = $(PROGRAM).c OBJS = $(PROGRAM).o CFLAGS = $(COMMON_CFLAGS) -I$(GFUTIL_SRCDIR) -I$(GFARMLIB_SRCDIR) LDLIBS = $(COMMON_LDFLAGS) $(GFARMLIB) $(LIBS) DEPLIBS = $(DEPGFARMLIB) all: $(PROGRAM) include $(top_srcdir)/makes/prog.mk ### $(OBJS): $(DEPGFARMINC) \ $(GFARMLIB_SRCDIR)/gfm_client.h gfarm-2.4.1/gftool/gfvoms-sync/gfvoms-list/0000755000000000000000000000000011507222730017326 5ustar rootrootgfarm-2.4.1/gftool/gfvoms-sync/gfvoms-list/gfvoms-list0000755000000000000000000003001211507222717021527 0ustar rootroot#!/usr/bin/env python # -*- encoding:utf-8 -*- ################################################################### # gfvoms-list # # Get voms infos using SOAP interface. # Make sure that ZSI (The Zolera Soap Infrastructure) is installed. # # Copyright (c) 2009 National Institute of Informatics in Japan. # All rights reserved. # # # Apache 2.0 Licensed Products: # This product includes software listed below that were licensed under # the Apache License, Version 2.0 (the "License"); you may not use this file # except in compliance with the License. You may obtain a copy of # the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions # and limitations under the License. # # VOMSAdmin, (C) 2006. Members of the EGEE Collaboration. ################################################################### import string, getopt, sys, os, os.path, types, re, urlparse, socket from zsi_def import SOAPBinding from hostid import hostids options = {} default_port = 8443 class ProgressBar: """Class for Progress bar""" format = "[%s%s] %d/%d\r" def __init__(self, _max, size=24): self.max = _max self.cur = 0 self.size = size self.out = Writer(sys.stdout) def start(self): self.progress(0) def progress(self, delta): if self.cur >= self.max: return self.cur += delta cursize = int(float(self.cur) / self.max * self.size) leftsize = self.size - cursize self.out.write(self.format % ('*'*cursize, '-'*leftsize, self.cur, self.max)) if self.cur >= self.max: print "\nComplete" class GroupCounter: """Class for Counter""" format = "%d groups found...\r" def __init__(self): self.cur = 0 self.out = Writer(sys.stdout) def start(self): self.progress(0) def end(self): self.out.write(self.format % (self.cur)) print "\nComplete" def progress(self, delta): self.cur += delta self.out.write(self.format % (self.cur)) class Writer(object): def __init__(self, writer): self.writer = writer self.lastFlickered = False self.lastLen = 0 def write(self, text): self.clear() self.writer.write(text) self.lastFlickered = text.endswith('\r') self.lastLen = len(text.split('\n')[-1]) self.writer.flush() def clear(self): if self.lastFlickered: self.writer.write(' '*(self.lastLen-1)+'\r') self.writer.flush() def __getattr__(self, name): return getattr(self.writer, name) def usage(e): if (e != None): print e e = "" usage_str ="""Usage: gfvoms-list -V vomsID -v vo [-f user-list-path] [-m membership-path] [-a hostids] [-h] options: -V voms : ID of VOMS Admin Server -v vo : Name of VO.[no default] -f user-list-path : List of users to get infos.[no default] If you don't set this option, all member of voms:vo will get. -m membership-path : Path to save membership info.[no default] If you don't set this option, membership info will write in stdout. -a hostids : Path of definition file of id and host. [default: '/var/gfarm/hostids'] -h : Show this Usage. membership-path format: One user per one line, and the format is 'user='. User DN should be the format of certification info like '/O=Grid/OU=GlobusTest/OU=simpleCA-example.co.jp/CN=GfarmDevelop' The line started with '#' will be treated as a comment line.""" print usage_str sys.exit(e) def listup_identity(): """List possible identity files. """ id_list = [] home = os.getenv("HOME") tmppem = "/tmp/x509up_u" + str(os.getuid()) x509_user_cert = os.getenv("X509_USER_CERT", home+"/.globus/usercert.pem") x509_user_key = os.getenv("X509_USER_KEY", home+"/.globus/userkey.pem") checklist = [ ("/etc/grid-security/hostcert.pem", "/etc/grid-security/hostkey.pem"), (tmppem, tmppem), (x509_user_cert, x509_user_key) ] for c,k in checklist: if os.access(c, os.F_OK | os.R_OK) and os.access(k, os.F_OK | os.R_OK): id_list.append((c,k)) return id_list def setup_identity(usercert, userkey): """Set files used for certification. """ options["user_cert"] = usercert options["user_key"] = userkey def getHostByVomsId(**options): """Get corresponding hostname by VomsID. """ host ="" port = default_port lines = [] try: f = open(options["hostids"], "r") lines = f.readlines() f.close() except: raise Exception( "Error: Failed to read vomsID file['%s']."%(options["hostids"])) index = 0 for line in lines: index += 1 buf = line.strip() if len(buf) == 0 or buf.startswith('#'): continue list = buf.split() for i in range(len(list)): if list[i].startswith("#"): list = list[:i] break if len(list) < 2 or len(list) > 3: print "Broken vomsid file. Cannot parse line(%d): %s"%(index, buf) raise Exception( "Error:Failed to parse vomsID file['%s']."%(options["hostids"])) if list[0] != options["vomsid"]: continue if len(list) == 2: host = list[1] else: host = list[1] port = int(list[2]) break if host == "": print "No definition for vomsID(%s) found."%(options["vomsid"]) raise Exception( "Error: Cannot find host in vomsID file['%s']."%(options["hostids"])) return host, port def check_options(): """Check options whether they are valid or not. """ if not options.has_key("hostids"): options["hostids"] = hostids if not options.has_key("vomsid"): sys.exit("NO vomsID specified!") else: m = re.compile("^[a-zA-Z0-9_-]*") if m.match(options["vomsid"]).group() != options["vomsid"]: sys.exit("The chars which can use for vomsID are [a-zA-Z0-9_-].") try: host, port = getHostByVomsId(**options) options["host"] = host options["port"] = port except Exception, e: sys.exit(e); if not options.has_key("vo"): sys.exit("NO vo specified!") if not options.has_key("host"): sys.exit("NO host specified!") def parse_command_line(): """Parse option, and set it to global 'options'. """ try: opts, args = getopt.getopt(sys.argv[1:], "V:v:f:m:a:h") for key, val in opts: if key == "-V": options["vomsid"] = val elif key == "-v": options["vo"] = val elif key == "-f": options["infile"] = val elif key == "-m": options["outfile"] = val elif key == "-a": options["hostids"] = val elif key == "-h": usage(None) check_options() if len(args) != 0: usage("Invalid Argument is set!") except getopt.GetoptError, e: sys.exit("Error parsing command line arguments:%s"%(e)) def getCheckUsers(infile): """Parser for user list file. """ try: f = open(infile, "r") lines = f.readlines() f.close() index = 0 users = {} for line in lines: index += 1 tmp_line = line.strip() if len(tmp_line) == 0: continue if tmp_line[0] == "#": continue info = tmp_line.split("=", 1) if len(info) != 2: print "invalid line(%d):%s"%(index, tmp_line) raise Exception( "Error: Failed to parse user list['%s'])."%(infile)) if info[0].strip() != "user": print "invalid line(%d):%s"%(index, tmp_line) raise Exception( "Error: Failed to parse user list['%s'])."%(infile)) if info[1].strip() in users: print "duplicate definition for dn ", print "(in line %d):%s"%(index, info[1].strip()) raise Exception( "Error: Failed to parse user list['%s'])."%(infile)) users[info[1].strip()]="" return users except IOError, e: raise Exception("Error: Failed to read user list['%s'])."%(infile)) except Exception, e: f.close() raise e def export(group_infos): """Print the result to 'outfile' which is registered in global 'options'. """ groups = group_infos.keys() f = sys.stdout print "Writing Infos..." if options.has_key("outfile"): try: f = open(options["outfile"], "w") except Exception, e: raise Exception("Error:Failed to open file.(%s)"%(str(e))) if f == sys.stdout: print "-------------------------------------------" print >>f, "void=%s\nvo=/%s"%(options["vomsid"], options["vo"]) for group in groups: if len(group_infos[group]) == 0: continue print >>f, "voms=%s"%(group) for member in group_infos[group]: print >>f, "user=%s"%(member._DN) if f == sys.stdout: print "-------------------------------------------" print "Finished" f.close() def getGroupList(group, counter, root): """Get group list. """ global admin glist = [] try: glist = admin.execute("listSubGroups", group=group) except socket.error, e: errtuple = tuple(e) if len(errtuple) == 2: raise Exception( "SocketError(%d):%s [hostname=%s, post=%d]"%( errtuple[0], errtuple[1], options["host"], options["port"])) else: raise e except Exception, e: if str(e).find("Insufficient privileges") != -1: if not root: counter.out.write( "Ignored: Insufficient privileges to perform '%s' to %s\n"%( "listSubGroups", group)) else: raise Exception("Authorization Failure") else: raise e ret_list = glist[:] counter.progress(1) for g in glist: ret_list.extend(getGroupList(g, counter, False)) return ret_list def getRoleList(): rlist = [] try: rlist = admin.execute("listRoles", **options) except Exception, e: if str(e).find("Insufficient privileges") != -1: print "Ignored: ", print "Insufficient privileges to perform 'listRoles'" else: raise e return rlist def main(): global admin try: # Init counter = None bar = None group_infos = {} dns = None parse_command_line() if options.has_key("infile"): dns = getCheckUsers(options["infile"]) checkidlist = listup_identity() if len(checkidlist) == 0: raise Exception("No Certification file found") usercert, userkey = checkidlist[0] print "trying usercert:%s, userkey:%s"%(usercert, userkey) setup_identity(usercert, userkey) admin = SOAPBinding(**options) # Get Groups and Roles print "Start to get Group Info..." counter = GroupCounter() counter.start() glist = getGroupList("/%s"%(options["vo"]), counter, True) glist.insert(0, "/%s"%(options["vo"])) counter.end() counter = None print "Start to get Role Info..." rlist = getRoleList() print "%d roles found..."%(len(rlist)) print "Complete" # Get Info. user by user print "Getting Group Member Infos..." bar = ProgressBar(len(glist)) bar.start() for group in glist: grp_novo = group[len(options["vo"]) + 1:] try: members = admin.execute("listMembers", group=group) if dns != None: members = [u for u in members if u._DN in dns] group_infos[grp_novo] = members except Exception, e: if str(e).find("Insufficient privileges") != -1: bar.out.write( "Ignored: " + "Insufficient privileges to perform '%s' to %s\n"%( "listMembers",group)) else: raise e for role in rlist: try: r_members = admin.execute("listUsersWithRole", group=group, role=role) if dns != None: r_members = [u for u in r_members if u._DN in dns] group_infos["%s/%s"%(grp_novo, role)] = r_members except Exception, e: if str(e).find("containerName.length()") != -1: bar.out.write( "Ignored: " + "Too long groupname '%s/%s'\n"%(grp_novo, role)) continue elif str(e).find("Insufficient privileges") != -1: bar.out.write( "Ignored:" + "Insufficient privileges to perform " + "'%s' to %s/Role=%s\n"%( "listUsersWithRole", group, role)) continue else: raise e bar.progress(1) bar = None export(group_infos) except Exception, e: if counter != None or bar != None: print "" msg = "" if str(e).find("text/html") != -1: msg = ": vo(%s) may be not exists or not active."%(options["vo"]) sys.exit("%s%s"%(e,msg)) if __name__ == "__main__": main() gfarm-2.4.1/gftool/gfvoms-sync/gfvoms-list/Makefile0000644000000000000000000000025411507222717020774 0ustar rootroottop_builddir = ../../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk SCRIPTS = $(srcdir)/gfvoms-list include $(top_srcdir)/makes/script.mk gfarm-2.4.1/gftool/gfvoms-sync/Makefile0000644000000000000000000000027511507222717016525 0ustar rootroottop_builddir = ../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk SUBDIRS = gfvoms-list gfvoms-update gfvoms-sync lib include $(top_srcdir)/makes/subdir.mk gfarm-2.4.1/gftool/gfvoms-sync/gfvoms-sync/0000755000000000000000000000000011507222730017327 5ustar rootrootgfarm-2.4.1/gftool/gfvoms-sync/gfvoms-sync/gfvoms-sync.py0000755000000000000000000001053711507222717022172 0ustar rootroot#!/usr/bin/env python # -*- encoding:utf-8 -*- ############################################################### # gfvoms-sync # # Sync voms infos and gfarm # Using gfvoms-list and gfvoms-update, # synchronize voms's membership infos and that of gfarm. # # Copyright (c) 2009 National Institute of Informatics in Japan. # All rights reserved. ############################################################## import commands, getopt, sys, os, re from hostid import hostids tmpdir = "/tmp" vomslist_tmpfile = "%s/vomslist.tmp"%(tmpdir) options = {} def usage(e): if e != None: print e e = "" usage_str ="""Usage: gfvoms-sync -s -V vomsID -v vo [-g voms-membership-path] [-a hostids] [-h] gfvoms-sync -d -V vomsID -v vo [-g voms-membership-path] [-a hostids] [-h] options: -s : Synchronization mode. -d : Deletion mode. -V voms : ID of VOMS Admin Server -v vo : Name of VO to get membership infos.[no default] -g membership-path : Path of voms membership info file.[no default] -a vomsids : Path of file of id and host.[default: '%s'] -h : Show this Usage.\n""" print usage_str%(hostids) sys.exit(e) def check_options(): if (not options.has_key("sync")) and (not options.has_key("del")): usage("No Operation is found. You must set '-s' or '-d' option.") if (options.has_key("sync")) and options.has_key("del"): usage("Duplicate Operations. " + "Option '-s' and '-d' cannot set in same time.") if not options.has_key("vomsid"): usage("No vomsID Specified!") m = re.compile("^[a-zA-Z0-9_-]*") if m.match(options["vomsid"]).group() != options["vomsid"]: sys.exit("The chars which can use for vomsID are [a-zA-Z0-9_-].") if not options.has_key("vo"): usage("No vo Specified!") if not options.has_key("hostids"): options["hostids"] = hostids def parse_options(): try: opts, args = getopt.getopt(sys.argv[1:], "sdg:a:V:v:nh") for key, val in opts: if key == "-V": options["vomsid"] = val elif key == "-v": options["vo"] = val elif key == "-g": options["vomslist"] = val elif key == "-a": options["hostids"] = val elif key == "-s": options["sync"] = "" elif key == "-d": options["del"] = "" elif key == "-n": options["noupd"] = "" elif key == "-h": usage(None) check_options() if len(args) != 0: usage("Invalid Argument is set!") except getopt.GetoptError, e: sys.exit("Error parsing command line arguments:%s"%(e)) def getGfvomsListOptions(): ret= "-a %s -V %s -v %s -m %s"%( options["hostids"], options["vomsid"], options["vo"], vomslist_tmpfile) return ret def getGfvomsUpdOptions(): ret= "-V %s -v %s"%(options["vomsid"], options["vo"]) if options.has_key("del"): ret += " -d" else: ret += " -m %s"%(options["vomslist"]) if options.has_key("noupd"): ret += " -n" return ret def main(): istmpfile = True try: # Init parse_options() # check gfvoms-list and gfvoms-update status,gfvoms_list = commands.getstatusoutput("which gfvoms-list") if status != 0: gfvoms_list = "./gfvoms-list" if not os.path.isfile(gfvoms_list): sys.exit("Cannot find command 'gfvoms-list'") status, gfvoms_update = commands.getstatusoutput( "which gfvoms-update") if status != 0: gfvoms_update = "./gfvoms-update" if not os.path.isfile(gfvoms_update): sys.exit("Cannot find command 'gfvoms-update'") if options.has_key("vomslist"): istmpfile = False # voms-list if not options.has_key("del"): if not options.has_key("vomslist"): if not os.path.exists(tmpdir): os.makedirs(tmpdir) print "gfvoms-list started..." status = os.system("%s %s"%( gfvoms_list, getGfvomsListOptions())) if status != 0: raise Exception("gfvoms-list failed!") options["vomslist"] = vomslist_tmpfile # voms-update print "gfvoms-update started..." status = os.system("%s %s"%(gfvoms_update, getGfvomsUpdOptions())) if status != 0: raise Exception("gfvoms-update failed!") if not options.has_key("del"): print "Synchronization Finished Successfully!" if istmpfile and os.path.isfile(options["vomslist"]): os.remove(options["vomslist"]) else: print "Deletion Finished Successfully!" except Exception, e: sys.exit("Error:%s"%(e)) if __name__ == "__main__": main() gfarm-2.4.1/gftool/gfvoms-sync/gfvoms-sync/Makefile0000644000000000000000000000054511507222717021000 0ustar rootroottop_builddir = ../../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk datadir = $(default_datadir)/gfarm/voms SCRIPTS = gfvoms-sync DATA = $(srcdir)/gfvoms-sync.py EXTRA_CLEAN_TARGETS = $(SCRIPTS) all: $(SCRIPTS) $(SCRIPTS): ./mkscript $(datadir) include $(top_srcdir)/makes/script.mk include $(top_srcdir)/makes/data.mk gfarm-2.4.1/gftool/gfvoms-sync/gfvoms-sync/mkscript0000755000000000000000000000066311507222717021123 0ustar rootroot#!/usr/bin/env python # Copyright (c) 2009 National Institute of Informatics in Japan. # All rights reserved. import sys tmp = """#!/bin/sh # Copyright (c) 2009 National Institute of Informatics in Japan. # All rights reserved. vomsdir="%s" pythonpath="$vomsdir:$PYTHONPATH" export PYTHONPATH=$pythonpath python $vomsdir/gfvoms-sync.py $@ """ ret_str = tmp%(sys.argv[1]) f = open("gfvoms-sync", "w") f.write(ret_str) f.close() gfarm-2.4.1/gftool/gfvoms-sync/lib/0000755000000000000000000000000011507222730015622 5ustar rootrootgfarm-2.4.1/gftool/gfvoms-sync/lib/zsi_def.py0000755000000000000000000002457711507222717017646 0ustar rootroot#!/usr/bin/env python # -*- encoding: utf-8 -*- ###################################################################### # Copyright (c) 2009 National Institute of Informatics in Japan. # All rights reserved. # # Apache 2.0 Licensed Products: # This product includes software listed below that were licensed under # the Apache License, Version 2.0 (the "License"); you may not use this file # except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions # and limitations under the License. # # VOMSAdmin, (C) 2006. Members of the EGEE Collaboration. ###################################################################### """modules to use ZSI. """ nspace = "http://glite.org/wsdl/services/org.glite.security.voms" encstyle = "http://schemas.xmlsoap.org/soap/encoding/" import string, getopt, sys, os, os.path, types, re, urlparse import ZSI from ZSI import client class ns0: targetNamespace = nspace class User_Def(ZSI.TCcompound.ComplexType, ZSI.schema.TypeDefinition): schema = nspace type = (schema, "User") def __init__(self, pname, ofwhat=(), attributes=None, extend=False, restrict=False, **kw): ns = self.__class__.schema option = {"minOccurs":1, "maxOccurs":1, "nillable":True, "typed":False, "encoded":kw.get("encoded")} TClist = [ ZSI.TC.String(pname="CA", aname="_CA", **option), ZSI.TC.String(pname="CN", aname="_CN", **option), ZSI.TC.String(pname="DN", aname="_DN", **option), ZSI.TC.String(pname="certUri", aname="_certUri", **option), ZSI.TC.String(pname="mail", aname="_mail", **option)] self.attribute_typecode_dict = attributes or {} if extend: TClist += ofwhat if restrict: TClist = ofwhat ZSI.TCcompound.ComplexType.__init__( self, None, TClist, pname=pname, inorder=0, **kw) class Holder: typecode = self def __init__(self): # pyclass self._CA = None self._CN = None self._DN = None self._certUri = None self._mail = None return def __repr__(self): return "%s, %s" % (self._DN, self._CA) Holder.__name__ = "User_Holder" self.pyclass = Holder class VOMSException_Def(ZSI.TCcompound.ComplexType, ZSI.schema.TypeDefinition): schema = nspace type = (schema, "VOMSException") def __init__(self, pname, ofwhat=(), attributes=None, extend=False, restrict=False, **kw): ns = self.__class__.schema TClist = [] self.attribute_typecode_dict = attributes or {} if extend: TClist += ofwhat if restrict: TClist = ofwhat ZSI.TCcompound.ComplexType.__init__(self, None, TClist, pname=pname, inorder=0, **kw) class Holder: typecode = self def __init__(self): # pyclass return Holder.__name__ = "VOMSException_Holder" self.pyclass = Holder class ns1: targetNamespace = "%s.service.admin"%(nspace) class ArrayOf_tns2_User_Def(ZSI.TC.Array, ZSI.schema.TypeDefinition): #complexType/complexContent base="SOAP-ENC:Array" schema = "%s.service.admin"%(nspace) type = (schema, "ArrayOf_tns2_User") def __init__(self, pname, ofwhat=(), extend=False, restrict=False, attributes=None, **kw): ofwhat = ns0.User_Def(None, typed=False) atype = (nspace, u'User[]') ZSI.TCcompound.Array.__init__(self, atype, ofwhat, pname=pname, childnames='item', **kw) class ArrayOf_soapenc_string_Def(ZSI.TC.Array, ZSI.schema.TypeDefinition): #complexType/complexContent base="SOAP-ENC:Array" schema = "%s.service.admin"%(nspace) type = (schema, "ArrayOf_soapenc_string") def __init__(self, pname, ofwhat=(), extend=False, restrict=False, attributes=None, **kw): ofwhat = ZSI.TC.String(None, typed=False) atype = (encstyle, u'string[]') ZSI.TCcompound.Array.__init__(self, atype, ofwhat, pname=pname, childnames='item', **kw) class listUsersWithRoleRequest: def __init__(self): self._in0 = None self._in1 = None return listUsersWithRoleRequest.typecode = ZSI.TCcompound.Struct( pname=("%s.service.admin"%(nspace),"listUsersWithRole"), ofwhat=[ ZSI.TC.String(pname="in0", aname="_in0", typed=False, encoded=None, minOccurs=1, maxOccurs=1, nillable=True), ZSI.TC.String(pname="in1", aname="_in1", typed=False, encoded=None, minOccurs=1, maxOccurs=1, nillable=True)], pyclass=listUsersWithRoleRequest, encoded="%s.service.admin"%(nspace)) class listUsersWithRoleResponse: def __init__(self): self._listUsersWithRoleReturn = None return listUsersWithRoleResponse.typecode = ZSI.TCcompound.Struct( pname=("%s.service.admin"%(nspace),"listUsersWithRoleResponse"), ofwhat=[ ns1.ArrayOf_tns2_User_Def( pname="listUsersWithRoleReturn", aname="_listUsersWithRoleReturn", typed=False, encoded=None, minOccurs=1, maxOccurs=1, nillable=True)], pyclass=listUsersWithRoleResponse, encoded="%s.service.admin"%(nspace)) class listMembersRequest: def __init__(self): self._in0 = None return listMembersRequest.typecode = ZSI.TCcompound.Struct( pname=("%s.service.admin"%(nspace),"listMembers"), ofwhat=[ ZSI.TC.String( pname="in0", aname="_in0", typed=False, encoded=None, minOccurs=1, maxOccurs=1, nillable=True)], pyclass=listMembersRequest, encoded="%s.service.admin"%(nspace)) class listMembersResponse: def __init__(self): self._listMembersReturn = None return listMembersResponse.typecode = ZSI.TCcompound.Struct( pname=("%s.service.admin"%(nspace),"listMembersResponse"), ofwhat=[ ns1.ArrayOf_tns2_User_Def( pname="listMembersReturn", aname="_listMembersReturn", typed=False, encoded=None, minOccurs=1, maxOccurs=1, nillable=True)], pyclass=listMembersResponse, encoded="%s.service.admin"%(nspace)) class listRolesRequest: def __init__(self): self._in0 = None self._in1 = None return listRolesRequest.typecode = ZSI.TCcompound.Struct( pname=("%s.service.admin"%(nspace),"listRoles"), ofwhat=[], pyclass=listRolesRequest, encoded="%s.service.admin"%(nspace)) class listRolesResponse: def __init__(self): self._listRolesReturn = None return listRolesResponse.typecode = ZSI.TCcompound.Struct( pname=("%s.service.admin"%(nspace),"listRolesResponse"), ofwhat=[ ns1.ArrayOf_soapenc_string_Def( pname="listRolesReturn", aname="_listRolesReturn", typed=False, encoded=None, minOccurs=1, maxOccurs=1, nillable=True)], pyclass=listRolesResponse, encoded="%s.service.admin"%(nspace)) class listSubGroupsRequest: def __init__(self): self._in0 = None return listSubGroupsRequest.typecode = ZSI.TCcompound.Struct( pname=("%s.service.admin"%(nspace),"listSubGroups"), ofwhat=[ ZSI.TC.String(pname="in0", aname="_in0", typed=False, encoded=None, minOccurs=1, maxOccurs=1, nillable=True)], pyclass=listSubGroupsRequest, encoded="%s.service.admin"%(nspace)) class listSubGroupsResponse: def __init__(self): self._listSubGroupsReturn = None return listSubGroupsResponse.typecode = ZSI.TCcompound.Struct( pname=("%s.service.admin"%(nspace),"listSubGroupsResponse"), ofwhat=[ ns1.ArrayOf_soapenc_string_Def( pname="listSubGroupsReturn", aname="_listSubGroupsReturn", typed=False, encoded=None, minOccurs=1, maxOccurs=1, nillable=True)], pyclass=listSubGroupsResponse, encoded="%s.service.admin"%(nspace)) class SOAPBinding: """Class to use SOAP interface of voms""" def __init__(self, **kw): transdict = {"cert_file":kw['user_cert'], "key_file":kw['user_key']} kw.setdefault("readerclass", None) kw.setdefault("writerclass", None) admin_url = "https://%s:%d/voms/%s/services/VOMSAdmin" % ( kw['host'],kw['port'],kw['vo']) self.binding = client.Binding( url=admin_url, transdict = transdict, **kw) # op "list-members" def listMembers(self, **kw): request = listMembersRequest() request._in0 = "%s"%(kw["group"]) self.binding.Send(None, None, request, soapaction="", encodingStyle=encstyle, **kw) typecode = ZSI.TCcompound.Struct( pname=None, ofwhat=listMembersResponse.typecode.ofwhat, pyclass=listMembersResponse.typecode.pyclass) if self.binding.Receive(typecode)._listMembersReturn == None: return [] return self.binding.Receive(typecode)._listMembersReturn # op "list-sub-groups" def listSubGroups(self, **kw): request = listSubGroupsRequest() request._in0 = "%s"%(kw["group"]) self.binding.Send(None, None, request, soapaction="", encodingStyle=encstyle, **kw) typecode = ZSI.TCcompound.Struct( pname=None, ofwhat=listSubGroupsResponse.typecode.ofwhat, pyclass=listSubGroupsResponse.typecode.pyclass) response = self.binding.Receive(typecode) if self.binding.Receive(typecode)._listSubGroupsReturn == None: return [] return self.binding.Receive(typecode)._listSubGroupsReturn # op "list-roles" def listRoles(self, **kw): request = listRolesRequest() self.binding.Send(None, None, request, soapaction="", encodingStyle=encstyle) typecode = ZSI.TCcompound.Struct( pname=None, ofwhat=listRolesResponse.typecode.ofwhat, pyclass=listRolesResponse.typecode.pyclass) if self.binding.Receive(typecode)._listRolesReturn == None: return [] return self.binding.Receive(typecode)._listRolesReturn # op "list-users-with-role" def listUsersWithRole(self, **kw): request = listUsersWithRoleRequest() request._in0 = "%s"%(kw["group"]) request._in1 = "%s"%(kw["role"]) self.binding.Send(None, None, request, soapaction="", encodingStyle=encstyle) typecode = ZSI.TCcompound.Struct( pname=None, ofwhat=listUsersWithRoleResponse.typecode.ofwhat, pyclass=listUsersWithRoleResponse.typecode.pyclass) response = self.binding.Receive(typecode) if self.binding.Receive(typecode)._listUsersWithRoleReturn == None: return [] return self.binding.Receive(typecode)._listUsersWithRoleReturn def execute(self, cmd, **arg): cmds = {"listUsersWithRole":"","listRoles":"", "listSubGroups":"","listMembers":""} if cmd in cmds: try: response = self.__class__.__dict__[cmd](self, **arg) if isinstance(response, types.ListType): return response except Exception, e: raise e else: raise Exception("Unkown Command:%s"%(cmd)) gfarm-2.4.1/gftool/gfvoms-sync/lib/Makefile0000644000000000000000000000141411507222717017267 0ustar rootroottop_builddir = ../../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk datadir = $(default_datadir)/gfarm/voms confpath = $(sysconfdir) vomsids_name = gfarm.vomsids hostidpy_name = hostid.py DATA = $(srcdir)/zsi_def.py $(hostidpy_name) all: $(vomsids_name) $(vomsids_name): ./mkscript $(hostidpy_name) $(confpath) $(vomsids_name) post-install-hook: @if ! test -e "$(confpath)/`basename $(vomsids_name)`"; then \ echo \ $(INSTALL_DATA) $(srcdir)/$(vomsids_name) $(confpath)/`basename $(vomsids_name)`; \ $(INSTALL_DATA) $(srcdir)/$(vomsids_name) $(confpath)/`basename $(vomsids_name)`; \ fi post-clean-hook: @for i in -- $(vomsids_name) $(hostidpy_name); do \ test ! -e $$i || $(RM) -f $$i; \ done include $(top_srcdir)/makes/data.mk gfarm-2.4.1/gftool/gfvoms-sync/lib/mkscript0000755000000000000000000000260511507222717017414 0ustar rootroot#!/usr/bin/env python # Copyright (c) 2009 National Institute of Informatics in Japan. # All rights reserved. import sys,os,socket imp_str = """#!/usr/bin/env python # Copyright (c) 2009 National Institute of Informatics in Japan. # All rights reserved. hostids="%s" """ vomsids_str = """# vomsIDs-hostname correlation file # In voms-collaboration commands, you need to set vomsID by '-V' option. # The vomsID is defined in this file. # # Definition format is " ", and use one row for one host. # # vomsID: # You can use [a-zA-Z0-9_-] for vomsID. # # host: # You can use IPv4, IPv6 or hostname for host. # # port: # Port number which is used for connection to VOMS-Admin server. # VOMS-Admin server uses 8443 for default. If you don't write # port number, 8443 is used for default. # # The row which has '#' at it's top is Comment. # You can use the comments add to from the end of the line. # ex.) # |#valid comment # |1 foo.bar.co.jp 8443 #valid comment # | # |... #Example # #1 %s #2 foo.bar.co.jp 443 """ imp_file = imp_str%(os.path.join(sys.argv[2], sys.argv[3])) imp_path = os.path.join(os.path.dirname(sys.argv[0]), sys.argv[1]) f = open(imp_path, "w") f.write(imp_file) f.close() vomsids_file = vomsids_str%(socket.getfqdn()) vomsids_path = os.path.join(os.path.dirname(sys.argv[0]), sys.argv[3]) f = open(vomsids_path, "w") f.write(vomsids_file) f.close() gfarm-2.4.1/gftool/gfuser/0000755000000000000000000000000011507222730014074 5ustar rootrootgfarm-2.4.1/gftool/gfuser/gfuser.c0000644000000000000000000001017011507222717015537 0ustar rootroot/* * $Id: gfuser.c 4320 2010-01-20 03:44:50Z n-soda $ */ #include #include #include #include #include #include #include "config.h" #include "gfm_client.h" #include "lookup.h" char *program_name = "gfuser"; #define OP_USERNAME '\0' #define OP_LIST_LONG 'l' #define OP_CREATE_ENTRY 'c' #define OP_MODIFY_ENTRY 'm' #define OP_DELETE_ENTRY 'd' struct gfm_connection *gfm_server; static void usage(void) { fprintf(stderr, "Usage:\t%s [-P ] [-l] [username ...]\n", program_name); fprintf(stderr, "\t%s [-P ] -c username realname homedir gsi_dn\n", program_name); fprintf(stderr, "\t%s [-P ] -m username realname homedir gsi_dn\n", program_name); fprintf(stderr, "\t%s [-P ] -d username\n", program_name); exit(1); } static void display_user(int op, int nusers, char *names[], gfarm_error_t *errs, struct gfarm_user_info *users) { int i; for (i = 0; i < nusers; i++) { if (errs != NULL && errs[i] != GFARM_ERR_NO_ERROR) { assert(names != NULL); fprintf(stderr, "%s: %s\n", names[i], gfarm_error_string(errs[i])); continue; } switch (op) { case OP_USERNAME: puts(users[i].username); break; case OP_LIST_LONG: printf("%s:%s:%s:%s\n", users[i].username, users[i].realname, users[i].homedir, users[i].gsi_dn); break; } gfarm_user_info_free(&users[i]); } } gfarm_error_t list_all(int op) { struct gfarm_user_info *users; gfarm_error_t e; int nusers; e = gfm_client_user_info_get_all(gfm_server, &nusers, &users); if (e != GFARM_ERR_NO_ERROR) return (e); display_user(op, nusers, NULL, NULL, users); free(users); return (e); } gfarm_error_t list(int op, int n, char *names[]) { struct gfarm_user_info *users; gfarm_error_t e, *errs; GFARM_MALLOC_ARRAY(users, n); GFARM_MALLOC_ARRAY(errs, n); if (users == NULL || errs == NULL) { e = GFARM_ERR_NO_MEMORY; goto free_users; } e = gfm_client_user_info_get_by_names( gfm_server, n, (const char **)names, errs, users); if (e != GFARM_ERR_NO_ERROR) goto free_users; display_user(op, n, names, errs, users); free_users: if (users != NULL) free(users); if (errs != NULL) free(errs); return (e); } int main(int argc, char **argv) { gfarm_error_t e; int c, status = 0; char opt_operation = '\0'; /* default operation */ extern int optind; struct gfarm_user_info ui; const char *path = GFARM_PATH_ROOT; if (argc > 0) program_name = basename(argv[0]); e = gfarm_initialize(&argc, &argv); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", program_name, gfarm_error_string(e)); exit(1); } while ((c = getopt(argc, argv, "P:cdhlm?")) != -1) { switch (c) { case 'P': path = optarg; break; case 'c': case 'd': case 'l': case 'm': opt_operation = c; break; case 'h': case '?': default: usage(); } } argc -= optind; argv += optind; if ((e = gfm_client_connection_and_process_acquire_by_path(path, &gfm_server)) != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: metadata server for \"%s\": %s\n", program_name, path, gfarm_error_string(e)); exit(1); } switch (opt_operation) { case OP_USERNAME: case OP_LIST_LONG: if (argc == 0) e = list_all(opt_operation); else e = list(opt_operation, argc, argv); break; case OP_CREATE_ENTRY: case OP_MODIFY_ENTRY: if (argc != 4) usage(); ui.username = argv[0]; ui.realname = argv[1]; ui.homedir = argv[2]; ui.gsi_dn = argv[3]; switch (opt_operation) { case OP_CREATE_ENTRY: e = gfm_client_user_info_set(gfm_server, &ui); break; case OP_MODIFY_ENTRY: e = gfm_client_user_info_modify( gfm_server, &ui); break; } break; case OP_DELETE_ENTRY: if (argc != 1) usage(); e = gfm_client_user_info_remove(gfm_server, argv[0]); break; } if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", program_name, gfarm_error_string(e)); status = 1; } gfm_client_connection_free(gfm_server); e = gfarm_terminate(); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", program_name, gfarm_error_string(e)); status = 1; } return (status); } gfarm-2.4.1/gftool/gfuser/Makefile0000644000000000000000000000101611507222717015537 0ustar rootroot# $Id: Makefile 4320 2010-01-20 03:44:50Z n-soda $ top_builddir = ../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk PROGRAM = gfuser SRCS = $(PROGRAM).c OBJS = $(PROGRAM).o CFLAGS = $(COMMON_CFLAGS) -I$(GFUTIL_SRCDIR) -I$(GFARMLIB_SRCDIR) LDLIBS = $(COMMON_LDFLAGS) $(GFARMLIB) $(LIBS) DEPLIBS = $(DEPGFARMLIB) all: $(PROGRAM) include $(top_srcdir)/makes/prog.mk ### $(OBJS): $(DEPGFARMINC) \ $(GFARMLIB_SRCDIR)/config.h \ $(GFARMLIB_SRCDIR)/gfm_client.h \ $(GFARMLIB_SRCDIR)/lookup.h gfarm-2.4.1/gftool/gfxattr/0000755000000000000000000000000011507222730014260 5ustar rootrootgfarm-2.4.1/gftool/gfxattr/gfxattr.c0000644000000000000000000001477011507222717016121 0ustar rootroot/* * Copyright (c) 2009 National Institute of Informatics in Japan. * All rights reserved. */ /* * $Id$ */ #include #include #include #include #include #include #include #include #include #include #include #include "gfutil.h" #define DEFAULT_ALLOC_SIZE (64 * 1024) static gfarm_error_t set_xattr(int xmlMode, char *path, char *xattrname, char *filename, int flags) { const size_t count = 65536; ssize_t sz; size_t buf_sz, msg_sz = 0; char *buf = NULL, *tbuf; gfarm_error_t e; int fd, need_close = 0; int overflow; if (filename != NULL) { fd = open(filename, O_RDONLY); need_close = 1; } else fd = STDIN_FILENO; if (fd == -1) { if (filename != NULL) fprintf(stderr, "%s: %s\n", filename, strerror(errno)); return (gfarm_errno_to_error(errno)); } buf_sz = count; overflow = 0; buf_sz = gfarm_size_add(&overflow, buf_sz, 1); if (!overflow) buf = malloc(buf_sz); if (buf == NULL) return (GFARM_ERR_NO_MEMORY); while ((sz = read(fd, buf + msg_sz, count)) > 0) { msg_sz += sz; buf_sz = gfarm_size_add(&overflow, buf_sz, count); if (!overflow) tbuf = realloc(buf, buf_sz); if (overflow || (tbuf == NULL)) { e = GFARM_ERR_NO_MEMORY; goto free_buf; } buf = tbuf; } buf[msg_sz] = '\0'; if (need_close) close(fd); if (xmlMode) { e = gfs_setxmlattr(path, xattrname, buf, msg_sz + 1, flags); } else { e = gfs_setxattr(path, xattrname, buf, msg_sz, flags); } free_buf: free(buf); return (e); } static gfarm_error_t get_xattr_alloc(int xmlMode, char *path, char *xattrname, void **valuep, size_t *size) { gfarm_error_t e; void *value; value = malloc(*size); if (value == NULL) return GFARM_ERR_NO_ERROR; if (xmlMode) e = gfs_getxmlattr(path, xattrname, value, size); else e = gfs_getxattr(path, xattrname, value, size); if (e == GFARM_ERR_NO_ERROR) *valuep = value; else free(value); return e; } static gfarm_error_t get_xattr(int xmlMode, char *path, char *xattrname, char *filename) { gfarm_error_t e; FILE *f; int need_close = 0; void *value = NULL; size_t size, wsize; size = DEFAULT_ALLOC_SIZE; e = get_xattr_alloc(xmlMode, path, xattrname, &value, &size); if (e == GFARM_ERR_RESULT_OUT_OF_RANGE) { e = get_xattr_alloc(xmlMode, path, xattrname, &value, &size); } if (e != GFARM_ERR_NO_ERROR) return (e); if (filename != NULL) { f = fopen(filename, "w"); need_close = 1; } else f = stdout; if (f == NULL) { free(value); if (filename != NULL) fprintf(stderr, "%s: %s\n", filename, strerror(errno)); return (gfarm_errno_to_error(errno)); } wsize = fwrite(value, 1, size, f); if (wsize != size) { perror("fwrite"); } fflush(f); if (need_close) fclose(f); free(value); return (e); } static gfarm_error_t remove_xattr(int xmlMode, char *path, char *xattrname) { gfarm_error_t e; if (xmlMode) { e = gfs_removexmlattr(path, xattrname); } else { e = gfs_removexattr(path, xattrname); } return (e); } static gfarm_error_t list_xattr_alloc(int xmlMode, char *path, char **listp, size_t *size) { gfarm_error_t e; char *list; list = malloc(*size); if (list == NULL) return GFARM_ERR_NO_MEMORY; if (xmlMode) e = gfs_listxmlattr(path, list, size); else e = gfs_listxattr(path, list, size); if (e == GFARM_ERR_NO_ERROR) *listp = list; else free(list); return e; } static gfarm_error_t list_xattr(int xmlMode, char *path) { gfarm_error_t e; char *list = NULL, *base, *p, *last; size_t size; size = DEFAULT_ALLOC_SIZE; e = list_xattr_alloc(xmlMode, path, &list, &size); if (e == GFARM_ERR_RESULT_OUT_OF_RANGE) { e = list_xattr_alloc(xmlMode, path, &list, &size); } if (e != GFARM_ERR_NO_ERROR) return e; base = list; last = base + size; while ((base < last) && ((p = strchr(base, '\0')) != NULL)) { printf("%s\n", base); base = p + 1; } free(list); return (e); } void usage(char *prog_name) { fprintf(stderr, "Usage: %s [ -s | -g | -r | -l ]" #ifdef ENABLE_XMLATTR " [ -x ]" #endif " [ -c | -m ]" " [ -f xattrfile ] file [xattrname]\n", prog_name); fprintf(stderr, "\t-s\tset extended attribute\n"); fprintf(stderr, "\t-g\tget extended attribute\n"); fprintf(stderr, "\t-r\tremove extended attribute\n"); fprintf(stderr, "\t-l\tlist extended attribute\n"); #ifdef ENABLE_XMLATTR fprintf(stderr, "\t-x\thandle XML extended attribute\n"); #endif fprintf(stderr, "\t-c\tfail if xattrname already exists (use with -s)\n"); fprintf(stderr, "\t-m\tfail if xattrname does not exist (use with -s)\n"); exit(2); } /* * */ int main(int argc, char *argv[]) { char *prog_name = basename(argv[0]); char *filename = NULL, *c_path = NULL, *xattrname = NULL; enum { NONE, SET_MODE, GET_MODE, REMOVE_MODE, LIST_MODE } mode = NONE; int c, xmlMode = 0, flags = 0; gfarm_error_t e; const char *opts = "f:gsrlcmh?" #ifdef ENABLE_XMLATTR "x" #endif ; while ((c = getopt(argc, argv, opts)) != -1) { switch (c) { case 'f': filename = optarg; break; #ifdef ENABLE_XMLATTR case 'x': xmlMode = 1; break; #endif case 'g': mode = GET_MODE; break; case 's': mode = SET_MODE; break; case 'r': mode = REMOVE_MODE; break; case 'l': mode = LIST_MODE; break; case 'c': if (flags == 0) flags = GFS_XATTR_CREATE; else usage(prog_name); break; case 'm': if (flags == 0) flags = GFS_XATTR_REPLACE; else usage(prog_name); break; case 'h': case '?': default: usage(prog_name); } } argc -= optind; argv += optind; if (argc < 1 || mode == NONE) usage(prog_name); e = gfarm_initialize(&argc, &argv); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", prog_name, gfarm_error_string(e)); exit(1); } c_path = argv[0]; if (argc > 1) { xattrname = argv[1]; } switch (mode) { case SET_MODE: if (argc != 2) usage(prog_name); e = set_xattr(xmlMode, c_path, xattrname, filename, flags); break; case GET_MODE: if (argc != 2) usage(prog_name); e = get_xattr(xmlMode, c_path, xattrname, filename); break; case REMOVE_MODE: if (argc != 2) usage(prog_name); e = remove_xattr(xmlMode, c_path, xattrname); break; case LIST_MODE: if (argc != 1) usage(prog_name); e = list_xattr(xmlMode, c_path); break; default: usage(prog_name); break; } if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s\n", gfarm_error_string(e)); exit(1); } e = gfarm_terminate(); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", prog_name, gfarm_error_string(e)); exit(1); } exit(0); } gfarm-2.4.1/gftool/gfxattr/Makefile0000644000000000000000000000067711507222717015737 0ustar rootroot# $Id: Makefile 1265 2004-08-17 01:47:35Z soda $ top_builddir = ../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk PROGRAM = gfxattr SRCS = $(PROGRAM).c OBJS = $(PROGRAM).o CFLAGS = $(COMMON_CFLAGS) -I$(GFUTIL_SRCDIR) -I$(GFARMLIB_SRCDIR) $(openssl_includes) LDLIBS = $(COMMON_LDLIBS) $(GFARMLIB) $(LIBS) DEPLIBS = $(DEPGFARMLIB) all: $(PROGRAM) include $(top_srcdir)/makes/prog.mk ### $(OBJS): $(DEPGFARMINC) gfarm-2.4.1/gftool/gfrun/0000755000000000000000000000000011507222730013722 5ustar rootrootgfarm-2.4.1/gftool/gfrun/Makefile0000644000000000000000000000157411507222717015376 0ustar rootroot# $Id: Makefile 2373 2006-01-12 00:54:22Z soda $ top_builddir = ../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk SRCS = gfrun.c OBJS = gfrun.o PROGRAM = gfrun PROGRAM_LINKS = gfrsh gfssh gfrshl gfsshl EXTRA_VERYCLEAN_TARGETS = $(PROGRAM_LINKS) CFLAGS = $(COMMON_CFLAGS) -I$(GFUTIL_SRCDIR) -I$(GFARMLIB_SRCDIR) LDLIBS = $(COMMON_LDFLAGS) $(GFARMLIB) $(LIBS) DEPLIBS = $(DEPGFARMLIB) all: $(PROGRAM) $(PROGRAM_LINKS) include $(top_srcdir)/makes/prog.mk $(PROGRAM_LINKS): $(PROGRAM) rm -f $@ ln $(PROGRAM) $@ post-install-hook: for f in $(PROGRAM_LINKS); do \ rm -f $(DESTDIR)$(bindir)/$$f; \ ln $(DESTDIR)$(bindir)/$(PROGRAM) $(DESTDIR)$(bindir)/$$f; \ done ### $(OBJS): $(DEPGFARMINC) \ $(GFUTIL_SRCDIR)/gfutil.h \ $(GFARMLIB_SRCDIR)/host.h \ $(GFARMLIB_SRCDIR)/config.h \ $(GFARMLIB_SRCDIR)/gfj_client.h \ $(GFARMLIB_SRCDIR)/schedule.h gfarm-2.4.1/gftool/gfrun/gfrun.c0000644000000000000000000005447411507222717015232 0ustar rootroot/* * $Id: gfrun.c 3617 2007-03-12 08:32:55Z n-soda $ */ #include #include #include #include #include #include #include #include #include #include #include #include "gfutil.h" #include "host.h" #include "config.h" #include "gfj_client.h" #include "schedule.h" #define ENV_GFRUN_CMD "GFRUN_CMD" #define ENV_GFRUN_FLAGS "GFRUN_FLAGS" enum command_type {UNKNOWN_COMMAND = -1, USUAL_COMMAND = 0, GFARM_COMMAND = 1}; char *program_name = "gfrun"; void setsig(int signum, void (*handler)(int)) { struct sigaction act; act.sa_handler = handler; sigemptyset(&act.sa_mask); /* do not set SA_RESTART to make interrupt at waitpid(2) */ act.sa_flags = 0; if (sigaction(signum, &act, NULL) == -1) { fprintf(stderr, "%s: sigaction(%d): %s\n", program_name, signum, strerror(errno)); exit(1); } } void ignore_handler(int signum) { /* do nothing */ } void sig_ignore(int signum) { /* we don't use SIG_IGN to make it possible that child catch singals */ setsig(signum, ignore_handler); } void usage() { fprintf(stderr, #ifdef HAVE_GSI "Usage: %s [-bghnuprvS] [-l ]\n" #else "Usage: %s [-bghnuprS] [-l ]\n" #endif "\t[-G |-H |-N ] " "[-I
]\n" "\t[-o ] [-e ]" " command ...\n", program_name); exit(1); } struct gfrun_options { char *user_name; char *stdout_file; char *stderr_file; char *sched_file; /* -G */ char *hosts_file; /* -H */ int nprocs; /* -N */ char *section; /* -I */ enum command_type cmd_type; int authentication_verbose_mode; int profile; int replicate; int use_gfexec; int hook_global; }; static void default_gfrun_options(struct gfrun_options *options) { options->user_name = NULL; options->stdout_file = NULL; options->stderr_file = NULL; options->sched_file = NULL; options->hosts_file = NULL; options->nprocs = 0; options->section = NULL; options->cmd_type = UNKNOWN_COMMAND; options->authentication_verbose_mode = 0; options->profile = 0; options->replicate = 0; options->use_gfexec = 1; options->hook_global = 0; } char * gfrun(char *rsh_command, gfarm_stringlist *rsh_options, char *canonical_name_option, struct gfrun_options *options, int nhosts, char **hosts, char *cmd, char **argv) { int i, save_errno, status; int base_alist_index, host_alist_index, command_alist_index; gfarm_stringlist arg_list; char total_nodes[GFARM_INT32STRLEN], node_index[GFARM_INT32STRLEN]; char **delivered_paths = NULL, *e; enum command_type cmd_type_guess = USUAL_COMMAND, cmd_type; char *stdout_file = options->stdout_file; char *stderr_file = options->stderr_file; static char gfexec_command[] = "gfexec"; #ifdef __GNUC__ /* shut up stupid warning by gcc */ command_alist_index = 0; #endif /* * deliver gfarm:program. */ if (gfarm_is_url(cmd)) { if (!options->use_gfexec) { e = gfarm_url_program_deliver(cmd, nhosts, hosts, &delivered_paths); if (e != NULL) { fprintf(stderr, "%s: deliver %s: %s\n", program_name, cmd, e); return (e); } } cmd_type_guess = GFARM_COMMAND; } if (options->cmd_type == UNKNOWN_COMMAND) cmd_type = cmd_type_guess; else cmd_type = options->cmd_type; sprintf(total_nodes, "%d", nhosts); gfarm_stringlist_init(&arg_list); /* make room for "gfrcmd -N " */ gfarm_stringlist_add(&arg_list, "(dummy)"); gfarm_stringlist_add(&arg_list, "(dummy)"); gfarm_stringlist_add(&arg_list, "(dummy)"); host_alist_index = gfarm_stringlist_length(&arg_list); gfarm_stringlist_add(&arg_list, "(dummy)"); if (rsh_options != NULL) gfarm_stringlist_add_list(&arg_list, rsh_options); if (options->use_gfexec) gfarm_stringlist_add(&arg_list, gfexec_command); if (!options->use_gfexec) { command_alist_index = gfarm_stringlist_length(&arg_list); gfarm_stringlist_add(&arg_list, "(dummy)"); } if (options->use_gfexec || cmd_type == GFARM_COMMAND) { char *cwd; gfarm_stringlist_add(&arg_list, "--gfarm_nfrags"); gfarm_stringlist_add(&arg_list, total_nodes); gfarm_stringlist_add(&arg_list, "--gfarm_index"); gfarm_stringlist_add(&arg_list, node_index); if (stdout_file != NULL) { gfarm_stringlist_add(&arg_list, "--gfarm_stdout"); gfarm_stringlist_add(&arg_list, stdout_file); } if (stderr_file != NULL) { gfarm_stringlist_add(&arg_list, "--gfarm_stderr"); gfarm_stringlist_add(&arg_list, stderr_file); } if (options->profile) gfarm_stringlist_add(&arg_list, "--gfarm_profile"); if (options->replicate) gfarm_stringlist_add(&arg_list, "--gfarm_replicate"); if (options->hook_global) gfarm_stringlist_add(&arg_list, "--gfarm_hook_global"); cwd = getenv("GFS_PWD"); if (cwd != NULL) { gfarm_stringlist_add(&arg_list, "--gfarm_cwd"); gfarm_stringlist_add(&arg_list, cwd); } } if (options->use_gfexec) { command_alist_index = gfarm_stringlist_length(&arg_list); gfarm_stringlist_add(&arg_list, "(dummy)"); } gfarm_stringlist_cat(&arg_list, argv); gfarm_stringlist_add(&arg_list, NULL); for (i = 0; i < nhosts; i++) { char *if_hostname; struct sockaddr peer_addr; if (options->section != NULL && nhosts == 1) { /* Serial execution case with section name */ int nfrags; sprintf(node_index, "%d", atoi(options->section)); if (options->sched_file != NULL) { e = gfarm_url_fragment_number( options->sched_file, &nfrags); if (e != NULL) return (e); sprintf(total_nodes, "%d", nfrags); } else if (options->nprocs > 0) sprintf(total_nodes, "%d", options->nprocs); } else sprintf(node_index, "%d", i); /* reflect "address_use" directive in the `if_hostname' */ e = gfarm_host_address_get(hosts[i], gfarm_spool_server_port, &peer_addr, &if_hostname); if (e != NULL) { GFARM_STRINGLIST_ELEM(arg_list, host_alist_index) = hosts[i]; base_alist_index = 2; } else { GFARM_STRINGLIST_ELEM(arg_list, host_alist_index) = if_hostname; if (canonical_name_option == NULL || strcmp(hosts[i], if_hostname) == 0) { base_alist_index = 2; } else { base_alist_index = 0; GFARM_STRINGLIST_ELEM(arg_list, 1) = canonical_name_option; GFARM_STRINGLIST_ELEM(arg_list, 2) = hosts[i]; } } GFARM_STRINGLIST_ELEM(arg_list, base_alist_index) = rsh_command; if (delivered_paths == NULL) { GFARM_STRINGLIST_ELEM(arg_list, command_alist_index) = cmd; } else { GFARM_STRINGLIST_ELEM(arg_list, command_alist_index) = delivered_paths[i]; } switch (fork()) { case 0: execvp(rsh_command, GFARM_STRINGLIST_STRARRAY(arg_list) + base_alist_index); perror(rsh_command); exit(1); case -1: perror("fork"); exit(1); } if (e == NULL) free(if_hostname); } sig_ignore(SIGHUP); sig_ignore(SIGINT); sig_ignore(SIGQUIT); sig_ignore(SIGTERM); while (waitpid(-1, &status, 0) != -1 || errno == EINTR) ; save_errno = errno; if (delivered_paths != NULL) gfarm_strings_free_deeply(nhosts, delivered_paths); gfarm_stringlist_free(&arg_list); if (save_errno != ECHILD) { e = gfarm_errno_to_error(save_errno); fprintf(stderr, "%s: waiting child process: %s\n", program_name, e); return (e); } return (NULL); } /* * register files in gfarm spool */ void register_stdout_stderr(char *stdout_file, char *stderr_file, char *rsh_command, gfarm_stringlist *rsh_options, char *canonical_name_option, int nhosts, char **hosts) { char gfsplck_cmd[] = "gfarm:/bin/gfsplck"; struct gfs_stat sb; char *e, *gfarm_files[3]; int i = 0; /* purge the directory-tree cache. */ gfs_uncachedir(); if (stdout_file != NULL) { e = gfs_stat(stdout_file, &sb); if (e != NULL) gfarm_files[i++] = stdout_file; else gfs_stat_free(&sb); } if (stderr_file != NULL) { e = gfs_stat(stderr_file, &sb); if (e != NULL) gfarm_files[i++] = stderr_file; else gfs_stat_free(&sb); } gfarm_files[i] = NULL; if (i > 0) { struct gfrun_options options; e = gfs_stat(gfsplck_cmd, &sb); if (e != NULL) { fprintf(stderr, "%s: cannot register a stdout/stderr file, " "backend program %s: %s\n", program_name, gfsplck_cmd, e); return; } gfs_stat_free(&sb); default_gfrun_options(&options); options.cmd_type = GFARM_COMMAND; e = gfrun(rsh_command, rsh_options, canonical_name_option, &options, nhosts, hosts, gfsplck_cmd, gfarm_files); if (e != NULL) fprintf(stderr, "%s: cannot register a stdout file: " "%s\n", program_name, e); } } /* Process scheduling */ void schedule(char *command_name, struct gfrun_options *options, gfarm_stringlist *input_list, int *nhostsp, char ***hostsp, char **scheduling_filep) { char *e, *scheduling_file, **hosts; int error_line, nhosts; int spooled_command = gfarm_is_url(command_name); int nopts = 0; if (options->sched_file != NULL) nopts++; if (options->hosts_file != NULL) nopts++; if (options->nprocs > 0) nopts++; if (nopts > 1) { fprintf(stderr, "%s: only one of -G/-H/-N option can be used at most.", program_name); usage(); } if (options->hosts_file != NULL) { /* Hostfile scheduling */ if (options->section != NULL) fprintf(stderr, "%s: warning: -I option is ignored\n", program_name); /* * Is it necessary to access a Gfarm hostfile? */ e = gfarm_hostlist_read(options->hosts_file, &nhosts, &hosts, &error_line); if (e != NULL) { if (error_line != -1) fprintf(stderr, "%s: %s: line %d: %s\n", program_name, options->hosts_file, error_line, e); else fprintf(stderr, "%s: %s: %s\n", program_name, options->hosts_file, e); exit(1); } scheduling_file = options->hosts_file; } else if (options->nprocs > 0) { if (options->section != NULL) /* schedule a process for specified section */ nhosts = 1; else nhosts = options->nprocs; GFARM_MALLOC_ARRAY(hosts, nhosts); if (hosts == NULL) { fprintf(stderr, "%s: not enough memory for %d hosts", program_name, nhosts); exit(1); } if (spooled_command) { e = gfarm_schedule_search_idle_by_program( command_name, nhosts, hosts); } else { e = gfarm_schedule_search_idle_by_all(nhosts, hosts); } if (e != NULL) { fprintf(stderr, "%s: scheduling %d nodes: %s\n", program_name, nhosts, e); exit(1); } scheduling_file = ""; } else if (options->sched_file != NULL || gfarm_stringlist_length(input_list) != 0) { /* * File-affinity scheduling * * If scheduling file is not explicitly specified, the * first input file used for file-affinity scheduling. */ if (options->sched_file == NULL) options->sched_file = gfarm_stringlist_elem(input_list, 0); scheduling_file = options->sched_file; if (options->section != NULL) { /* schedule a process for specified section */ char *gfarm_file; nhosts = 1; GFARM_MALLOC(hosts); if (hosts == NULL) { fprintf(stderr, "%s: not enough memory", program_name); exit(1); } e = gfarm_url_make_path(scheduling_file, &gfarm_file); if (e != NULL) { fprintf(stderr, "%s: %s", program_name, e); exit(1); } if (spooled_command) e = gfarm_file_section_host_schedule_by_program( gfarm_file, options->section, command_name, hosts); else e = gfarm_file_section_host_schedule( gfarm_file, options->section, hosts); free(gfarm_file); } else { if (spooled_command) e = gfarm_url_hosts_schedule_by_program( scheduling_file, command_name, NULL, &nhosts, &hosts); else e = gfarm_url_hosts_schedule(scheduling_file, NULL, &nhosts, &hosts); } if (e != NULL) { fprintf(stderr, "%s: scheduling by %s: %s\n", program_name, scheduling_file, e); exit(1); } } else { /* Serial execution */ nhosts = 1; GFARM_MALLOC(hosts); if (hosts == NULL) { fprintf(stderr, "%s: not enough memory", program_name); exit(1); } if (spooled_command) e = gfarm_schedule_search_idle_by_program( command_name, 1, hosts); else e= gfarm_schedule_search_idle_by_all(1, hosts); if (e != NULL) { fprintf(stderr, "%s: scheduling 1 host: %s\n", program_name, e); exit(1); } scheduling_file = ""; } *nhostsp = nhosts; *hostsp = hosts; *scheduling_filep = scheduling_file; } /* * parse command line */ void decide_rsh_command(char *program_name, char **rsh_commandp, gfarm_stringlist *rsh_options, char **canonical_name_optionp, int *remove_gfarm_url_prefixp) { char *rsh_command, *rsh_flags, *base; char *canonical_name_option = NULL; int have_redirect_stdin_option = 1, remove_gfarm_url_prefix = 0; rsh_command = getenv(ENV_GFRUN_CMD); if (rsh_command == NULL) rsh_command = "gfrcmd"; /* For backward compatibility */ if (strcmp(program_name, "gfrsh") == 0) { rsh_command = "rsh"; } else if (strcmp(program_name, "gfssh") == 0) { rsh_command = "ssh"; } else if (strcmp(program_name, "gfrshl") == 0) { rsh_command = "rsh"; remove_gfarm_url_prefix = 1; } else if (strcmp(program_name, "gfsshl") == 0) { rsh_command = "ssh"; remove_gfarm_url_prefix = 1; } /* Hack */ base = basename(rsh_command); if (strcmp(base, "gfrcmd") == 0) canonical_name_option = "-N"; else if (strcmp(base, "globus-job-run") == 0) have_redirect_stdin_option = 0; /* $GFRUN_FLAGS: XXX - Currently, You can specify at most one flag */ rsh_flags = getenv(ENV_GFRUN_FLAGS); if (rsh_flags != NULL) gfarm_stringlist_add(rsh_options, rsh_flags); else if (have_redirect_stdin_option) gfarm_stringlist_add(rsh_options, "-n"); *rsh_commandp = rsh_command; *canonical_name_optionp = canonical_name_option; *remove_gfarm_url_prefixp = remove_gfarm_url_prefix; } void missing_argument(char option) { fprintf(stderr, "%s: missing argument to -%c\n", program_name, option); usage(); } /* * Parse a gfrun option which does take a parameter. * The option itself will not be added to *rsh_options. * * INPUT: * is_last_arg: Is `arg' last argument of argv[]? * arg: currently looking entry of argv[] * next_arg: next entry of argv[] * char_index: arg[char_index] is the currently looking gfrun option * INPUT/OUTPUT: * *rsh_options: rsh options * OUTPUT: * *parameterp: parameter of the currently looking gfrun option * RETURN: * true, if next argument is spent as the parameter of this option */ int option_param(int is_last_arg, char *arg, char *next_arg, int char_index, gfarm_stringlist *rsh_options, char **parameterp) { char optchar = arg[char_index]; if (char_index > 1) { arg[char_index] = '\0'; gfarm_stringlist_add(rsh_options, arg); } if (arg[char_index + 1] != '\0') { *parameterp = &arg[char_index + 1]; return (0); /* don't skip next arg */ } else if (!is_last_arg) { *parameterp = next_arg; return (1); /* skip next arg */ } else { missing_argument(optchar); /* NOTREACHED */ } return (0); } /* * Parse a rsh option which does take a parameter. * The option will be added to *rsh_options. * * INPUT: * is_last_arg: Is `arg' last argument of argv[]? * arg: currently looking entry of argv[] * next_arg: next entry of argv[] * char_index: arg[char_index] is the currently looking rsh option * INPUT/OUTPUT: * *rsh_options: rsh options * OUTPUT: * *parameterp: parameter of the currently looking rsh option * RETURN: * true, if next argument is spent as the parameter of this option */ int rsh_option_param(int is_last_arg, char *arg, char *next_arg, int char_index, gfarm_stringlist *rsh_options, char **parameterp) { if (arg[char_index + 1] != '\0') { *parameterp = &arg[char_index + 1]; gfarm_stringlist_add(rsh_options, arg); return (0); /* don't skip next arg */ } else if (!is_last_arg) { *parameterp = next_arg; gfarm_stringlist_add(rsh_options, arg); gfarm_stringlist_add(rsh_options, next_arg); return (1); /* skip next arg */ } else { missing_argument(arg[char_index]); /* NOTREACHED */ } return (0); } /* * RETURN: * true, if this is the sole option in the arg, * i.e. this option shouldn't be added to rsh_options */ int remove_option(char *arg, int *char_indexp) { int i = *char_indexp; if (i == 1 && arg[i + 1] == '\0') return (1); /* this is the sole option in the arg */ memmove(&arg[i], &arg[i + 1], strlen(&arg[i])); *char_indexp = i - 1; return (0); } /* * RETURN: * true, if next argument is spent as the parameter of this option. */ int parse_option(int is_last_arg, char *arg, char *next_arg, gfarm_stringlist *rsh_options, struct gfrun_options *options) { int i, skip_next; char *s; for (i = 1; arg[i] != '\0'; i++) { switch (arg[i]) { case 'b': options->hook_global = 1; if (remove_option(arg, &i)) return (0); break; case 'h': case '?': usage(); case 'g': options->cmd_type = GFARM_COMMAND; if (remove_option(arg, &i)) return (0); break; case 'u': options->cmd_type = USUAL_COMMAND; if (remove_option(arg, &i)) return (0); break; case 'v': options->authentication_verbose_mode = 1; if (remove_option(arg, &i)) return (0); break; case 'p': options->profile = 1; if (remove_option(arg, &i)) return (0); break; case 'r': options->replicate = 1; if (remove_option(arg, &i)) return (0); break; case 'S': options->use_gfexec = 0; if (remove_option(arg, &i)) return (0); break; case 'o': return (option_param(is_last_arg, arg, next_arg, i, rsh_options, &options->stdout_file)); case 'e': return (option_param(is_last_arg, arg, next_arg, i, rsh_options, &options->stderr_file)); case 'G': return (option_param(is_last_arg, arg, next_arg, i, rsh_options, &options->sched_file)); case 'H': return (option_param(is_last_arg, arg, next_arg, i, rsh_options, &options->hosts_file)); case 'I': return (option_param(is_last_arg, arg, next_arg, i, rsh_options, &options->section)); case 'N': skip_next = option_param(is_last_arg, arg, next_arg, i, rsh_options, &s); options->nprocs = atoi(s); return (skip_next); case 'K': /* turn off kerberos */ case 'd': /* turn on SO_DEBUG */ case 'n': /* redirect input from /dev/null */ case 'x': /* DES encrypt */ /* an option which doesn't have an argument */ break; case 'k': /* realm of kerberos */ return (rsh_option_param(is_last_arg, arg, next_arg, i, rsh_options, &s)); case 'l': /* user name */ return (rsh_option_param(is_last_arg, arg, next_arg, i, rsh_options, &options->user_name)); } } gfarm_stringlist_add(rsh_options, arg); return (0); /* don't skip next arg */ } int parse_options(int argc, char **argv, gfarm_stringlist *rsh_options, struct gfrun_options *options) { int i; default_gfrun_options(options); for (i = 1; i < argc; i++) { if (argv[i][0] != '-') break; /* argv[argc] == NULL, thus this isn't out of bounds. */ if (parse_option(i + 1 == argc, argv[i], argv[i + 1], rsh_options, options)) i++; } return (i); } int main(int argc, char **argv) { char *e, *e_save, *command_url; char **hosts, *rsh_command, *command_name, *scheduling_file; int i, command_index, nhosts, job_id, nfrags; struct gfrun_options options; gfarm_stringlist input_list, output_list, rsh_options; char *canonical_name_option; int remove_gfarm_url_prefix = 0, command_url_need_free; if (argc >= 1) program_name = basename(argv[0]); gfarm_stringlist_init(&rsh_options); decide_rsh_command(program_name, &rsh_command, &rsh_options, &canonical_name_option, &remove_gfarm_url_prefix); command_index = parse_options(argc, argv, &rsh_options, &options); if (command_index >= argc) /* no command name */ usage(); command_name = argv[command_index]; if (options.authentication_verbose_mode) gflog_auth_set_verbose(1); if ((e = gfarm_initialize(&argc, &argv)) != NULL) { fprintf(stderr, "%s: gfarm initialize: %s\n", program_name, e); exit(1); } if ((e = gfj_initialize()) != NULL) { fprintf(stderr, "%s: job manager: %s\n", program_name, e); exit(1); } gfarm_stringlist_init(&input_list); gfarm_stringlist_init(&output_list); for (i = command_index + 1; i < argc; i++) { if (gfarm_is_url(argv[i])) { e = gfarm_url_fragment_number(argv[i], &nfrags); if (e == NULL) gfarm_stringlist_add(&input_list, argv[i]); else gfarm_stringlist_add(&output_list, argv[i]); if (remove_gfarm_url_prefix) argv[i] += GFARM_URL_PREFIX_LENGTH; } } /* command name */ e = gfs_realpath(command_name, &command_url); if (e == NULL) { struct gfs_stat gsb; e = gfs_stat(command_url, &gsb); if (e == NULL) { if (!GFARM_S_IS_PROGRAM(gsb.st_mode)) { fprintf(stderr, "%s: not an executable\n", command_url); gfs_stat_free(&gsb); free(command_url); exit(1); } gfs_stat_free(&gsb); } else { fprintf(stderr, "%s: %s\n", command_url, e); free(command_url); exit(1); } command_url_need_free = 1; } else { if (gfarm_is_url(command_name)) { fprintf(stderr, "%s: %s\n", command_name, e); exit(1); } /* not a command in Gfarm file system */ command_url = command_name; command_url_need_free = 0; } schedule(command_url, &options, &input_list, &nhosts, &hosts, &scheduling_file); /* * register job manager */ e = gfarm_user_job_register(nhosts, hosts, program_name, scheduling_file, argc - command_index, &argv[command_index], &job_id); if (e != NULL) { fprintf(stderr, "%s: job register: %s\n", program_name, e); exit(1); } e_save = gfrun(rsh_command, &rsh_options, canonical_name_option, &options, nhosts, hosts, command_url, &argv[command_index + 1]); #if 0 /* * gfarm_terminate() should be called after the change of * hooks_init.c on 2 March, 2005. It is not necessary to call * costly register_stdout_stderr() any more. */ if (e_save == NULL) { register_stdout_stderr( options.stdout_file, options.stderr_file, rsh_command, &rsh_options, canonical_name_option, nhosts, hosts); } #endif #if 0 /* XXX - temporary solution; it is not necessary for the output file to be the same number of fragments. */ for (i = 0; i < gfarm_stringlist_length(&output_list); i++) gfarm_url_fragment_cleanup( gfarm_stringlist_elem(&output_list, i), nhosts, hosts); #endif gfarm_strings_free_deeply(nhosts, hosts); gfarm_stringlist_free(&output_list); gfarm_stringlist_free(&input_list); gfarm_stringlist_free(&rsh_options); if (command_url_need_free) free(command_url); if ((e = gfarm_terminate()) != NULL) { fprintf(stderr, "%s: gfarm terminate: %s\n", program_name, e); exit(1); } return (e_save == NULL ? 0 : 1); } gfarm-2.4.1/gftool/gfchmod/0000755000000000000000000000000011507222730014210 5ustar rootrootgfarm-2.4.1/gftool/gfchmod/gfchmod.c0000644000000000000000000000432711507222717015776 0ustar rootroot/* * $Id: gfchmod.c 3717 2007-05-09 13:44:18Z tatebe $ */ #include #include #include #include #include #include #include char *program_name = "gfchmod"; static void usage(void) { fprintf(stderr, "Usage: %s ...\n", program_name); exit(1); } int main(int argc, char **argv) { gfarm_error_t e; int c, i, n, status = 0; char *s; long mode; #if 0 /* not yet in gfarm v2 */ gfarm_stringlist paths; gfs_glob_t types; #endif extern int optind; if (argc > 0) program_name = basename(argv[0]); e = gfarm_initialize(&argc, &argv); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", program_name, gfarm_error_string(e)); exit(1); } while ((c = getopt(argc, argv, "h?")) != -1) { switch (c) { case 'h': case '?': default: usage(); } } argc -= optind; argv += optind; if (argc <= 1) usage(); errno = 0; mode = strtol(argv[0], &s, 8); if (errno != 0 || s == argv[0] || *s != '\0') { fprintf(stderr, "%s: %s: %s\n", program_name, argv[0], errno != 0 ? strerror(errno) : " must be an octal number"); status = 1; #if 0 /* not yet in gfarm v2 */ } else if ((e = gfarm_stringlist_init(&paths)) != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", program_name, e); status = 1; } else if ((e = gfs_glob_init(&types)) != GFARM_ERR_NO_ERROR) { gfarm_stringlist_free_deeply(&paths); fprintf(stderr, "%s: %s\n", program_name, e); status = 1; #endif } else { #if 0 /* not yet in gfarm v2 */ for (i = 1; i < argc; i++) gfs_glob(argv[i], &paths, &types); n = gfarm_stringlist_length(&paths); for (i = 0; i < n; i++) { s = gfarm_stringlist_elem(&paths, i); #else n = argc; for (i = 1; i < n; i++) { s = argv[i]; #endif e = gfs_chmod(s, (gfarm_mode_t)mode); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s: %s\n", program_name, s, gfarm_error_string(e)); status = 1; } } #if 0 /* not yet in gfarm v2 */ gfs_glob_free(&types); gfarm_stringlist_free_deeply(&paths); #endif } e = gfarm_terminate(); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", program_name, gfarm_error_string(e)); status = 1; } return (status); } gfarm-2.4.1/gftool/gfchmod/Makefile0000644000000000000000000000060311507222717015654 0ustar rootroot# $Id: Makefile 2637 2006-05-29 22:35:42Z soda $ top_builddir = ../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk PROGRAM = gfchmod SRCS = $(PROGRAM).c OBJS = $(PROGRAM).o CFLAGS = $(COMMON_CFLAGS) LDLIBS = $(COMMON_LDLIBS) $(GFARMLIB) $(LIBS) DEPLIBS = $(DEPGFARMLIB) all: $(PROGRAM) include $(top_srcdir)/makes/prog.mk ### $(OBJS): $(DEPGFARMINC) gfarm-2.4.1/gftool/gfifo/0000755000000000000000000000000011507222730013673 5ustar rootrootgfarm-2.4.1/gftool/gfifo/gfifo.sh0000755000000000000000000000417011507222717015333 0ustar rootroot#!/bin/sh # # gfifo.sh script submits processes on a specified host when it # is available. -G or -N option specifies the total number of # processes. -H option specifies the host list that limits the # number of parallel executions. # # $Id$ FIFO=/tmp/gfifo-$$ error() { echo >&2 $* usage } usage() { echo >&2 "usage: gfifo.sh [ -G file | -N #proc ] [ -H hostfile ]" echo >&2 " [ -o stdout ] [ -e stderr ] [ -prb ] ..." exit 1 } # setup host list setup_hostlist() { if [ X$HOSTFILE = X ]; then gfhost > $FIFO & else cat $HOSTFILE > $FIFO & fi } job() { gfrcmd -n $1 gfexec $GFRCMD_ARGS --gfarm_index $2 $PROGS >&2 } submit() { i=0 cat $FIFO | while read h do (job $h $i; echo $h) & i=`expr $i + 1` [ $i -ge $NUM_PROC ] && { wait break } done > $FIFO } while [ $# -gt 0 ]; do case $1 in -G) shift; [ $# -ge 1 ] || usage [ X$NUM_PROC = X ] || error -G option cannot be specified with -N SCHEDFILE=$1 ;; -N) shift; [ $# -ge 1 ] || usage [ X$SCHEDFILE = X ] || error -N option cannot be specified with -G NUM_PROC=$1 ;; -H) shift; [ $# -ge 1 ] || usage HOSTFILE=$1 [ -e $HOSTFILE ] || error $HOSTFILE: not exist ;; -o) shift; [ $# -ge 1 ] || usage STDOUT=$1 ;; -e) shift; [ $# -ge 1 ] || usage STDERR=$1 ;; -p) PROFILE=yes ;; -r) REPLICATION=yes ;; -b) GLOBAL=yes ;; *) break ;; esac shift done [ X$SCHEDFILE = X -a X$NUM_PROC = X ] && error either -G or -N option should be specified if [ X$SCHEDFILE != X ]; then NUM_PROC=$(gfwhere $SCHEDFILE | wc -l) NUM_PROC=`expr $NUM_PROC - 1` fi GFRCMD_ARGS="--gfarm_nfrags $NUM_PROC" [ X$STDOUT = X ] || GFRCMD_ARGS="$GFRCMD_ARGS --gfarm_stdout=$STDOUT" [ X$STDERR = X ] || GFRCMD_ARGS="$GFRCMD_ARGS --gfarm_stderr=$STDERR" [ X$PROFILE = X ] || GFRCMD_ARGS="$GFRCMD_ARGS --gfarm_profile" [ X$REPLICATION = X ] || GFRCMD_ARGS="$GFRCMD_ARGS --gfarm_replicate" [ X$GLOBAL = X ] || GFRCMD_ARGS="$GFRCMD_ARGS --gfarm_hook_global" [ X$GFS_PWD = X ] || GFRCMD_ARGS="$GFRCMD_ARGS --gfarm_cwd $GFS_PWD" PROGS="$*" mknod $FIFO p setup_hostlist submit rm -f $FIFO gfarm-2.4.1/gftool/gfifo/Makefile0000644000000000000000000000025611507222717015343 0ustar rootroot# $Id$ top_builddir = ../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk SCRIPTS = $(srcdir)/gfifo.sh include $(top_srcdir)/makes/script.mk gfarm-2.4.1/gftool/gfmv/0000755000000000000000000000000011507222730013540 5ustar rootrootgfarm-2.4.1/gftool/gfmv/Makefile0000644000000000000000000000060011507222717015201 0ustar rootroot# $Id: Makefile 2612 2006-05-29 04:24:37Z soda $ top_builddir = ../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk PROGRAM = gfmv SRCS = $(PROGRAM).c OBJS = $(PROGRAM).o CFLAGS = $(COMMON_CFLAGS) LDLIBS = $(COMMON_LDLIBS) $(GFARMLIB) $(LIBS) DEPLIBS = $(DEPGFARMLIB) all: $(PROGRAM) include $(top_srcdir)/makes/prog.mk ### $(OBJS): $(DEPGFARMINC) gfarm-2.4.1/gftool/gfmv/gfmv.c0000644000000000000000000000213411507222717014650 0ustar rootroot/* * $Id: gfmv.c 2640 2006-05-29 22:38:29Z soda $ */ #include #include #include #include #include char *program_name = "gfmv"; static void usage(void) { fprintf(stderr, "Usage: %s src dst\n", program_name); exit(1); } int main(int argc, char **argv) { gfarm_error_t e; int c, status = 0; extern int optind; if (argc > 0) program_name = basename(argv[0]); e = gfarm_initialize(&argc, &argv); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", program_name, gfarm_error_string(e)); exit(1); } while ((c = getopt(argc, argv, "h?")) != -1) { switch (c) { case 'h': case '?': default: usage(); } } argc -= optind; argv += optind; if (argc != 2) usage(); e = gfs_rename(argv[0], argv[1]); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s %s %s: %s\n", program_name, argv[0], argv[1], gfarm_error_string(e)); status = 1; } e = gfarm_terminate(); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", program_name, gfarm_error_string(e)); status = 1; } return (status); } gfarm-2.4.1/gftool/gfpwd/0000755000000000000000000000000011507222730013710 5ustar rootrootgfarm-2.4.1/gftool/gfpwd/gfpwd.c0000644000000000000000000000125711507222717015175 0ustar rootroot/* * $Id: gfpwd.c 2373 2006-01-12 00:54:22Z soda $ */ #include #include #include #include #include char *program_name = "gfpwd"; int main(int argc, char **argv) { char *e, *path; if (argc > 0) program_name = basename(argv[0]); e = gfarm_initialize(&argc, &argv); if (e != NULL) { fprintf(stderr, "%s: %s\n", program_name, e); exit(1); } e = gfs_realpath(".", &path); if (e != NULL) { fprintf(stderr, "%s: %s\n", program_name, e); exit(1); } e = gfarm_terminate(); if (e != NULL) { fprintf(stderr, "%s: %s\n", program_name, e); exit(1); } printf("%s\n", path); free(path); return (0); } gfarm-2.4.1/gftool/gfpwd/Makefile0000644000000000000000000000061411507222717015356 0ustar rootroot# $Id: Makefile 2373 2006-01-12 00:54:22Z soda $ top_builddir = ../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk SRCS = gfpwd.c OBJS = gfpwd.o PROGRAM = gfpwd CFLAGS = $(COMMON_CFLAGS) -I$(GFARMLIB_SRCDIR) LDLIBS = $(COMMON_LDLIBS) $(GFARMLIB) $(LIBS) DEPLIBS = $(DEPGFARMLIB) all: $(PROGRAM) include $(top_srcdir)/makes/prog.mk ### $(OBJS): $(DEPGFARMINC) gfarm-2.4.1/gftool/gfps/0000755000000000000000000000000011507222730013540 5ustar rootrootgfarm-2.4.1/gftool/gfps/gfps.c0000644000000000000000000000546411507222717014661 0ustar rootroot#include #include #include #include #include #include #include #include "gfj_client.h" #include "auth.h" #include "gfutil.h" char *program_name = "gfps"; void usage() { fprintf(stderr, "Usage: %s [option] [...]\n", program_name); fprintf(stderr, "option:\n"); fprintf(stderr, "\t-a\tlist all user\n"); fprintf(stderr, "\t-l\tdetailed output\n"); #ifdef HAVE_GSI fprintf(stderr, "\t-v: display GSS minor status error.\n"); #endif exit(1); } int main(argc, argv) int argc; char **argv; { extern int optind; int ch, do_all = 0, do_detailed = 0; int opt_auth_verbose = 0; int n, i, j, *joblist; struct gfarm_job_info *info, *infos; char *e; if (argc >= 1) program_name = basename(argv[0]); while ((ch = getopt(argc, argv, "alv?")) != -1) { switch (ch) { case 'a': do_all = 1; break; case 'l': do_detailed = 1; break; case 'v': opt_auth_verbose = 1; break; case '?': default: usage(); } } argc -= optind; argv += optind; if (opt_auth_verbose) gflog_auth_set_verbose(1); e = gfarm_initialize(&argc, &argv); if (e != NULL) { fprintf(stderr, "%s: %s\n", program_name, e); exit(1); } e = gfj_initialize(); if (e != NULL) { fprintf(stderr, "%s: %s\n", program_name, e); exit(1); } if (argc > 0) { n = argc; GFARM_MALLOC_ARRAY(joblist, n); if (joblist == NULL) { fprintf(stderr, "%s: no memory\n", program_name); exit(1); } for (i = 0; i < argc; i++) joblist[i] = atoi(argv[i]); } else { e = gfj_client_list(gfarm_jobmanager_server, do_all ? "" : gfarm_get_global_username(), &n, &joblist); } if (e != NULL) { fprintf(stderr, "%s: %s\n", program_name, e); exit(1); } GFARM_MALLOC_ARRAY(infos, n); if (infos == NULL) { fprintf(stderr, "%s: no memory\n", program_name); exit(1); } e = gfj_client_info(gfarm_jobmanager_server, n, joblist, infos); if (e != NULL) { fprintf(stderr, "%s: %s\n", program_name, e); exit(1); } for (i = 0; i < n; i++) { info = &infos[i]; /* * infos[i] may be invalid when there is no process * having the specified process id. */ if (info->user == NULL) continue; printf("%6d %8s@%-10.10s %-8s %4d", joblist[i], info->user, info->originate_host, info->job_type, info->total_nodes); for (j = 0; j < info->argc; j++) printf(" %s", info->argv[j]); printf("\n"); if (do_detailed) { printf("\t"); printf("%s", info->nodes[0].hostname); for (j = 1; j < info->total_nodes; j++) printf(", %s", info->nodes[j].hostname); printf("\n"); } } gfarm_job_info_free_contents(infos, n); free(infos); free(joblist); e = gfarm_terminate(); if (e != NULL) { fprintf(stderr, "%s: %s\n", program_name, e); exit(1); } return (0); } gfarm-2.4.1/gftool/gfps/Makefile0000644000000000000000000000102011507222717015176 0ustar rootroot# $Id: Makefile 2373 2006-01-12 00:54:22Z soda $ top_builddir = ../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk SRCS = gfps.c OBJS = gfps.o PROGRAM = gfps CFLAGS = $(COMMON_CFLAGS) -I$(GFUTIL_SRCDIR) -I$(GFARMLIB_SRCDIR) \ $(openssl_includes) LDLIBS = $(COMMON_LDLIBS) $(GFARMLIB) $(LIBS) DEPLIBS = $(DEPGFARMLIB) all: $(PROGRAM) include $(top_srcdir)/makes/prog.mk ### $(OBJS): $(DEPGFARMINC) \ $(GFUTIL_SRCDIR)/gfutil.h \ $(GFARMLIB_SRCDIR)/gfj_client.h \ $(GFARMLIB_SRCDIR)/auth.h gfarm-2.4.1/gftool/gfwhere/0000755000000000000000000000000011507222730014230 5ustar rootrootgfarm-2.4.1/gftool/gfwhere/Makefile0000644000000000000000000000067011507222717015700 0ustar rootroot# $Id: Makefile 3950 2008-04-28 07:58:23Z tatebe $ top_builddir = ../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk SRCS = gfwhere.c OBJS = gfwhere.o PROGRAM = gfwhere CFLAGS = $(COMMON_CFLAGS) -I$(GFARMLIB_SRCDIR) LDLIBS = $(COMMON_LDFLAGS) $(GFARMLIB) $(LIBS) DEPLIBS = $(DEPGFARMLIB) all: $(PROGRAM) include $(top_srcdir)/makes/prog.mk ### $(OBJS): $(DEPGFARMINC) $(GFARMLIB_SRCDIR)/gfarm_foreach.h gfarm-2.4.1/gftool/gfwhere/gfwhere.c0000644000000000000000000001423711507222717016037 0ustar rootroot#include #include #include #include #include #include #include #include #include #include "gfarm_foreach.h" char *program_name = "gfwhere"; struct options { int long_format; int type_suffix; int print_dead_host; int print_incomplete_copy; int print_dead_copy; int do_not_display_name; int flags; }; static void display_name(char *name) { static int print_ln; if (print_ln) printf("\n"); else print_ln = 1; printf("%s:\n", name); } void display_replica(struct gfs_stat *st, struct gfs_replica_info *ri, int i, struct options *opt) { int need_space; if (opt->long_format) putchar('\t'); else if (i > 0) putchar(' '); fputs(gfs_replica_info_nth_host(ri, i), stdout); if (opt->type_suffix) { if (opt->print_dead_copy && gfs_replica_info_nth_is_dead_copy(ri, i)) printf(";%llu", (long long)gfs_replica_info_nth_gen(ri, i)); if (gfs_replica_info_nth_is_incomplete(ri, i)) putchar('?'); if (gfs_replica_info_nth_is_dead_host(ri, i)) putchar('-'); } if (opt->long_format) { if (opt->print_dead_host || opt->print_incomplete_copy || opt->print_dead_copy) putchar('\t'); if (opt->print_dead_copy) printf("%10llu\t", (unsigned long long) gfs_replica_info_nth_gen(ri, i)); need_space = 0; if (opt->print_dead_host) { putchar(gfs_replica_info_nth_is_dead_host(ri, i) ? 'd' : '-'); need_space = 1; } if (opt->print_incomplete_copy) { if (need_space) putchar(' '); putchar(gfs_replica_info_nth_is_incomplete(ri, i) ? 'i' : '-'); need_space = 1; } if (opt->print_dead_copy) { if (need_space) putchar(' '); putchar(gfs_replica_info_nth_is_dead_copy(ri, i) ? 'o' : '-'); } putchar('\n'); } } static gfarm_error_t display_copy(char *path, struct gfs_stat *st, struct options *opt) { gfarm_error_t e; int n, i; struct gfs_replica_info *ri; e = gfs_replica_info_by_name(path, opt->flags, &ri); if (e != GFARM_ERR_NO_ERROR) return (e); if (!opt->do_not_display_name) display_name(path); n = gfs_replica_info_number(ri); for (i = 0; i < n; ++i) { display_replica(st, ri, i, opt); } printf("\n"); gfs_replica_info_free(ri); return (e); } static gfarm_error_t display_replica_catalog(char *path, struct gfs_stat *st, void *arg) { gfarm_error_t e; struct options *opt = arg; gfarm_mode_t mode; mode = st->st_mode; if (GFARM_S_ISDIR(mode)) e = GFARM_ERR_IS_A_DIRECTORY; else if (!GFARM_S_ISREG(mode)) e = GFARM_ERR_FUNCTION_NOT_IMPLEMENTED; else if (!opt->print_dead_host && !opt->print_incomplete_copy && !opt->print_dead_copy && st->st_ncopy == 0 && st->st_size > 0) /* XXX - GFARM_ERR_NO_REPLICA */ e = GFARM_ERR_NO_SUCH_OBJECT; else e = display_copy(path, st, opt); if (e != GFARM_ERR_NO_ERROR) fprintf(stderr, "%s: %s\n", path, gfarm_error_string(e)); return (e); } void usage(void) { fprintf(stderr, "Usage: %s [option] ...\n", program_name); fprintf(stderr, "option:\n"); fprintf(stderr, "\t-a\t\tall replicas; equals -dio\n"); fprintf(stderr, "\t-d\t\tdead filesystem node is displayed\n"); fprintf(stderr, "\t-F\t\tappend indicator (-, ?, ;gen) to replicas\n"); fprintf(stderr, "\t-i\t\tincomplete replica is displayed\n"); fprintf(stderr, "\t-l\t\tlong format\n"); fprintf(stderr, "\t-o\t\tobsolete replica is displayed\n"); fprintf(stderr, "\t-r, -R\t\tdisplay subdirectories recursively\n"); exit(1); } int main(int argc, char **argv) { int argc_save = argc; char **argv_save = argv; gfarm_error_t e, e_save = GFARM_ERR_NO_ERROR; int i, n, ch, opt_recursive = 0; struct options opt; gfarm_stringlist paths; gfs_glob_t types; if (argc >= 1) program_name = basename(argv[0]); opt.long_format = 0; opt.type_suffix = 0; opt.print_dead_host = 0; opt.print_incomplete_copy = 0; opt.print_dead_copy = 0; while ((ch = getopt(argc, argv, "adFilorR?")) != -1) { switch (ch) { case 'a': opt.print_dead_host = opt.print_incomplete_copy = opt.print_dead_copy = 1; break; case 'd': opt.print_dead_host = 1; break; case 'F': opt.type_suffix = 1; break; case 'i': opt.print_incomplete_copy = 1; break; case 'l': opt.long_format = 1; break; case 'o': opt.print_dead_copy = 1; break; case 'r': case 'R': opt_recursive = 1; break; case '?': default: usage(); } } argc -= optind; argv += optind; opt.flags = 0; if (opt.print_dead_host) opt.flags |= GFS_REPLICA_INFO_INCLUDING_DEAD_HOST; if (opt.print_incomplete_copy) opt.flags |= GFS_REPLICA_INFO_INCLUDING_INCOMPLETE_COPY; if (opt.print_dead_copy) opt.flags |= GFS_REPLICA_INFO_INCLUDING_DEAD_COPY; e = gfarm_initialize(&argc_save, &argv_save); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", program_name, gfarm_error_string(e)); exit(1); } if (argc == 0) { usage(); } e = gfarm_stringlist_init(&paths); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", program_name, gfarm_error_string(e)); exit(EXIT_FAILURE); } e = gfs_glob_init(&types); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", program_name, gfarm_error_string(e)); exit(EXIT_FAILURE); } for (i = 0; i < argc; i++) gfs_glob(argv[i], &paths, &types); gfs_glob_free(&types); n = gfarm_stringlist_length(&paths); for (i = 0; i < n; i++) { char *p = gfarm_stringlist_elem(&paths, i); struct gfs_stat st; opt.do_not_display_name = 0; if ((e = gfs_stat(p, &st)) != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", p, gfarm_error_string(e)); } else { if (GFARM_S_ISREG(st.st_mode)) { opt.do_not_display_name = (n == 1); e = display_replica_catalog(p, &st, &opt); } else if (opt_recursive) e = gfarm_foreach_directory_hierarchy( display_replica_catalog, NULL, NULL, p, &opt); else fprintf(stderr, "%s: not a file\n", p); gfs_stat_free(&st); if (e_save == GFARM_ERR_NO_ERROR) e_save = e; } } gfarm_stringlist_free_deeply(&paths); e = gfarm_terminate(); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", program_name, gfarm_error_string(e)); exit(1); } return (e_save == GFARM_ERR_NO_ERROR ? 0 : 1); } gfarm-2.4.1/gftool/gfrm/0000755000000000000000000000000011507222730013534 5ustar rootrootgfarm-2.4.1/gftool/gfrm/gfrm_simple.c0000644000000000000000000000370411507222717016215 0ustar rootroot/* * $Id: gfrm_simple.c 4695 2010-05-27 11:54:51Z n-soda $ */ #include #include #include #include #include char *program_name = "gfrm"; static void usage(void) { fprintf(stderr, "Usage: %s [-f] [-h hostname] file...\n", program_name); exit(EXIT_FAILURE); } int main(int argc, char **argv) { gfarm_error_t e; int i, n, c, status = 0; int opt_force = 0; char *host = NULL; gfarm_stringlist paths; gfs_glob_t types; if (argc > 0) program_name = basename(argv[0]); e = gfarm_initialize(&argc, &argv); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", program_name, gfarm_error_string(e)); exit(EXIT_FAILURE); } while ((c = getopt(argc, argv, "fh:?")) != -1) { switch (c) { case 'f': opt_force = 1; break; case 'h': host = optarg; break; case '?': default: usage(); } } argc -= optind; argv += optind; if (argc <= 0) usage(); e = gfarm_stringlist_init(&paths); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", program_name, gfarm_error_string(e)); exit(EXIT_FAILURE); } e = gfs_glob_init(&types); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", program_name, gfarm_error_string(e)); exit(EXIT_FAILURE); } for (i = 0; i < argc; i++) gfs_glob(argv[i], &paths, &types); gfs_glob_free(&types); n = gfarm_stringlist_length(&paths); for (i = 0; i < n; i++) { char *p = gfarm_stringlist_elem(&paths, i); if (host == NULL) e = gfs_unlink(p); else e = gfs_replica_remove_by_file(p, host); if (e != GFARM_ERR_NO_ERROR && (!opt_force || e != GFARM_ERR_NO_SUCH_FILE_OR_DIRECTORY)) { fprintf(stderr, "%s: %s: %s\n", program_name, p, gfarm_error_string(e)); status = 1; } } gfarm_stringlist_free_deeply(&paths); e = gfarm_terminate(); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", program_name, gfarm_error_string(e)); status = 1; } return (status); } gfarm-2.4.1/gftool/gfrm/gfrm.c0000644000000000000000000004122311507222717014642 0ustar rootroot/* * $Id: gfrm.c 3617 2007-03-12 08:32:55Z n-soda $ */ #include #include #include #include #include #include #ifdef _OPENMP #include #include #include #include #define LIBGFARM_NOT_MT_SAFE #else static void omp_set_num_threads(int n){ return; } #endif #include #include #include "host.h" #include "schedule.h" #include "gfs_client.h" #include "gfs_misc.h" #include "gfarm_list.h" #include "gfarm_foreach.h" #include "gfarm_xinfo.h" #include "hash.h" #define HOSTHASH_SIZE 101 static char *program_name = "gfrm"; struct gfrm_arg { char *domain; struct gfarm_hash_table *hosthash; int nhosts; char **hosts; char *section; int ncopy; int force; int noexecute; int verbose; }; struct files { gfarm_stringlist files, dirs; }; struct host_copy { struct gfrm_arg *a; struct gfarm_hash_table *hosthash; gfarm_list *slist; char *file; int nsrccopy; gfarm_stringlist copylist; }; static char * add_file(char *file, struct gfs_stat *st, void *arg) { struct files *a = arg; char *f; f = strdup(file); if (f == NULL) return (GFARM_ERR_NO_MEMORY); return (gfarm_stringlist_add(&a->files, f)); } static char * is_valid_dir(char *file, struct gfs_stat *st, void *arg) { const char *f = gfarm_url_prefix_skip(file); if (f[0] == '.' && (f[1] == '\0' || (f[1] == '.' && f[2] == '\0'))) return ("cannot remove \'.\' or \'..\'"); return (NULL); } static char * do_not_add_dir(char *file, struct gfs_stat *st, void *arg) { const char *f = gfarm_url_prefix_skip(file); char *e = GFARM_ERR_IS_A_DIRECTORY; fprintf(stderr, "%s: '%s' %s\n", program_name, f, e); /* return error always to prevent further traverse */ return (e); } static char * add_dir(char *file, struct gfs_stat *st, void *arg) { struct files *a = arg; char *f; f = strdup(file); if (f == NULL) return (GFARM_ERR_NO_MEMORY); return (gfarm_stringlist_add(&a->dirs, f)); } static char * gfarm_list_add_xinfo(char *file, int ncopy, char **copy, struct gfarm_file_section_info *info, gfarm_list *list) { struct gfarm_section_xinfo *i; char **newcopy, *e; GFARM_MALLOC(i); if (i == NULL) return (GFARM_ERR_NO_MEMORY); GFARM_MALLOC_ARRAY(newcopy, ncopy); if (newcopy == NULL) { e = GFARM_ERR_NO_MEMORY; goto free_i; } e = gfarm_fixedstrings_dup(ncopy, newcopy, copy); if (e != NULL) goto free_newcopy; i->file = strdup(file); i->ncopy = ncopy; i->copy = newcopy; i->i = *info; i->i.pathname = strdup(info->pathname); i->i.section = strdup(info->section); i->i.checksum_type = NULL; i->i.checksum = NULL; if (i->file == NULL || i->i.pathname == NULL || i->i.section == NULL) { gfarm_section_xinfo_free(i); return (GFARM_ERR_NO_MEMORY); } e = gfarm_list_add(list, i); if (e != NULL) gfarm_section_xinfo_free(i); return (e); free_newcopy: free(newcopy); free_i: free(i); return (e); } static char * gfarm_list_add_xinfo2(struct gfarm_section_xinfo *xinfo, gfarm_list *list) { return (gfarm_list_add_xinfo(xinfo->file, xinfo->ncopy, xinfo->copy, &xinfo->i, list)); } static char * add_host_and_copy(struct gfarm_file_section_copy_info *info, void *arg) { struct host_copy *a = arg; char *s = info->hostname; if ((a->a->hosthash && gfarm_hash_lookup( a->a->hosthash, s, strlen(s) + 1)) || (!a->a->hosthash && gfarm_host_is_in_domain(s, a->a->domain))) { /* add info->hostname to a->hash */ gfarm_hash_enter(a->hosthash, s, strlen(s) + 1, 0, NULL); gfarm_stringlist_add(&a->copylist, strdup(s)); } return (NULL); } static char * add_sec(struct gfarm_file_section_info *info, void *arg) { struct host_copy *a = arg; int ncopy; char **copy, *e; e = gfarm_stringlist_init(&a->copylist); if (e != NULL) return (e); e = gfarm_foreach_copy(add_host_and_copy, info->pathname, info->section, arg, NULL); /* if there is no replica in specified domain, do not add. */ if (e != NULL || gfarm_stringlist_length(&a->copylist) == 0) goto stringlist_free; /* add a file section */ ncopy = gfarm_stringlist_length(&a->copylist); copy = a->copylist.array; e = gfarm_list_add_xinfo(a->file, ncopy, copy, info, a->slist); stringlist_free: gfarm_stringlist_free_deeply(&a->copylist); return (e); } static char * do_section(char *(*op)(struct gfarm_file_section_info *, void *), const char *gfarm_file, const char *section, void *arg) { char *e; struct gfarm_file_section_info info; e = gfarm_file_section_info_get(gfarm_file, section, &info); if (e == NULL) { e = op(&info, arg); gfarm_file_section_info_free(&info); } return (e); } static char * gfarm_hash_to_string_array(struct gfarm_hash_table *hash, int *array_lengthp, char ***arrayp) { struct gfarm_hash_iterator iter; struct gfarm_hash_entry *entry; gfarm_stringlist ls; char *ent, **array, *e; e = gfarm_stringlist_init(&ls); if (e != NULL) return (e); for (gfarm_hash_iterator_begin(hash, &iter); !gfarm_hash_iterator_is_end(&iter); gfarm_hash_iterator_next(&iter)) { entry = gfarm_hash_iterator_access(&iter); if (entry != NULL) { ent = strdup(gfarm_hash_entry_key(entry)); if (ent == NULL) e = GFARM_ERR_NO_MEMORY; else e = gfarm_stringlist_add(&ls, ent); } if (e != NULL) goto stringlist_free; } array = gfarm_strings_alloc_from_stringlist(&ls); if (array == NULL) { e = GFARM_ERR_NO_MEMORY; goto stringlist_free; } *array_lengthp = gfarm_stringlist_length(&ls); *arrayp = array; stringlist_free: if (e == NULL) gfarm_stringlist_free(&ls); else gfarm_stringlist_free_deeply(&ls); return (e); } static char * create_host_and_file_section_list( gfarm_stringlist *list, struct gfrm_arg *gfrm_arg, int *nhosts, char ***hosts, int *nsinfop, struct gfarm_section_xinfo ***sinfop) { gfarm_list slist; struct gfarm_hash_table *hosthash; char *file, *path, *e; struct host_copy host_copy; int i; e = gfarm_list_init(&slist); if (e != NULL) return (e); hosthash = gfarm_hash_table_alloc(HOSTHASH_SIZE, gfarm_hash_casefold, gfarm_hash_key_equal_casefold); if (hosthash == NULL) { e = GFARM_ERR_NO_MEMORY; goto free_list; } host_copy.slist = &slist; host_copy.hosthash = hosthash; host_copy.a = gfrm_arg; for (i = 0; i < gfarm_stringlist_length(list); i++) { file = gfarm_stringlist_elem(list, i); e = gfarm_url_make_path(file, &path); if (e != NULL) goto free_hash; host_copy.file = file; if (gfrm_arg->section == NULL) e = gfarm_foreach_section( add_sec, path, &host_copy, NULL); else e = do_section( add_sec, path, gfrm_arg->section, &host_copy); free(path); if (e == GFARM_ERR_NO_FRAGMENT_INFORMATION || e == GFARM_ERR_NO_SUCH_OBJECT) e = gfs_unlink(file); if (e != NULL) goto free_hash; } *sinfop = gfarm_array_alloc_from_list(&slist); *nsinfop = gfarm_list_length(&slist); /* hash to array */ gfarm_hash_to_string_array(hosthash, nhosts, hosts); free_hash: gfarm_hash_table_free(hosthash); free_list: if (e == NULL) gfarm_list_free(&slist); else gfarm_list_free_deeply(&slist, (void (*)(void *))gfarm_section_xinfo_free); return (e); } static char * refine_copy(struct gfarm_section_xinfo *xinfo, struct gfarm_hash_table *hash) { gfarm_stringlist copylist; char *s, **copy, *e; int i; e = gfarm_stringlist_init(©list); if (e != NULL) return (e); for (i = 0; i < xinfo->ncopy; ++i) { s = xinfo->copy[i]; if (gfarm_hash_lookup(hash, s, strlen(s) + 1)) { e = gfarm_stringlist_add(©list, strdup(s)); if (e != NULL) goto free_copylist; } } gfarm_strings_free_deeply(xinfo->ncopy, xinfo->copy); copy = gfarm_strings_alloc_from_stringlist(©list); if (copy == NULL) { e = GFARM_ERR_NO_MEMORY; goto free_copylist; } xinfo->ncopy = gfarm_stringlist_length(©list); xinfo->copy = copy; free_copylist: if (e == NULL) gfarm_stringlist_free(©list); else gfarm_stringlist_free_deeply(©list); return (e); } static char * create_hash_table_from_string_list(int array_length, char **array, int hashsize, struct gfarm_hash_table **hashp) { struct gfarm_hash_table *hash; int i; hash = gfarm_hash_table_alloc(hashsize, gfarm_hash_casefold, gfarm_hash_key_equal_casefold); if (hash == NULL) return (GFARM_ERR_NO_MEMORY); for (i = 0; i < array_length; ++i) gfarm_hash_enter(hash, array[i], strlen(array[i])+1, 0, NULL); *hashp = hash; return (NULL); } static char * refine_file_section_list(int *nsinfop, struct gfarm_section_xinfo ***sinfop, struct gfrm_arg *arg) { int i, nsinfo = *nsinfop; struct gfarm_section_xinfo **sinfo = *sinfop; struct gfarm_hash_table *hosthash; gfarm_list slist; char *e; e = create_hash_table_from_string_list(arg->nhosts, arg->hosts, HOSTHASH_SIZE, &hosthash); if (e != NULL) return (e); e = gfarm_list_init(&slist); if (e != NULL) goto free_hosthash; /* * If number of file replicas stored on the specified set of * hosts is less than 'num_replica', do not add the file section. */ for (i = 0; i < nsinfo; gfarm_section_xinfo_free(sinfo[i++])) { e = refine_copy(sinfo[i], hosthash); if (e != NULL) goto free_list; if (sinfo[i]->ncopy <= arg->ncopy) continue; e = gfarm_list_add_xinfo2(sinfo[i], &slist); if (e != NULL) goto free_list; } free(sinfo); *sinfop = gfarm_array_alloc_from_list(&slist); *nsinfop = gfarm_list_length(&slist); free_list: if (e == NULL) gfarm_list_free(&slist); else gfarm_list_free_deeply(&slist, (void (*)(void *))gfarm_section_xinfo_free); free_hosthash: gfarm_hash_table_free(hosthash); return (e); } static void print_gfrm_arg(struct gfrm_arg *arg) { int i; printf("nhosts = %d\n", arg->nhosts); for (i = 0; i < arg->nhosts; ++i) printf("%s\n", arg->hosts[i]); if (arg->section != NULL) printf("section = %s\n", arg->section); printf("ncopy = %d\n", arg->ncopy); printf("force : %d\n", arg->force); printf("noexecute: %d\n", arg->noexecute); printf("verbose : %d\n", arg->verbose); } static char * remove_files(int nsinfo, struct gfarm_section_xinfo **sinfo, gfarm_stringlist *dirs, int nthreads, struct gfrm_arg *arg) { int i, nerr = 0; char *e = NULL; int nhosts = arg->nhosts; if (nhosts <= 0) return "no host"; if (arg->ncopy < 0) arg->ncopy = 0; if (nsinfo + gfarm_stringlist_length(dirs) <= 0) return (NULL); /* no file */ if (nthreads <= 0) { nthreads = nsinfo; if (nhosts < nthreads) nthreads = nhosts; } if (arg->verbose) { print_gfrm_arg(arg); printf("files: %d\n", nsinfo); #ifdef _OPENMP printf("parallel remove using %d streams\n", nthreads); #endif } omp_set_num_threads(nthreads); #ifdef LIBGFARM_NOT_MT_SAFE /* * XXX - libgfarm is not thread-safe... * purge the connection cache for gfsd since the connection to * gfsd cannot be shared among child processes. */ gfs_client_terminate(); #endif #pragma omp parallel for schedule(dynamic) reduction(+:nerr) for (i = 0; i < nsinfo; ++i) { struct gfarm_section_xinfo *si = sinfo[i]; #ifdef LIBGFARM_NOT_MT_SAFE pid_t pid; int s, rv; pid = fork(); if (pid == 0) { #endif if (arg->verbose || arg->noexecute) { si->ncopy -= arg->ncopy; gfarm_section_xinfo_print(si); si->ncopy += arg->ncopy; e = NULL; } if (!arg->noexecute) e = gfs_unlink_section_replica(si->file, si->i.section, si->ncopy - arg->ncopy, si->copy, arg->force); if (e != NULL) { #ifndef LIBGFARM_NOT_MT_SAFE ++nerr; #endif fprintf(stderr, "%s (%s): %s\n", si->file, si->i.section, e); } #ifdef LIBGFARM_NOT_MT_SAFE _exit(e == NULL ? 0 : 1); } while ((rv = waitpid(pid, &s, 0)) == -1 && errno == EINTR); if (rv == -1 || (WIFEXITED(s) && WEXITSTATUS(s) != 0)) ++nerr; #endif } for (i = 0; i < gfarm_stringlist_length(dirs); ++i) { char *dir = gfarm_stringlist_elem(dirs, i); if (!arg->noexecute) e = gfs_rmdir(dir); else { printf("%s\n", dir); e = NULL; } if (arg->force && e != NULL) { ++nerr; fprintf(stderr, "%s: %s\n", dir, e); } } return (nerr == 0 ? NULL : "error happens during removal"); } static int usage() { fprintf(stderr, "Usage: %s [-frRnqv] [-I
] [-h ]" " [-D ]\n", program_name); fprintf(stderr, "\t[-H ] [-N <#replica>]"); #ifdef _OPENMP fprintf(stderr, " [-j <#thread>]"); #endif fprintf(stderr, " ...\n"); exit(EXIT_FAILURE); } static int error_check(char *e) { if (e == NULL) return (0); fprintf(stderr, "%s: %s\n", program_name, e); exit(EXIT_FAILURE); } static void conflict_check(int *mode_ch_p, int ch) { if (*mode_ch_p) { fprintf(stderr, "%s: -%c option conflicts with -%c\n", program_name, ch, *mode_ch_p); usage(); } *mode_ch_p = ch; } static char * create_hostlist(char *hostfile, int *nhosts, char ***hosts) { int error_line = -1; char *e; e = gfarm_hostlist_read(hostfile, nhosts, hosts, &error_line); if (e != NULL) { if (error_line != -1) fprintf(stderr, "%s: line %d: %s\n", hostfile, error_line, e); else fprintf(stderr, "%s: %s\n", hostfile, e); exit(EXIT_FAILURE); } return (e); } int main(int argc, char *argv[]) { char *domain = "", *hostfile = NULL, *section = NULL; struct gfarm_hash_table *hosthash = NULL; gfarm_stringlist paths; gfs_glob_t types; int mode_ch = 0, num_replicas = 0, parallel = -1, recursive = 0; int force = 0, noexecute = 0, quiet = 0, verbose = 0; int i, nhosts, nsinfo; char **hosts, ch, *e; struct gfrm_arg gfrm_arg; struct files files; struct gfarm_section_xinfo **sinfo; char *(*op_dir_before)(char *, struct gfs_stat *, void *); #ifdef __GNUC__ /* workaround gcc warning: may be used uninitialized */ nsinfo = 0; sinfo = NULL; #endif if (argc >= 1) program_name = basename(argv[0]); e = gfarm_initialize(&argc, &argv); error_check(e); #ifdef _OPENMP while ((ch = getopt(argc, argv, "a:fh:j:nqrvD:H:I:N:R?")) != -1) { #else while ((ch = getopt(argc, argv, "a:fh:nqrvD:H:I:N:R?")) != -1) { #endif switch (ch) { case 'a': case 'I': section = optarg; break; case 'f': force = 1; break; #ifdef _OPENMP case 'j': parallel = strtol(optarg, NULL, 0); break; #endif case 'n': noexecute = 1; break; case 'q': quiet = 1; break; case 'r': case 'R': recursive = 1; break; case 'v': verbose = 1; break; case 'h': case 'D': domain = optarg; conflict_check(&mode_ch, ch); break; case 'H': hostfile = optarg; conflict_check(&mode_ch, ch); break; case 'N': num_replicas = strtol(optarg, NULL, 0); break; case '?': default: usage(); } } argc -= optind; argv += optind; e = gfarm_stringlist_init(&paths); if (e == NULL) { e = gfs_glob_init(&types); if (e == NULL) { for (i = 0; i < argc; i++) gfs_glob(argv[i], &paths, &types); gfs_glob_free(&types); } } error_check(e); if (recursive) op_dir_before = is_valid_dir; else op_dir_before = do_not_add_dir; e = gfarm_stringlist_init(&files.files); error_check(e); e = gfarm_stringlist_init(&files.dirs); error_check(e); for (i = 0; i < gfarm_stringlist_length(&paths); i++) { char *file = gfarm_stringlist_elem(&paths, i); e = gfarm_foreach_directory_hierarchy( add_file, op_dir_before, add_dir, file, &files); /* * GFARM_ERR_IS_A_DIRECTORY may be returned to prevent * further traverse. */ if (e != NULL && e != GFARM_ERR_IS_A_DIRECTORY) fprintf(stderr, "%s: %s\n", file, e); } gfarm_stringlist_free_deeply(&paths); if (gfarm_stringlist_length(&files.files) + gfarm_stringlist_length(&files.dirs) <= 0) exit(0); /* no file */ if (!quiet) { printf("investigating hosts..."); fflush(stdout); } if (hostfile != NULL) { e = create_hostlist(hostfile, &nhosts, &hosts); error_check(e); e = create_hash_table_from_string_list(nhosts, hosts, HOSTHASH_SIZE, &hosthash); error_check(e); gfarm_strings_free_deeply(nhosts, hosts); } gfrm_arg.domain = domain; gfrm_arg.hosthash = hosthash; gfrm_arg.section = section; e = create_host_and_file_section_list(&files.files, &gfrm_arg, &nhosts, &hosts, &nsinfo, &sinfo); gfarm_stringlist_free_deeply(&files.files); if (hosthash != NULL) gfarm_hash_table_free(hosthash); if (e == NULL) e = gfarm_schedule_search_idle_acyclic_hosts( nhosts, hosts, &nhosts, hosts); error_check(e); gfrm_arg.nhosts = nhosts; gfrm_arg.hosts = hosts; gfrm_arg.ncopy = num_replicas; e = refine_file_section_list(&nsinfo, &sinfo, &gfrm_arg); error_check(e); if (!quiet) printf(" done\n"); gfrm_arg.force = force || (domain[0] == '\0' && hostfile == NULL && num_replicas == 0); gfrm_arg.noexecute = noexecute; gfrm_arg.verbose = verbose; e = remove_files(nsinfo, sinfo, &files.dirs, parallel, &gfrm_arg); error_check(e); gfarm_array_free_deeply(nsinfo, sinfo, (void (*)(void *))gfarm_section_xinfo_free); gfarm_strings_free_deeply(nhosts, hosts); gfarm_stringlist_free_deeply(&files.dirs); e = gfarm_terminate(); error_check(e); return (0); } gfarm-2.4.1/gftool/gfrm/Makefile0000644000000000000000000000117411507222717015204 0ustar rootroot# $Id: Makefile 3647 2007-03-12 09:15:25Z n-soda $ top_builddir = ../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk SRCS = gfrm_simple.c OBJS = gfrm_simple.o PROGRAM = gfrm #CC = omcc #OMPFLAGS = -fopenmp CFLAGS = $(OMPFLAGS) $(COMMON_CFLAGS) -I$(GFUTIL_SRCDIR) -I$(GFARMLIB_SRCDIR) $(openssl_includes) LDLIBS = $(COMMON_LDFLAGS) $(GFARMLIB) $(LIBS) DEPLIBS = $(DEPGFARMLIB) all: $(PROGRAM) include $(top_srcdir)/makes/prog.mk ### $(OBJS): $(DEPGFARMINC) $(GFARMLIB_SRCDIR)/host.h $(GFARMLIB_SRCDIR)/schedule.h $(GFARMLIB_SRCDIR)/gfs_client.h $(GFARMLIB_SRCDIR)/gfs_misc.h $(GFUTIL_SRCDIR)/hash.h gfarm-2.4.1/gftool/gfchown/0000755000000000000000000000000011507222730014234 5ustar rootrootgfarm-2.4.1/gftool/gfchown/gfchown.c0000644000000000000000000000377711507222717016056 0ustar rootroot/* * $Id: gfchown.c 4097 2009-03-18 15:01:13Z tatebe $ */ #include #include #include #include #include #include char *program_name = "gfchown"; int opt_chgrp = 0; static void usage(void) { if (!opt_chgrp) { fprintf(stderr, "Usage: %s [:] ...\n", program_name); fprintf(stderr, " %s : ...\n", program_name); } else { fprintf(stderr, "Usage: %s ...\n", program_name); } exit(1); } int main(int argc, char **argv) { gfarm_error_t e; int c, i, status = 0; char *s, *user = NULL, *group = NULL; extern int optind; if (argc > 0) program_name = basename(argv[0]); if (strcasecmp(program_name, "gfchgrp") == 0) opt_chgrp = 1; e = gfarm_initialize(&argc, &argv); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", program_name, gfarm_error_string(e)); exit(1); } while ((c = getopt(argc, argv, "h?")) != -1) { switch (c) { case 'h': case '?': default: usage(); } } argc -= optind; argv += optind; if (argc <= 1) usage(); if (!opt_chgrp) { if (argv[0][0] == ':') { group = &argv[0][1]; } else if ((s = strchr(argv[0], ':')) != NULL) { *s = '\0'; user = argv[0]; group = s + 1; } else { user = argv[0]; } } else { group = argv[0]; } for (i = 1; i < argc; i++) { e = gfs_chown(argv[i], user, group); switch (e) { case GFARM_ERR_NO_ERROR: break; case GFARM_ERR_NO_SUCH_FILE_OR_DIRECTORY: fprintf(stderr, "%s: %s: %s\n", program_name, argv[i], gfarm_error_string(e)); status = 1; break; default: fprintf(stderr, "%s: %s%s%s: %s\n", program_name, user != NULL ? user : "", user != NULL && group != NULL ? ":" : "", group != NULL ? group : "", gfarm_error_string(e)); status = 1; break; } } e = gfarm_terminate(); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", program_name, gfarm_error_string(e)); status = 1; } return (status); } gfarm-2.4.1/gftool/gfchown/Makefile0000644000000000000000000000102511507222717015677 0ustar rootroot# $Id: Makefile 2637 2006-05-29 22:35:42Z soda $ top_builddir = ../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk PROGRAM = gfchown PROGRAM2 = gfchgrp SRCS = $(PROGRAM).c OBJS = $(PROGRAM).o CFLAGS = $(COMMON_CFLAGS) LDLIBS = $(COMMON_LDLIBS) $(GFARMLIB) $(LIBS) DEPLIBS = $(DEPGFARMLIB) all: $(PROGRAM) post-install-hook: -rm -f $(DESTDIR)$(bindir)/$(PROGRAM2) ln $(DESTDIR)$(bindir)/$(PROGRAM) $(DESTDIR)$(bindir)/$(PROGRAM2) include $(top_srcdir)/makes/prog.mk ### $(OBJS): $(DEPGFARMINC) gfarm-2.4.1/gftool/gfln/0000755000000000000000000000000011507222730013527 5ustar rootrootgfarm-2.4.1/gftool/gfln/gfln.c0000644000000000000000000000235111507222717014627 0ustar rootroot/* * $Id: gfmv.c 2640 2006-05-29 22:38:29Z soda $ */ #include #include #include #include #include char *program_name = "gfln"; static void usage(void) { fprintf(stderr, "Usage: %s [-s] target link_name\n", program_name); exit(1); } int main(int argc, char **argv) { gfarm_error_t e; int c, status = 0; int opt_symlink = 0; extern int optind; if (argc > 0) program_name = basename(argv[0]); e = gfarm_initialize(&argc, &argv); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", program_name, gfarm_error_string(e)); exit(1); } while ((c = getopt(argc, argv, "sh?")) != -1) { switch (c) { case 's': opt_symlink = 1; break; case 'h': case '?': default: usage(); } } argc -= optind; argv += optind; if (argc != 2) usage(); e = (opt_symlink ? gfs_symlink : gfs_link)(argv[0], argv[1]); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s%s %s %s: %s\n", program_name, opt_symlink ? " -s" : "", argv[0], argv[1], gfarm_error_string(e)); status = 1; } e = gfarm_terminate(); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", program_name, gfarm_error_string(e)); status = 1; } return (status); } gfarm-2.4.1/gftool/gfln/Makefile0000644000000000000000000000060011507222717015170 0ustar rootroot# $Id: Makefile 2612 2006-05-29 04:24:37Z soda $ top_builddir = ../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk PROGRAM = gfln SRCS = $(PROGRAM).c OBJS = $(PROGRAM).o CFLAGS = $(COMMON_CFLAGS) LDLIBS = $(COMMON_LDLIBS) $(GFARMLIB) $(LIBS) DEPLIBS = $(DEPGFARMLIB) all: $(PROGRAM) include $(top_srcdir)/makes/prog.mk ### $(OBJS): $(DEPGFARMINC) gfarm-2.4.1/gftool/gfwhoami/0000755000000000000000000000000011507222730014402 5ustar rootrootgfarm-2.4.1/gftool/gfwhoami/Makefile0000644000000000000000000000065511507222717016055 0ustar rootroot# $Id: Makefile 2373 2006-01-12 00:54:22Z soda $ top_builddir = ../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk PROGRAM = gfwhoami SRCS = $(PROGRAM).c OBJS = $(PROGRAM).o CFLAGS = $(COMMON_CFLAGS) -I$(GFARMLIB_SRCDIR) $(openssl_includes) LDLIBS = $(COMMON_LDLIBS) $(GFARMLIB) $(LIBS) DEPLIBS = $(DEPGFARMLIB) all: $(PROGRAM) include $(top_srcdir)/makes/prog.mk ### $(OBJS): $(DEPGFARMINC) gfarm-2.4.1/gftool/gfwhoami/gfwhoami.c0000644000000000000000000000247511507222717016364 0ustar rootroot/* * $Id: gfwhoami.c 3960 2008-05-10 14:33:48Z tatebe $ */ #include #include #include #include #include #ifdef HAVE_GSI #include "auth.h" #endif char *program_name = "gfwhoami"; #ifdef HAVE_GSI #define GFWHOAMI_OPTIONS "hv" #else #define GFWHOAMI_OPTIONS "h" #endif void usage(void) { fprintf(stderr, "Usage: %s [-" GFWHOAMI_OPTIONS "]\n", program_name); exit(EXIT_FAILURE); } int main(int argc, char **argv) { gfarm_error_t e; int c; #ifdef HAVE_GSI int verbose_flag = 0; #endif if (argc > 0) program_name = basename(argv[0]); e = gfarm_initialize(&argc, &argv); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: gfarm_initialize: %s\n", program_name, gfarm_error_string(e)); exit(EXIT_FAILURE); } while ((c = getopt(argc, argv, GFWHOAMI_OPTIONS)) != -1) { switch (c) { #ifdef HAVE_GSI case 'v': verbose_flag = 1; break; #endif case 'h': default: usage(); } } if (argc - optind > 0) usage(); printf("%s", gfarm_get_global_username()); #ifdef HAVE_GSI if (verbose_flag) printf(" %s", gfarm_gsi_client_cred_name()); #endif printf("\n"); e = gfarm_terminate(); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: gfarm_terminate: %s\n", program_name, gfarm_error_string(e)); exit(EXIT_FAILURE); } return (0); } gfarm-2.4.1/gftool/gfexec/0000755000000000000000000000000011507222730014042 5ustar rootrootgfarm-2.4.1/gftool/gfexec/Makefile0000644000000000000000000000073111507222717015510 0ustar rootroot# $Id: Makefile 3617 2007-03-12 08:32:55Z n-soda $ top_builddir = ../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk PROGRAM = gfexec SRCS = $(PROGRAM).c OBJS = $(PROGRAM).o CFLAGS = $(COMMON_CFLAGS) -I$(GFARMLIB_SRCDIR) $(openssl_includes) LDLIBS = $(COMMON_LDLIBS) $(GFARMLIB) $(openssl_libs) $(LIBS) DEPLIBS = $(DEPGFARMLIB) all: $(PROGRAM) include $(top_srcdir)/makes/prog.mk ### $(OBJS): $(DEPGFARMINC) $(GFARMLIB_SRCDIR)/config.h gfarm-2.4.1/gftool/gfexec/gfexec.c0000644000000000000000000003415011507222717015457 0ustar rootroot/* * $Id: gfexec.c 3617 2007-03-12 08:32:55Z n-soda $ */ #include #include #include #include #include #include #include #include #include #include #include #include "config.h" /* gfs_profile, ... */ #if !defined(WCOREDUMP) && defined(_AIX) #define WCOREDUMP(status) ((status) & 0x80) #endif #define PROGRAM_NAME "gfexec" static char progname[] = PROGRAM_NAME; #define BOURNE_SHELL "/bin/sh" static void print_usage() { fprintf(stderr, "usage: %s [-N ] [-I ] [-s] " " ...\n", progname); exit(2); } char * search_path(char *command) { int command_len, dir_len; char *result, *path; struct stat st; char buf[PATH_MAX]; if (strchr(command, '/') != NULL) { /* absolute or relative path */ result = command; goto finish; } command_len = strlen(command); path = getenv("PATH"); if (path == NULL) path = "/bin:/usr/bin:/usr/ucb:/usr/local/bin"; do { dir_len = strcspn(path, ":"); if (dir_len == 0) { if (command_len + 1 > sizeof(buf)) { fprintf(stderr, "%s: %s: path too long\n", progname, command); exit(1); } result = command; } else { if (dir_len + command_len + 2 > sizeof(buf)) { fprintf(stderr, "%s: %s: path too long (%s)\n", progname, command, path); exit(1); } memcpy(buf, path, dir_len); buf[dir_len] = '/'; strcpy(buf + dir_len + 1, command); result = buf; } if (access(result, X_OK) == 0 && stat(result, &st) == 0 && (st.st_mode & S_IFMT) == S_IFREG) goto finish; path += dir_len; } while (*path++ == ':'); /* not found in $PATH */ result = command; finish: result = strdup(result); if (result == NULL) { fprintf(stderr, "%s: no memory\n", progname); exit(1); } return (result); } /* * Shared objects in gfarm file system cannot be dynamically linked * because _dl_*() defined in /lib/ld-linux cannot be hooked. * So, we replicate shared objects to local machine and rewrite paths in * LD_LIBRARY_PATH to local spool directory path, for example, * /gfarm/lib -> /var/spool/gfarm/lib. */ /* XXX - the following two static functions are defined in hooks_subr.c. */ static char gfs_mntdir[] = "/gfarm"; static int is_null_or_slash(const char c) { return (c == '\0' || c == '/' || c == ':'); } static int is_mount_point(const char *path) { return (*path == '/' && memcmp(path, gfs_mntdir, sizeof(gfs_mntdir) - 1) == 0 && is_null_or_slash(path[sizeof(gfs_mntdir) - 1])); } static char * gfarm_url_localize(char *url, char **local_path) { char *e, *canonic_path; *local_path = NULL; e = gfarm_url_make_path(url, &canonic_path); if (e != NULL) return (e); e = gfarm_path_localize(canonic_path, local_path); free(canonic_path); return (e); } /* convert to the canonical path */ static char * gfs_mntpath_canonicalize(char *dir, size_t size, char **canonic_path) { char *e, *gfarm_file; *canonic_path = NULL; dir += sizeof(gfs_mntdir) - 1; size -= sizeof(gfs_mntdir) - 1; /* in '/gfarm/~' case, skip the first '/' */ if (dir[0] == '/' && dir[1] == '~') { ++dir; --size; } /* * in '/gfarm' case, just convert to '\0'. * ':' is a separator of the environment variable. */ else if (dir[0] == '\0' || dir[0] == ':') { *canonic_path = strdup(""); if (*canonic_path == NULL) return (GFARM_ERR_NO_MEMORY); return (NULL); } GFARM_MALLOC_ARRAY(gfarm_file, size + 1); if (gfarm_file == NULL) return (GFARM_ERR_NO_MEMORY); sprintf(gfarm_file, "%.*s", (int)size, dir); e = gfarm_canonical_path(gfarm_file, canonic_path); free(gfarm_file); return (e); } static char * gfs_mntpath_localize(char *dir, size_t size, char **local_path) { char *e, *canonic_path; *local_path = NULL; e = gfs_mntpath_canonicalize(dir, size, &canonic_path); if (e != NULL) return (e); e = gfarm_path_localize(canonic_path, local_path); free(canonic_path); return (e); } static char * gfs_mntpath_to_url(char *path, size_t size, char **url) { char *e, *canonic_path; *url = NULL; e = gfs_mntpath_canonicalize(path, size, &canonic_path); if (e != NULL) return (e); e = gfarm_path_canonical_to_url(canonic_path, url); free(canonic_path); return (e); } static char * replicate_so_and_symlink(char *dir, size_t size) { char *gfarm_url, *so_pat, *lpath; char *e, *e_save; int i, rv; gfarm_stringlist paths; gfs_glob_t types; static char so_pat_template[] = "/*.so*"; e = gfs_mntpath_to_url(dir, size, &gfarm_url); if (e != NULL) return (e); GFARM_MALLOC_ARRAY(so_pat, strlen(gfarm_url) + sizeof(so_pat_template)); if (so_pat == NULL) { free(gfarm_url); return (GFARM_ERR_NO_MEMORY); } sprintf(so_pat, "%s%s", gfarm_url, so_pat_template); free(gfarm_url); e_save = gfarm_stringlist_init(&paths); if (e_save != NULL) goto free_so_pat; e_save = gfs_glob_init(&types); if (e_save != NULL) goto free_paths; e_save = gfs_glob(so_pat, &paths, &types); if (e_save != NULL) goto free_types; /* XXX - should replicate so files in parallel */ for (i = 0; i < gfarm_stringlist_length(&paths); i++) { char *gfarm_so, *local_so; gfarm_so = gfarm_stringlist_elem(&paths, i); if (strcmp(gfarm_so, so_pat) == 0) /* no "*.so*" file in dir */ break; e = gfarm_url_execfile_replicate_to_local(gfarm_so, &lpath); if (e != NULL) { fprintf(stderr, "%s: %s\n", gfarm_so, e); if (e_save == NULL) e_save = e; if (e == GFARM_ERR_NO_MEMORY) break; continue; } /* create a symlink */ e = gfarm_url_localize(gfarm_so, &local_so); if (e != NULL) { fprintf(stderr, "%s: %s\n", gfarm_so, e); if (e_save == NULL) e_save = e; if (e == GFARM_ERR_NO_MEMORY) break; free(lpath); continue; } unlink(local_so); rv = symlink(lpath, local_so); if (rv == -1) { perror(local_so); if (e_save == NULL) e_save = gfarm_errno_to_error(errno); } free(local_so); free(lpath); } free_types: gfs_glob_free(&types); free_paths: gfarm_stringlist_free_deeply(&paths); free_so_pat: free(so_pat); return (e_save); } static char * alloc_ldpath(size_t size) { static char *ldpath = NULL; static int ldpath_len = 0; if (ldpath_len < size) { char *p; GFARM_REALLOC_ARRAY(p, ldpath, size); if (p == NULL) return (NULL); ldpath = p; ldpath_len = size; } return (ldpath); } static char * modify_ld_library_path(void) { char *e, *e_save = NULL, *ldpath, *nldpath; static char env_ldlibpath[] = "LD_LIBRARY_PATH"; size_t len, dirlen; int rv; ldpath = getenv(env_ldlibpath); if (ldpath == NULL) return (NULL); len = sizeof(env_ldlibpath) + 1; nldpath = alloc_ldpath(1024); /* specify bigger size than len */ if (nldpath == NULL) return (GFARM_ERR_NO_MEMORY); sprintf(nldpath, "%s=", env_ldlibpath); while (*ldpath != '\0') { char *local_dir; int is_valid_local_dir = 0; dirlen = strcspn(ldpath, ":"); if (is_mount_point(ldpath)) { e = gfs_mntpath_localize(ldpath, dirlen, &local_dir); if (e != NULL) { if (e != GFARM_ERR_NO_SUCH_OBJECT) { if (e_save == NULL) e_save = e; } goto skip_copying; } e = replicate_so_and_symlink(ldpath, dirlen); if (e != NULL) if (e_save == NULL) e_save = e; len += strlen(local_dir); is_valid_local_dir = 1; } else len += dirlen; nldpath = alloc_ldpath(len); if (nldpath == NULL) { if (is_valid_local_dir) free(local_dir); return (GFARM_ERR_NO_MEMORY); } if (is_valid_local_dir) { strcat(nldpath, local_dir); free(local_dir); } else strncat(nldpath, ldpath, dirlen); skip_copying: ldpath += dirlen; if (*ldpath) { ++len; nldpath = alloc_ldpath(len); if (nldpath == NULL) return (GFARM_ERR_NO_MEMORY); strncat(nldpath, ldpath, 1); ++ldpath; } } rv = putenv(nldpath); if (rv == -1) return (gfarm_errno_to_error(errno)); return (e_save); } static void errmsg(char *func, char *msg) { fprintf(stderr, "%s (%s): %s: %s\n", gfarm_host_get_self_name(), progname, func, msg); } int main(int argc, char *argv[], char *envp[]) { char *e, *gfarm_url, *local_path, **new_env, *cwd_env, *pwd_env; char *path; int i, j, status, envc, rank = -1, nodes = -1; pid_t pid; static const char env_node_rank[] = "GFARM_NODE_RANK="; static const char env_node_size[] = "GFARM_NODE_SIZE="; static const char env_flags[] = "GFARM_FLAGS="; static const char env_gfs_pwd[] = "GFS_PWD="; static const char env_pwd[] = "PWD="; char rankbuf[sizeof(env_node_rank) + GFARM_INT64STRLEN]; char nodesbuf[sizeof(env_node_size) + GFARM_INT64STRLEN]; char flagsbuf[sizeof(env_flags) + 3]; char cwdbuf[PATH_MAX * 2], pwdbuf[PATH_MAX * 2]; e = gfarm_initialize(&argc, &argv); if (e != NULL) { errmsg("gfarm_initialize", e); exit(1); } /* * don't use getopt(3) here, because getopt(3) in glibc refers * argv[] passed to main(), instead of argv[] passed to getopt(3). */ for (i = 1; i < argc; i++) { if (argv[i][0] != '-') break; for (j = 1; argv[i][j] != '\0'; j++) { switch (argv[i][j]) { case 'I': if (argv[i][j + 1] != '\0') { rank = strtol(&argv[i][j+1], NULL, 0); j += strlen(&argv[i][j + 1]); } else if (i + 1 < argc) { rank = strtol(argv[++i], NULL, 0); j = strlen(argv[i]) - 1; } else { errmsg("-I", "missing argument"); print_usage(); } break; case 'N': if (argv[i][j + 1] != '\0') { nodes = strtol(&argv[i][j+1], NULL, 0); j += strlen(&argv[i][j + 1]); } else if (i + 1 < argc) { nodes = strtol(argv[++i], NULL, 0); j = strlen(argv[i]) - 1; } else { errmsg("-N", "missing argument"); print_usage(); } break; case 's': rank = 0; nodes = 1; break; case 'h': case '?': print_usage(); default: fprintf(stderr, "%s: invalid option -- %c\n", progname, argv[i][j]); print_usage(); } } } argc -= i; argv += i; if (argc == 0) print_usage(); path = argv[0]; if (is_mount_point(path)) e = gfs_mntpath_to_url(path, strlen(path), &gfarm_url); else e = gfs_realpath(path, &gfarm_url); if (e == NULL) { e = gfarm_url_program_get_local_path(gfarm_url, &local_path); if (e != NULL) { errmsg(gfarm_url, e); exit(1); } free(gfarm_url); } else { struct stat sb; local_path = search_path(path); if (stat(local_path, &sb)) { errmsg(local_path, strerror(errno)); exit(1); } } e = modify_ld_library_path(); if (e != NULL) { errmsg("modify_ld_library_path", e); /* continue */ } /* * the followings are only needed for pid==0 case. * but isn't it better to check errors before fork(2)? * * If gfs_pio_get_node_{rank,size}() fails, continue to * execute as a single process (not parallel processes). */ if (rank == -1) { e = gfs_pio_get_node_rank(&rank); if (e != NULL) rank = 0; } if (nodes == -1) { e = gfs_pio_get_node_size(&nodes); if (e != NULL) nodes = 1; } for (envc = 0; envp[envc] != NULL; envc++) ; GFARM_MALLOC_ARRAY(new_env, envc + 5 + 1); memcpy(cwdbuf, GFARM_URL_PREFIX, GFARM_URL_PREFIX_LENGTH); e = gfs_getcwd(cwdbuf + GFARM_URL_PREFIX_LENGTH, sizeof(cwdbuf) - GFARM_URL_PREFIX_LENGTH); if (e != NULL) { errmsg("cannot get current directory", e); exit(1); } GFARM_MALLOC_ARRAY(cwd_env, strlen(cwdbuf) + sizeof(env_gfs_pwd)); if (cwd_env == NULL) { fprintf(stderr, "%s: no memory for %s%s\n", progname, env_gfs_pwd, cwdbuf); exit(1); } (void)chdir(cwdbuf); /* rely on syscall hook. it is ok if it fails */ getcwd(pwdbuf, sizeof pwdbuf); GFARM_MALLOC_ARRAY(pwd_env, strlen(pwdbuf) + sizeof(env_pwd)); if (pwd_env == NULL) { fprintf(stderr, "%s: no memory for %s%s\n", progname, env_pwd, pwdbuf); exit(1); } envc = 0; for (i = 0; (e = envp[i]) != NULL; i++) { if (memcmp(e, env_node_rank, sizeof(env_node_rank) -1 ) != 0 && memcmp(e, env_node_size, sizeof(env_node_size) -1 ) != 0 && memcmp(e, env_flags, sizeof(env_flags) - 1 ) != 0 && memcmp(e, env_gfs_pwd, sizeof(env_gfs_pwd) - 1) != 0 && memcmp(e, env_pwd, sizeof(env_pwd) - 1 ) != 0) new_env[envc++] = e; } sprintf(rankbuf, "%s%d", env_node_rank, rank); new_env[envc++] = rankbuf; sprintf(nodesbuf, "%s%d", env_node_size, nodes); new_env[envc++] = nodesbuf; sprintf(flagsbuf, "%s%s%s%s", env_flags, gf_profile ? "p" : "", gf_on_demand_replication ? "r" : "", gf_hook_default_global ? "g" : ""); new_env[envc++] = flagsbuf; sprintf(cwd_env, "%s%s", env_gfs_pwd, cwdbuf); new_env[envc++] = cwd_env; sprintf(pwd_env, "%s%s", env_pwd, pwdbuf); new_env[envc++] = pwd_env; new_env[envc++] = NULL; if (gf_stdout == NULL && gf_stderr == NULL) { /* what we need is to call exec(2) */ pid = 0; } else { /* * we have to call fork(2) and exec(2), to close * gf_stdout and gf_stderr by calling gfarm_terminate() * after the child program finished. */ pid = fork(); } switch (pid) { case -1: perror(PROGRAM_NAME ": fork"); status = 255; break; case 0: if (gf_stdout == NULL && gf_stderr == NULL) { /* * not to display profile statistics * on gfarm_terminate() */ gfs_profile(gf_profile = 0); e = gfarm_terminate(); if (e != NULL) errmsg("(child) gfarm_terminate", e); } else { /* * otherwise don't call gfarm_terminate(), because: * - it closes gf_stdout and gf_stderr. * - it causes: * "gfarm_terminate: Can't contact LDAP server" * on the parent process. */ } execve(local_path, argv, new_env); if (errno != ENOEXEC) { perror(local_path); } else { /* * argv[-1] must be available, * because there should be "gfexec" at least. */ argv[-1] = BOURNE_SHELL; argv[0] = local_path; execve(BOURNE_SHELL, argv - 1, new_env); } _exit(255); default: if (waitpid(pid, &status, 0) == -1) { perror(PROGRAM_NAME ": waitpid"); status = 255; } else if (WIFSIGNALED(status)) { fprintf(stderr, "%s: signal %d received%s.\n", gfarm_host_get_self_name(), WTERMSIG(status), WCOREDUMP(status) ? " (core dumped)" : ""); status = 255; } else { status = WEXITSTATUS(status); } break; } /* not to display profile statistics on gfarm_terminate() */ gfs_profile(gf_profile = 0); e = gfarm_terminate(); if (e != NULL) { errmsg("gfarm_terminate", e); exit(1); } exit(status); } gfarm-2.4.1/gftool/gfusage/0000755000000000000000000000000011507222730014222 5ustar rootrootgfarm-2.4.1/gftool/gfusage/gfusage.c0000644000000000000000000001251511507222717016020 0ustar rootroot/* * $Id: gfusage.c 4474 2010-03-01 06:04:24Z takuya-i $ */ #include #include #include #include #include #include "config.h" #include "gfm_client.h" #include "lookup.h" #include "quota_info.h" char *program_name = "gfusage"; struct gfm_connection *gfm_server; static void usage(void) { fprintf(stderr, "Usage:\t%s [-P ] [-g] [name]\n", program_name); exit(1); } static const char head_user[] = " UserName"; static const char head_group[] = "GroupName"; static const char head_space[] = "FileSpace"; static const char head_num[] = "FileNum"; static const char head_phy_space[] = "PhysicalSpace"; static const char head_phy_num[] = "PhysicalNum"; static const char header_format[] = "# %s : %15s %11s %15s %11s\n"; static gfarm_error_t print_usage_common(const char *name, int opt_group) { struct gfarm_quota_get_info qi; gfarm_error_t e; if (opt_group) e = gfm_client_quota_group_get(gfm_server, name, &qi); else e = gfm_client_quota_user_get(gfm_server, name, &qi); if (e == GFARM_ERR_OPERATION_NOT_PERMITTED) /* not report here */ return (e); else if (e == GFARM_ERR_NO_SUCH_OBJECT) { /* not enabled */ fprintf(stderr, "%s : quota is not enabled.\n", name); return (e); } else if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s : %s\n", program_name, name, gfarm_error_string(e)); return (e); } else { printf("%12s :" " %15"GFARM_PRId64" %11"GFARM_PRId64 " %15"GFARM_PRId64" %11"GFARM_PRId64"\n" , name, qi.space, qi.num, qi.phy_space, qi.phy_num); gfarm_quota_get_info_free(&qi); return (GFARM_ERR_NO_ERROR); } } static void print_header_user() { printf(header_format, head_user, head_space, head_num, head_phy_space, head_phy_num); } static void print_header_group() { printf(header_format, head_group, head_space, head_num, head_phy_space, head_phy_num); } static gfarm_error_t print_usage_user(const char *name) { return (print_usage_common(name, 0)); } static gfarm_error_t print_usage_group(const char *name) { return (print_usage_common(name, 1)); } static gfarm_error_t usage_user_one(const char *name) { print_header_user(); return (print_usage_user(name)); } static gfarm_error_t usage_group_one(const char *name) { print_header_group(); return (print_usage_group(name)); } static gfarm_error_t usage_user_all() { struct gfarm_user_info *users; gfarm_error_t e, e_save = GFARM_ERR_NO_ERROR; int nusers, i, success = 0; e = gfm_client_user_info_get_all(gfm_server, &nusers, &users); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: gfm_client_user_info_get_all: %s\n", program_name, gfarm_error_string(e)); return (e); } print_header_user(); for (i = 0; i < nusers; i++) { e = print_usage_user(users[i].username); if (e == GFARM_ERR_NO_ERROR) success++; else { /* GFARM_ERR_NO_SUCH_OBJECT is preferred */ if (e == GFARM_ERR_NO_SUCH_OBJECT) e_save = e; if (e_save == GFARM_ERR_NO_ERROR) e_save = e; } gfarm_user_info_free(&users[i]); } free(users); if (success > 0) return (GFARM_ERR_NO_ERROR); else return (e_save); } static gfarm_error_t usage_group_all() { struct gfarm_group_info *groups; gfarm_error_t e, e_save = GFARM_ERR_NO_ERROR; int ngroups, i, success = 0; e = gfm_client_group_info_get_all(gfm_server, &ngroups, &groups); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: gfm_client_group_info_get_all: %s\n", program_name, gfarm_error_string(e)); return (e); } print_header_group(); for (i = 0; i < ngroups; i++) { e = print_usage_group(groups[i].groupname); if (e == GFARM_ERR_NO_ERROR) success++; else { /* GFARM_ERR_NO_SUCH_OBJECT is preferred */ if (e == GFARM_ERR_NO_SUCH_OBJECT) e_save = e; if (e_save == GFARM_ERR_NO_ERROR) e_save = e; } gfarm_group_info_free(&groups[i]); } free(groups); if (success > 0) return (GFARM_ERR_NO_ERROR); else return (e_save); } int main(int argc, char **argv) { gfarm_error_t e; int c, status = 0; int opt_group = 0; /* default: users list */ char *name = NULL; const char *path = GFARM_PATH_ROOT; if (argc > 0) program_name = basename(argv[0]); e = gfarm_initialize(&argc, &argv); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", program_name, gfarm_error_string(e)); exit(1); } while ((c = getopt(argc, argv, "P:gh?")) != -1) { switch (c) { case 'P': path = optarg; break; case 'g': opt_group = 1; break; case 'h': case '?': default: usage(); } } argc -= optind; argv += optind; if ((e = gfm_client_connection_and_process_acquire_by_path( path, &gfm_server)) != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: metadata server for \"%s\": %s\n", program_name, path, gfarm_error_string(e)); status = 1; goto terminate; } if (argc > 0) name = argv[0]; if (name) { if (opt_group) e = usage_group_one(name); else e = usage_user_one(name); } else { if (opt_group) e = usage_group_all(); else e = usage_user_all(); } if (e != GFARM_ERR_NO_ERROR) status = 1; if (e == GFARM_ERR_OPERATION_NOT_PERMITTED) fprintf(stderr, "%s: %s\n", program_name, gfarm_error_string(e)); gfm_client_connection_free(gfm_server); terminate: e = gfarm_terminate(); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", program_name, gfarm_error_string(e)); status = 1; } return (status); } gfarm-2.4.1/gftool/gfusage/Makefile0000644000000000000000000000072311507222717015671 0ustar rootroot# $Id: Makefile 4306 2010-01-09 06:14:20Z takuya-i $ top_builddir = ../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk PROGRAM = gfusage SRCS = $(PROGRAM).c OBJS = $(PROGRAM).o CFLAGS = $(COMMON_CFLAGS) -I$(GFUTIL_SRCDIR) -I$(GFARMLIB_SRCDIR) LDLIBS = $(COMMON_LDFLAGS) $(GFARMLIB) $(LIBS) DEPLIBS = $(DEPGFARMLIB) all: $(PROGRAM) include $(top_srcdir)/makes/prog.mk ### $(OBJS): $(DEPGFARMINC) \ $(GFARMLIB_SRCDIR)/gfm_client.h gfarm-2.4.1/gftool/gfquota/0000755000000000000000000000000011507222730014247 5ustar rootrootgfarm-2.4.1/gftool/gfquota/gfedquota/0000755000000000000000000000000011507222730016226 5ustar rootrootgfarm-2.4.1/gftool/gfquota/gfedquota/gfedquota.c0000644000000000000000000001201311507222717020353 0ustar rootroot/* * $Id: gfedquota.c 4390 2010-02-10 04:06:06Z takuya-i $ */ #include #include #include #include #include #define HAVE_GETOPT_LONG #ifdef HAVE_GETOPT_LONG #include #endif #include #include "config.h" #include "gfm_client.h" #include "lookup.h" #include "quota_info.h" char *program_name = "gfedquota"; #ifdef HAVE_GETOPT_LONG #define OPT(s, l, m) fprintf(stderr, " -%s,--%s\t%s\n", s, l, m) #else #define OPT(s, l, m) fprintf(stderr, " -%s\t%s\n", s, m) #endif static void usage(void) { fprintf(stderr, "Usage:\t%s " "[-P ] -u username (or -g groupname) [options]\n" "Options:\n" "(If the value is 'disable' or -1, the limit is disabled):\n", program_name); OPT("P", "path=NAME", "pathname (for multiple metadata servers)"); OPT("u", "user=NAME", "username"); OPT("g", "group=NAME", "groupname"); OPT("G", "grace=SEC", "grace period for all SoftLimits"); OPT("s", "softspc=BYTE", "SoftLimit of total used file space"); OPT("h", "hardspc=BYTE", "HardLimit of total used file space"); OPT("m", "softnum=NUM", "SoftLimit of total used file number"); OPT("n", "hardnum=NUM", "HardLimit of total used file number"); OPT("S", "physoftspc=BYTE", "SoftLimit of total used physical space"); OPT("H", "phyhardspc=BYTE", "HardLimit of total used physical space"); OPT("M", "physoftnum=NUM", "SoftLimit of total used physical number"); OPT("N", "phyhardnum=NUM", "HardLimit of total used physical number"); OPT("?", "help", "this help message"); exit(1); } static gfarm_int64_t convert_value(const char *str) { gfarm_int64_t val; char *endptr; if (strcmp(str, "disable") == 0) return (GFARM_QUOTA_INVALID); val = strtoll(str, &endptr, 10); if (*endptr != '\0') { fprintf(stderr, "ignore invalid parameter: %s\n", str); return (GFARM_QUOTA_NOT_UPDATE); } if (val == -1) return (GFARM_QUOTA_INVALID); else if (val < -1) return (GFARM_QUOTA_NOT_UPDATE); else return (val); } int main(int argc, char **argv) { gfarm_error_t e; int c, status = 0; char *username = NULL, *groupname = NULL; char *optstring = "P:u:g:G:s:h:m:n:S:H:M:N:?"; #ifdef HAVE_GETOPT_LONG struct option long_options[] = { {"path", 1, NULL, 'P'}, {"user", 1, NULL, 'u'}, {"group", 1, NULL, 'g'}, {"grace", 1, NULL, 'G'}, {"softspc", 1, NULL, 's'}, {"hardspc", 1, NULL, 'h'}, {"softnum", 1, NULL, 'm'}, {"hardnum", 1, NULL, 'n'}, {"physoftspc", 1, NULL, 'S'}, {"phyhardspc", 1, NULL, 'H'}, {"physoftnum", 1, NULL, 'M'}, {"phyhardnum", 1, NULL, 'N'}, {"help", 0, NULL, '?'}, {0, 0, 0, 0} }; #endif struct gfarm_quota_set_info qi = { NULL, GFARM_QUOTA_NOT_UPDATE, GFARM_QUOTA_NOT_UPDATE, GFARM_QUOTA_NOT_UPDATE, GFARM_QUOTA_NOT_UPDATE, GFARM_QUOTA_NOT_UPDATE, GFARM_QUOTA_NOT_UPDATE, GFARM_QUOTA_NOT_UPDATE, GFARM_QUOTA_NOT_UPDATE, GFARM_QUOTA_NOT_UPDATE, }; struct gfm_connection *gfm_server; const char *path = GFARM_PATH_ROOT; if (argc > 0) program_name = basename(argv[0]); e = gfarm_initialize(&argc, &argv); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", program_name, gfarm_error_string(e)); exit(1); } while (1) { #ifdef HAVE_GETOPT_LONG int option_index = 0; c = getopt_long(argc, argv, optstring, long_options, &option_index); #else c = getopt(argc, argv, optstring); #endif if (c == -1) break; switch (c) { case 'P': path = optarg; break; case 'u': username = strdup(optarg); break; case 'g': groupname = strdup(optarg); break; case 'G': qi.grace_period = convert_value(optarg); break; case 's': qi.space_soft = convert_value(optarg); break; case 'h': qi.space_hard = convert_value(optarg); break; case 'm': qi.num_soft = convert_value(optarg); break; case 'n': qi.num_hard = convert_value(optarg); break; case 'S': qi.phy_space_soft = convert_value(optarg); break; case 'H': qi.phy_space_hard = convert_value(optarg); break; case 'M': qi.phy_num_soft = convert_value(optarg); break; case 'N': qi.phy_num_hard = convert_value(optarg); break; case '?': default: usage(); } } argc -= optind; argv += optind; if ((e = gfm_client_connection_and_process_acquire_by_path( path, &gfm_server)) != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: metadata server for \"%s\": %s\n", program_name, path, gfarm_error_string(e)); status = -1; goto terminate; } if (username != NULL && groupname == NULL) { qi.name = username; e = gfm_client_quota_user_set(gfm_server, &qi); } else if (username == NULL && groupname != NULL) { qi.name = groupname; e = gfm_client_quota_group_set(gfm_server, &qi); } else usage(); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", program_name, gfarm_error_string(e)); status = -2; } gfarm_quota_set_info_free(&qi); gfm_client_connection_free(gfm_server); terminate: e = gfarm_terminate(); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", program_name, gfarm_error_string(e)); status = -3; } return (status); } gfarm-2.4.1/gftool/gfquota/gfedquota/Makefile0000644000000000000000000000064211507222717017675 0ustar rootroottop_builddir = ../../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk PROGRAM = gfedquota SRCS = $(PROGRAM).c OBJS = $(PROGRAM).o CFLAGS = $(COMMON_CFLAGS) -I$(GFUTIL_SRCDIR) -I$(GFARMLIB_SRCDIR) LDLIBS = $(COMMON_LDFLAGS) $(GFARMLIB) $(LIBS) DEPLIBS = $(DEPGFARMLIB) all: $(PROGRAM) include $(top_srcdir)/makes/prog.mk ### $(OBJS): $(DEPGFARMINC) \ $(GFARMLIB_SRCDIR)/gfm_client.h gfarm-2.4.1/gftool/gfquota/gfquotacheck/0000755000000000000000000000000011507222730016713 5ustar rootrootgfarm-2.4.1/gftool/gfquota/gfquotacheck/Makefile0000644000000000000000000000064511507222717020365 0ustar rootroottop_builddir = ../../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk PROGRAM = gfquotacheck SRCS = $(PROGRAM).c OBJS = $(PROGRAM).o CFLAGS = $(COMMON_CFLAGS) -I$(GFUTIL_SRCDIR) -I$(GFARMLIB_SRCDIR) LDLIBS = $(COMMON_LDFLAGS) $(GFARMLIB) $(LIBS) DEPLIBS = $(DEPGFARMLIB) all: $(PROGRAM) include $(top_srcdir)/makes/prog.mk ### $(OBJS): $(DEPGFARMINC) \ $(GFARMLIB_SRCDIR)/gfm_client.h gfarm-2.4.1/gftool/gfquota/gfquotacheck/gfquotacheck.c0000644000000000000000000000305511507222717021533 0ustar rootroot/* * $Id: gfquotacheck.c 4391 2010-02-10 04:07:47Z takuya-i $ */ #include #include #include #include #include #include "config.h" #include "gfm_client.h" #include "lookup.h" #include "quota_info.h" char *program_name = "gfquota"; static void usage(void) { fprintf(stderr, "Usage:\t%s [-P ]\n", program_name); exit(1); } int main(int argc, char **argv) { gfarm_error_t e; int c, status = 0; struct gfm_connection *gfm_server; const char *path = GFARM_PATH_ROOT; if (argc > 0) program_name = basename(argv[0]); e = gfarm_initialize(&argc, &argv); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", program_name, gfarm_error_string(e)); exit(1); } while ((c = getopt(argc, argv, "P:h?")) != -1) { switch (c) { case 'P': path = optarg; break; case 'h': case '?': default: usage(); } } argc -= optind; argv += optind; if ((e = gfm_client_connection_and_process_acquire_by_path( path, &gfm_server)) != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: metadata server for \"%s\": %s\n", program_name, path, gfarm_error_string(e)); status = -1; goto terminate; } e = gfm_client_quota_check(gfm_server); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", program_name, gfarm_error_string(e)); status = 1; } gfm_client_connection_free(gfm_server); terminate: e = gfarm_terminate(); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", program_name, gfarm_error_string(e)); status = 1; } return (status); } gfarm-2.4.1/gftool/gfquota/Makefile0000644000000000000000000000026211507222717015714 0ustar rootroottop_builddir = ../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk SUBDIRS = gfquota gfedquota gfquotacheck include $(top_srcdir)/makes/subdir.mk gfarm-2.4.1/gftool/gfquota/gfquota/0000755000000000000000000000000011507222730015715 5ustar rootrootgfarm-2.4.1/gftool/gfquota/gfquota/Makefile0000644000000000000000000000064011507222717017362 0ustar rootroottop_builddir = ../../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk PROGRAM = gfquota SRCS = $(PROGRAM).c OBJS = $(PROGRAM).o CFLAGS = $(COMMON_CFLAGS) -I$(GFUTIL_SRCDIR) -I$(GFARMLIB_SRCDIR) LDLIBS = $(COMMON_LDFLAGS) $(GFARMLIB) $(LIBS) DEPLIBS = $(DEPGFARMLIB) all: $(PROGRAM) include $(top_srcdir)/makes/prog.mk ### $(OBJS): $(DEPGFARMINC) \ $(GFARMLIB_SRCDIR)/gfm_client.h gfarm-2.4.1/gftool/gfquota/gfquota/gfquota.c0000644000000000000000000001334111507222717017536 0ustar rootroot/* * $Id: gfquota.c 4473 2010-02-26 09:23:14Z takuya-i $ */ #include #include #include #include #include #include #include "config.h" #include "gfm_client.h" #include "lookup.h" #include "quota_info.h" char *program_name = "gfquota"; static void usage(void) { fprintf(stderr, "Usage:\t%s [-q] [-P ] [-u username | -g groupname]\n", program_name); exit(EXIT_FAILURE); } #define EXCEEDED(f, type) fprintf(f, "warning: %s exceeded\n", type) #define EXPIRED(f, type) fprintf(f, "warning: %s expired\n", type) static int quota_check_and_warning(FILE *f, struct gfarm_quota_get_info *q) { int count = 0; /* hardlimit exceeded */ if ((quota_limit_is_valid(q->space_hard) && q->space >= q->space_hard)) { EXCEEDED(f, "FileSpaceHardLimit"); count++; } if (quota_limit_is_valid(q->num_hard) && q->num >= q->num_hard) { EXCEEDED(f, "FileNumHardLimit"); count++; } if (quota_limit_is_valid(q->phy_space_hard) && q->phy_space >= q->phy_space_hard) { EXCEEDED(f, "PhysicalSpaceHardLimit"); count++; } if (quota_limit_is_valid(q->phy_num_hard) && q->phy_num >= q->phy_num_hard) { EXCEEDED(f, "PhysicalNumHardLimit"); count++; } if (!quota_limit_is_valid(q->grace_period)) return (count); /* softlimit expired or eceeded */ if (quota_limit_is_valid(q->space_soft)) { if (q->space_grace == 0) { EXPIRED(f, "FileSpaceSoftLimit"); count++; } else if (q->space > q->space_soft) { EXCEEDED(f, "FileSpaceSoftLimit"); count++; } } if (quota_limit_is_valid(q->num_soft)) { if (q->num_grace == 0) { EXPIRED(f, "FileNumSoftLimit"); count++; } else if (q->num > q->num_soft) { EXCEEDED(f, "FileNumSoftLimit"); count++; } } if (quota_limit_is_valid(q->phy_space_soft)) { if (q->phy_space_grace == 0) { EXPIRED(f, "PhysicalSpaceSoftLimit"); count++; } else if (q->phy_space > q->phy_space_soft) { EXCEEDED(f, "PhysicalSpaceSoftLimit"); count++; } } if (quota_limit_is_valid(q->phy_num_soft)) { if (q->phy_num_grace == 0) { EXPIRED(f, "PhysicalNumSoftLimit"); count++; } else if (q->phy_num > q->phy_num_soft) { EXCEEDED(f, "PhysicalNumSoftLimit"); count++; } } return (count); } #define PRINT(f, s, v) \ { \ if (quota_limit_is_valid(v)) \ fprintf(f, "%s : %22"GFARM_PRId64"\n", s, v); \ else \ fprintf(f, "%s : %22s\n", s, "disabled"); \ } static void quota_get_info_print(FILE *f, struct gfarm_quota_get_info *q, int is_group) { if (!is_group) fprintf(f, "UserName : "); else fprintf(f, "GroupName : "); fprintf(f, "%22s\n", q->name); PRINT(f, "GracePeriod ", q->grace_period); PRINT(f, "FileSpace ", q->space); PRINT(f, "FileSpaceGracePeriod ", q->space_grace); PRINT(f, "FileSpaceSoftLimit ", q->space_soft); PRINT(f, "FileSpaceHardLimit ", q->space_hard); PRINT(f, "FileNum ", q->num); PRINT(f, "FileNumGracePeriod ", q->num_grace); PRINT(f, "FileNumSoftLimit ", q->num_soft); PRINT(f, "FileNumHardLimit ", q->num_hard); PRINT(f, "PhysicalSpace ", q->phy_space); PRINT(f, "PhysicalSpaceGracePeriod", q->phy_space_grace); PRINT(f, "PhysicalSpaceSoftLimit ", q->phy_space_soft); PRINT(f, "PhysicalSpaceHardLimit ", q->phy_space_hard); PRINT(f, "PhysicalNum ", q->phy_num); PRINT(f, "PhysicalNumGracePeriod ", q->phy_num_grace); PRINT(f, "PhysicalNumSoftLimit ", q->phy_num_soft); PRINT(f, "PhysicalNumHardLimit ", q->phy_num_hard); } #define OPT_USER 'u' #define OPT_GROUP 'g' static void conflict_check(int *mode_ch_p, int ch) { if (*mode_ch_p) { fprintf(stderr, "%s: -%c option conflicts with -%c\n", program_name, ch, *mode_ch_p); usage(); } *mode_ch_p = ch; } int main(int argc, char **argv) { gfarm_error_t e; int c, status = 0, opt_quiet = 0; int mode = 0; char *name = ""; /* default: my username */ struct gfarm_quota_get_info qi; struct gfm_connection *gfm_server; const char *path = GFARM_PATH_ROOT; if (argc > 0) program_name = basename(argv[0]); e = gfarm_initialize(&argc, &argv); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", program_name, gfarm_error_string(e)); exit(EXIT_FAILURE); } while ((c = getopt(argc, argv, "P:g:hqu:?")) != -1) { switch (c) { case 'P': path = optarg; break; case OPT_USER: /* 'u' */ name = optarg; conflict_check(&mode, c); break; case OPT_GROUP: /* 'g' */ name = optarg; conflict_check(&mode, c); break; case 'q': opt_quiet = 1; break; case 'h': case '?': default: usage(); } } argc -= optind; argv += optind; /* default mode is user */ if (mode == 0) mode = OPT_USER; if ((e = gfm_client_connection_and_process_acquire_by_path( path, &gfm_server)) != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: metadata server for \"%s\": %s\n", program_name, path, gfarm_error_string(e)); exit(EXIT_FAILURE); } switch (mode) { case OPT_USER: e = gfm_client_quota_user_get(gfm_server, name, &qi); break; case OPT_GROUP: e = gfm_client_quota_group_get(gfm_server, name, &qi); break; default: usage(); } if (e == GFARM_ERR_NO_SUCH_OBJECT) { /* quota is not enabled */ } else if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", program_name, gfarm_error_string(e)); exit(EXIT_FAILURE); } else { status = quota_check_and_warning(stderr, &qi); if (!opt_quiet) quota_get_info_print(stdout, &qi, mode == OPT_GROUP); gfarm_quota_get_info_free(&qi); } gfm_client_connection_free(gfm_server); e = gfarm_terminate(); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", program_name, gfarm_error_string(e)); exit(EXIT_FAILURE); } return (status); } gfarm-2.4.1/gftool/gfls/0000755000000000000000000000000011507222730013534 5ustar rootrootgfarm-2.4.1/gftool/gfls/gfls.c0000644000000000000000000004106011507222717014641 0ustar rootroot/* * $Id: gfls.c 4412 2010-02-16 06:20:53Z n-soda $ */ #include #include #include #include #include #include #include #include #include #include #include #include "timespec.h" /* XXX should export this interface */ char *program_name = "gfls"; #define INUM_LEN 11 #define INUM_PRINT(ino) printf("%10lu ", (long)(ino)) enum output_format { OF_ONE_PER_LINE, OF_MULTI_COLUMN, OF_LONG } option_output_format; /* -1/-C/-l */ enum sort_order { SO_NAME, SO_SIZE, SO_MTIME } option_sort_order = SO_NAME; /* -S/-t */ enum option_all_kind { OA_NONE = 0, OA_ALL, OA_ALMOST_ALL } option_all = OA_NONE; /* -a/-A */ #define is_option_all (option_all == OA_ALL) #define is_option_almost_all (option_all == OA_ALMOST_ALL) int option_type_suffix = 0; /* -F */ int option_recursive = 0; /* -R */ int option_complete_time = 0; /* -T */ int option_directory_itself = 0; /* -d */ int option_inumber = 0; /* -i */ int option_reverse_sort = 0; /* -r */ #define CACHE_EXPIRATION_NOT_SPECIFIED -1.0 double option_cache_expiration = CACHE_EXPIRATION_NOT_SPECIFIED; /* -E */ int screen_width = 80; /* default */ /* * gfls implementation */ struct ls_entry { char *path, *symlink; struct gfs_stat *st; }; int compare_name(const void *a, const void *b) { const struct ls_entry *p = a, *q = b; return (strcmp(p->path, q->path)); } int compare_name_r(const void *a, const void *b) { const struct ls_entry *p = a, *q = b; return (-strcmp(p->path, q->path)); } int compare_size(const void *a, const void *b) { const struct ls_entry *p = a, *q = b; if (p->st->st_size > q->st->st_size) return (1); else if (p->st->st_size < q->st->st_size) return (-1); else return (0); } int compare_size_r(const void *a, const void *b) { return (-compare_size(a, b)); } int compare_mtime(const void *a, const void *b) { const struct ls_entry *p = a, *q = b; return (gfarm_timespec_cmp(&q->st->st_mtimespec, &p->st->st_mtimespec)); } int compare_mtime_r(const void *a, const void *b) { const struct ls_entry *p = a, *q = b; return (gfarm_timespec_cmp(&p->st->st_mtimespec, &q->st->st_mtimespec)); } void ls_sort(int n, struct ls_entry *ls) { int (*compare)(const void *, const void *); #ifdef __GNUC__ /* workaround gcc warning: unused variable */ compare = NULL; #endif if (option_reverse_sort) { switch (option_sort_order) { case SO_NAME: compare = compare_name_r; break; case SO_SIZE: compare = compare_size_r; break; case SO_MTIME: compare = compare_mtime_r; break; } } else { switch (option_sort_order) { case SO_NAME: compare = compare_name; break; case SO_SIZE: compare = compare_size; break; case SO_MTIME: compare = compare_mtime; break; } } qsort(ls, n, sizeof(*ls), compare); } gfarm_error_t do_stats(char *prefix, int *np, char **files, struct gfs_stat *stats, struct ls_entry *ls) { gfarm_error_t e, e_save = GFARM_ERR_NO_ERROR; int i, n = *np, m, prefix_len, space; char *namep, buffer[PATH_MAX * 2 + 1]; prefix_len = strlen(prefix); if (prefix_len > sizeof(buffer) - 1) prefix_len = sizeof(buffer) - 1; memcpy(buffer, prefix, prefix_len); namep = &buffer[prefix_len]; space = sizeof(buffer) - prefix_len - 1; m = 0; for (i = 0; i < n; i++) { if (strlen(files[i]) <= space) { strcpy(namep, files[i]); } else { memcpy(namep, files[i], space); namep[space] = '\0'; } e = gfs_lstat_cached(buffer, &stats[i]); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", buffer, gfarm_error_string(e)); if (e_save != GFARM_ERR_NO_ERROR) e_save = e; /* mark this stats[i] isn't initialized */ stats[i].st_user = stats[i].st_group = NULL; continue; } ls[m].path = files[i]; ls[m].st = &stats[i]; if (!GFARM_S_ISLNK(ls[m].st->st_mode) || gfs_readlink(buffer, &ls[m].symlink) != GFARM_ERR_NO_ERROR) ls[m].symlink = NULL; m++; } *np = m; return (e_save); } int put_suffix(struct ls_entry *ls) { struct gfs_stat *st = ls->st; if (GFARM_S_ISDIR(st->st_mode)) { putchar('/'); return 1; } else if (GFARM_S_ISLNK(st->st_mode)) { putchar('@'); return 1; } else if (GFARM_S_IS_PROGRAM(st->st_mode)) { putchar('*'); return 1; } return 0; } void put_perm(int mode) { if (mode & 04) putchar('r'); else putchar('-'); if (mode & 02) putchar('w'); else putchar('-'); if (mode & 01) putchar('x'); else putchar('-'); } #define HALFYEAR ((365 * 24 * 60 * 60) / 2) void put_time(struct gfarm_timespec *ts) { static struct timeval now; static int initialized = 0; struct tm *tm; time_t sec; char buffer[100]; if (!initialized) { gettimeofday(&now, NULL); initialized = 1; } sec = ts->tv_sec; tm = localtime(&sec); if (option_complete_time) strftime(buffer, sizeof(buffer) - 1, "%b %e %H:%M:%S %Y", tm); else if (ts->tv_sec >= now.tv_sec - HALFYEAR && ts->tv_sec <= now.tv_sec + HALFYEAR) strftime(buffer, sizeof(buffer) - 1, "%b %e %H:%M", tm); else strftime(buffer, sizeof(buffer) - 1, "%b %e %Y", tm); buffer[sizeof(buffer) - 1] = '\0'; fputs(buffer, stdout); } void put_stat(struct gfs_stat *st) { if (GFARM_S_ISDIR(st->st_mode)) putchar('d'); else if (GFARM_S_ISLNK(st->st_mode)) putchar('l'); else putchar('-'); put_perm(st->st_mode >> 6); put_perm(st->st_mode >> 3); put_perm(st->st_mode); printf(" %d %-8s %-8s ", (int)st->st_nlink, st->st_user, st->st_group); printf("%10" GFARM_PRId64 " ", st->st_size); put_time(&st->st_mtimespec); putchar(' '); } gfarm_error_t list_files(char *prefix, int n, char **files, int *need_newline) { gfarm_error_t e = GFARM_ERR_NO_ERROR; int i; struct ls_entry *ls; struct gfs_stat *stats = NULL; GFARM_MALLOC_ARRAY(ls, n); if (ls == NULL) return (GFARM_ERR_NO_MEMORY); if (option_output_format == OF_LONG || option_sort_order != SO_NAME || option_type_suffix || option_inumber) { GFARM_MALLOC_ARRAY(stats, n); if (stats == NULL) { free(ls); return (GFARM_ERR_NO_MEMORY); } e = do_stats(prefix, &n, files, stats, ls); } else { for (i = 0; i < n; i++) { ls[i].path = files[i]; ls[i].st = NULL; ls[i].symlink = NULL; } } ls_sort(n, ls); if (option_output_format == OF_MULTI_COLUMN) { int j, k, columns, lines, column_width, max_width = 0; for (i = 0; i < n; i++) { j = strlen(ls[i].path); if (max_width < j) max_width = j; } column_width = max_width + (option_type_suffix ? 1 : 0) + (option_inumber ? INUM_LEN : 0); columns = screen_width / (column_width + 1); if (columns <= 0) /* a pathname is wider than screen_width */ columns = 1; lines = n / columns; if (lines * columns < n) lines++; for (i = 0; i < lines; i++) { for (j = 0; j < columns; j++) { int len_suffix = 0; k = i + j * lines; if (k >= n) break; if (option_inumber) INUM_PRINT(ls[k].st->st_ino); fputs(ls[k].path, stdout); if (option_type_suffix) len_suffix = put_suffix(&ls[k]); printf("%*s", (int)(column_width - (option_inumber ? INUM_LEN : 0) - strlen(ls[k].path)) - len_suffix + 1, ""); } putchar('\n'); } } else { for (i = 0; i < n; i++) { if (option_inumber) INUM_PRINT(ls[i].st->st_ino); if (option_output_format == OF_LONG) put_stat(ls[i].st); fputs(ls[i].path, stdout); if (option_type_suffix) (void)put_suffix(&ls[i]); if (option_output_format == OF_LONG && ls[i].symlink != NULL) printf(" -> %s", ls[i].symlink); putchar('\n'); } } if (n > 0 || e != GFARM_ERR_NO_ERROR) *need_newline = 1; if (stats != NULL) { for (i = 0; i < n; i++) { if (stats[i].st_user != NULL || stats[i].st_group != NULL) gfs_stat_free(&stats[i]); } free(stats); } free(ls); return (e); } gfarm_error_t list_dirs(char *, int, char **, int *); #define is_dot_or_dot_dot(s) \ (s[0] == '.' && (s[1] == '\0' || (s[1] == '.' && s[2] == '\0'))) gfarm_error_t list_dir(char *prefix, char *dirname, int *need_newline) { gfarm_error_t e, e_save = GFARM_ERR_NO_ERROR; char *s, *path; gfarm_stringlist names; gfs_glob_t types; GFS_Dir dir; struct gfs_dirent *entry; int len = strlen(prefix) + strlen(dirname); GFARM_MALLOC_ARRAY(path, len + 1 + 1); if (path == NULL) return (GFARM_ERR_NO_MEMORY); sprintf(path, "%s%s", prefix, dirname); e = gfarm_stringlist_init(&names); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", program_name, gfarm_error_string(e)); free(path); return (e); } e = gfs_glob_init(&types); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", program_name, gfarm_error_string(e)); gfarm_stringlist_free(&names); free(path); return (e); } e = gfs_opendir_caching(path, &dir); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", path, gfarm_error_string(e)); gfs_glob_free(&types); gfarm_stringlist_free(&names); free(path); return (e); } while ((e = gfs_readdir(dir, &entry)) == GFARM_ERR_NO_ERROR && entry != NULL) { if (!option_all && entry->d_name[0] == '.') continue; if (is_option_almost_all && is_dot_or_dot_dot(entry->d_name)) continue; s = strdup(entry->d_name); if (s == NULL) { e = GFARM_ERR_NO_MEMORY; break; } gfarm_stringlist_add(&names, s); gfs_glob_add(&types, entry->d_type); } if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s%s: %s\n", prefix, dirname, gfarm_error_string(e)); e_save = e; } gfs_closedir(dir); if (*gfarm_path_dir_skip(path) != '\0') { path[len] = '/'; path[len + 1] = '\0'; } e = list_files(path, gfarm_stringlist_length(&names), GFARM_STRINGLIST_STRARRAY(names), need_newline); if (e_save == GFARM_ERR_NO_ERROR) e_save = e; if (option_recursive) { int i; for (i = 0; i < gfarm_stringlist_length(&names); i++) { s = GFARM_STRINGLIST_STRARRAY(names)[i]; if (is_dot_or_dot_dot(s)) continue; /* "." or ".." */ if (!option_all && s[0] == '.') continue; if (gfs_glob_elem(&types, i) == GFS_DT_DIR) { e = list_dirs(path, 1, &s, need_newline); if (e_save == GFARM_ERR_NO_ERROR) e_save = e; } } } gfs_glob_free(&types); gfarm_stringlist_free_deeply(&names); free(path); return (e_save); } int string_compare(const void *a, const void *b) { const char *const *p = a, *const *q = b; return (strcmp(*p, *q)); } void string_sort(int n, char **v) { qsort(v, n, sizeof(*v), string_compare); } gfarm_error_t list_dirs(char *prefix, int n, char **dirs, int *need_newline) { gfarm_error_t e, e_save = GFARM_ERR_NO_ERROR; int i; string_sort(n, dirs); for (i = 0; i < n; i++) { if (*need_newline) { printf("\n"); *need_newline = 0; } printf("%s%s:\n", prefix, dirs[i]); e = list_dir(prefix, dirs[i], need_newline); *need_newline = 1; if (e_save == GFARM_ERR_NO_ERROR) e_save = e; } return (e_save); } gfarm_error_t list(gfarm_stringlist *paths, gfs_glob_t *types, int *need_newline) { gfarm_error_t e, e_save = GFARM_ERR_NO_ERROR; gfarm_stringlist dirs, files; int i, nfiles, ndirs; if (option_directory_itself) { return (list_files("", gfarm_stringlist_length(paths), GFARM_STRINGLIST_STRARRAY(*paths), need_newline)); } e = gfarm_stringlist_init(&dirs); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", program_name, gfarm_error_string(e)); return (e); } e = gfarm_stringlist_init(&files); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", program_name, gfarm_error_string(e)); gfarm_stringlist_free(&dirs); return (e); } for (i = 0; i < gfarm_stringlist_length(paths); i++) { char *path = gfarm_stringlist_elem(paths, i); if (gfs_glob_elem(types, i) == GFS_DT_DIR) gfarm_stringlist_add(&dirs, path); else gfarm_stringlist_add(&files, path); } nfiles = gfarm_stringlist_length(&files); ndirs = gfarm_stringlist_length(&dirs); if (nfiles > 0) { e = list_files("", nfiles, GFARM_STRINGLIST_STRARRAY(files), need_newline); /* warning is already printed in list_files() */ if (e_save == GFARM_ERR_NO_ERROR) e_save = e; } gfarm_stringlist_free(&files); if (nfiles == 0 && ndirs == 1) { e = list_dir("", gfarm_stringlist_elem(&dirs, 0), need_newline); /* warning is already printed in list_dir() */ } else { e = list_dirs("", ndirs, GFARM_STRINGLIST_STRARRAY(dirs), need_newline); /* warning is already printed in list_dirs() */ } if (e_save == GFARM_ERR_NO_ERROR) e_save = e; gfarm_stringlist_free(&dirs); return (e_save); } void usage(void) { fprintf(stderr, "Usage: %s [-1ACFRSTadilrt] [-E ] ...\n", program_name); exit(EXIT_FAILURE); } int main(int argc, char **argv) { gfarm_error_t e; gfarm_stringlist paths; gfs_glob_t types; int i, c, exit_code = EXIT_SUCCESS; char *ep; if (argc > 0) program_name = basename(argv[0]); e = gfarm_initialize(&argc, &argv); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: gfarm_initialize: %s\n", program_name, gfarm_error_string(e)); exit(EXIT_FAILURE); } if (isatty(STDOUT_FILENO)) { char *s = getenv("COLUMNS"); #ifdef TIOCGWINSZ struct winsize win; #endif if (s != NULL) screen_width = strtol(s, NULL, 0); #ifdef TIOCGWINSZ else if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &win) == 0 && win.ws_col > 0) screen_width = win.ws_col; #endif option_output_format = OF_MULTI_COLUMN; } else { option_output_format = OF_ONE_PER_LINE; } while ((c = getopt(argc, argv, "1ACE:FRSTadilrt?")) != -1) { switch (c) { case '1': option_output_format = OF_ONE_PER_LINE; break; case 'A': option_all = OA_ALMOST_ALL; break; case 'C': option_output_format = OF_MULTI_COLUMN; break; case 'E': errno = 0; option_cache_expiration = strtod(optarg, &ep); if (ep == optarg || *ep != '\0') { fprintf(stderr, "%s: -E %s: invalid argument\n", program_name, optarg); usage(); } else if (errno != 0) { fprintf(stderr, "%s: -E %s: %s\n", program_name, optarg, strerror(errno)); exit(EXIT_FAILURE); } break; case 'F': option_type_suffix = 1; break; case 'R': option_recursive = 1; break; case 'S': option_sort_order = SO_SIZE; break; case 'T': option_complete_time = 1; break; case 'a': option_all = OA_ALL; break; case 'd': option_directory_itself = 1; break; case 'i': option_inumber = 1; break; case 'l': option_output_format = OF_LONG; break; case 'r': option_reverse_sort = 1; break; case 't': option_sort_order = SO_MTIME; break; case '?': default: usage(); } } argc -= optind; argv += optind; if (option_cache_expiration == 0.0) gfs_stat_cache_enable(0); else if (option_cache_expiration != CACHE_EXPIRATION_NOT_SPECIFIED) gfs_stat_cache_expiration_set(option_cache_expiration*1000.0); e = gfarm_stringlist_init(&paths); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", program_name, gfarm_error_string(e)); exit(EXIT_FAILURE); } e = gfs_glob_init(&types); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", program_name, gfarm_error_string(e)); exit(EXIT_FAILURE); } if (argc < 1) { gfarm_stringlist_add(&paths, strdup(".")); gfs_glob_add(&types, GFS_DT_DIR); } else { for (i = 0; i < argc; i++) { int last; /* do not treat glob error as an error */ gfs_glob(argv[i], &paths, &types); last = gfs_glob_length(&types) - 1; if (last >= 0 && gfs_glob_elem(&types, last) == GFS_DT_UNKNOWN) { /* * Currently, this only happens if there is * no file which matches with argv[i]. * In such case, the number of entries which * were added by gfs_glob() is 1. * But also please note that GFS_DT_UNKNOWN * may happen on other case in future. */ struct gfs_stat s; char *path = gfarm_stringlist_elem(&paths, last); e = gfs_lstat_cached(path, &s); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: %s\n", path, gfarm_error_string(e)); exit_code = EXIT_FAILURE; /* remove last entry */ /* XXX: FIXME layering violation */ free(paths.array[last]); paths.length--; types.length--; } else { GFS_GLOB_ELEM(types, last) = gfs_mode_to_type(s.st_mode); gfs_stat_free(&s); } } } } if (gfarm_stringlist_length(&paths) > 0) { int need_newline = 0; #if 1 if (list(&paths, &types, &need_newline) != GFARM_ERR_NO_ERROR){ /* warning is already printed in list() */ exit_code = EXIT_FAILURE; } #else for (i = 0; i < gfarm_stringlist_length(&paths); i++) printf("<%s>\n", gfarm_stringlist_elem(&paths, i)); #endif } gfarm_stringlist_free_deeply(&paths); gfs_glob_free(&types); e = gfarm_terminate(); if (e != GFARM_ERR_NO_ERROR) { fprintf(stderr, "%s: gfarm_terminate: %s\n", program_name, gfarm_error_string(e)); exit_code = EXIT_FAILURE; } return (exit_code); } gfarm-2.4.1/gftool/gfls/Makefile0000644000000000000000000000066511507222717015210 0ustar rootroot# $Id: Makefile 4413 2010-02-16 06:35:17Z n-soda $ top_builddir = ../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk PROGRAM = gfls SRCS = $(PROGRAM).c OBJS = $(PROGRAM).o CFLAGS = $(COMMON_CFLAGS) -I$(GFARMLIB_SRCDIR) LDLIBS = $(COMMON_LDLIBS) $(GFARMLIB) $(LIBS) DEPLIBS = $(DEPGFARMLIB) all: $(PROGRAM) include $(top_srcdir)/makes/prog.mk ### $(OBJS): $(DEPGFARMINC) $(GFARMLIB_SRCDIR)/timespec.h gfarm-2.4.1/README.en0000644000000000000000000000361711507222727012605 0ustar rootrootIntroduction ============ If you are new to a Gfarm file system, it's recommended that you read the documents in the following order: 1. Overview Please read OVERVIEW.en. 2. How to install Gfarm file system If you intend to install Gfarm from the source code, please read INSTALL.en. If you intend to install Gfarm from the RPM binary package, please read INSTALL.RPM.en. 3. How to setup Gfarm file system Please read SETUP.en. 4. How to use Gfarm file system If you intend to use GfarmFS-FUSE, please read the documents in that package. List of Documents ================= - README.en (in English) README.ja (in Japanese) This file. - LICENSE (in English) The License for Gfarm. - RELNOTES (in English) This document describes the differences in each version. - OVERVIEW.en (in English) OVERVIEW.ja (in Japanese) This document introduces an overview of Gfarm and its terminology. - INSTALL.en (in English) INSTALL.ja (in Japanese) This document describes how to install Gfarm from the source code. - INSTALL.RPM.en (in English) INSTALL.RPM.ja (in Japanese) This document describes how to install Gfarm from the RPM binary packages that are used in RedHat Linux, Fedora Core, CentOS, etc. - SETUP.en (in English) SETUP.ja (in Japanese) This document describes how to setup a Gfarm file system. - SETUP.private.en (in English) SETUP.private.ja (in Japanese) This document describes how to setup a private Gfarm file system by a non privileged user. - KNOWN_PROBLEMS.en (in English) KNOWN_PROBLEMS.ja (in Japanese) This document describes known problems with Gfarm. - Gfarm-FAQ.en (in English) Gfarm-FAQ.ja (in Japanese) This document describes frequently asked questions and answers. - Reference manual in both HTML and UNIX manpage format. (both English and Japanese) - User's manual in HTML format. (both English and Japanese) Please see http://datafarm.apgrid.org/ as well. gfarm-2.4.1/configure.ac0000644000000000000000000010737711507222727013622 0ustar rootrootdnl Process this file with autoconf to produce a configure script. AC_INIT AC_CONFIG_SRCDIR(RELNOTES) AC_CONFIG_AUX_DIR(makes) AC_CONFIG_HEADER(include/gfarm/gfarm_config.h) # Determine target system # This is called "host" on autotools, because its terminology is following: # build system - system which is used to build a tool # host system - system which is used to run a tool # target system - system which is used to run a program generated by a tool AC_CANONICAL_HOST # "linux-gnu" -> "linux", "netbsdelf" -> "netbsd", "osf5.1b" -> "osf1" host_os_nickname=`echo $host_os | sed -e 's/-.*//' -e 's/[[0-9.]]*$//' \ -e 's/^netbsdelf$/netbsd/' -e 's/osf[0-9].*/osf1/'` ###### ###### Checks for programs. ###### AC_PROG_CC(cc gcc) # search cc before gcc if test x"$GCC" = x"yes"; then # CFLAGS='-g -O2' CFLAGS="${CFLAGS} -Wall" else # CFLAGS='-g' CFLAGS="-O" # don't use -g, but use -O fi AC_PROG_LEX # the following definition should not be needed. # but there is stupid environment which flex exists but libfl.a doesn't. if test x"$LEX" = x"flex"; then AC_CHECK_LIB(fl, yywrap, [LEXLIB=-lfl], [LEXLIB=-ll]) fi if mkdir -p . 2>/dev/null; then MKDIR_P='mkdir -p' else test -d ./-p && rmdir ./-p MKDIR_P='$(top_srcdir)/makes/mkdirhier' fi AC_SUBST(MKDIR_P) AC_PROG_YACC AC_PROG_INSTALL AC_PROG_LIBTOOL ###### ###### parsing command line options ###### ### ### --with-pthread=PTHREAD_ROOT, or --without-pthread ### AC_MSG_CHECKING([pthread]) AC_ARG_WITH(pthread, [ --with-pthread=PTHREAD_ROOT pthread root directory [[default=/usr]] --without-pthread disable pthread support], [with_pthread="${withval}" ]) ax_cv_have_pthread=no if test x"${with_pthread}" != x"no"; then AC_DEFUN([AC_TRY_PTHREAD], [ CPPFLAGS_SAVE="$CPPFLAGS" LIBS_SAVE="$LIBS" CPPFLAGS="${pthread_includes} $1 $CPPFLAGS_SAVE" # -R is not portable without libtool, and not necessary for AC_TRY_LINK LIBS="`echo $2 | sed 's/-R[[^ ]]*//g'` $LIBS_SAVE" AC_TRY_LINK([ #include void *foo(void *p){ return 0; }],[ pthread_t thread_id; pthread_create(&thread_id, NULL, foo, NULL); ], [ ax_cv_have_pthread=yes pthread_includes="${pthread_includes} $1" pthread_libs="${pthread_libs} $2" ], [ if test x"${pthread_specified}" = x"explicit"; then AC_MSG_ERROR([\"$3\" is specified, but cannot be linked, aborted]) fi ]) CPPFLAGS="$CPPFLAGS_SAVE" LIBS="$LIBS_SAVE" ]) # always define _REENTRANT pthread_includes="-D_REENTRANT" pthread_libs= if expr x"${with_pthread}" : x"/.*" >/dev/null; then # pathname specified? pthread_specified=explicit case ${with_pthread} in /usr) AC_TRY_PTHREAD(,-lpthread,${with_pthread}) ;; *) AC_TRY_PTHREAD(-I${with_pthread}/include,-R${with_pthread}/lib -L${with_pthread}/lib -lpthread,${with_pthread}) ;; esac elif test x"${with_pthread}" != x && test x"${with_pthread}" != x"yes"; then pthread_specified=explicit AC_TRY_PTHREAD(${with_pthread},${with_pthread},${with_pthread}) elif test x"${PTHREAD_CFLAGS+1}${PTHREAD_LDFLAGS+2}${PTHREAD_LIBS+3}" != x"" then # NetBSD pkgsrc configuration is specified? pthread_specified=explicit AC_TRY_PTHREAD(${PTHREAD_CFLAGS},${PTHREAD_LDFLAGS} ${PTHREAD_LIBS},${PTHREAD_CFLAGS} ${PTHREAD_LDFLAGS} ${PTHREAD_LIBS}) else # otherwise try system supplied pthread library pthread_specified=yes case $host in *-*-aix*) AC_TRY_PTHREAD(-mthreads,-mthreads,);; *-*-freebsd[[2-4]].*) # FreeBSD 2.X ... 4.X (-lc_r) needs -D_THREAD_SAFE AC_TRY_PTHREAD(-D_THREAD_SAFE -pthread,-pthread,);; *-*-hpux*) AC_TRY_PTHREAD(-D_POSIX_C_SOURCE=199506L -D_HPUX_SOURCE,-lpthread,);; *-*-solaris*) if test x"$GCC" = x"yes"; then AC_TRY_PTHREAD(-pthread,-pthread,) else AC_TRY_PTHREAD(-mt -D_POSIX_PTHREAD_SEMANTICS,-mt -lpthread,) fi;; *-*-sysv5uw7*) # UnixWare 7 if test x"$GCC" = x"yes"; then AC_TRY_PTHREAD(-pthread,-pthread,) else AC_TRY_PTHREAD(-Kthread,-Kthread,) fi;; *) # Tru64 (OSF1): -pthread # FreeBSD 5.X: -pthread, 3 libraries are available as follows: # -lpthread (M:N, default), -lc_r (1:N), and -lthr (1:1) # NetBSD 2.X or later: -pthread # Linux: -pthread AC_TRY_PTHREAD(-pthread,-pthread,);; esac # and if it fails too, just try default ${CFLAGS}, ${LDFLAGS} and ${LIBS} if test x"${ax_cv_have_pthread}" != x"yes"; then AC_TRY_PTHREAD(,,) fi fi fi case ${ax_cv_have_pthread} in yes) AC_MSG_RESULT([using CFLAGS=\"${pthread_includes}\" and LDLIBS=\"${pthread_libs}\"]) AC_DEFINE(HAVE_PTHREAD, 1, [pthread library exists]) pthread_srcs='${PTHREAD_SRCS}' pthread_objs='${PTHREAD_OBJS}' pthread_cflags='${PTHREAD_CFLAGS}' pthread_targets='${PTHREAD_TARGETS}' ;; *) if test x"${with_pthread}" = x"no"; then AC_MSG_RESULT([disabled]) else # in this case, must be: test x"${pthread_specified}" != x"explicit" AC_MSG_RESULT([no]) fi pthread_includes= pthread_libs= pthread_srcs= pthread_objs= pthread_cflags= pthread_targets= ;; esac AC_SUBST(pthread_includes) AC_SUBST(pthread_libs) # for conditional compilation which depends on pthread AC_SUBST(pthread_srcs) AC_SUBST(pthread_objs) AC_SUBST(pthread_cflags) AC_SUBST(pthread_targets) ### ### --with-openssl=OpenSSL_ROOT ### # sanity check for OpenSSL is deferred, because ${openssl_includes} # and ${openssl_lib} may be overrided by Globus autoconfiguration. AC_ARG_WITH(openssl, [ --with-openssl=OpenSSL_ROOT openssl root directory [[default=/usr]]], [with_openssl="${withval}" ], [with_openssl=/usr ]) AC_MSG_RESULT([using \"${with_openssl}\"]) openssl_libs='-lssl -lcrypto' if test x"${with_openssl}" = x"/usr"; then openssl_includes= else openssl_includes="-I${with_openssl}/include" openssl_libs="-R${with_openssl}/lib -L${with_openssl}/lib ${openssl_libs}" fi AC_SUBST(openssl_includes) AC_SUBST(openssl_libs) ### ### --with-globus=GLOBUS_ROOT --with-globus-flavor=FLAVOR -with-globus-static ### AC_ARG_WITH(globus_static, [ --with-globus-static link static version of globus libraries instead of shared version [[default=disable]]], [globus_static="${withval}" ], [globus_static="" ]) AC_ARG_WITH(globus_flavor, [ --with-globus-flavor=FLAVOR globus flavor name [[default=guessed]]], [globus_flavor="${withval}" ], [globus_flavor= ]) AC_SUBST(globus_flavor) AC_MSG_CHECKING([globus]) AC_ARG_WITH(globus, [ --with-globus=GLOBUS_ROOT globus root directory [[default=disable]]], [globus_location="${withval}" case "${globus_location}" in yes) globus_location=${GLOBUS_LOCATION};; esac GLBlocation_candidates=${globus_location:-/usr/grid} if test -n "$globus_flavor"; then GLBflavor_candidates="$globus_flavor" else GLBflavor_candidates= if test x"$GCC" = x"yes"; then tmp='gcc vendorcc' else tmp='vendorcc gcc' fi for GLBbits in 64 32; do for GLBcc in $tmp; do for GLBdebug in "" dbg; do for GLBpthread in "" pthr; do GLBflavor_candidates="$GLBflavor_candidates $GLBcc$GLBbits$GLBdebug$GLBpthread" done done done done fi globus_found= for d in ${GLBlocation_candidates}; do for f in ${GLBflavor_candidates}; do if test -f "$d/include/$f/gssapi.h"; then globus_location=$d globus_flavor=$f globus_found=yes break fi done if test x"$globus_found" = x"yes"; then break; fi done if test x"$globus_found" != x"yes"; then AC_MSG_RESULT([not found]) AC_MSG_RESULT([searched directories are: ${GLBlocation_candidates}]) AC_MSG_RESULT([searched flavors are: ${GLBflavor_candidates}]) if test -n "$globus_flavor"; then AC_MSG_ERROR([cannot find the globus flavor \"$globus_flavor\", missing include/$globus_flavor/gssapi.h under ${GLBlocation_candidates}.]) else AC_MSG_ERROR([cannot automatically find include/\${GLOBUS_FLAVOR}/gssapi.h under ${GLBlocation_candidates}, please specify the flavor by --with-globus-flavor=GLOBUS_FLAVOR]) fi exit 1 fi AC_MSG_RESULT([found in \"${globus_location}\" with \"${globus_flavor}\" flavor]) globus_includes="-I${globus_location}/include/${globus_flavor}" globus_libdir="${globus_location}/lib" cfgmhtmp=/tmp/cfgmh$$ AC_MSG_CHECKING([globus library names]) if case ${globus_static} in yes) env GLOBUS_LOCATION=${globus_location} ${globus_location}/bin/globus-makefile-header -static -flavor=${globus_flavor} globus_gssapi_gsi;; *) env GLOBUS_LOCATION=${globus_location} ${globus_location}/bin/globus-makefile-header -flavor=${globus_flavor} globus_gssapi_gsi;; esac > $cfgmhtmp then AC_MSG_RESULT([done]) else rm -f $cfgmhtmp AC_MSG_RESULT([failed to call ${globus_location}/bin/globus-makefile-header command.]) AC_MSG_RESULT([Please run \${GPT_LOCATION}/sbin/gpt-postinstall, if it is not invoked yet.]) AC_MSG_ERROR([Globus installation is incomplete, aborted.]) fi globus_gssapi_libs=`sed -n '/^GLOBUS_PKG_LIBS *=/s///p' $cfgmhtmp` rm -f $cfgmhtmp case ${globus_static} in yes) :;; *) globus_gssapi_libs="-R${globus_libdir} -L${globus_libdir} $globus_gssapi_libs" esac # for conditional compilation which depends on whether globus is enabled or not globus_srcs='${GLOBUS_SRCS}' globus_objs='${GLOBUS_OBJS}' globus_cflags='${GLOBUS_CFLAGS}' globus_targets='${GLOBUS_TARGETS}' # replace openssl library with that included in globus if test -x ${globus_location}/bin/globus-version; then globus_version=`env GLOBUS_LOCATION=${globus_location} ${globus_location}/bin/globus-version` case ${globus_version} in 4.0*|3*|2*) openssl_includes="${globus_includes}" case ${globus_static} in yes) openssl_libs="${globus_libdir}/libssl_${globus_flavor}.a ${globus_libdir}/libcrypto_${globus_flavor}.a" AC_MSG_RESULT([using globus static library: yes]);; *) openssl_libs="-R${globus_libdir} -L${globus_libdir} -lssl_${globus_flavor} -lcrypto_${globus_flavor}" AC_MSG_RESULT([using globus static library: no]);; esac;; *) # after 4.2.0, globus does not include openssl libarary. ;; esac fi AC_DEFINE(HAVE_GSI, 1, [Grid Security Infrastructure exists]) ], [AC_MSG_RESULT([disabled]) globus_location= globus_includes= globus_gssapi_libs= # for conditional compilation which depends on whether globus is enabled or not globus_srcs= globus_objs= globus_cflags= globus_targets= ]) AC_SUBST(globus_location) AC_SUBST(globus_includes) AC_SUBST(globus_gssapi_libs) # for conditional compilation which depends on whether globus is enabled or not AC_SUBST(globus_srcs) AC_SUBST(globus_objs) AC_SUBST(globus_cflags) AC_SUBST(globus_targets) ### ### --with-gfshook ### AC_ARG_WITH(gfshook, [ --with-gfshook build libgfs_hook.so syscall hooking library [[default]] --without-gfshook disable to build syscall hooking library]) if test x${with_gfshook} != xno then gfshook_srcs='${GFSHOOK_SRCS}' gfshook_objs='${GFSHOOK_OBJS}' gfshook_cflags='${GFSHOOK_CFLAGS}' gfshook_targets='${GFSHOOK_TARGETS}' else AC_MSG_CHECKING([gfshook]) AC_MSG_RESULT([disable]) gfshook_srcs= gfshook_objs= gfshook_cflags= gfshook_targets= fi # for conditional compilation related to syscall hooking library AC_SUBST(gfshook_srcs) AC_SUBST(gfshook_objs) AC_SUBST(gfshook_cflags) AC_SUBST(gfshook_targets) ### ### --with-mpi=MPI_ROOT ### AC_MSG_CHECKING([mpi]) AC_ARG_WITH(mpi, [ --with-mpi=MPI_ROOT MPI root directory [[default=disable]]], [with_mpi="${withval}" if test x"${withval}" = x'yes'; then mpicc="mpicc" else mpicc="${with_mpi}/bin/mpicc" fi AC_MSG_RESULT([using \"${mpicc}\"]) # for conditional compilation which depends on whether MPI is enabled or not mpi_srcs='${MPI_SRCS}' mpi_objs='${MPI_OBJS}' mpi_cflags='${MPI_CFLAGS}' mpi_targets='${MPI_TARGETS}' ], [AC_MSG_RESULT([disabled]) with_mpi= mpicc= # for conditional compilation which depends on whether MPI is enabled or not mpi_srcs= mpi_objs= mpi_cflags= mpi_targets= ]) AC_SUBST(mpicc) # for conditional compilation which depends on whether globus is enabled or not AC_SUBST(mpi_srcs) AC_SUBST(mpi_objs) AC_SUBST(mpi_cflags) AC_SUBST(mpi_targets) ### The following options are all "ns" specific ### ### --with-readline=READLINE_ROOT ### AC_MSG_CHECKING([readline]) AC_ARG_WITH(readline, [ --with-readline=READLINE_ROOT readline root directory [[default=disable]]], [with_readline="${withval}" ], [with_readline= ]) readline_specified= case ${with_readline} in /*) if test -f "${with_readline}"/include/readline/readline.h; then readline_specified=explicit else AC_MSG_ERROR([not found in \"${with_readline}\", aborted]) fi;; yes) for d in /usr/local /usr/pkg /usr do if test -f $d/include/readline/readline.h; then with_readline=$d readline_specified=yes break fi done;; no|'') ;; *) readline_specified=explicit;; esac readline_includes= readline_libs= if test x"${readline_specified}" = x""; then AC_MSG_RESULT([no]) else AC_MSG_RESULT([using \"${with_readline}\"]) AC_DEFINE(HAVE_READLINE, 1, [readline-compatible library exists]) readline_libs="-lreadline -ltermcap" case ${with_readline} in /usr) ;; /*) readline_includes="-I${with_readline}/include ${readline_includes}" readline_libs="-R${with_readline}/lib -L${with_readline}/lib ${readline_libs}" ;; *) readline_includes=${with_readline} readline_libs=${with_readline} ;; esac fi AC_SUBST(readline_includes) AC_SUBST(readline_libs) ### ### --with-default-ns-server=HOSTNAME ### AC_ARG_WITH(default_ns_server, [ --with-default-ns-server=HOSTNAME default hostname of ns server [[default=localhost]]], [default_ns_server="${withval}"], [default_ns_server='localhost']) AC_SUBST(default_ns_server) ### ### --with-default-ns-port=PORTNUMBER ### AC_ARG_WITH(default_ns_port, [ --with-default-ns-port=PORTNUMBER default port number of ns server [[default=5000]]], [default_ns_port="${withval}"], [default_ns_port='5000']) AC_SUBST(default_ns_port) ### ### --with-default-ns-exec-root=DIR ### AC_ARG_WITH(default_ns_exec_root, [ --with-default-ns-exec-root=DIR default top directory of ns_exec [[default=PREFIX]]], [default_ns_exec_root="${withval}" default_ns_exec_bindir="${default_ns_exec_root}/bin" ], [default_ns_exec_root='$(prefix)' default_ns_exec_bindir='$(bindir)' ]) AC_SUBST(default_ns_exec_root) AC_SUBST(default_ns_exec_bindir) ### ### --with-gfarm-rsh=RSH_COMMAND ### AC_ARG_WITH(gfarm_rsh, [ --with-gfarm-rsh=RSH command name equivalent to rsh [[default=rsh]]], [gfarm_rsh="${withval}"], [gfarm_rsh='rsh']) AC_SUBST(gfarm_rsh) ### ### --with-gfarmd-username=DIR ### AC_ARG_WITH(gfarmd_username, [ --with-gfarmd-username=DIR default username of gfarmd [[default=nobody]]], [gfarmd_username="${withval}"], [gfarmd_username='nobody']) AC_SUBST(gfarmd_username) ### ### --without-mtsafe-netdb ... are getaddrinfo(3) and getnameinfo(3) MT-Safe? ### AC_ARG_WITH(mtsafe_netdb, [ --without-mtsafe-netdb getaddrinfo(3) and getnameinfo(3) are MT-Safe? [[default=yes]]], [mtsafe_netdb="${withval}"], [mtsafe_netdb="yes"]) case ${mtsafe_netdb} in no) :;; *) AC_DEFINE(HAVE_MTSAFE_NETDB, 1, [getaddrinfo(3) and getnameinfo(3) are MT-Safe]);; esac ###### ###### Checks for libraries. ###### ### check sanity of $CC, $CFLAGS and $CPPFLAGS AC_CHECK_HEADERS(stdio.h) if test x"${ac_cv_header_stdio_h}" != x"yes"; then AC_MSG_RESULT([preprocessor option error on: \"$ac_cpp\"]) #exit 1 fi ### check sanity of $CC, $CFLAGS, $CPPFLAGS and $LDFLAGS setting AC_CHECK_FUNCS(printf) if test x"${ac_cv_func_printf}" != x"yes"; then AC_MSG_RESULT([linker option error on: \"$ac_link\"]) exit 1 fi # We need to add those libraries to $LIBS at first, # otherwise some libraries (e.g. OpenLDAP and OpenSSL) cannot be linked. AC_CHECK_LIB(dl, dlopen) AC_CHECK_LIB(nsl, gethostname) # SVR4 and derived AC_CHECK_LIB(socket, socket) # SVR4 and derived AC_CHECK_LIB(crypt, crypt) # 4.4BSD and derived AC_CHECK_LIB(compat, cuserid) # NetBSD AC_CHECK_LIB(gen, basename) # IRIX AC_CHECK_LIB(rt, fdatasync) # Solaris AC_CHECK_LIB(cext, seteuid) # HP-UX AC_CHECK_LIB(perfstat, perfstat_cpu_total) # AIX, to implement getloadavg() # have pthread_attr_setstacksize(3)? case ${ax_cv_have_pthread} in yes) AC_MSG_CHECKING([for pthread_attr_setstacksize]) CPPFLAGS_SAVE="$CPPFLAGS" LIBS_SAVE="$LIBS" CPPFLAGS="${pthread_includes} $CPPFLAGS" LIBS="$LIBS ${pthread_libs}" AC_TRY_LINK([ # include void test(void){}],[ pthread_attr_t at; if (pthread_attr_init(&at) == 0) pthread_attr_setstacksize(&at, 64 * 1024); ], [ AC_MSG_RESULT([yes]) AC_DEFINE(HAVE_PTHREAD_ATTR_SETSTACKSIZE, 1, [pthread_attr_setstacksize() exists]) ], [ AC_MSG_RESULT([no]) ]) CPPFLAGS="$CPPFLAGS_SAVE" LIBS="$LIBS_SAVE" ;; esac # Since gfarm-1.3, libgfarm calls pthread functions internally, # thus, we need to link ${pthread_libs}, unless libc supplies weak symbols. # e.g. using 3rd party pthread library, FreeBSD-4.x, or NetBSD-2.x AC_MSG_CHECKING([whether libc supplies weak symbols for pthread]) AC_TRY_LINK([ #include void init(void){}],[ pthread_once_t once; pthread_once(&once, init); ], [ AC_MSG_RESULT([yes]) ], [ AC_MSG_RESULT([no. WARNING: always link pthread]) LIBS="${LIBS} ${pthread_libs}" ]) ### use 64bit off_t, if possible. AC_MSG_CHECKING([Large File extention for 64bit off_t]) if ( getconf LFS_CFLAGS && getconf LFS_LDFLAGS && getconf LFS_LIBS ) > /dev/null 2>&1; then AC_MSG_RESULT([yes]) largefile_cflags="`getconf LFS_CFLAGS`" largefile_ldflags="`getconf LFS_LDFLAGS`" LIBS="$LIBS `getconf LFS_LIBS`" if test x"$host_os" = x"linux-gnu"; then # glibc requires _GNU_SOURCE for pwrite64(2) largefile_cflags="${largefile_cflags} -D_GNU_SOURCE" fi else AC_MSG_RESULT([no]) largefile_cflags= largefile_ldflags= fi AC_SUBST(largefile_cflags) AC_SUBST(largefile_ldflags) ### is _LARGEFILE64_SOURCE API supported? i.e. can be _LFS64_LARGEFILE=1? AC_MSG_CHECKING([_LARGEFILE64_SOURCE API]) if ( getconf LFS64_CFLAGS && getconf LFS64_LDFLAGS && getconf LFS64_LIBS ) > /dev/null 2>&1; then AC_MSG_RESULT([yes]) largefile64_srcs='${LARGEFILE64_SRCS}' largefile64_objs='${LARGEFILE64_OBJS}' largefile64_cflags='${LARGEFILE64_CFLAGS}' largefile64_targets='${LARGEFILE64_TARGETS}' else AC_MSG_RESULT([no]) largefile64_srcs= largefile64_objs= largefile64_cflags= largefile64_targets= fi # for conditional compilation which depends on _LARGEFILE64_SOURCE API AC_SUBST(largefile64_srcs) AC_SUBST(largefile64_objs) AC_SUBST(largefile64_cflags) AC_SUBST(largefile64_targets) ### sanity check whether OpenSSL is really usable or not AC_MSG_CHECKING([openssl]) CPPFLAGS_SAVE="$CPPFLAGS" LIBS_SAVE="$LIBS" CPPFLAGS="${openssl_includes} $CPPFLAGS_SAVE" # -R is not portable without libtool, and not necessary for AC_TRY_LINK LIBS="`echo ${openssl_libs} | sed 's/-R[[^ ]]*//g'` $LIBS_SAVE" AC_TRY_LINK([ #include ],[ EVP_MD_CTX md_ctx; EVP_MD *md_type = EVP_get_digestbyname("sha1"); EVP_DigestInit(&md_ctx, md_type); ], [], [ AC_MSG_ERROR([OpenSSL cannot be linked with \"${openssl_includes} ${openssl_libs}\" options, aborted]) ]) CPPFLAGS="$CPPFLAGS_SAVE" LIBS="$LIBS_SAVE" AC_MSG_RESULT([using \"${openssl_includes} ${openssl_libs}\"]) ### ### --with-openldap=OpenLDAP_ROOT ### # This command line option must be handled here, # because this needs AC_CHECK_LIB(nsl, ...) AC_MSG_CHECKING([openldap]) AC_ARG_WITH(openldap, [ --with-openldap=OpenLDAP_ROOT openldap root directory [[default=guessed]] --without-openldap disable openldap], [with_openldap="${withval}" ], [with_openldap= ]) ldap_specified= case ${with_openldap} in /*) if test -f "${with_openldap}"/include/ldap.h; then ldap_specified=explicit else AC_MSG_ERROR([not found in \"${with_openldap}\", aborted]) fi;; yes|'') for d in /usr/local/openldap /usr/local /usr/pkg /usr do if test -f $d/include/ldap.h; then with_openldap=$d ldap_specified=yes break fi done;; no) ;; *) ldap_specified=explicit;; esac ldap_usable= if test x"${ldap_specified}" = x""; then AC_MSG_RESULT([no]) else AC_DEFUN([AC_TRY_LDAP], [ CPPFLAGS_SAVE="$CPPFLAGS" LIBS_SAVE="$LIBS" CPPFLAGS="$1 $CPPFLAGS_SAVE" # -R is not portable without libtool, and not necessary for AC_TRY_LINK LIBS="`echo $2 | sed 's/-R[[^ ]]*//g'` $3 $4 ${openssl_libs} $LIBS_SAVE" # OpenLDAP may need OpenSSL due to its SSL/TLS support. AC_TRY_LINK([ #include #include ],[ LDAP *ldap_server = ldap_open("example.com", 389); ], [ if test x"$4" != x""; then AC_MSG_RESULT([using \"$1 $2 $3\" with \"$4\" for LDAP]) ldap_libs="$2 $3 $4" else AC_MSG_RESULT([using \"$1 $2 $3\" for LDAP]) ldap_libs="$2 $3" fi ldap_usable=yes # this needs to be checked here due to settings of $CPPFLAGS and $LIBS AC_CHECK_FUNCS(ldap_memfree ldap_set_option ldap_start_tls_s ldap_perror) ], []) CPPFLAGS="$CPPFLAGS_SAVE" LIBS="$LIBS_SAVE" ]) case ${with_openldap} in /*) case ${with_openldap} in /usr) ldap_includes= ldap_libs=;; *) ldap_includes="-I${with_openldap}/include" ldap_libs="-R${with_openldap}/lib -L${with_openldap}/lib";; esac # OpenLDAP since 2.x calls res_query() and dn_expand(), if dnssrv is # configured, and DNS resolver library doesn't belongs to libc on some # systems. # But we cannot blindly link libresolv, because it may change behaviour # of gethostbyname() and friends. for libs in "-lldap -llber" "-lldap"; do for extra_lib in "" "-lresolv" "-lbind"; do AC_TRY_LDAP(${ldap_includes},${ldap_libs},${libs},${extra_lib}) if test x"${ldap_usable}" = x"yes"; then break 2 fi done done ;; *) ldap_includes=${with_openldap} ldap_libs=${with_openldap} AC_TRY_LDAP(${ldap_includes},${ldap_libs},,) ;; esac if test x"${ldap_usable}" != x"yes"; then case $ldap_specified in explicit) AC_MSG_ERROR([\"${with_openldap}\" is specified, but cannot be linked, aborted]);; yes) AC_MSG_RESULT([found in \"${with_openldap}\", but cannot be linked, ignored]);; esac fi fi case $ldap_usable in yes) AC_DEFINE(HAVE_LDAP, 1, [LDAP library exists]) ldap_srcs='${LDAP_SRCS}' ldap_objs='${LDAP_OBJS}' ldap_cflags='${LDAP_CFLAGS}' ldap_targets='${LDAP_TARGETS}' ;; *) ldap_includes= ldap_libs= ldap_srcs= ldap_objs= ldap_cflags= ldap_targets= ;; esac AC_SUBST(ldap_includes) AC_SUBST(ldap_libs) # for conditional compilation which depends on LDAP AC_SUBST(ldap_srcs) AC_SUBST(ldap_objs) AC_SUBST(ldap_cflags) AC_SUBST(ldap_targets) ### ### --with-postgresql=PostgreSQL_ROOT ### AC_MSG_CHECKING([PostgreSQL]) AC_ARG_WITH(postgresql, [ --with-postgresql=PostgreSQL_ROOT PostgreSQL root directory [[default=guessed]] --without-postgresql disable PostgreSQL], [with_postgresql="${withval}" ], [with_postgresql= ]) postgresql_specified= case ${with_postgresql} in /*) if test -f "${with_postgresql}"/bin/pg_config; then postgresql_specified=explicit else AC_MSG_ERROR([not found in \"${with_postgresql}\", aborted]) fi;; yes|'') for d in /usr/local/pgsql /usr/local /usr/pkg /usr do if test -f $d/bin/pg_config; then with_postgresql=$d postgresql_specified=yes break fi done;; no) ;; *) postgresql_specified=explicit;; esac postgresql_usable= if test x"${postgresql_specified}" = x""; then AC_MSG_RESULT([no]) else if test -x ${with_postgresql}/bin/pg_config; then if ! ${with_postgresql}/bin/pg_config --version > /dev/null 2>&1; then AC_MSG_RESULT([failed to call ${with_postgresql}/bin/pg_config command.]) AC_MSG_ERROR([PostgreSQL installation is incomplete, aborted.]) fi postgresql_include_dir=`${with_postgresql}/bin/pg_config --includedir` postgresql_lib_dir=`${with_postgresql}/bin/pg_config --libdir` case ${postgresql_include_dir} in /usr/include) postgresql_includes= ;; *) postgresql_includes="-I${postgresql_include_dir}" ;; esac case ${postgresql_lib_dir} in /usr/lib) postgresql_libs="-lpq" ;; *) postgresql_libs="-R${postgresql_lib_dir} -L${postgresql_lib_dir} -lpq" ;; esac else postgresql_includes="${with_postgresql}" postgresql_libs="${with_postgresql}" fi CPPFLAGS_SAVE="$CPPFLAGS" LIBS_SAVE="$LIBS" CPPFLAGS="${postgresql_includes} $CPPFLAGS_SAVE" # -R is not portable without libtool, and not necessary for AC_TRY_LINK LIBS="`echo $postgresql_libs | sed 's/-R[[^ ]]*//g'` $LIBS_SAVE" AC_TRY_LINK([ #include #include ],[ PGconn *conn = PQconnectdb(""); PGresult *res = PQexecParams(conn, "", 0, NULL, NULL, NULL, NULL, 0); ], [ postgresql_usable=yes AC_MSG_RESULT([using \"${with_postgresql}\"]) ], [ case $postgresql_specified in explicit) AC_MSG_ERROR([\"${with_postgresql}\" is specified, but cannot be linked, aborted]);; yes) AC_MSG_RESULT([found in \"${with_postgresql}\", but cannot be linked, ignored]);; esac ]) CPPFLAGS="$CPPFLAGS_SAVE" LIBS="$LIBS_SAVE" fi case $postgresql_usable in yes) AC_DEFINE(HAVE_POSTGRESQL, 1, [PostgreSQL library exists]) postgresql_srcs='${POSTGRESQL_SRCS}' postgresql_objs='${POSTGRESQL_OBJS}' postgresql_cflags='${POSTGRESQL_CFLAGS}' postgresql_targets='${POSTGRESQL_TARGETS}' ;; *) postgresql_includes= postgresql_libs= postgresql_srcs= postgresql_objs= postgresql_cflags= postgresql_targets= ;; esac AC_SUBST(postgresql_includes) AC_SUBST(postgresql_libs) # for conditional compilation which depends on PostgreSQL AC_SUBST(postgresql_srcs) AC_SUBST(postgresql_objs) AC_SUBST(postgresql_cflags) AC_SUBST(postgresql_targets) ### ### sanity check. We need either PostgreSQL or LDAP. ### if test x"${ldap_usable}" != x"yes" && test x"${postgresql_usable}" != x"yes" then AC_MSG_RESULT([WARNING: neither LDAP or PostgreSQL is found]) fi ###### ###### Checks for header files. ###### AC_CHECK_HEADERS(inttypes.h shadow.h crypt.h machine/endian.h sys/loadavg.h) ###### ###### Checks for types. ###### AC_C_BIGENDIAN AC_CHECK_SIZEOF(long) AC_CHECK_SIZEOF(long long) ### socklen_t is available? AC_MSG_CHECKING([socklen_t]) case $host_os_nickname in hpux) # There are two ways to deal with socklen_t on HP-UX 11i. # 1. Use system supplied socklen_t. # This requires CPPFLAGS=-D_XOPEN_SOURCE_EXTENDED and LIBS=-lxnet. # 2. Use int. # This is incompatible with both -D_XOPEN_SOURCE_EXTENDED and -lxnet. # socklen_t had been also usable for the case 2 on HP-UX before LP64 support. # But this is no longer true on LP64 HP-UX, because socklen_t is now always # size_t on HP-UX, and size_t is uint64_t on LP64 systems. The problem is # that 1 and 2 are incompatible, and cannot be linked each other. # We choose 2 here, because that seems to be the way most third party # libraries are using now. ax_cv_have_socklen_t=no # don't try linking, it's linkable, but doesn't work. ;; *) AC_TRY_LINK([ # include # include ],[ int rv, s = socket(PF_INET, SOCK_STREAM, 0); struct sockaddr addr; socklen_t len; rv = getpeername(s, &addr, &len); ], [ax_cv_have_socklen_t=yes], [ax_cv_have_socklen_t=no]) ;; esac if test "$ax_cv_have_socklen_t" = yes; then AC_MSG_RESULT([yes]) else # determine size of socklen_t AC_TRY_RUN([ # include # include main() { struct msghdr h; /* h.msg_namelen should be socklen_t */ h.msg_namelen = -1; if (sizeof(h.msg_namelen) == sizeof(int) && h.msg_namelen < 0) return (0); /* int */ else return (1); /* size_t */ } ], [ax_cv_socklen_t=int], [ax_cv_socklen_t=size_t]) AC_MSG_RESULT([$ax_cv_socklen_t]) AC_DEFINE_UNQUOTED(socklen_t, $ax_cv_socklen_t, [3rd argument type of bind(2)/connect(2), if doesn't define]) fi ###### ###### Checks for structures. ###### AC_MSG_CHECKING([struct dirent::d_off]) AC_TRY_COMPILE([ #include #include ],[ struct dirent d; long off; off = d.d_off; ], [ax_cv_have_d_off=yes], [ax_cv_have_d_off=no]) AC_MSG_RESULT([$ax_cv_have_d_off]) if test "$ax_cv_have_d_off" = yes; then AC_DEFINE(HAVE_D_OFF, 1, [struct dirent has d_off member]) fi AC_MSG_CHECKING([struct dirent::d_namlen]) AC_TRY_COMPILE([ #include #include ],[ struct dirent d; int len; len = d.d_namlen; ], [ax_cv_have_d_namlen=yes], [ax_cv_have_d_namlen=no]) AC_MSG_RESULT([$ax_cv_have_d_namlen]) if test "$ax_cv_have_d_namlen" = yes; then AC_DEFINE(HAVE_D_NAMLEN, 1, [struct dirent has d_namlen member]) fi AC_MSG_CHECKING([struct dirent::d_type]) AC_TRY_COMPILE([ #include #include ],[ struct dirent d; int len; len = d.d_type; ], [ax_cv_have_d_type=yes], [ax_cv_have_d_type=no]) AC_MSG_RESULT([$ax_cv_have_d_type]) if test "$ax_cv_have_d_type" = yes; then AC_DEFINE(HAVE_D_TYPE, 1, [struct dirent has d_type member]) fi ###### Checks for compiler characteristics. # empty for now ###### ###### Checks for library functions. ###### AC_CHECK_FUNCS(getdents fdatasync fdopendir poll pread pwrite snprintf getpassphrase mkdtemp setlogin strtoll strtoq setrlimit daemon getloadavg statvfs statfs random) ### Check epoll_create really implemented AC_MSG_CHECKING([for epoll]) AC_RUN_IFELSE([ #include int main() { return (epoll_create(5) == -1); }], [ax_cv_func_epoll=yes], [ax_cv_func_epoll=no], [ax_cv_func_epoll=no]) AC_MSG_RESULT([$ax_cv_func_epoll]) if test "$ax_cv_func_epoll" = yes; then AC_DEFINE(HAVE_EPOLL, 1, [Define to 1 if epoll functions are implemented.]) fi ### SUSv2 getpwnam_r() has 5 args, but Solaris's only has 4. AC_MSG_CHECKING([SUSv2 compliant getpwnam_r]) AC_TRY_LINK([ #include #include ],[ int rv; struct passwd *pwd; char buffer[1024]; rv = getpwnam_r("root", pwd, buffer, sizeof buffer, &pwd); ], [ax_cv_have_getpwnam_r=yes], [ax_cv_have_getpwnam_r=no]) AC_MSG_RESULT([$ax_cv_have_getpwnam_r]) if test "$ax_cv_have_getpwnam_r" = yes; then AC_DEFINE(HAVE_GETPWNAM_R, 1, [5 arguments getpwnam_r() which is compatible with SUSv2 exists]) fi ### SUSv2 getspnam_r() has 5 args, but Solaris's only has 4. AC_MSG_CHECKING([SUSv2 compliant getspnam_r]) AC_TRY_LINK([ #include ],[ int rv; struct spwd *sp; char buffer[1024]; rv = getspnam_r("root", sp, buffer, sizeof buffer, &sp); ], [ax_cv_have_getspnam_r=yes], [ax_cv_have_getspnam_r=no]) AC_MSG_RESULT([$ax_cv_have_getspnam_r]) if test "$ax_cv_have_getspnam_r" = yes; then AC_DEFINE(HAVE_GETSPNAM_R, 1, [5 arguments getspnam_r() exists]) fi ### Solaris no longer defines sys_nerr/sys_errlist AC_MSG_CHECKING([sys_nerr]) AC_TRY_LINK([ #include #include ],[ int i = sys_nerr; ], [ax_cv_have_sys_nerr=yes], [ax_cv_have_sys_nerr=no]) AC_MSG_RESULT([$ax_cv_have_sys_nerr]) if test "$ax_cv_have_sys_nerr" = yes; then AC_DEFINE(HAVE_SYS_NERR, 1, [sys_nerr is defined]) fi ###### Checks for system services. # empty for now ###### ###### miscellaneous ###### ### ### config.h template ### AH_TOP([ #ifndef GFARM_CONFIG_H #define GFARM_CONFIG_H ]) AH_BOTTOM([ /* Grid Security Infrastructure exists */ #undef HAVE_GSI /* 5 arguments getpwnam_r() which is compatible with SUSv2 exists */ #undef HAVE_GETPWNAM_R /* 5 arguments getspnam_r() exists */ #undef HAVE_GETSPNAM_R /* sys_nerr is defined */ #undef HAVE_SYS_NERR /* 3rd argument type of bind(2)/connect(2), if doesn't define */ #undef socklen_t #if SIZEOF_LONG == 8 typedef long gfarm_int64_t; typedef unsigned long gfarm_uint64_t; # define GFARM_INT64_MAX 0x7fffffffffffffffL # define GFARM_PRId64 "ld" # define gfarm_strtoi64(s, endptr) strtol(s, endptr, 0) #elif SIZEOF_LONG_LONG == 8 typedef long long gfarm_int64_t; typedef unsigned long long gfarm_uint64_t; # define GFARM_INT64_MAX 0x7fffffffffffffffLL # define GFARM_PRId64 "lld" # define gfarm_strtoi64(s, endptr) strtoll(s, endptr, 0) #else error! cannot find 64bit integer type #endif #endif /* GFARM_CONFIG_H */ ]) ### ### lib/gfs_hook ### # need to make system dependent source? gfs_hook_sysdep=lib/gfs_hook/sysdep/${host_os_nickname} if test -f ${srcdir}/${gfs_hook_sysdep}/Makefile; then AC_MSG_RESULT([using ${gfs_hook_sysdep} directory for system dependent objects.]) gfs_hook_sysdep_subdir=${host_os_nickname} else gfs_hook_sysdep_subdir=default fi AC_SUBST(gfs_hook_sysdep_subdir) ### ### gftool/config-gfarm ### config_gfarm_sysdep=gftool/config-gfarm/sysdep/${host_os_nickname} if test -f ${srcdir}/${config_gfarm_sysdep}/Makefile; then AC_MSG_RESULT([using ${config_gfarm_sysdep} directory for system dependent part of config-gfarm.]) config_gfarm_sysdep_subdir=${host_os_nickname} else config_gfarm_sysdep_subdir=default fi AC_SUBST(config_gfarm_sysdep_subdir) ### ### --enable-voms ### AC_ARG_ENABLE(voms, AS_HELP_STRING([--enable-voms],[Enable voms collaboration.[[default=yes]]]), [if test "${enable_voms}" = "yes"; then AC_CHECK_PROG(PYTHON_SPECIFIED, python, yes, no) gfvoms_sync_targets='' AC_MSG_CHECKING(voms-collaboration available) voms_available="no" if test "${PYTHON_SPECIFIED}" = "yes" ;then py_ver=`python -V 2>&1 | sed -e 's/Python \([[0-9\.]]*\).*/\1/'` case $py_ver in 2.[[3456]].*) imp_path=`python -c "import sys; print sys.path" | sed -e 's/^\[[\(.*\)\]]$/\1/' | sed -e "s/[[,']]//g"` found=0 for d in $imp_path do if test -d $d/ZSI ; then found=1 break 1 fi done if test $found -eq 0 ; then break 1 fi found=0 for d in $imp_path do if test -d $d/_xmlplus ; then found=1 break 1 fi done if test $found -eq 0 ; then break 1 fi imp_test=`python -c "import ZSI" 2>&1` if test ${#imp_test} == 0; then gfvoms_sync_targets='${GFVOMS_SYNC_TARGETS}' voms_available="yes" fi ;; esac fi AC_MSG_RESULT(${voms_available}) else gfvoms_sync_targets='' fi ], [gfvoms_sync_targets='' ]) AC_SUBST(gfvoms_sync_targets) ### ### --enable-xmlattr support XML extended attributs and searching by XPath ### AC_ARG_ENABLE(xmlattr, AS_HELP_STRING([--enable-xmlattr],[support XML extended attributs and searching by XPath.[[default=yes]]]), [if test "${enable_xmlattr}" = "yes"; then AC_DEFINE(ENABLE_XMLATTR, 1, [support XML extended attributs and searching by XPath]) fi],[]) ### ### ns ### if test -d ${srcdir}/ns; then ns_makefiles=' ns/nslib/Makefile ns/gfarmd/Makefile ns/nstool/file/Makefile' # The following is for --srcdir option. # AC_OUTPUT() assumes that parent directory of the Makefile exists test -d ns || mkdir ns test -d ns/nstool || mkdir ns/nstool fi ### ### --with-private-srcdir ### private_srcdir='' AC_MSG_CHECKING([use of private source directory]) AC_ARG_WITH(private_srcdir, [ --with-private-srcdir=DIR private source directory ], [private_srcdir="${withval}" ], [private_srcdir="" ]) top_private_dir='' if test "x${private_srcdir}" = "x"; then AC_MSG_RESULT([not use.]) else if test -d "${private_srcdir}"; then top_private_dir="`(cd ${private_srcdir}; /bin/pwd)`" AC_MSG_RESULT([use ${top_private_dir}]) else AC_MSG_RESULT([${private_srcdir} is not a directory.]) exit 1 fi fi AC_SUBST(top_private_dir) if test "x${top_private_dir}" = "x"; then # use public source directory. optional_config=/dev/null optional_rule='${PUBLIC_RULE}' optional_srcs='${PUBLIC_SRCS}' optional_objs='${PUBLIC_OBJS}' optional_cflags='${PUBLIC_CFLAGS}' optional_targets='${PUBLIC_TARGETS}' else # use private source directory. optional_config='${top_private_dir}/private_config.mk' optional_rule='${PRIVATE_RULE}' optional_srcs='${PRIVATE_SRCS}' optional_objs='${PRIVATE_OBJS}' optional_cflags='${PRIVATE_CFLAGS}' optional_targets='${PRIVATE_TARGETS}' fi AC_SUBST(optional_config) AC_SUBST(optional_rule) AC_SUBST(optional_srcs) AC_SUBST(optional_objs) AC_SUBST(optional_cflags) AC_SUBST(optional_targets) ## ## private sources macros end here. ## # The following is for --srcdir option. # AC_OUTPUT() assumes that parent directory of the Makefile exists test -d include || mkdir include test -d gfptool || mkdir gfptool test -d package || mkdir package test -d util || mkdir util AC_CONFIG_FILES(Makefile makes/config.mk makes/install-doc ${ns_makefiles} gftool/config-gfarm/config-gfarm gftool/config-gfarm/config-gfsd gftool/config-gfarm/config-gfarm-update gftool/gfdump/gfdump.postgresql package/solaris/gfmd package/solaris/gfsd ) AC_OUTPUT gfarm-2.4.1/SETUP.en0000644000000000000000000003453511507222727012553 0ustar rootroot Gfarm Filesystem Setup Manual About this document =================== This document describes how to configure the Gfarm filesystem. For users who would like to configure a Gfarm filesystem by a non privileged user, refer to SETUP.private.en. Please install the Gfarm software before using this manual, By using either INSTALL.en, for installation from the source code, or INSTALL.RPM.en, for installation from the RPM binary packages. If problems occur, please refer to the Trouble Shooting section in Gfarm-FAQ.en. Overview ======== To introduce the Gfarm filesystem, configure a metadata server, and filesystem nodes have to be configured, and register users, administrators and root users. Quick Start =========== Configuration of a Gfarm metadata server (MDS) # config-gfarm -A # useradd -c "Gfarm gfsd" _gfarmfs # su _gfarmfs $ gfkey -f -p 31536000 Configuration of a Gfarm filesystem node # useradd -c "Gfarm gfsd" _gfarmfs Copy ~_gfarmfs/.gfarm_shared_key from the MDS Copy /etc/gfarm2.conf from the MDS # config-gfsd Ask administrators to register the filesystem node # /etc/init.d/gfsd start Configuration of a Gfarm client node Copy /etc/gfarm2.conf from the MDS $ gfkey -f -p 31536000 Copy a shared secret key ~/.gfarm_shared_key to the MDS, all file system nodes Registration of Users $ gfuser -c username realname homedir gsi_dn $ gfmkdir homedir $ gfchown username homedir Registration of Administrators $ gfgroup -m gfarmadm user1 user2 ... Registration of Root users $ gfgroup -m gfarmroot user1 user2 ... Configuration of a Gfarm metadata server (MDS) ============================================== To set up a Gfarm file system, the root privilege is required. To begin with, the following information is required: - a global username of an administrator [-A] - a subject DN of an administrator [-D] (for GSI auth only) The global username is a unique user name used in Gfarm file system to share files among several administrative domains having different account names. When you log on as a normal user and change to the root privilege by 'su', the normal user account name is used as a global username of the administrator by default. In case of the shared secret authentication, the default mapping from a local account to a global username is identical. A user having the same account name as the global username is an administrator by default. This mapping can be managed by a user mapfile that is specified by 'local_user_map' directive in gfarm2.conf. In case of GSI, a user having the specified subject DN is an administrator for a Gfarm file system. Run 'config-gfarm' to configure a Gfarm filesystem. First, make sure of the default setting with the -t option. With the -t option, nothing is really executed except for the display of the settings for configuration. # config-gfarm -t -A -a gsi_auth -D The -a and -D options are only required for GSI authentication. The -a option specifies the authentication method in Gfarm file system. The default is shared secret authentication (sharedsecret). For details, refer to a manual page of gfarm2.conf(5) and Gfarm-FAQ.en. You can modify any default parameter with the option shown in [ ]. When you have confirmed the parameter, run 'config-gfarm' by the root user without the -t option. config-gfarm sets up the backend database, creates a Gfarm configuration file, /etc/gfarm2.conf and /etc/gfmd.conf, and executes the Gfarm metadata server gfmd. 'prefix' is used to configure several Gfarm filesystems. It generates all configuration files under the specified directory. When you use the shared secret authentication between gfsd and gfmd, it is necessary to create a '_gfarmfs' user and a shared secret key. # useradd -c "Gfarm gfsd" _gfarmfs We recommend to create a home directory in NFS if available. Create a shared secret key '~/.gfarm_shared_key' for the _gfarmfs user in the home directory. # su _gfarmfs $ gfkey -f -p 31536000 This example sets up an expiration date of about one year (31536000 seconds). You can check whether the metadata server gfmd is running or not by the following command execution; # /etc/init.d/gfmd status For the automatic startup during the boot process, chkconfig command is useful in Red Hat Linux. # chkconfig --add gfmd # chkconfig --add gfarm-pgsql (or # chkconfig --add gfarm-slapd) For debian, use update-rc.d instead of chkconfig. # update-rc.d gfmd defaults # update-rc.d gfarm-pgsql defaults (or # update-rc.d gfarm-slapd defaults) If you would like to remove all files created by config-gfarm, first stop gfmd and backend database server; # /etc/init.d/gfmd stop (or # killall gfmd) # /etc/init.d/gfarm-pgsql stop (or # /etc/init.d/gfarm-slapd stop) Then, remove files and directories as follows; # rm -f /etc/gfarm2.conf /etc/gfmd.conf # rm -f /etc/init.d/gfarm-* /etc/init.d/gfmd # rm -rf /var/gfarm-* o Firewall configuration The Gfarm metadata server should be able to accept TCP connections at a port that are specified by the -m option of the config-gfarm command. Configuration of a Gfarm filesystem node ======================================== To set up a Gfarm filesystem node, the root privilege is required. Create a '_gfarmfs' user if not exist. This user is a system account for a gfsd I/O daemon. # useradd -c "Gfarm gfsd" _gfarmfs In case of the shared secret authentication, copy the shared secret key .gfarm_shared_key in the _gfarmfs's directory from the metadata server if the home directory is not shared. Note that the permission of .gfarm_shared_key should be '0600' and the owner should be '_gfarmfs'. In case of the GSI authentication, obtain a service certificate for the gfsd. Copy the certificate to /etc/grid-security/gfsd/gfsd{cert,key}.pem and change the owner to '_gfarmfs'. The permission of gfsdkey.pem should be 0400. Copy /etc/gfarm2.conf from the metadata server that is created by 'config-gfarm'. Run 'config-gfsd' to set up a spool directory in a local filesystem on the filesystem node, and register it in the metadata server. First, make sure of the default setting with the -t option. With the -t option, nothing is really executed except for display of the settings for configuration. # config-gfsd -t /var/gfarm You can modify any default parameter by using the option shown in [ ]. The last argument of config-gfsd is a spool directory, which stores physical files in Gfarm file system. Note that the spool directory should be a non-shared area among filesystem nodes. When you have confirmed the parameter, run 'config-gfsd' by the root user without the -t option. # config-gfsd /var/gfarm config-gfsd displays a command line of 'gfhost' that would be executed by an administrator in Gfarm file system. Ask the administrator to execute the displayed text. The administrator should execute the gfhost command as a global user specified by config-gfarm command on the metadata server host. In case of the shared secret authentication, it is a local account of the same name or mapped by a user mapfile. In case of GSI, use a user certificate specified by the -D option of config-gfarm. $ /usr/bin/gfhost -c -a i386-fedora5-linux -p 600 -n 2 node1.example.org In case of GSI, add a service certificate of the gfsd in /etc/grid-security/grid-mapfile of a metadata server in the following format. '@host@' is a fixed string. It cannot be changed. Please note that the "CN=" part of the distinguished name must be "gfsd/" format. For example, it must be "CN=gfsd/linux-1.example.com" for a filesystem node "linux-1.example.com". "Subject DN of gfsd server cert" @host@ FQDN Start gfsd by the root user. # /etc/init.d/gfsd start You can check whether the gfsd is running or not by the following command execution; # /etc/init.d/gfmd status For the automatic startup during the boot process, chkconfig command is useful in Red Hat Linux. # chkconfig --add gfsd For debian, use update-rc.d instead of chkconfig. # update-rc.d gfsd defaults If you would like to remove all files created by config-gfsd, first stop gfsd; # /etc/init.d/gfsd stop Then, remove files and directories as follows; # rm -f /etc/gfarm2.conf /etc/init.d/gfsd # rm -rf o Firewall configuration Filesystem nodes should be able to accept TCP connections and UDP packet reception and transmission at the port that is specified by the -p option of the config-gfsd command. Also, it requires the same settings as those of the client nodes. Configuration of a Gfarm client node ==================================== This chapter describes configuration for a client node. o Configuration of a client node Copy /etc/gfarm2.conf from the metadata server to the client node. This setting can be substituted for copying to ~/.gfarm2rc. In case of the shared secret authentication, if user's home directory is shared among metadata server and file system nodes, there is nothing to do. If not, .gfarm_shared_key needs to be create and copied among every nodes. In case of GSI, obtain the user certificate, and ask to add your entry into grid-mapfile of every file system node and a metadata server. o Firewall configuration Client nodes should be able to initiate TCP connections to the metadata server, at the port specified by the -m option of the config-gfarm command. Furthermore, they should be able to initiate TCP connections and should be able to send/receive UDP packets to filesystem nodes, from the port specified by the -p option of the config-gfsd command. Testing of the Gfarm filesystem =============================== You can check whether the Gfarm filesystem works or not using any client, since it can be accessed (or shared) by every client node. o gfls - Directory listing 'gfls' lists the contents of a directory. % gfls -la drwxrwxr-x gfarmadm gfarmadm 4 Aug 23 06:33 . drwxrwxr-x gfarmadm gfarmadm 4 Aug 23 06:33 .. drwxr-xr-x tatebe gfarmadm 0 Aug 22 16:08 tmp o gfhost - Filesystem node information 'gfhost -M' displays the information for filesystem nodes registered with the metadata server. % gfhost -M i386-fedora3-linux 2 linux-1.example.com 600 0 i386-fedora3-linux 2 linux-2.example.com 600 0 i386-fedora3-linux 2 linux-3.example.com 600 0 i386-redhat8.0-linux 1 linux-4.example.com 600 0 sparc-sun-solaris8 1 solaris-1.example.com 600 0 sparc-sun-solaris8 1 solaris-2.example.com 600 0 ... 'gfhost -l' displays the status of the filesystem nodes. % gfhost -l 0.01/0.03/0.03 s i386-fedora3-linux 2 linux-1.example.com 600 0(10.0.0.1) 0.00/0.00/0.00 s i386-fedora3-linux 2 linux-2.example.com 600 0(10.0.0.2) -.--/-.--/-.-- - i386-fedora3-linux 2 linux-3.example.com 600 0(10.0.0.3) 0.00/0.02/0.00 x i386-redhat8.0-linux 1 linux-4.example.com 600 0(10.0.0.4) 0.10/0.00/0.00 G sparc-sun-solaris8 1 solaris-1.example.com 600 0(10.0.1.1) x.xx/x.xx/x.xx - sparc-sun-solaris8 1 solaris-2.example.com 600 0(10.0.1.2) ... The second field shows the status of authentication with the filesystem node. 's', 'g', and 'G' show successful authentication, while 'x' shows an authentication failure. '-.--/-.--/-.--' in the first field shows that gfsd has not executed correctly, and 'x.xx/x.xx/x.xx' shows the filesystem node is probably down. o gfdf - display storage capacity 'gfdf' displays capacity of each file system node and the total capacity. % gfdf 1K-blocks Used Avail Capacity Host 1824815008 213068 1824601940 0% linux-1.example.com 6835798016 71836400 6763961616 1% linux-2.example.com 1669232308 44224088 1625008220 3% solaris-1.example.com --------------------------------------------- 10329845332 116273556 10213571776 1% For details of the above Gfarm commands, refer to the respective man page. User registration ================= Every user needs to be registered to access Gfarm file system by a Gfarm administrator. Besides, a Gfarm root user needs to create his home directory. A Gfarm administrator specified by config-gfarm is automatically registered during config-gfarm. Gfarm administrators are members of gfarmadm group. Gfarm root users are members of gfarmroot group. For user registration, execute gfuser command; % gfuser -c global_username realname homedir gsi_dn 'global_username' is a global user name in Gfarm file system. 'realname' is a name to identify the user. 'homedir' is a home directory in Gfarm. 'gsi_dn' is a subject DN of a user certificate used in GSI authentication. 'homedir' is not used for now. When 'realname' includes a space, it is necessary to quote. The following example registers a global user 'foo'; % gfuser -c foo "foo bar" /home/foo "" Next, it is necessary to create a home directory for the user. This should be done by a Gfarm root user. In the case of the above example, % gfmkdir /home % gfmkdir /home/foo % gfchown foo /home/foo Registration of Gfarm administrators and root users =================================================== Gfarm administrators manages file system nodes, users, and groups. Gfarm root users manages access control in Gfarm file system. Gfarm administrators are members of the gfarmadm group. The following command displays the current administrators. % gfgroup -l gfarmadm To change the members, use 'gfgroup -m' command. % gfgroup -m gfarmadm user1 user2 ... Note that 'gfgroup -m' replaces members with specified members. The old members are overwritten. Gfarm root users are members of the gfarmroot group. % gfgroup -m gfarmroot user1 user2 ... Further examples of advanced functionality ========================================== o File replica creation Each file in the Gfarm filesystem can have several file copies that can be stored on two and more filesystem nodes. Multiple file copies of the same file enables access to the file even when one of the filesystem nodes is down. Moreover, it enables prevention of access performance deterioration by allowing access to different file copies. The 'gfwhere' command displays the location of file copies, or a replica catalog, of the specified files. % gfwhere .bashrc linux-1.example.com The 'gfrep' command creates file copies. % gfrep -N 2 .bashrc % gfwhere .bashrc linux-1.example.com linux-2.example.com In this case, '.bashrc' has two copies; one is stored on linux-1.example.com and the other is stored on linux-2.example.com. gfarm-2.4.1/aclocal.m40000644000000000000000000065513511507222727013174 0ustar rootroot# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- ## Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005 ## Free Software Foundation, Inc. ## Originally by Gordon Matzigkeit , 1996 ## ## This file is free software; the Free Software Foundation gives ## unlimited permission to copy and/or distribute it, with or without ## modifications, as long as this notice is preserved. # serial 47 AC_PROG_LIBTOOL # AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) # ----------------------------------------------------------- # If this macro is not defined by Autoconf, define it here. m4_ifdef([AC_PROVIDE_IFELSE], [], [m4_define([AC_PROVIDE_IFELSE], [m4_ifdef([AC_PROVIDE_$1], [$2], [$3])])]) # AC_PROG_LIBTOOL # --------------- AC_DEFUN([AC_PROG_LIBTOOL], [AC_REQUIRE([_AC_PROG_LIBTOOL])dnl dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX. AC_PROVIDE_IFELSE([AC_PROG_CXX], [AC_LIBTOOL_CXX], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX ])]) dnl And a similar setup for Fortran 77 support AC_PROVIDE_IFELSE([AC_PROG_F77], [AC_LIBTOOL_F77], [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77 ])]) dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly. dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [AC_LIBTOOL_GCJ], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [AC_LIBTOOL_GCJ], [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ], [AC_LIBTOOL_GCJ], [ifdef([AC_PROG_GCJ], [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])]) ifdef([A][M_PROG_GCJ], [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])]) ifdef([LT_AC_PROG_GCJ], [define([LT_AC_PROG_GCJ], defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])]) ])])# AC_PROG_LIBTOOL # _AC_PROG_LIBTOOL # ---------------- AC_DEFUN([_AC_PROG_LIBTOOL], [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl # Prevent multiple expansion define([AC_PROG_LIBTOOL], []) ])# _AC_PROG_LIBTOOL # AC_LIBTOOL_SETUP # ---------------- AC_DEFUN([AC_LIBTOOL_SETUP], [AC_PREREQ(2.50)dnl AC_REQUIRE([AC_ENABLE_SHARED])dnl AC_REQUIRE([AC_ENABLE_STATIC])dnl AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_LD])dnl AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl AC_REQUIRE([AC_PROG_NM])dnl AC_REQUIRE([AC_PROG_LN_S])dnl AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! AC_REQUIRE([AC_OBJEXT])dnl AC_REQUIRE([AC_EXEEXT])dnl dnl AC_LIBTOOL_SYS_MAX_CMD_LEN AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE AC_LIBTOOL_OBJDIR AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl _LT_AC_PROG_ECHO_BACKSLASH case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='sed -e 1s/^X//' [sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'] # Same as above, but do not quote variable references. [double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'] # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' # Constants: rm="rm -f" # Global variables: default_ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except M$VC, # which needs '.lib'). libext=a ltmain="$ac_aux_dir/ltmain.sh" ofile="$default_ofile" with_gnu_ld="$lt_cv_prog_gnu_ld" AC_CHECK_TOOL(AR, ar, false) AC_CHECK_TOOL(RANLIB, ranlib, :) AC_CHECK_TOOL(STRIP, strip, :) old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru test -z "$AS" && AS=as test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$LD" && LD=ld test -z "$LN_S" && LN_S="ln -s" test -z "$MAGIC_CMD" && MAGIC_CMD=file test -z "$NM" && NM=nm test -z "$SED" && SED=sed test -z "$OBJDUMP" && OBJDUMP=objdump test -z "$RANLIB" && RANLIB=: test -z "$STRIP" && STRIP=: test -z "$ac_objext" && ac_objext=o # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds" ;; *) old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then AC_PATH_MAGIC fi ;; esac AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], enable_win32_dll=yes, enable_win32_dll=no) AC_ARG_ENABLE([libtool-lock], [AC_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes AC_ARG_WITH([pic], [AC_HELP_STRING([--with-pic], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [pic_mode="$withval"], [pic_mode=default]) test -z "$pic_mode" && pic_mode=default # Use C for the default configuration in the libtool script tagname= AC_LIBTOOL_LANG_C_CONFIG _LT_AC_TAGCONFIG ])# AC_LIBTOOL_SETUP # _LT_AC_SYS_COMPILER # ------------------- AC_DEFUN([_LT_AC_SYS_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_AC_SYS_COMPILER # _LT_CC_BASENAME(CC) # ------------------- # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. AC_DEFUN([_LT_CC_BASENAME], [for cc_temp in $1""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` ]) # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. AC_DEFUN([_LT_COMPILER_BOILERPLATE], [ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. AC_DEFUN([_LT_LINKER_BOILERPLATE], [ac_outfile=conftest.$ac_objext printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm conftest* ])# _LT_LINKER_BOILERPLATE # _LT_AC_SYS_LIBPATH_AIX # ---------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX], [AC_LINK_IFELSE(AC_LANG_PROGRAM,[ aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi],[]) if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ])# _LT_AC_SYS_LIBPATH_AIX # _LT_AC_SHELL_INIT(ARG) # ---------------------- AC_DEFUN([_LT_AC_SHELL_INIT], [ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], [AC_DIVERT_PUSH(NOTICE)]) $1 AC_DIVERT_POP ])# _LT_AC_SHELL_INIT # _LT_AC_PROG_ECHO_BACKSLASH # -------------------------- # Add some code to the start of the generated configure script which # will find an echo command which doesn't interpret backslashes. AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], [_LT_AC_SHELL_INIT([ # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case X$ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` ;; esac echo=${ECHO-echo} if test "X[$]1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X[$]1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then # Yippee, $echo works! : else # Restart under the correct shell. exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} fi if test "X[$]1" = X--fallback-echo; then # used as fallback echo shift cat </dev/null 2>&1 && unset CDPATH if test -z "$ECHO"; then if test "X${echo_test_string+set}" != Xset; then # find a string as large as possible, as long as the shell can cope with it for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... if (echo_test_string="`eval $cmd`") 2>/dev/null && echo_test_string="`eval $cmd`" && (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null then break fi done fi if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then : else # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for dir in $PATH /usr/ucb; do IFS="$lt_save_ifs" if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$dir/echo" break fi done IFS="$lt_save_ifs" if test "X$echo" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # This shell has a builtin print -r that does the trick. echo='print -r' elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running configure again with it. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} else # Try using printf. echo='printf %s\n' if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # Cool, printf works : elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL echo="$CONFIG_SHELL [$]0 --fallback-echo" elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$CONFIG_SHELL [$]0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null then break fi prev="$cmd" done if test "$prev" != 'sed 50q "[$]0"'; then echo_test_string=`eval $prev` export echo_test_string exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} else # Oops. We lost completely, so just stick with echo. echo=echo fi fi fi fi fi fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. ECHO=$echo if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" fi AC_SUBST(ECHO) ])])# _LT_AC_PROG_ECHO_BACKSLASH # _LT_AC_LOCK # ----------- AC_DEFUN([_LT_AC_LOCK], [AC_ARG_ENABLE([libtool-lock], [AC_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '[#]line __oline__ "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case "`/usr/bin/file conftest.o`" in *32-bit*) case $host in x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], [*-*-cygwin* | *-*-mingw* | *-*-pw32*) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; ]) esac need_locks="$enable_libtool_lock" ])# _LT_AC_LOCK # AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [AC_REQUIRE([LT_AC_PROG_SED]) AC_CACHE_CHECK([$1], [$2], [$2=no ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp $SED '/^$/d' conftest.err >conftest.er2 if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $rm conftest* ]) if test x"[$]$2" = xyes; then ifelse([$5], , :, [$5]) else ifelse([$6], , :, [$6]) fi ])# AC_LIBTOOL_COMPILER_OPTION # AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ------------------------------------------------------------ # Check whether the given compiler option works AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" printf "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $echo "X$_lt_linker_boilerplate" | $Xsed > conftest.exp $SED '/^$/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $rm conftest* LDFLAGS="$save_LDFLAGS" ]) if test x"[$]$2" = xyes; then ifelse([$4], , :, [$4]) else ifelse([$5], , :, [$5]) fi ])# AC_LIBTOOL_LINKER_OPTION # AC_LIBTOOL_SYS_MAX_CMD_LEN # -------------------------- AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [# find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for *BSD fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; *) # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \ = "XX$teststring") >/dev/null 2>&1 && new_result=`expr "X$teststring" : ".*" 2>&1` && lt_cv_sys_max_cmd_len=$new_result && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done teststring= # Add a significant safety factor because C++ compilers can tack on massive # amounts of additional arguments before passing them to the linker. # It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` ;; esac ]) if test -n $lt_cv_sys_max_cmd_len ; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi ])# AC_LIBTOOL_SYS_MAX_CMD_LEN # _LT_AC_CHECK_DLFCN # -------------------- AC_DEFUN([_LT_AC_CHECK_DLFCN], [AC_CHECK_HEADERS(dlfcn.h)dnl ])# _LT_AC_CHECK_DLFCN # _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ------------------------------------------------------------------ AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF], [AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl if test "$cross_compiling" = yes; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); }] EOF if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_unknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_AC_TRY_DLOPEN_SELF # AC_LIBTOOL_DLOPEN_SELF # ------------------- AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen="shl_load"], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"]) ]) ]) ]) ]) ]) ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_AC_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test "x$lt_cv_dlopen_self" = xyes; then LDFLAGS="$LDFLAGS $link_static_flag" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_AC_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi ])# AC_LIBTOOL_DLOPEN_SELF # AC_LIBTOOL_PROG_CC_C_O([TAGNAME]) # --------------------------------- # Check to see if options -c and -o are simultaneously supported by compiler AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O], [AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed > out/conftest.exp $SED '/^$/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* ]) ])# AC_LIBTOOL_PROG_CC_C_O # AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME]) # ----------------------------------------- # Check to see if we can do hard links to lock some files if needed AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_REQUIRE([_LT_AC_LOCK])dnl hard_links="nottested" if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test "$hard_links" = no; then AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi ])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS # AC_LIBTOOL_OBJDIR # ----------------- AC_DEFUN([AC_LIBTOOL_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir ])# AC_LIBTOOL_OBJDIR # AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME]) # ---------------------------------------------- # Check hardcoding attributes. AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_AC_TAGVAR(hardcode_action, $1)= if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \ test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \ test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then # We can hardcode non-existant directories. if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no && test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then # Linking always hardcodes the temporary library directory. _LT_AC_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_AC_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_AC_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)]) if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi ])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH # AC_LIBTOOL_SYS_LIB_STRIP # ------------------------ AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP], [striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi ])# AC_LIBTOOL_SYS_LIB_STRIP # AC_LIBTOOL_SYS_DYNAMIC_LINKER # ----------------------------- # PORTME Fill in your ld.so characteristics AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_MSG_CHECKING([dynamic linker characteristics]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` else sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; kfreebsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; *) # from 3.2 on shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case "$host_cpu" in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; knetbsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[[89]] | openbsd2.[[89]].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; sco3.2v5*) version_type=osf soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test "$dynamic_linker" = no && can_build_shared=no ])# AC_LIBTOOL_SYS_DYNAMIC_LINKER # _LT_AC_TAGCONFIG # ---------------- AC_DEFUN([_LT_AC_TAGCONFIG], [AC_ARG_WITH([tags], [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@], [include additional configurations @<:@automatic@:>@])], [tagnames="$withval"]) if test -f "$ltmain" && test -n "$tagnames"; then if test ! -f "${ofile}"; then AC_MSG_WARN([output file `$ofile' does not exist]) fi if test -z "$LTCC"; then eval "`$SHELL ${ofile} --config | grep '^LTCC='`" if test -z "$LTCC"; then AC_MSG_WARN([output file `$ofile' does not look like a libtool script]) else AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile']) fi fi # Extract list of available tagged configurations in $ofile. # Note that this assumes the entire list is on one line. available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for tagname in $tagnames; do IFS="$lt_save_ifs" # Check whether tagname contains only valid characters case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in "") ;; *) AC_MSG_ERROR([invalid tag name: $tagname]) ;; esac if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null then AC_MSG_ERROR([tag name \"$tagname\" already exists]) fi # Update the list of available tags. if test -n "$tagname"; then echo appending configuration tag \"$tagname\" to $ofile case $tagname in CXX) if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_LIBTOOL_LANG_CXX_CONFIG else tagname="" fi ;; F77) if test -n "$F77" && test "X$F77" != "Xno"; then AC_LIBTOOL_LANG_F77_CONFIG else tagname="" fi ;; GCJ) if test -n "$GCJ" && test "X$GCJ" != "Xno"; then AC_LIBTOOL_LANG_GCJ_CONFIG else tagname="" fi ;; RC) AC_LIBTOOL_LANG_RC_CONFIG ;; *) AC_MSG_ERROR([Unsupported tag name: $tagname]) ;; esac # Append the new tag name to the list of available tags. if test -n "$tagname" ; then available_tags="$available_tags $tagname" fi fi done IFS="$lt_save_ifs" # Now substitute the updated list of available tags. if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then mv "${ofile}T" "$ofile" chmod +x "$ofile" else rm -f "${ofile}T" AC_MSG_ERROR([unable to update list of available tagged configurations.]) fi fi ])# _LT_AC_TAGCONFIG # AC_LIBTOOL_DLOPEN # ----------------- # enable checks for dlopen support AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP]) ])# AC_LIBTOOL_DLOPEN # AC_LIBTOOL_WIN32_DLL # -------------------- # declare package support for building win32 dll's AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_BEFORE([$0], [AC_LIBTOOL_SETUP]) ])# AC_LIBTOOL_WIN32_DLL # AC_ENABLE_SHARED([DEFAULT]) # --------------------------- # implement the --enable-shared flag # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. AC_DEFUN([AC_ENABLE_SHARED], [define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE([shared], [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_shared=]AC_ENABLE_SHARED_DEFAULT) ])# AC_ENABLE_SHARED # AC_DISABLE_SHARED # ----------------- #- set the default shared flag to --disable-shared AC_DEFUN([AC_DISABLE_SHARED], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_SHARED(no) ])# AC_DISABLE_SHARED # AC_ENABLE_STATIC([DEFAULT]) # --------------------------- # implement the --enable-static flag # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. AC_DEFUN([AC_ENABLE_STATIC], [define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE([static], [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_static=]AC_ENABLE_STATIC_DEFAULT) ])# AC_ENABLE_STATIC # AC_DISABLE_STATIC # ----------------- # set the default static flag to --disable-static AC_DEFUN([AC_DISABLE_STATIC], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_STATIC(no) ])# AC_DISABLE_STATIC # AC_ENABLE_FAST_INSTALL([DEFAULT]) # --------------------------------- # implement the --enable-fast-install flag # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. AC_DEFUN([AC_ENABLE_FAST_INSTALL], [define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl AC_ARG_ENABLE([fast-install], [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT) ])# AC_ENABLE_FAST_INSTALL # AC_DISABLE_FAST_INSTALL # ----------------------- # set the default to --disable-fast-install AC_DEFUN([AC_DISABLE_FAST_INSTALL], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_ENABLE_FAST_INSTALL(no) ])# AC_DISABLE_FAST_INSTALL # AC_LIBTOOL_PICMODE([MODE]) # -------------------------- # implement the --with-pic flag # MODE is either `yes' or `no'. If omitted, it defaults to `both'. AC_DEFUN([AC_LIBTOOL_PICMODE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl pic_mode=ifelse($#,1,$1,default) ])# AC_LIBTOOL_PICMODE # AC_PROG_EGREP # ------------- # This is predefined starting with Autoconf 2.54, so this conditional # definition can be removed once we require Autoconf 2.54 or later. m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP], [AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep], [if echo a | (grep -E '(a|b)') >/dev/null 2>&1 then ac_cv_prog_egrep='grep -E' else ac_cv_prog_egrep='egrep' fi]) EGREP=$ac_cv_prog_egrep AC_SUBST([EGREP]) ])]) # AC_PATH_TOOL_PREFIX # ------------------- # find a file program which can recognise shared library AC_DEFUN([AC_PATH_TOOL_PREFIX], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="ifelse([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$1; then lt_cv_path_MAGIC_CMD="$ac_dir/$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac]) MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi ])# AC_PATH_TOOL_PREFIX # AC_PATH_MAGIC # ------------- # find a file program which can recognise a shared library AC_DEFUN([AC_PATH_MAGIC], [AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# AC_PATH_MAGIC # AC_PROG_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([AC_PROG_LD], [AC_ARG_WITH([gnu-ld], [AC_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test "$withval" = no || with_gnu_ld=yes], [with_gnu_ld=no]) AC_REQUIRE([LT_AC_PROG_SED])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case "$host_cpu" in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux*) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; nto-qnx*) lt_cv_deplibs_check_method=unknown ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; sco3.2v5*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; esac ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown ])# AC_DEPLIBS_CHECK_METHOD # AC_PROG_NM # ---------- # find the pathname to a BSD-compatible name lister AC_DEFUN([AC_PROG_NM], [AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/${ac_tool_prefix}nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac esac fi done IFS="$lt_save_ifs" test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm fi]) NM="$lt_cv_path_NM" ])# AC_PROG_NM # AC_CHECK_LIBM # ------------- # check for math library AC_DEFUN([AC_CHECK_LIBM], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM="-lm") ;; esac ])# AC_CHECK_LIBM # AC_LIBLTDL_CONVENIENCE([DIRECTORY]) # ----------------------------------- # sets LIBLTDL to the link flags for the libltdl convenience library and # LTDLINCL to the include flags for the libltdl header and adds # --enable-ltdl-convenience to the configure arguments. Note that LIBLTDL # and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If # DIRECTORY is not provided, it is assumed to be `libltdl'. LIBLTDL will # be prefixed with '${top_builddir}/' and LTDLINCL will be prefixed with # '${top_srcdir}/' (note the single quotes!). If your package is not # flat and you're not using automake, define top_builddir and # top_srcdir appropriately in the Makefiles. AC_DEFUN([AC_LIBLTDL_CONVENIENCE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl case $enable_ltdl_convenience in no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; "") enable_ltdl_convenience=yes ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; esac LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) # For backwards non-gettext consistent compatibility... INCLTDL="$LTDLINCL" ])# AC_LIBLTDL_CONVENIENCE # AC_LIBLTDL_INSTALLABLE([DIRECTORY]) # ----------------------------------- # sets LIBLTDL to the link flags for the libltdl installable library and # LTDLINCL to the include flags for the libltdl header and adds # --enable-ltdl-install to the configure arguments. Note that LIBLTDL # and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If # DIRECTORY is not provided and an installed libltdl is not found, it is # assumed to be `libltdl'. LIBLTDL will be prefixed with '${top_builddir}/' # and LTDLINCL will be prefixed with '${top_srcdir}/' (note the single # quotes!). If your package is not flat and you're not using automake, # define top_builddir and top_srcdir appropriately in the Makefiles. # In the future, this macro may have to be called after AC_PROG_LIBTOOL. AC_DEFUN([AC_LIBLTDL_INSTALLABLE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl AC_CHECK_LIB(ltdl, lt_dlinit, [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], [if test x"$enable_ltdl_install" = xno; then AC_MSG_WARN([libltdl not installed, but installation disabled]) else enable_ltdl_install=yes fi ]) if test x"$enable_ltdl_install" = x"yes"; then ac_configure_args="$ac_configure_args --enable-ltdl-install" LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) else ac_configure_args="$ac_configure_args --enable-ltdl-install=no" LIBLTDL="-lltdl" LTDLINCL= fi # For backwards non-gettext consistent compatibility... INCLTDL="$LTDLINCL" ])# AC_LIBLTDL_INSTALLABLE # AC_LIBTOOL_CXX # -------------- # enable support for C++ libraries AC_DEFUN([AC_LIBTOOL_CXX], [AC_REQUIRE([_LT_AC_LANG_CXX]) ])# AC_LIBTOOL_CXX # _LT_AC_LANG_CXX # --------------- AC_DEFUN([_LT_AC_LANG_CXX], [AC_REQUIRE([AC_PROG_CXX]) AC_REQUIRE([_LT_AC_PROG_CXXCPP]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX]) ])# _LT_AC_LANG_CXX # _LT_AC_PROG_CXXCPP # --------------- AC_DEFUN([_LT_AC_PROG_CXXCPP], [ AC_REQUIRE([AC_PROG_CXX]) if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_PROG_CXXCPP fi ])# _LT_AC_PROG_CXXCPP # AC_LIBTOOL_F77 # -------------- # enable support for Fortran 77 libraries AC_DEFUN([AC_LIBTOOL_F77], [AC_REQUIRE([_LT_AC_LANG_F77]) ])# AC_LIBTOOL_F77 # _LT_AC_LANG_F77 # --------------- AC_DEFUN([_LT_AC_LANG_F77], [AC_REQUIRE([AC_PROG_F77]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77]) ])# _LT_AC_LANG_F77 # AC_LIBTOOL_GCJ # -------------- # enable support for GCJ libraries AC_DEFUN([AC_LIBTOOL_GCJ], [AC_REQUIRE([_LT_AC_LANG_GCJ]) ])# AC_LIBTOOL_GCJ # _LT_AC_LANG_GCJ # --------------- AC_DEFUN([_LT_AC_LANG_GCJ], [AC_PROVIDE_IFELSE([AC_PROG_GCJ],[], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[], [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[], [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])], [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])], [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ]) ])# _LT_AC_LANG_GCJ # AC_LIBTOOL_RC # -------------- # enable support for Windows resource files AC_DEFUN([AC_LIBTOOL_RC], [AC_REQUIRE([LT_AC_PROG_RC]) _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC]) ])# AC_LIBTOOL_RC # AC_LIBTOOL_LANG_C_CONFIG # ------------------------ # Ensure that the configuration vars for the C compiler are # suitably defined. Those variables are subsequently used by # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG]) AC_DEFUN([_LT_AC_LANG_C_CONFIG], [lt_save_CC="$CC" AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_AC_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}\n' _LT_AC_SYS_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # # Check for any special shared library compilation flags. # _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)= if test "$GCC" = no; then case $host_os in sco3.2v5*) _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)='-belf' ;; esac fi if test -n "$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)"; then AC_MSG_WARN([`$CC' requires `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to build shared libraries]) if echo "$old_CC $old_CFLAGS " | grep "[[ ]]$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)[[ ]]" >/dev/null; then : else AC_MSG_WARN([add `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to the CC or CFLAGS env variable and reconfigure]) _LT_AC_TAGVAR(lt_cv_prog_cc_can_build_shared, $1)=no fi fi # # Check to make sure the static flag actually works. # AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $_LT_AC_TAGVAR(lt_prog_compiler_static, $1) works], _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1), $_LT_AC_TAGVAR(lt_prog_compiler_static, $1), [], [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=]) ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) AC_LIBTOOL_PROG_COMPILER_PIC($1) AC_LIBTOOL_PROG_CC_C_O($1) AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) AC_LIBTOOL_PROG_LD_SHLIBS($1) AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) AC_LIBTOOL_SYS_LIB_STRIP AC_LIBTOOL_DLOPEN_SELF($1) # Report which librarie types wil actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case "$host_os" in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix4* | aix5*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) AC_LIBTOOL_CONFIG($1) AC_LANG_POP CC="$lt_save_CC" ])# AC_LIBTOOL_LANG_C_CONFIG # AC_LIBTOOL_LANG_CXX_CONFIG # -------------------------- # Ensure that the configuration vars for the C compiler are # suitably defined. Those variables are subsequently used by # AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)]) AC_DEFUN([_LT_AC_LANG_CXX_CONFIG], [AC_LANG_PUSH(C++) AC_REQUIRE([AC_PROG_CXX]) AC_REQUIRE([_LT_AC_PROG_CXXCPP]) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(allow_undefined_flag, $1)= _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(archive_expsym_cmds, $1)= _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= _LT_AC_TAGVAR(hardcode_minus_L, $1)=no _LT_AC_TAGVAR(hardcode_automatic, $1)=no _LT_AC_TAGVAR(module_cmds, $1)= _LT_AC_TAGVAR(module_expsym_cmds, $1)= _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown _LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_AC_TAGVAR(no_undefined_flag, $1)= _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Dependencies to place before and after the object being linked: _LT_AC_TAGVAR(predep_objects, $1)= _LT_AC_TAGVAR(postdep_objects, $1)= _LT_AC_TAGVAR(predeps, $1)= _LT_AC_TAGVAR(postdeps, $1)= _LT_AC_TAGVAR(compiler_lib_search_path, $1)= # Source file extension for C++ test sources. ac_ext=cc # Object file extension for compiled C++ test sources. objext=o _LT_AC_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_AC_SYS_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} compiler=$CC _LT_AC_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) # We don't want -fno-exception wen compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration AC_PROG_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ grep 'no-whole-archive' > /dev/null; then _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_AC_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_AC_TAGVAR(archive_cmds, $1)='' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes if test "$GXX" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 _LT_AC_TAGVAR(hardcode_direct, $1)=yes else # We have old collect2 _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_AC_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' # -bexpall does not export symbols beginning with underscore (_) _LT_AC_TAGVAR(always_export_symbols, $1)=yes # Exported symbols can be pulled into shared objects from archives _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' ' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds it's shared libraries. _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; darwin* | rhapsody*) case "$host_os" in rhapsody* | darwin1.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_automatic, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes if test "$GXX" = yes ; then lt_int_apple_cc_single_mod=no output_verbose_link_cmd='echo' if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then lt_int_apple_cc_single_mod=yes fi if test "X$lt_int_apple_cc_single_mod" = Xyes ; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' fi _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's if test "X$lt_int_apple_cc_single_mod" = Xyes ; then _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' fi _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac fi ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd[[12]]*) # C++ shared libraries reported to be fairly broken before switch to ELF _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | kfreebsd*-gnu | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_AC_TAGVAR(ld_shlibs, $1)=yes ;; gnu*) ;; hpux9*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[[-]]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then case "$host_cpu" in hppa*64*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; ia64*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' ;; *) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; esac fi case "$host_cpu" in hppa*64*) _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; ia64*) _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; *) _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case "$host_cpu" in hppa*64*|ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case "$host_cpu" in ia64*|hppa*64*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' fi fi _LT_AC_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; linux*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc*) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC*) # Portland Group C++ compiler _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive,`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; openbsd2*) # C++ shared libraries are fairly broken _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; openbsd*) _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd='echo' ;; osf3*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; cxx*) _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; cxx*) _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~ $rm $lib.exp' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; sco*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The C++ compiler is used as linker so we must use $wl # flag to pass the commands to the underlying system # linker. We must also pass each convience library through # to the system linker between allextract/defaultextract. # The C++ compiler will combine linker options so we # cannot just pass the convience library names through # without $wl. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; esac _LT_AC_TAGVAR(link_all_deplibs, $1)=yes # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep "\-[[LR]]"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | grep -v '^2\.7' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' fi ;; esac ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_AC_TAGVAR(GCC, $1)="$GXX" _LT_AC_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... AC_LIBTOOL_POSTDEP_PREDEP($1) AC_LIBTOOL_PROG_COMPILER_PIC($1) AC_LIBTOOL_PROG_CC_C_O($1) AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) AC_LIBTOOL_PROG_LD_SHLIBS($1) AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) AC_LIBTOOL_SYS_LIB_STRIP AC_LIBTOOL_DLOPEN_SELF($1) AC_LIBTOOL_CONFIG($1) AC_LANG_POP CC=$lt_save_CC LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ldcxx=$with_gnu_ld with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld ])# AC_LIBTOOL_LANG_CXX_CONFIG # AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME]) # ------------------------ # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[ dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... ifelse([$1],[],[cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <> "$cfgfile" ifelse([$1], [], [#! $SHELL # `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. # # This file is part of GNU Libtool: # Originally by Gordon Matzigkeit , 1996 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="$SED -e 1s/^X//" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # The names of the tagged configurations supported by this script. available_tags= # ### BEGIN LIBTOOL CONFIG], [# ### BEGIN LIBTOOL TAG CONFIG: $tagname]) # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1) # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # A language-specific compiler. CC=$lt_[]_LT_AC_TAGVAR(compiler, $1) # Is the compiler the GNU C compiler? with_gcc=$_LT_AC_TAGVAR(GCC, $1) # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_[]_LT_AC_TAGVAR(LD, $1) # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) # Must we lock files when doing compilation? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1) # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1) # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1) # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1) # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1) old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1) # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) # Commands used to build and install a shared archive. archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1) archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1) postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1) module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1) # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1) # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1) # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1) # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1) # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1) # Flag that forces no undefined symbols. no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1) # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1) # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1) # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1) # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1) # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1) # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1) # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1) # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)" # Set to yes if exported symbols are required. always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1) # The commands to list exported symbols. export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1) # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1) # Symbols that must always be exported. include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1) ifelse([$1],[], [# ### END LIBTOOL CONFIG], [# ### END LIBTOOL TAG CONFIG: $tagname]) __EOF__ ifelse([$1],[], [ case $host_os in aix3*) cat <<\EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi EOF ;; esac # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || \ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ]) else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ])# AC_LIBTOOL_CONFIG # AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------------------- AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi ])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE # --------------------------------- AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_PROG_NM]) AC_REQUIRE([AC_OBJEXT]) # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Transform an extracted symbol line into a proper C declaration lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32*) symcode='[[ABCDGISTW]]' ;; hpux*) # Its linker distinguishes data from code symbols if test "$host_cpu" = ia64; then symcode='[[ABCDEGRST]]' fi lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" ;; linux*) if test "$host_cpu" = ia64; then symcode='[[ABCDGIRSTW]]' lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris* | sysv5*) symcode='[[BDRT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac # Try without a prefix undercore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext < $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if grep ' nm_test_var$' "$nlist" >/dev/null; then if grep ' nm_test_func$' "$nlist" >/dev/null; then cat < conftest.$ac_ext #ifdef __cplusplus extern "C" { #endif EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' cat <> conftest.$ac_ext #if defined (__STDC__) && __STDC__ # define lt_ptr_t void * #else # define lt_ptr_t char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr_t address; } lt_preloaded_symbols[[]] = { EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext cat <<\EOF >> conftest.$ac_ext {0, (lt_ptr_t) 0} }; #ifdef __cplusplus } #endif EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_save_LIBS="$LIBS" lt_save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS="$lt_save_LIBS" CFLAGS="$lt_save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -f conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi ]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE # AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME]) # --------------------------------------- AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC], [_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)= _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_static, $1)= AC_MSG_CHECKING([for $compiler option to produce PIC]) ifelse([$1],[CXX],[ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | os2* | pw32*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= ;; sysv4*MP*) if test -d /usr/nec; then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix4* | aix5*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; esac ;; dgux*) case $cc_basename in ec++*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | kfreebsd*-gnu | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" if test "$host_cpu" != ia64; then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux*) case $cc_basename in KCC*) # KAI C++ Compiler _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; icpc* | ecpc*) # Intel C++ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC*) # Portland Group C++ compiler. _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; sco*) case $cc_basename in CC*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; *) ;; esac ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; unixware*) ;; vxworks*) ;; *) _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test "$GCC" = yes; then _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; esac ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; newsos6) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; linux*) case $cc_basename in icc* | ecc*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgcc* | pgf77* | pgf90*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; ccc*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; esac ;; osf3* | osf4* | osf5*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; sco3.2v5*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kpic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-dn' ;; solaris*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; unicos*) _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)]) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works], _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1), [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi case "$host_os" in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])" ;; esac ]) # AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME]) # ------------------------------------ # See if the linker supports building shared libraries. AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) ifelse([$1],[CXX],[ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' case $host_os in aix4* | aix5*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' else _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; cygwin* | mingw*) _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([[^ ]]*\) [[^ ]]*/\1 DATA/;/^I /d;/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' ;; *) _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ],[ runpath_var= _LT_AC_TAGVAR(allow_undefined_flag, $1)= _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_AC_TAGVAR(archive_cmds, $1)= _LT_AC_TAGVAR(archive_expsym_cmds, $1)= _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)= _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= _LT_AC_TAGVAR(thread_safe_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_minus_L, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown _LT_AC_TAGVAR(hardcode_automatic, $1)=no _LT_AC_TAGVAR(module_cmds, $1)= _LT_AC_TAGVAR(module_expsym_cmds, $1)= _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_AC_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. extract_expsyms_cmds= # Just being paranoid about ensuring that cc_basename is set. _LT_CC_BASENAME([$compiler]) case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; openbsd*) with_gnu_ld=no ;; esac _LT_AC_TAGVAR(ld_shlibs, $1)=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then _LT_AC_TAGVAR(ld_shlibs, $1)=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(always_export_symbols, $1)=no _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; linux*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_addflag= case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive,`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* ) # Portland Group f77 and f90 compilers _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive,`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; esac _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; then _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris* | sysv5*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then _LT_AC_TAGVAR(ld_shlibs, $1)=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; sunos4*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_AC_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then runpath_var= _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(always_export_symbols, $1)=yes _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes if test "$GCC" = yes && test -z "$link_static_flag"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' else _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_AC_TAGVAR(archive_cmds, $1)='' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes if test "$GCC" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 _LT_AC_TAGVAR(hardcode_direct, $1)=yes else # We have old collect2 _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_AC_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. _LT_AC_SYS_LIBPATH_AIX _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' # -bexpall does not export symbols beginning with underscore (_) _LT_AC_TAGVAR(always_export_symbols, $1)=yes # Exported symbols can be pulled into shared objects from archives _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' ' _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds it's shared libraries. _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # see comment about different semantics on the GNU ld section _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; bsdi[[45]]*) _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs' _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; darwin* | rhapsody*) case "$host_os" in rhapsody* | darwin1.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[[012]]) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_automatic, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' _LT_AC_TAGVAR(link_all_deplibs, $1)=yes if test "$GCC" = yes ; then output_verbose_link_cmd='echo' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac fi ;; dgux*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; freebsd1*) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | kfreebsd*-gnu | dragonfly*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; hpux10* | hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case "$host_cpu" in hppa*64*|ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case "$host_cpu" in hppa*64*|ia64*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;; esac fi if test "$with_gnu_ld" = no; then case "$host_cpu" in hppa*64*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; ia64*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes ;; *) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(link_all_deplibs, $1)=yes ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; openbsd*) _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else case $host_os in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ;; *) _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ;; esac fi ;; os2*) _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' # Both c and cxx compiler support -rpath directly _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: ;; sco3.2v5*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ;; solaris*) _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' if test "$GCC" = yes; then wlarc='${wl}' _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else wlarc='' _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine linker options so we # cannot just pass the convience library names through # without $wl, iff we do not link with $LD. # Luckily, gcc supports the same syntax we need for Sun Studio. # Supported since Solaris 2.6 (maybe 2.5.1?) case $wlarc in '') _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; *) _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; esac ;; esac _LT_AC_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_AC_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_AC_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4.2uw2*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_direct, $1)=yes _LT_AC_TAGVAR(hardcode_minus_L, $1)=no _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no hardcode_runpath_var=yes runpath_var=LD_RUN_PATH ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*) _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z ${wl}text' if test "$GCC" = yes; then _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' fi runpath_var='LD_RUN_PATH' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv5*) _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' # $CC -shared without GNU ld will not create a library from C++ # object files and a static libstdc++, better avoid it by now _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' ;; uts4*) _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; esac fi ]) AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi # # Do we need to explicitly link libc? # case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $_LT_AC_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_MSG_CHECKING([whether -lc should be explicitly linked in]) $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1) _LT_AC_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) then _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no else _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)]) ;; esac fi ;; esac ])# AC_LIBTOOL_PROG_LD_SHLIBS # _LT_AC_FILE_LTDLL_C # ------------------- # Be careful that the start marker always follows a newline. AC_DEFUN([_LT_AC_FILE_LTDLL_C], [ # /* ltdll.c starts here */ # #define WIN32_LEAN_AND_MEAN # #include # #undef WIN32_LEAN_AND_MEAN # #include # # #ifndef __CYGWIN__ # # ifdef __CYGWIN32__ # # define __CYGWIN__ __CYGWIN32__ # # endif # #endif # # #ifdef __cplusplus # extern "C" { # #endif # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); # #ifdef __cplusplus # } # #endif # # #ifdef __CYGWIN__ # #include # DECLARE_CYGWIN_DLL( DllMain ); # #endif # HINSTANCE __hDllInstance_base; # # BOOL APIENTRY # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) # { # __hDllInstance_base = hInst; # return TRUE; # } # /* ltdll.c ends here */ ])# _LT_AC_FILE_LTDLL_C # _LT_AC_TAGVAR(VARNAME, [TAGNAME]) # --------------------------------- AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])]) # old names AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) AC_DEFUN([AM_PROG_LD], [AC_PROG_LD]) AC_DEFUN([AM_PROG_NM], [AC_PROG_NM]) # This is just to silence aclocal about the macro not being used ifelse([AC_DISABLE_FAST_INSTALL]) AC_DEFUN([LT_AC_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj, no) test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS) ]) AC_DEFUN([LT_AC_PROG_RC], [AC_CHECK_TOOL(RC, windres, no) ]) ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ # LT_AC_PROG_SED # -------------- # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. AC_DEFUN([LT_AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_MSG_RESULT([$SED]) ]) gfarm-2.4.1/SETUP.ja0000644000000000000000000003643611507222727012545 0ustar rootroot[This is written in Japanese, please look at SETUP.en for English version.] Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥àÀßÄê¥Þ¥Ë¥å¥¢¥ë ¡ü Ëܥɥ­¥å¥á¥ó¥È¤Ë¤Ä¤¤¤Æ ========================= Ëܥɥ­¥å¥á¥ó¥È¤Ï Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ÎÀßÄêÊýË¡¤òµ­½Ò¤·¤¿¤â¤Î¤Ç¤¹¡¥ ¥æ¡¼¥¶¸¢¸Â¤Ç Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ò¹½ÃÛ¤·¤¿¤¤¾ì¹ç¤Ï¡¤ SETUP.private.ja ¤ò¸æÍ÷¤¯¤À¤µ¤¤¡¥ ¤³¤Î¥Þ¥Ë¥å¥¢¥ë¤òÍøÍѤ¹¤ëÁ°¤Ë¡¤Gfarm ¥½¥Õ¥È¥¦¥§¥¢¤Î¥¤¥ó¥¹¥È¡¼¥ë¤ò¹Ô¤Ê¤Ã¤Æ ¤¯¤À¤µ¤¤¡¥¥¤¥ó¥¹¥È¡¼¥ëÊýË¡¤Ï¡¤¥½¡¼¥¹¥³¡¼¥É¤«¤é¤Î¥¤¥ó¥¹¥È¡¼¥ë¤Î¾ì¹ç¤Ï INSTALL.ja ¤Ë¡¤RPM ¥Ð¥¤¥Ê¥ê¥Ñ¥Ã¥±¡¼¥¸¤«¤é¤Î¥¤¥ó¥¹¥È¡¼¥ë¤Î¾ì¹ç¤Ï INSTALL.RPM.ja ¤Ë¤¢¤ê¤Þ¤¹¡¥ ¤Ê¤Ë¤«ÌäÂ꤬À¸¤¸¤¿¾ì¹ç¤Ë¤Ï¡¤Gfarm-FAQ.ja ¤Î¥È¥é¥Ö¥ë¡¦¥·¥å¡¼¥Æ¥£¥ó¥°¤Î ¹à¤â»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡¥ ¡ü ³µÍ× ========================= Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ÎƳÆþ¤Ë¤¢¤¿¤ê¡¤¤Þ¤º¡¤¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤òÀßÄꤷ¡¤ ¤½¤Î¸å¡¤¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¡¤¥¯¥é¥¤¥¢¥ó¥È¥Î¡¼¥É¤ÎÀßÄê¤ò¹Ô¤¤¤Þ¤¹¡¥ ƳÆþ¸å¡¤°ìÈ̤ª¤è¤Ó´ÉÍý¼Ô¸¢¸Â¡¤root ¸¢¸Â¤ò¤â¤Ä¥æ¡¼¥¶¤ÎÅÐÏ¿¤ò¹Ô¤¤¤Þ¤¹¡¥ ¡ü Quick Start ========================= ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤ÎÀßÄê # config-gfarm -A # useradd -c "Gfarm gfsd" _gfarmfs # su _gfarmfs $ gfkey -f -p 31536000 ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤ÎÀßÄê # useradd -c "Gfarm gfsd" _gfarmfs ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤«¤é ~_gfarmfs/.gfarm_shared_key ¤ò¥³¥Ô¡¼ ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤«¤é /etc/gfarm2.conf ¤ò¥³¥Ô¡¼ # config-gfsd ´ÉÍý¼Ô¤Ë¥Û¥¹¥ÈÅÐÏ¿¤ò°ÍÍê # /etc/init.d/gfsd start ¥¯¥é¥¤¥¢¥ó¥È¤ÎÀßÄê ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤«¤é /etc/gfarm2.conf ¤ò¥³¥Ô¡¼ $ gfkey -f -p 31536000 ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¡¤Á´¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¡¤¥¯¥é¥¤¥¢¥ó¥È¤Ë ¶¦Í­¸° ~/.gfarm_shared_key ¤ò¥³¥Ô¡¼ ¥æ¡¼¥¶ÅÐÏ¿¤È¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥êºîÀ® $ gfuser -c username realname homedir gsi_dn $ gfmkdir homedir $ gfchown username homedir ´ÉÍý¼Ô¸¢¸Â¥æ¡¼¥¶ÅÐÏ¿ $ gfgroup -m gfarmadm user1 user2 ... root ¸¢¸Â¥æ¡¼¥¶ÅÐÏ¿ $ gfgroup -m gfarmroot user1 user2 ... ¡ü ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤ÎÀßÄê ========================= ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤òÀßÄꤹ¤ë¤¿¤á¤Ë¤ÏÀßÄꤹ¤ë¥Û¥¹¥È¤Î root ¸¢¸Â¤¬É¬ÍפǤ¹¡¥ °Ê²¼¤ÎÀßÄê¤Ï root ¸¢¸Â¤Ç¹Ô¤¤¤Þ¤¹¡¥ ÀßÄê¤Ë¤¢¤¿¤ê¡¤¤Þ¤º°Ê²¼¤ò·è¤á¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡¥ ¡¦´ÉÍý¼Ô¤Î¥°¥í¡¼¥Ð¥ë¥æ¡¼¥¶Ì¾ [-A] ¡¦´ÉÍý¼Ô¤Î¥æ¡¼¥¶¾ÚÌÀ½ñ¤Î Subject DN [-D] (GSI ǧ¾Ú¤Î¤È¤­¤À¤±) ¥°¥í¡¼¥Ð¥ë¥æ¡¼¥¶Ì¾¤È¤Ï¡¤Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ÇÍøÍѤµ¤ì¤ë¥æ¡¼¥¶Ì¾¤Ç ¤¹¡¥°Û¤Ê¤ë¥¢¥«¥¦¥ó¥ÈÂηϤò¤â¤ÄÊ£¿ô¤Î´ÉÍý¥É¥á¥¤¥ó¤ò¤Þ¤¿¤¬¤Ã¤Æ¥Õ¥¡¥¤¥ë ¶¦Í­¤ò¹Ô¤¦¤¿¤á¤Ë Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ë¤ª¤¤¤Æ¥æ¥Ë¡¼¥¯¤Ê̾Á°¤òÀßÄê ¤·¤Þ¤¹¡¥ °ìÈ̥桼¥¶¤Ç¥í¥°¥¤¥ó¤·¡¤root ¸¢¸Â¤Ë su ¤·¤¿¾ì¹ç¤Ï¡¤¤½¤Î¤È¤­¤Î°ìÈ̥桼 ¥¶¤Î¥¢¥«¥¦¥ó¥È̾¤¬¥Ç¥Õ¥©¥ë¥È¤Î´ÉÍý¼Ô¤Î¥°¥í¡¼¥Ð¥ë¥æ¡¼¥¶Ì¾¤È¤Ê¤ê¤Þ¤¹¡¥ ¶¦Í­¸°Ç§¾Ú¤Î¾ì¹ç¤Ï¡¤¥Ç¥Õ¥©¥ë¥È¤Ç¤ÏÍøÍÑ¥Û¥¹¥È¤Î¥¢¥«¥¦¥ó¥È̾¤È¥°¥í¡¼¥Ð ¥ë¥æ¡¼¥¶Ì¾¤ÏƱ°ì̾¤ÇÂбþ¤¹¤ë¤¿¤á¡¤¥°¥í¡¼¥Ð¥ë¥æ¡¼¥¶Ì¾¤ÈƱ°ì̾¤Î¥æ¡¼¥¶ ¤¬´ÉÍý¼Ô¤È¤Ê¤ê¤Þ¤¹¡¥Ì¾Á°¤ÎÂбþ¤Ï gfarm2.conf ¤Î local_user_map ¤Ç»Ø Äꤵ¤ì¤ë¡¤¥°¥í¡¼¥Ð¥ë¥æ¡¼¥¶Ì¾¤È¥í¡¼¥«¥ë¥¢¥«¥¦¥ó¥È̾¤òµ­½Ò¤·¤¿¥æ¡¼¥¶¥Þ¥Ã ¥×¥Õ¥¡¥¤¥ë¤Ç¥Û¥¹¥È¤´¤È¤Ë´ÉÍý¤·¤Þ¤¹¡¥ GSI ǧ¾Ú¤Î¾ì¹ç¤Ï¡¤¤³¤³¤ÇÀßÄꤷ¤¿ Subject DN ¤Î¥æ¡¼¥¶¾ÚÌÀ½ñ¤ò»ý¤Ä¥æ¡¼ ¥¶¤¬´ÉÍý¼Ô¤È¤Ê¤ê¤Þ¤¹¡¥¤³¤Î¾ì¹ç¡¤»ØÄꤷ¤¿ Subject DN ¤Î¥¨¥ó¥È¥ê¤ò /etc/grid-security/grid-mapfile ¤ËÄɲä·¤Þ¤¹¡¥ ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¾å¤Ç°Ê²¼¤Î¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤·¤Æ¡¤¤³¤ì¤«¤é¹Ô¤¦ÀßÄê¤Ë´Ø¤·¤Æ¡¤ ŬÀڤʥǥե©¥ë¥ÈÃͤ¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¤«³Îǧ¤·¤Þ¤¹¡¥ # config-gfarm -t -A -a gsi_auth -D -a ¥ª¥×¥·¥ç¥ó¡¤-D ¥ª¥×¥·¥ç¥ó¤Ï GSI ǧ¾Ú¤òÍøÍѤ·¤Ê¤¤¾ì¹ç¤ÏɬÍפ¢¤ê¤Þ¤»¤ó¡¥ -a ¥ª¥×¥·¥ç¥ó¤Ï¡¤Gfarm ¤Ë¤ª¤±¤ëǧ¾ÚÊý¼°¤ò»ØÄꤹ¤ë¤â¤Î¤Ç¤¹¡¥¥Ç¥Õ¥©¥ë¥È¤Ï sharedsecret¡Ê¶¦Í­¸°Ç§¾Ú¡Ë¤È¤Ê¤ê¤Þ¤¹¡¥Ç§¾ÚÊý¼°¤Ë´Ø¤¹¤ë¾ÜºÙ¤Ï gfarm2.conf(5) ¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤¢¤ë¤¤¤Ï Gfarm-FAQ.ja ¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡¥ ¤â¤·¥Ç¥Õ¥©¥ë¥ÈÃͤ¬Å¬ÀڤǤʤ¤¾ì¹ç¤Ë¤Ï¡¤É½¼¨¤µ¤ì¤ë¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤ÆÀß Äê¤òÊѹ¹¤Ç¤­¤Þ¤¹¡¥ ŬÀÚ¤ÊÀßÄê¤Ë¤Ê¤Ã¤¿¤é¡¤config-gfarm ¥³¥Þ¥ó¥É¤Î¥ª¥×¥·¥ç¥ó¤«¤é -t ¤ò¼è¤ê ½ü¤¤¤Æ¼Â¹Ô¤·¤Þ¤¹¡¥ ¥¨¥é¡¼¤¬µ¯¤­¤Ê¤±¤ì¤Ð¡¤¥Ð¥Ã¥¯¥¨¥ó¥É DB ¤ÎÀßÄê¤Èµ¯Æ°¡¤ÀßÄê¥Õ¥¡¥¤¥ë /etc/gfarm2.conf¡¤/etc/gfmd.conf ¤ÎºîÀ®¡¤¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð gfmd ¤Îµ¯Æ° ¤¬¹Ô¤ï¤ì¤Þ¤¹¡¥ prefix ¤Ï¡¤ÆÃ¤ËƱ°ì¥µ¡¼¥Ð¤ÇÊ£¿ô¤Î Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ËÂФ¹¤ë¥á¥¿ ¥Ç¡¼¥¿¥µ¡¼¥Ð¤òΩ¤Á¾å¤²¤ë¾ì¹ç¤Ê¤É¤Ë»ØÄꤷ¤Þ¤¹¡¥¤³¤Î¾ì¹ç¡¤prefix ¤Ç»Ø Äꤷ¤¿¥Ç¥£¥ì¥¯¥È¥ê¤Î²¼¤ËÀßÄê¥Õ¥¡¥¤¥ë¤¬À¸À®¤µ¤ì¤Þ¤¹¡¥ ¶¦Í­¸°Ç§¾Ú¤Ç gfsd ¤È¤Îǧ¾Ú¤ò¹Ô¤¦¾ì¹ç¤Ï¡¤¥æ¡¼¥¶¡Ö_gfarmfs¡×¤òºîÀ®¤·¡¤¤½ ¤Î¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê¤Ë¡¤Ç§¾Ú¸°¥Õ¥¡¥¤¥ë¤òÃÖ¤­¤Þ¤¹¡¥ # useradd -c "Gfarm gfsd" _gfarmfs ¤â¤·¡¤¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤¬¡¤NFS ¤Ç¥Ç¥£¥¹¥¯¤ò¶¦ Í­¤·¤Æ¤¤¤ë¤Ê¤é¤Ð¡¤¥æ¡¼¥¶ _gfarmfs ¤Î¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê¤ò NFS ¾å¤ËÃÖ ¤­¡¤Ç§¾Ú¸°¤ò NFS ¤Ç¶¦Í­¤¹¤ë¤³¤È¤ò¤ª´«¤á¤·¤Þ¤¹¡¥ ¥æ¡¼¥¶¡Ö_gfarmfs¡×¤Î¸¢¸Â¤Ç¡¤¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê¤Ëǧ¾Ú¸°¥Õ¥¡¥¤¥ë ¡Ö.gfarm_shared_key¡×¤òºîÀ®¤·¤Þ¤¹¡¥ # su _gfarmfs $ gfkey -f -p 31536000 ¤³¤³¤Ç¤Ï¡¤Ç§¾Ú¸°¤Î´ü¸Â¤ò¡¤¤Û¤Ü1ǯ(31536000ÉÃ) ¤ËÀßÄꤷ¤Æ¤¤¤Þ¤¹¡¥ °Ê¾å¤Ç¡¤¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¡¼¾å¤Ç¤ÎÀßÄê¤Ï´°Î»¤Ç¤¹¡¥ ²¼µ­¤ò¼Â¹Ô¤·¤Æ¡¤gfmd ¤¬Æ°ºî¤·¤Æ¤¤¤ë¤³¤È¤ò³Îǧ¤·¤Æ¤¯¤À¤µ¤¤¡¥ # /etc/init.d/gfmd status Red Hat ·Ï¤Î Linux ¤Î¾ì¹ç¡¤chkconfig ¥³¥Þ¥ó¥É¤òÍѤ¤¤Æ¡¤¼«Æ°µ¯Æ°¤ÎÀßÄê ¤ò¹Ô¤Ê¤¨¤Þ¤¹¡¥ # chkconfig --add gfmd # chkconfig --add gfarm-pgsql (¤¢¤ë¤¤¤Ï # chkconfig --add gfarm-slapd) Debian ·Ï¤Î Linux ¤Î¾ì¹ç¡¤update-rc.d ¥³¥Þ¥ó¥É¤òÍѤ¤¤Æ¡¤¼«Æ°µ¯Æ°¤ÎÀßÄê ¤ò¹Ô¤Ê¤¨¤Þ¤¹¡¥ # update-rc.d gfmd defaults # update-rc.d gfarm-pgsql defaults (¤¢¤ë¤¤¤Ï # update-rc.d gfarm-slapd defaults) ¾åµ­ºî¶È¤Ë¤è¤Ã¤ÆºîÀ®¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤ò¾Ãµî¤·¤¿¤¤¾ì¹ç¤Ë¤Ï¡¤²¼µ­¤Î¥³¥Þ¥ó¥É ¤Ç gfmd ¤ª¤è¤Ó¥Ð¥Ã¥¯¥¨¥ó¥É¥Ç¡¼¥¿¥Ù¡¼¥¹¥µ¡¼¥Ð¤òÄä»ß¤µ¤»¤¿¤Î¤Á¡¤ # /etc/init.d/gfmd stop (¾ì¹ç¤Ë¤è¤Ã¤Æ¤Ï # killall gfmd) # /etc/init.d/gfarm-pgsql stop (¤¢¤ë¤¤¤Ï # /etc/init.d/gfarm-slapd stop) ²¼µ­¤Î¥³¥Þ¥ó¥É¤Çºï½ü¤Ç¤­¤Þ¤¹¡¥ # rm -f /etc/gfarm2.conf /etc/gfmd.conf # rm -f /etc/init.d/gfarm-* /etc/init.d/gfmd # rm -rf /var/gfarm-* ¢¦ ¥Õ¥¡¥¤¥¢¥¦¥©¡¼¥ë¤ÎÀßÄê ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¾å¤Ç¤Ï¡¤config-gfarm ¤Î -m ¥ª¥×¥·¥ç¥ó¤Ç»ØÄꤷ¤¿¥Ý¡¼¥È ¤Ë¤Ä¤¤¤Æ¡¤TCP ¤Ç¤Î¥³¥Í¥¯¥·¥ç¥ó¤ò¼õ¤±ÉÕ¤±¤ë¤è¤¦¤ËÀßÄꤷ¤Æ¤ª¤¯É¬Íפ¬¤¢¤ê ¤Þ¤¹¡¥ ¡ü ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤ÎÀßÄê =============================== ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤òÀßÄꤹ¤ë¤¿¤á¤Ë¤ÏÀßÄꤹ¤ë¥Û¥¹¥È¤Î root ¸¢¸Â¤¬É¬ ÍפǤ¹¡¥°Ê²¼¤ÎÀßÄê¤Ï root ¸¢¸Â¤Ç¹Ô¤¤¤Þ¤¹¡¥ ¥æ¡¼¥¶¡Ö_gfarmfs¡×¤¬Ìµ¤¤¾ì¹ç¤ÏºîÀ®¤·¤Þ¤¹¡¥ # useradd -c "Gfarm gfsd" _gfarmfs ¶¦Í­¸°Ç§¾Ú¤Î¾ì¹ç¤Ï¡¤¥æ¡¼¥¶¡Ö_gfarmfs¡×¤Î¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê¤Ë¡¤¥á¥¿¥Ç¡¼ ¥¿¥µ¡¼¥Ð¤ÇºîÀ®¤·¤¿Ç§¾Ú¸°¥Õ¥¡¥¤¥ë¡Ö.gfarm_shared_key¡×¤ò¥³¥Ô¡¼¤·¤Þ¤¹¡¥ ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤È¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤¬¡¤NFS ¤Ç¥Û¡¼¥à¥Ç¥£¥ì ¥¯¥È¥ê¤ò¶¦Í­¤·¤Æ¤¤¤ë¾ì¹ç¤Ï¡¤´û¤Ë¸ºß¤¹¤ë¤¿¤á¥³¥Ô¡¼¤¹¤ëɬÍפϤ¢ ¤ê¤Þ¤»¤ó ¡Ö.gfarm_shared_key¡×¤Î¥Õ¥¡¥¤¥ë¤Î¥â¡¼¥É¤¬¡Ö0600¡×¡¤¥Õ¥¡¥¤¥ë ¤Î½êÍ­¼Ô¤¬¡Ö_gfarmfs¡×¤È¤Ê¤Ã¤Æ¤¤¤ë¤«¤É¤¦¤«³Îǧ¤·¤Æ¤¯¤À¤µ¤¤¡¥ GSI ǧ¾Ú¤Î¾ì¹ç¤Ï¡¤gfsd ÍѤΥµ¡¼¥Ó¥¹¾ÚÌÀ½ñ¤ò¼èÆÀ¤·¤Þ¤¹¡¥ ¥µ¡¼¥Ó¥¹¾ÚÌÀ½ñ¤Ï¡¤Distinguished Name ¤Î¡ÖCN=¡×¤ÎÉôʬ¤Ë¡¤ ¡Ögfsd/¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Î¥Û¥¹¥È̾¡×¤ÈÀßÄꤵ¤ì¤Æ¤¤¤ë ɬÍפ¬¤¢¤ê¤Þ¤¹¤Î¤Ç¡¤Ãí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡¥¤¿¤È¤¨¤Ð¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¡¦¥Î¡¼¥É ¡Ölinux-1.example.com¡×¤ËÂбþ¤¹¤ë CN Éô¤Ï¡¤¡ÖCN=gfsd/linux-1.example.com¡× ¤È¤Ê¤ê¤Þ¤¹¡¥ ¾ÚÌÀ½ñ¤Ï /etc/grid-security/gfsd/gfsd{cert,key}.pem ¤ËÃÖ¤­¡¤¥Ç¥£¥ì¥¯ ¥È¥ê¤È¥Õ¥¡¥¤¥ë¤Î¥ª¡¼¥Ê¤ò _gfarmfs ¤È¤·¤Þ¤¹¡¥gfsdkey.pem ¤Î¥Õ¥¡¥¤¥ë¥â¡¼ ¥É¤Ï 0400 ¤È¤·¤Þ¤¹¡¥ ¼¡¤Ë¡¤¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤ÇÀ¸À®¤µ¤ì¤¿ /etc/gfarm2.conf ¥Õ¥¡¥¤¥ë¤ò¥Õ¥¡¥¤¥ë ¥·¥¹¥Æ¥à¥Î¡¼¥É¤Î /etc ¤Ë¥³¥Ô¡¼¤·¤Þ¤¹¡¥ ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¾å¤Ç°Ê²¼¤Î¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤·¤Æ¡¤¤³¤ì¤«¤é¹Ô¤¦ÀßÄê¤Ë ´Ø¤·¤Æ¡¤Å¬Àڤʥǥե©¥ë¥ÈÃͤ¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¤«³Îǧ¤·¤Þ¤¹¡¥ # config-gfsd -t /var/gfarm ¤â¤·¥Ç¥Õ¥©¥ë¥ÈÃͤ¬Å¬ÀڤǤʤ¤¾ì¹ç¤Ë¤Ï¡¤É½¼¨¤µ¤ì¤ë¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Æ ÀßÄê¤òÊѹ¹¤Ç¤­¤Þ¤¹¡¥ config-gfsd ¥³¥Þ¥ó¥É¤ÎºÇ¸å¤Î°ú¿ô¤Ï Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¼ÂÂÎ¥Õ¥¡ ¥¤¥ë¤¬³ÊǼ¤µ¤ì¤ë¥¹¥×¡¼¥ë¡¦¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤¹¡¥¥¹¥×¡¼¥ë¡¦¥Ç¥£¥ì¥¯¥È¥ê¤Ï¡¤ ¾¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤È¶¦Í­¤µ¤ì¤Ê¤¤Îΰè¤ò»ØÄꤷ¤Æ¤¯¤À¤µ¤¤¡¥ ŬÀÚ¤ÊÀßÄê¤Ë¤Ê¤Ã¤¿¤é¡¤config-gfsd ¥³¥Þ¥ó¥É¤Î¥ª¥×¥·¥ç¥ó¤«¤é -t ¤ò¼è¤ê½ü ¤¤¤Æ¼Â¹Ô¤·¤Þ¤¹¡¥ ÆÃ¤Ë¥ª¥×¥·¥ç¥ó¤ò»ØÄꤹ¤ëɬÍפ¬¤Ê¤¤¤Î¤Ç¤¢¤ì¤Ð¡¤°Ê²¼¤ò¼Â¹Ô¤¹¤ë¤³¤È¤Ë¤Ê ¤ê¤Þ¤¹¡¥ # config-gfsd /var/gfarm ¤³¤ÎºÇ¸å¤Ë¡¤¡Ögfhost¡×¥³¥Þ¥ó¥É¤Î¼Â¹Ô¤ò¤¦¤Ê¤¬¤¹É½¼¨¤¬¹Ô¤Ê¤ï¤ì¤¿È¦¤Ç¤¹¡¥ ¤½¤Îɽ¼¨¤ò Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î´ÉÍý¼Ô¤ÎÅÁ¤¨¡¤¼Â¹Ô¤·¤Æ¤â¤é¤Ã¤Æ¤¯¤À ¤µ¤¤¡¥ ¤³¤Î»þ¡¤´ÉÍý¼Ô¤Ï¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤òÀßÄꤷ¤¿¥Û¥¹¥È¤Ç gfhost ¥³¥Þ¥ó¥É¤ò ¼Â¹Ô¤·¤Þ¤¹¡¥¶¦Í­¸°Ç§¾Ú¤Î¾ì¹ç¤Ï¡¤´ÉÍý¼Ô¤È¤·¤Æ»ØÄꤷ¤¿¥°¥í¡¼¥Ð¥ë¥æ¡¼¥¶ ̾¤ÈƱ°ì̾¡¤¤¢¤ë¤¤¤Ï¥æ¡¼¥¶¥Þ¥Ã¥×¥Õ¥¡¥¤¥ë¤Ç¥Þ¥Ã¥×¤µ¤ì¤¿¥¢¥«¥¦¥ó¥È¤Î°ì È̥桼¥¶¸¢¸Â¤Ç¼Â¹Ô¤·¤Þ¤¹¡¥GSI ǧ¾Ú¤Î¾ì¹ç¤Ï¡¤-D ¥ª¥×¥·¥ç¥ó¤Ç»ØÄꤷ¤¿ ¥æ¡¼¥¶¾ÚÌÀ½ñ¤òÍøÍѤ·¤Æ¼Â¹Ô¤·¤Þ¤¹¡¥ $ /usr/bin/gfhost -c -a i386-fedora5-linux -p 600 -n 2 node1.example.org GSI ǧ¾Ú¤Î¾ì¹ç¤Ï¡¤gfmd ¤Î /etc/grid-security/grid-mapfile ¤Ë gfsd ¤Î ¥µ¡¼¥Ó¥¹¾ÚÌÀ½ñ¤ò°Ê²¼¤Î·Á¼°¤ÇÄɲä·¤Þ¤¹¡¥@host@ ¤Ï¶¦Ä̤θÇÄêʸ»úÎó¤Ç ¤¹¡¥Êѹ¹¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó¡¥ "Subject DN of gfsd server cert" @host@ FQDN root ¸¢¸Â¤Ë¤Ê¤ê¡¤²¼µ­¤Î¥³¥Þ¥ó¥É¤Ç gfsd ¤òµ¯Æ°¤·¤Þ¤¹¡¥ # /etc/init.d/gfsd start °Ê¾å¤ÇÀßÄê¤Ï´°Î»¤Ç¤¹¡¥ ²¼µ­¤ò¼Â¹Ô¤·¤Æ¡¤gfsd ¤¬Æ°ºî¤·¤Æ¤¤¤ë¤³¤È¤ò³Îǧ¤·¤Æ¤¯¤À¤µ¤¤¡¥ # /etc/init.d/gfsd status Red Hat ·Ï¤Î Linux ¤Î¾ì¹ç¡¤chkconfig ¥³¥Þ¥ó¥É¤òÍѤ¤¤Æ¡¤¼«Æ°µ¯Æ°¤ÎÀßÄê ¤ò¹Ô¤Ê¤¨¤Þ¤¹¡¥ # chkconfig --add gfsd Debian ·Ï¤Î Linux ¤Î¾ì¹ç¡¤update-rc.d ¥³¥Þ¥ó¥É¤òÍѤ¤¤Æ¡¤¼«Æ°µ¯Æ°¤ÎÀßÄê ¤ò¹Ô¤Ê¤¨¤Þ¤¹¡¥ # update-rc.d gfsd defaults ¾åµ­ºî¶È¤Ë¤è¤Ã¤ÆºîÀ®¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤ò¾Ãµî¤·¤¿¤¤¾ì¹ç¤Ë¤Ï¡¤ ²¼µ­¤Î¥³¥Þ¥ó¥É¤Ç gfsd ¤òÄä»ß¤µ¤»¤¿¤Î¤Á¡¤ # /etc/init.d/gfsd stop ²¼µ­¤Î¥³¥Þ¥ó¥É¤Çºï½ü¤Ç¤­¤Þ¤¹¡¥ # rm -f /etc/gfarm2.conf /etc/init.d/gfsd # rm -rf ¥¹¥×¡¼¥ë¡¦¥Ç¥£¥ì¥¯¥È¥ê ¢¦ ¥Õ¥¡¥¤¥¢¥¦¥©¡¼¥ë¤ÎÀßÄê ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¾å¤Ç¤Ï¡¤config-gfsd ¤Î -p ¥ª¥×¥·¥ç¥ó¤Ç»ØÄꤷ¤¿ ¥Ý¡¼¥È¤Ë¤Ä¤¤¤Æ¡¤TCP ¤Î¥³¥Í¥¯¥·¥ç¥ó¤Î¼õ¤±ÉÕ¤±¤È¡¤UDP ¥Ñ¥±¥Ã¥È¤ÎÃå¿®¤È Á÷¿®¤¬¤Ç¤­¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡¥ ¤µ¤é¤Ë¡¤¥¯¥é¥¤¥¢¥ó¥È¥Î¡¼¥É¤ÈƱÍͤÊÀßÄê¤âɬÍפǤ¹¡¥ ¡ü ¥¯¥é¥¤¥¢¥ó¥È¥Î¡¼¥É¤ÎÀßÄê =========================== Á°¾Ï¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤ÎÀßÄê¤Ë¥¯¥é¥¤¥¢¥ó¥È¥Î¡¼¥É¤ÎÀßÄê¤Ï´Þ¤Þ¤ì¤Æ ¤¤¤Þ¤¹¤¬¡¤¤³¤Î¾Ï¤Ç¤Ï¥¯¥é¥¤¥¢¥ó¥È¥Î¡¼¥É¤À¤±¤ÎÀßÄê¤òÀâÌÀ¤·¤Þ¤¹¡¥ ¢¦ ¥¯¥é¥¤¥¢¥ó¥È¥Î¡¼¥É¤ÎÀßÄê ¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤ÇÀ¸À®¤µ¤ì¤¿ /etc/gfarm2.conf ¥Õ¥¡¥¤¥ë¤ò /etc ¤Ë¥³¥Ô¡¼ ¤·¤Þ¤¹¡¥ ¶¦Í­¸°Ç§¾Ú¤Î¾ì¹ç¡¤¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤ä¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤È¤Î´Ö¤Ç¡¤¥æ¡¼ ¥¶¤Î¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê¤¬ NFS ¤Ç¶¦Í­¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¤°Ê¾å¤ÇÀßÄê¤Ï´° λ¤Ç¤¹¡¥ ¶¦Í­¤µ¤ì¤Æ¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¤¥³¥Þ¥ó¥É¡Ögfkey -c¡×¤Ç¡¤Ç§¾Ú¸°¥Õ¥¡¥¤¥ë ¡Ö.gfarm_shared_key¡×¤ò³Æ¥æ¡¼¥¶¤¬¤½¤Î¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê¤ËºîÀ®¤·¤¿¸å¡¤ ¤½¤Îǧ¾Ú¸°¥Õ¥¡¥¤¥ë¤ò¡¤¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤äÁ´¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Ø¥³¥Ô¡¼ ¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡¥ GSI ǧ¾Ú¤Î¾ì¹ç¡¤¥æ¡¼¥¶¾ÚÌÀ½ñ¤ò¼èÆÀ¤·¤Æ¡¤gfmd ¤ª¤è¤Ó³Æ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à ¥Î¡¼¥É¤Î grid-mapfile ¤Ë¼«Ê¬¤Î¥¨¥ó¥È¥ê¤òÄɲ䷤Ƥâ¤é¤¤¤Þ¤¹¡¥ ¢¦ ¥Õ¥¡¥¤¥¢¥¦¥©¡¼¥ë¤ÎÀßÄê ¥¯¥é¥¤¥¢¥ó¥È¥Î¡¼¥É¤Ç¤Ï¡¤config-gfarm ¤Î -m ¥ª¥×¥·¥ç¥ó¤Ç»ØÄꤷ¤¿¥Ý¡¼¥È ¤Ë¤Ä¤¤¤Æ¡¤¥á¥¿¥Ç¡¼¥¿¥µ¡¼¥Ð¤ËÂФ¹¤ë TCP ¥³¥Í¥¯¥·¥ç¥ó¤òȯ¸Æ¤Ç¤­¤ëɬÍפ¬ ¤¢¤ê¤Þ¤¹¡¥ ¤µ¤é¤Ë¡¤¤½¤ì¤¾¤ì¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Ë¤Ä¤¤¤Æ¡¤config-gfsd ¤Î -p ¥ª ¥×¥·¥ç¥ó¤Ç»ØÄꤷ¤¿¥Ý¡¼¥È¤ËÂФ·¤Æ¡¤TCP ¥³¥Í¥¯¥·¥ç¥ó¤Îȯ¸Æ¤È¡¤UDP ¥Ñ¥±¥Ã ¥È¤ÎÁ÷¼õ¿®¤¬¤Ç¤­¤ëɬÍפ⤢¤ê¤Þ¤¹¡¥ ¡ü Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ÎÍøÍѳÎǧ =================================== Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ï¡¤¥¯¥é¥¤¥¢¥ó¥È¤ÎÀßÄê¤ò¤·¤Æ¤¤¤ë¥Î¡¼¥É¤Ç¤¢¤ì¤Ð¡¤ ¤É¤Î¥Î¡¼¥É¤Ç¤âÍøÍѡʶ¦Í­¡Ë¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡¥ ¡þ gfls - ¥Ç¥£¥ì¥¯¥È¥ê¡¦¥ê¥¹¥Æ¥£¥ó¥° % gfls -la drwxrwxr-x gfarmadm gfarmadm 4 Aug 23 06:33 . drwxrwxr-x gfarmadm gfarmadm 4 Aug 23 06:33 .. drwxr-xr-x tatebe gfarmadm 0 Aug 22 16:08 tmp ¡þ gfhost - ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¾ðÊó¤Îɽ¼¨ ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤¬Àµ¤·¤¯ÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë¤«¤É¤¦¤«¡¤gfhost ¥³¥Þ¥ó¥É¤Ç ³Îǧ¤·¤Þ¤¹¡¥ % gfhost -M i386-fedora3-linux 2 linux-1.example.com 600 0 i386-fedora3-linux 2 linux-2.example.com 600 0 i386-fedora3-linux 2 linux-3.example.com 600 0 i386-redhat8.0-linux 1 linux-4.example.com 600 0 sparc-sun-solaris8 1 solaris-1.example.com 600 0 sparc-sun-solaris8 1 solaris-2.example.com 600 0 ... ¼¡¤Ë¡¤ÍøÍѲÄǽ¤«¤É¤¦¤«³Îǧ¤·¤Þ¤¹¡¥ % gfhost -lv 0.01/0.03/0.03 s i386-fedora3-linux 2 linux-1.example.com 600 0(10.0.0.1) 0.00/0.00/0.00 s i386-fedora3-linux 2 linux-2.example.com 600 0(10.0.0.2) -.--/-.--/-.-- - i386-fedora3-linux 2 linux-3.example.com 600 0(10.0.0.3) 0.00/0.02/0.00 x i386-redhat8.0-linux 1 linux-4.example.com 600 0(10.0.0.4) 0.10/0.00/0.00 G sparc-sun-solaris8 1 solaris-1.example.com 600 0(10.0.1.1) x.xx/x.xx/x.xx - sparc-sun-solaris8 1 solaris-2.example.com 600 0(10.0.1.2) ... º¸¤«¤éÆóÈÖÌܤÎʸ»ú¤¬ 's', 'g', 'G' ¤Ç¤¢¤ì¤Ð¡¤¤½¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É ¤¬ÍøÍѲÄǽ¤Ç¤¹¡¥'x' ¤Î¾ì¹ç¤Ïǧ¾Ú¤Ë¼ºÇÔ¤·¤Æ¤¤¤Þ¤¹¡¥ ¤Þ¤¿¡¤°ìÈÖº¸¤¬ '-.--/-.--/-.--' ¤Èɽ¼¨¤µ¤ì¤ë¾ì¹ç¤Ï¡¤gfsd ¤¬Àµ¤·¤¯µ¯Æ°¤· ¤Æ¤¤¤Ê¤¤¤³¤È¤ò¼¨¤·¤Æ¤ª¤ê¡¤'x.xx/x.xx/x.xx' ¤Èɽ¼¨¤µ¤ì¤ë¾ì¹ç¤Ï¡¤¤½¤Î¥Î¡¼ ¥É¤ËÀܳ¤Ç¤­¤Ê¤¤¡ÊÍî¤Á¤Æ¤¤¤ë¡Ë¤³¤È¤ò¼¨¤·¤Æ¤¤¤Þ¤¹¡¥ ¡þ gfdf - ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Î¥Õ¥¡¥¤¥ëÍÆÎ̤Îɽ¼¨ ¸½ºßÍøÍѲÄǽ¤Ê¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ÎÍÆÎ̤òɽ¼¨¤·¤Þ¤¹¡¥ % gfdf 1K-blocks Used Avail Capacity Host 1824815008 213068 1824601940 0% linux-1.example.com 6835798016 71836400 6763961616 1% linux-2.example.com 1669232308 44224088 1625008220 3% solaris-1.example.com --------------------------------------------- 10329845332 116273556 10213571776 1% ¤Ê¤ª¡¤¾åµ­¥³¥Þ¥ó¥É¤Î¾ÜºÙ¤Ï¡¤man ¥Ú¡¼¥¸¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡¥ ¡ü ÍøÍѥ桼¥¶¤ÎÅÐÏ¿ =================== Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤òÍøÍѤ¹¤ë¤¿¤á¤Ë¤Ï¡¤Gfarm ¤Î´ÉÍý¼Ô¸¢¸Â¤ò¤â¤Ä¥æ¡¼ ¥¶¤¬ÍøÍѥ桼¥¶¤òÅÐÏ¿¤·¡¤Gfarm ¤Î root ¸¢¸Â¤ò»ý¤Ä¥æ¡¼¥¶¤¬¥Û¡¼¥à¥Ç¥£¥ì¥¯ ¥È¥ê¤òºîÀ®¤·¤Þ¤¹¡¥ config-gfarm ¤Ç»ØÄꤷ¤¿´ÉÍý¼Ô¤Ï¡¤¼«Æ°Åª¤Ë´ÉÍý¼Ô¸¢¸Â¤ò»ý¤Ä¥æ¡¼¥¶¤È¤· ¤ÆÅÐÏ¿¤¬¤Ê¤µ¤ì¤ë¤¿¤á¡¤¥æ¡¼¥¶ÅÐÏ¿¤ÎɬÍפϤ¢¤ê¤Þ¤»¤ó¡¥ Gfarm ¤Î´ÉÍý¼Ô¸¢¸Â¤ò»ý¤Ä¥æ¡¼¥¶¤Ï gfarmadm ¥°¥ë¡¼¥×¤Ë½ê°¤·¤Æ¤¤¤ë¥æ¡¼ ¥¶¤Ç¤¹¡¥ Gfarm ¤Î root ¸¢¸Â¤ò»ý¤Ä¥æ¡¼¥¶¤Ï gfarmroot ¥°¥ë¡¼¥×¤Ë½ê°¤·¤Æ¤¤¤ë¥æ¡¼ ¥¶¤Ç¤¹¡¥¼¡Àá¤â»²¹Í¤Ë¤·¤Æ¤¯¤À¤µ¤¤¡¥ ÅÐÏ¿¤Ë¤Ï gfuser ¥³¥Þ¥ó¥É¤òÍøÍѤ·¤Þ¤¹¡¥ % gfuser -c global_username realname homedir gsi_dn global_username ¤Ï¡¤Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¾å¤Î¥°¥í¡¼¥Ð¥ë¤Ê¥æ¡¼¥¶Ì¾¡¤ realname ¤Ï¿Í´Ö¤¬¥æ¡¼¥¶¤ò¼±Ê̤Ǥ­¤ë̾Á°¡¤homedir ¤Ï Gfarm ¾å¤Î¥Û¡¼¥à¥Ç¥£ ¥ì¥¯¥È¥ê¡¤gsi_dn ¤Ï GSI ǧ¾Ú¤Ë¤ª¤±¤ë¥æ¡¼¥¶¾ÚÌÀ½ñ¤Î Subject DN ¤Ç¤¹¡¥ ¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê¤Ï 2009ǯ9·î¸½ºßÍøÍѤµ¤ì¤Æ¤¤¤Þ¤»¤ó¡¥ realname ¤Ê¤É¤Ë space ¤ò´Þ¤à¾ì¹ç¤Ï¡¤¥À¥Ö¥ë¥¯¥ª¡¼¥È¤Ê¤É¤Ç³ç¤ê¤Þ¤¹¡¥Î㤨 ¤Ð¡¤°Ê²¼¤Î¤è¤¦¤Ë¤·¤Æ¥°¥í¡¼¥Ð¥ë¥æ¡¼¥¶ taro ¤òÅÐÏ¿¤·¤Þ¤¹¡¥ % gfuser -c taro "Taro Tsukuba" /home/taro "" ¤½¤Î¸å¡¤¥æ¡¼¥¶¤Î¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê¤òºîÀ®¤·¤Þ¤¹¡¥¥æ¡¼¥¶¥Ç¥£¥ì¥¯¥È¥ê¤Îºî À®¤Ï¡¤Gfarm ¤Î root ¸¢¸Â¤¬É¬ÍפȤʤê¤Þ¤¹¡¥ ¾åµ­¤Î¾ì¹ç¡¤°Ê²¼¤ÎÍͤ˺îÀ®¤·¤Þ¤¹¡¥ % gfmkdir /home % gfmkdir /home/taro % gfchown taro /home/taro ¡ü ´ÉÍý¼Ô¸¢¸Â¡¤root ¸¢¸Â¤ò¤â¤Ä¥æ¡¼¥¶¤ÎÅÐÏ¿ ========================================== Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ò´ÉÍý¤¹¤ë¤¿¤á¤Î¥æ¡¼¥¶¤È¤·¤Æ¡¤´ÉÍý¼Ô¸¢¸Â¤ò¤â¤Ä¥æ¡¼ ¥¶¡¤root ¸¢¸Â¤ò¤â¤Ä¥æ¡¼¥¶¤òÅÐÏ¿¤·¤Þ¤¹¡¥ÅÐÏ¿¤Ë¤Ï Gfarm ¤Î´ÉÍý¼Ô¸¢¸Â¤¬É¬ ÍפǤ¹¡¥ ´ÉÍý¼Ô¸¢¸Â¤È¤Ï¡¤¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¡¤Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ÎÍøÍѼԡ¤ ¥°¥ë¡¼¥×¤ÎÄɲ᤽¤Àµ¡¤ºï½ü¤ò¹Ô¤¦¸¢¸Â¤Ç¤¹¡¥ root ¸¢¸Â¤È¤Ï¡¤Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î¥¢¥¯¥»¥¹À©¸æ¤ò¹Ô¤¦¸¢¸Â¤Ç¤¹¡¥ ´ÉÍý¼Ô¸¢¸Â¤ò»ý¤Ä¥æ¡¼¥¶¤Ï¡¤gfarmadm ¥°¥ë¡¼¥×¤Ë½ê°¤µ¤»¤Þ¤¹¡¥°Ê²¼¤Î¥³¥Þ ¥ó¥É¤Ç¡¤¸½ºß½ê°¤·¤Æ¤¤¤ë¥æ¡¼¥¶¤òɽ¼¨¤Ç¤­¤Þ¤¹¡¥ % gfgroup -l gfarmadm ½ê°¥æ¡¼¥¶¤ÎÊѹ¹¤Ï°Ê²¼¤Ç¹Ô¤¤¤Þ¤¹¡¥ % gfgroup -m gfarmadm user1 user2 ... ½ê°¥æ¡¼¥¶¤ÎÊѹ¹¤Ç¤Ï¡¤½ê°¥æ¡¼¥¶¤ò»ØÄꤷ¤¿¥æ¡¼¥¶¤ËÊѹ¹¤·¡¤¤â¤È¤â¤È½ê° ¤·¤Æ¤¤¤¿¥æ¡¼¥¶¤Ï´°Á´¤Ë¾å½ñ¤­¤µ¤ì¤Æ¤·¤Þ¤¦¤È¤³¤í¤ËÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡¥ root ¸¢¸Â¤ò»ý¤Ä¥æ¡¼¥¶¤Ï¡¤Æ±ÍÍ¤Ë gfarmroot ¥°¥ë¡¼¥×¤Ë½ê°¤µ¤»¤Þ¤¹¡¥ % gfgroup -m gfarmroot user1 user2 ... ¡ü Gfarm ¤Î¿Ê¤ó¤ÀÍøÍÑ ===================== ¢¦ ¥Õ¥¡¥¤¥ë¤ÎÊ£À½ Gfarm ¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç¤Ï¡¤¥Õ¥¡¥¤¥ë¤Ï¤É¤³¤«¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Ë ³ÊǼ¤µ¤ì¤Þ¤¹¤¬¡¤Æó¤Ä°Ê¾å¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Ë¥Õ¥¡¥¤¥ë¤ÎÊ£À½¤òÊÝ»ý ¤¹¤ë¤³¤È¤â¤Ç¤­¤Þ¤¹¡¥ ¥Õ¥¡¥¤¥ë¤ÎÊ£À½¤òÊÝ»ý¤¹¤ë¤³¤È¤Ë¤è¤ê¡¤¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Î¡¼¥É¤Î¾ã³²»þ¤Ç¤â¡¤ ¥Õ¥¡¥¤¥ë¥¢¥¯¥»¥¹¤¬²Äǽ¤Ë¤Ê¤ë¾¡¤¥Õ¥¡¥¤¥ë¥¢¥¯¥»¥¹¤Îʬ»¶¤Ë¤è¤ê¥Õ¥¡¥¤¥ë¥¢ ¥¯¥»¥¹À­Ç½¤ÎÎô²½¤òËɤ°¤³¤È¤¬¤Ç¤­¤Þ¤¹¡¥ ¥Õ¥¡¥¤¥ë¤¬¤É¤³¤Ë³ÊǼ¤µ¤ì¤Æ¤¤¤ë¤«¤òÃΤ뤿¤á¤Ë¤Ï gfwhere ¥³¥Þ¥ó¥É¤òÍøÍѤ· ¤Þ¤¹¡¥ % gfwhere .bashrc linux-1.example.com ¥Õ¥¡¥¤¥ëÊ£À½¤òºîÀ®¤¹¤ë¤¿¤á¤Ë¤Ï gfrep ¥³¥Þ¥ó¥É¤¬½àÈ÷¤µ¤ì¤Æ¤¤¤Þ¤¹¡¥Î㤨¤Ð¡¤ ¤â¤¦°ì¤Ä¥Õ¥¡¥¤¥ëÊ£À½¤òºîÀ®¤·¤¿¤¤¾ì¹ç¤Ï¡¤°Ê²¼¤Î¤è¤¦¤Ë¤·¤Þ¤¹¡¥ % gfrep -N 2 .bashrc % gfwhere .bashrc linux-1.example.com linux-2.example.com ¤³¤Î¾ì¹ç¡¤linux-1 ¤È linux-2 ¤Ë¡¤¥Õ¥¡¥¤¥ë¤¬Ê£À½¤µ¤ì¤Æ³ÊǼ¤µ¤ì¤Æ¤¤¤Þ¤¹¡¥ gfarm-2.4.1/nls/0000755000000000000000000000000011507222730012103 5ustar rootrootgfarm-2.4.1/nls/ja_JP.UTF-8/0000755000000000000000000000000011507222730013670 5ustar rootrootgfarm-2.4.1/nls/ja_JP.UTF-8/Makefile0000644000000000000000000000043311507222720015327 0ustar rootroottop_builddir = ../.. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk ### ### variables ### CFLAGS = -I$(top_srcdir)/include CATALOG_FILES = gfarm.cat EXTRA_CLEAN_TARGETS = $(CATALOG_FILES) LOCALE = ja_JP.UTF-8 include $(top_srcdir)/makes/catalog.mk gfarm-2.4.1/nls/ja_JP.UTF-8/gfarm.msg0000644000000000000000000000024111507222720015470 0ustar rootroot#include "gfarm/gfarm_msg_enums.h" $ gfarm message catalog file sample $ . $ add customized message in following format. $ . $ GFARM_MSG_XXXXXXX gfarm-2.4.1/nls/Makefile0000644000000000000000000000044211507222720013542 0ustar rootroottop_builddir = .. top_srcdir = $(top_builddir) srcdir = . include $(top_srcdir)/makes/var.mk PRIVATE_TARGETS = $(PRIVATE_NLS_SUBDIRS) PUBLIC_TARGETS = SUBDIRS = \ $(optional_targets) \ # ja_JP.UTF-8 # commented out, because this is just a sample include $(top_srcdir)/makes/subdir.mk gfarm-2.4.1/configure0000755000000000000000000257777611507222727013263 0ustar rootroot#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.65. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, # Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error ERROR [LINENO LOG_FD] # --------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with status $?, using 1 if that was 0. as_fn_error () { as_status=$?; test $as_status -eq 0 && as_status=1 if test "$3"; then as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 fi $as_echo "$as_me: error: $1" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in #( -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case X$ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','` ;; esac echo=${ECHO-echo} if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then # Yippee, $echo works! : else # Restart under the correct shell. exec $SHELL "$0" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat </dev/null 2>&1 && unset CDPATH if test -z "$ECHO"; then if test "X${echo_test_string+set}" != Xset; then # find a string as large as possible, as long as the shell can cope with it for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... if (echo_test_string="`eval $cmd`") 2>/dev/null && echo_test_string="`eval $cmd`" && (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null then break fi done fi if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then : else # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for dir in $PATH /usr/ucb; do IFS="$lt_save_ifs" if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$dir/echo" break fi done IFS="$lt_save_ifs" if test "X$echo" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # This shell has a builtin print -r that does the trick. echo='print -r' elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running configure again with it. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} else # Try using printf. echo='printf %s\n' if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # Cool, printf works : elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL echo="$CONFIG_SHELL $0 --fallback-echo" elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then echo="$CONFIG_SHELL $0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null then break fi prev="$cmd" done if test "$prev" != 'sed 50q "$0"'; then echo_test_string=`eval $prev` export echo_test_string exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} else # Oops. We lost completely, so just stick with echo. echo=echo fi fi fi fi fi fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. ECHO=$echo if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" fi tagnames=${tagnames+${tagnames},}CXX tagnames=${tagnames+${tagnames},}F77 test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= PACKAGE_URL= ac_unique_file="RELNOTES" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='LTLIBOBJS LIBOBJS optional_targets optional_cflags optional_objs optional_srcs optional_rule optional_config top_private_dir gfvoms_sync_targets PYTHON_SPECIFIED config_gfarm_sysdep_subdir gfs_hook_sysdep_subdir postgresql_targets postgresql_cflags postgresql_objs postgresql_srcs postgresql_libs postgresql_includes ldap_targets ldap_cflags ldap_objs ldap_srcs ldap_libs ldap_includes largefile64_targets largefile64_cflags largefile64_objs largefile64_srcs largefile_ldflags largefile_cflags gfarmd_username gfarm_rsh default_ns_exec_bindir default_ns_exec_root default_ns_port default_ns_server readline_libs readline_includes mpi_targets mpi_cflags mpi_objs mpi_srcs mpicc gfshook_targets gfshook_cflags gfshook_objs gfshook_srcs globus_targets globus_cflags globus_objs globus_srcs globus_gssapi_libs globus_includes globus_location globus_flavor openssl_libs openssl_includes pthread_targets pthread_cflags pthread_objs pthread_srcs pthread_libs pthread_includes LIBTOOL ac_ct_F77 FFLAGS F77 CXXCPP ac_ct_CXX CXXFLAGS CXX CPP STRIP RANLIB AR ECHO LN_S EGREP GREP INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM YFLAGS YACC MKDIR_P LEXLIB LEX_OUTPUT_ROOT LEX OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC host_os host_vendor host_cpu host build_os build_vendor build_cpu build target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_shared enable_static enable_fast_install with_gnu_ld enable_libtool_lock with_pic with_tags with_pthread with_openssl with_globus_static with_globus_flavor with_globus with_gfshook with_mpi with_readline with_default_ns_server with_default_ns_port with_default_ns_exec_root with_gfarm_rsh with_gfarmd_username with_mtsafe_netdb with_openldap with_postgresql enable_voms enable_xmlattr with_private_srcdir ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS YACC YFLAGS CPP CXX CXXFLAGS CCC CXXCPP F77 FFLAGS' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error "unrecognized option: \`$ac_option' Try \`$0 --help' for more information." ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --enable-voms Enable voms collaboration.[[default=yes]] --enable-xmlattr support XML extended attributs and searching by XPath.[[default=yes]] Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-pic try to use only PIC/non-PIC objects [default=use both] --with-tags[=TAGS] include additional configurations [automatic] --with-pthread=PTHREAD_ROOT pthread root directory [default=/usr] --without-pthread disable pthread support --with-openssl=OpenSSL_ROOT openssl root directory [default=/usr] --with-globus-static link static version of globus libraries instead of shared version [default=disable] --with-globus-flavor=FLAVOR globus flavor name [default=guessed] --with-globus=GLOBUS_ROOT globus root directory [default=disable] --with-gfshook build libgfs_hook.so syscall hooking library [default] --without-gfshook disable to build syscall hooking library --with-mpi=MPI_ROOT MPI root directory [default=disable] --with-readline=READLINE_ROOT readline root directory [default=disable] --with-default-ns-server=HOSTNAME default hostname of ns server [default=localhost] --with-default-ns-port=PORTNUMBER default port number of ns server [default=5000] --with-default-ns-exec-root=DIR default top directory of ns_exec [default=PREFIX] --with-gfarm-rsh=RSH command name equivalent to rsh [default=rsh] --with-gfarmd-username=DIR default username of gfarmd [default=nobody] --without-mtsafe-netdb getaddrinfo(3) and getnameinfo(3) are MT-Safe? [default=yes] --with-openldap=OpenLDAP_ROOT openldap root directory [default=guessed] --without-openldap disable openldap --with-postgresql=PostgreSQL_ROOT PostgreSQL root directory [default=guessed] --without-postgresql disable PostgreSQL --with-private-srcdir=DIR private source directory Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory YACC The `Yet Another C Compiler' implementation to use. Defaults to the first program found out of: `bison -y', `byacc', `yacc'. YFLAGS The list of arguments that will be passed by default to $YACC. This script will default YFLAGS to the empty string to avoid a default value of `-d' given by some make applications. CPP C preprocessor CXX C++ compiler command CXXFLAGS C++ compiler flags CXXCPP C++ preprocessor F77 Fortran 77 compiler command FFLAGS Fortran 77 compiler flags Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to the package provider. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.65 Copyright (C) 2009 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} } # ac_fn_c_check_header_mongrel # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} } # ac_fn_c_check_header_compile # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} } # ac_fn_c_check_func # ac_fn_cxx_try_compile LINENO # ---------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_cxx_try_compile # ac_fn_cxx_try_cpp LINENO # ------------------------ # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_cxx_try_cpp # ac_fn_cxx_try_link LINENO # ------------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_cxx_try_link # ac_fn_cxx_check_func LINENO FUNC VAR # ------------------------------------ # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_cxx_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} } # ac_fn_cxx_check_func # ac_fn_f77_try_compile LINENO # ---------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_f77_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_f77_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_f77_try_compile # ac_fn_f77_try_link LINENO # ------------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_f77_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_f77_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_f77_try_link # ac_fn_c_compute_int LINENO EXPR VAR INCLUDES # -------------------------------------------- # Tries to find the compile-time value of EXPR in a program that includes # INCLUDES, setting VAR accordingly. Returns whether the value could be # computed ac_fn_c_compute_int () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_lo=0 ac_mid=0 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=$ac_mid; break else as_fn_arith $ac_mid + 1 && ac_lo=$as_val if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=-1 ac_mid=-1 while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_lo=$ac_mid; break else as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else ac_lo= ac_hi= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_hi=$ac_mid else as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in #(( ?*) eval "$3=\$ac_lo"; ac_retval=0 ;; '') ac_retval=1 ;; esac else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 static long int longval () { return $2; } static unsigned long int ulongval () { return $2; } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; if (($2) < 0) { long int i = longval (); if (i != ($2)) return 1; fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); if (i != ($2)) return 1; fprintf (f, "%lu", i); } /* Do not output a trailing newline, as this causes \r\n confusion on some platforms. */ return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : echo >>conftest.val; read $3 config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.65. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then ac_site_file1=$CONFIG_SITE elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_aux_dir= for ac_dir in makes "$srcdir"/makes; do for ac_t in install-sh install.sh shtool; do if test -f "$ac_dir/$ac_t"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/$ac_t -c" break 2 fi done done if test -z "$ac_aux_dir"; then as_fn_error "cannot find install-sh, install.sh, or shtool in makes \"$srcdir\"/makes" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. ac_config_headers="$ac_config_headers include/gfarm/gfarm_config.h" # Determine target system # This is called "host" on autotools, because its terminology is following: # build system - system which is used to build a tool # host system - system which is used to run a tool # target system - system which is used to run a program generated by a tool # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if test "${ac_cv_build+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if test "${ac_cv_host+set}" = set; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac # "linux-gnu" -> "linux", "netbsdelf" -> "netbsd", "osf5.1b" -> "osf1" host_os_nickname=`echo $host_os | sed -e 's/-.*//' -e 's/[0-9.]*$//' \ -e 's/^netbsdelf$/netbsd/' -e 's/osf0-9.*/osf1/'` ###### ###### Checks for programs. ###### ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then for ac_prog in cc gcc do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cc gcc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error "no acceptable C compiler found in \$PATH See \`config.log' for more details." "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { as_fn_set_status 77 as_fn_error "C compiler cannot create executables See \`config.log' for more details." "$LINENO" 5; }; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if test "${ac_cv_objext+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error "cannot compute suffix of object files: cannot compile See \`config.log' for more details." "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # search cc before gcc if test x"$GCC" = x"yes"; then # CFLAGS='-g -O2' CFLAGS="${CFLAGS} -Wall" else # CFLAGS='-g' CFLAGS="-O" # don't use -g, but use -O fi for ac_prog in flex lex do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_LEX+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$LEX"; then ac_cv_prog_LEX="$LEX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_LEX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LEX=$ac_cv_prog_LEX if test -n "$LEX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LEX" >&5 $as_echo "$LEX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$LEX" && break done test -n "$LEX" || LEX=":" if test "x$LEX" != "x:"; then cat >conftest.l <<_ACEOF %% a { ECHO; } b { REJECT; } c { yymore (); } d { yyless (1); } e { yyless (input () != 0); } f { unput (yytext[0]); } . { BEGIN INITIAL; } %% #ifdef YYTEXT_POINTER extern char *yytext; #endif int main (void) { return ! yylex () + ! yywrap (); } _ACEOF { { ac_try="$LEX conftest.l" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$LEX conftest.l") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking lex output file root" >&5 $as_echo_n "checking lex output file root... " >&6; } if test "${ac_cv_prog_lex_root+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -f lex.yy.c; then ac_cv_prog_lex_root=lex.yy elif test -f lexyy.c; then ac_cv_prog_lex_root=lexyy else as_fn_error "cannot find output from $LEX; giving up" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_root" >&5 $as_echo "$ac_cv_prog_lex_root" >&6; } LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root if test -z "${LEXLIB+set}"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking lex library" >&5 $as_echo_n "checking lex library... " >&6; } if test "${ac_cv_lib_lex+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_save_LIBS=$LIBS ac_cv_lib_lex='none needed' for ac_lib in '' -lfl -ll; do LIBS="$ac_lib $ac_save_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ `cat $LEX_OUTPUT_ROOT.c` _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_lex=$ac_lib fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext test "$ac_cv_lib_lex" != 'none needed' && break done LIBS=$ac_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lex" >&5 $as_echo "$ac_cv_lib_lex" >&6; } test "$ac_cv_lib_lex" != 'none needed' && LEXLIB=$ac_cv_lib_lex fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether yytext is a pointer" >&5 $as_echo_n "checking whether yytext is a pointer... " >&6; } if test "${ac_cv_prog_lex_yytext_pointer+set}" = set; then : $as_echo_n "(cached) " >&6 else # POSIX says lex can declare yytext either as a pointer or an array; the # default is implementation-dependent. Figure out which it is, since # not all implementations provide the %pointer and %array declarations. ac_cv_prog_lex_yytext_pointer=no ac_save_LIBS=$LIBS LIBS="$LEXLIB $ac_save_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define YYTEXT_POINTER 1 `cat $LEX_OUTPUT_ROOT.c` _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_prog_lex_yytext_pointer=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_yytext_pointer" >&5 $as_echo "$ac_cv_prog_lex_yytext_pointer" >&6; } if test $ac_cv_prog_lex_yytext_pointer = yes; then $as_echo "#define YYTEXT_POINTER 1" >>confdefs.h fi rm -f conftest.l $LEX_OUTPUT_ROOT.c fi # the following definition should not be needed. # but there is stupid environment which flex exists but libfl.a doesn't. if test x"$LEX" = x"flex"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for yywrap in -lfl" >&5 $as_echo_n "checking for yywrap in -lfl... " >&6; } if test "${ac_cv_lib_fl_yywrap+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char yywrap (); int main () { return yywrap (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fl_yywrap=yes else ac_cv_lib_fl_yywrap=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fl_yywrap" >&5 $as_echo "$ac_cv_lib_fl_yywrap" >&6; } if test "x$ac_cv_lib_fl_yywrap" = x""yes; then : LEXLIB=-lfl else LEXLIB=-ll fi fi if mkdir -p . 2>/dev/null; then MKDIR_P='mkdir -p' else test -d ./-p && rmdir ./-p MKDIR_P='$(top_srcdir)/makes/mkdirhier' fi for ac_prog in 'bison -y' byacc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_YACC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$YACC"; then ac_cv_prog_YACC="$YACC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_YACC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi YACC=$ac_cv_prog_YACC if test -n "$YACC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $YACC" >&5 $as_echo "$YACC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$YACC" && break done test -n "$YACC" || YACC="yacc" # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then : enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac else enable_shared=yes fi # Check whether --enable-static was given. if test "${enable_static+set}" = set; then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac else enable_static=yes fi # Check whether --enable-fast-install was given. if test "${enable_fast_install+set}" = set; then : enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac else enable_fast_install=yes fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if test "${lt_cv_path_SED+set}" = set; then : $as_echo_n "(cached) " >&6 else # Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done fi SED=$lt_cv_path_SED { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SED" >&5 $as_echo "$SED" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if test "${ac_cv_path_GREP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if test "${ac_cv_path_EGREP+set}" = set; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if test "${lt_cv_path_LD+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if test "${lt_cv_prog_gnu_ld+set}" = set; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU ld's only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } if test "${lt_cv_ld_reload_flag+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 $as_echo "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in darwin*) if test "$GCC" = yes; then reload_cmds='$CC -nostdlib ${wl}-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD-compatible nm" >&5 $as_echo_n "checking for BSD-compatible nm... " >&6; } if test "${lt_cv_path_NM+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/${ac_tool_prefix}nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac esac fi done IFS="$lt_save_ifs" test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 $as_echo "$lt_cv_path_NM" >&6; } NM="$lt_cv_path_NM" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognise dependent libraries" >&5 $as_echo_n "checking how to recognise dependent libraries... " >&6; } if test "${lt_cv_deplibs_check_method+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # which responds to the $file_magic_cmd with a given extended regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. case $host_os in aix4* | aix5*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump'. lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | kfreebsd*-gnu | dragonfly*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case "$host_cpu" in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux*) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; nto-qnx*) lt_cv_deplibs_check_method=unknown ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; sco3.2v5*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; esac ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # Allow CC to be a program name with arguments. compiler=$CC # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then : enableval=$enable_libtool_lock; fi test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '#line 4583 "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case "`/usr/bin/file conftest.o`" in *32-bit*) case $host in x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } if test "${lt_cv_cc_needs_belf+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_cc_needs_belf=yes else lt_cv_cc_needs_belf=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 $as_echo "$lt_cv_cc_needs_belf" >&6; } if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; esac need_locks="$enable_libtool_lock" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if test "${ac_cv_header_stdc+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " eval as_val=\$$as_ac_Header if test "x$as_val" = x""yes; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in dlfcn.h do : ac_fn_c_check_header_mongrel "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default" if test "x$ac_cv_header_dlfcn_h" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DLFCN_H 1 _ACEOF fi done ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CXX+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 $as_echo "$CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CXX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 $as_echo "$ac_ct_CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CXX" && break done if test "x$ac_ct_CXX" = x; then CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX fi fi fi fi # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } if test "${ac_cv_cxx_compiler_gnu+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 $as_echo "$ac_cv_cxx_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GXX=yes else GXX= fi ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 $as_echo_n "checking whether $CXX accepts -g... " >&6; } if test "${ac_cv_prog_cxx_g+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes else CXXFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : else ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 $as_echo "$ac_cv_prog_cxx_g" >&6; } if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 $as_echo_n "checking how to run the C++ preprocessor... " >&6; } if test -z "$CXXCPP"; then if test "${ac_cv_prog_CXXCPP+set}" = set; then : $as_echo_n "(cached) " >&6 else # Double quotes because CXXCPP needs to be expanded for CXXCPP in "$CXX -E" "/lib/cpp" do ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CXXCPP=$CXXCPP fi CXXCPP=$ac_cv_prog_CXXCPP else ac_cv_prog_CXXCPP=$CXXCPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 $as_echo "$CXXCPP" >&6; } ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error "C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details." "$LINENO" 5; } fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu fi ac_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu if test -n "$ac_tool_prefix"; then for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_F77+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$F77"; then ac_cv_prog_F77="$F77" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_F77="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi F77=$ac_cv_prog_F77 if test -n "$F77"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $F77" >&5 $as_echo "$F77" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$F77" && break done fi if test -z "$F77"; then ac_ct_F77=$F77 for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_F77+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_F77"; then ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_F77="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_F77=$ac_cv_prog_ac_ct_F77 if test -n "$ac_ct_F77"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_F77" >&5 $as_echo "$ac_ct_F77" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_F77" && break done if test "x$ac_ct_F77" = x; then F77="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac F77=$ac_ct_F77 fi fi # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for Fortran 77 compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done rm -f a.out # If we don't use `.F' as extension, the preprocessor is not run on the # input file. (Note that this only needs to work for GNU compilers.) ac_save_ext=$ac_ext ac_ext=F { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU Fortran 77 compiler" >&5 $as_echo_n "checking whether we are using the GNU Fortran 77 compiler... " >&6; } if test "${ac_cv_f77_compiler_gnu+set}" = set; then : $as_echo_n "(cached) " >&6 else cat > conftest.$ac_ext <<_ACEOF program main #ifndef __GNUC__ choke me #endif end _ACEOF if ac_fn_f77_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_f77_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_f77_compiler_gnu" >&5 $as_echo "$ac_cv_f77_compiler_gnu" >&6; } ac_ext=$ac_save_ext ac_test_FFLAGS=${FFLAGS+set} ac_save_FFLAGS=$FFLAGS FFLAGS= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $F77 accepts -g" >&5 $as_echo_n "checking whether $F77 accepts -g... " >&6; } if test "${ac_cv_prog_f77_g+set}" = set; then : $as_echo_n "(cached) " >&6 else FFLAGS=-g cat > conftest.$ac_ext <<_ACEOF program main end _ACEOF if ac_fn_f77_try_compile "$LINENO"; then : ac_cv_prog_f77_g=yes else ac_cv_prog_f77_g=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_f77_g" >&5 $as_echo "$ac_cv_prog_f77_g" >&6; } if test "$ac_test_FFLAGS" = set; then FFLAGS=$ac_save_FFLAGS elif test $ac_cv_prog_f77_g = yes; then if test "x$ac_cv_f77_compiler_gnu" = xyes; then FFLAGS="-g -O2" else FFLAGS="-g" fi else if test "x$ac_cv_f77_compiler_gnu" = xyes; then FFLAGS="-O2" else FFLAGS= fi fi if test $ac_compiler_gnu = yes; then G77=yes else G77= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! # find the maximum length of command line arguments { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } if test "${lt_cv_sys_max_cmd_len+set}" = set; then : $as_echo_n "(cached) " >&6 else i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for *BSD fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; *) # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} while (test "X"`$SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \ = "XX$teststring") >/dev/null 2>&1 && new_result=`expr "X$teststring" : ".*" 2>&1` && lt_cv_sys_max_cmd_len=$new_result && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done teststring= # Add a significant safety factor because C++ compilers can tack on massive # amounts of additional arguments before passing them to the linker. # It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` ;; esac fi if test -n $lt_cv_sys_max_cmd_len ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 $as_echo "$lt_cv_sys_max_cmd_len" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; } fi # Check for command to grab the raw symbol name followed by C symbol from nm. { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then : $as_echo_n "(cached) " >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Transform an extracted symbol line into a proper C declaration lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32*) symcode='[ABCDGISTW]' ;; hpux*) # Its linker distinguishes data from code symbols if test "$host_cpu" = ia64; then symcode='[ABCDEGRST]' fi lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" ;; linux*) if test "$host_cpu" = ia64; then symcode='[ABCDGIRSTW]' lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris* | sysv5*) symcode='[BDRT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac # Try without a prefix undercore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\""; } >&5 (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if grep ' nm_test_var$' "$nlist" >/dev/null; then if grep ' nm_test_func$' "$nlist" >/dev/null; then cat < conftest.$ac_ext #ifdef __cplusplus extern "C" { #endif EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' cat <> conftest.$ac_ext #if defined (__STDC__) && __STDC__ # define lt_ptr_t void * #else # define lt_ptr_t char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr_t address; } lt_preloaded_symbols[] = { EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext cat <<\EOF >> conftest.$ac_ext {0, (lt_ptr_t) 0} }; #ifdef __cplusplus } #endif EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_save_LIBS="$LIBS" lt_save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS="$lt_save_LIBS" CFLAGS="$lt_save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 $as_echo "failed" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } if test "${lt_cv_objdir+set}" = set; then : $as_echo_n "(cached) " >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 $as_echo "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='sed -e 1s/^X//' sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' # Constants: rm="rm -f" # Global variables: default_ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except M$VC, # which needs '.lib'). libext=a ltmain="$ac_aux_dir/ltmain.sh" ofile="$default_ofile" with_gnu_ld="$lt_cv_prog_gnu_ld" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_AR+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AR="${ac_tool_prefix}ar" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_AR"; then ac_ct_AR=$AR # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_AR+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_AR="ar" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi else AR="$ac_cv_prog_AR" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_RANLIB+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_STRIP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru test -z "$AS" && AS=as test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$LD" && LD=ld test -z "$LN_S" && LN_S="ln -s" test -z "$MAGIC_CMD" && MAGIC_CMD=file test -z "$NM" && NM=nm test -z "$SED" && SED=sed test -z "$OBJDUMP" && OBJDUMP=objdump test -z "$RANLIB" && RANLIB=: test -z "$STRIP" && STRIP=: test -z "$ac_objext" && ac_objext=o # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds" ;; *) old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` # Only perform the check for file, if the check method requires it case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } if test "${lt_cv_path_MAGIC_CMD+set}" = set; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/${ac_tool_prefix}file; then lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 $as_echo_n "checking for file... " >&6; } if test "${lt_cv_path_MAGIC_CMD+set}" = set; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/file; then lt_cv_path_MAGIC_CMD="$ac_dir/file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac enable_dlopen=no enable_win32_dll=no # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then : enableval=$enable_libtool_lock; fi test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Check whether --with-pic was given. if test "${with_pic+set}" = set; then : withval=$with_pic; pic_mode="$withval" else pic_mode=default fi test -z "$pic_mode" && pic_mode=default # Use C for the default configuration in the libtool script tagname= lt_save_CC="$CC" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}\n' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm conftest* # # Check for any special shared library compilation flags. # lt_prog_cc_shlib= if test "$GCC" = no; then case $host_os in sco3.2v5*) lt_prog_cc_shlib='-belf' ;; esac fi if test -n "$lt_prog_cc_shlib"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&5 $as_echo "$as_me: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&2;} if echo "$old_CC $old_CFLAGS " | grep "[ ]$lt_prog_cc_shlib[ ]" >/dev/null; then : else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&5 $as_echo "$as_me: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&2;} lt_cv_prog_cc_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_prog_compiler_static works" >&5 $as_echo_n "checking if $compiler static flag $lt_prog_compiler_static works... " >&6; } if test "${lt_prog_compiler_static_works+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_prog_compiler_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_prog_compiler_static" printf "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $echo "X$_lt_linker_boilerplate" | $Xsed > conftest.exp $SED '/^$/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_static_works=yes fi else lt_prog_compiler_static_works=yes fi fi $rm conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_static_works" >&5 $as_echo "$lt_prog_compiler_static_works" >&6; } if test x"$lt_prog_compiler_static_works" = xyes; then : else lt_prog_compiler_static= fi ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then lt_prog_compiler_no_builtin_flag=' -fno-builtin' { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:6600: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:6604: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp $SED '/^$/d' conftest.err >conftest.er2 if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $rm conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; *) lt_prog_compiler_pic='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) lt_prog_compiler_pic='-qnocommon' lt_prog_compiler_wl='-Wl,' ;; esac ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; linux*) case $cc_basename in icc* | ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; pgcc* | pgf77* | pgf90*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-static' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; esac ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; sco3.2v5*) lt_prog_compiler_pic='-Kpic' lt_prog_compiler_static='-dn' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5 $as_echo "$lt_prog_compiler_pic" >&6; } # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if test "${lt_prog_compiler_pic_works+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:6862: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:6866: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp $SED '/^$/d' conftest.err >conftest.er2 if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_pic_works=yes fi fi $rm conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic_works" >&5 $as_echo "$lt_prog_compiler_pic_works" >&6; } if test x"$lt_prog_compiler_pic_works" = xyes; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi case "$host_os" in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test "${lt_cv_prog_compiler_c_o+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:6924: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:6928: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed > out/conftest.exp $SED '/^$/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test "$hard_links" = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= enable_shared_with_static_runtimes=no archive_cmds= archive_expsym_cmds= old_archive_From_new_cmds= old_archive_from_expsyms_cmds= export_dynamic_flag_spec= whole_archive_flag_spec= thread_safe_flag_spec= hardcode_libdir_flag_spec= hardcode_libdir_flag_spec_ld= hardcode_libdir_separator= hardcode_direct=no hardcode_minus_L=no hardcode_shlibpath_var=unsupported link_all_deplibs=unknown hardcode_automatic=no module_cmds= module_expsym_cmds= always_export_symbols=no export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. extract_expsyms_cmds= # Just being paranoid about ensuring that cc_basename is set. for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. ld_shlibs=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' else ld_shlibs=no fi ;; linux*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_addflag= case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='${wl}--whole-archive,`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* ) # Portland Group f77 and f90 compilers whole_archive_flag_spec='${wl}--whole-archive,`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; esac archive_cmds='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; then archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi else ld_shlibs=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris* | sysv5*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = no; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes && test -z "$link_static_flag"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_libdir_separator=':' link_all_deplibs=yes if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct=yes else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an empty executable. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' ${wl}-bernotok' allow_undefined_flag=' ${wl}-berok' # -bexpall does not export symbols beginning with underscore (_) always_export_symbols=yes # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec=' ' archive_cmds_need_lc=yes # This is similar to how AIX traditionally builds it's shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # see comment about different semantics on the GNU ld section ld_shlibs=no ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes=yes ;; darwin* | rhapsody*) case "$host_os" in rhapsody* | darwin1.[012]) allow_undefined_flag='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) allow_undefined_flag='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported whole_archive_flag_spec='' link_all_deplibs=yes if test "$GCC" = yes ; then output_verbose_link_cmd='echo' archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) ld_shlibs=no ;; esac fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; freebsd1*) ld_shlibs=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | kfreebsd*-gnu | dragonfly*) archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='${wl}-E' ;; hpux10* | hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case "$host_cpu" in hppa*64*|ia64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case "$host_cpu" in hppa*64*|ia64*) archive_cmds='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' ;; *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;; esac fi if test "$with_gnu_ld" = no; then case "$host_cpu" in hppa*64*) hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_flag_spec_ld='+b $libdir' hardcode_libdir_separator=: hardcode_direct=no hardcode_shlibpath_var=no ;; ia64*) hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=no hardcode_shlibpath_var=no # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; *) hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_ld='-rpath $libdir' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: link_all_deplibs=yes ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; openbsd*) hardcode_direct=yes hardcode_shlibpath_var=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-R$libdir' ;; *) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi hardcode_libdir_separator=: ;; sco3.2v5*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='${wl}-Bexport' runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ;; solaris*) no_undefined_flag=' -z text' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else wlarc='' archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine linker options so we # cannot just pass the convience library names through # without $wl, iff we do not link with $LD. # Luckily, gcc supports the same syntax we need for Sun Studio. # Supported since Solaris 2.6 (maybe 2.5.1?) case $wlarc in '') whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; *) whole_archive_flag_spec='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; esac ;; esac link_all_deplibs=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4.2uw2*) archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=no hardcode_shlibpath_var=no hardcode_runpath_var=yes runpath_var=LD_RUN_PATH ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) no_undefined_flag='${wl}-z ${wl}text' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' fi runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv5*) no_undefined_flag=' -z text' # $CC -shared without GNU ld will not create a library from C++ # object files and a static libstdc++, better avoid it by now archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' hardcode_libdir_flag_spec= hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 $as_echo "$ld_shlibs" >&6; } test "$ld_shlibs" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then archive_cmds_need_lc=no else archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* { $as_echo "$as_me:${as_lineno-$LINENO}: result: $archive_cmds_need_lc" >&5 $as_echo "$archive_cmds_need_lc" >&6; } ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` else sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; kfreebsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; *) # from 3.2 on shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case "$host_cpu" in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; knetbsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; sco3.2v5*) version_type=osf soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || \ test -n "$runpath_var" || \ test "X$hardcode_automatic" = "Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, )" != no && test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 $as_echo "$hardcode_action" >&6; } if test "$hardcode_action" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi striplib= old_striplib= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; esac fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = x""yes; then : lt_cv_dlopen="shl_load" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if test "${ac_cv_lib_dld_shl_load+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = x""yes; then : lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" else ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = x""yes; then : lt_cv_dlopen="dlopen" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if test "${ac_cv_lib_svld_dlopen+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_svld_dlopen=yes else ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = x""yes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if test "${ac_cv_lib_dld_dld_link+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_dld_link=yes else ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = x""yes; then : lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } if test "${lt_cv_dlopen_self+set}" = set; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); } EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_unknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 $as_echo "$lt_cv_dlopen_self" >&6; } if test "x$lt_cv_dlopen_self" = xyes; then LDFLAGS="$LDFLAGS $link_static_flag" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if test "${lt_cv_dlopen_self_static+set}" = set; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); } EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 $as_echo "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi # Report which librarie types wil actually be built { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 $as_echo_n "checking if libtool supports shared libraries... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 $as_echo "$can_build_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 $as_echo_n "checking whether to build shared libraries... " >&6; } test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case "$host_os" in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix4* | aix5*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 $as_echo "$enable_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 $as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler \ CC \ LD \ lt_prog_compiler_wl \ lt_prog_compiler_pic \ lt_prog_compiler_static \ lt_prog_compiler_no_builtin_flag \ export_dynamic_flag_spec \ thread_safe_flag_spec \ whole_archive_flag_spec \ enable_shared_with_static_runtimes \ old_archive_cmds \ old_archive_from_new_cmds \ predep_objects \ postdep_objects \ predeps \ postdeps \ compiler_lib_search_path \ archive_cmds \ archive_expsym_cmds \ postinstall_cmds \ postuninstall_cmds \ old_archive_from_expsyms_cmds \ allow_undefined_flag \ no_undefined_flag \ export_symbols_cmds \ hardcode_libdir_flag_spec \ hardcode_libdir_flag_spec_ld \ hardcode_libdir_separator \ hardcode_automatic \ module_cmds \ module_expsym_cmds \ lt_cv_prog_compiler_c_o \ exclude_expsyms \ include_expsyms; do case $var in old_archive_cmds | \ old_archive_from_new_cmds | \ archive_cmds | \ archive_expsym_cmds | \ module_cmds | \ module_expsym_cmds | \ old_archive_from_expsyms_cmds | \ export_symbols_cmds | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="${ofile}T" trap "$rm \"$cfgfile\"; exit 1" 1 2 15 $rm -f "$cfgfile" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ofile" >&5 $as_echo "$as_me: creating $ofile" >&6;} cat <<__EOF__ >> "$cfgfile" #! $SHELL # `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. # # This file is part of GNU Libtool: # Originally by Gordon Matzigkeit , 1996 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="$SED -e 1s/^X//" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # The names of the tagged configurations supported by this script. available_tags= # ### BEGIN LIBTOOL CONFIG # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # A language-specific compiler. CC=$lt_compiler # Is the compiler the GNU C compiler? with_gcc=$GCC # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Must we lock files when doing compilation? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # ### END LIBTOOL CONFIG __EOF__ case $host_os in aix3*) cat <<\EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi EOF ;; esac # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || \ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" # Check whether --with-tags was given. if test "${with_tags+set}" = set; then : withval=$with_tags; tagnames="$withval" fi if test -f "$ltmain" && test -n "$tagnames"; then if test ! -f "${ofile}"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: output file \`$ofile' does not exist" >&5 $as_echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;} fi if test -z "$LTCC"; then eval "`$SHELL ${ofile} --config | grep '^LTCC='`" if test -z "$LTCC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: output file \`$ofile' does not look like a libtool script" >&5 $as_echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;} else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5 $as_echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;} fi fi # Extract list of available tagged configurations in $ofile. # Note that this assumes the entire list is on one line. available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for tagname in $tagnames; do IFS="$lt_save_ifs" # Check whether tagname contains only valid characters case `$echo "X$tagname" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in "") ;; *) as_fn_error "invalid tag name: $tagname" "$LINENO" 5 ;; esac if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null then as_fn_error "tag name \"$tagname\" already exists" "$LINENO" 5 fi # Update the list of available tags. if test -n "$tagname"; then echo appending configuration tag \"$tagname\" to $ofile case $tagname in CXX) if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu archive_cmds_need_lc_CXX=no allow_undefined_flag_CXX= always_export_symbols_CXX=no archive_expsym_cmds_CXX= export_dynamic_flag_spec_CXX= hardcode_direct_CXX=no hardcode_libdir_flag_spec_CXX= hardcode_libdir_flag_spec_ld_CXX= hardcode_libdir_separator_CXX= hardcode_minus_L_CXX=no hardcode_automatic_CXX=no module_cmds_CXX= module_expsym_cmds_CXX= link_all_deplibs_CXX=unknown old_archive_cmds_CXX=$old_archive_cmds no_undefined_flag_CXX= whole_archive_flag_spec_CXX= enable_shared_with_static_runtimes_CXX=no # Dependencies to place before and after the object being linked: predep_objects_CXX= postdep_objects_CXX= predeps_CXX= postdeps_CXX= compiler_lib_search_path_CXX= # Source file extension for C++ test sources. ac_ext=cc # Object file extension for compiled C++ test sources. objext=o objext_CXX=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;\n" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *) { return(0); }\n' # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm conftest* # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} compiler=$CC compiler_CXX=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` # We don't want -fno-exception wen compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' else lt_prog_compiler_no_builtin_flag_CXX= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if test "${lt_cv_path_LD+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if test "${lt_cv_prog_gnu_ld+set}" = set; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU ld's only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ grep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_CXX= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } ld_shlibs_CXX=yes case $host_os in aix3*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_CXX='' hardcode_direct_CXX=yes hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes if test "$GXX" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct_CXX=yes else # We have old collect2 hardcode_direct_CXX=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_CXX=yes hardcode_libdir_flag_spec_CXX='-L$libdir' hardcode_libdir_separator_CXX= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols_CXX=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_CXX='-berok' # Determine the default libpath from the value encoded in an empty executable. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_CXX="-z nodefs" archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_CXX=' ${wl}-bernotok' allow_undefined_flag_CXX=' ${wl}-berok' # -bexpall does not export symbols beginning with underscore (_) always_export_symbols_CXX=yes # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_CXX=' ' archive_cmds_need_lc_CXX=yes # This is similar to how AIX traditionally builds it's shared libraries. archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_CXX='-L$libdir' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=no enable_shared_with_static_runtimes_CXX=yes if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' else ld_shlibs_CXX=no fi ;; darwin* | rhapsody*) case "$host_os" in rhapsody* | darwin1.[012]) allow_undefined_flag_CXX='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) allow_undefined_flag_CXX='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac archive_cmds_need_lc_CXX=no hardcode_direct_CXX=no hardcode_automatic_CXX=yes hardcode_shlibpath_var_CXX=unsupported whole_archive_flag_spec_CXX='' link_all_deplibs_CXX=yes if test "$GXX" = yes ; then lt_int_apple_cc_single_mod=no output_verbose_link_cmd='echo' if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then lt_int_apple_cc_single_mod=yes fi if test "X$lt_int_apple_cc_single_mod" = Xyes ; then archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' else archive_cmds_CXX='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' fi module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's if test "X$lt_int_apple_cc_single_mod" = Xyes ; then archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' fi module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) ld_shlibs_CXX=no ;; esac fi ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; freebsd[12]*) # C++ shared libraries reported to be fairly broken before switch to ELF ld_shlibs_CXX=no ;; freebsd-elf*) archive_cmds_need_lc_CXX=no ;; freebsd* | kfreebsd*-gnu | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions ld_shlibs_CXX=yes ;; gnu*) ;; hpux9*) hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: export_dynamic_flag_spec_CXX='${wl}-E' hardcode_direct_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) archive_cmds_CXX='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then archive_cmds_CXX='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then case "$host_cpu" in hppa*64*) hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_flag_spec_ld_CXX='+b $libdir' hardcode_libdir_separator_CXX=: ;; ia64*) hardcode_libdir_flag_spec_CXX='-L$libdir' ;; *) hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: export_dynamic_flag_spec_CXX='${wl}-E' ;; esac fi case "$host_cpu" in hppa*64*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no ;; ia64*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. ;; *) hardcode_direct_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) case "$host_cpu" in hppa*64*|ia64*) archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' ;; *) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case "$host_cpu" in ia64*|hppa*64*) archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs' ;; *) archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' fi fi link_all_deplibs_CXX=yes ;; esac hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: ;; linux*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' hardcode_libdir_flag_spec_CXX='${wl}--rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc*) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac archive_cmds_need_lc_CXX=no hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC*) # Portland Group C++ compiler archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' whole_archive_flag_spec_CXX='${wl}--whole-archive,`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_CXX='-rpath $libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; esac ;; lynxos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; m88k*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; openbsd2*) # C++ shared libraries are fairly broken ld_shlibs_CXX=no ;; openbsd*) hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' export_dynamic_flag_spec_CXX='${wl}-E' whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd='echo' ;; osf3*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' hardcode_libdir_separator_CXX=: # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx*) allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' hardcode_libdir_separator_CXX=: # Archives containing C++ object files must be created using # the KAI C++ compiler. old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx*) allow_undefined_flag_CXX=' -expect_unresolved \*' archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~ $rm $lib.exp' hardcode_libdir_flag_spec_CXX='-rpath $libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; sco*) archive_cmds_need_lc_CXX=no case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -nolib ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_shlibpath_var_CXX=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The C++ compiler is used as linker so we must use $wl # flag to pass the commands to the underlying system # linker. We must also pass each convience library through # to the system linker between allextract/defaultextract. # The C++ compiler will combine linker options so we # cannot just pass the convience library names through # without $wl. # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; esac link_all_deplibs_CXX=yes # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep "\-[LR]"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then no_undefined_flag_CXX=' ${wl}-z ${wl}defs' if $CC --version | grep -v '^2\.7' > /dev/null; then archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" fi hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' fi ;; esac ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) archive_cmds_need_lc_CXX=no ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 $as_echo "$ld_shlibs_CXX" >&6; } test "$ld_shlibs_CXX" = no && can_build_shared=no GCC_CXX="$GXX" LD_CXX="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... cat > conftest.$ac_ext <&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no # The `*' in the case matches for architectures that use `case' in # $output_verbose_cmd can trigger glob expansion during the loop # eval without this substitution. output_verbose_link_cmd="`$echo \"X$output_verbose_link_cmd\" | $Xsed -e \"$no_glob_subst\"`" for p in `eval $output_verbose_link_cmd`; do case $p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" \ || test $p = "-R"; then prev=$p continue else prev= fi if test "$pre_test_object_deps_done" = no; then case $p in -L* | -R*) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$compiler_lib_search_path_CXX"; then compiler_lib_search_path_CXX="${prev}${p}" else compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$postdeps_CXX"; then postdeps_CXX="${prev}${p}" else postdeps_CXX="${postdeps_CXX} ${prev}${p}" fi fi ;; *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$predep_objects_CXX"; then predep_objects_CXX="$p" else predep_objects_CXX="$predep_objects_CXX $p" fi else if test -z "$postdep_objects_CXX"; then postdep_objects_CXX="$p" else postdep_objects_CXX="$postdep_objects_CXX $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling CXX test program" fi $rm -f confest.$objext case " $postdeps_CXX " in *" -lc "*) archive_cmds_need_lc_CXX=no ;; esac lt_prog_compiler_wl_CXX= lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX= { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | os2* | pw32*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_CXX='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_CXX='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all lt_prog_compiler_pic_CXX= ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_CXX=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac else case $host_os in aix4* | aix5*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' else lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) lt_prog_compiler_pic_CXX='-qnocommon' lt_prog_compiler_wl_CXX='-Wl,' ;; esac ;; dgux*) case $cc_basename in ec++*) lt_prog_compiler_pic_CXX='-KPIC' ;; ghcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; freebsd* | kfreebsd*-gnu | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" if test "$host_cpu" != ia64; then lt_prog_compiler_pic_CXX='+Z' fi ;; aCC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive" case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_CXX='+Z' ;; esac ;; *) ;; esac ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux*) case $cc_basename in KCC*) # KAI C++ Compiler lt_prog_compiler_wl_CXX='--backend -Wl,' lt_prog_compiler_pic_CXX='-fPIC' ;; icpc* | ecpc*) # Intel C++ lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-static' ;; pgCC*) # Portland Group C++ compiler. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fpic' lt_prog_compiler_static_CXX='-static' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; *) ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) lt_prog_compiler_pic_CXX='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) lt_prog_compiler_wl_CXX='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 lt_prog_compiler_pic_CXX='-pic' ;; cxx*) # Digital/Compaq C++ lt_prog_compiler_wl_CXX='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; *) ;; esac ;; psos*) ;; sco*) case $cc_basename in CC*) lt_prog_compiler_pic_CXX='-fPIC' ;; *) ;; esac ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x lt_prog_compiler_pic_CXX='-pic' lt_prog_compiler_static_CXX='-Bstatic' ;; lcc*) # Lucid lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 lt_prog_compiler_pic_CXX='-KPIC' ;; *) ;; esac ;; unixware*) ;; vxworks*) ;; *) lt_prog_compiler_can_build_shared_CXX=no ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic_CXX" >&5 $as_echo "$lt_prog_compiler_pic_CXX" >&6; } # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; } if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_prog_compiler_pic_works_CXX=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:11074: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:11078: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp $SED '/^$/d' conftest.err >conftest.er2 if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_pic_works_CXX=yes fi fi $rm conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic_works_CXX" >&5 $as_echo "$lt_prog_compiler_pic_works_CXX" >&6; } if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then case $lt_prog_compiler_pic_CXX in "" | " "*) ;; *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; esac else lt_prog_compiler_pic_CXX= lt_prog_compiler_can_build_shared_CXX=no fi fi case "$host_os" in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_CXX= ;; *) lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_CXX=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:11136: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:11140: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed > out/conftest.exp $SED '/^$/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes fi fi chmod u+w . $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 $as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test "$hard_links" = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' case $host_os in aix4* | aix5*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) export_symbols_cmds_CXX="$ltdll_cmds" ;; cygwin* | mingw*) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([^ ]*\) [^ ]*/\1 DATA/;/^I /d;/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 $as_echo "$ld_shlibs_CXX" >&6; } test "$ld_shlibs_CXX" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_CXX" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_CXX=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_CXX in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_CXX compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_CXX allow_undefined_flag_CXX= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then archive_cmds_need_lc_CXX=no else archive_cmds_need_lc_CXX=yes fi allow_undefined_flag_CXX=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* { $as_echo "$as_me:${as_lineno-$LINENO}: result: $archive_cmds_need_lc_CXX" >&5 $as_echo "$archive_cmds_need_lc_CXX" >&6; } ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` else sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; kfreebsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; *) # from 3.2 on shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case "$host_cpu" in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; knetbsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; sco3.2v5*) version_type=osf soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action_CXX= if test -n "$hardcode_libdir_flag_spec_CXX" || \ test -n "$runpath_var_CXX" || \ test "X$hardcode_automatic_CXX" = "Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct_CXX" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, CXX)" != no && test "$hardcode_minus_L_CXX" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_CXX=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_CXX=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_CXX=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5 $as_echo "$hardcode_action_CXX" >&6; } if test "$hardcode_action_CXX" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi striplib= old_striplib= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; esac fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) ac_fn_cxx_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = x""yes; then : lt_cv_dlopen="shl_load" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if test "${ac_cv_lib_dld_shl_load+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = x""yes; then : lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" else ac_fn_cxx_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = x""yes; then : lt_cv_dlopen="dlopen" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if test "${ac_cv_lib_svld_dlopen+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_svld_dlopen=yes else ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = x""yes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if test "${ac_cv_lib_dld_dld_link+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_dld_dld_link=yes else ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = x""yes; then : lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } if test "${lt_cv_dlopen_self+set}" = set; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); } EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_unknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 $as_echo "$lt_cv_dlopen_self" >&6; } if test "x$lt_cv_dlopen_self" = xyes; then LDFLAGS="$LDFLAGS $link_static_flag" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if test "${lt_cv_dlopen_self_static+set}" = set; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); } EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 $as_echo "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_CXX \ CC_CXX \ LD_CXX \ lt_prog_compiler_wl_CXX \ lt_prog_compiler_pic_CXX \ lt_prog_compiler_static_CXX \ lt_prog_compiler_no_builtin_flag_CXX \ export_dynamic_flag_spec_CXX \ thread_safe_flag_spec_CXX \ whole_archive_flag_spec_CXX \ enable_shared_with_static_runtimes_CXX \ old_archive_cmds_CXX \ old_archive_from_new_cmds_CXX \ predep_objects_CXX \ postdep_objects_CXX \ predeps_CXX \ postdeps_CXX \ compiler_lib_search_path_CXX \ archive_cmds_CXX \ archive_expsym_cmds_CXX \ postinstall_cmds_CXX \ postuninstall_cmds_CXX \ old_archive_from_expsyms_cmds_CXX \ allow_undefined_flag_CXX \ no_undefined_flag_CXX \ export_symbols_cmds_CXX \ hardcode_libdir_flag_spec_CXX \ hardcode_libdir_flag_spec_ld_CXX \ hardcode_libdir_separator_CXX \ hardcode_automatic_CXX \ module_cmds_CXX \ module_expsym_cmds_CXX \ lt_cv_prog_compiler_c_o_CXX \ exclude_expsyms_CXX \ include_expsyms_CXX; do case $var in old_archive_cmds_CXX | \ old_archive_from_new_cmds_CXX | \ archive_cmds_CXX | \ archive_expsym_cmds_CXX | \ module_cmds_CXX | \ module_expsym_cmds_CXX | \ old_archive_from_expsyms_cmds_CXX | \ export_symbols_cmds_CXX | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_CXX # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # A language-specific compiler. CC=$lt_compiler_CXX # Is the compiler the GNU C compiler? with_gcc=$GCC_CXX # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_CXX # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_CXX # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_CXX pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX # Must we lock files when doing compilation? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_CXX # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_CXX old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_CXX archive_expsym_cmds=$lt_archive_expsym_cmds_CXX postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_CXX module_expsym_cmds=$lt_module_expsym_cmds_CXX # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects_CXX # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_CXX # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_CXX # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_CXX # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_CXX # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_CXX # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_CXX # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_CXX # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_CXX # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_CXX # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic_CXX # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_CXX # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path_CXX" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_CXX # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_CXX # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_CXX # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_CXX # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC=$lt_save_CC LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ldcxx=$with_gnu_ld with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld else tagname="" fi ;; F77) if test -n "$F77" && test "X$F77" != "Xno"; then ac_ext=f ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_f77_compiler_gnu archive_cmds_need_lc_F77=no allow_undefined_flag_F77= always_export_symbols_F77=no archive_expsym_cmds_F77= export_dynamic_flag_spec_F77= hardcode_direct_F77=no hardcode_libdir_flag_spec_F77= hardcode_libdir_flag_spec_ld_F77= hardcode_libdir_separator_F77= hardcode_minus_L_F77=no hardcode_automatic_F77=no module_cmds_F77= module_expsym_cmds_F77= link_all_deplibs_F77=unknown old_archive_cmds_F77=$old_archive_cmds no_undefined_flag_F77= whole_archive_flag_spec_F77= enable_shared_with_static_runtimes_F77=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o objext_F77=$objext # Code to be used in simple compile tests lt_simple_compile_test_code=" subroutine t\n return\n end\n" # Code to be used in simple link tests lt_simple_link_test_code=" program t\n end\n" # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm conftest* # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${F77-"f77"} compiler=$CC compiler_F77=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 $as_echo_n "checking if libtool supports shared libraries... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 $as_echo "$can_build_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 $as_echo_n "checking whether to build shared libraries... " >&6; } test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case "$host_os" in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix4* | aix5*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 $as_echo "$enable_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 $as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } test "$ld_shlibs_F77" = no && can_build_shared=no GCC_F77="$G77" LD_F77="$LD" lt_prog_compiler_wl_F77= lt_prog_compiler_pic_F77= lt_prog_compiler_static_F77= { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if test "$GCC" = yes; then lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_static_F77='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_F77='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_F77='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_F77='-fno-common' ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared_F77=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_F77=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_F77='-fPIC' ;; esac ;; *) lt_prog_compiler_pic_F77='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl_F77='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_F77='-Bstatic' else lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp' fi ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) lt_prog_compiler_pic_F77='-qnocommon' lt_prog_compiler_wl_F77='-Wl,' ;; esac ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_F77='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl_F77='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_F77='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static_F77='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl_F77='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static_F77='-non_shared' ;; newsos6) lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' ;; linux*) case $cc_basename in icc* | ecc*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-static' ;; pgcc* | pgf77* | pgf90*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-fpic' lt_prog_compiler_static_F77='-static' ;; ccc*) lt_prog_compiler_wl_F77='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static_F77='-non_shared' ;; esac ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl_F77='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static_F77='-non_shared' ;; sco3.2v5*) lt_prog_compiler_pic_F77='-Kpic' lt_prog_compiler_static_F77='-dn' ;; solaris*) lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' case $cc_basename in f77* | f90* | f95*) lt_prog_compiler_wl_F77='-Qoption ld ';; *) lt_prog_compiler_wl_F77='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl_F77='-Qoption ld ' lt_prog_compiler_pic_F77='-PIC' lt_prog_compiler_static_F77='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic_F77='-Kconform_pic' lt_prog_compiler_static_F77='-Bstatic' fi ;; unicos*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_can_build_shared_F77=no ;; uts4*) lt_prog_compiler_pic_F77='-pic' lt_prog_compiler_static_F77='-Bstatic' ;; *) lt_prog_compiler_can_build_shared_F77=no ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic_F77" >&5 $as_echo "$lt_prog_compiler_pic_F77" >&6; } # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_F77"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... " >&6; } if test "${lt_prog_compiler_pic_works_F77+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_prog_compiler_pic_works_F77=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_F77" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:13170: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:13174: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp $SED '/^$/d' conftest.err >conftest.er2 if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_pic_works_F77=yes fi fi $rm conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic_works_F77" >&5 $as_echo "$lt_prog_compiler_pic_works_F77" >&6; } if test x"$lt_prog_compiler_pic_works_F77" = xyes; then case $lt_prog_compiler_pic_F77 in "" | " "*) ;; *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;; esac else lt_prog_compiler_pic_F77= lt_prog_compiler_can_build_shared_F77=no fi fi case "$host_os" in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_F77= ;; *) lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_F77=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:13232: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:13236: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed > out/conftest.exp $SED '/^$/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_F77=yes fi fi chmod u+w . $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_F77" >&5 $as_echo "$lt_cv_prog_compiler_c_o_F77" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test "$hard_links" = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag_F77= enable_shared_with_static_runtimes_F77=no archive_cmds_F77= archive_expsym_cmds_F77= old_archive_From_new_cmds_F77= old_archive_from_expsyms_cmds_F77= export_dynamic_flag_spec_F77= whole_archive_flag_spec_F77= thread_safe_flag_spec_F77= hardcode_libdir_flag_spec_F77= hardcode_libdir_flag_spec_ld_F77= hardcode_libdir_separator_F77= hardcode_direct_F77=no hardcode_minus_L_F77=no hardcode_shlibpath_var_F77=unsupported link_all_deplibs_F77=unknown hardcode_automatic_F77=no module_cmds_F77= module_expsym_cmds_F77= always_export_symbols_F77=no export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms_F77= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms_F77="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. extract_expsyms_cmds= # Just being paranoid about ensuring that cc_basename is set. for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs_F77=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_F77='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_F77='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_F77= fi supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs_F77=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. ld_shlibs_F77=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_F77=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs_F77=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_F77='-L$libdir' allow_undefined_flag_F77=unsupported always_export_symbols_F77=no enable_shared_with_static_runtimes_F77=yes export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_F77='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' else ld_shlibs_F77=no fi ;; linux*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_addflag= case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec_F77='${wl}--whole-archive,`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* ) # Portland Group f77 and f90 compilers whole_archive_flag_spec_F77='${wl}--whole-archive,`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; esac archive_cmds_F77='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; then archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi else ld_shlibs_F77=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris* | sysv5*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs_F77=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_F77=no fi ;; sunos4*) archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_F77=no fi ;; esac if test "$ld_shlibs_F77" = no; then runpath_var= hardcode_libdir_flag_spec_F77= export_dynamic_flag_spec_F77= whole_archive_flag_spec_F77= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag_F77=unsupported always_export_symbols_F77=yes archive_expsym_cmds_F77='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L_F77=yes if test "$GCC" = yes && test -z "$link_static_flag"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct_F77=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_F77='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_F77='' hardcode_direct_F77=yes hardcode_libdir_separator_F77=':' link_all_deplibs_F77=yes if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct_F77=yes else # We have old collect2 hardcode_direct_F77=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_F77=yes hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_libdir_separator_F77= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols_F77=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_F77='-berok' # Determine the default libpath from the value encoded in an empty executable. cat > conftest.$ac_ext <<_ACEOF program main end _ACEOF if ac_fn_f77_try_link "$LINENO"; then : aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_F77="-z nodefs" archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat > conftest.$ac_ext <<_ACEOF program main end _ACEOF if ac_fn_f77_try_link "$LINENO"; then : aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_F77=' ${wl}-bernotok' allow_undefined_flag_F77=' ${wl}-berok' # -bexpall does not export symbols beginning with underscore (_) always_export_symbols_F77=yes # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_F77=' ' archive_cmds_need_lc_F77=yes # This is similar to how AIX traditionally builds it's shared libraries. archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes # see comment about different semantics on the GNU ld section ld_shlibs_F77=no ;; bsdi[45]*) export_dynamic_flag_spec_F77=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec_F77=' ' allow_undefined_flag_F77=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds_F77='true' # FIXME: Should let the user specify the lib program. old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path_F77='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes_F77=yes ;; darwin* | rhapsody*) case "$host_os" in rhapsody* | darwin1.[012]) allow_undefined_flag_F77='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) allow_undefined_flag_F77='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac archive_cmds_need_lc_F77=no hardcode_direct_F77=no hardcode_automatic_F77=yes hardcode_shlibpath_var_F77=unsupported whole_archive_flag_spec_F77='' link_all_deplibs_F77=yes if test "$GCC" = yes ; then output_verbose_link_cmd='echo' archive_cmds_F77='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) ld_shlibs_F77=no ;; esac fi ;; dgux*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_shlibpath_var_F77=no ;; freebsd1*) ld_shlibs_F77=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes hardcode_minus_L_F77=yes hardcode_shlibpath_var_F77=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | kfreebsd*-gnu | dragonfly*) archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds_F77='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds_F77='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' hardcode_libdir_separator_F77=: hardcode_direct_F77=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_F77=yes export_dynamic_flag_spec_F77='${wl}-E' ;; hpux10* | hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case "$host_cpu" in hppa*64*|ia64*) archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case "$host_cpu" in hppa*64*|ia64*) archive_cmds_F77='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' ;; *) archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;; esac fi if test "$with_gnu_ld" = no; then case "$host_cpu" in hppa*64*) hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' hardcode_libdir_flag_spec_ld_F77='+b $libdir' hardcode_libdir_separator_F77=: hardcode_direct_F77=no hardcode_shlibpath_var_F77=no ;; ia64*) hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_direct_F77=no hardcode_shlibpath_var_F77=no # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_F77=yes ;; *) hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' hardcode_libdir_separator_F77=: hardcode_direct_F77=yes export_dynamic_flag_spec_F77='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_F77=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_ld_F77='-rpath $libdir' fi hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_F77=: link_all_deplibs_F77=yes ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no ;; newsos6) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_F77=: hardcode_shlibpath_var_F77=no ;; openbsd*) hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' export_dynamic_flag_spec_F77='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_F77='-R$libdir' ;; *) archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' ;; esac fi ;; os2*) hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes allow_undefined_flag_F77=unsupported archive_cmds_F77='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_From_new_cmds_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag_F77=' -expect_unresolved \*' archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_F77=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' else allow_undefined_flag_F77=' -expect_unresolved \*' archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec_F77='-rpath $libdir' fi hardcode_libdir_separator_F77=: ;; sco3.2v5*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_F77=no export_dynamic_flag_spec_F77='${wl}-Bexport' runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ;; solaris*) no_undefined_flag_F77=' -z text' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else wlarc='' archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi hardcode_libdir_flag_spec_F77='-R$libdir' hardcode_shlibpath_var_F77=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine linker options so we # cannot just pass the convience library names through # without $wl, iff we do not link with $LD. # Luckily, gcc supports the same syntax we need for Sun Studio. # Supported since Solaris 2.6 (maybe 2.5.1?) case $wlarc in '') whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;; *) whole_archive_flag_spec_F77='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; esac ;; esac link_all_deplibs_F77=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_direct_F77=yes hardcode_minus_L_F77=yes hardcode_shlibpath_var_F77=no ;; sysv4) case $host_vendor in sni) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds_F77='$CC -r -o $output$reload_objs' hardcode_direct_F77=no ;; motorola) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var_F77=no ;; sysv4.3*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_F77=no export_dynamic_flag_spec_F77='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_F77=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs_F77=yes fi ;; sysv4.2uw2*) archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_F77=yes hardcode_minus_L_F77=no hardcode_shlibpath_var_F77=no hardcode_runpath_var=yes runpath_var=LD_RUN_PATH ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) no_undefined_flag_F77='${wl}-z ${wl}text' if test "$GCC" = yes; then archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_F77='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' fi runpath_var='LD_RUN_PATH' hardcode_shlibpath_var_F77=no ;; sysv5*) no_undefined_flag_F77=' -z text' # $CC -shared without GNU ld will not create a library from C++ # object files and a static libstdc++, better avoid it by now archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' hardcode_libdir_flag_spec_F77= hardcode_shlibpath_var_F77=no runpath_var='LD_RUN_PATH' ;; uts4*) archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_shlibpath_var_F77=no ;; *) ld_shlibs_F77=no ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_F77" >&5 $as_echo "$ld_shlibs_F77" >&6; } test "$ld_shlibs_F77" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_F77" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_F77=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_F77 in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_F77 compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_F77 allow_undefined_flag_F77= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then archive_cmds_need_lc_F77=no else archive_cmds_need_lc_F77=yes fi allow_undefined_flag_F77=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* { $as_echo "$as_me:${as_lineno-$LINENO}: result: $archive_cmds_need_lc_F77" >&5 $as_echo "$archive_cmds_need_lc_F77" >&6; } ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` else sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; kfreebsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; *) # from 3.2 on shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case "$host_cpu" in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; knetbsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; sco3.2v5*) version_type=osf soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action_F77= if test -n "$hardcode_libdir_flag_spec_F77" || \ test -n "$runpath_var_F77" || \ test "X$hardcode_automatic_F77" = "Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct_F77" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, F77)" != no && test "$hardcode_minus_L_F77" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_F77=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_F77=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_F77=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_F77" >&5 $as_echo "$hardcode_action_F77" >&6; } if test "$hardcode_action_F77" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi striplib= old_striplib= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; esac fi # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_F77 \ CC_F77 \ LD_F77 \ lt_prog_compiler_wl_F77 \ lt_prog_compiler_pic_F77 \ lt_prog_compiler_static_F77 \ lt_prog_compiler_no_builtin_flag_F77 \ export_dynamic_flag_spec_F77 \ thread_safe_flag_spec_F77 \ whole_archive_flag_spec_F77 \ enable_shared_with_static_runtimes_F77 \ old_archive_cmds_F77 \ old_archive_from_new_cmds_F77 \ predep_objects_F77 \ postdep_objects_F77 \ predeps_F77 \ postdeps_F77 \ compiler_lib_search_path_F77 \ archive_cmds_F77 \ archive_expsym_cmds_F77 \ postinstall_cmds_F77 \ postuninstall_cmds_F77 \ old_archive_from_expsyms_cmds_F77 \ allow_undefined_flag_F77 \ no_undefined_flag_F77 \ export_symbols_cmds_F77 \ hardcode_libdir_flag_spec_F77 \ hardcode_libdir_flag_spec_ld_F77 \ hardcode_libdir_separator_F77 \ hardcode_automatic_F77 \ module_cmds_F77 \ module_expsym_cmds_F77 \ lt_cv_prog_compiler_c_o_F77 \ exclude_expsyms_F77 \ include_expsyms_F77; do case $var in old_archive_cmds_F77 | \ old_archive_from_new_cmds_F77 | \ archive_cmds_F77 | \ archive_expsym_cmds_F77 | \ module_cmds_F77 | \ module_expsym_cmds_F77 | \ old_archive_from_expsyms_cmds_F77 | \ export_symbols_cmds_F77 | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_F77 # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77 # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # A language-specific compiler. CC=$lt_compiler_F77 # Is the compiler the GNU C compiler? with_gcc=$GCC_F77 # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_F77 # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_F77 # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_F77 pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77 # Must we lock files when doing compilation? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_F77 # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77 # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77 # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77 # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_F77 # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_F77 old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77 # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77 # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_F77 archive_expsym_cmds=$lt_archive_expsym_cmds_F77 postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_F77 module_expsym_cmds=$lt_module_expsym_cmds_F77 # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects_F77 # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_F77 # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_F77 # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_F77 # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_F77 # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_F77 # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_F77 # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_F77 # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_F77 # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77 # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77 # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_F77 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_F77 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_F77 # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic_F77 # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_F77 # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path_F77" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_F77 # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_F77 # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_F77 # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_F77 # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" else tagname="" fi ;; GCJ) if test -n "$GCJ" && test "X$GCJ" != "Xno"; then # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o objext_GCJ=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}\n" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n' # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm conftest* # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${GCJ-"gcj"} compiler=$CC compiler_GCJ=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` # GCJ did not exist at the time GCC didn't implicitly link libc in. archive_cmds_need_lc_GCJ=no old_archive_cmds_GCJ=$old_archive_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... lt_prog_compiler_no_builtin_flag_GCJ= if test "$GCC" = yes; then lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin' { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:15307: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:15311: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp $SED '/^$/d' conftest.err >conftest.er2 if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $rm conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl_GCJ= lt_prog_compiler_pic_GCJ= lt_prog_compiler_static_GCJ= { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if test "$GCC" = yes; then lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_static_GCJ='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_GCJ='-Bstatic' fi ;; amigaos*) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic_GCJ='-m68020 -resident32 -malways-restore-a4' ;; beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_GCJ='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_GCJ='-fno-common' ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared_GCJ=no enable_shared=no ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_GCJ=-Kconform_pic fi ;; hpux*) # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_GCJ='-fPIC' ;; esac ;; *) lt_prog_compiler_pic_GCJ='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl_GCJ='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_GCJ='-Bstatic' else lt_prog_compiler_static_GCJ='-bnso -bI:/lib/syscalls.exp' fi ;; darwin*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files case $cc_basename in xlc*) lt_prog_compiler_pic_GCJ='-qnocommon' lt_prog_compiler_wl_GCJ='-Wl,' ;; esac ;; mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_GCJ='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl_GCJ='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case "$host_cpu" in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_GCJ='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static_GCJ='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl_GCJ='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static_GCJ='-non_shared' ;; newsos6) lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; linux*) case $cc_basename in icc* | ecc*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-static' ;; pgcc* | pgf77* | pgf90*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-fpic' lt_prog_compiler_static_GCJ='-static' ;; ccc*) lt_prog_compiler_wl_GCJ='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static_GCJ='-non_shared' ;; esac ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl_GCJ='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static_GCJ='-non_shared' ;; sco3.2v5*) lt_prog_compiler_pic_GCJ='-Kpic' lt_prog_compiler_static_GCJ='-dn' ;; solaris*) lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' case $cc_basename in f77* | f90* | f95*) lt_prog_compiler_wl_GCJ='-Qoption ld ';; *) lt_prog_compiler_wl_GCJ='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl_GCJ='-Qoption ld ' lt_prog_compiler_pic_GCJ='-PIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic_GCJ='-Kconform_pic' lt_prog_compiler_static_GCJ='-Bstatic' fi ;; unicos*) lt_prog_compiler_wl_GCJ='-Wl,' lt_prog_compiler_can_build_shared_GCJ=no ;; uts4*) lt_prog_compiler_pic_GCJ='-pic' lt_prog_compiler_static_GCJ='-Bstatic' ;; *) lt_prog_compiler_can_build_shared_GCJ=no ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic_GCJ" >&5 $as_echo "$lt_prog_compiler_pic_GCJ" >&6; } # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_GCJ"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... " >&6; } if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_prog_compiler_pic_works_GCJ=no ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_GCJ" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:15569: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:15573: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp $SED '/^$/d' conftest.err >conftest.er2 if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then lt_prog_compiler_pic_works_GCJ=yes fi fi $rm conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic_works_GCJ" >&5 $as_echo "$lt_prog_compiler_pic_works_GCJ" >&6; } if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then case $lt_prog_compiler_pic_GCJ in "" | " "*) ;; *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;; esac else lt_prog_compiler_pic_GCJ= lt_prog_compiler_can_build_shared_GCJ=no fi fi case "$host_os" in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_GCJ= ;; *) lt_prog_compiler_pic_GCJ="$lt_prog_compiler_pic_GCJ" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_GCJ=no $rm -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out printf "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:15631: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:15635: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $echo "X$_lt_compiler_boilerplate" | $Xsed > out/conftest.exp $SED '/^$/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_GCJ=yes fi fi chmod u+w . $rm conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files $rm out/* && rmdir out cd .. rmdir conftest $rm conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_GCJ" >&5 $as_echo "$lt_cv_prog_compiler_c_o_GCJ" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $rm conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test "$hard_links" = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag_GCJ= enable_shared_with_static_runtimes_GCJ=no archive_cmds_GCJ= archive_expsym_cmds_GCJ= old_archive_From_new_cmds_GCJ= old_archive_from_expsyms_cmds_GCJ= export_dynamic_flag_spec_GCJ= whole_archive_flag_spec_GCJ= thread_safe_flag_spec_GCJ= hardcode_libdir_flag_spec_GCJ= hardcode_libdir_flag_spec_ld_GCJ= hardcode_libdir_separator_GCJ= hardcode_direct_GCJ=no hardcode_minus_L_GCJ=no hardcode_shlibpath_var_GCJ=unsupported link_all_deplibs_GCJ=unknown hardcode_automatic_GCJ=no module_cmds_GCJ= module_expsym_cmds_GCJ= always_export_symbols_GCJ=no export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms_GCJ= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms_GCJ="_GLOBAL_OFFSET_TABLE_" # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. extract_expsyms_cmds= # Just being paranoid about ensuring that cc_basename is set. for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` case $host_os in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs_GCJ=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_GCJ='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_GCJ='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_GCJ= fi supports_anon_versioning=no case `$LD -v 2>/dev/null` in *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs_GCJ=no cat <&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. EOF fi ;; amigaos*) archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_minus_L_GCJ=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we can't use # them. ld_shlibs_GCJ=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_GCJ=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs_GCJ=no fi ;; cygwin* | mingw* | pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, GCJ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_GCJ='-L$libdir' allow_undefined_flag_GCJ=unsupported always_export_symbols_GCJ=no enable_shared_with_static_runtimes_GCJ=yes export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_GCJ='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' else ld_shlibs_GCJ=no fi ;; linux*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_addflag= case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec_GCJ='${wl}--whole-archive,`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* ) # Portland Group f77 and f90 compilers whole_archive_flag_spec_GCJ='${wl}--whole-archive,`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; esac archive_cmds_GCJ='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; then archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi else ld_shlibs_GCJ=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris* | sysv5*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs_GCJ=no cat <&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. EOF elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_GCJ=no fi ;; sunos4*) archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_GCJ=no fi ;; esac if test "$ld_shlibs_GCJ" = no; then runpath_var= hardcode_libdir_flag_spec_GCJ= export_dynamic_flag_spec_GCJ= whole_archive_flag_spec_GCJ= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag_GCJ=unsupported always_export_symbols_GCJ=yes archive_expsym_cmds_GCJ='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L_GCJ=yes if test "$GCC" = yes && test -z "$link_static_flag"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct_GCJ=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then export_symbols_cmds_GCJ='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_GCJ='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_GCJ='' hardcode_direct_GCJ=yes hardcode_libdir_separator_GCJ=':' link_all_deplibs_GCJ=yes if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 hardcode_direct_GCJ=yes else # We have old collect2 hardcode_direct_GCJ=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_GCJ=yes hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_libdir_separator_GCJ= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols_GCJ=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_GCJ='-berok' # Determine the default libpath from the value encoded in an empty executable. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_GCJ='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_GCJ="-z nodefs" archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an empty executable. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'`; fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_GCJ=' ${wl}-bernotok' allow_undefined_flag_GCJ=' ${wl}-berok' # -bexpall does not export symbols beginning with underscore (_) always_export_symbols_GCJ=yes # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_GCJ=' ' archive_cmds_need_lc_GCJ=yes # This is similar to how AIX traditionally builds it's shared libraries. archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_minus_L_GCJ=yes # see comment about different semantics on the GNU ld section ld_shlibs_GCJ=no ;; bsdi[45]*) export_dynamic_flag_spec_GCJ=-rdynamic ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec_GCJ=' ' allow_undefined_flag_GCJ=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds_GCJ='true' # FIXME: Should let the user specify the lib program. old_archive_cmds_GCJ='lib /OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path_GCJ='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes_GCJ=yes ;; darwin* | rhapsody*) case "$host_os" in rhapsody* | darwin1.[012]) allow_undefined_flag_GCJ='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' else case ${MACOSX_DEPLOYMENT_TARGET} in 10.[012]) allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) allow_undefined_flag_GCJ='${wl}-undefined ${wl}dynamic_lookup' ;; esac fi ;; esac archive_cmds_need_lc_GCJ=no hardcode_direct_GCJ=no hardcode_automatic_GCJ=yes hardcode_shlibpath_var_GCJ=unsupported whole_archive_flag_spec_GCJ='' link_all_deplibs_GCJ=yes if test "$GCC" = yes ; then output_verbose_link_cmd='echo' archive_cmds_GCJ='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' else case $cc_basename in xlc*) output_verbose_link_cmd='echo' archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) ld_shlibs_GCJ=no ;; esac fi ;; dgux*) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_shlibpath_var_GCJ=no ;; freebsd1*) ld_shlibs_GCJ=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=yes hardcode_minus_L_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | kfreebsd*-gnu | dragonfly*) archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds_GCJ='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds_GCJ='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' hardcode_libdir_separator_GCJ=: hardcode_direct_GCJ=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_GCJ=yes export_dynamic_flag_spec_GCJ='${wl}-E' ;; hpux10* | hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case "$host_cpu" in hppa*64*|ia64*) archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case "$host_cpu" in hppa*64*|ia64*) archive_cmds_GCJ='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags' ;; *) archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;; esac fi if test "$with_gnu_ld" = no; then case "$host_cpu" in hppa*64*) hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' hardcode_libdir_flag_spec_ld_GCJ='+b $libdir' hardcode_libdir_separator_GCJ=: hardcode_direct_GCJ=no hardcode_shlibpath_var_GCJ=no ;; ia64*) hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_direct_GCJ=no hardcode_shlibpath_var_GCJ=no # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_GCJ=yes ;; *) hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' hardcode_libdir_separator_GCJ=: hardcode_direct_GCJ=yes export_dynamic_flag_spec_GCJ='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_GCJ=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds_GCJ='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_ld_GCJ='-rpath $libdir' fi hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_GCJ=: link_all_deplibs_GCJ=yes ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds_GCJ='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; newsos6) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=yes hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_GCJ=: hardcode_shlibpath_var_GCJ=no ;; openbsd*) hardcode_direct_GCJ=yes hardcode_shlibpath_var_GCJ=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' export_dynamic_flag_spec_GCJ='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_GCJ='-R$libdir' ;; *) archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' ;; esac fi ;; os2*) hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_minus_L_GCJ=yes allow_undefined_flag_GCJ=unsupported archive_cmds_GCJ='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_From_new_cmds_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag_GCJ=' -expect_unresolved \*' archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_GCJ=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' else allow_undefined_flag_GCJ=' -expect_unresolved \*' archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec_GCJ='-rpath $libdir' fi hardcode_libdir_separator_GCJ=: ;; sco3.2v5*) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_GCJ=no export_dynamic_flag_spec_GCJ='${wl}-Bexport' runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ;; solaris*) no_undefined_flag_GCJ=' -z text' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' else wlarc='' archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' fi hardcode_libdir_flag_spec_GCJ='-R$libdir' hardcode_shlibpath_var_GCJ=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine linker options so we # cannot just pass the convience library names through # without $wl, iff we do not link with $LD. # Luckily, gcc supports the same syntax we need for Sun Studio. # Supported since Solaris 2.6 (maybe 2.5.1?) case $wlarc in '') whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;; *) whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; esac ;; esac link_all_deplibs_GCJ=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds_GCJ='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_GCJ='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_direct_GCJ=yes hardcode_minus_L_GCJ=yes hardcode_shlibpath_var_GCJ=no ;; sysv4) case $host_vendor in sni) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds_GCJ='$CC -r -o $output$reload_objs' hardcode_direct_GCJ=no ;; motorola) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var_GCJ=no ;; sysv4.3*) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_GCJ=no export_dynamic_flag_spec_GCJ='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_GCJ=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs_GCJ=yes fi ;; sysv4.2uw2*) archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_GCJ=yes hardcode_minus_L_GCJ=no hardcode_shlibpath_var_GCJ=no hardcode_runpath_var=yes runpath_var=LD_RUN_PATH ;; sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*) no_undefined_flag_GCJ='${wl}-z ${wl}text' if test "$GCC" = yes; then archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_GCJ='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' fi runpath_var='LD_RUN_PATH' hardcode_shlibpath_var_GCJ=no ;; sysv5*) no_undefined_flag_GCJ=' -z text' # $CC -shared without GNU ld will not create a library from C++ # object files and a static libstdc++, better avoid it by now archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' hardcode_libdir_flag_spec_GCJ= hardcode_shlibpath_var_GCJ=no runpath_var='LD_RUN_PATH' ;; uts4*) archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_GCJ='-L$libdir' hardcode_shlibpath_var_GCJ=no ;; *) ld_shlibs_GCJ=no ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_GCJ" >&5 $as_echo "$ld_shlibs_GCJ" >&6; } test "$ld_shlibs_GCJ" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_GCJ" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_GCJ=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_GCJ in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } $rm conftest* printf "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_GCJ compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_GCJ allow_undefined_flag_GCJ= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then archive_cmds_need_lc_GCJ=no else archive_cmds_need_lc_GCJ=yes fi allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $rm conftest* { $as_echo "$as_me:${as_lineno-$LINENO}: result: $archive_cmds_need_lc_GCJ" >&5 $as_echo "$archive_cmds_need_lc_GCJ" >&6; } ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)' # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. if test "$GCC" = yes; then sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` else sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' fi sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; kfreebsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; *) # from 3.2 on shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case "$host_cpu" in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; knetbsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='GNU ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; nto-qnx*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; sco3.2v5*) version_type=osf soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action_GCJ= if test -n "$hardcode_libdir_flag_spec_GCJ" || \ test -n "$runpath_var_GCJ" || \ test "X$hardcode_automatic_GCJ" = "Xyes" ; then # We can hardcode non-existant directories. if test "$hardcode_direct_GCJ" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no && test "$hardcode_minus_L_GCJ" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_GCJ=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_GCJ=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_GCJ=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_GCJ" >&5 $as_echo "$hardcode_action_GCJ" >&6; } if test "$hardcode_action_GCJ" = relink; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi striplib= old_striplib= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; esac fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = x""yes; then : lt_cv_dlopen="shl_load" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if test "${ac_cv_lib_dld_shl_load+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = x""yes; then : lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" else ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = x""yes; then : lt_cv_dlopen="dlopen" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if test "${ac_cv_lib_svld_dlopen+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_svld_dlopen=yes else ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = x""yes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if test "${ac_cv_lib_dld_dld_link+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_dld_link=yes else ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = x""yes; then : lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } if test "${lt_cv_dlopen_self+set}" = set; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); } EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_unknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 $as_echo "$lt_cv_dlopen_self" >&6; } if test "x$lt_cv_dlopen_self" = xyes; then LDFLAGS="$LDFLAGS $link_static_flag" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if test "${lt_cv_dlopen_self_static+set}" = set; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); } EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 $as_echo "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_GCJ \ CC_GCJ \ LD_GCJ \ lt_prog_compiler_wl_GCJ \ lt_prog_compiler_pic_GCJ \ lt_prog_compiler_static_GCJ \ lt_prog_compiler_no_builtin_flag_GCJ \ export_dynamic_flag_spec_GCJ \ thread_safe_flag_spec_GCJ \ whole_archive_flag_spec_GCJ \ enable_shared_with_static_runtimes_GCJ \ old_archive_cmds_GCJ \ old_archive_from_new_cmds_GCJ \ predep_objects_GCJ \ postdep_objects_GCJ \ predeps_GCJ \ postdeps_GCJ \ compiler_lib_search_path_GCJ \ archive_cmds_GCJ \ archive_expsym_cmds_GCJ \ postinstall_cmds_GCJ \ postuninstall_cmds_GCJ \ old_archive_from_expsyms_cmds_GCJ \ allow_undefined_flag_GCJ \ no_undefined_flag_GCJ \ export_symbols_cmds_GCJ \ hardcode_libdir_flag_spec_GCJ \ hardcode_libdir_flag_spec_ld_GCJ \ hardcode_libdir_separator_GCJ \ hardcode_automatic_GCJ \ module_cmds_GCJ \ module_expsym_cmds_GCJ \ lt_cv_prog_compiler_c_o_GCJ \ exclude_expsyms_GCJ \ include_expsyms_GCJ; do case $var in old_archive_cmds_GCJ | \ old_archive_from_new_cmds_GCJ | \ archive_cmds_GCJ | \ archive_expsym_cmds_GCJ | \ module_cmds_GCJ | \ module_expsym_cmds_GCJ | \ old_archive_from_expsyms_cmds_GCJ | \ export_symbols_cmds_GCJ | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_GCJ # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_GCJ # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # A language-specific compiler. CC=$lt_compiler_GCJ # Is the compiler the GNU C compiler? with_gcc=$GCC_GCJ # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_GCJ # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_GCJ # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_GCJ pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ # Must we lock files when doing compilation? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_GCJ # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_GCJ # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_GCJ # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_GCJ # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_GCJ # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_GCJ old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_GCJ # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_GCJ # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_GCJ archive_expsym_cmds=$lt_archive_expsym_cmds_GCJ postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_GCJ module_expsym_cmds=$lt_module_expsym_cmds_GCJ # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects_GCJ # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_GCJ # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_GCJ # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_GCJ # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_GCJ # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_GCJ # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_GCJ # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_GCJ # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_GCJ # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_GCJ # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_GCJ # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_GCJ # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_GCJ # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_GCJ # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic_GCJ # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_GCJ # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path_GCJ" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_GCJ # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_GCJ # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_GCJ # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_GCJ # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" else tagname="" fi ;; RC) # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o objext_RC=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext printf "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext printf "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $rm conftest* # Allow CC to be a program name with arguments. lt_save_CC="$CC" CC=${RC-"windres"} compiler=$CC compiler_RC=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` lt_cv_prog_compiler_c_o_RC=yes # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then # See if we are running on zsh, and set the options which allow our commands through # without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \ SED SHELL STRIP \ libname_spec library_names_spec soname_spec extract_expsyms_cmds \ old_striplib striplib file_magic_cmd finish_cmds finish_eval \ deplibs_check_method reload_flag reload_cmds need_locks \ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ compiler_RC \ CC_RC \ LD_RC \ lt_prog_compiler_wl_RC \ lt_prog_compiler_pic_RC \ lt_prog_compiler_static_RC \ lt_prog_compiler_no_builtin_flag_RC \ export_dynamic_flag_spec_RC \ thread_safe_flag_spec_RC \ whole_archive_flag_spec_RC \ enable_shared_with_static_runtimes_RC \ old_archive_cmds_RC \ old_archive_from_new_cmds_RC \ predep_objects_RC \ postdep_objects_RC \ predeps_RC \ postdeps_RC \ compiler_lib_search_path_RC \ archive_cmds_RC \ archive_expsym_cmds_RC \ postinstall_cmds_RC \ postuninstall_cmds_RC \ old_archive_from_expsyms_cmds_RC \ allow_undefined_flag_RC \ no_undefined_flag_RC \ export_symbols_cmds_RC \ hardcode_libdir_flag_spec_RC \ hardcode_libdir_flag_spec_ld_RC \ hardcode_libdir_separator_RC \ hardcode_automatic_RC \ module_cmds_RC \ module_expsym_cmds_RC \ lt_cv_prog_compiler_c_o_RC \ exclude_expsyms_RC \ include_expsyms_RC; do case $var in old_archive_cmds_RC | \ old_archive_from_new_cmds_RC | \ archive_cmds_RC | \ archive_expsym_cmds_RC | \ module_cmds_RC | \ module_expsym_cmds_RC | \ old_archive_from_expsyms_cmds_RC | \ export_symbols_cmds_RC | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done case $lt_echo in *'\$0 --fallback-echo"') lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` ;; esac cfgfile="$ofile" cat <<__EOF__ >> "$cfgfile" # ### BEGIN LIBTOOL TAG CONFIG: $tagname # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_RC # Whether or not to disallow shared libs when runtime libs are static allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # An echo program that does not interpret backslashes. echo=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A C compiler. LTCC=$lt_LTCC # A language-specific compiler. CC=$lt_compiler_RC # Is the compiler the GNU C compiler? with_gcc=$GCC_RC # An ERE matcher. EGREP=$lt_EGREP # The linker used to build libraries. LD=$lt_LD_RC # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$lt_STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # Used on cygwin: DLL creation program. DLLTOOL="$DLLTOOL" # Used on cygwin: object dumper. OBJDUMP="$OBJDUMP" # Used on cygwin: assembler. AS="$AS" # The name of the directory that contains temporary libtool files. objdir=$objdir # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_RC # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Shared library suffix (normally ".so"). shrext_cmds='$shrext_cmds' # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_RC pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC # Must we lock files when doing compilation? need_locks=$lt_need_locks # Do we need the lib prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_RC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec_RC # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME. library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds_RC old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_RC # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds_RC archive_expsym_cmds=$lt_archive_expsym_cmds_RC postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) module_cmds=$lt_module_cmds_RC module_expsym_cmds=$lt_module_expsym_cmds_RC # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Dependencies to place before the objects being linked to create a # shared library. predep_objects=$lt_predep_objects_RC # Dependencies to place after the objects being linked to create a # shared library. postdep_objects=$lt_postdep_objects_RC # Dependencies to place before the objects being linked to create a # shared library. predeps=$lt_predeps_RC # Dependencies to place after the objects being linked to create a # shared library. postdeps=$lt_postdeps_RC # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_RC # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_RC # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_RC # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # This is the shared library runtime path variable. runpath_var=$runpath_var # This is the shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_RC # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_RC # If ld is used when linking, flag to hardcode \$libdir into # a binary during linking. This must work even if \$libdir does # not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_RC # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC # Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the # resulting binary. hardcode_direct=$hardcode_direct_RC # Set to yes if using the -LDIR flag during linking hardcodes DIR into the # resulting binary. hardcode_minus_L=$hardcode_minus_L_RC # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into # the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_RC # Set to yes if building a shared library automatically hardcodes DIR into the library # and all subsequent libraries and executables linked against it. hardcode_automatic=$hardcode_automatic_RC # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_RC # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path="$fix_srcfile_path_RC" # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_RC # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_RC # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_RC # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_RC # ### END LIBTOOL TAG CONFIG: $tagname __EOF__ else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` if test -f "$ltmain_in"; then test -f Makefile && make "$ltmain" fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" ;; *) as_fn_error "Unsupported tag name: $tagname" "$LINENO" 5 ;; esac # Append the new tag name to the list of available tags. if test -n "$tagname" ; then available_tags="$available_tags $tagname" fi fi done IFS="$lt_save_ifs" # Now substitute the updated list of available tags. if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then mv "${ofile}T" "$ofile" chmod +x "$ofile" else rm -f "${ofile}T" as_fn_error "unable to update list of available tagged configurations." "$LINENO" 5 fi fi # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' # Prevent multiple expansion ###### ###### parsing command line options ###### ### ### --with-pthread=PTHREAD_ROOT, or --without-pthread ### { $as_echo "$as_me:${as_lineno-$LINENO}: checking pthread" >&5 $as_echo_n "checking pthread... " >&6; } # Check whether --with-pthread was given. if test "${with_pthread+set}" = set; then : withval=$with_pthread; with_pthread="${withval}" fi ax_cv_have_pthread=no if test x"${with_pthread}" != x"no"; then # always define _REENTRANT pthread_includes="-D_REENTRANT" pthread_libs= if expr x"${with_pthread}" : x"/.*" >/dev/null; then # pathname specified? pthread_specified=explicit case ${with_pthread} in /usr) CPPFLAGS_SAVE="$CPPFLAGS" LIBS_SAVE="$LIBS" CPPFLAGS="${pthread_includes} $CPPFLAGS_SAVE" # -R is not portable without libtool, and not necessary for AC_TRY_LINK LIBS="`echo -lpthread | sed 's/-R[^ ]*//g'` $LIBS_SAVE" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include void *foo(void *p){ return 0; } int main () { pthread_t thread_id; pthread_create(&thread_id, NULL, foo, NULL); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_cv_have_pthread=yes pthread_includes="${pthread_includes} " pthread_libs="${pthread_libs} -lpthread" else if test x"${pthread_specified}" = x"explicit"; then as_fn_error "\"${with_pthread}\" is specified, but cannot be linked, aborted" "$LINENO" 5 fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CPPFLAGS="$CPPFLAGS_SAVE" LIBS="$LIBS_SAVE" ;; *) CPPFLAGS_SAVE="$CPPFLAGS" LIBS_SAVE="$LIBS" CPPFLAGS="${pthread_includes} -I${with_pthread}/include $CPPFLAGS_SAVE" # -R is not portable without libtool, and not necessary for AC_TRY_LINK LIBS="`echo -R${with_pthread}/lib -L${with_pthread}/lib -lpthread | sed 's/-R[^ ]*//g'` $LIBS_SAVE" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include void *foo(void *p){ return 0; } int main () { pthread_t thread_id; pthread_create(&thread_id, NULL, foo, NULL); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_cv_have_pthread=yes pthread_includes="${pthread_includes} -I${with_pthread}/include" pthread_libs="${pthread_libs} -R${with_pthread}/lib -L${with_pthread}/lib -lpthread" else if test x"${pthread_specified}" = x"explicit"; then as_fn_error "\"${with_pthread}\" is specified, but cannot be linked, aborted" "$LINENO" 5 fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CPPFLAGS="$CPPFLAGS_SAVE" LIBS="$LIBS_SAVE" ;; esac elif test x"${with_pthread}" != x && test x"${with_pthread}" != x"yes"; then pthread_specified=explicit CPPFLAGS_SAVE="$CPPFLAGS" LIBS_SAVE="$LIBS" CPPFLAGS="${pthread_includes} ${with_pthread} $CPPFLAGS_SAVE" # -R is not portable without libtool, and not necessary for AC_TRY_LINK LIBS="`echo ${with_pthread} | sed 's/-R[^ ]*//g'` $LIBS_SAVE" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include void *foo(void *p){ return 0; } int main () { pthread_t thread_id; pthread_create(&thread_id, NULL, foo, NULL); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_cv_have_pthread=yes pthread_includes="${pthread_includes} ${with_pthread}" pthread_libs="${pthread_libs} ${with_pthread}" else if test x"${pthread_specified}" = x"explicit"; then as_fn_error "\"${with_pthread}\" is specified, but cannot be linked, aborted" "$LINENO" 5 fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CPPFLAGS="$CPPFLAGS_SAVE" LIBS="$LIBS_SAVE" elif test x"${PTHREAD_CFLAGS+1}${PTHREAD_LDFLAGS+2}${PTHREAD_LIBS+3}" != x"" then # NetBSD pkgsrc configuration is specified? pthread_specified=explicit CPPFLAGS_SAVE="$CPPFLAGS" LIBS_SAVE="$LIBS" CPPFLAGS="${pthread_includes} ${PTHREAD_CFLAGS} $CPPFLAGS_SAVE" # -R is not portable without libtool, and not necessary for AC_TRY_LINK LIBS="`echo ${PTHREAD_LDFLAGS} ${PTHREAD_LIBS} | sed 's/-R[^ ]*//g'` $LIBS_SAVE" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include void *foo(void *p){ return 0; } int main () { pthread_t thread_id; pthread_create(&thread_id, NULL, foo, NULL); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_cv_have_pthread=yes pthread_includes="${pthread_includes} ${PTHREAD_CFLAGS}" pthread_libs="${pthread_libs} ${PTHREAD_LDFLAGS} ${PTHREAD_LIBS}" else if test x"${pthread_specified}" = x"explicit"; then as_fn_error "\"${PTHREAD_CFLAGS} ${PTHREAD_LDFLAGS} ${PTHREAD_LIBS}\" is specified, but cannot be linked, aborted" "$LINENO" 5 fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CPPFLAGS="$CPPFLAGS_SAVE" LIBS="$LIBS_SAVE" else # otherwise try system supplied pthread library pthread_specified=yes case $host in *-*-aix*) CPPFLAGS_SAVE="$CPPFLAGS" LIBS_SAVE="$LIBS" CPPFLAGS="${pthread_includes} -mthreads $CPPFLAGS_SAVE" # -R is not portable without libtool, and not necessary for AC_TRY_LINK LIBS="`echo -mthreads | sed 's/-R[^ ]*//g'` $LIBS_SAVE" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include void *foo(void *p){ return 0; } int main () { pthread_t thread_id; pthread_create(&thread_id, NULL, foo, NULL); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_cv_have_pthread=yes pthread_includes="${pthread_includes} -mthreads" pthread_libs="${pthread_libs} -mthreads" else if test x"${pthread_specified}" = x"explicit"; then as_fn_error "\"\" is specified, but cannot be linked, aborted" "$LINENO" 5 fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CPPFLAGS="$CPPFLAGS_SAVE" LIBS="$LIBS_SAVE" ;; *-*-freebsd[2-4].*) # FreeBSD 2.X ... 4.X (-lc_r) needs -D_THREAD_SAFE CPPFLAGS_SAVE="$CPPFLAGS" LIBS_SAVE="$LIBS" CPPFLAGS="${pthread_includes} -D_THREAD_SAFE -pthread $CPPFLAGS_SAVE" # -R is not portable without libtool, and not necessary for AC_TRY_LINK LIBS="`echo -pthread | sed 's/-R[^ ]*//g'` $LIBS_SAVE" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include void *foo(void *p){ return 0; } int main () { pthread_t thread_id; pthread_create(&thread_id, NULL, foo, NULL); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_cv_have_pthread=yes pthread_includes="${pthread_includes} -D_THREAD_SAFE -pthread" pthread_libs="${pthread_libs} -pthread" else if test x"${pthread_specified}" = x"explicit"; then as_fn_error "\"\" is specified, but cannot be linked, aborted" "$LINENO" 5 fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CPPFLAGS="$CPPFLAGS_SAVE" LIBS="$LIBS_SAVE" ;; *-*-hpux*) CPPFLAGS_SAVE="$CPPFLAGS" LIBS_SAVE="$LIBS" CPPFLAGS="${pthread_includes} -D_POSIX_C_SOURCE=199506L -D_HPUX_SOURCE $CPPFLAGS_SAVE" # -R is not portable without libtool, and not necessary for AC_TRY_LINK LIBS="`echo -lpthread | sed 's/-R[^ ]*//g'` $LIBS_SAVE" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include void *foo(void *p){ return 0; } int main () { pthread_t thread_id; pthread_create(&thread_id, NULL, foo, NULL); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_cv_have_pthread=yes pthread_includes="${pthread_includes} -D_POSIX_C_SOURCE=199506L -D_HPUX_SOURCE" pthread_libs="${pthread_libs} -lpthread" else if test x"${pthread_specified}" = x"explicit"; then as_fn_error "\"\" is specified, but cannot be linked, aborted" "$LINENO" 5 fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CPPFLAGS="$CPPFLAGS_SAVE" LIBS="$LIBS_SAVE" ;; *-*-solaris*) if test x"$GCC" = x"yes"; then CPPFLAGS_SAVE="$CPPFLAGS" LIBS_SAVE="$LIBS" CPPFLAGS="${pthread_includes} -pthread $CPPFLAGS_SAVE" # -R is not portable without libtool, and not necessary for AC_TRY_LINK LIBS="`echo -pthread | sed 's/-R[^ ]*//g'` $LIBS_SAVE" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include void *foo(void *p){ return 0; } int main () { pthread_t thread_id; pthread_create(&thread_id, NULL, foo, NULL); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_cv_have_pthread=yes pthread_includes="${pthread_includes} -pthread" pthread_libs="${pthread_libs} -pthread" else if test x"${pthread_specified}" = x"explicit"; then as_fn_error "\"\" is specified, but cannot be linked, aborted" "$LINENO" 5 fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CPPFLAGS="$CPPFLAGS_SAVE" LIBS="$LIBS_SAVE" else CPPFLAGS_SAVE="$CPPFLAGS" LIBS_SAVE="$LIBS" CPPFLAGS="${pthread_includes} -mt -D_POSIX_PTHREAD_SEMANTICS $CPPFLAGS_SAVE" # -R is not portable without libtool, and not necessary for AC_TRY_LINK LIBS="`echo -mt -lpthread | sed 's/-R[^ ]*//g'` $LIBS_SAVE" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include void *foo(void *p){ return 0; } int main () { pthread_t thread_id; pthread_create(&thread_id, NULL, foo, NULL); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_cv_have_pthread=yes pthread_includes="${pthread_includes} -mt -D_POSIX_PTHREAD_SEMANTICS" pthread_libs="${pthread_libs} -mt -lpthread" else if test x"${pthread_specified}" = x"explicit"; then as_fn_error "\"\" is specified, but cannot be linked, aborted" "$LINENO" 5 fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CPPFLAGS="$CPPFLAGS_SAVE" LIBS="$LIBS_SAVE" fi;; *-*-sysv5uw7*) # UnixWare 7 if test x"$GCC" = x"yes"; then CPPFLAGS_SAVE="$CPPFLAGS" LIBS_SAVE="$LIBS" CPPFLAGS="${pthread_includes} -pthread $CPPFLAGS_SAVE" # -R is not portable without libtool, and not necessary for AC_TRY_LINK LIBS="`echo -pthread | sed 's/-R[^ ]*//g'` $LIBS_SAVE" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include void *foo(void *p){ return 0; } int main () { pthread_t thread_id; pthread_create(&thread_id, NULL, foo, NULL); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_cv_have_pthread=yes pthread_includes="${pthread_includes} -pthread" pthread_libs="${pthread_libs} -pthread" else if test x"${pthread_specified}" = x"explicit"; then as_fn_error "\"\" is specified, but cannot be linked, aborted" "$LINENO" 5 fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CPPFLAGS="$CPPFLAGS_SAVE" LIBS="$LIBS_SAVE" else CPPFLAGS_SAVE="$CPPFLAGS" LIBS_SAVE="$LIBS" CPPFLAGS="${pthread_includes} -Kthread $CPPFLAGS_SAVE" # -R is not portable without libtool, and not necessary for AC_TRY_LINK LIBS="`echo -Kthread | sed 's/-R[^ ]*//g'` $LIBS_SAVE" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include void *foo(void *p){ return 0; } int main () { pthread_t thread_id; pthread_create(&thread_id, NULL, foo, NULL); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_cv_have_pthread=yes pthread_includes="${pthread_includes} -Kthread" pthread_libs="${pthread_libs} -Kthread" else if test x"${pthread_specified}" = x"explicit"; then as_fn_error "\"\" is specified, but cannot be linked, aborted" "$LINENO" 5 fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CPPFLAGS="$CPPFLAGS_SAVE" LIBS="$LIBS_SAVE" fi;; *) # Tru64 (OSF1): -pthread # FreeBSD 5.X: -pthread, 3 libraries are available as follows: # -lpthread (M:N, default), -lc_r (1:N), and -lthr (1:1) # NetBSD 2.X or later: -pthread # Linux: -pthread CPPFLAGS_SAVE="$CPPFLAGS" LIBS_SAVE="$LIBS" CPPFLAGS="${pthread_includes} -pthread $CPPFLAGS_SAVE" # -R is not portable without libtool, and not necessary for AC_TRY_LINK LIBS="`echo -pthread | sed 's/-R[^ ]*//g'` $LIBS_SAVE" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include void *foo(void *p){ return 0; } int main () { pthread_t thread_id; pthread_create(&thread_id, NULL, foo, NULL); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_cv_have_pthread=yes pthread_includes="${pthread_includes} -pthread" pthread_libs="${pthread_libs} -pthread" else if test x"${pthread_specified}" = x"explicit"; then as_fn_error "\"\" is specified, but cannot be linked, aborted" "$LINENO" 5 fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CPPFLAGS="$CPPFLAGS_SAVE" LIBS="$LIBS_SAVE" ;; esac # and if it fails too, just try default ${CFLAGS}, ${LDFLAGS} and ${LIBS} if test x"${ax_cv_have_pthread}" != x"yes"; then CPPFLAGS_SAVE="$CPPFLAGS" LIBS_SAVE="$LIBS" CPPFLAGS="${pthread_includes} $CPPFLAGS_SAVE" # -R is not portable without libtool, and not necessary for AC_TRY_LINK LIBS="`echo | sed 's/-R[^ ]*//g'` $LIBS_SAVE" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include void *foo(void *p){ return 0; } int main () { pthread_t thread_id; pthread_create(&thread_id, NULL, foo, NULL); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_cv_have_pthread=yes pthread_includes="${pthread_includes} " pthread_libs="${pthread_libs} " else if test x"${pthread_specified}" = x"explicit"; then as_fn_error "\"\" is specified, but cannot be linked, aborted" "$LINENO" 5 fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CPPFLAGS="$CPPFLAGS_SAVE" LIBS="$LIBS_SAVE" fi fi fi case ${ax_cv_have_pthread} in yes) { $as_echo "$as_me:${as_lineno-$LINENO}: result: using CFLAGS=\"${pthread_includes}\" and LDLIBS=\"${pthread_libs}\"" >&5 $as_echo "using CFLAGS=\"${pthread_includes}\" and LDLIBS=\"${pthread_libs}\"" >&6; } $as_echo "#define HAVE_PTHREAD 1" >>confdefs.h pthread_srcs='${PTHREAD_SRCS}' pthread_objs='${PTHREAD_OBJS}' pthread_cflags='${PTHREAD_CFLAGS}' pthread_targets='${PTHREAD_TARGETS}' ;; *) if test x"${with_pthread}" = x"no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 $as_echo "disabled" >&6; } else # in this case, must be: test x"${pthread_specified}" != x"explicit" { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi pthread_includes= pthread_libs= pthread_srcs= pthread_objs= pthread_cflags= pthread_targets= ;; esac # for conditional compilation which depends on pthread ### ### --with-openssl=OpenSSL_ROOT ### # sanity check for OpenSSL is deferred, because ${openssl_includes} # and ${openssl_lib} may be overrided by Globus autoconfiguration. # Check whether --with-openssl was given. if test "${with_openssl+set}" = set; then : withval=$with_openssl; with_openssl="${withval}" else with_openssl=/usr fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: using \"${with_openssl}\"" >&5 $as_echo "using \"${with_openssl}\"" >&6; } openssl_libs='-lssl -lcrypto' if test x"${with_openssl}" = x"/usr"; then openssl_includes= else openssl_includes="-I${with_openssl}/include" openssl_libs="-R${with_openssl}/lib -L${with_openssl}/lib ${openssl_libs}" fi ### ### --with-globus=GLOBUS_ROOT --with-globus-flavor=FLAVOR -with-globus-static ### # Check whether --with-globus_static was given. if test "${with_globus_static+set}" = set; then : withval=$with_globus_static; globus_static="${withval}" else globus_static="" fi # Check whether --with-globus_flavor was given. if test "${with_globus_flavor+set}" = set; then : withval=$with_globus_flavor; globus_flavor="${withval}" else globus_flavor= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking globus" >&5 $as_echo_n "checking globus... " >&6; } # Check whether --with-globus was given. if test "${with_globus+set}" = set; then : withval=$with_globus; globus_location="${withval}" case "${globus_location}" in yes) globus_location=${GLOBUS_LOCATION};; esac GLBlocation_candidates=${globus_location:-/usr/grid} if test -n "$globus_flavor"; then GLBflavor_candidates="$globus_flavor" else GLBflavor_candidates= if test x"$GCC" = x"yes"; then tmp='gcc vendorcc' else tmp='vendorcc gcc' fi for GLBbits in 64 32; do for GLBcc in $tmp; do for GLBdebug in "" dbg; do for GLBpthread in "" pthr; do GLBflavor_candidates="$GLBflavor_candidates $GLBcc$GLBbits$GLBdebug$GLBpthread" done done done done fi globus_found= for d in ${GLBlocation_candidates}; do for f in ${GLBflavor_candidates}; do if test -f "$d/include/$f/gssapi.h"; then globus_location=$d globus_flavor=$f globus_found=yes break fi done if test x"$globus_found" = x"yes"; then break; fi done if test x"$globus_found" != x"yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 $as_echo "not found" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: searched directories are: ${GLBlocation_candidates}" >&5 $as_echo "searched directories are: ${GLBlocation_candidates}" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: searched flavors are: ${GLBflavor_candidates}" >&5 $as_echo "searched flavors are: ${GLBflavor_candidates}" >&6; } if test -n "$globus_flavor"; then as_fn_error "cannot find the globus flavor \"$globus_flavor\", missing include/$globus_flavor/gssapi.h under ${GLBlocation_candidates}." "$LINENO" 5 else as_fn_error "cannot automatically find include/\${GLOBUS_FLAVOR}/gssapi.h under ${GLBlocation_candidates}, please specify the flavor by --with-globus-flavor=GLOBUS_FLAVOR" "$LINENO" 5 fi exit 1 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: found in \"${globus_location}\" with \"${globus_flavor}\" flavor" >&5 $as_echo "found in \"${globus_location}\" with \"${globus_flavor}\" flavor" >&6; } globus_includes="-I${globus_location}/include/${globus_flavor}" globus_libdir="${globus_location}/lib" cfgmhtmp=/tmp/cfgmh$$ { $as_echo "$as_me:${as_lineno-$LINENO}: checking globus library names" >&5 $as_echo_n "checking globus library names... " >&6; } if case ${globus_static} in yes) env GLOBUS_LOCATION=${globus_location} ${globus_location}/bin/globus-makefile-header -static -flavor=${globus_flavor} globus_gssapi_gsi;; *) env GLOBUS_LOCATION=${globus_location} ${globus_location}/bin/globus-makefile-header -flavor=${globus_flavor} globus_gssapi_gsi;; esac > $cfgmhtmp then { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 $as_echo "done" >&6; } else rm -f $cfgmhtmp { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed to call ${globus_location}/bin/globus-makefile-header command." >&5 $as_echo "failed to call ${globus_location}/bin/globus-makefile-header command." >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: Please run \${GPT_LOCATION}/sbin/gpt-postinstall, if it is not invoked yet." >&5 $as_echo "Please run \${GPT_LOCATION}/sbin/gpt-postinstall, if it is not invoked yet." >&6; } as_fn_error "Globus installation is incomplete, aborted." "$LINENO" 5 fi globus_gssapi_libs=`sed -n '/^GLOBUS_PKG_LIBS *=/s///p' $cfgmhtmp` rm -f $cfgmhtmp case ${globus_static} in yes) :;; *) globus_gssapi_libs="-R${globus_libdir} -L${globus_libdir} $globus_gssapi_libs" esac # for conditional compilation which depends on whether globus is enabled or not globus_srcs='${GLOBUS_SRCS}' globus_objs='${GLOBUS_OBJS}' globus_cflags='${GLOBUS_CFLAGS}' globus_targets='${GLOBUS_TARGETS}' # replace openssl library with that included in globus if test -x ${globus_location}/bin/globus-version; then globus_version=`env GLOBUS_LOCATION=${globus_location} ${globus_location}/bin/globus-version` case ${globus_version} in 4.0*|3*|2*) openssl_includes="${globus_includes}" case ${globus_static} in yes) openssl_libs="${globus_libdir}/libssl_${globus_flavor}.a ${globus_libdir}/libcrypto_${globus_flavor}.a" { $as_echo "$as_me:${as_lineno-$LINENO}: result: using globus static library: yes" >&5 $as_echo "using globus static library: yes" >&6; };; *) openssl_libs="-R${globus_libdir} -L${globus_libdir} -lssl_${globus_flavor} -lcrypto_${globus_flavor}" { $as_echo "$as_me:${as_lineno-$LINENO}: result: using globus static library: no" >&5 $as_echo "using globus static library: no" >&6; };; esac;; *) # after 4.2.0, globus does not include openssl libarary. ;; esac fi $as_echo "#define HAVE_GSI 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 $as_echo "disabled" >&6; } globus_location= globus_includes= globus_gssapi_libs= # for conditional compilation which depends on whether globus is enabled or not globus_srcs= globus_objs= globus_cflags= globus_targets= fi # for conditional compilation which depends on whether globus is enabled or not ### ### --with-gfshook ### # Check whether --with-gfshook was given. if test "${with_gfshook+set}" = set; then : withval=$with_gfshook; fi if test x${with_gfshook} != xno then gfshook_srcs='${GFSHOOK_SRCS}' gfshook_objs='${GFSHOOK_OBJS}' gfshook_cflags='${GFSHOOK_CFLAGS}' gfshook_targets='${GFSHOOK_TARGETS}' else { $as_echo "$as_me:${as_lineno-$LINENO}: checking gfshook" >&5 $as_echo_n "checking gfshook... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: disable" >&5 $as_echo "disable" >&6; } gfshook_srcs= gfshook_objs= gfshook_cflags= gfshook_targets= fi # for conditional compilation related to syscall hooking library ### ### --with-mpi=MPI_ROOT ### { $as_echo "$as_me:${as_lineno-$LINENO}: checking mpi" >&5 $as_echo_n "checking mpi... " >&6; } # Check whether --with-mpi was given. if test "${with_mpi+set}" = set; then : withval=$with_mpi; with_mpi="${withval}" if test x"${withval}" = x'yes'; then mpicc="mpicc" else mpicc="${with_mpi}/bin/mpicc" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: using \"${mpicc}\"" >&5 $as_echo "using \"${mpicc}\"" >&6; } # for conditional compilation which depends on whether MPI is enabled or not mpi_srcs='${MPI_SRCS}' mpi_objs='${MPI_OBJS}' mpi_cflags='${MPI_CFLAGS}' mpi_targets='${MPI_TARGETS}' else { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 $as_echo "disabled" >&6; } with_mpi= mpicc= # for conditional compilation which depends on whether MPI is enabled or not mpi_srcs= mpi_objs= mpi_cflags= mpi_targets= fi # for conditional compilation which depends on whether globus is enabled or not ### The following options are all "ns" specific ### ### --with-readline=READLINE_ROOT ### { $as_echo "$as_me:${as_lineno-$LINENO}: checking readline" >&5 $as_echo_n "checking readline... " >&6; } # Check whether --with-readline was given. if test "${with_readline+set}" = set; then : withval=$with_readline; with_readline="${withval}" else with_readline= fi readline_specified= case ${with_readline} in /*) if test -f "${with_readline}"/include/readline/readline.h; then readline_specified=explicit else as_fn_error "not found in \"${with_readline}\", aborted" "$LINENO" 5 fi;; yes) for d in /usr/local /usr/pkg /usr do if test -f $d/include/readline/readline.h; then with_readline=$d readline_specified=yes break fi done;; no|'') ;; *) readline_specified=explicit;; esac readline_includes= readline_libs= if test x"${readline_specified}" = x""; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: using \"${with_readline}\"" >&5 $as_echo "using \"${with_readline}\"" >&6; } $as_echo "#define HAVE_READLINE 1" >>confdefs.h readline_libs="-lreadline -ltermcap" case ${with_readline} in /usr) ;; /*) readline_includes="-I${with_readline}/include ${readline_includes}" readline_libs="-R${with_readline}/lib -L${with_readline}/lib ${readline_libs}" ;; *) readline_includes=${with_readline} readline_libs=${with_readline} ;; esac fi ### ### --with-default-ns-server=HOSTNAME ### # Check whether --with-default_ns_server was given. if test "${with_default_ns_server+set}" = set; then : withval=$with_default_ns_server; default_ns_server="${withval}" else default_ns_server='localhost' fi ### ### --with-default-ns-port=PORTNUMBER ### # Check whether --with-default_ns_port was given. if test "${with_default_ns_port+set}" = set; then : withval=$with_default_ns_port; default_ns_port="${withval}" else default_ns_port='5000' fi ### ### --with-default-ns-exec-root=DIR ### # Check whether --with-default_ns_exec_root was given. if test "${with_default_ns_exec_root+set}" = set; then : withval=$with_default_ns_exec_root; default_ns_exec_root="${withval}" default_ns_exec_bindir="${default_ns_exec_root}/bin" else default_ns_exec_root='$(prefix)' default_ns_exec_bindir='$(bindir)' fi ### ### --with-gfarm-rsh=RSH_COMMAND ### # Check whether --with-gfarm_rsh was given. if test "${with_gfarm_rsh+set}" = set; then : withval=$with_gfarm_rsh; gfarm_rsh="${withval}" else gfarm_rsh='rsh' fi ### ### --with-gfarmd-username=DIR ### # Check whether --with-gfarmd_username was given. if test "${with_gfarmd_username+set}" = set; then : withval=$with_gfarmd_username; gfarmd_username="${withval}" else gfarmd_username='nobody' fi ### ### --without-mtsafe-netdb ... are getaddrinfo(3) and getnameinfo(3) MT-Safe? ### # Check whether --with-mtsafe_netdb was given. if test "${with_mtsafe_netdb+set}" = set; then : withval=$with_mtsafe_netdb; mtsafe_netdb="${withval}" else mtsafe_netdb="yes" fi case ${mtsafe_netdb} in no) :;; *) $as_echo "#define HAVE_MTSAFE_NETDB 1" >>confdefs.h ;; esac ###### ###### Checks for libraries. ###### ### check sanity of $CC, $CFLAGS and $CPPFLAGS for ac_header in stdio.h do : ac_fn_c_check_header_mongrel "$LINENO" "stdio.h" "ac_cv_header_stdio_h" "$ac_includes_default" if test "x$ac_cv_header_stdio_h" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STDIO_H 1 _ACEOF fi done if test x"${ac_cv_header_stdio_h}" != x"yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: preprocessor option error on: \"$ac_cpp\"" >&5 $as_echo "preprocessor option error on: \"$ac_cpp\"" >&6; } #exit 1 fi ### check sanity of $CC, $CFLAGS, $CPPFLAGS and $LDFLAGS setting for ac_func in printf do : ac_fn_c_check_func "$LINENO" "printf" "ac_cv_func_printf" if test "x$ac_cv_func_printf" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_PRINTF 1 _ACEOF fi done if test x"${ac_cv_func_printf}" != x"yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: linker option error on: \"$ac_link\"" >&5 $as_echo "linker option error on: \"$ac_link\"" >&6; } exit 1 fi # We need to add those libraries to $LIBS at first, # otherwise some libraries (e.g. OpenLDAP and OpenSSL) cannot be linked. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBDL 1 _ACEOF LIBS="-ldl $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostname in -lnsl" >&5 $as_echo_n "checking for gethostname in -lnsl... " >&6; } if test "${ac_cv_lib_nsl_gethostname+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gethostname (); int main () { return gethostname (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_nsl_gethostname=yes else ac_cv_lib_nsl_gethostname=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostname" >&5 $as_echo "$ac_cv_lib_nsl_gethostname" >&6; } if test "x$ac_cv_lib_nsl_gethostname" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBNSL 1 _ACEOF LIBS="-lnsl $LIBS" fi # SVR4 and derived { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lsocket" >&5 $as_echo_n "checking for socket in -lsocket... " >&6; } if test "${ac_cv_lib_socket_socket+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char socket (); int main () { return socket (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_socket_socket=yes else ac_cv_lib_socket_socket=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_socket" >&5 $as_echo "$ac_cv_lib_socket_socket" >&6; } if test "x$ac_cv_lib_socket_socket" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBSOCKET 1 _ACEOF LIBS="-lsocket $LIBS" fi # SVR4 and derived { $as_echo "$as_me:${as_lineno-$LINENO}: checking for crypt in -lcrypt" >&5 $as_echo_n "checking for crypt in -lcrypt... " >&6; } if test "${ac_cv_lib_crypt_crypt+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypt $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char crypt (); int main () { return crypt (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypt_crypt=yes else ac_cv_lib_crypt_crypt=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypt_crypt" >&5 $as_echo "$ac_cv_lib_crypt_crypt" >&6; } if test "x$ac_cv_lib_crypt_crypt" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBCRYPT 1 _ACEOF LIBS="-lcrypt $LIBS" fi # 4.4BSD and derived { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cuserid in -lcompat" >&5 $as_echo_n "checking for cuserid in -lcompat... " >&6; } if test "${ac_cv_lib_compat_cuserid+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcompat $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char cuserid (); int main () { return cuserid (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_compat_cuserid=yes else ac_cv_lib_compat_cuserid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_compat_cuserid" >&5 $as_echo "$ac_cv_lib_compat_cuserid" >&6; } if test "x$ac_cv_lib_compat_cuserid" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBCOMPAT 1 _ACEOF LIBS="-lcompat $LIBS" fi # NetBSD { $as_echo "$as_me:${as_lineno-$LINENO}: checking for basename in -lgen" >&5 $as_echo_n "checking for basename in -lgen... " >&6; } if test "${ac_cv_lib_gen_basename+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lgen $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char basename (); int main () { return basename (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_gen_basename=yes else ac_cv_lib_gen_basename=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gen_basename" >&5 $as_echo "$ac_cv_lib_gen_basename" >&6; } if test "x$ac_cv_lib_gen_basename" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBGEN 1 _ACEOF LIBS="-lgen $LIBS" fi # IRIX { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fdatasync in -lrt" >&5 $as_echo_n "checking for fdatasync in -lrt... " >&6; } if test "${ac_cv_lib_rt_fdatasync+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lrt $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char fdatasync (); int main () { return fdatasync (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_rt_fdatasync=yes else ac_cv_lib_rt_fdatasync=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_fdatasync" >&5 $as_echo "$ac_cv_lib_rt_fdatasync" >&6; } if test "x$ac_cv_lib_rt_fdatasync" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBRT 1 _ACEOF LIBS="-lrt $LIBS" fi # Solaris { $as_echo "$as_me:${as_lineno-$LINENO}: checking for seteuid in -lcext" >&5 $as_echo_n "checking for seteuid in -lcext... " >&6; } if test "${ac_cv_lib_cext_seteuid+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcext $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char seteuid (); int main () { return seteuid (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_cext_seteuid=yes else ac_cv_lib_cext_seteuid=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cext_seteuid" >&5 $as_echo "$ac_cv_lib_cext_seteuid" >&6; } if test "x$ac_cv_lib_cext_seteuid" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBCEXT 1 _ACEOF LIBS="-lcext $LIBS" fi # HP-UX { $as_echo "$as_me:${as_lineno-$LINENO}: checking for perfstat_cpu_total in -lperfstat" >&5 $as_echo_n "checking for perfstat_cpu_total in -lperfstat... " >&6; } if test "${ac_cv_lib_perfstat_perfstat_cpu_total+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lperfstat $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char perfstat_cpu_total (); int main () { return perfstat_cpu_total (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_perfstat_perfstat_cpu_total=yes else ac_cv_lib_perfstat_perfstat_cpu_total=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_perfstat_perfstat_cpu_total" >&5 $as_echo "$ac_cv_lib_perfstat_perfstat_cpu_total" >&6; } if test "x$ac_cv_lib_perfstat_perfstat_cpu_total" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBPERFSTAT 1 _ACEOF LIBS="-lperfstat $LIBS" fi # AIX, to implement getloadavg() # have pthread_attr_setstacksize(3)? case ${ax_cv_have_pthread} in yes) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_attr_setstacksize" >&5 $as_echo_n "checking for pthread_attr_setstacksize... " >&6; } CPPFLAGS_SAVE="$CPPFLAGS" LIBS_SAVE="$LIBS" CPPFLAGS="${pthread_includes} $CPPFLAGS" LIBS="$LIBS ${pthread_libs}" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # include void test(void){} int main () { pthread_attr_t at; if (pthread_attr_init(&at) == 0) pthread_attr_setstacksize(&at, 64 * 1024); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define HAVE_PTHREAD_ATTR_SETSTACKSIZE 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CPPFLAGS="$CPPFLAGS_SAVE" LIBS="$LIBS_SAVE" ;; esac # Since gfarm-1.3, libgfarm calls pthread functions internally, # thus, we need to link ${pthread_libs}, unless libc supplies weak symbols. # e.g. using 3rd party pthread library, FreeBSD-4.x, or NetBSD-2.x { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether libc supplies weak symbols for pthread" >&5 $as_echo_n "checking whether libc supplies weak symbols for pthread... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include void init(void){} int main () { pthread_once_t once; pthread_once(&once, init); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no. WARNING: always link pthread" >&5 $as_echo "no. WARNING: always link pthread" >&6; } LIBS="${LIBS} ${pthread_libs}" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ### use 64bit off_t, if possible. { $as_echo "$as_me:${as_lineno-$LINENO}: checking Large File extention for 64bit off_t" >&5 $as_echo_n "checking Large File extention for 64bit off_t... " >&6; } if ( getconf LFS_CFLAGS && getconf LFS_LDFLAGS && getconf LFS_LIBS ) > /dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } largefile_cflags="`getconf LFS_CFLAGS`" largefile_ldflags="`getconf LFS_LDFLAGS`" LIBS="$LIBS `getconf LFS_LIBS`" if test x"$host_os" = x"linux-gnu"; then # glibc requires _GNU_SOURCE for pwrite64(2) largefile_cflags="${largefile_cflags} -D_GNU_SOURCE" fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } largefile_cflags= largefile_ldflags= fi ### is _LARGEFILE64_SOURCE API supported? i.e. can be _LFS64_LARGEFILE=1? { $as_echo "$as_me:${as_lineno-$LINENO}: checking _LARGEFILE64_SOURCE API" >&5 $as_echo_n "checking _LARGEFILE64_SOURCE API... " >&6; } if ( getconf LFS64_CFLAGS && getconf LFS64_LDFLAGS && getconf LFS64_LIBS ) > /dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } largefile64_srcs='${LARGEFILE64_SRCS}' largefile64_objs='${LARGEFILE64_OBJS}' largefile64_cflags='${LARGEFILE64_CFLAGS}' largefile64_targets='${LARGEFILE64_TARGETS}' else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } largefile64_srcs= largefile64_objs= largefile64_cflags= largefile64_targets= fi # for conditional compilation which depends on _LARGEFILE64_SOURCE API ### sanity check whether OpenSSL is really usable or not { $as_echo "$as_me:${as_lineno-$LINENO}: checking openssl" >&5 $as_echo_n "checking openssl... " >&6; } CPPFLAGS_SAVE="$CPPFLAGS" LIBS_SAVE="$LIBS" CPPFLAGS="${openssl_includes} $CPPFLAGS_SAVE" # -R is not portable without libtool, and not necessary for AC_TRY_LINK LIBS="`echo ${openssl_libs} | sed 's/-R[^ ]*//g'` $LIBS_SAVE" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { EVP_MD_CTX md_ctx; EVP_MD *md_type = EVP_get_digestbyname("sha1"); EVP_DigestInit(&md_ctx, md_type); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : else as_fn_error "OpenSSL cannot be linked with \"${openssl_includes} ${openssl_libs}\" options, aborted" "$LINENO" 5 fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CPPFLAGS="$CPPFLAGS_SAVE" LIBS="$LIBS_SAVE" { $as_echo "$as_me:${as_lineno-$LINENO}: result: using \"${openssl_includes} ${openssl_libs}\"" >&5 $as_echo "using \"${openssl_includes} ${openssl_libs}\"" >&6; } ### ### --with-openldap=OpenLDAP_ROOT ### # This command line option must be handled here, # because this needs AC_CHECK_LIB(nsl, ...) { $as_echo "$as_me:${as_lineno-$LINENO}: checking openldap" >&5 $as_echo_n "checking openldap... " >&6; } # Check whether --with-openldap was given. if test "${with_openldap+set}" = set; then : withval=$with_openldap; with_openldap="${withval}" else with_openldap= fi ldap_specified= case ${with_openldap} in /*) if test -f "${with_openldap}"/include/ldap.h; then ldap_specified=explicit else as_fn_error "not found in \"${with_openldap}\", aborted" "$LINENO" 5 fi;; yes|'') for d in /usr/local/openldap /usr/local /usr/pkg /usr do if test -f $d/include/ldap.h; then with_openldap=$d ldap_specified=yes break fi done;; no) ;; *) ldap_specified=explicit;; esac ldap_usable= if test x"${ldap_specified}" = x""; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } else case ${with_openldap} in /*) case ${with_openldap} in /usr) ldap_includes= ldap_libs=;; *) ldap_includes="-I${with_openldap}/include" ldap_libs="-R${with_openldap}/lib -L${with_openldap}/lib";; esac # OpenLDAP since 2.x calls res_query() and dn_expand(), if dnssrv is # configured, and DNS resolver library doesn't belongs to libc on some # systems. # But we cannot blindly link libresolv, because it may change behaviour # of gethostbyname() and friends. for libs in "-lldap -llber" "-lldap"; do for extra_lib in "" "-lresolv" "-lbind"; do CPPFLAGS_SAVE="$CPPFLAGS" LIBS_SAVE="$LIBS" CPPFLAGS="${ldap_includes} $CPPFLAGS_SAVE" # -R is not portable without libtool, and not necessary for AC_TRY_LINK LIBS="`echo ${ldap_libs} | sed 's/-R[^ ]*//g'` ${libs} ${extra_lib} ${openssl_libs} $LIBS_SAVE" # OpenLDAP may need OpenSSL due to its SSL/TLS support. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { LDAP *ldap_server = ldap_open("example.com", 389); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : if test x"${extra_lib}" != x""; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: using \"${ldap_includes} ${ldap_libs} ${libs}\" with \"${extra_lib}\" for LDAP" >&5 $as_echo "using \"${ldap_includes} ${ldap_libs} ${libs}\" with \"${extra_lib}\" for LDAP" >&6; } ldap_libs="${ldap_libs} ${libs} ${extra_lib}" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: using \"${ldap_includes} ${ldap_libs} ${libs}\" for LDAP" >&5 $as_echo "using \"${ldap_includes} ${ldap_libs} ${libs}\" for LDAP" >&6; } ldap_libs="${ldap_libs} ${libs}" fi ldap_usable=yes # this needs to be checked here due to settings of $CPPFLAGS and $LIBS for ac_func in ldap_memfree ldap_set_option ldap_start_tls_s ldap_perror do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" eval as_val=\$$as_ac_var if test "x$as_val" = x""yes; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CPPFLAGS="$CPPFLAGS_SAVE" LIBS="$LIBS_SAVE" if test x"${ldap_usable}" = x"yes"; then break 2 fi done done ;; *) ldap_includes=${with_openldap} ldap_libs=${with_openldap} CPPFLAGS_SAVE="$CPPFLAGS" LIBS_SAVE="$LIBS" CPPFLAGS="${ldap_includes} $CPPFLAGS_SAVE" # -R is not portable without libtool, and not necessary for AC_TRY_LINK LIBS="`echo ${ldap_libs} | sed 's/-R[^ ]*//g'` ${openssl_libs} $LIBS_SAVE" # OpenLDAP may need OpenSSL due to its SSL/TLS support. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { LDAP *ldap_server = ldap_open("example.com", 389); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : if test x"" != x""; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: using \"${ldap_includes} ${ldap_libs} \" with \"\" for LDAP" >&5 $as_echo "using \"${ldap_includes} ${ldap_libs} \" with \"\" for LDAP" >&6; } ldap_libs="${ldap_libs} " else { $as_echo "$as_me:${as_lineno-$LINENO}: result: using \"${ldap_includes} ${ldap_libs} \" for LDAP" >&5 $as_echo "using \"${ldap_includes} ${ldap_libs} \" for LDAP" >&6; } ldap_libs="${ldap_libs} " fi ldap_usable=yes # this needs to be checked here due to settings of $CPPFLAGS and $LIBS for ac_func in ldap_memfree ldap_set_option ldap_start_tls_s ldap_perror do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" eval as_val=\$$as_ac_var if test "x$as_val" = x""yes; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CPPFLAGS="$CPPFLAGS_SAVE" LIBS="$LIBS_SAVE" ;; esac if test x"${ldap_usable}" != x"yes"; then case $ldap_specified in explicit) as_fn_error "\"${with_openldap}\" is specified, but cannot be linked, aborted" "$LINENO" 5;; yes) { $as_echo "$as_me:${as_lineno-$LINENO}: result: found in \"${with_openldap}\", but cannot be linked, ignored" >&5 $as_echo "found in \"${with_openldap}\", but cannot be linked, ignored" >&6; };; esac fi fi case $ldap_usable in yes) $as_echo "#define HAVE_LDAP 1" >>confdefs.h ldap_srcs='${LDAP_SRCS}' ldap_objs='${LDAP_OBJS}' ldap_cflags='${LDAP_CFLAGS}' ldap_targets='${LDAP_TARGETS}' ;; *) ldap_includes= ldap_libs= ldap_srcs= ldap_objs= ldap_cflags= ldap_targets= ;; esac # for conditional compilation which depends on LDAP ### ### --with-postgresql=PostgreSQL_ROOT ### { $as_echo "$as_me:${as_lineno-$LINENO}: checking PostgreSQL" >&5 $as_echo_n "checking PostgreSQL... " >&6; } # Check whether --with-postgresql was given. if test "${with_postgresql+set}" = set; then : withval=$with_postgresql; with_postgresql="${withval}" else with_postgresql= fi postgresql_specified= case ${with_postgresql} in /*) if test -f "${with_postgresql}"/bin/pg_config; then postgresql_specified=explicit else as_fn_error "not found in \"${with_postgresql}\", aborted" "$LINENO" 5 fi;; yes|'') for d in /usr/local/pgsql /usr/local /usr/pkg /usr do if test -f $d/bin/pg_config; then with_postgresql=$d postgresql_specified=yes break fi done;; no) ;; *) postgresql_specified=explicit;; esac postgresql_usable= if test x"${postgresql_specified}" = x""; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } else if test -x ${with_postgresql}/bin/pg_config; then if ! ${with_postgresql}/bin/pg_config --version > /dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed to call ${with_postgresql}/bin/pg_config command." >&5 $as_echo "failed to call ${with_postgresql}/bin/pg_config command." >&6; } as_fn_error "PostgreSQL installation is incomplete, aborted." "$LINENO" 5 fi postgresql_include_dir=`${with_postgresql}/bin/pg_config --includedir` postgresql_lib_dir=`${with_postgresql}/bin/pg_config --libdir` case ${postgresql_include_dir} in /usr/include) postgresql_includes= ;; *) postgresql_includes="-I${postgresql_include_dir}" ;; esac case ${postgresql_lib_dir} in /usr/lib) postgresql_libs="-lpq" ;; *) postgresql_libs="-R${postgresql_lib_dir} -L${postgresql_lib_dir} -lpq" ;; esac else postgresql_includes="${with_postgresql}" postgresql_libs="${with_postgresql}" fi CPPFLAGS_SAVE="$CPPFLAGS" LIBS_SAVE="$LIBS" CPPFLAGS="${postgresql_includes} $CPPFLAGS_SAVE" # -R is not portable without libtool, and not necessary for AC_TRY_LINK LIBS="`echo $postgresql_libs | sed 's/-R[^ ]*//g'` $LIBS_SAVE" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { PGconn *conn = PQconnectdb(""); PGresult *res = PQexecParams(conn, "", 0, NULL, NULL, NULL, NULL, 0); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : postgresql_usable=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: using \"${with_postgresql}\"" >&5 $as_echo "using \"${with_postgresql}\"" >&6; } else case $postgresql_specified in explicit) as_fn_error "\"${with_postgresql}\" is specified, but cannot be linked, aborted" "$LINENO" 5;; yes) { $as_echo "$as_me:${as_lineno-$LINENO}: result: found in \"${with_postgresql}\", but cannot be linked, ignored" >&5 $as_echo "found in \"${with_postgresql}\", but cannot be linked, ignored" >&6; };; esac fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CPPFLAGS="$CPPFLAGS_SAVE" LIBS="$LIBS_SAVE" fi case $postgresql_usable in yes) $as_echo "#define HAVE_POSTGRESQL 1" >>confdefs.h postgresql_srcs='${POSTGRESQL_SRCS}' postgresql_objs='${POSTGRESQL_OBJS}' postgresql_cflags='${POSTGRESQL_CFLAGS}' postgresql_targets='${POSTGRESQL_TARGETS}' ;; *) postgresql_includes= postgresql_libs= postgresql_srcs= postgresql_objs= postgresql_cflags= postgresql_targets= ;; esac # for conditional compilation which depends on PostgreSQL ### ### sanity check. We need either PostgreSQL or LDAP. ### if test x"${ldap_usable}" != x"yes" && test x"${postgresql_usable}" != x"yes" then { $as_echo "$as_me:${as_lineno-$LINENO}: result: WARNING: neither LDAP or PostgreSQL is found" >&5 $as_echo "WARNING: neither LDAP or PostgreSQL is found" >&6; } fi ###### ###### Checks for header files. ###### for ac_header in inttypes.h shadow.h crypt.h machine/endian.h sys/loadavg.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" eval as_val=\$$as_ac_Header if test "x$as_val" = x""yes; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done ###### ###### Checks for types. ###### { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 $as_echo_n "checking whether byte ordering is bigendian... " >&6; } if test "${ac_cv_c_bigendian+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_cv_c_bigendian=unknown # See if we're dealing with a universal compiler. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __APPLE_CC__ not a universal capable compiler #endif typedef int dummy; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : # Check for potential -arch flags. It is not universal unless # there are at least two -arch flags with different values. ac_arch= ac_prev= for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do if test -n "$ac_prev"; then case $ac_word in i?86 | x86_64 | ppc | ppc64) if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then ac_arch=$ac_word else ac_cv_c_bigendian=universal break fi ;; esac ac_prev= elif test "x$ac_word" = "x-arch"; then ac_prev=arch fi done fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_c_bigendian = unknown; then # See if sys/param.h defines the BYTE_ORDER macro. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { #if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ && LITTLE_ENDIAN) bogus endian macros #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : # It does; now see whether it defined to BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { #if BYTE_ORDER != BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_bigendian=yes else ac_cv_c_bigendian=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { #if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) bogus endian macros #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : # It does; now see whether it defined to _BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { #ifndef _BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_bigendian=yes else ac_cv_c_bigendian=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # Compile a test program. if test "$cross_compiling" = yes; then : # Try to guess by grepping values from an object file. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; int use_ascii (int i) { return ascii_mm[i] + ascii_ii[i]; } short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; int use_ebcdic (int i) { return ebcdic_mm[i] + ebcdic_ii[i]; } extern int foo; int main () { return use_ascii (foo) == use_ebcdic (foo); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then ac_cv_c_bigendian=yes fi if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then if test "$ac_cv_c_bigendian" = unknown; then ac_cv_c_bigendian=no else # finding both strings is unlikely to happen, but who knows? ac_cv_c_bigendian=unknown fi fi fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { /* Are we little or big endian? From Harbison&Steele. */ union { long int l; char c[sizeof (long int)]; } u; u.l = 1; return u.c[sizeof (long int) - 1] == 1; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_c_bigendian=no else ac_cv_c_bigendian=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 $as_echo "$ac_cv_c_bigendian" >&6; } case $ac_cv_c_bigendian in #( yes) $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h ;; #( no) ;; #( universal) $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h ;; #( *) as_fn_error "unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; esac # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 $as_echo_n "checking size of long... " >&6; } if test "${ac_cv_sizeof_long+set}" = set; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then : else if test "$ac_cv_type_long" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { as_fn_set_status 77 as_fn_error "cannot compute sizeof (long) See \`config.log' for more details." "$LINENO" 5; }; } else ac_cv_sizeof_long=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 $as_echo "$ac_cv_sizeof_long" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_LONG $ac_cv_sizeof_long _ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long long" >&5 $as_echo_n "checking size of long long... " >&6; } if test "${ac_cv_sizeof_long_long+set}" = set; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long))" "ac_cv_sizeof_long_long" "$ac_includes_default"; then : else if test "$ac_cv_type_long_long" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { as_fn_set_status 77 as_fn_error "cannot compute sizeof (long long) See \`config.log' for more details." "$LINENO" 5; }; } else ac_cv_sizeof_long_long=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_long" >&5 $as_echo "$ac_cv_sizeof_long_long" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long _ACEOF ### socklen_t is available? { $as_echo "$as_me:${as_lineno-$LINENO}: checking socklen_t" >&5 $as_echo_n "checking socklen_t... " >&6; } case $host_os_nickname in hpux) # There are two ways to deal with socklen_t on HP-UX 11i. # 1. Use system supplied socklen_t. # This requires CPPFLAGS=-D_XOPEN_SOURCE_EXTENDED and LIBS=-lxnet. # 2. Use int. # This is incompatible with both -D_XOPEN_SOURCE_EXTENDED and -lxnet. # socklen_t had been also usable for the case 2 on HP-UX before LP64 support. # But this is no longer true on LP64 HP-UX, because socklen_t is now always # size_t on HP-UX, and size_t is uint64_t on LP64 systems. The problem is # that 1 and 2 are incompatible, and cannot be linked each other. # We choose 2 here, because that seems to be the way most third party # libraries are using now. ax_cv_have_socklen_t=no # don't try linking, it's linkable, but doesn't work. ;; *) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # include # include int main () { int rv, s = socket(PF_INET, SOCK_STREAM, 0); struct sockaddr addr; socklen_t len; rv = getpeername(s, &addr, &len); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_cv_have_socklen_t=yes else ax_cv_have_socklen_t=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ;; esac if test "$ax_cv_have_socklen_t" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else # determine size of socklen_t if test "$cross_compiling" = yes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error "cannot run test program while cross compiling See \`config.log' for more details." "$LINENO" 5; } else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # include # include main() { struct msghdr h; /* h.msg_namelen should be socklen_t */ h.msg_namelen = -1; if (sizeof(h.msg_namelen) == sizeof(int) && h.msg_namelen < 0) return (0); /* int */ else return (1); /* size_t */ } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ax_cv_socklen_t=int else ax_cv_socklen_t=size_t fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_socklen_t" >&5 $as_echo "$ax_cv_socklen_t" >&6; } cat >>confdefs.h <<_ACEOF #define socklen_t $ax_cv_socklen_t _ACEOF fi ###### ###### Checks for structures. ###### { $as_echo "$as_me:${as_lineno-$LINENO}: checking struct dirent::d_off" >&5 $as_echo_n "checking struct dirent::d_off... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { struct dirent d; long off; off = d.d_off; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ax_cv_have_d_off=yes else ax_cv_have_d_off=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_have_d_off" >&5 $as_echo "$ax_cv_have_d_off" >&6; } if test "$ax_cv_have_d_off" = yes; then $as_echo "#define HAVE_D_OFF 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking struct dirent::d_namlen" >&5 $as_echo_n "checking struct dirent::d_namlen... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { struct dirent d; int len; len = d.d_namlen; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ax_cv_have_d_namlen=yes else ax_cv_have_d_namlen=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_have_d_namlen" >&5 $as_echo "$ax_cv_have_d_namlen" >&6; } if test "$ax_cv_have_d_namlen" = yes; then $as_echo "#define HAVE_D_NAMLEN 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking struct dirent::d_type" >&5 $as_echo_n "checking struct dirent::d_type... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { struct dirent d; int len; len = d.d_type; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ax_cv_have_d_type=yes else ax_cv_have_d_type=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_have_d_type" >&5 $as_echo "$ax_cv_have_d_type" >&6; } if test "$ax_cv_have_d_type" = yes; then $as_echo "#define HAVE_D_TYPE 1" >>confdefs.h fi ###### Checks for compiler characteristics. # empty for now ###### ###### Checks for library functions. ###### for ac_func in getdents fdatasync fdopendir poll pread pwrite snprintf getpassphrase mkdtemp setlogin strtoll strtoq setrlimit daemon getloadavg statvfs statfs random do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" eval as_val=\$$as_ac_var if test "x$as_val" = x""yes; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done ### Check epoll_create really implemented { $as_echo "$as_me:${as_lineno-$LINENO}: checking for epoll" >&5 $as_echo_n "checking for epoll... " >&6; } if test "$cross_compiling" = yes; then : ax_cv_func_epoll=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main() { return (epoll_create(5) == -1); } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ax_cv_func_epoll=yes else ax_cv_func_epoll=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_func_epoll" >&5 $as_echo "$ax_cv_func_epoll" >&6; } if test "$ax_cv_func_epoll" = yes; then $as_echo "#define HAVE_EPOLL 1" >>confdefs.h fi ### SUSv2 getpwnam_r() has 5 args, but Solaris's only has 4. { $as_echo "$as_me:${as_lineno-$LINENO}: checking SUSv2 compliant getpwnam_r" >&5 $as_echo_n "checking SUSv2 compliant getpwnam_r... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { int rv; struct passwd *pwd; char buffer[1024]; rv = getpwnam_r("root", pwd, buffer, sizeof buffer, &pwd); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_cv_have_getpwnam_r=yes else ax_cv_have_getpwnam_r=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_have_getpwnam_r" >&5 $as_echo "$ax_cv_have_getpwnam_r" >&6; } if test "$ax_cv_have_getpwnam_r" = yes; then $as_echo "#define HAVE_GETPWNAM_R 1" >>confdefs.h fi ### SUSv2 getspnam_r() has 5 args, but Solaris's only has 4. { $as_echo "$as_me:${as_lineno-$LINENO}: checking SUSv2 compliant getspnam_r" >&5 $as_echo_n "checking SUSv2 compliant getspnam_r... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { int rv; struct spwd *sp; char buffer[1024]; rv = getspnam_r("root", sp, buffer, sizeof buffer, &sp); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_cv_have_getspnam_r=yes else ax_cv_have_getspnam_r=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_have_getspnam_r" >&5 $as_echo "$ax_cv_have_getspnam_r" >&6; } if test "$ax_cv_have_getspnam_r" = yes; then $as_echo "#define HAVE_GETSPNAM_R 1" >>confdefs.h fi ### Solaris no longer defines sys_nerr/sys_errlist { $as_echo "$as_me:${as_lineno-$LINENO}: checking sys_nerr" >&5 $as_echo_n "checking sys_nerr... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { int i = sys_nerr; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_cv_have_sys_nerr=yes else ax_cv_have_sys_nerr=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_have_sys_nerr" >&5 $as_echo "$ax_cv_have_sys_nerr" >&6; } if test "$ax_cv_have_sys_nerr" = yes; then $as_echo "#define HAVE_SYS_NERR 1" >>confdefs.h fi ###### Checks for system services. # empty for now ###### ###### miscellaneous ###### ### ### config.h template ### ### ### lib/gfs_hook ### # need to make system dependent source? gfs_hook_sysdep=lib/gfs_hook/sysdep/${host_os_nickname} if test -f ${srcdir}/${gfs_hook_sysdep}/Makefile; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: using ${gfs_hook_sysdep} directory for system dependent objects." >&5 $as_echo "using ${gfs_hook_sysdep} directory for system dependent objects." >&6; } gfs_hook_sysdep_subdir=${host_os_nickname} else gfs_hook_sysdep_subdir=default fi ### ### gftool/config-gfarm ### config_gfarm_sysdep=gftool/config-gfarm/sysdep/${host_os_nickname} if test -f ${srcdir}/${config_gfarm_sysdep}/Makefile; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: using ${config_gfarm_sysdep} directory for system dependent part of config-gfarm." >&5 $as_echo "using ${config_gfarm_sysdep} directory for system dependent part of config-gfarm." >&6; } config_gfarm_sysdep_subdir=${host_os_nickname} else config_gfarm_sysdep_subdir=default fi ### ### --enable-voms ### # Check whether --enable-voms was given. if test "${enable_voms+set}" = set; then : enableval=$enable_voms; if test "${enable_voms}" = "yes"; then # Extract the first word of "python", so it can be a program name with args. set dummy python; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_PYTHON_SPECIFIED+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$PYTHON_SPECIFIED"; then ac_cv_prog_PYTHON_SPECIFIED="$PYTHON_SPECIFIED" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_PYTHON_SPECIFIED="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_PYTHON_SPECIFIED" && ac_cv_prog_PYTHON_SPECIFIED="no" fi fi PYTHON_SPECIFIED=$ac_cv_prog_PYTHON_SPECIFIED if test -n "$PYTHON_SPECIFIED"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_SPECIFIED" >&5 $as_echo "$PYTHON_SPECIFIED" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi gfvoms_sync_targets='' { $as_echo "$as_me:${as_lineno-$LINENO}: checking voms-collaboration available" >&5 $as_echo_n "checking voms-collaboration available... " >&6; } voms_available="no" if test "${PYTHON_SPECIFIED}" = "yes" ;then py_ver=`python -V 2>&1 | sed -e 's/Python \([0-9\.]*\).*/\1/'` case $py_ver in 2.[3456].*) imp_path=`python -c "import sys; print sys.path" | sed -e 's/^\[\(.*\)\]$/\1/' | sed -e "s/[,']//g"` found=0 for d in $imp_path do if test -d $d/ZSI ; then found=1 break 1 fi done if test $found -eq 0 ; then break 1 fi found=0 for d in $imp_path do if test -d $d/_xmlplus ; then found=1 break 1 fi done if test $found -eq 0 ; then break 1 fi imp_test=`python -c "import ZSI" 2>&1` if test ${#imp_test} == 0; then gfvoms_sync_targets='${GFVOMS_SYNC_TARGETS}' voms_available="yes" fi ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${voms_available}" >&5 $as_echo "${voms_available}" >&6; } else gfvoms_sync_targets='' fi else gfvoms_sync_targets='' fi ### ### --enable-xmlattr support XML extended attributs and searching by XPath ### # Check whether --enable-xmlattr was given. if test "${enable_xmlattr+set}" = set; then : enableval=$enable_xmlattr; if test "${enable_xmlattr}" = "yes"; then $as_echo "#define ENABLE_XMLATTR 1" >>confdefs.h fi fi ### ### ns ### if test -d ${srcdir}/ns; then ns_makefiles=' ns/nslib/Makefile ns/gfarmd/Makefile ns/nstool/file/Makefile' # The following is for --srcdir option. # AC_OUTPUT() assumes that parent directory of the Makefile exists test -d ns || mkdir ns test -d ns/nstool || mkdir ns/nstool fi ### ### --with-private-srcdir ### private_srcdir='' { $as_echo "$as_me:${as_lineno-$LINENO}: checking use of private source directory" >&5 $as_echo_n "checking use of private source directory... " >&6; } # Check whether --with-private_srcdir was given. if test "${with_private_srcdir+set}" = set; then : withval=$with_private_srcdir; private_srcdir="${withval}" else private_srcdir="" fi top_private_dir='' if test "x${private_srcdir}" = "x"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: not use." >&5 $as_echo "not use." >&6; } else if test -d "${private_srcdir}"; then top_private_dir="`(cd ${private_srcdir}; /bin/pwd)`" { $as_echo "$as_me:${as_lineno-$LINENO}: result: use ${top_private_dir}" >&5 $as_echo "use ${top_private_dir}" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${private_srcdir} is not a directory." >&5 $as_echo "${private_srcdir} is not a directory." >&6; } exit 1 fi fi if test "x${top_private_dir}" = "x"; then # use public source directory. optional_config=/dev/null optional_rule='${PUBLIC_RULE}' optional_srcs='${PUBLIC_SRCS}' optional_objs='${PUBLIC_OBJS}' optional_cflags='${PUBLIC_CFLAGS}' optional_targets='${PUBLIC_TARGETS}' else # use private source directory. optional_config='${top_private_dir}/private_config.mk' optional_rule='${PRIVATE_RULE}' optional_srcs='${PRIVATE_SRCS}' optional_objs='${PRIVATE_OBJS}' optional_cflags='${PRIVATE_CFLAGS}' optional_targets='${PRIVATE_TARGETS}' fi ## ## private sources macros end here. ## # The following is for --srcdir option. # AC_OUTPUT() assumes that parent directory of the Makefile exists test -d include || mkdir include test -d gfptool || mkdir gfptool test -d package || mkdir package test -d util || mkdir util ac_config_files="$ac_config_files Makefile makes/config.mk makes/install-doc ${ns_makefiles} gftool/config-gfarm/config-gfarm gftool/config-gfarm/config-gfsd gftool/config-gfarm/config-gfarm-update gftool/gfdump/gfdump.postgresql package/solaris/gfmd package/solaris/gfsd" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error ERROR [LINENO LOG_FD] # --------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with status $?, using 1 if that was 0. as_fn_error () { as_status=$?; test $as_status -eq 0 && as_status=1 if test "$3"; then as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 fi $as_echo "$as_me: error: $1" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in #( -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.65. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Report bugs to the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.65, with options \\"\$ac_cs_config\\" Copyright (C) 2009 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "include/gfarm/gfarm_config.h") CONFIG_HEADERS="$CONFIG_HEADERS include/gfarm/gfarm_config.h" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "makes/config.mk") CONFIG_FILES="$CONFIG_FILES makes/config.mk" ;; "makes/install-doc") CONFIG_FILES="$CONFIG_FILES makes/install-doc" ;; "${ns_makefiles}") CONFIG_FILES="$CONFIG_FILES ${ns_makefiles}" ;; "gftool/config-gfarm/config-gfarm") CONFIG_FILES="$CONFIG_FILES gftool/config-gfarm/config-gfarm" ;; "gftool/config-gfarm/config-gfsd") CONFIG_FILES="$CONFIG_FILES gftool/config-gfarm/config-gfsd" ;; "gftool/config-gfarm/config-gfarm-update") CONFIG_FILES="$CONFIG_FILES gftool/config-gfarm/config-gfarm-update" ;; "gftool/gfdump/gfdump.postgresql") CONFIG_FILES="$CONFIG_FILES gftool/gfdump/gfdump.postgresql" ;; "package/solaris/gfmd") CONFIG_FILES="$CONFIG_FILES package/solaris/gfmd" ;; "package/solaris/gfsd") CONFIG_FILES="$CONFIG_FILES package/solaris/gfsd" ;; *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error "cannot create a temporary directory in ." "$LINENO" 5 # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ || as_fn_error "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_t=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_t"; then break elif $ac_last_try; then as_fn_error "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS " shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin" \ || as_fn_error "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ || as_fn_error "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out" && rm -f "$tmp/out";; *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; esac \ || as_fn_error "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" } >"$tmp/config.h" \ || as_fn_error "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$tmp/config.h" "$ac_file" \ || as_fn_error "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error "could not create -" "$LINENO" 5 fi ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit $? fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi