diff -Naur ./trunk/CHANGELOG ./maui-3.3.1/CHANGELOG --- ./trunk/CHANGELOG 2010-04-30 18:14:38.000000000 +0300 +++ ./maui-3.3.1/CHANGELOG 2010-06-01 18:39:43.692301914 +0300 @@ -1,3 +1,8 @@ +maui-3.3.1-cygwin.patch + - Added build system changes to support Cygwin (Yauheni Charniauski, UIIP Minsk) + - Added the --with-cygrunsrv configure option for start maui as Windows service (doesn't use a background daemon). + Cygwin utility cygrunsrv.exe goes it into background independently (Igor Ilyenko, UIIP Minsk) + Maui 3.3.1 - Fixed issue where hostlist was being overwritten resulting in broken $PBS_NODEFILE. (Alexis Cousein) diff -Naur ./trunk/configure ./maui-3.3.1/configure --- ./trunk/configure 2010-02-19 21:48:13.000000000 +0200 +++ ./maui-3.3.1/configure 2010-06-01 17:59:01.502302182 +0300 @@ -311,7 +311,7 @@ # include #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT LN_S SPOOLDIR MACHINE SEED OPSYS OS HOSTNAME USER BUILDDATE BUILDDIR RMTYPE LLDIR LLDEF PBSTARGETDIR SGEBUILDDIR SGEOSDIR LSFDIR LSFLIBS LSFDEFS PBSCFLAGS PBSLDFLAGS RMPORT RMHOST RMSOCKETPROTOCOL RMWIREPROTOCOL RMVERSION RMNMPORT RMNMHOST AMTYPE AMHOST AMPORT AMSOCKETPROTOCOL AMWIREPROTOCOL AMOTHER PCREDIR CPP EGREP LIBOBJS POW_LIB LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT LN_S SPOOLDIR MACHINE SEED DAEMONDEF OPSYS OS HOSTNAME USER BUILDDATE BUILDDIR RMTYPE LLDIR LLDEF PBSTARGETDIR SGEBUILDDIR SGEOSDIR LSFDIR LSFLIBS LSFDEFS PBSCFLAGS PBSLDFLAGS RMPORT RMHOST RMSOCKETPROTOCOL RMWIREPROTOCOL RMVERSION RMNMPORT RMNMHOST AMTYPE AMHOST AMPORT AMSOCKETPROTOCOL AMWIREPROTOCOL AMOTHER PCREDIR CPP EGREP LIBOBJS POW_LIB LTLIBOBJS' ac_subst_files='rm_config ll_definitions sdr_definitions pbs_definitions sge_definitions lsf_definitions mx_definitions pcre_definitions' # Initialize some variables set by options. @@ -862,6 +862,7 @@ --with-sss-am[=PORT] use SSS Allocation Manager (default port [8865]) --with-mx use MX --with-pcre[=DIR] use PCRE (pcre dir (location of PCRE include and lib directories) [/path/to/pcre] + --with-cygrunsrv run as Windows service for Cygwin (do not use a background daemon) Some influential environment variables: CC C compiler command @@ -2234,6 +2235,8 @@ { echo "$as_me:$LINENO: WARNING: Unexpected AIX level: $OSLEVEL, attempting build with OPSYS=$OPSYS" >&5 echo "$as_me: WARNING: Unexpected AIX level: $OSLEVEL, attempting build with OPSYS=$OPSYS" >&2;} fi +elif echo "$OS" | grep -q "CYGWIN"; then + OPSYS="__CYGWIN" elif test "$OS" = "Linux"; then OPSYS="__LINUX" elif test "$OS" = "HP-UX"; then @@ -2743,6 +2746,17 @@ pcre_definitions=include/Makefile.inc.pcre fi +# CYGRUNSRV + +# Check whether --with-cygrunsrv or --without-cygrunsrv was given. +if test "${with_cygrunsrv+set}" = set; then + withval="$with_cygrunsrv" + DAEMONDEF="-D__CYGRUNSRV" +else + DAEMONDEF="" +fi; + + # Make sure one RM was specified if test "$RMTYPE" = ''; then { { echo "$as_me:$LINENO: error: At least one Resource Manager must be specified" >&5 @@ -7201,6 +7215,7 @@ s,@SPOOLDIR@,$SPOOLDIR,;t t s,@MACHINE@,$MACHINE,;t t s,@SEED@,$SEED,;t t +s,@DAEMONDEF@,$DAEMONDEF,;t t s,@OPSYS@,$OPSYS,;t t s,@OS@,$OS,;t t s,@HOSTNAME@,$HOSTNAME,;t t diff -Naur ./trunk/configure.ac ./maui-3.3.1/configure.ac --- ./trunk/configure.ac 2010-02-19 21:48:13.000000000 +0200 +++ ./maui-3.3.1/configure.ac 2010-06-01 17:59:01.502302182 +0300 @@ -53,6 +53,8 @@ OSLEVEL=`oslevel` AC_MSG_WARN([Unexpected AIX level: $OSLEVEL, attempting build with OPSYS=$OPSYS]) fi +elif echo "$OS" | grep -q "CYGWIN"; then + OPSYS="__CYGWIN" elif test "$OS" = "Linux"; then OPSYS="__LINUX" elif test "$OS" = "HP-UX"; then @@ -466,6 +468,15 @@ pcre_definitions=include/Makefile.inc.pcre fi + +# CYGRUNSRV +AC_ARG_WITH(cygrunsrv, + [ --with-cygrunsrv run as Windows service for Cygwin (do not use a background daemon)], + [DAEMONDEF="-D__CYGRUNSRV"], + [DAEMONDEF=""]) +AC_SUBST(DAEMONDEF) + + # Make sure one RM was specified if test "$RMTYPE" = ''; then AC_MSG_ERROR([At least one Resource Manager must be specified]) diff -Naur ./trunk/Makefile.in ./maui-3.3.1/Makefile.in --- ./trunk/Makefile.in 2010-02-19 20:54:21.000000000 +0200 +++ ./maui-3.3.1/Makefile.in 2010-06-01 17:59:01.503186445 +0300 @@ -6,6 +6,7 @@ BUILDROOT= export MSCHED_HOME=${BUILDROOT}@SPOOLDIR@ export INST_DIR=${BUILDROOT}@prefix@ +export DAEMONDEF=@DAEMONDEF@ export OPSYS=@OPSYS@ export OS=@OS@ export CC=@CC@ diff -Naur ./trunk/README.cygwin ./maui-3.3.1/README.cygwin --- ./trunk/README.cygwin 1970-01-01 03:00:00.000000000 +0300 +++ ./maui-3.3.1/README.cygwin 2010-06-01 18:45:38.624177005 +0300 @@ -0,0 +1,87 @@ + +Checked against the Cygwin PBS Torque 2.5 realization. +Maui 3.3.1 tested with the stable release Cygwin 1.5.25 on +Windows XP Pro and on Windows Server 2003 SE (both 32-bit). +Tested with the stable release Cygwin 1.7.5 on 64-bit Windows 7 Ultimate. + +Windows file system must be NTFS!!! +Maui needs two Windows users on each host: + with Computer administrator privileges and + with Limited account. +Both users must be password protected. +Maui scheduler can run as Cygwin daemon or as Windows service. +Run as administrator (right-click) on Windows 7 and similar. + + + +########################### +### Install Cygwin ### +########################### + +Enter into Windows as user . +To install Cygwin 1.5.25 browse to http://cygwin.com/win-9x.html and click the "setup-legacy.exe" link. +Download and run setup-legacy.exe. +To install Cygwin 1.7.5 (or later) browse to http://cygwin.com and click the "Install Cygwin now" link. +Download and run setup.exe. +Click through the defaults and under the package selection +to select the following packages: + + autoconf; + automake; + cygrunsrv; + gcc or gcc4; + make; + vim or mc is desirable. + +Download and install the default's and selected Cygwin packages. + + + +################################################### +### Start Maui under Cygwin with PBS Torque ### +################################################### + +Enter into working directory as and execute the following commands: + + #./configure --with-pbs[=DIR] --with-spooldir=/var/spool/maui/ +where DIR - target directory, location of PBS Torque lib dir (as default - /usr/local) + #make + #make install + +Open the ports for Maui scheduler in your firewall. + +Start the Maui: + + #maui + +Submit jobs as with Limited account. + +See jobs information via the Maui showq command +and via the Torque qstat command. + +See more the Maui Documentations. + + + +###################################################### +### Start Maui under Cygwin as Windows service ### +###################################################### + +Enter into working directory as and execute the following commands: + + #./configure --with-cygrunsrv --with-pbs[=DIR] --with-spooldir=/var/spool/maui/ + #make + #make install + +Set additional privilege in order that user can log on as a service: + #editrights -a SeServiceLogonRight -u + +Use cygrunsrv.exe for install, start, stop and remove services. +See more cygrunsrv.exe --help. + +For example: + + #cygrunsrv.exe -I maui -p /usr/sbin/maui.exe –u -w + +Services and privileges are managed via the Windows Control Panel or command line. + diff -Naur ./trunk/src/mcom/Makefile ./maui-3.3.1/src/mcom/Makefile --- ./trunk/src/mcom/Makefile 2010-02-19 20:54:21.000000000 +0200 +++ ./maui-3.3.1/src/mcom/Makefile 2010-06-01 17:59:01.503186445 +0300 @@ -13,7 +13,7 @@ LP =-L$(LIB) $(SCHEDLP) $(MXLP) $(REGEXLP) IP =$(SCHEDIP) $(REGEXIP) $(MXIP) INCS =$(INC)moab.h $(INC)moab-proto.h - DEFS =-D$(OPSYS) $(OSDEF) $(MXDEF) $(REGEXDEF) $(SECDEF) + DEFS =-D$(OPSYS) $(OSDEF) $(MXDEF) $(REGEXDEF) $(SECDEF) $(DAEMONDEF) LIBMCOM =libmcom.a LOBJECTS =MSU.o MSec.o MS3I.o MXML.o MConst.o MTComm.o MComm.o diff -Naur ./trunk/src/moab/Makefile ./maui-3.3.1/src/moab/Makefile --- ./trunk/src/moab/Makefile 2010-02-19 20:54:21.000000000 +0200 +++ ./maui-3.3.1/src/moab/Makefile 2010-06-01 17:59:01.503186445 +0300 @@ -18,7 +18,7 @@ IP =$(SCHEDIP) $(LLIP) $(REGEXIP) $(MXIP) $(PBSCFLAGS) INCS =$(INC)moab.h $(INC)msched.h DEFS =-D$(OPSYS) $(LLDEF) $(SDRDEF) $(PBSDEF) $(OSDEF) $(MXDEF) $(REGEXDEF) \ - $(SECDEF) $(RMSDEF) $(THREADDEF) + $(SECDEF) $(RMSDEF) $(THREADDEF) $(DAEMONDEF) MOAB =libmoab.a LOBJECTS =MFile.o MConfig.o MQOS.o MLog.o MCred.o MSched.o MAM.o MSR.o MRes.o \ diff -Naur ./trunk/src/moab/MFile.c ./maui-3.3.1/src/moab/MFile.c --- ./trunk/src/moab/MFile.c 2005-09-06 22:32:22.000000000 +0300 +++ ./maui-3.3.1/src/moab/MFile.c 2010-06-01 17:59:01.503186445 +0300 @@ -1184,7 +1184,7 @@ char *LockFile) /* I */ { -#if !defined(__LINUX) && !defined(__HPUX) && !defined(__NT) +#if !defined(__LINUX) && !defined(__CYGWIN) && !defined(__HPUX) && !defined(__NT) int fd; struct flock lock; char Name[MAX_MLINE]; @@ -1197,7 +1197,7 @@ Directory, LockFile); -#if !defined(__LINUX) && !defined(__HPUX) && !defined(__NT) +#if !defined(__LINUX) && !defined(__CYGWIN) && !defined(__HPUX) && !defined(__NT) if (!strstr(LockFile,Directory)) { diff -Naur ./trunk/src/moab/MLog.c ./maui-3.3.1/src/moab/MLog.c --- ./trunk/src/moab/MLog.c 2005-07-13 00:12:53.000000000 +0300 +++ ./maui-3.3.1/src/moab/MLog.c 2010-06-01 17:59:01.503186445 +0300 @@ -82,7 +82,7 @@ if (SigSet == 0) { -# if defined(__AIX41) || defined(__AIX42) || defined(__AIX43) || defined(__IRIX) || defined(__LINUX) || defined(__HPUX) || defined(__SOLARIS) +# if defined(__AIX41) || defined(__AIX42) || defined(__AIX43) || defined(__IRIX) || defined(__LINUX) || defined(__CYGWIN) || defined(__HPUX) || defined(__SOLARIS) signal(SIGUSR1,(void(*)(int))MLogLevelAdjust); signal(SIGUSR2,(void(*)(int))MLogLevelAdjust); # else @@ -414,7 +414,7 @@ mlog.Threshold); } -#if defined(__AIX41) || defined(__AIX42) || defined(__AIX43) || defined(__IRIX) || defined(__LINUX) || defined(__HPUX) || defined(__SOLARIS) +#if defined(__AIX41) || defined(__AIX42) || defined(__AIX43) || defined(__IRIX) || defined(__LINUX) || defined(__CYGWIN) || defined(__HPUX) || defined(__SOLARIS) signal(SIGUSR1,(void(*)(int))MLogLevelAdjust); @@ -441,7 +441,7 @@ mlog.Threshold); } -#if defined(__AIX41) || defined(__AIX42) || defined(__AIX43) || defined(__IRIX) || defined(__LINUX) || defined(__HPUX) || defined(__SOLARIS) || defined(__OSF) +#if defined(__AIX41) || defined(__AIX42) || defined(__AIX43) || defined(__IRIX) || defined(__LINUX) || defined(__CYGWIN) || defined(__HPUX) || defined(__SOLARIS) || defined(__OSF) signal(SIGUSR2,(void(*)(int))MLogLevelAdjust); diff -Naur ./trunk/src/moab/MPBSI.c ./maui-3.3.1/src/moab/MPBSI.c --- ./trunk/src/moab/MPBSI.c 2010-04-30 17:59:45.000000000 +0300 +++ ./maui-3.3.1/src/moab/MPBSI.c 2010-06-01 17:59:01.504551888 +0300 @@ -2657,7 +2657,7 @@ "arch", /* the architecture of the machine */ "physmem", /* the amount of physical memory */ "loadave", /* the current load average */ -#if defined(__AIX43) || defined(__AIX51) || defined(__LINUX) || defined(__IRIX) +#if defined(__AIX43) || defined(__AIX51) || defined(__LINUX) || defined(__CYGWIN) || defined(__IRIX) "availmem", "totmem", #endif /* AIX43 || LINUX || IRIX */ diff -Naur ./trunk/src/server/Makefile ./maui-3.3.1/src/server/Makefile --- ./trunk/src/server/Makefile 2010-02-19 21:48:13.000000000 +0200 +++ ./maui-3.3.1/src/server/Makefile 2010-06-01 17:59:01.504551888 +0300 @@ -18,7 +18,7 @@ IP =$(SCHEDIP) $(LLIP) $(SGEIP) $(REGEXIP) $(MXIP) $(PBSCFLAGS) INCS =$(INC)moab.h $(INC)msched-proto.h $(INC)msched-common.h DEFS =-D$(OPSYS) $(LLDEF) $(SDRDEF) $(PBSDEF) $(OSDEF) $(MXDEF) \ - $(REGEXDEF) $(RMSDEF) $(SECDEF) $(THREADDEF) + $(REGEXDEF) $(RMSDEF) $(SECDEF) $(THREADDEF) $(DAEMONDEF) SERVER =maui SCHEDLIB =moab diff -Naur ./trunk/src/server/OServer.c ./maui-3.3.1/src/server/OServer.c --- ./trunk/src/server/OServer.c 2007-08-14 00:38:31.000000000 +0300 +++ ./maui-3.3.1/src/server/OServer.c 2010-06-01 17:59:01.504551888 +0300 @@ -5,7 +5,7 @@ { /* trap TERM(15) QUIT(3) INT(2) HUP(1) */ -#if defined(__AIX41) || defined(__AIX42) || defined(__AIX43) || defined(__AIX51) || defined(__IRIX) || defined(__LINUX) || defined(__HPUX) || defined(__SOLARIS) || defined(__OSF) || defined(__FREEBSD) +#if defined(__AIX41) || defined(__AIX42) || defined(__AIX43) || defined(__AIX51) || defined(__IRIX) || defined(__LINUX) || defined(__CYGWIN) || defined(__HPUX) || defined(__SOLARIS) || defined(__OSF) || defined(__FREEBSD) signal(SIGINT, SIG_IGN); signal(SIGTERM, (void(*)(int))MSysShutdown); @@ -120,7 +120,7 @@ } } /* END BLOCK */ -#elif defined(__LINUX) || defined(__IRIX) || defined(__HPUX) || defined(__SOLARIS) || defined(__OSF) +#elif defined(__LINUX) || defined(__CYGWIN) || defined(__IRIX) || defined(__HPUX) || defined(__SOLARIS) || defined(__OSF) ServerLoadSignalConfig(); @@ -143,8 +143,9 @@ int ServerDemonize() +{ +#ifndef __CYGRUNSRV - { #ifndef __NT int pid; #endif /* __NT */ @@ -235,6 +236,7 @@ } } /* END if (MSched.Mode != msmSim) */ +#endif /* __CYGRUNSRV */ return(SUCCESS); } /* END ServerDemonize() */ @@ -305,7 +307,7 @@ if (signo == SIGSEGV) { -#if defined(__AIX41) || defined(__AIX42) || defined(__AIX43) || defined(__AIX51) || defined(__LINUX) || defined(__HPUX) || defined(__IRIX) || defined(__SOLARIS) || defined(__OSF) || defined(__FREEBSD) +#if defined(__AIX41) || defined(__AIX42) || defined(__AIX43) || defined(__AIX51) || defined(__LINUX) || defined(__CYGWIN) || defined(__CYGWIN) || defined(__HPUX) || defined(__IRIX) || defined(__SOLARIS) || defined(__OSF) || defined(__FREEBSD) signal(SIGSEGV,(void(*)(int))CrashMode); @@ -317,7 +319,7 @@ } else if (signo == SIGILL) { -#if defined(__AIX41) || defined(__AIX42) || defined(__AIX43) || defined(__AIX51) || defined(__LINUX) || defined(__HPUX) || defined(__IRIX) || defined(__SOLARIS) || defined(__OSF) || defined(__FREEBSD) +#if defined(__AIX41) || defined(__AIX42) || defined(__AIX43) || defined(__AIX51) || defined(__LINUX) || defined(__CYGWIN) || defined(__HPUX) || defined(__IRIX) || defined(__SOLARIS) || defined(__OSF) || defined(__FREEBSD) signal(SIGILL,(void(*)(int))CrashMode); @@ -378,7 +380,7 @@ MSched.Reload = TRUE; -#if defined(__AIX41) || defined(__AIX42) || defined(__AIX43) || defined(__AIX51) || defined(__LINUX) || defined(__HPUX) || defined(__IRIX) || defined(__SOLARIS) || defined(__OSF) || defined(__FREEBSD) +#if defined(__AIX41) || defined(__AIX42) || defined(__AIX43) || defined(__AIX51) || defined(__LINUX) || defined(__CYGWIN) || defined(__HPUX) || defined(__IRIX) || defined(__SOLARIS) || defined(__OSF) || defined(__FREEBSD) signal(SIGHUP,(void(*)(int))ReloadConfig);